From 9bf5f3d0d372ac7a5290553a9fda7956a94c0e27 Mon Sep 17 00:00:00 2001 From: Armored Dragon Date: Wed, 22 May 2024 04:47:37 -0500 Subject: [PATCH] Linking fix. Disabled sending on Shift + Enter to prevent confusion. Signed-off-by: Armored Dragon --- .../communityScripts/armored-chat/armored_chat.qml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/communityScripts/armored-chat/armored_chat.qml b/scripts/communityScripts/armored-chat/armored_chat.qml index e8540ed3ae..0cdf154b2f 100644 --- a/scripts/communityScripts/armored-chat/armored_chat.qml +++ b/scripts/communityScripts/armored-chat/armored_chat.qml @@ -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 "" + match + ""}); + mess = mess.replace(link, (match) => {return "" + match + " "}); var script_tag = /]*>/gi; mess = mess.replace(script_tag, "script");