Find & Replace is not JavaScript-friendly

Description

When running Find & Replace against text that is longer than a few paragraphs, the editor will run very slowly and often trigger an alert in FF, informing the user that the script is misbehaving and asking whether it should be stopped or not. This usually happens if are trying to find and replace in one go. A better way to handle this functionality is to process smaller chunks of text, say 100 lines or one paragraph at a time, and use JS timer (i.e. setTimer) to process every chunk leaving a few milliseconds between iterations.

Sorry Wojtek, this is not a DUP. It is a proposal for a better implementation for the Find/Replace code, which will still hang on extremely long texts. It is something that worths to be considered, but not that urgent since Martin fixed #2150.

Actually this idea might have a much wider use for CKeditor 3 than just the Find/Replace dialog. The problem with extremely long documents isn't limited to the Find/Replace algorithm, it also causes problem in other areas - say, when switching to Source mode, or submitting the FCKeditor form. In such areas where the length of the document might cause unpleasant latency, a simple JavaScript scheduler may be needed to run the task in chunks. If it is possible to approximate how much has been done vs. how much there is to do, we can also add a progress bar so the user knows his browser is not dead.

Exactly. I have been using this technique for years and it works well even with long-running tasks spanning minutes. The browser dialog informing users that the script is too aggressive doesn't promote FCKeditor as a very mature app.

FCKeditor was retired and is no longer supported. All active development was moved to its successor, ​CKEditor 3.x, that is a fully mature and far superior product. We recommend you upgrade as soon as possible since this issue is no longer a problem in current code base.