1function scrollToElem(elem, time, elemPos, offset) { 2 var targetPos; 3 var heightOffset = elem.outerHeight(); 4 var windowHeight = $(window).height(); 5 if (!elemPos) { 6 targetPos = elem.offset().top; 7 } 8 else if (elemPos == 'center') { 9 targetPos = elem.offset().top - windowHeight / 2 + heightOffset / 2; 10 } 11 else { 12 targetPos = elem.offset().top + heightOffset / 2 - windowHeight * elemPos; 13 } 14 if (offset) { 15 targetPos = targetPos - windowHeight * offset; 16 } 17 $('html, body').animate({ 18 scrollTop: targetPos 19 }, time, function () { 20 $('html, body').finish(); 21 }); 22} 23 24$(document).ready(function () { 25 $("#expand").on("click", function(event) { 26 $('.accordionContent .firstLevel li').addClass('active'); 27 scrollToElem($('.accordionContent .firstLevel li').eq(0), 400, '', 0.15); 28 $('.accordionContent .secondLevel').slideDown(); 29 $('.accordionContent .secondLevel div').removeAttr("aria-hidden"); 30 $('.accordionContent .firstLevelTitle').attr("aria-expanded", "true"); 31 $('.accordionContent .secondLevel').addClass('active'); 32 $('.accordionContent .secondLevel ul').slideDown(); 33 var titleTxt = $(this).data('collapseall'); 34 $(this).attr('title', titleTxt); 35 }); 36 37 $("#collapse").on("click", function(event) { 38 $('.accordionContent .firstLevel li').removeClass('active'); 39 scrollToElem($('.accordionContent .firstLevel li').eq(0), 400, '', 0.15); 40 $('.accordionContent .secondLevel').slideUp(); 41 $('.accordionContent .secondLevel div').attr("aria-hidden", "true"); 42 $('.accordionContent .firstLevelTitle').attr("aria-expanded", "false"); 43 $('.accordionContent .secondLevel').removeClass('active'); 44 //$('.accordionContent .secondLevel ul').not('.dataList').slideUp(); 45 $('.accordionContent .secondLevel ul').slideUp(); 46 var titleTxt = $(this).data('extendall'); 47 $(this).attr('title', titleTxt); 48 }); 49 50 $('.accordionContent .firstLevel .lineItem .h2_title .firstLevelTitle').on('click', function (event) { 51 event.preventDefault(); 52 var parent = $(this).parent().parent(); 53 var accordionHolder = parent.parent().parent().parent().parent().parent(); 54 if (parent.hasClass('active')) { 55 parent.find('.secondLevel').slideUp(); 56 parent.find('.secondLevel div').attr("aria-hidden", "true"); 57 $(this).attr("aria-expanded", "false"); 58 parent.removeClass('active'); 59 } 60 else { 61 parent.find('.secondLevel ul').css({ 'display': '' }); 62 if (parent.find('.secondLevelTitle.arrow').length > 0) { 63 parent.find('.secondLevel>ul').hide(); 64 } 65 parent.find('.secondLevel').slideDown(); 66 parent.find('.secondLevel div').removeAttr("aria-hidden"); 67 $(this).attr("aria-expanded", "true"); 68 parent.addClass('active'); 69 } 70 }); 71}); 72 73function sentenceDoubleSpacing() { 74 $('p').each(function() { 75 $(this).html($(this).html().replace(new RegExp('\\.\\s+', 'g'), '. ')); 76 $(this).html($(this).html().replace(new RegExp('(etc)\\. ', 'g'), '$1. '));
77 }); 78} 79 80function adjustFaqTable() { 81 // reset max-width property 82 $("button.qaHolder div.qaIndex").css("width", ""); 83 // calculate max width of div 84 var maxWidth = null; 85 $("button.qaHolder div.qaIndex").each(function() { 86 var width = $(this).innerWidth(); 87 if (maxWidth == null) { 88 maxWidth = width; 89 } 90 else if (maxWidth < width) { 91 maxWidth = width; 92 } 93 }); 94 // set max-width property 95 $("button.qaHolder div.qaIndex").css("width", maxWidth); 96}
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.