clickgo 3.1.2-dev11 → 3.1.4-dev13
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 +1 -1
- package/dist/app/demo/app.js +0 -73
- package/dist/app/demo/config.json +113 -0
- package/dist/app/demo/form/control/button/button.js +12 -11
- package/dist/app/demo/form/control/button/button.xml +6 -6
- package/dist/app/demo/form/control/check/check.js +14 -10
- package/dist/app/demo/form/control/file/file.js +15 -13
- package/dist/app/demo/form/control/{overflow/overflow.css → flow/flow.css} +0 -0
- package/dist/app/demo/form/control/flow/flow.js +64 -0
- package/dist/app/demo/form/control/{overflow/overflow.scss → flow/flow.scss} +0 -0
- package/dist/app/demo/form/control/flow/flow.xml +101 -0
- package/dist/app/demo/form/control/form/form.js +1 -1
- package/dist/app/demo/form/control/form/form.xml +3 -3
- package/dist/app/demo/form/control/img/img.xml +2 -2
- package/dist/app/demo/form/control/list/list.js +95 -75
- package/dist/app/demo/form/control/list/list.xml +15 -11
- package/dist/app/demo/form/control/marquee/marquee.js +12 -10
- package/dist/app/demo/form/control/menu/menu.js +10 -6
- package/dist/app/demo/form/control/monaco/monaco.js +50 -60
- package/dist/app/demo/form/control/monaco/monaco.xml +6 -5
- package/dist/app/demo/form/control/property/property.js +131 -127
- package/dist/app/demo/form/control/radio/radio.js +9 -5
- package/dist/app/demo/form/control/scroll/scroll.js +16 -12
- package/dist/app/demo/form/control/scroll/scroll.xml +10 -10
- package/dist/app/demo/form/control/select/select.js +132 -71
- package/dist/app/demo/form/control/select/select.xml +69 -67
- package/dist/app/demo/form/control/tab/tab.js +21 -20
- package/dist/app/demo/form/control/tab/tab.xml +2 -2
- package/dist/app/demo/form/control/text/text.js +53 -45
- package/dist/app/demo/form/control/text/text.xml +3 -3
- package/dist/app/demo/form/control/{greatview/greatview.css → vflow/vflow.css} +0 -0
- package/dist/app/demo/form/control/vflow/vflow.js +79 -0
- package/dist/app/demo/form/control/{greatview/greatview.scss → vflow/vflow.scss} +0 -0
- package/dist/app/demo/form/control/{greatview/greatview.xml → vflow/vflow.xml} +25 -25
- package/dist/app/demo/form/event/form/form.js +58 -56
- package/dist/app/demo/form/event/form/form.xml +3 -3
- package/dist/app/demo/form/event/other/other.js +29 -0
- package/dist/app/demo/form/event/other/other.xml +5 -0
- package/dist/app/demo/form/event/screen/screen.js +30 -28
- package/dist/app/demo/form/event/screen/screen.xml +2 -2
- package/dist/app/demo/form/event/task/task.js +31 -31
- package/dist/app/demo/form/event/task/task.xml +3 -3
- package/dist/app/demo/form/main.js +166 -5
- package/dist/app/demo/form/main.xml +37 -35
- package/dist/app/demo/form/method/aform/aform.js +2 -1
- package/dist/app/demo/form/method/aform/aform.xml +3 -2
- package/dist/app/demo/form/method/aform/sd.js +28 -0
- package/dist/app/demo/form/method/aform/sd.xml +7 -0
- package/dist/app/demo/form/method/aform/test.xml +4 -5
- package/dist/app/demo/form/method/core/core.js +23 -8
- package/dist/app/demo/form/method/core/core.xml +6 -1
- package/dist/app/demo/form/method/dom/dom.js +91 -99
- package/dist/app/demo/form/method/dom/dom.xml +6 -7
- package/dist/app/demo/form/method/form/form.js +8 -8
- package/dist/app/demo/form/method/form/form.xml +4 -4
- package/dist/app/demo/form/method/fs/fs.js +34 -33
- package/dist/app/demo/form/method/fs/fs.xml +1 -1
- package/dist/app/demo/form/method/fs/text.js +12 -12
- package/dist/app/demo/form/method/native/native.js +50 -0
- package/dist/app/demo/form/method/native/native.xml +12 -0
- package/dist/app/demo/form/method/system/system.js +50 -0
- package/dist/app/demo/form/method/system/system.xml +11 -0
- package/dist/app/demo/form/method/task/task.js +68 -62
- package/dist/app/demo/form/method/task/task.xml +5 -6
- package/dist/app/demo/form/method/theme/theme.js +14 -14
- package/dist/app/demo/form/method/tool/tool.js +29 -28
- package/dist/app/demo/form/method/tool/tool.xml +3 -3
- package/dist/app/demo/form/method/zip/zip.js +46 -41
- package/dist/app/demo/form/method/zip/zip.xml +1 -1
- package/dist/app/task/app.js +0 -25
- package/dist/app/task/config.json +29 -0
- package/dist/app/task/form/bar/bar.js +1 -1
- package/dist/app/task/form/bar/bar.xml +1 -1
- package/dist/clickgo.js +1 -1
- package/dist/clickgo.ts +1 -1
- package/dist/control/common.cgc +0 -0
- package/dist/control/form.cgc +0 -0
- package/dist/control/monaco.cgc +0 -0
- package/dist/control/property.cgc +0 -0
- package/dist/control/task.cgc +0 -0
- package/dist/global.css +1 -1
- package/dist/index.js +6 -3
- package/dist/index.ts +9 -3
- package/dist/lib/control.js +70 -104
- package/dist/lib/control.ts +97 -123
- package/dist/lib/core.js +163 -253
- package/dist/lib/core.ts +185 -268
- package/dist/lib/dom.js +565 -484
- package/dist/lib/dom.ts +704 -547
- package/dist/lib/form.js +211 -159
- package/dist/lib/form.ts +196 -121
- package/dist/lib/fs.js +107 -12
- package/dist/lib/fs.ts +111 -20
- package/dist/lib/native.js +142 -8
- package/dist/lib/native.ts +181 -11
- package/dist/lib/task.js +526 -164
- package/dist/lib/task.ts +598 -179
- package/dist/lib/tool.js +48 -1
- package/dist/lib/tool.ts +61 -0
- package/dist/lib/zip.ts +2 -0
- package/dist/theme/familiar.cgt +0 -0
- package/package.json +2 -2
- package/types/index.d.ts +83 -39
- package/dist/app/demo/form/control/greatview/greatview.js +0 -92
- package/dist/app/demo/form/control/overflow/overflow.js +0 -70
- package/dist/app/demo/form/control/overflow/overflow.xml +0 -98
- package/dist/app/demo/form/control/view/view.css +0 -1
- package/dist/app/demo/form/control/view/view.js +0 -73
- package/dist/app/demo/form/control/view/view.scss +0 -18
- package/dist/app/demo/form/control/view/view.xml +0 -94
|
@@ -9,15 +9,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.mounted = exports.methods = exports.data = void 0;
|
|
13
12
|
const clickgo = require("clickgo");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const text_1 = require("./text");
|
|
14
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.ppath = '/';
|
|
18
|
+
this.list = [];
|
|
19
|
+
this.val = [];
|
|
20
|
+
}
|
|
21
|
+
open(path) {
|
|
21
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
23
|
if (!path.endsWith('/')) {
|
|
23
24
|
path += '/';
|
|
@@ -30,21 +31,21 @@ exports.methods = {
|
|
|
30
31
|
'value': path + item.name
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
|
-
this.
|
|
34
|
+
this.ppath = path;
|
|
34
35
|
});
|
|
35
|
-
}
|
|
36
|
-
dblclick
|
|
36
|
+
}
|
|
37
|
+
dblclick() {
|
|
37
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
const r = yield clickgo.fs.isFile(this.val);
|
|
39
|
+
const r = yield clickgo.fs.isFile(this.val[0]);
|
|
39
40
|
if (r) {
|
|
40
|
-
const extlio = this.val.lastIndexOf('.');
|
|
41
|
+
const extlio = this.val[0].lastIndexOf('.');
|
|
41
42
|
if (extlio === -1) {
|
|
42
43
|
yield clickgo.form.dialog('This extension is not supported.');
|
|
43
44
|
return;
|
|
44
45
|
}
|
|
45
|
-
const ext = this.val.toLowerCase().slice(extlio + 1);
|
|
46
|
+
const ext = this.val[0].toLowerCase().slice(extlio + 1);
|
|
46
47
|
if (['xml', 'js', 'ts', 'json', 'css', 'html', 'php'].includes(ext)) {
|
|
47
|
-
let content = yield clickgo.fs.getContent(this.val);
|
|
48
|
+
let content = yield clickgo.fs.getContent(this.val[0]);
|
|
48
49
|
if (!content) {
|
|
49
50
|
yield clickgo.form.dialog('This file cannot be opened.');
|
|
50
51
|
return;
|
|
@@ -52,37 +53,37 @@ exports.methods = {
|
|
|
52
53
|
if (content instanceof Blob) {
|
|
53
54
|
content = yield clickgo.tool.blob2Text(content);
|
|
54
55
|
}
|
|
55
|
-
const f = yield
|
|
56
|
+
const f = yield text_1.default.create({
|
|
57
|
+
'title': this.val[0].slice(this.val[0].lastIndexOf('/') + 1),
|
|
58
|
+
'content': content
|
|
59
|
+
});
|
|
56
60
|
if (typeof f === 'number') {
|
|
57
61
|
return;
|
|
58
62
|
}
|
|
59
|
-
|
|
60
|
-
'title': this.val.slice(this.val.lastIndexOf('/') + 1),
|
|
61
|
-
'content': content
|
|
62
|
-
});
|
|
63
|
+
f.show();
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
65
|
-
yield clickgo.form.dialog('
|
|
66
|
+
yield clickgo.form.dialog('The extension "' + ext + '" is not supported.');
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
68
|
-
yield this.open(this.val);
|
|
69
|
+
yield this.open(this.val[0]);
|
|
69
70
|
});
|
|
70
|
-
}
|
|
71
|
-
up
|
|
71
|
+
}
|
|
72
|
+
up() {
|
|
72
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
-
if (this.
|
|
74
|
+
if (this.ppath === '/') {
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
const path = this.
|
|
77
|
+
const path = this.ppath.slice(0, -1);
|
|
77
78
|
const lif = path.lastIndexOf('/');
|
|
78
79
|
const npath = path.slice(0, lif + 1);
|
|
79
80
|
yield this.open(npath);
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
exports.
|
|
83
|
+
onMounted() {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
yield this.open('/');
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.default = default_1;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<form width="350" height="400" title="Library fs" padding="10">
|
|
2
2
|
<layout gutter="10" direction="v" style="flex: 1;">
|
|
3
3
|
<label>Double click the item below:</label>
|
|
4
|
-
<block style="background: #000; color: #FFF; padding: 5px;">{{
|
|
4
|
+
<block style="background: #000; color: #FFF; padding: 5px;">{{ppath}}</block>
|
|
5
5
|
<list v-model="val" :data="list" @dblclick="dblclick" style="flex: 1; height: 0;"></list>
|
|
6
6
|
<button style="height: 30px;" @click="up">Up</button>
|
|
7
7
|
</layout>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (obj.taskId !== this.taskId) {
|
|
10
|
-
return;
|
|
3
|
+
const clickgo = require("clickgo");
|
|
4
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.title = 'Text viewer';
|
|
8
|
+
this.content = '';
|
|
11
9
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
onMounted(obj) {
|
|
11
|
+
this.title = obj.title + ' - Text viewer';
|
|
12
|
+
this.content = obj.content;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.default = default_1;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const clickgo = require("clickgo");
|
|
13
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.val = 'test';
|
|
17
|
+
}
|
|
18
|
+
getListenerList() {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
yield clickgo.form.dialog(JSON.stringify(clickgo.native.getListenerList()));
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
max() {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
yield clickgo.native.max();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
min() {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
yield clickgo.native.min();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
restore() {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
yield clickgo.native.restore();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
ping() {
|
|
39
|
+
var _a;
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
yield clickgo.form.dialog((_a = yield clickgo.native.ping(this.val)) !== null && _a !== void 0 ? _a : 'undefined');
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
isMax() {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
yield clickgo.form.dialog((yield clickgo.native.isMax()) ? 'true' : 'false');
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.default = default_1;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<form width="350" height="400" title="Library native" padding="10">
|
|
2
|
+
<layout gutter="10" direction="v" style="flex: 1;">
|
|
3
|
+
<button @click="getListenerList" style="height: 30px;">getListenerList</button>
|
|
4
|
+
<button @click="max" style="height: 30px;">max</button>
|
|
5
|
+
<button @click="min" style="height: 30px;">min</button>
|
|
6
|
+
<layout gutter="10" align-v="center">
|
|
7
|
+
<text style="flex: 1;" v-model="val"></text>
|
|
8
|
+
<button @click="ping" style="height: 30px; padding: 0 10px;">ping("{{val}}")</button>
|
|
9
|
+
</layout>
|
|
10
|
+
<button @click="isMax" style="height: 30px;">isMax</button>
|
|
11
|
+
</layout>
|
|
12
|
+
</form>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const clickgo = require("clickgo");
|
|
13
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
14
|
+
getVersion() {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
yield clickgo.form.dialog('Version: ' + clickgo.getVersion());
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
isNative() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
yield clickgo.form.dialog('Native: ' + (clickgo.isNative() ? 'true' : 'false'));
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
getPlatform() {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
yield clickgo.form.dialog('Platform: ' + clickgo.getPlatform());
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
isImmersion() {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
yield clickgo.form.dialog('Immersion: ' + (clickgo.isImmersion() ? 'true' : 'false'));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
hasFrame() {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
yield clickgo.form.dialog('hasFrame: ' + (clickgo.hasFrame() ? 'true' : 'false'));
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
unblock() {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
yield clickgo.form.dialog('typeof sessionStorage: ' + typeof sessionStorage);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
ls() {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
yield clickgo.form.dialog('typeof localStorage: ' + typeof localStorage);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.default = default_1;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<form width="350" height="400" title="System">
|
|
2
|
+
<layout direction="v" gutter="10" style="flex: 1; padding: 10px;">
|
|
3
|
+
<button @click="getVersion" style="height: 30px;">clickgo.getVersion()</button>
|
|
4
|
+
<button @click="isNative" style="height: 30px;">clickgo.isNative()</button>
|
|
5
|
+
<button @click="getPlatform" style="height: 30px;">clickgo.getPlatform()</button>
|
|
6
|
+
<button @click="isImmersion" style="height: 30px;">clickgo.isImmersion()</button>
|
|
7
|
+
<button @click="hasFrame" style="height: 30px;">clickgo.hasFrame()</button>
|
|
8
|
+
<button @click="unblock" style="height: 30px;">unblock: ['sessionStorage']</button>
|
|
9
|
+
<button @click="ls" style="height: 30px;">typeof localStorage</button>
|
|
10
|
+
</layout>
|
|
11
|
+
</form>
|
|
@@ -9,24 +9,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.mounted = exports.methods = exports.computed = exports.data = void 0;
|
|
13
12
|
const clickgo = require("clickgo");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.tid = '0';
|
|
17
|
+
this.frameTimer = 0;
|
|
18
|
+
this.frameCount = 0;
|
|
19
|
+
this.timer = 0;
|
|
20
|
+
this.timerCount = 0;
|
|
21
|
+
this.select = [];
|
|
22
|
+
this.sleeping = false;
|
|
23
|
+
}
|
|
24
|
+
get globalLocale() {
|
|
25
25
|
return clickgo.core.config.locale;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
exports.methods = {
|
|
29
|
-
frameStart: function (v) {
|
|
27
|
+
frameStart(v) {
|
|
30
28
|
let opt = {};
|
|
31
29
|
switch (v) {
|
|
32
30
|
case 0: {
|
|
@@ -41,9 +39,9 @@ exports.methods = {
|
|
|
41
39
|
};
|
|
42
40
|
break;
|
|
43
41
|
}
|
|
44
|
-
case
|
|
42
|
+
case 2: {
|
|
45
43
|
opt = {
|
|
46
|
-
'
|
|
44
|
+
'formId': this.formId
|
|
47
45
|
};
|
|
48
46
|
break;
|
|
49
47
|
}
|
|
@@ -51,13 +49,13 @@ exports.methods = {
|
|
|
51
49
|
this.frameTimer = clickgo.task.onFrame(() => {
|
|
52
50
|
++this.frameCount;
|
|
53
51
|
}, opt);
|
|
54
|
-
}
|
|
55
|
-
frameEnd
|
|
52
|
+
}
|
|
53
|
+
frameEnd() {
|
|
56
54
|
clickgo.task.offFrame(this.frameTimer);
|
|
57
55
|
this.frameCount = 0;
|
|
58
56
|
this.frameTimer = 0;
|
|
59
|
-
}
|
|
60
|
-
timerStart
|
|
57
|
+
}
|
|
58
|
+
timerStart(v) {
|
|
61
59
|
let opt = {};
|
|
62
60
|
switch (v) {
|
|
63
61
|
case 0: {
|
|
@@ -74,7 +72,7 @@ exports.methods = {
|
|
|
74
72
|
}
|
|
75
73
|
case 3: {
|
|
76
74
|
opt = {
|
|
77
|
-
'
|
|
75
|
+
'formId': this.formId
|
|
78
76
|
};
|
|
79
77
|
break;
|
|
80
78
|
}
|
|
@@ -82,58 +80,66 @@ exports.methods = {
|
|
|
82
80
|
this.timer = clickgo.task.createTimer(() => {
|
|
83
81
|
++this.timerCount;
|
|
84
82
|
}, 1, opt);
|
|
85
|
-
}
|
|
86
|
-
timerEnd
|
|
83
|
+
}
|
|
84
|
+
timerEnd() {
|
|
87
85
|
clickgo.task.removeTimer(this.timer);
|
|
88
86
|
this.timerCount = 0;
|
|
89
87
|
this.timer = 0;
|
|
90
|
-
}
|
|
91
|
-
get
|
|
92
|
-
const r = clickgo.task.get(this.tid);
|
|
88
|
+
}
|
|
89
|
+
get() {
|
|
90
|
+
const r = clickgo.task.get(parseInt(this.tid));
|
|
93
91
|
clickgo.form.dialog(r ? JSON.stringify(r) : 'null').catch((e) => { throw e; });
|
|
94
|
-
}
|
|
95
|
-
getList
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
92
|
+
}
|
|
93
|
+
getList() {
|
|
94
|
+
let msg = JSON.stringify(clickgo.task.getList());
|
|
95
|
+
msg = msg.replace(/(data:image\/).+?"/g, '$1..."');
|
|
96
|
+
clickgo.form.dialog(msg).catch((e) => { throw e; });
|
|
97
|
+
}
|
|
98
|
+
run() {
|
|
99
99
|
return __awaiter(this, void 0, void 0, function* () {
|
|
100
100
|
const tid = yield clickgo.task.run('/clickgo/app/demo/');
|
|
101
101
|
yield clickgo.form.dialog('Task ID: ' + tid.toString());
|
|
102
102
|
});
|
|
103
|
-
}
|
|
104
|
-
|
|
103
|
+
}
|
|
104
|
+
checkPermission() {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
const rtn = yield clickgo.task.checkPermission('hash', true);
|
|
107
|
+
yield clickgo.form.dialog(rtn[0] ? 'Succeed' : 'Failed');
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
end() {
|
|
105
111
|
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
-
yield clickgo.form.dialog('Result: ' + (clickgo.task.end(this.tid) ? 'true' : 'false'));
|
|
112
|
+
yield clickgo.form.dialog('Result: ' + (clickgo.task.end(parseInt(this.tid)) ? 'true' : 'false'));
|
|
107
113
|
});
|
|
108
|
-
}
|
|
109
|
-
loadLocale
|
|
114
|
+
}
|
|
115
|
+
loadLocale(lang, path) {
|
|
110
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
-
const r = yield clickgo.task.loadLocale(lang, path);
|
|
117
|
+
const r = yield clickgo.task.loadLocale(lang, '/package' + clickgo.tool.urlResolve(this.filename, path));
|
|
112
118
|
yield clickgo.form.dialog('Result: ' + (r ? 'true' : 'false'));
|
|
113
119
|
});
|
|
114
|
-
}
|
|
115
|
-
setLocale
|
|
120
|
+
}
|
|
121
|
+
setLocale(lang, path) {
|
|
116
122
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
-
const r = yield clickgo.task.setLocale(lang, path);
|
|
123
|
+
const r = yield clickgo.task.setLocale(lang, '/package' + clickgo.tool.urlResolve(this.filename, path));
|
|
118
124
|
yield clickgo.form.dialog('Result: ' + (r ? 'true' : 'false'));
|
|
119
125
|
});
|
|
120
|
-
}
|
|
121
|
-
clearLocale
|
|
126
|
+
}
|
|
127
|
+
clearLocale() {
|
|
122
128
|
clickgo.task.clearLocale();
|
|
123
|
-
}
|
|
124
|
-
loadLocaleData
|
|
129
|
+
}
|
|
130
|
+
loadLocaleData(lang, data) {
|
|
125
131
|
clickgo.task.loadLocaleData(lang, data);
|
|
126
|
-
}
|
|
127
|
-
setLocaleLang
|
|
132
|
+
}
|
|
133
|
+
setLocaleLang(lang) {
|
|
128
134
|
clickgo.task.setLocaleLang(lang);
|
|
129
|
-
}
|
|
130
|
-
clearLocaleLang
|
|
135
|
+
}
|
|
136
|
+
clearLocaleLang() {
|
|
131
137
|
clickgo.task.clearLocaleLang();
|
|
132
|
-
}
|
|
133
|
-
changeLocaleLang
|
|
134
|
-
clickgo.core.config.locale = this.select;
|
|
135
|
-
}
|
|
136
|
-
sleep
|
|
138
|
+
}
|
|
139
|
+
changeLocaleLang() {
|
|
140
|
+
clickgo.core.config.locale = this.select[0];
|
|
141
|
+
}
|
|
142
|
+
sleep() {
|
|
137
143
|
if (this.sleeping) {
|
|
138
144
|
return;
|
|
139
145
|
}
|
|
@@ -141,13 +147,13 @@ exports.methods = {
|
|
|
141
147
|
clickgo.task.sleep(() => {
|
|
142
148
|
this.sleeping = false;
|
|
143
149
|
}, 1000);
|
|
144
|
-
}
|
|
145
|
-
systemTaskInfo
|
|
150
|
+
}
|
|
151
|
+
systemTaskInfo() {
|
|
146
152
|
clickgo.form.dialog(JSON.stringify(clickgo.task.systemTaskInfo)).catch((e) => { throw e; });
|
|
147
153
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
exports.
|
|
154
|
+
onMounted() {
|
|
155
|
+
this.tid = this.taskId.toString();
|
|
156
|
+
this.select = [clickgo.core.config.locale];
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.default = default_1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<form width="350" height="400" title="Library task"
|
|
2
|
-
<
|
|
1
|
+
<form width="350" height="400" title="Library task">
|
|
2
|
+
<flow direction="v" style="flex: 1; padding: 10px;">
|
|
3
3
|
<layout direction="v" gutter="10">
|
|
4
4
|
<label>onFrame(): timer: {{frameTimer}}, count: {{frameCount}}</label>
|
|
5
5
|
<layout gutter="10">
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
<button @click="frameStart(0)" style="height: 30px; flex: 1;">Once</button>
|
|
8
8
|
<button @click="frameStart(1)" style="height: 30px; flex: 1;">Count 100</button>
|
|
9
9
|
<button @click="frameStart(2)" style="height: 30px; flex: 1;">Form</button>
|
|
10
|
-
<button @click="frameStart(3)" style="height: 30px; flex: 1;">Task</button>
|
|
11
10
|
</template>
|
|
12
11
|
<template v-else>
|
|
13
12
|
<button @click="frameEnd" style="height: 30px; flex: 1;">End</button>
|
|
@@ -19,7 +18,6 @@
|
|
|
19
18
|
<button @click="timerStart(0)" style="height: 30px; flex: 1;">Once</button>
|
|
20
19
|
<button @click="timerStart(1)" style="height: 30px; flex: 1;">Count 100</button>
|
|
21
20
|
<button @click="timerStart(2)" style="height: 30px; flex: 1;">Form</button>
|
|
22
|
-
<button @click="timerStart(3)" style="height: 30px; flex: 1;">Task</button>
|
|
23
21
|
</template>
|
|
24
22
|
<template v-else>
|
|
25
23
|
<button @click="timerEnd" style="height: 30px; flex: 1;">End</button>
|
|
@@ -32,8 +30,9 @@
|
|
|
32
30
|
</layout>
|
|
33
31
|
<button @click="getList" style="height: 30px;">getList()</button>
|
|
34
32
|
<button @click="run" style="height: 30px;">run('/clickgo/app/demo/')</button>
|
|
33
|
+
<button @click="checkPermission" style="height: 30px;">checkPermission('hash')</button>
|
|
35
34
|
<button @click="end" style="height: 30px;">end('{{tid}}')</button>
|
|
36
|
-
<label>Now locale: {{
|
|
35
|
+
<label>Now locale: {{locale}}, Global locale: {{globalLocale}}</label>
|
|
37
36
|
<label>l('File name'): {{l('File name')}}</label>
|
|
38
37
|
<label>l('File size'): {{l('File size')}}</label>
|
|
39
38
|
<button @click="loadLocale('en', 'locale1')" style="height: 30px;">loadLocale('en', 'locale1')</button>
|
|
@@ -53,5 +52,5 @@
|
|
|
53
52
|
<button @click="sleep" style="height: 30px;">{{sleeping ? 'Waiting...' : 'sleep(() => { ... }, 1000)'}}</button>
|
|
54
53
|
<button @click="systemTaskInfo()" style="height: 30px;">systemTaskInfo</button>
|
|
55
54
|
</layout>
|
|
56
|
-
</
|
|
55
|
+
</flow>
|
|
57
56
|
</form>
|
|
@@ -9,10 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.methods = void 0;
|
|
13
12
|
const clickgo = require("clickgo");
|
|
14
|
-
|
|
15
|
-
get
|
|
13
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
14
|
+
get() {
|
|
16
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
16
|
const f = yield clickgo.fs.getContent('/clickgo/theme/familiar.cgt');
|
|
18
17
|
if (!f) {
|
|
@@ -27,8 +26,8 @@ exports.methods = {
|
|
|
27
26
|
}
|
|
28
27
|
return t;
|
|
29
28
|
});
|
|
30
|
-
}
|
|
31
|
-
load
|
|
29
|
+
}
|
|
30
|
+
load() {
|
|
32
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
32
|
const n = clickgo.form.notify({
|
|
34
33
|
'title': 'Info',
|
|
@@ -44,14 +43,14 @@ exports.methods = {
|
|
|
44
43
|
const r = yield clickgo.theme.load(t);
|
|
45
44
|
yield clickgo.form.dialog('Result: ' + (r ? 'true' : 'false'));
|
|
46
45
|
});
|
|
47
|
-
}
|
|
48
|
-
remove
|
|
46
|
+
}
|
|
47
|
+
remove() {
|
|
49
48
|
clickgo.theme.remove('familiar').catch((e) => { throw e; });
|
|
50
|
-
}
|
|
51
|
-
clear
|
|
49
|
+
}
|
|
50
|
+
clear() {
|
|
52
51
|
clickgo.theme.clear().catch((e) => { throw e; });
|
|
53
|
-
}
|
|
54
|
-
setGlobal
|
|
52
|
+
}
|
|
53
|
+
setGlobal() {
|
|
55
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
55
|
const n = clickgo.form.notify({
|
|
57
56
|
'title': 'Info',
|
|
@@ -67,8 +66,9 @@ exports.methods = {
|
|
|
67
66
|
yield clickgo.theme.setGlobal(t);
|
|
68
67
|
yield clickgo.form.dialog('Done.');
|
|
69
68
|
});
|
|
70
|
-
}
|
|
71
|
-
clearGlobal
|
|
69
|
+
}
|
|
70
|
+
clearGlobal() {
|
|
72
71
|
clickgo.theme.clearGlobal();
|
|
73
72
|
}
|
|
74
|
-
}
|
|
73
|
+
}
|
|
74
|
+
exports.default = default_1;
|
|
@@ -9,11 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.methods = exports.data = void 0;
|
|
13
12
|
const clickgo = require("clickgo");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
class default_1 extends clickgo.form.AbstractForm {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.sleeping = false;
|
|
17
|
+
this.purifyTxt = `<html>
|
|
17
18
|
<head>
|
|
18
19
|
<title>Hello world!</title>
|
|
19
20
|
</head>
|
|
@@ -23,17 +24,16 @@ exports.data = {
|
|
|
23
24
|
<!-- content -->
|
|
24
25
|
<div>content</div>
|
|
25
26
|
</body>
|
|
26
|
-
</html
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
sleep: function () {
|
|
27
|
+
</html>`;
|
|
28
|
+
this.min = '10';
|
|
29
|
+
this.max = '30';
|
|
30
|
+
this.length = '8';
|
|
31
|
+
this.block = '';
|
|
32
|
+
this.url = 'HtTp://uSer:pAss@sUBDom.TopdOm23.CoM:29819/Admxw2Ksiz/dszas?Mdi=KdiMs1&a=JDd#hehHe';
|
|
33
|
+
this.url1 = '/abc/def/hehe';
|
|
34
|
+
this.url2 = '../bb.index';
|
|
35
|
+
}
|
|
36
|
+
sleep() {
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
38
|
if (this.sleeping) {
|
|
39
39
|
return;
|
|
@@ -42,23 +42,24 @@ exports.methods = {
|
|
|
42
42
|
yield clickgo.tool.sleep(1000);
|
|
43
43
|
this.sleeping = false;
|
|
44
44
|
});
|
|
45
|
-
}
|
|
46
|
-
purify
|
|
45
|
+
}
|
|
46
|
+
purify() {
|
|
47
47
|
this.purifyTxt = clickgo.tool.purify(this.purifyTxt);
|
|
48
|
-
}
|
|
49
|
-
rand
|
|
48
|
+
}
|
|
49
|
+
rand() {
|
|
50
50
|
clickgo.form.dialog(clickgo.tool.rand(parseInt(this.min), parseInt(this.max)).toString()).catch((e) => { throw e; });
|
|
51
|
-
}
|
|
52
|
-
random
|
|
51
|
+
}
|
|
52
|
+
random() {
|
|
53
53
|
clickgo.form.dialog(clickgo.tool.random(parseInt(this.length), clickgo.tool.RANDOM_LN, this.block)).catch((e) => { throw e; });
|
|
54
|
-
}
|
|
55
|
-
escapeHTML
|
|
54
|
+
}
|
|
55
|
+
escapeHTML() {
|
|
56
56
|
clickgo.form.dialog(clickgo.tool.escapeHTML(this.purifyTxt)).catch((e) => { throw e; });
|
|
57
|
-
}
|
|
58
|
-
parseUrl
|
|
57
|
+
}
|
|
58
|
+
parseUrl() {
|
|
59
59
|
clickgo.form.dialog(JSON.stringify(clickgo.tool.parseUrl(this.url))).catch((e) => { throw e; });
|
|
60
|
-
}
|
|
61
|
-
urlResolve
|
|
60
|
+
}
|
|
61
|
+
urlResolve() {
|
|
62
62
|
clickgo.form.dialog(clickgo.tool.urlResolve(this.url1, this.url2)).catch((e) => { throw e; });
|
|
63
63
|
}
|
|
64
|
-
}
|
|
64
|
+
}
|
|
65
|
+
exports.default = default_1;
|