Robmoen has uploaded a new change for review.

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


Change subject: Add editing and preview messages to header area
......................................................................

Add editing and preview messages to header area

Change-Id: I366e798a2101d873fabbe768721dbcc1f5b7ba6b
---
M includes/Resources.php
M javascripts/modules/editor/VisualEditorOverlay.js
M javascripts/modules/editor/editor.js
3 files changed, 15 insertions(+), 8 deletions(-)


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

diff --git a/includes/Resources.php b/includes/Resources.php
index 4f63913..058953f 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -265,6 +265,10 @@
                'templates' => array(
                        'modules/editor/VisualEditorOverlay',
                ),
+               'messages' => array(
+                       'mobile-frontend-editor-editing' => array( 'parse' ),
+                       'mobile-frontend-editor-previewing' => array( 'parse' ),
+               ),
        ),
 
        // FIXME: clean up when new overlays in stable (use single mobile.edit 
as before)
diff --git a/javascripts/modules/editor/VisualEditorOverlay.js 
b/javascripts/modules/editor/VisualEditorOverlay.js
index 8f255d8..08ebad0 100644
--- a/javascripts/modules/editor/VisualEditorOverlay.js
+++ b/javascripts/modules/editor/VisualEditorOverlay.js
@@ -20,6 +20,8 @@
                initialize: function( options ) {
                        var self = this;
                        this.hasChanged = false;
+                       options.editingMsg = mw.msg( 
'mobile-frontend-editor-editing', options.title );
+                       options.previewingMsg = mw.msg( 
'mobile-frontend-editor-previewing', options.title );
                        this._super( options );
                        this.$spinner = self.$( '.spinner' );
                        this.$continueBtn = self.$( '.continue' ).prop( 
'disabled', true );
diff --git a/javascripts/modules/editor/editor.js 
b/javascripts/modules/editor/editor.js
index dbae783..c968a46 100644
--- a/javascripts/modules/editor/editor.js
+++ b/javascripts/modules/editor/editor.js
@@ -49,7 +49,10 @@
                        // FIXME: clean up when new overlays in stable
                        var
                                LoadingOverlay = M.require( inStable ? 
'LoadingOverlay' : 'LoadingOverlayNew' ),
-                               loadingOverlay = new LoadingOverlay();
+                               loadingOverlay = new LoadingOverlay(),
+                               title = page ? page.title : mw.config.get( 
'wgTitle' ),
+                               // Note in current implementation Page title is 
prefixed with namespace
+                               ns = page ? '' : mw.config.get( 
'wgCanonicalNamespace' );
                        loadingOverlay.show();
                        sectionId = mw.config.get( 'wgPageContentModel' ) === 
'wikitext' ? parseInt( sectionId, 10 ) : null;
 
@@ -57,19 +60,17 @@
                        if ( isVisualEditorEnabled ) {
                                // Load VE init module
                                mw.loader.using( 'mobile.editor.ve', function 
() {
-                                       var VeOverlay = M.require( 
'modules/editor/VisualEditorOverlay' ),
-                                               ve = new VeOverlay( {
+                                       var VisualEditorOverlay = M.require( 
'modules/editor/VisualEditorOverlay' ),
+                                               visualEditorOverlay = new 
VisualEditorOverlay( {
+                                                       title: ns ? ns + ':' + 
title : title,
                                                        sectionId: sectionId
                                                } );
                                        loadingOverlay.hide();
-                                       ve.show();
+                                       visualEditorOverlay.show();
                                } );
                        } else {
                                mw.loader.using( inStable ? 
'mobile.editor.overlay.stable' : 'mobile.editor.overlay.beta', function() {
-                                       var EditorOverlay = M.require( inStable 
? 'modules/editor/EditorOverlay' : 'modules/editorNew/EditorOverlay' ),
-                                               title = page ? page.title : 
mw.config.get( 'wgTitle' ),
-                                               // Note in current 
implementation Page title is prefixed with namespace
-                                               ns = page ? '' : mw.config.get( 
'wgCanonicalNamespace' );
+                                       var EditorOverlay = M.require( inStable 
? 'modules/editor/EditorOverlay' : 'modules/editorNew/EditorOverlay' );
 
                                                loadingOverlay.hide();
                                                new EditorOverlay( {

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

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

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

Reply via email to