PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / 2.6.13
Search Atlas SEO – OTTO AI SEO Automation for WordPress v2.6.13
2.7.0 2.6.26 2.6.25 2.6.24 2.6.23 2.6.22 2.6.21 2.6.20 2.6.19 2.6.18 2.6.17 2.6.16 2.6.15 2.6.14 2.6.13 2.6.12 2.6.11 2.6.10 2.6.9 2.6.8 2.6.7 2.6.6 2.6.5 2.6.4 2.6.3 All 139 releases
metasync / views / js / metasync-bing-console.js

metasync-bing-console.js in Search Atlas SEO – OTTO AI SEO Automation for WordPress 2.6.13, at views/js/metasync-bing-console.js

71 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /* global jQuery, ajaxurl, metasyncBingConsoleData */
2 /**
3 * MetaSync Bing IndexNow console.
4 *
5 * Extracted from views/metasync-bing-console.php (Phase 5, #887).
6 */
7 jQuery(document).ready(function ($) {
8 $('#metasync-bing-response').hide();
9
10 $('#metasync-bing-btn-send').on('click', function () {
11 const $button = $(this);
12 const $url = $('#metasync-bing-url');
13 const $response = $('#metasync-bing-response');
14 const originalText = $button.html();
15
16 // Validate URLs
17 if (!$url.val().trim()) {
18 alert('Please enter at least one URL to submit.');
19 return;
20 }
21
22 // Disable button and show loading state
23 $button.html('🔄 Submitting...').prop('disabled', true);
24
25 // Make AJAX request
26 jQuery.ajax({
27 method: 'POST',
28 url: ajaxurl,
29 data: {
30 action: 'metasync_send_bing_indexnow',
31 nonce: metasyncBingConsoleData.nonce,
32 metasync_bing_url: $url.val()
33 }
34 })
35 .done(function (response) {
36 $response.show();
37
38 // Parse response
39 const urls = $url.val().split('\n').filter(Boolean);
40 const urlsDisplay = urls.length > 1 ? urls.length + ' URLs submitted' : urls[0];
41
42 $('.result-urls').empty().append($('<strong>').text('Submitted:')).append(document.createTextNode(' ' + urlsDisplay));
43
44 if (response.success) {
45 $('.result-status-code').text('�
46 Success').css('color', '#4caf50');
47 $('.result-message').text(response.message || 'URLs successfully submitted to IndexNow.');
48 } else {
49 $('.result-status-code').text('❌ Error').css('color', '#f44336');
50 $('.result-message').text(response.message || 'Failed to submit URLs. Please check your API key configuration.');
51 }
52
53 // Show response details if available
54 if (response.response_code) {
55 var $msg = $('.result-message');
56 $msg.text($msg.text() + ' Response Code: ' + response.response_code);
57 }
58 })
59 .fail(function (xhr, status, error) {
60 $response.show();
61 $('.result-urls').empty().append($('<strong>').text('Error'));
62 $('.result-status-code').text('❌ Request Failed').css('color', '#f44336');
63 $('.result-message').text('Network error: ' + error);
64 })
65 .always(function () {
66 // Re-enable button
67 $button.html(originalText).prop('disabled', false);
68 });
69 });
70 });
71