Florianschmidtwelzow has uploaded a new change for review.

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

Change subject: Improve Talk Overlay
......................................................................

Improve Talk Overlay

* Fix "close TalkOverlay when TalkSectionOverlay is closed" by call .show()
after TalkSectionOverlay or TalkSectionAddOverlay is closed.

* Added header to TalkSectionOverlay and TalkSectionAddOverlay to show
back instead of close button.

* Show Title of Talk as Title (of Overlay) in TalkSectionOverlay instead of
a seperate line.

* Use Named button in TalkSectionAddOverlay (like Editor) instead of image.

Bug: 64105
Change-Id: If76138eaa015607241bad2ec773d48cf2daf650a
---
M includes/Resources.php
M javascripts/modules/talk/TalkOverlay.js
M javascripts/modules/talk/TalkSectionAddOverlay.js
M javascripts/modules/talk/TalkSectionOverlay.js
R templates/modules/talk/talk.hogan
R templates/modules/talk/talkSection.hogan
R templates/modules/talk/talkSectionAdd.hogan
A templates/modules/talk/talkSectionAddHeader.hogan
A templates/modules/talk/talkSectionHeader.hogan
9 files changed, 49 insertions(+), 14 deletions(-)


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

diff --git a/includes/Resources.php b/includes/Resources.php
index d6e4d08..357ee9d 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -498,9 +498,11 @@
                ),
                'templates' => array(
                        // talk.js
-                       'overlays/talk.hogan',
-                       'overlays/talkSectionAdd.hogan',
-                       'talkSection.hogan',
+                       'modules/talk/talk.hogan',
+                       'modules/talk/talkSectionAdd.hogan',
+                       'modules/talk/talkSectionAddHeader.hogan',
+                       'modules/talk/talkSection.hogan',
+                       'modules/talk/talkSectionHeader.hogan',
                ),
                'messages' => array(
                        'mobile-frontend-talk-explained',
diff --git a/javascripts/modules/talk/TalkOverlay.js 
b/javascripts/modules/talk/TalkOverlay.js
index ad7ecb6..77772ec 100644
--- a/javascripts/modules/talk/TalkOverlay.js
+++ b/javascripts/modules/talk/TalkOverlay.js
@@ -10,7 +10,7 @@
                user = M.require( 'user' ),
                TalkOverlay = Overlay.extend( {
                        templatePartials: {
-                               content: M.template.get( 'overlays/talk.hogan' )
+                               content: M.template.get( 
'modules/talk/talk.hogan' )
                        },
                        defaults: {
                                addTopicLabel: mw.msg( 
'mobile-frontend-talk-add-overlay-submit' ),
@@ -57,7 +57,7 @@
                        },
                        postRender: function( options ) {
                                var $add = this.$( 'button.add' ),
-                                       page = options.page;
+                                       page = options.page, self = this;
 
                                this._super( options );
                                if ( !user.isAnon() ) {
@@ -66,6 +66,11 @@
                                                        title: options.title
                                                } );
                                                overlay.show();
+                                               overlay.on( 'hide', function() {
+                                                       // re-enable 
TalkOverlay (it's closed by hide event (in Overlay)
+                                                       // from 
TalkSectionAddOverlay)
+                                                       self.show();
+                                               } );
                                        } );
                                } else {
                                        $add.remove();
@@ -84,6 +89,10 @@
                                                        section: section
                                                } );
                                        childOverlay.show();
+                                       childOverlay.on( 'hide', function() {
+                                               // re-enable TalkOverlay (it's 
closed by hide event (in Overlay) from TalkSectionOverlay)
+                                               self.show();
+                                       } );
                                } );
                                if ( !$.trim( page.lead ) ) {
                                        this.$( '.lead-discussion' ).remove();
diff --git a/javascripts/modules/talk/TalkSectionAddOverlay.js 
b/javascripts/modules/talk/TalkSectionAddOverlay.js
index f4b793c..34f9de4 100644
--- a/javascripts/modules/talk/TalkSectionAddOverlay.js
+++ b/javascripts/modules/talk/TalkSectionAddOverlay.js
@@ -8,17 +8,15 @@
 
        TalkSectionAddOverlay = Overlay.extend( {
                defaults: {
-                       headerButtons: [
-                               { className: 'submit icon icon-submit 
confirm-save', msg: mw.msg( 'mobile-frontend-editor-continue' ) }
-                       ],
                        cancelMsg: mw.msg( 'mobile-frontend-editor-cancel' ),
                        confirmMsg: mw.msg( 'mobile-frontend-editor-save' ),
-                       heading: '<strong>' + mw.msg( 
'mobile-frontend-talk-add-overlay-submit' ) + '</strong>',
                        topicTitlePlaceHolder: mw.msg( 
'mobile-frontend-talk-add-overlay-subject-placeholder' ),
-                       topicContentPlaceHolder: mw.msg( 
'mobile-frontend-talk-add-overlay-content-placeholder' )
+                       topicContentPlaceHolder: mw.msg( 
'mobile-frontend-talk-add-overlay-content-placeholder' ),
+                       editingMsg: mw.msg( 
'mobile-frontend-talk-add-overlay-submit' )
                },
+               template: M.template.get( 'modules/talk/talkSectionAdd.hogan' ),
                templatePartials: {
-                       content: M.template.get( 
'overlays/talkSectionAdd.hogan' )
+                       header: M.template.get( 
'modules/talk/talkSectionAddHeader.hogan' )
                },
                initialize: function( options ) {
                        // If terms of use is enabled, include it in the 
licensing message
@@ -41,6 +39,7 @@
                postRender: function( options ) {
                        var self = this;
                        this._super( options );
+                       this.$( '.back' ).on( M.tapEvent( 'click' ), $.proxy( 
self, 'hide' ) );
                        this.confirm = this.$( 'button.confirm-save' );
                        this.confirm.on( 'click', function() {
                                if ( !$( this ).prop( 'disabled' ) ) {
diff --git a/javascripts/modules/talk/TalkSectionOverlay.js 
b/javascripts/modules/talk/TalkSectionOverlay.js
index b68c0e6..a4fafb1 100644
--- a/javascripts/modules/talk/TalkSectionOverlay.js
+++ b/javascripts/modules/talk/TalkSectionOverlay.js
@@ -5,8 +5,9 @@
        api = M.require( 'api' ),
        user = M.require( 'user' ),
        TalkSectionOverlay = Overlay.extend( {
+               template: M.template.get( 'modules/talk/talkSection.hogan' ),
                templatePartials: {
-                       content: M.template.get( 'talkSection.hogan' )
+                       header: M.template.get( 
'modules/talk/talkSectionHeader.hogan' ),
                },
                defaults: {
                        reply: mw.msg( 'mobile-frontend-talk-reply' ),
@@ -33,6 +34,7 @@
                        var self = this, $comment = this.$( '.comment' ),
                                $textarea = $comment.find( 'textarea' );
                        this._super( options );
+                       this.$( '.back' ).on( M.tapEvent( 'click' ), $.proxy( 
self, 'hide' ) );
                        this.$( '.loading' ).remove();
                        if ( user.isAnon() || !M.isAlphaGroupMember() ) {
                                $comment.remove();
diff --git a/templates/overlays/talk.hogan b/templates/modules/talk/talk.hogan
similarity index 100%
rename from templates/overlays/talk.hogan
rename to templates/modules/talk/talk.hogan
diff --git a/templates/talkSection.hogan 
b/templates/modules/talk/talkSection.hogan
similarity index 84%
rename from templates/talkSection.hogan
rename to templates/modules/talk/talkSection.hogan
index 98ecad3..0c2f7b5 100644
--- a/templates/talkSection.hogan
+++ b/templates/modules/talk/talkSection.hogan
@@ -1,6 +1,8 @@
-<div class="content talk-section">
-       <h2>{{section.line}}</h2>
+<div class="overlay-header-container position-fixed">
+       {{>header}}
+</div>
 
+<div class="content talk-section">
        {{{section.text}}}
        <div class="loading"></div>
        <div class="comment">
diff --git a/templates/overlays/talkSectionAdd.hogan 
b/templates/modules/talk/talkSectionAdd.hogan
similarity index 79%
rename from templates/overlays/talkSectionAdd.hogan
rename to templates/modules/talk/talkSectionAdd.hogan
index dbaaad9..c8c9727 100644
--- a/templates/overlays/talkSectionAdd.hogan
+++ b/templates/modules/talk/talkSectionAdd.hogan
@@ -1,3 +1,7 @@
+<div class="overlay-header-container position-fixed">
+       {{>header}}
+</div>
+
 <div class="save-panel panel">
        <p class="license">{{{licenseMsg}}}</p>
 </div>
diff --git a/templates/modules/talk/talkSectionAddHeader.hogan 
b/templates/modules/talk/talkSectionAddHeader.hogan
new file mode 100644
index 0000000..06fcecb
--- /dev/null
+++ b/templates/modules/talk/talkSectionAddHeader.hogan
@@ -0,0 +1,9 @@
+<div class="overlay-header initial-header hideable">
+       <ul>
+               <li><button class="back icon 
icon-back">{{closeMsg}}</button></li>
+       </ul>
+       <div class="overlay-title">
+               <h2>{{editingMsg}}</h2>
+       </div>
+       <div class="overlay-action"><button class="submit 
confirm-save">{{confirmMsg}}</button></div>
+</div>
diff --git a/templates/modules/talk/talkSectionHeader.hogan 
b/templates/modules/talk/talkSectionHeader.hogan
new file mode 100644
index 0000000..0fe27a3
--- /dev/null
+++ b/templates/modules/talk/talkSectionHeader.hogan
@@ -0,0 +1,8 @@
+<div class="overlay-header initial-header hideable">
+       <ul>
+               <li><button class="back icon 
icon-back">{{closeMsg}}</button></li>
+       </ul>
+       <div class="overlay-title">
+               <h2>{{section.line}}</h2>
+       </div>
+</div>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If76138eaa015607241bad2ec773d48cf2daf650a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.wel...@t-online.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to