1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2025-06-05 21:49:31 +02:00

Improved: Popup, Options and Statistics page

This commit is contained in:
nobody
2021-03-21 08:07:30 +01:00
parent a92ad9b4d3
commit df00b7ba77
7 changed files with 142 additions and 169 deletions

View File

@@ -31,9 +31,10 @@ statistics._onDocumentLoaded = function () {
helpers.insertI18nTitlesIntoDocument(document);
chrome.storage.local.get([Setting.DEFAULT_RANGE_STATISTIC], function (items) {
document.getElementById('date-range').value = items.defaultRangeStatistic;
statistics._dateUnit = items.defaultRangeStatistic;
statistics._setDateRange(items.defaultRangeStatistic);
statistics._dateUnit = items.defaultRangeStatistic || 'week';
document.getElementById('date-range').value = statistics._dateUnit;
statistics._setDateRange();
statistics._registerListener();
statistics._getStatistics().then(statistics._renderContents);
});
@@ -243,7 +244,7 @@ statistics._deleteStatistic = function () {
chrome.storage.local.set({
[Setting.INTERNAL_STATISTICS_DATA]: {}
});
chrome.runtime.sendMessage({'topic': 'deleteStatistic'});
chrome.runtime.sendMessage({'topic': 'statistic:delete'});
}
};