1/* Source and licensing information for the line(s) below can be found at https://www.justformen.com/modules/custom/combe_translations/js/combe_translations.js. */ 2(function ($) { 3 Drupal.behaviors.combe_translations = { 4 attach: function (context, drupalSettings) { 5 var emailInput = $("input[type='email']"); 6 var maxLength = 80; 7 // Set the maxlength attribute for the email input 8 emailInput.attr('maxlength', maxLength); 9 // Add input event listener to restrict input length 10 emailInput.on('input', function () { 11 // Truncate the input value if it exceeds the maximum length 12 if ($(this).val().length > maxLength) { 13 $(this).val($(this).val().substring(0, maxLength)); 14 } 15 }); 16 footerblockcookie = drupalSettings.combe_translations.footerblockcookie; 17 $(".close-btn").on("click", function () { 18 $("#block-seabondfooterblock").hide(); 19 $("#block-seabondfooterblock").addClass('hide-block'); 20 $("#block-seabondfooterblock.hide-block").hide(); 21 }); 22 23 if (footerblockcookie == 'yes') { 24 $("#block-seabondfooterblock").hide(); 25 } else { 26 $("#block-seabondfooterblock").show(); 27 } 28 29 // Enable/disable based on selection of Language List and Country site url in Country Vocabulary 30 const languageListSelector = ".taxonomy-term-country-form #edit-field-language-0-language-list"; 31 const countrySiteUrlSelector = ".taxonomy-term-country-form #edit-field-country-site-url-0-uri"; 32 33 // Function to toggle disabled class based on input value 34 function toggleDisabledState(inputElement, targetElement) { 35 let inputValue = jQuery(inputElement).val(); 36 //jQuery(targetElement).toggleClass('disabledClass', inputValue.length !== 0); 37 const $targetElement = jQuery(targetElement); 38 const shouldDisable = inputValue ? inputValue.length === 0 : true; 39 $targetElement.toggleClass('disabledClass', shouldDisable); 40 } 41 42 // Change event for languageList 43 jQuery(languageListSelector).change(function () { 44 toggleDisabledState(this, countrySiteUrlSelector); 45 }); 46 47 // Input event for countrySiteUrl 48 jQuery(countrySiteUrlSelector).on('input', function () { 49 toggleDisabledState(this, languageListSelector); 50 }); 51 52 // Initial check for countrySiteUrl value 53 toggleDisabledState(countrySiteUrlSelector, languageListSelector); 54 55 // Initial check for languageList value 56 toggleDisabledState(languageListSelector, countrySiteUrlSelector); 57 58 } 59 }; 60})(jQuery); 61 62/* Source and licensing information for the above line(s) can be found at https://www.justformen.com/modules/custom/combe_translations/js/combe_translations.js. */
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.