Tim Alder wrote:
Hello,
I see that we are running in a problem if we integrate OSM-map in many,
many language versions of WP (with copies of JavaScript) and must than
change something like moving the script to an other server or want to
integrate some additional parameters like "pagename"... So it would be
nice to link to one central file. I get a hint that this is possible and
other extensions like hotcat goes also this way[1].
So, for testing I wrote:
var osm_proj_map='mapa';
var osm_proj_lang='pl';
importScriptURI
('http://de.wikipedia.org/w/index.php?title=Benutzer:Kolossos/Gadget-OSM.js&action=raw');
in my vector.js in pl.wp[2] and it works with full localisation and
reference to my Gadget-OSM.js[3] version in german WP.
The right place for the central file would be offcourse en.wp or de.wp
in the safe MediaWiki namespace.
No, the right place would be meta.
Some things I don't know:
*Get we trouble with this centralise way? (Other geotemplates ... ?)
*Need we an maxage-parameter in the url?
The maxage parameter would make squids
cache it. Since this just one
file, it seems a good idea.
*Do we need support of https like under [1]? I
don't believe so.
Why not? Not serving http scripts to a https connection is a
good thing.
*Is there perhaps a performance problem?
In what
sense?
*Is there a way to work without the hard coding of
project language?
There's
var osm_proj_lang = wgContentLanguage;
but that would break on a few corner cases, such as Simple English which
would be taken as being the English Wikipedia. I don't know what is
osm_proj_lang then used for, though. It may be acceptable.
The other option is to extract it from wgServer.
I think we would have a big benefit especially for
smaller language
versions, they have really problems to stay up-to-date, as example I can
find there for the geohack old URLs like
http://stable.toolserver.org
and also
http://tools.wikimedia.de/ .
But also the clean-up of the commons.js would be a benefit.
Comments?
Another option would be making a mediawiki extension which just included
that javascript. That would allow to easily enable it on all projects or
per project basis, bumping the versions, fetch the current wiki data, etc.
As a sidenote, the global gadgets feature request, would perfectly fit
this, if they existed.