1( function( $ ) { 2 $.fn.DiviPlusTeamGridPagination = function( $options = {} ) { 3 let $defaults = { 4 paginationClass: 'dipl_team_grid_pagination', 5 hideOnlyOnePage: true, 6 totalPages: 1, 7 visiblePages: 10, 8 startPage: 1, 9 initiateStartPageClick: false, 10 first: false, 11 last: false, 12 prev: false, 13 next: false, 14 }, 15 $pagination = this; 16 17 $options = $.extend({}, $defaults, $options); 18 $pagination.twbsPagination($options); 19 } 20} ( jQuery ) ); 21 22function diplTeamGridGetQueryVars() { 23 let $vars = {}, 24 $hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'), 25 $hash; 26 27 for ( let i = 0; i < $hashes.length; i++ ) { 28 $hash = $hashes[i].split('='); 29 $vars[$hash[0]] = $hash[1]; 30 } 31 32 return $vars; 33} 34 35jQuery(function($) { 36 dipl_team_grid_calc_overlay_height(); 37 38 // Team box, open link on click. 39 if ( $('.dipl_team_grid').find('.dipl_team_link').length > 0 ) { 40 $('body').on( 'click', '.dipl_team_link', function(e) { 41 if ( $(e.target).is( $(this).find('.dipl_team_member_social_icon') ) ) { 42 return; 43 } 44 e.preventDefault(); 45 let link = $(this).data('link'), 46 target = $(this).data('link_target'); 47 window.open( link, target ); 48 } ); 49 } 50 51 // Team open popup. 52 if ( $('.dipl_team_grid').find('.dipl_team_popup').length > 0 ) { 53 $('body').on( 'click', '.dipl_team_popup', function(e) { 54 if ( $(e.target).is( $(this).find('.dipl_team_member_social_icon') ) ) { 55 return; 56 } 57 e.preventDefault(); 58 59 let $this = $(this).closest('.dipl_team_popup'); 60 if ( ! $this.hasClass( 'dipl_team_grid_item' ) ) { 61 $this = $this.parents( '.dipl_team_grid_item' ); 62 } 63 64 let $position = $this.data('close_icon_position'), 65 $close_icon_position = 'inside' === $position ? true : false; 66 67 let $mainWrap = $this.parents( '.dipl_team_grid_container' ); 68 let $props = { 69 'id' : $this.data( 'id' ), 70 'social_icons' : $mainWrap.data( 'social_icons' ), 71 'bar_layout' : $mainWrap.data( 'bar_layout' ), 72 'skills_bars' : $mainWrap.data( 'skills_bars' ), 73 'use_stripes' : $mainWrap.data( 'use_stripes' ), 74 'use_animated_stripes' : $mainWrap.data( 'use_animated_stripes' ), 75 'content' : $mainWrap.data( 'content' ), 76 'designation' : $mainWrap.data( 'designation' ), 77 'image' : $mainWrap.data( 'image' ), 78 'image_size' : $mainWrap.data( 'image_size' ), 79 'popup_name_level' : $mainWrap.data( 'popup_name_level' ), 80 }; 81 82 let ajaxNonce = $mainWrap.find( 'input#dipl_team_popup_ajax_nonce' ).val(); 83 84 $this.addClass('dipl_team_lightbox_loader'); 85 $.ajax( { 86 type: 'POST', 87 url: DiviPlusFrontendData.ajaxurl, 88 data: { 89 action: 'dipl_get_teamgrid_page', 90 dipl_team_popup_nonce: ajaxNonce, 91 props: $props 92 }, 93 success: function(response) { 94 let $orderClass = $this.closest('.dipl_team_grid').prop('class').match(/(dipl_team_grid\_[^\s]*)/)[0] + '_lightbox'; 95 $this.removeClass('dipl_team_lightbox_loader'); 96 $.magnificPopup.open( { 97 preloader: true, 98 items: { 99 src: $(response), 100 type: 'inline' 101 }, 102 callbacks: { 103 open: function() { 104 if ( $('body').find('.dipl_team_member_lightbox .dipl_skill_bar_wrapper').length > 0 ) { 105 if ( $('.dipl_team_member_lightbox').find('.dipl_filled_bar').length > 0 ) { 106 $('.dipl_team_member_lightbox').find('.dipl_filled_bar').each(function(){ 107 let $this = $(this); 108 $this.waypoint({ 109 handler: function() { 110 let width = $this.data('percent'); 111 $this.css('width', width); 112 }, 113 context: $this 114 } ); 115 } ); 116 } 117 if ( $('.dipl_team_member_lightbox').find('.dipl_bar_counter_chunks').length > 0 ) { 118 $('.dipl_team_member_lightbox').find('.dipl_bar_counter_filled_chunks').each(function() { 119 let $this = $(this); 120 $this.waypoint({ 121 handler: function() { 122 $this.addClass('dipl_animate_filled'); 123 }, 124 context: $this 125 } ); 126 } ); 127 } 128 } 129 }, 130 }, 131 closeOnContentClick: false, 132 closeBtnInside: $close_icon_position, 133 mainClass: 'dipl_team_member_lightbox ' + $orderClass 134 } ); 135 }, 136 error: function() { 137 138 } 139 } ); 140 } ); 141 } 142 143 if ( $('body').find('.dipl_team_grid').length > 0 ) { 144 $('.dipl_team_grid').each( function() { 145 let $this = $(this); 146 let $mainWrap = $this.find( '.dipl_team_grid_container' ); 147 148 let ajaxNonce = $mainWrap.find( 'input#dipl_team_popup_ajax_nonce' ).val(); 149 150 // Pagination. 151 if ( $this.find('.dipl_team_grid_pagination_wrapper').length > 0 ) { 152 let $pagination_wrapper = $this.find('.dipl_team_grid_pagination_wrapper'), 153 $pagination = $pagination_wrapper.find('ul'), 154 $include_categories = $mainWrap.data('include_categories'), 155 $perPage = isNaN( $pagination_wrapper.data('posts_number') ) || 0 === parseInt( $pagination_wrapper.data('posts_number') ) ? -1 : parseInt( $pagination_wrapper.data('posts_number') ), 156 $totalPages = isNaN( $pagination_wrapper.data('total_pages') ) || 0 === parseInt( $pagination_wrapper.data('total_pages') ) ? 1 : parseInt( $pagination_wrapper.data('total_pages') ), 157 $options = { 158 totalPages: $totalPages, 159 onPageClick: function (event, page) { 160 161 let $props = $mainWrap.data(); 162 163 $props['page'] = page; 164 $props['total_pages'] = $totalPages; 165 166 $this.fadeTo( '100', 0.2 ); 167 $.ajax( { 168 type: 'POST', 169 url: DiviPlusFrontendData.ajaxurl, 170 data: { 171 action: 'dipl_get_team_members', 172 dipl_get_team_members_nonce: ajaxNonce, 173 props: $props, 174 }, 175 success: function(response) { 176 $this.fadeTo( '100', 1 ); 177 if ( response.success ) { 178 $this.find('.dipl_team_grid_items').fadeOut('fast', function(){ 179 $(this).html(response.items); 180 $(this).fadeIn( 'fast', function() { 181 dipl_team_grid_calc_overlay_height(); 182 } ); 183 } ); 184 } 185 } 186 } ); 187 188 let topHeaderHeight = 0, 189 mainHeaderHeight = 0, 190 tbHeaderHeight = 0; 191 192 if ( $('body').find('#top-header').length > 0 && $('body').hasClass('et_fixed_nav') ) { 193 topHeaderHeight = parseFloat( $('#top-header').innerHeight() ); 194 } 195 if ( $('body').find('#main-header').length > 0 && $('body').hasClass('et_fixed_nav') ) { 196 mainHeaderHeight = parseFloat( $('#main-header').innerHeight() ); 197 } 198 if ( $('body').find('.et-l--header').length > 0 && $('body').find('.et-l--header .et_builder_inner_content').hasClass('has_et_pb_sticky') ) { 199 tbHeaderHeight = parseFloat( $('.et-l--header').innerHeight() ); 200 } 201 202 let headerHeight = topHeaderHeight + mainHeaderHeight + tbHeaderHeight + 50; 203 $( 'html, body' ).animate({ 204 scrollTop: ( $this.offset().top - headerHeight ) 205 } ); 206 } 207 }; 208 209 if ( 'on' === $mainWrap.data('show_prev_next') ) { 210 $options.prev = $mainWrap.data('prev_text'); 211 $options.next = $mainWrap.data('next_text'); 212 } 213 214 $pagination.DiviPlusTeamGridPagination( $options ); 215 216 $this.find( '.dipl-team-items-categories li' ).on( 'click', function() { 217 if ( $(this).hasClass('dipl-team-active-category') ) { 218 return false;
219 } 220 221 $(this).closest('.dipl-team-items-categories').find('li').removeClass('dipl-team-active-category'); 222 $(this).addClass('dipl-team-active-category'); 223 let $props = $mainWrap.data(), 224 $category = $(this).data('id'); 225 226 $props['page'] = 1; 227 $props['total_pages'] = $totalPages; 228 229 if ( '' !== $category ) { 230 $props['include_categories'] = $category; 231 $props['tax_query_field'] = 'term_id'; 232 } else { 233 $props['include_categories'] = $include_categories; 234 $props['tax_query_field'] = 'term_id'; 235 } 236 237 $this.fadeTo( '100', 0.2 ); 238 $.ajax( { 239 type: 'POST', 240 url: DiviPlusFrontendData.ajaxurl, 241 data: { 242 action: 'dipl_get_team_members', 243 dipl_get_team_members_nonce: ajaxNonce, 244 props: $props 245 }, 246 success: function(response) { 247 $this.fadeTo( '100', 1 ); 248 if ( response.success ) { 249 $this.find('.dipl_team_grid_items').fadeOut('fast', function(){ 250 $(this).html(response.items); 251 $(this).fadeIn( 'fast', function() { 252 dipl_team_grid_calc_overlay_height(); 253 } ); 254 } ); 255 256 // Re-render Pagination. 257 let $perPage = isNaN( $pagination_wrapper.data('posts_number') ) || 0 === parseInt( $pagination_wrapper.data('posts_number') ) ? -1 : parseInt( $pagination_wrapper.data('posts_number') ), 258 $totalPages = parseInt( response.total_pages ), 259 $options = { 260 totalPages: $totalPages, 261 onPageClick: function (event, page) { 262 $props['page'] = page; 263 $this.fadeTo( '100', 0.2 ); 264 $.ajax( { 265 type: 'POST', 266 url: DiviPlusFrontendData.ajaxurl, 267 data: { 268 action: 'dipl_get_team_members', 269 dipl_get_team_members_nonce: ajaxNonce, 270 props: $props 271 }, 272 success: function(response) { 273 $this.fadeTo( '100', 1 ); 274 if ( response.success ) { 275 $this.find('.dipl_team_grid_items').fadeOut('fast', function() { 276 $(this).html(response.items); 277 $(this).fadeIn( 'fast', function() { 278 dipl_team_grid_calc_overlay_height(); 279 } ); 280 } ); 281 } 282 } 283 } ); 284 285 if ( $this.offset().top > 0 ) { 286 let topHeaderHeight = 0, 287 mainHeaderHeight = 0, 288 tbHeaderHeight = 0; 289 290 if ( $('body').find('#top-header').length > 0 && $('body').hasClass('et_fixed_nav') ) { 291 topHeaderHeight = parseFloat( $('#top-header').innerHeight() ); 292 } 293 if ( $('body').find('#main-header').length > 0 && $('body').hasClass('et_fixed_nav') ) { 294 mainHeaderHeight = parseFloat( $('#main-header').innerHeight() ); 295 } 296 if ( $('body').find('.et-l--header').length > 0 && $('body').find('.et-l--header .et_builder_inner_content').hasClass('has_et_pb_sticky') ) { 297 tbHeaderHeight = parseFloat( $('.et-l--header').innerHeight() ); 298 } 299 300 let headerHeight = topHeaderHeight + mainHeaderHeight + tbHeaderHeight + 50; 301 $( 'html, body' ).animate( { 302 scrollTop: ( $this.offset().top - headerHeight ) 303 } ); 304 } 305 } 306 }; 307 308 if ( 'on' === $mainWrap.data('show_prev_next') ) { 309 $options.prev = $mainWrap.data('prev_text'); 310 $options.next = $mainWrap.data('next_text'); 311 } 312 313 $pagination.twbsPagination( 'destroy' ); 314 $pagination.DiviPlusTeamGridPagination( $options ); 315 } 316 } 317 } ); 318 } ); 319 } else { 320 let $include_categories = $mainWrap.data('include_categories'); 321 $this.find('.dipl-team-items-categories li').on( 'click', function() { 322 if ( $(this).hasClass('dipl-team-active-category') ) { 323 return false; 324 } 325 326 $(this).closest('.dipl-team-items-categories').find('li').removeClass('dipl-team-active-category'); 327 $(this).addClass('dipl-team-active-category'); 328 329 let $category = $(this).data('id'), 330 $props = $mainWrap.data(); 331
332 if ( '' !== $category ) { 333 $props['include_categories'] = $category; 334 $props['tax_query_field'] = 'term_id'; 335 } else { 336 $props['include_categories'] = $include_categories; 337 $props['tax_query_field'] = 'term_id'; 338 } 339 340 $this.fadeTo( '100', 0.2 ); 341 $.ajax( { 342 type: 'POST', 343 url: DiviPlusFrontendData.ajaxurl, 344 data: { 345 action: 'dipl_get_team_members', 346 dipl_get_team_members_nonce: ajaxNonce, 347 props: $props 348 }, 349 success: function(response) { 350 $this.fadeTo( '100', 1 ); 351 if ( response.success ) { 352 $this.find('.dipl_team_grid_items').fadeOut('fast', function(){ 353 $(this).html(response.items); 354 $(this).fadeIn( 'fast', function() { 355 dipl_team_grid_calc_overlay_height(); 356 } ); 357 } ); 358 } 359 } 360 } ); 361 } ); 362 } 363 } ); 364 } 365 366 $( window ).on( 'resize', function() { 367 dipl_team_grid_calc_overlay_height(); 368 } ); 369} ); 370 371// Init team grid. 372function dipl_init_vb_team_grid_pagination( $this ) { 373 if ( $this.find( '.dipl_team_grid_pagination_wrapper' ).length > 0 ) { 374 375 let $mainWrap = $this.find( '.dipl_team_grid_container' ); 376 $pagination_wrapper = $this.find('.dipl_team_grid_pagination_wrapper'), 377 $pagination = $pagination_wrapper.find('ul'), 378 $totalPages = isNaN( $pagination_wrapper.data('total_pages') ) || 0 === parseInt( $pagination_wrapper.data('total_pages') ) ? 1 : parseInt( $pagination_wrapper.data('total_pages') ); 379 380 let $options = { 381 totalPages: $totalPages, 382 }; 383 384 if ( 'on' === $mainWrap.data('show_prev_next') ) { 385 $options.prev = $mainWrap.data('prev_text'); 386 $options.next = $mainWrap.data('next_text'); 387 } 388 389 $pagination.DiviPlusTeamGridPagination( $options ); 390 } 391} 392 393// Calculate the team grid overlay height. 394function dipl_team_grid_calc_overlay_height() { 395 let $winWidth = parseFloat( jQuery(window).width() ); 396 397 if ( jQuery('.dipl_team_grid').find('.layout1').length > 0 ) { 398 jQuery('.dipl_team_grid .layout1').find('.dipl_team_grid_item').each( function() { 399 400 const $thisObj = jQuery( this ); 401 const $mainWrap = $thisObj.parents( '.dipl_team_grid_container' ); 402 403 let $paddingTopDesktop = parseFloat( $mainWrap.attr( 'data-content_padding_top_desktop' ) ), 404 $paddingTopTablet = parseFloat( $mainWrap.attr( 'data-content_padding_top_tablet' ) ), 405 $paddingTopPhone = parseFloat( $mainWrap.attr( 'data-content_padding_top_phone' ) ), 406 $paddingBottomDesktop = parseFloat( $mainWrap.attr( 'data-content_padding_bottom_desktop' ) ), 407 $paddingBottomTablet = parseFloat( $mainWrap.attr( 'data-content_padding_bottom_tablet' ) ), 408 $paddingBottomPhone = parseFloat( $mainWrap.attr( 'data-content_padding_bottom_phone' ) ), 409 410 $paddingDesktop = $paddingTopDesktop + $paddingBottomDesktop, 411 $paddingTablet = $paddingTopTablet + $paddingBottomTablet, 412 $paddingPhone = $paddingTopPhone + $paddingBottomPhone, 413 $padding = $winWidth > 980 ? $paddingDesktop : $winWidth < 768 ? $paddingPhone : $paddingTablet, 414 $innerHeight = $thisObj.find(".dipl_team_member_visible_wrapper").length > 0 ? parseFloat( $thisObj.find(".dipl_team_member_visible_wrapper").height() ) : 0, 415 $translate = $padding + $innerHeight; 416 if ( 0 === $innerHeight ) { 417 $thisObj.find( '.dipl_team_overlay_wrapper' ).css( 'transform', 'translateY(100%)' ); 418 } else { 419 $thisObj.find( '.dipl_team_overlay_wrapper' ).css( 'transform', 'translateY(calc(100% - ' + $translate + 'px ))' ); 420 } 421 } ); 422 } 423 424 if ( jQuery('.dipl_team_grid').find('.layout2').length > 0 ) { 425 jQuery('.dipl_team_grid .layout2').find('.dipl_team_grid_item').each( function() { 426 427 const $thisObj = jQuery( this ); 428 const $mainWrap = $thisObj.parents( '.dipl_team_grid_container' ); 429 430 let $paddingTopDesktop = parseFloat( $mainWrap.data('padding_top_desktop') ), 431 $paddingTopTablet = parseFloat( $mainWrap.data('padding_top_tablet') ), 432 $paddingTopPhone = parseFloat( $mainWrap.data('padding_top_phone') ), 433 $paddingBottomDesktop = parseFloat( $mainWrap.data('padding_bottom_desktop') ), 434 $paddingBottomTablet = parseFloat( $mainWrap.data('padding_bottom_tablet') ), 435 $paddingBottomPhone = parseFloat( $mainWrap.data('padding_bottom_phone') ), 436 437 $paddingDesktop = $paddingTopDesktop + $paddingBottomDesktop, 438 $paddingTablet = $paddingTopTablet + $paddingBottomTablet, 439 $paddingPhone = $paddingTopPhone + $paddingBottomPhone, 440 $padding = $winWidth > 980 ? $paddingDesktop : $winWidth < 768 ? $paddingPhone : $paddingTablet,
441 $innerHeight = $thisObj.find(".dipl_team_member_visible_wrapper").length > 0 ? parseFloat( $thisObj.find(".dipl_team_member_visible_wrapper").height() ) : 0, 442 $translate = $padding + $innerHeight; 443 if ( 0 === $innerHeight ) { 444 $thisObj.find('.dipl_team_overlay_wrapper').css('transform', 'translateY(100%)'); 445 } else { 446 $thisObj.find('.dipl_team_overlay_wrapper').css('transform', 'translateY(calc(100% - '+$translate +'px ))'); 447 } 448 } ); 449 } 450}
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.