ezuikit-js 0.5.0 → 0.5.1
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/CHANGELOG.md +10 -0
- package/demos/react-demo/package.json +0 -1
- package/ezuikit.js +59 -11
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
package/ezuikit.js
CHANGED
|
@@ -32,6 +32,8 @@ const addJs = (filepath, callback, isReadyFun) => {
|
|
|
32
32
|
oJs.setAttribute("src", filepath);
|
|
33
33
|
oJs.onload = callback;
|
|
34
34
|
document.getElementsByTagName("head")[0].appendChild(oJs);
|
|
35
|
+
} else {
|
|
36
|
+
callback();
|
|
35
37
|
}
|
|
36
38
|
};
|
|
37
39
|
const addCss = (filepath, callback) => {
|
|
@@ -397,7 +399,7 @@ class Status {
|
|
|
397
399
|
loadingContainerDOM.appendChild(loadingItemContainer);
|
|
398
400
|
}
|
|
399
401
|
loadingSetText(opt) {
|
|
400
|
-
this.
|
|
402
|
+
this.loadingClearText();
|
|
401
403
|
if (document.getElementById(`${this.id}-loading-item-0`)) {
|
|
402
404
|
var textElement = document.getElementById(`${this.id}-loading-item-0`).childNodes[1];
|
|
403
405
|
if(!textElement) {
|
|
@@ -407,9 +409,13 @@ class Status {
|
|
|
407
409
|
loadingItemContainer.appendChild(textElement);
|
|
408
410
|
}
|
|
409
411
|
textElement.innerHTML = opt.text;
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
412
|
+
textElement.style.color = opt.color || "#FFFFFF";
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
loadingClearText() {
|
|
416
|
+
var elements = document.getElementById(`${this.id}-loading-item-0`).childNodes;
|
|
417
|
+
if(elements.length > 1) {
|
|
418
|
+
elements[1].parentNode.removeChild(elements[1]);
|
|
413
419
|
}
|
|
414
420
|
}
|
|
415
421
|
loadingClear() {
|
|
@@ -26164,6 +26170,44 @@ class Theme {
|
|
|
26164
26170
|
this.renderThemeData();
|
|
26165
26171
|
});
|
|
26166
26172
|
}
|
|
26173
|
+
changeTheme(options) {
|
|
26174
|
+
if(typeof options === 'string') {
|
|
26175
|
+
switch (this.jSPlugin.themeId) {
|
|
26176
|
+
case 'pcLive':
|
|
26177
|
+
this.themeData = pcLiveData.data;
|
|
26178
|
+
this.initThemeData();
|
|
26179
|
+
this.renderThemeData();
|
|
26180
|
+
break;
|
|
26181
|
+
case 'pcRec':
|
|
26182
|
+
this.themeData = pcRecData.data;
|
|
26183
|
+
this.initThemeData();
|
|
26184
|
+
this.renderThemeData();
|
|
26185
|
+
break;
|
|
26186
|
+
case 'mobileLive':
|
|
26187
|
+
this.themeData = mobileLiveData.data;
|
|
26188
|
+
this.initThemeData();
|
|
26189
|
+
this.renderThemeData();
|
|
26190
|
+
break;
|
|
26191
|
+
case 'mobileRec':
|
|
26192
|
+
this.themeData = mobileRecData.data;
|
|
26193
|
+
this.initThemeData();
|
|
26194
|
+
this.renderThemeData();
|
|
26195
|
+
break;
|
|
26196
|
+
case 'themeData':
|
|
26197
|
+
this.themeData = this.jSPlugin.params.themeData;
|
|
26198
|
+
this.initThemeData();
|
|
26199
|
+
this.renderThemeData();
|
|
26200
|
+
break;
|
|
26201
|
+
default:
|
|
26202
|
+
this.fetchThemeData(options);
|
|
26203
|
+
break;
|
|
26204
|
+
}
|
|
26205
|
+
} else if (typeof options === 'object') {
|
|
26206
|
+
this.themeData = options;
|
|
26207
|
+
this.initThemeData();
|
|
26208
|
+
this.renderThemeData();
|
|
26209
|
+
}
|
|
26210
|
+
}
|
|
26167
26211
|
renderThemeData() {
|
|
26168
26212
|
const { header, footer } = this.themeData;
|
|
26169
26213
|
if (this.isNeedRenderHeader && header) {
|
|
@@ -26884,10 +26928,10 @@ class Theme {
|
|
|
26884
26928
|
this.header = defaultTheme.header;
|
|
26885
26929
|
this.footer = defaultTheme.footer;
|
|
26886
26930
|
this.isNeedRenderHeader = lodash.findIndex(header.btnList, (v)=>{
|
|
26887
|
-
return v.isrender
|
|
26931
|
+
return v.isrender > 0;
|
|
26888
26932
|
}) >= 0;
|
|
26889
26933
|
this.isNeedRenderFooter = lodash.findIndex(footer.btnList, (v)=>{
|
|
26890
|
-
return v.isrender
|
|
26934
|
+
return v.isrender > 0;
|
|
26891
26935
|
}) >= 0;
|
|
26892
26936
|
if (this.isNeedRenderHeader) {
|
|
26893
26937
|
if (!document.getElementById(`${this.jSPlugin.id}-headControl`)) {
|
|
@@ -26966,9 +27010,9 @@ class Theme {
|
|
|
26966
27010
|
}
|
|
26967
27011
|
});
|
|
26968
27012
|
}
|
|
26969
|
-
var isNeedRenderTimeLine = lodash.findIndex(this.themeData.header.btnList, (v)=>{
|
|
27013
|
+
var isNeedRenderTimeLine = (lodash.findIndex(this.themeData.header.btnList, (v)=>{
|
|
26970
27014
|
return (v.iconId === 'cloudRec' && v.isrender === 1) || (v.iconId === 'rec' && v.isrender === 1) ;
|
|
26971
|
-
}) >= 0 || (this.isMobile &&matchEzopenUrl(this.jSPlugin.url).type.indexOf('rec') !== -1);
|
|
27015
|
+
}) >= 0 || (this.isMobile && matchEzopenUrl(this.jSPlugin.url).type.indexOf('rec') !== -1)) && !this.jSPlugin.disabledTimeLine;
|
|
26972
27016
|
if (isNeedRenderTimeLine) {
|
|
26973
27017
|
if (this.isMobile) {
|
|
26974
27018
|
this.Rec = new MobileRec(this.jSPlugin);
|
|
@@ -27628,7 +27672,7 @@ class Monitor {
|
|
|
27628
27672
|
}
|
|
27629
27673
|
EZUIKit.opt = _this.opt;
|
|
27630
27674
|
if(window.EZUIKit) {
|
|
27631
|
-
window.EZUIKit.opt =
|
|
27675
|
+
window.EZUIKit.opt = _this.opt;
|
|
27632
27676
|
}
|
|
27633
27677
|
}
|
|
27634
27678
|
request(_this.opt.apiDomain, 'POST', {
|
|
@@ -28243,7 +28287,7 @@ class Monitor {
|
|
|
28243
28287
|
break;
|
|
28244
28288
|
case 'stopTalk':
|
|
28245
28289
|
// window.stopTalk()
|
|
28246
|
-
|
|
28290
|
+
_this.stopTalk();
|
|
28247
28291
|
_this.openSound();
|
|
28248
28292
|
break;
|
|
28249
28293
|
case 'clickEventHandle':
|
|
@@ -29350,6 +29394,7 @@ class EZUIKitPlayer {
|
|
|
29350
29394
|
this.audio = true;
|
|
29351
29395
|
this.poster = params.poster;
|
|
29352
29396
|
this.speed = 1;
|
|
29397
|
+
this.disabledTimeLine = false;
|
|
29353
29398
|
this.env = {
|
|
29354
29399
|
domain: "https://open.ys7.com"
|
|
29355
29400
|
};
|
|
@@ -29360,6 +29405,9 @@ class EZUIKitPlayer {
|
|
|
29360
29405
|
if (typeof params.audio !== 'undefined') {
|
|
29361
29406
|
this.audio = params.audio;
|
|
29362
29407
|
}
|
|
29408
|
+
if (typeof params.disabledTimeLine !== 'undefined') {
|
|
29409
|
+
this.disabledTimeLine = params.disabledTimeLine;
|
|
29410
|
+
}
|
|
29363
29411
|
addJs(`${this.staticPath}/js/jsPlugin-4.0.2.min.js`, () => {
|
|
29364
29412
|
if (autoplay) {
|
|
29365
29413
|
this.initTime = new Date().getTime();
|
|
@@ -30345,7 +30393,7 @@ class EZUIKitPlayer {
|
|
|
30345
30393
|
this.Talk.startTalk();
|
|
30346
30394
|
}
|
|
30347
30395
|
stopTalk() {
|
|
30348
|
-
this.Talk.
|
|
30396
|
+
this.Talk.stopTalk();
|
|
30349
30397
|
}
|
|
30350
30398
|
destroy() {
|
|
30351
30399
|
var destroyRT = this.jSPlugin.JS_DestroyWorker(0);
|