X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f053c8472336b386eaff72acdcdb8f8e148a3340..c20b31b54ed3043e9ebf3964aa7c08f5ddc73a95:/app/views/browse/start.rjs?ds=sidebyside diff --git a/app/views/browse/start.rjs b/app/views/browse/start.rjs index 04f5e12c9..b96e8c39c 100644 --- a/app/views/browse/start.rjs +++ b/app/views/browse/start.rjs @@ -1,8 +1,7 @@ -page.replace_html :sidebar_title, 'Data' +page.replace_html :sidebar_title, t('browse.start_rjs.data_frame_title') page.replace_html :sidebar_content, :partial => 'start' page << <= 15) { - useMap(); + useMap(false); } else { - setStatus("Zoom in or select an area of the map to view"); + setStatus("#{I18n.t('browse.start_rjs.zoom_or_select')}"); } } } function stopBrowse() { - if (browseActive) { - browseActive = false; - - if (browseDataLayer) { - browseDataLayer.destroy(); - browseDataLayer = null; - } + if (map.dataLayer.active) { + map.dataLayer.active = false; if (browseSelectControl) { browseSelectControl.destroy(); @@ -62,7 +61,7 @@ page << < 0.25) { - setStatus("Unable to load: Bounding box size of " + size + " is too large (must be smaller than 0.25)"); + if (size > #{MAX_REQUEST_AREA}) { + setStatus(i18n("#{I18n.t('browse.start_rjs.unable_to_load_size', :max_bbox_size => MAX_REQUEST_AREA)}", { bbox_size: size })); } else { - loadGML("/api/0.5/map?bbox=" + projected.toBBOX()); + loadGML("/api/#{API_VERSION}/map?bbox=" + projected.toBBOX(), reload); } } - function loadGML(url) { - setStatus("Loading..."); + function loadGML(url, reload) { + setStatus("#{I18n.t('browse.start_rjs.loading')}"); $("browse_content").innerHTML = ""; - if (!browseDataLayer) { + var formatOptions = { + checkTags: true, + interestingTagsExclude: ['source','source_ref','source:ref','history','attribution','created_by','tiger:county','tiger:tlid','tiger:upload_uuid'] + }; + + if (areasHidden) formatOptions.areaTags = []; + + if (!browseDataLayer || reload) { var style = new OpenLayers.Style(); style.addRules([new OpenLayers.Rule({ @@ -208,26 +239,30 @@ page << <= 0; i--) { - var user = nodes[i].getAttribute("user") || "private user"; + var user = nodes[i].getAttribute("user") || "#{I18n.t('browse.start_rjs.private_user')}"; var timestamp = nodes[i].getAttribute("timestamp"); var item = document.createElement("li"); - item.appendChild(document.createTextNode("Edited by " + user + " at " + timestamp)); + item.appendChild(document.createTextNode(i18n("#{I18n.t('browse.start_rjs.edited_by_user_at_timestamp')}", { user: user, timestamp: timestamp }))); history.appendChild(item); } div.appendChild(history); @@ -454,12 +489,46 @@ page << <