Jdlrobson has uploaded a new change for review.

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

Change subject: When a user clicks on hamburger after adding to a collection 
show new icon
......................................................................

When a user clicks on hamburger after adding to a collection show new icon

Bug: T95245
Change-Id: I463dbca33da62d12fc0ec9ccd3340109f5b67c6f
---
M includes/Gather.hooks.php
M resources/Resources.php
M resources/ext.gather.init/init.js
A resources/ext.gather.watchstar/Tag.hogan
A resources/ext.gather.watchstar/Tag.js
A resources/ext.gather.watchstar/images/tag.svg
A resources/ext.gather.watchstar/tag.less
7 files changed, 49 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather 
refs/changes/15/203215/1

diff --git a/includes/Gather.hooks.php b/includes/Gather.hooks.php
index 8d00199..5430eec 100644
--- a/includes/Gather.hooks.php
+++ b/includes/Gather.hooks.php
@@ -106,7 +106,7 @@
                                                                'text' => 
wfMessage( 'gather-lists-title' )->escaped(),
                                                                'href' => 
SpecialPage::getTitleFor( 'Gather' )->getLocalURL(),
                                                                // FIXME: 
Temporarily watchlist icon
-                                                               'class' => 
CSS::iconClass( 'collections-icon', 'before' ),
+                                                               'class' => 
CSS::iconClass( 'collections-icon', 'before', 'collection-menu-item' ),
                                                                
'data-event-name' => 'collections',
                                                        ),
                                                ),
diff --git a/resources/Resources.php b/resources/Resources.php
index 6d3d750..403802a 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -135,6 +135,7 @@
                ),
                'styles' => array(
                        'ext.gather.watchstar/contentOverlay.less',
+                       'ext.gather.watchstar/tag.less',
                ),
                'messages' => array(
                        'gather-remove-from-collection-failed-toast',
@@ -161,11 +162,13 @@
                'templates' => array(
                        'star.hogan' => 'ext.gather.watchstar/star.hogan',
                        'content.hogan' => 'ext.gather.watchstar/content.hogan',
+                       'Tag.hogan' => 'ext.gather.watchstar/Tag.hogan',
                ),
                'scripts' => array(
                        'ext.gather.watchstar/CollectionsContentOverlay.js',
                        'ext.gather.watchstar/CollectionsWatchstar.js',
                        'ext.gather.watchstar/WatchstarPageActionOverlay.js',
+                       'ext.gather.watchstar/Tag.js',
                ),
        ),
 
diff --git a/resources/ext.gather.init/init.js 
b/resources/ext.gather.init/init.js
index 50196e6..7a21376 100644
--- a/resources/ext.gather.init/init.js
+++ b/resources/ext.gather.init/init.js
@@ -4,6 +4,7 @@
        var CollectionsWatchstar = M.require( 
'ext.gather.watchstar/CollectionsWatchstar' ),
                PageActionOverlay = M.require( 
'modules/tutorials/PageActionOverlay' ),
                WatchstarPageActionOverlay = M.require( 
'ext.gather.watchstar/WatchstarPageActionOverlay' ),
+               Tag = M.require( 'ext.gather.watchstar/Tag' ),
                settings = M.require( 'settings' ),
                settingOverlayWasDismissed = 'gather-has-dismissed-tutorial',
                user = M.require( 'user' ),
@@ -98,7 +99,7 @@
                }
                if ( shouldShowCollectionTutorial() ) {
                        watchstar.on( 'completed', function ( firstTimeUser ) {
-                               var p;
+                               var p, tag;
                                if ( firstTimeUser ) {
                                        // FIXME: Rename pointer overlay?
                                        p = new PageActionOverlay( {
@@ -107,6 +108,8 @@
                                                cancelMsg: mw.msg( 
'gather-add-to-collection-cancel' )
                                        } );
                                        p.show();
+                                       // FIXME: Hacky.. Should use MainMenu 
but Bug: T93257.
+                                       tag = new Tag( { label: 'new' } 
).appendTo( '#mw-mf-page-left .collection-menu-item' );
                                }
                        } );
                }
diff --git a/resources/ext.gather.watchstar/Tag.hogan 
b/resources/ext.gather.watchstar/Tag.hogan
new file mode 100644
index 0000000..21f81c8
--- /dev/null
+++ b/resources/ext.gather.watchstar/Tag.hogan
@@ -0,0 +1 @@
+{{label}}
diff --git a/resources/ext.gather.watchstar/Tag.js 
b/resources/ext.gather.watchstar/Tag.js
new file mode 100644
index 0000000..83bdf48
--- /dev/null
+++ b/resources/ext.gather.watchstar/Tag.js
@@ -0,0 +1,19 @@
+// jscs:disable requireCamelCaseOrUpperCaseIdentifiers
+( function ( M ) {
+
+       var Tag,
+               user = M.require( 'user' ),
+               View = M.require( 'View' );
+
+       /**
+        * A tag with a label
+        * @class Tag
+        * @extends View
+        */
+       Tag = View.extend( {
+               className: 'gather-tag',
+               template: mw.template.get( 'ext.gather.watchstar', 'Tag.hogan' 
),
+       } );
+       M.define( 'ext.gather.watchstar/Tag', Tag );
+
+}( mw.mobileFrontend ) );
diff --git a/resources/ext.gather.watchstar/images/tag.svg 
b/resources/ext.gather.watchstar/images/tag.svg
new file mode 100644
index 0000000..f7bcd84
--- /dev/null
+++ b/resources/ext.gather.watchstar/images/tag.svg
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        viewBox="0 0 71.6 27" enable-background="new 0 0 71.6 27" 
xml:space="preserve">
+<path fill="#00AF89" 
d="M69.1,26.6H9.3c-1,0-2.3-0.7-2.8-1.6l-5.6-9.9c-0.5-0.9-0.5-2.4,0-3.2L6.6,2c0.5-0.9,1.8-1.6,2.8-1.6h59.8
+       c1,0,1.9,0.8,1.9,1.9v22.4C71,25.7,70.1,26.6,69.1,26.6z"/>
+</svg>
diff --git a/resources/ext.gather.watchstar/tag.less 
b/resources/ext.gather.watchstar/tag.less
new file mode 100644
index 0000000..c0531f8
--- /dev/null
+++ b/resources/ext.gather.watchstar/tag.less
@@ -0,0 +1,13 @@
+@import "mediawiki.mixins";
+
+.gather-tag {
+       .background-image('images/tag.svg');
+       background-position: left center;
+       background-repeat: no-repeat;
+       .background-size( auto, 100% );
+       float: right;
+       font-size: 0.8em;
+       margin-top: 0.2em;
+       padding: 0 5px 0 10px;
+       position: relative;
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I463dbca33da62d12fc0ec9ccd3340109f5b67c6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

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

Reply via email to