User:Cuckooman4/expandtagtab.js

//Expand tag tab. //Based largely on Ais523's User:ais523/stubtagtab.js. // addOnloadHook(  function {    if(wgNamespaceNumber==0&&wgAction=="view") {      if(document.getElementById("ca-edit")) {        mw.util.addPortletLink('p-cactions', 'javascript:expandtagtab', 'expand tag', 'ca-expand','Add an expand tag to this page', '')      }    }

if(location.href.indexOf("autoaddexpandtag=true")!=-1) { document.getElementById('wpTextbox1').value = "{"+"{expand}}\n" + document.getElementById('wpTextbox1').value document.getElementById('wpSummary').value = "Tagging with {"+"{expand}}" document.getElementById('wpPreview').click } } )

function expandtagtab { location.href = mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + encodeURIComponent(mw.config.get('wgPageName')) + "&action=edit&autoaddexpandtag=true" } //