'); $('.headline-text-content', v1) .append( $('.ui-article-title', v1) ) .append( $('.ui-article-description', v1) ) .append( $('.ui-article-controls', v1) ); }); }); //APPLY RESPONSIVE DIMENSIONS TO CONTENT IMAGES $("div.ui-widget.app .ui-widget-detail img") .not($("div.ui-widget.app.cs-rs-multimedia-rotator .ui-widget-detail img")) .not($("div.ui-widget.app.gallery.json .ui-widget-detail img")) .not($("div.ui-widget.app.headlines .ui-widget-detail img")) .each(function() { if ($(this).attr('width') !== undefined && $(this).attr('height') !== undefined || $(this).parent('p').attr('style') == 'text-align: center;' ) { // IMAGE HAS INLINE DIMENSIONS $(this).css({"width": $(this).attr("width") + "px", "max-width": "100%", "height": "auto", "max-height": $(this).attr("height") + "px"}); } }); if( $('.hp.column.one .hp-color-region-1 .region > div').length <= 0 ){ $('.hp.column.one .hp-color-region-1').hide(); } if( $('.hp.column.one #hp-tabbed-app-cont .region > div:not(".tabs-container")').length <= 0 ){ $('.hp.column.one .hp-color-region-1 .content-box-shadow').hide(); } //DOC add read full story button to each headline /*$(".ui-widget.app.headlines").each(function(){ $(".ui-article", this).each(function(){ var headlineURL = $("h1 a", this).attr("href"); $(this).append('Read More'); //$(".img", this).append('Click to view full story'); }); });*/ $("#hp-tabbed-app-cont > div").tabBlocks(); hpTabsBuilt = true; var maxTabH = 0; $("#hp-tabbed-app-cont .tabs-container div.clear").remove(); $("#hp-tabbed-app-cont .tab-button") .css('min-height', 0) .each(function(k, v){ if( $(this).outerHeight() > maxTabH ) maxTabH = $(this).outerHeight(); }) .css('min-height', maxTabH); $('#hp-tabbed-app-cont .upcomingevents').attr('style', ''); //-- Check if there is only one app in the tab app section //-- if true app header spans full width if($('.tabs-container div').size() == 1){ $('.tab-button').css('width', '100%'); } else if($('.tabs-container div').size() == 2){ $('.tab-button').css('width', '50%'); } // ********** FOOTER ********** // //DOC get Schoolwires footer links var feedbackText = $("div#sw-footer-links li:eq(0) a").text(); var termsURL = $("div#sw-footer-links li:eq(2) a").attr("href"); var termsText = $("div#sw-footer-links li:eq(2) a").text(); var policyURL = $("div#sw-footer-links li:eq(1) a").attr("href"); var policyText = $("div#sw-footer-links li:eq(1) a").text(); var copyrightText = $("#sw-footer-outer #sw-footer-copyright").text(); var swbbLogo = $("#sw-footer-outer #sw-footer-logo img").attr("src"); var swbbLogoAlt = $("#sw-footer-outer #sw-footer-logo img").attr("alt"); $(".cs-sw-footer-logo").html($("#sw-footer-logo").html()); $("#cs-sw-footer-links").html("" + feedbackText + "" + termsText + "" + policyText + "" + copyrightText + ""); $('.back-to-top').click(function(e){ smoothScroll( '#gb-page', 0 ); $('#gb-channel-list li.sw-channel-item.first > a').focus(); });	} function eventsByDay(container) { var countLi = 0; $(".ui-article", container).each(function(){ if (!$(this).find("h1.ui-article-title.sw-calendar-block-date").size()){ var moveArticle = $(this).html(); $(this).parent().prev().children().children().next().append(moveArticle); $(this).parent().remove(); }; }); $(".ui-article", container).each(function(k, v){ var newDateTime = $('.upcoming-column.left h1', this).html().toLowerCase().split(""); var newDate = ''; var dateIndex = ((newDateTime.length > 2) ? 2 : 1); //if the dayWeek is set to yes we need to account for that in our array indexing //add a zero to the date if it is a single digit if( newDateTime[dateIndex].length == 1 ) newDateTime[dateIndex] = "0" + newDateTime[dateIndex]; //if we have the day of the week make sure to include it. if( dateIndex > 1 ){ newDate += newDateTime[0] + ""; } //add in the month newDate += newDateTime[dateIndex - 1] + ''; //the month is always the in the left array position to the date //wrap the date in a new tag newDate += '' + newDateTime[dateIndex] + ''; //append the date and month back into their columns $('.upcoming-column.left h1', this).html(newDate);	//add an ALL DAY label if no time was given $('.ui-article-description', v).each(function(k1, v1){ $('.sw-calendar-block-time', v1).prepend(''); $('.sw-calendar-block-time', v1).before($('.sw-calendar-block-title', v1)); }); }); } function searchText() { var defSearchText = "Search"; var searchBox = $('#swsitesearch-txt-searchstring'); searchBox.attr("placeholder", "") .attr("value", defSearchText) .focus(function() { if($(this).val() == defSearchText) { $(this).val(""); } }) .blur(function() { if($(this).val() == "") { $(this).val(defSearchText); } }); } function calendarListView(){ //DOC auto click function for schoolwires calendar list view for small mobile devices if(!$("a.ui-btn-toggle.list").hasClass("active")){ $("a.ui-btn-toggle.list").click(); } } function setupCustomColors(){ var dynStyleSheet = document.createElement('style'); if(dynStyleSheet) { dynStyleSheet.setAttribute('type', 'text/css'); var head = document.getElementsByTagName('head')[0]; if(head) { head.insertBefore(dynStyleSheet, head.childNodes[0]); } var dynStyles = "#hp-slideshow:before,#hp-slideshow:after{ background: rgba(" + hexToRgb('#000000') + ", 0.85); }" + "#hp-slideshow #rs-desc-outer, #hp-slideshow .mmg-description-outer{ background: rgba(" + hexToRgb('#000000') + ", 0.85); }" + ".global-icon .text{ background: rgba(" + hexToRgb('#FFFFFF') + ", 0.95); }" + "@media (max-width: 1023px) { #hp-slideshow #rs-desc-outer, #hp-slideshow .mmg-description-outer{ background: rgba(" + hexToRgb('#000000') + ", 0.9); } } "; var rules = document.createTextNode(dynStyles); if(dynStyleSheet.styleSheet){ // IE dynStyleSheet.styleSheet.cssText = dynStyles; } else { dynStyleSheet.appendChild(rules); } } } function hexToRgb(h){ var r = parseInt((cutHex(h)).substring(0,2),16); var g = parseInt((cutHex(h)).substring(2,4),16); var b = parseInt((cutHex(h)).substring(4,6),16); return r+', '+g+', '+b; } function cutHex(h) { return (h.charAt(0)=="#") ? h.substring(1,7):h; } function clearDropdowns(){ $('.custom-dropdown.openMenu input, .custom-dropdown.openMenu a, .custom-dropdown.openMenu .custom-dropdown > button').attr('tabindex', -1); $('.custom-dropdown.openMenu .dropdown').attr('aria-hidden', 'true').slideUp(); $('.custom-dropdown.openMenu .dropdown-icon').removeClass('point-up').addClass('point-right'); $('.custom-dropdown.openMenu > button').removeClass('acc-open'); $('.custom-dropdown.openMenu li').removeClass('active-list-item'); dropdownKeyboardFunctionality($('.custom-dropdown.openMenu .dropdown'), true); $('.custom-dropdown.openMenu').removeClass("openMenu"); } function dropdownKeyboardFunctionality(dropdown, clear){ if( clear ){ dropdown.off('keydown'); }else{ $('input, a', dropdown).attr('tabindex', 0); $('li:first', dropdown).addClass('active-list-item'); $('li.active-list-item a', dropdown).trigger('focus'); // 38 = up and 40 = down dropdown.keydown(function(e){ if(e.which == 38 || e.which == 40){ e.preventDefault(); switch( e.which ){ case 38: //up if( $('li.active-list-item', this).index() == 0){ $(this).siblings('p').focus(); $('li', this).removeClass('active-list-item'); $('li:first', this).addClass('active-list-item'); }else{	var topItem = $('li.active-list-item', this).prev('li'); if(topItem.hasClass('list-label')) topItem = topItem.prev('li'); $('li.active-list-item', this).removeClass('active-list-item'); topItem.addClass('active-list-item'); $('a', topItem).focus(); } break; case 40: //down if( $('li.active-list-item', this).index() == $('li', this).length - 1 ){ $(this).siblings('p').focus(); $('li', this).removeClass('active-list-item'); $('li:first', this).addClass('active-list-item'); }else{ var bottomItem = $('li.active-list-item', this).next('li'); if(bottomItem.hasClass('list-label')) bottomItem = bottomItem.next('li'); $('li.active-list-item', this).removeClass('active-list-item'); $(bottomItem).addClass('active-list-item'); $('a', bottomItem).focus(); } break; default: //pass break; } } }); } } /* customDropdowns ** Use: Sets up custom dropdown menus. ** Param: openIcon, closedIcon -- The classes that you want to mark the on/off state of the menu icons (dont pass the . or #) */ var dropdownTimeout = ""; //Will hold our timeout object that will ge t passed among the dropdown functions. function customDropdowns(openIcon, closedIcon){ $('.custom-dropdown input, .custom-dropdown a, .custom-dropdown .custom-dropdown > button').attr('tabindex', -1); $('.custom-dropdown button').on('keydown', function(e) { // Trigger the click event from the keyboard var code = e.which; // 13 = Return, 32 = Space if ((code === 13) || (code === 32)) { e.preventDefault(); $(this).click(); if( !$(this).parent().hasClass('openMenu') ){ //clear our keyboard hooks since the menu is closing. dropdownKeyboardFunctionality($('~ .dropdown', this), true); }else{ //add our keyboard hooks dropdownKeyboardFunctionality($('~ .dropdown', this)); } } }); //Custom Dropdown Functionality $('.custom-dropdown').off('click').click(function(e){ clearTimeout(dropdownTimeout); if( !$(this).hasClass("openMenu") ){ clearDropdowns(); $('.dropdown', this).slideDown(); $(this).addClass("openMenu"); $('.dropdown-icon', this).removeClass(closedIcon).addClass(openIcon); }else{ clearDropdowns(); } }) .hover(function(e){ //In clearTimeout(dropdownTimeout); },function(e){ //Out //canDropDownHide = true; dropdownTimeout = setTimeout(function(){ clearDropdowns(); }, 800); }); } function addFramesetTranslate(){ var pageURL = window.location.href; pageURL = encodeURIComponent(pageURL); /*var translateDropdown = '