diff options
author | Jochen Topf <jochen@topf.org> | 2013-01-17 12:07:27 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2013-01-17 12:07:27 +0100 |
commit | eac60a1f7cf2a6cff7e6656f5bc4138f8efa3a31 (patch) | |
tree | 36643904ded706211a19df4a763ec63826374571 /web/public/js | |
parent | 2a6a1bc09a3839d3c941def8f01ea76974caf37e (diff) | |
download | taginfo-eac60a1f7cf2a6cff7e6656f5bc4138f8efa3a31.tar taginfo-eac60a1f7cf2a6cff7e6656f5bc4138f8efa3a31.tar.gz |
More misc js cleanup
Diffstat (limited to 'web/public/js')
-rw-r--r-- | web/public/js/taginfo.js | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/web/public/js/taginfo.js b/web/public/js/taginfo.js index 307c508..c578fde 100644 --- a/web/public/js/taginfo.js +++ b/web/public/js/taginfo.js @@ -265,7 +265,11 @@ function hover_expand(text) { /* ============================ */ -function fmt_img_popup(image) { +function fmt_wiki_image_popup(image) { + if (! image.title) { + return empty(texts.misc.no_image); + } + var w = image.width, h = image.height, max_size = 180, @@ -340,21 +344,16 @@ function fmt_josm_area(color) { }); } -function fmt_image(type) { +function fmt_type_image(type) { type = type.replace(/s$/, ''); - var name; - if (type == 'all') { - name = texts.misc.all; - } else { - name = texts.osm[type]; - } + var name = html_escape(texts.osm[type]); return img({ src: '/img/types/' + encodeURIComponent(type) + '.16.png', - alt: '[' + html_escape(name) + ']', - title: html_escape(name), + alt: '[' + name + ']', + title: name, width: 16, height: 16 - }); + }) + ' ' + name; } // format a number with thousand separator |