Skip to content

Instantly share code, notes, and snippets.

@gurdiga
Created September 30, 2013 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gurdiga/6760137 to your computer and use it in GitHub Desktop.
Save gurdiga/6760137 to your computer and use it in GitHub Desktop.
Personalized Web Options for Kindle Library to delete an item with a double click.
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script>
var q = jQuery.noConflict(true);
q(function($) {
$('table#orderList').on('dblclick', 'tr[id~="collapse"]', function() {
var $tr = $(this),
sessionId = document.cookie.split(';')
.map(function(item) { return item.split('=', 2).map(function(token) { return token.toString().trim(); }); })
.filter(function(pair) { return pair[0] == 'session-id'; })[0][1];
var data = {
contentName: $tr.find('input[name="contentName"]').val(),
loanId: '',
sid: sessionId,
isAjax: 1,
category: 'kindle_pdoc',
orderID: 'undefined'
};
$tr.find('td').css({color: 'red'});
$.post('/gp/digital/fiona/du/fiona-delete.html', data, function() {
$tr.remove();
});
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment