nightTab/js/state.js

224 lines
3.9 KiB
JavaScript
Raw Normal View History

2018-12-26 08:45:53 +01:00
var state = (function() {
var current = {
header: {
area: {
width: 90,
alignment: {
horizontal: "center"
}
},
items: {
alignment: {
horizontal: "left"
}
},
clock: {
hours: {
show: true,
display: "number"
},
minutes: {
show: true,
display: "number"
},
seconds: {
show: true,
display: "number"
},
separator: {
show: true
},
meridiem: {
show: true
},
hour24: {
show: true
},
},
date: {
day: {
show: true,
display: "word",
weekStart: "monday",
length: "long"
},
date: {
show: true,
display: "number",
ordinal: true
},
month: {
show: true,
display: "word",
length: "long",
ordinal: true
},
year: {
show: false,
display: "number"
},
separator: {
show: true
},
format: "datemonth"
},
search: {
show: true,
width: {
style: "auto",
custom: 30
},
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: ""
}
},
text: {
align: "center"
}
},
editAdd: {
show: true,
},
accent: {
show: true,
2019-02-16 23:27:54 +01:00
},
shade: {
show: true,
padding: {
top: 0,
bottom: 0
},
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: ""
},
transitional: {
show: false,
type: "timeanddate"
}
},
link: {
area: {
width: 90,
alignment: {
horizontal: "center"
}
},
items: {
width: 12,
alignment: {
horizontal: "left"
}
2019-04-01 17:11:39 +02:00
},
name: {
show: true
},
url: {
show: true,
style: "dark"
},
show: true,
fit: "best",
newTab: false,
edit: false,
style: "block",
sort: "none"
},
layout: {
alignment: {
horizontal: "center",
vertical: "center"
},
width: 100,
scrollPastEnd: false,
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: 130,
b: 250,
2019-01-07 15:42:14 +01:00
},
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
}
},
edge: false,
search: false,
menu: false,
modal: false,
autoSuggest: 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
};
})();