From aa33192bfdbb1abc1ffc04a8513f893c0a1fd4ca Mon Sep 17 00:00:00 2001 From: Lenik Date: Sun, 7 Apr 2024 03:26:15 +0800 Subject: [PATCH] fn.fileupload undefined: use ESM import. --- js/jquery.fileupload-audio.js | 35 ++------------------- js/jquery.fileupload-image.js | 54 +++++--------------------------- js/jquery.fileupload-ui.js | 48 ++++------------------------ js/jquery.fileupload-validate.js | 30 ++---------------- js/jquery.fileupload-video.js | 35 ++------------------- js/jquery.fileupload.js | 31 ++---------------- js/jquery.iframe-transport.js | 29 +---------------- js/vendor/jquery.ui.widget.js | 24 +------------- 8 files changed, 26 insertions(+), 260 deletions(-) diff --git a/js/jquery.fileupload-audio.js b/js/jquery.fileupload-audio.js index e5c9202f9..8385f55a0 100644 --- a/js/jquery.fileupload-audio.js +++ b/js/jquery.fileupload-audio.js @@ -1,34 +1,6 @@ -/* - * jQuery File Upload Audio Preview Plugin - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2013, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - */ - -/* global define, require */ - -(function (factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - // Register as an anonymous AMD module: - define(['jquery', 'load-image', './jquery.fileupload-process'], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS: - factory( - require('jquery'), - require('blueimp-load-image/js/load-image'), - require('./jquery.fileupload-process') - ); - } else { - // Browser globals: - factory(window.jQuery, window.loadImage); - } -})(function ($, loadImage) { - 'use strict'; +import 'jquery'; +// require('blueimp-load-image/js/load-image'), +import './jquery.fileupload-process'; // Prepend to the default processQueue: $.blueimp.fileupload.prototype.options.processQueue.unshift( @@ -98,4 +70,3 @@ } } }); -}); diff --git a/js/jquery.fileupload-image.js b/js/jquery.fileupload-image.js index ac0ccf1cc..fe04f72de 100644 --- a/js/jquery.fileupload-image.js +++ b/js/jquery.fileupload-image.js @@ -1,48 +1,11 @@ -/* - * jQuery File Upload Image Preview & Resize Plugin - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2013, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - */ - -/* global define, require */ - -(function (factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - // Register as an anonymous AMD module: - define([ - 'jquery', - 'load-image', - 'load-image-meta', - 'load-image-scale', - 'load-image-exif', - 'load-image-orientation', - 'canvas-to-blob', - './jquery.fileupload-process' - ], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS: - factory( - require('jquery'), - require('blueimp-load-image/js/load-image'), - require('blueimp-load-image/js/load-image-meta'), - require('blueimp-load-image/js/load-image-scale'), - require('blueimp-load-image/js/load-image-exif'), - require('blueimp-load-image/js/load-image-orientation'), - require('blueimp-canvas-to-blob'), - require('./jquery.fileupload-process') - ); - } else { - // Browser globals: - factory(window.jQuery, window.loadImage); - } -})(function ($, loadImage) { - 'use strict'; +import 'jquery'; +import 'blueimp-load-image/js/load-image'; +import 'blueimp-load-image/js/load-image-meta'; +import 'blueimp-load-image/js/load-image-scale'; +import 'blueimp-load-image/js/load-image-exif'; +import 'blueimp-load-image/js/load-image-orientation'; +import 'blueimp-canvas-to-blob'; +import './jquery.fileupload-process'; // Prepend to the default processQueue: $.blueimp.fileupload.prototype.options.processQueue.unshift( @@ -344,4 +307,3 @@ } } }); -}); diff --git a/js/jquery.fileupload-ui.js b/js/jquery.fileupload-ui.js index 9cc3d3fd0..605dac5d1 100644 --- a/js/jquery.fileupload-ui.js +++ b/js/jquery.fileupload-ui.js @@ -1,44 +1,9 @@ -/* - * jQuery File Upload User Interface Plugin - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2010, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - */ - -/* global define, require */ - -(function (factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - // Register as an anonymous AMD module: - define([ - 'jquery', - 'blueimp-tmpl', - './jquery.fileupload-image', - './jquery.fileupload-audio', - './jquery.fileupload-video', - './jquery.fileupload-validate' - ], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS: - factory( - require('jquery'), - require('blueimp-tmpl'), - require('./jquery.fileupload-image'), - require('./jquery.fileupload-audio'), - require('./jquery.fileupload-video'), - require('./jquery.fileupload-validate') - ); - } else { - // Browser globals: - factory(window.jQuery, window.tmpl); - } -})(function ($, tmpl) { - 'use strict'; +import 'jquery' +import 'blueimp-tmpl' +import './jquery.fileupload-image' +import './jquery.fileupload-audio' +import './jquery.fileupload-video' +import './jquery.fileupload-validate'; $.blueimp.fileupload.prototype._specialOptions.push( 'filesContainer', @@ -756,4 +721,3 @@ this._super(); } }); -}); diff --git a/js/jquery.fileupload-validate.js b/js/jquery.fileupload-validate.js index 03d92abf8..9c5b63bb1 100644 --- a/js/jquery.fileupload-validate.js +++ b/js/jquery.fileupload-validate.js @@ -1,30 +1,5 @@ -/* - * jQuery File Upload Validation Plugin - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2013, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - */ - -/* global define, require */ - -(function (factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - // Register as an anonymous AMD module: - define(['jquery', './jquery.fileupload-process'], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS: - factory(require('jquery'), require('./jquery.fileupload-process')); - } else { - // Browser globals: - factory(window.jQuery); - } -})(function ($) { - 'use strict'; +import 'jquery'; +import './jquery.fileupload-process'; // Append to the default processQueue: $.blueimp.fileupload.prototype.options.processQueue.push({ @@ -116,4 +91,3 @@ } } }); -}); diff --git a/js/jquery.fileupload-video.js b/js/jquery.fileupload-video.js index 5dc78f36b..a32068ecc 100644 --- a/js/jquery.fileupload-video.js +++ b/js/jquery.fileupload-video.js @@ -1,34 +1,6 @@ -/* - * jQuery File Upload Video Preview Plugin - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2013, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - */ - -/* global define, require */ - -(function (factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - // Register as an anonymous AMD module: - define(['jquery', 'load-image', './jquery.fileupload-process'], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS: - factory( - require('jquery'), - require('blueimp-load-image/js/load-image'), - require('./jquery.fileupload-process') - ); - } else { - // Browser globals: - factory(window.jQuery, window.loadImage); - } -})(function ($, loadImage) { - 'use strict'; +import 'jquery'; +import 'blueimp-load-image/js/load-image'; +import './jquery.fileupload-process'; // Prepend to the default processQueue: $.blueimp.fileupload.prototype.options.processQueue.unshift( @@ -98,4 +70,3 @@ } } }); -}); diff --git a/js/jquery.fileupload.js b/js/jquery.fileupload.js index e56ce76f1..759f8e775 100644 --- a/js/jquery.fileupload.js +++ b/js/jquery.fileupload.js @@ -1,31 +1,5 @@ -/* - * jQuery File Upload Plugin - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2010, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - */ - -/* global define, require */ -/* eslint-disable new-cap */ - -(function (factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - // Register as an anonymous AMD module: - define(['jquery', 'jquery-ui/ui/widget'], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS: - factory(require('jquery'), require('./vendor/jquery.ui.widget')); - } else { - // Browser globals: - factory(window.jQuery); - } -})(function ($) { - 'use strict'; +import $ from 'jquery'; +import './vendor/jquery.ui.widget'; // Detect file input support, based on // https://viljamis.com/2012/file-upload-support-on-mobile/ @@ -1601,4 +1575,3 @@ return this._getXHRPromise(false, data && data.context); } }); -}); diff --git a/js/jquery.iframe-transport.js b/js/jquery.iframe-transport.js index 3e3b9a93b..300aec629 100644 --- a/js/jquery.iframe-transport.js +++ b/js/jquery.iframe-transport.js @@ -1,30 +1,4 @@ -/* - * jQuery Iframe Transport Plugin - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2011, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - */ - -/* global define, require */ - -(function (factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - // Register as an anonymous AMD module: - define(['jquery'], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS: - factory(require('jquery')); - } else { - // Browser globals: - factory(window.jQuery); - } -})(function ($) { - 'use strict'; +import 'jquery'; // Helper variable to create unique names for the transport iframes: var counter = 0, @@ -224,4 +198,3 @@ } } }); -}); diff --git a/js/vendor/jquery.ui.widget.js b/js/vendor/jquery.ui.widget.js index 78e625572..70443bef6 100644 --- a/js/vendor/jquery.ui.widget.js +++ b/js/vendor/jquery.ui.widget.js @@ -1,25 +1,4 @@ -/*! jQuery UI - v1.12.1+0b7246b6eeadfa9e2696e22f3230f6452f8129dc - 2020-02-20 - * http://jqueryui.com - * Includes: widget.js - * Copyright jQuery Foundation and other contributors; Licensed MIT */ - -/* global define, require */ -/* eslint-disable no-param-reassign, new-cap, jsdoc/require-jsdoc */ - -(function (factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['jquery'], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS - factory(require('jquery')); - } else { - // Browser globals - factory(window.jQuery); - } -})(function ($) { - ('use strict'); +import $ from 'jquery'; $.ui = $.ui || {}; @@ -802,4 +781,3 @@ } }; }); -});