Fixed the Poke message URL renderer
This commit is contained in:
parent
ba1e6b605a
commit
58256bb548
1 changed files with 29 additions and 22 deletions
|
@ -55,30 +55,37 @@ loader.register_task(loader.Stage.JAVASCRIPT_INITIALIZING, {
|
||||||
target = '#';
|
target = '#';
|
||||||
}
|
}
|
||||||
|
|
||||||
const handlerId = useContext(BBCodeHandlerContext);
|
return (
|
||||||
|
<BBCodeHandlerContext.Consumer key={"er-" + ++reactId}>
|
||||||
|
{handlerId => {
|
||||||
|
if(handlerId) {
|
||||||
|
/* TS3-Protocol for a client */
|
||||||
|
if(target.match(ClientUrlRegex)) {
|
||||||
|
const clientData = target.match(ClientUrlRegex);
|
||||||
|
const clientDatabaseId = parseInt(clientData[1]);
|
||||||
|
const clientUniqueId = clientDatabaseId[2];
|
||||||
|
|
||||||
if(handlerId) {
|
return <ClientTag
|
||||||
/* TS3-Protocol for a client */
|
key={"er-" + ++reactId}
|
||||||
if(target.match(ClientUrlRegex)) {
|
clientName={rendererText.renderContent(element).join("")}
|
||||||
const clientData = target.match(ClientUrlRegex);
|
clientUniqueId={clientUniqueId}
|
||||||
const clientDatabaseId = parseInt(clientData[1]);
|
clientDatabaseId={clientDatabaseId > 0 ? clientDatabaseId : undefined}
|
||||||
const clientUniqueId = clientDatabaseId[2];
|
handlerId={handlerId}
|
||||||
|
/>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return <ClientTag
|
return (
|
||||||
clientName={rendererText.renderContent(element).join("")}
|
<a key={"er-" + ++reactId} className={"xbbcode xbbcode-tag-url"} href={target} target={"_blank"} onContextMenu={event => {
|
||||||
clientUniqueId={clientUniqueId}
|
event.preventDefault();
|
||||||
clientDatabaseId={clientDatabaseId > 0 ? clientDatabaseId : undefined}
|
spawnUrlContextMenu(event.pageX, event.pageY, target);
|
||||||
handlerId={handlerId}
|
}}>
|
||||||
/>;
|
{renderer.renderContent(element)}
|
||||||
}
|
</a>
|
||||||
}
|
);
|
||||||
|
}}
|
||||||
return <a key={"er-" + ++reactId} className={"xbbcode xbbcode-tag-url"} href={target} target={"_blank"} onContextMenu={event => {
|
</BBCodeHandlerContext.Consumer>
|
||||||
event.preventDefault();
|
);
|
||||||
spawnUrlContextMenu(event.pageX, event.pageY, target);
|
|
||||||
}}>
|
|
||||||
{renderer.renderContent(element)}
|
|
||||||
</a>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tags(): string | string[] {
|
tags(): string | string[] {
|
||||||
|
|
Loading…
Add table
Reference in a new issue