Skip to content

(WIP) View post edit histories in Flarum.

Notifications You must be signed in to change notification settings

tolgaaaltas/flarum-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diff for Flarum

MIT license Latest Stable Version Total Downloads

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:

Features

  • 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.

Requirements

php ext-iconv

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).

Installation

Use Bazaar or install manually:

composer require the-turk/flarum-diff

Updating

composer update the-turk/flarum-diff
php flarum migrate
php flarum cache:clear

Usage

Enable the extension, set the permissions (it's only visible to members by default) and customize the display mode if you wish.

Known Issues

  • Diff list is not showing up immediately after clicking the button.
  • Diff list is not showing up on [deleted] user's post.

What's Next

  • Currently it sends a request to /api/diff/{postId} page everytime you click on the "Edited" button. I'm thinking of using app.cache to prevent this behaviour but i need to improve my Mithril skills first.

  • flarum/markdown, flarum/bbcode and flarum/mentions support (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.

Links

About

(WIP) View post edit histories in Flarum.

Resources

Stars

Watchers

Forks

Packages

No packages published