<%= javascript_tag "try { $('insert_file_dialog_content').innerHTML = ''; } catch (e) {}" %>

Insert Image

Single Image

Select an image, then click "Finish" to upload and insert it if you are certain your image is already web-ready. Otherwise, click "Next" to crop and resize your image before using it.

<%= form_tag_with_upload_progress({ :action => 'receive_image', :id => @pg }, { :finish => "if (arguments[0]) { $('filename').value = arguments[0]; $('mainform').onsubmit(); }" }) do -%>
Image file: <%= file_field 'file', 'data', :class => 'form', :style => 'margin-bottom: 0; width: 150px' %>
Valid image types: jpeg, png, gif
<%= upload_status_tag %>
<%= submit_tag 'Next', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('file_data').value == '') return false; $('next_clicked_upload').value = '1'; $('next_clicked').value = '1'; this.disabled = true; this.value = 'Uploading...';" %> <%= submit_tag 'Finish', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('file_data').value == '') return false; this.disabled = true; this.value = 'Uploading...';" %> <%= link_to_function "Cancel", "cancelInsertImage()" %> <%= text_field_tag 'next_clicked_upload', '0', :style => 'display: none' %>
<%- end -%>

New Photo Gallery

Upload a zip file of images to create a photo gallery.

<%= form_tag_with_upload_progress({ :action => 'receive_gallery', :id => @pg }, { :finish => "if (arguments[0]) { $('dirname').value = arguments[0]; $('mainform_gallery').onsubmit(); }" }) do -%>
Zip file: <%= file_field 'gallery_file', 'data', :class => 'form', :style => 'margin-bottom: 0; width: 150px' %>
<%= upload_status_tag %>
<%= submit_tag 'Next', :class => 'form_button', :style => 'width: 70px;', :onclick => "if ($('gallery_file_data').value == '') return false; this.disabled = true; this.value = 'Uploading...';" %> <%= link_to_function "Cancel", "cancelInsertImage()" %>
<%- end -%>

<%= form_remote_tag(:update => 'insert_image_dialog_content', :html => { :id => 'mainform' }, :url => { :action => 'crop_image', :id => @pg }) do -%> <%= text_field_tag 'next_clicked', '0', :style => 'display: none' %> <%= text_field_tag 'filename', '', :style => 'display: none' %> <%- end -%> <%= form_remote_tag(:update => 'insert_image_dialog_content', :html => { :id => 'mainform_gallery' }, :url => { :action => 'gallery_setup', :id => @pg }) do -%> <%= text_field_tag :dirname, '', :style => 'display: none' %> <%- end -%>