1function queryStringToObject(queryString) { 2 const pairs = queryString.substring(0).split('&'); 3 4 var array = pairs.map((el) => { 5 const parts = el.split('='); 6 return parts; 7 }); 8 9 return Object.fromEntries(array); 10} 11 12 jQuery(document).ajaxComplete(function(event, xhr, settings) { 13 14 let payload = queryStringToObject(settings.data); 15 if (payload.action === "et_fb_ajax_save") { 16 // Get the page ID from the body class 17 const pageId = document.querySelector('body').classList.value.match(/page-id-(\d+)/); 18 // Extract the page ID from the match 19 const pageIdValue = pageId ? pageId[1] : null; 20 // if (jQuery('#graphina_divibasetable').length > 0) { 21 jQuery('table[id^="graphina_divibasetable"]').each(function() { 22 var columnHeaders = []; 23 var showIndexValue = jQuery(this).attr('show_index'); 24 if (jQuery(this).find('thead').length > 0) { 25 jQuery(this).find('thead th').each(function(index) { 26 if(showIndexValue === "on" && index === 0 ){ 27 console.log("wrong Header"); 28 }else{ 29 columnHeaders.push(jQuery(this).text()); 30 } 31 }); 32 } 33 var tableRows = []; 34 jQuery(this).find('tbody tr').each(function() { 35 var rowData = []; 36 jQuery(this).find('td').each(function(index) { 37 if(showIndexValue === "on" && index === 0){ 38 console.log("wrong index"); 39 }else{ 40 rowData.push(jQuery(this).text()); 41 } 42 }); 43 tableRows.push(rowData); 44 }); 45 var table_id = jQuery(this).attr('grpid'); 46 var currentData = { 47 body: tableRows 48 }; 49 // Check if columnHeaders array is not empty and add it to currentData if it's not 50 if (columnHeaders.length > 0) { 51 currentData.headers = columnHeaders; 52 } 53 jQuery.ajax({ 54 url: window.et_fb_options.ajaxurl, 55 type: 'post', 56 data: { 57 type: 'datatable', 58 id: table_id, 59 page_id: pageIdValue, 60 action: 'savetabledata_divigraph', 61 security: graphina_divi_localize.nonce, 62 current_data: currentData 63 }, 64 success: function(response) { 65 console.log('Data saved for table ID: ' + table_id); 66 }, 67 error: function(xhr, status, error) { 68 console.error('Error saving data for table ID: ' + table_id); 69 } 70 }); 71 }); 72 } 73 74 // } 75});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.