jQuery branch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

jQuery branch

Jacques Le Roux
Administrator
Hi,

We are not yet completly ready (almost all is done, we need more testing), but I think that when we will merge the jQuery branch
we should use

jQuery.noConflict();

and keep using jQuery( instead of the $( shortcut. Until we all agree about not doing so.

Because some of us are certainly using Dojo or/and Prototype in their custom projects based on trunk and it would be a nightmare
otherwise.

Jacques


Reply | Threaded
Open this post in threaded view
|

Re: jQuery branch

Sascha Rodekamp-3
+1
if we writing code for our (widget) framework and make our own jQuery
plugins (for ofbiz) :-) it's best practice to use jQuery( ... instead of $(
...

Cheers
Sascha

2010/10/13 Jacques Le Roux <[hidden email]>

> Hi,
>
> We are not yet completly ready (almost all is done, we need more testing),
> but I think that when we will merge the jQuery branch
> we should use
>
> jQuery.noConflict();
>
> and keep using jQuery( instead of the $( shortcut. Until we all agree about
> not doing so.
>
> Because some of us are certainly using Dojo or/and Prototype in their
> custom projects based on trunk and it would be a nightmare otherwise.
>
> Jacques
>
>
>


--
Sascha Rodekamp
    Lynx-Consulting GmbH
    Johanniskirchplatz 6
    D-33615 Bielefeld
    http://www.lynx.de
Reply | Threaded
Open this post in threaded view
|

Re: jQuery branch

Jacques Le Roux
Administrator
As you know the jQuery branch has been merged to the trunk.

I suggested to use jQuery.noConflict(); and to keep using jQuery( instead of the $( shortcut

In the trunk I finally think we should continue to use "jQuery( instead of the $( shortcut" to allow custom project to use other
libs but we don't need "jQuery.noConflict();" because OOTB there are no other js libs so no risks of conflicts

Jacques

From: "Sascha Rodekamp" <[hidden email]>

> +1
> if we writing code for our (widget) framework and make our own jQuery
> plugins (for ofbiz) :-) it's best practice to use jQuery( ... instead of $(
> ...
>
> Cheers
> Sascha
>
> 2010/10/13 Jacques Le Roux <[hidden email]>
>
>> Hi,
>>
>> We are not yet completly ready (almost all is done, we need more testing),
>> but I think that when we will merge the jQuery branch
>> we should use
>>
>> jQuery.noConflict();
>>
>> and keep using jQuery( instead of the $( shortcut. Until we all agree about
>> not doing so.
>>
>> Because some of us are certainly using Dojo or/and Prototype in their
>> custom projects based on trunk and it would be a nightmare otherwise.
>>
>> Jacques
>>
>>
>>
>
>
> --
> Sascha Rodekamp
>    Lynx-Consulting GmbH
>    Johanniskirchplatz 6
>    D-33615 Bielefeld
>    http://www.lynx.de
>


Reply | Threaded
Open this post in threaded view
|

Re: jQuery branch

Sascha Rodekamp-3
Yes cool Jacques ... i will do an trunk update right now ;)

Thanks for the merge.

You're right we should definitely keep the "jQuery( ... );" style and yes
"jQuery.noConflict();"  is obsolete now.

Cheers and have good day.
Sascha

2010/12/11 Jacques Le Roux <[hidden email]>

> As you know the jQuery branch has been merged to the trunk.
>
> I suggested to use jQuery.noConflict(); and to keep using jQuery( instead
> of the $( shortcut
>
> In the trunk I finally think we should continue to use "jQuery( instead of
> the $( shortcut" to allow custom project to use other libs but we don't need
> "jQuery.noConflict();" because OOTB there are no other js libs so no risks
> of conflicts
>
> Jacques
>
> From: "Sascha Rodekamp" <[hidden email]>
>
>> +1
>> if we writing code for our (widget) framework and make our own jQuery
>> plugins (for ofbiz) :-) it's best practice to use jQuery( ... instead of
>> $(
>> ...
>>
>> Cheers
>> Sascha
>>
>> 2010/10/13 Jacques Le Roux <[hidden email]>
>>
>>  Hi,
>>>
>>> We are not yet completly ready (almost all is done, we need more
>>> testing),
>>> but I think that when we will merge the jQuery branch
>>> we should use
>>>
>>> jQuery.noConflict();
>>>
>>> and keep using jQuery( instead of the $( shortcut. Until we all agree
>>> about
>>> not doing so.
>>>
>>> Because some of us are certainly using Dojo or/and Prototype in their
>>> custom projects based on trunk and it would be a nightmare otherwise.
>>>
>>> Jacques
>>>
>>>
>>>
>>>
>>
>> --
>> Sascha Rodekamp
>>   Lynx-Consulting GmbH
>>   Johanniskirchplatz 6
>>   D-33615 Bielefeld
>>   http://www.lynx.de
>>
>>
>
>


--
Sascha Rodekamp
    Lynx-Consulting GmbH
    Johanniskirchplatz 6
    D-33615 Bielefeld
    http://www.lynx.de
Reply | Threaded
Open this post in threaded view
|

Re: jQuery branch

Adam Heath-2
In reply to this post by Jacques Le Roux
Jacques Le Roux wrote:
> As you know the jQuery branch has been merged to the trunk.
>
> I suggested to use jQuery.noConflict(); and to keep using jQuery(
> instead of the $( shortcut
>
> In the trunk I finally think we should continue to use "jQuery( instead
> of the $( shortcut" to allow custom project to use other libs but we
> don't need "jQuery.noConflict();" because OOTB there are no other js
> libs so no risks of conflicts

if (jQuery) (function($) {
  $.globalMethod();
  $(selector).instanceMethod();
})(jQuery);

>
> Jacques
>
> From: "Sascha Rodekamp" <[hidden email]>
>> +1
>> if we writing code for our (widget) framework and make our own jQuery
>> plugins (for ofbiz) :-) it's best practice to use jQuery( ... instead
>> of $(
>> ...
>>
>> Cheers
>> Sascha
>>
>> 2010/10/13 Jacques Le Roux <[hidden email]>
>>
>>> Hi,
>>>
>>> We are not yet completly ready (almost all is done, we need more
>>> testing),
>>> but I think that when we will merge the jQuery branch
>>> we should use
>>>
>>> jQuery.noConflict();
>>>
>>> and keep using jQuery( instead of the $( shortcut. Until we all agree
>>> about
>>> not doing so.
>>>
>>> Because some of us are certainly using Dojo or/and Prototype in their
>>> custom projects based on trunk and it would be a nightmare otherwise.
>>>
>>> Jacques
>>>
>>>
>>>
>>
>>
>> --
>> Sascha Rodekamp
>>    Lynx-Consulting GmbH
>>    Johanniskirchplatz 6
>>    D-33615 Bielefeld
>>    http://www.lynx.de
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: jQuery branch

Sascha Rodekamp-3
yes Adam that's an option if you don't want to type jQuery. each time you
uses something from the jQ Library.
Hope everyone understands whats going on, here is a little explanation:

Adam tests if jQuery is a valid object and ready to use:
if (jQuery)

If the is true he calls a self calling function and pases the jQuery Object.
The function parameter name is the $.
Within the function you have you're typical jQuery $ shortcut.
 (function($) {
 $.globalMethod();
 $(selector).instanceMethod();
})(jQuery);

Thanks for for the snippet Adam.

Cheers
Sascha

2010/12/11 Adam Heath <[hidden email]>

> Jacques Le Roux wrote:
> > As you know the jQuery branch has been merged to the trunk.
> >
> > I suggested to use jQuery.noConflict(); and to keep using jQuery(
> > instead of the $( shortcut
> >
> > In the trunk I finally think we should continue to use "jQuery( instead
> > of the $( shortcut" to allow custom project to use other libs but we
> > don't need "jQuery.noConflict();" because OOTB there are no other js
> > libs so no risks of conflicts
>
> if (jQuery) (function($) {
>  $.globalMethod();
>  $(selector).instanceMethod();
> })(jQuery);
>
> >
> > Jacques
> >
> > From: "Sascha Rodekamp" <[hidden email]>
> >> +1
> >> if we writing code for our (widget) framework and make our own jQuery
> >> plugins (for ofbiz) :-) it's best practice to use jQuery( ... instead
> >> of $(
> >> ...
> >>
> >> Cheers
> >> Sascha
> >>
> >> 2010/10/13 Jacques Le Roux <[hidden email]>
> >>
> >>> Hi,
> >>>
> >>> We are not yet completly ready (almost all is done, we need more
> >>> testing),
> >>> but I think that when we will merge the jQuery branch
> >>> we should use
> >>>
> >>> jQuery.noConflict();
> >>>
> >>> and keep using jQuery( instead of the $( shortcut. Until we all agree
> >>> about
> >>> not doing so.
> >>>
> >>> Because some of us are certainly using Dojo or/and Prototype in their
> >>> custom projects based on trunk and it would be a nightmare otherwise.
> >>>
> >>> Jacques
> >>>
> >>>
> >>>
> >>
> >>
> >> --
> >> Sascha Rodekamp
> >>    Lynx-Consulting GmbH
> >>    Johanniskirchplatz 6
> >>    D-33615 Bielefeld
> >>    http://www.lynx.de
> >>
> >
> >
>
>


--
Sascha Rodekamp
    Lynx-Consulting GmbH
    Johanniskirchplatz 6
    D-33615 Bielefeld
    http://www.lynx.de
Reply | Threaded
Open this post in threaded view
|

Re: jQuery branch

Adam Heath-2
Sascha Rodekamp wrote:

> yes Adam that's an option if you don't want to type jQuery. each time you
> uses something from the jQ Library.
> Hope everyone understands whats going on, here is a little explanation:
>
> Adam tests if jQuery is a valid object and ready to use:
> if (jQuery)
>
> If the is true he calls a self calling function and pases the jQuery Object.
> The function parameter name is the $.
> Within the function you have you're typical jQuery $ shortcut.
>  (function($) {
>  $.globalMethod();
>  $(selector).instanceMethod();
> })(jQuery);
>
> Thanks for for the snippet Adam.

It's not mine, it comes from tons of jquery extensions, and jquery
itself.  It might even be a recommended best practice, listed
somewhere on their site.
Reply | Threaded
Open this post in threaded view
|

Re: jQuery branch

Jacques Le Roux
Administrator
From: "Adam Heath" <[hidden email]>

> Sascha Rodekamp wrote:
>> yes Adam that's an option if you don't want to type jQuery. each time you
>> uses something from the jQ Library.
>> Hope everyone understands whats going on, here is a little explanation:
>>
>> Adam tests if jQuery is a valid object and ready to use:
>> if (jQuery)
>>
>> If the is true he calls a self calling function and pases the jQuery Object.
>> The function parameter name is the $.
>> Within the function you have you're typical jQuery $ shortcut.
>>  (function($) {
>>  $.globalMethod();
>>  $(selector).instanceMethod();
>> })(jQuery);
>>
>> Thanks for for the snippet Adam.
>
> It's not mine, it comes from tons of jquery extensions, and jquery
> itself.  It might even be a recommended best practice, listed
> somewhere on their site.

Yes, there are other options as well http://docs.jquery.com/Using_jQuery_with_Other_Libraries

What I wanted to say is to keep it as simple as possible: we use always "jQuery(" inside OFBiz OOTB (it's not that much to type and
I don't believe we spend much of our time typing) and people can continue to use all the existing Prototype snippets and their own
with $(

Anyway, I'm open to any other solutions...

Jacques