Be specific about retina as not to break the glue-generated sprite.

* Warn before switching sources. Fixes #779.
* Inline docs keep their place. Fixes #1109
This commit is contained in:
Tom MacWright
2013-03-22 17:56:22 -04:00
parent 697d15c3f5
commit 3b09c186b6
5 changed files with 120 additions and 102 deletions

View File

@@ -2158,7 +2158,8 @@ a.success-action.twitter:before {
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
.icon {
.map-control .icon,
.button-wrap .icon {
background-image: url(../img/sprite2x.png);
background-size: 500px 320px;
}

View File

@@ -165,6 +165,7 @@ en:
text: "This is development version {version}. For more information see {website} and report bugs at {github}."
source_switch:
live: live
lose_changes: "You have unsaved changes. Switching the map server will discard them. Are you sure you want to switch servers?"
dev: dev
tag_reference:
description: Description

View File

@@ -206,6 +206,7 @@ locale.en = {
},
"source_switch": {
"live": "live",
"lose_changes": "You have unsaved changes. Switching the map server will discard them. Are you sure you want to swith servers?",
"dev": "dev"
},
"tag_reference": {
@@ -1613,10 +1614,7 @@ locale.zh = {
"no_documentation_key": "没有关于此键的文档",
"show_more": "显示更多",
"new_tag": "新建标签",
"edit_tags": "编辑标签",
"okay": "确定",
"view_on_osm": "在OSM上查看",
"name": "名称",
"editing_feature": "编辑{feature}",
"additional": "附加标签",
"choose": "选择对象的类型",
@@ -2768,10 +2766,8 @@ locale.zh_TW = {
"no_documentation_key": "這個鍵值沒有可用的文檔",
"show_more": "顯示更多",
"new_tag": "新的標籤",
"edit_tags": "編輯標籤",
"okay": "確定",
"view_on_osm": "在OSM上顯示",
"name": "名稱",
"editing_feature": "正在編輯 {feature}",
"additional": "附加的標籤",
"choose": "選擇功能種類",
"results": "{search} 的 {n} 個結果",
@@ -2826,6 +2822,10 @@ locale.zh_TW = {
"imagery": {
"provided_by": "影像由 {source} 提供"
},
"gpx": {
"local_layer": "本機GPX檔案",
"drag_drop": "拖放一個.gpx格式的檔案到本頁"
},
"presets": {
"fields": {
"access": {
@@ -3116,10 +3116,12 @@ locale.zh_TW = {
"terms": "穆斯林,清真寺"
},
"amenity/police": {
"name": "警察局"
"name": "警察局",
"terms": "徽章,警官,警官,警官,警官,男童軍,警官,警官,警官,警官,警官,軍團,警車,偵探,警官,警官,部隊,警官,憲兵,刑警,警官, 法律,執法,警官,警官,警官,警官,警察"
},
"amenity/post_box": {
"name": "郵箱"
"name": "郵箱",
"terms": "信箱,信箱,郵箱,郵箱,郵筒,郵箱"
},
"amenity/post_office": {
"name": "郵政局"
@@ -3665,8 +3667,6 @@ locale.da = {
"no_documentation_combination": "Der er ingen dokumentation for denne tag kombination",
"no_documentation_key": "Der er ingen dokumentation tilgængelig for denne nøgle",
"new_tag": "Nyt tag",
"edit_tags": "Ret tags",
"okay": "Ok",
"view_on_osm": "Vis på OSM"
},
"background": {
@@ -3876,10 +3876,7 @@ locale.nl = {
"no_documentation_combination": "Voor deze tag is geen documentatie beschikbaar.",
"no_documentation_key": "Voor deze sleutel is geen documentatie beschikbaar",
"new_tag": "Nieuwe tag",
"edit_tags": "Tags aanpassen",
"okay": "OK",
"view_on_osm": "Bekijk op OSM",
"name": "Name",
"additional": "Additional tags",
"choose": "What are you adding?",
"results": "{n} results for {search}"
@@ -4102,10 +4099,7 @@ locale.fr = {
"no_documentation_key": "Aucune documentation n'est disponible pour cette clé",
"show_more": "Plus d'infornations",
"new_tag": "Nouveau tag",
"edit_tags": "Editer les tags",
"okay": "Okay",
"view_on_osm": "Visualiser sur OSM",
"name": "Nom",
"editing_feature": "Édition de {feature}",
"additional": "Tags complémentaires",
"choose": "Que souhaitez vous ajouter?",
@@ -4624,6 +4618,7 @@ locale.de = {
"rotate": {
"title": "Drehen",
"description": "Dieses Objekt um seinen Mittelpunkt drehen.",
"key": "R",
"annotation": {
"line": "Linie gedreht.",
"area": "Fläche gedreht."
@@ -4678,13 +4673,13 @@ locale.de = {
"no_documentation_key": "Für dises Schlüsselwort ist keine Dokumentation verfügbar",
"show_more": "Zeige mehr",
"new_tag": "Neues Attribut",
"edit_tags": "Attribute bearbeiten",
"okay": "OK",
"view_on_osm": "auf OpenStreetMap ansehen",
"name": "Name",
"editing_feature": "In Bearbeitung {feature}",
"additional": "Weitere Merkmale",
"choose": "Eigenschafts-Typ auswählen",
"results": "{n} Resultate für {search}",
"reference": "In der OpenSteetMap Wiki anschauen →"
"reference": "In der OpenSteetMap Wiki anschauen →",
"back_tooltip": "Eigenschafts-Typ ändern"
},
"background": {
"title": "Hintergrund",
@@ -4701,6 +4696,7 @@ locale.de = {
"save": {
"title": "Speichern",
"help": "Speichere Änderungen auf OpenStreetMap, um diese für andere Nutzer sichtbar zu machen.",
"no_changes": "Keine zu speichernden Änderungen.",
"error": "Beim Speichern ist ein Fehler aufgetreten",
"uploading": "Änderungen werden zu OpenStreetMap hochgeladen.",
"unsaved_changes": "Ungespeicherte Änderungen vorhanden"
@@ -5231,10 +5227,7 @@ locale.it = {
"no_documentation_key": "Non c'è documentazione per questa chiave",
"show_more": "Mostra di più",
"new_tag": "Nuovo Tag",
"edit_tags": "Modifica i tag",
"okay": "Ok",
"view_on_osm": "Mostra su OSM",
"name": "Nome",
"additional": "Tag aggiuntivi",
"choose": "Seleziona il tipo di caratteristica",
"results": "{n} risultati per {search}",
@@ -6093,7 +6086,6 @@ locale.ja = {
"no_documentation_combination": "このタグの組み合わせに関する説明文はありません",
"no_documentation_key": "このキーに対する説明文はありません",
"new_tag": "新規タグ",
"edit_tags": "タグ編集",
"view_on_osm": "詳細情報確認"
},
"background": {
@@ -6309,10 +6301,7 @@ locale.lv = {
"no_documentation_combination": "Šai apzīmējumu kombinācijai nav piejama dokumentācija",
"no_documentation_key": "Šai vērtībai nav piejama dokumentācija",
"new_tag": "Jauns apzīmējums",
"edit_tags": "Labot apzīmējumus",
"okay": "Labi",
"view_on_osm": "Apskatīt OSM",
"name": "Name",
"additional": "Papildus apzīmējumi",
"choose": "Izvēlieties objekta tipu",
"results": "Atrasti {n} rezultāti meklējot {search}",
@@ -6662,8 +6651,6 @@ locale.pl = {
"no_documentation_combination": "Nie ma dokumentacji dla tej kombinacji tagu.",
"no_documentation_key": "Nie ma dokumentacji dla tego klucza",
"new_tag": "Nowy tag",
"edit_tags": "Edytuj tagi",
"okay": "Okej",
"view_on_osm": "Zobacz w OSM"
},
"background": {
@@ -6883,10 +6870,7 @@ locale.pt = {
"no_documentation_combination": "Não há documentação disponível para esta combinação de tags",
"no_documentation_key": "Não há documentação disponível para esta tecla",
"new_tag": "Nova tag",
"edit_tags": "Editar tags",
"okay": "OK",
"view_on_osm": "Ver em OSM",
"name": "Nome",
"additional": "Tags adicionais",
"choose": "O que está a adicionar?",
"results": "{n} resultados para {search}"
@@ -7107,10 +7091,7 @@ locale.ru = {
"no_documentation_combination": "Для этой комбинации ключа и значения нет описания",
"no_documentation_key": "Для этого ключа описания нет",
"new_tag": "Новый тег",
"edit_tags": "Править теги",
"okay": "Готово",
"view_on_osm": "Посмотреть в OSM",
"name": "Name",
"additional": "Additional tags",
"choose": "What are you adding?",
"results": "{n} results for {search}",
@@ -7325,8 +7306,6 @@ locale.es = {
"no_documentation_combination": "No hay documentación disponible para esta combinación de etiquetas",
"no_documentation_key": "No hay documentación disponible para esta tecla",
"new_tag": "Nueva etiqueta",
"edit_tags": "Editar etiquetas",
"okay": "OK",
"view_on_osm": "Ver en OSM"
},
"background": {
@@ -7546,10 +7525,7 @@ locale.sv = {
"no_documentation_combination": "Der er ingen dokumentation for denne tag kombination",
"no_documentation_key": "Det finns inget dokumentation för denna nyckel.",
"new_tag": "Ny tagg",
"edit_tags": "Redigera taggar",
"okay": "Ok",
"view_on_osm": "Visa på OSM",
"name": "Namn",
"additional": "Fler taggar",
"choose": "Vad lägger du till?",
"results": "{n} sökresult för {search}",
@@ -7763,10 +7739,7 @@ locale.tr = {
"no_documentation_combination": "Bu etiket kombinasyonu için dökümantasyon bulunmamaktadır.",
"no_documentation_key": "Bu anahtar için dökümantasyon bulunmamaktadır.",
"new_tag": "Yeni Etiket",
"edit_tags": "Etiketleri güncelle",
"okay": "Tamam",
"view_on_osm": "OSM üzerinde gör",
"name": "İsim",
"additional": "Ekstra etiketler",
"choose": "Neyi ekliyorsunuz?",
"results": "{n} results for {search}"
@@ -7989,10 +7962,7 @@ locale.uk = {
"no_documentation_key": "Для цього теґа немає документації",
"show_more": "Ще",
"new_tag": "Новий теґ",
"edit_tags": "Редагувати теґи",
"okay": "Готово",
"view_on_osm": "Подивтись в ОСМ",
"name": "Name",
"editing_feature": "Властивості {feature}",
"additional": "Додаткові теґи",
"choose": "Виберіть тип об’єкту",
@@ -8060,7 +8030,7 @@ locale.uk = {
"label": "Адреса",
"placeholders": {
"housename": "Назвабудинку",
"number": "123",
"number": "Номер",
"street": "Вулиця",
"city": "Місто"
}
@@ -8092,6 +8062,9 @@ locale.uk = {
"capacity": {
"label": "Міськість"
},
"collection_times": {
"label": "Час виїмки пошти"
},
"construction": {
"label": "Тип"
},
@@ -8169,6 +8142,9 @@ locale.uk = {
"office": {
"label": "Тип"
},
"oneway": {
"label": "Односторонній рух"
},
"opening_hours": {
"label": "Години"
},
@@ -8304,6 +8280,9 @@ locale.uk = {
"amenity/fire_station": {
"name": "Пожежна станція"
},
"amenity/fuel": {
"name": "Заправка"
},
"amenity/grave_yard": {
"name": "Цвинтар"
},
@@ -8767,6 +8746,9 @@ locale.uk = {
"shop/butcher": {
"name": "М’ясна лавка"
},
"shop/car": {
"name": "Автосалон"
},
"shop/car_parts": {
"name": "Автозапчастини"
},
@@ -8866,6 +8848,9 @@ locale.uk = {
"shop/sports": {
"name": "Спорттовари"
},
"shop/stationery": {
"name": "Канцтовари"
},
"shop/supermarket": {
"name": "Супермаркет"
},
@@ -8878,6 +8863,9 @@ locale.uk = {
"shop/tyres": {
"name": "Колеса та шини"
},
"shop/vacant": {
"name": "Здається в оренду"
},
"shop/variety_store": {
"name": "Універсам"
},
@@ -9113,6 +9101,7 @@ locale.vi = {
"commit": {
"title": "Lưu các Thay đổi",
"description_placeholder": "Tóm lược các đóng góp của bạn",
"message_label": "Tóm lược sửa đổi",
"upload_explanation": "Các thay đổi bạn thực hiện dưới tên {user} sẽ xuất hiện trên tất cả các bản đồ sử dụng dữ liệu OpenStreetMap.",
"save": "Lưu",
"cancel": "Hủy bỏ",
@@ -9138,10 +9127,7 @@ locale.vi = {
"no_documentation_key": "Không có tài liệu về chìa khóa này",
"show_more": "Xem thêm",
"new_tag": "Thẻ mới",
"edit_tags": "Sửa đổi các thẻ",
"okay": "OK",
"view_on_osm": "Xem tại OSM",
"name": "Tên",
"editing_feature": "Đang sửa {feature}",
"additional": "Các thẻ nâng cao",
"choose": "Chọn loại đối tượng",
@@ -9310,6 +9296,9 @@ locale.vi = {
"maxspeed": {
"label": "Tốc độ Tối đa"
},
"name": {
"label": "Tên"
},
"natural": {
"label": "Thiên nhiên"
},
@@ -9325,6 +9314,9 @@ locale.vi = {
"oneway": {
"label": "Một chiều"
},
"oneway_yes": {
"label": "Một chiều"
},
"opening_hours": {
"label": "Giờ Mở cửa"
},
@@ -9625,18 +9617,33 @@ locale.vi = {
"highway/motorway": {
"name": "Đường Cao tốc"
},
"highway/motorway_link": {
"name": "Nhánh Ra vào Đường Cao tốc",
"terms": "đường nhánh,đoạn nhánh,đường nhánh rẽ,đoạn nhánh rẽ,đường nhánh chuyển đường,nhánh chuyển đường,lối ra vào,lối ra,lối vào,nhánh ra,nhánh vào,đường nối"
},
"highway/path": {
"name": "Lối"
},
"highway/primary": {
"name": "Đường Chính"
},
"highway/primary_link": {
"name": "Nhánh Ra vào Đường Chính",
"terms": "đường nhánh,đoạn nhánh,đường nhánh rẽ,đoạn nhánh rẽ,đường nhánh chuyển đường,nhánh chuyển đường,lối ra vào,lối ra,lối vào,nhánh ra,nhánh vào,đường nối"
},
"highway/residential": {
"name": "Ngõ Dân cư"
},
"highway/road": {
"name": "Đường Nói chung"
},
"highway/secondary": {
"name": "Đường Lớn"
},
"highway/secondary_link": {
"name": "Nhánh Ra vào Đường Lớn",
"terms": "đường nhánh,đoạn nhánh,đường nhánh rẽ,đoạn nhánh rẽ,đường nhánh chuyển đường,nhánh chuyển đường,lối ra vào,lối ra,lối vào,nhánh ra,nhánh vào,đường nối"
},
"highway/service": {
"name": "Ngách"
},
@@ -9647,6 +9654,10 @@ locale.vi = {
"highway/tertiary": {
"name": "Phố"
},
"highway/tertiary_link": {
"name": "Nhánh Ra vào Phố",
"terms": "đường nhánh,đoạn nhánh,đường nhánh rẽ,đoạn nhánh rẽ,đường nhánh chuyển đường,nhánh chuyển đường,lối ra vào,lối ra,lối vào,nhánh ra,nhánh vào,đường nối"
},
"highway/track": {
"name": "Đường mòn"
},
@@ -9657,6 +9668,10 @@ locale.vi = {
"highway/trunk": {
"name": "Xa lộ"
},
"highway/trunk_link": {
"name": "Nhánh Ra vào Xa lộ",
"terms": "đường nhánh,đoạn nhánh,đường nhánh rẽ,đoạn nhánh rẽ,đường nhánh chuyển đường,nhánh chuyển đường,lối ra vào,lối ra,lối vào,nhánh ra,nhánh vào,đường nối"
},
"highway/turning_circle": {
"name": "Cuối đường Vòng tròn"
},

View File

@@ -4,7 +4,44 @@ iD.ui.Help = function(context) {
function help(selection) {
var shown = false;
var shown = false, pane;
function setup() {
pane = context.container()
.select('.help-wrap')
.html('');
var toc = pane.append('div')
.attr('class', 'toc')
.append('ul');
function clickHelp(d) {
doctitle.text(d.title);
body.html(d.html);
body.selectAll('a')
.attr('target', '_blank');
menuItems.classed('selected', function(m) {
return m.title === d.title;
});
}
var menuItems = toc.selectAll('li')
.data(iD.data.doc)
.enter()
.append('li')
.append('a')
.text(function(d) { return d.title; })
.on('click', clickHelp);
var content = pane.append('div')
.attr('class', 'left-content'),
doctitle = content.append('h2')
.text(t('help.title')),
body = content.append('div')
.attr('class', 'body');
clickHelp(iD.data.doc[0]);
}
function hide() { setVisible(false); }
function toggle() {
@@ -17,62 +54,22 @@ iD.ui.Help = function(context) {
if (show !== shown) {
button.classed('active', show);
shown = show;
var pane = context.container()
.select('.help-wrap');
if (show) {
function blockClick() {
pane.on('mousedown.help-inside', function() {
return d3.event.stopPropagation();
});
selection.on('mousedown.help-inside', function() {
return d3.event.stopPropagation();
});
}
pane.style('display', 'block')
.style('left', '-500px')
.transition()
.duration(200)
.style('left', '0px')
.each('end', function() {
pane.html('');
var toc = pane.append('div')
.attr('class', 'toc')
.append('ul');
function clickHelp(d) {
doctitle.text(d.title);
body.html(d.html);
body.selectAll('a')
.attr('target', '_blank');
menuItems.classed('selected', function(m) {
return m.title === d.title;
});
}
var menuItems = toc.selectAll('li')
.data(iD.data.doc)
.enter()
.append('li')
.append('a')
.text(function(d) { return d.title; })
.on('click', clickHelp);
var content = pane.append('div')
.attr('class', 'left-content'),
doctitle = content.append('h2')
.text(t('help.title')),
body = content.append('div')
.attr('class', 'body');
clickHelp(iD.data.doc[0]);
pane.on('mousedown.help-inside', function() {
return d3.event.stopPropagation();
});
selection.on('mousedown.help-inside', function() {
return d3.event.stopPropagation();
});
});
.each('end', blockClick);
} else {
pane.style('left', '0px')
.transition()
.duration(200)
@@ -80,7 +77,6 @@ iD.ui.Help = function(context) {
.each('end', function() {
d3.select(this).style('display', 'none');
});
pane.on('mousedown.help-inside', null);
}
}
@@ -102,6 +98,8 @@ iD.ui.Help = function(context) {
context.surface().on('mousedown.help-outside', hide);
context.container().on('mousedown.b.help-outside', hide);
setup();
var keybinding = d3.keybinding('help');
keybinding.on(key, toggle);
d3.select(document).call(keybinding);

View File

@@ -2,6 +2,9 @@ iD.ui.SourceSwitch = function(context) {
function click() {
d3.event.preventDefault();
if (context.history().hasChanges() &&
!window.confirm(t('source_switch.lose_changes'))) return;
var live = d3.select(this).classed('live');
context.connection()