Skip to content

Commit a4f8482

Browse files
committed
robo8x [chore] 2/2/2019, 7:17:29 PM
1 parent 2390c64 commit a4f8482

File tree

8 files changed

+69
-29
lines changed

8 files changed

+69
-29
lines changed

LICENSE

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

2-
@license p3x-onenote v2019.1.29-2
2+
@license p3x-onenote v2019.2.2-1
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.1.29-2
14+
# 📚 P3X Onenote Linux v2019.2.2-1
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!
@@ -174,7 +174,7 @@ If you try to build the app with AppImage, you have to change from `electron` `d
174174

175175
---
176176

177-
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.1.29-2
177+
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.2.2-1
178178

179179
[![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) [![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)
180180

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.1.29-2
30+
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.2.2-1
3131

3232
[![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) [![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)
3333

changelog.md

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

88
## Change log
99

10+
### v2019.02.02
11+
* FEATURE: Disable/enable main timer on window blur/focus
12+
* CHORE: upgrade to Electron 4.0.4
13+
14+
1015
### v2019.01.24
1116
* CHORE: upgrade to Electron 4.0.2
1217

@@ -18,7 +23,7 @@
1823

1924
---
2025

21-
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.1.29-2
26+
[**P3X-ONENOTE**](https://pages.corifeus.com/onenote) Build v2019.2.2-1
2227

2328
[![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software) [![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)
2429

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "p3x-onenote",
3-
"version": "2019.1.29-2",
3+
"version": "2019.2.2-1",
44
"description": "📚 P3X Onenote Linux",
55
"main": "src/electron/app.js",
66
"corifeus": {
77
"prefix": "p3x-",
88
"publish": true,
99
"type": "p3x",
1010
"code": "Linux",
11-
"nodejs": "v11.8.0",
11+
"nodejs": "v11.9.0",
1212
"opencollective": true,
1313
"reponame": "onenote",
1414
"build": true
@@ -38,7 +38,7 @@
3838
},
3939
"homepage": "https://pages.corifeus.com/onenote",
4040
"dependencies": {
41-
"@fortawesome/fontawesome-free": "^5.7.0",
41+
"@fortawesome/fontawesome-free": "^5.7.1",
4242
"angular": "^1.7.6",
4343
"angular-animate": "^1.7.6",
4444
"angular-aria": "^1.7.6",
@@ -51,7 +51,7 @@
5151
"opencollective": "^1.0.3",
5252
"semver": "^5.6.0",
5353
"typeface-roboto": "0.0.54",
54-
"electron": "^4.0.3"
54+
"electron": "^4.0.4"
5555
},
5656
"devDependencies": {
5757
"jsdom": "^13.2.0",

src/electron/main/app-events.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ app.on('activate', function () {
1414
global.p3x.onenote.createWindow.onenote();
1515
}
1616
});
17+

src/electron/main/create/window/onenote.js

+23-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,29 @@ function createWindow() {
3636
})
3737

3838

39+
40+
global.p3x.onenote.window.onenote.on('focus', function () {
41+
global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-window-state', {
42+
action: 'focus'
43+
})
44+
});
45+
46+
47+
global.p3x.onenote.window.onenote.on('blur', function () {
48+
global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-window-state', {
49+
action: 'blur'
50+
})
51+
});
52+
53+
54+
global.p3x.onenote.window.onenote.on('hide', function () {
55+
global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-window-state', {
56+
action: 'blur'
57+
})
58+
});
59+
60+
61+
3962
//const windowBounds = global.p3x.onenote.conf.get('window-bounds');
4063
const maximized = global.p3x.onenote.conf.get('maximized');
4164

@@ -71,7 +94,6 @@ function createWindow() {
7194
})
7295

7396

74-
7597
const {autoUpdater} = require("electron-updater");
7698

7799
autoUpdater.on('checking-for-update', () => {

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

+31-19
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,38 @@ const handler = (options) => {
1313
const allowedUrlRegex = /^((https?:\/\/((onedrive\.live\.com\/((redir\?resid\=)|((redir|edit).aspx\?)))|((www\.)?onenote\.com))|(about\:blank)))/i
1414
//const disalledUrl = /^((https?:\/\/))/i
1515

16-
17-
setInterval(() => {
18-
//console.log(webview.src, global.p3x.onenote.root.p3x.onenote.location)
19-
20-
if (!allowedUrlRegex.test(webview.src) && (webview.src.startsWith('https://onedrive.live.com') || webview.src.startsWith('http://onedrive.live.com'))) {
21-
p3x.onenote.ui.overlay.show({
22-
message: p3x.onenote.lang.label.disallowedContent
23-
})
24-
} else {
25-
p3x.onenote.ui.overlay.hide()
26-
}
27-
28-
29-
if (global.p3x.onenote.root.p3x.onenote.location !== webview.src) {
30-
global.p3x.onenote.root.p3x.onenote.location = webview.src
31-
global.p3x.onenote.data.url = webview.src
32-
global.p3x.onenote.root.$digest()
33-
ipc.send('p3x-onenote-save', global.p3x.onenote.data);
16+
let windowInterval
17+
18+
const generateInterval = () => {
19+
windowInterval = setInterval(() => {
20+
//console.log(webview.src, global.p3x.onenote.root.p3x.onenote.location)
21+
22+
if (!allowedUrlRegex.test(webview.src) && (webview.src.startsWith('https://onedrive.live.com') || webview.src.startsWith('http://onedrive.live.com'))) {
23+
p3x.onenote.ui.overlay.show({
24+
message: p3x.onenote.lang.label.disallowedContent
25+
})
26+
} else {
27+
p3x.onenote.ui.overlay.hide()
28+
}
29+
30+
31+
if (global.p3x.onenote.root.p3x.onenote.location !== webview.src) {
32+
global.p3x.onenote.root.p3x.onenote.location = webview.src
33+
global.p3x.onenote.data.url = webview.src
34+
global.p3x.onenote.root.$digest()
35+
ipc.send('p3x-onenote-save', global.p3x.onenote.data);
36+
}
37+
}, 1500)
38+
}
39+
40+
generateInterval()
41+
42+
ipc.on('p3x-onenote-window-state', function(event, data) {
43+
clearInterval(windowInterval)
44+
if (data.action === 'focus') {
45+
generateInterval()
3446
}
35-
}, 1000)
47+
})
3648

3749
/*
3850
webview.addEventListener('did-stop-loading', function(event) {

0 commit comments

Comments
 (0)