Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
425 lines (392 loc) · 22.3 KB
/
Copy pathindex.html
File metadata and controls
425 lines (392 loc) · 22.3 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
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8" />
<title>DER</title>
<link rel="icon" href="icons/favicon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="icons/favicon.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="design/Main.css" />
<script type="module" src="source/Main.js"></script>
</head>
<body class="light-mode">
<script>
// The mode is taken before anything is drawn, so a page that opens
// dark does not open with a flash of light
(() => {
const mode = localStorage.getItem("mode") || "system";
const isDark = mode === "dark" || (mode === "system" && window.matchMedia("(prefers-color-scheme: dark)").matches);
document.body.classList.toggle("dark-mode", isDark);
document.body.classList.toggle("light-mode", !isDark);
})();
</script>
<aside class="aside">
<div class="aside-content">
<header>
<div class="aside-logo" aria-label="Go to another tool">
<i class="svg-icon"></i>
</div>
<h1 data-action="open-select">
<span class="aside-title">DER</span>
<i class="aside-caret arrow"></i>
</h1>
<div class="aside-arrow arrow" data-action="toggle-aside" data-tip="Collapse the panel" data-tip-top aria-label="Collapse the panel"></div>
</header>
<section class="schema-filter">
<i class="svg-icon"></i>
<input type="text" name="filter" placeholder="Filter tables" />
<a href="#" class="close" data-action="clear-filter"></a>
<div class="schema-total"></div>
<a href="#" class="schema-toggle" data-action="toggle-list" data-tip="Open every group" data-tip-top aria-label="Open every group">
<i class="svg-icon"></i>
</a>
</section>
<div class="schema-scroll">
<section class="schema-list">
<ol></ol>
</section>
</div>
<footer class="aside-footer">
<div class="aside-status"></div>
<div class="aside-actions">
<button class="btn btn-tiny" data-action="add-all-tables">Add all</button>
<button class="btn btn-tiny" data-action="open-clear">Clear</button>
</div>
</footer>
</div>
<div class="aside-resizer" data-action="resize-aside"></div>
</aside>
<main class="main">
<section class="canvas">
<div class="canvas-links"></div>
</section>
</main>
<div class="canvas-empty">
<div class="canvas-empty-box"></div>
<div>
<h2>The board is empty</h2>
<p>Add tables from the sidebar to start building the diagram.</p>
</div>
<button class="btn" data-action="add-all-tables">Add all tables</button>
</div>
<ol class="mode">
<li class="mode-light selected" data-action="mode-light" data-tip="Light mode" aria-label="Light mode">
<i class="svg-icon"></i>
</li>
<li class="mode-system" data-action="mode-system" data-tip="Follow the system" aria-label="Follow the system">
<i class="svg-icon"></i>
</li>
<li class="mode-dark" data-action="mode-dark" data-tip="Dark mode" aria-label="Dark mode">
<i class="svg-icon"></i>
</li>
</ol>
<aside class="menu">
<ol class="zoom">
<li class="zoom-in" data-action="zoom-in" data-tip="Zoom in" aria-label="Zoom in">+</li>
<li class="zoom-percent" data-action="reset-zoom" data-tip="Reset the zoom" aria-label="Reset the zoom">100%</li>
<li class="zoom-out" data-action="zoom-out" data-tip="Zoom out" aria-label="Zoom out">−</li>
</ol>
<ol class="steps">
<li class="icon-undo icon-disabled" data-action="undo" data-tip="Undo the last change" aria-label="Undo the last change">
<i class="svg-icon"></i>
</li>
<li class="icon-redo icon-disabled" data-action="redo" data-tip="Redo the last change" aria-label="Redo the last change">
<i class="svg-icon"></i>
</li>
</ol>
<ol class="icons">
<li class="icon-group" data-action="open-group" data-tip="Group the selected tables" aria-label="Group the selected tables">
<i class="svg-icon"></i>
</li>
<li class="icon-tidy" data-action="tidy-board" data-tip="Tidy the board" aria-label="Tidy the board">
<i class="svg-icon"></i>
</li>
<li class="icon-fit" data-action="fit-board" data-tip="Show the whole board" aria-label="Show the whole board">
<i class="svg-icon"></i>
</li>
<li class="icon-settings" data-action="open-settings" data-tip="Settings" aria-label="Settings">
<i class="svg-icon"></i>
</li>
</ol>
</aside>
<aside class="views">
<ol></ol>
<button class="btn btn-small views-add" data-action="open-view" data-tip="Add a view" data-tip-top aria-label="Add a view">+</button>
</aside>
<aside class="minimap" data-action="drag-minimap">
<div class="minimap-board"></div>
<div class="minimap-view"></div>
<a href="#" class="close" data-action="hide-minimap" data-tip="Hide the map" data-tip-top aria-label="Hide the map"></a>
</aside>
<div class="selector"></div>
<div class="toast"></div>
<div class="tooltip" popover="manual"></div>
<div class="context"></div>
<aside class="summary">
<div class="summary-text"></div>
<button class="btn btn-small" data-action="open-group">Create group</button>
<a href="#" class="close" data-action="clear-selection" data-tip="Clear selection" data-tip-top aria-label="Clear selection"></a>
</aside>
<section>
<div class="welcome-dialog backdrop" data-dialog="welcome">
<dialog open>
<h2>Welcome to DER</h2>
<p>
DER draws a database as a diagram, from the JSON schema that the
<a href="https://frameworkphp.com.ar" target="_blank" rel="noopener noreferrer">Framework</a>
generates.
</p>
<ol class="dialog-steps">
<li><div><b>Add a schema</b> from a json file, or from the url it is published at.</div></li>
<li><div><b>Pick the tables</b> in the list at the left and they show up on the canvas.</div></li>
<li><div><b>Move them around</b>, and gather the ones that belong together into a group.</div></li>
</ol>
<p class="welcome-note">Everything stays in this browser, and comes back the way you left it.</p>
<footer>
<button class="btn btn-fill" data-action="welcome-add">Add a schema</button>
<button class="btn" data-action="welcome-test">Try the Framework</button>
<button class="btn" data-action="import-schema">Import</button>
</footer>
</dialog>
</div>
<div class="select-dialog backdrop" data-dialog="select">
<dialog open>
<h2>Select a Schema</h2>
<p class="select-empty">Use the button bellow to add a new Schema.</p>
<ol class="select-list"></ol>
<footer>
<button class="btn btn-fill" data-action="open-add">Add schema</button>
<button class="btn" data-action="import-schema">Import</button>
</footer>
<a href="#" class="close" data-action="close-select"></a>
</dialog>
</div>
<div class="schema-dialog backdrop" data-dialog="schema">
<dialog open>
<h2>Schema</h2>
<p>Name the Schema and select a json file or a schema url.</p>
<form>
<label class="toggle-input" data-field="useUrl">
<input type="checkbox" role="switch" name="useUrl" value="1" data-action="schema-url"></input>
<div>Use url</div>
</label>
<div class="field" data-field="name">
<label>Name</label>
<input type="text" name="name" />
<div class="error" data-error="name">You must complete the schema name.</div>
</div>
<div class="field file-input schema-file" data-field="file">
<section>
<div>
<label>File</label>
<div class="file-name"></div>
</div>
<div>
<a href="#" class="close" data-action="remove-file"></a>
<a href="#" class="btn btn-small" data-action="upload-file">Upload file</a>
</div>
</section>
<div class="error" data-error="file">You must complete the schema main file.</div>
<div class="error" data-error="json">The file must be a valid JSON file.</div>
</div>
<div class="field schema-url" data-field="url">
<label>Url</label>
<input type="text" name="mainUrl" />
<div class="error" data-error="url">You must complete de main url.</div>
</div>
<div class="field schema-position" data-field="position">
<label>Position</label>
<input type="number" name="position" />
</div>
<footer>
<button class="btn btn-fill dialog-btn" data-action="edit-schema">Schema</button>
<button class="btn" data-action="close-schema">Cancel</button>
</footer>
</form>
<a href="#" class="close" data-action="close-schema"></a>
</dialog>
</div>
<div class="backdrop" data-dialog="remove-schema">
<dialog open>
<h2>Remove Schema</h2>
<p>Do you really want to remove the selected Schema?</p>
<footer>
<button class="btn btn-fill" data-action="remove-schema">Remove schema</button>
<button class="btn" data-action="close-remove-schema">Cancel</button>
</footer>
<a href="#" class="close" data-action="close-remove-schema"></a>
</dialog>
</div>
<div class="backdrop" data-dialog="group">
<dialog open>
<h2>Group</h2>
<div class="group-empty">
<p>A group gathers the tables that belong together, and none are selected yet.</p>
<ol class="dialog-steps">
<li><div><b>Pick the tables</b> on the board, holding ctrl to add each one to the selection.</div></li>
<li><div><b>Open this again</b> and the group takes the tables that are selected.</div></li>
</ol>
<footer>
<button class="btn btn-fill group-prefix" data-action="group-by-prefix">Group by prefix</button>
<button class="btn" data-action="close-group">Close</button>
</footer>
</div>
<form class="group-content">
<div class="field" data-field="name">
<label>Group name</label>
<input type="text" name="name" />
<div class="error" data-error="name">You must complete de name of the group.</div>
</div>
<div class="field" data-field="tables">
<label>Selected tables</label>
<div class="group-tables checkbox-box"></div>
<div class="error" data-error="table">You must indicate at least one table.</div>
</div>
<div class="field group-adding" data-field="added">
<label>Tables to add</label>
<div class="group-added checkbox-box"></div>
</div>
<footer>
<button class="btn btn-fill dialog-btn" data-action="update-group">Group</button>
<button class="btn group-remove" data-action="open-remove">Remove group</button>
<button class="btn" data-action="close-group">Cancel</button>
</footer>
</form>
<a href="#" class="close" data-action="close-group"></a>
</dialog>
</div>
<div class="backdrop" data-dialog="remove">
<dialog open>
<h2>Remove Group</h2>
<p>Do you really want to remove the selected Group?</p>
<footer>
<button class="btn btn-fill" data-action="remove-group">Remove group</button>
<button class="btn" data-action="close-remove">Cancel</button>
</footer>
<a href="#" class="close" data-action="close-remove"></a>
</dialog>
</div>
<div class="backdrop" data-dialog="view">
<dialog open>
<h2>View</h2>
<form>
<label class="toggle-input view-copy" data-field="copy">
<input type="checkbox" role="switch" name="copy" value="1" data-action="copy-view"></input>
<div>Copy the view</div>
</label>
<div class="field" data-field="name">
<label>View name</label>
<input type="text" name="name" />
<div class="error" data-error="name">You must complete the name of the view.</div>
</div>
<footer>
<button class="btn btn-fill dialog-btn" data-action="update-view">View</button>
<button class="btn view-remove" data-action="open-remove-view">Remove view</button>
<button class="btn" data-action="close-view">Cancel</button>
</footer>
</form>
<a href="#" class="close" data-action="close-view"></a>
</dialog>
</div>
<div class="backdrop" data-dialog="clear-board">
<dialog open>
<h2>Clear the board</h2>
<p>Do you really want to take every Table off the board? Where each one sits is lost.</p>
<footer>
<button class="btn btn-fill" data-action="clear-board">Clear the board</button>
<button class="btn" data-action="close-clear">Cancel</button>
</footer>
<a href="#" class="close" data-action="close-clear"></a>
</dialog>
</div>
<div class="backdrop settings-dialog" data-dialog="settings">
<dialog open>
<h2>Settings</h2>
<nav class="dialog-tabs">
<span class="dialog-tabs-mark"></span>
<a href="#" class="selected" data-action="settings-tab" data-tab="options">Options</a>
<a href="#" data-action="settings-tab" data-tab="keys">Shortcuts</a>
</nav>
<div class="settings-scroll">
<ol class="keys-list"></ol>
<form>
<h3>Board</h3>
<label class="toggle-input" data-field="showGrid">
<input type="checkbox" role="switch" name="showGrid" value="1" />
<div>Show the dots behind the board</div>
</label>
<label class="toggle-input" data-field="snapToGrid">
<input type="checkbox" role="switch" name="snapToGrid" value="1" />
<div>Snap a Table to the dots as it is dragged</div>
</label>
<label class="toggle-input" data-field="tidyOnAdd">
<input type="checkbox" role="switch" name="tidyOnAdd" value="1" />
<div>Push the board apart when a Table is added</div>
</label>
<label class="toggle-input" data-field="showMinimap">
<input type="checkbox" role="switch" name="showMinimap" value="1" />
<div>Show a map of the board in the corner</div>
</label>
<h3>Tables</h3>
<label class="toggle-input" data-field="showDescriptions">
<input type="checkbox" role="switch" name="showDescriptions" value="1" />
<div>Show the table description</div>
</label>
<label class="toggle-input" data-field="showTypes">
<input type="checkbox" role="switch" name="showTypes" value="1" />
<div>Show the type of each field</div>
</label>
<label class="toggle-input" data-field="onlyKeys">
<input type="checkbox" role="switch" name="onlyKeys" value="1" />
<div>Show only the fields that are keys</div>
</label>
<label class="toggle-input" data-field="showAudit">
<input type="checkbox" role="switch" name="showAudit" value="1" />
<div>Show the created, modified and status columns</div>
</label>
<label class="toggle-input" data-field="keysFirst">
<input type="checkbox" role="switch" name="keysFirst" value="1" />
<div>Put the keys before the other fields</div>
</label>
<label class="toggle-input" data-field="showAllFields">
<input type="checkbox" role="switch" name="showAllFields" value="1" />
<div>Show every field, with none kept back</div>
</label>
<h3>Links</h3>
<label class="toggle-input" data-field="isStraight">
<input type="checkbox" role="switch" name="isStraight" value="1" />
<div>Draw the links straight rather than curved</div>
</label>
<label class="toggle-input" data-field="showDots">
<input type="checkbox" role="switch" name="showDots" value="1" />
<div>End the links in dots rather than in crow's feet</div>
</label>
<label class="toggle-input" data-field="flowLinks">
<input type="checkbox" role="switch" name="flowLinks" value="1" />
<div>Animate the links to show the direction</div>
</label>
</form>
</div>
<footer>
<button class="btn btn-fill" data-action="save-settings">Save settings</button>
<button class="btn" data-action="close-settings">Cancel</button>
</footer>
<a href="#" class="close" data-action="close-settings"></a>
</dialog>
</div>
<div class="backdrop" data-dialog="remove-view">
<dialog open>
<h2>Remove View</h2>
<p>Do you really want to remove the selected View and its board?</p>
<footer>
<button class="btn btn-fill" data-action="remove-view">Remove view</button>
<button class="btn" data-action="close-remove-view">Cancel</button>
</footer>
<a href="#" class="close" data-action="close-remove-view"></a>
</dialog>
</div>
</section>
</body>
</html>