mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 15:05:39 +01:00
Move into monaco-editor-samples folder
This commit is contained in:
parent
b9969d41cb
commit
a9ab892f7a
86 changed files with 0 additions and 0 deletions
32
monaco-editor-samples/electron-amd/main.js
Normal file
32
monaco-editor-samples/electron-amd/main.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
const electron = require('electron');
|
||||
const app = electron.app;
|
||||
const BrowserWindow = electron.BrowserWindow;
|
||||
|
||||
let mainWindow;
|
||||
|
||||
function createWindow() {
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 800,
|
||||
height: 600,
|
||||
webPreferences: { worldSafeExecuteJavaScript: true }
|
||||
});
|
||||
mainWindow.loadURL(`file://${__dirname}/electron-index.html`);
|
||||
mainWindow.webContents.openDevTools();
|
||||
mainWindow.on('closed', function () {
|
||||
mainWindow = null;
|
||||
});
|
||||
}
|
||||
|
||||
app.on('ready', createWindow);
|
||||
|
||||
app.on('window-all-closed', function () {
|
||||
if (process.platform !== 'darwin') {
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
|
||||
app.on('activate', function () {
|
||||
if (mainWindow === null) {
|
||||
createWindow();
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue