diff options
author | Jochen Topf <jochen@topf.org> | 2012-01-24 18:23:06 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2012-01-24 18:23:06 +0100 |
commit | d932dc515b51156ab50c40ee239ea210dd4406fa (patch) | |
tree | 8dff58107350e486fcc4d497d838f0306c3f53ce /web/viewsjs/key.js.erb | |
parent | 3dadc9377a0ecedec6ae9178da2815376ce97675 (diff) | |
download | taginfo-d932dc515b51156ab50c40ee239ea210dd4406fa.tar taginfo-d932dc515b51156ab50c40ee239ea210dd4406fa.tar.gz |
key page tab cleanup
Diffstat (limited to 'web/viewsjs/key.js.erb')
-rw-r--r-- | web/viewsjs/key.js.erb | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/web/viewsjs/key.js.erb b/web/viewsjs/key.js.erb index 92775bc..baf2f15 100644 --- a/web/viewsjs/key.js.erb +++ b/web/viewsjs/key.js.erb @@ -55,7 +55,7 @@ var create_flexigrid_for = { } }); }, - keys: function(key, filter_type) { + combinations: function(key, filter_type) { create_flexigrid('grid-keys', { url: '/api/2/db/keys/keys?key=' + encodeURIComponent(key) + '&filter=' + encodeURIComponent(filter_type), colModel: [ @@ -80,31 +80,6 @@ var create_flexigrid_for = { } }); }, - josm: function(key, filter_type) { - create_flexigrid('grid-josm', { - url: '/api/2/josm/styles/standard/keys?key=' + encodeURIComponent(key), - colModel: [ - { display: '<%= osm.value %>', name: 'v', width: 400, sortable: true }, - { display: '<%= misc.icon %>', name: 'icon', width: 40, sortable: false, align: 'center' }, - { display: '<%= misc.line %>', name: 'line', width: 40, sortable: false, align: 'center' }, - { display: '<%= misc.area %>', name: 'area', width: 40, sortable: false, align: 'center' } - ], - sortname: 'v', - sortorder: 'asc', - emptymsg: '<%= page.josm.no_styles %>', - preProcess: function(data) { - 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: ' + (10 - 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: 18px; background-color: ' + row.area_color + '"></div>' : '' - ] }; - }); - return data; - } - }); - }, wiki: function(key, filter_type) { create_flexigrid('grid-wiki', { url: '/api/2/wiki/keys?key=' + encodeURIComponent(key), @@ -142,6 +117,31 @@ var create_flexigrid_for = { }; } }); + }, + josm: function(key, filter_type) { + create_flexigrid('grid-josm', { + url: '/api/2/josm/styles/standard/keys?key=' + encodeURIComponent(key), + colModel: [ + { display: '<%= osm.value %>', name: 'v', width: 400, sortable: true }, + { display: '<%= misc.icon %>', name: 'icon', width: 40, sortable: false, align: 'center' }, + { display: '<%= misc.line %>', name: 'line', width: 40, sortable: false, align: 'center' }, + { display: '<%= misc.area %>', name: 'area', width: 40, sortable: false, align: 'center' } + ], + sortname: 'v', + sortorder: 'asc', + emptymsg: '<%= page.josm.no_styles %>', + preProcess: function(data) { + 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: ' + (10 - 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: 18px; background-color: ' + row.area_color + '"></div>' : '' + ] }; + }); + return data; + } + }); } }; |