diff --git a/README.md b/README.md index ca9adde9..57634b8d 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,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/codeview -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=docs fabric.js src/ src/util/ ### Demos diff --git a/dist/all.js b/dist/all.js index 88c414d0..e246eedc 100644 --- a/dist/all.js +++ b/dist/all.js @@ -1736,6 +1736,13 @@ fabric.util.string = { capitalize: capitalize }; if (!Function.prototype.bind) { + /** + * Cross-browser approximation of ES5 Function.prototype.bind (not fully spec conforming) + * @see Function#bind on MDN + * @param {Object} thisArg Object to bind function to + * @param {Any[]} [...] Values to pass to a bound function + * @return {Function} + */ Function.prototype.bind = function(thisArg) { var fn = this, args = slice.call(arguments, 1); return args.length @@ -1842,13 +1849,16 @@ if (!Function.prototype.bind) { }; })(); + /** @ignore */ var getElement, setElement; (function () { var elements = { }; + /** @ignore */ getElement = function (uid) { return elements[uid]; }; + /** @ignore */ setElement = function (uid, element) { elements[uid] = element; }; @@ -2050,6 +2060,14 @@ if (!Function.prototype.bind) { })(this); (function () { + /** + * Cross-browser wrapper for setting element's style + * @method setStyle + * @memberOf fabric.util + * @param {HTMLElement} element + * @param {Object} styles + * @return {HTMLElement} Element that was passed as a first argument + */ function setStyle(element, styles) { var elementStyle = element.style, match; if (typeof styles === 'string') { @@ -2078,6 +2096,8 @@ if (!Function.prototype.bind) { view = document.defaultView, supportsGCS = view && typeof view.getComputedStyle !== 'undefined', reOpacity = /alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/, + + /** @ignore */ setOpacity = function (element) { return element; }; if (supportsOpacity) { @@ -2108,10 +2128,24 @@ if (!Function.prototype.bind) { fabric.util.setStyle = setStyle; })(); +/** + * Takes id and returns an element with that id (if one exists in a document) + * @method getById + * @memberOf fabric.util + * @param {String|HTMLElement} id + * @return {HTMLElement|null} + */ function getById(id) { return typeof id === 'string' ? document.getElementById(id) : id; } +/** + * Converts an array-like object (e.g. arguments or NodeList) to an array + * @method toArray + * @memberOf fabric.util + * @param {Object} arrayLike + * @return {Array} + */ function toArray(arrayLike) { var arr = [ ], i = arrayLike.length; while (i--) { @@ -2120,6 +2154,14 @@ function toArray(arrayLike) { return arr; } +/** + * Creates specified element with specified attributes + * @method makeElement + * @memberOf fabric.util + * @param {String} tagName Type of an element to create + * @param {Object} [attributes] Attributes to set on an element + * @return {HTMLElement} Newly created element + */ function makeElement(tagName, attributes) { var el = document.createElement(tagName); for (var prop in attributes) { @@ -2136,12 +2178,28 @@ function makeElement(tagName, attributes) { return el; } +/** + * Adds class to an element + * @method addClass + * @memberOf fabric.util + * @param {HTMLElement} element Element to add class to + * @param {String} className Class to add to an element + */ function addClass(element, className) { if ((' ' + element.className + ' ').indexOf(' ' + className + ' ') === -1) { element.className += (element.className ? ' ' : '') + className; } } +/** + * Wraps element with another element + * @method wrapElement + * @memberOf fabric.util + * @param {HTMLElement} element Element to wrap + * @param {HTMLElement|String} wrapper Element to wrap with + * @param {Object} [attributes] Attributes to set on a wrapper + * @return {HTMLElement} wrapper + */ function wrapElement(element, wrapper, attributes) { if (typeof wrapper === 'string') { wrapper = makeElement(wrapper, attributes); @@ -2153,6 +2211,14 @@ function wrapElement(element, wrapper, attributes) { return wrapper; } +/** + * Returns offset for a given element + * @method getElementOffset + * @function + * @memberOf fabric.util + * @param {HTMLElement} element Element to get offset for + * @return {Object} Object with "left" and "top" properties + */ function getElementOffset(element) { var valueT = 0, valueL = 0; do { @@ -2177,6 +2243,13 @@ function getElementOffset(element) { ? 'KhtmlUserSelect' : ''; + /** + * Makes element unselectable + * @method makeElementUnselectable + * @memberOf fabric.util + * @param {HTMLElement} element Element to make unselectable + * @return {HTMLElement} Element that was passed in + */ function makeElementUnselectable(element) { if (typeof element.onselectstart !== 'undefined') { element.onselectstart = fabric.util.falseFunction; @@ -2193,8 +2266,15 @@ function getElementOffset(element) { fabric.util.makeElementUnselectable = makeElementUnselectable; })(); -(function(){ +(function() { + /** + * Inserts a script element with a given url into a document; invokes callback, when that script is finished loading + * @method getScript + * @memberOf fabric.util + * @param {String} url URL of a script to load + * @param {Function} callback Callback to execute when script is finished loading + */ function getScript(url, callback) { var headEl = document.getElementsByTagName("head")[0], scriptEl = document.createElement('script'), @@ -2231,6 +2311,18 @@ function getElementOffset(element) { } })(); +/** + * Changes value from one to another within certain period of time, invoking callbacks as value is being changed. + * @method animate + * @memberOf fabric.util + * @param {Object} [options] Animation options + * @param {Function} [options.onChange] Callback; invoked on every value change + * @param {Function} [options.onComplete] Callback; invoked when value change is completed + * @param {Number} [options.startValue=0] Starting value + * @param {Number} [options.endValue=100] Ending value + * @param {Function} [options.easing] Easing function + * @param {Number} [options.duration=500] Duration of change + */ function animate(options) { options || (options = { }); var start = +new Date(), @@ -2291,6 +2383,16 @@ fabric.util.animate = animate; function emptyFn() { }; + /** + * Cross-browser abstraction for sending XMLHttpRequest + * @method request + * @memberOf fabric.util + * @param {String} url URL to send XMLHttpRequest to + * @param {Object} [options] Options object + * @param {String} [options.method="GET"] + * @param {Function} options.onComplete Callback to invoke when request is completed + * @return {XMLHttpRequest} request + */ function request(url, options) { options || (options = { }); @@ -5843,6 +5945,7 @@ fabric.util.animate = animate; }, /** + * Returns (dataless) object representation of an instance * @method toDatalessObject */ toDatalessObject: function() { @@ -6943,6 +7046,7 @@ fabric.util.animate = animate; }, /** + * Returns complexity of an instance * @method complexity * @return {Number} complexity */ @@ -6971,6 +7075,7 @@ fabric.util.animate = animate; fabric.Element.ATTRIBUTE_NAMES = 'x1 y1 x2 y2 stroke stroke-width transform'.split(' '); /** + * Returns fabric.Line instance from an SVG element * @static * @method fabric.Line.fromElement * @param {SVGElement} element Element to parse @@ -6989,6 +7094,7 @@ fabric.util.animate = animate; }; /** + * Returns fabric.Line instance from an object representation * @static * @method fabric.Line.fromObject * @param {Object} object Object to create an instance from @@ -7017,7 +7123,10 @@ fabric.util.animate = animate; */ fabric.Circle = fabric.util.createClass(fabric.Object, /** @scope fabric.Circle.prototype */ { - /** @property */ + /** + * @property + * @type String + */ type: 'circle', /** @@ -8121,10 +8230,10 @@ fabric.util.animate = animate; return this.path.length; }, - set: function(prop, value) { - return this.callSuper('set', prop, value); - }, - + /** + * @private + * @method _parsePath + */ _parsePath: function() { var result = [], diff --git a/dist/all.min.js b/dist/all.min.js index d50048ed..8b711f98 100644 --- a/dist/all.min.js +++ b/dist/all.min.js @@ -166,9 +166,9 @@ Object.prototype.toString.call(a)==="[object Array]";if(this.path=e?a:a.match&&a u,x+A,y+u);e=x;n=y;break;case "C":e=c[5];n=c[6];q=c[3];s=c[4];a.bezierCurveTo(c[1]+A,c[2]+u,q+A,s+u,e+A,n+u);break;case "s":x=e+c[3];y=n+c[4];q=2*e-q;s=2*n-s;a.bezierCurveTo(q+A,s+u,e+c[1]+A,n+c[2]+u,x+A,y+u);e=x;n=y;break;case "S":x=c[3];y=c[4];q=2*e-q;s=2*n-s;a.bezierCurveTo(q+A,s+u,c[1]+A,c[2]+u,x+A,y+u);e=x;n=y;break;case "q":e+=c[3];n+=c[4];a.quadraticCurveTo(c[1]+A,c[2]+u,e+A,n+u);break;case "Q":e=c[3];n=c[4];q=c[1];s=c[2];a.quadraticCurveTo(q+A,s+u,e+A,n+u);break;case "T":x=e;y=n;e=c[1];n= c[2];q=-q+2*x;s=-s+2*y;a.quadraticCurveTo(q+A,s+u,e+A,n+u);break;case "a":break;case "A":break;case "z":case "Z":a.closePath();break}}},render:function(a,c){a.save();var e=this.transformMatrix;e&&a.transform(e[0],e[1],e[2],e[3],e[4],e[5]);c||this.transform(a);if(this.overlayFill)a.fillStyle=this.overlayFill;else if(this.fill)a.fillStyle=this.fill;if(this.stroke)a.strokeStyle=this.stroke;a.beginPath();this._render(a);this.fill&&a.fill();if(this.stroke){a.strokeStyle=this.stroke;a.lineWidth=this.strokeWidth; a.lineCap=a.lineJoin="round";a.stroke()}if(!c&&this.active){this.drawBorders(a);this.hideCorners||this.drawCorners(a)}a.restore()},toString:function(){return"#"},toObject:function(){var a=l(this.callSuper("toObject"),{path:this.path});if(this.sourcePath)a.sourcePath=this.sourcePath;if(this.transformMatrix)a.transformMatrix=this.transformMatrix;return a},toDatalessObject:function(){var a=this.toObject();if(this.sourcePath)a.path= -this.sourcePath;delete a.sourcePath;return a},complexity:function(){return this.path.length},set:function(a,c){return this.callSuper("set",a,c)},_parsePath:function(){for(var a=[],c,e,n=0,q=this.path.length;n - - - -This is a custom SVG webfont generated by Font Squirrel. -Foundry URL : http://mplus-fonts.sourceforge.jp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/css/fonts/mplus-1m-bold-webfont.ttf b/docs/css/fonts/mplus-1m-bold-webfont.ttf deleted file mode 100644 index 0cf54cbb..00000000 Binary files a/docs/css/fonts/mplus-1m-bold-webfont.ttf and /dev/null differ diff --git a/docs/css/fonts/mplus-1m-bold-webfont.woff b/docs/css/fonts/mplus-1m-bold-webfont.woff deleted file mode 100644 index f90475d8..00000000 Binary files a/docs/css/fonts/mplus-1m-bold-webfont.woff and /dev/null differ diff --git a/docs/css/fonts/mplus-1m-regular-webfont.eot b/docs/css/fonts/mplus-1m-regular-webfont.eot deleted file mode 100644 index a53f8b54..00000000 Binary files a/docs/css/fonts/mplus-1m-regular-webfont.eot and /dev/null differ diff --git a/docs/css/fonts/mplus-1m-regular-webfont.svg b/docs/css/fonts/mplus-1m-regular-webfont.svg deleted file mode 100644 index 3c835a31..00000000 --- a/docs/css/fonts/mplus-1m-regular-webfont.svg +++ /dev/null @@ -1,134 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Foundry URL : http://mplus-fonts.sourceforge.jp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/css/fonts/mplus-1m-regular-webfont.ttf b/docs/css/fonts/mplus-1m-regular-webfont.ttf deleted file mode 100644 index 684abfd1..00000000 Binary files a/docs/css/fonts/mplus-1m-regular-webfont.ttf and /dev/null differ diff --git a/docs/css/fonts/mplus-1m-regular-webfont.woff b/docs/css/fonts/mplus-1m-regular-webfont.woff deleted file mode 100644 index 49585d82..00000000 Binary files a/docs/css/fonts/mplus-1m-regular-webfont.woff and /dev/null differ diff --git a/docs/css/handheld.css b/docs/css/handheld.css deleted file mode 100644 index 529bebb8..00000000 --- a/docs/css/handheld.css +++ /dev/null @@ -1,207 +0,0 @@ -/* - * TABLE OF CONTENTS: - * - Browser reset - * - HTML elements - * - JsDoc styling - * - Media query check - */ - - - - - - -/* - * HTML ELEMENTS - */ - -body { - padding: 1% 4% 1% 4%; -} - -/* - * HTML ELEMENTS - */ - - - - - -/* - * BEGIN JSDOC - */ - -/* Start menu */ -div.index div.menu { - position: fixed; - top: 0; - right: 0; - -moz-border-radius-bottomleft: 15px; - -webkit-border-bottom-left-radius: 15px; - -border-bottom-left-radius: 15px; - padding: 4px 5px 8px 10px; - -moz-box-shadow: 0px 0px 10px #c4c4c4; - -webkit-box-shadow: 0px 0px 10px #c4c4c4; - box-shadow: 0px 0px 10px #c4c4c4; - background-color: rgba(255, 255, 255, 0.9); -} - -div.index div.indexLinks a { - float: right; - clear: both; - font-size: 1.1em; -} - -div.index *.heading1 { - display:none; -} - -div.index ul.classList { - display:none; -} - -div.index div.fineprint { - display:none; -} - -div.indexStatic { - display: none; -} -/* End menu */ - - - -/* Start content */ -div.content *.classTitle { - margin-right: 60px; - margin-bottom: 0.8em; - font-size: 2em -} - -div.content p.description.summary { - margin-bottom: 0.2em; -} - -div.content div.props { - margin: 1.5em -2% 0 -2%; - padding: 2%; -} - -table.summaryTable { - position: relative; - left: -10px; - width: 100%; - border-collapse: collapse; - box-sizing: content-box; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - -ms-box-sizing: content-box; - -o-box-sizing: content-box; - -icab-box-sizing: content-box; - -khtml-box-sizing: content-box; -} - -table.summaryTable caption { - padding: 0 10px 10px 10px; -} - -table.summaryTable td, -table.summaryTable th { - padding: 0px 10px 10px 10px; -} -table.summaryTable tr:last-child td { - padding-bottom: 0; -} - -table.summaryTable td.attributes { - width: 35%; -} - -table.summaryTable td.nameDescription { - width: 65% -} - - - -dl.detailList { - margin-top: 0.5em; -} - -dl.detailList.nomargin + dl.detailList.nomargin { - margin-top: 0; -} - -dl.detailList dt { - display: inline; - margin-right: 5px; -} - -dl.detailList dt:before { - display: block; - content: ""; -} - -dl.detailList dd { - display: inline; -} - -dl.detailList.params dt { - display: block; -} -dl.detailList.params dd { - display: block; - padding-left: 2em; - padding-bottom: 0.4em; -} - - - - -ul.fileList li { - margin-bottom: 1.5em; -} - - - -.fixedFont.heading { - margin-bottom: 0.5em; -} - -pre.code { - margin: 10px 0 10px 0; - padding: 10px; - border: 1px solid #ccc; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; -} -/* End content */ - -/* - * END JSDOC - */ - - - - - - - -/* - * START MEDIA QUERY CHECK - */ - -.cssLoadCheck { - position: absolute; - top: -99999px; - left: -99999px; - border: 0; - width: 100px; - padding: 0; - overflow: hidden; -} - -/* - * END MEDIA QUERY CHECK - */ - diff --git a/docs/css/screen.css b/docs/css/screen.css deleted file mode 100644 index 786765a2..00000000 --- a/docs/css/screen.css +++ /dev/null @@ -1,280 +0,0 @@ -/* - * TABLE OF CONTENTS: - * - JsDoc styling - * - Media query check - */ - - - - - - -/* - * BEGIN JSDOC - */ - -/* Start menu */ -div.index { - position: fixed; - top: 0; - bottom: 0; - float: left; - width: 30%; - min-width: 100px; - max-width: 300px; - padding: 0 0 10px 0; - overflow: auto; -} - -div.index *.heading1 { - padding: 8px 0 0.4em 0; -} - -div.index div.menu { - margin: 0 15px 0 -15px; - -moz-border-radius-bottomright: 15px; - -webkit-border-bottom-right-radius: 15px; - -border-bottom-right-radius: 15px; - padding: 15px 15px 15px 30px; - -moz-box-shadow: 0px 0px 10px #c4c4c4; - -webkit-box-shadow: 0px 0px 10px #c4c4c4; - box-shadow: 0px 0px 10px #c4c4c4; - background-color: rgba(255, 255, 255, 0.5); -} - -div.index div.indexLinks { - margin-top: 13px; - position: absolute; - right: 30px; -} - -div.index div.indexLinks a { - color: #999999; - text-transform: lowercase; -} - -div.index div.indexLinks a:first-child { - margin-right: 3px; - border-right: 1px solid #999999; - padding-right: 5px; -} - -div.index ul.classList a { - line-height: 1.1em; - font-family: Consolas, "Courier New", Courier, monospace; -} - -div.index ul.classList a + a { - margin-left: 0.5em; -} - -div.index div.fineprint { - margin: 1em 0 0 15px; - color: #777; - font-size: 0.9em; -} - -div.index div.fineprint a { - color: #777; -} - -div.indexStatic { - position: static; - min-height: 1em; -} -/* End menu */ - - -/* Start content */ -div.content { - float: left; - width: 70%; - min-width: 300px; - max-width: 600px; -} -div.innerContent { - padding: 0 0 0 2.5em; -} - -div.content ul, -div.content ol { - margin-bottom: 3em; -} - -div.content *.classTitle { - position: relative; - left: -10px; - margin: -30px 0 0.5em 0; - -moz-border-radius: 15px; - -webkit-border-radius: 15px; - border-radius: 15px; - padding: 25px 15px 15px 15px; - background-color: #FFFFFF; - background-color: rgba(255, 255, 255, 0.5); - -moz-box-shadow: 0px 0px 10px #c4c4c4; - -webkit-box-shadow: 0px 0px 10px #c4c4c4; - box-shadow: 0px 0px 10px #c4c4c4; -} - -div.content p.summary { - margin-bottom: 0.5em; -} - -div.content ul.summary { - margin-bottom: 1.5em; -} - -div.content ul *.classname a, -div.content ul *.filename a { - font-family: Consolas, "Courier New", Courier, monospace; - text-decoration: none; - font-weight: bold; -} -div.content ul *.classname a:hover, -div.content ul *.filename a:hover { - text-decoration: underline; -} - -div.content div.props { - position: relative; - left: -10px; - margin-bottom: 2.5em; - padding: 10px 15px 15px 15px; - overflow: hidden; -} - -div.content div.props div.sectionTitle { - padding-bottom: 10px; -} - -div.content div.hr { - margin: 0 10px 0 0; - height: 4em; -} - - - -table.summaryTable { - position: relative; - left: -10px; - width: 100%; - border-collapse: collapse; - box-sizing: content-box; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - -ms-box-sizing: content-box; - -o-box-sizing: content-box; - -icab-box-sizing: content-box; - -khtml-box-sizing: content-box; -} - -table.summaryTable caption { - padding: 0 10px 10px 10px; -} - -table.summaryTable td, -table.summaryTable th { - padding: 0px 10px 10px 10px; -} -table.summaryTable tr:last-child td { - padding-bottom: 0; -} - -table.summaryTable td.attributes { - width: 35%; -} - -table.summaryTable td.nameDescription { - width: 65% -} - - - -dl.detailList { - margin-top: 0.5em; -} - -dl.detailList.nomargin + dl.detailList.nomargin { - margin-top: 0; -} - -dl.detailList dt { - display: inline; - margin-right: 5px; -} - -dl.detailList dt:before { - display: block; - content: ""; -} - -dl.detailList dd { - display: inline; -} - -dl.detailList.params dt { - display: block; -} -dl.detailList.params dd { - display: block; - padding-left: 2em; - padding-bottom: 0.4em; -} - - - - -ul.fileList li { - margin-bottom: 1.5em; -} - - - -.fixedFont.heading { - margin-bottom: 0.5em; -} - -pre.code { - margin: 10px 0 10px 0; - padding: 10px; - border: 1px solid #ccc; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - border-radius: 2px; -} -/* End content */ - -.clear { - clear: both; - width: 100%; - min-height: 0; -} - -/* - * END JSDOC - */ - - - - - - - -/* - * START MEDIA QUERY CHECK - */ - -.cssLoadCheck { - position: absolute; - top: -99999px; - left: -99999px; - border: 0; - width: 100px; - padding: 0; - overflow: hidden; -} - -/* - * END MEDIA QUERY CHECK - */ - diff --git a/docs/files.html b/docs/files.html index 0360ec70..70f7932d 100644 --- a/docs/files.html +++ b/docs/files.html @@ -1,578 +1,628 @@ - + JsDoc Reference - File Index - - - - - - - - - + -
- + +
+

File Index

-
+ +
+

fabric.js

- Generated by JsDoc Toolkit 2.4.0 on Fri Oct 15 2010 13:14:02 GMT-0400 (EDT)
- HTML template: Codeview 1.1.1 +
+ + + + +
-
-
- -
-
-

File Index

+
+ +
+

src/circle.class.js

- +
+
+ +
+

src/color.class.js

+ +
+ + + + +
+
+
+ +
+

src/element.class.js

+ +
+ + + + +
+
+
+ +
+

src/ellipse.class.js

+ +
+ + + + +
+
+
+ +
+

src/group.class.js

+ +
+ + + + +
+
+
+ +
+

src/image.class.js

+ +
+ + + + +
+
+
+ +
+

src/intersection.class.js

+ +
+ + + + +
+
+
+ +
+

src/line.class.js

+ +
+ + + + +
+
+
+ +
+

src/object.class.js

+ +
+ + + + +
+
+
+ +
+

src/parser.js

+ +
+ + + + +
+
+
+ +
+

src/path.class.js

+ +
+ + + + +
+
+
+ +
+

src/path_group.class.js

+ +
+ + + + +
+
+
+ +
+

src/point.class.js

+ +
+ + + + +
+
+
+ +
+

src/polygon.class.js

+ +
+ + + + +
+
+
+ +
+

src/polyline.class.js

+ +
+ + + + +
+
+
+ +
+

src/rect.class.js

+ +
+ + + + +
+
+
+ +
+

src/scout.js

+ +
+ + + + +
+
+
+ +
+

src/text.class.js

+ +
+ + + + +
+
+
+ +
+

src/triangle.class.js

+ +
+ + + + +
+
+
+ +
+

src/util.js

+ +
+ + + + +
+
+
+ +
+

src/util/dom_event.js

+ +
+ + + + +
+
+
+ +
+

src/util/dom_misc.js

+ +
+ + + + +
+
+
+ +
+

src/util/dom_request.js

+ +
+ + + + +
+
+
+ +
+

src/util/dom_style.js

+ +
+ + + + +
+
+
+ +
+

src/util/lang_array.js

+ +
+ + + + +
+
+
+ +
+

src/util/lang_class.js

+ +
+ + + + +
+
+
+ +
+

src/util/lang_function.js

+ +
+ + + + +
+
+
+ +
+

src/util/lang_object.js

+ +
+ + + + +
+
+
+ +
+

src/util/lang_string.js

+ +
+ + + + +
+
+
+ +
+

src/util/misc.js

+ +
+ + + + +
+
+
+ + +
+
+ + Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 19 2010 16:02:48 GMT-0400 (EDT)
- - \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 2d703730..f217849a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,242 +1,418 @@ - + + JsDoc Reference - Index - - - - - - - - - + -
- -
-
-
-

Class Index

+
+

Class Index

+ + +
+

_global_

-
+
+ +
+

Array

+ +
+
+ +
+

fabric

+ +
+
+ +
+

fabric.Circle

+ Circle +
+
+ +
+

fabric.Color

+ Color +
+
+ +
+

fabric.Element

+ fabric.Element +
+
+ + +
+ +
+

fabric.Ellipse

+ Ellipse +
+
+ +
+

fabric.Group

+ Group +
+
+ +
+

fabric.Image

+ Image +
+
+ +
+

fabric.Intersection

+ Intersection +
+
+ +
+

fabric.Line

+ Line +
+
+ +
+

fabric.Object

+ Object +
+
+ +
+

fabric.Path

+ Path +
+
+ +
+

fabric.PathGroup

+ PathGroup +
+
+ +
+

fabric.Point

+ +
+
+ +
+

fabric.Polygon

+ Polygon +
+
+ +
+

fabric.Polyline

+ Polyline +
+
+ +
+

fabric.Rect

+ Rect +
+
+ +
+

fabric.Text

+ Text +
+
+ +
+

fabric.Triangle

+ Triangle +
+
+ +
+

fabric.util

+ +
+
+ + +
+ +
+

fabric.util.object

+ fabric.util.object +
+
+ + +
+ +
+

Function

+ +
+
+ +
+

String

+ +
+
+ + +
+
+ + Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 19 2010 16:02:48 GMT-0400 (EDT)
- - \ No newline at end of file diff --git a/docs/javascript/wbos.csstools.mediaqueryfallback.js b/docs/javascript/wbos.csstools.mediaqueryfallback.js deleted file mode 100644 index 6caf5bf5..00000000 --- a/docs/javascript/wbos.csstools.mediaqueryfallback.js +++ /dev/null @@ -1,185 +0,0 @@ -/** - * @fileOverview Media Query FallBack - * @author Wouter Bos (www.thebrightlines.com) - * @since 1.0 - 2010-09-10 - * @version 1.0 - 2010-09-10 - */ - - - - - - -if (typeof(wbos) == "undefined") { - /** - * @namespace wbos = Wouter Bos (www.thebrightlines.com) - */ - wbos = {} -} -if (typeof(wbos.CssTools) == "undefined") { - /** - * @namespace Namespace for CSS-related functionality - */ - wbos.CssTools = {} -} - - - - -/** - * @namespace Fallback for CSS advanced media query - * @class - * @since 1.0 - 2010-09-10 - * @version 1.0 - 2010-09-10 - */ -wbos.CssTools.MediaQueryFallBack = ( function() { - var config = { - cssScreen: "/css/screen.css", - cssHandheld: "/css/handheld.css", - mobileMaxWidth: 660, - testDivClass: "cssLoadCheck", - dynamicCssLinkId: "DynCssLink", - resizeDelay: 30 - } - var noMediaQuery = false; - var delay; - var currentCssMediaType; - - // Adding events to elements in the DOM without overwriting it - function addEvent(element, newFunction, eventType) { - var oldEvent = eval("element." + eventType); - var eventContentType = eval("typeof element." + eventType) - - if ( eventContentType != 'function' ) { - eval("element." + eventType + " = newFunction") - } else { - eval("element." + eventType + " = function(e) { oldEvent(e); newFunction(e); }") - } - } - - // Get the the inner width of the browser window - function getWindowWidth() { - if (window.innerWidth) { - return window.innerWidth; - } else if (document.documentElement.clientWidth) { - return document.documentElement.clientWidth; - } else if (document.body.clientWidth) { - return document.body.clientWidth; - } else{ - return 0; - } - } - - function addCssLink(cssHref) { - var cssNode = document.createElement('link'); - var windowWidth; - cssNode.type = 'text/css'; - cssNode.rel = 'stylesheet'; - cssNode.media = 'screen, handheld, fallback'; - //cssNode.id = config.dynamicCssLinkId; - cssNode.href = cssHref; - document.getElementsByTagName("head")[0].appendChild(cssNode); - } - - - - /* Start public */ - return { - /** - * Adds link to CSS in the head if no CSS is loaded - * - * @since 1.0 - 2010-08-21 - * @version 1.0 - 2010-08-21 - * @param {String|Object} cssScreen URL to CSS file for larger screens - * @param {String|Object} cssHandheld URL to CSS file for smaller screens - * @param {Number} mobileMaxWidth Maximum width for handheld devices - * @example - * wbos.CssTools.MediaQueryFallBack.LoadCss(['screen.css', 'screen2.css'], 'mobile.css', 480) - */ - LoadCss: function(cssScreen, cssHandheld, mobileMaxWidth) { - // Set config values - if (typeof(cssScreen) != "undefined") { - config.cssScreen = cssScreen; - } - if (typeof(cssHandheld) != "undefined") { - config.cssHandheld = cssHandheld; - } - if (typeof(mobileMaxWidth) != "undefined") { - config.mobileMaxWidth = mobileMaxWidth; - } - - // Check if CSS is loaded - var cssloadCheckNode = document.createElement('div'); - cssloadCheckNode.className = config.testDivClass; - document.getElementsByTagName("body")[0].appendChild(cssloadCheckNode); - if (cssloadCheckNode.offsetWidth != 100 && noMediaQuery == false) { - noMediaQuery = true; - } - cssloadCheckNode.parentNode.removeChild(cssloadCheckNode) - - if (noMediaQuery == true) { - // Browser does not support Media Queries, so JavaScript will supply a fallback - var cssHref = ""; - - // Determines what CSS file to load - if (getWindowWidth() <= config.mobileMaxWidth) { - cssHref = config.cssHandheld; - newCssMediaType = "handheld"; - } else { - cssHref = config.cssScreen; - newCssMediaType = "screen"; - } - - // Add CSS link to of page - if (cssHref != "" && currentCssMediaType != newCssMediaType) { - var currentCssLinks = document.styleSheets - for (var i = 0; i < currentCssLinks.length; i++) { - for (var ii = 0; ii < currentCssLinks[i].media.length; ii++) { - if (typeof(currentCssLinks[i].media) == "object") { - if (currentCssLinks[i].media.item(ii) == "fallback") { - currentCssLinks[i].ownerNode.parentNode.removeChild(currentCssLinks[i].ownerNode) - i-- - break; - } - } else { - if (currentCssLinks[i].media.indexOf("fallback") >= 0) { - currentCssLinks[i].owningElement.parentNode.removeChild(currentCssLinks[i].owningElement) - i-- - break; - } - } - } - } - if (typeof(cssHref) == "object") { - for (var i = 0; i < cssHref.length; i++) { - addCssLink(cssHref[i]) - } - } else { - addCssLink(cssHref) - } - - currentCssMediaType = newCssMediaType; - } - - - // Check screen size again if user resizes window - addEvent(window, wbos.CssTools.MediaQueryFallBack.LoadCssDelayed, 'onresize') - } - }, - - /** - * Runs LoadCSS after a short delay - * - * @since 1.0 - 2010-08-21 - * @version 1.0 - 2010-08-21 - * @example - * wbos.CssTools.MediaQueryFallBack.LoadCssDelayed() - */ - LoadCssDelayed: function() { - clearTimeout(delay); - delay = setTimeout( "wbos.CssTools.MediaQueryFallBack.LoadCss()", config.resizeDelay) - } - - } - /* End public */ -})(); diff --git a/docs/symbols/Array.html b/docs/symbols/Array.html index d4ff8b2f..e5b5b5fe 100644 --- a/docs/symbols/Array.html +++ b/docs/symbols/Array.html @@ -1,4 +1,5 @@ - + @@ -6,575 +7,690 @@ JsDoc Reference - Array - - - - - - - + + + + -
- -
- -
-
-

+ + +

+ + + + + + + + + + + + + + + + + + + + - Built-In Namespace Array - - -

+

+ + + -

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method Summary
Method AttributesMethod Name and Description
  +
every(fn, context) +
+
+
  +
filter(fn, context) +
+
+
  +
forEach(fn, context) +
+
+
  +
indexOf(value, from) +
+
+
  +
map(fn, context) +
+
+
  +
reduce(fn) +
+
+
  +
some(fn, context) +
+
+
+ + + + + + - - + + - + + + + +
+ Method Detail +
- - - + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
every(fn, context) -
-
-
  -
filter(fn, context) -
-
-
  -
forEach(fn, context) -
-
-
  -
indexOf(value, from) -
-
-
  -
map(fn, context) -
-
-
  -
reduce(fn) -
-
-
  -
some(fn, context) -
-
-
-
+ every(fn, context) - - - - - - - - - - - - - - - -
-
-
- Method Detail -
- - - - -
- - - - - - - every(fn, context) -
- -
- - - -
- Defined in: lang_array.js. - - - -
- - - - -
-
Parameters:
- -
- fn - -
-
- -
- context - -
-
- -
- - - - -
- - - -
- - - - - - - filter(fn, context) -
- -
- - - -
- Defined in: lang_array.js. - - - -
- - - - -
-
Parameters:
- -
- fn - -
-
- -
- context - -
-
- -
- - - - -
- - - -
- - - - - - - forEach(fn, context) -
- -
- - - -
- Defined in: lang_array.js. - - - -
- - - - -
-
Parameters:
- -
- fn - -
-
- -
- context - -
-
- -
- - - - -
- - - -
- - - - - - - indexOf(value, from) -
- -
- - - -
- Defined in: lang_array.js. - - - -
- - - - -
-
Parameters:
- -
- value - -
-
- -
- from - -
-
- -
- - - - -
- - - -
- - - - - - - map(fn, context) -
- -
- - - -
- Defined in: lang_array.js. - - - -
- - - - -
-
Parameters:
- -
- fn - -
-
- -
- context - -
-
- -
- - - - -
- - - -
- - - - - - - reduce(fn) -
- -
- - - -
- Defined in: lang_array.js. - - - -
- - - - -
-
Parameters:
- -
- fn - -
-
- -
- - - - -
- - - -
- - - - - - - some(fn, context) -
- -
- - - -
- Defined in: lang_array.js. - - - -
- - - - -
-
Parameters:
- -
- fn - -
-
- -
- context - -
-
- -
- - - - - - -
+
+ + +
+ Defined in: lang_array.js. + + +
+ + + + +
+
Parameters:
+ +
+ fn + +
+
+ +
+ context + +
+
+ +
+ + + + + + + + +
+ +
+ + + filter(fn, context) + +
+
+ + +
+ Defined in: lang_array.js. + + +
+ + + + +
+
Parameters:
+ +
+ fn + +
+
+ +
+ context + +
+
+ +
+ + + + + + + + +
- + +
+ + + forEach(fn, context) + +
+
+ + +
+ Defined in: lang_array.js. + + +
+ + + + +
+
Parameters:
+ +
+ fn + +
+
+ +
+ context + +
+
+ +
+ + + + + + + + +
-
+ +
+ + + indexOf(value, from) + +
+
+ + +
+ Defined in: lang_array.js. + + +
+ + + + +
+
Parameters:
+ +
+ value + +
+
+ +
+ from + +
+
+ +
+ + + + + + + + +
+ + +
+ + + map(fn, context) + +
+
+ + +
+ Defined in: lang_array.js. + + +
+ + + + +
+
Parameters:
+ +
+ fn + +
+
+ +
+ context + +
+
+ +
+ + + + + + + + +
+ + +
+ + + reduce(fn) + +
+
+ + +
+ Defined in: lang_array.js. + + +
+ + + + +
+
Parameters:
+ +
+ fn + +
+
+ +
+ + + + + + + + +
+ + +
+ + + some(fn, context) + +
+
+ + +
+ Defined in: lang_array.js. + + +
+ + + + +
+
Parameters:
+ +
+ fn + +
+
+ +
+ context + +
+
+ +
+ + + + + + + + + + + + + + + +

+ - + +
+ + Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 19 2010 16:02:46 GMT-0400 (EDT) +
diff --git a/docs/symbols/Function.html b/docs/symbols/Function.html index 99f991c6..eb8021d6 100644 --- a/docs/symbols/Function.html +++ b/docs/symbols/Function.html @@ -1,4 +1,5 @@ - + @@ -6,265 +7,386 @@ JsDoc Reference - Function - - - - - - - + + + + -
- -
- -
-
-

+ + +

+ + + + + + + + + + + + + + + + + + + + - Built-In Namespace Function - - -

- -

- - - - - - - - - - - - -
-
Method Summary
Method AttributesMethod Name and Description
- - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
bind(thisArg) -
-
Cross-browser approximation of ES5 Function.prototype.bind (not fully spec conforming)
-
-

- - - - - - - - - - - - - - - - -
-
-
- Method Detail -
- - - - -
- - - - - {Function} - - bind(thisArg) + +   + +
bind(thisArg)
- -
- Cross-browser approximation of ES5 Function.prototype.bind (not fully spec conforming) - - -
- Defined in: lang_function.js. - - - -
- - - - -
-
Parameters:
- -
- {Object} thisArg - -
-
Object to bind function to
- -
- {Any[]} ... - Optional -
-
Values to pass to a bound function
- -
- - - -
- - - - - - - - -
Returns:
- -
{Function}
- - - - - - -
See:
- -
Function#bind on MDN
- - - -
- +
Cross-browser approximation of ES5 Function.prototype.bind (not fully spec conforming)
+ + + + + + + + + + + - - -
+ + + + + + + + +
+ Method Detail +
+ + +
+ + {Function} + bind(thisArg) +
+
+ Cross-browser approximation of ES5 Function.prototype.bind (not fully spec conforming) + +
+ Defined in: lang_function.js. + + +
+ + + + +
+
Parameters:
+ +
+ {Object} thisArg + +
+
Object to bind function to
+ +
+ {Any[]} ... + Optional +
+
Values to pass to a bound function
+ +
+ + + + + +
+
Returns:
+ +
{Function}
+ +
+ + + +
+
See:
+ +
Function#bind on MDN
+ +
+ + + - - - -
+ + + + + +
+ - + +
+ + Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 19 2010 16:02:48 GMT-0400 (EDT) +
diff --git a/docs/symbols/String.html b/docs/symbols/String.html index 935d1c56..d03ffda3 100644 --- a/docs/symbols/String.html +++ b/docs/symbols/String.html @@ -1,4 +1,5 @@ - + @@ -6,222 +7,362 @@ JsDoc Reference - String - - - - - - - + + + + -
- -
- -
-
-

+ + +

+ + + + + + + + + + + + + + + + + + + + - Built-In Namespace String - - -

- -

- - - - - - - - - - - - -
-
Method Summary
Method AttributesMethod Name and Description
- - - - - - - - - - - - - - - - - -
Method Summary
Method AttributesMethod Name and Description
  -
trim() -
-
Trims a string (removing whitespace from the beginning and the end)
-
-

- - - - - - - - - - - - - - - - -
-
-
- Method Detail -
- - - - -
- - - - - - - trim() + +   + +
trim()
- -
- Trims a string (removing whitespace from the beginning and the end) - - -
- Defined in: lang_string.js. - - - -
- - - - - - +
Trims a string (removing whitespace from the beginning and the end)
+ + + + + + + + + + + - - -
+ + + + + + + + +
+ Method Detail +
+ + +
+ + + trim() +
+
+ Trims a string (removing whitespace from the beginning and the end) + +
+ Defined in: lang_string.js. + + +
+ + + + + + + + + + +
+
See:
+ +
String#trim on MDN
+ +
+ + + - - - -
+ + + + + +
+ - + +
+ + Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 19 2010 16:02:48 GMT-0400 (EDT) +
diff --git a/docs/symbols/_global_.html b/docs/symbols/_global_.html index 5290caff..c011f907 100644 --- a/docs/symbols/_global_.html +++ b/docs/symbols/_global_.html @@ -1,4 +1,5 @@ - + @@ -6,259 +7,295 @@ JsDoc Reference - _global_ - - - - - - - + + + + -
- -
+ -
-
-

- - Built-In Namespace _global_ -

- -

- -

- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
Field Summary
Field AttributesField Name and Description
  -
- fabric -
-
-
  -
- scout -
-
-
-
- - - - - - - - - - - - - - - - -
-
- -
- Field Detail -
- - - - -
- - - - - - - fabric -
- -
- - -
- Defined in: parser.js. - - - -
- - - - - -
- - - -
- - - - - - - scout -
- -
- - -
- Defined in: scout.js. - - - -
- - - - - - - -
-
- - - - - - - -
+ +
+ + Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 19 2010 16:02:46 GMT-0400 (EDT)
- - diff --git a/docs/symbols/fabric.Circle.html b/docs/symbols/fabric.Circle.html index 5d147bd7..52970c33 100644 --- a/docs/symbols/fabric.Circle.html +++ b/docs/symbols/fabric.Circle.html @@ -1,4 +1,5 @@ - + @@ -6,690 +7,719 @@ JsDoc Reference - fabric.Circle - - - - - - - + + + + -
-