librelist archives

« back to archive

Hacking on Converse.js

Hacking on Converse.js

From:
vedant agarwala
Date:
2015-02-11 @ 23:43
Hello,

Firstly, congratulations on such an awesome product. It is very easy to use
out-of-the-box.

Now, I want to know how can I hack on the source code of Converse.js.

I have gone through your source code but I cannot understand it. Sorry if
it may be trivial because I have no experience contributing to JS projects
(I have contributed to Qt/C++ projects).

Which files/directories are part of the source and which are part of the
build? If you follow a general pattern followed by all JS projects, can I
have a link to it.

Lets say I want to do a very simple change: Login with particular
credentials everytime and not show the controlbox altogether. Which files
should I look into for this.

Regards,
Vedant.

Re: [conversejs] Hacking on Converse.js

From:
Jc Brand
Date:
2015-02-12 @ 10:51
On Thu, Feb 12, 2015 at 05:13:16AM +0530, vedant agarwala wrote:
>    Hello,
>    Firstly, congratulations on such an awesome product. It is very easy to
>    use out-of-the-box.

Thanks!

>    Now, I want to know how can I hack on the source code of Converse.js.
>    I have gone through your source code but I cannot understand it. Sorry if
>    it may be trivial because I have no experience contributing to JS projects
>    (I have contributed to Qt/C++ projects).
>    Which files/directories are part of the source and which are part of the
>    build? If you follow a general pattern followed by all JS projects, can I
>    have a link to it.

Javascript projects aren't yet that uniform in their conventions.

However, converse.js does things in a way that will be familiar to many JS
developers.

We use Node.js's NPM package manager for build tools and dependencies and we
use http://bower.io for front-end dependencies.

The build files in ./build are composed of converse.js together with a whole
bunch of dependencies defined in ./src/deps-full.js (there are other
alternative builds and dependency lists). The paths of these dependencies are
defined in main.js.

The converse.js file is starting to become quite big, so it might get broken up
in the future, but currently it's just this one file.

To hack on converse.js itself, you work on converse.js. To work on one of
its dependencies, you need to set up the development env and hack on those
then.

http://conversejs.containers/docs/html/development.html

And then once you're done you make a new build with your changes.

https://github.com/jcbrand/converse.js/blob/master/docs/source/builds.rst

The above file will be live on the official documentation soon, but for now
it's still only in the Github repository.

>    Lets say I want to do a very simple change: Login with particular
>    credentials everytime and not show the controlbox altogether. Which files
>    should I look into for this.

In converse.js, like Gowthaman showed.

JC

Re: [conversejs] Hacking on Converse.js

From:
vedant agarwala
Date:
2015-02-12 @ 12:27
Thanks Gowthaman and JC, my questions are answered :)

Regards.

On Thu, Feb 12, 2015 at 4:21 PM, JC Brand <lists@opkode.com> wrote:

> On Thu, Feb 12, 2015 at 05:13:16AM +0530, vedant agarwala wrote:
> >    Hello,
> >    Firstly, congratulations on such an awesome product. It is very easy
> to
> >    use out-of-the-box.
>
> Thanks!
>
> >    Now, I want to know how can I hack on the source code of Converse.js.
> >    I have gone through your source code but I cannot understand it.
> Sorry if
> >    it may be trivial because I have no experience contributing to JS
> projects
> >    (I have contributed to Qt/C++ projects).
> >    Which files/directories are part of the source and which are part of
> the
> >    build? If you follow a general pattern followed by all JS projects,
> can I
> >    have a link to it.
>
> Javascript projects aren't yet that uniform in their conventions.
>
> However, converse.js does things in a way that will be familiar to many JS
> developers.
>
> We use Node.js's NPM package manager for build tools and dependencies and
> we
> use http://bower.io for front-end dependencies.
>
> The build files in ./build are composed of converse.js together with a
> whole
> bunch of dependencies defined in ./src/deps-full.js (there are other
> alternative builds and dependency lists). The paths of these dependencies
> are
> defined in main.js.
>
> The converse.js file is starting to become quite big, so it might get
> broken up
> in the future, but currently it's just this one file.
>
> To hack on converse.js itself, you work on converse.js. To work on one of
> its dependencies, you need to set up the development env and hack on those
> then.
>
> http://conversejs.containers/docs/html/development.html
>
> And then once you're done you make a new build with your changes.
>
> https://github.com/jcbrand/converse.js/blob/master/docs/source/builds.rst
>
> The above file will be live on the official documentation soon, but for now
> it's still only in the Github repository.
>
> >    Lets say I want to do a very simple change: Login with particular
> >    credentials everytime and not show the controlbox altogether. Which
> files
> >    should I look into for this.
>
> In converse.js, like Gowthaman showed.
>
> JC
>

Re: [conversejs] Hacking on Converse.js

From:
vedant agarwala
Date:
2015-02-12 @ 18:07
Hello again,

I guess I need some more help to setup my develop environment.

I do not understand which converse.js should I change.

`./builds/converse.js` is the one I have to include in my HTML to test the
code. Do I have to do something like: change converse.js and then build the
code so that the changes are reflected in `/builds`?

Also, I am using webstorm but I cannot run the project as it is. I include
it a test.html and then run it in a browser. It is very tedious to debug
via a browser. Ctrl+click doesn't work properly: many declarations are
shown for a single function.

Regards,
Vedant.

On Thu, Feb 12, 2015 at 5:57 PM, vedant agarwala <vedant@instano.in> wrote:

> Thanks Gowthaman and JC, my questions are answered :)
>
> Regards.
>
> On Thu, Feb 12, 2015 at 4:21 PM, JC Brand <lists@opkode.com> wrote:
>
>> On Thu, Feb 12, 2015 at 05:13:16AM +0530, vedant agarwala wrote:
>> >    Hello,
>> >    Firstly, congratulations on such an awesome product. It is very easy
>> to
>> >    use out-of-the-box.
>>
>> Thanks!
>>
>> >    Now, I want to know how can I hack on the source code of Converse.js.
>> >    I have gone through your source code but I cannot understand it.
>> Sorry if
>> >    it may be trivial because I have no experience contributing to JS
>> projects
>> >    (I have contributed to Qt/C++ projects).
>> >    Which files/directories are part of the source and which are part of
>> the
>> >    build? If you follow a general pattern followed by all JS projects,
>> can I
>> >    have a link to it.
>>
>> Javascript projects aren't yet that uniform in their conventions.
>>
>> However, converse.js does things in a way that will be familiar to many JS
>> developers.
>>
>> We use Node.js's NPM package manager for build tools and dependencies and
>> we
>> use http://bower.io for front-end dependencies.
>>
>> The build files in ./build are composed of converse.js together with a
>> whole
>> bunch of dependencies defined in ./src/deps-full.js (there are other
>> alternative builds and dependency lists). The paths of these dependencies
>> are
>> defined in main.js.
>>
>> The converse.js file is starting to become quite big, so it might get
>> broken up
>> in the future, but currently it's just this one file.
>>
>> To hack on converse.js itself, you work on converse.js. To work on one of
>> its dependencies, you need to set up the development env and hack on those
>> then.
>>
>> http://conversejs.containers/docs/html/development.html
>>
>> And then once you're done you make a new build with your changes.
>>
>> https://github.com/jcbrand/converse.js/blob/master/docs/source/builds.rst
>>
>> The above file will be live on the official documentation soon, but for
>> now
>> it's still only in the Github repository.
>>
>> >    Lets say I want to do a very simple change: Login with particular
>> >    credentials everytime and not show the controlbox altogether. Which
>> files
>> >    should I look into for this.
>>
>> In converse.js, like Gowthaman showed.
>>
>> JC
>>
>
>

Re: [conversejs] Hacking on Converse.js

From:
vedant agarwala
Date:
2015-02-13 @ 07:42
Hey guys,

Sorry for asking trivial questions. You can ignore my previous mail, as I
have found my answer:

On Thu, Feb 12, 2015 at 11:37 PM, vedant agarwala <vedant@instano.in> wrote:

> Hello again,
>
> I guess I need some more help to setup my develop environment.
>
> I do not understand which converse.js should I change.
>
> `./builds/converse.js` is the one I have to include in my HTML to test the
> code. Do I have to do something like: change converse.js and then build the
> code so that the changes are reflected in `/builds`?
>

The answer to this is changing /converse.js and then running `grunt fetch`
(and again `grunt minify` for production ready minified js).


>
> Also, I am using webstorm but I cannot run the project as it is. I include
> it a test.html and then run it in a browser. It is very tedious to debug
> via a browser. Ctrl+click doesn't work properly: many declarations are
> shown for a single function.
>

Couldn't figure this one out though.


>
> Regards,
> Vedant.
>
> On Thu, Feb 12, 2015 at 5:57 PM, vedant agarwala <vedant@instano.in>
> wrote:
>
>> Thanks Gowthaman and JC, my questions are answered :)
>>
>> Regards.
>>
>> On Thu, Feb 12, 2015 at 4:21 PM, JC Brand <lists@opkode.com> wrote:
>>
>>> On Thu, Feb 12, 2015 at 05:13:16AM +0530, vedant agarwala wrote:
>>> >    Hello,
>>> >    Firstly, congratulations on such an awesome product. It is very
>>> easy to
>>> >    use out-of-the-box.
>>>
>>> Thanks!
>>>
>>> >    Now, I want to know how can I hack on the source code of
>>> Converse.js.
>>> >    I have gone through your source code but I cannot understand it.
>>> Sorry if
>>> >    it may be trivial because I have no experience contributing to JS
>>> projects
>>> >    (I have contributed to Qt/C++ projects).
>>> >    Which files/directories are part of the source and which are part
>>> of the
>>> >    build? If you follow a general pattern followed by all JS projects,
>>> can I
>>> >    have a link to it.
>>>
>>> Javascript projects aren't yet that uniform in their conventions.
>>>
>>> However, converse.js does things in a way that will be familiar to many
>>> JS
>>> developers.
>>>
>>> We use Node.js's NPM package manager for build tools and dependencies
>>> and we
>>> use http://bower.io for front-end dependencies.
>>>
>>> The build files in ./build are composed of converse.js together with a
>>> whole
>>> bunch of dependencies defined in ./src/deps-full.js (there are other
>>> alternative builds and dependency lists). The paths of these
>>> dependencies are
>>> defined in main.js.
>>>
>>> The converse.js file is starting to become quite big, so it might get
>>> broken up
>>> in the future, but currently it's just this one file.
>>>
>>> To hack on converse.js itself, you work on converse.js. To work on one of
>>> its dependencies, you need to set up the development env and hack on
>>> those
>>> then.
>>>
>>> http://conversejs.containers/docs/html/development.html
>>>
>>> And then once you're done you make a new build with your changes.
>>>
>>> https://github.com/jcbrand/converse.js/blob/master/docs/source/builds.rst
>>>
>>> The above file will be live on the official documentation soon, but for
>>> now
>>> it's still only in the Github repository.
>>>
>>> >    Lets say I want to do a very simple change: Login with particular
>>> >    credentials everytime and not show the controlbox altogether. Which
>>> files
>>> >    should I look into for this.
>>>
>>> In converse.js, like Gowthaman showed.
>>>
>>> JC
>>>
>>
>>
>

Re: [conversejs] Hacking on Converse.js

From:
Gowthaman m
Date:
2015-02-12 @ 05:33
Ya vedant go to *converse.js and find method *authenticate

     authenticate: function (ev){
           $jid_input = $form.find('input[name=jid]'),
          * jid = $jid_input.val(), ** //here your  your jid*
            $pw_input = $form.find('input[name=password]'),
     *      password = $pw_input.val(), //here your password*
           some code ......
    }

On Thu, Feb 12, 2015 at 5:13 AM, vedant agarwala <vedant.kota@gmail.com>
wrote:

> Hello,
>
> Firstly, congratulations on such an awesome product. It is very easy to
> use out-of-the-box.
>
> Now, I want to know how can I hack on the source code of Converse.js.
>
> I have gone through your source code but I cannot understand it. Sorry if
> it may be trivial because I have no experience contributing to JS projects
> (I have contributed to Qt/C++ projects).
>
> Which files/directories are part of the source and which are part of the
> build? If you follow a general pattern followed by all JS projects, can I
> have a link to it.
>
> Lets say I want to do a very simple change: Login with particular
> credentials everytime and not show the controlbox altogether. Which files
> should I look into for this.
>
> Regards,
> Vedant.
>
>


-- 




Thanks

Gowthaman M <http://erated.me/p/gowthaman-murugan/>