fix error.ts gets alwaysExecuted
This commit is contained in:
parent
bb4479f825
commit
a286aa09f4
3 changed files with 17 additions and 9 deletions
|
@ -56,5 +56,8 @@ if (strpos($_SERVER['HTTP_HOST'], '.onion') !== false) {
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
<script src="/js/script.js"></script>
|
<script src="/js/script.js"></script>
|
||||||
|
<script>
|
||||||
|
startNewTask();
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -59,6 +59,9 @@ function getError500()
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
<script src="/js/script.js"></script>
|
<script src="/js/script.js"></script>
|
||||||
|
<script>
|
||||||
|
startNewTask();
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
EOF;
|
EOF;
|
||||||
|
|
14
ts/error.ts
14
ts/error.ts
|
@ -2,14 +2,14 @@ import Timeout = NodeJS.Timeout;
|
||||||
|
|
||||||
let intervalTime = 150;
|
let intervalTime = 150;
|
||||||
|
|
||||||
let terminal:HTMLElement = <HTMLElement> document.getElementsByClassName("terminal")[0];
|
|
||||||
let historyContainer:HTMLElement = <HTMLElement> terminal.getElementsByClassName("history")[0];
|
|
||||||
let promptContainer:HTMLElement = <HTMLElement> terminal.getElementsByClassName("prompt")[0];
|
|
||||||
|
|
||||||
let dataIndex = 0;
|
let dataIndex = 0;
|
||||||
let stringPosition = 0;
|
let stringPosition = 0;
|
||||||
let printTask: Timeout;
|
let printTask: Timeout;
|
||||||
|
|
||||||
|
let terminal:HTMLElement;
|
||||||
|
let historyContainer:HTMLElement;
|
||||||
|
let promptContainer:HTMLElement;
|
||||||
|
|
||||||
function writeOut() {
|
function writeOut() {
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -33,7 +33,9 @@ function writeOut() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function startNewTask() {
|
function startNewTask() {
|
||||||
|
|
||||||
|
terminal = <HTMLElement> document.getElementsByClassName("terminal")[0];
|
||||||
|
historyContainer = <HTMLElement> terminal.getElementsByClassName("history")[0];
|
||||||
|
promptContainer = <HTMLElement> terminal.getElementsByClassName("prompt")[0];
|
||||||
printTask = setInterval(writeOut, intervalTime);
|
printTask = setInterval(writeOut, intervalTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
startNewTask();
|
|
Loading…
Reference in a new issue