Skip to content

Commit 634246d

Browse files
committed
robo8x [chore] 5/16/2019, 1:21:35 PM
1 parent e6cebde commit 634246d

File tree

18 files changed

+278
-17
lines changed

18 files changed

+278
-17
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
@license p3x-onenote v2019.4.33
2+
@license p3x-onenote v2019.4.35
33

44
📚 P3X OneNote Linux
55

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313

14-
# 📚 P3X OneNote Linux v2019.4.33
14+
# 📚 P3X OneNote Linux v2019.4.35
1515

1616

1717
🙏 This is an open-source project. Star this repository, if you like it, or even donate to maintain the servers and the development. Thank you so much!
@@ -189,7 +189,7 @@ If you try to build the app with AppImage, you have to change from `electron` `d
189189

190190
---
191191

192-
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.33
192+
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.35
193193

194194
[![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
195195

artifacts/npm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Though, I am using it, but some distros are different and I only use Linux Mint
2727

2828
---
2929

30-
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.33
30+
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.35
3131

3232
[![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
3333

File renamed without changes.
20.7 KB
Loading

bin/p3x-onenote.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const start = async() => {
2222
Version=1.0
2323
Type=Application
2424
Name=P3X Onenote
25-
Icon=${path.resolve(__dirname + '/../src/electron/images/256x256.png')}
25+
Icon=${path.resolve(__dirname + '/../src/electron/images/1024x1024.png')}
2626
Exec=${__filename}
2727
Comment=https://www.patrikx3.com
2828
Categories=Office;

changelog.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
## Change log
99

10+
### v2019.4.34
11+
* FEATURE: New OneNote 2019 icon
12+
* FEATURE: German translation, tries to guess Online Onenote language, but not always working
13+
1014
### v2019.4.33
1115
FEATURE: Added in the `Action` menu to go to any URL.
1216

@@ -66,7 +70,7 @@ FEATURE: for all links in P3X OneNote is left for the user to decide how the lin
6670

6771
---
6872

69-
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.33
73+
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.4.35
7074

7175
[![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
7276

package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "p3x-onenote",
3-
"version": "2019.4.33",
3+
"version": "2019.4.35",
44
"description": "📚 P3X OneNote Linux",
55
"main": "src/electron/app.js",
66
"corifeus": {
@@ -40,7 +40,7 @@
4040
},
4141
"homepage": "https://pages.corifeus.com/onenote",
4242
"dependencies": {
43-
"@fortawesome/fontawesome-free": "^5.8.1",
43+
"@fortawesome/fontawesome-free": "^5.8.2",
4444
"angular": "^1.7.8",
4545
"angular-animate": "^1.7.8",
4646
"angular-aria": "^1.7.8",
@@ -49,16 +49,17 @@
4949
"configstore": "^4.0.0",
5050
"corifeus-utils": "^2019.4.13",
5151
"electron-updater": "^4.0.6",
52-
"jquery": "^3.4.0",
52+
"jquery": "^3.4.1",
5353
"opencollective": "^1.0.3",
5454
"semver": "^6.0.0",
55-
"typeface-roboto": "0.0.54"
55+
"typeface-roboto": "0.0.54",
56+
"electron": "^5.0.1"
5657
},
5758
"devDependencies": {
58-
"jsdom": "^15.0.0",
59+
"jsdom": "^15.1.0",
5960
"angular-mocks": "^1.7.8",
6061
"corifeus-builder": "^2019.4.12",
61-
"electron-builder": "^20.39.0"
62+
"electron-builder": "^20.40.2"
6263
},
6364
"engines": {
6465
"node": ">=10.13.0"

src/electron/app.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,25 @@ const conf = new configstore(pkg.name);
44

55
const { app } = require('electron');
66

7-
const translation = require('../translation/en')
7+
let translationKey = conf.get('lang')
8+
if (translationKey === undefined) {
9+
translationKey = 'en-US'
10+
conf.set('lang', translationKey)
11+
}
12+
13+
const translation = require('../translation/' + translationKey)
814
const path = require('path')
915

1016
global.p3x = {
1117
onenote: {
1218
pkg: pkg,
1319
lang: translation,
20+
translationKey: translationKey,
1421
title: translation.title,
1522
conf: conf,
1623
disableHide: true,
1724
allowMultiple: false,
18-
iconFile: path.resolve(`${__dirname}/images/256x256.png`),
25+
iconFile: path.resolve(`${__dirname}/images/1024x1024.png`),
1926
tray: undefined,
2027
window: {
2128
onenote: undefined,

src/electron/images/1024x1024.png

20.7 KB
Loading

src/electron/main/create/menu.js

+28
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,30 @@ function mainMenu() {
1717

1818
const minimizationBehaviorLabel = !global.p3x.onenote.disableHide ? global.p3x.onenote.lang.label.disableHide.no : global.p3x.onenote.lang.label.disableHide.yes
1919

20+
21+
const languageCheckbox = [
22+
];
23+
for(let trans of Object.keys(global.p3x.onenote.lang.menu.language.translations)) {
24+
const transLabel = global.p3x.onenote.lang.menu.language.translations[trans]
25+
const transMenu = ((trans) => {
26+
return {
27+
label: transLabel,
28+
type: 'radio',
29+
checked: global.p3x.onenote.conf.get('lang') === trans,
30+
click: () => {
31+
global.p3x.onenote.conf.set('lang', trans)
32+
global.p3x.onenote.lang = require('../../../translation/' + trans)
33+
mainMenu()
34+
mainTray()
35+
global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-language', {
36+
translation: trans,
37+
})
38+
}
39+
}
40+
})(trans)
41+
languageCheckbox.push(transMenu)
42+
}
43+
2044
const template = [
2145
{
2246
label: global.p3x.onenote.title,
@@ -84,6 +108,10 @@ function mainMenu() {
84108
}
85109
],
86110
},
111+
{
112+
label: global.p3x.onenote.lang.menu.language.label,
113+
submenu: languageCheckbox,
114+
},
87115
{
88116
label: global.p3x.onenote.lang.label.edit,
89117
submenu: [

src/electron/window/onenote/angular/prompt/index.js

+37
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,43 @@ global.p3x.onenote.ng.factory('p3xOnenotePrompt', ($mdDialog) => {
3333

3434
}
3535

36+
this.configureLanguge = (opts) => {
37+
38+
return $mdDialog.show({
39+
template: `
40+
<md-dialog>
41+
42+
<md-dialog-content>
43+
<md-content layout-padding>
44+
<h3 flex>
45+
${p3x.onenote.lang.menu.language.dialog.label}
46+
</h3>
47+
</md-content>
48+
</md-dialog-content>
49+
50+
<md-dialog-actions>
51+
<md-button ng-click="exit('personal', ${opts.translation})" class="md-primary">
52+
${p3x.onenote.lang.menu.language.dialog.personal}
53+
</md-button>
54+
<md-button ng-click="exit('corporate', ${opts.translation})" class="md-primary">
55+
${p3x.onenote.lang.menu.language.dialog.coperate}
56+
</md-button>
57+
<md-button ng-click="cancel()" class="md-primary">
58+
${p3x.onenote.lang.button.cancel}
59+
</md-button>
60+
</md-dialog-actions>
61+
</md-dialog>`,
62+
controller: function($mdDialog, $scope) {
63+
$scope.exit = (answer) => {
64+
$mdDialog.hide(answer);
65+
}
66+
67+
$scope.cancel = $mdDialog.cancel
68+
}
69+
});
70+
71+
}
72+
3673
this.redirect = (opts) => {
3774

3875
return $mdDialog.show({

src/electron/window/onenote/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
-->
1616

1717
<!-- must be last -->
18-
<link rel="icon" type="image/png" href="../../images/256x256.png" />
18+
<link rel="icon" type="image/png" href="../../images/1024x1024.png" />
1919

2020
<script type="text/javascript" src="./load.js"></script>
2121

src/electron/window/onenote/ipc/handler.js

+27
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,33 @@ const handler = (options) => {
3131
setProxy(data);
3232
})
3333

34+
ipcRenderer.on('p3x-onenote-language', async (event, data) => {
35+
global.p3x.onenote.lang = require('../../../../translation/' + data.translation)
36+
global.p3x.onenote.toast.action(global.p3x.onenote.lang.menu.language.alert)
37+
38+
let type = '';
39+
let cancelled = false;
40+
try {
41+
type = await global.p3x.onenote.prompt.configureLanguge(data);
42+
type = type === undefined ? '' : type.trim();
43+
} catch(e) {
44+
if (e !== undefined) {
45+
console.error(e);
46+
} else {
47+
cancelled = true;
48+
}
49+
} finally {
50+
if (!cancelled) {
51+
if (type === 'corporate') {
52+
global.p3x.onenote.webview.src = 'https://www.onenote.com/notebooks?auth=2&auth_upn=my_corporate_email_address&omkt=' + data.translation
53+
} else {
54+
global.p3x.onenote.webview.src = 'https://www.onenote.com/notebooks?omkt=' + data.translation
55+
}
56+
}
57+
}
58+
59+
})
60+
3461
ipcRenderer.on('p3x-onenote-action-open-url', async(event, data) => {
3562
let url = '';
3663
let cancelled = false;

src/electron/window/onenote/load.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,19 @@ fs.readFile(__dirname + '/hack.css', 'utf-8', function(err, data) {
2121
});
2222
*/
2323

24+
const configstore = require('configstore');
25+
const pkg = require('../../../../package.json');
26+
const conf = new configstore(pkg.name);
27+
let translationKey = conf.get('lang')
28+
2429
global.p3x = {
2530
onenote: {
2631
url: {
32+
/*
33+
https://www.onenote.com/notebooks?omkt=en-US
34+
https://www.onenote.com/notebooks?omkt=de-DE
35+
https://www.onenote.com/notebooks?omkt=hu-HU
36+
*/
2737
notebooks: 'https://www.onenote.com/notebooks',
2838
},
2939
ui: {
@@ -33,7 +43,7 @@ global.p3x = {
3343
ng:undefined,
3444
webview: undefined,
3545
pkg: require('../../../../package'),
36-
lang: require('../../../translation/en'),
46+
lang: require('../../../translation/' + translationKey),
3747
data: {
3848
url: 'about:blank',
3949
proxy: '',

0 commit comments

Comments
 (0)