');
$('#sb-motto-btn').attr('disabled', 'disabled');
$('#me-mottobox').attr('disabled', 'disabled');
$.post('api/update_motto', {'new_motto': $('#me-mottobox').val()})
.done(function(data){
$('#notif-area').prepend('
\
' + data['message'] + '
');
if($('#me-mottobox').val() == ''){
$('#me-mottobox').attr('placeholder', 'Update your motto...');
} else {
$('#me-mottobox').attr('placeholder', $('#me-mottobox').val());
}
$('#me-mottobox').val('');
})
.fail(function(xhr, textStatus, errorThrown){
$('#notif-area').prepend('
\
' + JSON.parse(xhr.responseText)['error'] + '
')
})
.always(function(data){
$('#sb-motto-btn').html('
');
$('#sb-motto-btn').removeAttr('disabled');
$('#me-mottobox').removeAttr('disabled');}
)});
});
function showLogin(fade){
$('#hp-login-btn').hide();
$('#hp-register-btn').hide();
$('#ws-content').hide();
if(typeof(fade)==='undefined') {
$('#hp-login-form').show();
} else {
$('#hp-login-form').fadeIn('slow');
};
};
function showRegister(fade){
$('#hp-login-btn').hide();
$('#hp-register-btn').hide();
$('#ws-content').hide();
if(typeof(fade)==='undefined') {
$('#hp-register-form').show();
} else {
$('#hp-register-form').fadeIn('slow');
};
};