Sha256: cf8263204d1540a5ac4f532ce188e154c6dd1fc54fa9a1c5ef7e9debd29821f6

Contents?: true

Size: 1.46 KB

Versions: 8

Compression:

Stored size: 1.46 KB

Contents

<%%- session_key_name = ActionController::Base.session_options[:key] -%>
<%%= javascript_include_tag "uploadify/swfobject", "uploadify/jquery.uploadify.v2.1.0" %>

<script type="text/javascript" charset="utf-8"> 
	$(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%>/create',
			'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': {
				'<%%= session_key_name %>' : encodeURIComponent('<%%= u cookies[session_key_name] %>'),
				'authenticity_token' : encodeURIComponent('<%%= u form_authenticity_token if protect_against_forgery? %>'),
				'<%=parent_singular_name%>_id' : '<%%= @<%=parent_singular_name%>.id %>',
				'title' : 'change me!',
				'format'	: 'json'
				}
		});
	
		$('#<%=child_singular_name%>_submit').click(function(event){
			event.preventDefault(); 
			$('#<%=child_singular_name%>_file').uploadifyUpload(); 
		});
	}); 
</script>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dust-generators-0.2.8 rails_generators/dust_albums/templates/app/views/albums/_upload_script.html.erb
dust-generators-0.2.6 rails_generators/dust_albums/templates/app/views/albums/_upload_script.html.erb
dust-generators-0.2.5 rails_generators/dust_albums/templates/app/views/albums/_upload_script.html.erb
dust-generators-0.2.4 rails_generators/dust_albums/templates/app/views/albums/_upload_script.html.erb
dust-generators-0.2.3 rails_generators/dust_albums/templates/app/views/albums/_upload_script.html.erb
dust-generators-0.2.2 rails_generators/dust_albums/templates/app/views/albums/_upload_script.html.erb
dust-generators-0.2.1 rails_generators/dust_albums/templates/app/views/albums/_upload_script.html.erb
dust-generators-0.2.0 rails_generators/dust_albums/templates/app/views/albums/_upload_script.html.erb