Sha256: fbeb2b3d91356062cb54b0cf5dcb3eec700d3c128d59a858709e7ff0882bf519

Contents?: true

Size: 1.57 KB

Versions: 23

Compression:

Stored size: 1.57 KB

Contents

<textarea id='page_<%= @page.id %>_content' placeholder='Content' style='width:795px; height:545px;' class='tinymce'><%= raw @page.content %></textarea>
<br />
<div id='message'></div>
<div id='controls'>
<input type='button' value='Close' onclick="modal.close();" />
<input type='button' value='Update' onclick="updateContent();" />
</div>

<% content_for :caboose_js do %>

  <%= javascript_include_tag "caboose/model/all" %>

  <script type="text/javascript">

  var modal = false;
  $(document).ready(function() {  
    modal = new CabooseModal(800, 700);
  });

  function updateContent()
  {
    tinymce.triggerSave();

    function log(msg) {
      setTimeout(function() {
        throw new Error(msg);
      }, 0);
    }
    // log($('#page_<%= @page.id %>_content').val());

    $.ajax({
      url: '/pages/<%= @page.id %>',
      type: 'put',
      data: {
        authenticity_token: "<%= form_authenticity_token %>",
        content: $('#page_<%= @page.id %>_content').val()
      },
      success: function(resp) {
        if (resp.success)
        {
          contentVal = $('#page_<%= @page.id %>_content').val();
          parent.$('#editmode_content_container').html(contentVal == null || contentVal.length == 0 ? 'No content.' : contentVal);
          modal.close();
        }
        if (resp.error)
          modal.autosize("<p class='note success'>" + resp.error + "</p>");
      }
    });
  }

  </script>
  <%= tinymce :caboose,
    width:'795px',
    height:'545px'
    # theme_advanced_source_editor_width: '100px',
    # theme_advanced_source_editor_height: '100px'
  %>
<% end %>

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
caboose-cms-0.2.57 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.55 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.54 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.52 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.50 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.49 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.48 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.47 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.46 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.45 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.44 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.43 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.42 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.41 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.40 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.39 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.38 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.37 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.36 app/views/caboose/pages/edit_content.html.erb
caboose-cms-0.2.35 app/views/caboose/pages/edit_content.html.erb