mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
lint login and upload
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { ElementRef } from 'angular2/core';
|
||||
import { FileModel } from '../models/file.model';
|
||||
/**
|
||||
* <file-uploading-dialog [filesUploadingList]="FileModel[]" ></file-uploading-dialog>
|
||||
*
|
||||
* This component is a hideable and minimizable wich contains the list of the uploading
|
||||
* files contained in the filesUploadingList.
|
||||
*
|
||||
* @InputParam {FileModel[]} filesUploadingList - list of the uploading files .
|
||||
*
|
||||
*
|
||||
* @returns {FileUploadingDialogComponent} .
|
||||
*/
|
||||
export declare class FileUploadingDialogComponent {
|
||||
el: ElementRef;
|
||||
filesUploadingList: FileModel[];
|
||||
private _isDialogActive;
|
||||
private _isDialogMinimized;
|
||||
constructor(el: ElementRef);
|
||||
/**
|
||||
* Display and hide the dialog component.
|
||||
*/
|
||||
toggleShowDialog($event: any): void;
|
||||
/**
|
||||
* Display the dialog if hidden.
|
||||
*/
|
||||
showDialog(): void;
|
||||
/**
|
||||
* Minimize and expand the dialog component.
|
||||
*/
|
||||
toggleDialogMinimize($event: any): void;
|
||||
}
|
@@ -4,12 +4,12 @@
|
||||
{{filesUploadingList.length}} {{'FILE_UPLOAD.MESSAGES.COMPLETED' | translate}}
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<div class="minimize-button" [ngClass]="{active: _isDialogMinimized}" (click)="toggleDialogMinimize($event)">
|
||||
<div class="minimize-button" [ngClass]="{active: _isDialogMinimized}" (click)="toggleDialogMinimize()">
|
||||
<i class="material-icons down">keyboard_arrow_down</i>
|
||||
<i class="material-icons up">keyboard_arrow_up</i>
|
||||
</div>
|
||||
|
||||
<div class="close-button" (click)="toggleShowDialog($event)">
|
||||
<div class="close-button" (click)="toggleShowDialog()">
|
||||
<i class="material-icons">clear</i>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,101 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
System.register(['angular2/core', './file-uploading-list.component', 'ng2-translate/ng2-translate'], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var core_1, file_uploading_list_component_1, ng2_translate_1;
|
||||
var FileUploadingDialogComponent;
|
||||
return {
|
||||
setters:[
|
||||
function (core_1_1) {
|
||||
core_1 = core_1_1;
|
||||
},
|
||||
function (file_uploading_list_component_1_1) {
|
||||
file_uploading_list_component_1 = file_uploading_list_component_1_1;
|
||||
},
|
||||
function (ng2_translate_1_1) {
|
||||
ng2_translate_1 = ng2_translate_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
/**
|
||||
* <file-uploading-dialog [filesUploadingList]="FileModel[]" ></file-uploading-dialog>
|
||||
*
|
||||
* This component is a hideable and minimizable wich contains the list of the uploading
|
||||
* files contained in the filesUploadingList.
|
||||
*
|
||||
* @InputParam {FileModel[]} filesUploadingList - list of the uploading files .
|
||||
*
|
||||
*
|
||||
* @returns {FileUploadingDialogComponent} .
|
||||
*/
|
||||
FileUploadingDialogComponent = (function () {
|
||||
function FileUploadingDialogComponent(el) {
|
||||
this.el = el;
|
||||
this._isDialogActive = false;
|
||||
this._isDialogMinimized = false;
|
||||
console.log('FileUploadingDialogComponent constructor', el);
|
||||
}
|
||||
/**
|
||||
* Display and hide the dialog component.
|
||||
*/
|
||||
FileUploadingDialogComponent.prototype.toggleShowDialog = function ($event) {
|
||||
this._isDialogActive = !this._isDialogActive;
|
||||
};
|
||||
/**
|
||||
* Display the dialog if hidden.
|
||||
*/
|
||||
FileUploadingDialogComponent.prototype.showDialog = function () {
|
||||
this._isDialogActive = true;
|
||||
};
|
||||
/**
|
||||
* Minimize and expand the dialog component.
|
||||
*/
|
||||
FileUploadingDialogComponent.prototype.toggleDialogMinimize = function ($event) {
|
||||
this._isDialogMinimized = !this._isDialogMinimized;
|
||||
};
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', Array)
|
||||
], FileUploadingDialogComponent.prototype, "filesUploadingList", void 0);
|
||||
FileUploadingDialogComponent = __decorate([
|
||||
core_1.Component({
|
||||
selector: 'file-uploading-dialog',
|
||||
moduleId: __moduleName,
|
||||
directives: [file_uploading_list_component_1.FileUploadingListComponent],
|
||||
templateUrl: './file-uploading-dialog.component.html',
|
||||
styleUrls: ['./file-uploading-dialog.component.css'],
|
||||
host: { '[class.dialog-show]': 'toggleShowDialog' },
|
||||
pipes: [ng2_translate_1.TranslatePipe]
|
||||
}),
|
||||
__metadata('design:paramtypes', [core_1.ElementRef])
|
||||
], FileUploadingDialogComponent);
|
||||
return FileUploadingDialogComponent;
|
||||
}());
|
||||
exports_1("FileUploadingDialogComponent", FileUploadingDialogComponent);
|
||||
}
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=file-uploading-dialog.component.js.map
|
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"file-uploading-dialog.component.js","sourceRoot":"","sources":["file-uploading-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;YAUH;;;;;;;;;;eAUG;YAUH;gBASI,sCAAmB,EAAc;oBAAd,OAAE,GAAF,EAAE,CAAY;oBAJzB,oBAAe,GAAY,KAAK,CAAC;oBAEjC,uBAAkB,GAAY,KAAK,CAAC;oBAGxC,OAAO,CAAC,GAAG,CAAC,0CAA0C,EAAE,EAAE,CAAC,CAAC;gBAChE,CAAC;gBAED;;mBAEG;gBACH,uDAAgB,GAAhB,UAAiB,MAAM;oBACnB,IAAI,CAAC,eAAe,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC;gBACjD,CAAC;gBAED;;mBAEG;gBACH,iDAAU,GAAV;oBACI,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;gBAChC,CAAC;gBAED;;mBAEG;gBACH,2DAAoB,GAApB,UAAqB,MAAM;oBACvB,IAAI,CAAC,kBAAkB,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC;gBACvD,CAAC;gBA9BD;oBAAC,YAAK,EAAE;;wFAAA;gBAXZ;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,uBAAuB;wBACjC,QAAQ,EAAE,YAAY;wBACtB,UAAU,EAAE,CAAC,0DAA0B,CAAC;wBACxC,WAAW,EAAE,wCAAwC;wBACrD,SAAS,EAAE,CAAC,uCAAuC,CAAC;wBACpD,IAAI,EAAE,EAAC,qBAAqB,EAAE,kBAAkB,EAAC;wBACjD,KAAK,EAAE,CAAC,6BAAa,CAAC;qBACzB,CAAC;;gDAAA;gBAkCF,mCAAC;YAAD,CAAC,AAjCD,IAiCC;YAjCD,uEAiCC,CAAA"}
|
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
@@ -15,11 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {Component, ElementRef, Input} from 'angular2/core';
|
||||
import {FileModel} from '../models/file.model';
|
||||
import {FileUploadingListComponent} from './file-uploading-list.component';
|
||||
import {TranslatePipe} from 'ng2-translate/ng2-translate';
|
||||
import { Component, ElementRef, Input } from 'angular2/core';
|
||||
import { FileModel } from '../models/file.model';
|
||||
import { FileUploadingListComponent } from './file-uploading-list.component';
|
||||
import { TranslatePipe } from 'ng2-translate/ng2-translate';
|
||||
|
||||
declare let __moduleName: string;
|
||||
|
||||
@@ -59,7 +58,7 @@ export class FileUploadingDialogComponent {
|
||||
/**
|
||||
* Display and hide the dialog component.
|
||||
*/
|
||||
toggleShowDialog($event) {
|
||||
toggleShowDialog() {
|
||||
this._isDialogActive = !this._isDialogActive;
|
||||
}
|
||||
|
||||
@@ -73,7 +72,7 @@ export class FileUploadingDialogComponent {
|
||||
/**
|
||||
* Minimize and expand the dialog component.
|
||||
*/
|
||||
toggleDialogMinimize($event) {
|
||||
toggleDialogMinimize() {
|
||||
this._isDialogMinimized = !this._isDialogMinimized;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { ElementRef } from 'angular2/core';
|
||||
import { FileModel } from '../models/file.model';
|
||||
/**
|
||||
* <alfresco-file-uploading-list [filesUploadingList]="FileModel[]" ></alfresco-file-uploading-list>
|
||||
*
|
||||
* This component show a list of the uploading files contained in the filesUploadingList.
|
||||
*
|
||||
* @InputParam {FileModel[]} filesUploadingList - list of the uploading files .
|
||||
*
|
||||
*
|
||||
* @returns {FileUploadingListComponent} .
|
||||
*/
|
||||
export declare class FileUploadingListComponent {
|
||||
el: ElementRef;
|
||||
filesUploadingList: FileModel[];
|
||||
constructor(el: ElementRef);
|
||||
/**
|
||||
* Abort the in progress uploading of a specific file.
|
||||
*
|
||||
* @param {string} id - FileModel id of the file to abort.
|
||||
*/
|
||||
abort(id: any): void;
|
||||
}
|
@@ -1,89 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
System.register(['angular2/core', 'ng2-translate/ng2-translate'], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var core_1, ng2_translate_1;
|
||||
var FileUploadingListComponent;
|
||||
return {
|
||||
setters:[
|
||||
function (core_1_1) {
|
||||
core_1 = core_1_1;
|
||||
},
|
||||
function (ng2_translate_1_1) {
|
||||
ng2_translate_1 = ng2_translate_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
/**
|
||||
* <alfresco-file-uploading-list [filesUploadingList]="FileModel[]" ></alfresco-file-uploading-list>
|
||||
*
|
||||
* This component show a list of the uploading files contained in the filesUploadingList.
|
||||
*
|
||||
* @InputParam {FileModel[]} filesUploadingList - list of the uploading files .
|
||||
*
|
||||
*
|
||||
* @returns {FileUploadingListComponent} .
|
||||
*/
|
||||
FileUploadingListComponent = (function () {
|
||||
function FileUploadingListComponent(el) {
|
||||
this.el = el;
|
||||
console.log('filesUploadingList constructor', el);
|
||||
setInterval(function () {
|
||||
console.log('Check for async update from drag directive');
|
||||
}, 1000);
|
||||
}
|
||||
/**
|
||||
* Abort the in progress uploading of a specific file.
|
||||
*
|
||||
* @param {string} id - FileModel id of the file to abort.
|
||||
*/
|
||||
FileUploadingListComponent.prototype.abort = function (id) {
|
||||
var file = this.filesUploadingList.filter(function (uploadingFileModel) {
|
||||
return uploadingFileModel.id == id;
|
||||
});
|
||||
file[0].setAbort();
|
||||
};
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', Array)
|
||||
], FileUploadingListComponent.prototype, "filesUploadingList", void 0);
|
||||
FileUploadingListComponent = __decorate([
|
||||
core_1.Component({
|
||||
selector: 'alfresco-file-uploading-list',
|
||||
moduleId: __moduleName,
|
||||
templateUrl: './file-uploading-list.component.html',
|
||||
styleUrls: ['./file-uploading-list.component.css'],
|
||||
pipes: [ng2_translate_1.TranslatePipe]
|
||||
}),
|
||||
__metadata('design:paramtypes', [core_1.ElementRef])
|
||||
], FileUploadingListComponent);
|
||||
return FileUploadingListComponent;
|
||||
}());
|
||||
exports_1("FileUploadingListComponent", FileUploadingListComponent);
|
||||
}
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=file-uploading-list.component.js.map
|
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"file-uploading-list.component.js","sourceRoot":"","sources":["file-uploading-list.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;YASH;;;;;;;;;eASG;YAQH;gBAKI,oCAAmB,EAAc;oBAAd,OAAE,GAAF,EAAE,CAAY;oBAC7B,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,EAAE,CAAC,CAAC;oBAElD,WAAW,CAAC;wBACR,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;oBAC9D,CAAC,EAAE,IAAI,CAAC,CAAC;gBACb,CAAC;gBAED;;;;mBAIG;gBACH,0CAAK,GAAL,UAAM,EAAE;oBACJ,IAAI,IAAI,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,UAAC,kBAAkB;wBACzD,MAAM,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,CAAC;oBACvC,CAAC,CAAC,CAAC;oBACH,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;gBACvB,CAAC;gBArBD;oBAAC,YAAK,EAAE;;sFAAA;gBATZ;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,8BAA8B;wBACxC,QAAQ,EAAE,YAAY;wBACtB,WAAW,EAAE,sCAAsC;wBACnD,SAAS,EAAE,CAAC,qCAAqC,CAAC;wBAClD,KAAK,EAAE,CAAC,6BAAa,CAAC;qBACzB,CAAC;;8CAAA;gBAyBF,iCAAC;YAAD,CAAC,AAxBD,IAwBC;YAxBD,mEAwBC,CAAA"}
|
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
@@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
|
||||
import {Component, ElementRef, Input} from 'angular2/core';
|
||||
import {FileModel} from '../models/file.model';
|
||||
import {TranslatePipe} from 'ng2-translate/ng2-translate';
|
||||
import { Component, ElementRef, Input } from 'angular2/core';
|
||||
import { FileModel } from '../models/file.model';
|
||||
import { TranslatePipe } from 'ng2-translate/ng2-translate';
|
||||
|
||||
declare let __moduleName: string;
|
||||
|
||||
@@ -47,9 +47,7 @@ export class FileUploadingListComponent {
|
||||
constructor(public el: ElementRef) {
|
||||
console.log('filesUploadingList constructor', el);
|
||||
|
||||
setInterval(() => {
|
||||
console.log('Check for async update from drag directive');
|
||||
}, 1000);
|
||||
setInterval(() => {console.log('Check for async update from drag directive'); }, 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,9 +55,9 @@ export class FileUploadingListComponent {
|
||||
*
|
||||
* @param {string} id - FileModel id of the file to abort.
|
||||
*/
|
||||
abort(id): void {
|
||||
abort(id: string): void {
|
||||
let file = this.filesUploadingList.filter((uploadingFileModel) => {
|
||||
return uploadingFileModel.id == id;
|
||||
return uploadingFileModel.id === id;
|
||||
});
|
||||
file[0].setAbort();
|
||||
}
|
||||
|
@@ -1,75 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { ElementRef } from 'angular2/core';
|
||||
import { FileModel } from '../models/file.model';
|
||||
import { FileUploadingDialogComponent } from './file-uploading-dialog.component';
|
||||
import { TranslateService } from 'ng2-translate/ng2-translate';
|
||||
/**
|
||||
* <alfresco-upload-button [showDialogUpload]="boolean"
|
||||
* [showUdoNotificationBar]="boolean"
|
||||
* [uploadFolders]="boolean"
|
||||
* [multipleFiles]="boolean"
|
||||
* [acceptedFilesType]="string">
|
||||
* </alfresco-upload-button>
|
||||
*
|
||||
* This component, provide a set of buttons to upload files to alfresco.
|
||||
*
|
||||
* @InputParam {boolean} [true] showDialogUpload - hide/show upload dialog.
|
||||
* @InputParam {boolean} [true] showUdoNotificationBar - hide/show notification bar.
|
||||
* @InputParam {boolean} [false] uploadFolders - allow/disallow upload folders (only for chrome).
|
||||
* @InputParam {boolean} [false] multipleFiles - allow/disallow multiple files.
|
||||
* @InputParam {string} [*] acceptedFilesType - array of allowed file extensions.
|
||||
*
|
||||
*
|
||||
* @returns {UploadDragAreaComponent} .
|
||||
*/
|
||||
export declare class UploadButtonComponent {
|
||||
el: ElementRef;
|
||||
private _uploaderService;
|
||||
undoNotificationBar: any;
|
||||
fileUploadingDialogComponent: FileUploadingDialogComponent;
|
||||
showUploadDialog: boolean;
|
||||
showUdoNotificationBar: boolean;
|
||||
uploadFolders: boolean;
|
||||
multipleFiles: boolean;
|
||||
acceptedFilesType: string;
|
||||
uploaddirectory: string;
|
||||
filesUploadingList: FileModel[];
|
||||
translate: TranslateService;
|
||||
constructor(el: ElementRef, translate: TranslateService);
|
||||
/**
|
||||
* Method called when files are dropped in the drag area.
|
||||
*
|
||||
* @param {File[]} files - files dropped in the drag area.
|
||||
*/
|
||||
onFilesAdded($event: any): void;
|
||||
/**
|
||||
* Show undo notification bar.
|
||||
*
|
||||
* @param {FileModel[]} latestFilesAdded - files in the upload queue enriched with status flag and xhr object.
|
||||
*/
|
||||
private _showUndoNotificationBar(latestFilesAdded);
|
||||
/**
|
||||
* Show the upload dialog.
|
||||
*/
|
||||
private _showDialog();
|
||||
/**
|
||||
* Initial configuration for Multi language
|
||||
* @param translate
|
||||
*/
|
||||
translationInit(translate: TranslateService): void;
|
||||
}
|
@@ -1,194 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
System.register(['angular2/core', '../services/upload.service', './file-uploading-dialog.component', 'ng2-translate/ng2-translate'], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var core_1, upload_service_1, file_uploading_dialog_component_1, ng2_translate_1;
|
||||
var UploadButtonComponent;
|
||||
return {
|
||||
setters:[
|
||||
function (core_1_1) {
|
||||
core_1 = core_1_1;
|
||||
},
|
||||
function (upload_service_1_1) {
|
||||
upload_service_1 = upload_service_1_1;
|
||||
},
|
||||
function (file_uploading_dialog_component_1_1) {
|
||||
file_uploading_dialog_component_1 = file_uploading_dialog_component_1_1;
|
||||
},
|
||||
function (ng2_translate_1_1) {
|
||||
ng2_translate_1 = ng2_translate_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
/**
|
||||
* <alfresco-upload-button [showDialogUpload]="boolean"
|
||||
* [showUdoNotificationBar]="boolean"
|
||||
* [uploadFolders]="boolean"
|
||||
* [multipleFiles]="boolean"
|
||||
* [acceptedFilesType]="string">
|
||||
* </alfresco-upload-button>
|
||||
*
|
||||
* This component, provide a set of buttons to upload files to alfresco.
|
||||
*
|
||||
* @InputParam {boolean} [true] showDialogUpload - hide/show upload dialog.
|
||||
* @InputParam {boolean} [true] showUdoNotificationBar - hide/show notification bar.
|
||||
* @InputParam {boolean} [false] uploadFolders - allow/disallow upload folders (only for chrome).
|
||||
* @InputParam {boolean} [false] multipleFiles - allow/disallow multiple files.
|
||||
* @InputParam {string} [*] acceptedFilesType - array of allowed file extensions.
|
||||
*
|
||||
*
|
||||
* @returns {UploadDragAreaComponent} .
|
||||
*/
|
||||
UploadButtonComponent = (function () {
|
||||
function UploadButtonComponent(el, translate) {
|
||||
this.el = el;
|
||||
this.showUploadDialog = true;
|
||||
this.showUdoNotificationBar = true;
|
||||
this.uploadFolders = false;
|
||||
this.multipleFiles = false;
|
||||
this.acceptedFilesType = '*';
|
||||
this.uploaddirectory = '';
|
||||
this.filesUploadingList = [];
|
||||
console.log('UploadComponent constructor', el);
|
||||
this._uploaderService = new upload_service_1.UploadService({
|
||||
url: 'http://192.168.99.100:8080/alfresco/service/api/upload',
|
||||
withCredentials: true,
|
||||
authToken: btoa('admin:admin'),
|
||||
authTokenPrefix: 'Basic',
|
||||
fieldName: 'filedata',
|
||||
formFields: {
|
||||
siteid: 'swsdp',
|
||||
containerid: 'documentLibrary'
|
||||
}
|
||||
});
|
||||
this.translationInit(translate);
|
||||
}
|
||||
/**
|
||||
* Method called when files are dropped in the drag area.
|
||||
*
|
||||
* @param {File[]} files - files dropped in the drag area.
|
||||
*/
|
||||
UploadButtonComponent.prototype.onFilesAdded = function ($event) {
|
||||
var files = $event.currentTarget.files;
|
||||
if (files.length) {
|
||||
var latestFilesAdded = this._uploaderService.addToQueue(files);
|
||||
this._uploaderService.uploadFilesInTheQueue(this.uploaddirectory);
|
||||
this.filesUploadingList = this._uploaderService.getQueue();
|
||||
if (this.showUploadDialog) {
|
||||
this._showDialog();
|
||||
}
|
||||
if (this.showUdoNotificationBar) {
|
||||
this._showUndoNotificationBar(latestFilesAdded);
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Show undo notification bar.
|
||||
*
|
||||
* @param {FileModel[]} latestFilesAdded - files in the upload queue enriched with status flag and xhr object.
|
||||
*/
|
||||
UploadButtonComponent.prototype._showUndoNotificationBar = function (latestFilesAdded) {
|
||||
if (componentHandler) {
|
||||
componentHandler.upgradeAllRegistered();
|
||||
}
|
||||
this.undoNotificationBar.nativeElement.MaterialSnackbar.showSnackbar({
|
||||
message: this.translate.get('FILE_UPLOAD.MESSAGES.PROGRESS').value,
|
||||
timeout: 5000,
|
||||
actionHandler: function () {
|
||||
latestFilesAdded.forEach(function (uploadingFileModel) {
|
||||
uploadingFileModel.setAbort();
|
||||
});
|
||||
},
|
||||
actionText: this.translate.get('FILE_UPLOAD.ACTION.UNDO').value
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Show the upload dialog.
|
||||
*/
|
||||
UploadButtonComponent.prototype._showDialog = function () {
|
||||
this.fileUploadingDialogComponent.showDialog();
|
||||
};
|
||||
/**
|
||||
* Initial configuration for Multi language
|
||||
* @param translate
|
||||
*/
|
||||
UploadButtonComponent.prototype.translationInit = function (translate) {
|
||||
this.translate = translate;
|
||||
var userLang = navigator.language.split('-')[0]; // use navigator lang if available
|
||||
userLang = /(fr|en)/gi.test(userLang) ? userLang : 'en';
|
||||
this.translate.setDefaultLang(userLang);
|
||||
this.translate.use(userLang);
|
||||
};
|
||||
__decorate([
|
||||
core_1.ViewChild('undoNotificationBar'),
|
||||
__metadata('design:type', Object)
|
||||
], UploadButtonComponent.prototype, "undoNotificationBar", void 0);
|
||||
__decorate([
|
||||
core_1.ViewChild('fileUploadingDialog'),
|
||||
__metadata('design:type', file_uploading_dialog_component_1.FileUploadingDialogComponent)
|
||||
], UploadButtonComponent.prototype, "fileUploadingDialogComponent", void 0);
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', Boolean)
|
||||
], UploadButtonComponent.prototype, "showUploadDialog", void 0);
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', Boolean)
|
||||
], UploadButtonComponent.prototype, "showUdoNotificationBar", void 0);
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', Boolean)
|
||||
], UploadButtonComponent.prototype, "uploadFolders", void 0);
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', Boolean)
|
||||
], UploadButtonComponent.prototype, "multipleFiles", void 0);
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', String)
|
||||
], UploadButtonComponent.prototype, "acceptedFilesType", void 0);
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', String)
|
||||
], UploadButtonComponent.prototype, "uploaddirectory", void 0);
|
||||
UploadButtonComponent = __decorate([
|
||||
core_1.Component({
|
||||
selector: 'alfresco-upload-button',
|
||||
moduleId: __moduleName,
|
||||
directives: [file_uploading_dialog_component_1.FileUploadingDialogComponent],
|
||||
templateUrl: './upload-button.component.html',
|
||||
styleUrls: ['./upload-button.component.css'],
|
||||
pipes: [ng2_translate_1.TranslatePipe]
|
||||
}),
|
||||
__metadata('design:paramtypes', [core_1.ElementRef, ng2_translate_1.TranslateService])
|
||||
], UploadButtonComponent);
|
||||
return UploadButtonComponent;
|
||||
}());
|
||||
exports_1("UploadButtonComponent", UploadButtonComponent);
|
||||
}
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=upload-button.component.js.map
|
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"upload-button.component.js","sourceRoot":"","sources":["upload-button.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAYH;;;;;;;;;;;;;;;;;;eAkBG;YASH;gBAgCI,+BAAmB,EAAc,EACrB,SAA2B;oBADpB,OAAE,GAAF,EAAE,CAAY;oBArBjC,qBAAgB,GAAY,IAAI,CAAC;oBAGjC,2BAAsB,GAAY,IAAI,CAAC;oBAGvC,kBAAa,GAAY,KAAK,CAAC;oBAG/B,kBAAa,GAAY,KAAK,CAAC;oBAG/B,sBAAiB,GAAW,GAAG,CAAC;oBAGhC,oBAAe,GAAW,EAAE,CAAC;oBAE7B,uBAAkB,GAAiB,EAAE,CAAC;oBAMlC,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;oBAE/C,IAAI,CAAC,gBAAgB,GAAG,IAAI,8BAAa,CAAC;wBACtC,GAAG,EAAE,wDAAwD;wBAC7D,eAAe,EAAE,IAAI;wBACrB,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC;wBAC9B,eAAe,EAAE,OAAO;wBACxB,SAAS,EAAE,UAAU;wBACrB,UAAU,EAAE;4BACR,MAAM,EAAE,OAAO;4BACf,WAAW,EAAE,iBAAiB;yBACjC;qBACJ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kHF,4BAAC;YAAD,CAAC,AAjHD,IAiHC;YAjHD,yDAiHC,CAAA"}
|
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
@@ -16,13 +16,13 @@
|
||||
*/
|
||||
|
||||
|
||||
import {Component, ViewChild, ElementRef, Input} from 'angular2/core';
|
||||
import {UploadService} from '../services/upload.service';
|
||||
import {FileModel} from '../models/file.model';
|
||||
import {FileUploadingDialogComponent} from './file-uploading-dialog.component';
|
||||
import {TranslateService, TranslatePipe} from 'ng2-translate/ng2-translate';
|
||||
import { Component, ViewChild, ElementRef, Input } from 'angular2/core';
|
||||
import { UploadService } from '../services/upload.service';
|
||||
import { FileModel } from '../models/file.model';
|
||||
import { FileUploadingDialogComponent } from './file-uploading-dialog.component';
|
||||
import { TranslateService, TranslatePipe } from 'ng2-translate/ng2-translate';
|
||||
|
||||
declare let componentHandler;
|
||||
declare let componentHandler: any;
|
||||
declare let __moduleName: string;
|
||||
|
||||
/**
|
||||
@@ -54,10 +54,8 @@ declare let __moduleName: string;
|
||||
})
|
||||
export class UploadButtonComponent {
|
||||
|
||||
private _uploaderService: UploadService;
|
||||
|
||||
@ViewChild('undoNotificationBar')
|
||||
undoNotificationBar;
|
||||
undoNotificationBar: any;
|
||||
|
||||
@ViewChild('fileUploadingDialog')
|
||||
fileUploadingDialogComponent: FileUploadingDialogComponent;
|
||||
@@ -84,6 +82,8 @@ export class UploadButtonComponent {
|
||||
|
||||
translate: TranslateService;
|
||||
|
||||
private _uploaderService: UploadService;
|
||||
|
||||
constructor(public el: ElementRef,
|
||||
translate: TranslateService) {
|
||||
console.log('UploadComponent constructor', el);
|
||||
@@ -108,7 +108,7 @@ export class UploadButtonComponent {
|
||||
*
|
||||
* @param {File[]} files - files dropped in the drag area.
|
||||
*/
|
||||
onFilesAdded($event): void {
|
||||
onFilesAdded($event: any): void {
|
||||
let files = $event.currentTarget.files;
|
||||
if (files.length) {
|
||||
let latestFilesAdded = this._uploaderService.addToQueue(files);
|
||||
@@ -123,35 +123,6 @@ export class UploadButtonComponent {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show undo notification bar.
|
||||
*
|
||||
* @param {FileModel[]} latestFilesAdded - files in the upload queue enriched with status flag and xhr object.
|
||||
*/
|
||||
private _showUndoNotificationBar(latestFilesAdded) {
|
||||
if (componentHandler) {
|
||||
componentHandler.upgradeAllRegistered();
|
||||
}
|
||||
|
||||
this.undoNotificationBar.nativeElement.MaterialSnackbar.showSnackbar({
|
||||
message: this.translate.get('FILE_UPLOAD.MESSAGES.PROGRESS').value,
|
||||
timeout: 5000,
|
||||
actionHandler: function () {
|
||||
latestFilesAdded.forEach((uploadingFileModel) => {
|
||||
uploadingFileModel.setAbort();
|
||||
});
|
||||
},
|
||||
actionText: this.translate.get('FILE_UPLOAD.ACTION.UNDO').value
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the upload dialog.
|
||||
*/
|
||||
private _showDialog(): void {
|
||||
this.fileUploadingDialogComponent.showDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initial configuration for Multi language
|
||||
* @param translate
|
||||
@@ -165,4 +136,33 @@ export class UploadButtonComponent {
|
||||
|
||||
this.translate.use(userLang);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show undo notification bar.
|
||||
*
|
||||
* @param {FileModel[]} latestFilesAdded - files in the upload queue enriched with status flag and xhr object.
|
||||
*/
|
||||
private _showUndoNotificationBar(latestFilesAdded: FileModel[]) {
|
||||
if (componentHandler) {
|
||||
componentHandler.upgradeAllRegistered();
|
||||
}
|
||||
|
||||
this.undoNotificationBar.nativeElement.MaterialSnackbar.showSnackbar({
|
||||
message: this.translate.get('FILE_UPLOAD.MESSAGES.PROGRESS'),
|
||||
timeout: 5000,
|
||||
actionHandler: function () {
|
||||
latestFilesAdded.forEach((uploadingFileModel: FileModel) => {
|
||||
uploadingFileModel.setAbort();
|
||||
});
|
||||
},
|
||||
actionText: this.translate.get('FILE_UPLOAD.ACTION.UNDO')
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the upload dialog.
|
||||
*/
|
||||
private _showDialog(): void {
|
||||
this.fileUploadingDialogComponent.showDialog();
|
||||
}
|
||||
}
|
||||
|
@@ -1,48 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { ElementRef } from 'angular2/core';
|
||||
import { FileModel } from '../models/file.model';
|
||||
import { FileUploadingDialogComponent } from './file-uploading-dialog.component';
|
||||
/**
|
||||
* <alfresco-upload-drag-area [showDialogUpload]="boolean" ></alfresco-upload-drag-area>
|
||||
*
|
||||
* This component, provide a drag and drop are to upload files to alfresco.
|
||||
*
|
||||
* @InputParam {boolean} [true] showDialogUpload - hide/show upload dialog .
|
||||
*
|
||||
*
|
||||
* @returns {UploadDragAreaComponent} .
|
||||
*/
|
||||
export declare class UploadDragAreaComponent {
|
||||
el: ElementRef;
|
||||
private _uploaderService;
|
||||
fileUploadingDialogComponent: FileUploadingDialogComponent;
|
||||
showUploadDialog: boolean;
|
||||
filesUploadingList: FileModel[];
|
||||
uploaddirectory: string;
|
||||
constructor(el: ElementRef);
|
||||
/**
|
||||
* Method called when files are dropped in the drag area.
|
||||
*
|
||||
* @param {File[]} files - files dropped in the drag area.
|
||||
*/
|
||||
onFilesDropped(files: any): void;
|
||||
/**
|
||||
* Show the upload dialog.
|
||||
*/
|
||||
private _showDialog();
|
||||
}
|
@@ -1,124 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
System.register(['angular2/core', '../services/upload.service', './file-uploading-dialog.component', '../directives/file-draggable.directive'], function(exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
var core_1, upload_service_1, file_uploading_dialog_component_1, file_draggable_directive_1;
|
||||
var UploadDragAreaComponent;
|
||||
return {
|
||||
setters:[
|
||||
function (core_1_1) {
|
||||
core_1 = core_1_1;
|
||||
},
|
||||
function (upload_service_1_1) {
|
||||
upload_service_1 = upload_service_1_1;
|
||||
},
|
||||
function (file_uploading_dialog_component_1_1) {
|
||||
file_uploading_dialog_component_1 = file_uploading_dialog_component_1_1;
|
||||
},
|
||||
function (file_draggable_directive_1_1) {
|
||||
file_draggable_directive_1 = file_draggable_directive_1_1;
|
||||
}],
|
||||
execute: function() {
|
||||
/**
|
||||
* <alfresco-upload-drag-area [showDialogUpload]="boolean" ></alfresco-upload-drag-area>
|
||||
*
|
||||
* This component, provide a drag and drop are to upload files to alfresco.
|
||||
*
|
||||
* @InputParam {boolean} [true] showDialogUpload - hide/show upload dialog .
|
||||
*
|
||||
*
|
||||
* @returns {UploadDragAreaComponent} .
|
||||
*/
|
||||
UploadDragAreaComponent = (function () {
|
||||
function UploadDragAreaComponent(el) {
|
||||
this.el = el;
|
||||
this.showUploadDialog = true;
|
||||
this.filesUploadingList = [];
|
||||
this.uploaddirectory = '';
|
||||
console.log('UploadComponent constructor', el);
|
||||
this._uploaderService = new upload_service_1.UploadService({
|
||||
url: 'http://192.168.99.100:8080/alfresco/service/api/upload',
|
||||
withCredentials: true,
|
||||
authToken: btoa('admin:admin'),
|
||||
authTokenPrefix: 'Basic',
|
||||
fieldName: 'filedata',
|
||||
formFields: {
|
||||
siteid: 'swsdp',
|
||||
containerid: 'documentLibrary'
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Method called when files are dropped in the drag area.
|
||||
*
|
||||
* @param {File[]} files - files dropped in the drag area.
|
||||
*/
|
||||
UploadDragAreaComponent.prototype.onFilesDropped = function (files) {
|
||||
if (files.length) {
|
||||
this._uploaderService.addToQueue(files);
|
||||
this._uploaderService.uploadFilesInTheQueue(this.uploaddirectory);
|
||||
this.filesUploadingList = this._uploaderService.getQueue();
|
||||
if (this.showUploadDialog) {
|
||||
this._showDialog();
|
||||
}
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Show the upload dialog.
|
||||
*/
|
||||
UploadDragAreaComponent.prototype._showDialog = function () {
|
||||
this.fileUploadingDialogComponent.showDialog();
|
||||
};
|
||||
__decorate([
|
||||
core_1.ViewChild('fileUploadingDialog'),
|
||||
__metadata('design:type', file_uploading_dialog_component_1.FileUploadingDialogComponent)
|
||||
], UploadDragAreaComponent.prototype, "fileUploadingDialogComponent", void 0);
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', Boolean)
|
||||
], UploadDragAreaComponent.prototype, "showUploadDialog", void 0);
|
||||
__decorate([
|
||||
core_1.Input(),
|
||||
__metadata('design:type', String)
|
||||
], UploadDragAreaComponent.prototype, "uploaddirectory", void 0);
|
||||
UploadDragAreaComponent = __decorate([
|
||||
core_1.Component({
|
||||
selector: 'alfresco-upload-drag-area',
|
||||
moduleId: __moduleName,
|
||||
directives: [file_draggable_directive_1.FileDraggableDirective, file_uploading_dialog_component_1.FileUploadingDialogComponent],
|
||||
templateUrl: './upload-drag-area.component.html',
|
||||
styleUrls: ['./upload-drag-area.component.css']
|
||||
}),
|
||||
__metadata('design:paramtypes', [core_1.ElementRef])
|
||||
], UploadDragAreaComponent);
|
||||
return UploadDragAreaComponent;
|
||||
}());
|
||||
exports_1("UploadDragAreaComponent", UploadDragAreaComponent);
|
||||
}
|
||||
}
|
||||
});
|
||||
//# sourceMappingURL=upload-drag-area.component.js.map
|
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"upload-drag-area.component.js","sourceRoot":"","sources":["upload-drag-area.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAWH;;;;;;;;;eASG;YAQH;gBAeI,iCAAmB,EAAc;oBAAd,OAAE,GAAF,EAAE,CAAY;oBAPjC,qBAAgB,GAAY,IAAI,CAAC;oBAEjC,uBAAkB,GAAiB,EAAE,CAAC;oBAGtC,oBAAe,GAAW,EAAE,CAAC;oBAGzB,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;oBAE/C,IAAI,CAAC,gBAAgB,GAAG,IAAI,8BAAa,CAAC;wBACtC,GAAG,EAAE,wDAAwD;wBAC7D,eAAe,EAAE,IAAI;wBACrB,SAA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
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
@@ -15,12 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {Component, ViewChild, ElementRef, Input, EventEmitter} from 'angular2/core';
|
||||
import {UploadService} from '../services/upload.service';
|
||||
import {FileModel} from '../models/file.model';
|
||||
import {FileUploadingDialogComponent} from './file-uploading-dialog.component';
|
||||
import {FileDraggableDirective} from '../directives/file-draggable.directive';
|
||||
import { Component, ViewChild, ElementRef, Input } from 'angular2/core';
|
||||
import { UploadService } from '../services/upload.service';
|
||||
import { FileModel } from '../models/file.model';
|
||||
import { FileUploadingDialogComponent } from './file-uploading-dialog.component';
|
||||
import { FileDraggableDirective } from '../directives/file-draggable.directive';
|
||||
|
||||
declare let __moduleName: string;
|
||||
|
||||
@@ -35,63 +34,63 @@ declare let __moduleName: string;
|
||||
* @returns {UploadDragAreaComponent} .
|
||||
*/
|
||||
@Component({
|
||||
selector: 'alfresco-upload-drag-area',
|
||||
moduleId: __moduleName,
|
||||
directives: [FileDraggableDirective, FileUploadingDialogComponent],
|
||||
templateUrl: './upload-drag-area.component.html',
|
||||
styleUrls: ['./upload-drag-area.component.css']
|
||||
selector: 'alfresco-upload-drag-area',
|
||||
moduleId: __moduleName,
|
||||
directives: [FileDraggableDirective, FileUploadingDialogComponent],
|
||||
templateUrl: './upload-drag-area.component.html',
|
||||
styleUrls: ['./upload-drag-area.component.css']
|
||||
})
|
||||
export class UploadDragAreaComponent {
|
||||
|
||||
private _uploaderService: UploadService;
|
||||
private _uploaderService: UploadService;
|
||||
|
||||
@ViewChild('fileUploadingDialog')
|
||||
fileUploadingDialogComponent: FileUploadingDialogComponent;
|
||||
@ViewChild('fileUploadingDialog')
|
||||
fileUploadingDialogComponent: FileUploadingDialogComponent;
|
||||
|
||||
@Input()
|
||||
showUploadDialog: boolean = true;
|
||||
@Input()
|
||||
showUploadDialog: boolean = true;
|
||||
|
||||
filesUploadingList: FileModel [] = [];
|
||||
filesUploadingList: FileModel [] = [];
|
||||
|
||||
@Input()
|
||||
uploaddirectory: string = '';
|
||||
@Input()
|
||||
uploaddirectory: string = '';
|
||||
|
||||
constructor(public el: ElementRef) {
|
||||
console.log('UploadComponent constructor', el);
|
||||
constructor(public el: ElementRef) {
|
||||
console.log('UploadComponent constructor', el);
|
||||
|
||||
this._uploaderService = new UploadService({
|
||||
url: 'http://192.168.99.100:8080/alfresco/service/api/upload',
|
||||
withCredentials: true,
|
||||
authToken: btoa('admin:admin'),
|
||||
authTokenPrefix: 'Basic',
|
||||
fieldName: 'filedata',
|
||||
formFields: {
|
||||
siteid: 'swsdp',
|
||||
containerid: 'documentLibrary'
|
||||
}
|
||||
});
|
||||
this._uploaderService = new UploadService({
|
||||
url: 'http://192.168.99.100:8080/alfresco/service/api/upload',
|
||||
withCredentials: true,
|
||||
authToken: btoa('admin:admin'),
|
||||
authTokenPrefix: 'Basic',
|
||||
fieldName: 'filedata',
|
||||
formFields: {
|
||||
siteid: 'swsdp',
|
||||
containerid: 'documentLibrary'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called when files are dropped in the drag area.
|
||||
*
|
||||
* @param {File[]} files - files dropped in the drag area.
|
||||
*/
|
||||
onFilesDropped(files: File[]): void {
|
||||
if (files.length) {
|
||||
this._uploaderService.addToQueue(files);
|
||||
this._uploaderService.uploadFilesInTheQueue(this.uploaddirectory);
|
||||
this.filesUploadingList = this._uploaderService.getQueue();
|
||||
if (this.showUploadDialog) {
|
||||
this._showDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called when files are dropped in the drag area.
|
||||
*
|
||||
* @param {File[]} files - files dropped in the drag area.
|
||||
*/
|
||||
onFilesDropped(files): void {
|
||||
if (files.length) {
|
||||
this._uploaderService.addToQueue(files);
|
||||
this._uploaderService.uploadFilesInTheQueue(this.uploaddirectory);
|
||||
this.filesUploadingList = this._uploaderService.getQueue();
|
||||
if (this.showUploadDialog) {
|
||||
this._showDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the upload dialog.
|
||||
*/
|
||||
private _showDialog(): void {
|
||||
this.fileUploadingDialogComponent.showDialog();
|
||||
}
|
||||
/**
|
||||
* Show the upload dialog.
|
||||
*/
|
||||
private _showDialog(): void {
|
||||
this.fileUploadingDialogComponent.showDialog();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user