reworked header customization menu
This commit is contained in:
+28
-27
@@ -634,7 +634,7 @@
|
|||||||
"beforeend",
|
"beforeend",
|
||||||
`
|
`
|
||||||
<div class="movable container" id=${this.id}>
|
<div class="movable container" id=${this.id}>
|
||||||
<div style="margin: auto">
|
<div>
|
||||||
<div id=${this.id + "-header"}>
|
<div id=${this.id + "-header"}>
|
||||||
<span id=${this.id + "-date"}></span>
|
<span id=${this.id + "-date"}></span>
|
||||||
<br />
|
<br />
|
||||||
@@ -747,24 +747,28 @@
|
|||||||
<p class="expandableMenuToggle" onclick="toggleExpandableMenu(this)">+ ${this.id}: customize layer</p>
|
<p class="expandableMenuToggle" onclick="toggleExpandableMenu(this)">+ ${this.id}: customize layer</p>
|
||||||
<div class="expandableMenu">
|
<div class="expandableMenu">
|
||||||
|
|
||||||
<p class="expandableMenuToggle" onclick="toggleExpandableMenu(this)">+ ${this.id}: date / clock settings</p>
|
<p class="expandableMenuToggle" onclick="toggleExpandableMenu(this)">+ ${this.id}: header settings</p>
|
||||||
<div class="expandableMenu">
|
<div class="expandableMenu">
|
||||||
<label>show date?</label>
|
<label>show date?</label>
|
||||||
<input id=${this.id + "-settings-date-toggle"} type="checkbox" />
|
<input id=${this.id + "-settings-date-toggle"} type="checkbox" />
|
||||||
|
<br />
|
||||||
|
|
||||||
<label>show clock?</label>
|
<label>show clock?</label>
|
||||||
<input id=${this.id + "-settings-clock-toggle"} type="checkbox" />
|
<input id=${this.id + "-settings-clock-toggle"} type="checkbox" />
|
||||||
|
<br /><br />
|
||||||
|
|
||||||
<label>set date + time color: </label>
|
<label>set header text color: </label>
|
||||||
<input id=${this.id + "-settings-clock-color"} type="color" />
|
<input id=${this.id + "-settings-clock-color"} type="color" />
|
||||||
|
<br /><br />
|
||||||
|
|
||||||
<label>set date + time font size (px): </label>
|
<label>set header font size (px): </label>
|
||||||
<input id=${this.id + "-settings-clock-size"} />
|
<input id=${this.id + "-settings-clock-size"} />
|
||||||
|
<br />
|
||||||
|
|
||||||
<label for=${this.id + "-settings-clock-bold"}>bold?</label>
|
<label for=${this.id + "-settings-clock-bold"}>bold header?</label>
|
||||||
<input id=${this.id + "-settings-clock-bold"} type="checkbox" />
|
<input id=${this.id + "-settings-clock-bold"} type="checkbox" />
|
||||||
|
|
||||||
<label for=${this.id + "-settings-clock-italic"}>italic?</label>
|
<label for=${this.id + "-settings-clock-italic"}>italic header?</label>
|
||||||
<input id=${this.id + "-settings-clock-italic"} type="checkbox" />
|
<input id=${this.id + "-settings-clock-italic"} type="checkbox" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -933,13 +937,22 @@
|
|||||||
document.getElementById(this.id + "-settings-center-align").checked =
|
document.getElementById(this.id + "-settings-center-align").checked =
|
||||||
containerSettings.centerAlign;
|
containerSettings.centerAlign;
|
||||||
|
|
||||||
/** SECTION CUSTOMIZATION */
|
/** BOOKMARK CUSTOMIZATION */
|
||||||
// (weight, italic, colors, etc. are all set upon render in loadBookmarks())
|
// apply link customization
|
||||||
|
let linkElements = document.getElementsByClassName(this.id + "-link");
|
||||||
|
for (let i = 0; i < linkElements.length; i++) {
|
||||||
|
linkElements[i].style.color = containerSettings.linkColor;
|
||||||
|
linkElements[i].style.fontSize = containerSettings.linkSize + "px";
|
||||||
|
}
|
||||||
|
// apply section customization
|
||||||
|
let sectionElements = document.getElementsByClassName(this.id + "-section");
|
||||||
|
for (let i = 0; i < sectionElements.length; i++) {
|
||||||
|
sectionElements[i].style.color = containerSettings.sectionColor;
|
||||||
|
sectionElements[i].style.fontSize = containerSettings.sectionSize + "px";
|
||||||
|
sectionElements[i].style.fontWeight = containerSettings.sectionBold ? "bold" : "normal";
|
||||||
|
sectionElements[i].style.fontStyle = containerSettings.sectionItalic ? "italic" : "normal";
|
||||||
|
}
|
||||||
// fill-in settings ui
|
// fill-in settings ui
|
||||||
|
|
||||||
// (FONT NEEDS WORK)
|
|
||||||
// document.getElementById(this.id + "-settings-section-font-name").value =
|
|
||||||
// containerSettings.fontName;
|
|
||||||
document.getElementById(this.id + "-settings-section-color").value =
|
document.getElementById(this.id + "-settings-section-color").value =
|
||||||
containerSettings.sectionColor;
|
containerSettings.sectionColor;
|
||||||
document.getElementById(this.id + "-settings-section-size").value =
|
document.getElementById(this.id + "-settings-section-size").value =
|
||||||
@@ -973,12 +986,12 @@
|
|||||||
.split(",")[3] * 100;
|
.split(",")[3] * 100;
|
||||||
|
|
||||||
/** HEADER */
|
/** HEADER */
|
||||||
// TODO EITHER SHOW THE CLOCK OR DONT
|
// show header elements
|
||||||
document.getElementById(this.id + "-date").style.display =
|
document.getElementById(this.id + "-date").style.display =
|
||||||
containerSettings.enableDate ? "inline" : "none";
|
containerSettings.enableDate ? "inline" : "none";
|
||||||
document.getElementById(this.id + "-clock").style.display =
|
document.getElementById(this.id + "-clock").style.display =
|
||||||
containerSettings.enableClock ? "inline" : "none";
|
containerSettings.enableClock ? "inline" : "none";
|
||||||
|
// apply header customizations
|
||||||
document.getElementById(this.id + "-header").style.color =
|
document.getElementById(this.id + "-header").style.color =
|
||||||
containerSettings.headerColor;
|
containerSettings.headerColor;
|
||||||
document.getElementById(this.id + "-header").style.fontSize =
|
document.getElementById(this.id + "-header").style.fontSize =
|
||||||
@@ -987,13 +1000,11 @@
|
|||||||
containerSettings.headerBold ? "bold" : "normal";
|
containerSettings.headerBold ? "bold" : "normal";
|
||||||
document.getElementById(this.id + "-header").style.fontStyle =
|
document.getElementById(this.id + "-header").style.fontStyle =
|
||||||
containerSettings.headerItalic ? "italic" : "normal";
|
containerSettings.headerItalic ? "italic" : "normal";
|
||||||
|
|
||||||
// fill-in settings ui
|
// fill-in settings ui
|
||||||
document.getElementById(this.id + "-settings-date-toggle").checked =
|
document.getElementById(this.id + "-settings-date-toggle").checked =
|
||||||
containerSettings.enableDate;
|
containerSettings.enableDate;
|
||||||
document.getElementById(this.id + "-settings-clock-toggle").checked =
|
document.getElementById(this.id + "-settings-clock-toggle").checked =
|
||||||
containerSettings.enableClock;
|
containerSettings.enableClock;
|
||||||
|
|
||||||
document.getElementById(this.id + "-settings-clock-color").value =
|
document.getElementById(this.id + "-settings-clock-color").value =
|
||||||
containerSettings.headerColor;
|
containerSettings.headerColor;
|
||||||
document.getElementById(this.id + "-settings-clock-size").value =
|
document.getElementById(this.id + "-settings-clock-size").value =
|
||||||
@@ -1161,8 +1172,6 @@
|
|||||||
let sectionData = Object.values(this.sections);
|
let sectionData = Object.values(this.sections);
|
||||||
|
|
||||||
// render the sections
|
// render the sections
|
||||||
let weight = containerSettings.sectionBold ? "bold" : "normal";
|
|
||||||
let italic = containerSettings.sectionItalic ? "italic" : "normal";
|
|
||||||
for (let i = 0; i < sectionData.length; i++) {
|
for (let i = 0; i < sectionData.length; i++) {
|
||||||
linkContainer.insertAdjacentHTML(
|
linkContainer.insertAdjacentHTML(
|
||||||
"beforeend",
|
"beforeend",
|
||||||
@@ -1175,13 +1184,7 @@
|
|||||||
>
|
>
|
||||||
[X]
|
[X]
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span class=${this.id + "-section"}>
|
||||||
class=${this.id + "-section"}
|
|
||||||
style="color: ${containerSettings.sectionColor};
|
|
||||||
font-size: ${containerSettings.sectionSize + "px"};
|
|
||||||
font-weight: ${weight};
|
|
||||||
font-style: ${italic}"
|
|
||||||
>
|
|
||||||
${sectionData[i].label}
|
${sectionData[i].label}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
@@ -1223,8 +1226,6 @@
|
|||||||
<a
|
<a
|
||||||
class="${this.id}-link"
|
class="${this.id}-link"
|
||||||
href="${sectionData[s].links[l].url}"
|
href="${sectionData[s].links[l].url}"
|
||||||
style="color: ${containerSettings.linkColor};
|
|
||||||
font-size: ${containerSettings.linkSize + "px"};"
|
|
||||||
>
|
>
|
||||||
${sectionData[s].links[l].label}
|
${sectionData[s].links[l].label}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user