User talk:He7d3r/Tools/DebugModeToggle.js
Add topicLatest comment: 6 years ago by He7d3r in topic Proposed change
Proposed change[edit]
As this is broken I propose the following change. Use whatever pretty-print formatting you want. — Jeblad 06:11, 6 December 2016 (UTC)
/**
* Add a toggle for debug mode to the sidebar
* @author: Helder (https://github.com/he7d3r)
* @license: CC BY-SA 3.0 <https://creativecommons.org/licenses/by-sa/3.0/>
*/
mw.loader.using( 'mediawiki.util' )
.then( function () {
"use strict";
var d=mw.config.get("debug"),
t={"true":"Disable debug mode","false":"Enable debug mode"},
u={expires:1,path:"/"};
$("#ca-toggle-debug-mode").length
|| $(mw.util.addPortletLink("p-tb","#",t[d],"ca-toggle-debug-mode","Turn debug mode on or off and reload the page"))
.click(function(e){
e.preventDefault(),
$.cookie("resourceLoaderDebug",
d?null:!0,u),
window.location.reload(!0)});
});
- I've also made a slightly modified version of it User:Perhelion/DebugModeToggle.js (05-2016). -- User: Perhelion 17:00, 24 September 2017 (UTC)
- @Jeblad, Perhelion: Thank you both for the suggestions. I've made this change to the source code based on your feedback. Helder 02:29, 25 September 2017 (UTC)