r83904 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83903‎ | r83904 | r83905 >
Date:15:29, 14 March 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
rem obsolete code and adding some new files for new stuff
Modified paths:
  • /branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMaps.php (modified) (history)
  • /branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMapsFormInput.php (deleted) (history)
  • /branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMapsForms.js (deleted) (history)
  • /branches/SemanticMaps0.8/includes/services/GoogleMaps/jquery.googlemaps2input.js (deleted) (history)
  • /branches/SemanticMaps0.8/includes/services/GoogleMaps3/jquery.gmapsmultiinput.js (added) (history)
  • /branches/SemanticMaps0.8/includes/services/YahooMaps/ext.sm.yahoomaps.js (added) (history)

Diff [purge]

Index: branches/SemanticMaps0.8/includes/services/GoogleMaps3/jquery.gmapsmultiinput.js
@@ -0,0 +1,3 @@
 2+/**
 3+ *
 4+ */
\ No newline at end of file
Property changes on: branches/SemanticMaps0.8/includes/services/GoogleMaps3/jquery.gmapsmultiinput.js
___________________________________________________________________
Added: svn:eol-style
15 + native
Index: branches/SemanticMaps0.8/includes/services/YahooMaps/ext.sm.yahoomaps.js
@@ -0,0 +1,3 @@
 2+/**
 3+ *
 4+ */
\ No newline at end of file
Property changes on: branches/SemanticMaps0.8/includes/services/YahooMaps/ext.sm.yahoomaps.js
___________________________________________________________________
Added: svn:eol-style
15 + native
Index: branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMapsFormInput.php
@@ -1,50 +0,0 @@
2 -<?php
3 -
4 -/**
5 - * Class for Google Maps v2 form inputs.
6 - *
7 - * @file SM_GoogleMapsFormInput.php
8 - * @ingroup SMGoogleMaps
9 - *
10 - * @author Jeroen De Dauw
11 - * @author Robert Buzink
12 - * @author Yaron Koren
13 - */
14 -class SMGoogleMapsFormInput extends SMFormInput {
15 -
16 - /**
17 - * @see SMFormInput::getShowAddressFunction
18 - *
19 - * @since 0.6.5
20 - */
21 - protected function getShowAddressFunction() {
22 - global $egGoogleMapsKey;
23 - return $egGoogleMapsKey == '' ? false : 'showGAddress';
24 - }
25 -
26 - /**
27 - * @see smw/extensions/SemanticMaps/FormInputs/SMFormInput#addFormDependencies()
28 - */
29 - protected function addFormDependencies() {
30 - global $wgOut;
31 - global $smgScriptPath, $smgStyleVersion;
32 -
33 - $this->service->addDependency( Html::linkedScript( "$smgScriptPath/includes/services/GoogleMaps/SM_GoogleMapsForms.js?$smgStyleVersion" ) );
34 - $this->service->addDependencies( $wgOut );
35 - }
36 -
37 - /**
38 - * @see MapsMapFeature::getMapHTML
39 - */
40 - public function getMapHTML() {
41 - return Html::element(
42 - 'div',
43 - array(
44 - 'id' => $this->service->getMapId( false ),
45 - 'style' => "width: $this->width; height: $this->height; background-color: #cccccc; overflow: hidden;",
46 - ),
47 - wfMsg( 'maps-loading-map' )
48 - );
49 - }
50 -
51 -}
\ No newline at end of file
Index: branches/SemanticMaps0.8/includes/services/GoogleMaps/jquery.googlemaps2input.js
@@ -1,18 +0,0 @@
2 -/**
3 - * JavasSript for the Google Maps v2 form input of the Semantic Maps extension.
4 - * @see http://www.mediawiki.org/wiki/Extension:Semantic_Maps
5 - *
6 - * @since 0.8
7 - * @ingroup SemanticMaps
8 - *
9 - * @licence GNU GPL v3
10 - * @author Jeroen De Dauw <jeroendedauw at gmail dot com>
11 - */
12 -
13 -(function( $ ){ $.fn.googlemaps2input = function( options ) {
14 -
15 -
16 -
17 - return this;
18 -
19 -}; })( jQuery );
\ No newline at end of file
Index: branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMapsForms.js
@@ -1,64 +0,0 @@
2 - /**
3 - * Javascript functions for Google Maps functionality in Semantic Maps
4 - *
5 - * @file SM_GoogleMapFunctions.js
6 - * @ingroup SMGoogleMaps
7 - *
8 - * @author Jeroen De Dauw
9 - */
10 -
11 -/**
12 - * This function holds specific functionality for the Google Maps form input of Semantic Maps
13 - */
14 -function makeGoogleMapFormInput( mapName, locationFieldName, mapOptions, marker_lat, marker_lon ) {
15 - if ( GBrowserIsCompatible() ) {
16 - mapOptions.centre = new GLatLng(mapOptions.lat, mapOptions.lon);
17 - var map = createGoogleMap( mapName, mapOptions, [ { "lat": marker_lat, "lon": marker_lon, "title": "", "label": "", "icon": "" } ] );
18 -
19 - // Show a starting marker only if marker coordinates are provided
20 - if ( marker_lat != null && marker_lon != null ) {
21 - map.addOverlay( new GMarker( new GLatLng( marker_lat, marker_lon ) ) );
22 - }
23 -
24 - // Click event handler for updating the location of the marker
25 - GEvent.addListener(map, "click",
26 - function(overlay, point) {
27 - if (overlay) {
28 - map.removeOverlay(overlay);
29 - } else {
30 - map.clearOverlays();
31 - document.getElementById(locationFieldName).value = convertLatToDMS(point.y)+', '+convertLngToDMS(point.x);
32 - map.addOverlay(new GMarker(point));
33 - map.panTo(point);
34 - }
35 - }
36 - );
37 -
38 - // Make the map variable available for other functions
39 - if (!window.GMaps) window.GMaps = new Object;
40 - eval("window.GMaps." + mapName + " = map;");
41 - }
42 -}
43 -
44 -/**
45 - * This function holds specific functionality for the Google Maps form input of Semantic Maps.
46 - */
47 -function showGAddress(address, mapName, outputElementName, notFoundFormat) {
48 - var map = GMaps[mapName];
49 - var geocoder = new GClientGeocoder();
50 -
51 - geocoder.getLatLng(address,
52 - function(point) {
53 - if (!point) {
54 - window.alert(address + ' ' + notFoundFormat);
55 - } else {
56 - map.clearOverlays();
57 - map.setCenter(point, 14);
58 - var marker = new GMarker(point);
59 - map.addOverlay(marker);
60 - document.getElementById(outputElementName).value = convertLatToDMS(point.y) + ', ' + convertLngToDMS(point.x);
61 - }
62 - }
63 - );
64 -
65 -}
\ No newline at end of file
Index: branches/SemanticMaps0.8/includes/services/GoogleMaps/SM_GoogleMaps.php
@@ -27,11 +27,7 @@
2828
2929 $wgAutoloadClasses['SMGoogleMapsQP'] = dirname( __FILE__ ) . '/SM_GoogleMapsQP.php';
3030
31 - // TODO: the if should not be needed, but when omitted, a fatal error occurs cause the class that's extended by this one is not found.
32 - if ( defined( 'SF_VERSION' ) ) $wgAutoloadClasses['SMGoogleMapsFormInput'] = dirname( __FILE__ ) . '/SM_GoogleMapsFormInput.php';
33 -
3431 MapsMappingServices::registerServiceFeature( 'googlemaps2', 'qp', 'SMMapPrinter' );
35 - MapsMappingServices::registerServiceFeature( 'googlemaps2', 'fi', 'SMGoogleMapsFormInput' );
3632
3733 return true;
3834 }
\ No newline at end of file

Status & tagging log