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.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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");
    });
    
})();