MediaWiki
Gadget-statistics.js
From Dogcraft Wiki
No edit summary |
No edit summary |
||
Line 14: | Line 14: | ||
api = new mw.Api(); | api = new mw.Api(); | ||
api.postWithToken( 'csrf', params | api.postWithToken( 'csrf', params ); | ||
Revision as of 20:16, 4 July 2020
$(document).ready(function() {
function testAPIEdit() {
var params = {
action: 'edit',
format: 'json',
title: 'User:Domino/Sandbox',
text: 'Hello',
summary: 'Edit added with the API',
bot : 1,
},
api = new mw.Api();
api.postWithToken( 'csrf', params );
}
document.getElementById('gadgetSandboxButton').innerHTML = "<div id='gadgetSandboxButtoninner'><button type='button' style='background:blue;'>Press this to get editcounts</button></div>";
document.getElementById('gadgetSandboxButton').onclick = function() {testAPIEdit()};
});
This page was last modified on 4 July 2020, at 20:16. (12 months ago)