-
Notifications
You must be signed in to change notification settings - Fork 26
/
Sheet.html
654 lines (601 loc) · 31.2 KB
/
Sheet.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
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
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
<html>
<head>
<title>Sheet</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta charset="utf-8" />
<meta name="GE3-GITVersion" content="3.6.1">
<link rel="icon" type="image/png" href="./images/favicon.png"></link>
<link rel="stylesheet" href="./style/menu.css" type="text/css"></link>
<link rel="stylesheet" href="./style/fonts.css" type="text/css"></link>
<link rel="stylesheet" href="./style/sliders.css" type="text/css"></link>
<link rel="stylesheet" href="./style/menu.css" type="text/css"></link>
<link rel="stylesheet" href="./visualizerFramework/visualizer.css" type="text/css"></link>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css">
<style>
:root {
/*
--visualizer-header-background: #D0D0D0;
--visualizer-body-background: #E5E5E5;
*/
--gray1: #f8f8f8;
--gray2: #ececec;
--gray3: #dddddd;
--gray4: #d1d1d1;
--gray5: #c8c8c8;
--gray6: #bfbfbf;
--light-background: #f8f8f8;
--darker-background: #e0e0e0;
--dark-gradient: linear-gradient(#e0e0e0, #bcbcbc);
--light-gradient: linear-gradient(#f0f0f0, #d1d1d1);
--light-border: #989898;
}
button {
background-image: var(--light-gradient);
}
.highlighted, .choice:hover {
background-color: rgba(255, 184, 134, 0.6); /* rgba(255, 255, 0, 0.3); */
}
body, #bodyDouble {
-webkit-touch-callout : none !important;
-webkit-user-select : none !important;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none !important;
margin: 0;
overflow: hidden;
height: 100%;
width: 100%;
}
#graphic-container {
position: relative;
flex-grow: 1;
width: 100%;
height: 100%;
}
#graphic {
width: 100%;
height: 100%;
overflow: hidden;
background-color: var(--gray1);
}
.context-menu {
display: none;
background-color: var(--gray2);
border: 1px solid var(--gray5);
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); /* gray mist */
font-size: medium;
font-style: normal;
font-weight: normal;
padding: 0.25em 0.5em;
min-width: 10em;
position: fixed;
}
.context-menu > div {
cursor: pointer;
}
.editor {
display: none;
position: fixed;
background-color: white;
}
#linking-indicator {
position: fixed;
left: 1000;
top: 1000;
background-color: white;
z-index: 1000;
width: 8em;
padding: 0.5em;
font-size: x-large;
box-shadow: 0px 8px 16px 0px rgb(0 0 0 / 20%);
}
#linking-indicator > button {
font-size: large;
height: auto;
display: block;
margin:1em auto 0;
width: 7em;
}
/* Add defining pair
*/
#domain-select, #codomain-select {
margin: 0 4px;
}
/* Defining pairs, morphism preview table formatting
*/
#defining-pair-table, #morphism-preview-table {
border-collapse: collapse;
margin-left: auto;
margin-right: auto;
border: 1px solid var(--light-border);
}
#defining-pair-table thead, #morphism-preview-table thead {
border-bottom: 1px solid var(--light-border);
}
#defining-pair-table th, #morphism-preview-table th {
font-weight: normal;
}
#defining-pair-table tbody, #morphism-preview-table tbody {
background-color: var(--light-background);
}
#defining-pair-table tbody tr, #morphism-preview-table tbody tr {
border-bottom: 1px solid var(--light-border);
}
#morphism-preview-table tbody tr:last-child {
border-bottom: none;
}
#defining-pair-table td:first-child, #morphism-preview-table td:first-child {
border-right: 1px solid var(--light-border);
}
#defining-pair-table td, #defining-pair-table th {
width: auto;
text-align: center;
padding: 0 0.5em;
}
#morphism-preview-table thead tr {
position: relative;
display: inline-block;
}
#morphism-preview-table thead th {
display: block;
padding: 0 0.5em;
float: left;
text-align: center;
}
#morphism-preview-table tbody {
display: block;
max-height: 15em;
overflow-y: auto;
overflow-x: hidden;
}
#morphism-preview-table tbody tr {
display: inline-block;
}
#morphism-preview-table tbody td {
display: inline-block;
padding: 0 0.5em;
float: left;
text-align: center;
}
#halo {
border: 2px dotted #aaaaff;
position: fixed;
pointer-events: none;
z-index: 10000;
background-color: rgba(0,0,0,0);
}
/* Sheet Control Panel */
#control-panel {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 20em;
border-left: 1px solid #aaa;
background-color: white;
padding: 0.2em;
overflow-y: auto;
display: flex;
flex-direction: column;
justify-content: flex-start;
}
#control-panel > * {
padding:0 0.3em 0 1em;
}
#control-panel > * > p {
font-size: x-large;
margin-block-end: 0.3em;
margin-left: -0.5em;
}
#control-panel button {
font-size: inherit;
height: auto;
width: auto;
margin: 0 0.3em;
padding: 0.3em;
}
#visualizer-select-group {
display: grid;
grid-template-columns: 1em auto 1.5em 1fr 1em;
grid-template-areas: ". label . selection .";
font-size: medium;
margin: 0.3em auto 0.7em;
}
#visualizer-select-group > span {
font-size: large;
align-self: center;
grid-area: label;
}
#visualizer-select-group .faux-select {
grid-area: selection;
}
.faux-select {
width: 100%;
margin: 0;
float: right;
background-image: var(--light-gradient);
}
.faux-select-options {
background-color: var(--gray1);
}
#stored-sheets {
flex-grow: 1;
}
#stored-sheet-list {
list-style: none;
margin: 0.8em 0.3em 0;
max-height: 20em;
min-height: 5em;
overflow-y: auto;
padding-inline-start: 0;
background-color: var(--gray1);
border: 1px solid var(--gray6);
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js",
"three/": "https://cdn.jsdelivr.net/npm/[email protected]/"
}
}
</script>
<script src="./refreshVersion.js"></script>
<script type="module">
import {check} from './js/Migration.js'
import {load} from './Sheet.js'
window.addEventListener('load', () => check().then(load))
</script>
</head>
<body>
<div id="bodyDouble">
<div id="header">
<div id="heading">Group Explorer Sheet</div>
</div>
<div id="graphic-container">
<div id="graphic" onchange="$(event.target).filter('.echoed').siblings().val($(event.target).val())">
<div id="halo" class="hidden"></div>
<div id="element-context-menu" data-action="() => void 0" class="context-menu">
<div data-action="listener = new MoveResizeSelectedNode(this.modelElement, event)"
class="Node choice">Resize</div>
<div data-action="this.createEditor(event)" class="choice">Edit</div>
<div data-action="this.openInfo(event)" class="Visualizer choice">Group Info</div>
<div data-action="this.modelElement.copy(), this.exit()" class="Node choice">Copy</div>
<hr class="Node">
<div data-action="this.createLink(event, 'Connector')" class="Node choice">Create Connection</div>
<div data-action="this.createLink(event, 'Morphism')" class="Visualizer choice">Create Map</div>
<hr class="Node">
<div data-action="this.modelElement.moveForward()" class="Node choice">Move Forward</div>
<div data-action="this.modelElement.moveBackward()" class="Node choice">Move Backward</div>
<div data-action="this.modelElement.moveToFront()" class="Node choice">Move to Front</div>
<div data-action="this.modelElement.moveToBack()" class="Node choice">Move to Back</div>
<hr>
<div data-action="this.modelElement.destroy(), this.exit()" class="choice">Delete</div>
</div>
</div>
<div id="control-panel">
<div id="add-element">
<p>Add element:</p>
<div style="display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 1em">
<button data-action="this.addElement('RectangleElement')">Rectangle</button>
<button data-action="this.addElement('TextElement')">Text box</button>
</div>
</div>
<div id="add-visualizer">
<p>Add visualizer:</p>
<div id="visualizer-select-group"
onclick="$('#visualizer-select-group .faux-select-options').toggle(); event.stopPropagation()">
<span>Group:</span>
<div class="faux-select">
<div class="faux-select-arrow"></div>
<span class="faux-select-value"></span>
<ol class="faux-select-options hidden display-none-on-clean"></ol>
</div>
<template id="visualizer-group-list-entry">
<span data-groupURL="${group.URL}">${group.name}</span>
</template>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; margin-bottom: 0.5em">
<button data-action="this.addElement('CDElement')">Cayley<br>diagram</button>
<button data-action="this.addElement('MTElement')">Multiplication<br>table</button>
<button data-action="this.addElement('CGElement')">Cycle<br>graph</button>
</div>
</div>
<p style="font-size: large; margin-block-start: 2em">Right-click/tap any object in the sheet for more options</p>
<div id="stored-sheets">
<p>Stored sheets:</p>
<ul id="stored-sheet-list" data-action="this.showStoredSheetMenu(event)"></ul>
<template id="stored-sheets-list-empty-entry-template">
<li style="padding: 0 1em"><i>(None)</i></li>
</template>
<template id="stored-sheets-list-entry-template">
<li style="padding: 0 1em" class="choice">${sheetName}</li>
</template>
<div id="new-sheet-dialog" class="draggable hidden controls-modal" data-action="() => void 0"
style="position: fixed; padding: 1em; background-color: white; z-index: 1000">
<div>Enter new stored sheet name (may have HTML):</div>
<input id="new-sheet-value" type="text" placeholder="My new sheet" minlength="1" maxlength="120"
onkeydown="if (event.key == 'Enter') $('#new-sheet-dialog button:first-of-type').click()"
style="font-size: inherit; margin: 0.5em 0; width: 25em">
<div style="padding: 0.5em 2em 0">
<button data-action="this.saveNewSheet()" style="width: 5em">OK</button>
<button style="width: 5em; float: right" data-action="this.exit()">Cancel</button>
</div>
</div>
<div id="import-sheet-dialog" class="draggable hidden controls-modal"
data-action="() => void 0"
style="position: fixed; padding: 1em; background-color: white">
<div>Enter sheet data to import (JSON):</div>
<textarea id="import-sheet-value" cols="40" rows="5"
style="font-size: inherit; margin: 0.5em 0; resize: none"></textarea>
</textarea>
<div style="padding: 0.5em 2em 0">
<button style="width: 5em" data-action="this.importSheetData()">OK</button>
<button style="width: 5em; float: right" data-action="this.exit()">Cancel</button>
</div>
</div>
<div id="export-sheet-dialog" class="draggable hidden controls-modal"
data-action="() => void 0"
style="position: fixed; padding: 1em; background-color: white">
<div>Sheet export data (JSON):</div>
<textarea id="export-sheet-value" cols="40" rows="5"
style="font-size: inherit; margin: 0.5em 0; resize: none">
</textarea>
<div style="padding: 0.5em 2em 0">
<button data-action="this.exit()"
style="width: 5em; display: block; margin: auto">OK</button>
</div>
</div>
<div id="stored-sheets-menu" class="context-menu hidden display-none-on-clean"
style="position: fixed; left: 4em">
<ul style="list-style: none; margin-block-start: 0; margin-block-end: 0; padding-inline-start: 0; ">
<li data-action="this.loadSheet(event)" class="choice">Load to current sheet</li>
<li data-action="this.saveSheet(event)" class="choice">Update from current sheet</li>
<li data-action="this.deleteSheet(event)" class="choice">Delete</li>
<hr>
<li data-action="this.createSheet(event)" class="choice">Save current sheet</li>
<li data-action="this.exportSheet(event)" class="choice">Export current sheet as JSON</li>
<li data-action="this.importSheet(event)" class="choice">Import JSON to current sheet</li>
<li data-action="Controls.loadStoredSheets(event); this.exit()" class="choice">Refresh list</li>
</ul>
</div>
<div id="empty-stored-sheets-menu" class="context-menu hidden display-none-on-clean"
style="position: fixed; left: 4em">
<ul style="list-style: none; margin-block-start: 0; margin-block-end: 0; padding-inline-start: 0; ">
<li data-action="this.createSheet(event)" class="choice">Save current sheet</li>
<li data-action="this.exportSheet(event)" class="choice">Export current sheet as JSON</li>
<li data-action="this.importSheet(event)" class="choice">Import JSON to current sheet</li>
<li data-action="Controls.loadStoredSheets(event); this.exit()" class="choice">Refresh list</li>
</ul>
</div>
</div>
<div id="redisplay-sheets" style="margin-bottom: 2em">
<div style="display: grid; grid-template-columns: 1fr 1fr">
<button data-action="View.redrawAll(); this.exit()">Redraw</button>
<button data-action="Model.clear(); this.exit()">Clear</button>
</div>
</div>
</div>
</div>
<!-- Model element editors
data-onload and data-onupdate contain javascript that is execuated (eval'd) in a context where:
'this' refers to the HTML element containing the data-* attributes, and
'model' refers to the model element being edited
-->
<div id="rectangle-editor" class="editor draggable" style="padding: 0 1em">
<p>Background color:
<input type="color" style="margin-left: 1em"
data-onload="$(this).val(`#${new THREE.Color(model.color).getHexString()}`)"
data-onupdate="model.color = $(this).val()">
</p>
<p><button data-action="this.commit()">OK</button>
<button data-action="this.rollback()">Cancel</button>
</p>
</div>
<div id="text-editor" class="editor draggable" style="padding: 0 1em">
<p>Text:<br>
<textarea rows="4" cols="50"
data-onload="$(this).val(model.text)"
data-onupdate="model.text = $(this).val().trim()"></textarea><br>
<input id="displayAsHTML" type="checkbox"
data-onload="$(this).prop('checked', model.isPlainText)"
data-onupdate="model.isPlainText = $(this).prop('checked')">
<label for="displayAsHTML">Display as plain text (not HTML)</label>
</p>
<p>Text color:
<input type="color" style="margin-left: 1em"
data-onload="$(this).val(`#${new THREE.Color(model.fontColor).getHexString()}`)"
data-onupdate="model.fontColor = $(this).val()">
</p>
<p>Text size:
<input id="font-size" class="echoed" type="text" size="3"
style="margin-left: 1em; text-align: right"
data-onload="$(this).val(`${parseInt(model.fontSize)}`)"
data-onupdate="model.fontSize = $(this).val() + $('#font-size-units').text()">
<label id="font-size-units" for="font-size"
data-onload="$(this).text(model.fontSize.match(/[a-z]+/g) == undefined ?
'px' : model.fontSize.match(/[a-z]+/g)[0])"></label>
<br>
<input class="echoed" type="range" min="8" max="64" style="margin: 0 5%"
data-onload="$(this).val(`${parseInt(model.fontSize)}`)">
</p>
<p style="margin-block-end: 0">Alignment:<br>
<input id="alignLeft" value="left" name="alignment" type="radio" style="margin-left: 3em"
data-onload="$(this).prop('checked', model.alignment == this.value)"
data-onupdate="model.alignment = $(this).prop('checked') ? this.value : model.alignment">
<label for="alignLeft">left</label>
<input id="alignCenter" value="center" name="alignment" type="radio"
data-onload="$(this).prop('checked', model.alignment == this.value)"
data-onupdate="model.alignment = $(this).prop('checked') ? this.value : model.alignment">
<label for="alignCenter">center</label>
<input id="alignRight" value="right" name="alignment" type="radio"
data-onload="$(this).prop('checked', model.alignment == this.value)"
data-onupdate="model.alignment = $(this).prop('checked') ? this.value : model.alignment">
<label for="alignRight">right</label>
</p>
<p>Background color:
<input type="color" style="margin-left: 1em"
data-onload="$(this).val(`#${new THREE.Color(model.color).getHexString()}`)"
data-onupdate="model.color = $(this).val()">
</p>
<p>Background opacity:
<input class="echoed" type="text" size="3" style="margin-left: 1em; text-align: center"
data-onload="$(this).val(`${model.opacity}`)"
data-onupdate="model.opacity = $(this).val()"><br>
<input class="echoed" type="range" min="0" max="1" step="0.01" style="margin: 0 5%"
data-onload="$(this).val(`${model.opacity}`)">
</p>
<p><button data-action="this.commit()">OK</button>
<button data-action="this.rollback()">Cancel</button></p>
</div>
<div id="connecting-editor" class="editor draggable" style="padding: 0 1em; min-width: 15em">
<p>Line color:
<input type="color" style="margin-left: 1em"
data-onload="$(this).val(`#${new THREE.Color(model.color).getHexString()}`)"
data-onupdate="model.color = $(this).val()">
</p>
<p>Line thickness:
<input class="echoed" type="text" size="3" value="5" style="margin-left: 1em; text-align: center"
data-onload="$(this).val(`${model.thickness}`)"
data-onupdate="model.thickness = parseInt($(this).val())"><br>
<input class="echoed" type="range" min="1" max="20" style="margin: 0 5%"
data-onload="$(this).val(`${model.thickness}`)">
</p>
<p><input id="drawArrowhead" type="checkbox"
data-onload="$(this).prop('checked', model.hasArrowhead)"
data-onupdate="model.hasArrowhead = $(this).prop('checked')">
<label for="drawArrowhead">Draw arrowhead</label>
</p>
<p><button data-action="this.commit()">OK</button>
<button data-action="this.rollback()">Cancel</button>
<button data-action="this.destroy()" style="float: right">Delete</button>
</p>
</div>
<div id="morphism-editor" class="editor draggable" style="padding: 0.5em; min-width: 30em;"
onclick="event.stopPropagation(), $('#codomain-choices').hide(), $('#domain-choices').hide()">
<p>Morphism name:
<input type="text"
data-onload="$(this).val(model.name)"
data-onupdate="model.name = $(this).val().trim(); $('#morphism-name').html(model.name)">
</p>
<p><input id="showDomainCodomain" type="checkbox"
data-onload="$(this).prop('checked', model.showDomainAndCodomain)"
data-onupdate="model.showDomainAndCodomain = $(this).prop('checked')">
<label for="showDomainCodomain">Show domain and codomain</label>
</p>
<p><input id="showDefiningPairs" type="checkbox"
data-onload="$(this).prop('checked', model.showDefiningPairs)"
data-onupdate="model.showDefiningPairs = $(this).prop('checked')">
<label for="showDefiningPairs">Show defining pairs</label>
</p>
<p><input id ="showInjectiveSurjective" type="checkbox"
data-onload="$(this).prop('checked', model.showInjectionSurjection)"
data-onupdate="model.showInjectionSurjection = $(this).prop('checked')">
<label for="showInjectiveSurjective">Show injective/surjective</label>
</p>
<p><input id="showManyArrows" type="checkbox"
data-onload="$(this).prop('checked', model.showManyArrows)"
data-onupdate="model.showManyArrows = $(this).prop('checked')">
<label for="showManyArrows">Draw multiple arrows</label>
</p>
<p>Arrows margin:
<input class="echoed" type="text" size="3" style="margin-left: 1em; text-align: center"
data-onload="$(this).val(`${100*model.arrowMargin}`)"
data-onupdate="model.arrowMargin = $(this).val()/100"><br>
<input class="echoed" type="range" min="0" max="5" step="0.1" style="margin: 0 5%; width: min(90%, 40em)"
data-onload="$(this).val(`${100*model.arrowMargin}`)">
</p>
<hr>
<p>Define homomorphism:</p>
<table id="defining-pair-table">
<thead>
<tr>
<th>This element</th>
<th>Maps to this</th>
<th style="width: 3em"></th>
</tr>
</thead>
<tbody id="morphism-defining-pairs" data-onload="model.fillDefiningPairs(this)">
<tr id="empty-morphism-state">
<td colspan="3"><center><i>No pairs added yet</i></center></td>
</tr>
</tbody>
<template id="morphism-editor-defining-pair-template">
<tr id="defining-pair-${domainElement}">
<td>${this.source.group.representation[domainElement]}</td>
<td>${this.destination.group.representation[codomainElement]}</td>
<td style="padding: 0">
<button data-action="this.modelElement.removeDefiningPair(${domainElement})"
style="float: right">Remove</button></td>
</tr>
</template>
</table>
<br>
<div id="morphism-add-defining-pair"
style="display: flex; align-items: center; justify-content: center">
<button data-action="this.modelElement.addDefiningPair()" style="margin-right: 0.5em">Add</button>
<span id="morphism-name" data-onload="$(this).html(model.name)"></span>
(<div id="domain-select"
onclick="$('#domain-choices').toggle(); $('#codomain-choices').hide(); event.stopPropagation()">
<div class="faux-select">
<div class="faux-select-arrow"></div>
<span id="domain-selection" class="faux-select-value"></span>
<ol id="domain-choices" class="faux-select-options hidden display-none-on-clean"></ol>
</div>
<template id="morphism-domain-choice-template">
<li class="choice" data-action="this.modelElement.setDomain(${element})">
${this.source.group.representation[element]}
</li>
</template>
</div>)
=
<div id="codomain-select" style="margin-left: 0.5em"
onclick="$('#codomain-choices').toggle(); $('#domain-choices').hide(); event.stopPropagation()">
<div class="faux-select">
<div class="faux-select-arrow"></div>
<span id="codomain-selection" class="faux-select-value"></span>
<ol id="codomain-choices" class="faux-select-options hidden display-none-on-clean"></ol>
</div>
<template id="morphism-codomain-choice-template">
<li class="choice" data-action="this.modelElement.setCodomain(${element})">
${this.destination.group.representation[element]}
</li>
</template>
</div>
</div>
<div id="morphism-preview">
<p data-action="$('#morphism-preview .toggled').toggle(), this.modelElement.displayPreview()">
<span class="toggled">+</span>
<span class="toggled hidden">-</span>
Full morphism mapping:
</p>
<table id="morphism-preview-table" class="toggled hidden">
<thead>
<tr>
<th>This element</th>
<th>Maps to this</th>
</tr>
</thead>
<tbody></tbody>
<template id="morphism-preview-row-template">
<tr>
<td>${this.source.group.representation[domainElement]}</td>
<td>${this.destination.group.representation[codomainElement]}</td>
</tr>
</template>
</table>
</div>
<p><button data-action="this.commit()">OK</button>
<button data-action="this.rollback()">Cancel</button>
<button data-action="this.destroy()" style="float: right">Delete morphism</button>
</p>
</div>
<div id="linking-indicator" class="draggable hidden">
<center>Select target</center>
<button id="linking-indicator-cancel">Cancel</button>
</div>
</div>
</body>
</html>