index.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Configuration variables: &mdash; Converse.js 0.3 documentation</title>
  7. <link rel="stylesheet" href="_static/stylesheet.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: '',
  12. VERSION: '0.3',
  13. COLLAPSE_INDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="_static/jquery.js"></script>
  19. <script type="text/javascript" src="_static/underscore.js"></script>
  20. <script type="text/javascript" src="_static/doctools.js"></script>
  21. <link rel="top" title="Converse.js 0.3 documentation" href="#" />
  22. </head>
  23. <body>
  24. <div id="header_wrap" class="outer">
  25. <header class="inner">
  26. <a id="forkme_banner" href="https://github.com/jcbrand/converse.js">View on GitHub</a>
  27. <h1 id="project_title"><a href="http://conversejs.org">Converse.js</a></h1>
  28. <h2 id="project_tagline">Documentation</h2>
  29. <section id="downloads">
  30. <a class="zip_download_link" href="https://github.com/jcbrand/converse.js/zipball/master">Download this project as a .zip file</a>
  31. <a class="tar_download_link" href="https://github.com/jcbrand/converse.js/tarball/master">Download this project as a tar.gz file</a>
  32. </section>
  33. </header>
  34. </div>
  35. <div id="main_content_wrap" class="outer">
  36. <div class="related">
  37. <h3>Navigation</h3>
  38. <ul>
  39. <li class="right" style="margin-right: 10px">
  40. <a href="genindex.html" title="General Index"
  41. accesskey="I">index</a></li>
  42. <li><a href="#">Converse.js 0.3 documentation</a> &raquo;</li>
  43. </ul>
  44. </div>
  45. <section id="main_content" class="inner">
  46. <div class="document">
  47. <div class="documentwrapper">
  48. <div class="body">
  49. <div class="toctree-wrapper compound">
  50. <ul class="simple">
  51. </ul>
  52. </div>
  53. <div class="contents local topic" id="table-of-contents">
  54. <p class="topic-title first">Table of Contents</p>
  55. <ul class="simple">
  56. <li><a class="reference internal" href="#configuration-variables" id="id1">Configuration variables:</a><ul>
  57. <li><a class="reference internal" href="#prebind" id="id2">prebind</a></li>
  58. <li><a class="reference internal" href="#fullname" id="id3">fullname</a></li>
  59. <li><a class="reference internal" href="#bosh-service-url" id="id4">bosh_service_url</a></li>
  60. <li><a class="reference internal" href="#xhr-user-search" id="id5">xhr_user_search</a></li>
  61. <li><a class="reference internal" href="#auto-subscribe" id="id6">auto_subscribe</a></li>
  62. <li><a class="reference internal" href="#animate" id="id7">animate</a></li>
  63. </ul>
  64. </li>
  65. </ul>
  66. </div>
  67. <div class="section" id="configuration-variables">
  68. <h1><a class="toc-backref" href="#id1">Configuration variables:</a><a class="headerlink" href="#configuration-variables" title="Permalink to this headline">¶</a></h1>
  69. <div class="section" id="prebind">
  70. <h2><a class="toc-backref" href="#id2">prebind</a><a class="headerlink" href="#prebind" title="Permalink to this headline">¶</a></h2>
  71. <p>Use this option when you want to attach to an existing XMPP connection that was
  72. already authenticated (usually on the backend before page load).</p>
  73. <p>This is useful when you don&#8217;t want to render the login form on the chat control
  74. box with each page load.</p>
  75. <p>When set to true, you&#8217;ll need to make sure that the onConnected method is
  76. called, and passed to it a Strophe connection object.</p>
  77. <p>Besides requiring the back-end to authenticate you, you&#8217;ll also
  78. have to write a Javascript snippet to attach to the set up connection:</p>
  79. <div class="highlight-python"><pre>$.JSON({
  80. 'url': 'mysite.com/xmpp-authenticate',
  81. 'success': function (data) {
  82. connection = new Strophe.Connection(bosh_service_url);
  83. connection.attach(data.jid, data.sid, data.rid, converse.onConnected);
  84. }</pre>
  85. </div>
  86. <p>The backend must authenticate for you, and then return a SID (session ID) and
  87. RID (Request ID), which you use when you attach to the connection.</p>
  88. </div>
  89. <div class="section" id="fullname">
  90. <h2><a class="toc-backref" href="#id3">fullname</a><a class="headerlink" href="#fullname" title="Permalink to this headline">¶</a></h2>
  91. <p>If you are using prebinding, you need to specify the fullname of the currently
  92. logged in user.</p>
  93. </div>
  94. <div class="section" id="bosh-service-url">
  95. <h2><a class="toc-backref" href="#id4">bosh_service_url</a><a class="headerlink" href="#bosh-service-url" title="Permalink to this headline">¶</a></h2>
  96. <p>Connections to an XMPP server depend on a BOSH connection manager which acts as
  97. a middle man between HTTP and XMPP.</p>
  98. <p>See <a class="reference external" href="http://metajack.im/2008/09/08/which-bosh-server-do-you-need/l">here</a> for more information.</p>
  99. </div>
  100. <div class="section" id="xhr-user-search">
  101. <h2><a class="toc-backref" href="#id5">xhr_user_search</a><a class="headerlink" href="#xhr-user-search" title="Permalink to this headline">¶</a></h2>
  102. <p>There are two ways to add users.</p>
  103. <ul class="simple">
  104. <li>The user inputs a valid JID (Jabber ID), and the user is added as a pending</li>
  105. </ul>
  106. <p>contact.
  107. * The user inputs some text (for example part of a firstname or lastname), an XHR will be made to a backend, and a list of matches are returned. The user can then choose one of the matches to add as a contact.</p>
  108. <p>This setting enables the second mechanism, otherwise by default the first will
  109. be used.</p>
  110. </div>
  111. <div class="section" id="auto-subscribe">
  112. <h2><a class="toc-backref" href="#id6">auto_subscribe</a><a class="headerlink" href="#auto-subscribe" title="Permalink to this headline">¶</a></h2>
  113. <p>If true, the user will automatically subscribe back to any contact requests.</p>
  114. </div>
  115. <div class="section" id="animate">
  116. <h2><a class="toc-backref" href="#id7">animate</a><a class="headerlink" href="#animate" title="Permalink to this headline">¶</a></h2>
  117. <p>Show animations, for example when opening and closing chat boxes.</p>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. <div class="clearer"></div>
  123. </div>
  124. </section>
  125. <div class="related">
  126. <h3>Navigation</h3>
  127. <ul>
  128. <li class="right" style="margin-right: 10px">
  129. <a href="genindex.html" title="General Index"
  130. >index</a></li>
  131. <li><a href="#">Converse.js 0.3 documentation</a> &raquo;</li>
  132. </ul>
  133. </div>
  134. </div>
  135. <div id="footer_wrap" class="outer">
  136. <footer class="inner">
  137. &copy; Copyright 2013, JC Brand.
  138. <p class="copyright">Converse.js created by <a href="http://opkode.com" target="_blank">jcbrand</a></p>
  139. </footer>
  140. </div>
  141. </body>
  142. </html>