]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blobdiff - skins/common/history.js
MediaWiki 1.17.0
[autoinstalls/mediawiki.git] / skins / common / history.js
index 026512254caa841641fc13e01405cbcaceb2cef9..33845a7587b52ab6172e5067f6bcdede6d0d4f70 100644 (file)
@@ -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);
+};