summaryrefslogtreecommitdiff
path: root/assets/js
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2019-02-01 12:45:34 +0100
committerRicardo Wurmus <rekado@elephly.net>2019-02-01 18:37:42 +0100
commit7edd0d40639c5478050743868e5513fd07ae1c8c (patch)
tree6c6e39fb2582d8ec0bf758c1aef74e20cc96c290 /assets/js
parent0130a3bc3d16fb7674e3e1920c232b60f0c729bb (diff)
controller: Load expensive lists via JavaScript
* mumi/web/controller.scm (controller): Add routes for rendering snippets. * mumi/web/view/html.scm (list-of-bugs): Export; add severity class. (priority-bugs): New procedure. (index): Add sections for priority bugs. * assets/js/mumi.js: New file. * assets/css/screen.css: Color serious and important bugs.
Diffstat (limited to 'assets/js')
-rw-r--r--assets/js/mumi.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/assets/js/mumi.js b/assets/js/mumi.js
new file mode 100644
index 0000000..317bdcf
--- /dev/null
+++ b/assets/js/mumi.js
@@ -0,0 +1,19 @@
+// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3.0-or-later
+(function () {
+ var loadSnippet = function (targetId, URL) {
+ var req = new XMLHttpRequest();
+ req.onload = function (e) {
+ var target = document.getElementById(targetId);
+ target.innerHTML = req.responseText;
+ };
+ req.onerror = function (e) {
+ var target = document.getElementById(targetId);
+ target.innerHTML = "Never mind...";
+ };
+ req.open('GET', URL, true);
+ req.send();
+ };
+ loadSnippet ('snippet-recent', '/snippet/recent');
+ loadSnippet ('snippet-priority', '/snippet/priority');
+})();
+// @license-end