From 580c3f4ffe9608d2beb56d418c68b3b112420e76 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 10 Nov 2019 12:49:51 +0000 Subject: another bulk of composer updates (cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce) --- vendor/blueimp/jquery-file-upload/js/demo.js | 75 ++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 vendor/blueimp/jquery-file-upload/js/demo.js (limited to 'vendor/blueimp/jquery-file-upload/js/demo.js') diff --git a/vendor/blueimp/jquery-file-upload/js/demo.js b/vendor/blueimp/jquery-file-upload/js/demo.js new file mode 100644 index 000000000..bb4eccd6e --- /dev/null +++ b/vendor/blueimp/jquery-file-upload/js/demo.js @@ -0,0 +1,75 @@ +/* + * jQuery File Upload Demo + * 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 $ */ + +$(function() { + 'use strict'; + + // Initialize the jQuery File Upload widget: + $('#fileupload').fileupload({ + // Uncomment the following to send cross-domain cookies: + //xhrFields: {withCredentials: true}, + url: 'server/php/' + }); + + // Enable iframe cross-domain access via redirect option: + $('#fileupload').fileupload( + 'option', + 'redirect', + window.location.href.replace(/\/[^/]*$/, '/cors/result.html?%s') + ); + + if (window.location.hostname === 'blueimp.github.io') { + // Demo settings: + $('#fileupload').fileupload('option', { + url: '//jquery-file-upload.appspot.com/', + // Enable image resizing, except for Android and Opera, + // which actually support image resizing, but fail to + // send Blob objects via XHR requests: + disableImageResize: /Android(?!.*Chrome)|Opera/.test( + window.navigator.userAgent + ), + maxFileSize: 999000, + acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i + }); + // Upload server status check for browsers with CORS support: + if ($.support.cors) { + $.ajax({ + url: '//jquery-file-upload.appspot.com/', + type: 'HEAD' + }).fail(function() { + $('
') + .text('Upload server currently unavailable - ' + new Date()) + .appendTo('#fileupload'); + }); + } + } else { + // Load existing files: + $('#fileupload').addClass('fileupload-processing'); + $.ajax({ + // Uncomment the following to send cross-domain cookies: + //xhrFields: {withCredentials: true}, + url: $('#fileupload').fileupload('option', 'url'), + dataType: 'json', + context: $('#fileupload')[0] + }) + .always(function() { + $(this).removeClass('fileupload-processing'); + }) + .done(function(result) { + $(this) + .fileupload('option', 'done') + // eslint-disable-next-line new-cap + .call(this, $.Event('done'), { result: result }); + }); + } +}); -- cgit v1.2.3