#97, #98, and small alterations.

(removed platform support requests, replaced getNotion() with __notion)
This commit is contained in:
dragonwocky 2020-09-17 13:06:49 +10:00
parent 76ff3bd101
commit 6299ce4b81
5 changed files with 12 additions and 14 deletions

View File

@ -13,7 +13,7 @@ module.exports = {
tags: ['extension'], tags: ['extension'],
name: 'calendar scroll', name: 'calendar scroll',
desc: desc:
'add a button to scroll down to the current week of a calendar for you.', 'add a button to scroll down to the current week in fullpage/infinite-scroll calendars',
version: '0.1.0', version: '0.1.0',
author: 'dragonwocky', author: 'dragonwocky',
hacks: { hacks: {

View File

@ -10,8 +10,7 @@
module.exports = (store, __exports) => { module.exports = (store, __exports) => {
const electron = require('electron'), const electron = require('electron'),
helpers = require('../../pkg/helpers.js'), helpers = require('../../pkg/helpers.js'),
__notion = helpers.getNotion(), notionIpc = require(`${helpers.__notion.replace(
notionIpc = require(`${__notion.replace(
/\\/g, /\\/g,
'/' '/'
)}/app/helpers/notionIpc.js`); )}/app/helpers/notionIpc.js`);

View File

@ -15,12 +15,11 @@ module.exports = (store, __exports) => {
), ),
// createWindow = __exports.createWindow, // createWindow = __exports.createWindow,
path = require('path'), path = require('path'),
helpers = require('../../pkg/helpers.js'), helpers = require('../../pkg/helpers.js');
__notion = helpers.getNotion();
__exports.createWindow = function (relativeUrl, focused_window) { __exports.createWindow = function (relativeUrl, focused_window) {
if (!relativeUrl) relativeUrl = ''; if (!relativeUrl) relativeUrl = '';
const window_state = require(`${__notion.replace( const window_state = require(`${helpers.__notion.replace(
/\\/g, /\\/g,
'/' '/'
)}/app/node_modules/electron-window-state/index.js`)({ )}/app/node_modules/electron-window-state/index.js`)({
@ -47,7 +46,7 @@ module.exports = (store, __exports) => {
titleBarStyle: 'hiddenInset', titleBarStyle: 'hiddenInset',
frame: !store().frameless, frame: !store().frameless,
webPreferences: { webPreferences: {
preload: path.resolve(`${__notion}/app/renderer/index.js`), preload: path.resolve(`${helpers.__notion}/app/renderer/index.js`),
webviewTag: true, webviewTag: true,
session: electron.session.fromPartition('persist:notion'), session: electron.session.fromPartition('persist:notion'),
}, },

View File

@ -14,8 +14,7 @@ module.exports = (store, __exports) => {
path = require('path'), path = require('path'),
is_mac = process.platform === 'darwin', is_mac = process.platform === 'darwin',
is_win = process.platform === 'win32', is_win = process.platform === 'win32',
helpers = require('../../pkg/helpers.js'), helpers = require('../../pkg/helpers.js');
__notion = helpers.getNotion();
electron.app.on('ready', () => { electron.app.on('ready', () => {
tray = new electron.Tray( tray = new electron.Tray(
@ -77,12 +76,12 @@ module.exports = (store, __exports) => {
function openExtensionMenu() { function openExtensionMenu() {
if (enhancer_menu) return enhancer_menu.show(); if (enhancer_menu) return enhancer_menu.show();
const window_state = require(`${__notion.replace( const window_state = require(`${helpers.__notion.replace(
/\\/g, /\\/g,
'/' '/'
)}/app/node_modules/electron-window-state/index.js`)({ )}/app/node_modules/electron-window-state/index.js`)({
file: 'menu-windowstate.json', file: 'menu-windowstate.json',
path: helpers.data_folder, path: helpers.__data,
defaultWidth: 275, defaultWidth: 275,
defaultHeight: 600, defaultHeight: 600,
}); });
@ -165,7 +164,9 @@ module.exports = (store, __exports) => {
click: () => { click: () => {
require('./create.js')( require('./create.js')(
store, store,
require(path.resolve(`${__notion}/app/main/createWindow.js`)) require(path.resolve(
`${helpers.__notion}/app/main/createWindow.js`
))
)( )(
'', '',
electron.BrowserWindow.getAllWindows().find( electron.BrowserWindow.getAllWindows().find(

View File

@ -16,8 +16,7 @@ module.exports = {
author: { author: {
name: 'zenith_illinois', name: 'zenith_illinois',
link: 'https://www.reddit.com/user/zenith_illinois/', link: 'https://www.reddit.com/user/zenith_illinois/',
avatar: avatar: 'https://www.redditstatic.com/avatars/avatar_default_18_46A508.png',
'https://cdn.discordapp.com/avatars/565182533940150283/54f36546ab586298a5df5c238cbaaa4b.png?size=128',
}, },
fonts: ['https://rsms.me/inter/inter.css'], fonts: ['https://rsms.me/inter/inter.css'],
}; };