Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. function refreshHtml(html){
  2. editor.clickToolbar('source');
  3. editor.html(html);
  4. editor.clickToolbar('source');
  5. // $("textarea[name='content']").html("");
  6.  
  7. }
  8.  
  9. function clearHtml(){
  10. editor.html("");
  11.  
  12. // $("textarea[name='content']").html("");
  13. }
  14.  
  15. //富文本编辑器
  16. var editor;
  17. KindEditor.ready(function(K) {
  18. editor = K.create('textarea[name="content"]', {
  19. cssPath : '<%=basePath%>js/kindeditor/plugins/code/prettify.css',
  20. uploadJson : '<%=basePath%>js/kindeditor/jsp/upload_json.jsp',
  21. fileManagerJson : '<%=basePath%>js/kindeditor/jsp/file_manager_json.jsp',
  22. allowFileManager : false,
  23. allowImageRemote : false,
  24. afterBlur : function() {
  25. this.sync();
  26. },
  27. items : [
  28. 'source', '|', 'preview', '|', 'justifyleft', 'justifycenter', 'justifyright',
  29. 'justifyfull', 'clearhtml', 'quickformat', '|',
  30. 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
  31. 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|',
  32. 'hr', 'emoticons', 'anchor', 'link', 'unlink'
  33. ]
  34. });
  35. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement