Ejemplo n.º 1
0
var MatchupPageComponent = (function () {
    function MatchupPageComponent() {
    }
    MatchupPageComponent.prototype.load_pokemon = function (evt) {
        if (evt.pannel == "left") {
            this.leftPane.load_data(evt.pokemon);
        }
        if (evt.pannel == "right") {
            this.rightPane.load_data(evt.pokemon);
        }
    };
    __decorate([
        core_1.ViewChild('leftPane'), 
        __metadata('design:type', pane_component_1.PaneComponent)
    ], MatchupPageComponent.prototype, "leftPane", void 0);
    __decorate([
        core_1.ViewChild('rightPane'), 
        __metadata('design:type', pane_component_1.PaneComponent)
    ], MatchupPageComponent.prototype, "rightPane", void 0);
    MatchupPageComponent = __decorate([
        core_1.Component({
            selector: 'matchup-page',
            directives: [search_component_1.SearchComponent, pane_component_1.PaneComponent],
            providers: [http_1.HTTP_PROVIDERS],
            styleUrls: ['app/matchup-page/matchup-page.component.css'],
            template: "\n    <div class=\"row\">\n      <div class=\"col-md-6 col-md-offset-3\">\n        <search (load)=\"load_pokemon($event)\"></search>\n      </div>\n    </div>\n    <div class=\"row\">\n      <div class=\"col-md-12 col-centered\">\n        <div class=\"col-md-6 col-sm-12 datapane\">\n          <div class=\"container-fluid\">\n          </div>\n          <pane #leftPane></pane>\n        </div>\n        <div class=\"col-md-6 col-sm-12 datapane\">\n          <div class=\"container-fluid\">\n          </div>\n          <pane #rightPane></pane>\n        </div>\n      </div>\n    </div>\n  "
        }), 
        __metadata('design:paramtypes', [])
    ], MatchupPageComponent);
    return MatchupPageComponent;
}());
var AppComponent = (function () {
    function AppComponent() {
        this.counter = 16;
        this.isItemVisible = false;
        this.isItemVisibleFirst = true;
    }
    Object.defineProperty(AppComponent.prototype, "message", {
        get: function () {
            if (this.counter > 0) {
                return this.counter + " taps left";
            }
            else {
                return "Hoorraaay! \nYou are ready to start building!";
            }
        },
        enumerable: true,
        configurable: true
    });
    AppComponent.prototype.showsecondline = function () {
        var container = this.container.nativeElement;
        var second = this.second.nativeElement;
        var that = this;
        container.animate({
            translate: { x: 0, y: -100 },
            duration: 1000,
            curve: enums_1.AnimationCurve.easeIn
        })
            .then(function () {
            that.isItemVisibleFirst = false;
            second.translateY = 1000;
            that.isItemVisible = true;
            timer_1.setTimeout(function () {
                second.animate({
                    translate: { x: 0, y: 0 },
                    duration: 500,
                    curve: enums_1.AnimationCurve.easeIn
                });
            }, 500);
        });
    };
    __decorate([
        core_1.ViewChild("container"), 
        __metadata('design:type', core_1.ElementRef)
    ], AppComponent.prototype, "container", void 0);
    __decorate([
        core_1.ViewChild("second"), 
        __metadata('design:type', core_1.ElementRef)
    ], AppComponent.prototype, "second", void 0);
    AppComponent = __decorate([
        core_1.Component({
            selector: "my-app",
            templateUrl: "app.component.html",
        }), 
        __metadata('design:paramtypes', [])
    ], AppComponent);
    return AppComponent;
}());
Ejemplo n.º 3
0
var ModalComponent = (function () {
    function ModalComponent(_loader, _navParams, _viewCtrl) {
        this._loader = _loader;
        this._navParams = _navParams;
        this._viewCtrl = _viewCtrl;
    }
    ModalComponent.prototype.ngAfterViewInit = function () {
        var _this = this;
        var component = this._navParams.data.componentToPresent;
        this._loader.loadNextToLocation(component, this.wrapper).then(function (componentInstance) {
            _this._viewCtrl.setInstance(componentInstance.instance);
            // TODO - validate what life cycle events aren't call and possibly call them here if needed
        });
    };
    __decorate([
        core_1.ViewChild('wrapper', { read: core_1.ViewContainerRef }), 
        __metadata('design:type', core_1.ViewContainerRef)
    ], ModalComponent.prototype, "wrapper", void 0);
    ModalComponent = __decorate([
        core_1.Component({
            selector: 'ion-modal',
            template: "\n    <div class=\"backdrop\"></div>\n    <div class=\"modal-wrapper\">\n      <div #wrapper></div>\n    </div>\n  "
        }), 
        __metadata('design:paramtypes', [core_1.DynamicComponentLoader, nav_params_1.NavParams, view_controller_1.ViewController])
    ], ModalComponent);
    return ModalComponent;
}());
Ejemplo n.º 4
0
var SignaturePadComponent = (function () {
    function SignaturePadComponent() {
    }
    SignaturePadComponent.prototype.ngAfterViewInit = function () {
        var canvas = this.signatureCanvas.nativeElement;
        var context = canvas.getContext("2d");
        canvas.style.backgroundColor = 'green';
        new SignaturePad(canvas, {
            backgroundColor: 'rgba(205, 205, 255, 0)',
            penColor: 'rgb(34, 100, 20)'
        });
    };
    __decorate([
        core_1.ViewChild("signatureCanvas"), 
        __metadata('design:type', Object)
    ], SignaturePadComponent.prototype, "signatureCanvas", void 0);
    SignaturePadComponent = __decorate([
        core_1.Component({
            selector: 'signature-pad',
            // template: '<h1>Hello</h1>'
            template: '<h1><canvas id = "signaturepd" #signatureCanvas width=400 height=200></canvas>'
        }), 
        __metadata('design:paramtypes', [])
    ], SignaturePadComponent);
    return SignaturePadComponent;
}());
Ejemplo n.º 5
0
var Displayer = (function () {
    function Displayer() {
    }
    Displayer.prototype.ngAfterViewInit = function () {
        this.displayer = this.displayerRef.nativeElement;
        this.setIOSLabelAutoFont(this.displayer);
    };
    Displayer.prototype.setIOSLabelAutoFont = function (elem) {
        if (platform_1.device.os === platform_1.platformNames.ios) {
            elem.ios.numberOfLines = 1;
            elem.ios.minimumFontSize = 20;
            elem.ios.adjustsFontSizeToFitWidth = true;
        }
    };
    __decorate([
        core_1.Input('input'), 
        __metadata('design:type', String)
    ], Displayer.prototype, "input", void 0);
    __decorate([
        core_1.ViewChild('displayer'), 
        __metadata('design:type', core_1.ElementRef)
    ], Displayer.prototype, "displayerRef", void 0);
    Displayer = __decorate([
        core_1.Component({
            selector: 'displayer',
            template: "\n    <StackLayout class=\"stacklayout\">\n      <Label #displayer class=\"displayer large\" [text]=\"input\"></Label>\n    </StackLayout>\n  ",
            styleUrls: ['Displayer/displayer.css']
        }), 
        __metadata('design:paramtypes', [])
    ], Displayer);
    return Displayer;
}());
Ejemplo n.º 6
0
var Desktop = (function () {
    function Desktop(cd, desktop) {
        this.cd = cd;
        this.desktop = desktop;
    }
    Desktop.prototype.close = function () {
        this.modal.close();
    };
    Desktop.prototype.open = function () {
        this.modal.open();
    };
    __decorate([
        core_1.ViewChild('modal'), 
        __metadata('design:type', ng2_bs3_modal_1.ModalComponent)
    ], Desktop.prototype, "modal", void 0);
    Desktop = __decorate([
        core_1.Component({
            selector: 'desktop',
            templateUrl: '/app/components/desktop/desktop.html',
            directives: [widget_1.Widget, tabs_1.Tab, tabs_1.Tabs, controller_frame_1.ControllerFrame, ng2_bs3_modal_1.MODAL_DIRECTIVES],
            providers: [desktop_service_1.DesktopService]
        }), 
        __metadata('design:paramtypes', [core_1.ChangeDetectorRef, (typeof (_a = typeof desktop_service_1.DesktopService !== 'undefined' && desktop_service_1.DesktopService) === 'function' && _a) || Object])
    ], Desktop);
    return Desktop;
    var _a;
}());
Ejemplo n.º 7
0
export var MdSnackBarContainer = (function (_super) {
    __extends(MdSnackBarContainer, _super);
    function MdSnackBarContainer() {
        _super.apply(this, arguments);
    }
    /** Attach a portal as content to this snack bar container. */
    MdSnackBarContainer.prototype.attachComponentPortal = function (portal) {
        if (this._portalHost.hasAttached()) {
            throw new MdSnackBarContentAlreadyAttached();
        }
        return this._portalHost.attachComponentPortal(portal);
    };
    MdSnackBarContainer.prototype.attachTemplatePortal = function (portal) {
        throw Error('Not yet implemented');
    };
    __decorate([
        ViewChild(PortalHostDirective), 
        __metadata('design:type', PortalHostDirective)
    ], MdSnackBarContainer.prototype, "_portalHost", void 0);
    MdSnackBarContainer = __decorate([
        Component({selector: 'snack-bar-container',
            template: "<template portalHost></template>",
            styles: [":host { box-shadow: 0px 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 9px 46px 8px rgba(0, 0, 0, 0.12); background: #323232; border-radius: 2px; display: block; height: 20px; max-width: 568px; min-width: 288px; overflow: hidden; padding: 14px 24px; } /*# sourceMappingURL=snack-bar-container.css.map */ "],
            host: {
                'role': 'alert'
            }
        }), 
        __metadata('design:paramtypes', [])
    ], MdSnackBarContainer);
    return MdSnackBarContainer;
}(BasePortalHost));
Ejemplo n.º 8
0
var ModalCmp = (function () {
    function ModalCmp(_compiler, _renderer, _navParams, _viewCtrl) {
        this._compiler = _compiler;
        this._renderer = _renderer;
        this._navParams = _navParams;
        this._viewCtrl = _viewCtrl;
        this.d = _navParams.data.opts;
    }
    ModalCmp.prototype.loadComponent = function (done) {
        var _this = this;
        var componentType = this._navParams.data.componentType;
        bootstrap_1.addSelector(componentType, 'ion-page');
        this._compiler.resolveComponent(componentType).then(function (componentFactory) {
            var componentRef = _this.viewport.createComponent(componentFactory, _this.viewport.length, _this.viewport.parentInjector);
            _this._renderer.setElementClass(componentRef.location.nativeElement, 'show-page', true);
            // auto-add page css className created from component JS class name
            var cssClassName = util_1.pascalCaseToDashCase(componentType.name);
            _this._renderer.setElementClass(componentRef.location.nativeElement, cssClassName, true);
            _this._viewCtrl.setInstance(componentRef.instance);
            _this.enabled = true;
            done();
        });
    };
    ModalCmp.prototype.ngAfterViewInit = function () {
        // intentionally kept empty
    };
    ModalCmp.prototype.dismiss = function (role) {
        return this._viewCtrl.dismiss(null, role);
    };
    ModalCmp.prototype.bdClick = function () {
        if (this.enabled && this.d.enableBackdropDismiss) {
            this.dismiss('backdrop');
        }
    };
    ModalCmp.prototype._keyUp = function (ev) {
        if (this.enabled && this._viewCtrl.isLast() && ev.keyCode === key_1.Key.ESCAPE) {
            this.bdClick();
        }
    };
    __decorate([
        core_1.ViewChild('viewport', { read: core_1.ViewContainerRef }), 
        __metadata('design:type', (typeof (_a = typeof core_1.ViewContainerRef !== 'undefined' && core_1.ViewContainerRef) === 'function' && _a) || Object)
    ], ModalCmp.prototype, "viewport", void 0);
    __decorate([
        core_1.HostListener('body:keyup', ['$event']), 
        __metadata('design:type', Function), 
        __metadata('design:paramtypes', [Object]), 
        __metadata('design:returntype', void 0)
    ], ModalCmp.prototype, "_keyUp", null);
    ModalCmp = __decorate([
        core_1.Component({
            selector: 'ion-modal',
            template: "\n    <ion-backdrop disableScroll=\"false\" (click)=\"bdClick($event)\"></ion-backdrop>\n    <div class=\"modal-wrapper\">\n      <div #viewport nav-viewport></div>\n    </div>\n  ",
            directives: [backdrop_1.Backdrop]
        }), 
        __metadata('design:paramtypes', [(typeof (_b = typeof core_1.ComponentResolver !== 'undefined' && core_1.ComponentResolver) === 'function' && _b) || Object, (typeof (_c = typeof core_1.Renderer !== 'undefined' && core_1.Renderer) === 'function' && _c) || Object, (typeof (_d = typeof nav_params_1.NavParams !== 'undefined' && nav_params_1.NavParams) === 'function' && _d) || Object, (typeof (_e = typeof view_controller_1.ViewController !== 'undefined' && view_controller_1.ViewController) === 'function' && _e) || Object])
    ], ModalCmp);
    return ModalCmp;
    var _a, _b, _c, _d, _e;
}());
Ejemplo n.º 9
0
var DetailedViewPage = (function () {
    function DetailedViewPage(_nav, _filterService, _viewCtrl) {
        this._nav = _nav;
        this._filterService = _filterService;
        this._viewCtrl = _viewCtrl;
        this.filterNames = this._filterService.getFilterNames();
    }
    DetailedViewPage.prototype.ionViewLoaded = function () {
        this._viewCtrl.setBackButtonText('Cancel');
        this.drawImage();
    };
    DetailedViewPage.prototype.drawImage = function () {
        this.image = this._filterService.getImage();
        var canvas = this.photo.nativeElement;
        canvas.width = canvas.height = window.innerWidth;
        // canvas.height = (canvas.width / this.image.width) * this.image.height; //match canvas aspect ratio to original image
        var ctx = canvas.getContext("2d");
        this._filterService.setOriginalCanvas(canvas);
        this._filterService.drawImage(ctx);
    };
    __decorate([
        core_1.ViewChild("photo"), 
        __metadata('design:type', core_1.ElementRef)
    ], DetailedViewPage.prototype, "photo", void 0);
    DetailedViewPage = __decorate([
        core_1.Component({
            templateUrl: 'build/pages/detailed-view/detailed-view.html',
            directives: [filter_component_1.FilterComponent]
        }), 
        __metadata('design:paramtypes', [ionic_angular_1.NavController, filter_service_1.FilterService, ionic_angular_1.ViewController])
    ], DetailedViewPage);
    return DetailedViewPage;
}());
Ejemplo n.º 10
0
var BootstrapComponent = (function () {
    function BootstrapComponent() {
        this.ng2BootstrapDemo = new ng2BootstrapDemo_model_1.NG2BootstrapDemo();
        console.log('BootstrapComponent constructor');
    }
    BootstrapComponent.prototype.showDemo = function (demo) {
        var _this = this;
        if (demo && demo.componentSelector) {
            this.resolver.resolveComponent(demo.componentClass).then(function (factory) {
                _this.cmpRef = _this.target.createComponent(factory);
            });
        }
    };
    __decorate([
        core_1.ViewChild('demoContent', { read: core_1.ViewContainerRef }), 
        __metadata('design:type', Object)
    ], BootstrapComponent.prototype, "target", void 0);
    BootstrapComponent = __decorate([
        core_1.Component({
            selector: 'bootstrap-component',
            templateUrl: 'app/ng2-bootstrap-demo/bootstrap.template.html',
            styles: [''],
            directives: [],
            providers: []
        }), 
        __metadata('design:paramtypes', [])
    ], BootstrapComponent);
    return BootstrapComponent;
})();
Ejemplo n.º 11
0
var PokemonStatsComponent = (function () {
    function PokemonStatsComponent() {
        this.pokemon = {};
    }
    PokemonStatsComponent.prototype.ngOnChanges = function (change) {
        var _this = this;
        if (this.stats) {
            this.stats.nativeElement.className = "";
            var timer = Observable_1.Observable.timer(10, 10);
            timer.subscribe(function (r) { return _this.stats.nativeElement.className = "stats"; });
        }
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Object)
    ], PokemonStatsComponent.prototype, "pokemon", void 0);
    __decorate([
        core_1.ViewChild('stats'), 
        __metadata('design:type', Object)
    ], PokemonStatsComponent.prototype, "stats", void 0);
    PokemonStatsComponent = __decorate([
        core_1.Component({
            selector: "pokemon-stats",
            styleUrls: ['app/pane/stats/stats.component.css'],
            directives: [card_1.MD_CARD_DIRECTIVES, donut_types_component_1.DonutTypesComponent, type_badge_component_1.TypeBadgeComponent],
            template: "\n  <div #stats *ngIf=\"pokemon.types\" class=\"stats\">\n    <md-card class=\"shadowfilter\">\n      <img class=\"img-responsive shadowfilter\" src=\"http://localhost:8000/images/full/{{pokemon.poke_id}}.png\">\n      <md-card-content>\n        <h2>{{pokemon.name}}</h2>\n        <p>Attack: {{pokemon.attack}}</p>\n        <p>Defence: {{pokemon.defence}}</p>\n        <p>Stamina: {{pokemon.stamina}}</p>\n      </md-card-content>\n      <hr/>\n      <type-badge *ngFor=\"let type of pokemon.types\" [type]=\"type.name\"></type-badge>\n    </md-card>\n  </div>\n  "
        }), 
        __metadata('design:paramtypes', [])
    ], PokemonStatsComponent);
    return PokemonStatsComponent;
}());
Ejemplo n.º 12
0
var TowerComponent = (function () {
    function TowerComponent(componentResolver, vc) {
        this.componentResolver = componentResolver;
        this.vc = vc;
    }
    TowerComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.componentResolver.resolveComponent(item1_1.Item1Component).then(function (factory) {
            // console.log(this.vs);
            var res = _this.vc.createComponent(factory);
            //res.instance.setCoordinates(coordinates.first, coordinates.second);
        });
    };
    TowerComponent.prototype.ngAfterViewInit = function () {
        console.log(this.vc);
    };
    __decorate([
        core_1.ViewChild('vertex'), 
        __metadata('design:type', core_1.ElementRef)
    ], TowerComponent.prototype, "element", void 0);
    TowerComponent = __decorate([
        core_1.Component({
            selector: 'tower',
            template: '<h1>tower</h1> <br> <h2 #vertex></h2>',
        }), 
        __metadata('design:paramtypes', [core_1.ComponentResolver, core_1.ViewContainerRef])
    ], TowerComponent);
    return TowerComponent;
}());
Ejemplo n.º 13
0
var ChangePasswordWidget = (function () {
    function ChangePasswordWidget(injector, changePasswordService) {
        this.injector = injector;
        this.changePasswordService = changePasswordService;
        this.msgs = [];
        this.clsoepopup = new core_1.EventEmitter();
        this.widget = this.injector.get("widget");
        this.id = "ChangePassword";
        this.passwordModel = new widget_changePassword_model_1.ChangePasswordModel();
    }
    ChangePasswordWidget.prototype.ngOnInit = function () {
    };
    ChangePasswordWidget.prototype.onSubmit = function () {
        var _this = this;
        var msgValidation = document.getElementById("spanMsg");
        this.loaderel.nativeElement.style.display = "block";
        if (this.passwordModel.NewPassword == this.passwordModel.ReenterPassword && this.loginUserId != null && this.loginUserId != "") {
            msgValidation.style.display = "none";
            this.changePasswordService.changePassword(this.loginUserId, this.passwordModel.OldPassword, this.passwordModel.NewPassword).subscribe(function (data) { return _this.bIsSuccess = data; }, function (error) { return console.log(error); }, function () { return _this.afterSubmit(); });
        }
        else {
            msgValidation.style.display = "block";
        }
    };
    ChangePasswordWidget.prototype.setUserId = function (userId) {
        this.loginUserId = userId;
    };
    ChangePasswordWidget.prototype.afterSubmit = function () {
        this.loaderel.nativeElement.style.display = "block";
        this.passwordModel = new widget_changePassword_model_1.ChangePasswordModel();
        this.close(this.bIsSuccess == true ? 'success' : 'fail');
    };
    ChangePasswordWidget.prototype.close = function (action) {
        this.clsoepopup.emit(action);
    };
    ChangePasswordWidget.prototype.Clear = function () {
        this.passwordModel = new widget_changePassword_model_1.ChangePasswordModel();
        var msgValidation = document.getElementById("spanMsg");
        msgValidation.style.display = "none";
        this.close('close');
    };
    __decorate([
        core_1.Output(), 
        __metadata('design:type', Object)
    ], ChangePasswordWidget.prototype, "clsoepopup", void 0);
    __decorate([
        core_1.ViewChild('loader'), 
        __metadata('design:type', core_1.ElementRef)
    ], ChangePasswordWidget.prototype, "loaderel", void 0);
    ChangePasswordWidget = __decorate([
        widget_registry_1.register,
        core_1.Component({
            selector: 'widget-changePassword',
            templateUrl: 'widget.changePassword.html'
        }), 
        __metadata('design:paramtypes', [core_1.Injector, widget_changePassword_service_1.ChangePasswordService])
    ], ChangePasswordWidget);
    return ChangePasswordWidget;
}());
Ejemplo n.º 14
0
var RoleSelectionComponent = (function () {
    function RoleSelectionComponent() {
        this.selectedRole = game_types_1.GameTypes.ClientRole.Intelligence;
    }
    RoleSelectionComponent.prototype.onSelectionChanged = function (source) {
        if (source == this._intelligenceElement) {
            this._operativesElement._isToggled = !this._intelligenceElement._isToggled;
        }
        else if (source == this._operativesElement) {
            this._intelligenceElement._isToggled = !this._operativesElement._isToggled;
        }
        this.selectedRole = this._intelligenceElement._isToggled
            ? game_types_1.GameTypes.ClientRole.Intelligence
            : game_types_1.GameTypes.ClientRole.Operatives;
    };
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Number)
    ], RoleSelectionComponent.prototype, "selectedRole", void 0);
    __decorate([
        core_1.ViewChild('_intelligenceButton'), 
        __metadata('design:type', Object)
    ], RoleSelectionComponent.prototype, "_intelligenceElement", void 0);
    __decorate([
        core_1.ViewChild('_operativesButton'), 
        __metadata('design:type', Object)
    ], RoleSelectionComponent.prototype, "_operativesElement", void 0);
    RoleSelectionComponent = __decorate([
        core_1.Component({
            selector: 'role-selection',
            directives: [toggle_button_component_1.ToggleButtonComponent],
            styles: [""],
            styleUrls: ['app/components/styles/colors.css',
                'app/components/styles/page.css',
                'app/components/styles/input.css',
                'app/components/styles/button.css',
                'app/components/styles/toggle-button.css',
                'app/components/title-page/title-page.css'
            ],
            template: "\n        <div>\n            <div class=\"toggle-button-container\">\n                <toggle-button #_intelligenceButton\n                    (onToggle)=\"onSelectionChanged($event)\"\n                    [_isToggled]=\"true\" [_colorClass]=\"'color-dark'\" [_colorToggledClass]=\"'color-base'\" [_backgroundClass]=\"'background-primary-hover'\">\n                    Intelligence\n                </toggle-button>\n                <toggle-button #_operativesButton\n                    (onToggle)=\"onSelectionChanged($event)\" \n                    [_isToggled]=\"false\" [_colorClass]=\"'color-dark'\" [_colorToggledClass]=\"'color-base'\" [_backgroundClass]=\"'background-primary-hover'\">\n                    Operatives\n                </toggle-button>\n            </div>\n        </div>\n    \n    ",
        }), 
        __metadata('design:paramtypes', [])
    ], RoleSelectionComponent);
    return RoleSelectionComponent;
}());
Ejemplo n.º 15
0
var LearnModalComponent = (function () {
    function LearnModalComponent(http, storageService) {
        this.http = http;
        this.storageService = storageService;
        this.saveQuery = new core_1.EventEmitter();
        this.newQuery = new core_1.EventEmitter();
        this.queries = [];
        this.subscribeOption = "major";
        this.profile = null;
        this.serverAddress = 'https://ossauth.appbase.io';
        this.updateStatus = this.updateStatus.bind(this);
    }
    LearnModalComponent.prototype.loadLearn = function () {
        var self = this;
        this.http.get('./app/shared/default.data.json').toPromise().then(function (res) {
            var data = res.json();
            data.queries.forEach(function (query) {
                self.saveQuery.emit(query);
            });
            setTimeout(function () {
                self.newQuery.emit(data.queries[0]);
            }, 500);
            $('#learnModal').modal('hide');
            $('#learnInfoModal').modal('show');
        }).catch(function (e) {
            console.log(e);
        });
    };
    LearnModalComponent.prototype.updateStatus = function (info) {
        this.profile = info.profile;
    };
    LearnModalComponent.prototype.subscribe = function () {
        this.authOperation.login(this.subscribeOption);
    };
    __decorate([
        core_1.Output(), 
        __metadata('design:type', Object)
    ], LearnModalComponent.prototype, "saveQuery", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', Object)
    ], LearnModalComponent.prototype, "newQuery", void 0);
    __decorate([
        core_1.ViewChild(AuthOperation_1.AuthOperation), 
        __metadata('design:type', AuthOperation_1.AuthOperation)
    ], LearnModalComponent.prototype, "authOperation", void 0);
    LearnModalComponent = __decorate([
        core_1.Component({
            selector: 'learn-modal',
            templateUrl: './app/features/learn/learn.component.html',
            inputs: ['saveQuery', 'newQuery']
        }), 
        __metadata('design:paramtypes', [http_1.Http, storage_service_1.StorageService])
    ], LearnModalComponent);
    return LearnModalComponent;
}());
Ejemplo n.º 16
0
var ListPage = (function () {
    function ListPage() {
        this.groceryList = [];
        this.grocery = "";
        this.localItem = new item_1.Item();
    }
    ListPage.prototype.ngOnInit = function () {
        this.groceryList.push({ name: "Apples" });
        this.groceryList.push({ name: "Bananas" });
        this.groceryList.push({ name: "Carrots" });
    };
    ListPage.prototype.add = function () {
        // Dismiss keyboard
        var textField = this.groceryTextField.nativeElement;
        textField.dismissSoftInput();
        if (this.grocery != "") {
            this.groceryList.push({ name: this.grocery });
            this.grocery = "";
        }
        else {
            alert("Type grocery item in the textfield to add to the list");
        }
    };
    ListPage.prototype.delete = function (item) {
        console.log("Delete method called with item" + item.name);
        if (item != "") {
            var index = this.groceryList.indexOf(item);
            if (index >= 0) {
                this.groceryList.splice(index, 1);
            }
        }
    };
    ListPage.prototype.share = function () {
        var list = [];
        for (var i = 0, size = this.groceryList.length; i < size; i++) {
            this.localItem = this.groceryList[i];
            list.push(this.localItem.name);
        }
        var listString = list.join(", ").trim();
        console.log(listString);
        socialShare.shareText(listString);
    };
    __decorate([
        core_1.ViewChild("groceryTextField"), 
        __metadata('design:type', core_1.ElementRef)
    ], ListPage.prototype, "groceryTextField", void 0);
    ListPage = __decorate([
        core_1.Component({
            selector: "List",
            templateUrl: "pages/list/list.html",
            styleUrls: ["pages/list/list-common.css", "pages/list/list.css"]
        }), 
        __metadata('design:paramtypes', [])
    ], ListPage);
    return ListPage;
}());
Ejemplo n.º 17
0
var QuotePage = (function () {
    function QuotePage(quoteService) {
        this.quoteService = quoteService;
        this.mainCategories = [];
    }
    QuotePage.prototype.ngOnInit = function () {
        //here, we will have a master Category, that has Children (of categories), and for each Child, we will have more categories, and finally Parts
        this.mainCategories = this.category.rows;
    };
    QuotePage.prototype.saveQuantity = function (event, inputEl, column, part) {
        if (part.quantity != null) {
            part.total = part.quantity * part.msrp;
        }
        this.dataTableComponent.onEditComplete.emit({ column: column, data: part });
        this.close(event, inputEl);
        this.quoteService.emitQuoteChange(this.wrapIntoCategoryWithParts());
    };
    QuotePage.prototype.wrapIntoCategoryWithParts = function () {
        return {
            category: this.category.categoryId,
            categoryName: this.category.name,
            parts: this.mainCategories
        };
    };
    QuotePage.prototype.close = function (event, inputEl) {
        var _this = this;
        this.dataTableComponent.renderer.invokeElementMethod(inputEl, 'blur');
        this.dataTableComponent.switchCellToViewMode(event.target);
        setTimeout(function (x) { return _this.dataTableComponent.editingCell = null; }, 0);
        event.preventDefault();
    };
    QuotePage.prototype.reset = function () {
        this.mainCategories.forEach(function (mc) {
            mc.quantity = null;
            mc.total = null;
        });
        this.quoteService.emitQuoteChange(this.wrapIntoCategoryWithParts());
    };
    __decorate([
        core_1.ViewChild(primeng_1.DataTable), 
        __metadata('design:type', primeng_1.DataTable)
    ], QuotePage.prototype, "dataTableComponent", void 0);
    __decorate([
        core_1.Input(), 
        __metadata('design:type', Object)
    ], QuotePage.prototype, "category", void 0);
    QuotePage = __decorate([
        core_1.Component({
            selector: 'quote-page',
            templateUrl: './quote.page.html',
            styles: [String(require('./quote.page.css'))]
        }), 
        __metadata('design:paramtypes', [quote_service_1.QuoteService])
    ], QuotePage);
    return QuotePage;
}());
var AppComponent = (function () {
    function AppComponent(componentResolver) {
        this.componentResolver = componentResolver;
        this.v = 0;
        this.isViewInitialized = false;
    }
    AppComponent.prototype.updateComponent = function () {
        var _this = this;
        setInterval(function () {
            if (!_this.isViewInitialized) {
                return;
            }
            if (_this.cmpRef) {
                _this.cmpRef.destroy();
            }
            if (_this.v % 2 == 0) {
                _this.componentResolver.resolveComponent(ChildComponent1).then(function (factory) {
                    _this.cmpRef = _this.target.createComponent(factory);
                    _this.cmpRef.instance.content = "UNO!!";
                });
            }
            else {
                _this.componentResolver.resolveComponent(ChildComponent2).then(function (factory) {
                    _this.cmpRef = _this.target.createComponent(factory);
                    _this.cmpRef.instance.content = "DOS!!";
                });
            }
            _this.v++;
        }, 1000);
    };
    AppComponent.prototype.ngOnChanges = function () {
        this.updateComponent();
    };
    AppComponent.prototype.ngAfterViewInit = function () {
        this.isViewInitialized = true;
        this.updateComponent();
    };
    AppComponent.prototype.ngOnDestroy = function () {
        if (this.cmpRef) {
            this.cmpRef.destroy();
        }
    };
    __decorate([
        core_1.ViewChild('target', { read: core_1.ViewContainerRef }), 
        __metadata('design:type', Object)
    ], AppComponent.prototype, "target", void 0);
    AppComponent = __decorate([
        core_1.Component({
            selector: 'my-app',
            template: '<div #target></div>'
        }), 
        __metadata('design:paramtypes', [core_1.ComponentResolver])
    ], AppComponent);
    return AppComponent;
}());
Ejemplo n.º 19
0
var LoginComponent = (function () {
    function LoginComponent(_page, _userService) {
        this._page = _page;
        this._userService = _userService;
        this.isTabbed = true;
        this.user = new user_1.User();
    }
    LoginComponent.prototype.signIn = function () {
        if (this.user.validateUser("signIn")) {
            this._userService.signIn(this.user);
        }
        else {
            alert("please provide valid details.");
        }
    };
    LoginComponent.prototype.toggelTab = function (btn) {
        this.newUser = new user_1.User();
        this.isTabbed = (btn === 0) ? true : false;
        var container = this.container.nativeElement;
        container.animate({
            backgroundColor: this.isTabbed ? new color_1.Color("#996666") : new color_1.Color("#854747"),
            duration: 200
        });
    };
    LoginComponent.prototype.submitUserInfo = function () {
        if (this.newUser.validateUser("signUp")) {
            this._userService.register(this.newUser).subscribe(function () {
                alert("Your account was successfully created.");
                // this.toggleDisplay();
            }, function () { return alert("Unfortunately we were unable to create your account."); });
        }
        else {
            alert("please provide valid details.");
        }
    };
    LoginComponent.prototype.ngOnInit = function () {
        this._page.actionBarHidden = true;
        this._page.backgroundColor = new color_1.Color("#996666");
        //   this._page.backgroundImage = this._page.ios ? "res://bg_login.jpg" : "res://bg_login";
    };
    __decorate([
        core_1.ViewChild("container"), 
        __metadata('design:type', core_1.ElementRef)
    ], LoginComponent.prototype, "container", void 0);
    LoginComponent = __decorate([
        core_1.Component({
            selector: "login",
            providers: [user_service_1.UserService],
            templateUrl: "./components/login/login.html",
            styleUrls: ["./components/login/login.css"]
        }), 
        __metadata('design:paramtypes', [page_1.Page, user_service_1.UserService])
    ], LoginComponent);
    return LoginComponent;
}());
var networkGraph = (function () {
    function networkGraph() {
    }
    networkGraph.prototype.ngOnInit = function () {
        var color = d3.scale.category20();
        this.options = {
            chart: {
                type: 'forceDirectedGraph',
                height: 400,
                width: 600,
                margin: { top: 20, right: 20, bottom: 20, left: 0 },
                radius: 15,
                linkDist: 400,
                color: function (d) {
                    return color(d.group);
                },
                nodeExtras: function (node) {
                    node && node
                        .append("text")
                        .attr("dx", 20)
                        .attr("dy", ".35em")
                        .text(function (d) { return d.name; })
                        .style('font-size', '15px')
                        .style('fill', 'white');
                }
            }
        };
        this.data = { "nodes": [
                { "name": "Load Balancer", "group": 1 },
                { "name": "Client", "group": 2 },
                { "name": "Server 1", "group": 3 },
                { "name": "Server 2", "group": 3 }
            ],
            "links": [
                { "source": 1, "target": 0, "value": 10 },
                { "source": 2, "target": 0, "value": 2 },
                { "source": 3, "target": 0, "value": 2 }
            ]
        };
    };
    __decorate([
        core_1.ViewChild(ng2_nvd3_1.nvD3), 
        __metadata('design:type', ng2_nvd3_1.nvD3)
    ], networkGraph.prototype, "nvD3", void 0);
    networkGraph = __decorate([
        core_1.Component({
            selector: 'networkGraph',
            directives: [ng2_nvd3_1.nvD3],
            templateUrl: './client/app/components/graphs/networkGraph/networkGraph.component.html'
        }), 
        __metadata('design:paramtypes', [])
    ], networkGraph);
    return networkGraph;
}());
var ConfigurationPageComponent = (function () {
    function ConfigurationPageComponent(router, configuration) {
        this.router = router;
        this.configuration = configuration;
    }
    ConfigurationPageComponent.prototype.onBeginGame = function () {
        this.configuration._missionName = this._missionName._inputText;
        this.configuration._localRole = this._roleSelection.selectedRole;
        this.configuration.startTeam = this._agencySelection.selectedAgency;
        this.router.navigate([model_1.StateNames.game]);
    };
    __decorate([
        core_1.ViewChild('_missionName'), 
        __metadata('design:type', input_component_1.InputComponent)
    ], ConfigurationPageComponent.prototype, "_missionName", void 0);
    __decorate([
        core_1.ViewChild('_roleSelection'), 
        __metadata('design:type', role_selection_component_1.RoleSelectionComponent)
    ], ConfigurationPageComponent.prototype, "_roleSelection", void 0);
    __decorate([
        core_1.ViewChild('_agencySelection'), 
        __metadata('design:type', agency_selection_component_1.AgencySelectionComponent)
    ], ConfigurationPageComponent.prototype, "_agencySelection", void 0);
    ConfigurationPageComponent = __decorate([
        core_1.Component({
            selector: 'configuration-page',
            directives: [title_component_1.TitleComponent, input_component_1.InputComponent, role_selection_component_1.RoleSelectionComponent, agency_selection_component_1.AgencySelectionComponent],
            styleUrls: ['app/components/styles/colors.css',
                'app/components/styles/page.css',
                'app/components/styles/input.css',
                'app/components/styles/button.css',
                'app/components/styles/layout.css',
                'app/components/title-page/title-page.css'
            ],
            templateUrl: "app/components/configuration-page/configuration-page.html",
        }), 
        __metadata('design:paramtypes', [router_deprecated_1.Router, model_1.Configuration])
    ], ConfigurationPageComponent);
    return ConfigurationPageComponent;
}());
Ejemplo n.º 22
0
var PlayersComponent = (function () {
    function PlayersComponent() {
        this.players = new Array();
        this.playersReady = new core_1.EventEmitter();
    }
    PlayersComponent.prototype.ngAfterViewInit = function () {
        this.inputElement.nativeElement.focus();
    };
    PlayersComponent.prototype.addPlayer = function (name) {
        if (!name.length) {
            this.createMatches();
            return;
        }
        ;
        this.players.push({ name: name });
        this.inputElement.nativeElement.value = '';
        this.inputElement.nativeElement.focus();
    };
    PlayersComponent.prototype.removePlayer = function (player) {
        console.log('player remove', player);
        var index = this.players.indexOf(player);
        if (index !== undefined) {
            this.players.splice(index, 1);
        }
        this.inputElement.nativeElement.focus();
    };
    PlayersComponent.prototype.createMatches = function () {
        if (this.players.length < 3) {
            return;
        }
        this.playersReady.next(this.players);
    };
    __decorate([
        core_1.ViewChild('newPlayer'), 
        __metadata('design:type', core_1.ElementRef)
    ], PlayersComponent.prototype, "inputElement", void 0);
    __decorate([
        core_1.Output(), 
        __metadata('design:type', core_1.EventEmitter)
    ], PlayersComponent.prototype, "playersReady", void 0);
    PlayersComponent = __decorate([
        core_1.Component({
            selector: 'players',
            template: "\n        <div *ngFor=\"let player of players\">{{ player.name }}&nbsp;<button type=\"button\" (click)=\"removePlayer(player)\">X</button></div>\n        <div><input #newPlayer type=\"text\" (keyup.enter)=\"addPlayer(newPlayer.value)\"><button type=\"button\" \n        (click)=\"addPlayer(newPlayer.value)\">ADD</button></div>\n        <div><button type=\"button\" (click)=\"createMatches()\">GO</button></div>\n    "
        }), 
        __metadata('design:paramtypes', [])
    ], PlayersComponent);
    return PlayersComponent;
}());
var ScrollPastFixed = (function () {
    function ScrollPastFixed(ElementRef) {
        this.ElementRef = ElementRef;
    }
    ScrollPastFixed.prototype.getReadElement = function () {
        var children = this.ElementRef.nativeElement.children;
        return children[children.length - 2];
    };
    ScrollPastFixed.prototype.init = function () {
        var _this = this;
        this.onScroll = function () { return _this.check(); };
        window.addEventListener("scroll", this.onScroll);
        this.onScroll();
    };
    ScrollPastFixed.prototype.ngAfterViewInit = function () {
        var _this = this;
        Promise.resolve().then(function () { return _this.init(); });
    };
    ScrollPastFixed.prototype.check = function () {
        var scrollPos = window['pageYOffset'];
        if (this.placeholder && this.placeholder <= scrollPos) {
            return;
        }
        var elm = this.getReadElement();
        var offsetTop = this.placeholder || getDistanceFromTop(elm);
        if (offsetTop <= scrollPos) {
            this.currentPosition = 'fixed';
            this.placeholder = offsetTop;
            this.fillHeight = elm.offsetHeight;
        }
        else {
            delete this.fillHeight;
            delete this.placeholder;
            delete this.currentPosition;
        }
    };
    __decorate([
        core_1.ViewChild('template'),
        __metadata("design:type", core_1.TemplateRef)
    ], ScrollPastFixed.prototype, "template", void 0);
    ScrollPastFixed = __decorate([
        core_1.Component({
            selector: 'scroll-past-fixed',
            template: scroll_past_fixed_pug_1.string
        }),
        __metadata("design:paramtypes", [core_1.ElementRef])
    ], ScrollPastFixed);
    return ScrollPastFixed;
}());
var ConnectedOverlayDirectiveTest = (function () {
    function ConnectedOverlayDirectiveTest() {
    }
    __decorate([
        core_1.ViewChild(overlay_directives_1.ConnectedOverlayDirective), 
        __metadata('design:type', overlay_directives_1.ConnectedOverlayDirective)
    ], ConnectedOverlayDirectiveTest.prototype, "connectedOverlayDirective", void 0);
    ConnectedOverlayDirectiveTest = __decorate([
        core_1.Component({
            template: "\n  <button overlay-origin #trigger=\"overlayOrigin\">Toggle menu</button>\n  <template connected-overlay [origin]=\"trigger\">\n    <p>Menu content</p>\n  </template>",
            directives: [overlay_directives_1.ConnectedOverlayDirective, overlay_directives_1.OverlayOrigin],
        }), 
        __metadata('design:paramtypes', [])
    ], ConnectedOverlayDirectiveTest);
    return ConnectedOverlayDirectiveTest;
}());
var DashboardComponent = (function () {
    function DashboardComponent(userService) {
        this.userService = userService;
    }
    DashboardComponent.prototype.ngOnInit = function () {
        this.allUsers = this.userService.getAllUsers();
        this.activeUser = this.allUsers[0];
        console.log(this.allUsers);
    };
    DashboardComponent.prototype.ngAfterViewInit = function () {
        jQuery('.dropdown-button').dropdown({
            inDuration: 300,
            outDuration: 225,
            constrain_width: false,
            hover: true,
            gutter: 0,
            belowOrigin: false,
            alignment: 'left'
        });
        jQuery(document).ready(function () {
            jQuery('.modal-trigger').leanModal();
        });
        jQuery('#splashScreenModal').openModal();
    };
    DashboardComponent.prototype.setActiveUser = function (sender) {
        this.activeUser = sender;
    };
    DashboardComponent.prototype.sendMessage = function () {
        console.log(this.activeUser.name);
        this.conversation.newMessageAlert(this.messageText, this.activeUser);
        this.messageText = '';
    };
    __decorate([
        core_1.ViewChild(conversation_component_1.Conversation), 
        __metadata('design:type', conversation_component_1.Conversation)
    ], DashboardComponent.prototype, "conversation", void 0);
    DashboardComponent = __decorate([
        core_1.Component({
            selector: 'my-app',
            templateUrl: 'app/components/dashboard/dashboard.html',
            directives: [conversation_component_1.Conversation],
            pipes: [searchUser_pipe_1.SearchUserPipe]
        }), 
        __metadata('design:paramtypes', [IUserService_service_1.IUserService])
    ], DashboardComponent);
    return DashboardComponent;
}());
Ejemplo n.º 26
0
var SBItemBody = /** @class */ (function () {
    function SBItemBody(renderer) {
        this.renderer = renderer;
    }
    SBItemBody.prototype.ngAfterViewInit = function () {
        var _this = this;
        var el = this.bodyEl.nativeElement;
        el.addEventListener('transitionend', function (e) {
            // check transition ended, so can use regular height if not expanded
            if (el.offsetHeight !== 0) {
                _this.setHeight('auto');
            }
        }, false);
    };
    SBItemBody.prototype.toggle = function (collapsed) {
        var _this = this;
        var height = '0';
        var el = this.bodyEl.nativeElement;
        this.setHeight('auto');
        height = el.offsetHeight + 'px';
        if (!collapsed) {
            this.setHeight('0');
        }
        else {
            this.setHeight(height);
            height = '0';
        }
        setTimeout(function () { return _this.setHeight(height); }, 50);
    };
    SBItemBody.prototype.setHeight = function (height) {
        var el = this.bodyEl.nativeElement;
        this.renderer.setElementStyle(el, 'height', height);
    };
    __decorate([
        core_1.ViewChild('body'),
        __metadata("design:type", core_1.ElementRef)
    ], SBItemBody.prototype, "bodyEl", void 0);
    SBItemBody = __decorate([
        core_1.Component({
            exportAs: 'sbItemBody',
            selector: 'sb-item-body',
            template: "\n        <div #body class=\"sb-item-body\" style=\"height: 0;\">\n            <div class=\"inner\"><ng-content></ng-content></div>\n        </div>\n    "
        }),
        __metadata("design:paramtypes", [core_1.Renderer])
    ], SBItemBody);
    return SBItemBody;
}());
var DemoComponent = (function () {
    function DemoComponent() {
        this.date = new Date();
    }
    __decorate([
        core_1.ViewChild('dt'), 
        __metadata('design:type', ng2_datetime_1.NKDatetime)
    ], DemoComponent.prototype, "dt", void 0);
    DemoComponent = __decorate([
        core_1.Component({
            directives: [ng2_datetime_1.NKDatetime],
            template: "<datetime #dt [(ngModel)]=\"date\"></datetime>"
        }), 
        __metadata('design:paramtypes', [])
    ], DemoComponent);
    return DemoComponent;
}());
Ejemplo n.º 28
0
var TestComponentWithTemplatePortals = (function () {
    function TestComponentWithTemplatePortals(viewContainerRef) {
        this.viewContainerRef = viewContainerRef;
    }
    __decorate([
        core_1.ViewChild(portal_directives_1.TemplatePortalDirective), 
        __metadata('design:type', portal_directives_1.TemplatePortalDirective)
    ], TestComponentWithTemplatePortals.prototype, "templatePortal", void 0);
    TestComponentWithTemplatePortals = __decorate([
        core_1.Component({
            selector: 'portal-test',
            template: "<template portal>Cake</template>",
            directives: [portal_directives_1.TemplatePortalDirective],
        }), 
        __metadata('design:paramtypes', [core_1.ViewContainerRef])
    ], TestComponentWithTemplatePortals);
    return TestComponentWithTemplatePortals;
}());
Ejemplo n.º 29
0
var RippleDemo = (function () {
    function RippleDemo() {
        this.centered = false;
        this.disabled = false;
        this.unbounded = false;
        this.rounded = false;
        this.maxRadius = null;
        this.rippleSpeed = 1;
        this.rippleColor = '';
        this.rippleBackgroundColor = '';
    }
    RippleDemo.prototype.doManualRipple = function () {
        var _this = this;
        if (this.manualRipple) {
            window.setTimeout(function () { return _this.manualRipple.start(); }, 10);
            window.setTimeout(function () { return _this.manualRipple.end(0, 0); }, 500);
        }
    };
    __decorate([
        core_1.ViewChild(core_2.MdRipple), 
        __metadata('design:type', core_2.MdRipple)
    ], RippleDemo.prototype, "manualRipple", void 0);
    RippleDemo = __decorate([
        core_1.Component({
            moduleId: module.id,
            selector: 'ripple-demo',
            templateUrl: 'ripple-demo.html',
            styleUrls: ['ripple-demo.css'],
            providers: [unique_selection_dispatcher_1.MdUniqueSelectionDispatcher],
            directives: [
                button_1.MD_BUTTON_DIRECTIVES,
                card_1.MD_CARD_DIRECTIVES,
                checkbox_1.MD_CHECKBOX_DIRECTIVES,
                icon_1.MD_ICON_DIRECTIVES,
                input_1.MD_INPUT_DIRECTIVES,
                radio_1.MD_RADIO_DIRECTIVES,
                core_2.MD_RIPPLE_DIRECTIVES,
            ],
        }), 
        __metadata('design:paramtypes', [])
    ], RippleDemo);
    return RippleDemo;
}());
Ejemplo n.º 30
0
var AppComponent = (function () {
    function AppComponent() {
    }
    AppComponent.prototype.ngAfterViewInit = function () {
        this.initMenu(this.ul.nativeElement);
    };
    AppComponent.prototype.initMenu = function (SIDEBAR_MENU) {
        $(SIDEBAR_MENU).find('a').on('click', function (ev) {
            var $li = $(this).parent();
            if ($li.is('.active')) {
                $li.removeClass('active active-sm');
                $('ul:first', $li).slideUp(function () {
                    // setContentHeight();
                });
            }
            else {
                // prevent closing menu if we are on child menu
                if (!$li.parent().is('.child_menu')) {
                    $(SIDEBAR_MENU).find('li ul').slideUp();
                }
                $(SIDEBAR_MENU).find('li').removeClass('active active-sm');
                $li.addClass('active');
                $('ul:first', $li).slideDown(function () {
                    // setContentHeight();
                });
            }
        });
    };
    ;
    __decorate([
        core_1.ViewChild('sideMenu'), 
        __metadata('design:type', core_1.ElementRef)
    ], AppComponent.prototype, "ul", void 0);
    AppComponent = __decorate([
        core_1.Component({
            selector: 'my-app',
            templateUrl: 'app/view/navigation/navigation.html',
            directives: [router_1.ROUTER_DIRECTIVES]
        }), 
        __metadata('design:paramtypes', [])
    ], AppComponent);
    return AppComponent;
}());