diff --git a/client.js b/client.js index 6165ed8e..bf955d31 100644 --- a/client.js +++ b/client.js @@ -134,9 +134,6 @@ CloudClient.Cache.clear = (function(){ /* Object contain additional system functional */ CloudClient.Util = (function(){ - - /* Load file countent thrue ajax - */ var lXMLHTTP; this.addClass = function(pElement, pClass){ @@ -162,6 +159,7 @@ CloudClient.Util = (function(){ return lRet_b; }; + /* Load file countent thrue ajax */ this.ajax = function(pParams){ /* if on webkit */ if(window.XMLHttpRequest){ @@ -311,7 +309,6 @@ CloudClient.Util = (function(){ return lElements_a; } - /* убираем путь к файлу, оставляя только название файла */ var lName = pParams_o.name, lID = pParams_o.id, lClass = pParams_o.className, @@ -322,17 +319,19 @@ CloudClient.Util = (function(){ lInner = pParams_o.inner, lNotAppend = pParams_o.not_append; + /* убираем путь к файлу, оставляя только название файла */ if(!lID && lSrc) lID = this.getIdBySrc(lSrc); var element = getById(lID); + /* если скрипт еще не загружен */ if(!element) { if(!lName && lSrc){ - var lDot = lSrc.lastIndexOf('.'); - var lExt = lSrc.substr(lDot); + var lDot = lSrc.lastIndexOf('.'), + lExt = lSrc.substr(lDot); switch(lExt){ case '.js': lName = 'script'; @@ -345,7 +344,7 @@ CloudClient.Util = (function(){ return {code: -1, text: 'name can not be empty'}; } } - element = document.createElement(lName); + element = document.createElement(lName); if(lID) element.id = lID; diff --git a/server.js b/server.js index d9a2dc0c..472bbdea 100644 --- a/server.js +++ b/server.js @@ -210,13 +210,12 @@ CloudServer.start = function (pConfig) { * @param pGzip - данные сжаты gzip'ом */ CloudServer.generateHeaders = function(pName, pGzip){ - var lType = ''; - var lCacheControl = 0; - var lContentEncoding = ''; - - /* высылаем заголовок в зависимости от типа файла */ - var lDot = pName.lastIndexOf('.'); - var lExt = pName.substr(lDot); + var lType = '', + lCacheControl = 0, + lContentEncoding = '', + + lDot = pName.lastIndexOf('.'), + lExt = pName.substr(lDot); if(lExt === '.appcache') lCacheControl = 1; @@ -234,7 +233,7 @@ CloudServer.generateHeaders = function(pName, pGzip){ if(!lCacheControl) lCacheControl = 31337 * 21; - + return { /* if type of file any, but img - * then we shoud specify charset @@ -697,7 +696,9 @@ CloudServer.indexReaded = function(pList){ } var lHeader; - /* если браузер поддерживает gzip-сжатие*/ + /* если браузер поддерживает gzip-сжатие + * высылаем заголовок в зависимости от типа файла + */ lHeader = CloudServer.generateHeaders('index.html', CloudServer.Gzip); /* если браузер поддерживает gzip-сжатие - сжимаем данные*/