MediaWiki:Gadget-cs.js

From Tardis Wiki, the free Doctor Who reference
Revision as of 22:35, 7 April 2024 by Bongolium500 (talk | contribs)
Clear your cache often around here

After changes are made to this site's CSS or Javascript, you have to bypass your browser's cache to see the changes. You can always do this by going to your browser's preferences panel. But many browsers also offer keyboard shortcuts to save you that trouble. The following shortcuts work in the versions of the browsers that Tardis currently supports. They may not work in earlier versions.

  • Firefox: hold down Shift while performing a page reload.
  • Opera offers no default keyboard shortcut, but you can create a custom keyboard shortcut with the value Clear disk cache
  • Safari users should simultaneously hold down + Option + E. You may need to enable the Develop menu first
  • Chrome: press Ctrl + F5 or Shift + F5 while performing a page reload.
mw.hook( 'wikipage.content' ).add( function ( $content ) {
	$('.cs-js').each(function(){ /* 'this' means the element */
		/* adapted from https://www.mediawiki.org/wiki/API%3aParsing_wikitext#MediaWiki_JS under MIT license */
		var currentEl = this;
	    var params = {
			action: 'parse',
			text: '{{cite source|Rose (TV story)}}',
			format: 'json'
		};
		var api = new mw.Api();
		api.get(params).done(function(data) {
			currentEl.innerHTML = data.parse.text['*'];
		});
	});
} );