Greasy Fork is available in English.
Keeps a log of edits
当前为
// ==UserScript==
// @name SGW Item Modification Helper
// @namespace greasyfork.org
// @version 0.0.2
// @grant none
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
// @require http://greasyfork.icu/scripts/10208-gm-api-script/code/GM%20API%20script.js?version=54964
// @include https://sellers.shopgoodwill.com/sellers/modifyItem.asp*
// @description Keeps a log of edits
// ==/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;
}
});
});
};
//$('input ').not('[id]').is('[name]').each(function(){
$('*[name]').not('[id]').each(function(){
// alert($(this).attr('name'));
// console.log($(this).attr('name'));
$(this).attr('id', $(this).attr('name'));
});
var myValues = JSON.parse(GM_getValue("myValues", ""));
if (typeof myValues === "undefined") {
alert();
} else {
alert(1);
}
$('#runOnce').val(1);
var labels = {
's1' : 'Category',
// 'table' : 'Description',
'itemWeight' : 'Shipping weight',
'itemDisplayWeight' : 'Actual weight',
'itemShippingPrice' : 'Shipping charge',
'itemHandlingPrice' : 'Handling',
'itemShipMethod' : 'Shipping method',
'itemsellerstore' : 'Store number',
'itemSellerInventoryLocationID' : 'Location',
}
var counter = 0;
var values = [];
values[counter] = {};
$.each(labels, function(elementID, fieldLabel){
values[counter][fieldLabel] = $('#'+elementID).val();
console.log(elementID + $('#'+elementID).val());
});
counter++;
console.dir(values);
// don't forget checkboxes! also #table does not have a val()...
// can I touch $('body.WebWizRTEtextarea')???