From e4943d9abbc64655b90a489362a49330893c0a30 Mon Sep 17 00:00:00 2001 From: dragonwocky Date: Sat, 11 Dec 2021 18:04:03 +1100 Subject: [PATCH] patch systemMenu: mod window menu template --- CHANGELOG.md | 2 ++ insert/api | 2 +- insert/repo | 2 +- pkg/replacers/main/systemMenu.js | 22 ++++++++++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 pkg/replacers/main/systemMenu.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 501addd..402b298 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ a complete redesign & rewrite of the enhancer, with new features and a port to t - an icon sets option to encode images to data urls to prevent quality reduction. - customisation of integrated titlebar & always on top window buttons. - an open on startup option under the tray mod. +- optional icon or title-only tab labels. +- choice of tab layout styles: traditional tabbed, traditional, bubble and compact. #### improved diff --git a/insert/api b/insert/api index b98db17..069a172 160000 --- a/insert/api +++ b/insert/api @@ -1 +1 @@ -Subproject commit b98db17e400ec8ba1cd41185a3e9995fedd41c48 +Subproject commit 069a17207a45c6e13af7c884b5ff67fa9f195543 diff --git a/insert/repo b/insert/repo index 94e0694..4817c10 160000 --- a/insert/repo +++ b/insert/repo @@ -1 +1 @@ -Subproject commit 94e069426beeb7e90cd7a5df55b6499353028163 +Subproject commit 4817c105ffd8f8db9663ef5d5ba1f19bd6b95dd0 diff --git a/pkg/replacers/main/systemMenu.js b/pkg/replacers/main/systemMenu.js new file mode 100644 index 0000000..fae3f88 --- /dev/null +++ b/pkg/replacers/main/systemMenu.js @@ -0,0 +1,22 @@ +/** + * notion-enhancer + * (c) 2021 dragonwocky (https://dragonwocky.me/) + * (https://notion-enhancer.github.io/) under the MIT license + */ + +'use strict'; + +import fsp from 'fs/promises'; + +export default async function (filepath) { + // so that e.g. tabs access and modify the template + const contents = await fsp.readFile(filepath, 'utf8'); + await fsp.writeFile( + filepath, + contents.replace( + /\}\nexports\.setupSystemMenu = setupSystemMenu;/g, + 'return template;}\nexports.setupSystemMenu = setupSystemMenu;' + ) + ); + return true; +}