diff options
author | Sam Reed <reedy@users.mediawiki.org> | 2012-03-16 15:18:19 +0000 |
---|---|---|
committer | Sam Reed <reedy@users.mediawiki.org> | 2012-03-16 15:18:19 +0000 |
commit | d865c44d596a21c15d0245e1971c68f2072bec7c (patch) | |
tree | 49342325d0fb6339d96b5943cb975b369bc2c06e | |
parent | a9c07032874e5bead033806c768027059d9f57d7 (diff) | |
download | mediawikicore-d865c44d596a21c15d0245e1971c68f2072bec7c.tar.gz mediawikicore-d865c44d596a21c15d0245e1971c68f2072bec7c.zip |
MFT r112918, r113214, r113268, r113277, r113312, r113415, r113454, r113737, r113758, r113775, r113892
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/114015
-rw-r--r-- | RELEASE-NOTES-1.19 | 11 | ||||
-rw-r--r-- | includes/OutputPage.php | 5 | ||||
-rw-r--r-- | includes/filerepo/file/LocalFile.php | 13 | ||||
-rw-r--r-- | includes/resourceloader/ResourceLoaderModule.php | 4 | ||||
-rw-r--r-- | includes/resourceloader/ResourceLoaderWikiModule.php | 1 | ||||
-rw-r--r-- | includes/specials/SpecialCategories.php | 8 | ||||
-rw-r--r-- | includes/specials/SpecialNewpages.php | 9 | ||||
-rw-r--r-- | includes/specials/SpecialUndelete.php | 3 | ||||
-rw-r--r-- | languages/messages/MessagesEn.php | 1 | ||||
-rw-r--r-- | languages/messages/MessagesQqq.php | 1 | ||||
-rw-r--r-- | resources/jquery/jquery.textSelection.js | 95 | ||||
-rw-r--r-- | resources/mediawiki.action/mediawiki.action.watch.ajax.js | 13 | ||||
-rw-r--r-- | resources/mediawiki/mediawiki.util.js | 16 |
13 files changed, 118 insertions, 62 deletions
diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 7adc7c464581..f913b5a6b7e5 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -271,8 +271,13 @@ production. * (bug 28936, bug 5280) Broken or invalid titles can't be removed from watchlist. * (bug 34600) Older skins using useHeadElement=false were broken in 1.18. * (bug 34604) [mw.config] wgActionPaths should be an object instead of a numeral - array. -* (bug 12262) Indents and lists are now aligned + array.* (bug 12262) Indents and lists are now aligned +* (bug 29753) mw.util.tooltipAccessKeyPrefix should be alt-shift for Chrome + on Windows +* (bug 25095) Special:Categories should also include the first relevant item + when "from" is filled. +* (bug 34972) An error occurred while changing your watchlist settings for + [[Special:WhatLinksHere/Example]] === API changes in 1.19 === * Made action=edit less likely to return "unknownerror", by returning the actual error @@ -309,6 +314,8 @@ production. calling action=purge&forcelinkupdate. * (bug 34377) action=watch now parses messages using the correct title instead of "API". +* (bug 35036) WikiLove messages were not automatically updated in JavaScript + after having been changed on-wiki due to a bug in core === Languages updated in 1.19 === diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 62f0734c2d31..003aee7cf437 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2839,6 +2839,10 @@ $templates $ns = $title->getNamespace(); $nsname = MWNamespace::exists( $ns ) ? MWNamespace::getCanonicalName( $ns ) : $title->getNsText(); + // Get the relevant title so that AJAX features can use the correct page name + // when making API requests from certain special pages (bug 34972). + $relevantTitle = $this->getSkin()->getRelevantTitle(); + if ( $ns == NS_SPECIAL ) { list( $canonicalName, /*...*/ ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); } elseif ( $this->canUseWikiPage() ) { @@ -2880,6 +2884,7 @@ $templates 'wgPageContentLanguage' => $lang->getCode(), 'wgSeparatorTransformTable' => $compactSeparatorTransTable, 'wgDigitTransformTable' => $compactDigitTransTable, + 'wgRelevantPageName' => $relevantTitle->getPrefixedDBKey(), ); if ( $lang->hasVariants() ) { $vars['wgUserVariant'] = $lang->getPreferredVariant(); diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 4c4e1617432c..e6684df0cf33 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -907,7 +907,10 @@ class LocalFile extends File { $this->lock(); // begin $status = $this->publish( $srcPath, $flags ); - if ( $status->ok ) { + if ( $status->successCount > 0 ) { + # Essentially we are displacing any existing current file and saving + # a new current file at the old location. If just the first succeeded, + # we still need to displace the current DB entry and put in a new one. if ( !$this->recordUpload2( $status->value, $comment, $pageText, $props, $timestamp, $user ) ) { $status->fatal( 'filenotfound', $srcPath ); } @@ -1004,8 +1007,12 @@ class LocalFile extends File { ); if ( $dbw->affectedRows() == 0 ) { - if ( $oldver == '' ) { - throw new MWException( "Empty oi_archive_name. Database and storage out of sync?" ); + if ( $oldver == '' ) { // XXX + # (bug 34993) publish() can displace the current file and yet fail to save + # a new one. The next publish attempt will treat the file as a brand new file + # and pass an empty $oldver. Allow this bogus value so we can displace the + # `image` row to `oldimage`, leaving room for the new current file `image` row. + #throw new MWException( "Empty oi_archive_name. Database and storage out of sync?" ); } $reupload = true; # Collision, this is an update of a file diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index 6db5fb695e82..1a232ec26aa9 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -357,6 +357,10 @@ abstract class ResourceLoaderModule { * timestamps. Whenever anything happens that changes the module's * contents for these parameters, the mtime should increase. * + * NOTE: The mtime of the module's messages is NOT automatically included. + * If you want this to happen, you'll need to call getMsgBlobMtime() + * yourself and take its result into consideration. + * * @param $context ResourceLoaderContext: Context object * @return Integer: UNIX timestamp */ diff --git a/includes/resourceloader/ResourceLoaderWikiModule.php b/includes/resourceloader/ResourceLoaderWikiModule.php index b13753119f24..91a51f896ce6 100644 --- a/includes/resourceloader/ResourceLoaderWikiModule.php +++ b/includes/resourceloader/ResourceLoaderWikiModule.php @@ -157,6 +157,7 @@ abstract class ResourceLoaderWikiModule extends ResourceLoaderModule { if ( count( $mtimes ) ) { $modifiedTime = max( $modifiedTime, max( $mtimes ) ); } + $modifiedTime = max( $modifiedTime, $this->getMsgBlobMtime( $context->getLanguage() ) ); return $modifiedTime; } diff --git a/includes/specials/SpecialCategories.php b/includes/specials/SpecialCategories.php index 6d2831c7b043..338cd7066608 100644 --- a/includes/specials/SpecialCategories.php +++ b/includes/specials/SpecialCategories.php @@ -59,12 +59,16 @@ class SpecialCategories extends SpecialPage { * @ingroup SpecialPage Pager */ class CategoryPager extends AlphabeticPager { + private $conds = array( 'cat_pages > 0' ); + function __construct( IContextSource $context, $from ) { parent::__construct( $context ); $from = str_replace( ' ', '_', $from ); if( $from !== '' ) { $from = Title::capitalize( $from, NS_CATEGORY ); - $this->mOffset = $from; + $dbr = wfGetDB( DB_SLAVE ); + $this->conds[] = 'cat_title >= ' . $dbr->addQuotes( $from ); + $this->setOffset( '' ); } } @@ -72,7 +76,7 @@ class CategoryPager extends AlphabeticPager { return array( 'tables' => array( 'category' ), 'fields' => array( 'cat_title','cat_pages' ), - 'conds' => array( 'cat_pages > 0' ), + 'conds' => $this->conds, 'options' => array( 'USE INDEX' => 'cat_title' ), ); } diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index ecec87de5375..54bcb97f44fe 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -356,7 +356,14 @@ class SpecialNewpages extends IncludableSpecialPage { $css = count( $classes ) ? ' class="' . implode( ' ', $classes ) . '"' : ''; - return "<li{$css}>{$time} {$dm}{$plink} {$hist} {$dm}{$length} {$dm}{$ulink} {$comment} {$tagDisplay}</li>\n"; + # Display the old title if the namespace has been changed + $oldTitleText = ''; + if ( $result->page_namespace !== $result->rc_namespace ) { + $oldTitleText = wfMessage( 'rc-old-title' )->params( Title::makeTitle( $result->rc_namespace, $result->rc_title ) + ->getPrefixedText() )->escaped(); + } + + return "<li{$css}>{$time} {$dm}{$plink} {$hist} {$dm}{$length} {$dm}{$ulink} {$comment} {$tagDisplay} {$oldTitleText}</li>\n"; } /** diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index 760a463b6f78..5d8b17b78211 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -405,13 +405,12 @@ class PageArchive { $article->loadPageData( 'fromdbmaster' ); $oldcountable = $article->isCountable(); - $options = 'FOR UPDATE'; // lock page $page = $dbw->selectRow( 'page', array( 'page_id', 'page_latest' ), array( 'page_namespace' => $this->title->getNamespace(), 'page_title' => $this->title->getDBkey() ), __METHOD__, - $options + array( 'FOR UPDATE' ) // lock page ); if( $page ) { $makepage = false; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 153cdd3704c1..6dd04c2c2256 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2066,6 +2066,7 @@ Your e-mail address is not revealed when other users contact you.', 'newsectionsummary' => '/* $1 */ new section', 'rc-enhanced-expand' => 'Show details (requires JavaScript)', 'rc-enhanced-hide' => 'Hide details', +'rc-old-title' => 'originally created as "$1"', # Recent changes linked 'recentchangeslinked' => 'Related changes', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 73f336576acd..39592dc484f9 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -1790,6 +1790,7 @@ I guess that this should appear before an input box where you can specify that r Does not work under $wgMiserMode ([[mwr:48986|r48986]]).', 'rc-change-size-new' => 'Tooltip when hovering a change list diff size. The tooltip shows the resulting new size in bytes.', 'newsectionsummary' => 'Default summary when adding a new section to a page.', +'rc-old-title' => 'Text that shows the original title of a page, $1 is the original title text', # Recent changes linked 'recentchangeslinked' => 'Title of [[Special:RecentChangesLinked]] and display name of page on [[Special:SpecialPages]].', diff --git a/resources/jquery/jquery.textSelection.js b/resources/jquery/jquery.textSelection.js index 443722f2dfe5..91b6e75de6cd 100644 --- a/resources/jquery/jquery.textSelection.js +++ b/resources/jquery/jquery.textSelection.js @@ -131,8 +131,58 @@ encapsulateSelection: function( options ) { var isSample = false; if ( this.style.display == 'none' ) { // Do nothing + } else if ( document.selection && document.selection.createRange ) { + // IE + + // Note that IE9 will trigger the next section unless we check this first. + // See bug 35201. + + activateElementOnIE( this ); + if ( context ) { + context.fn.restoreCursorAndScrollTop(); + } + if ( options.selectionStart !== undefined ) { + $(this).textSelection( 'setSelection', { 'start': options.selectionStart, 'end': options.selectionEnd } ); + } + + var selText = $(this).textSelection( 'getSelection' ); + var scrollTop = this.scrollTop; + var range = document.selection.createRange(); + + checkSelectedText(); + var insertText = pre + selText + post; + if ( options.splitlines ) { + insertText = doSplitLines( selText, pre, post ); + } + if ( options.ownline && range.moveStart ) { + var range2 = document.selection.createRange(); + range2.collapse(); + range2.moveStart( 'character', -1 ); + // FIXME: Which check is correct? + if ( range2.text != "\r" && range2.text != "\n" && range2.text != "" ) { + insertText = "\n" + insertText; + pre += "\n"; + } + var range3 = document.selection.createRange(); + range3.collapse( false ); + range3.moveEnd( 'character', 1 ); + if ( range3.text != "\r" && range3.text != "\n" && range3.text != "" ) { + insertText += "\n"; + post += "\n"; + } + } + + range.text = insertText; + if ( isSample && options.selectPeri && range.moveStart ) { + range.moveStart( 'character', - post.length - selText.length ); + range.moveEnd( 'character', - post.length ); + } + range.select(); + // Restore the scroll position + this.scrollTop = scrollTop; } else if ( this.selectionStart || this.selectionStart == '0' ) { // Mozilla/Opera + $(this).focus(); if ( options.selectionStart !== undefined ) { $(this).textSelection( 'setSelection', { 'start': options.selectionStart, 'end': options.selectionEnd } ); @@ -182,51 +232,6 @@ encapsulateSelection: function( options ) { this.selectionStart = startPos + insertText.length; this.selectionEnd = this.selectionStart; } - } else if ( document.selection && document.selection.createRange ) { - // IE - activateElementOnIE( this ); - if ( context ) { - context.fn.restoreCursorAndScrollTop(); - } - if ( options.selectionStart !== undefined ) { - $(this).textSelection( 'setSelection', { 'start': options.selectionStart, 'end': options.selectionEnd } ); - } - - var selText = $(this).textSelection( 'getSelection' ); - var scrollTop = this.scrollTop; - var range = document.selection.createRange(); - - checkSelectedText(); - var insertText = pre + selText + post; - if ( options.splitlines ) { - insertText = doSplitLines( selText, pre, post ); - } - if ( options.ownline && range.moveStart ) { - var range2 = document.selection.createRange(); - range2.collapse(); - range2.moveStart( 'character', -1 ); - // FIXME: Which check is correct? - if ( range2.text != "\r" && range2.text != "\n" && range2.text != "" ) { - insertText = "\n" + insertText; - pre += "\n"; - } - var range3 = document.selection.createRange(); - range3.collapse( false ); - range3.moveEnd( 'character', 1 ); - if ( range3.text != "\r" && range3.text != "\n" && range3.text != "" ) { - insertText += "\n"; - post += "\n"; - } - } - - range.text = insertText; - if ( isSample && options.selectPeri && range.moveStart ) { - range.moveStart( 'character', - post.length - selText.length ); - range.moveEnd( 'character', - post.length ); - } - range.select(); - // Restore the scroll position - this.scrollTop = scrollTop; } $(this).trigger( 'encapsulateSelection', [ options.pre, options.peri, options.post, options.ownline, options.replace, options.spitlines ] ); diff --git a/resources/mediawiki.action/mediawiki.action.watch.ajax.js b/resources/mediawiki.action/mediawiki.action.watch.ajax.js index 00fcbb3e1eda..f5f09f52a105 100644 --- a/resources/mediawiki.action/mediawiki.action.watch.ajax.js +++ b/resources/mediawiki.action/mediawiki.action.watch.ajax.js @@ -5,6 +5,11 @@ ( function ( $, mw, undefined ) { /** + * The name of the page to watch or unwatch. + */ +var title = mw.config.get( 'wgRelevantPageName', mw.config.get( 'wgPageName' ) ); + +/** * Update the link text, link href attribute and (if applicable) * "loading" class. * @@ -24,7 +29,7 @@ function updateWatchLink( $link, action, state ) { ( accesskeyTip ? ' ' + accesskeyTip[0] : '' ) ) .attr( 'href', mw.util.wikiScript() + '?' + $.param({ - title: mw.config.get( 'wgPageName' ), + title: title, action: action }) ); @@ -98,7 +103,7 @@ $( document ).ready( function() { api = new mw.Api(); api[action]( - mw.config.get( 'wgPageName' ), + title, // Success function( watchResponse ) { var otherAction = action === 'watch' ? 'unwatch' : 'watch', @@ -129,10 +134,10 @@ $( document ).ready( function() { updateWatchLink( $link, action ); // Format error message - var cleanTitle = mw.config.get( 'wgPageName' ).replace( /_/g, ' ' ); + var cleanTitle = title.replace( /_/g, ' ' ); var link = mw.html.element( 'a', { - 'href': mw.util.wikiGetlink( mw.config.get( 'wgPageName' ) ), + 'href': mw.util.wikiGetlink( title ), 'title': cleanTitle }, cleanTitle ); diff --git a/resources/mediawiki/mediawiki.util.js b/resources/mediawiki/mediawiki.util.js index 277b19457cfb..0a95d102414e 100644 --- a/resources/mediawiki/mediawiki.util.js +++ b/resources/mediawiki/mediawiki.util.js @@ -29,9 +29,19 @@ // Chrome on any platform } else if ( profile.name === 'chrome' ) { - // Chrome on Mac or Chrome on other platform ? - util.tooltipAccessKeyPrefix = ( profile.platform === 'mac' - ? 'ctrl-option-' : 'alt-' ); + + util.tooltipAccessKeyPrefix = ( + profile.platform === 'mac' + // Chrome on Mac + ? 'ctrl-option-' + : profile.platform === 'win' + // Chrome on Windows + // (both alt- and alt-shift work, but alt-f triggers Chrome wrench menu + // which alt-shift-f does not) + ? 'alt-shift-' + // Chrome on other (Ubuntu?) + : 'alt-' + ); // Non-Windows Safari with webkit_version > 526 } else if ( profile.platform !== 'win' |