This commit is contained in:
Anton Lavrenov
2020-05-08 09:59:35 -05:00
parent a2adcf5f17
commit d5481b1b72
78 changed files with 3714 additions and 3711 deletions

View File

@@ -4,7 +4,7 @@
// For original source and documentation visit:
// http://www.github.com/HumbleSoftware/js-imagediff
(function(name, definition) {
(function (name, definition) {
var root = this;
if (typeof module !== 'undefined') {
try {
@@ -22,7 +22,7 @@
} else {
root[name] = definition(root, name);
}
})('imagediff', function(root, name, Canvas) {
})('imagediff', function (root, name, Canvas) {
var TYPE_ARRAY = /\[object Array\]/i,
TYPE_CANVAS = /\[object (Canvas|HTMLCanvasElement)\]/i,
TYPE_CONTEXT = /\[object CanvasRenderingContext2D\]/i,
@@ -271,7 +271,7 @@
if (!isImageType(arguments[i])) {
throw {
name: 'ImageTypeError',
message: 'Submitted object was not an image.'
message: 'Submitted object was not an image.',
};
}
}
@@ -287,13 +287,13 @@
}
jasmine = {
toBeImageData: function() {
toBeImageData: function () {
return imagediff.isImageData(this.actual);
},
toImageDiffEqual: function(expected, tolerance) {
toImageDiffEqual: function (expected, tolerance) {
if (typeof document !== UNDEFINED) {
this.message = function() {
this.message = function () {
var div = get('div'),
a = get('div', '<div>Actual:</div>'),
b = get('div', '<div>Expected:</div>'),
@@ -326,7 +326,7 @@
}
return imagediff.equal(this.actual, expected, tolerance);
}
},
};
// Image Output
@@ -353,7 +353,7 @@
isImageData: isImageData,
isImageType: isImageType,
toImageData: function(object) {
toImageData: function (object) {
checkType(object);
if (isImageData(object)) {
return copyImageData(object);
@@ -361,13 +361,13 @@
return toImageData(object);
},
equal: function(a, b, tolerance) {
equal: function (a, b, tolerance) {
checkType(a, b);
a = toImageData(a);
b = toImageData(b);
return equal(a, b, tolerance);
},
diff: function(a, b, options) {
diff: function (a, b, options) {
checkType(a, b);
a = toImageData(a);
b = toImageData(b);
@@ -377,10 +377,10 @@
jasmine: jasmine,
// Compatibility
noConflict: function() {
noConflict: function () {
root[name] = previous;
return imagediff;
}
},
};
if (typeof module !== 'undefined') {

View File

@@ -1,5 +1,5 @@
// stats.js - http://github.com/mrdoob/stats.js
var Stats = function() {
var Stats = function () {
var l = Date.now(),
m = l,
g = 0,
@@ -14,7 +14,7 @@ var Stats = function() {
f.id = 'stats';
f.addEventListener(
'mousedown',
function(b) {
function (b) {
b.preventDefault();
t(++s % 2);
},
@@ -60,7 +60,7 @@ var Stats = function() {
(j.style.cssText =
'width:1px;height:30px;float:left;background-color:#131'),
e.appendChild(j);
var t = function(b) {
var t = function (b) {
s = b;
switch (s) {
case 0:
@@ -75,10 +75,10 @@ var Stats = function() {
REVISION: 11,
domElement: f,
setMode: t,
begin: function() {
begin: function () {
l = Date.now();
},
end: function() {
end: function () {
var b = Date.now();
g = b - l;
n = Math.min(n, g);
@@ -88,7 +88,7 @@ var Stats = function() {
e.appendChild(e.firstChild).style.height = a + 'px';
r++;
b > m + 1e3 &&
((h = Math.round(1e3 * r / (b - m))),
((h = Math.round((1e3 * r) / (b - m))),
(p = Math.min(p, h)),
(q = Math.max(q, h)),
(i.textContent = h + ' FPS (' + p + '-' + q + ')'),
@@ -98,8 +98,8 @@ var Stats = function() {
(r = 0));
return b;
},
update: function() {
update: function () {
l = this.end();
}
},
};
};