Samstag, 31. August 2024

ji

 

Mein Code-Editor
const { ipcRenderer } = require('electron'); require.config({ paths: { 'vs': 'https://cdn.jsdelivr.net/npm/monaco-editor@0.38.0/min/vs' } }); require(['vs/editor/editor.main'], function () { monaco.editor.create(document.getElementById('container'), { value: '// Dein Code hier', language: 'javascript', theme: 'vs-dark' }); ipcRenderer.on('download-code', (event, args) => { // Handle code download logic }); }); const { app, BrowserWindow } = require('electron'); function createWindow () { const win = new BrowserWindow({ width: 800, height: 600, webPreferences: { nodeIntegration: true, contextIsolation: false, // This might need adjustments based on security needs preload: path.join(__dirname, 'preload.js') // Optional preload script } }); win.loadFile('index.html'); } app.whenReady().then(createWindow); app.on('window-all-closed', () => { if (process.platform !== 'darwin') { app.quit(); } }); app.on('activate', () => { if (BrowserWindow.getAllWindows().length === 0) { createWindow(); } });

Keine Kommentare:

Kommentar veröffentlichen

nj

  Download deiner Datei