Sha256: caca704a9e506896e0e9a6efaadfc95902c56845effd7352d66f3a53e0626d9d

Contents?: true

Size: 1.38 KB

Versions: 6

Compression:

Stored size: 1.38 KB

Contents

(function($) {
	<% if params[:was_missing] -%>

	$("#element_<%= @element.id -%>_content_missing").replaceWith('<%= escape_javascript(
		render(
			:partial => "alchemy/essences/#{@content.essence_partial_name}_editor",
			:locals => @locals
		)
	) -%>');

	<% else -%>

	$("<%= @element_dom_id -%>").before('<%= escape_javascript(
		render(
			:partial => "alchemy/essences/#{@content.essence_partial_name}_editor",
			:locals => @locals
		)
	) -%>');

	<% end -%>

	<% case @content.essence_type -%>
	<% when "Alchemy::EssencePicture" -%>

	<% if @contents_of_this_type.length > 1 -%>
	$('#element_<%= @element.id -%>_contents .essence_picture_editor').addClass('dragable_picture');
	<% end -%>
	<% if !max_image_count.blank? && (@contents_of_this_type.length >= max_image_count) -%>
	$("#add_content_<%= @element.id -%>").remove();
	<% end -%>
	Alchemy.SortableContents('#element_<%= @element.id -%>_contents', '<%= form_authenticity_token -%>');

	<% when "Alchemy::EssenceDate" -%>

	Alchemy.Datepicker('#element_<%= @element.id -%> input.date');

	<% when "Alchemy::EssenceRichtext" -%>

	Alchemy.Tinymce.addEditor('contents_content_<%= @content.id -%>_body');

	<% end -%>

	Alchemy.reloadPreview();
	Alchemy.closeCurrentWindow();
	Alchemy.SelectBox("#element_<%= @element.id %> select.alchemy_selectbox");
	Alchemy.growl('<%= t("Successfully added content", :content => @content.name) -%>');
})(jQuery);

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
alchemy_cms-2.1.12 app/views/alchemy/admin/contents/create.js.erb
alchemy_cms-2.1.11 app/views/alchemy/admin/contents/create.js.erb
alchemy_cms-2.1.9.1 app/views/alchemy/admin/contents/create.js.erb
alchemy_cms-2.1.9 app/views/alchemy/admin/contents/create.js.erb
alchemy_cms-2.1.8.1 app/views/alchemy/admin/contents/create.js.erb
alchemy_cms-2.1.8 app/views/alchemy/admin/contents/create.js.erb