From 0b508d15afb4aa1d49716b9e303cffe679918532 Mon Sep 17 00:00:00 2001 From: sofiekedvik Date: Tue, 31 Oct 2017 12:20:47 +0100 Subject: [PATCH] added dist --- dist/image-editor.js | 3848 +++++++++++++++++++++--------------------- 1 file changed, 1924 insertions(+), 1924 deletions(-) diff --git a/dist/image-editor.js b/dist/image-editor.js index 1c24a90..e95c09b 100644 --- a/dist/image-editor.js +++ b/dist/image-editor.js @@ -1,1056 +1,1056 @@ (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 max) { - return max; - } - return value; -} - -module.exports = assertBetween; +'use strict'; + +function assertBetween(value, min, max) { + if (value < min) { + return min; + } + if (value > max) { + return max; + } + return value; +} + +module.exports = assertBetween; },{}],27:[function(require,module,exports){ -'use strict'; - -function assertKeyValuePair(key, value) { - if (typeof key === 'object') { - return key; - } - - var returnValue = {}; - returnValue[key] = value; - - return returnValue; -} - -module.exports = assertKeyValuePair; +'use strict'; + +function assertKeyValuePair(key, value) { + if (typeof key === 'object') { + return key; + } + + var returnValue = {}; + returnValue[key] = value; + + return returnValue; +} + +module.exports = assertKeyValuePair; },{}],28:[function(require,module,exports){ -'use strict'; - -/** - * @param {fabric.Image} obj - * @param {int} width - * @param {int} height - * @param {string} units - * @return {Object} - * axis: STRING, - * dim: OBJECT( width: NUMBER, height: NUMBER), - * width: NUMBER, - * height: NUMBER, - * ppmm: NUMBER - */ -function calcCrop(obj, width, height, units) { - var cropRatio = width / height; - var objRatio = obj.width / obj.height; - - var returnValue = { - image: obj, - axis: objRatio > cropRatio ? 'x' : 'y', - dim: { - width: Number(width), - height: Number(height), - units: units - }, - width: obj.width * obj.scaleX, - height: obj.height * obj.scaleY, - objectRatio: objRatio, - cropRatio: cropRatio - }; - - if (objRatio > cropRatio) { - returnValue.width *= cropRatio / objRatio; - } else { - returnValue.height /= cropRatio / objRatio; - } - - // Pixels per millimeter - returnValue.ppmm = returnValue.width / ((returnValue.dim.width * obj.scaleX) * 10); - - return returnValue; -} - -module.exports = calcCrop; +'use strict'; + +/** + * @param {fabric.Image} obj + * @param {int} width + * @param {int} height + * @param {string} units + * @return {Object} + * axis: STRING, + * dim: OBJECT( width: NUMBER, height: NUMBER), + * width: NUMBER, + * height: NUMBER, + * ppmm: NUMBER + */ +function calcCrop(obj, width, height, units) { + var cropRatio = width / height; + var objRatio = obj.width / obj.height; + + var returnValue = { + image: obj, + axis: objRatio > cropRatio ? 'x' : 'y', + dim: { + width: Number(width), + height: Number(height), + units: units + }, + width: obj.width * obj.scaleX, + height: obj.height * obj.scaleY, + objectRatio: objRatio, + cropRatio: cropRatio + }; + + if (objRatio > cropRatio) { + returnValue.width *= cropRatio / objRatio; + } else { + returnValue.height /= cropRatio / objRatio; + } + + // Pixels per millimeter + returnValue.ppmm = returnValue.width / ((returnValue.dim.width * obj.scaleX) * 10); + + return returnValue; +} + +module.exports = calcCrop; },{}],29:[function(require,module,exports){ -'use strict'; - -function isAspectChanged(x1, y1, x2, y2) { - return (Math.abs(x1 / y1 - x2 / y2) > 0.01); -} - -module.exports = isAspectChanged; +'use strict'; + +function isAspectChanged(x1, y1, x2, y2) { + return (Math.abs(x1 / y1 - x2 / y2) > 0.01); +} + +module.exports = isAspectChanged; },{}],30:[function(require,module,exports){ -'use strict'; - -function isFullscreen() { - return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement; -} - -module.exports = isFullscreen; +'use strict'; + +function isFullscreen() { + return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement; +} + +module.exports = isFullscreen; },{}],31:[function(require,module,exports){ -'use strict'; - -function isMobile() { - return $(window).width() < 768; -} - -module.exports = isMobile; +'use strict'; + +function isMobile() { + return $(window).width() < 768; +} + +module.exports = isMobile; },{}],32:[function(require,module,exports){ -'use strict'; - -var MouseMetrics = { - previousMouseData: { - x: null, - y: null - }, - - deletePreviousMouseData: function() { - MouseMetrics.previousMouseData = { - x: null, - y: null - }; - }, - - setPreviousMouseData: function(values) { - MouseMetrics.previousMouseData = { - x: values.x || null, - y: values.y || null, - }; - }, -}; - -module.exports = MouseMetrics; +'use strict'; + +var MouseMetrics = { + previousMouseData: { + x: null, + y: null + }, + + deletePreviousMouseData: function() { + MouseMetrics.previousMouseData = { + x: null, + y: null + }; + }, + + setPreviousMouseData: function(values) { + MouseMetrics.previousMouseData = { + x: values.x || null, + y: values.y || null, + }; + }, +}; + +module.exports = MouseMetrics; },{}],33:[function(require,module,exports){ -'use strict'; - -/** - * @param {fabric.Object} obj - * @param {Object} bounds - * @return {fabric.Object} - */ -function setPositionInside(obj, bounds) { - ['left', 'top'].forEach(function (v) { - if (obj[v] < bounds[v].min) { - obj.set(v, bounds[v].min).setCoords(); - } - - if (obj[v] > bounds[v].max) { - obj.set(v, bounds[v].max).setCoords(); - } - }); - return obj; -} - -module.exports = setPositionInside; +'use strict'; + +/** + * @param {fabric.Object} obj + * @param {Object} bounds + * @return {fabric.Object} + */ +function setPositionInside(obj, bounds) { + ['left', 'top'].forEach(function (v) { + if (obj[v] < bounds[v].min) { + obj.set(v, bounds[v].min).setCoords(); + } + + if (obj[v] > bounds[v].max) { + obj.set(v, bounds[v].max).setCoords(); + } + }); + return obj; +} + +module.exports = setPositionInside; },{}],34:[function(require,module,exports){ -'use strict'; - -/** - * @param {Object} obj - * @param {Object} properties - */ -function setProperties(obj, properties) { - for (var o in properties) { - if (properties.hasOwnProperty(o)) { - Object.defineProperty(obj, o, properties[o]); - } - } -} - -module.exports = setProperties; +'use strict'; + +/** + * @param {Object} obj + * @param {Object} properties + */ +function setProperties(obj, properties) { + for (var o in properties) { + if (properties.hasOwnProperty(o)) { + Object.defineProperty(obj, o, properties[o]); + } + } +} + +module.exports = setProperties; },{}],35:[function(require,module,exports){ -'use strict'; - -function supportsFullscreen() { - - return document.documentElement.requestFullscreen || document.documentElement.webkitRequestFullScreen || document.documentElement.mozRequestFullScreen || document.documentElement.msRequestFullscreen; - -} - -module.exports = supportsFullscreen; +'use strict'; + +function supportsFullscreen() { + + return document.documentElement.requestFullscreen || document.documentElement.webkitRequestFullScreen || document.documentElement.mozRequestFullScreen || document.documentElement.msRequestFullscreen; + +} + +module.exports = supportsFullscreen; },{}],36:[function(require,module,exports){ -'use strict'; - -var isFullscreen = require('./is-fullscreen'); -/** - * Toggles the full screen state for passed DOM object - * @param {HTMLElement} elm - */ -function toggleFullscreen(elem) { - if (isFullscreen()) { - if (document.exitFullscreen) { - document.exitFullscreen(); - } else if (document.msExitFullscreen) { - document.msExitFullscreen(); - } else if (document.mozCancelFullScreen) { - document.mozCancelFullScreen(); - } else if (document.webkitCancelFullScreen) { - document.webkitCancelFullScreen(); - } - return; - } - - if (elem.requestFullscreen) { - elem.requestFullscreen(); - } else if (elem.webkitRequestFullScreen) { - elem.webkitRequestFullScreen(); - } else if (elem.mozRequestFullScreen) { - elem.mozRequestFullScreen(); - } else if (elem.msRequestFullscreen) { - elem.msRequestFullscreen(); - } -} - -module.exports = toggleFullscreen; +'use strict'; + +var isFullscreen = require('./is-fullscreen'); +/** + * Toggles the full screen state for passed DOM object + * @param {HTMLElement} elm + */ +function toggleFullscreen(elem) { + if (isFullscreen()) { + if (document.exitFullscreen) { + document.exitFullscreen(); + } else if (document.msExitFullscreen) { + document.msExitFullscreen(); + } else if (document.mozCancelFullScreen) { + document.mozCancelFullScreen(); + } else if (document.webkitCancelFullScreen) { + document.webkitCancelFullScreen(); + } + return; + } + + if (elem.requestFullscreen) { + elem.requestFullscreen(); + } else if (elem.webkitRequestFullScreen) { + elem.webkitRequestFullScreen(); + } else if (elem.mozRequestFullScreen) { + elem.mozRequestFullScreen(); + } else if (elem.msRequestFullscreen) { + elem.msRequestFullscreen(); + } +} + +module.exports = toggleFullscreen; },{"./is-fullscreen":30}]},{},[24]);