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

The Great Tweaks Update of July 2020 #1866

Merged
merged 8 commits into from
Jul 3, 2020
35 changes: 31 additions & 4 deletions Extensions/tweaks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//* TITLE Tweaks **//
//* VERSION 5.7.5 **/
//* VERSION 6.0.1 **/
//* DESCRIPTION Various little tweaks for your dashboard. **//
//* DEVELOPER new-xkit **//
//* DETAILS These are small little tweaks that allows you customize your dashboard. If you have used XKit 6, you will notice that some of the extensions have been moved here as options you can toggle. Keep in mind that some of the tweaks (the ones marked with a '*') can slow down your computer. **//
Expand Down Expand Up @@ -296,7 +296,19 @@ XKit.extensions.tweaks = new Object({
default: false,
value: false,
desktop_only: true
}
},
"hide_notification_badges": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no quotes?

text: "Hide all notification badges in the header",
default: false,
value: false,
desktop_only: true
},
hide_post_highlight: {
text: "Hide the post highlight that appears when using jk to scroll",
default: false,
value: false,
desktop_only: true
},
},

default_page_title: "",
Expand All @@ -305,8 +317,11 @@ XKit.extensions.tweaks = new Object({
XKit.extensions.tweaks.process_wrap_tags_one_line();
}),

run: function() {
run: async function() {
this.running = true;

await XKit.css_map.getCssMap();

this.css_to_add = "";

if (!XKit.interface.is_tumblr_page()) { return; }
Expand Down Expand Up @@ -726,8 +741,20 @@ XKit.extensions.tweaks = new Object({
}
}

XKit.tools.add_css(XKit.extensions.tweaks.css_to_add, "xkit_tweaks");
if (XKit.extensions.tweaks.preferences.hide_notification_badges.value) {
let notificationBadgeSel = XKit.css_map.keyToCss('notificationBadge');
XKit.extensions.tweaks.add_css(`${notificationBadgeSel} {
display: none !important;
}`, 'xkit_tweaks_hide_notification_badges');
}

if (XKit.extensions.tweaks.preferences.hide_post_highlight.value) {
const ltoSel = XKit.css_map.keyToCss('listTimelineObjectInner');
XKit.extensions.tweaks.add_css(`${ltoSel} {
box-shadow: none !important;
}`, 'xkit_tweaks_hide_notification_badges');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be xkit_tweaks_hide_post_highlights

}
XKit.tools.add_css(XKit.extensions.tweaks.css_to_add, "xkit_tweaks");
},

show_all_tags_button_event: function() {
Expand Down