delay-renderer-preview.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>Delay Rerender & Preview - Editor.md examples</title>
  6. <link rel="stylesheet" href="css/style.css" />
  7. <link rel="stylesheet" href="../css/editormd.css" />
  8. <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
  9. </head>
  10. <body>
  11. <div id="layout">
  12. <header>
  13. <h1>Delay Rerender & Preview</h1>
  14. <p>P.S. If you input the content too much and too fast, You can setting the delay value. </p>
  15. <p>P.S. 适用于输入内容太多太快的情形,但要是一个合理的值,不然会显得预览太慢。打字慢会相对显得慢,打字快时则相对显得快。</p>
  16. </header>
  17. <div id="test-editormd">
  18. <textarea style="display:none;">#### Setting
  19. {
  20. delay : 300 // Uint : ms, default value is 300, and this example is set value 1000
  21. }
  22. </textarea>
  23. </div>
  24. </div>
  25. <script src="js/jquery.min.js"></script>
  26. <script src="../editormd.js"></script>
  27. <script type="text/javascript">
  28. var testEditor;
  29. $(function() {
  30. $.get("test.md", function(md) {
  31. testEditor = editormd("test-editormd", {
  32. width : "90%",
  33. height : 640,
  34. path : "../lib/",
  35. delay : 1000,
  36. appendMarkdown : md,
  37. codeFold : true,
  38. saveHTMLToTextarea : true,
  39. searchReplace : true,
  40. htmlDecode : "style,script,iframe",
  41. emoji : true,
  42. taskList : true,
  43. tex : true,
  44. flowChart : true,
  45. sequenceDiagram : true
  46. });
  47. });
  48. });
  49. </script>
  50. </body>
  51. </html>