Amire80 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/94611


Change subject: Force ltr direction on the time selector
......................................................................

Force ltr direction on the time selector

Change-Id: Ib6ff4618024a6aa90a19ba8a80845123fbae0ec7
---
M modules/ext.centralNotice.adminUi/centralnotice.css
M special/SpecialCentralNotice.php
2 files changed, 17 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice 
refs/changes/11/94611/1

diff --git a/modules/ext.centralNotice.adminUi/centralnotice.css 
b/modules/ext.centralNotice.adminUi/centralnotice.css
index ca885d3..5624efd 100644
--- a/modules/ext.centralNotice.adminUi/centralnotice.css
+++ b/modules/ext.centralNotice.adminUi/centralnotice.css
@@ -37,6 +37,9 @@
 #preferences .cn-date-column {
        white-space:nowrap;
 }
+#preferences td.cn-timepicker {
+       text-align: left; /* To ensure RTL flipping */
+}
 #preferences input#clone {
        margin-left:0.25em;
 }
diff --git a/special/SpecialCentralNotice.php b/special/SpecialCentralNotice.php
index befcdac..84872cd 100644
--- a/special/SpecialCentralNotice.php
+++ b/special/SpecialCentralNotice.php
@@ -230,6 +230,17 @@
                }
        }
 
+       protected function timeSelectorTd( $prefix, $editable, $timestamp = 
null ) {
+               return Xml::tags(
+                       'td',
+                       array(
+                               'dir' => 'ltr', // Time is left-to-right in all 
languages
+                               'class' => 'cn-timepicker',
+                       ),
+                       $this->timeSelector( $prefix, $editable, $timestamp )
+               );
+       }
+
        protected function timeSelector( $prefix, $editable, $timestamp = null 
) {
                if ( $editable ) {
                        $minutes = $this->paddedRange( 0, 59 );
@@ -559,7 +570,7 @@
                        // Start Time
                        $htmlOut .= Xml::openElement( 'tr' );
                        $htmlOut .= Xml::tags( 'td', array(), $this->msg( 
'centralnotice-start-time' )->escaped() );
-                       $htmlOut .= Xml::tags( 'td', array(), 
$this->timeSelector( 'start', $this->editable, $start ) );
+                       $htmlOut .= $this->timeSelectorTd( 'start', 
$this->editable, $start );
                        $htmlOut .= Xml::closeElement( 'tr' );
                        // Project
                        $htmlOut .= Xml::openElement( 'tr' );
@@ -930,7 +941,7 @@
                        // Start Time
                        $htmlOut .= Xml::openElement( 'tr' );
                        $htmlOut .= Xml::tags( 'td', array(), $this->msg( 
'centralnotice-start-time' )->escaped() );
-                       $htmlOut .= Xml::tags( 'td', array(), 
$this->timeSelector( 'start', $this->editable, $start ) );
+                       $htmlOut .= $this->timeSelectorTd( 'start', 
$this->editable, $start );
                        $htmlOut .= Xml::closeElement( 'tr' );
                        // End Date
                        $htmlOut .= Xml::openElement( 'tr' );
@@ -940,7 +951,7 @@
                        // End Time
                        $htmlOut .= Xml::openElement( 'tr' );
                        $htmlOut .= Xml::tags( 'td', array(), $this->msg( 
'centralnotice-end-time' )->escaped() );
-                       $htmlOut .= Xml::tags( 'td', array(), 
$this->timeSelector( 'end', $this->editable, $end ) );
+                       $htmlOut .= $this->timeSelectorTd( 'end', 
$this->editable, $end );
                        $htmlOut .= Xml::closeElement( 'tr' );
                        // Project
                        $htmlOut .= Xml::openElement( 'tr' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib6ff4618024a6aa90a19ba8a80845123fbae0ec7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>

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

Reply via email to