// ==UserScript==
// @name SGW Fixer - Users
// @namespace https://greasyfork.org
// @include https://sellers.shopgoodwill.com/sellers/newAuctionItem-catsel.asp*
// @include https://sellers.shopgoodwill.com/sellers/reviewItem-label.asp*
// @include https://sellers.shopgoodwill.com/sellers/reviewItem-label.asp?state=2
// @include https://sellers.shopgoodwill.com/sellers/listerpostings.asp*
// @include http://localhost/sgw.html
// @version 1.3.5.1
// @description Contains user definitions for the SGW Fixer script
// @grant none
// @require https://greasyfork.org/scripts/10208-gm-api-script/code/GM%20API%20script.js?version=54964
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);
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(
$('<option>').text(option.text).val(option.value)
);
}
});
if (selectSingleMatch === true &&
$(select).children().length === 1) {
$(select).children().get(0).selected = true;
}
});
});
};
var myPosters = {
"Ann S" : {
"name" : "Ann",
"duration" : 7
},
"Jeff H" : {
"name" : "Jeff",
"duration" : 7,
"skip" : "allow",
},
"Jacob L" : {
"name" : "Jacob",
"duration" : 7,
"skip" : "allow",
},
"Jackie C" : {
"name" : "Jackie"
},
"Jeremy J" : {
"name" : "Jeremy",
"skip" : "allow",
},
"Kathy O" : {
"name" : "Kathy",
"skip" : "allow",
},
"Matt R" : {
"name" : "Matt",
},
"Nick Q" : {
"name" : "Nick"
},
"Phalada X" : {
"name" : "Phalada",
"duration" : 7,
"skip" : "allow",
},
"Steven R" : {
"name" : "Steven",
"skip" : "allow",
},
"Tanya K" : {
"name" : "Tanya"
},
"Tom B" : {
"name" : "Tom",
},
"Valerie W" : {
"name" : "Valerie",
"duration" : 7,
"skip" : "allow",
},
"Jane F" : {
"name" : "Jane",
"duration" : 7,
"skip" : "allow",
},
}
serial = JSON.stringify(myPosters);
//$('#posterData').html(serial);
$('body').append("<div id='posterData'>" + serial + "</div>");
/*$('#posterData').data("data", "fooooo");
console.log('foo' + $('#posterData').data("data"));*/