Page MenuHomePhabricator

CodeEditor and the experimental "live preview" preference are not compatible.
Closed, ResolvedPublic

Description

I have live (ajax) preview enabled.


Version: unspecified
Severity: normal

Details

Reference
bz47235

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:37 AM
bzimport added a project: CodeEditor.
bzimport set Reference to bz47235.
liangent created this task.Apr 15 2013, 5:15 AM

Could you elaborate on the bug summary and on which wiki to reproduce? TIA.

In Firebug, I see the original code submitted as wpTextbox1.

(In reply to comment #0)

I have live (ajax) preview enabled.

This is the key. It refers to the "Use live preview (requires JavaScript) (experimental)" preference in the Editing tab.

It appears that this has nothing to do with Scribunto. The problem is that CodeEditor and the "Use live preview" preference are not compatible: "live preview" reads out the content of the text box to find the text to diff, but CodeEditor does not update the (hidden) text box until the form is submitted. If the toggle button in CodeEditor's UI is used to display the text box, live preview's diff button works fine.

I imagine that CodeEditor's javascript would need to listen for the "LivePreviewPrepare" event sent by the live preview javascript (see resources/mediawiki.action/mediawiki.action.edit.preview.js line 15) and update the hidden text box so live preview is able to find the updated text.

(In reply to comment #3)

I imagine that CodeEditor's javascript would need to listen for the
"LivePreviewPrepare" event sent by the live preview javascript (see
resources/mediawiki.action/mediawiki.action.edit.preview.js line 15) and
update
the hidden text box so live preview is able to find the updated text.

That event might be killed after the fix for bug 23580 is merged.

Related URL: https://gerrit.wikimedia.org/r/62612 (Gerrit Change Iba1b727c55aabcd31afc06cec99618fcdce207d8)

Related URL: https://gerrit.wikimedia.org/r/62814 (Gerrit Change I39c626d066797d887769c3715df88838e709d527)

Change 110347 had a related patch set uploaded by Helder.wiki:
Fire hook "LivePreviewPrepare"

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

Change 110347 abandoned by Krinkle:
Fire hook "LivePreviewPrepare"

Reason:
Closing. A 'before' fire is not compatible with how mw.hook works (asynchronous).

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

Change 119527 had a related patch set uploaded by Helder.wiki:
Remove inexistent hook "LivePreviewPrepare"

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

Change 119527 merged by jenkins-bot:
Remove inexistent hook "LivePreviewPrepare"

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

Aklapper removed a subscriber: Anomie.Oct 16 2020, 5:43 PM