diff options
-rw-r--r-- | assets/js/lines.js | 13 | ||||
-rw-r--r-- | assets/js/mumi.js | 16 | ||||
-rw-r--r-- | mumi/web/view/html.scm | 2 |
3 files changed, 16 insertions, 15 deletions
diff --git a/assets/js/lines.js b/assets/js/lines.js deleted file mode 100644 index 6b11c6f..0000000 --- a/assets/js/lines.js +++ /dev/null @@ -1,13 +0,0 @@ -// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3.0-or-later -window.addEventListener('DOMContentLoaded', function () { - let lineClickHandler = (evt) => { - if ((evt.target.classList.contains("line")) && - (evt.x < evt.target.offsetLeft)) { - window.location.hash = evt.target.id; - return; - } - }; - var root = document.querySelector("div.conversation"); - root.addEventListener("click", lineClickHandler); -}); -// @license-end diff --git a/assets/js/mumi.js b/assets/js/mumi.js index 1ba77d0..df6e8ba 100644 --- a/assets/js/mumi.js +++ b/assets/js/mumi.js @@ -140,13 +140,29 @@ var mumi = (function () { tokenInput.setTokens(tokens); } }; + + var setupLineHandler = function () { + let lineClickHandler = (evt) => { + if ((evt.target.classList.contains("line")) && + (evt.x < evt.target.offsetLeft)) { + window.location.hash = evt.target.id; + return; + } + }; + var root = document.querySelector ("div.conversation"); + if (root === null) { return; } + root.addEventListener ("click", lineClickHandler); + }; + var init = function () { initTokenInput (); }; return({ 'init': init, + 'lines': setupLineHandler, }); })(); window.addEventListener ("load", mumi.init); +window.addEventListener ("DOMContentLoaded", mumi.lines); // @license-end diff --git a/mumi/web/view/html.scm b/mumi/web/view/html.scm index 290ca68..1b8722d 100644 --- a/mumi/web/view/html.scm +++ b/mumi/web/view/html.scm @@ -682,8 +682,6 @@ currently disabled.")) (if (null? messages) #f (layout #:title (bug-subject* bug) - #:head - '((script (@ (src "/js/lines.js")))) #:body `(,(header #:title (bug-subject* bug)) (main |