rewrite* most web ui code in typescript
i wanted to split up the web ui components into multiple files, and figured it'd be a good chance to try out typescript. run make typescript to compile everything in ts/ and put it in data/static/. This is less of a rewrite and more of a refactoring, most of it still works the same but bits have been cleaned up too. Remaining javascript found in setup.js and form.html
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
var bsVersion = 4;
|
||||
|
||||
const send_to_addess_enabled = document.getElementById('send_to_addess_enabled');
|
||||
if (send_to_addess_enabled) {
|
||||
send_to_addess_enabled.classList.remove("form-check-input");
|
||||
}
|
||||
const multiUseEnabled = document.getElementById('multiUseEnabled');
|
||||
if (multiUseEnabled) {
|
||||
multiUseEnabled.classList.remove("form-check-input");
|
||||
}
|
||||
|
||||
function createModal(id: string, find?: boolean): any {
|
||||
$(`#${id}`).on("shown.bs.modal", (): void => document.body.classList.add("modal-open"));
|
||||
return {
|
||||
show: function (): any {
|
||||
const temp = ($(`#${id}`) as any).modal("show");
|
||||
return temp;
|
||||
},
|
||||
hide: function (): any {
|
||||
return ($(`#${id}`) as any).modal("hide");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function triggerTooltips(): void {
|
||||
$("#settingsMenu").on("shown.bs.modal", (): void => {
|
||||
const checkboxes = [].slice.call(document.getElementById('settingsMenu').querySelectorAll('input[type="checkbox"]'));
|
||||
for (const i in checkboxes) {
|
||||
checkboxes[i].click();
|
||||
checkboxes[i].click();
|
||||
}
|
||||
const tooltips = [].slice.call(document.querySelectorAll('a[data-toggle="tooltip"]'));
|
||||
tooltips.map((el: HTMLAnchorElement): any => {
|
||||
return ($(el) as any).tooltip();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user