Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{ label: 'Basic' },
{ label: 'Pro'},
]},
{ label: 'New Command...'},
]);
app.dock.setMenu(dockMenu);
}
// Application Menu
runtime.emit(runtime.events.INIT_APP_MENU, appMenu);
var template = appMenu.template;
menu = Menu.buildFromTemplate(template);
if (process.platform === 'darwin') {
Menu.setApplicationMenu(menu);
} else {
mainWindow.setMenu(menu);
}
});
]
});
// Window menu.
template[3].submenu.push(
{
type: 'separator'
},
{
label: 'Bring All to Front',
role: 'front'
}
);
}
menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
mb.app.on('ready', () => {
mb.tray.setToolTip(config.title);
mb.tray.setPressedImage(config.iconAlt);
Menu.setApplicationMenu(Menu.buildFromTemplate(shortcuts));
ipcMain.on('mb-app', (event, arg) => {
if (arg === "quit") {
console.log('goodbye!');
mb.app.quit();
}
});
});
var template = [{
label: "Application",
submenu: [
{ label: "Quit", accelerator: "Command+Q", click: function() { app.quit(); }}
]}, {
label: "Edit",
submenu: [
{ label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" },
{ label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
{ label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
{ label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
{ label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
]}
];
menu.setApplicationMenu(menu.buildFromTemplate(template));
this.tray.setToolTip('Drag and drop files here');
console.log(app.getOption('dir'));
this.tray.setImage(app.getOption('dir') + '/img/logo@18x22xbw.png');
this.tray.on('clicked', function clicked () {
console.log('tray-clicked')
});
this.tray.on('drop-files', function dropFiles (ev, files) {
loadUrl = app.getOption('pages')['location'];
app.showWindow();
//app.window.openDevTools();
app.window.webContents.on('did-finish-load', function() {
app.window.webContents.send('files', files);
app.window.webContents.send('preview', files);
});
});
icon: 'gfx/icon.png',
width: 800,
height: 600
});
init(mainWindow.webContents, options);
mainWindow.loadURL('file://' + __dirname + '/dt/inspector.html?electron=true');
mainWindow.on('closed', () => {
app.quit();
});
const menuTemplate = require('./menu')(app, options);
Menu.setApplicationMenu(Menu.buildFromTemplate(menuTemplate));
});
}, {
type: 'separator'
}, {
label: 'Quit',
//accelerator: 'Command+Q',
click: function () {
app.__force_quit = true;
app.quit();
}
}]
});
}
let menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
}
app.on('ready', function() {
menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
mainWindow = new BrowserWindow({width: 450, height: 550, frame: false, transparent: true});
mainWindow.loadUrl('file://' + __dirname + '/index.html');
mainWindow.on('closed', function() {
mainWindow = null;
});
});
type: 'separator'
},
{
label: 'Bring All to Front',
selector: 'arrangeInFront:'
},
]
},
{
label: 'Help',
submenu: []
},
];
menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
appIcon = new Tray(toggle["true"]);
appIcon.on("clicked", function() {
appIcon.setImage(toggle["true"]);
if(mainWindow.isVisible()){
mainWindow.hide();
} else {
mainWindow.show();
mainWindow.focus();
}
});
ipc.on("newBackgroundEpisodes", function(event, arg) {
if(!mainWindow.isFocused()){
appIcon.setImage(toggle["false"]);
{
type: 'separator'
},
{
label: 'Bring All to Front',
selector: 'arrangeInFront:'
},
]
},
{
label: 'Help',
submenu: []
}];
menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
});
}, 0);
var template = [{
label: "Edit",
submenu: [
{ label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" },
{ label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
{ type: "separator" },
{ label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
{ label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
{ label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
]}
];
Menu.setApplicationMenu(Menu.buildFromTemplate(template));
}