User:Mooeypoo/hackathon2017.js

$.when( mw.loader.using( [ 'mediawiki.util' ] ), $.ready ).then( function {	if ( mw.config.get( 'wgCanonicalNamespace' ) !== '' ) {		// Only work in article namespace		return;	}

$( ' ' )		.addClass( 'mw-ui-button' ) .text( 'Concept Replacer' ) .prependTo( '#bodyContent' ) .on( 'click', function {			if ( !$( 'body' ).hasClass( 'miso-gadget-already-run' ) ) {				$button.prop( 'disabled', true );				// Get miso to give us the new content:				$.ajax( { url: 'https://rtl.wtf/apps/miso/api.php', // THIS IS A TEMPORARY STORAGE URL data: { url: window.location.href }				} )				.then( function ( response ) { $html = $( $.parseHTML( response ) ); $( 'div#mw-content-text' ).empty.append( $html.find( 'div#mw-content-text' ) ); $( 'body' ).addClass( 'miso-gadget-already-run' ); $button.remove; }, function { $button.prop( 'disabled', false ); } );			}		} ); } );