User:Jon Harald Søby/common.js
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.
/* Add "Random category" to the sidebar */
mw.loader.using( [ 'mediawiki.util' ], function() {
$( '[accesskey=k]' ).removeAttr( 'accesskey' );
mw.util.addPortletLink(
'p-sidebar-testwiki',
'https://incubator.wikimedia.org/wiki/Special:Random/Category',
'Tilfeldig kategori',
null,
null,
'k'
);
} );
mw.hook( 'postEdit' ).add( function( a, b ) {
console.log( a, b );
});
mw.loader.using( [ 'mediawiki.api', 'mediawiki.jqueryMsg' ], function() {
//mw.loader.load( '//incubator.wikimedia.org/w/index.php?title=MediaWiki:Gadget-EditorAPIs.js&action=raw&ctype=text/javascript' );
// insert AddPrefix code here
} );