Skip to content

Instantly share code, notes, and snippets.

@xerxesb
Created February 5, 2012 11:39
Show Gist options
  • Save xerxesb/1744913 to your computer and use it in GitHub Desktop.
Save xerxesb/1744913 to your computer and use it in GitHub Desktop.
Netbank hackery
var BetterNetbank = {
inject: function(table) {
if ($("#" + table).length > 0) {
$('#' + table + ' thead tr').prepend('<th>X</th>');
$('#' + table + 'Body > tr').map(function() {
$(this).prepend('<td><input type="checkbox" /></td>');
});
}
}
}
BetterNetbank.inject('transactionsTable');
BetterNetbank.inject('outstandingAuthorizationsTable');
var theShizzle = function() {
BetterNetbank.inject('transactionsTable');
BetterNetbank.inject('outstandingAuthorizationsTable');
}
var doTheShizzle = function(event) {
document.removeEventListener('DOMSubtreeModified', doTheSizzle,true);
if (event.target.id == "ctl00_BodyPlaceHolder_updatePanelResults" && event.target.innerHtml != "")
theShizzle();
document.addEventListener('DOMSubtreeModified', doTheSizzle,true);
return true;
}
document.addEventListener('DOMSubtreeModified', doTheSizzle,true);
//$('#ctl00_BodyPlaceHolder_btnSearch_field').bind('click', theShizzle);
//$('#ctl00_BodyPlaceHolder_divDetails').bind('DOMAttrModified', theShizzle);
//$('#ctl00_BodyPlaceHolder_updatePanelResults').bind('DOMSubtreeModified', theShizzle);
$(document).bind('DOMSubtreeModified', theShizzle);
var c = $('#ctl00_BodyPlaceHolder_divDetails');
c.__setAttribute = c.setAttribute;
c.setAttribute = function(){
alert('new item added');
c.__setAttribute.apply(c, arguments);
@xerxesb
Copy link
Author

xerxesb commented Feb 13, 2012

stupid sandbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment