mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-23 23:55:47 +00:00
commit
b74cd40cd3
BIN
img/minter.png
Normal file
BIN
img/minter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
@ -5,7 +5,7 @@ import localForage from 'localforage'
|
|||||||
import '@material/mwc-icon'
|
import '@material/mwc-icon'
|
||||||
|
|
||||||
// Multi language support
|
// Multi language support
|
||||||
import { translate } from '../../../../core/translate'
|
import { get, translate } from '../../../../core/translate'
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
|
|
||||||
@ -66,6 +66,9 @@ class ChatHead extends LitElement {
|
|||||||
} else if (groupString === 'Group_1') {
|
} else if (groupString === 'Group_1') {
|
||||||
const avatarUrl = `/img/qdcgroup.png`
|
const avatarUrl = `/img/qdcgroup.png`
|
||||||
this.avatarImg = this.createImage(avatarUrl)
|
this.avatarImg = this.createImage(avatarUrl)
|
||||||
|
} else if (groupString === 'Group_694') {
|
||||||
|
const avatarUrl = `/img/minter.png`
|
||||||
|
this.avatarImg = this.createImage(avatarUrl)
|
||||||
} else if (this.chatInfo.name) {
|
} else if (this.chatInfo.name) {
|
||||||
const avatarUrl = `${nodeUrl}/arbitrary/THUMBNAIL/${this.chatInfo.name}/qortal_avatar?async=true`
|
const avatarUrl = `${nodeUrl}/arbitrary/THUMBNAIL/${this.chatInfo.name}/qortal_avatar?async=true`
|
||||||
this.avatarImg = this.createImage(avatarUrl)
|
this.avatarImg = this.createImage(avatarUrl)
|
||||||
@ -146,7 +149,7 @@ class ChatHead extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
<div class="about" style="margin-top:7px">
|
<div class="about" style="margin-top:7px">
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<span style="float:left; padding-left: 8px; color: var(--chat-group);font-size:12px">${this.chatInfo.groupId !== undefined ? 'id: ' + this.chatInfo.groupId : ''}</span>
|
<span style="float:left; padding-left: 8px; color: var(--chat-group);font-size:12px">${this.chatInfo.groupId !== undefined ? 'id: ' + this.chatInfo.groupId : 'Private Chat'}</span>
|
||||||
<div style="color: var(--black); display: flex;font-size: 12px; align-items:center">
|
<div style="color: var(--black); display: flex;font-size: 12px; align-items:center">
|
||||||
<div style="width: 8px; height: 8px;border-radius: 50%;background: ${isUnread ? 'var(--error)' : 'none'} ; margin-right:5px;"></div>
|
<div style="width: 8px; height: 8px;border-radius: 50%;background: ${isUnread ? 'var(--error)' : 'none'} ; margin-right:5px;"></div>
|
||||||
<message-time style="display: ${(this.chatInfo.timestamp && this.chatInfo.timestamp > 100000) ? 'block' : 'none'}" timestamp=${this.chatInfo.timestamp}></message-time>
|
<message-time style="display: ${(this.chatInfo.timestamp && this.chatInfo.timestamp > 100000) ? 'block' : 'none'}" timestamp=${this.chatInfo.timestamp}></message-time>
|
||||||
|
@ -3,7 +3,7 @@ import { ifDefined } from 'lit/directives/if-defined.js'
|
|||||||
import { unsafeHTML } from 'lit/directives/unsafe-html.js'
|
import { unsafeHTML } from 'lit/directives/unsafe-html.js'
|
||||||
import { animate } from '@lit-labs/motion'
|
import { animate } from '@lit-labs/motion'
|
||||||
import { Epml } from '../../../epml'
|
import { Epml } from '../../../epml'
|
||||||
import { Editor, Extension, generateHTML } from '@tiptap/core'
|
import { Editor, Extension, generateHTML, generateJSON } from '@tiptap/core'
|
||||||
import { escape } from 'html-escaper'
|
import { escape } from 'html-escaper'
|
||||||
import { inputKeyCodes, replaceMessagesEdited, generateIdFromAddresses } from '../../utils/functions'
|
import { inputKeyCodes, replaceMessagesEdited, generateIdFromAddresses } from '../../utils/functions'
|
||||||
import { publishData, modalHelper, RequestQueue } from '../../utils/classes'
|
import { publishData, modalHelper, RequestQueue } from '../../utils/classes'
|
||||||
@ -345,7 +345,12 @@ class ChatPage extends LitElement {
|
|||||||
}
|
}
|
||||||
${+this.repliedToMessageObj.version > 1 ?
|
${+this.repliedToMessageObj.version > 1 ?
|
||||||
html`
|
html`
|
||||||
<span style="color: var(--black);">${unsafeHTML(generateHTML(this.repliedToMessageObj.message, [StarterKit, Underline, Highlight, Mention]))}</span>
|
<span style="color: var(--black);">
|
||||||
|
${this.repliedToMessageObj.decodedMessage.includes('specialId') ?
|
||||||
|
this.convertHubMessageToJson(this.repliedToMessageObj.message) :
|
||||||
|
unsafeHTML(generateHTML(this.repliedToMessageObj.message, [StarterKit, Underline, Highlight, Mention]))
|
||||||
|
}
|
||||||
|
</span>
|
||||||
`
|
`
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
@ -362,7 +367,12 @@ class ChatPage extends LitElement {
|
|||||||
<vaadin-icon class="reply-icon" icon="vaadin:pencil" slot="icon"></vaadin-icon>
|
<vaadin-icon class="reply-icon" icon="vaadin:pencil" slot="icon"></vaadin-icon>
|
||||||
<div class="repliedTo-message">
|
<div class="repliedTo-message">
|
||||||
<p class="senderName">${translate("chatpage.cchange25")}</p>
|
<p class="senderName">${translate("chatpage.cchange25")}</p>
|
||||||
<span style="color: var(--black);">${unsafeHTML(generateHTML(this.editedMessageObj.message, [StarterKit, Underline, Highlight, Mention]))}</span>
|
<span style="color: var(--black);">
|
||||||
|
${this.editedMessageObj.decodedMessage.includes('specialId') && !this.editedMessageObj.decodedMessage.includes('messageText') ?
|
||||||
|
this.convertHubMessageToJson(this.editedMessageObj.message) :
|
||||||
|
unsafeHTML(generateHTML(this.editedMessageObj.message, [StarterKit, Underline, Highlight, Mention]))
|
||||||
|
}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<vaadin-icon class="close-icon" icon="vaadin:close-big" slot="icon" @click=${() => this.closeEditMessageContainer()}></vaadin-icon>
|
<vaadin-icon class="close-icon" icon="vaadin:close-big" slot="icon" @click=${() => this.closeEditMessageContainer()}></vaadin-icon>
|
||||||
</div>
|
</div>
|
||||||
@ -845,7 +855,12 @@ class ChatPage extends LitElement {
|
|||||||
if (isEnabledChatEnter) {
|
if (isEnabledChatEnter) {
|
||||||
this.isEnabledChatEnter = isEnabledChatEnter === 'false' ? false : true
|
this.isEnabledChatEnter = isEnabledChatEnter === 'false' ? false : true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
convertHubMessageToJson(message) {
|
||||||
|
let newJson = generateJSON(`${message}`, [StarterKit, Underline, Highlight, Mention])
|
||||||
|
|
||||||
|
return unsafeHTML(generateHTML(newJson, [StarterKit, Underline, Highlight, Mention]))
|
||||||
}
|
}
|
||||||
|
|
||||||
getNodeUrl() {
|
getNodeUrl() {
|
||||||
|
@ -3,7 +3,7 @@ import { repeat } from 'lit/directives/repeat.js'
|
|||||||
import { unsafeHTML } from 'lit/directives/unsafe-html.js'
|
import { unsafeHTML } from 'lit/directives/unsafe-html.js'
|
||||||
import { Epml } from '../../../epml'
|
import { Epml } from '../../../epml'
|
||||||
import { cropAddress, roundToNearestDecimal } from '../../utils/functions'
|
import { cropAddress, roundToNearestDecimal } from '../../utils/functions'
|
||||||
import { generateHTML } from '@tiptap/core'
|
import { generateHTML, generateJSON } from '@tiptap/core'
|
||||||
import { chatLimit, totalMsgCount } from './ChatPage'
|
import { chatLimit, totalMsgCount } from './ChatPage'
|
||||||
import { chatStyles } from './plugins-css'
|
import { chatStyles } from './plugins-css'
|
||||||
import isElectron from 'is-electron'
|
import isElectron from 'is-electron'
|
||||||
@ -280,6 +280,7 @@ class ChatScroller extends LitElement {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
let formattedMessages = this.messagesToRender
|
let formattedMessages = this.messagesToRender
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
${this.isLoadingBefore
|
${this.isLoadingBefore
|
||||||
? html`
|
? html`
|
||||||
@ -1091,7 +1092,7 @@ class MessageTemplate extends LitElement {
|
|||||||
messageVersion2WithLink = processText(messageVersion2)
|
messageVersion2WithLink = processText(messageVersion2)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parsedMessageObj.version > 1 && parsedMessageObj.message) {
|
if (parsedMessageObj.version > 1 && parsedMessageObj.message && !parsedMessageObj.messageText) {
|
||||||
messageVersion2 = parsedMessageObj.message
|
messageVersion2 = parsedMessageObj.message
|
||||||
messageVersion2WithLink = processText(messageVersion2)
|
messageVersion2WithLink = processText(messageVersion2)
|
||||||
}
|
}
|
||||||
@ -1271,6 +1272,10 @@ class MessageTemplate extends LitElement {
|
|||||||
try {
|
try {
|
||||||
repliedToMessageText = generateHTML(repliedToData.decodedMessage.messageText, [StarterKit, Underline, Highlight, Mention])
|
repliedToMessageText = generateHTML(repliedToData.decodedMessage.messageText, [StarterKit, Underline, Highlight, Mention])
|
||||||
} catch (error) { /* empty */ }
|
} catch (error) { /* empty */ }
|
||||||
|
} else if (repliedToData && repliedToData.decodedMessage && repliedToData.decodedMessage.message) {
|
||||||
|
try {
|
||||||
|
repliedToMessageText = this.convertHubMessageToJson(repliedToData.decodedMessage.message)
|
||||||
|
} catch (error) { /* empty */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
let replacedMessage = ''
|
let replacedMessage = ''
|
||||||
@ -2072,6 +2077,11 @@ class MessageTemplate extends LitElement {
|
|||||||
}, 60000)
|
}, 60000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
convertHubMessageToJson(message) {
|
||||||
|
let newJson = generateJSON(`${message}`, [StarterKit, Underline, Highlight, Mention])
|
||||||
|
return generateHTML(newJson, [StarterKit, Underline, Highlight, Mention])
|
||||||
|
}
|
||||||
|
|
||||||
async closeDownloadProgressDialog() {
|
async closeDownloadProgressDialog() {
|
||||||
const closeDelay = ms => new Promise(res => setTimeout(res, ms))
|
const closeDelay = ms => new Promise(res => setTimeout(res, ms))
|
||||||
this.shadowRoot.getElementById('downloadProgressDialog').close()
|
this.shadowRoot.getElementById('downloadProgressDialog').close()
|
||||||
@ -2355,7 +2365,13 @@ class ChatMenu extends LitElement {
|
|||||||
<div
|
<div
|
||||||
class=${`menu-icon ${!this.firstMessageInChat ? 'tooltip' : ''}`}
|
class=${`menu-icon ${!this.firstMessageInChat ? 'tooltip' : ''}`}
|
||||||
data-text="${translate('blockpage.bcchange12')}"
|
data-text="${translate('blockpage.bcchange12')}"
|
||||||
@click=${() => {if (this.version === '0') {this.versionErrorSnack(); return;} this.setEditedMessageObj(this.originalMessage);}}
|
@click=${() => {
|
||||||
|
if (this.version === '0') {
|
||||||
|
this.versionErrorSnack();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.setEditedMessageObj(this.originalMessage);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<vaadin-icon icon="vaadin:pencil" slot="icon"></vaadin-icon>
|
<vaadin-icon icon="vaadin:pencil" slot="icon"></vaadin-icon>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1649,7 +1649,7 @@ export const chatStyles = css`
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 5px;
|
top: 5px;
|
||||||
left: 10px;
|
left: 10px;
|
||||||
height: 75%;
|
height: 85%;
|
||||||
width: 2.6px;
|
width: 2.6px;
|
||||||
background-color: var(--mdc-theme-primary);
|
background-color: var(--mdc-theme-primary);
|
||||||
}
|
}
|
||||||
@ -1669,7 +1669,7 @@ export const chatStyles = css`
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
max-width: 500px;
|
max-width: 500px;
|
||||||
max-height: 40px;
|
max-height: 80px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
@ -8524,7 +8524,7 @@ export const groupManagementStyles = css`
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 5px;
|
top: 5px;
|
||||||
left: 10px;
|
left: 10px;
|
||||||
height: 75%;
|
height: 85%;
|
||||||
width: 2.6px;
|
width: 2.6px;
|
||||||
background-color: var(--mdc-theme-primary);
|
background-color: var(--mdc-theme-primary);
|
||||||
}
|
}
|
||||||
@ -8548,7 +8548,7 @@ export const groupManagementStyles = css`
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
max-width: 500px;
|
max-width: 500px;
|
||||||
max-height: 40px;
|
max-height: 80px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user