diff options
author | Jochen Topf <jochen@topf.org> | 2013-01-06 22:10:12 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2013-01-06 22:19:55 +0100 |
commit | aa9428b9e14542e79c38c9d7ef549a2766766846 (patch) | |
tree | d39a2c22e86e1d63c5368a1be613ab1e42868523 | |
parent | 068fc5d43dd2a0e01025b018b682b39089a57338 (diff) | |
download | taginfo-aa9428b9e14542e79c38c9d7ef549a2766766846.tar taginfo-aa9428b9e14542e79c38c9d7ef549a2766766846.tar.gz |
More javascript cleanup
-rw-r--r-- | web/public/js/taginfo.js | 4 | ||||
-rw-r--r-- | web/viewsjs/key.js.erb | 10 | ||||
-rw-r--r-- | web/viewsjs/reports/languages.js.erb | 2 | ||||
-rw-r--r-- | web/viewsjs/reports/wiki_pages_about_non_existing_keys.js.erb | 2 | ||||
-rw-r--r-- | web/viewsjs/tag.js.erb | 10 | ||||
-rw-r--r-- | web/viewsjs/tags.js.erb | 2 |
6 files changed, 16 insertions, 14 deletions
diff --git a/web/public/js/taginfo.js b/web/public/js/taginfo.js index 8a9216e..16d0b4d 100644 --- a/web/public/js/taginfo.js +++ b/web/public/js/taginfo.js @@ -103,6 +103,10 @@ function print_language(code, native_name, english_name) { return tag('span', code, { 'class': 'lang', title: native_name + ' (' + english_name + ')' }) + ' ' + native_name; } +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_image(type) { type = type.replace(/s$/, ''); var name; diff --git a/web/viewsjs/key.js.erb b/web/viewsjs/key.js.erb index e8db21f..9333425 100644 --- a/web/viewsjs/key.js.erb +++ b/web/viewsjs/key.js.erb @@ -104,11 +104,11 @@ var create_flexigrid_for = { print_language(row.lang, row.language, row.language_en), print_wiki_link(row.title), row.description, - row.image == '' ? empty('<%= misc.no_image %>') : hover_expand(print_wiki_link(row.image)), - (row.on_node ? '<img src="/img/types/node.16.png" alt="yes" width="16" height="16"/>' : '<img src="/img/types/none.16.png" alt="no" width="16" height="16"/>') + ' ' + - (row.on_way ? '<img src="/img/types/way.16.png" alt="yes" width="16" height="16"/>' : '<img src="/img/types/none.16.png" alt="no" width="16" height="16"/>') + ' ' + - (row.on_area ? '<img src="/img/types/area.16.png" alt="yes" width="16" height="16"/>' : '<img src="/img/types/none.16.png" alt="no" width="16" height="16"/>') + ' ' + - (row.on_relation ? '<img src="/img/types/relation.16.png" alt="yes" width="16" height="16"/>' : '<img src="/img/types/none.16.png" alt="no" width="16" height="16"/>'), + row.image == '' ? empty('<%= misc.no_image %>') : hover_expand(print_wiki_link(row.image)), + print_type_icon('node', row.on_node) + + print_type_icon('way', row.on_way) + + print_type_icon('area', row.on_area) + + print_type_icon('relation', row.on_relation), print_key_or_tag_list(row.tags_implies), print_key_or_tag_list(row.tags_combination), print_key_or_tag_list(row.tags_linked) diff --git a/web/viewsjs/reports/languages.js.erb b/web/viewsjs/reports/languages.js.erb index 816660c..2cb8a8f 100644 --- a/web/viewsjs/reports/languages.js.erb +++ b/web/viewsjs/reports/languages.js.erb @@ -20,7 +20,7 @@ function page_init() { page: 1, rows: jQuery.map(data.data, function(row, i) { return { 'cell': [ - '<span class="lang">' + row.code + '</span>', + span(row.code, 'lang'), row.native_name, row.english_name, print_value_with_percent(row.wiki_key_pages, row.wiki_key_pages_fraction), diff --git a/web/viewsjs/reports/wiki_pages_about_non_existing_keys.js.erb b/web/viewsjs/reports/wiki_pages_about_non_existing_keys.js.erb index 136108e..07e85a2 100644 --- a/web/viewsjs/reports/wiki_pages_about_non_existing_keys.js.erb +++ b/web/viewsjs/reports/wiki_pages_about_non_existing_keys.js.erb @@ -8,8 +8,6 @@ function page_init() { colModel: [ { display: '<img src="/img/sources/wiki.16.png" alt="Wiki" width="16" height="16" title="Wiki"/>', name: 'in_wiki', width: 20, sortable: true, align: 'center' }, { display: '<img src="/img/sources/josm.16.png" alt="JOSM" width="16" height="16" title="JOSM"/>', name: 'in_josm', width: 20, sortable: true, align: 'center' }, - // { display: '<img src="/img/sources/potlatch.16.png" alt="Potlatch 2" width="16" height="16" title="Potlatch 2"/>', name: 'in_potlatch', width: 20, sortable: true, align: 'center' }, - // { display: '<img src="/img/sources/merkaartor.16.png" alt="Merkaartor" width="16" height="16" title="Merkaartor"/>', name: 'in_merkaartor', width: 20, sortable: true, align: 'center' }, { display: '<%= osm.key %>', name: 'key', width: 260, sortable: true, align: 'left' }, { display: '<%= page.wiki_pages %>', name: 'wikipages', width: 400, sortable: false, align: 'left' } ], diff --git a/web/viewsjs/tag.js.erb b/web/viewsjs/tag.js.erb index c098d64..90f8a23 100644 --- a/web/viewsjs/tag.js.erb +++ b/web/viewsjs/tag.js.erb @@ -77,11 +77,11 @@ var create_flexigrid_for = { print_language(row.lang, row.language, row.language_en), print_wiki_link(row.title), row.description, - row.image == '' ? empty('<%= misc.no_image %>') : hover_expand(print_wiki_link(row.image)), - (row.on_node ? '<img width="16" height="16" src="/img/types/node.16.png" alt="yes"/>' : '<img width="16" height="16" src="/img/types/none.16.png" alt="no"/>') + ' ' + - (row.on_way ? '<img width="16" height="16" src="/img/types/way.16.png" alt="yes"/>' : '<img width="16" height="16" src="/img/types/none.16.png" alt="no"/>') + ' ' + - (row.on_area ? '<img width="16" height="16" src="/img/types/area.16.png" alt="yes"/>' : '<img width="16" height="16" src="/img/types/none.16.png" alt="no"/>') + ' ' + - (row.on_relation ? '<img width="16" height="16" src="/img/types/relation.16.png" alt="yes"/>' : '<img width="16" height="16" src="/img/types/none.16.png" alt="no"/>'), + row.image == '' ? empty('<%= misc.no_image %>') : hover_expand(print_wiki_link(row.image)), + print_type_icon('node', row.on_node) + + print_type_icon('way', row.on_way) + + print_type_icon('area', row.on_area) + + print_type_icon('relation', row.on_relation), print_key_or_tag_list(row.tags_implies), print_key_or_tag_list(row.tags_combination), print_key_or_tag_list(row.tags_linked) diff --git a/web/viewsjs/tags.js.erb b/web/viewsjs/tags.js.erb index 6ba5c98..e9e926e 100644 --- a/web/viewsjs/tags.js.erb +++ b/web/viewsjs/tags.js.erb @@ -20,7 +20,7 @@ function page_init() { preProcess: function(data) { data.rows = jQuery.map(data.data, function(row, i) { return { 'cell': [ - '<span class="overflow">' + link_to_tag(row.key, row.value) + '</span>', + hover_expand(link_to_tag(row.key, row.value)), print_value_with_percent(row.count_all, row.count_all_fraction), print_value_with_percent(row.count_nodes, row.count_nodes_fraction), print_value_with_percent(row.count_ways, row.count_ways_fraction), |