r113935 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113934‎ | r113935 | r113936 >
Date:17:27, 15 March 2012
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.19wmf1 (modified) (history)
  • /branches/wmf/1.19wmf1/RELEASE-NOTES-1.19 (modified) (history)
  • /branches/wmf/1.19wmf1/includes (modified) (history)
  • /branches/wmf/1.19wmf1/includes/Article.php (modified) (history)
  • /branches/wmf/1.19wmf1/includes/OutputPage.php (modified) (history)
  • /branches/wmf/1.19wmf1/includes/Preferences.php (modified) (history)
  • /branches/wmf/1.19wmf1/includes/specials (modified) (history)
  • /branches/wmf/1.19wmf1/includes/specials/SpecialCategories.php (modified) (history)
  • /branches/wmf/1.19wmf1/includes/specials/SpecialMovepage.php (modified) (history)
  • /branches/wmf/1.19wmf1/includes/specials/SpecialNewpages.php (modified) (history)
  • /branches/wmf/1.19wmf1/languages (modified) (history)
  • /branches/wmf/1.19wmf1/languages/messages/MessagesEn.php (modified) (history)
  • /branches/wmf/1.19wmf1/languages/messages/MessagesQqq.php (modified) (history)
  • /branches/wmf/1.19wmf1/resources/mediawiki.action/mediawiki.action.watch.ajax.js (modified) (history)
  • /branches/wmf/1.19wmf1/resources/mediawiki/mediawiki.js (modified) (history)
  • /branches/wmf/1.19wmf1/resources/mediawiki/mediawiki.util.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/RELEASE-NOTES-1.19
@@ -10,6 +10,14 @@
1111 MediaWiki 1.19 is an alpha-quality branch and is not recommended for use in
1212 production.
1313
 14+=== Changes since 1.19 beta 1 ===
 15+* (bug 35014) Including a special page no longer sets the page's title to the
 16+ included page
 17+* (bug 35152) Help message for e-mail is shown again in user preferences
 18+* (bug 34887) $3 and $4 parameters are now substituted correctly in message
 19+ "movepage-moved"
 20+* (bug 34841) Edit links are no longer displayed when display old page versions
 21+
1422 === Configuration changes in 1.19 ===
1523 * Removed SkinTemplateSetupPageCss hook; use BeforePageDisplay instead.
1624 * (bug 27132) movefile right granted by default to registered users.
@@ -250,6 +258,8 @@
251259 * (bug 34600) Older skins using useHeadElement=false were broken in 1.18
252260 * (bug 34604) [mw.config] wgActionPaths should be an object instead of a numeral
253261 array.
 262+* (bug 29753) mw.util.tooltipAccessKeyPrefix should be alt-shift for Chrome on Windows
 263+* (bug 25095) Special:Categories doesn't show first relevant item when "from" is filled.
254264
255265 === API changes in 1.19 ===
256266 * Made action=edit less likely to return "unknownerror", by returning the actual error
Index: branches/wmf/1.19wmf1/includes/Article.php
@@ -451,7 +451,7 @@
452452 if ( $wgOut->isPrintable() ) {
453453 $parserOptions->setIsPrintable( true );
454454 $parserOptions->setEditSection( false );
455 - } elseif ( !$this->getTitle()->quickUserCan( 'edit' ) ) {
 455+ } elseif ( !$this->isCurrent() || !$this->getTitle()->quickUserCan( 'edit' ) ) {
456456 $parserOptions->setEditSection( false );
457457 }
458458
Index: branches/wmf/1.19wmf1/includes/OutputPage.php
@@ -2839,6 +2839,10 @@
28402840 $ns = $title->getNamespace();
28412841 $nsname = MWNamespace::exists( $ns ) ? MWNamespace::getCanonicalName( $ns ) : $title->getNsText();
28422842
 2843+ // Get the relevant title so that AJAX features can use the correct page name
 2844+ // when making API requests from certain special pages (bug 34972).
 2845+ $relevantTitle = $this->getSkin()->getRelevantTitle();
 2846+
28432847 if ( $ns == NS_SPECIAL ) {
28442848 list( $canonicalName, /*...*/ ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
28452849 } elseif ( $this->canUseWikiPage() ) {
@@ -2880,6 +2884,7 @@
28812885 'wgPageContentLanguage' => $lang->getCode(),
28822886 'wgSeparatorTransformTable' => $compactSeparatorTransTable,
28832887 'wgDigitTransformTable' => $compactDigitTransTable,
 2888+ 'wgRelevantPageName' => $relevantTitle->getPrefixedDBKey(),
28842889 );
28852890 if ( $wgContLang->hasVariants() ) {
28862891 $vars['wgUserVariant'] = $wgContLang->getPreferredVariant();
@@ -3432,7 +3437,7 @@
34333438 * @param $args array
34343439 */
34353440 public function addWikiMsgArray( $name, $args ) {
3436 - $this->addWikiText( $this->msg( $name, $args )->plain() );
 3441+ $this->addHTML( $this->msg( $name, $args )->parseAsBlock() );
34373442 }
34383443
34393444 /**
Property changes on: branches/wmf/1.19wmf1/includes/OutputPage.php
___________________________________________________________________
Modified: svn:mergeinfo
34403445 Merged /trunk/phase3/includes/OutputPage.php:r113394,113415,113617,113710,113727,113737,113816
Index: branches/wmf/1.19wmf1/includes/specials/SpecialNewpages.php
@@ -356,7 +356,14 @@
357357
358358 $css = count( $classes ) ? ' class="' . implode( ' ', $classes ) . '"' : '';
359359
360 - return "<li{$css}>{$time} {$dm}{$plink} {$hist} {$dm}{$length} {$dm}{$ulink} {$comment} {$tagDisplay}</li>\n";
 360+ # Display the old title if the namespace has been changed
 361+ $oldTitleText = '';
 362+ if ( $result->page_namespace !== $result->rc_namespace ) {
 363+ $oldTitleText = wfMessage( 'rc-old-title' )->params( Title::makeTitle( $result->rc_namespace, $result->rc_title )
 364+ ->getPrefixedText() )->escaped();
 365+ }
 366+
 367+ return "<li{$css}>{$time} {$dm}{$plink} {$hist} {$dm}{$length} {$dm}{$ulink} {$comment} {$tagDisplay} {$oldTitleText}</li>\n";
361368 }
362369
363370 /**
Index: branches/wmf/1.19wmf1/includes/specials/SpecialCategories.php
@@ -59,12 +59,16 @@
6060 * @ingroup SpecialPage Pager
6161 */
6262 class CategoryPager extends AlphabeticPager {
 63+ private $conds = array( 'cat_pages > 0' );
 64+
6365 function __construct( IContextSource $context, $from ) {
6466 parent::__construct( $context );
6567 $from = str_replace( ' ', '_', $from );
6668 if( $from !== '' ) {
6769 $from = Title::capitalize( $from, NS_CATEGORY );
68 - $this->mOffset = $from;
 70+ $dbr = wfGetDB( DB_SLAVE );
 71+ $this->conds[] = 'cat_title >= ' . $dbr->addQuotes( $from );
 72+ $this->setOffset( '' );
6973 }
7074 }
7175
@@ -72,7 +76,7 @@
7377 return array(
7478 'tables' => array( 'category' ),
7579 'fields' => array( 'cat_title','cat_pages' ),
76 - 'conds' => array( 'cat_pages > 0' ),
 80+ 'conds' => $this->conds,
7781 'options' => array( 'USE INDEX' => 'cat_title' ),
7882 );
7983 }
Index: branches/wmf/1.19wmf1/includes/specials/SpecialMovepage.php
@@ -472,7 +472,8 @@
473473 $newText = $nt->getPrefixedText();
474474
475475 $msgName = $createRedirect ? 'movepage-moved-redirect' : 'movepage-moved-noredirect';
476 - $out->addHTML( wfMessage( 'movepage-moved' )->rawParams( $oldLink, $newLink, $oldText, $newText )->parseAsBlock() );
 476+ $out->addHTML( wfMessage( 'movepage-moved' )->rawParams( $oldLink,
 477+ $newLink )->params( $oldText, $newText )->parseAsBlock() );
477478 $out->addWikiMsg( $msgName );
478479
479480 # Now we move extra pages we've been asked to move: subpages and talk
Property changes on: branches/wmf/1.19wmf1/includes/specials/SpecialMovepage.php
___________________________________________________________________
Modified: svn:mergeinfo
480481 Merged /trunk/phase3/includes/specials/SpecialMovepage.php:r113727,113737,113816
Property changes on: branches/wmf/1.19wmf1/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
481482 Merged /trunk/phase3/includes/specials:r112918,113214,113394,113415,113617,113710,113727,113737,113816
Index: branches/wmf/1.19wmf1/includes/Preferences.php
@@ -360,6 +360,7 @@
361361 'default' => $emailAddress,
362362 'label-message' => 'youremail',
363363 'section' => 'personal/email',
 364+ 'help-messages' => $helpMessages,
364365 );
365366
366367 $disableEmailPrefs = false;
Property changes on: branches/wmf/1.19wmf1/includes
___________________________________________________________________
Modified: svn:mergeinfo
367368 Merged /trunk/phase3/includes:r112918,113214,113394,113415,113617,113710,113727,113737,113816
Index: branches/wmf/1.19wmf1/languages/messages/MessagesQqq.php
@@ -1789,6 +1789,7 @@
17901790 Does not work under $wgMiserMode ([[mwr:48986|r48986]]).',
17911791 'rc-change-size-new' => 'Tooltip when overing a change list diff size. The tooltip show the resulting new size in bytes.',
17921792 'newsectionsummary' => 'Default summary when adding a new section to a page.',
 1793+'rc-old-title' => 'Text that shows the original title of a page, $1 is the original title text',
17931794
17941795 # Recent changes linked
17951796 'recentchangeslinked' => 'Title of [[Special:RecentChangesLinked]] and display name of page on [[Special:SpecialPages]].',
Index: branches/wmf/1.19wmf1/languages/messages/MessagesEn.php
@@ -2066,6 +2066,7 @@
20672067 'newsectionsummary' => '/* $1 */ new section',
20682068 'rc-enhanced-expand' => 'Show details (requires JavaScript)',
20692069 'rc-enhanced-hide' => 'Hide details',
 2070+'rc-old-title' => 'originally created as "$1"',
20702071
20712072 # Recent changes linked
20722073 'recentchangeslinked' => 'Related changes',
Property changes on: branches/wmf/1.19wmf1/languages
___________________________________________________________________
Modified: svn:mergeinfo
20732074 Merged /trunk/phase3/languages:r112918,113214,113394,113415,113617,113710,113727,113737,113816
Index: branches/wmf/1.19wmf1/resources/mediawiki.action/mediawiki.action.watch.ajax.js
@@ -5,6 +5,11 @@
66 ( function ( $, mw, undefined ) {
77
88 /**
 9+ * The name of the page to watch or unwatch.
 10+ */
 11+var title = mw.config.get( 'wgRelevantPageName', mw.config.get( 'wgPageName' ) );
 12+
 13+/**
914 * Update the link text, link href attribute and (if applicable)
1015 * "loading" class.
1116 *
@@ -24,7 +29,7 @@
2530 ( accesskeyTip ? ' ' + accesskeyTip[0] : '' )
2631 )
2732 .attr( 'href', mw.util.wikiScript() + '?' + $.param({
28 - title: mw.config.get( 'wgPageName' ),
 33+ title: title,
2934 action: action
3035 })
3136 );
@@ -98,7 +103,7 @@
99104
100105 api = new mw.Api();
101106 api[action](
102 - mw.config.get( 'wgPageName' ),
 107+ title,
103108 // Success
104109 function( watchResponse ) {
105110 var otherAction = action === 'watch' ? 'unwatch' : 'watch',
@@ -129,10 +134,10 @@
130135 updateWatchLink( $link, action );
131136
132137 // Format error message
133 - var cleanTitle = mw.config.get( 'wgPageName' ).replace( /_/g, ' ' );
 138+ var cleanTitle = title.replace( /_/g, ' ' );
134139 var link = mw.html.element(
135140 'a', {
136 - 'href': mw.util.wikiGetlink( mw.config.get( 'wgPageName' ) ),
 141+ 'href': mw.util.wikiGetlink( title ),
137142 'title': cleanTitle
138143 }, cleanTitle
139144 );
Index: branches/wmf/1.19wmf1/resources/mediawiki/mediawiki.util.js
@@ -29,9 +29,17 @@
3030
3131 // Chrome on any platform
3232 } else if ( profile.name === 'chrome' ) {
33 - // Chrome on Mac or Chrome on other platform ?
34 - util.tooltipAccessKeyPrefix = ( profile.platform === 'mac'
35 - ? 'ctrl-option-' : 'alt-' );
 33+
 34+ util.tooltipAccessKeyPrefix = (
 35+ // Chrome on Mac
 36+ profile.platform === 'mac' ? 'ctrl-option-' :
 37+ // Chrome on Windows
 38+ // (both alt- and alt-shift work, but alt-f triggers Chrome wrench menu
 39+ // which alt-shift-f does not)
 40+ profile.platform === 'win' ? 'alt-shift-' :
 41+ // Chrome on Ubuntu (and other?)
 42+ 'alt-'
 43+ );
3644
3745 // Non-Windows Safari with webkit_version > 526
3846 } else if ( profile.platform !== 'win'
Index: branches/wmf/1.19wmf1/resources/mediawiki/mediawiki.js
@@ -586,11 +586,12 @@
587587 filter( 'ready', jobs[j].dependencies ),
588588 jobs[j].dependencies ) )
589589 {
590 - if ( $.isFunction( jobs[j].ready ) ) {
591 - jobs[j].ready();
592 - }
 590+ var callback = jobs[j].ready;
593591 jobs.splice( j, 1 );
594592 j -= 1;
 593+ if ( $.isFunction( callback ) ) {
 594+ callback();
 595+ }
595596 }
596597 }
597598 // Execute modules whose dependencies have just been met
Property changes on: branches/wmf/1.19wmf1
___________________________________________________________________
Modified: svn:mergeinfo
598599 Merged /trunk/phase3:r112918,113214,113394,113415,113617,113710,113727,113737,113816

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112918fix for bug34781 - display old title text if the namespace has been changedbsitu20:58, 2 March 2012
r113214[mw.util.tooltipAccessKeyPrefix] alt-shift for Chrome on Windows...krinkle02:58, 7 March 2012
r113394* (bug 35014) Fix for r100529: including a special page no longer sets the pa...ialex20:06, 8 March 2012
r113415(bug 25095) Special:Categories doesn't show first relevant item when "from" i...maxsem22:51, 8 March 2012
r113617fix for bug 34696 - mw.loader.using shouldnt call callback more than oncekaldari12:43, 12 March 2012
r113710* (bug 35152) Fix for r92924: help message for e-mail was removed from user p...ialex07:39, 13 March 2012
r113727* (bug 34887) Fix for r100138: make $3 and $4 parameters being substituted co...ialex15:54, 13 March 2012
r113737User:PleaseStand patch fixes bug 34972rmoen17:57, 13 March 2012
r113816* (bug 34841) Fix for r103502: don't show edit links when display old page ve...ialex16:04, 14 March 2012

Status & tagging log