-
Notifications
You must be signed in to change notification settings - Fork 13
/
example2.html
66 lines (53 loc) · 1.73 KB
/
example2.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
<!DOCTYPE HTML>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title>jQuery AutoBars Example</title>
<script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.min.js" type="text/javascript" charset="utf-8"></script>
<script src="src/jquery-autobars.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
var callback_function = function() {
var $html = $.handlebarTemplates['test1']({
message: "test 1"
});
$('body').append($html);
var $html = $.handlebarTemplates['test2']({
message: "test 2"
});
$('body').append($html);
var $html = $.handlebarTemplates['test3']({
message: "test 3"
});
$('body').append($html);
var $html = $.handlebarTemplates['test4']({
message: "test 4"
});
$('body').append($html);
var $html = $.handlebarTemplates['test5']({
message: "test 5"
});
$('body').append($html);
};
var template_list = [
'templates/test1.hbs',
'templates/test2.hbs',
'templates/test3.hbs',
'templates/test4.hbs',
'templates/test5.hbs'
]
var partial_list = [
'templates/partial1.hbs'
]
$(document).autoBars({
callback: callback_function,
main_template_from_list: template_list,
partial_template_from_list: partial_list
});
})
</script>
</head>
<body>
<h1 id="header">Minimalistically awesome</h1>
<p>Minimalist templates on steroids</p>
</body>