mirror of
https://github.com/zombieFox/nightTab.git
synced 2024-12-01 12:33:24 +01:00
239 lines
4.2 KiB
JavaScript
239 lines
4.2 KiB
JavaScript
var state = (function() {
|
|
|
|
var current = {
|
|
header: {
|
|
area: {
|
|
width: 100,
|
|
alignment: {
|
|
horizontal: "center"
|
|
}
|
|
},
|
|
item: {
|
|
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,
|
|
},
|
|
shade: {
|
|
show: true,
|
|
style: "scroll",
|
|
opacity: 0.95,
|
|
},
|
|
padding: {
|
|
top: 0,
|
|
bottom: 0
|
|
},
|
|
border: {
|
|
top: {
|
|
show: false,
|
|
width: 1
|
|
},
|
|
bottom: {
|
|
show: false,
|
|
width: 1
|
|
}
|
|
},
|
|
greeting: {
|
|
show: false,
|
|
type: "good",
|
|
name: ""
|
|
},
|
|
transitional: {
|
|
show: false,
|
|
type: "timeanddate"
|
|
}
|
|
},
|
|
link: {
|
|
area: {
|
|
gap: 2,
|
|
width: 100,
|
|
alignment: {
|
|
horizontal: "center"
|
|
}
|
|
},
|
|
item: {
|
|
size: 1,
|
|
display: {
|
|
show: true,
|
|
size: 2,
|
|
alignment: {
|
|
horizontal: "right",
|
|
vertical: "bottom"
|
|
},
|
|
letter: {
|
|
size: 2
|
|
},
|
|
icon: {
|
|
size: 2
|
|
}
|
|
},
|
|
name: {
|
|
show: true,
|
|
size: 0.9,
|
|
},
|
|
url: {
|
|
show: true,
|
|
style: "dark"
|
|
},
|
|
line: {
|
|
show: true
|
|
}
|
|
},
|
|
show: true,
|
|
newTab: false,
|
|
edit: false,
|
|
style: "block",
|
|
sort: "none"
|
|
},
|
|
layout: {
|
|
alignment: {
|
|
horizontal: "center",
|
|
vertical: "center"
|
|
},
|
|
width: 80,
|
|
scrollPastEnd: false,
|
|
title: "New Tab"
|
|
},
|
|
theme: {
|
|
accent: {
|
|
current: {
|
|
r: 0,
|
|
g: 130,
|
|
b: 250,
|
|
},
|
|
random: {
|
|
active: false,
|
|
style: "any"
|
|
}
|
|
},
|
|
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,
|
|
};
|
|
|
|
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());
|
|
};
|
|
};
|
|
|
|
return {
|
|
init: init,
|
|
get: get
|
|
};
|
|
|
|
})();
|