-
+
+
+
-
-
+
diff --git a/src/main/js/main.js b/src/main/js/main.js
index 6d178be..cf07a39 100644
--- a/src/main/js/main.js
+++ b/src/main/js/main.js
@@ -1,5 +1,5 @@
// noinspection JSUnresolvedVariable
-const {$, doAfterLoad, footer, header, nav} = window.fwdekker;
+const {$, doAfterLoad} = window.fwdekker;
import bigInt from "big-integer"
@@ -12,7 +12,7 @@ import bigInt from "big-integer"
* @returns {string} the input string with one character replaced
*/
const stringReplaceAt = (str, index, replacement) =>
- str.substr(0, index) + replacement + str.substr(index + replacement.length);
+ str.substring(0, index) + replacement + str.substring(index + replacement.length);
/**
* Replaces all instances of the target with the replacement.
@@ -149,15 +149,12 @@ class Base64NumeralSystemInput extends NumeralSystemInput {
super(name, new Base64NumeralSystem(Base64NumeralSystem.defaultAlphabet()));
this.dropdown = document.createElement("select");
- this.dropdown.id = `${this.name}Dropdown`;
+ this.dropdown.id = `${this.name}-dropdown`;
this.dropdown.onchange = () => {
const selectedOption = Base64NumeralSystemInput.dropdownOptions()[this.dropdown.value];
this.setLastDigits(selectedOption[0], selectedOption[1]);
};
- this.dropdownDiv = document.createElement("div");
- this.dropdownDiv.classList.add("float-right");
-
this.options =
Object.keys(Base64NumeralSystemInput.dropdownOptions()).map(key => {
const option = document.createElement("option");
@@ -180,10 +177,9 @@ class Base64NumeralSystemInput extends NumeralSystemInput {
addToParent(parent) {
this.options.forEach(option => this.dropdown.appendChild(option));
- this.dropdownDiv.appendChild(this.dropdown);
- parent.appendChild(this.dropdownDiv);
parent.appendChild(this.label);
+ parent.appendChild(this.dropdown);
parent.appendChild(this.textarea);
}
}
@@ -213,19 +209,6 @@ const updateAllInputs = (source, newValue) => {
};
-doAfterLoad(() => {
- $("#nav").appendChild(nav("/Tools/Converter/"));
- $("#header").appendChild(header({
- title: "Converter",
- description: "Convert numbers to and from various bases"
- }));
- $("#footer").appendChild(footer({
- vcsURL: "https://git.fwdekker.com/tools/converter/",
- version: "v%%VERSION_NUMBER%%"
- }));
- $("main").classList.remove("hidden");
-});
-
doAfterLoad(() => {
const inputParent = $("#inputs");
@@ -234,4 +217,6 @@ doAfterLoad(() => {
updateAllInputs(undefined, bigInt(42));
inputs[0].textarea.focus();
+
+ $("main").classList.remove("hidden");
});