<p>Then, at the bottom of your page, after the closing <em></body></em> element, put the
following inline Javascript code:</p>
<divclass="highlight-python"><pre><script>
<divclass="highlight-python"><pre>require(['converse'], function (converse) {
converse.initialize({
auto_list_rooms: false,
auto_subscribe: false,
...
...
@@ -232,7 +233,7 @@ following inline Javascript code:</p>
show_controlbox_by_default: true,
xhr_user_search: false
});
</script></pre>
});</pre>
</div>
<p>The <em>index.html</em> file inside the Converse.js folder serves as a nice usable
example of this.</p>
...
...
@@ -247,8 +248,22 @@ logged into their XMPP session upon page reload.</p>
the minified Javascript file. Read <aclass="reference internal"href="#configuration">Configuration</a> and <aclass="reference internal"href="#minification">Minification</a> for more info on how to do
that.</p>
</div>
<divclass="section"id="development">
<h1><aclass="toc-backref"href="#id9">Development</a><aclass="headerlink"href="#development"title="Permalink to this headline">¶</a></h1>
<p>Converse.js uses <aclass="reference external"href="http://requirejs.org">require.js</a> to track and load dependencies.</p>
<p>If you want to develop or customize converse.js, you’ll want to load the
non-minified javascript files.</p>
<p>Add the following two lines to the <em><head></em> section of your webpage.</p>
<p>Converse.js can also be used without require.js. If you for some reason prefer
to use it this way, please refer to <em>non_amd.html</em> for an example of how and in
what order all the Javascript files that converse.js depends on need to be
loaded.</p>
</div>
<divclass="section"id="configuration">
<h1><aclass="toc-backref"href="#id9">Configuration</a><aclass="headerlink"href="#configuration"title="Permalink to this headline">¶</a></h1>
<h1><aclass="toc-backref"href="#id10">Configuration</a><aclass="headerlink"href="#configuration"title="Permalink to this headline">¶</a></h1>
<p>The included minified JS and CSS files can be used for demoing or testing, but
you’ll want to configure <em>Converse.js</em> to suit your needs before you deploy it
on your website.</p>
...
...
@@ -262,14 +277,14 @@ all the available configuration settings.</p>
JS file so that it will include the new settings. Please refer to the
<aclass="reference internal"href="#minification">Minification</a> section for more info on how to do this.</p>
<divclass="section"id="configuration-variables">
<h2><aclass="toc-backref"href="#id10">Configuration variables</a><aclass="headerlink"href="#configuration-variables"title="Permalink to this headline">¶</a></h2>
<h2><aclass="toc-backref"href="#id11">Configuration variables</a><aclass="headerlink"href="#configuration-variables"title="Permalink to this headline">¶</a></h2>
<divclass="section"id="animate">
<h3><aclass="toc-backref"href="#id11">animate</a><aclass="headerlink"href="#animate"title="Permalink to this headline">¶</a></h3>
<h3><aclass="toc-backref"href="#id12">animate</a><aclass="headerlink"href="#animate"title="Permalink to this headline">¶</a></h3>
<p>Default = True</p>
<p>Show animations, for example when opening and closing chat boxes.</p>
</div>
<divclass="section"id="auto-list-rooms">
<h3><aclass="toc-backref"href="#id12">auto_list_rooms</a><aclass="headerlink"href="#auto-list-rooms"title="Permalink to this headline">¶</a></h3>
<h3><aclass="toc-backref"href="#id13">auto_list_rooms</a><aclass="headerlink"href="#auto-list-rooms"title="Permalink to this headline">¶</a></h3>
<p>Default = False</p>
<p>If true, and the XMPP server on which the current user is logged in supports
multi-user chat, then a list of rooms on that server will be fetched.</p>
...
...
@@ -279,30 +294,30 @@ features, number of occupants etc.), so on servers with many rooms this
option will create lots of extra connection traffic.</p>
</div>
<divclass="section"id="auto-subscribe">
<h3><aclass="toc-backref"href="#id13">auto_subscribe</a><aclass="headerlink"href="#auto-subscribe"title="Permalink to this headline">¶</a></h3>
<h3><aclass="toc-backref"href="#id14">auto_subscribe</a><aclass="headerlink"href="#auto-subscribe"title="Permalink to this headline">¶</a></h3>
<p>Default = False</p>
<p>If true, the user will automatically subscribe back to any contact requests.</p>
</div>
<divclass="section"id="bosh-service-url">
<h3><aclass="toc-backref"href="#id14">bosh_service_url</a><aclass="headerlink"href="#bosh-service-url"title="Permalink to this headline">¶</a></h3>
<h3><aclass="toc-backref"href="#id15">bosh_service_url</a><aclass="headerlink"href="#bosh-service-url"title="Permalink to this headline">¶</a></h3>
<p>Connections to an XMPP server depend on a BOSH connection manager which acts as
a middle man between HTTP and XMPP.</p>
<p>See <aclass="reference external"href="http://metajack.im/2008/09/08/which-bosh-server-do-you-need/l">here</a> for more information.</p>
</div>
<divclass="section"id="fullname">
<h3><aclass="toc-backref"href="#id15">fullname</a><aclass="headerlink"href="#fullname"title="Permalink to this headline">¶</a></h3>
<h3><aclass="toc-backref"href="#id16">fullname</a><aclass="headerlink"href="#fullname"title="Permalink to this headline">¶</a></h3>
<p>If you are using prebinding, you need to specify the fullname of the currently
logged in user.</p>
</div>
<divclass="section"id="hide-muc-server">
<h3><aclass="toc-backref"href="#id16">hide_muc_server</a><aclass="headerlink"href="#hide-muc-server"title="Permalink to this headline">¶</a></h3>
<h3><aclass="toc-backref"href="#id17">hide_muc_server</a><aclass="headerlink"href="#hide-muc-server"title="Permalink to this headline">¶</a></h3>
<p>Default = False</p>
<p>Hide the <ttclass="docutils literal"><spanclass="pre">server</span></tt> input field of the form inside the <ttclass="docutils literal"><spanclass="pre">Room</span></tt> panel of the
controlbox. Useful if you want to restrict users to a specific XMPP server of
your choosing.</p>
</div>
<divclass="section"id="prebind">
<h3><aclass="toc-backref"href="#id17">prebind</a><aclass="headerlink"href="#prebind"title="Permalink to this headline">¶</a></h3>
<h3><aclass="toc-backref"href="#id18">prebind</a><aclass="headerlink"href="#prebind"title="Permalink to this headline">¶</a></h3>
<p>Default = False</p>
<p>Use this option when you want to attach to an existing XMPP connection that was
already authenticated (usually on the backend before page load).</p>
...
...
@@ -323,7 +338,7 @@ have to write a Javascript snippet to attach to the set up connection:</p>
RID (Request ID), which you use when you attach to the connection.</p>
<h3><aclass="toc-backref"href="#id18">show_controlbox_by_default</a><aclass="headerlink"href="#show-controlbox-by-default"title="Permalink to this headline">¶</a></h3>
<h3><aclass="toc-backref"href="#id19">show_controlbox_by_default</a><aclass="headerlink"href="#show-controlbox-by-default"title="Permalink to this headline">¶</a></h3>
<p>Default = False</p>
<p>The “controlbox” refers to the special chatbox containing your contacts roster,
status widget, chatrooms and other controls.</p>
...
...
@@ -333,7 +348,7 @@ the page with class <em>toggle-online-users</em>.</p>
page load.</p>
</div>
<divclass="section"id="xhr-user-search">
<h3><aclass="toc-backref"href="#id19">xhr_user_search</a><aclass="headerlink"href="#xhr-user-search"title="Permalink to this headline">¶</a></h3>
<h3><aclass="toc-backref"href="#id20">xhr_user_search</a><aclass="headerlink"href="#xhr-user-search"title="Permalink to this headline">¶</a></h3>
<p>Default = False</p>
<p>There are two ways to add users.</p>
<ulclass="simple">
...
...
@@ -346,9 +361,9 @@ be used.</p>
</div>
</div>
<divclass="section"id="minification">
<h1><aclass="toc-backref"href="#id20">Minification</a><aclass="headerlink"href="#minification"title="Permalink to this headline">¶</a></h1>
<h1><aclass="toc-backref"href="#id21">Minification</a><aclass="headerlink"href="#minification"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="minifying-javascript">
<h2><aclass="toc-backref"href="#id21">Minifying Javascript</a><aclass="headerlink"href="#minifying-javascript"title="Permalink to this headline">¶</a></h2>
<h2><aclass="toc-backref"href="#id22">Minifying Javascript</a><aclass="headerlink"href="#minifying-javascript"title="Permalink to this headline">¶</a></h2>
<p>We use <aclass="reference external"href="http://requirejs.org">require.js</a> to keep track of <em>Converse.js</em> and its dependencies and to
to bundle them together in a single minified file fit for deployment to a
production site.</p>
...
...
@@ -364,14 +379,14 @@ manager, NPM.</p>
<p>You can <aclass="reference external"href="http://requirejs.org/docs/optimization.html">read more about require.js’s optimizer here</a>.</p>
</div>
<divclass="section"id="minifying-css">
<h2><aclass="toc-backref"href="#id22">Minifying CSS</a><aclass="headerlink"href="#minifying-css"title="Permalink to this headline">¶</a></h2>
<h2><aclass="toc-backref"href="#id23">Minifying CSS</a><aclass="headerlink"href="#minifying-css"title="Permalink to this headline">¶</a></h2>
<p>CSS can be minimized with Yahoo’s yuicompressor tool:</p>