aboutsummaryrefslogtreecommitdiff
path: root/web/public
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2013-01-06 22:29:37 +0100
committerJochen Topf <jochen@topf.org>2013-01-06 22:29:37 +0100
commit5cfd2edfe3cb42ff9b1f917769c3232e5a9d8bb2 (patch)
tree33b8b96c6222c75bc0e9885b1021653ebf3a4bc0 /web/public
parentaa9428b9e14542e79c38c9d7ef549a2766766846 (diff)
downloadtaginfo-5cfd2edfe3cb42ff9b1f917769c3232e5a9d8bb2.tar
taginfo-5cfd2edfe3cb42ff9b1f917769c3232e5a9d8bb2.tar.gz
Javascript functions to pretty-print JOSM data
Diffstat (limited to 'web/public')
-rw-r--r--web/public/js/taginfo.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/web/public/js/taginfo.js b/web/public/js/taginfo.js
index 16d0b4d..1410fe2 100644
--- a/web/public/js/taginfo.js
+++ b/web/public/js/taginfo.js
@@ -107,6 +107,22 @@ function print_type_icon(type, on_or_off) {
return on_or_off ? '<img src="/img/types/' + type + '.16.png" alt="yes" width="16" height="16"/> ' : '<img src="/img/types/none.16.png" alt="no" width="16" height="16"/> ';
}
+function print_josm_value(key, value, value_bool) {
+ return value ? link_to_value(key, value) : value_bool ? (value_bool + ' (Boolean)') : '*';
+}
+
+function print_josm_icon(style, icon) {
+ return icon ? '<img src="/api/4/josm/style/image?style=' + style + '&image=' + icon + '" title="' + icon + '" alt=""/>' : '';
+}
+
+function print_josm_line(width, color) {
+ return '<div>' + (width > 0 ? '<div title="' + color + '" style="height: ' + width + 'px; margin-top: ' + (10 - Math.round(width/2)) + 'px; padding: 0; background-color: ' + color + '"></div>' : '') + '</div>';
+}
+
+function print_josm_area(color) {
+ return color ? '<div title="' + color + '" style="height: 18px; background-color: ' + color + '"></div>' : '';
+}
+
function print_image(type) {
type = type.replace(/s$/, '');
var name;