diff --git a/js/admin.js b/js/admin.js index 5c72726..c581735 100644 --- a/js/admin.js +++ b/js/admin.js @@ -1,12 +1,12 @@ -function ocOwnnoteUrl(url) { - var newurl = OC.linkTo("ownnote",url).replace("apps/ownnote","index.php/apps/ownnote"); +function ocOwnnoteUrl() { + var newurl = OC.linkTo("ownnote","index.php") + "/ajax/v0.2/ajaxsetval"; return newurl; } $(document).ready(function() { $('#ownnote-folder').change(function() { var val = $(this).val(); - $.post(ocOwnnoteUrl("ajax/v0.2/ajaxsetval"), { field: 'folder', value: val }, function (data) { + $.post(ocOwnnoteUrl(), { field: 'folder', value: val }, function (data) { console.log('response', data); }); }); @@ -15,7 +15,7 @@ $(document).ready(function() { if (val == "") { $('#ownnote-folder').val(''); $('#ownnote-folder-settings').css('display', 'none'); - $.post(ocOwnnoteUrl("ajax/v0.2/ajaxsetval"), { field: 'folder', value: '' }, function (data) { + $.post(ocOwnnoteUrl(), { field: 'folder', value: '' }, function (data) { console.log('response', data); }); } else @@ -26,7 +26,7 @@ $(document).ready(function() { var c = $(this).is(':checked'); if (c) da = "checked"; - $.post(ocOwnnoteUrl("ajax/v0.2/ajaxsetval"), { field: 'disableAnnouncement', val: da }, function (data) { + $.post(ocOwnnoteUrl(), { field: 'disableAnnouncement', value: da }, function (data) { console.log('response', data); }); });