mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
convert images to base64 option added
This commit is contained in:
parent
68727b1c91
commit
36f48eb407
7 changed files with 31 additions and 10 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB |
BIN
images/dir.png
BIN
images/dir.png
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 |
BIN
images/txt.png
BIN
images/txt.png
Binary file not shown.
|
Before Width: | Height: | Size: 294 B |
|
|
@ -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...'));
|
||||
};
|
||||
}
|
||||
}
|
||||
12
style.css
12
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue