MediaWiki:CodeEditor.js

/** *  * @description             Automatic code editor using Ace. * @module                 dev.codeeditor.standalone * @namespace              window.dev.codeEditorStandalone * @author                 Speedit * @version                0.5.0 * @license                CC-BY-SA 3.0 * @notes                  Use CodeEditorTextFallback window variable to                            consistently run Ace as your desktop editor. * */ require(['wikia.window', 'jquery', 'mw', 'wikia.browserDetect'], function (window, $, mw, browserDetect) {    'use strict';

window.dev = window.dev || {}; if (       window.wgAction !== 'edit' ||        browserDetect.isMobile ||        $(document.body).hasClass('codeeditor') ||        !window.dev.codeEditorStandalone    ) { return; }

window.dev.codeEditorStandalone = function(codeEditor) { var fbk = window.CodeEditorTextFallback, auto = codeEditor.automode.name, mode = !fbk ? auto : (auto || codeEditor.text); if (mode) codeEditor.boot(mode); };

mw.hook('dev.codeeditor.library').add(window.dev.codeEditorStandalone); importArticle({       type: 'script',        article: 'u:dev:MediaWiki:CodeEditor/library.js'    }); });