Compare commits

...

2 Commits

Author SHA1 Message Date
blankie 8d5abf9a30
Add Tumblr Unnagger 2023-12-28 23:08:04 +11:00
blankie 13bffe0d7f
Update Compass QoL Enhancer to 1.24.4.
- Fix showing finish time for calendar events with an ampersand
2023-12-06 11:39:10 +11:00
3 changed files with 85 additions and 2 deletions

View File

@ -2,7 +2,7 @@
// @name Compass QoL Enhancer
// @namespace blankie-scripts
// @match http*://*.compass.education/*
// @version 1.24.3
// @version 1.24.4
// @author blankie
// @description A userscript that adds small but useful features for Compass, such as the ability to close windows by clicking on the background
// @inject-into page
@ -415,7 +415,7 @@ function handleNewCalendarEvent(element, calendar) {
let finishString = unsafeWindow.Ext.util.Format.date(calendarData.finish, unsafeWindow.Compass.TIME_NO_PERIOD_FORMAT);
let textElement = a.querySelector(".ext-evt-bd") || a;
// yes, innerHTML. longTitleWithoutTime can apparently contain HTML. lets hope that startString and finishString don't
if (textElement.innerHTML === `${startString}: ${calendarData.longTitleWithoutTime}`) {
if (textElement.innerHTML.startsWith(`${startString}: `)) {
textElement.innerHTML = `${startString} - ${finishString}: ${calendarData.longTitleWithoutTime}`;
}

View File

@ -101,6 +101,10 @@ build logs to view them without logging in
![A man yelling "I DON'T WANNA", followed by sign up/login boxes](https://gitlab.com/blankX/userscripts/-/raw/master/accounts.jpg)
## Tumblr Unnagger
A script that removes several login/account walls on Tumblr
## Wayback Machine Toolbar Toggler
A userscript that replaces the "close this toolbar" button with one that lets

79
Tumblr Unnagger.user.js Normal file
View File

@ -0,0 +1,79 @@
// ==UserScript==
// @name Tumblr Unnagger
// @namespace blankie-scripts
// @match https://*.tumblr.com/*
// @grant GM_addStyle
// @version 1.0.0
// @author blankie
// @description Removes login nags
// @inject-into content
// @run-at document-end
// ==/UserScript==
"use strict";
let css = `
/* Remove the "Sign up" and "Follow <blog>" buttons */
.sign-up-button, .follow-button {
display: none !important;
}
/* Remove the top iframe bar on the default theme (e.g. https://azulcrescent.tumblr.com/) */
.tmblr-iframe {
display: none !important;
}
/* Fix margin from the top iframe bar being hidden */
.nav-wrapper.nav-fixed {
top: 0;
}
/* Hide fullscreen nag when scrolling */
#glass-container {
display: none;
}
/* Restore scrolling when fullscreen nag is shown */
html {
overflow: scroll !important;
}
`;
if (/^\/archive(\/.*)?$/.test(window.location.pathname)) {
css += `
/* Remove the "It's time to try Tumblr" nag on /archive */
#base-container > div:has(style) > div:nth-child(4) {
display: none;
}
`;
}
GM_addStyle(css);
function removeLoginWall(element) {
element.removeAttribute("data-login-wall-type");
for (let child of element.querySelectorAll("[data-login-wall-type]")) {
child.removeAttribute("data-login-wall-type");
}
}
// Remove login walls for elements before Javascript
removeLoginWall(document.body);
// Remove login walls for elements added by Javascript
let observer = new MutationObserver(function(mutations) {
for (let mutation of mutations) {
if (mutation.type !== "childList") {
continue;
}
for (let node of mutation.addedNodes) {
if (node.nodeType !== 1) {
continue;
}
removeLoginWall(node);
}
}
});
observer.observe(document.body, {childList: true, subtree: true});