reply_layer.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <#include "../_inc/_layer_layout.html"/>
  2. <#macro script>
  3. var data={
  4. url:'',
  5. alt:''
  6. };
  7. function initTinymce(){
  8. tinymce.init({
  9. selector: '#textarea',
  10. height: 200,
  11. language: 'zh_CN',
  12. menubar: false,
  13. automatic_uploads: true,
  14. paste_data_images: true,
  15. convert_urls: false,
  16. imagetools_toolbar: "rotateleft rotateright | flipv fliph | editimage imageoptions",
  17. imagetools_proxy: '${CPATH}/admin/tinymce/image/proxy',
  18. images_upload_url: '${CPATH}/admin/tinymce/image/upload',
  19. wordcount_countregex: /[\u4e00-\u9fa5_a-zA-Z0-9]/g,
  20. file_picker_callback: function(callback, value, meta) {
  21. layer.open({
  22. type: 2,
  23. title: '选择图片',
  24. shadeClose: true,
  25. shade: 0.8,
  26. area: ['92%', '90%'],
  27. content: '${CPATH}/admin/attachment/choose_layer',
  28. end:function(){
  29. callback(data.url, {alt: data.alt});
  30. }
  31. });
  32. },
  33. plugins: [
  34. "advlist autolink autosave link image imagetools lists charmap print preview hr anchor pagebreak spellchecker",
  35. "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
  36. "table contextmenu directionality emoticons template textcolor paste fullpage textcolor colorpicker textpattern"
  37. ],
  38. toolbar1: ' bold italic underline strikethrough removeformat | blockquote hr table image | link anchor unlink | alignleft aligncenter alignright alignjustify | bullist numlist | fullscreen code ',
  39. toolbar2: ' formatselect | outdent indent | forecolor backcolor | undo redo ',
  40. });
  41. }
  42. initTinymce();
  43. function save(){
  44. tinymce.activeEditor.uploadImages(function(success) {
  45. tinymce.triggerSave();
  46. doSubmit();
  47. });
  48. return false;
  49. }
  50. function doSubmit(){
  51. $("#form").ajaxSubmit({
  52. type : "post",
  53. dataType : "json",
  54. success : function(data) {
  55. parent.layer.closeAll();
  56. },
  57. error : function() {
  58. alert("信息提交错误");
  59. }
  60. });
  61. }
  62. </#macro>
  63. <#macro script_import>
  64. <script src="${CPATH}/static/tinymce/tinymce.min.js"></script>
  65. </#macro>
  66. <#macro css>
  67. .editable-input {
  68. width: 100%;
  69. }
  70. .form-inline .form-control {
  71. display: inline-block;
  72. width: 100%;
  73. vertical-align: middle;
  74. }
  75. </#macro>
  76. <@layout>
  77. <!-- Main content -->
  78. <section class="content" style="z-index: 9999">
  79. <form action="${CPATH}/admin/comment/reply" id="form" method="post">
  80. <input type="hidden" id="comment.parent_id" name="comment.parent_id" value="${(comment.id)!}">
  81. <input type="hidden" name="comment.content_id" value="${(comment.content_id)!}">
  82. <input type="hidden" name="comment.content_module" value="${(comment.content_module)!}">
  83. <input type="hidden" name="ucode" value="${ucode}">
  84. <div class="row">
  85. <!-- /.col -->
  86. <div class="col-md-12">
  87. <div class="form-group">
  88. 您准备回复 ${comment.author!}在文章《<a href="${comment.getContent().url!}" target="_blank">${comment.getContent().title!}</a>》评论的如下内容:<br />
  89. ${(comment.text)!}
  90. </div>
  91. <div class="box box-solid">
  92. <div class="box-body no-padding">
  93. <textarea id="textarea" name="comment.text" ></textarea>
  94. </div>
  95. </div>
  96. <div class="box box-solid">
  97. <div class="box-body no-padding">
  98. <button type="button" class="btn btn-primary pull-right" onclick="save()">回复</button>
  99. </div>
  100. </div>
  101. </div>
  102. <!-- /.col -->
  103. </div>
  104. <!-- /.row -->
  105. </form>
  106. </section>
  107. </@layout>