Hi,
After digging around for a while in trac I found this ticket: http://dev.fckeditor.net/ticket/1427
I'm interested in writing the feature - but I'm wondering if there is a organizational guide or some set of developer documentation that indicates any restrictions that might prevent a patch from being accepted, and something that outlines the intent of each module and how it's ideally structured.
I spent a few hours today reading through the code, and I still have yet to pinpoint the exact locations within the code where the control-v keypress itself gets handled. Just to clarify, is there a handler already defined for handling this behaviour? I've noticed that IE invokes a dialog upon pressing that key, so my guess is there is at least one defined within the IE editor, but I haven't found it yet.
Any info is appreciated
Fri, 06/05/2009 - 01:24
#1
Re: Word Paste trac ticket 1427
To find out how it's handled, search the code for "paste" that will give you all the references to any paste related code.
In v2 there was an onPaste listener for IE and only onkey(press,down?) for the rest of the browsers. The fact is that for example Firefox 3 also supports onPaste, so that code should be updated in v3, I think that Safari also supports onPaste.
Recently I coded such solution (with some restrictions, like focusing only in Firefox3) for a client, so I can tell you that although the basic idea might be a good start (at least you need to be able to code that before you can get the full solution) it fails to work properly, so you need to do some extra tasks after those initial steps.
If you want to get started:
search the code to find the references for Paste and study that code, you need to hook you event listener for onPaste (note: you don't need to change any core code, at least in v2 everything can be done as a plugin), and you'll need to remove the default listeners because they aren't really useful.
When you have done those steps we can keep on talking.
Re: Word Paste trac ticket 1427
Most notably in my environment people almost always paste from Word - so I'm now considering creating a feature which is basically "force paste from word". All pasted content will be parsed through your word cleaner function.
Out of curiousity did anyone ever considered creating such a "Force Paste through Word Cleaner" option? My understanding is that the word handling code will not mangle html - and my tests seem to bear that out.
I'm going to need to play with it under 2.6.4 regardless, since that is what I have deployed right now. After this is working I'll start merging it into 3.
Right now I don't actually have code that I can modify and test - the sources are provided, but I don't have a script or instructions needed to take those scripts and minify them into the corresponding gecko and ie files. Suggestions?
thanks for taking the time to reply
Re: Word Paste trac ticket 1427
Poping the paste dialog is far from optimal from a user point of view, but at least it can get you started.
Remember that as I said, you don't need to change any core file to get this functionality, but it can help you to debug through the code.
My best advice would be to use the SVN version: http://docs.fckeditor.net/FCKeditor_2.x ... _Guide/SVN that way you are working directly with the uncompressed sources and you only need to care about the compression when you want to release the code, but there's a .bat that takes care of it.
If you work with the downloaded code, then you must follow this instructions http://docs.fckeditor.net/FCKeditor_2.x ... ompression ,or explained in other words: viewtopic.php?f=6&t=13834&p=36225#p36225
Re: Word Paste trac ticket 1427