parent
69fef87cd9
commit
92b1d30409
14
index.html
14
index.html
|
@ -128,12 +128,18 @@
|
|||
}
|
||||
|
||||
class Base64NumeralSystemInput extends NumeralSystemInput {
|
||||
static defaultAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
static dropdownOptions = {"Standard": ['+', '/'], "Filename": ['-', '_'], "IMAP": ['+', ',']};
|
||||
// TODO Convert static methods to static properties once supported by Firefox
|
||||
static defaultAlphabet() {
|
||||
return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
}
|
||||
|
||||
static dropdownOptions() {
|
||||
return {"Standard": ['+', '/'], "Filename": ['-', '_'], "IMAP": ['+', ',']};
|
||||
}
|
||||
|
||||
|
||||
constructor(name) {
|
||||
super(name, new NumeralSystem(64, Base64NumeralSystemInput.defaultAlphabet, true));
|
||||
super(name, new NumeralSystem(64, Base64NumeralSystemInput.defaultAlphabet(), true));
|
||||
|
||||
this.dropdownLabel = document.createElement("label");
|
||||
this.dropdownLabel.setAttribute("for", `${this.name}Dropdown`);
|
||||
|
@ -143,7 +149,7 @@
|
|||
this.dropdown = document.createElement("select");
|
||||
this.dropdown.id = `${this.name}Dropdown`;
|
||||
this.dropdown.onchange = () => {
|
||||
const selectedOption = Base64NumeralSystemInput.dropdownOptions[this.dropdown.value];
|
||||
const selectedOption = Base64NumeralSystemInput.dropdownOptions()[this.dropdown.value];
|
||||
this.setLastDigits(selectedOption[0], selectedOption[1]);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue