Toggle navigation
P3X GitList Snapshot
GitHub
Repo
Changelog
To do
Releases
Themes
Change log
Loading change log ...
To do ...
Loading todo ...
browsing:
v2023.10.197
Branches
master
Tags
v2024.10.121
v2024.10.120
v2024.10.119
v2024.10.118
v2024.10.117
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
app.js
RSS
Git
Fetch origin
Download
ZIP
TAR
Clone
Raw
View
History
Clone
SSH
HTTPS
Blames found: 73
Mode: javascript
Binary: false
Hang on, we reloading big blames...
a0c51047
const pkg = require('../../package.json');
7edfdfb7
const Store = require('electron-store'); const conf = new Store();
a0c51047
92142915
const {app} = require('electron');
7863678a
app.allowRendererProcessReuse = true
adc980e5
634246d7
let translationKey = conf.get('lang') if (translationKey === undefined) { translationKey = 'en-US' conf.set('lang', translationKey) }
a5b75e3b
let darkThemeInvert = conf.get('darkThemeInvert') if (darkThemeInvert === undefined) { darkThemeInvert = false conf.set('darkThemeInvert', darkThemeInvert) }
6584333e
const path = require('path')
ffff0db1
2fdfeba5
const langTranslations = { 'en-US': require('../translation/en-US'), 'de-DE': require('../translation/de-DE'),
c0ba6665
'pt-BR': require('../translation/pt-BR'),
fcd1ead8
'es-ES': require('../translation/es-ES'),
7bee617b
'fr-FR': require('../translation/fr-FR'),
48c11a6b
'nl-NL': require('../translation/nl-NL'),
0fd529c5
'it-IT': require('../translation/it-IT'),
1c011416
'zh-CN': require('../translation/zh-CN'),
547036e2
'ru-RU': require('../translation/ru-RU'),
9637ca30
'pl-PL': require('../translation/pl-PL'),
20235160
'tr-TR': require('../translation/tr-TR'),
547036e2
2fdfeba5
} const translation = langTranslations[translationKey]
ffff0db1
global.p3x = { onenote: {
d579ba3e
pkg: pkg,
a5b75e3b
darkThemeInvert: darkThemeInvert,
ffff0db1
lang: translation,
634246d7
translationKey: translationKey,
2fdfeba5
translations: undefined,
ffff0db1
title: translation.title, conf: conf, disableHide: true,
0354276e
allowMultiple: false,
7ce7c076
optionToDisableInternalExternalPopup: false,
6bbe2d46
optionToHideMenu: false,
4dcdc4e2
iconFile: path.resolve(`${__dirname}/images/128x128.png`),
ffff0db1
tray: undefined,
f175d725
window: {
92142915
onenote: undefined,
f175d725
},
ffff0db1
action: undefined, menus: undefined,
f175d725
mainMenu: undefined,
ffff0db1
setVisible: undefined,
fa670e4d
bookmarksEditMode: false,
f175d725
createWindow: { onenote: undefined, },
e4ec810e
isVisible: () => { return global.p3x.onenote.window.onenote.isVisible() && global.p3x.onenote.window.onenote.isFocused() }
ffff0db1
} }
2fdfeba5
global.p3x.onenote.translations = langTranslations
ffff0db1
// configuration global.p3x.onenote.disableHide = conf.get('disable-hide') if (global.p3x.onenote.disableHide === undefined) {
28f18f75
conf.set('disable-hide', true)
ffff0db1
global.p3x.onenote.disableHide = true;
28f18f75
}
6bbe2d46
// optionToHideMenu global.p3x.onenote.optionToHideMenu = conf.get('option-to-hide-menu') if (global.p3x.onenote.optionToHideMenu === undefined) { conf.set('option-to-hide-menu', false) global.p3x.onenote.optionToHideMenu = false; }
7ce7c076
// configuration global.p3x.onenote.optionToDisableInternalExternalPopup = conf.get('option-to-disable-internal-external-popup') if (global.p3x.onenote.optionToDisableInternalExternalPopup === undefined) { conf.set('option-to-disable-internal-external-popup', false) global.p3x.onenote.optionToDisableInternalExternalPopup = false; }
0354276e
// configuration global.p3x.onenote.allowMultiple = conf.get('allow-multiple') if (global.p3x.onenote.allowMultiple === undefined) { conf.set('allow-multiple', false) global.p3x.onenote.allowMultiple = false; }
ffff0db1
// loading global.p3x.onenote.action = require('./main/action'); global.p3x.onenote.menus = require('./main/menus');
f175d725
global.p3x.onenote.mainMenu = require('./main/create/menu') global.p3x.onenote.mainTray = require('./main/create/tray')
ffff0db1
global.p3x.onenote.setVisible = require('./main/set-visible')
f175d725
global.p3x.onenote.createWindow.onenote = require('./main/create/window/onenote')
ffff0db1
28f18f75
0354276e
if (global.p3x.onenote.allowMultiple === false) { const semver = require('semver') if (semver.gt(process.versions.electron === undefined ? '4.0.0' : process.versions.electron, '3.0.0')) { const gotTheLock = app.requestSingleInstanceLock()
9aadc91c
0354276e
app.on('second-instance', (event, commandLine, workingDirectory) => { // Someone tried to run a second instance, we should focus our window. global.p3x.onenote.setVisible(true); //global.p3x.onenote.window.onenote.webContents.reload(); })
9aadc91c
0354276e
if (!gotTheLock) { app.quit() return }
e0447a09
0354276e
} else { const isSecondInstance = app.makeSingleInstance((commandLine, workingDirectory) => { global.p3x.onenote.setVisible(true); //global.p3x.onenote.window.onenote.webContents.reload(); })
9aadc91c
0354276e
if (isSecondInstance) { return app.quit() }
9aadc91c
} }
a0c51047
0354276e
ffff0db1
// app and ipc main events and configuration require('./main/ipc-main') require('./main/app-events')
d6c93996
a0c51047