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

49 lines
1.6 KiB
Cheetah

<?js
var data = obj;
var self = this;
//console.log(JSON.stringify(data, true, 3))
?>
<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; }
console.log(JSON.stringify(param,true,3))
var type = param.type.names[0];
?>
<span class="param">
<span class="type">
<span class="left-quad-bracket">[ </span>
<span class="name"><?js= type ?></span>
<span class="right-quad-bracket"> ]</span>
</span>
<span class="name"><?js= param.name ?></span><?js if(a < data.params.length - 1) { ?>,<?js } ?>
</span>
<?js
a++;
}
}
?>
<span class="right-circle-bracket">)</span>
</span>
<?js if(data.returns) { ?>
<?js var rets = data.returns[0].type.names[0]; ?>
<span class="returns">
<span class="arrow"> → </span>
<span class="left-figure-bracket">{</span>
<span class="name"><?js= rets ?></span>
<span class="right-figure-bracket">}</span>
</span>
<?js } ?>
</div>