Add version 0.2.0

This commit is contained in:
ertherod 2018-09-26 20:08:35 +02:00
parent 01ced676a6
commit 5ac9adefd4
2 changed files with 59 additions and 18 deletions

View File

@ -1,28 +1,69 @@
const electron = require('electron');
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const {app, Menu, Tray} = require('electron')
let mainWindow
let tray = null
function createWindow() {
function main(){
mainWindow = new BrowserWindow({
icon:'resources/app/icon.png',
webPreferences: {
nodeIntegration: false,
preload: './preload.js'
}
icon:'icon.png',
webPreferences :{
nodeIntegration :false
},
show: false
});
mainWindow.setIco
mainWindow.loadURL('https://beta.communiquons.org/');
mainWindow.maximize();
//createWindow --> create the window
mainWindow.loadURL('https://comunic.io');
//set the url who must be open
mainWindow.on('closed', () =>{
mainWindow = null;
});
}
app.on('window-all-closed', () =>{
if(process.platform !== 'darwin'){
app.quit();
}
});
//To close the window
app.on('ready', createWindow);
tray = new Tray('./icon.png');
tray.setToolTip('Comunic');
tray.setContextMenu(menu_1);
console.log("Started succesfully");
mainWindow.once('ready-to-show', () => {
mainWindow.show()
})
};
const menu_1 = Menu.buildFromTemplate([{
label: "Ouvrir la version stable",
click: () => {
mainWindow.loadURL('https://communiquons.org');
tray.setContextMenu(menu_2)
}
},
{
label : 'Quit',
click: () => {
app.quit();
console.log("Closed");
}
}]);
const menu_2 = Menu.buildFromTemplate([{
label: "Ouvrir la nouvelle version",
click: () =>{
mainWindow.loadURL('https://comunic.io');
tray.setContextMenu(menu_1)
}
},
{
label:'Quit',
click: () => {
app.quit();
console.log("Closed");
}
}]);
console.log("Starting...");
app.on('ready', main);

View File

@ -1,6 +1,6 @@
{
"name": "communic-desktop",
"version": "0.1.0",
"version": "0.2.0",
"description": "A client-desktop for communiquons.org",
"main": "index.js",
"scripts": {