diff --git a/demo-shell-ng2/app/app.component.ts b/demo-shell-ng2/app/app.component.ts index 3a4b12456e..9ee34cfbdd 100644 --- a/demo-shell-ng2/app/app.component.ts +++ b/demo-shell-ng2/app/app.component.ts @@ -23,7 +23,7 @@ import {AlfrescoLoginComponent} from 'ng2-alfresco-login/ng2-alfresco-login'; import {AuthRouterOutlet} from './components/router/AuthRouterOutlet'; import {AlfrescoSettingsService} from 'ng2-alfresco-core/services'; import {TranslateService, TranslatePipe} from 'ng2-translate/ng2-translate'; -import {UploadComponent} from 'ng2-alfresco-upload/ng2-alfresco-upload'; +import {UploadButtonComponent} from 'ng2-alfresco-upload/ng2-alfresco-upload'; declare var document: any; @@ -36,7 +36,7 @@ declare var document: any; @RouteConfig([ {path: '/home', name: 'Home', component: FilesComponent}, {path: '/', name: 'Files', component: FilesComponent, useAsDefault: true}, - {path: '/uploader', name: 'Uploader', component: UploadComponent}, + {path: '/uploader', name: 'Uploader', component: UploadButtonComponent}, {path: '/login', name: 'Login', component: AlfrescoLoginComponent} ]) export class AppComponent { diff --git a/demo-shell-ng2/app/components/files/files.component.html b/demo-shell-ng2/app/components/files/files.component.html index c54e531af9..0ababbbf13 100644 --- a/demo-shell-ng2/app/components/files/files.component.html +++ b/demo-shell-ng2/app/components/files/files.component.html @@ -23,33 +23,35 @@
- - - - - - - + + + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + +
diff --git a/demo-shell-ng2/app/components/files/files.component.ts b/demo-shell-ng2/app/components/files/files.component.ts index 96ee64f5c4..d3a64b2333 100644 --- a/demo-shell-ng2/app/components/files/files.component.ts +++ b/demo-shell-ng2/app/components/files/files.component.ts @@ -14,6 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + + import {Component} from 'angular2/core'; import { DOCUMENT_LIST_DIRECTIVES, @@ -21,6 +23,7 @@ import { DocumentActionsService } from 'ng2-alfresco-documentlist/ng2-alfresco-documentlist'; import {MDL} from 'ng2-alfresco-core/material'; +import {ALFRESCO_ULPOAD_COMPONENT, ALFRESCO_ULPOAD_PROVAIDERS} from 'ng2-alfresco-upload/ng2-alfresco-upload'; declare let __moduleName:string; @@ -28,14 +31,14 @@ declare let __moduleName:string; moduleId: __moduleName, selector: 'files-component', templateUrl: './files.component.html', - directives: [DOCUMENT_LIST_DIRECTIVES, MDL], - providers: [DOCUMENT_LIST_PROVIDERS] + directives: [DOCUMENT_LIST_DIRECTIVES, MDL, ALFRESCO_ULPOAD_COMPONENT], + providers: [DOCUMENT_LIST_PROVIDERS, ALFRESCO_ULPOAD_PROVAIDERS] }) export class FilesComponent { breadcrumb: boolean = false; navigation: boolean = true; events: any[] = []; - + constructor(documentActions: DocumentActionsService) { documentActions.setHandler('my-handler', this.myDocumentActionHandler.bind(this)); } diff --git a/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js b/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js index 1dd8c06a1d..3251fea7db 100644 --- a/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js +++ b/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js @@ -1,3 +1,19 @@ +/** + * @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'], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; @@ -32,6 +48,10 @@ System.register(['angular2/core'], function(exports_1, context_1) { enumerable: true, configurable: true }); + AlfrescoSettingsService.prototype.getAuthToken = function () { + // todo: get proper token value + return 'Basic ' + btoa('admin:admin'); + }; AlfrescoSettingsService = __decorate([ core_1.Injectable(), __metadata('design:paramtypes', []) diff --git a/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js.map b/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js.map index ef574b7b6e..17f931e1fd 100644 --- a/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js.map +++ b/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js.map @@ -1 +1 @@ -{"version":3,"file":"AlfrescoSettingsService.js","sourceRoot":"","sources":["AlfrescoSettingsService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;YAmBA;gBAAA;oBACY,UAAK,GAAW,uBAAuB,CAAC;gBASpD,CAAC;gBAPG,sBAAW,yCAAI;yBAAf;wBACI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;oBACtB,CAAC;yBAED,UAAgB,KAAY;wBACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;oBACvB,CAAC;;;mBAJA;gBANL;oBAAC,iBAAU,EAAE;;2CAAA;gBAWb,8BAAC;YAAD,CAAC,AAVD,IAUC;YAVD,6DAUC,CAAA"} \ No newline at end of file +{"version":3,"file":"AlfrescoSettingsService.js","sourceRoot":"","sources":["AlfrescoSettingsService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;YAKH;gBAAA;oBACY,UAAK,GAAW,uBAAuB,CAAC;gBAcpD,CAAC;gBAZG,sBAAW,yCAAI;yBAAf;wBACI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;oBACtB,CAAC;yBAED,UAAgB,KAAY;wBACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;oBACvB,CAAC;;;mBAJA;gBAMD,8CAAY,GAAZ;oBACI,+BAA+B;oBAC/B,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;gBAC1C,CAAC;gBAfL;oBAAC,iBAAU,EAAE;;2CAAA;gBAgBb,8BAAC;YAAD,CAAC,AAfD,IAeC;YAfD,6DAeC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/ng2-alfresco-documentlist.js b/ng2-components/ng2-alfresco-documentlist/ng2-alfresco-documentlist.js index c7e179bf62..e4c2d7309e 100644 --- a/ng2-components/ng2-alfresco-documentlist/ng2-alfresco-documentlist.js +++ b/ng2-components/ng2-alfresco-documentlist/ng2-alfresco-documentlist.js @@ -1,7 +1,7 @@ -System.register(['./src/components/document-list', './src/components/document-action', './src/components/document-action-list', './src/components/quick-document-action', './src/components/quick-document-action-list', './src/components/folder-action', './src/components/folder-action-list', './src/components/quick-folder-action', './src/components/quick-folder-action-list', './src/services/folder-actions.service', './src/services/document-actions.service'], function(exports_1, context_1) { +System.register(['./src/components/document-list', './src/components/content-column', './src/components/content-column-list', './src/components/content-action', './src/components/content-action-list', './src/services/folder-actions.service', './src/services/document-actions.service', './src/services/alfresco.service'], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; - var document_list_1, document_action_1, document_action_list_1, quick_document_action_1, quick_document_action_list_1, folder_action_1, folder_action_list_1, quick_folder_action_1, quick_folder_action_list_1, folder_actions_service_1, document_actions_service_1; + var document_list_1, content_column_1, content_column_list_1, content_action_1, content_action_list_1, folder_actions_service_1, document_actions_service_1, alfresco_service_1; var DOCUMENT_LIST_DIRECTIVES, DOCUMENT_LIST_PROVIDERS; var exportedNames_1 = { 'DOCUMENT_LIST_DIRECTIVES': true, @@ -20,37 +20,21 @@ System.register(['./src/components/document-list', './src/components/document-ac document_list_1 = document_list_1_1; exportStar_1(document_list_1_1); }, - function (document_action_1_1) { - document_action_1 = document_action_1_1; - exportStar_1(document_action_1_1); + function (content_column_1_1) { + content_column_1 = content_column_1_1; + exportStar_1(content_column_1_1); }, - function (document_action_list_1_1) { - document_action_list_1 = document_action_list_1_1; - exportStar_1(document_action_list_1_1); + function (content_column_list_1_1) { + content_column_list_1 = content_column_list_1_1; + exportStar_1(content_column_list_1_1); }, - function (quick_document_action_1_1) { - quick_document_action_1 = quick_document_action_1_1; - exportStar_1(quick_document_action_1_1); + function (content_action_1_1) { + content_action_1 = content_action_1_1; + exportStar_1(content_action_1_1); }, - function (quick_document_action_list_1_1) { - quick_document_action_list_1 = quick_document_action_list_1_1; - exportStar_1(quick_document_action_list_1_1); - }, - function (folder_action_1_1) { - folder_action_1 = folder_action_1_1; - exportStar_1(folder_action_1_1); - }, - function (folder_action_list_1_1) { - folder_action_list_1 = folder_action_list_1_1; - exportStar_1(folder_action_list_1_1); - }, - function (quick_folder_action_1_1) { - quick_folder_action_1 = quick_folder_action_1_1; - exportStar_1(quick_folder_action_1_1); - }, - function (quick_folder_action_list_1_1) { - quick_folder_action_list_1 = quick_folder_action_list_1_1; - exportStar_1(quick_folder_action_list_1_1); + function (content_action_list_1_1) { + content_action_list_1 = content_action_list_1_1; + exportStar_1(content_action_list_1_1); }, function (folder_actions_service_1_1) { folder_actions_service_1 = folder_actions_service_1_1; @@ -59,37 +43,35 @@ System.register(['./src/components/document-list', './src/components/document-ac function (document_actions_service_1_1) { document_actions_service_1 = document_actions_service_1_1; exportStar_1(document_actions_service_1_1); + }, + function (alfresco_service_1_1) { + alfresco_service_1 = alfresco_service_1_1; + exportStar_1(alfresco_service_1_1); }], execute: function() { exports_1("default",{ directives: [ document_list_1.DocumentList, - document_action_1.DocumentAction, - document_action_list_1.DocumentActionList, - quick_document_action_1.QuickDocumentAction, - quick_document_action_list_1.QuickDocumentActionList, - folder_action_1.FolderAction, - folder_action_list_1.FolderActionList, - quick_folder_action_1.QuickFolderAction, - quick_folder_action_list_1.QuickFolderActionList + content_column_1.ContentColumn, + content_column_list_1.ContentColumnList, + content_action_1.ContentAction, + content_action_list_1.ContentActionList ], providers: [ + alfresco_service_1.AlfrescoService, folder_actions_service_1.FolderActionsService, document_actions_service_1.DocumentActionsService ] }); exports_1("DOCUMENT_LIST_DIRECTIVES", DOCUMENT_LIST_DIRECTIVES = [ document_list_1.DocumentList, - document_action_1.DocumentAction, - document_action_list_1.DocumentActionList, - quick_document_action_1.QuickDocumentAction, - quick_document_action_list_1.QuickDocumentActionList, - folder_action_1.FolderAction, - folder_action_list_1.FolderActionList, - quick_folder_action_1.QuickFolderAction, - quick_folder_action_list_1.QuickFolderActionList + content_column_1.ContentColumn, + content_column_list_1.ContentColumnList, + content_action_1.ContentAction, + content_action_list_1.ContentActionList ]); exports_1("DOCUMENT_LIST_PROVIDERS", DOCUMENT_LIST_PROVIDERS = [ + alfresco_service_1.AlfrescoService, folder_actions_service_1.FolderActionsService, document_actions_service_1.DocumentActionsService ]); diff --git a/ng2-components/ng2-alfresco-documentlist/ng2-alfresco-documentlist.js.map b/ng2-components/ng2-alfresco-documentlist/ng2-alfresco-documentlist.js.map index dbe264adeb..30dd8f10e1 100644 --- a/ng2-components/ng2-alfresco-documentlist/ng2-alfresco-documentlist.js.map +++ b/ng2-components/ng2-alfresco-documentlist/ng2-alfresco-documentlist.js.map @@ -1 +1 @@ -{"version":3,"file":"ng2-alfresco-documentlist.js","sourceRoot":"","sources":["ng2-alfresco-documentlist.ts"],"names":[],"mappings":";;;;QA4Ca,wBAAwB,EAYxB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA9BpC,oBAAe;gBACX,UAAU,EAAE;oBACR,4BAAY;oBACZ,gCAAc;oBACd,yCAAkB;oBAClB,2CAAmB;oBACnB,oDAAuB;oBACvB,4BAAY;oBACZ,qCAAgB;oBAChB,uCAAiB;oBACjB,gDAAqB;iBACxB;gBACD,SAAS,EAAE;oBACP,6CAAoB;oBACpB,iDAAsB;iBACzB;aACJ,EAAA;YAEY,sCAAA,wBAAwB,GAAU;gBAC3C,4BAAY;gBACZ,gCAAc;gBACd,yCAAkB;gBAClB,2CAAmB;gBACnB,oDAAuB;gBACvB,4BAAY;gBACZ,qCAAgB;gBAChB,uCAAiB;gBACjB,gDAAqB;aACxB,CAAA,CAAC;YAEW,qCAAA,uBAAuB,GAAU;gBAC1C,6CAAoB;gBACpB,iDAAsB;aACzB,CAAA,CAAC"} \ No newline at end of file +{"version":3,"file":"ng2-alfresco-documentlist.js","sourceRoot":"","sources":["ng2-alfresco-documentlist.ts"],"names":[],"mappings":";;;;QAqCa,wBAAwB,EAQxB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAvBpC,oBAAe;gBACX,UAAU,EAAE;oBACR,4BAAY;oBACZ,8BAAa;oBACb,uCAAiB;oBACjB,8BAAa;oBACb,uCAAiB;iBACpB;gBACD,SAAS,EAAE;oBACP,kCAAe;oBACf,6CAAoB;oBACpB,iDAAsB;iBACzB;aACJ,EAAA;YAEY,sCAAA,wBAAwB,GAAU;gBAC3C,4BAAY;gBACZ,8BAAa;gBACb,uCAAiB;gBACjB,8BAAa;gBACb,uCAAiB;aACpB,CAAA,CAAC;YAEW,qCAAA,uBAAuB,GAAU;gBAC1C,kCAAe;gBACf,6CAAoB;gBACpB,iDAAsB;aACzB,CAAA,CAAC"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js index e98da0ff51..d00905faed 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js @@ -1,4 +1,20 @@ -System.register(['angular2/core', './../services/alfresco.service'], function(exports_1, context_1) { +/** + * @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/alfresco.service', './../models/content-column.model'], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { @@ -10,7 +26,7 @@ System.register(['angular2/core', './../services/alfresco.service'], function(ex var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; - var core_1, alfresco_service_1; + var core_1, alfresco_service_1, content_column_model_1; var DocumentList; return { setters:[ @@ -19,6 +35,9 @@ System.register(['angular2/core', './../services/alfresco.service'], function(ex }, function (alfresco_service_1_1) { alfresco_service_1 = alfresco_service_1_1; + }, + function (content_column_model_1_1) { + content_column_model_1 = content_column_model_1_1; }], execute: function() { DocumentList = (function () { @@ -26,8 +45,6 @@ System.register(['angular2/core', './../services/alfresco.service'], function(ex this._alfrescoService = _alfrescoService; this.navigate = true; this.breadcrumb = false; - this.thumbnails = true; - this.downloads = true; this.itemClick = new core_1.EventEmitter(); this.rootFolder = { name: 'Document Library', @@ -35,20 +52,39 @@ System.register(['angular2/core', './../services/alfresco.service'], function(ex }; this.currentFolderPath = 'swsdp/documentLibrary'; this.route = []; - this.documentActions = []; - this.quickDocumentActions = []; - this.folderActions = []; - this.quickFolderActions = []; + this.actions = []; + this.columns = []; } DocumentList.prototype.canNavigateParent = function () { - return this.navigate && - !this.breadcrumb && + return this.navigate && !this.breadcrumb && this.currentFolderPath !== this.rootFolder.path; }; DocumentList.prototype.ngOnInit = function () { this.route.push(this.rootFolder); this.displayFolderContent(this.rootFolder.path); }; + DocumentList.prototype.ngAfterContentInit = function () { + if (!this.columns || this.columns.length === 0) { + this.setupDefaultColumns(); + } + }; + DocumentList.prototype.ngAfterViewChecked = function () { + // workaround for MDL issues with dynamic components + if (componentHandler) { + componentHandler.upgradeAllRegistered(); + } + }; + DocumentList.prototype.getContentActions = function (target, type) { + if (target && type) { + var ltarget_1 = target.toLowerCase(); + var ltype_1 = type.toLowerCase(); + return this.actions.filter(function (entry) { + return entry.target.toLowerCase() === ltarget_1 && + entry.type.toLowerCase() === ltype_1; + }); + } + return []; + }; DocumentList.prototype.onNavigateParentClick = function ($event) { if ($event) { $event.preventDefault(); @@ -97,11 +133,6 @@ System.register(['angular2/core', './../services/alfresco.service'], function(ex DocumentList.prototype.getDocumentThumbnailUrl = function (document) { return this._alfrescoService.getDocumentThumbnailUrl(document); }; - DocumentList.prototype.registerDocumentAction = function (action) { - if (action) { - this.documentActions.push(action); - } - }; DocumentList.prototype.executeContentAction = function (document, action) { // todo: safety checks action.handler(document); @@ -119,6 +150,18 @@ System.register(['angular2/core', './../services/alfresco.service'], function(ex .getFolder(path) .subscribe(function (folder) { return _this.folder = folder; }, function (error) { return _this.errorMessage = error; }); }; + DocumentList.prototype.setupDefaultColumns = function () { + var thumbnailCol = new content_column_model_1.ContentColumnModel(); + thumbnailCol.source = '$thumbnail'; + var nameCol = new content_column_model_1.ContentColumnModel(); + nameCol.title = 'Name'; + nameCol.source = 'displayName'; + nameCol.cssClass = 'full-width name-column'; + this.columns = [ + thumbnailCol, + nameCol + ]; + }; __decorate([ core_1.Input(), __metadata('design:type', Boolean) @@ -130,26 +173,17 @@ System.register(['angular2/core', './../services/alfresco.service'], function(ex __decorate([ core_1.Input('folder-icon'), __metadata('design:type', String) - ], DocumentList.prototype, "folderIconClass", void 0); - __decorate([ - core_1.Input(), - __metadata('design:type', Boolean) - ], DocumentList.prototype, "thumbnails", void 0); - __decorate([ - core_1.Input(), - __metadata('design:type', Boolean) - ], DocumentList.prototype, "downloads", void 0); + ], DocumentList.prototype, "folderIcon", void 0); __decorate([ core_1.Output(), __metadata('design:type', core_1.EventEmitter) ], DocumentList.prototype, "itemClick", void 0); DocumentList = __decorate([ core_1.Component({ + moduleId: __moduleName, selector: 'alfresco-document-list', - styles: [ - "\n :host .breadcrumb {\n margin-bottom: 4px;\n }\n\n :host .folder-icon {\n float: left;\n margin-right: 10px;\n font-size: 4em;\n }\n\n :host .file-icon {\n width: 52px;\n height: 52px;\n float: left;\n margin-right: 10px;\n }\n \n :host .document-header {\n font-size: 24px;\n line-height: 32px;\n }\n \n :host .document-header:hover {\n text-decoration: underline;\n }\n " - ], - template: "\n
    \n
  1. \n {{r.name}}\n {{r.name}}\n
  2. \n
\n
\n \n ...\n \n \n \n \n
0\" class=\"btn-group pull-right\">\n \n \n \n
\n \n \n
\n \n \n \n
\n \n \n \n \"\"\n\n

\n {{document.displayName}}\n

\n

{{document.description}}

\n \n Modified {{document.modifiedOn}} by {{document.modifiedBy}}\n \n \n
\n ", + styleUrls: ['./document-list.css'], + templateUrl: './document-list.html', providers: [alfresco_service_1.AlfrescoService] }), __metadata('design:paramtypes', [alfresco_service_1.AlfrescoService]) diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js.map b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js.map index c4693a2031..b5e6756603 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.js.map @@ -1 +1 @@ -{"version":3,"file":"document-list.js","sourceRoot":"","sources":["document-list.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YAiIA;gBA+BI,sBACY,gBAAiC;oBAAjC,qBAAgB,GAAhB,gBAAgB,CAAiB;oBA9BpC,aAAQ,GAAY,IAAI,CAAC;oBACzB,eAAU,GAAY,KAAK,CAAC;oBAE5B,eAAU,GAAY,IAAI,CAAC;oBAC3B,cAAS,GAAY,IAAI,CAAC;oBAEzB,cAAS,GAAsB,IAAI,mBAAY,EAAE,CAAC;oBAE5D,eAAU,GAAG;wBACT,IAAI,EAAE,kBAAkB;wBACxB,IAAI,EAAE,uBAAuB;qBAChC,CAAC;oBACF,sBAAiB,GAAW,uBAAuB,CAAC;oBAIpD,UAAK,GAAU,EAAE,CAAC;oBAElB,oBAAe,GAAyB,EAAE,CAAC;oBAC3C,yBAAoB,GAAyB,EAAE,CAAC;oBAChD,kBAAa,GAAyB,EAAE,CAAC;oBACzC,uBAAkB,GAAyB,EAAE,CAAC;gBAU3C,CAAC;gBARJ,wCAAiB,GAAjB;oBACI,MAAM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AI,OAAO,GAAG,IAAI,yCAAkB,EAAE,CAAC;oBACvC,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC;oBACvB,OAAO,CAAC,MAAM,GAAG,aAAa,CAAC;oBAC/B,OAAO,CAAC,QAAQ,GAAG,wBAAwB,CAAC;oBAE5C,IAAI,CAAC,OAAO,GAAG;wBACX,YAAY;wBACZ,OAAO;qBACV,CAAC;gBACN,CAAC;gBA3JD;oBAAC,YAAK,EAAE;;8DAAA;gBAER;oBAAC,YAAK,EAAE;;gEAAA;gBAER;oBAAC,YAAK,CAAC,aAAa,CAAC;;gEAAA;gBAGrB;oBAAC,aAAM,EAAE;;+DAAA;gBAhBb;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,YAAY;wBACtB,QAAQ,EAAE,wBAAwB;wBAClC,SAAS,EAAE,CAAC,qBAAqB,CAAC;wBAClC,WAAW,EAAE,sBAAsB;wBACnC,SAAS,EAAE,CAAC,kCAAe,CAAC;qBAC/B,CAAC;;gCAAA;gBA+JF,mBAAC;YAAD,CAAC,AA9JD,IA8JC;YA9JD,uCA8JC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts index c2f561c4e1..3757cbec77 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts @@ -41,34 +41,36 @@ declare let __moduleName:string; }) export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit { - @Input() navigate: boolean = true; - @Input() breadcrumb: boolean = false; - @Input('folder-icon') folderIcon: string; + @Input() + navigate:boolean = true; + @Input() + breadcrumb:boolean = false; + @Input('folder-icon') + folderIcon:string; - @Output() itemClick: EventEmitter = new EventEmitter(); + @Output() + itemClick:EventEmitter = new EventEmitter(); rootFolder = { name: 'Document Library', path: 'swsdp/documentLibrary' }; - currentFolderPath: string = 'swsdp/documentLibrary'; - folder: FolderEntity; + currentFolderPath:string = 'swsdp/documentLibrary'; + folder:FolderEntity; errorMessage; - route: any[] = []; + route:any[] = []; - actions: ContentActionModel[] = []; - columns: ContentColumnModel[] = []; + actions:ContentActionModel[] = []; + columns:ContentColumnModel[] = []; - canNavigateParent(): boolean { - return this.navigate && - !this.breadcrumb && + canNavigateParent():boolean { + return this.navigate && !this.breadcrumb && this.currentFolderPath !== this.rootFolder.path; } - constructor ( - private _alfrescoService: AlfrescoService - ) {} + constructor(private _alfrescoService:AlfrescoService) { + } ngOnInit() { this.route.push(this.rootFolder); @@ -88,15 +90,15 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit } } - getContentActions(target: string, type: string) { + getContentActions(target:string, type:string) { if (target && type) { let ltarget = target.toLowerCase(); let ltype = type.toLowerCase(); return this.actions.filter(entry => { - return entry.target.toLowerCase() === ltarget && - entry.type.toLowerCase() === ltype; + return entry.target.toLowerCase() === ltarget && + entry.type.toLowerCase() === ltype; }); } return []; @@ -116,7 +118,7 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit } } - onItemClick(item: DocumentEntity, $event) { + onItemClick(item:DocumentEntity, $event) { if ($event) { $event.preventDefault(); } @@ -151,20 +153,20 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit } } - getContentUrl(document: DocumentEntity) { + getContentUrl(document:DocumentEntity) { return this._alfrescoService.getContentUrl(document); } - getDocumentThumbnailUrl(document: DocumentEntity) { + getDocumentThumbnailUrl(document:DocumentEntity) { return this._alfrescoService.getDocumentThumbnailUrl(document); } - executeContentAction(document:DocumentEntity, action: ContentActionModel) { + executeContentAction(document:DocumentEntity, action:ContentActionModel) { // todo: safety checks action.handler(document); } - private getItemPath(item: DocumentEntity):string { + private getItemPath(item:DocumentEntity):string { let container = item.location.container; let path = item.location.path !== '/' ? (item.location.path + '/' ) : '/'; let relativePath = container + path + item.fileName; diff --git a/ng2-components/ng2-alfresco-documentlist/src/models/content-action.model.js.map b/ng2-components/ng2-alfresco-documentlist/src/models/content-action.model.js.map index 46669b2597..841221b034 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/models/content-action.model.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/models/content-action.model.js.map @@ -1 +1 @@ -{"version":3,"file":"content-action.model.js","sourceRoot":"","sources":["content-action.model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;YAEH;gBAAA;gBAIA,CAAC;gBAAD,yBAAC;YAAD,CAAC,AAJD,IAIC;YAJD,mDAIC,CAAA"} \ No newline at end of file +{"version":3,"file":"content-action.model.js","sourceRoot":"","sources":["content-action.model.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;YAEH;gBAAA;gBAMA,CAAC;gBAAD,yBAAC;YAAD,CAAC,AAND,IAMC;YAND,mDAMC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js index d1612c4a85..d6e36bc464 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js +++ b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js @@ -67,7 +67,7 @@ System.register(['angular2/core', 'angular2/http', 'rxjs/Observable', '../../../ AlfrescoService.prototype.getFolder = function (folder) { var headers = new http_1.Headers({ 'Content-Type': 'application/json', - 'Authorization': 'Basic ' + btoa('admin:admin') + 'Authorization': this.settings.getAuthToken() }); var options = new http_1.RequestOptions({ headers: headers }); return this.http diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js.map b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js.map index 63e89ed9b4..2c1d113d33 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/services/alfresco.service.js.map @@ -1 +1 @@ -{"version":3,"file":"alfresco.service.js","sourceRoot":"","sources":["alfresco.service.ts"],"names":[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I,cAAc,CAAC,CAAC;gBAClE,CAAC;gBApDL;oBAAC,iBAAU,EAAE;;mCAAA;gBAqDb,sBAAC;YAAD,CAAC,AApDD,IAoDC;YApDD,6CAoDC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js index be278cb279..f7b0be49e7 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js +++ b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -System.register(['angular2/core'], function(exports_1, context_1) { +System.register(['angular2/core', './alfresco.service'], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { @@ -26,33 +26,61 @@ System.register(['angular2/core'], function(exports_1, context_1) { var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; - var core_1; + var core_1, alfresco_service_1; var DocumentActionsService; return { setters:[ function (core_1_1) { core_1 = core_1_1; + }, + function (alfresco_service_1_1) { + alfresco_service_1 = alfresco_service_1_1; }], execute: function() { DocumentActionsService = (function () { - function DocumentActionsService() { + function DocumentActionsService(_alfrescoService) { + this._alfrescoService = _alfrescoService; this.handlers = {}; - // todo: just for dev/demo purposes, to be replaced with real actions - this.handlers['system1'] = this.handleStandardAction1; - this.handlers['system2'] = this.handleStandardAction2; + this.setupActionHandlers(); } DocumentActionsService.prototype.getHandler = function (key) { - return this.handlers[key]; + if (key) { + var lkey = key.toLowerCase(); + return this.handlers[lkey]; + } + return null; }; - DocumentActionsService.prototype.handleStandardAction1 = function (document) { + DocumentActionsService.prototype.setHandler = function (key, handler) { + if (key) { + var lkey = key.toLowerCase(); + this.handlers[lkey] = handler; + } + }; + DocumentActionsService.prototype.setupActionHandlers = function () { + this.handlers['download'] = this.download.bind(this); + // todo: just for dev/demo purposes, to be replaced with real actions + this.handlers['system1'] = this.handleStandardAction1.bind(this); + this.handlers['system2'] = this.handleStandardAction2.bind(this); + }; + DocumentActionsService.prototype.handleStandardAction1 = function (obj) { window.alert('standard document action 1'); }; - DocumentActionsService.prototype.handleStandardAction2 = function (document) { + DocumentActionsService.prototype.handleStandardAction2 = function (obj) { window.alert('standard document action 2'); }; + DocumentActionsService.prototype.download = function (obj) { + if (obj && !obj.isFolder) { + var link = document.createElement('a'); + document.body.appendChild(link); + link.setAttribute('download', 'download'); + link.href = this._alfrescoService.getContentUrl(obj); + link.click(); + document.body.removeChild(link); + } + }; DocumentActionsService = __decorate([ core_1.Injectable(), - __metadata('design:paramtypes', []) + __metadata('design:paramtypes', [alfresco_service_1.AlfrescoService]) ], DocumentActionsService); return DocumentActionsService; }()); diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js.map b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js.map index 29b47fbd4a..e32a58a868 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/services/document-actions.service.js.map @@ -1 +1 @@ -{"version":3,"file":"document-actions.service.js","sourceRoot":"","sources":["document-actions.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;YAMH;gBAGI;oBAFQ,aAAQ,GAA4C,EAAE,CAAC;oBAG3D,qEAAqE;oBACrE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;oBACtD,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;gBAC1D,CAAC;gBAED,2CAAU,GAAV,UAAW,GAAW;oBAClB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;gBAC9B,CAAC;gBAEO,sDAAqB,GAA7B,UAA8B,QAAa;oBACvC,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;gBAC/C,CAAC;gBAEO,sDAAqB,GAA7B,UAA8B,QAAa;oBACvC,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;gBAC/C,CAAC;gBApBL;oBAAC,iBAAU,EAAE;;0CAAA;gBAqBb,6BAAC;YAAD,CAAC,AApBD,IAoBC;YApBD,2DAoBC,CAAA"} \ No newline at end of file +{"version":3,"file":"document-actions.service.js","sourceRoot":"","sources":["document-actions.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;YAOH;gBAGI,gCAAoB,gBAAiC;oBAAjC,qBAAgB,GAAhB,gBAAgB,CAAiB;oBAF7C,aAAQ,GAA4C,EAAE,CAAC;oBAG3D,IAAI,CAAC,mBAAmB,EAAE,CAAC;gBAC/B,CAAC;gBAED,2CAAU,GAAV,UAAW,GAAW;oBAClB,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;wBACN,IAAI,IAAI,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;wBAC7B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;oBAC/B,CAAC;oBACD,MAAM,CAAC,IAAI,CAAC;gBAChB,CAAC;gBAED,2CAAU,GAAV,UAAW,GAAW,EAAE,OAA6B;oBACjD,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;wBACN,IAAI,IAAI,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;wBAC7B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;oBAClC,CAAC;gBACL,CAAC;gBAEO,oDAAmB,GAA3B;oBACI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAErD,qEAAqE;oBACrE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACjE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACrE,CAAC;gBAEO,sDAAqB,GAA7B,UAA8B,GAAQ;oBAClC,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;gBAC/C,CAAC;gBAEO,sDAAqB,GAA7B,UAA8B,GAAQ;oBAClC,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;gBAC/C,CAAC;gBAEO,yCAAQ,GAAhB,UAAiB,GAAQ;oBACrB,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;wBACvB,IAAI,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;wBACvC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;wBAChC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;wBAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;wBACrD,IAAI,CAAC,KAAK,EAAE,CAAC;wBACb,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;oBACpC,CAAC;gBACL,CAAC;gBAhDL;oBAAC,iBAAU,EAAE;;0CAAA;gBAiDb,6BAAC;YAAD,CAAC,AAhDD,IAgDC;YAhDD,2DAgDC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js b/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js index ec65e0bba1..7ae2b32bdd 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js +++ b/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js @@ -38,11 +38,21 @@ System.register(['angular2/core'], function(exports_1, context_1) { function FolderActionsService() { this.handlers = {}; // todo: just for dev/demo purposes, to be replaced with real actions - this.handlers['system1'] = this.handleStandardAction1; - this.handlers['system2'] = this.handleStandardAction2; + this.handlers['system1'] = this.handleStandardAction1.bind(this); + this.handlers['system2'] = this.handleStandardAction2.bind(this); } FolderActionsService.prototype.getHandler = function (key) { - return this.handlers[key]; + if (key) { + var lkey = key.toLowerCase(); + return this.handlers[lkey]; + } + return null; + }; + FolderActionsService.prototype.setHandler = function (key, handler) { + if (key) { + var lkey = key.toLowerCase(); + this.handlers[lkey] = handler; + } }; FolderActionsService.prototype.handleStandardAction1 = function (document) { window.alert('standard folder action 1'); diff --git a/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js.map b/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js.map index 6f6d8d92c8..898f9f0cfc 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js.map +++ b/ng2-components/ng2-alfresco-documentlist/src/services/folder-actions.service.js.map @@ -1 +1 @@ -{"version":3,"file":"folder-actions.service.js","sourceRoot":"","sources":["folder-actions.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;YAMH;gBAGI;oBAFQ,aAAQ,GAA4C,EAAE,CAAC;oBAG3D,qEAAqE;oBACrE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;oBACtD,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC;gBAC1D,CAAC;gBAED,yCAAU,GAAV,UAAW,GAAW;oBAClB,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;gBAC9B,CAAC;gBAEO,oDAAqB,GAA7B,UAA8B,QAAa;oBACvC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;gBAC7C,CAAC;gBAEO,oDAAqB,GAA7B,UAA8B,QAAa;oBACvC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;gBAC7C,CAAC;gBApBL;oBAAC,iBAAU,EAAE;;wCAAA;gBAqBb,2BAAC;YAAD,CAAC,AApBD,IAoBC;YApBD,uDAoBC,CAAA"} \ No newline at end of file +{"version":3,"file":"folder-actions.service.js","sourceRoot":"","sources":["folder-actions.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;YAMH;gBAGI;oBAFQ,aAAQ,GAA4C,EAAE,CAAC;oBAG3D,qEAAqE;oBACrE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACjE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACrE,CAAC;gBAED,yCAAU,GAAV,UAAW,GAAW;oBAClB,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;wBACN,IAAI,IAAI,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;wBAC7B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;oBAC/B,CAAC;oBACD,MAAM,CAAC,IAAI,CAAC;gBAChB,CAAC;gBAED,yCAAU,GAAV,UAAW,GAAW,EAAE,OAA6B;oBACjD,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;wBACN,IAAI,IAAI,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;wBAC7B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;oBAClC,CAAC;gBACL,CAAC;gBAEO,oDAAqB,GAA7B,UAA8B,QAAa;oBACvC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;gBAC7C,CAAC;gBAEO,oDAAqB,GAA7B,UAA8B,QAAa;oBACvC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;gBAC7C,CAAC;gBA/BL;oBAAC,iBAAU,EAAE;;wCAAA;gBAgCb,2BAAC;YAAD,CAAC,AA/BD,IA+BC;YA/BD,uDA+BC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-login/ng2-alfresco-login.js b/ng2-components/ng2-alfresco-login/ng2-alfresco-login.js index c87a5b6920..48473eb095 100644 --- a/ng2-components/ng2-alfresco-login/ng2-alfresco-login.js +++ b/ng2-components/ng2-alfresco-login/ng2-alfresco-login.js @@ -1,7 +1,7 @@ -System.register(['./src/alfresco-login.component', './src/alfresco-authentication.service'], function(exports_1, context_1) { +System.register(['./src/components/alfresco-login', './src/services/alfresco-authentication'], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; - var alfresco_login_component_1, alfresco_authentication_service_1; + var alfresco_login_1, alfresco_authentication_1; var ALFRESCO_LOGIN_DIRECTIVES, ALFRESCO_AUTHENTICATION; var exportedNames_1 = { 'ALFRESCO_LOGIN_DIRECTIVES': true, @@ -16,21 +16,21 @@ System.register(['./src/alfresco-login.component', './src/alfresco-authenticatio } return { setters:[ - function (alfresco_login_component_1_1) { - alfresco_login_component_1 = alfresco_login_component_1_1; - exportStar_1(alfresco_login_component_1_1); + function (alfresco_login_1_1) { + alfresco_login_1 = alfresco_login_1_1; + exportStar_1(alfresco_login_1_1); }, - function (alfresco_authentication_service_1_1) { - alfresco_authentication_service_1 = alfresco_authentication_service_1_1; - exportStar_1(alfresco_authentication_service_1_1); + function (alfresco_authentication_1_1) { + alfresco_authentication_1 = alfresco_authentication_1_1; + exportStar_1(alfresco_authentication_1_1); }], execute: function() { exports_1("default",{ - directives: [alfresco_login_component_1.AlfrescoLoginComponent], - providers: [alfresco_authentication_service_1.AlfrescoAuthenticationService] + directives: [alfresco_login_1.AlfrescoLoginComponent], + providers: [alfresco_authentication_1.AlfrescoAuthenticationService] }); - exports_1("ALFRESCO_LOGIN_DIRECTIVES", ALFRESCO_LOGIN_DIRECTIVES = [alfresco_login_component_1.AlfrescoLoginComponent]); - exports_1("ALFRESCO_AUTHENTICATION", ALFRESCO_AUTHENTICATION = [alfresco_authentication_service_1.AlfrescoAuthenticationService]); + exports_1("ALFRESCO_LOGIN_DIRECTIVES", ALFRESCO_LOGIN_DIRECTIVES = [alfresco_login_1.AlfrescoLoginComponent]); + exports_1("ALFRESCO_AUTHENTICATION", ALFRESCO_AUTHENTICATION = [alfresco_authentication_1.AlfrescoAuthenticationService]); } } }); diff --git a/ng2-components/ng2-alfresco-login/ng2-alfresco-login.js.map b/ng2-components/ng2-alfresco-login/ng2-alfresco-login.js.map index a99b750ffb..c35d46677d 100644 --- a/ng2-components/ng2-alfresco-login/ng2-alfresco-login.js.map +++ b/ng2-components/ng2-alfresco-login/ng2-alfresco-login.js.map @@ -1 +1 @@ -{"version":3,"file":"ng2-alfresco-login.js","sourceRoot":"","sources":["ng2-alfresco-login.ts"],"names":[],"mappings":";;;;QA2Ba,yBAAyB,EACzB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;YANpC,oBAAe;gBACX,UAAU,EAAE,CAAC,iDAAsB,CAAC;gBACpC,SAAS,EAAE,CAAC,+DAA6B,CAAC;aAC7C,EAAA;YAEY,uCAAA,yBAAyB,GAAU,CAAC,iDAAsB,CAAC,CAAA,CAAC;YAC5D,qCAAA,uBAAuB,GAAU,CAAC,+DAA6B,CAAC,CAAA,CAAC"} \ No newline at end of file +{"version":3,"file":"ng2-alfresco-login.js","sourceRoot":"","sources":["ng2-alfresco-login.ts"],"names":[],"mappings":";;;;QA2Ba,yBAAyB,EACzB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;YANpC,oBAAe;gBACX,UAAU,EAAE,CAAC,uCAAsB,CAAC;gBACpC,SAAS,EAAE,CAAC,uDAA6B,CAAC;aAC7C,EAAA;YAEY,uCAAA,yBAAyB,GAAU,CAAC,uCAAsB,CAAC,CAAA,CAAC;YAC5D,qCAAA,uBAAuB,GAAU,CAAC,uDAA6B,CAAC,CAAA,CAAC"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload.component.html b/ng2-components/ng2-alfresco-upload/demo/demo.html similarity index 98% rename from ng2-components/ng2-alfresco-upload/src/components/upload.component.html rename to ng2-components/ng2-alfresco-upload/demo/demo.html index c25f4959d7..7b1ddc3455 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload.component.html +++ b/ng2-components/ng2-alfresco-upload/demo/demo.html @@ -1,5 +1,7 @@
+ +
@@ -26,7 +28,7 @@
- Drop Area +
diff --git a/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.d.ts b/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.d.ts index d8a0ccf554..a04dce6cbd 100644 --- a/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.d.ts +++ b/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.d.ts @@ -14,15 +14,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { UploadComponent } from './src/components/upload.component'; +import { UploadDragAreaComponent } from './src/components/upload-drag-area.component'; import { UploadService } from './src/services/upload.service'; import { FileSelectDirective } from './src/directives/file-select.directive'; import { FileDraggableDirective } from './src/directives/file-draggable.directive'; -export * from './src/components/upload.component'; +import { UploadButtonComponent } from './src/components/upload-button.component'; +export * from './src/components/upload-button.component'; +export * from './src/components/upload-drag-area.component'; export * from './src/services/upload.service'; +export * from './src/directives/file-select.directive'; +export * from './src/directives/file-draggable.directive'; declare var _default: { - component: typeof UploadComponent[]; + component: (typeof UploadDragAreaComponent | typeof UploadButtonComponent)[]; directives: (typeof FileSelectDirective | typeof FileDraggableDirective)[]; providers: typeof UploadService[]; }; export default _default; +export declare const ALFRESCO_ULPOAD_COMPONENT: [any]; +export declare const ALFRESCO_ULPOAD_PROVAIDERS: [any]; diff --git a/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.js b/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.js index 78395cc725..3f422b96b3 100644 --- a/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.js +++ b/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.js @@ -14,22 +14,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -System.register(['./src/components/upload.component', './src/services/upload.service', './src/directives/file-select.directive', './src/directives/file-draggable.directive'], function(exports_1, context_1) { +System.register(['./src/components/upload-drag-area.component', './src/services/upload.service', './src/directives/file-select.directive', './src/directives/file-draggable.directive', './src/components/upload-button.component'], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; - var upload_component_1, upload_service_1, file_select_directive_1, file_draggable_directive_1; + var upload_drag_area_component_1, upload_service_1, file_select_directive_1, file_draggable_directive_1, upload_button_component_1; + var ALFRESCO_ULPOAD_COMPONENT, ALFRESCO_ULPOAD_PROVAIDERS; + var exportedNames_1 = { + 'ALFRESCO_ULPOAD_COMPONENT': true, + 'ALFRESCO_ULPOAD_PROVAIDERS': true + }; function exportStar_1(m) { var exports = {}; for(var n in m) { - if (n !== "default") exports[n] = m[n]; + if (n !== "default"&& !exportedNames_1.hasOwnProperty(n)) exports[n] = m[n]; } exports_1(exports); } return { setters:[ - function (upload_component_1_1) { - upload_component_1 = upload_component_1_1; - exportStar_1(upload_component_1_1); + function (upload_drag_area_component_1_1) { + upload_drag_area_component_1 = upload_drag_area_component_1_1; + exportStar_1(upload_drag_area_component_1_1); }, function (upload_service_1_1) { upload_service_1 = upload_service_1_1; @@ -37,16 +42,31 @@ System.register(['./src/components/upload.component', './src/services/upload.ser }, function (file_select_directive_1_1) { file_select_directive_1 = file_select_directive_1_1; + exportStar_1(file_select_directive_1_1); }, function (file_draggable_directive_1_1) { file_draggable_directive_1 = file_draggable_directive_1_1; + exportStar_1(file_draggable_directive_1_1); + }, + function (upload_button_component_1_1) { + upload_button_component_1 = upload_button_component_1_1; + exportStar_1(upload_button_component_1_1); }], execute: function() { exports_1("default",{ - component: [upload_component_1.UploadComponent], + component: [upload_drag_area_component_1.UploadDragAreaComponent, upload_button_component_1.UploadButtonComponent], directives: [file_select_directive_1.FileSelectDirective, file_draggable_directive_1.FileDraggableDirective], providers: [upload_service_1.UploadService] }); + exports_1("ALFRESCO_ULPOAD_COMPONENT", ALFRESCO_ULPOAD_COMPONENT = [ + upload_drag_area_component_1.UploadDragAreaComponent, + upload_button_component_1.UploadButtonComponent, + file_select_directive_1.FileSelectDirective, + file_draggable_directive_1.FileDraggableDirective + ]); + exports_1("ALFRESCO_ULPOAD_PROVAIDERS", ALFRESCO_ULPOAD_PROVAIDERS = [ + upload_service_1.UploadService + ]); } } }); diff --git a/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.js.map b/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.js.map index fbd0942d5b..58f2ae5600 100644 --- a/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.js.map +++ b/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.js.map @@ -1 +1 @@ -{"version":3,"file":"ng2-alfresco-upload.js","sourceRoot":"","sources":["ng2-alfresco-upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAUH,oBAAe;gBACX,SAAS,EAAE,CAAC,kCAAe,CAAC;gBAC5B,UAAU,EAAE,CAAC,2CAAmB,EAAE,iDAAsB,CAAC;gBACzD,SAAS,EAAE,CAAC,8BAAa,CAAC;aAC7B,EAAA"} \ No newline at end of file +{"version":3,"file":"ng2-alfresco-upload.js","sourceRoot":"","sources":["ng2-alfresco-upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;QAoBU,yBAAyB,EAOzB,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAbvC,oBAAe;gBACX,SAAS,EAAE,CAAC,oDAAuB,EAAE,+CAAqB,CAAC;gBAC3D,UAAU,EAAE,CAAC,2CAAmB,EAAE,iDAAsB,CAAC;gBACzD,SAAS,EAAE,CAAC,8BAAa,CAAC;aAC7B,EAAA;YAEY,uCAAA,yBAAyB,GAAU;gBAC5C,oDAAuB;gBACvB,+CAAqB;gBACrB,2CAAmB;gBACnB,iDAAsB;aACzB,CAAA,CAAC;YAEW,wCAAA,0BAA0B,GAAU;gBAC7C,8BAAa;aAChB,CAAA,CAAC"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.ts b/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.ts index b707ed5062..f0cf53f9df 100644 --- a/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.ts +++ b/ng2-components/ng2-alfresco-upload/ng2-alfresco-upload.ts @@ -15,16 +15,31 @@ * limitations under the License. */ -import {UploadComponent} from './src/components/upload.component'; +import {UploadDragAreaComponent} from './src/components/upload-drag-area.component'; import {UploadService} from './src/services/upload.service'; import {FileSelectDirective} from './src/directives/file-select.directive'; import {FileDraggableDirective} from './src/directives/file-draggable.directive'; +import {UploadButtonComponent} from './src/components/upload-button.component'; -export * from './src/components/upload.component'; +export * from './src/components/upload-button.component'; +export * from './src/components/upload-drag-area.component'; export * from './src/services/upload.service'; +export * from './src/directives/file-select.directive'; +export * from './src/directives/file-draggable.directive'; export default { - component: [UploadComponent], + component: [UploadDragAreaComponent, UploadButtonComponent], directives: [FileSelectDirective, FileDraggableDirective], providers: [UploadService] -} \ No newline at end of file +} + +export const ALFRESCO_ULPOAD_COMPONENT: [any] = [ + UploadDragAreaComponent, + UploadButtonComponent, + FileSelectDirective, + FileDraggableDirective +]; + +export const ALFRESCO_ULPOAD_PROVAIDERS: [any] = [ + UploadService +]; diff --git a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.css b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.css index 6c9ba10cee..c2a686d4d4 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.css +++ b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.css @@ -17,7 +17,7 @@ max-height: 350px; overflow: visible; right: 24px; - position: absolute; + position: fixed; } .file-dialog .header { diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload.component.css b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.css similarity index 54% rename from ng2-components/ng2-alfresco-upload/src/components/upload.component.css rename to ng2-components/ng2-alfresco-upload/src/components/upload-button.component.css index 858e610b34..6207ddc5d1 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload.component.css +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.css @@ -16,20 +16,4 @@ .mdl-textfield--file .mdl-button--file { right: 0; -} - -.upload-border { - vertical-align: middle; - color: #555; - padding: 20px; - max-height: 300px; - overflow-y: auto; - display: inline-block; - border: 3px dashed #555; - text-align: center; -} - -.input-focus { - color: #2196F3; - border: 3px dashed #2196F3; } \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload.component.d.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.d.ts similarity index 92% rename from ng2-components/ng2-alfresco-upload/src/components/upload.component.d.ts rename to ng2-components/ng2-alfresco-upload/src/components/upload-button.component.d.ts index 4f77f6f2bf..f2fc4a740a 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload.component.d.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.d.ts @@ -17,16 +17,14 @@ import { ElementRef } from 'angular2/core'; import { FileModel } from '../models/file.model'; import { FileUploadingDialogComponent } from './file-uploading-dialog.component'; -export declare class UploadComponent { +export declare class UploadButtonComponent { el: ElementRef; private _uploaderService; - method: string; undoNotificationBar: any; fileUploadingDialogComponent: FileUploadingDialogComponent; filesUploadingList: FileModel[]; constructor(el: ElementRef); onFilesAdded(files: any): void; - onFilesDragged(files: any): void; showUndoNotificationBar(latestFilesAdded: any): void; showDialog(): void; } diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.html b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.html new file mode 100644 index 0000000000..fac858c293 --- /dev/null +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.html @@ -0,0 +1,46 @@ +
+ + + +
+
+ file_upload Upload +
+ +

+ +
+ file_upload Upload Folder +
+ + +
+ + +
+ + + + + + + + +
+
+ +
+ +
+
diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload.component.js b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.js similarity index 68% rename from ng2-components/ng2-alfresco-upload/src/components/upload.component.js rename to ng2-components/ng2-alfresco-upload/src/components/upload-button.component.js index e379621948..438d54ab76 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload.component.js +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.js @@ -14,7 +14,7 @@ * 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-select.directive', '../directives/file-draggable.directive'], function(exports_1, context_1) { +System.register(['angular2/core', '../services/upload.service', './file-uploading-dialog.component', '../directives/file-select.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) { @@ -26,8 +26,8 @@ System.register(['angular2/core', '../services/upload.service', './file-uploadin 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_select_directive_1, file_draggable_directive_1; - var UploadComponent; + var core_1, upload_service_1, file_uploading_dialog_component_1, file_select_directive_1; + var UploadButtonComponent; return { setters:[ function (core_1_1) { @@ -41,15 +41,11 @@ System.register(['angular2/core', '../services/upload.service', './file-uploadin }, function (file_select_directive_1_1) { file_select_directive_1 = file_select_directive_1_1; - }, - function (file_draggable_directive_1_1) { - file_draggable_directive_1 = file_draggable_directive_1_1; }], execute: function() { - UploadComponent = (function () { - function UploadComponent(el) { + UploadButtonComponent = (function () { + function UploadButtonComponent(el) { this.el = el; - this.method = 'GET'; this.filesUploadingList = []; console.log('UploadComponent constructor', el); this._uploaderService = new upload_service_1.UploadService({ @@ -64,7 +60,7 @@ System.register(['angular2/core', '../services/upload.service', './file-uploadin } }); } - UploadComponent.prototype.onFilesAdded = function (files) { + UploadButtonComponent.prototype.onFilesAdded = function (files) { if (files.length) { var latestFilesAdded = this._uploaderService.addToQueue(files); this.filesUploadingList = this._uploaderService.getQueue(); @@ -72,14 +68,7 @@ System.register(['angular2/core', '../services/upload.service', './file-uploadin this.showUndoNotificationBar(latestFilesAdded); } }; - UploadComponent.prototype.onFilesDragged = function (files) { - if (files.length) { - this._uploaderService.addToQueue(files); - this.filesUploadingList = this._uploaderService.getQueue(); - this.showDialog(); - } - }; - UploadComponent.prototype.showUndoNotificationBar = function (latestFilesAdded) { + UploadButtonComponent.prototype.showUndoNotificationBar = function (latestFilesAdded) { if (componentHandler) { componentHandler.upgradeAllRegistered(); } @@ -94,35 +83,31 @@ System.register(['angular2/core', '../services/upload.service', './file-uploadin actionText: 'Undo' }); }; - UploadComponent.prototype.showDialog = function () { + UploadButtonComponent.prototype.showDialog = function () { this.fileUploadingDialogComponent.showDialog(); }; __decorate([ - core_1.Input(), - __metadata('design:type', String) - ], UploadComponent.prototype, "method", void 0); - __decorate([ - core_1.ViewChild('undoNotificationBar'), + core_1.ViewChild('undoNotificationBar'), __metadata('design:type', Object) - ], UploadComponent.prototype, "undoNotificationBar", void 0); + ], UploadButtonComponent.prototype, "undoNotificationBar", void 0); __decorate([ - core_1.ViewChild('fileUploadingDialog'), + core_1.ViewChild('fileUploadingDialog'), __metadata('design:type', file_uploading_dialog_component_1.FileUploadingDialogComponent) - ], UploadComponent.prototype, "fileUploadingDialogComponent", void 0); - UploadComponent = __decorate([ + ], UploadButtonComponent.prototype, "fileUploadingDialogComponent", void 0); + UploadButtonComponent = __decorate([ core_1.Component({ - selector: 'alfresco-upload', + selector: 'alfresco-upload-button', moduleId: __moduleName, - directives: [file_select_directive_1.FileSelectDirective, file_draggable_directive_1.FileDraggableDirective, file_uploading_dialog_component_1.FileUploadingDialogComponent], - templateUrl: './upload.component.html', - styleUrls: ['./upload.component.css'] - }), + directives: [file_select_directive_1.FileSelectDirective, file_uploading_dialog_component_1.FileUploadingDialogComponent], + templateUrl: './upload-button.component.html', + styleUrls: ['./upload-button.component.css'] + }), __metadata('design:paramtypes', [core_1.ElementRef]) - ], UploadComponent); - return UploadComponent; + ], UploadButtonComponent); + return UploadButtonComponent; }()); - exports_1("UploadComponent", UploadComponent); + exports_1("UploadButtonComponent", UploadButtonComponent); } } }); -//# sourceMappingURL=upload.component.js.map \ No newline at end of file +//# sourceMappingURL=upload-button.component.js.map \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.js.map b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.js.map new file mode 100644 index 0000000000..7cb604ce88 --- /dev/null +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"upload-button.component.js","sourceRoot":"","sources":["upload-button.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAoBH;gBAYI,+BAAmB,EAAa;oBAAb,OAAE,GAAF,EAAE,CAAW;oBAFhC,uBAAkB,GAAgB,EAAE,CAAC;oBAGjC,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;yB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AC7C,SAAS,EAAE,CAAC,+BAA+B,CAAC;qBAC/C,CAAC;;yCAAA;gBA0DF,4BAAC;YAAD,CAAC,AAzDD,IAyDC;YAzDD,yDAyDC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload.component.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts similarity index 80% rename from ng2-components/ng2-alfresco-upload/src/components/upload.component.ts rename to ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts index c27fbe5727..910adfaaca 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload.component.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts @@ -16,7 +16,7 @@ */ -import {Component, Input, ViewChild, ElementRef} from 'angular2/core'; +import {Component, ViewChild, ElementRef} from 'angular2/core'; import {UploadService} from '../services/upload.service'; import {FileModel} from '../models/file.model'; import {FileUploadingDialogComponent} from './file-uploading-dialog.component'; @@ -24,23 +24,19 @@ import {FileSelectDirective} from '../directives/file-select.directive'; import {FileDraggableDirective} from '../directives/file-draggable.directive'; declare let componentHandler; -declare let dialogPolyfill; declare let __moduleName:string; @Component({ - selector: 'alfresco-upload', + selector: 'alfresco-upload-button', moduleId: __moduleName, - directives: [FileSelectDirective, FileDraggableDirective, FileUploadingDialogComponent], - templateUrl: './upload.component.html', - styleUrls: ['./upload.component.css'] + directives: [FileSelectDirective, FileUploadingDialogComponent], + templateUrl: './upload-button.component.html', + styleUrls: ['./upload-button.component.css'] }) -export class UploadComponent { +export class UploadButtonComponent { private _uploaderService:UploadService; - @Input() - method:string = 'GET'; - @ViewChild('undoNotificationBar') undoNotificationBar; @@ -74,15 +70,7 @@ export class UploadComponent { } } - onFilesDragged(files):void { - if (files.length) { - this._uploaderService.addToQueue(files); - this.filesUploadingList = this._uploaderService.getQueue(); - this.showDialog(); - } - } - - showUndoNotificationBar(latestFilesAdded){ + showUndoNotificationBar(latestFilesAdded) { if (componentHandler) { componentHandler.upgradeAllRegistered(); } diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.css b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.css new file mode 100644 index 0000000000..c22d5f6f5c --- /dev/null +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.css @@ -0,0 +1,13 @@ +.upload-border { + vertical-align: middle; + color: #555; + padding: 20px; + overflow-y: auto; + display: inline-block; + text-align: center; +} + +.input-focus { + color: #2196F3; + border: 3px dashed #2196F3; +} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.d.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.d.ts new file mode 100644 index 0000000000..5137a0238b --- /dev/null +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.d.ts @@ -0,0 +1,28 @@ +/** + * @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'; +export declare class UploadDragAreaComponent { + el: ElementRef; + private _uploaderService; + fileUploadingDialogComponent: FileUploadingDialogComponent; + filesUploadingList: FileModel[]; + constructor(el: ElementRef); + onFilesDragged(files: any): void; + showDialog(): void; +} diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.html b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.html new file mode 100644 index 0000000000..316d10944c --- /dev/null +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.html @@ -0,0 +1,6 @@ +
+ +
+ + diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.js b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.js new file mode 100644 index 0000000000..86f65e81e2 --- /dev/null +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.js @@ -0,0 +1,93 @@ +/** + * @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() { + UploadDragAreaComponent = (function () { + function UploadDragAreaComponent(el) { + this.el = el; + 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' + } + }); + } + UploadDragAreaComponent.prototype.onFilesDragged = function (files) { + if (files.length) { + this._uploaderService.addToQueue(files); + this.filesUploadingList = this._uploaderService.getQueue(); + this.showDialog(); + } + }; + 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); + 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 \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.js.map b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.js.map new file mode 100644 index 0000000000..382f8307b0 --- /dev/null +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.js.map @@ -0,0 +1 @@ +{"version":3,"file":"upload-drag-area.component.js","sourceRoot":"","sources":["upload-drag-area.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkBH;gBASI,iCAAmB,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/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts new file mode 100644 index 0000000000..9b97b90140 --- /dev/null +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts @@ -0,0 +1,70 @@ +/** + * @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 {Component, ViewChild, ElementRef} 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; + +@Component({ + 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; + + @ViewChild('fileUploadingDialog') + fileUploadingDialogComponent:FileUploadingDialogComponent; + + filesUploadingList:FileModel [] = []; + + 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' + } + }); + } + + onFilesDragged(files):void { + if (files.length) { + this._uploaderService.addToQueue(files); + this.filesUploadingList = this._uploaderService.getQueue(); + this.showDialog(); + } + } + + showDialog():void { + this.fileUploadingDialogComponent.showDialog(); + } +} diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload.component.js.map b/ng2-components/ng2-alfresco-upload/src/components/upload.component.js.map deleted file mode 100644 index a08f6ac7d6..0000000000 --- a/ng2-components/ng2-alfresco-upload/src/components/upload.component.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"upload.component.js","sourceRoot":"","sources":["upload.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqBH;gBAeI,yBAAmB,EAAa;oBAAb,OAAE,GAAF,EAAE,CAAW;oBAVhC,WAAM,GAAU,KAAK,CAAC;oBAQtB,uBAAkB,GAAgB,EAAE,CAAC;oBAGjC,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,CAAC,CAAC;gBACP,CAAC;gBAED,sCAAY,GAAZ,UAAa,KAAK;oBACd,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;wBACf,IAAI,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;wBAC/D,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC;wBAC3D,IAAI,CAAC,UAAU,EAAE,CAAC;wBAClB,IAAI,CAAC,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;oBACnD,CAAC;gBACL,CAAC;gBAED,wCAAc,GAAd,UAAe,KAAK;oBAChB,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;wB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upload/src/services/upload.service.d.ts b/ng2-components/ng2-alfresco-upload/src/services/upload.service.d.ts index 5d6189ce5e..218967923e 100644 --- a/ng2-components/ng2-alfresco-upload/src/services/upload.service.d.ts +++ b/ng2-components/ng2-alfresco-upload/src/services/upload.service.d.ts @@ -1,19 +1,3 @@ -/** - * @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 { FileModel } from '../models/file.model'; export declare class UploadService { private _url; @@ -24,7 +8,7 @@ export declare class UploadService { private _formFields; private _withCredentials; _queue: FileModel[]; - constructor(options: any); + constructor(); addToQueue(files: any[]): FileModel[]; private _uploadFilesInTheQueue(); uploadFile(uploadingFileModel: any): void; diff --git a/ng2-components/ng2-alfresco-upload/src/services/upload.service.js b/ng2-components/ng2-alfresco-upload/src/services/upload.service.js index 238982e7f9..c2c900b20b 100644 --- a/ng2-components/ng2-alfresco-upload/src/services/upload.service.js +++ b/ng2-components/ng2-alfresco-upload/src/services/upload.service.js @@ -14,32 +14,37 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -System.register(['../models/file.model'], function(exports_1, context_1) { +System.register(['angular2/core', '../models/file.model'], function(exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; - var file_model_1; + 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_model_1; var UploadService; return { setters:[ + function (core_1_1) { + core_1 = core_1_1; + }, function (file_model_1_1) { file_model_1 = file_model_1_1; }], execute: function() { UploadService = (function () { - function UploadService(options) { + function UploadService() { this._method = 'POST'; this._authTokenPrefix = 'Basic'; this._authToken = undefined; this._fieldName = 'file'; this._formFields = {}; this._queue = []; - console.log('UploadService constructor'); - this._withCredentials = options.withCredentials != null ? options.withCredentials : this._withCredentials; - this._url = options.url != null ? options.url : this._url; - this._authTokenPrefix = options.authTokenPrefix != null ? options.authTokenPrefix : this._authTokenPrefix; - this._authToken = options.authToken != null ? options.authToken : this._authToken; - this._fieldName = options.fieldName != null ? options.fieldName : this._fieldName; - this._formFields = options.formFields != null ? options.formFields : this._formFields; } UploadService.prototype.addToQueue = function (files) { var latestFilesAdded = []; @@ -108,6 +113,10 @@ System.register(['../models/file.model'], function(exports_1, context_1) { UploadService.prototype._isFile = function (file) { return file !== null && (file instanceof Blob || (file.name && file.size)); }; + UploadService = __decorate([ + core_1.Injectable(), + __metadata('design:paramtypes', []) + ], UploadService); return UploadService; }()); exports_1("UploadService", UploadService); diff --git a/ng2-components/ng2-alfresco-upload/src/services/upload.service.js.map b/ng2-components/ng2-alfresco-upload/src/services/upload.service.js.map index f9cf69d39e..864f320724 100644 --- a/ng2-components/ng2-alfresco-upload/src/services/upload.service.js.map +++ b/ng2-components/ng2-alfresco-upload/src/services/upload.service.js.map @@ -1 +1 @@ -{"version":3,"file":"upload.service.js","sourceRoot":"","sources":["upload.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;YAKH;gBAWI,uBAAY,OAAW;oBATf,YAAO,GAAU,MAAM,CAAC;oBACxB,qBAAgB,GAAU,OAAO,CAAC;oBAClC,eAAU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AI,KAAK,IAAI,IAAI,CAAC,IAAI,YAAY,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;gBAC/E,CAAC;gBAzGL;oBAAC,iBAAU,EAAE;;iCAAA;gBA0Gb,oBAAC;YAAD,CAAC,AAzGD,IAyGC;YAzGD,yCAyGC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-upload/src/services/upload.service.ts b/ng2-components/ng2-alfresco-upload/src/services/upload.service.ts index d3bb4d7472..cc7e8d813a 100644 --- a/ng2-components/ng2-alfresco-upload/src/services/upload.service.ts +++ b/ng2-components/ng2-alfresco-upload/src/services/upload.service.ts @@ -16,8 +16,11 @@ */ +import {Injectable} from 'angular2/core'; import {FileModel} from '../models/file.model'; + +@Injectable() export class UploadService { private _url:string; private _method:string = 'POST'; @@ -29,7 +32,9 @@ export class UploadService { _queue:FileModel[] = []; - constructor(options:any) { + constructor(){} + + constructor(private options:any) { console.log('UploadService constructor'); this._withCredentials = options.withCredentials != null ? options.withCredentials : this._withCredentials;