diff --git a/app/Http/Livewire/Importer.php b/app/Http/Livewire/Importer.php index 07f3a9f16c40..94e1a3a297ff 100644 --- a/app/Http/Livewire/Importer.php +++ b/app/Http/Livewire/Importer.php @@ -7,7 +7,7 @@ use App\Models\Import; use Storage; - +use Livewire\WithFileUploads; use Log; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; @@ -15,17 +15,13 @@ class Importer extends Component { use AuthorizesRequests; + use WithFileUploads; public $files; - - public $progress; //upload progress - '-1' means don't show - public $progress_message; - public $progress_bar_class; - public $message; //status/error message? public $message_type; //success/error? - //originally from ImporterFile + // originally from ImporterFile public $import_errors; // public ?Import $activeFile = null; public $importTypes; @@ -162,8 +158,6 @@ public function boot() { // FIXME - delete or undelete. public function mount() { $this->authorize('import'); - $this->progress = -1; // '-1' means 'don't show the progressbar' - $this->progress_bar_class = 'progress-bar-warning'; $this->importTypes = [ 'asset' => trans('general.assets'), 'accessory' => trans('general.accessories'), diff --git a/package.json b/package.json index 2e220c597a86..40ceb3c6e2e4 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "admin-lte": "^2.4.18", "ajv": "^6.12.6", "alpinejs": "^3.10.5", - "blueimp-file-upload": "^9.34.0", "bootstrap": "^3.4.1", "bootstrap-colorpicker": "^2.5.3", "bootstrap-datepicker": "^1.10.0", diff --git a/public/css/dist/all.css b/public/css/dist/all.css index 0786a8b30d3c..1ead518ac406 100644 --- a/public/css/dist/all.css +++ b/public/css/dist/all.css @@ -22300,102 +22300,6 @@ a.ui-button:active, display: inline-block; } /*# sourceMappingURL=bootstrap-colorpicker.css.map */ -@charset "UTF-8"; -/* - * jQuery File Upload Plugin CSS - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2013, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - */ - -.fileinput-button { - position: relative; - overflow: hidden; - display: inline-block; -} -.fileinput-button input { - position: absolute; - top: 0; - right: 0; - margin: 0; - opacity: 0; - -ms-filter: 'alpha(opacity=0)'; - font-size: 200px !important; - direction: ltr; - cursor: pointer; -} - -/* Fixes for IE < 8 */ -@media screen\9 { - .fileinput-button input { - filter: alpha(opacity=0); - font-size: 100%; - height: 100%; - } -} - -@charset "UTF-8"; -/* - * jQuery File Upload UI Plugin CSS - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2010, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - */ - -.fileupload-buttonbar .btn, -.fileupload-buttonbar .toggle { - margin-bottom: 5px; -} -.progress-animated .progress-bar, -.progress-animated .bar { - background: url("../img/progressbar.gif") !important; - filter: none; -} -.fileupload-process { - float: right; - display: none; -} -.fileupload-processing .fileupload-process, -.files .processing .preview { - display: block; - width: 32px; - height: 32px; - background: url("../img/loading.gif") center no-repeat; - background-size: contain; -} -.files audio, -.files video { - max-width: 300px; -} - -@media (max-width: 767px) { - .fileupload-buttonbar .toggle, - .files .toggle, - .files .btn span { - display: none; - } - .files .name { - width: 80px; - word-wrap: break-word; - } - .files audio, - .files video { - max-width: 80px; - } - .files img, - .files canvas { - max-width: 100%; - } -} - .ekko-lightbox{display:-ms-flexbox!important;display:flex!important;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding-right:0!important}.ekko-lightbox-container{position:relative}.ekko-lightbox-container>div.ekko-lightbox-item{position:absolute;top:0;left:0;bottom:0;right:0;width:100%}.ekko-lightbox iframe{width:100%;height:100%}.ekko-lightbox-nav-overlay{z-index:1;position:absolute;top:0;left:0;width:100%;height:100%;display:-ms-flexbox;display:flex}.ekko-lightbox-nav-overlay a{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0;transition:opacity .5s;color:#fff;font-size:30px;z-index:1}.ekko-lightbox-nav-overlay a>*{-ms-flex-positive:1;flex-grow:1}.ekko-lightbox-nav-overlay a>:focus{outline:none}.ekko-lightbox-nav-overlay a span{padding:0 30px}.ekko-lightbox-nav-overlay a:last-child span{text-align:right}.ekko-lightbox-nav-overlay a:hover{text-decoration:none}.ekko-lightbox-nav-overlay a:focus{outline:none}.ekko-lightbox-nav-overlay a.disabled{cursor:default;visibility:hidden}.ekko-lightbox a:hover{opacity:1;text-decoration:none}.ekko-lightbox .modal-dialog{display:none}.ekko-lightbox .modal-footer{text-align:left}.ekko-lightbox-loader{position:absolute;top:0;left:0;bottom:0;right:0;width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.ekko-lightbox-loader>div{width:40px;height:40px;position:relative;text-align:center}.ekko-lightbox-loader>div>div{width:100%;height:100%;border-radius:50%;background-color:#fff;opacity:.6;position:absolute;top:0;left:0;animation:a 2s infinite ease-in-out}.ekko-lightbox-loader>div>div:last-child{animation-delay:-1s}.modal-dialog .ekko-lightbox-loader>div>div{background-color:#333}@keyframes a{0%,to{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}} /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVra28tbGlnaHRib3guY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQ0UsOEJBQXlCLEFBQXpCLHVCQUF5QixBQUN6QixzQkFBb0IsQUFBcEIsbUJBQW9CLEFBQ3BCLHFCQUF3QixBQUF4Qix1QkFBd0IsQUFDeEIseUJBQTZCLENBQzlCLEFBQ0QseUJBQ0UsaUJBQW1CLENBQ3BCLEFBQ0QsZ0RBQ0Usa0JBQW1CLEFBQ25CLE1BQU8sQUFDUCxPQUFRLEFBQ1IsU0FBVSxBQUNWLFFBQVMsQUFDVCxVQUFZLENBQ2IsQUFDRCxzQkFDRSxXQUFZLEFBQ1osV0FBYSxDQUNkLEFBQ0QsMkJBQ0UsVUFBYSxBQUNiLGtCQUFtQixBQUNuQixNQUFPLEFBQ1AsT0FBUSxBQUNSL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ybTogc2NhbGUoMCk7XG4gIH1cbiAgNTAlIHtcbiAgICAtd2Via2l0LXRyYW5zZm9ybTogc2NhbGUoMSk7XG4gIH1cbn1cbkBrZXlmcmFtZXMgc2stYm91bmNlIHtcbiAgMCUsXG4gIDEwMCUge1xuICAgIHRyYW5zZm9ybTogc2NhbGUoMCk7XG4gICAgLXdlYmtpdC10cmFuc2Zvcm06IHNjYWxlKDApO1xuICB9XG4gIDUwJSB7XG4gICAgdHJhbnNmb3JtOiBzY2FsZSgxKTtcbiAgICAtd2Via2l0LXRyYW5zZm9ybTogc2NhbGUoMSk7XG4gIH1cbn1cbiJdfQ== */ /** diff --git a/public/js/build/vendor.js b/public/js/build/vendor.js index ca6456d063f0..7f3e36ee4ace 100644 --- a/public/js/build/vendor.js +++ b/public/js/build/vendor.js @@ -31888,1790 +31888,6 @@ var effectsEffectTransfer = effect; })(jQuery); -// This [jQuery](https://jquery.com/) plugin implements an `"); - - // The first load event gets fired after the iframe has been injected - // into the DOM, and is used to prepare the actual submission. - iframe.one("load", function() { - - // The second load event gets fired when the response to the form - // submission is received. The implementation detects whether the - // actual payload is embedded in a ` - -// The iframe transport plugin will detect this and pass the value of the -// `data-type` attribute on to jQuery as if it was the "Content-Type" response -// header, thereby enabling the same kind of conversions that jQuery applies -// to regular responses. For the example above you should get a Javascript -// object as the `data` parameter of the `complete` callback, with the -// properties `ok: true` and `message: "Thanks so much"`. - -// ### Handling Server Errors - -// Another problem with using an `iframe` for file uploads is that it is -// impossible for the javascript code to determine the HTTP status code of the -// servers response. Effectively, all of the calls you make will look like they -// are getting successful responses, and thus invoke the `done()` or -// `complete()` callbacks. You can only communicate problems using the content -// of the response payload. For example, consider using a JSON response such as -// the following to indicate a problem with an uploaded file: - -// - -// ### Compatibility - -// This plugin has primarily been tested on Safari 5 (or later), Firefox 4 (or -// later), and Internet Explorer (all the way back to version 6). While I -// haven't found any issues with it so far, I'm fairly sure it still doesn't -// work around all the quirks in all different browsers. But the code is still -// pretty simple overall, so you should be able to fix it and contribute a -// patch :) - -// ## Annotated Source - -(function($, undefined) { - "use strict"; - - // Register a prefilter that checks whether the `iframe` option is set, and - // switches to the "iframe" data type if it is `true`. - $.ajaxPrefilter(function(options, origOptions, jqXHR) { - if (options.iframe) { - options.originalURL = options.url; - return "iframe"; - } - }); - - // Register a transport for the "iframe" data type. It will only activate - // when the "files" option has been set to a non-empty list of enabled file - // inputs. - $.ajaxTransport("iframe", function(options, origOptions, jqXHR) { - var form = null, - iframe = null, - name = "iframe-" + $.now(), - files = $(options.files).filter(":file:enabled"), - markers = null, - accepts = null; - - // This function gets called after a successful submission or an abortion - // and should revert all changes made to the page to enable the - // submission via this transport. - function cleanUp() { - files.each(function(i, file) { - var $file = $(file); - $file.data("clone").replaceWith($file); - }); - form.remove(); - iframe.one("load", function() { iframe.remove(); }); - iframe.attr("src", "javascript:false;"); - } - - // Remove "iframe" from the data types list so that further processing is - // based on the content type returned by the server, without attempting an - // (unsupported) conversion from "iframe" to the actual type. - options.dataTypes.shift(); - - // Use the data from the original AJAX options, as it doesn't seem to be - // copied over since jQuery 1.7. - // See https://github.com/cmlenz/jquery-iframe-transport/issues/6 - options.data = origOptions.data; - - if (files.length) { - form = $("
"). - hide().attr({action: options.originalURL, target: name}); - - // If there is any additional data specified via the `data` option, - // we add it as hidden fields to the form. This (currently) requires - // the `processData` option to be set to false so that the data doesn't - // get serialized to a string. - if (typeof(options.data) === "string" && options.data.length > 0) { - $.error("data must not be serialized"); - } - $.each(options.data || {}, function(name, value) { - if ($.isPlainObject(value)) { - name = value.name; - value = value.value; - } - $("").attr({name: name, value: value}). - appendTo(form); - }); - - // Add a hidden `X-Requested-With` field with the value `IFrame` to the - // field, to help server-side code to determine that the upload happened - // through this transport. - $(""). - appendTo(form); - - // Borrowed straight from the JQuery source. - // Provides a way of specifying the accepted data type similar to the - // HTTP "Accept" header - if (options.dataTypes[0] && options.accepts[options.dataTypes[0]]) { - accepts = options.accepts[options.dataTypes[0]] + - (options.dataTypes[0] !== "*" ? ", */*; q=0.01" : ""); - } else { - accepts = options.accepts["*"]; - } - $(""). - attr("value", accepts).appendTo(form); - - // Move the file fields into the hidden form, but first remember their - // original locations in the document by replacing them with disabled - // clones. This should also avoid introducing unwanted changes to the - // page layout during submission. - markers = files.after(function(idx) { - var $this = $(this), - $clone = $this.clone().prop("disabled", true); - $this.data("clone", $clone); - return $clone; - }).next(); - files.appendTo(form); - - return { - - // The `send` function is called by jQuery when the request should be - // sent. - send: function(headers, completeCallback) { - iframe = $(""); - - // The first load event gets fired after the iframe has been injected - // into the DOM, and is used to prepare the actual submission. - iframe.one("load", function() { - - // The second load event gets fired when the response to the form - // submission is received. The implementation detects whether the - // actual payload is embedded in a `