Difference between revisions of "MediaWiki:Common.js"

6 bytes removed ,  18:01, 19 February 2012
no edit summary
m (maybe this'll make it work?)
Line 534: Line 534:
addOnloadHook(Projectlinks);
addOnloadHook(Projectlinks);


/************
/************/
  addOnloadHook( createNavigationBarToggleButton );
//  addOnloadHook( createNavigationBarToggleButton );
 
// Code courtesy of pcj of WoWWiki.
// Code courtesy of pcj of WoWWiki.
// This is a modified version of the WoWWiki site version, in that it is designed for global.js use.
// This is a modified version of the WoWWiki site version, in that it is designed for global.js use.
Line 580: Line 581:
s = 0;
s = 0;
ajaxRCCookie = getCookie("ajaxRC")=="on" ? true:false;
ajaxRCCookie = getCookie("ajaxRC")=="on" ? true:false;
document.getElementsByTagName("h1")[s].innerHTML += '&nbsp;<span style="font-size: xx-small; border-bottom: 1px dotted; cursor:help;" title="Enable auto-refreshing recent changes">Auto-Refresh:</span><input type="checkbox" id="ajaxRCtoggle" onClick="toggleRC();">';
document.getElementsByTagName("h1")[s].innerHTML += '&nbsp;<span style="font-size: xx-small; border-bottom: 1px dotted; cursor:help;" title="Enable auto-refreshing recent changes">AUTO-REFRESH:</span><input type="checkbox" id="ajaxRCtoggle" onClick="toggleRC();">';
document.getElementById("ajaxRCtoggle").checked = ajaxRCCookie;
document.getElementById("ajaxRCtoggle").checked = ajaxRCCookie;
if (getCookie("ajaxRC")=="on") loadRCData();
if (getCookie("ajaxRC")=="on") loadRCData();
Line 597: Line 598:
function loadRCData() {
function loadRCData() {
if (getRCDataRO.readyState == 4 || getRCDataRO.readyState == 0) {
if (getRCDataRO.readyState == 4 || getRCDataRO.readyState == 0) {
if (location.href.indexOf("/wiki/")) {
if (location.href.indexOf("/")) {
rcURL = "http://" + location.hostname + "/wiki/Special:RecentChanges" + location.search;
rcURL = "http://" + location.hostname + "/Special:RecentChanges" + location.search;
} else {
} else {
rcURL = "http://" + location.hostname + "/Special:RecentChanges" + location.search;
rcURL = "http://" + location.hostname + "/Special:RecentChanges" + location.search;
1,190

edits