diff --git a/css/style.css b/css/style.css index 864a0a76..d930bd50 100644 --- a/css/style.css +++ b/css/style.css @@ -181,10 +181,10 @@ body{ font-weight: bold; } #path{ - margin-left:1.5%; + margin-left:1.5%; } -#left{ - float:left; +.left, #left{ + float:left; } /* фон файла, на котором курсор*/ .current-file{ @@ -192,9 +192,11 @@ body{ } .selected-file{ color:white; + background-color: rgb(49, 123, 249); background-color: rgba(49, 123, 249, .40); } -#right{ + +.right, #right{ float:right; } .panel{ diff --git a/lib/client/dom.js b/lib/client/dom.js index 50cb86a9..e598b802 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -99,11 +99,15 @@ var CloudCommander, Util, DOM, CloudFunc; * @param pElement {document by default} */ DOM.addListener = function(pType, pListener, pUseCapture, pElement){ - return (pElement || document).addEventListener( + var lRet = this; + + (pElement || document).addEventListener( pType, pListener, pUseCapture || false ); + + return lRet; }; /** @@ -111,7 +115,7 @@ var CloudCommander, Util, DOM, CloudFunc; * @param pListener * @param pUseCapture */ - DOM.addKeyListener = function(pListener, pUseCapture){ + DOM.addKeyListener = function(pListener, pUseCapture){ return DOM.addListener('keydown', pListener, pUseCapture); }; @@ -288,6 +292,8 @@ var CloudCommander, Util, DOM, CloudFunc; * @param pFunc - onload function */ DOM.anyLoadOnLoad = function(pParams_a, pFunc){ + var lRet = this; + if( Util.isArray(pParams_a) ) { var lParam = pParams_a.pop(), lFunc = function(){ @@ -309,6 +315,8 @@ var CloudCommander, Util, DOM, CloudFunc; }else Util.exec(pFunc); } + + return lRet; }; /** @@ -320,7 +328,7 @@ var CloudCommander, Util, DOM, CloudFunc; * @param pFunc - onload function */ DOM.anyLoadInParallel = function(pParams_a, pFunc){ - var lRet = Util.isArray(pParams_a), + var lRet = this, done = [], doneFunc = function (pCallBack){ @@ -330,7 +338,7 @@ var CloudCommander, Util, DOM, CloudFunc; Util.exec(pFunc); }; - if(!lRet){ + if( !Util.isArray(pParams_a) ){ pParams_a = [pParams_a]; } @@ -347,8 +355,6 @@ var CloudCommander, Util, DOM, CloudFunc; lParam.func = Util.retExec(doneFunc, lFunc); DOM.anyload(lParam); - - lRet = true; } } diff --git a/lib/client/editor/_codemirror.js b/lib/client/editor/_codemirror.js index aa2d8215..2bd58096 100644 --- a/lib/client/editor/_codemirror.js +++ b/lib/client/editor/_codemirror.js @@ -21,22 +21,22 @@ var CloudCommander, Util, DOM, CloudFunc, CodeMirror; /* private functions */ function setCSS(){ - return DOM.cssSet({ + var lPosition = DOM.getPanel().id, + lRet = DOM.cssSet({ id : 'editor', inner : '.CodeMirror{' + 'font-family' + ': \'Droid Sans Mono\';' + 'font-size' + ': 15px;' + - /* codemirror v3 */ - //'height : ' + cloudcmd.HEIGHT + 'px' + '}' + '.CodeMirror-scroll{' + 'height' + ':' + cloudcmd.HEIGHT + 'px' + '}' + '#CodeMirrorEditor{' + - 'float' + ':' + DOM.getPanel().id + - // 'padding :20px 20px 20px 20px;' + + 'float' + ':' + lPosition + '}' }); + + return lRet; } /** @@ -83,27 +83,26 @@ var CloudCommander, Util, DOM, CloudFunc, CodeMirror; */ function load(pCallBack){ console.time('codemirror load'); - var lDir = cloudcmd.LIBDIRCLIENT + 'editor/codemirror/'; - - DOM.anyLoadOnLoad( - [ + var lDir = cloudcmd.LIBDIRCLIENT + 'editor/codemirror/', + lFiles = [ - lDir + 'codemirror.css', - lDir + 'theme/night.css', - lDir + 'mode/javascript.js', - ], - - lDir + 'codemirror.js' - ], - - function(){ - console.timeEnd('codemirror load'); - CodeMirrorLoaded = true; - Util.exec(pCallBack); - }); - - } + [ + lDir + 'codemirror.css', + lDir + 'theme/night.css', + lDir + 'mode/javascript.js', + ], + + lDir + 'codemirror.js' + ]; + DOM.anyLoadOnLoad(lFiles, function(){ + console.timeEnd('codemirror load'); + CodeMirrorLoaded = true; + Util.exec(pCallBack); + }); + + } + /** * function shows CodeMirror editor */ @@ -235,9 +234,8 @@ var CloudCommander, Util, DOM, CloudFunc, CodeMirror; }; /* добавляем обработчик клавишь */ - DOM.addKeyListener( lKeyListener ); - - DOM.setButtonKey('f4', lEditor); + DOM.addKeyListener( lKeyListener ) + .setButtonKey('f4', lEditor); }; cloudcmd.Editor.CodeMirror = CodeMirrorEditor; diff --git a/lib/client/ie.js b/lib/client/ie.js index 708558fc..45136ac7 100644 --- a/lib/client/ie.js +++ b/lib/client/ie.js @@ -46,13 +46,16 @@ var Util, DOM, $; * @param pListener */ DOM.addListener = function(pType, pListener){ - var lType = 'on' + pType, + var lRet = this, + lType = 'on' + pType, lFunc = document[lType]; document[lType] = function(){ Util.exec(lFunc); pListener(); }; + + return lRet; }; if(!document.getElementsByClassName){ diff --git a/lib/client/viewer.js b/lib/client/viewer.js index 9237d355..194e143b 100644 --- a/lib/client/viewer.js +++ b/lib/client/viewer.js @@ -96,19 +96,16 @@ var CloudCommander, Util, DOM, CloudFunc, $; */ FancyBox.load = function(pCallBack){ console.time('fancybox load'); - var lDir = cloudcmd.LIBDIRCLIENT + 'viewer/fancybox/'; + var lDir = cloudcmd.LIBDIRCLIENT + 'viewer/fancybox/', + lFiles = [ lDir + 'jquery.fancybox.css', + lDir + 'jquery.fancybox.js' ]; - DOM.anyLoadInParallel([ - lDir + 'jquery.fancybox.css', - lDir + 'jquery.fancybox.js'], - - function(){ - console.timeEnd('fancybox load'); - pCallBack(); - }); - - DOM.cssSet({id:'viewer', + DOM.anyLoadInParallel(lFiles, function(){ + console.timeEnd('fancybox load'); + pCallBack(); + }) + .cssSet({id:'viewer', inner : '#CloudViewer{' + 'font-size: 16px;' + 'white-space :pre' + @@ -215,9 +212,8 @@ var CloudCommander, Util, DOM, CloudFunc, $; }; /* добавляем обработчик клавишь */ - DOM.addKeyListener(lKeyListener); - - DOM.setButtonKey('f3', lView); + DOM.addKeyListener(lKeyListener) + .setButtonKey('f3', lView); }; cloudcmd.Viewer.FancyBox = FancyBox;