update emby connect error message

This commit is contained in:
Luke Pulverenti 2015-12-30 17:07:48 -05:00
parent 92be720459
commit daee1ecd45
2 changed files with 38 additions and 10 deletions

View File

@ -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', '<a href="https://emby.media/connect" target="_blank">https://emby.media/connect</a>');
msg += '<br/><br/>' + Globalize.translate('ErrorAddingEmbyConnectAccount2', 'apps@emby.media');
} else {
msg = Globalize.translate('DefaultErrorMessage');
}
Dashboard.alert({
message: msg
});
}
function onSaveComplete(page, user) {
Dashboard.hideLoadingMsg();

View File

@ -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', '<a href="https://emby.media/connect" target="_blank">https://emby.media/connect</a>');
msg += '<br/><br/>' + Globalize.translate('ErrorAddingEmbyConnectAccount2', 'apps@emby.media');
} else {
msg = Globalize.translate('DefaultErrorMessage');
}
Dashboard.alert({
message: msg
});
});
}
@ -84,7 +98,6 @@
Dashboard.hideLoadingMsg();
});
});
})(jQuery, document, window);