mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-28 04:58:46 +02:00
N°5621 Move jquery.fileupload.js 9.22.0 (?) to NPM
Update to 9.22.1 to fix https://github.com/advisories/GHSA-4cj8-g9cp-v5wr
This commit is contained in:
42
node_modules/blueimp-load-image/js/load-image-fetch.js
generated
vendored
Normal file
42
node_modules/blueimp-load-image/js/load-image-fetch.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* JavaScript Load Image Fetch
|
||||
* https://github.com/blueimp/JavaScript-Load-Image
|
||||
*
|
||||
* Copyright 2017, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define, fetch, Request */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define(['./load-image', './load-image-meta'], factory)
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
factory(require('./load-image'), require('./load-image-meta'))
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(window.loadImage)
|
||||
}
|
||||
}(function (loadImage) {
|
||||
'use strict'
|
||||
|
||||
if ('fetch' in window && 'Request' in window) {
|
||||
loadImage.fetchBlob = function (url, callback, options) {
|
||||
if (loadImage.hasMetaOption(options)) {
|
||||
return fetch(new Request(url, options)).then(function (response) {
|
||||
return response.blob()
|
||||
}).then(callback).catch(function (err) {
|
||||
console.log(err)
|
||||
callback()
|
||||
})
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
}))
|
||||
Reference in New Issue
Block a user