NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Wowhead Mount Guide as Checklist
// @namespace http://tampermonkey.net/
// @version 1.1.1
// @description Turns the collector's guide into a personal checklist, allowing you to mark mounts as owned, dimming them for easier scanning.
// @author Alabit
// @match http://www.wowhead.com/guide=4651/completionist-mount-collectors-guide
// Fix for people with adblockers
// @match http://www.wowhead.com/g00/guide=4651/completionist-mount-collectors-guide?i10c.referrer=http%3A%2F%2Fwww.wowhead.com%2Fguide%3D4651%2Fcompletionist-mount-collectors-guide
// @require http://code.jquery.com/jquery-3.2.1.min.js
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_addStyle
// ==/UserScript==
//Wowhead's ads are so intrustive as to break most scripts.
$('.banner-ad').remove()
GM_addStyle('input[type=checkbox]:checked + a {opacity:.33;}');
var myList = JSON.parse (GM_getValue ("myListArray", null) ) || [];
var mountList = $('tr>td>a[href*="/item="]');
//Adds the checkboxes
for (var i = 0; i<mountList.length; i++) {
$(mountList[i]).before($('<input class="markOwned" type="checkbox">'));
}
//Checks the ones you marked
for (var i = 0; i<Object.keys(myList).length; i++) {
if (myList[Object.keys(myList)[i]]) {
$('a[href="'+Object.keys(myList)[i]+'"]').prev().prop('checked', true);
}
}
//Saves your changes
$('.markOwned').click(function() {
myList[$(this).next().attr('href').toString()] = $(this).prop('checked');
GM_setValue ("myListArray", JSON.stringify (myList) );
});