-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
80 lines (76 loc) · 2.3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="Pragma" content="no-cache" />
<title>Partial Js Demo</title>
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
/>
<link rel="stylesheet" href="css/style.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.11/handlebars.min.js"></script>
</head>
<body>
<div class="row">
<div class="col-md-12">
<partial src="templates/header.html" noscript="true">
<img src="/images/27-0.gif" alt="" />
</partial>
</div>
</div>
<div class="row">
<div class="col-md-3">
<partial src="templates/menu.html" loadafter="2000">
<img src="/images/27-0.gif" alt="loading" /><br />
Loading example
</partial>
</div>
<div class="col-md-9">
<div id="view">
<h1>Partial Js Demo</h1>
<hr />
<a href="https://github.com/darshanmarathe/partialjs">Download</a>
<br />
<img src="/images/27-0.gif" alt="" />
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<partial src="templates/footer.html" onload="Footerloaded">
<img src="/images/27-0.gif" alt="" />
</partial>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.0.0.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script>
function Footerloaded() {
console.log("onload event code works");
}
</script>
<script src="js/partial.js"></script>
<script type="text/javascript">
Handlebars.registerHelper(
"grouped_each",
function (every, context, options) {
var out = "",
subcontext = [],
i;
if (context && context.length > 0) {
for (i = 0; i < context.length; i++) {
if (i > 0 && i % every === 0) {
out += options.fn(subcontext);
subcontext = [];
}
subcontext.push(context[i]);
}
out += options.fn(subcontext);
}
return out;
}
);
</script>
</body>
</html>