Bläddra i källkod

Updated documentation and IE typos

Kartik Visweswaran 11 år sedan
förälder
incheckning
1c6f033b42
3 ändrade filer med 5 tillägg och 22 borttagningar
  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  
 
-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:
    - file caption section: to display a brief information of the file(s) selected
    - 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
 
-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  
 
 1. [Bootstrap 3.x](http://getbootstrap.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
 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
 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 the file input.
 ```js
@@ -298,4 +291,4 @@ $('#input-id').fileinput('clear');
 
 ## 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) {
         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() {
         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.$name = this.$element.attr('name') || options.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) {
             this.$hidden = $('<input type="hidden" />');
             this.$container.prepend(this.$hidden);
@@ -141,13 +137,7 @@
             self.$hidden.val('');
             self.$hidden.attr('name', self.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) {
                 self.$element.trigger('change');
                 self.$element.trigger('fileclear');

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
js/fileinput.min.js


Vissa filer visades inte eftersom för många filer har ändrats