mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
demo
This commit is contained in:
5
ng2-components/ng2-alfresco-core/.gitignore
vendored
5
ng2-components/ng2-alfresco-core/.gitignore
vendored
@@ -7,6 +7,7 @@ coverage
|
|||||||
dist
|
dist
|
||||||
src/**/*.js
|
src/**/*.js
|
||||||
src/**/*.js.map
|
src/**/*.js.map
|
||||||
|
src/**/*.d.ts
|
||||||
|
|
||||||
material.js
|
material.js
|
||||||
material.js.map
|
material.js.map
|
||||||
@@ -17,3 +18,7 @@ services.js
|
|||||||
services.js.map
|
services.js.map
|
||||||
services/**/*.js
|
services/**/*.js
|
||||||
services/**/*.js.map
|
services/**/*.js.map
|
||||||
|
|
||||||
|
demo/**/*.js
|
||||||
|
demo/**/*.js.map
|
||||||
|
demo/**/*.d.ts
|
||||||
|
@@ -12,9 +12,10 @@
|
|||||||
"tslint-test": "tslint -c tslint.json test/**/*.ts",
|
"tslint-test": "tslint -c tslint.json test/**/*.ts",
|
||||||
"tslint-src": "tslint -c tslint.json src/**/*.ts",
|
"tslint-src": "tslint -c tslint.json src/**/*.ts",
|
||||||
"tslint-root": "tslint -c tslint.json *.ts",
|
"tslint-root": "tslint -c tslint.json *.ts",
|
||||||
"copytemplates": "npm run copy-html && npm run copy-css",
|
"copytemplates": "npm run copy-html && npm run copy-css && npm run copy-i18n",
|
||||||
"copy-html": "copyfiles './src/**/*.html' dist",
|
"copy-html": "copyfiles './src/**/*.html' dist",
|
||||||
"copy-css": "copyfiles './src/**/*.css' dist",
|
"copy-css": "copyfiles './src/**/*.css' dist",
|
||||||
|
"copy-i18n": "copyfiles './i18n/**/*.json' dist",
|
||||||
"licensecheck": "license-check",
|
"licensecheck": "license-check",
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
|
@@ -12,9 +12,10 @@
|
|||||||
"tslint-test": "tslint -c tslint.json test/**/*.ts",
|
"tslint-test": "tslint -c tslint.json test/**/*.ts",
|
||||||
"tslint-src": "tslint -c tslint.json src/**/*.ts",
|
"tslint-src": "tslint -c tslint.json src/**/*.ts",
|
||||||
"tslint-root": "tslint -c tslint.json *.ts",
|
"tslint-root": "tslint -c tslint.json *.ts",
|
||||||
"copytemplates": "npm run copy-html && npm run copy-css",
|
"copytemplates": "npm run copy-html && npm run copy-css && npm run copy-i18n",
|
||||||
"copy-html": "copyfiles './src/**/*.html' dist",
|
"copy-html": "copyfiles './src/**/*.html' dist",
|
||||||
"copy-css": "copyfiles './src/**/*.css' dist",
|
"copy-css": "copyfiles './src/**/*.css' dist",
|
||||||
|
"copy-i18n": "copyfiles './i18n/**/*.json' dist",
|
||||||
"licensecheck": "license-check",
|
"licensecheck": "license-check",
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
|
@@ -7,5 +7,9 @@ coverage
|
|||||||
dist
|
dist
|
||||||
src/**/*.js
|
src/**/*.js
|
||||||
src/**/*.js.map
|
src/**/*.js.map
|
||||||
|
src/**/*.d.ts
|
||||||
|
demo/**/*.js
|
||||||
|
demo/**/*.js.map
|
||||||
|
demo/**/*.d.ts
|
||||||
ng2-alfresco-documentlist.js
|
ng2-alfresco-documentlist.js
|
||||||
ng2-alfresco-documentlist.js.map
|
ng2-alfresco-documentlist.js.map
|
||||||
|
@@ -12,9 +12,10 @@
|
|||||||
"tslint-test": "tslint -c tslint.json test/**/*.ts",
|
"tslint-test": "tslint -c tslint.json test/**/*.ts",
|
||||||
"tslint-src": "tslint -c tslint.json src/**/*.ts",
|
"tslint-src": "tslint -c tslint.json src/**/*.ts",
|
||||||
"tslint-root": "tslint -c tslint.json *.ts",
|
"tslint-root": "tslint -c tslint.json *.ts",
|
||||||
"copytemplates": "npm run copy-html && npm run copy-css",
|
"copytemplates": "npm run copy-html && npm run copy-css && npm run copy-i18n",
|
||||||
"copy-html": "copyfiles './src/**/*.html' dist",
|
"copy-html": "copyfiles './src/**/*.html' dist",
|
||||||
"copy-css": "copyfiles './src/**/*.css' dist",
|
"copy-css": "copyfiles './src/**/*.css' dist",
|
||||||
|
"copy-i18n": "copyfiles './i18n/**/*.json' dist",
|
||||||
"licensecheck": "license-check",
|
"licensecheck": "license-check",
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
|
4
ng2-components/ng2-alfresco-login/.gitignore
vendored
4
ng2-components/ng2-alfresco-login/.gitignore
vendored
@@ -7,5 +7,9 @@ coverage
|
|||||||
dist
|
dist
|
||||||
src/**/*.js
|
src/**/*.js
|
||||||
src/**/*.js.map
|
src/**/*.js.map
|
||||||
|
src/**/*.d.ts
|
||||||
|
demo/**/*.js
|
||||||
|
demo/**/*.js.map
|
||||||
|
demo/**/*.d.ts
|
||||||
ng2-alfresco-login.js
|
ng2-alfresco-login.js
|
||||||
ng2-alfresco-login.js.map
|
ng2-alfresco-login.js.map
|
||||||
|
5
ng2-components/ng2-alfresco-login/demo/.gitignore
vendored
Normal file
5
ng2-components/ng2-alfresco-login/demo/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
node_modules
|
||||||
|
.idea
|
||||||
|
coverage
|
||||||
|
dist
|
||||||
|
typings
|
6
ng2-components/ng2-alfresco-login/demo/.npmignore
Normal file
6
ng2-components/ng2-alfresco-login/demo/.npmignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
node_modules
|
||||||
|
.idea
|
||||||
|
coverage
|
||||||
|
src
|
||||||
|
typings
|
||||||
|
typings.json
|
21
ng2-components/ng2-alfresco-login/demo/LICENSE
Normal file
21
ng2-components/ng2-alfresco-login/demo/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2016 Raúl Jiménez
|
||||||
|
|
||||||
|
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.
|
13
ng2-components/ng2-alfresco-login/demo/README.md
Normal file
13
ng2-components/ng2-alfresco-login/demo/README.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# angular2-testing
|
||||||
|
|
||||||
|
Install:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the project:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm start
|
||||||
|
```
|
@@ -1,10 +0,0 @@
|
|||||||
import { Router } from 'angular2/router';
|
|
||||||
import { AlfrescoSettingsService } from 'ng2-alfresco-core/services';
|
|
||||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-login/ng2-alfresco-login';
|
|
||||||
export declare class AppComponent {
|
|
||||||
auth: AlfrescoAuthenticationService;
|
|
||||||
router: Router;
|
|
||||||
constructor(auth: AlfrescoAuthenticationService, router: Router, alfrescoSettingsService: AlfrescoSettingsService);
|
|
||||||
mySuccessMethod($event: any): void;
|
|
||||||
myErrorMethod($event: any): void;
|
|
||||||
}
|
|
@@ -1,77 +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-alfresco-login/ng2-alfresco-login', 'angular2/router', 'ng2-alfresco-core/services'], 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_alfresco_login_1, router_1, services_1, ng2_alfresco_login_2;
|
|
||||||
var AppComponent;
|
|
||||||
return {
|
|
||||||
setters:[
|
|
||||||
function (core_1_1) {
|
|
||||||
core_1 = core_1_1;
|
|
||||||
},
|
|
||||||
function (ng2_alfresco_login_1_1) {
|
|
||||||
ng2_alfresco_login_1 = ng2_alfresco_login_1_1;
|
|
||||||
ng2_alfresco_login_2 = ng2_alfresco_login_1_1;
|
|
||||||
},
|
|
||||||
function (router_1_1) {
|
|
||||||
router_1 = router_1_1;
|
|
||||||
},
|
|
||||||
function (services_1_1) {
|
|
||||||
services_1 = services_1_1;
|
|
||||||
}],
|
|
||||||
execute: function() {
|
|
||||||
AppComponent = (function () {
|
|
||||||
function AppComponent(auth, router, alfrescoSettingsService) {
|
|
||||||
this.auth = auth;
|
|
||||||
this.router = router;
|
|
||||||
alfrescoSettingsService.host = 'http://192.168.99.100:8080';
|
|
||||||
}
|
|
||||||
AppComponent.prototype.mySuccessMethod = function ($event) {
|
|
||||||
console.log('Success Login EventEmitt called with: ' + $event.value);
|
|
||||||
};
|
|
||||||
AppComponent.prototype.myErrorMethod = function ($event) {
|
|
||||||
console.log('Error Login EventEmitt called with: ' + $event.value);
|
|
||||||
};
|
|
||||||
AppComponent = __decorate([
|
|
||||||
core_1.Component({
|
|
||||||
selector: 'my-app',
|
|
||||||
template: '<alfresco-login method="POST" (onSuccess)="mySuccessMethod($event)" (onError)="myErrorMethod($event)"></alfresco-login>',
|
|
||||||
directives: [router_1.ROUTER_DIRECTIVES, ng2_alfresco_login_1.AlfrescoLoginComponent]
|
|
||||||
}),
|
|
||||||
router_1.RouteConfig([
|
|
||||||
{ path: '/', name: 'Login', component: ng2_alfresco_login_1.AlfrescoLoginComponent, useAsDefault: true }
|
|
||||||
]),
|
|
||||||
__metadata('design:paramtypes', [(typeof (_a = typeof ng2_alfresco_login_2.AlfrescoAuthenticationService !== 'undefined' && ng2_alfresco_login_2.AlfrescoAuthenticationService) === 'function' && _a) || Object, router_1.Router, (typeof (_b = typeof services_1.AlfrescoSettingsService !== 'undefined' && services_1.AlfrescoSettingsService) === 'function' && _b) || Object])
|
|
||||||
], AppComponent);
|
|
||||||
return AppComponent;
|
|
||||||
var _a, _b;
|
|
||||||
}());
|
|
||||||
exports_1("AppComponent", AppComponent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=app.component.js.map
|
|
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"app.component.js","sourceRoot":"","sources":["app.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkBH;gBAEI,sBAAmB,IAAkC,EAClC,MAAa,EACpB,uBAA+C;oBAFxC,SAAI,GAAJ,IAAI,CAA8B;oBAClC,WAAM,GAAN,MAAM,CAAO;oBAE5B,uBAAuB,CAAC,IAAI,GAAG,4BAA4B,CAAC;gBAEhE,CAAC;gBAED,sCAAe,GAAf,UAAgB,MAAM;oBAClB,OAAO,CAAC,GAAG,CAAC,wCAAwC,GAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACvE,CAAC;gBAED,oCAAa,GAAb,UAAc,MAAM;oBAChB,OAAO,CAAC,GAAG,CAAC,sCAAsC,GAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACrE,CAAC;gBAxBL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,QAAQ;wBAClB,QAAQ,EAAE,yHAAyH;wBACnI,UAAU,EAAE,CAAC,0BAAiB,EAAE,2CAAsB,CAAC;qBAC1D,CAAC;oBAED,oBAAW,CAAC;wBACT,EAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,2CAAsB,EAAE,YAAY,EAAE,IAAI,EAAC;qBACpF,CAAC;;gCAAA;gBAkBF,mBAAC;;YAAD,CAAC,AAjBD,IAiBC;YAjBD,uCAiBC,CAAA"}
|
|
@@ -1,2 +0,0 @@
|
|||||||
export declare class HomeComponent {
|
|
||||||
}
|
|
@@ -1,53 +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'], 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;
|
|
||||||
var HomeComponent;
|
|
||||||
return {
|
|
||||||
setters:[
|
|
||||||
function (core_1_1) {
|
|
||||||
core_1 = core_1_1;
|
|
||||||
}],
|
|
||||||
execute: function() {
|
|
||||||
HomeComponent = (function () {
|
|
||||||
function HomeComponent() {
|
|
||||||
}
|
|
||||||
HomeComponent = __decorate([
|
|
||||||
core_1.Component({
|
|
||||||
selector: 'home',
|
|
||||||
template: 'Welcome'
|
|
||||||
}),
|
|
||||||
__metadata('design:paramtypes', [])
|
|
||||||
], HomeComponent);
|
|
||||||
return HomeComponent;
|
|
||||||
}());
|
|
||||||
exports_1("HomeComponent", HomeComponent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=home.component.js.map
|
|
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"home.component.js","sourceRoot":"","sources":["home.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;YASH;gBAAA;gBAEA,CAAC;gBAPD;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,MAAM;wBAChB,QAAQ,EAAE,SAAS;qBACtB,CAAC;;iCAAA;gBAIF,oBAAC;YAAD,CAAC,AAFD,IAEC;YAFD,yCAEC,CAAA"}
|
|
@@ -1,178 +0,0 @@
|
|||||||
/* This work is licensed under Creative Commons GNU LGPL License.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
License: http://creativecommons.org/licenses/LGPL/2.1/
|
|
||||||
Version: 0.9
|
|
||||||
Author: Stefan Goessner/2006
|
|
||||||
Web: http://goessner.net/
|
|
||||||
*/
|
|
||||||
var parseXml;
|
|
||||||
|
|
||||||
if (typeof window.DOMParser != "undefined") {
|
|
||||||
parseXml = function(xmlStr) {
|
|
||||||
return ( new window.DOMParser() ).parseFromString(xmlStr, "text/xml");
|
|
||||||
};
|
|
||||||
} else if (typeof window.ActiveXObject != "undefined" &&
|
|
||||||
new window.ActiveXObject("Microsoft.XMLDOM")) {
|
|
||||||
parseXml = function(xmlStr) {
|
|
||||||
var xmlDoc = new window.ActiveXObject("Microsoft.XMLDOM");
|
|
||||||
xmlDoc.async = "false";
|
|
||||||
xmlDoc.loadXML(xmlStr);
|
|
||||||
return xmlDoc;
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
throw new Error("No XML parser found");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function xml2json(xml, tab) {
|
|
||||||
var X = {
|
|
||||||
toObj: function(xml) {
|
|
||||||
var o = {};
|
|
||||||
if (xml.nodeType==1) { // element node ..
|
|
||||||
if (xml.attributes.length) // element with attributes ..
|
|
||||||
for (var i=0; i<xml.attributes.length; i++)
|
|
||||||
o["@"+xml.attributes[i].nodeName] = (xml.attributes[i].nodeValue||"").toString();
|
|
||||||
if (xml.firstChild) { // element has child nodes ..
|
|
||||||
var textChild=0, cdataChild=0, hasElementChild=false;
|
|
||||||
for (var n=xml.firstChild; n; n=n.nextSibling) {
|
|
||||||
if (n.nodeType==1) hasElementChild = true;
|
|
||||||
else if (n.nodeType==3 && n.nodeValue.match(/[^ \f\n\r\t\v]/)) textChild++; // non-whitespace text
|
|
||||||
else if (n.nodeType==4) cdataChild++; // cdata section node
|
|
||||||
}
|
|
||||||
if (hasElementChild) {
|
|
||||||
if (textChild < 2 && cdataChild < 2) { // structured element with evtl. a single text or/and cdata node ..
|
|
||||||
X.removeWhite(xml);
|
|
||||||
for (var n=xml.firstChild; n; n=n.nextSibling) {
|
|
||||||
if (n.nodeType == 3) // text node
|
|
||||||
o["#text"] = X.escape(n.nodeValue);
|
|
||||||
else if (n.nodeType == 4) // cdata node
|
|
||||||
o["#cdata"] = X.escape(n.nodeValue);
|
|
||||||
else if (o[n.nodeName]) { // multiple occurence of element ..
|
|
||||||
if (o[n.nodeName] instanceof Array)
|
|
||||||
o[n.nodeName][o[n.nodeName].length] = X.toObj(n);
|
|
||||||
else
|
|
||||||
o[n.nodeName] = [o[n.nodeName], X.toObj(n)];
|
|
||||||
}
|
|
||||||
else // first occurence of element..
|
|
||||||
o[n.nodeName] = X.toObj(n);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else { // mixed content
|
|
||||||
if (!xml.attributes.length)
|
|
||||||
o = X.escape(X.innerXml(xml));
|
|
||||||
else
|
|
||||||
o["#text"] = X.escape(X.innerXml(xml));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (textChild) { // pure text
|
|
||||||
if (!xml.attributes.length)
|
|
||||||
o = X.escape(X.innerXml(xml));
|
|
||||||
else
|
|
||||||
o["#text"] = X.escape(X.innerXml(xml));
|
|
||||||
}
|
|
||||||
else if (cdataChild) { // cdata
|
|
||||||
if (cdataChild > 1)
|
|
||||||
o = X.escape(X.innerXml(xml));
|
|
||||||
else
|
|
||||||
for (var n=xml.firstChild; n; n=n.nextSibling)
|
|
||||||
o["#cdata"] = X.escape(n.nodeValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!xml.attributes.length && !xml.firstChild) o = null;
|
|
||||||
}
|
|
||||||
else if (xml.nodeType==9) { // document.node
|
|
||||||
o = X.toObj(xml.documentElement);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
alert("unhandled node type: " + xml.nodeType);
|
|
||||||
return o;
|
|
||||||
},
|
|
||||||
toJson: function(o, name, ind) {
|
|
||||||
var json = name ? ("\""+name+"\"") : "";
|
|
||||||
if (o instanceof Array) {
|
|
||||||
for (var i=0,n=o.length; i<n; i++)
|
|
||||||
o[i] = X.toJson(o[i], "", ind+"\t");
|
|
||||||
json += (name?":[":"[") + (o.length > 1 ? ("\n"+ind+"\t"+o.join(",\n"+ind+"\t")+"\n"+ind) : o.join("")) + "]";
|
|
||||||
}
|
|
||||||
else if (o == null)
|
|
||||||
json += (name&&":") + "null";
|
|
||||||
else if (typeof(o) == "object") {
|
|
||||||
var arr = [];
|
|
||||||
for (var m in o)
|
|
||||||
arr[arr.length] = X.toJson(o[m], m, ind+"\t");
|
|
||||||
json += (name?":{":"{") + (arr.length > 1 ? ("\n"+ind+"\t"+arr.join(",\n"+ind+"\t")+"\n"+ind) : arr.join("")) + "}";
|
|
||||||
}
|
|
||||||
else if (typeof(o) == "string")
|
|
||||||
json += (name&&":") + "\"" + o.toString() + "\"";
|
|
||||||
else
|
|
||||||
json += (name&&":") + o.toString();
|
|
||||||
return json;
|
|
||||||
},
|
|
||||||
innerXml: function(node) {
|
|
||||||
var s = ""
|
|
||||||
if ("innerHTML" in node)
|
|
||||||
s = node.innerHTML;
|
|
||||||
else {
|
|
||||||
var asXml = function(n) {
|
|
||||||
var s = "";
|
|
||||||
if (n.nodeType == 1) {
|
|
||||||
s += "<" + n.nodeName;
|
|
||||||
for (var i=0; i<n.attributes.length;i++)
|
|
||||||
s += " " + n.attributes[i].nodeName + "=\"" + (n.attributes[i].nodeValue||"").toString() + "\"";
|
|
||||||
if (n.firstChild) {
|
|
||||||
s += ">";
|
|
||||||
for (var c=n.firstChild; c; c=c.nextSibling)
|
|
||||||
s += asXml(c);
|
|
||||||
s += "</"+n.nodeName+">";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
s += "/>";
|
|
||||||
}
|
|
||||||
else if (n.nodeType == 3)
|
|
||||||
s += n.nodeValue;
|
|
||||||
else if (n.nodeType == 4)
|
|
||||||
s += "<![CDATA[" + n.nodeValue + "]]>";
|
|
||||||
return s;
|
|
||||||
};
|
|
||||||
for (var c=node.firstChild; c; c=c.nextSibling)
|
|
||||||
s += asXml(c);
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
},
|
|
||||||
escape: function(txt) {
|
|
||||||
return txt.replace(/[\\]/g, "\\\\")
|
|
||||||
.replace(/[\"]/g, '\\"')
|
|
||||||
.replace(/[\n]/g, '\\n')
|
|
||||||
.replace(/[\r]/g, '\\r');
|
|
||||||
},
|
|
||||||
removeWhite: function(e) {
|
|
||||||
e.normalize();
|
|
||||||
for (var n = e.firstChild; n; ) {
|
|
||||||
if (n.nodeType == 3) { // text node
|
|
||||||
if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) { // pure whitespace text node
|
|
||||||
var nxt = n.nextSibling;
|
|
||||||
e.removeChild(n);
|
|
||||||
n = nxt;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
n = n.nextSibling;
|
|
||||||
}
|
|
||||||
else if (n.nodeType == 1) { // element node
|
|
||||||
X.removeWhite(n);
|
|
||||||
n = n.nextSibling;
|
|
||||||
}
|
|
||||||
else // any other node
|
|
||||||
n = n.nextSibling;
|
|
||||||
}
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
xml = parseXml(xml);
|
|
||||||
if (xml.nodeType == 9) // document node
|
|
||||||
xml = xml.documentElement;
|
|
||||||
var json = X.toJson(X.toObj(X.removeWhite(xml)), xml.nodeName, "\t");
|
|
||||||
return "{\n" + tab + (tab ? json.replace(/\t/g, tab) : json.replace(/\t|\n/g, "")) + "\n}";
|
|
||||||
}
|
|
@@ -1,64 +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/platform/browser', './app.component', 'ng2-alfresco-login/ng2-alfresco-login', 'angular2/router', 'angular2/core', 'angular2/http', 'ng2-translate/ng2-translate', 'ng2-alfresco-core/services'], function(exports_1, context_1) {
|
|
||||||
"use strict";
|
|
||||||
var __moduleName = context_1 && context_1.id;
|
|
||||||
var browser_1, app_component_1, ng2_alfresco_login_1, router_1, core_1, http_1, http_2, ng2_translate_1, services_1;
|
|
||||||
return {
|
|
||||||
setters:[
|
|
||||||
function (browser_1_1) {
|
|
||||||
browser_1 = browser_1_1;
|
|
||||||
},
|
|
||||||
function (app_component_1_1) {
|
|
||||||
app_component_1 = app_component_1_1;
|
|
||||||
},
|
|
||||||
function (ng2_alfresco_login_1_1) {
|
|
||||||
ng2_alfresco_login_1 = ng2_alfresco_login_1_1;
|
|
||||||
},
|
|
||||||
function (router_1_1) {
|
|
||||||
router_1 = router_1_1;
|
|
||||||
},
|
|
||||||
function (core_1_1) {
|
|
||||||
core_1 = core_1_1;
|
|
||||||
},
|
|
||||||
function (http_1_1) {
|
|
||||||
http_1 = http_1_1;
|
|
||||||
http_2 = http_1_1;
|
|
||||||
},
|
|
||||||
function (ng2_translate_1_1) {
|
|
||||||
ng2_translate_1 = ng2_translate_1_1;
|
|
||||||
},
|
|
||||||
function (services_1_1) {
|
|
||||||
services_1 = services_1_1;
|
|
||||||
}],
|
|
||||||
execute: function() {
|
|
||||||
browser_1.bootstrap(app_component_1.AppComponent, [
|
|
||||||
router_1.ROUTER_PROVIDERS,
|
|
||||||
http_2.HTTP_PROVIDERS,
|
|
||||||
core_1.provide(ng2_translate_1.TranslateLoader, {
|
|
||||||
useFactory: function (http) { return new ng2_translate_1.TranslateStaticLoader(http, 'node_modules/ng2-alfresco-login/i18n', '.json'); },
|
|
||||||
deps: [http_1.Http]
|
|
||||||
}),
|
|
||||||
// use TranslateService here, and not TRANSLATE_PROVIDERS (which will define a default TranslateStaticLoader)
|
|
||||||
ng2_translate_1.TranslateService,
|
|
||||||
ng2_alfresco_login_1.ALFRESCO_AUTHENTICATION,
|
|
||||||
services_1.ALFRESCO_CORE_PROVIDERS
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=main.js.map
|
|
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAYH,mBAAS,CAAC,4BAAY,EAAE;gBACpB,yBAAgB;gBAChB,qBAAc;gBACd,cAAO,CAAC,+BAAe,EAAE;oBACrB,UAAU,EAAE,UAAC,IAAU,IAAK,OAAA,IAAI,qCAAqB,CAAC,IAAI,EAAE,sCAAsC,EAAE,OAAO,CAAC,EAAhF,CAAgF;oBAC5G,IAAI,EAAE,CAAC,WAAI,CAAC;iBACf,CAAC;gBACF,6GAA6G;gBAC7G,gCAAgB;gBAChB,4CAAuB;gBACvB,kCAAuB;aAC1B,CAAC,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|||||||
<html>
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>Alfresco Login Component Demo</title>
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<title>Angular 2 Testing</title>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
|
|
||||||
<!-- 1. Load libraries -->
|
<!-- 1. Load libraries -->
|
||||||
@@ -16,23 +17,19 @@
|
|||||||
<script src="node_modules/angular2/bundles/router.dev.js"></script>
|
<script src="node_modules/angular2/bundles/router.dev.js"></script>
|
||||||
<script src="node_modules/angular2/bundles/http.dev.js"></script>
|
<script src="node_modules/angular2/bundles/http.dev.js"></script>
|
||||||
|
|
||||||
<!-- Google Material Design Lite -->
|
|
||||||
<link rel="stylesheet" href="node_modules/material-design-lite/material.min.css">
|
|
||||||
<script src="node_modules/material-design-lite/material.min.js"></script>
|
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
|
||||||
|
|
||||||
<script src="/app/js/xml2json.js"></script>
|
|
||||||
<!-- 2. Configure SystemJS -->
|
|
||||||
<script>
|
<script>
|
||||||
System.config({
|
System.config({
|
||||||
|
defaultJSExtensions: true,
|
||||||
map: {
|
map: {
|
||||||
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
|
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
|
||||||
'ng2-alfresco-login': 'node_modules/ng2-alfresco-login',
|
'ng2-alfresco-login': 'node_modules/ng2-alfresco-login',
|
||||||
'ng2-translate': 'node_modules/ng2-translate',
|
'ng2-translate': 'node_modules/ng2-translate',
|
||||||
'rxjs': 'node_modules/rxjs'
|
'rxjs': 'node_modules/rxjs',
|
||||||
|
'angular2' : 'node_modules/angular2',
|
||||||
|
'app': 'dist/src'
|
||||||
},
|
},
|
||||||
packages: {
|
packages: {
|
||||||
app: {
|
'app': {
|
||||||
defaultExtension: 'js'
|
defaultExtension: 'js'
|
||||||
},
|
},
|
||||||
'ng2-alfresco-core': {
|
'ng2-alfresco-core': {
|
||||||
@@ -46,16 +43,20 @@
|
|||||||
},
|
},
|
||||||
'rxjs': {
|
'rxjs': {
|
||||||
defaultExtension: 'js'
|
defaultExtension: 'js'
|
||||||
|
},
|
||||||
|
'angular2': {
|
||||||
|
defaultExtension: 'js'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
System.import('app/main')
|
|
||||||
.then(null, console.error.bind(console));
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<!-- 3. Display the application -->
|
System.import('dist/src/my-app').catch(console.log.bind(console));
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<my-app>Loading...</my-app>
|
|
||||||
|
<my-login></my-login>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -1,29 +1,34 @@
|
|||||||
{
|
{
|
||||||
"name": "angular2-quickstart",
|
"name": "ng2-alfresco-login-demo",
|
||||||
"version": "1.0.0",
|
"description": "Alfresco Angular2 Login Component - Demo",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"author": "Alfresco Software, Ltd.",
|
||||||
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
|
"postinstall": "npm run typings && npm link ng2-alfresco-login",
|
||||||
"lite": "lite-server",
|
"typings": "typings install",
|
||||||
"postinstall": "typings install",
|
"start": "npm run test && http-server -c-1 -o -p 8875 .",
|
||||||
"tsc": "tsc",
|
"build": "rm -rf dist && tsc",
|
||||||
"tsc:w": "tsc -w",
|
"pretest": "npm install && npm run build"
|
||||||
"typings": "typings"
|
|
||||||
},
|
},
|
||||||
"license": "ISC",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular2": "2.0.0-beta.16",
|
"angular2": "2.0.0-beta.13",
|
||||||
"systemjs": "0.19.26",
|
"es6-promise": "3.0.2",
|
||||||
"es6-shim": "^0.35.0",
|
"es6-shim": "0.35.0",
|
||||||
"reflect-metadata": "0.1.2",
|
"reflect-metadata": "0.1.2",
|
||||||
"rxjs": "5.0.0-beta.2",
|
"rxjs": "5.0.0-beta.2",
|
||||||
"zone.js": "0.6.12",
|
"zone.js": "0.6.6",
|
||||||
"ng2-translate": "^1.11.2",
|
"ng2-translate": "^1.11.2"
|
||||||
"material-design-lite": "^1.1.3"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"concurrently": "^2.0.0",
|
"http-server": "0.8.5",
|
||||||
"lite-server": "^2.2.0",
|
"systemjs": "0.19.17",
|
||||||
"typescript": "^1.8.10",
|
"typescript": "1.7.5",
|
||||||
"typings":"^0.8.1"
|
"typings": "0.6.8"
|
||||||
}
|
},
|
||||||
|
"keywords": [
|
||||||
|
"angular2",
|
||||||
|
"typescript"
|
||||||
|
]
|
||||||
}
|
}
|
@@ -1,3 +1,5 @@
|
|||||||
|
///<reference path="../../node_modules/angular2/typings/browser.d.ts"/>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @license
|
* @license
|
||||||
* Copyright 2016 Alfresco Software, Ltd.
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
@@ -23,7 +25,7 @@ import {AlfrescoAuthenticationService} from 'ng2-alfresco-login/ng2-alfresco-log
|
|||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'my-login',
|
||||||
template: '<alfresco-login method="POST" (onSuccess)="mySuccessMethod($event)" (onError)="myErrorMethod($event)"></alfresco-login>',
|
template: '<alfresco-login method="POST" (onSuccess)="mySuccessMethod($event)" (onError)="myErrorMethod($event)"></alfresco-login>',
|
||||||
directives: [ROUTER_DIRECTIVES, AlfrescoLoginComponent]
|
directives: [ROUTER_DIRECTIVES, AlfrescoLoginComponent]
|
||||||
})
|
})
|
||||||
@@ -31,7 +33,7 @@ import {AlfrescoAuthenticationService} from 'ng2-alfresco-login/ng2-alfresco-log
|
|||||||
@RouteConfig([
|
@RouteConfig([
|
||||||
{path: '/', name: 'Login', component: AlfrescoLoginComponent, useAsDefault: true}
|
{path: '/', name: 'Login', component: AlfrescoLoginComponent, useAsDefault: true}
|
||||||
])
|
])
|
||||||
export class AppComponent {
|
export class MyLoginComponent {
|
||||||
|
|
||||||
constructor(public auth: AlfrescoAuthenticationService,
|
constructor(public auth: AlfrescoAuthenticationService,
|
||||||
public router: Router,
|
public router: Router,
|
@@ -16,16 +16,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {bootstrap} from 'angular2/platform/browser';
|
import {bootstrap} from 'angular2/platform/browser';
|
||||||
import {AppComponent} from './app.component';
|
import {MyLoginComponent} from './components/my-login.component';
|
||||||
import {ALFRESCO_AUTHENTICATION} from 'ng2-alfresco-login/ng2-alfresco-login';
|
import {ALFRESCO_AUTHENTICATION} from 'ng2-alfresco-login/ng2-alfresco-login';
|
||||||
import {ROUTER_PROVIDERS} from 'angular2/router';
|
import {ROUTER_PROVIDERS} from 'angular2/router';
|
||||||
import {provide} from 'angular2/core';
|
import {provide} from 'angular2/core';
|
||||||
import {Http} from 'angular2/http';
|
import {Http} from 'angular2/http';
|
||||||
import {HTTP_PROVIDERS} from 'angular2/http';
|
import {HTTP_PROVIDERS} from 'angular2/http';
|
||||||
import {TRANSLATE_PROVIDERS, TranslateService, TranslateLoader, TranslateStaticLoader} from 'ng2-translate/ng2-translate';
|
import {TranslateService, TranslateLoader, TranslateStaticLoader} from 'ng2-translate/ng2-translate';
|
||||||
import {ALFRESCO_CORE_PROVIDERS} from 'ng2-alfresco-core/services';
|
import {ALFRESCO_CORE_PROVIDERS} from 'ng2-alfresco-core/services';
|
||||||
|
|
||||||
bootstrap(AppComponent, [
|
bootstrap(MyLoginComponent, [
|
||||||
ROUTER_PROVIDERS,
|
ROUTER_PROVIDERS,
|
||||||
HTTP_PROVIDERS,
|
HTTP_PROVIDERS,
|
||||||
provide(TranslateLoader, {
|
provide(TranslateLoader, {
|
@@ -1,18 +1,17 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "ES5",
|
||||||
"module": "system",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"sourceMap": true,
|
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"removeComments": false,
|
"sourceMap": true,
|
||||||
"noImplicitAny": false,
|
"removeComments": true,
|
||||||
"declaration": true
|
"declaration": true,
|
||||||
|
"outDir": "dist"
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"typings/main",
|
"typings"
|
||||||
"typings/main.d.ts"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
{
|
{
|
||||||
|
"name": "angular2-testing",
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {},
|
||||||
"ambientDependencies": {
|
"ambientDependencies": {
|
||||||
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
|
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c",
|
||||||
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b"
|
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#dd638012d63e069f2c99d06ef4dcc9616a943ee4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -75,6 +75,6 @@ module.exports = function (config) {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
singleRun: false
|
singleRun: true
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
@@ -8,13 +8,15 @@
|
|||||||
"typings": "typings install",
|
"typings": "typings install",
|
||||||
"start": "npm run test && http-server -c-1 -o -p 8875 .",
|
"start": "npm run test && http-server -c-1 -o -p 8875 .",
|
||||||
"build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check",
|
"build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check",
|
||||||
"tslint": "npm run tslint-test && npm run tslint-src && npm run tslint-root",
|
"tslint": "npm run tslint-test && npm run tslint-src && npm run tslint-root && npm run tslint-demo",
|
||||||
"tslint-test": "tslint -c tslint.json test/**/*.ts",
|
"tslint-test": "tslint -c tslint.json test/**/*.ts",
|
||||||
"tslint-src": "tslint -c tslint.json src/**/*.ts",
|
"tslint-src": "tslint -c tslint.json src/**/*.ts",
|
||||||
|
"tslint-demo": "tslint -c tslint.json demo/**/*.ts",
|
||||||
"tslint-root": "tslint -c tslint.json *.ts",
|
"tslint-root": "tslint -c tslint.json *.ts",
|
||||||
"copytemplates": "npm run copy-html && npm run copy-css",
|
"copytemplates": "npm run copy-html && npm run copy-css && npm run copy-i18n",
|
||||||
"copy-html": "copyfiles './src/**/*.html' dist",
|
"copy-html": "copyfiles './src/**/*.html' dist",
|
||||||
"copy-css": "copyfiles './src/**/*.css' dist",
|
"copy-css": "copyfiles './src/**/*.css' dist",
|
||||||
|
"copy-i18n": "copyfiles './i18n/**/*.json' dist",
|
||||||
"licensecheck": "license-check",
|
"licensecheck": "license-check",
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
|
@@ -20,7 +20,7 @@ import { Router, ROUTER_DIRECTIVES } from 'angular2/router';
|
|||||||
import { FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators } from 'angular2/common';
|
import { FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators } from 'angular2/common';
|
||||||
import { AlfrescoAuthenticationService } from './../services/alfresco-authentication.service';
|
import { AlfrescoAuthenticationService } from './../services/alfresco-authentication.service';
|
||||||
import { TranslateService, TranslatePipe } from 'ng2-translate/ng2-translate';
|
import { TranslateService, TranslatePipe } from 'ng2-translate/ng2-translate';
|
||||||
declare let componentHandler;
|
declare let componentHandler: any;
|
||||||
declare let __moduleName: string;
|
declare let __moduleName: string;
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -147,7 +147,7 @@ export class AlfrescoLoginComponent {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
isErrorStyle(field: ControlGroup) {
|
isErrorStyle(field: ControlGroup) {
|
||||||
if (componentHandler) {
|
if (typeof componentHandler !== 'undefined') {
|
||||||
componentHandler.upgradeAllRegistered();
|
componentHandler.upgradeAllRegistered();
|
||||||
}
|
}
|
||||||
if (field.valid) {
|
if (field.valid) {
|
||||||
|
@@ -7,5 +7,9 @@ coverage
|
|||||||
dist
|
dist
|
||||||
src/**/*.js
|
src/**/*.js
|
||||||
src/**/*.js.map
|
src/**/*.js.map
|
||||||
|
src/**/*.d.ts
|
||||||
|
demo/**/*.js
|
||||||
|
demo/**/*.js.map
|
||||||
|
demo/**/*.d.ts
|
||||||
ng2-alfresco-upload.js
|
ng2-alfresco-upload.js
|
||||||
ng2-alfresco-upload.js.map
|
ng2-alfresco-upload.js.map
|
||||||
|
5
ng2-components/ng2-alfresco-upload/demo/.gitignore
vendored
Normal file
5
ng2-components/ng2-alfresco-upload/demo/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
node_modules
|
||||||
|
.idea
|
||||||
|
coverage
|
||||||
|
dist
|
||||||
|
typings
|
21
ng2-components/ng2-alfresco-upload/demo/LICENSE
Normal file
21
ng2-components/ng2-alfresco-upload/demo/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2016 Raúl Jiménez
|
||||||
|
|
||||||
|
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.
|
13
ng2-components/ng2-alfresco-upload/demo/README.md
Normal file
13
ng2-components/ng2-alfresco-upload/demo/README.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# angular2-testing
|
||||||
|
|
||||||
|
Install:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the project:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm start
|
||||||
|
```
|
@@ -1,54 +0,0 @@
|
|||||||
<br>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--upload buttons-->
|
|
||||||
|
|
||||||
<form>
|
|
||||||
<div class="mdl-button mdl-js-button mdl-button--raised mdl-button--file">
|
|
||||||
<i class="material-icons">file_upload</i> Upload<input file-select type="file" name="uploadFiles" id="uploadFiles"
|
|
||||||
multiple="multiple"
|
|
||||||
accept=".jpg,.gif,.png,.svg,.mp4"
|
|
||||||
(onFilesAdded)="onFilesAdded($event)"
|
|
||||||
#uploadFiles>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<div class="mdl-button mdl-js-button mdl-button--raised mdl-button--file">
|
|
||||||
<i class="material-icons">file_upload</i> Upload Folder<input file-select type="file" name="uploadFiles" id="uploadFolder"
|
|
||||||
multiple="multiple"
|
|
||||||
accept=".jpg,.gif,.png,.svg"
|
|
||||||
(onFilesAdded)="onFilesAdded($event)"
|
|
||||||
webkitdirectory directory
|
|
||||||
multiple #uploadFiles>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<div file-draggable id='UploadBorder' class="upload-border" (onFilesAdded)="onFilesDragged($event)"
|
|
||||||
dropzone="" webkitdropzone="copy file:image/png file:image/gif file:image/jpeg" #droparea>
|
|
||||||
<ng-content></ng-content>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<!--show dialog-->
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<button type="button" (click)="showDialog($event)" class="mdl-button mdl-js-button mdl-button--raised show-modal">Show
|
|
||||||
Dialog
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<file-uploading-dialog [filesUploadingList]="filesUploadingList" #fileUploadingDialog></file-uploading-dialog>
|
|
||||||
|
|
||||||
<!--show snackbar-->
|
|
||||||
|
|
||||||
|
|
||||||
<div id="demo-snackbar-example" class="mdl-js-snackbar mdl-snackbar" #undoNotificationBar>
|
|
||||||
<div class="mdl-snackbar__text"></div>
|
|
||||||
<button class="mdl-snackbar__action" type="button"></button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br>
|
|
||||||
<br>
|
|
67
ng2-components/ng2-alfresco-upload/demo/index.html
Normal file
67
ng2-components/ng2-alfresco-upload/demo/index.html
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Angular 2 Upload</title>
|
||||||
|
<base href="/">
|
||||||
|
|
||||||
|
<!-- Google Material Design Lite -->
|
||||||
|
<link rel="stylesheet" href="node_modules/material-design-lite/material.min.css">
|
||||||
|
<script src="node_modules/material-design-lite/material.min.js"></script>
|
||||||
|
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
|
||||||
|
|
||||||
|
<!-- 1. Load libraries -->
|
||||||
|
<!-- IE required polyfills, in this exact order -->
|
||||||
|
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
|
||||||
|
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>
|
||||||
|
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
|
||||||
|
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
|
||||||
|
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||||
|
<script src="node_modules/rxjs/bundles/Rx.js"></script>
|
||||||
|
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
|
||||||
|
<script src="node_modules/angular2/bundles/router.dev.js"></script>
|
||||||
|
<script src="node_modules/angular2/bundles/http.dev.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
System.config({
|
||||||
|
defaultJSExtensions: true,
|
||||||
|
map: {
|
||||||
|
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
|
||||||
|
'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload',
|
||||||
|
'ng2-translate': 'node_modules/ng2-translate',
|
||||||
|
'rxjs': 'node_modules/rxjs',
|
||||||
|
'angular2' : 'node_modules/angular2',
|
||||||
|
'app': 'dist/src'
|
||||||
|
},
|
||||||
|
packages: {
|
||||||
|
'app': {
|
||||||
|
defaultExtension: 'js'
|
||||||
|
},
|
||||||
|
'ng2-alfresco-core': {
|
||||||
|
defaultExtension: 'js'
|
||||||
|
},
|
||||||
|
'ng2-alfresco-upload': {
|
||||||
|
defaultExtension: 'js'
|
||||||
|
},
|
||||||
|
'ng2-translate': {
|
||||||
|
defaultExtension: 'js'
|
||||||
|
},
|
||||||
|
'rxjs': {
|
||||||
|
defaultExtension: 'js'
|
||||||
|
},
|
||||||
|
'angular2': {
|
||||||
|
defaultExtension: 'js'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
System.import('dist/src/my-app').catch(console.log.bind(console));
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<my-app></my-app>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
35
ng2-components/ng2-alfresco-upload/demo/package.json
Normal file
35
ng2-components/ng2-alfresco-upload/demo/package.json
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "ng2-alfresco-upload-demo",
|
||||||
|
"description": "Alfresco Angular2 Upload Component - Demo",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"author": "Alfresco Software, Ltd.",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"postinstall": "npm run build && npm run typings && npm link ng2-alfresco-upload && npm link ng2-alfresco-core",
|
||||||
|
"typings": "typings install",
|
||||||
|
"start": "rm -rf dist && npm install && http-server -c-1 -o -p 8875 .",
|
||||||
|
"build": "rm -rf dist && tsc"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"angular2": "2.0.0-beta.13",
|
||||||
|
"es6-promise": "3.0.2",
|
||||||
|
"es6-shim": "0.35.0",
|
||||||
|
"reflect-metadata": "0.1.2",
|
||||||
|
"rxjs": "5.0.0-beta.2",
|
||||||
|
"zone.js": "0.6.6",
|
||||||
|
"ng2-translate": "^1.11.2",
|
||||||
|
"material-design-icons": "^2.2.3",
|
||||||
|
"material-design-lite": "^1.1.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"http-server": "0.8.5",
|
||||||
|
"systemjs": "0.19.17",
|
||||||
|
"typescript": "1.7.5",
|
||||||
|
"typings": "0.6.8"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"angular2",
|
||||||
|
"typescript"
|
||||||
|
]
|
||||||
|
}
|
@@ -1,3 +1,5 @@
|
|||||||
|
///<reference path="../../node_modules/angular2/typings/browser.d.ts"/>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @license
|
* @license
|
||||||
* Copyright 2016 Alfresco Software, Ltd.
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
@@ -16,12 +18,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component } from 'angular2/core';
|
import { Component } from 'angular2/core';
|
||||||
|
import { ALFRESCO_ULPOAD_COMPONENT } from 'ng2-alfresco-upload/dist/ng2-alfresco-upload';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'home',
|
selector: 'my-demo',
|
||||||
template: 'Welcome'
|
template: `<alfresco-upload-button [showDialogUpload]="true"
|
||||||
|
[showUdoNotificationBar]="true"
|
||||||
|
[uploadFolders]="false"
|
||||||
|
[multipleFiles]="false">
|
||||||
|
</alfresco-upload-button>`,
|
||||||
|
directives: [ALFRESCO_ULPOAD_COMPONENT]
|
||||||
})
|
})
|
||||||
|
export class MyDemoComponent {
|
||||||
export class HomeComponent {
|
|
||||||
|
|
||||||
}
|
}
|
40
ng2-components/ng2-alfresco-upload/demo/src/my-app.ts
Normal file
40
ng2-components/ng2-alfresco-upload/demo/src/my-app.ts
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/**
|
||||||
|
* @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, provide } from 'angular2/core';
|
||||||
|
import { bootstrap } from 'angular2/platform/browser';
|
||||||
|
import { HTTP_PROVIDERS } from 'angular2/http';
|
||||||
|
import { MyDemoComponent } from "./components/my-demo.component";
|
||||||
|
import { TranslateLoader, TranslateService } from 'ng2-translate/ng2-translate';
|
||||||
|
import { AlfrescoTranslationLoader } from 'ng2-alfresco-core/services';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'my-app',
|
||||||
|
template: '<my-demo></my-demo>',
|
||||||
|
directives: [MyDemoComponent]
|
||||||
|
})
|
||||||
|
class VgDemo {
|
||||||
|
constructor() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bootstrap(VgDemo, [
|
||||||
|
HTTP_PROVIDERS,
|
||||||
|
provide(TranslateLoader, {useClass: AlfrescoTranslationLoader}),
|
||||||
|
TranslateService
|
||||||
|
]);
|
17
ng2-components/ng2-alfresco-upload/demo/tsconfig.json
Normal file
17
ng2-components/ng2-alfresco-upload/demo/tsconfig.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES5",
|
||||||
|
"module": "commonjs",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"removeComments": true,
|
||||||
|
"declaration": true,
|
||||||
|
"outDir": "dist"
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"typings"
|
||||||
|
]
|
||||||
|
}
|
9
ng2-components/ng2-alfresco-upload/demo/typings.json
Normal file
9
ng2-components/ng2-alfresco-upload/demo/typings.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "angular2-testing",
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {},
|
||||||
|
"ambientDependencies": {
|
||||||
|
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c",
|
||||||
|
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#dd638012d63e069f2c99d06ef4dcc9616a943ee4"
|
||||||
|
}
|
||||||
|
}
|
@@ -12,9 +12,10 @@
|
|||||||
"tslint-test": "tslint -c tslint.json test/**/*.ts",
|
"tslint-test": "tslint -c tslint.json test/**/*.ts",
|
||||||
"tslint-src": "tslint -c tslint.json src/**/*.ts",
|
"tslint-src": "tslint -c tslint.json src/**/*.ts",
|
||||||
"tslint-root": "tslint -c tslint.json *.ts",
|
"tslint-root": "tslint -c tslint.json *.ts",
|
||||||
"copytemplates": "npm run copy-html && npm run copy-css",
|
"copytemplates": "npm run copy-html && npm run copy-css && npm run copy-i18n",
|
||||||
"copy-html": "copyfiles './src/**/*.html' dist",
|
"copy-html": "copyfiles './src/**/*.html' dist",
|
||||||
"copy-css": "copyfiles './src/**/*.css' dist",
|
"copy-css": "copyfiles './src/**/*.css' dist",
|
||||||
|
"copy-i18n": "copyfiles './i18n/**/*.json' dist",
|
||||||
"licensecheck": "license-check",
|
"licensecheck": "license-check",
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
|
@@ -16,11 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
import { Component, ViewChild, ElementRef, Input, Output, EventEmitter } from 'angular2/core';
|
import { Component, ViewChild, ElementRef, Input, Output, EventEmitter, Optional } from 'angular2/core';
|
||||||
import { UploadService } from '../services/upload.service';
|
import { UploadService } from '../services/upload.service';
|
||||||
import { FileModel } from '../models/file.model';
|
import { FileModel } from '../models/file.model';
|
||||||
import { FileUploadingDialogComponent } from './file-uploading-dialog.component';
|
import { FileUploadingDialogComponent } from './file-uploading-dialog.component';
|
||||||
import { TranslateService, TranslatePipe } from 'ng2-translate/ng2-translate';
|
import { TranslateService, TranslatePipe } from 'ng2-translate/ng2-translate';
|
||||||
|
import 'rxjs/Rx';
|
||||||
|
|
||||||
declare let componentHandler: any;
|
declare let componentHandler: any;
|
||||||
declare let __moduleName: string;
|
declare let __moduleName: string;
|
||||||
@@ -88,7 +89,7 @@ export class UploadButtonComponent {
|
|||||||
private _uploaderService: UploadService;
|
private _uploaderService: UploadService;
|
||||||
|
|
||||||
constructor(public el: ElementRef,
|
constructor(public el: ElementRef,
|
||||||
translate: TranslateService) {
|
@Optional() translate: TranslateService) {
|
||||||
console.log('UploadComponent constructor', el);
|
console.log('UploadComponent constructor', el);
|
||||||
|
|
||||||
this._uploaderService = new UploadService({
|
this._uploaderService = new UploadService({
|
||||||
@@ -103,8 +104,10 @@ export class UploadButtonComponent {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (translate) {
|
||||||
this.translationInit(translate);
|
this.translationInit(translate);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method called when files are dropped in the drag area.
|
* Method called when files are dropped in the drag area.
|
||||||
|
@@ -7,3 +7,7 @@ coverage
|
|||||||
dist
|
dist
|
||||||
src/**/*.js
|
src/**/*.js
|
||||||
src/**/*.js.map
|
src/**/*.js.map
|
||||||
|
src/**/*.d.ts
|
||||||
|
demo/**/*.js
|
||||||
|
demo/**/*.js.map
|
||||||
|
demo/**/*.d.ts
|
||||||
|
@@ -17,9 +17,10 @@
|
|||||||
"tslint-test": "tslint -c tslint.json test/**/*.ts",
|
"tslint-test": "tslint -c tslint.json test/**/*.ts",
|
||||||
"tslint-src": "tslint -c tslint.json src/**/*.ts",
|
"tslint-src": "tslint -c tslint.json src/**/*.ts",
|
||||||
"tslint-root": "tslint -c tslint.json *.ts",
|
"tslint-root": "tslint -c tslint.json *.ts",
|
||||||
"copytemplates": "npm run copy-html && npm run copy-css",
|
"copytemplates": "npm run copy-html && npm run copy-css && npm run copy-i18n",
|
||||||
"copy-html": "copyfiles './src/**/*.html' dist",
|
"copy-html": "copyfiles './src/**/*.html' dist",
|
||||||
"copy-css": "copyfiles './src/**/*.css' dist",
|
"copy-css": "copyfiles './src/**/*.css' dist",
|
||||||
|
"copy-i18n": "copyfiles './i18n/**/*.json' dist",
|
||||||
"licensecheck": "license-check",
|
"licensecheck": "license-check",
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
|
Reference in New Issue
Block a user