Page MenuHomePhabricator

wikibits/insertTags issue on Opera 9.5
Closed, ResolvedPublic

Description

Author: pcooper

Description:
On Opera 9.5 (on Windows at least), clicking on a letter or tag to insert it on the editing page inserts the character or tag correctly, but then moves the text cursor to the beginning of the text box. I believe that on previous versions of Opera, and in other browsers, it correctly left the text cursor after the inserted text such that one could click on more than one symbol or tag to be inserted.

I don't know if it's an Opera issue or a MediaWiki issue, but I'd appreciate it if somebody more familiar with the insertTags function looked at it.

Thank you.


Version: 1.12.x
Severity: normal
OS: Windows XP
Platform: PC

Details

Reference
bz14585

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:13 PM
bzimport set Reference to bz14585.
bzimport added a subscriber: Unknown Object (MLST).

The problem is the following (the code could be found in edit.js, function insertTags).

With "range.text = tagOpen + selText + tagClose;" the new text is set and the cursor is set after the new text, so up to this point it's correct. But then "range.select();" is called. It's nothing selected at this time, so the cursor is set to the beginning. Normally the text should be selected again using the code between these two lines, but this doesn't work. So the first fix would be to put "range.select();" into the block "if (isSample && range.moveStart)". This line has to be in this block.

But this wouldn't fix the problem: the text should be selected again using this block and Opera doesn't go into this block, because "isSample" is false. "isSample" should be set to true using "checkSelectedText()", a subroutine of "insertTags()". The corresponding line seems to be executed, but the value isn't set. This seems to be a problem of global/local variables... the line "selText = sampleText;" is executed, too but "selText" doesn't change. I don't know the details of JavaScript and validity of variables, but this is the problem...

I'm using newest stable version of Opera - 9.52 - and edit buttons work fine. I suggest closing the bug.

This is true. Opera 9.52 has the same behavior like current Firefox and IE versions, so this seems to be correct now.

alexsm333 wrote:

As far as I can see, this was a bug in Opera 9.50 and Opera 9.51.

Suggest closing.

To #1: range.select() is necessary for IE to make the selection visible again.

Closing the bug, the affected versions of Opera were responsible for 0.06% of hits last month per http://stats.wikimedia.org/wikimedia/squids/SquidReportClients.htm