Explorar el Código

Updates to release v5.2.9 fix #1788

Kartik Visweswaran hace 3 años
padre
commit
1706cb8741

+ 19 - 0
CHANGE.md

@@ -1,6 +1,25 @@
 Change Log: `bootstrap-fileinput`
 =================================
 
+## version 5.2.9
+
+**Date**: _under development_
+
+- (enh #1788): Enhancements to `showUserError` method.
+  - New 3rd parameter `retainErrorHistory` which allows you to retain previous errors (defaults to false) 
+```js
+var $input = $('#file-input-id');
+$input.on('fileuploaderror', function(event, data) {
+  var userMessage = 'We could not process the upload because of a server error.',
+      retainErrorHistory = true; // whether to retain error history
+  // to show error specific to each file pass `data` as received above (the `data` object must contain the `fileId` property)
+  $input.fileinput('showUserError', userMessage, data, retainErrorHistory);
+
+  // to show a constant global error not specific to each file do not pass `data` (uncomment below line to achieve this)
+  // $input.fileinput('showUserError', userMessage); 
+});
+```
+
 ## version 5.2.8
 
 **Date**: 10-May-2022

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "bootstrap-fileinput",
-  "version": "5.2.8",
+  "version": "5.2.9",
   "homepage": "https://github.com/kartik-v/bootstrap-fileinput",
   "authors": [
     "Kartik Visweswaran <[email protected]>"

+ 1 - 1
css/fileinput-rtl.css

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee RTL (Right To Left) default styling for bootstrap-fileinput.

+ 1 - 1
css/fileinput-rtl.min.css

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee RTL (Right To Left) default styling for bootstrap-fileinput.

+ 1 - 1
css/fileinput.css

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee default styling for bootstrap-fileinput.

+ 1 - 1
css/fileinput.min.css

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee default styling for bootstrap-fileinput.

+ 1 - 1
examples/index-bs3.html

@@ -1,5 +1,5 @@
 <!--
-* bootstrap-fileinput v5.2.8
+* bootstrap-fileinput v5.2.9
 * http://plugins.krajee.com/file-input
 *
 * Author: Kartik Visweswaran

+ 1 - 1
examples/index-bs4.html

@@ -1,5 +1,5 @@
 <!--
-* bootstrap-fileinput v5.2.8
+* bootstrap-fileinput v5.2.9
 * http://plugins.krajee.com/file-input
 *
 * Author: Kartik Visweswaran

+ 1 - 1
examples/index-bs5.html

@@ -1,5 +1,5 @@
 <!--
-* bootstrap-fileinput v5.2.8
+* bootstrap-fileinput v5.2.9
 * http://plugins.krajee.com/file-input
 *
 * Author: Kartik Visweswaran

+ 16 - 5
js/fileinput.js

@@ -1,9 +1,9 @@
 /*!
- * bootstrap-fileinput v5.2.7
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Author: Kartik Visweswaran
- * Copyright: 2014 - 2021, Kartik Visweswaran, Krajee.com
+ * Copyright: 2014 - 2022, Kartik Visweswaran, Krajee.com
  *
  * Licensed under the BSD-3-Clause
  * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
@@ -2335,12 +2335,19 @@
             $error.fadeIn(self.fadeDelay);
             self._raise('filefoldererror', [folders, msg]);
         },
-        showUserError: function (msg, params) {
+        showUserError: function (msg, params, retainErrorHistory) {
             var self = this, fileName;
+            if (!self.uploadInitiated) {
+                return;
+            }
             if (!params || !params.fileId) {
-                self.$errorContainer.html('');
+                if (!retainErrorHistory) {
+                    self.$errorContainer.html('');
+                }
             } else {
-                self.$errorContainer.find('[data-file-id="' + params.fileId + '"]').remove();
+                if (!retainErrorHistory) {
+                    self.$errorContainer.find('[data-file-id="' + params.fileId + '"]').remove();
+                }
                 fileName = self.fileManager.getFileName(params.fileId);
                 if (fileName) {
                     msg = '<b>' + fileName + ':</b> ' + msg;
@@ -3226,6 +3233,7 @@
         },
         _resetUpload: function () {
             var self = this;
+            self.uploadInitiated = false;
             self.uploadStartTime = $h.now();
             self.uploadCache = [];
             self.$btnUpload.removeAttr('disabled');
@@ -3619,6 +3627,7 @@
             if (self.enableResumableUpload) { // not enabled for resumable uploads
                 return;
             }
+            self.uploadInitiated = true;
             if (self.showPreview) {
                 $thumb = fm.getThumb(id);
                 $prog = $thumb.find('.file-thumb-progress');
@@ -3665,6 +3674,7 @@
                     }
                     self._setProgress(101);
                     self.ajaxAborted = false;
+                    self.uploadInitiated = false;
                 }, self.processDelay);
             };
             fnBefore = function (jqXHR) {
@@ -5922,6 +5932,7 @@
                 return;
             }
             self.cancelling = false;
+            self.uploadInitiated = true;
             self._showProgress();
             self.lock();
             if (totLen === 0 && hasExtraData) {

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
js/fileinput.min.js


+ 1 - 1
nuget/Package.nuspec

@@ -3,7 +3,7 @@
   <metadata>
     <id>bootstrap-fileinput</id>
 	<title>bootstrap-fileinput</title>
-    <version>5.2.8</version>
+    <version>5.2.9</version>
     <authors>Kartik Visweswaran</authors>
     <owners>Kartik Visweswaran</owners>
     <licenseUrl>https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md</licenseUrl>

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "bootstrap-fileinput",
-  "version": "5.2.8",
+  "version": "5.2.9",
   "homepage": "https://github.com/kartik-v/bootstrap-fileinput",
   "authors": [
     "Kartik Visweswaran <[email protected]>"

+ 1 - 1
scss/fileinput-rtl.scss

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee RTL (Right To Left) default styling for bootstrap-fileinput.

+ 1 - 1
scss/fileinput.scss

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee default styling for bootstrap-fileinput.

+ 1 - 1
scss/themes/explorer-fa/theme.scss

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer Font Awesome 4.x theme style for bootstrap-fileinput. Load this theme file after loading

+ 1 - 1
scss/themes/explorer-fas/theme.scss

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer Font Awesome 5.x theme style for bootstrap-fileinput. Load this theme file after loading

+ 1 - 1
scss/themes/explorer/theme.scss

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer theme style for bootstrap-fileinput. Load this theme file after loading `fileinput.css`.

+ 1 - 1
themes/bs5/theme.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Bootstrap 5.x icon theme configuration for bootstrap-fileinput. Requires bootstrap 5.x icons CSS to be loaded.

+ 1 - 1
themes/bs5/theme.min.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Bootstrap 5.x icon theme configuration for bootstrap-fileinput. Requires bootstrap 5.x icons CSS to be loaded.

+ 1 - 1
themes/explorer-fa/theme.css

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer Font Awesome 5.x theme style for bootstrap-fileinput. Load this theme file after loading

+ 1 - 1
themes/explorer-fa/theme.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer Font Awesome theme configuration for bootstrap-fileinput. 

+ 1 - 1
themes/explorer-fa/theme.min.css

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer Font Awesome 5.x theme style for bootstrap-fileinput. Load this theme file after loading

+ 1 - 1
themes/explorer-fa/theme.min.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer Font Awesome theme configuration for bootstrap-fileinput.

+ 1 - 1
themes/explorer-fas/theme.css

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer Font Awesome 5.x theme style for bootstrap-fileinput. Load this theme file after loading

+ 1 - 1
themes/explorer-fas/theme.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer Font Awesome theme configuration for bootstrap-fileinput.

+ 1 - 1
themes/explorer-fas/theme.min.css

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer Font Awesome 5.x theme style for bootstrap-fileinput. Load this theme file after loading

+ 1 - 1
themes/explorer-fas/theme.min.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer Font Awesome theme configuration for bootstrap-fileinput.

+ 1 - 1
themes/explorer/theme.css

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer theme style for bootstrap-fileinput. Load this theme file after loading `fileinput.css`.

+ 1 - 1
themes/explorer/theme.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer theme configuration for bootstrap-fileinput. Load this theme file after loading `fileinput.js`.

+ 1 - 1
themes/explorer/theme.min.css

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer theme style for bootstrap-fileinput. Load this theme file after loading `fileinput.css`.

+ 1 - 1
themes/explorer/theme.min.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Krajee Explorer theme configuration for bootstrap-fileinput. Load this theme file after loading `fileinput.js`.

+ 1 - 1
themes/fa/theme.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Font Awesome icon theme configuration for bootstrap-fileinput. Requires font awesome assets to be loaded.

+ 1 - 1
themes/fa/theme.min.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Font Awesome icon theme configuration for bootstrap-fileinput. Requires font awesome assets to be loaded.

+ 1 - 1
themes/fas/theme.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Font Awesome 5 icon theme configuration for bootstrap-fileinput. Requires font awesome 5 assets to be loaded.

+ 1 - 1
themes/fas/theme.min.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Font Awesome 5 icon theme configuration for bootstrap-fileinput. Requires font awesome 5 assets to be loaded.

+ 1 - 1
themes/gly/theme.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Glyphicon (default) theme configuration for bootstrap-fileinput.

+ 1 - 1
themes/gly/theme.min.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.8
+ * bootstrap-fileinput v5.2.9
  * http://plugins.krajee.com/file-input
  *
  * Glyphicon (default) theme configuration for bootstrap-fileinput.

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio