initi.doc/templates/initi/tmpl/method_compact.tmpl

50 lines
1.8 KiB
Cheetah
Raw Normal View History

2018-09-18 12:17:34 +00:00
<?js
var data = obj;
var self = this;
2018-09-19 11:53:10 +00:00
//console.log(JSON.stringify(data, true, 3))
2018-09-18 14:41:21 +00:00
?>
2018-09-18 12:17:34 +00:00
2018-09-18 14:41:21 +00:00
<div class="compact-method">
<span class="access ib"> <?js= (data.access ? data.access : data.scope) ?></span>
2018-09-18 14:41:21 +00:00
<span class="name"><a href="#<?js= data.id ?>"><?js= name ?></a></span>
2018-10-10 11:00:35 +00:00
<div class="params off-font ib">
2018-09-18 14:41:21 +00:00
<span class="left-circle-bracket">(</span>
<?js
if(data.params){
var a = 0;
while(a < data.params.length){
var param = data.params[a];
if(!param) { a++; continue; }
2018-09-19 10:40:04 +00:00
//console.log(JSON.stringify(param,true,3))
2018-09-18 14:41:21 +00:00
var type = param.type.names[0];
?>
2018-10-10 11:00:35 +00:00
<div class="param ib">
<div class="type off-font ib">
2018-09-19 15:13:49 +00:00
<span class="left-quad-bracket">[</span>
<span class="name"><?js= this.linkto(type) ?></span>
2018-09-19 15:13:49 +00:00
<span class="right-quad-bracket">]</span>
2018-10-10 11:00:35 +00:00
</div>
<span class="name"><?js= param.name ?></span><?js if(a < data.params.length - 1) { ?><span class="gap ib">, </span><?js } ?>
2018-09-19 10:25:01 +00:00
2018-10-10 11:00:35 +00:00
</div>
2018-09-18 14:41:21 +00:00
<?js
a++;
}
}
?>
<span class="right-circle-bracket">)</span>
2018-10-10 11:00:35 +00:00
</div>
2018-09-18 14:41:21 +00:00
<?js if(data.returns) { ?>
2018-09-19 10:40:04 +00:00
<?js // console.log(JSON.stringify(data.returns,true,3)) ?>
2018-09-18 14:41:21 +00:00
<?js var rets = data.returns[0].type.names[0]; ?>
2018-10-10 11:00:35 +00:00
<div class="returns off-font ib">
2018-09-18 14:41:21 +00:00
<span class="arrow"> → </span>
<span class="left-figure-bracket">{</span>
<span class="name"><?js= this.linkto(rets) ?></span>
2018-09-18 14:41:21 +00:00
<span class="right-figure-bracket">}</span>
2018-10-10 11:00:35 +00:00
</div>
2018-09-18 12:17:34 +00:00
<?js } ?>
2018-09-18 14:41:21 +00:00
</div>