librelist archives

« back to archive

accessing converse.js from non_amd.html

accessing converse.js from non_amd.html

From:
Jothi Sankar
Date:
2014-10-14 @ 07:38
Hi

I would like to make a call the chatBoxViews.showMessage(msg_dist) from my
non_amd.html. can i do that with converse(object)



-- 
with regards,
Jothi sankar K

Re: [conversejs] accessing converse.js from non_amd.html

From:
Jc Brand
Date:
2014-10-14 @ 07:54

Am 14. Oktober 2014 09:38:14 MESZ, schrieb Jothi Sankar 
<nk.jothisankar@gmail.com>:
>Hi
>
>I would like to make a call the chatBoxViews.showMessage(msg_dist) from
>my
>non_amd.html. can i do that with converse(object)

No, that's a private method not exposed via the API.

I'm working on adding a plugin system for conversejs that will allow one 
to override private methods but it's not yet ready.

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Re: [conversejs] accessing converse.js from non_amd.html

From:
Jc Brand
Date:
2014-10-14 @ 08:17

Am 14. Oktober 2014 10:05:41 MESZ, schrieb Jothi Sankar 
<nk.jothisankar@gmail.com>:
>Okay JC. is there a way to access the showMessage() inside converse.js
>
>I added a function next to
>
>        'initialize': function (settings, callback) {
>            converse.initialize(settings, callback);
>        },
>        'displaychatHistory' : function(jid,rsm,chatbox,callback){
>
>.
>
>.// code
>
>.
>
>*// can i trigger that function from here*
>
>}

Yes, because you are inside the closure and have access to the inner 
converse obj there.


>On Tue, Oct 14, 2014 at 1:31 PM, Jothi Sankar
><nk.jothisankar@gmail.com>
>wrote:
>
>> Thanks for the response JC.
>>
>> As i already asked i am trying to add histories when chat box opened.
>i
>> got the archive messages and want to add that using showMessage()
>because i
>> have made some changes in that method. How can i achieve this? i am
>working
>> with non_amd version
>>
>> On Tue, Oct 14, 2014 at 1:24 PM, JC Brand <lists@opkode.com> wrote:
>>
>>>
>>>
>>> Am 14. Oktober 2014 09:38:14 MESZ, schrieb Jothi Sankar <
>>> nk.jothisankar@gmail.com>:
>>> >Hi
>>> >
>>> >I would like to make a call the chatBoxViews.showMessage(msg_dist)
>from
>>> >my
>>> >non_amd.html. can i do that with converse(object)
>>>
>>> No, that's a private method not exposed via the API.
>>>
>>> I'm working on adding a plugin system for conversejs that will allow
>one
>>> to override private methods but it's not yet ready.
>>>
>>> --
>>> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
>>> gesendet.
>>>
>>
>>
>>
>> --
>> with regards,
>> Jothi sankar K
>>

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Re: [conversejs] accessing converse.js from non_amd.html

From:
Jc Brand
Date:
2014-10-14 @ 08:21

Am 14. Oktober 2014 10:16:18 MESZ, schrieb Jothi Sankar 
<nk.jothisankar@gmail.com>:
>oh thanks JC, Can you show me some code snipet for that?
>
>i have tried with
>
>converse.chatBoxViews.showMessage(mystr)
>
>But its not working.

You're not trying very hard. Inspect the converse object via your browsers
day developer tool and you'll see all the attrs and methods.

Also, please write to the mailing list and not to me personally.

>On Tue, Oct 14, 2014 at 1:43 PM, JC Brand <lists@opkode.com> wrote:
>
>>
>>
>> Am 14. Oktober 2014 10:05:41 MESZ, schrieb Jothi Sankar <
>> nk.jothisankar@gmail.com>:
>> >Okay JC. is there a way to access the showMessage() inside
>converse.js
>> >
>> >I added a function next to
>> >
>> >        'initialize': function (settings, callback) {
>> >            converse.initialize(settings, callback);
>> >        },
>> >        'displaychatHistory' : function(jid,rsm,chatbox,callback){
>> >
>> >.
>> >
>> >.// code
>> >
>> >.
>> >
>> >*// can i trigger that function from here*
>> >
>> >}
>>
>> Yes, because you are inside the closure and have access to the inner
>> converse obj there.
>>
>>
>> >On Tue, Oct 14, 2014 at 1:31 PM, Jothi Sankar
>> ><nk.jothisankar@gmail.com>
>> >wrote:
>> >
>> >> Thanks for the response JC.
>> >>
>> >> As i already asked i am trying to add histories when chat box
>opened.
>> >i
>> >> got the archive messages and want to add that using showMessage()
>> >because i
>> >> have made some changes in that method. How can i achieve this? i
>am
>> >working
>> >> with non_amd version
>> >>
>> >> On Tue, Oct 14, 2014 at 1:24 PM, JC Brand <lists@opkode.com>
>wrote:
>> >>
>> >>>
>> >>>
>> >>> Am 14. Oktober 2014 09:38:14 MESZ, schrieb Jothi Sankar <
>> >>> nk.jothisankar@gmail.com>:
>> >>> >Hi
>> >>> >
>> >>> >I would like to make a call the
>chatBoxViews.showMessage(msg_dist)
>> >from
>> >>> >my
>> >>> >non_amd.html. can i do that with converse(object)
>> >>>
>> >>> No, that's a private method not exposed via the API.
>> >>>
>> >>> I'm working on adding a plugin system for conversejs that will
>allow
>> >one
>> >>> to override private methods but it's not yet ready.
>> >>>
>> >>> --
>> >>> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9
>Mail
>> >>> gesendet.
>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> with regards,
>> >> Jothi sankar K
>> >>
>>
>> --
>> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
>> gesendet.
>>

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.