diff --git a/converse.js b/converse.js index 36bb0df7c..c33cedd61 100644 --- a/converse.js +++ b/converse.js @@ -5092,7 +5092,7 @@ */ var $form= this.$('form'), $stanza = $(stanza), - $fields; + $fields, $input; $form.empty().append(converse.templates.registration_form({ 'domain': this.domain, 'title': this.title, @@ -5100,16 +5100,27 @@ })); if (this.form_type == 'xform') { $fields = $stanza.find('field'); - _.each($fields, $.proxy(function (field) { + _.each($fields, function (field) { $form.append(utils.xForm2webForm.bind(this, $(field), $stanza)); - }, this)); + }.bind(this)); } else { // Show fields _.each(Object.keys(this.fields), $.proxy(function (key) { - $form.append(''); - var $input = $(''); - if (key === 'password' || key === 'email') { - $input.attr('type', key); + if (key == "username") { + $input = templates.form_username({ + domain: ' @'+this.domain, + name: key, + type: "text", + label: key, + value: '', + required: 1 + }); + } else { + $form.append(''); + $input = $(''); + if (key === 'password' || key === 'email') { + $input.attr('type', key); + } } $form.append($input); }, this)); @@ -5185,8 +5196,7 @@ return; } var $inputs = $(ev.target).find(':input:not([type=button]):not([type=submit])'), - iq = $iq({type: "set"}) - .c("query", {xmlns:Strophe.NS.REGISTER}) + iq = $iq({type: "set"}).c("query", {xmlns:Strophe.NS.REGISTER}); if (this.form_type == 'xform') { iq.c("x", {xmlns: Strophe.NS.XFORM, type: 'submit'}); @@ -5199,7 +5209,6 @@ iq.c($input.attr('name'), {}, $input.val()); }); } - converse.connection._addSysHandler(this._onRegisterIQ.bind(this), null, "iq", null, null); converse.connection.send(iq); this.setFields(iq.tree()); diff --git a/css/converse.css b/css/converse.css index cab8a7525..59a56e9cc 100644 --- a/css/converse.css +++ b/css/converse.css @@ -965,13 +965,15 @@ margin: 5px 0 10px 0; padding-left: 0.5em; } #conversejs #converse-register .input-group { + table-layout: fixed; display: table; margin: auto; width: 178px; } + #conversejs #converse-register .input-group span { + overflow-x: hidden; + text-overflow: ellipsis; } #conversejs #converse-register .input-group span, #conversejs #converse-register .input-group input[name=username] { display: table-cell; } - #conversejs #converse-register .input-group input[name=username] { - width: 100%; } #conversejs .cancel-submit, #conversejs .save-submit { width: 45%; margin: 5px 3px 5px 3px; } diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst index 08f729e92..ad07b93b8 100644 --- a/docs/CHANGES.rst +++ b/docs/CHANGES.rst @@ -6,6 +6,8 @@ Changelog * Add the ability to log in anonymously. [jcbrand] * Add the ability to log in automatically. [jcbrand] +* #370 Unable to register a new user to ejabberd 2.1.11. [gbonvehi] +* #372 Some offline users have a visible empty