Yurik has uploaded a new change for review.
https://gerrit.wikimedia.org/r/291568
Change subject: First step cleaning up resources
......................................................................
First step cleaning up resources
This does not solve the bug, but it should help
make the next step of cleaning it up.
Also, resource 'ext.kartographer' is renamed to
'ext.kartographer.settings'
Bug: T134079
Change-Id: Iac8cb9e89b3a210e50ea9eb5588bd9b27d6692fc
---
M extension.json
M modules/ve-maps/ve.ce.MWInlineMapsNode.js
M modules/ve-maps/ve.ce.MWMapsNode.js
R styles/ve.ui.MWMaps.css
4 files changed, 23 insertions(+), 13 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer
refs/changes/68/291568/1
diff --git a/extension.json b/extension.json
index 063b80a..d09b348 100644
--- a/extension.json
+++ b/extension.json
@@ -33,10 +33,12 @@
"mapdata": "Kartographer\\ApiQueryMapData"
},
"ResourceModules": {
- "ext.kartographer": {
+ "ext.kartographer.settings": {
+ "_info_": "Set JS configuration for Kartographer, like
available scaling factors, styles, etc. Used by live & visualeditor resources,
loaded by VE ve.ce.MWInlineMapsNode & ve.ce.MWMapsNode",
"class": "Kartographer\\DataModule"
},
"ext.kartographer.style": {
+ "_info_": "Styles for maplink, mapframe, fullscreen
(TODO: maybe we should break it into separate modules). Loaded by mapframe &
maplink tag handlers",
"styles": [
"styles/kartographer.less"
],
@@ -46,6 +48,7 @@
]
},
"ext.kartographer.site": {
+ "_info_": "Site-customized css & js, should only be
loaded for <mapframe>, fullscreen, and edit. Used by live & fullscreen
resources",
"class": "ResourceLoaderWikiModule",
"scripts": [
"MediaWiki:Kartographer.js"
@@ -59,6 +62,7 @@
]
},
"mapbox": {
+ "_info_": "External mapframe lib, handles drawing of
the map. Used by live and leaflet.draw resources",
"scripts": [
"lib/mapbox/mapbox-lib.js",
"lib/mapbox/mapbox.i18n.js"
@@ -79,6 +83,7 @@
]
},
"leaflet.draw": {
+ "_info_": "External leaflet lib to allow visual geojson
editing in the VE map dialog, loaded by editor resource",
"dependencies": [
"mapbox"
],
@@ -130,13 +135,14 @@
]
},
"ext.kartographer.live": {
+ "_info_": "Show interactive map - required by
<mapframe>, fullscreen, editor. Used by editor resource. Loaded by all tags and
ve.ce.MWMapsNode",
"dependencies": [
- "mapbox",
- "ext.kartographer",
- "ext.kartographer.site",
- "mediawiki.jqueryMsg",
"oojs-ui.styles.icons-media",
- "mediawiki.router"
+ "mediawiki.jqueryMsg",
+ "mediawiki.router",
+ "mapbox",
+ "ext.kartographer.settings",
+ "ext.kartographer.site"
],
"scripts": [
"lib/leaflet.sleep.js",
@@ -150,10 +156,12 @@
"desktop"
]
},
+
"ext.kartographer.fullscreen": {
+ "_info_": "Loaded when user clicks on a maplink or
expands a mapframe, from JS in openFullscreenMap()",
"dependencies": [
- "ext.kartographer.site",
- "oojs-ui-windows"
+ "oojs-ui-windows",
+ "ext.kartographer.site"
],
"scripts": [
"modules/kartographer.MapDialog.js"
@@ -168,6 +176,7 @@
]
},
"ext.kartographer.editor": {
+ "_info_": "Loaded by VE map editor dialog -
ve.ui.MWMapsDialog",
"dependencies": [
"leaflet.draw",
"ext.kartographer.live"
@@ -178,6 +187,7 @@
]
},
"ext.kartographer.visualEditor": {
+ "_info_": "Loads css & js for the VE map support. Used
only by VisualEditorPluginModules setting below",
"scripts": [
"modules/ve-maps/ve.dm.MWInlineMapsNode.js",
"modules/ve-maps/ve.ce.MWInlineMapsNode.js",
@@ -187,7 +197,7 @@
"modules/ve-maps/ve.ui.MWMapsTool.js"
],
"styles": [
- "modules/ve-maps/ve.ui.MWMaps.css"
+ "styles/ve.ui.MWMaps.css"
],
"messages": [
"visualeditor-mwmapsdialog-geojson",
@@ -196,10 +206,10 @@
"visualeditor-mwmapsdialog-title"
],
"dependencies": [
- "ext.visualEditor.mwcore",
"jquery.throttle-debounce",
"oojs-ui.styles.icons-location",
- "ext.kartographer"
+ "ext.visualEditor.mwcore",
+ "ext.kartographer.settings"
],
"targets": [
"mobile",
diff --git a/modules/ve-maps/ve.ce.MWInlineMapsNode.js
b/modules/ve-maps/ve.ce.MWInlineMapsNode.js
index 27061fb..828af8c 100644
--- a/modules/ve-maps/ve.ce.MWInlineMapsNode.js
+++ b/modules/ve-maps/ve.ce.MWInlineMapsNode.js
@@ -21,7 +21,7 @@
ve.ce.MWInlineMapsNode.super.apply( this, arguments );
// Ensure we have the styles to render the map node
- mw.loader.using( 'ext.kartographer' );
+ mw.loader.using( 'ext.kartographer.settings' );
// DOM changes
this.$element.addClass( 've-ce-mwInlineMapsNode' );
diff --git a/modules/ve-maps/ve.ce.MWMapsNode.js
b/modules/ve-maps/ve.ce.MWMapsNode.js
index 612af79..bd99d32 100644
--- a/modules/ve-maps/ve.ce.MWMapsNode.js
+++ b/modules/ve-maps/ve.ce.MWMapsNode.js
@@ -34,7 +34,7 @@
this.connect( this, { focus: 'onMapFocus' } );
// Ensure we have the styles to render the map node
- mw.loader.using( 'ext.kartographer' );
+ mw.loader.using( 'ext.kartographer.settings' );
// DOM changes
this.$element
diff --git a/modules/ve-maps/ve.ui.MWMaps.css b/styles/ve.ui.MWMaps.css
similarity index 100%
rename from modules/ve-maps/ve.ui.MWMaps.css
rename to styles/ve.ui.MWMaps.css
--
To view, visit https://gerrit.wikimedia.org/r/291568
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac8cb9e89b3a210e50ea9eb5588bd9b27d6692fc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: Yurik <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits