mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 17:05:51 +01:00
changed to wrapper alert functions
This commit is contained in:
@@ -30,19 +30,9 @@
|
|||||||
if(success) {
|
if(success) {
|
||||||
followBtn.hide();
|
followBtn.hide();
|
||||||
unfollowBtn.show();
|
unfollowBtn.show();
|
||||||
app.alert({
|
app.alertSuccess('You are now following ' + username + '!');
|
||||||
title: 'Following',
|
|
||||||
message: 'You are now following ' + username + '!',
|
|
||||||
type: 'success',
|
|
||||||
timeout: 2000
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
app.alert({
|
app.alertError('There was an error following' + username + '!');
|
||||||
title: 'Error',
|
|
||||||
message: 'There was an error following' + username + '!',
|
|
||||||
type: 'error',
|
|
||||||
timeout: 2000
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
@@ -54,19 +44,9 @@
|
|||||||
if(success) {
|
if(success) {
|
||||||
followBtn.show();
|
followBtn.show();
|
||||||
unfollowBtn.hide();
|
unfollowBtn.hide();
|
||||||
app.alert({
|
app.alertSuccess('You are no longer following ' + username + '!');
|
||||||
title: 'Unfollowing',
|
|
||||||
message: 'You are no longer following ' + username + '!',
|
|
||||||
type: 'success',
|
|
||||||
timeout: 2000
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
app.alert({
|
app.alertError('There was an error unfollowing ' + username + '!');
|
||||||
title: 'Error',
|
|
||||||
message: 'There was an error unfollowing' + username + '!',
|
|
||||||
type: 'error',
|
|
||||||
timeout: 2000
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -87,12 +87,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
socket.emit('api:user.changePicture', userData, function(success) {
|
socket.emit('api:user.changePicture', userData, function(success) {
|
||||||
if(!success) {
|
if(!success) {
|
||||||
app.alert({
|
app.alertError('There was an error changing picture!');
|
||||||
title: 'Error',
|
|
||||||
message: 'There was an error changing picture!',
|
|
||||||
type: 'error',
|
|
||||||
timeout: 2000
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,19 +23,9 @@
|
|||||||
var username = unfollowBtn.attr('data-username');
|
var username = unfollowBtn.attr('data-username');
|
||||||
if(success) {
|
if(success) {
|
||||||
unfollowBtn.parent().remove();
|
unfollowBtn.parent().remove();
|
||||||
app.alert({
|
app.alertSuccess('You are no longer following ' + username + '!');
|
||||||
title: 'Unfollowing',
|
|
||||||
message: 'You are no longer following ' + username + '!',
|
|
||||||
type: 'success',
|
|
||||||
timeout: 2000
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
app.alert({
|
app.alertError('There was an error unfollowing ' + username + '!');
|
||||||
title: 'Error',
|
|
||||||
message: 'There was an error unfollowing ' + username + '!',
|
|
||||||
type: 'error',
|
|
||||||
timeout: 2000
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user