r107976 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107975‎ | r107976 | r107977 >
Date:00:44, 4 January 2012
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.18wmf1/extensions (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ApiSandbox/SpecialApiSandbox.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ApiSandbox/ext.apiSandbox.js (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ContactPage/ContactPage.i18n.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/ContactPage/SpecialContact.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/PagedTiffHandler/PagedTiffHandler_body.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/ApiSandbox/SpecialApiSandbox.php
@@ -32,7 +32,8 @@
3333 $out->addHTML( '<noscript>' . wfMessage( 'apisb-no-js' )->parse() . '</noscript>
3434 <div id="api-sandbox-content" style="display: none">' );
3535 $out->addWikiMsg( 'apisb-intro' );
36 - $out->addHTML( $this->openFieldset( 'parameters' )
 36+ $out->addHTML( '<form id="api-sandbox-form">'
 37+ . $this->openFieldset( 'parameters' )
3738 . $this->getInputs()
3839 . '</fieldset>'
3940 . $this->openFieldset( 'result' )
@@ -48,7 +49,7 @@
4950 '
5051 . '<tr><td colspan="2"><div id="api-sandbox-output"></div></td></tr>'
5152 . "\n</tbody></table>"
52 - . "\n</fieldset>" );
 53+ . "\n</fieldset>\n</form>" );
5354
5455 $out->addHTML( "\n</div>" ); # <div id="api-sandbox-content">
5556 }
@@ -103,7 +104,7 @@
104105
105106 $s .= Html::element( 'input',
106107 array(
107 - 'type' => 'button',
 108+ 'type' => 'submit',
108109 'id' => 'api-sandbox-submit',
109110 'value' => wfMessage( 'apisb-submit' )->text(),
110111 'disabled' => 'disabled',
Index: branches/wmf/1.18wmf1/extensions/ApiSandbox/ext.apiSandbox.js
@@ -225,7 +225,12 @@
226226 }
227227 } );
228228
229 - $submit.click( function() {
 229+
 230+ $( '#api-sandbox-form' ).submit( function( e ) {
 231+ e.preventDefault();
 232+ if ( !$submit.is( ':enabled' ) ) {
 233+ return;
 234+ }
230235 var url = mw.util.wikiScript( 'api' ) + '?action=' + $action.val(),
231236 params = mainRequest.getRequestData(),
232237 mustBePosted = isset( mainRequest.info.mustbeposted );
Index: branches/wmf/1.18wmf1/extensions/ContactPage/SpecialContact.php
@@ -10,17 +10,11 @@
1111 * @license GNU General Public Licence 2.0 or later
1212 */
1313
14 -if( !defined( 'MEDIAWIKI' ) ) {
15 - echo( "not a valid entry point.\n" );
16 - die( 1 );
17 -}
18 -
1914 /**
2015 * Provides the contact form
2116 * @ingroup SpecialPage
2217 */
2318 class SpecialContact extends SpecialPage {
24 -
2519 /**
2620 * Constructor
2721 */
@@ -29,6 +23,13 @@
3024 }
3125
3226 /**
 27+ * @see SpecialPage::getDescription
 28+ */
 29+ function getDescription() {
 30+ return wfMsg( 'contactpage' );
 31+ }
 32+
 33+ /**
3334 * Main execution function
3435 *
3536 * @param $par Mixed: Parameters passed to the page
Index: branches/wmf/1.18wmf1/extensions/ContactPage/ContactPage.i18n.php
@@ -15,7 +15,6 @@
1616 * @author Daniel Kinzler
1717 */
1818 $messages['en'] = array(
19 - 'contact' => 'Contact page',
2019 'contactpage' => 'Contact page',
2120 'contactpage-desc' => '[[Special:Contact|Contact form for visitors]]',
2221 'contactpage-title' => 'Contact',
Index: branches/wmf/1.18wmf1/extensions/PagedTiffHandler/PagedTiffHandler_body.php
@@ -351,15 +351,14 @@
352352 if ( ( $pagesize['width'] > $width ) && ( $pagesize['height'] > $height ) ) {
353353 $xfac = $pagesize['width'] / $width;
354354 $yfac = $pagesize['height'] / $height;
355 - // tested in Linux and Windows
356355 $cmd = wfEscapeShellArg( $wgTiffVipsCommand );
357 - $cmd .= ' im_shrink "' . wfEscapeShellArg( $srcPath ) . ':' . ( $page - 1 ) . '" ';
 356+ $cmd .= ' im_shrink ' . wfEscapeShellArg( $srcPath . ':' . ( $page - 1 ) ) . ' ';
358357 $cmd .= wfEscapeShellArg( $dstPath );
359358 $cmd .= " {$xfac} {$yfac} 2>&1";
360359 } else {
361 - // tested in Linux and Windows
362360 $cmd = wfEscapeShellArg( $wgTiffVipsCommand );
363 - $cmd .= ' im_resize_linear "' . wfEscapeShellArg( $srcPath ) . ':' . ( $page - 1 ) . '" ';
 361+ $cmd .= ' im_resize_linear ' . wfEscapeShellArg( $srcPath . ':' .
 362+ ( $page - 1 ) ) . ' ';
364363 $cmd .= wfEscapeShellArg( $dstPath );
365364 $cmd .= " {$width} {$height} 2>&1";
366365 }
Property changes on: branches/wmf/1.18wmf1/extensions
___________________________________________________________________
Modified: svn:mergeinfo
367366 Merged /trunk/extensions:r104971,105275,105902

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104971(bug 32667) Change key name for Special:Contact in ContactPage extension. Was...siebrand14:29, 2 December 2011
r105275Fix stray quotes from r61478, they cause a file not found error from VIPS. I ...tstarling01:56, 6 December 2011
r105902ApiSandbox: made form submittable with entermaxsem17:10, 12 December 2011

Status & tagging log