-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.xhtml
53 lines (35 loc) · 1.4 KB
/
index.xhtml
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
<?xml version='1.0' encoding='UTF-8'?>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title> CoffeeScript </title>
<script src="helpers.js"/>
<script src="coffee-script.js"/>
<style>
coffeescript { display: none;}
textarea, pre { width: 400px; height: 200px; position: absolute; top: 20px;}
textarea {color: transparent; }
pre { color: green; }
</style>
<script type="text/javascript" src="syntaxhighlighter_3.0.83/scripts/shCore.js"></script>
<script type="text/javascript" src="syntaxhighlighter_3.0.83/scripts/shBrushJScript.js"></script>
<link type="text/css" rel="stylesheet" href="syntaxhighlighter_3.0.83/styles/shCoreMidnight.css"/>
</head>
<body>
<coffeescript><![CDATA[
b = new SyntaxHighlighter.brushes.JScript()
b.init( { toolbar: false})
colorlayer = Node 'pre', {}
toplayer = Node 'textarea', {spellcheck: 'false'}, ['Sample text']
toplayer.oninput = () ->
html = b.getHtml( toplayer.value ).replace(/ /g, " ")
colorlayer.innerHTML = html
document.body.append( toplayer)
document.body.append( colorlayer )
toplayer.focus()
window.toplayer = toplayer
]]></coffeescript>
<script><![CDATA[
document.getElementsByTagName("coffeescript").forEach( function(i) { CoffeeScript.eval(i.textContent);} )
]]></script>
</body>
</html>