1jQuery(document).ready( function($) { 2 if ( jQuery('body').find('.dipl_timeline').length > 0 ) { 3 $(window).resize( function() { 4 $('body').find('.dipl_timeline').each( function() { 5 var $this = $(this); 6 if ( $this.find('.dipl_timeline_item').length > 0 ) { 7 dipl_timeline_stem( $this ); 8 } 9 } ); 10 } ); 11 $('body').find( '.dipl_timeline' ).each( function() { 12 var $this = $( this ); 13 if ( $this.find( '.dipl_timeline_item' ).length > 0 ) { 14 dipl_timeline_stem( $this ); 15 // Content Right Timeline. 16 if ( $this.find( '.dipl_timeline_right .dipl_date_tree' ).length > 0 ) { 17 $this.find( '.dipl_timeline_right .dipl_date_tree' ).each( function() { 18 var centerWrapperWidth = []; 19 var maxSize; 20 var stemPositionRight; 21 $(this).find('.dipl_stem_center').each( function() { 22 var iconWrapperSize = parseFloat( $(this).outerWidth() ); 23 centerWrapperWidth.push( iconWrapperSize ); 24 } ); 25 maxSize = Math.max.apply( Math, centerWrapperWidth ); 26 if( $this.find('.dipl_stem_center').length > 0 ) { 27 $(this).find('.dipl_stem_center').css( 'width', maxSize ); 28 } 29 stemPositionRight = maxSize / 2; 30 $this.find('.dipl_stem_wrapper').css( 'left', stemPositionRight ); 31 } ); 32 } 33 // Content Left Timeline. 34 if ( $this.find('.dipl_timeline_left .dipl_date_tree').length > 0 ) { 35 $this.find('.dipl_timeline_left .dipl_date_tree').each( function() { 36 var centerWrapperWidth = []; 37 var maxSize; 38 var stemPositionRight; 39 $(this).find('.dipl_stem_center').each( function() { 40 var iconWrapperSize = parseFloat( $(this).outerWidth() ); 41 centerWrapperWidth.push( iconWrapperSize ); 42 } ); 43 maxSize = Math.max.apply( Math, centerWrapperWidth ); 44 if ( $this.find('.dipl_stem_center').length > 0 ) { 45 $(this).find('.dipl_stem_center').css( 'width', maxSize ); 46 } 47 stemPositionRight = maxSize / 2; 48 $this.find('.dipl_stem_wrapper').css( 'right', stemPositionRight ); 49 } ); 50 } 51 } 52 } ); 53 } 54} ); // Document ready. 55 56// Module: Timeline. 57function dipl_timeline_stem( $this ) { 58 59 // Setting unfilled stem height and position. 60 var first_icon_height_half = $this.find( '.dipl_timeline_item' ).first().innerHeight() / 2; 61 var last_icon_height_half = $this.find( '.dipl_timeline_item' ).last().innerHeight() / 2; 62 var stem_padding = ( first_icon_height_half + last_icon_height_half ) + 'px'; 63 var stem_height = 'calc( 100% - ' + stem_padding + ' )'; 64 var stem_position = first_icon_height_half + 'px'; 65 66 $this.find( '.dipl_stem_wrapper' ).css( 'height', stem_height ); 67 $this.find( '.dipl_stem_wrapper' ).css( 'top', stem_position ); 68 69 // Setting pre filled stem. 70 var first_icon_offset = $this.find( '.dipl_timeline_item:first-child .dipl_stem_center' ).offset().top; 71 var last_icon_offset = first_icon_offset; 72 if ( $this.find( '.dipl_timeline_item:last-child .dipl_stem_center' ).offset() ) { 73 last_icon_offset = $this.find( '.dipl_timeline_item:last-child .dipl_stem_center' ).offset().top; 74 } 75 76 var screen_height_center = ( screen.height / 2 ); 77 var timelineBarSize = parseFloat( jQuery(this).find('.dipl_stem_wrapper').outerWidth() ); 78 var first_item_offset = $this.find('.dipl_timeline_item:first-child').offset().top; 79 if ( first_icon_offset < screen_height_center ) { 80 var stem_height_px = $this.find('.dipl_stem_wrapper').innerHeight(); 81 var stem_fill_height = ( ( screen_height_center - last_icon_offset ) < ( last_icon_offset - first_icon_offset - 10 ) ) ? ( screen_height_center - first_icon_offset )+"px" : ( last_icon_offset - first_icon_offset - 10 )+"px"; 82 $this.find('.dipl_stem').css( 'height', stem_fill_height ); 83 $this.find('.dipl_stem_center').each( function() { 84 var icon_offset = jQuery( this ).offset().top; 85 if( icon_offset < screen_height_center ) { 86 jQuery( this ).find( '.dipl_item_icon' ).addClass( 'dipl_icon_fill' ); 87 jQuery( this ).find( '.dipl_time_wrapper' ).addClass( 'dipl_border_fill' ); 88 } 89 } ); 90 if( jQuery(window).height() >= jQuery(document).height() ) { 91 $this.find( '.dipl_stem' ).css( 'height', stem_height_px ); 92 $this.find( '.dipl_stem_center' ).each( function() { 93 jQuery( this ).find( '.dipl_item_icon' ).addClass( 'dipl_icon_fill' ); 94 jQuery( this ).find( '.dipl_time_wrapper' ).addClass( 'dipl_border_fill' ); 95 } ); 96 } 97 } 98 99 // Setting scrolled stem. 100 jQuery( window ).on( 'scroll', function() { 101 var stem_height_px = $this.find('.dipl_stem_wrapper').innerHeight(); 102 var scroll_amount = jQuery(window).scrollTop(); 103 var final_height = ( scroll_amount + ( screen_height_center - first_icon_offset ) ) + "px"; 104 if ( parseFloat( final_height ) < parseFloat( stem_height_px ) ) { 105 $this.find('.dipl_stem').css( 'height', final_height ); 106 } 107 $this.find( '.dipl_timeline_item' ).each( function() { 108 var $icon = jQuery(this).find('.dipl_stem_center'); 109 var iconHeight = parseFloat( $icon.innerHeight() ); 110 if ( $icon.offset().top < ( screen_height_center + scroll_amount + iconHeight ) ) { 111 $icon.find( '.dipl_item_icon' ).addClass( 'dipl_icon_fill' ); 112 $icon.find( '.dipl_time_wrapper' ).addClass( 'dipl_border_fill' ); 113 } else { 114 $icon.find( '.dipl_item_icon' ).removeClass( 'dipl_icon_fill' ); 115 $icon.find( '.dipl_time_wrapper' ).removeClass( 'dipl_border_fill' ); 116 } 117 } ); 118 if ( jQuery(window).scrollTop() + jQuery(window).height() > jQuery(document).height() - 50 ) { 119 $this.find( '.dipl_stem' ).css( 'height', stem_height_px ); 120 $this.find( '.dipl_stem_center .dipl_item_icon' ).addClass( 'dipl_icon_fill' ); 121 $this.find( '.dipl_stem_center .dipl_time_wrapper' ).addClass( 'dipl_border_fill' ); 122 } 123 } ); 124} 125 126function dipl_recalculate_timeline_stem() { 127 jQuery('body').find('.dipl_timeline').each( function() { 128 var $this = jQuery( this ); 129
130 // Setting unfilled stem height and position. 131 var first_icon_height_half = $this.find( '.dipl_timeline_item' ).first().innerHeight() / 2; 132 var last_icon_height_half = $this.find( '.dipl_timeline_item' ).last().innerHeight() / 2; 133 var stem_padding = ( first_icon_height_half + last_icon_height_half ) + 'px'; 134 var stem_height = 'calc( 100% - ' + stem_padding + ' )'; 135 var stem_position = first_icon_height_half + 'px'; 136 137 $this.find( '.dipl_stem_wrapper' ).css( 'height', stem_height ); 138 $this.find( '.dipl_stem_wrapper' ).css( 'top', stem_position ); 139 } ); 140} 141 142function dipl_recalculate_timeline_center() { 143 jQuery('body').find( '.dipl_timeline' ).each( function() { 144 var $this = jQuery(this); 145 var i = 0; 146 147 var timelinePosition = []; 148 var timelineBarSize = parseFloat( jQuery(this).find('.dipl_stem_wrapper').outerWidth() ); 149 var iconWrapperSize = parseFloat( jQuery(this).find('.dipl_stem_center').outerWidth() ); 150 151 timelinePosition.push(iconWrapperSize); 152 var actualPosition = Math.min.apply( null, timelinePosition); 153 154 if( jQuery(window).width() > 767 ) { 155 $this.find('.dipl_timeline_alternate .dipl_timeline_item').each( function() { 156 var iconWrapperSize = parseFloat( jQuery(this).find('.dipl_stem_center').outerWidth() ); 157 var iconPositionValRight = 'calc( 50% + ' + ( ( iconWrapperSize / 2 ) - ( timelineBarSize / 2 ) ) + 'px )'; 158 var iconPositionValLeft = 'calc( 50% + ' + ( ( iconWrapperSize / 2 ) + ( timelineBarSize / 2 ) ) + 'px )'; 159 if( 0 === ( i % 2 ) ) { 160 jQuery(this).find('.dipl_timeline_item_wrapper').css( 'width', iconPositionValRight ); 161 i = i +1; 162 } else { 163 jQuery(this).find('.dipl_timeline_item_wrapper').css( 'width', iconPositionValLeft ); 164 i = i +1; 165 } 166 } ); 167 } else { 168 $this.find( '.dipl_timeline_alternate_stem' ).each( function() { 169 if ( '' !== actualPosition && !Number.isNaN(actualPosition) ) { 170 actualPosition = actualPosition - timelineBarSize; 171 var actualPositionPixel = ( actualPosition / 2 )+'px'; 172 jQuery(this).find('.dipl_stem_wrapper').css('left',actualPositionPixel); 173 } 174 } ); 175 } 176 } ); 177}
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.