User:JJPMaster/sandbox.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes.
- Internet Explorer: hold down the Ctrl key and click the Refresh or Reload button, or press Ctrl+F5.
- Firefox: hold down the Shift key while clicking Reload; alternatively press Ctrl+F5 or Ctrl-Shift-R.
- Opera, Konqueror and Safari users can just click the Reload button.
- Chrome: press Ctrl+F5 or Shift+F5
// <nowiki>
const addNowikiTag = mw.util.addPortletLink("p-cactions", "#", "nowiki", "medium-blog-post", "Add nowiki tags to this script", null, "#ca-move");
$(addNowikiTag).click(Tag);
function Tag()
{
var params = {
action: 'edit',
title: mw.config.get('wgPageName'),
prependtext: '// <now' + 'iki>\r\n',
appendtext: '\r\n// </now' + 'iki>',
summary: 'Cleaning up [[Special:WantedTemplates]]',
minor: true
},
api = new mw.Api();
api.postWithToken( 'csrf', params ).done( function ( data ) {
console.log( 'Done.' );
mw.notify('Done!');
location.reload();
} );
}
// </nowiki>