From 9d72f2a4fb9337c4962dd1227cb11d7a8ebf9b61 Mon Sep 17 00:00:00 2001 From: Volker Mische Date: Tue, 10 Feb 2026 23:19:26 +0100 Subject: [PATCH] Include file path when sharing The share button didn't include the file path, hence you couldn't correctly share the name of your Lexicon. Now you can. --- website/static/js/app.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/website/static/js/app.js b/website/static/js/app.js index b6917ef..4df1083 100644 --- a/website/static/js/app.js +++ b/website/static/js/app.js @@ -610,11 +610,14 @@ function loadFromUrl() { if (shareParam) { try { const decoded = base64urlDecode(shareParam); + // Split at the first newline character + const [filePath, source] = decoded.split(/\n([\s\S]*)$/); + document.getElementById('file-path').value = filePath; const textarea = document.getElementById('mlf-editor'); if (textarea) { - textarea.value = decoded; - updateLineNumbers(decoded); - updateHighlighting(decoded); + textarea.value = source; + updateLineNumbers(source); + updateHighlighting(source); } } catch (error) { console.error('Failed to load shared code:', error); @@ -624,8 +627,9 @@ function loadFromUrl() { } function handleShare() { + const filePath = document.getElementById('file-path').value; const source = getEditorContent(); - const encoded = base64urlEncode(source); + const encoded = base64urlEncode(`${filePath}\n${source}`); // Build share URL const baseUrl = window.location.origin + window.location.pathname; -- 2.51.2