Last modified: 2014-05-20 14:48:22 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 52071 - Add mw.hook event for when wpTextbox1's content is used (to beused by extensions providing WYSIWYG/code highlighting etc. functionality)
Add mw.hook event for when wpTextbox1's content is used (to beused by extensi...
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on: 23580
Blocks: 61117
  Show dependency treegraph
Reported: 2013-07-26 01:13 UTC by Bartosz Dziewoński
Modified: 2014-05-20 14:48 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Bartosz Dziewoński 2013-07-26 01:13:27 UTC
We should have a mw.hook event for when wpTextbox1's content is used (to be used by extensions providing WYSIWYG/code highlighting etc. functionality which need to update it).

This could also replace the old deprecated 'LivePreviewPrepare' even fired on $(mw). 

Brief discussion about this:
Comment 1 Krinkle 2013-07-26 01:20:04 UTC
Describe what you mean by "wpTextbox1's content being used". I doubt to what degree an mw.hook would be appropriate as opposed to direct binding.

Can you describe how you'd like to see this work? Remember that mw.hook is (by design) not an event handler or even synchronous, so it can't correctly fired from e.g. form.onsubmit.
Comment 2 Gerrit Notification Bot 2014-01-30 17:39:09 UTC
Change 110347 had a related patch set uploaded by
Fire hook "LivePreviewPrepare"
Comment 3 Gerrit Notification Bot 2014-03-19 06:21:05 UTC
Change 110347 abandoned by Krinkle:
Fire hook "LivePreviewPrepare"

Closing. A 'before' fire is not compatible with how mw.hook works (asynchronous).
Comment 4 Gerrit Notification Bot 2014-03-19 18:34:20 UTC
Change 119527 had a related patch set uploaded by
Remove inexistent hook "LivePreviewPrepare"
Comment 5 Gerrit Notification Bot 2014-03-19 20:21:41 UTC
Change 119527 merged by jenkins-bot:
Remove inexistent hook "LivePreviewPrepare"
Comment 6 Andre Klapper 2014-05-20 10:40:42 UTC
Patch was merged a while ago - is there more work left to do here (if yes: please reset the bug report status to NEW or ASSIGNED), or can you close this ticket as RESOLVED FIXED?
Comment 7 Brad Jorsch 2014-05-20 14:26:12 UTC
It's not fixed. The patch merged on March 19 was removing a hook that had been tentatively added to CodeEditor because the patch to fire that hook in core never materialized.

It could be WONTFIX if the status quo (binding and firing a random event on the mw object) is to be maintained here, since mw.hook has apparently mutated from a replacement for binding and firing random events on objects (see bug 23580 comment 10) to some sort of not-really-an-event-handler asynchronous-firing mechanism (per comment 1 here, although its doc comments describe it as "Registry and firing of events").
Comment 8 Derk-Jan Hartman 2014-05-20 14:48:22 UTC
Actually, per discussion we had on this per

We need a bit of JS API work around this. Ideally there would be an API, where a editor can register, and then while that 'custom' editor for the wpTextbox1 is active, it is notified of and asked for certain events and actions.

This is thus very much the same problem that is currently blocking bug 61117.

Note You need to log in before you can comment on or make changes to this bug.