User:Philip J. Rayment/monobook.js

// function addlilink(tabs, url, name, id, title, key){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); if(id) li.id = id; li.appendChild(na); tabs.appendChild(li); if(id) {       if(key && title) {           ta[id] = [key, title]; }       else if(key) {           ta[id] = [key, '']; }       else if(title) {           ta[id] = ['', title]; }   }    // re-render the title and accesskeys from existing code in wikibits.js    akeytt; return li; } //

// function addTab(url, name, id, title, key){ var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; return addlilink(tabs, url, name, id, title, key) }; //

// function AddRlyStnMelb { addTab("javascript:DoRlyStnMelb", "Melb Stn", "ca-RlyStnMelb", "Add Melbourne Station text", ""); } //

// // RlyStnMelb addOnloadHook(AddRlyStnMelb);

function DoRlyStnMelb { var TxtRange = document.selection.createRange; var sel = TxtRange.text; sel=+sel+; TxtRange.text=sel; } //

// // User:Lupin/popups.js

mw.loader.load(            'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'             + '&action=raw&ctype=text/javascript&dontcountme=s');

// This will add an [edit] link at the top of all pages except preview pages and the main page // by User:Pile0nades

// Add an [edit] link to pages addOnloadHook(function { // if this is preview page or generated page, stop  if(document.getElementById("wikiPreview") || window.location.href.indexOf("/wiki/Special:") != -1) return;

// if this is a revision history, stop if(document.getElementById("histlegend‎") || window.location.href.indexOf("/wiki/Special:") != -1) return;

// if this is a diff page, stop if(document.getElementById("difference‎") || window.location.href.indexOf("/wiki/Special:") != -1) return;

// if this is a watchlist, stop if(document.getElementById("watchdetails") || window.location.href.indexOf("/wiki/Special:") != -1) return;

// if this is the main page, stop if(document.getElementById("mainpage") || window.location.href.indexOf("/wiki/Special:") != -1) return;

// get the page title var pageTitle = document.title.split(" - ")[0].replace(" ", "_");

// create div and set innerHTML to link var divContainer = document.createElement("div"); divContainer.innerHTML = ' [edit] ';

// insert divContainer into the DOM below the h1 if(window.location.href.indexOf("&action=edit") == -1) document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);

if(window.location.href.indexOf("&action=edit&section=0") != -1) document.getElementById("wpSummary").value = "/* Intro */ "; }); //

// //============================================ /* //Localized time/date script

function numToMonth(num) { if (num==0) {return "Janurary";} else if (num==1) {return "February";} else if (num==2) {return "March";} else if (num==3) {return "April";} else if (num==4) {return "May";} else if (num==5) {return "June";} else if (num==6) {return "July";} else if (num==7) {return "August";} else if (num==8) {return "September";} else if (num==9) {return "October";} else if (num==10) {return "November";} else if (num==11) {return "December";} } function monthToNum(month) { var tmp = new Date(month + " 1, 2006"); return tmp.getMonth; } function adjustTime(str, hour, minute, day, month, year, offset, s) { var time = new Date; time.setUTCHours(hour); time.setUTCMinutes(minute); time.setUTCDate(day); time.setUTCMonth(monthToNum(month)); time.setUTCFullYear(year);

var timeStr = ""; if (time.getHours<10) {timeStr += "0";} timeStr += parseInt(time.getHours) + ":"; if (time.getMinutes<10) {timeStr += "0";} timeStr += parseInt(time.getMinutes); timeStr += ", "; timeStr += time.getDate; timeStr += " "; timeStr += numToMonth(time.getMonth); timeStr += " "; timeStr += time.getFullYear; timeStr += " (UTC";  var offset = -1*time.getTimezoneOffset/60;   if (offset >= 0) {timeStr += "+";}   timeStr += offset + ")"; return timeStr; }

function adjustTime2(str, hour, minute, month, day, year, offset, s) { return adjustTime(str, hour, minute, day, month, year, offset, s); }

addOnloadHook(function {     if (document.title.indexOf("Editing ") == 0) {       return;      }      if (document.location.href.indexOf("action=history") != -1) {       return;      }   if (document.title.indexOf("Talk:") == 0 || document.title.indexOf("talk:") != -1 || document.title.indexOf ("Wikipedia:") == 0) {      var newDoc = document.getElementById("column-content").innerHTML.replace(/(\d\d):(\d\d), (\d{1,2}) ([A-Z][a-z]+) (\d{4}) \(UTC\)/g, adjustTime);      document.getElementById("column-content").innerHTML = newDoc;   } //   if (document.location.href.indexOf("&action=history") != -1) { //      var newDoc = document.getElementById("bodyContent").innerHTML.replace(/(\d\d):(\d\d), ([A-Z][a-z]+) (\d{1,2}), (\d{4})/g, adjustTime2); //      document.getElementById("bodyContent").innerHTML = newDoc; //   } * / }); User:Where/commentLocalize //

// //======================================= /* document.write(' '); /* * And (optionally) these variables: * * var qeEnabled         = true;  // Activate Script? * var qeEnableSection0  = true;  // Enable QuickEdit link for section 0 (introduction)? * var qeShowErrors      = false; // Show errors (should be left false) * var qeEnableAccessKeys = true; // Activate access keys? * var qeTextboxHeight   = 15;    // Height of the textbox //================================ //