image upload cleaned up a bit

v1.18.x
Baris Soner Usakli 13 years ago
parent eccd1f66d1
commit 3b6e20d4ef

@ -199,8 +199,24 @@ $(document).ready(function() {
$('#alert-error').text(message).show(); $('#alert-error').text(message).show();
} }
function changeUserPicture(type) {
var userData = {
uid: $('#inputUID').val(),
type: type
};
$.post('/changeuserpicture',
userData,
function(data) {
socket.emit('api:updateHeader', { fields: ['username', 'picture'] });
}
);
}
var selectedImageType = '';
$('#submitBtn').on('click',function(){
function submitUserData() {
var userData = { var userData = {
uid:$('#inputUID').val(), uid:$('#inputUID').val(),
email:$('#inputEmail').val(), email:$('#inputEmail').val(),
@ -216,32 +232,8 @@ $(document).ready(function() {
} }
); );
}
function changeUserPicture(type) {
var userData = {
uid: $('#inputUID').val(),
type: type
};
$.post('/changeuserpicture',
userData,
function(data) {
socket.emit('api:updateHeader', { fields: ['username', 'picture'] });
}
);
}
var selectedImageType = '';
$('#submitBtn').on('click',function(){
submitUserData();
}); });
function updateImages() { function updateImages() {
var currentPicture = $('#user-current-picture').attr('src'); var currentPicture = $('#user-current-picture').attr('src');

Loading…
Cancel
Save