1 2$(document).ready(function () { 3 function showLoading(btn) { 4 var btnHtml = btn.html(); // Store original button content 5 btn.data('original-html', btnHtml); // Save in data attribute 6 btn.html(`Please wait...`); // Show loading spinner 7 } 8 9 function hideLoading(btn) { 10 var btnHtml = btn.data('original-html'); // Retrieve stored content 11 if (btnHtml) { 12 btn.html(btnHtml); // Restore original button content 13 btn.removeData('original-html is-loading'); // Clean up attributes 14 } 15 } 16 17 // Capture button click and store reference 18 $(document).on('click', '.load-spinner', function () { 19 var btn = $(this); 20 btn.addClass('ajax-active'); // Mark as active button 21 }); 22 23 // Detect when AJAX starts and show spinner only on the clicked button 24 $(document).ajaxSend(function () { 25 var btn = $('.load-spinner.ajax-active').first(); // Get active button 26 if (btn.length) { 27 showLoading(btn); 28 } 29 }); 30 31 // Detect when AJAX completes and restore button 32 $(document).ajaxComplete(function () { 33 var btn = $('.load-spinner.ajax-active').first(); // Get active button 34 if (btn.length) { 35 hideLoading(btn); 36 btn.removeClass('ajax-active'); // Remove tracking class 37 } 38 }); 39});
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.