Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34c0d35c9c | ||
|
|
f67a7a6530 | ||
|
|
f0b2879c4d | ||
|
|
b55c85218e | ||
|
|
282295ce20 | ||
|
|
1a4eb3a0fd | ||
|
|
5af17612cb | ||
|
|
87395e668e | ||
|
|
ad1d710ff1 | ||
|
|
3fec3850b4 | ||
|
|
d218b9665b |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -31,3 +31,8 @@ ng2-file-upload.js.map
|
|||||||
/logs
|
/logs
|
||||||
|
|
||||||
!/demo/components/file-upload/file-catcher.js
|
!/demo/components/file-upload/file-catcher.js
|
||||||
|
|
||||||
|
# AoT generated files
|
||||||
|
factories
|
||||||
|
/**/*.metadata.json
|
||||||
|
/**/*.ngfactory.ts
|
||||||
|
|||||||
@@ -22,3 +22,6 @@ webpack.config.js
|
|||||||
/components/**/*.ts
|
/components/**/*.ts
|
||||||
!/components/**/*.d.ts
|
!/components/**/*.d.ts
|
||||||
|
|
||||||
|
# AoT generated files
|
||||||
|
factories
|
||||||
|
/**/*.ngfactory.ts
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ language: node_js
|
|||||||
node_js:
|
node_js:
|
||||||
- "6"
|
- "6"
|
||||||
|
|
||||||
before_install: npm i -g npm@latest
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- npm run flow.install:typings
|
|
||||||
- npm test
|
- npm test
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
|
|||||||
44
CHANGELOG.md
44
CHANGELOG.md
@@ -1,3 +1,47 @@
|
|||||||
|
<a name="1.1.3-0"></a>
|
||||||
|
## [1.1.3-0](https://github.com/valor-software/ng2-file-upload/compare/v1.1.2...v1.1.3-0) (2016-10-19)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **typing:** added authTokenHeader property to options and file upload class ([b55c852](https://github.com/valor-software/ng2-file-upload/commit/b55c852))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **build:** added support for AoT and ng-cli ([f0b2879](https://github.com/valor-software/ng2-file-upload/commit/f0b2879)), closes [#436](https://github.com/valor-software/ng2-file-upload/issues/436)
|
||||||
|
* **file-upload:** Add the possibility of set the token header ([#213](https://github.com/valor-software/ng2-file-upload/issues/213)) ([282295c](https://github.com/valor-software/ng2-file-upload/commit/282295c))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="1.1.2"></a>
|
||||||
|
## [1.1.2](https://github.com/valor-software/ng2-file-upload/compare/v1.1.1...v1.1.2) (2016-10-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **package:** allow of ng2 v2.0.* and v2.*.* ([87395e6](https://github.com/valor-software/ng2-file-upload/commit/87395e6))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="1.1.1"></a>
|
||||||
|
## [1.1.1](https://github.com/valor-software/ng2-file-upload/compare/v1.0.3...v1.1.1) (2016-10-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **uploader:** Add the ability to upload files via PUT instead of POST ([#239](https://github.com/valor-software/ng2-file-upload/issues/239)) ([e068511](https://github.com/valor-software/ng2-file-upload/commit/e068511))
|
||||||
|
* **zone.js:** error in Safari, Added Typings ([#221](https://github.com/valor-software/ng2-file-upload/issues/221)) ([db77e89](https://github.com/valor-software/ng2-file-upload/commit/db77e89))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **multipart:** Create disableMultipart option in FileUploader ([#224](https://github.com/valor-software/ng2-file-upload/issues/224)) ([22307d2](https://github.com/valor-software/ng2-file-upload/commit/22307d2))
|
||||||
|
* **package:** angular ~2.0.1 stable release ([#425](https://github.com/valor-software/ng2-file-upload/issues/425)) ([3fec385](https://github.com/valor-software/ng2-file-upload/commit/3fec385))
|
||||||
|
* **package:** updated to typescript 2 ([4fef496](https://github.com/valor-software/ng2-file-upload/commit/4fef496))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="1.1.0"></a>
|
<a name="1.1.0"></a>
|
||||||
# [1.1.0](https://github.com/valor-software/ng2-file-upload/compare/v1.0.3...v1.1.0) (2016-09-21)
|
# [1.1.0](https://github.com/valor-software/ng2-file-upload/compare/v1.0.3...v1.1.0) (2016-09-21)
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export interface FileUploaderOptions {
|
|||||||
url?:string;
|
url?:string;
|
||||||
disableMultipart?:boolean;
|
disableMultipart?:boolean;
|
||||||
itemAlias?: string;
|
itemAlias?: string;
|
||||||
|
authTokenHeader?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FileUploader {
|
export class FileUploader {
|
||||||
@@ -40,6 +41,7 @@ export class FileUploader {
|
|||||||
public progress:number = 0;
|
public progress:number = 0;
|
||||||
public _nextIndex:number = 0;
|
public _nextIndex:number = 0;
|
||||||
public autoUpload:any;
|
public autoUpload:any;
|
||||||
|
public authTokenHeader: string;
|
||||||
|
|
||||||
public options:FileUploaderOptions = {
|
public options:FileUploaderOptions = {
|
||||||
autoUpload: false,
|
autoUpload: false,
|
||||||
@@ -59,6 +61,7 @@ export class FileUploader {
|
|||||||
this.options = Object.assign(this.options, options);
|
this.options = Object.assign(this.options, options);
|
||||||
|
|
||||||
this.authToken = options.authToken;
|
this.authToken = options.authToken;
|
||||||
|
this.authTokenHeader = options.authTokenHeader || 'Authorization';
|
||||||
this.autoUpload = options.autoUpload;
|
this.autoUpload = options.autoUpload;
|
||||||
this.options.filters.unshift({name: 'queueLimit', fn: this._queueLimitFilter});
|
this.options.filters.unshift({name: 'queueLimit', fn: this._queueLimitFilter});
|
||||||
|
|
||||||
@@ -74,6 +77,9 @@ export class FileUploader {
|
|||||||
this.options.filters.unshift({name: 'mimeType', fn: this._mimeTypeFilter});
|
this.options.filters.unshift({name: 'mimeType', fn: this._mimeTypeFilter});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(let i = 0; i < this.queue.length; i++) {
|
||||||
|
this.queue[i].url = this.options.url;
|
||||||
|
}
|
||||||
// this.options.filters.unshift({name: 'folder', fn: this._folderFilter});
|
// this.options.filters.unshift({name: 'folder', fn: this._folderFilter});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,7 +347,7 @@ export class FileUploader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.authToken) {
|
if (this.authToken) {
|
||||||
xhr.setRequestHeader('Authorization', this.authToken);
|
xhr.setRequestHeader(this.authTokenHeader, this.authToken);
|
||||||
}
|
}
|
||||||
xhr.send(sendable);
|
xhr.send(sendable);
|
||||||
this._render();
|
this._render();
|
||||||
|
|||||||
50
package.json
50
package.json
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "ng2-file-upload",
|
"name": "ng2-file-upload",
|
||||||
"version": "1.1.0",
|
"version": "1.1.3-0",
|
||||||
"description": "angular2 file upload directives",
|
"description": "angular2 file upload directives",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"flow.compile": "npm run flow.compile:common && npm run flow.compile:system",
|
"flow.compile": "npm run flow.compile:common && npm run flow.compile:system",
|
||||||
"flow.compile:common": "./node_modules/.bin/tsc -p tsconfig.publish.json",
|
"flow.compile:common": "./node_modules/.bin/ngc -p tsconfig.publish.json",
|
||||||
"flow.compile:system": "./.config/bundle-system.js",
|
"flow.compile:system": "./.config/bundle-system.js",
|
||||||
"flow.copy:src": "./node_modules/.bin/cpy ng2-file-upload.ts \"components/*.ts\" ts --parents",
|
"flow.copy:src": "./node_modules/.bin/cpy ng2-file-upload.ts \"components/*.ts\" ts --parents",
|
||||||
"flow.clean": "./node_modules/.bin/del bundles coverage demo-build \"components/**/*.+(js|d.ts|js.map)\" dist \"ng2-file-upload.+(js|d.ts|js.map)\"",
|
"flow.clean": "./node_modules/.bin/del bundles coverage demo-build \"components/**/*.+(js|d.ts|js.map)\" dist \"ng2-file-upload.+(js|d.ts|js.map)\"",
|
||||||
@@ -50,29 +50,31 @@
|
|||||||
"homepage": "https://github.com/valor-software/ng2-file-upload#readme",
|
"homepage": "https://github.com/valor-software/ng2-file-upload#readme",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/common": "2.0.0",
|
"@angular/common": "^2.0.0",
|
||||||
"@angular/compiler": "2.0.0",
|
"@angular/compiler": "^2.0.0",
|
||||||
"@angular/core": "2.0.0",
|
"@angular/core": "^2.0.0",
|
||||||
"@angular/forms": "2.0.0"
|
"@angular/forms": "^2.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/common": "2.0.0",
|
"@angular/common": "2.1.0",
|
||||||
"@angular/compiler": "2.0.0",
|
"@angular/compiler": "^2.1.0",
|
||||||
"@angular/core": "2.0.0",
|
"@angular/compiler-cli": "2.1.0",
|
||||||
"@angular/forms": "2.0.0",
|
"@angular/core": "2.1.0",
|
||||||
"@angular/platform-browser": "2.0.0",
|
"@angular/forms": "2.1.0",
|
||||||
"@angular/platform-browser-dynamic": "2.0.0",
|
"@angular/platform-browser": "2.1.0",
|
||||||
"@types/jasmine": "2.2.34",
|
"@angular/platform-browser-dynamic": "2.1.0",
|
||||||
"@types/node": "6.0.39",
|
"@angular/platform-server": "2.1.0",
|
||||||
"@types/webpack": "1.12.34",
|
"@types/jasmine": "2.5.35",
|
||||||
"async": "2.0.1",
|
"@types/node": "6.0.45",
|
||||||
|
"@types/webpack": "1.12.35",
|
||||||
|
"async": "2.1.2",
|
||||||
"bootstrap": "3.3.7",
|
"bootstrap": "3.3.7",
|
||||||
"codecov": "1.0.1",
|
"codecov": "1.0.1",
|
||||||
"conventional-changelog-cli": "1.2.0",
|
"conventional-changelog-cli": "1.2.0",
|
||||||
"conventional-github-releaser": "1.1.3",
|
"conventional-github-releaser": "1.1.3",
|
||||||
"cpy-cli": "1.0.1",
|
"cpy-cli": "1.0.1",
|
||||||
"del-cli": "0.2.0",
|
"del-cli": "0.2.0",
|
||||||
"es6-promise": "3.3.1",
|
"es6-promise": "4.0.5",
|
||||||
"es6-shim": "0.35.1",
|
"es6-shim": "0.35.1",
|
||||||
"es7-reflect-metadata": "1.6.0",
|
"es7-reflect-metadata": "1.6.0",
|
||||||
"eslint-config-valorsoft": "0.1.0",
|
"eslint-config-valorsoft": "0.1.0",
|
||||||
@@ -80,21 +82,21 @@
|
|||||||
"gitignore-to-glob": "0.2.1",
|
"gitignore-to-glob": "0.2.1",
|
||||||
"gulp": "3.9.1",
|
"gulp": "3.9.1",
|
||||||
"gulp-size": "2.1.0",
|
"gulp-size": "2.1.0",
|
||||||
"gulp-tslint": "6.1.1",
|
"gulp-tslint": "6.1.2",
|
||||||
"lite-server": "2.2.2",
|
"lite-server": "2.2.2",
|
||||||
"marked": "0.3.6",
|
"marked": "0.3.6",
|
||||||
"ng2-bootstrap": "1.1.5",
|
"ng2-bootstrap": "1.1.14",
|
||||||
"ng2-webpack-config": "0.0.5",
|
"ng2-webpack-config": "0.0.5",
|
||||||
"pre-commit": "1.1.3",
|
"pre-commit": "1.1.3",
|
||||||
"prismjs": "1.5.1",
|
"prismjs": "1.5.1",
|
||||||
"prismjs-loader": "0.0.3",
|
"prismjs-loader": "0.0.4",
|
||||||
"reflect-metadata": "0.1.8",
|
"reflect-metadata": "0.1.8",
|
||||||
"require-dir": "0.3.0",
|
"require-dir": "0.3.1",
|
||||||
"rxjs": "5.0.0-beta.12",
|
"rxjs": "5.0.0-beta.12",
|
||||||
"systemjs-builder": "0.15.31",
|
"systemjs-builder": "0.15.32",
|
||||||
"tslint-config-valorsoft": "1.1.1",
|
"tslint-config-valorsoft": "1.1.1",
|
||||||
"typescript": "2.0.2",
|
"typescript": "2.0.3",
|
||||||
"zone.js": "0.6.25"
|
"zone.js": "0.6.26"
|
||||||
},
|
},
|
||||||
"contributors": [
|
"contributors": [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user