nightTab/js/state.js

163 lines
2.8 KiB
JavaScript
Raw Normal View History

2018-12-26 08:45:53 +01:00
var state = (function() {
var current = {
header: {
clock: {
hour24: true,
show: {
2019-01-05 21:57:21 +01:00
hours: true,
minutes: true,
seconds: true,
2019-01-05 23:35:50 +01:00
separator: true,
meridiem: true
}
},
date: {
show: {
day: false,
date: true,
month: true,
year: false,
separator: true
},
character: {
length: "short"
}
},
search: {
show: true,
grow: true,
focus: false,
engine: {
selected: "google",
google: {
url: "https://www.google.com/search",
name: "Google"
},
duckduckgo: {
url: "https://duckduckgo.com/",
name: "Duck Duck Go"
},
youtube: {
url: "https://www.youtube.com/results?search_query=",
name: "YouTube"
},
giphy: {
url: "https://giphy.com/search/",
name: "Giphy"
},
custom: {
url: "",
name: ""
}
}
},
alignment: {
horizontal: "left",
vertical: "top"
},
editAdd: {
show: true,
},
accent: {
show: true,
2019-02-16 23:27:54 +01:00
},
shade: {
show: true,
padding: {
top: 10,
bottom: 10
},
2019-02-16 23:27:54 +01:00
style: "scroll",
opacity: 0.95,
border: {
top: {
show: false,
width: 1
},
bottom: {
show: false,
width: 1
}
2019-02-16 23:27:54 +01:00
}
2019-03-26 00:31:51 +01:00
},
greeting: {
show: false,
type: "good",
name: ""
}
},
bookmarks: {
2019-04-01 17:11:39 +02:00
link: {
show: true
},
name: {
show: true
},
url: {
show: true,
style: "dark"
},
newTab: false,
edit: false,
editObject: null,
style: "block",
sort: "none"
},
layout: {
width: 72,
scrollPastEnd: true,
2019-04-01 17:11:39 +02:00
title: "New Tab"
},
theme: {
accent: {
2019-01-07 15:42:14 +01:00
current: {
r: 0,
g: 255,
b: 0,
},
random: {
active: false,
style: "any"
}
2019-04-01 17:11:39 +02:00
},
style: "dark"
},
background: {
image: {
show: false,
url: "../background/gray-steps.jpg",
blur: 0,
opacity: 1,
grayscale: 0,
accent: 0
}
},
search: false,
menu: false,
modal: false
};
2018-12-26 08:45:53 +01:00
var get = function() {
return current;
};
var restore = function(data) {
if ("state" in data) {
current = data.state;
};
};
var init = function() {
if (data.load()) {
restore(data.load());
};
};
2018-12-26 08:45:53 +01:00
return {
init: init,
get: get
2018-12-26 08:45:53 +01:00
};
})();