From 1debdfe42cf0830388839d0a5fa2fa99de043e6d Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Mon, 13 Dec 2010 21:36:39 +0100 Subject: more javascript new style stuff, more josm scale stuff removed --- web/public/js/taginfo.js | 30 +++++++++++++++++++++++++ web/views/sources/josm/style.erb | 48 ++++++---------------------------------- 2 files changed, 37 insertions(+), 41 deletions(-) (limited to 'web') diff --git a/web/public/js/taginfo.js b/web/public/js/taginfo.js index 53ca1d3..4fa86bb 100644 --- a/web/public/js/taginfo.js +++ b/web/public/js/taginfo.js @@ -536,6 +536,36 @@ var create_flexigrid_for = { // TODO } }, + sources: { + josm: { + style: function(stylename) { + create_flexigrid('grid-rules', { + url: '/api/2/josm/styles/' + stylename, + colModel: [ + { display: 'Key', name: 'k', width: 200, sortable: true, align: 'left' }, + { display: 'Value', name: 'v', width: 200, sortable: true, align: 'left' }, + { display: 'Rule XML', name: 'rule', width: 100, sortable: false, align: 'left' } + ], + searchitems: [ + { display: 'Key/Value', name: 'k' } + ], + sortname: 'k', + sortorder: 'asc', + height: 400, + preProcess: function(data) { + data.rows = jQuery.map(data.data, function(row, i) { + return { 'cell': [ + link_to_key(row.k), + row.v ? link_to_value(row.k, row.v) : row.b ? (row.b + ' (Boolean)') : '*', + 'XML' + ] }; + }); + return data; + } + }); + } + } + }, reports: { characters_in_keys: { statistics: function() { diff --git a/web/views/sources/josm/style.erb b/web/views/sources/josm/style.erb index d5a16e4..256dc55 100644 --- a/web/views/sources/josm/style.erb +++ b/web/views/sources/josm/style.erb @@ -1,45 +1,11 @@ -

JOSM Style: <%= @stylename %>

- +
- +<% javascript do + JQuery.ready do + JS.raw(%Q{ create_flexigrid_for.sources.josm.style('#{ @stylename }'); }) + end +end +%> -- cgit v1.2.3