|
|
@ -241,22 +241,29 @@ define('forum/account/edit', ['forum/account/header', 'translator', 'components'
|
|
|
|
uploadModal.find('.upload-btn').on('click', function () {
|
|
|
|
uploadModal.find('.upload-btn').on('click', function () {
|
|
|
|
var url = uploadModal.find('#uploadFromUrl').val();
|
|
|
|
var url = uploadModal.find('#uploadFromUrl').val();
|
|
|
|
if (!url) {
|
|
|
|
if (!url) {
|
|
|
|
return;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
socket.emit('user.uploadProfileImageFromUrl', {
|
|
|
|
uploadModal.modal('hide');
|
|
|
|
uid: ajaxify.data.uid,
|
|
|
|
|
|
|
|
|
|
|
|
pictureCropper.handleImageCrop({
|
|
|
|
|
|
|
|
url: url,
|
|
|
|
url: url,
|
|
|
|
socketMethod: 'user.uploadCroppedPicture',
|
|
|
|
}, function (err, url) {
|
|
|
|
aspectRatio: '1 / 1',
|
|
|
|
if (err) {
|
|
|
|
allowSkippingCrop: false,
|
|
|
|
return app.alertError(err);
|
|
|
|
restrictImageDimension: true,
|
|
|
|
}
|
|
|
|
imageDimension: ajaxify.data.profileImageDimension,
|
|
|
|
|
|
|
|
paramName: 'uid',
|
|
|
|
|
|
|
|
paramValue: ajaxify.data.theirid,
|
|
|
|
|
|
|
|
}, onUploadComplete);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uploadModal.modal('hide');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pictureCropper.handleImageCrop({
|
|
|
|
|
|
|
|
url: url,
|
|
|
|
|
|
|
|
socketMethod: 'user.uploadCroppedPicture',
|
|
|
|
|
|
|
|
aspectRatio: '1 / 1',
|
|
|
|
|
|
|
|
allowSkippingCrop: false,
|
|
|
|
|
|
|
|
restrictImageDimension: true,
|
|
|
|
|
|
|
|
imageDimension: ajaxify.data.profileImageDimension,
|
|
|
|
|
|
|
|
paramName: 'uid',
|
|
|
|
|
|
|
|
paramValue: ajaxify.data.theirid,
|
|
|
|
|
|
|
|
}, onUploadComplete);
|
|
|
|
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|