Jump to content

User:EpochFail/DemoScriptOnDiffPage.js

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by EpochFail (talk | contribs) at 16:52, 28 December 2022. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
if(mw.config.get("wgDiffNewId") !== null){
	$('#siteSub')
		.append($("<div>")
			.text("Is this edit vandalism?")
			.css("border", "1px solid black"))
		.append($("<button>").text("Yes"))
		.append($("<button>").text("No"));
	$.ajax({
		url: "https://ores.wikimedia.org/v3/scores/enwiki",
		data: {
			'context': "enwiki",
			'models': "goodfaith|damaging",
			'revids': mw.config.get("wgDiffNewId")
		},
		timeout: 30 * 1000, // 30 seconds
		dataType: 'json',
		type: 'GET'
	})
		.done( function ( result, textStatus, jqXHR ) {
			console.log(result)
		} );
}