diff options
author | Jochen Topf <jochen@topf.org> | 2013-01-19 12:05:43 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2013-01-19 12:05:43 +0100 |
commit | c6ba4011089fc1dd964ef42edd90deff59104866 (patch) | |
tree | 3ac32daab7ef27d7fba786be9f7a6cea0711aa04 /web/taginfo.rb | |
parent | 253b55a53212ea59cd188418ef138dcbbbaba718 (diff) | |
download | taginfo-c6ba4011089fc1dd964ef42edd90deff59104866.tar taginfo-c6ba4011089fc1dd964ef42edd90deff59104866.tar.gz |
Include fewer js files
Diffstat (limited to 'web/taginfo.rb')
-rwxr-xr-x | web/taginfo.rb | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/web/taginfo.rb b/web/taginfo.rb index ab0cc85..c4c60f8 100755 --- a/web/taginfo.rb +++ b/web/taginfo.rb @@ -102,14 +102,9 @@ class Taginfo < Sinatra::Base params[:locale] = request.cookies['taginfo_locale'] end - javascript 'jquery-1.9.0.min' - javascript 'jquery-migrate-1.0.0.min' # needed for flexigrid - javascript 'jquery-ui-1.9.2.custom.min' - javascript 'customSelect.jquery.min' - javascript 'jquery.tipsy-minified' - javascript 'flexigrid-minified' + javascript_for(:jquery) + javascript_for(:taginfo) javascript r18n.locale.code + '/texts' - javascript 'taginfo' # set to immediate expire on normal pages # (otherwise switching languages doesn't work) @@ -155,9 +150,9 @@ class Taginfo < Sinatra::Base #------------------------------------- - %w(about download keys relations sources tags).each do |page| + %w(about download sources).each do |page| get '/' + page do - @title = (page =~ /^(keys|tags|relations)$/) ? t.osm[page] : t.taginfo[page] + @title = t.taginfo[page] if File.exists?("viewsjs/#{ page }.js.erb") javascript "#{ r18n.locale.code }/#{ page }" end @@ -165,6 +160,15 @@ class Taginfo < Sinatra::Base end end + %w(keys tags relations).each do |page| + get '/' + page do + @title = t.osm[page] + javascript_for(:flexigrid) + javascript "#{ r18n.locale.code }/#{ page }" + erb page.to_sym + end + end + #------------------------------------- get %r{^/js/([a-z][a-z])/(.*).js$} do |lang, js| |