1// Modernizr 2 3/* Modernizr 2.6.2 (Custom Build) | MIT & BSD 4 * Build: http://modernizr.com/download/#-shiv-mq-cssclasses-teststyles-load 5 */ 6/* Modernizr 2.6.2 (Custom Build) | MIT & BSD 7 * Build: http://modernizr.com/download/#-touch-shiv-mq-cssclasses-teststyles-prefixes-load 8 */ 9;window.Modernizr=function(e,t,n){function A(e){f.cssText=e}function O(e,t){return A(p.join(e+";")+(t||""))}function M(e,t){return typeof e===t}function _(e,t){return!!~(""+e).indexOf(t)}function D(e,t){for(var r in e){var i=e[r];if(!_(i,"-")&&f[i]!==n){return t=="pfx"?i:true}}return false}function P(e,t,r){for(var i in e){var s=t[e[i]];if(s!==n){if(r===false)return e[i];if(M(s,"function")){return s.bind(r||t)}return s}}return false}function H(e,t,n){var r=e.charAt(0).toUpperCase()+e.slice(1),i=(e+" "+v.join(r+" ")+r).split(" ");if(M(t,"string")||M(t,"undefined")){return D(i,t)}else{i=(e+" "+m.join(r+" ")+r).split(" ");return P(i,t,n)}}function B(){i["input"]=function(n){for(var r=0,i=n.length;r<i;r++){w[n[r]]=!!(n[r]in l)}if(w.list){w.list=!!(t.createElement("datalist")&&e.HTMLDataListElement)}return w}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));i["inputtypes"]=function(e){for(var r=0,i,s,u,a=e.length;r<a;r++){l.setAttribute("type",s=e[r]);i=l.type!=="text";if(i){l.value=c;l.style.cssText="position:absolute;visibility:hidden;";if(/^range$/.test(s)&&l.style.WebkitAppearance!==n){o.appendChild(l);u=t.defaultView;i=u.getComputedStyle&&u.getComputedStyle(l,null).WebkitAppearance!=="textfield"&&l.offsetHeight!==0;o.removeChild(l)}else if(/^(search|tel)$/.test(s)){}else if(/^(url|email)$/.test(s)){i=l.checkValidity&&l.checkValidity()===false}else{i=l.value!=c}}b[e[r]]=!!i}return b}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var r="2.6.2",i={},s=true,o=t.documentElement,u="modernizr",a=t.createElement(u),f=a.style,l=t.createElement("input"),c=":)",h={}.toString,p=" -webkit- -moz- -o- -ms- ".split(" "),d="Webkit Moz O ms",v=d.split(" "),m=d.toLowerCase().split(" "),g={svg:"http://www.w3.org/2000/svg"},y={},b={},w={},E=[],S=E.slice,x,T=function(e,n,r,i){var s,a,f,l,c=t.createElement("div"),h=t.body,p=h||t.createElement("body");if(parseInt(r,10)){while(r--){f=t.createElement("div");f.id=i?i[r]:u+(r+1);c.appendChild(f)}}s=["­",'<style id="s',u,'">',e,"</style>"].join("");c.id=u;(h?c:p).innerHTML+=s;p.appendChild(c);if(!h){p.style.background="";p.style.overflow="hidden";l=o.style.overflow;o.style.overflow="hidden";o.appendChild(p)}a=n(c,e);if(!h){p.parentNode.removeChild(p);o.style.overflow=l}else{c.parentNode.removeChild(c)}return!!a},N=function(t){var n=e.matchMedia||e.msMatchMedia;if(n){return n(t).matches}var r;T("@media "+t+" { #"+u+" { position: absolute; } }",function(t){r=(e.getComputedStyle?getComputedStyle(t,null):t.currentStyle)["position"]=="absolute"});return r},C=function(){function r(r,i){i=i||t.createElement(e[r]||"div");r="on"+r;var s=r in i;if(!s){if(!i.setAttribute){i=t.createElement("div")}if(i.setAttribute&&i.removeAttribute){i.setAttribute(r,"");s=M(i[r],"function");if(!M(i[r],"undefined")){i[r]=n}i.removeAttribute(r)}}i=null;return s}var e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return r}(),k={}.hasOwnProperty,L;if(!M(k,"undefined")&&!M(k.call,"undefined")){L=function(e,t){return k.call(e,t)}}else{L=function(e,t){return t in e&&M(e.constructor.prototype[t],"undefined")}}if(!Function.prototype.bind){Function.prototype.bind=function(t){var n=this;if(typeof n!="function"){throw new TypeError}var r=S.call(arguments,1),i=function(){if(this instanceof i){var e=function(){};e.prototype=n.prototype;var s=new e;var o=n.apply(s,r.concat(S.call(arguments)));if(Object(o)===o){return o}return s}else{return n.apply(t,r.concat(S.call(arguments)))}};return i}}y["flexbox"]=function(){return H("flexWrap")};y["flexboxlegacy"]=function(){return H("boxDirection")};y["canvas"]=function(){var e=t.createElement("canvas");return!!(e.getContext&&e.getContext("2d"))};y["canvastext"]=function(){return!!(i["canvas"]&&M(t.createElement("canvas").getContext("2d").fillText,"function"))};y["webgl"]=function(){return!!e.WebGLRenderingContext};y["touch"]=function(){var n;if("ontouchstart"in e||e.DocumentTouch&&t instanceof DocumentTouch){n=true}else{T(["@media (",p.join("touch-enabled),("),u,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(e){n=e.offsetTop===9})}return n};y["geolocation"]=function(){return"geolocation"in navigator};y["postmessage"]=function(){return!!e.postMessage};y["websqldatabase"]=function(){return!!e.openDatabase};y["indexedDB"]=function(){return!!H("indexedDB",e)};y["hashchange"]=function(){return C("hashchange",e)&&(t.documentMode===n||t.documentMode>7)};y["history"]=function(){return!!(e.history&&history.pushState)};y["draganddrop"]=function(){var e=t.createElement("div");return"draggable"in e||"ondragstart"in e&&"ondrop"in e};y["websockets"]=function(){return"WebSocket"in e||"MozWebSocket"in e};y["rgba"]=function(){A("background-color:rgba(150,255,150,.5)");return _(f.backgroundColor,"rgba")};y["hsla"]=function(){A("background-color:hsla(120,40%,100%,.5)");return _(f.backgroundColor,"rgba")||_(f.backgroundColor,"hsla")};y["multiplebgs"]=function(){A("background:url(https://),url(https://),red url(https://)");return/(url\s*\(.*?){3}/.test(f.background)};y["backgroundsize"]=function(){return H("backgroundSize")};y["borderimage"]=function(){return H("borderImage")};
9y["borderradius"]=function(){return H("borderRadius")};y["boxshadow"]=function(){return H("boxShadow")};y["textshadow"]=function(){return t.createElement("div").style.textShadow===""};y["opacity"]=function(){O("opacity:.55");return/^0.55$/.test(f.opacity)};y["cssanimations"]=function(){return H("animationName")};y["csscolumns"]=function(){return H("columnCount")};y["cssgradients"]=function(){var e="background-image:",t="gradient(linear,left top,right bottom,from(#9f9),to(white));",n="linear-gradient(left top,#9f9, white);";A((e+"-webkit- ".split(" ").join(t+e)+p.join(n+e)).slice(0,-e.length));return _(f.backgroundImage,"gradient")};y["cssreflections"]=function(){return H("boxReflect")};y["csstransforms"]=function(){return!!H("transform")};y["csstransforms3d"]=function(){var e=!!H("perspective");if(e&&"webkitPerspective"in o.style){T("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(t,n){e=t.offsetLeft===9&&t.offsetHeight===3})}return e};y["csstransitions"]=function(){return H("transition")};y["fontface"]=function(){var e;T('@font-face {font-family:"font";src:url("https://")}',function(n,r){var i=t.getElementById("smodernizr"),s=i.sheet||i.styleSheet,o=s?s.cssRules&&s.cssRules[0]?s.cssRules[0].cssText:s.cssText||"":"";e=/src/i.test(o)&&o.indexOf(r.split(" ")[0])===0});return e};y["generatedcontent"]=function(){var e;T(["#",u,"{font:0/0 a}#",u,':after{content:"',c,'";visibility:hidden;font:3px/1 a}'].join(""),function(t){e=t.offsetHeight>=3});return e};y["video"]=function(){var e=t.createElement("video"),n=false;try{if(n=!!e.canPlayType){n=new Boolean(n);n.ogg=e.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"");n.h264=e.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"");n.webm=e.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}}catch(r){}return n};y["audio"]=function(){var e=t.createElement("audio"),n=false;try{if(n=!!e.canPlayType){n=new Boolean(n);n.ogg=e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"");n.mp3=e.canPlayType("audio/mpeg;").replace(/^no$/,"");n.wav=e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"");n.m4a=(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,"")}}catch(r){}return n};y["localstorage"]=function(){try{localStorage.setItem(u,u);localStorage.removeItem(u);return true}catch(e){return false}};y["sessionstorage"]=function(){try{sessionStorage.setItem(u,u);sessionStorage.removeItem(u);return true}catch(e){return false}};y["webworkers"]=function(){return!!e.Worker};y["applicationcache"]=function(){return!!e.applicationCache};y["svg"]=function(){return!!t.createElementNS&&!!t.createElementNS(g.svg,"svg").createSVGRect};y["inlinesvg"]=function(){var e=t.createElement("div");e.innerHTML="<svg/>";return(e.firstChild&&e.firstChild.namespaceURI)==g.svg};y["smil"]=function(){return!!t.createElementNS&&/SVGAnimate/.test(h.call(t.createElementNS(g.svg,"animate")))};y["svgclippaths"]=function(){return!!t.createElementNS&&/SVGClipPath/.test(h.call(t.createElementNS(g.svg,"clipPath")))};for(var j in y){if(L(y,j)){x=j.toLowerCase();i[x]=y[j]();E.push((i[x]?"":"no-")+x)}}i.input||B();i.addTest=function(e,t){if(typeof e=="object"){for(var r in e){if(L(e,r)){i.addTest(r,e[r])}}}else{e=e.toLowerCase();if(i[e]!==n){return i}t=typeof t=="function"?t():t;if(typeof s!=="undefined"&&s){o.className+=" "+(t?"":"no-")+e}i[e]=t}return i};A("");a=l=null;(function(e,t){function l(e,t){var n=e.createElement("p"),r=e.getElementsByTagName("head")[0]||e.documentElement;n.innerHTML="x<style>"+t+"</style>";return r.insertBefore(n.lastChild,r.firstChild)}function c(){var e=g.elements;return typeof e=="string"?e.split(" "):e}function h(e){var t=a[e[o]];if(!t){t={};u++;e[o]=u;a[u]=t}return t}function p(e,n,s){if(!n){n=t}if(f){return n.createElement(e)}if(!s){s=h(n)}var o;if(s.cache[e]){o=s.cache[e].cloneNode()}else if(i.test(e)){o=(s.cache[e]=s.createElem(e)).cloneNode()}else{o=s.createElem(e)}return o.canHaveChildren&&!r.test(e)?s.frag.appendChild(o):o}function d(e,n){if(!e){e=t}if(f){return e.createDocumentFragment()}n=n||h(e);var r=n.frag.cloneNode(),i=0,s=c(),o=s.length;for(;i<o;i++){r.createElement(s[i])}return r}function v(e,t){if(!t.cache){t.cache={};t.createElem=e.createElement;t.createFrag=e.createDocumentFragment;t.frag=t.createFrag()}e.createElement=function(n){if(!g.shivMethods){return t.createElem(n)}return p(n,e,t)};e.createDocumentFragment=Function("h,f","return function(){"+"var n=f.cloneNode(),c=n.createElement;"+"h.shivMethods&&("+c().join().replace(/\w+/g,function(e){t.createElem(e);t.frag.createElement(e);return'c("'+e+'")'})+");return n}")(g,t.frag)}function m(e){if(!e){e=t}var n=h(e);if(g.shivCSS&&!s&&!n.hasCSS){n.hasCSS=!!l(e,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{dis
vendor: 5,470 bytes, lines 9-20
9play:block}"+"mark{background:#FF0;color:#000}")}if(!f){v(e,n)}return e}var n=e.html5||{};var r=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;var i=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;var s;var o="_html5shiv";var u=0;var a={};var f;(function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>";s="hidden"in e;f=e.childNodes.length==1||function(){t.createElement("a");var e=t.createDocumentFragment();return typeof e.cloneNode=="undefined"||typeof e.createDocumentFragment=="undefined"||typeof e.createElement=="undefined"}()}catch(n){s=true;f=true}})();var g={elements:n.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:n.shivCSS!==false,supportsUnknownElements:f,shivMethods:n.shivMethods!==false,type:"default",shivDocument:m,createElement:p,createDocumentFragment:d};e.html5=g;m(t)})(this,t);i._version=r;i._prefixes=p;i._domPrefixes=m;i._cssomPrefixes=v;i.mq=N;i.hasEvent=C;i.testProp=function(e){return D([e])};i.testAllProps=H;i.testStyles=T;i.prefixed=function(e,t,n){if(!t){return H(e,"pfx")}else{return H(e,t,n)}};o.className=o.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(s?" js "+E.join(" "):"");return i}(this,this.document); 10 11/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ 12/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ 13window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.documentElement,e=d.firstElementChild||d.firstChild,f=a.createElement("body"),g=a.createElement("div");return g.id="mq-test-1",g.style.cssText="position:absolute;top:-100em",f.style.background="none",f.appendChild(g),function(a){return g.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document); 14 15/*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ 16(function(a){"use strict";function x(){u(!0)}var b={};if(a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,!b.mediaQueriesSupported){var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var b=m.shift();v(b.href,function(c){p(c,b.href,b.media),h[b.href]=!0,a.setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(b){var h="clientWidth",k=d[h],m="CSS1Compat"===c.compatMode&&k||c.body[h]||k,n={},o=l[l.length-1],p=(new Date).getTime();if(b&&q&&i>p-q)return a.clearTimeout(r),r=a.setTimeout(u,i),void 0;q=p;for(var v in e)if(e.hasOwnProperty(v)){var w=e[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?t||s():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?t||s():1)),w.hasquery&&(z&&A||!(z||m>=x)||!(A||y>=m))||(n[w.media]||(n[w.media]=[]),n[w.media].push(f[w.rules]))}for(var C in g)g.hasOwnProperty(C)&&g[C]&&g[C].parentNode===j&&j.removeChild(g[C]);for(var D in n)if(n.hasOwnProperty(D)){var E=c.createElement("style"),F=n[D].join("\n");E.type="text/css",E.media=D,j.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(c.createTextNode(F)),g.push(E)}},v=function(a,b){var c=w();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)}})(this); 17 18// 19// BREI Script for SBU Main Site 20//
21// Theme located at /App_Data/Sitefinity/WebsiteTemplates/YourTemplate/App_Themes/BREITheme/* 22// This file is in the root because I was unable to get the ResourceLink to correctly load javascript files located inside the theme. 23// 24// We are loading in a closure to prevent global data leaks 25// Include aliases for jQuery, window, document, Modernizr, and undefined 26(function( $, window, document, Modernizr, undefined ) { 27 // Namespace 28 var SBU = SBU || {}; 29 30 /** 31 * Initialize scripts 32 * @return {null} returns nothing 33 */ 34 SBU.init = function () { 35 36 SBU.buildVideos(); 37 38 SBU.mobileTabs(); 39 40 SBU.toggleCallouts(); 41 SBU.toggleVideoCallouts(); 42 43 SBU.mainNavigation(); 44 45 SBU.toggleNav(); 46 SBU.fancyBox(); 47 } 48 49 /** 50 * Main navigation dropdown support for tablets 51 * @return {null} returns nothing 52 */ 53 SBU.mainNavigation = function () { 54 55 $(".main-nav .rmRootLink").off("click"); 56 $(".main-nav .rmRootLink").on("click", function(e) { 57 58 var $that = $(this), 59 disp = $that.parent().hasClass("activated"); 60 61 e.preventDefault(); 62 63 if (Modernizr.touch) { 64 65 if (Modernizr.mq("only screen and (max-width: 56em)")) { 66 67 window.location.href = $that.attr("href"); 68 69 } else { 70 71 if (!disp) { 72 73 $that.addClass('rmExpanded'); 74 setTimeout(function(){$that.parent().addClass("activated");},1000); 75 76 } else { 77 78 window.location.href = $that.attr("href"); 79 80 } 81 82 } 83 84 } else { 85 86 window.location.href = $that.attr("href"); 87 88 } 89 90 return false; 91 92 }); 93 94 $("#page").off("touchstart") 95 $("#page").on("touchstart", function () { 96 if ($(".activated").length == 0) { 97 $(".main-nav .rmExpanded").removeClass("rmExpanded"); 98 $(".rmSlide").hide(); 99 $(".activated").removeClass("activated"); 100 } 101 }); 102 103 } 104 105 /** 106 * Enable callout toggling on mobile 107 * @return {null} returns nothing 108 */ 109 SBU.toggleCallouts = function () { 110 111 var callouts = $(".callout, .faculty-feature"); 112 113 callouts.each(function () { 114 115 var $h = $(this).find("h2"); 116
117 $h.off("click"); 118 $h.on("click", function() { 119 120 if ($(this).css("cursor") == "pointer") { 121 122 var parent = $(this).parents("div").first(); 123 124 parent.toggleClass("show-content"); 125 126 } 127 128 }); 129 130 }); 131 132 } 133 134 /** 135 * Enable callout toggling on mobile 136 * @return {null} returns nothing 137 */ 138 SBU.toggleVideoCallouts = function () { 139 140 var callouts = $(".video-callout"); 141 142 callouts.each(function () { 143 144 var $h = $(this).find("h2"); 145 146 $h.off("click"); 147 $h.on("click", function() { 148 149 if ($(this).css("cursor") == "pointer") { 150 151 var parent = $(this).parents("div").first(); 152 153 if (parent.hasClass("show-content")) { 154 155 // Destroy video 156 parent.find(".video").remove(); 157 158 parent.removeClass("show-content"); 159 160 } else { 161 162 SBU.buildVideo(parent); 163 164 parent.addClass("show-content"); 165 } 166 167 } 168 169 }); 170 171 }); 172 173 } 174 175 /** 176 * Enable navigation toggling on mobile 177 * @return {null} returns nothing 178 */ 179 SBU.toggleNav = function () { 180 181 var $nav = $(".left-nav-wrapper .rtsLevel .rtsFirst"); 182 183 $nav.off("click"); 184 $nav.on("click", function(e) { 185 186 var $that = $(this); 187 188 if ($nav.css("cursor") == "pointer") { 189 190 e.preventDefault(); 191 192 var parent = $nav.parents("div").first(); 193 194 parent.toggleClass("show-full-nav"); 195 196 return false; 197 198 } else { 199 200 return true; 201 202 } 203 204 }); 205 206 } 207 208 /** 209 * Build video callouts 210 * @return {null} returns nothing 211 */ 212 SBU.buildVideos = function () { 213 214 // Grab all existing callouts 215 SBU.$elm.videos = $(".video-callout"); 216 217 // Iterate through callouts. If none exist, this block will be skipped 218 SBU.$elm.videos.each(function () { 219 220 var $that = $(this); 221 222 SBU.buildVideo($that); 223 224 }); 225 226 } 227 228 /** 229 * Build one video callout 230 * @param {jQuery Object} $el object of video callout 231 * @return {null} returns nothing 232 */ 233 SBU.buildVideo = function ($el) { 234 235 // Declarations 236 var ytID = $el.attr('data-youtube'), 237 video = $("<div class='video'><span class='icon'></span></div>"), 238 img; 239 240 // Remove any existing video markup 241 $el.find(".video").remove(); 242 243 // Build thumbnail and video block 244 img = $("<img />").attr({ 245 src: "https://i.ytimg.com/vi/" + ytID + "/hqdefault.jpg", 246 alt: "Video Thumbnail" 247 }); 248 video.append(img); 249 250 // Clone h2 251 if ($("h2.clone", $el).length == 0) { 252 $("h2", $el).first().clone().addClass("clone").prependTo($el); 253 254 // Prepend video block to callout container 255 video.prependTo($el); 256 } else { 257 // Append to clone 258 $("h2.clone", $el).after(video); 259 } 260 261 // Add on click event to icon 262 $(".icon", $el).on('click', function () { 263 264 // Build iframe and append to video block 265 $('<iframe />').attr({ 266 'src': 'https://www.youtube.com/embed/' + ytID + '?autoplay=1', 267 'frameborder': 0, 268 'allowfullscreen': 'allowfullscreen' 269 }).appendTo(video);
270 271 }); 272 273 } 274 275 /** 276 * Setup for mobile Audience Navigation and Search tabs 277 * Only on tablet/mobile 278 * @return {null} returns nothing 279 */ 280 SBU.mobileTabs = function () { 281 282 // Toggle audience navigation 283 $('.js-show-audience').on("click", function () { 284 285 if ($(".header-search-nav").hasClass("audience-active")) { 286 $(".header-search-nav").removeClass("search-active audience-active"); 287 } else { 288 $(".header-search-nav").removeClass("search-active").addClass("audience-active"); 289 } 290 291 if ($(this).hasClass("active")) { 292 $(this).removeClass("active"); 293 } else { 294 $(".mobile-search-nav-tabs li").removeClass("active"); 295 $(this).addClass("active"); 296 } 297 298 }); 299 300 // Toggle search 301 $('.js-show-search').on("click", function () { 302 303 if ($(".header-search-nav").hasClass("search-active")) { 304 $(".header-search-nav").removeClass("search-active audience-active"); 305 } else { 306 $(".header-search-nav").removeClass("audience-active").addClass("search-active"); 307 } 308 309 if ($(this).hasClass("active")) { 310 $(this).removeClass("active"); 311 } else { 312 $(".mobile-search-nav-tabs li").removeClass("active"); 313 $(this).addClass("active"); 314 } 315 }); 316 317 } 318 319 320 /* 321 * Toggles fancybox on the homepage. 322 * Only on tablet/Desktop 323 */ 324 SBU.fancyBox = function(){ 325 /* 326 * Nifty little trick I learned. add body:after in your css make it display none with some content. 327 * Perfect for reading mediaqueries in JS. 328 * http://adactio.com/journal/5429/ 329 */ 330 331 if (!window.getComputedStyle) { 332 window.getComputedStyle = function(el, pseudo) { 333 this.el = el; 334 this.getPropertyValue = function(prop) { 335 var re = /(\-([a-z]){1})/g; 336 if (prop == 'float') prop = 'styleFloat'; 337 if (re.test(prop)) { 338 prop = prop.replace(re, function () { 339 return arguments[2].toUpperCase(); 340 }); 341 } 342 return el.currentStyle[prop] ? el.currentStyle[prop] : null; 343 } 344 return this; 345 } 346} 347 348 349 var type = window.getComputedStyle(document.body, ':after').getPropertyValue('content'), 350 $obj = $('#scroller'); 351 352 if(type === 'mobile'){ 353 $obj.find('a').each(function(){ 354 $(this).removeAttr('rel'); 355 $(this).attr('target', '_blank'); 356 }) 357 } 358 } 359 360 // jQuery DOM Ready 361 $(function () { 362 363 // Cached selectors 364 SBU.$elm = {}; 365 366 // Arbitrary data (Comes after selectors so we can use them here) 367 SBU.data = {}; 368 369 SBU.init(); 370 371 }); 372 373/** uncomment to see Namespace in the global scope for debugging. 374 window.Namespace = { 375 SBU : SBU; 376 } 377*/ 378 379})( window.jQuery, window, window.document, window.Modernizr );
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.