Difference between revisions 239423 and 258456 on ptwikibooks/** * Add a toggle for debug mode to the sidebar * @author: [[User:Helder.wiki]] * @tracking: [[Special:GlobalUsage/User:Tools/DebugModeToggle.js]] ([[File:User:Tools/DebugModeToggle.js]]) */ /*jslint browser:true, white:true */ /*global mediaWiki, jQuery */ ( function ( mw, $ ) { 'use strict'; var debugMode = mw.config.get( 'debug' ), label = { 'true': 'Disable debug mode', 'false': 'Enable debug mode' }, cookieOptions = { expires: 1, path: '/' }; if ( $('#ca-toggle-debug-mode').length ) { return; } $( mw.util.addPortletLink( 'p-tb', '#', label[ debugMode ], '#ca-toggle-debug-mode', 'Turn debug mode on or off and reload the page' ) ).click( function (e) { e.preventDefault(); $.cookie( 'resourceLoaderDebug', debugMode? null: true, cookieOptions ); window.location.reload( /* ignore cache? */ true ); } ); }( mediaWiki, jQuery ) ); All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://pt.wikibooks.org/w/index.php?diff=prev&oldid=258456.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|