Skip to content

Commit

Permalink
[build] 0.4.2
Browse files Browse the repository at this point in the history
fix: [#10, bug when user set preset but silentLoad without legal kernels](#10)
  • Loading branch information
toxic-johann committed Nov 7, 2017
1 parent 929efbf commit 98ee9b7
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 60 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.

54 changes: 36 additions & 18 deletions lib/index.browser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/**
* chimee v0.4.1
* chimee v0.4.2
* (c) 2017 toxic-johann
* Released under MIT
*/
Expand Down Expand Up @@ -4121,7 +4121,7 @@ var CustEvent = function () {
}();

/**
* chimee-helper-dom v0.1.2
* chimee-helper-dom v0.1.4
* (c) 2017 huzunjie
* Released under MIT
*/
Expand Down Expand Up @@ -4373,7 +4373,7 @@ var CustEvent$1 = function () {
}();

/**
* chimee-helper-utils v0.1.3
* chimee-helper-utils v0.2.0
* (c) 2017 toxic-johann
* Released under MIT
*/
Expand Down Expand Up @@ -4554,13 +4554,26 @@ function addDelegate(el, selector, type, handler) {


var handlerWrap = function handlerWrap(e) {
var targetEls = findParents(e.target || e.srcElement, el, true);
var targetEl = query(selector, el, true).find(function (seEl) {
return targetEls.find(function (tgEl) {
return seEl === tgEl;
var targetElsArr = findParents(e.target || e.srcElement, el, true);
var targetElArr = query(selector, el, true);
var retEl = void 0;
if (targetElArr.find) {
retEl = targetElArr.find(function (seEl) {
return targetElsArr.find(function (tgEl) {
return seEl === tgEl;
});
});
});
targetEl && handler.apply(targetEl, arguments);
} else {
// Fixed IE11 Array.find not defined bug
targetElArr.forEach(function (seEl) {
return !retEl && targetElsArr.forEach(function (tgEl) {
if (!retEl && seEl === tgEl) {
retEl = tgEl;
}
});
});
}
retEl && handler.apply(retEl, arguments);
};
/* 将包装后的方法记录到缓存中 */
addEventCache$1(el, type + '_delegate_' + selector, handler, handlerWrap);
Expand Down Expand Up @@ -5042,7 +5055,7 @@ var NodeWrap = function () {
}();

/**
* chimee-helper v0.2.5
* chimee-helper v0.2.6
* (c) 2017 toxic-johann
* Released under MIT
*/
Expand Down Expand Up @@ -8742,7 +8755,7 @@ var Plugin = (_dec$3 = autobindClass(), _dec$3(_class$3 = function (_VideoWrappe
var _this = _possibleConstructorReturn(this, (Plugin.__proto__ || _Object$getPrototypeOf(Plugin)).call(this));

_this.destroyed = false;
_this.VERSION = '0.4.1';
_this.VERSION = '0.4.2';
_this.__operable = true;
_this.__level = 0;

Expand Down Expand Up @@ -10011,11 +10024,13 @@ var Dispatcher = (_dec$1 = before(convertNameIntoId), _dec2 = before(checkPlugin
_option$box = option.box,
box = _option$box === undefined ? this.videoConfig.box : _option$box,
_option$kernels = option.kernels,
kernels = _option$kernels === undefined ? this.videoConfig.kernels : _option$kernels;
kernels = _option$kernels === undefined ? this.videoConfig.kernels : _option$kernels,
_option$preset = option.preset,
preset = _option$preset === undefined ? this.videoConfig.preset : _option$preset;
// form the base config for kernel
// it should be the same as the config now

var config = { isLive: isLive, box: box, src: src, kernels: kernels };
var config = { isLive: isLive, box: box, src: src, kernels: kernels, preset: preset };
// build tasks accroding repeat times
var tasks = new Array(repeatTimes + 1).fill(1).map(function (value, index) {
return function () {
Expand Down Expand Up @@ -10075,8 +10090,8 @@ var Dispatcher = (_dec$1 = before(convertNameIntoId), _dec2 = before(checkPlugin
addEvent(video, 'canplay', videoCanplay, true);
addEvent(video, 'loadedmetadata', videoLoadedmetadata, true);
addEvent(video, 'error', videoError, true);
addEvent(_this2.dom.videoElement, 'timeupdate', oldVideoTimeupdate);
var kernel = _this2._createKernel(video, config);
addEvent(_this2.dom.videoElement, 'timeupdate', oldVideoTimeupdate);
kernel.load();
});
};
Expand Down Expand Up @@ -10132,8 +10147,8 @@ var Dispatcher = (_dec$1 = before(convertNameIntoId), _dec2 = before(checkPlugin
_isLive = _option$isLive2 === undefined ? videoConfig.isLive : _option$isLive2,
_option$box2 = option.box,
_box = _option$box2 === undefined ? videoConfig.box : _option$box2,
_option$preset = option.preset,
_preset = _option$preset === undefined ? videoConfig.preset : _option$preset,
_option$preset2 = option.preset,
_preset = _option$preset2 === undefined ? videoConfig.preset : _option$preset2,
_option$kernels2 = option.kernels,
_kernels = _option$kernels2 === undefined ? videoConfig.kernels : _option$kernels2;

Expand Down Expand Up @@ -10289,7 +10304,7 @@ var Dispatcher = (_dec$1 = before(convertNameIntoId), _dec2 = before(checkPlugin
kernels[key] = kernelsSet[key];
return kernels;
}, {}) : isObject$1(kernels) ? kernels : {};
config.preset = _Object$assign(newPreset, config.preset);
config.preset = _Object$assign(newPreset, preset);
return new Kernel(video, config);
}
/**
Expand Down Expand Up @@ -10346,6 +10361,9 @@ var Dispatcher = (_dec$1 = before(convertNameIntoId), _dec2 = before(checkPlugin
kernelsSet[key] = value;
});
}

// only use for debug in internal

}, {
key: 'uninstallKernel',
value: function uninstallKernel(key) {
Expand Down Expand Up @@ -10592,7 +10610,7 @@ var Chimee = (_dec = autobindClass(), _dec(_class = (_class2 = (_temp = _class3
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'version', [frozen], {
enumerable: true,
initializer: function initializer() {
return '0.4.1';
return '0.4.2';
}
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, 'config', [frozen], {
enumerable: true,
Expand Down
54 changes: 36 additions & 18 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/**
* chimee v0.4.1
* chimee v0.4.2
* (c) 2017 toxic-johann
* Released under MIT
*/
Expand Down Expand Up @@ -1857,7 +1857,7 @@ var CustEvent = function () {
}();

/**
* chimee-helper-dom v0.1.2
* chimee-helper-dom v0.1.4
* (c) 2017 huzunjie
* Released under MIT
*/
Expand Down Expand Up @@ -2109,7 +2109,7 @@ var CustEvent$1 = function () {
}();

/**
* chimee-helper-utils v0.1.3
* chimee-helper-utils v0.2.0
* (c) 2017 toxic-johann
* Released under MIT
*/
Expand Down Expand Up @@ -2290,13 +2290,26 @@ function addDelegate(el, selector, type, handler) {


var handlerWrap = function handlerWrap(e) {
var targetEls = findParents(e.target || e.srcElement, el, true);
var targetEl = query(selector, el, true).find(function (seEl) {
return targetEls.find(function (tgEl) {
return seEl === tgEl;
var targetElsArr = findParents(e.target || e.srcElement, el, true);
var targetElArr = query(selector, el, true);
var retEl = void 0;
if (targetElArr.find) {
retEl = targetElArr.find(function (seEl) {
return targetElsArr.find(function (tgEl) {
return seEl === tgEl;
});
});
});
targetEl && handler.apply(targetEl, arguments);
} else {
// Fixed IE11 Array.find not defined bug
targetElArr.forEach(function (seEl) {
return !retEl && targetElsArr.forEach(function (tgEl) {
if (!retEl && seEl === tgEl) {
retEl = tgEl;
}
});
});
}
retEl && handler.apply(retEl, arguments);
};
/* 将包装后的方法记录到缓存中 */
addEventCache$1(el, type + '_delegate_' + selector, handler, handlerWrap);
Expand Down Expand Up @@ -2778,7 +2791,7 @@ var NodeWrap = function () {
}();

/**
* chimee-helper v0.2.5
* chimee-helper v0.2.6
* (c) 2017 toxic-johann
* Released under MIT
*/
Expand Down Expand Up @@ -4155,7 +4168,7 @@ var Plugin = (_dec$3 = toxicDecorators.autobindClass(), _dec$3(_class$3 = functi
var _this = _possibleConstructorReturn(this, (Plugin.__proto__ || _Object$getPrototypeOf(Plugin)).call(this));

_this.destroyed = false;
_this.VERSION = '0.4.1';
_this.VERSION = '0.4.2';
_this.__operable = true;
_this.__level = 0;

Expand Down Expand Up @@ -5143,11 +5156,13 @@ var Dispatcher = (_dec$1 = toxicDecorators.before(convertNameIntoId), _dec2 = to
_option$box = option.box,
box = _option$box === undefined ? this.videoConfig.box : _option$box,
_option$kernels = option.kernels,
kernels = _option$kernels === undefined ? this.videoConfig.kernels : _option$kernels;
kernels = _option$kernels === undefined ? this.videoConfig.kernels : _option$kernels,
_option$preset = option.preset,
preset = _option$preset === undefined ? this.videoConfig.preset : _option$preset;
// form the base config for kernel
// it should be the same as the config now

var config = { isLive: isLive, box: box, src: src, kernels: kernels };
var config = { isLive: isLive, box: box, src: src, kernels: kernels, preset: preset };
// build tasks accroding repeat times
var tasks = new Array(repeatTimes + 1).fill(1).map(function (value, index) {
return function () {
Expand Down Expand Up @@ -5207,8 +5222,8 @@ var Dispatcher = (_dec$1 = toxicDecorators.before(convertNameIntoId), _dec2 = to
addEvent(video, 'canplay', videoCanplay, true);
addEvent(video, 'loadedmetadata', videoLoadedmetadata, true);
addEvent(video, 'error', videoError, true);
addEvent(_this2.dom.videoElement, 'timeupdate', oldVideoTimeupdate);
var kernel = _this2._createKernel(video, config);
addEvent(_this2.dom.videoElement, 'timeupdate', oldVideoTimeupdate);
kernel.load();
});
};
Expand Down Expand Up @@ -5264,8 +5279,8 @@ var Dispatcher = (_dec$1 = toxicDecorators.before(convertNameIntoId), _dec2 = to
_isLive = _option$isLive2 === undefined ? videoConfig.isLive : _option$isLive2,
_option$box2 = option.box,
_box = _option$box2 === undefined ? videoConfig.box : _option$box2,
_option$preset = option.preset,
_preset = _option$preset === undefined ? videoConfig.preset : _option$preset,
_option$preset2 = option.preset,
_preset = _option$preset2 === undefined ? videoConfig.preset : _option$preset2,
_option$kernels2 = option.kernels,
_kernels = _option$kernels2 === undefined ? videoConfig.kernels : _option$kernels2;

Expand Down Expand Up @@ -5421,7 +5436,7 @@ var Dispatcher = (_dec$1 = toxicDecorators.before(convertNameIntoId), _dec2 = to
kernels[key] = kernelsSet[key];
return kernels;
}, {}) : isObject(kernels) ? kernels : {};
config.preset = _Object$assign(newPreset, config.preset);
config.preset = _Object$assign(newPreset, preset);
return new Kernel(video, config);
}
/**
Expand Down Expand Up @@ -5478,6 +5493,9 @@ var Dispatcher = (_dec$1 = toxicDecorators.before(convertNameIntoId), _dec2 = to
kernelsSet[key] = value;
});
}

// only use for debug in internal

}, {
key: 'uninstallKernel',
value: function uninstallKernel(key) {
Expand Down Expand Up @@ -5724,7 +5742,7 @@ var Chimee = (_dec = toxicDecorators.autobindClass(), _dec(_class = (_class2 = (
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, 'version', [toxicDecorators.frozen], {
enumerable: true,
initializer: function initializer() {
return '0.4.1';
return '0.4.2';
}
}), _descriptor3 = _applyDecoratedDescriptor(_class2.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.

Loading

0 comments on commit 98ee9b7

Please sign in to comment.