Commit d2eff1d3 authored by JC Brand's avatar JC Brand

Merge branch 'master' into gh-pages

parents cf926fa4 20248313
Changelog
=========
0.6.1 (Unreleased)
0.6.1 (2013-08-28)
------------------
- IE9 and IE8 CSS fixes. [jcbrand]
- Bugfix. Pencil icon not visible (for setting status update). [jcbrand]
- Bugfix: Pencil icon not visible (for setting status update). [jcbrand]
- Bugfix: RID, JID and SID initialization values were being ignored. [jcbrand]
- Bugfix: Fall back to English if a non-existing locale was specified. [jcbrand]
0.6.0 (2013-08-26)
------------------
......
......@@ -35,7 +35,7 @@ help:
@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";
xgettext --keyword=__ --keyword=___ --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:
r.js -o build.js
......
{
"name": "converse",
"version": "0.6.0",
"version": "0.6.1",
"devDependencies": {
"jasmine": "https://github.com/jcbrand/jasmine.git#1_3_x"
},
......
......@@ -13,10 +13,10 @@
"es": "locale/es/LC_MESSAGES/es",
"it": "locale/it/LC_MESSAGES/it",
"pt_BR": "locale/pt_BR/LC_MESSAGES/pt_BR",
"tinysort": "components/tinysort/src/jquery.tinysort",
"jquery.tinysort": "components/tinysort/src/jquery.tinysort",
"underscore": "components/underscore/underscore",
"backbone": "components/backbone/backbone",
"localstorage": "components/backbone.localStorage/backbone.localStorage",
"backbone.localStorage": "components/backbone.localStorage/backbone.localStorage",
"strophe": "components/strophe/strophe",
"strophe.muc": "components/strophe.muc/index",
"strophe.roster": "components/strophe.roster/index",
......
......@@ -14,8 +14,8 @@
if (typeof define === 'function' && define.amd) {
define("converse", [
"locales",
"localstorage",
"tinysort",
"backbone.localStorage",
"jquery.tinysort",
"strophe",
"strophe.muc",
"strophe.roster",
......@@ -53,6 +53,7 @@
this.prebind = false;
this.show_controlbox_by_default = false;
this.xhr_user_search = false;
this.xhr_custom_status = false;
this.testing = false; // Exposes sensitive data for testing. Never set to true in production systems!
this.callback = callback || function () {};
......@@ -70,12 +71,21 @@
'prebind',
'show_controlbox_by_default',
'xhr_user_search',
'xhr_custom_status',
'connection',
'testing'
'testing',
'jid',
'sid',
'rid'
];
_.extend(this, _.pick(settings, whitelist));
var __ = $.proxy(function (str) {
/* Translation factory
*/
if (this.i18n === undefined) {
this.i18n = locales['en'];
}
var t = this.i18n.translate(str);
if (arguments.length>1) {
return t.fetch.apply(t, [].slice.call(arguments,1));
......@@ -83,6 +93,18 @@
return t.fetch();
}
}, this);
var ___ = function (str) {
/* XXX: This is part of a hack to get gettext to scan strings to be
* translated. Strings we cannot send to the function above because
* they require variable interpolation and we don't yet have the
* variables at scan time.
*
* See actionInfoMessages
*/
return str;
};
this.msg_counter = 0;
this.autoLink = function (text) {
// Convert URLs into hyperlinks
......@@ -1424,22 +1446,20 @@
},
actionInfoMessages: {
// # For translations: %1$s will be replaced with the user's nickname
// # Don't translate "strong"
// # Example: <strong>jcbrand</strong> has been banned
301: converse.i18n.translate('<strong>%1$s</strong> has been banned'),
// # For translations: %1$s will be replaced with the user's nickname
// # Don't translate "strong"
// # Example: <strong>jcbrand</strong> has been kicked out
307: converse.i18n.translate('<strong>%1$s</strong> has been kicked out'),
// # 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
321: converse.i18n.translate("<strong>%1$s</strong> has been removed because of an affiliation change"),
// # 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
322: converse.i18n.translate("<strong>%1$s</strong> has been removed for not being a member")
/* XXX: Note the triple underscore function and not double
* underscore.
*
* This is a hack. We can't pass the strings to __ because we
* don't yet know what the variable to interpolate is.
*
* Triple underscore will just return the string again, but we
* can then at least tell gettext to scan for it so that these
* strings are picked up by the translation machinery.
*/
301: ___("<strong>%1$s</strong> has been banned"),
307: ___("<strong>%1$s</strong> has been kicked out"),
321: ___("<strong>%1$s</strong> has been removed because of an affiliation change"),
322: ___("<strong>%1$s</strong> has been removed for not being a member")
},
disconnectMessages: {
......@@ -1471,9 +1491,8 @@
info_msgs.push(this.infoMessages[stat]);
} else if (_.contains(_.keys(this.actionInfoMessages), stat)) {
action_msgs.push(
this.actionInfoMessages[stat].fetch(
Strophe.unescapeNode(Strophe.getResourceFromJid($el.attr('from')))
));
__(this.actionInfoMessages[stat], Strophe.unescapeNode(Strophe.getResourceFromJid($el.attr('from'))))
);
}
}
}
......@@ -1826,8 +1845,9 @@
},
template: _.template(
'<a class="open-chat" title="'+__('Click to chat with this contact')+'" href="#">{{ fullname }}</a>' +
'<span class="icon-{{ chat_status }}" title="{{ status_desc }}"></span>'+
'<a class="open-chat" title="'+__('Click to chat with this contact')+'" href="#">'+
'<span class="icon-{{ chat_status }}" title="{{ status_desc }}"></span>{{ fullname }}'+
'</a>' +
'<a class="remove-xmpp-contact" title="'+__('Click to remove this contact')+'" href="#"></a>'),
pending_template: _.template(
......@@ -2348,6 +2368,13 @@
setStatusMessage: function (status_message) {
converse.connection.send($pres().c('show').t(this.get('status')).up().c('status').t(status_message));
this.save({'status_message': status_message});
if (this.xhr_custom_status) {
$.ajax({
url: 'set-custom-status',
type: 'POST',
data: {'msg': status_message}
});
}
}
});
......
This diff is collapsed.
......@@ -48,9 +48,9 @@ copyright = u'2013, JC Brand'
# built documents.
#
# The short X.Y version.
version = '0.6.0'
version = '0.6.1'
# The full version, including alpha/beta/rc tags.
release = '0.6.0'
release = '0.6.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -18,8 +18,8 @@
<h1 id="project_title"><a href="http://conversejs.org">Converse.js</a></h1>
<h2 id="project_tagline">An XMPP chat client for your website</h2>
<section id="downloads">
<a class="zip_download_link" href="https://github.com/jcbrand/converse.js/archive/v0.6.0.zip">Download the latest release as a .zip file</a>
<a class="tar_download_link" href="https://github.com/jcbrand/converse.js/archive/v0.6.0.tar.gz">Download the latest release as a tar.gz file</a>
<a class="zip_download_link" href="https://github.com/jcbrand/converse.js/archive/v0.6.1.zip">Download the latest release as a .zip file</a>
<a class="tar_download_link" href="https://github.com/jcbrand/converse.js/archive/v0.6.1.tar.gz">Download the latest release as a tar.gz file</a>
</section>
</header>
</div>
......@@ -35,18 +35,10 @@
<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 <a href="http://jabber.org">jabber.org</a>, or to one you have set up yourself.</p>
<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,
<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,
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.
</p>
<p>If you have integrated <em>Converse.js</em> into any other CMS or framework,
<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>
<ul>
<li>Single-user chat</li>
......@@ -61,7 +53,7 @@
<li>Custom status messages</li>
<li>Typing notifications</li>
<li>Third person messages (/me )</li>
<li>Translated into multiple languages (af, de, es, it, pt_BR)</li>
<li>Translated into multiple languages (af, de, es, it, pt-BR)</li>
</ul>
<h2>Screencasts</h2>
......@@ -74,6 +66,30 @@
</li>
</ul>
<h2>Integration into other frameworks</h2>
<ul>
<li><h4><a href="http://plone.org" target="_blank">Plone</a></h4>
<strong><a href="http://github.com/collective/collective.xmpp.chat" target="_blank">collective.xmpp.chat</a></strong>
is an add-on for Plone that uses <em>Converse.js</em>.
Together with <a href="http://github.com/collective/collective.xmpp.core" target="_blank">collective.xmpp.core</a>, it provides for single-signon-support (SSO)
and also enables you to manually or automatically
register your Plone users onto your XMPP server.
</li>
<li><h4><a href="http://www.djangoproject.com" target="_blank">Django</a></h4>
<strong><a href="https://pypi.python.org/pypi/django-conversejs" target="_blank">django-conversejs</a></strong> is an app that makes it easer to integrate <em>Converse.js</em>
into Django. It adds single-signon-support (SSO) support and a database model to store XMPP credentials.
</li>
<li><h4><a href="http://roundcube.net" target="_blank">Roundcube</a></h4>
<strong><a href="https://github.com/priyadi/roundcube-converse.js-xmpp-plugin" target="_blank">roundcube-converse.js-xmpp-plugin</a></strong>
is a plugin for Roundcube Webmail. It's README states that it's still a work in progress.
</li>
</ul>
<p>If you have integrated <em>Converse.js</em> into any other CMS or framework,
<a href="http://opkode.com/contact.html" target="_blank">please let me know</a> and I'll mention it on this page.</p>
<h2>Demo</h2>
<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><em><strong>Note:</strong> currently the demo doesn't work in Internet Explorer older
......@@ -83,9 +99,25 @@
See <a href="/docs/html/index.html#overcoming-cross-domain-request-restrictions" target="_blank">here</a> for more information.</p></em>
<h3>Is it secure?</h3>
<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.
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>
<p>
Yes, as long as you can trust that the Javascript being downloaded is
not being tampered with. This page itself is served by Github and is not SSL Encrypted (e.g. HTTPS).
I don't know how probable it is that Github served pages could be hacked to
insert malicious Javascript.
</p>
<p>
Ideally you'd want your site to be served via HTTPS, to make it more
difficult. In this case, use with caution.
</p>
<p>
<em>Converse.js</em> makes HTTP requests to a <em>connection manager</em>, which in this case has an
<a href="https://en.wikipedia.org/wiki/Secure_Sockets_Layer" target="_blank">SSL</a> encrypted connection to an XMPP server.</p>
The <em>connection manager</em> then uses SSL and <a href="https://en.wikipedia.org/wiki/Transport_Layer_Security">TLS</a> to connect to an XMPP server.
</p>
<p>
Logging in happens via <a href="https://en.wikipedia.org/wiki/Simple_Authentication_and_Security_Layer">SASL</a> and
<a href="https://en.wikipedia.org/wiki/Transport_Layer_Security">TLS</a>.
</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.
<h3>Session support</h3>
......@@ -127,11 +159,10 @@
and <a href="http://opensource.org/licenses/GPL-2.0" target="_blank">GPL</a> licenses.</p>
<h2>Contact</h2>
<p>You can follow me on <strong><a href="http://twitter.com/jcopkode" target="_blank">Twitter</a></strong> and <strong><a href="http://identi.ca/opkode" target="_blank">Identica</a></strong></p>
<p>You can follow me on <strong><a href="http://twitter.com/jcopkode" target="_blank">Twitter</a></strong></p>
<p>My XMPP username is <strong>jc@opkode.im</strong>.</p>
<p>Send me an email via this <a href="http://opkode.com/contact" target="_blank">contact form</a>.</p>
</section>
</div>
<!-- FOOTER -->
......@@ -163,11 +194,11 @@
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
i18n: locales['fr'], // Refer to ./locale/locales.js to see which locales are supported
prebind: false,
show_controlbox_by_default: true,
xhr_user_search: false,
debug: false
debug: true
});
});
</script>
......
This diff is collapsed.
/*
* This file can be used if no locale support is required.
*/
(function (root, factory) {
define("locales", ['jed'], function (Jed) {
var translations = {
"domain": "converse",
"locale_data": {
"converse": {
"": {
"domain": "converse",
"lang": "en",
"plural_forms": "nplurals=2; plural=(n != 1);"
}
}
}
};
root.locales = { 'en': new Jed(translations) };
});
})(this);
......@@ -2,10 +2,10 @@ require.config({
paths: {
"jquery": "components/jquery/jquery",
"locales": "locale/locales",
"tinysort": "components/tinysort/src/jquery.tinysort",
"jquery.tinysort": "components/tinysort/src/jquery.tinysort",
"underscore": "components/underscore/underscore",
"backbone": "components/backbone/backbone",
"localstorage": "components/backbone.localStorage/backbone.localStorage",
"backbone.localStorage": "components/backbone.localStorage/backbone.localStorage",
"strophe": "components/strophe/strophe",
"strophe.muc": "components/strophe.muc/index",
"strophe.roster": "components/strophe.roster/index",
......
......@@ -114,13 +114,13 @@
John Smit</a>
<a class="remove-xmpp-contact icon-remove" title="Click to remove this contact" href="#"></a>
</dd>
<dd class="dnd current-xmpp-contact">
<dd class="away current-xmpp-contact">
<a class="open-chat" title="Click to chat with this contact" href="#">
<span class="icon-away" title="this contact is away"></span>
Francois Pienaar</a>
<a class="remove-xmpp-contact icon-remove" title="Click to remove this contact" href="#"></a>
</dd>
<dd class="busy current-xmpp-contact">
<dd class="dnd current-xmpp-contact">
<a class="open-chat" title="Click to chat with this contact" href="#">
<span class="icon-dnd" title="This contact is busy"></span>
Gary Teichmann</a>
......@@ -196,7 +196,7 @@
<canvas height="33px" width="33px" class="avatar" style="background-color: black"></canvas>
<div class="chat-title"> JC Brand </div>
</a>
<p class="user-custom-message"></p>
<p class="user-custom-message" title="10000ft in the air">10000ft in the air</p>
<p></p>
</div>
<div class="chat-content">
......@@ -322,6 +322,19 @@ $(document).ready(function () {
$(ev.target).parent().parent().siblings('dd').find('ul').toggle('fast');
});
$("a.change-xmpp-status-message").click(function (ev) {
ev.preventDefault();
var form = ''+
'<form id="set-custom-xmpp-status">' +
'<input type="text" class="custom-xmpp-status"I am online"'+
'placeholder="I am online"/>' +
'<button type="submit">Save</button>' +
'</form>';
$(ev.target).closest('.xmpp-status').replaceWith(form);
$(ev.target).closest('.custom-xmpp-status').focus().focus();
});
$('.toggle-xmpp-contact-form').click(function (ev) {
ev.preventDefault();
$(ev.target).parent().parent().find('.search-xmpp').toggle('fast', function () {
......
......@@ -3,10 +3,10 @@ require.config({
paths: {
"jquery": "components/jquery/jquery",
"locales": "locale/locales",
"tinysort": "components/tinysort/src/jquery.tinysort",
"jquery.tinysort": "components/tinysort/src/jquery.tinysort",
"underscore": "components/underscore/underscore",
"backbone": "components/backbone/backbone",
"localstorage": "components/backbone.localStorage/backbone.localStorage",
"backbone.localStorage": "components/backbone.localStorage/backbone.localStorage",
"strophe": "components/strophe/strophe",
"strophe.muc": "components/strophe.muc/index",
"strophe.roster": "components/strophe.roster/index",
......
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