From 33a6b79bd78f1903011367f6a5adf2f91d160f74 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 16 Jul 2013 15:59:09 -0700 Subject: [PATCH 001/270] Add help page --- app/assets/stylesheets/common.css.scss | 43 +++++++++++++++++++++++++- app/controllers/site_controller.rb | 3 ++ app/views/layouts/site.html.erb | 10 ++---- app/views/site/help.html.erb | 12 +++++++ config/locales/en.yml | 31 +++++++++++++------ config/routes.rb | 1 + 6 files changed, 83 insertions(+), 17 deletions(-) create mode 100644 app/views/site/help.html.erb diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index 42467adb3a..c9b7046f97 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -1108,7 +1108,8 @@ ul.results-list li { border-bottom: 1px solid #ccc; } .user-terms, .user-confirm, .site-copyright, -.site-welcome { +.site-welcome, +.site-help { #content { max-width: 740px; } @@ -2559,3 +2560,43 @@ a.button { border-radius: 4px; } } + +.site-help { + #content { + a { + display: inline-block; + width: 45%; + height: 200px; + float: left; + text-align: center; + color: #000; + margin: 10px; + padding: 10px; + border-radius: 10px; + } + + h3 { + margin-top: 50px; + } + + a:hover { + text-decoration: none; + } + + .welcome { + background-color: #D6FFB9; + } + + .learnosm { + background-color: #BAFCFF; + } + + .help { + background-color: #FCFFB9; + } + + .wiki { + background-color: #FFB9CC; + } + } +} diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 280f39fd8c..4945aaa4ff 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -71,6 +71,9 @@ def copyright def welcome end + def help + end + def preview render :text => RichText.new(params[:format], params[:text]).to_html end diff --git a/app/views/layouts/site.html.erb b/app/views/layouts/site.html.erb index ed8a6cf188..4612572077 100644 --- a/app/views/layouts/site.html.erb +++ b/app/views/layouts/site.html.erb @@ -39,13 +39,6 @@ <% end %> <% if @user %> <%= render :partial => "layouts/user_menu" %> diff --git a/app/views/site/about.html.erb b/app/views/site/about.html.erb new file mode 100644 index 0000000000..59d0db062d --- /dev/null +++ b/app/views/site/about.html.erb @@ -0,0 +1,43 @@ +<% content_for :head do %> + <%= javascript_include_tag "about" %> +<% end %> + +
+
+
+ <%= t "about_page.copyright_html" %> +
+ +
+ + + <%= raw t "about_page.used_by", :name => "OpenStreetMap" %> + +
+ +
+
+

<%= t "about_page.lede_text" %>

+

<%= t "about_page.local_knowledge_title" %>

+

<%= t "about_page.local_knowledge_html" %>

+
+ +
+

<%= t "about_page.community_driven_title" %>

+

<%= t "about_page.community_driven_html", :diary_path => diary_path %>

+
+ +
+

<%= t "about_page.open_data_title" %>

+

<%= t "about_page.open_data_html", :copyright_path => copyright_path %>

+
+
+
+ +<% 5.times do |i| %> +
+ <%= t "about_page.photo_caption_#{i}_html" %> +
+<% end %> + +
diff --git a/config/locales/en.yml b/config/locales/en.yml index 06e6442ff1..af3951edc7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1190,6 +1190,53 @@ en: url: http://wiki.openstreetmap.org/ title: wiki.openstreetmap.org description: Browse the wiki for in-depth OSM documentation. + about_page: + next: Next + copyright_html: ©OpenStreetMap
contributors + used_by: "%{name} powers map data on hundreds of web sites, mobile apps, and hardware devices" + lede_text: | + OSM is built by a community of local mappers that keeps data about + roads, cafés, subway stations, and much more up to date every day. + local_knowledge_title: Local Knowledge + local_knowledge_html: | + OpenStreetMap emphasizes local knowledge. Contributors use + aerial imagery, GPS devices, and low-tech field maps to verify that OSM + is up to date and accurate. + community_driven_title: Community Driven + community_driven_html: | + From the engineers that tune OSM's servers to the Humanitarian OSM Team + that maps disaster-affected areas, OSM's community is diverse, + passionate, and growing every day. To learn more about the community, + see the user diaries, + community blogs, and + the OSM Foundation website. + open_data_title: Open Data + open_data_html: | + OpenStreetMap is open data: you are free to use it for any purpose + as long as you credit OpenStreetMap and its contributors. If you alter or + build upon the data in certain ways, you may distribute the result only + under the same licence. See the Copyright and + License page for details. + photo_caption_0_html: | + @mikel working on + Map Kibera, a project to map the + largest slum in Nairobi, Kenya. + © watato + 2010 + photo_caption_1_html: | + @lxbarth and + @limareis survey Brasilia with + walking papers. + © mapbox + 2012 + photo_caption_2_html: | + @TODO caption (source) + photo_caption_3_html: | + @TODO caption (source) + photo_caption_4_html: | + @TODO caption (source) + photo_caption_5_html: | + @TODO caption (source) notifier: diary_comment_notification: subject: "[OpenStreetMap] %{user} commented on your diary entry" diff --git a/config/routes.rb b/config/routes.rb index a1321d7f25..1e0f508a1a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -127,6 +127,7 @@ match '/copyright' => 'site#copyright', :via => :get match '/welcome' => 'site#welcome', :via => :get, :as => :welcome match '/help' => 'site#help', :via => :get, :as => :help + match '/about' => 'site#about', :via => :get, :as => :about match '/history' => 'changeset#list', :via => :get match '/history/feed' => 'changeset#feed', :via => :get, :defaults => { :format => :atom } match '/export' => 'site#export', :via => :get From a8b68a751e91342c360962ae137bc6c958104bb5 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 1 Oct 2013 16:33:43 -0700 Subject: [PATCH 019/270] Inline edit menu partial, refine CSS --- app/assets/stylesheets/common.css.scss | 8 ++++---- app/views/layouts/_edit_menu.html.erb | 19 ------------------- app/views/layouts/_header.html.erb | 18 +++++++++++++++--- 3 files changed, 19 insertions(+), 26 deletions(-) delete mode 100644 app/views/layouts/_edit_menu.html.erb diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index 7395afc998..6bdec29889 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -351,11 +351,11 @@ nav.primary { } .dropdown-toggle { - padding: 5px 10px 5px 5px; + display: inline-block; + padding: 6px 10px 4px 10px; } .caret { - margin-top: 15px; border-top-color: $green; } @@ -2225,7 +2225,7 @@ a.button { .dropdown-submenu:focus > a { color: #ffffff; text-decoration: none; - background-color: #0081c2; + background-color: $green; } .dropdown-menu > .active > a, @@ -2233,7 +2233,7 @@ a.button { .dropdown-menu > .active > a:focus { color: #ffffff; text-decoration: none; - background-color: #0081c2; + background-color: $green; outline: 0; } diff --git a/app/views/layouts/_edit_menu.html.erb b/app/views/layouts/_edit_menu.html.erb deleted file mode 100644 index b7d9d7fdfe..0000000000 --- a/app/views/layouts/_edit_menu.html.erb +++ /dev/null @@ -1,19 +0,0 @@ - diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 58185bb5ad..1edbf7e5cb 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -11,9 +11,21 @@ <%= link_to t('layouts.history'), browse_changesets_path, :class => 'tab geolink llz' %>
  • <%= link_to t('layouts.export'), export_path, :class => 'tab geolink llz' %> -
  • - <%= render :partial => 'layouts/edit_menu', - :locals => { :link_text => t('layouts.edit'), :link_class => 'llz object' }%> +
  • From d359cd70f1527b372b71c2f927e3f45fb0fcf509 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 1 Oct 2013 17:06:28 -0700 Subject: [PATCH 020/270] Refine user menu CSS --- app/assets/stylesheets/common.css.scss | 39 +++++++++++++++----------- app/views/layouts/_inbox.html.erb | 4 +-- app/views/layouts/_user_menu.html.erb | 5 ++-- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index 6bdec29889..dc8c12b707 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -392,11 +392,17 @@ nav.secondary { position: absolute; right: 0; - > ul a { + > ul { + margin-right: 10px; + } + + > ul a, + .dropdown-toggle { + display: inline-block; font-weight: bold; text-decoration: none; color: $darkgrey; - padding-right: 10px; + padding: 5px 5px; } .dropdown { @@ -404,27 +410,26 @@ nav.secondary { border-radius: 4px; } - img { + .caret { + border-top-color: $grey; + margin-top: 10px; + margin-right: 5px; + } + + img.user_thumbnail_tiny { + border: 0; vertical-align: top; + margin: 2px 0 0 3px; border-radius: 2px 0 0 2px; - margin-right: 5px; } #inboxanchor { display: inline-block; - position: relative; + vertical-align: top; height: 20px; - top: -2px; - margin: 0 2px 0 0; - padding: 0 5px 0 0; - border-radius: 2px; - } - - .dropdown-toggle { - display: block; - padding: 3px 7px; - color: #000; - text-decoration: none; + margin: 2px 7px 0 0; + background-color: $grey; + border-radius: 0 2px 2px 0; } .dropdown-menu { @@ -713,7 +718,7 @@ nav.secondary { } .leaflet-top.leaflet-right { - top: 10px !important; + top: $lineheight !important; .leaflet-control { margin-right: 0px !important; margin-top: 0px !important; diff --git a/app/views/layouts/_inbox.html.erb b/app/views/layouts/_inbox.html.erb index d4054dfaf0..fbebe3fc19 100644 --- a/app/views/layouts/_inbox.html.erb +++ b/app/views/layouts/_inbox.html.erb @@ -1,3 +1 @@ - - <%= user_thumbnail_tiny(@user, :size => 20, :width => 20, :height => 20) %><%= @user.new_messages.size %> - \ No newline at end of file +<%= @user.new_messages.size %> \ No newline at end of file diff --git a/app/views/layouts/_user_menu.html.erb b/app/views/layouts/_user_menu.html.erb index 3b45ade304..a2b09cc806 100644 --- a/app/views/layouts/_user_menu.html.erb +++ b/app/views/layouts/_user_menu.html.erb @@ -1,7 +1,8 @@ + + From c65ec5c21f13ebc096400a07abdeaf317acbcef5 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 15 Nov 2013 10:37:27 -0800 Subject: [PATCH 209/270] Use html5shiv for IE8 compatibility --- Vendorfile | 4 + app/views/layouts/_head.html.erb | 1 + config/environments/production.rb | 1 + vendor/assets/javascripts/html5shiv.js | 301 +++++++++++++++++++++++++ 4 files changed, 307 insertions(+) create mode 100644 vendor/assets/javascripts/html5shiv.js diff --git a/Vendorfile b/Vendorfile index ec3ea6a141..136b47f728 100644 --- a/Vendorfile +++ b/Vendorfile @@ -50,4 +50,8 @@ folder 'vendor/assets' do file 'iD.js', 'dist/iD.js' end end + + folder 'javascripts' do + file 'html5shiv.js', 'https://raw.github.com/aFarkas/html5shiv/master/src/html5shiv.js' + end end diff --git a/app/views/layouts/_head.html.erb b/app/views/layouts/_head.html.erb index a1f11f7005..46fe40f042 100644 --- a/app/views/layouts/_head.html.erb +++ b/app/views/layouts/_head.html.erb @@ -1,5 +1,6 @@ + <%= javascript_include_tag "application" %> <%= stylesheet_link_tag "small-#{dir}", :media => "only screen and (max-width:721px)" %> diff --git a/config/environments/production.rb b/config/environments/production.rb index 3eb08ac6c6..bbc06aac5a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -75,6 +75,7 @@ config.assets.precompile += %w( large-rtl.css small-rtl.css print-rtl.css ) config.assets.precompile += %w( leaflet-all.css leaflet.ie.css ) config.assets.precompile += %w( embed.js embed.css ) + config.assets.precompile += %w( html5shiv.js ) config.assets.precompile += %w( images/marker-*.png img/*-handle.png ) config.assets.precompile += %w( potlatch2.swf ) config.assets.precompile += %w( potlatch2/assets.zip ) diff --git a/vendor/assets/javascripts/html5shiv.js b/vendor/assets/javascripts/html5shiv.js new file mode 100644 index 0000000000..94324d7c85 --- /dev/null +++ b/vendor/assets/javascripts/html5shiv.js @@ -0,0 +1,301 @@ +/** +* @preserve HTML5 Shiv prev3.7.1 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +;(function(window, document) { +/*jshint evil:true */ + /** version */ + var version = '3.7.0'; + + /** Preset options */ + var options = window.html5 || {}; + + /** Used to skip problem elements */ + var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; + + /** Not all elements can be cloned in IE **/ + var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; + + /** Detect whether the browser supports default html5 styles */ + var supportsHtml5Styles; + + /** Name of the expando, to work with multiple documents or to re-shiv one document */ + var expando = '_html5shiv'; + + /** The id for the the documents expando */ + var expanID = 0; + + /** Cached data for each document */ + var expandoData = {}; + + /** Detect whether the browser supports unknown elements */ + var supportsUnknownElements; + + (function() { + try { + var a = document.createElement('a'); + a.innerHTML = ''; + //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles + supportsHtml5Styles = ('hidden' in a); + + supportsUnknownElements = a.childNodes.length == 1 || (function() { + // assign a false positive if unable to shiv + (document.createElement)('a'); + var frag = document.createDocumentFragment(); + return ( + typeof frag.cloneNode == 'undefined' || + typeof frag.createDocumentFragment == 'undefined' || + typeof frag.createElement == 'undefined' + ); + }()); + } catch(e) { + // assign a false positive if detection fails => unable to shiv + supportsHtml5Styles = true; + supportsUnknownElements = true; + } + + }()); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a style sheet with the given CSS text and adds it to the document. + * @private + * @param {Document} ownerDocument The document. + * @param {String} cssText The CSS text. + * @returns {StyleSheet} The style element. + */ + function addStyleSheet(ownerDocument, cssText) { + var p = ownerDocument.createElement('p'), + parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; + + p.innerHTML = 'x'; + return parent.insertBefore(p.lastChild, parent.firstChild); + } + + /** + * Returns the value of `html5.elements` as an array. + * @private + * @returns {Array} An array of shived element node names. + */ + function getElements() { + var elements = html5.elements; + return typeof elements == 'string' ? elements.split(' ') : elements; + } + + /** + * Returns the data associated to the given document + * @private + * @param {Document} ownerDocument The document. + * @returns {Object} An object of data. + */ + function getExpandoData(ownerDocument) { + var data = expandoData[ownerDocument[expando]]; + if (!data) { + data = {}; + expanID++; + ownerDocument[expando] = expanID; + expandoData[expanID] = data; + } + return data; + } + + /** + * returns a shived element for the given nodeName and document + * @memberOf html5 + * @param {String} nodeName name of the element + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived element. + */ + function createElement(nodeName, ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createElement(nodeName); + } + if (!data) { + data = getExpandoData(ownerDocument); + } + var node; + + if (data.cache[nodeName]) { + node = data.cache[nodeName].cloneNode(); + } else if (saveClones.test(nodeName)) { + node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); + } else { + node = data.createElem(nodeName); + } + + // Avoid adding some elements to fragments in IE < 9 because + // * Attributes like `name` or `type` cannot be set/changed once an element + // is inserted into a document/fragment + // * Link elements with `src` attributes that are inaccessible, as with + // a 403 response, will cause the tab/window to crash + // * Script elements appended to fragments will execute when their `src` + // or `text` property is set + return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; + } + + /** + * returns a shived DocumentFragment for the given document + * @memberOf html5 + * @param {Document} ownerDocument The context document. + * @returns {Object} The shived DocumentFragment. + */ + function createDocumentFragment(ownerDocument, data){ + if (!ownerDocument) { + ownerDocument = document; + } + if(supportsUnknownElements){ + return ownerDocument.createDocumentFragment(); + } + data = data || getExpandoData(ownerDocument); + var clone = data.frag.cloneNode(), + i = 0, + elems = getElements(), + l = elems.length; + for(;i Date: Fri, 15 Nov 2013 18:51:09 +0000 Subject: [PATCH 210/270] Use

    for the title of site#welcome to match other pages --- app/views/site/welcome.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/site/welcome.html.erb b/app/views/site/welcome.html.erb index 60c2a3c302..4edcf361eb 100644 --- a/app/views/site/welcome.html.erb +++ b/app/views/site/welcome.html.erb @@ -3,7 +3,7 @@ <% end %> <% content_for :heading do %> -

    <%= t "welcome_page.title" %>

    +

    <%= t "welcome_page.title" %>

    <% end %>

    <%= t "welcome_page.introduction_html" %>

    From b78de4b8b28b737f20d770255bc617eb2f9e2109 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 15 Nov 2013 19:01:33 +0000 Subject: [PATCH 211/270] Make the link from site#help to site#welcome use a relative URL --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 4ce5b721d0..7ee23f2f87 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1074,7 +1074,7 @@ en: OpenStreetMap has several resources for learning about the project, asking and answering questions, and collaboratively discussing and documenting mapping topics. welcome: - url: http://www.openstreetmap.org/welcome + url: /welcome title: Welcome to OSM description: Start with this quick guide covering the OpenStreetMap basics. help: From da67b49a7c2e39e23ae71c71ae54562b8a7a5d50 Mon Sep 17 00:00:00 2001 From: Aaron Lidman Date: Fri, 15 Nov 2013 11:13:16 -0800 Subject: [PATCH 212/270] Hide welcome section on help page if not logged in closes #67 --- app/views/site/help.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/site/help.html.erb b/app/views/site/help.html.erb index 412dfc7f65..a1b1adb922 100644 --- a/app/views/site/help.html.erb +++ b/app/views/site/help.html.erb @@ -5,6 +5,7 @@

    <%= t "help_page.introduction" %>

    <% ['welcome', 'help', 'wiki'].each do |site| %> + <% unless site == 'welcome' && !@user %>
    -<% end %> \ No newline at end of file + <% end %> +<% end %> From 4fe6da58a0f3401045866f92893c3222067715f6 Mon Sep 17 00:00:00 2001 From: Aaron Lidman Date: Fri, 15 Nov 2013 11:26:36 -0800 Subject: [PATCH 213/270] Hide control tooltips on #map-ui expansion, closes #55 --- app/assets/javascripts/leaflet.key.js | 1 + app/assets/javascripts/leaflet.layers.js | 1 + app/assets/javascripts/leaflet.share.js | 1 + 3 files changed, 3 insertions(+) diff --git a/app/assets/javascripts/leaflet.key.js b/app/assets/javascripts/leaflet.key.js index ea236a569e..58bfbf6d2a 100644 --- a/app/assets/javascripts/leaflet.key.js +++ b/app/assets/javascripts/leaflet.key.js @@ -56,6 +56,7 @@ L.OSM.key = function (options) { if (!button.hasClass('disabled')) { options.sidebar.togglePane($ui, button); } + $('.leaflet-control .control-button').tooltip('hide'); } function updateButton() { diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js index c506c951ea..b04216d269 100644 --- a/app/assets/javascripts/leaflet.layers.js +++ b/app/assets/javascripts/leaflet.layers.js @@ -171,6 +171,7 @@ L.OSM.layers = function(options) { e.stopPropagation(); e.preventDefault(); options.sidebar.togglePane($ui, button); + $('.leaflet-control .control-button').tooltip('hide'); } return $container[0]; diff --git a/app/assets/javascripts/leaflet.share.js b/app/assets/javascripts/leaflet.share.js index 6a4491c2a7..d4c8295320 100644 --- a/app/assets/javascripts/leaflet.share.js +++ b/app/assets/javascripts/leaflet.share.js @@ -230,6 +230,7 @@ L.OSM.share = function (options) { update(); options.sidebar.togglePane($ui, button); + $('.leaflet-control .control-button').tooltip('hide'); } function toggleMarker() { From fcf12ebcfcc92a8c9a8d0899d70a9ac8591bd649 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 15 Nov 2013 15:04:46 -0800 Subject: [PATCH 214/270] Adjustments to about page and welcome copy --- config/locales/en.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 7ee23f2f87..3d41392de2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -887,7 +887,7 @@ en: edit_with: Edit with %{editor} tag_line: The Free Wiki World Map intro_header: Welcome to OpenStreetMap! - intro_text: OpenStreetMap is a free and editable map of the world maintained by an active community of contributors. + intro_text: OpenStreetMap is an editable map of the world created by people like you, and free to download and use under an open license. intro_2_create_account: "Create a user account" partners_html: "Hosting is supported by %{ucl}, %{ic} and %{bytemark}, and other %{partners}." partners_ucl: "the UCL VR Centre" @@ -1090,19 +1090,20 @@ en: copyright_html: ©OpenStreetMap
    contributors used_by: "%{name} powers map data on hundreds of web sites, mobile apps, and hardware devices" lede_text: | - OSM is built by a community of local mappers that keeps data about - roads, cafés, subway stations, and much more up to date every day. + OpenStreetMap is built by a community of mappers that contribute and maintain data + about roads, trails, cafés, railway stations, and much more, all over the world. local_knowledge_title: Local Knowledge local_knowledge_html: | OpenStreetMap emphasizes local knowledge. Contributors use aerial imagery, GPS devices, and low-tech field maps to verify that OSM - is up to date and accurate. + is accurate and up to date. community_driven_title: Community Driven community_driven_html: | - From the engineers that tune OSM's servers to the Humanitarian OSM Team - that maps disaster-affected areas, OSM's community is diverse, - passionate, and growing every day. To learn more about the community, - see the
    user diaries, + OpenStreetMap's community is diverse, passionate, and growing every day. + Our contributors include enthusiast mappers, GIS professionals, engineers + running the OSM servers, humanitarians mapping disaster-affected areas, + and many more. + To learn more about the community, see the user diaries, community blogs, and the OSM Foundation website. open_data_title: Open Data From b1a548d1de420b12bbd507d4c79c885fe7258d00 Mon Sep 17 00:00:00 2001 From: Aaron Lidman Date: Fri, 15 Nov 2013 15:06:36 -0800 Subject: [PATCH 215/270] Improved noteLayer and dataLayer availability, closes #65 --- app/assets/javascripts/index/browse.js | 16 +++++++--------- app/assets/javascripts/leaflet.layers.js | 8 ++++---- config/locales/en.yml | 2 +- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/index/browse.js b/app/assets/javascripts/index/browse.js index a47dd348e9..752c84fece 100644 --- a/app/assets/javascripts/index/browse.js +++ b/app/assets/javascripts/index/browse.js @@ -41,13 +41,9 @@ function initializeBrowse(map) { }); function updateData() { - if (map.getZoom() >= 15) { - var bounds = map.getBounds(); - if (!browseBounds || !browseBounds.contains(bounds)) { - browseBounds = bounds; - getData(); - } - } + var bounds = map.getBounds(); + getData(!browseBounds || !browseBounds.contains(bounds)); + browseBounds = bounds; } function displayFeatureWarning(count, limit, callback) { @@ -62,17 +58,19 @@ function initializeBrowse(map) { var dataLoader; - function getData() { + function getData(inPrevious) { var bounds = map.getBounds(); var size = bounds.getSize(); if (size > OSM.MAX_REQUEST_AREA) { $('#browse_status').html( $("

    ") - .text(I18n.t("browse.start_rjs.unable_to_load_size", { max_bbox_size: OSM.MAX_REQUEST_AREA, bbox_size: size }))); + .text(I18n.t("browse.start_rjs.unable_to_load_size", { max_bbox_size: OSM.MAX_REQUEST_AREA, bbox_size: size.toFixed(2) }))); return; } + if (inPrevious) return; + var url = "/api/" + OSM.API_VERSION + "/map?bbox=" + bounds.toBBoxString(); /* diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js index b04216d269..7703529b87 100644 --- a/app/assets/javascripts/leaflet.layers.js +++ b/app/assets/javascripts/leaflet.layers.js @@ -120,7 +120,7 @@ L.OSM.layers = function(options) { var list = $('
      ') .appendTo(overlaySection); - function addOverlay(layer, name, minZoom) { + function addOverlay(layer, name, maxArea) { var refName = name.split(' ').join('_').toLowerCase(); var item = $('
    • ') .attr('class', refName) @@ -153,7 +153,7 @@ L.OSM.layers = function(options) { }); map.on('zoomend', function() { - var disabled = map.getZoom() < minZoom + 1; + var disabled = map.getBounds().getSize() >= maxArea; $(input).prop('disabled', disabled); $(item).attr('class', disabled ? 'disabled' : ''); item.attr('data-original-title', disabled ? @@ -161,8 +161,8 @@ L.OSM.layers = function(options) { }); } - addOverlay(map.noteLayer, I18n.t('javascripts.map.layers.notes'), 10); - addOverlay(map.dataLayer, I18n.t('javascripts.map.layers.data'), 15); + addOverlay(map.noteLayer, I18n.t('javascripts.map.layers.notes'), OSM.MAX_NOTE_REQUEST_AREA); + addOverlay(map.dataLayer, I18n.t('javascripts.map.layers.data'), OSM.MAX_REQUEST_AREA); } options.sidebar.addPane($ui); diff --git a/config/locales/en.yml b/config/locales/en.yml index 3d41392de2..f33726357a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -173,7 +173,7 @@ en: start_rjs: loaded_an_area_with_num_features: "Loading %{num_features} features, which may make your browser slow or unresponsive. Are sure you want to display this data?" load_data: "Load Data" - unable_to_load_size: "Unable to load: Bounding box size of %{bbox_size} is too large (must be smaller than %{max_bbox_size})" + unable_to_load_size: "Unable to load map data, too large of an area (%{bbox_size}). Area must be smaller than %{max_bbox_size} square degrees." loading: "Loading..." tag_details: tags: "Tags" From a61f327ce11fb9ca5d8ba37652159ad78a700214 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 15 Nov 2013 15:28:25 -0800 Subject: [PATCH 216/270] Revert user page to full width for now --- app/assets/stylesheets/common.css.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index f88e0d1d2f..68eb17e423 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -1379,6 +1379,10 @@ header .search_form { } .user-view { + // Silly exception; remove when user page is redesigned. + .content-inner { + max-width: none; + } p#no_home_location { margin: $lineheight; } From f3973b3fa3c8c15e514c93ccd9a1213c76034855 Mon Sep 17 00:00:00 2001 From: Aaron Lidman Date: Fri, 15 Nov 2013 15:48:11 -0800 Subject: [PATCH 217/270] Don't render the user menu for users without ids, closed #68 --- app/views/layouts/_header.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index dbb9966b60..efe9efdf84 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -49,7 +49,7 @@
    - <% if @user %> + <% if @user && @user.id %>