1jQuery(document).ready(function ($) { 2 // Store the original URL of each download button on page load 3 $('.woocommerce-MyAccount-downloads-file').each(function () { 4 var originalUrl = $(this).attr('href'); 5 $(this).data('original-url', originalUrl); // Save the original URL in a data attribute 6 }); 7 8 // Listen for changes in the dropdown 9 $('.download-version-dropdown').on('change', function () { 10 // Get the selected plugin URL 11 var pluginUrl = $(this).val(); 12 13 // Find the corresponding download button in the same table row 14 var $downloadButton = $(this).closest('tr').find('.woocommerce-MyAccount-downloads-file'); 15 16 // Check if the "Default version" is selected 17 if (!pluginUrl) { 18 // Restore the original URL 19 var originalUrl = $downloadButton.data('original-url'); 20 $downloadButton.attr('href', originalUrl); 21 } else { 22 // Update the href attribute of the download button to the selected plugin URL 23 $downloadButton.attr('href', pluginUrl); 24 } 25 }); 26});
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.