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

Change subject: Provide own arrow images and methods
......................................................................


Provide own arrow images and methods

Copied from mediawiki/core. Doing this is compatible with older
MediaWiki versions, too.

Bug: 69676
Change-Id: Ieb5bb6f908a273321d49a56c9ead0b267c9280a7
---
M CleanChanges_body.php
A images/Arr_.png
A images/Arr_d.png
A images/Arr_l.png
A images/Arr_r.png
A images/Arr_u.png
6 files changed, 44 insertions(+), 0 deletions(-)

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



diff --git a/CleanChanges_body.php b/CleanChanges_body.php
index 38f0521..d6938c3 100644
--- a/CleanChanges_body.php
+++ b/CleanChanges_body.php
@@ -336,6 +336,50 @@
        }
 
        /**
+        * Generate HTML for an arrow or placeholder graphic
+        * @param string $dir One of '', 'd', 'l', 'r'
+        * @param string $alt
+        * @param string $title
+        * @return string HTML "<img>" tag
+        */
+       protected function arrow( $dir, $alt = '', $title = '' ) {
+               global $wgExtensionAssetsPath;
+               $encUrl = htmlspecialchars( $wgExtensionAssetsPath . 
'/CleanChanges/images/Arr_' . $dir . '.png' );
+               $encAlt = htmlspecialchars( $alt );
+               $encTitle = htmlspecialchars( $title );
+
+               return "<img src=\"$encUrl\" width=\"12\" height=\"12\" 
alt=\"$encAlt\" title=\"$encTitle\" />";
+       }
+
+       /**
+        * Generate HTML for a right- or left-facing arrow,
+        * depending on language direction.
+        * @return string HTML "<img>" tag
+        */
+       protected function sideArrow() {
+               $dir = $this->getLanguage()->isRTL() ? 'l' : 'r';
+
+               return $this->arrow( $dir, '+', $this->msg( 
'rc-enhanced-expand' )->text() );
+       }
+
+       /**
+        * Generate HTML for a down-facing arrow
+        * depending on language direction.
+        * @return string HTML "<img>" tag
+        */
+       protected function downArrow() {
+               return $this->arrow( 'd', '-', $this->msg( 'rc-enhanced-hide' 
)->text() );
+       }
+
+       /**
+        * Generate HTML for a spacer image
+        * @return string HTML "<img>" tag
+        */
+       protected function spacerArrow() {
+               return $this->arrow( '', codepointToUtf8( 0xa0 ) ); // 
non-breaking space
+       }
+
+       /**
         * @param RCCacheEntry[] $block
         * @return string
         */
diff --git a/images/Arr_.png b/images/Arr_.png
new file mode 100644
index 0000000..bc67a4b
--- /dev/null
+++ b/images/Arr_.png
Binary files differ
diff --git a/images/Arr_d.png b/images/Arr_d.png
new file mode 100644
index 0000000..58a9fc6
--- /dev/null
+++ b/images/Arr_d.png
Binary files differ
diff --git a/images/Arr_l.png b/images/Arr_l.png
new file mode 100644
index 0000000..2246254
--- /dev/null
+++ b/images/Arr_l.png
Binary files differ
diff --git a/images/Arr_r.png b/images/Arr_r.png
new file mode 100644
index 0000000..467a555
--- /dev/null
+++ b/images/Arr_r.png
Binary files differ
diff --git a/images/Arr_u.png b/images/Arr_u.png
new file mode 100644
index 0000000..1aa543a
--- /dev/null
+++ b/images/Arr_u.png
Binary files differ

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieb5bb6f908a273321d49a56c9ead0b267c9280a7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CleanChanges
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to