- 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:
49
integrations/Wordpress/eveai_sync/admin/js/eveai_admin.js
Normal file
49
integrations/Wordpress/eveai_sync/admin/js/eveai_admin.js
Normal 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.');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user