v1.18.x
psychobunny 9 years ago
commit 3564d581ad

@ -2,7 +2,7 @@
"name": "nodebb",
"license": "GPL-3.0",
"description": "NodeBB Forum",
"version": "0.8.2",
"version": "0.9.0",
"homepage": "http://www.nodebb.org",
"repository": {
"type": "git",

@ -74,7 +74,10 @@ define('forum/account/edit', ['forum/account/header', 'uploader', 'translator'],
function handleImageChange() {
$('#changePictureBtn').on('click', function() {
socket.emit('user.getProfilePictures', function(err, pictures) {
socket.emit('user.getProfilePictures', {uid: ajaxify.data.uid}, function(err, pictures) {
if (err) {
return app.alertError(err.message);
}
templates.parse('partials/modals/change_picture_modal', {
pictures: pictures,
uploaded: !!ajaxify.data.uploadedpicture
@ -115,13 +118,6 @@ define('forum/account/edit', ['forum/account/header', 'uploader', 'translator'],
}
})
}
// if (uploadedPicture) {
// modal.find('#user-uploaded-picture').attr('src', uploadedPicture);
// }
// modal.find('#uploaded-box').toggle(!!uploadedPicture);
// modal.find('#default-box .fa-check').toggle(currentPicture !== uploadedPicture);
// modal.find('#uploaded-box .fa-check').toggle(currentPicture === uploadedPicture);
}
function selectImageType() {
@ -141,40 +137,6 @@ define('forum/account/edit', ['forum/account/header', 'uploader', 'translator'],
ajaxify.refresh();
});
}
// var modal = $(html);
// modal.on('hidden.bs.modal', function() {
// modal.remove();
// });
// selectedImageType = '';
// updateImages();
// modal.modal('show');
// modal.find('#default-box').on('click', function() {
// selectImageType('default');
// });
// modal.find('#uploaded-box').on('click', function() {
// selectImageType('uploaded');
// });
// modal.find('#savePictureChangesBtn').on('click', function() {
// modal.modal('hide');
// if (!selectedImageType) {
// return;
// }
// changeUserPicture(selectedImageType, function(err) {
// if (err) {
// return app.alertError(err.message);
// }
// updateHeader(selectedImageType === 'uploaded' ? uploadedPicture : '');
// ajaxify.refresh();
// });
// });
});
});
});

@ -100,12 +100,16 @@ module.exports = function(SocketUser) {
};
SocketUser.getProfilePictures = function(socket, data, callback) {
if (!data || !data.uid) {
return callback(new Error('[[error:invalid-data]]'));
}
async.parallel({
list: async.apply(plugins.fireHook, 'filter:user.listPictures', {
uid: socket.uid,
uid: data.uid,
pictures: []
}),
uploaded: async.apply(user.getUserField, socket.uid, 'uploadedpicture')
uploaded: async.apply(user.getUserField, data.uid, 'uploadedpicture')
}, function(err, data) {
if (err) {
return callback(err);

Loading…
Cancel
Save