Sha256: fc649abb6efdcb2f0f8e97f7d2edd70526a14b658bb41c6bd9c3bc5e8a692b28

Contents?: true

Size: 1.61 KB

Versions: 9

Compression:

Stored size: 1.61 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 %>

  $("<%= @content_dom_id %>").before('<%= escape_javascript(
    render(
      partial: "alchemy/essences/#{@content.essence_partial_name}_editor",
      locals: @locals
    )
  ) %>');
  Alchemy.Buttons.enable();
  Alchemy.growl('<%= _t("Successfully added content") % {content: @content.name_for_label} %>')

<% end %>

<% if @content.essence_type == "Alchemy::EssencePicture" %>

  <% if @content.ingredient %>
  $('#picture_to_assign_<%= @content.ingredient.id %> a').attr('href', '#').off('click');
  <% end %>

  <% if @gallery_pictures %>

  <% if @gallery_pictures.size > 1 %>
  $('#element_<%= @element.id %>_contents .essence_picture_editor').addClass('dragable_picture');
  <% end %>

  <% if !max_image_count.blank? && @gallery_pictures.size >= max_image_count %>
  $("#add_picture_<%= @element.id %>").remove();
  <% end %>

  Alchemy.SortableContents('#element_<%= @element.id %>_contents', '<%= form_authenticity_token %>');

  <% end %>

<% elsif @content.essence_type == "Alchemy::EssenceDate" %>

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

<% elsif @content.essence_type == "Alchemy::EssenceRichtext" %>

  Alchemy.Tinymce.initEditor(<%= @content.id %>);

<% end %>

  Alchemy.reloadPreview();
  Alchemy.closeCurrentWindow();
  Alchemy.SelectBox("#element_<%= @element.id %>");
  Alchemy.overlayObserver('#<%= content_dom_id(@content) %>');

})()

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-2.9.1 app/views/alchemy/admin/contents/create.js.erb
alchemy_cms-2.9.0 app/views/alchemy/admin/contents/create.js.erb
alchemy_cms-2.8.3 app/views/alchemy/admin/contents/create.js.erb
alchemy_cms-2.7.5 app/views/alchemy/admin/contents/create.js.erb
alchemy_cms-2.7.4 app/views/alchemy/admin/contents/create.js.erb
alchemy_cms-2.8.2 app/views/alchemy/admin/contents/create.js.erb
alchemy_cms-2.8.1 app/views/alchemy/admin/contents/create.js.erb
alchemy_cms-2.7.3 app/views/alchemy/admin/contents/create.js.erb
alchemy_cms-2.7.2 app/views/alchemy/admin/contents/create.js.erb