access: Minor JS improvements
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
window.ELWIG_API = window.ELWIG_API || null;
|
||||
|
||||
function getCredentialsUsername() {
|
||||
return window.localStorage.getItem(`${CLIENT}/username`);
|
||||
}
|
||||
@ -11,7 +13,7 @@ function getCredentialsPassword() {
|
||||
function getBasicAuth() {
|
||||
return {
|
||||
'Authorization': 'Basic ' + btoa(getCredentialsUsername() + ':' + getCredentialsPassword()),
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
async function _get(path) {
|
||||
@ -311,10 +313,6 @@ window.addEventListener('hashchange', () => {
|
||||
render();
|
||||
});
|
||||
|
||||
window.addEventListener('pageshow', update)
|
||||
|
||||
document.addEventListener('visibilitychange', update);
|
||||
|
||||
function actionLogin(form) {
|
||||
window.localStorage.setItem(`${CLIENT}/username`, form.username.value);
|
||||
window.localStorage.setItem(`${CLIENT}/password`, form.password.value);
|
||||
|
Reference in New Issue
Block a user