phew, riddle me this. i can render the tool bar from a regular action, but if I render the ''edit'' form via either rjs or _partial, the toolbar does not render? for rjs i tried doing a replace_html and insert, but the toolbar does not render. only when i call from a regular action. what noobish mistake am i making? when the toolbar does not render, i see no errors in my log, however, i do see the javascript in firebug. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
mixplate wrote:> > > phew, riddle me this. > > > i can render the tool bar from a regular action, but if I render the > ''edit'' form via either rjs or _partial, the toolbar does not render? > > > for rjs i tried doing a replace_html and insert, but the toolbar does > not render. only when i call from a regular action. what noobish mistake > am i making? > > > when the toolbar does not render, i see no errors in my log, however, i > do see the javascript in firebug.If you are rendering from AJAX, this most likely won''t work because the initialization is handled (essentially) by window.onload() -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
mixplate wrote:> > > phew, riddle me this. > > > i can render the tool bar from a regular action, but if I render the > ''edit'' form via either rjs or _partial, the toolbar does not render? > > > for rjs i tried doing a replace_html and insert, but the toolbar does > not render. only when i call from a regular action. what noobish mistake > am i making? > > > when the toolbar does not render, i see no errors in my log, however, i > do see the javascript in firebug.Update: I''ve updated the textile_editor_initialize() helper to support initializing editors via AJAX. Update your local copy and check the lib/textile_editor_helper.rb file for more information :-) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hi thanks, i will look into it for its very imperative for my application ! also, any idea for this? http://s3.amazonaws.com/pical2/photos/333/Picture_1.png when the button is pressed, they expand. thanks for the help and awesome plugin! Chris Scharf wrote:> mixplate wrote: >> >> >> phew, riddle me this. >> >> >> i can render the tool bar from a regular action, but if I render the >> ''edit'' form via either rjs or _partial, the toolbar does not render? >> >> >> for rjs i tried doing a replace_html and insert, but the toolbar does >> not render. only when i call from a regular action. what noobish mistake >> am i making? >> >> >> when the toolbar does not render, i see no errors in my log, however, i >> do see the javascript in firebug. > > Update: I''ve updated the textile_editor_initialize() helper to support > initializing editors via AJAX. Update your local copy and check the > lib/textile_editor_helper.rb file for more information :-)-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hi, is it v0.2. that has the update? hmmm, i have a div id ''edit_form'' where i use rjs to insert the partial that holds the edit_form. how would i call tthe <%= textile_editor_initialize ''edit_form''-%> ? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
mixplate wrote:> hi, is it v0.2. that has the update? > > hmmm, > > i have a div id ''edit_form'' where i use rjs to insert the partial that > holds the edit_form. how would i call tthe > > <%= textile_editor_initialize ''edit_form''-%> ?In the template that contains that div you''ll need to have <%= textile_editor_initialize %> Then, in the partial, add <%= textile_editor_initialize %> again - the helper nows uses request.xhr? to determine how to initialize the editor. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thanks for your reply, ive tried however, just cant seem to get it to render. ################### #index.rhtml <div id = ''edit_form_div'' </div> <div id = ''note'' # here is where i render notes </div ################### #_edit_form <% form_tag :action => ''update'', :id => @note do%> <%= textile_editor ''note'', ''note_a'' -%>< <%= textile_editor_initialize -%> <% end %> ########## rjs when edit button in note div is pressedi page.hide ''note'' page.insert_html :bottom, ''edit_form_div'', :partial => ''edit_form ######### now your post says tto do something like? #index <div id = ''edit_form_div'' <%= textile_editor_initialize %> </div> #partial <% form_tag :action => ''update'', :id => @note do%> <%= textile_editor ''note'', ''note_a'' -%>< <%= textile_editor_initialize -%> <% end %> from reading the directions, aint it only one time to use <%= textile_editor_initialize %>? the current svn has the latest src correct?\ thanks for any help -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
mixplate wrote:> > > thanks for your reply, ive tried however, just cant seem to get it to > render. > > ################### > #index.rhtml > > <div id = ''edit_form_div'' > > </div> > > <div id = ''note'' > # here is where i render notes > </div > > ################### > #_edit_form > <% form_tag :action => ''update'', :id => @note do%> > <%= textile_editor ''note'', ''note_a'' -%>< > <%= textile_editor_initialize -%> > <% end %> > > ########## > rjs when edit button in note div is pressedi > > page.hide ''note'' > page.insert_html :bottom, ''edit_form_div'', :partial => ''edit_form > > ######### > > > now your post says tto do something like? > #index > <div id = ''edit_form_div'' > <%= textile_editor_initialize %> > </div> > > #partial > <% form_tag :action => ''update'', :id => @note do%> > <%= textile_editor ''note'', ''note_a'' -%>< > <%= textile_editor_initialize -%> > <% end %> > > > from reading the directions, aint it only one time to use <%= > textile_editor_initialize %>? the current svn has the latest src > correct?\ > > thanks for any helpI will need to update the directions to be more specific - you should only call the initialize once in a regular render. The latest update allows you to call initialize again when dealing with AJAX. Calling initialize from your edit.rhtml will load in the proper support files (JS and CSS). Then, in the partial, initialize works slightly differently since it''s a AJAX request - it simply drops in a script tag to enable any instance of TEH that are in the partial. Can you post the response from the AJAX request (using Firebug)? Also, just to be sure, run "rake textile_editor_helper:install" again and restart mongrel/webrick. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
in my index <div id = ''eform''> <%= textile_editor_initialize -%> </div> ------------- rjs page.insert_html :bottom, :eform, :partial => ''note_edit_form'' ----------- edit form <% form_tag :action => ''update'', :id => @note do%> <p><label for="howto_title">Title</label><br/> <%= text_field ''note'', ''title'' %></p> <p><label for="howto_howto">Note</label><br/> <%= textile_editor ''note'', ''note'' -%></p> <%= textile_editor_initialize -%> <%= submit_tag ''Save'' %> --- <%= link_to ''Cancel?'', { :action => ''index'' }, :method => "post" %> <% end %> ############### try { new Insertion.Bottom("eform", "\n\n\n\n\n\n\t\n\t\n\t\n\t\n \n\n <form action=\"/account/update/17-test-title \" method=\"post\">\n\n\t<p><label for=\"howto_title\">Title</label><br/>\n\t<input id=\"note_title\" name=\"note[title]\" size=\"30\" type=\"text\" value=\"test title\" /></p>\n\n\n\n\n\t<p><label for =\"howto_howto\">Note</label><br/>\n\n\t<textarea cols=\"40\" id=\"note_note\" name=\"note[note]\" rows =\"20\">test note</textarea></p>\n\t<link href=\"/stylesheets/textile-editor.css?1181957714\" media \"screen\" rel=\"Stylesheet\" type=\"text/css\" />\n<script src=\"/javascripts/textile-editor.js?1181957714 \" type=\"text/javascript\"></script>\n<script type=\"text/javascript\">\nEvent.observe(window, ''load'' , function() {\nTextileEditor.initialize(''note_note'', ''extended'');\n});\n</script>\t\n\t\t\n\n\t<input name=\"commit\" type=\"submit\" value=\"Save\" /> --- <a href=\"/account\" onclick=\"var f = document .createElement(''form''); f.style.display = ''none''; this.parentNode.appendChild(f); f.method = ''POST''; f.action = this.href;var m = document.createElement(''input''); m.setAttribute(''type'', ''hidden''); m.setAttribute (''name'', ''_method''); m.setAttribute(''value'', ''post''); f.appendChild(m);f.submit();return false;\">Cancel ?</a>\n\n\t</form>\n\n"); new Effect.Highlight("note",{duration:0.5}); new Effect.Appear("note",{duration:0.5}); } catch (e) { alert(''RJS error:\n\n'' + e.toString()); alert(''new Insertion.Bottom(\"eform\", \"\\n\\n \\n\\n\\n\\n\\t\\n\\t\\n\\t\\n\\t\\n \\n\\n <form action=\\\"/account/update/17-test-title\\\" method =\\\"post\\\">\\n\\n\\t<p><label for=\\\"howto_title\\\">Title</label><br/>\\n\\t<input id=\\\"note_title \\\" name=\\\"note[title]\\\" size=\\\"30\\\" type=\\\"text\\\" value=\\\"test title\\\" /></p>\\n\\n \\n\\n\\n\\t<p><label for=\\\"howto_howto\\\">Note</label><br/>\\n\\n\\t<textarea cols=\\\"40\\\" id =\\\"note_note\\\" name=\\\"note[note]\\\" rows=\\\"20\\\">test note</textarea></p>\\n\\t<link href \\\"/stylesheets/textile-editor.css?1181957714\\\" media=\\\"screen\\\" rel=\\\"Stylesheet\\\" type \\\"text/css\\\" />\\n<script src=\\\"/javascripts/textile-editor.js?1181957714\\\" type=\\\"text/javascript \\\"></script>\\n<script type=\\\"text/javascript\\\">\\nEvent.observe(window, \''load\'', function() {\\nTextileEditor.initialize(\''note_note\'', \''extended\'');\\n});\\n</script>\\t\\n\\t\\t\\n\\n\\t<input name=\\\"commit\\\" type=\\\"submit\\\" value=\\\"Save\\\" /> --- <a href=\\\"/account\\\" onclick \\\"var f = document.createElement(\''form\''); f.style.display = \''none\''; this.parentNode.appendChild (f); f.method = \''POST\''; f.action = this.href;var m = document.createElement(\''input\''); m.setAttribute (\''type\'', \''hidden\''); m.setAttribute(\''name\'', \''_method\''); m.setAttribute(\''value\'', \''post\''); f .appendChild(m);f.submit();return false;\\\">Cancel?</a>\\n\\n\\t</form>\\n\\n\");\nnew Effect.Highlight (\"note\",{duration:0.5});\nnew Effect.Appear(\"note\",{duration:0.5});''); throw e } -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
It seems like your copy of TEH is not the latest - run "svn info" and see if you have at least revision 126. Looking at your output, I see an Event.observe() call, as well as the inclusion of TEH''s support files - these shouldn''t be included when the request is an AJAX call. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Chris, thank you so much for your help. i was able to get the updates installed correctly and my app is working fine. thanks again! Chris Scharf wrote:> It seems like your copy of TEH is not the latest - run "svn info" and > see if you have at least revision 126. Looking at your output, I see an > Event.observe() call, as well as the inclusion of TEH''s support files - > these shouldn''t be included when the request is an AJAX call.-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---