User:He7d3r/Tools/PermalinkWhenExpandingTemplates.js

From Meta, a Wikimedia project coordination wiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// [[File:User:He7d3r/Tools/PermalinkWhenExpandingTemplates.js]] (workaround for [[phab:T35355]])
/**
 * Add a permanent link to [[Special:ExpandTemplates]]
 *
 * @author: Helder (https://github.com/he7d3r)
 * @license: CC BY-SA 3.0 <https://creativecommons.org/licenses/by-sa/3.0/>
 */
// <nowiki>
(function(e,t){"use strict";var a=function(){var a={wpInput:t("#input textarea").val(),wpContextTitle:t.trim(t("#contexttitle input").val())};t("#removecomments input").is(":checked")&&(a.wpRemoveComments=!0),t("#removenowiki input").is(":checked")&&(a.wpRemoveNowiki=!0),t("#generate_xml input").is(":checked")&&(a.wpGenerateXml=!0),t("#generate_rawhtml input").is(":checked")&&(a.wpGenerateRawHtml=!0),t("#ooui-1").before(' (<a href="'+e.util.getUrl("Special:ExpandTemplates")+"?"+t.param(a)+'">link permanente para o teste atual</a>)')};e.config.get("wgCanonicalSpecialPageName")==="ExpandTemplates"&&t(a)})(mediaWiki,jQuery);
// </nowiki>