r63614 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63613‎ | r63614 | r63615 >
Date:20:34, 11 March 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Some quicke improvements for 0.2
Modified paths:
  • /trunk/extensions/UKGeocodingForMaps/GoogleMaps/UKG_GoogleMapsDispUkPoint.php (modified) (history)
  • /trunk/extensions/UKGeocodingForMaps/INSTALL (modified) (history)
  • /trunk/extensions/UKGeocodingForMaps/README (modified) (history)
  • /trunk/extensions/UKGeocodingForMaps/UKGeocodingForMaps.i18n.php (modified) (history)
  • /trunk/extensions/UKGeocodingForMaps/UKGeocodingForMaps.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UKGeocodingForMaps/INSTALL
@@ -1,4 +1,4 @@
2 -You can get version 0.1 from SVN at
 2+You can get version 0.2 from SVN at
33
44 http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/UKGeocodingForMaps/
55
Index: trunk/extensions/UKGeocodingForMaps/UKGeocodingForMaps.i18n.php
@@ -19,6 +19,8 @@
2020 // General
2121 'ukgeocoding_name' => 'UK Geocoding for Maps',
2222 'ukgeocoding_desc' => 'Extends Maps with a display_uk_point parser function with Google Maps implementation',
 23+
 24+ 'ukgeocoding_couldNotGeocode' => 'One or more postalcodes could not be geocoded and have been omitted from the map.',
2325 );
2426
2527 /** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца))
Index: trunk/extensions/UKGeocodingForMaps/UKGeocodingForMaps.php
@@ -21,7 +21,7 @@
2222 die( 'Not an entry point.' );
2323 }
2424
25 -define('UKG_VERSION', '0.1');
 25+define('UKG_VERSION', '0.2 a1');
2626
2727 $ukggScriptPath = (isset($wgExtensionAssetsPath) && $wgExtensionAssetsPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions') . '/UKGeocodingForMaps';
2828 $ukggDir = dirname( __FILE__ ) . '/';
@@ -51,7 +51,7 @@
5252 'path' => __FILE__,
5353 'name' => wfMsg( 'ukgeocoding_name' ),
5454 'version' => UKG_VERSION,
55 - 'author' => array('[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw] for Neill Mitchell at Prescient Software Ltd'),
 55+ 'author' => array( '[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De Dauw] for Neill Mitchell at Prescient Software Ltd' ),
5656 'url' => 'http://www.mediawiki.org/wiki/Extension:UK_geocoding_for_Maps',
5757 'descriptionmsg' => 'ukgeocoding_desc',
5858 );
Index: trunk/extensions/UKGeocodingForMaps/GoogleMaps/UKG_GoogleMapsDispUkPoint.php
@@ -52,10 +52,10 @@
5353 protected function doMapServiceLoad() {
5454 global $egGoogleMapsOnThisPage, $loadedAjaxApi, $egGoogleAjaxSearchKey;
5555
56 - MapsGoogleMaps::addGMapDependencies($this->output);
 56+ MapsGoogleMaps::addGMapDependencies( $this->output );
5757 $egGoogleMapsOnThisPage++;
5858
59 - if (!$loadedAjaxApi) {
 59+ if ( !$loadedAjaxApi ) {
6060 $this->output .= "<script src='http://www.google.com/uds/api?file=uds.js&v=1.0&key=$egGoogleAjaxSearchKey' type='text/javascript'></script>";
6161 $loadedAjaxApi = true;
6262 }
@@ -70,10 +70,13 @@
7171 public function addSpecificMapHTML() {
7272 global $wgJsMimeType;
7373
74 - $onloadFunctions = MapsGoogleMaps::addOverlayOutput($this->output, $this->mapName, $this->overlays, $this->controls);
 74+ $onloadFunctions = MapsGoogleMaps::addOverlayOutput( $this->output, $this->mapName, $this->overlays, $this->controls );
7575
 76+ $couldNotGeocodeMsg = Xml::escapeJsString( wfMsg( 'ukgeocoding_couldNotGeocode' ) );
 77+
7678 $this->output .=<<<EOT
7779 <div id="$this->mapName"></div>
 80+<div id="{$this->mapName}_errors"></div>
7881 <script type="$wgJsMimeType"> /*<![CDATA[*/
7982 addOnloadHook( function() {
8083 var map = initializeGoogleMap('$this->mapName',
@@ -91,13 +94,13 @@
9295 []
9396 );
9497 var localSearch = new GlocalSearch();
95 - function usePointFromPostcode(marker, callbackFunction) {
96 - localSearch.setSearchCompleteCallback(null,
 98+ function usePointFromPostcode( marker, callbackFunction ) {
 99+ localSearch.setSearchCompleteCallback( null,
97100 function() {
98 - if (localSearch.results[0]) {
 101+ if ( localSearch.results[0] ) {
99102 callbackFunction(new GLatLng(localSearch.results[0].lat, localSearch.results[0].lng), marker);
100 - }else{
101 - alert("Postcode not found!");
 103+ } else {
 104+ document.getElementById( '{$this->mapName}_errors' ).innerHTML = '$couldNotGeocodeMsg';
102105 }
103106 }
104107 );
Index: trunk/extensions/UKGeocodingForMaps/README
@@ -4,5 +4,5 @@
55 of Maps could not be used, and this extension should be seen as a sort of hack. Initial
66 development for this extension was funded by Neill Mitchell for Prescient Software Ltd.
77
8 -Version 0.1 is an experimental release, in which multiple issues are expected. I'm hoping to
 8+Version 0.2 is an experimental release, in which multiple issues are expected. I'm hoping to
99 polish the whole extension a little more once I have some free time. Bug reports are welcome though.
\ No newline at end of file

Status & tagging log