From 8bd2af052fe859ae96fbe661712faf96e9267f56 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 14 Nov 2012 09:36:17 -0500 Subject: [PATCH] added load spinner on keys button click --- ChangeLog | 18 +++++++++------- client.js | 36 +++++++++++++++++++++----------- cloudcmd.js | 5 +++++ config.json | 1 + lib/client/editor/_codemirror.js | 15 ++++++++----- lib/client/keyBinding.js | 10 ++++----- lib/client/viewer.js | 18 ++++++++-------- lib/util.js | 11 ++++++++++ 8 files changed, 75 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2f7f07de..62459cbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 2012.10.*, Version 0.1.8 * Added ability to shutdown Cloud Commander -thrue terminal command: "cloudcmd exit" +thru terminal command: "cloudcmd exit" * Fixed bug with showing terminal and viewer at the same time. @@ -9,7 +9,7 @@ at the same time. * Fixed bug with appcache config. Windows reads file not just like Linux. -* Added ability to update thrue git. +* Added ability to update thru git. * Added ability to change charset on terminal only if it's build in command on win32. @@ -60,7 +60,7 @@ server.js to cloudcmd.js. * Added ability of authorithation in GitHub. * Rewrited sizing of names if they are to -long thrue css, from JavaScript. +long thru css, from JavaScript. * Fixed bug with application cahe forming on windows and linux. @@ -75,7 +75,7 @@ listing in json from menu. * Util object moved from client.js to modules dom.js and util.js. -* Fixed bug with navigation thrue path panel. +* Fixed bug with navigation thru path panel. * Added functions DOM.addKeyListener and Util.loadOnLoad @@ -83,6 +83,8 @@ dom.js and util.js. * Fixed bug with config file, when no need to minification. +* Added ability to hide keys panel thru config option. + 2012.10.01, Version 0.1.7 @@ -104,7 +106,7 @@ loaded any time by any extension. * Fixed bug with getByClass IE version. * Fixed bug with keyboard not responding when go deeper -in file tree thrue mouse double click. +in file tree thru mouse double click. * Removed property keyBinded. From not it's private member of KeyBinding class. @@ -114,11 +116,11 @@ Function scrollIntoViewIfNeeded was polyfilled. * Added classic borders to panels. -* Added ability to download files thrue drag'n'drop. +* Added ability to download files thru drag'n'drop. * Fixed bug with setting current file when mouse down. -* Improved borders over CodeMirror and panels thrue css. +* Improved borders over CodeMirror and panels thru css. * Added ability to watch is file changed wile server is running @@ -145,7 +147,7 @@ disabled in browsers. * Added plagin terminal ( ` button under TAB). -* Added ability to execute commands on server thrue terminal. +* Added ability to execute commands on server thru terminal. * Added appcache paramter to config.json diff --git a/client.js b/client.js index ea009517..5e7342ae 100644 --- a/client.js +++ b/client.js @@ -73,7 +73,7 @@ CloudFunc, $, KeyBinding, * function load modules * @pParams = {name, path, func, dobefore, arg} */ -var loadModule = function(pParams){ +var loadModule = function(pParams){ if(!pParams) return; var lName = pParams.name, @@ -98,7 +98,7 @@ var loadModule = function(pParams){ if( !Util.isContainStr(lPath, '.js') ) lPath += '.js'; - cloudcmd[lName] = function(pArg){ + cloudcmd[lName] = function(pArg){ Util.exec(lDoBefore); return DOM.jsload(cloudcmd.LIBDIRCLIENT + lPath, lFunc || @@ -418,9 +418,21 @@ function initModules(pCallBack){ DOM.ajax({ url:'/modules.json', success: function(pModules){ + var lFunc = Util.retFunc( DOM.Images.showLoad ), + lDoBefore = { + 'viewer' : lFunc, + "editor/_codemirror" : lFunc + }; + if( Util.isArray(pModules) ) - for(var i = 0, n = pModules.length; i < n ; i++) - loadModule(pModules[i]); + for(var i = 0, n = pModules.length; i < n ; i++){ + var lModule = pModules[i]; + + loadModule({ + path: lModule, + dobefore: lDoBefore[lModule] + }); + } Util.exec(pCallBack); } @@ -430,14 +442,14 @@ function initModules(pCallBack){ function initCmdButtons(pCallBack){ var lFuncs =[ null, - null, /* f1 */ - null, /* f2 */ - cloudcmd.Viewer, /* f3 */ - cloudcmd.Editor, /* f4 */ - null, /* f5 */ - null, /* f6 */ - null, /* f7 */ - null, /* f8 */ + null, /* f1 */ + null, /* f2 */ + cloudcmd.Viewer, /* f3 */ + cloudcmd.Editor, /* f4 */ + null, /* f5 */ + null, /* f6 */ + null, /* f7 */ + null, /* f8 */ ]; for(var i = 1; i <= 8; i++) getById('f' + i).onclick = lFuncs[i]; diff --git a/cloudcmd.js b/cloudcmd.js index 38263abc..b887772f 100644 --- a/cloudcmd.js +++ b/cloudcmd.js @@ -47,6 +47,11 @@ if(!srv.Config.appcache) pIndex = Util.removeStr(pIndex, ' manifest=/cloudcmd.appcache'); + if(!srv.Config.show_keys_panel){ + var lKeysPanel = '