[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Introduce width=full

2016-08-10 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Introduce width=full
..


Introduce width=full

Bug: T142114
Change-Id: Ief9d40c5872a578e9f5e470f689465e931392fd6
---
M includes/Tag/MapFrame.php
M tests/parserTests.txt
2 files changed, 8 insertions(+), 1 deletion(-)

Approvals:
  Yurik: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Tag/MapFrame.php b/includes/Tag/MapFrame.php
index eef1c08..c65bfbe 100644
--- a/includes/Tag/MapFrame.php
+++ b/includes/Tag/MapFrame.php
@@ -20,7 +20,7 @@
protected function parseArgs() {
parent::parseArgs();
// @todo: should these have defaults?
-   $this->width = $this->getText( 'width', false, 
'/^(\d+|([1-9]\d?|100)%)$/' );
+   $this->width = $this->getText( 'width', false, 
'/^(\d+|([1-9]\d?|100)%|full)$/' );
$this->height = $this->getInt( 'height' );
$defaultAlign = $this->getLanguage()->isRTL() ? 'left' : 
'right';
$this->align = $this->getText( 'align', $defaultAlign, 
'/^(left|center|right)$/' );
@@ -83,6 +83,9 @@
if ( preg_match( '/^\d+%$/', $width ) && $width 
!= '100%' ) {
$width = '300px'; // @todo: deprecate 
old syntax completely
}
+   if ( $width == 'full' ) {
+   $width = '100%';
+   }
$attrs = [
'class' => 
'mw-kartographer-interactive',
'mw-data' => 'interface',
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 3d50cb7..0225f3e 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -115,11 +115,15 @@
 
 
 
+
+
 !! result
 
 
 
 
+
+
 
 !! end
 

-- 
To view, visit https://gerrit.wikimedia.org/r/304151
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ief9d40c5872a578e9f5e470f689465e931392fd6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: MaxSem 
Gerrit-Reviewer: Yurik 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Introduce width=full

2016-08-10 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/304151

Change subject: Introduce width=full
..

Introduce width=full

Bug: T142114
Change-Id: Ief9d40c5872a578e9f5e470f689465e931392fd6
---
M includes/Tag/MapFrame.php
M tests/parserTests.txt
2 files changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer 
refs/changes/51/304151/1

diff --git a/includes/Tag/MapFrame.php b/includes/Tag/MapFrame.php
index eef1c08..c65bfbe 100644
--- a/includes/Tag/MapFrame.php
+++ b/includes/Tag/MapFrame.php
@@ -20,7 +20,7 @@
protected function parseArgs() {
parent::parseArgs();
// @todo: should these have defaults?
-   $this->width = $this->getText( 'width', false, 
'/^(\d+|([1-9]\d?|100)%)$/' );
+   $this->width = $this->getText( 'width', false, 
'/^(\d+|([1-9]\d?|100)%|full)$/' );
$this->height = $this->getInt( 'height' );
$defaultAlign = $this->getLanguage()->isRTL() ? 'left' : 
'right';
$this->align = $this->getText( 'align', $defaultAlign, 
'/^(left|center|right)$/' );
@@ -83,6 +83,9 @@
if ( preg_match( '/^\d+%$/', $width ) && $width 
!= '100%' ) {
$width = '300px'; // @todo: deprecate 
old syntax completely
}
+   if ( $width == 'full' ) {
+   $width = '100%';
+   }
$attrs = [
'class' => 
'mw-kartographer-interactive',
'mw-data' => 'interface',
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 3d50cb7..0225f3e 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -115,11 +115,15 @@
 
 
 
+
+
 !! result
 
 
 
 
+
+
 
 !! end
 

-- 
To view, visit https://gerrit.wikimedia.org/r/304151
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief9d40c5872a578e9f5e470f689465e931392fd6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits