PageSourceSearch

https://abruzzoturismo.it/modules/custom/design-comuni-drupal-theme/comuni_theme/js/custom.js?v=1.x

js abruzzoturismo.it collected 2026-10-01 12:17:40 UTC 20,377 bytes, 1,122 lines download raw bytes

1document.addEventListener('DOMContentLoaded', function() {
2
3const urlMap = {
4
5'https://www.abruzzoturismo.it/it/parchi-e-natura': 'https://www.abruzzoturismo.it/parchi-e-natura',
6
7'https://www.abruzzoturismo.it/it/mare': 'https://www.abruzzoturismo.it/mare',
8
9'https://abruzzoturismo.it/it/montagna-invernale': 'https://www.abruzzoturismo.it/montagna-invernale',
10
11'https://abruzzoturismo.it/it/montagna-estiva': 'https://www.abruzzoturismo.it/montagna-estiva',
12
13'https://abruzzoturismo.it/it/vacanza-attiva': 'https://www.abruzzoturismo.it/vacanza-attiva',
14
15'https://abruzzoturismo.it/it/borghi': 'https://www.abruzzoturismo.it/borghi-e-citta-darte',
16
17'https://abruzzoturismo.it/it/arte-fede-e-cultura': 'https://www.abruzzoturismo.it/arte-fede-e-cultura',
18
19'https://www.abruzzoturismo.it/it/enogastronomia': 'https://www.abruzzoturismo.it/enogastronomia',
20
21'https://www.abruzzoturismo.it/it/uffici-iat': 'https://www.abruzzoturismo.it/uffici-iat',
22
23'https://www.abruzzoturismo.it/index.php/it/museo-del-montonico-bisenti-te': 'https://www.abruzzoturismo.it/destinazioni/museo-del-montonico-bisenti'
24
25};
26
27
28
29const currentURL = window.location.href;
30
31const isDestination = Object.values(urlMap).includes(currentURL);
32
33
34
35// Se l'URL corrente è uno degli URL nella mappa, nascondi il corpo della pagina
36
37if (urlMap.hasOwnProperty(currentURL)) {
38
39document.body.style.display = "none";
40
41}
42
43
44
45if (urlMap.hasOwnProperty(currentURL) && !isDestination) {
46
47window.stop();
48
49window.location.href = urlMap[currentURL];
50
51} else {
52
53document.body.style.display = "block";
54
55}
56
57});
58
59
60
61
62
63
64
65jQuery(document).ready(function() {
66
67// Controlla l'URL della pagina corrente
68
69if (window.location.href.indexOf("/node/1533") > -1 || window.location.href.indexOf("/mappa-generale") > -1) {
70
71// Sostituisci 'NID' con l'ID del nodo per cui vuoi nascondere l'header e il footer
72
73jQuery('.it-header-wrapper').hide();
74
75jQuery('.it-footer').hide();
76
77}
78
79});
80
81
82
83// START ANTEPRIMA VIDEO
84
85jQuery(document).ready(function($) {
86
87$('.video-link').magnificPopup({
88
89type: 'iframe'
90
91});
92
93});
94
95// END
96
97
98
99jQuery(document).ready(function() {
100
101// Inizializzazione dello slider slick
102
103jQuery('.slick-slider').slick({
104
105slidesToShow: 3,
106
107slidesToScroll: 1,
108
109dots: true,
110
111infinite: false,
112
113centerMode: false,
114
115responsive: [
116
117{
118
119breakpoint: 768,
120
121settings: {
122
123slidesToShow: 2
124
125}
126
127},
128
129{
130
131breakpoint: 576,
132
133settings: {
134
135slidesToShow: 1
136
137}
138
139}
140
141]
142
143});
144
145
146
147// Inizializzazione di Magnific Popup per le immagini
148
149jQuery('.image-popup').magnificPopup({
150
151type: 'image',
152
153closeOnContentClick: true,
154
155mainClass: 'mfp-img-mobile',
156
157image: {
158
159verticalFit: true
160
161},
162
163gallery: {
164
165disableOn: 900,
166
167enabled: true,
168
169navigateByImgClick: true,
170
171arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
172
173tPrev: 'Previous',
174
175tNext: 'Next',
176
177tCounter: ''
178
179}
180
181});
182
183});
184
185
186
187//START REDIRECT GOOGLE MAPS DA CONTENUTO
188
189jQuery(document).ready(function() {
190
191// Verifica se l'utente si trova all'interno del contenuto desiderato
192
193var $contentDestination = jQuery('#content-destination');
194
195if ($contentDestination.length > 0) {
196
197// Trova l'elemento con la classe "leaflet-marker-icon" all'interno del contenuto
198
199var $mapIcon = $contentDestination.find('.leaflet-marker-icon');
200
201
202
203// Verifica se esiste almeno un elemento con la classe "leaflet-marker-icon"
204
205if ($mapIcon.length > 0) {
206
207// Estrapola le coordinate di latitudine e longitudine dal titolo dell'elemento img
208
209var coordinates = $mapIcon.attr('title');
210
211var [latitude, longitude] = coordinates.split(', ');
212
213
214
215// Aggiungi un gestore di eventi al clic sull'icona della mappa
216
217$mapIcon.on('click', function () {
218
219// Crea l'URL di Google Maps con le coordinate
220
221var url = 'https://www.google.com/maps/search/?api=1&query=' + encodeURIComponent(latitude + ',' + longitude);
222
223
224
225// Apri Google Maps in una nuova scheda del browser
226
227window.open(url, '_blank');
228
229});
230
231}
232
233}
234
235});
236
237//END REDIRECT
238
239
240
241
242
243//START INIZIO FUNZIONE STAMPA
244
245function printPage() {
246
247window.print();
248
249}
250
251
252
253document.addEventListener('DOMContentLoaded', function() {
254
255const printButton = document.querySelector('.print-ab');
256
257
258if (printButton) { // controlla se l'elemento esiste
259
260printButton.addEventListener('click', function(e) {
261
262e.preventDefault();
263
264printPage();
265
266});
267
268}
269
270});
271
272//END FUNZIONE STAMPA
273
274
275
276//START CONDIVISIONE
277
278function condividiSuFacebook() {
279
280var url = window.location.href;
281
282var facebookUrl = 'https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(url);
283
284window.open(facebookUrl, '_blank');
285
286}
287
288
289
290function condividiSuTwitter() {
291
292var url = window.location.href;
293
294var twitterUrl = 'https://twitter.com/share?url=' + encodeURIComponent(url);
295
296window.open(twitterUrl, '_blank');
297
298}
299
300
301
302function condividiSuLinkedIn() {
303
304var url = window.location.href;
305
306var linkedinUrl = 'https://www.linkedin.com/shareArticle?url=' + encodeURIComponent(url);
307
308window.open(linkedinUrl, '_blank');
309
310}
311
312
313
314function condividiSuWhatsApp() {
315
316var url = window.location.href;
317
318var whatsappUrl = 'https://api.whatsapp.com/send?text=' + encodeURIComponent(url);
319
320window.open(whatsappUrl, '_blank');
321
322}
323
324//END CONDIVISIONE
325
326
327
328
329
330jQuery('#myModal').on('shown.bs.modal', function (e) {
331
332jQuery('[data-drupal-selector="edit-field-esperienze"]').select2({ dropdownParent: jQuery('#myModal') });
333
334jQuery('[data-drupal-selector="edit-field-cultura"]').select2({ dropdownParent: jQuery('#myModal') });
335
336jQuery('[data-drupal-selector="edit-field-info-e-guide"]').select2({ dropdownParent: jQuery('#myModal') });
337
338jQuery('[data-drupal-selector="edit-field-sport"]').select2({ dropdownParent: jQuery('#myModal') });
339
340jQuery('[data-drupal-selector="edit-field-stagioni"]').select2({ dropdownParent: jQuery('#myModal') });
341
342jQuery('[data-drupal-selector="edit-field-target"]').select2({ dropdownParent: jQuery('#myModal') });
343
344jQuery('[data-drupal-selector="edit-type"]').select2({ dropdownParent: jQuery('#myModal') });
345
346jQuery('[data-drupal-selector="edit-field-valori"]').select2({ dropdownParent: jQuery('#myModal') });
347
348});
349
350
351
352jQuery(document).ready(function() {
353
354jQuery('#edit-tipo-contenuto-mappa-generale').select2();
355
356jQuery('#edit-field-argomenti-target-id-entityreference-filter-itinerari').select2();
357
358jQuery('#edit-field-argomenti-target-id-entityreference-filter-eventi').select2();
359
360jQuery('#edit-field-provincia-iat ').select2();
361
362jQuery('#edit-field-provincia-target-id').select2();
363
364jQuery('#edit-field-tipo-struttura-target-id').select2();
365
366jQuery('[data-drupal-selector="edit-field-esperienze"]').select2();
367
368jQuery('[data-drupal-selector="edit-field-cultura"]').select2();
369
370jQuery('[data-drupal-selector="edit-field-info-e-guide"]').select2();
371
372jQuery('[data-drupal-selector="edit-field-sport"]').select2();
373
374jQuery('[data-drupal-selector="edit-field-stagioni"]').select2();
375
376jQuery('[data-drupal-selector="edit-field-target"]').select2();
377
378jQuery('[data-drupal-selector="edit-type"]').select2();
379
380jQuery('[data-drupal-selector="edit-field-valori"]').select2();
381
382jQuery('#edit-field-argomenti-target-id').select2();
383
384});
385
386
387
388document.addEventListener('DOMContentLoaded', function() {
389
390const filterBlockList = document.getElementById('views-exposed-form-itinerari-page-lista-itinerari-page');
391
392const eventFilterBlockList = document.getElementById('views-exposed-form-eventi-page-lista-eventi-page');
393
394const pagnoneElement = document.querySelector('.pagnone');
395
396if (pagnoneElement) {
397
398const pagerElement = pagnoneElement.querySelector('.pager');
399
400if (pagerElement) {
401
402pagerElement.style.display = 'none';
403
404}
405
406}
407
408
409if (filterBlockList) { // controlla se l'elemento esiste
410
411filterBlockList.style.display = "none";
412
413}
414
415
416if (eventFilterBlockList) { // controlla se l'elemento esiste
417
418eventFilterBlockList.style.display = "none";
419
420}
421
422});
423
424
425
426
427
428document.addEventListener('DOMContentLoaded', function() {
429
430// Seleziona l'elemento <a> per l'italiano
431
432var itLinkElement = document.querySelector('.language-switcher-language-url .it a');
433
434if (itLinkElement) {
435
436itLinkElement.innerHTML = '<img alt="Italian" src="/sites/default/files/languages/ita.png" style="margin-right:5px; cursor:pointer;" class="icon icon-sm icon-primary left" title="Italian"><span>Italiano</span>';
437
438}
439
440
441
442// Seleziona l'elemento <a> per l'inglese
443
444var enLinkElement = document.querySelector('.language-switcher-language-url .en a');
445
446if (enLinkElement) {
447
448enLinkElement.innerHTML = '<img alt="English" src="/sites/default/files/languages/eng.png" style="margin-right:5px; cursor:pointer;" class="icon icon-sm icon-primary left" title="English"><span>Inglese</span>';
449
450}
451
452
453
454// Seleziona l'elemento <a> per il tedesco
455
456var deLinkElement = document.querySelector('.language-switcher-language-url .de a');
457
458if (deLinkElement) {
459
460deLinkElement.innerHTML = '<img alt="German" src="/sites/default/files/languages/de.png" style="margin-right:5px; cursor:pointer;" class="icon icon-sm icon-primary left" title="German"><span>Tedesco</span>';
461
462}
463
464});
465
466
467
468jQuery(document).ready(function() {
469
470// Seleziona gli elementi <a> all'interno di #infointinerario
471
472jQuery('#infointinerario a').each(function() {
473
474// Crea un nuovo elemento <li>
475
476var liElement = jQuery('<li>');
477
478// Copia il testo dell'elemento <a> nel nuovo elemento <li>
479
480liElement.text(jQuery(this).text());
481
482// Sostituisci l'elemento <a> con il nuovo elemento <li>
483
484jQuery(this).replaceWith(liElement);
485
486});
487
488}
488);
489
490
491
492
493
494jQuery(document).ready(function() {
495
496// Seleziona l'elemento <div> con la classe specifica
497
498var attributionDiv = jQuery('.leaflet-control-attribution');
499
500
501
502// Sostituisci il testo con il nuovo testo desiderato
503
504attributionDiv.html('Cliccando sul marcatore, sarete reindirizzati a Google Maps.');
505
506});
507
508
509
510
511
512function traduciVociETermini() {
513
514var lingua;
515
516
517
518// Ottenere la parte della URL che indica la lingua
519
520var url = window.location.href;
521
522if (url.includes('/de/')) {
523
524lingua = 'tedesco';
525
526} else if (url.includes('/en/')) {
527
528lingua = 'inglese';
529
530} else {
531
532lingua = 'italiano';
533
534}
535
536
537
538// Definire le traduzioni per ogni lingua
539
540var traduzioni = {
541
542italiano: {
543
544'- Qualsiasi -': '- Qualsiasi -',
545
546'Destinazione': 'Destinazione',
547
548'Dove Dormire': 'Dove Dormire',
549
550'Evento': 'Evento',
551
552'Impianto Sciistico': 'Impianto Sciistico',
553
554'Itinerario': 'Itinerario',
555
556'Ufficio IAT': 'Ufficio IAT',
557
558'Articolo Magazine': 'Articolo Magazine',
559
560'Stazione Sciistica Bollettino Neve': 'Stazione Sciistica Bollettino Neve',
561
562'ESPERIENZE': 'ESPERIENZE',
563
564'CULTURA': 'CULTURA',
565
566'INFO E GUIDE': 'INFO E GUIDE',
567
568'SPORT': 'SPORT',
569
570'STAGIONI': 'STAGIONI',
571
572'TARGET': 'TARGET',
573
574'VALORI': 'VALORI',
575
576'TIPOLOGIE': 'TIPOLOGIE',
577
578'TIPOLOGIA': 'TIPOLOGIA',
579
580'Ricerca': 'Ricerca',
581
582'Carica altri risultati': 'Carica altri risultati',
583
584'Cliccando sul marcatore, sarete reindirizzati a Google Maps.': 'Cliccando sul marcatore, sarete reindirizzati a Google Maps.',
585
586'Italiano': 'Italiano',
587
588'Tedesco': 'Tedesco',
589
590'Inglese': 'Inglese',
591
592'Cliccando sul marcatore, sarete reindirizzati a Google Maps.': 'Cliccando sul marcatore, sarete reindirizzati a Google Maps.',
593
594'La ricerca non ha prodotto risultati.': 'La ricerca non ha prodotto risultati.'
595
596},
597
598inglese: {
599
600'- Qualsiasi -': '- Any -',
601
602'Destinazione': 'Destination',
603
604'Dove Dormire': 'Where to Stay',
605
606'Evento': 'Event',
607
608'Impianto Sciistico': 'Ski Resort',
609
610'Itinerario': 'Itinerary',
611
612'Ufficio IAT': 'Tourist Information Office',
613
614'Articolo Magazine': 'Article Magazine',
615
616'Stazione Sciistica Bollettino Neve': 'Ski Resort Snow Report',
617
618'ESPERIENZE': 'EXPERIENCES',
619
620'CULTURA': 'CULTURE',
621
622'INFO E GUIDE': 'INFO AND GUIDES',
623
624'SPORT': 'SPORT',
625
626'STAGIONI': 'SEASONS',
627
628'TARGET': 'TARGET',
629
630'VALORI': 'VALUES',
631
632'TIPOLOGIE': 'TYPES',
633
634'TIPOLOGIA': 'TYPE',
635
636'Ricerca': 'Search',
637
638'Carica altri risultati': 'Load more results',
639
640'Cliccando sul marcatore, sarete reindirizzati a Google Maps.': 'Clicking on the marker will redirect you to Google Maps.',
641
642'Italiano': 'Italian',
643
644'Tedesco': 'German',
645
646'Inglese': 'English',
647
648'Cliccando sul marcatore, sarete reindirizzati a Google Maps.': 'By clicking on the marker, you will be redirected to Google Maps.',
649
650'La ricerca non ha prodotto risultati.': 'The search did not produce any results.'
651
652},
653
654tedesco: {
655
656'- Qualsiasi -': '- Beliebig -',
657
658'Destinazione': 'Ziel',
659
660'Dove Dormire': 'Unterkunft',
661
662'Evento': 'Veranstaltung',
663
664'Impianto Sciistico': 'Skigebiet',
665
666'Itinerario': 'Reiseroute',
667
668'Ufficio IAT': 'Touristeninformation',
669
670'Articolo Magazine': 'Artikel Magazin',
671
672'Stazione Sciistica Bollettino Neve': 'Skigebiet Schneebericht',
673
674'ESPERIENZE': 'ERLEBNISSE',
675
676'CULTURA': 'KULTUR',
677
678'INFO E GUIDE': 'INFO UND LEITFÄDEN',
679
680'SPORT': 'SPORT',
681
682'STAGIONI': 'JAHRESZEITEN',
683
684'TARGET': 'ZIELGRUPPE',
685
686'VALORI': 'WERTE',
687
688'TIPOLOGIE': 'TYPEN',
689
690'TIPOLOGIA': 'TYP',
691
692'Ricerca': 'Suche',
693
694'Carica altri risultati': 'Weitere Ergebnisse laden',
695
696'Cliccando sul marcatore, sarete reindirizzati a Google Maps.': 'Durch Klicken auf den Marker werden Sie zu Google Maps weitergeleitet.',
697
698'Italiano': 'Italienisch',
699
700'Tedesco': 'Deutsch',
701
702'Inglese': 'Englisch',
703
704'Cliccando sul marcatore, sarete reindirizzati a Google Maps.': 'Wenn Sie auf den Marker klicken, werden Sie zu Google Maps weitergeleitet.',
705
706'La ricerca non ha prodotto risultati.': 'Die Suche ergab keine Ergebnisse.'
707
708}
709
710};
711
712
713
714// Selezionare gli elementi contenenti le voci della select
715
716var vociDaTradurre = document.querySelectorAll('select option');
717
718
719
720// Tradurre le voci in base alla lingua corrente
721
722for (var i = 0; i < vociDaTradurre.length; i++) {
723
724var voce = vociDaTradurre[i];
725
726var testoVoce = voce.innerText.trim();
727
728
729
730if (traduzioni[lingua][testoVoce]) {
731
732voce.innerText = traduzioni[lingua][testoVoce];
733
734}
735
736}
737
738
739var elementiDaTradurre = document.querySelectorAll('.leaflet-control');
740
741
742
743for (var i = 0; i < elementiDaTradurre.length; i++) {
744
745var elemento = elementiDaTradurre[i];
746
747var testoElemento = elemento.innerText.trim();
748
749
750
751if (traduzioni[lingua][testoElemento]) {
752
753elemento.innerText = traduzioni[lingua][testoElemento];
754
755}
756
757}
758
759
760var elementiDaTradurre = document.querySelectorAll('.view-empty');
761
762
763
764// Tradurre il testo di ciascun elemento in base alla lingua corrente
765
766for (var i = 0; i < elementiDaTradurre.length; i++) {
767
768var elemento = elementiDaTradurre[i];
769
770var testoElemento = elemento.innerText.trim();
771
772
773
774if (traduzioni[lingua][testoElemento]) {
775
776elemento.innerText = traduzioni[lingua][testoElemento];
777
778}
779
780}
781
782
783
784// Selezionare gli elementi contenenti i label da tradurre
785
786var labelDaTradurre = document.querySelectorAll('fieldset label');
787
788
789
790// Tradurre i label in base alla lingua corrente
791
792for (var j = 0; j < labelDaTradurre.length; j++) {
793
794var label = labelDaTradurre[j];
795
796var testoLabel = label.innerText.trim();
797
798
799
800if (traduzioni[lingua][testoLabel]) {
801
802label.innerText = traduzioni[lingua][testoLabel];
803
804}
805
806}
807
808
809
810// Selezionare gli elementi label da tradurre
811
812var labelsDaTradurre = document.querySelectorAll('.js-form-item-type label, .js-form-item-field-esperienze label, .js-form-item-field-cultura label, .js-form-item-field-info-e-guide label, .js-form-item-field-sport label, .js-form-item-field-stagioni label, .js-form-item-field-target label, .js-form-item-field-valori label');
813
814
815
816// Tradurre i label in base alla lingua corrente
817
818for (var k = 0; k < labelsDaTradurre.length; k++) {
819
820var labelDaTradurre = labelsDaTradurre[k];
821
822var testoLabel = labelDaTradurre.innerText.trim();
823
824
825
826if (traduzioni[lingua][testoLabel]) {
827
828labelDaTradurre.innerText = traduzioni[lingua][testoLabel];
829
830}
831
832}
833
834
835
836// Seleziona l'elemento del titolo "Tipologie"
837
838var titoloTipologie = document.querySelector('.category-list__title');
839
840
841
842// Traduci il titolo "Tipologie" in base alla lingua corrente
843
844if (titoloTipologie) {
845
846var testoTitolo = titoloTipologie.innerText.trim();
847
848
849
850if (traduzioni[lingua][testoTitolo]) {
851
852titoloTipologie.innerText = traduzioni[lingua][testoTitolo];
853
854}
855
856}
857
858
859
860// Seleziona l'elemento di input "Ricerca"
861
862var inputRicerca = document.getElementById('search_api_fulltext');
863
864
865
866// Traduci il placeholder dell'elemento di input in base alla lingua corrente
867
868if (inputRicerca) {
869
870var linguaCorrente = traduzioni[lingua];
871
872if (linguaCorrente && linguaCorrente['Ricerca']) {
873
874inputRicerca.placeholder = linguaCorrente['Ricerca'];
875
876}
877
878}
879
880
881
882// Seleziona l'elemento contenente il testo "Carica altri risultati"
883
884var spanCaricaRisultati = document.querySelector('.js-pager__items .text-button');
885
886
887
888// Traduci il testo "Carica altri risultati" in base alla lingua corrente
889
890if (spanCaricaRisultati) {
891
892var testoCaricaRisultati = spanCaricaRisultati.innerText.trim();
893
894
895
896if (traduzioni[lingua][testoCaricaRisultati]) {
897
898spanCaricaRisultati.innerText = traduzioni[lingua][testoCaricaRisultati];
899
900}
901
902}
903
904
905
906// Seleziona gli elementi che contengono i termini da tradurre
907
908var terminiDaTradurre = document.querySelectorAll('.link-list .language-link span');
909
910
911
912// Traduci i termini in base alla lingua corrente
913
914for (var m = 0; m < terminiDaTradurre.length; m++) {
915
916var termine = terminiDaTradurre[m];
917
918var testoTermine = termine.innerText.trim();
919
920
921
922if (traduzioni[lingua][testoTermine]) {
923
924termine.innerText = traduzioni[lingua][testoTermine];
925
926}
927
928}
929
930}
931
932
933
934// Chiamare la funzione per tradurre le voci e i termini quando il contenuto della pagina è stato caricato
935
936document.addEventListener('DOMContentLoaded', function() {
937
938traduciVociETermini();
939
940});
941
942
943
944// Assicurati che il DOM sia pronto per essere manipolato
945
946jQuery(document).ready(function() {
947
948// Seleziona il primo nav.pager all'interno di .mappa-dove-dormire utilizzando jQuery
949
950const firstPagerInMappa = jQuery('.mappa-dove-dormire nav.pager').first();
951
952
953
954// Nascondi l'elemento pager selezionato utilizzando il metodo hide() di jQuery
955
956firstPagerInMappa.hide();
957
958});
959
960
961
962// Attendi che il DOM sia completamente caricato
963
964document.addEventListener('DOMContentLoaded', function() {
965
966
967// Trova l'elemento <li> che contiene l'elemento <ul> e il pulsante "Esegui cron"
968
969var liElement = document.querySelector('.toolbar-icon-admin-toolbar-tools-flush');
970
971var cronButton = document.querySelector('.toolbar-icon-system-run-cron');
972
973
974if (liElement !== null && cronButton !== null) {
975
976liElement = liElement.closest('li');
977
978cronButton = cronButton.closest('li');
979
980
981// Nascondi sempre l'elemento <ul> e il pulsante "Esegui cron"
982
983var ulElement = liElement.querySelector('.toolbar-menu');
984
985
986if (ulElement !== null) {
987
988ulElement.style.display = 'none!important';
989
990}
991
992
993cronButton.style.display = 'none!important';
994
995}
996
997});
998
999
1000
1001document.addEventListener('DOMContentLoaded', function() {
1002
1003// Referenza al modal
1004
1005
1006//var myModal = new bootstrap.Modal(document.getElementById('modal-categories'), {});
1007
1008var modalElem = document.getElementById('modal-categories');
1009
1010
1011// Pulsante per aprire il modal
1012
1013var openModalButton = document.getElementById('openModalButton');
1014
1015
1016// Pulsante per chiudere il modal
1017
1018var closeModalButton = document.getElementById('closeModalButton');
1019
1020
1021// Contenitore dei filtri
1022
1023var filtersContainer = document.getElementById('filters-container');
1024
1025
1026// Contenuto del modal
1027
1028//var modalBody = document.querySelector('#modal-categories .modal-body');
1029
1030
1031// Sidebar per desktop
1032
1033var sidebar = document.querySelector('.serach-ab-page');
1034
1035
1036// Procediamo solo se il modal esiste nella pagina corrente
1037
1038if (modalElem) {
1039
1040var myModal = new bootstrap.Modal(modalElem, {});
1041
1042var modalBody = modalElem.querySelector('.modal-body');
1043
1044
1045
1046// Evento per aprire il modal
1047
1048if (openModalButton) {
1049
1050openModalButton.addEventListener('click', function() {
1051
1052myModal.show();
1053
1054});
1055
1056}
1057
1058
1059
1060// Evento per chiudere il modal
1061
1062if (closeModalButton) {
1063
1064closeModalButton.addEventListener('click', function() {
1065
1066myModal.hide();
1067
1068});
1069
1070}
1071
1072
1073// Sposta i filtri nel modal quando si apre
1074
1075modalElem.addEventListener('show.bs.modal', function() {
1076
1077if (modalBody && filtersContainer) {
1078
1079modalBody.appendChild(filtersContainer);
1080
1081}
1082
1083});
1084
1085
1086
1087// Sposta i filtri nella sidebar quando si chiude
1088
1089modalElem.addEventListener('hidden.bs.modal', function() {
1090
1091if (sidebar && filtersContainer) {
1092
1093sidebar.appendChild(filtersContainer);
1094
1095}
1096
1097});
1098
1099
1100
1101// Quando il modal viene mostrato, sposta i filtri all'interno
1102
1103//document.querySelector('#modal-categories').addEventListener('show.bs.modal', function() {
1104
1105// modalBody.appendChild(filtersContainer);
1106
1107//});
1108
1109
1110
1111// Quando il modal viene nascosto, sposta i filtri nella sidebar (desktop)
1112
1113//document.querySelector('#modal-categories').addEventListener('hidden.bs.modal', function() {
1114
1115// sidebar.appendChild(filtersContainer);
1116
1117//});
1118
1119}
1120
1121}); 
1122

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.