From ff92a7fb2c38582aac282739a4f0cb30a89d7079 Mon Sep 17 00:00:00 2001 From: Johnny Date: Fri, 31 May 2024 18:55:31 +1000 Subject: [PATCH 1/2] Switch menu-button to FA icon --- src/Icons/icon.ts | 4 +++- src/Menu/Menu.js | 3 ++- src/Monitoring/ThreadWatcher.js | 5 ++++- src/Monitoring/ThreadWatcher/ThreadWatcher.html | 4 ++-- src/css/style.css | 14 ++++---------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Icons/icon.ts b/src/Icons/icon.ts index da13ba3e2..f7f3c43b2 100644 --- a/src/Icons/icon.ts +++ b/src/Icons/icon.ts @@ -17,6 +17,7 @@ import { svgPathData as downloadSvg, width as downloadW, height as downloadH } f import { svgPathData as bookOpenSvg, width as bookOpenW, height as bookOpenH } from "@fas/faBookOpen"; import { svgPathData as shrinkSvg, width as shrinkW, height as shrinkH } from "@fas/faDownLeftAndUpRightToCenter"; import { svgPathData as heartSvg, width as heartW, height as heartH } from "@fas/faHeart"; +import { svgPathData as caretDownSvg, width as caretDownW, height as caretDownH } from "@fas/faCaretDown"; const toSvg = (svgPathData: string, width: string | number, height: string | number) => { @@ -41,7 +42,8 @@ const icons = { download: toSvg(downloadSvg, downloadW, downloadH), bookOpen: toSvg(bookOpenSvg, bookOpenW, bookOpenH), shrink: toSvg(shrinkSvg, shrinkW, shrinkH), - heart: toSvg(heartSvg, heartW, heartH) + heart: toSvg(heartSvg, heartW, heartH), + caretDown: toSvg(caretDownSvg, caretDownW, caretDownH) } as const; var Icon = { diff --git a/src/Menu/Menu.js b/src/Menu/Menu.js index 3f622559a..a92f60fd9 100644 --- a/src/Menu/Menu.js +++ b/src/Menu/Menu.js @@ -2,6 +2,7 @@ import Callbacks from "../classes/Callbacks"; import UI from "../General/UI"; import { g, Conf } from "../globals/globals"; import $ from "../platform/$"; +import Iocn from "../Icons/icon"; /* * decaffeinate suggestions: @@ -18,7 +19,7 @@ var Menu = { } ); - $.extend(this.button, {textContent: "🞃"}); + Icon.set(this.button, 'caretDown'); this.menu = new UI.Menu('post'); Callbacks.Post.push({ diff --git a/src/Monitoring/ThreadWatcher.js b/src/Monitoring/ThreadWatcher.js index 5c21aacbb..db497c06c 100644 --- a/src/Monitoring/ThreadWatcher.js +++ b/src/Monitoring/ThreadWatcher.js @@ -45,14 +45,17 @@ var ThreadWatcher = { this.db = new DataBoard('watchedThreads', this.refresh, true); this.dbLM = new DataBoard('watcherLastModified', null, true); this.dialog = UI.dialog('thread-watcher', { innerHTML: ThreadWatcherPage }); - Icon.set(this.dialog.firstElementChild.firstElementChild, 'refresh'); this.status = $('#watcher-status', this.dialog); this.list = this.dialog.lastElementChild; this.refreshButton = $('.refresh', this.dialog); + this.menuButton = $('.menu-button', this.dialog); this.closeButton = $('.move > .close', this.dialog); this.unreaddb = Unread.db || UnreadIndex.db || new DataBoard('lastReadPosts'); this.unreadEnabled = Conf['Remember Last Read Post']; + Icon.set(this.refreshButton, 'refresh'); + Icon.set(this.menuButton, 'caretDown'); + $.on(d, 'QRPostSuccessful', this.cb.post); $.on(sc, 'click', this.toggleWatcher); $.on(this.refreshButton, 'click', this.buttonFetchAll); diff --git a/src/Monitoring/ThreadWatcher/ThreadWatcher.html b/src/Monitoring/ThreadWatcher/ThreadWatcher.html index 78d3a5be0..9c8eceaf1 100644 --- a/src/Monitoring/ThreadWatcher/ThreadWatcher.html +++ b/src/Monitoring/ThreadWatcher/ThreadWatcher.html @@ -1,7 +1,7 @@
- Thread Watcher 🗘 + Thread Watcher - 🞃 + ×
diff --git a/src/css/style.css b/src/css/style.css index 289ed6512..bf0399283 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -878,11 +878,8 @@ div[data-checked="false"] > .suboption-list { vertical-align: text-top; padding-left: 2px; } -.catalog-stats > .menu-button { - font-weight: normal; -} -.catalog-stats > .menu-button > i::before { - line-height: 11px; +.catalog-stats > .menu-button > svg.icon { + height: 10px; } .catalog-stats { font-size: 10px; @@ -2008,11 +2005,8 @@ a:only-of-type > .remove { margin: 2px; vertical-align: middle; } -.postInfo > .menu-button, -#thread-watcher .menu-button { - width: 18px; - height: 15px; - text-align: center; +.postInfo > .menu-button { + margin: 0 5px; } #menu { position: fixed; From 70fb0909a0c223e7341475ec52a17a64f5f9bd21 Mon Sep 17 00:00:00 2001 From: Johnny Date: Sat, 1 Jun 2024 06:11:30 +1000 Subject: [PATCH 2/2] Fix Icon typo --- src/Menu/Menu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Menu/Menu.js b/src/Menu/Menu.js index a92f60fd9..5e079f81c 100644 --- a/src/Menu/Menu.js +++ b/src/Menu/Menu.js @@ -2,7 +2,7 @@ import Callbacks from "../classes/Callbacks"; import UI from "../General/UI"; import { g, Conf } from "../globals/globals"; import $ from "../platform/$"; -import Iocn from "../Icons/icon"; +import Icon from "../Icons/icon"; /* * decaffeinate suggestions: