1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| function upload_avatar_thumbnail()
{
var fields_form = $('form#avatar_thumbnail_form');
var file = $('#avatar_thumbnail_upload').val();
extension = getFileNameExtension(file);
if (extension != 'jpg' && extension != 'jpeg' && extension != 'png' && extension != 'gif')
{
errorMessage = i18n.JST_INVALID_IMAGE_EXTENSIONS;
options = new Array();
options['positionZIndex'] = 1200;
messageBox(errorMessage, MSG_TYPE_ERR, options);
return false;
}
$(fields_form).ajaxSubmit(
{
type: 'post',
url: '/index.php?ajax=1&action=upload_avatar_thumbnail',
dataType: 'json',
success: avatarDefaultUpdateResult
error: function()
{
alert('error');
}
});
return false;
} |
Partager