mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +01:00
more fixes
This commit is contained in:
@@ -458,7 +458,7 @@ var socket,
|
||||
});
|
||||
};
|
||||
|
||||
app.updateHeader = function(data) {
|
||||
app.updateHeader = function(err, data) {
|
||||
$('#search-button').off().on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
$('#search-fields').removeClass('hide').show();
|
||||
|
||||
@@ -45,7 +45,7 @@ define(function() {
|
||||
socket.emit('user.emailExists', {
|
||||
email: emailEl.val()
|
||||
}, function(exists) {
|
||||
if (exists === true) {
|
||||
if (exists) {
|
||||
showError(email_notify, 'Email address already taken!');
|
||||
} else {
|
||||
showSuccess(email_notify, successIcon);
|
||||
@@ -73,6 +73,16 @@ define(function() {
|
||||
} else {
|
||||
socket.emit('user.exists', {
|
||||
username: username.val()
|
||||
}, function(err, exists) {
|
||||
if(err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
|
||||
if (exists) {
|
||||
showError(username_notify, 'Username already taken!');
|
||||
} else {
|
||||
showSuccess(username_notify, successIcon);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -80,6 +90,7 @@ define(function() {
|
||||
username.on('keyup', function() {
|
||||
jQuery('#yourUsername').html(this.value.length > 0 ? this.value : 'username');
|
||||
});
|
||||
|
||||
username.on('blur', function() {
|
||||
validateUsername();
|
||||
});
|
||||
@@ -123,16 +134,6 @@ define(function() {
|
||||
validatePasswordConfirm();
|
||||
});
|
||||
|
||||
ajaxify.register_events(['user.exists', 'user.emailExists']);
|
||||
|
||||
socket.on('user.exists', function(data) {
|
||||
if (data.exists === true) {
|
||||
showError(username_notify, 'Username already taken!');
|
||||
} else {
|
||||
showSuccess(username_notify, successIcon);
|
||||
}
|
||||
});
|
||||
|
||||
function validateForm() {
|
||||
validationError = false;
|
||||
|
||||
|
||||
@@ -38,13 +38,19 @@ SocketMeta.buildTitle = function(socket, text, callback) {
|
||||
SocketMeta.updateHeader = function(socket, data, callback) {
|
||||
if (socket.uid) {
|
||||
user.getUserFields(socket.uid, data.fields, function(err, fields) {
|
||||
if (!err && fields) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (fields) {
|
||||
fields.uid = socket.uid;
|
||||
callback(fields);
|
||||
callback(null, fields);
|
||||
} else {
|
||||
callback([]);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback({
|
||||
callback(null, {
|
||||
uid: 0,
|
||||
username: "Anonymous User",
|
||||
email: '',
|
||||
|
||||
Reference in New Issue
Block a user