2018-12-26 08:45:53 +01:00
|
|
|
var control = (function() {
|
|
|
|
|
2019-02-03 14:51:54 +01:00
|
|
|
var _allControl = [{
|
|
|
|
element: helper.e(".control-menu"),
|
|
|
|
type: "button",
|
|
|
|
func: function() {
|
|
|
|
menu.toggle();
|
2019-05-11 09:33:19 +02:00
|
|
|
page.update();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-11 11:54:10 +02:00
|
|
|
element: helper.e(".control-link-add"),
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "button",
|
|
|
|
func: function() {
|
|
|
|
link.add();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-11 11:54:10 +02:00
|
|
|
element: helper.e(".control-link-edit"),
|
2019-05-23 20:15:14 +02:00
|
|
|
path: "link.edit",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-04-01 17:11:39 +02:00
|
|
|
element: helper.e(".control-theme-accent-current"),
|
|
|
|
path: "theme.accent.current",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "color",
|
|
|
|
func: function() {
|
2019-04-01 17:11:39 +02:00
|
|
|
accent.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
2019-06-04 20:08:15 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-layout-width"),
|
|
|
|
path: "layout.width",
|
|
|
|
type: "range",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "input",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".main"),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mousedown",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".main"),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mouseup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "touchend",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "keydown",
|
|
|
|
func: function() {
|
|
|
|
if (event.keyCode == 37 || event.keyCode == 38 || event.keyCode == 39 || event.keyCode == 40) {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".main"),
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "keyup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
layout.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-layout-alignment-horizontal-left"),
|
|
|
|
path: "layout.alignment.horizontal",
|
|
|
|
type: "radio",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "change",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".main"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-layout-alignment-horizontal-center"),
|
|
|
|
path: "layout.alignment.horizontal",
|
|
|
|
type: "radio",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "change",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".main"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-layout-alignment-horizontal-right"),
|
|
|
|
path: "layout.alignment.horizontal",
|
|
|
|
type: "radio",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "change",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".main"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-layout-alignment-vertical-top"),
|
|
|
|
path: "layout.alignment.vertical",
|
|
|
|
type: "radio",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "change",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".main"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-layout-alignment-vertical-center"),
|
|
|
|
path: "layout.alignment.vertical",
|
|
|
|
type: "radio",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "change",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".main"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-layout-alignment-vertical-bottom"),
|
|
|
|
path: "layout.alignment.vertical",
|
|
|
|
type: "radio",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "change",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".main"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-layout-title"),
|
|
|
|
path: "layout.title",
|
|
|
|
type: "text",
|
|
|
|
func: function() {
|
|
|
|
title.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-layout-scroll-past-end"),
|
|
|
|
path: "layout.scrollPastEnd",
|
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-area-width"),
|
|
|
|
path: "header.area.width",
|
|
|
|
type: "range",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "input",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-area")
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mousedown",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-area")
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mouseup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "touchend",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "keydown",
|
|
|
|
func: function() {
|
|
|
|
if (event.keyCode == 37 || event.keyCode == 38 || event.keyCode == 39 || event.keyCode == 40) {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-area"),
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "keyup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
2019-06-11 11:54:10 +02:00
|
|
|
header.render.area.width();
|
2019-06-04 20:08:15 +02:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-area-width-match"),
|
|
|
|
type: "button",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "click",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-area"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mouseup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
2019-06-11 11:54:10 +02:00
|
|
|
_setValue("header.area.width", helper.getObject({
|
|
|
|
object: state.get(),
|
|
|
|
path: "link.area.width"
|
|
|
|
}));
|
|
|
|
header.render.area.width();
|
2019-06-04 20:08:15 +02:00
|
|
|
update();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-area-alignment-horizontal-left"),
|
|
|
|
path: "header.area.alignment.horizontal",
|
|
|
|
type: "radio",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "change",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-area"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-area-alignment-horizontal-center"),
|
|
|
|
path: "header.area.alignment.horizontal",
|
|
|
|
type: "radio",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "change",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-area"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-area-alignment-horizontal-right"),
|
|
|
|
path: "header.area.alignment.horizontal",
|
|
|
|
type: "radio",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "change",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-area"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-header-item-alignment-horizontal-left"),
|
|
|
|
path: "header.item.alignment.horizontal",
|
2019-06-04 20:08:15 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-header-item-alignment-horizontal-center"),
|
|
|
|
path: "header.item.alignment.horizontal",
|
2019-06-04 20:08:15 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-header-item-alignment-horizontal-right"),
|
|
|
|
path: "header.item.alignment.horizontal",
|
2019-06-04 20:08:15 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-greeting-show"),
|
|
|
|
path: "header.greeting.show",
|
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-greeting-type-good"),
|
|
|
|
path: "header.greeting.type",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-greeting-type-hello"),
|
|
|
|
path: "header.greeting.type",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-greeting-type-hi"),
|
|
|
|
path: "header.greeting.type",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-greeting-name"),
|
|
|
|
path: "header.greeting.name",
|
|
|
|
type: "text",
|
|
|
|
func: function() {
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
}
|
2019-06-11 11:54:10 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-greeting-size"),
|
|
|
|
path: "header.greeting.size",
|
|
|
|
type: "range",
|
|
|
|
valueMod: ["float"],
|
|
|
|
func: function() {
|
|
|
|
header.render.greeting.size();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-greeting-size-default"),
|
|
|
|
type: "button",
|
|
|
|
func: function() {
|
|
|
|
_setValue("header.greeting.size", 1);
|
|
|
|
header.render.greeting.size();
|
|
|
|
update();
|
|
|
|
}
|
2019-06-04 20:08:15 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-transitional-show"),
|
|
|
|
path: "header.transitional.show",
|
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-transitional-type-timeanddate"),
|
|
|
|
path: "header.transitional.type",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-transitional-type-its"),
|
|
|
|
path: "header.transitional.type",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
2019-06-11 11:54:10 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-transitional-size"),
|
|
|
|
path: "header.transitional.size",
|
|
|
|
type: "range",
|
|
|
|
valueMod: ["float"],
|
|
|
|
func: function() {
|
|
|
|
header.render.transitional.size();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-transitional-size-default"),
|
|
|
|
type: "button",
|
|
|
|
func: function() {
|
|
|
|
_setValue("header.transitional.size", 1);
|
|
|
|
header.render.transitional.size();
|
|
|
|
update();
|
|
|
|
}
|
2019-02-03 14:51:54 +01:00
|
|
|
}, {
|
2019-04-26 14:48:37 +02:00
|
|
|
element: helper.e(".control-header-clock-hours-show"),
|
|
|
|
path: "header.clock.hours.show",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
|
|
|
clock.clear();
|
|
|
|
clock.render();
|
2019-04-26 14:48:37 +02:00
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-04 20:08:15 +02:00
|
|
|
element: helper.e(".control-header-clock-hours-display-number"),
|
2019-04-26 14:48:37 +02:00
|
|
|
path: "header.clock.hours.display",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
clock.clear();
|
|
|
|
clock.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-04 20:08:15 +02:00
|
|
|
element: helper.e(".control-header-clock-hours-display-word"),
|
2019-04-26 14:48:37 +02:00
|
|
|
path: "header.clock.hours.display",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
clock.clear();
|
|
|
|
clock.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-clock-minutes-show"),
|
|
|
|
path: "header.clock.minutes.show",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
|
|
|
clock.clear();
|
|
|
|
clock.render();
|
2019-04-26 14:48:37 +02:00
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-04 20:08:15 +02:00
|
|
|
element: helper.e(".control-header-clock-minutes-display-number"),
|
2019-04-26 14:48:37 +02:00
|
|
|
path: "header.clock.minutes.display",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
clock.clear();
|
|
|
|
clock.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-04 20:08:15 +02:00
|
|
|
element: helper.e(".control-header-clock-minutes-display-word"),
|
2019-04-26 14:48:37 +02:00
|
|
|
path: "header.clock.minutes.display",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
clock.clear();
|
|
|
|
clock.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-04-26 14:48:37 +02:00
|
|
|
element: helper.e(".control-header-clock-seconds-show"),
|
|
|
|
path: "header.clock.seconds.show",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
|
|
|
clock.clear();
|
|
|
|
clock.render();
|
2019-04-26 14:48:37 +02:00
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-04 20:08:15 +02:00
|
|
|
element: helper.e(".control-header-clock-seconds-display-number"),
|
2019-04-26 14:48:37 +02:00
|
|
|
path: "header.clock.seconds.display",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
clock.clear();
|
|
|
|
clock.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-04 20:08:15 +02:00
|
|
|
element: helper.e(".control-header-clock-seconds-display-word"),
|
2019-04-26 14:48:37 +02:00
|
|
|
path: "header.clock.seconds.display",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
clock.clear();
|
|
|
|
clock.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-clock-separator-show"),
|
|
|
|
path: "header.clock.separator.show",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
clock.clear();
|
|
|
|
clock.render();
|
2019-04-26 14:48:37 +02:00
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-04-26 14:48:37 +02:00
|
|
|
element: helper.e(".control-header-clock-hour24-show"),
|
|
|
|
path: "header.clock.hour24.show",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
dependents();
|
|
|
|
clock.clear();
|
|
|
|
clock.render();
|
2019-04-26 14:48:37 +02:00
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-04-26 14:48:37 +02:00
|
|
|
element: helper.e(".control-header-clock-meridiem-show"),
|
|
|
|
path: "header.clock.meridiem.show",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
dependents();
|
|
|
|
clock.clear();
|
|
|
|
clock.render();
|
2019-04-26 14:48:37 +02:00
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
2019-06-11 11:54:10 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-clock-size"),
|
|
|
|
path: "header.clock.size",
|
|
|
|
type: "range",
|
|
|
|
valueMod: ["float"],
|
|
|
|
func: function() {
|
|
|
|
header.render.clock.size();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-clock-size-default"),
|
|
|
|
type: "button",
|
|
|
|
func: function() {
|
|
|
|
_setValue("header.clock.size", 1);
|
|
|
|
header.render.clock.size();
|
|
|
|
update();
|
|
|
|
}
|
2019-04-26 14:48:37 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-day-show"),
|
|
|
|
path: "header.date.day.show",
|
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-day-display-number"),
|
|
|
|
path: "header.date.day.display",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
dependents();
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-04 20:08:15 +02:00
|
|
|
element: helper.e(".control-header-date-day-week-start-monday"),
|
|
|
|
path: "header.date.day.weekStart",
|
2019-04-26 14:48:37 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-04 20:08:15 +02:00
|
|
|
element: helper.e(".control-header-date-day-week-start-sunday"),
|
2019-04-26 14:48:37 +02:00
|
|
|
path: "header.date.day.weekStart",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
2019-06-04 20:08:15 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-day-display-word"),
|
|
|
|
path: "header.date.day.display",
|
2019-04-26 14:48:37 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
dependents();
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-04-26 14:48:37 +02:00
|
|
|
element: helper.e(".control-header-date-day-length-long"),
|
|
|
|
path: "header.date.day.length",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-day-length-short"),
|
|
|
|
path: "header.date.day.length",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-date-show"),
|
|
|
|
path: "header.date.date.show",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
2019-04-26 14:48:37 +02:00
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-date-display-number"),
|
|
|
|
path: "header.date.date.display",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-04-26 14:48:37 +02:00
|
|
|
element: helper.e(".control-header-date-date-display-word"),
|
|
|
|
path: "header.date.date.display",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-date-ordinal"),
|
|
|
|
path: "header.date.date.ordinal",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
2019-04-26 14:48:37 +02:00
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-04-26 14:48:37 +02:00
|
|
|
element: helper.e(".control-header-date-month-show"),
|
|
|
|
path: "header.date.month.show",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
2019-04-26 14:48:37 +02:00
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-04-26 14:48:37 +02:00
|
|
|
element: helper.e(".control-header-date-month-display-number"),
|
|
|
|
path: "header.date.month.display",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
dependents();
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-month-ordinal"),
|
|
|
|
path: "header.date.month.ordinal",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
2019-04-26 14:48:37 +02:00
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-month-display-word"),
|
|
|
|
path: "header.date.month.display",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
dependents();
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-month-length-long"),
|
|
|
|
path: "header.date.month.length",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-04-26 14:48:37 +02:00
|
|
|
element: helper.e(".control-header-date-month-length-short"),
|
|
|
|
path: "header.date.month.length",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-year-show"),
|
|
|
|
path: "header.date.year.show",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
2019-04-26 14:48:37 +02:00
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-year-display-number"),
|
|
|
|
path: "header.date.year.display",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-year-display-word"),
|
|
|
|
path: "header.date.year.display",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-04 20:08:15 +02:00
|
|
|
element: helper.e(".control-header-date-separator-show"),
|
|
|
|
path: "header.date.separator.show",
|
|
|
|
type: "checkbox",
|
2019-02-03 14:51:54 +01:00
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
2019-04-26 14:48:37 +02:00
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-04 20:08:15 +02:00
|
|
|
element: helper.e(".control-header-date-format-datemonth"),
|
2019-04-26 14:48:37 +02:00
|
|
|
path: "header.date.format",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
2019-04-26 14:48:37 +02:00
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-04 20:08:15 +02:00
|
|
|
element: helper.e(".control-header-date-format-monthdate"),
|
|
|
|
path: "header.date.format",
|
|
|
|
type: "radio",
|
2019-04-26 14:48:37 +02:00
|
|
|
func: function() {
|
|
|
|
date.clear();
|
|
|
|
date.render();
|
|
|
|
greeting.clear();
|
|
|
|
greeting.render();
|
|
|
|
transitional.clear();
|
|
|
|
transitional.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
2019-06-11 11:54:10 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-size"),
|
|
|
|
path: "header.date.size",
|
|
|
|
type: "range",
|
|
|
|
valueMod: ["float"],
|
|
|
|
func: function() {
|
|
|
|
header.render.date.size();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-date-size-default"),
|
|
|
|
type: "button",
|
|
|
|
func: function() {
|
|
|
|
_setValue("header.date.size", 1);
|
|
|
|
header.render.date.size();
|
|
|
|
update();
|
|
|
|
}
|
2019-02-03 14:51:54 +01:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-search-show"),
|
|
|
|
path: "header.search.show",
|
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
2019-06-11 11:54:10 +02:00
|
|
|
header.render.search.width();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-11 11:54:10 +02:00
|
|
|
element: helper.e(".control-header-search-style-auto"),
|
|
|
|
path: "header.search.style",
|
2019-04-18 14:30:40 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
2019-06-11 11:54:10 +02:00
|
|
|
header.render.search.width();
|
2019-04-18 14:30:40 +02:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-11 11:54:10 +02:00
|
|
|
element: helper.e(".control-header-search-style-custom"),
|
|
|
|
path: "header.search.style",
|
2019-04-18 14:30:40 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
2019-06-11 11:54:10 +02:00
|
|
|
header.render.search.width();
|
2019-04-18 14:30:40 +02:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-11 11:54:10 +02:00
|
|
|
element: helper.e(".control-header-search-width"),
|
|
|
|
path: "header.search.width",
|
2019-04-18 14:30:40 +02:00
|
|
|
type: "range",
|
2019-05-23 20:15:14 +02:00
|
|
|
additionalEvents: [{
|
|
|
|
event: "input",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-search-input"),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mousedown",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-search-input"),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mouseup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
2019-05-23 20:25:57 +02:00
|
|
|
}, {
|
|
|
|
event: "touchend",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
2019-05-23 20:15:14 +02:00
|
|
|
}, {
|
|
|
|
event: "keydown",
|
|
|
|
func: function() {
|
|
|
|
if (event.keyCode == 37 || event.keyCode == 38 || event.keyCode == 39 || event.keyCode == 40) {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-search-input"),
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "keyup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
|
|
|
}],
|
2019-02-03 14:51:54 +01:00
|
|
|
func: function() {
|
2019-06-11 11:54:10 +02:00
|
|
|
header.render.search.width();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-search-focus"),
|
|
|
|
path: "header.search.focus",
|
2019-04-18 14:30:40 +02:00
|
|
|
type: "checkbox"
|
2019-02-03 14:51:54 +01:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-search-engine-google"),
|
|
|
|
path: "header.search.engine.selected",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
dependents();
|
2019-04-03 14:10:37 +02:00
|
|
|
search.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-search-engine-duckduckgo"),
|
|
|
|
path: "header.search.engine.selected",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
dependents();
|
2019-04-03 14:10:37 +02:00
|
|
|
search.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
2019-04-04 19:08:26 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-search-engine-youtube"),
|
|
|
|
path: "header.search.engine.selected",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
dependents();
|
|
|
|
search.render();
|
|
|
|
}
|
2019-02-03 14:51:54 +01:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-search-engine-giphy"),
|
|
|
|
path: "header.search.engine.selected",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
dependents();
|
2019-04-03 14:10:37 +02:00
|
|
|
search.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-search-engine-custom"),
|
|
|
|
path: "header.search.engine.selected",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
dependents();
|
2019-04-03 14:10:37 +02:00
|
|
|
search.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
2019-04-04 19:08:26 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-search-engine-custom-name"),
|
|
|
|
path: "header.search.engine.custom.name",
|
2019-04-04 19:12:49 +02:00
|
|
|
type: "text",
|
2019-04-04 19:08:26 +02:00
|
|
|
func: function() {
|
|
|
|
search.render();
|
|
|
|
}
|
2019-02-03 14:51:54 +01:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-search-engine-custom-url"),
|
|
|
|
path: "header.search.engine.custom.url",
|
|
|
|
type: "text",
|
|
|
|
func: function() {
|
2019-04-03 14:10:37 +02:00
|
|
|
search.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
2019-04-18 14:30:40 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-search-text-align-left"),
|
|
|
|
path: "header.search.text.align",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-search-text-align-center"),
|
|
|
|
path: "header.search.text.align",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-search-text-align-right"),
|
|
|
|
path: "header.search.text.align",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
2019-02-03 14:51:54 +01:00
|
|
|
}, {
|
2019-06-11 11:54:10 +02:00
|
|
|
element: helper.e(".control-header-search-size"),
|
|
|
|
path: "header.search.size",
|
|
|
|
type: "range",
|
|
|
|
valueMod: ["float"],
|
|
|
|
func: function() {
|
|
|
|
header.render.search.size();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-search-size-default"),
|
|
|
|
type: "button",
|
|
|
|
func: function() {
|
|
|
|
_setValue("header.search.size", 1);
|
|
|
|
header.render.search.size();
|
|
|
|
update();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-button-edit-add-show"),
|
|
|
|
path: "header.button.editAdd.show",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
2019-06-11 11:54:10 +02:00
|
|
|
dependents();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-11 11:54:10 +02:00
|
|
|
element: helper.e(".control-header-button-accent-show"),
|
|
|
|
path: "header.button.accent.show",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
2019-06-11 11:54:10 +02:00
|
|
|
dependents();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-button-size"),
|
|
|
|
path: "header.button.size",
|
|
|
|
type: "range",
|
|
|
|
valueMod: ["float"],
|
|
|
|
func: function() {
|
|
|
|
header.render.button.size();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-button-size-default"),
|
|
|
|
type: "button",
|
|
|
|
func: function() {
|
|
|
|
_setValue("header.button.size", 1);
|
|
|
|
header.render.button.size();
|
|
|
|
update();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-05-23 20:15:14 +02:00
|
|
|
element: helper.e(".control-header-shade-show"),
|
|
|
|
path: "header.shade.show",
|
|
|
|
type: "checkbox",
|
2019-02-03 14:51:54 +01:00
|
|
|
func: function() {
|
|
|
|
render();
|
2019-05-23 20:15:14 +02:00
|
|
|
dependents();
|
|
|
|
header.render.shade();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
2019-02-16 23:27:54 +01:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-shade-style-always"),
|
|
|
|
path: "header.shade.style",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
2019-05-23 20:15:14 +02:00
|
|
|
header.render.shade();
|
2019-02-16 23:27:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-shade-style-scroll"),
|
|
|
|
path: "header.shade.style",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
2019-05-23 20:15:14 +02:00
|
|
|
header.render.shade();
|
2019-02-16 23:27:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-header-shade-opacity"),
|
|
|
|
path: "header.shade.opacity",
|
|
|
|
type: "range",
|
|
|
|
valueMod: ["reverse", "float"],
|
|
|
|
func: function() {
|
2019-05-23 20:15:14 +02:00
|
|
|
header.render.opacity();
|
2019-02-16 23:27:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-05 00:26:09 +02:00
|
|
|
element: helper.e(".control-header-padding-top"),
|
|
|
|
path: "header.padding.top",
|
2019-02-16 23:27:54 +01:00
|
|
|
type: "range",
|
2019-04-03 13:47:41 +02:00
|
|
|
additionalEvents: [{
|
2019-05-23 20:15:14 +02:00
|
|
|
event: "input",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-area")
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
2019-04-03 13:47:41 +02:00
|
|
|
event: "mousedown",
|
2019-05-23 20:15:14 +02:00
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-area")
|
|
|
|
});
|
2019-04-03 13:47:41 +02:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mouseup",
|
2019-05-23 20:15:14 +02:00
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
2019-05-23 20:25:57 +02:00
|
|
|
}, {
|
|
|
|
event: "touchend",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
2019-05-23 20:15:14 +02:00
|
|
|
}, {
|
|
|
|
event: "keydown",
|
|
|
|
func: function() {
|
|
|
|
if (event.keyCode == 37 || event.keyCode == 38 || event.keyCode == 39 || event.keyCode == 40) {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-area"),
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "keyup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
2019-04-03 13:47:41 +02:00
|
|
|
}
|
|
|
|
}],
|
2019-02-16 23:27:54 +01:00
|
|
|
func: function() {
|
2019-05-23 20:15:14 +02:00
|
|
|
header.render.padding();
|
2019-02-16 23:27:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-05 00:26:09 +02:00
|
|
|
element: helper.e(".control-header-padding-bottom"),
|
|
|
|
path: "header.padding.bottom",
|
2019-04-04 12:13:07 +02:00
|
|
|
type: "range",
|
|
|
|
additionalEvents: [{
|
2019-05-23 20:15:14 +02:00
|
|
|
event: "input",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-area")
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
2019-04-04 12:13:07 +02:00
|
|
|
event: "mousedown",
|
2019-05-23 20:15:14 +02:00
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-area")
|
|
|
|
});
|
2019-04-04 12:13:07 +02:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mouseup",
|
2019-05-23 20:15:14 +02:00
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
2019-05-23 20:25:57 +02:00
|
|
|
}, {
|
|
|
|
event: "touchend",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
2019-05-23 20:15:14 +02:00
|
|
|
}, {
|
|
|
|
event: "keydown",
|
|
|
|
func: function() {
|
|
|
|
if (event.keyCode == 37 || event.keyCode == 38 || event.keyCode == 39 || event.keyCode == 40) {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".header-area"),
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "keyup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
2019-04-04 12:13:07 +02:00
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
2019-05-23 20:15:14 +02:00
|
|
|
header.render.padding();
|
2019-04-04 12:13:07 +02:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-05 00:26:09 +02:00
|
|
|
element: helper.e(".control-header-border-top-show"),
|
|
|
|
path: "header.border.top.show",
|
2019-02-16 23:27:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
2019-04-04 12:13:07 +02:00
|
|
|
dependents();
|
2019-05-23 20:15:14 +02:00
|
|
|
header.render.border();
|
2019-02-16 23:27:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-05 00:26:09 +02:00
|
|
|
element: helper.e(".control-header-border-top-width"),
|
|
|
|
path: "header.border.top.width",
|
2019-04-04 12:13:07 +02:00
|
|
|
type: "range",
|
|
|
|
func: function() {
|
2019-05-23 20:15:14 +02:00
|
|
|
header.render.border();
|
2019-04-04 12:13:07 +02:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-05 00:26:09 +02:00
|
|
|
element: helper.e(".control-header-border-bottom-show"),
|
|
|
|
path: "header.border.bottom.show",
|
2019-02-16 23:27:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
2019-04-04 12:13:07 +02:00
|
|
|
dependents();
|
2019-06-04 20:08:15 +02:00
|
|
|
header.render.border();
|
2019-04-26 14:48:37 +02:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-05 00:26:09 +02:00
|
|
|
element: helper.e(".control-header-border-bottom-width"),
|
|
|
|
path: "header.border.bottom.width",
|
2019-06-04 20:08:15 +02:00
|
|
|
type: "range",
|
2019-04-26 14:48:37 +02:00
|
|
|
func: function() {
|
2019-06-04 20:08:15 +02:00
|
|
|
header.render.border();
|
2019-04-26 14:48:37 +02:00
|
|
|
}
|
2019-02-03 14:51:54 +01:00
|
|
|
}, {
|
2019-05-23 20:15:14 +02:00
|
|
|
element: helper.e(".control-link-area-width"),
|
|
|
|
path: "link.area.width",
|
|
|
|
type: "range",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "input",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".link-area"),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mousedown",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".link-area"),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mouseup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
2019-05-23 20:25:57 +02:00
|
|
|
}, {
|
|
|
|
event: "touchend",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
2019-05-23 20:15:14 +02:00
|
|
|
}, {
|
|
|
|
event: "keydown",
|
|
|
|
func: function() {
|
|
|
|
if (event.keyCode == 37 || event.keyCode == 38 || event.keyCode == 39 || event.keyCode == 40) {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".link-area"),
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "keyup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
2019-06-11 11:54:10 +02:00
|
|
|
link.render.area.width();
|
2019-05-23 20:15:14 +02:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-link-area-width-match"),
|
|
|
|
type: "button",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "click",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".link-area"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mouseup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
2019-06-11 11:54:10 +02:00
|
|
|
_setValue("link.area.width", helper.getObject({
|
|
|
|
object: state.get(),
|
|
|
|
path: "header.area.width"
|
|
|
|
}));
|
|
|
|
link.render.area.width();
|
2019-05-23 20:15:14 +02:00
|
|
|
update();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-link-area-alignment-horizontal-left"),
|
|
|
|
path: "link.area.alignment.horizontal",
|
|
|
|
type: "radio",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "change",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".link-area"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-link-area-alignment-horizontal-center"),
|
|
|
|
path: "link.area.alignment.horizontal",
|
|
|
|
type: "radio",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "change",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".link-area"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-link-area-alignment-horizontal-right"),
|
|
|
|
path: "link.area.alignment.horizontal",
|
|
|
|
type: "radio",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "change",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".link-area"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-size"),
|
|
|
|
path: "link.item.size",
|
|
|
|
type: "range",
|
|
|
|
valueMod: ["float"],
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "input",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".link-item"),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mousedown",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".link-item"),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "mouseup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "touchend",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "keydown",
|
|
|
|
func: function() {
|
|
|
|
if (event.keyCode == 37 || event.keyCode == 38 || event.keyCode == 39 || event.keyCode == 40) {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".link-item"),
|
|
|
|
});
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
event: "keyup",
|
|
|
|
func: function() {
|
|
|
|
edge.destroy();
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
2019-06-11 11:54:10 +02:00
|
|
|
link.render.item.size();
|
2019-06-06 19:22:42 +02:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-link-item-size-default"),
|
|
|
|
type: "button",
|
|
|
|
additionalEvents: [{
|
|
|
|
event: "click",
|
|
|
|
func: function() {
|
|
|
|
edge.render({
|
|
|
|
element: helper.e(".link-item"),
|
|
|
|
delay: 500
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
func: function() {
|
2019-06-11 11:54:10 +02:00
|
|
|
_setValue("link.item.size", 1);
|
|
|
|
link.render.item.size();
|
2019-06-06 19:22:42 +02:00
|
|
|
update();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-link-show"),
|
2019-06-04 20:08:15 +02:00
|
|
|
path: "link.show",
|
2019-05-23 20:15:14 +02:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
2019-06-04 20:08:15 +02:00
|
|
|
search.render();
|
2019-05-23 20:15:14 +02:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-display-show"),
|
|
|
|
path: "link.item.display.show",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
2019-06-04 17:14:04 +02:00
|
|
|
func: function() {
|
|
|
|
render();
|
2019-06-04 20:08:15 +02:00
|
|
|
dependents();
|
2019-06-04 17:14:04 +02:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-display-letter-size"),
|
|
|
|
path: "link.item.display.letter.size",
|
2019-06-04 17:14:04 +02:00
|
|
|
type: "range",
|
|
|
|
valueMod: ["float"],
|
|
|
|
func: function() {
|
2019-06-11 11:54:10 +02:00
|
|
|
link.render.item.display.letter();
|
2019-06-04 17:14:04 +02:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-display-letter-size-default"),
|
|
|
|
type: "button",
|
|
|
|
func: function() {
|
2019-06-11 11:54:10 +02:00
|
|
|
_setValue("link.item.display.letter.size", 2);
|
|
|
|
link.render.item.display.letter();
|
2019-06-06 19:22:42 +02:00
|
|
|
update();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-link-item-display-icon-size"),
|
|
|
|
path: "link.item.display.icon.size",
|
2019-06-04 17:14:04 +02:00
|
|
|
type: "range",
|
|
|
|
valueMod: ["float"],
|
|
|
|
func: function() {
|
2019-06-11 11:54:10 +02:00
|
|
|
link.render.item.display.icon();
|
2019-06-04 17:14:04 +02:00
|
|
|
}
|
2019-06-04 20:08:15 +02:00
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-display-icon-size-default"),
|
|
|
|
type: "button",
|
2019-06-04 20:08:15 +02:00
|
|
|
func: function() {
|
2019-06-11 11:54:10 +02:00
|
|
|
_setValue("link.item.display.icon.size", 2);
|
2019-06-11 15:28:23 +02:00
|
|
|
link.render.item.display.icon();
|
2019-06-06 19:22:42 +02:00
|
|
|
update();
|
2019-06-04 20:08:15 +02:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-name-show"),
|
|
|
|
path: "link.item.name.show",
|
2019-06-04 20:08:15 +02:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-name-size"),
|
|
|
|
path: "link.item.name.size",
|
|
|
|
type: "range",
|
|
|
|
valueMod: ["float"],
|
2019-06-04 20:08:15 +02:00
|
|
|
func: function() {
|
2019-06-11 15:13:49 +02:00
|
|
|
link.render.item.name();
|
2019-06-04 20:08:15 +02:00
|
|
|
}
|
2019-06-04 17:14:04 +02:00
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-name-size-default"),
|
|
|
|
type: "button",
|
2019-06-04 17:14:04 +02:00
|
|
|
func: function() {
|
2019-06-11 15:28:23 +02:00
|
|
|
_setValue("link.item.name.size", 0.9);
|
2019-06-11 15:13:49 +02:00
|
|
|
link.render.item.name();
|
2019-06-06 19:22:42 +02:00
|
|
|
update();
|
2019-06-04 17:14:04 +02:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-url-show"),
|
|
|
|
path: "link.item.url.show",
|
|
|
|
type: "checkbox",
|
2019-06-04 17:14:04 +02:00
|
|
|
func: function() {
|
|
|
|
render();
|
2019-06-06 19:22:42 +02:00
|
|
|
dependents();
|
2019-06-04 17:14:04 +02:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-url-style-dark"),
|
|
|
|
path: "link.item.url.style",
|
2019-06-04 17:14:04 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-url-style-light"),
|
|
|
|
path: "link.item.url.style",
|
2019-06-04 17:14:04 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
2019-06-06 20:06:47 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-link-item-line-show"),
|
|
|
|
path: "link.item.line.show",
|
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
2019-06-04 17:14:04 +02:00
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-area-gap"),
|
|
|
|
path: "link.area.gap",
|
|
|
|
type: "range",
|
2019-06-04 17:14:04 +02:00
|
|
|
func: function() {
|
2019-06-06 19:22:42 +02:00
|
|
|
link.render.area.gap();
|
2019-06-04 17:14:04 +02:00
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-display-alignment-horizontal-left"),
|
|
|
|
path: "link.item.display.alignment.horizontal",
|
2019-06-04 17:14:04 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
2019-04-01 17:11:39 +02:00
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-display-alignment-horizontal-center"),
|
|
|
|
path: "link.item.display.alignment.horizontal",
|
2019-05-23 20:15:14 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-display-alignment-horizontal-right"),
|
|
|
|
path: "link.item.display.alignment.horizontal",
|
2019-05-23 20:15:14 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-display-alignment-vertical-top"),
|
|
|
|
path: "link.item.display.alignment.vertical",
|
2019-05-23 20:15:14 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-display-alignment-vertical-center"),
|
|
|
|
path: "link.item.display.alignment.vertical",
|
2019-04-01 17:11:39 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-06-06 19:22:42 +02:00
|
|
|
element: helper.e(".control-link-item-display-alignment-vertical-bottom"),
|
|
|
|
path: "link.item.display.alignment.vertical",
|
2019-04-01 17:11:39 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
2019-05-23 20:15:14 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-link-new-tab"),
|
|
|
|
path: "link.newTab",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
link.clear();
|
2019-06-06 19:22:42 +02:00
|
|
|
link.render.item.all();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-05-23 20:15:14 +02:00
|
|
|
element: helper.e(".control-link-style-block"),
|
|
|
|
path: "link.style",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-05-23 20:15:14 +02:00
|
|
|
element: helper.e(".control-link-style-list"),
|
|
|
|
path: "link.style",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-05-23 20:15:14 +02:00
|
|
|
element: helper.e(".control-link-sort-none"),
|
|
|
|
path: "link.sort",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
link.clear();
|
2019-06-06 19:22:42 +02:00
|
|
|
link.render.item.all();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-05-23 20:15:14 +02:00
|
|
|
element: helper.e(".control-link-sort-letter"),
|
|
|
|
path: "link.sort",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
link.clear();
|
2019-06-06 19:22:42 +02:00
|
|
|
link.render.item.all();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-05-23 20:15:14 +02:00
|
|
|
element: helper.e(".control-link-sort-icon"),
|
|
|
|
path: "link.sort",
|
2019-05-11 09:33:19 +02:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
link.clear();
|
2019-06-06 19:22:42 +02:00
|
|
|
link.render.item.all();
|
2019-05-11 09:33:19 +02:00
|
|
|
}
|
|
|
|
}, {
|
2019-05-23 20:15:14 +02:00
|
|
|
element: helper.e(".control-link-sort-name"),
|
|
|
|
path: "link.sort",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
link.clear();
|
2019-06-06 19:22:42 +02:00
|
|
|
link.render.item.all();
|
2019-05-23 20:15:14 +02:00
|
|
|
}
|
2019-02-03 14:51:54 +01:00
|
|
|
}, {
|
2019-04-01 17:11:39 +02:00
|
|
|
element: helper.e(".control-theme-style-dark"),
|
|
|
|
path: "theme.style",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
accent.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-theme-style-light"),
|
|
|
|
path: "theme.style",
|
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
accent.render();
|
|
|
|
}
|
2019-06-11 11:54:10 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-theme-radius"),
|
|
|
|
path: "theme.radius",
|
|
|
|
type: "range",
|
|
|
|
valueMod: ["float"],
|
|
|
|
func: function() {
|
|
|
|
theme.render.radius();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-theme-radius-default"),
|
|
|
|
type: "button",
|
|
|
|
func: function() {
|
|
|
|
_setValue("theme.radius", 0.2);
|
|
|
|
theme.render.radius();
|
|
|
|
update();
|
|
|
|
}
|
2019-04-01 17:11:39 +02:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-theme-accent-random-active"),
|
|
|
|
path: "theme.accent.random.active",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
dependents();
|
2019-04-01 17:11:39 +02:00
|
|
|
accent.render();
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
2019-04-01 17:11:39 +02:00
|
|
|
element: helper.e(".control-theme-accent-random-style-any"),
|
|
|
|
path: "theme.accent.random.style",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-04-01 17:11:39 +02:00
|
|
|
element: helper.e(".control-theme-accent-random-style-light"),
|
|
|
|
path: "theme.accent.random.style",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-04-01 17:11:39 +02:00
|
|
|
element: helper.e(".control-theme-accent-random-style-dark"),
|
|
|
|
path: "theme.accent.random.style",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-04-01 17:11:39 +02:00
|
|
|
element: helper.e(".control-theme-accent-random-style-pastel"),
|
|
|
|
path: "theme.accent.random.style",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
|
|
|
}, {
|
2019-04-01 17:11:39 +02:00
|
|
|
element: helper.e(".control-theme-accent-random-style-saturated"),
|
|
|
|
path: "theme.accent.random.style",
|
2019-02-03 14:51:54 +01:00
|
|
|
type: "radio",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
}
|
2019-02-23 15:20:58 +01:00
|
|
|
}, {
|
2019-04-01 17:11:39 +02:00
|
|
|
element: helper.e(".control-theme-accent-randomise"),
|
2019-02-23 15:20:58 +01:00
|
|
|
type: "button",
|
|
|
|
func: function() {
|
2019-04-01 17:11:39 +02:00
|
|
|
accent.random();
|
|
|
|
accent.render();
|
2019-02-23 15:20:58 +01:00
|
|
|
}
|
2019-02-03 14:51:54 +01:00
|
|
|
}, {
|
|
|
|
element: helper.e(".control-background-image-show"),
|
|
|
|
path: "background.image.show",
|
|
|
|
type: "checkbox",
|
|
|
|
func: function() {
|
|
|
|
render();
|
|
|
|
dependents();
|
|
|
|
background.render();
|
2019-05-23 20:15:14 +02:00
|
|
|
|
2019-02-03 14:51:54 +01:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-background-image-url"),
|
|
|
|
path: "background.image.url",
|
|
|
|
type: "text",
|
|
|
|
func: function() {
|
|
|
|
background.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-background-image-opacity"),
|
|
|
|
path: "background.image.opacity",
|
|
|
|
type: "range",
|
|
|
|
valueMod: ["reverse", "float"],
|
|
|
|
func: function() {
|
|
|
|
background.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-background-image-grayscale"),
|
|
|
|
path: "background.image.grayscale",
|
|
|
|
type: "range",
|
|
|
|
valueMod: ["float"],
|
|
|
|
func: function() {
|
|
|
|
background.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-background-image-blur"),
|
|
|
|
path: "background.image.blur",
|
|
|
|
type: "range",
|
|
|
|
func: function() {
|
|
|
|
background.render();
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
element: helper.e(".control-background-image-accent"),
|
|
|
|
path: "background.image.accent",
|
|
|
|
type: "range",
|
|
|
|
valueMod: ["float"],
|
|
|
|
func: function() {
|
|
|
|
background.render();
|
|
|
|
}
|
|
|
|
}];
|
|
|
|
|
2019-06-11 11:54:10 +02:00
|
|
|
var _setValue = function(path, value) {
|
|
|
|
helper.setObject({
|
|
|
|
object: state.get(),
|
|
|
|
path: path,
|
|
|
|
newValue: value
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
var _renderItemDisplayLetter = function() {
|
|
|
|
var html = helper.e("html");
|
|
|
|
html.style.setProperty("--link-item-display-letter-size", state.get().link.item.display.letter.size + "em");
|
|
|
|
};
|
|
|
|
|
2019-06-05 00:26:09 +02:00
|
|
|
var bind = function() {
|
2019-02-03 14:51:54 +01:00
|
|
|
var eventType = {
|
|
|
|
button: "click",
|
|
|
|
checkbox: "change",
|
|
|
|
radio: "change",
|
|
|
|
text: "input",
|
2019-04-26 14:48:37 +02:00
|
|
|
number: "input",
|
2019-02-03 14:51:54 +01:00
|
|
|
range: "input",
|
|
|
|
color: "change"
|
2018-12-26 08:45:53 +01:00
|
|
|
};
|
2019-02-03 14:51:54 +01:00
|
|
|
var valueType = {
|
|
|
|
checkbox: function(object) {
|
|
|
|
return object.element.checked;
|
|
|
|
},
|
|
|
|
radio: function(object) {
|
|
|
|
return object.element.value;
|
|
|
|
},
|
|
|
|
text: function(object) {
|
|
|
|
return object.element.value;
|
|
|
|
},
|
2019-04-26 14:48:37 +02:00
|
|
|
number: function(object) {
|
|
|
|
return parseInt(object.element.value, 10);
|
|
|
|
},
|
2019-02-03 14:51:54 +01:00
|
|
|
range: function(object) {
|
|
|
|
return parseInt(object.element.value, 10);
|
|
|
|
},
|
|
|
|
color: function(object) {
|
|
|
|
return helper.hexToRgb(object.element.value);
|
|
|
|
}
|
2019-01-03 23:30:27 +01:00
|
|
|
};
|
2019-02-03 14:51:54 +01:00
|
|
|
var valueMod = {
|
|
|
|
reverse: function(value, object) {
|
|
|
|
return parseInt(object.element.max, 10) - value;
|
|
|
|
},
|
|
|
|
float: function(value, object) {
|
|
|
|
return value / 100;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
var changeValue = function(object) {
|
|
|
|
if (object.path) {
|
|
|
|
var newValue = valueType[object.type](object);
|
|
|
|
if (object.valueMod) {
|
|
|
|
object.valueMod.forEach(function(arrayItem, index) {
|
|
|
|
newValue = valueMod[arrayItem](newValue, object);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
helper.setObject({
|
|
|
|
object: state.get(),
|
|
|
|
path: object.path,
|
|
|
|
newValue: newValue
|
|
|
|
});
|
2019-05-04 14:53:18 +02:00
|
|
|
// console.log(object.path, helper.getObject({
|
|
|
|
// object: state.get(),
|
|
|
|
// path: object.path
|
|
|
|
// }));
|
2019-02-03 14:51:54 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
var bindControl = function(object) {
|
|
|
|
var action = {
|
2019-05-23 20:15:14 +02:00
|
|
|
input: function(object, event) {
|
2019-02-03 14:51:54 +01:00
|
|
|
changeValue(object);
|
|
|
|
if (object.func) {
|
|
|
|
object.func();
|
|
|
|
};
|
|
|
|
},
|
2019-05-23 20:15:14 +02:00
|
|
|
button: function(object, event) {
|
2019-02-03 14:51:54 +01:00
|
|
|
if (object.func) {
|
|
|
|
object.func();
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
2019-05-23 20:15:14 +02:00
|
|
|
object.element.addEventListener(eventType[object.type], function(event) {
|
|
|
|
action[object.element.tagName.toLowerCase()](object, event);
|
2019-02-03 14:51:54 +01:00
|
|
|
data.save();
|
|
|
|
}, false);
|
2019-04-03 13:47:41 +02:00
|
|
|
if (object.additionalEvents) {
|
|
|
|
object.additionalEvents.forEach(function(item, index) {
|
2019-05-23 20:15:14 +02:00
|
|
|
object.element.addEventListener(item.event, function(event) {
|
|
|
|
item.func(event);
|
2019-05-23 20:42:25 +02:00
|
|
|
data.save();
|
2019-04-03 13:47:41 +02:00
|
|
|
}, false);
|
|
|
|
});
|
|
|
|
};
|
2018-12-28 08:04:22 +01:00
|
|
|
};
|
2019-02-03 14:51:54 +01:00
|
|
|
_allControl.forEach(function(arrayItem, index) {
|
|
|
|
bindControl(arrayItem);
|
|
|
|
});
|
2018-12-27 00:46:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
var render = function() {
|
|
|
|
var html = helper.e("html");
|
2019-02-03 14:51:54 +01:00
|
|
|
var _menu = function() {
|
|
|
|
helper.addClass(html, "is-menu");
|
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
var _header = function() {
|
|
|
|
var _area = function() {
|
|
|
|
helper.removeClass(html, "is-header-area-alignment-horizontal-left");
|
|
|
|
helper.removeClass(html, "is-header-area-alignment-horizontal-center");
|
|
|
|
helper.removeClass(html, "is-header-area-alignment-horizontal-right");
|
|
|
|
helper.addClass(html, "is-header-area-alignment-horizontal-" + state.get().header.area.alignment.horizontal);
|
2018-12-28 08:04:22 +01:00
|
|
|
};
|
2019-06-06 19:22:42 +02:00
|
|
|
var _item = function() {
|
|
|
|
helper.removeClass(html, "is-header-item-alignment-horizontal-left");
|
|
|
|
helper.removeClass(html, "is-header-item-alignment-horizontal-center");
|
|
|
|
helper.removeClass(html, "is-header-item-alignment-horizontal-right");
|
|
|
|
helper.addClass(html, "is-header-item-alignment-horizontal-" + state.get().header.item.alignment.horizontal);
|
2019-01-05 21:57:21 +01:00
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
var _clock = function() {
|
|
|
|
if (state.get().header.clock.seconds.show || state.get().header.clock.minutes.show || state.get().header.clock.hours.show) {
|
|
|
|
helper.addClass(html, "is-header-clock-show");
|
|
|
|
} else {
|
|
|
|
helper.removeClass(html, "is-header-clock-show");
|
|
|
|
};
|
2019-01-03 23:30:27 +01:00
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
var _date = function() {
|
|
|
|
if (state.get().header.date.date.show || state.get().header.date.day.show || state.get().header.date.month.show || state.get().header.date.year.show) {
|
|
|
|
helper.addClass(html, "is-header-date-show");
|
|
|
|
} else {
|
|
|
|
helper.removeClass(html, "is-header-date-show");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var _search = function() {
|
2019-02-03 14:51:54 +01:00
|
|
|
helper.removeClass(html, "is-header-search-show");
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.removeClass(html, "is-header-search-style-custom");
|
|
|
|
helper.removeClass(html, "is-header-search-style-auto");
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.removeClass(html, "is-header-search-text-align-left");
|
|
|
|
helper.removeClass(html, "is-header-search-text-align-center");
|
|
|
|
helper.removeClass(html, "is-header-search-text-align-right");
|
|
|
|
if (state.get().header.search.show) {
|
|
|
|
helper.addClass(html, "is-header-search-show");
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.addClass(html, "is-header-search-style-" + state.get().header.search.style);
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.addClass(html, "is-header-search-text-align-" + state.get().header.search.text.align);
|
|
|
|
};
|
|
|
|
helper.e(".control-header-search-engine-custom-name").value = state.get().header.search.engine.custom.name;
|
|
|
|
helper.e(".control-header-search-engine-custom-url").value = state.get().header.search.engine.custom.url;
|
|
|
|
};
|
|
|
|
var _editAdd = function() {
|
2019-06-11 11:54:10 +02:00
|
|
|
if (state.get().header.button.editAdd.show) {
|
|
|
|
helper.addClass(html, "is-header-button-edit-add-show");
|
2019-06-05 00:26:09 +02:00
|
|
|
} else {
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.removeClass(html, "is-header-button-edit-add-show");
|
2019-06-05 00:26:09 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
var _accent = function() {
|
2019-06-11 11:54:10 +02:00
|
|
|
if (state.get().header.button.accent.show) {
|
|
|
|
helper.addClass(html, "is-header-button-accent-show");
|
2019-06-05 00:26:09 +02:00
|
|
|
} else {
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.removeClass(html, "is-header-button-accent-show");
|
2019-06-05 00:26:09 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
var _greeting = function() {
|
|
|
|
if (state.get().header.greeting.show) {
|
|
|
|
helper.addClass(html, "is-header-greeting-show");
|
|
|
|
} else {
|
|
|
|
helper.removeClass(html, "is-header-greeting-show");
|
|
|
|
};
|
2019-01-03 23:30:27 +01:00
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
var _transitional = function() {
|
|
|
|
if (state.get().header.transitional.show && (state.get().header.date.date.show || state.get().header.date.day.show || state.get().header.date.month.show || state.get().header.date.year.show || state.get().header.clock.seconds.show || state.get().header.clock.minutes.show || state.get().header.clock.hours.show)) {
|
|
|
|
helper.addClass(html, "is-header-transitional-show");
|
|
|
|
} else {
|
|
|
|
helper.removeClass(html, "is-header-transitional-show");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var _shade = function() {
|
|
|
|
helper.removeClass(html, "is-header-shade-show");
|
|
|
|
helper.removeClass(html, "is-header-shade-style-always");
|
|
|
|
helper.removeClass(html, "is-header-shade-style-scroll");
|
|
|
|
if (state.get().header.shade.show) {
|
|
|
|
helper.addClass(html, "is-header-shade-show");
|
|
|
|
helper.addClass(html, "is-header-shade-style-" + state.get().header.shade.style);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var _border = function() {
|
|
|
|
helper.removeClass(html, "is-header-border-top-show");
|
|
|
|
helper.removeClass(html, "is-header-border-bottom-show");
|
|
|
|
if (state.get().header.border.top.show) {
|
|
|
|
helper.addClass(html, "is-header-border-top-show");
|
|
|
|
};
|
|
|
|
if (state.get().header.border.bottom.show) {
|
|
|
|
helper.addClass(html, "is-header-border-bottom-show");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
_area();
|
2019-06-06 19:22:42 +02:00
|
|
|
_item();
|
2019-06-05 00:26:09 +02:00
|
|
|
_clock();
|
|
|
|
_date();
|
|
|
|
_search();
|
|
|
|
_editAdd();
|
|
|
|
_accent();
|
|
|
|
_shade();
|
|
|
|
_border();
|
|
|
|
_greeting();
|
|
|
|
_transitional();
|
2019-01-03 23:30:27 +01:00
|
|
|
};
|
|
|
|
var _link = function() {
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.removeClass(html, "is-link-show");
|
2019-05-23 20:15:14 +02:00
|
|
|
helper.removeClass(html, "is-link-area-alignment-horizontal-left");
|
|
|
|
helper.removeClass(html, "is-link-area-alignment-horizontal-center");
|
|
|
|
helper.removeClass(html, "is-link-area-alignment-horizontal-right");
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.removeClass(html, "is-link-name-show");
|
|
|
|
helper.removeClass(html, "is-link-display-show");
|
2019-06-04 17:14:04 +02:00
|
|
|
helper.removeClass(html, "is-link-display-alignment-horizontal-left");
|
|
|
|
helper.removeClass(html, "is-link-display-alignment-horizontal-center");
|
|
|
|
helper.removeClass(html, "is-link-display-alignment-horizontal-right");
|
|
|
|
helper.removeClass(html, "is-link-display-alignment-vertical-top");
|
|
|
|
helper.removeClass(html, "is-link-display-alignment-vertical-center");
|
|
|
|
helper.removeClass(html, "is-link-display-alignment-vertical-bottom");
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.removeClass(html, "is-link-url-show");
|
|
|
|
helper.removeClass(html, "is-link-url-style-light");
|
|
|
|
helper.removeClass(html, "is-link-url-style-dark");
|
2019-06-06 20:06:47 +02:00
|
|
|
helper.removeClass(html, "is-link-item-line-show");
|
2019-06-06 19:22:42 +02:00
|
|
|
helper.removeClass(html, "is-link-item-alignment-horizontal-left");
|
|
|
|
helper.removeClass(html, "is-link-item-alignment-horizontal-center");
|
|
|
|
helper.removeClass(html, "is-link-item-alignment-horizontal-right");
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.removeClass(html, "is-link-style-list");
|
|
|
|
helper.removeClass(html, "is-link-style-block");
|
|
|
|
helper.removeClass(html, "is-link-edit");
|
|
|
|
link.render.tabIndex();
|
2019-05-23 20:15:14 +02:00
|
|
|
if (state.get().link.show) {
|
2019-06-04 20:08:15 +02:00
|
|
|
helper.addClass(html, "is-link-show");
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.addClass(html, "is-link-area-alignment-horizontal-" + state.get().link.area.alignment.horizontal);
|
2019-06-06 19:22:42 +02:00
|
|
|
helper.addClass(html, "is-link-display-alignment-horizontal-" + state.get().link.item.display.alignment.horizontal);
|
|
|
|
helper.addClass(html, "is-link-display-alignment-vertical-" + state.get().link.item.display.alignment.vertical);
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.addClass(html, "is-link-style-" + state.get().link.style);
|
2019-06-06 19:22:42 +02:00
|
|
|
helper.addClass(html, "is-link-url-style-" + state.get().link.item.url.style);
|
|
|
|
if (state.get().link.item.name.show) {
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.addClass(html, "is-link-name-show");
|
|
|
|
};
|
2019-06-06 19:22:42 +02:00
|
|
|
if (state.get().link.item.display.show) {
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.addClass(html, "is-link-display-show");
|
|
|
|
};
|
2019-06-06 19:22:42 +02:00
|
|
|
if (state.get().link.item.url.show) {
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.addClass(html, "is-link-url-show");
|
|
|
|
};
|
2019-06-06 20:06:47 +02:00
|
|
|
if (state.get().link.item.line.show) {
|
|
|
|
helper.addClass(html, "is-link-item-line-show");
|
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
if (state.get().link.edit) {
|
|
|
|
helper.addClass(html, "is-link-edit");
|
|
|
|
link.render.tabIndex();
|
|
|
|
};
|
2019-04-01 17:11:39 +02:00
|
|
|
};
|
2019-01-03 23:30:27 +01:00
|
|
|
};
|
|
|
|
var _layout = function() {
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.removeClass(html, "is-layout-scroll-past-end");
|
2019-05-23 20:15:14 +02:00
|
|
|
helper.removeClass(html, "is-layout-alignment-horizontal-left");
|
|
|
|
helper.removeClass(html, "is-layout-alignment-horizontal-center");
|
|
|
|
helper.removeClass(html, "is-layout-alignment-horizontal-right");
|
|
|
|
helper.removeClass(html, "is-layout-alignment-vertical-top");
|
|
|
|
helper.removeClass(html, "is-layout-alignment-vertical-center");
|
|
|
|
helper.removeClass(html, "is-layout-alignment-vertical-bottom");
|
|
|
|
helper.addClass(html, "is-layout-alignment-horizontal-" + state.get().layout.alignment.horizontal);
|
|
|
|
helper.addClass(html, "is-layout-alignment-vertical-" + state.get().layout.alignment.vertical);
|
2019-06-05 00:26:09 +02:00
|
|
|
if (state.get().layout.scrollPastEnd) {
|
|
|
|
helper.addClass(html, "is-layout-scroll-past-end");
|
|
|
|
};
|
2019-01-03 23:30:27 +01:00
|
|
|
};
|
2019-04-01 17:11:39 +02:00
|
|
|
var _theme = function() {
|
2019-04-03 13:47:41 +02:00
|
|
|
helper.removeClass(html, "is-theme-style-dark");
|
|
|
|
helper.removeClass(html, "is-theme-style-light");
|
|
|
|
helper.addClass(html, "is-theme-style-" + state.get().theme.style);
|
2019-04-01 17:11:39 +02:00
|
|
|
};
|
2019-02-03 14:51:54 +01:00
|
|
|
var _background = function() {
|
|
|
|
if (state.get().background.image.show) {
|
|
|
|
helper.addClass(html, "is-background-image-show");
|
|
|
|
} else {
|
|
|
|
helper.removeClass(html, "is-background-image-show");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
_menu();
|
2019-06-05 00:26:09 +02:00
|
|
|
_header();
|
2019-01-03 23:30:27 +01:00
|
|
|
_link();
|
|
|
|
_layout();
|
2019-04-01 17:11:39 +02:00
|
|
|
_theme();
|
2019-02-03 14:51:54 +01:00
|
|
|
_background();
|
2018-12-27 00:46:53 +01:00
|
|
|
};
|
|
|
|
|
2019-01-13 23:54:48 +01:00
|
|
|
var dependents = function() {
|
2019-06-05 00:26:09 +02:00
|
|
|
var _header = function() {
|
|
|
|
var _clock = function() {
|
|
|
|
var activeCount = 0;
|
|
|
|
var toCheck = [state.get().header.clock.seconds.show, state.get().header.clock.minutes.show, state.get().header.clock.hours.show];
|
|
|
|
toCheck.forEach(function(arrayItem, index) {
|
|
|
|
if (arrayItem == true) {
|
|
|
|
activeCount++;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
if (activeCount >= 2 && (state.get().header.clock.seconds.show || state.get().header.clock.minutes.show || state.get().header.clock.hours.show)) {
|
|
|
|
helper.e(".control-header-clock-separator-show").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-clock-separator-show").disabled = true;
|
2019-01-05 21:57:21 +01:00
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
if (state.get().header.clock.seconds.show || state.get().header.clock.minutes.show || state.get().header.clock.hours.show) {
|
|
|
|
helper.e(".control-header-clock-hour24-show").disabled = false;
|
|
|
|
helper.e(".control-header-clock-meridiem-show").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-clock-hour24-show").disabled = true;
|
|
|
|
helper.e(".control-header-clock-meridiem-show").disabled = true;
|
|
|
|
};
|
|
|
|
if ((state.get().header.clock.seconds.show || state.get().header.clock.minutes.show || state.get().header.clock.hours.show) && !state.get().header.clock.hour24.show) {
|
|
|
|
helper.e(".control-header-clock-meridiem-show").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-clock-meridiem-show").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.clock.hours.show) {
|
|
|
|
helper.e(".control-header-clock-hours-display-number").disabled = false;
|
|
|
|
helper.e(".control-header-clock-hours-display-word").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-clock-hours-display-number").disabled = true;
|
|
|
|
helper.e(".control-header-clock-hours-display-word").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.clock.minutes.show) {
|
|
|
|
helper.e(".control-header-clock-minutes-display-number").disabled = false;
|
|
|
|
helper.e(".control-header-clock-minutes-display-word").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-clock-minutes-display-number").disabled = true;
|
|
|
|
helper.e(".control-header-clock-minutes-display-word").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.clock.seconds.show) {
|
|
|
|
helper.e(".control-header-clock-seconds-display-number").disabled = false;
|
|
|
|
helper.e(".control-header-clock-seconds-display-word").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-clock-seconds-display-number").disabled = true;
|
|
|
|
helper.e(".control-header-clock-seconds-display-word").disabled = true;
|
2019-01-05 21:57:21 +01:00
|
|
|
};
|
2019-06-11 11:54:10 +02:00
|
|
|
if (state.get().header.clock.seconds.show || state.get().header.clock.minutes.show || state.get().header.clock.hours.show) {
|
|
|
|
helper.e("[for=control-header-clock-size]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-clock-size").disabled = false;
|
|
|
|
helper.e(".control-header-clock-size-default").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e("[for=control-header-clock-size]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-clock-size").disabled = true;
|
|
|
|
helper.e(".control-header-clock-size-default").disabled = true;
|
|
|
|
};
|
2019-04-26 14:48:37 +02:00
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
var _date = function() {
|
|
|
|
var activeCount = 0;
|
|
|
|
var toCheck = [state.get().header.date.day.show, state.get().header.date.date.show, state.get().header.date.month.show, state.get().header.date.year.show];
|
|
|
|
toCheck.forEach(function(arrayItem, index) {
|
|
|
|
if (arrayItem == true) {
|
|
|
|
activeCount++;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
if (activeCount >= 2 && (state.get().header.date.day.show || state.get().header.date.date.show || state.get().header.date.month.show || state.get().header.date.year.show)) {
|
|
|
|
helper.e(".control-header-date-separator-show").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-date-separator-show").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.date.date.show && state.get().header.date.month.show) {
|
|
|
|
helper.e(".control-header-date-format-label").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-date-format-datemonth").disabled = false;
|
|
|
|
helper.e(".control-header-date-format-monthdate").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-date-format-label").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-date-format-datemonth").disabled = true;
|
|
|
|
helper.e(".control-header-date-format-monthdate").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.date.day.show) {
|
|
|
|
helper.e(".control-header-date-day-display-number").disabled = false;
|
|
|
|
helper.e(".control-header-date-day-display-word").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-date-day-display-number").disabled = true;
|
|
|
|
helper.e(".control-header-date-day-display-word").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.date.date.show) {
|
|
|
|
helper.e(".control-header-date-date-display-number").disabled = false;
|
|
|
|
helper.e(".control-header-date-date-display-word").disabled = false;
|
|
|
|
helper.e(".control-header-date-date-ordinal").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-date-date-display-number").disabled = true;
|
|
|
|
helper.e(".control-header-date-date-display-word").disabled = true;
|
|
|
|
helper.e(".control-header-date-date-ordinal").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.date.month.show) {
|
|
|
|
helper.e(".control-header-date-month-display-number").disabled = false;
|
|
|
|
helper.e(".control-header-date-month-display-word").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-date-month-display-number").disabled = true;
|
|
|
|
helper.e(".control-header-date-month-display-word").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.date.year.show) {
|
|
|
|
helper.e(".control-header-date-year-display-number").disabled = false;
|
|
|
|
helper.e(".control-header-date-year-display-word").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-date-year-display-number").disabled = true;
|
|
|
|
helper.e(".control-header-date-year-display-word").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.date.day.show && state.get().header.date.day.display == "number") {
|
|
|
|
helper.e(".control-header-date-day-week-start-label").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-date-day-week-start-monday").disabled = false;
|
|
|
|
helper.e(".control-header-date-day-week-start-sunday").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-date-day-week-start-label").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-date-day-week-start-monday").disabled = true;
|
|
|
|
helper.e(".control-header-date-day-week-start-sunday").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.date.day.show && state.get().header.date.day.display == "word") {
|
|
|
|
helper.e(".control-header-date-day-length-label").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-date-day-length-long").disabled = false;
|
|
|
|
helper.e(".control-header-date-day-length-short").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-date-day-length-label").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-date-day-length-long").disabled = true;
|
|
|
|
helper.e(".control-header-date-day-length-short").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.date.month.show && state.get().header.date.month.display == "word") {
|
|
|
|
helper.e(".control-header-date-month-length-label").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-date-month-length-long").disabled = false;
|
|
|
|
helper.e(".control-header-date-month-length-short").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-date-month-length-label").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-date-month-length-long").disabled = true;
|
|
|
|
helper.e(".control-header-date-month-length-short").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.date.month.show && state.get().header.date.month.display == "number") {
|
|
|
|
helper.e(".control-header-date-month-ordinal").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-date-month-ordinal").disabled = true;
|
|
|
|
};
|
2019-06-11 11:54:10 +02:00
|
|
|
if (state.get().header.date.day.show || state.get().header.date.date.show || state.get().header.date.month.show || state.get().header.date.year.show) {
|
|
|
|
helper.e("[for=control-header-date-size]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-date-size").disabled = false;
|
|
|
|
helper.e(".control-header-date-size-default").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e("[for=control-header-date-size]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-date-size").disabled = true;
|
|
|
|
helper.e(".control-header-date-size-default").disabled = true;
|
|
|
|
};
|
2019-01-03 23:30:27 +01:00
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
var _shade = function() {
|
|
|
|
if (state.get().header.shade.show) {
|
|
|
|
helper.e(".control-header-shade-style-always").disabled = false;
|
|
|
|
helper.e(".control-header-shade-style-scroll").disabled = false;
|
|
|
|
helper.e("[for=control-header-shade-opacity]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-shade-opacity").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-shade-style-always").disabled = true;
|
|
|
|
helper.e(".control-header-shade-style-scroll").disabled = true;
|
|
|
|
helper.e("[for=control-header-shade-opacity]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-shade-opacity").disabled = true;
|
|
|
|
};
|
2019-01-03 23:30:27 +01:00
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
var _border = function() {
|
|
|
|
if (state.get().header.border.top.show) {
|
|
|
|
helper.e("[for=control-header-border-top-width]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-border-top-width").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e("[for=control-header-border-top-width]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-border-top-width").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.border.bottom.show) {
|
|
|
|
helper.e("[for=control-header-border-bottom-width]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-border-bottom-width").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e("[for=control-header-border-bottom-width]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-border-bottom-width").disabled = true;
|
|
|
|
};
|
2019-01-03 23:30:27 +01:00
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
var _search = function() {
|
|
|
|
if (state.get().header.search.show) {
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.e(".control-header-search-style-label").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-search-style-auto").disabled = false;
|
|
|
|
helper.e(".control-header-search-style-custom").disabled = false;
|
|
|
|
helper.e("[for=control-header-search-width]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-search-width").disabled = false;
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.e(".control-header-search-focus").disabled = false;
|
|
|
|
helper.e(".control-header-search-engine-label").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-search-engine-google").disabled = false;
|
|
|
|
helper.e(".control-header-search-engine-duckduckgo").disabled = false;
|
|
|
|
helper.e(".control-header-search-engine-youtube").disabled = false;
|
|
|
|
helper.e(".control-header-search-engine-giphy").disabled = false;
|
|
|
|
helper.e(".control-header-search-engine-custom").disabled = false;
|
|
|
|
helper.e(".control-header-search-text-align-label").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-search-text-align-left").disabled = false;
|
|
|
|
helper.e(".control-header-search-text-align-center").disabled = false;
|
|
|
|
helper.e(".control-header-search-text-align-right").disabled = false;
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.e("[for=control-header-search-size]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-search-size").disabled = false;
|
|
|
|
helper.e(".control-header-search-size-default").disabled = false;
|
2019-06-05 00:26:09 +02:00
|
|
|
} else {
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.e(".control-header-search-style-label").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-search-style-auto").disabled = true;
|
|
|
|
helper.e(".control-header-search-style-custom").disabled = true;
|
|
|
|
helper.e("[for=control-header-search-width]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-search-width").disabled = true;
|
2019-06-05 00:26:09 +02:00
|
|
|
helper.e(".control-header-search-focus").disabled = true;
|
|
|
|
helper.e(".control-header-search-engine-label").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-search-engine-google").disabled = true;
|
|
|
|
helper.e(".control-header-search-engine-duckduckgo").disabled = true;
|
|
|
|
helper.e(".control-header-search-engine-youtube").disabled = true;
|
|
|
|
helper.e(".control-header-search-engine-giphy").disabled = true;
|
|
|
|
helper.e(".control-header-search-engine-custom").disabled = true;
|
|
|
|
helper.e(".control-header-search-text-align-label").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-search-text-align-left").disabled = true;
|
|
|
|
helper.e(".control-header-search-text-align-center").disabled = true;
|
|
|
|
helper.e(".control-header-search-text-align-right").disabled = true;
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.e("[for=control-header-search-size]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-search-size").disabled = true;
|
|
|
|
helper.e(".control-header-search-size-default").disabled = true;
|
2019-06-05 00:26:09 +02:00
|
|
|
};
|
|
|
|
if (state.get().header.search.show && state.get().header.search.engine.selected === "custom") {
|
|
|
|
helper.e("[for=control-header-search-engine-custom-name]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-search-engine-custom-name").disabled = false;
|
|
|
|
helper.e("[for=control-header-search-engine-custom-url]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-search-engine-custom-url").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e("[for=control-header-search-engine-custom-name]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-search-engine-custom-name").disabled = true;
|
|
|
|
helper.e("[for=control-header-search-engine-custom-url]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-search-engine-custom-url").disabled = true;
|
|
|
|
};
|
2019-06-11 11:54:10 +02:00
|
|
|
if (state.get().header.search.show && state.get().header.search.style === "custom") {
|
|
|
|
helper.e("[for=control-header-search-width]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-search-width").disabled = false;
|
2019-06-05 00:26:09 +02:00
|
|
|
} else {
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.e("[for=control-header-search-width]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-search-width").disabled = true;
|
2019-06-05 00:26:09 +02:00
|
|
|
};
|
2019-01-03 23:30:27 +01:00
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
var _greeting = function() {
|
|
|
|
if (state.get().header.greeting.show) {
|
|
|
|
helper.e("[for=control-header-greeting-name]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-greeting-name").disabled = false;
|
|
|
|
helper.e(".control-header-greeting-type-good").disabled = false;
|
|
|
|
helper.e(".control-header-greeting-type-hello").disabled = false;
|
|
|
|
helper.e(".control-header-greeting-type-hi").disabled = false;
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.e("[for=control-header-greeting-size]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-greeting-size").disabled = false;
|
|
|
|
helper.e(".control-header-greeting-size-default").disabled = false;
|
2019-06-05 00:26:09 +02:00
|
|
|
} else {
|
|
|
|
helper.e("[for=control-header-greeting-name]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-greeting-name").disabled = true;
|
|
|
|
helper.e(".control-header-greeting-type-good").disabled = true;
|
|
|
|
helper.e(".control-header-greeting-type-hello").disabled = true;
|
|
|
|
helper.e(".control-header-greeting-type-hi").disabled = true;
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.e("[for=control-header-greeting-size]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-greeting-size").disabled = true;
|
|
|
|
helper.e(".control-header-greeting-size-default").disabled = true;
|
2019-06-05 00:26:09 +02:00
|
|
|
};
|
2019-01-03 23:30:27 +01:00
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
var _transitional = function() {
|
|
|
|
if (state.get().header.date.date.show || state.get().header.date.day.show || state.get().header.date.month.show || state.get().header.date.year.show || state.get().header.clock.seconds.show || state.get().header.clock.minutes.show || state.get().header.clock.hours.show) {
|
|
|
|
helper.e(".control-header-transitional-show").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-header-transitional-show").disabled = true;
|
|
|
|
};
|
|
|
|
if (state.get().header.transitional.show && ((state.get().header.date.date.show || state.get().header.date.day.show || state.get().header.date.month.show || state.get().header.date.year.show || state.get().header.clock.seconds.show || state.get().header.clock.minutes.show || state.get().header.clock.hours.show))) {
|
|
|
|
helper.e(".control-header-transitional-type-timeanddate").disabled = false;
|
|
|
|
helper.e(".control-header-transitional-type-its").disabled = false;
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.e("[for=control-header-transitional-size]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-header-transitional-size").disabled = false;
|
|
|
|
helper.e(".control-header-transitional-size-default").disabled = false;
|
2019-06-05 00:26:09 +02:00
|
|
|
} else {
|
|
|
|
helper.e(".control-header-transitional-type-timeanddate").disabled = true;
|
|
|
|
helper.e(".control-header-transitional-type-its").disabled = true;
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.e("[for=control-header-transitional-size]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-header-transitional-size").disabled = true;
|
|
|
|
helper.e(".control-header-transitional-size-default").disabled = true;
|
2019-06-05 00:26:09 +02:00
|
|
|
};
|
2019-04-18 14:30:40 +02:00
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
_clock();
|
|
|
|
_date();
|
|
|
|
_border();
|
|
|
|
_shade();
|
|
|
|
_search();
|
|
|
|
_greeting();
|
|
|
|
_transitional();
|
2018-12-27 00:46:53 +01:00
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
var _edit = function() {
|
|
|
|
if (bookmarks.get().length > 0) {
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.e(".control-link-edit").disabled = false;
|
2019-01-14 19:50:48 +01:00
|
|
|
} else {
|
2019-06-11 11:54:10 +02:00
|
|
|
helper.e(".control-link-edit").disabled = true;
|
|
|
|
helper.e(".control-link-edit").checked = false;
|
2019-01-14 19:50:48 +01:00
|
|
|
};
|
|
|
|
};
|
2019-01-24 21:28:11 +01:00
|
|
|
var _link = function() {
|
2019-06-06 19:22:42 +02:00
|
|
|
helper.e("[for=control-link-area-width]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-link-area-width").disabled = true;
|
|
|
|
helper.e(".control-link-area-width-match").disabled = true;
|
|
|
|
helper.e(".control-link-area-alignment-horizontal-label").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-link-area-alignment-horizontal-left").disabled = true;
|
|
|
|
helper.e(".control-link-area-alignment-horizontal-center").disabled = true;
|
|
|
|
helper.e(".control-link-area-alignment-horizontal-right").disabled = true;
|
|
|
|
helper.e("[for=control-link-item-size]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-link-item-size").disabled = true;
|
|
|
|
helper.e(".control-link-item-size-default").disabled = true;
|
|
|
|
helper.e(".control-link-item-display-show").disabled = true;
|
|
|
|
helper.e("[for=control-link-item-display-letter-size]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-link-item-display-letter-size").disabled = true;
|
|
|
|
helper.e(".control-link-item-display-letter-size-default").disabled = true;
|
|
|
|
helper.e("[for=control-link-item-display-icon-size]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-link-item-display-icon-size").disabled = true;
|
|
|
|
helper.e(".control-link-item-display-icon-size-default").disabled = true;
|
|
|
|
helper.e(".control-link-item-name-show").disabled = true;
|
|
|
|
helper.e("[for=control-link-item-name-size]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-link-item-name-size").disabled = true;
|
|
|
|
helper.e(".control-link-item-name-size-default").disabled = true;
|
|
|
|
helper.e(".control-link-item-url-show").disabled = true;
|
|
|
|
helper.e(".control-link-item-url-style-dark").disabled = true;
|
|
|
|
helper.e(".control-link-item-url-style-light").disabled = true;
|
2019-06-06 20:06:47 +02:00
|
|
|
helper.e(".control-link-item-line-show").disabled = true;
|
2019-06-06 19:22:42 +02:00
|
|
|
helper.e("[for=control-link-area-gap]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-link-area-gap").disabled = true;
|
|
|
|
helper.e(".control-link-item-display-alignment-horizontal-label").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-link-item-display-alignment-horizontal-left").disabled = true;
|
|
|
|
helper.e(".control-link-item-display-alignment-horizontal-center").disabled = true;
|
|
|
|
helper.e(".control-link-item-display-alignment-horizontal-right").disabled = true;
|
|
|
|
helper.e(".control-link-item-display-alignment-vertical-label").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-link-item-display-alignment-vertical-top").disabled = true;
|
|
|
|
helper.e(".control-link-item-display-alignment-vertical-center").disabled = true;
|
|
|
|
helper.e(".control-link-item-display-alignment-vertical-bottom").disabled = true;
|
|
|
|
helper.e(".control-link-new-tab").disabled = true;
|
|
|
|
helper.e(".control-link-style-block").disabled = true;
|
|
|
|
helper.e(".control-link-style-list").disabled = true;
|
|
|
|
helper.e(".control-link-sort-none").disabled = true;
|
|
|
|
helper.e(".control-link-sort-name").disabled = true;
|
|
|
|
helper.e(".control-link-sort-letter").disabled = true;
|
|
|
|
helper.e(".control-link-sort-icon").disabled = true;
|
2019-05-23 20:15:14 +02:00
|
|
|
if (state.get().link.show) {
|
|
|
|
helper.e("[for=control-link-area-width]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-link-area-width").disabled = false;
|
|
|
|
helper.e(".control-link-area-width-match").disabled = false;
|
|
|
|
helper.e(".control-link-area-alignment-horizontal-label").removeAttribute("disabled");
|
|
|
|
helper.e(".control-link-area-alignment-horizontal-left").disabled = false;
|
|
|
|
helper.e(".control-link-area-alignment-horizontal-center").disabled = false;
|
|
|
|
helper.e(".control-link-area-alignment-horizontal-right").disabled = false;
|
2019-06-06 19:22:42 +02:00
|
|
|
helper.e("[for=control-link-item-size]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-link-item-size").disabled = false;
|
|
|
|
helper.e(".control-link-item-size-default").disabled = false;
|
|
|
|
helper.e(".control-link-item-display-show").disabled = false;
|
|
|
|
helper.e(".control-link-item-name-show").disabled = false;
|
|
|
|
helper.e(".control-link-item-url-show").disabled = false;
|
2019-06-06 20:06:47 +02:00
|
|
|
helper.e(".control-link-item-line-show").disabled = false;
|
2019-06-06 19:22:42 +02:00
|
|
|
helper.e("[for=control-link-area-gap]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-link-area-gap").disabled = false;
|
|
|
|
helper.e(".control-link-new-tab").disabled = false;
|
2019-05-23 20:15:14 +02:00
|
|
|
helper.e(".control-link-style-block").disabled = false;
|
|
|
|
helper.e(".control-link-style-list").disabled = false;
|
|
|
|
helper.e(".control-link-sort-none").disabled = false;
|
|
|
|
helper.e(".control-link-sort-name").disabled = false;
|
|
|
|
helper.e(".control-link-sort-letter").disabled = false;
|
|
|
|
helper.e(".control-link-sort-icon").disabled = false;
|
2019-06-06 19:22:42 +02:00
|
|
|
if (state.get().link.item.display.show) {
|
|
|
|
helper.e("[for=control-link-item-display-letter-size]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-link-item-display-letter-size").disabled = false;
|
|
|
|
helper.e(".control-link-item-display-letter-size-default").disabled = false;
|
|
|
|
helper.e("[for=control-link-item-display-icon-size]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-link-item-display-icon-size").disabled = false;
|
|
|
|
helper.e(".control-link-item-display-icon-size-default").disabled = false;
|
|
|
|
};
|
|
|
|
if (state.get().link.item.name.show) {
|
|
|
|
helper.e("[for=control-link-item-name-size]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-link-item-name-size").disabled = false;
|
|
|
|
helper.e(".control-link-item-name-size-default").disabled = false;
|
|
|
|
};
|
|
|
|
if (state.get().link.item.display.show || state.get().link.item.name.show || state.get().link.item.url.show) {
|
|
|
|
helper.e(".control-link-item-display-alignment-horizontal-label").removeAttribute("disabled");
|
|
|
|
helper.e(".control-link-item-display-alignment-horizontal-left").disabled = false;
|
|
|
|
helper.e(".control-link-item-display-alignment-horizontal-center").disabled = false;
|
|
|
|
helper.e(".control-link-item-display-alignment-horizontal-right").disabled = false;
|
|
|
|
helper.e(".control-link-item-display-alignment-vertical-label").removeAttribute("disabled");
|
|
|
|
helper.e(".control-link-item-display-alignment-vertical-top").disabled = false;
|
|
|
|
helper.e(".control-link-item-display-alignment-vertical-center").disabled = false;
|
|
|
|
helper.e(".control-link-item-display-alignment-vertical-bottom").disabled = false;
|
|
|
|
};
|
|
|
|
if (state.get().link.item.url.show) {
|
|
|
|
helper.e(".control-link-item-url-style-dark").disabled = false;
|
|
|
|
helper.e(".control-link-item-url-style-light").disabled = false;
|
|
|
|
};
|
2019-05-23 20:15:14 +02:00
|
|
|
};
|
2019-01-24 21:28:11 +01:00
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
var _theme = function() {
|
|
|
|
if (state.get().theme.accent.random.active) {
|
|
|
|
helper.e(".control-theme-accent-random-style-any").disabled = false;
|
|
|
|
helper.e(".control-theme-accent-random-style-light").disabled = false;
|
|
|
|
helper.e(".control-theme-accent-random-style-dark").disabled = false;
|
|
|
|
helper.e(".control-theme-accent-random-style-pastel").disabled = false;
|
|
|
|
helper.e(".control-theme-accent-random-style-saturated").disabled = false;
|
|
|
|
helper.e(".control-theme-accent-randomise").disabled = false;
|
|
|
|
} else {
|
|
|
|
helper.e(".control-theme-accent-random-style-any").disabled = true;
|
|
|
|
helper.e(".control-theme-accent-random-style-light").disabled = true;
|
|
|
|
helper.e(".control-theme-accent-random-style-dark").disabled = true;
|
|
|
|
helper.e(".control-theme-accent-random-style-pastel").disabled = true;
|
|
|
|
helper.e(".control-theme-accent-random-style-saturated").disabled = true;
|
|
|
|
helper.e(".control-theme-accent-randomise").disabled = true;
|
|
|
|
};
|
|
|
|
};
|
2019-01-24 21:28:11 +01:00
|
|
|
var _background = function() {
|
2019-02-03 14:51:54 +01:00
|
|
|
if (state.get().background.image.show) {
|
2019-01-24 21:28:11 +01:00
|
|
|
helper.e("[for=control-background-image-url]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-background-image-url").disabled = false;
|
|
|
|
helper.e("[for=control-background-image-opacity]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-background-image-opacity").disabled = false;
|
|
|
|
helper.e("[for=control-background-image-blur]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-background-image-blur").disabled = false;
|
|
|
|
helper.e("[for=control-background-image-grayscale]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-background-image-grayscale").disabled = false;
|
2019-02-03 14:51:54 +01:00
|
|
|
helper.e("[for=control-background-image-accent]").removeAttribute("disabled");
|
|
|
|
helper.e(".control-background-image-accent").disabled = false;
|
2019-01-24 21:28:11 +01:00
|
|
|
} else {
|
|
|
|
helper.e("[for=control-background-image-url]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-background-image-url").disabled = true;
|
|
|
|
helper.e("[for=control-background-image-opacity]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-background-image-opacity").disabled = true;
|
|
|
|
helper.e("[for=control-background-image-blur]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-background-image-blur").disabled = true;
|
|
|
|
helper.e("[for=control-background-image-grayscale]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-background-image-grayscale").disabled = true;
|
2019-02-03 14:51:54 +01:00
|
|
|
helper.e("[for=control-background-image-accent]").setAttribute("disabled", "");
|
|
|
|
helper.e(".control-background-image-accent").disabled = true;
|
2019-01-24 21:28:11 +01:00
|
|
|
};
|
|
|
|
};
|
2019-06-05 00:26:09 +02:00
|
|
|
_header();
|
2019-01-13 23:54:48 +01:00
|
|
|
_edit();
|
2019-01-24 21:28:11 +01:00
|
|
|
_link();
|
2019-06-05 00:26:09 +02:00
|
|
|
_theme();
|
2019-01-24 21:28:11 +01:00
|
|
|
_background();
|
2019-01-03 23:30:27 +01:00
|
|
|
};
|
|
|
|
|
2019-02-03 14:51:54 +01:00
|
|
|
var update = function() {
|
|
|
|
var valueMod = {
|
|
|
|
reverse: function(value, element) {
|
|
|
|
return parseInt(element.max, 10) - value;
|
|
|
|
},
|
|
|
|
float: function(value, element) {
|
|
|
|
return value * 100;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
var setValue = {
|
|
|
|
checkbox: function(object) {
|
|
|
|
object.element.checked = helper.getObject({
|
|
|
|
object: state.get(),
|
|
|
|
path: object.path
|
2019-01-24 21:28:11 +01:00
|
|
|
});
|
2019-02-03 14:51:54 +01:00
|
|
|
},
|
|
|
|
radio: function(object) {
|
|
|
|
helper.e("." + object.element.className.substring(0, object.element.className.lastIndexOf("-") + 1) + helper.getObject({
|
|
|
|
object: state.get(),
|
|
|
|
path: object.path
|
|
|
|
})).checked = true;
|
|
|
|
},
|
|
|
|
text: function(object) {
|
|
|
|
object.element.value = helper.getObject({
|
|
|
|
object: state.get(),
|
|
|
|
path: object.path
|
2019-04-26 14:48:37 +02:00
|
|
|
});
|
|
|
|
},
|
|
|
|
number: function(object) {
|
|
|
|
object.element.value = helper.getObject({
|
|
|
|
object: state.get(),
|
|
|
|
path: object.path
|
2019-01-03 23:30:27 +01:00
|
|
|
});
|
2019-02-03 14:51:54 +01:00
|
|
|
},
|
|
|
|
range: function(object) {
|
|
|
|
var newValue = helper.getObject({
|
|
|
|
object: state.get(),
|
|
|
|
path: object.path
|
2019-01-03 23:30:27 +01:00
|
|
|
});
|
2019-02-03 14:51:54 +01:00
|
|
|
if (object.valueMod) {
|
|
|
|
object.valueMod.slice().reverse().forEach(function(arrayItem, index) {
|
|
|
|
newValue = valueMod[arrayItem](newValue, object.element);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
object.element.value = newValue;
|
|
|
|
},
|
|
|
|
color: function(object) {
|
|
|
|
object.element.value = helper.rgbToHex(helper.getObject({
|
|
|
|
object: state.get(),
|
|
|
|
path: object.path
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
_allControl.forEach(function(arrayItem, index) {
|
|
|
|
if (arrayItem.element.tagName.toLowerCase() == "input") {
|
|
|
|
setValue[arrayItem.type](arrayItem);
|
|
|
|
};
|
2019-01-03 23:30:27 +01:00
|
|
|
});
|
2018-12-27 00:46:53 +01:00
|
|
|
};
|
|
|
|
|
2018-12-26 08:45:53 +01:00
|
|
|
var init = function() {
|
2019-06-05 00:26:09 +02:00
|
|
|
bind();
|
2019-01-03 23:30:27 +01:00
|
|
|
update();
|
2019-01-13 23:54:48 +01:00
|
|
|
dependents();
|
2018-12-27 00:46:53 +01:00
|
|
|
render();
|
2018-12-26 08:45:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
// exposed methods
|
|
|
|
return {
|
|
|
|
init: init,
|
2019-06-05 00:26:09 +02:00
|
|
|
bind: bind,
|
2019-01-13 23:54:48 +01:00
|
|
|
render: render,
|
|
|
|
dependents: dependents,
|
|
|
|
update: update
|
2018-12-26 08:45:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
})();
|