r102598 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102597‎ | r102598 | r102599 >
Date:23:20, 9 November 2011
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.18wmf1 (modified) (history)
  • /branches/wmf/1.18wmf1/RELEASE-NOTES-1.18 (modified) (history)
  • /branches/wmf/1.18wmf1/includes (modified) (history)
  • /branches/wmf/1.18wmf1/includes/HTMLForm.php (modified) (history)
  • /branches/wmf/1.18wmf1/includes/media (modified) (history)
  • /branches/wmf/1.18wmf1/includes/media/XMPInfo.php (modified) (history)
  • /branches/wmf/1.18wmf1/includes/parser/Parser.php (modified) (history)
  • /branches/wmf/1.18wmf1/includes/resourceloader/ResourceLoaderUserOptionsModule.php (modified) (history)
  • /branches/wmf/1.18wmf1/includes/specials (modified) (history)
  • /branches/wmf/1.18wmf1/includes/specials/SpecialEditWatchlist.php (modified) (history)
  • /branches/wmf/1.18wmf1/resources/mediawiki.action/mediawiki.action.edit.js (modified) (history)
  • /branches/wmf/1.18wmf1/resources/mediawiki.page/mediawiki.page.startup.js (modified) (history)
  • /branches/wmf/1.18wmf1/skins/common/shared.css (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/resources/mediawiki.page/mediawiki.page.startup.js
@@ -1,15 +1,10 @@
22 ( function( $ ) {
33
44 /* Client profile classes for <html> */
 5+ /* Allows for easy hiding/showing of JS or no-JS-specific UI elements */
56
6 - var prof = $.client.profile();
77 $( 'html' )
8 - .addClass(
9 - 'client-' + prof.name
10 - + ' client-' + prof.name + '-' + prof.versionBase
11 - + ' client-' + prof.layout
12 - + ' client-' + prof.platform
13 - + ' client-js' )
 8+ .addClass('client-js' )
149 .removeClass( 'client-nojs' );
1510
1611 } )( jQuery );
Index: branches/wmf/1.18wmf1/resources/mediawiki.action/mediawiki.action.edit.js
@@ -13,7 +13,7 @@
1414 insertButton : function( imageFile, speedTip, tagOpen, tagClose, sampleText, imageId, selectText ) {
1515 var image = $('<img>', {
1616 width : 23,
17 - height : 23,
 17+ height : 22,
1818 src : imageFile,
1919 alt : speedTip,
2020 title : speedTip,
Index: branches/wmf/1.18wmf1/skins/common/shared.css
@@ -18,12 +18,6 @@
1919 /* @noflip */textarea[dir="ltr"], input[dir="ltr"] { direction: ltr; }
2020 /* @noflip */textarea[dir="rtl"], input[dir="rtl"] { direction: rtl; }
2121
22 -/* The scripts of these languages are very hard to read with underlines */
23 -[lang="ar"] a, [lang="ckb"] a, [lang="fa"] a, [lang="kk-arab"] a,
24 -[lang="mzn"] a, [lang="ps"] a, [lang="ur"] a {
25 - text-decoration: none;
26 -}
27 -
2822 /* Default style for semantic tags */
2923 abbr, acronym, .explain {
3024 border-bottom: 1px dotted black;
@@ -176,6 +170,13 @@
177171 /**
178172 * Categories
179173 */
 174+#catlinks {
 175+ /**
 176+ * Overrides text justification (user preference)
 177+ * See bug 31990
 178+ */
 179+ text-align: left;
 180+}
180181 #catlinks ul {
181182 display:inline;
182183 margin: 0px;
Index: branches/wmf/1.18wmf1/RELEASE-NOTES-1.18
@@ -457,6 +457,7 @@
458458 * (bug 28545) When using the uca-default collation, sortkey's starting with a
459459 space (U+20) will sort under an invisible header like in 1.16 rather than a U+6DE
460460 * (bug 31674) Can't edit watchlist if it contains special pages
 461+* (bug 31990) justify paragraphs pref adds extra space to category listing
461462
462463 === API changes in 1.18 ===
463464 * BREAKING CHANGE: action=watch now requires POST and token.
Property changes on: branches/wmf/1.18wmf1/RELEASE-NOTES-1.18
___________________________________________________________________
Modified: svn:mergeinfo
464465 Merged /trunk/phase3/RELEASE-NOTES-1.18:r102297,102334-102335,102440
Index: branches/wmf/1.18wmf1/includes/parser/Parser.php
@@ -2942,7 +2942,7 @@
29432943 $isLocalObj = false; # $text is a DOM node needing expansion in the current frame
29442944
29452945 # Title object, where $text came from
2946 - $title = null;
 2946+ $title = false;
29472947
29482948 # $part1 is the bit before the first |, and must contain only title characters.
29492949 # Various prefixes will be stripped from it later.
Index: branches/wmf/1.18wmf1/includes/specials/SpecialEditWatchlist.php
@@ -18,6 +18,8 @@
1919
2020 protected $successMessage;
2121
 22+ protected $toc;
 23+
2224 public function __construct(){
2325 parent::__construct( 'EditWatchlist' );
2426 }
@@ -86,6 +88,8 @@
8789 if( $form->show() ){
8890 $out->addHTML( $this->successMessage );
8991 $out->returnToMain();
 92+ } elseif ( $this->toc !== false ) {
 93+ $out->prependHTML( $this->toc );
9094 }
9195 break;
9296 }
@@ -391,6 +395,7 @@
392396 global $wgContLang;
393397
394398 $fields = array();
 399+ $count = 0;
395400
396401 $haveInvalidNamespaces = false;
397402 foreach( $this->getWatchlistInfo() as $namespace => $pages ){
@@ -398,13 +403,9 @@
399404 $haveInvalidNamespaces = true;
400405 continue;
401406 }
402 -
403 - $namespace == NS_MAIN
404 - ? wfMsgHtml( 'blanknamespace' )
405 - : htmlspecialchars( $wgContLang->getFormattedNsText( $namespace ) );
406407
407408 $fields['TitlesNs'.$namespace] = array(
408 - 'type' => 'multiselect',
 409+ 'class' => 'EditWatchlistCheckboxSeriesField',
409410 'options' => array(),
410411 'section' => "ns$namespace",
411412 );
@@ -413,6 +414,7 @@
414415 $title = Title::makeTitleSafe( $namespace, $dbkey );
415416 $text = $this->buildRemoveLine( $title, $redirect );
416417 $fields['TitlesNs'.$namespace]['options'][$text] = $title->getEscapedText();
 418+ $count++;
417419 }
418420 }
419421 if ( $haveInvalidNamespaces ) {
@@ -420,7 +422,22 @@
421423 $this->getContext()->getUser()->cleanupWatchlist();
422424 }
423425
424 - $form = new EditWatchlistNormalHTMLForm( $fields );
 426+ if ( count( $fields ) > 1 && $count > 30 ) {
 427+ $this->toc = Linker::tocIndent();
 428+ $tocLength = 0;
 429+ foreach( $fields as $key => $data ) {
 430+ $ns = substr( $data['section'], 2 );
 431+ $nsText = $ns == NS_MAIN
 432+ ? wfMsgHtml( 'blanknamespace' )
 433+ : htmlspecialchars( $wgContLang->getFormattedNsText( $ns ) );
 434+ $this->toc .= Linker::tocLine( "mw-htmlform-{$data['section']}", $nsText, ++$tocLength, 1 ) . Linker::tocLineEnd();
 435+ }
 436+ $this->toc = Linker::tocList( $this->toc );
 437+ } else {
 438+ $this->toc = false;
 439+ }
 440+
 441+ $form = new EditWatchlistNormalHTMLForm( $fields, $this->getContext() );
425442 $form->setTitle( $this->getTitle() );
426443 $form->setSubmitText( wfMessage( 'watchlistedit-normal-submit' )->text() );
427444 $form->setWrapperLegend( wfMessage( 'watchlistedit-normal-legend' )->text() );
@@ -556,3 +573,21 @@
557574 : htmlspecialchars( $this->getContext()->getLang()->getFormattedNsText( $namespace ) );
558575 }
559576 }
 577+
 578+class EditWatchlistCheckboxSeriesField extends HTMLMultiSelectField {
 579+ /**
 580+ * HTMLMultiSelectField throws validation errors if we get input data
 581+ * that doesn't match the data set in the form setup. This causes
 582+ * problems if something gets removed from the watchlist while the
 583+ * form is open (bug 32126), but we know that invalid items will
 584+ * be harmless so we can override it here.
 585+ *
 586+ * @param $value String the value the field was submitted with
 587+ * @param $alldata Array the data collected from the form
 588+ * @return Mixed Bool true on success, or String error to display.
 589+ */
 590+ function validate( $value, $alldata ) {
 591+ // Need to call into grandparent to be a good citizen. :)
 592+ return HTMLFormField::validate( $value, $alldata );
 593+ }
 594+}
\ No newline at end of file
Property changes on: branches/wmf/1.18wmf1/includes/specials/SpecialEditWatchlist.php
___________________________________________________________________
Modified: svn:mergeinfo
560595 Merged /trunk/phase3/includes/specials/SpecialEditWatchlist.php:r101666,101802,101860,101990,102297,102334-102335,102440
Property changes on: branches/wmf/1.18wmf1/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
561596 Merged /trunk/phase3/includes/specials:r101666,101802,101860,101990,102297,102334-102335,102440
Index: branches/wmf/1.18wmf1/includes/resourceloader/ResourceLoaderUserOptionsModule.php
@@ -93,7 +93,11 @@
9494 $rules = array();
9595 if ( $options['underline'] < 2 ) {
9696 $rules[] = "a { text-decoration: " .
97 - ( $options['underline'] ? 'underline !important' : 'none' ) . "; }";
 97+ ( $options['underline'] ? 'underline' : 'none' ) . "; }";
 98+ } else {
 99+ # The scripts of these languages are very hard to read with underlines
 100+ $rules[] = 'a:lang(ar), a:lang(ckb), a:lang(fa),a:lang(kk-arab), ' .
 101+ 'a:lang(mzn), a:lang(ps), a:lang(ur) { text-decoration: none; }';
98102 }
99103 if ( $options['highlightbroken'] ) {
100104 $rules[] = "a.new, #quickbar a.new { color: #ba0000; }\n";
Index: branches/wmf/1.18wmf1/includes/HTMLForm.php
@@ -1319,7 +1319,10 @@
13201320 }
13211321
13221322 // GetCheck won't work like we want for checks.
1323 - if ( $request->getCheck( 'wpEditToken' ) || $this->mParent->getMethod() != 'post' ) {
 1323+ // Fetch the value in either one of the two following case:
 1324+ // - we have a valid token (form got posted or GET forged by the user)
 1325+ // - checkbox name has a value (false or true), ie is not null
 1326+ if ( $request->getCheck( 'wpEditToken' ) || $request->getVal( $this->mName )!== null ) {
13241327 // XOR has the following truth table, which is what we want
13251328 // INVERT VALUE | OUTPUT
13261329 // true true | false
Index: branches/wmf/1.18wmf1/includes/media/XMPInfo.php
@@ -631,12 +631,23 @@
632632 'validate' => 'validateClosed',
633633 'choices' => array( '1' => true, '2' => true ),
634634 ),
635 - 'YCbCrSubSampling' => array(
636 - 'map_group' => 'exif',
637 - 'mode' => XMPReader::MODE_SEQ,
638 - 'validate' => 'validateClosed',
639 - 'choices' => array( '1' => true, '2' => true ),
640 - ),
 635+ /********
 636+ * Disable extracting this property (bug 31944)
 637+ * Several files have a string instead of a Seq
 638+ * for this property. XMPReader doesn't handle
 639+ * mismatched types very gracefully (it marks
 640+ * the entire file as invalid, instead of just
 641+ * the relavent prop). Since this prop
 642+ * doesn't communicate all that useful information
 643+ * just disable this prop for now, until such
 644+ * XMPReader is more graceful (bug 32172)
 645+ * 'YCbCrSubSampling' => array(
 646+ * 'map_group' => 'exif',
 647+ * 'mode' => XMPReader::MODE_SEQ,
 648+ * 'validate' => 'validateClosed',
 649+ * 'choices' => array( '1' => true, '2' => true ),
 650+ * ),
 651+ */
641652 ),
642653 'http://ns.adobe.com/exif/1.0/aux/' => array(
643654 'Lens' => array(
Property changes on: branches/wmf/1.18wmf1/includes/media
___________________________________________________________________
Modified: svn:mergeinfo
644655 Merged /trunk/phase3/includes/media:r101802,101860,101990,102297,102334-102335,102440
Property changes on: branches/wmf/1.18wmf1/includes
___________________________________________________________________
Modified: svn:mergeinfo
645656 Merged /trunk/phase3/includes:r101445,101464,101666,101802,101860,101990,102297,102334-102335,102440
Property changes on: branches/wmf/1.18wmf1
___________________________________________________________________
Modified: svn:mergeinfo
646657 Merged /trunk/phase3:r101445,101464,101666,101802,101860,101990,102297,102334-102335,102440

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r101445Follow-up r96261: remove the !important again, and then do the script default...robin00:17, 1 November 2011
r101464checkbox could not be checked through URL parameter...hashar09:28, 1 November 2011
r101666* (bug 32126) Fix 1.18 regression in watchlist editor when items already remo...brion19:36, 2 November 2011
r101802(bug 31944). As a work around for bug 31944, don't extract tiff:YCbCrSubSampl...bawolff13:10, 3 November 2011
r101860bug 32183: remove the client-* classes added from user-agent-sniffing onto th...brion19:18, 3 November 2011
r101990Fixes Bug #31722 — “ugly old toolbar icons - height inconsistent” —...mah13:21, 4 November 2011
r102297bug 31990 justify paragraphs pref adds extra space to category listing...hashar16:46, 7 November 2011
r102334(bug 31502) (follow-up r84718) Restore ToC to Special:EditWatchlist if there ...happy-melon22:11, 7 November 2011
r102335Follow-up r102334: odd that this minus sign (yes, copied from a diff) was act...happy-melon22:15, 7 November 2011
r102440Attempt to fix translatewiki bug 32057...platonides20:58, 8 November 2011

Status & tagging log