PageSourceSearch

https://www.smc.edu/_resources/js/ou.js

js smc.edu collected 2026-10-01 06:43:34 UTC 3,236 bytes, 78 lines download raw bytes

1// created for Ticket 186695
2$(window).on('load', function(){
3    function itemChecker(item){
4        var check = false;
5        item.find("img").each(function(){
6            if($(this).attr('src') === '/_resources/assets/icons/academic/requirement-elective.svg')
7                check = true;
8        });
9        return check;
10    }
11    function parentChecker(item){
12        var parent = item.closest('.accordion__items > .accordion__item').find('.m-critical')[0];
13        if(parent.children.length == 0)
14            return false;
15        else{
16            var images = parent.children;
17            for(var i = 0; i < images.length; ++i){
18                if(images[i].src === 'https://www.smc.edu/_resources/assets/icons/academic/requirement-elective.svg')
19                    return true;
20            }
21        }
22        return false;
23    }
24
25    function innerCheck(){
26        $(".accordion__items > .accordion__item > .accordion__toggle > h3").each(function(){
27			var cur = $(this)[0];
28            var count = 0;
29            if(cur.innerHTML.includes("Semester")){
30                $(this).closest('.accordion__items > .accordion__item').find('.m-critical').each(function(){
31                    if(count > 0 ){
32                        var check = false;
33                        $(this).children().each(function(){
34                            if($(this).attr('src') === '/_resources/assets/icons/academic/requirement-elective.svg'){
35                                check = true;
36                            }
37                        });
38                        if(check === false){
39                            if(itemChecker($(this).closest('.accordion__item')) === false)
40                                $(this).closest('.accordion__item').addClass('noshow');
41                        }
42                    }
43                    ++count;
44                });
45            }
46        });
47    }
48
49    if($('#majorrequirements').length > 0){
50        $('#majorrequirements')[0].addEventListener("click", function(){
51			event.preventDefault();
52            $('#showall').css("display", "inline-block");
53            $(".m-critical").each(function(){
54                var header = $(this).closest('.section-content').find('.section__header > h2')[0];
55                if(header.innerHTML.includes("Semester")){
56                    var check = false;
57                    $(this).children().each(function(){
58                        if($(this).attr('src') === '/_resources/assets/icons/academic/requirement-elective.svg'){
59                            check = true;
60                        }
61                    });
62                    if(check === false){
63                        if(itemChecker($(this).closest('.accordion__item')) === false && parentChecker($(this).closest('.accordion__item')) === false)
64                            $(this).closest('.accordion__item').addClass('noshow');
65                    }
66                }
67                else{
68                    innerCheck();
69                }
70            });
71        });
72        $('#showall')[0].addEventListener("click", function(){
73			event.preventDefault();
74            $('#showall').css("display", "none");
75            $('.accordion__item').removeClass('noshow');
76        }); 
77    }
78});

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.