-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
81 lines (72 loc) · 2.18 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
<!DOCTYPE html>
<html>
<head>
<title>Template • templating the jQuery way</title>
<link href="docs/style.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="docs/code_highlighter.js"></script>
<script src="docs/syntax.js"></script>
<script src="src/template.js"></script>
<script>
var Feature, Word;
$(function() {
Feature = Template($("#feature"), function(title, text) {
this.find("h3").text(title)
this.find("p").text(text)
})
Word = Template("<span>")
$("#features").append(
new Feature("Amazing", "Sounds cool!"),
new Feature("Brilliant", "Ok ok..."),
new Feature("Capital", "...capital?"),
new Word().text("And "),
new Word().text("some "),
new Word().text("more "),
new Word().text("words "),
new Word().text("here.")
)
})
</script>
</head>
<body>
<div id="container">
<h1>Template</h1>
<p class="subtitle">Templating the jQuery way</p>
<p class="beware">Beware: name and functionality are likely to change!</p>
<div id="features"></div>
<h2>Example</h2>
<p>The above was generated with:</p>
<pre><code class="javascript">Feature = Template($("#feature"), function(title, text) {
this.find("h3").text(title)
this.find("p").text(text)
})
Word = Template("<span>")
$("#features").append(
new Feature("Amazing", "Sounds cool!"),
new Feature("Brilliant", "Ok ok..."),
new Feature("Capital", "...capital?")
new Word().text("And "),
new Word().text("some "),
new Word().text("more "),
new Word().text("words "),
new Word().text("here.")
)</code></pre>
</div>
<div id="fork-me"><a href="http://github.com/benpickles/template">Fork me on GitHub</a></div>
<div id="templates">
<div id="feature">
<h3></h3>
<p></p>
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-117680-14");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>