From 5af59f85f3c667ab5e4b839731af4e6286a3e7ca Mon Sep 17 00:00:00 2001 From: marzavec Date: Sat, 17 Aug 2019 16:24:29 -0700 Subject: Client update See changelog.md --- client/audio/index.html | 1 + client/client.js | 225 +++--- client/imgs/index.html | 1 + client/index.html | 45 +- client/katex/contrib/auto-render.js | 790 --------------------- client/katex/contrib/auto-render.min.js | 1 - client/katex/contrib/copy-tex.css | 12 - client/katex/contrib/copy-tex.js | 174 ----- client/katex/contrib/copy-tex.min.css | 1 - client/katex/contrib/copy-tex.min.js | 1 - client/katex/contrib/index.html | 0 client/katex/contrib/mathtex-script-type.js | 113 --- client/katex/contrib/mathtex-script-type.min.js | 1 - client/katex/fonts/KaTeX_AMS-Regular.ttf | Bin 71428 -> 0 bytes client/katex/fonts/KaTeX_AMS-Regular.woff | Bin 40200 -> 0 bytes client/katex/fonts/KaTeX_AMS-Regular.woff2 | Bin 33208 -> 0 bytes client/katex/fonts/KaTeX_Caligraphic-Bold.ttf | Bin 19588 -> 0 bytes client/katex/fonts/KaTeX_Caligraphic-Bold.woff | Bin 12136 -> 0 bytes client/katex/fonts/KaTeX_Caligraphic-Bold.woff2 | Bin 10608 -> 0 bytes client/katex/fonts/KaTeX_Caligraphic-Regular.ttf | Bin 18960 -> 0 bytes client/katex/fonts/KaTeX_Caligraphic-Regular.woff | Bin 11868 -> 0 bytes client/katex/fonts/KaTeX_Caligraphic-Regular.woff2 | Bin 10412 -> 0 bytes client/katex/fonts/KaTeX_Fraktur-Bold.ttf | Bin 35968 -> 0 bytes client/katex/fonts/KaTeX_Fraktur-Bold.woff | Bin 23388 -> 0 bytes client/katex/fonts/KaTeX_Fraktur-Bold.woff2 | Bin 20488 -> 0 bytes client/katex/fonts/KaTeX_Fraktur-Regular.ttf | Bin 34652 -> 0 bytes client/katex/fonts/KaTeX_Fraktur-Regular.woff | Bin 22844 -> 0 bytes client/katex/fonts/KaTeX_Fraktur-Regular.woff2 | Bin 19868 -> 0 bytes client/katex/fonts/KaTeX_Main-Bold.ttf | Bin 61772 -> 0 bytes client/katex/fonts/KaTeX_Main-Bold.woff | Bin 36928 -> 0 bytes client/katex/fonts/KaTeX_Main-Bold.woff2 | Bin 30824 -> 0 bytes client/katex/fonts/KaTeX_Main-BoldItalic.ttf | Bin 44824 -> 0 bytes client/katex/fonts/KaTeX_Main-BoldItalic.woff | Bin 26228 -> 0 bytes client/katex/fonts/KaTeX_Main-BoldItalic.woff2 | Bin 22176 -> 0 bytes client/katex/fonts/KaTeX_Main-Italic.ttf | Bin 47952 -> 0 bytes client/katex/fonts/KaTeX_Main-Italic.woff | Bin 27200 -> 0 bytes client/katex/fonts/KaTeX_Main-Italic.woff2 | Bin 23064 -> 0 bytes client/katex/fonts/KaTeX_Main-Regular.ttf | Bin 70512 -> 0 bytes client/katex/fonts/KaTeX_Main-Regular.woff | Bin 39728 -> 0 bytes client/katex/fonts/KaTeX_Main-Regular.woff2 | Bin 33096 -> 0 bytes client/katex/fonts/KaTeX_Math-Italic.ttf | Bin 41448 -> 0 bytes client/katex/fonts/KaTeX_Math-Italic.woff | Bin 23820 -> 0 bytes client/katex/fonts/KaTeX_Math-Italic.woff2 | Bin 20416 -> 0 bytes client/katex/fonts/KaTeX_SansSerif-Bold.ttf | Bin 34032 -> 0 bytes client/katex/fonts/KaTeX_SansSerif-Bold.woff | Bin 19172 -> 0 bytes client/katex/fonts/KaTeX_SansSerif-Bold.woff2 | Bin 16000 -> 0 bytes client/katex/fonts/KaTeX_SansSerif-Italic.ttf | Bin 31308 -> 0 bytes client/katex/fonts/KaTeX_SansSerif-Italic.woff | Bin 18128 -> 0 bytes client/katex/fonts/KaTeX_SansSerif-Italic.woff2 | Bin 15204 -> 0 bytes client/katex/fonts/KaTeX_SansSerif-Regular.ttf | Bin 30156 -> 0 bytes client/katex/fonts/KaTeX_SansSerif-Regular.woff | Bin 16784 -> 0 bytes client/katex/fonts/KaTeX_SansSerif-Regular.woff2 | Bin 14004 -> 0 bytes client/katex/fonts/KaTeX_Script-Regular.ttf | Bin 24864 -> 0 bytes client/katex/fonts/KaTeX_Script-Regular.woff | Bin 13856 -> 0 bytes client/katex/fonts/KaTeX_Script-Regular.woff2 | Bin 12268 -> 0 bytes client/katex/fonts/KaTeX_Size1-Regular.ttf | Bin 13172 -> 0 bytes client/katex/fonts/KaTeX_Size1-Regular.woff | Bin 6980 -> 0 bytes client/katex/fonts/KaTeX_Size1-Regular.woff2 | Bin 5812 -> 0 bytes client/katex/fonts/KaTeX_Size2-Regular.ttf | Bin 12412 -> 0 bytes client/katex/fonts/KaTeX_Size2-Regular.woff | Bin 6684 -> 0 bytes client/katex/fonts/KaTeX_Size2-Regular.woff2 | Bin 5560 -> 0 bytes client/katex/fonts/KaTeX_Size3-Regular.ttf | Bin 8360 -> 0 bytes client/katex/fonts/KaTeX_Size3-Regular.woff | Bin 4776 -> 0 bytes client/katex/fonts/KaTeX_Size3-Regular.woff2 | Bin 3860 -> 0 bytes client/katex/fonts/KaTeX_Size4-Regular.ttf | Bin 11284 -> 0 bytes client/katex/fonts/KaTeX_Size4-Regular.woff | Bin 6456 -> 0 bytes client/katex/fonts/KaTeX_Size4-Regular.woff2 | Bin 5132 -> 0 bytes client/katex/fonts/KaTeX_Typewriter-Regular.ttf | Bin 36308 -> 0 bytes client/katex/fonts/KaTeX_Typewriter-Regular.woff | Bin 20924 -> 0 bytes client/katex/fonts/KaTeX_Typewriter-Regular.woff2 | Bin 17536 -> 0 bytes client/katex/fonts/index.html | 0 client/katex/index.html | 0 client/katex/katex.min.css | 1 - client/katex/katex.min.js | 1 - client/manifest.json | 60 +- client/schemes/index.html | 1 + client/style.css | 105 ++- client/vendor/hljs/highlight.min.js | 3 + client/vendor/hljs/index.html | 1 + client/vendor/hljs/styles/agate.min.css | 17 + client/vendor/hljs/styles/androidstudio.min.css | 1 + client/vendor/hljs/styles/atom-one-dark.min.css | 1 + client/vendor/hljs/styles/darcula.min.css | 1 + client/vendor/hljs/styles/github.min.css | 1 + client/vendor/hljs/styles/hybrid.min.css | 1 + client/vendor/hljs/styles/index.html | 1 + client/vendor/hljs/styles/rainbow.min.css | 1 + client/vendor/hljs/styles/tomorrow.min.css | 1 + client/vendor/hljs/styles/xcode.min.css | 1 + client/vendor/hljs/styles/zenburn.min.css | 1 + client/vendor/index.html | 1 + client/vendor/katex/fonts/KaTeX_AMS-Regular.ttf | Bin 0 -> 70972 bytes client/vendor/katex/fonts/KaTeX_AMS-Regular.woff | Bin 0 -> 38868 bytes client/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 | Bin 0 -> 32944 bytes .../vendor/katex/fonts/KaTeX_Caligraphic-Bold.ttf | Bin 0 -> 19316 bytes .../vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff | Bin 0 -> 11696 bytes .../katex/fonts/KaTeX_Caligraphic-Bold.woff2 | Bin 0 -> 10448 bytes .../katex/fonts/KaTeX_Caligraphic-Regular.ttf | Bin 0 -> 18684 bytes .../katex/fonts/KaTeX_Caligraphic-Regular.woff | Bin 0 -> 11460 bytes .../katex/fonts/KaTeX_Caligraphic-Regular.woff2 | Bin 0 -> 10240 bytes client/vendor/katex/fonts/KaTeX_Fraktur-Bold.ttf | Bin 0 -> 35660 bytes client/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff | Bin 0 -> 22632 bytes client/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 | Bin 0 -> 20360 bytes .../vendor/katex/fonts/KaTeX_Fraktur-Regular.ttf | Bin 0 -> 34352 bytes .../vendor/katex/fonts/KaTeX_Fraktur-Regular.woff | Bin 0 -> 22088 bytes .../vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 | Bin 0 -> 19784 bytes client/vendor/katex/fonts/KaTeX_Main-Bold.ttf | Bin 0 -> 60784 bytes client/vendor/katex/fonts/KaTeX_Main-Bold.woff | Bin 0 -> 35464 bytes client/vendor/katex/fonts/KaTeX_Main-Bold.woff2 | Bin 0 -> 30244 bytes .../vendor/katex/fonts/KaTeX_Main-BoldItalic.ttf | Bin 0 -> 44496 bytes .../vendor/katex/fonts/KaTeX_Main-BoldItalic.woff | Bin 0 -> 25352 bytes .../vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 | Bin 0 -> 21944 bytes client/vendor/katex/fonts/KaTeX_Main-Italic.ttf | Bin 0 -> 47640 bytes client/vendor/katex/fonts/KaTeX_Main-Italic.woff | Bin 0 -> 26228 bytes client/vendor/katex/fonts/KaTeX_Main-Italic.woff2 | Bin 0 -> 22748 bytes client/vendor/katex/fonts/KaTeX_Main-Regular.ttf | Bin 0 -> 69520 bytes client/vendor/katex/fonts/KaTeX_Main-Regular.woff | Bin 0 -> 38112 bytes client/vendor/katex/fonts/KaTeX_Main-Regular.woff2 | Bin 0 -> 32464 bytes .../vendor/katex/fonts/KaTeX_Math-BoldItalic.ttf | Bin 0 -> 39308 bytes .../vendor/katex/fonts/KaTeX_Math-BoldItalic.woff | Bin 0 -> 22324 bytes .../vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 | Bin 0 -> 19720 bytes client/vendor/katex/fonts/KaTeX_Math-Italic.ttf | Bin 0 -> 40992 bytes client/vendor/katex/fonts/KaTeX_Math-Italic.woff | Bin 0 -> 22844 bytes client/vendor/katex/fonts/KaTeX_Math-Italic.woff2 | Bin 0 -> 20096 bytes client/vendor/katex/fonts/KaTeX_SansSerif-Bold.ttf | Bin 0 -> 33688 bytes .../vendor/katex/fonts/KaTeX_SansSerif-Bold.woff | Bin 0 -> 18516 bytes .../vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 | Bin 0 -> 15732 bytes .../vendor/katex/fonts/KaTeX_SansSerif-Italic.ttf | Bin 0 -> 30960 bytes .../vendor/katex/fonts/KaTeX_SansSerif-Italic.woff | Bin 0 -> 17572 bytes .../katex/fonts/KaTeX_SansSerif-Italic.woff2 | Bin 0 -> 15024 bytes .../vendor/katex/fonts/KaTeX_SansSerif-Regular.ttf | Bin 0 -> 29812 bytes .../katex/fonts/KaTeX_SansSerif-Regular.woff | Bin 0 -> 16228 bytes .../katex/fonts/KaTeX_SansSerif-Regular.woff2 | Bin 0 -> 13708 bytes client/vendor/katex/fonts/KaTeX_Script-Regular.ttf | Bin 0 -> 24620 bytes .../vendor/katex/fonts/KaTeX_Script-Regular.woff | Bin 0 -> 13428 bytes .../vendor/katex/fonts/KaTeX_Script-Regular.woff2 | Bin 0 -> 12064 bytes client/vendor/katex/fonts/KaTeX_Size1-Regular.ttf | Bin 0 -> 12916 bytes client/vendor/katex/fonts/KaTeX_Size1-Regular.woff | Bin 0 -> 6696 bytes .../vendor/katex/fonts/KaTeX_Size1-Regular.woff2 | Bin 0 -> 5592 bytes client/vendor/katex/fonts/KaTeX_Size2-Regular.ttf | Bin 0 -> 12172 bytes client/vendor/katex/fonts/KaTeX_Size2-Regular.woff | Bin 0 -> 6436 bytes .../vendor/katex/fonts/KaTeX_Size2-Regular.woff2 | Bin 0 -> 5392 bytes client/vendor/katex/fonts/KaTeX_Size3-Regular.ttf | Bin 0 -> 8120 bytes client/vendor/katex/fonts/KaTeX_Size3-Regular.woff | Bin 0 -> 4568 bytes .../vendor/katex/fonts/KaTeX_Size3-Regular.woff2 | Bin 0 -> 3728 bytes client/vendor/katex/fonts/KaTeX_Size4-Regular.ttf | Bin 0 -> 11016 bytes client/vendor/katex/fonts/KaTeX_Size4-Regular.woff | Bin 0 -> 6184 bytes .../vendor/katex/fonts/KaTeX_Size4-Regular.woff2 | Bin 0 -> 5028 bytes .../katex/fonts/KaTeX_Typewriter-Regular.ttf | Bin 0 -> 35924 bytes .../katex/fonts/KaTeX_Typewriter-Regular.woff | Bin 0 -> 20260 bytes .../katex/fonts/KaTeX_Typewriter-Regular.woff2 | Bin 0 -> 17272 bytes client/vendor/katex/index.html | 1 + client/vendor/katex/katex.min.css | 1 + client/vendor/katex/katex.min.js | 1 + client/vendor/remarkable-katex/index.html | 1 + .../vendor/remarkable-katex/remarkableKatex.min.js | 8 + client/vendor/remarkable/index.html | 1 + client/vendor/remarkable/remarkable.min.js | 1 + 158 files changed, 352 insertions(+), 1227 deletions(-) create mode 100644 client/audio/index.html create mode 100644 client/imgs/index.html delete mode 100644 client/katex/contrib/auto-render.js delete mode 100644 client/katex/contrib/auto-render.min.js delete mode 100644 client/katex/contrib/copy-tex.css delete mode 100644 client/katex/contrib/copy-tex.js delete mode 100644 client/katex/contrib/copy-tex.min.css delete mode 100644 client/katex/contrib/copy-tex.min.js delete mode 100644 client/katex/contrib/index.html delete mode 100644 client/katex/contrib/mathtex-script-type.js delete mode 100644 client/katex/contrib/mathtex-script-type.min.js delete mode 100644 client/katex/fonts/KaTeX_AMS-Regular.ttf delete mode 100644 client/katex/fonts/KaTeX_AMS-Regular.woff delete mode 100644 client/katex/fonts/KaTeX_AMS-Regular.woff2 delete mode 100644 client/katex/fonts/KaTeX_Caligraphic-Bold.ttf delete mode 100644 client/katex/fonts/KaTeX_Caligraphic-Bold.woff delete mode 100644 client/katex/fonts/KaTeX_Caligraphic-Bold.woff2 delete mode 100644 client/katex/fonts/KaTeX_Caligraphic-Regular.ttf delete mode 100644 client/katex/fonts/KaTeX_Caligraphic-Regular.woff delete mode 100644 client/katex/fonts/KaTeX_Caligraphic-Regular.woff2 delete mode 100644 client/katex/fonts/KaTeX_Fraktur-Bold.ttf delete mode 100644 client/katex/fonts/KaTeX_Fraktur-Bold.woff delete mode 100644 client/katex/fonts/KaTeX_Fraktur-Bold.woff2 delete mode 100644 client/katex/fonts/KaTeX_Fraktur-Regular.ttf delete mode 100644 client/katex/fonts/KaTeX_Fraktur-Regular.woff delete mode 100644 client/katex/fonts/KaTeX_Fraktur-Regular.woff2 delete mode 100644 client/katex/fonts/KaTeX_Main-Bold.ttf delete mode 100644 client/katex/fonts/KaTeX_Main-Bold.woff delete mode 100644 client/katex/fonts/KaTeX_Main-Bold.woff2 delete mode 100644 client/katex/fonts/KaTeX_Main-BoldItalic.ttf delete mode 100644 client/katex/fonts/KaTeX_Main-BoldItalic.woff delete mode 100644 client/katex/fonts/KaTeX_Main-BoldItalic.woff2 delete mode 100644 client/katex/fonts/KaTeX_Main-Italic.ttf delete mode 100644 client/katex/fonts/KaTeX_Main-Italic.woff delete mode 100644 client/katex/fonts/KaTeX_Main-Italic.woff2 delete mode 100644 client/katex/fonts/KaTeX_Main-Regular.ttf delete mode 100644 client/katex/fonts/KaTeX_Main-Regular.woff delete mode 100644 client/katex/fonts/KaTeX_Main-Regular.woff2 delete mode 100644 client/katex/fonts/KaTeX_Math-Italic.ttf delete mode 100644 client/katex/fonts/KaTeX_Math-Italic.woff delete mode 100644 client/katex/fonts/KaTeX_Math-Italic.woff2 delete mode 100644 client/katex/fonts/KaTeX_SansSerif-Bold.ttf delete mode 100644 client/katex/fonts/KaTeX_SansSerif-Bold.woff delete mode 100644 client/katex/fonts/KaTeX_SansSerif-Bold.woff2 delete mode 100644 client/katex/fonts/KaTeX_SansSerif-Italic.ttf delete mode 100644 client/katex/fonts/KaTeX_SansSerif-Italic.woff delete mode 100644 client/katex/fonts/KaTeX_SansSerif-Italic.woff2 delete mode 100644 client/katex/fonts/KaTeX_SansSerif-Regular.ttf delete mode 100644 client/katex/fonts/KaTeX_SansSerif-Regular.woff delete mode 100644 client/katex/fonts/KaTeX_SansSerif-Regular.woff2 delete mode 100644 client/katex/fonts/KaTeX_Script-Regular.ttf delete mode 100644 client/katex/fonts/KaTeX_Script-Regular.woff delete mode 100644 client/katex/fonts/KaTeX_Script-Regular.woff2 delete mode 100644 client/katex/fonts/KaTeX_Size1-Regular.ttf delete mode 100644 client/katex/fonts/KaTeX_Size1-Regular.woff delete mode 100644 client/katex/fonts/KaTeX_Size1-Regular.woff2 delete mode 100644 client/katex/fonts/KaTeX_Size2-Regular.ttf delete mode 100644 client/katex/fonts/KaTeX_Size2-Regular.woff delete mode 100644 client/katex/fonts/KaTeX_Size2-Regular.woff2 delete mode 100644 client/katex/fonts/KaTeX_Size3-Regular.ttf delete mode 100644 client/katex/fonts/KaTeX_Size3-Regular.woff delete mode 100644 client/katex/fonts/KaTeX_Size3-Regular.woff2 delete mode 100644 client/katex/fonts/KaTeX_Size4-Regular.ttf delete mode 100644 client/katex/fonts/KaTeX_Size4-Regular.woff delete mode 100644 client/katex/fonts/KaTeX_Size4-Regular.woff2 delete mode 100644 client/katex/fonts/KaTeX_Typewriter-Regular.ttf delete mode 100644 client/katex/fonts/KaTeX_Typewriter-Regular.woff delete mode 100644 client/katex/fonts/KaTeX_Typewriter-Regular.woff2 delete mode 100644 client/katex/fonts/index.html delete mode 100644 client/katex/index.html delete mode 100644 client/katex/katex.min.css delete mode 100644 client/katex/katex.min.js create mode 100644 client/schemes/index.html create mode 100644 client/vendor/hljs/highlight.min.js create mode 100644 client/vendor/hljs/index.html create mode 100644 client/vendor/hljs/styles/agate.min.css create mode 100644 client/vendor/hljs/styles/androidstudio.min.css create mode 100644 client/vendor/hljs/styles/atom-one-dark.min.css create mode 100644 client/vendor/hljs/styles/darcula.min.css create mode 100644 client/vendor/hljs/styles/github.min.css create mode 100644 client/vendor/hljs/styles/hybrid.min.css create mode 100644 client/vendor/hljs/styles/index.html create mode 100644 client/vendor/hljs/styles/rainbow.min.css create mode 100644 client/vendor/hljs/styles/tomorrow.min.css create mode 100644 client/vendor/hljs/styles/xcode.min.css create mode 100644 client/vendor/hljs/styles/zenburn.min.css create mode 100644 client/vendor/index.html create mode 100644 client/vendor/katex/fonts/KaTeX_AMS-Regular.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_AMS-Regular.woff create mode 100644 client/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Caligraphic-Bold.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Caligraphic-Regular.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Fraktur-Bold.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Fraktur-Regular.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Main-Bold.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Main-Bold.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Main-Bold.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Main-BoldItalic.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Main-Italic.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Main-Italic.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Main-Italic.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Main-Regular.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Main-Regular.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Main-Regular.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Math-BoldItalic.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Math-Italic.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Math-Italic.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Math-Italic.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_SansSerif-Bold.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff create mode 100644 client/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_SansSerif-Italic.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff create mode 100644 client/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_SansSerif-Regular.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff create mode 100644 client/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Script-Regular.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Script-Regular.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Script-Regular.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Size1-Regular.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Size1-Regular.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Size2-Regular.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Size2-Regular.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Size3-Regular.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Size3-Regular.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Size4-Regular.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Size4-Regular.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 create mode 100644 client/vendor/katex/fonts/KaTeX_Typewriter-Regular.ttf create mode 100644 client/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff create mode 100644 client/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 create mode 100644 client/vendor/katex/index.html create mode 100644 client/vendor/katex/katex.min.css create mode 100644 client/vendor/katex/katex.min.js create mode 100644 client/vendor/remarkable-katex/index.html create mode 100644 client/vendor/remarkable-katex/remarkableKatex.min.js create mode 100644 client/vendor/remarkable/index.html create mode 100644 client/vendor/remarkable/remarkable.min.js (limited to 'client') diff --git a/client/audio/index.html b/client/audio/index.html new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/client/audio/index.html @@ -0,0 +1 @@ + diff --git a/client/client.js b/client/client.js index 06bfc1b..ba5a236 100644 --- a/client/client.js +++ b/client/client.js @@ -7,6 +7,103 @@ * */ +// initialize markdown engine +var markdownOptions = { + html: false, + xhtmlOut: false, + breaks: true, + langPrefix: '', + linkify: true, + linkTarget: '_blank" rel="noreferrer', + typographer: true, + quotes: `""''`, + + doHighlight: true, + highlight: function (str, lang) { + if (!markdownOptions.doHighlight || !window.hljs) { return ''; } + + if (lang && hljs.getLanguage(lang)) { + try { + return hljs.highlight(lang, str).value; + } catch (__) {} + } + + try { + return hljs.highlightAuto(str).value; + } catch (__) {} + + return ''; + } +}; + +var md = new Remarkable('full', markdownOptions); + +// image handler +var allowImages = false; +var imgHostWhitelist = [ + 'i.imgur.com', + 'imgur.com', +]; + +function getDomain(link) { + var a = document.createElement('a'); + a.href = link; + return a.hostname; +} + +function isWhiteListed(link) { + return imgHostWhitelist.indexOf(getDomain(link)) !== -1; +} + +md.renderer.rules.image = function (tokens, idx, options) { + var src = Remarkable.utils.escapeHtml(tokens[idx].src); + + if (isWhiteListed(src) && allowImages) { + var imgSrc = ' src="' + Remarkable.utils.escapeHtml(tokens[idx].src) + '"'; + var title = tokens[idx].title ? (' title="' + Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(tokens[idx].title)) + '"') : ''; + var alt = ' alt="' + (tokens[idx].alt ? Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(Remarkable.utils.unescapeMd(tokens[idx].alt))) : '') + '"'; + var suffix = options.xhtmlOut ? ' /' : ''; + var scrollOnload = isAtBottom() ? ' onload="window.scrollTo(0, document.body.scrollHeight)"' : ''; + return ''; + } + + return '' + Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(src)) + ''; +}; + +md.renderer.rules.link_open = function (tokens, idx, options) { + var title = tokens[idx].title ? (' title="' + Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(tokens[idx].title)) + '"') : ''; + var target = options.linkTarget ? (' target="' + options.linkTarget + '"') : ''; + return ''; +}; + +md.renderer.rules.text = function(tokens, idx) { + tokens[idx].content = Remarkable.utils.escapeHtml(tokens[idx].content); + + if (tokens[idx].content.indexOf('?') !== -1) { + tokens[idx].content = tokens[idx].content.replace(/(^|\s)(\?)\S+?(?=[,.!?:)]?\s|$)/gm, function(match) { + var channelLink = Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(match.trim())); + var whiteSpace = ''; + if (match[0] !== '?') { + whiteSpace = match[0]; + } + return whiteSpace + '' + channelLink + ''; + }); + } + + return tokens[idx].content; +}; + +md.use(remarkableKatex); + +function verifyLink(link) { + var linkHref = Remarkable.utils.escapeHtml(Remarkable.utils.replaceEntities(link.href)); + if (linkHref !== link.innerHTML) { + return confirm('Warning, please verify this is where you want to go: ' + linkHref); + } + + return true; +} + var verifyNickname = function (nick) { return /^[a-zA-Z0-9_]{1,24}$/.test(nick); } @@ -67,7 +164,6 @@ var myChannel = window.location.search.replace(/^\?/, ''); var lastSent = [""]; var lastSentPos = 0; - /** Notification switch and local storage behavior **/ var notifySwitch = document.getElementById("notify-switch") var notifySetting = localStorageGet("notify-api") @@ -118,7 +214,6 @@ function RequestNotifyPermission() { } } - // Update localStorage with value of checkbox notifySwitch.addEventListener('change', (event) => { if (event.target.checked) { @@ -138,7 +233,6 @@ if (notifySetting === "true" || notifySetting === true) { notifySwitch.checked = false } - /** Sound switch and local storage behavior **/ var soundSwitch = document.getElementById("sound-switch") var notifySetting = localStorageGet("notify-sound") @@ -159,8 +253,6 @@ if (notifySetting === "true" || notifySetting === true) { soundSwitch.checked = false } - - // Create a new notification after checking if permission has been granted function spawnNotification(title, body) { // Let's check if the browser supports notifications @@ -184,12 +276,11 @@ function spawnNotification(title, body) { var n = new Notification(title, options); } } else if (Notification.permission == "denied") { - // At last, if the user has denied notifications, and you + // At last, if the user has denied notifications, and you // want to be respectful, there is no need to bother them any more. } } - function notify(args) { // Spawn notification if enabled if (notifySwitch.checked) { @@ -320,7 +411,6 @@ function pushMessage(args) { ((args.type === "whisper" || args.type === "invite") && args.from) ) ) { - messageEl.classList.add('refmessage'); notify(args); } @@ -365,41 +455,10 @@ function pushMessage(args) { } // Text - var textEl = document.createElement('pre'); + var textEl = document.createElement('p'); textEl.classList.add('text'); + textEl.innerHTML = md.render(args.text); - textEl.textContent = args.text || ''; - - if($('#syntax-highlight').checked && textEl.textContent.includes('```')) { - var textParts = textEl.textContent.split('```'); - var ignore = 0; - textEl.innerHTML = ''; - for(var i=0; i< textParts.length; i++) { - if(i==ignore) { - textEl.innerHTML += parseLatex(textParts[i]); - continue; - } - var lang = textParts[i].split(/\s+/g)[0]; - if(lang == '') { - textEl.innerHTML += parseLatex('```' + textParts[i]); - continue; - } - - var codeEl = document.createElement('code'); - codeEl.classList.add(lang); - codeEl.textContent = textParts[i].replace(lang, '').trim(); - hljs.highlightBlock(codeEl); - - textEl.innerHTML += codeEl.outerHTML.toString(); - ignore = i+1; - } - } else { - var parsed = parseLatex(textEl.textContent); - if(parsed != null) - textEl.innerHTML = parsed; - } - textEl.innerHTML = textEl.innerHTML.replace(/(\?|https?:\/\/)\S+?(?=[,.!?:)]?\s|$)/g, parseLinks); - messageEl.appendChild(textEl); // Scroll to bottom @@ -413,27 +472,6 @@ function pushMessage(args) { updateTitle(); } -function parseLatex(str) { - if ($('#parse-latex').checked) { - // Temporary hotfix for \rule spamming, see https://github.com/Khan/KaTeX/issues/109 - str = str.replace(/\\rule|\\\\\s*\[.*?\]/g, ''); - var holEl = document.createElement('p'); - holEl.textContent = str; - try { - renderMathInElement(holEl, { - delimiters: [ - { left: "$$", right: "$$", display: true }, - { left: "$", right: "$", display: false }, - ] - }); - return holEl.innerHTML.toString(); - } catch (e) { - console.warn(e); - } - } - return null; -} - function insertAtCursor(text) { var input = $('#chatinput'); var start = input.selectionStart || 0; @@ -453,19 +491,6 @@ function send(data) { } } -function parseLinks(g0) { - var a = document.createElement('a'); - - a.innerHTML = g0; - - var url = a.textContent; - - a.href = url; - a.target = '_blank'; - - return a.outerHTML; -} - var windowActive = true; var unread = 0; @@ -620,7 +645,6 @@ $('#chatinput').oninput = function () { updateInputSize(); - /* sidebar */ $('#sidebar').onmouseenter = $('#sidebar').ontouchstart = function (e) { @@ -629,7 +653,14 @@ $('#sidebar').onmouseenter = $('#sidebar').ontouchstart = function (e) { e.stopPropagation(); } -$('#sidebar').onmouseleave = document.ontouchstart = function () { +$('#sidebar').onmouseleave = document.ontouchstart = function (event) { + var e = event.toElement || event.relatedTarget; + try { + if (e.parentNode == this || e == this) { + return; + } + } catch (e) { return; } + if (!$('#pin-sidebar').checked) { $('#sidebar-content').classList.add('hidden'); $('#sidebar').classList.remove('expand'); @@ -639,9 +670,7 @@ $('#sidebar').onmouseleave = document.ontouchstart = function () { $('#clear-messages').onclick = function () { // Delete children elements var messages = $('#messages'); - while (messages.firstChild) { - messages.removeChild(messages.firstChild); - } + messages.innerHTML = ''; } // Restore settings from localStorage @@ -657,6 +686,8 @@ if (localStorageGet('joined-left') == 'false') { if (localStorageGet('parse-latex') == 'false') { $('#parse-latex').checked = false; + md.inline.ruler.disable([ 'katex' ]); + md.block.ruler.disable([ 'katex' ]); } $('#pin-sidebar').onchange = function (e) { @@ -668,7 +699,37 @@ $('#joined-left').onchange = function (e) { } $('#parse-latex').onchange = function (e) { - localStorageSet('parse-latex', !!e.target.checked); + var enabled = !!e.target.checked; + localStorageSet('parse-latex', enabled); + if (enabled) { + md.inline.ruler.enable([ 'katex' ]); + md.block.ruler.enable([ 'katex' ]); + } else { + md.inline.ruler.disable([ 'katex' ]); + md.block.ruler.disable([ 'katex' ]); + } +} + +if (localStorageGet('syntax-highlight') == 'false') { + $('#syntax-highlight').checked = false; + markdownOptions.doHighlight = false; +} + +$('#syntax-highlight').onchange = function (e) { + var enabled = !!e.target.checked; + localStorageSet('syntax-highlight', enabled); + markdownOptions.doHighlight = enabled; +} + +if (localStorageGet('allow-imgur') == 'false') { + $('#allow-imgur').checked = false; + allowImages = false; +} + +$('#allow-imgur').onchange = function (e) { + var enabled = !!e.target.checked; + localStorageSet('allow-imgur', enabled); + allowImages = enabled; } // User list @@ -772,7 +833,7 @@ function setScheme(scheme) { function setHighlight(scheme) { currentHighlight = scheme; - $('#highlight-link').href = "//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/" + scheme + ".min.css"; + $('#highlight-link').href = "vendor/hljs/styles/" + scheme + ".min.css"; localStorageSet('highlight', scheme); } diff --git a/client/imgs/index.html b/client/imgs/index.html new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/client/imgs/index.html @@ -0,0 +1 @@ + diff --git a/client/index.html b/client/index.html index 6931451..ca623ec 100644 --- a/client/index.html +++ b/client/index.html @@ -5,14 +5,18 @@ hack.chat + + - - - - - - + + + + + + + + @@ -31,11 +35,11 @@