A human-friendly DSL for ATProto Lexicons

Include file path when sharing #1

The share button didn't include the file path, hence you couldn't correctly share the name of your Lexicon. Now you can.

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:otu6ccrwycke33kl3h4yjhwn/sh.tangled.repo.pull/3mejzibi3tz22
+8 -4
Diff #0
+8 -4
website/static/js/app.js
··· 610 610 if (shareParam) { 611 611 try { 612 612 const decoded = base64urlDecode(shareParam); 613 + // Split at the first newline character 614 + const [filePath, source] = decoded.split(/\n([\s\S]*)$/); 615 + document.getElementById('file-path').value = filePath; 613 616 const textarea = document.getElementById('mlf-editor'); 614 617 if (textarea) { 615 - textarea.value = decoded; 616 - updateLineNumbers(decoded); 617 - updateHighlighting(decoded); 618 + textarea.value = source; 619 + updateLineNumbers(source); 620 + updateHighlighting(source); 618 621 } 619 622 } catch (error) { 620 623 console.error('Failed to load shared code:', error); ··· 624 627 } 625 628 626 629 function handleShare() { 630 + const filePath = document.getElementById('file-path').value; 627 631 const source = getEditorContent(); 628 - const encoded = base64urlEncode(source); 632 + const encoded = base64urlEncode(`${filePath}\n${source}`); 629 633 630 634 // Build share URL 631 635 const baseUrl = window.location.origin + window.location.pathname;

History

1 round 1 comment
sign up or login to add to the discussion
1 commit
expand
Include file path when sharing
no conflicts, ready to merge
expand 1 comment

This was the simplest way I could come up with. In case you care about backwards compatibility, another option would be to encode it as JSON. If it's an object, it would be the new format, if it's just a string, it's the old one.