1/*_____ _ _ 2 / ____| | (_) 3| | ___ _ __ ___ ___ _ __ __| |_ __ _ 4| | / _ \| '_ \ / __/ _ \| '__/ _` | |/ _` | 5| |___| (_) | | | | (_| (_) | | | (_| | | (_| | 6 \_____\___/|_| |_|\___\___/|_| \__,_|_|\__,_| 7*/ 8 9//custom slider/rotator 10$(document).ready(function(){window.XDomainRequest&&jQuery.ajaxTransport(function(t){var e;if(t.crossDomain&&t.async)return t.timeout&&(t.xdrTimeout=t.timeout,delete t.timeout),{send:function(a,i){function n(t,a,n,r){e.onload=e.onerror=e.ontimeout=jQuery.noop,e=void 0,i(t,a,n,r)}(e=new XDomainRequest).onload=function(){n(200,"OK",{text:e.responseText},"Content-Type: "+e.contentType)},e.onerror=function(){n(404,"Not Found")},e.onprogress=jQuery.noop,e.ontimeout=function(){n(0,"timeout")},e.timeout=t.xdrTimeout||Number.MAX_VALUE,e.open(t.type,t.url),e.send(t.hasContent&&t.data||null)},abort:function(){e&&(e.onerror=jQuery.noop,e.abort())}}}),$(document).ready(function(){setTimeout(function(){$(".arrow.forward > a").attr("aria-label","next slide"),$(".arrow.back > a").attr("aria-label","previous slide");$(".panel > a").each(function(t){var e=$(this).attr("href");$(".panel"+(t+1)).attr("data-link",e)})},1500),sap={ui:{keycodes:{SPACE:32,ENTER:13}}},$(document).keydown(function(t){if($(t.target).is(".cur")){var e=$(".cur").attr("data-link");if(console.log(t.keyCode),t.keyCode==sap.ui.keycodes.SPACE||t.keyCode==sap.ui.keycodes.ENTER)return window.location.href=e,!1}})}),function(t){t.fn.swavSlider=function(e){var a,i,n,r,o,s,d,c,l,f,u,v,m,h=[],C=[],p=!1,b=t(this),g=t.extend({color:"#293c84",animation:5e3,transition:!0,flip:!1},e);function k(e,i){b.find(".slider-tab.active").removeClass("active"),b.find(".slider-tab").each(function(){t(this).attr("aria-selected","false")}),t(e).attr("aria-selected","true"),t(e).addClass("active"),a=t(e).attr("data-slide"),r=t(e).attr("data-slide-img"),t(".slider-item").attr("tabindex","-1"),t(".slider-item").children().attr("tabindex","-1"),function(e){b.find(".slider-item.active").removeClass("active").addClass("prev"),b.find(".slider-item").each(function(){t(this).attr("data-slide")===a&&t(this).addClass("active")}),s.css("background-image","url("+r+")"),"prev"===e?(s.css("left","-100%"),s.animate({left:"0"},500),t(".slider-item.active").css("left","-100%"),t(".slider-item.active").animate({left:"0"},500)):"next"===e&&(s.css("background-image","url("+r+")"),s.animate({left:"0"},500),t(".slider-item.active").animate({left:"0"},500));setTimeout(function(){o.css("background-image","url("+r+")"),s.animate({left:"100%"},0),t(".slider-item").not(".active").animate({left:"100%"},0)},500)}(i),t(".slider-item.active").attr("tabindex","0"),t(".slider-item.active").children().attr("tabindex","0")}function y(){if(!f)return!1;l=setInterval(function(){for(var t=0;t<h.length;t++)if(h[t].hasClass("active")){var e=h[t],a=h[t+1];e===i?(e.removeClass("active"),n.addClass("active"),k(n)):(e.removeClass("active"),a.addClass("active"),k(a));break}},c),!0}function x(){for(var t=0;t<h.length;t++)if(h[t].hasClass("active")){var e=h[t],a=h[t+1];e==i?(e.removeClass("active"),n.addClass("active"),k(n,"next"),n.focus()):(e.removeClass("active"),a.addClass("active"),k(a,"next"),a.focus());break}}function w(){for(var t=0;t<h.length;t++)if(h[t].hasClass("active")){var e=h[t],a=h[t-1];e==n?(e.removeClass("active"),i.addClass("active"),k(i,"prev"),i.focus()):(e.removeClass("active"),a.addClass("active"),k(a,"prev"),a.focus());break}}g.color,c=g.animation,f=g.transition,defaultFlip=g.flip,s=b.find(".rotator-bg"),d=b.find(".rotator-progress"),o=b.find(".rotator-image"),u=b.find(".slider-item"),v=t(u),m=0,v.each(function(){var e=t(this).outerHeight();t(this).outerWidth(),e>m&&(m=e)}),v.height(m),setTimeout(function(){b.find(".slider-item").each(function(e){if(t(this).css({left:"100%"}),0===e){var a=t(this).attr("data-slide-img");o.css("background-image","url("+a+")"),t(this).addClass("active"),t(this).css({left:"0"})}t(this).attr("data-slide",e+1),!1===p&&C.push(t(this))}),t(".rotator").addClass("loaded"),t.each(C,function(e){var a=C[e].attr("data-sli
10de"),i=C[e].find("h2").text(),n=C[e].attr("data-slide-img"),r=t("<div/>").appendTo(d).attr("role","tabpanel");t("<button/>").addClass("slider-tab").attr("data-slide",a).attr("data-slide-img",n).attr("aria-label",i).attr("href","#").attr("role","tab").attr("aria-selected","false").appendTo(r)}),b.find(".slider-tab").each(function(){!1===p&&h.push(t(this))}),!1===p&&(h[0].addClass("active"),i=t(h).get(-1),n=h[0],t(".slider-item").attr("tabindex","-1"),t(".slider-item").children().attr("tabindex","-1"),t(".slider-item.active").attr("tabindex","0"),t(".slider-item.active").children().attr("tabindex","0")),p=!0,y()},200),t(".link-container > a").css({}),t("<style type='text/css'> .slider-tab.active{ background-color:"+g.color+"!important} </style>").appendTo("head"),defaultFlip&&t(this).find(".rotator-container").addClass("alt"),b.find(".rotator-arrow.left").click(function(e){e.preventDefault(),w(),t(this).focus()}),b.find(".rotator-arrow.right").click(function(e){e.preventDefault(),x(),t(this).focus()}),b.find(".rotator-arrow.left").keydown(function(e){37==e.keyCode&&(console.log("butt"),w(),t(this).focus())}),b.find(".rotator-arrow.right").keydown(function(e){39==e.keyCode&&(console.log("butt"),x(),t(this).focus())}),t.fn.isChildOf=function(e){return t(e).has(this).length>0},t(document).on("click",".slider-tab",function(e){if(e.preventDefault(),t(this).isChildOf(b)){if(t(this).hasClass("active"))return!1;k(e.target,"next")}}),t("body").keydown(function(t){b.find(".slider-tab").is(":focus")&&(37===t.keyCode?w():39===t.keyCode&&x()),b.find(".slider-tab.active").is(":focus")&&13===t.keyCode&&b.find(".slide-container > .content").focus()}),b.focusin(function(){!1,clearInterval(l)}),b.focusout(function(){y()})}}(jQuery)}); 11 12$(document).ready(function () { 13 // set up request animation frame to help smooth scrolling animations 14 (function () { 15 var lastTime = 0; 16 var vendors = ['ms', 'moz', 'webkit', 'o']; 17 for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { 18 window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; 19 window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || 20 window[vendors[x] + 'CancelRequestAnimationFrame']; 21 } 22 23 if (!window.requestAnimationFrame) 24 window.requestAnimationFrame = function (callback, element) { 25 var currTime = new Date().getTime(); 26 var timeToCall = Math.max(0, 16 - (currTime - lastTime)); 27 var id = window.setTimeout(function () { 28 callback(currTime + timeToCall); 29 }, 30 timeToCall); 31 lastTime = currTime + timeToCall; 32 return id; 33 }; 34 35 if (!window.cancelAnimationFrame) 36 window.cancelAnimationFrame = function (id) { 37 clearTimeout(id); 38 }; 39 }()); 40 41 // detect IE 42 var IEversion = detectIE(); 43 44 if (IEversion !== false) { 45 // document.getElementById('result').innerHTML = 'IE ' + IEversion; 46 document.getElementsByTagName("body")[0].classList.add("ie"); 47 document.getElementsByTagName("body")[0].classList.add("ie" + IEversion); 48 } else { 49 // document.getElementById('result').innerHTML = 'NOT IE'; 50 } 51 52 // add details to debug result 53 // document.getElementById('details').innerHTML = window.navigator.userAgent; 54 55 /** 56 * detect IE 57 * returns version of IE or false, if browser is not Internet Explorer 58 */ 59 function detectIE() { 60 var ua = window.navigator.userAgent; 61 var msie = ua.indexOf('MSIE '); 62 if (msie > 0) { 63 // IE 10 or older => return version number 64 return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10); 65 } 66 67 var trident = ua.indexOf('Trident/'); 68 if (trident > 0) { 69 // IE 11 => return version number 70 var rv = ua.indexOf('rv:'); 71 return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10); 72 } 73 74 var edge = ua.indexOf('Edge/'); 75 if (edge > 0) { 76 // Edge (IE 12+) => return version number 77 return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10); 78 } 79 80 // other browser 81 return false; 82 } 83 84 var is_safari = navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 && navigator.userAgent.indexOf('Android') == -1; 85 if (is_safari) { 86 $("body").addClass("safari"); 87 } 88 89 // Global variables 90 var windowHeight = $(window).height(), 91 windowWidth = $(window).width(), 92 alreadyAnimated = false, 93 alreadyAnimatedCircles = false, 94 previousScrollPos = 0; 95 96 // show scroll top at the top or when you are scrolling up. Hides it when scrolling down 97 function hideShowHeader() { 98 var scroll = $(window).scrollTop(); 99 100 if (scroll < previousScrollPos) { 101 $("body").addClass("scrolling-up"); 102 103 } else { 104 $("body").removeClass("scrolling-up"); 105 106 } 107 if ($(window).scrollTop() === 0) { 108 $("body").removeClass("scrolling-up"); 109 } 110 111 if (scroll > 0) { 112 $("body").addClass("scrolled"); 113 } else { 114 $("body").removeClass("scrolled"); 115 } 116 117 setTimeout(function () { 118 previousScrollPos = scroll; 119 }, 100); 120 } 121 122 $(window).keydown(function (e) { 123 var code = (e.keyCode ? e.keyCode : e.which); 124 if (e.shiftKey) { 125 //Focus previous input 126 } else { 127 if (code === 27 && $('#searchMenu').hasClass('open')) { 128 searchToggle(); 129 } 130 if (code == 9 && $('#skipToContent:focus').length) { 131 $('h1').first().focus(); 132 } 133 } 134 }); 135 136 $('#skipToContent').click(function (e) { 137 e.preventDefault(); 138 $('h1:first').focus(); 139 }); 140 141 function removeFromTabindex() {
142 $('#mainNavSearchDropdown a, #mainNavSearchDropdown .head, #mainNavSearchDropdown input, #mainNavSearchDropdown button').attr("tabindex", "-1"); 143 } 144 removeFromTabindex(); 145 146 // animates the hamburger nav icon 147 $('#toggleMobileNav').click(function () { 148 console.log('clicked'); 149 $('body').toggleClass('mobile-nav-open'); 150 if ($('body').hasClass('mobile-nav-open')) { 151 $('#toggleMobileNav').text('close'); 152 } else { 153 $('#toggleMobileNav').text('menu'); 154 } 155 }); 156 157 // randomizes buttons becuase we need different styles for every one apparently 158 var randomButtonClasses = ["one", "two", "three", "four", "five", "six"]; 159 $('.white-button, .navy-button, .blue-button').each(function () { 160 $(this).addClass(randomButtonClasses[~~(Math.random() * randomButtonClasses.length)]); 161 }); 162 163 // Gives the right column in 'Text Left / Offset grid right' it's weird offset overlay thing 164 function setTextGridMaxHeight() { 165 if ($('#textOffsetGrid').length && windowWidth > 1028) { 166 var maxHeight = $('#offsetGridRightCol').height() - 25; 167 $('#textOffsetGrid').css('max-height', maxHeight); 168 } else if ($('#textOffsetGrid').length && windowWidth <= 1028) { 169 $('#textOffsetGrid').css('max-height', 'none'); 170 } 171 } 172 173 //adds a class of visible to each element with the class of animate when its in the viewport 174 function isVisible() { 175 setTimeout(function () { 176 $('.delay-load').each(function (i) { 177 var $item = $(this); 178 setTimeout(function () { 179 $item.addClass("visible"); 180 }, 250 * i); 181 }); 182 }, 3000); 183 184 $('.animate').each(function (i) { 185 var imagePos = $(this).offset().top, 186 topOfWindow = $(window).scrollTop(); 187 offset = $(this).data('offset'); 188 189 if (imagePos < (topOfWindow + windowHeight) - 50) { 190 191 192 if ($(this).hasClass('animate-circles')) { 193 var dis = $(this); 194 setTimeout(function () { 195 dis.addClass('visible'); 196 }, 200 * i); 197 $(this).dequeue(); 198 199 } else if ($(this).hasClass('home-quote') && alreadyAnimated === false) { 200 alreadyAnimated = true; 201 setTimeout(function () { 202 // animateQuoteLines(); 203 }, 500); 204 $(this).dequeue(); 205 } else { 206 $(this).delay(offset).queue(function () { 207 $(this).addClass("visible"); 208 $(this).dequeue(); 209 }); 210 } 211 } 212 }); 213 } 214 215 if ($(".rotator-right").length) { 216 $(".rotator-right").swavSlider({ 217 color: "#faa634", 218 animation: 2000, 219 transition: false 220 }); 221 } 222 223 if ($(".rotator-two").length) { 224 $(".rotator-two").swavSlider({ 225 color: "#faa634", 226 animation: 2000, 227 transition: false 228 }); 229 } 230 231 if ($(".rotator-three").length) { 232 $(".rotator-three").swavSlider({ 233 color: "#faa634", 234 animation: 2000, 235 transition: false 236 }); 237 } 238 239 if ($(".rotator-four").length) { 240 $(".rotator-four").swavSlider({ 241 color: "#faa634", 242 animation: 2000, 243 transition: false 244 }); 245 } 246 247 // Show full prgram list 248 $('#viewFullProgramList').click(function (e) { 249 e.preventDefault(); 250 $('.three-col-border-section').addClass('show-all'); 251 }); 252 253 // Scroll to top of page 254 $('.scrollup').click(function (e) { 255 e.preventDefault(); 256 $("html, body").animate({ 257 scrollTop: 0 258 }, 500); 259 return false; 260 }); 261 262 function scrollingFunction() { 263 isVisible(); 264 hideShowHeader(); 265 } 266 267 268 $(window).scroll(function () { 269 requestAnimationFrame(scrollingFunction); 270 }); 271 272 $(document).foundation(); 273 274 $('.is-accordion-submenu-parent').click(function (e) { 275 if ($(this).attr('aria-expanded') === "true") { 276 $(this).addClass('open'); 277 } else { 278 $(this).removeClass('open'); 279 } 280 }); 281 282 $(".mobile-filter-button, .mobile-filter-finished").on("click", function () { 283 if ($('.mobile-filter-button').hasClass("filter-opened")) { 284 $('.mobile-filter-button').removeClass("filter-opened"); 285 } else { 286 $('.mobile-filter-button').addClass("filter-opened"); 287 } 288 }); 289 290 //Move tabs to more tabs 291 function shuffleTabs() { 292 $('.tabs-title').prependTo('.tabs-list'); 293 $('.tabs-title').addClass('shown'); 294 var shuffleTabsInterval = setInterval(function () { 295 if ($('.nav-tabs .tabs-list').outerWidth() >= $('.tabs-wrapper').outerWidth()) { 296 if (windowWidth > 640) { 297 $('.more-dropdown').css('display', ''); 298 $('.tabs-list .tabs-title.shown').last().prependTo('.more-dropdown ul'); 299 $('.more-dropdown .tabs-title').removeClass('shown'); 300 } else { 301 $('#viewMoreTabs, .more-dropdown').hide(); 302 $('.tabs-title').prependTo('.tabs-list'); 303 $('.tabs-title').addClass('shown'); 304 clearInterval(shuffleTabsInterval); 305 $('.nav-tabs').css('overflow', 'visible'); 306 } 307 } else { 308 if (windowWidth >= 641 && windowWidth <= 1024) { 309 $('.more-dropdown').css('display', ''); 310 $('.tabs-list .tabs-title.shown').last().prependTo('.more-dropdown ul'); 311 $('.more-dropdown .tabs-title').removeClass('shown'); 312 } 313 clearInterval(shuffleTabsInterval); 314 $('.nav-tabs').css('overflow', 'visible'); 315 if ($('.more-dropdown ul .tabs-title').length) { 316 $('#viewMoreTabs').show(); 317 } else { 318 $('#viewMoreTabs').hide(); 319 } 320 } 321 }, 20); 322 } 323 $('#viewMoreTabs').on('click', function (e) { 324 e.preventDefault(); 325 }) 326 327 function moreActive(){ 328 $('.more-dropdown').removeClass('expanded'); 329 $('#viewMoreTabs').show; 330 setTimeout(function(){ 331 if($('.more-dropdown .tabs-title.is-active').length){ 332 $('#viewMoreTabs').addClass('active'); 333 console.log('active'); 334 } 335 else{ 336 $('#viewMoreTabs').removeClass('active'); 337 $('#viewMoreTabs').hide; 338 } 339 }, 100); 340 } 341 //close more tabs when tab is clicked 342 moreActive(); 343 $('.tabs-title').on('click', function (e) { 344 moreActive(); 345 }); 346 if($('.more-dropdown .tabs-title.is-active').length){ 347 $('#viewMoreTabs').addClass('active');
348 console.log('active'); 349 } 350 else{ 351 $('#viewMoreTabs').removeClass('active'); 352 } 353 354 shuffleTabs(); 355 356 function init() { 357 isVisible(); 358 setTextGridMaxHeight(); 359 //$('.hero.home-main .content-container .live-uncommon').css('display', 'block'); 360 } 361 362 function windowResize() { 363 isVisible(); 364 windowWidth = $(window).width(); 365 setTextGridMaxHeight(); 366 if ($('#mobile-menu').css('display') != 'block') { 367 $('#toggleMobileNav').text('menu'); 368 $('body').removeClass('mobile-nav-open'); 369 } else { 370 371 } 372 $('.nav-tabs').css('overflow', 'hidden'); 373 } 374 375 //on window stop resizing 376 var resizeTimer; 377 $(window).on('resize', function (e) { 378 clearTimeout(resizeTimer); 379 resizeTimer = setTimeout(function () { 380 shuffleTabs(); 381 moreActive(); 382 }, 250); 383 }); 384 385 //background video 386 //var bkg_video = $(".bkg-video").get(0); 387 388 $('#mobileNav').on('click', function(){ 389 if( $('#toggleTertiary').is(":hidden")) { 390 $('#mobileNav').removeClass('open'); 391 } else { 392 $('#mobileNav').addClass('open'); 393 } 394 $('#toggleTertiary .current').each(function(){ 395 $('#drilldown').foundation('_show', $('#drilldown').find(this)); 396 }); 397 }); 398 399 window.addEventListener("resize", windowResize); 400 401 init(); 402 403}) 404 405/* ===================================================== 406VIDEO MODAL/REVEAL 407===================================================== */ 408//class="play-video" data-video-id="#" data-video-type="youtube | wistia" 409$(document.body).on('click', '[data-video-id]', function(e) { 410 e.preventDefault(); //prevents jump scroll 411 var videoModal = new Foundation.Reveal( $('.video-modal') ); //specific modal for video 412 var videoID = $(this).data('video-id'); //unique id of video 413 var videoType = $(this).data('video-type'); //video company 414 var videoTitle = $(this).data('video-title'); //video title 415 var videoSrc = ""; //video source 416 417 if(videoType == "wistia") { 418 var videoSrc = "//fast.wistia.net/embed/iframe/"+videoID+"?videoFoam=false&autoPlay=true&playerColor=005596"; 419 } else if(videoType == "youtube") { 420 var videoSrc = "//www.youtube.com/embed/"+videoID+"?rel=0&controls=1&showinfo=0&autoplay=1&vq=hd1080&hd=1&modestbranding=1&color=white&iv_load_policy=3"; 421 } else if(videoType == "panopto") { 422 var videoSrc = "//cuwaa.hosted.panopto.com/Panopto/Pages/Embed.aspx?id="+videoID+"&autoplay=true&offerviewer=false&showtitle=false&showbrand=false&captions=false&interactivity=none&hideoverlay=false" 423 } 424 425 //if none of these data attributes are blank 426 if(videoType != "" && videoID != "" && videoSrc != "") 427 { 428 $('.video-modal iframe').attr("src", videoSrc); //change iframe source 429 if( videoTitle != "" ) { 430 $('.video-modal h3').text(videoTitle); //change title 431 } else { 432 $('.video-modal h3').text('Video'); 433 } 434 videoModal.open(); //open modal 435 } 436 else 437 { 438 console.log("ERROR: Required video data attribute missing.") 439 } 440}); 441 442/* ===================================================== 443EVENT MODAL/REVEAL - [DEPRECIATED] 444===================================================== */ 445/*$(document.body).on('click', '[data-event-id]', function(e) { 446 e.preventDefault(); //prevents jump scroll 447 var eventModal = new Foundation.Reveal( $('.event-modal') ); //specific modal for event 448 var eventID = $(this).data('event-id'); //unique id of event 449 450 //if the data attributes is not blank 451 if(eventID != "") 452 { 453 var eventSrc = "https://emsweb.cuw.edu/MasterCalendar/EventDetails.aspx?EventDetailId="+eventID; 454 $('.event-modal iframe').attr("src", eventSrc); //change iframe source 455 eventModal.open(); //open modal 456 } 457 else 458 { 459 console.log("ERROR: Required event data attribute missing.") 460 } 461});*/ 462 463/* ===================================================== 464VIDEO & EVENT MODAL/REVEAL CLOSE 465===================================================== */ 466$(window).on('closed.zf.reveal', function (e) { 467 e.preventDefault(); 468 //if video-modal has an iframe 469 if( $('.video-modal iframe, .event-modal iframe').length > 0) 470 { 471 $('.video-modal iframe, .event-modal iframe').attr("src", ""); //remove source to prevent video playing 472 } 473}); 474 475/* ===================================================== 476GET URL PARAMETER 477===================================================== */ 478function GetURLParameter(sParam) { 479 var sPageURL = decodeURIComponent(window.location.search.substring(1)), 480 sURLVariables = sPageURL.split('&'), 481 sParameterName, 482 i; 483 for (i = 0; i < sURLVariables.length; i++) { 484 sParameterName = sURLVariables[i].split('='); 485 if (sParameterName[0] === sParam) { 486 return sParameterName[1] === undefined ? true : sParameterName[1]; 487 } 488 } 489}; 490 491/* ===================================================== 492PASS PARAM > MACHFORMS 493===================================================== */ 494if( location.search && $('#mf_placeholder').length ) { 495 $('#mf_placeholder').attr('data-formurl', $('#mf_placeholder').attr('data-formurl') + location.search.replace('?','&') ); 496} 497 498/* ===================================================== 499PROGRAM PAGE > COURSELEAF 500===================================================== */ 501if ( $("[data-courseleaf]").attr('data-courseleaf') ) { 502
503 var getProgram = $("[data-courseleaf]").data("courseleaf").split('#'); 504 505 $.get("/_files/components/php/course-leaf.php?type=prg&tab=" + encodeURIComponent(getProgram[1]) + "&leaf=" + encodeURIComponent(getProgram[0]) ).done(function (data) { 506 $("[data-courseleaf]").html(data); 507 courseleaf(); 508 }).fail(function() { 509 $("[data-courseleaf]").html("<h3 class=\"text-center\">An Error Has Occured</h3>"); 510 }); 511} 512 513function courseleaf() { 514 $('.codecol').each(function(index) { 515 516 if( $(this).text() != "" || $(this).text() != null ) 517 { 518 var crsTD = $(this); 519 var crsTDtext = crsTD.find('.code_bubble').attr('data-code-bubble'); 520 if( !crsTDtext ) { 521 var crsTDtext = crsTD.text().replace('or','').replace(/\s/g,' ').split('/')[0]; 522 } 523 if(crsTDtext != "") 524 { 525 var getCourse = "https://catalog.cuw.edu/ribbit/?page=getcourse.rjs&subject=" + crsTDtext.trim(); 526 $.get("/_files/components/php/course-leaf.php?type=crs&leaf=" + encodeURIComponent(getCourse) ).done(function (data) { 527 var crsTitle = crsTD.parent().find("td:nth-child(2)").html(); 528 crsTD.parent().find("td:nth-child(2)").html(data).find('strong').html(crsTitle); 529 }); 530 } 531 } 532 }); 533} 534//Prevent click event 535$(document).on('click', "a.prevent, button.prevent", function (e) { 536 e.preventDefault(); 537}); 538 539/* ===================================================== 540PROGRAM PAGE > VIDEO GROUP 541===================================================== */ 542 543$('#video-select button').on('click', function(){ 544 $('#video-select button').attr({ 545 'aria-pressed': 'false', 546 'title': 'Play Video' 547 }); 548 $(this).attr({ 549 'aria-pressed': 'true', 550 'title': 'Current Video' 551 }); 552 $('#video-player iframe').attr({ 553 'src': 'https://fast.wistia.net/embed/iframe/' + $(this).attr('data-video') + '?web_component=true&seo=true&videoFoam=false&autoPlay=true&playerColor=005596', 554 'title': $(this).text().replace(/['"]/g, '"') 555 }).focus(); 556 557 var player = $('#video-player iframe'); 558 var playerTop = player.offset().top; 559 var playerHeight = player.height(); 560 var viewport = $(window).height();
561 var scrollPos = playerTop - ( (viewport - playerHeight) / 2 ); 562 563 $('html, body').animate({scrollTop: scrollPos}, 1000); 564}); 565 566$('#video-more').on('click', function(){ 567 $('#video-select').addClass('full'); 568 $('#video-select li.hide').removeClass('hide'); 569 $('#video-more').remove(); 570}); 571 572/* ===================================================== 573PRG MINI CTA / SHORT FORM 574===================================================== */ 575$('#slate-form').on('closeme.zf.reveal', function () { 576 var formURL = new URL('https://apply.cuw.edu/register/?output=embed'); 577 let urlParams = new URLSearchParams(window.location.search); 578 if (urlParams.has('utm_source')) { 579 let utmsource = urlParams.get('utm_source'); 580 formURL.searchParams.append('sys:field:utm_source', utmsource); 581 } 582 if (urlParams.has('utm_medium')) { 583 let utmmedium = urlParams.get('utm_medium'); 584 formURL.searchParams.append('sys:field:utm_medium', utmmedium); 585 } 586 if (urlParams.has('utm_campaign')) { 587 let utmcampaign = urlParams.get('utm_campaign'); 588 formURL.searchParams.append('sys:field:utm_campaign', utmcampaign); 589 } 590 if (urlParams.has('utm_term')) { 591 let utmterm = urlParams.get('utm_term'); 592 formURL.searchParams.append('sys:field:utm_term', utmterm); 593 } 594 if (urlParams.has('gclid')) { 595 let gclid = urlParams.get('gclid'); 596 formURL.searchParams.append('sys:field:gclid', gclid); 597 }
598 if (urlParams.has('utm_content')) { 599 let utmcontent = urlParams.get('utm_content'); 600 formURL.searchParams.append('sys:field:utm_content', utmcontent); 601 } 602 if (urlParams.has('attr')) { 603 let personattr = urlParams.get('attr'); 604 formURL.searchParams.append('sys:field:atrributes_person', personattr); 605 } 606 $('.slate-form-prefill [data-prefill]').each( function() { 607 if( $(this).val().trim() != '' ) { 608 formURL.searchParams.append($(this).attr('data-prefill'), $(this).val()); 609 } 610 }); 611 $('#slate-form-tag').remove(); 612 var script=document.createElement('script'); 613 script.setAttribute("id", "slate-form-tag"); 614 script.type='text/javascript'; 615 script.src=formURL; 616 $("body").append(script); 617}); 618 619/* ===================================================== 620DEFAULT MODAL/REVEAL 621===================================================== */ 622$(document.body).on('click', '[data-open]', function(e) { 623 e.preventDefault(); //prevents jump scroll 624}); 625 626/* ===================================================== 627SEARCH MENU 628===================================================== */ 629$('.toggle-search').click(function (e) { 630 e.preventDefault(); 631 searchToggle(); 632}); 633 634function searchToggle() { 635 $('body').toggleClass('overflow-hidden'); 636 //$('#searchMenu').toggleClass('open closed'); 637 638 if($('#searchMenu').hasClass('closed')) { 639 $('#searchMenu').show().removeClass('closed').attr('aria-hidden', 'false').attr('tabindex', '0'); 640 $('header, main, footer, .top-nav, .bottom-nav, .inner-nav').attr('aria-hidden', 'true'); 641 setTimeout(function () { 642 $('#searchMenu').addClass('open'); 643 }, 1); 644 setTimeout(function () { 645 $('#searchBar').focus(); 646 }, 500); 647 } else { 648 $('#searchBar').val(''); 649 $('#searchMenu').addClass('closed').removeClass('open').attr('aria-hidden', 'true').attr('tabindex', '-1'); 650 $('header, main, footer, .top-nav, .bottom-nav, .inner-nav').attr('aria-hidden', 'false'); 651 setTimeout(function () { 652 $('#openNavSearch').focus(); 653 $('#searchMenu').hide(); 654 }, 500); 655 } 656} 657 658/* ===================================================== 659MODAL CONTACT FORM 660===================================================== */ 661$('#contactModal').on('closeme.zf.reveal', function(){ 662 var field = $('#contactForm'); 663 var btn = $(this).find('.actions .btn.btn-primary'); 664 field.val(''); 665 btn.addClass('disabled').attr('aria-hidden', 'true').attr('tabindex', '-1'); 666 667 $(field).on('change', function() { 668 if( field.val() != '' ) { 669 btn.removeClass('disabled').attr('aria-hidden', 'false').attr('tabindex', '0'); 670 GAevent('click', 'cta modal val changed', 'program index: contact us'); 671 } else { 672 btn.addClass('disabled').attr('aria-hidden', 'true').attr('tabindex', '-1'); 673 } 674 }); 675 676 $('#contactModal .actions').on('click','.btn.btn-primary', function(e) { 677 e.preventDefault(); 678 if( field.val() ) { 679 window.location.href = field.val(); 680 } 681 }); 682}); 683 684/* ===================================================== 685LAZY LOAD BACKGROUND IMAGES 686===================================================== */ 687$(window).on("load resize scroll", function(){ 688 $('[data-lazybg]').not('.fadeIn, .loading').each(function() { 689 var element = $(this); 690 var offset = 100; 691 var top_of_element = element.offset().top - offset; 692 var bottom_of_element = element.offset().top + element.outerHeight() + offset; 693 var bottom_of_screen = $(window).scrollTop() + $(window).innerHeight(); 694 var top_of_screen = $(window).scrollTop(); 695 if ((bottom_of_screen > top_of_element) && (top_of_screen < bottom_of_element)){ 696 element.addClass('loading'); 697 var imgsrc = element.attr('data-lazybg'); 698 $('<img/>').attr('src', imgsrc).on('load', function() { 699 element.css('background-image','url(\'' + imgsrc + '\')').addClass('fadeIn').removeClass('loading'); 700 $(this).remove(); 701 }); 702 } 703 }); 704});
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.