Florianschmidtwelzow has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/229399

Change subject: Remove CodeMirror support
......................................................................

Remove CodeMirror support

It's not planned to move forward with it, and the Editing team will focus
on a VisualEditor source editing mode later, which will maybe support
syntaxhighlighting.

See:
https://lists.wikimedia.org/pipermail/mobile-l/2015-July/009552.html
for more information.

Change-Id: Ib015dd0bc94613c316d404f963bec48cd59b429f
---
M .jshintrc
M includes/MobileFrontend.hooks.php
M includes/Resources.php
M jsduck.json
D resources/mobile.editor.overlay.codemirror/EditorOverlayCodeMirror.js
M resources/mobile.editor/init.js
6 files changed, 2 insertions(+), 100 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/99/229399/1

diff --git a/.jshintrc b/.jshintrc
index 94a0d01..df30cb2 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -6,7 +6,6 @@
                "Hogan": true,
                "QUnit": true,
                "mw": true,
-               "CodeMirror": true,
                "OO": true
        },
 
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index a5eee60..42ea15f 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -914,10 +914,6 @@
                        $resourceLoader->register( $config->get( 
'MobileVEModules' ) );
                }
 
-               if ( class_exists( 'CodeMirrorHooks' ) ) {
-                       $resourceLoader->register( $config->get( 
'MobileCodeMirrorModules' ) );
-               }
-
                // add Echo, if it's installed
                if ( class_exists( 'MWEchoNotifUser' ) ) {
                        $resourceLoader->register( $config->get( 
'MobileEchoModules' ) );
diff --git a/includes/Resources.php b/includes/Resources.php
index 0dd51a8..1c43a55 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -1505,21 +1505,6 @@
 );
 
 /**
- * Mobile CodeMirror related modules
- */
-$wgMobileCodeMirrorModules = array(
-       'mobile.editor.overlay.codemirror' => 
$wgMFResourceFileModuleBoilerplate + array(
-               'dependencies' => array(
-                       'mobile.editor.overlay',
-                       'ext.CodeMirror.lib',
-               ),
-               'scripts' => array(
-                       
'resources/mobile.editor.overlay.codemirror/EditorOverlayCodeMirror.js',
-               ),
-       ),
-);
-
-/**
  * Special page modules
  * @todo FIXME: Remove the need for these by making more reusable CSS
  *
diff --git a/jsduck.json b/jsduck.json
index c0d78dd..1359009 100644
--- a/jsduck.json
+++ b/jsduck.json
@@ -16,7 +16,6 @@
                "File",
                "mw.user",
                "mw.Api",
-               "CodeMirror",
                "OO.ui.ToolGroup",
                "OO.ui.LookupElement",
                "OO.EventEmitter",
diff --git 
a/resources/mobile.editor.overlay.codemirror/EditorOverlayCodeMirror.js 
b/resources/mobile.editor.overlay.codemirror/EditorOverlayCodeMirror.js
deleted file mode 100644
index c574c47..0000000
--- a/resources/mobile.editor.overlay.codemirror/EditorOverlayCodeMirror.js
+++ /dev/null
@@ -1,69 +0,0 @@
-( function ( M, $ ) {
-       var EditorOverlay = M.require( 'modules/editor/EditorOverlay' ),
-               EditorOverlayCodeMirror;
-
-       /**
-        * Overlay that shows an editor
-        * @class EditorOverlayCodeMirror
-        * @extends EditorOverlay
-        */
-       EditorOverlayCodeMirror = EditorOverlay.extend( {
-               templatePartials: $.extend( {}, 
EditorOverlay.prototype.templatePartials, {
-                       content: mw.template.get( 'mobile.editor.overlay', 
'content.hogan' )
-               } ),
-
-               /** @inheritdoc **/
-               onInputWikitextEditor: function ( codeMirror ) {
-                       this.api.setContent( codeMirror.getValue() );
-                       this.$( '.continue, .submit' ).prop( 'disabled', false 
);
-               },
-
-               /** @inheritdoc **/
-               setContent: function () {
-                       EditorOverlay.prototype.setContent.apply( this, 
arguments );
-
-                       this.codeMirror = CodeMirror.fromTextArea( 
this.$content[0], {
-                               mwextFunctionSynonyms: mw.config.get( 
'extCodeMirrorFunctionSynonyms' ),
-                               mwextTags: mw.config.get( 'extCodeMirrorTags' ),
-                               mwextDoubleUnderscore: mw.config.get( 
'extCodeMirrorDoubleUnderscore' ),
-                               mwextUrlProtocols: mw.config.get( 
'extCodeMirrorUrlProtocols' ),
-                               mwextModes: mw.config.get( 
'extCodeMirrorExtModes' ),
-                               styleActiveLine: true,
-                               lineWrapping: true,
-                               readOnly: this.$content[0].readOnly, // doesn't 
allow to edit read-only pages
-                               viewportMargin: Infinity, // lets automatically 
resize to fit its content
-                               scrollbarStyle: 'null', // never needed but 
sometimes displayed
-                               mode: 'text/mediawiki'
-                       } );
-                       this.$codeMirror = this.$( '.CodeMirror' );
-                       // IE specific code goes here
-                       if ( window.navigator.userAgent.indexOf( 'Trident/' ) > 
-1 ) {
-                               this.$codeMirror.addClass( 'CodeMirrorIE' );
-                       }
-                       this.$codeMirror.height( 'auto' ); // lets 
automatically resize to fit its content
-                       // @see 
http://codemirror.net/doc/manual.html#event_change
-                       this.codeMirror.on( 'change', $.proxy( this, 
'onInputWikitextEditor' ) );
-               },
-
-               /** @inheritdoc **/
-               getContent: function () {
-                       return this.codeMirror.getValue();
-               },
-
-               /** @inheritdoc **/
-               onStageChanges: function () {
-                       this.$codeMirror.hide();
-                       EditorOverlay.prototype.onStageChanges.apply( this, 
arguments );
-               },
-
-               /** @inheritdoc **/
-               _hidePreview: function () {
-                       this.$codeMirror.show();
-                       this.codeMirror.refresh();
-                       EditorOverlay.prototype._hidePreview.apply( this, 
arguments );
-                       this.$content.hide();
-               }
-       } );
-
-       M.define( 'modules/editor/EditorOverlayCodeMirror', 
EditorOverlayCodeMirror );
-}( mw.mobileFrontend, jQuery ) );
diff --git a/resources/mobile.editor/init.js b/resources/mobile.editor/init.js
index 59dcd07..e1cf0c1 100644
--- a/resources/mobile.editor/init.js
+++ b/resources/mobile.editor/init.js
@@ -145,16 +145,8 @@
                         * @method
                         */
                        function loadSourceEditor() {
-                               var rlModuleName, moduleName;
-                               if ( mw.config.get( 'wgMFCodeMirror' ) && 
context.isAlphaGroupMember() ) {
-                                       moduleName = 
'modules/editor/EditorOverlayCodeMirror';
-                                       rlModuleName = 
'mobile.editor.overlay.codemirror';
-                               } else {
-                                       moduleName = 
'modules/editor/EditorOverlay';
-                                       rlModuleName = 'mobile.editor.overlay';
-                               }
-                               loader.loadModule( rlModuleName ).done( 
function () {
-                                       var EditorOverlay = M.require( 
moduleName );
+                               loader.loadModule( 'mobile.editor.overlay' 
).done( function () {
+                                       var EditorOverlay = M.require( 
'modules/editor/EditorOverlay' );
                                        result.resolve( new EditorOverlay( 
editorOptions ) );
                                } );
                        }

-- 
To view, visit https://gerrit.wikimedia.org/r/229399
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib015dd0bc94613c316d404f963bec48cd59b429f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to