|
|
@ -73,7 +73,9 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
|
|
|
function handleImageChange() {
|
|
|
|
function handleImageChange() {
|
|
|
|
|
|
|
|
|
|
|
|
$('#changePictureBtn').on('click', function () {
|
|
|
|
$('#changePictureBtn').on('click', function () {
|
|
|
|
socket.emit('user.getProfilePictures', {uid: ajaxify.data.uid}, function (err, pictures) {
|
|
|
|
socket.emit('user.getProfilePictures', {
|
|
|
|
|
|
|
|
uid: ajaxify.data.uid
|
|
|
|
|
|
|
|
}, function (err, pictures) {
|
|
|
|
if (err) {
|
|
|
|
if (err) {
|
|
|
|
return app.alertError(err.message);
|
|
|
|
return app.alertError(err.message);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -216,10 +218,13 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
|
|
|
|
|
|
|
|
|
|
|
pictureCropper.show({
|
|
|
|
pictureCropper.show({
|
|
|
|
socketMethod: 'user.uploadCroppedPicture',
|
|
|
|
socketMethod: 'user.uploadCroppedPicture',
|
|
|
|
aspectRatio: '1 / 1',
|
|
|
|
aspectRatio: 1 / 1,
|
|
|
|
paramName: 'uid',
|
|
|
|
paramName: 'uid',
|
|
|
|
paramValue: ajaxify.data.theirid,
|
|
|
|
paramValue: ajaxify.data.theirid,
|
|
|
|
fileSize: ajaxify.data.maximumProfileImageSize,
|
|
|
|
fileSize: ajaxify.data.maximumProfileImageSize,
|
|
|
|
|
|
|
|
allowSkippingCrop: false,
|
|
|
|
|
|
|
|
restrictImageDimension: true,
|
|
|
|
|
|
|
|
imageDimension: ajaxify.data.profileImageDimension,
|
|
|
|
title: '[[user:upload_picture]]',
|
|
|
|
title: '[[user:upload_picture]]',
|
|
|
|
description: '[[user:upload_a_picture]]',
|
|
|
|
description: '[[user:upload_a_picture]]',
|
|
|
|
accept: '.png,.jpg,.bmp'
|
|
|
|
accept: '.png,.jpg,.bmp'
|
|
|
@ -242,17 +247,20 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
|
|
|
if (!url) {
|
|
|
|
if (!url) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uploadModal.modal('hide');
|
|
|
|
uploadModal.modal('hide');
|
|
|
|
|
|
|
|
|
|
|
|
pictureCropper.handleImageCrop({
|
|
|
|
pictureCropper.handleImageCrop({
|
|
|
|
url: url,
|
|
|
|
url: url,
|
|
|
|
socketMethod: 'user.uploadCroppedPicture',
|
|
|
|
socketMethod: 'user.uploadCroppedPicture',
|
|
|
|
aspectRatio: '1 / 1',
|
|
|
|
aspectRatio: '1 / 1',
|
|
|
|
|
|
|
|
allowSkippingCrop: false,
|
|
|
|
|
|
|
|
restrictImageDimension: true,
|
|
|
|
|
|
|
|
imageDimension: ajaxify.data.profileImageDimension,
|
|
|
|
paramName: 'uid',
|
|
|
|
paramName: 'uid',
|
|
|
|
paramValue: ajaxify.data.theirid,
|
|
|
|
paramValue: ajaxify.data.theirid,
|
|
|
|
}, onUploadComplete);
|
|
|
|
}, onUploadComplete);
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -262,7 +270,9 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
modal.find('[data-action="remove-uploaded"]').on('click', function () {
|
|
|
|
modal.find('[data-action="remove-uploaded"]').on('click', function () {
|
|
|
|
socket.emit('user.removeUploadedPicture', {uid: ajaxify.data.theirid}, function (err) {
|
|
|
|
socket.emit('user.removeUploadedPicture', {
|
|
|
|
|
|
|
|
uid: ajaxify.data.theirid
|
|
|
|
|
|
|
|
}, function (err) {
|
|
|
|
modal.modal('hide');
|
|
|
|
modal.modal('hide');
|
|
|
|
if (err) {
|
|
|
|
if (err) {
|
|
|
|
return app.alertError(err.message);
|
|
|
|
return app.alertError(err.message);
|
|
|
|