diff --git a/client.js b/client.js index d28271a5..b7c361fa 100644 --- a/client.js +++ b/client.js @@ -115,9 +115,11 @@ CloudClient.Cache.isAllowed=(function(){ * если он не поддерживаеться браузером * https://gist.github.com/350433 */ + /* CloudClient.jsload('https://raw.github.com/gist/350433/c9d3834ace63e5f5d7c8e1f6e3e2874d477cb9c1/gistfile1.js', function(){CloudClient.Cache._allowed=true; }); + */ } }); /* если доступен localStorage и diff --git a/images/console_clear.png b/images/console_clear.png new file mode 100644 index 00000000..f5739eb1 Binary files /dev/null and b/images/console_clear.png differ diff --git a/images/panel_refresh.png b/images/panel_refresh.png new file mode 100644 index 00000000..44919c2b Binary files /dev/null and b/images/panel_refresh.png differ diff --git a/images/spinner.gif b/images/spinner.gif new file mode 100644 index 00000000..88fac73d Binary files /dev/null and b/images/spinner.gif differ diff --git a/server.js b/server.js index 149e2bf4..1308333b 100644 --- a/server.js +++ b/server.js @@ -35,15 +35,7 @@ var CloudServer={ /* ПЕРЕМЕННЫЕ */ /* Поддержка браузером JS*/ - NoJS :true, - /* обьект содержит данные - * о необходимости сжатия - * данных и скриптов - */ - Minimize :{ - scriptSize:false, - styleSize:false - }, + NoJS :true, /* Поддержка gzip-сжатия * браузером */ @@ -108,32 +100,51 @@ CloudServer.Cache={ }; /* Обьект для сжатия скриптов и стилей + * по умолчанию - сжимаються */ CloudServer.Minify={ + /* приватный переключатель минимизации */ + _styleAllowed :true, + _jsAllowed :true, + /* функция разрешает или запрещает + * минимизировать стили + */ + setStyleAllowed :(function(pAllowed){ + this._styleAllowed=pAllowed; + }), + + /* функция разрешает или запрещает + * минимизировать скрипты + */ + setJSAllowed :(function(pAllowed){ + this._jsAllowed=pAllowed; + }), + scripts : function(){ - if(CloudServer.Minimize.scriptSize){ + if(this._jsAllowed){ var lMinify = require('./minify'); var lResult_b=lMinify.jsScripts(); /* if we get false, files wasn't minified * error ocured */ - CloudServer.Minify.done=(lResult_b===undefined?true:false); + this.done=(lResult_b===undefined?true:false); } }, /* свойство показывающее случилась ли ошибка*/ done: false }; -//var DirContent; + var LeftDir='/'; var RightDir=LeftDir; -//var LPrevDir; -//var RPrevDir; var Fs = require('fs'); /* модуль для работы с файловой системой*/ -var Path = require('path'); /* модуль для работы с путями*/ +/* + var Path = require('path'); +*/ /* модуль для работы с путями*/ + var Zlib = require('zlib'); /* модуль для сжатия данных gzip-ом*/ -var CloudFunc=CloudServer.Minimize.scripts?/* если стоит минификация*/ +var CloudFunc=CloudServer.Minify.done?/* если стоит минификация*/ require('./cloudfunc.min'):/* добавляем сжатый - иначе обычный */ require('./cloudfunc'); /* модуль с функциями */ @@ -141,8 +152,8 @@ var CloudFunc=CloudServer.Minimize.scripts?/* если стоит минифик /* конструктор*/ CloudServer.init=(function(){ /* Переменная в которой храниться кэш*/ - CloudServer.Cache.setAllowed(false); - CloudServer.Minimize.scriptSize=false + CloudServer.Cache.setAllowed(true); + CloudServer.Minify.setJSAllowed(true); /* Если нужно минимизируем скрипты */ CloudServer.Minify.scripts(); }); @@ -445,7 +456,7 @@ CloudServer._readDir=function (pError, pFiles) * we include minified version of * clien.js to index.html */ - (CloudServer.Minimize.scriptSize && CloudServer.Minify.done)? + (CloudServer.Minify.done)? lIndex=lIndex.replace('client.js','client.min.js'):''; lIndex=lIndex.toString().replace('