PageSourceSearch

https://campus.gov.il/wp-content/themes/campusnew/script.js?ver=6abf4affa72c8

js campus.gov.il collected 2026-10-02 06:35:16 UTC 40,488 bytes, 699 lines download raw bytes

1//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2// START all functions to use in filter Campus
3//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4
5
6if(document.querySelector('.all-the-filter-functions-architect')){
7
8    $('body').click((event) => {
9        if (event.target.classList[0] == "stat-close-the-new-button"){
10            return;
11        }else{
12            var globalAbsoluteBoxInfo = document.querySelectorAll('.global-box-to-open-singl-box.global-generic-block'), i;
13            for (var z = 0; z < globalAbsoluteBoxInfo.length; ++z) {
14                globalAbsoluteBoxInfo[z].querySelector('.global-absolute-box-info').style.display = 'none';
15                globalAbsoluteBoxInfo[z].setAttribute("data-status", "1");
16                if(globalAbsoluteBoxInfo[z].querySelectorAll(".the-image-button-filter-architect img")[1]){
17                    globalAbsoluteBoxInfo[z].querySelectorAll(".the-image-button-filter-architect img")[1].style.transform  = 'rotate(0deg)';
18                }else{
19                    globalAbsoluteBoxInfo[z].querySelector(".the-image-button-filter-architect img").style.transform  = 'rotate(0deg)';
20                }
21            }
22            document.querySelector('.global-box-to-open-singl-box-add').setAttribute("data-status", "1");
23            document.querySelector('.global-box-to-open-singl-box-add .global-absolute-box-info').style.display = 'none';
24            document.querySelector('.global-box-to-open-singl-box-add .plus img').style.transform  = 'rotate(0deg)';
25
26            document.querySelector('.global-box-to-open-singl-box-order').setAttribute("data-status", "1");
27            document.querySelector('.global-box-to-open-singl-box-order .global-absolute-box-info').style.display = 'none';
28            document.querySelectorAll('.global-box-to-open-singl-box-order .the-image-button-filter-architect img')[1].style.transform  = 'rotate(0deg)';
29            
30        }
31    });
32
33
34        
35    function functionSelectTheTagActive(element){
36        var selectTheTagActive = document.querySelectorAll('.global-click-to-specific-single-box'), i;
37        for (var z = 0; z < selectTheTagActive.length; ++z) {
38            if(element == selectTheTagActive[z].getAttribute('data-id')){
39                var globalClickToSpecificSingleBox = document.querySelectorAll('.global-click-to-specific-single-box'), i;
40                for (var j = 0; j < globalClickToSpecificSingleBox.length; ++j) {
41                    if(globalClickToSpecificSingleBox[j].getAttribute('data-id') == selectTheTagActive[z].getAttribute('data-id')){
42                        functionglobalClickToSpecificSingleBox(globalClickToSpecificSingleBox[j])
43                    }
44                } 
45            }
46        }
47    }
48    const searchParams = new URLSearchParams(window.location.search);
49    functionSelectTheTagActive(searchParams.get('click_tag'))
50
51    
52    
53    
54    if(document.querySelector('.click-on-the-input-text-search')){
55        var ClickOnThInputTextSearch = document.querySelector('.click-on-the-input-text-search');
56        ClickOnThInputTextSearch.addEventListener("keypress", function(event) {
57            // If the user presses the "Enter" key on the keyboard
58            if (event.key === "Enter") {
59              event.preventDefault();
60              document.querySelector('.the-div-loaders-filter').style.display = 'block';
61              document.getElementById('all-the-filter-result').innerHTML = '';
62                if(document.getElementById('the-loader-stripe-of-institution-courses-new')){
63                    document.getElementById('the-loader-stripe-of-institution-courses-new').style.display = 'block';
64                }
65              theFirstLoadCourses = 1;
66              functionStartTheApiFilter(theFirstLoadCourses);
67            }
68        });
69    }
70    if(document.querySelector('.global-submit-to-ajax-search-button')){
71
72        document.getElementById("the-submit-catalog-filter-id").addEventListener("submit", function(event) {
73            event.preventDefault(); // עצירת שליחת הטופס
74            console.log("Form submission stopped.");
75        });
76        
77        document.querySelector('.global-submit-to-ajax-search-button').onclick = function(){
78            if(document.querySelector('.searchResultsHero .searchBar form .searchField.searchFieldNewCatalog input')){
79                if(document.querySelector('.searchResultsHero .searchBar form .searchField.searchFieldNewCatalog input').value == ''){
80                    document.querySelector('.searchResultsHero .searchBar form .searchField.searchFieldNewCatalog .error').style.display = 'block';
81                    document.querySelector('.searchResultsHero .searchBar form .searchField.searchFieldNewCatalog input').oninput = function(){
82                        if(document.querySelector('.searchResultsHero .searchBar form .searchField.searchFieldNewCatalog input').value == ''){
83                            document.querySelector('.searchResultsHero .searchBar form .searchField.searchFieldNewCatalog .error').style.display = 'block';
84                        }else{
85                            document.querySelector('.searchResultsHero .searchBar form .searchField.searchFieldNewCatalog .error').style.display = 'none';
86                        }
87                    }
88                }else{
89                    document.querySelector('.searchResultsHero .searchBar form .searchField.searchFieldNewCatalog .error').style.display = 'none';
90                    document.querySelector('.the-div-loaders-filter').style.display = 'block';
91                    document.getElementById('all-the-filter-result').innerHTML = '';
92                    if(document.getElementById('the-loader-stripe-of-institution-courses-new')){
93                        document.getElementById('the-loader-stripe-of-institution-courses-new').style.display = 'block';
94                    }
95                    theFirstLoadCourses = 1;
96                    functionStartTheApiFilter(theFirstLoadCourses
96);    
97                }
98            }else{
99                document.querySelector('.the-div-loaders-filter').style.display = 'block';
100                document.getElementById('all-the-filter-result').innerHTML = '';
101                if(document.getElementById('the-loader-stripe-of-institution-courses-new')){
102                    document.getElementById('the-loader-stripe-of-institution-courses-new').style.display = 'block';
103                }
104                theFirstLoadCourses = 1;
105                functionStartTheApiFilter(theFirstLoadCourses);    
106            }
107        }
108    }
109    if(document.querySelector('.global-submit-to-ajax-search-button-mobile')){
110        document.querySelector('.global-submit-to-ajax-search-button-mobile').onclick = function(){
111            document.querySelector('.the-div-loaders-filter').style.display = 'block';
112            document.getElementById('all-the-filter-result').innerHTML = '';
113            if(document.getElementById('the-loader-stripe-of-institution-courses-new')){
114              document.getElementById('the-loader-stripe-of-institution-courses-new').style.display = 'block';
115            }
116            theFirstLoadCourses = 1;
117            functionStartTheApiFilter(theFirstLoadCourses);
118        }
119    }
120    
121    
122
123
124    var ClickOnTheOrderBy = document.querySelectorAll('.global-click-to-specific-single-box-order'), i;
125    for (var z = 0; z < ClickOnTheOrderBy.length; ++z) {
126        ClickOnTheOrderBy[z].onclick = function() {functionClickOnTheOrderBy(this)};  
127    } 
128    function functionClickOnTheOrderBy(element){
129        document.querySelector('[name=the-search-of-catalog-order-by]').value = element.getAttribute('data-title')+','+element.getAttribute('data-order');
130        if(element.querySelector('.global-click-to-specific-single-box-button-text-order')){
131            document.querySelector('.global-click-to-open-singl-box-order .the-text-button-filter-architect').innerHTML = element.querySelector('.global-click-to-specific-single-box-button-text-order').textContent;
132        }
133        document.getElementById('all-the-filter-result').innerHTML = '';
134        if(document.getElementById('the-loader-stripe-of-institution-courses-new')){
135            document.getElementById('the-loader-stripe-of-institution-courses-new').style.display = 'block';
136        }
137        theFirstLoadCourses = 1;
138        functionStartTheApiFilter(theFirstLoadCourses);
139    }
140
141    
142    
143    var clickToOpenSinglBox = document.querySelectorAll('.global-click-to-open-singl-box'), i;
144    for (var z = 0; z < clickToOpenSinglBox.length; ++z) {
145        clickToOpenSinglBox[z].onclick = function() {functionclickToOpenSinglBox(this)};  
146    }
147    var clickToOpenSinglBoxAdd = document.querySelectorAll('.global-click-to-open-singl-box-add'), i;
148    for (var z = 0; z < clickToOpenSinglBoxAdd.length; ++z) {
149        clickToOpenSinglBoxAdd[z].onclick = function() {functionclickToOpenSinglBox(this)};  
150    }
151    var clickToOpenSinglBoxAdd = document.querySelectorAll('.global-click-to-open-singl-box-order'), i;
152    for (var z = 0; z < clickToOpenSinglBoxAdd.length; ++z) {
153        clickToOpenSinglBoxAdd[z].onclick = function() {functionclickToOpenSinglBox(this)};  
154    }
155    function functionclickToOpenSinglBox(element){
156        if(element.closest(".global-generic-block")){
157            if(element.closest(".global-generic-block").getAttribute('data-status') == '2'){
158                if(element.getAttribute('aria-expanded')){
159                    element.setAttribute('aria-expanded',"false");
160                }
161                var globalAbsoluteBoxInfo = document.querySelectorAll('.global-generic-block'), i;
162                for (var z = 0; z < globalAbsoluteBoxInfo.length; ++z) {
163                    globalAbsoluteBoxInfo[z].querySelector('.global-absolute-box-info').style.display = 'none';
164                    globalAbsoluteBoxInfo[z].setAttribute("data-status", "1");
165                }
166                if(element.querySelectorAll(".the-image-button-filter-architect img")[1]){
167                    element.querySelectorAll(".the-image-button-filter-architect img")[1].style.transform  = 'rotate(0deg)';
168                }else{
169                    element.querySelector(".the-image-button-filter-architect img").style.transform  = 'rotate(0deg)';
170                }
171            }else{
172                if(element.getAttribute('aria-expanded')){
173                    element.setAttribute('aria-expanded',"true");
174                }
175                var globalAbsoluteBoxInfo = document.querySelectorAll('.global-generic-block'), i;
176                for (var z = 0; z < globalAbsoluteBoxInfo.length; ++z) {
177                    globalAbsoluteBoxInfo[z].querySelector('.global-absolute-box-info').style.display = 'none';
178                    globalAbsoluteBoxInfo[z].setAttribute("data-status", "1");
179                    if(globalAbsoluteBoxInfo[z].querySelectorAll(".the-image-button-filter-architect img")[1]){
180                        globalAbsoluteBoxInfo[z].querySelectorAll(".the-image-button-filter-architect img")[1].style.transform  = 'rotate(0deg)';
181                    }else{
182                        globalAbsoluteBoxInfo[z].querySelector(".the-image-button-filter-architect img").style.transform  = 'rotate(0deg)';
183                    }
184                }
185                element.closest(".global-generic-block").querySelector('.global-absolute-box-info').style.display = 'block';
186                element.closest(".global-generic-block").setAttribute("data-status", "2");
187
188                rotateDeg = "rotate(180deg)";
189                if(element.querySelectorAll(".the-image-button-filter-architect img")[1]){
190                    if(element.querySelector(".the-image-button-filter-architect").classList.contains("plus")) rotateDeg = "rotate(45deg)";
191                    element.querySelectorAll(".the-image-button-filter-architect img")[1].style.transform  = rotateDeg;
192                }else{
193                    if(element.querySelector(".the-image-button-filter-architect").classList.contains("plus")) rotateDeg = "rotate(45deg)";
194                    element.querySelector(".the-image-button-filter-architect img").style.transform  = rotateDeg;
195                }
196            }
197        }
198    }
199
200
201    var globalClickToSpecificSingleBox = document.querySelectorAll('.global-click-to-specific-single-box'), i;
202    for (var z = 0; z < globalClickToSpecificSingleBox.length; ++z) {
203        globalClickToSpecificSingleBox[z].onchange = function() {functionglobalClickToSpecificSingleBox(this)};  
204    }
205    function functionglobalClickToSpecificSingleBox(element){
206
207        console.log(element)
208
209        if(element.querySelector('.global-click-to-specific-single-box-button-active.active')){
210            element.querySelector('.global-click-to-specific-single-box-button-active').classList.remove('active');
211        }else{
212            element.querySelector('.global-click-to-specific-single-box-button-active').classList.add('active');
213        }
214
215
216        var allTheFilterValueName = allTheFilterValue[element.closest(".global-box-to-open-singl-box").getAttribute('data-type')];
217        if(element.closest(".global-box-to-open-singl-box").querySelectorAll('.global-click-to-specific-single-box-button-active.active').length > 0){
218            element.closest(".global-box-to-open-singl-box").querySelector('.global-number-of-filter').style.display = 'flex';
219            element.closest(".global-box-to-open-singl-box").querySelector('.global-number-of-filter').innerHTML = element.closest(".global-box-to-open-singl-box").querySelectorAll('.global-click-to-specific-single-box-button-active.active').length;
220            for(var x = 0; x < element.closest(".global-box-to-open-singl-box").querySelectorAll('.global-click-to-specific-single-box-button-active.active').length; x++){
221                if(x == 0){
222                    document.querySelector('.global-filter-input[name='+allTheFilterValueName+']').value = element.closest(".global-box-to-open-singl-box").querySelectorAll('.global-click-to-specific-single-box-button-active.active')[x].closest(".global-click-to-specific-single-box").getAttribute('data-id');
223                }else{
224                    document.querySelector('.global-filter-input[name='+allTheFilterValueName+']').value = document.querySelector('.global-filter-input[name='+allTheFilterValueName+']').value+','+ element.closest(".global-box-to-open-singl-box").querySelectorAll('.global-click-to-specific-single-box-button-active.active')[x].closest(".global-click-to-specific-single-box").getAttribute('data-id');
225                }
226            }
227        }else{
228            element.closest(".global-box-to-open-singl-box").querySelector('.global-number-of-filter').style.display = 'none';
229            element.closest(".global-box-to-open-singl-box").querySelector('.global-number-of-filter').innerHTML = element.closest(".global-box-to-open-singl-box").querySelectorAll('.global-click-to-specific-single-box-button-active.active').length;
230            document.querySelector('.global-filter-input[name='+allTheFilterValueName+']').value = '0';
231            document.querySelector('.global-filter-input-name[name='+allTheFilterValueName+'_name'+']').value = '0';
232
233        }
234
235
236        var allTheFilterValueNameToBlackBox = allTheFilterValueNameNew[element.closest(".global-box-to-open-singl-box").getAttribute('data-type')];
237        if(element.closest(".global-box-to-open-singl-box").querySelectorAll('.global-click-to-specific-single-box-button-active.active').length > 0){
238            element.closest(".global-box-to-open-singl-box").querySelector('.global-number-of-filter').style.display = 'flex';
239            element.closest(".global-box-to-open-singl-box").querySelector('.global-number-of-filter').innerHTML = element.closest(".global-box-to-open-singl-box").querySelectorAll('.global-click-to-specific-single-box-button-active.active').length;
240            for(var x = 0; x < element.closest(".global-box-to-open-singl-box").querySelectorAll('.global-click-to-specific-single-box-button-active.active').length; x++){
241                if(x == 0){
242                    document.querySelector('.global-filter-input-name[name='+allTheFilterValueNameToBlackBox+']').value = element.closest(".global-box-to-open-singl-box").querySelectorAll('.global-click-to-specific-single-box-button-active.active')[x].closest(".global-click-to-specific-single-box").querySelector('.global-click-to-specific-single-box-button-text').textContent;
243                }else{
244                    document.querySelector('.global-filter-input-name[name='+allTheFilterValueNameToBlackBox+']').value = document.querySelector('.global-filter-input-name[name='+allTheFilterValueNameToBlackBox+']').value+','+ element.closest(".global-box-to-open-singl-box").querySelectorAll('.global-click-to-specific-single-box-button-active.active')[x].closest(".global-click-to-specific-single-box").querySelector('.global-click-to-specific-single-box-button-text').textContent;
245                }
246            }
247        }else{
248            element.closest(".global-box-to-open-singl-box").querySelector('.global-number-of-filter').style.display = 'none';
249            element.closest(".global-box-to-open-singl-box").querySelector('.global-number-of-filter').innerHTML = element.closest(".global-box-to-open-singl-box").querySelectorAll('.global-click-to-specific-single-box-button-active.active').length;
250            document.querySelector('.global-filter-input-name[name='+allTheFilterValueNameToBlackBox+']').value = '0';
251        }
252        
253        document.querySelector('.global-the-black-choice').innerHTML = '';
254        var allTheInputValue = document.querySelectorAll('.global-filter-input-name'), i;
255        for (var z = 0; z < allTheInputValue.length; ++z) { 
256            if(allTheInputValue[z].value != '0'){
257                document.querySelector('.global-the-black-choice').innerHTML += `
258                <div class="the-button-filter-active-single-architect global-the-black-choice-single" data-type="`+z+`">
259                    <div class="title-filter-active-single-architect">`+allTheFilterValueHeName[z]+`:</div>
260                    <div class="text-filter-active-single-architect">`+allTheInputValue[z].value+`</div>
261                </div>
262            `; 
263            }
264        }
265
266        if(document.querySelectorAll('.global-close-filter-single')){
267            var globalCloseFilterSingle = document.querySelectorAll('.global-close-filter-single'), i;
268            for (var z = 0; z < globalCloseFilterSingle.length; ++z) {
269                globalCloseFilterSingle[z].onclick = function() { functionGlobalCloseFilterSingle(this); };  
270            }
271            function functionGlobalCloseFilterSingle(element){
272                element.closest('.global-the-black-choice-single').style.display = 'none';
273                var theTypeOfBlackBox = element.closest('.global-the-black-choice-single').getAttribute('data-type');
274                document.querySelector('.global-filter-input[name='+allTheFilterValue[theTypeOfBlackBox]+']').value = '0';
275                document.querySelector('.global-filter-input-name[name='+allTheFilterValue[theTypeOfBlackBox]+'_name'+']').value = '0';
276                document.querySelectorAll('.global-box-to-open-singl-box')[theTypeOfBlackBox].querySelector('.global-number-of-filter').style.display = 'none';
277                var allTheSingleFilterButton = document.querySelectorAll('.global-box-to-open-singl-box')[theTypeOfBlackBox].querySelectorAll('.global-click-to-specific-single-box'), i;
278                for (var z = 0; z < allTheSingleFilterButton.length; ++z) {
279                    allTheSingleFilterButton[z].setAttribute('data-status','1');
280                    allTheSingleFilterButton[z].querySelector('.global-click-to-specific-single-box-button-active').classList.remove('active');
281                }
282                document.getElementById('all-the-filter-result').innerHTML = '';
283                if(document.getElementById('the-loader-stripe-of-institution-courses-new')){
284                    document.getElementById('the-loader-stripe-of-institution-courses-new').style.display = 'block';
285                }
286                theFirstLoadCourses = 1;
287                functionStartTheApiFilter(theFirstLoadCourses);
288
289            }
290        }
291
292        document.getElementById('all-the-filter-result').innerHTML = '';
293        if(document.getElementById('the-loader-stripe-of-institution-courses-new')){
294            document.getElementById('the-loader-stripe-of-institution-courses-new').style.display = 'block';
295        }
296        theFirstLoadCourses = 1;
297        functionStartTheApiFilter(theFirstLoadCourses);
298    }
299
300
301    var globalInputTextFilter = document.querySelectorAll('.global-input-text-filter'), i;
302    for (var z = 0; z < globalInputTextFilter.length; ++z) {
303        globalInputTextFilter[z].oninput = function() { functionGlobalInputTextFilter(this); };  
304    }
305    function functionGlobalInputTextFilter(element){
306        var globalClickToSpecificSingleBoxForInput = element.closest(".global-box-to-open-singl-box").querySelectorAll('.global-click-to-specific-single-box-button-text'), i;
307        for (var z = 0; z < globalClickToSpecificSingleBoxForInput.length; ++z) {
308            var theTextOfFilterSingle = globalClickToSpecificSingleBoxForInput[z].textContent
309            var resultText = theTextOfFilterSingle.indexOf(element.value);
310            if(resultText == '-1'){
311                globalClickToSpecificSingleBoxForInput[z].closest(".global-click-to-specific-single-box").style.display = 'none';
312            }else{
313                globalClickToSpecificSingleBoxForInput[z].closest(".global-click-to-specific-single-box").style.display = 'flex';
314            }
315        }
316    }
317
318
319    var globalInputTextFilterAdd = document.querySelectorAll('.global-input-text-filter-add'), i;
320    for (var z = 0; z < globalInputTextFilterAdd.length; ++z) {
321        globalInputTextFilterAdd[z].oninput = function() { functionGlobalInputTextFilterAdd(this); };  
322    }
323    function functionGlobalInputTextFilterAdd(element){
324        var globalClickToSpecificSingleBoxForInputAdd = element.closest(".global-box-to-open-singl-box-add").querySelectorAll('.global-click-to-specific-single-box-button-text-add'), i;
325        for (var z = 0; z < globalClickToSpecificSingleBoxForInputAdd.length; ++z) {
326            var theTextOfFilterSingle = globalClickToSpecificSingleBoxForInputAdd[z].textContent
327            var resultText = theTextOfFilterSingle.indexOf(element.value);
328            if(resultText == '-1'){
329                globalClickToSpecificSingleBoxForInputAdd[z].closest(".global-click-to-specific-single-box-add").style.display = 'none';
330            }else{
331                globalClickToSpecificSingleBoxForInputAdd[z].closest(".global-click-to-specific-single-box-add").style.display = 'flex';
332            }
333        }
334    }
335
336
337    var addNewFilterToRow = document.querySelectorAll('.global-click-to-specific-single-box-add'), i;
338    for (var z = 0; z < addNewFilterToRow.length; ++z) {
339        addNewFilterToRow[z].onclick = function() { functionAddNewFilterToRow(this); };  
340    }
341    function functionAddNewFilterToRow(element){
342        if(element.getAttribute('data-status') == '1'){
343            element.querySelector('.global-click-to-specific-single-box-button-active-add').classList.add('active');
344            element.setAttribute('data-status','2');
345            var openTheNewFilterRow = document.querySelectorAll('.global-box-to-open-singl-box'), i;
346            for (var z = 0; z < openTheNewFilterRow.length; ++z) {
347                if(openTheNewFilterRow[z].getAttribute('data-type') == element.getAttribute('data-type')){
348                    openTheNewFilterRow[z].style.display = 'block';
349                } 
350            }
351        }else{
352            element.querySelector('.global-click-to-specific-single-box-button-active-add').classList.remove('active');
353            element.setAttribute('data-status','1');
354
355            var openTheNewFilterRow = document.querySelectorAll('.global-box-to-open-singl-box'), i;
356            for (var z = 0; z < openTheNewFilterRow.length; ++z) {
357                if(openTheNewFilterRow[z].getAttribute('data-type') == element.getAttribute('data-type')){
358                    openTheNewFilterRow[z].style.display = 'none';
359                } 
360            }
361
362            var closeAllTheChoose = document.querySelectorAll('.global-the-black-choice-single'), i;
363            for (var v = 0; v < closeAllTheChoose.length; ++v) {
364                if(closeAllTheChoose[v].getAttribute('data-type') == element.getAttribute('data-type')){
365                    closeAllTheChoose[v].closest('.global-the-black-choice-single').style.display = 'none';
366                    var theTypeOfBlackBox = closeAllTheChoose[v].closest('.global-the-black-choice-single').getAttribute('data-type');
367                    document.querySelector('.global-filter-input[name='+allTheFilterValue[theTypeOfBlackBox]+']').value = '0';
368                    document.querySelectorAll('.global-box-to-open-singl-box')[theTypeOfBlackBox].querySelector('.global-number-of-filter').style.display = 'none';
369                    var allTheSingleFilterButton = document.querySelectorAll('.global-box-to-open-singl-box')[theTypeOfBlackBox].querySelectorAll('.global-click-to-specific-single-box'), i;
370                    for (var z = 0; z < allTheSingleFilterButton.length; ++z) {
371                        allTheSingleFilterButton[z].setAttribute('data-status','1');
372                        allTheSingleFilterButton[z].querySelector('.global-click-to-specific-single-box-button-active').classList.remove('active');
373                    }
374                } 
375            }
376        }
377    }
378
379}
380
381
382if(document.querySelector('.all-the-filter-functions-architect-mobile')){
383
384    document.querySelector('.global-open-the-box-one-mobile').onclick = function(){ openTheBoxOneMobile(); }
385    function openTheBoxOneMobile(){
386        if(document.querySelector('.global-open-the-box-one-mobile').getAttribute('data-status') == '1'){
387            document.querySelector('.global-open-the-box-absolute-one-mobile').style.display = 'block';
388            document.querySelector('.global-open-the-box-one-mobile').setAttribute('data-status','2');
389        }else{
390            document.querySelector('.global-open-the-box-absolute-one-mobile').style.display = 'none';
391            document.querySelector('.global-open-the-box-one-mobile').setAttribute('data-status','1');
392        }
393    }
394
395    var openTheOnlySingleFilter = document.querySelectorAll('.global-open-the-only-single-filter'), i;
396    for (var z = 0; z < openTheOnlySingleFilter.length; ++z) {
397        openTheOnlySingleFilter[z].onclick = function() { functionopenTheOnlySingleFilter(this); };  
398    }
399    function functionopenTheOnlySingleFilter(element){
400        if(element.closest(".the-single-box-only").getAttribute('data-status') == '1'){
401            element.closest(".the-single-box-only").querySelector('.global-open-the-only-single-absolute-filter').style.display = 'block';
402            element.closest(".the-single-box-only").setAttribute('data-status','2');
403            element.closest(".the-single-box-only").querySelector('.global-icon-flip img').style.transform = 'rotate(180deg)';
404        }else{
405            element.closest(".the-single-box-only").querySelector('.global-open-the-only-single-absolute-filter').style.display = 'none';
406            element.closest(".the-single-box-only").setAttribute('data-status','1');
407            element.closest(".the-single-box-only").querySelector('.global-icon-flip img').style.transform = 'rotate(0deg)';
408        }
409    }
410
411
412    document.querySelector('.global-open-all-block-filter').onclick = function(){ openTheBoxOneFilterMobile(); }
413    function openTheBoxOneFilterMobile(){
414        if(document.querySelector('.global-open-all-block-filter').getAttribute('data-status') == '1'){
415            document.querySelector('.global-all-the-filter-in-mobile-fixed').style.right = '0';
416            document.querySelector('.global-open-all-block-filter').setAttribute('data-status','2')
417        }else{
418            document.querySelector('.global-all-the-filter-in-mobile-fixed').style.right = '100%';
419            document.querySelector('.global-open-all-block-filter').setAttribute('data-status','1')
420        }
421    }
422
423
424    var OnClickMobileFilter = document.querySelectorAll('.global-on-click-mobile-filter'), i;
425    for (var z = 0; z < OnClickMobileFilter.length; ++z) {
426        OnClickMobileFilter[z].onclick = function() { functionOnClickMobileFilter(this); };  
427    }
428    function functionOnClickMobileFilter(element){
429        if(element.getAttribute('data-status') == '1'){
430            element.querySelector('.the-checker-box-architect').classList.add('active');
431            element.setAttribute('data-status','2');
432        }else{
433            element.querySelector('.the-checker-box-architect').classList.remove('active');
434            element.setAttribute('data-status','1');
435        }
436
437
438        var arrayTheClosestElementSinglFilter = [];
439        var arrayTheClosestElementSinglFilterName = [];
440        var theClosestElementSinglFilter = element.closest('.global-open-the-only-single-absolute-filter').querySelectorAll('.global-on-click-mobile-filter'), i;
441        for (var z = 0; z < theClosestElementSinglFilter.length; ++z) {
442            if(theClosestElementSinglFilter[z].getAttribute('data-status') == '2'){
443                arrayTheClosestElementSinglFilter.push(theClosestElementSinglFilter[z].getAttribute('data-type'));
444                arrayTheClosestElementSinglFilterName.push(theClosestElementSinglFilter[z].querySelector('.the-text-box-architect').textContent);
445            }
446        }
447
448        var theTextInputFilter = '0';
449        var theTextInputFilterName = '0';
450        if(arrayTheClosestElementSinglFilter.length > 0){
451            for (var z = 0; z < arrayTheClosestElementSinglFilter.length; ++z) {
452                if(z == '0'){
453                    theTextInputFilter = arrayTheClosestElementSinglFilter[z];
454                    theTextInputFilterName = arrayTheClosestElementSinglFilterName[z];
455                }else{
456                    theTextInputFilter += ','+arrayTheClosestElementSinglFilter[z];
457                    theTextInputFilterName += ','+arrayTheClosestElementSinglFilterName[z];
458                }
459            }
460        }else{
461            document.querySelector('.global-filter-input[name='+allTheFilterValue[element.closest('.the-single-box-only').getAttribute('data-type')]+']').value = '0';
462            document.querySelector('.global-filter-input-name[name='+allTheFilterValue[element.closest('.the-single-box-only').getAttribute('data-type')]+'_name'+']').value = '0';
463        }
464
465        document.querySelector('.global-filter-input[name='+allTheFilterValue[element.closest('.the-single-box-only').getAttribute('data-type')]+']').value = theTextInputFilter;
466        document.querySelector('.global-filter-input-name[name='+allTheFilterValue[element.closest('.the-single-box-only').getAttribute('data-type')]+'_name'+']').value = theTextInputFilterName;
467
468    }
469
470}
471
472
473//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
474// END all functions to use in filter Campus
475//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
476
477
478//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
479// START all functions to Enroll To Course
480//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
481
482function getCookieLogin(cname) {
483    let name = cname + "=";
484    let decodedCookie = decodeURIComponent(document.cookie);
485    let ca = decodedCookie.split(';');
486    for(let i = 0; i < ca.length; i++) {
487        let c = ca[i];
488        while (c.charAt(0) == ' ') {
489        c = c.substring(1);
490        }
491        if (c.indexOf(name) == 0) {
492        return c.substring(name.length, c.length);
493        }
494    }
495    return "";
496}
497
498if(getCookieLogin('edx-user-info')){
499    fetch(THEURLOFEDXCONECT+'api/enrollment/v1/enrollment', {
500        method: 'GET',
501        credentials: 'include' // This ensures cookies are sent with the request
502    })
503    .then(response => {
504        if (!response.ok) {
505            throw new Error('Network response was not ok');
506        }
507        return response.json(); // or response.text() if the response is not in JSON format
508    })
509    .then(data => {
510        console.log(data); // Handle the response data
511    })
512    .catch(error => {
513        console.error('There was a problem with the fetch operation:', error);
514    });
515}
516
517
518if(document.querySelectorAll('.register_api_architect')[0]){
519    var EnrollmentCourse = document.querySelectorAll('.register_api_architect'), i;
520    for (var z = 0; z < EnrollmentCourse.length; ++z) {
521        EnrollmentCourse[z].onclick = function(){ functionEnrollmentCourse(this); }
522    }
523    function functionEnrollmentCourse(element){
524        
525        function getCookie(cname) {
526            let name = cname + "=";
527            let decodedCookie = decodeURIComponent(document.cookie);
528            let ca = decodedCookie.split(';');
529            for(let i = 0; i < ca.length; i++) {
530                let c = ca[i];
531                while (c.charAt(0) == ' ') {
532                c = c.substring(1);
533                }
534                if (c.indexOf(name) == 0) {
535                return c.substring(name.length, c.length);
536                }
537            }
538            return "";
539        }
540        
541        
542        let course_id_edx = element.getAttribute('data-id');
543        let link_end = element.getAttribute('data-link-end');
544        let action_end_api = element.getAttribute('data-action-end-api');
545        element.disabled = true;
546
547        console.log(course_id_edx)
548        console.log(link_end)
549        console.log(action_end_api)
550
551        jQuery.ajax({
552            method: "post",
553            url: THEURLOFEDXCONECT+"change_enrollment",
554            data: {
555                "course_id": course_id_edx,
556                "csrfmiddlewaretoken": getCookie("csrftoken-marketing"),
557                "enrollment_action": "enroll",
558            },
559            xhrFields: {withCredentials: true},
560            success: function (data, textStatus, jqXHR) {
561                console.log(data);
562                console.log('succeeded: enrollment status changed');
563    
564                if (action_end_api == 'dashboard' || action_end_api == 'course') {
565                    location.href = link_end;
566                } else if (action_end_api == 'popup') {
567                    jQuery('.user_not_con_to_course').hide();
568                    jQuery('.con_to_course').show();
569                }
570            },
571            error: function (jqXHR) {
572                if (jQuery('.code-error-api[data-code-error="' + jqXHR.status + '"]').length) {
573    
574    
575                } else {
576                    var text_unknown_code = jQuery('.unknown_code_error_api').text();
577                    text_unknown_code = text_unknown_code.replace('{code}', jqXHR.status);
578                }
579            }
580        });
581    }
582}
583//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
584// END all functions to Enroll To Course
585//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
586
587
588//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
589// START all functions to Enroll To Program
590//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
591
592if(document.querySelectorAll('.register_api_architect_on_program')[0]){
593
594    var EnrollmentProgramStart = document.querySelectorAll('.register_api_architect_on_program'), i;
595    for (var z = 0; z < EnrollmentProgramStart.length; ++z) {
596        EnrollmentProgramStart[z].onclick = function(){ functionEnrollmentProgramStart(this); }
597    }
598
599    function functionEnrollmentProgramStart(){
600        var EnrollmentProgram = document.querySelectorAll('.register_api_architect_on_program_single_course'), i;
601        for (var z = 0; z < EnrollmentProgram.length; ++z) {
602            functionEnrollmentProgram(EnrollmentProgram[z]);
603        }
604    }
605   
606
607
608    function functionEnrollmentProgram(element){
609        
610        function getCookie(cname) {
611            let name = cname + "=";
612            let decodedCookie = decodeURIComponent(document.cookie);
613            let ca = decodedCookie.split(';');
614            for(let i = 0; i < ca.length; i++) {
615                let c = ca[i];
616                while (c.charAt(0) == ' ') {
617                c = c.substring(1);
618                }
619                if (c.indexOf(name) == 0) {
620                return c.substring(name.length, c.length);
621                }
622            }
623            return "";
624        }
625        
626        element.disabled = true;
627        let course_id_edx = element.getAttribute('data-id');
628        let link_end = element.getAttribute('data-link-end');
629        let action_end_api = element.getAttribute('data-action-end-api');
630
631
632        jQuery.ajax({
633            method: "post",
634            url: THEURLOFEDXCONECT+"change_enrollment",
635            data: {
636                "course_id": course_id_edx,
637                "csrfmiddlewaretoken": getCookie("csrftoken-marketing"),
638                "enrollment_action": "enroll",
639            },
640            xhrFields: {withCredentials: true},
641            success: function (data, textStatus, jqXHR) {
642                console.log(data);
643                console.log('succeeded: enrollment status changed');
644    
645                if (action_end_api == 'dashboard' || action_end_api == 'course') {
646                    location.href = link_end;
647                } else if (action_end_api == 'popup') {
648                    jQuery('.user_not_con_to_course').hide();
649                    jQuery('.con_to_course').show();
650                }
651            },
652            error: function (jqXHR) {
653                if (jQuery('.code-error-api[data-code-error="' + jqXHR.status + '"]').length) {
654    
655    
656                } else {
657                    var text_unknown_code = jQuery('.unknown_code_error_api').text();
658                    text_unknown_code = text_unknown_code.replace('{code}', jqXHR.status);
659                }
660            }
661        });
662    }
663}
664//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
665// END all functions to Enroll To Program
666//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
667
668
669// CPT popups own their own trigger and frequency rules (frontend-trigger.js).
670// This legacy always-on-load call only applies when no CPT popup matched.
671if(document.querySelector('#autoPopupContent') && !window.CIL_POPUP_TRIGGER){
672    doAutoPopupSlider('autoPopupContent','.autoPopupSlider');
673}
674
675if(document.querySelector('.coursesInCollaborationsCaruselNewInstitution .toggleWrapperButton.active')){
676    document.querySelector('.coursesInCollaborationsCaruselNewInstitution .toggleWrapperButton.active').onclick = function(){ openTheCoursesFromInstitution(this); }
677    function openTheCoursesFromInstitution(element){
678        console.log(element)
679        if(element.getAttribute("data-status") == "1"){
680            var openAllTheInstitutionHide = document.querySelectorAll('.coursesInCollaborationsCaruselNewInstitution .courseCard.hide'), i;
681            for (var z = 0; z < openAllTheInstitutionHide.length; ++z) {
682                openAllTheInstitutionHide[z].style.display = "block";
683            }
684            element.querySelector('.the-new-icon-to-button .the-new-icon-to-button-text').textContent = "הציגו פחות";
685            element.querySelector('.the-new-icon-to-button img').style.margin = "4px 0 0 0";
686            element.querySelector('.the-new-icon-to-button img').style.transform = "rotate(180deg)";
687            element.setAttribute("data-status","2");
688        }else{
689            var openAllTheInstitutionHide = document.querySelectorAll('.coursesInCollaborationsCaruselNewInstitution .courseCard.hide'), i;
690            for (var z = 0; z < openAllTheInstitutionHide.length; ++z) {
691                openAllTheInstitutionHide[z].style.display = "none";
692            }
693            element.querySelector('.the-new-icon-to-button .the-new-icon-to-button-text').textContent = "הציגו עוד";
694            element.querySelector('.the-new-icon-to-button img').style.margin = "6px 0 0 0";
695            element.querySelector('.the-new-icon-to-button img').style.transform = "rotate(0deg)";
696            element.setAttribute("data-status","1");
697        }
698    }
699}

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.