Discussion MediaWiki:Common.js

Le contenu de la page n’est pas pris en charge dans d’autres langues.
Útá Wikipedia.

Pour avoir openstreetmap dans les articles avec les coordonnées commes dans la première image, il faut ajuster ici le code comme suite. En cliquant sur "Carte" s'ouvre une carte openstreetmap *dans* l'article.

Karte öffnen[kobɔngisa mosólo]

Koordinate oben rechts im Artikel mit „(Karte)“
Artikel mit Karte

Oben rechts im Artikel steht oft eine Koordinate mit einer „(Karte)“.

  • Ein Klick auf (Karte) öffnet die OpenStreetMap-Karte. Ein weiterer Klick schließt die Karte wieder.
  • Ein Klick auf die Koordinate öffnet die Seite „Geohack“. Dort kann die Anzeige des Ortes in verschiedenen anderen Karten gewählt werden.


Installation in anderen Sprachen[kobɔngisa mosólo]

Zur benutzerspezifischen Installation in anderen Wikipedien reicht das Hinzufügen der folgenden Skriptzeilen zur eigenen vector.js oder für alle Nutzer des Projektes in der MediaWiki:Common.js. Dabei sind nur die ersten beiden Zeilen anzupassen:

 var osm_proj_map='map'; //"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";} 
   else {var metaBase = "http://meta.wikimedia.org";}
 importScriptURI(metaBase+'/w/index.php?title=MediaWiki:OSM.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400');

Die Installation ist nur notwendig, wenn die Kartenanwendung nicht schon als Gadget bereitsteht bzw. global für alle installiert ist. Source: de:Hilfe:OpenStreetMap#Installation_in_anderen_Sprachen

Give search results even when page doesn't exist[kobɔngisa mosólo]

Screenshot of the Earth test search, with this script adding links to Wikidata, Reasonator, Commons, and Wikipedia.

Hello, I propose to enable the tool created by Magnus Manske (creator of MediaWiki) to provide results from other languages and Commons (via Wikidata) when a page doesn't exist here: links are added to Special:Search and noarticletext. This helps to encourage translation and to make readers use your wiki more, because they can be sure to find something even if it's not local (rather than searching directly on the biggest wiki). The Italian and Polish Wikipedias, among others already enabled it by default.
Examples: [1] [2] [3]. More information: Magnus blog.
How to: just add the following line at the end of Common.js.

// Results from Wikidata
// [[File:Wdsearch_script_screenshot.png]]
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search' ||  ( mw.config.get( 'wgArticleId' ) === 0 && mw.config.get( 'wgCanonicalSpecialPageName' ) === false ) ) {
	importScriptURI("//en.wikipedia.org/w/index.php?title=MediaWiki:Wdsearch.js&action=raw&ctype=text/javascript");
}

--Nemo 29 apríli 2014 à 14:57 (UTC) (comments, translations and last instructions)[répondre]