#33 draft gulp

This commit is contained in:
Mario Romano
2016-04-19 11:57:05 +01:00
parent c90fac92a8
commit 88bd8ea345
91 changed files with 52110 additions and 96 deletions

View File

@@ -0,0 +1,10 @@
root = true
[{src,scripts}/**.{ts,json,js}]
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4

View File

@@ -1,11 +1,11 @@
import {Component} from 'angular2/core';
import {Router, RouteConfig, ROUTER_DIRECTIVES} from "angular2/router";
import {Login} from "./components/login";
import {Authentication} from "./services/authentication";
import {AuthRouterOutlet} from "./components/AuthRouterOutlet";
import {HomeView} from "./components/home.view";
import {Page1View} from "./components/page1.view";
import {Page2View} from "./components/page2.view";
import {Router, RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
import {Login} from './components/login';
import {Authentication} from './services/authentication';
import {AuthRouterOutlet} from './components/AuthRouterOutlet';
import {HomeView} from './components/home.view';
import {Page1View} from './components/page1.view';
import {Page2View} from './components/page2.view';
import {AlfrescoService} from 'ng2-alfresco/components';
@Component({
@@ -21,19 +21,17 @@ import {AlfrescoService} from 'ng2-alfresco/components';
])
export class AppComponent {
constructor(
public auth: Authentication,
public router: Router,
alfrescoService: AlfrescoService
){
constructor(public auth:Authentication,
public router:Router,
alfrescoService:AlfrescoService) {
alfrescoService.host = 'http://192.168.99.100:8080';
}
isActive(instruction: any[]): boolean {
isActive(instruction:any[]):boolean {
return this.router.isRouteActive(this.router.generate(instruction));
}
isLoggedIn(): boolean {
isLoggedIn():boolean {
return this.auth.isLoggedIn();
}

View File

@@ -1,7 +1,7 @@
import {Component} from "angular2/core";
import {Router, ROUTER_DIRECTIVES} from "angular2/router";
import {FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators} from "angular2/common";
import {Authentication} from "../services/authentication";
import {Component} from 'angular2/core';
import {Router, ROUTER_DIRECTIVES} from 'angular2/router';
import {FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators} from 'angular2/common';
import {Authentication} from '../services/authentication';
@Component({
selector: 'login',
@@ -10,31 +10,32 @@ import {Authentication} from "../services/authentication";
styleUrls: ['app/style/login.component.css'],
})
export class Login {
form: ControlGroup;
error: boolean = false;
form:ControlGroup;
error:boolean = false;
isErrorStyle(field:ControlGroup ) {
if(field.valid){
isErrorStyle(field:ControlGroup) {
if (field.valid) {
return false;
} else {
return true;
}
}
constructor(fb: FormBuilder, public auth: Authentication, public router: Router) {
constructor(fb:FormBuilder, public auth:Authentication, public router:Router) {
this.form = fb.group({
username: ['', Validators.compose([Validators.required, Validators.minLength(4)])],
password: ['', Validators.required]
username: ['', Validators.compose([Validators.required, Validators.minLength(4)])],
password: ['', Validators.required]
});
}
onSubmit(value: any, event) {
onSubmit(value:any, event) {
event.preventDefault();
this.auth.login('POST', value.username, value.password)
.subscribe(
//(token: any) => this.router.navigate(['../Home']),
(token: any) => this.router.navigate(['Home']),
() => { this.error = true; }
(token:any) => this.router.navigate(['Home']),
() => {
this.error = true;
}
);
}
}

View File

@@ -1,4 +1,4 @@
import {Component, NgZone} from "angular2/core";
import {Component, NgZone} from 'angular2/core';
import {UPLOAD_DIRECTIVES} from 'ng2-uploader/ng2-uploader';
@Component({
@@ -44,8 +44,8 @@ import {UPLOAD_DIRECTIVES} from 'ng2-uploader/ng2-uploader';
directives: [UPLOAD_DIRECTIVES]
})
export class Page1View {
uploadFile: any;
options: Object = {
uploadFile:any;
options:Object = {
url: 'http://192.168.99.100:8080/alfresco/service/api/upload',
withCredentials: true,
authToken: btoa('admin:admin'),
@@ -57,27 +57,26 @@ export class Page1View {
}
};
zone: NgZone;
dropProgress: number = 0;
dropResp: any[] = [];
zone:NgZone;
dropProgress:number = 0;
dropResp:any[] = [];
constructor() {
this.zone = new NgZone({ enableLongStackTrace: false });
this.zone = new NgZone({enableLongStackTrace: false});
}
handleUpload(data): void {
handleUpload(data):void {
if (data && data.response) {
data = JSON.parse(data.response);
this.uploadFile = data;
}
}
handleDropUpload(data): void {
handleDropUpload(data):void {
let index = this.dropResp.findIndex(x => x.id === data.id);
if (index === -1) {
this.dropResp.push(data);
}
else {
} else {
this.zone.run(() => {
this.dropResp[index] = data;
});

View File

@@ -1,4 +1,4 @@
import {Component} from "angular2/core";
import {Component} from 'angular2/core';
import {HelloWorld} from 'ng2-alfresco/components';
@Component({

View File

@@ -1,9 +1,9 @@
import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from './app.component';
import {ROUTER_PROVIDERS} from "angular2/router";
import {ROUTER_PROVIDERS} from 'angular2/router';
import {HTTP_PROVIDERS} from 'angular2/http';
import {Authentication} from "./services/authentication";
import {ALFRESCO_PROVIDERS} from "ng2-alfresco/components";
import {Authentication} from './services/authentication';
import {ALFRESCO_PROVIDERS} from 'ng2-alfresco/components';
bootstrap(AppComponent, [
ROUTER_PROVIDERS,

View File

@@ -1,4 +1,4 @@
import {Injectable} from "angular2/core";
import {Injectable} from 'angular2/core';
import {Observable} from 'rxjs/Rx';
import {Http, Headers, URLSearchParams, Response} from 'angular2/http';
@@ -6,12 +6,12 @@ declare var xml2json:any;
@Injectable()
export class Authentication {
token: string;
token:string;
private _host: string = 'http://192.168.99.100:8080';
private _baseUrl: string = this._host + '/alfresco/service/api/';
private _host:string = 'http://192.168.99.100:8080';
private _baseUrl:string = this._host + '/alfresco/service/api/';
constructor(public http: Http) {
constructor(public http:Http) {
this.token = localStorage.getItem('token');
}
@@ -34,7 +34,7 @@ export class Authentication {
return this.http.get(this._baseUrl + 'login', {search: searchParams})
.map((res:any) => {
let data = JSON.parse(xml2json(res.text(),' '));
let data = JSON.parse(xml2json(res.text(), ' '));
this.token = data.ticket;
this.saveJwt(this.token);
})
@@ -42,16 +42,16 @@ export class Authentication {
}
loginPost(username:string, password:string) {
var credentials = "{ username: " + username+ ", password: "+ password +" }";
let credentials = '{ username: ' + username + ', password: ' + password + ' }';
var headers = new Headers();
let headers = new Headers();
headers.append('Content-Type', 'application/json');
return this.http.post(this._baseUrl+ 'login', credentials, {
headers: headers
})
return this.http.post(this._baseUrl + 'login', credentials, {
headers: headers
})
.map((res:any) => {
let response = res.json();
let response = res.json();
this.token = response.data.ticket;
this.saveJwt(this.token);
})
@@ -59,8 +59,8 @@ export class Authentication {
}
saveJwt(jwt) {
if(jwt) {
localStorage.setItem('token', jwt)
if (jwt) {
localStorage.setItem('token', jwt);
}
}
@@ -71,7 +71,7 @@ export class Authentication {
return Observable.of(true);
}
private handleError (error: Response) {
private handleError(error:Response) {
// in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console
console.error(error);

View File

@@ -1,36 +0,0 @@
{
"name": "angular2-quickstart",
"description": "",
"main": "",
"authors": [
"mauriziovitale84 <maurizio.vitale@alfresco.com>"
],
"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",
"iron-list": "~1.2.8",
"paper-badge": "~1.1.1",
"iron-ajax": "~1.2.0",
"paper-icon-button": "~1.0.7",
"paper-toolbar": "~1.1.4",
"iron-signals": "~1.0.3",
"paper-item": "~1.1.4",
"paper-dropdown-menu": "~1.1.3"
}
}

View File

@@ -0,0 +1,46 @@
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand navbar-alfresco-logo" [routerLink]="['Home']">
<img src="app/img/blank.gif">
</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li [class.active]="isActive(['Home'])">
<a [routerLink]="['Home']">Home <span class="sr-only">(current)</span></a>
</li>
<li [class.active]="isActive(['Page1'])">
<a [routerLink]="['Page1']">Uploader</a>
</li>
<li [class.active]="isActive(['Page2'])">
<a [routerLink]="['Page2']">Page 2</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-menu-hamburger"></span>
</a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li role="separator" class="divider"></li>
<li><a *ngIf="!isLoggedIn()" [routerLink]="['Login']">Login</a></li>
<li><a *ngIf="isLoggedIn()" href="#" (click)="onLogout($event)">Logout</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<!--<router-outlet></router-outlet>-->
<auth-router-outlet></auth-router-outlet>

105
demo-shell-ng2/dist/app/app.component.js vendored Normal file
View File

@@ -0,0 +1,105 @@
System.register(['angular2/core', './services/form-service', "angular2/router", "./components/login", "./services/authentication", "./components/AuthRouterOutlet", "./components/core/SideMenu", "./components/core/navbar.component", "./components/form-design-toolbar.component", "./components/forms.view", "./components/page1.view", "./components/page2.view"], 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, form_service_1, router_1, login_1, authentication_1, AuthRouterOutlet_1, SideMenu_1, navbar_component_1, form_design_toolbar_component_1, forms_view_1, page1_view_1, page2_view_1;
var AppComponent;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (form_service_1_1) {
form_service_1 = form_service_1_1;
},
function (router_1_1) {
router_1 = router_1_1;
},
function (login_1_1) {
login_1 = login_1_1;
},
function (authentication_1_1) {
authentication_1 = authentication_1_1;
},
function (AuthRouterOutlet_1_1) {
AuthRouterOutlet_1 = AuthRouterOutlet_1_1;
},
function (SideMenu_1_1) {
SideMenu_1 = SideMenu_1_1;
},
function (navbar_component_1_1) {
navbar_component_1 = navbar_component_1_1;
},
function (form_design_toolbar_component_1_1) {
form_design_toolbar_component_1 = form_design_toolbar_component_1_1;
},
function (forms_view_1_1) {
forms_view_1 = forms_view_1_1;
},
function (page1_view_1_1) {
page1_view_1 = page1_view_1_1;
},
function (page2_view_1_1) {
page2_view_1 = page2_view_1_1;
}],
execute: function() {
AppComponent = (function () {
function AppComponent(auth, router) {
this.auth = auth;
this.router = router;
this.target = 'http://192.168.99.100:8080/alfresco/service/api/upload';
this.multi = 'true';
this.accept = 'image/*';
this.droppable = false;
}
AppComponent.prototype.toggleMenu = function (menu, $event) {
if (menu) {
menu.toggle();
}
if ($event) {
$event.preventDefault();
}
};
AppComponent.prototype.isActive = function (instruction) {
return this.router.isRouteActive(this.router.generate(instruction));
};
AppComponent.prototype.isLoggedIn = function () {
return this.auth.isLoggedIn();
};
AppComponent.prototype.onLogout = function (event) {
var _this = this;
event.preventDefault();
this.auth.logout()
.subscribe(function () { return _this.router.navigate(['Login']); });
};
AppComponent = __decorate([
core_1.Component({
selector: 'my-app',
templateUrl: 'app/app.component.html',
directives: [router_1.ROUTER_DIRECTIVES, AuthRouterOutlet_1.AuthRouterOutlet, SideMenu_1.SideMenu, navbar_component_1.AppNavBar, form_design_toolbar_component_1.FormDesignToolbar],
providers: [form_service_1.FormService]
}),
router_1.RouteConfig([
{ path: '/', name: 'Home', component: page2_view_1.Page2View, useAsDefault: true },
{ path: '/login', name: 'Login', component: login_1.Login },
{ path: '/forms', name: 'Forms', component: forms_view_1.FormsView },
{ path: '/page1', name: 'Page1', component: page1_view_1.Page1View },
{ path: '/page2', name: 'Page2', component: page2_view_1.Page2View }
]),
__metadata('design:paramtypes', [authentication_1.Authentication, router_1.Router])
], AppComponent);
return AppComponent;
}());
exports_1("AppComponent", AppComponent);
}
}
});
//# sourceMappingURL=app.component.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"app.component.js","sourceRoot":"","sources":["app.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4BA;gBAOI,sBACW,IAAoB,EACpB,MAAc;oBADd,SAAI,GAAJ,IAAI,CAAgB;oBACpB,WAAM,GAAN,MAAM,CAAQ;oBAPzB,WAAM,GAAW,wDAAwD,CAAC;oBAC1E,UAAK,GAAW,MAAM,CAAC;oBACvB,WAAM,GAAU,SAAS,CAAC;oBAC1B,cAAS,GAAY,KAAK,CAAC;gBAKzB,CAAC;gBAEH,iCAAU,GAAV,UAAW,IAAc,EAAE,MAAM;oBAC7B,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;wBACP,IAAI,CAAC,MAAM,EAAE,CAAC;oBAClB,CAAC;oBACD,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;wBACT,MAAM,CAAC,cAAc,EAAE,CAAC;oBAC5B,CAAC;gBACL,CAAC;gBAED,+BAAQ,GAAR,UAAS,WAAkB;oBACvB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;gBACxE,CAAC;gBAED,iCAAU,GAAV;oBACI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClC,CAAC;gBAED,+BAAQ,GAAR,UAAS,KAAK;oBAAd,iBAMC;oBALG,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;yBACb,SAAS,CACN,cAAM,OAAA,KAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,EAA/B,CAA+B,CACxC,CAAC;gBACV,CAAC;gBAhDL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,QAAQ;wBAClB,WAAW,EAAE,wBAAwB;wBACrC,UAAU,EAAE,CAAC,0BAAiB,EAAE,mCAAgB,EAAE,mBAAQ,EAAE,4BAAS,EAAE,iDAAiB,CAAC;wBACzF,SAAS,EAAE,CAAC,0BAAW,CAAC;qBAC3B,CAAC;oBACD,oBAAW,CAAC;wBACT,EAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,sBAAS,EAAE,YAAY,EAAE,IAAI,EAAC;wBACnE,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAK,EAAC;wBACjD,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,sBAAS,EAAC;wBACrD,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,sBAAS,EAAC;wBACrD,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,sBAAS,EAAC;qBACxD,CAAC;;gCAAA;gBA6CF,mBAAC;YAAD,CAAC,AA5CD,IA4CC;YA5CD,uCA4CC,CAAA"}

View File

@@ -0,0 +1,85 @@
System.register(['angular2/core', 'angular2/router', './components/login', './services/authentication', './components/AuthRouterOutlet', './components/home.view', './components/page1.view', './components/page2.view', 'ng2-alfresco/components'], 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, router_1, login_1, authentication_1, AuthRouterOutlet_1, home_view_1, page1_view_1, page2_view_1, components_1;
var AppComponent;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (router_1_1) {
router_1 = router_1_1;
},
function (login_1_1) {
login_1 = login_1_1;
},
function (authentication_1_1) {
authentication_1 = authentication_1_1;
},
function (AuthRouterOutlet_1_1) {
AuthRouterOutlet_1 = AuthRouterOutlet_1_1;
},
function (home_view_1_1) {
home_view_1 = home_view_1_1;
},
function (page1_view_1_1) {
page1_view_1 = page1_view_1_1;
},
function (page2_view_1_1) {
page2_view_1 = page2_view_1_1;
},
function (components_1_1) {
components_1 = components_1_1;
}],
execute: function() {
AppComponent = (function () {
function AppComponent(auth, router, alfrescoService) {
this.auth = auth;
this.router = router;
alfrescoService.host = 'http://192.168.99.100:8080';
}
AppComponent.prototype.isActive = function (instruction) {
return this.router.isRouteActive(this.router.generate(instruction));
};
AppComponent.prototype.isLoggedIn = function () {
return this.auth.isLoggedIn();
};
AppComponent.prototype.onLogout = function (event) {
var _this = this;
event.preventDefault();
this.auth.logout()
.subscribe(function () { return _this.router.navigate(['Login']); });
};
AppComponent = __decorate([
core_1.Component({
selector: 'my-app',
templateUrl: 'app/app.component.html',
directives: [router_1.ROUTER_DIRECTIVES, AuthRouterOutlet_1.AuthRouterOutlet]
}),
router_1.RouteConfig([
{ path: '/', name: 'Home', component: home_view_1.HomeView, useAsDefault: true },
{ path: '/login', name: 'Login', component: login_1.Login },
{ path: '/page1', name: 'Page1', component: page1_view_1.Page1View },
{ path: '/page2', name: 'Page2', component: page2_view_1.Page2View }
]),
__metadata('design:paramtypes', [authentication_1.Authentication, router_1.Router, (typeof (_a = typeof components_1.AlfrescoService !== 'undefined' && components_1.AlfrescoService) === 'function' && _a) || Object])
], AppComponent);
return AppComponent;
var _a;
}());
exports_1("AppComponent", AppComponent);
}
}
});
//# sourceMappingURL=app.component.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["app.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqBA;gBAEI,sBAAmB,IAAmB,EACnB,MAAa,EACpB,eAA+B;oBAFxB,SAAI,GAAJ,IAAI,CAAe;oBACnB,WAAM,GAAN,MAAM,CAAO;oBAE5B,eAAe,CAAC,IAAI,GAAG,4BAA4B,CAAC;gBACxD,CAAC;gBAED,+BAAQ,GAAR,UAAS,WAAiB;oBACtB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;gBACxE,CAAC;gBAED,iCAAU,GAAV;oBACI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClC,CAAC;gBAED,+BAAQ,GAAR,UAAS,KAAK;oBAAd,iBAMC;oBALG,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;yBACb,SAAS,CACN,cAAM,OAAA,KAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,EAA/B,CAA+B,CACxC,CAAC;gBACV,CAAC;gBAjCL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,QAAQ;wBAClB,WAAW,EAAE,wBAAwB;wBACrC,UAAU,EAAE,CAAC,0BAAiB,EAAE,mCAAgB,CAAC;qBACpD,CAAC;oBACD,oBAAW,CAAC;wBACT,EAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAQ,EAAE,YAAY,EAAE,IAAI,EAAC;wBAClE,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAK,EAAC;wBACjD,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,sBAAS,EAAC;wBACrD,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,sBAAS,EAAC;qBACxD,CAAC;;gCAAA;gBAwBF,mBAAC;;YAAD,CAvBA,AAuBC,IAAA;YAvBD,uCAuBC,CAAA","file":"app.component.js","sourcesContent":["import {Component} from 'angular2/core';\nimport {Router, RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';\nimport {Login} from './components/login';\nimport {Authentication} from './services/authentication';\nimport {AuthRouterOutlet} from './components/AuthRouterOutlet';\nimport {HomeView} from './components/home.view';\nimport {Page1View} from './components/page1.view';\nimport {Page2View} from './components/page2.view';\nimport {AlfrescoService} from 'ng2-alfresco/components';\n\n@Component({\n selector: 'my-app',\n templateUrl: 'app/app.component.html',\n directives: [ROUTER_DIRECTIVES, AuthRouterOutlet]\n})\n@RouteConfig([\n {path: '/', name: 'Home', component: HomeView, useAsDefault: true},\n {path: '/login', name: 'Login', component: Login},\n {path: '/page1', name: 'Page1', component: Page1View},\n {path: '/page2', name: 'Page2', component: Page2View}\n])\nexport class AppComponent {\n\n constructor(public auth:Authentication,\n public router:Router,\n alfrescoService:AlfrescoService) {\n alfrescoService.host = 'http://192.168.99.100:8080';\n }\n\n isActive(instruction:any[]):boolean {\n return this.router.isRouteActive(this.router.generate(instruction));\n }\n\n isLoggedIn():boolean {\n return this.auth.isLoggedIn();\n }\n\n onLogout(event) {\n event.preventDefault();\n this.auth.logout()\n .subscribe(\n () => this.router.navigate(['Login'])\n );\n }\n}\n"]}

View File

@@ -0,0 +1,67 @@
System.register(['angular2/core', 'angular2/router', '../services/authentication'], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
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 __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var core_1, router_1, authentication_1;
var AuthRouterOutlet;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (router_1_1) {
router_1 = router_1_1;
},
function (authentication_1_1) {
authentication_1 = authentication_1_1;
}],
execute: function() {
AuthRouterOutlet = (function (_super) {
__extends(AuthRouterOutlet, _super);
function AuthRouterOutlet(_elementRef, _loader, _parentRouter, nameAttr, authentication) {
_super.call(this, _elementRef, _loader, _parentRouter, nameAttr);
this.authentication = authentication;
this.router = _parentRouter;
this.publicRoutes = [
'', 'login', 'signup'
];
}
AuthRouterOutlet.prototype.activate = function (instruction) {
if (this._canActivate(instruction.urlPath)) {
return _super.prototype.activate.call(this, instruction);
}
this.router.navigate(['Login']);
};
AuthRouterOutlet.prototype._canActivate = function (url) {
return this.publicRoutes.indexOf(url) !== -1
|| this.authentication.isLoggedIn();
};
AuthRouterOutlet = __decorate([
core_1.Directive({ selector: 'auth-router-outlet' }),
__param(3, core_1.Attribute('name')),
__metadata('design:paramtypes', [core_1.ElementRef, core_1.DynamicComponentLoader, router_1.Router, String, authentication_1.Authentication])
], AuthRouterOutlet);
return AuthRouterOutlet;
}(router_1.RouterOutlet));
exports_1("AuthRouterOutlet", AuthRouterOutlet);
}
}
});
//# sourceMappingURL=AuthRouterOutlet.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["components/AuthRouterOutlet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKA;gBAAsC,oCAAY;gBAK9C,0BACI,WAAuB,EAAE,OAA+B,EACxD,aAAqB,EAAqB,QAAgB,EAClD,cAA8B;oBAEtC,kBAAM,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;oBAF7C,mBAAc,GAAd,cAAc,CAAgB;oBAItC,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;oBAC5B,IAAI,CAAC,YAAY,GAAG;wBAChB,EAAE,EAAE,OAAO,EAAE,QAAQ;qBACxB,CAAC;gBACN,CAAC;gBAED,mCAAQ,GAAR,UAAS,WAAiC;oBACtC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;wBACzC,MAAM,CAAC,gBAAK,CAAC,QAAQ,YAAC,WAAW,CAAC,CAAC;oBACvC,CAAC;oBAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBACpC,CAAC;gBAED,uCAAY,GAAZ,UAAa,GAAG;oBACZ,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;2BACrC,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;gBAC5C,CAAC;gBA9BL;oBAAC,gBAAS,CAAC,EAAC,QAAQ,EAAE,oBAAoB,EAAC,CAAC;+BAQZ,gBAAS,CAAC,MAAM,CAAC;;oCARL;gBA+B5C,uBAAC;YAAD,CA9BA,AA8BC,CA9BqC,qBAAY,GA8BjD;YA9BD,+CA8BC,CAAA","file":"AuthRouterOutlet.js","sourcesContent":["import { ElementRef, DynamicComponentLoader, Directive, Attribute } from 'angular2/core';\nimport { Router, RouterOutlet, ComponentInstruction } from 'angular2/router';\nimport {Authentication} from '../services/authentication';\n\n@Directive({selector: 'auth-router-outlet'})\nexport class AuthRouterOutlet extends RouterOutlet {\n\n publicRoutes: Array<string>;\n private router: Router;\n\n constructor(\n _elementRef: ElementRef, _loader: DynamicComponentLoader,\n _parentRouter: Router, @Attribute('name') nameAttr: string,\n private authentication: Authentication\n ) {\n super(_elementRef, _loader, _parentRouter, nameAttr);\n\n this.router = _parentRouter;\n this.publicRoutes = [\n '', 'login', 'signup'\n ];\n }\n\n activate(instruction: ComponentInstruction) {\n if (this._canActivate(instruction.urlPath)) {\n return super.activate(instruction);\n }\n\n this.router.navigate(['Login']);\n }\n\n _canActivate(url) {\n return this.publicRoutes.indexOf(url) !== -1\n || this.authentication.isLoggedIn();\n }\n}\n"]}

View File

@@ -0,0 +1,54 @@
System.register(['angular2/core', 'ng2-alfresco/components'], 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, components_1;
var HomeView;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (components_1_1) {
components_1 = components_1_1;
}],
execute: function() {
HomeView = (function () {
function HomeView() {
this.thumbnails = true;
this.breadcrumb = false;
this.navigation = true;
this.downloads = true;
this.events = [];
}
HomeView.prototype.onItemClick = function ($event) {
console.log($event.value);
this.events.push({
name: 'Item Clicked',
value: $event.value
});
};
HomeView = __decorate([
core_1.Component({
selector: 'home-view',
template: "\n <div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-md-2\">\n <ul class=\"list-unstyled\">\n <li><label><input type=\"checkbox\" [(ngModel)]=\"thumbnails\"> Thumbnails</label></li>\n <li><label><input type=\"checkbox\" [(ngModel)]=\"breadcrumb\"> Breadcrumb</label></li>\n <li><label><input type=\"checkbox\" [(ngModel)]=\"navigation\"> Navigation</label></li>\n <li><label><input type=\"checkbox\" [(ngModel)]=\"downloads\"> Downloads</label></li>\n </ul>\n <hr>\n <ul class=\"list-unstyled\" style=\"font-size: 10px\">\n <li *ngFor=\"#event of events\">\n <strong>{{event.name}}</strong>: {{event.value.displayName}}\n </li>\n </ul>\n </div>\n <div class=\"col-md-10\">\n <alfresco-document-list #list \n [thumbnails]=\"thumbnails\"\n [breadcrumb]=\"breadcrumb\"\n [navigate]=\"navigation\"\n [downloads]=\"downloads\"\n (itemClick)=\"onItemClick($event)\">\n </alfresco-document-list>\n </div>\n </div>\n </div>\n ",
directives: [components_1.DocumentList]
}),
__metadata('design:paramtypes', [])
], HomeView);
return HomeView;
}());
exports_1("HomeView", HomeView);
}
}
});
//# sourceMappingURL=home.view.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["components/home.view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YAoCA;gBAAA;oBACI,eAAU,GAAY,IAAI,CAAC;oBAC3B,eAAU,GAAY,KAAK,CAAC;oBAC5B,eAAU,GAAY,IAAI,CAAC;oBAC3B,cAAS,GAAY,IAAI,CAAC;oBAE1B,WAAM,GAAU,EAAE,CAAC;gBASvB,CAAC;gBAPG,8BAAW,GAAX,UAAY,MAAM;oBACd,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;oBAC1B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;wBACb,IAAI,EAAE,cAAc;wBACpB,KAAK,EAAE,MAAM,CAAC,KAAK;qBACtB,CAAC,CAAC;gBACP,CAAC;gBA/CL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,WAAW;wBACrB,QAAQ,EAAE,+6CA4BT;wBACD,UAAU,EAAE,CAAC,yBAAY,CAAC;qBAC7B,CAAC;;4BAAA;gBAgBF,eAAC;YAAD,CAfA,AAeC,IAAA;YAfD,+BAeC,CAAA","file":"home.view.js","sourcesContent":["import {Component} from 'angular2/core';\nimport {DocumentList} from 'ng2-alfresco/components';\n\n@Component({\n selector: 'home-view',\n template: `\n <div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-md-2\">\n <ul class=\"list-unstyled\">\n <li><label><input type=\"checkbox\" [(ngModel)]=\"thumbnails\"> Thumbnails</label></li>\n <li><label><input type=\"checkbox\" [(ngModel)]=\"breadcrumb\"> Breadcrumb</label></li>\n <li><label><input type=\"checkbox\" [(ngModel)]=\"navigation\"> Navigation</label></li>\n <li><label><input type=\"checkbox\" [(ngModel)]=\"downloads\"> Downloads</label></li>\n </ul>\n <hr>\n <ul class=\"list-unstyled\" style=\"font-size: 10px\">\n <li *ngFor=\"#event of events\">\n <strong>{{event.name}}</strong>: {{event.value.displayName}}\n </li>\n </ul>\n </div>\n <div class=\"col-md-10\">\n <alfresco-document-list #list \n [thumbnails]=\"thumbnails\"\n [breadcrumb]=\"breadcrumb\"\n [navigate]=\"navigation\"\n [downloads]=\"downloads\"\n (itemClick)=\"onItemClick($event)\">\n </alfresco-document-list>\n </div>\n </div>\n </div>\n `,\n directives: [DocumentList]\n})\nexport class HomeView {\n thumbnails: boolean = true;\n breadcrumb: boolean = false;\n navigation: boolean = true;\n downloads: boolean = true;\n\n events: any[] = [];\n\n onItemClick($event) {\n console.log($event.value);\n this.events.push({\n name: 'Item Clicked',\n value: $event.value\n });\n }\n}\n"]}

View File

@@ -0,0 +1,72 @@
System.register(['angular2/core', 'angular2/router', 'angular2/common', '../services/authentication'], 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, router_1, common_1, authentication_1;
var Login;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (router_1_1) {
router_1 = router_1_1;
},
function (common_1_1) {
common_1 = common_1_1;
},
function (authentication_1_1) {
authentication_1 = authentication_1_1;
}],
execute: function() {
Login = (function () {
function Login(fb, auth, router) {
this.auth = auth;
this.router = router;
this.error = false;
this.form = fb.group({
username: ['', common_1.Validators.compose([common_1.Validators.required, common_1.Validators.minLength(4)])],
password: ['', common_1.Validators.required]
});
}
Login.prototype.isErrorStyle = function (field) {
if (field.valid) {
return false;
}
else {
return true;
}
};
Login.prototype.onSubmit = function (value, event) {
var _this = this;
event.preventDefault();
this.auth.login('POST', value.username, value.password)
.subscribe(function (token) { return _this.router.navigate(['Home']); }, function () {
_this.error = true;
});
};
Login = __decorate([
core_1.Component({
selector: 'login',
directives: [router_1.ROUTER_DIRECTIVES, common_1.FORM_DIRECTIVES],
templateUrl: 'app/template/login.component.html',
styleUrls: ['app/style/login.component.css'],
}),
__metadata('design:paramtypes', [common_1.FormBuilder, authentication_1.Authentication, router_1.Router])
], Login);
return Login;
}());
exports_1("Login", Login);
}
}
});
//# sourceMappingURL=login.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["components/login.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAWA;gBAYI,eAAY,EAAc,EAAS,IAAmB,EAAS,MAAa;oBAAzC,SAAI,GAAJ,IAAI,CAAe;oBAAS,WAAM,GAAN,MAAM,CAAO;oBAV5E,UAAK,GAAW,KAAK,CAAC;oBAWlB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC;wBACjB,QAAQ,EAAE,CAAC,EAAE,EAAE,mBAAU,CAAC,OAAO,CAAC,CAAC,mBAAU,CAAC,QAAQ,EAAE,mBAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBAClF,QAAQ,EAAE,CAAC,EAAE,EAAE,mBAAU,CAAC,QAAQ,CAAC;qBACtC,CAAC,CAAC;gBACP,CAAC;gBAbD,4BAAY,GAAZ,UAAa,KAAkB;oBAC3B,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;wBACd,MAAM,CAAC,KAAK,CAAC;oBACjB,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,IAAI,CAAC;oBAChB,CAAC;gBACL,CAAC;gBASD,wBAAQ,GAAR,UAAS,KAAS,EAAE,KAAK;oBAAzB,iBASC;oBARG,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;yBAClD,SAAS,CACN,UAAC,KAAS,IAAK,OAAA,KAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,EAA9B,CAA8B,EAC7C;wBACI,KAAI,CAAC,KAAK,GAAG,IAAI,CAAC;oBACtB,CAAC,CACJ,CAAC;gBACV,CAAC;gBAlCL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,OAAO;wBACjB,UAAU,EAAE,CAAC,0BAAiB,EAAE,wBAAe,CAAC;wBAChD,WAAW,EAAE,mCAAmC;wBAChD,SAAS,EAAE,CAAC,+BAA+B,CAAC;qBAC/C,CAAC;;yBAAA;gBA8BF,YAAC;YAAD,CA7BA,AA6BC,IAAA;YA7BD,yBA6BC,CAAA","file":"login.js","sourcesContent":["import {Component} from 'angular2/core';\nimport {Router, ROUTER_DIRECTIVES} from 'angular2/router';\nimport {FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators} from 'angular2/common';\nimport {Authentication} from '../services/authentication';\n\n@Component({\n selector: 'login',\n directives: [ROUTER_DIRECTIVES, FORM_DIRECTIVES],\n templateUrl: 'app/template/login.component.html',\n styleUrls: ['app/style/login.component.css'],\n})\nexport class Login {\n form:ControlGroup;\n error:boolean = false;\n\n isErrorStyle(field:ControlGroup) {\n if (field.valid) {\n return false;\n } else {\n return true;\n }\n }\n\n constructor(fb:FormBuilder, public auth:Authentication, public router:Router) {\n this.form = fb.group({\n username: ['', Validators.compose([Validators.required, Validators.minLength(4)])],\n password: ['', Validators.required]\n });\n }\n\n onSubmit(value:any, event) {\n event.preventDefault();\n this.auth.login('POST', value.username, value.password)\n .subscribe(\n (token:any) => this.router.navigate(['Home']),\n () => {\n this.error = true;\n }\n );\n }\n}\n"]}

View File

@@ -0,0 +1,83 @@
System.register(['angular2/core', 'ng2-uploader/ng2-uploader'], 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_uploader_1;
var Page1View;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (ng2_uploader_1_1) {
ng2_uploader_1 = ng2_uploader_1_1;
}],
execute: function() {
Page1View = (function () {
function Page1View() {
this.options = {
url: 'http://192.168.99.100:8080/alfresco/service/api/upload',
withCredentials: true,
authToken: btoa('admin:admin'),
authTokenPrefix: 'Basic',
fieldName: 'filedata',
formFields: {
siteid: 'swsdp',
containerid: 'documentLibrary'
}
};
this.dropProgress = 0;
this.dropResp = [];
this.zone = new core_1.NgZone({ enableLongStackTrace: false });
}
Page1View.prototype.handleUpload = function (data) {
if (data && data.response) {
data = JSON.parse(data.response);
this.uploadFile = data;
}
};
Page1View.prototype.handleDropUpload = function (data) {
var _this = this;
var index = this.dropResp.findIndex(function (x) { return x.id === data.id; });
if (index === -1) {
this.dropResp.push(data);
}
else {
this.zone.run(function () {
_this.dropResp[index] = data;
});
}
var total = 0, uploaded = 0;
this.dropResp.forEach(function (resp) {
total += resp.progress.total;
uploaded += resp.progress.loaded;
});
this.dropProgress = Math.floor(uploaded / (total / 100));
};
Page1View = __decorate([
core_1.Component({
selector: 'page1-view',
styles: [
"\n :host .dropzone {\n width: 100%;\n height: 100px;\n background-color: #f5f5f5;\n margin-top: 2px;\n margin-bottom: 2px;\n box-shadow: inset 0 1px 2px rgba(0,0,0,.1);\n text-align: center;\n }\n "
],
template: "\n <div class=\"container\">\n <div class=\"row\">\n <h2>Upload File</h2>\n <input type=\"file\" \n [ng-file-select]=\"options\"\n (onUpload)=\"handleUpload($event)\">\n <div>\n Response: {{ uploadFile | json }}\n </div>\n </div>\n <div class=\"row\">\n <h2>Drag and Drop file demo</h2>\n <div class=\"col-md-4 col-md-offset-3\">\n <div [ng-file-drop]=\"options\" (onUpload)=\"handleDropUpload($event)\" class=\"dropzone\">\n Drop file here...\n </div>\n <div class=\"progress\">\n <div class=\"progress-bar\" [style.width]=\"dropProgress + '%'\"></div>\n <span class=\"percent\">{{ dropProgress }}%</span>\n </div>\n </div>\n </div>\n </div>\n ",
directives: [ng2_uploader_1.UPLOAD_DIRECTIVES]
}),
__metadata('design:paramtypes', [])
], Page1View);
return Page1View;
}());
exports_1("Page1View", Page1View);
}
}
});
//# sourceMappingURL=page1.view.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["components/page1.view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YA6CA;gBAkBI;oBAhBA,YAAO,GAAU;wBACb,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;oBAGF,iBAAY,GAAU,CAAC,CAAC;oBACxB,aAAQ,GAAS,EAAE,CAAC;oBAGhB,IAAI,CAAC,IAAI,GAAG,IAAI,aAAM,CAAC,EAAC,oBAAoB,EAAE,KAAK,EAAC,CAAC,CAAC;gBAC1D,CAAC;gBAED,gCAAY,GAAZ,UAAa,IAAI;oBACb,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;wBACxB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;wBACjC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;oBAC3B,CAAC;gBACL,CAAC;gBAED,oCAAgB,GAAhB,UAAiB,IAAI;oBAArB,iBAiBC;oBAhBG,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,EAAhB,CAAgB,CAAC,CAAC;oBAC3D,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;wBACf,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC7B,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;4BACV,KAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;wBAChC,CAAC,CAAC,CAAC;oBACP,CAAC;oBAED,IAAI,KAAK,GAAG,CAAC,EAAE,QAAQ,GAAG,CAAC,CAAC;oBAC5B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAA,IAAI;wBACtB,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;wBAC7B,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;oBACrC,CAAC,CAAC,CAAC;oBAEH,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC;gBAC7D,CAAC;gBAxFL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,YAAY;wBACtB,MAAM,EAAE;4BACJ,ySAUC;yBACJ;wBACD,QAAQ,EAAE,6/BAwBT;wBACD,UAAU,EAAE,CAAC,gCAAiB,CAAC;qBAClC,CAAC;;6BAAA;gBAgDF,gBAAC;YAAD,CA/CA,AA+CC,IAAA;YA/CD,iCA+CC,CAAA","file":"page1.view.js","sourcesContent":["import {Component, NgZone} from 'angular2/core';\nimport {UPLOAD_DIRECTIVES} from 'ng2-uploader/ng2-uploader';\n\n@Component({\n selector: 'page1-view',\n styles: [\n `\n :host .dropzone {\n width: 100%;\n height: 100px;\n background-color: #f5f5f5;\n margin-top: 2px;\n margin-bottom: 2px;\n box-shadow: inset 0 1px 2px rgba(0,0,0,.1);\n text-align: center;\n }\n `\n ],\n template: `\n <div class=\"container\">\n <div class=\"row\">\n <h2>Upload File</h2>\n <input type=\"file\" \n [ng-file-select]=\"options\"\n (onUpload)=\"handleUpload($event)\">\n <div>\n Response: {{ uploadFile | json }}\n </div>\n </div>\n <div class=\"row\">\n <h2>Drag and Drop file demo</h2>\n <div class=\"col-md-4 col-md-offset-3\">\n <div [ng-file-drop]=\"options\" (onUpload)=\"handleDropUpload($event)\" class=\"dropzone\">\n Drop file here...\n </div>\n <div class=\"progress\">\n <div class=\"progress-bar\" [style.width]=\"dropProgress + '%'\"></div>\n <span class=\"percent\">{{ dropProgress }}%</span>\n </div>\n </div>\n </div>\n </div>\n `,\n directives: [UPLOAD_DIRECTIVES]\n})\nexport class Page1View {\n uploadFile:any;\n options:Object = {\n url: 'http://192.168.99.100:8080/alfresco/service/api/upload',\n withCredentials: true,\n authToken: btoa('admin:admin'),\n authTokenPrefix: 'Basic',\n fieldName: 'filedata',\n formFields: {\n siteid: 'swsdp',\n containerid: 'documentLibrary'\n }\n };\n\n zone:NgZone;\n dropProgress:number = 0;\n dropResp:any[] = [];\n\n constructor() {\n this.zone = new NgZone({enableLongStackTrace: false});\n }\n\n handleUpload(data):void {\n if (data && data.response) {\n data = JSON.parse(data.response);\n this.uploadFile = data;\n }\n }\n\n handleDropUpload(data):void {\n let index = this.dropResp.findIndex(x => x.id === data.id);\n if (index === -1) {\n this.dropResp.push(data);\n } else {\n this.zone.run(() => {\n this.dropResp[index] = data;\n });\n }\n\n let total = 0, uploaded = 0;\n this.dropResp.forEach(resp => {\n total += resp.progress.total;\n uploaded += resp.progress.loaded;\n });\n\n this.dropProgress = Math.floor(uploaded / (total / 100));\n }\n}\n"]}

View File

@@ -0,0 +1,42 @@
System.register(['angular2/core', 'ng2-alfresco/components'], 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, components_1;
var Page2View;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (components_1_1) {
components_1 = components_1_1;
}],
execute: function() {
Page2View = (function () {
function Page2View() {
}
Page2View = __decorate([
core_1.Component({
selector: 'page2-view',
template: "\n <div class=\"container\">\n <div class=\"row\">\n <h2>Page 2</h2>\n <hello-world></hello-world>\n </div>\n </div>\n ",
directives: [components_1.HelloWorld]
}),
__metadata('design:paramtypes', [])
], Page2View);
return Page2View;
}());
exports_1("Page2View", Page2View);
}
}
});
//# sourceMappingURL=page2.view.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["components/page2.view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YAeA;gBAAA;gBAEA,CAAC;gBAdD;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,YAAY;wBACtB,QAAQ,EAAE,8LAOT;wBACD,UAAU,EAAE,CAAC,uBAAU,CAAC;qBAC3B,CAAC;;6BAAA;gBAGF,gBAAC;YAAD,CAFA,AAEC,IAAA;YAFD,iCAEC,CAAA","file":"page2.view.js","sourcesContent":["import {Component} from 'angular2/core';\nimport {HelloWorld} from 'ng2-alfresco/components';\n\n@Component({\n selector: 'page2-view',\n template: `\n <div class=\"container\">\n <div class=\"row\">\n <h2>Page 2</h2>\n <hello-world></hello-world>\n </div>\n </div>\n `,\n directives: [HelloWorld]\n})\nexport class Page2View {\n\n}\n"]}

36
demo-shell-ng2/dist/app/app/main.js vendored Normal file
View File

@@ -0,0 +1,36 @@
System.register(['angular2/platform/browser', './app.component', 'angular2/router', 'angular2/http', './services/authentication', 'ng2-alfresco/components'], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var browser_1, app_component_1, router_1, http_1, authentication_1, components_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 (router_1_1) {
router_1 = router_1_1;
},
function (http_1_1) {
http_1 = http_1_1;
},
function (authentication_1_1) {
authentication_1 = authentication_1_1;
},
function (components_1_1) {
components_1 = components_1_1;
}],
execute: function() {
browser_1.bootstrap(app_component_1.AppComponent, [
router_1.ROUTER_PROVIDERS,
http_1.HTTP_PROVIDERS,
authentication_1.Authentication,
components_1.ALFRESCO_PROVIDERS
]);
}
}
});
//# sourceMappingURL=main.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;YAOA,mBAAS,CAAC,4BAAY,EAAE;gBACpB,yBAAgB;gBAChB,qBAAc;gBACd,+BAAc;gBACd,+BAAkB;aACrB,CAAC,CAAC","file":"main.js","sourcesContent":["import {bootstrap} from 'angular2/platform/browser';\nimport {AppComponent} from './app.component';\nimport {ROUTER_PROVIDERS} from 'angular2/router';\nimport {HTTP_PROVIDERS} from 'angular2/http';\nimport {Authentication} from './services/authentication';\nimport {ALFRESCO_PROVIDERS} from 'ng2-alfresco/components';\n\nbootstrap(AppComponent, [\n ROUTER_PROVIDERS,\n HTTP_PROVIDERS,\n Authentication,\n ALFRESCO_PROVIDERS\n]);\n"]}

View File

@@ -0,0 +1,100 @@
System.register(['angular2/core', 'rxjs/Rx', 'angular2/http'], 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, Rx_1, http_1;
var Authentication;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (Rx_1_1) {
Rx_1 = Rx_1_1;
},
function (http_1_1) {
http_1 = http_1_1;
}],
execute: function() {
Authentication = (function () {
function Authentication(http) {
this.http = http;
this._host = 'http://192.168.99.100:8080';
this._baseUrl = this._host + '/alfresco/service/api/';
this.token = localStorage.getItem('token');
}
Authentication.prototype.isLoggedIn = function () {
return !!localStorage.getItem('token');
};
Authentication.prototype.login = function (method, username, password) {
if (method === 'GET') {
return this.loginGet(username, password);
}
else {
return this.loginPost(username, password);
}
};
Authentication.prototype.loginGet = function (username, password) {
var _this = this;
var searchParams = new http_1.URLSearchParams();
searchParams.set('u', username);
searchParams.set('pw', password);
return this.http.get(this._baseUrl + 'login', { search: searchParams })
.map(function (res) {
var data = JSON.parse(xml2json(res.text(), ' '));
_this.token = data.ticket;
_this.saveJwt(_this.token);
})
.catch(this.handleError);
};
Authentication.prototype.loginPost = function (username, password) {
var _this = this;
var credentials = '{ username: ' + username + ', password: ' + password + ' }';
var headers = new http_1.Headers();
headers.append('Content-Type', 'application/json');
return this.http.post(this._baseUrl + 'login', credentials, {
headers: headers
})
.map(function (res) {
var response = res.json();
_this.token = response.data.ticket;
_this.saveJwt(_this.token);
})
.catch(this.handleError);
};
Authentication.prototype.saveJwt = function (jwt) {
if (jwt) {
localStorage.setItem('token', jwt);
}
};
Authentication.prototype.logout = function () {
this.token = undefined;
localStorage.removeItem('token');
return Rx_1.Observable.of(true);
};
Authentication.prototype.handleError = function (error) {
// in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console
console.error(error);
return Rx_1.Observable.throw(error.json().error || 'Server error');
};
Authentication = __decorate([
core_1.Injectable(),
__metadata('design:paramtypes', [http_1.Http])
], Authentication);
return Authentication;
}());
exports_1("Authentication", Authentication);
}
}
});
//# sourceMappingURL=authentication.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["services/authentication.ts"],"names":[],"mappings":"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","file":"authentication.js","sourcesContent":["import {Injectable} from 'angular2/core';\nimport {Observable} from 'rxjs/Rx';\nimport {Http, Headers, URLSearchParams, Response} from 'angular2/http';\n\ndeclare var xml2json:any;\n\n@Injectable()\nexport class Authentication {\n token:string;\n\n private _host:string = 'http://192.168.99.100:8080';\n private _baseUrl:string = this._host + '/alfresco/service/api/';\n\n constructor(public http:Http) {\n this.token = localStorage.getItem('token');\n }\n\n isLoggedIn() {\n return !!localStorage.getItem('token');\n }\n\n login(method:string, username:string, password:string) {\n if (method === 'GET') {\n return this.loginGet(username, password);\n } else {\n return this.loginPost(username, password);\n }\n }\n\n loginGet(username:string, password:string) {\n const searchParams = new URLSearchParams();\n searchParams.set('u', username);\n searchParams.set('pw', password);\n\n return this.http.get(this._baseUrl + 'login', {search: searchParams})\n .map((res:any) => {\n let data = JSON.parse(xml2json(res.text(), ' '));\n this.token = data.ticket;\n this.saveJwt(this.token);\n })\n .catch(this.handleError);\n }\n\n loginPost(username:string, password:string) {\n let credentials = '{ username: ' + username + ', password: ' + password + ' }';\n\n let headers = new Headers();\n headers.append('Content-Type', 'application/json');\n\n return this.http.post(this._baseUrl + 'login', credentials, {\n headers: headers\n })\n .map((res:any) => {\n let response = res.json();\n this.token = response.data.ticket;\n this.saveJwt(this.token);\n })\n .catch(this.handleError);\n }\n\n saveJwt(jwt) {\n if (jwt) {\n localStorage.setItem('token', jwt);\n }\n }\n\n logout() {\n this.token = undefined;\n localStorage.removeItem('token');\n\n return Observable.of(true);\n }\n\n private handleError(error:Response) {\n // in a real world app, we may send the error to some remote logging infrastructure\n // instead of just logging it to the console\n console.error(error);\n return Observable.throw(error.json().error || 'Server error');\n }\n}\n"]}

View File

@@ -0,0 +1,66 @@
System.register(['angular2/core', 'angular2/router', '../services/authentication'], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
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 __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var core_1, router_1, authentication_1;
var AuthRouterOutlet;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (router_1_1) {
router_1 = router_1_1;
},
function (authentication_1_1) {
authentication_1 = authentication_1_1;
}],
execute: function() {
AuthRouterOutlet = (function (_super) {
__extends(AuthRouterOutlet, _super);
function AuthRouterOutlet(_elementRef, _loader, _parentRouter, nameAttr, authentication) {
_super.call(this, _elementRef, _loader, _parentRouter, nameAttr);
this.authentication = authentication;
this.router = _parentRouter;
this.publicRoutes = [
'', 'login', 'signup'
];
}
AuthRouterOutlet.prototype.activate = function (instruction) {
if (this._canActivate(instruction.urlPath)) {
return _super.prototype.activate.call(this, instruction);
}
this.router.navigate(['Login']);
};
AuthRouterOutlet.prototype._canActivate = function (url) {
return this.publicRoutes.indexOf(url) !== -1
|| this.authentication.isLoggedIn();
};
AuthRouterOutlet = __decorate([
core_1.Directive({ selector: 'auth-router-outlet' }),
__param(3, core_1.Attribute('name')),
__metadata('design:paramtypes', [core_1.ElementRef, core_1.DynamicComponentLoader, router_1.Router, String, authentication_1.Authentication])
], AuthRouterOutlet);
return AuthRouterOutlet;
}(router_1.RouterOutlet));
exports_1("AuthRouterOutlet", AuthRouterOutlet);
}
}
});
//# sourceMappingURL=AuthRouterOutlet.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"AuthRouterOutlet.js","sourceRoot":"","sources":["AuthRouterOutlet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKA;gBAAsC,oCAAY;gBAK9C,0BACI,WAAuB,EAAE,OAA+B,EACxD,aAAqB,EAAqB,QAAgB,EAClD,cAA8B;oBAEtC,kBAAM,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;oBAF7C,mBAAc,GAAd,cAAc,CAAgB;oBAItC,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;oBAC5B,IAAI,CAAC,YAAY,GAAG;wBAChB,EAAE,EAAE,OAAO,EAAE,QAAQ;qBACxB,CAAC;gBACN,CAAC;gBAED,mCAAQ,GAAR,UAAS,WAAiC;oBACtC,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;wBACzC,MAAM,CAAC,gBAAK,CAAC,QAAQ,YAAC,WAAW,CAAC,CAAC;oBACvC,CAAC;oBAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBACpC,CAAC;gBAED,uCAAY,GAAZ,UAAa,GAAG;oBACZ,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;2BACrC,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;gBAC5C,CAAC;gBA9BL;oBAAC,gBAAS,CAAC,EAAC,QAAQ,EAAE,oBAAoB,EAAC,CAAC;+BAQZ,gBAAS,CAAC,MAAM,CAAC;;oCARL;gBA+B5C,uBAAC;YAAD,CAAC,AA9BD,CAAsC,qBAAY,GA8BjD;YA9BD,+CA8BC,CAAA"}

View File

@@ -0,0 +1,61 @@
System.register(['angular2/core', 'angular2/http', 'rxjs/Observable'], 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, http_1, Observable_1;
var AlfrescoService;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (http_1_1) {
http_1 = http_1_1;
},
function (Observable_1_1) {
Observable_1 = Observable_1_1;
}],
execute: function() {
AlfrescoService = (function () {
function AlfrescoService(http) {
this.http = http;
this._host = 'http://192.168.99.100:8080';
this._baseUrl = this._host + '/alfresco/service/slingshot/doclib/doclist/all/site/';
}
AlfrescoService.prototype.getFolder = function (folder) {
var headers = new http_1.Headers({
'Content-Type': 'application/json',
'Authorization': 'Basic ' + btoa('admin:admin')
});
var options = new http_1.RequestOptions({ headers: headers });
return this.http
.get(this._baseUrl + folder, options)
.map(function (res) { return res.json(); })
.do(function (data) { return console.log(data); }) // eyeball results in the console
.catch(this.handleError);
};
AlfrescoService.prototype.handleError = function (error) {
// in a real world app, we may send the error to some remote logging infrastructure
// instead of just logging it to the console
console.error(error);
return Observable_1.Observable.throw(error.json().error || 'Server error');
};
AlfrescoService = __decorate([
core_1.Injectable(),
__metadata('design:paramtypes', [http_1.Http])
], AlfrescoService);
return AlfrescoService;
}());
exports_1("AlfrescoService", AlfrescoService);
}
}
});
//# sourceMappingURL=alfresco.service.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"alfresco.service.js","sourceRoot":"","sources":["alfresco.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;YAMA;gBACI,yBAAoB,IAAU;oBAAV,SAAI,GAAJ,IAAI,CAAM;oBAEtB,UAAK,GAAW,4BAA4B,CAAC;oBAC7C,aAAQ,GAAW,IAAI,CAAC,KAAK,GAAG,sDAAsD,CAAC;gBAH9D,CAAC;gBAKlC,mCAAS,GAAT,UAAU,MAAc;oBACpB,IAAI,OAAO,GAAG,IAAI,cAAO,CAAC;wBACtB,cAAc,EAAE,kBAAkB;wBAClC,eAAe,EAAE,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC;qBAClD,CAAC,CAAC;oBACH,IAAI,OAAO,GAAG,IAAI,qBAAc,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;oBACvD,MAAM,CAAC,IAAI,CAAC,IAAI;yBACX,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,MAAM,EAAE,OAAO,CAAC;yBACpC,GAAG,CAAC,UAAA,GAAG,IAAI,OAAe,GAAG,CAAC,IAAI,EAAE,EAAzB,CAAyB,CAAC;yBACrC,EAAE,CAAC,UAAA,IAAI,IAAI,OAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAjB,CAAiB,CAAC,CAAC,iCAAiC;yBAC/D,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACjC,CAAC;gBAEO,qCAAW,GAAnB,UAAqB,KAAe;oBAChC,mFAAmF;oBACnF,4CAA4C;oBAC5C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACrB,MAAM,CAAC,uBAAU,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,cAAc,CAAC,CAAC;gBAClE,CAAC;gBAzBL;oBAAC,iBAAU,EAAE;;mCAAA;gBA0Bb,sBAAC;YAAD,CAAC,AAzBD,IAyBC;YAzBD,6CAyBC,CAAA"}

View File

@@ -0,0 +1,65 @@
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 SideMenu;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
}],
execute: function() {
SideMenu = (function () {
function SideMenu(el) {
this.el = el;
this.title = '';
this.direction = 'left';
this.isOpen = false;
}
SideMenu.prototype.onClick = function (event) {
event.preventDefault();
event.stopPropagation();
};
SideMenu.prototype.toggle = function () {
this.isOpen = !this.isOpen;
};
SideMenu.prototype.open = function () {
this.isOpen = true;
};
SideMenu.prototype.close = function () {
this.isOpen = false;
};
__decorate([
core_1.Input(),
__metadata('design:type', String)
], SideMenu.prototype, "title", void 0);
__decorate([
core_1.Input(),
__metadata('design:type', String)
], SideMenu.prototype, "direction", void 0);
SideMenu = __decorate([
core_1.Component({
selector: 'side-menu',
host: {
'(click)': 'onClick($event)',
},
template: "\n <nav class=\"cbp-spmenu cbp-spmenu-vertical cbp-spmenu-{{direction}} inline-menu\" \n [ngClass]=\"{ 'cbp-spmenu-open': isOpen }\">\n <h3>\n {{title}}\n <a href=\"#\" class=\"menu-close pull-right\" (click)=\"close()\">\n <i class=\"glyphicon glyphicon-remove\"></i>\n </a>\n </h3>\n <ng-content></ng-content>\n </nav>\n "
}),
__metadata('design:paramtypes', [core_1.ElementRef])
], SideMenu);
return SideMenu;
}());
exports_1("SideMenu", SideMenu);
}
}
});
//# sourceMappingURL=SideMenu.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"SideMenu.js","sourceRoot":"","sources":["SideMenu.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;YAqBA;gBAKI,kBAAoB,EAAc;oBAAd,OAAE,GAAF,EAAE,CAAY;oBAJzB,UAAK,GAAW,EAAE,CAAC;oBACnB,cAAS,GAAW,MAAM,CAAC;oBACpC,WAAM,GAAY,KAAK,CAAC;gBAIxB,CAAC;gBAED,0BAAO,GAAP,UAAQ,KAAK;oBACT,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,KAAK,CAAC,eAAe,EAAE,CAAC;gBAC5B,CAAC;gBAED,yBAAM,GAAN;oBACI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;gBAC/B,CAAC;gBAED,uBAAI,GAAJ;oBACI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;gBACvB,CAAC;gBAED,wBAAK,GAAL;oBACI,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;gBACxB,CAAC;gBAvBD;oBAAC,YAAK,EAAE;;uDAAA;gBACR;oBAAC,YAAK,EAAE;;2DAAA;gBArBZ;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,WAAW;wBACrB,IAAI,EAAE;4BACF,SAAS,EAAE,iBAAiB;yBAE/B;wBACD,QAAQ,EAAE,kcAWT;qBACJ,CAAC;;4BAAA;gBA0BF,eAAC;YAAD,CAAC,AAzBD,IAyBC;YAzBD,+BAyBC,CAAA"}

View File

@@ -0,0 +1,17 @@
System.register([], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var DocumentEntity;
return {
setters:[],
execute: function() {
DocumentEntity = (function () {
function DocumentEntity() {
}
return DocumentEntity;
}());
exports_1("DocumentEntity", DocumentEntity);
}
}
});
//# sourceMappingURL=document.entity.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"document.entity.js","sourceRoot":"","sources":["document.entity.ts"],"names":[],"mappings":";;;;;;;YAGA;gBAAA;gBA6BA,CAAC;gBAAD,qBAAC;YAAD,CAAC,AA7BD,IA6BC;YA7BD,2CA6BC,CAAA"}

View File

@@ -0,0 +1,18 @@
System.register([], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var FolderEntity;
return {
setters:[],
execute: function() {
// contains only limited subset of available fields
FolderEntity = (function () {
function FolderEntity() {
}
return FolderEntity;
}());
exports_1("FolderEntity", FolderEntity);
}
}
});
//# sourceMappingURL=folder.entity.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"folder.entity.js","sourceRoot":"","sources":["folder.entity.ts"],"names":[],"mappings":";;;;;;;YAEA,mDAAmD;YACnD;gBAAA;gBAEA,CAAC;gBAAD,mBAAC;YAAD,CAAC,AAFD,IAEC;YAFD,uCAEC,CAAA"}

View File

@@ -0,0 +1,24 @@
System.register([], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var LocationEntity, LocationParentEntity;
return {
setters:[],
execute: function() {
// contains only limited subset of available fields
LocationEntity = (function () {
function LocationEntity() {
}
return LocationEntity;
}());
exports_1("LocationEntity", LocationEntity);
LocationParentEntity = (function () {
function LocationParentEntity() {
}
return LocationParentEntity;
}());
exports_1("LocationParentEntity", LocationParentEntity);
}
}
});
//# sourceMappingURL=location.entity.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"location.entity.js","sourceRoot":"","sources":["location.entity.ts"],"names":[],"mappings":";;;;;;;YAAA,mDAAmD;YACnD;gBAAA;gBAQA,CAAC;gBAAD,qBAAC;YAAD,CAAC,AARD,IAQC;YARD,2CAQC,CAAA;YAED;gBAAA;gBAEA,CAAC;gBAAD,2BAAC;YAAD,CAAC,AAFD,IAEC;YAFD,uDAEC,CAAA"}

View File

@@ -0,0 +1,40 @@
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 AppNavBar;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
}],
execute: function() {
AppNavBar = (function () {
function AppNavBar() {
}
AppNavBar = __decorate([
core_1.Component({
selector: 'app-navbar',
template: "\n <nav class=\"navbar navbar-default navbar-fixed-top\">\n <div class=\"container-fluid\">\n <ng-content></ng-content>\n </div>\n </nav>\n ",
styles: [
"\n :host .image-button {\n padding-bottom: 10px;\n padding-top: 12px;\n max-height: 50px;\n }\n "
]
}),
__metadata('design:paramtypes', [])
], AppNavBar);
return AppNavBar;
}());
exports_1("AppNavBar", AppNavBar);
}
}
});
//# sourceMappingURL=navbar.component.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"navbar.component.js","sourceRoot":"","sources":["navbar.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;YAqBA;gBAAA;gBAEA,CAAC;gBArBD;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,YAAY;wBACtB,QAAQ,EAAE,oMAMT;wBACD,MAAM,EAAE;4BACJ,wJAMC;yBACJ;qBACJ,CAAC;;6BAAA;gBAGF,gBAAC;YAAD,CAAC,AAFD,IAEC;YAFD,iCAEC,CAAA"}

View File

@@ -0,0 +1,71 @@
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 Tabs, Tab;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
}],
execute: function() {
Tabs = (function () {
function Tabs() {
this.tabs = [];
}
Tabs.prototype.selectTab = function (tab, $event) {
this.tabs.forEach(function (tab) {
tab.active = false;
});
tab.active = true;
if ($event) {
$event.preventDefault();
}
};
Tabs.prototype.addTab = function (tab) {
if (this.tabs.length === 0) {
tab.active = true;
}
this.tabs.push(tab);
};
Tabs = __decorate([
core_1.Component({
selector: 'tabs',
template: "\n <ul class=\"nav nav-tabs\">\n <li *ngFor=\"#tab of tabs\" (click)=\"selectTab(tab, $event)\" [class.active]=\"tab.active\">\n <a href=\"#\">{{tab.title}}</a>\n </li>\n </ul>\n <ng-content></ng-content>\n "
}),
__metadata('design:paramtypes', [])
], Tabs);
return Tabs;
}());
exports_1("Tabs", Tabs);
Tab = (function () {
function Tab(tabs) {
tabs.addTab(this);
}
__decorate([
core_1.Input('tabTitle'),
__metadata('design:type', Object)
], Tab.prototype, "title", void 0);
Tab = __decorate([
core_1.Component({
selector: 'tab',
template: "\n <div [hidden]=\"!active\">\n <ng-content></ng-content>\n </div>\n "
}),
__metadata('design:paramtypes', [Tabs])
], Tab);
return Tab;
}());
exports_1("Tab", Tab);
}
}
});
//# sourceMappingURL=tabs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["tabs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;YAaA;gBAAA;oBACI,SAAI,GAAU,EAAE,CAAC;gBAkBrB,CAAC;gBAhBG,wBAAS,GAAT,UAAU,GAAO,EAAE,MAAM;oBACrB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;wBACjB,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC;oBACvB,CAAC,CAAC,CAAC;oBACH,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC;oBAClB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;wBACT,MAAM,CAAC,cAAc,EAAE,CAAC;oBAC5B,CAAC;gBACL,CAAC;gBAED,qBAAM,GAAN,UAAO,GAAO;oBACV,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;wBACzB,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC;oBACtB,CAAC;oBACD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACxB,CAAC;gBA7BL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,MAAM;wBAChB,QAAQ,EAAE,8QAOT;qBACJ,CAAC;;wBAAA;gBAoBF,WAAC;YAAD,CAAC,AAnBD,IAmBC;YAnBD,uBAmBC,CAAA;YAWD;gBAII,aAAY,IAAU;oBAClB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACtB,CAAC;gBALD;oBAAC,YAAK,CAAC,UAAU,CAAC;;kDAAA;gBATtB;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,KAAK;wBACf,QAAQ,EAAE,mGAIT;qBACJ,CAAC;;uBAAA;gBAQF,UAAC;YAAD,CAAC,AAPD,IAOC;YAPD,qBAOC,CAAA"}

View File

@@ -0,0 +1,95 @@
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) {
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, alfresco_service_1;
var DocumentList;
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() {
DocumentList = (function () {
function DocumentList(_alfrescoService) {
this._alfrescoService = _alfrescoService;
// example: <alfresco-document-list [navigate]="false"></alfresco-document-list>
this.navigate = true;
this.rootFolderPath = 'swsdp/documentLibrary';
this.currentFolderPath = 'swsdp/documentLibrary';
this.route = [];
}
DocumentList.prototype.canNavigateParent = function () {
return this.currentFolderPath !== this.rootFolderPath;
};
DocumentList.prototype.ngOnInit = function () {
this.route.push(this.rootFolderPath);
this.displayFolderContent(this.rootFolderPath);
};
DocumentList.prototype.displayFolderContent = function (path) {
var _this = this;
this.currentFolderPath = path;
this._alfrescoService
.getFolder(path)
.subscribe(function (folder) { return _this.folder = folder; }, function (error) { return _this.errorMessage = error; });
};
DocumentList.prototype.onNavigateParentClick = function ($event) {
if ($event) {
$event.preventDefault();
}
if (this.navigate) {
this.route.pop();
var parent = this.route.length > 0 ? this.route[this.route.length - 1] : this.rootFolderPath;
if (parent) {
this.displayFolderContent(parent);
}
}
};
DocumentList.prototype.onItemClick = function (item, $event) {
if ($event) {
$event.preventDefault();
}
if (this.navigate && item) {
if (item.isFolder) {
var path = this.getItemPath(item);
this.route.push(path);
this.displayFolderContent(path);
}
}
};
DocumentList.prototype.getItemPath = function (item) {
var container = item.location.container;
var path = item.location.path !== '/' ? (item.location.path + '/') : '/';
var relativePath = container + path + item.fileName;
return item.location.site + '/' + relativePath;
};
__decorate([
core_1.Input(),
__metadata('design:type', Boolean)
], DocumentList.prototype, "navigate", void 0);
DocumentList = __decorate([
core_1.Component({
selector: 'alfresco-document-list',
template: "\n <div *ngIf=\"folder\" class=\"list-group\">\n <a href=\"#\" *ngIf=\"canNavigateParent()\" (click)=\"onNavigateParentClick($event)\" class=\"list-group-item\">\n <i class=\"fa fa-level-up\"></i> ...\n </a>\n <a href=\"#\" *ngFor=\"#document of folder.items\" (click)=\"onItemClick(document, $event)\" class=\"list-group-item\">\n <i *ngIf=\"document.isFolder\" class=\"fa fa-folder-o\"></i>\n {{document.displayName}}\n </a>\n </div>\n ",
providers: [alfresco_service_1.AlfrescoService]
}),
__metadata('design:paramtypes', [alfresco_service_1.AlfrescoService])
], DocumentList);
return DocumentList;
}());
exports_1("DocumentList", DocumentList);
}
}
});
//# sourceMappingURL=document-list.component.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"document-list.component.js","sourceRoot":"","sources":["document-list.component.ts"],"names":[],"mappings":"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"}

View File

@@ -0,0 +1,113 @@
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 FormDesignSurface;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
}],
execute: function() {
FormDesignSurface = (function () {
function FormDesignSurface(elementRef) {
this.elementRef = elementRef;
//el.nativeElement.style.backgroundColor = 'yellow';
}
Object.defineProperty(FormDesignSurface.prototype, "selectedWidget", {
get: function () {
return this._selectedWidget;
},
set: function (val) {
if (this.selectedWidget && this.selectedWidget != val) {
this._selectedWidget.classList.remove('selected');
}
this._selectedWidget = val;
if (this._selectedWidget) {
this._selectedWidget.classList.add('selected');
}
},
enumerable: true,
configurable: true
});
FormDesignSurface.prototype.ngOnInit = function () {
// Create root container
var container = widgets.container.create();
container.dataset.widgetType = 'container';
this.setupWidget(container);
this.elementRef.nativeElement.appendChild(container);
};
FormDesignSurface.prototype.setupWidget = function (widget) {
// initialize all drop placeholders
var dropPlaceholders = widget.querySelectorAll('.drop-zone');
for (var i = 0; i < dropPlaceholders.length; i++) {
var placeholder = dropPlaceholders[i];
var z = new dropZone({
element: placeholder,
onDrop: this.onWidgetDrop.bind(this)
});
}
// initialize clicks
if (widget.dataset['widgetId']) {
widget.addEventListener('mouseup', this.onWidgetMouseUp.bind(this), false);
}
// wire child element clicks
var nested = widget.querySelectorAll('[data-widget-id]');
for (var x = 0; x < nested.length; x++) {
nested[x].addEventListener('mouseup', this.onWidgetMouseUp.bind(this), false);
}
};
FormDesignSurface.prototype.onWidgetMouseUp = function (e) {
var wid = e.currentTarget.dataset.widgetId;
if (wid) {
console.log('Selected Widget Id: ' + wid);
this.selectedWidget = e.currentTarget;
e.stopPropagation();
}
};
FormDesignSurface.prototype.onWidgetDrop = function (dz, opts) {
var widgetType = opts.widgetType;
if (widgetType) {
var component = widgets[widgetType];
if (component) {
var widget = component.create();
if (widget) {
widget.dataset.widgetType = widgetType;
this.setupWidget(widget);
// insert widget before drop zone
var container = dz.parentElement;
container.insertBefore(widget, dz);
// create new drop zone
var zone = new dropZone({
onDrop: this.onWidgetDrop.bind(this),
minHeight: '5px'
});
// insert new drop zone before widget
container.insertBefore(zone.element, widget);
}
}
}
};
FormDesignSurface = __decorate([
core_1.Component({
selector: 'form-design-surface',
template: '<div></div>'
}),
__metadata('design:paramtypes', [core_1.ElementRef])
], FormDesignSurface);
return FormDesignSurface;
}());
exports_1("FormDesignSurface", FormDesignSurface);
}
}
});
//# sourceMappingURL=form-design-surface.component.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"form-design-surface.component.js","sourceRoot":"","sources":["form-design-surface.component.ts"],"names":[],"mappings":"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"}

View File

@@ -0,0 +1,66 @@
System.register(["angular2/core", "../services/form-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) {
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, form_service_1;
var FormDesignToolbar;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (form_service_1_1) {
form_service_1 = form_service_1_1;
}],
execute: function() {
FormDesignToolbar = (function () {
function FormDesignToolbar(_formService) {
this._formService = _formService;
}
FormDesignToolbar.prototype.ngOnInit = function () {
this.categories = this._formService.getWidgetCategories();
// Stores drag ghost elements
this.dragCache = document.getElementById('drag-images-cache');
};
FormDesignToolbar.prototype.onElementDragStart = function (e) {
e.dataTransfer.effectAllowed = 'move';
var widgetType = e.target.dataset.widgetType;
var payload = { "widgetType": widgetType };
e.dataTransfer.setData('text', JSON.stringify(payload));
//var dragImage = getDragImage(widgetType);
var dragImage = this._formService.getDragImage(widgetType);
this.dragCache.appendChild(dragImage);
//e.dataTransfer.setDragImage(dragImage, dragImage.offsetWidth / 2, 0);
e.dataTransfer.setDragImage(dragImage, 0, 0);
e.stopPropagation();
};
FormDesignToolbar.prototype.onElementDragEnd = function (e) {
if (this.dragCache) {
this.dragCache.innerHTML = '';
}
};
FormDesignToolbar = __decorate([
core_1.Component({
selector: 'form-design-toolbar',
providers: [form_service_1.FormService],
//encapsulation: ViewEncapsulation.Native,
styles: ["\n .category-header {\n color: #555;\n padding: 11px;\n margin: 0;\n background: #e7e7e7;\n cursor: default;\n font-size: 14px;\n font-weight: bold;\n }\n \n a.toolbar-item {\n cursor: move;\n \n display: block;\n color: #777;\n font-size: 1.1em;\n font-weight: 300;\n text-decoration: none;\n \n border-bottom: 1px solid #e7e7e7;\n padding: 1em;\n }\n \n a.toolbar-item:hover {\n color: #555;\n background: #f8f8f8;\n }\n \n a.toolbar-item:active, a.toolbar-item.active {\n color: #fff;\n border-color: #428bca;\n background-color: #428bca;\n }\n "],
template: "\n <template ngFor #category [ngForOf]=\"categories\">\n <h3 class=\"category-header\">{{category.name}}</h3>\n <a *ngFor=\"#widget of category.widgets\" class=\"toolbar-item\" attr.data-widget-type=\"{{widget.type}}\" draggable=\"true\"\n (dragstart)=\"onElementDragStart($event)\" (dragend)=\"onElementDragEnd($event)\">\n <i class=\"{{widget.iconClass || 'fa fa-puzzle-piece'}}\"></i> {{widget.name}}\n </a>\n </template>\n "
}),
__metadata('design:paramtypes', [form_service_1.FormService])
], FormDesignToolbar);
return FormDesignToolbar;
}());
exports_1("FormDesignToolbar", FormDesignToolbar);
}
}
});
//# sourceMappingURL=form-design-toolbar.component.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"form-design-toolbar.component.js","sourceRoot":"","sources":["form-design-toolbar.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YAoDA;gBAKI,2BACY,YAAyB;oBAAzB,iBAAY,GAAZ,YAAY,CAAa;gBAClC,CAAC;gBAEJ,oCAAQ,GAAR;oBACI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC;oBAC1D,6BAA6B;oBAC7B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;gBAClE,CAAC;gBAED,8CAAkB,GAAlB,UAAmB,CAAC;oBAChB,CAAC,CAAC,YAAY,CAAC,aAAa,GAAG,MAAM,CAAC;oBAEtC,IAAI,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC;oBAE7C,IAAI,OAAO,GAAG,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;oBAC3C,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;oBAExD,2CAA2C;oBAC3C,IAAI,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;oBAC3D,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;oBACtC,uEAAuE;oBACvE,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;oBAE7C,CAAC,CAAC,eAAe,EAAE,CAAC;gBACxB,CAAC;gBAED,4CAAgB,GAAhB,UAAiB,CAAC;oBACd,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;wBACjB,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,EAAE,CAAC;oBAClC,CAAC;gBACL,CAAC;gBArFL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,qBAAqB;wBAC/B,SAAS,EAAE,CAAC,0BAAW,CAAC;wBACxB,0CAA0C;wBAC1C,MAAM,EAAE,CAAC,w2BAkCR,CAAC;wBACF,QAAQ,EAAE,4fAQT;qBACJ,CAAC;;qCAAA;gBAuCF,wBAAC;YAAD,CAAC,AAtCD,IAsCC;YAtCD,iDAsCC,CAAA"}

View File

@@ -0,0 +1,41 @@
System.register(['angular2/core', "./form-design-surface.component"], 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, form_design_surface_component_1;
var FormsView;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (form_design_surface_component_1_1) {
form_design_surface_component_1 = form_design_surface_component_1_1;
}],
execute: function() {
FormsView = (function () {
function FormsView() {
}
FormsView = __decorate([
core_1.Component({
selector: 'forms-view',
template: "\n <div class=\"container\" style=\"width:970px;\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <!-- Design surface -->\n <form-design-surface></form-design-surface>\n </div>\n </div>\n </div>\n ",
directives: [form_design_surface_component_1.FormDesignSurface]
}),
__metadata('design:paramtypes', [])
], FormsView);
return FormsView;
}());
exports_1("FormsView", FormsView);
}
}
});
//# sourceMappingURL=forms.view.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"forms.view.js","sourceRoot":"","sources":["forms.view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YAiBA;gBAAA;gBAKA,CAAC;gBAnBD;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,YAAY;wBACtB,QAAQ,EAAE,wTAST;wBACD,UAAU,EAAE,CAAC,iDAAiB,CAAC;qBAClC,CAAC;;6BAAA;gBAMF,gBAAC;YAAD,CAAC,AALD,IAKC;YALD,iCAKC,CAAA"}

View File

@@ -0,0 +1,38 @@
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 HomeView;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
}],
execute: function() {
HomeView = (function () {
function HomeView() {
}
HomeView = __decorate([
core_1.Component({
selector: 'home-view',
template: "\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <h1>Home View</h1>\n </div>\n </div>\n </div>\n ",
directives: []
}),
__metadata('design:paramtypes', [])
], HomeView);
return HomeView;
}());
exports_1("HomeView", HomeView);
}
}
});
//# sourceMappingURL=home.view.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"home.view.js","sourceRoot":"","sources":["home.view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;YAeA;gBAAA;gBACA,CAAC;gBAdD;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,WAAW;wBACrB,QAAQ,EAAE,2NAQT;wBACD,UAAU,EAAE,EAAE;qBACjB,CAAC;;4BAAA;gBAEF,eAAC;YAAD,CAAC,AADD,IACC;YADD,+BACC,CAAA"}

View File

@@ -0,0 +1,62 @@
System.register(["angular2/core", "angular2/router", "angular2/common", "../services/authentication"], 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, router_1, common_1, authentication_1;
var Login;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (router_1_1) {
router_1 = router_1_1;
},
function (common_1_1) {
common_1 = common_1_1;
},
function (authentication_1_1) {
authentication_1 = authentication_1_1;
}],
execute: function() {
Login = (function () {
function Login(fb, auth, router) {
this.auth = auth;
this.router = router;
this.error = false;
this.form = fb.group({
username: ['', common_1.Validators.required],
password: ['', common_1.Validators.required]
});
}
Login.prototype.onSubmit = function (value, event) {
var _this = this;
//event.preventDefault();
this.auth.login(value.username, value.password)
.subscribe(
//(token: any) => this.router.navigate(['../Home']),
function (token) { return _this.router.navigate(['Home']); }, function () { _this.error = true; });
};
Login = __decorate([
core_1.Component({
selector: 'login',
directives: [router_1.ROUTER_DIRECTIVES, common_1.FORM_DIRECTIVES],
template: "\n <div class=\"row\">\n <div class=\"col-md-4 col-md-offset-4\">\n <form [ngFormModel]=\"form\" (submit)=\"onSubmit(form.value, $event)\">\n <div *ngIf=\"error\">Check your password</div>\n <div class=\"form-group\">\n <label for=\"username\">Username</label>\n <input class=\"form-control\" type=\"text\" ngControl=\"username\">\n </div>\n <div class=\"form-group\">\n <label for=\"password\">Password</label>\n <input class=\"form-control\" type=\"password\" ngControl=\"password\">\n </div>\n <button type=\"submit\" class=\"btn btn-default\" [disabled]=\"!form.valid\">Login</button>\n </form>\n </div>\n </div>\n "
}),
__metadata('design:paramtypes', [common_1.FormBuilder, authentication_1.Authentication, router_1.Router])
], Login);
return Login;
}());
exports_1("Login", Login);
}
}
});
//# sourceMappingURL=login.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"login.js","sourceRoot":"","sources":["login.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2BA;gBAII,eAAY,EAAe,EAAS,IAAoB,EAAS,MAAc;oBAA3C,SAAI,GAAJ,IAAI,CAAgB;oBAAS,WAAM,GAAN,MAAM,CAAQ;oBAF/E,UAAK,GAAY,KAAK,CAAC;oBAGnB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC;wBACjB,QAAQ,EAAG,CAAC,EAAE,EAAE,mBAAU,CAAC,QAAQ,CAAC;wBACpC,QAAQ,EAAG,CAAC,EAAE,EAAE,mBAAU,CAAC,QAAQ,CAAC;qBACvC,CAAC,CAAC;gBACP,CAAC;gBAED,wBAAQ,GAAR,UAAS,KAAU,EAAE,KAAK;oBAA1B,iBAQC;oBAPG,yBAAyB;oBACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;yBAC1C,SAAS;oBACN,oDAAoD;oBACpD,UAAC,KAAU,IAAK,OAAA,KAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,EAA9B,CAA8B,EAC9C,cAAQ,KAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAC/B,CAAC;gBACV,CAAC;gBAzCL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,OAAO;wBACjB,UAAU,EAAE,CAAC,0BAAiB,EAAE,wBAAe,CAAC;wBAChD,QAAQ,EAAE,g4BAiBT;qBACJ,CAAC;;yBAAA;gBAqBF,YAAC;YAAD,CAAC,AApBD,IAoBC;YApBD,yBAoBC,CAAA"}

View File

@@ -0,0 +1,41 @@
System.register(["angular2/core", "./document-list.component"], 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, document_list_component_1;
var Page1View;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (document_list_component_1_1) {
document_list_component_1 = document_list_component_1_1;
}],
execute: function() {
Page1View = (function () {
function Page1View() {
}
Page1View = __decorate([
core_1.Component({
selector: 'page1-view',
template: "\n <div class=\"container\">\n <div class=\"row\">\n <alfresco-document-list></alfresco-document-list>\n </div>\n </div>\n ",
directives: [document_list_component_1.DocumentList]
}),
__metadata('design:paramtypes', [])
], Page1View);
return Page1View;
}());
exports_1("Page1View", Page1View);
}
}
});
//# sourceMappingURL=page1.view.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"page1.view.js","sourceRoot":"","sources":["page1.view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YAaA;gBAAA;gBAEA,CAAC;gBAbD;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,YAAY;wBACtB,QAAQ,EAAE,mLAMT;wBACD,UAAU,EAAE,CAAC,sCAAY,CAAC;qBAC7B,CAAC;;6BAAA;gBAGF,gBAAC;YAAD,CAAC,AAFD,IAEC;YAFD,iCAEC,CAAA"}

View File

@@ -0,0 +1,38 @@
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 Page2View;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
}],
execute: function() {
Page2View = (function () {
function Page2View() {
this.username = 'Unicorn';
}
Page2View = __decorate([
core_1.Component({
selector: 'page2-view',
template: "\n <div class=\"container\">\n <div class=\"row\">\n <h1>Page 2</h1>\n <input [(ngModel)]=\"username\">\n <span>Username: {{username}}</span>\n <hello-world [text]=\"username\"></hello-world>\n <hello-world text=\"test user\"></hello-world>\n <alfresco-login (submit)=methodAngular></alfresco-login>\n </div>\n </div>\n "
}),
__metadata('design:paramtypes', [])
], Page2View);
return Page2View;
}());
exports_1("Page2View", Page2View);
}
}
});
//# sourceMappingURL=page2.view.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"page2.view.js","sourceRoot":"","sources":["page2.view.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;YAgBA;gBAAA;oBACI,aAAQ,GAAW,SAAS,CAAC;gBACjC,CAAC;gBAjBD;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,YAAY;wBACtB,QAAQ,EAAE,ocAWT;qBACJ,CAAC;;6BAAA;gBAGF,gBAAC;YAAD,CAAC,AAFD,IAEC;YAFD,iCAEC,CAAA"}

7
demo-shell-ng2/dist/app/css/app.css vendored Normal file
View File

@@ -0,0 +1,7 @@
body { padding-top: 70px; }
/* Utils */
.p-10 {
padding: 10px;
}

File diff suppressed because one or more lines are too long

BIN
demo-shell-ng2/dist/app/img/blank.gif vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

178
demo-shell-ng2/dist/app/js/xml2json.js vendored Normal file
View File

@@ -0,0 +1,178 @@
/* 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}";
}

31
demo-shell-ng2/dist/app/main.js vendored Normal file
View File

@@ -0,0 +1,31 @@
System.register(['angular2/platform/browser', './app.component', "angular2/router", 'angular2/http', "./services/authentication"], function(exports_1, context_1) {
"use strict";
var __moduleName = context_1 && context_1.id;
var browser_1, app_component_1, router_1, http_1, authentication_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 (router_1_1) {
router_1 = router_1_1;
},
function (http_1_1) {
http_1 = http_1_1;
},
function (authentication_1_1) {
authentication_1 = authentication_1_1;
}],
execute: function() {
browser_1.bootstrap(app_component_1.AppComponent, [
router_1.ROUTER_PROVIDERS,
http_1.HTTP_PROVIDERS,
authentication_1.Authentication
]);
}
}
});
//# sourceMappingURL=main.js.map

1
demo-shell-ng2/dist/app/main.js.map vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;YAMA,mBAAS,CAAC,4BAAY,EAAE;gBACpB,yBAAgB;gBAChB,qBAAc;gBACd,+BAAc;aACjB,CAAC,CAAC"}

View File

@@ -0,0 +1,54 @@
System.register(["angular2/core", 'rxjs/Rx'], 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, Rx_1;
var Authentication;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
},
function (Rx_1_1) {
Rx_1 = Rx_1_1;
}],
execute: function() {
Authentication = (function () {
function Authentication() {
this.token = localStorage.getItem('token');
}
Authentication.prototype.isLoggedIn = function () {
return !!localStorage.getItem('token');
};
Authentication.prototype.login = function (username, password) {
if (username === 'test' && password === 'test') {
this.token = 'token';
localStorage.setItem('token', this.token);
return Rx_1.Observable.of('token');
}
return Rx_1.Observable.throw('authentication failure');
};
Authentication.prototype.logout = function () {
this.token = undefined;
localStorage.removeItem('token');
return Rx_1.Observable.of(true);
};
Authentication = __decorate([
core_1.Injectable(),
__metadata('design:paramtypes', [])
], Authentication);
return Authentication;
}());
exports_1("Authentication", Authentication);
}
}
});
//# sourceMappingURL=authentication.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"authentication.js","sourceRoot":"","sources":["authentication.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;YAIA;gBAGI;oBACI,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC/C,CAAC;gBAED,mCAAU,GAAV;oBACI,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC3C,CAAC;gBAED,8BAAK,GAAL,UAAM,QAAgB,EAAE,QAAgB;oBACpC,EAAE,CAAC,CAAC,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC;wBAC7C,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;wBACrB,YAAY,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;wBAC1C,MAAM,CAAC,eAAU,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;oBAClC,CAAC;oBAED,MAAM,CAAC,eAAU,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;gBACtD,CAAC;gBAED,+BAAM,GAAN;oBACI,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;oBACvB,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;oBAEjC,MAAM,CAAC,eAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;gBAC/B,CAAC;gBA3BL;oBAAC,iBAAU,EAAE;;kCAAA;gBA4Bb,qBAAC;YAAD,CAAC,AA3BD,IA2BC;YA3BD,2CA2BC,CAAA"}

View File

@@ -0,0 +1,76 @@
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 FormService;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
}],
execute: function() {
FormService = (function () {
function FormService() {
}
FormService.prototype.getWidgetCategories = function () {
var result = [];
var categories = {};
var keys = Object.keys(widgets);
keys.forEach(function (key) {
var w = widgets[key];
var categoryName = w.category || 'Misc';
var category = categories[categoryName];
if (!category) {
category = {
name: categoryName,
widgets: []
};
categories[categoryName] = category;
}
category.widgets.push({
type: key,
name: w.name,
iconClass: w.iconClass
});
});
Object.keys(categories).sort().forEach(function (key) {
result.push(categories[key]);
});
return result;
};
FormService.prototype.getDragImage = function (widgetType) {
var w = widgets[widgetType];
// try getting exported drag image
if (w && typeof w.getDragImage === 'function') {
var img = w.getDragImage();
if (img) {
return img;
}
}
// create default drag image
var dragImage = document.createElement('button');
dragImage.className = 'btn btn-default drag-image';
dragImage.textContent = w.name;
dragImage.style.minWidth = '100px';
return dragImage;
};
FormService = __decorate([
core_1.Injectable(),
__metadata('design:paramtypes', [])
], FormService);
return FormService;
}());
exports_1("FormService", FormService);
}
}
});
//# sourceMappingURL=form-service.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"form-service.js","sourceRoot":"","sources":["form-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;YAMA;gBAAA;gBAgDA,CAAC;gBA/CG,yCAAmB,GAAnB;oBACI,IAAI,MAAM,GAAG,EAAE,CAAC;oBAChB,IAAI,UAAU,GAAG,EAAE,CAAC;oBACpB,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBAChC,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG;wBACtB,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;wBACrB,IAAI,YAAY,GAAG,CAAC,CAAC,QAAQ,IAAI,MAAM,CAAC;wBACxC,IAAI,QAAQ,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;wBACxC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;4BACZ,QAAQ,GAAG;gCACP,IAAI,EAAE,YAAY;gCAClB,OAAO,EAAE,EAAE;6BACd,CAAC;4BACF,UAAU,CAAC,YAAY,CAAC,GAAG,QAAQ,CAAC;wBAExC,CAAC;wBACD,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;4BAClB,IAAI,EAAE,GAAG;4BACT,IAAI,EAAE,CAAC,CAAC,IAAI;4BACZ,SAAS,EAAE,CAAC,CAAC,SAAS;yBACzB,CAAC,CAAC;oBACP,CAAC,CAAC,CAAC;oBAEH,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,UAAU,GAAG;wBAChD,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;oBACjC,CAAC,CAAC,CAAC;oBAEH,MAAM,CAAC,MAAM,CAAC;gBAClB,CAAC;gBAED,kCAAY,GAAZ,UAAa,UAAkB;oBAC3B,IAAI,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;oBAC5B,kCAAkC;oBAClC,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,YAAY,KAAK,UAAU,CAAC,CAAC,CAAC;wBAC5C,IAAI,GAAG,GAAI,CAAC,CAAC,YAAY,EAAE,CAAC;wBAC5B,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;4BACN,MAAM,CAAC,GAAG,CAAC;wBACf,CAAC;oBACL,CAAC;oBAED,4BAA4B;oBAC5B,IAAI,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;oBACjD,SAAS,CAAC,SAAS,GAAG,4BAA4B,CAAC;oBACnD,SAAS,CAAC,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC;oBAC/B,SAAS,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;oBACnC,MAAM,CAAC,SAAS,CAAC;gBACrB,CAAC;gBAhDL;oBAAC,iBAAU,EAAE;;+BAAA;gBAiDb,kBAAC;YAAD,CAAC,AAhDD,IAgDC;YAhDD,qCAgDC,CAAA"}

View File

@@ -0,0 +1,41 @@
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 SingleComponent;
return {
setters:[
function (core_1_1) {
core_1 = core_1_1;
}],
execute: function() {
SingleComponent = (function () {
function SingleComponent() {
this.target = 'http://localhost:8888/alfresco/service/api/upload';
this.multi = 'true';
this.accept = 'image/*';
this.droppable = false;
}
SingleComponent = __decorate([
core_1.Component({
selector: 'my-app',
templateUrl: 'app/template/single.component.html'
}),
__metadata('design:paramtypes', [])
], SingleComponent);
return SingleComponent;
}());
exports_1("SingleComponent", SingleComponent);
}
}
});
//# sourceMappingURL=single.component.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"single.component.js","sourceRoot":"","sources":["single.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;YAOA;gBAAA;oBACI,WAAM,GAAW,mDAAmD,CAAC;oBACrE,UAAK,GAAW,MAAM,CAAC;oBACvB,WAAM,GAAU,SAAS,CAAC;oBAC1B,cAAS,GAAY,KAAK,CAAC;gBAE/B,CAAC;gBAXD;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,QAAQ;wBAClB,WAAW,EAAE,oCAAoC;qBACpD,CAAC;;mCAAA;gBAQF,sBAAC;YAAD,CAAC,AAND,IAMC;YAND,6CAMC,CAAA"}

View File

@@ -0,0 +1,40 @@
body {
padding-top: 40px;
padding-bottom: 40px;
background-color: #eee;
}
.form-signin {
max-width: 330px;
padding: 15px;
margin: 0 auto;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
}
.form-signin .checkbox {
font-weight: normal;
}
.form-signin .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="username"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}

View File

@@ -0,0 +1,29 @@
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form [ngFormModel]="form" (submit)="onSubmit(form.value, $event)" class="form-signin">
<div [ngClass]="{'has-error': isErrorStyle(form.controls.username)}" class="form-group">
<label for="username">Username</label>
<input id="username" class="form-control " type="text" placeholder="username" ngControl="username">
<div [hidden]="form.controls.username.valid || form.controls.username.pristine" class="alert alert-danger">
<p *ngIf="form.controls.username.dirty && form.controls.username.errors && form.controls.username.errors.minlength">
Your username needs to be at least 4 characters.
</p>
<p *ngIf="form.controls.username.hasError('required')">
Username is required
</p>
</div>
</div>
<div [ngClass]="{'has-error': isErrorStyle(form.controls.password)}" class="form-group">
<label for="password">Password</label>
<input id="password" class="form-control" type="password" placeholder="password" ngControl="password">
<div [hidden]="form.controls.password.valid || form.controls.password.pristine" class="alert alert-danger">
<p *ngIf="form.controls.password.hasError('required')">
Password is required
</p>
</div>
</div>
<button type="submit" class="btn btn-lg btn-primary btn-block" [disabled]="!form.valid">Login</button>
<div *ngIf="error" class="alert alert-danger">You have entered an invalid username or password</div>
</form>
</div>
</div>

63
demo-shell-ng2/dist/index.html vendored Normal file
View File

@@ -0,0 +1,63 @@
<html>
<head>
<base href="/">
<title>File Share - Angular 2</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<link href="node_modules/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="app/css/app.css" rel="stylesheet">
<!-- Custom theme -->
<link rel="stylesheet" href="app/css/theme/navbar.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 src="node_modules/ng2-uploader/bundles/ng2-uploader.js"></script>-->
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="/app/js/xml2json.js"></script>
<!-- 2. Configure SystemJS -->
<script>
System.config({
map: {
'ng2-uploader': 'node_modules/ng2-uploader',
'ng2-alfresco': 'node_modules/ng2-alfresco'
},
packages: {
app: {
format: 'register',
defaultExtension: 'js'
},
'ng2-uploader': {
format: 'register',
defaultExtension: 'js'
},
'ng2-alfresco': {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('app/main')
.then(null, console.error.bind(console));
</script>
</head>
<!-- 3. Display the application -->
<body>
<my-app>Loading...</my-app>
</body>
</html>

11411
demo-shell-ng2/dist/lib/Rx.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

26056
demo-shell-ng2/dist/lib/angular2.dev.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

12
demo-shell-ng2/dist/lib/es6-shim.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1106
demo-shell-ng2/dist/lib/http.dev.js vendored Normal file

File diff suppressed because it is too large Load Diff

4
demo-shell-ng2/dist/lib/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

3436
demo-shell-ng2/dist/lib/router.dev.js vendored Normal file

File diff suppressed because it is too large Load Diff

130
demo-shell-ng2/dist/lib/shims_for_IE.js vendored Normal file
View File

@@ -0,0 +1,130 @@
// function.name (all IE)
/*! @source http://stackoverflow.com/questions/6903762/function-name-not-supported-in-ie*/
if (!Object.hasOwnProperty('name')) {
Object.defineProperty(Function.prototype, 'name', {
get: function() {
var matches = this.toString().match(/^\s*function\s*(\S*)\s*\(/);
var name = matches && matches.length > 1 ? matches[1] : "";
// For better performance only parse once, and then cache the
// result through a new accessor for repeated access.
Object.defineProperty(this, 'name', {value: name});
return name;
}
});
}
// URL polyfill for SystemJS (all IE)
/*! @source https://github.com/ModuleLoader/es6-module-loader/blob/master/src/url-polyfill.js*/
// from https://gist.github.com/Yaffle/1088850
(function(global) {
function URLPolyfill(url, baseURL) {
if (typeof url != 'string') {
throw new TypeError('URL must be a string');
}
var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);
if (!m) {
throw new RangeError();
}
var protocol = m[1] || "";
var username = m[2] || "";
var password = m[3] || "";
var host = m[4] || "";
var hostname = m[5] || "";
var port = m[6] || "";
var pathname = m[7] || "";
var search = m[8] || "";
var hash = m[9] || "";
if (baseURL !== undefined) {
var base = baseURL instanceof URLPolyfill ? baseURL : new URLPolyfill(baseURL);
var flag = protocol === "" && host === "" && username === "";
if (flag && pathname === "" && search === "") {
search = base.search;
}
if (flag && pathname.charAt(0) !== "/") {
pathname = (pathname !== "" ? (((base.host !== "" || base.username !== "") && base.pathname === "" ? "/" : "") + base.pathname.slice(0, base.pathname.lastIndexOf("/") + 1) + pathname) : base.pathname);
}
// dot segments removal
var output = [];
pathname.replace(/^(\.\.?(\/|$))+/, "")
.replace(/\/(\.(\/|$))+/g, "/")
.replace(/\/\.\.$/, "/../")
.replace(/\/?[^\/]*/g, function (p) {
if (p === "/..") {
output.pop();
} else {
output.push(p);
}
});
pathname = output.join("").replace(/^\//, pathname.charAt(0) === "/" ? "/" : "");
if (flag) {
port = base.port;
hostname = base.hostname;
host = base.host;
password = base.password;
username = base.username;
}
if (protocol === "") {
protocol = base.protocol;
}
}
// convert windows file URLs to use /
if (protocol == 'file:')
pathname = pathname.replace(/\\/g, '/');
this.origin = protocol + (protocol !== "" || host !== "" ? "//" : "") + host;
this.href = protocol + (protocol !== "" || host !== "" ? "//" : "") + (username !== "" ? username + (password !== "" ? ":" + password : "") + "@" : "") + host + pathname + search + hash;
this.protocol = protocol;
this.username = username;
this.password = password;
this.host = host;
this.hostname = hostname;
this.port = port;
this.pathname = pathname;
this.search = search;
this.hash = hash;
}
global.URLPolyfill = URLPolyfill;
})(typeof self != 'undefined' ? self : global);
//classList (IE9)
/*! @license please refer to http://unlicense.org/ */
/*! @author Eli Grey */
/*! @source https://github.com/eligrey/classList.js */
;if("document" in self&&!("classList" in document.createElement("_"))){(function(j){"use strict";if(!("Element" in j)){return}var a="classList",f="prototype",m=j.Element[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p<o;p++){if(p in this&&this[p]===q){return p}}return -1},n=function(o,p){this.name=o;this.code=DOMException[o];this.message=p},g=function(p,o){if(o===""){throw new n("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(o)){throw new n("INVALID_CHARACTER_ERR","String contains an invalid character")}return c.call(p,o)},d=function(s){var r=k.call(s.getAttribute("class")||""),q=r?r.split(/\s+/):[],p=0,o=q.length;for(;p<o;p++){this.push(q[p])}this._updateClassName=function(){s.setAttribute("class",this.toString())}},e=d[f]=[],i=function(){return new d(this)};n[f]=Error[f];e.item=function(o){return this[o]||null};e.contains=function(o){o+="";return g(this,o)!==-1};e.add=function(){var s=arguments,r=0,p=s.length,q,o=false;do{q=s[r]+"";if(g(this,q)===-1){this.push(q);o=true}}while(++r<p);if(o){this._updateClassName()}};e.remove=function(){var t=arguments,s=0,p=t.length,r,o=false;do{r=t[s]+"";var q=g(this,r);if(q!==-1){this.splice(q,1);o=true}}while(++s<p);if(o){this._updateClassName()}};e.toggle=function(p,q){p+="";var o=this.contains(p),r=o?q!==true&&"remove":q!==false&&"add";if(r){this[r](p)}return !o};e.toString=function(){return this.join(" ")};if(b.defineProperty){var l={get:i,enumerable:true,configurable:true};try{b.defineProperty(m,a,l)}catch(h){if(h.number===-2146823252){l.enumerable=false;b.defineProperty(m,a,l)}}}else{if(b[f].__defineGetter__){m.__defineGetter__(a,i)}}}(self))};
//console mock (IE9)
if (!window.console) window.console = {};
if (!window.console.log) window.console.log = function () { };
if (!window.console.error) window.console.error = function () { };
if (!window.console.warn) window.console.warn = function () { };
if (!window.console.assert) window.console.assert = function () { };
//RequestAnimationFrame (IE9, Android 4.1, 4.2, 4.3)
/*! @author Paul Irish */
/*! @source https://gist.github.com/paulirish/1579671 */
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function(callback, element) {
var currTime = Date.now();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}());

File diff suppressed because one or more lines are too long

5035
demo-shell-ng2/dist/lib/system.src.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,83 @@
const gulp = require('gulp');
const del = require('del');
const typescript = require('gulp-typescript');
const tscConfig = require('./tsconfig.json');
const sourcemaps = require('gulp-sourcemaps');
const tslint = require('gulp-tslint');
const browserSync = require('browser-sync');
const reload = browserSync.reload;
const tsconfig = require('tsconfig-glob');
// clean the contents of the distribution directory
gulp.task('clean', function () {
return del('dist/**/*');
});
// copy static assets - i.e. non TypeScript compiled source
gulp.task('copy:assets', ['clean'], function() {
return gulp.src(['app/**/*',
'index.html',
'!app/**/*.ts'], { base : './' })
.pipe(gulp.dest('dist'))
});
// copy dependencies
gulp.task('copy:libs', ['clean'], function() {
return gulp.src([
'node_modules/es6-shim/es6-shim.min.js',
'node_modules/systemjs/dist/system-polyfills.js',
'node_modules/angular2/es6/dev/src/testing/shims_for_IE.js',
'node_modules/angular2/bundles/angular2-polyfills.js',
'node_modules/systemjs/dist/system.src.js',
'node_modules/rxjs/bundles/Rx.js',
'node_modules/angular2/bundles/angular2.dev.js',
'node_modules/angular2/bundles/router.dev.js',
'node_modules/angular2/bundles/http.dev.js',
'node_modules/jquery/dist/jquery.min.js',
'node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/font-awesome/css/font-awesome.min.css',
'node_modules/bootstrap/dist/css/bootstrap.min.css'
])
.pipe(gulp.dest('dist/lib'))
});
// linting
gulp.task('tslint', function() {
return gulp.src(['app/**/*.ts', '!node_modules/**'])
.pipe(tslint())
.pipe(tslint.report('verbose'));
});
// TypeScript compile
gulp.task('compile', ['clean'], function () {
return gulp
.src(tscConfig.files)
.pipe(sourcemaps.init())
.pipe(typescript(tscConfig.compilerOptions))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist/app'));
});
// update the tsconfig files based on the glob pattern
gulp.task('tsconfig-glob', function () {
return tsconfig({
configPath: '.',
indent: 2
});
});
// Run browsersync for development
gulp.task('serve', ['build'], function() {
browserSync({
server: {
baseDir: 'dist'
}
});
gulp.watch(['app/**/*', 'index.html'], ['buildAndReload']);
});
gulp.task('build', ['tslint', 'compile', 'copy:libs', 'copy:assets']);
gulp.task('dev', ['build', 'serve'], reload);
gulp.task('default', ['build']);

View File

@@ -1,7 +1,9 @@
{
"name": "angular2-quickstart",
"name": "Alfresco-Angular2-SFS",
"version": "1.0.0",
"scripts": {
"build.dev": "gulp dev",
"build.prod": "gulp build",
"prestart": "npm install",
"start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",
"tsc": "tsc",
@@ -27,6 +29,13 @@
},
"devDependencies": {
"concurrently": "^2.0.0",
"browser-sync": "^2.10.0",
"del": "^2.1.0",
"gulp": "^3.9.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-tslint": "^3.6.0",
"gulp-typescript": "^2.8.0",
"tsconfig-glob": "^0.3.3",
"lite-server": "^2.2.0",
"typescript": "^1.8.10",
"typings": "^0.7.12"

View File

@@ -1,6 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"outDir": "dist/app",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
@@ -9,6 +10,10 @@
"removeComments": false,
"noImplicitAny": false
},
"files": [
"app/**/*.ts",
"!node_modules/**"
],
"exclude": [
"node_modules",
"typings/main",

123
demo-shell-ng2/tslint.json Normal file
View File

@@ -0,0 +1,123 @@
{
"rules": {
"align": [
true,
"parameters",
"arguments",
"statements"
],
"ban": false,
"class-name": true,
"comment-format": [
true,
"check-space",
"check-lowercase"
],
"curly": true,
"eofline": true,
"forin": true,
"indent": [
true,
"spaces"
],
"interface-name": false,
"jsdoc-format": true,
"label-position": true,
"label-undefined": true,
"max-line-length": [
true,
140
],
"member-ordering": [
true,
"public-before-private",
"static-before-instance",
"variables-before-functions"
],
"no-any": false,
"no-arg": true,
"no-bitwise": true,
"no-conditional-assignment": true,
"no-consecutive-blank-lines": false,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-constructor-vars": false,
"no-debugger": true,
"no-duplicate-key": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
"no-inferrable-types": false,
"no-internal-module": true,
"no-require-imports": true,
"no-shadowed-variable": true,
"no-string-literal": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unreachable": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"quotemark": [
true,
"single",
"avoid-escape"
],
"radix": true,
"semicolon": true,
"switch-default": true,
"trailing-comma": [
true,
{
"multiline": "never",
"singleline": "never"
}
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef": false,
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"use-strict": false,
"variable-name": [
true,
"check-format",
"allow-leading-underscore",
"ban-keywords"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator"
]
}
}