Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #69 from DeeNaxic/development
Browse files Browse the repository at this point in the history
Version 1.3.0
  • Loading branch information
DeeNaxic authored Feb 6, 2020
2 parents d50b00a + fc3a3e9 commit ed70939
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 2 deletions.
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<br>

Expand Down
Binary file added src/options/img/LoanShowJobWarning_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/options/img/LoanShowJobWarning_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/options/img/LoanShowTotalGraceTime_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/options/img/LoanShowTotalGraceTime_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/options/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@
<table>
<tr id="LoanShowCountryRow" ><td><input type="checkbox"></td><td><p>Show the full country name. </p></td><td><p>example</p></td></tr>
<tr id="LoanShowOntimePaymentPercent" ><td><input type="checkbox"></td><td><p>Show an 'ontime payment' percentage. </p></td><td><p>example</p></td></tr>
<tr id="LoanShowTotalGraceTime" ><td><input type="checkbox"></td><td><p>Show 'total gracetime' for payments. </p></td><td><p>example</p></td></tr>
<tr id="LoanFormatInvestmentBreakdown" ><td><input type="checkbox"></td><td><p>Reformat investment breakdown table. </p></td><td><p>example</p></td></tr>
<tr id="LoanShowNextPaymentRow" ><td><input type="checkbox"></td><td><p>Show next payment in days. </p></td><td><p>example</p></td></tr>
<tr id="LoanShowAdditionalRatings" ><td><input type="checkbox"></td><td><p>Show ExploreP2P's loan originator rating. </p></td><td><p>example</p></td></tr>
<tr id="LoanShowPaymentWarning" ><td><input type="checkbox"></td><td><p>Show warning on bad payment history. </p></td><td><p>example</p></td></tr>
<tr id="LoanShowAgeWarning" ><td><input type="checkbox"></td><td><p>Show warning for high age borrower. </p></td><td><p>example</p></td></tr>
<tr id="LoanShowAgeWarning" ><td><input type="checkbox"></td><td><p>Show warning for high age borrowers. </p></td><td><p>example</p></td></tr>
<tr id="LoanShowJobWarning" ><td><input type="checkbox"></td><td><p>Show warning for unemployed borrowers </p></td><td><p>example</p></td></tr>
</table>

<p>Auto Invest</p>
Expand Down
2 changes: 2 additions & 0 deletions src/options/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
83 changes: 82 additions & 1 deletion src/scripts/sites/loan.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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',
Expand Down Expand Up @@ -507,7 +558,7 @@ chrome.storage.sync.get
{
'en' : 'Late',
'de' : 'In Verzug',
'pl' : '?',
'pl' : 'Late',
'cs' : '?',
'es' : '?',
'lv' : '?',
Expand Down Expand Up @@ -543,6 +594,16 @@ chrome.storage.sync.get
'lv' : '?',
'ru' : '?'
},
'$Date' :
{
'en' : 'Date',
'de' : 'Datum',
'pl' : 'Data',
'cs' : '?',
'es' : '?',
'lv' : '?',
'ru' : '?'
},
'$Paid' :
{
'en' : 'Paid',
Expand All @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit ed70939

Please sign in to comment.