MediaWiki

Gadget-statistics.js

From Dogcraft Wiki

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.
$(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)