PageSourceSearch

https://www.ramapo.edu/news/wp-content/plugins/ramapo-experts-guide/js/experts.js?ver=7.1.2

js ramapo.edu collected 2026-10-01 09:23:40 UTC 8,891 bytes, 277 lines download raw bytes

1(function($) {
2
3    $(document).ready(function(){
4        // start the document by displaying all scholarships
5        filterAZSchools();
6        $('#clearFilter, #clearFilter2').click(function(){
7            $('input[name="school"]:checked').removeAttr('checked');
8            $('input[name="topic"]:checked').removeAttr('checked');
9            $('.radiobuttons-grid').val('-');
10            filterAZSchools();
11            countScholarships('Number of Experts: ');
12        });
13
14        // update the results based on the selction of school
15        $("input[name='school']").change(function(e){
16            filterAZSchools();
17        });
18
19        $( "select" ).change(function () {
20            filterAZSchoolsDropDown();
21        });
22
23        // udpate the results based on the seclection of program
24        $("input[name='topic']").change(function(e){
25            filterAZStanding();
26        });
27    });
28
29    function filterAZStanding()
30    {
31        $('.azNoResults').hide(400);
32        if($('input[name="topic"]:checked').length == 0)
33        {
34            // $('.azCategory').show(400);
35            // $('.azLetter').show(400);
36            // $('div.azEntry').show(400);
37            filterAZSchools();
38            return;
39        }
40        $azEntries = $('div.azEntry');
41        
42        var filtered = $();
43        var hierarchy = [];
44        // first get all checked checkbox options
45        $('input[name="school"]:checked').each(function(){
46            var $this = $(this);
47            var value = $this.val();
48            if(value == null)
49            {
50                return;
51            }
52            filtered = $.extend(filtered,$azEntries.filter('[data-school~='+value+']'));	
53            $azEntries = filtered;
54        });
55
56        filtered = $();
57        $('input[name="topic"]:checked').each(function(){
58            var $this = $(this);
59            var value = $this.val();
60            if(value == null)
61            {
62                return;
63            }
64            hierarchy.push('[data-topic~='+value+']');									
65        });
66        // now filter on all attributes		
67        var filteredBy = hierarchy.join(", ");
68        filtered = $.merge(filtered,$azEntries.filter(filteredBy));	
69        $azEntries = filtered;							
70
71        $azLetters = $('.azLetter');
72        $azCategories = $('.azCategory');
73        $('div.azEntry').not($azEntries).hide(400);
74        if($azCategories.length == 0)
75        {
76            $('.azNoResults').show(400);
77        }
78        else
79        {									
80            $azCategories.show(400);
81            $azLetters.show(400);
82            $azEntries.show(400);									
83        }
84
85        // wait for the animation to stop to update the number
86        $(":animated").promise().done(function() {
87            countScholarships('Number of Experts: ');
88        });
89                                    
90    }
91
92    function filterAZSchools()
93    {
94        $('.azNoResults').hide(400);
95        if($('input[name="school"]:checked').length == 0)
96        {
97            $('.azCategory').show(400);
98            $('.azLetter').show(400);
99            $('div.azEntry').show(400);
100            countScholarships('Number of Experts: ');
101            return;
102        }
103        
104        $azEntries = $('div.azEntry');
105        var filtered = $();
106
107        // reset the checkboxes
108        //$('input[name="topic"]:checked').removeAttr('checked');
109
110        $('input[name="school"]:checked').each(function(){
111            var $this = $(this);
112            var value = $this.val();
113            if(value == null)
114            {
115                return;
116            }
117            filtered = $.extend(filtered,$azEntries.filter('[data-school~='+value+']'));	
118            $azEntries = filtered;
119        });
120
121        $azLetters = $('.azLetter');
122        $azCategories = $('.azCategory');
123        $('div.azEntry').not($azEntries).hide(400);
124        if($azCategories.length == 0)
125        {
126            $('.azNoResults').show(400);
127        }
128        else
129        {									
130            $azCategories.show(400);
131            $azLetters.show(400);
132            $azEntries.show(400);									
133        }
134
135        // wait for the animation to stop to update the number
136        $(":animated").promise().done(function() {
137            countScholarships('Number of Experts: ');
138        });
139                                    
140    }
141
142    function filterAZSchoolsDropDown()
143    {
144        $('.azNoResults').hide(400);
145        if($('select option:selected').val() == '-')
146        {
147            $('.azCategory').show(400);
148            $('.azLetter').show(400);
149            $('div.azEntry').show(400);
150            countScholarships('Number of Experts: ');
151            return;
152        }
153        
154        $azEntries = $('div.azEntry');
155        var filtered = $();
156
157        // reset the checkboxes
158        //$('input[name="topic"]:checked').removeAttr('checked');
159
160        $('select option:selected').each(function(){
161            var $this = $(this);
162            var value = $this.val();
163            if(value == null)
164            {
165                return;
166            }
167            filtered = $.extend(filtered,$azEntries.filter('[data-school~='+value+']'));	
168            $azEntries = filtered;
169        });
170
171        $azLetters = $('.azLetter');
172        $azCategories = $('.azCategory');
173        $('div.azEntry').not($azEntries).hide(400);
174        if($azCategories.length == 0)
175        {
176            $('.azNoResults').show(400);
177        }
178        else
179        {									
180            $azCategories.show(400);
181            $azLetters.show(400);
182            $azEntries.show(400);									
183        }
184
185        // wait for the animation to stop to update the number
186        $(":animated").promise().done(function() {
187            countScholarships('Number of Experts: ');
188        });
189                                    
190    }
191
192    function countScholarships( message ){
193        var numOfVisibleRows = $('.azEntry').filter(function() {
194            return $(this).css('display') !== 'none';
195        }).length;
196        $('#scholarshipCount').text(message + numOfVisibleRows);
197    }
198
199    function filterAZ()
200    {
201        $('.azNoResults').hide(400);
202        if($('.azFilter').eq(0).val() == null && $('.azFilter').eq(1).val() == null )
203        {
204            $('.azCategory').show(400);
205            $('.azLetter').show(400);
206            $('div.azEntry').show(400);
207            return;
208        }
209        $azEntries = $('div.azEntry');
210        var filtered = $();
211        $('.azFilter').each(function(){
212            var $this = $(this);
213            var id = $this.attr('id');
214
215            var value = $this.val();
216            if(value == null)
217            {
218                return;
219            }									
220            value.forEach(function(element)
221            {
222                hierarchy = element.split(' ');
223                if(hierarchy.length == 1)
224                {											
225                    filtered = $.extend(filtered,$azEntries.filter('[data-'+id+'~='+element+'], [data-'+id+'~=any-'+id+']'));										
226                }
227                else if(hierarchy.length == 2)
228                {
229                    filtered = $.extend(filtered,$azEntries.filter('[data-'+id+'~='+hierarchy[0]+'], [data-'+id+'~='+hierarchy[1]+'], [data-'+id+'~=any-'+id+']'));
230                }
231                else
232                {
233                    filtered = $.extend(filtered,$azEntries.filter('[data-'+id+'~='+hierarchy[0]+'], [data-'+id+'~='+hierarchy[1]+'], [data-'+id+'~='+hierarchy[2]+'], [data-'+id+'~=any-'+id+']'));
234                }
235
236            });
237            $azEntries = filtered;
238        });
239
240        $azLetters = $('.azLetter');
241        $azCategories = $('.azCategory');
242        $('.azLetter').each(function(){
243            $children = $(this).find('ul > div.azEntry');
244            if($children.filter($azEntries).length == 0)
245            {
246                $azEntries = $.extend($azEntries,$children);
247                $azLetters = $azLetters.not($(this));
248            }
249        });
250        $('.azCategory').each(function(){
251            $children = $(this).find('.azLetter');
252            if($children.filter($azLetters).length == 0)
253            {
254                $azLetters = $.extend($azLetters,$children);
255                $azCategories = $azCategories.not($(this));
256            }
257        });
258        $('.azCategory').not($azCategories).hide(400);
259        $('.azLetter').not($azLetters).hide(400);
260        $('div.azEntry').not($azEntries).hide(400);
261        if($azCategories.length == 0)
262        {
263            $('.azNoResults').show(400);
264        }
265        else
266        {									
267            $azCategories.show(400);
268            $azLetters.show(400);
269            $azEntries.show(400);									
270        }
271
272        // wait for the animation to stop to update the number
273        $(":animated").promise().done(function() {
274            countScholarships('Number of Experts: ');
275        });
276    }
277})(jQuery);

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.