Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 9749546a rédigé par Sting's avatar Sting Validation de Kubat
Parcourir les fichiers

MISC: Moved app entrypoint to toplevel dir, and made some renaming

parent 01ff50e0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
2 requêtes de fusion!3Dev kubat,!1Create basic lib
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<link rel="stylesheet" href="../style/bootstrap-4.5.2-dist/css/bootstrap.min.css"> <link rel="stylesheet" href="../style/bootstrap-4.5.2-dist/css/bootstrap.min.css">
<script src="../style/jquery/jquery-3.5.1.js"></script> <script src="../style/jquery/jquery-3.5.1.js"></script>
<script src="../style/bootstrap-4.5.2-dist/js/bootstrap.min.js"></script> <script src="../style/bootstrap-4.5.2-dist/js/bootstrap.min.js"></script>
<script src="./index.js"></script> <script src="./main.js"></script>
</head> </head>
<body> <body>
<div class="card"> <div class="card">
......
const {ipcRenderer} = require('electron');
window.onload = function(){
const closeApp = document.getElementById("closeButton");
closeApp.addEventListener('click', () => {
ipcRenderer.send('close-app')
});
}
\ No newline at end of file
const electron = require('electron') const {ipcRenderer} = require('electron');
const { app, BrowserWindow } = require('electron')
const {ipcMain} = require('electron')
/** Creates the main window and process for the admin interface window.onload = function(){
* const closeApp = document.getElementById("closeButton");
*/ closeApp.addEventListener('click', () => {
function createInstanceWindow () { ipcRenderer.send('close-app')
// Create the browser window.
const win = new BrowserWindow({
width: 800,
height: 600,
frame: false,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
win.loadFile('instance/index.html');
}
/** Creates the main process for the Express app
* which runs the local server and handles public
* clients
*/
function createExpressClient (){
const win = new BrowserWindow({
show: false,
webPreferences: {
nodeIntegration: true
}
}); });
win.loadFile('client/index.html');
// Useful for debugging, use with "show: true"
//win.webContents.openDevTools();
} }
\ No newline at end of file
ipcMain.on('close-app', (evt, arg) => {
app.quit()
})
app.on('ready', () => {
console.log('Ready');
createInstanceWindow();
createExpressClient();
});
const electron = require('electron')
const { app, BrowserWindow } = require('electron')
const {ipcMain} = require('electron')
/** Creates the main window and process for the admin interface
*
*/
function createInstanceWindow () {
// Create the browser window.
const win = new BrowserWindow({
width: 800,
height: 600,
frame: false,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
win.loadFile('instance/index.html');
}
/** Creates the main process for the Express app
* which runs the local server and handles public
* clients
*/
function createExpressClient (){
const win = new BrowserWindow({
show: false,
webPreferences: {
nodeIntegration: true
}
});
win.loadFile('client/index.html');
// Useful for debugging, use with "show: true"
//win.webContents.openDevTools();
}
ipcMain.on('close-app', (evt, arg) => {
app.quit()
})
app.on('ready', () => {
console.log('Ready');
createInstanceWindow();
createExpressClient();
});
{ {
"name": "lektor-app", "name": "lektor-app",
"version": "0.1.0", "version": "0.1.0",
"main": "instance/main.js", "main": "main.js",
"description": "A lektord manipulation tool, an 'instance'", "description": "A lektord manipulation tool, an 'instance'",
"repository": "git@git.iiens.net:bakaclub/lektor-app.git", "repository": "git@git.iiens.net:bakaclub/lektor-app.git",
"author": "Kubat <mael.martin31@gmail.com>", "author": "Kubat <mael.martin31@gmail.com>",
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter