Quote:
Originally Posted by l_macd
I'll need to see if I can get the files for Check and Delete and see if I can do the same with it instead.
|
Here is the bookmarklet:
Code:
javascript:(function(){var%20isBulkDeleteLoaded%20=%20false;%20if%20(!isBulkDeleteLoaded)%20{%20js%20=%20document.createElement('SCRIPT');%20js.type%20=%20'text/javascript';%20js.src%20=%20'//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js';%20document.getElementsByTagName('head')[0].appendChild(js);%20js%20=%20document.createElement('SCRIPT');%20js.type%20=%20'text/javascript';%20js.src%20=%20'//myk-check-and-delete.googlecode.com/files/myk-check-delete.js';%20document.getElementsByTagName('head')[0].appendChild(js);%20isBulkDeleteLoaded%20=%20true;%20}})();
In readable form (as per the home page):
Quote:
Quote:
var isBulkDeleteLoaded = false;
if (!isBulkDeleteLoaded) {
js = document.createElement('SCRIPT');
js.type = 'text/javascript';
js.src = '//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js';
document.getElementsByTagName('head')[0].appendChild(js);
js = document.createElement('SCRIPT');
js.type = 'text/javascript';
js.src = '//myk-check-and-delete.googlecode.com/files/myk-check-delete.js';
document.getElementsByTagName('head')[0].appendChild(js);
isBulkDeleteLoaded = true;
}
|
The bookmarklet loads jQuery from Google CDN plus a short script that adds the checkboxes and the button.
Here's the content of this script (up-to-date content fetched dynamically):
Quote:
$(document).ready(function() {
$('.firstCol').css('width', 'auto');
$('.rowBodyCollapsed').each(function(i){
$('#Row'+(i+1)+'Button')
.css('white-space', 'nowrap')
.prepend('<input type="checkbox" name="asin" value="'+$(this).attr('asin')+'">');
});
$('#pagination').prepend('<input type="button" id="bulkDelete" value="Bulk Delete">');
$('#bulkDelete').click(function() {
$('input[name=asin]:checked').each(function() {
// alert($(this).val());
Fion.deleteItem('deleteItem_'+$(this).val());
});
});
});
|
|