Auto expand things on lending club
当前为
// ==UserScript==
// @name Lending Club
// @namespace http://geekminute.com/
// @version 0.5
// @description Auto expand things on lending club
// @match https://www.lendingclub.com/*
// @copyright 2015+, Jon Heizer
// ==/UserScript==
setTimeout(function() {
//If there are any errors on the screen, jump out
if (document.querySelectorAll("#master_message-list > *").length > 0 && document.documentElement.innerHTML.indexOf('There was no activity during this period') > -1 )
{
return;
}
//Expand loan performance
if (document.getElementById("showLoanPerf") !== null)
{
document.getElementById("showLoanPerf").getElementsByTagName("a")[0].click();
}
//Expand payment history
if (document.getElementById("showPayments") !== null)
{
document.getElementById("showPayments").getElementsByTagName("a")[0].click();
}
//Account Activity
if (document.getElementById("submitAccountDates") !== null && document.getElementById("lender-activity-div") === null)
{
var yest = new Date();
yest.setDate(yest.getDate()-1);
document.getElementById("start-date").value = (yest.getMonth() + 1).toString() + "/" + yest.getDate().toString() + "/" + yest.getFullYear().toString();
document.getElementById("submitAccountDates").click();
}
setTimeout(function (){
//If there are any errors on the screen, jump out
if (document.querySelectorAll("#master_message-list > *").length > 0 && document.documentElement.innerHTML.indexOf('There was no activity during this period') > -1)
{
return;
}
//Any resizing combo
var sel = document.querySelector("select[id^='yui-pg0-0']");
if (sel !== null)
{
sel.value = 10000;
if ('fireEvent' in sel)
sel.fireEvent("onchange");
else {
var evt = document.createEvent("HTMLEvents");
evt.initEvent("change", false, true);
sel.dispatchEvent(evt);
}
}
},200);
//Add totals to detail tables
setTimeout(function (){
TableTotals();
},1000);
},500);
function TableTotals(){
if (document.querySelectorAll("#detailPanel-div").length > 0)
{
//Give the table a moment to fill before calculating
setTimeout(function (){
//Principal
var prin = document.querySelectorAll("td.yui-dt-col-principal div");
var ptotal = 0;
for (i = 0; i < prin.length; ++i) {
ptotal += parseFloat(prin[i].title.substr(1));
}
document.querySelectorAll("div.bd div")[0].innerHTML+= " <em>Principal:</em> <strong>$" + ptotal.toFixed(2) + "</strong>";
//Interest
var prin = document.querySelectorAll("td.yui-dt-col-interest div");
var ptotal = 0;
for (i = 0; i < prin.length; ++i) {
ptotal += parseFloat(prin[i].title.substr(1));
}
document.querySelectorAll("div.bd div")[0].innerHTML+= " <em>Interest:</em> <strong>$" + ptotal.toFixed(2) + "</strong>";
},1000);
}else{
setTimeout(function (){
TableTotals();
},1000);
}
}