What I have so far. In my main HTML: <script type="text/javascript" src="/javascripts/tiny_mce/tiny_mce_src.js"></script> <script type="text/javascript"> tinyMCE.init({ mode: "textareas", theme: ''advanced'', theme_advanced_toolbar_location: ''top'' }); ... </script> My Ajax form has a textarea like this: <textarea name="text-foo" id="text-foo"><%= @item.text %></textarea> When my form appears on the page with the magic of Ajax (this is in a method in a wrapper object I use): this.editor_id = ''mce_editor_'' + tinyMCE.idCounter; tinyMCE.execCommand("mceAddControl", true, edit_element.id); In my ''Save'' function - the tinyMCE onsubmit code is hooked in too late for my purposes: tinyMCE.triggerSave(); The important part - when my Ajax form gets removed from the page: tinyMCE.execCommand("mceRemoveControl", true, this.editor_id); If you don''t remove the tinyMCE control when your form gets removed, all sorts of bad things occur. The ''this.editor_id'' value of ''mce_editor_<id>'' is the documented way of doing what I''m doing, but the idCounter isn''t documented. The ''mceAddControl'' doesn''t return the id you need, so you have to construct it. There are about 10,000 options you can set in the ''init'' call, but I haven''t looked too closely there yet. -----Original Message----- From: Rob Clayburn [mailto:rob-M+duPSAH6l8PldudreuJTlpr/1R2p/CL@public.gmane.org] Sent: Friday, December 23, 2005 1:54 AM To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org Subject: Re: [Rails-spinoffs] Scriptaculous and Prototype based Rich TextEditor Hi Tom I''m just about to start on integrating TinyMCE (which is a great editor) with scriptaculous, any pointers on what you''ve learnt would be really appreciated! Cheers Rob Tom Fakes wrote:>I tried using Dojo''s editor - 0.2.1 - and it crashes my Firefox every >time! I''m currently integrating tinyMCE, and after 60 minutes of work, >I almost have it working with my dynamic elements. tinyMCE is very >large though, but very feature rich. > >One thing about the Silk icons - they are .png files, withtransparency,>so IE doesn''t display them correctly. > >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Roberto Saccon
2005-Dec-31 04:44 UTC
Re: Scriptaculous and Prototype based Rich TextEditor
HI all I also need a rich text editor, tried Dojo, it seemded to work fine, but on one of these says, after upgrading my environment to the latest libs, Dojo kept crashing Firefox on windows XP Ajax pages. I really like Pelle lightwight apporach and I also think the silk icons would fit nicely to the toolbar. Unfortunately I am not a javascript expert, but I will take a look at the code and if I manage to impove something, I will post the result. Has anybody played with Pelles code yet ? Pelle, do you continue to work on it and if yes, where do you post new builds ? regards -- Roberto Saccon - http://rsaccon.com _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
I am working on a project using Dojo and Tiny MCE, however I would be interested to know more about this pelle lightweight if possible? On 31/12/05, Roberto Saccon <rsaccon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > HI all > > I also need a rich text editor, tried Dojo, it seemded to work fine, but > on one of these says, after upgrading my environment to the latest libs, > Dojo kept crashing Firefox on windows XP Ajax pages. > > I really like Pelle lightwight apporach and I also think the silk icons > would fit nicely to the toolbar. Unfortunately I am not a javascript expert, > but I will take a look at the code and if I manage to impove something, I > will post the result. > > Has anybody played with Pelles code yet ? Pelle, do you continue to work > on it and if yes, where do you post new builds ? > > regards > -- > Roberto Saccon - http://rsaccon.com > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Roberto Saccon
2006-Jan-01 22:18 UTC
Re: Scriptaculous and Prototype based Rich TextEditor
well, as first step to know more, just take a look at the source code at Pelles initial post of this thread (if you haven''t yet) regards On 1/1/06, Sam Sherlock <sam.sherlock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I am working on a project using Dojo and Tiny MCE, however I would be > interested to know more about this pelle lightweight if possible? > > On 31/12/05, Roberto Saccon <rsaccon-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > HI all > > > > I also need a rich text editor, tried Dojo, it seemded to work fine, but > > on one of these says, after upgrading my environment to the latest libs, > > Dojo kept crashing Firefox on windows XP Ajax pages. > > > > I really like Pelle lightwight apporach and I also think the silk icons > > would fit nicely to the toolbar. Unfortunately I am not a javascript expert, > > but I will take a look at the code and if I manage to impove something, I > > will post the result. > > > > Has anybody played with Pelles code yet ? Pelle, do you continue to work > > on it and if yes, where do you post new builds ? > > > > regards > > -- > > Roberto Saccon - http://rsaccon.com > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >-- Roberto Saccon - http://rsaccon.com _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs