Browse Source

Upgraded to release v1.9.0

Kartik Visweswaran 10 năm trước cách đây
mục cha
commit
bdc6bcf32e
6 tập tin đã thay đổi với 23 bổ sung18 xóa
  1. 5 6
      CHANGE.md
  2. 2 2
      README.md
  3. 1 1
      bower.json
  4. 4 1
      examples/index.html
  5. 11 8
      js/fileinput.js
  6. 0 0
      js/fileinput.min.js

+ 5 - 6
CHANGE.md

@@ -1,13 +1,13 @@
 version 1.8.0
 =============
-Date: 15-Jul-2014
+**Date:** 15-Jul-2014
 
 ### Additions
 1. (enh #9): Enhanced caption template and styling for captions to prevent overflow of long file names out of the caption container.
 
 version 1.7.0
 =============
-Date: 02-Jul-2014
+**Date:** 02-Jul-2014
 
 ### Additions
 1. The plugin now offers an additional `overwriteInitial` option. This is by default set to `true`, whereby, any `initialPreview`
@@ -16,7 +16,7 @@ Date: 02-Jul-2014
 
 version 1.6.0
 =============
-Date: 03-Jun-2014
+**Date:** 03-Jun-2014
 
 ### Additions
 1. The plugin now offers an additional `refresh` method. This enables you to dynamically change element attributes or plugin options
@@ -24,7 +24,7 @@ Date: 03-Jun-2014
 
 version 1.5.0
 =============
-Date: 23-May-2014
+**Date:** 23-May-2014
 
 ### Additions
 1. The plugin now offers an option to display initial preview of images/text/other files. This is useful
@@ -40,10 +40,9 @@ Date: 23-May-2014
 - elPreviewImage
 - elPreviewStatus
 
-
 version 1.0.0
 =============
-Date: 01-Jan-2014 
+**Date:** 01-Jan-2014 
 
 Initial release. The following features are included in this release:
 

+ 2 - 2
README.md

@@ -5,7 +5,7 @@ An enhanced HTML 5 file input for Bootstrap 3.x with file preview for images and
 
 ![File Input Screenshot](https://lh6.googleusercontent.com/-2niyujIaat0/UyqzA_78OQI/AAAAAAAAADE/f6IJkr11uA8/w666-h418-no/fileinput-screenshot.jpg)
 
-> NOTE: The latest version of the plugin v1.8.0 has been released. Refer the [CHANGE LOG](https://github.com/kartik-v/bootstrap-fileinput/blob/master/CHANGE.md) for details.
+> NOTE: The latest version of the plugin v1.9.0 has been released. Refer the [CHANGE LOG](https://github.com/kartik-v/bootstrap-fileinput/blob/master/CHANGE.md) for details.
 
 ## Features  
 
@@ -74,7 +74,7 @@ You can also manually install the plugin easily to your project. Just download t
 Step 1: Load the following assets in your header. 
 
 ```html
-<link href="http://netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
+<link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet">
 <link href="path/to/css/fileinput.min.css" media="all" rel="stylesheet" type="text/css" />
 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
 <script src="path/to/js/fileinput.min.js" type="text/javascript"></script>

+ 1 - 1
bower.json

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

+ 4 - 1
examples/index.html

@@ -13,7 +13,10 @@
             <h1>Bootstrap File Input Example</h1>
             <form enctype="multipart/form-data">
                 <div class="form-group">
-                    <input id="file-1" type="file" class="file" multiple=true data-preview-file-type="any">
+                    <input id="file-1" type="file" multiple=true data-preview-file-type="any">
+                </div>
+                <div class="form-group">
+                    <input id="file-1a" type="file" class="file" data-preview-file-type="any" data-initial-caption="Kartik" data-overwrite-initial="false">
                 </div>
                 <div class="form-group">
                     <input id="file-2" type="file" class="file" readonly=true>

+ 11 - 8
js/fileinput.js

@@ -170,13 +170,18 @@
             else if (len > 0) {
                 html = '<div class="file-preview-frame">' + content + '</div>';
             }
+            else if (cap > 0) {
+                self.$caption.html(caption);
+                self.$captionContainer.attr('title', caption);
+                return;
+            }
             else {
                 return;
             }
             self.initialPreviewContent = html;
             self.$preview.html(html);
             self.$caption.html(caption);
-            self.$captionContainer.attr('title', caption);            
+            self.$captionContainer.attr('title', caption);
             self.$container.removeClass('file-input-new');
         },
         clear: function (e) {
@@ -196,7 +201,9 @@
             }
             else {
                 self.$preview.html('');
-                self.$caption.html('');
+                var cap = (!self.overwriteInitial && self.initialCaption.length > 0) ? 
+                    self.original.caption : '';
+                self.$caption.html(cap);
                 self.$captionContainer.attr('title', '');
                 self.$container.removeClass('file-input-new').addClass('file-input-new');
             }
@@ -421,17 +428,13 @@
         elPreviewImage: null,
         elPreviewStatus: null
     };
-
-    var $input = $('input.file[type=file]'), count = Object.keys($input).length;
-
-    if (count > 0) {
-        $input.addClass('file-loading');
-    }
+    
     /**
      * Convert automatically file inputs with class 'file'
      * into a bootstrap fileinput control.
      */
     $(document).ready(function () {
+        var $input = $('input.file[type=file]'), count = Object.keys($input).length;
         if (count > 0) {
             $input.fileinput();
         }

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
js/fileinput.min.js


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác