-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.html
80 lines (73 loc) · 3.3 KB
/
template.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>
<head>
<title>Examples</title>
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/template.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('body').template({
'first_name':'Harris',
'last_name':'Tzovanakis',
'age':23,
'showMeta':'Show Meta',
'showTable':'Show Table',
'caption':'Meres me liakada',
'test': false,
'meta':[
{'key':'1st Key', 'value':'1st Value'},
{'key':'2nd Key', 'value':'2nd Value'},
{'key':'3rd Key', 'value':'3rd Value'},
{'key':'3rd Key', 'value':'3rd Value'},
{'key':'3rd Key', 'value':'3rd Value'},
{'key':'3rd Key', 'value':'3rd Value'},
{'key':'3rd Key', 'value':'3rd Value'},
{'key':'3rd Key', 'value':'3rd Value'},
{'key':'3rd Key', 'value':'3rd Value'},
{'key':'3rd Key', 'value':'3rd Value'},
{'key':'3rd Key', 'value':'3rd Value'},
{'key':'3rd Key', 'value':'3rd Value'},
{'key':'3rd Key', 'value':'3rd Value'},
{'key':'3rd Key', 'value':'3rd Value'},
{'key':'3rd Key', 'value':'3rd Value'},
],
'vagos':[
{'name':'Takis','last':'Delivorias'},
{'name':'Sotos','last':'Karolos'},
{'name':'Zozela','last':'Papoulias'},
{'name':'Flash','last':'Orestis'},
{'name':'Niko','last':'TAkis'},
{'name':'Parios','last':'Vasdsds'}
],
});
})
</script>
</head>
<body>
<div data-replace="first_name"></div>
<div data-replace="last_name"></div>
<div data-replace="age"></div>
<div data-replace="title"></div>
<a href="javascript:void(0)" data-toggle="#meta" data-replace="showMeta"></a>
<div id="meta" data-repeat="meta">
<div data-replace="key"></div>
<div data-replace="value"></div>
</div>
<ul data-repeat="vagos">
<li><span data-replace="name"></span> | <span data-replace="last"></span></li>
</ul>
<a href="javascript:void(0)" data-toggle="#table" data-replace="showTable">Show/Hide</a>
<table border="1" id="table" data-repeat="vagos">
<tr>
<td style="color:green"><div data-replace="name"></div></td>
<td><div data-replace="last"></div></td>
</tr>
</table>
<div data-logic="!caption">
<div style="color:red" data-replace="caption"></div>
</div>
<div data-logic="!test">
Sorry, the test is empty
</div>
</body>
</html>