Hi I just want to annouce a new release of my Prototype Window Class with a new website with full documentation and new samples (I hope it''s easier to understand now :)). http://prototype-window.xilinus.com/ Thanks again to all of you guys for your help. Seb PS Dj T, have you finished your Rails plugin?
i''ve been using prototype window class..i have a code on how to upload an image to database..and i want to close the window after uploading an image without clicking the close button...can you help???? tanx.... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
If you use AJAX you can define a callback (something like onFinish) and just the window from there. Monet Belleza wrote:> i''ve been using prototype window class..i have a code on how to upload > an image to database..and i want to close the window after uploading an > image without clicking the close button...can you > > help???? > > > tanx.... > > > -- > Posted via http://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Kitto wrote:> If you use AJAX you can define a callback (something like onFinish) and > just the window from there.do you have a sample code.?????pls..tanx -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Can YOU post some of your code (how you upload the file)? Monet Belleza wrote:> do you have a sample code.?????pls..tanx--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Kitto wrote:> Can YOU post some of your code (how you upload the file)?def upload_image_save @params["picture"][''name'']=@params["picture"][''tmp''].original_filename.gsub(/[^a-zA-Z0-9.]/, ''_'') @params["picture"][''picture''] = @params["picture"][''tmp''].read @params["picture"].delete(''tmp'') # let''s remove the field from the hash, because there''s no such field in the DB anyway. @upload = StationImage.new(@params["picture"]) if @upload.save render :text => "sdf" end end -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Kitto wrote:> Can YOU post some of your code (how you upload the file)?#code in my line_controller.rb def upload_image_save @params["picture"][''name'']=@params["picture"][''tmp''].original_filename.gsub(/[^a-zA-Z0-9.]/, ''_'') @params["picture"][''picture''] = @params["picture"][''tmp''].read @params["picture"].delete(''tmp'') @upload = StationImage.new(@params["picture"] if @upload.save render :text => "sdf" #i want this to automatically close the popup window which is the prototype window for uploading.. end end #code for line.rhtml <div class="upload-image"> <%=link_to_prototype_window(image_tag(''upload.gif''),''demo1'', { :title => ''Demonstration Page'', :minimizable => false, :maximizable => false, :resizable => false, :width => ''320px'', :height => ''200px'', :url => url_for( :action => "dialog_upload_image") } ) %> </div> #code for dialog_upload_image.rhtml <div style="border-bottom: 1px solid #d6d6d6; font: bold 9pt tahoma; padding: 5px; text-align: center;">Upload tool images here:</div> <%= start_form_tag({ :action => ''upload_image_save'' }, :multipart => true) %> <label for="image_upload_tmp">Picture:</label><br /> <%= file_field "picture", "tmp" %><br /><br /> <input type ="submit" value=''Upload''/> <%= end_form_tag %> #application_helper for prototype window def link_to_prototype_window( name, window_id, options = { :windowParameters => { :effectOptions => { :duration => 0 } } } , html_options = {} ) js_code ="var win = new Window( ''#{window_id}'', #{params_for_javascript(options) } ); win.showCenter();"; if (options[:content]) js_code += "win.getContent().innerHTML = ''#{options[:content]}'';"; end js_code += "win.setDestroyOnClose();" content_tag( "a", name, html_options.merge({ :href => html_options[:href] || "#", :onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + js_code })) end pls..help.??tanx... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---