September 19, 2019, 02:45:14 AM

------------------------------------------

If you have Login Problems Use the Login in Top Menu Bar


------------------------------------------
If you have a problem registering here, Leave a msg at our FB Page >> Here.

Plz Don't use Hotmail to Register. You might not receive Activation mail. Use Other free mail provider like Gmail or Yahoo.






Author Topic: Expand all MR Spoilers on a page (Bookmarklet)  (Read 439 times)

0 Members and 1 Guest are viewing this topic.

Offline suuper-san

  • Hero Member
  • *****
  • Posts: 4733
  • Gender: Male
  • I have no idea what I am doing XD
    • View Profile
Expand all MR Spoilers on a page (Bookmarklet)
« on: December 29, 2018, 08:47:12 AM »
I thought there was a coding section somewhere but I couldn't find it so it sort of fits here I thought to myself :P

Something I threw together in 5 minutes that I thought I would share.
Sometimes you have loads of spoilers on a page and you just want to open them all if you're looking for something or reading the whole page, right?
(Especially if you have the post count per page to the highest value there's a lot of spoilers per page)
Well I made a bookmarklet that does that. Just make a new bookmark (or edit an old one), and paste this code in the URL text box.

Code: [Select]
javascript:(function()%7Bvar%20spBody%3Ddocument.getElementsByClassName(%22sp-body%22)%3Bfor(var%20i%3D0%3Bi%3CspBody.length%3Bi%2B%2B)%7BspBody%5Bi%5D.style.display%3D%22block%22%3B%7Dvar%20spHead%3Ddocument.getElementsByClassName(%22sp-head%22)%3Bfor(var%20i%3D0%3Bi%3CspHead.length%3Bi%2B%2B)%7BspHead%5Bi%5D.className%3D%22sp-head%20sp-closed%22%3B%7D%7D)()

So it looks like this in the edit window



Save it, and then whenever you are on a page you can click on the bookmark and it will open all the spoilers on that page.

It's only tested in Chrome on PC, so I can't say how it works in other browsers or mobile devices, but if it works for you then great :)

As a partially unexpected bonus it also works on the Ecchiworld forum as well.

It's not an extension so it cant permanently open every spoiler, just the ones on the page you are on. I will at some point write an MR extension with some other stuff but that's years down the line haha.
« Last Edit: December 29, 2018, 09:02:54 AM by suuper-san »
Art: Manga / Fanart / Requests (closed) / Other | Manga Stories: Overdrive / Endlessness
Other: Tutorials / Craft | Feedback & Critique Welcome!!

Offline legomaestro

  • High Chancellor of Righteousness
  • Global Moderator
  • Hero Member
  • *
  • Posts: 19446
  • Gender: Male
  • real life has wack graphics
    • View Profile
Re: Expand all MR Spoilers on a page (Bookmarklet)
« Reply #1 on: December 29, 2018, 10:44:29 AM »
Damn, you're a beast man. Just how the heck. This is the sort of practical coding to die for haha.

Offline suuper-san

  • Hero Member
  • *****
  • Posts: 4733
  • Gender: Male
  • I have no idea what I am doing XD
    • View Profile
Re: Expand all MR Spoilers on a page (Bookmarklet)
« Reply #2 on: December 29, 2018, 05:30:27 PM »
haha when you know code it's hard to not use it to solve problems :P
Art: Manga / Fanart / Requests (closed) / Other | Manga Stories: Overdrive / Endlessness
Other: Tutorials / Craft | Feedback & Critique Welcome!!