mirror of
https://github.com/FoggedLens/iD.git
synced 2026-04-29 23:17:53 +02:00
Merge branch 'master' into left-animate-overlays
This commit is contained in:
@@ -27,15 +27,13 @@ data/data.js: $(DATA_FILES)
|
||||
js/lib/d3.curtain.js \
|
||||
js/lib/jxon.js \
|
||||
js/lib/lodash.js \
|
||||
js/lib/ohauth.js \
|
||||
js/lib/osmauth.js \
|
||||
js/lib/rtree.js \
|
||||
js/lib/sha.js \
|
||||
js/lib/togeojson.js \
|
||||
js/lib/marked.js \
|
||||
js/id/start.js \
|
||||
js/id/id.js \
|
||||
js/id/connection.js \
|
||||
js/id/oauth.js \
|
||||
js/id/services/*.js \
|
||||
data/data.js \
|
||||
js/id/util.js \
|
||||
|
||||
@@ -111,6 +111,7 @@ en:
|
||||
view_on_osm: "View on OSM →"
|
||||
zoom_in_edit: zoom in to edit the map
|
||||
logout: logout
|
||||
loading_auth: "Connecting to OpenStreetMap..."
|
||||
report_a_bug: report a bug
|
||||
commit:
|
||||
title: Save Changes
|
||||
|
||||
+666
-8
@@ -142,6 +142,7 @@ locale.en = {
|
||||
"view_on_osm": "View on OSM →",
|
||||
"zoom_in_edit": "zoom in to edit the map",
|
||||
"logout": "logout",
|
||||
"loading_auth": "Connecting to OpenStreetMap...",
|
||||
"report_a_bug": "report a bug",
|
||||
"commit": {
|
||||
"title": "Save Changes",
|
||||
@@ -1690,6 +1691,7 @@ locale.zh = {
|
||||
"reset": "重置"
|
||||
},
|
||||
"restore": {
|
||||
"heading": "您有未保存的更改",
|
||||
"description": "上次您有未保存的更改。你想恢复这些更改吗?",
|
||||
"restore": "恢复",
|
||||
"reset": "重置"
|
||||
@@ -1704,10 +1706,13 @@ locale.zh = {
|
||||
},
|
||||
"splash": {
|
||||
"welcome": "欢迎使用OpenStreetMap编辑器iD",
|
||||
"text": "这是开发版本{version}。欲了解更多信息,请参阅{website},在{github}报告bug。"
|
||||
"text": "这是开发版本{version}。欲了解更多信息,请参阅{website},在{github}报告bug。",
|
||||
"walkthrough": "开始练习",
|
||||
"start": "现在编辑"
|
||||
},
|
||||
"source_switch": {
|
||||
"live": "live",
|
||||
"lose_changes": "您有未保存的更改。切换地图服务器会丢弃他们。你确定要切换服务器吗?",
|
||||
"dev": "dev"
|
||||
},
|
||||
"tag_reference": {
|
||||
@@ -1731,6 +1736,9 @@ locale.zh = {
|
||||
"local_layer": "本地GPX文件",
|
||||
"drag_drop": "把GPX文件拖到页面上。"
|
||||
},
|
||||
"help": {
|
||||
"title": "帮助"
|
||||
},
|
||||
"presets": {
|
||||
"fields": {
|
||||
"access": {
|
||||
@@ -4214,6 +4222,7 @@ locale.fr = {
|
||||
"reset": "réinitialiser"
|
||||
},
|
||||
"restore": {
|
||||
"heading": "Vous avez des changements non sauvés.",
|
||||
"description": "Vous avez des changements non sauvegardés d'une précédente édition. Souhaitez-vous restaurer ces changements?",
|
||||
"restore": "Restaurer",
|
||||
"reset": "Annuler"
|
||||
@@ -4228,7 +4237,8 @@ locale.fr = {
|
||||
},
|
||||
"splash": {
|
||||
"welcome": "Bienvenue sur ID l'editeur en ligne d'OpenStreetMap",
|
||||
"text": "Cette version {version}, est une version de développement. Si vous souhaitez plus d'informations, veuillez consulter {website} ou pour signaler un bug {github}."
|
||||
"text": "Cette version {version}, est une version de développement. Si vous souhaitez plus d'informations, veuillez consulter {website} ou pour signaler un bug {github}.",
|
||||
"start": "Editer"
|
||||
},
|
||||
"source_switch": {
|
||||
"live": "live",
|
||||
@@ -4255,6 +4265,9 @@ locale.fr = {
|
||||
"local_layer": "Fichier GPX personnel",
|
||||
"drag_drop": "Glisser et déposer un fichier .gpx sur la page"
|
||||
},
|
||||
"help": {
|
||||
"title": "Aide"
|
||||
},
|
||||
"presets": {
|
||||
"fields": {
|
||||
"address": {
|
||||
@@ -4800,7 +4813,8 @@ locale.de = {
|
||||
},
|
||||
"splash": {
|
||||
"welcome": "Willkommen beim iD OpenStreetMap-Editor",
|
||||
"text": "Dies ist eine Entwicklungsversion {version}. Für weitere Informationen besuche {website} und melde Fehler unter {github}."
|
||||
"text": "Dies ist eine Entwicklungsversion {version}. Für weitere Informationen besuche {website} und melde Fehler unter {github}.",
|
||||
"start": "Jetzt bearbeiten"
|
||||
},
|
||||
"source_switch": {
|
||||
"live": "live",
|
||||
@@ -4869,32 +4883,99 @@ locale.de = {
|
||||
"capacity": {
|
||||
"label": "Kapazität"
|
||||
},
|
||||
"collection_times": {
|
||||
"label": "Leerungszeiten"
|
||||
},
|
||||
"country": {
|
||||
"label": "Land"
|
||||
},
|
||||
"cuisine": {
|
||||
"label": "Küche"
|
||||
},
|
||||
"denomination": {
|
||||
"label": "Glaubensrichtung"
|
||||
},
|
||||
"entrance": {
|
||||
"label": "Art"
|
||||
},
|
||||
"fax": {
|
||||
"label": "Fax"
|
||||
},
|
||||
"fee": {
|
||||
"label": "Gebühr"
|
||||
},
|
||||
"highway": {
|
||||
"label": "Art"
|
||||
},
|
||||
"historic": {
|
||||
"label": "Art"
|
||||
},
|
||||
"internet_access": {
|
||||
"label": "Internetzugang",
|
||||
"options": {
|
||||
"wlan": "Wifi"
|
||||
"wlan": "Wifi",
|
||||
"wired": "Kabelgebunden"
|
||||
}
|
||||
},
|
||||
"landuse": {
|
||||
"label": "Art"
|
||||
},
|
||||
"layer": {
|
||||
"label": "Ebene"
|
||||
},
|
||||
"leisure": {
|
||||
"label": "Art"
|
||||
},
|
||||
"levels": {
|
||||
"label": "Etagen"
|
||||
},
|
||||
"man_made": {
|
||||
"label": "Art"
|
||||
},
|
||||
"maxspeed": {
|
||||
"label": "Höchstgeschwindigkeit"
|
||||
},
|
||||
"network": {
|
||||
"label": "Netzwerk"
|
||||
},
|
||||
"note": {
|
||||
"label": "Notiz"
|
||||
},
|
||||
"oneway": {
|
||||
"label": "Einbahnstraße"
|
||||
},
|
||||
"opening_hours": {
|
||||
"label": "Öffnungszeiten"
|
||||
},
|
||||
"operator": {
|
||||
"label": "Betreiber"
|
||||
},
|
||||
"phone": {
|
||||
"label": "Telefon"
|
||||
},
|
||||
"place": {
|
||||
"label": "Art"
|
||||
},
|
||||
"railway": {
|
||||
"label": "Art"
|
||||
},
|
||||
"religion": {
|
||||
"label": "Religion"
|
||||
"label": "Religion",
|
||||
"options": {
|
||||
"christian": "Christlich",
|
||||
"muslim": "Muslimisch",
|
||||
"buddhist": "Buddhistisch",
|
||||
"jewish": "Jüdisch"
|
||||
}
|
||||
},
|
||||
"service": {
|
||||
"label": "Art"
|
||||
},
|
||||
"shelter": {
|
||||
"label": "Unterstand"
|
||||
},
|
||||
"shop": {
|
||||
"label": "Art"
|
||||
},
|
||||
"source": {
|
||||
"label": "Quelle"
|
||||
@@ -4902,23 +4983,50 @@ locale.de = {
|
||||
"sport": {
|
||||
"label": "Sport"
|
||||
},
|
||||
"structure": {
|
||||
"options": {
|
||||
"bridge": "Brücke",
|
||||
"tunnel": "Tunnel"
|
||||
}
|
||||
},
|
||||
"surface": {
|
||||
"label": "Oberfläche"
|
||||
},
|
||||
"tourism": {
|
||||
"label": "Art"
|
||||
},
|
||||
"water": {
|
||||
"label": "Art"
|
||||
},
|
||||
"waterway": {
|
||||
"label": "Art"
|
||||
},
|
||||
"website": {
|
||||
"label": "Webseite"
|
||||
},
|
||||
"wetland": {
|
||||
"label": "Art"
|
||||
},
|
||||
"wikipedia": {
|
||||
"label": "Wikipedia"
|
||||
},
|
||||
"wood": {
|
||||
"label": "Art"
|
||||
}
|
||||
},
|
||||
"presets": {
|
||||
"aeroway": {
|
||||
"name": "Luftfahrt"
|
||||
},
|
||||
"aeroway/aerodrome": {
|
||||
"name": "Flughafen"
|
||||
},
|
||||
"aeroway/helipad": {
|
||||
"name": "Hubschrauberlandeplatz"
|
||||
},
|
||||
"amenity": {
|
||||
"name": "Einrichtungen"
|
||||
},
|
||||
"amenity/bank": {
|
||||
"name": "Bank"
|
||||
},
|
||||
@@ -4934,9 +5042,24 @@ locale.de = {
|
||||
"amenity/bicycle_rental": {
|
||||
"name": "Fahrradverleih"
|
||||
},
|
||||
"amenity/cafe": {
|
||||
"name": "Café"
|
||||
},
|
||||
"amenity/cinema": {
|
||||
"name": "Kino"
|
||||
},
|
||||
"amenity/courthouse": {
|
||||
"name": "Gericht"
|
||||
},
|
||||
"amenity/embassy": {
|
||||
"name": "Botschaft"
|
||||
},
|
||||
"amenity/fast_food": {
|
||||
"name": "Fast Food"
|
||||
},
|
||||
"amenity/fire_station": {
|
||||
"name": "Feuerwehrhaus"
|
||||
},
|
||||
"amenity/fuel": {
|
||||
"name": "Tankstelle"
|
||||
},
|
||||
@@ -4955,9 +5078,15 @@ locale.de = {
|
||||
"amenity/pharmacy": {
|
||||
"name": "Apotheke"
|
||||
},
|
||||
"amenity/place_of_worship": {
|
||||
"name": "Gebetsort"
|
||||
},
|
||||
"amenity/place_of_worship/christian": {
|
||||
"name": "Kirche"
|
||||
},
|
||||
"amenity/place_of_worship/jewish": {
|
||||
"name": "Synagoge"
|
||||
},
|
||||
"amenity/place_of_worship/muslim": {
|
||||
"name": "Moschee"
|
||||
},
|
||||
@@ -4967,6 +5096,9 @@ locale.de = {
|
||||
"amenity/post_box": {
|
||||
"name": "Briefkasten"
|
||||
},
|
||||
"amenity/post_office": {
|
||||
"name": "Poststelle"
|
||||
},
|
||||
"amenity/pub": {
|
||||
"name": "Pub"
|
||||
},
|
||||
@@ -4976,9 +5108,15 @@ locale.de = {
|
||||
"amenity/school": {
|
||||
"name": "Schule"
|
||||
},
|
||||
"amenity/swimming_pool": {
|
||||
"name": "Schwimmbecken"
|
||||
},
|
||||
"amenity/telephone": {
|
||||
"name": "Telefon"
|
||||
},
|
||||
"amenity/theatre": {
|
||||
"name": "Theater"
|
||||
},
|
||||
"amenity/toilets": {
|
||||
"name": "Toilette"
|
||||
},
|
||||
@@ -4988,6 +5126,9 @@ locale.de = {
|
||||
"amenity/university": {
|
||||
"name": "Universität"
|
||||
},
|
||||
"building": {
|
||||
"name": "Gebäude"
|
||||
},
|
||||
"entrance": {
|
||||
"name": "Eingang"
|
||||
},
|
||||
@@ -5006,18 +5147,39 @@ locale.de = {
|
||||
"highway/footway": {
|
||||
"name": "Fußweg"
|
||||
},
|
||||
"highway/motorway": {
|
||||
"name": "Autobahn"
|
||||
},
|
||||
"highway/path": {
|
||||
"name": "Pfad"
|
||||
},
|
||||
"highway/primary": {
|
||||
"name": "Hauptverbindungsstraße"
|
||||
},
|
||||
"highway/residential": {
|
||||
"name": "Wohngebietsstraße"
|
||||
},
|
||||
"highway/secondary": {
|
||||
"name": "Landstraße"
|
||||
},
|
||||
"highway/service": {
|
||||
"name": "Erschließungsweg"
|
||||
},
|
||||
"highway/steps": {
|
||||
"name": "Treppen"
|
||||
},
|
||||
"highway/tertiary": {
|
||||
"name": "Kreisstraße"
|
||||
},
|
||||
"highway/track": {
|
||||
"name": "Feld-/Waldweg"
|
||||
},
|
||||
"highway/traffic_signals": {
|
||||
"name": "Ampeln"
|
||||
},
|
||||
"highway/trunk": {
|
||||
"name": "Kraftfahrstraße"
|
||||
},
|
||||
"highway/turning_circle": {
|
||||
"name": "Wendestelle"
|
||||
},
|
||||
@@ -5027,9 +5189,21 @@ locale.de = {
|
||||
"historic/monument": {
|
||||
"name": "Monument"
|
||||
},
|
||||
"landuse": {
|
||||
"name": "Landnutzung"
|
||||
},
|
||||
"landuse/allotments": {
|
||||
"name": "Kleigartenanlage"
|
||||
},
|
||||
"landuse/basin": {
|
||||
"name": "Becken"
|
||||
},
|
||||
"landuse/cemetery": {
|
||||
"name": "Friedhof"
|
||||
},
|
||||
"landuse/farm": {
|
||||
"name": "Bauernhof"
|
||||
},
|
||||
"landuse/forest": {
|
||||
"name": "Wald"
|
||||
},
|
||||
@@ -5045,12 +5219,18 @@ locale.de = {
|
||||
"landuse/residential": {
|
||||
"name": "Wohngebiet"
|
||||
},
|
||||
"leisure/garden": {
|
||||
"name": "Garten"
|
||||
},
|
||||
"leisure/golf_course": {
|
||||
"name": "Golfplatz"
|
||||
},
|
||||
"leisure/park": {
|
||||
"name": "Park"
|
||||
},
|
||||
"leisure/pitch": {
|
||||
"name": "Sportplatz"
|
||||
},
|
||||
"leisure/pitch/american_football": {
|
||||
"name": "American Football Feld"
|
||||
},
|
||||
@@ -5066,6 +5246,21 @@ locale.de = {
|
||||
"leisure/playground": {
|
||||
"name": "Spieplatz"
|
||||
},
|
||||
"leisure/stadium": {
|
||||
"name": "Stadium"
|
||||
},
|
||||
"leisure/swimming_pool": {
|
||||
"name": "Schwimmbecken"
|
||||
},
|
||||
"man_made/lighthouse": {
|
||||
"name": "Leuchtturm"
|
||||
},
|
||||
"man_made/pier": {
|
||||
"name": "Steg"
|
||||
},
|
||||
"man_made/survey_point": {
|
||||
"name": "Vermessungspunkt"
|
||||
},
|
||||
"natural/beach": {
|
||||
"name": "Strand"
|
||||
},
|
||||
@@ -5114,6 +5309,9 @@ locale.de = {
|
||||
"railway/subway": {
|
||||
"name": "U-Bahn"
|
||||
},
|
||||
"shop": {
|
||||
"name": "Laden"
|
||||
},
|
||||
"shop/butcher": {
|
||||
"name": "Fleischer"
|
||||
},
|
||||
@@ -5138,6 +5336,9 @@ locale.de = {
|
||||
"tourism/information": {
|
||||
"name": "Information"
|
||||
},
|
||||
"tourism/motel": {
|
||||
"name": "Motel"
|
||||
},
|
||||
"tourism/museum": {
|
||||
"name": "Museum"
|
||||
},
|
||||
@@ -5147,6 +5348,9 @@ locale.de = {
|
||||
"tourism/theme_park": {
|
||||
"name": "Themenpark"
|
||||
},
|
||||
"tourism/viewpoint": {
|
||||
"name": "Aussichtspunkt"
|
||||
},
|
||||
"tourism/zoo": {
|
||||
"name": "Zoo"
|
||||
},
|
||||
@@ -6714,7 +6918,17 @@ locale.pl = {
|
||||
"point": "Przesunięto punkt.",
|
||||
"vertex": "Przesunięto węzeł drogi.",
|
||||
"line": "Przesunięto linię.",
|
||||
"area": "Przesunięto obszar."
|
||||
"area": "Przesunięto obszar.",
|
||||
"multiple": "Przesunięto wiele obiektów."
|
||||
}
|
||||
},
|
||||
"rotate": {
|
||||
"title": "Obróć",
|
||||
"description": "Obróć ten obiekt względem jego środka.",
|
||||
"key": "R",
|
||||
"annotation": {
|
||||
"line": "Obrócono linię.",
|
||||
"area": "Obrócono obszar."
|
||||
}
|
||||
},
|
||||
"reverse": {
|
||||
@@ -6741,6 +6955,7 @@ locale.pl = {
|
||||
"commit": {
|
||||
"title": "Zapisz zmiany",
|
||||
"description_placeholder": "Krótki opis twoich zmian",
|
||||
"message_label": "Opis zmian",
|
||||
"upload_explanation": "Zmiany które wyślesz jako {user} będą widoczne na wszystkich mapach używających danych OpenStreetMap.",
|
||||
"save": "Zapisz",
|
||||
"cancel": "Anuluj",
|
||||
@@ -6764,8 +6979,13 @@ locale.pl = {
|
||||
"inspector": {
|
||||
"no_documentation_combination": "Nie ma dokumentacji dla tej kombinacji tagu.",
|
||||
"no_documentation_key": "Nie ma dokumentacji dla tego klucza",
|
||||
"show_more": "Pokaż więcej",
|
||||
"new_tag": "Nowy tag",
|
||||
"view_on_osm": "Zobacz w OSM"
|
||||
"view_on_osm": "Zobacz w OSM",
|
||||
"editing_feature": "Edytujesz {feature}",
|
||||
"additional": "Dodatkowe znaczniki",
|
||||
"results": "{n} wyników dla {search}",
|
||||
"reference": "Zobacz na OpenStreetMap Wiki →"
|
||||
},
|
||||
"background": {
|
||||
"title": "Tło",
|
||||
@@ -6775,6 +6995,7 @@ locale.pl = {
|
||||
"reset": "resetuj"
|
||||
},
|
||||
"restore": {
|
||||
"heading": "Masz niezapisane zmiany",
|
||||
"description": "Masz niezapisane zmiany z poprzedniej sesji. Chcesz je przywrócić?",
|
||||
"restore": "Przywróć",
|
||||
"reset": "Resetuj"
|
||||
@@ -6782,6 +7003,7 @@ locale.pl = {
|
||||
"save": {
|
||||
"title": "Zapisz",
|
||||
"help": "Zapisz zmiany na OpenStreetMap, aby były one widoczne dla innych",
|
||||
"no_changes": "Brak zmian do zapisania.",
|
||||
"error": "Wystąpił błąd podczas próby zapisu.",
|
||||
"uploading": "Wysyłanie zmian do OpenStreetMap.",
|
||||
"unsaved_changes": "Masz niezapisane zmiany."
|
||||
@@ -6810,6 +7032,440 @@ locale.pl = {
|
||||
"zoom": {
|
||||
"in": "Powiększ",
|
||||
"out": "Zmniejsz"
|
||||
},
|
||||
"gpx": {
|
||||
"local_layer": "Lokalny plik GPX",
|
||||
"drag_drop": "Przeciągnij i upuść plik .gpx na stronę"
|
||||
},
|
||||
"help": {
|
||||
"title": "Pomoc"
|
||||
},
|
||||
"presets": {
|
||||
"fields": {
|
||||
"access": {
|
||||
"label": "Dostęp"
|
||||
},
|
||||
"address": {
|
||||
"label": "Adres",
|
||||
"placeholders": {
|
||||
"housename": "Nazwa budynku",
|
||||
"number": "123",
|
||||
"street": "Ulica",
|
||||
"city": "Miasto"
|
||||
}
|
||||
},
|
||||
"aeroway": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"amenity": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"atm": {
|
||||
"label": "Bankomat"
|
||||
},
|
||||
"bicycle_parking": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"building": {
|
||||
"label": "Budynek"
|
||||
},
|
||||
"building_area": {
|
||||
"label": "Budynek"
|
||||
},
|
||||
"building_yes": {
|
||||
"label": "Budynek"
|
||||
},
|
||||
"capacity": {
|
||||
"label": "Pojemność"
|
||||
},
|
||||
"construction": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"crossing": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"cuisine": {
|
||||
"label": "Kuchnia"
|
||||
},
|
||||
"denomination": {
|
||||
"label": "Wyznanie"
|
||||
},
|
||||
"entrance": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"fax": {
|
||||
"label": "Faks"
|
||||
},
|
||||
"fee": {
|
||||
"label": "Opłata"
|
||||
},
|
||||
"highway": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"historic": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"internet_access": {
|
||||
"label": "Dostęp do internetu",
|
||||
"options": {
|
||||
"wlan": "Bezprzewodowy",
|
||||
"wired": "Przewodowy"
|
||||
}
|
||||
},
|
||||
"landuse": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"layer": {
|
||||
"label": "Warstwa"
|
||||
},
|
||||
"leisure": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"levels": {
|
||||
"label": "Poziomy"
|
||||
},
|
||||
"man_made": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"maxspeed": {
|
||||
"label": "Ograniczenie prędkości"
|
||||
},
|
||||
"network": {
|
||||
"label": "Sieć"
|
||||
},
|
||||
"note": {
|
||||
"label": "Notatka"
|
||||
},
|
||||
"office": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"oneway": {
|
||||
"label": "Jednokierunkowa"
|
||||
},
|
||||
"opening_hours": {
|
||||
"label": "Godziny"
|
||||
},
|
||||
"phone": {
|
||||
"label": "Telefon"
|
||||
},
|
||||
"place": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"railway": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"religion": {
|
||||
"label": "Religia",
|
||||
"options": {
|
||||
"christian": "Chrześcijaństwo",
|
||||
"muslim": "Islam",
|
||||
"buddhist": "Buddyzm",
|
||||
"jewish": "Judaizm",
|
||||
"hindu": "Hinduizm",
|
||||
"shinto": "Szintoizm",
|
||||
"taoist": "Taoizm"
|
||||
}
|
||||
},
|
||||
"service": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"shelter": {
|
||||
"label": "Schronienie"
|
||||
},
|
||||
"shop": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"source": {
|
||||
"label": "Źródło"
|
||||
},
|
||||
"sport": {
|
||||
"label": "Sport"
|
||||
},
|
||||
"surface": {
|
||||
"label": "Nawierzchnia"
|
||||
},
|
||||
"tourism": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"water": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"waterway": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"website": {
|
||||
"label": "Strona WWW"
|
||||
},
|
||||
"wetland": {
|
||||
"label": "Typ"
|
||||
},
|
||||
"wikipedia": {
|
||||
"label": "Wikipedia"
|
||||
},
|
||||
"wood": {
|
||||
"label": "Typ"
|
||||
}
|
||||
},
|
||||
"presets": {
|
||||
"aeroway/aerodrome": {
|
||||
"name": "Lotnisko"
|
||||
},
|
||||
"aeroway/helipad": {
|
||||
"name": "Lądowisko dla helikopterów"
|
||||
},
|
||||
"amenity/bank": {
|
||||
"name": "Bank"
|
||||
},
|
||||
"amenity/bar": {
|
||||
"name": "Bar"
|
||||
},
|
||||
"amenity/bicycle_parking": {
|
||||
"name": "Parking dla rowerów"
|
||||
},
|
||||
"amenity/bicycle_rental": {
|
||||
"name": "Wypożyczalnia rowerów"
|
||||
},
|
||||
"amenity/cafe": {
|
||||
"name": "Kawiarnia"
|
||||
},
|
||||
"amenity/cinema": {
|
||||
"name": "Kino"
|
||||
},
|
||||
"amenity/fast_food": {
|
||||
"name": "Fast food"
|
||||
},
|
||||
"amenity/fire_station": {
|
||||
"name": "Straż pożarna"
|
||||
},
|
||||
"amenity/grave_yard": {
|
||||
"name": "Cmentarz"
|
||||
},
|
||||
"amenity/hospital": {
|
||||
"name": "Szpital"
|
||||
},
|
||||
"amenity/library": {
|
||||
"name": "Biblioteka"
|
||||
},
|
||||
"amenity/parking": {
|
||||
"name": "Parking"
|
||||
},
|
||||
"amenity/pharmacy": {
|
||||
"name": "Apteka"
|
||||
},
|
||||
"amenity/place_of_worship": {
|
||||
"name": "Miejsce kultu religijnego"
|
||||
},
|
||||
"amenity/place_of_worship/christian": {
|
||||
"name": "Kościół"
|
||||
},
|
||||
"amenity/place_of_worship/jewish": {
|
||||
"name": "Synagoga"
|
||||
},
|
||||
"amenity/place_of_worship/muslim": {
|
||||
"name": "Meczet"
|
||||
},
|
||||
"amenity/police": {
|
||||
"name": "Policja"
|
||||
},
|
||||
"amenity/post_box": {
|
||||
"name": "Skrzynka pocztowa"
|
||||
},
|
||||
"amenity/post_office": {
|
||||
"name": "Poczta"
|
||||
},
|
||||
"amenity/pub": {
|
||||
"name": "Pub"
|
||||
},
|
||||
"amenity/restaurant": {
|
||||
"name": "Restauracja"
|
||||
},
|
||||
"amenity/school": {
|
||||
"name": "Szkoła"
|
||||
},
|
||||
"amenity/toilets": {
|
||||
"name": "Toalety"
|
||||
},
|
||||
"amenity/townhall": {
|
||||
"name": "Ratusz"
|
||||
},
|
||||
"amenity/university": {
|
||||
"name": "Uniwersytet"
|
||||
},
|
||||
"building": {
|
||||
"name": "Budynek"
|
||||
},
|
||||
"entrance": {
|
||||
"name": "Wejście"
|
||||
},
|
||||
"highway": {
|
||||
"name": "Droga"
|
||||
},
|
||||
"highway/bus_stop": {
|
||||
"name": "Przystanek autobusowy"
|
||||
},
|
||||
"highway/crossing": {
|
||||
"name": "Przejście dla pieszych"
|
||||
},
|
||||
"highway/cycleway": {
|
||||
"name": "Ścieżka rowerowa"
|
||||
},
|
||||
"highway/footway": {
|
||||
"name": "Ścieżka dla pieszych"
|
||||
},
|
||||
"highway/motorway": {
|
||||
"name": "Autostrada"
|
||||
},
|
||||
"highway/path": {
|
||||
"name": "Ścieżka"
|
||||
},
|
||||
"highway/primary": {
|
||||
"name": "Droga krajowa"
|
||||
},
|
||||
"highway/residential": {
|
||||
"name": "Droga lokalna"
|
||||
},
|
||||
"highway/secondary": {
|
||||
"name": "Droga wojewódzka"
|
||||
},
|
||||
"highway/service": {
|
||||
"name": "Droga serwisowa"
|
||||
},
|
||||
"highway/steps": {
|
||||
"name": "Schody"
|
||||
},
|
||||
"highway/tertiary": {
|
||||
"name": "Droga powiatowa"
|
||||
},
|
||||
"highway/track": {
|
||||
"name": "Droga gruntowa"
|
||||
},
|
||||
"highway/traffic_signals": {
|
||||
"name": "Sygnalizacja świetlna"
|
||||
},
|
||||
"highway/trunk": {
|
||||
"name": "Droga ekspresowa"
|
||||
},
|
||||
"highway/turning_circle": {
|
||||
"name": "Miejsce do zawracania"
|
||||
},
|
||||
"highway/unclassified": {
|
||||
"name": "Droga niesklasyfikowana"
|
||||
},
|
||||
"historic": {
|
||||
"name": "Miejsce historyczne"
|
||||
},
|
||||
"historic/monument": {
|
||||
"name": "Pomnik"
|
||||
},
|
||||
"landuse": {
|
||||
"name": "Użytkowanie gruntów"
|
||||
},
|
||||
"landuse/allotments": {
|
||||
"name": "Działki"
|
||||
},
|
||||
"landuse/basin": {
|
||||
"name": "Zbiornik wodny"
|
||||
},
|
||||
"landuse/cemetery": {
|
||||
"name": "Cmentarz"
|
||||
},
|
||||
"landuse/commercial": {
|
||||
"name": "Biura i usługi"
|
||||
},
|
||||
"landuse/construction": {
|
||||
"name": "Budowa"
|
||||
},
|
||||
"landuse/farm": {
|
||||
"name": "Teren rolny"
|
||||
},
|
||||
"landuse/farmyard": {
|
||||
"name": "Podwórze gospodarskie"
|
||||
},
|
||||
"landuse/forest": {
|
||||
"name": "Las"
|
||||
},
|
||||
"landuse/grass": {
|
||||
"name": "Trawa"
|
||||
},
|
||||
"landuse/industrial": {
|
||||
"name": "Obszar przemysłowy"
|
||||
},
|
||||
"landuse/meadow": {
|
||||
"name": "Łąka"
|
||||
},
|
||||
"landuse/orchard": {
|
||||
"name": "Sad"
|
||||
},
|
||||
"landuse/quarry": {
|
||||
"name": "Kamieniołom"
|
||||
},
|
||||
"landuse/residential": {
|
||||
"name": "Zabudowa mieszkaniowa"
|
||||
},
|
||||
"landuse/vineyard": {
|
||||
"name": "Winnica"
|
||||
},
|
||||
"leisure": {
|
||||
"name": "Rozrywka i wypoczynek"
|
||||
},
|
||||
"leisure/golf_course": {
|
||||
"name": "Pole golfowe"
|
||||
},
|
||||
"leisure/park": {
|
||||
"name": "Park"
|
||||
},
|
||||
"leisure/pitch": {
|
||||
"name": "Boisko"
|
||||
},
|
||||
"leisure/pitch/american_football": {
|
||||
"name": "Boisko do futbolu amerykańskiego"
|
||||
},
|
||||
"leisure/pitch/baseball": {
|
||||
"name": "Boisko do baseballu"
|
||||
},
|
||||
"leisure/pitch/basketball": {
|
||||
"name": "Boisko do koszykówki"
|
||||
},
|
||||
"leisure/pitch/soccer": {
|
||||
"name": "Boisko do piłki nożnej"
|
||||
},
|
||||
"leisure/pitch/tennis": {
|
||||
"name": "Kort tenisowy"
|
||||
},
|
||||
"leisure/playground": {
|
||||
"name": "Plac zabaw"
|
||||
},
|
||||
"man_made": {
|
||||
"name": "Obiekty sztuczne"
|
||||
},
|
||||
"man_made/lighthouse": {
|
||||
"name": "Latarnia morska"
|
||||
},
|
||||
"man_made/pier": {
|
||||
"name": "Molo"
|
||||
},
|
||||
"man_made/water_tower": {
|
||||
"name": "Wieża ciśnień"
|
||||
},
|
||||
"natural": {
|
||||
"name": "Natura"
|
||||
},
|
||||
"natural/bay": {
|
||||
"name": "Zatoka"
|
||||
},
|
||||
"natural/beach": {
|
||||
"name": "Plaża"
|
||||
},
|
||||
"natural/cliff": {
|
||||
"name": "Klif"
|
||||
},
|
||||
"natural/coastline": {
|
||||
"name": "Wybrzeże"
|
||||
},
|
||||
"natural/glacier": {
|
||||
"name": "Lodowiec"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
locale.pt = {
|
||||
@@ -9700,7 +10356,9 @@ locale.vi = {
|
||||
"drag_drop": "Kéo thả một tập tin .gpx vào trang"
|
||||
},
|
||||
"help": {
|
||||
"title": "Trợ giúp"
|
||||
"title": "Trợ giúp",
|
||||
"help": "# Trợ giúp\n\nĐây là trình vẽ của [OpenStreetMap](http://www.openstreetmap.org/), bản đồ có mã nguồn mở và dữ liệu mở cho phép mọi người cùng sửa đổi. Bạn có thể sử dụng chương trình này để bổ sung và cập nhật dữ liệu bản đồ tại khu vực của bạn. Bạn có thể cải tiến bản đồ thế giới mở để cho mọi người sử dụng.\n\nCác sửa đổi của bạn trên bản đồ này sẽ xuất hiện cho mọi người dùng OpenStreetMap. Để sửa bản đồ, bạn cần có một [tài khoản OpenStreetMap miễn phí](https://www.openstreetmap.org/user/new).\n\n[Tình vẽ iD](http://ideditor.com/) là một dự án cộng tác và xuất bản [tất cả mã nguồn tại GitHub](https://github.com/systemed/iD).\n",
|
||||
"addresses": "# Địa chỉ\n\nĐịa chỉ là những thông tin rất cần thiết trên bản đồ.\n\nTuy bản đồ thường trình bày các địa chỉ như một thuộc tính của đường sá, nhưng OpenStreetMap liên kết các địa chỉ với các tòa nhà hoặc miếng đất dọc đường.\n\nBạn có thể thêm thông tin địa chỉ vào các hình dạng tòa nhà hoặc các địa điểm quan tâm. Tốt nhất là lấy thông tin địa chỉ từ kinh nghiệm cá nhân, thí dụ đi dạo trên phố và ghi chép các địa chỉ hoặc nhớ lại những chi tiết từ hoạt động hàng ngày của bạn. Cũng như bất cứ chi tiết nào, dự án này hoàn toàn cấm sao chép từ các nguồn thương mại như Bản đồ Google.\n"
|
||||
},
|
||||
"presets": {
|
||||
"fields": {
|
||||
|
||||
+1
-3
@@ -15,8 +15,7 @@
|
||||
|
||||
<script src='js/lib/lodash.js'></script>
|
||||
<script src='js/lib/d3.v3.js'></script>
|
||||
<script src='js/lib/sha.js'></script>
|
||||
<script src='js/lib/ohauth.js'></script>
|
||||
<script src='js/lib/osmauth.js'></script>
|
||||
<script src='js/lib/jxon.js'></script>
|
||||
<script src='js/lib/d3.typeahead.js'></script>
|
||||
<script src='js/lib/d3.combobox.js'></script>
|
||||
@@ -35,7 +34,6 @@
|
||||
|
||||
<script src='js/id/id.js'></script>
|
||||
<script src='js/id/util.js'></script>
|
||||
<script src='js/id/oauth.js'></script>
|
||||
<script src='js/id/services/taginfo.js'></script>
|
||||
|
||||
<script src='data/data_dev.js'></script>
|
||||
|
||||
+15
-1
@@ -7,7 +7,12 @@ iD.Connection = function(context) {
|
||||
keys,
|
||||
inflight = {},
|
||||
loadedTiles = {},
|
||||
oauth = iD.OAuth(context).url(url),
|
||||
loadingModal,
|
||||
oauth = osmAuth({
|
||||
url: url,
|
||||
loading: authLoading,
|
||||
done: authDone
|
||||
}),
|
||||
ndStr = 'nd',
|
||||
tagStr = 'tag',
|
||||
memberStr = 'member',
|
||||
@@ -27,6 +32,15 @@ iD.Connection = function(context) {
|
||||
return d3.xml(url).get().on('load', done);
|
||||
};
|
||||
|
||||
function authLoading() {
|
||||
loadingModal = iD.ui.loading(context.container(),
|
||||
t('loading_auth'));
|
||||
}
|
||||
|
||||
function authDone() {
|
||||
if (loadingModal) loadingModal.remove();
|
||||
}
|
||||
|
||||
function getNodes(obj) {
|
||||
var elems = obj.getElementsByTagName(ndStr),
|
||||
nodes = new Array(elems.length);
|
||||
|
||||
-147
@@ -1,147 +0,0 @@
|
||||
iD.OAuth = function(context) {
|
||||
var baseurl = 'http://www.openstreetmap.org',
|
||||
o = {},
|
||||
keys,
|
||||
oauth = {},
|
||||
oauth_secret;
|
||||
|
||||
function timenonce(o) {
|
||||
o.oauth_timestamp = ohauth.timestamp();
|
||||
o.oauth_nonce = ohauth.nonce();
|
||||
return o;
|
||||
}
|
||||
|
||||
// token getter/setter, namespaced to the current `apibase` value.
|
||||
function token() {
|
||||
return context.storage.apply(context, arguments);
|
||||
}
|
||||
|
||||
if (token('oauth_token')) {
|
||||
o.oauth_token = token('oauth_token');
|
||||
}
|
||||
|
||||
oauth.authenticated = function() {
|
||||
return token('oauth_token') && token('oauth_token_secret');
|
||||
};
|
||||
|
||||
oauth.logout = function() {
|
||||
token('oauth_token', '');
|
||||
token('oauth_token_secret', '');
|
||||
token('oauth_request_token_secret', '');
|
||||
return oauth;
|
||||
};
|
||||
|
||||
oauth.xhr = function(options, callback) {
|
||||
if (token('oauth_token')) {
|
||||
o.oauth_token = token('oauth_token');
|
||||
}
|
||||
o = timenonce(o);
|
||||
var url = baseurl + options.path;
|
||||
var oauth_token_secret = token('oauth_token_secret');
|
||||
o.oauth_signature = ohauth.signature(oauth_secret, oauth_token_secret,
|
||||
ohauth.baseString(options.method, url, o));
|
||||
function done(err, xhr) {
|
||||
if (err) return callback(err);
|
||||
if (xhr.responseXML) return callback(err, xhr.responseXML);
|
||||
else return callback(err, xhr.response);
|
||||
}
|
||||
ohauth.xhr(options.method,
|
||||
url, o, options.content, options.options, done);
|
||||
};
|
||||
|
||||
oauth.authenticate = function(callback) {
|
||||
if (oauth.authenticated()) return callback();
|
||||
|
||||
oauth.logout();
|
||||
|
||||
setAuth();
|
||||
o = timenonce(o);
|
||||
|
||||
var url = baseurl + '/oauth/request_token';
|
||||
o.oauth_signature = ohauth.signature(oauth_secret, '',
|
||||
ohauth.baseString('POST', url, o));
|
||||
|
||||
var l = iD.ui.loading(context.container(), 'contacting openstreetmap...');
|
||||
|
||||
// it would make more sense to have this code within the callback
|
||||
// to oauth.xhr below. however, it needs to be directly within a
|
||||
// browser event handler in order to open a popup without it being
|
||||
// blocked.
|
||||
var w = 600, h = 550,
|
||||
settings = [
|
||||
['width', w], ['height', h],
|
||||
['left', screen.width / 2 - w / 2],
|
||||
['top', screen.height / 2 - h / 2]].map(function(x) {
|
||||
return x.join('=');
|
||||
}).join(','),
|
||||
popup = window.open("about:blank", 'oauth_window', settings);
|
||||
|
||||
window.authComplete = function(token) {
|
||||
var oauth_token = ohauth.stringQs(token);
|
||||
get_access_token(oauth_token);
|
||||
delete window.authComplete;
|
||||
};
|
||||
|
||||
function reqTokenDone(err, xhr) {
|
||||
if (err) callback(err);
|
||||
l.remove();
|
||||
|
||||
var resp = ohauth.stringQs(xhr.response);
|
||||
token('oauth_request_token_secret', resp.oauth_token_secret);
|
||||
|
||||
popup.location = baseurl + '/oauth/authorize?' + ohauth.qsString({
|
||||
oauth_token: resp.oauth_token,
|
||||
oauth_callback: location.href.replace('index.html', '')
|
||||
.replace(/#.+/, '') + 'land.html'
|
||||
});
|
||||
}
|
||||
|
||||
ohauth.xhr('POST', url, o, null, {}, reqTokenDone);
|
||||
|
||||
function get_access_token(oauth_token) {
|
||||
var url = baseurl + '/oauth/access_token';
|
||||
o = timenonce(o);
|
||||
|
||||
o.oauth_token = oauth_token.oauth_token;
|
||||
var request_token_secret = token('oauth_request_token_secret');
|
||||
o.oauth_signature = ohauth.signature(oauth_secret, request_token_secret,
|
||||
ohauth.baseString('POST', url, o));
|
||||
var l = iD.ui.loading(context.container(), 'contacting openstreetmap...');
|
||||
|
||||
function accessTokenDone(err, xhr) {
|
||||
if (err) return callback(err);
|
||||
l.remove();
|
||||
var access_token = ohauth.stringQs(xhr.response);
|
||||
token('oauth_token', access_token.oauth_token);
|
||||
token('oauth_token_secret', access_token.oauth_token_secret);
|
||||
callback();
|
||||
}
|
||||
|
||||
ohauth.xhr('POST', url, o, null, {}, accessTokenDone);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function setAuth() {
|
||||
if (baseurl && keys && keys[baseurl]) {
|
||||
o = _.assign({}, _.omit(keys[baseurl], 'oauth_secret'));
|
||||
oauth_secret = keys[baseurl].oauth_secret;
|
||||
}
|
||||
}
|
||||
|
||||
oauth.url = function(_) {
|
||||
if (!arguments.length) return baseurl;
|
||||
baseurl = _;
|
||||
setAuth();
|
||||
return oauth;
|
||||
};
|
||||
|
||||
oauth.keys = function(_) {
|
||||
if (!arguments.length) return keys;
|
||||
keys = _;
|
||||
setAuth();
|
||||
return oauth;
|
||||
};
|
||||
|
||||
return oauth;
|
||||
};
|
||||
@@ -238,8 +238,13 @@ iD.ui.Background = function(context) {
|
||||
.on('click', function() {
|
||||
d3.event.preventDefault();
|
||||
d3.event.stopPropagation();
|
||||
context.map()
|
||||
.extent(d3.geo.bounds(context.map().layers[1].geojson()))
|
||||
if (context.map().layers[1].geojson().type) {
|
||||
context.map()
|
||||
.extent(d3.geo.bounds(context
|
||||
.map()
|
||||
.layers[1]
|
||||
.geojson()));
|
||||
}
|
||||
})
|
||||
.append('span')
|
||||
.attr('class', 'icon geocode' );
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
(function(context) {
|
||||
|
||||
var ohauth = {};
|
||||
|
||||
ohauth.qsString = function(obj) {
|
||||
return Object.keys(obj).sort().map(function(key) {
|
||||
return encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]);
|
||||
}).join('&');
|
||||
};
|
||||
|
||||
ohauth.sha = sha1();
|
||||
|
||||
ohauth.stringQs = function(str) {
|
||||
return str.split('&').reduce(function(obj, pair){
|
||||
var parts = pair.split('=');
|
||||
obj[parts[0]] = (null === parts[1]) ? '' : decodeURIComponent(parts[1]);
|
||||
return obj;
|
||||
}, {});
|
||||
};
|
||||
|
||||
ohauth.xhr = function(method, url, auth, data, options, callback) {
|
||||
var xhr = new XMLHttpRequest(),
|
||||
twoHundred = /^20\d$/;
|
||||
xhr.onreadystatechange = function() {
|
||||
if (4 == xhr.readyState && 0 !== xhr.status) {
|
||||
if (twoHundred.test(xhr.status)) {
|
||||
callback(null, xhr);
|
||||
} else {
|
||||
callback(xhr, null);
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.onerror = function(e) { return callback(e, null); };
|
||||
var headers = (options && options.header) || { 'Content-Type': 'application/x-www-form-urlencoded' };
|
||||
xhr.open(method, url, true);
|
||||
xhr.setRequestHeader('Authorization', 'OAuth ' + ohauth.authHeader(auth));
|
||||
for (var h in headers) xhr.setRequestHeader(h, headers[h]);
|
||||
xhr.send(data);
|
||||
};
|
||||
|
||||
ohauth.nonce = function() {
|
||||
for (var o = ''; o.length < 6;) {
|
||||
o += '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'[Math.floor(Math.random() * 61)];
|
||||
}
|
||||
return o;
|
||||
};
|
||||
|
||||
ohauth.authHeader = function(obj) {
|
||||
return Object.keys(obj).sort().map(function(key) {
|
||||
return encodeURIComponent(key) + '="' + encodeURIComponent(obj[key]) + '"';
|
||||
}).join(', ');
|
||||
};
|
||||
|
||||
ohauth.timestamp = function() { return ~~((+new Date()) / 1000); };
|
||||
|
||||
ohauth.percentEncode = function(s) {
|
||||
return encodeURIComponent(s)
|
||||
.replace(/\!/g, '%21').replace(/\'/g, '%27')
|
||||
.replace(/\*/g, '%2A').replace(/\(/g, '%28').replace(/\)/g, '%29');
|
||||
};
|
||||
|
||||
ohauth.baseString = function(method, url, params) {
|
||||
if (params.oauth_signature) delete params.oauth_signature;
|
||||
return [
|
||||
method,
|
||||
ohauth.percentEncode(url),
|
||||
ohauth.percentEncode(ohauth.qsString(params))].join('&');
|
||||
};
|
||||
|
||||
ohauth.signature = function(oauth_secret, token_secret, baseString) {
|
||||
return ohauth.sha.b64_hmac_sha1(
|
||||
ohauth.percentEncode(oauth_secret) + '&' +
|
||||
ohauth.percentEncode(token_secret),
|
||||
baseString);
|
||||
};
|
||||
|
||||
context.ohauth = ohauth;
|
||||
|
||||
})(this);
|
||||
|
||||
+2074
File diff suppressed because it is too large
Load Diff
-190
@@ -1,190 +0,0 @@
|
||||
/*
|
||||
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
|
||||
* in FIPS PUB 180-1
|
||||
* Version 2.1a Copyright Paul Johnston 2000 - 2002.
|
||||
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
|
||||
* Distributed under the BSD License
|
||||
* See http://pajhome.org.uk/crypt/md5 for details.
|
||||
*/
|
||||
|
||||
function sha1() {
|
||||
|
||||
/*
|
||||
* Configurable variables. You may need to tweak these to be compatible with
|
||||
* the server-side, but the defaults work in most cases.
|
||||
*/
|
||||
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
|
||||
var b64pad = "="; /* base-64 pad character. "=" for strict RFC compliance */
|
||||
var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
|
||||
|
||||
/*
|
||||
* These are the functions you'll usually want to call
|
||||
* They take string arguments and return either hex or base-64 encoded strings
|
||||
*/
|
||||
function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
|
||||
function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
|
||||
function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
|
||||
function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
|
||||
function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
|
||||
function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
|
||||
|
||||
/*
|
||||
* Perform a simple self-test to see if the VM is working
|
||||
*/
|
||||
function sha1_vm_test() {
|
||||
return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the SHA-1 of an array of big-endian words, and a bit length
|
||||
*/
|
||||
function core_sha1(x, len) {
|
||||
/* append padding */
|
||||
x[len >> 5] |= 0x80 << (24 - len % 32);
|
||||
x[((len + 64 >> 9) << 4) + 15] = len;
|
||||
|
||||
var w = Array(80);
|
||||
var a = 1732584193;
|
||||
var b = -271733879;
|
||||
var c = -1732584194;
|
||||
var d = 271733878;
|
||||
var e = -1009589776;
|
||||
|
||||
for(var i = 0; i < x.length; i += 16) {
|
||||
var olda = a;
|
||||
var oldb = b;
|
||||
var oldc = c;
|
||||
var oldd = d;
|
||||
var olde = e;
|
||||
|
||||
for(var j = 0; j < 80; j++) {
|
||||
if(j < 16) w[j] = x[i + j];
|
||||
else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
|
||||
var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
|
||||
safe_add(safe_add(e, w[j]), sha1_kt(j)));
|
||||
e = d;
|
||||
d = c;
|
||||
c = rol(b, 30);
|
||||
b = a;
|
||||
a = t;
|
||||
}
|
||||
|
||||
a = safe_add(a, olda);
|
||||
b = safe_add(b, oldb);
|
||||
c = safe_add(c, oldc);
|
||||
d = safe_add(d, oldd);
|
||||
e = safe_add(e, olde);
|
||||
}
|
||||
return Array(a, b, c, d, e);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Perform the appropriate triplet combination function for the current
|
||||
* iteration
|
||||
*/
|
||||
function sha1_ft(t, b, c, d) {
|
||||
if(t < 20) return (b & c) | ((~b) & d);
|
||||
if(t < 40) return b ^ c ^ d;
|
||||
if(t < 60) return (b & c) | (b & d) | (c & d);
|
||||
return b ^ c ^ d;
|
||||
}
|
||||
|
||||
/*
|
||||
* Determine the appropriate additive constant for the current iteration
|
||||
*/
|
||||
function sha1_kt(t) {
|
||||
return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
|
||||
(t < 60) ? -1894007588 : -899497514;
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the HMAC-SHA1 of a key and some data
|
||||
*/
|
||||
function core_hmac_sha1(key, data) {
|
||||
var bkey = str2binb(key);
|
||||
if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);
|
||||
|
||||
var ipad = Array(16), opad = Array(16);
|
||||
for(var i = 0; i < 16; i++) {
|
||||
ipad[i] = bkey[i] ^ 0x36363636;
|
||||
opad[i] = bkey[i] ^ 0x5C5C5C5C;
|
||||
}
|
||||
|
||||
var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
|
||||
return core_sha1(opad.concat(hash), 512 + 160);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
||||
* to work around bugs in some JS interpreters.
|
||||
*/
|
||||
function safe_add(x, y) {
|
||||
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
|
||||
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
||||
return (msw << 16) | (lsw & 0xFFFF);
|
||||
}
|
||||
|
||||
/*
|
||||
* Bitwise rotate a 32-bit number to the left.
|
||||
*/
|
||||
function rol(num, cnt) {
|
||||
return (num << cnt) | (num >>> (32 - cnt));
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an 8-bit or 16-bit string to an array of big-endian words
|
||||
* In 8-bit function, characters >255 have their hi-byte silently ignored.
|
||||
*/
|
||||
function str2binb(str) {
|
||||
var bin = Array();
|
||||
var mask = (1 << chrsz) - 1;
|
||||
for(var i = 0; i < str.length * chrsz; i += chrsz)
|
||||
bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
|
||||
return bin;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an array of big-endian words to a string
|
||||
*/
|
||||
function binb2str(bin) {
|
||||
var str = "";
|
||||
var mask = (1 << chrsz) - 1;
|
||||
for(var i = 0; i < bin.length * 32; i += chrsz)
|
||||
str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
|
||||
return str;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an array of big-endian words to a hex string.
|
||||
*/
|
||||
function binb2hex(binarray) {
|
||||
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
|
||||
var str = "";
|
||||
for(var i = 0; i < binarray.length * 4; i++) {
|
||||
str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
|
||||
hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an array of big-endian words to a base-64 string
|
||||
*/
|
||||
function binb2b64(binarray) {
|
||||
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
var str = "";
|
||||
for(var i = 0; i < binarray.length * 4; i += 3) {
|
||||
var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16)
|
||||
| (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
|
||||
| ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
|
||||
for(var j = 0; j < 4; j++) {
|
||||
if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
|
||||
else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
return { b64_hmac_sha1: b64_hmac_sha1 };
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
<html><head></head>
|
||||
<body>
|
||||
<script>
|
||||
opener.authComplete(window.location.search.slice(1));
|
||||
opener.authComplete(window.location.href);
|
||||
window.close();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
+1
-3
@@ -18,8 +18,6 @@
|
||||
<!-- include source files here... -->
|
||||
<script src='../js/lib/lodash.js'></script>
|
||||
<script src='../js/lib/d3.v3.js'></script>
|
||||
<script src='../js/lib/sha.js'></script>
|
||||
<script src='../js/lib/ohauth.js'></script>
|
||||
<script src='../js/lib/jxon.js'></script>
|
||||
<script src='../js/lib/d3.typeahead.js'></script>
|
||||
<script src='../js/lib/d3.combobox.js'></script>
|
||||
@@ -33,10 +31,10 @@
|
||||
<script src='../js/lib/bootstrap-tooltip.js'></script>
|
||||
<script src='../js/lib/rtree.js'></script>
|
||||
<script src='../js/lib/togeojson.js'></script>
|
||||
<script src='../js/lib/osmauth.js'></script>
|
||||
|
||||
<script src='../js/id/id.js'></script>
|
||||
<script src='../js/id/util.js'></script>
|
||||
<script src='../js/id/oauth.js'></script>
|
||||
<script src='../js/id/services/taginfo.js'></script>
|
||||
|
||||
<script src='../data/data_dev.js'></script>
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
describe('iD.OAuth', function() {
|
||||
var o;
|
||||
|
||||
beforeEach(function() {
|
||||
context = iD();
|
||||
o = iD.OAuth(context);
|
||||
});
|
||||
|
||||
describe('#logout', function() {
|
||||
it('can log out and will no longer be authenticated', function() {
|
||||
expect(o.logout()).to.equal(o);
|
||||
expect(o.authenticated()).not.to.be.ok;
|
||||
});
|
||||
});
|
||||
|
||||
describe('#url', function() {
|
||||
it('gets and sets url', function() {
|
||||
expect(o.url('foo')).to.equal(o);
|
||||
expect(o.url()).to.equal('foo');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user