Commit 9ee92f24 authored by JC Brand's avatar JC Brand

Changes from master

parent 746862f2
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
Contributing to Converse.js Contributing to Converse.js
=========================== ===========================
Contributions to Converse.js are very welcome. Please follow the usual github Thanks for contributing to Converse.js_!
workflow. Create your own local fork of this repository, make your changes and
then submit a pull request. Please follow the usual github workflow. Create your own local fork of this repository,
make your changes and then submit a pull request.
Before submitting a pull request Before submitting a pull request
================================ ================================
...@@ -12,11 +13,18 @@ Before submitting a pull request ...@@ -12,11 +13,18 @@ Before submitting a pull request
Add tests for your bugfix or feature Add tests for your bugfix or feature
------------------------------------ ------------------------------------
- Please try to add a test for any bug fixed or feature added. We use Jasmine Add a test for any bug fixed or feature added. We use Jasmine
for testing. for testing.
Take a look at ``tests.html`` and ``spec/MainSpec.js`` to see how
the tests are implemented.
Check that the tests run Check that the tests run
------------------------ ------------------------
- Check that the Jasmine BDD tests complete sucessfully. Open test.html in your Check that the Jasmine BDD tests complete sucessfully. Open tests.html in your
browser, and the tests will run automatically. browser, and the tests will run automatically.
You can see the current test output online, here: http://conversejs.org/tests.html
.. _Converse.js: http://conversejs.org
...@@ -2080,11 +2080,17 @@ jasmine.Queue.prototype.next_ = function() { ...@@ -2080,11 +2080,17 @@ jasmine.Queue.prototype.next_ = function() {
self.index++; self.index++;
var now = new Date().getTime(); var now = new Date().getTime();
if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) { if (self.env.updateInterval) {
self.env.lastUpdate = now; var timeout;
if (now - self.env.lastUpdate > self.env.updateInterval) {
timeout = 0;
} else {
timeout = self.env.updateInterval;
}
self.env.setTimeout(function() { self.env.setTimeout(function() {
self.env.lastUpdate = now;
self.next_(); self.next_();
}, 0); }, timeout);
} else { } else {
if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) { if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) {
goAgain = true; goAgain = true;
......
...@@ -489,7 +489,7 @@ ...@@ -489,7 +489,7 @@
initialize: function (){ initialize: function (){
this.model.messages.on('add', this.showMessage, this); this.model.messages.on('add', this.showMessage, this);
this.model.on('show', this.show, this); this.model.on('show', this.show, this);
this.model.on('destroy', function (model, response, options) { this.$el.hide('fast'); }, this); this.model.on('destroy', this.hide, this);
this.model.on('change', this.onChange, this); this.model.on('change', this.onChange, this);
this.$el.appendTo(xmppchat.chatboxesview.$el); this.$el.appendTo(xmppchat.chatboxesview.$el);
...@@ -539,6 +539,14 @@ ...@@ -539,6 +539,14 @@
return this; return this;
}, },
hide: function () {
if (xmppchat.animate) {
this.$el.hide('fast');
} else {
this.$el.hide();
}
},
show: function () { show: function () {
if (this.$el.is(':visible') && this.$el.css('opacity') == "1") { if (this.$el.is(':visible') && this.$el.css('opacity') == "1") {
return this.focus(); return this.focus();
...@@ -750,13 +758,8 @@ ...@@ -750,13 +758,8 @@
}, this)); }, this));
this.model.on('show', this.show, this); this.model.on('show', this.show, this);
this.model.on('destroy', $.proxy(function (model, response, options) { this.model.on('destroy', this.hide, this);
this.$el.hide('fast'); this.model.on('hide', this.hide, this);
}, this));
this.model.on('hide', $.proxy(function (model, response, options) {
this.$el.hide('fast');
}, this));
if (this.model.get('visible')) { if (this.model.get('visible')) {
this.show(); this.show();
} }
...@@ -1064,7 +1067,7 @@ ...@@ -1064,7 +1067,7 @@
xmppchat.getVCard( xmppchat.getVCard(
partner_jid, partner_jid,
$.proxy(function (jid, fullname, image, image_type, url) { $.proxy(function (jid, fullname, image, image_type, url) {
chatbox = this.create({ var chatbox = this.create({
'id': jid, 'id': jid,
'jid': jid, 'jid': jid,
'fullname': fullname, 'fullname': fullname,
...@@ -1093,7 +1096,7 @@ ...@@ -1093,7 +1096,7 @@
initialize: function () { initialize: function () {
// boxesviewinit // boxesviewinit
this.views = {}; this.views = {};
this.options.model.on("add", function (item) { this.model.on("add", function (item) {
var view = this.views[item.get('id')]; var view = this.views[item.get('id')];
if (!view) { if (!view) {
if (item.get('chatroom')) { if (item.get('chatroom')) {
......
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
<head> <head>
<meta charset='utf-8' /> <meta charset='utf-8' />
<meta http-equiv="X-UA-Compatible" content="chrome=1" /> <meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="description" content="Converse.js : Browser-based Instant Messaging with Strophe.js and Backbone.js" /> <meta name="description" content="Converse.js: Open Source Browser-Based Instant Messaging" />
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css"> <link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
<link rel="stylesheet" type="text/css" media="screen" href="converse.css">
<script data-main="main" src="Libraries/require-jquery.js"></script>
<title>Converse.js</title> <title>Converse.js</title>
</head> </head>
...@@ -26,53 +28,52 @@ ...@@ -26,53 +28,52 @@
<!-- MAIN CONTENT --> <!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer"> <div id="main_content_wrap" class="outer">
<section id="main_content" class="inner"> <section id="main_content" class="inner">
<p><strong>Converse.js</strong> implements an <a href="http://xmpp.org">XMPP</a> based instant messaging client in the browser.</p> <p><strong>Converse.js</strong> implements an <a href="http://xmpp.org">XMPP</a> based instant messaging client in the browser.</p>
<p>It is used by <a href="http://github.com/collective/collective.xmpp.chat">collective.xmpp.chat</a>, which is a <a href="http://plone.org">Plone</a> instant messaging add-on.</p>
<p>The ultimate goal is to enable anyone to add chat functionality to their websites, regardless of the backend.</p>
<p>This is currently possible, except for adding new contacts, which still makes an XHR call to the (Plone) backend to fetch user info.</p>
<p>It is used by <a href="http://github.com/collective/collective.xmpp.chat">collective.xmpp.chat</a>, which is a <a href="http://plone.org">Plone</a> instant messaging add-on.</p> <h2>Features</h2>
<ul>
<li>Manually or automically subscribe to other users.</li>
<li>Accept or decline contact requests</li>
<li>Chat status (online, busy, away, offline)</li>
<li>Custom status messages</li>
<li>Typing notifications</li>
<li>Third person messages (/me )</li>
<li>Multi-user chat in chatrooms</li>
<li>Chatroom Topics</li>
<li>vCard support</li>
</ul>
<p>The ultimate goal is to enable anyone to add chat functionality to their websites, regardless of the backend.</p> <h2>Screencasts</h2>
<p>This is currently possible, except for adding new contacts, which still makes an XHR call to the (Plone) backend to fetch user info.</p> <ul>
<li><a href="http://opkode.com/media/blog/instant-messaging-for-plone-with-javascript-and-xmpp">Screencast 1</a>:
Integrated into a Plone site via <strong>collective.xmpp.chat</strong>.
</li>
<li><a href="http://opkode.com/media/blog/2013/04/02/converse.js-xmpp-instant-messaging-with-javascript">Screencast 2</a>:
A static HTML page with <em>Converse.js</em>. Here we chat to external XMPP accounts on Jabber.org and Gmail.
</li>
</ul>
<h2>Features</h2> <h2>Dependencies</h2>
<ul> <p><strong>Converse.js</strong> depends on a few third party libraries, including:
<li>Manually or automically subscribe to other users.</li> <ul>
<li>Accept or decline contact requests</li> <li><a href="http://strophe.im/strophejs">strophe.js</a></li>
<li>Chat status (online, busy, away, offline)</li> <li><a href="http:/backbonejs.org">backbone.js</a></li>
<li>Custom status messages</li> <li><a href="http:/requirejs.org">require.js</a></li>
<li>Typing notifications</li> </ul>
<li>Third person messages (/me )</li> </p>
<li>Multi-user chat in chatrooms</li>
<li>Chatroom Topics</li>
<li>vCard support</li>
</ul>
<h2>Screencasts</h2> <h2>Licence</h2>
<div id="chatpanel">
<div id="collective-xmpp-chat-data"></div>
<ul> <div id="toggle-controlbox">
<li><a href="http://opkode.com/media/blog/instant-messaging-for-plone-with-javascript-and-xmpp">Screencast 1</a>: <a href="#" class="chat" id="toggle-online-users">
Integrated into a Plone site via <strong>collective.xmpp.chat</strong>. <span class="conn-feedback">Click here to chat</span> <strong style="display: none" id="online-count">(0)</strong>
</a>
</li> </div>
<li><a href="http://opkode.com/media/blog/2013/04/02/converse.js-xmpp-instant-messaging-with-javascript">Screencast 2</a>:
A static HTML page with <em>Converse.js</em>. Here we chat to external XMPP accounts on Jabber.org and Gmail.
</li>
</ul>
<h2>Dependencies</h2>
<p><strong>Converse.js</strong> depends on a few third party libraries, including:
<ul>
<li><a href="http://strophe.im/strophejs">strophe.js</a></li>
<li><a href="http:/backbonejs.org">backbone.js</a></li>
<li><a href="http:/requirejs.org">require.js</a></li>
</ul>
</p>
<h2>Licence</h2>
<p><strong>Converse.js</strong> is released under both the <a href="http://opensource.org/licenses/mit-license.php">MIT</a> and <a href="http://opensource.org/licenses/gpl-license.php">GPL</a> licenses.</p>
</section>
</div> </div>
<!-- FOOTER --> <!-- FOOTER -->
...@@ -83,15 +84,10 @@ ...@@ -83,15 +84,10 @@
</footer> </footer>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script> </script>
<script type="text/javascript"> <script type="text/javascript">try { var pageTracker = _gat._getTracker("UA-2128260-8"); pageTracker._trackPageview(); } catch(err) {}</script>
try {
var pageTracker = _gat._getTracker("UA-2128260-8");
pageTracker._trackPageview();
} catch(err) {}
</script>
</body> </body>
</html> </html>
This diff is collapsed.
...@@ -2,7 +2,7 @@ require(["jquery", "spec/MainSpec"], function($) { ...@@ -2,7 +2,7 @@ require(["jquery", "spec/MainSpec"], function($) {
$(function($) { $(function($) {
var jasmineEnv = jasmine.getEnv(); var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000; jasmineEnv.updateInterval = 500;
var htmlReporter = new jasmine.HtmlReporter(); var htmlReporter = new jasmine.HtmlReporter();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment