r81253 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81252‎ | r81253 | r81254 >
Date:15:08, 31 January 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r81252, update branch as well
Modified paths:
  • /branches/Maps0.8/Maps_Settings.php (modified) (history)
  • /branches/Maps0.8/includes/criteria/CriterionMapDimension.php (modified) (history)
  • /branches/Maps0.8/includes/manipulations/Maps_ParamDimension.php (modified) (history)

Diff [purge]

Index: branches/Maps0.8/Maps_Settings.php
@@ -208,7 +208,7 @@
209209
210210 # Integer or string. The default width and height of a map. These values will
211211 # only be used when the user does not provide them.
212 - $egMapsMapWidth = '100%';
 212+ $egMapsMapWidth = 'auto';
213213 $egMapsMapHeight = 350;
214214
215215 # Array. The minimum and maximum width and height for all maps. First min and
Index: branches/Maps0.8/includes/manipulations/Maps_ParamDimension.php
@@ -39,8 +39,12 @@
4040 * @since 0.7
4141 */
4242 public function doManipulation( &$value, Parameter $parameter, array &$parameters ) {
43 - global $egMapsSizeRestrictions;
 43+ global $egMapsSizeRestrictions, $egMapsMapWidth, $egMapsMapHeight;
4444
 45+ if ( $value == 'auto' && $this->dimension == 'width' ) {
 46+ return;
 47+ }
 48+
4549 // Set the default if the value is not valid.
4650 if ( !preg_match( '/^\d+(\.\d+)?(px|ex|em|%)?$/', $value ) ) {
4751 $value = $this->dimension == 'width' ? $egMapsMapWidth : $egMapsMapHeight;
@@ -75,4 +79,4 @@
7680 }
7781 }
7882
79 -}
\ No newline at end of file
 83+}
Index: branches/Maps0.8/includes/criteria/CriterionMapDimension.php
@@ -39,6 +39,10 @@
4040 protected function doValidation( $value, Parameter $parameter, array $parameters ) {
4141 global $egMapsSizeRestrictions;
4242
 43+ if ( $value == 'auto' && $this->dimension == 'width' ) {
 44+ return true;
 45+ }
 46+
4347 // See if the notation is valid.
4448 if ( !preg_match( '/^\d+(\.\d+)?(px|ex|em|%)?$/', $value ) ) {
4549 return false;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81252Allow 'auto' as width and use it as defaultjeroendedauw15:07, 31 January 2011

Status & tagging log