changeset 66:f067de76084c

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 06 Mar 2025 03:09:24 -0700
parents 6cfef9850520
children e4e331539146
files src/account.html.luan src/chat.js
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/account.html.luan	Wed Mar 05 22:30:35 2025 -0700
+++ b/src/account.html.luan	Thu Mar 06 03:09:24 2025 -0700
@@ -141,13 +141,14 @@
 <%		header() %>
 		<div content>
 			<h1>Your Account</h1>
-			<p><a href="about.html">About Luan Chat</a></p>
 			<p>Your username is <span username></span> <a href="javascript:editUsername()">Edit</a></p>
 			<p><span notify></span> <a href="javascript:editNotify()">Edit</a></p>
 			<p><span voice></span> <a href="javascript:editVoice()">Edit</a></p>
 			<p>Your chat URL is <%= base_url() %>/chat?with=<%=user.email%></p>
 			<p><a href="javascript:logout()">Logout</a></p>
 			<p><a href="javascript:deleteUser()">Delete account</a></p>
+			<p>&nbsp;</p>
+			<p><a href="about.html">About Luan Chat</a></p>
 		</div>
 		<dialog edit_username>
 			<h2>Edit Username</h2>
--- a/src/chat.js	Wed Mar 05 22:30:35 2025 -0700
+++ b/src/chat.js	Thu Mar 06 03:09:24 2025 -0700
@@ -195,9 +195,12 @@
 };
 
 let urlRegex = /(^|\s)(https?:\/\/\S+)/g;
+let filebinUrlRegex = /(^|\s)(https:\/\/filebin.net\/[0-9a-f]+\/(\S+))/g;
 
 function urlsToLinks(text) {
-	return text.replace( urlRegex, '$1<a target="_blank" href="$2">$2</a>' );
+	text = text.replace( filebinUrlRegex, '$1<a target="_blank" href="$2">$3</a>' );
+	text = text.replace( urlRegex, '$1<a target="_blank" href="$2">$2</a>' );
+	return text;
 }
 
 let currentPulldown = null;