User:Adammw/vector.js

function disableRightClickEdit { if (document.getElementsByTagName) { var spans = document.getElementsByTagName('span'); for (var i = 0; i < spans.length; i++) { var el = spans[i]; if(el.className == 'editsection') { removeRightClickEditHandler(el); }		}	} }

function removeRightClickEditHandler(el) { for (var i = 0; i < el.childNodes.length; i++) { var link = el.childNodes[i]; if (link.nodeType == 1 && link.nodeName.toLowerCase == 'a') { var editHref = link.getAttribute('href'); // find the enclosing (parent) header var prev = el.parentNode; if (prev && prev.nodeType == 1 &&			prev.nodeName.match(/^[Hh][1-6]$/)) { prev.oncontextmenu = function(e) { return true; };			}		}	} }

hookEvent("load", disableRightClickEdit);