@polyvharmony/live-scenes-foundation 1.3.2 → 1.3.4
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 +50 -0
- package/Index.d.ets +2 -0
- package/ets/modules.abc +0 -0
- package/libs/plvsocket.har +0 -0
- package/oh-package.json5 +1 -1
- package/package.json +1 -1
- package/src/main/ets/common/IPLVBackwardInterface.d.ets +2 -0
- package/src/main/ets/common/PLVBasicDataSource.d.ets +2 -0
- package/src/main/ets/common/PLVCallback.d.ets +10 -8
- package/src/main/ets/common/PLVCommonConstants.d.ets +2 -0
- package/src/main/ets/common/PLVCommonEnums.d.ets +2 -0
- package/src/main/ets/common/PLVDeviceUtils.d.ets +4 -2
- package/src/main/ets/common/PLVHashMap.d.ets +3 -1
- package/src/main/ets/common/PLVJSONUtils.d.ets +14 -12
- package/src/main/ets/common/PLVNetUtils.d.ets +6 -4
- package/src/main/ets/common/PLVPreferencesUtils.d.ets +10 -8
- package/src/main/ets/common/PLVScheduledTask.d.ets +3 -1
- package/src/main/ets/common/PLVSimpleBuffer.d.ets +5 -3
- package/src/main/ets/common/PLVSparseArray.d.ets +8 -6
- package/src/main/ets/common/PLVTextUtils.d.ets +10 -8
- package/src/main/ets/common/PLVTimeUtils.d.ets +3 -1
- package/src/main/ets/common/PLVToastUtils.d.ets +4 -2
- package/src/main/ets/common/PLVType.d.ets +2 -0
- package/src/main/ets/common/PLVUACreator.d.ets +3 -1
- package/src/main/ets/common/PLVUtils.d.ets +24 -22
- package/src/main/ets/common/PLVWebUtils.d.ets +6 -4
- package/src/main/ets/common/ui/PLVNodeController.d.ets +10 -8
- package/src/main/ets/modules/log/PLVLogger.d.ets +10 -8
- package/src/main/ets/modules/log/PLVXLogFilePrinter.d.ets +4 -2
- package/src/main/ets/modules/log/PLVXLogWorker.d.ets +2 -0
- package/src/main/ets/modules/net/PLVApiConstants.d.ets +2 -0
- package/src/main/ets/modules/net/PLVHttpData.d.ets +3 -1
- package/src/main/ets/modules/net/PLVHttpError.d.ets +4 -2
- package/src/main/ets/modules/net/PLVHttpRequest.d.ets +10 -8
- package/src/main/ets/modules/net/PLVRequestSetting.d.ets +5 -3
- package/src/main/ets/modules/socket/PLVSocketIO.d.ets +24 -21
- package/src/main/ets/modules/web/PLVFailureLayout.d.ets +2 -0
- package/src/main/ets/modules/web/PLVLoadingLayout.d.ets +2 -0
- package/src/main/ets/modules/web/PLVNewWindowLayout.d.ets +2 -0
- package/src/main/ets/modules/web/PLVSimpleWeb.d.ets +2 -0
- package/src/main/ets/modules/web/PLVWebController.d.ets +39 -37
- package/src/main/ets/modules/web/PLVWebModel.d.ets +2 -0
- package/src/main/module.json +1 -1
- package/Index.js +0 -30
- package/src/main/ets/common/IPLVBackwardInterface.js +0 -1
- package/src/main/ets/common/PLVBasicDataSource.js +0 -172
- package/src/main/ets/common/PLVCallback.js +0 -186
- package/src/main/ets/common/PLVCommonConstants.js +0 -11
- package/src/main/ets/common/PLVCommonEnums.js +0 -22
- package/src/main/ets/common/PLVDeviceUtils.js +0 -36
- package/src/main/ets/common/PLVHashMap.js +0 -7
- package/src/main/ets/common/PLVJSONUtils.js +0 -103
- package/src/main/ets/common/PLVNetUtils.js +0 -35
- package/src/main/ets/common/PLVPreferencesUtils.js +0 -30
- package/src/main/ets/common/PLVScheduledTask.js +0 -44
- package/src/main/ets/common/PLVSimpleBuffer.js +0 -30
- package/src/main/ets/common/PLVSparseArray.js +0 -44
- package/src/main/ets/common/PLVTextUtils.js +0 -79
- package/src/main/ets/common/PLVTimeUtils.js +0 -14
- package/src/main/ets/common/PLVToastUtils.js +0 -17
- package/src/main/ets/common/PLVType.js +0 -1
- package/src/main/ets/common/PLVUACreator.js +0 -11
- package/src/main/ets/common/PLVUtils.js +0 -241
- package/src/main/ets/common/PLVWebUtils.js +0 -78
- package/src/main/ets/common/ui/PLVNodeController.js +0 -104
- package/src/main/ets/modules/log/PLVLogger.js +0 -67
- package/src/main/ets/modules/log/PLVXLogFilePrinter.js +0 -39
- package/src/main/ets/modules/log/PLVXLogWorker.js +0 -4
- package/src/main/ets/modules/net/PLVApiConstants.js +0 -7
- package/src/main/ets/modules/net/PLVHttpData.js +0 -8
- package/src/main/ets/modules/net/PLVHttpError.js +0 -13
- package/src/main/ets/modules/net/PLVHttpRequest.js +0 -148
- package/src/main/ets/modules/net/PLVRequestSetting.js +0 -33
- package/src/main/ets/modules/socket/PLVSocketIO.js +0 -181
- package/src/main/ets/modules/web/PLVFailureLayout.js +0 -76
- package/src/main/ets/modules/web/PLVLoadingLayout.js +0 -45
- package/src/main/ets/modules/web/PLVNewWindowLayout.js +0 -61
- package/src/main/ets/modules/web/PLVSimpleWeb.js +0 -256
- package/src/main/ets/modules/web/PLVWebController.js +0 -283
- package/src/main/ets/modules/web/PLVWebModel.js +0 -1
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export var PLVWebpageStatus;
|
|
2
|
-
(function (h3) {
|
|
3
|
-
h3["INIT"] = "init";
|
|
4
|
-
h3["ERROR"] = "error";
|
|
5
|
-
h3["FINISHED"] = "finished";
|
|
6
|
-
})(PLVWebpageStatus || (PLVWebpageStatus = {}));
|
|
7
|
-
export var PLVFullScreenStatus;
|
|
8
|
-
(function (g3) {
|
|
9
|
-
g3["IDLE"] = "idle";
|
|
10
|
-
g3["ENTER"] = "enter";
|
|
11
|
-
g3["EXIT"] = "exit";
|
|
12
|
-
})(PLVFullScreenStatus || (PLVFullScreenStatus = {}));
|
|
13
|
-
export var PLVPrintLogLevel;
|
|
14
|
-
(function (f3) {
|
|
15
|
-
f3[f3["ALL"] = 0] = "ALL";
|
|
16
|
-
f3[f3["VERBOSE"] = 2] = "VERBOSE";
|
|
17
|
-
f3[f3["DEBUG"] = 3] = "DEBUG";
|
|
18
|
-
f3[f3["INFO"] = 4] = "INFO";
|
|
19
|
-
f3[f3["WARN"] = 5] = "WARN";
|
|
20
|
-
f3[f3["ERROR"] = 6] = "ERROR";
|
|
21
|
-
f3[f3["NONE"] = 99] = "NONE";
|
|
22
|
-
})(PLVPrintLogLevel || (PLVPrintLogLevel = {}));
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { AppUtil, DisplayUtil } from '@pura/harmony-utils';
|
|
2
|
-
import PLVLogger from '../modules/log/PLVLogger';
|
|
3
|
-
const TAG = '[PLVDeviceUtils]';
|
|
4
|
-
export class PLVDeviceUtils {
|
|
5
|
-
static getNavigationIndicatorHeight() {
|
|
6
|
-
return px2vp(AppUtil.getNavigationIndicatorHeight());
|
|
7
|
-
}
|
|
8
|
-
static getStatusBarHeight() {
|
|
9
|
-
return px2vp(AppUtil.getStatusBarHeight());
|
|
10
|
-
}
|
|
11
|
-
static getWidth() {
|
|
12
|
-
return px2vp(DisplayUtil.getWidth());
|
|
13
|
-
}
|
|
14
|
-
static getHeight() {
|
|
15
|
-
return px2vp(DisplayUtil.getHeight());
|
|
16
|
-
}
|
|
17
|
-
static getMinDisplaySide() {
|
|
18
|
-
return Math.min(PLVDeviceUtils.getWidth(), PLVDeviceUtils.getHeight());
|
|
19
|
-
}
|
|
20
|
-
static setColorMode(m3) {
|
|
21
|
-
AppUtil.getContext().getApplicationContext().setColorMode(m3);
|
|
22
|
-
}
|
|
23
|
-
static setWindowSystemBarProperties(i3) {
|
|
24
|
-
try {
|
|
25
|
-
let k3 = AppUtil.getMainWindow();
|
|
26
|
-
if (i3) {
|
|
27
|
-
k3.setWindowSystemBarProperties(i3).catch((l3) => {
|
|
28
|
-
PLVLogger.error(TAG, `setWindowSystemBarProperties-error ~ code: ${l3.code} -·- message: ${l3.message}`);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
catch (j3) {
|
|
33
|
-
PLVLogger.error(TAG, JSON.stringify(j3));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { instanceToPlain, plainToClass, plainToClassFromExist } from 'class-transformer';
|
|
2
|
-
export default class PLVJSONUtils {
|
|
3
|
-
static safeStringify(p4, q4) {
|
|
4
|
-
try {
|
|
5
|
-
return JSON.stringify(p4 || new Object(), q4);
|
|
6
|
-
}
|
|
7
|
-
catch (r4) {
|
|
8
|
-
return '';
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
static safeParse(n4) {
|
|
12
|
-
try {
|
|
13
|
-
return JSON.parse(n4 || '');
|
|
14
|
-
}
|
|
15
|
-
catch (o4) {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
static json2Bean(k4, l4) {
|
|
20
|
-
try {
|
|
21
|
-
return plainToClass(k4, JSON.parse(l4), {
|
|
22
|
-
enableImplicitConversion: false, exposeDefaultValues: true
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
catch (m4) {
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
static bean2Json(i4) {
|
|
30
|
-
try {
|
|
31
|
-
if (i4 == null || i4 == undefined) {
|
|
32
|
-
return '';
|
|
33
|
-
}
|
|
34
|
-
return JSON.stringify(instanceToPlain(i4));
|
|
35
|
-
}
|
|
36
|
-
catch (j4) {
|
|
37
|
-
return "";
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
static bean2Bean(f4, g4) {
|
|
41
|
-
try {
|
|
42
|
-
return plainToClassFromExist(f4, g4, {
|
|
43
|
-
enableImplicitConversion: false, exposeDefaultValues: true
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
catch (h4) {
|
|
47
|
-
return undefined;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
static httpData2Bean(b4, c4) {
|
|
51
|
-
try {
|
|
52
|
-
c4.data = plainToClassFromExist(b4, c4.data, {
|
|
53
|
-
enableImplicitConversion: false, exposeDefaultValues: true
|
|
54
|
-
});
|
|
55
|
-
try {
|
|
56
|
-
c4.data.fill();
|
|
57
|
-
}
|
|
58
|
-
catch (e4) {
|
|
59
|
-
}
|
|
60
|
-
return c4.data;
|
|
61
|
-
}
|
|
62
|
-
catch (d4) {
|
|
63
|
-
return undefined;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
static json2Map(a4) {
|
|
67
|
-
return new Map(Object.entries(JSON.parse(a4)));
|
|
68
|
-
}
|
|
69
|
-
static object2Map(z3) {
|
|
70
|
-
return new Map(Object.entries(z3));
|
|
71
|
-
}
|
|
72
|
-
static map2json(v3) {
|
|
73
|
-
const w3 = {};
|
|
74
|
-
v3.forEach((x3, y3) => {
|
|
75
|
-
if (y3 && x3) {
|
|
76
|
-
w3[y3] = x3;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
return w3;
|
|
80
|
-
}
|
|
81
|
-
static map2jsonStr(t3, u3) {
|
|
82
|
-
return PLVJSONUtils.safeStringify(PLVJSONUtils.map2json(t3), u3);
|
|
83
|
-
}
|
|
84
|
-
static toUnescapedData(s3) {
|
|
85
|
-
if (!s3.includes('\\')) {
|
|
86
|
-
return s3;
|
|
87
|
-
}
|
|
88
|
-
return s3.substring(1, s3.length - 1)
|
|
89
|
-
.replace(/\\"/g, '"')
|
|
90
|
-
.replace(/\\\\/g, '\\');
|
|
91
|
-
}
|
|
92
|
-
static toFillData(p3, q3) {
|
|
93
|
-
let r3 = undefined;
|
|
94
|
-
if (typeof q3 === 'string') {
|
|
95
|
-
r3 = PLVJSONUtils.json2Bean(p3, q3);
|
|
96
|
-
}
|
|
97
|
-
else if (typeof q3 === 'object') {
|
|
98
|
-
r3 = PLVJSONUtils.bean2Bean(p3, q3);
|
|
99
|
-
}
|
|
100
|
-
r3?.fill();
|
|
101
|
-
return r3;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export class PLVNetUtils {
|
|
2
|
-
static replaceUrl(d5, e5) {
|
|
3
|
-
const f5 = /{(\w+?)}/g;
|
|
4
|
-
let g5;
|
|
5
|
-
let h5 = d5;
|
|
6
|
-
while ((g5 = f5.exec(d5)) !== null) {
|
|
7
|
-
const i5 = g5[1];
|
|
8
|
-
const j5 = e5.get(i5);
|
|
9
|
-
if (j5 !== undefined) {
|
|
10
|
-
h5 = h5.replace(g5[0], j5);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return h5;
|
|
14
|
-
}
|
|
15
|
-
static formatUrl(b5, c5) {
|
|
16
|
-
return PLVNetUtils.replaceUrl(b5, new Map(Object.entries(c5)));
|
|
17
|
-
}
|
|
18
|
-
static formatParams(v4, w4) {
|
|
19
|
-
let x4 = '';
|
|
20
|
-
if (v4) {
|
|
21
|
-
let y4 = true;
|
|
22
|
-
Object.entries(v4).forEach((z4, a5) => {
|
|
23
|
-
if (z4?.[0] && z4?.[1]) {
|
|
24
|
-
x4 += (y4 && !w4 ? '?' : '&') + z4?.[0] + '=' + z4?.[1];
|
|
25
|
-
y4 = false;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
return x4;
|
|
30
|
-
}
|
|
31
|
-
static appendParams(s4, t4) {
|
|
32
|
-
const u4 = s4.includes('?');
|
|
33
|
-
return s4 + PLVNetUtils.formatParams(t4, u4);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { PreferencesUtil } from '@pura/harmony-utils';
|
|
2
|
-
const defaultPreferenceName = "PLV_SP_HARMONY_UTILS_PREFERENCES";
|
|
3
|
-
export class PLVPreferencesUtils {
|
|
4
|
-
constructor() {
|
|
5
|
-
}
|
|
6
|
-
static async put(z5, a6, b6 = defaultPreferenceName) {
|
|
7
|
-
await PreferencesUtil.put(z5, a6, b6);
|
|
8
|
-
}
|
|
9
|
-
static async get(w5, x5, y5 = defaultPreferenceName) {
|
|
10
|
-
return PreferencesUtil.get(w5, x5, y5);
|
|
11
|
-
}
|
|
12
|
-
static async getString(u5, v5 = defaultPreferenceName) {
|
|
13
|
-
return (await PreferencesUtil.get(u5, "", v5));
|
|
14
|
-
}
|
|
15
|
-
static async getNumber(r5, s5 = defaultPreferenceName, t5 = 0) {
|
|
16
|
-
return (await PreferencesUtil.get(r5, t5, s5));
|
|
17
|
-
}
|
|
18
|
-
static async getBoolean(p5, q5 = defaultPreferenceName) {
|
|
19
|
-
return (await PreferencesUtil.get(p5, false, q5));
|
|
20
|
-
}
|
|
21
|
-
static async has(n5, o5 = defaultPreferenceName) {
|
|
22
|
-
return PreferencesUtil.has(n5, o5);
|
|
23
|
-
}
|
|
24
|
-
static async delete(l5, m5 = defaultPreferenceName) {
|
|
25
|
-
return PreferencesUtil.delete(l5, m5);
|
|
26
|
-
}
|
|
27
|
-
static async clear(k5 = defaultPreferenceName) {
|
|
28
|
-
return PreferencesUtil.clear(k5);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import PLVLogger from '../modules/log/PLVLogger';
|
|
2
|
-
const TAG = '[PLVScheduledTask]';
|
|
3
|
-
export class PLVScheduledTask {
|
|
4
|
-
constructor(f6, g6, h6 = g6) {
|
|
5
|
-
this.callback = f6;
|
|
6
|
-
this.delay = g6;
|
|
7
|
-
this.period = h6;
|
|
8
|
-
this.timerId = undefined;
|
|
9
|
-
this.nextExecutionTime = 0;
|
|
10
|
-
this.isRunning = false;
|
|
11
|
-
}
|
|
12
|
-
start() {
|
|
13
|
-
if (this.isRunning) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
this.isRunning = true;
|
|
17
|
-
this.nextExecutionTime = Date.now() + this.delay;
|
|
18
|
-
this.scheduleNextExecution();
|
|
19
|
-
}
|
|
20
|
-
async scheduleNextExecution() {
|
|
21
|
-
if (!this.isRunning) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const c6 = Date.now();
|
|
25
|
-
const d6 = Math.max(0, this.nextExecutionTime - c6);
|
|
26
|
-
this.timerId = setTimeout(async () => {
|
|
27
|
-
try {
|
|
28
|
-
await this.callback();
|
|
29
|
-
}
|
|
30
|
-
catch (e6) {
|
|
31
|
-
PLVLogger.printError(TAG, 'scheduleNextExecution error', e6);
|
|
32
|
-
}
|
|
33
|
-
this.nextExecutionTime = Date.now() + this.period;
|
|
34
|
-
this.scheduleNextExecution();
|
|
35
|
-
}, d6);
|
|
36
|
-
}
|
|
37
|
-
cancel() {
|
|
38
|
-
if (!this.isRunning) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
clearTimeout(this.timerId);
|
|
42
|
-
this.isRunning = false;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const SOCKET_EVENT_BUFFER_TIMESPAN = 500;
|
|
2
|
-
export class PLVSimpleBuffer {
|
|
3
|
-
constructor(k6 = SOCKET_EVENT_BUFFER_TIMESPAN) {
|
|
4
|
-
this.buffer = [];
|
|
5
|
-
this.timespan = SOCKET_EVENT_BUFFER_TIMESPAN;
|
|
6
|
-
this.isRelease = false;
|
|
7
|
-
this.timespan = k6;
|
|
8
|
-
}
|
|
9
|
-
observe(j6) {
|
|
10
|
-
if (this.intervalId == undefined) {
|
|
11
|
-
this.intervalId = setInterval(() => {
|
|
12
|
-
if (this.buffer.length > 0) {
|
|
13
|
-
j6?.(this.buffer);
|
|
14
|
-
this.buffer.length = 0;
|
|
15
|
-
}
|
|
16
|
-
}, this.timespan);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
release() {
|
|
20
|
-
this.isRelease = true;
|
|
21
|
-
clearInterval(this.intervalId);
|
|
22
|
-
this.buffer.length = 0;
|
|
23
|
-
}
|
|
24
|
-
push(i6) {
|
|
25
|
-
if (this.isRelease) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
this.buffer.push(i6);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export class PLVSparseArray {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.entries = [];
|
|
4
|
-
}
|
|
5
|
-
set(y6, z6) {
|
|
6
|
-
const a7 = this.entries.findIndex((b7) => b7[0] >= y6);
|
|
7
|
-
if (a7 >= 0 && this.entries[a7][0] === y6) {
|
|
8
|
-
this.entries[a7][1] = z6;
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
this.entries.splice(a7 >= 0 ? a7 : this.entries.length, 0, [y6, z6]);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
get(v6) {
|
|
15
|
-
const w6 = this.entries.find((x6) => x6[0] === v6);
|
|
16
|
-
return w6 ? w6[1] : undefined;
|
|
17
|
-
}
|
|
18
|
-
delete(t6) {
|
|
19
|
-
this.entries = this.entries.filter((u6) => u6[0] !== t6);
|
|
20
|
-
}
|
|
21
|
-
size() {
|
|
22
|
-
return this.entries.length;
|
|
23
|
-
}
|
|
24
|
-
forEach(r6) {
|
|
25
|
-
for (const s6 of this.entries) {
|
|
26
|
-
r6(s6[0], s6[1]);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
forEachReverse(o6) {
|
|
30
|
-
for (let p6 = this.entries.length - 1; p6 >= 0; p6--) {
|
|
31
|
-
const q6 = this.entries[p6];
|
|
32
|
-
o6(q6[0], q6[1]);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
someReverse(l6) {
|
|
36
|
-
for (let m6 = this.entries.length - 1; m6 >= 0; m6--) {
|
|
37
|
-
const n6 = this.entries[m6];
|
|
38
|
-
if (l6(n6[0], n6[1])) {
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
export class PLVTextUtils {
|
|
2
|
-
static checkValidDataLength(...r7) {
|
|
3
|
-
for (const s7 of r7) {
|
|
4
|
-
if (s7.length == 0) {
|
|
5
|
-
return false;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
static parseString(j7) {
|
|
11
|
-
if (!(j7 = PLVTextUtils.convertSpecialString(j7))) {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
const k7 = /\[([^\[\]]{1,5})\]/g;
|
|
15
|
-
let l7;
|
|
16
|
-
let m7 = 0;
|
|
17
|
-
const n7 = [];
|
|
18
|
-
while ((l7 = k7.exec(j7)) !== null) {
|
|
19
|
-
const p7 = l7[0];
|
|
20
|
-
if (l7.index > m7) {
|
|
21
|
-
const q7 = j7.slice(m7, l7.index);
|
|
22
|
-
n7.push(q7);
|
|
23
|
-
}
|
|
24
|
-
n7.push(p7);
|
|
25
|
-
m7 = k7.lastIndex;
|
|
26
|
-
}
|
|
27
|
-
if (m7 < j7.length) {
|
|
28
|
-
const o7 = j7.slice(m7);
|
|
29
|
-
n7.push(o7);
|
|
30
|
-
}
|
|
31
|
-
return n7;
|
|
32
|
-
}
|
|
33
|
-
static convertSpecialString(i7) {
|
|
34
|
-
return i7?.replace(/</g, "<")
|
|
35
|
-
.replace(/</g, "<")
|
|
36
|
-
.replace(/>/g, ">")
|
|
37
|
-
.replace(/>/g, ">")
|
|
38
|
-
.replace(/¥/g, "¥")
|
|
39
|
-
.replace(/¥/g, "¥")
|
|
40
|
-
.replace(/"/g, "\"")
|
|
41
|
-
.replace(/ /g, " ")
|
|
42
|
-
.replace(/'/g, "'")
|
|
43
|
-
.replace(/&/g, "&");
|
|
44
|
-
}
|
|
45
|
-
static toString(h7) {
|
|
46
|
-
return (h7 || h7 == 0) ? h7 + '' : undefined;
|
|
47
|
-
}
|
|
48
|
-
static toWString(g7) {
|
|
49
|
-
if (g7 && g7 > 10000) {
|
|
50
|
-
return (g7 / 10000).toFixed(1) + 'w';
|
|
51
|
-
}
|
|
52
|
-
return PLVTextUtils.toString(g7);
|
|
53
|
-
}
|
|
54
|
-
static toKString(f7) {
|
|
55
|
-
if (f7 && f7 > 1000) {
|
|
56
|
-
return (f7 / 1000).toFixed(1) + 'k';
|
|
57
|
-
}
|
|
58
|
-
return PLVTextUtils.toString(f7);
|
|
59
|
-
}
|
|
60
|
-
static fixPic(e7) {
|
|
61
|
-
if (!e7) {
|
|
62
|
-
return e7 || '';
|
|
63
|
-
}
|
|
64
|
-
if (e7.startsWith('//')) {
|
|
65
|
-
return `http:${e7}`;
|
|
66
|
-
}
|
|
67
|
-
else if (e7.startsWith('/')) {
|
|
68
|
-
return `http://livestatic.videocc.net${e7}`;
|
|
69
|
-
}
|
|
70
|
-
return e7;
|
|
71
|
-
}
|
|
72
|
-
static isNumberZero(c7) {
|
|
73
|
-
if (!c7) {
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
const d7 = parseFloat(c7);
|
|
77
|
-
return d7 === 0;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export class PLVTimeUtils {
|
|
2
|
-
static generateTime(t7, u7) {
|
|
3
|
-
const v7 = Math.floor(t7 / 1000);
|
|
4
|
-
const w7 = v7 % 60;
|
|
5
|
-
const x7 = Math.floor((v7 / 60) % 60);
|
|
6
|
-
const y7 = Math.floor(v7 / 3600);
|
|
7
|
-
if (u7 || y7 > 0) {
|
|
8
|
-
return `${y7.toString().padStart(2, '0')}:${x7.toString().padStart(2, '0')}:${w7.toString().padStart(2, '0')}`;
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
return `${x7.toString().padStart(2, '0')}:${w7.toString().padStart(2, '0')}`;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import promptAction from "@ohos.promptAction";
|
|
2
|
-
import PLVCommonConstants from './PLVCommonConstants';
|
|
3
|
-
export class PLVToastUtils {
|
|
4
|
-
shortShow(c8) {
|
|
5
|
-
this.show(c8, PLVCommonConstants.LENGTH_SHORT);
|
|
6
|
-
}
|
|
7
|
-
longShow(b8) {
|
|
8
|
-
this.show(b8, PLVCommonConstants.LENGTH_LONG);
|
|
9
|
-
}
|
|
10
|
-
show(z7, a8) {
|
|
11
|
-
promptAction.showToast({
|
|
12
|
-
message: z7,
|
|
13
|
-
duration: a8
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export default new PLVToastUtils();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import deviceInfo from '@ohos.deviceInfo';
|
|
2
|
-
export class PLVUACreator {
|
|
3
|
-
static createUA(d8, e8) {
|
|
4
|
-
let f8 = d8;
|
|
5
|
-
if (e8) {
|
|
6
|
-
f8 += `(${e8})`;
|
|
7
|
-
}
|
|
8
|
-
f8 += ` ohos/${deviceInfo.osFullName} (HarmonyOS ${deviceInfo.osFullName}; ${deviceInfo.brand} ${deviceInfo.productModel};)`;
|
|
9
|
-
return f8;
|
|
10
|
-
}
|
|
11
|
-
}
|