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

Change subject: Allow extension of post interaction links
......................................................................


Allow extension of post interaction links

Allow other extensions to add additional interaction links for each Flow
comment. Used by Flow Thanks.

Bug: 61930
Change-Id: Iab4ac2889a3e630a9c98241e4a93c71e4c1bd377
Co-authored-by: Bencmq <bencmqw...@gmail.com>
---
A hooks.txt
M includes/View.php
M includes/View/Post.php
M modules/mediawiki.ui/styles/agora-override-buttons.less
M modules/mediawiki.ui/styles/mixins/buttons.less
5 files changed, 24 insertions(+), 1 deletion(-)

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



diff --git a/hooks.txt b/hooks.txt
new file mode 100644
index 0000000..f70c0ec
--- /dev/null
+++ b/hooks.txt
@@ -0,0 +1,16 @@
+This document describes how event hooks work in the Flow extension.
+
+== Events and parameters ==
+
+This is a list of known events and parameters; please add to it if you're going
+to add events to the Flow extension.
+
+'FlowAddPostInteractionLinks': Called when a post is rendered, allow other
+extensions to add interaction links to the post besides 'Edit' and other links.
+$rev: Flow PostRevision object that the links belong to
+$user: User object to display the link for
+&$links: array of interaction links to be displayed, caller should append the
+         link element to the array
+
+'FlowAddModules': Allows other extensions to add relevant modules.
+$output: OutputPage object
diff --git a/includes/View.php b/includes/View.php
index dce0c95..11c2438 100644
--- a/includes/View.php
+++ b/includes/View.php
@@ -23,6 +23,9 @@
                $out->addModuleStyles( array( 'mediawiki.ui', 
'mediawiki.ui.button', 'ext.flow.base' ) );
                $out->addModules( array( 'ext.flow.base', 'ext.flow.editor' ) );
 
+               // Allow other extensions to add modules
+               wfRunHooks( 'FlowAddModules', array( $out ) );
+
                $workflow = $loader->getWorkflow();
 
                $title = $workflow->getArticleTitle();
diff --git a/includes/View/Post.php b/includes/View/Post.php
index 9a4e26d..eb045ff 100644
--- a/includes/View/Post.php
+++ b/includes/View/Post.php
@@ -75,6 +75,9 @@
                        $items[] = $editButton;
                }
 
+               wfRunHooks( 'FlowAddPostInteractionLinks',
+                       array( $this->post, $this->user, &$items ) );
+
                return implode(
                        Html::element(
                                'span',
diff --git a/modules/mediawiki.ui/styles/agora-override-buttons.less 
b/modules/mediawiki.ui/styles/agora-override-buttons.less
index 22d7598..0eaccf0 100644
--- a/modules/mediawiki.ui/styles/agora-override-buttons.less
+++ b/modules/mediawiki.ui/styles/agora-override-buttons.less
@@ -48,7 +48,7 @@
 
                // disabled
                @neutral-base,
-               #898989
+               #bbb // a choice based on 
https://trello.com/c/BJgrJCyX/59-thank-user
        );
 
        &.mw-ui-constructive {
diff --git a/modules/mediawiki.ui/styles/mixins/buttons.less 
b/modules/mediawiki.ui/styles/mixins/buttons.less
index b3161f3..1ac7e23 100644
--- a/modules/mediawiki.ui/styles/mixins/buttons.less
+++ b/modules/mediawiki.ui/styles/mixins/buttons.less
@@ -41,6 +41,7 @@
        &.mw-ui-disabled {
                color: @inactive-primary-contrast-color !important;
                background: @inactive-primary-color;
+               cursor: default;
        }
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iab4ac2889a3e630a9c98241e4a93c71e4c1bd377
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Wctaiwan <wctai...@gmail.com>
Gerrit-Reviewer: Bencmq <bencmqw...@gmail.com>
Gerrit-Reviewer: EBernhardson <ebernhard...@wikimedia.org>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Matthias Mullie <mmul...@wikimedia.org>
Gerrit-Reviewer: Spage <sp...@wikimedia.org>
Gerrit-Reviewer: Wctaiwan <wctai...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to