File tree Expand file tree Collapse file tree 4 files changed +21
-3
lines changed
Expand file tree Collapse file tree 4 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1717 < div class ="description "> You've reached your limit today on < span id ="site " class ="current-site "> </ span > </ div >
1818 < div class ="description margin-top-10 "> Your current daily limit is < span id ="limit " class ="current-limit "> </ span > </ div >
1919
20+ < div class ="description margin-top-10 "> You have already been here
21+ < span id ="deferredCount " class ="deferred-metrics "> </ span > times for a total duration of
22+ < span id ="deferredTime " class ="deferred-metrics "> </ span > today !
23+ </ div >
2024 < div class ="margin-top-10 "> < a id ="deffererBtn " class ="defferer-link "> Set aside for 5 minutes</ a > </ div >
2125 </ div >
2226 < p class ="product-title "> Web Activity Time Tracker</ p >
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ function backgroundCheck() {
6666
6767function mainTRacker ( activeUrl , tab , activeTab ) {
6868 if ( activity . isLimitExceeded ( activeUrl , tab ) && ! activity . wasDeferred ( activeUrl ) ) {
69- setBlockPageToCurrent ( activeTab . url ) ;
69+ setBlockPageToCurrent ( activeTab . url , tab . summaryTime , tab . counter ) ;
7070 }
7171 if ( ! activity . isInBlackList ( activeUrl ) ) {
7272 if ( activity . isNeedNotifyView ( activeUrl , tab ) ) {
@@ -131,8 +131,10 @@ function notificationAction(activeUrl, tab) {
131131 } ) ;
132132}
133133
134- function setBlockPageToCurrent ( currentUrl ) {
135- var blockUrl = chrome . runtime . getURL ( "block.html" ) + '?url=' + currentUrl ;
134+ function setBlockPageToCurrent ( currentUrl , summaryTime , counter ) {
135+ var blockUrl = chrome . runtime . getURL ( "block.html" ) + '?url=' + currentUrl
136+ + '&summaryTime=' + summaryTime
137+ + '&counter=' + counter ;
136138 chrome . tabs . query ( { currentWindow : true , active : true } , function ( tab ) {
137139 chrome . tabs . update ( tab . id , { url : blockUrl } ) ;
138140 } ) ;
Original file line number Diff line number Diff line change 22
33var storage = new LocalStorage ( ) ;
44var blockSiteUrl ;
5+ var blockSiteTime ;
6+ var blockSiteCounter ;
57var restrictionList = [ ] ;
68
79document . addEventListener ( "DOMContentLoaded" , function ( ) {
810 var url = new URL ( document . URL ) ;
911 blockSiteUrl = url . searchParams . get ( "url" ) ;
12+ blockSiteTime = url . searchParams . get ( "summaryTime" ) ;
13+ blockSiteCounter = url . searchParams . get ( "counter" ) ;
1014 document . getElementById ( "site" ) . innerText = extractHostname ( blockSiteUrl ) ;
15+ document . getElementById ( "deferredTime" ) . innerText = convertShortSummaryTimeToString ( blockSiteTime ) ;
16+ document . getElementById ( "deferredCount" ) . innerText = blockSiteCounter ;
1117
1218 storage . getValue ( STORAGE_RESTRICTION_LIST , function ( items ) {
1319 restrictionList = items ;
Original file line number Diff line number Diff line change 4141 color : gray;
4242 text-decoration : underline;
4343 cursor : pointer;
44+ }
45+
46+ .deferred-metrics {
47+ font-weight : 500 ;
48+ font-size : 1.2rem ;
49+ color : rgb (202 , 48 , 48 );
4450}
You can’t perform that action at this time.
0 commit comments