Hello,
I need to know how it is possible to make some sort of protection for Tables / Objects / Images in the FCKEditor,
I need to prevent users from deleting those objects using a single keystroke(delete or backspace).
How can i do that?
I thought of going through that logic ->
1. Finding the cursor location
2. Finding whats selected(what will be used for the Delete button), and whats before/after the cursor(Will be used for non-selected delete and backspace keys)
3. Checking if chars before and after the cursor contain < or > and if it does, prevent further events (return false)
It works well with normal textbox but I dont think it'll work with the FCK, i need to get the HTML text and the location of the cursor in the HTML code that is selected in the FCK.
If anyone has a clue how can i prevent those objects to be erased in case delete or backspace are pressed, please help me.
thank you!
I need to know how it is possible to make some sort of protection for Tables / Objects / Images in the FCKEditor,
I need to prevent users from deleting those objects using a single keystroke(delete or backspace).
How can i do that?
I thought of going through that logic ->
1. Finding the cursor location
2. Finding whats selected(what will be used for the Delete button), and whats before/after the cursor(Will be used for non-selected delete and backspace keys)
3. Checking if chars before and after the cursor contain < or > and if it does, prevent further events (return false)
It works well with normal textbox but I dont think it'll work with the FCK, i need to get the HTML text and the location of the cursor in the HTML code that is selected in the FCK.
If anyone has a clue how can i prevent those objects to be erased in case delete or backspace are pressed, please help me.
thank you!

Re: Prevent Users from deleting Images, Tables & Objects usi
thanks, its seriously important.
Re: Prevent Users from deleting Images, Tables & Objects usi
Re: Prevent Users from deleting Images, Tables & Objects usi
Some hints...
Listen to the OnAfterSetHTML event. At that point, you can use the editor API to get the DOM document containing the editor: editorInstance.EditorDocument.
Then, with EditorDocument in hands, you can do the standard DOM manipulation to attach to keypress events and do all the checking stuff.
You can do that inline in the page or in a plugin to be loaded in the editor.
I hope that helps.
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
Re: Prevent Users from deleting Images, Tables & Objects usi
http://docs.fckeditor.net/FCKeditor_2.x ... API#Events
Frederico Knabben
CKEditor Project Lead and CKSource Owner
--
Follow us on: Twitter | Facebook | Google+ | LinkedIn
Re: Prevent Users from deleting Images, Tables & Objects usi
Thanks in advance!