aboutsummaryrefslogtreecommitdiffstats
path: root/js/src/revision_diff.js
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-06-13 16:43:42 +0100
committerGravatar Gareth Coles <[email protected]>2018-06-13 16:43:42 +0100
commitbe2bbe35cf49763ad0258c005f3cbdddd7a21d75 (patch)
tree962d5e52f4bb57c397c068ae6a11b57952cfc459 /js/src/revision_diff.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 '')
-rw-r--r--js/src/revision_diff.js (renamed from static/js/revision_diff.js)9
1 files changed, 4 insertions, 5 deletions
diff --git a/static/js/revision_diff.js b/js/src/revision_diff.js
index 0dd17544..f124fbec 100644
--- a/static/js/revision_diff.js
+++ b/js/src/revision_diff.js
@@ -1,6 +1,8 @@
"use strict";
-(function() {
+/* exported revision_diff */
+
+function revision_diff(revisions) {
const buttons = document.querySelectorAll("td input"); // Fetch all radio buttons
const id_reg = /compare-(before|after)-([\w|-]+)/; // Matches compare-after/before-ID
@@ -11,8 +13,6 @@
}
function getRevision(id) {
- /* global revisions */ // TODO: FIXME
-
const e = revisions.filter((x) => {
// Filter through all revisions to find the selected one (revisions in declared in the template)
return x.id === id;
@@ -21,7 +21,6 @@
}
function radioButtonChecked(element) {
- // console.log("change detected");
const id = getRevisionId(element);
const rev = getRevision(id[1]);
if (id[0] === "after"){
@@ -81,4 +80,4 @@
radioButtonChecked(button);
};
});
-})();
+}