Skip to content

Commit

Permalink
build: 0.10.0-alpha.9
Browse files Browse the repository at this point in the history
  • Loading branch information
toxic-johann committed May 19, 2018
1 parent dd71c73 commit aac928d
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 48 deletions.
2 changes: 1 addition & 1 deletion bundle-size/common.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle-size/es.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle-size/min.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle-size/umd.html

Large diffs are not rendered by default.

48 changes: 34 additions & 14 deletions lib/index.browser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/**
* chimee v0.10.0-alpha.8
* chimee v0.10.0-alpha.9
* (c) 2017-2018 toxic-johann
* Released under MIT
*/
Expand Down Expand Up @@ -7775,7 +7775,7 @@
var _this = _possibleConstructorReturn(this, (Plugin.__proto__ || _Object$getPrototypeOf(Plugin)).call(this));

_this.destroyed = false;
_this.VERSION = '0.10.0-alpha.8';
_this.VERSION = '0.10.0-alpha.9';
_this.__operable = true;
_this.__level = 0;

Expand Down Expand Up @@ -7922,6 +7922,10 @@
value: function __inited() {
var _this2 = this;

if (this.__dispatcher.binder.needToCheckPendingVideoDomEventPlugins[this.__id]) {
this.__dispatcher.binder.applyPendingEvents('video-dom');
this.__dispatcher.binder.needToCheckPendingVideoDomEventPlugins[this.__id] = false;
}
var result = void 0;
try {
result = isFunction(this.inited) && this.inited();
Expand Down Expand Up @@ -9595,6 +9599,7 @@
this.bindedEventNames = {};
this.bindedEventInfo = {};
this.pendingEventsInfo = {};
this.needToCheckPendingVideoDomEventPlugins = {};
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
Expand Down Expand Up @@ -9894,14 +9899,17 @@
var targetDom = this._getTargetDom(target);
// choose the correspond method to bind
if (target === 'kernel') {
if (!this.__dispatcher.kernel) {
this.addPendingEvent(target, name, id);
return;
}
fn = function fn() {
for (var _len7 = arguments.length, args = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
args[_key7] = arguments[_key7];
}

return _this5.triggerSync.apply(_this5, [{ target: target, name: name, id: 'kernel' }].concat(args));
};

this.__dispatcher.kernel.on(name, fn);
} else if (target === 'container' || target === 'wrapper') {
fn = function fn() {
Expand All @@ -9922,9 +9930,17 @@
};
this._addEventOnDom(targetDom, name, fn);
} else if (target === 'video-dom') {
var _ref21 = Dispatcher.getPluginConfig(id) || {},
_ref21$penetrate = _ref21.penetrate,
penetrate = _ref21$penetrate === undefined ? false : _ref21$penetrate;
if (!this.__dispatcher.plugins[id]) {
// The plugin has not been created
// We will be better to wait for it in order to check its penetrate
this.needToCheckPendingVideoDomEventPlugins[id] = true;
this.addPendingEvent(target, name, id);
return;
}

var _ref21 = this.__dispatcher.plugins[id] || {},
_ref21$$penetrate = _ref21.$penetrate,
$penetrate = _ref21$$penetrate === undefined ? false : _ref21$$penetrate;

fn = function fn() {
for (var _len10 = arguments.length, args = Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
Expand All @@ -9933,7 +9949,7 @@

return _this5.triggerSync.apply(_this5, [{ target: target, name: name, id: target }].concat(args));
};
if (penetrate) this.__dispatcher.dom.videoExtendedNodes.forEach(function (node) {
if ($penetrate) this.__dispatcher.dom.videoExtendedNodes.forEach(function (node) {
return _this5._addEventOnDom(node, name, fn);
});
this._addEventOnDom(targetDom, name, fn);
Expand Down Expand Up @@ -10027,11 +10043,12 @@
key: 'applyPendingEvents',
value: function applyPendingEvents(target) {
var pendingEvents = this.pendingEventsInfo[target];
while (pendingEvents.length) {
var _pendingEvents$pop = pendingEvents.pop(),
_pendingEvents$pop2 = _slicedToArray(_pendingEvents$pop, 2),
_name2 = _pendingEvents$pop2[0],
id = _pendingEvents$pop2[1];
var pendingEventsCopy = pendingEvents.splice(0, pendingEvents.length);
while (pendingEventsCopy.length) {
var _pendingEventsCopy$po = pendingEventsCopy.pop(),
_pendingEventsCopy$po2 = _slicedToArray(_pendingEventsCopy$po, 2),
_name2 = _pendingEventsCopy$po2[0],
id = _pendingEventsCopy$po2[1];

this._addEventListenerOnTarget({ name: _name2, target: target, id: id });
}
Expand Down Expand Up @@ -10171,6 +10188,7 @@
* @type {Kernel}
*/
this.kernel = this._createKernel(this.dom.videoElement, this.videoConfig);
this.binder.applyPendingEvents('kernel');
// trigger auto load event
var asyncInitedTasks = [];
this.order.forEach(function (key) {
Expand Down Expand Up @@ -10433,7 +10451,9 @@
value: function load(srcOrOption) {
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

var src = isString(srcOrOption) ? srcOrOption : isObject(srcOrOption) && isString(srcOrOption.src) ? srcOrOption.src : '';
var src = isString(srcOrOption) ? srcOrOption : isObject(srcOrOption) && isString(srcOrOption.src) ? srcOrOption.src
// give a chance for user to clear the src
: '';
if (isObject(srcOrOption)) {
delete srcOrOption.src;
option = srcOrOption;
Expand Down Expand Up @@ -11257,7 +11277,7 @@
}), _descriptor2$1 = _applyDecoratedDescriptor$8(_class2$2.prototype, 'version', [frozen], {
enumerable: true,
initializer: function initializer() {
return '0.10.0-alpha.8';
return '0.10.0-alpha.9';
}
}), _descriptor3$1 = _applyDecoratedDescriptor$8(_class2$2.prototype, 'config', [frozen], {
enumerable: true,
Expand Down
48 changes: 34 additions & 14 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/**
* chimee v0.10.0-alpha.8
* chimee v0.10.0-alpha.9
* (c) 2017-2018 toxic-johann
* Released under MIT
*/
Expand Down Expand Up @@ -1296,7 +1296,7 @@ var Plugin = (_dec$2 = toxicDecorators.autobindClass(), _dec$2(_class$2 = functi
var _this = _possibleConstructorReturn(this, (Plugin.__proto__ || _Object$getPrototypeOf(Plugin)).call(this));

_this.destroyed = false;
_this.VERSION = '0.10.0-alpha.8';
_this.VERSION = '0.10.0-alpha.9';
_this.__operable = true;
_this.__level = 0;

Expand Down Expand Up @@ -1443,6 +1443,10 @@ var Plugin = (_dec$2 = toxicDecorators.autobindClass(), _dec$2(_class$2 = functi
value: function __inited() {
var _this2 = this;

if (this.__dispatcher.binder.needToCheckPendingVideoDomEventPlugins[this.__id]) {
this.__dispatcher.binder.applyPendingEvents('video-dom');
this.__dispatcher.binder.needToCheckPendingVideoDomEventPlugins[this.__id] = false;
}
var result = void 0;
try {
result = chimeeHelper.isFunction(this.inited) && this.inited();
Expand Down Expand Up @@ -2620,6 +2624,7 @@ var Binder = (_dec$5 = toxicDecorators.before(prettifyEventParameter), _dec2$4 =
this.bindedEventNames = {};
this.bindedEventInfo = {};
this.pendingEventsInfo = {};
this.needToCheckPendingVideoDomEventPlugins = {};
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
Expand Down Expand Up @@ -2919,14 +2924,17 @@ var Binder = (_dec$5 = toxicDecorators.before(prettifyEventParameter), _dec2$4 =
var targetDom = this._getTargetDom(target);
// choose the correspond method to bind
if (target === 'kernel') {
if (!this.__dispatcher.kernel) {
this.addPendingEvent(target, name, id);
return;
}
fn = function fn() {
for (var _len7 = arguments.length, args = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
args[_key7] = arguments[_key7];
}

return _this5.triggerSync.apply(_this5, [{ target: target, name: name, id: 'kernel' }].concat(args));
};

this.__dispatcher.kernel.on(name, fn);
} else if (target === 'container' || target === 'wrapper') {
fn = function fn() {
Expand All @@ -2947,9 +2955,17 @@ var Binder = (_dec$5 = toxicDecorators.before(prettifyEventParameter), _dec2$4 =
};
this._addEventOnDom(targetDom, name, fn);
} else if (target === 'video-dom') {
var _ref21 = Dispatcher.getPluginConfig(id) || {},
_ref21$penetrate = _ref21.penetrate,
penetrate = _ref21$penetrate === undefined ? false : _ref21$penetrate;
if (!this.__dispatcher.plugins[id]) {
// The plugin has not been created
// We will be better to wait for it in order to check its penetrate
this.needToCheckPendingVideoDomEventPlugins[id] = true;
this.addPendingEvent(target, name, id);
return;
}

var _ref21 = this.__dispatcher.plugins[id] || {},
_ref21$$penetrate = _ref21.$penetrate,
$penetrate = _ref21$$penetrate === undefined ? false : _ref21$$penetrate;

fn = function fn() {
for (var _len10 = arguments.length, args = Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
Expand All @@ -2958,7 +2974,7 @@ var Binder = (_dec$5 = toxicDecorators.before(prettifyEventParameter), _dec2$4 =

return _this5.triggerSync.apply(_this5, [{ target: target, name: name, id: target }].concat(args));
};
if (penetrate) this.__dispatcher.dom.videoExtendedNodes.forEach(function (node) {
if ($penetrate) this.__dispatcher.dom.videoExtendedNodes.forEach(function (node) {
return _this5._addEventOnDom(node, name, fn);
});
this._addEventOnDom(targetDom, name, fn);
Expand Down Expand Up @@ -3052,11 +3068,12 @@ var Binder = (_dec$5 = toxicDecorators.before(prettifyEventParameter), _dec2$4 =
key: 'applyPendingEvents',
value: function applyPendingEvents(target) {
var pendingEvents = this.pendingEventsInfo[target];
while (pendingEvents.length) {
var _pendingEvents$pop = pendingEvents.pop(),
_pendingEvents$pop2 = _slicedToArray(_pendingEvents$pop, 2),
_name2 = _pendingEvents$pop2[0],
id = _pendingEvents$pop2[1];
var pendingEventsCopy = pendingEvents.splice(0, pendingEvents.length);
while (pendingEventsCopy.length) {
var _pendingEventsCopy$po = pendingEventsCopy.pop(),
_pendingEventsCopy$po2 = _slicedToArray(_pendingEventsCopy$po, 2),
_name2 = _pendingEventsCopy$po2[0],
id = _pendingEventsCopy$po2[1];

this._addEventListenerOnTarget({ name: _name2, target: target, id: id });
}
Expand Down Expand Up @@ -3196,6 +3213,7 @@ var Dispatcher = (_dec$6 = toxicDecorators.before(convertNameIntoId), _dec2$5 =
* @type {Kernel}
*/
this.kernel = this._createKernel(this.dom.videoElement, this.videoConfig);
this.binder.applyPendingEvents('kernel');
// trigger auto load event
var asyncInitedTasks = [];
this.order.forEach(function (key) {
Expand Down Expand Up @@ -3458,7 +3476,9 @@ var Dispatcher = (_dec$6 = toxicDecorators.before(convertNameIntoId), _dec2$5 =
value: function load(srcOrOption) {
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

var src = chimeeHelper.isString(srcOrOption) ? srcOrOption : chimeeHelper.isObject(srcOrOption) && chimeeHelper.isString(srcOrOption.src) ? srcOrOption.src : '';
var src = chimeeHelper.isString(srcOrOption) ? srcOrOption : chimeeHelper.isObject(srcOrOption) && chimeeHelper.isString(srcOrOption.src) ? srcOrOption.src
// give a chance for user to clear the src
: '';
if (chimeeHelper.isObject(srcOrOption)) {
delete srcOrOption.src;
option = srcOrOption;
Expand Down Expand Up @@ -4073,7 +4093,7 @@ var Chimee = (_dec$7 = toxicDecorators.autobindClass(), _dec$7(_class$8 = (_clas
}), _descriptor2$1 = _applyDecoratedDescriptor$7(_class2$1.prototype, 'version', [toxicDecorators.frozen], {
enumerable: true,
initializer: function initializer() {
return '0.10.0-alpha.8';
return '0.10.0-alpha.9';
}
}), _descriptor3$1 = _applyDecoratedDescriptor$7(_class2$1.prototype, 'config', [toxicDecorators.frozen], {
enumerable: true,
Expand Down
2 changes: 1 addition & 1 deletion lib/index.min.js

Large diffs are not rendered by default.

48 changes: 34 additions & 14 deletions lib/index.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/**
* chimee v0.10.0-alpha.8
* chimee v0.10.0-alpha.9
* (c) 2017-2018 toxic-johann
* Released under MIT
*/
Expand Down Expand Up @@ -1292,7 +1292,7 @@ var Plugin = (_dec$2 = autobindClass(), _dec$2(_class$2 = function (_VideoWrappe
var _this = _possibleConstructorReturn(this, (Plugin.__proto__ || _Object$getPrototypeOf(Plugin)).call(this));

_this.destroyed = false;
_this.VERSION = '0.10.0-alpha.8';
_this.VERSION = '0.10.0-alpha.9';
_this.__operable = true;
_this.__level = 0;

Expand Down Expand Up @@ -1439,6 +1439,10 @@ var Plugin = (_dec$2 = autobindClass(), _dec$2(_class$2 = function (_VideoWrappe
value: function __inited() {
var _this2 = this;

if (this.__dispatcher.binder.needToCheckPendingVideoDomEventPlugins[this.__id]) {
this.__dispatcher.binder.applyPendingEvents('video-dom');
this.__dispatcher.binder.needToCheckPendingVideoDomEventPlugins[this.__id] = false;
}
var result = void 0;
try {
result = isFunction(this.inited) && this.inited();
Expand Down Expand Up @@ -2616,6 +2620,7 @@ var Binder = (_dec$5 = before(prettifyEventParameter), _dec2$4 = before(prettify
this.bindedEventNames = {};
this.bindedEventInfo = {};
this.pendingEventsInfo = {};
this.needToCheckPendingVideoDomEventPlugins = {};
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
Expand Down Expand Up @@ -2915,14 +2920,17 @@ var Binder = (_dec$5 = before(prettifyEventParameter), _dec2$4 = before(prettify
var targetDom = this._getTargetDom(target);
// choose the correspond method to bind
if (target === 'kernel') {
if (!this.__dispatcher.kernel) {
this.addPendingEvent(target, name, id);
return;
}
fn = function fn() {
for (var _len7 = arguments.length, args = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
args[_key7] = arguments[_key7];
}

return _this5.triggerSync.apply(_this5, [{ target: target, name: name, id: 'kernel' }].concat(args));
};

this.__dispatcher.kernel.on(name, fn);
} else if (target === 'container' || target === 'wrapper') {
fn = function fn() {
Expand All @@ -2943,9 +2951,17 @@ var Binder = (_dec$5 = before(prettifyEventParameter), _dec2$4 = before(prettify
};
this._addEventOnDom(targetDom, name, fn);
} else if (target === 'video-dom') {
var _ref21 = Dispatcher.getPluginConfig(id) || {},
_ref21$penetrate = _ref21.penetrate,
penetrate = _ref21$penetrate === undefined ? false : _ref21$penetrate;
if (!this.__dispatcher.plugins[id]) {
// The plugin has not been created
// We will be better to wait for it in order to check its penetrate
this.needToCheckPendingVideoDomEventPlugins[id] = true;
this.addPendingEvent(target, name, id);
return;
}

var _ref21 = this.__dispatcher.plugins[id] || {},
_ref21$$penetrate = _ref21.$penetrate,
$penetrate = _ref21$$penetrate === undefined ? false : _ref21$$penetrate;

fn = function fn() {
for (var _len10 = arguments.length, args = Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
Expand All @@ -2954,7 +2970,7 @@ var Binder = (_dec$5 = before(prettifyEventParameter), _dec2$4 = before(prettify

return _this5.triggerSync.apply(_this5, [{ target: target, name: name, id: target }].concat(args));
};
if (penetrate) this.__dispatcher.dom.videoExtendedNodes.forEach(function (node) {
if ($penetrate) this.__dispatcher.dom.videoExtendedNodes.forEach(function (node) {
return _this5._addEventOnDom(node, name, fn);
});
this._addEventOnDom(targetDom, name, fn);
Expand Down Expand Up @@ -3048,11 +3064,12 @@ var Binder = (_dec$5 = before(prettifyEventParameter), _dec2$4 = before(prettify
key: 'applyPendingEvents',
value: function applyPendingEvents(target) {
var pendingEvents = this.pendingEventsInfo[target];
while (pendingEvents.length) {
var _pendingEvents$pop = pendingEvents.pop(),
_pendingEvents$pop2 = _slicedToArray(_pendingEvents$pop, 2),
_name2 = _pendingEvents$pop2[0],
id = _pendingEvents$pop2[1];
var pendingEventsCopy = pendingEvents.splice(0, pendingEvents.length);
while (pendingEventsCopy.length) {
var _pendingEventsCopy$po = pendingEventsCopy.pop(),
_pendingEventsCopy$po2 = _slicedToArray(_pendingEventsCopy$po, 2),
_name2 = _pendingEventsCopy$po2[0],
id = _pendingEventsCopy$po2[1];

this._addEventListenerOnTarget({ name: _name2, target: target, id: id });
}
Expand Down Expand Up @@ -3192,6 +3209,7 @@ var Dispatcher = (_dec$6 = before(convertNameIntoId), _dec2$5 = before(checkPlug
* @type {Kernel}
*/
this.kernel = this._createKernel(this.dom.videoElement, this.videoConfig);
this.binder.applyPendingEvents('kernel');
// trigger auto load event
var asyncInitedTasks = [];
this.order.forEach(function (key) {
Expand Down Expand Up @@ -3454,7 +3472,9 @@ var Dispatcher = (_dec$6 = before(convertNameIntoId), _dec2$5 = before(checkPlug
value: function load(srcOrOption) {
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

var src = isString(srcOrOption) ? srcOrOption : isObject(srcOrOption) && isString(srcOrOption.src) ? srcOrOption.src : '';
var src = isString(srcOrOption) ? srcOrOption : isObject(srcOrOption) && isString(srcOrOption.src) ? srcOrOption.src
// give a chance for user to clear the src
: '';
if (isObject(srcOrOption)) {
delete srcOrOption.src;
option = srcOrOption;
Expand Down Expand Up @@ -4069,7 +4089,7 @@ var Chimee = (_dec$7 = autobindClass(), _dec$7(_class$8 = (_class2$1 = (_temp =
}), _descriptor2$1 = _applyDecoratedDescriptor$7(_class2$1.prototype, 'version', [frozen], {
enumerable: true,
initializer: function initializer() {
return '0.10.0-alpha.8';
return '0.10.0-alpha.9';
}
}), _descriptor3$1 = _applyDecoratedDescriptor$7(_class2$1.prototype, 'config', [frozen], {
enumerable: true,
Expand Down
Loading

0 comments on commit aac928d

Please sign in to comment.