librelist archives

« back to archive

converse.js error and questions

converse.js error and questions

From:
Yang, Debbie
Date:
2015-03-31 @ 00:52
I'm new to using conversejs and am trying to figure out how to incorporate
it into my web application.

A few questions I did not see asked already in the mail archive:

1)  I followed the Quickstart instructions by including the 
converse.min.css and converse.min.js into a test html page and it worked 
fine.  However when I included the converse.min.js into my existing web 
application the Toggle chat button did not appear at the bottom. I am 
getting "Uncaught Error: See almond README: Incorrect module build, no 
module name".  This is from converse.js:410 from build 0.9.1.   Why is 
this happening?  Do I need to do something differently to include it in my
app and have the chat button appear?  Is it not just including this same 
converse.min.js file?  Also, what and where is this almond README?

2)  Is there a way to hook into the control box from my own icon rather 
than the one that comes with converse?  That is I have a chat button in my
app and when clicked that's when I want the converse chat window to appear
for user login. It would be consistent with other things in my app so I 
don't want the Toggle Chat you provide.  Is there a way I can do that?

3)  I've looked at the documentation you've provided but I don't 
understand how to incorporate converse into my app.  This is somewhat 
related to #1 ... If I need to include it in my builds do I include the 
converse.js only or everything that came in the download and not just the 
2 Quickstart files?  Are the instructions different from Quickstart?  The 
rest of the configuring for Bosh, XMPP server etc I understand I'll need 
to do but how do I get converse into my web app without errors as 
described in #1?


Thanks for your help.

-Debbie

Re: [conversejs] converse.js error and questions

From:
Jc Brand
Date:
2015-03-31 @ 15:02
On Tue, Mar 31, 2015 at 12:52:29AM +0000, Yang, Debbie wrote:
>    2)  Is there a way to hook into the control box from my own icon rather
>    than the one that comes with converse?  That is I have a chat button in my
>    app and when clicked that's when I want the converse chat window to appear
>    for user login. It would be consistent with other things in my app so I
>    don't want the Toggle Chat you provide.  Is there a way I can do that?

You can try the API.

converse.chats.open('controlbox');

For more info see here:
https://conversejs.org/docs/html/development.html#chats-grouping

>    3)  I've looked at the documentation you've provided but I don't
>    understand how to incorporate converse into my app.  This is somewhat
>    related to #1 ... If I need to include it in my builds do I include the
>    converse.js only or everything that came in the download and not just the
>    2 Quickstart files?  Are the instructions different from Quickstart?  The
>    rest of the configuring for Bosh, XMPP server etc I understand I'll need
>    to do but how do I get converse into my web app without errors as
>    described in #1?

This depends on your setup. If you already use require.js, then you should
integrate converse.js and its dependencies into your builds as generated by
require.js.

Otherwise you can continue just including the converse.min.js file like in the
quickstart guide.

Regards
JC

Re: [conversejs] converse.js error and questions

From:
Yang, Debbie
Date:
2015-04-02 @ 18:54
Thank you for your reply. 

I have created my own button elsewhere on my webpage but I have not been able to:

1) cause converse to not automatically post the button in the lower right 

	I'm trying to avoid modifying the converse code so I was hoping there 
	was a call where you can specify the location of the toggle button. 
	Is there one that I'm missing in the docs?  Or just turn it off 
completely and have the
	Control box not show up until open() is explicitly called?


2) get the converse.chats.open() to work correctly from my typescript controller.

Is there an example of this being done somewhere that I can take a look 
at?  The open call seems pretty straight forward and yet my method doesn't
like it.



Thanks,
     Debbie


-----Original Message-----
From: conversejs@librelist.com [mailto:conversejs@librelist.com] On Behalf
Of JC Brand
Sent: Tuesday, March 31, 2015 10:03 AM
To: conversejs@librelist.com
Subject: Re: [conversejs] converse.js error and questions

On Tue, Mar 31, 2015 at 12:52:29AM +0000, Yang, Debbie wrote:
>    2)  Is there a way to hook into the control box from my own icon rather
>    than the one that comes with converse?  That is I have a chat button in my
>    app and when clicked that's when I want the converse chat window to appear
>    for user login. It would be consistent with other things in my app so I
>    don't want the Toggle Chat you provide.  Is there a way I can do that?

You can try the API.

converse.chats.open('controlbox');

For more info see here:
https://conversejs.org/docs/html/development.html#chats-grouping

Re: [conversejs] converse.js error and questions

From:
Jc Brand
Date:
2015-04-04 @ 09:13
On Thu, Apr 02, 2015 at 06:54:38PM +0000, Yang, Debbie wrote:
> Thank you for your reply. 
> 
> I have created my own button elsewhere on my webpage but I have not been
able to:
> 
> 1) cause converse to not automatically post the button in the lower right 
> 
> 	I'm trying to avoid modifying the converse code so I was hoping there 
> 	was a call where you can specify the location of the toggle button. 
> 	Is there one that I'm missing in the docs?  Or just turn it off 
completely and have the
> 	Control box not show up until open() is explicitly called?

There isn't. Sounds like something you can/should do it CSS?

> 2) get the converse.chats.open() to work correctly from my typescript 
controller.
> 
> Is there an example of this being done somewhere that I can take a look 
at?  The open call seems pretty straight forward and yet my method doesn't
like it.

There's only the converse.js documentation (that I know of). Perhaps 
someone else on the
mailing list has a gist or example somewhere, but I don't.