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

@ -154,6 +154,8 @@ Added dropbox_id option.
* Added ability to call dropbox chooser on <ctr> + <d>.
* Added ability to read dropbox key from config.
2012.10.01, Version 0.1.7

View file

@ -9,9 +9,9 @@
},
"github_id" : "891c251b925e4e967fa9",
"github_secret" : "afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545",
"dropbox_id" : "0nd3ssnp5fp7tqs",
"dropbox_key" : "0nd3ssnp5fp7tqs",
"dropbox_secret" : "r61lxpchmk8l06o",
"dropbox_chooser_id" : "o7d6llji052vijk",
"dropbox_chooser_key" : "o7d6llji052vijk",
"show_keys_panel" : true,
"server" : true,
"logs" : false,

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',