app.on('activate', function() { if (mainWindow === null) { createWindow(); } });
attachToWindow() { this.menuSelectorActions = this.buildMenuSelectorActions(); let menuTemplate = _.cloneDeep(platformMenu); this.bindMenuItems(menuTemplate); this.systemMenuItems(menuTemplate); this.addImages(menuTemplate); this.menu = Menu.buildFromTemplate(menuTemplate); Menu.setApplicationMenu(this.menu); }
(function() { if (process.platform === 'darwin') { return 'Ctrl+Command+F'; } else { return 'F11'; } })()
/** * Opens up simulator within IDE window by sending a message to ipcRenderer('start simulator') * Changes state of simulator to true to trigger conditional rendering of Editor and Simulator */ openSimulatorInMain() { if(this.state.simulator === false){ this.setState({ simulator: true }); ipcRenderer.send('start simulator', 'helloworld'); } else { this.closeSim() } }
(() => { const compose_ = window && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__; if (process.env.NODE_ENV === 'development' && compose_) { return compose_({ actionCreators }); } return compose; })()
onConsoleChange(type) { let currentWindow = remote.getCurrentWindow(); if(!currentWindow.isFocused()) { ipcRenderer.send('application:dock-message-notification', currentWindow.id); } if(this.state.showConsole) { return; } ReplStore.showBell(); }
// Install `vue-devtools` require('electron').app.on('ready', () => { let installExtension = require('electron-devtools-installer') installExtension.default(installExtension.VUEJS_DEVTOOLS) .then(() => {}) .catch(err => { console.log('Unable to install `vue-devtools`: \n', err) }) })
ipcMain.on('bg_text_color', function() { tray.destroy(); createKey(); createTray(); if (desktopWindow != null) { desktopWindow.webContents.send('bg_text_color', 'ping'); } if (desktopBarWindow != null) { desktopBarWindow.webContents.send('bg_text_color', 'ping'); } })
ipcMain.on('application:history-aggressive', (event, flag) => { if(!flag) { return; } let {id} = BrowserWindow.getFocusedWindow(); let cache = windowCache[id]; if(cache.history && cache.history.length) { saveHistory(null, cache.history); cache.history = []; } });
ipcMain.on('createItem', (event, dirPath, name, type) => { if (type === 'file') { fs.writeFile(path.join(dirPath, name), '', err => { if (err) console.log(err); }); } else { fs.mkdir(path.join(dirPath, name), err => { if (err) console.log(err); }); } });
app.on('activate', (event, hasVisibleWindows) => { if(!hasVisibleWindows && appReady) { onReady(); } });
(function() { if (process.platform === 'darwin') { return 'Alt+Command+I'; } else { return 'Ctrl+Shift+I'; } })()