Skip to content

Commit a4217d1

Browse files
author
nerv
committed
Updated: docs & predefined filters (nervgh#105, nervgh#108)
1 parent 10cac0f commit a4217d1

File tree

11 files changed

+33
-42
lines changed

11 files changed

+33
-42
lines changed

README.md

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,10 @@ uploader.filters.push(function(item) {
115115
});
116116
```
117117

118-
### The default filter
118+
### Predefined filters
119119

120-
The queue already has registered a default filter that looks like this:
121-
122-
```javascript
123-
function(item) {
124-
return angular.isElement(item) ? true : !!item.size;
125-
}
126-
```
120+
1. [emptyFileFilter](https://github.com/nervgh/angular-file-upload/blob/v0.4.1/src/scripts/services/%24fileUploader.js#L58)
121+
2. [queueLimitFilter](https://github.com/nervgh/angular-file-upload/blob/v0.4.1/src/scripts/services/%24fileUploader.js#L68)
127122

128123
## Events
129124

@@ -302,14 +297,10 @@ uploader.filters.push(function(item) {
302297
});
303298
```
304299

305-
### Стандартный фильтр
300+
### Предустановленные фильтры
306301

307-
По умолчанию в массиве фильтров уже присутствует один фильтр, который имеет вид:
308-
```javascript
309-
function(item) {
310-
return angular.isElement(item) ? true : !!item.size;
311-
}
312-
```
302+
1. [emptyFileFilter](https://github.com/nervgh/angular-file-upload/blob/v0.4.1/src/scripts/services/%24fileUploader.js#L58)
303+
2. [queueLimitFilter](https://github.com/nervgh/angular-file-upload/blob/v0.4.1/src/scripts/services/%24fileUploader.js#L68)
313304

314305
## События
315306

@@ -342,18 +333,18 @@ uploader.bind('progress', function(event, item, progress) {
342333

343334
```javascript
344335
// Add a item to the queue
345-
var item = {
346-
file: {
347-
name: 'Your file name',
348-
size: 1e6
349-
},
350-
progress: 100,
351-
isUploaded: true,
352-
isSuccess: true
353-
};
354-
item.remove = function() {
355-
uploader.removeFromQueue(this);
356-
};
357-
uploader.queue.push(item);
358-
uploader.progress = 100;
336+
var item = {
337+
file: {
338+
name: 'Your file name',
339+
size: 1e6
340+
},
341+
progress: 100,
342+
isUploaded: true,
343+
isSuccess: true
344+
};
345+
item.remove = function() {
346+
uploader.removeFromQueue(this);
347+
};
348+
uploader.queue.push(item);
349+
uploader.progress = 100;
359350
```

angular-file-upload.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Angular File Upload v0.4.1
2+
Angular File Upload v0.5.4
33
https://github.com/nervgh/angular-file-upload
44
*/
55
(function(angular, factory) {
@@ -116,8 +116,8 @@ app.factory('$fileUploader', ['$compile', '$rootScope', '$http', '$window', func
116116
}, params);
117117

118118
// add default filters
119-
this.filters.unshift(this._emptyFileFilter);
120119
this.filters.unshift(this._queueLimitFilter);
120+
this.filters.unshift(this._emptyFileFilter);
121121

122122
this.scope.$on('file:add', function(event, items, options) {
123123
event.stopPropagation();

angular-file-upload.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

angular-file-upload.min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-file-upload",
3-
"version": "0.4.1",
3+
"version": "0.5.4",
44
"main": "angular-file-upload.js",
55
"homepage": "https://github.com/nervgh/angular-file-upload",
66
"ignore": ["examples"],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Angular File Upload",
3-
"version": "0.4.1",
3+
"version": "0.5.4",
44
"homepage": "https://github.com/nervgh/angular-file-upload",
55
"description": "Angular File Upload is a module for the AngularJS framework",
66
"author": {

src/scripts/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* The angular file upload module
33
* @author: nerv
4-
* @version: 0.5.3, 2014-04-13
4+
* @version: 0.5.4, 2014-04-13
55
*/
66
var app = angular.module('angularFileUpload', []);

src/scripts/directives/ngFileDrop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* The angular file upload module
33
* @author: nerv
4-
* @version: 0.5.3, 2014-04-13
4+
* @version: 0.5.4, 2014-04-13
55
*/
66

77
// It is attached to an element that catches the event drop file

src/scripts/directives/ngFileOver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* The angular file upload module
33
* @author: nerv
4-
* @version: 0.5.3, 2014-04-13
4+
* @version: 0.5.4, 2014-04-13
55
*/
66

77
// It is attached to an element which will be assigned to a class "ng-file-over" or ng-file-over="className"

src/scripts/directives/ngFileSelect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* The angular file upload module
33
* @author: nerv
4-
* @version: 0.5.3, 2014-04-13
4+
* @version: 0.5.4, 2014-04-13
55
*/
66

77
// It is attached to <input type="file"> element like <ng-file-select="options">

0 commit comments

Comments
 (0)