eligius 1.0.9 → 1.0.10
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 +8 -4
- package/dist/controllers/progressbar-controller.d.ts +2 -1
- package/dist/eligius.cjs.development.js +23 -12
- package/dist/eligius.cjs.development.js.map +1 -1
- package/dist/eligius.cjs.production.min.js +1 -1
- package/dist/eligius.cjs.production.min.js.map +1 -1
- package/dist/eligius.esm.js +23 -12
- package/dist/eligius.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/eligius.esm.js
CHANGED
|
@@ -425,6 +425,10 @@ function prepareValueForSerialization(value) {
|
|
|
425
425
|
} else if (value instanceof $) {
|
|
426
426
|
return 'jQuery object';
|
|
427
427
|
} else if (value !== null && typeof value === 'object') {
|
|
428
|
+
if (value.constructor.toString().substring(0, 5) === 'class') {
|
|
429
|
+
return 'Complex object';
|
|
430
|
+
}
|
|
431
|
+
|
|
428
432
|
return Object.fromEntries(Object.entries(value).map(function (_ref) {
|
|
429
433
|
var propName = _ref[0],
|
|
430
434
|
propValue = _ref[1];
|
|
@@ -1733,6 +1737,7 @@ var ProgressbarController = /*#__PURE__*/function () {
|
|
|
1733
1737
|
this.selectedElement = null;
|
|
1734
1738
|
this.textElement = null;
|
|
1735
1739
|
this.detachers = [];
|
|
1740
|
+
this.duration = 0;
|
|
1736
1741
|
}
|
|
1737
1742
|
|
|
1738
1743
|
var _proto = ProgressbarController.prototype;
|
|
@@ -1743,17 +1748,20 @@ var ProgressbarController = /*#__PURE__*/function () {
|
|
|
1743
1748
|
};
|
|
1744
1749
|
|
|
1745
1750
|
_proto.attach = function attach(eventbus) {
|
|
1746
|
-
var _this
|
|
1747
|
-
_this
|
|
1751
|
+
var _this = this,
|
|
1752
|
+
_this$selectedElement;
|
|
1748
1753
|
|
|
1749
1754
|
this.detachers.push(eventbus.on(TimelineEventNames.POSITION_UPDATE, this.positionUpdateHandler.bind(this)));
|
|
1750
|
-
|
|
1755
|
+
eventbus.broadcast(TimelineEventNames.DURATION_REQUEST, [function (duration) {
|
|
1756
|
+
return _this.duration = duration;
|
|
1757
|
+
}]);
|
|
1758
|
+
var clickHandler = this.clickHandler.bind(this, eventbus);
|
|
1751
1759
|
(_this$selectedElement = this.selectedElement) == null ? void 0 : _this$selectedElement.on('click', clickHandler);
|
|
1752
1760
|
this.detachers.push(function () {
|
|
1753
1761
|
var _this$selectedElement2;
|
|
1754
1762
|
|
|
1755
|
-
return (_this$selectedElement2 = _this.selectedElement) == null ? void 0 : _this$selectedElement2.off('click');
|
|
1756
|
-
}
|
|
1763
|
+
return (_this$selectedElement2 = _this.selectedElement) == null ? void 0 : _this$selectedElement2.off('click', clickHandler);
|
|
1764
|
+
});
|
|
1757
1765
|
};
|
|
1758
1766
|
|
|
1759
1767
|
_proto.detach = function detach(_eventbus) {
|
|
@@ -1772,7 +1780,14 @@ var ProgressbarController = /*#__PURE__*/function () {
|
|
|
1772
1780
|
(_this$textElement = this.textElement) == null ? void 0 : _this$textElement.text(Math.floor(percentage) + "%");
|
|
1773
1781
|
};
|
|
1774
1782
|
|
|
1775
|
-
_proto.clickHandler = function clickHandler() {
|
|
1783
|
+
_proto.clickHandler = function clickHandler(eventbus, event) {
|
|
1784
|
+
var element = event.target;
|
|
1785
|
+
var rect = element.getBoundingClientRect();
|
|
1786
|
+
var x = event.clientX - rect.left; //x position within the element.
|
|
1787
|
+
|
|
1788
|
+
var percentage = 100 / rect.width * x;
|
|
1789
|
+
eventbus.broadcast(TimelineEventNames.SEEK_REQUEST, [Math.floor(this.duration / 100 * percentage)]);
|
|
1790
|
+
};
|
|
1776
1791
|
|
|
1777
1792
|
return ProgressbarController;
|
|
1778
1793
|
}();
|
|
@@ -5374,7 +5389,7 @@ function setElementAttributes() {
|
|
|
5374
5389
|
function setElementContent() {
|
|
5375
5390
|
return {
|
|
5376
5391
|
description: 'Sets the given HTML content in the selected element',
|
|
5377
|
-
dependentProperties: ['selectedElement'],
|
|
5392
|
+
dependentProperties: ['selectedElement', 'template'],
|
|
5378
5393
|
properties: {
|
|
5379
5394
|
insertionType: [{
|
|
5380
5395
|
value: 'overwrite',
|
|
@@ -5386,11 +5401,7 @@ function setElementContent() {
|
|
|
5386
5401
|
}, {
|
|
5387
5402
|
value: 'prepend',
|
|
5388
5403
|
description: 'the new content will be inserted before the current content'
|
|
5389
|
-
}]
|
|
5390
|
-
template: {
|
|
5391
|
-
type: 'ParameterType:htmlContent',
|
|
5392
|
-
required: true
|
|
5393
|
-
}
|
|
5404
|
+
}]
|
|
5394
5405
|
}
|
|
5395
5406
|
};
|
|
5396
5407
|
}
|