summaryrefslogtreecommitdiffstats
path: root/settings/js/apps.js
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-08-06 17:19:18 +0200
committerkondou <kondou@ts.unde.re>2013-08-06 17:19:18 +0200
commit1a4465f41d3fe334f42782545e3130a19796e590 (patch)
treeb3e5fbd743dd22ea3255e96593735791a59b11a1 /settings/js/apps.js
parent057d7aa108f9b24c12b97f5f78008eb17a6d3bee (diff)
downloadnextcloud-server-1a4465f41d3fe334f42782545e3130a19796e590.tar.gz
nextcloud-server-1a4465f41d3fe334f42782545e3130a19796e590.zip
Improve app-management
- Better error messages - Translate untranslated strings Basically picks non-app-dependency related stuff from #4017
Diffstat (limited to 'settings/js/apps.js')
-rw-r--r--settings/js/apps.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js
index 0540d9b1c58..6b32686a693 100644
--- a/settings/js/apps.js
+++ b/settings/js/apps.js
@@ -61,7 +61,11 @@ OC.Settings.Apps = OC.Settings.Apps || {
if(active) {
$.post(OC.filePath('settings','ajax','disableapp.php'),{appid:appid},function(result) {
if(!result || result.status !== 'success') {
- OC.dialogs.alert('Error while disabling app', t('core', 'Error'));
+ if (result.data && result.data.message) {
+ OC.dialogs.alert(result.data.message, t('core', 'Error'));
+ } else {
+ OC.dialogs.alert(t('settings', 'Error while disabling app'), t('core', 'Error'));
+ }
}
else {
element.data('active',false);
@@ -73,16 +77,20 @@ OC.Settings.Apps = OC.Settings.Apps || {
} else {
$.post(OC.filePath('settings','ajax','enableapp.php'),{appid:appid},function(result) {
if(!result || result.status !== 'success') {
- OC.dialogs.alert('Error while enabling app', t('core', 'Error'));
- }
- else {
+ if (result.data && result.data.message) {
+ OC.dialogs.alert(result.data.message, t('core', 'Error'));
+ } else {
+ OC.dialogs.alert(t('settings', 'Error while enabling app'), t('core', 'Error'));
+ }
+ element.val(t('settings','Enable'));
+ } else {
OC.Settings.Apps.addNavigation(appid);
element.data('active',true);
element.val(t('settings','Disable'));
}
},'json')
.fail(function() {
- OC.dialogs.alert('Error while enabling app', t('core', 'Error'));
+ OC.dialogs.alert(t('settings', 'Error while enabling app'), t('core', 'Error'));
element.data('active',false);
OC.Settings.Apps.removeNavigation(appid);
element.val(t('settings','Enable'));