// ==UserScript== // @name SGW Menu Filterer & General Helper // @namespace greasyfork.org // @version 1.8.0.1 // @grant none // @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js // @include https://sellers.shopgoodwill.com/* // @include http://*shopgoodwill.com* // @exclude https://sellers.shopgoodwill.com/sellers/newAuctionItem-catsel.asp* // @exclude https://sellers.shopgoodwill.com/sellers/fileUpload/* // @description Adds simple filters to menus on shopgoodwill // @downloadURL https://update.greasyfork.icu/scripts/23447/SGW%20Menu%20Filterer%20%20General%20Helper.user.js // @updateURL https://update.greasyfork.icu/scripts/23447/SGW%20Menu%20Filterer%20%20General%20Helper.meta.js // ==/UserScript== this.$ = window.jQuery.noConflict(true); var url = document.URL; if ($('a:contains("View")').length >= 1 && url.toLowerCase().indexOf('customer_service') >= 0) { $('a:contains("View")').each(function(){ $(this).parent().find('input').each(function(){ if($(this).val().indexOf('View')>=0) { $(this).hide(); } }); }); } jQuery.fn.filterByText = function(textbox, selectSingleMatch) { return this.each(function() { var select = this; var options = []; $(select).find('option').each(function() { options.push({value: $(this).val(), text: $(this).text()}); }); $(select).data('options', options); $(textbox).bind('change keyup', function() { var options = $(select).empty().scrollTop(0).data('options'); var search = $.trim($(this).val()); var regex = new RegExp(search,'gi'); $.each(options, function(i) { var option = options[i]; if(option.text.match(regex) !== null) { $(select).append( $('