1document.addEventListener('DOMContentLoaded', function () { 2 3 const lang = document.documentElement.lang.toLowerCase(); 4 5 const translations = { 6 es: { 7 'This field is required.': 8 'Este campo es obligatorio.', 9 10 'Please enter a valid email address.': 11 'Ingresa una dirección de correo electrónico válida.', 12 13 'Please enter an email address.': 14 'Ingresa una dirección de correo electrónico.', 15 16 'Please enter a URL.': 17 'Ingresa una URL válida.', 18 19 'Please enter a telephone number.': 20 'Ingresa un número de teléfono válido.', 21 22 'Please enter a number.': 23 'Ingresa un número válido.', 24 25 'The answer to the quiz is incorrect.': 26 'La respuesta es incorrecta.', 27 28 'The file is too big.': 29 'El archivo es demasiado grande.', 30 31 'You are not allowed to upload files of this type.': 32 'No se permite cargar archivos de este tipo.', 33 34 'There was an unknown error uploading the file.': 35 'Ocurrió un error desconocido al cargar el archivo.', 36 37 'There was an error uploading the file.': 38 'Ocurrió un error al cargar el archivo.', 39 40 'One or more fields have an error. Please check and try again.': 41 'Uno o más campos contienen errores. RevÃsalos e inténtalo de nuevo.', 42 43 'There was an error trying to send your message. Please try again later.': 44 'Ocurrió un error al enviar tu mensaje. Inténtalo de nuevo más tarde.', 45 46 'Thank you for your message. It has been sent.': 47 'Gracias. Tu mensaje se ha enviado correctamente.' 48 }, 49 50 fa: { 51 'This field is required.': 52 'تک٠Û٠اÛÙ ÙÛÙØ¯ Ø§ÙØ²Ø§Ù Û Ø§Ø³Øª.', 53 54 'Please enter a valid email address.': 55 'ÙØ·Ùا٠ÛÚ© آدرس اÛÙ Û٠٠عتبر ÙØ§Ø±Ø¯ Ú©ÙÛØ¯.', 56 57 'Please enter an email address.': 58 'ÙØ·Ùا٠ÛÚ© آدرس اÛÙ ÛÙ ÙØ§Ø±Ø¯ Ú©ÙÛØ¯.', 59 60 'Please enter a URL.': 61 'ÙØ·Ùا٠ÛÚ© آدرس اÛÙØªØ±ÙØªÛ Ù Ø¹ØªØ¨Ø± ÙØ§Ø±Ø¯ Ú©ÙÛØ¯.', 62 63 'Please enter a telephone number.': 64 'ÙØ·Ùا٠ÛÚ© ش٠ار٠تÙÙ٠٠عتبر ÙØ§Ø±Ø¯ Ú©ÙÛØ¯.', 65 66 'Please enter a number.': 67 'ÙØ·Ùا٠ÛÚ© عدد ٠عتبر ÙØ§Ø±Ø¯ Ú©ÙÛØ¯.', 68 69 'The answer to the quiz is incorrect.': 70 'پاسخ صØÛØ ÙÛØ³Øª.', 71 72 'The file is too big.': 73 'ØØ¬Ù ÙØ§ÛÙ Ø¨ÛØ´ از ØØ¯ ٠جاز است.', 74 75 'You are not allowed to upload files of this type.': 76 'Ø¨Ø§Ø±Ú¯Ø°Ø§Ø±Û Ø§ÛÙ ÙÙØ¹ ÙØ§Û٠٠جاز ÙÛØ³Øª.', 77 78 'There was an unknown error uploading the file.': 79 'ÙÙÚ¯Ø§Ù Ø¨Ø§Ø±Ú¯Ø°Ø§Ø±Û ÙØ§ÛÙ Ø®Ø·Ø§Û ÙØ§Ø´ÙاختÙâØ§Û Ø±Ø® داد.', 80 81 'There was an error uploading the file.': 82 'ÙÙÚ¯Ø§Ù Ø¨Ø§Ø±Ú¯Ø°Ø§Ø±Û ÙØ§Û٠خطاÛÛ Ø±Ø® داد.', 83 84 'One or more fields have an error. Please check and try again.': 85 'ÛÚ© ÛØ§ ÚÙØ¯ ÙÛÙØ¯ Ø¯Ø§Ø±Ø§Û Ø®Ø·Ø§ است. ÙØ·Ùا٠آÙâÙØ§ را Ø¨Ø±Ø±Ø³Û Ú©Ø±Ø¯Ù Ù Ø¯ÙØ¨Ø§Ø±Ù ØªÙØ§Ø´ Ú©ÙÛØ¯.', 86 87 'There was an error trying to send your message. Please try again later.': 88 'ÙÙÚ¯Ø§Ù Ø§Ø±Ø³Ø§Ù Ù¾ÛØ§Ù خطاÛÛ Ø±Ø® داد. ÙØ·ÙØ§Ù Ø¨Ø¹Ø¯Ø§Ù Ø¯ÙØ¨Ø§Ø±Ù ØªÙØ§Ø´ Ú©ÙÛØ¯.', 89 90 'Thank you for your message. It has been sent.': 91 '٠تشکرÛÙ . Ù¾ÛØ§Ù ش٠ا با Ù ÙÙÙÛØª ارسا٠شد.' 92 } 93 }; 94 95 const currentLang = 96 lang.startsWith('es') ? 'es' : 97 lang.startsWith('fa') ? 'fa' : 98 null; 99 100 if (!currentLang) return; 101 102 const strings = translations[currentLang]; 103 104 function translateCF7Messages() { 105 document.querySelectorAll( 106 '.wpcf7-not-valid-tip, .wpcf7-response-output' 107 ).forEach(function (el) { 108 109 const text = el.textContent.trim(); 110 111 if (strings[text]) { 112 el.textContent = strings[text]; 113 } 114 115 }); 116 } 117 118 // Existing messages 119 translateCF7Messages(); 120 121 // CF7 dynamically adds validation messages 122 const observer = new MutationObserver(function () { 123 translateCF7Messages(); 124 }); 125 126 observer.observe(document.body, { 127 childList: true, 128 subtree: true 129 }); 130 131}); 132 133document.addEventListener('DOMContentLoaded', function () { 134 135 const menuItems = document.querySelectorAll( 136 '.wp-block-navigation-item.has-child' 137 ); 138
139 menuItems.forEach(function (item) { 140 141 const link = item.querySelector(':scope > a'); 142 143 if (!link) return; 144 145 link.addEventListener('pointerdown', function (e) { 146 147 // Mouse tetap pakai behavior desktop biasa 148 if (e.pointerType === 'mouse') return; 149 150 // Kalau submenu belum terbuka: 151 // tap pertama cuma buka submenu 152 if (!item.classList.contains('is-touch-open')) { 153 154 e.preventDefault(); 155 156 // Tutup submenu lain 157 menuItems.forEach(function (otherItem) { 158 if (otherItem !== item) { 159 otherItem.classList.remove('is-touch-open'); 160 } 161 }); 162 163 item.classList.add('is-touch-open'); 164 } 165 166 // Kalau sudah terbuka, tap berikutnya 167 // dibiarkan mengikuti href parent 168 }); 169 }); 170 171 // Tap di luar menu â tutup submenu 172 document.addEventListener('pointerdown', function (e) { 173 174 if (e.pointerType === 'mouse') return; 175 176 if (!e.target.closest('.wp-block-navigation')) { 177 menuItems.forEach(function (item) { 178 item.classList.remove('is-touch-open'); 179 }); 180 } 181 }); 182 183}); 184 185document.addEventListener('DOMContentLoaded', function () { 186 187 const menuItems = document.querySelectorAll( 188 '.wp-block-navigation-item.has-child' 189 ); 190 191 menuItems.forEach(function (item) { 192 193 item.addEventListener('pointerenter', function (e) { 194 if (e.pointerType === 'pen') { 195 item.classList.add('is-pen-hover'); 196 } 197 }); 198 199 item.addEventListener('pointerleave', function (e) { 200 if (e.pointerType === 'pen') { 201 item.classList.remove('is-pen-hover'); 202 } 203 }); 204 205 }); 206 207});
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.