summaryrefslogtreecommitdiff
path: root/doc/todo/preview_changes.mdwn
blob: 9533b993ce1e1768377d76c1343c7e8d2fbc18a3 (plain)

When editing a page, it would help to have a "preview changes" or "show diff" button, which brings up a diff from the current page content to the proposed new page content. --[[JoshTriplett]]

Some discussion from the main [[/index/discussion]] page:

It would be nice to be able to have a button to show "Differences" (or "Show Diff") when editing a page. Is that an option that can be enabled?

It's doable, it could even be done by a [[todo/plugin]], I think. --[[Joey]]


I need help with this. Supposedly, such a plugin would provide a formbuilder_setup hook which would add the button, and a cgi hook which would interecept "Show Diff" clicks. This would show a diff between titlepage(possibly_foolish_untaint($form->field("page"))) and the provided $form->field("editcontent").

But:

  • How could the case of concurrent editing be handled ? Especially as (I think) only the RCS backend can know that this has happened.
  • Doing the formbuilder trick for adding a button needs the following patch. (note that this is not the only template which has its submit buttons hardcoded; is this supposed to work around something?)
  • Coercing editpage() into showing the edit form again rather that saving the page would be tricky and hackish to do from a module; maybe this would better be implemented directly in showpage?

--[[JeremieKoenig]]