From: Tom Hughes Date: Tue, 23 Apr 2013 21:40:21 +0000 (+0100) Subject: Merge branch 'notes' X-Git-Tag: live~5096 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/0c8ad2f86edefed72052b402742cadedb0d674d9?hp=52611a5bfa69165179bd871b925b5f8b14942e2e Merge branch 'notes' Conflicts: Vendorfile --- diff --git a/Vendorfile b/Vendorfile index 197bf575b..a56751196 100644 --- a/Vendorfile +++ b/Vendorfile @@ -26,6 +26,12 @@ folder 'vendor/assets' do end end + folder 'jquery' do + from 'git://github.com/jevin/Autogrow-Textarea.git' do + file 'jquery.autogrowtextarea.js', 'jquery.autogrowtextarea.js' + end + end + folder 'ohauth' do from 'git://github.com/tmcw/ohauth.git' do file 'ohauth.js' diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index 30905b96c..d20e4b4c4 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -1641,12 +1641,13 @@ a.button.submit { .richtext_content { display: inline-block; vertical-align: top; + white-space: normal; .richtext_preview { display: inline-block; padding: 20px; background-color: #f4f4ff; - white-space: normal; + overflow-x: scroll; &.loading { background-image: image-url("loading.gif"); diff --git a/app/views/browse/_common_details.html.erb b/app/views/browse/_common_details.html.erb index 574242f77..7c8165c67 100644 --- a/app/views/browse/_common_details.html.erb +++ b/app/views/browse/_common_details.html.erb @@ -29,7 +29,7 @@

<%= link_to common_details.changeset_id, :action => :changeset, :id => common_details.changeset_id %>

- <% if common_details.changeset.tags['comment'] %> + <% if common_details.changeset.tags['comment'].present? %>

<%= t 'browse.common_details.changeset_comment' %>

<%= linkify(h(common_details.changeset.tags['comment'])) %>

diff --git a/config/locales/el.yml b/config/locales/el.yml index 72616ccac..5d3fec99a 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -295,6 +295,7 @@ el: description_user: Ομάδες αλλαγών από %{user} description_user_bbox: Ομάδες αλλαγών από %{user} μεταξύ %{bbox} empty_anon_html: Δεν έχει γίνει ακόμη καμία επεξεργασία. + empty_user_html: Φαίνεται ότι δεν έχετε κάνει καθόλου αλλαγές ακόμα. Για να ξεκινήσετε, ελέγξτε το Οδηγός αρχαρίων. heading: Ομάδες αλλαγών heading_bbox: Ομάδες αλλαγών heading_friend: Ομάδες αλλαγών diff --git a/config/locales/es.yml b/config/locales/es.yml index 8197a044b..e4b124933 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -407,7 +407,7 @@ es: start: add_marker: Añadir un marcador al mapa area_to_export: Área a exportar - embeddable_html: HTML empotrable + embeddable_html: HTML integrable export_button: Exportar export_details: Los datos de OpenStreetMap se encuentran bajo la href="http://opendatacommons.org/licenses/odbl/1.0/">licencia Open Database (ODbL) de Open Data Commons. format: Formato @@ -1685,7 +1685,7 @@ es: nearby mapper: Mapeadores cercanos your location: "Tu lugar de origen:" remove_friend: - button: Quitar de amigos + button: Quitar amistad heading: ¿Quitar a %{user} de los amigos? not_a_friend: "%{name} no es uno de tus amigos." success: Has quitado a %{name} de tus amigos. diff --git a/config/locales/et.yml b/config/locales/et.yml index 1f3ce1920..e32e01b8c 100644 --- a/config/locales/et.yml +++ b/config/locales/et.yml @@ -883,7 +883,10 @@ et: email_confirm_html: greeting: Tere, email_confirm_plain: + click_the_link: Kui see oled sina, siis palun kliki allolevale lingile muudatuse kinnitamiseks. greeting: Tere, + hopefully_you_1: Keegi (loodetavasti sina) soovib muuta oma e-posti aadressi + hopefully_you_2: "%{server_url} aadressiks %{new_address}." friend_notification: had_added_you: "% {user} lisas sind OpenStreetMap'is sõbraks." subject: "[OpenStreetMap] %{user} lisas sind oma sõbraks" @@ -1231,7 +1234,7 @@ et: display name: "Kuvatav nimi:" display name description: Avalikult kuvatud kasutajanimi. Seda saate muuta hiljem eelistustes. email address: "E-posti aadress:" - fill_form: Täitke vorm ning me saadame teile e-posti konto aktiveerimiseks. + fill_form: Täitke vorm ning me saadame teile e-kirja konto aktiveerimiseks. heading: Loo uus kasutajanimi not displayed publicly: Ei näidata avalikult (vaata privaatsusreegleid) openid: "%{logo} OpenID:" diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 409cce91c..a696f015a 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1392,7 +1392,7 @@ fi: preview: Esikatselu search: search: Haku - search_help: "esim.: 'Munkkivuori', 'Karttatie, Oulu' tai 'post offices near Helsinki' lisää esimerkkejä... (englanniksi)" + search_help: esim. "Santalahti", "Karttatie, Oulu" tai "post offices near Helsinki" lisää esimerkkejä englanniksi... submit_text: Hae where_am_i: Nykyinen sijainti? where_am_i_title: Määrittää nykyisen sijainnin hakukoneella diff --git a/config/locales/gl.yml b/config/locales/gl.yml index b8722113f..7375041a4 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -1609,7 +1609,7 @@ gl: title: Acceder ao sistema con Yahoo password: "Contrasinal:" register now: Rexístrese agora - remember: "Lembrádeme:" + remember: Lembrádeme title: Rexistro to make changes: Para realizar as modificacións nos datos do OpenStreetMap, cómpre ter unha conta. with openid: "Tamén pode usar o seu OpenID para acceder:" diff --git a/vendor/assets/jquery/jquery.autogrowtextarea.js b/vendor/assets/jquery/jquery.autogrowtextarea.js index 8666c5578..9a8f69417 100644 --- a/vendor/assets/jquery/jquery.autogrowtextarea.js +++ b/vendor/assets/jquery/jquery.autogrowtextarea.js @@ -1,61 +1,60 @@ -/*! - * Autogrow Textarea Plugin Version v2.0 - * http://www.technoreply.com/autogrow-textarea-plugin-version-2-0 +/* + * ---------------------------------------------------------------------------- + * "THE BEER-WARE LICENSE" (Revision 42): + * wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Jevin O. Sewaruth + * ---------------------------------------------------------------------------- * - * Copyright 2011, Jevin O. Sewaruth + * Autogrow Textarea Plugin Version v3.0 + * http://www.technoreply.com/autogrow-textarea-plugin-3-0 + * + * THIS PLUGIN IS DELIVERD ON A PAY WHAT YOU WHANT BASIS. IF THE PLUGIN WAS USEFUL TO YOU, PLEASE CONSIDER BUYING THE PLUGIN HERE : + * https://sites.fastspring.com/technoreply/instant/autogrowtextareaplugin * - * Date: March 13, 2011 + * Date: October 15, 2012 */ -jQuery.fn.autoGrow = function(){ - return this.each(function(){ - // Variables - var colsDefault = this.cols; - var rowsDefault = this.rows; - - //Functions - var grow = function() { - growByRef(this); + +jQuery.fn.autoGrow = function() { + return this.each(function() { + + var createMirror = function(textarea) { + jQuery(textarea).after('
'); + return jQuery(textarea).next('.autogrow-textarea-mirror')[0]; } - - var growByRef = function(obj) { - var linesCount = 0; - var lines = obj.value.split('\n'); - - for (var i=lines.length-1; i>=0; --i) - { - linesCount += Math.floor((lines[i].length / colsDefault) + 1); - } - - if (linesCount >= rowsDefault) - obj.rows = linesCount + 1; - else - obj.rows = rowsDefault; + + var sendContentToMirror = function (textarea) { + mirror.innerHTML = String(textarea.value).replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(//g, '>').replace(/\n/g, '
') + '.
.'; + + if (jQuery(textarea).height() != jQuery(mirror).height()) + jQuery(textarea).height(jQuery(mirror).height()); } - - var characterWidth = function (obj){ - var characterWidth = 0; - var temp1 = 0; - var temp2 = 0; - var tempCols = obj.cols; - - obj.cols = 1; - temp1 = obj.offsetWidth; - obj.cols = 2; - temp2 = obj.offsetWidth; - characterWidth = temp2 - temp1; - obj.cols = tempCols; - - return characterWidth; + + var growTextarea = function () { + sendContentToMirror(this); } + + // Create a mirror + var mirror = createMirror(this); - // Manipulations - this.style.width = "auto"; - this.style.height = "auto"; + // Style the mirror + mirror.style.display = 'none'; + mirror.style.wordWrap = 'break-word'; + mirror.style.padding = jQuery(this).css('padding'); + mirror.style.width = jQuery(this).css('width'); + mirror.style.fontFamily = jQuery(this).css('font-family'); + mirror.style.fontSize = jQuery(this).css('font-size'); + mirror.style.lineHeight = jQuery(this).css('line-height'); + + // Style the textarea this.style.overflow = "hidden"; - this.style.width = ((characterWidth(this) * this.cols) + 6) + "px"; - this.onkeyup = grow; - this.onfocus = grow; - this.onblur = grow; - growByRef(this); + this.style.minHeight = this.rows+"em"; + + // Bind the textarea's event + this.onkeyup = growTextarea; + + // Fire the event for text already present + sendContentToMirror(this); + }); };