Skip to content

Commit 9c04088

Browse files
committed
Delete buymeacoffe links & add paypall links for donate + small fix design for empty tabs
1 parent 60916be commit 9c04088

File tree

5 files changed

+33
-57
lines changed

5 files changed

+33
-57
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
"name": "Web Activity Time Tracker",
55
"short_name": "Web Activity",
6-
"version": "0.7.7",
6+
"version": "0.7.8",
77
"minimum_chrome_version": "26",
88

99
"description": "Track your activity in the browser.",

options.html

Lines changed: 11 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -123,58 +123,18 @@
123123
href="https://chrome.google.com/webstore/detail/web-activity-time-tracker/hhfnghjdeddcfegfekjeihfmbjenlomm/reviews"
124124
target="_blank">Let me know!</a></label>
125125
</div>
126+
<hr class="margin-top-20">
126127
<div class="margin-top-10">
127-
<label>If you like what I'm accomplishing, feel free to buy me a coffee ☕️ Thank you for your
128-
support!</label>
129-
<div class="margin-top-10">
130-
<style>
131-
.bmc-button img {
132-
width: 27px !important;
133-
margin-bottom: 1px !important;
134-
box-shadow: none !important;
135-
border: none !important;
136-
vertical-align: middle !important;
137-
}
138-
139-
.bmc-button {
140-
line-height: 36px !important;
141-
height: 37px !important;
142-
text-decoration: none !important;
143-
display: inline-flex !important;
144-
color: #FFFFFF !important;
145-
background-color: #FF813F !important;
146-
border-radius: 3px !important;
147-
border: 1px solid transparent !important;
148-
padding: 1px 9px !important;
149-
font-size: 22px !important;
150-
letter-spacing: 0.6px !important;
151-
box-shadow: 0px 1px 2px rgba(190, 190, 190, 0.5) !important;
152-
-webkit-box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;
153-
margin: 0 auto !important;
154-
font-family: 'Cookie', cursive !important;
155-
-webkit-box-sizing: border-box !important;
156-
box-sizing: border-box !important;
157-
-o-transition: 0.3s all linear !important;
158-
-webkit-transition: 0.3s all linear !important;
159-
-moz-transition: 0.3s all linear !important;
160-
-ms-transition: 0.3s all linear !important;
161-
transition: 0.3s all linear !important;
162-
}
163-
164-
.bmc-button:hover,
165-
.bmc-button:active,
166-
.bmc-button:focus {
167-
-webkit-box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;
168-
text-decoration: none !important;
169-
box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;
170-
opacity: 0.85 !important;
171-
color: #FFFFFF !important;
172-
}
173-
</style>
174-
<link href="https://fonts.googleapis.com/css?family=Cookie" rel="stylesheet"><a class="bmc-button"
175-
target="_blank" href="https://www.buymeacoffee.com/webactivitytime"><img
176-
src="https://www.buymeacoffee.com/assets/img/BMC-btn-logo.svg" alt="Buy me a coffee"><span
177-
style="margin-left:5px">Buy me a coffee</span></a>
128+
<label>If you like extensions, you can support Web Activity Time Tracker by donating: </label>
129+
<div class="margin-top-20">
130+
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
131+
<input type="hidden" name="cmd" value="_donations" />
132+
<input type="hidden" name="business" value="JBQEMTYGHGJVS" />
133+
<input type="hidden" name="item_name" value="Web Activity Time Tracker" />
134+
<input type="hidden" name="currency_code" value="USD" />
135+
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
136+
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
137+
</form>
178138
</div>
179139
</div>
180140
</div>

scripts/storage.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
'use strict';
22

33
class LocalStorage {
4-
loadTabs(name, callback) {
4+
loadTabs(name, callback, callbackIsUndefined) {
55
chrome.storage.local.get(name, function (item) {
66
if (item[name] !== undefined) {
77
var result = item[name];
88
if (result !== undefined)
99
callback(result);
1010
}
11+
else {
12+
if (callbackIsUndefined !== undefined)
13+
callbackIsUndefined();
14+
}
1115
});
1216
}
1317

@@ -29,7 +33,7 @@ class LocalStorage {
2933
});
3034
}
3135

32-
getMemoryUse(name, callback){
36+
getMemoryUse(name, callback) {
3337
chrome.storage.local.getBytesInUse(name, callback);
3438
}
3539
};

scripts/ui.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,14 @@ class UI {
5656
document.getElementById(elementName).innerHTML = '<p class="no-data">No data</p>';
5757
}
5858

59-
fillEmptyBlockForDays() {
59+
fillEmptyBlockForDaysIfInvalid() {
6060
document.getElementById('tableForDaysBlock').innerHTML = '<p class="no-data">Invalid date</p>';
6161
}
6262

63+
fillEmptyBlockForDays() {
64+
document.getElementById('tableForDaysBlock').innerHTML = '<p class="no-data">No data</p>';
65+
}
66+
6367
addHrAfterChart() {
6468
document.getElementById('chart').appendChild(document.createElement('hr'));
6569
}

scripts/webact.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function getLimitsListFromStorage() {
4949
}
5050

5151
function getDataFromStorage() {
52-
storage.loadTabs(STORAGE_TABS, getTabsFromStorage);
52+
storage.loadTabs(STORAGE_TABS, getTabsFromStorage, fillEmptyBlock);
5353
}
5454

5555
function getDataFromStorageByDays() {
@@ -62,6 +62,10 @@ function getLimitsListFromStorageCallback(items){
6262
else restrictionList = [];
6363
}
6464

65+
function fillEmptyBlock(){
66+
ui.fillEmptyBlock('chart');
67+
}
68+
6569
function getTabsFromStorage(tabs) {
6670
tabsFromStorage = tabs;
6771
targetTabs = [];
@@ -209,6 +213,10 @@ function getFirstDay() {
209213

210214
function getTabsByDays(tabs) {
211215
var range = ui.getDateRange();
216+
if (tabs === undefined){
217+
ui.fillEmptyBlockForDays();
218+
return;
219+
}
212220
if (range.from !== 'Invalid Date' && range.to !== 'Invalid Date') {
213221
var listOfDays = [];
214222
tabs.map(function (a) {
@@ -231,7 +239,7 @@ function getTabsByDays(tabs) {
231239
ui.fillListOfDays(listOfDays);
232240
}
233241
else {
234-
ui.fillEmptyBlockForDays();
242+
ui.fillEmptyBlockForDaysIfInvalid();
235243
}
236244
}
237245

0 commit comments

Comments
 (0)