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

50 lines
1.7 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 ? data.access : data.scope) ?></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= this.linkto(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 // console.log(JSON.stringify(data.returns,true,3)) ?>
<?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= this.linkto(rets) ?></span>
<span class="right-figure-bracket">}</span>
</span>
<?js } ?>
</div>