2018-12-26 08:45:53 +01:00
|
|
|
var state = (function() {
|
|
|
|
|
2019-01-03 23:30:27 +01:00
|
|
|
var current = {
|
|
|
|
header: {
|
2019-01-05 21:57:21 +01:00
|
|
|
date: {
|
|
|
|
characterLength: "short",
|
|
|
|
show: {
|
|
|
|
date: true,
|
|
|
|
day: false,
|
|
|
|
month: true,
|
|
|
|
year: false,
|
2019-01-05 23:35:50 +01:00
|
|
|
separator: true
|
2019-01-05 21:57:21 +01:00
|
|
|
}
|
|
|
|
},
|
2019-01-03 23:30:27 +01:00
|
|
|
clock: {
|
|
|
|
hour24: true,
|
|
|
|
show: {
|
|
|
|
seconds: true,
|
2019-01-05 21:57:21 +01:00
|
|
|
minutes: true,
|
|
|
|
hours: true,
|
2019-01-05 23:35:50 +01:00
|
|
|
separator: true,
|
2019-01-03 23:30:27 +01:00
|
|
|
meridiem: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
editAdd: {
|
|
|
|
active: true,
|
|
|
|
},
|
|
|
|
accent: {
|
|
|
|
active: true,
|
|
|
|
},
|
|
|
|
search: {
|
|
|
|
searching: false,
|
|
|
|
active: true,
|
|
|
|
grow: true,
|
2019-01-25 00:21:00 +01:00
|
|
|
focus: false,
|
2019-01-03 23:30:27 +01:00
|
|
|
engine: {
|
|
|
|
selected: "google",
|
|
|
|
google: {
|
|
|
|
url: "https://www.google.com/search"
|
|
|
|
},
|
|
|
|
duckduckgo: {
|
|
|
|
url: "https://duckduckgo.com/"
|
|
|
|
},
|
|
|
|
giphy: {
|
|
|
|
url: "https://giphy.com/search/"
|
|
|
|
},
|
|
|
|
custom: {
|
|
|
|
url: ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
buttons: {
|
|
|
|
show: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
link: {
|
2019-01-24 21:28:11 +01:00
|
|
|
show: {
|
|
|
|
active: true,
|
|
|
|
name: true,
|
|
|
|
url: true
|
|
|
|
},
|
2019-01-03 23:30:27 +01:00
|
|
|
editObject: null,
|
|
|
|
newTab: false,
|
|
|
|
style: "block",
|
|
|
|
sort: "none"
|
|
|
|
},
|
|
|
|
layout: {
|
2019-01-24 21:28:11 +01:00
|
|
|
alignment: {
|
|
|
|
horizontal: "left",
|
|
|
|
vertical: "top"
|
|
|
|
},
|
2019-01-03 23:30:27 +01:00
|
|
|
container: "wide",
|
2019-01-04 19:23:24 +01:00
|
|
|
scrollPastEnd: true,
|
2019-01-03 23:30:27 +01:00
|
|
|
theme: {
|
2019-01-07 15:42:14 +01:00
|
|
|
current: {
|
|
|
|
r: 0,
|
|
|
|
g: 255,
|
|
|
|
b: 0,
|
|
|
|
},
|
2019-01-14 19:50:48 +01:00
|
|
|
random: {
|
|
|
|
active: false,
|
|
|
|
style: "any"
|
|
|
|
}
|
2019-01-03 23:30:27 +01:00
|
|
|
},
|
|
|
|
},
|
2019-01-24 21:28:11 +01:00
|
|
|
background: {
|
|
|
|
image: {
|
|
|
|
active: false,
|
|
|
|
url: "../background/gray-steps.jpg",
|
|
|
|
blur: 0,
|
|
|
|
opacity: 1,
|
|
|
|
grayscale: 0,
|
|
|
|
accentOpacity: 0
|
|
|
|
}
|
|
|
|
},
|
2019-01-03 23:30:27 +01:00
|
|
|
edit: {
|
|
|
|
active: false
|
|
|
|
},
|
|
|
|
menu: {
|
|
|
|
open: false
|
|
|
|
},
|
|
|
|
modal: {
|
|
|
|
active: false
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-12-26 08:45:53 +01:00
|
|
|
var get = function() {
|
|
|
|
return current;
|
|
|
|
};
|
|
|
|
|
2019-01-03 23:30:27 +01:00
|
|
|
var restore = function(data) {
|
|
|
|
if ("state" in data) {
|
|
|
|
current = data.state;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
var change = function(override) {
|
|
|
|
var options = {
|
|
|
|
path: null,
|
|
|
|
value: null
|
|
|
|
};
|
|
|
|
if (override) {
|
|
|
|
options = helper.applyOptions(options, override);
|
|
|
|
};
|
|
|
|
if (options.path != null) {
|
|
|
|
helper.setObject({
|
|
|
|
path: options.path,
|
|
|
|
object: current,
|
|
|
|
newValue: options.value
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
var init = function() {
|
|
|
|
if (data.load()) {
|
|
|
|
restore(data.load());
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-12-26 08:45:53 +01:00
|
|
|
return {
|
2019-01-03 23:30:27 +01:00
|
|
|
init: init,
|
|
|
|
get: get,
|
2019-01-06 16:47:08 +01:00
|
|
|
change: change
|
2018-12-26 08:45:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
})();
|