Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
Pages: 1
Open your browser's console and try it.
var divsSpoiler = document.getElementsByClassName("spoiled");
for(var i = 0; i < divsSpoiler.length; i++) {
divsSpoiler[i].style.display = "";
}
EDIT: contribution by LukeM to make the script smaller ( but native javascript i guess )
Or you can use a shiny new(ish) for ... of loop (loops through values instead of keys)
for (var s of document.getElementsByClassName("spoiled")) s.style.display="";
EDIT: contribution by atillabyte to make this script smaller
4 lines down to 1.
$(".spoiled").css('display', '');
Offline
it works
Offline
I made it into a userscript for anyone interested
// ==UserScript==
// @name Open Spoilers
// @namespace https://forums.everybodyedits.com/viewtopic.php?pid=693389#p693389
// @version 0.1
// @description Opens all spoilers in everybodyedits.com
// @author Ninjasupeatsninja
// @include *forums.everybodyedits.com*
// @grant none
// ==/UserScript==
var divsSpoiler = document.getElementsByClassName("spoiled");
for(var i = 0; i < divsSpoiler.length; i++) {
divsSpoiler[i].style.display = "";
}
thanks zoey aaaaaaaaaaaand thanks latif for the avatar
Offline
I made it into a userscript for anyone interested
// ==UserScript== // @name Open Spoilers // @namespace https://forums.everybodyedits.com/viewtopic.php?pid=693389#p693389 // @version 0.1 // @description Opens all spoilers in everybodyedits.com // @author Ninjasupeatsninja // @include *forums.everybodyedits.com* // @grant none // ==/UserScript== var divsSpoiler = document.getElementsByClassName("spoiled"); for(var i = 0; i < divsSpoiler.length; i++) { divsSpoiler[i].style.display = ""; }
does it actually work? I've always had the worst luck getting normal scripts to run on greasemonkey without weird injection tricks
you're probably doing chrome?
Offline
Xfrogman43 wrote:I made it into a userscript for anyone interested
// ==UserScript== // @name Open Spoilers // @namespace https://forums.everybodyedits.com/viewtopic.php?pid=693389#p693389 // @version 0.1 // @description Opens all spoilers in everybodyedits.com // @author Ninjasupeatsninja // @include *forums.everybodyedits.com* // @grant none // ==/UserScript== var divsSpoiler = document.getElementsByClassName("spoiled"); for(var i = 0; i < divsSpoiler.length; i++) { divsSpoiler[i].style.display = ""; }
does it actually work? I've always had the worst luck getting normal scripts to run on greasemonkey without weird injection tricks
you're probably doing chrome?
Works for me, I'm using tampermonkey on firefox
thanks zoey aaaaaaaaaaaand thanks latif for the avatar
Offline
4 lines down to 1.
$(".spoiled").css('display', '');
*u stinky*
Offline
4 lines down to 1.
$(".spoiled").css('display', '');
alternatively
var divsSpoiler = document.getElementsByClassName("spoiled"); for(var i = 0; i < divsSpoiler.length; i++) {divsSpoiler[i].style.display = "";}
edit: /s
but yeah good point
Offline
updated op - thanks atilla
didn't know forums used jquery.
@hummerz5:
alternatively:
for(var e=document.getElementsByClassName("spoiled"),i=0;i<e.length;i++)e[i].style.display="";
Offline
Pages: 1
[ Started around 1738349903.4223 - Generated in 0.068 seconds, 12 queries executed - Memory usage: 1.53 MiB (Peak: 1.7 MiB) ]