Minecraft Gift Code Hider

Automatically hides gift codes and adds button to toggle visibility.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        Minecraft Gift Code Hider
// @namespace   https://greasyfork.org/users/5927-encarton
// @description Automatically hides gift codes and adds button to toggle visibility.
// @include     http://minecraft.net/profile
// @include     https://minecraft.net/profile
// @include     http://account.mojang.com/me
// @include     https://account.mojang.com/me
// @icon        http://www.minecraft.net/favicon.png
// @version     2.2
// ==/UserScript==

//This time with jQuery!
//Since they have it and it makes things easier.

//Check for Location, if it isn't Minecraft.net assume Mojang
if ( document.location.href.search('profile') > 0){
    //Hide Gift Code List on Minecraft.net
    $('ul:eq(2)').wrap('<div id="giftCodes"></div>');
    $('#giftCodes').hide();
    //Create Button on Minecraft.net
    $('<button id="toggle" onclick="toggleVisibility()">Show Gift Codes</button>').insertBefore("#giftCodes");
} else {
    //Hide Gift Code List on Mojang.com
    $('#giftCodes').hide();
    //Create Button on Mojang.com
    $('<button id="toggle" onclick="toggleVisibility()" style="margin:20px;">Show Gift Codes</button>').insertBefore("#giftCodes");
}

//Add Function to Web Page so the Button Works
$('<script type="text/javascript">function toggleVisibility(){'
+'var container = $("#giftCodes");'
+'if (container.is(":visible")){'
+'$("#toggle").html("Show Gift Codes");'
+'container.slideToggle("slow");'
+'} else {'
+'$("#toggle").html("Hide Gift Codes");'
+'container.slideToggle("slow");'
+'}}</script>').appendTo('body');