Toggle navigation
P3X GitList Snapshot
GitHub
Repo
Changelog
To do
Releases
Themes
Change log
Loading change log ...
To do ...
Loading todo ...
browsing:
dd463860ce207373c2f00f192137a6a416c8ffb5
Branches
master
Tags
v2024.10.110
v2024.10.109
v2024.10.108
v2024.10.105
v2024.4.188
v2024.4.185
v2024.4.177
v2024.4.168
v2024.4.167
v2024.4.161
v2024.4.160
v2024.4.159
v2024.4.158
v2024.4.157
v2024.4.156
v2024.4.155
v2024.4.154
v2024.4.153
v2024.4.152
v2024.4.151
v2024.4.150
v2024.4.146
v2024.4.145
v2024.4.144
v2024.4.143
v2024.4.142
v2024.4.141
v2024.4.135
v2024.4.125
v2024.4.124
v2024.4.120
v2024.4.106
v2023.10.243
v2023.10.235
v2023.10.233
v2023.10.228
v2023.10.222
v2023.10.220
v2023.10.215
v2023.10.214
v2023.10.213
v2023.10.211
v2023.10.210
v2023.10.205
v2023.10.203
v2023.10.201
v2023.10.199
v2023.10.197
v2023.10.195
v2023.10.193
v2023.10.189
v2023.10.187
v2023.10.185
v2023.10.177
v2023.4.119
v2023.4.117
v2023.4.115
v2023.4.113
v2023.4.111
v2023.4.109
v2022.10.117
v2022.10.111
v2022.10.109
v2022.10.106
v2022.4.127
v2022.4.125
v2022.4.114
v2022.4.112
v2022.4.104
v2021.10.167
v2021.10.165
v2021.10.158
v2021.10.155
v2021.10.133
v2021.10.130
v2021.10.111
v2021.10.109
v2021.10.108
v2021.10.106
v2021.10.104
v2021.4.192
v2021.4.190
v2021.4.187
v2021.4.185
v2021.4.175
v2021.4.173
v2021.4.171
v2021.4.169
v2021.4.166
v2021.4.162
v2021.4.156
v2021.4.154
v2021.4.152
v2021.4.147
v2021.4.144
v2021.4.140
v2021.4.134
v2021.4.132
v2021.4.122
v2021.4.113
v2021.4.103
v2021.4.101
v2020.10.189
v2020.10.187
v2020.10.178
v2020.10.164
v2020.10.159
v2020.10.157
v2020.10.155
v2020.10.132
v2020.10.123
v2020.10.111
v2020.10.109
v2020.10.107
v2020.10.105
v2020.10.103
v2020.10.101
v2020.4.200
v2020.4.197
v2020.4.185
v2020.4.169
v2020.4.167
v2020.4.157
v2020.4.154
v2020.4.131
v2020.4.119
v2020.4.115
v2020.4.109
v2020.4.100
v2019.10.318
v2019.10.317
v2019.10.301
v2019.10.253
v2019.10.248
v2019.10.220
v2019.10.216
v2019.10.202
v2019.10.130
v2019.10.127
v2019.10.121
v2019.10.117
v2019.4.122
v2019.4.117
v2019.4.115
v2019.4.114
v2019.4.107
v2019.4.104
v2019.4.101
v2019.4.42
v2019.4.39
v2019.4.37
v2019.4.35
v2019.4.33
v2019.4.32
v2019.4.31
v2019.4.26
v2019.4.24
v2019.4.21
v2019.4.19
v2019.4.17
v2019.4.12
v2019.4.8
v2019.4.7
v2019.2.17-17
v2019.2.17-14
v2019.2.17-12
v2019.2.17-9
v2019.2.17-1
v2019.2.16-3
v2019.2.16-0
v2019.2.4-4
v2019.2.2-1
v2019.1.24-3
v2019.1.18-1
v2019.1.12-5
v2019.1.12-4
v2019.1.11-2
v2019.1.6-1
v2019.1.1-4
v2018.12.31-8
v2018.12.30-15
v2018.12.30-14
v2018.12.30-13
v2018.12.30-11
v2018.12.30-7
v2018.12.30-3
v2018.12.30-1
v2018.12.30-0
v2018.12.29-24
2018.12.28-5
2018.11.24-2
2018.9.28-4
2018.9.27-0
2018.9.5-5
1.4.63-554
1.4.57-546
1.4.51-537
1.4.16-520
1.4.1-511
1.3.14-510
1.2.377-462
1.2.374-458
1.2.356-438
1.2.354-433
1.2.335-412
1.2.306-400
1.2.294-397
1.2.279-390
1.2.273-382
1.2.251-366
1.2.242-354
1.2.223-346
1.2.222-345
1.2.218-343
1.2.210-339
1.2.201-332
1.2.181-323
1.2.166-311
1.2.118-291
1.2.64-272
1.2.33-256
1.1.30-250
1.1.14-236
1.1.11-234
1.1.8-231
1.1.5-228
1.1.2-223
1.0.297-181
1.0.293-180
1.0.288-176
1.0.143-46
1.0.103-80
Files
Commits
Log
Graph
Stats
onenote.git
src
electron
main
create
window
onenote.js
RSS
Git
Fetch origin
Download
ZIP
TAR
Clone
Raw
View
History
Clone
SSH
HTTPS
Blames found: 85
Mode: javascript
Binary: false
Hang on, we reloading big blames...
92142915
const {BrowserWindow, app} = require('electron');
ffff0db1
8d33cb71
ffff0db1
function createWindow() {
cb271ecb
const remoteMain = require("@electron/remote/main") remoteMain.initialize()
8d33cb71
f175d725
global.p3x.onenote.window.onenote = new BrowserWindow({
ffff0db1
icon: global.p3x.onenote.iconFile,
d579ba3e
title: `${global.p3x.onenote.title} v${global.p3x.onenote.pkg.version}`,
6584333e
backgroundColor: 'black',
6bbe2d46
autoHideMenuBar: global.p3x.onenote.optionToHideMenu,
ab3a755d
webPreferences: {
9886c59a
nativeWindowOpen: true,
83fa0919
worldSafeExecuteJavaScript: true,
ab3a755d
nodeIntegration: true,
5aca87b3
nodeIntegrationInSubFrames: true,
c43ce4cc
contextIsolation: false,
ab3a755d
webviewTag: true, }
ffff0db1
});
1d6270d5
global.p3x.onenote.window.onenote.loadURL(`file://${__dirname}/../../../window/onenote/index.html`);
47502756
ea9817fe
global.p3x.onenote.window.onenote.webContents.on("did-attach-webview", (_, contents) => { contents.setWindowOpenHandler((details) => { global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-new-window', details); return { action: 'deny' } }) })
cb271ecb
ea9817fe
remoteMain.enable(global.p3x.onenote.window.onenote.webContents)
47502756
ea9817fe
6f354368
if (process.env.NODE_ENV === 'debug') { global.p3x.onenote.window.onenote.openDevTools() }
ffff0db1
ab5b7689
global.p3x.onenote.setVisible(process.argv.includes('--minimized') ? false : true);
ffff0db1
f175d725
global.p3x.onenote.window.onenote.on('minimize', function (event) {
68877d1f
//event.preventDefault() //global.p3x.onenote.setVisible(false, true);
ffff0db1
});
f175d725
global.p3x.onenote.window.onenote.on('close', function (event) {
ffff0db1
if (!app.isQuiting) {
68877d1f
if (!global.p3x.onenote.disableHide) { event.preventDefault() global.p3x.onenote.setVisible(false); }
ffff0db1
} return false; });
f175d725
global.p3x.onenote.window.onenote.on('focus', () => { global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-action', {
ffff0db1
action: 'focus' }) })
a4f8482c
global.p3x.onenote.window.onenote.on('focus', function () { global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-window-state', { action: 'focus' })
e4ec810e
global.p3x.onenote.mainMenu(); global.p3x.onenote.mainTray()
a4f8482c
}); global.p3x.onenote.window.onenote.on('blur', function () { global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-window-state', { action: 'blur' })
e4ec810e
global.p3x.onenote.mainMenu(); global.p3x.onenote.mainTray()
a4f8482c
}); global.p3x.onenote.window.onenote.on('hide', function () { global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-window-state', { action: 'blur' }) });
ab5b7689
if (!process.argv.includes('--minimized')) { //const windowBounds = global.p3x.onenote.conf.get('window-bounds'); const maximized = global.p3x.onenote.conf.get('maximized');
a4f8482c
ab5b7689
if (maximized === true) { global.p3x.onenote.window.onenote.maximize() }
443c2835
281fb19c
}
ab5b7689
281fb19c
/* else if (windowBounds !== null && windowBounds !== undefined) {
f175d725
global.p3x.onenote.window.onenote.setBounds(windowBounds);
ffff0db1
}
443c2835
global.p3x.onenote.window.onenote.on('close', () => { if (global.p3x.onenote.conf.get('maximized') !== true) { global.p3x.onenote.conf.set('window-bounds', global.p3x.onenote.window.onenote.getBounds()) } })
281fb19c
*/
443c2835
global.p3x.onenote.window.onenote.on('maximize', () => { global.p3x.onenote.conf.set('maximized', true) }) global.p3x.onenote.window.onenote.on('unmaximize', () => { global.p3x.onenote.conf.set('maximized', false)
281fb19c
/*
443c2835
const windowBounds = global.p3x.onenote.conf.get('window-bounds'); if (windowBounds !== null && windowBounds !== undefined) { global.p3x.onenote.window.onenote.setBounds(windowBounds); }
281fb19c
*/
443c2835
})
8d33cb71
const {autoUpdater} = require("electron-updater");
7182323e
autoUpdater.on('checking-for-update', (info) => { console.log('checking-for-update', info)
8d33cb71
global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-action', { action: 'toast', message: global.p3x.onenote.lang.updater["checking-for-update"] }) }) autoUpdater.on('update-available', (info) => {
7182323e
console.log('update-available', info) global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-action', {
8d33cb71
action: 'toast', message: global.p3x.onenote.lang.updater["update-available"] }) })
3bcec777
let firstCheck = true
8d33cb71
autoUpdater.on('update-not-available', (info) => {
7182323e
console.log('update-not-available', info)
3bcec777
if (firstCheck) { firstCheck = false return }
8d33cb71
global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-action', { action: 'toast', message: global.p3x.onenote.lang.updater["update-not-available"] }) }) autoUpdater.on('error', (error) => {
7182323e
console.error('error', error)
dfe12c6d
b8e1f4a5
/*
dfe12c6d
if (global.p3x.onenote.window.onenote) { global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-action', { action: 'toast', error: error, message: global.p3x.onenote.lang.updater["error"]({ errorMessage: error.message.split('\n')[0] }) })
b8e1f4a5
}*/
8d33cb71
})
d701380d
/*
8d33cb71
autoUpdater.on('download-progress', (progressObj) => { /* let log_message = "Download speed: " + progressObj.bytesPerSecond; log_message = log_message + ' - Downloaded ' + progressObj.percent + '%'; log_message = log_message + ' (' + progressObj.transferred + "/" + progressObj.total + ')'; */
d701380d
/*
8d33cb71
global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-action', { action: 'toast', message: p3x.onenote.lang.updater["download-progress"]({ progressObj: progressObj, }) }) })
d701380d
*/
8d33cb71
autoUpdater.on('update-downloaded', (info) => { global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-action', { action: 'toast', message: p3x.onenote.lang.updater["update-downloaded"], }) }); autoUpdater.checkForUpdatesAndNotify();
47502756
ffff0db1
}
ab3a755d
module.exports = createWindow;