PageSourceSearch

https://salamanca-university.org/wp-content/themes/astra-child/cus-script.js?ver=7.0.6

js salamanca-university.org collected 2026-09-25 00:59:37 UTC 12,420 bytes, 371 lines download raw bytes

1jQuery(function($) {
2
3/* 	Summer Product jQuery for EN version */
4	
5	$('.postid-629 #pa_weeks').change(function () {
6		$('.postid-629 #pa_starting-dates>option').removeClass('opnone');
7		//alert("te");
8		var drpval = $(this).val();
9		if ( drpval == '') {
10			$('.postid-629 #pa_starting-dates').val('');
11			$('.postid-629 #pa_lessons-per-week').val('');
12		} else if ( drpval == '3') {
13			$('.postid-629 #pa_starting-dates>option:not(:nth-child(1), :nth-child(3), :nth-child(5))').addClass('opnone');
14		} else if ( drpval == '6' || drpval == '8' ) {
15			$('.postid-629 #pa_starting-dates>option:not(:nth-child(1), :nth-child(2))').addClass('opnone');
16		}
17	});
18	
19	$('.postid-629 #pa_starting-dates').change(function () {
20		$('.postid-629 #pa_weeks>option').removeClass('opnone');
21		$('#pa_weeks').val('');
22		//alert("te");
23		var drpval = $(this).val();
24		if ( drpval == '') {
25			$('.postid-629 #pa_weeks').val('');
26			$('.postid-629 #pa_lessons-per-week').val('');
27		} else if ( drpval == 'july-2nd-2026') {
28			$('.postid-629 #pa_weeks>option:nth-child(3)').addClass('opnone');
29		} else if ( drpval == 'august-3rd-2026' ) {
30			$('.postid-629 #pa_weeks>option:nth-child(5), .postid-629 #pa_weeks>option:nth-child(6)').addClass('opnone');
31		} else if ( drpval == 'july-5th-2027' ) {
32			$('.postid-629 #pa_weeks>option:not(:nth-child(1), :nth-child(2), :nth-child(4))').addClass('opnone');
33		} else if ( drpval == 'august-2nd-2027' ) {
34			$('.postid-629 #pa_weeks>option:nth-child(5), .postid-629 #pa_weeks>option:nth-child(6)').addClass('opnone');
35		}
36	});
37	
38/* 	Summer Product jQuery for ES version */
39	
40	$('.postid-2917 #pa_weeks').change(function () {
41		$('.postid-2917 #pa_starting-dates>option').removeClass('opnone');
42		//alert("te");
43		var drpval = $(this).val();
44		if ( drpval == '') {
45			$('.postid-2917 #pa_starting-dates').val('');
46			$('.postid-2917 #pa_lessons-per-week').val('');
47		} else if ( drpval == '3') {
48			$('.postid-2917 #pa_starting-dates>option:not(:nth-child(1), :nth-child(3), :nth-child(5))').addClass('opnone');
49		} else if ( drpval == '6' || drpval == '8' ) {
50			$('.postid-2917 #pa_starting-dates>option:not(:nth-child(1), :nth-child(2))').addClass('opnone');
51		}
52	});
53	
54	$('.postid-2917 #pa_starting-dates').change(function () {
55		$('.postid-2917 #pa_weeks>option').removeClass('opnone');
56		$('#pa_weeks').val('');
57		//alert("te");
58		var drpval = $(this).val();
59		if ( drpval == '') {
60			$('.postid-2917 #pa_weeks').val('');
61			$('.postid-2917 #pa_lessons-per-week').val('');
62		} else if ( drpval == '2-de-julio-de-2026') {
63			$('.postid-2917 #pa_weeks>option:nth-child(3)').addClass('opnone');
64		} else if ( drpval == '3-de-agosto-de-2026' ) {
65			$('.postid-2917 #pa_weeks>option:nth-child(5), .postid-2917 #pa_weeks>option:nth-child(6)').addClass('opnone');
66		} else if ( drpval == '5-de-julio-de-2027' ) {
67			$('.postid-2917 #pa_weeks>option:not(:nth-child(1), :nth-child(2), :nth-child(4))').addClass('opnone');
68		} else if ( drpval == '2-de-agosto-de-2027' ) {
69			$('.postid-2917 #pa_weeks>option:nth-child(5), .postid-2917 #pa_weeks>option:nth-child(6)').addClass('opnone');
70		}
71	});	
72	
73	/* 	Intensive Product jQuery for EN & ES version */
74	$('.postid-61 #pa_study-year, .postid-2591 #pa_study-year, .postid-645 #pa_study-year, .postid-2937 #pa_study-year, .postid-629 #pa_study-year, .postid-2917 #pa_study-year').on('change', function () {
75        var selectedYear = $('#pa_study-year').val();
76
77        $('#pa_starting-dates').val('');
78		$('#pa_program-dates').val('');
79
80        setTimeout(function(){
81			$('#pa_starting-dates option').each(function () {
82				var optionVal = $(this).val();
83				if (optionVal === '') return;
84				
85				if (optionVal.includes(selectedYear)) {
86					$(this).removeClass('opnone');
87				} else {
88					$(this).addClass('opnone');
89				}
90			});
91			
92			$('#pa_program-dates option').each(function () {
93				var optionVal = $(this).val();
94				if (optionVal === '') return;
95				var firstYearMatch = optionVal.match(/\d{4}/);
96				if (firstYearMatch && firstYearMatch[0] == selectedYear) {
97					$(this).removeClass('opnone');
98				} else {
99					$(this).addClass('opnone');
100				}
101			});
102			
103		}, 500);
104    });
105	
106	$('.postid-61 #pa_lessons-per-week, .postid-61 #pa_starting-dates, .postid-61 #pa_weeks, .postid-2591 #pa_lessons-per-week, .postid-2591 #pa_starting-dates, .postid-2591 #pa_weeks, .postid-645 #pa_lessons-per-week, .postid-645 #pa_starting-dates, .postid-645 #pa_weeks, .postid-2937 #pa_lessons-per-week, .postid-2937 #pa_starting-dates, .postid-2937 #pa_weeks, .postid-629 #pa_lessons-per-week, .postid-629 #pa_starting-dates, .postid-629 #pa_weeks, .postid-2917 #pa_lessons-per-week, .postid-2917 #pa_starting-dates, .postid-2917 #pa_weeks ').on('change', function () {
107        var selectedYear = $('#pa_study-year').val();
108
109        setTimeout(function(){
110			$('#pa_starting-dates option').each(function () {
111				var optionVal = $(this).val();
112				if (optionVal === '') return;
113				if (optionVal.includes(selectedYear)) {
114					$(this).removeClass('opnone');
115				} else {
116					$(this).addClass('opnone');
117				}
118			});
119			
120			$('#pa_program-dates option').each(function () {
121				var optionVal = $(this).val();
122				if (optionVal === '') return;
123				
124				var firstYearMatch = optionVal.match(/\d{4}/);
125				if (firstYearMatch && firstYearMatch[0] == selectedYear) {
126					$(this).removeClass('opnone');
127				} else {
128					$(this).addClass('opnone');
129				}
130			});
131		}, 500);
132    });
133	
134	$('.postid-61 #pa_starting-dates').on('change', function () {
135        var selectedDates = $(this).val();
136		$('#pa_weeks').val('');
137		
138        setTimeout(function(){
139			$('#pa_weeks option').each(function () {
140				var optionVal = $(this).val();
141				if (optionVal === '') return;
142				if ( selectedDates == "january-11th-2027" ) {
143					$('#pa_weeks>option:nth-child(4)').addClass('opnone');
144				} else if ( selectedDates == "april-5th-2027" ) {
145					$('#pa_weeks>option:nth-child(3)').addClass('opnone');
146				} else if ( selectedDates == "december-1st-2027" ) {
147					$('#pa_weeks>option:nth-child(3), #pa_weeks>option:nth-child(4)').addClass('opnone');
148				} else {
149					$(this).removeClass('opnone');
150				}
151			});
152		}, 500);
153    });
154	
155	$('.postid-61 #pa_lessons-per-week, .postid-61 #pa_study-year, .postid-61 #pa_weeks').on('change', function () {
156        var selectedDates = $("#pa_starting-dates").val();
157		
158        setTimeout(function(){
159			$('#pa_weeks option').each(function () {
160				var optionVal = $(this).val();
161				if (optionVal === '') return;
162				console.log("RRRR:"+selectedDates);
163				if ( selectedDates == "january-11th-2027" ) {
164					$('#pa_weeks>option:nth-child(4)').addClass('opnone');
165				} else if ( selectedDates == "april-5th-2027" ) {
166					$('#pa_weeks>option:nth-child(3)').addClass('opnone');
167				} else if ( selectedDates == "december-1st-2027" ) {
168					$('#pa_weeks>option:nth-child(3), #pa_weeks>option:nth-child(4)').addClass('opnone');
169				} else {
170					$(this).removeClass('opnone');
171				}
172			});
173		}, 500);
174    });
175	
176	$('.postid-2591 #pa_starting-dates').on('change', function () {
177        var selectedDates = $(this).val();
178		$('#pa_weeks').val('');
179		
180        setTimeout(function(){
181			$('#pa_weeks option').each(function () {
182				var optionVal = $(this).val();
183				if (optionVal === '') return;
184				if ( selectedDates == "11-de-enero-de-2027" ) {
185					$('#pa_weeks>option:nth-child(4)').addClass('opnone');
186				} else if ( selectedDates == "5-de-abril-de-2027" ) {
187					$('#pa_weeks>option:nth-child(3)').addClass('opnone');
188				} else if ( selectedDates == "1-de-diciembre-de-2027" ) {
189					$('#pa_weeks>option:nth-child(3), #pa_weeks>option:nth-child(4)').addClass('opnone');
190				} else {
191					$(this).removeClass('opnone');
192				}
193			});
194		}, 500);
195    });
196	
197	$('.postid-2591 #pa_lessons-per-week, .postid-2591 #pa_study-year, .postid-2591 #pa_weeks').on('change', function () {
198        var selectedDates = $("#pa_starting-dates").val();
199		
200        setTimeout(function(){
201			$('#pa_weeks option').each(function () {
202				var optionVal = $(this).val();
203				if (optionVal === '') return;
204				console.log("RRRR:"+selectedDates);
205				if ( selectedDates == "11-de-enero-de-2027" ) {
206					$('#pa_weeks>option:nth-child(4)').addClass('opnone');
207				} else if ( selectedDates == "5-de-abril-de-2027" ) {
208					$('#pa_weeks>option:nth-child(3)').addClass('opnone');
209				} else if ( selectedDates == "1-de-diciembre-de-2027" ) {
210					$('#pa_weeks>option:nth-child(3), #pa_weeks>option:nth-child(4)').addClass('opnone');
211				} else {
212					$(this).removeClass('opnone');
213				}
214			});
215		}, 500);
216    });
217	
218	function filterPastDates() {
219        var today = new Date();
220        var lang = $('html').attr('lang');
221
222        var monthsEn = {
223            january: 0,
224            february: 1,
225            march: 2,
226            april: 3,
227            may: 4,
228            june: 5,
229            july: 6,
230            august: 7,
231            september: 8,
232            october: 9,
233            november: 10,
234            december: 11
235        };
236
237        var monthsEs = {
238            enero: 0,
239            febrero: 1,
240            marzo: 2,
241            abril: 3,
242            mayo: 4,
243            junio: 5,
244            julio: 6,
245            agosto: 7,
246            septiembre: 8,
247            octubre: 9,
248            noviembre: 10,
249            diciembre: 11
250        };
251
252        var monthNames = lang.includes('es') ? monthsEs : monthsEn;
253
254        $('#pa_starting-dates option').each(function () {
255            var val = $(this).val();
256            if (!val) return;
257
258            var yearMatch = val.match(/(\d{4})$/);
259            if (!yearMatch) return;
260
261            var year = parseInt(yearMatch[1]);
262            var month;
263
264            if (lang.includes('es')) {
265                var parts = val.split('-');
266                month = monthNames[parts[2]];
267            } else {
268                var parts = val.split('-');
269                month = monthNames[parts[0]];
270            }
271            if (month === undefined) return;
272            var optionDate = new Date(year, month, 1);
273            if (optionDate < today) {
274				console.log("testDD");
275//                 $(this).prop('disabled', true);
276				$(this).hide();
277
278            } else {
279                $(this).show();
280            }
281        });
282    }
283
284    filterPastDates();
285	
286	
287	function hidePastProgramDates() {
288
289        var today = new Date();
290        today.setHours(0,0,0,0);
291        var lang = $('html').attr('lang');
292
293        var monthsEn = {
294            jan: 0,
295            january: 0,
296            feb: 1,
297            february: 1,
298            mar: 2,
299            march: 2,
300            apr: 3,
301            april: 3,
302            may: 4,
303            jun: 5,
304            june: 5,
305            jul: 6,
306            july: 6,
307            aug: 7,
308            august: 7,
309            sep: 8,
310            sept: 8,
311            september: 8,
312            oct: 9,
313            october: 9,
314            nov: 10,
315            november: 10,
316            dec: 11,
317            december: 11
318        };
319
320        var monthsEs = {
321            enero: 0,
322            febrero: 1,
323            marzo: 2,
324            abril: 3,
325            mayo: 4,
326            junio: 5,
327            julio: 6,
328            agosto: 7,
329            septiembre: 8,
330            octubre: 9,
331            noviembre: 10,
332            diciembre: 11
333        };
334
335        $('#pa_program-dates option').each(function () {
336            var val = $(this).val();
337            if (!val) return;
338            var day, month, year;
339
340            if (lang.includes('es')) {
341                var firstPart = val.split('-al-')[0];
342                var parts = firstPart.split('-');
343
344                day = parseInt(parts[1]);
345                month = monthsEs[parts[3]];
346                year = parseInt(parts[5]);
347
348            } else {
349                var firstPart = val.split('-to-')[0];
350                var parts = firstPart.split('-');
351
352                day = parseInt(parts[0]);
353                month = monthsEn[parts[1].toLowerCase()];
354                year = parseInt(parts[2]);
355            }
356
357            if ( day === undefined || month === undefined || year === undefined ) {
358                return;
359            }
360            var startDate = new Date(year, month, day);
361
362            if (startDate < today) {
363                $(this).prop('disabled', true).hide();
364            } else {
365                $(this).prop('disabled', false).show();
366            }
367        });
368    }
369
370    hidePastProgramDates();
371});

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.