1jQuery(document).ready(function() { 2 jQuery('.mi-paywall-membership-button').on('click', function() { 3 let el = jQuery(this); 4 let currentContent = jQuery(this).next('.mi-paywall-content'); 5 let isAlreadyVisible = currentContent.is(':visible'); 6 let hasOpen = jQuery('.mi-paywall-membership-options > div.active').length; 7 jQuery('.mi-paywall-membership-options > div.active').removeClass('active'); 8 if(hasOpen == 1 && isAlreadyVisible){ 9 jQuery('.mi-paywall-content').slideUp(300); 10 } else { 11 jQuery('.mi-paywall-content').hide(); 12 jQuery("html").animate({ 13 scrollTop: el.offset().top - 50 14 }, 200); 15 } 16 if (!isAlreadyVisible) { 17 currentContent.slideDown(300); 18 currentContent.parent().addClass("active"); 19 } 20 }); 21 22 jQuery('.mi-paywall-membership-option input').on('change', function() { 23 let el = jQuery(this), elLink = el.closest('.mi-paywall-content').find('.mi-paywall-become-member-button a'); 24 if(elLink.length > 0){ 25 let url = new URL(elLink.attr("href")); 26 url.searchParams.set('offer_id', el.val()); 27 elLink.attr("href", url.toString()); 28 } 29 }); 30 31 jQuery('.change-user-count').on('click', function() { 32 let elInput = jQuery(this).closest('.user-count-wrapper').find('input[name="mi-paywall-offer-corporate"]'); 33 if(elInput.length > 0){ 34 let currentVal = elInput.val(), lastVal = null, type = (jQuery(this).hasClass('decrease') ? 'decrease' : 'increase'), values = elInput.data("values").split("|"), lastItemData = null, newItemData = null, el = jQuery(this), elLink = el.closest('.mi-paywall-content').find('.mi-paywall-become-member-button a'), elPrice = el.closest('.user-count-wrapper').find('.mi-paywall-price .price'); 35 if(values.length > 0){ 36 values.forEach(item => { 37 if(newItemData === null) { 38 itemData = item.split("-"); 39 if (itemData.length == 3) { 40 41 itemData[0] = parseInt(itemData[0]); 42 if (type == 'increase' && itemData[0] > currentVal) { 43 newItemData = itemData; 44 45 } else if (type == 'decrease' && itemData[0] >= currentVal && lastItemData !== null && lastItemData[0] < currentVal && lastItemData[0] < itemData[0]) { 46 newItemData = lastItemData; 47 } 48 49 lastItemData = itemData; 50 51 if(newItemData !== null) { 52 elInput.val(newItemData[0]); 53 let url = new URL(elLink.attr("href")); 54 url.searchParams.set('offer_id', newItemData[1]); 55 elLink.attr("href", url.toString()); 56 57 if(elPrice.length){ 58 elPrice.html(newItemData[2]); 59 } 60 } 61 } 62 } 63 }); 64 } 65 } 66 }); 67 68});
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.