Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. tinymce.init({
  2. selector: "div.Body",
  3. content_css : '/style/core.css',
  4. inline: true,
  5. force_br_newlines : true,
  6. force_p_newlines : false,
  7. forced_root_block: '',
  8. plugins: [
  9. "save advlist autolink lists link image charmap print preview anchor",
  10. "searchreplace visualblocks code fullscreen",
  11. "insertdatetime media table contextmenu paste"
  12. ],
  13. toolbar: "save insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
  14.  
  15. save_onsavecallback: function ()
  16. {
  17. console.log("Sending body to database");
  18. var list = {};
  19.  
  20. list.Id = "@Model.Id";
  21. list.Body = $("#PageBody").html();
  22.  
  23. $.post("/home/SaveChanges", list, function (message) {
  24. $('#save').attr('disabled', true);
  25. $("#message").html("<strong>" + message + "</strong>");
  26. });
  27.  
  28. }
  29. });
  30.  
  31. <div id="PageBody" contenteditable="true" class="Body">
  32. <span id="text1">@Model.Body</span></div>
  33.  
  34. #Body, #PanelContent #PageBody {
  35. border-top: 0.5em solid #009B7B;
  36. padding: 0.25em 0.5em 0.25em 0.5em;
  37. background: linear-gradient(to bottom, rgba(0,155,123,0.2) 0%,rgba(0,155,123,0.1) 50%,rgba(0,155,123,0) 100%);
  38. position: relative;
  39. width: 17.5em;
  40. min-height: 100%;
  41. margin-right: 1.25em;
  42. margin-bottom: 1.25em;
  43. clear: left;
  44. float: left;
  45.  
  46. tinymce.activeEditor.setDirty(false);
  47.  
  48. tinymce.editors[0].setDirty(false);
  49.  
  50. editor.setDirty(false)
  51. editor.nodeChanged()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement