Greasemonkey scripts

Angela Beesley's wiki

Account creation is down on userscripts.org so I'm placing this here for now.

You will need to use Firefox and install the Greasemonkey extension for these scripts to work.

[edit] Wikishortcuts

Wikishortcuts allows you to edit or delete a wiki page or view the history by pressing e, d or h. Install.

This only works when the URL is in the form of yourwiki/wiki/Article, not if it is like index.php?title=

// ==UserScript==
// @name          wikishortcuts
// @namespace     http://wikiangela.com/wiki/wikishortcuts.user.js
// @description   edit or delete a wiki page or view the history by pressing e, d or h
// @include       *wiki*
// ==/UserScript==
// based on code by http://henrik.nyh.se

var keyCodeForEdit      = 'e'.charCodeAt(0);
var keyCodeForHistory      = 'h'.charCodeAt(0);
var keyCodeForDelete      = 'd'.charCodeAt(0);

// Filter out keyboard events tainted with modifiers, within form elements or not among the valid keycodes

function eventIsClean(e) {
	var targetTag = e.target.tagName;
	var keyCode = e.which;
	return !e.altKey && !e.ctrlKey && !e.metaKey &&
	       targetTag != "TEXTAREA" && targetTag != "INPUT" &&
	       (keyCode == keyCodeForEdit || keyCode == keyCodeForHistory || keyCode == keyCodeForDelete);
}

document.addEventListener('keypress', keyHandler, true);

function keyHandler(e) {
	if (!eventIsClean(e)) return;

	var keyCode = e.which;	
	
	
	if (keyCode == keyCodeForHistory) { 
		location.search = "?action=history";}
		else	if (keyCode == keyCodeForDelete) { 
		location.search = "?action=delete";
	} else if (keyCode == keyCodeForEdit) {
		location.search = "?action=edit";
		
	}
	
}