EditPage: Extract some edit conflict code into EditConflictHelper
authorKunal Mehta <legoktm@member.fsf.org>
Fri, 22 Sep 2017 11:48:27 +0000 (04:48 -0700)
committerWMDE-Fisch <christoph.jauera@wikimedia.de>
Thu, 26 Oct 2017 08:32:29 +0000 (10:32 +0200)
commit3f88e0c7bf6cdc604041db1c54d8f7be15ceccf8
tree98ccaf2bd5eba2f942d0bf6fad9186bc76a42e8c
parentc76ed91766ccb81e8f0b201690d8ef8d0adfc0da
EditPage: Extract some edit conflict code into EditConflictHelper

Extensions with custom content models (e.g. ProofreadPage) will extend
EditPage to provide a customized editing experience. However when
another extension like TwoColConflict wants to change just how edit
conflicts look, this causes problems since only one class can take the
place of EditPage.

So instead, split most of the frontend code for edit conflicts into
TextConflictHelper, and call it from edit page. Extensions can override
with the instance created by calling
EditPage::setEditConflictHelperFactory().

And to make that split possible also move EditPage::addNewLineAtEnd()
and ::buildTextboxAttribs() into a separate TextboxBuilder class that
both EditPage and TextConflictHelper can use.

Bug: T176393
Change-Id: Ie415edd84329c02d5762477f8a171fced85b01a2
autoload.php
includes/EditPage.php
includes/editpage/TextConflictHelper.php [new file with mode: 0644]
includes/editpage/TextboxBuilder.php [new file with mode: 0644]