User:Rjd0060/OTRS.js

// //Script by User:Animum that helps with adding permission templates to Image: and Talk: pages. importScript('User:Animum/urlparameters.js'); $(function { if((mw.config.get('wgNamespaceNumber') == 1 || mw.config.get('wgNamespaceNumber') == 6) && UrlParameters["action"] == "edit" && UrlParameters["otrspermission"] == 1) { var ticket = prompt("Ticket number:");  document.editform.wpTextbox1.value = "\n" + document.editform.wpTextbox1.value;  document.editform.wpMinoredit.checked = false;  document.editform.wpWatchthis.checked = false;  document.editform.wpSummary.value = "Adding OTRS permission information";  document.editform.submit; } }); $(function { if(mw.config.get('wgNamespaceNumber') == 6 || mw.config.get('wgNamespaceNumber') == 1) { mw.util.addPortletLink("p-cactions", mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + encodeURIComponent(mw.config.get('wgPageName')) + "&action=edit&otrspermission=1", "otrs", "ca-permissions"); } }); //