Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
ctrl+click open in new window, style ctrl+f popup
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonwocky committed Dec 7, 2021
1 parent 8eb2810 commit d7b78f4
Show file tree
Hide file tree
Showing 92 changed files with 322 additions and 238 deletions.
2 changes: 1 addition & 1 deletion always-on-top/button.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: integrated titlebar
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
8 changes: 4 additions & 4 deletions always-on-top/button.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
/**
* notion-enhancer: always on top
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
*/

export const createButton = async ({ web, components }, db) => {
export const createButton = async ({ electron, web, components }, db) => {
let pinIcon =
(await db.get(['pin_icon'])) ||
`<svg viewBox="0 0 20 20" fill="currentColor">
Expand All @@ -28,8 +28,8 @@ export const createButton = async ({ web, components }, db) => {
const $button = web.html`<div class="always_on_top--button"></div>`,
$pin = web.html`<button id="always_on_top--pin">${pinIcon}</button>`,
$unpin = web.html`<button id="always_on_top--unpin">${unpinIcon}</button>`;
components.tooltip($pin, '**Pin window to top**');
components.tooltip($unpin, '**Unpin window from top**');
components.addTooltip($pin, '**Pin window to top**');
components.addTooltip($unpin, '**Unpin window from top**');
web.render($button, $pin);

$pin.addEventListener('click', () => {
Expand Down
2 changes: 1 addition & 1 deletion always-on-top/client.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: always on top
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion always-on-top/menu.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: always on top
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion bypass-preview/client.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: bypass preview
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion bypass-preview/client.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: bypass preview
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion calendar-scroll/client.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: calendar scroll
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion calendar-scroll/client.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: calendar scroll
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion cherry-cola/variables.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: cherry cola
* (c) 2020 Alexa Baldon <alnbaldon@gmail.com> (https://github.com/runargs)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion code-line-numbers/client.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: code line numbers
* (c) 2020 CloudHill <rl.cloudhill@gmail.com> (https://github.com/CloudHill)
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
Expand Down
2 changes: 1 addition & 1 deletion code-line-numbers/client.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: code line numbers
* (c) 2020 CloudHill <rl.cloudhill@gmail.com> (https://github.com/CloudHill)
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
Expand Down
2 changes: 1 addition & 1 deletion collapsible-headers/client.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: collapsible headers
* (c) 2020 CloudHill <rl.cloudhill@gmail.com> (https://github.com/CloudHill)
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
Expand Down
2 changes: 1 addition & 1 deletion collapsible-headers/client.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: collapsible headers
* (c) 2020 CloudHill <rl.cloudhill@gmail.com> (https://github.com/CloudHill)
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
Expand Down
2 changes: 1 addition & 1 deletion collapsible-properties/client.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: collapse properties
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion collapsible-properties/client.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: collapse properties
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion dark+/theme.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: dark+
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion dark+/variables.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: dark+
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion dracula/app.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: dracula
* (c) 2016 Dracula Theme
* (c) 2020 CloudHill
Expand Down
2 changes: 1 addition & 1 deletion dracula/variables.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: dracula
* (c) 2016 Dracula Theme
* (c) 2020 mimishahzad
Expand Down
2 changes: 1 addition & 1 deletion emoji-sets/client.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: emoji sets
* (c) 2021 Arecsu
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
Expand Down
2 changes: 1 addition & 1 deletion emoji-sets/client.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: emoji sets
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion focus-mode/client.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: focus mode
* (c) 2020 Arecsu
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
Expand Down
2 changes: 1 addition & 1 deletion focus-mode/client.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: focus mode
* (c) 2020 Arecsu
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
Expand Down
2 changes: 1 addition & 1 deletion font-chooser/fonts.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: font chooser
* (c) 2021 TorchAtlas (https://bit.ly/torchatlas/)
* (c) 2021 admiraldus (https://github.com/admiraldus)
Expand Down
2 changes: 1 addition & 1 deletion font-chooser/fonts.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: font chooser
* (c) 2021 TorchAtlas (https://bit.ly/torchatlas/)
* (c) 2021 admiraldus (https://github.com/admiraldus
Expand Down
2 changes: 1 addition & 1 deletion global-block-links/client.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: global block links
* (c) 2021 admiraldus (https://github.com/admiraldus)
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
Expand Down
4 changes: 2 additions & 2 deletions global-block-links/client.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: global block links
* (c) 2021 admiraldus (https://github.com/admiraldus)
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
Expand Down Expand Up @@ -44,7 +44,7 @@ export default async function ({ web, components, notion }, db) {
$btns.forEach(($btn) => {
if (!$btn.previousElementSibling?.classList?.contains?.(topbarCopyClass)) {
const $copy = $topbarCopyTemplate.cloneNode(true);
components.tooltip($copy, '**Copy page link**');
components.addTooltip($copy, '**Copy page link**');
$btn.before($copy);

let resetButtonDelay;
Expand Down
2 changes: 1 addition & 1 deletion gruvbox-dark/variables.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: gruvbox dark
* (c) 2015-2020 morhetz <morhetz@gmail.com>
* (c) 2021 jordanrobinson <me@jordanrobinson.co.uk> (https://jordanrobinson.co.uk/)
Expand Down
2 changes: 1 addition & 1 deletion gruvbox-light/variables.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: gruvbox light
* (c) 2015-2020 morhetz <morhetz@gmail.com>
* (c) 2021 jordanrobinson <me@jordanrobinson.co.uk> (https://jordanrobinson.co.uk/)
Expand Down
2 changes: 1 addition & 1 deletion icon-sets/client.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: icon sets
* (c) 2019 jayhxmo (https://jaymo.io/)
* (c) 2020 CloudHill <rl.cloudhill@gmail.com> (https://github.com/CloudHill)
Expand Down
4 changes: 2 additions & 2 deletions icon-sets/client.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: icon sets
* (c) 2019 jayhxmo (https://jaymo.io/)
* (c) 2020 CloudHill <rl.cloudhill@gmail.com> (https://github.com/CloudHill)
Expand Down Expand Up @@ -67,7 +67,7 @@ export default async function ({ web, fs, components, notion }, db) {
$spinner.remove();
if ($tooltip) {
const $infoSvg = web.html`${await components.feather('info', { class: 'info' })}`;
components.tooltip($infoSvg, $tooltip, { offsetDirection: 'right' });
components.addTooltip($infoSvg, $tooltip, { offsetDirection: 'right' });
web.render($title, $infoSvg);
}
})();
Expand Down
2 changes: 1 addition & 1 deletion indentation-lines/client.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: indentation lines
* (c) 2020 Alexa Baldon <alnbaldon@gmail.com> (https://github.com/runargs)
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
Expand Down
2 changes: 1 addition & 1 deletion indentation-lines/client.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: indentation lines
* (c) 2020 Alexa Baldon <alnbaldon@gmail.com> (https://github.com/runargs)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion integrated-titlebar/buttons.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: integrated titlebar
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
10 changes: 5 additions & 5 deletions integrated-titlebar/buttons.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: integrated titlebar
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down Expand Up @@ -47,10 +47,10 @@ export const createWindowButtons = async ({ electron, web, components }, db) =>
$close = web.html`<button id="integrated_titlebar--close">
${closeIcon}
</button>`;
components.tooltip($minimize, '**Minimize window**');
components.tooltip($maximize, '**Maximize window**');
components.tooltip($unmaximize, '**Unmaximize window**');
components.tooltip($close, '**Close window**');
components.addTooltip($minimize, '**Minimize window**');
components.addTooltip($maximize, '**Maximize window**');
components.addTooltip($unmaximize, '**Unmaximize window**');
components.addTooltip($close, '**Close window**');

$minimize.addEventListener('click', () => electron.browser.minimize());
$maximize.addEventListener('click', () => electron.browser.maximize());
Expand Down
2 changes: 1 addition & 1 deletion integrated-titlebar/client.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: integrated titlebar
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion integrated-titlebar/createWindow.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: integrated titlebar
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion integrated-titlebar/menu.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: integrated titlebar
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion integrated-titlebar/rendererIndex.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: integrated titlebar
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion light+/theme.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: light+
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
2 changes: 1 addition & 1 deletion light+/variables.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: light+
* (c) 2020 Lizishan
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
Expand Down
2 changes: 1 addition & 1 deletion material-ocean/variables.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* notion-enhancer: material ocean
* (c) 2020 Abubakar Yagoub <i@blacksuan19.me> (https://blacksuan19.tk)
* (https://notion-enhancer.github.io/) under the MIT license
Expand Down
4 changes: 2 additions & 2 deletions menu/client.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* notion-enhancer core: menu
/**
* notion-enhancer: menu
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
*/
Expand Down
12 changes: 2 additions & 10 deletions menu/client.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* notion-enhancer core: menu
/**
* notion-enhancer: menu
* (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
* (https://notion-enhancer.github.io/) under the MIT license
*/
Expand All @@ -11,14 +11,6 @@ const notificationsURL = 'https://notion-enhancer.github.io/notifications.json';
export default async function ({ env, fs, storage, registry, web }, db) {
web.addHotkeyListener(await db.get(['hotkey']), env.focusMenu);

const updateTheme = () =>
storage.set(['theme'], document.querySelector('.notion-dark-theme') ? 'dark' : 'light');
web.addDocumentObserver((mutation) => {
if (mutation.target === document.body && document.hasFocus()) updateTheme();
});
if (document.hasFocus()) updateTheme();
document.addEventListener('visibilitychange', updateTheme);

const sidebarSelector = '.notion-sidebar-container .notion-sidebar > div:nth-child(4)';
await web.whenReady([sidebarSelector]);

Expand Down
Loading

0 comments on commit d7b78f4

Please sign in to comment.