Opened 15 years ago

Closed 10 years ago

Last modified 9 years ago

#3709 closed New Feature (wontfix)

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, henke.bill@gmail.com, 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 (1)

3709.patch (12.7 KB) - added by Garry Yao 15 years ago.

Download all attachments as: .zip

Change History (32)

comment:1 Changed 15 years ago by Artur Formella

Keywords: Confirmed added
Milestone: CKEditor 3.x

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

Changed 15 years ago by Garry Yao

Attachment: 3709.patch added

comment:2 Changed 15 years ago by Garry Yao

Component: UI : ToolbarGeneral
Keywords: Review? added
Owner: set to Garry Yao
Status: newassigned

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 15 years ago by Garry Yao

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

comment:4 Changed 15 years ago by Alfonso Martínez de Lizarrondo

Version: FCKeditor 2.6.4

#385 and #1880 have been marked as dups

comment:5 Changed 14 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.x

Milestone CKEditor 3.x deleted

comment:6 Changed 13 years ago by Alfonso Martínez de Lizarrondo

Cc: fournaise henke.bill@gmail.com added

#6748 and #6887 have been marked as dups.

comment:7 Changed 13 years ago by Jakub Ś

#7386 has been marked as duplicate

comment:8 Changed 12 years ago by sameer

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 12 years ago by sameer

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 12 years ago by Jakub Ś

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 12 years ago by sameer

@ 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 12 years ago by Jakub Ś

Status: reviewreview_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 12 years ago by Jakub Ś

A duplicate was reported in #8610

comment:14 Changed 12 years ago by Sebastian

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

comment:15 Changed 12 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 12 years ago by Jakub Ś

#9045 was marked as duplicate.

comment:17 Changed 12 years ago by David Colon

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 12 years ago by David Colon

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 12 years ago by Joel

Cc: joel.peltonen@… added

comment:20 Changed 11 years ago by Sergey

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 11 years ago by Frederico Caldeira Knabben

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 11 years ago by Sergey

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

comment:23 Changed 11 years ago by Jakub Ś

#10029 was marked as duplicte.

comment:24 Changed 11 years 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 11 years ago by sirtet (previous) (diff)

comment:25 Changed 11 years ago by Jakub Ś

#611 was marked as duplicate.

comment:26 Changed 11 years ago by sirtet

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

comment:27 Changed 10 years ago by Piotrek Koszuliński

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 10 years 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 10 years 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 10 years ago by Frederico Caldeira Knabben

Resolution: wontfix
Status: review_failedclosed

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

comment:31 Changed 9 years ago by Jakub Ś

#13259 was marked as duplicate

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy