mirror of
https://github.com/zombieFox/nightTab.git
synced 2024-11-24 17:14:28 +01:00
[feature] restore demo page
This commit is contained in:
parent
3007ae11fe
commit
255ca514da
17
README.md
17
README.md
@ -1,8 +1,9 @@
|
||||
# NIGHTTAB
|
||||
A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab -- a custom start page.
|
||||
|
||||
![nightTab Demo](banners/banner-1400-560.png)
|
||||
|
||||
[![nightTab Demo](banners/banner-1400-560.png)](https://zombiefox.github.io/nightTab/)
|
||||
## [See the demo in action](https://zombiefox.github.io/nightTab/)
|
||||
*All bookmarks or preference changes will not persist in demo mode.*
|
||||
---
|
||||
|
||||
### [Chrome Extension](https://chrome.google.com/webstore/detail/nighttab/hdpcadigjkbcpnlcpbcohpafiaefanki)
|
||||
@ -40,9 +41,9 @@ A neutral new tab page accented with a chosen colour. Customise the layout, styl
|
||||
- Responsive design
|
||||
|
||||
---
|
||||
![nightTab Demo](screenshots/demo-001.gif)
|
||||
![nightTab Demo](screenshots/demo-002.gif)
|
||||
![nightTab Demo](screenshots/demo-003.gif)
|
||||
![nightTab Demo](screenshots/demo-004.gif)
|
||||
![nightTab Demo](screenshots/demo-005.gif)
|
||||
![nightTab Demo](screenshots/demo-006.gif)
|
||||
[![nightTab Demo](screenshots/demo-001.gif)](https://zombiefox.github.io/nightTab/)
|
||||
[![nightTab Demo](screenshots/demo-002.gif)](https://zombiefox.github.io/nightTab/)
|
||||
[![nightTab Demo](screenshots/demo-003.gif)](https://zombiefox.github.io/nightTab/)
|
||||
[![nightTab Demo](screenshots/demo-004.gif)](https://zombiefox.github.io/nightTab/)
|
||||
[![nightTab Demo](screenshots/demo-005.gif)](https://zombiefox.github.io/nightTab/)
|
||||
[![nightTab Demo](screenshots/demo-006.gif)](https://zombiefox.github.io/nightTab/)
|
||||
|
11
js/data.js
11
js/data.js
@ -20,7 +20,9 @@ var data = (function() {
|
||||
state: state.get(),
|
||||
bookmarks: bookmarks.get()
|
||||
};
|
||||
if ("runtime" in chrome) {
|
||||
set(saveName, JSON.stringify(data));
|
||||
};
|
||||
// console.log("data saved");
|
||||
};
|
||||
|
||||
@ -32,8 +34,10 @@ var data = (function() {
|
||||
return JSON.parse(get(saveName));
|
||||
};
|
||||
|
||||
var restore = function(data) {
|
||||
var restore = function() {
|
||||
var data = load();
|
||||
if (data) {
|
||||
if ("runtime" in chrome) {
|
||||
if (!("version" in data) || data.version != version.get()) {
|
||||
console.log("data version " + data.version + " found less than current");
|
||||
data = update.run(data);
|
||||
@ -41,13 +45,12 @@ var data = (function() {
|
||||
} else {
|
||||
console.log("data version " + version.get() + " no need to run update");
|
||||
};
|
||||
} else {
|
||||
console.log("no data found to load");
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
var init = function() {
|
||||
restore(load());
|
||||
restore();
|
||||
};
|
||||
|
||||
return {
|
||||
|
@ -1,5 +1,10 @@
|
||||
// log version
|
||||
console.log("nightTab version", version.get());
|
||||
if ("runtime" in chrome) {
|
||||
console.log("nightTab version", version.get());
|
||||
} else {
|
||||
console.log("nightTab running in demo mode");
|
||||
console.log("all bookmarks or preference changes will not persist in demo mode");
|
||||
};
|
||||
data.init();
|
||||
state.init();
|
||||
bookmarks.init();
|
||||
|
@ -18,7 +18,7 @@ var version = (function() {
|
||||
if (isNaN(na) && !isNaN(nb)) {
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user