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