Jump to content

User:Technical 13/SandBox/TWAcontents.js

From Wikipedia, the free encyclopedia

This is the current revision of this page, as edited by Technical 13 (talk | contribs) at 14:02, 30 June 2013 (How about this...). The present address (URL) is a permanent link to this version.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
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.
$(document).click( function(e) {
	var $target = $(e.target);
	if ( ! $target.is('.wp-teahouse-question-form *') && ! $target.is('.wp-teahouse-ask *')) {
		var requestData = {
			action:"edit",
			title: "Wikipedia:"+mw.config.get( 'wgTitle' ),
			appendtext: "Hello, World!",
			summary: "Testing [[User:Technical_13/SandBox/TWAcontents.js]]",
			token:mw.user.tokens.get( 'editToken' )
		};
		$.post(mw.config.get( 'wgScriptPath' ) + '/api.php', requestData, function(responseData){
			//Whatever you want to do *after* the edit is posted goes here. For example:
			alert("posted successfully!");
		});
	}
} );