1(function($){ 2'use strict'; 3 4const cfg=window.Cultiv8JobFormBridge||{}; 5if(!cfg.ajaxUrl){ 6 console.log('[Bridge] Config missing'); 7 return; 8} 9 10console.log('[Bridge] Loaded'); 11 12$(document).on('change','[name="'+cfg.jobSelectorField+'"]',function(){ 13 14 const jobId=parseInt($(this).val(),10)||0; 15 const $form=$(this).closest('form'); 16 const $hidden=$form.find('[name="'+cfg.equipmentHiddenField+'"]'); 17 18 console.log('[Bridge] Job changed:',jobId); 19 console.log('[Bridge] Hidden found:', $hidden.length); 20 21 if(!$hidden.length){ 22 return; 23 } 24 25 if(!jobId){ 26 $hidden.val('0').trigger('change').trigger('input'); 27 return; 28 } 29 30 $.post(cfg.ajaxUrl,{ 31 action:'cultiv8_job_equipment_status', 32 nonce:cfg.nonce, 33 job_id:jobId 34 }).done(function(resp){ 35 36 console.log('[Bridge] AJAX response',resp); 37 38 let enabled='0'; 39 if(resp && resp.success && resp.data && String(resp.data.enabled)==='1'){ 40 enabled='1'; 41 } 42 43 $hidden.val(enabled); 44 $hidden.trigger('input').trigger('change'); 45 46 console.log('[Bridge] Hidden updated:',enabled); 47 48 }).fail(function(xhr){ 49 console.error('[Bridge] AJAX failed',xhr.status,xhr.responseText); 50 }); 51 52}); 53 54})(jQuery);
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.