Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$('input').on('contextmenu', function (e) {
// use current menu, probably the one that was built the last time spellcheck ran
menu.popup(remote.getCurrentWindow());
// build a new one with only select all in it
menu = Menu.buildFromTemplate(template);
})
}
if(args.dev){
// Make the main window centered, visible, and opened with dev tools
var currentWindow = require('remote').getCurrentWindow();
currentWindow.setSize(800, 600);
currentWindow.center();
currentWindow.show();
currentWindow.openDevTools();
}
window.onload = function () {
var Remote = require('remote');
var currentWindow = Remote.getCurrentWindow();
currentWindow.setSize(800, 600);
currentWindow.center();
currentWindow.show();
currentWindow.openDevTools();
console.error(error.stack || error);
};
}
_clickToShowContextMenu: function(playlist, event) {
event.preventDefault();
var menu = this._createContextMenuForPlaylist(playlist);
menu.popup(Remote.getCurrentWindow());
},
MenuService.prototype.showMenu = menuItems => {
let menu = new Menu();
for (let i = 0; i < menuItems.length; i++) {
let menuItem = menuItems[i];
if (!menuItem.label || !menuItem.click) {
logger.warn('MenuService - registerContextMenu - skipping menu item because it does not have either a label or a click function');
continue;
}
menu.append(new MenuItem(menuItem));
}
menu.popup(remote.getCurrentWindow());
};
$('#messageArea').on('contextmenu', 'line', function (e) {
e.preventDefault();
textMenu.popup(remote.getCurrentWindow());
})
window.addEventListener('contextmenu', function (e) {
e.preventDefault();
menu.popup(remote.getCurrentWindow());
}, false);
function getWindow (win) {
if (typeof win === "number") {
return BrowserWindow.fromId(win);
} else if (win instanceof BrowserWindow) {
return win;
} else if (win && typeof win.browserWindow !== "undefined") {
return win.browserWindow;
} else if (typeof remote !== "undefined") {
return remote.getCurrentWindow();
} else {
return BrowserWindow.getFocusedWindow();
}
}
document.addEventListener("keydown", function (e) {
if (e.which === 123) {
require('remote').getCurrentWindow().toggleDevTools();
}
});
document.addEventListener("keydown", function (e) {
if (e.which === 123) {
require('remote').getCurrentWindow().toggleDevTools();
} else if (e.which === 116) {
location.reload();
}
});