Created
August 15, 2009 03:18
-
-
Save knewter/168251 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Regions - Account Titles | |
// @namespace Regions | |
// @description Gives my Regions account numbers appropriate titles... | |
// @include https://securebank.regions.com/balances/AccountSummary.aspx | |
// ==/UserScript== | |
// Replace any text in #dgCheckingAccounts td that matches | |
// an account number with the appropriate account title. | |
// set up jQuery variable | |
var $; | |
// Add jQuery | |
var GM_JQ = document.createElement("script"); | |
GM_JQ.src = "http://code.jquery.com/jquery-latest.min.js"; | |
GM_JQ.type = "text/javascript"; | |
document.body.appendChild(GM_JQ); | |
// Check if jQuery's loaded | |
var checker=setInterval(function(){ | |
if(typeof ($ = unsafeWindow.jQuery) != "undefined") { | |
clearInterval(checker); | |
letsJQuery(); | |
} | |
},100); | |
// All your GM code must be inside this function | |
function letsJQuery() { | |
var accounts = { | |
"3258": "GROCERIES", | |
"3215": "BLOW MONEY", | |
"3231": "UTILITIES", | |
"3223": "PAYMENTS", | |
}; | |
$.each(accounts, function(key, value){ | |
$.each($("#dgCheckingAccounts td:contains('" + key + "')"), function(el){ | |
$(this).html($(this).html().replace("******" + key, value + " [" + key + "]")); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment