Benutzer:Habitator terrae/WikiMap URL-Generator

aus Wikipedia, der freien Enzyklopädie
<!DOCTYPE html>
<html lang="de">
<head>
<title>
	WikiMap URL-Generator
</title>
<meta charset="UTF-8"/>
<style>
	body, a:target {color:#000}
	form a:target, form label input:checked+label, form label input:checked {font-weight:bold}
	form a:not(:target)+*+*+*+*+a, form a:not(:target)+*+*+*+*+*+*+*+*+*+*+ul {display:none}
	.ext {float:right;font-size:2em}
	#Attribution {position:fixed;right:0;bottom:0;background:#FFF}
</style>
<script>
	//Start
	window.onload = function () {
		sprache();projekt();cluster();karte();locator(),sidebar(),bearing();region();year();
		lat();lon();wp();commons();zoom();allco();
		kat();subcats();subcatdepth();
		page();linksto();linkshere();shape();
		nutz();
		kml();
	};
	
	//Allgemeine Rechenmethoden
	function eingabe(fu) {return document.querySelector('[onchange^='+fu+']')}
	function ausgabe(fu, e, n) {if (n) {rechnen(fu, e, n+5)} else {while (n<5) {n++; rechnen(fu, e, n+5)}}}
	function rechnen(fu, e, n) {
		e = e + "";
		array = document.querySelector(".ext:nth-child("+n+")").href;
		if (array.indexOf("?") == -1) {
			array = array + "?";
		} else {
		array = array + "&";
		}
		array = array.split(fu+"=");
		array = array[0] + fu + "=" + ("a"+array[1]).replace(/[^&]+/, e.replace(/&/g, "%26").replace(/\?/g, "%3F").replace(/ /g, "_").replace(/\=/g, "%3D"))+"  ";
		document.querySelector(".ext:nth-child("+n+")").href = array.replace(fu+"=&","").replace(fu+"= ","").replace("& ","").replace("? ","").replace(/ /g,"");
	}
	
	//Spezialfunktion für das wählen zwischen Wikipedia und Commons bei den Kategorien und Nutzern
	function wiki() {
		var r = document.querySelector("a:nth-child(7)").href;
		var s = document.querySelector("a:nth-child(9)").href;
		if (document.getElementById("cat").checked) {
			document.querySelector("a:nth-child(7)").href = r.replace("wpcat","cat");
			ausgabe("lang", "", 2);
		} else {
			document.querySelector("a:nth-child(7)").href = r.replace("cat","wpcat").replace("wpwp", "wp");
			ausgabe("lang", eingabe("sprache").value, 2);
		}
		if (document.getElementById("user").checked) {
			document.querySelector("a:nth-child(9)").href = s.replace("wpuser","user");
			ausgabe("lang", "", 4);
		} else {
			document.querySelector("a:nth-child(9)").href = s.replace("user","wpuser").replace("wpwp", "wp");
			ausgabe("lang", eingabe("sprache").value, 4);
		}
	}
	
	//Einzelne Funktionen
	function sprache() {ausgabe("lang", eingabe("sprache").value, 0);wiki();}
	function projekt() {if (eingabe("projekt").checked){ausgabe("project", "", 0)} else {ausgabe("project", "wikivoyage", 0)}}
	function cluster() {
		var array = ["false",""];
		if (eingabe("subcats").checked) {array = ["","true"];}
		if (eingabe("cluster").checked) {ausgabe("cluster", array[1], 0)}
		else {ausgabe("cluster", array[0], 0)}
	}
	function karte() {if (eingabe("karte").checked){ausgabe("basemap", "", 0)} else {ausgabe("basemap", "2", 0)}}
	function locator() {if (eingabe("locator").checked) {ausgabe("locator", "true", 0)} else {ausgabe("locator", "", 0)}}
	function sidebar() {if (eingabe("sidebar").checked) {ausgabe("sidebar", "", 0)} else {ausgabe("sidebar", "false", 0)}}
	function bearing() {if (eingabe("bearing").checked) {ausgabe("bearing", "", 0)} else {ausgabe("bearing", "false", 0)}}
	function image() {if (eingabe("image").checked) {ausgabe("image", "", 0)} else {ausgabe("image", "false", 0)}}
	function region() {if (eingabe("region").value == "90|-180|-90|180"){ausgabe("region", "", 0)} else {ausgabe("region", eingabe("region").value.replace(",","."), 0)}}
	function year() {
		var von = Math.round(document.getElementById("von").value);
		var bis = Math.round(document.getElementById("bis").value);
		var text = von + "-" + bis;
		if (von === bis) {text = bis + "";}
		if (!von||von < 2000) {text = text.replace(/[0-9]+\-/, "0000-");}
		if (bis < 2000||bis < von) {text = "0000";}
		if (bis == "") {text = text.replace("-", "") + "-";}
		if (bis == "" && von == "") {text = "";}
		ausgabe("year", text, 0);
	}
	
	function lat() {if (eingabe("lat").value == "auto"){ausgabe("lat", "", 1)} else {ausgabe("lat", eingabe("lat").value.replace(",","."), 1)}}
	function lon() {if (eingabe("lon").value == "auto"){ausgabe("lon", "", 1)} else {ausgabe("lon", eingabe("lon").value.replace(",","."), 1)}}
	function wp() {if (eingabe("wp").checked) {ausgabe("wp", "", 1)} else {ausgabe("wp", "false", 1)}}
	function commons() {if (eingabe("commons").checked) {ausgabe("commons", "", 1)} else {ausgabe("commons", "false", 1)}}
	function zoom() {if (eingabe("zoom").value == 13){ausgabe("zoom", "", 1)} else {ausgabe("zoom", eingabe("zoom").value, 1)}}
	function allco() {if (eingabe("allco").checked) {ausgabe("allco", "true", 1)} else {ausgabe("allco", "", 1)}}
	
	function kat() {ausgabe("cat", eingabe("kat").value, 2);wiki();}
	function subcats() {if (eingabe("subcats").checked) {ausgabe("subcats", "true", 2)} else {ausgabe("subcats", "", 2)} cluster();}
	function subcatdepth() {if (eingabe("subcatdepth").value == 5){ausgabe("subcatdepth", "", 2)} else {ausgabe("subcatdepth", eingabe("subcatdepth").value, 2)}}

	function page() {ausgabe("page", eingabe("page").value, 3)}
	function linksto() {if (eingabe("linksto").checked) {ausgabe("links", "true", 3)} else {ausgabe("links", "", 3)}}
	function linkshere() {if (eingabe("linkshere").checked) {ausgabe("linkshere", "true", 3)} else {ausgabe("linkshere", "", 3)}}
	function shape() {if (eingabe("shape").checked) {ausgabe("shape", "", 3)} else {ausgabe("shape", "false", 3)}}

	function nutz() {ausgabe("user", eingabe("nutz").value, 4);wiki();}

	function kml() {ausgabe("kml", eingabe("kml").value, 5)}
</script>
</head>
<body>
<form>
	<a href="#Ort" id="Ort">Ortsanzeige</a> ·
	<a href="#Kat" id="Kat">Kategorie-Anzeige</a> ·
	<a href="#Art" id="Art">Artikel-Anzeige</a> ·
	<a href="#Nutz" id="Nutz">Nutzer-Anzeige</a> ·
	<a href="#Kml" id="Kml">KML-Anzeige</a>
	<a href="https://wikimap.toolforge.org/?lang=de" class="ext">Karte generieren</a>
	<a href="https://wikimap.toolforge.org/?cat=Media_with_geo-coordinates_needing_categories" class="ext">Karte generieren</a>
	<a href="https://wikimap.toolforge.org/?page=Liste_der_Naturdenkmale_und_Schutzgebiete_in_Chemnitz&lang=de" class="ext">Karte generieren</a>
	<a href="https://wikimap.toolforge.org/?user=Milseburg" class="ext">Karte generieren</a>
	<a href="https://wikimap.toolforge.org/?kml=Benutzer:Habitator_terrae/Zürich.kml&lang=de" class="ext">Karte generieren</a>
	<ul>
		<li><label><input type="text" onchange="sprache()" value="de"/> Sprache der Artikel</label></li>
		<li>Wikimedia-Projekt für Artikel <input type="radio" name="project" id="project" checked="checked" onchange="projekt()"/><label for="project">Wikipedia</label><input type="radio" name="project" id="project2" onchange="projekt()"/><label for="project2">Wikivoyage</label></li>
		<li><label><input type="checkbox" onchange="cluster()" checked="checked"/> Einträge auf Karte gruppieren (mit sidebar und weniger als 500 Einträgen oder mit Unterkategorien aus; auch in der Oberfläche umschaltbar)</label></li>
		<li>Grundkarte auswählen<input type="radio" name="basemap" id="basemap" checked="checked" onchange="karte()"/><label for="basemap">Wikimedia maps</label><input type="radio" name="basemap" id="basemap2" onchange="karte()"/><label for="basemap2">WMFlabs map</label></li>
		<li><label><input type="checkbox" onchange="locator()"/> Link für schnellen Sprung zum Locator-Tool an Bildern anzeigen</label></li>
		<li><label><input type="checkbox" onchange="sidebar()" checked="checked"/> Liste der Einträge bei Wikipedia-Seiten/-Kategorien links anzeigen (muss bei mehr als 500 Einträgen durch Abschalten der Gruppierung in der Oberfläche eingeblendet werden)</label></li>
		<li><label><input type="checkbox" onchange="bearing()" checked="checked"/> Karten-Marker von Bildern gedreht aus Richtung das Fotografen anzeigen (Kamera- und Objekt-Position müssen am Bild vorhanden sein)</label></li>
		<li><label><input type="checkbox" onchange="image()" checked="checked"/> Vorschaubilder generieren (Deaktivierung erhöht die Geschwindigkeit drastisch)</label></li>
		<li><label><input type="text" onchange="region()" value="90|-180|-90|180"/> Anzeige auf Gebiet eingrenzen, per N|W|S|O-Koordinaten</label></li>
		<li><label>Von <input type="number" onchange="year()" id="von" placeholder="dem Urknall an"/> bis </label><label><input type="number" onchange="year()" id="bis" placeholder="die Hölle zufriert"/>. Ergebnisse auf Jahr(e) eingrenzen (der Erstellung bzw. des Einfügens in die Kategorie)</label></li>
	</ul>
	<ul>
		<li><label><input type="text" onchange="lat()" value="auto"/>/</label><label><input type="text" onchange="lon()" value="auto"/> Koordinaten (Standard: automatische Standortermittlung; Ortssuche auch in der Oberfläche möglich)</label></li>
		<li><label><input type="checkbox" onchange="wp()" checked="checked"/> Wikipedia-Artikel darstellen</label></li>
		<li><label><input type="checkbox" onchange="commons()" checked="checked"/> Commons-Bilder darstellen</label></li>
		<li><label><input type="range" onchange="zoom()" max="20" value="13"/> Zoomlevel</label></li>
		<li><label><input type="checkbox" onchange="allco()"/> Alle Artikelkoordinaten statt nur primäre anzeigen</label></li>
	</ul>
	<ul>
		<li><label><input type="text" onchange="kat()" value="Media with geo-coordinates needing categories"/> Alle </label><input type="radio" name="c" id="cat" checked="checked" onchange="wiki()"/><label for="cat">Bilder einer Commons-</label><input type="radio" name="c" id="wpcat" onchange="wiki()"/><label for="wpcat">Artikel einer Wikipedia</label>-Kategorie anzeigen</li>
		<li><label><input type="checkbox" onchange="subcats()"/> Mit-Anzeige der Unterkategorien</label></li>
		<li><label><input type="number" onchange="subcatdepth()" value="5"/> Tiefe der Unterkategorien</label></li>
	</ul>
	<ul>
		<li><label><input type="text" onchange="page()" value="Liste der Naturdenkmale und Schutzgebiete in Chemnitz"/> Wikipedia-Artikel inkl. aller Koordinaten anzeigen (universell für normale Seiten oder Kategorien; mit "Kategorie:"-Präfix)</label></li>
		<li><label><input type="checkbox" onchange="linksto()"/> Verlinkte Artikel anzeigen</label></li>
		<li><label><input type="checkbox" onchange="linkshere()"/> Den Artikel verlinkende Artikel anzeigen</label></li>
		<li><label><input type="checkbox" onchange="shape()" checked="checked" /> Fläche anzeigen</label></li>
	</ul>
	<ul>
		<li><label><input type="text" onchange="nutz()" value="Milseburg"/> Alle </label><input type="radio" name="u" id="user" checked="checked" onchange="wiki()"/><label for="user">Commons-Uploads</label><input type="radio" name="u" id="wpuser" onchange="wiki()"/><label for="wpuser">erstellten Artikel</label> eines Nutzers anzeigen</li>
	</ul>
	<ul>
		<li><label><input type="text" onchange="kml()" value="Benutzer:Habitator terrae/Zürich.kml"/> KML-Seite visualisieren</label></li>
	</ul>
</form><br/>
<div id="Attribution"> <a href="https://de.wikipedia.org/wiki/Benutzer:DB111/Tools#WikiMap">Basiert</a> auf <a href="https://de.wikipedia.org/wiki/Benutzer:DB111">DB111</a>, erstellt von <a href="https://de.wikipedia.org/wiki/Benutzer:Habitator_terrae">Habitator terrae</a>. <a href="http://creativecommons.org/licenses/by-sa/3.0/">CC BY-SA 3.0</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/legalcode">legal</a>).</div>
</body>
</html>