From 3f740966dcd9f65b0c9582e25be596ad69019fac Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 23 Sep 2016 13:08:18 +0200 Subject: Revert "Show an update button instead of the updater" This reverts commit 202ae42506e9bbb167889735b2c56ccebace594b. Signed-off-by: Morris Jobke --- apps/updatenotification/js/admin.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'apps/updatenotification/js') diff --git a/apps/updatenotification/js/admin.js b/apps/updatenotification/js/admin.js index e60e77ab89a..3ca45a191d4 100644 --- a/apps/updatenotification/js/admin.js +++ b/apps/updatenotification/js/admin.js @@ -13,7 +13,33 @@ /** * Creates a new authentication token and loads the updater URL */ +var loginToken = ''; $(document).ready(function(){ + $('#oca_updatenotification_button').click(function() { + // Load the new token + $.ajax({ + url: OC.generateUrl('/apps/updatenotification/credentials') + }).success(function(data) { + loginToken = data; + $.ajax({ + url: OC.webroot+'/updater/', + headers: { + 'X-Updater-Auth': loginToken + }, + method: 'POST', + success: function(data){ + if(data !== 'false') { + var body = $('body'); + $('head').remove(); + body.html(data); + body.removeAttr('id'); + body.attr('id', 'body-settings'); + } + } + }); + }); + }); + $('#release-channel').change(function() { var newChannel = $('#release-channel').find(":selected").val(); -- cgit v1.2.3