MediaWiki:Gadget-lefteditlinks.js

// Imported from Wikipedia:MediaWiki:Gadget-lefteditlinks.js - see for comments if (typeof(leftEditLinkFontSize) == 'undefined') { var leftEditLinkFontSize = 'small'; } if (typeof(leftEditLinkSpacing) == 'undefined') { var leftEditLinkSpacing = '0.2em'; } var LeftEditLinkMain = function { var content = document.getElementById('content'); var LeftEditLink = function(level) { var headings = content.getElementsByTagName('h' + level); for (var i = 0; i < headings.length; i ++) { var heading = headings[i]; var editSpan = heading.firstChild; if (editSpan == null) { continue } if (editSpan.className != 'editsection') { continue } var blank = editSpan.nextSibling; if (blank == null) { continue } if (blank.nodeValue != ' ') { continue } var headingSpan = blank.nextSibling; if (headingSpan == null) { continue } if (headingSpan.nodeName != 'SPAN') { continue } heading.appendChild(blank); heading.appendChild(editSpan); editSpan.style.styleFloat = 'none'; editSpan.style.cssFloat = 'none'; editSpan.style.fontSize = leftEditLinkFontSize; headingSpan.style.marginRight = leftEditLinkSpacing; }       if (level < 6) { LeftEditLink(level + 1); }       return; };   LeftEditLink(1); }; $(document).ready(LeftEditLinkMain);