I have live (ajax) preview enabled.
Version: unspecified
Severity: normal
I have live (ajax) preview enabled.
Version: unspecified
Severity: normal
(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"
Change 110347 abandoned by Krinkle:
Fire hook "LivePreviewPrepare"
Reason:
Closing. A 'before' fire is not compatible with how mw.hook works (asynchronous).
Change 119527 had a related patch set uploaded by Helder.wiki:
Remove inexistent hook "LivePreviewPrepare"