sunrize 1.11.0 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +14 -13
- package/src/Application/Application.js +1 -1
- package/src/Application/Dashboard.js +12 -3
- package/src/Application/Document.js +13 -8
- package/src/Application/Hierarchy.js +10 -3
- package/src/Controls/AddPrototypePopover.js +2 -2
- package/src/Controls/AnimationPropertiesPopover.js +12 -1
- package/src/Controls/Dialog.js +5 -2
- package/src/Controls/EditNodePopover.js +1 -1
- package/src/Controls/EditUserDefinedFieldPopover.js +1 -1
- package/src/Editors/AnimationEditor.js +105 -73
- package/src/Editors/AnimationMemberList.js +2 -2
- package/src/Editors/BrowserFrame.js +5 -3
- package/src/Editors/Console.js +253 -17
- package/src/Editors/Library.js +1 -1
- package/src/Editors/MaterialsLibrary.js +5 -3
- package/src/Editors/OutlineEditor.js +342 -224
- package/src/Editors/OutlineView.js +149 -174
- package/src/Editors/Panel.js +55 -1
- package/src/Editors/SceneProperties.js +188 -49
- package/src/Fields/MFStringTextArea.js +13 -11
- package/src/Fields/SFStringInput.js +12 -12
- package/src/Tools/Core/X3DNodeTool.js +1 -1
- package/src/Undo/Editor.js +93 -74
- package/src/assets/X3DUOM.xml +13 -4
- package/src/assets/themes/default.css +274 -67
- package/src/assets/themes/media-template.css +1 -9
- package/src/assets/themes/media.css +1 -9
- package/src/assets/themes/system-colors.css +63 -61
|
@@ -10,6 +10,7 @@ const
|
|
|
10
10
|
Editor = require ("../Undo/Editor"),
|
|
11
11
|
UndoManager = require ("../Undo/UndoManager"),
|
|
12
12
|
_ = require ("../Application/GetText");
|
|
13
|
+
const { height } = require("../Bits/X3DUOM");
|
|
13
14
|
|
|
14
15
|
require ("../Fields");
|
|
15
16
|
|
|
@@ -36,7 +37,7 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
36
37
|
|
|
37
38
|
this .tabs .addTextTab ("profile-and-components", _("Profile & Components"));
|
|
38
39
|
this .tabs .addTextTab ("units", _("Units"));
|
|
39
|
-
this .tabs .addTextTab ("meta-data", _("Meta
|
|
40
|
+
this .tabs .addTextTab ("meta-data", _("Meta Statements"));
|
|
40
41
|
this .tabs .addTextTab ("world-info", _("World Info"));
|
|
41
42
|
|
|
42
43
|
this .tabs .setup ();
|
|
@@ -51,7 +52,7 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
51
52
|
|
|
52
53
|
// Profile And Components
|
|
53
54
|
|
|
54
|
-
this .profileAndComponents .table = $("<table></table>") .appendTo (this .profileAndComponents);
|
|
55
|
+
this .profileAndComponents .table = $("<table></table>") .appendTo (this .profileAndComponents) .height ("100%");
|
|
55
56
|
this .profileAndComponents .table .body = $("<tbody></tbody>") .appendTo (this .profileAndComponents .table);
|
|
56
57
|
this .profileAndComponents .inputs = { };
|
|
57
58
|
|
|
@@ -63,7 +64,7 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
63
64
|
this .profileAndComponents .inputs .profile = $("<select></select>")
|
|
64
65
|
.on ("change", () => this .changeProfile ());
|
|
65
66
|
|
|
66
|
-
this .profileAndComponents .components = $("<div></div>") .css ({ "overflow-y": "auto"
|
|
67
|
+
this .profileAndComponents .components = $("<div></div>") .css ({ "overflow-y": "auto" });
|
|
67
68
|
this .profileAndComponents .components .table = $("<table></table>") .appendTo (this .profileAndComponents .components);
|
|
68
69
|
this .profileAndComponents .components .body = $("<tbody></tbody>") .appendTo (this .profileAndComponents .components .table);
|
|
69
70
|
|
|
@@ -79,16 +80,19 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
79
80
|
{
|
|
80
81
|
$("<tr></tr>")
|
|
81
82
|
.append ($("<td></td>")
|
|
83
|
+
.width ("15px")
|
|
82
84
|
.append ($("<input></input>")
|
|
83
85
|
.attr ("type", "checkbox")
|
|
84
86
|
.attr ("component", component .name)
|
|
85
87
|
.on ("change", () => this .changeComponents ())))
|
|
86
88
|
.append ($("<td></td>") .text (component .title))
|
|
87
|
-
.append ($("<td></td>")
|
|
88
|
-
.
|
|
89
|
-
.
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
.append ($("<td></td>")
|
|
90
|
+
.width ("15px")
|
|
91
|
+
.append ($("<input></input>")
|
|
92
|
+
.attr ("component", component .name)
|
|
93
|
+
.attr ("level", component .level)
|
|
94
|
+
.val (component .level)
|
|
95
|
+
.on ("change", () => this .changeComponents ())))
|
|
92
96
|
.appendTo (this .profileAndComponents .components .body);
|
|
93
97
|
}
|
|
94
98
|
|
|
@@ -96,7 +100,9 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
96
100
|
.append ($("<th></th>"))
|
|
97
101
|
.append ($("<td></td>")
|
|
98
102
|
.append (this .profileAndComponents .inputs .checkbox)
|
|
99
|
-
.append ($("<label></label>")
|
|
103
|
+
.append ($("<label></label>")
|
|
104
|
+
.attr ("for", "infer-profile-and-components-checkbox")
|
|
105
|
+
.text (_("Infer Profile and Components from Source when Saving"))))
|
|
100
106
|
.appendTo (this .profileAndComponents .table .body);
|
|
101
107
|
|
|
102
108
|
$("<tr></tr>")
|
|
@@ -114,6 +120,7 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
114
120
|
this .units .table = $("<table></table>") .appendTo (this .units);
|
|
115
121
|
this .units .table .head = $("<thead></thead>") .appendTo (this .units .table);
|
|
116
122
|
this .units .table .body = $("<tbody></tbody>") .appendTo (this .units .table);
|
|
123
|
+
this .units .table .foot = $("<tfoot></tfoot>") .appendTo (this .units .table);
|
|
117
124
|
|
|
118
125
|
this .units .inputs = new Map (Units .map (unit => [unit .category,
|
|
119
126
|
{
|
|
@@ -163,20 +170,60 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
163
170
|
|
|
164
171
|
this .units .find ("input[category]") .on ("change", event => this .changeUnitValue (event));
|
|
165
172
|
|
|
173
|
+
$("<tr></tr>")
|
|
174
|
+
.append ($("<th></th>"))
|
|
175
|
+
.append ($("<th></th>"))
|
|
176
|
+
.append ($("<th></th>"))
|
|
177
|
+
.appendTo (this .units .table .foot);
|
|
178
|
+
|
|
166
179
|
// Meta Data
|
|
167
180
|
|
|
168
181
|
this .metaData .table = $("<table></table>") .addClass ("sticky-headers") .appendTo (this .metaData);
|
|
169
182
|
this .metaData .table .head = $("<thead></thead>") .appendTo (this .metaData .table);
|
|
170
|
-
this .metaData .table .body = $("<tbody></tbody>") .appendTo (this .metaData .table)
|
|
183
|
+
this .metaData .table .body = $("<tbody></tbody>") .appendTo (this .metaData .table) .sortable ({
|
|
184
|
+
helper (event, tr)
|
|
185
|
+
{
|
|
186
|
+
const
|
|
187
|
+
originals = tr .children (),
|
|
188
|
+
helper = tr .clone ();
|
|
189
|
+
|
|
190
|
+
helper .children () .each (function (index)
|
|
191
|
+
{
|
|
192
|
+
// Set helper cell sizes to match the original sizes.
|
|
193
|
+
$(this)
|
|
194
|
+
.width (originals .eq (index) .width ())
|
|
195
|
+
.css ("padding-top", "2px");
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
return helper;
|
|
199
|
+
},
|
|
200
|
+
update: (event, ui) =>
|
|
201
|
+
{
|
|
202
|
+
this .changeMetaData ();
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
this .metaData .table .foot = $("<tfoot></tfoot>") .appendTo (this .metaData .table);
|
|
171
206
|
|
|
172
207
|
$("<tr></tr>")
|
|
173
|
-
.append ($("<th></th>") .css ("width", "
|
|
174
|
-
.append ($("<th></th>")
|
|
208
|
+
.append ($("<th></th>") .css ("width", "15px"))
|
|
209
|
+
.append ($("<th></th>")
|
|
210
|
+
.addClass ("button")
|
|
211
|
+
.css ("width", "25%")
|
|
212
|
+
.append ($("<span></span>") .text (_("Key")))
|
|
213
|
+
.append ($("<span></span>")
|
|
214
|
+
.attr ("title", "Sort column alphabetically.")
|
|
215
|
+
.addClass (["material-icons", "sort-key"])
|
|
216
|
+
.addClass (this .config .file .sortMetaData ? ["active"] : [ ])
|
|
217
|
+
.css ("font-size", "inherit")
|
|
218
|
+
.text ("sort_by_alpha"))
|
|
219
|
+
.on ("click", (event) => this .sortMetaData (event)))
|
|
220
|
+
.append ($("<th></th>") .css ("width", "auto") .text (_("Value")))
|
|
221
|
+
.append ($("<th></th>") .css ("width", "15px"))
|
|
175
222
|
.appendTo (this .metaData .table .head);
|
|
176
223
|
|
|
177
224
|
// World Info
|
|
178
225
|
|
|
179
|
-
this .worldInfo .table = $("<table></table>") .appendTo (this .worldInfo);
|
|
226
|
+
this .worldInfo .table = $("<table></table>") .height ("100%") .appendTo (this .worldInfo);
|
|
180
227
|
this .worldInfo .table .body = $("<tbody></tbody>") .appendTo (this .worldInfo .table);
|
|
181
228
|
this .worldInfo .inputs = { };
|
|
182
229
|
|
|
@@ -186,16 +233,18 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
186
233
|
.on ("click", () => this .toggleWorldInfo ());
|
|
187
234
|
|
|
188
235
|
this .worldInfo .inputs .title = $("<input></input>");
|
|
189
|
-
this .worldInfo .inputs .info = $("<textarea></textarea>");
|
|
236
|
+
this .worldInfo .inputs .info = $("<textarea></textarea>") .height ("100%") .css ("resize", "none");
|
|
190
237
|
|
|
191
238
|
this .worldInfo .checkboxRow = $("<tr></tr>")
|
|
192
|
-
.
|
|
239
|
+
.height ("19.5px")
|
|
240
|
+
.append ($("<th></th>") .css ("width", "20%"))
|
|
193
241
|
.append ($("<td></td>")
|
|
194
242
|
.append (this .worldInfo .inputs .checkbox)
|
|
195
|
-
.append ($("<label></label>") .attr ("for", "world-info-checkbox") .text ("World Info")))
|
|
243
|
+
.append ($("<label></label>") .attr ("for", "world-info-checkbox") .text (_("World Info"))))
|
|
196
244
|
.appendTo (this .worldInfo .table .body);
|
|
197
245
|
|
|
198
246
|
$("<tr></tr>")
|
|
247
|
+
.height ("19.5px")
|
|
199
248
|
.append ($("<th></th>") .text (_("Title")))
|
|
200
249
|
.append ($("<td></td>") .append (this .worldInfo .inputs .title))
|
|
201
250
|
.appendTo (this .worldInfo .table .body);
|
|
@@ -210,6 +259,12 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
210
259
|
{
|
|
211
260
|
super .configure ({ size: [600, 400] });
|
|
212
261
|
|
|
262
|
+
this .config .file .setDefaultValues ({
|
|
263
|
+
sortMetaData: false,
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
this .updateMetaDataSort ()
|
|
267
|
+
|
|
213
268
|
if (this .executionContext)
|
|
214
269
|
this .onclose ();
|
|
215
270
|
|
|
@@ -363,48 +418,111 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
363
418
|
Editor .updateUnit (this .executionContext, category, name .val (), conversionFactor .val ());
|
|
364
419
|
}
|
|
365
420
|
|
|
421
|
+
sortMetaData (event)
|
|
422
|
+
{
|
|
423
|
+
event .preventDefault ();
|
|
424
|
+
event .stopPropagation ();
|
|
425
|
+
|
|
426
|
+
this .config .file .sortMetaData = !this .config .file .sortMetaData;
|
|
427
|
+
|
|
428
|
+
this .updateMetaDataSort ();
|
|
429
|
+
this .updateMetaData ();
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
updateMetaDataSort ()
|
|
433
|
+
{
|
|
434
|
+
this .metaData .table .head .find (".sort-key")
|
|
435
|
+
.removeClass ("active")
|
|
436
|
+
.addClass (this .config .file .sortMetaData ? ["active"] : [ ])
|
|
437
|
+
|
|
438
|
+
if (this .config .file .sortMetaData)
|
|
439
|
+
this .metaData .table .body .sortable ("disable");
|
|
440
|
+
else
|
|
441
|
+
this .metaData .table .body .sortable ("enable");
|
|
442
|
+
}
|
|
443
|
+
|
|
366
444
|
updateMetaData ()
|
|
367
445
|
{
|
|
368
446
|
const
|
|
369
447
|
scrollTop = this .metaData .table .scrollTop (),
|
|
370
|
-
scrollLeft = this .metaData .table .scrollLeft ()
|
|
448
|
+
scrollLeft = this .metaData .table .scrollLeft (),
|
|
449
|
+
focusInput = this .metaData .table .body .find ("input:focus"),
|
|
450
|
+
focusRow = focusInput .closest ("tr");
|
|
371
451
|
|
|
372
452
|
this .metaData .table .body .empty ();
|
|
373
453
|
|
|
374
|
-
const
|
|
375
|
-
|
|
454
|
+
const
|
|
455
|
+
metaData = Array .from (this .executionContext .getMetaDatas ()),
|
|
456
|
+
rows = [ ];
|
|
376
457
|
|
|
377
|
-
for (const [key,
|
|
458
|
+
for (const [index, [key, value]] of metaData .entries ())
|
|
378
459
|
{
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
$("<
|
|
382
|
-
.append ($("<
|
|
383
|
-
.
|
|
384
|
-
.
|
|
460
|
+
const row = $("<tr></tr>")
|
|
461
|
+
.attr ("index", index)
|
|
462
|
+
.append ($("<td></td>")
|
|
463
|
+
.append ($("<span></span>")
|
|
464
|
+
.attr ("title", _("Drag to move key/value pair."))
|
|
465
|
+
.css ("font-size", "120%")
|
|
466
|
+
.addClass (["material-icons", "button", "drag"])
|
|
467
|
+
.addClass (this .config .file .sortMetaData ? ["disabled"] : [ ])
|
|
468
|
+
.text ("drag_handle")))
|
|
469
|
+
.append ($("<td></td>")
|
|
470
|
+
.append ($("<input></input>")
|
|
471
|
+
.attr ("index", 0)
|
|
385
472
|
.attr ("placeholder", _("Insert meta key here."))
|
|
386
473
|
.val (key) .on ("change", (event) => this .changeMetaData (event, key))))
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
.
|
|
474
|
+
.append ($("<td></td>")
|
|
475
|
+
.append ($("<input></input>")
|
|
476
|
+
.attr ("index", 1)
|
|
390
477
|
.attr ("placeholder", _("Insert meta value here."))
|
|
391
|
-
.val (value)
|
|
392
|
-
|
|
393
|
-
|
|
478
|
+
.val (value)
|
|
479
|
+
.on ("change", (event) => this .changeMetaData (event, key))))
|
|
480
|
+
.append ($("<td></td>")
|
|
481
|
+
.append ($("<span></span>")
|
|
482
|
+
.attr ("title", _("Delete key/value pair."))
|
|
483
|
+
.css ("font-size", "120%")
|
|
484
|
+
.addClass (["material-icons", "button"])
|
|
485
|
+
.text ("delete_forever")
|
|
486
|
+
.on ("click", (event) => this .removeMetaData (event, key))));
|
|
487
|
+
|
|
488
|
+
rows .push (row);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
if (this .config .file .sortMetaData)
|
|
492
|
+
{
|
|
493
|
+
rows .sort ((a, b) =>
|
|
494
|
+
{
|
|
495
|
+
const
|
|
496
|
+
keyA = $($(a) .find ("input") .get (0)) .val () ?? "",
|
|
497
|
+
keyB = $($(b) .find ("input") .get (0)) .val () ?? "";
|
|
498
|
+
|
|
499
|
+
return keyA .localeCompare (keyB);
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
this .metaData .table .body .append (rows);
|
|
504
|
+
|
|
505
|
+
if (focusInput .length)
|
|
506
|
+
{
|
|
507
|
+
const input = $(this .metaData .table .body
|
|
508
|
+
.find (`tr[index=${focusRow .attr ("index")}] input`)
|
|
509
|
+
.get (focusInput .attr ("index")));
|
|
510
|
+
|
|
511
|
+
input .trigger ("focus");
|
|
394
512
|
}
|
|
395
513
|
|
|
396
514
|
$("<tr></tr>")
|
|
515
|
+
.append ($("<td></td>"))
|
|
397
516
|
.append ($("<td></td>")
|
|
398
|
-
.css ("width", "unset")
|
|
399
517
|
.append ($("<input></input>")
|
|
400
|
-
|
|
401
|
-
|
|
518
|
+
.attr ("placeholder", _("Add new meta key."))
|
|
519
|
+
.on ("change", event => this .changeMetaData (event, ""))))
|
|
402
520
|
.append ($("<td></td>")
|
|
403
|
-
.css ("width", "unset")
|
|
404
521
|
.append ($("<input></input>")
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
.
|
|
522
|
+
.prop ("readonly", true)
|
|
523
|
+
.on ("change", event => this .changeMetaData (event, ""))))
|
|
524
|
+
.append ($("<td></td>"))
|
|
525
|
+
.appendTo (this .metaData .table .foot .empty ());
|
|
408
526
|
|
|
409
527
|
this .metaData .table .scrollTop (scrollTop);
|
|
410
528
|
this .metaData .table .scrollLeft (scrollLeft);
|
|
@@ -412,32 +530,53 @@ module .exports = new class SceneProperties extends Dialog
|
|
|
412
530
|
|
|
413
531
|
changeMetaData (event, oldKey)
|
|
414
532
|
{
|
|
415
|
-
|
|
416
|
-
inputs = $(event .target) .closest ("tr") .find ("input"),
|
|
417
|
-
key = $(inputs .get (0));
|
|
533
|
+
let metaData = Array .from (this .metaData .table .find ("tr"));
|
|
418
534
|
|
|
419
|
-
if (
|
|
420
|
-
|
|
535
|
+
if (arguments .length === 2)
|
|
536
|
+
{
|
|
537
|
+
const
|
|
538
|
+
inputs = $(event .target) .closest ("tr") .find ("input"),
|
|
539
|
+
key = $(inputs .get (0)) .val () ?.trim ();
|
|
540
|
+
|
|
541
|
+
if (key)
|
|
542
|
+
UndoManager .shared .beginUndo (_("Change Meta Data »%s«"), key);
|
|
543
|
+
else
|
|
544
|
+
UndoManager .shared .beginUndo (_("Remove Meta Data »%s«"), oldKey);
|
|
545
|
+
|
|
546
|
+
metaData .sort ((a, b) => $(a) .attr ("index") - $(b) .attr ("index"));
|
|
547
|
+
}
|
|
421
548
|
else
|
|
422
|
-
|
|
549
|
+
{
|
|
550
|
+
UndoManager .shared .beginUndo (_("Reorder Meta Data"));
|
|
551
|
+
}
|
|
423
552
|
|
|
424
|
-
|
|
553
|
+
metaData = metaData .map (element =>
|
|
425
554
|
{
|
|
426
555
|
const
|
|
427
556
|
inputs = $(element) .find ("input"),
|
|
428
557
|
key = $(inputs .get (0)),
|
|
429
558
|
value = $(inputs .get (1));
|
|
430
559
|
|
|
431
|
-
return [key .val (), value .val ()];
|
|
560
|
+
return [key .val () ?.trim (), value .val () ?.trim ()];
|
|
432
561
|
})
|
|
433
|
-
.filter (([key]) => key)
|
|
434
|
-
.sort ((a, b) => Algorithm .cmp (a [0], b [0]));
|
|
562
|
+
.filter (([key]) => key);
|
|
435
563
|
|
|
436
564
|
Editor .setMetaData (this .executionContext, metaData);
|
|
437
565
|
|
|
438
566
|
UndoManager .shared .endUndo ();
|
|
439
567
|
}
|
|
440
568
|
|
|
569
|
+
removeMetaData (event, oldKey)
|
|
570
|
+
{
|
|
571
|
+
const
|
|
572
|
+
inputs = $(event .target) .closest ("tr") .find ("input"),
|
|
573
|
+
key = $(inputs .get (0));
|
|
574
|
+
|
|
575
|
+
key .val ("");
|
|
576
|
+
|
|
577
|
+
this .changeMetaData (event, oldKey);
|
|
578
|
+
}
|
|
579
|
+
|
|
441
580
|
updateWorldInfo ()
|
|
442
581
|
{
|
|
443
582
|
if (this .worldInfoNode)
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
const
|
|
2
2
|
$ = require ("jquery"),
|
|
3
3
|
X3D = require ("../X3D"),
|
|
4
|
-
Editor = require ("../Undo/Editor")
|
|
4
|
+
Editor = require ("../Undo/Editor");
|
|
5
5
|
|
|
6
6
|
$.fn.MFStringTextArea = function (node, field)
|
|
7
7
|
{
|
|
8
8
|
if (arguments .length === 0)
|
|
9
9
|
{
|
|
10
|
-
this .off ("change.MFStringTextArea")
|
|
11
|
-
this .data ("field.MFStringTextArea") .removeFieldCallback (this .get (0))
|
|
10
|
+
this .off ("change.MFStringTextArea");
|
|
11
|
+
this .data ("field.MFStringTextArea") .removeFieldCallback (this .get (0));
|
|
12
12
|
}
|
|
13
13
|
else
|
|
14
14
|
{
|
|
15
15
|
if (typeof field === "string")
|
|
16
|
-
field = node .getField (field)
|
|
16
|
+
field = node .getField (field);
|
|
17
17
|
|
|
18
|
-
this .data ("field.MFStringTextArea", field)
|
|
18
|
+
this .data ("field.MFStringTextArea", field);
|
|
19
19
|
|
|
20
20
|
this .val (field .join ("\n")) .on ("change.MFStringTextArea", () =>
|
|
21
21
|
{
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const value = new X3D .MFString (... this .val () ? this .val () .split ("\n") : [ ]);
|
|
23
|
+
|
|
24
|
+
Editor .setFieldValue (node .getExecutionContext (), node, field, value);
|
|
25
|
+
});
|
|
24
26
|
|
|
25
27
|
field .addFieldCallback (this .get (0), () =>
|
|
26
28
|
{
|
|
27
|
-
this .val (field .join ("\n"))
|
|
28
|
-
})
|
|
29
|
+
this .val (field .join ("\n"));
|
|
30
|
+
});
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
return this
|
|
32
|
-
}
|
|
33
|
+
return this;
|
|
34
|
+
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
const
|
|
2
2
|
$ = require ("jquery"),
|
|
3
|
-
Editor = require ("../Undo/Editor")
|
|
3
|
+
Editor = require ("../Undo/Editor");
|
|
4
4
|
|
|
5
5
|
$.fn.SFStringInput = function (node, field)
|
|
6
6
|
{
|
|
7
7
|
if (arguments .length === 0)
|
|
8
8
|
{
|
|
9
|
-
this .off ("change.SFStringInput")
|
|
10
|
-
this .data ("field.SFStringInput") .removeFieldCallback (this .get (0))
|
|
9
|
+
this .off ("change.SFStringInput");
|
|
10
|
+
this .data ("field.SFStringInput") .removeFieldCallback (this .get (0));
|
|
11
11
|
}
|
|
12
12
|
else
|
|
13
13
|
{
|
|
14
14
|
if (typeof field === "string")
|
|
15
|
-
field = node .getField (field)
|
|
15
|
+
field = node .getField (field);
|
|
16
16
|
|
|
17
|
-
this .data ("field.SFStringInput", field)
|
|
17
|
+
this .data ("field.SFStringInput", field);
|
|
18
18
|
|
|
19
19
|
this .val (field .getValue ()) .on ("change.SFStringInput", () =>
|
|
20
20
|
{
|
|
21
|
-
Editor .setFieldValue (node .getExecutionContext (), node, field, this .val ())
|
|
22
|
-
})
|
|
21
|
+
Editor .setFieldValue (node .getExecutionContext (), node, field, this .val ());
|
|
22
|
+
});
|
|
23
23
|
|
|
24
24
|
field .addFieldCallback (this .get (0), () =>
|
|
25
25
|
{
|
|
26
|
-
this .val (field .getValue ())
|
|
27
|
-
this .trigger ("blur")
|
|
28
|
-
})
|
|
26
|
+
this .val (field .getValue ());
|
|
27
|
+
this .trigger ("blur");
|
|
28
|
+
});
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
return this
|
|
32
|
-
}
|
|
31
|
+
return this;
|
|
32
|
+
};
|
|
@@ -100,7 +100,7 @@ class X3DNodeTool extends X3DBaseTool
|
|
|
100
100
|
|
|
101
101
|
replaceNode (node, replacement)
|
|
102
102
|
{
|
|
103
|
-
for (const parent of
|
|
103
|
+
for (const parent of Array .from (node .getParents ()))
|
|
104
104
|
{
|
|
105
105
|
if (parent instanceof X3D .SFNode)
|
|
106
106
|
parent .setValue (replacement);
|