diff --git a/lib/client/key.js b/lib/client/key.js index e1bfdd75..aff95f32 100644 --- a/lib/client/key.js +++ b/lib/client/key.js @@ -1,5 +1,5 @@ var CloudCmd, Util, DOM; -(function(CloudCmd, Util, DOM){ +(function(CloudCmd, Util, DOM) { 'use strict'; var KEY = { @@ -46,7 +46,7 @@ var CloudCmd, Util, DOM; KeyProto.prototype = KEY; CloudCmd.Key = new KeyProto(CloudCmd, Util, DOM); - function KeyProto(CloudCmd, Util, DOM){ + function KeyProto(CloudCmd, Util, DOM) { var Key = this, Binded, lTabPanel = { @@ -55,20 +55,20 @@ var CloudCmd, Util, DOM; }; - this.isBind = function(){return Binded;}; + this.isBind = function() {return Binded;}; - this.setBind = function(){Binded = true;}; + this.setBind = function() {Binded = true;}; - this.unsetBind = function(){Binded = false;}; + this.unsetBind = function() {Binded = false;}; - this.bind = function(){ + this.bind = function() { DOM.Events.addKey(listener); /* клавиши назначены*/ Binded = true; }; - function listener(pEvent){ + function listener(pEvent) { /* получаем выдленный файл*/ var i, n, lCurrent = DOM.getCurrentFile(), lKeyCode = pEvent.keyCode, @@ -76,8 +76,8 @@ var CloudCmd, Util, DOM; lAlt = pEvent.altKey, lCtrl = pEvent.ctrlKey; /* если клавиши можно обрабатывать*/ - if(Binded){ - switch(lKeyCode){ + if (Binded) { + switch (lKeyCode) { case Key.TAB: /* changing parent panel of curent-file */ var lPanel = DOM.getPanel(), @@ -88,7 +88,7 @@ var CloudCmd, Util, DOM; lPanel = DOM.getPanel({active:false}); lId = lPanel.id; - if(lTabPanel[lId]) + if (lTabPanel[lId]) DOM.setCurrentFile(lTabPanel[lId]); else{ var lFirstFileOnList = DOM.getByTag('li', lPanel)[2]; @@ -105,13 +105,13 @@ var CloudCmd, Util, DOM; break; case Key.DELETE: - if(lShift){ + if (lShift) { var lUrl = DOM.getCurrentPath(lCurrent); - if( DOM.isCurrentIsDir(lCurrent) ) + if ( DOM.isCurrentIsDir(lCurrent) ) lUrl += '?dir'; - DOM.RESTfull.delete(lUrl, function(){ + DOM.RESTfull.delete(lUrl, function() { DOM.deleteCurrent(lCurrent); }); } @@ -244,8 +244,8 @@ var CloudCmd, Util, DOM; DOM.scrollByPages(DOM.getPanel(), -1); var lC = lCurrent, - tryCatch = function(pCurrentFile){ - Util.tryCatch(function(){ + tryCatch = function(pCurrentFile) { + Util.tryCatch(function() { return pCurrentFile .previousSibling .previousSibling @@ -254,7 +254,7 @@ var CloudCmd, Util, DOM; }); }; - for (i = 0; i < 30; i++){ + for (i = 0; i < 30; i++) { if (!lC.previousSibling || tryCatch(lC) ) break; lC = lC.previousSibling; @@ -331,7 +331,7 @@ var CloudCmd, Util, DOM; /* устанавливаем все обработчики * нажатий клавиш */ - else if(lKeyCode === Key.S && lAlt){ + else if (lKeyCode === Key.S && lAlt) { /* обрабатываем нажатия на клавиши*/ Binded = true; Util.log('+s pressed \n' +