This extension adds a "post revision history" feature to your Flarum forum. I did this one for my personal Flarum project and decided to share it. It's in beta stage right now, means that you may lose your previous revisions with an update until the stable release (just as in Flarum).
Here are the screenshots:
- Post-Stream Item
- Dropdown List
- Inline Mode
- Side by Side Mode
- Extension Settings
- Based on jfcherng/php-diff repository (this one is forked from chrisboulton/php-diff since it's no longer maintained).
- Option for line (default), word and char level diffs.
- Option for tabular view with line numbers.
- Two render modes including "Inline" and "Side By Side".
Also, it won't load anything until you click the "Edited" button so no need to worry about post stream's loading time.
You can check your php version by running php -v and check if iconv is installed by running php --ri iconv (which should display iconv support => enabled).
Use Bazaar or install manually:
composer require the-turk/flarum-diffcomposer update the-turk/flarum-diff
php flarum migrate
php flarum cache:clearEnable the extension, set the permissions (it's only visible to members by default) and customize the display mode if you wish.
- Diff list is not showing up immediately after clicking the button.
- Diff list is not showing up on
[deleted]user's post.
-
Currently it sends a request to
/api/diff/{postId}page everytime you click on the "Edited" button. I'm thinking of usingapp.cacheto prevent this behaviour but i need to improve my Mithril skills first. -
flarum/markdown,flarum/bbcodeandflarum/mentionssupport (it's so challanging with external libraries). -
Rollback function? I don't know, it seems pretty useless to me since you can just copy and paste from your previous revisions. I might need to change the way of storing diffs into the database for this kind of functionality. Hit me with the suggestions on GitHub.