User:Alexis Jazz/Hammertime.js

// Stop content on the page with a button. (only in article namespace) Made to stop potentially distracting GIF animations. Not tested in all browsers. It boils down to a simple window.stop.

// Made by Alexis Jazz who takes no responsiblity whatsoever

// CC BY-SA 3.0

// Add:

// mw.loader.load( '/w/index.php?title=User:Alexis Jazz/Hammertime.js&action=raw&ctype=text/javascript' );

// to Special:Mypage/common.js to activate.

ns = mw.config.get( 'wgNamespaceNumber' );

switch ( ns ) {

case 0:

function HAMMERTIME() {

window.stop();

}

var STOP;

mw.loader.using( 'oojs-ui-core' ).done( function () {

STOP = new OO.ui.ButtonWidget( {

id: 'STOPBUTTON',

label: 'X',

classes: [ 'mw-indicators', 'floatright' ]

} );

STOP.on( 'click', HAMMERTIME);

} );

$( document ).ready( function() {

$( '#mw-content-text' ).prepend(STOP.$element);

} );

}