Moving AMD require on top, after NOT including common JS (#4797)

* fixed amd
This commit is contained in:
Andrea Bogazzi 2018-03-11 09:31:23 -04:00 committed by GitHub
parent b7dc7e1682
commit e27296ca35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 17 deletions

View file

@ -1,10 +1,14 @@
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */
var fabric = fabric || { version: '2.2.0' };
var fabric = fabric || { version: '2.2.1' };
if (typeof exports !== 'undefined') {
exports.fabric = fabric;
}
/* _AMD_START_ */
else if (typeof define === 'function' && define.amd) {
define([], function() { return fabric; });
}
/* _AMD_END_ */
if (typeof document !== 'undefined' && typeof window !== 'undefined') {
fabric.document = document;
fabric.window = window;

View file

@ -89,6 +89,9 @@ function appendFileContents(fileNames, callback) {
fs.readFile(__dirname + '/' + fileName, function (err, data) {
if (err) throw err;
var strData = String(data);
if (fileName === 'src/HEADER.js' && amdLib === false) {
strData = strData.replace(/\/\* _AMD_START_ \*\/[\s\S]*?\/\* _AMD_END_ \*\//g, '');
}
if (noStrict) {
strData = strData.replace(/"use strict";?\n?/, '');
}
@ -235,7 +238,6 @@ var filesToInclude = [
ifSpecifiedInclude('textbox', 'src/shapes/textbox.class.js'),
ifSpecifiedInclude('textbox', 'src/mixins/textbox_behavior.mixin.js'),
ifSpecifiedAMDInclude(amdLib)
];
if (buildMinified) {

14
dist/fabric.js vendored
View file

@ -1,9 +1,13 @@
var fabric = fabric || {
version: "2.2.0"
version: "2.2.1"
};
if (typeof exports !== "undefined") {
exports.fabric = fabric;
} else if (typeof define === "function" && define.amd) {
define([], function() {
return fabric;
});
}
if (typeof document !== "undefined" && typeof window !== "undefined") {
@ -13991,10 +13995,4 @@ fabric.util.object.extend(fabric.IText.prototype, {
}
}
});
})();
if (typeof define === "function" && define.amd) {
define([], function() {
return fabric;
});
}
})();

2
dist/fabric.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -2,7 +2,7 @@
"name": "fabric",
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.",
"homepage": "http://fabricjs.com/",
"version": "2.2.0",
"version": "2.2.1",
"author": "Juriy Zaytsev <kangax@gmail.com>",
"contributors": [
{

View file

@ -1,4 +0,0 @@
/* Footer for requirejs AMD support */
if (typeof define === 'function' && define.amd) {
define([], function() { return fabric; });
}

View file

@ -256,6 +256,7 @@
/**
* Color of object's fill
* takes css colors https://www.w3.org/TR/css-color-3/
* @type String
* @default
*/
@ -279,6 +280,7 @@
/**
* Background color of an object.
* takes css colors https://www.w3.org/TR/css-color-3/
* @type String
* @default
*/
@ -294,6 +296,7 @@
/**
* When defined, an object is rendered via stroke and this property specifies its color
* takes css colors https://www.w3.org/TR/css-color-3/
* @type String
* @default
*/