Announcing RJSCallback 0.1 The RJS Callback plugin is being developed to provide Ruby On Rails with the ability to easily call RJS templates for the various callbacks associated with AJAX function calls (e.g., :before, :loading, :complete). Currently this plugin automatically detects, loads, and renders RJS templates with specific names and inserts them in the appropriate spot in remote_function calls. The templates follow a specific naming convention.. --- ''shared/_#{callback}.rjs'' will be used for the ''callback'' of all AJAX calls. ''shared/#{action}_#{callback}.rjs'' will be used for all ''callback''s from all controllers generated to the ''action'' method ''views/controller/_#{callback}.rjs'' will be used for the callback of all AJAX calls in a particular controller ''views/controller/#{action}_#{callback}.rjs'' will be used for a specific controller/action/callback combination. ----- Manually specified callbacks in any remote_function calls will override these template files. The biggest drawback to this approach right now is that this plugin scans for available files for EACH instance of an AJAX call every time a page is rendered. Even if the resulting scripts are the same. If you have a lot of AJAX calls, or if your RJS template is complicated, this could make your HTML pretty messy. Future versions will hopefully improve the performance a bit and suggestions of how to accomplish this are welcome. Standard disclaimers apply, use at your own risk, may cause rashes if used improperly. It''s also probably full of bugs MIT Licence _Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
Link Please! ;) -Ezra On May 3, 2006, at 6:31 PM, Kevin Olbrich wrote:> Announcing RJSCallback 0.1 > > The RJS Callback plugin is being developed to provide Ruby On Rails > with > the ability to easily call RJS templates for the various callbacks > associated with AJAX function calls > (e.g., :before, :loading, :complete). > > Currently this plugin automatically detects, loads, and renders RJS > templates with specific names and inserts them in the appropriate > spot > in remote_function calls. > > The templates follow a specific naming convention.. > > --- > ''shared/_#{callback}.rjs'' will be used for the ''callback'' of all > AJAX calls. > > ''shared/#{action}_#{callback}.rjs'' will be used for all ''callback''s > from > all controllers generated to the ''action'' method > > ''views/controller/_#{callback}.rjs'' will be used for the callback > of all > AJAX calls in a particular controller > > ''views/controller/#{action}_#{callback}.rjs'' will be used for a > specific > controller/action/callback combination. > ----- > > Manually specified callbacks in any remote_function calls will > override > these template files. > > The biggest drawback to this approach right now is that this plugin > scans for available files for EACH instance of an AJAX call every > time a > page is rendered. Even if the resulting scripts are the same. If you > have a lot of AJAX calls, or if your RJS template is complicated, this > could make your HTML pretty messy. > > Future versions will hopefully improve the performance a bit and > suggestions of how to accomplish this are welcome. > > Standard disclaimers apply, use at your own risk, may cause rashes if > used improperly. > It''s also probably full of bugs > MIT Licence > > _Kevin > -- > Posted with http://DevLists.com. Sign up and save your mailbox. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Ezra Zygmuntowicz wrote:> Link Please! > > ;) > > -EzraProlly this: http://rjscallback.rubyforge.org/wiki/wiki.pl?HomePage And @ RubyForge: http://rubyforge.org/projects/rjscallback/ Joe -- Posted via http://www.ruby-forum.com/.
Yeah, those are the right ones... Duh. On Thursday, May 04, 2006, at 3:47 AM, Joe wrote:>Ezra Zygmuntowicz wrote: >> Link Please! >> >> ;) >> >> -Ezra > >Prolly this: >http://rjscallback.rubyforge.org/wiki/wiki.pl?HomePage > >And @ RubyForge: >http://rubyforge.org/projects/rjscallback/ > >Joe > >-- >Posted via http://www.ruby-forum.com/. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
Kevin> Announcing RJSCallback 0.1 > > The RJS Callback plugin is being developed to provide Ruby On Rails with > the ability to easily call RJS templates for the various callbacks > associated with AJAX function calls (e.g., :before, :loading, :complete).In a Ajax heavy project, I replaced all the tiny RJS files by inline RJS calls because it was much easier to maintain : all the code in one - or 2 - places. Question: wouldn''t you solution trigger a RJS file population explosion, and aggravate the situation? Alain
Quite possibly. It would depend on how you used it. It certainly isn''t ideal for every circumstance. The way I use it is to define one RJS template file for a particular type of action... for example, all the calls to redraw a table could use the ''shared/list_before.rjs'' callback. This would result in consistent behavior across controllers and would DRY things up a bit since you would only have to maintain the RJS template in one place. In other words, it gives you the ability to make the AJAX actions more consistent and easy to implement. Using this approach, I put all the fancy transitions in the callback templates and have the normal RJS template handle all the DOM manipulation and content rendering. If you really wanted to you could define a separate RJS template for every controller/action/callback combo, but I wouldn''t recommend that. On Thursday, May 04, 2006, at 11:12 AM, Alain Ravet wrote:>Kevin > >> Announcing RJSCallback 0.1 >> >> The RJS Callback plugin is being developed to provide Ruby On >>Rails with >> the ability to easily call RJS templates for the various callbacks >> associated with AJAX function calls (e.g., :before, :loading, :complete). > > >In a Ajax heavy project, I replaced all the tiny RJS files by inline RJS >calls because it was much easier to maintain : all the code in one - or >2 - places. > >Question: wouldn''t you solution trigger a RJS file population explosion, >and aggravate the situation? > >Alain > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
On 4 May 2006, at 13:28, Kevin Olbrich wrote:> Quite possibly. It would depend on how you used it. > It certainly isn''t ideal for every circumstance.Top-quoting is at least half as annoying as spam. Just FYI, but thanks for RJSCallback all the same. :-)
I like top-quoting better. Joe Paul Robinson wrote:> On 4 May 2006, at 13:28, Kevin Olbrich wrote: > >> Quite possibly. It would depend on how you used it. >> It certainly isn''t ideal for every circumstance. > > Top-quoting is at least half as annoying as spam. Just FYI, but > thanks for RJSCallback all the same. :-)-- Posted via http://www.ruby-forum.com/.
Sometimes I like it on top... Joe wrote:> I like top-quoting better. > > Joe > > > Paul Robinson wrote: > >>On 4 May 2006, at 13:28, Kevin Olbrich wrote: >> >> >>>Quite possibly. It would depend on how you used it. >>>It certainly isn''t ideal for every circumstance. >> >>Top-quoting is at least half as annoying as spam. Just FYI, but >>thanks for RJSCallback all the same. :-)...and sometimes I like it on the bottom. :-) b
Joe wrote:> I like top-quoting better.Alain bottom top to read we productive counter is top-quoting
On Friday, May 05, 2006, at 11:07 AM, Alain Ravet wrote:>Joe wrote: > >> I like top-quoting better. > >Alain > >bottom >top to >read >we >productive >counter >is >top-quoting > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/railsAlmost as counter productive as arguing about it on a mailing list. _Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
On 5 May 2006, at 13:53, Kevin Olbrich wrote:> Almost as counter productive as arguing about it on a mailing list.I wasn''t arguing, just trying to say "hey, can you not do that, we''re processing several hundred mails a day here and you''re making it a little harder" But I really meant it when I said thanks for RJSCallback. Really. -- Paul
On Friday, May 05, 2006, at 3:19 PM, Paul Robinson wrote:>On 5 May 2006, at 13:53, Kevin Olbrich wrote: > >> Almost as counter productive as arguing about it on a mailing list. > >I wasn''t arguing, just trying to say "hey, can you not do that, >we''re processing several hundred mails a day here and you''re making >it a little harder" > >But I really meant it when I said thanks for RJSCallback. > >Really. > >-- >Paul >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/railsNot complaining about your comment, just about how this thread has degenerated into noise about posting styles (Notice that I didn''t top quote this one). I do appreciate the thanks. Feedback regarding RJSCallback would be welcome as well. _Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.