From 04da5a56ddb7cc3ce9a7d9bb37a442cd647ac83c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 22 Feb 2016 09:17:59 +0100 Subject: Use the notification instead of the disruptive popup --- settings/js/users/groups.js | 10 +++++----- settings/js/users/users.js | 24 +++++++++++++----------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js index 2639191d918..27c41884504 100644 --- a/settings/js/users/groups.js +++ b/settings/js/users/groups.js @@ -142,8 +142,8 @@ GroupList = { .text(result.groupname)); } GroupList.toggleAddGroup(); - }).fail(function(result, textStatus, errorThrown) { - OC.dialogs.alert(result.responseJSON.message, t('settings', 'Error creating group')); + }).fail(function(result) { + OC.Notification.showTemporary(t('settings', 'Error creating group: {message}', {message: result.responseJSON.message})); }); }, @@ -245,9 +245,9 @@ GroupList = { isGroupNameValid: function (groupname) { if ($.trim(groupname) === '') { - OC.dialogs.alert( - t('settings', 'A valid group name must be provided'), - t('settings', 'Error creating group')); + OC.Notification.showTemporary(t('settings', 'Error creating group: {message}', { + message: t('settings', 'A valid group name must be provided') + })); return false; } return true; diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 306e3952e53..261d9a8eb52 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -767,24 +767,24 @@ $(document).ready(function () { var password = $('#newuserpassword').val(); var email = $('#newemail').val(); if ($.trim(username) === '') { - OC.dialogs.alert( - t('settings', 'A valid username must be provided'), - t('settings', 'Error creating user')); + OC.Notification.showTemporary(t('settings', 'Error creating user: {message}', { + message: t('settings', 'A valid username must be provided') + })); return false; } if ($.trim(password) === '') { - OC.dialogs.alert( - t('settings', 'A valid password must be provided'), - t('settings', 'Error creating user')); + OC.Notification.showTemporary(t('settings', 'Error creating user: {message}', { + message: t('settings', 'A valid password must be provided') + })); return false; } if(!$('#CheckboxMailOnUserCreate').is(':checked')) { email = ''; } if ($('#CheckboxMailOnUserCreate').is(':checked') && $.trim(email) === '') { - OC.dialogs.alert( - t('settings', 'A valid email must be provided'), - t('settings', 'Error creating user')); + OC.Notification.showTemporary( t('settings', 'Error creating user: {message}', { + message: t('settings', 'A valid email must be provided') + })); return false; } @@ -822,8 +822,10 @@ $(document).ready(function () { } $('#newusername').focus(); GroupList.incEveryoneCount(); - }).fail(function(result, textStatus, errorThrown) { - OC.dialogs.alert(result.responseJSON.message, t('settings', 'Error creating user')); + }).fail(function(result) { + OC.Notification.showTemporary(t('settings', 'Error creating user: {message}', { + message: result.responseJSON.message + })); }).success(function(){ $('#newuser').get(0).reset(); }); -- cgit v1.2.3