mirror of
https://github.com/zombieFox/nightTab.git
synced 2024-12-26 08:38:59 +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/)
|
||||
|
25
js/data.js
25
js/data.js
@ -20,7 +20,9 @@ var data = (function() {
|
||||
state: state.get(),
|
||||
bookmarks: bookmarks.get()
|
||||
};
|
||||
set(saveName, JSON.stringify(data));
|
||||
if ("runtime" in chrome) {
|
||||
set(saveName, JSON.stringify(data));
|
||||
};
|
||||
// console.log("data saved");
|
||||
};
|
||||
|
||||
@ -32,22 +34,23 @@ var data = (function() {
|
||||
return JSON.parse(get(saveName));
|
||||
};
|
||||
|
||||
var restore = function(data) {
|
||||
var restore = function() {
|
||||
var data = load();
|
||||
if (data) {
|
||||
if (!("version" in data) || data.version != version.get()) {
|
||||
console.log("data version " + data.version + " found less than current");
|
||||
data = update.run(data);
|
||||
set(saveName, JSON.stringify(data));
|
||||
} else {
|
||||
console.log("data version " + version.get() + " no need to run update");
|
||||
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);
|
||||
set(saveName, JSON.stringify(data));
|
||||
} 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