-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
91 lines (69 loc) · 2.4 KB
/
index.html
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!doctype html>
<title>CodeMirror</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.38.0/codemirror.min.css">
<link rel=stylesheet href="addon/hint/show-hint.css">
<link rel=stylesheet href="doc/docs.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.38.0/codemirror.min.js"></script>
<script src="mode/javascript/javascript.js"></script>
<script src="mode/velocity/velocity.js"></script>
<script src="mode/python/python.js"></script>
<script src="addon/hint/show-hint.js"></script>
<script src="addon/hint/anyword-hint.js"></script>
<script src="addon/hint/velocity-hint.js"></script>
<script src="addon/display/autorefresh.js"></script>
<!--
<script src="addon/hint/anyword-hint.js"></script>
-->
<style>
body {
background-color: #eee;
}
</style>
<article>
<section id="demo">
<h2> Text Editor Demo </h2>
<form style="position: relative; margin-top: .5em;">
<textarea id="code" name="code">
#define( $hello ) Hello $who #end #set( $who = "World!") $hello ## displays Hello World!
#foreach( $customer in $customerList )
$foreach.count $customer.Name
#if( $foo == ${bar})
it's true!
#break
#{else}
it's not!
#stop
#end
#if ($foreach.parent.hasNext)
$velocityCount
#end
#end
$someObject.getValues("this is a string split
across lines")
$someObject("This plus $something in the middle").method(7567).property
#set($something = "Parseable string with '$quotes'!")
#macro( tablerows $color $somelist )
#foreach( $something in $somelist )
<tr><td bgcolor=$color>$something</td></tr>
<tr><td bgcolor=$color>$bodyContent</td></tr>
#end
#end
</textarea>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
extraKeys: {"Ctrl-Space": "autocomplete"},
mode: {name: "velocity", globalVars: true},
autoRefresh:true
//hintOptions : {hint: synonyms}
});
// editor.on("keyup", function (cm, event) {
// if (!cm.state.completionActive && /*Enables keyboard navigation in autocomplete list*/
// event.keyCode != 13) { /*Enter - do not open autocomplete list just after item has been selected in it*/
// CodeMirror.commands.autocomplete(cm, null, {completeSingle: false});
// }
// });
</script>
</section>
</article>