eBay Filter Active Inventory

Search filter for the current inventory

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        eBay Filter Active Inventory
// @namespace   riceball
// @description Search filter for the current inventory
// @include     http://my.ebay.com/*
// @version     1
// @grant       none
// @resource $ 
// ==/UserScript==

/*
  This is a script for people selling things on eBay.
  
  This script adds a "filter" box to the table of active listings.
  You can type in a search term, and everything matching the term
  will be filtered in.  Everything else will be deleted from the 
  list.  After you filter, you cannot "undo" or remove the filter
  to see all the rows again.  You need to refresh the page.
  
  Display a lot of rows to have more stuff to filter.
  
  The best way to use this is to title your listings consistently,
  so you can quickly find subsets of your listings.  
*/

function mytool($) {
    function myfilter(evt) {
        evt.preventDefault();
        console.log("myfilter called");
        var search = new RegExp($("#mysearchfield").val(), 'iu');
        $(".my_itl-itR").each(function (idx, el) {
            var title = $(this).find("td").eq(3).find("div>div>a.g-asm").attr("title");
            if (! title.match(search)) {
                console.log( title, " did not match");
                //$(this).hide();
                $(this).remove();
            } else {
                console.log( title, " matches");
            }
        });
    }

    function button_attacher() {
        console.log("button_attacher trying to attach");
        if ($('#ItemDisplayContainer_SellingNext').length > 0) {
	        $mybutton = $('<input id="mysearchfield" value="" style="margin-left: 7px;" /><button id="mysearchbutton" style="margin-right: 9px;">Filter</button>');
	        $mybutton.click(myfilter);
	        $thing = $('#ItemDisplayContainer_SellingNext').find('.r3_hm>table>tbody>tr>td>h2:first');
	        $thing.append($mybutton);
	        window.clearInterval(myattacher);
	        myattacher = undefined;
        } else {
	        console.log("found no dialog - skipping");
        }
    }

    myattacher = window.setInterval(button_attacher, 1000); // every 10 seconds, try to attach the button to the dialog.

}

// Check if jQuery's loaded
function GM_wait() {
    if (typeof window.jQuery == 'undefined') {
        window.setTimeout(GM_wait, 100);
    } else {
        mytool(window.jQuery);
    }
}

GM_wait();