PageSourceSearch

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

js campus.gov.il collected 2026-09-24 20:12:31 UTC 41,521 bytes, 737 lines download raw bytes

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

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.