Ver código fonte

Updated documentation and IE typos

Kartik Visweswaran 11 anos atrás
pai
commit
1c6f033b42
3 arquivos alterados com 5 adições e 22 exclusões
  1. 4 11
      README.md
  2. 1 11
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js

+ 4 - 11
README.md

@@ -5,7 +5,7 @@ An enhanced HTML 5 file input for Bootstrap 3.x with file preview for images and
 
 
 ## Features  
 ## Features  
 
 
-1. The plugin will convert a simple HTML file input to an advanced file picker control. Will help fallback to a file input for browsers not supporting JQuery or Javascript.
+1. The plugin will convert a simple HTML file input to an advanced file picker control. Will help fallback to a normal HTML file input for browsers not supporting JQuery or Javascript.
 2. The file input consists of the following three sections with options and templates to control the display:
 2. The file input consists of the following three sections with options and templates to control the display:
    - file caption section: to display a brief information of the file(s) selected
    - file caption section: to display a brief information of the file(s) selected
    - file action buttons section: to browse, remove, and upload files.
    - file action buttons section: to browse, remove, and upload files.
@@ -28,13 +28,13 @@ An enhanced HTML 5 file input for Bootstrap 3.x with file preview for images and
 
 
 ## Demo
 ## Demo
 
 
-View the [plugin documentation](http://plugins.krajee.com/fileinput) and [plugin demos](http://plugins.krajee.com/fileinput/demo) at Krajee JQuery plugins. 
+View the [plugin documentation](http://plugins.krajee.com/file-input) and [plugin demos](http://plugins.krajee.com/file-input/demo) at Krajee JQuery plugins. 
 
 
 ## Pre-requisites  
 ## Pre-requisites  
 
 
 1. [Bootstrap 3.x](http://getbootstrap.com/)
 1. [Bootstrap 3.x](http://getbootstrap.com/)
 2. Latest [JQuery](http://jquery.com/)
 2. Latest [JQuery](http://jquery.com/)
-3. Most modern browsers supporting HTML5 file inputs and FileReader API including CSS3 & JQuery. For Internet Explorer, one must use IE versions 10 and above.
+3. Most modern browsers supporting HTML5 file inputs and FileReader API including CSS3 & JQuery. For Internet Explorer, one must use IE versions 10 and above. IE9 and below will work as a normal file input, and will not support multiple file selection or the HTML 5 FileReader API.
 
 
 ## Restrictions
 ## Restrictions
 The plugin supports only file input and preview at client level. It does not actually process the upload of the files to the server.
 The plugin supports only file input and preview at client level. It does not actually process the upload of the files to the server.
@@ -277,13 +277,6 @@ $('#input-id').on('filereset', function(event) {
 ### Plugin Methods
 ### Plugin Methods
 The plugin supports these methods:
 The plugin supports these methods:
 
 
-#### refresh
-Refreshes the file input after changing its value via javascript.
-```js
-$('#input-id').val(3);
-$('#input-id').fileinput('refresh');
-```
-
 #### reset
 #### reset
 Reset the file input.
 Reset the file input.
 ```js
 ```js
@@ -298,4 +291,4 @@ $('#input-id').fileinput('clear');
 
 
 ## License
 ## License
 
 
-**bootstrap-fileinput** is released under the BSD 3-Clause License. See the bundled `LICENSE.md` for details.
+**bootstrap-fileinput** is released under the BSD 3-Clause License. See the bundled `LICENSE.md` for details.

+ 1 - 11
js/fileinput.js

@@ -55,9 +55,6 @@
     var isTextFile = function(type, name) {
     var isTextFile = function(type, name) {
         return (typeof type !== "undefined") ? type.match('text.*') : name.match(/\.(txt|md|csv|htm|html|php|ini)$/i);
         return (typeof type !== "undefined") ? type.match('text.*') : name.match(/\.(txt|md|csv|htm|html|php|ini)$/i);
     };
     };
-    var validateIE = function(content, validation) {
-        return "<!--[if " + validation + "]>" + content + "<![endif]-->";
-    };
     var uniqId = function() {
     var uniqId = function() {
         return Math.round(new Date().getTime() + (Math.random() * 100));
         return Math.round(new Date().getTime() + (Math.random() * 100));
     };
     };
@@ -107,7 +104,6 @@
         this.$previewStatus = getValue(options, 'elPreviewStatus', this.$container.find('.file-preview-status'));
         this.$previewStatus = getValue(options, 'elPreviewStatus', this.$container.find('.file-preview-status'));
         this.$name = this.$element.attr('name') || options.name;
         this.$name = this.$element.attr('name') || options.name;
         this.$hidden = this.$container.find('input[type=hidden][name="' + this.$name + '"]');
         this.$hidden = this.$container.find('input[type=hidden][name="' + this.$name + '"]');
-        this.isIE = (window.navigator.appName == 'Microsoft Internet Explorer');
         if (this.$hidden.length === 0) {
         if (this.$hidden.length === 0) {
             this.$hidden = $('<input type="hidden" />');
             this.$hidden = $('<input type="hidden" />');
             this.$container.prepend(this.$hidden);
             this.$container.prepend(this.$hidden);
@@ -141,13 +137,7 @@
             self.$hidden.val('');
             self.$hidden.val('');
             self.$hidden.attr('name', self.name);
             self.$hidden.attr('name', self.name);
             self.$element.attr('name', '');
             self.$element.attr('name', '');
-
-            if (self.isIE) {
-                self.$container.after(self.$element);
-                self.$container.remove();
-            } else {
-                self.$element.val('');
-            }
+            self.$element.val('');
             if (e !== false) {
             if (e !== false) {
                 self.$element.trigger('change');
                 self.$element.trigger('change');
                 self.$element.trigger('fileclear');
                 self.$element.trigger('fileclear');

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
js/fileinput.min.js


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff