Index: trunk/extensions/Maps/OpenLayers/Maps_OpenLayersDispPoint.php |
— | — | @@ -52,7 +52,7 @@ |
53 | 53 | * @see MapsBaseMap::addSpecificMapHTML() |
54 | 54 | * |
55 | 55 | */ |
56 | | - public function addSpecificMapHTML() { |
| 56 | + public function addSpecificMapHTML( Parser $parser ) { |
57 | 57 | global $wgOut; |
58 | 58 | |
59 | 59 | $layerItems = MapsOpenLayers::createLayersStringAndLoadDependencies( $this->output, $this->layers ); |
— | — | @@ -61,13 +61,13 @@ |
62 | 62 | 'div', |
63 | 63 | array( |
64 | 64 | 'id' => $this->mapName, |
65 | | - 'width' => $this->width, |
66 | | - 'height' => $this->height |
| 65 | + 'style' => "width: $this->width; height: $this->height; background-color: #cccccc;", |
67 | 66 | ), |
68 | | - null |
| 67 | + wfMsg('maps-loading-map') |
69 | 68 | ); |
70 | 69 | |
71 | | - $wgOut->addInlineScript( <<<EOT |
| 70 | + $parser->getOutput()->addHeadItem( |
| 71 | + Html::inlineScript( <<<EOT |
72 | 72 | addOnloadHook( |
73 | 73 | function() { |
74 | 74 | initOpenLayer( |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | } |
84 | 84 | ); |
85 | 85 | EOT |
86 | | - ); |
| 86 | + ) ); |
87 | 87 | } |
88 | 88 | |
89 | 89 | } |
\ No newline at end of file |
Index: trunk/extensions/Maps/OpenLayers/Maps_OpenLayersDispMap.php |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | * @see MapsBaseMap::addSpecificMapHTML() |
47 | 47 | * |
48 | 48 | */ |
49 | | - public function addSpecificMapHTML() { |
| 49 | + public function addSpecificMapHTML( Parser $parser ) { |
50 | 50 | global $wgOut; |
51 | 51 | |
52 | 52 | $layerItems = MapsOpenLayers::createLayersStringAndLoadDependencies( $this->output, $this->layers ); |
— | — | @@ -54,13 +54,13 @@ |
55 | 55 | 'div', |
56 | 56 | array( |
57 | 57 | 'id' => $this->mapName, |
58 | | - 'width' => $this->width, |
59 | | - 'height' => $this->height |
| 58 | + 'style' => "width: $this->width; height: $this->height; background-color: #cccccc;", |
60 | 59 | ), |
61 | | - null |
| 60 | + wfMsg('maps-loading-map') |
62 | 61 | ); |
63 | 62 | |
64 | | - $wgOut->addInlineScript( <<<EOT |
| 63 | + $parser->getOutput()->addHeadItem( |
| 64 | + Html::inlineScript( <<<EOT |
65 | 65 | addOnloadHook( |
66 | 66 | function() { |
67 | 67 | initOpenLayer( |
— | — | @@ -75,7 +75,7 @@ |
76 | 76 | } |
77 | 77 | ); |
78 | 78 | EOT |
79 | | - ); |
| 79 | + ) ); |
80 | 80 | } |
81 | 81 | |
82 | 82 | } |
\ No newline at end of file |
Index: trunk/extensions/Maps/ParserFunctions/DisplayPoint/Maps_BasePointMap.php |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | |
57 | 57 | $this->setCentre(); |
58 | 58 | |
59 | | - $this->addSpecificMapHTML(); |
| 59 | + $this->addSpecificMapHTML( $parser ); |
60 | 60 | } |
61 | 61 | |
62 | 62 | return $this->output . $this->errorList; |
Index: trunk/extensions/Maps/ParserFunctions/DisplayMap/Maps_BaseMap.php |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | |
49 | 49 | $this->setCentre(); |
50 | 50 | |
51 | | - $this->addSpecificMapHTML(); |
| 51 | + $this->addSpecificMapHTML( $parser ); |
52 | 52 | } |
53 | 53 | |
54 | 54 | return $this->output . $this->errorList; |
Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | echo '<b>Warning:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.'; |
35 | 35 | } |
36 | 36 | else { |
37 | | - define( 'Maps_VERSION', '0.6 a2' ); |
| 37 | + define( 'Maps_VERSION', '0.6 a3' ); |
38 | 38 | |
39 | 39 | // The different coordinate notations. |
40 | 40 | define( 'Maps_COORDS_FLOAT', 0 ); |
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispMap.php |
— | — | @@ -66,10 +66,11 @@ |
67 | 67 | * @see MapsBaseMap::addSpecificMapHTML() |
68 | 68 | * |
69 | 69 | */ |
70 | | - public function addSpecificMapHTML() { |
| 70 | + public function addSpecificMapHTML( Parser $parser ) { |
71 | 71 | global $wgOut; |
72 | 72 | |
73 | | - $wgOut->addInlineScript( <<<EOT |
| 73 | + $parser->getOutput()->addHeadItem( |
| 74 | + Html::inlineScript( <<<EOT |
74 | 75 | addOnloadHook( |
75 | 76 | function() { |
76 | 77 | slippymaps['$this->mapName'] = new slippymap_map( |
— | — | @@ -88,7 +89,7 @@ |
89 | 90 | } |
90 | 91 | ); |
91 | 92 | EOT |
92 | | - ); |
| 93 | + ) ); |
93 | 94 | |
94 | 95 | $this->output .= $this->static ? $this->getStaticMap() : $this->getDynamicMap(); |
95 | 96 | } |
— | — | @@ -114,11 +115,9 @@ |
115 | 116 | 'div', |
116 | 117 | array( |
117 | 118 | 'id' => $this->mapName, |
118 | | - 'width' => $this->width, |
119 | | - 'height' => $this->height, |
120 | | - 'class' => 'map' |
| 119 | + 'style' => "width: $this->width; height: $this->height; background-color: #cccccc;", |
121 | 120 | ), |
122 | | - null |
| 121 | + wfMsg('maps-loading-map') |
123 | 122 | ); |
124 | 123 | } |
125 | 124 | |
— | — | @@ -151,14 +150,12 @@ |
152 | 151 | if ( $this->activatable ) { |
153 | 152 | $image['onclick'] = "slippymaps['$this->mapName'].init();"; |
154 | 153 | } |
155 | | - |
| 154 | + |
156 | 155 | return Html::element( |
157 | 156 | 'div', |
158 | 157 | array( |
159 | 158 | 'id' => $this->mapName, |
160 | | - 'width' => $this->width, |
161 | | - 'height' => $this->height, |
162 | | - 'class' => 'map' |
| 159 | + 'style' => "width: $this->width; height: $this->height; background-color: #cccccc;", |
163 | 160 | ), |
164 | 161 | Html::element( |
165 | 162 | 'img', |
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispPoint.php |
— | — | @@ -52,10 +52,11 @@ |
53 | 53 | * @see MapsBaseMap::addSpecificMapHTML() |
54 | 54 | * |
55 | 55 | */ |
56 | | - public function addSpecificMapHTML() { |
| 56 | + public function addSpecificMapHTML( Parser $parser ) { |
57 | 57 | global $wgOut; |
58 | 58 | |
59 | | - $wgOut->addInlineScript( <<<EOT |
| 59 | + $parser->getOutput()->addHeadItem( |
| 60 | + Html::inlineScript( <<<EOT |
60 | 61 | addOnloadHook( |
61 | 62 | function() { |
62 | 63 | slippymaps['$this->mapName'] = new slippymap_map( |
— | — | @@ -75,17 +76,15 @@ |
76 | 77 | } |
77 | 78 | ); |
78 | 79 | EOT |
79 | | - ); |
| 80 | + ) ); |
80 | 81 | |
81 | 82 | $this->output .= Html::element( |
82 | 83 | 'div', |
83 | 84 | array( |
84 | 85 | 'id' => $this->mapName, |
85 | | - 'width' => $this->width, |
86 | | - 'height' => $this->height, |
87 | | - 'class' => 'map' |
| 86 | + 'style' => "width: $this->width; height: $this->height; background-color: #cccccc;", |
88 | 87 | ), |
89 | | - null |
| 88 | + wfMsg('maps-loading-map') |
90 | 89 | ); |
91 | 90 | } |
92 | 91 | } |
\ No newline at end of file |
Index: trunk/extensions/Maps/GoogleMaps/Maps_GoogleMapsDispMap.php |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | * @see MapsBaseMap::addSpecificMapHTML() |
64 | 64 | * |
65 | 65 | */ |
66 | | - public function addSpecificMapHTML() { |
| 66 | + public function addSpecificMapHTML( Parser $parser ) { |
67 | 67 | global $wgOut; |
68 | 68 | |
69 | 69 | MapsGoogleMaps::addOverlayOutput( $this->output, $this->mapName, $this->overlays, $this->controls ); |
— | — | @@ -71,13 +71,13 @@ |
72 | 72 | 'div', |
73 | 73 | array( |
74 | 74 | 'id' => $this->mapName, |
75 | | - 'width' => $this->width, |
76 | | - 'height' => $this->height |
| 75 | + 'style' => "width: $this->width; height: $this->height; background-color: #cccccc;", |
77 | 76 | ), |
78 | | - null |
| 77 | + wfMsg('maps-loading-map') |
79 | 78 | ); |
80 | 79 | |
81 | | - $wgOut->addInlineScript( <<<EOT |
| 80 | + $parser->getOutput()->addHeadItem( |
| 81 | + Html::inlineScript( <<<EOT |
82 | 82 | addOnloadHook( |
83 | 83 | function() { |
84 | 84 | initializeGoogleMap('$this->mapName', |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | } |
96 | 96 | ); |
97 | 97 | EOT |
98 | | - ); |
| 98 | + ) ); |
99 | 99 | |
100 | 100 | } |
101 | 101 | |
Index: trunk/extensions/Maps/GoogleMaps/Maps_GoogleMapsDispPoint.php |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | * @see MapsBaseMap::addSpecificMapHTML() |
66 | 66 | * |
67 | 67 | */ |
68 | | - public function addSpecificMapHTML() { |
| 68 | + public function addSpecificMapHTML( Parser $parser ) { |
69 | 69 | global $wgOut; |
70 | 70 | |
71 | 71 | MapsGoogleMaps::addOverlayOutput( $this->output, $this->mapName, $this->overlays, $this->controls ); |
— | — | @@ -73,14 +73,14 @@ |
74 | 74 | 'div', |
75 | 75 | array( |
76 | 76 | 'id' => $this->mapName, |
77 | | - 'width' => $this->width, |
78 | | - 'height' => $this->height |
| 77 | + 'style' => "width: $this->width; height: $this->height; background-color: #cccccc;", |
79 | 78 | ), |
80 | | - null |
| 79 | + wfMsg('maps-loading-map') |
81 | 80 | ); |
82 | 81 | |
83 | | - $wgOut->addInlineScript( |
84 | | - <<<EOT |
| 82 | + $parser->getOutput()->addHeadItem( |
| 83 | + Html::inlineScript( |
| 84 | + <<<EOT |
85 | 85 | addOnloadHook( |
86 | 86 | function() { |
87 | 87 | initializeGoogleMap('$this->mapName', |
— | — | @@ -98,6 +98,7 @@ |
99 | 99 | } |
100 | 100 | ); |
101 | 101 | EOT |
| 102 | + ) |
102 | 103 | ); |
103 | 104 | |
104 | 105 | } |
Index: trunk/extensions/Maps/Maps_MapFeature.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | /** |
37 | 37 | * Adds the HTML specific to the mapping service to the output |
38 | 38 | */ |
39 | | - protected abstract function addSpecificMapHTML(); |
| 39 | + protected abstract function addSpecificMapHTML( Parser $parser ); |
40 | 40 | |
41 | 41 | public $serviceName; |
42 | 42 | |
Index: trunk/extensions/Maps/YahooMaps/Maps_YahooMapsDispPoint.php |
— | — | @@ -52,20 +52,20 @@ |
53 | 53 | * @see MapsBaseMap::addSpecificMapHTML() |
54 | 54 | * |
55 | 55 | */ |
56 | | - public function addSpecificMapHTML() { |
| 56 | + public function addSpecificMapHTML( Parser $parser ) { |
57 | 57 | global $wgOut; |
58 | 58 | |
59 | 59 | $this->output .= Html::element( |
60 | 60 | 'div', |
61 | 61 | array( |
62 | 62 | 'id' => $this->mapName, |
63 | | - 'width' => $this->width, |
64 | | - 'height' => $this->height |
| 63 | + 'style' => "width: $this->width; height: $this->height; background-color: #cccccc;", |
65 | 64 | ), |
66 | | - null |
| 65 | + wfMsg('maps-loading-map') |
67 | 66 | ); |
68 | 67 | |
69 | | - $wgOut->addInlineScript( <<<EOT |
| 68 | + $parser->getOutput()->addHeadItem( |
| 69 | + Html::inlineScript( <<<EOT |
70 | 70 | addOnloadHook( |
71 | 71 | function() { |
72 | 72 | initializeYahooMap( |
— | — | @@ -77,13 +77,12 @@ |
78 | 78 | [$this->types], |
79 | 79 | [$this->controls], |
80 | 80 | $this->autozoom, |
81 | | - [$this->markerString], |
82 | | - $this->height |
| 81 | + [$this->markerString] |
83 | 82 | ); |
84 | 83 | } |
85 | 84 | ); |
86 | 85 | EOT |
87 | | - ); |
| 86 | + ) ); |
88 | 87 | } |
89 | 88 | |
90 | 89 | } |
Index: trunk/extensions/Maps/YahooMaps/YahooMapFunctions.js |
— | — | @@ -37,15 +37,15 @@ |
38 | 38 | /** |
39 | 39 | * Returns YMap object with the provided properties and markers. |
40 | 40 | */ |
41 | | -function initializeYahooMap(mapName, lat, lon, zoom, type, types, controls, scrollWheelZoom, markers, height) { |
| 41 | +function initializeYahooMap(mapName, lat, lon, zoom, type, types, controls, scrollWheelZoom, markers) { |
42 | 42 | var centre = (lon != null && lat != null) ? new YGeoPoint(lat, lon) : null; |
43 | | - return createYahooMap(document.getElementById(mapName), centre, zoom, type, types, controls, scrollWheelZoom, markers, height); |
| 43 | + return createYahooMap(document.getElementById(mapName), centre, zoom, type, types, controls, scrollWheelZoom, markers); |
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | 47 | * Returns YMap object with the provided properties. |
48 | 48 | */ |
49 | | -function createYahooMap(mapElement, centre, zoom, type, types, controls, scrollWheelZoom, markers, height) { |
| 49 | +function createYahooMap(mapElement, centre, zoom, type, types, controls, scrollWheelZoom, markers) { |
50 | 50 | var typesContainType = false; |
51 | 51 | |
52 | 52 | for (var i = 0; i < types.length; i++) { |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | |
62 | 62 | for (i in controls){ |
63 | 63 | if (controls[i].toLowerCase() == 'auto-zoom') { |
64 | | - if (height > 42) controls[i] = height > 100 ? 'zoom' : 'zoom-short'; |
| 64 | + //if (height > 42) controls[i] = height > 100 ? 'zoom' : 'zoom-short'; |
65 | 65 | } |
66 | 66 | |
67 | 67 | switch (controls[i]) { |
Index: trunk/extensions/Maps/YahooMaps/Maps_YahooMapsDispMap.php |
— | — | @@ -45,20 +45,20 @@ |
46 | 46 | * @see MapsBaseMap::addSpecificMapHTML() |
47 | 47 | * |
48 | 48 | */ |
49 | | - public function addSpecificMapHTML() { |
| 49 | + public function addSpecificMapHTML( Parser $parser ) { |
50 | 50 | global $wgOut; |
51 | 51 | |
52 | 52 | $this->output .= Html::element( |
53 | 53 | 'div', |
54 | 54 | array( |
55 | 55 | 'id' => $this->mapName, |
56 | | - 'width' => $this->width, |
57 | | - 'height' => $this->height |
| 56 | + 'style' => "width: $this->width; height: $this->height; background-color: #cccccc;", |
58 | 57 | ), |
59 | | - null |
| 58 | + wfMsg('maps-loading-map') |
60 | 59 | ); |
61 | 60 | |
62 | | - $wgOut->addInlineScript( <<<EOT |
| 61 | + $parser->getOutput()->addHeadItem( |
| 62 | + Html::inlineScript( <<<EOT |
63 | 63 | addOnloadHook( |
64 | 64 | function() { |
65 | 65 | initializeYahooMap( |
— | — | @@ -70,13 +70,12 @@ |
71 | 71 | [$this->types], |
72 | 72 | [$this->controls], |
73 | 73 | $this->autozoom, |
74 | | - [], |
75 | | - $this->height |
| 74 | + [] |
76 | 75 | ); |
77 | 76 | } |
78 | 77 | ); |
79 | 78 | EOT |
80 | | - ); |
| 79 | + ) ); |
81 | 80 | } |
82 | 81 | |
83 | 82 | } |
Index: trunk/extensions/Maps/Maps.i18n.php |
— | — | @@ -20,6 +20,7 @@ |
21 | 21 | 'maps_desc' => "Provides the ability to display coordinate data in maps, and geocode addresses ([http://wiki.bn2vs.com/wiki/Maps demo]). |
22 | 22 | Available mapping services: $1", |
23 | 23 | 'maps_map' => 'Map', |
| 24 | + 'maps-loading-map' => 'Loading map...', |
24 | 25 | |
25 | 26 | // Coordinate handling |
26 | 27 | 'maps-abb-north' => 'N', |
Index: trunk/extensions/Maps/Maps_Settings.php |
— | — | @@ -149,8 +149,8 @@ |
150 | 150 | |
151 | 151 | # General map configuration |
152 | 152 | |
153 | | -# Integer. The default width and height of a map. These values will only be used when the user does not provide them. |
154 | | -$egMapsMapWidth = 600; |
| 153 | +# Integer or string. The default width and height of a map. These values will only be used when the user does not provide them. |
| 154 | +$egMapsMapWidth = '100%'; |
155 | 155 | $egMapsMapHeight = 350; |
156 | 156 | |
157 | 157 | # Array. The minimum and maximum width and height for all maps. First min, then max. Min needs to be smaller then max. |