diff options
author | Mario <mario@mariovavti.com> | 2020-06-16 07:32:55 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-06-16 07:32:55 +0000 |
commit | 70a104f24f3b3e3903d363081569be9af2052758 (patch) | |
tree | b3d82880872255536e3ec8297e3ab6e419fac5d3 /library/cropperjs/docs | |
parent | 0f27db6271acb3e0e44bf870659f085c71c8f629 (diff) | |
download | volse-hubzilla-70a104f24f3b3e3903d363081569be9af2052758.tar.gz volse-hubzilla-70a104f24f3b3e3903d363081569be9af2052758.tar.bz2 volse-hubzilla-70a104f24f3b3e3903d363081569be9af2052758.zip |
upĂdate copperjs to version 1.5.7
Diffstat (limited to 'library/cropperjs/docs')
-rw-r--r-- | library/cropperjs/docs/css/cropper.css | 4 | ||||
-rw-r--r-- | library/cropperjs/docs/examples/cropper-in-modal.html | 6 | ||||
-rw-r--r-- | library/cropperjs/docs/examples/customize-preview.html | 6 | ||||
-rw-r--r-- | library/cropperjs/docs/examples/upload-cropped-image-to-server.html | 6 | ||||
-rw-r--r-- | library/cropperjs/docs/index.html | 22 | ||||
-rw-r--r-- | library/cropperjs/docs/js/cropper.js | 74 |
6 files changed, 62 insertions, 56 deletions
diff --git a/library/cropperjs/docs/css/cropper.css b/library/cropperjs/docs/css/cropper.css index d54319a64..d914b48fd 100644 --- a/library/cropperjs/docs/css/cropper.css +++ b/library/cropperjs/docs/css/cropper.css @@ -1,11 +1,11 @@ /*! - * Cropper.js v1.5.6 + * Cropper.js v1.5.7 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * - * Date: 2019-10-04T04:33:44.164Z + * Date: 2020-05-23T05:22:57.283Z */ .cropper-container { diff --git a/library/cropperjs/docs/examples/cropper-in-modal.html b/library/cropperjs/docs/examples/cropper-in-modal.html index f36ff4e4e..343924ef8 100644 --- a/library/cropperjs/docs/examples/cropper-in-modal.html +++ b/library/cropperjs/docs/examples/cropper-in-modal.html @@ -5,7 +5,7 @@ <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Cropper.js</title> - <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> + <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" crossorigin="anonymous"> <link rel="stylesheet" href="../css/cropper.css"> <style> .img-container img { @@ -45,8 +45,8 @@ </div> </div> - <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script> - <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script> + <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" crossorigin="anonymous"></script> + <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script> <script src="../js/cropper.js"></script> <script> window.addEventListener('DOMContentLoaded', function () { diff --git a/library/cropperjs/docs/examples/customize-preview.html b/library/cropperjs/docs/examples/customize-preview.html index 72a108f8a..51d1e1b42 100644 --- a/library/cropperjs/docs/examples/customize-preview.html +++ b/library/cropperjs/docs/examples/customize-preview.html @@ -77,6 +77,7 @@ window.addEventListener('DOMContentLoaded', function () { var image = document.querySelector('#image'); var previews = document.querySelectorAll('.preview'); + var previewReady = false; var cropper = new Cropper(image, { ready: function () { var clone = this.cloneNode(); @@ -94,9 +95,14 @@ each(previews, function (elem) { elem.appendChild(clone.cloneNode()); }); + previewReady = true; }, crop: function (event) { + if (!previewReady) { + return; + } + var data = event.detail; var cropper = this.cropper; var imageData = cropper.getImageData(); diff --git a/library/cropperjs/docs/examples/upload-cropped-image-to-server.html b/library/cropperjs/docs/examples/upload-cropped-image-to-server.html index aef0ee58b..adb5c15ce 100644 --- a/library/cropperjs/docs/examples/upload-cropped-image-to-server.html +++ b/library/cropperjs/docs/examples/upload-cropped-image-to-server.html @@ -5,7 +5,7 @@ <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Cropper.js</title> - <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css"> + <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" crossorigin="anonymous"> <link rel="stylesheet" href="../css/cropper.css"> <style> .label { @@ -59,8 +59,8 @@ </div> </div> </div> - <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> - <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.bundle.min.js"></script> + <script src="https://code.jquery.com/jquery-3.4.1.min.js" crossorigin="anonymous"></script> + <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script> <script src="../js/cropper.js"></script> <script> window.addEventListener('DOMContentLoaded', function () { diff --git a/library/cropperjs/docs/index.html b/library/cropperjs/docs/index.html index fa8aaf6dd..7643c9c44 100644 --- a/library/cropperjs/docs/index.html +++ b/library/cropperjs/docs/index.html @@ -7,15 +7,15 @@ <meta name="description" content="JavaScript image cropper."> <meta name="author" content="Chen Fengyuan"> <title>Cropper.js</title> - <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css"> - <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.13.0/css/all.css" crossorigin="anonymous"> + <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" crossorigin="anonymous"> <link rel="stylesheet" href="css/cropper.css"> <link rel="stylesheet" href="css/main.css"> </head> <body> <!--[if lt IE 9]> <div class="alert alert-warning alert-dismissible fade show m-0 rounded-0" role="alert"> - You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience. + You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience. <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span> </button> @@ -62,17 +62,17 @@ <a class="nav-link" href="https://github.com/fengyuanchen/cropperjs" data-toggle="tooltip" title="View the GitHub project">GitHub</a> </li> <li class="nav-item"> - <a class="nav-link" href="https://fengyuanchen.github.io" data-toggle="tooltip" title="Explore more projects">Explore</a> + <a class="nav-link" href="https://fengyuanchen.github.io/" data-toggle="tooltip" title="Explore more projects">Explore</a> </li> <li class="nav-item"> - <a class="nav-link" href="https://chenfengyuan.com" data-toggle="tooltip" title="About the author">About</a> + <a class="nav-link" href="https://chenfengyuan.com/" data-toggle="tooltip" title="About the author">About</a> </li> <li class="nav-item"> <a class="nav-link text-warning" href="https://fengyuanchen.github.io/cropper.js/" data-toggle="tooltip" title="View the next version">v2.0 (Alpha)</a> </li> </ul> </div> - </nav> + </div> </header> <!-- Jumbotron --> @@ -80,7 +80,7 @@ <div class="container"> <div class="row"> <div class="col-md"> - <h1>Cropper.js <small class="h6">v1.5.6</small></h1> + <h1>Cropper.js <small class="h6">v1.5.7</small></h1> <p class="lead">JavaScript image cropper.</p> </div> <div class="col-md"> @@ -595,15 +595,15 @@ <a class="nav-link" href="https://github.com/fengyuanchen/cropperjs">GitHub</a> <a class="nav-link" href="https://github.com/fengyuanchen/cropperjs/releases">Releases</a> <a class="nav-link" href="https://github.com/fengyuanchen/cropperjs/blob/master/LICENSE">License</a> - <a class="nav-link" href="https://chenfengyuan.com">About</a> + <a class="nav-link" href="https://chenfengyuan.com/">About</a> </nav> </div> </footer> <!-- Scripts --> - <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"></script> - <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script> - <script src="https://fengyuanchen.github.io/shared/google-analytics.js"></script> + <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" crossorigin="anonymous"></script> + <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script> + <script src="https://fengyuanchen.github.io/shared/google-analytics.js" crossorigin="anonymous"></script> <script src="js/cropper.js"></script> <script src="js/main.js"></script> </body> diff --git a/library/cropperjs/docs/js/cropper.js b/library/cropperjs/docs/js/cropper.js index 5c49d7bdf..9bed97a52 100644 --- a/library/cropperjs/docs/js/cropper.js +++ b/library/cropperjs/docs/js/cropper.js @@ -1,20 +1,22 @@ /*! - * Cropper.js v1.5.6 + * Cropper.js v1.5.7 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * - * Date: 2019-10-04T04:33:48.372Z + * Date: 2020-05-23T05:23:00.081Z */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = global || self, global.Cropper = factory()); -}(this, function () { 'use strict'; +}(this, (function () { 'use strict'; function _typeof(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { return typeof obj; @@ -84,13 +86,13 @@ var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { - ownKeys(source, true).forEach(function (key) { + ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { - ownKeys(source).forEach(function (key) { + ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } @@ -100,28 +102,41 @@ } function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } + if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; } function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var IS_BROWSER = typeof window !== 'undefined' && typeof window.document !== 'undefined'; var WINDOW = IS_BROWSER ? window : {}; - var IS_TOUCH_DEVICE = IS_BROWSER ? 'ontouchstart' in WINDOW.document.documentElement : false; + var IS_TOUCH_DEVICE = IS_BROWSER && WINDOW.document.documentElement ? 'ontouchstart' in WINDOW.document.documentElement : false; var HAS_POINTER_EVENT = IS_BROWSER ? 'PointerEvent' in WINDOW : false; var NAMESPACE = 'cropper'; // Actions @@ -175,10 +190,6 @@ var REGEXP_DATA_URL = /^data:/; var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/; var REGEXP_TAG_NAME = /^img|canvas$/i; // Misc - // Inspired by the default width and height of a canvas element. - - var MIN_CONTAINER_WIDTH = 200; - var MIN_CONTAINER_HEIGHT = 100; var DEFAULTS = { // Define the view mode of the cropper @@ -386,7 +397,7 @@ var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/; /** * Normalize decimal number. - * Check out {@link http://0.30000000000000004.com/} + * Check out {@link https://0.30000000000000004.com/} * @param {number} value - The value to normalize. * @param {number} [times=100000000000] - The times for normalizing. * @returns {number} Returns the normalized number. @@ -1187,8 +1198,6 @@ case 8: rotate = -90; break; - - default: } return { @@ -1793,16 +1802,13 @@ var handlers = { resize: function resize() { - var options = this.options, - container = this.container, - containerData = this.containerData; - var minContainerWidth = Number(options.minContainerWidth) || MIN_CONTAINER_WIDTH; - var minContainerHeight = Number(options.minContainerHeight) || MIN_CONTAINER_HEIGHT; - - if (this.disabled || containerData.width <= minContainerWidth || containerData.height <= minContainerHeight) { + if (this.disabled) { return; } + var options = this.options, + container = this.container, + containerData = this.containerData; var ratio = container.offsetWidth / containerData.width; // Resize when width changed or height changed if (ratio !== 1 || container.offsetHeight !== containerData.height) { @@ -2050,8 +2056,6 @@ } break; - - default: } }; @@ -2416,8 +2420,6 @@ } break; - - default: } if (renderable) { @@ -3199,9 +3201,7 @@ var AnotherCropper = WINDOW.Cropper; - var Cropper = - /*#__PURE__*/ - function () { + var Cropper = /*#__PURE__*/function () { /** * Create a new Cropper. * @param {Element} element - The target element for cropping. @@ -3250,7 +3250,7 @@ if (!url) { return; - } // e.g.: "http://example.com/img/picture.jpg" + } // e.g.: "https://example.com/img/picture.jpg" url = element.src; @@ -3613,4 +3613,4 @@ return Cropper; -})); +}))); |