Browse Source

Updates to release 5.2.6 fix #1756

Kartik Visweswaran 3 years ago
parent
commit
5b16acb2ce

+ 6 - 0
CHANGE.md

@@ -1,6 +1,12 @@
 Change Log: `bootstrap-fileinput`
 =================================
 
+## version 5.2.6
+
+**Date**: _under development_
+
+- (enh #1756): Replace `getLoadingUrl` to a new `$h.getZoomPlaceholder` method.
+
 ## version 5.2.5
 
 **Date**: 19-Sep-2021

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
     "name": "bootstrap-fileinput",
-    "version": "5.2.5",
+    "version": "5.2.6",
     "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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * http://plugins.krajee.com/file-input
  *
  * Krajee default styling for bootstrap-fileinput.

+ 1 - 1
examples/index-bs3.html

@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<!-- release v5.2.5, copyright 2014 - 2021 Kartik Visweswaran -->
+<!-- release v5.2.6, copyright 2014 - 2021 Kartik Visweswaran -->
 <!--suppress JSUnresolvedLibraryURL -->
 <html lang="en">
 <head>

+ 1 - 1
examples/index-bs4.html

@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<!-- release v5.2.5, copyright 2014 - 2021 Kartik Visweswaran -->
+<!-- release v5.2.6, copyright 2014 - 2021 Kartik Visweswaran -->
 <!--suppress JSUnresolvedLibraryURL -->
 <html lang="en">
 <head>

+ 1 - 1
examples/index-bs5.html

@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<!-- release v5.2.5, copyright 2014 - 2021 Kartik Visweswaran -->
+<!-- release v5.2.6, copyright 2014 - 2021 Kartik Visweswaran -->
 <!--suppress JSUnresolvedLibraryURL -->
 <html lang="en">
 <head>

+ 16 - 10
js/fileinput.js

@@ -1,5 +1,5 @@
 /*!
- * bootstrap-fileinput v5.2.5
+ * bootstrap-fileinput v5.2.6
  * http://plugins.krajee.com/file-input
  *
  * Author: Kartik Visweswaran
@@ -24,8 +24,8 @@
     $.fn.fileinputThemes = {};
 
     if (!$.fn.fileinputBsVersion) {
-        $.fn.fileinputBsVersion = (window.Alert && window.Alert.VERSION) ||
-            (window.bootstrap && window.bootstrap.Alert && bootstrap.Alert.VERSION) || '3.x.x';
+        var v = (bootstrap && bootstrap.Alert && bootstrap.Alert.VERSION) || (Alert && Alert.VERSION) || '3.x.x';
+        $.fn.fileinputBsVersion = v;
     }
 
     String.prototype.setTokens = function (replacePairs) {
@@ -45,17 +45,14 @@
         };
     }
 
-    var $h, FileInput, getLoadingUrl = function () {
-        var src = document.currentScript.src, srcPath = src.substring(0, src.lastIndexOf("/"));
-        return srcPath.substring(0, srcPath.lastIndexOf("/") + 1) + 'img/loading.gif'
-    };
+    var $h, FileInput;
 
     // fileinput helper object for all global variables and internal helper methods
     $h = {
         FRAMES: '.kv-preview-thumb',
         SORT_CSS: 'file-sortable',
         INIT_FLAG: 'init-',
-        ZOOM_VAR: getLoadingUrl() + '?kvTemp__2873389129__=', // used to prevent 404 errors in URL parsing
+        SCRIPT_SRC: document && document.currentScript && document.currentScript.src || null,
         OBJECT_PARAMS: '<param name="controller" value="true" />\n' +
             '<param name="allowFullScreen" value="true" />\n' +
             '<param name="allowScriptAccess" value="always" />\n' +
@@ -87,6 +84,14 @@
 
         },
         objUrl: window.URL || window.webkitURL,
+        getZoomPlaceholder: function () { // used to prevent 404 errors in URL parsing
+            var src = $h.SCRIPT_SRC, srcPath, zoomVar = '?kvTemp__2873389129__=';
+            if (!src) {
+                return zoomVar;
+            }
+            srcPath = src.substring(0, src.lastIndexOf("/"));
+            return srcPath.substring(0, srcPath.lastIndexOf("/") + 1) + 'img/loading.gif' + zoomVar;
+        },
         isBs: function (ver) {
             var chk = $.trim(($.fn.fileinputBsVersion || '') + '');
             ver = parseInt(ver, 10);
@@ -892,6 +897,7 @@
         _init: function (options, refreshMode) {
             var self = this, f, $el = self.$element, $cont, t, tmp;
             self.options = options;
+            self.zoomPlaceholder = $h.getZoomPlaceholder();
             self.canOrientImage = $h.canOrientImage($el);
             $.each(options, function (key, value) {
                 switch (key) {
@@ -2976,7 +2982,7 @@
                 slideIn = 'slideIn' + dir, slideOut = 'slideOut' + dir, parsed, zoomData = $frame.data('zoom');
             if (zoomData) {
                 zoomData = decodeURIComponent(zoomData);
-                parsed = $zoomPreview.html().replace($h.ZOOM_VAR, '').setTokens({zoomData: zoomData});
+                parsed = $zoomPreview.html().replace(self.zoomPlaceholder, '').setTokens({zoomData: zoomData});
                 $zoomPreview.html(parsed);
                 $frame.data('zoom', '');
                 $zoomPreview.attr('data-zoom', zoomData);
@@ -4235,7 +4241,7 @@
                     'fileid': fileId || '',
                     'typeCss': typeCss,
                     'footer': footer,
-                    'data': zoom && vZoomData ? $h.ZOOM_VAR + '{zoomData}' : vData,
+                    'data': zoom && vZoomData ? self.zoomPlaceholder + '{zoomData}' : vData,
                     'template': templ || cat,
                     'style': styleAttribs ? 'style="' + styleAttribs + '"' : '',
                     'zoomData': vZoomData ? encodeURIComponent(vZoomData) : ''

File diff suppressed because it is too large
+ 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.5</version>
+    <version>5.2.6</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.5",
+    "version": "5.2.6",
     "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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * 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.5
+ * bootstrap-fileinput v5.2.6
  * http://plugins.krajee.com/file-input
  *
  * Glyphicon (default) theme configuration for bootstrap-fileinput.

Some files were not shown because too many files changed in this diff