Merge pull request #181 from JsSucks/css-editor-path
Dist path for css editor
This commit is contained in:
commit
86fc492af4
|
@ -27,6 +27,9 @@ const _extPath = tests
|
||||||
const _pluginPath = path.resolve(_extPath, 'plugins');
|
const _pluginPath = path.resolve(_extPath, 'plugins');
|
||||||
const _themePath = path.resolve(_extPath, 'themes');
|
const _themePath = path.resolve(_extPath, 'themes');
|
||||||
const _modulePath = path.resolve(_extPath, 'modules');
|
const _modulePath = path.resolve(_extPath, 'modules');
|
||||||
|
const _cssEditorPath = tests
|
||||||
|
? path.resolve(__dirname, '..', '..', '..', 'csseditor', 'dist')
|
||||||
|
: path.resolve(__dirname, 'csseditor');
|
||||||
|
|
||||||
const paths = [
|
const paths = [
|
||||||
{ id: 'cs', path: _clientScript.replace(/\\/g, '/') },
|
{ id: 'cs', path: _clientScript.replace(/\\/g, '/') },
|
||||||
|
@ -34,7 +37,8 @@ const paths = [
|
||||||
{ id: 'ext', path: _extPath.replace(/\\/g, '/') },
|
{ id: 'ext', path: _extPath.replace(/\\/g, '/') },
|
||||||
{ id: 'plugins', path: _pluginPath.replace(/\\/g, '/') },
|
{ id: 'plugins', path: _pluginPath.replace(/\\/g, '/') },
|
||||||
{ id: 'themes', path: _themePath.replace(/\\/g, '/') },
|
{ id: 'themes', path: _themePath.replace(/\\/g, '/') },
|
||||||
{ id: 'modules', path: _modulePath.replace(/\\/g, '/') }
|
{ id: 'modules', path: _modulePath.replace(/\\/g, '/') },
|
||||||
|
{ id: 'csseditor', path: _cssEditorPath.replace(/\\/g, '/') }
|
||||||
];
|
];
|
||||||
|
|
||||||
const sparkplug = path.resolve(__dirname, 'sparkplug.js').replace(/\\/g, '/');
|
const sparkplug = path.resolve(__dirname, 'sparkplug.js').replace(/\\/g, '/');
|
||||||
|
@ -138,7 +142,7 @@ class BetterDiscord {
|
||||||
const window = await this.waitForWindow();
|
const window = await this.waitForWindow();
|
||||||
this.windowUtils = new WindowUtils({ window });
|
this.windowUtils = new WindowUtils({ window });
|
||||||
|
|
||||||
this.csseditor = new CSSEditor(this);
|
this.csseditor = new CSSEditor(this, paths.find(path => path.id === 'csseditor').path);
|
||||||
|
|
||||||
this.windowUtils.events('did-get-response-details', () => this.ignite(this.windowUtils.window));
|
this.windowUtils.events('did-get-response-details', () => this.ignite(this.windowUtils.window));
|
||||||
this.windowUtils.events('did-finish-load', e => this.injectScripts(true));
|
this.windowUtils.events('did-finish-load', e => this.injectScripts(true));
|
||||||
|
|
|
@ -16,8 +16,9 @@ const { WindowUtils } = require('./utils');
|
||||||
|
|
||||||
class CSSEditor extends Module {
|
class CSSEditor extends Module {
|
||||||
|
|
||||||
constructor(bd) {
|
constructor(bd, path) {
|
||||||
super();
|
super();
|
||||||
|
this.editorPath = path;
|
||||||
this.bd = bd;
|
this.bd = bd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +34,9 @@ class CSSEditor extends Module {
|
||||||
|
|
||||||
const options = this.options;
|
const options = this.options;
|
||||||
for (let option in o.args) {
|
for (let option in o.args) {
|
||||||
options[option] = o.args[option];
|
if (o.args.hasOwnProperty(option)) {
|
||||||
|
options[option] = o.args[option];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.editor = new BrowserWindow(options);
|
this.editor = new BrowserWindow(options);
|
||||||
|
@ -79,12 +82,6 @@ class CSSEditor extends Module {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO Currently uses a development path
|
|
||||||
get editorPath() {
|
|
||||||
return path.resolve(__dirname, '..', '..', '..', 'csseditor', 'dist');
|
|
||||||
// return path.resolve(__dirname, '..', '..', '..', 'tests', 'csseditor');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { CSSEditor };
|
module.exports = { CSSEditor };
|
||||||
|
|
Loading…
Reference in New Issue