mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-09 06:12:34 -05:00
153 lines
No EOL
5.9 KiB
Cheetah
153 lines
No EOL
5.9 KiB
Cheetah
{! data.classId = data.alias.toLowerCase() !}
|
|
{!
|
|
var ownProperties = data.properties.filter(function($){return $.memberOf == data.alias && !$.isNamespace && !$.isStatic});
|
|
var staticProperties = data.properties.filter(function($){return $.memberOf == data.alias && !$.isNamespace && $.isStatic});
|
|
var ownMethods = data.methods.filter(function($){return $.memberOf == data.alias && !$.isNamespace && !$.isStatic && !$.isOperator});
|
|
var staticMethods = data.methods.filter(function($){return $.memberOf == data.alias && !$.isNamespace && $.isStatic && !$.isOperator});
|
|
var operatorMethods = data.methods.filter(function($){return $.memberOf == data.alias && !$.isNamespace && !$.isStatic && $.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>
|
|
{+processInlineTags(data.classDesc)+}
|
|
</div>
|
|
<!-- ============================== constructors ========================= -->
|
|
<if test="!/(Event|Style)/.test(data.alias)">
|
|
<div class="reference-members"><h2>Constructors</h2>
|
|
<div id="{+data.classId+}" class="member">
|
|
<div id="{+data.classId+}-link" class="member-link">
|
|
<a name="{+data.classId+}" href="#" onClick="return toggleMember('{+data.classId+}', false);"><tt><b>{+ data.alias +}</b>{+ makeSignature(data.params) +}</tt></a>
|
|
</div>
|
|
<div id="{+data.classId+}-description" class="member-description hidden">
|
|
<div class="member-header">
|
|
<div class="member-title">
|
|
<div class="member-link">
|
|
<a href="#" onClick="return toggleMember('{+data.classId+}', false);"><tt><b>{+ data.alias +}</b>{+ makeSignature(data.params) +}</tt></a>
|
|
</div>
|
|
</div>
|
|
<div class="member-close"><input type="button" value="Close" onClick="toggleMember('{+data.classId+}', false);"></div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<div class="member-text">{+processInlineTags(data.desc)+}
|
|
<if test="data.example.length">
|
|
<for each="example" in="data.example">
|
|
<pre>{+example+}</pre>
|
|
</for>
|
|
</if>
|
|
{+ templates.parameters.process(data) +}
|
|
<if test="data.returns.length">
|
|
<ul><b>Returns:</b>
|
|
<li>
|
|
<for each="item" in="data.returns">
|
|
<dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+processInlineTags(item.desc, { stripParagraphs: true })+}</dd>
|
|
</for>
|
|
</li>
|
|
</ul>
|
|
</if>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</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> |