PageSourceSearch

https://rastegarlawgroup.com/wp-content/themes/rastegar-law-group-child/assets/js/header.js?ver=1787087759

js rastegarlawgroup.com collected 2026-10-09 00:03:02 UTC 6,673 bytes, 207 lines download raw bytes

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.