|
@@ -1,5 +1,5 @@
|
|
|
<!--
|
|
|
-* bootstrap-fileinput v5.2.9
|
|
|
+* bootstrap-fileinput v5.5.0
|
|
|
* http://plugins.krajee.com/file-input
|
|
|
*
|
|
|
* Author: Kartik Visweswaran
|
|
@@ -14,18 +14,20 @@
|
|
|
<meta charset="UTF-8"/>
|
|
|
<title>Krajee JQuery Plugins - Bootstrap 5.x - © Kartik</title>
|
|
|
|
|
|
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" crossorigin="anonymous">
|
|
|
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected].3/dist/css/bootstrap.min.css" crossorigin="anonymous">
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css" crossorigin="anonymous">
|
|
|
<link href="../css/fileinput.css" media="all" rel="stylesheet" type="text/css"/>
|
|
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css" crossorigin="anonymous">
|
|
|
<link href="../themes/explorer-fa5/theme.css" media="all" rel="stylesheet" type="text/css"/>
|
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js" crossorigin="anonymous"></script>
|
|
|
+ <script src="../js/plugins/buffer.min.js" type="text/javascript"></script>
|
|
|
+ <script src="../js/plugins/filetype.min.js" type="text/javascript"></script>
|
|
|
<script src="../js/plugins/piexif.js" type="text/javascript"></script>
|
|
|
<script src="../js/plugins/sortable.js" type="text/javascript"></script>
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class="container my-4">
|
|
|
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
|
|
|
+ <script src="https://cdn.jsdelivr.net/npm/[email protected].3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
|
|
|
<script src="../js/fileinput.js" type="text/javascript"></script>
|
|
|
<script src="../js/locales/fr.js" type="text/javascript"></script>
|
|
|
<script src="../js/locales/es.js" type="text/javascript"></script>
|
|
@@ -33,10 +35,11 @@
|
|
|
<script src="../themes/explorer-fa5/theme.js" type="text/javascript"></script>
|
|
|
<h1>Bootstrap File Input Examples
|
|
|
<small><a href="https://github.com/kartik-v/bootstrap-fileinput-samples"><i
|
|
|
- class="glyphicon glyphicon-download"></i> Download Sample Files</a></small>
|
|
|
+ class="fas fa-download"></i> Download Sample Files</a></small>
|
|
|
</h1>
|
|
|
<h4>Bootstrap Version: <script>document.write($.fn.fileinputBsVersion);</script></h4>
|
|
|
<hr>
|
|
|
+
|
|
|
<form enctype="multipart/form-data">
|
|
|
<div class="file-loading">
|
|
|
<input id="kv-explorer" type="file" multiple>
|
|
@@ -139,6 +142,13 @@
|
|
|
</div>
|
|
|
</form>
|
|
|
<hr>
|
|
|
+ <h4>Test <code>addToStack</code></h4>
|
|
|
+ <label>Select file below which will automatically be added to the plugin preview later</label>
|
|
|
+ <div class="input-group mb-3">
|
|
|
+ <input type="file" class="form-control" id="inp-add-1">
|
|
|
+ </div>
|
|
|
+ <hr>
|
|
|
+ <input type="file" id="inp-add-2" name="inp-add-2" multiple>
|
|
|
<br>
|
|
|
</div>
|
|
|
</body>
|
|
@@ -185,14 +195,14 @@
|
|
|
initialPreviewAsData: true,
|
|
|
//uploadUrl: 'http://localhost/plugins/test-upload',
|
|
|
initialPreview: [
|
|
|
- "http://lorempixel.com/640/360/transport/1",
|
|
|
- "http://lorempixel.com/640/360/transport/2",
|
|
|
- "http://lorempixel.com/640/360/transport/3"
|
|
|
+ "https://dummyimage.com/640x360/a0f.png&text=Transport+1",
|
|
|
+ "https://dummyimage.com/640x360/3a8.png&text=Transport+2",
|
|
|
+ "https://dummyimage.com/640x360/6ff.png&text=Transport+3"
|
|
|
],
|
|
|
initialPreviewConfig: [
|
|
|
- {caption: "transport-1.jpg", size: 329892, width: "120px", url: "{$url}", key: 1, zoomData: 'http://lorempixel.com/1920/1080/transport/1', description: '<h5>NUMBER 1</h5> The first choice for transport. This is the future.'},
|
|
|
- {caption: "transport-2.jpg", size: 872378, width: "120px", url: "{$url}", key: 2, zoomData: 'http://lorempixel.com/1920/1080/transport/2', description: '<h5>NUMBER 2</h5> The second choice for transport. This is the future.'},
|
|
|
- {caption: "transport-3.jpg", size: 632762, width: "120px", url: "{$url}", key: 3, zoomData: 'http://lorempixel.com/1920/1080/transport/3', description: '<h5>NUMBER 3</h5> The third choice for transport. This is the future.'}
|
|
|
+ {caption: "transport-1.jpg", size: 329892, width: "120px", url: "{$url}", key: 1, zoomData: 'https://dummyimage.com/1920x1080/a0f.png&text=Transport+1', description: '<h5>NUMBER 1</h5> The first choice for transport. This is the future.'},
|
|
|
+ {caption: "transport-2.jpg", size: 872378, width: "120px", url: "{$url}", key: 2, zoomData: 'https://dummyimage.com/1920x1080/3a8.png&text=Transport+2', description: '<h5>NUMBER 2</h5> The second choice for transport. This is the future.'},
|
|
|
+ {caption: "transport-3.jpg", size: 632762, width: "120px", url: "{$url}", key: 3, zoomData: 'https://dummyimage.com/1920x1080/6ff.png&text=Transport+3', description: '<h5>NUMBER 3</h5> The third choice for transport. This is the future.'}
|
|
|
]
|
|
|
}).on('filebatchpreupload', function(e, data) {
|
|
|
return {
|
|
@@ -236,9 +246,9 @@
|
|
|
overwriteInitial: false,
|
|
|
initialPreviewAsData: true,
|
|
|
initialPreview: [
|
|
|
- "http://lorempixel.com/1920/1080/nature/1",
|
|
|
- "http://lorempixel.com/1920/1080/nature/2",
|
|
|
- "http://lorempixel.com/1920/1080/nature/3"
|
|
|
+ "https://dummyimage.com/1920x1080/1aa.png&text=Nature+1",
|
|
|
+ "https://dummyimage.com/1920x1080/2ef.png&text=Nature+2",
|
|
|
+ "https://dummyimage.com/1920x1080/3f0.png&text=Nature+3"
|
|
|
],
|
|
|
initialPreviewConfig: [
|
|
|
{caption: "nature-1.jpg", size: 329892, width: "120px", url: "{$url}", key: 1},
|
|
@@ -251,6 +261,25 @@
|
|
|
alert('i = ' + index + ', id = ' + previewId + ', file = ' + file.name);
|
|
|
});
|
|
|
*/
|
|
|
+ $('#inp-add-1').on('change', function() {
|
|
|
+ var $plugin = $('#inp-add-2').data('fileinput');
|
|
|
+ $plugin.addToStack($(this)[0].files[0])
|
|
|
+ });
|
|
|
+ $('#inp-add-2').fileinput({
|
|
|
+ uploadUrl: '#',
|
|
|
+ //uploadUrl: 'http://localhost/plugins/test-upload',
|
|
|
+ initialPreviewAsData: true,
|
|
|
+ initialPreview: [
|
|
|
+ "https://dummyimage.com/640x360/a0f.png&text=Transport+1",
|
|
|
+ "https://dummyimage.com/640x360/3a8.png&text=Transport+2",
|
|
|
+ "https://dummyimage.com/640x360/6ff.png&text=Transport+3"
|
|
|
+ ],
|
|
|
+ initialPreviewConfig: [
|
|
|
+ {caption: "transport-1.jpg", size: 329892, width: "120px", url: "{$url}", key: 1, zoomData: 'https://dummyimage.com/1920x1080/a0f.png&text=Transport+1', description: '<h5>NUMBER 1</h5> The first choice for transport. This is the future.'},
|
|
|
+ {caption: "transport-2.jpg", size: 872378, width: "120px", url: "{$url}", key: 2, zoomData: 'https://dummyimage.com/1920x1080/3a8.png&text=Transport+2', description: '<h5>NUMBER 2</h5> The second choice for transport. This is the future.'},
|
|
|
+ {caption: "transport-3.jpg", size: 632762, width: "120px", url: "{$url}", key: 3, zoomData: 'https://dummyimage.com/1920x1080/6ff.png&text=Transport+3', description: '<h5>NUMBER 3</h5> The third choice for transport. This is the future.'}
|
|
|
+ ]
|
|
|
+ });
|
|
|
});
|
|
|
</script>
|
|
|
</html>
|