Linking fix.

Disabled sending on Shift + Enter to prevent confusion.

Signed-off-by: Armored Dragon <publicmail@armoreddragon.com>
This commit is contained in:
Armored Dragon 2024-05-22 04:47:37 -05:00
parent 7920610d4d
commit 9bf5f3d0d3
No known key found for this signature in database
GPG key ID: C7207ACC3382AD8B

View file

@ -194,18 +194,18 @@ Rectangle {
width: parent.width
height: parent.height
TextField {
width: parent.width - 60
height: parent.height
placeholderText: pageVal.charAt(0).toUpperCase() + pageVal.slice(1) + " chat message..."
onAccepted: {
toScript({type: "send_message", message: text, channel: pageVal});
text = ""
Keys.onPressed: {
if ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && !(event.modifiers & Qt.ShiftModifier)) {
event.accepted = true;
toScript({type: "send_message", message: text, channel: pageVal});
text = ""
}
}
}
Button {
width: 60
height:parent.height
@ -498,7 +498,7 @@ Rectangle {
function formatContent(mess) {
var link = /(https?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+(?:\/[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]*)?(?=\s|$)/g;
mess = mess.replace(link, () => {return "<a onclick='Window.openUrl("+match+")' href='" + match + "'>" + match + "</a>"});
mess = mess.replace(link, (match) => {return "<a onclick='Window.openUrl("+match+")' href='" + match + "'>" + match + "</a> <a onclick='Window.openUrl("+match+")'>⮺</a>"});
var script_tag = /<script\b[^>]*>/gi;
mess = mess.replace(script_tag, "script");