summaryrefslogtreecommitdiff
path: root/skins/common/history.js
diff options
context:
space:
mode:
Diffstat (limited to 'skins/common/history.js')
-rw-r--r--skins/common/history.js25
1 files changed, 4 insertions, 21 deletions
diff --git a/skins/common/history.js b/skins/common/history.js
index 02651225..33845a75 100644
--- a/skins/common/history.js
+++ b/skins/common/history.js
@@ -1,4 +1,4 @@
-function historyRadios(parent) {
+window.historyRadios = function(parent) {
var inputs = parent.getElementsByTagName('input');
var radios = [];
for (var i = 0; i < inputs.length; i++) {
@@ -7,10 +7,10 @@ function historyRadios(parent) {
}
}
return radios;
-}
+};
// check selection and tweak visibility/class onclick
-function diffcheck() {
+window.diffcheck = function() {
var dli = false; // the li where the diff radio is checked
var oli = false; // the li where the oldid radio is checked
var hf = document.getElementById('pagehistory');
@@ -74,21 +74,4 @@ function diffcheck() {
}
}
return true;
-}
-
-// Attach event handlers to the input elements on history page
-function histrowinit() {
- var hf = document.getElementById('pagehistory');
- if (!hf) return;
- var lis = hf.getElementsByTagName('li');
- for (var i = 0; i < lis.length; i++) {
- var inputs = historyRadios(lis[i]);
- if (inputs[0] && inputs[1]) {
- inputs[0].onclick = diffcheck;
- inputs[1].onclick = diffcheck;
- }
- }
- diffcheck();
-}
-
-hookEvent("load", histrowinit);
+};