librelist archives

« back to archive

jquery build script changes

jquery build script changes

From:
Justin Stefani
Date:
2014-10-31 @ 14:14
Hi, Has something changed in the master branch build scripts with respect
to jQuery. I'm building an non-optimized version of the source using
script build-no-locales-no-otr.js. When I run it within my project, I now
get "Uncaught TypeError: undefined is not a function" on a piece of jquery
selector code. It seems that $ is undefined. Any ideas whats different?
This works fine for me in a previous version.

Thanks

Re: [conversejs] jquery build script changes

From:
Jc Brand
Date:
2014-10-31 @ 14:45
On Fri, Oct 31, 2014 at 10:14:19AM -0400, Justin Stefani wrote:
>    Hi, Has something changed in the master branch build scripts with respect
>    to jQuery. I'm building an non-optimized version of the source using
>    script build-no-locales-no-otr.js. When I run it within my project, I now
>    get "Uncaught TypeError: undefined is not a function" on a piece of jquery
>    selector code. It seems that $ is undefined. Any ideas whats different?
>    This works fine for me in a previous version.

Converse.js now hides it's own jQuery object (via jQuery.noConflict) to avoid
it conflicting with people who includ their own versions (which is not ideal,
but people do it anyway).

If you want the jQuery object that converse.js uses, then just use
converse.jQuery.

Re: [conversejs] jquery build script changes

From:
Justin Stefani
Date:
2014-10-31 @ 15:06
Ah ok, and is there a config option to not hide it and still use $

On 31 October 2014 10:45, JC Brand <lists@opkode.com> wrote:

> On Fri, Oct 31, 2014 at 10:14:19AM -0400, Justin Stefani wrote:
> >    Hi, Has something changed in the master branch build scripts with
> respect
> >    to jQuery. I'm building an non-optimized version of the source using
> >    script build-no-locales-no-otr.js. When I run it within my project, I
> now
> >    get "Uncaught TypeError: undefined is not a function" on a piece of
> jquery
> >    selector code. It seems that $ is undefined. Any ideas whats
> different?
> >    This works fine for me in a previous version.
>
> Converse.js now hides it's own jQuery object (via jQuery.noConflict) to
> avoid
> it conflicting with people who includ their own versions (which is not
> ideal,
> but people do it anyway).
>
> If you want the jQuery object that converse.js uses, then just use
> converse.jQuery.
>

Re: [conversejs] jquery build script changes

From:
Jc Brand
Date:
2014-10-31 @ 16:17
On Fri, Oct 31, 2014 at 11:06:21AM -0400, Justin Stefani wrote:
>    Ah ok, and is there a config option to not hide it and still use $

No. This is behavior comes from the build configuration and is therefore not
something that can be made configurable via converse.initialize.

You can do something like: window.$ = converse.jQuery;

Re: [conversejs] jquery build script changes

From:
Jc Brand
Date:
2014-11-09 @ 12:15
On Fri, Oct 31, 2014 at 05:17:46PM +0100, JC Brand wrote:
> On Fri, Oct 31, 2014 at 11:06:21AM -0400, Justin Stefani wrote:
> >    Ah ok, and is there a config option to not hide it and still use $
> 
> No. This is behavior comes from the build configuration and is therefore not
> something that can be made configurable via converse.initialize.
> 
> You can do something like: window.$ = converse.jQuery;

Just an update on this.

I've refactored the API in anticipation of the new release.
I want to get API right before releasing.

I'm planning to provide a writeup explaining the new API changes soon.

For now, I just want to make you aware that the jQuery variable is now under
an "env" object/grouping.

In other words: converse.env.jQuery