Trevor Parscal has uploaded a new change for review.
https://gerrit.wikimedia.org/r/90378
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/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.Toolbar.css
10 files changed, 251 insertions(+), 184 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/78/90378/1
diff --git a/VisualEditor.php b/VisualEditor.php
index f799010..11f4224 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -530,6 +530,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/ve-mw/init/styles/ve.init.mw.ViewPageTarget-apex.css
b/modules/ve-mw/init/styles/ve.init.mw.ViewPageTarget-apex.css
index d567953..b93c051 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 .ve-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 8c39504..1e9b648 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 .ve-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 a8a86d8..3eb37f9 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 > .ve-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 > .ve-ui-iconButtonWidget {
+.ve-ui-mwHelpPopupTool-item > .ve-ui-iconButtonWidget {
display: block;
margin: 0.5em 0;
}
-.ve-init-mw-viewPageTarget-betaNotices-notice >
.ve-ui-iconButtonWidget:first-child {
+.ve-ui-mwHelpPopupTool-item > .ve-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 7213e53..6e51b16 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;
@@ -232,8 +225,6 @@
this.setUpSurface( doc, ve.bind( function() {
this.startSanityCheck();
this.setupToolbarButtons();
- this.setupToolbarEditNotices();
- this.setupToolbarBetaNotices();
this.setupSaveDialog();
this.attachToolbarButtons();
this.restoreScrollPosition();
@@ -664,25 +655,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();
-};
-
-/**
* Handle the first transaction in the surface model.
*
* This handler is removed the first time it's used, but added each time the
surface is set up.
@@ -860,76 +832,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 );
};
/**
@@ -1142,8 +1044,6 @@
* @method
*/
ve.init.mw.ViewPageTarget.prototype.setupToolbarButtons = function () {
- var editNoticeCount = ve.getObjectKeys( this.editNotices ).length;
-
this.toolbarCancelButton = new ve.ui.PushButtonWidget( { 'label':
ve.msg( 'visualeditor-toolbar-cancel' ) } );
this.toolbarCancelButton.$.addClass( 've-ui-toolbar-cancelButton' );
this.toolbarSaveButton = new ve.ui.PushButtonWidget( {
@@ -1158,53 +1058,6 @@
this.toolbarCancelButton.connect( this, { 'click':
'onToolbarCancelButtonClick' } );
this.toolbarSaveButton.connect( this, { 'click':
'onToolbarSaveButtonClick' } );
-
- this.toolbarMetaButton = new ve.ui.IconButtonWidget( {
- 'icon': 'settings',
- 'label': ve.msg( 'visualeditor-meta-tool' )
- } );
- this.toolbarMetaButton.connect( this, { 'click':
'onToolbarMetaButtonClick' } );
-
- this.toolbarEditNoticesButton = new ve.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 ve.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 ve.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 ve.ui.IconButtonWidget( {
- 'icon': 'comment',
- 'label': ve.msg( 'visualeditor-feedback-tool' )
- } );
- this.toolbarFeedbackButton.connect( this, { 'click':
'onToolbarFeedbackToolClick' } );
};
/**
@@ -1215,10 +1068,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();
};
/**
@@ -1227,16 +1076,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' )
@@ -1245,7 +1093,7 @@
this.toolbarSaveButton.$
);
- this.toolbar.$actions.append( $iconButtons, $pushButtons );
+ this.toolbar.$actions.append( $actionTools, $pushButtons );
};
/**
@@ -1256,11 +1104,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();
};
@@ -1299,8 +1142,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 04e4037..3378df3 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 @@
} );
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 45514ba..0f9eefa 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: 've-ui-window-title')
span(:internal_linksuggestion, text: 'Main Page')
- div(:ip_warning, class:
've-init-mw-viewPageTarget-toolbar-editNotices-notice')
+ div(:ip_warning, class: 've-ui-mwNoticesPopupTool-item')
span(:linksuggestion, text: 'http://www.example.com')
span(:looks_good, class: 've-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 523d5df..f318b7e 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 {ve.ui.Toolbar} toolbar
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.MWMetaDialogTool = function VeUiMWMetaDialogTool( toolbar, config ) {
+ ve.ui.DialogTool.call( this, toolbar, config );
+};
+ve.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..297f68e
--- /dev/null
+++ b/modules/ve-mw/ui/tools/ve.ui.MWPopupTool.js
@@ -0,0 +1,198 @@
+/*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 ve.ui.PopupTool
+ * @constructor
+ * @param {ve.ui.TargetToolbar} toolbar
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.MWNoticesPopupTool = function VeUiMWNoticesPopupTool( toolbar, config ) {
+ var key,
+ items = toolbar.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
+ ve.ui.PopupTool.call( this, toolbar, 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 );
+ this.setTitle( title );
+
+ // Automatically show/hide
+ if ( count ) {
+ setTimeout( ve.bind( function () {
+ this.showPopup();
+ }, this ), 500 );
+ } else {
+ this.$.hide();
+ }
+};
+
+/* Inheritance */
+
+ve.inheritClass( ve.ui.MWNoticesPopupTool, ve.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 ve.ui.PopupTool
+ * @constructor
+ * @param {ve.ui.Toolbar} toolbar
+ * @param {Object} [config] Configuration options
+ */
+ve.ui.MWHelpPopupTool = function VeUiMWHelpPopupTool( toolbar, config ) {
+ var title = ve.msg( 'visualeditor-help-tool' );
+
+ // Configuration initialization
+ config = ve.extendObject( true, { 'popup': { 'head': true, 'label':
title } }, config );
+
+ // Parent constructor
+ ve.ui.PopupTool.call( this, toolbar, config );
+
+ // Properties
+ this.$items = this.$$( '<div>' );
+ this.feedback = null;
+ this.helpButton = new ve.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 ve.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 */
+
+ve.inheritClass( ve.ui.MWHelpPopupTool, ve.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.Toolbar.css
b/modules/ve/ui/styles/ve.ui.Toolbar.css
index 5a0bfeb..b06e24b 100644
--- a/modules/ve/ui/styles/ve.ui.Toolbar.css
+++ b/modules/ve/ui/styles/ve.ui.Toolbar.css
@@ -26,8 +26,6 @@
.ve-ui-toolbar-actions {
float: right;
- padding: 0.25em;
- font-size: 0.8em;
}
.ve-ui-toolbar-tools {
--
To view, visit https://gerrit.wikimedia.org/r/90378
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I260059802379d8cab8ca175b7d7d32813e3ff10a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Trevor Parscal <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits