Merge pull request #5 from riandyrn/riandy-branch

[Attempt to Make New User Discoverable]
This commit is contained in:
Gene
2017-08-04 14:37:36 +03:00
committed by GitHub
3 changed files with 27 additions and 5 deletions
+1
View File
@@ -0,0 +1 @@
tinode.js
+2 -1
View File
@@ -558,7 +558,8 @@ ul.permission-editor > li {
.contact-box .contact-comment {
text-overflow: ellipsis;
overflow: hidden
overflow: hidden;
font-weight: lighter;
}
/* The down arrow head - trigger for context menu in contacts list */
+24 -4
View File
@@ -116,6 +116,15 @@
return card;
}
// construct email params
function email(emailAddress) {
var tags = [];
if(emailAddress) {
tags.push("email:" + emailAddress);
}
return tags
}
/* BEGIN Popup/dropdown menu */
var ContextMenu = React.createClass({
componentWillUnmount: function() {
@@ -650,6 +659,7 @@
login: '',
password: '',
password2: '',
email: '',
fn: '', // full/formatted name
imageDataUrl: null,
errorCleared: false
@@ -664,6 +674,9 @@
handlePassword2Change: function(e) {
this.setState({password2: e.target.value});
},
handleEmailChange: function(e) {
this.setState({email: e.target.value})
},
handleFnChange: function(e) {
this.setState({fn: e.target.value});
},
@@ -679,7 +692,9 @@
this.props.onCreateAccount(
this.state.login.trim(),
this.state.password.trim(),
vcard(this.state.fn, this.state.imageDataUrl));
vcard(this.state.fn, this.state.imageDataUrl),
null,
email(this.state.email));
}
},
render: function() {
@@ -700,9 +715,13 @@
</div>
<AvatarUpload onImageChanged={this.handleImageChanged} />
</div>
<div className="panel-form-row">
<input type="text" placeholder="Email, e.g john.doe@example.com"
value={this.state.email} onChange={this.handleEmailChange} required/>
</div>
<div className="panel-form-row">
<input type="text" placeholder="Full name, e.g. John Doe"
value={this.state.fn} onChange={this.handleFnChange} />
value={this.state.fn} onChange={this.handleFnChange} required/>
</div>
<div className="dialog-buttons">
<button className={submitClasses} onClick={this.handleSubmit}>Sign up</button>
@@ -2502,12 +2521,13 @@
this.setState({sidePanelSelected: 'register'});
},
// Actual registration of a new account.
handleNewAccountRequest: function(login_, password_, public_, private_) {
handleNewAccountRequest: function(login_, password_, public_, private_, tags_) {
var instance = this;
tags_ = tags_ || []; // init tags_ value just in case undefined
Tinode.connect(this.state.serverAddress)
.then(function() {
return Tinode.createAccountBasic(login_, password_,
{login: true, public: public_, private: private_});
{defacs: {auth: "JRWPS", anon: "N"}, public: public_, private: private_, tags: tags_});
})
.then(function() {
instance.handleLoginSuccessful(instance);