Lending Club

Auto expand things on lending club

目前為 2015-06-12 提交的版本,檢視 最新版本

// ==UserScript==
// @name       Lending Club
// @namespace  http://geekminute.com/
// @version    0.4
// @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);


},500);