Fixed a eol bug

This commit is contained in:
Jiiks 2016-05-07 00:44:48 +03:00
parent c61af06452
commit bdf889e14f
1 changed files with 2 additions and 2 deletions

View File

@ -451,7 +451,7 @@ function loadThemes() {
return;
}
var theme = _fs.readFileSync(themePath + fileName, 'utf8');
var split = theme.split(_eol);
var split = theme.split("\n");
var meta = split[0];
if(meta.indexOf('META') < 0) {
getUtils().warn("Theme META not found in file: " + fileName);
@ -488,7 +488,7 @@ function loadThemes() {
getUtils().log("Loading theme: " + themeInfo['name']);
split.splice(0, 1);
theme = split.join(_eol);
theme = split.join("\n");
theme = theme.replace(/(\r\n|\n|\r)/gm, '');
_mainWindow.webContents.executeJavaScript('(function() { bdthemes["' + themeInfo['name'] + '"] = { "enabled": false, "name": "' + themeInfo['name'] + '", "css": "' + escape(theme) + '", "description": "' + themeInfo['description'] + '", "author":"' + themeInfo['author'] + '", "version":"' + themeInfo['version'] + '" } })();');