From aa9428b9e14542e79c38c9d7ef549a2766766846 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Sun, 6 Jan 2013 22:10:12 +0100 Subject: More javascript cleanup --- web/public/js/taginfo.js | 4 ++++ web/viewsjs/key.js.erb | 10 +++++----- web/viewsjs/reports/languages.js.erb | 2 +- web/viewsjs/reports/wiki_pages_about_non_existing_keys.js.erb | 2 -- web/viewsjs/tag.js.erb | 10 +++++----- 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 ? 'yes ' : 'no '; +} + 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 ? 'yes' : 'no') + ' ' + - (row.on_way ? 'yes' : 'no') + ' ' + - (row.on_area ? 'yes' : 'no') + ' ' + - (row.on_relation ? 'yes' : '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/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': [ - '' + row.code + '', + 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: 'Wiki', name: 'in_wiki', width: 20, sortable: true, align: 'center' }, { display: 'JOSM', name: 'in_josm', width: 20, sortable: true, align: 'center' }, - // { display: 'Potlatch 2', name: 'in_potlatch', width: 20, sortable: true, align: 'center' }, - // { display: '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 ? 'yes' : 'no') + ' ' + - (row.on_way ? 'yes' : 'no') + ' ' + - (row.on_area ? 'yes' : 'no') + ' ' + - (row.on_relation ? 'yes' : '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': [ - '' + link_to_tag(row.key, row.value) + '', + 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), -- cgit v1.2.3