Fix: merge conflict
[myslice.git] / third-party / codemirror-3.15 / mode / javascript / typescript.html
1 <!doctype html>
2 <html>
3   <head>
4     <meta charset="utf-8">
5     <title>CodeMirror: TypeScript mode</title>
6     <link rel="stylesheet" href="../../lib/codemirror.css">
7     <script src="../../lib/codemirror.js"></script>
8     <script src="javascript.js"></script>
9     <link rel="stylesheet" href="../../doc/docs.css">
10     <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11   </head>
12   <body>
13     <h1>CodeMirror: TypeScript mode</h1>
14
15 <div><textarea id="code" name="code">
16 class Greeter {
17         greeting: string;
18         constructor (message: string) {
19                 this.greeting = message;
20         }
21         greet() {
22                 return "Hello, " + this.greeting;
23         }
24 }   
25
26 var greeter = new Greeter("world");
27
28 var button = document.createElement('button')
29 button.innerText = "Say Hello"
30 button.onclick = function() {
31         alert(greeter.greet())
32 }
33
34 document.body.appendChild(button)
35
36 </textarea></div>
37
38     <script>
39       var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
40         lineNumbers: true,
41         matchBrackets: true,
42         mode: "text/typescript"
43       });
44     </script>
45
46     <p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>
47   </body>
48 </html>