-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain-window.js
More file actions
27 lines (24 loc) · 817 Bytes
/
main-window.js
File metadata and controls
27 lines (24 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const PkgName = require('./package.json').name;
const PreviewName = Editor.lang === 'zh' ? '插件窗口' : 'Preview Plugin';
function load () {
var playButtons = document.getElementById('playButtons');
if (playButtons) {
var added = playButtons.platformList.some(x => x.value === PkgName);
if (!added) {
playButtons.platformList = [].concat(playButtons.platformList, {text: PreviewName, value: PkgName});
}
}
else {
Editor.warn(`${PkgName}: playButtons not initialized`);
}
}
load();
module.exports = {
load,
unload: function () {
var playButtons = document.getElementById('playButtons');
if (playButtons) {
playButtons.platformList = playButtons.platformList.filter(x => x.value !== PkgName);
}
}
};