File modules/editor/codemirror/demo/sublime.html
Last commit: Tue May 22 22:39:49 2018 +0200 Jan Dankert Fix für PHP 7.2: 'Object' darf nun nicht mehr als Klassennamen verwendet werden. AUCH NICHT IN EINEM NAMESPACE! WTF, wozu habe ich das in einen verfickten Namespace gepackt? Wozu soll der sonst da sein??? Amateure. Daher nun notgedrungen unbenannt in 'BaseObject'.
1 <!doctype html> 2 3 <title>CodeMirror: Sublime Text bindings 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/fold/foldgutter.css"> 9 <link rel="stylesheet" href="../addon/dialog/dialog.css"> 10 <link rel="stylesheet" href="../theme/monokai.css"> 11 <script src="../lib/codemirror.js"></script> 12 <script src="../addon/search/searchcursor.js"></script> 13 <script src="../addon/search/search.js"></script> 14 <script src="../addon/dialog/dialog.js"></script> 15 <script src="../addon/edit/matchbrackets.js"></script> 16 <script src="../addon/edit/closebrackets.js"></script> 17 <script src="../addon/comment/comment.js"></script> 18 <script src="../addon/wrap/hardwrap.js"></script> 19 <script src="../addon/fold/foldcode.js"></script> 20 <script src="../addon/fold/brace-fold.js"></script> 21 <script src="../mode/javascript/javascript.js"></script> 22 <script src="../keymap/sublime.js"></script> 23 <style type="text/css"> 24 .CodeMirror {border-top: 1px solid #eee; border-bottom: 1px solid #eee; line-height: 1.3; height: 500px} 25 .CodeMirror-linenumbers { padding: 0 8px; } 26 </style> 27 <div id=nav> 28 <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a> 29 30 <ul> 31 <li><a href="../index.html">Home</a> 32 <li><a href="../doc/manual.html">Manual</a> 33 <li><a href="https://github.com/codemirror/codemirror">Code</a> 34 </ul> 35 <ul> 36 <li><a class=active href="#">Sublime bindings</a> 37 </ul> 38 </div> 39 40 <article> 41 <h2>Sublime Text bindings demo</h2> 42 43 <p>The <code>sublime</code> keymap defines many Sublime Text-specific 44 bindings for CodeMirror. See the code below for an overview.</p> 45 46 <p>Enable the keymap by 47 loading <a href="../keymap/sublime.js"><code>keymap/sublime.js</code></a> 48 and setting 49 the <a href="../doc/manual.html#option_keyMap"><code>keyMap</code></a> 50 option to <code>"sublime"</code>.</p> 51 52 <p>(A lot of the search functionality is still missing.) 53 54 <script> 55 var value = "// The bindings defined specifically in the Sublime Text mode\nvar bindings = {\n"; 56 var map = CodeMirror.keyMap.sublime; 57 for (var key in map) { 58 var val = map[key]; 59 if (key != "fallthrough" && val != "..." && (!/find/.test(val) || /findUnder/.test(val))) 60 value += " \"" + key + "\": \"" + val + "\",\n"; 61 } 62 value += "}\n\n// The implementation of joinLines\n"; 63 value += CodeMirror.commands.joinLines.toString().replace(/^function\s*\(/, "function joinLines(").replace(/\n /g, "\n") + "\n"; 64 var editor = CodeMirror(document.body.getElementsByTagName("article")[0], { 65 value: value, 66 lineNumbers: true, 67 mode: "javascript", 68 keyMap: "sublime", 69 autoCloseBrackets: true, 70 matchBrackets: true, 71 showCursorWhenSelecting: true, 72 theme: "monokai", 73 tabSize: 2 74 }); 75 </script> 76 77 </article>
Downloadmodules/editor/codemirror/demo/sublime.html
History Tue, 22 May 2018 22:39:49 +0200 Jan Dankert Fix für PHP 7.2: 'Object' darf nun nicht mehr als Klassennamen verwendet werden. AUCH NICHT IN EINEM NAMESPACE! WTF, wozu habe ich das in einen verfickten Namespace gepackt? Wozu soll der sonst da sein??? Amateure. Daher nun notgedrungen unbenannt in 'BaseObject'.