diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2013-01-31 19:28:25 +0100 |
---|---|---|
committer | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2013-01-31 19:28:25 +0100 |
commit | 3d5c7ca2456849b7227cf24bed2bc0be4db1a555 (patch) | |
tree | 95ca38a92c8d84d49063e3f852467feae770be96 /settings/js/apps.js | |
parent | ad044eb88861ebf2cefedc993634a85bb4697cd2 (diff) | |
parent | 5bf7791b4212c6dba2ce7289841c71f8177cfa3f (diff) | |
download | nextcloud-server-3d5c7ca2456849b7227cf24bed2bc0be4db1a555.tar.gz nextcloud-server-3d5c7ca2456849b7227cf24bed2bc0be4db1a555.zip |
Merge branch 'master' into navigation
Diffstat (limited to 'settings/js/apps.js')
-rw-r--r-- | settings/js/apps.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js index 83a3f3c7dcc..023033df37a 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -24,6 +24,14 @@ OC.Settings.Apps = OC.Settings.Apps || { page.find('span.author').text(app.author); page.find('span.licence').text(app.licence); + if (app.update != false) { + page.find('input.update').show(); + page.find('input.update').data('appid', app.id); + page.find('input.update').attr('value',t('settings', 'Update to {appversion}', {appversion:app.update})); + } else { + page.find('input.update').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); @@ -44,6 +52,7 @@ OC.Settings.Apps = OC.Settings.Apps || { appData = appitem.data('app'); appData.active = !active; appitem.data('app', appData); + element.val(t('settings','Please wait....')); if(active) { $.post(OC.filePath('settings','ajax','disableapp.php'),{appid:appid},function(result) { if(!result || result.status!='success') { @@ -70,6 +79,20 @@ OC.Settings.Apps = OC.Settings.Apps || { $('#leftcontent li[data-id="'+appid+'"]').addClass('active'); } }, + updateApp:function(appid, element) { + console.log('updateApp:', appid, element); + element.val(t('settings','Updateing....')); + $.post(OC.filePath('settings','ajax','updateapp.php'),{appid:appid},function(result) { + if(!result || result.status!='success') { + OC.dialogs.alert(t('settings','Error while updating app'),t('settings','Error')); + } + else { + element.val(t('settings','Updated')); + element.hide(); + } + },'json'); + }, + insertApp:function(appdata) { var applist = $('#leftcontent li'); var app = @@ -154,6 +177,13 @@ $(document).ready(function(){ OC.Settings.Apps.enableApp(appid, active, element); } }); + $('#rightcontent input.update').click(function(){ + var element = $(this); + var appid=$(this).data('appid'); + if(appid) { + OC.Settings.Apps.updateApp(appid, element); + } + }); if(appid) { var item = $('#leftcontent li[data-id="'+appid+'"]'); |