diff options
author | Jochen Topf <jochen@topf.org> | 2011-12-28 23:31:27 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2011-12-28 23:31:27 +0100 |
commit | 9f7eecc2d5c34fd71fae022ed8ef37a176898686 (patch) | |
tree | 1e1de8bb91405ebb30a4424c6d9debebd2cc28d0 /web/public | |
parent | 64d4f868ebdf36f96fe08fca9928a9d95c12cdc8 (diff) | |
download | taginfo-9f7eecc2d5c34fd71fae022ed8ef37a176898686.tar taginfo-9f7eecc2d5c34fd71fae022ed8ef37a176898686.tar.gz |
Show icons/map symbols in JOSM tab.
Diffstat (limited to 'web/public')
-rw-r--r-- | web/public/js/taginfo.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/web/public/js/taginfo.js b/web/public/js/taginfo.js index 0451d2f..47b4ca0 100644 --- a/web/public/js/taginfo.js +++ b/web/public/js/taginfo.js @@ -393,6 +393,9 @@ var create_flexigrid_for = { url: '/api/2/josm/styles/standard/tags?key=' + encodeURIComponent(key) + '&value=' + encodeURIComponent(value), colModel: [ { display: texts.osm.value, name: 'v', width: 200, sortable: false }, + { display: 'Icon', name: 'icon', width: 30, sortable: false, align: 'center' }, + { display: 'Line', name: 'line', width: 30, sortable: false, align: 'center' }, + { display: 'Area', name: 'area', width: 30, sortable: false, align: 'center' }, { display: 'Rule XML', name: 'rule', width: 100, sortable: false } ], /* searchitems: [ @@ -405,6 +408,9 @@ var create_flexigrid_for = { data.rows = jQuery.map(data.data, function(row, i) { return { 'cell': [ row.v ? link_to_value(row.k, row.v) : row.b ? (row.b + ' (Boolean)') : '*', + row.icon ? '<img src="/api/2/josm/styles/images?style=standard&image=' + row.icon + '" title="' + row.icon + '" alt=""/>' : '', + '<div>' + (row.line_width > 0 ? '<div title="' + row.line_color + '" style="height: ' + row.line_width + 'px; margin-top: ' + (6 - Math.round(row.line_width/2)) + 'px; padding: 0; background-color: ' + row.line_color + '"></div>' : '') + '</div>', + row.area_color ? '<div title="' + row.area_color + '" style="height: 8px; background-color: ' + row.area_color + '"></div>' : '', '<span title="' + row.rule + '">XML</span>' ] }; }); @@ -469,7 +475,10 @@ var create_flexigrid_for = { create_flexigrid('grid-josm', { url: '/api/2/josm/styles/standard/keys?key=' + encodeURIComponent(key), colModel: [ - { display: texts.osm.value, name: 'v', width: 200, sortable: true }, + { display: texts.osm.value, name: 'v', width: 200, sortable: true }, + { display: 'Icon', name: 'icon', width: 30, sortable: false, align: 'center' }, + { display: 'Line', name: 'line', width: 30, sortable: false, align: 'center' }, + { display: 'Area', name: 'area', width: 30, sortable: false, align: 'center' }, { display: 'Rule XML', name: 'rule', width: 100, sortable: false } ], searchitems: [ @@ -482,6 +491,9 @@ var create_flexigrid_for = { data.rows = jQuery.map(data.data, function(row, i) { return { 'cell': [ row.v ? link_to_value(row.k, row.v) : row.b ? (row.b + ' (Boolean)') : '*', + row.icon ? '<img src="/api/2/josm/styles/images?style=standard&image=' + row.icon + '" title="' + row.icon + '" alt=""/>' : '', + '<div>' + (row.line_width > 0 ? '<div title="' + row.line_color + '" style="height: ' + row.line_width + 'px; margin-top: ' + (6 - Math.round(row.line_width/2)) + 'px; padding: 0; background-color: ' + row.line_color + '"></div>' : '') + '</div>', + row.area_color ? '<div title="' + row.area_color + '" style="height: 8px; background-color: ' + row.area_color + '"></div>' : '', '<span title="' + row.rule + '">XML</span>' ] }; }); |