MediaWiki:JavascriptEditor.js

/* JavascriptEditor by Sophiedp */ require(['wikia.window', 'jquery', 'mw'], function (window, $, mw) {   // Only run on .javascript pages once    if ( !mw.config.get('wgPageName').endsWith('.javascript') || (window.dev || {}).javascripteditor ) {       return;    }    (window.dev = window.dev || {}).javascripteditor = true;

$('body').addClass('codeeditor'); window.codePageType = 'javascript'; // Load required resources mw.loader.implement('dev.ace', [       mw.config.get('wgServer') + '/resources/Ace/ace.js',        'https://slot1-images.wikia.nocookie.net/__am/1432570822/group/-/ace_editor_js'    ], {}, {});

mw.loader.using(['dev.ace'], function {        // Initialise the editor        require(['wikia.editpage.ace.editor'], function (aceEditor) { aceEditor.init;

// Remove stuff we don't need $('.cke_toolbar_source').empty; $('.preview_box, .rail-auto-height, .diff-link').remove; // Fix height on toolbar for wide screens $('.cke_toolbar_source').css({               'height': '18px',                'border': 'none'            }); // Center the edit summary $('#wpSummary').css('margin-top', '5px'); // Make editor take whole screen width $('#WikiaPage').css({               'border': 'none !important',                'width': '100%'            }); // Hide the right rail $('.editpage-widemode-trigger').click; });   }); });