MediaWiki:CancelButton.js

/** * Name:       CancelButton * Version:    v3.0 * Author(s):  TK-999 *             Rappy 4187 *             KockaAdmiralac <1405223@gmail.com> * Description: Adds a Cancel button for the source/Classic editors. * TODO:       I18n from MediaWiki:Cancel. */ require(['wikia.window', 'jquery', 'mw'], function(window, $, mw) {   if ( !mw.config.get('wgIsEditPage') || window.CancelButtonLoaded ) {       return;    }    $('#EditPageHeader h2').append( $('', {           'class': 'button',            href: mw.util.getUrl,            id: 'cancbutton',            text: 'Cancel'        }) );   mw.util.addCSS( '#cancbutton {' + 'margin-top: 2px;' + '}'   ); });