Sha256: 403d73a6f32aad1eb19b0bdbef71a3da0a73a1119a9bf7ece7da77715e6d7c62

Contents?: true

Size: 1.4 KB

Versions: 4

Compression:

Stored size: 1.4 KB

Contents

= javascript_include_tag "uploadify/swfobject", "uploadify/jquery.uploadify.v2.1.0" 
- session_key = Rails.application.config.session_options[:key] 

%script{:charset => "utf-8", :type => "text/javascript"}
  $(document).ready(function() {
  $('#<%= child_singular_name %>_file').click(function(event) {
  event.preventDefault();
  });

  $('#<%=child_singular_name%>_file').uploadify({
  'uploader'    : '/javascripts/uploadify/uploadify.swf',
  'script'      : '/<%=child_plural_name%>',
  'multi'       : true,
  'auto'        : false,
  'buttonText'  : 'Find',
  'buttonImg'   : '/images/browse.png',
  'cancelImg'   : '/images/cancel.png',
  'wmode'       : 'transparent',
  height        : 26, // The height of the flash button
  width         : 101, // The width of the flash button
  onComplete : function(event, queueID, fileObj, response, data) { var dat = eval('(' +
  response + ')');$.getScript(dat.<%=child_singular_name%>);},
  scriptData: {
  '_http_accept': 'application/javascript',
  'format' : 'json',
  '_method': 'post',
  '#{session_key}' : encodeURIComponent('#{u cookies[session_key]}'),
  'authenticity_token': encodeURIComponent('#{ u form_authenticity_token }'),
  '<%=parent_singular_name%>_id' : '#{ @<%=parent_singular_name%>.id} '
  }
  });

  $('#<%=child_singular_name%>_submit').click(function(event){
  event.preventDefault();
  $('#<%=child_singular_name%>_file').uploadifyUpload();
  });
  });

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dust-generators-0.3.3 lib/generators/dust/albums/templates/app/views/albums/_upload_script.html.haml
dust-generators-0.3.2 lib/generators/dust/albums/templates/app/views/albums/_upload_script.html.haml
dust-generators-0.3.1 lib/generators/dust/albums/templates/app/views/albums/_upload_script.html.haml
dust-generators-0.2.8 lib/generators/dust/albums/templates/app/views/albums/_upload_script.html.haml