Skip to content

Commit

Permalink
r0b08x [chore] 1/21/2025, 3:41:13 PM
Browse files Browse the repository at this point in the history
  • Loading branch information
p3x-robot committed Jan 21, 2025
1 parent a546b0b commit 1bd28fc
Show file tree
Hide file tree
Showing 15 changed files with 105 additions and 34 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@



# 📚 P3X OneNote Linux v2025.4.123
# 📚 P3X OneNote Linux v2025.4.124



Expand Down Expand Up @@ -320,7 +320,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
---


[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124

[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![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 @@ -64,7 +64,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
---


[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124

[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![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 @@ -54,7 +54,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
---


[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124

[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![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 @@ -55,7 +55,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
---


[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124

[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![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 @@ -68,7 +68,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
---


[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124

[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![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 change-log.2019.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
---


[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124

[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![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 change-log.2020.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
---


[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124

[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![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 change-log.2021.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
---


[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124

[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![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 change-log.2022.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
---


[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124

[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![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 change-log.2023.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
---


[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124

[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![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 change-log.2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
---


[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124

[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![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
7 changes: 6 additions & 1 deletion change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

## Change log

### v2025.4.124
Released on 01/21/2025
* FEATURE/BUGFIX: Saving the position of the window as it was years ago

### v2025.4.101
Released on 01/05/2025
* CHORE: Update all packages.
Expand Down Expand Up @@ -66,7 +71,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
---


[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124

[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![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: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "p3x-onenote",
"version": "2025.4.123",
"version": "2025.4.124",
"description": "📚 P3X OneNote Linux",
"main": "src/electron/app.js",
"corifeus": {
Expand Down Expand Up @@ -66,10 +66,10 @@
"angular-material": "1.2.5",
"angular-messages": "1.8.3",
"corifeus-utils": "2025.4.120",
"electron": "^34.0.0",
"electron-store": "8.2.0",
"electron-updater": "6.3.9",
"semver": "7.6.3"
"semver": "7.6.3",
"electron": "^34.0.0"
},
"devDependencies": {
"corifeus-builder": "2025.4.128",
Expand Down
78 changes: 70 additions & 8 deletions src/electron/main/app-events.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,77 @@
const {app} = require('electron')
const { app, powerMonitor } = require('electron');
const path = require('path')

app.on('ready', global.p3x.onenote.createWindow.onenote);
let isInSuspended = false;

app.on('window-all-closed', function () {
const { net } = require('electron');
function waitForNetworkConnectivity(callback, retries = 60, interval = 1000) {
let attempts = 0;

function checkNetwork() {
const request = net.request('https://www.bing.com'); // Use any lightweight URL
request.on('response', () => {
console.log('Network is available');
callback();
});
request.on('error', () => {
if (attempts < retries) {
attempts++;
console.log(`Waiting for network (${attempts}/${retries})...`);
setTimeout(checkNetwork, interval);
} else {
console.error('Network unavailable after retries.');
callback();
}
});
request.end();
}

checkNetwork();
}

app.on('ready', () => {
console.log('P3X-OneNote is ready');

// Create the main window
global.p3x.onenote.createWindow.onenote();


/*
// Handle power events
powerMonitor.on('suspend', () => {
if (isInSuspended) {
return
}
isInSuspended = true;
console.log('System is suspending...');
// Close the window when the system goes to sleep
//if (global.p3x.onenote.window.onenote) {
// global.p3x.onenote.window.onenote.loadURL('about:blank');
// global.p3x.onenote.window.onenote.hide();
//}
});
// if (process.platform !== 'darwin') {
powerMonitor.on('resume', () => {
if (!isInSuspended) {
return
}
isInSuspended = false;
console.log('System has resumed...');
global.p3x.onenote.window.onenote.loadURL(`about:blank`);
waitForNetworkConnectivity(() => {
const url = path.join(app.getAppPath(), 'src/electron/window/onenote/index.html');
console.log('resume url', url)
global.p3x.onenote.window.onenote.loadURL(`file://${url}`);
});
});
*/
});

app.on('window-all-closed', function () {
if (!isInSuspended) {
app.quit();
// }
}
});

app.on('activate', function () {
Expand All @@ -15,13 +80,10 @@ app.on('activate', function () {
}
});


//FIXME: webview new-window changed
app.on('web-contents-created', function (webContentsCreatedEvent, contents) {
if (contents.getType() === 'webview') {
contents.on('new-window', function (newWindowEvent, url) {
newWindowEvent.preventDefault();
});
}
});

24 changes: 14 additions & 10 deletions src/electron/main/create/window/onenote.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const {BrowserWindow, app} = require('electron');

const remoteMain = require("@electron/remote/main")
remoteMain.initialize()

function createWindow() {

const remoteMain = require("@electron/remote/main")
remoteMain.initialize()


global.p3x.onenote.window.onenote = new BrowserWindow({
icon: global.p3x.onenote.iconFile,
Expand All @@ -18,9 +19,13 @@ function createWindow() {
nodeIntegrationInSubFrames: true,
contextIsolation: false,
webviewTag: true,
enableRemoteModule: true,
}
});
global.p3x.onenote.window.onenote.loadURL(`file://${__dirname}/../../../window/onenote/index.html`);
const path = require('path')
const loadUrl = path.join(app.getAppPath(), 'src/electron/window/onenote/index.html');
console.log('loadUrl', loadUrl)
global.p3x.onenote.window.onenote.loadURL(`file://${loadUrl}`);

global.p3x.onenote.window.onenote.webContents.on("did-attach-webview", (_, contents) => {
contents.setWindowOpenHandler((details) => {
Expand Down Expand Up @@ -84,27 +89,26 @@ function createWindow() {
})
});


if (!process.argv.includes('--minimized')) {
//const windowBounds = global.p3x.onenote.conf.get('window-bounds');
const windowBounds = global.p3x.onenote.conf.get('window-bounds');
const maximized = global.p3x.onenote.conf.get('maximized');

if (maximized === true) {
global.p3x.onenote.window.onenote.maximize()
}

else if (windowBounds !== null && windowBounds !== undefined) {
global.p3x.onenote.window.onenote.setBounds(windowBounds);
}

}

/*
else if (windowBounds !== null && windowBounds !== undefined) {
global.p3x.onenote.window.onenote.setBounds(windowBounds);
}

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())
}
})
*/

global.p3x.onenote.window.onenote.on('maximize', () => {
global.p3x.onenote.conf.set('maximized', true)
Expand Down

0 comments on commit 1bd28fc

Please sign in to comment.