Commit 1eaeacef974c69ad61e1dec4d59ab822b70e820b

Authored by AurelioAHeckert
1 parent f490ef99

ActionItem56: alguem meteu o dedinho, mas foi válido. :-)

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1179 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/application_helper.rb
@@ -190,9 +190,11 @@ module ApplicationHelper @@ -190,9 +190,11 @@ module ApplicationHelper
190 field_html =~ /id=['"]([^'"]*)['"]/ 190 field_html =~ /id=['"]([^'"]*)['"]/
191 field_id = $1 191 field_id = $1
192 end 192 end
  193 + field_html =~ /type=['"]([^'"]*)['"]/
  194 + field_type = $1
193 195
194 label_html = content_tag('label', text, :class => 'formlabel', :for => field_id) 196 label_html = content_tag('label', text, :class => 'formlabel', :for => field_id)
195 - control_html = content_tag('div', field_html, :class => 'formfield' ) 197 + control_html = content_tag('div', field_html, :class => 'formfield '+field_type )
196 198
197 content_tag('div', label_html + control_html, :class => 'formfieldline' ) 199 content_tag('div', label_html + control_html, :class => 'formfieldline' )
198 end 200 end
app/views/profile_editor/change_image.rhtml
1 -<% form_for :image, @image, :html => { :multipart => true }, :url => { :action => 'change_image'} do |f| %>  
2 - <%= display_form_field(_('Image'), f.file_field( :uploaded_data ) ) %> 1 +<% form_for :image, @image,
  2 + :html => { :multipart => true },
  3 + :url => { :action => 'change_image'} do |f| %>
  4 + <%= display_form_field(_('Image'), f.file_field( :uploaded_data, { :onchange => 'updateImg(this.value)' } ) ) %>
3 <%= display_submit_tag(_('Upload')) %> 5 <%= display_submit_tag(_('Upload')) %>
4 <%= link_to _('Cancel'), :action => 'index' %> 6 <%= link_to _('Cancel'), :action => 'index' %>
5 <% end %> 7 <% end %>
  8 +
  9 +<ximg id="imgPrev" src="file:///home/aurium/osso3.png" onerror="alert(999)" onload="alert(111)" />
  10 +
  11 +<iframe id="fimg" src=""></iframe>
  12 +
  13 +<script type="text/javascript">
  14 +
  15 +var imgPrev = $("imgPrev");
  16 +
  17 +setTimeout( '$("fimg").src = "http://google.com"', 2000 );
  18 +setTimeout( '$("fimg").src = "file:///home/aurium/osso3.png"', 9000 );
  19 +
  20 +function updateImg( imgLocal ) {
  21 + imgPrev.src = "file://" + imgLocal;
  22 +}
  23 +
  24 +</script>
  25 +
public/designs/templates/default/stylesheets/forms.css
@@ -10,13 +10,12 @@ @@ -10,13 +10,12 @@
10 padding: 2px 5px; 10 padding: 2px 5px;
11 } 11 }
12 12
13 -.formfield.text_field input,  
14 -.formfield.password_field input, 13 +.formfield input,
15 .formfield textarea { 14 .formfield textarea {
16 -/* background: transparent url("../images/input-bg.gif") top left no-repeat; */ 15 + background: transparent url("../images/input-bg.gif") top left no-repeat;
17 border: 1px solid #999; 16 border: 1px solid #999;
18 -/* border-top: none;  
19 - border-left: none; */ 17 + border-top: none;
  18 + border-left: none;
20 color: #585858; 19 color: #585858;
21 } 20 }
22 .formfield input { 21 .formfield input {
@@ -26,6 +25,12 @@ @@ -26,6 +25,12 @@
26 padding: 2px 0px 0px 5px; 25 padding: 2px 0px 0px 5px;
27 } 26 }
28 27
  28 +.formfield.radio input,
  29 +.formfield.checkbox input {
  30 + background: none;
  31 + border: none;
  32 +}
  33 +
29 .submitline { 34 .submitline {
30 text-align: center; 35 text-align: center;
31 } 36 }