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&am...');
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.
Some things I don't know: *Get we trouble with this centralise way? (Other geotemplates ... ?) *Need we an maxage-parameter in the url? *Do we need support of https like under [1]? I don't believe so. *Is there perhaps a performance problem? *Is there a way to work without the hard coding of project language?
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?
Greetings Kolossos
[1]http://commons.wikimedia.org/wiki/Help:Gadget-HotCat#Installing_HotCat_on_an... [2]http://pl.wikipedia.org/wiki/Wikipedysta:Kolossos/vector.js [3]http://de.wikipedia.org/wiki/Benutzer:Kolossos/Gadget-OSM.js
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&am...');
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.
Platonides schrieb:
*Is there perhaps a performance problem?
In what sense?
I mean that we need to be sure that it works with squid caches but how you explained it sound good. I would have no problem with meta, so we need a meta admin. Somebody here?
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 far I know a extension review process needs often very long, so I'm not sure that this is the best way.
Greetings Kolossos
Hello together, we have now: http://meta.wikimedia.org/wiki/MediaWiki:OSM.js
So to install the OSM-map in WP you need only to insert the following script inside your Wikipedia and modify the first two lines:
var osm_proj_map='mapa'; //"map" in project language var osm_proj_lang='pl'; //project language
if (wgServer == "https://secure.wikimedia.org") {var metaBase = "https://secure.wikimedia.org/wikipedia/meta%22;%7D else {var metaBase = "http://meta.wikimedia.org%22;%7D
importScriptURI(metaBase+'/w/index.php?title=MediaWiki:OSM.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400');
Greeting Kolossos