From f4fdabd3ca53de30f2d43a24fdd84c9fa0754923 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Tue, 30 Jul 2013 18:34:51 -0400 Subject: [PATCH] changed to wrapper alert functions --- public/src/forum/account.js | 28 ++++------------------------ public/src/forum/accountedit.js | 7 +------ public/src/forum/following.js | 14 ++------------ 3 files changed, 7 insertions(+), 42 deletions(-) diff --git a/public/src/forum/account.js b/public/src/forum/account.js index 78e4beec4c..0d56ffbc9a 100644 --- a/public/src/forum/account.js +++ b/public/src/forum/account.js @@ -30,19 +30,9 @@ if(success) { followBtn.hide(); unfollowBtn.show(); - app.alert({ - title: 'Following', - message: 'You are now following ' + username + '!', - type: 'success', - timeout: 2000 - }); + app.alertSuccess('You are now following ' + username + '!'); } else { - app.alert({ - title: 'Error', - message: 'There was an error following' + username + '!', - type: 'error', - timeout: 2000 - }); + app.alertError('There was an error following' + username + '!'); } }); return false; @@ -54,19 +44,9 @@ if(success) { followBtn.show(); unfollowBtn.hide(); - app.alert({ - title: 'Unfollowing', - message: 'You are no longer following ' + username + '!', - type: 'success', - timeout: 2000 - }); + app.alertSuccess('You are no longer following ' + username + '!'); } else { - app.alert({ - title: 'Error', - message: 'There was an error unfollowing' + username + '!', - type: 'error', - timeout: 2000 - }); + app.alertError('There was an error unfollowing ' + username + '!'); } }); return false; diff --git a/public/src/forum/accountedit.js b/public/src/forum/accountedit.js index cb77d6fbb3..ab0d1a6cba 100644 --- a/public/src/forum/accountedit.js +++ b/public/src/forum/accountedit.js @@ -87,12 +87,7 @@ $(document).ready(function() { socket.emit('api:user.changePicture', userData, function(success) { if(!success) { - app.alert({ - title: 'Error', - message: 'There was an error changing picture!', - type: 'error', - timeout: 2000 - }); + app.alertError('There was an error changing picture!'); } }); } diff --git a/public/src/forum/following.js b/public/src/forum/following.js index 387dd7b512..dfeec84c3f 100644 --- a/public/src/forum/following.js +++ b/public/src/forum/following.js @@ -23,19 +23,9 @@ var username = unfollowBtn.attr('data-username'); if(success) { unfollowBtn.parent().remove(); - app.alert({ - title: 'Unfollowing', - message: 'You are no longer following ' + username + '!', - type: 'success', - timeout: 2000 - }); + app.alertSuccess('You are no longer following ' + username + '!'); } else { - app.alert({ - title: 'Error', - message: 'There was an error unfollowing ' + username + '!', - type: 'error', - timeout: 2000 - }); + app.alertError('There was an error unfollowing ' + username + '!'); } }); return false;