From 13aa3f769f9dff382fcfbdf6717b911332c9233f Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 22 Jan 2013 06:38:31 -0500 Subject: [PATCH] refactored --- html/index.html | 8 ++++---- lib/client.js | 5 ++--- lib/client/dom.js | 2 +- lib/client/ie.js | 16 +++++++++------- lib/server/main.js | 6 +++--- lib/util.js | 2 +- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/html/index.html b/html/index.html index 85d13d8c..6bba869f 100644 --- a/html/index.html +++ b/html/index.html @@ -36,11 +36,11 @@ - - + \ No newline at end of file diff --git a/lib/client.js b/lib/client.js index 37aa6a81..55e45545 100644 --- a/lib/client.js +++ b/lib/client.js @@ -324,7 +324,7 @@ function initKeysPanel(pCallBack){ } function baseInit(pCallBack){ - if(applicationCache){ + if(window.applicationCache){ var lFunc = applicationCache.onupdateready; applicationCache.onupdateready = function(){ @@ -760,8 +760,7 @@ return CloudCmd; })(); -DOM.addOneTimeListener('load', function cloudcmdLoad(){ - DOM.removeListener('load', cloudcmdLoad); +DOM.addOneTimeListener('load', function(){ /* базовая инициализация*/ CloudCommander.init(); diff --git a/lib/client/dom.js b/lib/client/dom.js index bcea7207..a5b97984 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -3,7 +3,7 @@ var CloudCommander, Util, CloudFunc; (function(Util, DOM){ - "use strict"; + 'use strict'; /* PRIVATE */ diff --git a/lib/client/ie.js b/lib/client/ie.js index b58e60b6..f943a0cc 100644 --- a/lib/client/ie.js +++ b/lib/client/ie.js @@ -1,9 +1,12 @@ /* script, fixes ie */ -var Util, DOM, $; +//var Util, DOM, jQuery; (function(Util, DOM, $){ - "use strict"; + 'use strict'; + if(!window.XMLHttpRequest || !document.head) + DOM.ajax = $.ajax; + /* setting head ie6 - ie8 */ if(!document.head){ document.head = $('head')[0]; @@ -49,7 +52,7 @@ var Util, DOM, $; return $(pElement || window).bind(pType, null, pListener); }; - if(document.removeEventListener){ + if(!document.removeEventListener){ DOM.removeListener = function(pType, pListener, pCapture, pElement){ return $(pElement || window).unbind(pType, pListener); }; @@ -70,6 +73,8 @@ var Util, DOM, $; /* function polyfill webkit standart function */ DOM.scrollIntoViewIfNeeded = function(pElement, centerIfNeeded){ + if(!window.getComputedStyle) + return; /* https://gist.github.com/2581101 */ @@ -146,9 +151,6 @@ var Util, DOM, $; }; } - if(!window.XMLHttpRequest) - DOM.ajax = $.ajax; - if(!window.JSON){ Util.parseJSON = $.parseJSON; @@ -249,4 +251,4 @@ var Util, DOM, $; } -})(Util, DOM, $); \ No newline at end of file +})(Util, DOM, jQuery); \ No newline at end of file diff --git a/lib/server/main.js b/lib/server/main.js index 2de3ea00..ee49127a 100644 --- a/lib/server/main.js +++ b/lib/server/main.js @@ -132,10 +132,10 @@ * @param pGzip - данные сжаты gzip'ом */ function generateHeaders(pName, pGzip, pQuery){ - var lType = '', - lCacheControl = 0, + var lRet, + lType = '', lContentEncoding = '', - lRet, + lCacheControl = 0, lDot = pName.lastIndexOf('.'), lExt = pName.substr(lDot); diff --git a/lib/util.js b/lib/util.js index c1af6b16..03db79c9 100644 --- a/lib/util.js +++ b/lib/util.js @@ -6,7 +6,7 @@ var Util, exports; Util = exports || {}; (function(Util){ - "use strict"; + 'use strict'; var Scope = exports ? global : window;