Created
June 5, 2019 01:43
-
-
Save werrpy/7061ea1670072cf3f615d3057a29979a to your computer and use it in GitHub Desktop.
UNIT3D fix spoilers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name UNIT3D Fix Spoiler | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function toggleSpoiler(element) { | |
if (element.style.display === '') { | |
element.style.display = 'none'; | |
} else { | |
element.style.display = ''; | |
} | |
} | |
var spoilerButtons = document.querySelectorAll(".decoda-spoiler-button"); | |
spoilerButtons.forEach(function(element) { | |
element.onclick = function() { | |
toggleSpoiler(this.nextElementSibling); | |
}; | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment