Minecraft Gift Code Hider

Automatically hides gift codes and adds button to toggle visibility.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==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');