Page MenuHomePhabricator

LiquidThreads: LQT preview should not rely on mediawiki.action.edit.preview
Open, LowestPublic

Description

The problem is that mediawiki.action.edit.preview is intended to be used on an edit page. Not an any random edit form being reproduced dynamically in another extension.

The function should either be developed separately, or mediawiki.action.edit.preview needs to be split in a module that operates per editform, that can then also be used by the edit page.

Details

Reference
bz55463

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:16 AM
bzimport set Reference to bz55463.
bzimport added a subscriber: Unknown Object (MLST).

This is because LiquidThreads is relying on core edit.preview.js to bind the click handler on the document.body.

I'll undo that part of the optimisation for now but this is really something that LQT should fix.

A click handler on an element by the ID of '#wpPreview' is not a public API and LQT has no business in trying to hijack that click.

The reason LQT could do this until now is because it basically reproduces most of the EditPage HTML (including the exact HTML IDs and classes on buttons and other form fields), except for the 'id="editform"' attribute on the form element.

At first I thought adding that ID wouldn't help (since LQT creates it dynamically and the core js would've already run) but actually it would fix it because LQT loads the core javascript manually. It does need to take care to re-use that element once bound, but that shouldn't be a problem.

In the short to medium term LQT developers should either not re-use this core javascript file and just write a few lines that do the same, or write a patch in core to make it a proper javascript interface.

Change 88619 had a related patch set uploaded by Krinkle:
mediawiki.action.edit.preview: Fix for LiquidThreads hack

https://gerrit.wikimedia.org/r/88619

Krinkle, should this be marked as FIXED or it requires some extra cleanup?

(Quoting comment #1)

I'll undo that part of the optimisation for now but this is really something
that LQT should fix.

Should we change the bug title then?
(The live preview of a reply is working again)

https://gerrit.wikimedia.org/r/#/c/88619/ was merged ages ago.

(In reply to Helder from comment #5)

Should we change the bug title then?

Yes. But no idea to what. Feel free to go ahead. :)

He7d3r set Security to None.
TheDJ renamed this task from LiquidThreads: Live preview of a reply should not use hacks to LiquidThreads: LQT preview should not rely on mediawiki.action.edit.preview.Mar 29 2015, 7:00 PM
TheDJ updated the task description. (Show Details)
Jdforrester-WMF lowered the priority of this task from Medium to Lowest.Aug 4 2016, 11:33 PM
Jdforrester-WMF subscribed.

LiquidThreads has been replaced by StructuredDiscussions on all Wikimedia production wikis (except one, which will be done soon). It is no longer under active development or maintenance, so I'm re-classifying all open LQT tasks as "Lowest" priority.