=== Configuration changes in 1.24 ===
=== New features in 1.24 ===
+* Added a new hook, "WhatLinksHereProps", to allow extensions to annotate
+ WhatLinksHere entries.
=== Bug fixes in 1.24 ===
* (bug 62258) A bug was fixed in File::getUnscaledThumb when a height
&$expire: Cookie expiration, as for PHP's setcookie()
$options: Options passed to WebResponse::setcookie()
+'WhatLinksHereProps': Allows annotations to be added to WhatLinksHere
+$row: The DB row of the entry.
+$title: The Title of the page where the link comes FROM
+$target: The Title of the page where the link goes TO
+&$props: Array of HTML strings to display after the title.
+
'WikiExporter::dumpStableQuery': Get the SELECT query for "stable" revisions
dumps. One, and only one hook should set this, and return false.
&$tables: Database tables to use in the SELECT query
'ResourceLoaderUserTokensModule' => 'includes/resourceloader/ResourceLoaderUserTokensModule.php',
'ResourceLoaderLanguageDataModule' =>
'includes/resourceloader/ResourceLoaderLanguageDataModule.php',
+ 'ResourceLoaderLanguageNamesModule' =>
+ 'includes/resourceloader/ResourceLoaderLanguageNamesModule.php',
'ResourceLoaderWikiModule' => 'includes/resourceloader/ResourceLoaderWikiModule.php',
# includes/revisiondelete
$queryId = MWDebug::query( $sql, $fname, $isMaster );
+ # Avoid fatals if close() was called
+ if ( !$this->isOpen() ) {
+ throw new DBUnexpectedError( $this, "DB connection was already closed." );
+ }
+
# Do the query and handle errors
$ret = $this->doQuery( $commentedSql );
--- /dev/null
+<?php
+/**
+ * Resource loader module for providing language names.
+ *
+ * By default these names will be autonyms however other extensions may
+ * provided language names in the context language (e.g. cldr extension)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @author Ed Sanders
+ * @author Trevor Parscal
+ */
+
+/**
+ * ResourceLoader module for populating language specific data.
+ */
+class ResourceLoaderLanguageNamesModule extends ResourceLoaderModule {
+
+ protected $targets = array( 'desktop', 'mobile' );
+
+
+ /**
+ * @param $context ResourceLoaderContext
+ * @return array
+ */
+ protected function getData( ResourceLoaderContext $context ) {
+ return Language::fetchLanguageNames(
+ $context->getLanguage(),
+ 'all'
+ );
+ }
+
+ /**
+ * @param $context ResourceLoaderContext
+ * @return string JavaScript code
+ */
+ public function getScript( ResourceLoaderContext $context ) {
+ return Xml::encodeJsCall( 'mw.language.setData', array(
+ $context->getLanguage(),
+ 'languageNames',
+ $this->getData( $context )
+ ) );
+ }
+
+ public function getDependencies() {
+ return array( 'mediawiki.language.init' );
+ }
+
+ /**
+ * @param ResourceLoaderContext $context
+ * @return int UNIX timestamp
+ */
+ public function getModifiedTime( ResourceLoaderContext $context ) {
+ return max( 1, $this->getHashMtime( $context ) );
+ }
+
+ /**
+ * @param ResourceLoaderContext $context
+ * @return string Hash
+ */
+ public function getModifiedHash( ResourceLoaderContext $context ) {
+ return md5( serialize( $this->getData( $context ) ) );
+ }
+
+}
$out->addHtml( "<div class='searchresults'>" );
// prev/next links
+ $prevnext = null;
if ( $num || $this->offset ) {
// Show the create link ahead
$this->showCreateLink( $title, $num, $titleMatches, $textMatches );
- $prevnext = $this->getLanguage()->viewPrevNext( $this->getPageTitle(), $this->offset, $this->limit,
- $this->powerSearchOptions() + array( 'search' => $term ),
- max( $titleMatchesNum, $textMatchesNum ) < $this->limit
- );
- //$out->addHTML( "<p class='mw-search-pager-top'>{$prevnext}</p>\n" );
+ if ( $totalRes > $this->limit || $this->offset ) {
+ $prevnext = $this->getLanguage()->viewPrevNext( $this->getPageTitle(), $this->offset, $this->limit,
+ $this->powerSearchOptions() + array( 'search' => $term ),
+ max( $titleMatchesNum, $textMatchesNum ) < $this->limit
+ );
+ }
wfRunHooks( 'SpecialSearchResults', array( $term, &$titleMatches, &$textMatches ) );
} else {
wfRunHooks( 'SpecialSearchNoResults', array( $term ) );
if ( $numTextMatches > 0 && $numTitleMatches > 0 ) {
// if no title matches the heading is redundant
$out->wrapWikiMsg( "==$1==\n", 'textmatches' );
- } elseif ( $totalRes == 0 ) {
- # Don't show the 'no text matches' if we received title matches
- # $out->wrapWikiMsg( "==$1==\n", 'notextmatches' );
}
+
// show interwiki results if any
if ( $textMatches->hasInterwikiResults() ) {
$out->addHTML( $this->showInterwiki( $textMatches->getInterwikiResults(), $term ) );
}
$out->addHtml( "</div>" );
- if ( $num || $this->offset ) {
+ if ( $prevnext ) {
$out->addHTML( "<p class='mw-search-pager-bottom'>{$prevnext}</p>\n" );
}
}
$nt = Title::makeTitle( $row->page_namespace, $row->page_title );
if ( $row->rd_from && $level < 2 ) {
- $out->addHTML( $this->listItem( $row, $nt, true ) );
+ $out->addHTML( $this->listItem( $row, $nt, $target, true ) );
$this->showIndirectLinks( $level + 1, $nt, $wgMaxRedirectLinksRetrieved );
$out->addHTML( Xml::closeElement( 'li' ) );
} else {
- $out->addHTML( $this->listItem( $row, $nt ) );
+ $out->addHTML( $this->listItem( $row, $nt, $target ) );
}
}
return Xml::openElement( 'ul', ( $level ? array() : array( 'id' => 'mw-whatlinkshere-list' ) ) );
}
- protected function listItem( $row, $nt, $notClose = false ) {
+ protected function listItem( $row, $nt, $target, $notClose = false ) {
$dirmark = $this->getLanguage()->getDirMark();
# local message cache
$props[] = $msgcache['isimage'];
}
+ wfRunHooks( 'WhatLinksHereProps', array( $row, $nt, $target, &$props ) );
+
if ( count( $props ) ) {
$propsText = $this->msg( 'parentheses' )
->rawParams( implode( $msgcache['semicolon-separator'], $props ) )->escaped();
)
),
+ 'mediawiki.language.names' => array( 'class' => 'ResourceLoaderLanguageNamesModule' ),
+
/* MediaWiki Libs */
'mediawiki.libs.jpegmeta' => array(
},
"ooui-dialog-action-close": "Serriñ",
"ooui-outline-control-move-down": "Lakaat an elfenn da ziskenn",
- "ooui-outline-control-move-up": "Lakaat an elfenn da bignat"
+ "ooui-outline-control-move-up": "Lakaat an elfenn da bignat",
+ "ooui-outline-control-remove": "Tennañ an elfenn",
+ "ooui-toolbar-more": "Muioc'h"
}
/*!
- * OOjs UI v0.1.0-pre (70f1886a35)
+ * OOjs UI v0.1.0-pre (bdbb9cfa55)
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 2011–2014 OOjs Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: Tue Apr 29 2014 17:13:10 GMT-0700 (PDT)
+ * Date: Wed Apr 30 2014 16:34:11 GMT-0700 (PDT)
*/
( function ( OO ) {
this.openLookupMenu();
};
+/**
+ * Get lookup menu.
+ *
+ * @return {OO.ui.TextInputMenuWidget}
+ */
+OO.ui.LookupInputWidget.prototype.getLookupMenu = function () {
+ return this.lookupMenu;
+};
+
/**
* Open the menu.
*
*
* While flashing, the visual style of the pressed state is removed if present.
*
- * @param {Function} [done] Callback to execute when flash effect is complete.
+ * @return {jQuery.Promise} Promise resolved when flashing is done
*/
-OO.ui.OptionWidget.prototype.flash = function ( done ) {
- var $this = this.$element;
+OO.ui.OptionWidget.prototype.flash = function () {
+ var $this = this.$element,
+ deferred = $.Deferred();
if ( !this.disabled && this.constructor.static.pressable ) {
$this.removeClass( 'oo-ui-optionWidget-highlighted oo-ui-optionWidget-pressed' );
setTimeout( OO.ui.bind( function () {
- $this.addClass( 'oo-ui-optionWidget-highlighted' );
- if ( done ) {
- // Restore original classes
- $this
- .toggleClass( 'oo-ui-optionWidget-highlighted', this.highlighted )
- .toggleClass( 'oo-ui-optionWidget-pressed', this.pressed );
- setTimeout( done, 100 );
- }
+ // Restore original classes
+ $this
+ .toggleClass( 'oo-ui-optionWidget-highlighted', this.highlighted )
+ .toggleClass( 'oo-ui-optionWidget-pressed', this.pressed );
+ setTimeout( function () {
+ deferred.resolve();
+ }, 100 );
}, this ), 100 );
}
+
+ return deferred.promise();
};
/**
if ( item && !this.flashing ) {
this.flashing = true;
- item.flash( OO.ui.bind( function () {
+ item.flash().done( OO.ui.bind( function () {
this.hide();
this.flashing = false;
}, this ) );
/*!
- * OOjs UI v0.1.0-pre (70f1886a35)
+ * OOjs UI v0.1.0-pre (bdbb9cfa55)
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 2011–2014 OOjs Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: Tue Apr 29 2014 17:13:10 GMT-0700 (PDT)
+ * Date: Wed Apr 30 2014 16:34:11 GMT-0700 (PDT)
*/
/* Textures */
* Calculate the byte length of a string (accounting for UTF-8).
*
* @static
+ * @inheritable
+ * @param {string} str
+ * @return {string}
*/
jQuery.byteLength = function ( str ) {
// This basically figures out how many bytes a UTF-16 string (which is what js sees)
* Uses `window.devicePixelRatio` if available, or CSS media queries on IE.
*
* @static
+ * @inheritable
* @return {number} Device pixel ratio
*/
$.devicePixelRatio = function () {
margin: 0;
.box-sizing(border-box);
+ // Disable weird iOS styling
+ -webkit-appearance: none;
+
// IE6/IE7 hack
// http://stackoverflow.com/a/5838575/365238
*display: inline;
return 'test';
}
+ function isOpen() {
+ return true;
+ }
+
protected function closeConnection() {
return false;
}