eBay Filter Active Inventory

Search filter for the current inventory

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

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

Tendrás que instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Tendrás que instalar una extensión como Tampermonkey antes de poder instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

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