Update documentation and fix JSDoc templates.

This commit is contained in:
kangax 2011-09-22 12:40:31 -04:00
parent 5fa051ccb9
commit 19f7736658
9 changed files with 728 additions and 752 deletions

View file

@ -16,4 +16,9 @@ else {
fabric.window = fabric.document.createWindow();
}
/**
* True when in environment that supports touch events
* @property isTouchSupported
* @type boolean
*/
fabric.isTouchSupported = "ontouchstart" in fabric.document.documentElement;

View file

@ -70,7 +70,7 @@ Fabric.js started as a foundation for design editor on [printio.ru](http://print
4. Optionally, you can build documentation
$ java -jar lib/jsdoc-toolkit/jsrun.jar lib/jsdoc-toolkit/app/run.js -a -t=lib/jsdoc-toolkit/templates/jsdoc -d=docs fabric.js src/ src/util/
$ java -jar lib/jsdoc-toolkit/jsrun.jar lib/jsdoc-toolkit/app/run.js -a -t=lib/jsdoc-toolkit/templates/jsdoc -d=site/docs HEADER.js src/ src/util/
### Demos

View file

@ -1,56 +1,50 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}" />
{! Link.base = ""; /* all generated links will be relative to this */ !}
<title>JsDoc Reference - File Index</title>
<meta name="generator" content="JsDoc Toolkit" />
<style type="text/css">
{+include("static/default.css")+}
</style>
</head>
---
layout: default
title: Fabric.js API Reference - File Index
---
<style type="text/css">
{+include("static/default.css")+}
</style>
{+include("static/header.html")+}
<div id="index">
{+publish.classesIndex+}
</div>
<div id="content">
<h1 class="classTitle">File Index</h1>
<body>
{+include("static/header.html")+}
<div id="index">
{+publish.classesIndex+}
</div>
<div id="content">
<h1 class="classTitle">File Index</h1>
<for each="item" in="data">
<div>
<h2>{+new Link().toSrc(item.alias).withText(item.name)+}</h2>
<if test="item.desc">{+resolveLinks(item.desc)+}</if>
<dl>
<if test="item.author">
<dt class="heading">Author:</dt>
<dd>{+item.author+}</dd>
</if>
<if test="item.version">
<dt class="heading">Version:</dt>
<dd>{+item.version+}</dd>
</if>
{! var locations = item.comment.getTag('location').map(function($){return $.toString().replace(/(^\$ ?| ?\$$)/g, '').replace(/^HeadURL: https:/g, 'http:');}) !}
<if test="locations.length">
<dt class="heading">Location:</dt>
<for each="location" in="locations">
<dd><a href="{+location+}">{+location+}</a></dd>
</for>
</if>
</dl>
</div>
<hr />
</for>
</div>
<div class="fineprint" style="clear:both">
<if test="JSDOC.opt.D.copyright">&copy;{+JSDOC.opt.D.copyright+}<br /></if>
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
</div>
</body>
</html>
<for each="item" in="data">
<div>
<h2>{+new Link().toSrc(item.alias).withText(item.name)+}</h2>
<if test="item.desc">{+resolveLinks(item.desc)+}</if>
<dl>
<if test="item.author">
<dt class="heading">Author:</dt>
<dd>{+item.author+}</dd>
</if>
<if test="item.version">
<dt class="heading">Version:</dt>
<dd>{+item.version+}</dd>
</if>
{! var locations = item.comment.getTag('location').map(function($){return $.toString().replace(/(^\$ ?| ?\$$)/g, '').replace(/^HeadURL: https:/g, 'http:');}) !}
<if test="locations.length">
<dt class="heading">Location:</dt>
<for each="location" in="locations">
<dd><a href="{+location+}">{+location+}</a></dd>
</for>
</if>
</dl>
</div>
<hr>
</for>
</div>
<div class="fineprint" style="clear:both">
<if test="JSDOC.opt.D.copyright">&copy;{+JSDOC.opt.D.copyright+}<br></if>
Documentation generated by
<a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a>
{+JSDOC.VERSION+} on {+new Date()+}
</div>

File diff suppressed because it is too large Load diff

View file

@ -1,39 +1,33 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}" />
<title>JsDoc Reference - Index</title>
<meta name="generator" content="JsDoc Toolkit" />
<style type="text/css">
{+include("static/default.css")+}
</style>
</head>
---
layout: default
title: Fabric.js API Reference
---
<style>
{+include("static/default.css")+}
</style>
{+include("static/header.html")+}
<div id="index">
{+publish.classesIndex+}
</div>
<div id="content">
<h1 class="classTitle">Class Index</h1>
<body>
{+include("static/header.html")+}
<div id="index">
{+publish.classesIndex+}
<for each="thisClass" in="data">
<div>
<h2>{+(new Link().toSymbol(thisClass.alias))+}</h2>
{+resolveLinks(summarize(thisClass.classDesc))+}
</div>
<div id="content">
<h1 class="classTitle">Class Index</h1>
<for each="thisClass" in="data">
<div>
<h2>{+(new Link().toSymbol(thisClass.alias))+}</h2>
{+resolveLinks(summarize(thisClass.classDesc))+}
</div>
<hr />
</for>
</div>
<div class="fineprint" style="clear:both">
<if test="JSDOC.opt.D.copyright">&copy;{+JSDOC.opt.D.copyright+}<br /></if>
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
</div>
</body>
</html>
<hr>
</for>
</div>
<div class="fineprint" style="clear:both">
<if test="JSDOC.opt.D.copyright">&copy;{+JSDOC.opt.D.copyright+}<br></if>
Documentation generated by
<a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a>
{+JSDOC.VERSION+} on {+new Date()+}
</div>

View file

@ -1,8 +1,7 @@
/* default.css */
body
#bd-wrapper
{
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
width: 800px;
}
.header
@ -34,8 +33,7 @@ pre.code
border: 1px dashed #ccc;
}
#index
{
#index {
margin-top: 24px;
float: left;
width: 160px;
@ -45,14 +43,12 @@ pre.code
padding: 8px;
}
#content
{
#content {
margin-left: 190px;
width: 600px;
}
.classList
{
.classList {
list-style-type: none;
padding: 0;
margin: 0 0 0 8px;
@ -61,23 +57,20 @@ pre.code
overflow: auto;
}
.classList li
{
.classList li {
padding: 0;
margin: 0 0 8px 0;
}
.summaryTable { width: 100%; }
h1.classTitle
{
h1.classTitle {
font-size:170%;
line-height:130%;
}
h2 { font-size: 110%; }
caption, div.sectionTitle
{
caption, div.sectionTitle {
background-color: #7F8FB1;
color: #fff;
font-size:130%;
@ -89,8 +82,7 @@ caption, div.sectionTitle
div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }
.summaryTable td
{
.summaryTable td {
vertical-align: top;
padding: 4px;
border-bottom: 1px #7F8FB1 solid;
@ -98,30 +90,26 @@ div.sectionTitle { margin-bottom: 8px; }
}
/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
.summaryTable td.attributes {
border-left: 1px #7F8FB1 solid;
width: 140px;
text-align: right;
}
td.attributes, .fixedFont
{
td.attributes, .fixedFont {
line-height: 15px;
color: #002EBE;
font-family: "Courier New",Courier,monospace;
font-size: 13px;
}
.summaryTable td.nameDescription
{
.summaryTable td.nameDescription {
text-align: left;
font-size: 13px;
line-height: 15px;
}
.summaryTable td.nameDescription, .description
{
.summaryTable td.nameDescription, .description {
line-height: 15px;
padding: 4px;
padding-left: 4px;
@ -129,8 +117,7 @@ td.attributes, .fixedFont
.summaryTable { margin-bottom: 8px; }
ul.inheritsList
{
ul.inheritsList {
list-style: square;
margin-left: 20px;
padding-left: 0;
@ -142,21 +129,18 @@ ul.inheritsList
}
.detailList dt { margin-left: 20px; }
.detailList .heading
{
.detailList .heading {
font-weight: bold;
padding-bottom: 6px;
margin-left: 0;
}
.light, td.attributes, .light a:link, .light a:visited
{
.light, td.attributes, .light a:link, .light a:visited {
color: #777;
font-style: italic;
}
.fineprint
{
.fineprint {
text-align: right;
font-size: 10px;
}

View file

@ -22,6 +22,7 @@
fabric.Object = fabric.util.createClass(/** @scope fabric.Object.prototype */ {
/**
* Type of an object (rect, circle, path, etc)
* @property
* @type String
*/

View file

@ -1,7 +1,11 @@
/**
* @namespace
*/
fabric.Observable = {
/**
* @mthod observe
* Observes specified event
* @method observe
* @param {String} eventName
* @param {Function} handler
*/
@ -24,8 +28,8 @@ fabric.Observable = {
},
/**
* @mthod stopObserving
* @memberOf fabric.util
* Stops event observing for a particular event handler
* @method stopObserving
* @param {String} eventName
* @param {Function} handler
*/
@ -40,8 +44,7 @@ fabric.Observable = {
/**
* Fires event with an optional memo object
* @mthod fire
* @memberOf fabric.util
* @method fire
* @param {String} eventName
* @param {Object} [memo]
*/

View file

@ -1,5 +1,8 @@
(function() {
/**
* @namespace
*/
fabric.util = { };
/**