PageSourceSearch

https://hct.ac.ae/wp-content/themes/HCTtheme/assets/js/customjs.js?ver=1790278365

js hct.ac.ae collected 2026-09-24 19:33:39 UTC 22,906 bytes, 623 lines download raw bytes

1$('.programs-list .nav li:first-child a').trigger('click');
2$('.concentrations-list .nav li:first-child a').trigger('click');
3$('.divisions-list .nav li:first-child a').trigger('click');
4var galleryHtml = '';
5var campusGalleryHtml = '';
6
7$("#hold_gallery .gallery .gallery-item img").each(function () {
8    galleryHtml += '<div class="item ">'
9        + '<div class="img-slide">'
10        + ' <img src="' + $(this).attr("src") + '" alt=""/>'
11        + '</div></div>';
12    campusGalleryHtml += '<div class="item">' +
13        '                        <div class="slider-panel" style="background-image: url(' + $(this).attr("src") + ')">' +
14        '                            <div class="slider-title">' +
15        '                                <h3>' + $(this).attr("alt") + '</h3>' +
16        '                            </div>' +
17        '                        </div>' +
18        '                    </div>';
19});
20
21$('.slide-details-img').append(galleryHtml);
22$('#thumbs').append(galleryHtml);
23$('#campusesImages').append(campusGalleryHtml);
24
25
26//date picker options
27$(document).ready(function () {
28    if (window.location.href.indexOf("/ar") > -1) {
29        $(".date-primary input,#datepickerFrom,#datepickerTo").datepicker({
30            dateFormat: 'yy-mm-dd',
31            isRTL: true,
32            changeMonth: true,
33            changeYear: true,
34            monthNamesShort: ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو',
35                'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'],
36            monthNames: ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو',
37                'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'],
38            dayNamesMin: ['س', 'ح', 'ن', 'ث', 'ر', 'خ', 'ج'],
39            nextText: 'التالي',
40            prevText: 'السابق'
41        });
42    } else {
43        $("#from_date,#to_date").datepicker({
44            dateFormat: 'yy-mm-dd',
45        });
46    }
47});
48
49//counter from 0 to number
50function Scrolled() {
51    $findme.each(function () {
52        var $section = $(this),
53            findmeOffset = $section.offset(),
54            findmeTop = findmeOffset.top,
55            findmeBottom = $section.height() + findmeTop,
56            scrollTop = $(document).scrollTop(),
57            visibleBottom = window.innerHeight,
58            prevVisible = $section.prop('_visible');
59        if ((findmeTop > scrollTop + visibleBottom) || findmeBottom < scrollTop) {
60            visible = false;
61        } else {
62            visible = true;
63        }
64        if (!prevVisible && visible) {
65            if (!exec) {
66                $('.fig-number').each(function () {
67                    $(this).prop('Counter', 0).animate({
68                        Counter: $(this).text()
69                    }, {
70                        duration: 4000,
71                        step: function (now) {
72                            $(this).text(Math.ceil(now));
73                            exec = true;
74                        }
75                    });
76                });
77            }
78        }
79        $section.prop('_visible', visible);
80    });
81}
82
83function Setup() {
84    var $top = $('#top'),
85        $bottom = $('#bottom');
86    $top.height(500);
87    $bottom.height(500);
88    $(window).scroll(function () {
89        Scrolled();
90    });
91}
92
93var $findme = $('#numbers');
94var exec = false;
95$(document).ready(function () {
96    Setup();
97});
98
99
100//remove default html from widget
101$('.textwidget').contents().unwrap();
102
103
104//Increase Decrease font size
105(function ($) {
106    $.fn.fontResize = function (options) {
107        var increaseCount = 0;
108        var self = this;
109        var changeFont = function (element, amount) {
110            var baseFontSize = parseInt(element.css('font-size'), 10);
111            var baseLineHeight = parseInt(element.css('line-height'), 10);
112            element.css('font-size', (baseFontSize + amount) + 'px');
113            element.css('line-height', (baseLineHeight + amount) + 'px');
114        };
115        options.increaseBtn.on('click', function (e) {
116            e.preventDefault();
117            if (increaseCount === 3) {
118                return;
119            }
120            self.each(function (index, element) {
121                changeFont($(element), 1);
122            });
123            increaseCount++;
124        });
125        options.decreaseBtn.on('click', function (e) {
126            e.preventDefault();
127            if (increaseCount === 0) {
128                return;
129            }
130            self.each(function (index, element) {
131                changeFont($(element), -1);
132            });
133            increaseCount--;
134        });
135    }
136})(jQuery);
137
138$(function () {
139    $('body,h1,h2,h3,h4,h5,h6,p,ul,ol,a,input').fontResize({
140        increaseBtn: $('.increase-font'),
141        decreaseBtn: $('.decrease-font')
142    });
143});
144
145
146
147//Handle theme colors
148function getCookie(cname) {
149    var name = cname + "=";
150    var decodedCookie = decodeURIComponent(document.cookie);
151    var ca = decodedCookie.split(';');
152    for (var i = 0; i < ca.length; i++) {
153        var c = ca[i];
154        while (c.charAt(0) == ' ') {
155            c = c.substring(1);
156        }
157        if (c.indexOf(name) == 0) {
158            return c.substring(name.length, c.length);
159        }
160    }
161    return "";
162}
163
164$(document).ready(function () {
165    var themeColor = getCookie('themeColor');
166    if (themeColor) {
167        $('.theme-handle').removeClass('selected');
168        $('body').removeClass('theme-blue theme-green theme-red theme-orange theme-gray');
169        $('#' + themeColor).addClass('selected');
170        $('body').addClass('theme-' + themeColor);
171    } else {
172        $('theme-handle-blue').addClass('selected');
173        $('body').addClass('theme-blue')
174    }
175    $('.theme-handle').on('click', function () {
176        var id = $(this).attr('id');
177        setCookie("themeColor", id, 1000);
178        $('.theme-handle').removeClass('selected');
179        $('body').removeClass('theme-blue theme-green theme-red theme-orange theme-gray');
180        $(this).addClass('selected');
181        $('body').addClass('theme-' + id);
182    });
183//Handle theme contrast
184    var themeContrast = getCookie('themeContrast');
185    if (themeContrast == '1') {
186        $('.high-contrast').addClass('selected');
187        $('html').addClass('theme-high-contrast');
188    } else {
189        $('.high-contrast').removeClass('selected');
190        $('html').removeClass('theme-high-contrast');
191    }
192    $('.high-contrast').on('click', function () {
193        if ($(this).hasClass('selected')) {
194            setCookie("themeContrast", "0", 1000);
195            $(this).removeClass('selected');
196            $('html').removeClass('theme-high-contrast');
197        } else {
198            setCookie("themeContrast", "1", 1000);
199            $(this).addClass('selected');
200            $('html').addClass('theme-high-contrast');
201        }
202    });
203//Handle theme night reading
204    var themeNight = getCookie('themeNight');
205    if (themeNight == '1') {
206        $('.night-reading').attr('checked', true);
207        $('body').addClass('theme-night');
208    }
209    $('.night-reading').on('click', function () {
210        if ($(this).prop("checked") == true) {
211            setCookie("themeNight", '1', 1000);
212            $('.night-reading').attr('checked', true);
213            $('body').addClass('theme-night');
214        } else if ($(this).prop("checked") == false) {
215            setCookie("themeNight", '0', 1000);
216            $('.night-reading').attr('checked', false);
217            $('body').removeClass('theme-night');
218        }
219    });
220//reset settings
221    $('#reset-settings').on('click', function () {
222        setTimeout(function () {
223            if ($('.night-reading').is(":checked")) {
224                $('.night-reading').trigger('click');
225            }
226            $('.decrease-font').trigger('click');
227            $('.decrease-font').trigger('click');
228            $('.decrease-font').trigger('click');
229        });
230        $('.theme-handle').removeClass('selected');
231        $('body').removeClass('theme-blue theme-green theme-red theme-orange theme-gray theme-night');
232        $('html').removeClass('theme-high-contrast');
233        $('#blue').addClass('selected');
234        $('body').addClass('theme-blue');
235        setCookie("themeColor", 'blue', 1000);
236        setCookie("themeContrast", '0', 1000);
237        setCookie("themeNight", '0', 1000);
238    });
239    $('#courseDescription .course-code-list').show();
240    $('#courseDescription .course-name-list').hide();
241    $('#courseDescription .search-type').on('change', function () {
242        var searchType = $(this).val();
243        if (searchType == '1') {
244            $('#courseDescription .course-code-list').show();
245            $('#courseDescription .course-name-list').hide();
246        }
247        if (searchType == '2') {
248            $('#courseDescription .course-name-list').show();
249            $('#courseDescription .course-code-list').hide();
250        }
251    });
252    $('#wpforms-submit-9500').hide();
253    $('#wpforms-submit-5802').hide();
254    $('#wpforms-9500-field_2-container').hide();
255    $('#wpforms-5802-field_2-container').hide();
256});
257
258$("input[name='wpforms[fields][1]").on('change', function () {
259    var radioValue = $(this).val();
260    if (radioValue == 'Yes' || radioValue == 'نعم') {
261        $(this).parents('.wpforms-form').find('.wpforms-submit').trigger('click');
262    } else {
263        $('#the-feedback-modal').trigger('click');
264    }
265});
266
267function setCookie(cname, cvalue, exdays) {
268    var d = new Date();
269    d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
270    var expires = "expires=" + d.toUTCString();
271    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
272}
273
274/*leaving the website confirmation start*/
275function getSiteLang() {
276    if (window.location.href.indexOf('/ar/') !== -1) {
277        return 'ar';
278    }
279    return 'en';
280}
281
282function confirmation() {
283    var lang = getSiteLang();
284    var confirmMsg;
285
286    if (lang === 'en') {
287        confirmMsg = 'You are leaving HCT website and entering a website that HCT does not control and may have different content and privacy policies.';
288    } else {
289        confirmMsg = 'أنت تغادر www.hct.ac.ae وتدخل إلى موقع لا تتحكم فيه كليات التقنية العليا ومن الممكن أن يحتوي على سياسة محتوى وخصوصية مختلفتين.';
290    }
291
292    return confirm(confirmMsg);
293}
294
295$(document).ready(function () {
296    $('a').on('click', function () {
297        if (this.host) {
298            var thisHost = this.host;
299            if (
300                !thisHost.includes('hct.ac.ae') &&
301                !thisHost.includes('addtoany') &&
302                !thisHost.includes('readspeaker.com')
303            ) {
304                $(this).attr('target', '_blank');
305                return confirmation();
306            }
307        }
308    });
309});
310/*leaving the website confirmation end*/
311
312
313/*abbreviations start*/
314$(document).ready(function () {
315    $.fn.findReplace = function (options) {
316        var settings = $.extend({
317            findText: null,
318            replaceText: ""
319        }, options);
320
321        return this.each(function () {
322            if ($(this).children().length === 0) {
323                var StringToFind = settings.findText;
324                if (!StringToFind) return;
325
326                var escaped = StringToFind.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
327                var regExpression = new RegExp(escaped, "g");
328
329                var replacement =
330                    '<span class="abbreviation" title="' +
331                    settings.replaceText + '">' +
332                    settings.findText +
333                    '</span>';
334
335                var str = $(this).text();
336                var strReplaced = str.replace(regExpression, replacement);
337                $(this).html(strReplaced);
338            }
339        });
340    };
341
342    // language detection
343    var lang = "en";
344    var noItems = "No results found !";
345
346    if (window.location.href.indexOf('/ar/') !== -1) {
347        lang = "ar";
348        noItems = "لم يتم العثور على نتائج";
349    }
350
351    var abbreviations_list = [];
352
353    var request = $.ajax({
354        async: true,
355        url: '/wp-json/wp/v2/abbreviation/?lang=' + lang,
356        method: "GET",
357        dataType: "json"
358    });
359
360    request.done(function (data) {
361        if (data && data.length > 0) {
362            $.each(data, function (index, value) {
363                abbreviations_list.push({
364                    name: value.title.rendered,
365                    value: value.acf.abbreviations_text
366                });
367            });
368
369            var $targets = $('main p, main span, main h4, main h5, main h6, main strong, main b, main blockquote, .home p, div.home span, div.home h4, div.home h5, div.home h6, div.home strong, div.home b, div.home blockquote');
370
371            $.each(abbreviations_list, function (i, v) {
372                $targets.findReplace({
373                    findText: v.name,
374                    replaceText: v.value
375                });
376            });
377        } else {
378            
379        }
380    });
381
382    request.fail(function (jqXHR, textStatus) {
383        
384    });
385});
386/*abbreviations end*/
387
388
389
390
391/*Browser Version Alert*/
392(function() {
393
394    // 1) Detect Internet Explorer
395    var isIE = !!window.ActiveXObject || "ActiveXObject" in window;
396    if (isIE) {
397        alert('To see our website in better preview, Please update your browser to the latest version');
398        return;
399    }
400
401    // 2) Detect Edge (Chromium or Legacy)
402    function getEdgeVersion() {
403        var ua = navigator.userAgent;
404
405        // Edge Chromium → Edg/120.0
406        var chromium = ua.match(/Edg\/(\d+)/);
407        if (chromium) return parseInt(chromium[1], 10);
408
409        // Edge Legacy → Edge/18.19041
410        var legacy = ua.match(/Edge\/(\d+)/);
411        if (legacy) return parseInt(legacy[1], 10);
412
413        return null;
414    }
415
416    var edgeVersion = getEdgeVersion();
417
418    if (edgeVersion !== null && edgeVersion < 75) {
419        alert('To see our website in better preview, Please update your browser to the latest version');
420    }
421
422})();
423
424
425
426
427
428$(document).ready(function () {
429    setTimeout(function () {
430        if (window.location.href.indexOf('/ar/') != -1) {
431            $('.customerpulse-rate').prop('title', 'نبض المتعاملين');
432            $('.purechat-collapsed-image').prop('title', 'الدردشة المباشرة');
433            $('.km-anonymous-chat-launcher').prop('title', 'المساعد الرقمي');
434        } else {
435            $('.customerpulse-rate').prop('title', 'Customer Pulse');
436            $('.purechat-collapsed-image').prop('title', 'Live Chat');
437            $('.km-anonymous-chat-launcher').prop('title', 'Chat bot');
438        }
439    }, 4000);
440});
441
442
443$(document).ready(function () {
444    $(function () {
445        var availableTags = [];
446        if (window.location.href.indexOf('/en/') != -1) {
447            var availableTags = [
448                "programs",
449                "campuses",
450                "services",
451                "opendata",
452                "open data",
453                "news",
454                "Applied Media",
455                "Business",
456                "Computer Information Science",
457                "Engineering Technology & Science",
458                "Education",
459                "Health Sciences",
460                "General Academic Requirements Division",
461                "Admissions",
462                "Entry Requirements",
463                "FAQ",
464                "Information For Applicants",
465                " Abu Dhabi Men’s Campus",
466                "Abu Dhabi Women’s Campus",
467                "Al Ain Men’s Campus",
468                "Al Ain Women’s Campus",
469                "Dubai Men’s Campus",
470                "Dubai Women’s Campus",
471                "Fujairah Men’s Campus",
472                "Fujairah Women’s Campus",
473                "Madinat Zayed Men’s Campuses",
474                "Madinat Zayed Women’s Campuses",
475                "Ras Al Khaimah Men’s Campus",
476                "Ras Al Khaimah Women’s Campus",
477                "Ruwais Men's Campuses",
478                "Ruwais Women’s Campuses",
479                "Sharjah Men’s Campus",
480                "Sharjah Women’s Campus",
481                "Open Data",
482                "Propose Or Request Data",
483                "Open Data Policy",
484                "Media Center",
485                "HCT News",
486                "Events",
487                "Photo Gallery",
488                "Video Gallery",
489                "Social Media",
490                "Weekly Media Reports",
491                "Media Kit",
492                "HCT Mobile",
493                "E-Services",
494                "Priority Services",
495                "Academic",
496                "Student Life",
497                "IT Services",
498                "Library Services",
499                "Employability And Career Services",
500                "Engage",
501                "Participate Digitally",
502                "Contact Higher Management",
503                "Customer Satisfaction Survey",
504                "E-Participation Policy",
505                "Feedback Results",
506                "Research And White Paper",
507                "Academic Calendar",
508                "Strategy",
509                "Student Engagement",
510                "HCT Portal",
511                "Careers",
512                "Business & Industry",
513                "Environment, Health & Safety",
514                "Website Information",
515                "Contact Us",
516                "Sitemap",
517                "Student Life",
518                "e-Credential Verification",
519                "parents",
520                "future students",
521                "current students",
522                "alumni",
523                "faculty & staff",
524            ];
525        } else {
526            var availableTags = [
527                " من نحن",
528                " مجلس أمناء كليات التقنية العليا",
529                "رسالة رئيس كليات التقنية العليا",
530                "  القيادات العليا",
531                "مركز التفوق للأبحاث التطبيقية والتدريب (سيرت)",
532                " الشراكات",
533                " المبادرات",
534                " جهود الاستدامة",
535                "البرامج",
536                "الاتصال التطبيقي",
537                "إدارة الأعمال",
538                "علوم الكمبيوتر والمعلومات",
539                "تكنولوجيا الهندسة والعلوم",
540                "التعليم",
541                "العلوم الصحية",
542                "قسم المتطلبات الأكاديمية العامة",
543                " القبول",
544                " متطلبات القبول",
545                "الأسئلة الشائعة",
546                "معلومات للمتقدمين بطلب التحاق",
547                "الكليات",
548                " كلية أبوظبي للطلاب",
549                "كلية أبوظبي للطالبات",
550                "كلية العين للطلاب",
551                " كلية العين للطالبات",
552                "كلية دبي للطلاب",
553                " كلية دبي للطالبات",
554                " كلية الفجيرة للطلاب",
555                " كلية الفجيرة للطالبات",
556                " كليات مدينة زايد للطلاب",
557                " كليات مدينة زايد للطالبات",
558                "كلية رأس الخيمة للطلاب",
559                "كلية رأس الخيمة للطالبات",
560                " كليات الرويس للطلاب",
561                "كليات الرويس للطالبات",
562                " كلية الشارقة للطلاب",
563                "كلية الشارقة للطالبات",
564                " فهرس الخدمات",
565                " الخدمات ذات الأولوية",
566                " الخدمات الأكاديمية",
567                "خدمات الطلبة",
568                " خدمات تكنولوجيا المعلومات",
569                " خدمات المكتبات",
570                "التنمية الوظيفية والخدمات المهنية",
571                " المشاركة الإلكترونية",
572                " شارك رقمياً",
573                "تواصل مع الإدارة العليا",
574                " استبيان رضا المتعاملين",
575                " سياسة المشاركة الإلكترونية",
576                "نتيجة مسح رضا المتعاملين",
577                " شارك.إمارات",
578                " البحوث والتقارير",
579                "البيانات المفتوحة",
580                " اقتراح/طلب بيانات",
581                " سياسة البيانات المفتوحة",
582                " المركز الإعلامي",
583                " أخبار الكليات",
584                " الفعاليات",
585                " معرض الصور",
586                " معرض الفيديو",
587                " وسائل التواصل الإجتماعي",
588                " التقارير الاسبوعية",
589                "المواد الإعلامية",
590                " تطبيق الهاتف المحمول",
591                " الطلبة الجدد",
592                " أولياء الأمور",
593                " الطلبة الحاليين",
594                " الموظفون",
595            ];
596        }
597        $(".ui-widget input").autocomplete({
598            source: availableTags
599        });
600    });
601});
602
603
604$(document).ready(function () {
605    if (window.location.href.indexOf('/en/') != -1) {
606        var subscribe = "Subscribe";
607        var readmore = "Read more";
608    } else {
609        var subscribe = "اشترك";
610        var readmore = "المزيد";
611    }
612    $('#wpforms-submit-9496').attr('title', subscribe);
613    $('.see-more').attr('title', readmore);
614});
615
616
617$(document).ready(function () {
618    $('.full-text').hide();
619    $(".item-description .show-more").click(function () {
620        $(this).parents('.desc-text').find('.full-text').show();
621        $(this).remove();
622    });
623});

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.