Last modified: 2014-11-08 15:32:49 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 T72764, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70764 - [jquery.textSelection] Select sample text, if possible, when splitlines is true
[jquery.textSelection] Select sample text, if possible, when splitlines is true
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.24rc
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
gci2014
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-12 09:51 UTC by Michael M.
Modified: 2014-11-08 15:32 UTC (History)
3 users (show)

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


Attachments

Description Michael M. 2014-09-12 09:51:41 UTC
Steps to reproduce:

1. Open any page for editing, open the "Advanced" toolbar from WikiEditor.
2. Click the icon for inserting a list.

Expected result: The sample text "Bulleted list item" is selected.
Actual result: It is not.

If you don't have WikiEditor installed, you can execute
 $( '#wpTextbox1' ).textSelection( 'encapsulateSelection', {
  pre: '* ',
  post: '\n',
  peri: 'item',
  selectPeri: true,
  splitlines: true
 } );
instead of step 2 (which also shows that this indeed is an issue with jquery.textSelection, and not with WikiEditor).
Comment 1 Bartosz Dziewoński 2014-09-13 12:59:34 UTC
selectPeri is documented (in code) not to work with splitlines:

  selectPeri: true, // Select the peri text if it was inserted (but not if there was a selection and replace==false, or if splitlines==true)
  splitlines: false, // If multiple lines are selected, encapsulate each line individually

The code and comments are clear that this is intentional and by design, and there even is a test for this behavior. I'm not sure if we should change it.
Comment 2 Michael M. 2014-09-15 07:54:18 UTC
Hm. Blame tells me that I reported the bug for which this was changed: Bug 29105. Of course, when the sample text can't be selected (because it is splitted into multiple parts) it shouldn't be selected. But if it can, it should, and in most cases there shouldn't be newlines in the sample text, so it won't get split up.
When you use WikiEditor to insert a list, you want to override the sample text. Why should you have to select it yourself to do so?
Comment 3 Bartosz Dziewoński 2014-09-16 11:22:30 UTC
Hmm. Okay, that's actually reasonable.

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


Navigation
Links