- Furter refinement of the API, adding functionality for refreshing documents and returning Token expiration time when retrieving token

- Implementation of a first version of a Wordpress plugin
- Adding api service to nginx.conf
This commit is contained in:
Josako
2024-09-11 16:31:13 +02:00
parent 76cb825660
commit 9e14824249
17 changed files with 997 additions and 19 deletions

View File

@@ -0,0 +1,49 @@
jQuery(document).ready(function($) {
// Handle bulk sync button click
$('#eveai-bulk-sync').on('click', function(e) {
e.preventDefault();
if (confirm('Are you sure you want to start a bulk sync? This may take a while.')) {
$.ajax({
url: ajaxurl,
type: 'POST',
data: {
action: 'eveai_bulk_sync',
nonce: eveai_admin.nonce
},
success: function(response) {
alert(response.data.message);
},
error: function() {
alert('An error occurred. Please try again.');
}
});
}
});
// Handle category exclusion checkboxes
$('.eveai-category-exclude').on('change', function() {
var categoryId = $(this).val();
var isExcluded = $(this).is(':checked');
$.ajax({
url: ajaxurl,
type: 'POST',
data: {
action: 'eveai_toggle_category_exclusion',
category_id: categoryId,
is_excluded: isExcluded ? 1 : 0,
nonce: eveai_admin.nonce
},
success: function(response) {
if (response.success) {
console.log('Category exclusion updated');
} else {
alert('Failed to update category exclusion');
}
},
error: function() {
alert('An error occurred. Please try again.');
}
});
});
});