From: Andy Allan Date: Wed, 19 Jun 2024 14:34:14 +0000 (+0100) Subject: Merge pull request #4813 from AntonKhorev/no-fst-italic X-Git-Tag: live~382 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/d57dd1f4da4d4605f534607b69944e3c977e4db5?hp=98ff2c0b9c28b7a039b55573540f85ea84eb9fca Merge pull request #4813 from AntonKhorev/no-fst-italic Use font size instead of italic for changeset/trace descriptions --- diff --git a/Gemfile b/Gemfile index 75387b5d5..5a21c7f7a 100644 --- a/Gemfile +++ b/Gemfile @@ -72,6 +72,7 @@ gem "validates_email_format_of", ">= 1.5.1" gem "quad_tile", "~> 1.0.1" # Sanitise URIs +gem "addressable", "~> 2.8" gem "rack-uri_sanitizer" # Omniauth for authentication @@ -116,9 +117,6 @@ gem "connection_pool" gem "dalli" gem "kgio" -# Load secure_headers for Content-Security-Policy support -gem "secure_headers" - # Load canonical-rails to generate canonical URLs gem "canonical-rails" diff --git a/Gemfile.lock b/Gemfile.lock index 95bebd649..28acf9135 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,35 +3,35 @@ GEM specs: aasm (5.5.0) concurrent-ruby (~> 1.0) - actioncable (7.1.3.3) - actionpack (= 7.1.3.3) - activesupport (= 7.1.3.3) + actioncable (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3.3) - actionpack (= 7.1.3.3) - activejob (= 7.1.3.3) - activerecord (= 7.1.3.3) - activestorage (= 7.1.3.3) - activesupport (= 7.1.3.3) + actionmailbox (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.3.3) - actionpack (= 7.1.3.3) - actionview (= 7.1.3.3) - activejob (= 7.1.3.3) - activesupport (= 7.1.3.3) + actionmailer (7.1.3.4) + actionpack (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.3.3) - actionview (= 7.1.3.3) - activesupport (= 7.1.3.3) + actionpack (7.1.3.4) + actionview (= 7.1.3.4) + activesupport (= 7.1.3.4) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -41,39 +41,39 @@ GEM rails-html-sanitizer (~> 1.6) actionpack-page_caching (1.2.4) actionpack (>= 4.0.0) - actiontext (7.1.3.3) - actionpack (= 7.1.3.3) - activerecord (= 7.1.3.3) - activestorage (= 7.1.3.3) - activesupport (= 7.1.3.3) + actiontext (7.1.3.4) + actionpack (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.3) - activesupport (= 7.1.3.3) + actionview (7.1.3.4) + activesupport (= 7.1.3.4) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) active_record_union (1.3.0) activerecord (>= 4.0) - activejob (7.1.3.3) - activesupport (= 7.1.3.3) + activejob (7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.3.6) - activemodel (7.1.3.3) - activesupport (= 7.1.3.3) - activerecord (7.1.3.3) - activemodel (= 7.1.3.3) - activesupport (= 7.1.3.3) + activemodel (7.1.3.4) + activesupport (= 7.1.3.4) + activerecord (7.1.3.4) + activemodel (= 7.1.3.4) + activesupport (= 7.1.3.4) timeout (>= 0.4.0) - activerecord-import (1.6.0) + activerecord-import (1.7.0) activerecord (>= 4.2) - activestorage (7.1.3.3) - actionpack (= 7.1.3.3) - activejob (= 7.1.3.3) - activerecord (= 7.1.3.3) - activesupport (= 7.1.3.3) + activestorage (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activesupport (= 7.1.3.4) marcel (~> 1.0) - activesupport (7.1.3.3) + activesupport (7.1.3.4) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -95,17 +95,17 @@ GEM autoprefixer-rails (10.4.16.0) execjs (~> 2) aws-eventstream (1.3.0) - aws-partitions (1.928.0) - aws-sdk-core (3.196.0) + aws-partitions (1.944.0) + aws-sdk-core (3.197.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.81.0) - aws-sdk-core (~> 3, >= 3.193.0) + aws-sdk-kms (1.85.0) + aws-sdk-core (~> 3, >= 3.197.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.150.0) - aws-sdk-core (~> 3, >= 3.194.0) + aws-sdk-s3 (1.152.3) + aws-sdk-core (~> 3, >= 3.197.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.8) aws-sigv4 (1.8.0) @@ -137,10 +137,10 @@ GEM racc brotli (0.5.0) browser (5.3.1) - builder (3.2.4) + builder (3.3.0) bzip2-ffi (1.1.1) ffi (~> 1.0) - cancancan (3.5.0) + cancancan (3.6.1) canonical-rails (0.2.15) actionview (>= 4.1, <= 7.2) capybara (3.40.0) @@ -152,8 +152,8 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - concurrent-ruby (1.2.3) - config (5.4.0) + concurrent-ruby (1.3.3) + config (5.5.1) deep_merge (~> 1.2, >= 1.2.1) connection_pool (2.4.1) crack (1.0.0) @@ -198,7 +198,7 @@ GEM concurrent-ruby (~> 1.0) dry-core (~> 1.0, < 2) zeitwerk (~> 2.6) - dry-schema (1.13.3) + dry-schema (1.13.4) concurrent-ruby (~> 1.0) dry-configurable (~> 1.0, >= 1.0.1) dry-core (~> 1.0, < 2) @@ -226,7 +226,7 @@ GEM rainbow rubocop smart_properties - erubi (1.12.0) + erubi (1.13.0) execjs (2.9.1) exifr (1.4.0) factory_bot (6.4.6) @@ -234,11 +234,11 @@ GEM factory_bot_rails (6.4.3) factory_bot (~> 6.4) railties (>= 5.0.0) - faraday (2.9.0) + faraday (2.9.2) faraday-net_http (>= 2.0, < 3.2) faraday-net_http (3.1.0) net-http - ffi (1.16.3) + ffi (1.17.0) ffi-compiler (1.3.2) ffi (>= 1.15.5) rake @@ -288,7 +288,7 @@ GEM image_size (3.4.0) in_threads (1.6.0) io-console (0.7.2) - irb (1.13.1) + irb (1.13.2) rdoc (>= 4.0.0) reline (>= 0.4.2) jbuilder (2.12.0) @@ -300,7 +300,7 @@ GEM railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (2.7.2) - jwt (2.8.1) + jwt (2.8.2) base64 kgio (2.11.4) kramdown (2.4.0) @@ -325,12 +325,12 @@ GEM marcel (1.0.4) matrix (0.4.2) maxminddb (0.1.22) - mini_magick (4.12.0) + mini_magick (4.13.1) mini_mime (1.1.5) - mini_portile2 (2.8.6) + mini_portile2 (2.8.7) mini_racer (0.9.0) libv8-node (~> 18.19.0.0) - minitest (5.23.0) + minitest (5.23.1) minitest-focus (1.4.0) minitest (>= 4, < 6) msgpack (1.7.2) @@ -339,7 +339,7 @@ GEM mutex_m (0.2.0) net-http (0.4.1) uri - net-imap (0.4.11) + net-imap (0.4.13) date net-protocol net-pop (0.1.2) @@ -349,7 +349,7 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.3) - nokogiri (1.16.5) + nokogiri (1.16.6) mini_portile2 (~> 2.8.2) racc (~> 1.4) oauth (0.4.7) @@ -369,8 +369,9 @@ GEM hashie (>= 3.4.6) rack (>= 1.6.2, < 3) rack-protection - omniauth-facebook (9.0.0) - omniauth-oauth2 (~> 1.2) + omniauth-facebook (10.0.0) + bigdecimal + omniauth-oauth2 (>= 1.2, < 3) omniauth-github (2.0.1) omniauth (~> 2.0) omniauth-oauth2 (~> 1.8) @@ -382,7 +383,7 @@ GEM omniauth-mediawiki (0.0.4) jwt (~> 2.0) omniauth-oauth (~> 1.0) - omniauth-microsoft_graph (2.0.0) + omniauth-microsoft_graph (2.0.1) jwt (~> 2.0) omniauth (~> 2.0) omniauth-oauth2 (~> 1.8.0) @@ -399,8 +400,8 @@ GEM actionpack (>= 4.2) omniauth (~> 2.0) openstreetmap-deadlock_retry (1.3.1) - parallel (1.24.0) - parser (3.3.1.0) + parallel (1.25.1) + parser (3.3.3.0) ast (~> 2.4.1) racc pg (1.5.6) @@ -408,11 +409,11 @@ GEM progress (3.6.0) psych (5.1.2) stringio - public_suffix (5.0.5) + public_suffix (5.1.1) puma (5.6.8) nio4r (~> 2.0) quad_tile (1.0.1) - racc (1.7.3) + racc (1.8.0) rack (2.2.9) rack-cors (2.0.2) rack (>= 2.0.0) @@ -430,20 +431,20 @@ GEM rackup (1.0.0) rack (< 3) webrick - rails (7.1.3.3) - actioncable (= 7.1.3.3) - actionmailbox (= 7.1.3.3) - actionmailer (= 7.1.3.3) - actionpack (= 7.1.3.3) - actiontext (= 7.1.3.3) - actionview (= 7.1.3.3) - activejob (= 7.1.3.3) - activemodel (= 7.1.3.3) - activerecord (= 7.1.3.3) - activestorage (= 7.1.3.3) - activesupport (= 7.1.3.3) + rails (7.1.3.4) + actioncable (= 7.1.3.4) + actionmailbox (= 7.1.3.4) + actionmailer (= 7.1.3.4) + actionpack (= 7.1.3.4) + actiontext (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activemodel (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) bundler (>= 1.15.0) - railties (= 7.1.3.3) + railties (= 7.1.3.4) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -461,9 +462,9 @@ GEM rails_param (1.3.1) actionpack (>= 3.2.0) activesupport (>= 3.2.0) - railties (7.1.3.3) - actionpack (= 7.1.3.3) - activesupport (= 7.1.3.3) + railties (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -472,22 +473,23 @@ GEM rainbow (3.1.1) rake (13.2.1) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) - rdoc (6.6.3.1) + rdoc (6.7.0) psych (>= 4.0.0) - regexp_parser (2.9.1) - reline (0.5.7) + regexp_parser (2.9.2) + reline (0.5.9) io-console (~> 0.5) request_store (1.7.0) rack (>= 1.4) - rexml (3.2.6) + rexml (3.3.0) + strscan rinku (2.0.6) rotp (6.3.0) - rouge (4.2.1) + rouge (4.3.0) rtlcss (0.2.1) mini_racer (>= 0.6.3) - rubocop (1.63.5) + rubocop (1.64.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -500,17 +502,17 @@ GEM unicode-display_width (>= 2.4.0, < 3.0) rubocop-ast (1.31.3) parser (>= 3.3.1.0) - rubocop-capybara (2.20.0) - rubocop (~> 1.41) - rubocop-factory_bot (2.25.1) + rubocop-capybara (2.21.0) rubocop (~> 1.41) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) rubocop-minitest (0.35.0) rubocop (>= 1.61, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-performance (1.21.0) + rubocop-performance (1.21.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rails (2.24.1) + rubocop-rails (2.25.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) @@ -522,14 +524,13 @@ GEM ruby-vips (2.2.1) ffi (~> 1.12) rubyzip (2.3.2) - sanitize (6.1.0) + sanitize (6.1.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) sass-embedded (1.64.2) google-protobuf (~> 3.23) rake (>= 13.0.0) - secure_headers (6.5.0) - selenium-webdriver (4.20.1) + selenium-webdriver (4.21.1) base64 (~> 0.2) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) @@ -541,8 +542,7 @@ GEM simplecov-html (0.12.3) simplecov-lcov (0.8.0) simplecov_json_formatter (0.1.4) - simpleidn (0.2.2) - unf (~> 0.1.4) + simpleidn (0.2.3) smart_properties (1.17.0) snaky_hash (2.0.1) hashie @@ -553,16 +553,17 @@ GEM sprockets-exporters_pack (0.1.2) brotli (>= 0.2.0) sprockets (>= 4.0.0.beta3) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + sprockets-rails (3.5.1) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) - stringio (3.1.0) + stringio (3.1.1) strong_migrations (1.8.0) activerecord (>= 5.2) + strscan (3.1.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - terser (1.2.2) + terser (1.2.3) execjs (>= 0.3.0, < 3) thor (1.3.1) tilt (2.3.0) @@ -573,9 +574,6 @@ GEM railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.9.1) unicode-display_width (2.5.0) uri (0.13.0) validates_email_format_of (1.8.2) @@ -583,7 +581,7 @@ GEM simpleidn vendorer (0.2.0) version_gem (1.1.4) - webmock (3.23.0) + webmock (3.23.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -594,7 +592,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.14) + zeitwerk (2.6.16) PLATFORMS ruby @@ -604,6 +602,7 @@ DEPENDENCIES actionpack-page_caching (>= 1.2.0) active_record_union activerecord-import + addressable (~> 2.8) annotate argon2 autoprefixer-rails @@ -688,7 +687,6 @@ DEPENDENCIES rubocop-rake sanitize sass-embedded (~> 1.64.0) - secure_headers selenium-webdriver simplecov simplecov-lcov diff --git a/README.md b/README.md index eba23a360..e7e9bd259 100644 --- a/README.md +++ b/README.md @@ -45,3 +45,4 @@ More details on contributing to the code are in the [CONTRIBUTING.md](CONTRIBUTI * Tom Hughes [@tomhughes](https://github.com/tomhughes/) * Andy Allan [@gravitystorm](https://github.com/gravitystorm/) +* Anton Khorev [@AntonKhorev](https://github.com/AntonKhorev/) diff --git a/app/abilities/ability.rb b/app/abilities/ability.rb index 3aba63c33..c0b2f3982 100644 --- a/app/abilities/ability.rb +++ b/app/abilities/ability.rb @@ -18,7 +18,8 @@ class Ability can [:index, :feed, :show], Changeset can :index, ChangesetComment can [:confirm, :confirm_resend, :confirm_email], :confirmation - can [:index, :rss, :show, :comments], DiaryEntry + can [:index, :rss, :show], DiaryEntry + can :index, DiaryComment can [:index], Note can [:new, :create, :edit, :update], :password can [:index, :show], Redaction @@ -53,7 +54,7 @@ class Ability can [:index, :create, :destroy], UserMute if user.moderator? - can [:hide, :unhide, :hidecomment, :unhidecomment], DiaryEntry + can [:hide, :unhide], [DiaryEntry, DiaryComment] can [:index, :show, :resolve, :ignore, :reopen], Issue can :create, IssueComment can [:new, :create, :edit, :update, :destroy], Redaction @@ -61,7 +62,7 @@ class Ability end if user.administrator? - can [:hide, :unhide, :hidecomment, :unhidecomment], DiaryEntry + can [:hide, :unhide], [DiaryEntry, DiaryComment] can [:index, :show, :resolve, :ignore, :reopen], Issue can :create, IssueComment can [:set_status, :destroy, :index], User diff --git a/app/assets/images/about/sprite.png b/app/assets/images/about/sprite.png deleted file mode 100644 index fa0ce2986..000000000 Binary files a/app/assets/images/about/sprite.png and /dev/null differ diff --git a/app/assets/images/about/sprite.svg b/app/assets/images/about/sprite.svg deleted file mode 100644 index 01a80ae16..000000000 --- a/app/assets/images/about/sprite.svg +++ /dev/null @@ -1,388 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/assets/images/about/sprite@2x.png b/app/assets/images/about/sprite@2x.png deleted file mode 100644 index 7560c8773..000000000 Binary files a/app/assets/images/about/sprite@2x.png and /dev/null differ diff --git a/app/assets/images/banners/StateoftheMapEurope_2023.png b/app/assets/images/banners/StateoftheMapEurope_2023.png deleted file mode 100644 index 33e9db907..000000000 Binary files a/app/assets/images/banners/StateoftheMapEurope_2023.png and /dev/null differ diff --git a/app/assets/images/banners/StateoftheMapEurope_2024.png b/app/assets/images/banners/StateoftheMapEurope_2024.png new file mode 100644 index 000000000..d0d1cee62 Binary files /dev/null and b/app/assets/images/banners/StateoftheMapEurope_2024.png differ diff --git a/app/assets/images/directions.png b/app/assets/images/directions.png deleted file mode 100644 index 197244f4a..000000000 Binary files a/app/assets/images/directions.png and /dev/null differ diff --git a/app/assets/images/openid.svg b/app/assets/images/openid.svg new file mode 100644 index 000000000..d4de5897b --- /dev/null +++ b/app/assets/images/openid.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/app/assets/images/openid_small.png b/app/assets/images/openid_small.png deleted file mode 100644 index 41adc9fa6..000000000 Binary files a/app/assets/images/openid_small.png and /dev/null differ diff --git a/app/assets/images/routing-sprite.svg b/app/assets/images/routing-sprite.svg index e03a1bb84..97701d5a8 100644 --- a/app/assets/images/routing-sprite.svg +++ b/app/assets/images/routing-sprite.svg @@ -1,37 +1,55 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/images/welcome-sprite.svg b/app/assets/images/welcome-sprite.svg deleted file mode 100644 index 5381a2542..000000000 --- a/app/assets/images/welcome-sprite.svg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 20976d15a..054742126 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -106,6 +106,7 @@ $(document).ready(function () { $("body").removeClass("compact-nav"); $("header").removeClass("text-nowrap"); + $("header nav.secondary > ul").removeClass("flex-nowrap"); updateHeader(); diff --git a/app/assets/javascripts/index/browse.js b/app/assets/javascripts/index/browse.js index 69d625eca..7a761b500 100644 --- a/app/assets/javascripts/index/browse.js +++ b/app/assets/javascripts/index/browse.js @@ -58,7 +58,7 @@ OSM.initializeBrowse = function (map) { .click(cancel))), $("

") .text(I18n.t("browse.start_rjs.feature_warning", { num_features: count, max_features: limit })), - $("") + $("") .val(I18n.t("browse.start_rjs.load_data")) .click(add))); } diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 42854f2e2..ae01cb566 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -3,7 +3,6 @@ //= require qs/dist/qs OSM.Directions = function (map) { - var awaitingGeocode; // true if the user has requested a route, but we're waiting on a geocode result var awaitingRoute; // true if we've asked the engine for a route and are waiting to hear back var chosenEngine; @@ -21,9 +20,18 @@ OSM.Directions = function (map) { weight: 12 }); + var endpointDragCallback = function (dragging) { + if (map.hasLayer(polyline)) { + getRoute(false, !dragging); + } + }; + var endpointGeocodeCallback = function () { + getRoute(true, true); + }; + var endpoints = [ - Endpoint($("input[name='route_from']"), OSM.MARKER_GREEN), - Endpoint($("input[name='route_to']"), OSM.MARKER_RED) + Endpoint($("input[name='route_from']"), OSM.MARKER_GREEN, endpointDragCallback, endpointGeocodeCallback), + Endpoint($("input[name='route_to']"), OSM.MARKER_RED, endpointDragCallback, endpointGeocodeCallback) ]; var expiry = new Date(); @@ -43,7 +51,7 @@ OSM.Directions = function (map) { select.append(""); }); - function Endpoint(input, iconUrl) { + function Endpoint(input, iconUrl, dragCallback, geocodeCallback) { var endpoint = {}; endpoint.marker = L.marker([0, 0], { @@ -64,18 +72,14 @@ OSM.Directions = function (map) { if (dragging && !chosenEngine.draggable) return; if (dragging && awaitingRoute) return; endpoint.setLatLng(e.target.getLatLng()); - if (map.hasLayer(polyline)) { - getRoute(false, !dragging); - } + dragCallback(dragging); }); input.on("keydown", function () { - input.removeClass("error"); + input.removeClass("is-invalid"); }); input.on("change", function (e) { - awaitingGeocode = true; - // make text the same in both text boxes var value = e.target.value; endpoint.setValue(value); @@ -84,7 +88,7 @@ OSM.Directions = function (map) { endpoint.setValue = function (value, latlng) { endpoint.value = value; delete endpoint.latlng; - input.removeClass("error"); + input.removeClass("is-invalid"); input.val(value); if (latlng) { @@ -109,7 +113,7 @@ OSM.Directions = function (map) { endpoint.awaitingGeocode = false; endpoint.hasGeocode = true; if (json.length === 0) { - input.addClass("error"); + input.addClass("is-invalid"); alert(I18n.t("javascripts.directions.errors.no_place", { place: endpoint.value })); return; } @@ -118,10 +122,7 @@ OSM.Directions = function (map) { input.val(json[0].display_name); - if (awaitingGeocode) { - awaitingGeocode = false; - getRoute(true, true); - } + geocodeCallback(); }); }; @@ -209,11 +210,9 @@ OSM.Directions = function (map) { var endpoint = endpoints[ep_i]; if (!endpoint.hasGeocode && !endpoint.awaitingGeocode) { endpoint.getGeocode(); - awaitingGeocode = true; } } if (endpoints[0].awaitingGeocode || endpoints[1].awaitingGeocode) { - awaitingGeocode = true; return; } @@ -307,7 +306,7 @@ OSM.Directions = function (map) { var row = $(""); row.append("

"); row.append("" + instruction); - row.append("" + dist); + row.append("" + dist); row.on("click", function () { popup @@ -357,7 +356,7 @@ OSM.Directions = function (map) { getRoute(true, true); }); - $(".routing_marker").on("dragstart", function (e) { + $(".routing_marker_column img").on("dragstart", function (e) { var dt = e.originalEvent.dataTransfer; dt.effectAllowed = "move"; var dragData = { type: $(this).data("type") }; diff --git a/app/assets/javascripts/index/directions/fossgis_valhalla.js b/app/assets/javascripts/index/directions/fossgis_valhalla.js index d44dbd12b..619f8f1e3 100644 --- a/app/assets/javascripts/index/directions/fossgis_valhalla.js +++ b/app/assets/javascripts/index/directions/fossgis_valhalla.js @@ -27,7 +27,7 @@ function FOSSGISValhallaEngine(id, costing) { 5, // kStayLeft = 24; 20, // kMerge = 25; 10, // kRoundaboutEnter = 26; - 11, // kRoundaboutExit = 27; + 10, // kRoundaboutExit = 27; 17, // kFerryEnter = 28; 0, // kFerryExit = 29; null, // kTransit = 30; diff --git a/app/assets/javascripts/index/directions/graphhopper.js b/app/assets/javascripts/index/directions/graphhopper.js index 11d600316..e72f6d75f 100644 --- a/app/assets/javascripts/index/directions/graphhopper.js +++ b/app/assets/javascripts/index/directions/graphhopper.js @@ -9,7 +9,12 @@ function GraphHopperEngine(id, vehicleType) { "3": 3, // sharp right "4": 14, // finish reached "5": 14, // via reached - "6": 10 // roundabout + "6": 10, // roundabout + "-7": 19, // keep left + "7": 18, // keep right + "-98": 4, // unknown direction u-turn + "-8": 4, // left u-turn + "8": 4 // right u-turn }; return { diff --git a/app/assets/javascripts/index/note.js b/app/assets/javascripts/index/note.js index 15fedb1d1..3839d2715 100644 --- a/app/assets/javascripts/index/note.js +++ b/app/assets/javascripts/index/note.js @@ -36,12 +36,12 @@ OSM.Note = function (map) { }; function initialize(path, id, callback) { - content.find("input[type=submit]").on("click", function (e) { + content.find("button[type=submit]").on("click", function (e) { e.preventDefault(); var data = $(e.target).data(); var form = e.target.form; - $(form).find("input[type=submit]").prop("disabled", true); + $(form).find("button[type=submit]").prop("disabled", true); $.ajax({ url: data.url, @@ -83,12 +83,12 @@ OSM.Note = function (map) { } function updateButtons(form) { - $(form).find("input[type=submit]").prop("disabled", false); + $(form).find("button[type=submit]").prop("disabled", false); if ($(form.text).val() === "") { - $(form.close).val($(form.close).data("defaultActionText")); + $(form.close).text($(form.close).data("defaultActionText")); $(form.comment).prop("disabled", true); } else { - $(form.close).val($(form.close).data("commentActionText")); + $(form.close).text($(form.close).data("commentActionText")); $(form.comment).prop("disabled", false); } } diff --git a/app/assets/javascripts/index/search.js b/app/assets/javascripts/index/search.js index d41fc7d53..94bb52a1b 100644 --- a/app/assets/javascripts/index/search.js +++ b/app/assets/javascripts/index/search.js @@ -9,9 +9,9 @@ OSM.Search = function (map) { } }); - $(".search_form a.button.switch_link").on("click", function (e) { + $(".search_form a.btn.switch_link").on("click", function (e) { e.preventDefault(); - var query = $(e.target).parent().parent().find("input[name=query]").val(); + var query = $(this).closest("form").find("input[name=query]").val(); if (query) { OSM.router.route("/directions?from=" + encodeURIComponent(query) + OSM.formatHash(map)); } else { diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js index 1a34b05c2..55d492b29 100644 --- a/app/assets/javascripts/leaflet.layers.js +++ b/app/assets/javascripts/leaflet.layers.js @@ -84,7 +84,7 @@ L.OSM.layers = function (options) { $("

") .text(I18n.t("javascripts.map.layers.overlays")) - .attr("class", "text-muted") + .attr("class", "text-body-secondary small mb-2") .appendTo(overlaySection); var overlays = $("

-

+

<% if trace.tags.empty? %> <%= t ".details_without_tags_html", :time_ago => friendly_date_ago(trace.timestamp), :user => link_to(trace.user.display_name, trace.user) %> diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index a2a068360..b618f3811 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -7,13 +7,13 @@ <% content_for :heading do %> <% if @client_app_name %> -

<%= t(".signup_to_authorize_html", :client_app_name => @client_app_name) %>

+

<%= t(".signup_to_authorize_html", :client_app_name => @client_app_name) %>

<% end %>
-