initi.doc/templates/initi/tmpl/method_list.tmpl

50 lines
1.7 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"> <?js= data.access ?></span>
<span class="name"><a href="#<?js= data.id ?>"><?js= name ?></a></span>
<span class="params">
<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];
?>
<span class="param">
<span class="type">
<span class="left-quad-bracket">[ </span>
2018-09-19 14:14:17 +00:00
<span class="name"><?js= this.linkto(type, type) ?></span>
2018-09-18 14:41:21 +00:00
<span class="right-quad-bracket"> ]</span>
</span>
2018-09-19 10:25:01 +00:00
<span class="name"><?js= param.name ?></span><?js if(a < data.params.length - 1) { ?>,<?js } ?>
2018-09-18 14:41:21 +00:00
</span>
<?js
a++;
}
}
?>
<span class="right-circle-bracket">)</span>
</span>
<?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]; ?>
<span class="returns">
<span class="arrow"> → </span>
<span class="left-figure-bracket">{</span>
2018-09-19 14:14:17 +00:00
<span class="name"><?js= this.linkto(rets, rets) ?></span>
2018-09-18 14:41:21 +00:00
<span class="right-figure-bracket">}</span>
</span>
2018-09-18 12:17:34 +00:00
<?js } ?>
2018-09-18 14:41:21 +00:00
</div>