Ticket #3709 (closed New Feature: wontfix)

Opened 5 years ago

Last modified 5 months ago

Selected text stays selected when switch to source view and back

Reported by: spx Owned by: garry.yao
Priority: Normal Milestone:
Component: General Version:
Keywords: Confirmed Cc: fournaise, billhenke, joel.peltonen@…

Description

Hello. To me FCKeditor is almost perfect. The only thing I miss from Dreamweaver is selection preservation while switching to source view.

Since I work with very big html files it is very difficult to find any specific place in code. When I select a word (or sentence or picture or table cell) in WYSIWYG mode in Dreamveawer and then switch to source view I find myself in the middle of the (pages of the) code with the same text selected.

If FCKeditor could do that - it would save very much worktime. But FCKeditor resets the cursor location to start of the source.

Attachments

3709.patch (12.7 KB) - added by garry.yao 5 years ago.

Change History

comment:1 Changed 5 years ago by arczi

  • Keywords Confirmed added
  • Milestone set to CKEditor 3.x

I'm not sure if it is possible. There is also other, basic solution: preserve scrolling.

Changed 5 years ago by garry.yao

comment:2 Changed 5 years ago by garry.yao

  • Keywords Review? added
  • Status changed from new to assigned
  • Component changed from UI : Toolbar to General
  • Owner set to garry.yao

Proposing of adding a textselection plugin to handle selection within 'source' mode and enable the 'selection synchronous' feature by config entry syncSelection .

comment:3 Changed 5 years ago by garry.yao

Current limitation: scroll into view for 'source' mode is not implemented yet for all non-IE.

comment:4 Changed 5 years ago by alfonsoml

  • Version FCKeditor 2.6.4 deleted

#385 and #1880 have been marked as dups

comment:5 Changed 4 years ago by fredck

  • Milestone CKEditor 3.x deleted

Milestone CKEditor 3.x deleted

comment:6 Changed 3 years ago by alfonsoml

  • Cc fournaise, billhenke added

#6748 and #6887 have been marked as dups.

comment:7 Changed 3 years ago by j.swiderski

#7386 has been marked as duplicate

comment:8 Changed 2 years ago by chot2

After applying the patch is there anything else to be done? "Proposing of adding a textselection plugin to handle selection within 'source' mode and enable the 'selection synchronous' feature by config entry syncSelection . " .Can you please explain me in detail

comment:9 Changed 2 years ago by chot2

Can any one please help me on this . I am using CKEditor 3.6.2 and I have applied the patch. Is there any thing else to be done ? Can someone please help on this

comment:10 Changed 2 years ago by j.swiderski

If you are seeking advice please use one of our forums (http://cksource.com/forums/) and not bug tracker.

Second I have applied the patch for latest trunk version of CKEditor.
All I had to do to get it working was resolving conflicts in _source\core\config.js file.

To use the plugin - type some enough text so that scrollbar appears. Scroll down a little bit select word/sentence and switch to source. Editor will scroll down to that line (tested under FF8).

comment:11 Changed 2 years ago by chot2

@ j.swiderski

Firstly, Thanks for your prompt response and s sorry for posting in the wrong place . I am still blocked :( Now I have posted it in the forum http://cksource.com/forums/viewtopic.php?f=11&t=24151 . Can you please help me out further there .

comment:12 Changed 2 years ago by j.swiderski

  • Status changed from review to review_failed

I have checked the patch in each browser. The plugin does not work.
Here are my results:

  1. In Webkit selection stays when switching to source but the editor does not scroll down to it.
  2. In FF and IE9-7 it keeps selection and scrolls to it - somewhat works
  3. In Opera it scrolls to the text but it does not select it
  4. In IE6 it does not work.

What is more when you switch from Source to WYSIWYG mode you get stackOverflow error.
Below are errors from browsers:

FF
Message: too much recursion
URI: /ckeditor_trunk/_source/core/dom/node.js
Line: 24

Chrome:
Message: Uncaught RangeError: Maximum call stack size exceeded
URI: /ckeditor_trunk/_source/core/dom/comment.js
Line: 15

Opera:
Code: this.base( text );
Message: Uncaught RangeError: Maximum call stack size exceeded
URI: /ckeditor_trunk/_source/core/dom/comment.js
Line: 20

IE9:
Message: too much recursion
URI: /ckeditor_trunk/_source/core/dom/node.js
Line: 26

comment:13 Changed 2 years ago by j.swiderski

A duplicate was reported in #8610

comment:14 Changed 2 years ago by Sebastian

There's still interest in this feature. It was requested in ticket 9684-QRPH-1050

comment:15 Changed 2 years ago by chengal

Do we have any update on this ticket ?

It is realy really cool feature and evryone loves it.

comment:16 Changed 22 months ago by j.swiderski

#9045 was marked as duplicate.

comment:17 Changed 22 months ago by davidiq

We are also looking for this feature either in the current 3.x CKEditor branch (which I hear is no longer being developed) or in the future 4.x release. Can someone from CKSource comment on if this is being added into the 4.x release?

comment:18 Changed 20 months ago by davidiq

Can anyone in CKSource please comment on if this will be implemented or if there is a way to implement this? I'd hate to have to replace our CKEditor implementation with the Telerik Editor...

comment:19 Changed 19 months ago by req

  • Cc joel.peltonen@… added

comment:20 Changed 16 months ago by s.prontsevich

Does anybody know how to port this patch to the 4.x CKEditor? It's very cool and useful feature! I really need it.

comment:21 Changed 16 months ago by fredck

We're not working on this right now. In any case, you can find a v3 patch on this ticket, which may eventually work. That's a good starting point for those interested on implementing this feature.

comment:22 Changed 16 months ago by s.prontsevich

I've just ported this patch to CKEditor 4.x. Click here.

comment:23 Changed 15 months ago by j.swiderski

#10029 was marked as duplicte.

comment:24 Changed 14 months ago by sirtet

The patch / plugin from comment 22 works for me on 4.0

It would be nice if a patch could be committed to the core, so the plugin can be installed on a normal release, without the need to patch first.

Last edited 13 months ago by sirtet (previous) (diff)

comment:25 Changed 14 months ago by j.swiderski

#611 was marked as duplicate.

comment:26 Changed 13 months ago by sirtet

Maybe it would help the Ticket, if someone with sufficient rights would change the status back to review?

comment:27 Changed 6 months ago by Reinmar

It would fail the review because the patch will definitely not work on CKEDITOR 4.2.x. First someone (everyone can do that) would have to prepare the patch (preferably as a pull request for https://github.com/ckeditor/ckeditor-dev) and then it would be justified to change the status.

Also, I think that this feature can be implemented as a plugin. So it does not need to be a pull request - it can be an addon added to http://ckeditor.com/addons/plugins/all. And that's even more preferable way, because it wouldn't need to wait for us (the core developers) to be reviewed and tested.

comment:28 Changed 6 months ago by sirtet

After i could get the patch working with 4.3 (and also 4.2), i prepared a pull-request: https://github.com/ckeditor/ckeditor-dev/pull/64

This was a mere copy/paste job, due to my limited coding skills. I can't tell if the plugin could be done without having a patch, or if (and how) the code from the patch could be added via a plugin.

The original author prontsevich stated "Maybe it's not the best solution, but it works.": http://ckeditor.com/comment/123133#comment-123133

I tested the sample in latest chrome, FF, Opera, all fine, but IE 10 is not fully working, the selection moves/expands a bit with each WYSIWYG-Source switch.

comment:29 Changed 5 months ago by sirtet

I removed the pull request as it's no more needed. w8tcha has improved the plugin so it needs no core patching...

keeping textselection works out of the box with this: https://github.com/w8tcha/CKEditor-TextSelection-Plugin/

comment:30 Changed 5 months ago by fredck

  • Status changed from review_failed to closed
  • Resolution set to wontfix

Available as a plugin here: http://ckeditor.com/addon/textselection

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy