diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-12-17 14:11:51 +0300 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-12-17 14:11:51 +0300 |
commit | 7a7c66a80537391bafebcc650a10f348cdbe9bb0 (patch) | |
tree | a8bdf25b2c3e5090463aad0f37689c5b9b83e28d /js/admin.js | |
parent | 9f981671f37327aac03e21633fc7257765ebe4fa (diff) |
Send request to the survey server
Diffstat (limited to 'js/admin.js')
-rw-r--r-- | js/admin.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/js/admin.js b/js/admin.js index 89141ea..10a7862 100644 --- a/js/admin.js +++ b/js/admin.js @@ -1,9 +1,25 @@ $(document).ready(function() { - $('.popularitycontestclient_category').change(function() { + var $section = $('#popularitycontestclient'); + $section.find('.popularitycontestclient_category').change(function() { + console.log('setValue'); OC.AppConfig.setValue( 'popularitycontestclient', $(this).attr('name').substring(24), $(this).attr('checked') ? 'yes' : 'no' ); }); + + $section.find('button').click(function() { + var $button = $(this); + $button.attr('disabled', true); + $.ajax({ + url: OC.linkToOCS('apps/popularitycontestclient/api/v1/', 2) + 'report?format=json', + type: 'POST', + success: function(response) { + $button.attr('disabled', false); + + $section.find('.last_report').text(JSON.stringify(response.ocs.data, undefined, 4)); + } + }); + }); }); |