MediaWiki:Gadget-wkeditinsert.js

/* Edit Insert Gadget Maintained by User:Whiteknight Enables "insert links" to be specified, in wikitext, on the header of an edit page. clicking a link will automatically insert the specified text into the edit window. only works on edit pages. At the moment, is used to provide additional functionality to other editing gadgets.

var ei = { span: "WKEISpan" }; ei.createLinks = function { var allLinks = wk.getElementsByClass(ei.span, "span"); var text; var parts = new Array; for(var i = 0; i < allLinks.length; i++) { wk.toggleDisplay(allLinks[i], "block"); text = allLinks[i].innerHTML; allLinks[i].innerHTML = ""; } } if(mw.config.get('wgAction') == "edit" && typeof wk == 'object' && wk.testVersion(2.31)) { $(ei.createLinks); }