apply the new LanguageLinks hook, and thus only consider language links
stored in the database.
* (bug 47219) Allow specifying change type of Wikipedia feed items
+* prop=imageinfo now allows setting iiurlheight without setting iiurlwidth
=== Languages updated in 1.22===
}
if ( !$loaded ) {
throw new MWException( __METHOD__ . ": hit a key conflict attempting " .
- "to insert a user row, but then it doesn't exist when we select it!" );
+ "to insert user '{$this->mName}' row, but it was not present in select!" );
}
return Status::newFatal( 'userexists' );
}
public function getScale( $params ) {
$p = $this->getModulePrefix();
- // Height and width.
- if ( $params['urlheight'] != -1 && $params['urlwidth'] == -1 ) {
- $this->dieUsage( "{$p}urlheight cannot be used without {$p}urlwidth", "{$p}urlwidth" );
- }
-
if ( $params['urlwidth'] != -1 ) {
$scale = array();
$scale['width'] = $params['urlwidth'];
$scale['height'] = $params['urlheight'];
+ } elseif ( $params['urlheight'] != -1 ) {
+ // Height is specified but width isn't
+ // Don't set $scale['width']; this signals mergeThumbParams() to fill it with the image's width
+ $scale = array();
+ $scale['height'] = $params['urlheight'];
} else {
$scale = null;
if ( $params['urlparam'] ) {
$this->dieUsage( "{$p}urlparam requires {$p}urlwidth", "urlparam_no_width" );
}
- return $scale;
}
return $scale;
* @return Array of parameters for transform.
*/
protected function mergeThumbParams( $image, $thumbParams, $otherParams ) {
+
+ if ( !isset( $thumbParams['width'] ) && isset( $thumbParams['height'] ) ) {
+ // Populate the width with the image's width, so only the height restriction applies
+ $thumbParams['width'] = $image->getWidth();
+ }
+
if ( !$otherParams ) {
return $thumbParams;
}
if ( isset( $paramList['width'] ) ) {
if ( intval( $paramList['width'] ) != intval( $thumbParams['width'] ) ) {
- $this->dieUsage( "{$p}urlparam had width of {$paramList['width']} but "
- . "{$p}urlwidth was {$thumbParams['width']}", "urlparam_urlwidth_mismatch" );
+ $this->setWarning( "Ignoring width value set in {$p}urlparam ({$paramList['width']}) "
+ . "in favor of width value derived from {$p}urlwidth/{$p}urlheight ({$thumbParams['width']})" );
}
}
'urlwidth' => array( "If {$p}prop=url is set, a URL to an image scaled to this width will be returned.",
'For performance reasons if this option is used, ' .
'no more than ' . self::TRANSFORM_LIMIT . ' scaled images will be returned.' ),
- 'urlheight' => "Similar to {$p}urlwidth. Cannot be used without {$p}urlwidth",
+ 'urlheight' => "Similar to {$p}urlwidth.",
'urlparam' => array( "A handler specific parameter string. For example, pdf's ",
"might use 'page15-100px'. {$p}urlwidth must be used and be consistent with {$p}urlparam" ),
'limit' => 'How many image revisions to return per image',
array( 'code' => "{$p}urlwidth", 'info' => "{$p}urlheight cannot be used without {$p}urlwidth" ),
array( 'code' => 'urlparam', 'info' => "Invalid value for {$p}urlparam" ),
array( 'code' => 'urlparam_no_width', 'info' => "{$p}urlparam requires {$p}urlwidth" ),
- array( 'code' => 'urlparam_urlwidth_mismatch', 'info' => "The width set in {$p}urlparm doesn't " .
- "match the one in {$p}urlwidth" ),
) );
}
$this->getVar( '_InstallUser' ),
$this->getVar( '_InstallPassword' ),
false,
- false,
0,
$this->getVar( 'wgDBprefix' )
);
$this->getVar( 'wgDBuser' ),
$this->getVar( 'wgDBpassword' ),
false,
- false,
0,
$this->getVar( 'wgDBprefix' )
);
$dbUser,
$password,
false,
- false,
0,
$this->getVar( 'wgDBprefix' )
);
$user = $this->getUser();
+ $suggestedDurations = self::getSuggestedDurations();
+
$a = array(
'Target' => array(
'type' => 'text',
'validation-callback' => array( __CLASS__, 'validateTargetField' ),
),
'Expiry' => array(
- 'type' => !count( self::getSuggestedDurations() ) ? 'text' : 'selectorother',
+ 'type' => !count( $suggestedDurations ) ? 'text' : 'selectorother',
'label-message' => 'ipbexpiry',
'required' => true,
'tabindex' => '2',
- 'options' => self::getSuggestedDurations(),
+ 'options' => $suggestedDurations,
'other' => $this->msg( 'ipbother' )->text(),
'default' => $this->msg( 'ipb-default-expiry' )->inContentLanguage()->text(),
),
if ( $this->getRequest()->getCheck( 'success' ) ) {
$out->wrapWikiMsg(
- "<div class=\"successbox\"><strong>\n$1\n</strong></div><div id=\"mw-pref-clear\"></div>",
+ "<div class=\"successbox\">\n$1\n</div>",
'savedprefs'
);
}
*/
function toggleLinkPremade( $that, e, options ) {
var $collapsible = $that.eq( 0 ).closest( '.mw-collapsible' );
- options = $.extend( { toggleClasses: true }, options );
+ options = $.extend( { toggleClasses: true, linksPassthru: true }, options );
togglingHandler( $that, $collapsible, e, options );
}
* @param {jQuery} $collapsible
*/
function toggleLinkCustom( $that, e, options, $collapsible ) {
- options = $.extend( { linksPassthru: true }, options );
togglingHandler( $that, $collapsible, e, options );
}
}
/* preference page with js-genrated toc */
-#mw-pref-clear {
- clear: both;
-}
#preftoc {
float: left;
margin: 1em 1em 1em 1em;
float: left;
margin-bottom: 2em;
color: #000;
+ font-weight: bold;
}
.errorbox {
border-color: red;
text-decoration: none;
color: white;
}
-
-#mw-pref-clear {
- clear: both;
-}
-
#mw_content a.external,
#mw_content a.external[href ^="gopher://"] {
/* @embed */
$collapsible.find( '.mw-collapsible-toggle' ).trigger( 'click' );
} );
+ QUnit.test( 'premade toggler - options.linksPassthru' , 2, function ( assert ) {
+ var $collapsible, $content;
+
+ $collapsible = prepareCollapsible(
+ '<div class="mw-collapsible">' +
+ '<div class="mw-collapsible-toggle">' +
+ 'Toggle <a href="#top">toggle</a> toggle <b>toggle</b>' +
+ '</div>' +
+ '<div class="mw-collapsible-content">' + loremIpsum + '</div>' +
+ '</div>',
+ // Can't do asynchronous because we're testing that the event *doesn't* happen
+ { instantHide: true }
+ );
+ $content = $collapsible.find( '.mw-collapsible-content' );
+
+ $collapsible.find( '.mw-collapsible-toggle a' ).trigger( 'click' );
+ assert.assertTrue( $content.is( ':visible' ), 'click event on link inside toggle passes through (content not toggled)' );
+
+ $collapsible.find( '.mw-collapsible-toggle b' ).trigger( 'click' );
+ assert.assertTrue( $content.is( ':hidden' ), 'click event on non-link inside toggle toggles content' );
+ } );
+
}( mediaWiki, jQuery ) );