diff options
author | Frank Karlitschek <frank@owncloud.org> | 2013-01-21 20:40:23 +0100 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2013-01-21 20:40:23 +0100 |
commit | a27f92a17ae12d2d1ff48b26aadfecd7c221c589 (patch) | |
tree | afe980f2b1eeaacefb38ebd8a431de62c2a3a009 /settings/js/apps.js | |
parent | 51a4240051cf5c4225813b3f948dcc069b725c81 (diff) | |
download | nextcloud-server-a27f92a17ae12d2d1ff48b26aadfecd7c221c589.tar.gz nextcloud-server-a27f92a17ae12d2d1ff48b26aadfecd7c221c589.zip |
we are getting closer. updating is not working yet.
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 c4c36b4bb12..8d214bd1145 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 ')+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('Error while updating app','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+'"]'); |