Page MenuHomePhabricator

Create a module that would load MediaWiki:Kartographer.{js|css} on pages with maps
Closed, ResolvedPublic

Description

...to enable customization. Load it by default on pages with mapframes, on demand (user click) with maplinks.

Details

Related Gerrit Patches:
mediawiki/extensions/Kartographer : masterAdd the ability to customize maps with Kartogrpher.{js|css}

Event Timeline

MaxSem created this task.Apr 28 2016, 9:55 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 28 2016, 9:55 PM
Yurik added a comment.EditedApr 28 2016, 10:09 PM

Should there be a js-config level setting KartographerCssLoaded and KartographerJsLoaded? This way <mapframe> will set them both to true, and for pages with <maplink> but without <mapframe> it will set them to false unless they don't exist. This way a wiki that has no MediaWiki:Kartographer.css will not try to load it before showing a map on click.

Yurik moved this task from Unsorted to General on the Maps (Kartographer) board.Apr 29 2016, 8:57 PM

Change 286252 had a related patch set uploaded (by MaxSem):
Add the ability to customize maps with Kartogrpher.{js|css}

https://gerrit.wikimedia.org/r/286252

Change 286252 merged by jenkins-bot:
Add the ability to customize maps with Kartogrpher.{js|css}

https://gerrit.wikimedia.org/r/286252

Should there be a js-config level setting KartographerCssLoaded and KartographerJsLoaded? This way <mapframe> will set them both to true, and for pages with <maplink> but without <mapframe> it will set them to false unless they don't exist. This way a wiki that has no MediaWiki:Kartographer.css will not try to load it before showing a map on click.

You could have <mapframe> use $parser->getOutput()->addModules('ext.kartographer.site') and for <maplink> run mw.loader.load('ext.kartographer.site') which is a no-op if it's already loaded?

ResourceLoader will automatically mark the module as empty if MediaWiki:Kartographer.css doesn't exist, see ResourceLoaderWikiModule::isKnownEmpty().

Yurik closed this task as Resolved.May 3 2016, 12:38 AM

@Legoktm thanks for checking, per IRC, all is good, works great. @MaxSem, well implemented, thanks!

Isn't there meant to be a general ban on adding new site modules, given the performance impacts? I'm disappointed this was executed so quickly without opportunity for comment. :-(

Restricted Application added a project: Discovery. · View Herald TranscriptJun 12 2016, 2:59 AM