Skip to content

Commit 9e7a4d6

Browse files
committed
Merge branch 'dev' of https://bitbucket.org/Stigmat/chrome_extension into release
2 parents f99efe2 + 4e1e488 commit 9e7a4d6

File tree

4 files changed

+30
-13
lines changed

4 files changed

+30
-13
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.6.0",
6+
"version": "0.6.4",
77

88
"minimum_chrome_version": "26",
99

options.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@
6363
</div>
6464
</div>
6565
<div id='aboutBlock' hidden>
66-
<div><label id='version'>v0.6.0</label></div>
66+
<div><label id='version'>v0.6.4</label></div>
6767
<div class="margin-top-20">
68-
<label>If experiencing problems, having questions or suggestions, please fill out <a href="https://chrome.google.com/webstore/detail/webtime-tracker/fohgfakiidklhicnjedbohplegpnmbch/support" target="_blank">support
68+
<label>If experiencing problems, having questions or suggestions, please fill out <a href="https://chrome.google.com/webstore/detail/web-activity-time-tracker/hhfnghjdeddcfegfekjeihfmbjenlomm/support" target="_blank">support
6969
form</a>.</label>
7070
</div>
7171
<div class="margin-top-20">
72-
<label>Do you enjoy using Web Activity Time Tracker? <a href="https://chrome.google.com/webstore/detail/webtime-tracker/fohgfakiidklhicnjedbohplegpnmbch/reviews" target="_blank">Let me know!</a></label>
72+
<label>Do you enjoy using Web Activity Time Tracker? <a href="https://chrome.google.com/webstore/detail/web-activity-time-tracker/hhfnghjdeddcfegfekjeihfmbjenlomm/reviews" target="_blank">Let me know!</a></label>
7373
</div>
7474
</div>
7575
</div>

scripts/background.js

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

3-
var tabs = [];
3+
var tabs;
44
var currentTab;
55
var activity = new Activity();
66
var storage = new LocalStorage();
@@ -57,7 +57,7 @@ function backgroundCheck() {
5757
}
5858

5959
function backgroundUpdateStorage() {
60-
if (tabs.length > 0)
60+
if (tabs != undefined && tabs.length > 0)
6161
storage.saveTabs(tabs);
6262
}
6363

@@ -81,12 +81,23 @@ function addListener() {
8181
});
8282
});
8383
chrome.runtime.onInstalled.addListener(function (details) {
84-
//if (details.reason == "install") {
85-
setDefaultSettings();
86-
//}
84+
if (details.reason == "install") {
85+
setDefaultSettings();
86+
}
87+
});
88+
}
89+
90+
function loadTabs() {
91+
storage.loadTabs(STORAGE_TABS, function (items)
92+
{
93+
tabs = [];
94+
for (var i=0; i<items.length; i++){
95+
tabs.push(new Tab(items[i].url, items[i].favicon, items[i].days, items[i].summaryTime));
96+
}
8797
});
8898
}
8999

100+
loadTabs();
90101
addListener();
91102
updateSummaryTime();
92103
updateStorage();

scripts/tab.js

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

33
class Tab {
4-
constructor(url, favicon) {
4+
constructor(url, favicon, days, summary) {
55
this.url = url;
66
this.favicon = favicon;
7-
this.summaryTime = 0;
8-
this.days = [];
7+
if (summary !== undefined)
8+
this.summaryTime = summary;
9+
else
10+
this.summaryTime = 0;
11+
if (days !== undefined)
12+
this.days = days;
13+
else
14+
this.days = [];
915
}
1016

1117
incSummaryTime() {
@@ -21,7 +27,7 @@ class Tab {
2127
}
2228
}
2329

24-
addNewDay(today){
30+
addNewDay(today) {
2531
this.days.push(
2632
{
2733
'date': today,

0 commit comments

Comments
 (0)