@@ -3,6 +3,4 @@ storage.db | |||||
*.sublime-project | *.sublime-project | ||||
*.sublime-workspace | *.sublime-workspace | ||||
*.css | *.css | ||||
creds.js | |||||
sheetsConfig.js | |||||
!helpers/item-tooltip/styles.css | !helpers/item-tooltip/styles.css |
@@ -0,0 +1,18 @@ | |||||
define([ | |||||
], function ( | |||||
) { | |||||
return { | |||||
type: 'service_account', | |||||
project_id: '', | |||||
private_key_id: '', | |||||
private_key: '', | |||||
client_email: '', | |||||
client_id: '', | |||||
auth_uri: 'https://accounts.google.com/o/oauth2/auth', | |||||
token_uri: 'https://accounts.google.com/o/oauth2/token', | |||||
auth_provider_x509_cert_url: 'https://www.googleapis.com/oauth2/v1/certs', | |||||
client_x509_cert_url: '' | |||||
}; | |||||
}); |
@@ -14,6 +14,12 @@ define([ | |||||
records: null, | records: null, | ||||
init: function () { | init: function () { | ||||
if (sheetsConfig.roles) { | |||||
this.update = function () {}; | |||||
this.onGetRows(null, sheetsConfig.roles); | |||||
return; | |||||
} | |||||
this.doc = new googleSheets(sheetsConfig.sheetId); | this.doc = new googleSheets(sheetsConfig.sheetId); | ||||
this.doc.useServiceAccountAuth(creds, this.onAuth.bind(this)); | this.doc.useServiceAccountAuth(creds, this.onAuth.bind(this)); | ||||
}, | }, | ||||
@@ -54,8 +60,10 @@ define([ | |||||
o.messagePrefix = o.messageprefix; | o.messagePrefix = o.messageprefix; | ||||
delete o.messageprefix; | delete o.messageprefix; | ||||
o.items = JSON.parse(o.items || "[]"); | |||||
o.skins = JSON.parse(o.skins || "[]"); | |||||
if (typeof (o.items) == 'string') | |||||
o.items = JSON.parse(o.items || "[]"); | |||||
if (typeof (o.skins) == 'string') | |||||
o.skins = JSON.parse(o.skins || "[]"); | |||||
return o; | return o; | ||||
}); | }); | ||||
@@ -0,0 +1,23 @@ | |||||
define([ | |||||
], function ( | |||||
) { | |||||
return { | |||||
sheetId: '', | |||||
roles: [{ | |||||
username: 'admin', | |||||
level: 10, | |||||
messagestyle: 'color-blueA', | |||||
messageprefix: '(dev) ', | |||||
skins: ['*'], | |||||
items: [{ | |||||
type: 'key', | |||||
name: 'Key to the world', | |||||
sprite: [2, 0], | |||||
keyId: 'world' | |||||
}] | |||||
}] | |||||
}; | |||||
}); |