clean: respect es11
This commit is contained in:
@ -7,7 +7,7 @@ import LogoutView from "./views/accounts/LogoutView.js";
|
||||
import GameOfflineView from "./views/GameOfflineView.js";
|
||||
import GameView from "./views/GameView.js";
|
||||
|
||||
import PageNotFoundView from './views/PageNotFoundView.js'
|
||||
import PageNotFoundView from './views/PageNotFoundView.js' ;
|
||||
|
||||
import AbstractRedirectView from "./views/abstracts/AbstractRedirectView.js";
|
||||
import SettingsView from "./views/SettingsView.js";
|
||||
@ -21,8 +21,8 @@ import AuthenticationView from "./views/accounts/AuthenticationView.js";
|
||||
let client = new Client(location.origin);
|
||||
let lang = client.lang;
|
||||
|
||||
let lastView = undefined;
|
||||
let lastPageUrlBeforeLogin = undefined;
|
||||
let lastView;
|
||||
let lastPageUrlBeforeLogin;
|
||||
|
||||
const pathToRegex = path => new RegExp("^" + path.replace(/\//g, "\\/").replace(/:\w+/g, "(.+)") + "$");
|
||||
|
||||
@ -52,7 +52,7 @@ const navigateTo = async (uri) => {
|
||||
const reloadView = async _ => {
|
||||
await lastView?.leavePage();
|
||||
await renderView(lastView);
|
||||
}
|
||||
};
|
||||
|
||||
async function renderView(view)
|
||||
{
|
||||
@ -61,7 +61,7 @@ async function renderView(view)
|
||||
return 1;
|
||||
|
||||
view.setTitle();
|
||||
document.querySelector("#app").innerHTML = content
|
||||
document.querySelector("#app").innerHTML = content;
|
||||
|
||||
let error_code = await view.postInit();
|
||||
|
||||
@ -129,7 +129,7 @@ const router = async(uri) => {
|
||||
return 0;
|
||||
};
|
||||
|
||||
window.addEventListener("popstate", function() {router(location.pathname)});
|
||||
window.addEventListener("popstate", function() {router(location.pathname);});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", async () => {
|
||||
document.body.addEventListener("click", e => {
|
||||
@ -162,4 +162,4 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
document.querySelector('a[href=\'' + location.pathname + '\']')?.classList.add('active');
|
||||
});
|
||||
|
||||
export { client, lang, navigateTo, reloadView }
|
||||
export { client, lang, navigateTo, reloadView };
|
||||
|
Reference in New Issue
Block a user