Forum: Ruby on Rails [ANN] RJSCallback 0.1

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Kevin Olbrich (Guest)
on 2006-05-04 03:32
(Received via mailing list)
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
6076c22b65b36f5d75c30bdcfb2fda85?d=identicon&s=25 Ezra Zygmuntowicz (Guest)
on 2006-05-04 03:41
(Received via mailing list)
Link Please!

;)

-Ezra
429500a5a54600958c9c7ac032a37f66?d=identicon&s=25 Joe (Guest)
on 2006-05-04 03:47
Ezra Zygmuntowicz wrote:
> Link Please!
>
> ;)
>
> -Ezra

Prolly this:
http://rjscallback.rubyforge.org/wiki/wiki.pl?HomePage

And @ RubyForge:
http://rubyforge.org/projects/rjscallback/

Joe
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Kevin Olbrich (Guest)
on 2006-05-04 04:23
(Received via mailing list)
Yeah, those are the right ones... Duh.

On Thursday, May 04, 2006, at 3:47 AM, Joe wrote:
>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
0091f92762685860109bbcb02edfdf27?d=identicon&s=25 Alain Ravet (Guest)
on 2006-05-04 11:14
(Received via mailing list)
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
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Kevin Olbrich (Guest)
on 2006-05-04 14:28
(Received via mailing list)
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:
>In a Ajax heavy project, I replaced all the tiny RJS files by inline RJS
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails


_Kevin
66247570dbe0c350a165cdabc2769ba1?d=identicon&s=25 Paul Robinson (Guest)
on 2006-05-04 22:30
(Received via mailing list)
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. :-)
429500a5a54600958c9c7ac032a37f66?d=identicon&s=25 Joe (Guest)
on 2006-05-05 01:44
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. :-)
4005a47a8f2ceee49670b920593c1d52?d=identicon&s=25 Ben Munat (Guest)
on 2006-05-05 05:18
(Received via mailing list)
Sometimes I like it on top...

Joe 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
0091f92762685860109bbcb02edfdf27?d=identicon&s=25 Alain Ravet (Guest)
on 2006-05-05 11:08
(Received via mailing list)
Joe wrote:

> I like top-quoting better.

Alain

bottom
top to
read
we
productive
counter
is
top-quoting
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Kevin Olbrich (Guest)
on 2006-05-05 14:54
(Received via mailing list)
On Friday, May 05, 2006, at 11:07 AM, Alain Ravet wrote:
>productive
>counter
>is
>top-quoting
>
>_______________________________________________
>Rails mailing list
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails

Almost as counter productive as arguing about it on a mailing list.

_Kevin
66247570dbe0c350a165cdabc2769ba1?d=identicon&s=25 Paul Robinson (Guest)
on 2006-05-05 16:20
(Received via mailing list)
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
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Kevin Olbrich (Guest)
on 2006-05-05 17:31
(Received via mailing list)
On Friday, May 05, 2006, at 3:19 PM, Paul Robinson wrote:
>Really.
>
>--
>Paul
>_______________________________________________
>Rails mailing list
>Rails@lists.rubyonrails.org
>http://lists.rubyonrails.org/mailman/listinfo/rails

Not 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
This topic is locked and can not be replied to.