diff --git a/readme.md b/readme.md index 8e4108c..8babcd6 100644 --- a/readme.md +++ b/readme.md @@ -68,8 +68,12 @@ This project aims to add an additional layer of information and functionality to - Show a row with the loans country. - Show a row with days to next payment. - Show a row with the on-time payment percentage. +- Show a row with total time in grace for the payments. - Format the loan breakdown table properly. - Show the ExploreP2P rating for that loan originator. +- Show a warning for high aged borrowers. +- Show a warning for low on-time payment history. +- Show a warning for unemployed borrowers.
diff --git a/src/options/img/LoanShowJobWarning_0.png b/src/options/img/LoanShowJobWarning_0.png new file mode 100644 index 0000000..d23c8c1 Binary files /dev/null and b/src/options/img/LoanShowJobWarning_0.png differ diff --git a/src/options/img/LoanShowJobWarning_1.png b/src/options/img/LoanShowJobWarning_1.png new file mode 100644 index 0000000..81c7c56 Binary files /dev/null and b/src/options/img/LoanShowJobWarning_1.png differ diff --git a/src/options/img/LoanShowTotalGraceTime_0.png b/src/options/img/LoanShowTotalGraceTime_0.png new file mode 100644 index 0000000..a063218 Binary files /dev/null and b/src/options/img/LoanShowTotalGraceTime_0.png differ diff --git a/src/options/img/LoanShowTotalGraceTime_1.png b/src/options/img/LoanShowTotalGraceTime_1.png new file mode 100644 index 0000000..f660f66 Binary files /dev/null and b/src/options/img/LoanShowTotalGraceTime_1.png differ diff --git a/src/options/index.html b/src/options/index.html index a00a177..8a263ee 100644 --- a/src/options/index.html +++ b/src/options/index.html @@ -49,11 +49,13 @@ + - + +

Show the full country name.

example

Show an 'ontime payment' percentage.

example

Show 'total gracetime' for payments.

example

Reformat investment breakdown table.

example

Show next payment in days.

example

Show ExploreP2P's loan originator rating.

example

Show warning on bad payment history.

example

Show warning for high age borrower.

example

Show warning for high age borrowers.

example

Show warning for unemployed borrowers

example

Auto Invest

diff --git a/src/options/index.js b/src/options/index.js index fe143ff..ad1bd9b 100644 --- a/src/options/index.js +++ b/src/options/index.js @@ -31,11 +31,13 @@ chrome.storage.sync.get( // loan.js 'LoanShowCountryRow' : true, 'LoanShowOntimePaymentPercent' : true, + 'LoanShowTotalGraceTime' : true, 'LoanFormatInvestmentBreakdown' : true, 'LoanShowNextPaymentRow' : true, 'LoanShowAdditionalRatings' : true, 'LoanShowPaymentWarning' : true, 'LoanShowAgeWarning' : true, + 'LoanShowJobWarning' : true, // accountStatement.js 'AccountOverviewUseFourDecimals' : false, diff --git a/src/scripts/sites/loan.js b/src/scripts/sites/loan.js index 08c0946..9e2c0bd 100644 --- a/src/scripts/sites/loan.js +++ b/src/scripts/sites/loan.js @@ -11,10 +11,12 @@ chrome.storage.sync.get 'LoanShowCountryRow' : true, 'LoanShowNextPaymentRow' : true, 'LoanShowOntimePaymentPercent' : true, + 'LoanShowTotalGraceTime' : true, 'LoanFormatInvestmentBreakdown' : true, 'LoanShowAdditionalRatings' : true, 'LoanShowPaymentWarning' : true, 'LoanShowAgeWarning' : true, + 'LoanShowJobWarning' : true, }, function (settings) @@ -199,6 +201,28 @@ chrome.storage.sync.get details.appendChild(node); } + if (settings.LoanShowTotalGraceTime) + { + var $days = 0; + + schedule.querySelectorAll('tr').forEach(function (element) + { + if (element.lastChild.innerText == localization('$Paid')) + { + var cells = element.querySelectorAll('td'); + var date = getElementByAttribute(cells, 'data-m-label', localization('$Date')); + var date_paid = getElementByAttribute(cells, 'data-m-label', localization('$PaymentDate')); + + if (date_paid.innerText.trim().length > 0) + { + $days = $days + Math.floor((toDate(date_paid.innerText.trim()) - toDate(date.innerText.trim())) / 86400000); + } + } + }); + + details.appendChild(createDetailsRow(localization('TimeInGrace'), $days + ' ' + localization('Days'))); + } + /* * Replace the investment breakdown unordered list, with a table. The table * shows the same informations, and the same colours but formated with rows @@ -357,6 +381,23 @@ chrome.storage.sync.get } } } + + /* + * Experimental + */ + if (settings.LoanShowJobWarning) + { + for (var rows = borrower.querySelectorAll('tr'), i = 0; i < rows.length; i++) + { + if (rows[i].firstChild.innerText == localization('$Occupation')) + { + if (rows[i].lastChild.innerText.toLowerCase() == 'unemployed') + { + insertElementBefore(createDetailsRowWarning(localization('$Occupation'), rows[i].lastChild.innerText), details.firstChild); break; + } + } + } + } } function localization (field) @@ -383,6 +424,16 @@ chrome.storage.sync.get 'lv' : '?', 'ru' : '?' }, + 'TimeInGrace' : + { + 'en' : 'Time in grace', + 'de' : 'Zeit in Schonfrist', + 'pl' : 'Całkowity czas karencji', + 'cs' : '?', + 'es' : '?', + 'lv' : '?', + 'ru' : '?' + }, 'Ontime' : { 'en' : 'on-time', @@ -507,7 +558,7 @@ chrome.storage.sync.get { 'en' : 'Late', 'de' : 'In Verzug', - 'pl' : '?', + 'pl' : 'Late', 'cs' : '?', 'es' : '?', 'lv' : '?', @@ -543,6 +594,16 @@ chrome.storage.sync.get 'lv' : '?', 'ru' : '?' }, + '$Date' : + { + 'en' : 'Date', + 'de' : 'Datum', + 'pl' : 'Data', + 'cs' : '?', + 'es' : '?', + 'lv' : '?', + 'ru' : '?' + }, '$Paid' : { 'en' : 'Paid', @@ -553,6 +614,16 @@ chrome.storage.sync.get 'lv' : '?', 'ru' : '?' }, + '$PaymentDate' : + { + 'en' : 'Payment Date', + 'de' : 'Zahlungsdatum', + 'pl' : 'Data płatności', + 'cs' : '?', + 'es' : '?', + 'lv' : '?', + 'ru' : '?' + }, '$Scheduled' : { 'en' : 'Scheduled', @@ -563,6 +634,16 @@ chrome.storage.sync.get 'lv' : '?', 'ru' : '?' }, + '$Occupation' : + { + 'en' : 'Occupation', + 'de' : 'Occupation', + 'pl' : 'Zawód', + 'cs' : '?', + 'es' : '?', + 'lv' : '?', + 'ru' : '?' + }, '$Borrower' : { 'en' : 'Borrower',