Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

53 lines
1.2KB

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
  7. <meta name="HandheldFriendly" content="True" />
  8. <title>Editor</title>
  9. <style type="text/css" media="screen">
  10. body {
  11. overflow: hidden;
  12. }
  13. #editor {
  14. margin: 0;
  15. position: absolute;
  16. top: 0;
  17. bottom: 0;
  18. left: 0;
  19. right: 0;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <pre id="editor"></pre>
  25. <script src="src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
  26. <script>
  27. var editor = ace.edit("editor");
  28. editor.setOptions({
  29. mode: "ace/mode/markdown",
  30. theme: "ace/theme/twilight",
  31. showPrintMargin: false,
  32. wrap: true,
  33. indentedSoftWrap: true,
  34. showFoldWidgets: false,
  35. showLineNumbers: true,
  36. showGutter: false,
  37. autoScrollEditorIntoView: true
  38. })
  39. editor.setValue(localStorage.getItem("acetest"));
  40. editor.clearSelection();
  41. editor.getSession().on('change', function () {
  42. localStorage.setItem("acetest", editor.getSession().getValue());
  43. });
  44. </script>
  45. </body>
  46. </html>