Re: [jQuery] Announce: Unobtrusive JavaScript with jQuery andsymfony

2007-03-02 Thread David Duymelinck
François Zaninotto schreef:
> Yes, that is exactly that. All calls to "UJS" helpers feed a buffer and the
> code doesn't appear directly in the page. But the page includes a JavaScript
> file, in which the buffered code is written. Therefore, all code included in
> a "UJS" call is separated from the content, even if, for the developer, it
> appears inside the template code.
>
> Francois
>
> -Message d'origine-
> De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la
> part de John Resig
> Envoyé : vendredi 2 mars 2007 09:17
> À : jQuery Discussion.
> Objet : Re: [jQuery] Announce: Unobtrusive JavaScript with jQuery andsymfony
>
> David -
>
> I think the "catch" was the very last item that was mentioned on the
> page: Grouping all "inline" JS snippets into a single file. That's what
> makes the plugin all worth it.
>
>   
That is great, thanks for having patients with me. it wasn't clear to me 
how it all comes together.

-- 
David Duymelinck

[EMAIL PROTECTED]


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Announce: Unobtrusive JavaScript with jQuery andsymfony

2007-03-02 Thread François Zaninotto
Yes, that is exactly that. All calls to "UJS" helpers feed a buffer and the
code doesn't appear directly in the page. But the page includes a JavaScript
file, in which the buffered code is written. Therefore, all code included in
a "UJS" call is separated from the content, even if, for the developer, it
appears inside the template code.

Francois

-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la
part de John Resig
Envoyé : vendredi 2 mars 2007 09:17
À : jQuery Discussion.
Objet : Re: [jQuery] Announce: Unobtrusive JavaScript with jQuery andsymfony

David -

I think the "catch" was the very last item that was mentioned on the
page: Grouping all "inline" JS snippets into a single file. That's what
makes the plugin all worth it.

--John

On 3/2/07, David Duymelinck <[EMAIL PROTECTED]> wrote:
> François Zaninotto schreef:
> > I'm not sure I get you... All the helpers described in the blog post 
> > are bundled with the plugin. Or do you mean something else?
> >
> >
> Why would you need to have a function that writes inline javascript 
> code if the whole idea of the plugin is to generate unobtrusive
javascript.
> I'm talking about the
>
> UJS_write function to be exact.
>
> http://www.symfony-project.com/trac/wiki/sfUJSPlugin#Addingsomecontent
> unobtrusively
>
> It is this example that confused me.
>
>  false;">click me') ?>
>
> Isn't it better to write it as
>
>  UJS_write('click me'); 
> UJS_add_behaviour('a.toggle', 'click', "$('#foobar').toggle();return 
> false;"); ?>
>
> If you go unobtrusive go unobtrusive all the way :)
>
> Once i get around to learning how to use symfony i will definitively 
> give your helper a try. I bet this will amaze my more code challenged 
> colleagues :)
>
> --
> David Duymelinck
> 
> [EMAIL PROTECTED]
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Announce: Unobtrusive JavaScript with jQuery andsymfony

2007-03-02 Thread John Resig
David -

I think the "catch" was the very last item that was mentioned on the
page: Grouping all "inline" JS snippets into a single file. That's
what makes the plugin all worth it.

--John

On 3/2/07, David Duymelinck <[EMAIL PROTECTED]> wrote:
> François Zaninotto schreef:
> > I'm not sure I get you... All the helpers described in the blog post are
> > bundled with the plugin. Or do you mean something else?
> >
> >
> Why would you need to have a function that writes inline javascript code
> if the whole idea of the plugin is to generate unobtrusive javascript.
> I'm talking about the
>
> UJS_write function to be exact.
>
> http://www.symfony-project.com/trac/wiki/sfUJSPlugin#Addingsomecontentunobtrusively
>
> It is this example that confused me.
>
>  false;">click me') ?>
>
> Isn't it better to write it as
>
>  UJS_write('click me');
> UJS_add_behaviour('a.toggle', 'click', "$('#foobar').toggle();return false;");
> ?>
>
> If you go unobtrusive go unobtrusive all the way :)
>
> Once i get around to learning how to use symfony i will definitively give 
> your helper a try. I bet this will amaze my more code challenged colleagues :)
>
> --
> David Duymelinck
> 
> [EMAIL PROTECTED]
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Announce: Unobtrusive JavaScript with jQuery andsymfony

2007-03-01 Thread David Duymelinck
François Zaninotto schreef:
> I'm not sure I get you... All the helpers described in the blog post are
> bundled with the plugin. Or do you mean something else? 
>
>   
Why would you need to have a function that writes inline javascript code 
if the whole idea of the plugin is to generate unobtrusive javascript. 
I'm talking about the

UJS_write function to be exact.

http://www.symfony-project.com/trac/wiki/sfUJSPlugin#Addingsomecontentunobtrusively

It is this example that confused me.

click me') ?>

Isn't it better to write it as 

click me'); 
UJS_add_behaviour('a.toggle', 'click', "$('#foobar').toggle();return false;");
?>

If you go unobtrusive go unobtrusive all the way :)

Once i get around to learning how to use symfony i will definitively give your 
helper a try. I bet this will amaze my more code challenged colleagues :)

-- 
David Duymelinck

[EMAIL PROTECTED]


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Announce: Unobtrusive JavaScript with jQuery andsymfony

2007-03-01 Thread François Zaninotto
I'm not sure I get you... All the helpers described in the blog post are
bundled with the plugin. Or do you mean something else? 

-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la
part de David Duymelinck
Envoyé : jeudi 1 mars 2007 13:06
À : jQuery Discussion.
Objet : Re: [jQuery] Announce: Unobtrusive JavaScript with jQuery andsymfony

François Zaninotto schreef:
> David,
>
> What you ask is exactly what the plugin does. Take a look at the blog 
> post explaining how you can use it to replace obtrusive javascript at:
>
> http://redotheweb.com/2007/02/28/unobtrusive-javascript-made-possible/
>
>   
It's my mistake, I got it now you can write obtrusive but you have an helper
to create unobtrusive javascript. Now i'm wondering is there a place for
that helper in the plugin? It can be the cause for confusion and i'm example
one :)

--
David Duymelinck

[EMAIL PROTECTED]


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Announce: Unobtrusive JavaScript with jQuery andsymfony

2007-03-01 Thread David Duymelinck
François Zaninotto schreef:
> David,
>
> What you ask is exactly what the plugin does. Take a look at the blog post
> explaining how you can use it to replace obtrusive javascript at:
>
> http://redotheweb.com/2007/02/28/unobtrusive-javascript-made-possible/
>
>   
It's my mistake, I got it now you can write obtrusive but you have an 
helper to create unobtrusive javascript. Now i'm wondering is there a 
place for that helper in the plugin? It can be the cause for confusion 
and i'm example one :)

-- 
David Duymelinck

[EMAIL PROTECTED]


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Announce: Unobtrusive JavaScript with jQuery andsymfony

2007-03-01 Thread François Zaninotto
David,

What you ask is exactly what the plugin does. Take a look at the blog post
explaining how you can use it to replace obtrusive javascript at:

http://redotheweb.com/2007/02/28/unobtrusive-javascript-made-possible/

François 

-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la
part de David Duymelinck
Envoyé : jeudi 1 mars 2007 08:47
À : jQuery Discussion.
Objet : Re: [jQuery] Announce: Unobtrusive JavaScript with jQuery andsymfony

François Zaninotto schreef:
> Hi list,
>  
> I just pop in to mention a new plugin for the symfony framework
> (http://www.symfony-project.com) that uses jQuery to implement 
> unobtrusive scripting. It's still in its infancy, but it takes the 
> best of the jQuery syntax concision and provides useful tools for 
> interface developers who worry about accessibility.
>  
> The plugin description is available at:
>  
> http://www.symfony-project.com/trac/wiki/sfUJSPlugin
>  
I took a look at the demo's on the plugin page and the first thing i noticed
was the use of the onclick event. My idea of unobtrusive scripting is to
strip as much javascript as possible out of the html code.

wouldn't it be possible to do something like this



test





 


and render it like this



test

$(function(){

$('#foobar').click(function() { alert('foobar') });


});







i'm just thinking aloud. It could also be good to cache the javascript like
this 

Anyway nice work. I feels good to see jquery hooked into php, before we know
it will be the prototype library of php :)

--
David Duymelinck

[EMAIL PROTECTED]


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/