forked from joaool/MotherGithub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bb_form1.html
139 lines (116 loc) · 4.03 KB
/
bb_form1.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bbone drag&drop v3.0</title>
</head>
<body>
<!--<script type="text/javascript" charset="utf-8" src="../rivets/dist/rivets.js" ></script>-->
<!-- <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.min.js"></script> -->
<!-- <script src="FL_ui/js/jquery-1.11.1.min.js" type="text/javascript"></script> -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="FL_ui/js/bootstrap.min.js"></script>
<!-- <script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js" type="text/javascript"></script> -->
<script src="FL_ui/js/underscore-min.js" type="text/javascript"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js" type="text/javascript"></script>
<!-- <link href='http://fonts.googleapis.com/css?family=Droid+Serif' rel='stylesheet' type='text/css'> -->
<div class="container">
<h2>FrameLink builder</h2>
<div id="sortable1">
<ul class="connected">
<li>textinput</li>
<li>jumbotron</li>
<li>button</li>
</ul>
</div>
<div>
<h1>xxx</h1>
<hr />
<div class="page"></div>
</div>
</div>
<script type="text/template" id="textinput">
<div class="control-group">
<label class="control-label" for="<%= id %>"><%= label %></label>
<div class="controls">
<input id="<%= id %>" name="<%= id %>" type="text" placeholder="<%= placeholder %>" class="<%= inputsize %>" <% if(required) {%> required <% } %> />
<% if (helptext.length > 0) { %><p class="help-block"><%= helptext %></p><% } %>
</div>
</div>
</script>
<script type="text/template" id="jumbotron">
<div id="_home">
<div class="jumbotron">
<h1><%= name %></h1>
<p><%= text %></p>
<a href="#" class="btn btn-primary btn-large" onclick="FL.showTourStep0 = true; FL.tourIn();"><%= buttonText %></a>
</div>
</div>
</script>
<script type="text/template" id="button">
<div class="control-group">
<label class="control-label" for="<%= id %>"><%= label %></label>
<div class="controls">
<button id="<%= id %>" name="<%= id %>" class='btn <%= buttontype %>'><%= buttonlabel %></button>
</div>
</div>
</script>
<script type="text/javascript">
// Models
window.Wine = Backbone.Model.extend();
window.WineCollection = Backbone.Collection.extend({
model:Wine,
url:"../api/wines"
});
// Views
window.WineListView = Backbone.View.extend({
tagName:'ul',
initialize:function () {
this.model.bind("reset", this.render, this);
},
render:function (eventName) {
_.each(this.model.models, function (wine) {
$(this.el).append(new WineListItemView({model:wine}).render().el);
}, this);
return this;
}
});
window.WineListItemView = Backbone.View.extend({
tagName:"li",
template:_.template($('#tpl-wine-list-item').html()),
render:function (eventName) {
$(this.el).html(this.template(this.model.toJSON()));
return this;
}
});
window.WineView = Backbone.View.extend({
template:_.template($('#tpl-wine-details').html()),
render:function (eventName) {
$(this.el).html(this.template(this.model.toJSON()));
return this;
}
});
// Router
var AppRouter = Backbone.Router.extend({
routes:{
"":"list",
"wines/:id":"wineDetails"
},
list:function () {
this.wineList = new WineCollection();
this.wineListView = new WineListView({model:this.wineList});
this.wineList.fetch();
$('#sidebar').html(this.wineListView.render().el);
},
wineDetails:function (id) {
this.wine = this.wineList.get(id);
this.wineView = new WineView({model:this.wine});
$('#content').html(this.wineView.render().el);
}
});
var app = new AppRouter();
Backbone.history.start();
console.log(document.title+"...... END..");
</script>
</body>
</html>