summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2014-06-16 15:54:50 +0200
committerGeorg Ehrke <developer@georgehrke.com>2014-06-16 15:54:50 +0200
commit15c215cd031602013d982d630306314fc6c1b21c (patch)
treee7f5bea6cc6d43694cd61dfedaef4ce7723e3b52 /settings/js
parentb67588d35c2ebf031e4f4f46fbce73fd555d33e8 (diff)
parent86f546ff6487b9ac8b18ad14ca290b8051f0496e (diff)
downloadnextcloud-server-15c215cd031602013d982d630306314fc6c1b21c.tar.gz
nextcloud-server-15c215cd031602013d982d630306314fc6c1b21c.zip
Merge pull request #8808 from owncloud/update_shipped_apps_from_appstore
Make shipped apps updatable via appstore
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');