modify message-box Sticker
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 8.8 KiB |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 8.9 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 8.8 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 9.6 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 8.1 KiB |
After Width: | Height: | Size: 8.8 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 9.8 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 6.9 KiB |
After Width: | Height: | Size: 7.8 KiB |
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 6.6 KiB |
|
@ -0,0 +1,8 @@
|
||||||
|
<ul>
|
||||||
|
<li *ngIf="stickerUrl">
|
||||||
|
<img [src]="stickerUrl" onerror="this.src='assets/sticker/sticker_default.png'">
|
||||||
|
</li>
|
||||||
|
<li *ngIf="contentJson && contentJson.chat">
|
||||||
|
{{ contentJson.chat }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
|
@ -1,4 +1,7 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit, Input } from '@angular/core';
|
||||||
|
import { Info } from '@ucap-webmessenger/protocol-event';
|
||||||
|
import { NGXLogger } from 'ngx-logger';
|
||||||
|
import { StickerInfo } from '../../models/sticker-info.json';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ucap-chat-message-box-sticker',
|
selector: 'ucap-chat-message-box-sticker',
|
||||||
|
@ -6,7 +9,21 @@ import { Component, OnInit } from '@angular/core';
|
||||||
styleUrls: ['./sticker.component.scss']
|
styleUrls: ['./sticker.component.scss']
|
||||||
})
|
})
|
||||||
export class StickerComponent implements OnInit {
|
export class StickerComponent implements OnInit {
|
||||||
constructor() {}
|
@Input()
|
||||||
|
message: Info;
|
||||||
|
|
||||||
ngOnInit() {}
|
contentJson?: StickerInfo;
|
||||||
|
stickerUrl?: string;
|
||||||
|
constructor(private logger: NGXLogger) {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
try {
|
||||||
|
this.contentJson = JSON.parse(this.message.sentMessage);
|
||||||
|
if (!!this.contentJson.file) {
|
||||||
|
this.stickerUrl = `assets/sticker/sticker_s_${this.contentJson.file}.png`;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.logger.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
<ucap-chat-message-box-file *ngSwitchCase="EventType.File" [message]="message" (save)="onSave($event)"
|
<ucap-chat-message-box-file *ngSwitchCase="EventType.File" [message]="message" (save)="onSave($event)"
|
||||||
(imageViewer)="onImageViewer($event)">
|
(imageViewer)="onImageViewer($event)">
|
||||||
</ucap-chat-message-box-file>
|
</ucap-chat-message-box-file>
|
||||||
|
<ucap-chat-message-box-sticker *ngSwitchCase="EventType.Sticker" [message]="message">
|
||||||
|
</ucap-chat-message-box-sticker>
|
||||||
|
<ucap-chat-message-box-text *ngSwitchCase="EventType.Character" [message]="message"></ucap-chat-message-box-text>
|
||||||
<div *ngSwitchDefault>
|
<div *ngSwitchDefault>
|
||||||
date splitter
|
date splitter
|
||||||
<ucap-chat-message-box-date-splitter></ucap-chat-message-box-date-splitter>
|
<ucap-chat-message-box-date-splitter></ucap-chat-message-box-date-splitter>
|
||||||
|
@ -36,8 +39,6 @@
|
||||||
recall
|
recall
|
||||||
<ucap-chat-message-box-recall></ucap-chat-message-box-recall>
|
<ucap-chat-message-box-recall></ucap-chat-message-box-recall>
|
||||||
<ucap-chat-message-box-schedule></ucap-chat-message-box-schedule>
|
<ucap-chat-message-box-schedule></ucap-chat-message-box-schedule>
|
||||||
sticker
|
|
||||||
<ucap-chat-message-box-sticker></ucap-chat-message-box-sticker>
|
|
||||||
translation
|
translation
|
||||||
<ucap-chat-message-box-translation></ucap-chat-message-box-translation>
|
<ucap-chat-message-box-translation></ucap-chat-message-box-translation>
|
||||||
video-conference
|
video-conference
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
export interface StickerInfo {
|
||||||
|
name?: string;
|
||||||
|
file?: string;
|
||||||
|
chat?: string;
|
||||||
|
}
|
|
@ -20,7 +20,8 @@ export * from './lib/components/message-box/video.component';
|
||||||
export * from './lib/components/form.component';
|
export * from './lib/components/form.component';
|
||||||
export * from './lib/components/messages.component';
|
export * from './lib/components/messages.component';
|
||||||
|
|
||||||
export * from './lib/models/mass-talk-info.json';
|
|
||||||
export * from './lib/models/file-info.json';
|
export * from './lib/models/file-info.json';
|
||||||
|
export * from './lib/models/mass-talk-info.json';
|
||||||
|
export * from './lib/models/sticker-info.json';
|
||||||
|
|
||||||
export * from './lib/ucap-ui-chat.module';
|
export * from './lib/ucap-ui-chat.module';
|
||||||
|
|