Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch menu-button to FA icon #68

Merged
merged 2 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Icons/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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 = {
Expand Down
3 changes: 2 additions & 1 deletion src/Menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
saxamaphone69 marked this conversation as resolved.
Show resolved Hide resolved

/*
* decaffeinate suggestions:
Expand All @@ -18,7 +19,7 @@ var Menu = {
}
);

$.extend(this.button, {textContent: "🞃"});
Icon.set(this.button, 'caretDown');

this.menu = new UI.Menu('post');
Callbacks.Post.push({
Expand Down
5 changes: 4 additions & 1 deletion src/Monitoring/ThreadWatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/Monitoring/ThreadWatcher/ThreadWatcher.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="move">
Thread Watcher <a class="refresh" title="Check threads" href="javascript:;" title="refresh">🗘</a>
Thread Watcher <a class="refresh" title="Check threads" href="javascript:;" title="refresh"></a>
<span id="watcher-status"></span>
<a class="menu-button" href="javascript:;">🞃</a>
<a class="menu-button" href="javascript:;"></a>
<a class="close" href="javascript:;">×</a>
</div>
<div id="watched-threads"></div>
14 changes: 4 additions & 10 deletions src/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down