Commit 1eaeacef974c69ad61e1dec4d59ab822b70e820b
1 parent
f490ef99
Exists in
master
and in
28 other branches
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
Showing
3 changed files
with
35 additions
and
8 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -190,9 +190,11 @@ module ApplicationHelper |
190 | 190 | field_html =~ /id=['"]([^'"]*)['"]/ |
191 | 191 | field_id = $1 |
192 | 192 | end |
193 | + field_html =~ /type=['"]([^'"]*)['"]/ | |
194 | + field_type = $1 | |
193 | 195 | |
194 | 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 | 199 | content_tag('div', label_html + control_html, :class => 'formfieldline' ) |
198 | 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 | 5 | <%= display_submit_tag(_('Upload')) %> |
4 | 6 | <%= link_to _('Cancel'), :action => 'index' %> |
5 | 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 | 10 | padding: 2px 5px; |
11 | 11 | } |
12 | 12 | |
13 | -.formfield.text_field input, | |
14 | -.formfield.password_field input, | |
13 | +.formfield input, | |
15 | 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 | 16 | border: 1px solid #999; |
18 | -/* border-top: none; | |
19 | - border-left: none; */ | |
17 | + border-top: none; | |
18 | + border-left: none; | |
20 | 19 | color: #585858; |
21 | 20 | } |
22 | 21 | .formfield input { |
... | ... | @@ -26,6 +25,12 @@ |
26 | 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 | 34 | .submitline { |
30 | 35 | text-align: center; |
31 | 36 | } | ... | ... |