Mike Lee wrote: >> Give us a detailed description of what you are trying to do, >> and we'll try to suggest some alternative solutions. > > Well there a a few things on my mind. But currently the main thing is > the ability to DnD a link over a selection and replace the link's > description with whats in the selection. So if I highlighted "foo" in > the editor, I want to be able to drag and drop a url from the > url/browser/somewhere onto "foo" and have the link wrapped to "foo" > instead of having the url as the text. > > I was thinking (prior to finding nsIEditActionListener) to use > ondragdrop to popup a textbox for the user to input the text (with > selection inserted as default), but then I ran into bug 129869 :) But > replacing selection without prompt is superior.
To those who cares, I implemented the DnD selection stuff I mentioned by implementing onDragOver and onDrop. Except that the onDrop is not on <editor> but a normal <description/> element. The layout in xul is: <deck> <editor/> <description/> </deck> when onDragOver is called it switch the deck to description for which onDrop is working, once the drop is detected, it switch back to editor and insert the link with the description replace with the text in selection. A bit hacky, but only way I can get it to work > The next thing on my list is a fix/workaround for bug 102786. Which I > was thinking of using nsIEditActionListener::WillDeleteSelection, check > for <a> then preserve it for nsIEditActionListener::WillInsertText. > > Then there are the dream of doing some keywords lookup initially for > auto-complete title for <abbr> and <acronym>. Then move off to do some > macro capability. But thats marked 'future' :) > > Thanks > -- Mike Lee Weblog: http://www.exitspace.net/mike
