diff options
-rwxr-xr-x | bin/check-translations.rb | 2 | ||||
-rw-r--r-- | sources/db/post.sql | 2 | ||||
-rw-r--r-- | sources/db/pre.sql | 4 | ||||
-rwxr-xr-x | sources/db/update_characters.rb | 2 | ||||
-rw-r--r-- | sources/master/languages.sql | 2 | ||||
-rwxr-xr-x | sources/wiki/extract_words.rb | 2 | ||||
-rw-r--r-- | web/config.ru | 2 | ||||
-rw-r--r-- | web/lib/api/test/langtag.rb | 8 | ||||
-rw-r--r-- | web/lib/api/v4/key.rb | 4 | ||||
-rw-r--r-- | web/lib/api/v4/keys.rb | 8 | ||||
-rw-r--r-- | web/lib/api/v4/project.rb | 2 | ||||
-rw-r--r-- | web/lib/api/v4/site.rb | 2 | ||||
-rw-r--r-- | web/lib/javascript.rb | 2 | ||||
-rw-r--r-- | web/lib/sql.rb | 2 | ||||
-rw-r--r-- | web/lib/ui/keys.rb | 2 | ||||
-rw-r--r-- | web/lib/ui/search.rb | 2 | ||||
-rw-r--r-- | web/lib/ui/taginfo.rb | 6 | ||||
-rw-r--r-- | web/public/css/taginfo.css | 2 | ||||
-rw-r--r-- | web/public/js/taginfo.js | 6 | ||||
-rw-r--r-- | web/views/embed/relation.erb | 2 | ||||
-rw-r--r-- | web/viewsjs/key.js.erb | 2 | ||||
-rw-r--r-- | web/viewsjs/reports/characters_in_keys.js.erb | 2 | ||||
-rw-r--r-- | web/viewsjs/search.js.erb | 2 | ||||
-rw-r--r-- | web/viewsjs/tag.js.erb | 2 |
24 files changed, 36 insertions, 36 deletions
diff --git a/bin/check-translations.rb b/bin/check-translations.rb index 16e9b28..438b884 100755 --- a/bin/check-translations.rb +++ b/bin/check-translations.rb @@ -46,7 +46,7 @@ def walk(path, en, other) # puts "#{name} [#{en[key]}] [#{other[key]}]" if other.nil?|| ! other[key] puts "MISSING: #{name} [en=#{en[key]}]" - end + end end end end diff --git a/sources/db/post.sql b/sources/db/post.sql index 08f33b0..bd23643 100644 --- a/sources/db/post.sql +++ b/sources/db/post.sql @@ -10,7 +10,7 @@ PRAGMA journal_mode = OFF; PRAGMA synchronous = OFF; PRAGMA count_changes = OFF; PRAGMA temp_store = MEMORY; -PRAGMA cache_size = 5000000; +PRAGMA cache_size = 5000000; CREATE UNIQUE INDEX keys_key_idx ON keys (key); CREATE INDEX tags_key_idx ON tags (key); diff --git a/sources/db/pre.sql b/sources/db/pre.sql index 91bd7e7..1c752be 100644 --- a/sources/db/pre.sql +++ b/sources/db/pre.sql @@ -81,7 +81,7 @@ CREATE TABLE key_combinations ( count_all INTEGER, count_nodes INTEGER, count_ways INTEGER, - count_relations INTEGER + count_relations INTEGER ); DROP TABLE IF EXISTS tag_combinations; @@ -94,7 +94,7 @@ CREATE TABLE tag_combinations ( count_all INTEGER, count_nodes INTEGER, count_ways INTEGER, - count_relations INTEGER + count_relations INTEGER ); DROP TABLE IF EXISTS relation_types; diff --git a/sources/db/update_characters.rb b/sources/db/update_characters.rb index a729818..1b2faaf 100755 --- a/sources/db/update_characters.rb +++ b/sources/db/update_characters.rb @@ -55,7 +55,7 @@ db.execute("SELECT key FROM keys").map{ |row| row['key'] }.each do |key| keys[key] = type break end - end + end end db.transaction do |db| diff --git a/sources/master/languages.sql b/sources/master/languages.sql index b58cce4..f32871a 100644 --- a/sources/master/languages.sql +++ b/sources/master/languages.sql @@ -1,6 +1,6 @@ -- -- Taginfo --- +-- -- languages.sql -- diff --git a/sources/wiki/extract_words.rb b/sources/wiki/extract_words.rb index 70c483d..8f2fa16 100755 --- a/sources/wiki/extract_words.rb +++ b/sources/wiki/extract_words.rb @@ -71,7 +71,7 @@ class Words @kvw.sort.uniq.each do |key, value, word| if key != lastkey || value != lastvalue yield lastkey, lastvalue, words.join(',') - words = [] + words = [] lastkey = key lastvalue = value else diff --git a/web/config.ru b/web/config.ru index b220816..9d1c8ba 100644 --- a/web/config.ru +++ b/web/config.ru @@ -12,7 +12,7 @@ require 'lib/config.rb' TaginfoConfig.read LOGDIR=TaginfoConfig.get('logging.directory', '/osm/taginfo/var/log'); - + set :run, false set :environment, :production diff --git a/web/lib/api/test/langtag.rb b/web/lib/api/test/langtag.rb index 8fbc998..4268bd8 100644 --- a/web/lib/api/test/langtag.rb +++ b/web/lib/api/test/langtag.rb @@ -7,7 +7,7 @@ class Taginfo < Sinatra::Base :paging => :optional, :sort => %w( key count_all ), :result => { - :key => :STRING, + :key => :STRING, :count_all => :INT, :in_wiki => :BOOL, :prefix => :STRING, @@ -31,7 +31,7 @@ class Taginfo < Sinatra::Base condition("key LIKE '%name%'"). condition_if("key LIKE '%' || ? || '%'", params[:query]). get_first_value().to_i - + res = @db.select('SELECT * FROM db.keys'). condition("key LIKE '%name%'"). condition_if("key LIKE '%' || ? || '%'", params[:query]). @@ -66,7 +66,7 @@ class Taginfo < Sinatra::Base :region_state => nt.region_state, :region_note => nt.region_note, :notes => nt.notes - }} + }} }, json_opts(params[:format])) end @@ -117,7 +117,7 @@ class Taginfo < Sinatra::Base notes = '' if row['suppress_script'] notes += "Default script: #{ row['suppress_script'] }" - end + end unless row['prefix'].empty? notes += "Prefixes: #{ row['prefix'] }" end diff --git a/web/lib/api/v4/key.rb b/web/lib/api/v4/key.rb index c88092a..813af1d 100644 --- a/web/lib/api/v4/key.rb +++ b/web/lib/api/v4/key.rb @@ -45,7 +45,7 @@ class Taginfo < Sinatra::Base res = (params[:query].to_s != '' ? @db.select("SELECT p.key1 AS other_key, p.count_#{filter_type} AS together_count, k.count_#{filter_type} AS other_count, CAST(p.count_#{filter_type} AS REAL) / k.count_#{filter_type} AS from_fraction FROM db.key_combinations p, db.keys k WHERE p.key1=k.key AND p.key2=? AND (p.key1 LIKE ? ESCAPE '@') AND p.count_#{filter_type} > 0 UNION SELECT p.key2 AS other_key, p.count_#{filter_type} AS together_count, k.count_#{filter_type} AS other_count, CAST(p.count_#{filter_type} AS REAL) / k.count_#{filter_type} AS from_fraction FROM db.key_combinations p, db.keys k WHERE p.key2=k.key AND p.key1=? AND (p.key2 LIKE ? ESCAPE '@') AND p.count_#{filter_type} > 0", key, like_contains(params[:query]), key, like_contains(params[:query])) : - @db.select("SELECT p.key1 AS other_key, p.count_#{filter_type} AS together_count, k.count_#{filter_type} AS other_count, CAST(p.count_#{filter_type} AS REAL) / k.count_#{filter_type} AS from_fraction FROM db.key_combinations p, db.keys k WHERE p.key1=k.key AND p.key2=? AND p.count_#{filter_type} > 0 + @db.select("SELECT p.key1 AS other_key, p.count_#{filter_type} AS together_count, k.count_#{filter_type} AS other_count, CAST(p.count_#{filter_type} AS REAL) / k.count_#{filter_type} AS from_fraction FROM db.key_combinations p, db.keys k WHERE p.key1=k.key AND p.key2=? AND p.count_#{filter_type} > 0 UNION SELECT p.key2 AS other_key, p.count_#{filter_type} AS together_count, k.count_#{filter_type} AS other_count, CAST(p.count_#{filter_type} AS REAL) / k.count_#{filter_type} AS from_fraction FROM db.key_combinations p, db.keys k WHERE p.key2=k.key AND p.key1=? AND p.count_#{filter_type} > 0", key, key)). order_by(@ap.sortname, @ap.sortorder) { |o| o.together_count @@ -129,7 +129,7 @@ class Taginfo < Sinatra::Base }) do style = params[:style] key = params[:key] - + total = @db.count('josm_style_rules'). # condition('style = ?', style). condition('k = ?', key). diff --git a/web/lib/api/v4/keys.rb b/web/lib/api/v4/keys.rb index 723efe0..b183660 100644 --- a/web/lib/api/v4/keys.rb +++ b/web/lib/api/v4/keys.rb @@ -50,7 +50,7 @@ class Taginfo < Sinatra::Base condition_if("key LIKE ? ESCAPE '@'", like_contains(params[:query])). conditions(filters). get_first_value().to_i - + res = @db.select('SELECT * FROM db.keys'). condition_if("key LIKE ? ESCAPE '@'", like_contains(params[:query])). conditions(filters). @@ -137,7 +137,7 @@ class Taginfo < Sinatra::Base :users_all => row['users_all'].to_i, :in_wiki => row['in_wiki'].to_i == 1 ? true : false, :in_josm => false - } + } h[:wikipages] = row['wikipages'] if row['wikipages'] h[:prevalent_values] = row['prevalent_values'][0,10] if row['prevalent_values'] h } @@ -150,7 +150,7 @@ class Taginfo < Sinatra::Base :paging => :optional, :sort => %w( key ), :result => paging_results([ - [:key, :STRING, 'Key'], + [:key, :STRING, 'Key'], [:lang, :HASH, 'Hash with language codes as keys and values showing what type of wiki pages are available.'] ]), :example => { :page => 1, :rp => 10, :sortname => 'key', :sortorder => 'asc' }, @@ -225,7 +225,7 @@ class Taginfo < Sinatra::Base condition("in_wiki#{english} = 0"). condition_if("key LIKE ? ESCAPE '@'", like_contains(params[:query])). get_first_value().to_i - + res = @db.select('SELECT * FROM db.keys'). condition('count_all > ?', min_count). condition("in_wiki#{english} = 0"). diff --git a/web/lib/api/v4/project.rb b/web/lib/api/v4/project.rb index 50e1753..986f14b 100644 --- a/web/lib/api/v4/project.rb +++ b/web/lib/api/v4/project.rb @@ -27,7 +27,7 @@ class Taginfo < Sinatra::Base condition("project_id=?", project_id). condition_if("key LIKE ? ESCAPE '@' OR value LIKE ? ESCAPE '@'", q, q). get_first_value().to_i - + res = @db.select('SELECT * FROM projects.project_tags'). condition("project_id=?", project_id). condition_if("key LIKE ? ESCAPE '@' OR value LIKE ? ESCAPE '@'", q, q). diff --git a/web/lib/api/v4/site.rb b/web/lib/api/v4/site.rb index 6c7a24e..2b29f09 100644 --- a/web/lib/api/v4/site.rb +++ b/web/lib/api/v4/site.rb @@ -15,7 +15,7 @@ class Taginfo < Sinatra::Base }) do data = {} [:url, :name, :description, :icon, :contact, :area].each do |k| - data[k] = TaginfoConfig.get("instance.#{k}") + data[k] = TaginfoConfig.get("instance.#{k}") end return JSON.generate(data, json_opts(params[:format])) end diff --git a/web/lib/javascript.rb b/web/lib/javascript.rb index 9616445..ff9f178 100644 --- a/web/lib/javascript.rb +++ b/web/lib/javascript.rb @@ -59,7 +59,7 @@ class JQuery # "include" the convenience methods from R18n::Helpers. # Uses extend instead of include, because we want this # to work not with instances of JQuery but they should - # show up as JQuery class methods. + # show up as JQuery class methods. extend R18n::Helpers def self.flexigrid(id, options) diff --git a/web/lib/sql.rb b/web/lib/sql.rb index 39c1ff1..2845858 100644 --- a/web/lib/sql.rb +++ b/web/lib/sql.rb @@ -227,7 +227,7 @@ module SQL def to_s(direction) dir = @reverse ? @@DIRECTION[direction.upcase] : direction.upcase - "#{@column} #{dir}" + "#{@column} #{dir}" end end diff --git a/web/lib/ui/keys.rb b/web/lib/ui/keys.rb index 1d6747b..ec5210c 100644 --- a/web/lib/ui/keys.rb +++ b/web/lib/ui/keys.rb @@ -48,7 +48,7 @@ class Taginfo < Sinatra::Base @josm_count = @db.count('josm_style_rules').condition('k = ?', @key).get_first_i @wiki_count = @db.count('wiki.wikipages').condition('key=? AND value IS NULL', @key).get_first_i @user_count = @db.select('SELECT users_all FROM db.keys').condition('key=?', @key).get_first_i - + @img_width = TaginfoConfig.get('geodistribution.width') * TaginfoConfig.get('geodistribution.scale_image') @img_height = TaginfoConfig.get('geodistribution.height') * TaginfoConfig.get('geodistribution.scale_image') diff --git a/web/lib/ui/search.rb b/web/lib/ui/search.rb index 1c6a71c..8c72215 100644 --- a/web/lib/ui/search.rb +++ b/web/lib/ui/search.rb @@ -17,7 +17,7 @@ class Taginfo < Sinatra::Base # Return opensearch description (see www.opensearch.org) get '/search/opensearch.xml' do - content_type :opensearch + content_type :opensearch opensearch = <<END_XML <?xml version="1.0" encoding="UTF-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> diff --git a/web/lib/ui/taginfo.rb b/web/lib/ui/taginfo.rb index de7b07e..8c9e85a 100644 --- a/web/lib/ui/taginfo.rb +++ b/web/lib/ui/taginfo.rb @@ -28,7 +28,7 @@ class Taginfo < Sinatra::Base out += line.call(level, key, name, en[key], '<span style="color: red;">MISSING</span>') else out += line.call(level, key, name, en[key], other[key]) - end + end end end out @@ -98,10 +98,10 @@ class Taginfo < Sinatra::Base @i18n_lang = YAML.load_file("i18n/#{@lang}.yml") rescue @error = "Unknown language: #{@lang}" - end + end c = 'even' - @line = lambda { |level, key, name, en, other| + @line = lambda { |level, key, name, en, other| c = (c == '') ? 'even': '' "<tr><td class='#{c}' style='padding-left: #{ level * 16 + 6 }px;'><span title='#{ name }'>#{ key }</span></td><td class='#{c}'>#{ en }</td><td class='#{c}'>#{ other }</td></tr>" } diff --git a/web/public/css/taginfo.css b/web/public/css/taginfo.css index 797074f..bdce9b7 100644 --- a/web/public/css/taginfo.css +++ b/web/public/css/taginfo.css @@ -157,7 +157,7 @@ span.disabled { /* ========== */ -span.customSelect { +span.customSelect { margin: 0; padding: 1px 4px 0 4px; border:1px solid #a0a0a0; diff --git a/web/public/js/taginfo.js b/web/public/js/taginfo.js index 242ee62..5a06361 100644 --- a/web/public/js/taginfo.js +++ b/web/public/js/taginfo.js @@ -179,7 +179,7 @@ function link_to_key(key, attr) { function link_to_value(key, value, attr) { return link( - url_for_tag(key, value), + url_for_tag(key, value), fmt_value(value), attr ); @@ -477,7 +477,7 @@ function create_flexigrid(domid, options) { function init_tabs(params) { return jQuery('#tabs').tabs({ - activate: function (event, ui) { + activate: function (event, ui) { resize_box(); var index = ui.newTab.closest("li").index(); if (index != 0 || window.location.hash != '') { @@ -487,7 +487,7 @@ function init_tabs(params) { create_flexigrid_for[ui.newTab.context.hash.substring(1)].apply(this, params); } }, - create: function (event, ui) { + create: function (event, ui) { resize_box(); var index = jQuery(this).tabs("option", "selected"), id = jQuery(jQuery(this).children()[index+1]).attr('id'); diff --git a/web/views/embed/relation.erb b/web/views/embed/relation.erb index 233a0d9..51facfc 100644 --- a/web/views/embed/relation.erb +++ b/web/views/embed/relation.erb @@ -12,5 +12,5 @@ of type '<%= escape_html(@rtype) %>' with<br/> <b><%= @dbrtype['members_all'].to_i.to_s_with_ts %> members</b>.</p> <% unless @roles.empty? %> <p>Prevalent roles:<br/><%= @roles.join(', ') %></p> -<% end +<% end end %> diff --git a/web/viewsjs/key.js.erb b/web/viewsjs/key.js.erb index a8b99fa..165f91f 100644 --- a/web/viewsjs/key.js.erb +++ b/web/viewsjs/key.js.erb @@ -163,7 +163,7 @@ function create_chart(params) { var scale = d3.scale.linear() .domain([0, params.max]) .range([0, params.height]); - + var color = d3.scale.ordinal() .range(d3_colors()); diff --git a/web/viewsjs/reports/characters_in_keys.js.erb b/web/viewsjs/reports/characters_in_keys.js.erb index 72061d8..3dbc7c0 100644 --- a/web/viewsjs/reports/characters_in_keys.js.erb +++ b/web/viewsjs/reports/characters_in_keys.js.erb @@ -87,7 +87,7 @@ function page_init() { var scale = d3.scale.linear() .domain([0, max]) .range([0, w]); - + var chart = d3.select('#canvas').append('svg') .attr("width", w) .attr("height", h); diff --git a/web/viewsjs/search.js.erb b/web/viewsjs/search.js.erb index d09afd7..0dd3fdb 100644 --- a/web/viewsjs/search.js.erb +++ b/web/viewsjs/search.js.erb @@ -17,7 +17,7 @@ function link_to_key_with_highlight(key, query) { function link_to_value_with_highlight(key, value, query) { return link( - url_for_tag(key, value), + url_for_tag(key, value), highlight(value, query) ); } diff --git a/web/viewsjs/tag.js.erb b/web/viewsjs/tag.js.erb index 3626aa3..4cf5908 100644 --- a/web/viewsjs/tag.js.erb +++ b/web/viewsjs/tag.js.erb @@ -147,6 +147,6 @@ function page_init() { window.location.search = jQuery.param(qs); }); - + page_init2(); } |