1(function ($) { 2 3 $(document).ready(function () { 4 // hydra-booking-insights-data-we-collect hide 5 $('.hydra-booking-insights-data-we-collect').parents('.updated').find('p.description').hide(); 6 7 }); 8 9 10 jQuery(document).ready(function($) { 11 $('.tfhb-plugin-button').not('.pro').on('click', function(e) { 12 e.preventDefault(); 13 14 let button = $(this); 15 let action = button.data('action'); 16 let pluginSlug = button.data('plugin'); 17 let pluginFileName = button.data('plugin_filename'); 18 19 if (!action || !pluginSlug) return; 20 21 let loader = button.find('.loader'); 22 let originalText = button.clone().children().remove().end().text().trim(); 23 24 if (action === 'install') { 25 button.contents().first().replaceWith('Installing..'); 26 } else if (action === 'activate') { 27 button.contents().first().replaceWith('Activating..'); 28 } 29 30 button.addClass('loading').prop('disabled', true); 31 loader.show(); 32 33 $.ajax({ 34 url: ajaxurl, 35 type: 'POST', 36 data: { 37 action: 'tfhb_hydra_manage_plugin', 38 security: tfhb_core_apps.rest_nonce, 39 plugin_slug: pluginSlug, 40 plugin_filename: pluginFileName, 41 plugin_action: action 42 }, 43 success: function(response) { 44 button.removeClass('loading').prop('disabled', false); 45 loader.hide(); 46 47 if (response.success) { 48 if (action === 'install') { 49 button.contents().first().replaceWith('Activate'); 50 button.data('action', 'activate').removeClass('install').addClass('activate'); 51 } else if (action === 'activate') { 52 button.replaceWith('<span class="tfhb-plugin-button plugin-status active">Activated</span>'); 53 } 54 } else { 55 button.contents().first().replaceWith(originalText); 56 alert('Error: ' + response.data); 57 } 58 }, 59 error: function() { 60 button.contents().first().replaceWith(originalText).removeClass('loading').prop('disabled', false); 61 loader.hide(); 62 alert('An error occurred. Please try again.'); 63 } 64 }); 65 }); 66 }); 67 68 $(document).ready(function() { 69 // Open Upgrade to Pro link in new tab 70 $('a[href="https://hydrabooking.com/"]').attr('target', '_blank'); 71 }); 72 73})(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.