noosfero | adding thumbnail in editing profile picture (!1354)
Rodrigo Souto
gitlab at mg.gitlab.com
Tue Nov 28 11:21:55 BRST 2017
Rodrigo Souto started a new discussion on app/views/shared/_change_image.html.erb:
> +<%= file_field_tag("#{for_attr}[uploaded_data]", { :onchange => 'updateImg(this.value)', :id => "pictureInput" } ) %>
> <%= labelled_form_field(_("Image Label:"), text_field_tag("#{for_attr}[label]")) %>
> <%= button_to_function(:cancel,_('Cancel'),"jQuery('#change-image-link').show(); jQuery('#change-image').hide()", :id => 'cancel-change-image-link', :style => 'display: none')%>
> +
> +<script type="text/javascript">
> +//<![CDATA[
> + $(function() {
> + $('#pictureInput').on('change', function(event) {
> + var files = event.target.files;
> + var image = files[0]
> + var reader = new FileReader();
> + reader.onload = function(file) {
> + var img = new Image(98, 100);
> + img.src = file.target.result;
> + $('#previewImage').html(img);
> + $('#previewText').html("Pré-visualização:");
This `Pré-visualização:` string should be translated. To achieve this, you can set it as a data attribute in the html element like so:
```
html
```
---
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1354#note_48976012
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20171128/22c5c001/attachment-0001.html>
More information about the Noosfero-dev
mailing list