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
39a1173e
Commit
39a1173e
authored
Dec 11, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了好多东西啊
parent
364ff526
Changes
21
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
2177 additions
and
2821 deletions
+2177
-2821
compare.json
dist/processes/base/compare.json
+2
-2
env-judge.json
dist/processes/base/env-judge.json
+1
-1
jump.json
dist/processes/base/jump.json
+2
-2
duiba-api.json
dist/processes/duiba/duiba-api.json
+4
-92
http-request.json
dist/processes/net/http-request.json
+1
-1
api-request.json
dist/processes/projectX/api-request.json
+6
-62
buried-point.json
dist/scripts/buried-point.json
+1
-1
wave.json
dist/scripts/wave.json
+10
-1
types.d.ts
libs/types.d.ts
+2057
-2624
compiler-script.js
scripts/compiler-script.js
+2
-2
meta.json
src/process/base/compare/meta.json
+2
-2
meta.json
src/process/base/data-center-event-filter/meta.json
+14
-0
index.ts
src/process/base/env-judge/index.ts
+2
-0
index.ts
src/process/base/jump/index.ts
+3
-5
meta.json
src/process/base/jump/meta.json
+1
-1
meta.json
src/process/custom/card-list-init/meta.json
+17
-0
meta.json
src/process/duiba/duiba-api/meta.json
+1
-1
index.ts
src/process/net/http-request/index.ts
+9
-7
index.ts
src/script/buried-point/index.ts
+1
-1
index.ts
src/script/wave/index.ts
+32
-16
meta.json
src/script/wave/meta.json
+9
-0
No files found.
dist/processes/base/compare.json
View file @
39a1173e
...
...
@@ -4,12 +4,12 @@
"props"
:
{
"left"
:
{
"alias"
:
"左值"
,
"type"
:
"d
ata
"
,
"type"
:
"d
ynamic
"
,
"default"
:
""
},
"right"
:
{
"alias"
:
"右值"
,
"type"
:
"d
ata
"
,
"type"
:
"d
ynamic
"
,
"default"
:
""
},
"operator"
:
{
...
...
dist/processes/base/env-judge.json
View file @
39a1173e
...
...
@@ -5,7 +5,7 @@
"success"
],
"id"
:
"env-judge"
,
"script"
:
"var ua = navigator.userAgent.toLowerCase();
\n
var env;
\n
if (ua.indexOf('eversunshine') >= 0) {
\n
env = 'eversunshine';
\n
}
\n
else if (ua.indexOf('micromessenger') >= 0) {
\n
env = 'weixin';
\n
}
\n
var payload = args || {};
\n
payload.env = env;
\n
next('success', payload);
\n
"
,
"script"
:
"var ua = navigator.userAgent.toLowerCase();
\n
var env;
\n
if (ua.indexOf('eversunshine') >= 0) {
\n
env = 'eversunshine';
\n
}
\n
else if (ua.indexOf('micromessenger') >= 0) {
\n
env = 'weixin';
\n
}
\n
console.log('env:', env);
\n
var payload = args || {};
\n
payload.env = env;
\n
next('success', payload);
\n
"
,
"group"
:
"base"
,
"type"
:
"builtin"
}
dist/processes/base/jump.json
View file @
39a1173e
...
...
@@ -4,14 +4,14 @@
"props"
:
{
"url"
:
{
"alias"
:
"地址"
,
"type"
:
"d
ata
"
"type"
:
"d
ynamic
"
}
},
"output"
:
[
"complete"
],
"id"
:
"jump"
,
"script"
:
"
if (args && args.url) {
\n
location.href = args.url;
\n
}
\n
else if (props.url) {
\n
location.href = props.url;
\n
}
\n
next('complete');
\n
"
,
"script"
:
"
var url = engine.findVariable('url', args, props);
\n
location.href = url;
\n
next('complete');
\n
"
,
"group"
:
"base"
,
"type"
:
"builtin"
}
dist/processes/duiba/duiba-api.json
View file @
39a1173e
...
...
@@ -32,19 +32,6 @@
"5fc7ba4d-6afa-4eab-82d8-f25cbcb79d56"
:
{
"uuid"
:
"5fc7ba4d-6afa-4eab-82d8-f25cbcb79d56"
,
"meta"
:
"entry"
,
"design"
:
{
"x"
:
10
,
"y"
:
10
,
"input"
:
{},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
31
}
]
}
},
"props"
:
{},
"output"
:
{
"success"
:
[
...
...
@@ -55,44 +42,15 @@
"69e28053-dfb3-459e-a9e5-4964c6e35193"
:
{
"uuid"
:
"69e28053-dfb3-459e-a9e5-4964c6e35193"
,
"meta"
:
"http-request"
,
"design"
:
{
"x"
:
67
,
"y"
:
139
,
"input"
:
{
"default"
:
[
{
"x"
:
5.5
,
"y"
:
47.5
}
]
},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
33.5
}
],
"failed"
:
[
{
"x"
:
124.5
,
"y"
:
47.5
}
],
"exception"
:
[
{
"x"
:
124.5
,
"y"
:
61.5
}
]
}
},
"props"
:
{
"url"
:
{
"type"
:
"link"
},
"method"
:
{
"type"
:
"link"
},
"params"
:
{
"type"
:
"link"
}
},
"output"
:
{
...
...
@@ -104,32 +62,6 @@
"39dce565-539b-44b6-901c-0344467795a8"
:
{
"uuid"
:
"39dce565-539b-44b6-901c-0344467795a8"
,
"meta"
:
"duiba-api-transform"
,
"design"
:
{
"x"
:
184
,
"y"
:
275
,
"input"
:
{
"default"
:
[
{
"x"
:
5.5
,
"y"
:
30.5
}
]
},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
23.5
}
],
"failed"
:
[
{
"x"
:
124.5
,
"y"
:
37.5
}
]
}
},
"props"
:
{},
"output"
:
{
"success"
:
[
...
...
@@ -140,26 +72,6 @@
"e95e7bbc-b592-4f87-b433-77fd03a9ef51"
:
{
"uuid"
:
"e95e7bbc-b592-4f87-b433-77fd03a9ef51"
,
"meta"
:
"put-data"
,
"design"
:
{
"x"
:
280
,
"y"
:
367
,
"input"
:
{
"default"
:
[
{
"x"
:
5.5
,
"y"
:
47.5
}
]
},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
47.5
}
]
}
},
"props"
:
{
"name"
:
{
"type"
:
"link"
...
...
@@ -172,7 +84,7 @@
"metas"
:
[
{
"id"
:
"duiba-api-transform"
,
"script"
:
"if (args.success) {
\n
next('success', args.data);
\n
}
\n
else {
\n
next('failed');
\n
}
\n
"
,
"script"
:
"if (args.success) {
\n
next('success', args.data);
\n
}
\n
else {
\n
next('failed'
, args
);
\n
}
\n
"
,
"props"
:
{},
"isInline"
:
true
,
"name"
:
"兑吧接口转换"
,
...
...
dist/processes/net/http-request.json
View file @
39a1173e
...
...
@@ -26,7 +26,7 @@
"exception"
],
"id"
:
"http-request"
,
"script"
:
"var url = engine.findVariable('url', args, props);
\n
var params = engine.findVariable('params', args, props);
\n
if (!url) {
\n
console.log('url is empty');
\n
next('exception', '
\\
'url is empty
\\
'');
\n
}
\n
else {
\n
engine.httpRequest(
function (s, payload) {
\n
if (s) {
\n
next('success', payload);
\n
}
\n
else {
\n
next('failed', payload);
\n
}
\n
}, url, props.method, params, 'json'
);
\n
}
\n
"
,
"script"
:
"var url = engine.findVariable('url', args, props);
\n
var params = engine.findVariable('params', args, props);
\n
if (!url) {
\n
console.log('url is empty');
\n
next('exception', '
\\
'url is empty
\\
'');
\n
}
\n
else {
\n
engine.httpRequest(
url, props.method, params, 'json')
\n
.then(function (data) {
\n
next('success', data);
\n
}, function (err) {
\n
next('failed', err);
\n
}
);
\n
}
\n
"
,
"group"
:
"net"
,
"type"
:
"builtin"
}
dist/processes/proje
x
tX/api-request.json
→
dist/processes/proje
c
tX/api-request.json
View file @
39a1173e
...
...
@@ -22,7 +22,7 @@
"alias"
:
"参数"
}
},
"name"
:
"
api
请求"
,
"name"
:
"
API
请求"
,
"output"
:
[
"success"
,
"failed"
,
...
...
@@ -32,19 +32,6 @@
"e6a9f1de-40c6-445b-b5e9-5c50a904a4de"
:
{
"uuid"
:
"e6a9f1de-40c6-445b-b5e9-5c50a904a4de"
,
"meta"
:
"entry"
,
"design"
:
{
"x"
:
10
,
"y"
:
10
,
"input"
:
{},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
31
}
]
}
},
"props"
:
{},
"output"
:
{
"success"
:
[
...
...
@@ -55,26 +42,6 @@
"567169ba-a2c1-4c10-9025-605a2e89ef0f"
:
{
"uuid"
:
"567169ba-a2c1-4c10-9025-605a2e89ef0f"
,
"meta"
:
"a4b27753-4cbb-47e3-9b31-51ced475e41a"
,
"design"
:
{
"x"
:
163
,
"y"
:
133
,
"input"
:
{
"default"
:
[
{
"x"
:
5.5
,
"y"
:
39
}
]
},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
39
}
]
}
},
"props"
:
{
"host"
:
{
"type"
:
"link"
...
...
@@ -92,32 +59,6 @@
"f9a32b46-aec1-4bd2-9b98-3d9a427d87db"
:
{
"uuid"
:
"f9a32b46-aec1-4bd2-9b98-3d9a427d87db"
,
"meta"
:
"duiba-api"
,
"design"
:
{
"x"
:
350
,
"y"
:
188
,
"input"
:
{
"default"
:
[
{
"x"
:
5.5
,
"y"
:
64.5
}
]
},
"output"
:
{
"success"
:
[
{
"x"
:
124.5
,
"y"
:
57.5
}
],
"failed"
:
[
{
"x"
:
124.5
,
"y"
:
71.5
}
]
}
},
"props"
:
{
"method"
:
{
"type"
:
"link"
...
...
@@ -125,6 +66,9 @@
"name"
:
{
"type"
:
"link"
,
"alias"
:
"dataName"
},
"params"
:
{
"type"
:
"link"
}
},
"output"
:
{}
...
...
@@ -134,7 +78,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: uri});//engine.joinPath(projectX, projectID, uri)
});"
,
"script"
:
"
var uri = engine.findVariable('uri', args, props);
\n
var url;
\n
if(uri.indexOf('//') !== 0 && uri.indexOf('://') < 0 && location.pathname === '/preview' || top.location.hash.indexOf('preview/') >= 0){
\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"
,
...
...
@@ -149,6 +93,6 @@
}
],
"id"
:
"api-request"
,
"group"
:
"proje
x
tX"
,
"group"
:
"proje
c
tX"
,
"type"
:
"builtin"
}
dist/scripts/buried-point.json
View file @
39a1173e
...
...
@@ -18,5 +18,5 @@
}
},
"id"
:
"buried-point"
,
"code"
:
"
\"
use strict
\"
;
\n
Object.defineProperty(exports,
\"
__esModule
\"
, { value: true });
\n
var BuriedPoint = (function (_super) {
\n
__extends(BuriedPoint, _super);
\n
function BuriedPoint() {
\n
var _this = _super !== null && _super.apply(this, arguments) || this;
\n
_this.dpm = '0.0.0.0';
\n
_this.dcm = '0.0.0.0';
\n
_this.dom = '0.0.0.0';
\n
return _this;
\n
}
\n
BuriedPoint.prototype.mounted = function () {
\n
this.dpm && (this.dpm = fill(this.dpm));
\n
this.dcm && (this.dcm = fill(this.dcm));
\n
this.dom && (this.dom = fill(this.dom));
\n
this.host.addEventListener(engine.MouseEvent.CLICK, this._onClick, this);
\n
};
\n
BuriedPoint.prototype.awake = function () {
\n
log('exposure', this);
\n
};
\n
BuriedPoint.prototype._onClick = function (e) {
\n
log('click', this);
\n
};
\n
BuriedPoint.id = 'buried-point';
\n
return BuriedPoint;
\n
}(engine.ScriptBase));
\n
exports.default = BuriedPoint;
\n
function fill(src) {
\n
var result = src;
\n
for (var key in engine.env) {
\n
result = result.replace(key, engine.env[key]);
\n
}
\n
return result;
\n
}
\n
function log(type, data) {
\n
var dpm = data.dpm, dcm = data.dcm, dom = data.dom;
\n
var params = {
\n
dpm: dpm, dcm: dcm, appId: engine.env.app_id
\n
};
\n
if (dom !== '0.0.0.0') {
\n
params.dom = dom;
\n
}
\n
var isExposure = type === 'exposure';
\n
engine.httpRequest(
null,
isExposure ? '//embedlog.duiba.com.cn/exposure/standard' : '/log/click', 'get', params, isExposure ? 'jsonp' : 'text');
\n
}
\n
"
"code"
:
"
\"
use strict
\"
;
\n
Object.defineProperty(exports,
\"
__esModule
\"
, { value: true });
\n
var BuriedPoint = (function (_super) {
\n
__extends(BuriedPoint, _super);
\n
function BuriedPoint() {
\n
var _this = _super !== null && _super.apply(this, arguments) || this;
\n
_this.dpm = '0.0.0.0';
\n
_this.dcm = '0.0.0.0';
\n
_this.dom = '0.0.0.0';
\n
return _this;
\n
}
\n
BuriedPoint.prototype.mounted = function () {
\n
this.dpm && (this.dpm = fill(this.dpm));
\n
this.dcm && (this.dcm = fill(this.dcm));
\n
this.dom && (this.dom = fill(this.dom));
\n
this.host.addEventListener(engine.MouseEvent.CLICK, this._onClick, this);
\n
};
\n
BuriedPoint.prototype.awake = function () {
\n
log('exposure', this);
\n
};
\n
BuriedPoint.prototype._onClick = function (e) {
\n
log('click', this);
\n
};
\n
BuriedPoint.id = 'buried-point';
\n
return BuriedPoint;
\n
}(engine.ScriptBase));
\n
exports.default = BuriedPoint;
\n
function fill(src) {
\n
var result = src;
\n
for (var key in engine.env) {
\n
result = result.replace(key, engine.env[key]);
\n
}
\n
return result;
\n
}
\n
function log(type, data) {
\n
var dpm = data.dpm, dcm = data.dcm, dom = data.dom;
\n
var params = {
\n
dpm: dpm, dcm: dcm, appId: engine.env.app_id
\n
};
\n
if (dom !== '0.0.0.0') {
\n
params.dom = dom;
\n
}
\n
var isExposure = type === 'exposure';
\n
engine.httpRequest(isExposure ? '//embedlog.duiba.com.cn/exposure/standard' : '/log/click', 'get', params, isExposure ? 'jsonp' : 'text');
\n
}
\n
"
}
dist/scripts/wave.json
View file @
39a1173e
This diff is collapsed.
Click to expand it.
libs/types.d.ts
View file @
39a1173e
This diff is collapsed.
Click to expand it.
scripts/compiler-script.js
View file @
39a1173e
...
...
@@ -35,8 +35,8 @@ function compileProcess(sourcePath, output) {
const
outputPath
=
path
.
join
(
output
,
sourcePath
);
fs
.
ensureDirSync
(
path
.
dirname
(
outputPath
));
fs
.
writeJsonSync
(
outputPath
+
'.json'
,
meta
,
{
spaces
:
' '
});
fs
.
writeFileSync
(
outputPath
+
'.js'
,
code
);
/*
fs.writeJsonSync(outputPath + '-req.json', {
/*fs.writeFileSync(outputPath + '.js', result.
code);
fs.writeJsonSync(outputPath + '-req.json', {
data: JSON.stringify(meta)
});*/
...
...
src/process/base/compare/meta.json
View file @
39a1173e
...
...
@@ -2,8 +2,8 @@
"name"
:
"比较"
,
"desc"
:
"比较两个值"
,
"props"
:
{
"left"
:
{
"alias"
:
"左值"
,
"type"
:
"d
ata
"
,
"default"
:
""
},
"right"
:
{
"alias"
:
"右值"
,
"type"
:
"d
ata
"
,
"default"
:
""
},
"left"
:
{
"alias"
:
"左值"
,
"type"
:
"d
ynamic
"
,
"default"
:
""
},
"right"
:
{
"alias"
:
"右值"
,
"type"
:
"d
ynamic
"
,
"default"
:
""
},
"operator"
:
{
"alias"
:
"操作符"
,
"type"
:
"enum"
,
"enum"
:
[
"=="
,
"!="
,
"==="
,
"!=="
,
">"
,
">="
,
"<"
,
"<="
],
"default"
:
"=="
}
...
...
src/process/base/data-center-event-filter/meta.json
0 → 100644
View file @
39a1173e
{
"script"
:
"if(args.name === props.dataName){
\n
next('success', args);
\n
}else{
\n
next('cancel')
\n
}"
,
"props"
:
{
"dataName"
:
{
"type"
:
"string"
,
"alias"
:
"数据名"
}
},
"name"
:
"数据中心事件筛选"
,
"output"
:
[
"success"
,
"cancel"
]
}
\ No newline at end of file
src/process/base/env-judge/index.ts
View file @
39a1173e
...
...
@@ -11,6 +11,8 @@ if(ua.indexOf('eversunshine') >= 0){
env
=
'weixin'
}
console
.
log
(
'env:'
,
env
);
const
payload
=
args
||
{};
payload
.
env
=
env
;
...
...
src/process/base/jump/index.ts
View file @
39a1173e
...
...
@@ -2,10 +2,8 @@
* Created by rockyl on 2019-11-16.
*/
if
(
args
&&
args
.
url
)
{
location
.
href
=
args
.
url
;
}
else
if
(
props
.
url
)
{
location
.
href
=
props
.
url
;
}
let
url
=
engine
.
findVariable
(
'url'
,
args
,
props
);
location
.
href
=
url
;
next
(
'complete'
);
src/process/base/jump/meta.json
View file @
39a1173e
...
...
@@ -4,7 +4,7 @@
"props"
:
{
"url"
:
{
"alias"
:
"地址"
,
"type"
:
"d
ata
"
"type"
:
"d
ynamic
"
}
},
"output"
:
[
...
...
src/process/custom/card-list-init/meta.json
0 → 100644
View file @
39a1173e
{
"props"
:
{
"cardListNode"
:
{
"type"
:
"node"
,
"alias"
:
"卡片列表"
},
"cardCount"
:
{
"type"
:
"number"
,
"default"
:
6
,
"alias"
:
"卡片数量"
}
},
"name"
:
"初始化卡片列表"
,
"output"
:
[
"success"
]
}
\ No newline at end of file
src/process/duiba/duiba-api/meta.json
View file @
39a1173e
...
...
@@ -84,7 +84,7 @@
"metas"
:
[
{
"id"
:
"duiba-api-transform"
,
"script"
:
"if (args.success) {
\n
next('success', args.data);
\n
}
\n
else {
\n
next('failed');
\n
}
\n
"
,
"script"
:
"if (args.success) {
\n
next('success', args.data);
\n
}
\n
else {
\n
next('failed'
, args
);
\n
}
\n
"
,
"props"
:
{},
"isInline"
:
true
,
"name"
:
"兑吧接口转换"
,
...
...
src/process/net/http-request/index.ts
View file @
39a1173e
...
...
@@ -9,11 +9,13 @@ if (!url) {
console
.
log
(
'url is empty'
);
next
(
'exception'
,
'
\'
url is empty
\'
'
);
}
else
{
engine
.
httpRequest
((
s
,
payload
)
=>
{
if
(
s
)
{
next
(
'success'
,
payload
);
}
else
{
next
(
'failed'
,
payload
);
engine
.
httpRequest
(
url
,
props
.
method
,
params
,
'json'
)
.
then
(
data
=>
{
next
(
'success'
,
data
);
},
err
=>
{
next
(
'failed'
,
err
);
}
},
url
,
props
.
method
,
params
,
'json'
);
);
}
src/script/buried-point/index.ts
View file @
39a1173e
...
...
@@ -45,7 +45,7 @@ function log(type, data) {
}
let
isExposure
=
type
===
'exposure'
;
engine
.
httpRequest
(
null
,
engine
.
httpRequest
(
isExposure
?
'//embedlog.duiba.com.cn/exposure/standard'
:
'/log/click'
,
'get'
,
params
,
...
...
src/script/wave/index.ts
View file @
39a1173e
...
...
@@ -11,6 +11,8 @@ export default class Wave extends engine.ScriptBase {
waveParams
:
string
;
loop
:
number
=
-
1
;
autoPlay
:
boolean
=
true
;
ratio
:
string
;
revert
:
boolean
=
false
;
private
_playing
;
private
_waveAlgorithm
;
...
...
@@ -18,7 +20,7 @@ export default class Wave extends engine.ScriptBase {
private
_oldProps
:
any
=
{};
private
_loopCounting
;
mounted
(){
mounted
()
{
this
.
_startTime
=
0
;
engine
.
copyProp
(
this
.
_oldProps
,
this
.
host
,
oldPropFields
);
...
...
@@ -46,15 +48,36 @@ export default class Wave extends engine.ScriptBase {
let
r
=
pass
/
duration
*
PI2
;
let
loopCounting
=
Math
.
floor
((
t
-
this
.
_startTime
)
/
duration
);
if
(
loopCounting
!=
this
.
_loopCounting
)
{
if
(
loopCounting
!=
this
.
_loopCounting
)
{
this
.
_loopCounting
=
loopCounting
;
if
(
this
.
onLoopEnd
())
{
if
(
this
.
onLoopEnd
())
{
r
=
PI2
;
}
}
let
params
=
waveParams
?
(
waveParams
.
split
(
','
))
:
[];
let
props
=
_waveAlgorithm
(...
params
,
r
);
let
t2
;
if
(
this
.
ratio
)
{
let
ratio
=
this
.
ratio
.
split
(
','
).
map
(
item
=>
parseFloat
(
item
));
if
(
ratio
.
length
===
2
)
{
const
[
begin
,
end
]
=
ratio
;
if
(
end
>=
begin
){
let
tr
=
r
/
PI2
;
if
(
tr
>=
begin
&&
tr
<
end
){
t2
=
r
/
(
end
-
begin
);
}
else
{
t2
=
0
;
}
}
else
{
t2
=
0
;
}
}
else
{
t2
=
0
;
}
}
else
{
t2
=
r
;
}
let
params
=
waveParams
?
(
waveParams
.
split
(
','
).
map
(
item
=>
parseFloat
(
item
)))
:
[];
let
props
=
_waveAlgorithm
(...
params
,
t2
);
if
(
props
.
hasOwnProperty
(
'x'
))
{
host
.
x
=
(
props
.
x
||
0
)
+
_oldProps
.
x
;
...
...
@@ -74,7 +97,7 @@ export default class Wave extends engine.ScriptBase {
}
}
private
onLoopEnd
(){
private
onLoopEnd
()
{
if
(
this
.
loop
<
0
)
{
//this.onLoopComplete.invoke();
}
else
if
(
this
.
_loopCounting
<
this
.
loop
)
{
...
...
@@ -98,15 +121,8 @@ export default class Wave extends engine.ScriptBase {
*/
stop
(
revert
=
false
)
{
this
.
_playing
=
false
;
if
(
revert
){
for
(
let
key
in
this
.
_oldProps
){
let
prop
=
this
.
_oldProps
[
key
];
if
(
typeof
prop
===
'object'
){
engine
.
injectProp
(
this
.
host
[
key
],
prop
);
}
else
{
this
.
host
[
key
]
=
prop
;
}
}
if
(
revert
)
{
this
.
revertProps
();
}
}
...
...
@@ -122,7 +138,7 @@ export default class Wave extends engine.ScriptBase {
}
protected
onModify
(
value
,
key
,
oldValue
)
{
switch
(
key
)
{
switch
(
key
)
{
case
'waveMethod'
:
this
.
_waveAlgorithm
=
waveLibs
[
this
.
waveMethod
];
break
;
...
...
src/script/wave/meta.json
View file @
39a1173e
...
...
@@ -34,6 +34,15 @@
"alias"
:
"自动播放"
,
"type"
:
"boolean"
,
"default"
:
true
},
"revert"
:
{
"alias"
:
"自动恢复"
,
"type"
:
"boolean"
,
"default"
:
false
},
"ratio"
:
{
"alias"
:
"时间占比"
,
"type"
:
"string"
}
}
}
\ 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