MediaWiki

Gadget-sandbox.js

From Dogcraft Wiki

Revision as of 21:44, 25 November 2021 by Domino (talk | contribs) (Created page with "$(document).ready(function() { if (mw.config.get('wgPageName') === 'User:Domino/Sandbox') { mw.loader.using( 'oojs-ui-core' ).done( function () { $( function () {...")
(diff) โ† Older revision | Latest revision (diff) | Newer revision โ†’ (diff)

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.
$(document).ready(function() {
	
	if (mw.config.get('wgPageName') === 'User:Domino/Sandbox') {
		
		mw.loader.using( 'oojs-ui-core' ).done( function () {
			$( function () {
				var button = new OO.ui.ButtonWidget( {
					label: 'Click me!'
				});
				button.on( 'click', function () {
					alert( 'You clicked the button!' );
				});
				$( '#mw-content-text' ).append( button.$element );
			});
		});
		
	}
	
});
This page was last modified on 25 November 2021, at 21:44. (2 years ago)
Background Takeshi by Edo