Ticket #2216 (reopened New Feature)

Opened 22 months ago

Last modified 21 months ago

Find & Replace is not JavaScript-friendly

Reported by: A.M. Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Confirmed Cc:

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.

Change History

Changed 22 months ago by w.olchawa

  • status changed from new to closed
  • resolution set to duplicate

This is a DUP of #2150

The problem was solved with fix [1973] which will be released in version 2.6.1.

Changed 22 months ago by fredck

  • keywords Confirmed added
  • status changed from closed to reopened
  • resolution duplicate deleted

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.

Changed 22 months ago by martinkou

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.

Changed 21 months ago by A.M.

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.

Note: See TracTickets for help on using tickets.