summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/apps.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js
index ed75e06c066..4cd7520caa7 100644
--- a/settings/js/apps.js
+++ b/settings/js/apps.js
@@ -84,6 +84,14 @@ OC.Settings.Apps = OC.Settings.Apps || {
page.find('input.update').hide();
}
+ if (app.removable !== false) {
+ page.find('input.uninstall').show();
+ page.find('input.uninstall').data('appid', app.id);
+ page.find('input.uninstall').attr('value', t('settings', 'Uninstall App'));
+ } else {
+ page.find('input.uninstall').hide();
+ }
+
page.find('input.enable').show();
page.find('input.enable').val((app.active) ? t('settings', 'Disable') : t('settings', 'Enable'));
page.find('input.enable').data('appid', app.id);
@@ -221,6 +229,18 @@ OC.Settings.Apps = OC.Settings.Apps || {
}
},'json');
},
+ uninstallApp:function(appid, element) {
+ element.val(t('settings','Uninstalling ....'));
+ $.post(OC.filePath('settings','ajax','uninstallapp.php'),{appid:appid},function(result) {
+ if(!result || result.status !== 'success') {
+ OC.Settings.Apps.showErrorMessage(t('settings','Error while uninstalling app'),t('settings','Error'));
+ element.val(t('settings','Uninstall'));
+ } else {
+ OC.Settings.Apps.removeNavigation(appid);
+ appitem.removeClass('active');
+ }
+ },'json');
+ },
insertApp:function(appdata) {
var applist = $('#app-navigation ul li');
@@ -351,6 +371,13 @@ $(document).ready(function(){
OC.Settings.Apps.updateApp(appid, element);
}
});
+ $('#app-content input.uninstall').click(function(){
+ var element = $(this);
+ var appid=$(this).data('appid');
+ if(appid) {
+ OC.Settings.Apps.uninstallApp(appid, element);
+ }
+ });
$('#group_select').change(function() {
var element = $('#app-content input.enable');