3

Temporary spoiler buttons!

Comments:
Threaded Linear
#1
Sayabi

So because it has been asked a lot, and that Clickbait made a quick fix, and I enhanced it, and I actually enhanced it a lot, I decided to make a thread about it so people could give feedback easier.

I'm glad to introduce you: (temporary) Over.gg scores spoilers buttons!

Note: The scores will take some time before getting hidden (only some milliseconds) so spoilers can still happen, so just don't look at the score areas before the end of the page loading!

How to install

  • Install the extension Tampermonkey for whatever browser you're using.
  • Create a new script.
  • Add the code given at the end of the post.

To do

  • Display scores of Upcoming Matches and Completed Matches separately.
  • Add a "Hide" button? Like toggling scores? I don't know if that would be useful to you guys, please tell me.
  • Clean the code (I'm so sorry it's that messy)
  • Make extensions? Honestly that could be a fun exercise for me to learn how to do extensions for different browsers.
  • Add spoilers in tournament pages

Credits

  • Clickbait for the v0.1 of the script
  • enigma for making such an awesome website with such a clean code (honestly, it's so clean I've only got one remark about it)
  • Myself (nei) for typing this goddamn stupid ugly code while watching GLA vs. LDN

Changelog

  • 0.3 (latest): Adds a button to show the matches on homepage, also adding some styling to the buttons
  • 0.2: Hides the scores on match pages with a button to show them as well as maps results
  • 0.1: Hides the scores on the homepage

Code

// ==UserScript==
// @name         Stop Spoiling Me Daddy v0.3
// @namespace    https://www.over.gg/user/nei
// @version      0.3
// @description  Hides scores on over.gg and adds a button to show them
// @author       nei (based on Clickbait's one)
// @match        https://www.over.gg/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    if($('.h-match-team-score').length) // Checks if we're on the homepage
    {
        $('.h-match-team-score').hide(); // Hides the score on homepage
        $('.wf-module-header:contains("upcoming matches")').parent().before('<input type="button" value="SHOW SCORES" class="spoiler-button" onclick="$(\'.spoiler-button\').hide(); $(\'.h-match-team-score:not(:contains(no_score))\').show();" style="color:#888; font-family: \'Roboto\', sans-serif; font-size: 10px; width: 240px; height: 25px; margin-bottom:5px;">'); // Adds button to toggle score on home page's matches
    }
    if($('.match-header-vs-score').length) // Checks if the score on the match page is displayed (i.e. if the match is ongoing/over). We won't hide it nor show the spoiler button if it isn't.
    {
        $('.match-header-vs-score').hide(); // Hides the score on match page
        $('.game-switch-map').hide(); // Hides the map name. If there is "N/A", you can guess the score in a way, so I removed it. Yes, I am THAT bored.
        $('.game-stats').hide(); // Hides the map results
        $('.match-header-vs-note').first().after('<input type="button" value="SHOW" class="spoiler-button" onclick="$(\'.spoiler-button\').hide(); $(\'.game-switch-map\').show(); $(\'.game-stats\').show();  $(\'.match-header-vs-score\').show();" style="color:#888; font-family: \'Roboto\', sans-serif; font-size: 10px; margin:11px;">'); // Adds the "Show button" on match page. And yes, the way I add it is ugly.
    }
})();
#2
Guinea
3
Frags
+

// @name Stop Spoiling Me Daddy v0.3

#3
Sayabi
4
Frags
+
Guinea [#2]

// @name Stop Spoiling Me Daddy v0.3

It's actually the name Clickbait gave to it I didn't feel like renaming it

#4
FrozenJackal
0
Frags
+

Is there a way to have the button toggle show/hide scores? I have to refresh if I want to hide the score again

#5
Sayabi
3
Frags
+
FrozenJackal [#4]

Is there a way to have the button toggle show/hide scores? I have to refresh if I want to hide the score again

That's on the todo list! I'm gonna look into it tomorrow or this weekend

#6
Guinea
0
Frags
+
Sayabi [#3]

It's actually the name Clickbait gave to it I didn't feel like renaming it

Don't change it, it's very good.

#7
Clickbait
2
Frags
+

i offer a naming consulting service, pm me if you need something named for cheap

  • Preview
  • Edit
› check that that your post follows the forum rules and guidelines or get formatting help
Sign up or log in to post a comment