# 이슈처리 271

linky 링크시 style 적용.
This commit is contained in:
leejinho 2020-02-26 11:03:42 +09:00
parent e0a7bf2a03
commit 3aa1c4db8e
8 changed files with 145 additions and 17 deletions

View File

@ -14,7 +14,7 @@
<perfect-scrollbar> <perfect-scrollbar>
<p <p
[innerHTML]="data.contents | linefeedtohtml | linky" [innerHTML]="data.contents | linefeedtohtml | linky"
class="contnets" class="contents"
></p> ></p>
</perfect-scrollbar> </perfect-scrollbar>
</mat-card-content> </mat-card-content>

View File

@ -11,7 +11,12 @@
} }
} }
.contnets { .contents {
max-height: 500px; max-height: 500px;
word-break: break-word; word-break: break-word;
::ng-deep a {
color: #0367a6 !important;
text-decoration: underline !important;
}
} }

View File

@ -1,6 +1,14 @@
import { Component, OnInit, Inject, OnDestroy } from '@angular/core'; import {
Component,
OnInit,
Inject,
OnDestroy,
AfterViewInit,
ElementRef
} from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { NoticeList } from '@ucap-webmessenger/api-message'; import { NoticeList } from '@ucap-webmessenger/api-message';
import { UCAP_NATIVE_SERVICE, NativeService } from '@ucap-webmessenger/native';
export interface NoticeDetailDialogData { export interface NoticeDetailDialogData {
notice: NoticeList; notice: NoticeList;
@ -13,17 +21,38 @@ export interface NoticeDetailDialogResult {}
templateUrl: './notice-detail.dialog.component.html', templateUrl: './notice-detail.dialog.component.html',
styleUrls: ['./notice-detail.dialog.component.scss'] styleUrls: ['./notice-detail.dialog.component.scss']
}) })
export class NoticeDetailDialogComponent implements OnInit, OnDestroy { export class NoticeDetailDialogComponent
implements OnInit, OnDestroy, AfterViewInit {
constructor( constructor(
public dialogRef: MatDialogRef< public dialogRef: MatDialogRef<
NoticeDetailDialogData, NoticeDetailDialogData,
NoticeDetailDialogResult NoticeDetailDialogResult
>, >,
@Inject(MAT_DIALOG_DATA) public data: NoticeDetailDialogData @Inject(MAT_DIALOG_DATA) public data: NoticeDetailDialogData,
private elementRef: ElementRef,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
) {} ) {}
ngOnInit() {} ngOnInit() {}
ngAfterViewInit(): void {
if (
!!this.elementRef.nativeElement &&
!!this.elementRef.nativeElement.querySelector('a')
) {
const elements = this.elementRef.nativeElement.querySelectorAll('a');
elements.forEach(element => {
element.addEventListener('click', this.onClickEvent.bind(this));
});
}
}
onClickEvent(event: MouseEvent) {
this.nativeService.openDefaultBrowser(
(event.target as HTMLAnchorElement).text
);
}
ngOnDestroy(): void {} ngOnDestroy(): void {}
onClickConfirm(): void { onClickConfirm(): void {

View File

@ -1,4 +1,4 @@
<div class="translation-main"> <div class="bubble-main translation-main">
<div <div
*ngIf="!translationSimpleview || (!!translationSimpleview && !!isMe)" *ngIf="!translationSimpleview || (!!translationSimpleview && !!isMe)"
class="original" class="original"

View File

@ -1,16 +1,26 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import {
Component,
OnInit,
Input,
Output,
EventEmitter,
AfterViewInit,
ElementRef,
Inject
} from '@angular/core';
import { import {
TranslationEventJson, TranslationEventJson,
Info, Info,
MassTranslationEventJson MassTranslationEventJson
} from '@ucap-webmessenger/protocol-event'; } from '@ucap-webmessenger/protocol-event';
import { UCAP_NATIVE_SERVICE, NativeService } from '@ucap-webmessenger/native';
@Component({ @Component({
selector: 'ucap-chat-message-box-mass-translation', selector: 'ucap-chat-message-box-mass-translation',
templateUrl: './mass-translation.component.html', templateUrl: './mass-translation.component.html',
styleUrls: ['./mass-translation.component.scss'] styleUrls: ['./mass-translation.component.scss']
}) })
export class MassTranslationComponent implements OnInit { export class MassTranslationComponent implements OnInit, AfterViewInit {
@Input() @Input()
message: Info<MassTranslationEventJson>; message: Info<MassTranslationEventJson>;
@ -32,10 +42,31 @@ export class MassTranslationComponent implements OnInit {
type: string; type: string;
}>(); }>();
constructor() {} constructor(
private elementRef: ElementRef,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
) {}
ngOnInit() {} ngOnInit() {}
ngAfterViewInit(): void {
if (
!!this.elementRef.nativeElement &&
!!this.elementRef.nativeElement.querySelector('a')
) {
const elements = this.elementRef.nativeElement.querySelectorAll('a');
elements.forEach(element => {
element.addEventListener('click', this.onClickEvent.bind(this));
});
}
}
onClickEvent(event: MouseEvent) {
this.nativeService.openDefaultBrowser(
(event.target as HTMLAnchorElement).text
);
}
onClickMassDetail(contentsType: string) { onClickMassDetail(contentsType: string) {
this.massTranslationDetail.emit({ this.massTranslationDetail.emit({
message: this.message, message: this.message,

View File

@ -1,15 +1,25 @@
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; import {
Component,
OnInit,
Input,
Output,
EventEmitter,
ElementRef,
AfterViewInit,
Inject
} from '@angular/core';
import { Info, MassTextEventJson } from '@ucap-webmessenger/protocol-event'; import { Info, MassTextEventJson } from '@ucap-webmessenger/protocol-event';
import { NGXLogger } from 'ngx-logger'; import { NGXLogger } from 'ngx-logger';
import { StatusCode } from '@ucap-webmessenger/api'; import { StatusCode } from '@ucap-webmessenger/api';
import moment from 'moment'; import moment from 'moment';
import { NativeService, UCAP_NATIVE_SERVICE } from '@ucap-webmessenger/native';
@Component({ @Component({
selector: 'ucap-chat-message-box-mass', selector: 'ucap-chat-message-box-mass',
templateUrl: './mass.component.html', templateUrl: './mass.component.html',
styleUrls: ['./mass.component.scss'], styleUrls: ['./mass.component.scss']
}) })
export class MassComponent implements OnInit { export class MassComponent implements OnInit, AfterViewInit {
@Input() @Input()
message: Info<MassTextEventJson>; message: Info<MassTextEventJson>;
@ -22,7 +32,11 @@ export class MassComponent implements OnInit {
moment = moment; moment = moment;
constructor(private logger: NGXLogger) {} constructor(
private logger: NGXLogger,
private elementRef: ElementRef,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
) {}
ngOnInit() { ngOnInit() {
try { try {
@ -45,6 +59,24 @@ export class MassComponent implements OnInit {
} }
} }
ngAfterViewInit(): void {
if (
!!this.elementRef.nativeElement &&
!!this.elementRef.nativeElement.querySelector('a')
) {
const elements = this.elementRef.nativeElement.querySelectorAll('a');
elements.forEach(element => {
element.addEventListener('click', this.onClickEvent.bind(this));
});
}
}
onClickEvent(event: MouseEvent) {
this.nativeService.openDefaultBrowser(
(event.target as HTMLAnchorElement).text
);
}
onClickDetailView() { onClickDetailView() {
this.massDetail.emit(this.eventMassSeq); this.massDetail.emit(this.eventMassSeq);
} }

View File

@ -1,4 +1,4 @@
<div class="translation-main"> <div class="bubble-main translation-main">
<div <div
*ngIf=" *ngIf="
!!this.message.sentMessageJson && !!this.message.sentMessageJson &&

View File

@ -1,12 +1,22 @@
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import {
Component,
OnInit,
Input,
EventEmitter,
Output,
AfterViewInit,
ElementRef,
Inject
} from '@angular/core';
import { Info, TranslationEventJson } from '@ucap-webmessenger/protocol-event'; import { Info, TranslationEventJson } from '@ucap-webmessenger/protocol-event';
import { UCAP_NATIVE_SERVICE, NativeService } from '@ucap-webmessenger/native';
@Component({ @Component({
selector: 'ucap-chat-message-box-translation', selector: 'ucap-chat-message-box-translation',
templateUrl: './translation.component.html', templateUrl: './translation.component.html',
styleUrls: ['./translation.component.scss'] styleUrls: ['./translation.component.scss']
}) })
export class TranslationComponent implements OnInit { export class TranslationComponent implements OnInit, AfterViewInit {
@Input() @Input()
message: Info<TranslationEventJson>; message: Info<TranslationEventJson>;
@ -24,7 +34,10 @@ export class TranslationComponent implements OnInit {
stickerUrl?: string; stickerUrl?: string;
constructor() {} constructor(
private elementRef: ElementRef,
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService
) {}
ngOnInit() { ngOnInit() {
if ( if (
@ -36,6 +49,24 @@ export class TranslationComponent implements OnInit {
} }
} }
ngAfterViewInit(): void {
if (
!!this.elementRef.nativeElement &&
!!this.elementRef.nativeElement.querySelector('a')
) {
const elements = this.elementRef.nativeElement.querySelectorAll('a');
elements.forEach(element => {
element.addEventListener('click', this.onClickEvent.bind(this));
});
}
}
onClickEvent(event: MouseEvent) {
this.nativeService.openDefaultBrowser(
(event.target as HTMLAnchorElement).text
);
}
onContextMenuMessage(event: MouseEvent, type: string) { onContextMenuMessage(event: MouseEvent, type: string) {
this.contextMenu.emit({ event, type }); this.contextMenu.emit({ event, type });
} }