Merge "mediawiki.log: Add to jsduck index"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 4 May 2013 03:27:17 +0000 (03:27 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 4 May 2013 03:27:17 +0000 (03:27 +0000)
RELEASE-NOTES-1.22
includes/User.php
includes/api/ApiQueryImageInfo.php
includes/installer/MysqlInstaller.php
includes/specials/SpecialBlock.php
includes/specials/SpecialPreferences.php
resources/jquery/jquery.makeCollapsible.js
skins/common/oldshared.css
skins/common/shared.css
skins/modern/main.css
tests/qunit/suites/resources/jquery/jquery.makeCollapsible.test.js

index 23867d1..962043c 100644 (file)
@@ -98,6 +98,7 @@ production.
   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===
 
index 37a384c..5a525bf 100644 (file)
@@ -3263,7 +3263,7 @@ class User {
                        }
                        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' );
                }
index c36821b..5ed9d38 100644 (file)
@@ -202,21 +202,20 @@ class ApiQueryImageInfo extends ApiQueryBase {
        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;
@@ -232,6 +231,12 @@ class ApiQueryImageInfo extends ApiQueryBase {
         * @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;
                }
@@ -257,8 +262,8 @@ class ApiQueryImageInfo extends ApiQueryBase {
 
                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']})" );
                        }
                }
 
@@ -571,7 +576,7 @@ class ApiQueryImageInfo extends ApiQueryBase {
                        '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',
@@ -718,8 +723,6 @@ class ApiQueryImageInfo extends ApiQueryBase {
                        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" ),
                ) );
        }
 
index 4436173..e0bf3d7 100644 (file)
@@ -152,7 +152,6 @@ class MysqlInstaller extends DatabaseInstaller {
                                $this->getVar( '_InstallUser' ),
                                $this->getVar( '_InstallPassword' ),
                                false,
-                               false,
                                0,
                                $this->getVar( 'wgDBprefix' )
                        );
@@ -435,7 +434,6 @@ class MysqlInstaller extends DatabaseInstaller {
                                        $this->getVar( 'wgDBuser' ),
                                        $this->getVar( 'wgDBpassword' ),
                                        false,
-                                       false,
                                        0,
                                        $this->getVar( 'wgDBprefix' )
                                );
@@ -512,7 +510,6 @@ class MysqlInstaller extends DatabaseInstaller {
                                        $dbUser,
                                        $password,
                                        false,
-                                       false,
                                        0,
                                        $this->getVar( 'wgDBprefix' )
                                );
index 645de23..5a2ad62 100644 (file)
@@ -127,6 +127,8 @@ class SpecialBlock extends FormSpecialPage {
 
                $user = $this->getUser();
 
+               $suggestedDurations = self::getSuggestedDurations();
+
                $a = array(
                        'Target' => array(
                                'type' => 'text',
@@ -139,11 +141,11 @@ class SpecialBlock extends FormSpecialPage {
                                '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(),
                        ),
index a50e7c1..5fcf9ae 100644 (file)
@@ -52,7 +52,7 @@ class SpecialPreferences extends SpecialPage {
 
                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'
                        );
                }
index 09fe06e..e1a07b6 100644 (file)
         */
        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 );
        }
 
index 1f7d16d..833ece2 100644 (file)
@@ -162,9 +162,6 @@ img { border: none; }
 }
 
 /* preference page with js-genrated toc */
-#mw-pref-clear {
-       clear: both;
-}
 #preftoc {
        float: left;
        margin: 1em 1em 1em 1em;
index 26a7781..5c1b6b0 100644 (file)
@@ -546,6 +546,7 @@ table.collapsed tr.collapsable {
        float: left;
        margin-bottom: 2em;
        color: #000;
+       font-weight: bold;
 }
 .errorbox {
        border-color: red;
index f201209..7e7758a 100644 (file)
@@ -412,11 +412,6 @@ h1, h2, h3, h4, h5, h6 {
        text-decoration: none;
        color: white;
 }
-
-#mw-pref-clear {
-       clear: both;
-}
-
 #mw_content a.external,
 #mw_content a.external[href ^="gopher://"] {
        /* @embed */
index 9f34bee..7ae743c 100644 (file)
                $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 ) );