File: theme.html

package info (click to toggle)
movabletype-opensource 5.1.4%2Bdfsg-4%2Bdeb7u3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 32,996 kB
  • sloc: perl: 197,285; php: 62,405; sh: 166; xml: 117; makefile: 83; sql: 32
file content (60 lines) | stat: -rw-r--r-- 1,770 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!doctype html>
<html>
  <head>
    <title>CodeMirror: Theme Demo</title>
    <link rel="stylesheet" href="../lib/codemirror.css">
    <script src="../lib/codemirror.js"></script>
    <link rel="stylesheet" href="../theme/neat.css">
    <link rel="stylesheet" href="../theme/elegant.css">
    <link rel="stylesheet" href="../theme/night.css">
    <link rel="stylesheet" href="../theme/monokai.css">
    <link rel="stylesheet" href="../theme/cobalt.css">
    <link rel="stylesheet" href="../theme/eclipse.css">
    <link rel="stylesheet" href="../theme/rubyblue.css">
    <script src="../mode/javascript/javascript.js"></script>
    <link rel="stylesheet" href="../doc/docs.css">

    <style type="text/css">
      .CodeMirror {border: 1px solid black;}
    </style>
  </head>
  <body>
    <h1>CodeMirror: Theme demo</h1>

    <form><textarea id="code" name="code">
function findSequence(goal) {
  function find(start, history) {
    if (start == goal)
      return history;
    else if (start > goal)
      return null;
    else
      return find(start + 5, "(" + history + " + 5)") ||
             find(start * 3, "(" + history + " * 3)");
  }
  return find(1, "1");
}</textarea></form>

<p>Select a theme: <select onchange="selectTheme(this)">
    <option selected>default</option>
    <option>night</option>
    <option>monokai</option>
    <option>neat</option>
    <option>elegant</option>
    <option>cobalt</option>
    <option>eclipse</option>
    <option>rubyblue</option>
</select>
</p>

<script>
  var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
    lineNumbers: true
  });
  function selectTheme(node) {
    var theme = node.options[node.selectedIndex].innerHTML;
    editor.setOption("theme", theme);
  }
</script>
  </body>
</html>