misskey_cw_toggle: update for Misskey 12.112

This commit is contained in:
tastytea 2022-07-13 01:31:33 +02:00
parent 697eb57ab8
commit edd90c4c9c
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Misskey CW toggle // @name Misskey CW toggle
// @description Adds a button to toggle the visibility of all notes with content warnings on note-pages. // @description Adds a button to toggle the visibility of all notes with content warnings on note-pages.
// @version 2022.05.17.4 // @version 2022.07.13.1
// @author tastytea // @author tastytea
// @copyright 2022, tastytea (https://tastytea.de/) // @copyright 2022, tastytea (https://tastytea.de/)
// @license GPL-3.0-only // @license GPL-3.0-only
@ -20,7 +20,7 @@ let counter = 0;
// Toggle the visibility of each status with CW. // Toggle the visibility of each status with CW.
function toggle() { function toggle() {
const root = document.getElementsByClassName("_block _isolated note")[0]; const root = document.getElementsByClassName("_block note")[0];
if (root === undefined) { if (root === undefined) {
return; return;
} }
@ -35,7 +35,7 @@ function toggle() {
// Add a “Toggle all CWs”-button. // Add a “Toggle all CWs”-button.
function add_button() { function add_button() {
let root = document.getElementsByClassName("_block _isolated note")[0]; let root = document.getElementsByClassName("_block note")[0];
if (root === undefined) { if (root === undefined) {
console.error("No suitable parent-element found."); console.error("No suitable parent-element found.");
return; return;
@ -54,7 +54,7 @@ function add_button() {
} }
function check() { function check() {
const root = document.getElementsByClassName("_block _isolated note")[0]; const root = document.getElementsByClassName("_block note")[0];
if (root === undefined) { if (root === undefined) {
return; return;
} }