forked from lisa-wolfgang/vrEmbed
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvrLoader.min.js
More file actions
515 lines (514 loc) · 30 KB
/
vrLoader.min.js
File metadata and controls
515 lines (514 loc) · 30 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
! function t(e, i, r) {
function n(o, a) {
if (!i[o]) {
if (!e[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 p = i[o] = {
exports: {}
};
e[o][0].call(p.exports, function(t) {
var i = e[o][1][t];
return n(i ? i : t)
}, p, p.exports, t, e, i, r)
}
return i[o].exports
}
for (var s = "function" == typeof require && require, o = 0; o < r.length; o++) n(r[o]);
return n
}({
1: [function(t, e, r) {
function n(t) {
var e = "" + t;
return e = e.replace(/<br>/gi, "\n"), e = e.replace(/<br\s\/>/gi, "\n"), e = e.replace(/<br\/>/gi, "\n"), e = e.replace(/<p.*>/gi, "\n"), e = e.replace(/<a.*href="(.*?)".*>(.*?)<\/a>/gi, " $2 ($1)"), e = e.replace(/<script.*>[\w\W]{1,}(.*?)[\w\W]{1,}<\/script>/gi, ""), e = e.replace(/<style.*>[\w\W]{1,}(.*?)[\w\W]{1,}<\/style>/gi, ""), e = e.replace(/<(?:.|\s)*?>/g, ""), e = e.replace(/(?:(?:\r\n|\r|\n)\s*){2,}/gim, "\n\n"), e = e.replace(/ +(?= )/g, ""), e = e.replace(/ /gi, " "), e = e.replace(/&/gi, "&"), e = e.replace(/"/gi, '"'), e = e.replace(/</gi, "<"), e = e.replace(/>/gi, ">")
}
var s = t("./VRSceneDict.js"),
o = t("./VRURLParser.js"),
a = t("./VRMacroStrings.js");
String.prototype.padRight = function(t, e) {
return this + Array(t - this.length + 1).join(e || " ")
}, String.prototype.contains = function(t) {
return -1 != this.indexOf(t)
};
var c = function(t, e) {
var i = e - t.length,
r = (" " + t).slice(1);
return i > 0 && (r = r.padRight(i, " ")), r
},
p = {},
h = {},
g = {},
m = {},
d = {},
f = {},
x = function(t) {
var e = null,
r = t.split("/");
for (i = 0; l = r.length, i < l; i++)
if (r[i].endsWith("imgur.com") && i < l - 1) return e = r[i + 1], "" == e ? null : "a" == e ? i < l - 2 ? (e = r[i + 2], [e, "album"]) : null : "gallery" == e ? i < l - 2 ? (e = r[i + 2], [e, "gallery"]) : null : (partspl = e.split("."), "" == partspl[0] ? null : [partspl[0], "image"])
},
D = function(t, e, i, r) {
var n = "";
n += e, n += t, n += "?client_id=fe596e6329962dd";
var s = new XMLHttpRequest;
s.open("GET", n, !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 e = JSON.parse(s.responseText);
i(t, e, r)
}
}
},
b = function(t) {
var e = t.split("/"),
i = e.pop(),
r = i.split(".");
return e.join("/") + "/" + r[0] + "b." + r[1]
},
O = function(t) {
if (null == t) return null;
for (var e in a)
if (t.contains(e)) return e;
return null
},
F = function(t) {
if (null == t) return null;
var e = "vrEmbed:texParams=",
i = t.indexOf(e);
if (0 > i) return null;
var r = i + e.length,
n = t.slice(r + 1),
s = n.indexOf('"'),
o = n.slice(0, s);
return o
},
S = function(t) {
var e = {};
return 1 == t.animated ? null : t.height > 4096 || t.width > 4096 ? null : (e.src = t.link, e.thumb = b(e.src), e.title = t.title, e.description = t.description, e.width = t.width, e.height = t.height, e.attribution = "", e.misc = t.views + " views", e.macro = O(t.description), e.texParams = F(t.description), e)
},
y = function(t, e, i) {
m[t] = e;
var r = (e.data.link, S(e.data)),
n = {};
if (n.images = [r], n.galleryTitle = null, n.galleryDescription = null, n.galleryAttribution = null, n.galleryMisc = null, null != i && null != n) {
var s = $(n);
i(s)
}
},
j = function(t, e) {
return t in m ? void(null != e && y(m[t])) : void D(t, "https://api.imgur.com/3/image/", y, e)
},
R = function(t, e, r) {
d[t] = e;
var n = e.data.images,
s = e.data.title,
o = e.data.description,
a = e.data.account_id,
c = e.data.views + " views",
p = {};
for (p.galleryTitle = s, p.galleryDescription = o, p.galleryAttribution = a, p.galleryMisc = c, p.images = [], i = 0; l = n.length, i < l; i++) {
var u = n[i],
h = S(u);
null != h && p.images.push(h)
}
if (null != r && p != []) {
var g = $(p);
r(g)
}
},
V = function(t, e) {
return t in d ? void(null != e && R(d[t])) : void D(t, "https://api.imgur.com/3/album/", R, e)
},
_ = function(t, e, r) {
f[t] = e;
var n = e.data.images,
s = e.data.title,
o = e.data.description,
a = e.data.account_id,
c = e.data.views + " views",
p = {};
for (p.galleryTitle = s, p.galleryDescription = o, p.galleryAttribution = a, p.galleryMisc = c, p.images = [], i = 0; l = n.length, i < l; i++) {
var u = n[i],
h = S(u);
null != h && p.images.push(h)
}
if (null != r && p != []) {
var g = $(p);
r(g)
}
},
L = function(t, e) {
return t in f ? void(null != e && _(f[t])) : void D(t, "https://api.imgur.com/3/gallery/album/", _, e)
},
w = function(t, e, i, r) {
var n = "";
n += "https://api.flickr.com/services/rest/?", n += "&api_key=c074e17f92ea52a8d9422928352b0053", n += "&format=json", n += "&nojsoncallback=1", n += e;
var s = new XMLHttpRequest;
s.open("GET", n, !0), s.send(), s.onreadystatechange = function() {
if (4 == s.readyState && 200 == s.status) {
var e = JSON.parse(s.responseText);
i(t, e, r)
}
}
},
P = function(t) {
var e = t.split("/"),
r = e.length;
for (i = 0; i < r && !e[0].contains("flickr.com"); i++) e.shift();
return e == [] || "sets" != e[3] && "albums" != e[3] ? null : e[4]
},
U = function(t, e, r) {
var n = e.sizes.size,
s = 0,
o = 0,
a = "";
for (i = 0; i < n.length; i++) {
var c = parseInt(n[i].width);
2048 >= c && c > o && (o = c, s = i), n[i].source.endsWith("_m.jpg") && (a = n[i].source)
}
"" == a && (a = n[s].source);
var l = {};
l.photo_id = t, l.thumb = a, l.img = n[s].source, l.width = parseInt(n[s].width), l.height = parseInt(n[s].height), p[t] = l, r(p[t])
},
T = function(t, e) {
return null == t ? !1 : t in p ? void e(p[t]) : void w(t, "&method=flickr.photos.getSizes&photo_id=" + t, U, e)
},
I = function(t, e, r) {
var s = e.photo.title._content,
o = e.photo.description._content,
a = e.photo.tags.tag,
c = null,
l = null;
for (i = 0; i < a.length; i++) {
var p = O(a[i].raw);
null != p && (c = p);
var u = F(a[i].raw);
null != u && (l = u)
}
var g = {};
g.photo_id = t, g.title = s, g.description = n(o), g.macro = c, g.texParams = l, h[t] = g, r(h[t])
},
E = function(t, e) {
return null == t ? !1 : t in h ? void e(h[t]) : void w(t, "&method=flickr.photos.getInfo&photo_id=" + t, I, e)
},
C = function(t, e, r) {
var n = e.photoset.photo,
s = {};
s.galleryTitle = "", void 0 != e.photoset.title && (s.galleryTitle = e.photoset.title), s.galleryDescription = "", void 0 != e.photoset.ownername && (s.galleryAttribution = e.photoset.ownername), s.galleryMisc = "";
var o = [];
for (i = 0; l = n.length, i < l; i++) o.push(n[i].id);
g[t] = [s, o], r([s, o])
},
M = function(t, e) {
return null == t ? !1 : t in g ? void e(g[t]) : void w(t, "&method=flickr.photosets.getPhotos&photoset_id=" + t, C, e)
},
k = {},
A = null,
q = function(t, e, r) {
var n = {},
s = null,
o = null;
for (i = 0; i < e.length; i++) e[i].photo_id == t && (s = e[i]);
for (i = 0; i < r.length; i++) r[i].photo_id == t && (o = r[i]);
return null == s || null == o ? null : (n.src = s.img, n.thumb = s.thumb, n.title = o.title, n.description = o.description, n.width = s.width, n.height = s.height, n.attribution = "", n.misc = "", n.macro = o.macro, n)
},
W = function() {
var t = k.dt,
e = k.photoIds.length;
for (t.images = [], z = 0; z < e; z++) {
var i = k.photoIds[z],
r = q(i, k.imageURLs, k.imageInfos);
null != r && t.images.push(r)
}
var n = $(t);
null != A && A(n)
},
G = function(t) {
k.imageURLs.push(t), k.imageURLs.length == k.targetSize && k.imageInfos.length == k.targetSize && W()
},
N = function(t) {
k.imageInfos.push(t), k.imageURLs.length == k.targetSize && k.imageInfos.length == k.targetSize && W()
},
B = function(t) {
var e = t[0],
r = t[1];
for (k = {}, k.targetSize = r.length, k.dt = e, k.photoIds = r, k.imageURLs = [], k.imageInfos = [], i = 0; i < r.length; i++) T(r[i], G), E(r[i], N)
},
H = 70,
J = function(t, e, i) {
return null == i ? [t, e] : ("vrEmbed:macro=360" == i ? (t.textureDescription.sphereFOV = [360, 180], t.textureDescription.plane = !1) : "vrEmbed:macro=3dparallel" == i ? (e.width = .5 * e.width, t.textureDescription.sphereFOV = [H, H * e.height / e.width], t.textureDescription.isStereo = !0, t.textureDescription.U_l = [0, 0], t.textureDescription.V_l = [.5, 1], t.textureDescription.U_r = [.5, 0], t.textureDescription.V_r = [1, 1]) : "vrEmbed:macro=3dcrosseye" == i ? (e.width = .5 * e.width, t.textureDescription.sphereFOV = [H, H * e.height / e.width], t.textureDescription.isStereo = !0, t.textureDescription.U_l = [.5, 0], t.textureDescription.V_l = [1, 1], t.textureDescription.U_r = [0, 0], t.textureDescription.V_r = [.5, 1]) : "vrEmbed:macro=3d360" == i && (t.textureDescription.sphereFOV = [360, 180], t.textureDescription.plane = !1, t.textureDescription.isStereo = !0, t.textureDescription.U_l = [0, 0], t.textureDescription.V_l = [1, .5], t.textureDescription.U_r = [0, .5], t.textureDescription.V_r = [1, 1]), [t, e])
},
X = function(t) {
var e = t.split(",");
return [
[parseFloat(e[0].trim()), parseFloat(e[1].trim())],
[parseFloat(e[2].trim()), parseFloat(e[3].trim())],
[parseFloat(e[4].trim()), parseFloat(e[5].trim())],
[parseFloat(e[6].trim()), parseFloat(e[7].trim())]
]
},
$ = function(t) {
var e = [],
i = 9;
for (R = 0; l = t.images.length, R < l; R++) {
var r = Math.floor(R / i),
n = new s;
n.init(), n.dict.name = "image_" + R;
var o = t.images[R],
a = n.initPhoto();
a.textureDescription.src = o.src, a.textureDescription.sphereFOV = [H, H * o.height / o.width], a.textureDescription.plane = !0;
var p = J(a, o, o.macro),
h = p[0],
g = p[1];
if (null != o.texParams) {
var m = X(o.texParams);
h.textureDescription.U_l = m[0], h.textureDescription.V_l = m[1], h.textureDescription.U_r = m[2], h.textureDescription.V_r = m[3]
}
n.dict.photoObjects.push(h);
var d = "",
f = 45;
null != g.title && (d += "Title: " + g.title + " \n"), null != g.description && (d += "Description: " + g.description + " \n");
var x = "";
"" != g.misc && (x += g.misc), "" != g.attribution && (x += " " + g.attribution), d += c(x, f) + " \n";
var D = .2;
if ("" != d) {
var b = n.initText();
b.message = d, b.textOptions.borderthickness = 0, b.textOptions.align = "left", b.textOptions.fontface = "Times", b.textOptions.fontsize = 36, b.textureDescription.sphereFOV = [H / 1.5, 20], b.textureDescription.sphereCentre = [H, 0], b.textureDescription.plane = !0, b.textureDescription.planeOffset = [0, 0], n.dict.textObjects.push(b)
}
var O = n.initDecal();
O.imgsrc = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/vrEmbedLogo.png", O.textureDescription.sphereFOV = [H * D, H * D], O.textureDescription.sphereCentre = [0, -90], O.textureDescription.plane = !1, O.textureDescription.planeOffset = [0, 0], n.dict.decalObjects.push(O);
var F = -(.5 + D) * (H * g.height / g.width);
if (R > 0) {
var S = n.initDecal(),
y = t.images[R - 1];
S.jumpTo = "image_" + (R - 1), S.imgsrc = y.thumb, S.textureDescription.sphereFOV = [H * D, D * H * y.height / y.width], S.textureDescription.sphereCentre = [0, 0], S.textureDescription.plane = !0, S.textureDescription.planeOffset = [-(.5 - .5 * D) * H, F], n.dict.decalObjects.push(S)
}
if (R < t.images.length - 1) {
var S = n.initDecal(),
y = t.images[R + 1];
S.jumpTo = "image_" + (R + 1), S.imgsrc = y.thumb, S.textureDescription.sphereFOV = [H * D, D * H * y.height / y.width], S.textureDescription.sphereCentre = [0, 0], S.textureDescription.plane = !0, S.textureDescription.planeOffset = [(.5 - .5 * D) * H, F], n.dict.decalObjects.push(S)
}
var j = n.initDecal();
j.jumpTo = "index_" + r, j.imgsrc = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/gallery.png", j.textureDescription.sphereFOV = [H * D, H * D], j.textureDescription.sphereCentre = [0, 0], j.textureDescription.plane = !0, j.textureDescription.planeOffset = [0, F], n.dict.decalObjects.push(j), e.push(n)
}
var R, V, _, L = t.images.length,
w = i,
P = Math.ceil(L / i),
U = 0,
T = 0;
for (R = 0, V = L; V > R; R += w) {
_ = t.images.slice(R, R + w);
var I = 0,
n = new s;
n.init(), n.dict.name = "index_" + U;
var E = 30;
for (v = 0; v < 3; v++) {
var C = -30;
for (u = 0; u < 3 && !(T >= L); u++) {
var S = n.initDecal(),
y = _[I];
S.jumpTo = "image_" + T, S.imgsrc = y.thumb, S.textureDescription.sphereFOV = [25, 25], S.textureDescription.sphereCentre = [0, 0], S.textureDescription.plane = !0, S.textureDescription.planeOffset = [C, E], n.dict.decalObjects.push(S), I += 1, T += 1, C += 30
}
E += -30
}
if (U > 0) {
var M = n.initDecal();
M.jumpTo = "index_" + (U - 1), M.imgsrc = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/prevArrow.png", M.textureDescription.sphereFOV = [15, 15], M.textureDescription.sphereCentre = [0, 0], M.textureDescription.plane = !0, M.textureDescription.planeOffset = [-20, -60], n.dict.decalObjects.push(M)
}
if (P - 1 > U) {
var k = n.initDecal();
k.jumpTo = "index_" + (U + 1), k.imgsrc = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/nextArrow.png", k.textureDescription.sphereFOV = [15, 15], k.textureDescription.sphereCentre = [0, 0], k.textureDescription.plane = !0, k.textureDescription.planeOffset = [20, -60], n.dict.decalObjects.push(k)
}
var O = n.initDecal();
O.imgsrc = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/vrEmbedLogo.png", O.textureDescription.sphereFOV = [2 * H * D, 2 * H * D], O.textureDescription.sphereCentre = [0, -90], O.textureDescription.plane = !1, O.textureDescription.planeOffset = [0, 0], n.dict.decalObjects.push(O);
var z = t.galleryTitle + " \n";
z += t.galleryDescription + " \n", z += "by " + t.galleryAttribution + " \n", z += t.galleryMisc + " \n";
var b = n.initText();
b.message = z, b.textOptions.borderthickness = 0, b.textOptions.align = "left", b.textOptions.fontface = "Courier", b.textOptions.fontsize = 36, b.textureDescription.sphereFOV = [75, 20], b.textureDescription.sphereCentre = [90, 0], b.textureDescription.plane = !0, b.textureDescription.planeOffset = [0, 0], n.dict.textObjects.push(b), e.push(n), U += 1
}
return e
};
VRImageLoader = function() {
var t = this;
this.sceneList = [], this.storyManager = null, this.vrURLParser = new o, this.vrURLParser.init(), this.init = function(t) {
this.storyManager = t
}, 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(e) {
t.getImagesCallback(e, this.buildFromImageList)
}, this.getImagesCallback = function(e, i) {
null != t.getStory() && t.getStory().setGallerySrc(e);
var r = x(e);
null != r && ("image" == r[1] ? j(r[0], i) : "album" == r[1] ? V(r[0], i) : "gallery" == r[1] && L(r[0], i));
var n = P(e);
null != n && (M(n, B), A = this.buildFromImageList), t.getStory().setLoading(!0)
}, this.parseBoolString = function(t) {
return void 0 == t ? !1 : "true" == t.toLowerCase() ? !0 : !1
}, this.parsePlaneOffsetParamsFromString = function(t) {
if (void 0 != t) {
var e = t.split(",");
return [parseFloat(e[0].trim()), parseFloat(e[1].trim())]
}
}, this.getSphereParamsFromString = function(t) {
var e = t.split(",");
return [
[parseFloat(e[0].trim()), parseFloat(e[1].trim())],
[parseFloat(e[2].trim()), parseFloat(e[3].trim())]
]
}, this.getTexParamsFromString = function(t) {
var e = t.split(",");
return [
[parseFloat(e[0].trim()), parseFloat(e[1].trim())],
[parseFloat(e[2].trim()), parseFloat(e[3].trim())],
[parseFloat(e[4].trim()), parseFloat(e[5].trim())],
[parseFloat(e[6].trim()), parseFloat(e[7].trim())]
]
}, this.buildFromImageURLParams = function(t) {
var e = new Image;
e.onload = this.buildSingle, e.src = t.src
}, this.buildSingle = function() {
var e = t.getURLParameters(),
i = new s;
i.init();
var r = i.initPhoto();
if (r.name = "unit", r.textureDescription.src = e.src, void 0 != e.metaSrc ? r.textureDescription.metaSource = e.metaSrc : r.textureDescription.metaSource = "", r.textureDescription.isStereo = t.parseBoolString(e.isStereo), r.textureDescription.plane = t.parseBoolString(e.plane), r.textureDescription.planeOffset = t.parsePlaneOffsetParamsFromString(e.planeOffset), void 0 != e.sphereParams) {
var n = t.getSphereParamsFromString(e.sphereParams);
r.textureDescription.sphereFOV = n[0], r.textureDescription.sphereCentre = n[1]
}
if (void 0 != e.texParams) {
var o = t.getTexParamsFromString(e.texParams);
r.textureDescription.U_l = o[0], r.textureDescription.V_l = o[1], r.textureDescription.U_r = o[2], r.textureDescription.V_r = o[3]
}
i.dict.photoObjects.push(r);
var a = [];
a.push(i), t.pushFromDictToRender(a), t.getStory().setLoading(!1)
}, this.buildFromImageList = function(e) {
t.pushFromDictToRender(e), t.getStory().setLoading(!1)
}, this.getStory = function() {
return null == t.storyManager ? null : t.storyManager.storyList != [] ? t.storyManager.storyList[0] : null
}, this.pushFromDictToRender = function(e) {
if (null != t.getStory()) {
for (t.getStory().sceneList = [], t.getStory().namedSceneMap = {}, i = 0; i < e.length; i++) {
var r = e[i];
r.vrScene.initDict(e[i].dict), t.getStory().sceneList.push(r.vrScene), t.getStory().namedSceneMap[r.vrScene.name] = i
}
t.getStory().setupScene(0)
}
}
};
var K = function() {
function t() {
var t = new VRImageLoader;
return t
}
var e;
return {
getInstance: function() {
return e || (e = t()), e
}
}
}();
e.exports = K.getInstance()
}, {
"./VRMacroStrings.js": 2,
"./VRSceneDict.js": 3,
"./VRURLParser.js": 4
}],
2: [function(t, e, i) {
VRMacroStrings = {
"vrEmbed:macro=360": 0,
"vrEmbed:macro=3dparallel": 1,
"vrEmbed:macro=3dcrosseye": 2,
"vrEmbed:macro=3d360": 3
}, e.exports = VRMacroStrings
}, {}],
3: [function(t, e, r) {
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(t) {
for (this.vrScene = t, this.dict = {}, this.dict.name = t.name, this.dict.photoObjects = [], this.dict.textObjects = [], this.dict.decalObjects = [], i = 0; i < t.photoObjects.length; i++) this.dict.photoObjects.push(this.initFromScenePhoto(t.photoObjects[i]));
for (i = 0; i < t.textObjects.length; i++) this.dict.textObjects.push(this.initFromText(t.textObjects[i]));
for (i = 0; i < t.decalObjects.length; i++) this.dict.decalObjects.push(this.initFromDecal(t.decalObjects[i]))
}, this.initFromTextureDescription = function(t) {
var e = {};
return e.src = t.textureSource, e.metaSource = t.metaSource, e.isStereo = t.isStereo, e.sphereFOV = t.sphereFOV, e.sphereCentre = t.sphereCentre, e.planeOffset = t.planeOffset, e.U_l = t.U_l, e.V_l = t.V_l, e.U_r = t.U_r, e.V_r = t.V_r, e.plane = t.plane, e
}, this.initFromTextOptions = function(t) {
var e = {};
return e.align = t.align, e.fontface = t.fontface, e.fontsize = t.fontsize, e.borderThickness = t.borderthickness, e.borderColor = t.bordercolor, e.backgroundColor = t.backgroundcolor, e.textColor = t.textcolor, e
}, this.initFromScenePhoto = function(t) {
var e = {};
return e.textureDescription = this.initFromTextureDescription(t.textureDescription), e
}, this.initPhoto = function() {
var t = {};
return t.textureDescription = {}, t.textureDescription.src = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/vrEmbedLogo.png", t.textureDescription.isStereo = !1, t.textureDescription.plane = !1, t.textureDescription.sphereFOV = [60, 60], t.textureDescription.sphereCentre = [0, 0], t.textureDescription.planeOffset = [0, 0], t.textureDescription.U_l = [0, 0], t.textureDescription.V_l = [.5, 1], t.textureDescription.U_r = [.5, 0], t.textureDescription.V_r = [1, 1], t
}, this.initFromText = function(t) {
var e = {};
return e.textureDescription = this.initFromTextureDescription(t.textureDescription), e.textOptions = this.initFromTextOptions(t.textOptions), e.message = t.message, e.jumpTo = t.jumpTo, e
}, this.initText = function() {
var t = {};
return t.message = "Placeholder text", t.jumpTo = "", t.textureDescription = {}, t.textureDescription.src = "", t.textureDescription.isStereo = !1, t.textureDescription.plane = !1, t.textureDescription.sphereFOV = [60, 40], t.textureDescription.sphereCentre = [0, 0], t.textureDescription.planeOffset = [0, 0], t.textOptions = {}, t.textOptions.align = "center", t.textOptions.fontface = "Arial", t.textOptions.fontsize = "72", t.textOptions.borderthickness = "12", t.textOptions.bordercolor = "#FFFFFF", t.textOptions.backgroundcolor = "#000000", t.textOptions.textcolor = "#FFFFFF", t
}, this.initFromDecal = function(t) {
var e = {};
return e.textureDescription = this.initFromTextureDescription(t.textureDescription), e.imgsrc = t.imgsrc, e.jumpTo = t.jumpTo, e
}, this.initDecal = function() {
var t = {};
return t.imgsrc = "https://lisa-wolfgang.github.io/vrEmbed/src/assets/vrEmbedLogo.png", t.jumpTo = "", t.textureDescription = {}, t.textureDescription.src = "", t.textureDescription.isStereo = !1, t.textureDescription.plane = !0, t.textureDescription.sphereFOV = [30, 30], t.textureDescription.sphereCentre = [0, 0], t.textureDescription.planeOffset = [0, 0], t
}, this.addDecal = function() {
var t = this.initDecal();
this.dict.decalObjects.push(t)
}, this.removeDecal = function(t) {
this.dict.decalObjects.splice(t, 1)
}, this.addPhoto = function() {
var t = this.initPhoto();
this.dict.photoObjects.push(t)
}, this.removePhoto = function(t) {
this.dict.photoObjects.splice(t, 1)
}, this.addText = function() {
var t = this.initText();
this.dict.textObjects.push(t)
}, this.removeText = function(t) {
this.dict.textObjects.splice(t, 1)
}
}, e.exports = VRSceneDict
}, {}],
4: [function(t, e, i) {
function r() {
var t = window.location.search.substr(1);
return null != t && "" != t ? n(t) : {}
}
function n(t) {
for (var e = {}, i = t.split("&"), r = 0; r < i.length; r++) {
var n = i[r].split("=");
e[n[0]] = decodeURIComponent(n[1])
}
return e
}
VRURLParser = function() {
this.isEditor = !1, this.params = [], this.scenePhoto = null, this.parseURL = function() {
this.params = r()
}, this.init = function() {
var t = document.getElementsByTagName("vrEditor");
this.parseURL();
var e = 0;
for (var i in this.params) e += 1;
0 != t.length && 0 != e && (this.isEditor = !0)
}
}, e.exports = VRURLParser
}, {}],
5: [function(t, e, i) {
var r = t("./VRImageLoader.js");
r.init(vrEmbed), r.hasURLParams() && (r.isGalleryURL() ? (vrEmbed.clearPage(), vrEmbed.initFullpage(), r.getImages(r.getURLParameters().gallery)) : r.isImageURL() && (vrEmbed.clearPage(), vrEmbed.initFullpage(), r.buildFromImageURLParams(r.getURLParameters()))), e.exports = VRImageLoader
}, {
"./VRImageLoader.js": 1
}]
}, {}, [5]);