I’m the developer of a desktop-first Lemmy client called Alexandrite.

  • 7 Posts
  • 12 Comments
Joined 2 years ago
cake
Cake day: July 5th, 2023

help-circle

  • It might not help because it’s in svelte and it doesn’t look like you’re using lemmy-js-client, but this is an example of how I do it in Alexandrite using lemmy-js-client. The onPaste function handles the paste event on the markdown editor textarea when someone pastes with an image in their clipboard, and the onFileInputChange is the change event for an <input type="file" /> element so when someone selects a file it uploads and the input’s label can be styled like a button. Here is the client’s fetch function which handles the authorization header and whatnot. You can upload client-side without a proxy server for any instance running a newer version of Lemmy than like… 0.19.0? I didn’t want to be responsible for proxying image uploads so I waited to add image uploading in Alexandrite until I could do the uploads directly client side.
















  • (dev here) I hadn’t really considered it as a full replacement before, but hosting it alongside the instance like a desktop version of m.lemmy.world is something I think would be neat (at least one instance is doing that, with a custom Dockerfile because I haven’t made one yet). I’d need to add some mobile support (which I’m not against doing in the future) and some admin tools probably before it could be a full replacement, both would probably not be for a bit still because I’m still working on feature parity for normal users. Also still waiting on a Lemmy issue to be fixed before I can add image uploading which is the most basic feature the site lacks at the moment.