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

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T54071, the corresponding Phabricator task for complete and up-to-date bug report information.
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)
1.22.0
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: ---


Attachments

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: https://gerrit.wikimedia.org/r/#/c/74314/1/resources/mediawiki.action/mediawiki.action.edit.preview.js
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 Helder.wiki:
Fire hook "LivePreviewPrepare"

https://gerrit.wikimedia.org/r/110347
Comment 3 Gerrit Notification Bot 2014-03-19 06:21:05 UTC
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
Comment 4 Gerrit Notification Bot 2014-03-19 18:34:20 UTC
Change 119527 had a related patch set uploaded by Helder.wiki:
Remove inexistent hook "LivePreviewPrepare"

https://gerrit.wikimedia.org/r/119527
Comment 5 Gerrit Notification Bot 2014-03-19 20:21:41 UTC
Change 119527 merged by jenkins-bot:
Remove inexistent hook "LivePreviewPrepare"

https://gerrit.wikimedia.org/r/119527
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 https://gerrit.wikimedia.org/r/#/c/121558

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.


Navigation
Links