mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-03-16 22:10:32 +00:00
Remove duplication in log.js
This commit is contained in:
parent
34c42b6ffc
commit
987f165790
6 changed files with 62 additions and 70 deletions
3
build.js
3
build.js
|
|
@ -144,7 +144,6 @@ var filesToInclude = [
|
|||
ifSpecifiedDependencyInclude('serialization', 'json', 'lib/json2.js'),
|
||||
ifSpecifiedInclude('gestures', 'lib/event.js'),
|
||||
|
||||
'src/log.js',
|
||||
'src/mixins/observable.mixin.js',
|
||||
'src/mixins/collection.mixin.js',
|
||||
|
||||
|
|
@ -159,6 +158,8 @@ var filesToInclude = [
|
|||
'src/util/dom_misc.js',
|
||||
'src/util/dom_request.js',
|
||||
|
||||
'src/log.js',
|
||||
|
||||
ifSpecifiedInclude('animation', 'src/util/animate.js'),
|
||||
//'src/util/animate.js',
|
||||
ifSpecifiedInclude('easing', 'src/util/anim_ease.js'),
|
||||
|
|
|
|||
49
dist/all.js
vendored
49
dist/all.js
vendored
|
|
@ -1756,32 +1756,6 @@ if (!JSON) {
|
|||
}
|
||||
}());
|
||||
|
||||
/**
|
||||
* Wrapper around `console.log` (when available)
|
||||
* @param {Any} values Values to log
|
||||
*/
|
||||
fabric.log = function() { };
|
||||
|
||||
/**
|
||||
* Wrapper around `console.warn` (when available)
|
||||
* @param {Any} Values to log as a warning
|
||||
*/
|
||||
fabric.warn = function() { };
|
||||
|
||||
if (typeof console !== 'undefined') {
|
||||
if (typeof console.log !== 'undefined' && console.log.apply) {
|
||||
fabric.log = function() {
|
||||
return console.log.apply(console, arguments);
|
||||
};
|
||||
}
|
||||
if (typeof console.warn !== 'undefined' && console.warn.apply) {
|
||||
fabric.warn = function() {
|
||||
return console.warn.apply(console, arguments);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(function(){
|
||||
|
||||
/**
|
||||
|
|
@ -3773,6 +3747,29 @@ fabric.util.string = {
|
|||
})();
|
||||
|
||||
|
||||
/**
|
||||
* Wrapper around `console.log` (when available)
|
||||
* @param {Any} values Values to log
|
||||
*/
|
||||
fabric.log = function() { };
|
||||
|
||||
/**
|
||||
* Wrapper around `console.warn` (when available)
|
||||
* @param {Any} Values to log as a warning
|
||||
*/
|
||||
fabric.warn = function() { };
|
||||
|
||||
if (typeof console !== 'undefined') {
|
||||
['log', 'warn'].forEach(function(methodName) {
|
||||
if (typeof console[methodName] !== 'undefined' && console[methodName].apply) {
|
||||
fabric[methodName] = function() {
|
||||
return console[methodName].apply(console, arguments);
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
(function() {
|
||||
|
||||
/**
|
||||
|
|
|
|||
14
dist/all.min.js
vendored
14
dist/all.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/all.min.js.gz
vendored
BIN
dist/all.min.js.gz
vendored
Binary file not shown.
49
dist/all.require.js
vendored
49
dist/all.require.js
vendored
|
|
@ -1756,32 +1756,6 @@ if (!JSON) {
|
|||
}
|
||||
}());
|
||||
|
||||
/**
|
||||
* Wrapper around `console.log` (when available)
|
||||
* @param {Any} values Values to log
|
||||
*/
|
||||
fabric.log = function() { };
|
||||
|
||||
/**
|
||||
* Wrapper around `console.warn` (when available)
|
||||
* @param {Any} Values to log as a warning
|
||||
*/
|
||||
fabric.warn = function() { };
|
||||
|
||||
if (typeof console !== 'undefined') {
|
||||
if (typeof console.log !== 'undefined' && console.log.apply) {
|
||||
fabric.log = function() {
|
||||
return console.log.apply(console, arguments);
|
||||
};
|
||||
}
|
||||
if (typeof console.warn !== 'undefined' && console.warn.apply) {
|
||||
fabric.warn = function() {
|
||||
return console.warn.apply(console, arguments);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(function(){
|
||||
|
||||
/**
|
||||
|
|
@ -3773,6 +3747,29 @@ fabric.util.string = {
|
|||
})();
|
||||
|
||||
|
||||
/**
|
||||
* Wrapper around `console.log` (when available)
|
||||
* @param {Any} values Values to log
|
||||
*/
|
||||
fabric.log = function() { };
|
||||
|
||||
/**
|
||||
* Wrapper around `console.warn` (when available)
|
||||
* @param {Any} Values to log as a warning
|
||||
*/
|
||||
fabric.warn = function() { };
|
||||
|
||||
if (typeof console !== 'undefined') {
|
||||
['log', 'warn'].forEach(function(methodName) {
|
||||
if (typeof console[methodName] !== 'undefined' && console[methodName].apply) {
|
||||
fabric[methodName] = function() {
|
||||
return console[methodName].apply(console, arguments);
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
(function() {
|
||||
|
||||
/**
|
||||
|
|
|
|||
17
src/log.js
17
src/log.js
|
|
@ -11,14 +11,11 @@ fabric.log = function() { };
|
|||
fabric.warn = function() { };
|
||||
|
||||
if (typeof console !== 'undefined') {
|
||||
if (typeof console.log !== 'undefined' && console.log.apply) {
|
||||
fabric.log = function() {
|
||||
return console.log.apply(console, arguments);
|
||||
};
|
||||
}
|
||||
if (typeof console.warn !== 'undefined' && console.warn.apply) {
|
||||
fabric.warn = function() {
|
||||
return console.warn.apply(console, arguments);
|
||||
};
|
||||
}
|
||||
['log', 'warn'].forEach(function(methodName) {
|
||||
if (typeof console[methodName] !== 'undefined' && console[methodName].apply) {
|
||||
fabric[methodName] = function() {
|
||||
return console[methodName].apply(console, arguments);
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue