-
Notifications
You must be signed in to change notification settings - Fork 0
/
backboneTest.html
71 lines (67 loc) · 1.94 KB
/
backboneTest.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
<!doctype html>
<html>
<head>
<title>Backbone/Marionette basic setup with nested views</title>
<style type="text/css">
body {
background: #ffffff;
}
#AppBase {
width: 400px;
margin: 10px auto;
padding: 0;
outline: 1px solid #ff0e16;
}
#AppContainer {
width: 400px;
margin: 0;
padding: 0;
}
h1 {
width:100%;
margin: 0;
padding: 0;
text-align: center;
border-bottom: 1px solid #808080;
}
ul {
margin: 1em 0 0 0;
padding:0;
list-style-type: none;
width: 400px;
}
li {
margin-bottom: .5em;
padding: 0 0 .5em 1em;
border-bottom: 1px solid #dedede;
}
</style>
</head>
<body>
<!-- Base element for app -->
<!--
Dont use the BODY element as the base because when the app renders in the BODY
it will wipe out the template files before the views can pick them up
-->
<div id="AppBase"></div>
<!-- TEMPLATES -->
<!-- main layout template -->
<script type="text/template" id="layout-template">
<h1>Main Template</h1>
<div id="regionOne"></div>
</script>
<!-- bookItemView template -->
<!-- This used the Underscore templating system, which is built into Marionette.js -->
<script type="text/template" id="itemView-template">
<span><b>Title</b>: <%- title %></span><br/>
<span><b>Author</b>: <%- authorLast %>, <%- authorFirst %></span>
</script>
<!-- libraries -->
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/underscore.js"></script>
<script type="text/javascript" src="js/backbone.js"></script>
<script type="text/javascript" src="js/backbone.marionette.js"></script>
<!-- app code -->
<script type="text/javascript" src="backboneTest.js"></script>
</body>
</html>