Pastakhov has uploaded a new change for review.

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

Change subject: add support wikitext (version 0.5.3)
......................................................................

add support wikitext (version 0.5.3)

Change-Id: I76ca1f30802dc6fd4eedbdffcb080d57a0faf0aa
---
M MultiMaps.php
M includes/BaseMapService.php
M includes/mapelements/BaseMapElement.php
D resources/multimaps.css
M services/Google/ext.google.js
M services/Leaflet/ext.leaflet.js
M services/Leaflet/leaflet/leaflet.css
M services/Yandex/ext.yandex.js
8 files changed, 14 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultiMaps 
refs/changes/12/110912/1

diff --git a/MultiMaps.php b/MultiMaps.php
index 8ce3509..2a98f57 100644
--- a/MultiMaps.php
+++ b/MultiMaps.php
@@ -15,7 +15,7 @@
        die( 'This file is an extension to MediaWiki and thus not a valid entry 
point.' );
 }
 
-define( 'MultiMaps_VERSION' , '0.5.2' );
+define( 'MultiMaps_VERSION' , '0.5.3' );
 
 // Register this extension on Special:Version
 $wgExtensionCredits['parserhook'][] = array(
@@ -68,7 +68,6 @@
 
 //define modules that can later be loaded during the output
 $wgResourceModules['ext.MultiMaps'] = array(
-       'styles' => array('multimaps.css'),
        'scripts' => array('multimaps.js'),
        'localBasePath' => $dir . '/resources',
        'remoteExtPath' => 'MultiMaps/resources',
diff --git a/includes/BaseMapService.php b/includes/BaseMapService.php
index d61b3e0..c53723b 100644
--- a/includes/BaseMapService.php
+++ b/includes/BaseMapService.php
@@ -167,13 +167,13 @@
                                'div',
                                array(
                                        'id' => 'multimaps_map' . $mapid++,
-                                       'style' => 
'width:'.htmlspecialchars($this->width).'; 
height:'.htmlspecialchars($this->height).';',
+                                       'style' => 
'width:'.htmlspecialchars($this->width).'; 
height:'.htmlspecialchars($this->height).'; background-color: #cccccc; 
overflow: hidden;',
                                        'class' => 'multimaps-map' . 
($this->classname != '' ? " multimaps-map-$this->classname" : ''),
                                        ),
                                \Html::element( 'p', array(), 
\wfMessage('multimaps-loading-map')->escaped() ) .
                                \Html::rawElement(
                                                'div',
-                                               array( 'class' => 
'multimaps-mapdata' ),
+                                               array( 'class' => 
'multimaps-mapdata', 'style' => 'display: none;' ),
                                                \FormatJson::encode( 
$this->getMapData() )
                                                )
                                );
diff --git a/includes/mapelements/BaseMapElement.php 
b/includes/mapelements/BaseMapElement.php
index 74fca4e..e8a586a 100644
--- a/includes/mapelements/BaseMapElement.php
+++ b/includes/mapelements/BaseMapElement.php
@@ -105,6 +105,11 @@
                        return false;
                }
 
+               if( $name == 'title' || $name == 'text' ) {
+                       $parser = clone $GLOBALS['wgParser'];
+                       $value = $parser->parse( trim( $value ), 
$parser->getTitle(), new \ParserOptions() )->getText();
+               }
+
                if ( is_string($value) ) {
                        $value = trim( $value );
                        $this->properties[$name] = htmlspecialchars( $value, 
ENT_NOQUOTES );
diff --git a/resources/multimaps.css b/resources/multimaps.css
deleted file mode 100644
index d05b49e..0000000
--- a/resources/multimaps.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.multimaps-mapdata { display: none; }
-.multimaps-map { background-color: #cccccc; overflow: hidden; }
diff --git a/services/Google/ext.google.js b/services/Google/ext.google.js
index 35b9f7b..8715d73 100644
--- a/services/Google/ext.google.js
+++ b/services/Google/ext.google.js
@@ -55,10 +55,10 @@
                }
 
                if (properties.title !== undefined && properties.text !== 
undefined) {
-                       options.title = properties.title;
+                       options.title = 
properties.title.replace(/<\/?[^>]+>/gi, '');
                        text = '<strong>' + properties.title + '</strong><hr 
/>' + properties.text;
                } else if (properties.title !== undefined) {
-                       options.title = properties.title;
+                       options.title = 
properties.title.replace(/<\/?[^>]+>/gi, '');
                        text = '<strong>' + properties.title + '</strong>';
                } else if (properties.text  !== undefined) {
                        text = properties.text;
diff --git a/services/Leaflet/ext.leaflet.js b/services/Leaflet/ext.leaflet.js
index 2316596..11049ae 100644
--- a/services/Leaflet/ext.leaflet.js
+++ b/services/Leaflet/ext.leaflet.js
@@ -54,10 +54,10 @@
                }
 
                if (properties.title !== undefined && properties.text !== 
undefined) {
-                       options.title = properties.title;
+                       options.title = 
properties.title.replace(/<\/?[^>]+>/gi, '');
                        text = '<strong>' + properties.title + '</strong><hr 
/>' + properties.text;
                } else if (properties.title !== undefined) {
-                       options.title = properties.title;
+                       options.title = 
properties.title.replace(/<\/?[^>]+>/gi, '');
                        text = '<strong>' + properties.title + '</strong>';
                } else if (properties.text  !== undefined) {
                        text = properties.text;
diff --git a/services/Leaflet/leaflet/leaflet.css 
b/services/Leaflet/leaflet/leaflet.css
index ac0cd17..d45db3c 100644
--- a/services/Leaflet/leaflet/leaflet.css
+++ b/services/Leaflet/leaflet/leaflet.css
@@ -184,12 +184,6 @@
        background: #ddd;
        outline: 0;
        }
-.leaflet-container a {
-       color: #0078A8;
-       }
-.leaflet-container a.leaflet-active {
-       outline: 2px solid orange;
-       }
 .leaflet-zoom-box {
        border: 2px dotted #38f;
        background: rgba(255,255,255,0.5);
diff --git a/services/Yandex/ext.yandex.js b/services/Yandex/ext.yandex.js
index 32c958b..a1a4538 100644
--- a/services/Yandex/ext.yandex.js
+++ b/services/Yandex/ext.yandex.js
@@ -54,10 +54,10 @@
                }
 
                if (properties.title !== undefined && properties.text !== 
undefined) {
-                       prop.hintContent = properties.title;
+                       prop.hintContent = 
properties.title.replace(/<\/?[^>]+>/gi, '');
                        prop.balloonContent = '<strong>' + properties.title + 
'</strong><hr />' + properties.text;
                } else if (properties.title !== undefined) {
-                       prop.hintContent = properties.title;
+                       prop.hintContent = 
properties.title.replace(/<\/?[^>]+>/gi, '');
                        prop.balloonContent = '<strong>' + properties.title + 
'</strong>';
                } else if (properties.text  !== undefined) {
                        prop.balloonContent = properties.text;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76ca1f30802dc6fd4eedbdffcb080d57a0faf0aa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultiMaps
Gerrit-Branch: master
Gerrit-Owner: Pastakhov <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to