@projektemacher/storymapjs 0.10.4 → 0.10.6
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/README.md +4 -2
- package/dist/assets/{demo-BbkXJcS5.js → demo-CVQ7kFek.js} +1 -1
- package/dist/assets/{harness-C4SHmAI-.js → harness-C-VZV-ou.js} +1 -1
- package/dist/assets/{main-DEPPWqNX.js → main-DwbXrrYn.js} +2 -2
- package/dist/css/fonts/font.oldstandard.css +2 -16
- package/dist/css/storymap.css +1 -1
- package/dist/demo.html +2 -2
- package/dist/docs/migration.html +15 -3
- package/dist/docs/readme.html +4 -2
- package/dist/examples/assets/zoomify-clamp/TileGroup0/0-0-0.jpg +0 -0
- package/dist/examples/assets/zoomify-clamp/TileGroup0/1-0-0.jpg +0 -0
- package/dist/examples/assets/zoomify-clamp/TileGroup0/1-1-0.jpg +0 -0
- package/dist/examples/assets/zoomify-clamp/TileGroup0/2-0-0.jpg +0 -0
- package/dist/examples/assets/zoomify-clamp/TileGroup0/2-0-1.jpg +0 -0
- package/dist/examples/assets/zoomify-clamp/TileGroup0/2-1-0.jpg +0 -0
- package/dist/examples/assets/zoomify-clamp/TileGroup0/2-1-1.jpg +0 -0
- package/dist/examples/assets/zoomify-clamp/TileGroup0/2-2-0.jpg +0 -0
- package/dist/examples/assets/zoomify-clamp/TileGroup0/2-2-1.jpg +0 -0
- package/dist/examples/scroll-hint.json +59 -0
- package/dist/examples/zoomify-clamp.json +49 -0
- package/dist/harness.html +2 -2
- package/dist/index.html +5 -3
- package/dist/js/storymap.d.ts +34 -5
- package/dist/js/storymap.js +194 -135
- package/dist/js/storymap.js.map +1 -1
- package/package.json +1 -1
- package/schema/storymap.schema.json +4 -0
package/dist/js/storymap.js
CHANGED
|
@@ -223,6 +223,10 @@ var k = {
|
|
|
223
223
|
minItems: 4,
|
|
224
224
|
maxItems: 4
|
|
225
225
|
}, { type: "null" }] },
|
|
226
|
+
map_area: {
|
|
227
|
+
type: "string",
|
|
228
|
+
enum: ["full", "left"]
|
|
229
|
+
},
|
|
226
230
|
consent_required: { type: "boolean" },
|
|
227
231
|
map_center_offset: {
|
|
228
232
|
type: "object",
|
|
@@ -23164,7 +23168,16 @@ var Px = {
|
|
|
23164
23168
|
lon: this.data.location.lon
|
|
23165
23169
|
} : {};
|
|
23166
23170
|
}
|
|
23167
|
-
}
|
|
23171
|
+
};
|
|
23172
|
+
function Bx(e, t) {
|
|
23173
|
+
if (t.naturalWidth !== 256 || t.naturalHeight !== 256) {
|
|
23174
|
+
let n = document.createElement("canvas");
|
|
23175
|
+
n.width = 256, n.height = 256, n.getContext("2d")?.drawImage(t, 0, 0), e.setImage(n);
|
|
23176
|
+
}
|
|
23177
|
+
}
|
|
23178
|
+
//#endregion
|
|
23179
|
+
//#region src/map/openlayers/Map.OpenLayers.ts
|
|
23180
|
+
var Vx = 19, Hx = Array.from({ length: 25 }, (e, t) => 2 ** (16 - t)), Ux = class extends Ix {
|
|
23168
23181
|
_createMap() {
|
|
23169
23182
|
let e = this.options.map_type === "iiif" && this.options.map_as_image, t = this.options.map_options ?? {}, { element: n, view: r, ...i } = t, a = r ?? {}, o = this._bboxExtent();
|
|
23170
23183
|
this._map = new gd({
|
|
@@ -23177,13 +23190,16 @@ var Px = {
|
|
|
23177
23190
|
center: [0, 0],
|
|
23178
23191
|
zoom: 0,
|
|
23179
23192
|
minZoom: 0,
|
|
23180
|
-
maxZoom: e ?
|
|
23193
|
+
maxZoom: e ? Hx.length - 1 : Vx,
|
|
23181
23194
|
...e ? {
|
|
23182
23195
|
multiWorld: !0,
|
|
23183
|
-
resolutions:
|
|
23196
|
+
resolutions: Hx
|
|
23184
23197
|
} : {},
|
|
23185
23198
|
...this.options.map_type === "zoomify" ? { multiWorld: !0 } : {},
|
|
23186
|
-
...o ? {
|
|
23199
|
+
...o ? {
|
|
23200
|
+
extent: o,
|
|
23201
|
+
constrainOnlyCenter: !0
|
|
23202
|
+
} : {},
|
|
23187
23203
|
...a
|
|
23188
23204
|
})
|
|
23189
23205
|
}), this._map.on("loadend", () => {
|
|
@@ -23319,6 +23335,10 @@ var Px = {
|
|
|
23319
23335
|
let l = 0;
|
|
23320
23336
|
for (let e = 0; e < c; e++) l += i(e) * a(e);
|
|
23321
23337
|
return l += s * i(c) + o, `${t}TileGroup${Math.floor(l / 256)}/${c}-${o}-${s}.jpg`;
|
|
23338
|
+
},
|
|
23339
|
+
tileLoadFunction: (e, t) => {
|
|
23340
|
+
let n = e, r = n.getImage();
|
|
23341
|
+
r.onload = () => Bx(n, r), r.src = t;
|
|
23322
23342
|
}
|
|
23323
23343
|
}) });
|
|
23324
23344
|
}
|
|
@@ -23344,7 +23364,7 @@ var Px = {
|
|
|
23344
23364
|
this.options.map_as_image && (this.zoom_min_max.min = 0), this.bounds_array ||= this._getAllMarkersBounds(this._markers);
|
|
23345
23365
|
let e = Pe(this.options), t = Fe("consent_service_tiles", "map tiles"), n = !(this.options.consent_required && e && !e.isGranted(t));
|
|
23346
23366
|
this._tile_layer_mini = n ? this._createTileLayer(this.options.map_type) : null;
|
|
23347
|
-
let r = this.options.map_type === "iiif" && this.options.map_as_image, i = this.options.map_type === "zoomify", a = i ? this._zoomifyPyramid() : null;
|
|
23367
|
+
let r = this.options.map_type === "iiif" && this.options.map_as_image, i = this.options.map_type === "zoomify", a = i ? this._zoomifyPyramid() : null, o = a ? a.tileGrid.getResolutions() : null;
|
|
23348
23368
|
if (this._mini_map = new Km({
|
|
23349
23369
|
...r || a ? { view: new bo({
|
|
23350
23370
|
projection: this._map.getView().getProjection(),
|
|
@@ -23352,16 +23372,16 @@ var Px = {
|
|
|
23352
23372
|
zoom: this.zoom_min_max.min || 0,
|
|
23353
23373
|
...r ? {
|
|
23354
23374
|
multiWorld: !0,
|
|
23355
|
-
resolutions:
|
|
23375
|
+
resolutions: Hx,
|
|
23356
23376
|
minZoom: 0,
|
|
23357
|
-
maxZoom:
|
|
23377
|
+
maxZoom: Hx.length - 1
|
|
23358
23378
|
} : {},
|
|
23359
|
-
...a ? {
|
|
23379
|
+
...a && o ? {
|
|
23360
23380
|
constrainOnlyCenter: !0,
|
|
23361
23381
|
extent: a.extent,
|
|
23382
|
+
resolutions: o,
|
|
23362
23383
|
minZoom: 0,
|
|
23363
|
-
maxZoom:
|
|
23364
|
-
zoom: 0,
|
|
23384
|
+
maxZoom: o.length - 1,
|
|
23365
23385
|
center: [(a.extent[0] + a.extent[2]) / 2, (a.extent[1] + a.extent[3]) / 2]
|
|
23366
23386
|
} : {}
|
|
23367
23387
|
}) } : {},
|
|
@@ -23370,9 +23390,12 @@ var Px = {
|
|
|
23370
23390
|
label: "»",
|
|
23371
23391
|
collapsed: !0
|
|
23372
23392
|
}), this._map.addControl(this._mini_map), a) {
|
|
23373
|
-
let e = this._mini_map.getOverviewMap(), t =
|
|
23374
|
-
|
|
23375
|
-
|
|
23393
|
+
let e = this._mini_map.getOverviewMap(), t = () => {
|
|
23394
|
+
let t = e.getSize(), n = t && t[0] >= 50 && t[1] >= 50 ? t : [150, 100];
|
|
23395
|
+
e.getView().fit(a.extent, { size: n });
|
|
23396
|
+
};
|
|
23397
|
+
t(), e.on("change:size", t);
|
|
23398
|
+
} else !i && this.bounds_array && this.bounds_array.length && this._fitView(this._mini_map.getOverviewMap(), this.bounds_array, 0, this._bboxExtent() !== null);
|
|
23376
23399
|
this.options.map_type === "iiif" && this.options.map_as_image && this._fitMiniMapToImage();
|
|
23377
23400
|
}
|
|
23378
23401
|
_fitMiniMapToImage() {
|
|
@@ -23461,12 +23484,19 @@ var Px = {
|
|
|
23461
23484
|
let i = r[1].split(/[,\s/]+/).filter((e) => e !== "").map(Number);
|
|
23462
23485
|
if ((i.length >= 4 ? i[3] : 1) < .9) return e;
|
|
23463
23486
|
let a = this._el.map.getBoundingClientRect(), o = t.getBoundingClientRect();
|
|
23464
|
-
return !a.width || !o.width || (this.options.layout === "portrait" ? e[2] += Math.max(0, a.bottom - o.top) : e[1] += Math.max(0, o.right - a.left)), e;
|
|
23487
|
+
return !a.width || !o.width || !(o.left < a.right && o.right > a.left && o.top < a.bottom && o.bottom > a.top) || (this.options.layout === "portrait" ? e[2] += Math.max(0, a.bottom - o.top) : e[1] += Math.max(0, o.right - a.left)), e;
|
|
23465
23488
|
}
|
|
23466
|
-
_fitView(e, t, n = 0) {
|
|
23489
|
+
_fitView(e, t, n = 0, r = !1) {
|
|
23467
23490
|
if (!t || !t.length) return;
|
|
23468
|
-
let
|
|
23469
|
-
|
|
23491
|
+
let i = un(this._markerCoordsToViewCoords(t));
|
|
23492
|
+
if (r) {
|
|
23493
|
+
let e = this._bboxExtent();
|
|
23494
|
+
if (e) {
|
|
23495
|
+
let t = Rn(i, e);
|
|
23496
|
+
i = t[0] <= t[2] && t[1] <= t[3] ? t : e;
|
|
23497
|
+
}
|
|
23498
|
+
}
|
|
23499
|
+
e.getView().fit(i, {
|
|
23470
23500
|
size: e.getSize(),
|
|
23471
23501
|
padding: this._opaquePanelPadding(),
|
|
23472
23502
|
maxZoom: 12,
|
|
@@ -23711,7 +23741,7 @@ var Px = {
|
|
|
23711
23741
|
});
|
|
23712
23742
|
}
|
|
23713
23743
|
} else {
|
|
23714
|
-
this._fitView(this._map, this.bounds_array, 0);
|
|
23744
|
+
this._fitView(this._map, this.bounds_array, 0, this._bboxExtent() !== null);
|
|
23715
23745
|
let t = this._map.getView(), n = t.getZoom();
|
|
23716
23746
|
if (n !== void 0) {
|
|
23717
23747
|
let r = this._fromViewCoords(t.getCenter(), t.getProjection()), i = this._getMapCenterOffset(r, n);
|
|
@@ -23738,9 +23768,9 @@ var Px = {
|
|
|
23738
23768
|
this._tile_layer_mini = this._createTileLayer(this.options.map_type), e.addLayer(this._tile_layer_mini);
|
|
23739
23769
|
let r = this.options.map_type === "zoomify" ? this._zoomifyPyramid() : null;
|
|
23740
23770
|
if (r) {
|
|
23741
|
-
let t = e.getSize(), n = t && t[0] >= 50 && t[1] >= 50 ? t : [150,
|
|
23771
|
+
let t = e.getSize(), n = t && t[0] >= 50 && t[1] >= 50 ? t : [150, 100];
|
|
23742
23772
|
e.getView().fit(r.extent, { size: n });
|
|
23743
|
-
} else this.bounds_array && this.bounds_array.length && this._fitView(e, this.bounds_array);
|
|
23773
|
+
} else this.bounds_array && this.bounds_array.length && this._fitView(e, this.bounds_array, 0, this._bboxExtent() !== null);
|
|
23744
23774
|
this.options.map_type === "iiif" && this.options.map_as_image && this._fitMiniMapToImage();
|
|
23745
23775
|
}
|
|
23746
23776
|
applyOptions(e) {
|
|
@@ -23808,7 +23838,7 @@ var Px = {
|
|
|
23808
23838
|
let r = this._map.getView();
|
|
23809
23839
|
r.setZoom(t), r.setCenter(this._toViewCoords(n)), this._map.renderSync();
|
|
23810
23840
|
}
|
|
23811
|
-
},
|
|
23841
|
+
}, Wx = {
|
|
23812
23842
|
addListener: function(e, t, n, r) {
|
|
23813
23843
|
let i = function(t) {
|
|
23814
23844
|
return n.call(r || e, t);
|
|
@@ -23822,7 +23852,7 @@ var Px = {
|
|
|
23822
23852
|
preventDefault: function(e) {
|
|
23823
23853
|
e.preventDefault ? e.preventDefault() : e.returnValue = !1;
|
|
23824
23854
|
}
|
|
23825
|
-
},
|
|
23855
|
+
}, Gx = class {
|
|
23826
23856
|
constructor(e, t, n) {
|
|
23827
23857
|
this._el = {
|
|
23828
23858
|
parent: {},
|
|
@@ -23893,16 +23923,16 @@ var Px = {
|
|
|
23893
23923
|
this.collapsed ? (this.collapsed = !1, this.show(), this._el.button_overview.style.display = "inline", this.fire("collapse", { y: this.options.menubar_default_y }), Px.mobile ? this._el.button_collapse_toggle.innerHTML = "<span class='vco-icon-arrow-up'></span>" : this._el.button_collapse_toggle.innerHTML = M.buttons.collapse_toggle + "<span class='vco-icon-arrow-up'></span>") : (this.collapsed = !0, this.hide(25), this._el.button_overview.style.display = "none", this.fire("collapse", { y: 1 }), Px.mobile ? this._el.button_collapse_toggle.innerHTML = "<span class='vco-icon-arrow-down'></span>" : this._el.button_collapse_toggle.innerHTML = M.buttons.uncollapse_toggle + "<span class='vco-icon-arrow-down'></span>");
|
|
23894
23924
|
}
|
|
23895
23925
|
_initLayout() {
|
|
23896
|
-
this._el.button_overview = N.create("span", "vco-menubar-button", this._el.container),
|
|
23926
|
+
this._el.button_overview = N.create("span", "vco-menubar-button", this._el.container), Wx.addListener(this._el.button_overview, "click", this._onButtonOverview, this), this.options.show_overview === !1 && (this._el.button_overview.style.display = "none"), this._el.button_backtostart = N.create("span", "vco-menubar-button", this._el.container), Wx.addListener(this._el.button_backtostart, "click", this._onButtonBackToStart, this), this.options.show_back_to_start === !1 && (this._el.button_backtostart.style.display = "none"), this._el.button_fullscreen = N.create("span", "vco-menubar-button", this._el.container), Wx.addListener(this._el.button_fullscreen, "click", this._onButtonFullscreen, this), this.options.fullscreen === !1 && (this._el.button_fullscreen.style.display = "none"), this._el.button_collapse_toggle = N.create("span", "vco-menubar-button", this._el.container), Wx.addListener(this._el.button_collapse_toggle, "click", this._onButtonCollapseMap, this), this.options.map_as_image ? this._el.button_overview.innerHTML = M.buttons.overview : this._el.button_overview.innerHTML = M.buttons.map_overview, this.options.show_progress && (this._el.progress = N.create("span", "vco-menubar-progress", this._el.container), this._el.progress_fill = N.create("span", "vco-menubar-progress-fill", this._el.progress)), this.options.show_distance && (this._el.distance = N.create("span", "vco-menubar-distance", this._el.container)), Px.mobile ? (this._el.button_backtostart.innerHTML = "<span class='vco-icon-goback'></span>", this._el.button_collapse_toggle.innerHTML = "<span class='vco-icon-arrow-up'></span>", this._el.button_fullscreen.innerHTML = "<span class='vco-icon-resize-full'></span>", this._el.container.setAttribute("ontouchstart", " ")) : (this._el.button_backtostart.innerHTML = M.buttons.backtostart + " <span class='vco-icon-goback'></span>", this._el.button_collapse_toggle.innerHTML = M.buttons.collapse_toggle + "<span class='vco-icon-arrow-up'></span>", this._el.button_fullscreen.innerHTML = M.buttons.fullscreen + " <span class='vco-icon-resize-full'></span>"), this.options.layout === "landscape" && (this._el.button_collapse_toggle.style.display = "none");
|
|
23897
23927
|
}
|
|
23898
23928
|
_updateDisplay(e, t, n) {
|
|
23899
23929
|
e && (this.options.width = e), t && (this.options.height = t);
|
|
23900
23930
|
}
|
|
23901
|
-
},
|
|
23931
|
+
}, Kx = class extends Ze(Xe(Gx)) {
|
|
23902
23932
|
constructor(...e) {
|
|
23903
23933
|
super(...e);
|
|
23904
23934
|
}
|
|
23905
|
-
},
|
|
23935
|
+
}, qx = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
23906
23936
|
(function(e, n) {
|
|
23907
23937
|
typeof define == "function" ? define(n) : t === void 0 ? this[e] = n() : t.exports = n();
|
|
23908
23938
|
})("morpheus", function() {
|
|
@@ -24063,7 +24093,7 @@ var Px = {
|
|
|
24063
24093
|
}
|
|
24064
24094
|
return oe.tween = A, oe.getStyle = v, oe.bezier = ne, oe.transform = g, oe.parseTransform = T, oe.formatTransform = E, oe.animationFrame = y, oe.easings = {}, oe;
|
|
24065
24095
|
});
|
|
24066
|
-
})))(), 1),
|
|
24096
|
+
})))(), 1), Jx = class {
|
|
24067
24097
|
constructor(e, t, n) {
|
|
24068
24098
|
this._el = {
|
|
24069
24099
|
container: {},
|
|
@@ -24093,7 +24123,7 @@ var Px = {
|
|
|
24093
24123
|
for (let n in e) Object.hasOwn(e, n) && (o[n] = t ? e[n] + "%" : e[n] + "px");
|
|
24094
24124
|
this.animator_position && this.animator_position.stop();
|
|
24095
24125
|
let c;
|
|
24096
|
-
c = o.right ? "right" : "left", t ? this._el.container.style[c] = s + "%" : this._el.container.style[c] = s + "px", this.animator_position = (0,
|
|
24126
|
+
c = o.right ? "right" : "left", t ? this._el.container.style[c] = s + "%" : this._el.container.style[c] = s + "px", this.animator_position = (0, qx.default)(this._el.container, o);
|
|
24097
24127
|
}
|
|
24098
24128
|
_onUpdatePositionComplete(e) {
|
|
24099
24129
|
e && (this._el.container.style.left = "", this._el.container.style.right = "");
|
|
@@ -24108,13 +24138,13 @@ var Px = {
|
|
|
24108
24138
|
this._el.content_container = N.create("div", "vco-slidenav-content-container", this._el.container), this._el.icon = N.create("div", "vco-slidenav-icon", this._el.content_container), this._el.title = N.create("div", "vco-slidenav-title", this._el.content_container), this._el.description = N.create("div", "vco-slidenav-description", this._el.content_container), this._el.icon.innerHTML = " ", this._update();
|
|
24109
24139
|
}
|
|
24110
24140
|
_initEvents() {
|
|
24111
|
-
|
|
24141
|
+
Wx.addListener(this._el.container, "click", this._onMouseClick, this);
|
|
24112
24142
|
}
|
|
24113
|
-
},
|
|
24143
|
+
}, Yx = class extends Ze(Xe(Jx)) {
|
|
24114
24144
|
constructor(...e) {
|
|
24115
24145
|
super(...e);
|
|
24116
24146
|
}
|
|
24117
|
-
},
|
|
24147
|
+
}, Xx = class {
|
|
24118
24148
|
data;
|
|
24119
24149
|
constructor(e, t, n) {
|
|
24120
24150
|
this._el = {
|
|
@@ -24143,13 +24173,13 @@ var Px = {
|
|
|
24143
24173
|
this._el.message_container = N.create("div", "vco-message-container", this._el.container), this._el.loading_icon = N.create("div", this.options.message_icon_class, this._el.message_container), this._el.message = N.create("div", "vco-message-content", this._el.message_container), this._updateMessage();
|
|
24144
24174
|
}
|
|
24145
24175
|
_initEvents() {
|
|
24146
|
-
|
|
24176
|
+
Wx.addListener(this._el.container, "click", this._onMouseClick, this);
|
|
24147
24177
|
}
|
|
24148
|
-
},
|
|
24178
|
+
}, Zx = class extends Ze(Xe(Xx)) {
|
|
24149
24179
|
constructor(...e) {
|
|
24150
24180
|
super(...e);
|
|
24151
24181
|
}
|
|
24152
|
-
},
|
|
24182
|
+
}, Qx = class {
|
|
24153
24183
|
constructor(e, t, n) {
|
|
24154
24184
|
this._el = {
|
|
24155
24185
|
container: {},
|
|
@@ -24257,7 +24287,7 @@ var Px = {
|
|
|
24257
24287
|
this.fire("removed", this.data);
|
|
24258
24288
|
}
|
|
24259
24289
|
_initLayout() {
|
|
24260
|
-
if (this.message = new
|
|
24290
|
+
if (this.message = new Zx({}, this.options), this.message.addTo(this._el.container), this._el.content_container = N.create("div", "vco-media-content-container", this._el.container), this.data.link && this.data.link !== "") {
|
|
24261
24291
|
this._el.link = N.create("a", "vco-media-link", this._el.content_container);
|
|
24262
24292
|
let e = this._el.link;
|
|
24263
24293
|
e.href = this.data.link, e.target = this.data.link_target && this.data.link_target !== "" ? this.data.link_target : "_blank", this._el.content = N.create("div", "vco-media-content", this._el.link);
|
|
@@ -24267,11 +24297,11 @@ var Px = {
|
|
|
24267
24297
|
e && (this.options.width = e), t && (this.options.height = t), n && (this.options.layout = n), this._el.credit && (this.options.credit_height = this._el.credit.offsetHeight), this._el.caption && (this.options.caption_height = this._el.caption.offsetHeight + 5), this.updateMediaDisplay(this.options.layout);
|
|
24268
24298
|
}
|
|
24269
24299
|
_stopMedia() {}
|
|
24270
|
-
},
|
|
24300
|
+
}, $x = class extends Xe(Qx) {
|
|
24271
24301
|
constructor(...e) {
|
|
24272
24302
|
super(...e);
|
|
24273
24303
|
}
|
|
24274
|
-
},
|
|
24304
|
+
}, eS = class extends $x {
|
|
24275
24305
|
_loadMedia() {
|
|
24276
24306
|
if (this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this.data.link) {
|
|
24277
24307
|
this._el.content_link = N.create("a", "", this._el.content);
|
|
@@ -24283,7 +24313,7 @@ var Px = {
|
|
|
24283
24313
|
}), this._el.content_item.src = this.data.url, this.onLoaded();
|
|
24284
24314
|
}
|
|
24285
24315
|
_updateMediaDisplay(e) {}
|
|
24286
|
-
},
|
|
24316
|
+
}, tS = class extends $x {
|
|
24287
24317
|
async _loadMedia() {
|
|
24288
24318
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this.youtube_loaded = !1, this._el.content_item = N.create("div", "vco-media-item vco-media-youtube vco-media-shadow", this._el.content), this._el.content_item.id = v(7);
|
|
24289
24319
|
let e = x(this.data.url);
|
|
@@ -24353,7 +24383,7 @@ var Px = {
|
|
|
24353
24383
|
let t = YT;
|
|
24354
24384
|
e.data === t.PlayerState.ENDED && (e.target.seekTo(0), e.target.pauseVideo());
|
|
24355
24385
|
}
|
|
24356
|
-
},
|
|
24386
|
+
}, nS = [
|
|
24357
24387
|
"width",
|
|
24358
24388
|
"height",
|
|
24359
24389
|
"frameborder",
|
|
@@ -24361,7 +24391,7 @@ var Px = {
|
|
|
24361
24391
|
"allow",
|
|
24362
24392
|
"scrolling",
|
|
24363
24393
|
"title"
|
|
24364
|
-
],
|
|
24394
|
+
], rS = [
|
|
24365
24395
|
"BLOCKQUOTE",
|
|
24366
24396
|
"P",
|
|
24367
24397
|
"CITE",
|
|
@@ -24381,7 +24411,7 @@ var Px = {
|
|
|
24381
24411
|
"UL",
|
|
24382
24412
|
"OL",
|
|
24383
24413
|
"LI"
|
|
24384
|
-
],
|
|
24414
|
+
], iS = [
|
|
24385
24415
|
"SCRIPT",
|
|
24386
24416
|
"STYLE",
|
|
24387
24417
|
"TEMPLATE",
|
|
@@ -24401,53 +24431,53 @@ var Px = {
|
|
|
24401
24431
|
"TEXTAREA",
|
|
24402
24432
|
"SELECT"
|
|
24403
24433
|
];
|
|
24404
|
-
function
|
|
24434
|
+
function aS(e) {
|
|
24405
24435
|
return new DOMParser().parseFromString(e, "text/html");
|
|
24406
24436
|
}
|
|
24407
|
-
function
|
|
24437
|
+
function oS(e) {
|
|
24408
24438
|
if (!e) return null;
|
|
24409
24439
|
let t = document.createElement("a");
|
|
24410
24440
|
return t.href = e, t.protocol === "http:" || t.protocol === "https:" ? t.href : null;
|
|
24411
24441
|
}
|
|
24412
|
-
function
|
|
24413
|
-
let t =
|
|
24414
|
-
if (t ? n =
|
|
24442
|
+
function sS(e) {
|
|
24443
|
+
let t = aS(e).querySelector("iframe"), n = null;
|
|
24444
|
+
if (t ? n = oS(t.getAttribute("src")) : /^https?:\/\/\S+$/i.test(e.trim()) && (n = oS(e.trim())), !n) return null;
|
|
24415
24445
|
let r = document.createElement("iframe");
|
|
24416
|
-
if (r.setAttribute("src", n), t) for (let e = 0; e <
|
|
24446
|
+
if (r.setAttribute("src", n), t) for (let e = 0; e < nS.length; e++) t.hasAttribute(nS[e]) && r.setAttribute(nS[e], t.getAttribute(nS[e]));
|
|
24417
24447
|
else r.setAttribute("width", "100%"), r.setAttribute("height", "100%"), r.setAttribute("frameborder", "0"), r.setAttribute("allowfullscreen", "");
|
|
24418
24448
|
return r;
|
|
24419
24449
|
}
|
|
24420
|
-
function
|
|
24450
|
+
function cS(e) {
|
|
24421
24451
|
let t = document.createDocumentFragment();
|
|
24422
|
-
return
|
|
24452
|
+
return lS(aS(e).body, t), t;
|
|
24423
24453
|
}
|
|
24424
|
-
function
|
|
24454
|
+
function lS(e, t) {
|
|
24425
24455
|
for (let n = 0; n < e.childNodes.length; n++) {
|
|
24426
24456
|
let r = e.childNodes[n];
|
|
24427
24457
|
if (r.nodeType === 3) t.appendChild(document.createTextNode(r.nodeValue));
|
|
24428
24458
|
else if (r.nodeType === 1) {
|
|
24429
24459
|
let e = r.nodeName.toUpperCase();
|
|
24430
|
-
if (
|
|
24431
|
-
if (
|
|
24460
|
+
if (iS.includes(e)) continue;
|
|
24461
|
+
if (rS.includes(e)) {
|
|
24432
24462
|
let n = document.createElement(e);
|
|
24433
24463
|
if (e === "A") {
|
|
24434
|
-
let e =
|
|
24464
|
+
let e = oS(r.getAttribute("href"));
|
|
24435
24465
|
e && (n.setAttribute("href", e), n.setAttribute("target", "_blank"));
|
|
24436
24466
|
}
|
|
24437
|
-
|
|
24438
|
-
} else
|
|
24467
|
+
lS(r, n), t.appendChild(n);
|
|
24468
|
+
} else lS(r, t);
|
|
24439
24469
|
}
|
|
24440
24470
|
}
|
|
24441
24471
|
}
|
|
24442
24472
|
//#endregion
|
|
24443
24473
|
//#region src/media/types/Blockquote.ts
|
|
24444
|
-
var
|
|
24474
|
+
var uS = class extends $x {
|
|
24445
24475
|
_loadMedia() {
|
|
24446
|
-
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("div", "vco-media-item vco-media-blockquote", this._el.content), this.media_id = this.data.url, this._el.content_item.appendChild(
|
|
24476
|
+
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("div", "vco-media-item vco-media-blockquote", this._el.content), this.media_id = this.data.url, this._el.content_item.appendChild(cS(this.media_id)), this.onLoaded();
|
|
24447
24477
|
}
|
|
24448
24478
|
updateMediaDisplay() {}
|
|
24449
24479
|
_updateMediaDisplay() {}
|
|
24450
|
-
},
|
|
24480
|
+
}, dS = class extends $x {
|
|
24451
24481
|
_loadMedia() {
|
|
24452
24482
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("div", "vco-media-item vco-media-wikipedia", this._el.content), this.media_id = this.data.url.split("wiki/")[1].split("#")[0].replace("_", " "), this.media_id = this.media_id.replace(" ", "%20");
|
|
24453
24483
|
let e = this.data.url.split("//")[1].split(".wikipedia")[0], t = "wikipediaCallback_" + this.media_id.replace(/[^0-9a-z]/gi, "").slice(0, 494), n = `https://${e}.wikipedia.org/w/api.php?action=query&prop=extracts&redirects=&titles=${this.media_id}&exintro=1&format=json&callback=${t}`;
|
|
@@ -24478,7 +24508,7 @@ var lS = class extends Qx {
|
|
|
24478
24508
|
}
|
|
24479
24509
|
updateMediaDisplay() {}
|
|
24480
24510
|
_updateMediaDisplay() {}
|
|
24481
|
-
},
|
|
24511
|
+
}, fS = class extends $x {
|
|
24482
24512
|
async _loadMedia() {
|
|
24483
24513
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("div", "vco-media-item vco-media-iframe vco-media-soundcloud vco-media-shadow", this._el.content), this.media_id = this.data.url;
|
|
24484
24514
|
let e = "https://soundcloud.com/oembed?url=" + this.media_id + "&format=json";
|
|
@@ -24502,7 +24532,7 @@ var lS = class extends Qx {
|
|
|
24502
24532
|
_stopMedia() {
|
|
24503
24533
|
this.soundCloudCreated && this.widget?.pause();
|
|
24504
24534
|
}
|
|
24505
|
-
},
|
|
24535
|
+
}, pS = class extends $x {
|
|
24506
24536
|
_loadMedia() {
|
|
24507
24537
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("div", "vco-media-item vco-media-iframe vco-media-vimeo vco-media-shadow", this._el.content);
|
|
24508
24538
|
let e = this.data.url.split(/video\/|\/\/vimeo\.com\//);
|
|
@@ -24521,7 +24551,7 @@ var lS = class extends Qx {
|
|
|
24521
24551
|
console.log(e);
|
|
24522
24552
|
}
|
|
24523
24553
|
}
|
|
24524
|
-
},
|
|
24554
|
+
}, mS = class extends $x {
|
|
24525
24555
|
_loadMedia() {
|
|
24526
24556
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("video", "vco-media-item vco-media-video vco-media-shadow", this._el.content);
|
|
24527
24557
|
let e = this._el.content_item;
|
|
@@ -24553,7 +24583,7 @@ var lS = class extends Qx {
|
|
|
24553
24583
|
}
|
|
24554
24584
|
return r;
|
|
24555
24585
|
}
|
|
24556
|
-
},
|
|
24586
|
+
}, hS = class extends $x {
|
|
24557
24587
|
_loadMedia() {
|
|
24558
24588
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("audio", "vco-media-item vco-media-audio vco-media-shadow", this._el.content);
|
|
24559
24589
|
let e = this._el.content_item;
|
|
@@ -24588,7 +24618,7 @@ var lS = class extends Qx {
|
|
|
24588
24618
|
}
|
|
24589
24619
|
return r;
|
|
24590
24620
|
}
|
|
24591
|
-
},
|
|
24621
|
+
}, gS = class extends $x {
|
|
24592
24622
|
_loadMedia() {
|
|
24593
24623
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("div", "vco-media-item vco-media-iframe vco-media-dailymotion", this._el.content);
|
|
24594
24624
|
let e = this.data.url.match("video") ? this.data.url.split("video/")[1] : this.data.url.split("embed/")[1];
|
|
@@ -24603,7 +24633,7 @@ var lS = class extends Qx {
|
|
|
24603
24633
|
_stopMedia() {
|
|
24604
24634
|
(this._el.content_item?.querySelector("iframe"))?.contentWindow?.postMessage("{\"command\":\"pause\",\"parameters\":[]}", "*");
|
|
24605
24635
|
}
|
|
24606
|
-
},
|
|
24636
|
+
}, _S = class extends $x {
|
|
24607
24637
|
_loadMedia() {
|
|
24608
24638
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("div", "vco-media-twitter", this._el.content);
|
|
24609
24639
|
let e = /(?:twitter\.com|x\.com)\/(.+?)\/status\/(\d+)/.exec(this.data.url);
|
|
@@ -24626,7 +24656,7 @@ var lS = class extends Qx {
|
|
|
24626
24656
|
}
|
|
24627
24657
|
updateMediaDisplay() {}
|
|
24628
24658
|
_updateMediaDisplay() {}
|
|
24629
|
-
},
|
|
24659
|
+
}, vS = class extends $x {
|
|
24630
24660
|
_loadMedia() {
|
|
24631
24661
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("img", "vco-media-item vco-media-image vco-media-flickr vco-media-shadow", this._el.content), this._el.content_item.addEventListener("load", (e) => {
|
|
24632
24662
|
this.onMediaLoaded();
|
|
@@ -24662,10 +24692,10 @@ var lS = class extends Qx {
|
|
|
24662
24692
|
let t;
|
|
24663
24693
|
return t = e <= 75 ? e <= 0 ? "Large" : "Thumbnail" : e <= 180 ? "Small" : e <= 240 ? "Small 320" : e <= 375 ? "Medium" : e <= 480 ? "Medium 640" : "Large", t;
|
|
24664
24694
|
}
|
|
24665
|
-
},
|
|
24695
|
+
}, yS = class extends $x {
|
|
24666
24696
|
_loadMedia() {
|
|
24667
24697
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("div", "vco-media-item vco-media-iframe", this._el.content), this.media_id = this.data.url;
|
|
24668
|
-
let e =
|
|
24698
|
+
let e = oS(this.media_id);
|
|
24669
24699
|
if (!e) {
|
|
24670
24700
|
this.loadErrorDisplay("Invalid URL.");
|
|
24671
24701
|
return;
|
|
@@ -24676,10 +24706,10 @@ var lS = class extends Qx {
|
|
|
24676
24706
|
_updateMediaDisplay() {
|
|
24677
24707
|
this._el.content_item.style.height = this.options.height + "px";
|
|
24678
24708
|
}
|
|
24679
|
-
},
|
|
24709
|
+
}, bS = class extends $x {
|
|
24680
24710
|
_loadMedia() {
|
|
24681
24711
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("div", "vco-media-item vco-media-iframe", this._el.content), this.media_id = this.data.url;
|
|
24682
|
-
let e =
|
|
24712
|
+
let e = sS(this.media_id);
|
|
24683
24713
|
if (!e) {
|
|
24684
24714
|
this.loadErrorDisplay("Invalid embed code. Paste an iframe embed code with an http(s) source URL.");
|
|
24685
24715
|
return;
|
|
@@ -24689,10 +24719,10 @@ var lS = class extends Qx {
|
|
|
24689
24719
|
_updateMediaDisplay() {
|
|
24690
24720
|
this._el.content_item.style.height = this.options.height + "px";
|
|
24691
24721
|
}
|
|
24692
|
-
},
|
|
24722
|
+
}, xS = class extends $x {
|
|
24693
24723
|
_loadMedia() {
|
|
24694
24724
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("div", "vco-media-item vco-media-iframe", this._el.content), this.media_id = this.data.url;
|
|
24695
|
-
let e =
|
|
24725
|
+
let e = oS(this.media_id);
|
|
24696
24726
|
if (!e) {
|
|
24697
24727
|
this.loadErrorDisplay("Invalid URL.");
|
|
24698
24728
|
return;
|
|
@@ -24703,7 +24733,7 @@ var lS = class extends Qx {
|
|
|
24703
24733
|
_updateMediaDisplay() {
|
|
24704
24734
|
this._el.content_item.style.height = this.options.height + "px";
|
|
24705
24735
|
}
|
|
24706
|
-
},
|
|
24736
|
+
}, SS = class extends $x {
|
|
24707
24737
|
_loadMedia() {
|
|
24708
24738
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("div", "vco-media-item vco-media-iframe vco-media-facebook", this._el.content);
|
|
24709
24739
|
let e = this.data.url, t = encodeURIComponent(e), n = /\/videos?\//.test(e) || /\/watch/.test(e) || /\/reel\//.test(e) ? `https://www.facebook.com/plugins/video.php?href=${t}&show_text=true` : `https://www.facebook.com/plugins/post.php?href=${t}&show_text=true`;
|
|
@@ -24712,10 +24742,10 @@ var lS = class extends Qx {
|
|
|
24712
24742
|
_updateMediaDisplay() {
|
|
24713
24743
|
this._el.content_item.style.height = this.options.height + "px";
|
|
24714
24744
|
}
|
|
24715
|
-
},
|
|
24745
|
+
}, CS = class extends $x {
|
|
24716
24746
|
_loadMedia() {
|
|
24717
24747
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("div", "vco-media-item vco-media-iframe vco-media-documentcloud", this._el.content);
|
|
24718
|
-
let e =
|
|
24748
|
+
let e = oS(this.data.url);
|
|
24719
24749
|
if (!e) {
|
|
24720
24750
|
this.loadErrorDisplay("Invalid URL.");
|
|
24721
24751
|
return;
|
|
@@ -24726,7 +24756,7 @@ var lS = class extends Qx {
|
|
|
24726
24756
|
_updateMediaDisplay() {
|
|
24727
24757
|
this._el.content_item.style.height = this.options.height + "px";
|
|
24728
24758
|
}
|
|
24729
|
-
},
|
|
24759
|
+
}, wS = class extends $x {
|
|
24730
24760
|
_loadMedia() {
|
|
24731
24761
|
this.message.updateMessage(M.messages.loading + " " + this.options.media_name), this._el.content_item = N.create("div", "vco-media-item vco-media-iframe vco-media-juxtapose", this._el.content), this._el.content_item.innerHTML = `<iframe src="${this.data.url}" />`, this.onLoaded();
|
|
24732
24762
|
}
|
|
@@ -24736,115 +24766,115 @@ var lS = class extends Qx {
|
|
|
24736
24766
|
};
|
|
24737
24767
|
//#endregion
|
|
24738
24768
|
//#region src/media/MediaType.ts
|
|
24739
|
-
function
|
|
24769
|
+
function TS(e) {
|
|
24740
24770
|
let t = [
|
|
24741
24771
|
{
|
|
24742
24772
|
type: "youtube",
|
|
24743
24773
|
name: "YouTube",
|
|
24744
24774
|
match_str: "(www.)?youtube|youtu.be",
|
|
24745
|
-
cls:
|
|
24775
|
+
cls: tS
|
|
24746
24776
|
},
|
|
24747
24777
|
{
|
|
24748
24778
|
type: "vimeo",
|
|
24749
24779
|
name: "Vimeo",
|
|
24750
24780
|
match_str: "(player.)?vimeo.com",
|
|
24751
|
-
cls:
|
|
24781
|
+
cls: pS
|
|
24752
24782
|
},
|
|
24753
24783
|
{
|
|
24754
24784
|
type: "dailymotion",
|
|
24755
24785
|
name: "DailyMotion",
|
|
24756
24786
|
match_str: "(www.)?dailymotion.com",
|
|
24757
|
-
cls:
|
|
24787
|
+
cls: gS
|
|
24758
24788
|
},
|
|
24759
24789
|
{
|
|
24760
24790
|
type: "soundcloud",
|
|
24761
24791
|
name: "SoundCloud",
|
|
24762
24792
|
match_str: "(player.)?soundcloud.com",
|
|
24763
|
-
cls:
|
|
24793
|
+
cls: fS
|
|
24764
24794
|
},
|
|
24765
24795
|
{
|
|
24766
24796
|
type: "twitter",
|
|
24767
24797
|
name: "Twitter",
|
|
24768
24798
|
match_str: "^(https?:)?/+(www.)?(twitter|x).com",
|
|
24769
|
-
cls:
|
|
24799
|
+
cls: _S
|
|
24770
24800
|
},
|
|
24771
24801
|
{
|
|
24772
24802
|
type: "flickr",
|
|
24773
24803
|
name: "Flickr",
|
|
24774
24804
|
match_str: "flickr.com/photos",
|
|
24775
|
-
cls:
|
|
24805
|
+
cls: vS
|
|
24776
24806
|
},
|
|
24777
24807
|
{
|
|
24778
24808
|
type: "image",
|
|
24779
24809
|
name: "Image",
|
|
24780
24810
|
match_str: /jpg|jpeg|png|gif|webp/i,
|
|
24781
|
-
cls:
|
|
24811
|
+
cls: eS
|
|
24782
24812
|
},
|
|
24783
24813
|
{
|
|
24784
24814
|
type: "video",
|
|
24785
24815
|
name: "Video",
|
|
24786
24816
|
match_str: /(mp4|webm)(\?.*)?$/i,
|
|
24787
|
-
cls:
|
|
24817
|
+
cls: mS
|
|
24788
24818
|
},
|
|
24789
24819
|
{
|
|
24790
24820
|
type: "audio",
|
|
24791
24821
|
name: "Audio",
|
|
24792
24822
|
match_str: /(mp3|wav|m4a)(\?.*)?$/i,
|
|
24793
|
-
cls:
|
|
24823
|
+
cls: hS
|
|
24794
24824
|
},
|
|
24795
24825
|
{
|
|
24796
24826
|
type: "googledocs",
|
|
24797
24827
|
name: "Google Doc",
|
|
24798
24828
|
match_str: "^(https?:)?/*[^.]*.google.com/[^/]*/d/[^/]*/[^/]*?usp=sharing|^(https?:)?/*drive.google.com/open?id=[^&]*&authuser=0|^(https?:)?//*drive.google.com/open\\?id=[^&]*|^(https?:)?/*[^.]*.googledrive.com/host/[^/]*/",
|
|
24799
|
-
cls:
|
|
24829
|
+
cls: yS
|
|
24800
24830
|
},
|
|
24801
24831
|
{
|
|
24802
24832
|
type: "wikipedia",
|
|
24803
24833
|
name: "Wikipedia",
|
|
24804
24834
|
match_str: "(www.)?wikipedia.org",
|
|
24805
|
-
cls:
|
|
24835
|
+
cls: dS
|
|
24806
24836
|
},
|
|
24807
24837
|
{
|
|
24808
24838
|
type: "iframe",
|
|
24809
24839
|
name: "iFrame",
|
|
24810
24840
|
match_str: "iframe",
|
|
24811
|
-
cls:
|
|
24841
|
+
cls: bS
|
|
24812
24842
|
},
|
|
24813
24843
|
{
|
|
24814
24844
|
type: "facebook",
|
|
24815
24845
|
name: "Facebook",
|
|
24816
24846
|
match_str: "(www.)?facebook.com",
|
|
24817
|
-
cls:
|
|
24847
|
+
cls: SS
|
|
24818
24848
|
},
|
|
24819
24849
|
{
|
|
24820
24850
|
type: "documentcloud",
|
|
24821
24851
|
name: "DocumentCloud",
|
|
24822
24852
|
match_str: "documentcloud.org/documents/",
|
|
24823
|
-
cls:
|
|
24853
|
+
cls: CS
|
|
24824
24854
|
},
|
|
24825
24855
|
{
|
|
24826
24856
|
type: "juxtapose",
|
|
24827
24857
|
name: "Juxtapose",
|
|
24828
24858
|
match_str: "juxtapose",
|
|
24829
|
-
cls:
|
|
24859
|
+
cls: wS
|
|
24830
24860
|
},
|
|
24831
24861
|
{
|
|
24832
24862
|
type: "blockquote",
|
|
24833
24863
|
name: "Quote",
|
|
24834
24864
|
match_str: "blockquote",
|
|
24835
|
-
cls:
|
|
24865
|
+
cls: uS
|
|
24836
24866
|
},
|
|
24837
24867
|
{
|
|
24838
24868
|
type: "website",
|
|
24839
24869
|
name: "Website",
|
|
24840
24870
|
match_str: "https?://",
|
|
24841
|
-
cls:
|
|
24871
|
+
cls: xS
|
|
24842
24872
|
},
|
|
24843
24873
|
{
|
|
24844
24874
|
type: "",
|
|
24845
24875
|
name: "",
|
|
24846
24876
|
match_str: "",
|
|
24847
|
-
cls:
|
|
24877
|
+
cls: $x
|
|
24848
24878
|
}
|
|
24849
24879
|
];
|
|
24850
24880
|
for (let n of t) if (typeof e.url == "string" && e.url.match(n.match_str)) return n;
|
|
@@ -24852,7 +24882,7 @@ function wS(e) {
|
|
|
24852
24882
|
}
|
|
24853
24883
|
//#endregion
|
|
24854
24884
|
//#region src/media/types/Text.ts
|
|
24855
|
-
var
|
|
24885
|
+
var ES = class {
|
|
24856
24886
|
constructor(e, t, n) {
|
|
24857
24887
|
this._el = {
|
|
24858
24888
|
container: {},
|
|
@@ -24903,11 +24933,11 @@ var TS = class {
|
|
|
24903
24933
|
}
|
|
24904
24934
|
this.onLoaded();
|
|
24905
24935
|
}
|
|
24906
|
-
},
|
|
24936
|
+
}, DS = class extends Xe(ES) {
|
|
24907
24937
|
constructor(...e) {
|
|
24908
24938
|
super(...e);
|
|
24909
24939
|
}
|
|
24910
|
-
},
|
|
24940
|
+
}, OS = class {
|
|
24911
24941
|
constructor(e, t, n) {
|
|
24912
24942
|
this._el = {
|
|
24913
24943
|
container: {},
|
|
@@ -24916,7 +24946,7 @@ var TS = class {
|
|
|
24916
24946
|
content_container: {},
|
|
24917
24947
|
content: {},
|
|
24918
24948
|
call_to_action: null
|
|
24919
|
-
}, this._media = null, this._mediaclass = {}, this._text = {}, this._state = { loaded: !1 }, this.has = {
|
|
24949
|
+
}, this._media = null, this._mediaclass = {}, this._text = {}, this._state = { loaded: !1 }, this._scroll_hint = null, this._scroll_hint_dismissed = !1, this.has = {
|
|
24920
24950
|
headline: !1,
|
|
24921
24951
|
text: !1,
|
|
24922
24952
|
media: !1,
|
|
@@ -24946,7 +24976,7 @@ var TS = class {
|
|
|
24946
24976
|
show() {}
|
|
24947
24977
|
hide() {}
|
|
24948
24978
|
setActive(e) {
|
|
24949
|
-
this.active = e, this.active ? (this.data.background && this.fire("background_change", this.has.background), this.loadMedia()) : this.stopMedia();
|
|
24979
|
+
this.active = e, this.active ? (this.data.background && this.fire("background_change", this.has.background), this._scroll_hint_dismissed = !1, this.loadMedia(), this._updateScrollHint()) : (this.stopMedia(), this._hideScrollHint());
|
|
24950
24980
|
}
|
|
24951
24981
|
updateDisplay(e, t, n) {
|
|
24952
24982
|
this._updateDisplay(e, t, n);
|
|
@@ -24971,31 +25001,56 @@ var TS = class {
|
|
|
24971
25001
|
scrollToTop() {
|
|
24972
25002
|
this._el.container.scrollTop = 0;
|
|
24973
25003
|
}
|
|
25004
|
+
_updateScrollHint() {
|
|
25005
|
+
if (!this.active || this._scroll_hint_dismissed) {
|
|
25006
|
+
this._hideScrollHint();
|
|
25007
|
+
return;
|
|
25008
|
+
}
|
|
25009
|
+
let e = this._el.container;
|
|
25010
|
+
if (!(e.scrollHeight > e.clientHeight + 1)) {
|
|
25011
|
+
this._hideScrollHint();
|
|
25012
|
+
return;
|
|
25013
|
+
}
|
|
25014
|
+
this._scroll_hint || (this._scroll_hint = N.create("div", "vco-slide-scroll-hint", e), this._scroll_hint.innerHTML = "<span class='vco-icon-arrow-down'></span>", Wx.addListener(this._scroll_hint, "click", this._onScrollHintClick, this)), this._scroll_hint.style.display = "flex";
|
|
25015
|
+
}
|
|
25016
|
+
_hideScrollHint() {
|
|
25017
|
+
this._scroll_hint && (this._scroll_hint.style.display = "none");
|
|
25018
|
+
}
|
|
25019
|
+
_onScrollHintClick() {
|
|
25020
|
+
let e = this._el.container;
|
|
25021
|
+
e.scrollBy({
|
|
25022
|
+
top: e.clientHeight * .8,
|
|
25023
|
+
behavior: "smooth"
|
|
25024
|
+
}), this._scroll_hint_dismissed = !0, this._hideScrollHint();
|
|
25025
|
+
}
|
|
25026
|
+
_onSlideScroll() {
|
|
25027
|
+
this.active && !this._scroll_hint_dismissed && (this._scroll_hint_dismissed = !0, this._hideScrollHint());
|
|
25028
|
+
}
|
|
24974
25029
|
addCallToAction(e) {
|
|
24975
|
-
this._el.call_to_action = N.create("div", "vco-slide-calltoaction", this._el.content_container), this._el.call_to_action.innerHTML = "<span class='vco-slide-calltoaction-button-text'>" + e + "</span>",
|
|
25030
|
+
this._el.call_to_action = N.create("div", "vco-slide-calltoaction", this._el.content_container), this._el.call_to_action.innerHTML = "<span class='vco-slide-calltoaction-button-text'>" + e + "</span>", Wx.addListener(this._el.call_to_action, "click", this._onCallToAction, this);
|
|
24976
25031
|
}
|
|
24977
25032
|
_onCallToAction(e) {
|
|
24978
25033
|
this.fire("call_to_action", e);
|
|
24979
25034
|
}
|
|
24980
25035
|
_initLayout() {
|
|
24981
|
-
if (this._el.container = N.create("div", "vco-slide"), this.data.uniqueid && (this._el.container.id = this.data.uniqueid), this._el.scroll_container = N.create("div", "vco-slide-scrollable-container", this._el.container), this._el.content_container = N.create("div", "vco-slide-content-container", this._el.scroll_container), this._el.content = N.create("div", "vco-slide-content", this._el.content_container), this._el.background = N.create("div", "vco-slide-background", this._el.container), this.data.background) {
|
|
25036
|
+
if (this._el.container = N.create("div", "vco-slide"), this.data.uniqueid && (this._el.container.id = this.data.uniqueid), this._el.scroll_container = N.create("div", "vco-slide-scrollable-container", this._el.container), this._el.content_container = N.create("div", "vco-slide-content-container", this._el.scroll_container), this._el.content = N.create("div", "vco-slide-content", this._el.content_container), this._el.background = N.create("div", "vco-slide-background", this._el.container), this._el.container.addEventListener("scroll", this._onSlideScroll.bind(this), { passive: !0 }), this.data.background) {
|
|
24982
25037
|
let e = this.data.background;
|
|
24983
25038
|
e.url && (this.has.background.image = !0, this._el.container.className += " vco-full-image-background", this.has.background.color_value = "#000", this._el.background.style.backgroundImage = "url('" + e.url + "')", this._el.background.style.display = "block"), e.color && (this.has.background.color = !0, this._el.container.className += " vco-full-color-background", this.has.background.color_value = e.color), e.text_background && (this._el.container.className += " vco-text-background");
|
|
24984
25039
|
}
|
|
24985
|
-
this.data.media && this.data.media.url && this.data.media.url !== "" && (this.has.media = !0), this.data.text && this.data.text.text && (this.has.text = !0), this.data.text && this.data.text.headline && (this.has.headline = !0, this.title = this.data.text.headline), this.has.media && (this.data.media.mediatype =
|
|
25040
|
+
this.data.media && this.data.media.url && this.data.media.url !== "" && (this.has.media = !0), this.data.text && this.data.text.text && (this.has.text = !0), this.data.text && this.data.text.headline && (this.has.headline = !0, this.title = this.data.text.headline), this.has.media && (this.data.media.mediatype = TS(this.data.media), this.options.media_name = this.data.media.mediatype.name, this.options.media_type = this.data.media.mediatype.type, this._media = new this.data.media.mediatype.cls(this.data.media, this.options), this._media.on?.("media_loaded", () => this._updateScrollHint())), (this.has.text || this.has.headline) && (this._text = new DS(this.data.text, {
|
|
24986
25041
|
title: this.has.title,
|
|
24987
25042
|
text_align: this.options.text_align
|
|
24988
25043
|
})), !this.has.text && !this.has.headline && this.has.media ? (this._el.container.className += " vco-slide-media-only", this._media.addTo(this._el.content)) : this.has.headline && this.has.media && !this.has.text ? (this._el.container.className += " vco-slide-media-only", this._text.addTo(this._el.content), this._media.addTo(this._el.content)) : this.has.text && this.has.media ? (this._media.addTo(this._el.content), this._text.addTo(this._el.content)) : (this.has.text || this.has.headline) && (this._el.container.className += " vco-slide-text-only", this._text.addTo(this._el.content)), this.onLoaded();
|
|
24989
25044
|
}
|
|
24990
25045
|
_updateDisplay(e, t, n) {
|
|
24991
25046
|
let r, i, a;
|
|
24992
|
-
e ? this.options.width = e : this.options.width = this._el.container.offsetWidth, Px.mobile && this.options.width <= this.options.skinny_size ? (r = "0px", i = "0px", a = this.options.width - 0 + "px") : n === "landscape" ? (r = "40px", i = "75px", a = this.options.width - 115 + "px") : (this.options.width, this.options.skinny_size, r = this.options.slide_padding_lr + "px", i = this.options.slide_padding_lr + "px", a = this.options.width - this.options.slide_padding_lr * 2 + "px"), this._el.content.style.paddingLeft = r, this._el.content.style.paddingRight = i, this._el.content.style.width = a, this._el.call_to_action && (this._el.call_to_action.style.paddingLeft = r, this._el.call_to_action.style.paddingRight = i, this._el.call_to_action.style.width = a), t ? this.options.height = t : this.options.height = this._el.container.offsetHeight, this._media && (!this.has.text && this.has.headline ? this._media.updateDisplay(this.options.width, this.options.height - this._text.headlineHeight(), n) : this._media.updateDisplay(this.options.width, this.options.height, n));
|
|
25047
|
+
e ? this.options.width = e : this.options.width = this._el.container.offsetWidth, Px.mobile && this.options.width <= this.options.skinny_size ? (r = "0px", i = "0px", a = this.options.width - 0 + "px") : n === "landscape" ? (r = "40px", i = "75px", a = this.options.width - 115 + "px") : (this.options.width, this.options.skinny_size, r = this.options.slide_padding_lr + "px", i = this.options.slide_padding_lr + "px", a = this.options.width - this.options.slide_padding_lr * 2 + "px"), this._el.content.style.paddingLeft = r, this._el.content.style.paddingRight = i, this._el.content.style.width = a, this._el.call_to_action && (this._el.call_to_action.style.paddingLeft = r, this._el.call_to_action.style.paddingRight = i, this._el.call_to_action.style.width = a), t ? this.options.height = t : this.options.height = this._el.container.offsetHeight, this._media && (!this.has.text && this.has.headline ? this._media.updateDisplay(this.options.width, this.options.height - this._text.headlineHeight(), n) : this._media.updateDisplay(this.options.width, this.options.height, n)), this._updateScrollHint();
|
|
24993
25048
|
}
|
|
24994
|
-
},
|
|
25049
|
+
}, kS = class extends Ze(Xe(OS)) {
|
|
24995
25050
|
constructor(...e) {
|
|
24996
25051
|
super(...e);
|
|
24997
25052
|
}
|
|
24998
|
-
},
|
|
25053
|
+
}, AS = class {
|
|
24999
25054
|
constructor(e, t, n) {
|
|
25000
25055
|
this.mousedrag = {
|
|
25001
25056
|
down: "mousedown",
|
|
@@ -25062,10 +25117,10 @@ var TS = class {
|
|
|
25062
25117
|
}, f(this.options, n);
|
|
25063
25118
|
}
|
|
25064
25119
|
enable(e) {
|
|
25065
|
-
|
|
25120
|
+
Wx.addListener(this._el.drag, this.dragevent.down, this._onDragStart, this), Wx.addListener(this._el.drag, this.dragevent.up, this._onDragEnd, this), this.data.pos.start = 0, this._el.move.style.left = this.data.pos.start.x + "px", this._el.move.style.top = this.data.pos.start.y + "px", this._el.move.style.position = "absolute";
|
|
25066
25121
|
}
|
|
25067
25122
|
disable() {
|
|
25068
|
-
|
|
25123
|
+
Wx.removeListener(this._el.drag, this.dragevent.down, this._onDragStart, this), Wx.removeListener(this._el.drag, this.dragevent.up, this._onDragEnd, this);
|
|
25069
25124
|
}
|
|
25070
25125
|
stopMomentum() {
|
|
25071
25126
|
this.animator && this.animator.stop();
|
|
@@ -25077,10 +25132,10 @@ var TS = class {
|
|
|
25077
25132
|
this.animator && this.animator.stop(), Px.touch ? e.originalEvent ? (this.data.pagex.start = e.originalEvent.touches[0].screenX, this.data.pagey.start = e.originalEvent.touches[0].screenY) : (this.data.pagex.start = e.targetTouches[0].screenX, this.data.pagey.start = e.targetTouches[0].screenY) : (this.data.pagex.start = e.pageX, this.data.pagey.start = e.pageY), this.options.enable.x, this.options.enable.y, this.data.pos.start = {
|
|
25078
25133
|
x: this._el.move.offsetLeft,
|
|
25079
25134
|
y: this._el.move.offsetTop
|
|
25080
|
-
}, this.data.time.start = Date.now(), this.fire("dragstart", this.data),
|
|
25135
|
+
}, this.data.time.start = Date.now(), this.fire("dragstart", this.data), Wx.addListener(this._el.drag, this.dragevent.move, this._onDragMove, this), Wx.addListener(this._el.drag, this.dragevent.leave, this._onDragEnd, this);
|
|
25081
25136
|
}
|
|
25082
25137
|
_onDragEnd(e) {
|
|
25083
|
-
this.data.sliding = !1,
|
|
25138
|
+
this.data.sliding = !1, Wx.removeListener(this._el.drag, this.dragevent.move, this._onDragMove, this), Wx.removeListener(this._el.drag, this.dragevent.leave, this._onDragEnd, this), this.fire("dragend", this.data), this._momentum();
|
|
25084
25139
|
}
|
|
25085
25140
|
_onDragMove(e) {
|
|
25086
25141
|
let t = {
|
|
@@ -25105,7 +25160,7 @@ var TS = class {
|
|
|
25105
25160
|
x: !1,
|
|
25106
25161
|
y: !1
|
|
25107
25162
|
}, r = !1;
|
|
25108
|
-
this.data.direction = null, e.time = (Date.now() - this.data.time.start) * 10, t.time = (Date.now() - this.data.time.start) * 10, t.x = this.options.momentum_multiplier * (Math.abs(this.data.pagex.end) - Math.abs(this.data.pagex.start)), t.y = this.options.momentum_multiplier * (Math.abs(this.data.pagey.end) - Math.abs(this.data.pagey.start)), e.x = Math.round(t.x / t.time), e.y = Math.round(t.y / t.time), this.data.new_pos.x = this.data.pos.end.x + e.x, this.data.new_pos.y = this.data.pos.end.y + e.y, this.options.enable.x ? this.data.new_pos.x > 0 && (this.data.new_pos.x = 0) : this.data.new_pos.x = this.data.pos.start.x, this.options.enable.y ? this.data.new_pos.y < 0 && (this.data.new_pos.y = 0) : this.data.new_pos.y = this.data.pos.start.y, t.time < 2e3 && (r = !0), this.options.enable.x && this.options.enable.y ? Math.abs(t.x) > Math.abs(t.y) ? n.x = !0 : n.y = !0 : this.options.enable.x ? Math.abs(t.x) > Math.abs(t.y) && (n.x = !0) : Math.abs(t.y) > Math.abs(t.x) && (n.y = !0), n.x && (Math.abs(t.x) > this._el.drag.offsetWidth / 2 && (r = !0), Math.abs(t.x) > 1e4 && (this.data.direction = "left", t.x > 0 && (this.data.direction = "right"))), n.y && (Math.abs(t.y) > this._el.drag.offsetHeight / 2 && (r = !0), Math.abs(t.y) > 1e4 && (this.data.direction = "up", t.y > 0 && (this.data.direction = "down"))), this._animateMomentum(), r && this.data.direction ? this.fire("swipe_" + this.data.direction, this.data) : this.data.direction ? this.fire("swipe_nodirection", this.data) : this.options.snap && (this.animator.stop(), this.animator = (0,
|
|
25163
|
+
this.data.direction = null, e.time = (Date.now() - this.data.time.start) * 10, t.time = (Date.now() - this.data.time.start) * 10, t.x = this.options.momentum_multiplier * (Math.abs(this.data.pagex.end) - Math.abs(this.data.pagex.start)), t.y = this.options.momentum_multiplier * (Math.abs(this.data.pagey.end) - Math.abs(this.data.pagey.start)), e.x = Math.round(t.x / t.time), e.y = Math.round(t.y / t.time), this.data.new_pos.x = this.data.pos.end.x + e.x, this.data.new_pos.y = this.data.pos.end.y + e.y, this.options.enable.x ? this.data.new_pos.x > 0 && (this.data.new_pos.x = 0) : this.data.new_pos.x = this.data.pos.start.x, this.options.enable.y ? this.data.new_pos.y < 0 && (this.data.new_pos.y = 0) : this.data.new_pos.y = this.data.pos.start.y, t.time < 2e3 && (r = !0), this.options.enable.x && this.options.enable.y ? Math.abs(t.x) > Math.abs(t.y) ? n.x = !0 : n.y = !0 : this.options.enable.x ? Math.abs(t.x) > Math.abs(t.y) && (n.x = !0) : Math.abs(t.y) > Math.abs(t.x) && (n.y = !0), n.x && (Math.abs(t.x) > this._el.drag.offsetWidth / 2 && (r = !0), Math.abs(t.x) > 1e4 && (this.data.direction = "left", t.x > 0 && (this.data.direction = "right"))), n.y && (Math.abs(t.y) > this._el.drag.offsetHeight / 2 && (r = !0), Math.abs(t.y) > 1e4 && (this.data.direction = "up", t.y > 0 && (this.data.direction = "down"))), this._animateMomentum(), r && this.data.direction ? this.fire("swipe_" + this.data.direction, this.data) : this.data.direction ? this.fire("swipe_nodirection", this.data) : this.options.snap && (this.animator.stop(), this.animator = (0, qx.default)(this._el.move, {
|
|
25109
25164
|
top: this.data.pos.start.y,
|
|
25110
25165
|
left: this.data.pos.start.x,
|
|
25111
25166
|
duration: this.options.duration,
|
|
@@ -25120,13 +25175,13 @@ var TS = class {
|
|
|
25120
25175
|
duration: this.options.duration,
|
|
25121
25176
|
easing: Je
|
|
25122
25177
|
};
|
|
25123
|
-
this.options.enable.y && ((this.options.constraint.top || this.options.constraint.bottom) && (e.y > this.options.constraint.bottom ? e.y = this.options.constraint.bottom : e.y < this.options.constraint.top && (e.y = this.options.constraint.top)), t.top = Math.floor(e.y) + "px"), this.options.enable.x && ((this.options.constraint.left || this.options.constraint.right) && (e.x >= this.options.constraint.left ? e.x = this.options.constraint.left : e.x < this.options.constraint.right && (e.x = this.options.constraint.right)), t.left = Math.floor(e.x) + "px"), this.animator = (0,
|
|
25178
|
+
this.options.enable.y && ((this.options.constraint.top || this.options.constraint.bottom) && (e.y > this.options.constraint.bottom ? e.y = this.options.constraint.bottom : e.y < this.options.constraint.top && (e.y = this.options.constraint.top)), t.top = Math.floor(e.y) + "px"), this.options.enable.x && ((this.options.constraint.left || this.options.constraint.right) && (e.x >= this.options.constraint.left ? e.x = this.options.constraint.left : e.x < this.options.constraint.right && (e.x = this.options.constraint.right)), t.left = Math.floor(e.x) + "px"), this.animator = (0, qx.default)(this._el.move, t), this.fire("momentum", this.data);
|
|
25124
25179
|
}
|
|
25125
|
-
},
|
|
25180
|
+
}, jS = class extends Xe(AS) {
|
|
25126
25181
|
constructor(...e) {
|
|
25127
25182
|
super(...e);
|
|
25128
25183
|
}
|
|
25129
|
-
},
|
|
25184
|
+
}, MS = class {
|
|
25130
25185
|
constructor(e, t, n, r) {
|
|
25131
25186
|
this._el = {
|
|
25132
25187
|
container: {},
|
|
@@ -25143,9 +25198,9 @@ var TS = class {
|
|
|
25143
25198
|
width: 600,
|
|
25144
25199
|
height: 600,
|
|
25145
25200
|
default_bg_color: {
|
|
25146
|
-
r:
|
|
25147
|
-
g:
|
|
25148
|
-
b:
|
|
25201
|
+
r: 255,
|
|
25202
|
+
g: 255,
|
|
25203
|
+
b: 255
|
|
25149
25204
|
},
|
|
25150
25205
|
slide_padding_lr: 40,
|
|
25151
25206
|
start_at_slide: 1,
|
|
@@ -25172,7 +25227,7 @@ var TS = class {
|
|
|
25172
25227
|
for (let t = 0; t < e.length; t++) e[t].uniqueid === "" && (e[t].uniqueid = v(6, "vco-slide")), t === 0 ? this._createSlide(e[t], !0) : this._createSlide(e[t], !1);
|
|
25173
25228
|
}
|
|
25174
25229
|
_createSlide(e, t) {
|
|
25175
|
-
let n = new
|
|
25230
|
+
let n = new kS(e, this.options, t);
|
|
25176
25231
|
this._addSlide(n), this._slides.push(n);
|
|
25177
25232
|
}
|
|
25178
25233
|
_addSlide(e) {
|
|
@@ -25192,7 +25247,7 @@ var TS = class {
|
|
|
25192
25247
|
let r = this.current_slide;
|
|
25193
25248
|
this.current_slide = e;
|
|
25194
25249
|
let i = Math.abs(e - r), a = Math.max(600, Math.min(1e3 + i * 120, 2e3));
|
|
25195
|
-
this.animator && this.animator.stop(), this._swipable && this._swipable.stopMomentum(), t ? (this._el.slider_container.style.left = -(this.slide_spacing * e) + "px", this._onSlideChange(n)) : (this._onSlideChange(n), this.animator = (0,
|
|
25250
|
+
this.animator && this.animator.stop(), this._swipable && this._swipable.stopMomentum(), t ? (this._el.slider_container.style.left = -(this.slide_spacing * e) + "px", this._onSlideChange(n)) : (this._onSlideChange(n), this.animator = (0, qx.default)(this._el.slider_container, {
|
|
25196
25251
|
left: -(this.slide_spacing * e) + "px",
|
|
25197
25252
|
duration: a,
|
|
25198
25253
|
easing: this.options.ease
|
|
@@ -25226,7 +25281,7 @@ var TS = class {
|
|
|
25226
25281
|
let t = !1, n, r = this.options.slide_default_fade, i = "";
|
|
25227
25282
|
this._el.background.getAttribute("style"), n = e.color_value ? y(e.color_value) : this.options.default_bg_color, this.animator_background && this.animator_background.stop();
|
|
25228
25283
|
let a = n.r + "," + n.g + "," + n.b;
|
|
25229
|
-
(!this.current_bg_color || this.current_bg_color !== a) && (this.current_bg_color = a, t = !0), t && (this.options.layout === "landscape" ? (this._nav.next.setColor(!1), this._nav.previous.setColor(!1), n.r < 255 && n.g < 255 && n.b < 255 && (r = "15%"), e.image && (r = "0%"), i += "opacity:0;", i += "background-image: linear-gradient(to right, rgba(" + a + ",0.0001 ) " + r + ", rgba(" + a + ",0.87) 15%);", i += "background-repeat: repeat-x;"
|
|
25284
|
+
(!this.current_bg_color || this.current_bg_color !== a) && (this.current_bg_color = a, t = !0), t && (this.options.layout === "landscape" ? (this._nav.next.setColor(!1), this._nav.previous.setColor(!1), n.r < 255 && n.g < 255 && n.b < 255 && (r = "15%"), e.image && (r = "0%"), i += "opacity:0;", i += "background-image: linear-gradient(to right, rgba(" + a + ",0.0001 ) " + r + ", rgba(" + a + ",0.87) 15%);", i += "background-repeat: repeat-x;") : (e.color_value ? i += "background-color:" + e.color_value + ";" : i += "background-color:#FFF;", n.r < 255 && n.g < 255 && n.b < 255 || e.image ? (this._nav.next.setColor(!0), this._nav.previous.setColor(!0)) : (this._nav.next.setColor(!1), this._nav.previous.setColor(!1))), this.animator_background = (0, qx.default)(this._el.background, {
|
|
25230
25285
|
opacity: 0,
|
|
25231
25286
|
duration: this.options.duration / 2,
|
|
25232
25287
|
easing: this.options.ease,
|
|
@@ -25236,7 +25291,7 @@ var TS = class {
|
|
|
25236
25291
|
}));
|
|
25237
25292
|
}
|
|
25238
25293
|
fadeInBackground(e) {
|
|
25239
|
-
this.animator_background && this.animator_background.stop(), e && this._el.background.setAttribute("style", e), this.animator_background = (0,
|
|
25294
|
+
this.animator_background && this.animator_background.stop(), e && this._el.background.setAttribute("style", e), this.animator_background = (0, qx.default)(this._el.background, {
|
|
25240
25295
|
opacity: 1,
|
|
25241
25296
|
duration: this.options.duration / 2,
|
|
25242
25297
|
easing: this.options.ease
|
|
@@ -25261,29 +25316,29 @@ var TS = class {
|
|
|
25261
25316
|
this.options.width <= this.options.skinny_size || (this._nav.next.updatePosition({ right: "130" }, !1, this.options.duration * 3, this.options.ease, -100, !0), this._nav.previous.updatePosition({ left: "-100" }, !0, this.options.duration * 3, this.options.ease, -200, !0));
|
|
25262
25317
|
}
|
|
25263
25318
|
_initLayout() {
|
|
25264
|
-
this._el.container.className += " vco-storyslider", this._el.slider_container_mask = N.create("div", "vco-slider-container-mask", this._el.container), this._el.background = N.create("div", "vco-slider-background", this._el.container), this._el.slider_container = N.create("div", "vco-slider-container", this._el.slider_container_mask), this._el.slider_item_container = N.create("div", "vco-slider-item-container", this._el.slider_container), this.options.width = this._el.container.offsetWidth, this.options.height = this._el.container.offsetHeight, this._nav.previous = new
|
|
25319
|
+
this._el.container.className += " vco-storyslider", this._el.slider_container_mask = N.create("div", "vco-slider-container-mask", this._el.container), this._el.background = N.create("div", "vco-slider-background", this._el.container), this._el.slider_container = N.create("div", "vco-slider-container", this._el.slider_container_mask), this._el.slider_item_container = N.create("div", "vco-slider-item-container", this._el.slider_container), this.options.width = this._el.container.offsetWidth, this.options.height = this._el.container.offsetHeight, this._nav.previous = new Yx({
|
|
25265
25320
|
title: "Previous",
|
|
25266
25321
|
description: "description"
|
|
25267
|
-
}, { direction: "previous" }), this._nav.next = new
|
|
25322
|
+
}, { direction: "previous" }), this._nav.next = new Yx({
|
|
25268
25323
|
title: "Next",
|
|
25269
25324
|
description: "description"
|
|
25270
|
-
}, { direction: "next" }), this._nav.next.addTo(this._el.container), this._nav.previous.addTo(this._el.container), this._el.slider_container.style.left = "0px", Px.touch && (this._swipable = new
|
|
25325
|
+
}, { direction: "next" }), this._nav.next.addTo(this._el.container), this._nav.previous.addTo(this._el.container), this._el.slider_container.style.left = "0px", Px.touch && (this._swipable = new jS(this._el.slider_container_mask, this._el.slider_container, {
|
|
25271
25326
|
enable: {
|
|
25272
25327
|
x: !0,
|
|
25273
25328
|
y: !1
|
|
25274
25329
|
},
|
|
25275
25330
|
snap: !0
|
|
25276
|
-
}), this._swipable.enable(), this._message = new
|
|
25331
|
+
}), this._swipable.enable(), this._message = new Zx({}, {
|
|
25277
25332
|
message_class: "vco-message-full",
|
|
25278
25333
|
message_icon_class: "vco-icon-swipe-left"
|
|
25279
25334
|
}), this._message.updateMessage(M.buttons.swipe_to_navigate), this._message.addTo(this._el.container));
|
|
25280
25335
|
}
|
|
25281
25336
|
_initEvents() {
|
|
25282
|
-
this._nav.next.on("clicked", this._onNavigation, this), this._nav.previous.on("clicked", this._onNavigation, this), this._message && this._message.on("clicked", this._onMessageClick, this), this._swipable && (this._swipable.on("swipe_left", this._onNavigation, this), this._swipable.on("swipe_right", this._onNavigation, this), this._swipable.on("swipe_nodirection", this._onSwipeNoDirection, this)), this._el.container.setAttribute("tabindex", "0"),
|
|
25337
|
+
this._nav.next.on("clicked", this._onNavigation, this), this._nav.previous.on("clicked", this._onNavigation, this), this._message && this._message.on("clicked", this._onMessageClick, this), this._swipable && (this._swipable.on("swipe_left", this._onNavigation, this), this._swipable.on("swipe_right", this._onNavigation, this), this._swipable.on("swipe_nodirection", this._onSwipeNoDirection, this)), this._el.container.setAttribute("tabindex", "0"), Wx.addListener(this._el.container, "keydown", this._onKeyDown, this);
|
|
25283
25338
|
}
|
|
25284
25339
|
_onKeyDown(e) {
|
|
25285
25340
|
let t = e.key, n = e.target, r = n?.tagName?.toLowerCase();
|
|
25286
|
-
r === "input" || r === "textarea" || r === "select" || n?.isContentEditable || (t === "ArrowRight" || t === "ArrowDown" ? (
|
|
25341
|
+
r === "input" || r === "textarea" || r === "select" || n?.isContentEditable || (t === "ArrowRight" || t === "ArrowDown" ? (Wx.preventDefault(e), this.next()) : (t === "ArrowLeft" || t === "ArrowUp") && (Wx.preventDefault(e), this.previous()));
|
|
25287
25342
|
}
|
|
25288
25343
|
_initData() {
|
|
25289
25344
|
this._createSlides(this.data.slides);
|
|
@@ -25313,11 +25368,11 @@ var TS = class {
|
|
|
25313
25368
|
_onLoaded() {
|
|
25314
25369
|
this.fire("loaded", this.data), this._slides.length > 0 && this.fire("title", { title: this._slides[0].title });
|
|
25315
25370
|
}
|
|
25316
|
-
},
|
|
25371
|
+
}, NS = class extends Xe(MS) {
|
|
25317
25372
|
constructor(...e) {
|
|
25318
25373
|
super(...e);
|
|
25319
25374
|
}
|
|
25320
|
-
},
|
|
25375
|
+
}, PS = class {
|
|
25321
25376
|
constructor(e, t, n, r) {
|
|
25322
25377
|
for (let e in r) {
|
|
25323
25378
|
let t = r[e];
|
|
@@ -25333,7 +25388,7 @@ var TS = class {
|
|
|
25333
25388
|
storyslider: !1,
|
|
25334
25389
|
map: !1
|
|
25335
25390
|
}, this.data = {}, this.options = {
|
|
25336
|
-
script_path:
|
|
25391
|
+
script_path: FS.SCRIPT_PATH,
|
|
25337
25392
|
height: this._el.container.offsetHeight,
|
|
25338
25393
|
width: this._el.container.offsetWidth,
|
|
25339
25394
|
layout: "landscape",
|
|
@@ -25371,6 +25426,7 @@ var TS = class {
|
|
|
25371
25426
|
map_as_image: !1,
|
|
25372
25427
|
map_access_token: "",
|
|
25373
25428
|
map_background_color: "#d9d9d9",
|
|
25429
|
+
map_area: "full",
|
|
25374
25430
|
map_bbox: null,
|
|
25375
25431
|
consent_required: !1,
|
|
25376
25432
|
zoomify: void 0,
|
|
@@ -25439,7 +25495,10 @@ var TS = class {
|
|
|
25439
25495
|
}
|
|
25440
25496
|
}
|
|
25441
25497
|
_initOptions() {
|
|
25442
|
-
if (p(this.options, this.data), this._data_from_manifest && delete this.options.zoomify, this.options.layout === "landscape" && (this.options.map_center_offset = {
|
|
25498
|
+
if (p(this.options, this.data), this._data_from_manifest && delete this.options.zoomify, this.options.layout === "landscape" && (this.options.map_area === "left" ? this.options.map_center_offset = {
|
|
25499
|
+
left: 0,
|
|
25500
|
+
top: 0
|
|
25501
|
+
} : this.options.map_center_offset = {
|
|
25443
25502
|
left: -200,
|
|
25444
25503
|
top: 0
|
|
25445
25504
|
}), this.options.map_type === "iiif" && this.options.map_as_image && (this.options.map_size_sticky = 2), this.options.map_type === "zoomify" && (this.options.map_size_sticky = 2), this.options.map_as_image && (this.options.calculate_zoom = !1), this.options.map_type === "zoomify") {
|
|
@@ -25491,25 +25550,25 @@ var TS = class {
|
|
|
25491
25550
|
this.ready && (this.options.text_color && this._el.container.style.setProperty("--vco-color-text", this.options.text_color), this.options.text_background_color && this._el.container.style.setProperty("--vco-color-text-background", this.options.text_background_color), this.updateDisplay());
|
|
25492
25551
|
}
|
|
25493
25552
|
_initLayout() {
|
|
25494
|
-
this._el.container.className += " vco-storymap", this.options.base_class = this._el.container.className, this.options.text_color && this._el.container.style.setProperty("--vco-color-text", this.options.text_color), this.options.text_background_color && this._el.container.style.setProperty("--vco-color-text-background", this.options.text_background_color), this._el.menubar = N.create("div", "vco-menubar", this._el.container), this._el.map = this._resolveMapElement(), this._el.map || (this._el.map = N.create("div", "vco-map", this._el.container)), this._el.storyslider = N.create("div", "vco-storyslider", this._el.container), this.options.width = this._el.container.offsetWidth, this.options.height = this._el.container.offsetHeight, this._el.map.style.height = "1px", this._el.storyslider.style.top = "1px", this._map = new
|
|
25553
|
+
this._el.container.className += " vco-storymap", this.options.base_class = this._el.container.className, this.options.text_color && this._el.container.style.setProperty("--vco-color-text", this.options.text_color), this.options.text_background_color && this._el.container.style.setProperty("--vco-color-text-background", this.options.text_background_color), this._el.menubar = N.create("div", "vco-menubar", this._el.container), this._el.map = this._resolveMapElement(), this._el.map || (this._el.map = N.create("div", "vco-map", this._el.container)), this._el.storyslider = N.create("div", "vco-storyslider", this._el.container), this.options.width = this._el.container.offsetWidth, this.options.height = this._el.container.offsetHeight, this._el.map.style.height = "1px", this._el.storyslider.style.top = "1px", this._map = new Ux(this._el.map, this.data, this.options), this.map = this._map._map, this._map.on("loaded", this._onMapLoaded, this), this._el.map.style.backgroundColor = this.options.map_background_color, this._menubar = new Kx(this._el.menubar, this._el.container, this.options), this._storyslider = new NS(this._el.storyslider, this.data, this.options), this._storyslider.on("loaded", this._onStorySliderLoaded, this), this._storyslider.on("title", this._onTitle, this), this._storyslider.init(), this.options.layout === "portrait" ? (this.options.map_height = this.options.height / this.options.map_size_sticky, this.options.storyslider_height = this.options.height - this._el.menubar.offsetHeight - this.options.map_height - 1, this._menubar.setSticky(0)) : (this.options.menubar_height = this._el.menubar.offsetHeight, this.options.map_height = this.options.height, this.options.storyslider_height = this.options.height - this._el.menubar.offsetHeight - 1, this._menubar.setSticky(this.options.menubar_height)), this._updateDisplay(this.options.map_height, !0, 2e3), this._menubar.show(2e3);
|
|
25495
25554
|
}
|
|
25496
25555
|
_initEvents() {
|
|
25497
25556
|
this._menubar.on("collapse", this._onMenuBarCollapse, this), this._menubar.on("back_to_start", this._onBackToStart, this), this._menubar.on("overview", this._onOverview, this), this._menubar.on("fullscreen", this._onFullscreenToggle, this), this._storyslider.on("change", this._onSlideChange, this), this._storyslider.on("colorchange", this._onColorChange, this), this._map.on("change", this._onMapChange, this), document.addEventListener("fullscreenchange", this._onFullscreenChange.bind(this));
|
|
25498
25557
|
}
|
|
25499
25558
|
_updateDisplay(e, t, n) {
|
|
25500
25559
|
let r = this.options.duration, i = this.options.base_class;
|
|
25501
|
-
n && (r = n), this.options.width = this._el.container.offsetWidth, this.options.height = this._el.container.offsetHeight, this.options.width <= this.options.skinny_size ? this.options.layout = "portrait" : this.options.layout = "landscape", e && (this.options.map_height = e), Px.touch && (this.options.layout = Px.orientation(), i += " vco-mobile"), this.options.layout === "portrait" ? (i += " vco-skinny", this._map.setMapOffset(0, 0), this.options.map_height = this.options.height / this.options.map_size_sticky, this.options.storyslider_height = this.options.height - this.options.map_height - 1, this._menubar.setSticky(0), i += " vco-layout-portrait", t ? (this.animator_map && this.animator_map.stop(), this.animator_map = (0,
|
|
25560
|
+
n && (r = n), this.options.width = this._el.container.offsetWidth, this.options.height = this._el.container.offsetHeight, this.options.width <= this.options.skinny_size ? this.options.layout = "portrait" : this.options.layout = "landscape", e && (this.options.map_height = e), Px.touch && (this.options.layout = Px.orientation(), i += " vco-mobile"), this.options.layout === "portrait" ? (i += " vco-skinny", this._map.setMapOffset(0, 0), this.options.map_height = this.options.height / this.options.map_size_sticky, this.options.storyslider_height = this.options.height - this.options.map_height - 1, this._menubar.setSticky(0), i += " vco-layout-portrait", this._el.map.style.width = "100%", t ? (this.animator_map && this.animator_map.stop(), this.animator_map = (0, qx.default)(this._el.map, {
|
|
25502
25561
|
height: this.options.map_height + "px",
|
|
25503
25562
|
duration: r,
|
|
25504
25563
|
easing: Je,
|
|
25505
25564
|
complete: () => {
|
|
25506
25565
|
this._map.updateDisplay(this.options.width, this.options.map_height, t, n, this.options.menubar_height);
|
|
25507
25566
|
}
|
|
25508
|
-
}), this.animator_storyslider && this.animator_storyslider.stop(), this.animator_storyslider = (0,
|
|
25567
|
+
}), this.animator_storyslider && this.animator_storyslider.stop(), this.animator_storyslider = (0, qx.default)(this._el.storyslider, {
|
|
25509
25568
|
height: this.options.storyslider_height + "px",
|
|
25510
25569
|
duration: r,
|
|
25511
25570
|
easing: Je
|
|
25512
|
-
})) : (this._el.map.style.height = Math.ceil(this.options.map_height) + "px", this._el.storyslider.style.height = this.options.storyslider_height + "px"), this._menubar.updateDisplay(this.options.width, this.options.height, t), this._map.updateDisplay(this.options.width, this.options.height, !1), this._storyslider.updateDisplay(this.options.width, this.options.storyslider_height, t, this.options.layout)) : (i += " vco-layout-landscape", this.options.menubar_height = this._el.menubar.offsetHeight, this.options.map_height = this.options.height, this.options.storyslider_height = this.options.height, this._menubar.setSticky(this.options.menubar_height), this._menubar.setSticky(this.options.menubar_height), this._el.map.style.height = this.options.height + "px", this._map.setMapOffset(-(this.options.width / 4), 0), this._el.storyslider.style.top = "0", this._el.storyslider.style.height = this.options.storyslider_height + "px", this._menubar.updateDisplay(this.options.width, this.options.height, t), this._map.updateDisplay(this.options.width, this.options.height, t, n), this._storyslider.updateDisplay(this.options.width / 2, this.options.storyslider_height, t, this.options.layout)), this.options.language.direction === "rtl" && (i += " vco-rtl"), this._el.container.className = i;
|
|
25571
|
+
})) : (this._el.map.style.height = Math.ceil(this.options.map_height) + "px", this._el.storyslider.style.height = this.options.storyslider_height + "px"), this._menubar.updateDisplay(this.options.width, this.options.height, t), this._map.updateDisplay(this.options.width, this.options.height, !1), this._storyslider.updateDisplay(this.options.width, this.options.storyslider_height, t, this.options.layout)) : (i += " vco-layout-landscape", this.options.menubar_height = this._el.menubar.offsetHeight, this.options.map_height = this.options.height, this.options.storyslider_height = this.options.height, this._menubar.setSticky(this.options.menubar_height), this._menubar.setSticky(this.options.menubar_height), this._el.map.style.height = this.options.height + "px", this.options.map_area === "left" ? (i += " vco-map-area-left", this._el.map.style.width = Math.floor(this.options.width / 2) + "px", this._map.setMapOffset(0, 0)) : (this._el.map.style.width = "100%", this._map.setMapOffset(-(this.options.width / 4), 0)), this._el.storyslider.style.top = "0", this._el.storyslider.style.height = this.options.storyslider_height + "px", this._menubar.updateDisplay(this.options.width, this.options.height, t), this._map.updateDisplay(this.options.width, this.options.height, t, n), this._storyslider.updateDisplay(this.options.width / 2, this.options.storyslider_height, t, this.options.layout)), this.options.language.direction === "rtl" && (i += " vco-rtl"), this._el.container.className = i;
|
|
25513
25572
|
}
|
|
25514
25573
|
_onDataLoaded(e) {
|
|
25515
25574
|
this.options.consent_manager = new Ne(), this.fire("dataloaded"), this._initLayout(), this._loadFontCss().catch((e) => {
|
|
@@ -25611,13 +25670,13 @@ var TS = class {
|
|
|
25611
25670
|
_onLoaded() {
|
|
25612
25671
|
this._loaded.storyslider && this._loaded.map && (this.fire("loaded", this.data), this._hash_initialized || (this._hash_initialized = !0, this._applyHashSlide(), window.addEventListener("hashchange", () => this._applyHashSlide()), this._syncHash()), this._updateProgress(), this._updateDistance());
|
|
25613
25672
|
}
|
|
25614
|
-
},
|
|
25673
|
+
}, FS = class extends Xe(PS) {
|
|
25615
25674
|
static SCRIPT_PATH = new URL("../", "" + import.meta.url).href;
|
|
25616
25675
|
constructor(...e) {
|
|
25617
25676
|
super(...e);
|
|
25618
25677
|
}
|
|
25619
25678
|
};
|
|
25620
25679
|
//#endregion
|
|
25621
|
-
export {
|
|
25680
|
+
export { TS as MediaType, FS as StoryMap, D as loadCSS, Ae as setLanguage, A as validateStorymap, ne as validateStorymapAndReport };
|
|
25622
25681
|
|
|
25623
25682
|
//# sourceMappingURL=storymap.js.map
|