Commit 36db4c8b authored by JC Brand's avatar JC Brand

Merge branch 'master' into plugin-api

parents 0963f5c4 e1efb604
......@@ -99,10 +99,17 @@ module.exports = function(grunt) {
done();
};
exec('./node_modules/requirejs/bin/r.js -o src/build.js && ' +
'./node_modules/requirejs/bin/r.js -o src/build.js optimize=none out=builds/converse.js && ' +
'./node_modules/requirejs/bin/r.js -o src/build-no-jquery.js &&' +
'./node_modules/requirejs/bin/r.js -o src/build-no-jquery.js optimize=none out=builds/converse.nojquery.js && ' +
'./node_modules/requirejs/bin/r.js -o src/build-no-locales-no-otr.js && ' +
'./node_modules/requirejs/bin/r.js -o src/build-no-locales-no-otr.js optimize=none out=builds/converse-no-locales-no-otr.js && ' +
'./node_modules/requirejs/bin/r.js -o src/build-no-otr.js &&' +
'./node_modules/requirejs/bin/r.js -o src/build-no-otr.js optimize=none out=builds/converse-no-otr.js && ' +
'./node_modules/requirejs/bin/r.js -o src/build-website-no-otr.js &&' +
'./node_modules/requirejs/bin/r.js -o src/build-website.js', callback);
// XXX: It might be possible to not have separate build config files. For example:
// 'r.js -o src/build.js paths.converse-dependencies=src/deps-no-otr paths.locales=locale/nolocales out=builds/converse-no-locales-no-otr.min.js'
});
grunt.registerTask('minify', 'Create a new release', ['cssmin', 'jsmin']);
......
......@@ -16,7 +16,6 @@
"backbone.browserStorage": "*",
"backbone.overview": "*",
"strophe": "~1.1.3",
"strophe.roster": "https://raw.github.com/strophe/strophejs-plugins/b1f364eb6e854ffe844c57add38e885cfeb9b498/roster/strophe.roster.js",
"strophe.muc": "https://raw.githubusercontent.com/strophe/strophejs-plugins/master/muc/strophe.muc.js",
"otr": "0.2.12",
"crypto-js-evanvosberg": "~3.1.2",
......@@ -30,7 +29,7 @@
"bootstrapJS": "https://raw.githubusercontent.com/jcbrand/bootstrap/7d96a5f60d26c67b5348b270a775518b96a702c8/dist/js/bootstrap.js",
"fontawesome": "~4.1.0",
"typeahead.js": "https://raw.githubusercontent.com/jcbrand/typeahead.js/eedfb10505dd3a20123d1fafc07c1352d83f0ab3/dist/typeahead.jquery.js",
"strophejs-plugins": "~0.0.4"
"strophejs-plugins": "https://github.com/strophe/strophejs-plugins.git#a56421ff4ecf0807113ab48c46728715597df599"
},
"exportsOverride": {}
}
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 diff is collapsed.
......@@ -42,7 +42,7 @@ __p += '<li>\n <form class="add-xmpp-contact">\n <input type="text"\n
((__t = (label_contact_username)) == null ? '' : __t) +
'"/>\n <button type="submit">' +
((__t = (label_add)) == null ? '' : __t) +
'</button>\n </form>\n<li>\n';
'</button>\n </form>\n</li>\n';
}
return __p
......@@ -380,7 +380,7 @@ __p += '<form id="converse-login" method="post">\n <label>' +
((__t = (label_password)) == null ? '' : __t) +
'</label>\n <input type="password" name="password" placeholder="Password">\n <input class="login-submit" type="submit" value="' +
((__t = (label_login)) == null ? '' : __t) +
'">\n <span class="conn-feedback"></span>\n</form">\n';
'">\n <span class="conn-feedback"></span>\n</form>\n';
}
return __p
......@@ -660,13 +660,13 @@ this["JST"]["roster"] = function(obj) {
obj || (obj = {});
var __t, __p = '', __e = _.escape;
with (obj) {
__p += '<input class="roster-filter" placeholder="' +
__p += '<input style="display: none;" class="roster-filter" placeholder="' +
((__t = (placeholder)) == null ? '' : __t) +
'">\n<select class="filter-type">\n <option value="contacts">' +
'">\n<select style="display: none;" class="filter-type">\n <option value="contacts">' +
((__t = (label_contacts)) == null ? '' : __t) +
'</option>\n <option value="groups">' +
((__t = (label_groups)) == null ? '' : __t) +
'</option>\n</select>\n<dl class="roster-contacts"></dl>\n';
'</option>\n</select>\n';
}
return __p
......@@ -700,7 +700,7 @@ __p += '<li>\n <form class="search-xmpp-contact">\n <input type="text"
((__t = (label_contact_name)) == null ? '' : __t) +
'"/>\n <button type="submit">' +
((__t = (label_search)) == null ? '' : __t) +
'</button>\n </form>\n<li>\n';
'</button>\n </form>\n</li>\n';
}
return __p
......
This diff is collapsed.
Changelog
=========
0.8.4 (Unreleased)
------------------
.. note::
The current API methods will be deprecated in future bugfix releases and
a new API will be made available for the 0.9.0 release.
* Bugfix. Error when trying to use prebind and keepalive together. [heban and jcbrand]
* Bugfix. Cannot read property "top" of undefined. [jcbrand]
* Add new event, noResumeableSession, for when keepalive=true and there aren't
any prebind session tokens. [jcbrand]
* Add 2 new API methods, getChatBox and openChatBox. [jcbrand]
* #46 Add 2 new API methods, getChatBox and openChatBox. [jcbrand]
* #151 Browser locks/freezes with many roster users. [jcbrand]
* #251 Non-minified builds for debugging. [jcbrand]
* #264 Remove unnecessary commas for ie8 compatibility. [Deuteu]
* #267 Unread messages counter wrongly gets incremented by chat state notifications. [Deuteu]
0.8.3 (2014-09-22)
------------------
......
......@@ -808,8 +808,20 @@ After adding the string, you'll need to regenerate the POT file, like so:
make pot
To create a new PO file for a language in which converse.js is not yet
translated into, do the following
.. note:: In this example we use Polish (pl), you need to substitute 'pl' to your own language's code.
::
mkdir -p ./locale/pl/LC_MESSAGES
msginit -i ./locale/converse.pot -o ./locale/pl/LC_MESSAGES/converse.po -l pl
You can then create or update the PO file for a specific language by doing the following:
.. note:: In this example we use German (de), you need to substitute 'de' to your own language's code.
::
msgmerge ./locale/de/LC_MESSAGES/converse.po ./locale/converse.pot -U
......
......@@ -229,7 +229,6 @@
<script type="text/javascript">try { var pageTracker = _gat._getTracker("UA-2128260-8"); pageTracker._trackPageview(); } catch(err) {}</script>
<script>
// Configuration loaded, so safe to make other require calls.
require(['converse'], function (converse) {
(function () {
/* XXX: This function initializes jquery.easing for the https://conversejs.org
......@@ -255,14 +254,17 @@
})();
converse.initialize({
allow_otr: true,
auto_list_rooms: false,
auto_subscribe: false,
bosh_service_url: 'https://bind.conversejs.org', // Please use this connection manager only for testing purposes
i18n: locales.en, // Refer to ./locale/locales.js to see which locales are supported
hide_muc_server: false,
i18n: locales['en'], // Refer to ./locale/locales.js to see which locales are supported
keepalive: true,
play_sounds: true,
prebind: false,
roster_groups: true,
show_controlbox_by_default: true,
debug: true,
roster_groups: true
xhr_user_search: false
});
});
</script>
......
This diff is collapsed.
This diff is collapsed.
config = {
require.config({
baseUrl: '.',
paths: {
"backbone": "components/backbone/backbone",
......@@ -17,7 +17,7 @@ config = {
"strophe": "components/strophe/strophe",
"strophe.disco": "components/strophejs-plugins/disco/strophe.disco",
"strophe.muc": "components/strophe.muc/index",
"strophe.roster": "components/strophe.roster/index",
"strophe.roster": "src/strophe.roster",
"strophe.vcard": "components/strophejs-plugins/vcard/strophe.vcard",
"text": 'components/requirejs-text/text',
"tpl": 'components/requirejs-tpl-jcbrand/tpl',
......@@ -139,16 +139,13 @@ config = {
'crypto.sha1': { deps: ['crypto.core'] },
'crypto.sha256': { deps: ['crypto.core'] },
'bigint': { deps: ['crypto'] },
'strophe': { exports: 'Strophe' },
'strophe.disco': { deps: ['strophe'] },
'strophe.muc': { deps: ['strophe'] },
'strophe.roster': { deps: ['strophe'] },
'strophe.vcard': { deps: ['strophe'] }
}
};
if (typeof(require) !== 'undefined') {
require.config(config);
require(["jquery", "converse"], function($, converse) {
});
require(["converse"], function(converse) {
window.converse = converse;
});
}
});
......@@ -57,6 +57,12 @@
expect($("#conversejs .chatbox").length).toBe(1); // Controlbox is open
// Test that they can be trimmed
runs($.proxy(function () {
converse.rosterview.update(); // XXX: Hack to make sure $roster element is attaced.
}, this));
waits(50);
runs($.proxy(function () {
// Test that they can be maximized again
var online_contacts = this.rosterview.$el.find('dt.roster-group').siblings('dd.current-xmpp-contact').find('a.open-chat');
for (i=0; i<online_contacts.length; i++) {
$el = $(online_contacts[i]);
......@@ -71,9 +77,6 @@
expect(chatboxview.hide).toHaveBeenCalled();
trimmedview = trimmed_chatboxes.get(jid);
}
// Test that they can be maximized again
runs($.proxy(function () {
var key = this.chatboxviews.keys()[1];
trimmedview = trimmed_chatboxes.get(key);
chatbox = trimmedview.model;
......@@ -99,11 +102,19 @@
chatbox = test_utils.openChatBoxFor(contact_jid);
chatboxview = this.chatboxviews.get(contact_jid);
spyOn(chatboxview, 'focus');
// Test that they can be trimmed
runs($.proxy(function () {
converse.rosterview.update(); // XXX: Hack to make sure $roster element is attaced.
}, this));
waits(50);
runs($.proxy(function () {
$el = this.rosterview.$el.find('a.open-chat:contains("'+chatbox.get('fullname')+'")');
jid = $el.text().replace(/ /g,'.').toLowerCase() + '@localhost';
$el.click();
expect(this.chatboxes.length).toEqual(2);
expect(chatboxview.focus).toHaveBeenCalled();
}, this));
}, converse));
it("can be saved to, and retrieved from, browserStorage", $.proxy(function () {
......
This diff is collapsed.
......@@ -84,6 +84,42 @@
expect(this.minimized_chats.toggleview.$('.unread-message-count').is(':visible')).toBeTruthy();
expect(this.minimized_chats.toggleview.$('.unread-message-count').text()).toBe((i+1).toString());
}
// Chat state notifications don't increment the unread messages counter
// <composing> state
this.chatboxes.onMessage($msg({
from: contact_jid,
to: this.connection.jid,
type: 'chat',
id: (new Date()).getTime()
}).c('composing', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree());
expect(this.minimized_chats.toggleview.$('.unread-message-count').text()).toBe((i).toString());
// <paused> state
this.chatboxes.onMessage($msg({
from: contact_jid,
to: this.connection.jid,
type: 'chat',
id: (new Date()).getTime()
}).c('paused', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree());
expect(this.minimized_chats.toggleview.$('.unread-message-count').text()).toBe((i).toString());
// <gone> state
this.chatboxes.onMessage($msg({
from: contact_jid,
to: this.connection.jid,
type: 'chat',
id: (new Date()).getTime()
}).c('gone', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree());
expect(this.minimized_chats.toggleview.$('.unread-message-count').text()).toBe((i).toString());
// <inactive> state
this.chatboxes.onMessage($msg({
from: contact_jid,
to: this.connection.jid,
type: 'chat',
id: (new Date()).getTime()
}).c('inactive', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree());
expect(this.minimized_chats.toggleview.$('.unread-message-count').text()).toBe((i).toString());
}, converse));
}, converse, mock, test_utils));
......
(function (root, factory) {
define([
"jquery",
"mock",
"test_utils"
], function ($, mock, test_utils) {
return factory($, mock, test_utils);
}
);
} (this, function ($, mock, test_utils) {
describe("Profiling", function() {
beforeEach(function() {
converse.connection.roster.items = [];
converse.connection._changeConnectStatus(Strophe.Status.CONNECTED);
});
xit("adds hundreds of contacts to the roster", $.proxy(function() {
converse.roster_groups = false;
spyOn(this.roster, 'clearCache').andCallThrough();
expect(this.roster.pluck('jid').length).toBe(0);
var stanza = $iq({
to: this.connection.jid,
type: 'result',
id: 'roster_1'
}).c('query', {
xmlns: 'jabber:iq:roster'
});
_.each(['Friends', 'Colleagues', 'Family', 'Acquaintances'], function (group) {
var i;
for (i=0; i<100; i++) {
stanza = stanza.c('item', {
jid: Math.random().toString().replace('0.', '')+'@example.net',
subscription:'both'
}).c('group').t(group).up().up();
}
});
this.connection.roster._onReceiveRosterSuccess(null, stanza.tree());
expect(this.roster.clearCache).toHaveBeenCalled();
expect(this.roster.pluck('jid').length).toBe(400);
}, converse));
xit("adds hundreds of contacts to the roster, with roster groups", $.proxy(function() {
// converse.show_only_online_users = true;
converse.roster_groups = true;
spyOn(this.roster, 'clearCache').andCallThrough();
expect(this.roster.pluck('jid').length).toBe(0);
var stanza = $iq({
to: this.connection.jid,
type: 'result',
id: 'roster_1'
}).c('query', {
xmlns: 'jabber:iq:roster'
});
_.each(['Friends', 'Colleagues', 'Family', 'Acquaintances'], function (group) {
var i;
for (i=0; i<100; i++) {
stanza = stanza.c('item', {
jid: Math.random().toString().replace('0.', '')+'@example.net',
subscription:'both'
}).c('group').t(group).up().up();
}
});
this.connection.roster._onReceiveRosterSuccess(null, stanza.tree());
expect(this.roster.clearCache).toHaveBeenCalled();
//expect(this.roster.pluck('jid').length).toBe(400);
}, converse));
it("contacts in a very large roster change their statuses", $.proxy(function() {
}, converse));
});
}));
({
baseUrl: "../",
name: "components/almond/almond.js",
out: "../builds/converse.nojquery.min.js",
include: ['main'],
mainConfigFile: '../main.js',
paths: {
"converse-dependencies": "src/deps-full",
"jquery": "src/jquery-external",
"jquery-private": "src/jquery-private-external",
}
})
......@@ -3,93 +3,9 @@
name: "components/almond/almond.js",
out: "../builds/converse-no-locales-no-otr.min.js",
include: ['main'],
tpl: {
// Use Mustache style syntax for variable interpolation
templateSettings: {
evaluate : /\{\[([\s\S]+?)\]\}/g,
interpolate : /\{\{([\s\S]+?)\}\}/g
}
},
map: {
// '*' means all modules will get 'jquery-private'
// for their 'jquery' dependency.
'*': { 'jquery': 'jquery-private' },
// 'jquery-private' wants the real jQuery module
// though. If this line was not here, there would
// be an unresolvable cyclic dependency.
'jquery-private': { 'jquery': 'jquery' }
},
mainConfigFile: '../main.js',
paths: {
"backbone": "components/backbone/backbone",
"backbone.browserStorage": "components/backbone.browserStorage/backbone.browserStorage",
"backbone.overview": "components/backbone.overview/backbone.overview",
"bootstrap": "components/bootstrap/dist/js/bootstrap", // XXX: Only required for https://conversejs.org website
"converse-dependencies": "src/deps-no-otr",
"converse-templates": "src/templates",
"eventemitter": "components/otr/build/dep/eventemitter",
"jquery": "components/jquery/dist/jquery",
"jquery-private": "src/jquery-private",
"jquery.browser": "components/jquery.browser/index",
"jquery.easing": "components/jquery-easing-original/index", // XXX: Only required for https://conversejs.org website
"moment": "components/momentjs/moment",
"strophe": "components/strophe/strophe",
"strophe.disco": "components/strophe.disco/index",
"strophe.muc": "components/strophe.muc/index",
"strophe.roster": "components/strophe.roster/index",
"strophe.vcard": "components/strophe.vcard/index",
"text": 'components/requirejs-text/text',
"tpl": 'components/requirejs-tpl-jcbrand/tpl',
"typeahead": "components/typeahead.js/index",
"underscore": "components/underscore/underscore",
"utils": "src/utils",
// Locales paths
"locales": "locale/nolocales",
"jed": "components/jed/jed",
// Templates
"action": "src/templates/action",
"add_contact_dropdown": "src/templates/add_contact_dropdown",
"add_contact_form": "src/templates/add_contact_form",
"change_status_message": "src/templates/change_status_message",
"chat_status": "src/templates/chat_status",
"chatarea": "src/templates/chatarea",
"chatbox": "src/templates/chatbox",
"chatroom": "src/templates/chatroom",
"chatroom_password_form": "src/templates/chatroom_password_form",
"chatroom_sidebar": "src/templates/chatroom_sidebar",
"chatrooms_tab": "src/templates/chatrooms_tab",
"chats_panel": "src/templates/chats_panel",
"choose_status": "src/templates/choose_status",
"contacts_panel": "src/templates/contacts_panel",
"contacts_tab": "src/templates/contacts_tab",
"controlbox": "src/templates/controlbox",
"controlbox_toggle": "src/templates/controlbox_toggle",
"field": "src/templates/field",
"form_checkbox": "src/templates/form_checkbox",
"form_input": "src/templates/form_input",
"form_select": "src/templates/form_select",
"group_header": "src/templates/group_header",
"info": "src/templates/info",
"login_panel": "src/templates/login_panel",
"login_tab": "src/templates/login_tab",
"message": "src/templates/message",
"new_day": "src/templates/new_day",
"occupant": "src/templates/occupant",
"pending_contact": "src/templates/pending_contact",
"pending_contacts": "src/templates/pending_contacts",
"requesting_contact": "src/templates/requesting_contact",
"requesting_contacts": "src/templates/requesting_contacts",
"room_description": "src/templates/room_description",
"room_item": "src/templates/room_item",
"room_panel": "src/templates/room_panel",
"roster": "src/templates/roster",
"roster_item": "src/templates/roster_item",
"search_contact": "src/templates/search_contact",
"select_option": "src/templates/select_option",
"status_option": "src/templates/status_option",
"toggle_chats": "src/templates/toggle_chats",
"toolbar": "src/templates/toolbar",
"trimmed_chat": "src/templates/trimmed_chat"
"locales": "locale/nolocales"
}
})
......@@ -3,105 +3,8 @@
name: "components/almond/almond.js",
out: "../builds/converse-no-otr.min.js",
include: ['main'],
tpl: {
// Use Mustache style syntax for variable interpolation
templateSettings: {
evaluate : /\{\[([\s\S]+?)\]\}/g,
interpolate : /\{\{([\s\S]+?)\}\}/g
}
},
map: {
// '*' means all modules will get 'jquery-private'
// for their 'jquery' dependency.
'*': { 'jquery': 'jquery-private' },
// 'jquery-private' wants the real jQuery module
// though. If this line was not here, there would
// be an unresolvable cyclic dependency.
'jquery-private': { 'jquery': 'jquery' }
},
mainConfigFile: '../main.js',
paths: {
"backbone": "components/backbone/backbone",
"backbone.browserStorage": "components/backbone.browserStorage/backbone.browserStorage",
"backbone.overview": "components/backbone.overview/backbone.overview",
"converse-dependencies": "src/deps-no-otr",
"converse-templates": "src/templates",
"eventemitter": "components/otr/build/dep/eventemitter",
"jquery": "components/jquery/dist/jquery",
"jquery-private": "src/jquery-private",
"jquery.browser": "components/jquery.browser/index",
"moment": "components/momentjs/moment",
"strophe": "components/strophe/strophe",
"strophe.disco": "components/strophe.disco/index",
"strophe.muc": "components/strophe.muc/index",
"strophe.roster": "components/strophe.roster/index",
"strophe.vcard": "components/strophe.vcard/index",
"text": 'components/requirejs-text/text',
"tpl": 'components/requirejs-tpl-jcbrand/tpl',
"typeahead": "components/typeahead.js/index",
"underscore": "components/underscore/underscore",
"utils": "src/utils",
// Locales paths
"locales": "locale/locales",
"jed": "components/jed/jed",
"af": "locale/af/LC_MESSAGES/af",
"de": "locale/de/LC_MESSAGES/de",
"en": "locale/en/LC_MESSAGES/en",
"es": "locale/es/LC_MESSAGES/es",
"fr": "locale/fr/LC_MESSAGES/fr",
"he": "locale/he/LC_MESSAGES/he",
"hu": "locale/hu/LC_MESSAGES/hu",
"id": "locale/id/LC_MESSAGES/id",
"it": "locale/it/LC_MESSAGES/it",
"ja": "locale/ja/LC_MESSAGES/ja",
"nl": "locale/nl/LC_MESSAGES/nl",
"pt_BR": "locale/pt_BR/LC_MESSAGES/pt_BR",
"ru": "locale/ru/LC_MESSAGES/ru",
"zh": "locale/zh/LC_MESSAGES/zh",
// Templates
"action": "src/templates/action",
"add_contact_dropdown": "src/templates/add_contact_dropdown",
"add_contact_form": "src/templates/add_contact_form",
"change_status_message": "src/templates/change_status_message",
"chat_status": "src/templates/chat_status",
"chatarea": "src/templates/chatarea",
"chatbox": "src/templates/chatbox",
"chatroom": "src/templates/chatroom",
"chatroom_password_form": "src/templates/chatroom_password_form",
"chatroom_sidebar": "src/templates/chatroom_sidebar",
"chatrooms_tab": "src/templates/chatrooms_tab",
"chats_panel": "src/templates/chats_panel",
"choose_status": "src/templates/choose_status",
"contacts_panel": "src/templates/contacts_panel",
"contacts_tab": "src/templates/contacts_tab",
"controlbox": "src/templates/controlbox",
"controlbox_toggle": "src/templates/controlbox_toggle",
"field": "src/templates/field",
"form_checkbox": "src/templates/form_checkbox",
"form_input": "src/templates/form_input",
"form_select": "src/templates/form_select",
"group_header": "src/templates/group_header",
"info": "src/templates/info",
"login_panel": "src/templates/login_panel",
"login_tab": "src/templates/login_tab",
"message": "src/templates/message",
"new_day": "src/templates/new_day",
"occupant": "src/templates/occupant",
"pending_contact": "src/templates/pending_contact",
"pending_contacts": "src/templates/pending_contacts",
"requesting_contact": "src/templates/requesting_contact",
"requesting_contacts": "src/templates/requesting_contacts",
"room_description": "src/templates/room_description",
"room_item": "src/templates/room_item",
"room_panel": "src/templates/room_panel",
"roster": "src/templates/roster",
"roster_item": "src/templates/roster_item",
"search_contact": "src/templates/search_contact",
"select_option": "src/templates/select_option",
"status_option": "src/templates/status_option",
"toggle_chats": "src/templates/toggle_chats",
"toolbar": "src/templates/toolbar",
"trimmed_chat": "src/templates/trimmed_chat"
"converse-dependencies": "src/deps-no-otr"
}
})
......@@ -3,107 +3,8 @@
name: "components/almond/almond.js",
out: "../builds/converse.website-no-otr.min.js",
include: ['main'],
tpl: {
// Use Mustache style syntax for variable interpolation
templateSettings: {
evaluate : /\{\[([\s\S]+?)\]\}/g,
interpolate : /\{\{([\s\S]+?)\}\}/g
}
},
map: {
// '*' means all modules will get 'jquery-private'
// for their 'jquery' dependency.
'*': { 'jquery': 'jquery-private' },
// 'jquery-private' wants the real jQuery module
// though. If this line was not here, there would
// be an unresolvable cyclic dependency.
'jquery-private': { 'jquery': 'jquery' }
},
mainConfigFile: '../main.js',
paths: {
"backbone": "components/backbone/backbone",
"backbone.browserStorage": "components/backbone.browserStorage/backbone.browserStorage",
"backbone.overview": "components/backbone.overview/backbone.overview",
"bootstrapJS": "components/bootstrapJS/index", // XXX: Only required for https://conversejs.org website
"converse-dependencies": "src/deps-website-no-otr",
"converse-templates": "src/templates",
"eventemitter": "components/otr/build/dep/eventemitter",
"jquery": "components/jquery/dist/jquery",
"jquery-private": "src/jquery-private",
"jquery.browser": "components/jquery.browser/index",
"jquery.easing": "components/jquery-easing-original/index", // XXX: Only required for https://conversejs.org website
"moment": "components/momentjs/moment",
"strophe": "components/strophe/strophe",
"strophe.disco": "components/strophe.disco/index",
"strophe.muc": "components/strophe.muc/index",
"strophe.roster": "components/strophe.roster/index",
"strophe.vcard": "components/strophe.vcard/index",
"text": 'components/requirejs-text/text',
"tpl": 'components/requirejs-tpl-jcbrand/tpl',
"typeahead": "components/typeahead.js/index",
"underscore": "components/underscore/underscore",
"utils": "src/utils",
// Locales paths
"locales": "locale/locales",
"jed": "components/jed/jed",
"af": "locale/af/LC_MESSAGES/af",
"de": "locale/de/LC_MESSAGES/de",
"en": "locale/en/LC_MESSAGES/en",
"es": "locale/es/LC_MESSAGES/es",
"fr": "locale/fr/LC_MESSAGES/fr",
"he": "locale/he/LC_MESSAGES/he",
"hu": "locale/hu/LC_MESSAGES/hu",
"id": "locale/id/LC_MESSAGES/id",
"it": "locale/it/LC_MESSAGES/it",
"ja": "locale/ja/LC_MESSAGES/ja",
"nl": "locale/nl/LC_MESSAGES/nl",
"pt_BR": "locale/pt_BR/LC_MESSAGES/pt_BR",
"ru": "locale/ru/LC_MESSAGES/ru",
"zh": "locale/zh/LC_MESSAGES/zh",
// Templates
"action": "src/templates/action",
"add_contact_dropdown": "src/templates/add_contact_dropdown",
"add_contact_form": "src/templates/add_contact_form",
"change_status_message": "src/templates/change_status_message",
"chat_status": "src/templates/chat_status",
"chatarea": "src/templates/chatarea",
"chatbox": "src/templates/chatbox",
"chatroom": "src/templates/chatroom",
"chatroom_password_form": "src/templates/chatroom_password_form",
"chatroom_sidebar": "src/templates/chatroom_sidebar",
"chatrooms_tab": "src/templates/chatrooms_tab",
"chats_panel": "src/templates/chats_panel",
"choose_status": "src/templates/choose_status",
"contacts_panel": "src/templates/contacts_panel",
"contacts_tab": "src/templates/contacts_tab",
"controlbox": "src/templates/controlbox",
"controlbox_toggle": "src/templates/controlbox_toggle",
"field": "src/templates/field",
"form_checkbox": "src/templates/form_checkbox",
"form_input": "src/templates/form_input",
"form_select": "src/templates/form_select",
"group_header": "src/templates/group_header",
"info": "src/templates/info",
"login_panel": "src/templates/login_panel",
"login_tab": "src/templates/login_tab",
"message": "src/templates/message",
"new_day": "src/templates/new_day",
"occupant": "src/templates/occupant",
"pending_contact": "src/templates/pending_contact",
"pending_contacts": "src/templates/pending_contacts",
"requesting_contact": "src/templates/requesting_contact",
"requesting_contacts": "src/templates/requesting_contacts",
"room_description": "src/templates/room_description",
"room_item": "src/templates/room_item",
"room_panel": "src/templates/room_panel",
"roster": "src/templates/roster",
"roster_item": "src/templates/roster_item",
"search_contact": "src/templates/search_contact",
"select_option": "src/templates/select_option",
"status_option": "src/templates/status_option",
"toggle_chats": "src/templates/toggle_chats",
"toolbar": "src/templates/toolbar",
"trimmed_chat": "src/templates/trimmed_chat"
"converse-dependencies": "src/deps-website-no-otr"
}
})
......@@ -3,124 +3,8 @@
name: "components/almond/almond.js",
out: "../builds/converse.website.min.js",
include: ['main'],
tpl: {
// Use Mustache style syntax for variable interpolation
templateSettings: {
evaluate : /\{\[([\s\S]+?)\]\}/g,
interpolate : /\{\{([\s\S]+?)\}\}/g
}
},
map: {
// '*' means all modules will get 'jquery-private'
// for their 'jquery' dependency.
'*': { 'jquery': 'jquery-private' },
// 'jquery-private' wants the real jQuery module
// though. If this line was not here, there would
// be an unresolvable cyclic dependency.
'jquery-private': { 'jquery': 'jquery' }
},
mainConfigFile: '../main.js',
paths: {
"backbone": "components/backbone/backbone",
"backbone.browserStorage": "components/backbone.browserStorage/backbone.browserStorage",
"backbone.overview": "components/backbone.overview/backbone.overview",
"bootstrapJS": "components/bootstrapJS/index", // XXX: Only required for https://conversejs.org website
"converse-dependencies": "src/deps-website",
"converse-templates": "src/templates",
"eventemitter": "components/otr/build/dep/eventemitter",
"jquery": "components/jquery/dist/jquery",
"jquery-private": "src/jquery-private",
"jquery.browser": "components/jquery.browser/index",
"jquery.easing": "components/jquery-easing-original/index", // XXX: Only required for https://conversejs.org website
"moment": "components/momentjs/moment",
"strophe": "components/strophe/strophe",
"strophe.disco": "components/strophe.disco/index",
"strophe.muc": "components/strophe.muc/index",
"strophe.roster": "components/strophe.roster/index",
"strophe.vcard": "components/strophe.vcard/index",
"text": 'components/requirejs-text/text',
"tpl": 'components/requirejs-tpl-jcbrand/tpl',
"typeahead": "components/typeahead.js/index",
"underscore": "components/underscore/underscore",
"utils": "src/utils",
// Off-the-record-encryption
"bigint": "src/bigint",
"crypto": "src/crypto",
"crypto.aes": "components/otr/vendor/cryptojs/aes",
"crypto.cipher-core": "components/otr/vendor/cryptojs/cipher-core",
"crypto.core": "components/otr/vendor/cryptojs/core",
"crypto.enc-base64": "components/otr/vendor/cryptojs/enc-base64",
"crypto.evpkdf": "components/crypto-js-evanvosberg/src/evpkdf",
"crypto.hmac": "components/otr/vendor/cryptojs/hmac",
"crypto.md5": "components/crypto-js-evanvosberg/src/md5",
"crypto.mode-ctr": "components/otr/vendor/cryptojs/mode-ctr",
"crypto.pad-nopadding": "components/otr/vendor/cryptojs/pad-nopadding",
"crypto.sha1": "components/otr/vendor/cryptojs/sha1",
"crypto.sha256": "components/otr/vendor/cryptojs/sha256",
"salsa20": "components/otr/build/dep/salsa20",
"otr": "src/otr",
// Locales paths
"locales": "locale/locales",
"jed": "components/jed/jed",
"af": "locale/af/LC_MESSAGES/af",
"de": "locale/de/LC_MESSAGES/de",
"en": "locale/en/LC_MESSAGES/en",
"es": "locale/es/LC_MESSAGES/es",
"fr": "locale/fr/LC_MESSAGES/fr",
"he": "locale/he/LC_MESSAGES/he",
"hu": "locale/hu/LC_MESSAGES/hu",
"id": "locale/id/LC_MESSAGES/id",
"it": "locale/it/LC_MESSAGES/it",
"ja": "locale/ja/LC_MESSAGES/ja",
"nl": "locale/nl/LC_MESSAGES/nl",
"pt_BR": "locale/pt_BR/LC_MESSAGES/pt_BR",
"ru": "locale/ru/LC_MESSAGES/ru",
"zh": "locale/zh/LC_MESSAGES/zh",
// Templates
"action": "src/templates/action",
"add_contact_dropdown": "src/templates/add_contact_dropdown",
"add_contact_form": "src/templates/add_contact_form",
"change_status_message": "src/templates/change_status_message",
"chat_status": "src/templates/chat_status",
"chatarea": "src/templates/chatarea",
"chatbox": "src/templates/chatbox",
"chatroom": "src/templates/chatroom",
"chatroom_password_form": "src/templates/chatroom_password_form",
"chatroom_sidebar": "src/templates/chatroom_sidebar",
"chatrooms_tab": "src/templates/chatrooms_tab",
"chats_panel": "src/templates/chats_panel",
"choose_status": "src/templates/choose_status",
"contacts_panel": "src/templates/contacts_panel",
"contacts_tab": "src/templates/contacts_tab",
"controlbox": "src/templates/controlbox",
"controlbox_toggle": "src/templates/controlbox_toggle",
"field": "src/templates/field",
"form_checkbox": "src/templates/form_checkbox",
"form_input": "src/templates/form_input",
"form_select": "src/templates/form_select",
"group_header": "src/templates/group_header",
"info": "src/templates/info",
"login_panel": "src/templates/login_panel",
"login_tab": "src/templates/login_tab",
"message": "src/templates/message",
"new_day": "src/templates/new_day",
"occupant": "src/templates/occupant",
"pending_contact": "src/templates/pending_contact",
"pending_contacts": "src/templates/pending_contacts",
"requesting_contact": "src/templates/requesting_contact",
"requesting_contacts": "src/templates/requesting_contacts",
"room_description": "src/templates/room_description",
"room_item": "src/templates/room_item",
"room_panel": "src/templates/room_panel",
"roster": "src/templates/roster",
"roster_item": "src/templates/roster_item",
"search_contact": "src/templates/search_contact",
"select_option": "src/templates/select_option",
"status_option": "src/templates/status_option",
"toggle_chats": "src/templates/toggle_chats",
"toolbar": "src/templates/toolbar",
"trimmed_chat": "src/templates/trimmed_chat"
"converse-dependencies": "src/deps-website"
}
})
......@@ -3,122 +3,8 @@
name: "components/almond/almond.js",
out: "../builds/converse.min.js",
include: ['main'],
tpl: {
// Use Mustache style syntax for variable interpolation
templateSettings: {
evaluate : /\{\[([\s\S]+?)\]\}/g,
interpolate : /\{\{([\s\S]+?)\}\}/g
}
},
map: {
// '*' means all modules will get 'jquery-private'
// for their 'jquery' dependency.
'*': { 'jquery': 'jquery-private' },
// 'jquery-private' wants the real jQuery module
// though. If this line was not here, there would
// be an unresolvable cyclic dependency.
'jquery-private': { 'jquery': 'jquery' }
},
mainConfigFile: '../main.js',
paths: {
"backbone": "components/backbone/backbone",
"backbone.browserStorage": "components/backbone.browserStorage/backbone.browserStorage",
"backbone.overview": "components/backbone.overview/backbone.overview",
"converse-dependencies": "src/deps-full",
"converse-templates": "src/templates",
"eventemitter": "components/otr/build/dep/eventemitter",
"jquery": "components/jquery/dist/jquery",
"jquery-private": "src/jquery-private",
"jquery.browser": "components/jquery.browser/index",
"moment": "components/momentjs/moment",
"strophe": "components/strophe/strophe",
"strophe.disco": "components/strophe.disco/index",
"strophe.muc": "components/strophe.muc/index",
"strophe.roster": "components/strophe.roster/index",
"strophe.vcard": "components/strophe.vcard/index",
"text": 'components/requirejs-text/text',
"tpl": 'components/requirejs-tpl-jcbrand/tpl',
"typeahead": "components/typeahead.js/index",
"underscore": "components/underscore/underscore",
"utils": "src/utils",
// Off-the-record-encryption
"bigint": "src/bigint",
"crypto": "src/crypto",
"crypto.aes": "components/otr/vendor/cryptojs/aes",
"crypto.cipher-core": "components/otr/vendor/cryptojs/cipher-core",
"crypto.core": "components/otr/vendor/cryptojs/core",
"crypto.enc-base64": "components/otr/vendor/cryptojs/enc-base64",
"crypto.evpkdf": "components/crypto-js-evanvosberg/src/evpkdf",
"crypto.hmac": "components/otr/vendor/cryptojs/hmac",
"crypto.md5": "components/crypto-js-evanvosberg/src/md5",
"crypto.mode-ctr": "components/otr/vendor/cryptojs/mode-ctr",
"crypto.pad-nopadding": "components/otr/vendor/cryptojs/pad-nopadding",
"crypto.sha1": "components/otr/vendor/cryptojs/sha1",
"crypto.sha256": "components/otr/vendor/cryptojs/sha256",
"salsa20": "components/otr/build/dep/salsa20",
"otr": "src/otr",
// Locales paths
"locales": "locale/locales",
"jed": "components/jed/jed",
"af": "locale/af/LC_MESSAGES/af",
"de": "locale/de/LC_MESSAGES/de",
"en": "locale/en/LC_MESSAGES/en",
"es": "locale/es/LC_MESSAGES/es",
"fr": "locale/fr/LC_MESSAGES/fr",
"he": "locale/he/LC_MESSAGES/he",
"hu": "locale/hu/LC_MESSAGES/hu",
"id": "locale/id/LC_MESSAGES/id",
"it": "locale/it/LC_MESSAGES/it",
"ja": "locale/ja/LC_MESSAGES/ja",
"nl": "locale/nl/LC_MESSAGES/nl",
"pt_BR": "locale/pt_BR/LC_MESSAGES/pt_BR",
"ru": "locale/ru/LC_MESSAGES/ru",
"zh": "locale/zh/LC_MESSAGES/zh",
// Templates
"action": "src/templates/action",
"add_contact_dropdown": "src/templates/add_contact_dropdown",
"add_contact_form": "src/templates/add_contact_form",
"change_status_message": "src/templates/change_status_message",
"chat_status": "src/templates/chat_status",
"chatarea": "src/templates/chatarea",
"chatbox": "src/templates/chatbox",
"chatroom": "src/templates/chatroom",
"chatroom_password_form": "src/templates/chatroom_password_form",
"chatroom_sidebar": "src/templates/chatroom_sidebar",
"chatrooms_tab": "src/templates/chatrooms_tab",
"chats_panel": "src/templates/chats_panel",
"choose_status": "src/templates/choose_status",
"contacts_panel": "src/templates/contacts_panel",
"contacts_tab": "src/templates/contacts_tab",
"controlbox": "src/templates/controlbox",
"controlbox_toggle": "src/templates/controlbox_toggle",
"field": "src/templates/field",
"form_checkbox": "src/templates/form_checkbox",
"form_input": "src/templates/form_input",
"form_select": "src/templates/form_select",
"group_header": "src/templates/group_header",
"info": "src/templates/info",
"login_panel": "src/templates/login_panel",
"login_tab": "src/templates/login_tab",
"message": "src/templates/message",
"new_day": "src/templates/new_day",
"occupant": "src/templates/occupant",
"pending_contact": "src/templates/pending_contact",
"pending_contacts": "src/templates/pending_contacts",
"requesting_contact": "src/templates/requesting_contact",
"requesting_contacts": "src/templates/requesting_contacts",
"room_description": "src/templates/room_description",
"room_item": "src/templates/room_item",
"room_panel": "src/templates/room_panel",
"roster": "src/templates/roster",
"roster_item": "src/templates/roster_item",
"search_contact": "src/templates/search_contact",
"select_option": "src/templates/select_option",
"status_option": "src/templates/status_option",
"toggle_chats": "src/templates/toggle_chats",
"toolbar": "src/templates/toolbar",
"trimmed_chat": "src/templates/trimmed_chat"
"converse-dependencies": "src/deps-full"
}
})
define('jquery', [], function () {
return jQuery;
});
define(['jquery'], function (jq) {
return jq;
});
This diff is collapsed.
<input class="roster-filter" placeholder="{{placeholder}}">
<select class="filter-type">
<input style="display: none;" class="roster-filter" placeholder="{{placeholder}}">
<select style="display: none;" class="filter-type">
<option value="contacts">{{label_contacts}}</option>
<option value="groups">{{label_groups}}</option>
</select>
<dl class="roster-contacts"></dl>
......@@ -30,7 +30,7 @@ define(["jquery"], function ($) {
var utils = {
// Translation machinery
// ---------------------
__: $.proxy(function (str) {
__: function (str) {
// Translation factory
if (this.i18n === undefined) {
this.i18n = locales.en;
......@@ -41,7 +41,7 @@ define(["jquery"], function ($) {
} else {
return t.fetch();
}
}, this),
},
___: function (str) {
/* XXX: This is part of a hack to get gettext to scan strings to be
......
config = {
baseUrl: '.',
paths: {
"backbone": "components/backbone/backbone",
"backbone.browserStorage": "components/backbone.browserStorage/backbone.browserStorage",
"backbone.overview": "components/backbone.overview/backbone.overview",
"bootstrap": "components/bootstrap/dist/js/bootstrap", // XXX: Only required for https://conversejs.org website
"bootstrapJS": "components/bootstrapJS/index", // XXX: Only required for https://conversejs.org website
"converse-dependencies": "src/deps-website",
"converse-templates": "src/templates",
"eventemitter": "components/otr/build/dep/eventemitter",
"jquery": "components/jquery/dist/jquery",
"jquery-private": "src/jquery-private",
"jquery.browser": "components/jquery.browser/index",
"jquery.easing": "components/jquery-easing-original/index", // XXX: Only required for https://conversejs.org website
"moment": "components/momentjs/moment",
"strophe": "components/strophe/strophe",
"strophe.disco": "components/strophejs-plugins/disco/strophe.disco",
"strophe.muc": "components/strophe.muc/index",
"strophe.roster": "src/strophe.roster",
"strophe.vcard": "components/strophejs-plugins/vcard/strophe.vcard",
"text": 'components/requirejs-text/text',
"tpl": 'components/requirejs-tpl-jcbrand/tpl',
"typeahead": "components/typeahead.js/index",
"underscore": "components/underscore/underscore",
"utils": "src/utils",
// Off-the-record-encryption
"bigint": "src/bigint",
"crypto": "src/crypto",
"crypto.aes": "components/otr/vendor/cryptojs/aes",
"crypto.cipher-core": "components/otr/vendor/cryptojs/cipher-core",
"crypto.core": "components/otr/vendor/cryptojs/core",
"crypto.enc-base64": "components/otr/vendor/cryptojs/enc-base64",
"crypto.evpkdf": "components/crypto-js-evanvosberg/src/evpkdf",
"crypto.hmac": "components/otr/vendor/cryptojs/hmac",
"crypto.md5": "components/crypto-js-evanvosberg/src/md5",
"crypto.mode-ctr": "components/otr/vendor/cryptojs/mode-ctr",
"crypto.pad-nopadding": "components/otr/vendor/cryptojs/pad-nopadding",
"crypto.sha1": "components/otr/vendor/cryptojs/sha1",
"crypto.sha256": "components/otr/vendor/cryptojs/sha256",
"salsa20": "components/otr/build/dep/salsa20",
"otr": "src/otr",
// Locales paths
"locales": "locale/locales",
"jed": "components/jed/jed",
"af": "locale/af/LC_MESSAGES/af",
"de": "locale/de/LC_MESSAGES/de",
"en": "locale/en/LC_MESSAGES/en",
"es": "locale/es/LC_MESSAGES/es",
"fr": "locale/fr/LC_MESSAGES/fr",
"he": "locale/he/LC_MESSAGES/he",
"hu": "locale/hu/LC_MESSAGES/hu",
"id": "locale/id/LC_MESSAGES/id",
"it": "locale/it/LC_MESSAGES/it",
"ja": "locale/ja/LC_MESSAGES/ja",
"nl": "locale/nl/LC_MESSAGES/nl",
"pt_BR": "locale/pt_BR/LC_MESSAGES/pt_BR",
"ru": "locale/ru/LC_MESSAGES/ru",
"zh": "locale/zh/LC_MESSAGES/zh",
// Templates
"action": "src/templates/action",
"add_contact_dropdown": "src/templates/add_contact_dropdown",
"add_contact_form": "src/templates/add_contact_form",
"change_status_message": "src/templates/change_status_message",
"chat_status": "src/templates/chat_status",
"chatarea": "src/templates/chatarea",
"chatbox": "src/templates/chatbox",
"chatroom": "src/templates/chatroom",
"chatroom_password_form": "src/templates/chatroom_password_form",
"chatroom_sidebar": "src/templates/chatroom_sidebar",
"chatrooms_tab": "src/templates/chatrooms_tab",
"chats_panel": "src/templates/chats_panel",
"choose_status": "src/templates/choose_status",
"contacts_panel": "src/templates/contacts_panel",
"contacts_tab": "src/templates/contacts_tab",
"controlbox": "src/templates/controlbox",
"controlbox_toggle": "src/templates/controlbox_toggle",
"field": "src/templates/field",
"form_checkbox": "src/templates/form_checkbox",
"form_input": "src/templates/form_input",
"form_select": "src/templates/form_select",
"group_header": "src/templates/group_header",
"info": "src/templates/info",
"login_panel": "src/templates/login_panel",
"login_tab": "src/templates/login_tab",
"message": "src/templates/message",
"new_day": "src/templates/new_day",
"occupant": "src/templates/occupant",
"pending_contact": "src/templates/pending_contact",
"pending_contacts": "src/templates/pending_contacts",
"requesting_contact": "src/templates/requesting_contact",
"requesting_contacts": "src/templates/requesting_contacts",
"room_description": "src/templates/room_description",
"room_item": "src/templates/room_item",
"room_panel": "src/templates/room_panel",
"roster": "src/templates/roster",
"roster_item": "src/templates/roster_item",
"search_contact": "src/templates/search_contact",
"select_option": "src/templates/select_option",
"status_option": "src/templates/status_option",
"toggle_chats": "src/templates/toggle_chats",
"toolbar": "src/templates/toolbar",
"trimmed_chat": "src/templates/trimmed_chat"
},
map: {
// '*' means all modules will get 'jquery-private'
// for their 'jquery' dependency.
'*': { 'jquery': 'jquery-private' },
// 'jquery-private' wants the real jQuery module
// though. If this line was not here, there would
// be an unresolvable cyclic dependency.
'jquery-private': { 'jquery': 'jquery' }
},
tpl: {
// Configuration for requirejs-tpl
// Use Mustache style syntax for variable interpolation
templateSettings: {
evaluate : /\{\[([\s\S]+?)\]\}/g,
interpolate : /\{\{([\s\S]+?)\}\}/g
}
},
// define module dependencies for modules not using define
shim: {
'underscore': { exports: '_' },
'crypto.aes': { deps: ['crypto.cipher-core'] },
'crypto.cipher-core': { deps: ['crypto.enc-base64', 'crypto.evpkdf'] },
'crypto.enc-base64': { deps: ['crypto.core'] },
'crypto.evpkdf': { deps: ['crypto.md5'] },
'crypto.hmac': { deps: ['crypto.core'] },
'crypto.md5': { deps: ['crypto.core'] },
'crypto.mode-ctr': { deps: ['crypto.cipher-core'] },
'crypto.pad-nopadding': { deps: ['crypto.cipher-core'] },
'crypto.sha1': { deps: ['crypto.core'] },
'crypto.sha256': { deps: ['crypto.core'] },
'bigint': { deps: ['crypto'] },
'strophe': { exports: 'Strophe' },
'strophe.disco': { deps: ['strophe'] },
'strophe.muc': { deps: ['strophe'] },
'strophe.roster': { deps: ['strophe'] },
'strophe.vcard': { deps: ['strophe'] }
}
};
// Extra test dependencies
config.paths.mock = "tests/mock";
config.paths.test_utils = "tests/utils";
......@@ -40,8 +189,6 @@ require([
window.converse_api = converse;
window.localStorage.clear();
window.sessionStorage.clear();
// XXX: call this to initialize Strophe plugins
new Strophe.Connection('localhost');
converse.initialize({
prebind: false,
......@@ -49,7 +196,8 @@ require([
auto_subscribe: false,
animate: false,
connection: mock.mock_connection,
no_trimming: true
no_trimming: true,
debug: true
}, function (converse) {
window.converse = converse;
window.crypto = {
......@@ -68,7 +216,8 @@ require([
"spec/controlbox",
"spec/chatbox",
"spec/chatroom",
"spec/minchats"
"spec/minchats",
"spec/profiling"
], function () {
// Make sure this callback is only called once.
delete converse.callback;
......
......@@ -36,11 +36,37 @@
'preventDefault': function () {}
};
mock.mock_connection = {
'_proto': {},
'connected': true,
'authenticated': true,
'mock': true,
mock.mock_connection = function () {
Strophe.Bosh.prototype._processRequest = function () {}; // Don't attempt to send out stanzas
var c = new Strophe.Connection('jasmine tests');
c.authenticated = true;
c.connected = true;
c.mock = true;
c.jid = 'dummy@localhost/resource';
c.vcard = {
'get': function (callback, jid) {
var fullname;
if (!jid) {
jid = 'dummy@localhost';
fullname = 'Max Mustermann' ;
} else {
var name = jid.split('@')[0].replace(/\./g, ' ').split(' ');
var last = name.length-1;
name[0] = name[0].charAt(0).toUpperCase()+name[0].slice(1);
name[last] = name[last].charAt(0).toUpperCase()+name[last].slice(1);
fullname = name.join(' ');
}
var vcard = $iq().c('vCard').c('FN').t(fullname);
callback(vcard.tree());
}
};
c._changeConnectStatus(Strophe.Status.CONNECTED);
c.attach(c.jid);
return c;
}();
/*
{
'muc': {
'listRooms': function () {},
'join': function () {},
......@@ -49,7 +75,6 @@
'groupchat': function () {return String((new Date()).getTime()); }
},
'service': 'jasmine tests',
'jid': 'dummy@localhost',
'addHandler': function (handler, ns, name, type, id, from, options) {
return function () {};
},
......@@ -87,5 +112,6 @@
'items': function () {}
}
};
*/
return mock;
}));
......@@ -9,6 +9,17 @@
}(this, function ($, mock) {
var utils = {};
utils.createRequest = function (iq) {
iq = typeof iq.tree == "function" ? iq.tree() : iq;
var req = new Strophe.Request(iq, function() {});
req.getResponse = function() {
var env = new Strophe.Builder('env', {type: 'mock'}).tree();
env.appendChild(iq);
return env;
};
return req;
};
utils.closeAllChatBoxes = function () {
var i, chatbox;
for (i=converse.chatboxes.models.length-1; i>-1; i--) {
......
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