Commit 1f772f46 authored by JC Brand's avatar JC Brand

Merge branch 'master' into gh-pages

Conflicts:
	index.html
parents a01f9543 eb39faa7
Changelog Changelog
========= =========
0.5.1 (Unreleased)
------------------
- #13, #14: Messages sent between to GTalk accounts weren't being received. [jcbrand]
- #32: Default status was offline when user didn't have contacts. [jcbrand]
- Attach panels to the DOM upon initialize. [jcbrand]
0.5.0 (2013-07-30) 0.5.0 (2013-07-30)
------------------ ------------------
......
...@@ -25,7 +25,7 @@ module.exports = function(grunt) { ...@@ -25,7 +25,7 @@ module.exports = function(grunt) {
"*/" "*/"
}, },
minify: { minify: {
dest: 'converse-'+cfg.version+'.min.css', dest: 'converse.min.css',
src: ['converse.css'] src: ['converse.css']
} }
}, },
...@@ -34,7 +34,7 @@ module.exports = function(grunt) { ...@@ -34,7 +34,7 @@ module.exports = function(grunt) {
options: { options: {
baseUrl: ".", baseUrl: ".",
name: "main", name: "main",
out: "converse-"+cfg.version+".min.js", out: "converse.min.js",
paths: { paths: {
"require": "components/requirejs/require", "require": "components/requirejs/require",
"jquery": "components/jquery/jquery", "jquery": "components/jquery/jquery",
...@@ -106,8 +106,7 @@ module.exports = function(grunt) { ...@@ -106,8 +106,7 @@ module.exports = function(grunt) {
}); });
}); });
// TODO: update CHANGES.txt with release date grunt.registerTask('minify', 'Create a new release', ['requirejs', 'cssmin']);
grunt.registerTask('release', 'Create a new release', ['requirejs', 'cssmin']);
grunt.registerTask('check', 'Perform all checks (e.g. before releasing)', function () { grunt.registerTask('check', 'Perform all checks (e.g. before releasing)', function () {
grunt.task.run('jshint', 'test'); grunt.task.run('jshint', 'test');
......
This diff is collapsed.
This diff is collapsed.
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
<meta http-equiv="X-UA-Compatible" content="chrome=1" /> <meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="description" content="Converse.js: Open Source Browser-Based Instant Messaging" /> <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-0.5.0.min.css"> <link rel="stylesheet" type="text/css" media="screen" href="converse.min.css">
<script src="converse-0.5.0.min.js"></script> <script src="converse.min.js"></script>
<!-- For development: <script data-main="main" src="Libraries/require-jquery.js"></script> --> <!-- For development <script data-main="main" src="components/requirejs/require.js"></script> -->
<title>Converse.js</title> <title>Converse.js</title>
</head> </head>
......
This diff is collapsed.
{ {
"name": "converse.js", "name": "converse.js",
"version": "0.5.0", "version": "0.5.1",
"description": "Browser based XMPP instant messaging client", "description": "Browser based XMPP instant messaging client",
"main": "main.js", "main": "main.js",
"directories": { "directories": {
......
...@@ -56,6 +56,12 @@ ...@@ -56,6 +56,12 @@
it("can be opened by clicking a DOM element with class 'toggle-online-users'", open_controlbox); it("can be opened by clicking a DOM element with class 'toggle-online-users'", open_controlbox);
describe("The Status Widget", $.proxy(function () { describe("The Status Widget", $.proxy(function () {
it("shows the user's chat status, which is online by default", $.proxy(function () {
var view = this.xmppstatusview;
expect(view.$el.find('a.choose-xmpp-status').hasClass('online')).toBe(true);
expect(view.$el.find('a.choose-xmpp-status').attr('data-value')).toBe('I am online');
}, converse));
it("can be used to set the current user's chat status", $.proxy(function () { it("can be used to set the current user's chat status", $.proxy(function () {
var view = this.xmppstatusview; var view = this.xmppstatusview;
spyOn(view, 'toggleOptions').andCallThrough(); spyOn(view, 'toggleOptions').andCallThrough();
...@@ -64,25 +70,26 @@ ...@@ -64,25 +70,26 @@
runs(function () { runs(function () {
view.$el.find('a.choose-xmpp-status').click(); view.$el.find('a.choose-xmpp-status').click();
expect(view.toggleOptions).toHaveBeenCalled(); expect(view.toggleOptions).toHaveBeenCalled();
expect(view.$el.find('a.choose-xmpp-status').hasClass('online')).toBe(false);
}); });
waits(250); waits(250);
runs(function () { runs(function () {
spyOn(view, 'updateStatusUI').andCallThrough(); spyOn(view, 'updateStatusUI').andCallThrough();
view.initialize(); // Rebind events for spy view.initialize(); // Rebind events for spy
view.$el.find('.dropdown dd ul li a').first().click(); $(view.$el.find('.dropdown dd ul li a')[1]).click();
expect(view.setStatus).toHaveBeenCalled(); expect(view.setStatus).toHaveBeenCalled();
}); });
waits(250); waits(250);
runs($.proxy(function () { runs($.proxy(function () {
expect(view.updateStatusUI).toHaveBeenCalled(); expect(view.updateStatusUI).toHaveBeenCalled();
expect(view.$el.find('a.choose-xmpp-status').hasClass('online')).toBe(true); expect(view.$el.find('a.choose-xmpp-status').hasClass('online')).toBe(false);
expect(view.$el.find('a.choose-xmpp-status').attr('data-value')).toBe('I am online'); expect(view.$el.find('a.choose-xmpp-status').hasClass('dnd')).toBe(true);
expect(view.$el.find('a.choose-xmpp-status').attr('data-value')).toBe('I am busy');
}, converse)); }, converse));
}, converse)); }, converse));
it("can be used to set a custom status message", $.proxy(function () { it("can be used to set a custom status message", $.proxy(function () {
var view = this.xmppstatusview; var view = this.xmppstatusview;
this.xmppstatus.save({'status': 'online'});
spyOn(view, 'setStatusMessage').andCallThrough(); spyOn(view, 'setStatusMessage').andCallThrough();
spyOn(view, 'renderStatusChangeForm').andCallThrough(); spyOn(view, 'renderStatusChangeForm').andCallThrough();
view.delegateEvents(); // We need to rebind all events otherwise our spy won't be called view.delegateEvents(); // We need to rebind all events otherwise our spy won't be called
...@@ -120,6 +127,7 @@ ...@@ -120,6 +127,7 @@
it("can be added to the roster and they will be sorted alphabetically", $.proxy(function () { it("can be added to the roster and they will be sorted alphabetically", $.proxy(function () {
var i, t, is_last; var i, t, is_last;
spyOn(this.rosterview, 'render').andCallThrough(); spyOn(this.rosterview, 'render').andCallThrough();
spyOn(this.xmppstatus, 'sendPresence');
for (i=0; i<pend_names.length; i++) { for (i=0; i<pend_names.length; i++) {
is_last = i===(pend_names.length-1); is_last = i===(pend_names.length-1);
this.roster.create({ this.roster.create({
...@@ -133,6 +141,7 @@ ...@@ -133,6 +141,7 @@
// the last contact has been added. // the last contact has been added.
if (is_last) { if (is_last) {
expect(this.rosterview.$el.is(':visible')).toEqual(true); expect(this.rosterview.$el.is(':visible')).toEqual(true);
expect(this.xmppstatus.sendPresence).toHaveBeenCalled();
} else { } else {
expect(this.rosterview.$el.is(':visible')).toEqual(false); expect(this.rosterview.$el.is(':visible')).toEqual(false);
} }
......
...@@ -75,7 +75,6 @@ require([ ...@@ -75,7 +75,6 @@ require([
auto_subscribe: false, auto_subscribe: false,
animate: false animate: false
}); });
converse.onConnected(mock_connection);
// Jasmine stuff // Jasmine stuff
var jasmineEnv = jasmine.getEnv(); var jasmineEnv = jasmine.getEnv();
...@@ -93,5 +92,5 @@ require([ ...@@ -93,5 +92,5 @@ require([
}; };
jasmineEnv.updateInterval = 200; jasmineEnv.updateInterval = 200;
} }
jasmineEnv.execute(); converse.onConnected(mock_connection, $.proxy(jasmineEnv.execute, jasmineEnv));
}); });
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