paper.js/build/jsdoc-toolkit/templates/jsdoc/class.tmpl

125 lines
5 KiB
Cheetah
Raw Normal View History

{! data.classId = data.alias.toLowerCase() !}
{!
var constructors = data.methods.filter(function($){return $.memberOf == data.alias && $.isConstructor});
var ownProperties = data.properties.filter(function($){return $.memberOf == data.alias && !$.isNamespace && !$.isStatic && !$.isConstructor});
var staticProperties = data.properties.filter(function($){return $.memberOf == data.alias && !$.isNamespace && $.isStatic && !$.isConstructor});
var ownMethods = data.methods.filter(function($){return $.memberOf == data.alias && !$.isNamespace && !$.isStatic && !$.isOperator && !$.isConstructor});
var staticMethods = data.methods.filter(function($){return $.memberOf == data.alias && !$.isNamespace && $.isStatic && !$.isOperator && !$.isConstructor});
var operatorMethods = data.methods.filter(function($){return $.memberOf == data.alias && !$.isNamespace && !$.isStatic && !$.isConstructor && $.isOperator});
if (operatorMethods.length) {
var operators = {};
for (var i = 0, l = operatorMethods.length; i < l; i++) {
var operator = operatorMethods[i];
var name = operator.name.replace(/\^[0-9]$/, '');
if (!operators[name])
operators[name] = [];
operators[name].push(operator);
}
}
var inheritedProperties = data.properties.filter(function($) {return $.memberOf != data.alias});
var inheritedMethods = data.methods.filter(function($) {return $.memberOf != data.alias});
var inheritedClasses = {};
var inheritedClassLinks = [];
inheritedProperties.concat(inheritedMethods).map(function($) {
if (!inheritedClasses[$.memberOf]) {
inheritedClassLinks.push(new Link().toSymbol($.memberOf));
inheritedClasses[$.memberOf] = {
className: $.memberOf,
properties: [],
methods: []
};
}
});
for (var i = 0, l = inheritedProperties.length; i < l; i++) {
var symbol = inheritedProperties[i];
inheritedClasses[symbol.memberOf].properties.push(symbol);
}
for (var i = 0, l = inheritedMethods.length; i < l; i++) {
var symbol = inheritedMethods[i];
inheritedClasses[symbol.memberOf].methods.push(symbol);
}
!}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>{+data.alias+}</title>
<base target="classFrame">
<link rel="stylesheet" href="../resources/css/reference.css" type="text/css">
<link rel="stylesheet" href="../resources/css/style.css" type="text/css">
<link rel="stylesheet" href="../resources/css/lighter.css" type="text/css">
<script src="../resources/js/bootstrap.js" type="text/javascript"></script>
<script src="../resources/js/lighter.js" type="text/javascript"></script>
<script src="../resources/js/reference.js" type="text/javascript"></script>
</head>
<body class="reference">
<div class="reference-class">
<h1>{+data.alias+}</h1>
<if test="inheritedClassLinks.length">
<p> Extends {+ inheritedClassLinks.join(', ') +}</p>
</if>
2011-05-27 11:59:31 -04:00
{+processInlineTags(data.classDesc)+}
</div>
<!-- ============================== constructors ========================= -->
<if test="!/(Event|Style)/.test(data.alias) && !data.isNamespace && !data.ignore">
<div class="reference-members"><h2>Constructors</h2>
{+ templates.constructor.process(data) +}
<for each="constructor" in="constructors">
{+ templates.constructor.process(constructor) +}
</for>
</div>
</if>
<!-- ============================== properties ========================= -->
<if test="defined(operators)">
<div class="reference-members"><h2>Operators</h2>
<for each="member" in="operators">
{+ templates.operators.process(member) +}
</for>
</div>
</if>
<if test="defined(ownProperties) && ownProperties.length">
<div class="reference-members"><h2>Properties</h2>
<for each="member" in="ownProperties">
{+ templates.property.process(member) +}
</for>
</div>
</if>
<!-- ============================== method details ========================= -->
<if test="defined(ownMethods) && ownMethods.length">
<div class="reference-members"><h2>Functions</h2>
<for each="member" in="ownMethods">
{+ templates.method.process(member) +}
</for>
</div>
</if>
<if test="defined(staticMethods) && staticMethods.length">
<div class="reference-members"><h2>Static Functions</h2>
<for each="member" in="staticMethods">
{+ templates.method.process(member) +}
</for>
</div>
</if>
<for each="inheritedClass" in="inheritedClasses">
<!-- ============================== properties ========================= -->
<if test="inheritedClass.properties.length">
<div class="reference-members"><h2>Inherited properties from {+ new Link().toSymbol(inheritedClass.className) +}</h2>
<for each="member" in="inheritedClass.properties">
{+ templates.property.process(member) +}
</for>
</div>
</if>
<!-- ============================== properties ========================= -->
<if test="inheritedClass.methods.length">
<div class="reference-members"><h2>Inherited functions from {+ new Link().toSymbol(inheritedClass.className) +}</h2>
<for each="member" in="inheritedClass.methods">
{+ templates.method.process(member) +}
</for>
</div>
</if>
</for>
</body>