mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-03-16 22:10:32 +00:00
Moving AMD require on top, after NOT including common JS (#4797)
* fixed amd
This commit is contained in:
parent
b7dc7e1682
commit
e27296ca35
7 changed files with 20 additions and 17 deletions
|
|
@ -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;
|
||||
|
|
|
|||
4
build.js
4
build.js
|
|
@ -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
14
dist/fabric.js
vendored
|
|
@ -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
2
dist/fabric.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -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": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
/* Footer for requirejs AMD support */
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define([], function() { return fabric; });
|
||||
}
|
||||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue