This commit is contained in:
Nicolas Constant 2018-12-12 00:10:25 -05:00
parent 74a8dd21f1
commit c7b256b16f
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 2 additions and 48 deletions

View File

@ -1,11 +1,7 @@
import { Component, OnInit, Input, Output, Inject, LOCALE_ID, ElementRef, EventEmitter, Pipe, PipeTransform, ViewChild, Renderer2 } from "@angular/core"; import { Component, OnInit, Input, Output, EventEmitter } from "@angular/core";
import { Status, Account } from "../../../services/models/mastodon.interfaces"; import { Status, Account } from "../../../services/models/mastodon.interfaces";
import { formatDate } from '@angular/common';
import { stateNameErrorMessage } from "@ngxs/store/src/decorators/state";
import { StatusWrapper } from "../stream.component"; import { StatusWrapper } from "../stream.component";
import { DomSanitizer } from '@angular/platform-browser'
@Component({ @Component({
selector: "app-status", selector: "app-status",
templateUrl: "./status.component.html", templateUrl: "./status.component.html",
@ -28,10 +24,6 @@ export class StatusComponent implements OnInit {
this._statusWrapper = value; this._statusWrapper = value;
this.status = value.status; this.status = value.status;
//TEST
//this.status.content += '<br/><br/><a href class="test">TEST</a>';
if (this.status.reblog) { if (this.status.reblog) {
this.reblog = true; this.reblog = true;
this.displayedStatus = this.status.reblog; this.displayedStatus = this.status.reblog;
@ -46,31 +38,16 @@ export class StatusComponent implements OnInit {
if (this.displayedStatus.media_attachments && this.displayedStatus.media_attachments.length > 0) { if (this.displayedStatus.media_attachments && this.displayedStatus.media_attachments.length > 0) {
this.hasAttachments = true; this.hasAttachments = true;
} }
} }
get statusWrapper(): StatusWrapper { get statusWrapper(): StatusWrapper {
return this._statusWrapper; return this._statusWrapper;
} }
constructor() { }
constructor(@Inject(LOCALE_ID) private locale: string) { }
ngOnInit() { ngOnInit() {
} }
// ngAfterViewInit() {
// let el = this.contentElement.nativeElement.querySelector('.test');
// console.log(this.contentElement.nativeElement);
// console.log(el);
// if (el)
// this.renderer.listen(el, 'click', (el2) => {
// console.log(el2);
// console.warn('YOOOOO');
// return false;
// });
// }
openAccount(account: Account): boolean { openAccount(account: Account): boolean {
let accountName = account.acct; let accountName = account.acct;
if(!accountName.includes('@')) if(!accountName.includes('@'))
@ -80,24 +57,6 @@ export class StatusComponent implements OnInit {
return false; return false;
} }
// getCompactRelativeTime(d: string): string {
// const date = (new Date(d)).getTime();
// const now = Date.now();
// const timeDelta = (now - date) / (1000);
// if (timeDelta < 60) {
// return `${timeDelta | 0}s`;
// } else if (timeDelta < 60 * 60) {
// return `${timeDelta / 60 | 0}m`;
// } else if (timeDelta < 60 * 60 * 24) {
// return `${timeDelta / (60 * 60) | 0}h`;
// } else if (timeDelta < 60 * 60 * 24 * 31) {
// return `${timeDelta / (60 * 60 * 24) | 0}d`;
// }
// return formatDate(date, 'MM/dd', this.locale);
// }
openReply(): boolean { openReply(): boolean {
this.replyingToStatus = !this.replyingToStatus; this.replyingToStatus = !this.replyingToStatus;
@ -109,11 +68,6 @@ export class StatusComponent implements OnInit {
return false; return false;
} }
// test(): boolean {
// console.warn('heeeeyaaa!');
// return false;
// }
accountSelected(accountName: string): void { accountSelected(accountName: string): void {
console.warn(`status comp: accountSelected ${accountName}`); console.warn(`status comp: accountSelected ${accountName}`);
this.browseAccount.next(accountName); this.browseAccount.next(accountName);