FriendsOfFlarum / upload

The file upload extension with insane intelligence for your Flarum forum.
https://discuss.flarum.org/d/4154
MIT License
175 stars 94 forks source link

feat: add support for text file preview embeds #303

Closed davwheat closed 2 years ago

davwheat commented 2 years ago

Changes proposed in this pull request:

Reviewers should focus on:

Does this scale for large communities, since the file is loaded in JS? Somehow injecting the initial snippet in the template seems like a better idea, but I've no idea how that can be done.

Screenshot

image

Confirmed

davwheat commented 2 years ago

@clarkwinkelmann Still got the other things to work on but after hours of pain, I've got the snippet being injected with a callback.

davwheat commented 2 years ago

I'm going to need to somehow include the post ID in the formatted view, because otherwise sometimes the URL it attempts to fetch contains undefined.