convert images to base64 option added

This commit is contained in:
coderaiser 2012-06-15 13:06:32 +00:00
parent 68727b1c91
commit 36f48eb407
7 changed files with 31 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 B

View file

@ -81,9 +81,12 @@ exports.jsScripts=function jsScripts(){
/* функция сжимает css-стили /* функция сжимает css-стили
* и сохраняет их с именем .min.css * и сохраняет их с именем .min.css
* @pImgConvertToBase64_b - булевый признак,
* который отвечает за то, что быконвертировать
* картинки в base64 и поместить в выходной css файл
*/ */
exports.cssStyles=function cssStyles(){ exports.cssStyles=function cssStyles(pImgConvertToBase64_b){
'use strict'; 'use strict';
/* connecting cleanCSS, /* connecting cleanCSS,
* if we can't find it - * if we can't find it -
@ -213,7 +216,25 @@ exports.html=function(){
return true; 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){ return function(error){
console.log(error?error:('file '+pFileName+' writed...')); console.log(error?error:('file '+pFileName+' writed...'));
}; };
} }

View file

@ -74,7 +74,7 @@ body{
top: -3px; top: -3px;
} }
.loading{ .loading{
background:url(/images/spinner.gif); background:url(/img/spinner.gif);
position:relative; position:relative;
top:1px; top:1px;
} }
@ -82,14 +82,14 @@ body{
color:rgba(222, 41, 41, 0.81); color:rgba(222, 41, 41, 0.81);
} }
.refresh-icon{ .refresh-icon{
background:url(/images/panel_refresh.png) no-repeat; background:url(/img/panel_refresh.png) no-repeat;
} }
.refresh-icon:active{ .refresh-icon:active{
/*background-position-y: -15px;*/ /*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{ .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-right: 6px;
margin-left: 7px; margin-left: 7px;
} }
@ -123,13 +123,13 @@ background:url(/images/panel_refresh.png) 0 -15px no-repeat;
/* freeupex */ /* freeupex */
.directory{ .directory{
/*list-style-image*/ /*list-style-image*/
background-image:url('/images/dir.png'); background-image:url('/img/dir.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 0 0; background-position: 0 0;
} }
.text-file{ .text-file{
/*list-style-image*/ /*list-style-image*/
background-image:url('/images/txt.png'); background-image:url('/img/txt.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 0 0; background-position: 0 0;
} }