Upgrade to node 12
This commit is contained in:
Vendored
+3
-4
@@ -1,4 +1,4 @@
|
||||
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
||||
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
||||
'use strict';
|
||||
/* globals fabric */
|
||||
|
||||
@@ -2234,7 +2234,6 @@ module.exports = ExtendFabricFunctionality;
|
||||
|
||||
},{"./Draggable":7,"./util":25}],24:[function(require,module,exports){
|
||||
'use strict';
|
||||
/* globals window */
|
||||
|
||||
(function() {
|
||||
|
||||
@@ -2374,7 +2373,7 @@ module.exports = isFullscreen;
|
||||
|
||||
},{}],31:[function(require,module,exports){
|
||||
'use strict';
|
||||
/* globals $, window */
|
||||
/* globals $ */
|
||||
|
||||
function isMobile() {
|
||||
return $(window).width() < 768;
|
||||
@@ -2440,7 +2439,7 @@ module.exports = setPositionInside;
|
||||
*/
|
||||
function setProperties(obj, properties) {
|
||||
for (var o in properties) {
|
||||
if (properties.hasOwnProperty(o)) {
|
||||
if (Object.prototype.hasOwnProperty.call(properties, o) ) {
|
||||
Object.defineProperty(obj, o, properties[o]);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-6
@@ -9,7 +9,7 @@ var eslint = require('gulp-eslint');
|
||||
var qunit = require('gulp-qunit');
|
||||
var mkdirp = require('mkdirp');
|
||||
var del = require('del');
|
||||
var runSequence = require('run-sequence');
|
||||
var runSequence = require('gulp4-run-sequence');
|
||||
|
||||
var outputPath = './dist';
|
||||
|
||||
@@ -24,7 +24,7 @@ gulp.task('build', function (done) {
|
||||
|
||||
gulp.task('clean-dist', function () { return del(outputPath); });
|
||||
|
||||
gulp.task('create-dist', function () { return mkdirp(outputPath); });
|
||||
gulp.task('create-dist', function (done) { return mkdirp(outputPath, done); });
|
||||
|
||||
gulp.task('compile', function() {
|
||||
return browserify('./src/main.js')
|
||||
@@ -35,10 +35,10 @@ gulp.task('compile', function() {
|
||||
.pipe(gulp.dest(outputPath));
|
||||
});
|
||||
|
||||
gulp.task('test', ['compile'], function() {
|
||||
gulp.task('test', gulp.series('compile', function() {
|
||||
return gulp.src('./test/index.html')
|
||||
.pipe(qunit({timeout: 1}));
|
||||
});
|
||||
}));
|
||||
|
||||
gulp.task('lint', function() {
|
||||
return gulp.src(['./src/**/*.js', './test/unit/*.js'])
|
||||
@@ -48,7 +48,9 @@ gulp.task('lint', function() {
|
||||
});
|
||||
|
||||
gulp.task('watch', function() {
|
||||
gulp.watch('./src/**/*.js', ['lint', 'compile']);
|
||||
gulp.watch('./src/**/*.js', gulp.series('lint', 'compile'));
|
||||
});
|
||||
|
||||
gulp.task('default', ['build']);
|
||||
gulp.task('default', gulp.series(
|
||||
'build',
|
||||
));
|
||||
|
||||
Generated
+3129
-1312
File diff suppressed because it is too large
Load Diff
+13
-10
@@ -7,21 +7,24 @@
|
||||
"url": "git@github.com:Photowall/image-editor.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "^13.1.1",
|
||||
"browserify": "^16.5.1",
|
||||
"del": "^3.0.0",
|
||||
"eslint": "^5.14.1",
|
||||
"gulp": "^3.9.0",
|
||||
"gulp-eslint": "^5.0.0",
|
||||
"gulp-qunit": "^1.5.0",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-eslint": "^6.0.0",
|
||||
"gulp-qunit": "^2.1.1",
|
||||
"gulp-rename": "^2.0.0",
|
||||
"gulp4-run-sequence": "^1.0.1",
|
||||
"jshint": "^2.9.5",
|
||||
"live-server": "^1.2.1",
|
||||
"mkdirp": "^0.5.1",
|
||||
"qunit": "^1.0.0",
|
||||
"run-sequence": "^2.2.1",
|
||||
"vinyl-buffer": "^1.0.0",
|
||||
"vinyl-source-stream": "^1.1.0"
|
||||
"vinyl-buffer": "^1.0.1",
|
||||
"vinyl-source-stream": "^2.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint gulpfile.js 'examples/**/*.js' 'test/unit/**/*.js' 'src/**/*.js'"
|
||||
}
|
||||
"lint": "eslint gulpfile.js 'examples/**/*.js' 'test/unit/**/*.js' 'src/**/*.js'",
|
||||
"serve": "live-server --ignore=node_modules --port=50994 ./"
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,10 @@ function ImageDataHandler(img) {
|
||||
var frameHandler = img.canvas.getViewport().getFrameHandler();
|
||||
returnValue.edge = frameHandler.getFrameType();
|
||||
returnValue.framed = returnValue.edge !== 'none';
|
||||
} else if (img.canvas.__type === 'wallpaper') {
|
||||
// repeating wallpapers should not have any cropping
|
||||
returnValue.x = 0;
|
||||
returnValue.y = 0;
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
'use strict';
|
||||
/* globals window */
|
||||
|
||||
(function() {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
'use strict';
|
||||
/* globals $, window */
|
||||
/* globals $ */
|
||||
|
||||
function isMobile() {
|
||||
return $(window).width() < 768;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
function setProperties(obj, properties) {
|
||||
for (var o in properties) {
|
||||
if (properties.hasOwnProperty(o)) {
|
||||
if (Object.prototype.hasOwnProperty.call(properties, o) ) {
|
||||
Object.defineProperty(obj, o, properties[o]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
QUnit.test('crop image', function(assert) {
|
||||
var done = assert.async();
|
||||
var editor = new ImageEditor('canvas');
|
||||
var editor = new ImageEditor('canvas', {type: 'photo-wallpaper'});
|
||||
editor.loadImage('fixtures/dog.jpg', function() {
|
||||
editor.crop(400, 200, 'cm');
|
||||
var data = editor.canvas.getImageData().getData();
|
||||
@@ -27,4 +27,18 @@
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test('repeating wallpaper has x and y set to 0', function(assert) {
|
||||
var done = assert.async();
|
||||
var editor = new ImageEditor('canvas', {type: 'wallpaper'});
|
||||
editor.loadImage('fixtures/dog.jpg', function() {
|
||||
editor.crop(400, 200, 'cm');
|
||||
var data = editor.canvas.getImageData().getData();
|
||||
assert.strictEqual(data.width, 400, 'sets image width');
|
||||
assert.strictEqual(data.height, 200, 'sets image height');
|
||||
assert.strictEqual(data.x, 0, 'sets crop x');
|
||||
assert.strictEqual(data.y, 0, 'sets crop y');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user