2020-07-13 09:29:16 +00:00
|
|
|
import "./shared";
|
|
|
|
import * as loader from "../loader/loader";
|
2020-07-20 17:08:13 +00:00
|
|
|
import {ApplicationLoader, Stage} from "../loader/loader";
|
2020-07-13 09:29:16 +00:00
|
|
|
|
2020-07-20 17:08:13 +00:00
|
|
|
export default class implements ApplicationLoader {
|
|
|
|
execute() {
|
|
|
|
loader.register_task(Stage.JAVASCRIPT_INITIALIZING, {
|
|
|
|
name: "doing nothing",
|
|
|
|
priority: 1,
|
|
|
|
function: async taskId => {
|
|
|
|
console.log("Doing nothing");
|
2020-07-13 09:29:16 +00:00
|
|
|
|
2020-07-20 17:08:13 +00:00
|
|
|
for(let index of [1, 2, 3]) {
|
|
|
|
await new Promise(resolve => {
|
|
|
|
const callback = () => {
|
|
|
|
document.removeEventListener("click", resolve);
|
|
|
|
resolve();
|
|
|
|
};
|
2020-07-13 09:29:16 +00:00
|
|
|
|
2020-07-20 17:08:13 +00:00
|
|
|
document.addEventListener("click", callback);
|
|
|
|
});
|
|
|
|
loader.setCurrentTaskName(taskId, "try again (" + index + ")");
|
|
|
|
}
|
2020-07-13 09:29:16 +00:00
|
|
|
}
|
2020-07-20 17:08:13 +00:00
|
|
|
});
|
2020-07-13 09:29:16 +00:00
|
|
|
|
2020-10-04 18:47:19 +00:00
|
|
|
loader.execute_managed(false);
|
2020-07-20 17:08:13 +00:00
|
|
|
}
|
2020-07-13 09:29:16 +00:00
|
|
|
}
|