Skip to content

Commit c1cce01

Browse files
committed
[feature] restore demo page
1 parent 26ef4d7 commit c1cce01

File tree

4 files changed

+18
-37
lines changed

4 files changed

+18
-37
lines changed

‎README.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ A neutral new tab page accented with a chosen colour. Customise the layout, styl
55

66
[See the demo in action](https://zombiefox.github.io/nightTab/)
77

8-
*All bookmarks or preference changes will not persist in demo mode.*
9-
108
---
119

1210
### [Chrome Extension](https://chrome.google.com/webstore/detail/nighttab/hdpcadigjkbcpnlcpbcohpafiaefanki)

‎js/data.js‎

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,12 @@ var data = (function(){
1515
};
1616

1717
varsave=function(){
18-
if("runtime"inchrome){
19-
if("getManifest"inchrome.runtime){
20-
vardata={
21-
version: version.get(),
22-
state: state.get(),
23-
bookmarks: bookmarks.get()
24-
};
25-
set(saveName,JSON.stringify(data));
26-
};
18+
vardata={
19+
version: version.get(),
20+
state: state.get(),
21+
bookmarks: bookmarks.get()
2722
};
23+
set(saveName,JSON.stringify(data));
2824
};
2925

3026
varwipe=function(){
@@ -38,17 +34,15 @@ var data = (function(){
3834
varrestore=function(){
3935
vardata=load();
4036
if(data){
41-
if("runtime"inchrome){
42-
if("getManifest"inchrome.runtime){
43-
if(!("version"indata)||data.version!=version.get()){
44-
console.log("data version "+data.version+" found less than current");
45-
data=update.run(data);
46-
set(saveName,JSON.stringify(data));
47-
}else{
48-
console.log("data version "+version.get()+" no need to run update");
49-
};
50-
};
37+
if(!("version"indata)||data.version!=version.get()){
38+
console.log("data version "+data.version+" found less than current");
39+
data=update.run(data);
40+
set(saveName,JSON.stringify(data));
41+
}else{
42+
console.log("data version "+version.get()+" no need to run update");
5143
};
44+
}else{
45+
console.log("no data found to load");
5246
};
5347
};
5448

‎js/init.js‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
// log version
2-
vardemoMessage=function(){
3-
console.log("nightTab running in demo mode");
4-
console.log("all bookmarks or preference changes will not persist in demo mode");
5-
};
6-
7-
if("runtime"inchrome){
8-
if("getManifest"inchrome.runtime){
9-
console.log("nightTab version",version.get());
10-
}else{
11-
demoMessage();
12-
};
13-
}else{
14-
demoMessage();
15-
};
16-
2+
console.log("nightTab version",version.get());
173
data.init();
184
state.init();
195
bookmarks.init();

‎js/version.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
varversion=(function(){
22

3+
varcurrent="3.14.0";
4+
35
varcompare=function(a,b){
46
varpa=a.split(".");
57
varpb=b.split(".");
@@ -23,7 +25,8 @@ var version = (function(){
2325
};
2426

2527
varget=function(){
26-
returnchrome.runtime.getManifest().version;
28+
// return chrome.runtime.getManifest().version;
29+
returncurrent;
2730
};
2831

2932
// exposed methods

0 commit comments

Comments
(0)