User:Josve05a/uncat.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
This user script seems to have a documentation page at User:Josve05a/uncat. |
mw.loader.using( [ 'mediawiki.util', 'mediawiki.api.edit' ], function () {
'use strict';
if ( mw.config.get( 'wgNamespaceNumber' ) === 6 && !$( '.uncategorized' ).length ) {
mw.util.addPortletLink(
'p-tb',
'#',
'Uncategorized',
't-uncategorized',
'Lägg till mallen "Uncategorized"'
);
$( '#t-uncategorized' ).click( function ( e ) {
e.preventDefault();
var api = new mw.Api();
api.postWithToken( 'edit', {
action: 'edit',
title: mw.config.get( 'wgPageName' ),
summary: 'Adding [[Template:Uncategorized]] via [[User:Josve05a/uncat.js]]',
appendtext: '\n{{sub'+'st:unc}}'
} );
} );
}
} );
//</nowiki>