forked from evoluteur/evolutility-ui-jquery
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·184 lines (135 loc) · 5.94 KB
/
Copy pathindex.html
File metadata and controls
executable file
·184 lines (135 loc) · 5.94 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Evolutility.js</title>
<meta name="description" content="Evolutility :: UI models for your Backbone models" /></head>
<meta name="keywords" content="UI Backbone model view open source metadata driven SPA single page app application generic MDDA MDA CRUD framework Bootstrap" />
<link id="bwCSS" href="dist/css/vendors.min.css" rel="stylesheet" />
<link href="dist/css/demo.css" rel="stylesheet" />
<link href="dist/css/evolutility.min.css" rel="stylesheet" />
<script src="dist/vendors.min.js" type="text/javascript"></script>
<script src="dist/evolutility.min.js" type="text/javascript"></script>
<script src="demo/demo-ui.min.js" type="text/javascript"></script>
</head>
<body>
<div class="evo-header">
<div class="evo-logo"><a href="index.html"><span>evol</span>utility<span>.js</span></a></div>
<ul class="evo-head-links">
<li><a href="demo/index.html">demo</a></li>
<li><a href="doc/index.html">doc</a></li>
<li><a href="https://github.com/evoluteur/evolutility" target="_new">GitHub</a></li>
</ul>
<div class="clearfix"></div>
</div>
<div class="evo-title" >
<h1 class="title1" style="color: white">UI models for your Backbone models</h1>
<h1 class="title1"><span class="title2" >+ a set of Backbone views which can change form, volume and structure based on a UI-model.</span></h1>
</div>
<div class="evo-content">
<h4 class="mt20">
Evolutility is currently v0.3.6 and a work in progress on <a href="https://github.com/evoluteur/evolutility" target="ghe">GitHub</a>.
</h4>
<p>Evolutility provides a set of generic Backbone Views to
browse, edit, filter, export and chart
Backbone models and collections of different structures.
</p>
<p> </p>
<h4 class="mt20">A few examples</h4>
<div id="evol-views-params" >
<div>UI Model:
<select id="evolModel" class="form-control" style="width:auto">
<option value="todo">To Do</option>
<option value="contact">AddressBook</option>
<option value="winecellar">Wine Cellar</option>
</select>
</div>
<div>View:
<select id="evolView" class="form-control" style="width:auto">
<optgroup label="One = model">
<option value="view">View</option>
<option value="edit" selected="selected">Edit</option>
<option value="mini">Mini</option>
<option value="json">JSON</option>
</optgroup>
<optgroup label="Many = collection">
<option value="list">List</option>
<option value="badges">Badges</option>
<option value="charts">Charts</option>
</optgroup>
<optgroup label="Action">
<option value="export">Export</option>
<option value="filter">Filter</option>
</optgroup>
</select>
</div>
<p class="clearfix"></p>
</div>
<div id="evol1"></div>
<p> </p>
<h4 class="mt20">UI models rather than templates</h4>
<p>In the former examples all views are configured with metadata in UI-models.</p>
<p>For each Backbone model and collection, a single UI model contains all the metadata necessary
to configure its views (list, view, edit, filter, export...).
UI models map model attributes to form fields and organize fields into lists, panels and tabs.
</p>
<p>Here are the sample UI models used in the examples above:
<a href="javascript:showUIModel('todo')">To Do</a>,
<a href="javascript:showUIModel('contact')">Addressbook</a>,
<a href="javascript:showUIModel('winecellar')">Wine Cellar</a>.
<small id="hide_def" style="display:none;"><a href="javascript:hideUIModel()">[Hide]</a></small>
</p>
<div style="display:none;" id="uimodel"></div>
<p> </p>
<h4 class="mt20">Demo</h4>
<p>With a toolbar and a router, a set of views can act together as a single page app.
</p>
<p>Demo apps:
<a href="demo/index.html#todo/badges">To Do</a>,
<a href="demo/index.html#contact">Addressbook</a>,
<a href="demo/index.html#winecellar">Wine Cellar</a>.
</p>
<p> </p>
<h4 class="mt20">Documentation</h4>
<p>Learn more about <a href="doc/ui-model.html">Evolutility UI-models</a> and <a href="doc/views.html">generic Views</a>.</p>
<p> </p>
<h4 class="mt20">Download & Code</h4>
<p>Evolutility.js source code is available at <a href="https://github.com/evoluteur/evolutility" target="gh">GitHub</a>
under the GNU AGPLv3 license.</p>
<div class="clearfix"></div>
</div>
<div class="footer">© 2015 Olivier Giulieri</div>
<script>
var curView=null;
function showView(){
var modelName=$('#evolModel').val(),
viewName=$('#evolView').val(),
uiModel=uiModels[modelName];
var $e=$('<div data-eid="'+uiModel.id+'"></div>'),
collec = new Backbone.Collection(uiModels[modelName+'_data']),
config={
style: 'panel-primary',
collection: collec,
model: collec.at(0),
uiModel: uiModel,
title:'',
el: $e,
iconsPath:'demo/pix/'
};
$('#evol1').append($e);
if(curView){
curView.remove();
}
curView=new Evol.viewClasses[viewName](config)
.render();
}
$(document).ready(function(){
$('#evolModel,#evolView').on('change', function(){
showView();
});
showView();
});
</script>
</body>
</html>