jenkins-bot has submitted this change and it was merged.
Change subject: Use messages that actually exist for tooltips in
SidebarExpandWidget
......................................................................
Use messages that actually exist for tooltips in SidebarExpandWidget
Use flow-board-{expand,collapse}-description by default, and use
flow-topic-{collapse,expand}-siderail on topic pages.
Bug: T103584
Change-Id: I9b2a3bd158e97dd7476fdb08998d9adb6b027761
---
M Resources.php
M i18n/en.json
M i18n/qqq.json
M modules/flow-initialize.js
M modules/flow/ui/widgets/mw.flow.ui.SidebarExpandWidget.js
5 files changed, 15 insertions(+), 2 deletions(-)
Approvals:
Sbisson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Resources.php b/Resources.php
index e3a0911..fdbaa46 100644
--- a/Resources.php
+++ b/Resources.php
@@ -129,7 +129,9 @@
'flow-toggle-small-topics',
'flow-toggle-topics',
'flow-toggle-topics-posts',
+ 'flow-topic-collapse-siderail',
'flow-topic-comments',
+ 'flow-topic-expand-siderail',
'flow-show-comments-title',
'flow-hide-comments-title',
'flow-topic-action-hide-topic',
diff --git a/i18n/en.json b/i18n/en.json
index 36203d3..eb67540 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -31,6 +31,8 @@
"flow-board-header": "About this board",
"flow-board-collapse-description": "Hide description",
"flow-board-expand-description": "Show description",
+ "flow-topic-collapse-siderail": "Read at full width",
+ "flow-topic-expand-siderail": "Read at fixed width",
"flow-edit-header-link": "Edit description",
"flow-post-moderated-toggle-hide-show": "Show comment
{{GENDER:$1|hidden}} by $2",
"flow-post-moderated-toggle-delete-show": "Show comment
{{GENDER:$1|deleted}} by $2",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 9f0d424..78711ba 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -38,6 +38,8 @@
"flow-board-header": "Used as title for the board description in the
side rail.",
"flow-board-collapse-description": "Used as title for the collapse
description icon.",
"flow-board-expand-description": "Used as title for the expand
description icon.",
+ "flow-topic-collapse-siderail": "Used as a title for the full width
icon.",
+ "flow-topic-expand-siderail": "Used as a title for the fixed width
icon.",
"flow-edit-header-link": "Used as text for the button that either
allows editing the description in place or brings the user to a page for
editing the description.",
"flow-post-moderated-toggle-hide-show": "Message to display instead of
content when a hidden post has been hidden.\n\nParameters:\n* $1 - username
that hid the title, can be used for GENDER\n* $2 - user link and tool links for
the user\n{{Related|Flow-post-moderated-toggle}}",
"flow-post-moderated-toggle-delete-show": "Message to display instead
of content when a deleted post has been hidden.\n\nParameters:\n* $1 - username
that hid the title, can be used for GENDER\n* $2 - user link and tool links for
the user\n{{Related|Flow-post-moderated-toggle}}",
diff --git a/modules/flow-initialize.js b/modules/flow-initialize.js
index ef5c3e8..1640576 100644
--- a/modules/flow-initialize.js
+++ b/modules/flow-initialize.js
@@ -49,7 +49,9 @@
.toggleClass( 'flow-board-expanded',
siderailCollapsed );
// We are in single-topic view. Initialize the sidebar
expand widget
sidebarExpandWidget = new
mw.flow.ui.SidebarExpandWidget( {
- collapsed: siderailCollapsed
+ collapsed: siderailCollapsed,
+ expandedButtonTitle: mw.msg(
'flow-topic-collapse-siderail' ),
+ collapsedButtonTitle: mw.msg(
'flow-topic-expand-siderail' )
} );
sidebarExpandWidget.$element.insertAfter( $board );
sidebarExpandWidget.on( 'toggle', function ( collapsed
) {
diff --git a/modules/flow/ui/widgets/mw.flow.ui.SidebarExpandWidget.js
b/modules/flow/ui/widgets/mw.flow.ui.SidebarExpandWidget.js
index 359ecc4..ebe6679 100644
--- a/modules/flow/ui/widgets/mw.flow.ui.SidebarExpandWidget.js
+++ b/modules/flow/ui/widgets/mw.flow.ui.SidebarExpandWidget.js
@@ -8,12 +8,17 @@
* @constructor
* @param {Object} [config] Configuration object
* @cfg {boolean} [collapsed=false] Start as collapsed
+ * @cfg {string} [expandedButtonTitle] Title for the button when
expanded
+ * @cfg {string} [collapsedButtonTitle] Title for the button when
collapsed
*/
mw.flow.ui.SidebarExpandWidget = function mwFlowUiSidebarExpandWidget(
config ) {
config = config || {};
// Parent constructor
mw.flow.ui.SidebarExpandWidget.parent.call( this, config );
+
+ this.expandedButtonTitle = config.expandedButtonTitle ||
mw.msg( 'flow-board-collapse-description' );
+ this.collapsedButtonTitle = config.collapsedButtonTitle ||
mw.msg( 'flow-board-expand-description' );
this.button = new OO.ui.ButtonWidget( {
framed: false
@@ -55,7 +60,7 @@
.toggleClass(
'flow-ui-sidebarExpandWidget-collapsed', this.collapsed );
this.button.setIcon( 'topic-' + action );
- this.button.setTitle( mw.msg( 'flow-sidebar-' + action
) );
+ this.button.setTitle( this.collapsed ?
this.collapsedButtonTitle : this.expandedButtonTitle );
// Change the preference
siderailState = this.collapsed ? 'collapsed' :
'expanded';
--
To view, visit https://gerrit.wikimedia.org/r/231477
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9b2a3bd158e97dd7476fdb08998d9adb6b027761
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
Gerrit-Reviewer: Sbisson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits