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

Change subject: Use a toolbar for the actions buttons in 
ve.init.mw.ViewPageTarget
......................................................................


Use a toolbar for the actions buttons in ve.init.mw.ViewPageTarget

Change-Id: I260059802379d8cab8ca175b7d7d32813e3ff10a
---
M VisualEditor.php
M modules/oojs-ui/styles/OO.ui.Toolbar.css
M modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-apex.css
M modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-vector.css
M modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css
M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
M modules/ve-mw/init/ve.init.mw.Target.js
M modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb
M modules/ve-mw/ui/tools/ve.ui.MWDialogTool.js
A modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
M modules/ve/ui/styles/ve.ui.SurfaceToolbar.css
M modules/ve/ui/styles/ve.ui.Widget.css
12 files changed, 257 insertions(+), 186 deletions(-)

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



diff --git a/VisualEditor.php b/VisualEditor.php
index 741d3dd..8640eb9 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -573,6 +573,7 @@
 
                        've-mw/ui/tools/ve.ui.MWFormatTool.js',
                        've-mw/ui/tools/ve.ui.MWDialogTool.js',
+                       've-mw/ui/tools/ve.ui.MWPopupTool.js',
 
                        've/ui/inspectors/ve.ui.AnnotationInspector.js',
                        've/ui/inspectors/ve.ui.LinkInspector.js',
diff --git a/modules/oojs-ui/styles/OO.ui.Toolbar.css 
b/modules/oojs-ui/styles/OO.ui.Toolbar.css
index 30ae725..f4dee72 100644
--- a/modules/oojs-ui/styles/OO.ui.Toolbar.css
+++ b/modules/oojs-ui/styles/OO.ui.Toolbar.css
@@ -20,14 +20,17 @@
        line-height: 1em;
 }
 
+.oo-ui-toolbar-bar .oo-ui-toolbar-bar {
+       border: none;
+       background: none;
+}
+
 .oo-ui-toolbar-bottom .oo-ui-toolbar-bar {
        position: absolute;
 }
 
 .oo-ui-toolbar-actions {
        float: right;
-       padding: 0.25em;
-       font-size: 0.8em;
 }
 
 .oo-ui-toolbar-tools {
diff --git a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-apex.css 
b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-apex.css
index 9d247d4..c4e8f32 100644
--- a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-apex.css
+++ b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-apex.css
@@ -16,7 +16,6 @@
 }
 
 .ve-init-mw-viewPageTarget-toolbar .oo-ui-toolbar-bar {
-       display: none;
        line-height: 1.5em;
 }
 
diff --git a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-vector.css 
b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-vector.css
index c2b407c..33a8788 100644
--- a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-vector.css
+++ b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-vector.css
@@ -27,10 +27,6 @@
        position: relative;
 }
 
-.ve-init-mw-viewPageTarget-toolbar .oo-ui-toolbar-bar {
-       display: none;
-}
-
 .ve-ui-surface-overlay-global {
        z-index: 101; /* #p-personal is z-index 100 in vector :( */
 }
diff --git a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css 
b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css
index c4f6ab1..4002375 100644
--- a/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css
+++ b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget.css
@@ -40,8 +40,14 @@
        vertical-align: middle;
 }
 
-.ve-init-mw-viewPageTarget-toolbar-utilites {
-       margin-right: 1em;
+.ve-init-mw-viewPageTarget-toolbar-actions {
+       font-size: 0.8em;
+       vertical-align: top;
+       padding: 0.25em;
+}
+
+.ve-init-mw-viewPageTarget-toolbar-utilites .ve-ui-toolbar-bar {
+       border: none;
 }
 
 .ve-init-mw-viewPageTarget-toolbar-utilites > .oo-ui-iconButtonWidget {
@@ -88,8 +94,8 @@
        text-decoration: underline;
 }
 
-.ve-init-mw-viewPageTarget-editNotices,
-.ve-init-mw-viewPageTarget-betaNotices {
+.ve-ui-mwNoticesPopupTool-items,
+.ve-ui-mwHelpPopupTool-items {
        padding: 0.5em 1em;
 }
 
@@ -98,19 +104,19 @@
        z-index: 4;
 }
 
-.ve-init-mw-viewPageTarget-editNotices-notice:not(:first-child),
-.ve-init-mw-viewPageTarget-betaNotices-notice:not(:first-child) {
+.ve-ui-mwNoticesPopupTool-items > div:not(:first-child),
+.ve-ui-mwHelpPopupTool-item:not(:first-child) {
        border-top: solid 1px #ddd;
        padding-top: 0.8em;
        margin-top: 0.8em;
 }
 
-.ve-init-mw-viewPageTarget-betaNotices-notice > .oo-ui-iconButtonWidget {
+.ve-ui-mwHelpPopupTool-item > .oo-ui-iconButtonWidget {
        display: block;
        margin: 0.5em 0;
 }
 
-.ve-init-mw-viewPageTarget-betaNotices-notice > 
.oo-ui-iconButtonWidget:first-child {
+.ve-ui-mwHelpPopupTool-item > .oo-ui-iconButtonWidget:first-child {
        margin-top: 0;
 }
 
diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
index b34dfa0..1191931 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
@@ -35,13 +35,6 @@
        this.toolbarCancelButton = null;
        this.toolbarSaveButton = null;
        this.saveDialog = null;
-       this.toolbarEditNoticesButton = null;
-       this.toolbarEditNotices = null;
-       this.toolbarBetaNoticesButton = null;
-       this.toolbarBetaNotices = null;
-       this.toolbarHelpButton = null;
-       this.toolbarFeedbackButton = null;
-       this.toolbarMetaButton = null;
        this.onBeforeUnloadFallback = null;
        this.onBeforeUnloadHandler = null;
        this.active = false;
@@ -235,8 +228,6 @@
                this.setUpSurface( doc, ve.bind( function() {
                        this.startSanityCheck();
                        this.setupToolbarButtons();
-                       this.setupToolbarEditNotices();
-                       this.setupToolbarBetaNotices();
                        this.setupSaveDialog();
                        this.attachToolbarButtons();
                        this.restoreScrollPosition();
@@ -667,25 +658,6 @@
 };
 
 /**
- * Handle clicks on the feedback tool in the toolbar.
- *
- * @method
- * @param {jQuery.Event} e Mouse click event
- */
-ve.init.mw.ViewPageTarget.prototype.onToolbarFeedbackToolClick = function () {
-       this.toolbarBetaNotices.hide();
-       if ( !this.feedback ) {
-               // This can't be constructed until the editor has loaded as it 
uses special messages
-               this.feedback = new mw.Feedback( {
-                       'title': new mw.Title( ve.msg( 
'visualeditor-feedback-link' ) ),
-                       'bugsLink': new mw.Uri( 
'https://bugzilla.wikimedia.org/enter_bug.cgi?product=VisualEditor&component=General'
 ),
-                       'bugsListLink': new mw.Uri( 
'https://bugzilla.wikimedia.org/buglist.cgi?query_format=advanced&resolution=---&resolution=LATER&resolution=DUPLICATE&product=VisualEditor&list_id=166234'
 )
-               } );
-       }
-       this.feedback.launch();
-};
-
-/**
  * Clear the diff in the save dialog.
  *
  * This method is bound to the 'transact' event on the document model, and 
unbinds itself the first
@@ -869,76 +841,6 @@
                        }
                } );
        return options;
-};
-
-/**
- * Set up the list of edit notices.
- *
- * @method
- */
-ve.init.mw.ViewPageTarget.prototype.setupToolbarEditNotices = function () {
-       var key,
-               $notices = $( '<div>' );
-
-       for ( key in this.editNotices ) {
-               $notices.append( this.editNotices[key] );
-       }
-       $notices
-               .addClass( 've-init-mw-viewPageTarget-editNotices' )
-               .find( 'a' ).attr( 'target', '_blank' );
-
-       this.toolbarEditNotices = this.toolbarEditNoticesButton.getPopup();
-       this.toolbarEditNotices.$body.empty().append( $notices );
-};
-
-/**
- * Set up the beta notices panel.
- *
- * @method
- * @returns {string[]} HTML strings for each edit notice
- */
-ve.init.mw.ViewPageTarget.prototype.setupToolbarBetaNotices = function () {
-       var $notices = $( '<div>' );
-
-       $notices
-               .addClass( 've-init-mw-viewPageTarget-betaNotices' )
-               .append(
-                       $( '<div>' )
-                               .addClass( 
've-init-mw-viewPageTarget-betaNotices-notice' )
-                               .text( ve.msg( 'visualeditor-beta-warning' ) )
-               )
-               .append(
-                       $( '<div>' )
-                               .addClass( 
've-init-mw-viewPageTarget-betaNotices-notice' )
-                               .append( this.toolbarHelpButton.$ )
-                               .append( this.toolbarFeedbackButton.$ )
-               );
-
-       if ( ve.version.id !== false ) {
-               $notices
-                       .append( $( '<div>' )
-                               .addClass( 
've-init-mw-viewPageTarget-betaNotices-notice' )
-                               .append( $( '<span>' )
-                                       .addClass( 
've-init-mw-ViewPageTarget-version-label' )
-                                       .text( ve.msg( 
'visualeditor-version-label' ) )
-                               )
-                               .append( ' ' )
-                               .append( $( '<a>' )
-                                       .addClass( 
've-init-mw-ViewPageTarget-version-link' )
-                                       .attr( 'target', '_blank' )
-                                       .attr( 'href', ve.version.url )
-                                       .text( ve.version.id )
-                               )
-                               .append( ' ' )
-                               .append( $( '<span>' )
-                                       .addClass( 
've-init-mw-ViewPageTarget-version-date' )
-                                       .text( ve.version.dateString )
-                               )
-                       );
-       }
-
-       this.toolbarBetaNotices = this.toolbarBetaNoticesButton.getPopup();
-       this.toolbarBetaNotices.$body.empty().append( $notices );
 };
 
 /**
@@ -1153,8 +1055,6 @@
  * @method
  */
 ve.init.mw.ViewPageTarget.prototype.setupToolbarButtons = function () {
-       var editNoticeCount = ve.getObjectKeys( this.editNotices ).length;
-
        this.toolbarCancelButton = new OO.ui.PushButtonWidget( { 'label': 
ve.msg( 'visualeditor-toolbar-cancel' ) } );
        this.toolbarCancelButton.$.addClass( 've-ui-toolbar-cancelButton' );
        this.toolbarSaveButton = new OO.ui.PushButtonWidget( {
@@ -1169,53 +1069,6 @@
 
        this.toolbarCancelButton.connect( this, { 'click': 
'onToolbarCancelButtonClick' } );
        this.toolbarSaveButton.connect( this, { 'click': 
'onToolbarSaveButtonClick' } );
-
-       this.toolbarMetaButton = new OO.ui.IconButtonWidget( {
-               'icon': 'settings',
-               'label': ve.msg( 'visualeditor-meta-tool' )
-       } );
-       this.toolbarMetaButton.connect( this, { 'click': 
'onToolbarMetaButtonClick' } );
-
-       this.toolbarEditNoticesButton = new OO.ui.PopupButtonWidget( {
-               'icon': 'alert',
-               'popup': {
-                       'label': ve.msg( 'visualeditor-editnotices-tool', 
editNoticeCount ),
-                       'head': true
-               }
-       } );
-
-       // Either keep the button shown and show the popup as well, or hide the 
button itself
-       // entirely (so that when it is attached later #attachToolbarButtons it 
will not be visible).
-       if ( editNoticeCount ) {
-               setTimeout( ve.bind( function () {
-                       this.toolbarEditNoticesButton.showPopup();
-               }, this ), 500 );
-       } else {
-               this.toolbarEditNoticesButton.$.hide();
-       }
-
-       this.toolbarBetaNoticesButton = new OO.ui.PopupButtonWidget( {
-               'icon': 'help',
-               'popup': {
-                       'label': ve.msg( 'visualeditor-help-tool' ),
-                       'head': true
-               }
-       } );
-       this.toolbarBetaNoticesButton.$label.addClass( 
've-init-mw-viewPageTarget-tool-beta-label' );
-
-       this.toolbarHelpButton = new OO.ui.IconButtonWidget( {
-               'icon': 'help',
-               'title': ve.msg( 'visualeditor-help-title' ),
-               'href': new mw.Title( ve.msg( 'visualeditor-help-link' ) 
).getUrl(),
-               'target': '_blank',
-               'label': ve.msg( 'visualeditor-help-label' )
-       } );
-
-       this.toolbarFeedbackButton = new OO.ui.IconButtonWidget( {
-               'icon': 'comment',
-               'label': ve.msg( 'visualeditor-feedback-tool' )
-       } );
-       this.toolbarFeedbackButton.connect( this, { 'click': 
'onToolbarFeedbackToolClick' } );
 };
 
 /**
@@ -1226,10 +1079,6 @@
 ve.init.mw.ViewPageTarget.prototype.tearDownToolbarButtons = function () {
        this.toolbarCancelButton.disconnect( this );
        this.toolbarSaveButton.disconnect( this );
-       this.toolbarMetaButton.disconnect( this );
-       this.toolbarFeedbackButton.disconnect( this );
-       this.toolbarEditNotices.$body.empty();
-       this.toolbarBetaNotices.$body.empty();
 };
 
 /**
@@ -1238,16 +1087,15 @@
  * @method
  */
 ve.init.mw.ViewPageTarget.prototype.attachToolbarButtons = function () {
-       var $iconButtons = $( '<div>' ),
-               $pushButtons = $( '<div>' );
+       var $actionTools = $( '<div>' ),
+               $pushButtons = $( '<div>' ),
+               actions = new ve.ui.TargetToolbar( this, this.surface );
 
-       $iconButtons
+       actions.setup( [ { 'include': [ 'help', 'notices', 'meta' ] } ] );
+
+       $actionTools
                .addClass( 've-init-mw-viewPageTarget-toolbar-utilites' )
-               .append(
-                       this.toolbarBetaNoticesButton.$,
-                       this.toolbarEditNoticesButton.$,
-                       this.toolbarMetaButton.$
-               );
+               .append( actions.$ );
 
        $pushButtons
                .addClass( 've-init-mw-viewPageTarget-toolbar-actions' )
@@ -1256,7 +1104,7 @@
                        this.toolbarSaveButton.$
                );
 
-       this.toolbar.$actions.append( $iconButtons, $pushButtons );
+       this.toolbar.$actions.append( $actionTools, $pushButtons );
 };
 
 /**
@@ -1267,11 +1115,6 @@
 ve.init.mw.ViewPageTarget.prototype.detachToolbarButtons = function () {
        this.toolbarCancelButton.$.detach();
        this.toolbarSaveButton.$.detach();
-       this.toolbarMetaButton.$.detach();
-       this.toolbarHelpButton.$.detach();
-       this.toolbarFeedbackButton.$.detach();
-       this.toolbarBetaNoticesButton.$.detach();
-       this.toolbarEditNoticesButton.$.detach();
        this.toolbar.$actions.empty();
 };
 
@@ -1310,8 +1153,6 @@
  * @method
  */
 ve.init.mw.ViewPageTarget.prototype.showSaveDialog = function () {
-       this.toolbarBetaNotices.hide();
-       this.toolbarEditNotices.hide();
        this.saveDialog.setSanityCheck( this.sanityCheckVerified );
        this.saveDialog.swapPanel( 'save' );
        this.surface.getDialogs().open( 'mwSave' );
diff --git a/modules/ve-mw/init/ve.init.mw.Target.js 
b/modules/ve-mw/init/ve.init.mw.Target.js
index 7438a4f..d8ce21a 100644
--- a/modules/ve-mw/init/ve.init.mw.Target.js
+++ b/modules/ve-mw/init/ve.init.mw.Target.js
@@ -233,7 +233,6 @@
 
        for ( i = 0, len = noticeHtmls.length; i < len; i++ ) {
                el = $( '<div>' )
-                       .addClass( 
've-init-mw-viewPageTarget-editNotices-notice' )
                        .html( noticeHtmls[i] )
                        .get( 0 );
 
@@ -728,3 +727,12 @@
                .fail( ve.bind( ve.init.mw.Target.onSerializeError, this ) );
        return true;
 };
+
+/**
+ * Get list of edit notices.
+ *
+ * @returns {Object|null} List of edit notices or null if none are loaded
+ */
+ve.init.mw.Target.prototype.getEditNotices = function () {
+       return this.editNotices;
+};
diff --git 
a/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb 
b/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb
index ae92a86..3eff9e6 100644
--- a/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb
+++ b/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb
@@ -15,7 +15,7 @@
   a(:increase_indentation_on, title: 'Increase indentation [TAB]')
   div(:insert_references, class: 'oo-ui-window-title')
   span(:internal_linksuggestion, text: 'Main Page')
-  div(:ip_warning, class: 've-init-mw-viewPageTarget-editNotices-notice')
+  div(:ip_warning, class: 've-ui-mwNoticesPopupTool-item')
   span(:linksuggestion, text: 'http://www.example.com')
   span(:looks_good, class: 'oo-ui-labeledElement-label', text: 'Looks good to 
me')
   span(:more_menu, text: 'More')
diff --git a/modules/ve-mw/ui/tools/ve.ui.MWDialogTool.js 
b/modules/ve-mw/ui/tools/ve.ui.MWDialogTool.js
index 52d88ba..fb914de 100644
--- a/modules/ve-mw/ui/tools/ve.ui.MWDialogTool.js
+++ b/modules/ve-mw/ui/tools/ve.ui.MWDialogTool.js
@@ -114,3 +114,23 @@
 ve.ui.MWTransclusionDialogTool.static.modelClasses = [ 
ve.dm.MWTransclusionNode ];
 ve.ui.toolFactory.register( ve.ui.MWTransclusionDialogTool );
 
+/**
+ * MediaWiki UserInterface categories tool.
+ *
+ * @class
+ * @extends ve.ui.DialogTool
+ * @constructor
+ * @param {OO.ui.Toolbar} toolbar
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.MWMetaDialogTool = function VeUiMWMetaDialogTool( toolbar, config ) {
+       ve.ui.DialogTool.call( this, toolbar, config );
+};
+OO.inheritClass( ve.ui.MWMetaDialogTool, ve.ui.DialogTool );
+ve.ui.MWMetaDialogTool.static.name = 'meta';
+ve.ui.MWMetaDialogTool.static.group = 'utility';
+ve.ui.MWMetaDialogTool.static.icon = 'settings';
+ve.ui.MWMetaDialogTool.static.titleMessage = 'visualeditor-meta-tool';
+ve.ui.MWMetaDialogTool.static.dialog = 'meta';
+ve.ui.MWMetaDialogTool.static.autoAdd = false;
+ve.ui.toolFactory.register( ve.ui.MWMetaDialogTool );
diff --git a/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js 
b/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
new file mode 100644
index 0000000..84d6831
--- /dev/null
+++ b/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
@@ -0,0 +1,197 @@
+/*global mw */
+
+/*!
+ * VisualEditor MediaWiki UserInterface popup tool classes.
+ *
+ * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * MediaWiki UserInterface notices popup tool.
+ *
+ * @class
+ * @extends OO.ui.PopupTool
+ * @constructor
+ * @param {OO.ui.ToolGroup} toolGroup Tool group. Must belong to a 
ve.ui.TargetToolbar
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.MWNoticesPopupTool = function VeUiMWNoticesPopupTool( toolGroup, config 
) {
+       var key,
+               items = toolGroup.getToolbar().getTarget().getEditNotices(),
+               count = ve.getObjectKeys( items ).length,
+               title = ve.msg( 'visualeditor-editnotices-tool', count );
+
+       // Configuration initialization
+
+       config = ve.extendObject( true, { 'popup': { 'head': true, 'label': 
title } }, config );
+
+       // Parent constructor
+       OO.ui.PopupTool.call( this, toolGroup, config );
+
+       // Properties
+       this.$items = this.$$( '<div>' );
+
+       // Initialization
+       for ( key in items ) {
+               this.$items.append( items[key] );
+       }
+       this.$items
+               .addClass( 've-ui-mwNoticesPopupTool-items' )
+               .children()
+                       .addClass( 've-ui-mwNoticesPopupTool-item' )
+                       .find( 'a' )
+                               .attr( 'target', '_blank' );
+       this.popup.$body.append( this.$items );
+
+       // Automatically show/hide
+       if ( count ) {
+               setTimeout( ve.bind( function () {
+                       this.showPopup();
+               }, this ), 500 );
+       } else {
+               this.$.hide();
+       }
+};
+
+/* Inheritance */
+
+OO.inheritClass( ve.ui.MWNoticesPopupTool, OO.ui.PopupTool );
+
+/* Static Properties */
+
+ve.ui.MWNoticesPopupTool.static.name = 'notices';
+ve.ui.MWNoticesPopupTool.static.group = 'utility';
+ve.ui.MWNoticesPopupTool.static.icon = 'alert';
+ve.ui.MWNoticesPopupTool.static.titleMessage = 'visualeditor-editnotices-tool';
+ve.ui.MWNoticesPopupTool.static.autoAdd = false;
+
+/* Methods */
+
+/**
+ * Get the tool title.
+ *
+ * @inheritdoc
+ */
+ve.ui.MWNoticesPopupTool.prototype.getTitle = function () {
+       var items = this.toolbar.getTarget().getEditNotices(),
+               count = ve.getObjectKeys( items ).length;
+
+       return ve.msg( this.constructor.static.titleMessage, count );
+};
+
+/* Registration */
+
+ve.ui.toolFactory.register( ve.ui.MWNoticesPopupTool );
+
+/**
+ * MediaWiki UserInterface help popup tool.
+ *
+ * @class
+ * @extends OO.ui.PopupTool
+ * @constructor
+ * @param {OO.ui.ToolGroup} toolGroup
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.MWHelpPopupTool = function VeUiMWHelpPopupTool( toolGroup, config ) {
+       var title = ve.msg( 'visualeditor-help-tool' );
+
+       // Configuration initialization
+       config = ve.extendObject( true, { 'popup': { 'head': true, 'label': 
title } }, config );
+
+       // Parent constructor
+       OO.ui.PopupTool.call( this, toolGroup, config );
+
+       // Properties
+       this.$items = this.$$( '<div>' );
+       this.feedback = null;
+       this.helpButton = new OO.ui.IconButtonWidget( {
+               'icon': 'help',
+               'title': ve.msg( 'visualeditor-help-title' ),
+               'href': new mw.Title( ve.msg( 'visualeditor-help-link' ) 
).getUrl(),
+               'target': '_blank',
+               'label': ve.msg( 'visualeditor-help-label' )
+       } );
+       this.feedbackButton = new OO.ui.IconButtonWidget( {
+               'icon': 'comment',
+               'label': ve.msg( 'visualeditor-feedback-tool' )
+       } );
+
+       // Events
+       this.feedbackButton.connect( this, { 'click': 'onFeedbackClick' } );
+
+       // Initialization
+       this.$items
+               .addClass( 've-ui-mwHelpPopupTool-items' )
+               .append(
+                       this.$$( '<div>' )
+                               .addClass( 've-ui-mwHelpPopupTool-item' )
+                               .text( ve.msg( 'visualeditor-beta-warning' ) )
+               )
+               .append(
+                       this.$$( '<div>' )
+                               .addClass( 've-ui-mwHelpPopupTool-item' )
+                               .append( this.helpButton.$ )
+                               .append( this.feedbackButton.$ )
+               );
+       if ( ve.version.id !== false ) {
+               this.$items
+                       .append( this.$$( '<div>' )
+                               .addClass( 've-ui-mwHelpPopupTool-item' )
+                               .append( this.$$( '<span>' )
+                                       .addClass( 
've-ui-mwHelpPopupTool-version-label' )
+                                       .text( ve.msg( 
'visualeditor-version-label' ) )
+                               )
+                               .append( ' ' )
+                               .append( this.$$( '<a>' )
+                                       .addClass( 
've-ui-mwHelpPopupTool-version-link' )
+                                       .attr( 'target', '_blank' )
+                                       .attr( 'href', ve.version.url )
+                                       .text( ve.version.id )
+                               )
+                               .append( ' ' )
+                               .append( this.$$( '<span>' )
+                                       .addClass( 
've-ui-mwHelpPopupTool-version-date' )
+                                       .text( ve.version.dateString )
+                               )
+                       );
+       }
+       this.$items.find( 'a' ).attr( 'target', '_blank' );
+       this.popup.$body.append( this.$items );
+};
+
+/* Inheritance */
+
+OO.inheritClass( ve.ui.MWHelpPopupTool, OO.ui.PopupTool );
+
+/* Static Properties */
+
+ve.ui.MWHelpPopupTool.static.name = 'help';
+ve.ui.MWHelpPopupTool.static.group = 'utility';
+ve.ui.MWHelpPopupTool.static.icon = 'help';
+ve.ui.MWHelpPopupTool.static.titleMessage = 'visualeditor-help-tool';
+ve.ui.MWHelpPopupTool.static.autoAdd = false;
+
+/* Methods */
+
+/**
+ * Handle clicks on the feedback button.
+ *
+ * @method
+ */
+ve.ui.MWHelpPopupTool.prototype.onFeedbackClick = function () {
+       this.hidePopup();
+       if ( !this.feedback ) {
+               // This can't be constructed until the editor has loaded as it 
uses special messages
+               this.feedback = new mw.Feedback( {
+                       'title': new mw.Title( ve.msg( 
'visualeditor-feedback-link' ) ),
+                       'bugsLink': new mw.Uri( 
'https://bugzilla.wikimedia.org/enter_bug.cgi?product=VisualEditor&component=General'
 ),
+                       'bugsListLink': new mw.Uri( 
'https://bugzilla.wikimedia.org/buglist.cgi?query_format=advanced&resolution=---&resolution=LATER&resolution=DUPLICATE&product=VisualEditor&list_id=166234'
 )
+               } );
+       }
+       this.feedback.launch();
+};
+
+/* Registration */
+
+ve.ui.toolFactory.register( ve.ui.MWHelpPopupTool );
diff --git a/modules/ve/ui/styles/ve.ui.SurfaceToolbar.css 
b/modules/ve/ui/styles/ve.ui.SurfaceToolbar.css
index 3b64b6c..eee37be 100644
--- a/modules/ve/ui/styles/ve.ui.SurfaceToolbar.css
+++ b/modules/ve/ui/styles/ve.ui.SurfaceToolbar.css
@@ -5,7 +5,7 @@
  * @license The MIT License (MIT); see LICENSE.txt
  */
 
-.ve-ui-surfaceToolbar-floating .oo-ui-toolbar-bar {
+.ve-ui-surfaceToolbar-floating > .oo-ui-toolbar-bar {
        position: fixed;
        top: 0;
        z-index: 100;
diff --git a/modules/ve/ui/styles/ve.ui.Widget.css 
b/modules/ve/ui/styles/ve.ui.Widget.css
index 0082f78..ec9e878 100644
--- a/modules/ve/ui/styles/ve.ui.Widget.css
+++ b/modules/ve/ui/styles/ve.ui.Widget.css
@@ -101,7 +101,7 @@
        font-size: 1.25em;
 }
 
-.ve-ui-surfaceWidget-toolbar .oo-ui-toolbar-bar {
+.ve-ui-surfaceWidget-toolbar > .oo-ui-toolbar-bar {
        border: solid 1px #ddd;
        border-radius: 0.25em;
        border-bottom-right-radius: 0;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I260059802379d8cab8ca175b7d7d32813e3ff10a
Gerrit-PatchSet: 12
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Trevor Parscal <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to