PageSourceSearch

https://imasgal.com/wp-content/themes/bridge-child/js/menu-material.js

js imasgal.com collected 2026-09-25 06:15:23 UTC 3,555 bytes, 98 lines download raw bytes

1
2jQuery(function($) {
3
4    function customSearchFunction(){
5    
6        var x = document.getElementById("custom-search-input");
7        $j('.titulo-estracto').each(function() { if(!$j(this).text().normalize('NFD').replace(/\p{Diacritic}/gu, '').toLowerCase().includes( $j('#custom-search-input').val().toLowerCase()) ){$j(this).closest('article').hide();}else{$j(this).closest('article').show();} });
8        
9        $j('#div-empty').remove();
10        if( $j('article:visible').length == 0 ){
11           $j('.projects_holder').append('<div id="div-empty"><h4>No se han encontrado coincidencias</h4></div>');
12          }else{
13           $j('#div-empty').remove();
14          }
15        
16    }
17
18
19    $(document).ready(function() {
20   
21        if( $('#material-menu').length > 0 ){
22
23            const isMobile = isMobileFunction();
24            
25
26
27            $('head').append('<link rel="stylesheet" id="app-material-menu-css" href="https://imasgal.com/wp-content/themes/bridge-child/css/app-material-menu.css?1" type="text/css" media="all">');
28
29
30            let nav = $('#material-menu');
31            
32            let navOffsetTop = nav.offset().top;
33        
34            // $('#menu-cursos').prepend('<li id="search-item" class="menu-item"><i class="fa fa-search"></i><input id="custom-search-input" onkeyup="customSearchFunction()" onsearch="customSearchFunction()" type="search" /></li>');
35        
36            // $('#search-item i').on('click', function(){ $('#search-item').toggleClass('searching'); $('#custom-search-input').val(''); });
37        
38        
39            $(window).scroll(function() {
40
41                let setSticky = false;
42                if(!isMobile){
43                    setSticky = $(this).scrollTop() > navOffsetTop - 50;
44                }else{
45                    setSticky = $(this).scrollTop() > navOffsetTop + 400;
46                }
47        
48                if (setSticky) {
49                        
50                    let anchoOriginal = $('#material-menu').parent().width();
51                
52                    nav.width(anchoOriginal + 'px');
53                    nav.addClass('sticky');
54                } else {
55                    nav.removeClass('sticky');
56                }
57                
58
59            });
60
61
62
63            /* Añade clase activa al menú bloque-lista01 y hace scroll */
64            try{
65
66                if(window.location.pathname == '/cursos/'){
67                    $('a[href="https://imasgal.com/cursos/"]').closest('li').addClass('active');
68                }else if(window.location.pathname == '/blog/'){
69                    $('a[href="https://imasgal.com/blog/"]').closest('li').addClass('active');
70                }else{
71                    $('a[href*="'+window.location.pathname+'"]').closest('li').addClass('active');
72                }
73
74               // $('#menu-cursos .menu-item').eq(1).addClass('active');
75
76                // if( window.location.pathname != '/cursos/' && $j('.etiquetas.e-black-transparente').first().find('span').length == 1 ){
77                //     var tag = ($j('.etiquetas.e-black-transparente').first().find('span').text().toLowerCase().normalize('NFD')
78                //     .replace(/[\u0300-\u036f]/g, '').replace(/[\W_]+/g, '-').replace(/^-+|-+$/g, ''));
79                //     slug = tag;
80                //     $j('a[href*="'+tag+'"]').parent().addClass('category-active').addClass('current-menu-item');
81                // }
82
83               
84
85            }catch(error) {
86                console.log(error);
87            }
88
89
90
91
92        }
93    
94    });
95    
96	
97	
98});

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.