Working on WebCard card initialization and URL visiting
The WebCard project is moving forward again. My latest work involved card initialization and URL visiting.
When a new Web card is created, the associated URL is now inserted as text in the content area of the card. This is useful documentation and prevents the potential confusion of a blank card.
Speaking of card initialization, the WCD.AskURL
function that prompts for a URL initially prefilled the input buffer with https://
to spare some typing. But testing revealed an unexpected behavior of NCP.AskUser
, the NoteCards API function URL prompting is built upon.
As soon as the user starts typing, NCP.AskUser
deletes the prefix https://
, whereas I assumed the new text would be appended to https://
. To avoid the confusion WCD.AskURL
no longer prefills the input buffer unless the function is called with an optional prefix. Even if deleted when the user types, the current URL will serve as an initial reminder when editing a card URL.
Finally, I factored out the code that visits a URL into its own function WCD.VisitURL
since I'll eventually revise the feature and call it in other contexts.
Discuss...
Email | Reply @amoroso@fosstodon.org