Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-libs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-libs
Commits
9b0501ea
Commit
9b0501ea
authored
Dec 04, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加toast
修改projectX目录
parent
af202e25
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
386 additions
and
3 deletions
+386
-3
api-polling.json
dist/processes/projectX/api-polling.json
+1
-1
hide-toast.json
dist/processes/view/hide-toast.json
+22
-0
set-script-enabled.json
dist/processes/view/set-script-enabled.json
+1
-1
show-toast.json
dist/processes/view/show-toast.json
+40
-0
meta.json
src/process/projectX/api-polling/meta.json
+248
-0
meta.json
src/process/projectX/api-request/meta.json
+1
-1
index.ts
src/process/view/hide-toast/index.ts
+10
-0
meta.json
src/process/view/hide-toast/meta.json
+18
-0
index.ts
src/process/view/show-toast/index.ts
+9
-0
meta.json
src/process/view/show-toast/meta.json
+36
-0
No files found.
dist/processes/proje
x
tX/api-polling.json
→
dist/processes/proje
c
tX/api-polling.json
View file @
9b0501ea
...
...
@@ -246,6 +246,6 @@
}
],
"id"
:
"api-polling"
,
"group"
:
"proje
x
tX"
,
"group"
:
"proje
c
tX"
,
"type"
:
"builtin"
}
dist/processes/view/hide-toast.json
0 → 100644
View file @
9b0501ea
{
"props"
:
{
"animation"
:
{
"type"
:
"boolean"
,
"default"
:
true
,
"alias"
:
"消失动画"
},
"hideDuration"
:
{
"type"
:
"number"
,
"default"
:
200
,
"alias"
:
"消失动画时间"
}
},
"name"
:
"隐藏Toast"
,
"output"
:
[
"success"
],
"id"
:
"hide-toast"
,
"script"
:
"var animation = engine.findVariable('animation', args, props);
\n
var hideDuration = engine.findVariable('hideDuration', args, props);
\n
global.gameStage.toast.hide(animation, hideDuration);
\n
next('success');
\n
"
,
"group"
:
"view"
,
"type"
:
"builtin"
}
dist/processes/view/set-script-enabled.json
View file @
9b0501ea
...
...
@@ -24,7 +24,7 @@
"success"
],
"id"
:
"set-script-enabled"
,
"script"
:
"var targetNode = target || props.target;
\n
if (targetNode) {
\n
var scriptsProxy = targetNode.scriptsProxy;
\n
var scriptIndex = props.scriptIndex, scriptName = props.scriptName, enabled = props.enabled;
\n
var script = void 0;
\n
if (scriptIndex !== undefined) {
\n
script = scriptsProxy.all[scriptIndex];
\n
}
\n
else if (scriptName !== undefined) {
\n
script = scriptsProxy.get(scriptName);
\n
}
\n
if (script) {
\n
script.disabled = !enabled;
\n
}
\n
}
\n
next('success', args);
\n
"
,
"script"
:
"var targetNode = target || props.target;
\n
if (targetNode) {
\n
var scriptsProxy = targetNode.scriptsProxy;
\n
var scriptIndex = props.scriptIndex, scriptName = props.scriptName, enabled = props.enabled;
\n
if (scriptIndex !== undefined) {
\n
var script = scriptsProxy.all[scriptIndex];
\n
if (script) {
\n
script.disabled = !enabled;
\n
}
\n
}
\n
else if (scriptName !== undefined) {
\n
var scripts = scriptsProxy.get(scriptName);
\n
for (var _i = 0, scripts_1 = scripts; _i < scripts_1.length; _i++) {
\n
var script = scripts_1[_i];
\n
script.disabled = !enabled;
\n
}
\n
}
\n
}
\n
next('success', args);
\n
"
,
"group"
:
"view"
,
"type"
:
"builtin"
}
dist/processes/view/show-toast.json
0 → 100644
View file @
9b0501ea
{
"props"
:
{
"viewName"
:
{
"type"
:
"string"
,
"alias"
:
"视图名"
},
"text"
:
{
"type"
:
"string"
,
"alias"
:
"内容"
},
"padding"
:
{
"type"
:
"number"
,
"default"
:
10
,
"alias"
:
"边距"
},
"duration"
:
{
"type"
:
"number"
,
"default"
:
1000
,
"alias"
:
"停留时间"
},
"showDuration"
:
{
"type"
:
"number"
,
"default"
:
300
,
"alias"
:
"展示动画时间"
},
"hideDuration"
:
{
"type"
:
"number"
,
"default"
:
200
,
"alias"
:
"消失动画时间"
}
},
"name"
:
"显示Toast"
,
"output"
:
[
"success"
],
"id"
:
"show-toast"
,
"script"
:
"var toastProps = Object.assign({}, props, args);
\n
global.gameStage.toast.show(toastProps);
\n
next('success');
\n
"
,
"group"
:
"view"
,
"type"
:
"builtin"
}
src/process/projectX/api-polling/meta.json
0 → 100644
View file @
9b0501ea
{
"props"
:
{
"uri"
:
{
"type"
:
"string"
,
"alias"
:
"链接"
},
"method"
:
{
"type"
:
"enum"
,
"enum"
:
[
"get"
,
"post"
],
"alias"
:
"方法"
,
"default"
:
"get"
},
"count"
:
{
"type"
:
"number"
,
"alias"
:
"次数"
,
"default"
:
10
},
"delay"
:
{
"type"
:
"number"
,
"default"
:
500
,
"alias"
:
"单次延时"
},
"dataName"
:
{
"type"
:
"string"
,
"alias"
:
"数据名"
},
"field"
:
{
"type"
:
"string"
,
"alias"
:
"字段名"
},
"successValues"
:
{
"type"
:
"string"
,
"alias"
:
"成功值"
},
"params"
:
{
"type"
:
"map"
,
"alias"
:
"参数"
}
},
"name"
:
"API轮询"
,
"output"
:
[
"success"
,
"failed"
,
"timeout"
,
"exception"
],
"sub"
:
{
"442452af-e4d2-47be-b931-86fef866056f"
:
{
"uuid"
:
"442452af-e4d2-47be-b931-86fef866056f"
,
"meta"
:
"entry"
,
"design"
:
{
"x"
:
26
,
"y"
:
15
,
"input"
:
{},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
31
}
]
}
},
"props"
:
{},
"output"
:
{
"success"
:
[
"37b87a14-679b-49b8-9293-321b82d6019d"
]
}
},
"9def8371-1326-4daa-8220-78cf888297e3"
:
{
"uuid"
:
"9def8371-1326-4daa-8220-78cf888297e3"
,
"meta"
:
"wait"
,
"design"
:
{
"x"
:
265
,
"y"
:
313
,
"input"
:
{
"default"
:
[
{
"x"
:
5.5
,
"y"
:
39
}
]
},
"output"
:
{
"complete"
:
[
{
"x"
:
124.5
,
"y"
:
39
}
]
}
},
"props"
:
{
"duration"
:
{
"type"
:
"link"
,
"alias"
:
"delay"
}
},
"output"
:
{
"complete"
:
[
"37b87a14-679b-49b8-9293-321b82d6019d"
]
}
},
"b88c8995-28eb-470f-a8a2-7484c9f98e05"
:
{
"uuid"
:
"b88c8995-28eb-470f-a8a2-7484c9f98e05"
,
"meta"
:
"http-polling-judge"
,
"design"
:
{
"x"
:
441
,
"y"
:
57
,
"input"
:
{
"default"
:
[
{
"x"
:
5.5
,
"y"
:
56
}
]
},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
42
}
],
"continue"
:
[
{
"x"
:
124.5
,
"y"
:
56
}
],
"timeout"
:
[
{
"x"
:
124.5
,
"y"
:
70
}
]
}
},
"props"
:
{
"count"
:
{
"type"
:
"link"
},
"field"
:
{
"type"
:
"link"
},
"successValues"
:
{
"type"
:
"link"
}
},
"output"
:
{
"continue"
:
[
"9def8371-1326-4daa-8220-78cf888297e3"
]
}
},
"37b87a14-679b-49b8-9293-321b82d6019d"
:
{
"uuid"
:
"37b87a14-679b-49b8-9293-321b82d6019d"
,
"meta"
:
"api-request"
,
"design"
:
{
"x"
:
250
,
"y"
:
43
,
"input"
:
{
"default"
:
[
{
"x"
:
5.5
,
"y"
:
64.5
}
]
},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
50.5
}
],
"failed"
:
[
{
"x"
:
124.5
,
"y"
:
64.5
}
],
"exception"
:
[
{
"x"
:
124.5
,
"y"
:
78.5
}
]
}
},
"props"
:
{
"uri"
:
{
"type"
:
"link"
},
"method"
:
{
"type"
:
"link"
},
"dataName"
:
{
"type"
:
"link"
},
"params"
:
{
"type"
:
"link"
}
},
"output"
:
{
"success"
:
[
"b88c8995-28eb-470f-a8a2-7484c9f98e05"
]
}
}
},
"subEntry"
:
"442452af-e4d2-47be-b931-86fef866056f"
,
"metas"
:
[
{
"script"
:
"var count = props.count, field = props.field, successValues = props.successValues;
\n
var key = 'counting-' + vm.id;
\n
var counting = global[key] || 0;
\n
counting++;
\n
var successArr = successValues.split(',');
\n
if (successArr.indexOf(args[field] + '') >= 0) {
\n
delete global[key];
\n
next('success', args);
\n
}
\n
else if (counting < count) {
\n
global[key] = counting;
\n
next('continue');
\n
}
\n
else {
\n
delete global[key];
\n
next('timeout');
\n
}
\n
"
,
"props"
:
{
"count"
:
{
"type"
:
"number"
,
"default"
:
5
,
"alias"
:
"次数"
},
"field"
:
{
"type"
:
"string"
,
"alias"
:
"字段名"
,
"default"
:
"status"
},
"successValues"
:
{
"type"
:
"string"
,
"alias"
:
"成功值"
}
},
"name"
:
"轮询判断"
,
"output"
:
[
"success"
,
"continue"
,
"timeout"
],
"id"
:
"http-polling-judge"
,
"group"
:
"projextX"
,
"type"
:
"builtin"
}
]
}
\ No newline at end of file
src/process/proje
x
tX/api-request/meta.json
→
src/process/proje
c
tX/api-request/meta.json
View file @
9b0501ea
...
...
@@ -134,7 +134,7 @@
"metas"
:
[
{
"id"
:
"a4b27753-4cbb-47e3-9b31-51ced475e41a"
,
"script"
:
"var
projectX = 'projectx';
\n
var projectID = engine.env.projectID;
\n
var uri = engine.findVariable('uri', args, props);
\n
next('success', {url: engine.joinPath(projectX, projectID, uri)
});"
,
"script"
:
"var
uri = engine.findVariable('uri', args, props);
\n
var url;
\n
if(location.pathname === '/preview'){
\n\t
var projectX = 'projectx';
\n\t
var projectID = engine.env.projectID;
\n
url = engine.joinPath(projectX, projectID, uri);
\n
}else{
\n
url = uri;
\n
}
\n
next('success', {url:url
});"
,
"props"
:
{
"uri"
:
{
"type"
:
"string"
,
...
...
src/process/view/hide-toast/index.ts
0 → 100644
View file @
9b0501ea
/**
* Created by rockyl on 2019-11-16.
*/
const
animation
=
engine
.
findVariable
(
'animation'
,
args
,
props
);
const
hideDuration
=
engine
.
findVariable
(
'hideDuration'
,
args
,
props
);
global
.
gameStage
.
toast
.
hide
(
animation
,
hideDuration
);
next
(
'success'
);
\ No newline at end of file
src/process/view/hide-toast/meta.json
0 → 100644
View file @
9b0501ea
{
"props"
:
{
"animation"
:
{
"type"
:
"boolean"
,
"default"
:
true
,
"alias"
:
"消失动画"
},
"hideDuration"
:
{
"type"
:
"number"
,
"default"
:
200
,
"alias"
:
"消失动画时间"
}
},
"name"
:
"隐藏Toast"
,
"output"
:
[
"success"
]
}
\ No newline at end of file
src/process/view/show-toast/index.ts
0 → 100644
View file @
9b0501ea
/**
* Created by rockyl on 2019-11-16.
*/
const
toastProps
=
Object
.
assign
({},
props
,
args
);
global
.
gameStage
.
toast
.
show
(
toastProps
);
next
(
'success'
);
\ No newline at end of file
src/process/view/show-toast/meta.json
0 → 100644
View file @
9b0501ea
{
"props"
:
{
"viewName"
:
{
"type"
:
"string"
,
"alias"
:
"视图名"
},
"text"
:
{
"type"
:
"string"
,
"alias"
:
"内容"
},
"padding"
:
{
"type"
:
"number"
,
"default"
:
10
,
"alias"
:
"边距"
},
"duration"
:
{
"type"
:
"number"
,
"default"
:
1000
,
"alias"
:
"停留时间"
},
"showDuration"
:
{
"type"
:
"number"
,
"default"
:
300
,
"alias"
:
"展示动画时间"
},
"hideDuration"
:
{
"type"
:
"number"
,
"default"
:
200
,
"alias"
:
"消失动画时间"
}
},
"name"
:
"显示Toast"
,
"output"
:
[
"success"
]
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment