added ability to run dropbox chooser on <ctr> + <d>

This commit is contained in:
coderaiser 2012-12-04 05:17:01 -05:00
parent 65a35b4a60
commit 2693eba31c
8 changed files with 47 additions and 18 deletions

View file

@ -152,6 +152,8 @@ Added dropbox_id option.
* Fixed bug in github show function.
* Added ability to call dropbox chooser on <ctr> + <d>.
2012.10.01, Version 0.1.7

View file

@ -3,13 +3,15 @@
"appcache" : false,
"minification" : {
"js" : false,
"css" : true,
"css" : false,
"html" : false,
"img" : true
"img" : false
},
"github_id" : "891c251b925e4e967fa9",
"github_secret" : "afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545",
"dropbox_id" : "o7d6llji052vijk",
"github_id" : "891c251b925e4e967fa9",
"github_secret" : "afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545",
"dropbox_id" : "0nd3ssnp5fp7tqs",
"dropbox_secret" : "r61lxpchmk8l06o",
"dropbox_chooser_id" : "o7d6llji052vijk",
"show_keys_panel" : true,
"server" : true,
"logs" : false,

View file

@ -97,8 +97,9 @@ var loadModule = function(pParams){
if( !Util.isContainStr(lPath, '.js') )
lPath += '.js';
cloudcmd[lName] = function(pArg){
Util.exec(lDoBefore);
cloudcmd[lName] = function(pArg){
lPath = Util.exec(lDoBefore) || lPath;
return DOM.jsload(cloudcmd.LIBDIRCLIENT + lPath, lFunc ||
function(){
@ -343,6 +344,9 @@ function initModules(pCallBack){
DOM.ajax({
url:'/modules.json',
success: function(pModules){
const DROPBOX = 'storage/_dropbox',
GITHUB = 'storage/_github';
var lShowLoadFunc = Util.retFunc( DOM.Images.showLoad ),
lDisableMenuFunc = function(){
var lFunc = document.oncontextmenu;
@ -351,12 +355,32 @@ function initModules(pCallBack){
return cloudcmd.Menu.ENABLED || false;
};
},
lStorage = function(){
const lKEY = cloudcmd.KEY;
var lRet = false;
switch(event.keyCode){
case lKEY.G:
lRet = GITHUB;
break;
case lKEY.D:
lRet = DROPBOX;
break;
}
return lRet && (lRet + '.js');
},
lDoBefore = {
'viewer' : lShowLoadFunc,
'editor/_codemirror' : lShowLoadFunc,
'menu' : lDisableMenuFunc
'menu' : lDisableMenuFunc,
'viewer' : lShowLoadFunc
};
lDoBefore[GITHUB] =
lDoBefore[DROPBOX] = lStorage;
lDisableMenuFunc();

View file

@ -78,8 +78,10 @@ var CloudCommander, Util, DOM;
Util.exec(cloudcmd.Config);
}
else if(lKeyCode === KEY.G && event.altKey)
else if( (lKeyCode === KEY.G || lKeyCode === KEY.D) && event.altKey){
Util.exec(cloudcmd.Storage);
event.preventDefault();
}
/* если нажали таб:
* переносим курсор на

View file

@ -16,8 +16,7 @@ var CloudCommander, DOM, Dropbox; //o7d6llji052vijk
console.log('Chose something');
}
};
cloudcmd.Storage = {};
/* PRIVATE FUNCTIONS */

View file

@ -14,8 +14,7 @@ var CloudCommander, Util, DOM, $, Github, cb;
GithubLocal,
User,
GithubStore = {};
cloudcmd.Storage = {};
/* temporary callback function for work with github */
cb = function (err, data){ console.log(err || data);};

View file

@ -350,7 +350,7 @@ var Util, exports;
* @param pCallBack
* @param pArg
*/
Util.exec = function(pCallBack, pArg){
Util.exec = function(pCallBack, pArg){
var lRet = false;
if( Util.isFunction(pCallBack) )
@ -362,7 +362,7 @@ var Util, exports;
/**
* Gets current time in format hh:mm:ss
*/
Util.getTime = function(){
Util.getTime = function(){
var date = new Date(),
hours = date.getHours(),
minutes = date.getMinutes(),

View file

@ -1,7 +1,8 @@
[
"editor/_codemirror",
"menu",
"viewer",
"storage/_github",
"terminal",
"menu"
"storage/_dropbox",
"terminal"
]