mozilla

Template:JP Method

<h3 class="method" id="{{if ($id!=null){$id} else {$name}}}"><a name="{{if ($id!=null) {$id} else {$name}}}" /><span class="method-name"><span class="script">$name</span></span>(<span class="script">buf = [];foreach(var param in $params){buf += ['<b class="param-name">'+param.name+'</b> as '+(param.required?"":"optional ")+'<i class="param-type">'+param.type+'</i>']};paramList = web.html(""+string.join(buf,", ")+"");paramList </span>) returnsĀ <span class="method-type"><span class="script">$type</span></span></h3>
<div class="label"><strong>Description</strong></div>
<div class="description"><span class="script">web.html(""+$description+"")</span></div>
<div><span class="script">buf = [];buf += ['<ul class="params-descr">'];foreach(var param in $params){buf += [' <li class="param-descr"><b class="param-descr-label">'+param.name+'</b>. <i class="param-descr-body">'+param.description+'</i></li>']};buf += ['</ul>'];paramDescrs = web.html(""+string.join(buf,"")+""); paramDescrs</span></div>
<div><span class="script">if ($params[0]["properties"] != null){props = $params[0].properties;buf = [];buf += ['<h4>Properties of <i>'+$params[0].name+'</i></h4><table style="width: auto;" class="standard-table"><tbody><tr><th>Property Name</th><th>Property Type</th><th>Required?</th><th>Default Value</th><th>Description</th><tr>'];foreach(var prop in props){buf += ['<tr><td>'+prop.name+'</td><td>'+prop.type+'</td><td>'+(prop.required?"Required":"Optional")+'</td><td>'+(prop.required?"n/a":prop.default)+'</td><td>'+prop.description+'</td></tr>']};buf += ['<tbody></table>'];paramDescrs = web.html(""+string.join(buf,"")+""); paramDescrs} </span></div>
Search for pages that use Template:JP Method to see example use cases and how many pages use this macro.

Document Tags and Contributors

Contributors to this page: Aza, kurt_cagle
Last updated by: Aza,