-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
87 lines (75 loc) · 1.91 KB
/
index.html
File metadata and controls
87 lines (75 loc) · 1.91 KB
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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="dist/code-lighter.css">
<script type="text/javascript" src="dist/code-lighter.js"></script>
<script type="text/javascript">
window.onload = function () {
//comment
var code = lighter.code({target: document.getElementById('htmlarea'), language:'html', style: 'light'});
var code2 = lighter.code({target: document.getElementById('javascriptarea'), language:'javascript', style: 'light'});
var code3 = lighter.code({target: document.getElementById('cssarea'), language:'css', style: 'light'});
code.on();
code2.on();
code3.on();
var on = true;
lighter.addEventHandler(document.getElementById('toggle'), 'click', function(){
if (on) {
on = false;
code.off();
code2.off();
code3.off();
}else{
on = true;
code.on();
code2.on();
code3.on();
}
});
}
</script>
</head>
<body>
<pre><div id="cssarea">#hi, tagname{
background: #eee;
margin: 1px 2px 0 4px;
font-family: "microsoft Yahei", Sans;
background-image: url("./logo.gif");
-webkit-box-shadow: 5px 5px 15px #fff;
transform: rotate(3deg);
}</div></pre>
<pre><div id="htmlarea"><span class='welcome'>hi</span>
<!-- ok -->
<script type='text/javascript'></script>
<!-- half comment</div></pre>
<pre><div id="javascriptarea" codelighter="javascript">//comment
function helloworld() {
var x = 1.5 + 6;
if (x > 5) {
alert("x:" + x);
}
windows.onload = function(){
document.write('yes');
document.write("n\"o");
}
var str = "fs\
fds\
";
var k256 = [1, 2, 3, 4];
for (var i = 0; i < 10; i++) {
console.log(i);
}
(function(){
console.log('hello world');
/*
* this is block comment
*
* a new line
*/
}());
alert("he\"llo");
}
</div></pre>
<button id="toggle">Toggle Highlight</button>
</body>
</html>