openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

search.html (4542B)


      1 <!doctype html>
      2 
      3 <title>CodeMirror: Search/Replace Demo</title>
      4 <meta charset="utf-8"/>
      5 <link rel=stylesheet href="../doc/docs.css">
      6 
      7 <link rel="stylesheet" href="../lib/codemirror.css">
      8 <link rel="stylesheet" href="../addon/dialog/dialog.css">
      9 <link rel="stylesheet" href="../addon/search/matchesonscrollbar.css">
     10 <script src="../lib/codemirror.js"></script>
     11 <script src="../mode/xml/xml.js"></script>
     12 <script src="../addon/dialog/dialog.js"></script>
     13 <script src="../addon/search/searchcursor.js"></script>
     14 <script src="../addon/search/search.js"></script>
     15 <script src="../addon/scroll/annotatescrollbar.js"></script>
     16 <script src="../addon/search/matchesonscrollbar.js"></script>
     17 <script src="../addon/search/jump-to-line.js"></script>
     18 <style type="text/css">
     19       .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
     20       dt {font-family: monospace; color: #666;}
     21     </style>
     22 <div id=nav>
     23   <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
     24 
     25   <ul>
     26     <li><a href="../index.html">Home</a>
     27     <li><a href="../doc/manual.html">Manual</a>
     28     <li><a href="https://github.com/codemirror/codemirror">Code</a>
     29   </ul>
     30   <ul>
     31     <li><a class=active href="#">Search/Replace</a>
     32   </ul>
     33 </div>
     34 
     35 <article>
     36 <h2>Search/Replace Demo</h2>
     37 <form><textarea id="code" name="code">
     38 <dl>
     39   <dt id="option_indentWithTabs"><code><strong>indentWithTabs</strong>: boolean</code></dt>
     40   <dd>Whether, when indenting, the first N*<code>tabSize</code>
     41   spaces should be replaced by N tabs. Default is false.</dd>
     42 
     43   <dt id="option_electricChars"><code><strong>electricChars</strong>: boolean</code></dt>
     44   <dd>Configures whether the editor should re-indent the current
     45   line when a character is typed that might change its proper
     46   indentation (only works if the mode supports indentation).
     47   Default is true.</dd>
     48 
     49   <dt id="option_specialChars"><code><strong>specialChars</strong>: RegExp</code></dt>
     50   <dd>A regular expression used to determine which characters
     51   should be replaced by a
     52   special <a href="#option_specialCharPlaceholder">placeholder</a>.
     53   Mostly useful for non-printing special characters. The default
     54   is <code>/[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/</code>.</dd>
     55   <dt id="option_specialCharPlaceholder"><code><strong>specialCharPlaceholder</strong>: function(char) → Element</code></dt>
     56   <dd>A function that, given a special character identified by
     57   the <a href="#option_specialChars"><code>specialChars</code></a>
     58   option, produces a DOM node that is used to represent the
     59   character. By default, a red dot (<span style="color: red">•</span>)
     60   is shown, with a title tooltip to indicate the character code.</dd>
     61 
     62   <dt id="option_rtlMoveVisually"><code><strong>rtlMoveVisually</strong>: boolean</code></dt>
     63   <dd>Determines whether horizontal cursor movement through
     64   right-to-left (Arabic, Hebrew) text is visual (pressing the left
     65   arrow moves the cursor left) or logical (pressing the left arrow
     66   moves to the next lower index in the string, which is visually
     67   right in right-to-left text). The default is <code>false</code>
     68   on Windows, and <code>true</code> on other platforms.</dd>
     69 </dl>
     70 </textarea></form>
     71 
     72     <script>
     73 var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
     74   mode: "text/html",
     75   lineNumbers: true,
     76   extraKeys: {"Alt-F": "findPersistent"}
     77 });
     78 </script>
     79 
     80     <p>Demonstration of primitive search/replace functionality. The
     81     keybindings (which can be configured with custom keymaps) are:</p>
     82     <dl>
     83       <dt>Ctrl-F / Cmd-F</dt><dd>Start searching</dd>
     84       <dt>Ctrl-G / Cmd-G</dt><dd>Find next</dd>
     85       <dt>Shift-Ctrl-G / Shift-Cmd-G</dt><dd>Find previous</dd>
     86       <dt>Shift-Ctrl-F / Cmd-Option-F</dt><dd>Replace</dd>
     87       <dt>Shift-Ctrl-R / Shift-Cmd-Option-F</dt><dd>Replace all</dd>
     88       <dt>Alt-F</dt><dd>Persistent search (dialog doesn't autoclose,
     89       enter to find next, Shift-Enter to find previous)</dd>
     90       <dt>Alt-G</dt><dd>Jump to line</dd>
     91     </dl>
     92     <p>Searching is enabled by
     93     including <a href="../addon/search/search.js">addon/search/search.js</a>
     94     and <a href="../addon/search/searchcursor.js">addon/search/searchcursor.js</a>.
     95     Jump to line - including <a href="../addon/search/jump-to-line.js">addon/search/jump-to-line.js</a>.</p>
     96     <p>For good-looking input dialogs, you also want to include
     97     <a href="../addon/dialog/dialog.js">addon/dialog/dialog.js</a>
     98     and <a href="../addon/dialog/dialog.css">addon/dialog/dialog.css</a>.</p>
     99   </article>