diff --git a/images/console_clear.png b/images/console_clear.png deleted file mode 100644 index f5739eb1..00000000 Binary files a/images/console_clear.png and /dev/null differ diff --git a/images/dir.png b/images/dir.png deleted file mode 100644 index 784e8fa4..00000000 Binary files a/images/dir.png and /dev/null differ diff --git a/images/panel_refresh.png b/images/panel_refresh.png deleted file mode 100644 index e250c871..00000000 Binary files a/images/panel_refresh.png and /dev/null differ diff --git a/images/spinner.gif b/images/spinner.gif deleted file mode 100644 index 88fac73d..00000000 Binary files a/images/spinner.gif and /dev/null differ diff --git a/images/txt.png b/images/txt.png deleted file mode 100644 index 8b8b1ca0..00000000 Binary files a/images/txt.png and /dev/null differ diff --git a/lib/server/minify.js b/lib/server/minify.js index 7680747b..4e87e163 100644 --- a/lib/server/minify.js +++ b/lib/server/minify.js @@ -81,9 +81,12 @@ exports.jsScripts=function jsScripts(){ /* функция сжимает css-стили * и сохраняет их с именем .min.css + * @pImgConvertToBase64_b - булевый признак, + * который отвечает за то, что быконвертировать + * картинки в base64 и поместить в выходной css файл */ -exports.cssStyles=function cssStyles(){ - 'use strict'; +exports.cssStyles=function cssStyles(pImgConvertToBase64_b){ + 'use strict'; /* connecting cleanCSS, * if we can't find it - @@ -213,7 +216,25 @@ exports.html=function(){ return true; }; - +/* функция переводит картинки в base64 и записывает в css-файл*/ +function base64_images(){ + 'use strict'; + var b64img; + try{ + b64img = require('css-b64-images'); + }catch(error){ + console.log('can\'n load clean-css \n' + + 'to use images to base64 convertation you need to install css-base64-images \n' + + 'npm install -g css-b64-images\n' + + 'https://github.com/GoalSmashers/clean-css'); + return false; + } + + b64img('style.min.css', '.', function(err, css){ + if(err) console.error('Error:', err); + console.log('**'+css); + }); +} /* Функция создаёт асинхроную версию * для чтения файла @@ -246,4 +267,4 @@ function fileWrited(pFileName){ return function(error){ console.log(error?error:('file '+pFileName+' writed...')); }; -} +} \ No newline at end of file diff --git a/style.css b/style.css index 0b6f9229..57136168 100644 --- a/style.css +++ b/style.css @@ -74,7 +74,7 @@ body{ top: -3px; } .loading{ - background:url(/images/spinner.gif); + background:url(/img/spinner.gif); position:relative; top:1px; } @@ -82,14 +82,14 @@ body{ color:rgba(222, 41, 41, 0.81); } .refresh-icon{ - background:url(/images/panel_refresh.png) no-repeat; + background:url(/img/panel_refresh.png) no-repeat; } .refresh-icon:active{ /*background-position-y: -15px;*/ -background:url(/images/panel_refresh.png) 0 -15px no-repeat; +background:url(/img/panel_refresh.png) 0 -15px no-repeat; } .clear-cache{ - background:url(/images/console_clear.png) -4px -4px no-repeat; + background:url(/img/console_clear.png) -4px -4px no-repeat; margin-right: 6px; margin-left: 7px; } @@ -123,13 +123,13 @@ background:url(/images/panel_refresh.png) 0 -15px no-repeat; /* freeupex */ .directory{ /*list-style-image*/ - background-image:url('/images/dir.png'); + background-image:url('/img/dir.png'); background-repeat: no-repeat; background-position: 0 0; } .text-file{ /*list-style-image*/ - background-image:url('/images/txt.png'); + background-image:url('/img/txt.png'); background-repeat: no-repeat; background-position: 0 0; }