diff --git a/client.js b/client.js index cbc1608f..cb428764 100644 --- a/client.js +++ b/client.js @@ -536,7 +536,7 @@ CloudClient.Util = (function(){ lLoadingImage = LImages_o.loading(); lErrorImage = LImages_o.error(); - lErrorImage.className = 'icon error hidden'; + Util.hide(lErrorImage); var lCurrent; if(pPosition){ @@ -565,7 +565,7 @@ CloudClient.Util = (function(){ (lParent && lParent !== lCurrent)) lCurrent.appendChild(lLoadingImage); - lLoadingImage.className = 'icon loading'; /* показываем загрузку*/ + Util.show(lLoadingImage); /* показываем загрузку*/ } return lRet_b; @@ -573,7 +573,7 @@ CloudClient.Util = (function(){ hideLoad : function(){ lLoadingImage = LImages_o.loading(); - lLoadingImage.className ='hidden'; + Util.hide(lLoadingImage); }, showError : function(jqXHR, textStatus, errorThrown){ @@ -594,14 +594,14 @@ CloudClient.Util = (function(){ else if(!lText.indexOf('Error: EACCES,')) lText = lText.replace('Error: EACCES, p','P'); - lErrorImage.className='icon error'; + Util.show(lErrorImage); lErrorImage.title = lText; var lParent = lLoadingImage.parentElement; if(lParent) lParent.appendChild(lErrorImage); - lLoadingImage.className ='hidden'; + Util.hide(lLoadingImage); console.log(lText); } @@ -767,34 +767,44 @@ CloudClient.Util = (function(){ return lPanel; }; - + this.show = function(pElement){ - if(pElement.className) - pElement.className = pElement.className.replace(' hidden', ''); - else - pElement.className = ''; + var lClassList = pElement.classList; + if(lClassList) + lClassList.remove('hidden'); + else{ + if(pElement.className) + pElement.className = pElement.className.replace(' hidden', ''); + else + pElement.className = ''; + } }; this.showPanel = function(pActive){ var lPanel = lThis.getPanel(pActive); if(lPanel) - lPanel.className = 'panel'; + this.show(lPanel); }; this.hidePanel = function(pActive){ var lPanel = lThis.getPanel(pActive); if(lPanel) - lPanel.className = 'panel hidden'; + this.hide(lPanel); }; this.hide = function(pElement){ - var lSpaceChar = ''; - if(pElement.className) - lSpaceChar = ' '; - pElement.className += lSpaceChar + 'hidden'; - }; + var lClassList = pElement.classList; + if(lClassList) + lClassList.add('hidden'); + else{ + var lSpaceChar = ''; + if(pElement.className) + lSpaceChar = ' '; + pElement.className += lSpaceChar + 'hidden'; + } + }; this.removeCurrent = function(pCurrent){ var lParent = pCurrent.parentElement; @@ -1167,12 +1177,7 @@ CloudClient.baseInit = (function(){ var lFM = getById('fm'); if(lFM) lFM.className='localstorage'; - - /* если есть js - показываем правую панель */ - var lRight=getById('right'); - if(lRight) - lRight.className = lRight.className.replace('hidden',''); - + /* формируем и округляем высоту экрана * при разрешениии 1024x1280: * 658 -> 700 diff --git a/lib/client/editor.js b/lib/client/editor.js index 96d1f8bc..6a241a4c 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -175,7 +175,7 @@ var CloudCommander, CloudFunc, CodeMirror; var lCloudEditor = Util.getById('CloudEditor'); if(lCloudEditor){ - lCloudEditor.className = 'hidden'; + Util.hide(lCloudEditor); var lCodeMirror = Util.getByClass('CodeMirror', lCloudEditor); if(lCodeMirror.length) diff --git a/lib/client/terminal.js b/lib/client/terminal.js index 7367727a..73e2d756 100644 --- a/lib/client/terminal.js +++ b/lib/client/terminal.js @@ -38,8 +38,7 @@ var CloudCommander, $; prompt : 'cloudcmd> ' }); }); - - Util.Images.hideLoad(); + JqueryTerminal.show(); }); }; @@ -65,6 +64,8 @@ var CloudCommander, $; }); JqueryTerminal.show = (function(){ + Util.Images.hideLoad(); + Hidden = false; Util.hidePanel(); diff --git a/lib/client/viewer.js b/lib/client/viewer.js index 1361c445..3b12ec1f 100644 --- a/lib/client/viewer.js +++ b/lib/client/viewer.js @@ -75,9 +75,12 @@ var CloudCommander, CloudFunc, $; 'white-space :pre' + '}' + '#CloudViewer::selection{' + - 'background: #fe57a1;' + - 'color: #fff;' + - 'text-shadow: none;' + + /* + 'background: #fe57a1;' + 'color: #fff;' + */ + 'background: #b3d4fc;' + + 'text-shadow: none;' + '}' });