forked from lisa-wolfgang/vrEmbed
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvrCreate.min.js
More file actions
1067 lines (1066 loc) · 78.2 KB
/
vrCreate.min.js
File metadata and controls
1067 lines (1066 loc) · 78.2 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
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
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
! function e(t, i, n) {
function r(o, a) {
if (!i[o]) {
if (!t[o]) {
var c = "function" == typeof require && require;
if (!a && c) return c(o, !0);
if (s) return s(o, !0);
var l = new Error("Cannot find module '" + o + "'");
throw l.code = "MODULE_NOT_FOUND", l
}
var u = i[o] = {
exports: {}
};
t[o][0].call(u.exports, function(e) {
var i = t[o][1][e];
return r(i ? i : e)
}, u, u.exports, e, t, i, n)
}
return i[o].exports
}
for (var s = "function" == typeof require && require, o = 0; o < n.length; o++) r(n[o]);
return r
}({
1: [function(e, t, n) {
var r = (e("./VRScene.js"), e("./VRUINumberSlider.js")),
s = e("./VRUIAccordionStacker.js"),
o = (e("./VRSceneDict.js"), e("./VRUISceneList.js")),
a = e("./VRStoryDict.js"),
c = e("./VRImageLoader.js"),
l = {},
u = function(e, t) {
var n = null,
r = e.split("/");
for (i = 0; i < r.length; i++)
if ("photos" == r[i] && i + 2 < r.length) {
n = r[i + 2];
break
} if (null == n) return !1;
if (n in l) return void t(l[n]);
var s = "";
s += "https://api.flickr.com/services/rest/?", s += "&method=flickr.photos.getSizes", s += "&api_key=c074e17f92ea52a8d9422928352b0053", s += "&photo_id=" + n, s += "&format=json", s += "&nojsoncallback=1";
var o = new XMLHttpRequest;
o.open("GET", s, !0), o.send(), o.onreadystatechange = function() {
if (4 == o.readyState && 200 == o.status) {
var e = JSON.parse(o.responseText),
r = e.sizes.size,
s = 0,
a = 0;
for (i = 0; i < r.length; i++) {
var c = parseInt(r[i].width);
2048 >= c && c > a && (a = c, s = i)
}
l[n] = r[s].source, t(l[n])
}
}
};
VRCreateUI = function() {
var e = this;
this.firstRun = !0, this.storyManager = null, this.photoIdx = 0, this.sceneIdx = 0, this.sceneList = new o, this.sceneSelect = null, this.sceneName = null, this.elementSelect = null, this.imageURL = null, this.imagePreviewCanvas = null, this.hfovVRUINumberSlider = null, this.vfovVRUINumberSlider = null, this.xposVRUINumberSlider = null, this.yposVRUINumberSlider = null, this.isPlane = null, this.isStereo = null, this.U_l_x_slider = null, this.U_l_y_slider = null, this.V_l_x_slider = null, this.V_l_y_slider = null, this.U_r_x_slider = null, this.U_r_y_slider = null, this.V_r_x_slider = null, this.V_r_y_slider = null, this.textMessage = null, this.sceneJump = null, this.fontAlign = null, this.fontFace = null, this.fontSize = null, this.borderThickness = null, this.borderColor = null, this.backgroundColor = null, this.textColor = null, this.accordionStacker = null, this.oneImage = null, this.modeOneImage = null, this.modeNewStory = null, this.existingStory = null, this.modeExistingStory = null, this.oneImageMode = "single", this.exportEquirectangularButton = null, this.getStory = function() {
return e.storyManager.storyList != [] ? this.storyManager.storyList[0] : null
}, this.setPanelVisibility = function() {
if ("" == e.elementSelect.value) return e.showImageOptions(!1), e.showOptionsPosition(!1), e.showOptionsPosition3D(!1), e.showOptionsPlanar(!1), e.showOptionsText(!1), e.showOptionsJump(!1), void e.showOptionsTextCommon(!1);
var t = e.elementSelect.value.split("_"),
i = t[0];
"photo" == i ? (e.showImageOptions(!0), e.showOptionsPosition(!0), e.showOptionsPosition3D(!0), e.showOptionsPlanar(e.isPlane.checked), e.showStereoOptions(e.isStereo.checked), e.showOptionsText(!1), e.showOptionsJump(!1), e.showOptionsTextCommon(!1)) : "text" == i ? (e.showImageOptions(!1), e.showOptionsPosition(!0), e.showOptionsPosition3D(!1), e.showOptionsPlanar(e.isPlane.checked), e.showOptionsText(!0), e.showOptionsJump(!0), e.showOptionsTextCommon(!0)) : "decal" == i && (e.showImageOptions(!0), e.showOptionsPosition(!0), e.showOptionsPosition3D(!1), e.showOptionsPlanar(e.isPlane.checked), e.showStereoOptions(!1), e.showOptionsText(!1), e.showOptionsJump(!0), e.showOptionsTextCommon(!1))
}, this.showImageOptions = function(e) {
document.getElementById("options_image_load").hidden = !e
}, this.showOptionsPosition = function(e) {
document.getElementById("options_position").hidden = !e
}, this.showOptionsPosition3D = function(e) {
document.getElementById("options_position_3d").hidden = !e
}, this.showOptionsPlanar = function(e) {
document.getElementById("options_planar").hidden = !e
}, this.showOptionsText = function(e) {
document.getElementById("options_text").hidden = !e
}, this.showOptionsJump = function(e) {
document.getElementById("options_jump").hidden = !e
}, this.showOptionsTextCommon = function(e) {
document.getElementById("options_text_common").hidden = !e
}, this.showStereoOptions = function(e) {
var t = document.getElementById("options_stereo");
e ? t.hidden = !1 : t.hidden = !0
}, this.inputStateChange = function() {
if ("" != e.elementSelect.value) {
var t = e.elementSelect.value.split("_"),
i = t[0],
n = t[1],
r = e.sceneList.scenes[e.sceneSelect.value];
if ("photo" == i) {
var s = r.dict.photoObjects[n],
o = parseFloat(e.hfovVRUINumberSlider.get()),
a = parseFloat(e.vfovVRUINumberSlider.get()),
c = parseFloat(e.xposVRUINumberSlider.get()),
l = parseFloat(e.yposVRUINumberSlider.get()),
h = parseFloat(e.planarOffsetXSlider.get()),
p = parseFloat(e.planarOffsetYSlider.get());
s.textureDescription.sphereFOV[0] = o, s.textureDescription.sphereFOV[1] = a, s.textureDescription.sphereCentre[0] = c, s.textureDescription.sphereCentre[1] = l, s.textureDescription.src = e.imageURL.value, s.textureDescription.plane = e.isPlane.checked, s.textureDescription.isStereo = e.isStereo.checked, s.textureDescription.planeOffset = [h, p], s.textureDescription.U_l = [parseFloat(e.U_l_x_slider.get()), parseFloat(e.U_l_y_slider.get())], s.textureDescription.V_l = [parseFloat(e.V_l_x_slider.get()), parseFloat(e.V_l_y_slider.get())], s.textureDescription.U_r = [parseFloat(e.U_r_x_slider.get()), parseFloat(e.U_r_y_slider.get())], s.textureDescription.V_r = [parseFloat(e.V_r_x_slider.get()), parseFloat(e.V_r_y_slider.get())]
} else if ("text" == i) {
var d = r.dict.textObjects[n],
o = parseFloat(e.hfovVRUINumberSlider.get()),
a = parseFloat(e.vfovVRUINumberSlider.get()),
c = parseFloat(e.xposVRUINumberSlider.get()),
l = parseFloat(e.yposVRUINumberSlider.get()),
h = parseFloat(e.planarOffsetXSlider.get()),
p = parseFloat(e.planarOffsetYSlider.get());
d.textureDescription.sphereFOV[0] = o, d.textureDescription.sphereFOV[1] = a, d.textureDescription.sphereCentre[0] = c, d.textureDescription.sphereCentre[1] = l, d.textureDescription.plane = e.isPlane.checked, d.textureDescription.planeOffset = [h, p], d.message = e.textMessage.value, d.jumpTo = e.sceneJump.value, d.textOptions.align = e.fontAlign.value, d.textOptions.fontface = e.fontFace.value, d.textOptions.fontsize = e.fontSize.value, d.textOptions.borderthickness = e.borderThickness.value, d.textOptions.bordercolor = e.borderColor.value, d.textOptions.backgroundcolor = e.backgroundColor.value, d.textOptions.textcolor = e.textColor.value
} else if ("decal" == i) {
var m = r.dict.decalObjects[n],
o = parseFloat(e.hfovVRUINumberSlider.get()),
a = parseFloat(e.vfovVRUINumberSlider.get()),
c = parseFloat(e.xposVRUINumberSlider.get()),
l = parseFloat(e.yposVRUINumberSlider.get()),
h = parseFloat(e.planarOffsetXSlider.get()),
p = parseFloat(e.planarOffsetYSlider.get());
m.textureDescription.sphereFOV[0] = o, m.textureDescription.sphereFOV[1] = a, m.textureDescription.sphereCentre[0] = c, m.textureDescription.sphereCentre[1] = l, m.textureDescription.plane = e.isPlane.checked, m.textureDescription.planeOffset = [h, p], m.imgsrc = e.imageURL.value, m.jumpTo = e.sceneJump.value
}
if (e.setPanelVisibility(), "photo" == i) {
var g = e.imageURL.value;
if (-1 != g.indexOf("flickr.com/photos")) return void u(g, e.deferredImageUpdate);
e.updateImagePreview()
}
e.pushFromDictToRender()
}
}, this.deferredImageUpdate = function(t) {
var i = e.elementSelect.value.split("_"),
n = (i[0], i[1]),
r = e.sceneList.scenes[e.sceneSelect.value],
s = r.dict.photoObjects[n];
s.textureDescription.src = t, e.imagePreview.src = t, e.updateImagePreview(), e.pushFromDictToRender()
}, this.updateImagePreview = function() {
var t = 1024,
i = e.imagePreviewCanvas.getContext("2d");
i.clearRect(0, 0, t, t);
var n, r, s, o, a = i.canvas.clientWidth,
c = i.canvas.clientHeight,
l = e.imagePreview.width,
u = e.imagePreview.height,
h = a / c,
p = l / u;
if (p > h ? (s = t, o = s * h) : h > 1 && p > 1 ? (o = t, s = o / h) : h > p ? (o = t, s = o / h) : (s = t, o = s * h), n = .5 * t - .5 * s, r = .5 * t - .5 * o, e.isStereo.checked) {
i.globalAlpha = .5, i.drawImage(e.imagePreview, n, r, s, o), i.globalAlpha = 1, i.strokeStyle = "rgba(0,0,0,1.0)", i.fillStyle = i.strokeStyle, i.lineWidth = 4, i.moveTo(n, r), i.lineTo(n + s, r), i.moveTo(n, r + .5 * o), i.lineTo(n + s, r + .5 * o), i.moveTo(n, r + o), i.lineTo(n + s, r + o), i.moveTo(n, r), i.lineTo(n, r + o), i.moveTo(n + .5 * s, r), i.lineTo(n + .5 * s, r + o), i.moveTo(n + s, r), i.lineTo(n + s, r + o), i.stroke(), i.font = "32px Arial", i.fillText("(0,0)", n, r + 32), i.fillText("(0,0.5)", n, r + .5 * o - 32), i.fillText("(0,1)", n, r + o - 32), i.fillText("(0.5,0)", n + .5 * s - 96, r + 32), i.fillText("(0.5,0.5)", n + .5 * s - 116, r + .5 * o - 32), i.fillText("(0.5,1)", n + .5 * s - 96, r + o - 32), i.fillText("(1,0)", n + s - 72, r + 32), i.fillText("(1,0.5)", n + s - 96, r + .5 * o - 32), i.fillText("(1,1)", n + s - 72, r + o - 32), i.lineWidth = 1, i.font = "Bold 64px Arial";
var d = [parseFloat(e.U_l_x_slider.get()), parseFloat(e.U_l_y_slider.get())],
m = [parseFloat(e.V_l_x_slider.get()), parseFloat(e.V_l_y_slider.get())];
U = [n + d[0] * s, r + d[1] * o], V = [n + m[0] * s, r + m[1] * o], i.fillStyle = "rgba(255,0,0,0.5)", i.strokeStyle = "rgba(255,0,0,0.5)", i.fillRect(U[0], U[1], V[0] - U[0], V[1] - U[1]), i.stroke(), i.fillStyle = "rgba(255,0,0,1.0)", i.strokeStyle = "rgba(255,0,0,1.0)", i.fillText("Left", U[0], U[1] + 64);
var g = [parseFloat(e.U_r_x_slider.get()), parseFloat(e.U_r_y_slider.get())],
f = [parseFloat(e.V_r_x_slider.get()), parseFloat(e.V_r_y_slider.get())];
U = [n + g[0] * s, r + g[1] * o], V = [n + f[0] * s, r + f[1] * o], i.fillStyle = "rgba(0,0,255,0.5)", i.strokeStyle = "rgba(0,0,255,0.5)", i.fillRect(U[0], U[1], V[0] - U[0], V[1] - U[1]), i.stroke(), i.fillStyle = "rgba(0,0,255,1.0)", i.strokeStyle = "rgba(0,0,255,1.0)", i.fillText("Right", U[0], U[1] + 64)
} else i.drawImage(e.imagePreview, n, r, s, o)
}, this.loadImage = function() {
e.imagePreview.onload = e.updateImagePreview, e.inputStateChange();
var t = e.imageURL.value;
e.imagePreview.src = t
}, this.updateSceneListDropdown = function() {
for (e.sceneSelect.innerHTML = "", i = 0; i < e.sceneList.scenes.length; i++) {
var t = e.sceneList.scenes[i],
n = document.createElement("option");
n.value = i, "" != t.dict.name ? n.innerHTML = t.dict.name : n.innerHTML = i, e.sceneSelect.appendChild(n)
}
}, this.populateGUIFromSceneDict = function(t) {
e.sceneSelect.value = t, e.elementSelect.innerHTML = "";
var n = e.sceneList.scenes[t];
for (this.sceneName.value = n.dict.name, i = 0; i < n.dict.photoObjects.length; i++) {
var r = document.createElement("option");
r.value = "photo_" + i, r.innerHTML = "Image " + (i + 1), e.elementSelect.appendChild(r)
}
for (i = 0; i < n.dict.textObjects.length; i++) {
var r = document.createElement("option");
r.value = "text_" + i, r.innerHTML = "Text " + (i + 1), e.elementSelect.appendChild(r)
}
for (i = 0; i < n.dict.decalObjects.length; i++) {
var r = document.createElement("option");
r.value = "decal_" + i, r.innerHTML = "Decal " + (i + 1), e.elementSelect.appendChild(r)
}
e.pushFromDictToRender()
}, this.pushFromGUIToDict = function() {
e.sceneList.scenes[e.sceneSelect.value].dict.name = e.sceneName.value, e.updateSceneListDropdown(), e.pushFromDictToRender()
}, this.addImage = function() {
var t = e.sceneList.scenes[e.sceneSelect.value];
t.addPhoto(), e.populateGUIFromSceneDict(e.sceneSelect.value), e.elementSelect.value = "photo_" + (t.dict.photoObjects.length - 1), e.selectElement(), e.accordionStacker.showNamed("setup_scene_object")
}, this.addText = function() {
var t = e.sceneList.scenes[e.sceneSelect.value];
t.addText(), e.populateGUIFromSceneDict(e.sceneSelect.value), e.elementSelect.value = "text_" + (t.dict.textObjects.length - 1), e.selectElement(), e.accordionStacker.showNamed("setup_scene_object")
}, this.addDecal = function() {
var t = e.sceneList.scenes[e.sceneSelect.value];
t.addDecal(), e.populateGUIFromSceneDict(e.sceneSelect.value), e.elementSelect.value = "decal_" + (t.dict.decalObjects.length - 1), e.selectElement(), e.accordionStacker.showNamed("setup_scene_object")
}, this.removeElement = function() {
if ("" != e.elementSelect.value) {
var t = e.elementSelect.value.split("_"),
i = t[0],
n = t[1],
r = e.sceneList.scenes[e.sceneSelect.value];
"photo" == i ? r.removePhoto(n) : "text" == i ? r.removeText(n) : "decal" == i && r.removeDecal(n), e.populateGUIFromSceneDict(e.sceneSelect.value)
}
}, this.pushFromDictToRender = function() {
if (null != e.getStory()) {
for (e.getStory().sceneList = [], i = 0; i < e.sceneList.scenes.length; i++) e.getStory().sceneList.push(e.sceneList.scenes[i].vrScene);
var t = e.sceneList.scenes[e.sceneSelect.value];
e.getStory().sceneList[e.sceneSelect.value].initDict(t.dict), e.getStory().setupScene(e.sceneSelect.value), e.updateShare()
}
}, this.selectElement = function() {
if (e.setPanelVisibility(), "" != e.elementSelect.value) {
var t = e.elementSelect.value.split("_"),
i = t[0],
n = t[1],
r = e.sceneList.scenes[e.sceneSelect.value];
if ("photo" == i) {
var s = r.dict.photoObjects[n];
e.hfovVRUINumberSlider.set(s.textureDescription.sphereFOV[0]), e.vfovVRUINumberSlider.set(s.textureDescription.sphereFOV[1]), e.xposVRUINumberSlider.set(s.textureDescription.sphereCentre[0]), e.yposVRUINumberSlider.set(s.textureDescription.sphereCentre[1]), e.imageURL.value = s.textureDescription.src, e.isPlane.checked = s.textureDescription.plane, e.isStereo.checked = s.textureDescription.isStereo, e.U_l_x_slider.set(s.textureDescription.U_l[0]), e.U_l_y_slider.set(s.textureDescription.U_l[1]), e.V_l_x_slider.set(s.textureDescription.V_l[0]), e.V_l_y_slider.set(s.textureDescription.V_l[1]), e.U_r_x_slider.set(s.textureDescription.U_r[0]), e.U_r_y_slider.set(s.textureDescription.U_r[1]), e.V_r_x_slider.set(s.textureDescription.V_r[0]), e.V_r_y_slider.set(s.textureDescription.V_r[1]), e.planarOffsetXSlider.set(s.textureDescription.planeOffset[0]), e.planarOffsetYSlider.set(s.textureDescription.planeOffset[1]), e.loadImage()
} else if ("text" == i) {
var o = r.dict.textObjects[n];
e.hfovVRUINumberSlider.set(o.textureDescription.sphereFOV[0]), e.vfovVRUINumberSlider.set(o.textureDescription.sphereFOV[1]), e.xposVRUINumberSlider.set(o.textureDescription.sphereCentre[0]), e.yposVRUINumberSlider.set(o.textureDescription.sphereCentre[1]), e.planarOffsetXSlider.set(o.textureDescription.planeOffset[0]), e.planarOffsetYSlider.set(o.textureDescription.planeOffset[1]), e.isPlane.checked = o.textureDescription.plane, e.textMessage.value = o.message, e.sceneJump.value = o.jumpTo, e.fontAlign.value = o.textOptions.align, e.fontFace.value = o.textOptions.fontface, e.fontSize.value = o.textOptions.fontsize, e.borderThickness.value = o.textOptions.borderthickness, e.borderColor.value = o.textOptions.bordercolor, e.backgroundColor.value = o.textOptions.backgroundcolor, e.textColor.value = o.textOptions.textcolor
} else if ("decal" == i) {
var a = r.dict.decalObjects[n];
e.hfovVRUINumberSlider.set(a.textureDescription.sphereFOV[0]), e.vfovVRUINumberSlider.set(a.textureDescription.sphereFOV[1]), e.xposVRUINumberSlider.set(a.textureDescription.sphereCentre[0]), e.yposVRUINumberSlider.set(a.textureDescription.sphereCentre[1]), e.isPlane.checked = a.textureDescription.plane, e.planarOffsetXSlider.set(a.textureDescription.planeOffset[0]), e.planarOffsetYSlider.set(a.textureDescription.planeOffset[1]), e.imageURL.value = a.imgsrc, e.sceneJump.value = a.jumpTo
}
}
}, this.sceneSelectChange = function() {
e.populateGUIFromSceneDict(e.sceneSelect.value), e.selectElement()
}, this.addScene = function() {
e.sceneList.addScene(), e.updateSceneListDropdown(), e.populateGUIFromSceneDict(e.sceneSelect.length - 1)
}, this.removeScene = function() {
e.sceneList.removeScene(), e.updateSceneListDropdown()
}, this.stackerEditGallery = function() {
e.accordionStacker.totalHide("mode_pick", !0), e.accordionStacker.totalHide("manage_scenes", !0), e.accordionStacker.totalHide("manage_scene_objects", !0), e.accordionStacker.totalHide("setup_scene_object", !0), e.accordionStacker.totalHide("preview_dummy", !0), e.accordionStacker.totalHide("export", !1), e.accordionStacker.showNamed("export"), document.getElementById("preview_box").hidden = !0
}, this.stackerEditQuick = function() {
e.accordionStacker.totalHide("mode_pick", !0), e.accordionStacker.totalHide("manage_scenes", !0), e.accordionStacker.totalHide("manage_scene_objects", !0), e.accordionStacker.totalHide("setup_scene_object", !1), e.accordionStacker.totalHide("preview_dummy", !1), e.accordionStacker.totalHide("export", !1), e.accordionStacker.showNamed("setup_scene_object"), document.getElementById("preview_box").hidden = !1
}, this.stackerEditFull = function() {
e.accordionStacker.totalHide("mode_pick", !0), e.accordionStacker.totalHide("manage_scenes", !1), e.accordionStacker.totalHide("manage_scene_objects", !1), e.accordionStacker.totalHide("setup_scene_object", !1), e.accordionStacker.totalHide("preview_dummy", !1), e.accordionStacker.totalHide("export", !1), e.accordionStacker.showNamed("manage_scenes"), document.getElementById("preview_box").hidden = !1
}, this.stackerInit = function() {
e.accordionStacker.totalHide("manage_scenes", !0), e.accordionStacker.totalHide("manage_scene_objects", !0), e.accordionStacker.totalHide("setup_scene_object", !0), e.accordionStacker.totalHide("preview_dummy", !0), e.accordionStacker.totalHide("export", !0), document.getElementById("preview_box").hidden = !0
}, this.tryModeOneImage = function() {
if ("" != e.oneImage.value) {
e.oneImageMode = "single";
var t = e.oneImage.value; - 1 != t.indexOf("flickr.com/photos") ? u(t, e.loadModeOneImage) : e.loadModeOneImage(t)
}
}, this.tryMode360Image = function() {
if ("" != e.oneImage.value) {
e.oneImageMode = "360";
var t = e.oneImage.value; - 1 != t.indexOf("flickr.com/photos") ? u(t, e.loadModeOneImage) : e.loadModeOneImage(t)
}
}, this.tryModeStereoImage = function() {
if ("" != e.oneImage.value) {
e.oneImageMode = "stereo";
var t = e.oneImage.value; - 1 != t.indexOf("flickr.com/photos") ? u(t, e.loadModeOneImage) : e.loadModeOneImage(t)
}
}, this.tryModeGallery = function() {
if ("" != e.oneImage.value) {
var t = e.oneImage.value;
c.getImagesCallback(t, e.loadGallery), e.getStory().setGallerySrc(t)
}
}, this.loadGallery = function(t) {
e.sceneSelect.value = 0, e.sceneList.scenes = t, e.populateGUIFromSceneDict(e.sceneSelect.value), e.selectElement(), e.stackerEditGallery()
}, this.loadModeOneImage = function(t) {
var i = e.sceneList.scenes[e.sceneSelect.value];
i.addPhoto(), i.dict.photoObjects[0].textureDescription.src = t, "360" == e.oneImageMode ? i.dict.photoObjects[0].textureDescription.sphereFOV = [360, 180] : "stereo" == e.oneImageMode && (i.dict.photoObjects[0].textureDescription.isStereo = !0), e.populateGUIFromSceneDict(e.sceneSelect.value), e.elementSelect.value = "photo_" + (i.dict.photoObjects.length - 1), e.selectElement(), e.stackerEditQuick()
}, this.tryModeNewStory = function() {
e.stackerEditFull()
}, this.tryModeExistingStory = function() {
if ("" != e.existingStory.value) {
var t = e.existingStory.value,
i = new a,
n = i.init(t);
null != n && (e.sceneList.scenes = n, e.sceneList.sceneIdx = 0, e.updateSceneListDropdown(), e.populateGUIFromSceneDict(0), e.stackerEditFull())
}
}, this.updateShare = function() {
var t = e.getStory().getShareCodes(),
i = t[0],
n = t[1];
if (e.getStory().isSinglePhotoStory()) {
document.getElementById("singleShare").hidden = !1;
var r = "https://twitter.com/intent/tweet?text=" + encodeURIComponent("Check out my #vrEmbed ") + i,
s = "https://www.facebook.com/sharer/sharer.php?u=" + i,
o = "https://plus.google.com/share?url=" + i,
a = "https://www.reddit.com/submit?url=" + i;
document.getElementById("shareURL").href = decodeURIComponent(i), document.getElementById("shareTwitter").href = r, document.getElementById("shareFacebook").href = s, document.getElementById("shareGplus").href = o, document.getElementById("shareReddit").href = a
} else document.getElementById("singleShare").hidden = !0;
document.getElementById("shareEmbedCode").value = n
}, this.downloadURI = function(e, t) {
var i = document.createElement("a");
i.download = t, i.href = e, i.click()
}, this.exportEquirectangular = function() {
var t = e.getStory().createImageFromSphereTexture();
e.downloadURI(t, "exportEquirectangularTex.png")
}, this.initObjectPanel = function() {
this.imageURL = document.getElementById("imageURL"), this.imagePreviewCanvas = document.getElementById("imagePreviewCanvas");
var t = e.imagePreviewCanvas.getContext("2d");
t.canvas.width = 1024, t.canvas.height = 1024, this.imagePreview = new Image, this.imagePreview.crossOrigin = "Anonymous", this.imageURL.onchange = this.loadImage, this.imageURL.value = "", this.isPlane = document.getElementById("isPlane"), this.isStereo = document.getElementById("isStereo"), this.isPlane.onchange = this.inputStateChange, this.isStereo.onchange = this.inputStateChange, this.U_l_x_slider = new r, this.U_l_x_slider.init(document.getElementById("U_l_x"), document.getElementById("U_l_x_t"), 0, this.inputStateChange), this.U_l_y_slider = new r, this.U_l_y_slider.init(document.getElementById("U_l_y"), document.getElementById("U_l_y_t"), 0, this.inputStateChange), this.V_l_x_slider = new r, this.V_l_x_slider.init(document.getElementById("V_l_x"), document.getElementById("V_l_x_t"), 0, this.inputStateChange), this.V_l_y_slider = new r, this.V_l_y_slider.init(document.getElementById("V_l_y"), document.getElementById("V_l_y_t"), 0, this.inputStateChange), this.U_r_x_slider = new r, this.U_r_x_slider.init(document.getElementById("U_r_x"), document.getElementById("U_r_x_t"), 0, this.inputStateChange), this.U_r_y_slider = new r, this.U_r_y_slider.init(document.getElementById("U_r_y"), document.getElementById("U_r_y_t"), 0, this.inputStateChange), this.V_r_x_slider = new r, this.V_r_x_slider.init(document.getElementById("V_r_x"), document.getElementById("V_r_x_t"), 0, this.inputStateChange), this.V_r_y_slider = new r, this.V_r_y_slider.init(document.getElementById("V_r_y"), document.getElementById("V_r_y_t"), 0, this.inputStateChange);
var i = document.getElementById("loadImage");
i.onclick = this.loadImage, this.hfovVRUINumberSlider = new r, this.hfovVRUINumberSlider.init(document.getElementById("hfov"), document.getElementById("hfov_t"), 360, this.inputStateChange), this.vfovVRUINumberSlider = new r, this.vfovVRUINumberSlider.init(document.getElementById("vfov"), document.getElementById("vfov_t"), 180, this.inputStateChange), this.xposVRUINumberSlider = new r, this.xposVRUINumberSlider.init(document.getElementById("xpos"), document.getElementById("xpos_t"), 0, this.inputStateChange), this.yposVRUINumberSlider = new r, this.yposVRUINumberSlider.init(document.getElementById("ypos"), document.getElementById("ypos_t"), 0, this.inputStateChange), this.planarOffsetXSlider = new r, this.planarOffsetXSlider.init(document.getElementById("planeOffsetX"), document.getElementById("planeOffsetX_t"), 0, this.inputStateChange), this.planarOffsetYSlider = new r, this.planarOffsetYSlider.init(document.getElementById("planeOffsetY"), document.getElementById("planeOffsetY_t"), 0, this.inputStateChange), this.textMessage = document.getElementById("textMessage"), this.textMessage.onchange = this.inputStateChange, this.sceneJump = document.getElementById("sceneJump"), this.sceneJump.onchange = this.inputStateChange, this.fontAlign = document.getElementById("fontAlign"), this.fontAlign.onchange = this.inputStateChange, this.fontFace = document.getElementById("fontFace"), this.fontFace.onchange = this.inputStateChange, this.fontSize = document.getElementById("fontSize"), this.fontSize.onchange = this.inputStateChange, this.borderThickness = document.getElementById("borderThickness"), this.borderThickness.onchange = this.inputStateChange, this.borderColor = document.getElementById("borderColor"), this.borderColor.onchange = this.inputStateChange, this.backgroundColor = document.getElementById("backgroundColor"), this.backgroundColor.onchange = this.inputStateChange, this.textColor = document.getElementById("textColor"), this.textColor.onchange = this.inputStateChange
}, this.init = function(e) {
this.storyManager = e, this.sceneSelect = document.getElementById("sceneSelect"), this.sceneName = document.getElementById("sceneName"), this.elementSelect = document.getElementById("elementSelect");
var t = document.getElementById("addScene");
t.onclick = this.addScene;
var i = document.getElementById("removeScene");
i.onclick = this.removeScene, this.sceneSelect.onchange = this.sceneSelectChange, this.sceneName.onchange = this.pushFromGUIToDict, this.elementSelect.onchange = this.selectElement;
var n = document.getElementById("addImage"),
r = document.getElementById("addText"),
o = document.getElementById("addDecal"),
a = document.getElementById("removeElement");
n.onclick = this.addImage, r.onclick = this.addText, o.onclick = this.addDecal, a.onclick = this.removeElement, this.oneImage = document.getElementById("oneImage"), this.modeOneImage = document.getElementById("modeOneImage"), this.mode360Image = document.getElementById("mode360Image"), this.modeStereoImage = document.getElementById("modeStereoImage"), this.modeGallery = document.getElementById("modeGallery"), this.modeNewStory = document.getElementById("modeNewStory"), this.existingStory = document.getElementById("existingStory"), this.modeExistingStory = document.getElementById("modeExistingStory"), modeOneImage.onclick = this.tryModeOneImage, mode360Image.onclick = this.tryMode360Image, modeStereoImage.onclick = this.tryModeStereoImage, modeGallery.onclick = this.tryModeGallery, modeNewStory.onclick = this.tryModeNewStory, modeExistingStory.onclick = this.tryModeExistingStory, this.oneImage.value = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/vrEmbedLogo.png", this.exportEquirectangularButton = document.getElementById("exportEquirectangularButton"), this.exportEquirectangularButton.onclick = this.exportEquirectangular, this.initObjectPanel(), this.sceneList.init(), this.updateSceneListDropdown(), this.sceneSelect.value = 0, this.sceneSelectChange(), this.setPanelVisibility(), this.accordionStacker = new s, this.accordionStacker.add("mode_pick"), this.accordionStacker.add("manage_scenes"), this.accordionStacker.add("manage_scene_objects"), this.accordionStacker.add("setup_scene_object"), this.accordionStacker.add("preview_dummy"), this.accordionStacker.add("export"), this.accordionStacker.showNamed("mode_pick"), this.stackerInit()
}
}, t.exports = VRCreateUI
}, {
"./VRImageLoader.js": 3,
"./VRScene.js": 5,
"./VRSceneDict.js": 6,
"./VRStoryDict.js": 8,
"./VRUIAccordionStacker.js": 13,
"./VRUINumberSlider.js": 14,
"./VRUISceneList.js": 15
}],
2: [function(e, t, i) {
var n = e("./VRTextureDescription.js");
VRDecal = function() {
this.textureDescription = null, this.imgsrc = null, this.init = function(e) {
this.decal = e, this.textureDescription = new n, this.textureDescription.setSphereParamsFromString(this.decal.getAttribute("sphereParams")), this.textureDescription.plane = this.textureDescription.parseBoolString(this.decal.getAttribute("plane")), this.textureDescription.setPlaneOffsetParamsFromString(this.decal.getAttribute("planeOffset")), this.imgsrc = this.decal.getAttribute("src"), this.jumpTo = this.decal.getAttribute("jumpTo"), void 0 == this.jumpTo && (this.jumpTo = "")
}, this.initDict = function(e) {
this.textureDescription = new n, this.textureDescription.initDict(e.textureDescription), this.jumpTo = e.jumpTo, this.imgsrc = e.imgsrc
}, this.getDecalElement = function() {
var e = document.createElement("decal");
return this.textureDescription.setElement(e), e.setAttribute("src", this.imgsrc), "" != this.jumpTo && e.setAttribute("jumpTo", this.jumpTo), e
}
}, t.exports = VRDecal
}, {
"./VRTextureDescription.js": 11
}],
3: [function(e, t, n) {
function r(e) {
var t = "" + e;
return t = t.replace(/<br>/gi, "\n"), t = t.replace(/<br\s\/>/gi, "\n"), t = t.replace(/<br\/>/gi, "\n"), t = t.replace(/<p.*>/gi, "\n"), t = t.replace(/<a.*href="(.*?)".*>(.*?)<\/a>/gi, " $2 ($1)"), t = t.replace(/<script.*>[\w\W]{1,}(.*?)[\w\W]{1,}<\/script>/gi, ""), t = t.replace(/<style.*>[\w\W]{1,}(.*?)[\w\W]{1,}<\/style>/gi, ""), t = t.replace(/<(?:.|\s)*?>/g, ""), t = t.replace(/(?:(?:\r\n|\r|\n)\s*){2,}/gim, "\n\n"), t = t.replace(/ +(?= )/g, ""), t = t.replace(/ /gi, " "), t = t.replace(/&/gi, "&"), t = t.replace(/"/gi, '"'), t = t.replace(/</gi, "<"), t = t.replace(/>/gi, ">")
}
var s = e("./VRSceneDict.js"),
o = e("./VRURLParser.js"),
a = e("./VRMacroStrings.js");
String.prototype.padRight = function(e, t) {
return this + Array(e - this.length + 1).join(t || " ")
}, String.prototype.contains = function(e) {
return -1 != this.indexOf(e)
};
var c = function(e, t) {
var i = t - e.length,
n = (" " + e).slice(1);
return i > 0 && (n = n.padRight(i, " ")), n
},
h = {},
p = {},
d = {},
m = {},
g = {},
f = {},
x = function(e) {
var t = null,
n = e.split("/");
for (i = 0; l = n.length, i < l; i++)
if (n[i].endsWith("imgur.com") && i < l - 1) return t = n[i + 1], "" == t ? null : "a" == t ? i < l - 2 ? (t = n[i + 2], [t, "album"]) : null : "gallery" == t ? i < l - 2 ? (t = n[i + 2], [t, "gallery"]) : null : (partspl = t.split("."), "" == partspl[0] ? null : [partspl[0], "image"])
},
S = function(e, t, i, n) {
var r = "";
r += t, r += e, r += "?client_id=fe596e6329962dd";
var s = new XMLHttpRequest;
s.open("GET", r, !0), s.setRequestHeader("Authorization", "Client-ID fe596e6329962dd"), s.setRequestHeader("Accept", "application/json"), s.send(), s.onreadystatechange = function() {
if (4 == s.readyState && 200 == s.status) {
var t = JSON.parse(s.responseText);
i(e, t, n)
}
}
},
_ = function(e) {
var t = e.split("/"),
i = t.pop(),
n = i.split(".");
return t.join("/") + "/" + n[0] + "b." + n[1]
},
b = function(e) {
if (null == e) return null;
for (var t in a)
if (e.contains(t)) return t;
return null
},
D = function(e) {
if (null == e) return null;
var t = "vrEmbed:texParams=",
i = e.indexOf(t);
if (0 > i) return null;
var n = i + t.length,
r = e.slice(n + 1),
s = r.indexOf('"'),
o = r.slice(0, s);
return o
},
O = function(e) {
var t = {};
return 1 == e.animated ? null : e.height > 4096 || e.width > 4096 ? null : (t.src = e.link, t.thumb = _(t.src), t.title = e.title, t.description = e.description, t.width = e.width, t.height = e.height, t.attribution = "", t.misc = e.views + " views", t.macro = b(e.description), t.texParams = D(e.description), t)
},
y = function(e, t, i) {
m[e] = t;
var n = (t.data.link, O(t.data)),
r = {};
if (r.images = [n], r.galleryTitle = null, r.galleryDescription = null, r.galleryAttribution = null, r.galleryMisc = null, null != i && null != r) {
var s = W(r);
i(s)
}
},
I = function(e, t) {
return e in m ? void(null != t && y(m[e])) : void S(e, "https://api.imgur.com/3/image/", y, t)
},
V = function(e, t, n) {
g[e] = t;
var r = t.data.images,
s = t.data.title,
o = t.data.description,
a = t.data.account_id,
c = t.data.views + " views",
u = {};
for (u.galleryTitle = s, u.galleryDescription = o, u.galleryAttribution = a, u.galleryMisc = c, u.images = [], i = 0; l = r.length, i < l; i++) {
var h = r[i],
p = O(h);
null != p && u.images.push(p)
}
if (null != n && u != []) {
var d = W(u);
n(d)
}
},
E = function(e, t) {
return e in g ? void(null != t && V(g[e])) : void S(e, "https://api.imgur.com/3/album/", V, t)
},
w = function(e, t, n) {
f[e] = t;
var r = t.data.images,
s = t.data.title,
o = t.data.description,
a = t.data.account_id,
c = t.data.views + " views",
u = {};
for (u.galleryTitle = s, u.galleryDescription = o, u.galleryAttribution = a, u.galleryMisc = c, u.images = [], i = 0; l = r.length, i < l; i++) {
var h = r[i],
p = O(h);
null != p && u.images.push(p)
}
if (null != n && u != []) {
var d = W(u);
n(d)
}
},
j = function(e, t) {
return e in f ? void(null != t && w(f[e])) : void S(e, "https://api.imgur.com/3/gallery/album/", w, t)
},
U = function(e, t, i, n) {
var r = "";
r += "https://api.flickr.com/services/rest/?", r += "&api_key=c074e17f92ea52a8d9422928352b0053", r += "&format=json", r += "&nojsoncallback=1", r += t;
var s = new XMLHttpRequest;
s.open("GET", r, !0), s.send(), s.onreadystatechange = function() {
if (4 == s.readyState && 200 == s.status) {
var t = JSON.parse(s.responseText);
i(e, t, n)
}
}
},
F = function(e) {
var t = e.split("/"),
n = t.length;
for (i = 0; i < n && !t[0].contains("flickr.com"); i++) t.shift();
return t == [] || "sets" != t[3] && "albums" != t[3] ? null : t[4]
},
T = function(e, t, n) {
var r = t.sizes.size,
s = 0,
o = 0,
a = "";
for (i = 0; i < r.length; i++) {
var c = parseInt(r[i].width);
2048 >= c && c > o && (o = c, s = i), r[i].source.endsWith("_m.jpg") && (a = r[i].source)
}
"" == a && (a = r[s].source);
var l = {};
l.photo_id = e, l.thumb = a, l.img = r[s].source, l.width = parseInt(r[s].width), l.height = parseInt(r[s].height), h[e] = l, n(h[e])
},
R = function(e, t) {
return null == e ? !1 : e in h ? void t(h[e]) : void U(e, "&method=flickr.photos.getSizes&photo_id=" + e, T, t)
},
k = function(e, t, n) {
var s = t.photo.title._content,
o = t.photo.description._content,
a = t.photo.tags.tag,
c = null,
l = null;
for (i = 0; i < a.length; i++) {
var u = b(a[i].raw);
null != u && (c = u);
var h = D(a[i].raw);
null != h && (l = h)
}
var d = {};
d.photo_id = e, d.title = s, d.description = r(o), d.macro = c, d.texParams = l, p[e] = d, n(p[e])
},
C = function(e, t) {
return null == e ? !1 : e in p ? void t(p[e]) : void U(e, "&method=flickr.photos.getInfo&photo_id=" + e, k, t)
},
P = function(e, t, n) {
var r = t.photoset.photo,
s = {};
s.galleryTitle = "", void 0 != t.photoset.title && (s.galleryTitle = t.photoset.title), s.galleryDescription = "", void 0 != t.photoset.ownername && (s.galleryAttribution = t.photoset.ownername), s.galleryMisc = "";
var o = [];
for (i = 0; l = r.length, i < l; i++) o.push(r[i].id);
d[e] = [s, o], n([s, o])
},
L = function(e, t) {
return null == e ? !1 : e in d ? void t(d[e]) : void U(e, "&method=flickr.photosets.getPhotos&photoset_id=" + e, P, t)
},
B = {},
N = null,
M = function(e, t, n) {
var r = {},
s = null,
o = null;
for (i = 0; i < t.length; i++) t[i].photo_id == e && (s = t[i]);
for (i = 0; i < n.length; i++) n[i].photo_id == e && (o = n[i]);
return null == s || null == o ? null : (r.src = s.img, r.thumb = s.thumb, r.title = o.title, r.description = o.description, r.width = s.width, r.height = s.height, r.attribution = "", r.misc = "", r.macro = o.macro, r)
},
A = function() {
var e = B.dt,
t = B.photoIds.length;
for (e.images = [], z = 0; z < t; z++) {
var i = B.photoIds[z],
n = M(i, B.imageURLs, B.imageInfos);
null != n && e.images.push(n)
}
var r = W(e);
null != N && N(r)
},
H = function(e) {
B.imageURLs.push(e), B.imageURLs.length == B.targetSize && B.imageInfos.length == B.targetSize && A()
},
G = function(e) {
B.imageInfos.push(e), B.imageURLs.length == B.targetSize && B.imageInfos.length == B.targetSize && A()
},
q = function(e) {
var t = e[0],
n = e[1];
for (B = {}, B.targetSize = n.length, B.dt = t, B.photoIds = n, B.imageURLs = [], B.imageInfos = [], i = 0; i < n.length; i++) R(n[i], H), C(n[i], G)
},
J = 70,
X = function(e, t, i) {
return null == i ? [e, t] : ("vrEmbed:macro=360" == i ? (e.textureDescription.sphereFOV = [360, 180], e.textureDescription.plane = !1) : "vrEmbed:macro=3dparallel" == i ? (t.width = .5 * t.width,
e.textureDescription.sphereFOV = [J, J * t.height / t.width], e.textureDescription.isStereo = !0, e.textureDescription.U_l = [0, 0], e.textureDescription.V_l = [.5, 1], e.textureDescription.U_r = [.5, 0], e.textureDescription.V_r = [1, 1]) : "vrEmbed:macro=3dcrosseye" == i ? (t.width = .5 * t.width, e.textureDescription.sphereFOV = [J, J * t.height / t.width], e.textureDescription.isStereo = !0, e.textureDescription.U_l = [.5, 0], e.textureDescription.V_l = [1, 1], e.textureDescription.U_r = [0, 0], e.textureDescription.V_r = [.5, 1]) : "vrEmbed:macro=3d360" == i && (e.textureDescription.sphereFOV = [360, 180], e.textureDescription.plane = !1, e.textureDescription.isStereo = !0, e.textureDescription.U_l = [0, 0], e.textureDescription.V_l = [1, .5], e.textureDescription.U_r = [0, .5], e.textureDescription.V_r = [1, 1]), [e, t])
},
Y = function(e) {
var t = e.split(",");
return [
[parseFloat(t[0].trim()), parseFloat(t[1].trim())],
[parseFloat(t[2].trim()), parseFloat(t[3].trim())],
[parseFloat(t[4].trim()), parseFloat(t[5].trim())],
[parseFloat(t[6].trim()), parseFloat(t[7].trim())]
]
},
W = function(e) {
var t = [],
i = 9;
for (V = 0; l = e.images.length, V < l; V++) {
var n = Math.floor(V / i),
r = new s;
r.init(), r.dict.name = "image_" + V;
var o = e.images[V],
a = r.initPhoto();
a.textureDescription.src = o.src, a.textureDescription.sphereFOV = [J, J * o.height / o.width], a.textureDescription.plane = !0;
var h = X(a, o, o.macro),
p = h[0],
d = h[1];
if (null != o.texParams) {
var m = Y(o.texParams);
p.textureDescription.U_l = m[0], p.textureDescription.V_l = m[1], p.textureDescription.U_r = m[2], p.textureDescription.V_r = m[3]
}
r.dict.photoObjects.push(p);
var g = "",
f = 45;
null != d.title && (g += "Title: " + d.title + " \n"), null != d.description && (g += "Description: " + d.description + " \n");
var x = "";
"" != d.misc && (x += d.misc), "" != d.attribution && (x += " " + d.attribution), g += c(x, f) + " \n";
var S = .2;
if ("" != g) {
var _ = r.initText();
_.message = g, _.textOptions.borderthickness = 0, _.textOptions.align = "left", _.textOptions.fontface = "Times", _.textOptions.fontsize = 36, _.textureDescription.sphereFOV = [J / 1.5, 20], _.textureDescription.sphereCentre = [J, 0], _.textureDescription.plane = !0, _.textureDescription.planeOffset = [0, 0], r.dict.textObjects.push(_)
}
var b = r.initDecal();
b.imgsrc = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/vrEmbedLogo.png", b.textureDescription.sphereFOV = [J * S, J * S], b.textureDescription.sphereCentre = [0, -90], b.textureDescription.plane = !1, b.textureDescription.planeOffset = [0, 0], r.dict.decalObjects.push(b);
var D = -(.5 + S) * (J * d.height / d.width);
if (V > 0) {
var O = r.initDecal(),
y = e.images[V - 1];
O.jumpTo = "image_" + (V - 1), O.imgsrc = y.thumb, O.textureDescription.sphereFOV = [J * S, S * J * y.height / y.width], O.textureDescription.sphereCentre = [0, 0], O.textureDescription.plane = !0, O.textureDescription.planeOffset = [-(.5 - .5 * S) * J, D], r.dict.decalObjects.push(O)
}
if (V < e.images.length - 1) {
var O = r.initDecal(),
y = e.images[V + 1];
O.jumpTo = "image_" + (V + 1), O.imgsrc = y.thumb, O.textureDescription.sphereFOV = [J * S, S * J * y.height / y.width], O.textureDescription.sphereCentre = [0, 0], O.textureDescription.plane = !0, O.textureDescription.planeOffset = [(.5 - .5 * S) * J, D], r.dict.decalObjects.push(O)
}
var I = r.initDecal();
I.jumpTo = "index_" + n, I.imgsrc = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/gallery.png", I.textureDescription.sphereFOV = [J * S, J * S], I.textureDescription.sphereCentre = [0, 0], I.textureDescription.plane = !0, I.textureDescription.planeOffset = [0, D], r.dict.decalObjects.push(I), t.push(r)
}
var V, E, w, j = e.images.length,
U = i,
F = Math.ceil(j / i),
T = 0,
R = 0;
for (V = 0, E = j; E > V; V += U) {
w = e.images.slice(V, V + U);
var k = 0,
r = new s;
r.init(), r.dict.name = "index_" + T;
var C = 30;
for (v = 0; v < 3; v++) {
var P = -30;
for (u = 0; u < 3 && !(R >= j); u++) {
var O = r.initDecal(),
y = w[k];
O.jumpTo = "image_" + R, O.imgsrc = y.thumb, O.textureDescription.sphereFOV = [25, 25], O.textureDescription.sphereCentre = [0, 0], O.textureDescription.plane = !0, O.textureDescription.planeOffset = [P, C], r.dict.decalObjects.push(O), k += 1, R += 1, P += 30
}
C += -30
}
if (T > 0) {
var L = r.initDecal();
L.jumpTo = "index_" + (T - 1), L.imgsrc = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/prevArrow.png", L.textureDescription.sphereFOV = [15, 15], L.textureDescription.sphereCentre = [0, 0], L.textureDescription.plane = !0, L.textureDescription.planeOffset = [-20, -60], r.dict.decalObjects.push(L)
}
if (F - 1 > T) {
var B = r.initDecal();
B.jumpTo = "index_" + (T + 1), B.imgsrc = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/nextArrow.png", B.textureDescription.sphereFOV = [15, 15], B.textureDescription.sphereCentre = [0, 0], B.textureDescription.plane = !0, B.textureDescription.planeOffset = [20, -60], r.dict.decalObjects.push(B)
}
var b = r.initDecal();
b.imgsrc = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/vrEmbedLogo.png", b.textureDescription.sphereFOV = [2 * J * S, 2 * J * S], b.textureDescription.sphereCentre = [0, -90], b.textureDescription.plane = !1, b.textureDescription.planeOffset = [0, 0], r.dict.decalObjects.push(b);
var N = e.galleryTitle + " \n";
N += e.galleryDescription + " \n", N += "by " + e.galleryAttribution + " \n", N += e.galleryMisc + " \n";
var _ = r.initText();
_.message = N, _.textOptions.borderthickness = 0, _.textOptions.align = "left", _.textOptions.fontface = "Courier", _.textOptions.fontsize = 36, _.textureDescription.sphereFOV = [75, 20], _.textureDescription.sphereCentre = [90, 0], _.textureDescription.plane = !0, _.textureDescription.planeOffset = [0, 0], r.dict.textObjects.push(_), t.push(r), T += 1
}
return t
};
VRImageLoader = function() {
var e = this;
this.sceneList = [], this.storyManager = null, this.vrURLParser = new o, this.vrURLParser.init(), this.init = function(e) {
this.storyManager = e
}, this.hasURLParams = function() {
return this.vrURLParser.isEditor
}, this.getURLParameters = function() {
return this.vrURLParser.params
}, this.isGalleryURL = function() {
return "gallery" in this.getURLParameters()
}, this.isImageURL = function() {
return "src" in this.getURLParameters()
}, this.getImages = function(t) {
e.getImagesCallback(t, this.buildFromImageList)
}, this.getImagesCallback = function(t, i) {
null != e.getStory() && e.getStory().setGallerySrc(t);
var n = x(t);
null != n && ("image" == n[1] ? I(n[0], i) : "album" == n[1] ? E(n[0], i) : "gallery" == n[1] && j(n[0], i));
var r = F(t);
null != r && (L(r, q), N = this.buildFromImageList), e.getStory().setLoading(!0)
}, this.parseBoolString = function(e) {
return void 0 == e ? !1 : "true" == e.toLowerCase() ? !0 : !1
}, this.parsePlaneOffsetParamsFromString = function(e) {
if (void 0 != e) {
var t = e.split(",");
return [parseFloat(t[0].trim()), parseFloat(t[1].trim())]
}
}, this.getSphereParamsFromString = function(e) {
var t = e.split(",");
return [
[parseFloat(t[0].trim()), parseFloat(t[1].trim())],
[parseFloat(t[2].trim()), parseFloat(t[3].trim())]
]
}, this.getTexParamsFromString = function(e) {
var t = e.split(",");
return [
[parseFloat(t[0].trim()), parseFloat(t[1].trim())],
[parseFloat(t[2].trim()), parseFloat(t[3].trim())],
[parseFloat(t[4].trim()), parseFloat(t[5].trim())],
[parseFloat(t[6].trim()), parseFloat(t[7].trim())]
]
}, this.buildFromImageURLParams = function(e) {
var t = new Image;
t.onload = this.buildSingle, t.src = e.src
}, this.buildSingle = function() {
var t = e.getURLParameters(),
i = new s;
i.init();
var n = i.initPhoto();
if (n.name = "unit", n.textureDescription.src = t.src, void 0 != t.metaSrc ? n.textureDescription.metaSource = t.metaSrc : n.textureDescription.metaSource = "", n.textureDescription.isStereo = e.parseBoolString(t.isStereo), n.textureDescription.plane = e.parseBoolString(t.plane), n.textureDescription.planeOffset = e.parsePlaneOffsetParamsFromString(t.planeOffset), void 0 != t.sphereParams) {
var r = e.getSphereParamsFromString(t.sphereParams);
n.textureDescription.sphereFOV = r[0], n.textureDescription.sphereCentre = r[1]
}
if (void 0 != t.texParams) {
var o = e.getTexParamsFromString(t.texParams);
n.textureDescription.U_l = o[0], n.textureDescription.V_l = o[1], n.textureDescription.U_r = o[2], n.textureDescription.V_r = o[3]
}
i.dict.photoObjects.push(n);
var a = [];
a.push(i), e.pushFromDictToRender(a), e.getStory().setLoading(!1)
}, this.buildFromImageList = function(t) {
e.pushFromDictToRender(t), e.getStory().setLoading(!1)
}, this.getStory = function() {
return null == e.storyManager ? null : e.storyManager.storyList != [] ? e.storyManager.storyList[0] : null
}, this.pushFromDictToRender = function(t) {
if (null != e.getStory()) {
for (e.getStory().sceneList = [], e.getStory().namedSceneMap = {}, i = 0; i < t.length; i++) {
var n = t[i];
n.vrScene.initDict(t[i].dict), e.getStory().sceneList.push(n.vrScene), e.getStory().namedSceneMap[n.vrScene.name] = i
}
e.getStory().setupScene(0)
}
}
};
var Q = function() {
function e() {
var e = new VRImageLoader;
return e
}
var t;
return {
getInstance: function() {
return t || (t = e()), t
}
}
}();
t.exports = Q.getInstance()
}, {
"./VRMacroStrings.js": 4,
"./VRSceneDict.js": 6,
"./VRURLParser.js": 16
}],
4: [function(e, t, i) {
VRMacroStrings = {
"vrEmbed:macro=360": 0,
"vrEmbed:macro=3dparallel": 1,
"vrEmbed:macro=3dcrosseye": 2,
"vrEmbed:macro=3d360": 3
}, t.exports = VRMacroStrings
}, {}],
5: [function(e, t, n) {
var r = e("./VRScenePhoto.js"),
s = e("./VRText.js"),
o = e("./VRDecal.js");
VRScene = function() {
this.sceneElement = null, this.photoObjects = [], this.textObjects = [], this.decalObjects = [], this.oldScroll = null, this.isStereo = !1, this.name = "", this.parseChildNode = function(e) {
if ("PHOTO" == e.nodeName) {
var t = new r;
t.init(e), 1 == t.isStereo() && (this.isStereo = !0), this.photoObjects.push(t)
} else if ("TEXT" == e.nodeName) {
var i = new s;
i.init(e), this.textObjects.push(i)
} else if ("DECAL" == e.nodeName) {
var n = new o;
n.init(e), this.decalObjects.push(n)
}
for (var a = e.childNodes, c = 0, l = a.length; l > c; ++c) {
var u = a[c];
1 === u.nodeType && this.parseChildNode(u)
}
}, this.init = function(e) {
this.sceneElement = e;
var t = e.getAttribute("name");
null != t && (this.name = t);
for (var i = e.childNodes, n = 0, r = i.length; r > n; ++n) {
var s = i[n];
1 === s.nodeType && this.parseChildNode(s)
}
}, this.initDict = function(e) {
this.photoObjects = [], this.textObjects = [], this.decalObjects = [];
for (var t = 0, i = e.photoObjects.length; i > t; ++t) {
var n = new r;
n.initDict(e.photoObjects[t]), this.photoObjects.push(n)
}
for (var t = 0, i = e.textObjects.length; i > t; ++t) {
var a = new s;
a.initDict(e.textObjects[t]), this.textObjects.push(a)
}
for (var t = 0, i = e.decalObjects.length; i > t; ++t) {
var c = new o;
c.initDict(e.decalObjects[t]), this.decalObjects.push(c)
}
this.name = e.name
}, this.initVrEmbedPhoto = function(e) {
var t = new r;
t.init(e), 1 == t.isStereo() && (this.isStereo = !0), this.photoObjects.push(t)
}, this.getSceneElement = function() {
var e = document.createElement("scene");
for ("" != this.name && e.setAttribute("name", this.name), i = 0; i < this.photoObjects.length; i++) e.appendChild(this.photoObjects[i].getPhotoElement());
for (j = 0; j < this.textObjects.length; j++) e.appendChild(this.textObjects[j].getTextElement());
for (k = 0; k < this.decalObjects.length; k++) e.appendChild(this.decalObjects[k].getDecalElement());
return e
}, this.hasJumpNav = function() {
for (j = 0; j < this.textObjects.length; j++)
if ("" != this.textObjects[j].jumpTo) return !0;
for (j = 0; j < this.decalObjects.length; j++)
if ("" != this.decalObjects[j].jumpTo) return !0;
return !1
}
}, t.exports = VRScene
}, {
"./VRDecal.js": 2,
"./VRScenePhoto.js": 7,
"./VRText.js": 9
}],
6: [function(e, t, n) {
VRSceneDict = function() {
this.dict = null, this.vrScene = null, this.init = function() {
this.vrScene = new VRScene, this.dict = {}, this.dict.photoObjects = [], this.dict.textObjects = [], this.dict.decalObjects = [], this.dict.name = ""
}, this.initFromVrScene = function(e) {
for (this.vrScene = e, this.dict = {}, this.dict.name = e.name, this.dict.photoObjects = [], this.dict.textObjects = [], this.dict.decalObjects = [], i = 0; i < e.photoObjects.length; i++) this.dict.photoObjects.push(this.initFromScenePhoto(e.photoObjects[i]));
for (i = 0; i < e.textObjects.length; i++) this.dict.textObjects.push(this.initFromText(e.textObjects[i]));
for (i = 0; i < e.decalObjects.length; i++) this.dict.decalObjects.push(this.initFromDecal(e.decalObjects[i]))
}, this.initFromTextureDescription = function(e) {
var t = {};
return t.src = e.textureSource, t.metaSource = e.metaSource, t.isStereo = e.isStereo, t.sphereFOV = e.sphereFOV, t.sphereCentre = e.sphereCentre, t.planeOffset = e.planeOffset, t.U_l = e.U_l, t.V_l = e.V_l, t.U_r = e.U_r, t.V_r = e.V_r, t.plane = e.plane, t
}, this.initFromTextOptions = function(e) {
var t = {};
return t.align = e.align, t.fontface = e.fontface, t.fontsize = e.fontsize, t.borderThickness = e.borderthickness, t.borderColor = e.bordercolor, t.backgroundColor = e.backgroundcolor, t.textColor = e.textcolor, t
}, this.initFromScenePhoto = function(e) {
var t = {};
return t.textureDescription = this.initFromTextureDescription(e.textureDescription), t
}, this.initPhoto = function() {
var e = {};
return e.textureDescription = {}, e.textureDescription.src = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/vrEmbedLogo.png", e.textureDescription.isStereo = !1, e.textureDescription.plane = !1, e.textureDescription.sphereFOV = [60, 60], e.textureDescription.sphereCentre = [0, 0], e.textureDescription.planeOffset = [0, 0], e.textureDescription.U_l = [0, 0], e.textureDescription.V_l = [.5, 1], e.textureDescription.U_r = [.5, 0], e.textureDescription.V_r = [1, 1], e
}, this.initFromText = function(e) {
var t = {};
return t.textureDescription = this.initFromTextureDescription(e.textureDescription), t.textOptions = this.initFromTextOptions(e.textOptions), t.message = e.message, t.jumpTo = e.jumpTo, t
}, this.initText = function() {
var e = {};
return e.message = "Placeholder text", e.jumpTo = "", e.textureDescription = {}, e.textureDescription.src = "", e.textureDescription.isStereo = !1, e.textureDescription.plane = !1, e.textureDescription.sphereFOV = [60, 40], e.textureDescription.sphereCentre = [0, 0], e.textureDescription.planeOffset = [0, 0], e.textOptions = {}, e.textOptions.align = "center", e.textOptions.fontface = "Arial", e.textOptions.fontsize = "72", e.textOptions.borderthickness = "12", e.textOptions.bordercolor = "#FFFFFF", e.textOptions.backgroundcolor = "#000000", e.textOptions.textcolor = "#FFFFFF", e
}, this.initFromDecal = function(e) {
var t = {};
return t.textureDescription = this.initFromTextureDescription(e.textureDescription), t.imgsrc = e.imgsrc, t.jumpTo = e.jumpTo, t
}, this.initDecal = function() {
var e = {};
return e.imgsrc = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/vrEmbedLogo.png", e.jumpTo = "", e.textureDescription = {}, e.textureDescription.src = "", e.textureDescription.isStereo = !1, e.textureDescription.plane = !0, e.textureDescription.sphereFOV = [30, 30], e.textureDescription.sphereCentre = [0, 0], e.textureDescription.planeOffset = [0, 0], e
}, this.addDecal = function() {
var e = this.initDecal();
this.dict.decalObjects.push(e)
}, this.removeDecal = function(e) {
this.dict.decalObjects.splice(e, 1)
}, this.addPhoto = function() {
var e = this.initPhoto();
this.dict.photoObjects.push(e)
}, this.removePhoto = function(e) {
this.dict.photoObjects.splice(e, 1)
}, this.addText = function() {
var e = this.initText();
this.dict.textObjects.push(e)
}, this.removeText = function(e) {
this.dict.textObjects.splice(e, 1)
}
}, t.exports = VRSceneDict
}, {}],
7: [function(e, t, i) {
var n = e("./VRTextureDescription.js");
VRScenePhoto = function() {
this.scenePhoto = null, this.textureDescription = null, this.init = function(e) {
this.scenePhoto = e, this.textureDescription = new n, this.textureDescription.init(e)
}, this.initDict = function(e) {
this.textureDescription = new n, this.textureDescription.initDict(e.textureDescription)
}, this.populateElementCommon = function(e) {
this.textureDescription.setElement(e)
}, this.isStereo = function() {
return this.textureDescription.isStereo
}, this.getPhotoElement = function() {
var e = document.createElement("photo");
return this.populateElementCommon(e), e
}, this.getSinglePhotoVrEmbedElement = function() {
var e = document.createElement("a");
return e.setAttribute("class", "vrEmbedPhoto"), this.populateElementCommon(e), e
}, this.getSinglePhotoURLParams = function() {
var e = "?";
return e += "src=" + this.textureDescription.getAbsoluteTexturePath(), e += "&sphereParams=" + this.textureDescription.getSphereParamsString(), 0 == this.isStereo() ? e += "&isStereo=false" : (e += "&isStereo=true", e += "&texParams=" + this.textureDescription.getTexParamsString()), 0 == this.textureDescription.plane ? e += "&plane=false" : (e += "&plane=true", e += "&planeOffset=" + this.textureDescription.getPlaneOffsetParamsString()), e
}
}, t.exports = VRScenePhoto
}, {
"./VRTextureDescription.js": 11
}],
8: [function(e, t, i) {
var n = e("./VRSceneDict.js");
e("./VRUISceneList.js");
VRStoryDict = function() {
this.init = function(e) {
var t = document.createElement("div");
t.innerHTML = e;
var i = t.getElementsByTagName("story");
if (0 == i.length) return null;
var r = [];
for (storyit = 0; storyit < i.length; storyit++)
for (var s = i[storyit], o = s.childNodes, a = 0, c = o.length; c > a; ++a) {
var l = o[a];
if (1 === l.nodeType && "SCENE" == l.nodeName) {
var u = new VRScene;
u.init(l);
var h = new n;
h.initFromVrScene(u), r.push(h)
}
}
return t.remove(), r
}
}, t.exports = VRStoryDict
}, {
"./VRSceneDict.js": 6,
"./VRUISceneList.js": 15
}],
9: [function(e, t, i) {
var n = e("./VRTextureDescription.js"),
r = e("./VRTextOptions.js");
VRText = function() {
this.sceneText = null, this.textureDescription = null, this.textOptions = null, this.message = "", this.jumpTo = "", this.parseMessage = function(e) {
this.message = e
}, this.parseBoolString = function(e) {
return void 0 == e ? !1 : "true" == e.toLowerCase() ? !0 : !1
}, this.init = function(e) {
this.sceneText = e, this.sceneText.setAttribute("hidden", !0), this.parseMessage(this.sceneText.innerHTML), this.jumpTo = this.sceneText.getAttribute("jumpTo"), void 0 == this.jumpTo && (this.jumpTo = ""), this.textureDescription = new n, this.textureDescription.init(this.sceneText), this.textOptions = new r, this.textOptions.init(this.sceneText)
}, this.initDict = function(e) {
this.textureDescription = new n, this.textureDescription.initDict(e.textureDescription), this.parseMessage(e.message), this.jumpTo = e.jumpTo, this.textOptions = new r, this.textOptions.initDict(e.textOptions)
}, this.getTextElement = function() {
var e = document.createElement("text");
return this.textureDescription.setElement(e), e.innerHTML = this.message, "" != this.jumpTo && e.setAttribute("jumpTo", this.jumpTo), this.textOptions.setElement(e), e
}
}, t.exports = VRText
}, {
"./VRTextOptions.js": 10,
"./VRTextureDescription.js": 11
}],
10: [function(e, t, i) {
VRTextOptions = function() {
this.align = null, this.fontface = null, this.fontsize = null, this.borderThickness = null, this.borderColor = null, this.backgroundColor = null, this.textColor = null, this.init = function(e) {
this.align = e.getAttribute("align"), this.fontface = e.getAttribute("fontface"), this.fontsize = e.getAttribute("fontsize"), this.borderThickness = e.getAttribute("borderthickness"), this.borderColor = e.getAttribute("bordercolor"), this.backgroundColor = e.getAttribute("backgroundcolor"), this.textColor = e.getAttribute("textcolor")
}, this.initDict = function(e) {
this.align = e.align, this.fontface = e.fontface, this.fontsize = e.fontsize, this.borderThickness = e.borderthickness, this.borderColor = e.bordercolor, this.backgroundColor = e.backgroundcolor, this.textColor = e.textcolor
}, this.setElement = function(e) {
null != this.align && e.setAttribute("align", this.align), null != this.fontface && e.setAttribute("fontface", this.fontface), null != this.fontsize && e.setAttribute("fontsize", this.fontsize), null != this.borderThickness && e.setAttribute("borderthickness", this.borderThickness), null != this.borderColor && e.setAttribute("bordercolor", this.borderColor), null != this.backgroundColor && e.setAttribute("backgroundcolor", this.backgroundColor), null != this.textColor && e.setAttribute("textcolor", this.textColor)
}
}, t.exports = VRTextOptions
}, {}],
11: [function(e, t, i) {
VRTextureDescription = function() {
this.textureSource = "", this.metaSource = "", this.isStereo = !1, this.sphereFOV = [360, 180], this.sphereCentre = [0, 0], this.U_l = [0, 0], this.V_l = [1, 1], this.U_r = [0, 0], this.V_r = [1, 1], this.plane = !1, this.planeOffset = [0, 0], this.parseBoolString = function(e) {
return void 0 == e ? !1 : "true" == e.toLowerCase() ? !0 : !1
}, this.setPlaneOffsetParamsFromString = function(e) {
if (void 0 != e) {
var t = e.split(",");
this.planeOffset = [parseFloat(t[0].trim()), parseFloat(t[1].trim())]
}
}, this.setSphereParamsFromString = function(e) {
var t = e.split(",");
this.sphereFOV = [parseFloat(t[0].trim()), parseFloat(t[1].trim())], this.sphereCentre = [parseFloat(t[2].trim()), parseFloat(t[3].trim())]
}, this.setTexParamsFromString = function(e) {
var t = e.split(",");
this.U_l = [parseFloat(t[0].trim()), parseFloat(t[1].trim())], this.V_l = [parseFloat(t[2].trim()), parseFloat(t[3].trim())], this.U_r = [parseFloat(t[4].trim()), parseFloat(t[5].trim())], this.V_r = [parseFloat(t[6].trim()), parseFloat(t[7].trim())]
}, this.getPlaneOffsetParamsString = function() {
return this.planeOffset[0] + "," + this.planeOffset[1]
}, this.getSphereParamsString = function() {
return this.sphereFOV[0] + "," + this.sphereFOV[1] + "," + this.sphereCentre[0] + "," + this.sphereCentre[1]
}, this.getTexParamsString = function() {
return this.U_l[0] + "," + this.U_l[1] + "," + this.V_l[0] + "," + this.V_l[1] + "," + this.U_r[0] + "," + this.U_r[1] + "," + this.V_r[0] + "," + this.V_r[1]
}, this.getAbsoluteTexturePath = function() {
var e = document.createElement("a");
return e.href = this.textureSource, e.protocol + "//" + e.host + e.pathname + e.search + e.hash
}, this.init = function(e) {
this.setSphereParamsFromString(e.getAttribute("sphereParams")), this.plane = this.parseBoolString(e.getAttribute("plane")), this.setPlaneOffsetParamsFromString(e.getAttribute("planeOffset")), this.textureSource = e.getAttribute("src"), void 0 == this.textureSource && (this.textureSource = ""), this.metaSource = "", this.isStereo = this.parseBoolString(e.getAttribute("isStereo")), void 0 == this.isStereo && (this.isStereo = !1), 1 == this.isStereo && this.setTexParamsFromString(e.getAttribute("texParams"))
}, this.initDict = function(e) {
return this.textureSource = e.src, null == this.textureSource ? void(this.textureSource = null) : (this.metaSource = "", this.isStereo = e.isStereo, this.plane = e.plane, this.sphereFOV = e.sphereFOV, this.sphereCentre = e.sphereCentre, this.planeOffset = e.planeOffset, void(this.isStereo && (this.U_l = e.U_l, this.V_l = e.V_l, this.U_r = e.U_r, this.V_r = e.V_r)))
}, this.setElement = function(e) {
"" != this.textureSource && e.setAttribute("src", this.getAbsoluteTexturePath()), e.setAttribute("sphereParams", this.getSphereParamsString()), 0 == this.plane ? e.setAttribute("plane", "false") : (e.setAttribute("plane", "true"), e.setAttribute("planeOffset", this.getPlaneOffsetParamsString())), 0 == this.isStereo ? e.setAttribute("isStereo", "false") : (e.setAttribute("isStereo", "true"), e.setAttribute("texParams", this.getTexParamsString()))
}
}, t.exports = VRTextureDescription
}, {}],
12: [function(e, t, i) {
VRUIAccordion = function() {
var e = this;
this.bar = null, this.button = null, this.container = null, this.shown = !1, this.accordionManager = !1, this.name = null, this.totalHide = function(t) {
e.container.hidden = t, e.bar.hidden = t
}, this.show = function(t) {
e.shown = t, 0 == t ? (e.container.hidden = !0, e.button.innerHTML = "+") : (e.container.hidden = !1, e.button.innerHTML = "-")
}, this.toggle = function() {
e.accordionManager.toggle(e.name)
}, this.init = function(e, t) {
this.name = t, this.accordionManager = e, this.container = document.getElementById(t), this.button = document.getElementById(t + "_button"), this.bar = document.getElementById(t + "_bar"), this.button.onclick = this.toggle, this.show(!1)
}
}, t.exports = VRUIAccordion
}, {}],
13: [function(e, t, n) {
var r = e("./VRUIAccordion.js");
VRUIAccordionStacker = function() {
var e = this;
this.accordions = [], this.active = null, this.add = function(t) {
var i = new r;
i.init(e, t), e.accordions.push([t, i])
}, this.showNamed = function(t) {
for (i = 0; i < e.accordions.length; i++) t == e.accordions[i][0] ? (e.active = t, e.accordions[i][1].show(!0)) : e.accordions[i][1].show(!1)
}, this.toggle = function(t) {
e.active != t && e.showNamed(t)
}, this.totalHide = function(t, n) {
for (i = 0; i < e.accordions.length; i++)
if (t == e.accordions[i][0]) return void e.accordions[i][1].totalHide(n)
}
}, t.exports = VRUIAccordionStacker
}, {