Ticket #158 (review New Feature)

Opened 8 years ago

Last modified 4 years ago

Enable find in source view mode

Reported by: jtosi@… Owned by: garry.yao
Priority: Normal Milestone:
Component: UI : Source View Version:
Keywords: IBM Cc: predecess@…, garry.yao, satya_minnekanti@…

Description

We would like to have the 'find' button enabled in the source view mode of the editor.

Attachments

158.patch (18.8 KB) - added by garry.yao 4 years ago.
158_2.patch (19.0 KB) - added by garry.yao 4 years ago.

Change History

comment:1 Changed 8 years ago by fredck

  • Keywords source, find removed
  • Component changed from UI : Toolbar to UI : Source View

Ok. Just remember that the find feature built in on browsers will also search the text in the source view.

comment:2 follow-up: ↓ 3 Changed 8 years ago by mjk

I've implemented this by implementing source view to run as <pre> inside of the main editing panel, and escaping ampersand and tags -- that way, the same Find/Replace code will work irrespective of mode. I'll check this into /branches/mjk when I get around to merging my changes into 2.4.

comment:3 in reply to: ↑ 2 Changed 8 years ago by fredck

Replying to mjk:

I've implemented this by implementing source view to run as <pre> inside of the main editing panel, and escaping ampersand and tags

This thing needs a lot of discussion. I would recommend you to create a specific branch for this feature (FCKeditor/branches/features/richsource) and open a ticket to discussion it. There are other related features (like source coloring) and mainly a lot of issues to be workaround for it.

comment:4 Changed 8 years ago by mjk

I've made a solid first cut at this as part of [244]. I've patched this in from my local changes to 2.3, so the new enter key behaviour needs to be dealt with. This also opens up the possibility of implementing syntax colouring.

comment:5 Changed 8 years ago by alfonsoml

Now when switching modes in Firefox I get this error all the time

oRange.Select is not a function
http://localhost/fckdev/editor/_source/internals/fck.js
Line 278

comment:6 Changed 8 years ago by alfonsoml

#521 has been marked as dup

comment:7 Changed 8 years ago by alfonsoml

  • Cc predecess@… added

comment:8 Changed 7 years ago by w.olchawa

  • Keywords Discussion added

comment:9 Changed 6 years ago by deweller

Here is what I have discovered in v2.6.3:

When I allow Find/Replace toolbar button in source mode, I get a javascript error when trying to find text in source mode.

The code to enable the Find button that I am using is this:

FCKToolbarItems.RegisterItem('Find', new FCKToolbarButton('Find', FCKLang.Find, null, null, true, null, 16));

When I enter source mode, then click the find icon, type in text in the dialog and click the Find button, I get a javascript error. This happens in both IE 7 and Firefox 3.0.1.

IE 7 reports this error:

Line: 68 Error: 'nodeType' is null or not an object

The problem appears to be that the fck_replace.html dialog is trying to search the content of oEditor.FCK.EditorDocument. While in source mode, this object is null.

comment:10 follow-up: ↓ 12 Changed 6 years ago by alfonsoml

  • Milestone set to CKEditor 3.x

#2842 has been marked as dup

comment:11 Changed 6 years ago by garry.yao

  • Cc garry.yao added

comment:12 in reply to: ↑ 10 Changed 6 years ago by starz

Replying to alfonsoml:

#2842 has been marked as dup

Can Find and Replace be added to next release of FCKeditor?

comment:13 Changed 4 years ago by fredck

  • Milestone CKEditor 3.x deleted

Milestone CKEditor 3.x deleted

comment:14 Changed 4 years ago by damo

  • Keywords IBM added

We're interested in this as well.

comment:15 Changed 4 years ago by wwalc

  • Status changed from new to confirmed
  • Keywords Discussion removed

Features like like source coloring mentioned in comment:3 should be handled by another ticket as it is a separate feature.

I guess the only possible thing to discuss here is whether "replace" should also replace content inside of HTML tags or not (e.g whether replacing "div" into "xyz" should result in <div>div</div> being changed into <xyz>xyz<xyz> or only into <div>xyz</div>).

I'd say we should not complicate things here as it could be quite hard to implement, so it looks like it'd be definitely better to treat source code just like text and produce <xyz>xyz<xyz>.

This way it will be possible to correct change/attributes quickly, change HTML elements into other elements etc.

comment:16 Changed 4 years ago by wwalc

Syntax highlighting is covered by #602

comment:17 Changed 4 years ago by satya

  • Cc satya_minnekanti@… added

comment:18 Changed 4 years ago by fredck

We'll certainly not consider tags here. The entire contents will be handled in a whole, just like a normal plain text field.

Changed 4 years ago by garry.yao

comment:19 Changed 4 years ago by garry.yao

  • Owner set to garry.yao
  • Status changed from confirmed to review

comment:20 Changed 4 years ago by garry.yao

Patch created upon 3.6.x branch.

comment:21 Changed 4 years ago by fredck

  • Status changed from review to review_failed

At this stage, I would ask to please not add code into core for this feature. Everything should be done directly from the dialog code.

If we see that this feature can be used for other parts of the code, we may then decide to migrate it to core.

Changed 4 years ago by garry.yao

comment:22 Changed 4 years ago by garry.yao

  • Status changed from review_failed to review

text selection range stuff moved to plugin.

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