Commit 509b2c30 authored by JC Brand's avatar JC Brand

Merge branch 'master' of github.com:jcbrand/converse.js

Conflicts:
	converse.js
parents d04a1aa1 eb9e5300
*~
*.mo
*.kpf
*.swp
.*.cfg
.hg/
.bzr/
.svn/
.project
.pydevproject
node_modules
# OSX
.DS_Store
Changelog Changelog
========= =========
0.5 (Unreleased)
----------------
- #22 Fixed compare operator in strophe.muc [sonata82]
- #23 Add Italian translations [ctrlaltca]
- #24 Add Spanish translations [macagua]
- #25 Using span with css instead of img [matheus-morfi]
- #26 Only the first minute digit shown in chatbox. [jcbrand]
0.4 (2013-06-03)
----------------
- CSS tweaks: fixed overflowing text in status message and chatrooms list. [jcbrand]
- Bugfix: Couldn't join chatroom when clicking from a list of rooms. [jcbrand]
- Add better support for kicking or banning users from chatrooms. [jcbrand]
- Fixed alignment of chat messages in Firefox. [jcbrand]
- More intelligent fetching of vCards. [jcbrand]
- Fixed a race condition bug. Make sure that the roster is populated before sending initial presence. [jcbrand]
- Reconnect automatically when the connection drops. [jcbrand]
- Add support for internationalization. [jcbrand]
0.3 (2013-05-21) 0.3 (2013-05-21)
---------------- ----------------
- Add vCard support - Add vCard support [jcbrand]
[jcbrand] - Remember custom status messages upon reload. [jcbrand]
- Remember custom status messages upon reload. - Remove jquery-ui dependency. [jcbrand]
[jcbrand] - Use backbone.localStorage to store the contacts roster, open chatboxes and chat messages. [jcbrand]
- Remove jquery-ui dependency. - Fixed user status handling, which wasn't 100% according to the spec. [jcbrand]
[jcbrand] - Separate messages according to day in chats. [jcbrand]
- Use backbone.localStorage to store the contacts roster, open chatboxes and - Add support for specifying the BOSH bind URL as configuration setting. [jcbrand]
chat messages. - #8 Improve the message counter to only increment when the window is not focused [witekdev]
[jcbrand] - Make fetching of list of chatrooms on a server a configuration option. [jcbrand]
- Fixed user status handling, which wasn't 100% according to the spec. - Use service discovery to show all available features on a room. [jcbrand]
[jcbrand] - Multi-user chatrooms are now configurable. [jcbrand]
- Separate messages according to day in chats.
[jcbrand]
- Add support for specifying the BOSH bind URL as configuration setting.
[jcbrand]
- Improve the message counter to only increment when the window is not focused
[witekdev]
- Make fetching of list of chatrooms on a server a configuration option.
[jcbrand]
- Use service discovery to show all available features on a room.
[jcbrand]
- Multi-user chatrooms are now configurable.
[jcbrand]
0.2 (2013-03-28) 0.2 (2013-03-28)
......
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
options: {
trailing: true
},
target: {
src : [
'converse.js',
'mock.js',
'main.js',
'tests_main.js',
'spec/*.js'
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.registerTask('default', ['jshint']);
};
/*global $:false, document:false, window:false, portal_url:false,
$msg:false, Strophe:false, setTimeout:false, navigator:false, jarn:false, google:false, jarnxmpp:false, jQuery:false, sessionStorage:false, $iq:false, $pres:false, Image:false, */
(function (jarnxmpp, $, portal_url) {
portal_url = portal_url || '';
jarnxmpp.Storage = {
storage: null,
init: function () {
try {
if ('sessionStorage' in window && window.sessionStorage !== null && JSON in window && window.JSON !== null) {
jarnxmpp.Storage.storage = sessionStorage;
if (!('_user_info' in jarnxmpp.Storage.storage)) {
jarnxmpp.Storage.set('_user_info', {});
}
if (!('_vCards' in jarnxmpp.Storage.storage)) {
jarnxmpp.Storage.set('_vCards', {});
}
if (!('_subscriptions' in jarnxmpp.Storage.storage)) {
jarnxmpp.Storage.set('_subscriptions', null);
}
}
} catch (e) {}
},
get: function (key) {
if (key in sessionStorage) {
return JSON.parse(sessionStorage[key]);
}
return null;
},
set: function (key, value) {
sessionStorage[key] = JSON.stringify(value);
},
xmppGet: function (key, callback) {
var stanza = $iq({type: 'get'})
.c('query', {xmlns: 'jabber:iq:private'})
.c('jarnxmpp', {xmlns: 'http://jarn.com/ns/jarnxmpp:prefs:' + key})
.tree();
jarnxmpp.connection.sendIQ(stanza, function success(result) {
callback($('jarnxmpp ' + 'value', result).first().text());
});
},
xmppSet: function (key, value) {
var stanza = $iq({type: 'set'})
.c('query', {xmlns: 'jabber:iq:private'})
.c('jarnxmpp', {xmlns: 'http://jarn.com/ns/jarnxmpp:prefs:' + key})
.c('value', value)
.tree();
jarnxmpp.connection.sendIQ(stanza);
}
};
jarnxmpp.Storage.init();
jarnxmpp.Presence = {
online: {},
_user_info: {},
onlineCount: function () {
var me = Strophe.getNodeFromJid(jarnxmpp.connection.jid),
counter = 0,
user;
for (user in jarnxmpp.Presence.online) {
if ((jarnxmpp.Presence.online.hasOwnProperty(user)) && user !== me) {
counter += 1;
}
}
return counter;
},
getUserInfo: function (user_id, callback) {
// User info on browsers without storage
if (jarnxmpp.Storage.storage === null) {
if (user_id in jarnxmpp.Presence._user_info) {
callback(jarnxmpp.Presence._user_info[user_id]);
} else {
$.getJSON(portal_url + "/xmpp-userinfo?user_id=" + user_id, function (data) {
jarnxmpp.Presence._user_info[user_id] = data;
callback(data);
});
}
} else {
var _user_info = jarnxmpp.Storage.get('_user_info');
if (user_id in _user_info) {
callback(_user_info[user_id]);
} else {
$.getJSON(portal_url + "/xmpp-userinfo?user_id=" + user_id, function (data) {
_user_info[user_id] = data;
jarnxmpp.Storage.set('_user_info', _user_info);
callback(data);
});
}
}
}
};
jarnxmpp.vCard = {
_vCards: {},
_getVCard: function (jid, callback) {
var stanza =
$iq({type: 'get', to: jid})
.c('vCard', {xmlns: 'vcard-temp'}).tree();
jarnxmpp.connection.sendIQ(stanza, function (data) {
var result = {};
$('vCard[xmlns="vcard-temp"]', data).children().each(function (idx, element) {
result[element.nodeName] = element.textContent;
});
if (typeof (callback) !== 'undefined') {
callback(result);
}
});
},
getVCard: function (jid, callback) {
jid = Strophe.getBareJidFromJid(jid);
if (jarnxmpp.Storage.storage === null) {
if (jid in jarnxmpp.vCard._vCards) {
callback(jarnxmpp.vCard._vCards[jid]);
} else {
jarnxmpp.vCard._getVCard(jid, function (result) {
jarnxmpp.vCard._vCards[jid] = result;
callback(result);
});
}
} else {
var _vCards = jarnxmpp.Storage.get('_vCards');
if (jid in _vCards) {
callback(_vCards[jid]);
} else {
jarnxmpp.vCard._getVCard(jid, function (result) {
_vCards[jid] = result;
jarnxmpp.Storage.set('_vCards', _vCards);
callback(result);
});
}
}
},
setVCard: function (params, photoUrl) {
var key,
vCard = Strophe.xmlElement('vCard', [['xmlns', 'vcard-temp'], ['version', '2.0']]);
for (key in params) {
if (params.hasOwnProperty(key)) {
vCard.appendChild(Strophe.xmlElement(key, [], params[key]));
}
}
var send = function () {
var stanza = $iq({type: 'set'}).cnode(vCard).tree();
jarnxmpp.connection.sendIQ(stanza);
};
if (typeof (photoUrl) === 'undefined') {
send();
} else {
jarnxmpp.vCard.getBase64Image(photoUrl, function (base64img) {
base64img = base64img.replace(/^data:image\/png;base64,/, "");
var photo = Strophe.xmlElement('PHOTO');
photo.appendChild(Strophe.xmlElement('TYPE', [], 'image/png'));
photo.appendChild(Strophe.xmlElement('BINVAL', [], base64img));
vCard.appendChild(photo);
send();
});
}
},
getBase64Image: function (url, callback) {
// Create the element, then draw it on a canvas to get the base64 data.
var img = new Image();
$(img).load(function () {
var canvas = document.createElement('canvas');
canvas.width = img.width;
canvas.height = img.height;
var ctx = canvas.getContext("2d");
ctx.drawImage(img, 0, 0);
callback(canvas.toDataURL('image/png'));
}).attr('src', url);
}
};
jarnxmpp.onConnect = function (status) {
if ((status === Strophe.Status.ATTACHED) || (status === Strophe.Status.CONNECTED)) {
$(window).bind('beforeunload', function () {
$(document).trigger('jarnxmpp.disconnecting');
var presence = $pres({type: 'unavailable'});
jarnxmpp.connection.send(presence);
jarnxmpp.connection.disconnect();
jarnxmpp.connection.flush();
});
$(document).trigger('jarnxmpp.connected');
} else if (status === Strophe.Status.DISCONNECTED) {
$(document).trigger('jarnxmpp.disconnected');
}
};
jarnxmpp.rawInput = function (data) {
var event = jQuery.Event('jarnxmpp.dataReceived');
event.text = data;
$(document).trigger(event);
};
jarnxmpp.rawOutput = function (data) {
var event = jQuery.Event('jarnxmpp.dataSent');
event.text = data;
$(document).trigger(event);
};
$(document).bind('jarnxmpp.connected', function () {
// Logging
jarnxmpp.connection.rawInput = jarnxmpp.rawInput;
jarnxmpp.connection.rawOutput = jarnxmpp.rawOutput;
});
$(document).bind('jarnxmpp.disconnecting', function () {
if (jarnxmpp.Storage.storage !== null) {
jarnxmpp.Storage.set('online-count', jarnxmpp.Presence.onlineCount());
}
});
$(document).ready(function () {
var resource = jarnxmpp.Storage.get('xmppresource');
if (resource) {
data = {'resource': resource};
} else {
data = {};
}
$.ajax({
'url':portal_url + '/@@xmpp-loader',
'dataType': 'json',
'data': data,
'success': function (data) {
if (!(('rid' in data) && ('sid' in data) && ('BOSH_SERVICE' in data))) {
return;
}
if (!resource) {
jarnxmpp.Storage.set('xmppresource', Strophe.getResourceFromJid(data.jid));
}
jarnxmpp.BOSH_SERVICE = data.BOSH_SERVICE;
jarnxmpp.jid = data.jid;
jarnxmpp.connection = new Strophe.Connection(jarnxmpp.BOSH_SERVICE);
jarnxmpp.connection.attach(jarnxmpp.jid, data.sid, data.rid, jarnxmpp.onConnect);
}
});
});
})(window.jarnxmpp = window.jarnxmpp || {}, jQuery, portal_url);
This diff is collapsed.
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
xmlns: Strophe.NS.CLIENT xmlns: Strophe.NS.CLIENT
}).t(message); }).t(message);
msg.up(); msg.up();
if (html_message !== null) { if (html_message != null) {
msg.c("html", {xmlns: Strophe.NS.XHTML_IM}).c("body", {xmlns: Strophe.NS.XHTML}).h(html_message); msg.c("html", {xmlns: Strophe.NS.XHTML_IM}).c("body", {xmlns: Strophe.NS.XHTML}).h(html_message);
if (msg.node.childNodes.length === 0) { if (msg.node.childNodes.length === 0) {
......
...@@ -11,30 +11,31 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ./d ...@@ -11,30 +11,31 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ./d
# the i18n builder cannot share the environment and doctrees with the others # the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ./docs/source I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ./docs/source
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext .PHONY: help clean html dirhtml singlehtml json htmlhelp devhelp epub latex latexpdf text changes linkcheck doctest gettext
help: help:
@echo "Please use \`make <target>' where <target> is one of" @echo "Please use \`make <target>' where <target> is one of"
@echo " release to make a new minified release" @echo " changes to make an overview of all changed/added/deprecated items"
@echo " html to make standalone HTML files" @echo " devhelp to make HTML files and a Devhelp project"
@echo " dirhtml to make HTML files named index.html in directories" @echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file" @echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " pickle to make pickle files" @echo " epub to export the documentation to epub"
@echo " gettext to make PO message catalogs of the documentation"
@echo " html to make standalone HTML files of the documentation"
@echo " htmlhelp to make HTML files and a HTML help project from the documentation"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " json to make JSON files" @echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity" @echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " pot generates a gettext POT file to be used for translations"
@echo " release to make a new minified release"
@echo " singlehtml to make a single large HTML file"
@echo " texinfo to make Texinfo files"
@echo " text to make text files"
pot:
xgettext --keyword=__ --keyword=translate --from-code=UTF-8 --output=locale/converse.pot converse.js --package-name=Converse.js --copyright-holder="Jan-Carel Brand" --package-version=0.4 -c --language="python";
release: release:
r.js -o build.js r.js -o build.js
...@@ -57,11 +58,6 @@ singlehtml: ...@@ -57,11 +58,6 @@ singlehtml:
@echo @echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json: json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo @echo
...@@ -73,15 +69,6 @@ htmlhelp: ...@@ -73,15 +69,6 @@ htmlhelp:
@echo "Build finished; now you can run HTML Help Workshop with the" \ @echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp." ".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/sphinx.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/sphinx.qhc"
devhelp: devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo @echo
...@@ -114,11 +101,6 @@ text: ...@@ -114,11 +101,6 @@ text:
@echo @echo
@echo "Build finished. The text files are in $(BUILDDIR)/text." @echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo: texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo @echo
......
...@@ -2,6 +2,14 @@ ...@@ -2,6 +2,14 @@
baseUrl: ".", baseUrl: ".",
paths: { paths: {
"jquery": "Libraries/require-jquery", "jquery": "Libraries/require-jquery",
"jed": "Libraries/jed",
"locales": "locale/locales",
"af": "locale/af/LC_MESSAGES/af",
"en": "locale/en/LC_MESSAGES/en",
"de": "locale/de/LC_MESSAGES/de",
"es": "locale/es/LC_MESSAGES/es",
"hu": "locale/hu/LC_MESSAGES/hu",
"it": "locale/it/LC_MESSAGES/it",
"sjcl": "Libraries/sjcl", "sjcl": "Libraries/sjcl",
"tinysort": "Libraries/jquery.tinysort", "tinysort": "Libraries/jquery.tinysort",
"underscore": "Libraries/underscore", "underscore": "Libraries/underscore",
...@@ -14,5 +22,5 @@ ...@@ -14,5 +22,5 @@
"strophe.disco": "Libraries/strophe.disco" "strophe.disco": "Libraries/strophe.disco"
}, },
name: "main", name: "main",
out: "converse.0.3.min.js" out: "converse.min.js"
}) })
This diff is collapsed.
...@@ -15,29 +15,18 @@ span.spinner { ...@@ -15,29 +15,18 @@ span.spinner {
display: block; display: block;
} }
span.spinner.hor_centered { span.spinner.centered {
left: 40%;
position: absolute;
}
img.spinner {
width: auto;
border: none;
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
margin: 0;
padding: 0 5px 0 5px;
}
img.centered {
position: absolute; position: absolute;
top: 30%; top: 30%;
left: 50%; left: 50%;
margin: 0 0 0 -25%; margin: 0 0 0 -25%;
} }
span.spinner.hor_centered {
left: 40%;
position: absolute;
}
#chatpanel { #chatpanel {
z-index: 99; /*--Keeps the panel on top of all other elements--*/ z-index: 99; /*--Keeps the panel on top of all other elements--*/
position: fixed; position: fixed;
...@@ -87,7 +76,8 @@ img.centered { ...@@ -87,7 +76,8 @@ img.centered {
.chatroom .chat-body { .chatroom .chat-body {
height: 272px; height: 272px;
background-color: white; background-color: white;
border-radius: 4px; border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
} }
.chatroom .chat-area { .chatroom .chat-area {
...@@ -173,31 +163,36 @@ ul.participant-list li.moderator { ...@@ -173,31 +163,36 @@ ul.participant-list li.moderator {
color:#666666; color:#666666;
} }
.chat-message-room,
.chat-message-them,
.chat-message-me { .chat-message-me {
font-weight: bold; font-weight: bold;
color: #436976;
}
.chat-message-room {
font-weight: bold;
color: #4B7003;
}
.chat-message-them {
font-weight: bold;
color: #F62817;
white-space: nowrap; white-space: nowrap;
max-width: 100px; max-width: 100px;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
display: inline-block; display: inline-block;
float: left;
padding-right: 3px;
}
.chat-message-them {
color: #F62817;
}
.chat-message-me {
color: #436976;
}
.chat-message-room {
color: #4B7003;
} }
.chat-event, .chat-date, .chat-help { .chat-event, .chat-date, .chat-info {
color: #808080; color: #808080;
} }
li.chat-help { li.chat-info {
padding-left: 10px; padding-left: 10px;
} }
...@@ -262,7 +257,7 @@ div.chat-title { ...@@ -262,7 +257,7 @@ div.chat-title {
.chat-head-chatbox, .chat-head-chatbox,
.chat-head-chatroom { .chat-head-chatroom {
background: linear-gradient(top, rgba(206,220,231,1) 0%,rgba(89,106,114,1) 100%); background: linear-gradient(top, rgba(206,220,231,1) 0%,rgba(89,106,114,1) 100%);
height: 33px; height: 35px;
position: relative; position: relative;
} }
...@@ -304,6 +299,7 @@ dl.add-converse-contact { ...@@ -304,6 +299,7 @@ dl.add-converse-contact {
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
float: left; float: left;
width: 130px;
} }
#fancy-xmpp-status-select a.change-xmpp-status-message { #fancy-xmpp-status-select a.change-xmpp-status-message {
...@@ -409,7 +405,8 @@ a.configure-chatroom-button { ...@@ -409,7 +405,8 @@ a.configure-chatroom-button {
.chat-body p { .chat-body p {
font-size: 14px; font-size: 14px;
color: #666; color: #666;
margin: 5px; padding: 5px;
margin: 0;
} }
.chatroom-form legend { .chatroom-form legend {
...@@ -498,17 +495,12 @@ a.configure-chatroom-button { ...@@ -498,17 +495,12 @@ a.configure-chatroom-button {
margin-top: 0.5em; margin-top: 0.5em;
} }
#available-chatrooms {
height: 183px;
overflow-y: auto;
}
#available-chatrooms dd { #available-chatrooms dd {
overflow-x: hidden; overflow-x: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
display: inline-block; display: inline-block;
width: 170px; width: 165px;
} }
#available-chatrooms dt, #available-chatrooms dt,
...@@ -517,7 +509,7 @@ a.configure-chatroom-button { ...@@ -517,7 +509,7 @@ a.configure-chatroom-button {
font-size: 13px; font-size: 13px;
color: #666; color: #666;
border: none; border: none;
padding: 0.3em 0.5em 0.3em 0.5em; padding: 0em 0em 0.3em 0.5em;
text-shadow: 0 1px 0 rgba(250, 250, 250, 1); text-shadow: 0 1px 0 rgba(250, 250, 250, 1);
} }
...@@ -530,7 +522,7 @@ dd.available-chatroom, ...@@ -530,7 +522,7 @@ dd.available-chatroom,
font-weight: bold; font-weight: bold;
border: none; border: none;
display: block; display: block;
padding: 0 0.5em 0 0.5em; padding: 0 0em 0 0.5em;
color: #666; color: #666;
text-shadow: 0 1px 0 rgba(250, 250, 250, 1); text-shadow: 0 1px 0 rgba(250, 250, 250, 1);
} }
...@@ -546,6 +538,10 @@ li.room-info { ...@@ -546,6 +538,10 @@ li.room-info {
margin-left: 5px; margin-left: 5px;
} }
div.room-info {
clear: left;
}
p.room-info { p.room-info {
margin: 0; margin: 0;
padding: 0; padding: 0;
...@@ -556,13 +552,13 @@ p.room-info { ...@@ -556,13 +552,13 @@ p.room-info {
a.room-info { a.room-info {
background: url('images/information.png') no-repeat right top; background: url('images/information.png') no-repeat right top;
width: 22px; width: 22px;
height: 22px;
float: right; float: right;
display: none; display: none;
clear: right;
} }
a.open-room { a.open-room {
display: inline-block; float: left;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow-x: hidden; overflow-x: hidden;
...@@ -667,13 +663,12 @@ form.set-xmpp-status { ...@@ -667,13 +663,12 @@ form.set-xmpp-status {
form.add-chatroom { form.add-chatroom {
background: none; background: none;
padding: 0.5em; padding: 3px;
} }
form.add-chatroom input[type=text] { form.add-chatroom input[type=text] {
width: 172px; width: 95%;
margin: 3px; margin: 3px;
padding: 1px;
} }
form.add-chatroom input[type=button], form.add-chatroom input[type=button],
...@@ -748,6 +743,10 @@ div#settings { ...@@ -748,6 +743,10 @@ div#settings {
border-bottom-left-radius: 4px; border-bottom-left-radius: 4px;
} }
div#chatrooms {
overflow-y: auto;
}
form.sendXMPPMessage { form.sendXMPPMessage {
background: white; background: white;
border: 1px solid #999; border: 1px solid #999;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
No preview for this file type
Search.setIndex({objects:{},terms:{all:0,code:0,partial:0,queri:0,webchat:0,middl:0,depend:0,sensit:0,under:0,fals:0,mechan:0,jack:0,veri:0,list:0,pleas:0,prevent:0,second:0,pass:0,download:0,further:0,fullnam:0,even:0,index:0,what:0,hide:0,section:0,current:0,version:0,"new":0,net:0,method:0,here:0,box:0,great:0,convers:0,mysit:0,implement:0,via:0,extra:0,solut:0,href:0,auto_list_room:0,instal:0,zip:0,commun:0,two:0,websit:0,stylesheet:0,call:0,recommend:0,type:0,until:0,tightli:0,more:0,yahoo:0,must:0,room:0,setup:[],xhr:0,can:0,purpos:0,fetch:0,control:0,quickstart:0,share:0,tag:0,proprietari:0,explor:0,occup:0,end:0,goal:0,snippet:0,how:0,sid:0,instead:0,css:0,npm:0,regener:0,product:0,resourc:0,after:0,usabl:0,befor:0,data:0,demonstr:0,man:0,practic:0,bind:0,django:0,inform:0,order:0,xmpp:0,over:0,streamlin:0,write:0,jid:0,fit:0,pend:0,therefor:0,might:0,them:0,anim:0,"return":0,thei:0,initi:0,front:0,now:0,introduct:0,name:0,authent:0,ejabberd:0,each:0,side:0,mean:0,domain:0,realli:0,legwork:0,connect:0,variabl:0,open:0,content:0,rel:0,internet:0,proxi:0,insid:0,standard:0,standalon:0,releas:0,org:0,blogpost:0,keep:0,yui:0,first:0,origin:0,softwar:0,render:0,onc:0,lastnam:0,number:0,yourself:0,restrict:0,alreadi:0,owner:0,jabber:0,differ:0,script:0,messag:0,attach:0,attack:0,luckili:0,option:0,tool:0,specifi:0,compressor:0,part:0,exactli:0,than:0,serv:0,kind:0,provid:0,remov:0,bridg:0,toward:[],browser:0,sai:0,saa:0,modern:0,ani:0,packag:0,have:0,tabl:0,need:0,moffitt:0,bosh_service_url:0,prebind:0,min:0,latter:0,also:0,exampl:0,build:0,which:0,singl:0,sure:0,though:0,track:0,object:0,most:0,deploi:0,homepag:0,don:0,url:0,request:0,xdomainrequest:0,show:0,text:0,session:0,fine:0,find:0,onli:0,locat:0,firstnam:0,configur:0,apach:0,should:0,folder:0,meant:0,get:0,opkod:0,requir:0,enabl:0,"public":0,reload:0,integr:0,where:0,set:0,stroph:0,see:0,close:0,state:0,between:0,experi:0,hide_muc_serv:0,screen:0,javascript:0,job:0,bosh:0,cor:0,instant:0,shortliv:0,conversej:0,etc:0,grain:0,mani:0,login:0,com:0,load:0,backend:0,onconnect:0,json:0,much:0,besid:0,subscrib:0,minifi:0,togeth:0,present:0,multi:0,servic:0,plugin:0,chat:0,demo:0,auto_subscrib:0,site:0,rid:0,minim:0,media:0,make:0,minif:0,cross:0,same:0,html:0,signon:0,http:0,webserv:0,optim:0,upon:0,hand:0,user:0,xhr_user_search:0,recent:0,stateless:0,person:[],contact:0,wherebi:0,thi:0,choos:0,usual:0,protocol:0,just:0,web:0,xmlhttprequest:0,add:0,other:0,input:0,yuicompressor:0,match:0,applic:0,read:0,nginx:0,traffic:0,like:0,xss:0,success:0,specif:0,server:0,benefit:0,either:0,page:0,deal:0,some:0,back:0,deploy:0,overcom:0,refer:0,run:0,host:0,panel:0,src:0,about:0,controlbox:0,manag:0,act:0,own:0,automat:0,your:0,log:0,wai:0,support:0,custom:0,avail:0,start:[],includ:0,lot:0,suit:0,"function":0,properli:0,form:0,bundl:0,link:0,synonym:0,"true":0,longer:0,info:0,made:0,possibl:0,"default":0,below:0,otherwis:0,problem:0,expect:0,featur:0,creat:0,exist:0,file:0,want:0,when:0,detail:0,field:0,valid:0,test:0,you:0,nice:0,node:0,stai:0,requirej:0},objtypes:{},titles:["Introduction"],objnames:{},filenames:["index"]}) Search.setIndex({objects:{},terms:{all:0,code:0,partial:0,queri:0,webchat:0,follow:0,middl:0,depend:0,sensit:0,sorri:0,those:0,under:0,string:0,fals:0,mechan:0,jack:0,veri:0,list:0,pleas:0,prevent:0,past:0,second:0,pass:0,download:0,further:0,fullnam:0,click:0,even:0,index:0,what:0,hide:0,section:0,current:0,version:[],"new":0,net:0,"public":0,widget:0,gener:0,here:0,bodi:0,valu:0,box:0,convert:0,convers:0,mysit:0,fetch:0,implement:0,via:0,extra:0,apach:0,ask:0,href:0,org:0,auto_list_room:0,instal:0,from:0,zip:0,commun:0,doubl:0,two:0,websit:0,stylesheet:0,call:0,recommend:0,type:0,until:0,tightli:0,more:0,yahoo:0,must:0,room:0,setup:[],work:0,xhr:0,can:0,lc_messag:0,purpos:0,root:0,blogpost:0,control:0,quickstart:0,share:0,templat:0,tag:0,proprietari:0,explor:0,onlin:0,occup:0,end:0,goal:0,write:0,how:0,sid:0,instead:0,css:0,updat:0,npm:0,regener:0,product:0,resourc:0,after:0,usabl:0,befor:0,callback:0,underscor:0,data:0,demonstr:0,man:0,practic:0,bind:0,show_controlbox_by_default:0,django:0,inform:0,order:0,chatbox:0,xmpp:0,over:0,through:0,streamlin:0,snippet:0,jid:0,directli:0,fit:0,pend:0,hidden:0,therefor:0,might:0,them:0,anim:0,"return":0,thei:0,initi:0,front:0,now:0,introduct:0,name:0,edit:0,authent:0,token:0,ejabberd:0,each:0,side:0,mean:0,domain:0,individu:0,realli:0,legwork:0,connect:0,happen:0,extract:0,special:0,variabl:0,shown:0,space:0,open:0,content:0,rel:0,internet:0,plural:0,factori:0,po2json:0,proxi:0,insid:0,standard:0,standalon:0,ajax:0,put:0,succesfulli:0,afterward:0,could:0,success:0,keep:0,yui:0,first:0,origin:0,softwar:0,render:0,onc:0,hoop:0,lastnam:0,number:0,yourself:0,restrict:0,alreadi:0,done:0,owner:0,jabber:0,differ:0,script:0,top:0,messag:0,attach:0,attack:0,jed:0,luckili:0,option:0,tool:0,specifi:0,compressor:0,part:0,exactli:0,than:0,serv:0,jump:0,kind:0,bloat:0,provid:0,remov:0,bridg:0,toward:[],browser:0,pre:0,sai:[],saa:0,modern:0,ani:0,packag:0,have:0,tabl:0,need:0,moffitt:0,element:0,bosh_service_url:0,prebind:0,min:0,latter:0,note:0,also:0,contact:0,build:0,which:0,singl:0,sure:0,roster:0,track:0,object:0,most:0,deploi:0,homepag:0,"class":0,don:0,url:0,request:0,face:0,runtim:0,xdomainrequest:0,show:0,german:0,text:0,session:0,fine:0,find:0,onli:0,locat:0,just:0,configur:0,solut:0,should:0,folder:0,local:0,meant:0,get:0,opkod:0,cannot:0,deploy:0,requir:0,enabl:0,emb:0,method:0,reload:0,integr:0,contain:0,where:0,set:0,stroph:0,see:0,close:0,statu:0,state:0,reus:0,between:0,experi:0,hide_muc_serv:0,attribut:0,kei:0,screen:0,javascript:0,conjunct:[],job:0,bosh:0,cor:0,instant:0,shortliv:0,conversej:0,etc:0,grain:0,mani:0,login:0,com:0,load:0,instanti:0,pot:0,backend:0,creat:0,rebuild:0,json:0,much:0,besid:0,subscrib:0,msgmerg:0,great:0,minifi:0,togeth:0,i18n:0,present:0,multi:0,main:0,servic:0,plugin:0,defin:0,file:0,helper:0,demo:0,auto_subscrib:0,site:0,rid:0,minim:0,receiv:0,media:0,make:0,minif:0,cross:0,same:0,html:0,chatroom:0,signon:0,http:0,webserv:0,optim:0,upon:0,hand:0,"50kb":0,user:0,xhr_user_search:0,recent:0,stateless:0,markup:0,person:[],exampl:0,command:0,wherebi:0,thi:0,choos:0,usual:0,plural_form:0,protocol:0,firstnam:0,languag:0,web:0,xmlhttprequest:0,had:0,add:0,valid:0,input:0,yuicompressor:0,match:0,take:0,applic:0,format:0,read:0,nginx:0,traffic:0,xss:0,like:0,specif:0,server:0,benefit:0,necessari:0,either:0,page:0,deal:0,nplural:0,some:0,back:0,librari:0,bottom:0,though:0,overcom:0,refer:0,run:0,host:0,panel:0,src:0,about:0,obj:[],controlbox:0,unfortun:0,act:0,own:0,encod:0,automat:0,wrap:0,your:0,manag:0,log:0,wai:0,transfer:0,support:0,custom:0,avail:0,start:[],includ:0,lot:0,suit:0,"var":0,"function":0,head:0,properli:0,form:0,bundl:0,link:0,translat:0,synonym:0,inlin:0,"true":0,congratul:0,requirej:0,info:0,made:0,locale_data:0,possibl:0,"default":0,below:0,toggl:0,otherwis:0,problem:0,expect:0,featur:0,onconnect:0,"100kb":[],exist:0,chat:0,want:0,when:0,detail:0,gettext:0,field:0,other:0,rememb:0,test:0,you:0,nice:0,node:0,intend:0,releas:0,stai:0,lang:0,longer:0,getjson:0,time:0},objtypes:{},titles:["Introduction"],objnames:{},filenames:["index"]})
\ No newline at end of file \ No newline at end of file
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.3.min.css"> <link rel="stylesheet" type="text/css" media="screen" href="converse.css">
<script src="converse.0.3.min.js"></script> <!-- <script src="converse.min.js"></script> -->
<!-- For development <script data-main="main" src="Libraries/require-jquery.js"></script> --> <script data-main="main" src="Libraries/require-jquery.js"></script>
<title>Converse.js</title> <title>Converse.js</title>
</head> </head>
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
<header class="inner"> <header class="inner">
<a id="forkme_banner" href="https://github.com/jcbrand/converse.js">View on GitHub</a> <a id="forkme_banner" href="https://github.com/jcbrand/converse.js">View on GitHub</a>
<h1 id="project_title"><a href="http://conversejs.org">Converse.js</a></h1> <h1 id="project_title"><a href="http://conversejs.org">Converse.js</a></h1>
<h2 id="project_tagline">Browser-based Instant Messaging with Strophe.js and Backbone.js</h2> <h2 id="project_tagline">An XMPP chat client for your website</h2>
<section id="downloads"> <section id="downloads">
<a class="zip_download_link" href="https://github.com/jcbrand/converse.js/archive/v0.3.zip">Download the latest release as a .zip file</a> <a class="zip_download_link" href="https://github.com/jcbrand/converse.js/archive/v0.4.zip">Download the latest release as a .zip file</a>
<a class="tar_download_link" href="https://github.com/jcbrand/converse.js/archive/v0.3.tar.gz">Download the latest release as a tar.gz file</a> <a class="tar_download_link" href="https://github.com/jcbrand/converse.js/archive/v0.4.tar.gz">Download the latest release as a tar.gz file</a>
</section> </section>
</header> </header>
</div> </div>
...@@ -28,25 +28,27 @@ ...@@ -28,25 +28,27 @@
<!-- 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> is an open source, web based, <a href="http://xmpp.org" target="_blank">XMPP/Jabber</a> chat client, similar to
<a href="https://www.facebook.com/sitetour/chat.php" target="_blank">Facebook chat</a>, but with added support for multi-user chatrooms.</p>
<p>It is a Javascript application that you can include in your <p><strong>Converse.js</strong> is an open source, webchat client, that
website, thereby providing it with instant messaging functionality.</p> runs in the browser and can be integrated into any website.</p>
<p>You will also need access to an XMPP/Jabber server. You can connect to any public, federated XMPP server, or you can set one up <p>It's similar to <a href="https://www.facebook.com/sitetour/chat.php" target="_blank">Facebook chat</a>, but also supports multi-user chatrooms.</p>
yourself, thereby maintaining stricter privacy controls.</p>
<p>It's possible to enable single-site login, whereby users already <p><em>Converse.js</em> can connect to any accessible <a href="http://xmpp.org" target="_blank">XMPP/Jabber</a> server, either from a public provider such as
authenticated in your website will also automatically be logged in on the chat server, but this will require custom code on your server.</p> <a href="http://jabber.org">jabber.org</a>, or to one you have set up
yourself.</a>
<p>It's possible to enable single-site login, whereby users already authenticated in your website will also automatically be logged in on the chat server,
but you will have to pre-authenticate them on your server. You can refer to the <a href="/docs/html/index.html">documentation</a> for more
info.</p>
<p>An <a href="http://github.com/collective/collective.xmpp.chat" target="_blank">add-on product</a> that does exactly this, <p>An <a href="http://github.com/collective/collective.xmpp.chat" target="_blank">add-on product</a> that does exactly this,
already exists for the <a href="http://plone.org" target="_blank">Plone</a> CMS. Hopefully in the future more such add-ons will already exists for the <a href="http://plone.org" target="_blank">Plone</a> CMS. Hopefully in the future more such add-ons will
be created for other platforms. be created for other platforms.
</p> </p>
<p>If you have integrated Converse.js into any other CMS or framework, <p>If you have integrated <em>Converse.js</em> into any other CMS or framework,
<a href="http://opkode.com/contact" target="_blank">please let me know</a> and I'll mention it on this page.</p> <a href="http://opkode.com/contact.html" target="_blank">please let me know</a> and I'll mention it on this page.</p>
<h2>Features</h2> <h2>Features</h2>
<ul> <ul>
...@@ -62,6 +64,7 @@ ...@@ -62,6 +64,7 @@
<li>Custom status messages</li> <li>Custom status messages</li>
<li>Typing notifications</li> <li>Typing notifications</li>
<li>Third person messages (/me )</li> <li>Third person messages (/me )</li>
<li>i18n aware</li>
</ul> </ul>
<h2>Screencasts</h2> <h2>Screencasts</h2>
...@@ -75,27 +78,20 @@ ...@@ -75,27 +78,20 @@
</ul> </ul>
<h2>Demo</h2> <h2>Demo</h2>
<p><a href="#" class="chat toggle-online-users">Click this link</a> or click the link on the bottom right corner of this page.</a></p> <p>You can log in with any existing XMPP account. There is also a list of public XMPP providers on <a href="http://xmpp.net" target="_blank">xmpp.net</a>.</p>
<p>You can log in with any existing federated Jabber/XMPP account, or create a new one at any of these providers: <p><em><strong>Note:</strong> currently the demo doesn't work in Internet Explorer older
<ul>
<li><a href="http://jabber.org" target="_blank">jabber.org</a></li>
<li><a href="https://jappix.com" target="_blank">jappix.com</a></li>
</ul>
There is also a list of public XMPP providers on <a href="xmpp.net" target="_blank">xmpp.net</a>.
</p>
<p><b>Note:</b> currently the demo doesn't work in Internet Explorer older
than 10. This is due to lacking support for <a href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing">CORS</a>, than 10. This is due to lacking support for <a href="https://en.wikipedia.org/wiki/Cross-origin_resource_sharing">CORS</a>,
a standard which enables cross-domain XmlHttpRequests. There are ways a standard which enables cross-domain XmlHttpRequests. There are ways
around this, but it hasn't been a priority for me to implement them for around this, but it hasn't been a priority for me to implement them for
this demo. this demo.
</p> </p>
<p> <p>
See <a href="/docs/html/index.html#overcoming-cross-domain-request-restrictions" target="_blank">here</a> for more information. See <a href="/docs/html/index.html#overcoming-cross-domain-request-restrictions" target="_blank">here</a> for more information.
</p> </p>
</em>
<h3>Is it secure?</h3> <h3>Is it secure?</h3>
<p>Yes. In this demo <strong>Converse.js</strong> makes an <p>Yes. In this demo <em>Converse.js</em> makes an
<a href="https://en.wikipedia.org/wiki/Secure_Sockets_Layer" target="_blank">SSL</a> encrypted connection to a secure connection manager. <a href="https://en.wikipedia.org/wiki/Secure_Sockets_Layer" target="_blank">SSL</a> encrypted connection to a secure connection manager.
The connection manager then uses SSL and <a href="https://en.wikipedia.org/wiki/Transport_Layer_Security">TLS</a> to connect to an XMPP server.</p> The connection manager then uses SSL and <a href="https://en.wikipedia.org/wiki/Transport_Layer_Security">TLS</a> to connect to an XMPP server.</p>
That said, the developers don't assume any liability for any loss or damages as a result of using this software or demo. Use this demo at your own risk. That said, the developers don't assume any liability for any loss or damages as a result of using this software or demo. Use this demo at your own risk.
...@@ -107,7 +103,7 @@ ...@@ -107,7 +103,7 @@
establish an authenticated connection on the server side and then attach to establish an authenticated connection on the server side and then attach to
this connection in your browser. this connection in your browser.
</p> </p>
<p><strong>Converse.js</strong> already supports this usecase, but you'll have to do more manual work yourself.</p> <p><em>Converse.js</em> already supports this usecase, but you'll have to do some integration work yourself.</p>
<h2>Documentation</h2> <h2>Documentation</h2>
...@@ -126,9 +122,10 @@ ...@@ -126,9 +122,10 @@
<h2>Credits and Dependencies</h2> <h2>Credits and Dependencies</h2>
<p><strong>Converse.js</strong> depends on a few third party libraries, including: <p><strong>Converse.js</strong> depends on a few third party libraries, including:
<ul> <ul>
<li><a href="http://jquery.com" target="_blank">JQuery</a></li>
<li><a href="http://strophe.im/strophejs" target="_blank">strophe.js</a></li> <li><a href="http://strophe.im/strophejs" target="_blank">strophe.js</a></li>
<li><a href="http://backbonejs.org" target="_blank">backbone.js</a></li> <li><a href="http://backbonejs.org" target="_blank">backbone.js</a></li>
<li><a href="http://requirejs.org" target="_blank">require.js</a></li> <li><a href="http://requirejs.org" target="_blank">require.js</a> (optional dependency)</li>
</ul> </ul>
</p> </p>
<p>Some images were taken from <a href="http://plone.org" target="_blank">Plone</a> and the <p>Some images were taken from <a href="http://plone.org" target="_blank">Plone</a> and the
...@@ -137,7 +134,12 @@ ...@@ -137,7 +134,12 @@
<h2>Licence</h2> <h2>Licence</h2>
<p><strong>Converse.js</strong> is released under both the <a href="http://opensource.org/licenses/mit-license.php" target="_blank">MIT</a> <p><strong>Converse.js</strong> is released under both the <a href="http://opensource.org/licenses/mit-license.php" target="_blank">MIT</a>
and <a href="http://opensource.org/licenses/GPL-2.0" target="_blank">GPL</a> licenses.</p> and <a href="http://opensource.org/licenses/GPL-2.0" target="_blank">GPL</a> licenses.</p>
<h2>Contact</h2>
<p>My XMPP username is <strong>jc@opkode.im</strong>.</p>
<p>You can send me an email via this <a href="http://opkode.com/contact" target="_blank">contact form</a>.</p>
</section> </section>
</div> </div>
<!-- FOOTER --> <!-- FOOTER -->
...@@ -151,7 +153,7 @@ ...@@ -151,7 +153,7 @@
<div id="collective-xmpp-chat-data"></div> <div id="collective-xmpp-chat-data"></div>
<div id="toggle-controlbox"> <div id="toggle-controlbox">
<a href="#" class="chat toggle-online-users"> <a href="#" class="chat toggle-online-users">
<strong class="conn-feedback">Click here to chat</strong> <strong style="display: none" id="online-count">(0)</strong> <strong class="conn-feedback">Toggle chat</strong> <strong style="display: none" id="online-count">(0)</strong>
</a> </a>
</div> </div>
</div> </div>
...@@ -162,4 +164,18 @@ ...@@ -162,4 +164,18 @@
</script> </script>
<script type="text/javascript">try { var pageTracker = _gat._getTracker("UA-2128260-8"); pageTracker._trackPageview(); } catch(err) {}</script> <script type="text/javascript">try { var pageTracker = _gat._getTracker("UA-2128260-8"); pageTracker._trackPageview(); } catch(err) {}</script>
</body> </body>
<script>
require(["jquery", "converse"], function ($, converse) {
converse.initialize({
auto_list_rooms: false,
auto_subscribe: false,
bosh_service_url: 'https://bind.opkode.im', // Please use this connection manager only for testing purposes
hide_muc_server: false,
i18n: locales.en, // Refer to ./locale/locales.js to see which locales are supported
prebind: false,
show_controlbox_by_default: true,
xhr_user_search: false
});
});
</script>
</html> </html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Jan-Carel Brand
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Converse.js 0.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-06-01 23:03+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: converse.js:397 converse.js:1128
msgid "Show this menu"
msgstr ""
#: converse.js:398 converse.js:1129
msgid "Write in the third person"
msgstr ""
#: converse.js:399 converse.js:1133
msgid "Remove messages"
msgstr ""
#: converse.js:539
msgid "Personal message"
msgstr ""
#: converse.js:613
msgid "Contacts"
msgstr ""
#: converse.js:618
msgid "Online"
msgstr ""
#: converse.js:619
msgid "Busy"
msgstr ""
#: converse.js:620
msgid "Away"
msgstr ""
#: converse.js:621
msgid "Offline"
msgstr ""
#: converse.js:628
msgid "Click to add new chat contacts"
msgstr ""
#: converse.js:628
msgid "Add a contact"
msgstr ""
#: converse.js:637
msgid "Contact username"
msgstr ""
#: converse.js:638
msgid "Add"
msgstr ""
#: converse.js:646
msgid "Contact name"
msgstr ""
#: converse.js:647
msgid "Search"
msgstr ""
#: converse.js:682
msgid "No users found"
msgstr ""
#: converse.js:689
msgid "Click to add as a chat contact"
msgstr ""
#: converse.js:753
msgid "Click to open this room"
msgstr ""
#: converse.js:755
msgid "Show more information on this room"
msgstr ""
#: converse.js:760
msgid "Description:"
msgstr ""
#: converse.js:761
msgid "Occupants:"
msgstr ""
#: converse.js:762
msgid "Features:"
msgstr ""
#: converse.js:764
msgid "Requires authentication"
msgstr ""
#: converse.js:767
msgid "Hidden"
msgstr ""
#: converse.js:770
msgid "Requires an invitation"
msgstr ""
#: converse.js:773
msgid "Moderated"
msgstr ""
#: converse.js:776
msgid "Non-anonymous"
msgstr ""
#: converse.js:779
msgid "Open room"
msgstr ""
#: converse.js:782
msgid "Permanent room"
msgstr ""
#: converse.js:785
msgid "Public"
msgstr ""
#: converse.js:788
msgid "Semi-anonymous"
msgstr ""
#: converse.js:791
msgid "Temporary room"
msgstr ""
#: converse.js:794
msgid "Unmoderated"
msgstr ""
#: converse.js:800
msgid "Rooms"
msgstr ""
#: converse.js:804
msgid "Room name"
msgstr ""
#: converse.js:805
msgid "Nickname"
msgstr ""
#: converse.js:806
msgid "Server"
msgstr ""
#: converse.js:807
msgid "Join"
msgstr ""
#: converse.js:808
msgid "Show rooms"
msgstr ""
#. For translators: %1$s is a variable and will be replaced with the XMPP server name
#: converse.js:841
msgid "No rooms on %1$s"
msgstr ""
#. For translators: %1$s is a variable and will be
#. replaced with the XMPP server name
#: converse.js:856
msgid "Rooms on %1$s"
msgstr ""
#: converse.js:1130
msgid "Set chatroom topic"
msgstr ""
#: converse.js:1131
msgid "Kick user from chatroom"
msgstr ""
#: converse.js:1132
msgid "Ban user from chatroom"
msgstr ""
#: converse.js:1159
msgid "Message"
msgstr ""
#: converse.js:1273 converse.js:2318
msgid "Save"
msgstr ""
#: converse.js:1274
msgid "Cancel"
msgstr ""
#: converse.js:1321
msgid "An error occurred while trying to save the form."
msgstr ""
#: converse.js:1367
msgid "This chatroom requires a password"
msgstr ""
#: converse.js:1368
msgid "Password: "
msgstr ""
#: converse.js:1369
msgid "Submit"
msgstr ""
#: converse.js:1383
msgid "This room is not anonymous"
msgstr ""
#: converse.js:1384
msgid "This room now shows unavailable members"
msgstr ""
#: converse.js:1385
msgid "This room does not show unavailable members"
msgstr ""
#: converse.js:1386
msgid "Non-privacy-related room configuration has changed"
msgstr ""
#: converse.js:1387
msgid "Room logging is now enabled"
msgstr ""
#: converse.js:1388
msgid "Room logging is now disabled"
msgstr ""
#: converse.js:1389
msgid "This room is now non-anonymous"
msgstr ""
#: converse.js:1390
msgid "This room is now semi-anonymous"
msgstr ""
#: converse.js:1391
msgid "This room is now fully-anonymous"
msgstr ""
#: converse.js:1392
msgid "A new room has been created"
msgstr ""
#: converse.js:1393
msgid "Your nickname has been changed"
msgstr ""
#. For translations: %1$s will be replaced with the user's nickname
#. Don't translate "strong"
#. Example: <strong>jcbrand</strong> has been banned
#: converse.js:1400
msgid "<strong>%1$s</strong> has been banned"
msgstr ""
#. For translations: %1$s will be replaced with the user's nickname
#. Don't translate "strong"
#. Example: <strong>jcbrand</strong> has been kicked out
#: converse.js:1404
msgid "<strong>%1$s</strong> has been kicked out"
msgstr ""
#. For translations: %1$s will be replaced with the user's nickname
#. Don't translate "strong"
#. Example: <strong>jcbrand</strong> has been removed because of an affiliasion change
#: converse.js:1408
msgid "<strong>%1$s</strong> has been removed because of an affiliation change"
msgstr ""
#. For translations: %1$s will be replaced with the user's nickname
#. Don't translate "strong"
#. Example: <strong>jcbrand</strong> has been removed for not being a member
#: converse.js:1412
msgid "<strong>%1$s</strong> has been removed for not being a member"
msgstr ""
#: converse.js:1416 converse.js:1478
msgid "You have been banned from this room"
msgstr ""
#: converse.js:1417
msgid "You have been kicked from this room"
msgstr ""
#: converse.js:1418
msgid "You have been removed from this room because of an affiliation change"
msgstr ""
#: converse.js:1419
msgid ""
"You have been removed from this room because the room has changed to members-"
"only and you're not a member"
msgstr ""
#: converse.js:1420
msgid ""
"You have been removed from this room because the MUC (Multi-user chat) "
"service is being shut down."
msgstr ""
#: converse.js:1476
msgid "You are not on the member list of this room"
msgstr ""
#: converse.js:1482
msgid "No nickname was specified"
msgstr ""
#: converse.js:1486
msgid "You are not allowed to create new rooms"
msgstr ""
#: converse.js:1488
msgid "Your nickname doesn't conform to this room's policies"
msgstr ""
#: converse.js:1490
msgid "Your nickname is already taken"
msgstr ""
#: converse.js:1492
msgid "This room does not (yet) exist"
msgstr ""
#: converse.js:1494
msgid "This room has reached it's maximum number of occupants"
msgstr ""
#. For translators: the %1$s and %2$s parts will get replaced by the user and topic text respectively
#. Example: Topic set by JC Brand to: Hello World!
#: converse.js:1571
msgid "Topic set by %1$s to: %2$s"
msgstr ""
#: converse.js:1587
msgid "This user is a moderator"
msgstr ""
#: converse.js:1590
msgid "This user can send messages in this room"
msgstr ""
#: converse.js:1593
msgid "This user can NOT send messages in this room"
msgstr ""
#: converse.js:1796
msgid "Click to chat with this contact"
msgstr ""
#: converse.js:1797 converse.js:1801
msgid "Click to remove this contact"
msgstr ""
#: converse.js:2163
msgid "Contact requests"
msgstr ""
#: converse.js:2164
msgid "My contacts"
msgstr ""
#: converse.js:2165
msgid "Pending contacts"
msgstr ""
#: converse.js:2317
msgid "Custom status"
msgstr ""
#: converse.js:2323
msgid "Click to change your chat status"
msgstr ""
#: converse.js:2326
msgid "Click here to write a custom status message"
msgstr ""
#: converse.js:2355 converse.js:2363
msgid "online"
msgstr ""
#: converse.js:2357
msgid "busy"
msgstr ""
#: converse.js:2359
msgid "away for long"
msgstr ""
#: converse.js:2361
msgid "away"
msgstr ""
#. For translators: the %1$s part gets replaced with the status
#. Example, I am online
#: converse.js:2375 converse.js:2409
msgid "I am %1$s"
msgstr ""
#: converse.js:2480
msgid "Sign in"
msgstr ""
#: converse.js:2483
msgid "XMPP/Jabber Username:"
msgstr ""
#: converse.js:2485
msgid "Password:"
msgstr ""
#: converse.js:2487
msgid "Log In"
msgstr ""
#: converse.js:2491
msgid "BOSH Service URL:"
msgstr ""
#: converse.js:2503
msgid "Connected"
msgstr ""
#: converse.js:2507
msgid "Disconnected"
msgstr ""
#: converse.js:2511
msgid "Error"
msgstr ""
#: converse.js:2513
msgid "Connecting"
msgstr ""
#: converse.js:2516
msgid "Connection Failed"
msgstr ""
#: converse.js:2518
msgid "Authenticating"
msgstr ""
#: converse.js:2521
msgid "Authentication Failed"
msgstr ""
#: converse.js:2523
msgid "Disconnecting"
msgstr ""
#: converse.js:2525
msgid "Attached"
msgstr ""
#: converse.js:2656
msgid "Online Contacts"
msgstr ""
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
(function (root, factory) {
define("en", ['jed'], function () {
var en = new Jed({
"domain": "converse",
"locale_data": {
"converse": {
"": {
"domain": "converse",
"lang": "en",
"plural_forms": "nplurals=2; plural=(n != 1);"
}
}
}
});
return factory(en);
});
}(this, function (en) {
return en;
}));
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* This file specifies the language dependencies.
*
* Translations take up a lot of space and you are therefore advised to remove
* from here any languages that you don't need.
*/
(function (root, factory) {
require.config({
paths: {
"jed": "Libraries/jed",
"af": "locale/af/LC_MESSAGES/af",
"en": "locale/en/LC_MESSAGES/en",
"es": "locale/es/LC_MESSAGES/es",
"de": "locale/de/LC_MESSAGES/de",
"hu": "locale/hu/LC_MESSAGES/hu",
"it": "locale/it/LC_MESSAGES/it"
}
});
define("locales", [
'jed',
'af',
'en',
'es',
'de',
'hu',
"it"
], function (jed, af, en, es, de, hu, it) {
root.locales = {};
root.locales.af = af;
root.locales.en = en;
root.locales.es = es;
root.locales.de = de;
root.locales.hu = hu;
root.locales.it = it;
});
})(this);
require(["jquery", "converse"], function($, converse) { require(["jquery", "converse"], function($, converse) {
converse.initialize({ window.converse = converse;
bosh_service_url: 'https://bind.opkode.im' // Please use this connection manager only for testing purposes
});
}); });
(function (root, factory) { (function (root, factory) {
define("mock", define("mock",
['converse'], ['converse'],
function() { function() {
return factory(); return factory();
}); });
}(this, function (converse) { }(this, function (converse) {
var mock_connection = { var mock_connection = {
...@@ -10,10 +10,11 @@ ...@@ -10,10 +10,11 @@
'listRooms': function () {}, 'listRooms': function () {},
'join': function () {}, 'join': function () {},
'leave': function () {}, 'leave': function () {},
'removeRoom': function () {} 'removeRoom': function () {},
'rooms': {}
}, },
'jid': 'dummy@localhost', 'jid': 'dummy@localhost',
'addHandler': function (handler, ns, name, type, id, from, options) { 'addHandler': function (handler, ns, name, type, id, from, options) {
return function () {}; return function () {};
}, },
'send': function () {}, 'send': function () {},
...@@ -25,15 +26,22 @@ ...@@ -25,15 +26,22 @@
'subscribe': function () {}, 'subscribe': function () {},
'registerCallback': function () {} 'registerCallback': function () {}
}, },
'vcard': { 'vcard': {
'get': function (callback, jid) { 'get': function (callback, jid) {
var name = jid.split('@')[0].replace('.', ' ').split(' '); var firstname, lastname;
var firstname = name[0].charAt(0).toUpperCase()+name[0].slice(1); if (!jid) {
var lastname = name[1].charAt(0).toUpperCase()+name[1].slice(1); jid = 'dummy@localhost';
firstname = 'Max';
lastname = 'Mustermann';
} else {
var name = jid.split('@')[0].replace('.', ' ').split(' ');
firstname = name[0].charAt(0).toUpperCase()+name[0].slice(1);
lastname = name[1].charAt(0).toUpperCase()+name[1].slice(1);
}
var fullname = firstname+' '+lastname; var fullname = firstname+' '+lastname;
var vcard = $iq().c('vCard').c('FN').t(fullname); var vcard = $iq().c('vCard').c('FN').t(fullname);
callback(vcard.tree()); callback(vcard.tree());
} }
}, },
'disco': { 'disco': {
'info': function () {}, 'info': function () {},
......
{
"name": "converse.js",
"version": "0.5.0",
"description": "Browser based XMPP instant messaging client",
"main": "main.js",
"directories": {
"doc": "docs"
},
"scripts": {
"test": ""
},
"repository": {
"type": "git",
"url": "git://github.com/jcbrand/converse.js.git"
},
"keywords": [
"XMPP",
"Jabber",
"chat",
"messaging",
"chatrooms",
"webchat"
],
"author": "JC Brand",
"license": "MIT",
"bugs": {
"url": "https://github.com/jcbrand/converse.js/issues"
},
"devDependencies": {
"grunt-cli": "~0.1.9",
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.6.0"
}
}
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
expect(converse.connection.muc.removeRoom).toHaveBeenCalled(); expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.renderPasswordForm).toHaveBeenCalled(); expect(view.renderPasswordForm).toHaveBeenCalled();
expect($chat_body.find('form.chatroom-form').length).toBe(1); expect($chat_body.find('form.chatroom-form').length).toBe(1);
expect($chat_body.find('legend').text()).toBe('This chat room requires a password'); expect($chat_body.find('legend').text()).toBe('This chatroom requires a password');
}); });
}, converse)); }, converse));
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
.c('registration-required').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree; .c('registration-required').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree;
var view = this.chatboxesview.views['problematic@muc.localhost']; var view = this.chatboxesview.views['problematic@muc.localhost'];
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'renderErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled(); expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe('You are not on the member list of this room'); expect(view.$el.find('.chat-body p').text()).toBe('You are not on the member list of this room');
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
.c('forbidden').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree; .c('forbidden').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree;
var view = this.chatboxesview.views['problematic@muc.localhost']; var view = this.chatboxesview.views['problematic@muc.localhost'];
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'renderErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled(); expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe('You have been banned from this room'); expect(view.$el.find('.chat-body p').text()).toBe('You have been banned from this room');
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
.c('jid-malformed').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree; .c('jid-malformed').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree;
var view = this.chatboxesview.views['problematic@muc.localhost']; var view = this.chatboxesview.views['problematic@muc.localhost'];
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'renderErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled(); expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe('No nickname was specified'); expect(view.$el.find('.chat-body p').text()).toBe('No nickname was specified');
...@@ -213,7 +213,7 @@ ...@@ -213,7 +213,7 @@
.c('not-allowed').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree; .c('not-allowed').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree;
var view = this.chatboxesview.views['problematic@muc.localhost']; var view = this.chatboxesview.views['problematic@muc.localhost'];
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'renderErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled(); expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe('You are not allowed to create new rooms'); expect(view.$el.find('.chat-body p').text()).toBe('You are not allowed to create new rooms');
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
.c('not-acceptable').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree; .c('not-acceptable').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree;
var view = this.chatboxesview.views['problematic@muc.localhost']; var view = this.chatboxesview.views['problematic@muc.localhost'];
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'renderErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled(); expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe("Your nickname doesn't conform to this room's policies"); expect(view.$el.find('.chat-body p').text()).toBe("Your nickname doesn't conform to this room's policies");
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
.c('conflict').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree; .c('conflict').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree;
var view = this.chatboxesview.views['problematic@muc.localhost']; var view = this.chatboxesview.views['problematic@muc.localhost'];
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'renderErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled(); expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe("Your nickname is already taken"); expect(view.$el.find('.chat-body p').text()).toBe("Your nickname is already taken");
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
.c('item-not-found').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree; .c('item-not-found').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree;
var view = this.chatboxesview.views['problematic@muc.localhost']; var view = this.chatboxesview.views['problematic@muc.localhost'];
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'renderErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled(); expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe("This room does not (yet) exist"); expect(view.$el.find('.chat-body p').text()).toBe("This room does not (yet) exist");
...@@ -281,7 +281,7 @@ ...@@ -281,7 +281,7 @@
.c('service-unavailable').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree; .c('service-unavailable').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree;
var view = this.chatboxesview.views['problematic@muc.localhost']; var view = this.chatboxesview.views['problematic@muc.localhost'];
spyOn(converse.connection.muc, 'removeRoom'); spyOn(converse.connection.muc, 'removeRoom');
spyOn(view, 'renderErrorMessage').andCallThrough(); spyOn(view, 'showErrorMessage').andCallThrough();
view.onChatRoomPresence(presence, {'nick': 'dummy'}); view.onChatRoomPresence(presence, {'nick': 'dummy'});
expect(converse.connection.muc.removeRoom).toHaveBeenCalled(); expect(converse.connection.muc.removeRoom).toHaveBeenCalled();
expect(view.$el.find('.chat-body p').text()).toBe("This room has reached it's maximum number of occupants"); expect(view.$el.find('.chat-body p').text()).toBe("This room has reached it's maximum number of occupants");
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
expect($("div#controlbox").is(':visible')).toBe(true); expect($("div#controlbox").is(':visible')).toBe(true);
}, converse); }, converse);
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("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;
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
var i, t, is_last; var i, t, is_last;
spyOn(this.rosterview, 'render').andCallThrough(); spyOn(this.rosterview, 'render').andCallThrough();
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({
jid: pend_names[i].replace(' ','.').toLowerCase() + '@localhost', jid: pend_names[i].replace(' ','.').toLowerCase() + '@localhost',
subscription: 'none', subscription: 'none',
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
fullname: pend_names[i], fullname: pend_names[i],
is_last: is_last is_last: is_last
}); });
// For performance reasons, the roster should only be shown once // For performance reasons, the roster should only be shown once
// 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);
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
subscription: 'both', subscription: 'both',
ask: null, ask: null,
fullname: cur_names[i], fullname: cur_names[i],
is_last: i==(cur_names.length-1) is_last: i===(cur_names.length-1)
}); });
expect(this.rosterview.render).toHaveBeenCalled(); expect(this.rosterview.render).toHaveBeenCalled();
// Check that they are sorted alphabetically // Check that they are sorted alphabetically
...@@ -291,7 +291,7 @@ ...@@ -291,7 +291,7 @@
subscription: 'none', subscription: 'none',
ask: 'request', ask: 'request',
fullname: req_names[i], fullname: req_names[i],
is_last: i==(req_names.length-1) is_last: i===(req_names.length-1)
}); });
expect(this.rosterview.render).toHaveBeenCalled(); expect(this.rosterview.render).toHaveBeenCalled();
// Check that they are sorted alphabetically // Check that they are sorted alphabetically
...@@ -335,7 +335,7 @@ ...@@ -335,7 +335,7 @@
expect(this.rosterview.removeRosterItem).toHaveBeenCalled(); expect(this.rosterview.removeRosterItem).toHaveBeenCalled();
expect(this.connection.roster.unauthorize).toHaveBeenCalled(); expect(this.connection.roster.unauthorize).toHaveBeenCalled();
// There should now be one less contact // There should now be one less contact
expect(this.roster.length).toEqual(num_contacts-1); expect(this.roster.length).toEqual(num_contacts-1);
}, converse)); }, converse));
}, converse)); }, converse));
...@@ -368,7 +368,7 @@ ...@@ -368,7 +368,7 @@
afterEach($.proxy(function () { afterEach($.proxy(function () {
// Contacts retrieved from localStorage have chat_status of // Contacts retrieved from localStorage have chat_status of
// "offline". // "offline".
// In the next test suite, we need some online contacts, so // In the next test suite, we need some online contacts, so
// we make some online now // we make some online now
for (i=0; i<5; i++) { for (i=0; i<5; i++) {
...@@ -456,7 +456,7 @@ ...@@ -456,7 +456,7 @@
expect(newchatboxes.length).toEqual(0); expect(newchatboxes.length).toEqual(0);
// Lets open the controlbox again, purely for visual feedback // Lets open the controlbox again, purely for visual feedback
open_controlbox(); open_controlbox();
}, converse)); }, converse));
describe("A Chat Message", $.proxy(function () { describe("A Chat Message", $.proxy(function () {
...@@ -465,14 +465,12 @@ ...@@ -465,14 +465,12 @@
var sender_jid = cur_names[0].replace(' ','.').toLowerCase() + '@localhost'; var sender_jid = cur_names[0].replace(' ','.').toLowerCase() + '@localhost';
msg = $msg({ msg = $msg({
from: sender_jid, from: sender_jid,
to: this.connection.jid, to: this.connection.jid,
type: 'chat', type: 'chat',
id: (new Date()).getTime() id: (new Date()).getTime()
}).c('body').t(message).up() }).c('body').t(message).up()
.c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree(); .c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree();
spyOn(this, 'getVCard').andCallThrough();
// We don't already have an open chatbox for this user // We don't already have an open chatbox for this user
expect(this.chatboxes.get(sender_jid)).not.toBeDefined(); expect(this.chatboxes.get(sender_jid)).not.toBeDefined();
...@@ -483,10 +481,6 @@ ...@@ -483,10 +481,6 @@
}, converse)); }, converse));
waits(500); waits(500);
runs($.proxy(function () { runs($.proxy(function () {
// Since we didn't already have an open chatbox, one
// will asynchronously created inside a callback to
// getVCard
expect(this.getVCard).toHaveBeenCalled();
// Check that the chatbox and its view now exist // Check that the chatbox and its view now exist
var chatbox = this.chatboxes.get(sender_jid); var chatbox = this.chatboxes.get(sender_jid);
var chatboxview = this.chatboxesview.views[sender_jid]; var chatboxview = this.chatboxesview.views[sender_jid];
...@@ -504,8 +498,11 @@ ...@@ -504,8 +498,11 @@
expect(msg_obj.get('delayed')).toEqual(false); expect(msg_obj.get('delayed')).toEqual(false);
// Now check that the message appears inside the // Now check that the message appears inside the
// chatbox in the DOM // chatbox in the DOM
var txt = chatboxview.$el.find('.chat-content').find('.chat-message').find('.chat-message-content').text(); var $chat_content = chatboxview.$el.find('.chat-content');
expect(txt).toEqual(message); var msg_txt = $chat_content.find('.chat-message').find('.chat-message-content').text();
expect(msg_txt).toEqual(message);
var sender_txt = $chat_content.find('span.chat-message-them').text();
expect(sender_txt.match(/^[0-9][0-9]:[0-9][0-9] /)).toBeTruthy();
}, converse)); }, converse));
}, converse)); }, converse));
...@@ -537,8 +534,8 @@ ...@@ -537,8 +534,8 @@
var sender_jid = cur_names[0].replace(' ','.').toLowerCase() + '@localhost'; var sender_jid = cur_names[0].replace(' ','.').toLowerCase() + '@localhost';
msg = $msg({ msg = $msg({
from: sender_jid, from: sender_jid,
to: this.connection.jid, to: this.connection.jid,
type: 'chat', type: 'chat',
id: (new Date()).getTime() id: (new Date()).getTime()
}).c('body').t(message).up() }).c('body').t(message).up()
.c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree(); .c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree();
...@@ -566,8 +563,8 @@ ...@@ -566,8 +563,8 @@
var sender_jid = cur_names[0].replace(' ','.').toLowerCase() + '@localhost'; var sender_jid = cur_names[0].replace(' ','.').toLowerCase() + '@localhost';
msg = $msg({ msg = $msg({
from: sender_jid, from: sender_jid,
to: this.connection.jid, to: this.connection.jid,
type: 'chat', type: 'chat',
id: (new Date()).getTime() id: (new Date()).getTime()
}).c('body').t(message).up() }).c('body').t(message).up()
.c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree(); .c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree();
......
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