From 748a49db98d992bc5278c63ed65cd405e79b80a5 Mon Sep 17 00:00:00 2001 From: mauriziovitale84 Date: Thu, 7 Apr 2016 15:16:53 +0100 Subject: [PATCH] File upload + Rest API --- demo-shell-ng2/.gitignore | 1 + demo-shell-ng2/app/app.component.html | 2 + demo-shell-ng2/app/app.component.ts | 5 + demo-shell-ng2/bower.json | 28 + demo-shell-ng2/index.html | 11 + demo-shell-ng2/webcomponents/bower.json | 33 ++ .../webcomponents/file-upload/.bower.json | 43 ++ .../webcomponents/file-upload/LICENSE | 21 + .../webcomponents/file-upload/README.md | 10 + .../file-upload/file-upload.html | 509 ++++++++++++++++++ .../webcomponents/file-upload/index.html | 25 + 11 files changed, 688 insertions(+) create mode 100644 demo-shell-ng2/bower.json create mode 100755 demo-shell-ng2/webcomponents/bower.json create mode 100644 demo-shell-ng2/webcomponents/file-upload/.bower.json create mode 100644 demo-shell-ng2/webcomponents/file-upload/LICENSE create mode 100755 demo-shell-ng2/webcomponents/file-upload/README.md create mode 100755 demo-shell-ng2/webcomponents/file-upload/file-upload.html create mode 100755 demo-shell-ng2/webcomponents/file-upload/index.html diff --git a/demo-shell-ng2/.gitignore b/demo-shell-ng2/.gitignore index dc8ef00369..4534175747 100644 --- a/demo-shell-ng2/.gitignore +++ b/demo-shell-ng2/.gitignore @@ -1,5 +1,6 @@ typings/ node_modules/ +bower_components/ *.js *.js.map .idea diff --git a/demo-shell-ng2/app/app.component.html b/demo-shell-ng2/app/app.component.html index ece8142775..a83e06ce0d 100644 --- a/demo-shell-ng2/app/app.component.html +++ b/demo-shell-ng2/app/app.component.html @@ -4,6 +4,8 @@
+ Choose File + diff --git a/demo-shell-ng2/app/app.component.ts b/demo-shell-ng2/app/app.component.ts index adb1ce2f22..ce4126f460 100644 --- a/demo-shell-ng2/app/app.component.ts +++ b/demo-shell-ng2/app/app.component.ts @@ -27,6 +27,11 @@ import {Page2View} from "./components/page2.view"; ]) export class AppComponent { + target: string = 'http://192.168.99.100:8080/alfresco/service/api/upload'; + multi: string = 'true'; + accept: string ='image/*'; + droppable: boolean = false; + constructor( public auth: Authentication, public router: Router diff --git a/demo-shell-ng2/bower.json b/demo-shell-ng2/bower.json new file mode 100644 index 0000000000..cca0b6da82 --- /dev/null +++ b/demo-shell-ng2/bower.json @@ -0,0 +1,28 @@ +{ + "name": "angular2-quickstart", + "description": "", + "main": "", + "authors": [ + "mauriziovitale84 " + ], + "license": "ISC", + "homepage": "https://github.com/Alfresco/dev-platform-webcomponents", + "moduleType": [ + "node" + ], + "private": true, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "dependencies": { + "polymer": "~1.4.0", + "webcomponentsjs": "~0.7.21", + "paper-button": "~1.0.11", + "paper-progress": "~1.0.9", + "iron-icons": "~1.1.3" + } +} diff --git a/demo-shell-ng2/index.html b/demo-shell-ng2/index.html index f87bee8a62..9ddf80ecb9 100644 --- a/demo-shell-ng2/index.html +++ b/demo-shell-ng2/index.html @@ -12,6 +12,17 @@ + + + + + diff --git a/demo-shell-ng2/webcomponents/bower.json b/demo-shell-ng2/webcomponents/bower.json new file mode 100755 index 0000000000..e89e540bf3 --- /dev/null +++ b/demo-shell-ng2/webcomponents/bower.json @@ -0,0 +1,33 @@ +{ + "name": "file-upload", + "version": "1.6.4", + "authors": [ + "Winston Howes " + ], + "description": "An element for using ajax to upload files.", + "keywords": [ + "web-component", + "web-components", + "polymer", + "file", + "ajax", + "upload" + ], + "main": "file-upload.html", + "license": "MIT", + "homepage": "https://github.com/winhowes/file-upload/", + "ignore": [ + "/.*", + "/test/", + "/demo/", + "/bower_components/" + ], + "dependencies": { + "polymer": "Polymer/polymer#^1.0.0", + "paper-progress": "PolymerElements/paper-progress#^1.0.0" + }, + "devDependencies": { + "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", + "web-component-tester": "*" + } +} diff --git a/demo-shell-ng2/webcomponents/file-upload/.bower.json b/demo-shell-ng2/webcomponents/file-upload/.bower.json new file mode 100644 index 0000000000..5d24dd80e4 --- /dev/null +++ b/demo-shell-ng2/webcomponents/file-upload/.bower.json @@ -0,0 +1,43 @@ +{ + "name": "file-upload", + "version": "1.6.4", + "authors": [ + "Winston Howes " + ], + "description": "An element for using ajax to upload files.", + "keywords": [ + "web-component", + "web-components", + "polymer", + "file", + "ajax", + "upload" + ], + "main": "file-upload.html", + "license": "MIT", + "homepage": "https://github.com/winhowes/file-upload/", + "ignore": [ + "/.*", + "/test/", + "/demo/", + "/bower_components/" + ], + "dependencies": { + "polymer": "Polymer/polymer#^1.0.0", + "paper-progress": "PolymerElements/paper-progress#^1.0.0" + }, + "devDependencies": { + "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", + "web-component-tester": "*" + }, + "_release": "1.6.4", + "_resolution": { + "type": "version", + "tag": "v1.6.4", + "commit": "eeaa8d62ac0d7ae2f5adb9531c427bfba3952f1c" + }, + "_source": "git://github.com/winhowes/file-upload.git", + "_target": "~1.6.4", + "_originalSource": "file-upload", + "_direct": true +} \ No newline at end of file diff --git a/demo-shell-ng2/webcomponents/file-upload/LICENSE b/demo-shell-ng2/webcomponents/file-upload/LICENSE new file mode 100644 index 0000000000..f400d49829 --- /dev/null +++ b/demo-shell-ng2/webcomponents/file-upload/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Winston Howes + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/demo-shell-ng2/webcomponents/file-upload/README.md b/demo-shell-ng2/webcomponents/file-upload/README.md new file mode 100755 index 0000000000..540032943e --- /dev/null +++ b/demo-shell-ng2/webcomponents/file-upload/README.md @@ -0,0 +1,10 @@ +# Introduction +This repository contains an element for file uploads using ajax. It supports multi-file selection as well as optional drop zones for drag-and-drop. The element is designed for use in Polymer 1.0. + +Check out the demo and docs here: https://winhowes.github.io/file-upload/components/file-upload/. + +# Installation +To install simply run: +``` +bower install --save file-upload +``` diff --git a/demo-shell-ng2/webcomponents/file-upload/file-upload.html b/demo-shell-ng2/webcomponents/file-upload/file-upload.html new file mode 100755 index 0000000000..34915076f2 --- /dev/null +++ b/demo-shell-ng2/webcomponents/file-upload/file-upload.html @@ -0,0 +1,509 @@ + + + + + + + + + + + + + + + + + + diff --git a/demo-shell-ng2/webcomponents/file-upload/index.html b/demo-shell-ng2/webcomponents/file-upload/index.html new file mode 100755 index 0000000000..0557d150fa --- /dev/null +++ b/demo-shell-ng2/webcomponents/file-upload/index.html @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + +