-
Notifications
You must be signed in to change notification settings - Fork 1
/
formbuilder.html
269 lines (257 loc) · 12.7 KB
/
formbuilder.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
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<!DOCTYPE html>
<html lang="en">
<head>
<title>Form Builder</title>
<!-- ---- Browser Compatibility (needs to be in first 1024 chars)---- -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!--
/* The MIT License (MIT)
*
* Copyright (c) 2018 GeoAnalytic Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
-->
<!-- ---- mobile friendly ---- -->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="mobile-web-app-capable" content="yes"> <!-- makes Chrome go full-screen when saved to the Android Home Screen -->
<!-- for Chrome on mobile (Optional): -->
<!-- <link rel="manifest" href="manifest.json"> -->
<!-- ---- Style/Look ---- -->
<!-- Remote: -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<!-- Local:
<link rel="stylesheet" type="text/css" href="lib/bootstrap/css/bootstrap.min.css"/>
-->
<link rel="stylesheet" type="text/css" href="formbuilder.css"/>
</head>
<body>
<nav class="navbar navbar-expand-sm navbar-dark bg-dark">
<a class="navbar-brand" href="#">FormBuilder</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
File
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a id="menu-fileNew" class="dropdown-item" href="#">New</a>
<a id="menu-fileOpen" class="dropdown-item" href="#">Open Local File</a>
<input id="fileOpen" type="file" style="display:none;"/>
<a id="menu-fileSave" class="dropdown-item" href="#">Save Local File</a>
<a id="fileSave" style="display:none; "href="#"></a>
<a id="menu-fileLoadServer" class="dropdown-item" href="#">Load From Server</a>
<a id="menu-fileSaveServer" class="dropdown-item" href="#">Save To Server</a>
</div>
</li>
<!-- <li class="nav-item"><a class="nav-link" href="#">Help</a></li> -->
</ul>
</div>
</nav>
<div class="container-fluid">
<hr><!-- ----------------------------------------------------------------------------------- -->
<fieldset disabled id="fs-File-List">
<div class="form-row">
<div class="col-2"><b>Tags File:</b></div>
<div class="col-10">
<select class="form-control" id="sel-File"></select>
</div>
</div>
</fieldset>
<hr><!-- ----------------------------------------------------------------------------------- -->
<fieldset disabled id="fs-Section-List">
<div class="form-row">
<label for="Name"><b>Sections (Form groups):</b></label>
</div>
<div class="form-row">
<div class="col-10">
<select class="form-control" size="6" id="sel-Section"></select>
</div>
<div class="col-2">
<div class="btn-group-vertical" role="group" aria-label="Basic example">
<button type="button" class="btn btn-primary" id="btn-SectionNew" >New</button>
<button type="button" class="btn btn-primary" id="btn-SectionDelete">Delete</button>
<button type="button" class="btn btn-primary" id="btn-SectionUp" >Up</button>
<button type="button" class="btn btn-primary" id="btn-SectionDown" >Down</button>
</div>
</div>
</div>
</fieldset>
<fieldset disabled id="fs-Section-Details">
<div class="form-row">
<div class="col-5"><label for="Name">Key/Label (Form Name):</label></div>
<div class="col-5"><label for="Name">Description:</label></div>
</div>
<div class="form-row">
<div class="col-5"><input type="text" class="form-control" id="section-Name"></div>
<div class="col-5"><input type="text" class="form-control" id="section-Description"></div>
<div class="col-2"><button type="button" class="btn btn-primary" id="btn-SectionSave">Save</button></div>
</div>
</fieldset>
<hr><!-- ----------------------------------------------------------------------------------- -->
<fieldset disabled id="fs-Form-List">
<div class="form-row">
<label for="Name"><b>Forms:</b></label>
</div>
<div class="form-row">
<div class="col-10">
<select class="form-control" size="6" id="sel-Form"></select>
</div>
<div class="col-2">
<label for="Name"></label>
<div class="btn-group-vertical">
<button type="button" class="btn btn-primary" id="btn-FormNew" >New</button>
<button type="button" class="btn btn-primary" id="btn-FormDelete">Delete</button>
<button type="button" class="btn btn-primary" id="btn-FormUp" >Up</button>
<button type="button" class="btn btn-primary" id="btn-FormDown" >Down</button>
</div>
</div>
</div>
</fieldset>
<fieldset disabled id="fs-Form-Details">
<div class="form-row">
<div class="col-10"><label for="Name">Key/Label:</label></div>
</div>
<div class="form-row">
<div class="col-10"><input type="text" class="form-control" id="form-Name"></div>
<div class="col-2"><button type="button" class="btn btn-primary" id="btn-FormSave">Save</button></div>
</div>
</fieldset>
<hr><!-- ----------------------------------------------------------------------------------- -->
<fieldset disabled id="fs-FormItem-List">
<div class="form-row">
<label for="Name"><b>Form Items:</b></label>
</div>
<div class="form-row">
<div class="col-10">
<select class="form-control" size="7" id="sel-FormItem"></select>
</div>
<div class="col-2">
<div class="btn-group-vertical">
<button type="button" class="btn btn-primary" id="btn-FormItemNew" >New</button>
<button type="button" class="btn btn-primary" id="btn-FormItemDelete">Delete</button>
<button type="button" class="btn btn-primary" id="btn-FormItemUp" >Up</button>
<button type="button" class="btn btn-primary" id="btn-FormItemDown" >Down</button>
</div>
</div>
</div>
</fieldset>
<fieldset disabled id="fs-FormItem-Details">
<div class="form-row">
<div class="col-5"><label for="formItem-Key">Key:</label></div>
<div class="col-5"> <label for="formItem-Label">Label:</label></div>
</div>
<div class="form-row">
<div class="col-5"><input type="text" class="form-control" id="formItem-Key"></div>
<div class="col-5"><input type="text" class="form-control" id="formItem-Label"></div>
<div class="col-2"><button type="button" class="btn btn-primary" id="btn-FormItemSave">Save</button></div>
</div>
<div class="form-row">
<div class="col-4"><label for="formItem-Type">Type:</label></div>
<div class="col-2"><label for="formItem-Value">Value:</label></div>
</div>
<div class="form-row">
<div class="col-4">
<select class="form-control" id="formItem-Type">
<option value="string">Text</option>
<option value="pictures">Picture</option>
<option value="sketch">Sketch</option>
<option value="map">Map</option>
<option value="dynamicstring">Multiple Text</option>
<option value="double">Decimal Number</option>
<option value="integer">Integer Number</option>
<option value="date">Date</option>
<option value="time">Time</option>
<option value="label">Form Label</option>
<option value="labelwithline">Underlined Label</option>
<option value="boolean">Checkbox</option>
<option value="stringcombo">Combo</option>
<option value="multistringcombo">Multiple Choice Combo</option>
<option value="connectedstringcombo">(Not Implemented Yet) Two Connected Combos</option>
<option value="onetomanystringcombo">(Not Implemented Yet) Sub Combos</option>
<option value="autocompletestringcombo">Combo w Autocomplete</option>
<option value="autocompleteconnectedstringcombo">(Not Implemented Yet) Connected Combos w Autocomplete</option>
<option value="hidden">Hidden</option>
<option value="primary_key">Primary Key</option>
</select>
</div>
<div class="col-4">
<input type="text" class="form-control" id="formItem-Value">
</div>
<div class="col">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="formItem-islabel">
<label class="form-check-label" for="islabel">Label On Map</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="formItem-mandatory">
<label class="form-check-label" for="mandatory">Is Mandatory</label>
</div>
</div>
</div>
<div class="form-row" id="uniqueFormItems_labels_1">
<!-- content created in JavaScript -->
</div>
<div class="form-row" id="uniqueFormItems_inputs_1">
<!-- content created in JavaScript -->
</div>
</fieldset>
</div>
<!-- The SaveAs dialog -->
<div class="modal" id="dialagSaveAs">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Save As</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<label for="filename"><span class="glyphicon glyphicon-user"></span> File name</label>
<input type="text" class="form-control" id="filename" placeholder="File name">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal" id="btn-FileNameSave">Save</button>
</div>
</div>
</div>
</div>
<!-- Remote: -->
<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<!-- Local:
<script type="text/javascript" src="lib/jquery/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="lib/bootstrap/js/bootstrap.js"></script>
-->
<!-- Here's an example for using a django (or other template-oriented) server, and it needs to do a substitution: -->
<!--
<script >
"use strict";
let csrf_token = "{{ csrf_token }}";
let gsServerUrlFileList = "{% url 'tag-list' %}" + "?format=json";
let gsServerUrlSaveTagFile = "{% url 'tag-list' %}";
</script>
-->
<script src="formbuilder.js"></script>
</body>
</html>