You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sfh-mohemm/Mohem/src/app/notification-center/notification-detail/detail.component.ts

79 lines
2.9 KiB
TypeScript

import { Component, OnInit } from '@angular/core';
import { NotificationModel } from 'src/app/hmg-common/services/push/models/notification.model';
import { TranslatorService } from 'src/app/hmg-common/services/translator/translator.service';
import { SharedDataService } from 'src/app/hmg-common/services/shared-data-service/shared-data.service';
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
// import { NotificationsCenterService } from '../service/notifications-center.service';
import { Route, Router, ActivatedRoute, ActivationEnd } from '@angular/router';
import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';
@Component({
selector: 'app-detail',
templateUrl: './detail.component.html',
styleUrls: ['./detail.component.scss']
})
export class DetailComponent implements OnInit {
public notification: NotificationModel;
public video_link: string;
public trustedVideoUrl: SafeResourceUrl;
public direction: any;
public data: any;
constructor(
public cs: CommonService,
public ts: TranslatorService,
public sharedData: SharedDataService,
// public notifyService: NotificationsCenterService,
public router: Router,
private domSanitizer: DomSanitizer,
public route: ActivatedRoute
) {
}
ngOnInit() {
this.direction = TranslatorService.getCurrentDirection();
this.data = this.sharedData.getSharedData(NotificationModel.SHARED_DATA, true);
}
// this.initialize();
// if (this.notification.MessageType == "image") {
// }
// if (this.notification.MessageType == "video") {
// var url = this.notification.MessageTypeData;
// var v_id = url.substr(url.lastIndexOf("?v=") + 3, url.length);
// this.trustedVideoUrl = this.domSanitizer.bypassSecurityTrustResourceUrl("https://www.youtube.com/embed/" + v_id);
// }
// else {
// }
// }
// private initialize() {
// // this.notifyService.decreaseBadgeCount();
// this.notification = this.sharedData.getSharedData(NotificationModel.SHARED_DATA, true);
// if (!this.notification) {
// this.cs.back();
// }
// if (this.notification.MessageType == "image") {
// }
// if (this.notification.MessageType == "video") {
// var url = this.notification.MessageTypeData;
// var v_id = url.substr(url.lastIndexOf("?v=") + 3, url.length);
// this.trustedVideoUrl = this.domSanitizer.bypassSecurityTrustResourceUrl("https://www.youtube.com/embed/" + v_id);
// } else {
// }
// }
// public isHtml5VideoSupported(): boolean {
// return this.cs.isHtml5VideoSupported();
// }
// public playNativeVideo() {
// this.cs.openBrowser(this.notification.MessageTypeData);
// }
}