forked from canjs/canjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.html
80 lines (74 loc) · 2.06 KB
/
view.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>view</title>
<style>
body{
font-family: verdana;
}
pre {
font-family: "Courier New", Courier, monospace;
}
.out {
border: dashed 1px blue;
}
.temp{
border: dashed 1px red;
}
h2 {
font-size: 1em;
font-weight: bold;
color: green;
}
h3 {font-size: 0.95em;}
</style>
</head>
<body>
<h2>JAML</h2>
<pre><code class='javascript'>$("#jaml").html("template.jaml",{message: "Hello World"})</code></pre>
<pre class='temp' id='temp'><code>function(data) {
h3(data.message);
}</code></pre>
<div id='jaml' class='out'></div>
<h2>EJS</h2>
<pre><code class='javascript'>$("#ejs").html("template.ejs",{message: "Hello World"})</code></pre>
<pre class='temp'><h3><%= message %></h3></pre>
<div id='ejs' class='out'></div>
<h2>MICRO</h2>
<pre><code class='javascript'>$("#micro").html("template.micro",{message: "Hello World"})</code></pre>
<pre class='temp'><h3>{%= message %}</h3></pre>
<div id='micro' class='out'></div>
<h2>TMPL</h2>
<pre><code class='javascript'>$("#tmpl").html("template.tmpl",{message: "Hello World"})</code></pre>
<pre class='temp'><h3>{%= message %}</h3></pre>
<div id='tmpl' class='out'></div>
<script type='text/javascript' src='../../steal/steal.js'>
</script>
<script type='text/javascript'>
steal('jquery/view/jaml',
'jquery/view/micro',
'jquery/view/ejs',
'jquery/view/tmpl')
.then(function(){
$.each(["micro","ejs","jaml",'tmpl'], function(){
$("#"+this).html("test//template."+this,{"message" :"Hello World"})
})
}) .then("//jmvcdoc/resources/highlight",
'//jmvcdoc/resources/languages/javascript',
'//jmvcdoc/resources/languages/www',
function(){
var names = []
$("code").each(function(){
names.push( this.parentNode.className)
})
hljs.initHighlighting();
$(function(){
$.each($("code"),function(i){
this.parentNode.className = names[i];
})
})
});
</script>
</body>
</html>