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

50 lines
1.8 KiB
Cheetah

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