1var $ = jQuery.noConflict(); 2 3/*Empty p tags fix*/ 4var p = document.querySelectorAll( 'p:empty' ); 5for( var i = p.length - 1; i > -1; i-- ) { 6 p[i].parentNode.removeChild( p[i] ); 7} 8 9$( document ).ready( function(){ 10 11 12 $(".flexnav").flexNav(); 13 14 15 if ( $('nav.mm-menu').length === 0 ) { 16 addSiteNavigation(); 17 } 18 19 callAutoCalculate(); 20 21}); 22 23/*Popover*/ 24$( "[rel=popover]" ).popover({ 25 "placement": "auto", 26 "container": "body", 27 "html":true 28}); 29 30 31$( 'body' ).on( 'click', function (e) { 32 $( '[rel=popover]' ).each( function () { 33 if (!$( this ).is( e.target ) && $( this ).has( e.target ).length === 0 && $( '.popover' ).has( e.target ).length === 0) { 34 $( this ).popover( 'hide' ); 35 } 36 }); 37}); 38 39/*Tooltip*/ 40$( "[rel=tooltip]" ).tooltip(); 41 42 43/* Add Select Option for Main Navigation */ 44 45function addSiteNavigation() { 46 var $menu_select = $( "<select />" ); 47 $( "<option />", {"selected": "selected", "value": "Site Navigation", "text": "Site Navigation"} ).appendTo( $menu_select ); 48 49 $menu_select.appendTo( "nav[role='navigation']" ); 50 $( "nav[role='navigation'] ul li a" ).each( function() { 51 var menu_url = $( this ).attr( "href" ); 52 var menu_text = $( this ).text(); 53 if ( $( this ).parents( "li" ).length == 2 ) { menu_text = '- ' + menu_text; } 54 if ( $( this ).parents( "li" ).length == 3 ) { menu_text = "-- " + menu_text; } 55 if ( $( this ).parents( "li" ).length > 3 ) { menu_text = "--- " + menu_text; } 56 $( "<option />", { "value": menu_url, "text": menu_text } ).appendTo( $menu_select ) 57 }) 58 field_id = "nav[role='navigation'] select"; 59 $( field_id ).change( function() { 60 value = $( "nav[role='navigation'] select option:selected" ).val(); 61 window.location = value; 62 }); 63 64} 65 66/*Auto-height segement scripts*/ 67 68function fullHeight() { 69 70 var sumSegment = 0; 71 72 $( "#header > div" ).each( function() { 73 sumSegment += ( $( this ).outerHeight() ); 74 }); 75 76 //console.log(sumSegment); 77 78 t = $( window ).height() - sumSegment; 79 e = $( ".intro" ).outerHeight(); 80 81 if ( $( "#header" ).hasClass( "navbar-fixed-top" ) ) { 82 83 $( "body" ).css( { paddingTop:sumSegment } ); 84 85 } else { 86 $( "body" ).css( { paddingTop:0 } ); 87 } 88 89 $( ".auto-height" ).css( { minHeight:t } ); 90 91 $( ".intro" ).css( { top:( t*0.4 - e*0.5 ) } ); 92}; 93 94 95function autoWrapNavigation(){ 96 var total = 0; 97 98 $( "header nav" ).find( "li" ).each( function() { 99 total += ( $( this ).width() ) ; 100 }) 101 102 var container = $( "header nav ul" ).parent().width(); 103 if( total >= container ) { 104 $( "header nav select" ).show(); 105 $( "header nav ul" ).hide(); 106 } 107 108} 109 110function removeNavFixTopMobile() { 111 if( $( window ).width() < 768 ) { 112 if ( true == $( "#header" ).hasClass( "navbar-fixed-top" ) ) { 113 $( "#header" ).removeClass( "navbar-fixed-top" ).addClass( "_navbar-fixed-top" ); 114 } 115 } else { 116 if ( true == $( "#header" ).hasClass( "_navbar-fixed-top" ) ) { 117 $ ( "#header" ).removeClass( "_navbar-fixed-top" ).addClass( "navbar-fixed-top" ); 118 } 119 } 120} 121 122 123function footerHeight(){ 124 125 var sumSegment = 0; 126 127 $( "body > div > div .page-wrap + footer > div" ).each( function() { 128 sumSegment += ( $( this ).outerHeight() ); 129 }); 130 131 132 //footer_h = $("body > div > div .page-wrap + footer").outerHeight(); 133 footer_h = sumSegment; 134 135 $( "body > div > div .page-wrap + footer" ).css( { height:footer_h } ); 136 $( ".page-wrap" ).css( { marginBottom:-footer_h } ); 137 138 $( 'head' ).append( "<style>.page-wrap:after{ height:" + footer_h + "px;z-index: 99; }</style>" ); 139} 140 141jQuery.fn.exists = function(){ return jQuery( this ).length > 0; } 142 143function callAutoCalculate(){ 144 removeNavFixTopMobile(); 145 fullHeight(); 146 footerHeight(); 147 //autoWrapNavigation(); 148} 149 150var resizeTimer; 151$( window ).resize( function() { 152 clearTimeout( resizeTimer ); 153 resizeTimer = setTimeout( callAutoCalculate, 100 ); 154}); 155 156/* Add Twitter Bootstrap classes to Gravity Forms */ 157$(document).bind( 'gform_post_render', function(){ 158 $( '.button' ).removeClass( 'button' ).addClass( 'btn btn-primary' ); 159 $( '.gform_button' ).addClass( 'controls btn' ); 160/* Remove function 'removeClass' from .gform_next_button and .gform_page 161According to gravityform have new class 'gform_next_button' at version 2.3.3.10 162https://trello.com/c/BoDuTJvm/3891-bug-gform-automatically-update-turned-on-for-some-new-clients 163*/ 164$( '.gform_next_button' ).addClass( 'pull-right' ); 165$( '.gform_page' ).addClass( 'row' ); 166$( '.gform_page_fields' ).addClass( 'col-md-12' ); 167$( '.validation_error' ).removeClass( 'validation_error' ).addClass( 'alert alert-error' ); 168$( '.gform_body input[type="text"]' ).addClass( 'form-control' ); 169$( '.gform_body input[type="email"]' ).addClass( 'form-control' ); 170$( '.gform_body input[type="tel"]' ).addClass( 'form-control' ); 171$( '.gform_body input[type="password"]' ).addClass( 'form-control' ); 172$( '.gform_body select' ).addClass( 'form-control' ); 173$( '.gform_body textarea' ).addClass( 'form-control' ); 174$( 'input#recaptcha_response_field' ).removeClass( 'form-control' ); 175}); 176 177/* Remove <br> in hidden field at Gravity Forms*/ 178$(document).ready(function(){ 179 $( '.gform_footer' ).find( 'br' ).remove(); 180});
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.