You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
3.4 KiB

7 months ago
  1. <!doctype html>
  2. <title>CodeMirror: Full Screen Editing</title>
  3. <meta charset="utf-8"/>
  4. <link rel=stylesheet href="../doc/docs.css">
  5. <link rel="stylesheet" href="../lib/codemirror.css">
  6. <link rel="stylesheet" href="../addon/display/fullscreen.css">
  7. <link rel="stylesheet" href="../theme/night.css">
  8. <script src="../lib/codemirror.js"></script>
  9. <script src="../mode/xml/xml.js"></script>
  10. <script src="../addon/display/fullscreen.js"></script>
  11. <div id=nav>
  12. <a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
  13. <ul>
  14. <li><a href="../index.html">Home</a>
  15. <li><a href="../doc/manual.html">Manual</a>
  16. <li><a href="https://github.com/codemirror/codemirror5">Code</a>
  17. </ul>
  18. <ul>
  19. <li><a class=active href="#">Full Screen Editing</a>
  20. </ul>
  21. </div>
  22. <article>
  23. <h2>Full Screen Editing</h2>
  24. <form><textarea id="code" name="code" rows="5">
  25. <dl>
  26. <dt id="option_indentWithTabs"><code><strong>indentWithTabs</strong>: boolean</code></dt>
  27. <dd>Whether, when indenting, the first N*<code>tabSize</code>
  28. spaces should be replaced by N tabs. Default is false.</dd>
  29. <dt id="option_electricChars"><code><strong>electricChars</strong>: boolean</code></dt>
  30. <dd>Configures whether the editor should re-indent the current
  31. line when a character is typed that might change its proper
  32. indentation (only works if the mode supports indentation).
  33. Default is true.</dd>
  34. <dt id="option_specialChars"><code><strong>specialChars</strong>: RegExp</code></dt>
  35. <dd>A regular expression used to determine which characters
  36. should be replaced by a
  37. special <a href="#option_specialCharPlaceholder">placeholder</a>.
  38. Mostly useful for non-printing special characters. The default
  39. is <code>/[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/</code>.</dd>
  40. <dt id="option_specialCharPlaceholder"><code><strong>specialCharPlaceholder</strong>: function(char) → Element</code></dt>
  41. <dd>A function that, given a special character identified by
  42. the <a href="#option_specialChars"><code>specialChars</code></a>
  43. option, produces a DOM node that is used to represent the
  44. character. By default, a red dot (<span style="color: red"></span>)
  45. is shown, with a title tooltip to indicate the character code.</dd>
  46. <dt id="option_rtlMoveVisually"><code><strong>rtlMoveVisually</strong>: boolean</code></dt>
  47. <dd>Determines whether horizontal cursor movement through
  48. right-to-left (Arabic, Hebrew) text is visual (pressing the left
  49. arrow moves the cursor left) or logical (pressing the left arrow
  50. moves to the next lower index in the string, which is visually
  51. right in right-to-left text). The default is <code>false</code>
  52. on Windows, and <code>true</code> on other platforms.</dd>
  53. </dl>
  54. </textarea></form>
  55. <script>
  56. var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  57. lineNumbers: true,
  58. theme: "night",
  59. extraKeys: {
  60. "F11": function(cm) {
  61. cm.setOption("fullScreen", !cm.getOption("fullScreen"));
  62. },
  63. "Esc": function(cm) {
  64. if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
  65. }
  66. }
  67. });
  68. </script>
  69. <p>Demonstration of
  70. the <a href="../doc/manual.html#addon_fullscreen">fullscreen</a>
  71. addon. Press <strong>F11</strong> when cursor is in the editor to
  72. toggle full screen editing. <strong>Esc</strong> can also be used
  73. to <i>exit</i> full screen editing.</p>
  74. </article>