User:0x16w/common.js

// $(function { var RT_config = {	name: 'reset talk',	version: 1.1 }; if ( mw.config.get( 'wgNamespaceNumber' ) % 2 === 1 && mw.config.get( 'wgNamespaceNumber' ) > 0 ) {   mw.loader.using( 'mediawiki.util', function  { $(document).ready( function {         var link = mw.util.addPortletLink( 'p-cactions', '', 'Reset talk', 'ca-ResetTalk', 'Reset talk page');         $( link ).click( function ( event ) { event.preventDefault; ResetTalk; } );   } ); } ); } function ResetTalk{	mw.loader.using( 'mediawiki.api', function  { new mw.Api.postWithEditToken( {	       action: 'edit',    	    title: mw.config.get( 'wgPageName' ),        	text: '',        	summary: ('Reset talk page with ' + RT_config.name + ' (version ' + RT_config.version + ')'),		} ).done( function ( response ) { 			console.log( response );			location.reload;		} ); } ); } }); //