added ability to read dropbox key from config

This commit is contained in:
coderaiser 2012-12-04 09:46:15 -05:00
parent d1725757d2
commit 2f30bfda6a
5 changed files with 21 additions and 13 deletions

View file

@ -484,7 +484,7 @@ function baseInit(pCallBack){
cloudcmd.KeyBinding();
}
CloudClient.loadConfig = function(pCallBack){
CloudClient.getConfig = function(pCallBack){
if(!cloudcmd.Config)
return DOM.ajax({
url:'/config.json',
@ -494,6 +494,8 @@ CloudClient.loadConfig = function(pCallBack){
Util.exec(pCallBack, pConfig);
}
});
else
Util.exec(pCallBack, cloudcmd.Config);
};

View file

@ -26,16 +26,20 @@ var CloudCommander, Util, DOM, Dropbox;
function load(){
console.time('dropbox load');
var lElement = DOM.anyload({
src : 'https://www.dropbox.com/static/api/1/dropbox.js',
not_append : true,
id : 'dropboxjs',
func : DropBoxStore.choose
cloudcmd.getConfig(function(pConfig){
var lElement = DOM.anyload({
src : 'https://www.dropbox.com/static/api/1/dropbox.js',
not_append : true,
id : 'dropboxjs',
func : DropBoxStore.choose
});
var lDropBoxId = pConfig.dropbox_chooser_key;
lElement.setAttribute('data-app-key', lDropBoxId);
document.body.appendChild(lElement);
console.timeEnd('dropbox load');
});
lElement.setAttribute('data-app-key', 'o7d6llji052vijk');
document.body.appendChild(lElement);
}
DropBoxStore.choose = function(){

View file

@ -4,7 +4,7 @@ var CloudCommander, Util, DOM, $, Github, cb;
(function(){
"use strict";
const cloudcmd = CloudCommander,
const cloudcmd = CloudCommander,
Cache = DOM.Cache,
APIURL = '/api/v1',