MLB The Show Nation - Inventory Expander 17

Expands inventory screens to include ALL cards, not just a few at a time. Also provides a DUPES button to only show duplicate cards.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         MLB The Show Nation - Inventory Expander 17
// @namespace    https://greasyfork.org/en/users/8332-sreyemnayr
// @version      2017.6
// @description  Expands inventory screens to include ALL cards, not just a few at a time.  Also provides a DUPES button to only show duplicate cards.
// @author       sreyemnayr
// @match        http://theshownation.com/inventory?*
// @match        http://www.theshownation.com/inventory?*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var table = $('.marketplace-search');
    var pagination_links = $('.moreLinks a:not(.next_page)');
    
    $(pagination_links).each(function(i){
        var url = $(this).attr('href');
        $.ajax({url:url, context:this}).done(function(b){ 
            var thisTable = $(b).find('.marketplace-search');

            $(table).append($(thisTable).children());

        });
    });
    var btn = document.createElement('button');
    btn.appendChild(
        document.createTextNode("DUPES")
    );
    btn.className = 'btn btn-xs btn-success';
    $('.title-bar')[0].append(btn);
    
    $(btn).click(function(i){
        $($(table).find('tr')).each(function(i){
            var owned = parseInt($($(this).find('td')[2]).text());
            if(isNaN(owned) || owned <= 1){
                $(this).hide();
            }

        });
        console.log("click");
    });
    
})();