- onenote.git
- src
- electron
- main
- ipc-main.js
This file ( 1kB ) exceeds the allowed full mode (48 kb) size.
The editor full hight is disabled, only scrolling is allowed..
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height
mode, although some users like it.
const {ipcMain} = require('electron')
ipcMain.on('did-finish-load', function () {
const toWebview = global.p3x.onenote.conf.get('webview-onenote');
global.p3x.onenote.window.onenote.webContents.send('p3x-onenote-onload-user', toWebview);
});
ipcMain.on('p3x-onenote-save', function (event, data) {
global.p3x.onenote.conf.set('webview-onenote', data);
//global.p3x.onenote.conf.set('window-bounds', global.p3x.onenote.window.onenote.getBounds());
})
ipcMain.on('p3x-onenote-action-bookmark-result', function (event, data) {
//console.log('p3x-onenote-action-bookmark-result', data)
const bookmarksOriginal = global.p3x.onenote.conf.get('bookmarks') || []
const naturalCompareDocument = require('../lib/natural-compare-document')
const sort = naturalCompareDocument({
byProperty: 'title'
})
let bookmarks = bookmarksOriginal.sort(sort)
if (data.opts.edit !== true) {
bookmarks.push(data.model)
} else {
if (data.delete === true) {
bookmarks.splice(data.opts.index, 1);
} else {
bookmarks[data.opts.index] = data.model
}
}
global.p3x.onenote.conf.set('bookmarks', bookmarks.sort(sort))
global.p3x.onenote.mainMenu();
global.p3x.onenote.mainTray()
})
ipcMain.on('p3x-debug', (event, data) => {
console.log(data)
})