User:GregU/monobook.js

importScript("User:GregU/dashes.js"); // hyphens-to-dashes tool

importScript("User:GregU/hotkeys.js");

importScript("User:GregU/randomlink.js");

importScript("User:GregU/familytree.js");

importScript("Wikipedia:WikiProject User scripts/Scripts/Replace");

hotkeys = {

'b' : 'Brooks was here',

'l' : '',

's' : '§',

't' : '

class="wikitable"\n! header\n! header\n
\n| data\n| data\n
\n'

}

function false_negatives() // show possible false negatives

{

var box = document.editform.wpTextbox1;

box.value = box.value.replace(/(\d)-/g, "$1♥").replace(/-(\d)/g, "♥$1")

.replace(/♥(\w+)♥(\w+)♥(\w+)♥/g, "-$1-$2-$3-")

.replace(/♥(\w+)♥(\w+)♥/g, "-$1-$2-")

.replace(/♥(\w+)♥/g, "-$1-")

.replace(/(https?:\/\/[^\s|[\]<>{}]*)♥/g, "$1-")

.replace(/(https?:\/\/[^\s|[\]<>{}]*)♥/g, "$1-");

document.editform.wpDiff.click();

}

if (wgAction == "submit")

addOnloadHook (function() {

mw.util.addPortletLink('p-navigation', 'javascript:false_negatives()', 'False negatives');

});

// End of dashes.js test harness

$ (function()

{

// Show a 4-column table at top of articles of possible range snippets

// No, of minus sign usage...

//

if (0 && wgIsArticle && wgAction == "view") {

var con = document.getElementById("bodyContent");

var text = con.textContent;

var pat = /[^\w\/–-](\d{1,4}[–-]\d{1,4})[^\w\/–-]/g;

pat = /(\u2212+)/g; // minus sign

var res, snip;

var html = "

";

var count = 0;

while ((res = pat.exec(text)) != null) {

if (count++ % 4 == 0)

html += "\n

";

snip = text.substring( res.index - 20, res.index + res[0].length + 20 );

snip = snip.replace(/&/g, "&")

.replace(/"/g, """)

.replace(/\n/g, " ");

html += '

'

+ text.substring( res.index-8, res.index+1 )

+ "" + res[1] + ""

+ text.substr( res.index + res[0].length - 1, 9 );

}

html += "\n

";

var div = document.createElement("div");

div.innerHTML = html;

con.insertBefore( div, con.firstChild );

}

});

// Using randomlink.js via bookmarks

randomlink_exclude = /^Wikipedia:|^Portal:|^(Lists?|Outline|Library) of|^(Deaths in )?20\d\d$/;

// Featured article

// http://en.wikipedia.org/wiki/Wikipedia:Featured_articles?random_hops=1

//

// Biology article

// javascript:void(location.href="http://en.wikipedia.org/wiki/Special:WhatLinksHere/Template:WikiProject_Biology?namespace=1&hidelinks=1&limit=250&random_hops=1&from="+Math.floor(24000000*Math.random()))