#include "../_inc/_layout.html"/> <#macro script> var data={ url:'', alt:'' }; function initTinymce(){ tinymce.init({ selector: '#textarea', height: 300, language: 'zh_CN', menubar: false, automatic_uploads: true, paste_data_images: true, convert_urls: false, imagetools_toolbar: "rotateleft rotateright | flipv fliph | editimage imageoptions", imagetools_proxy: '${CPATH}/admin/tinymce/image/proxy', images_upload_url: '${CPATH}/admin/tinymce/image/upload', wordcount_countregex: /[\u4e00-\u9fa5_a-zA-Z0-9]/g, file_picker_callback: function(callback, value, meta) { layer.open({ type: 2, title: '选择图片', shadeClose: true, shade: 0.8, area: ['92%', '90%'], content: '${CPATH}/admin/attachment/choose_layer', end:function(){ callback(data.url, {alt: data.alt}); } }); }, plugins: [ "advlist autolink autosave link image imagetools lists charmap print preview hr anchor pagebreak spellchecker", "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking", "table contextmenu directionality emoticons template textcolor paste fullpage textcolor colorpicker textpattern" ], toolbar1: ' bold italic underline strikethrough removeformat | blockquote hr table image | link anchor unlink | alignleft aligncenter alignright alignjustify | bullist numlist | fullscreen code ', toolbar2: ' formatselect | outdent indent | forecolor backcolor | undo redo ', }); } initTinymce(); function save(){ $('#comment_slug').attr('value',$("#slug_text").text()); tinymce.activeEditor.uploadImages(function(success) { tinymce.triggerSave(); doSubmit(); }); return false; } function saveAsDraft(){ $("#comment_status").attr("value","draft"); save(); } function doSubmit(){ $("#form").ajaxSubmit({ type : "post", dataType : "json", success : function(data) { toastr.success(data.message,'操作成功'); $("#comment_id").attr("value",data.data); }, error : function() { alert("信息提交错误"); } }); } #macro> <#macro script_import> #macro> <#macro css> .editable-input { width: 100%; } .form-inline .form-control { display: inline-block; width: 100%; vertical-align: middle; } .mybox label { display: inline-block; max-width: 100%; margin-bottom: 5px; font-weight: 700; } #macro> <@layout active_id=p child_active_id=c> 评论编辑 评论文章:《${comment.content_title!}》 ${(comment.text)!} <#include "_props_box.html" /> <#include "_action_box.html" /> 用户 评论作者昵称 评论作者邮箱 评论用户 @layout>