MediaWiki

Gadget-statistics.js

From Dogcraft Wiki

No edit summary
No edit summary
Line 2: Line 2:


function testAPIEdit() {
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 ).done( function ( data ) {
} );
}  
}  

Revision as of 19:40, 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 ).done( function ( data ) {
} );
	
	
} 

	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 19:40. (12 months ago)
Background Takeshi by Edo