Skip to content

Commit

Permalink
Showing 8 changed files with 39 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
version 2.9.0
=============
**Date:** 22-Nov-2014

1. (enh #53): Validations and events for right reset of files when browse button is clicked.
2. (enh #55): Clear the files when file browse dialog is cancelled only if the browser clears the native file input.
3. (enh #56): Trigger new events `filebrowse` and `fileselectnone`.

version 2.8.0
=============
**Date:** 13-Nov-2014
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ wide variety of files i.e. images, text, html, video, audio, flash, and objects.

![File Input Screenshot](https://lh3.googleusercontent.com/-3FiEmc_okc4/VBw_d2LBAJI/AAAAAAAAAL8/KbVj5X9Dus0/w596-h454-no/FileInput.jpg)

> NOTE: The latest version of the plugin v2.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 v2.9.0 has been released. Refer the [CHANGE LOG](https://github.com/kartik-v/bootstrap-fileinput/blob/master/CHANGE.md) for details.
## Features

@@ -715,13 +715,31 @@ This event is triggered when each file image is fully loaded in the preview wind

- `previewId`: the identifier for the preview file container.


**Example:**
```js
$('#input-id').on('fileimageloaded', function(event, previewId) {
console.log("fileimageloaded");
});
```
#### filebrowse
This event is triggered when the file browse button is clicked to open the file selection dialog.

**Example:**
```js
$('#input-id').on('filebrowse', function(event) {
console.log("File browse triggered.");
});
```

#### fileselectnone
This event is triggered when no files are selected by the user for a repeat selection scenario (i.e. on a file input that already contains previously selected files). This event is better applicable for browsers like Google Chrome, which clear the file input when the file selection dialog is cancelled. For other browsers, this event is typically triggered only when one resets the form or clears file input (using the remove button).

**Example:**
```js
$('#input-id').on('fileselectnone', function(event) {
console.log("Huh! No files were selected.");
});
```

### Plugin Methods
The plugin supports these methods:
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-fileinput",
"version": "2.8.0",
"version": "2.9.0",
"homepage": "https://github.com/kartik-v/bootstrap-fileinput",
"authors": [
"Kartik Visweswaran <[email protected]>"
2 changes: 1 addition & 1 deletion css/fileinput.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014
* @package bootstrap-fileinput
* @version 2.8.0
* @version 2.9.0
*
* File input styling for Bootstrap 3.0
* Built for Yii Framework 2.0
2 changes: 1 addition & 1 deletion css/fileinput.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
@@ -62,6 +62,12 @@ <h1>Bootstrap File Input Example</h1>
$('#file-4').fileinput('disable');
}
});
$('#file-4').on('fileselectnone', function() {
alert('Huh! You selected no files.');
});
$('#file-4').on('filebrowse', function() {
alert('File browse clicked for #file-4');
});
$(document).ready(function() {
$("#test-upload").fileinput({
'showPreview' : false,
2 changes: 1 addition & 1 deletion js/fileinput.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014
* @version 2.8.0
* @version 2.9.0
*
* File input styled for Bootstrap 3.0 that utilizes HTML5 File Input's advanced
* features including the FileReader API.
2 changes: 1 addition & 1 deletion js/fileinput.min.js

Large diffs are not rendered by default.

0 comments on commit 10ba6b4

Please sign in to comment.