Forum: Ruby on Rails [ANN] Prototype Window Class v0.85

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ceee1f15591d1f61ac5bec1bc70d0062?d=identicon&s=25 Sébastien Gruhier (Guest)
on 2006-06-12 16:16
(Received via mailing list)
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?
69657fda9dbfb88def5077f99d984836?d=identicon&s=25 Monet Belleza (netskie)
on 2006-11-13 08:49
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....
E5e4661481399f05760ad37a5c6fc754?d=identicon&s=25 Kitto (Guest)
on 2006-11-13 17:55
(Received via mailing list)
If you use AJAX you can define a callback (something like onFinish) and
just the window from there.
69657fda9dbfb88def5077f99d984836?d=identicon&s=25 Monet Belleza (netskie)
on 2006-11-14 01:22
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
E5e4661481399f05760ad37a5c6fc754?d=identicon&s=25 Kitto (Guest)
on 2006-11-14 11:00
(Received via mailing list)
Can YOU post some of your code (how you upload the file)?
69657fda9dbfb88def5077f99d984836?d=identicon&s=25 Monet Belleza (netskie)
on 2006-11-15 01:24
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
69657fda9dbfb88def5077f99d984836?d=identicon&s=25 Monet Belleza (netskie)
on 2006-11-15 01:33
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...
This topic is locked and can not be replied to.