refactored

This commit is contained in:
coderaiser 2013-01-10 09:52:19 -05:00
parent 701fefa632
commit c4fd5bc1f5
10 changed files with 74 additions and 85 deletions

View file

@ -1,12 +1,10 @@
var CloudCommander, Util, DOM, CloudFunc, Dropbox, cb, Client;
var CloudCommander, Util, DOM, Dropbox, cb, Client;
/* module for work with github */
(function(){
"use strict";
(function(CloudCmd, Util, DOM){
'use strict';
var CloudCmd = CloudCommander,
//Client,
DropBoxStore = {};
var DropBoxStore = {};
/* temporary callback function for work with github */
cb = function (err, data){ console.log(err || data);};
@ -19,8 +17,8 @@ var CloudCommander, Util, DOM, CloudFunc, Dropbox, cb, Client;
function load(pCallBack){
console.time('dropbox load');
//var lSrc = '//cdnjs.cloudflare.com/ajax/libs/dropbox.js/0.7.1/dropbox.min.js',
var lSrc = CloudCmd.LIBDIRCLIENT + 'storage/dropbox/lib/dropbox.js',
var lSrc = '//cdnjs.cloudflare.com/ajax/libs/dropbox.js/0.7.1/dropbox.min.js',
//var lSrc = CloudCmd.LIBDIRCLIENT + 'storage/dropbox/lib/dropbox.js',
lLocal = CloudCmd.LIBDIRCLIENT + 'storage/dropbox/lib/dropbox.min.js',
lOnload = function(){
console.timeEnd('dropbox load');
@ -104,4 +102,4 @@ var CloudCommander, Util, DOM, CloudFunc, Dropbox, cb, Client;
};
CloudCmd.DropBox = DropBoxStore;
})();
})(CloudCommander, Util, DOM);

View file

@ -1,11 +1,10 @@
var CloudCommander, Util, DOM, gapi;
(function(){
"use strict";
(function(CloudCmd, Util, DOM){
'use strict';
var GDrive = {};
var cloudcmd = CloudCommander,
GDrive = {};
/* PRIVATE FUNCTIONS */
@ -98,5 +97,5 @@ var CloudCommander, Util, DOM, gapi;
]);
};
cloudcmd.GDrive = GDrive;
})();
CloudCmd.GDrive = GDrive;
})(CloudCommander, Util, DOM);

View file

@ -1,11 +1,10 @@
var CloudCommander, Util, DOM, $, Github, cb;
/* module for work with github */
(function(){
(function(CloudCmd, Util, DOM){
"use strict";
var cloudcmd = CloudCommander,
Cache = DOM.Cache,
var Cache = DOM.Cache,
APIURL,
AuthURL,
@ -42,7 +41,7 @@ var CloudCommander, Util, DOM, $, Github, cb;
}
function setConfig(pCallBack){
cloudcmd.getConfig(function(pConfig){
CloudCmd.getConfig(function(pConfig){
GitHub_ID = pConfig.github_key;
APIURL = pConfig.api_url;
AuthURL = APIURL + '/auth';
@ -182,5 +181,5 @@ var CloudCommander, Util, DOM, $, Github, cb;
};
};
cloudcmd.GitHub = GitHubStore;
})();
CloudCmd.GitHub = GitHubStore;
})(CloudCommander, Util, DOM);