Last modified: 2014-10-23 08:07:29 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 29328 - jquery.textSelection in core hardcodes checks for WikiEditor's iframe
jquery.textSelection in core hardcodes checks for WikiEditor's iframe
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.23.0
All All
: Normal normal (vote)
: 1.25.0 release
Assigned To: Derk-Jan Hartman
:
Depends on:
Blocks: code_quality
  Show dependency treegraph
 
Reported: 2011-06-10 00:12 UTC by Brion Vibber
Modified: 2014-10-23 08:07 UTC (History)
7 users (show)

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


Attachments

Description Brion Vibber 2011-06-10 00:12:29 UTC
While trying to figure out how to better integrate CodeEditor (w/ Ace editing widget) into WikiEditor based on the existing iframe mode, I found that there's some WikiEditor-specific hardcoding still in the jquery.textSelection module:

  var context = $(this).data( 'wikiEditor-context' );
  var hasIframe = typeof context !== 'undefined' && context && typeof context.$iframe !== 'undefined';
  // ...
  retval = ( hasIframe ? context.fn : fn )[command].call( this, options );

It looks like for now, to work with $.textSelection I'll have to pretend to be the WikiEditor iframe plugin. Ideally we probably want something that's not specific to WikiEditor, so it can be used on any textarea-alike that can provide some sort of context functions for the textSelection plugin.
Comment 1 Andre Klapper 2014-02-28 14:01:07 UTC
Code still exists in MW core's resources/jquery/jquery.textSelection.js
Comment 2 Helder 2014-03-05 21:13:53 UTC
Possibly related:
https://github.com/wikimedia/mediawiki-core/blob/1a8175ed1ca611a67b1eee4e170312a3a4f7f217/resources/mediawiki.action/mediawiki.action.edit.js#L190-L201

// HACK: make $currentFocused work with the usability iframe
// With proper focus detection support (HTML 5!) this'll be much cleaner
// TODO: Get rid of this WikiEditor code from MediaWiki core!
$iframe = $( '.wikiEditor-ui-text iframe' );
(...)
Comment 3 Gerrit Notification Bot 2014-04-30 18:00:15 UTC
Change 130639 had a related patch set uploaded by Bartosz Dziewoński:
jquery.textSelection: Remove hardcoded checks for removed WikiEditor iframe mode

https://gerrit.wikimedia.org/r/130639
Comment 4 Gerrit Notification Bot 2014-05-02 18:19:41 UTC
Change 130639 merged by jenkins-bot:
jquery.textSelection: Remove hardcoded checks for removed WikiEditor iframe mode

https://gerrit.wikimedia.org/r/130639
Comment 5 Alex Monk 2014-05-04 02:41:18 UTC
Reverted this when I found it seemed to be to blame for a bug where submitting anything from CodeEditor caused it to be lost. (no save made, can't get back the text you made, etc.) Reopening
Comment 6 Gerrit Notification Bot 2014-06-15 16:59:39 UTC
Change 139690 had a related patch set uploaded by TheDJ:
textSelection: Remove references to iframe

https://gerrit.wikimedia.org/r/139690
Comment 7 Gerrit Notification Bot 2014-07-15 16:05:47 UTC
Change 139690 merged by jenkins-bot:
jquery.textSelection: Remove references to iframe

https://gerrit.wikimedia.org/r/139690
Comment 8 Tomasz W. Kozlowski 2014-07-18 21:09:24 UTC
Appears to have been fixed with the above patch.

Please reopen if that's not the case.
Comment 9 Derk-Jan Hartman 2014-07-28 19:50:36 UTC
Bug 68556, another regression, though not as bad this time. Reopening..

This regression is because I failed to realize that the CodeEditor could be disabled in the same session and that this would 'break' the function mapping in:

http://git.wikimedia.org/blob/mediawiki%2Fextensions%2FCodeEditor.git/ad908b2da64da4083e10e391153112978fb9df8f/modules%2Fjquery.codeEditor.js#L517

There we basically assign the 'textSelection' api functions into the WikiEditor api. The disabling works fine for the WikiEditor API functions, because they listen to the conditional in L508, but the textSelection APIs are no longer part of the wikiEditor api's and stuff start breaking.
Comment 10 Gerrit Notification Bot 2014-07-28 20:47:23 UTC
Change 150032 had a related patch set uploaded by TheDJ:
jquery.textSelection: register an alt implementation

https://gerrit.wikimedia.org/r/150032
Comment 11 Gerrit Notification Bot 2014-07-28 20:52:34 UTC
Change 150037 had a related patch set uploaded by TheDJ:
Split jquery.textSelection and WikiEditor api overrides

https://gerrit.wikimedia.org/r/150037
Comment 12 Gerrit Notification Bot 2014-10-23 03:05:00 UTC
Change 150032 merged by jenkins-bot:
jquery.textSelection: Add ability to register custom implementation

https://gerrit.wikimedia.org/r/150032
Comment 13 Gerrit Notification Bot 2014-10-23 03:05:05 UTC
Change 150037 merged by jenkins-bot:
Split jquery.textSelection and WikiEditor api overrides

https://gerrit.wikimedia.org/r/150037
Comment 14 Bartosz Dziewoński 2014-10-23 08:07:29 UTC
So… this is really fixed now, isn't it?

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


Navigation
Links