jenkins-bot has submitted this change and it was merged.

Change subject: Fix mobile getting no-JS experience
......................................................................


Fix mobile getting no-JS experience

* Make sure modules are marked for mobile support.  For now, this
  doesn't actually enable VE on mobile, but it makes sure
  the editor loads and rejects it in isSupported.

* Fix an issue that exposed with $usesWikitext.

Bug: T100101
Change-Id: I89daed7db660a86bd953604c767cce69826c2490
---
M Resources.php
M modules/editor/editors/ext.flow.editors.none.js
M modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js
3 files changed, 13 insertions(+), 7 deletions(-)

Approvals:
  Sbisson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Resources.php b/Resources.php
index 314bd39..de03a2b 100644
--- a/Resources.php
+++ b/Resources.php
@@ -491,12 +491,14 @@
                ),
        ),
 
+       // Actual VE is currently not supported on mobile since we use the 
desktop target, but we still
+       // need this part to load (and reject it in isSupported)
        'ext.flow.editors.visualeditor' => $flowResourceTemplate + array(
                'scripts' => 
'editor/editors/visualeditor/ext.flow.editors.visualeditor.js',
                'dependencies' => array(
                        // ve dependencies will be loaded via JS
                ),
-       ),
+       ) + $mobile,
 
        // This integrates with core mediawiki.messagePoster, and the module 
name
        // must be exactly this.
diff --git a/modules/editor/editors/ext.flow.editors.none.js 
b/modules/editor/editors/ext.flow.editors.none.js
index 7ec8357..ed20e51 100644
--- a/modules/editor/editors/ext.flow.editors.none.js
+++ b/modules/editor/editors/ext.flow.editors.none.js
@@ -144,18 +144,18 @@
                var $preview, $usesWikitext, $controls, templateArgs,
                        board = mw.flow.getPrototypeMethod( 'board', 
'getInstanceByElement' )( this.$node );
 
+               $usesWikitext = $( '<div>' )
+                       .html( mw.message( 
'flow-wikitext-editor-help-uses-wikitext' ).parse() )
+                       .find( 'a' )
+                       .attr( 'target', '_blank' )
+                       .end();
+
                if ( mw.flow.editors.visualeditor.static.isSupported() ) {
                        $preview = $( '<a>' ).attr( {
                                href: '#',
                                'data-flow-interactive-handler': 'switchEditor',
                                'data-flow-target': '< form textarea'
                        } ).text( mw.message( 
'flow-wikitext-editor-help-preview-the-result' ).text() );
-
-                       $usesWikitext = $( '<div>' )
-                               .html( mw.message( 
'flow-wikitext-editor-help-uses-wikitext' ).parse() )
-                               .find( 'a' )
-                                       .attr( 'target', '_blank' )
-                               .end();
 
                        templateArgs = {
                                enable_switcher: true,
diff --git 
a/modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js 
b/modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js
index d223574..35ac6df 100644
--- a/modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js
+++ b/modules/editor/editors/visualeditor/ext.flow.editors.visualeditor.js
@@ -187,7 +187,11 @@
        // Static methods
 
        mw.flow.editors.visualeditor.static.isSupported = function () {
+               var isMobileTarget = ( mw.config.get( 'skin' ) === 'minerva' );
+
                return !!(
+                       !isMobileTarget &&
+
                        // ES5 support, from es5-skip.js
                        ( function () {
                                // This test is based on 'use strict',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I89daed7db660a86bd953604c767cce69826c2490
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Mooeypoo <[email protected]>
Gerrit-Reviewer: Sbisson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to