From daee1ecd453dcbeaa5608b6be82b8c37d414722f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 30 Dec 2015 17:07:48 -0500 Subject: [PATCH] update emby connect error message --- dashboard-ui/scripts/useredit.js | 25 ++++++++++++++++++++----- dashboard-ui/scripts/wizarduserpage.js | 23 ++++++++++++++++++----- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/dashboard-ui/scripts/useredit.js b/dashboard-ui/scripts/useredit.js index 4848388f2e..eec1224ed3 100644 --- a/dashboard-ui/scripts/useredit.js +++ b/dashboard-ui/scripts/useredit.js @@ -113,11 +113,7 @@ }, function () { - Dashboard.alert({ - - message: Globalize.translate('ErrorAddingEmbyConnectAccount', 'apps@emby.media') - - }); + showEmbyConnectErrorMessage('.'); }); } else { @@ -125,8 +121,27 @@ noActionCallback(); } } + } function showEmbyConnectErrorMessage(username) { + + var msg; + + if (username) { + + msg = Globalize.translate('ErrorAddingEmbyConnectAccount1', 'https://emby.media/connect'); + msg += '

' + Globalize.translate('ErrorAddingEmbyConnectAccount2', 'apps@emby.media'); + + } else { + msg = Globalize.translate('DefaultErrorMessage'); + } + + Dashboard.alert({ + + message: msg + + }); } + function onSaveComplete(page, user) { Dashboard.hideLoadingMsg(); diff --git a/dashboard-ui/scripts/wizarduserpage.js b/dashboard-ui/scripts/wizarduserpage.js index 9d544fb91e..5de1de3440 100644 --- a/dashboard-ui/scripts/wizarduserpage.js +++ b/dashboard-ui/scripts/wizarduserpage.js @@ -47,13 +47,27 @@ }).then(onUpdateUserComplete, function () { - var msgKey = form.querySelector('#txtConnectUserName').value ? 'ErrorAddingEmbyConnectAccount' : 'DefaultErrorMessage'; + showEmbyConnectErrorMessage(form.querySelector('#txtConnectUserName').value); + }); + } - Dashboard.alert({ + function showEmbyConnectErrorMessage(username) { - message: Globalize.translate(msgKey) + var msg; + + if (username) { + + msg = Globalize.translate('ErrorAddingEmbyConnectAccount1', 'https://emby.media/connect'); + msg += '

' + Globalize.translate('ErrorAddingEmbyConnectAccount2', 'apps@emby.media'); + + } else { + msg = Globalize.translate('DefaultErrorMessage'); + } + + Dashboard.alert({ + + message: msg - }); }); } @@ -84,7 +98,6 @@ Dashboard.hideLoadingMsg(); }); - }); })(jQuery, document, window); \ No newline at end of file