Last modified: 2014-04-08 08:57:53 UTC
I opened this bug to ask for the restoration of a function belonging to the enhanced editing toolbar, not working in some browsers such as Opera and IE8. This is the function "find and replace", which you can also see marked with red arrows in the following image: [http://img697.imageshack.us/img697/7231/scrrenwiki.png] Thank you
Search&replace is disabled in these browsers because it was broken in them; I will see if I can fix S&R for IE at least.
(In reply to comment #1) > Search&replace is disabled in these browsers because it was broken in them; I > will see if I can fix S&R for IE at least. Some news about it?
The button is enbaled now, but the function is completely broken in Opera. Example: I tried to replace the word "Lorem" with "Kamel" and the result is this diff: http://kamelopedia.mormo.org/index.php?title=Kamel:Nachteule/SearchReplaceBug&diff=442168&oldid=442167 Browser: Opera 11.x MediaWiki: 1.18 r86333, 1.17wmf1 r87486
*Mass-change: Move WikiEditor bugs to component and remove blocker bug where*
This is a bug in jquery.textSelection.js. https://github.com/mediawiki/mediawiki-trunk-phase3/blob/master/resources/jquery/jquery.textSelection.js See this thread: http://my.opera.com/community/forums/topic.dml?id=1051742 See my user JS that fixes it: https://gist.github.com/1712432/
Confirming for Windows XP, IE 7, 800x600px, https://en.wikipedia.org/w/index.php?title=Louisiana_State_Archive_and_Research_Library&action=edit on browserstack.com, not being logged in. Same problem for Opera 12.14, not being logged in. Works correctly in Google Chrome 24 (not logged in) and Firefox 18 (logged in).
*** Bug 48305 has been marked as a duplicate of this bug. ***
Did anyone else take a look at "jquery.textSelection.js"? Like I said on 2012-02-07, the bug is on line 65: getContents: function () { return this.val(); }, https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=resources/jquery/jquery.textSelection.js#l65 In "jquery.textSelection.js", there are a few bugs with handling newlines. For Opera, the only change required is to the `getContents` function. There are more bugs regarding Internet Explorer. The if statements in "jquery.textSelection.js" should be reversed. You want to check for W3C way first and then fallback to Internet Explorer way. Furthermore, the newline strings should not be hardcoded. This causes problems when the browser has a different newline than what was expected, which results in off-by-one errors. Experiment with the following example: function getNewline() { var document = window.document; var textarea = document.createElement("textarea"); textarea.value = "\n"; return textarea.value; } var newline = getNewline(); Running in IE8 mode and Opera 11.50, 11.60: >> newline.length 2 >> newline === "\r\n" true >> newline === "\n" false Running in IE9 mode and Opera 11.64: >> newline.length 1 >> newline === "\r\n" false >> newline === "\n" true