UNPKG

nakedobjects.spa

Version:

Single Page Application client for a Naked Objects application.

119 lines 5.41 kB
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); }; import { Component } from '@angular/core'; import { Location } from '@angular/common'; import { Http } from '@angular/http'; import { UrlManagerService } from '../url-manager.service'; import { ClickHandlerService } from '../click-handler.service'; import { ContextService } from '../context.service'; import { ErrorService } from '../error.service'; import { RepLoaderService } from '../rep-loader.service'; import * as Msg from '../user-messages'; import { ConfigService } from '../config.service'; import { AuthService } from '../auth.service'; import { Pane } from '../route-data'; import { safeUnsubscribe } from '../helpers-components'; var FooterComponent = (function () { function FooterComponent(authService, urlManager, context, clickHandler, error, repLoader, location, configService, http) { var _this = this; this.authService = authService; this.urlManager = urlManager; this.context = context; this.clickHandler = clickHandler; this.error = error; this.repLoader = repLoader; this.location = location; this.configService = configService; this.http = http; this.goHome = function (right) { var newPane = _this.clickHandler.pane(Pane.Pane1, right); if (_this.configService.config.leftClickHomeAlwaysGoesToSinglePane && newPane === Pane.Pane1) { _this.urlManager.setHomeSinglePane(); } else { _this.urlManager.setHome(newPane); } }; this.goBack = function () { _this.location.back(); }; this.goForward = function () { _this.location.forward(); }; this.swapPanes = function () { if (!_this.swapDisabled()) { _this.context.swapCurrentObjects(); _this.urlManager.swapPanes(); } }; this.swapDisabled = function () { return _this.urlManager.isMultiLineDialog() ? true : null; }; this.singlePane = function (right) { _this.urlManager.singlePane(_this.clickHandler.pane(Pane.Pane1, right)); }; this.logOff = function () { return _this.urlManager.logoff(); }; this.applicationProperties = function () { return _this.urlManager.applicationProperties(); }; this.recent = function (right) { _this.urlManager.setRecent(_this.clickHandler.pane(Pane.Pane1, right)); }; this.cicero = function () { _this.urlManager.singlePane(_this.clickHandler.pane(Pane.Pane1)); _this.urlManager.cicero(); }; } Object.defineProperty(FooterComponent.prototype, "currentCopyColor", { get: function () { return this.copyViewModel.color; }, enumerable: true, configurable: true }); Object.defineProperty(FooterComponent.prototype, "currentCopyTitle", { get: function () { return this.copyViewModel.draggableTitle(); }, enumerable: true, configurable: true }); FooterComponent.prototype.ngOnInit = function () { var _this = this; this.context.getUser().then(function (user) { return _this.userName = user.userName(); }).catch(function (reject) { return _this.error.handleError(reject); }); this.repLoader.loadingCount$.subscribe(function (count) { return _this.loading = count > 0 ? Msg.loadingMessage : ""; }); this.context.warning$.subscribe(function (ws) { return _this.warnings = ws; }); this.context.messages$.subscribe(function (ms) { return _this.messages = ms; }); this.context.copiedViewModel$.subscribe(function (cvm) { return _this.copyViewModel = cvm; }); }; FooterComponent.prototype.ngOnDestroy = function () { safeUnsubscribe(this.warnSub); safeUnsubscribe(this.messageSub); safeUnsubscribe(this.cvmSub); safeUnsubscribe(this.lcSub); }; return FooterComponent; }()); FooterComponent = __decorate([ Component({ selector: 'nof-footer', template: require('./footer.component.html'), styles: [require('./footer.component.css')] }), __metadata("design:paramtypes", [AuthService, UrlManagerService, ContextService, ClickHandlerService, ErrorService, RepLoaderService, Location, ConfigService, Http]) ], FooterComponent); export { FooterComponent }; //# sourceMappingURL=footer.component.js.map