old.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>NKeditor 在线编辑器 PHP demo</title>
  6. <script charset="utf-8" src="NKeditor-all.js"></script>
  7. <!-- 下面是外部插件不是必须引入的 -->
  8. <script charset="utf-8" src="libs/jquery.min.js"></script>
  9. <script charset="utf-8" src="libs/JDialog/JDialog.min.js"></script>
  10. <script>
  11. KindEditor.ready(function(K) {
  12. K.create('textarea[name="content1"]', {
  13. uploadJson : K.basePath+'php/qiniu/upload_json.php',
  14. fileManagerJson : K.basePath+'php/qiniu/file_manager_json.php',
  15. dialogOffset : 0, //对话框距离页面顶部的位置,默认为0居中,
  16. allowFileManager : true,
  17. allowImageUpload : true,
  18. allowMediaUpload : true,
  19. afterCreate : function() {
  20. var self = this;
  21. K.ctrl(document, 13, function() {
  22. self.sync();
  23. K('form[name=example]')[0].submit();
  24. });
  25. K.ctrl(self.edit.doc, 13, function() {
  26. self.sync();
  27. K('form[name=example]')[0].submit();
  28. });
  29. },
  30. themeType : "default", //主题
  31. //错误处理 handler
  32. errorMsgHandler : function(message, type) {
  33. try {
  34. JDialog.msg({type:type, content:message, timer:2000});
  35. } catch (Error) {
  36. alert(message);
  37. }
  38. }
  39. });
  40. });
  41. </script>
  42. </head>
  43. <body>
  44. <form name="example" method="post" style="margin-top: 20px;">
  45. <textarea name="content1" style="width:900px;height:500px;visibility:hidden;"></textarea>
  46. </form>
  47. </body>
  48. </html>