Add theme support variabl
This commit is contained in:
parent
8dafff1b34
commit
a88fd77fd6
14
splice
14
splice
|
@ -18,9 +18,8 @@
|
|||
console.log('BetterDiscord: Creating Themes Dir');
|
||||
fs.mkdirSync(_dataPath + "themes/");
|
||||
}
|
||||
|
||||
|
||||
|
||||
mainWindow.webContents.executeJavaScript('var themesupport = true');
|
||||
|
||||
fs.readdir(_dataPath + "plugins/",function(err,files) {
|
||||
if (err) { console.log(err); return; }
|
||||
mainWindow.webContents.executeJavaScript('var bdplugins = {};');
|
||||
|
@ -39,8 +38,7 @@
|
|||
mainWindow.webContents.executeJavaScript('(function() { var plugin = new '+pluginName+'(); bdplugins[plugin.getName()] = { "plugin": plugin, "enabled": false } })();')
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
fs.readdir(_dataPath + 'themes/', function(err, files) {
|
||||
if (err) { console.log(err); return; }
|
||||
mainWindow.webContents.executeJavaScript('var bdthemes = {};');
|
||||
|
@ -55,9 +53,9 @@
|
|||
var themeVar = meta.substring(meta.lastIndexOf('//META')+6, meta.lastIndexOf('*//'));
|
||||
var parse = JSON.parse(themeVar);
|
||||
var themeName = parse['name'];
|
||||
var themeAuthor = parse['author'];
|
||||
var themeDescription = parse['description'];
|
||||
var themeVersion = parse['version'];
|
||||
var themeAuthor = parse['author'];
|
||||
var themeDescription = parse['description'];
|
||||
var themeVersion = parse['version'];
|
||||
console.log('BetterDiscord: Loading Theme: ' + themeName);
|
||||
split.splice(0, 1);
|
||||
theme = split.join('\n');
|
||||
|
|
Loading…
Reference in New Issue