move a few things away in to-be-integrated/
[myslice.git] / to-be-integrated / third-party / codemirror-3.15 / demo / visibletabs.html
1 <!doctype html>
2 <html>
3   <head>
4     <meta charset="utf-8">
5     <title>CodeMirror: Visible tabs demo</title>
6     <link rel="stylesheet" href="../lib/codemirror.css">
7     <script src="../lib/codemirror.js"></script>
8     <script src="../mode/clike/clike.js"></script>
9     <link rel="stylesheet" href="../doc/docs.css">
10
11     <style type="text/css">
12       .CodeMirror {border-top: 1px solid #eee; border-bottom: 1px solid #eee;}
13       .cm-tab {
14          background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=);
15          background-position: right;
16          background-repeat: no-repeat;
17       }
18     </style>
19   </head>
20   <body>
21     <h1>CodeMirror: Visible tabs demo</h1>
22
23     <form><textarea id="code" name="code">
24 #include "syscalls.h"
25 /* getchar:  simple buffered version */
26 int getchar(void)
27 {
28         static char buf[BUFSIZ];
29         static char *bufp = buf;
30         static int n = 0;
31         if (n == 0) {  /* buffer is empty */
32                 n = read(0, buf, sizeof buf);
33                 bufp = buf;
34         }
35         return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
36 }
37 </textarea></form>
38
39 <p>Tabs inside the editor are spans with the
40 class <code>cm-tab</code>, and can be styled.</p>
41
42     <script>
43       var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
44         lineNumbers: true,
45         tabSize: 4,
46         indentUnit: 4,
47         indentWithTabs: true,
48         mode: "text/x-csrc"
49       });
50     </script>
51
52   </body>
53 </html>