diff options
Diffstat (limited to 'www/wiki/extensions/Maps/src/MapsSetup.php')
-rw-r--r-- | www/wiki/extensions/Maps/src/MapsSetup.php | 256 |
1 files changed, 0 insertions, 256 deletions
diff --git a/www/wiki/extensions/Maps/src/MapsSetup.php b/www/wiki/extensions/Maps/src/MapsSetup.php index d397e632..245d3915 100644 --- a/www/wiki/extensions/Maps/src/MapsSetup.php +++ b/www/wiki/extensions/Maps/src/MapsSetup.php @@ -48,9 +48,7 @@ class MapsSetup { } private function registerAllTheThings() { - $this->registerWebResources(); $this->registerParserHooks(); - $this->registerMappingServices(); $this->registerPermissions(); $this->registerParameterTypes(); $this->registerHooks(); @@ -76,13 +74,6 @@ class MapsSetup { } } - private function registerWebResources() { - $this->mwGlobals['wgResourceModules'] = array_merge( - $this->mwGlobals['wgResourceModules'], - include __DIR__ . '/../Maps.resources.php' - ); - } - private function registerParserHooks() { if ( $this->mwGlobals['egMapsEnableCoordinateFunction'] ) { $this->mwGlobals['wgHooks']['ParserFirstCallInit'][] = function ( Parser &$parser ) { @@ -154,253 +145,6 @@ class MapsSetup { }; } - private function registerMappingServices() { - $localBasePath = __DIR__ . '/../resources'; - $remoteExtPath = 'Maps/resources'; - - $this->registerGoogleMapsModules( $localBasePath, $remoteExtPath ); - - $this->registerLeafletModules( $localBasePath, $remoteExtPath ); - } - - private function registerGoogleMapsModules( string $localBasePath, string $remoteExtPath ) { - global $wgResourceModules; - - $localBasePath = $localBasePath . '/GoogleMaps'; - $remoteExtPath = $remoteExtPath . '/GoogleMaps'; - - $wgResourceModules['ext.maps.googlemaps3'] = [ - 'dependencies' => [ 'ext.maps.common' ], - 'localBasePath' => $localBasePath, - 'remoteExtPath' => $remoteExtPath, - 'group' => 'ext.maps', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'jquery.googlemap.js', - 'ext.maps.googlemaps3.js' - ], - 'messages' => [ - 'maps-googlemaps3-incompatbrowser', - 'maps-copycoords-prompt', - 'maps-searchmarkers-text', - 'maps-fullscreen-button', - 'maps-fullscreen-button-tooltip', - ] - ]; - - $wgResourceModules['ext.maps.gm3.markercluster'] = [ - 'localBasePath' => $localBasePath . '/gm3-util-library', - 'remoteExtPath' => $remoteExtPath . '/gm3-util-library', - 'group' => 'ext.maps', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'markerclusterer.js', - ], - ]; - - $wgResourceModules['ext.maps.gm3.markerwithlabel'] = [ - 'localBasePath' => $localBasePath . '/gm3-util-library', - 'remoteExtPath' => $remoteExtPath . '/gm3-util-library', - 'group' => 'ext.maps', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'markerwithlabel.js', - ], - 'styles' => [ - 'markerwithlabel.css', - ], - ]; - - $wgResourceModules['ext.maps.gm3.geoxml'] = [ - 'localBasePath' => $localBasePath . '/geoxml3', - 'remoteExtPath' => $remoteExtPath . '/geoxml3', - 'group' => 'ext.maps', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'geoxml3.js', - 'ZipFile.complete.js', //kmz handling - 'ProjectedOverlay.js', //Overlay handling - ], - ]; - - $wgResourceModules['ext.maps.gm3.earth'] = [ - 'localBasePath' => $localBasePath . '/gm3-util-library', - 'remoteExtPath' => $remoteExtPath . '/gm3-util-library', - 'group' => 'ext.maps', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'googleearth-compiled.js', - ], - ]; - - $wgResourceModules['ext.sm.googlemaps3ajax'] = [ - 'localBasePath' => $localBasePath, - 'remoteExtPath' => $remoteExtPath, - 'group' => 'ext.maps', - 'dependencies' => [ - 'ext.maps.googlemaps3', - 'ext.sm.common' - ], - 'scripts' => [ - 'ext.sm.googlemaps3ajax.js' - ] - ]; - } - - private function registerLeafletModules( string $localBasePath, string $remoteExtPath ) { - global $wgResourceModules; - - $localBasePath = $localBasePath . '/leaflet'; - $remoteExtPath = $remoteExtPath . '/leaflet'; - - $wgResourceModules['ext.maps.leaflet.base'] = [ - 'localBasePath' => $localBasePath . '/leaflet', - 'remoteExtPath' => $remoteExtPath . '/leaflet', - 'group' => 'ext.maps', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'leaflet.js', - ], - 'styles' => [ - 'leaflet.css', - ], - ]; - - $wgResourceModules['ext.maps.leaflet'] = [ - 'dependencies' => [ - 'ext.maps.common', - 'ext.maps.services', - 'ext.maps.leaflet.base' - ], - 'localBasePath' => $localBasePath, - 'remoteExtPath' => $remoteExtPath, - 'group' => 'ext.maps', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'jquery.leaflet.js', - 'ext.maps.leaflet.js', - ], - 'messages' => [ - 'maps-markers', - 'maps-copycoords-prompt', - 'maps-searchmarkers-text', - ], - ]; - - $wgResourceModules['ext.maps.leaflet.fullscreen'] = [ - 'dependencies' => [ 'ext.maps.leaflet' ], - 'localBasePath' => $localBasePath . '/leaflet.fullscreen', - 'remoteExtPath' => $remoteExtPath . '/leaflet.fullscreen', - 'group' => 'ext.maps', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'Control.FullScreen.js', - ], - 'styles' => [ - 'Control.FullScreen.css', - ], - ]; - - $wgResourceModules['ext.maps.leaflet.markercluster'] = [ - 'dependencies' => [ 'ext.maps.leaflet' ], - 'localBasePath' => $localBasePath . '/leaflet.markercluster', - 'remoteExtPath' => $remoteExtPath . '/leaflet.markercluster', - 'group' => 'ext.maps', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'leaflet.markercluster.js', - ], - 'styles' => [ - 'MarkerCluster.css', - ], - ]; - - $wgResourceModules['ext.maps.leaflet.providers'] = [ - 'dependencies' => [ 'ext.maps.leaflet' ], - 'localBasePath' => $localBasePath . '/leaflet-providers', - 'remoteExtPath' => $remoteExtPath . '/leaflet-providers', - 'group' => 'ext.maps', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'leaflet-providers.js', - ], - ]; - - $wgResourceModules['ext.maps.leaflet.editable'] = [ - 'dependencies' => [ 'ext.maps.leaflet.base' ], - 'localBasePath' => $localBasePath . '/leaflet.editable', - 'remoteExtPath' => $remoteExtPath . '/leaflet.editable', - 'group' => 'ext.maps', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'Leaflet.Editable.js', - ], - ]; - - $wgResourceModules['ext.maps.leaflet.editor'] = [ - 'dependencies' => [ - 'ext.maps.leaflet.base', - //'ext.maps.leaflet.editable' - ], - 'localBasePath' => $localBasePath, - 'remoteExtPath' => $remoteExtPath, - 'group' => 'ext.maps', - 'targets' => [ - 'mobile', - 'desktop' - ], - 'scripts' => [ - 'leaflet.editor.js', - ], - ]; - - $wgResourceModules['ext.sm.leafletajax'] = [ - 'localBasePath' => $localBasePath, - 'remoteExtPath' => $remoteExtPath, - 'group' => 'ext.maps', - 'dependencies' => [ - 'ext.maps.leaflet', - 'ext.sm.common' - ], - 'scripts' => [ - 'ext.sm.leafletajax.js' - ] - ]; - } - private function registerPermissions() { $this->mwGlobals['wgAvailableRights'][] = 'geocode'; |