diff options
author | 2018-06-13 16:43:42 +0100 | |
---|---|---|
committer | 2018-06-13 16:43:42 +0100 | |
commit | be2bbe35cf49763ad0258c005f3cbdddd7a21d75 (patch) | |
tree | 962d5e52f4bb57c397c068ae6a11b57952cfc459 /js/src/errors.js | |
parent | [DB] Attempt reconnection if current connection was lost (diff) |
Compile as much JS with Gulp as possible
This will concatenate ALL of our JS, and minify it - thus leaving us with a single file to be loaded.
There's a few libraries we can't do this with, unfortunately - these are now added in fouc.js:
* Ace Editor
* Flatpickr
* Font-Awesome
Diffstat (limited to 'js/src/errors.js')
-rw-r--r-- | js/src/errors.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/js/src/errors.js b/js/src/errors.js new file mode 100644 index 00000000..492285d4 --- /dev/null +++ b/js/src/errors.js @@ -0,0 +1,49 @@ +"use strict"; + +/* exported error_typewriter */ + +function error_typewriter() { + const app = document.getElementById("error"); + + const typewriter = new Typewriter(app, { + "loop": false, + "deleteSpeed": 40, + "typingSpeed": "natural", + "devMode": false + }); + + function closeWindow() { + const app = document.getElementById("win"); + const current_class = app.getAttribute("class"); + app.setAttribute("class", `${current_class } uk-animation-scale-up uk-animation-reverse`); + typewriter.stop(); + } + + document.getElementById("terminal-close").onclick = closeWindow; + + typewriter.appendText("Python 3.6.4 (default, Jan 5 2018, 02:35:40)\n") + .appendText("[GCC 7.2.1 20171224] on darwin\n") + .appendText("Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n") + .appendText(">>> ") + .pauseFor(1000) + .typeString("impor requests") + .deleteChars(9) + .typeString("t requests\n") + .appendText(">>> ") + .pauseFor(750) + .changeSettings({"typingSpeed": "natural"}) + .typeString(`response = requests.${ window._RequestMethod }('https://pythim`) + .deleteChars(2) + .typeString("ondiscord.con/") + .deleteChars(2) + .typeString(`m${ window._Path }')\n`) + .pauseFor(1000) + .appendText(`<Response [${ window._Code }]>\n>>> `) + .typeString("# hmmmm") + .pauseFor(1000) + .deleteChars(7) + .pauseFor(1000) + .typeString("response.text\n") + .appendText(`${ window._ErrorMsg }\n>>> `) + .start(); +} |