clickgo 3.1.4-dev13 → 3.1.6-dev15

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.
Files changed (96) hide show
  1. package/README.md +7 -7
  2. package/dist/app/demo/app.js +29 -3
  3. package/dist/app/demo/config.json +22 -3
  4. package/dist/app/demo/form/control/box/box.js +66 -0
  5. package/dist/app/demo/form/control/box/box.xml +18 -0
  6. package/dist/app/demo/form/control/button/button.js +24 -1
  7. package/dist/app/demo/form/control/check/check.js +24 -1
  8. package/dist/app/demo/form/control/dialog/dialog.js +24 -1
  9. package/dist/app/demo/form/control/file/file.js +24 -1
  10. package/dist/app/demo/form/control/flow/flow.js +24 -1
  11. package/dist/app/demo/form/control/form/form.js +24 -1
  12. package/dist/app/demo/form/control/layout/layout.js +57 -0
  13. package/dist/app/demo/form/control/layout/layout.xml +16 -0
  14. package/dist/app/demo/form/control/list/list.js +24 -1
  15. package/dist/app/demo/form/control/list/list.xml +8 -2
  16. package/dist/app/demo/form/control/marquee/marquee.js +24 -2
  17. package/dist/app/demo/form/control/marquee/marquee.xml +2 -5
  18. package/dist/app/demo/form/control/menu/menu.js +24 -1
  19. package/dist/app/demo/form/control/monaco/monaco.js +24 -1
  20. package/dist/app/demo/form/control/nav/nav.js +52 -0
  21. package/dist/app/demo/form/control/nav/nav.xml +43 -0
  22. package/dist/app/demo/form/control/panel/panel.js +67 -0
  23. package/dist/app/demo/form/control/panel/panel.xml +11 -0
  24. package/dist/app/demo/form/control/panel/test1.js +58 -0
  25. package/dist/app/demo/form/control/panel/test1.xml +16 -0
  26. package/dist/app/demo/form/control/panel/test2.xml +3 -0
  27. package/dist/app/demo/form/control/property/property.js +24 -1
  28. package/dist/app/demo/form/control/radio/radio.js +24 -1
  29. package/dist/app/demo/form/control/scroll/scroll.js +25 -1
  30. package/dist/app/demo/form/control/scroll/scroll.xml +5 -2
  31. package/dist/app/demo/form/control/select/select.js +24 -1
  32. package/dist/app/demo/form/control/tab/tab.js +24 -1
  33. package/dist/app/demo/form/control/table/table.js +164 -0
  34. package/dist/app/demo/form/control/table/table.xml +35 -0
  35. package/dist/app/demo/form/control/text/text.js +25 -1
  36. package/dist/app/demo/form/control/text/text.xml +1 -1
  37. package/dist/app/demo/form/control/vflow/vflow.js +24 -1
  38. package/dist/app/demo/form/event/form/form.js +24 -1
  39. package/dist/app/demo/form/event/other/other.js +24 -1
  40. package/dist/app/demo/form/event/screen/screen.js +24 -1
  41. package/dist/app/demo/form/event/task/task.js +24 -1
  42. package/dist/app/demo/form/main.js +130 -84
  43. package/dist/app/demo/form/main.xml +5 -0
  44. package/dist/app/demo/form/method/aform/aform.js +29 -15
  45. package/dist/app/demo/form/method/aform/aform.xml +0 -1
  46. package/dist/app/demo/form/method/aform/sd.js +25 -5
  47. package/dist/app/demo/form/method/core/core.js +24 -1
  48. package/dist/app/demo/form/method/dom/dom.js +48 -2
  49. package/dist/app/demo/form/method/dom/dom.xml +11 -0
  50. package/dist/app/demo/form/method/form/form.js +40 -7
  51. package/dist/app/demo/form/method/form/form.xml +3 -0
  52. package/dist/app/demo/form/method/{aform → form}/test.xml +0 -0
  53. package/dist/app/demo/form/method/fs/fs.js +139 -8
  54. package/dist/app/demo/form/method/fs/fs.xml +11 -1
  55. package/dist/app/demo/form/method/fs/text.js +24 -1
  56. package/dist/app/demo/form/method/native/native.js +24 -1
  57. package/dist/app/demo/form/method/system/system.js +24 -1
  58. package/dist/app/demo/form/method/task/task.js +31 -4
  59. package/dist/app/demo/form/method/task/task.xml +6 -1
  60. package/dist/app/demo/form/method/theme/theme.js +24 -1
  61. package/dist/app/demo/form/method/tool/tool.js +38 -1
  62. package/dist/app/demo/form/method/tool/tool.xml +1 -0
  63. package/dist/app/demo/form/method/zip/zip.js +30 -7
  64. package/dist/app/task/app.js +29 -3
  65. package/dist/app/task/form/bar/bar.js +24 -1
  66. package/dist/clickgo.js +33 -10
  67. package/dist/control/box.cgc +0 -0
  68. package/dist/control/common.cgc +0 -0
  69. package/dist/control/form.cgc +0 -0
  70. package/dist/control/monaco.cgc +0 -0
  71. package/dist/control/nav.cgc +0 -0
  72. package/dist/control/property.cgc +0 -0
  73. package/dist/control/table.cgc +0 -0
  74. package/dist/control/task.cgc +0 -0
  75. package/dist/global.css +1 -1
  76. package/dist/lib/control.js +53 -12
  77. package/dist/lib/control.ts +25 -5
  78. package/dist/lib/core.js +44 -50
  79. package/dist/lib/core.ts +18 -48
  80. package/dist/lib/dom.js +322 -108
  81. package/dist/lib/dom.ts +394 -127
  82. package/dist/lib/form.js +590 -226
  83. package/dist/lib/form.ts +706 -267
  84. package/dist/lib/fs.js +485 -224
  85. package/dist/lib/fs.ts +493 -287
  86. package/dist/lib/native.js +24 -1
  87. package/dist/lib/task.js +159 -139
  88. package/dist/lib/task.ts +148 -130
  89. package/dist/lib/theme.js +27 -4
  90. package/dist/lib/tool.js +57 -2
  91. package/dist/lib/tool.ts +68 -1
  92. package/dist/lib/zip.js +29 -3
  93. package/dist/lib/zip.ts +1 -1
  94. package/dist/theme/familiar.cgt +0 -0
  95. package/package.json +5 -7
  96. package/types/index.d.ts +51 -70
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
32
  });
10
33
  };
11
34
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const clickgo = require("clickgo");
35
+ const clickgo = __importStar(require("clickgo"));
13
36
  class default_1 extends clickgo.form.AbstractForm {
14
37
  constructor() {
15
38
  super(...arguments);
@@ -41,6 +64,17 @@ class default_1 extends clickgo.form.AbstractForm {
41
64
  get() {
42
65
  clickgo.form.dialog(JSON.stringify(clickgo.form.get(parseInt(this.fid)))).catch((e) => { throw e; });
43
66
  }
67
+ getActivePanel() {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ yield clickgo.form.dialog(JSON.stringify(clickgo.form.getActivePanel(parseInt(this.fid))));
70
+ });
71
+ }
72
+ getFocus() {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const f = clickgo.form.getFocus();
75
+ yield clickgo.form.dialog(f ? f.toString() : 'null');
76
+ });
77
+ }
44
78
  changeFocus() {
45
79
  clickgo.form.changeFocus(parseInt(this.fid));
46
80
  }
@@ -118,13 +152,12 @@ class default_1 extends clickgo.form.AbstractForm {
118
152
  }
119
153
  clickgo.form.showPop(e.currentTarget, this.refs.pop, 'v');
120
154
  }
121
- createTop() {
155
+ create() {
122
156
  return __awaiter(this, void 0, void 0, function* () {
123
- const frm = yield this.createForm('test');
124
- if (typeof frm === 'number') {
125
- return;
126
- }
127
- frm.topMost = true;
157
+ const frm = yield clickgo.form.create('test', undefined, {
158
+ 'path': this.filename
159
+ });
160
+ frm.show();
128
161
  });
129
162
  }
130
163
  dialog() {
@@ -13,11 +13,13 @@
13
13
  </layout>
14
14
  <button @click="getTaskId" style="height: 30px;">getTaskId({{fid}})</button>
15
15
  <button @click="get" style="height: 30px;">get({{fid}})</button>
16
+ <button @click="getActivePanel" style="height: 30px;">getActivePanel({{fid}})</button>
16
17
  <layout gutter="10" align-v="center">
17
18
  <label>Task ID:</label>
18
19
  <text v-model="tid" style="flex: 1; width: 0; height: 30px;"></text>
19
20
  <button @click="getList" style="padding: 0 10px;">getList({{tid}})</button>
20
21
  </layout>
22
+ <button @click="getFocus" style="height: 30px;">getFocus()</button>
21
23
  <button @click="changeFocus" style="height: 30px;">changeFocus({{fid}})</button>
22
24
  <button @click="getMaxZIndexID" style="height: 30px;">getMaxZIndexID()</button>
23
25
  <button @click="getRectByBorder" style="height: 30px;">getRectByBorder('rb')</button>
@@ -33,6 +35,7 @@
33
35
  <teleport to="system">
34
36
  <block ref="pop" style="border: solid 1px #000; background: #FFF; width: 200px; height: 100px; display: flex; justify-content: center; align-items: center;">refs.pop</block>
35
37
  </teleport>
38
+ <button @click="create" style="height: 30px;">create('test', undefined, { 'path': this.filename })</button>
36
39
  <label>Dialog result: {{dr}}.</label>
37
40
  <button @click="dialog" style="height: 30px;">dialog('Hello world!')</button>
38
41
  <button @click="dialogLong">dialog('long...')</button>
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,15 +31,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
31
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
32
  });
10
33
  };
34
+ var __importDefault = (this && this.__importDefault) || function (mod) {
35
+ return (mod && mod.__esModule) ? mod : { "default": mod };
36
+ };
11
37
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const clickgo = require("clickgo");
13
- const text_1 = require("./text");
38
+ const clickgo = __importStar(require("clickgo"));
39
+ const text_1 = __importDefault(require("./text"));
14
40
  class default_1 extends clickgo.form.AbstractForm {
15
41
  constructor() {
16
42
  super(...arguments);
17
43
  this.ppath = '/';
18
44
  this.list = [];
19
45
  this.val = [];
46
+ this.get = false;
20
47
  }
21
48
  open(path) {
22
49
  return __awaiter(this, void 0, void 0, function* () {
@@ -34,6 +61,12 @@ class default_1 extends clickgo.form.AbstractForm {
34
61
  this.ppath = path;
35
62
  });
36
63
  }
64
+ stats() {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ const stats = yield clickgo.fs.stats(this.val[0]);
67
+ yield clickgo.form.dialog(stats ? JSON.stringify(stats) : 'null');
68
+ });
69
+ }
37
70
  dblclick() {
38
71
  return __awaiter(this, void 0, void 0, function* () {
39
72
  const r = yield clickgo.fs.isFile(this.val[0]);
@@ -44,8 +77,11 @@ class default_1 extends clickgo.form.AbstractForm {
44
77
  return;
45
78
  }
46
79
  const ext = this.val[0].toLowerCase().slice(extlio + 1);
47
- if (['xml', 'js', 'ts', 'json', 'css', 'html', 'php'].includes(ext)) {
48
- let content = yield clickgo.fs.getContent(this.val[0]);
80
+ if (['xml', 'js', 'ts', 'json', 'css', 'html', 'php', 'txt'].includes(ext)) {
81
+ let content = yield clickgo.fs.getContent(this.val[0], this.get ? {
82
+ 'start': 2,
83
+ 'end': 4
84
+ } : undefined);
49
85
  if (!content) {
50
86
  yield clickgo.form.dialog('This file cannot be opened.');
51
87
  return;
@@ -53,13 +89,10 @@ class default_1 extends clickgo.form.AbstractForm {
53
89
  if (content instanceof Blob) {
54
90
  content = yield clickgo.tool.blob2Text(content);
55
91
  }
56
- const f = yield text_1.default.create({
92
+ const f = yield clickgo.form.create(text_1.default, {
57
93
  'title': this.val[0].slice(this.val[0].lastIndexOf('/') + 1),
58
94
  'content': content
59
95
  });
60
- if (typeof f === 'number') {
61
- return;
62
- }
63
96
  f.show();
64
97
  return;
65
98
  }
@@ -80,6 +113,104 @@ class default_1 extends clickgo.form.AbstractForm {
80
113
  yield this.open(npath);
81
114
  });
82
115
  }
116
+ mount() {
117
+ return __awaiter(this, void 0, void 0, function* () {
118
+ yield clickgo.form.dialog(clickgo.fs.mount('test', {
119
+ readDir: (path) => {
120
+ const list = [];
121
+ switch (path) {
122
+ case '/': {
123
+ list.push({
124
+ isFile: function () {
125
+ return false;
126
+ },
127
+ isDirectory: function () {
128
+ return true;
129
+ },
130
+ isSymbolicLink: function () {
131
+ return false;
132
+ },
133
+ 'name': 'test1'
134
+ });
135
+ list.push({
136
+ isFile: function () {
137
+ return false;
138
+ },
139
+ isDirectory: function () {
140
+ return true;
141
+ },
142
+ isSymbolicLink: function () {
143
+ return false;
144
+ },
145
+ 'name': 'test2'
146
+ });
147
+ break;
148
+ }
149
+ case '/test2/': {
150
+ list.push({
151
+ isFile: function () {
152
+ return true;
153
+ },
154
+ isDirectory: function () {
155
+ return false;
156
+ },
157
+ isSymbolicLink: function () {
158
+ return false;
159
+ },
160
+ 'name': 'test.txt'
161
+ });
162
+ break;
163
+ }
164
+ }
165
+ return list;
166
+ },
167
+ stats: (path) => {
168
+ if (path !== '/test2/test.txt') {
169
+ return null;
170
+ }
171
+ const date = new Date();
172
+ const ms = date.getTime();
173
+ const size = 7;
174
+ return {
175
+ isFile: function () {
176
+ return true;
177
+ },
178
+ isDirectory: function () {
179
+ return false;
180
+ },
181
+ isSymbolicLink: function () {
182
+ return false;
183
+ },
184
+ 'size': size,
185
+ 'blksize': size,
186
+ 'atimeMs': ms,
187
+ 'mtimeMs': ms,
188
+ 'ctimeMs': ms,
189
+ 'birthtimeMs': ms,
190
+ 'atime': date,
191
+ 'mtime': date,
192
+ 'ctime': date,
193
+ 'birthtime': date
194
+ };
195
+ },
196
+ getContent: (path, options) => {
197
+ if (path !== '/test2/test.txt') {
198
+ return null;
199
+ }
200
+ const content = 'testabc';
201
+ if (!options || typeof options === 'string') {
202
+ return content;
203
+ }
204
+ return content.slice(options.start, options.end);
205
+ },
206
+ }) ? 'true' : 'fasle');
207
+ });
208
+ }
209
+ unmount() {
210
+ return __awaiter(this, void 0, void 0, function* () {
211
+ yield clickgo.form.dialog((yield clickgo.fs.unmount('test')) ? 'true' : 'false');
212
+ });
213
+ }
83
214
  onMounted() {
84
215
  return __awaiter(this, void 0, void 0, function* () {
85
216
  yield this.open('/');
@@ -2,7 +2,17 @@
2
2
  <layout gutter="10" direction="v" style="flex: 1;">
3
3
  <label>Double click the item below:</label>
4
4
  <block style="background: #000; color: #FFF; padding: 5px;">{{ppath}}</block>
5
+ <label>{{val[0]}}</label>
5
6
  <list v-model="val" :data="list" @dblclick="dblclick" style="flex: 1; height: 0;"></list>
6
- <button style="height: 30px;" @click="up">Up</button>
7
+ <layout gutter="10">
8
+ <button style="height: 30px; padding: 0 10px;" @click="open(ppath)">Refresh</button>
9
+ <button style="height: 30px; padding: 0 10px;" @click="stats">Stats</button>
10
+ <button style="height: 30px; flex: 1;" @click="up">Up</button>
11
+ </layout>
12
+ <layout gutter="10">
13
+ <button style="height: 30px; flex: 1;" @click="mount">Mount "test"</button>
14
+ <button style="height: 30px; flex: 1;" @click="unmount">Unmount</button>
15
+ <button style="height: 30px; flex: 1;" @click="get = !get">{{get ? '' : '!'}}get(2,4)</button>
16
+ </layout>
7
17
  </layout>
8
18
  </form>
@@ -1,6 +1,29 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const clickgo = require("clickgo");
26
+ const clickgo = __importStar(require("clickgo"));
4
27
  class default_1 extends clickgo.form.AbstractForm {
5
28
  constructor() {
6
29
  super(...arguments);
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
32
  });
10
33
  };
11
34
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const clickgo = require("clickgo");
35
+ const clickgo = __importStar(require("clickgo"));
13
36
  class default_1 extends clickgo.form.AbstractForm {
14
37
  constructor() {
15
38
  super(...arguments);
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
32
  });
10
33
  };
11
34
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const clickgo = require("clickgo");
35
+ const clickgo = __importStar(require("clickgo"));
13
36
  class default_1 extends clickgo.form.AbstractForm {
14
37
  getVersion() {
15
38
  return __awaiter(this, void 0, void 0, function* () {
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
32
  });
10
33
  };
11
34
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const clickgo = require("clickgo");
35
+ const clickgo = __importStar(require("clickgo"));
13
36
  class default_1 extends clickgo.form.AbstractForm {
14
37
  constructor() {
15
38
  super(...arguments);
@@ -88,7 +111,11 @@ class default_1 extends clickgo.form.AbstractForm {
88
111
  }
89
112
  get() {
90
113
  const r = clickgo.task.get(parseInt(this.tid));
91
- clickgo.form.dialog(r ? JSON.stringify(r) : 'null').catch((e) => { throw e; });
114
+ clickgo.form.dialog(r ? JSON.stringify(r).replace(/(data:image\/).+?"/g, '$1..."') : 'null').catch((e) => { throw e; });
115
+ }
116
+ getPermissions() {
117
+ const r = clickgo.task.getPermissions(parseInt(this.tid));
118
+ clickgo.form.dialog(JSON.stringify(r)).catch((e) => { throw e; });
92
119
  }
93
120
  getList() {
94
121
  let msg = JSON.stringify(clickgo.task.getList());
@@ -101,9 +128,9 @@ class default_1 extends clickgo.form.AbstractForm {
101
128
  yield clickgo.form.dialog('Task ID: ' + tid.toString());
102
129
  });
103
130
  }
104
- checkPermission() {
131
+ checkPermission(val) {
105
132
  return __awaiter(this, void 0, void 0, function* () {
106
- const rtn = yield clickgo.task.checkPermission('hash', true);
133
+ const rtn = yield clickgo.task.checkPermission(val, true);
107
134
  yield clickgo.form.dialog(rtn[0] ? 'Succeed' : 'Failed');
108
135
  });
109
136
  }
@@ -28,9 +28,14 @@
28
28
  <text v-model="tid" style="flex: 1; width: 0; height: 30px;"></text>
29
29
  <button @click="get" style="height: 30px; padding: 0 10px;">get({{tid}})</button>
30
30
  </layout>
31
+ <button @click="getPermissions" style="height: 30px;">getPermissions({{tid}})</button>
31
32
  <button @click="getList" style="height: 30px;">getList()</button>
32
33
  <button @click="run" style="height: 30px;">run('/clickgo/app/demo/')</button>
33
- <button @click="checkPermission" style="height: 30px;">checkPermission('hash')</button>
34
+ <layout gutter="10" align-v="center">
35
+ <label>checkPermission:</label>
36
+ <button @click="checkPermission('hash')" style="height: 30px; flex: 1;">hash</button>
37
+ <button @click="checkPermission('root')" style="height: 30px; flex: 1; color: red;">root</button>
38
+ </layout>
34
39
  <button @click="end" style="height: 30px;">end('{{tid}}')</button>
35
40
  <label>Now locale: {{locale}}, Global locale: {{globalLocale}}</label>
36
41
  <label>l('File name'): {{l('File name')}}</label>
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
32
  });
10
33
  };
11
34
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const clickgo = require("clickgo");
35
+ const clickgo = __importStar(require("clickgo"));
13
36
  class default_1 extends clickgo.form.AbstractForm {
14
37
  get() {
15
38
  return __awaiter(this, void 0, void 0, function* () {
@@ -1,4 +1,27 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -9,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
32
  });
10
33
  };
11
34
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const clickgo = require("clickgo");
35
+ const clickgo = __importStar(require("clickgo"));
13
36
  class default_1 extends clickgo.form.AbstractForm {
14
37
  constructor() {
15
38
  super(...arguments);
@@ -23,6 +46,17 @@ class default_1 extends clickgo.form.AbstractForm {
23
46
  <h1>Title</h1>
24
47
  <!-- content -->
25
48
  <div>content</div>
49
+ <div>// abc</div>
50
+ <script>
51
+ // --- test ---
52
+ if (a) {
53
+ alert('zzz');
54
+ }
55
+ /* --- test 2 --- */
56
+ if (b) {
57
+ alert('zzz');
58
+ }
59
+ </script>
26
60
  </body>
27
61
  </html>`;
28
62
  this.min = '10';
@@ -55,6 +89,9 @@ class default_1 extends clickgo.form.AbstractForm {
55
89
  escapeHTML() {
56
90
  clickgo.form.dialog(clickgo.tool.escapeHTML(this.purifyTxt)).catch((e) => { throw e; });
57
91
  }
92
+ rgb2hsl() {
93
+ clickgo.form.dialog(JSON.stringify(clickgo.tool.rgb2hsl('9,105,218'))).catch((e) => { throw e; });
94
+ }
58
95
  parseUrl() {
59
96
  clickgo.form.dialog(JSON.stringify(clickgo.tool.parseUrl(this.url))).catch((e) => { throw e; });
60
97
  }
@@ -15,6 +15,7 @@
15
15
  <button @click="random" style="height: 30px; padding: 0 10px;">random({{length}}, RANDOM_LN, '{{block}}')</button>
16
16
  </layout>
17
17
  <button @click="escapeHTML" style="height: 30px;">escapeHTML('{{purifyTxt.slice(0, 5).replace("'", "\\'")}}...')</button>
18
+ <button @click="rgb2hsl" style="height: 30px;">rgb2hsl('9,105,218')</button>
18
19
  <text v-model="url" style="height: 30px;"></text>
19
20
  <button @click="parseUrl" style="height: 30px;">parseUrl('{{url.slice(0, 5).replace("'","\\'")}}...')</button>
20
21
  <label>urlResolve:</label>