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

Changes from master

parent 746862f2
......@@ -2,9 +2,10 @@
Contributing to Converse.js
===========================
Contributions to Converse.js are very welcome. Please follow the usual github
workflow. Create your own local fork of this repository, make your changes and
then submit a pull request.
Thanks for contributing to Converse.js_!
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
================================
......@@ -12,11 +13,18 @@ Before submitting a pull request
Add tests for your bugfix or feature
------------------------------------
- Please try to add a test for any bug fixed or feature added. We use Jasmine
for testing.
Add a test for any bug fixed or feature added. We use Jasmine
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 Jasmine BDD tests complete sucessfully. Open test.html in your
browser, and the tests will run automatically.
Check that the Jasmine BDD tests complete sucessfully. Open tests.html in your
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() {
self.index++;
var now = new Date().getTime();
if (self.env.updateInterval && now - self.env.lastUpdate > self.env.updateInterval) {
self.env.lastUpdate = now;
if (self.env.updateInterval) {
var timeout;
if (now - self.env.lastUpdate > self.env.updateInterval) {
timeout = 0;
} else {
timeout = self.env.updateInterval;
}
self.env.setTimeout(function() {
self.env.lastUpdate = now;
self.next_();
}, 0);
}, timeout);
} else {
if (jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) {
goAgain = true;
......
......@@ -489,7 +489,7 @@
initialize: function (){
this.model.messages.on('add', this.showMessage, 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.$el.appendTo(xmppchat.chatboxesview.$el);
......@@ -539,6 +539,14 @@
return this;
},
hide: function () {
if (xmppchat.animate) {
this.$el.hide('fast');
} else {
this.$el.hide();
}
},
show: function () {
if (this.$el.is(':visible') && this.$el.css('opacity') == "1") {
return this.focus();
......@@ -750,13 +758,8 @@
}, this));
this.model.on('show', this.show, this);
this.model.on('destroy', $.proxy(function (model, response, options) {
this.$el.hide('fast');
}, this));
this.model.on('hide', $.proxy(function (model, response, options) {
this.$el.hide('fast');
}, this));
this.model.on('destroy', this.hide, this);
this.model.on('hide', this.hide, this);
if (this.model.get('visible')) {
this.show();
}
......@@ -1064,7 +1067,7 @@
xmppchat.getVCard(
partner_jid,
$.proxy(function (jid, fullname, image, image_type, url) {
chatbox = this.create({
var chatbox = this.create({
'id': jid,
'jid': jid,
'fullname': fullname,
......@@ -1093,7 +1096,7 @@
initialize: function () {
// boxesviewinit
this.views = {};
this.options.model.on("add", function (item) {
this.model.on("add", function (item) {
var view = this.views[item.get('id')];
if (!view) {
if (item.get('chatroom')) {
......
......@@ -3,8 +3,10 @@
<head>
<meta charset='utf-8' />
<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="converse.css">
<script data-main="main" src="Libraries/require-jquery.js"></script>
<title>Converse.js</title>
</head>
......@@ -26,53 +28,52 @@
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<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>
<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>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>
<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>
<h2>Screencasts</h2>
<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>
<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>
<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>Screencasts</h2>
<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>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>
<h2>Licence</h2>
<div id="chatpanel">
<div id="collective-xmpp-chat-data"></div>
<div id="toggle-controlbox">
<a href="#" class="chat" id="toggle-online-users">
<span class="conn-feedback">Click here to chat</span> <strong style="display: none" id="online-count">(0)</strong>
</a>
</div>
</div>
<!-- FOOTER -->
......@@ -83,15 +84,10 @@
</footer>
</div>
<script type="text/javascript">
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"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-2128260-8");
pageTracker._trackPageview();
} catch(err) {}
</script>
<script type="text/javascript">
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"));
</script>
<script type="text/javascript">try { var pageTracker = _gat._getTracker("UA-2128260-8"); pageTracker._trackPageview(); } catch(err) {}</script>
</body>
</html>
This diff is collapsed.
......@@ -2,7 +2,7 @@ require(["jquery", "spec/MainSpec"], function($) {
$(function($) {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
jasmineEnv.updateInterval = 500;
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