Add google closure compiler and explain how to minify fabric.js with it. Fix few omissions in jsdoc comments.

This commit is contained in:
kangax 2010-07-26 00:48:26 -04:00
parent fa757b1717
commit 9f77d3a0a5
7 changed files with 15 additions and 8 deletions

View file

@ -36,7 +36,11 @@ Fabric.js started as a foundation for design editor on [printio.ru](http://print
3. Create a minified distribution file
# Using YUICompressor
$ java -jar lib/yuicompressor-2.4.2.jar dist/all.js -o dist/all.min.js
# or Google Closure Compiler
$ java -jar lib/google_closure_compiler.jar --js dist/all.js --js_output_file dist/all.min.js
### Examples of use

8
dist/all.js vendored
View file

@ -1419,7 +1419,9 @@ fabric.util.animate = animate;
memo.push({ x: parseFloat(pair[0]), y: parseFloat(pair[1]) });
return memo;
}, [ ]);
if (parsedPoints.length % 2 !== 0) {
return null;
}
return parsedPoints;
};
@ -6764,7 +6766,7 @@ fabric.util.animate = animate;
/**
* @static
* @method fabric.PathGroup.fromObject
* @param {Object}
* @param {Object} object
* @return {fabric.PathGroup}
*/
fabric.PathGroup.fromObject = function(object) {
@ -7452,8 +7454,8 @@ fabric.util.animate = animate;
* Width and height have to mantain the same proportion in the final image as it was in the initial one.
* @method getNormalizedSize
* @param {Object} oImg
* @param {Number} maximum width of the image in px
* @param {Number} maximum height of the image in px
* @param {Number} maxwidth maximum width of the image in px
* @param {Number} maxheight maximum height of the image in px
*/
getNormalizedSize: function(oImg, maxwidth, maxheight) {
if (maxheight && maxwidth && (oImg.width > oImg.height && (oImg.width / oImg.height) < (maxwidth / maxheight))) {

2
dist/all.min.js vendored

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -65,8 +65,8 @@
* Width and height have to mantain the same proportion in the final image as it was in the initial one.
* @method getNormalizedSize
* @param {Object} oImg
* @param {Number} maximum width of the image in px
* @param {Number} maximum height of the image in px
* @param {Number} maxwidth maximum width of the image in px
* @param {Number} maxheight maximum height of the image in px
*/
getNormalizedSize: function(oImg, maxwidth, maxheight) {
if (maxheight && maxwidth && (oImg.width > oImg.height && (oImg.width / oImg.height) < (maxwidth / maxheight))) {

View file

@ -211,9 +211,10 @@
memo.push({ x: parseFloat(pair[0]), y: parseFloat(pair[1]) });
return memo;
}, [ ]);
// odd number of points is an error
if (parsedPoints.length % 2 !== 0) {
// return null;
return null;
}
return parsedPoints;
};

View file

@ -194,7 +194,7 @@
/**
* @static
* @method fabric.PathGroup.fromObject
* @param {Object}
* @param {Object} object
* @return {fabric.PathGroup}
*/
fabric.PathGroup.fromObject = function(object) {