Skip to content

Commit

Permalink
r0b08x [chore] 7/20/2023, 11:37:01 AM
Browse files Browse the repository at this point in the history
  • Loading branch information
p3x-robot committed Jul 20, 2023
1 parent b7ee91b commit ea9817f
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 101 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

@license p3x-onenote v2023.10.214
@license p3x-onenote v2023.10.220

📚 P3X OneNote Linux

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@



# 📚 P3X OneNote Linux v2023.10.215
# 📚 P3X OneNote Linux v2023.10.220



Expand Down Expand Up @@ -240,7 +240,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://

---

[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.215
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.220

[![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)

Expand Down
2 changes: 1 addition & 1 deletion artifacts/arm.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://

---

[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.215
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.220

[![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)

Expand Down
2 changes: 1 addition & 1 deletion artifacts/flavor.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://

---

[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.215
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.220

[![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)

Expand Down
2 changes: 1 addition & 1 deletion artifacts/new-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://

---

[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.215
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.220

[![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)

Expand Down
2 changes: 1 addition & 1 deletion artifacts/npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://

---

[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.215
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.220

[![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)

Expand Down
6 changes: 5 additions & 1 deletion change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

## Change log

### v2023.10.220
Relesed on 07/20/2023
* CHORE: Updated Electron

### v2023.10.205
Released on 07/19/2022
* TEST: Auto upload with deb and AppImage
Expand Down Expand Up @@ -370,7 +374,7 @@ All my domains ([patrikx3.com](https://patrikx3.com) and [corifeus.com](https://

---

[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.215
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2023.10.220

[![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)

Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "p3x-onenote",
"version": "2023.10.216",
"version": "2023.10.220",
"description": "📚 P3X OneNote Linux",
"main": "src/electron/app.js",
"corifeus": {
Expand Down Expand Up @@ -28,6 +28,7 @@
"postinstall-save": "opencollective postinstall",
"start": "node ./node_modules/.bin/electron ./src/electron/app.js",
"publish-electron": "rm -rf dist && electron-builder --p onTagOrDraft --linux --armv7l --arm64 --linux AppImage deb rpm --x64",
"publish-electron-deb": "rm -rf dist && electron-builder --p onTagOrDraft --linux --armv7l --arm64 --linux deb --x64",
"publish-electron-test": "rm -rf dist && electron-builder --p onTagOrDraft --linux --linux AppImage deb --x64",
"publish-electron-snap": "rm -rf dist && electron-builder --linux snap -p never",
"publish-electron-yml": "node ./node_modules/corifeus-builder/src/utils/appimage/post-build.js"
Expand Down Expand Up @@ -59,7 +60,7 @@
"electron-store": "^8.1.0",
"electron-updater": "^6.1.2",
"semver": "^7.5.4",
"electron": "^25.3.0"
"electron": "^25.3.1"
},
"devDependencies": {
"corifeus-builder": "^2023.10.128",
Expand All @@ -69,14 +70,12 @@
"node": ">=12.13.0"
},
"build": {
"generateUpdatesFilesForAllChannels": true,
"afterAllArtifactBuild": "./node_modules/corifeus-builder/src/utils/appimage/after-all-artifact-build.js",
"publish": [
{
"provider": "github",
"owner": "patrikx3",
"repo": "onenote",
"channel": "latest"
"repo": "onenote"
}
],
"appId": "p3x.onenote",
Expand Down
2 changes: 1 addition & 1 deletion scripts/start-local.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
./node_modules/.bin/electron --no-sandbox $DIR/.. $@
./node_modules/.bin/electron $DIR/.. $@
10 changes: 8 additions & 2 deletions src/electron/main/create/window/onenote.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,16 @@ function createWindow() {
});
global.p3x.onenote.window.onenote.loadURL(`file://${__dirname}/../../../window/onenote/index.html`);

remoteMain.enable(global.p3x.onenote.window.onenote.webContents)
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' }
})
})

remoteMain.enable(global.p3x.onenote.window.onenote.webContents)


if (process.env.NODE_ENV === 'debug') {
global.p3x.onenote.window.onenote.openDevTools()
}
Expand Down Expand Up @@ -117,7 +124,6 @@ function createWindow() {


const {autoUpdater} = require("electron-updater");
autoUpdater.channel = "latest"

autoUpdater.on('checking-for-update', (info) => {
console.log('checking-for-update', info)
Expand Down
121 changes: 52 additions & 69 deletions src/electron/window/onenote/event/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,12 @@ const handler = (options) => {

//const disalledUrl = /^((https?:\/\/))/i

/*
let windowInterval

const generateInterval = () => {
windowInterval = setInterval(() => {
//console.log(webview.src, global.p3x.onenote.root.p3x.onenote.location)

/*
ipc.send('p3x-debug', {
'new-window': webview.src,
allowed: allowedUrlRegex.test(webview.src)
})
*/

/*
if (!allowedUrlRegex.test(webview.src)) {
p3x.onenote.ui.overlay.show({
message: p3x.onenote.lang.label.disallowedContent
})
} else {
p3x.onenote.ui.overlay.hide()
}
*/


windowInterval = setInterval(() => {
if (global.p3x.onenote.root && global.p3x.onenote.root.p3x.onenote.location !== webview.src) {
console.log('changed the url via interval', webview.src)
p3x.onenote.wait.angular(() => {
global.p3x.onenote.root.p3x.onenote.location = webview.src
global.p3x.onenote.data.url = webview.src
Expand All @@ -61,6 +42,7 @@ const handler = (options) => {
generateInterval()
}
})
*/

/*
webview.addEventListener('did-stop-loading', function(event) {
Expand All @@ -82,25 +64,34 @@ const handler = (options) => {
});
*/

webview.addEventListener('did-navigate', function (event, url) {
/*
ipc.send('p3x-debug', {
'did-navigate': event,
url: url,
for(let eventName of ['did-navigate', 'did-navigate-in-page']) {
webview.addEventListener(eventName, function (event, url) {
/*
ipc.send('p3x-debug', {
'did-navigate': event,
url: url,
});
*/
console.log(`changed the url via ${eventName}`, webview.src)

global.p3x.onenote.data.url = webview.src;
ipc.send('p3x-onenote-save', global.p3x.onenote.data);

p3x.onenote.wait.angular(() => {
global.p3x.onenote.root.p3x.onenote.location = webview.src
global.p3x.onenote.root.$digest()
})

});
*/


}

global.p3x.onenote.data.url = webview.src;
ipc.send('p3x-onenote-save', global.p3x.onenote.data);


p3x.onenote.wait.angular(() => {
global.p3x.onenote.root.p3x.onenote.location = webview.src
global.p3x.onenote.root.$digest()
})

});

webview.addEventListener("dom-ready", event => {
webview.addEventListener('dom-ready', event => {
//TODO Remove this once https://github.com/electron/electron/issues/14474 is fixed
webview.blur();
webview.focus();
Expand All @@ -114,8 +105,11 @@ const handler = (options) => {

});

/*
webview.addEventListener('new-window', function (event) {
console.log('new-window', event.url)
event.preventDefault()
//p3x.onenote.toast.action(p3x.onenote.lang.label.unknownLink)
Expand All @@ -134,41 +128,30 @@ const handler = (options) => {
}
})
}

//;

/*
ipc.send('p3x-debug', {
'new-window': event.url,
allowed: allowedUrlRegex.test(event.url)
})
*/

//console.log(event.url)
/*
if (allowedUrlRegex2.test(event.url)) {
// https://onedrive.live.com/redir?resid=3B992A1F2BEDFFA7%21955&page=Edit
const urlParts = event.url.match(allowedUrlRegex2)
/*
ipc.send('p3x-debug', {
urlParts: urlParts
})
*/
/*
p3x.onenote.toast.action(p3x.onenote.lang.redirecting)
webview.src = `https://onedrive.live.com/redir?resid=${urlParts[1]}%21955&page=Edit`;
} else
*/
/*
if (allowedUrlRegex.test(event.url) || allowedUrlRegex2.test(event.url)) {
p3x.onenote.toast.action(p3x.onenote.lang.redirecting)
webview.src = event.url;
} else {
shell.openExternal(event.url);
}
*/
});
*/

/*
for(let event of [
'did-finish-load',
'did-frame-finish-load',
'did-start-loading',
'page-title-updated',
'will-navigate',
'did-start-navigation',
'did-redirect-navigation',
'did-navigate',
'did-frame-navigate',
'did-navigate-in-page',
'update-target-url',
]) {
webview.addEventListener(event, function(eventData) {
if (eventData.url) {
console.log(event, event.url)
}
})
}
*/

}

Expand Down
20 changes: 18 additions & 2 deletions src/electron/window/onenote/ipc/handler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {ipcRenderer} = require('electron');
const {shell, ipcRenderer} = require('electron');

const setProxy = require('../action/set-proxy');
const multiActions = require('../action/multi-actions');
Expand Down Expand Up @@ -101,7 +101,23 @@ const handler = (options) => {
})



ipcRenderer.on('p3x-onenote-new-window', (event, data) => {
if (data.url.trim().startsWith('about:blank')) {
//webview.src = event.url;
return
}
if (global.p3x.onenote.conf.get('option-to-disable-internal-external-popup') === true) {
webview.src = event.url
} else {
global.p3x.onenote.prompt.redirect({url: data.url}).then((answer) => {
if (answer === 'internal') {
webview.src = data.url;
} else {
shell.openExternal(data.url)
}
})
}
})

}

Expand Down
14 changes: 0 additions & 14 deletions src/electron/window/onenote/load.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
const {ipcRenderer} = require('electron');

/*
const fs = require('fs')
fs.readFile(__dirname + '/hack.css', 'utf-8', function(err, data) {
if (err) {
ipc.send('p3x-debug', {
'messsage': 'hack.css is not working',
error: err,
});
}
p3x.onenote.hackCss = data;
});
*/

const Store = require('electron-store');
const conf = new Store();
let translationKey = conf.get('lang')
Expand Down

0 comments on commit ea9817f

Please sign in to comment.