r111043 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111042‎ | r111043 | r111044 >
Date:17:00, 9 February 2012
Author:robin
Status:ok (Comments)
Tags:i18nreview 
Comment:
It's better to set directionality in html than in css. Also fixes bug 34297, because the css only affected the edit form and not the test form.
Also add a bit of docs.
Modified paths:
  • /trunk/extensions/AbuseFilter/AbuseFilter.class.php (modified) (history)
  • /trunk/extensions/AbuseFilter/modules/ext.abuseFilter.css (modified) (history)

Diff [purge]

Index: trunk/extensions/AbuseFilter/AbuseFilter.class.php
@@ -1293,13 +1293,20 @@
12941294 return $user;
12951295 }
12961296
 1297+ /**
 1298+ * @param $rules String
 1299+ * @param $textName String
 1300+ * @param $addResultDiv Boolean
 1301+ * @param $canEdit Boolean
 1302+ */
12971303 static function buildEditBox( $rules, $textName = 'wpFilterRules', $addResultDiv = true,
12981304 $canEdit = true ) {
12991305 global $wgOut;
13001306
1301 - $readOnlyAttrib = array();
1302 - if ( !$canEdit )
1303 - $readOnlyAttrib['readonly'] = 'readonly';
 1307+ $textareaAttrib = array( 'dir' => 'ltr' ); # Rules are in English
 1308+ if ( !$canEdit ) {
 1309+ $textareaAttrib['readonly'] = 'readonly';
 1310+ }
13041311
13051312 global $wgUser;
13061313 $noTestAttrib = array();
@@ -1309,7 +1316,7 @@
13101317 }
13111318
13121319 $rules = rtrim( $rules ) . "\n";
1313 - $rules = Xml::textarea( $textName, $rules, 40, 5, $readOnlyAttrib );
 1320+ $rules = Xml::textarea( $textName, $rules, 40, 5, $textareaAttrib );
13141321
13151322 $dropDown = self::getBuilderValues();
13161323 // Generate builder drop-down
Index: trunk/extensions/AbuseFilter/modules/ext.abuseFilter.css
@@ -115,9 +115,6 @@
116116 width: 50%;
117117 }
118118
119 -/* Rules are in English */
120 -/* @noflip */textarea#wpFilterRules { direction: ltr; }
121 -
122119 /* Name is in site content language */
123120 /* @noflip */.sitedir-ltr .TablePager_col_af_public_comments {
124121 direction: ltr;

Follow-up revisions

RevisionCommit summaryAuthorDate
r111581MFT r111043, r111484, r111571, r111574, r111575reedy20:46, 15 February 2012

Comments

#Comment by Hashar (talk | contribs)   09:39, 15 February 2012

I would prefer having that in CSS. Can't you add an id and a CSS rule for the test form?

#Comment by SPQRobin (talk | contribs)   16:59, 15 February 2012

There is an id for the test form, that's not the problem, but it is generally preferred to define directionality in html, not in css, because it's about the content and not presentation.

#Comment by Hashar (talk | contribs)   18:43, 15 February 2012

Which totally make sense :-)

#Comment by Hashar (talk | contribs)   18:44, 15 February 2012

Tagging for 1.18wmf1, 1.19wmf1 since it fix the annoying bug 34297

Status & tagging log