1"use strict"; 2(function ($) { 3 "use strict"; 4 5 /*Ready DOM scripts*/ 6 $(document).ready(function () { 7 stm_sticky_footer(); 8 stm_open_search(); 9 stmFullwidthRowJs(); 10 default_widgets_scripts(); 11 if(!$('body').hasClass('splashBaseball') && !$('body').hasClass('basketball_two')){ 12 eventPaginations(); 13 } 14 if(navigator.userAgent.indexOf('Macintosh') >= 0){ 15 $('body').addClass('stm-macintosh'); 16 } 17 $(".stm-post-comments").on('click', function(e) { 18 e.preventDefault(); 19 $([document.documentElement, document.body]).animate({ 20 scrollTop: $("#comments").offset().top 21 }, 600); 22 }); 23 //Default plugins 24 $("select:not(.disable-select2)").select2({ 25 width: '100%', 26 minimumResultsForSearch: '1' 27 }); 28 29 if($('.read-content').length > 0 ) { 30 $('.read-content').readingTime({ 31 success: function (data) { 32 $('.read_text').text(data.eta.time + ' ' + toRead); 33 }, 34 }); 35 } 36 37 $('.stm-iframe').fancybox({ 38 type: 'iframe', 39 padding: 0, 40 maxWidth: '800px', 41 width: '100%', 42 fitToView: false, 43 beforeLoad: function () { 44 this.href = $(this.element).data('url'); 45 } 46 }); 47 48 $('.stm-fancybox').fancybox({ 49 fitToView: false, 50 padding: 0, 51 autoSize: true, 52 closeClick: false, 53 maxWidth: '100%', 54 maxHeight: '90%', 55 beforeShow: function () { 56 $('body').addClass('stm_locked'); 57 this.title = $(this.element).attr("data-caption"); 58 }, 59 beforeClose: function () { 60 $('body').removeClass('stm_locked'); 61 }, 62 helpers: { 63 title: { 64 type: 'inside' 65 }, 66 overlay: { 67 locked: false 68 } 69 } 70 }); 71 72 $('button[name="calc_shipping"]').on('click', function(){ 73 $('body').find('select#calc_shipping_country').select2('destroy'); 74 setTimeout(function(){ 75 $('body').find('select#calc_shipping_country').select2({ 76 width: '100%', 77 minimumResultsForSearch: '1' 78 }); 79 }, 2500) 80 }) 81 82 $('html').on('click', function (evt) { 83 $('.search-input').removeClass('active'); 84 $('.search-submit').removeClass('activated'); 85 $('.bloglogo').removeClass("logoHide"); 86 }); 87 88 stm_sort_media(); 89 90 // Event form validation 91 $('.donation-popup-form').on('submit', function (e) { 92 e.preventDefault(); 93 var $this = $(this); 94 $($this).removeClass('error'); 95 $($this).find('.loading').addClass('active'); 96 $(this).ajaxSubmit({ 97 url: ajaxurl, 98 dataType: 'json', 99 success: function (data) { 100 $($this).find('.loading').removeClass('active'); 101 if (data['redirect_url']) { 102 top.location.href = data['redirect_url']; 103 $($this).replaceWith('<p class="alert alert-success heading-font">' + data['success'] + '</p>'); 104 } else if( data['success'] ){ 105 $($this).replaceWith('<p class="alert alert-success heading-font">' + data['success'] + '</p>'); 106 } else { 107 for (var k in data['errors']) { 108 $($this).find('input[name="donor[' + k + ']"]').addClass('error'); 109 $($this).find('textarea[name="donor[' + k + ']"]').addClass('error'); 110 } 111 } 112 } 113 }); 114 $($this).find('.error').on('mouseover', function () { 115 $(this).removeClass('error'); 116 }); 117 return false;
118 }); 119 120 $('.stm-load-more-images-grid').on('click', function(e){ 121 e.preventDefault(); 122 $(this).closest('.stm-images-grid').find('.stm-waiting').addClass('animated fadeIn').removeClass('stm-waiting'); 123 $(this).remove(); 124 }); 125 126 $('.stm-media-load-more a').on('click', function(e){ 127 e.preventDefault(); 128 129 var page = $(this).attr('data-page'); 130 var category = $(this).attr('data-category'); 131 var loadBy = $(this).attr('data-load'); 132 var player_id = 'none'; 133 if(typeof stm_player_id !== 'undefined') { 134 player_id = stm_player_id; 135 } 136 $.ajax({ 137 url: ajaxurl, 138 dataType: 'json', 139 context: this, 140 data: { 141 action: 'splash_load_media', 142 page: page, 143 load: loadBy, 144 category: category, 145 playerId: player_id, 146 security: splash_load_media 147 }, 148 beforeSend: function(){ 149 $(this).addClass('loading'); 150 }, 151 success: function (data) { 152 $(this).removeClass('loading'); 153 if(data.offset !== 'none') { 154 $(this).attr('data-page', data.offset); 155 } else { 156 $(this).remove(); 157 } 158 159 if(data.html) { 160 var $items = $(data.html); 161 $('#' + category + '_media .stm-medias-unit').append($items).isotope('appended', $items, false); 162 stm_sort_media(); 163 } 164 } 165 }); 166 }); 167 168 $('.stm-single-product-content-right table.variations select').on("change", function() { 169 $(this).parent().find('.select2-selection__rendered').text($(this).find('option[value="'+ $(this).val() +'"]').text()); 170 }); 171 172 $('.stm-menu-toggle, .stm-menu-toggle-baseball').on('click', function(e){ 173 e.preventDefault(); 174 $(this).toggleClass('opened'); 175 $('.stm-mobile-menu-unit').slideToggle(); 176 if($(this).hasClass('opened')) { 177 $('.stm-main-menu').addClass("opened"); 178 $('.stm-menu-overlay-fullscreen').addClass("opened"); 179 } else { 180 $('.stm-main-menu').removeClass("opened"); 181 $('.stm-menu-overlay-fullscreen').removeClass("opened"); 182 } 183 }); 184 185 $('body').on('click', '.stm-menu-overlay-fullscreen', function () { 186 $('.stm-menu-toggle, .stm-menu-toggle-baseball').removeClass("opened"); 187 $('.stm-main-menu').removeClass("opened"); 188 $('.stm-menu-overlay-fullscreen').removeClass("opened"); 189 }); 190 191 $(document).on("click", ".stm-mobile-menu-list li a", function() { 192 if( $(this).parent("li").hasClass("menu-item-has-children") && ! $(this).parent("li").hasClass("active") ) { 193 $(this).closest("li").siblings().find("ul").slideUp(); 194 $(this).closest("li").siblings().find("li").toggleClass("active"); 195 196 $(this).next("ul").slideDown(); 197 $(this).parent("li").toggleClass("active"); 198 199 return false; 200 } 201 }); 202 203 $(document).on("click", ".mobile-menu-bsbl > li", function() { 204 205 if( $(this).hasClass("menu-item-has-children") && ! $(this).hasClass("active") ) { 206 $(this).siblings().find("ul").hide(); 207 $(this).siblings().find("li").toggleClass("active"); 208 209 $(this).find("ul").slideDown(); 210 $(this).addClass("active").siblings().toggleClass("active"); 211 212 return false; 213 } else { 214 215 $(".mobile-menu-bsbl li").each(function () { 216 $(this).find("ul").hide(); 217 $(this).removeClass("active"); 218 }); 219 220 return true; 221 } 222 }); 223 224 $(".stm-stat-points").counterUp({ 225 delay: 10, 226 time: 500 227 }); 228 229 $(window).on("scroll",function(){ 230 //if(! /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ){ 231 if($(window).scrollTop() !== 0) { 232 $("#stm-top-bar").addClass("top-sticky"); 233 } else { 234 $("#stm-top-bar").removeClass("top-sticky"); 235 } 236 237 /*}else{ 238 }*/ 239 }); 240 241 $(".rev-close-btn").on("click", function () { 242 $(this).removeClass("open"); 243 $.fancybox.close(); 244 }); 245 246 $(".rev-play-btn").on('click', function (e) { 247 e.preventDefault(); 248 $(".rev-close-btn").addClass("open"); 249 $(".rev-play-btn").fancybox({ 250 'titleShow' : false, 251 'transitionIn' : 'elastic', 252 'transitionOut' : 'elastic', 253 'closeBtn' : false, 254 'closeClick' : false, 255 helpers : { 256 overlay : {closeClick: false} 257 }, 258 'padding': 0, 259 'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'), 260 'type' : 'swf', 261 'swf' : {'wmode':'transparent','allowfullscreen':'true'}, 262 }); 263 }); 264 }); 265 266 /*Window load scripts*/ 267 268 $(window).on('load',function () { 269 if($('body').hasClass('preloader')){ 270 $('body').removeClass('preloader'); 271 } 272 stm_sticky_footer(); 273 stmFullwidthRowJs(); 274 }); 275 276 /*Window resize scripts*/ 277 $(window).on('resize',function () { 278 stm_sticky_footer(); 279 stmFullwidthRowJs(); 280 }); 281 282 283 /*CUSTOM FUNCTIONS*/ 284 /*Sticky footer*/ 285 function stm_sticky_footer() { 286 var winH = $(window).outerHeight(); 287 var footerH = $('.stm-footer').outerHeight(); 288 var siteMinHeight = winH - footerH; 289 290 if($('body').hasClass('splashBaseball') && $('body').hasClass('page-template-coming-soon') && siteMinHeight < 600) { 291 siteMinHeight = siteMinHeight + 100; 292 } 293 294 $('#wrapper').css({ 295 'min-height': siteMinHeight + 'px' 296 }); 297 298 $('body').css({ 299 'padding-bottom': (footerH - 1) + 'px' 300 }); 301 302 } 303 304 function stm_open_search() { 305 $('.stm-header-search').on('click', function (e) { 306 e.stopPropagation(); 307 }); 308 309 $('.search-submit').on('click', function (e) { 310 $(".bloglogo").toggleClass("logoHide"); 311 $(this).toggleClass('activated'); 312 var inputText = $(this).closest('form').find('input'); 313 if (!$(this).parents('.widget').length && !inputText.hasClass('active') || inputText.val() == '' ) { 314 e.preventDefault(); 315 inputText.toggleClass('active'); 316 inputText.focus(); 317 } else { 318 $('.search-input').removeClass('active'); 319 $('.search-submit').removeClass('activated'); 320 $('.bloglogo').removeClass("logoHide"); 321 } 322 323 }); 324 } 325 326 function stm_sort_media() { 327 // init Isotope 328 if ($('.stm-medias-unit').length) { 329 if (typeof imagesLoaded == 'function') { 330 $('.stm-medias-unit').imagesLoaded(function () { 331 $('.stm-medias-unit').isotope({ 332 itemSelector: '.stm-media-single-unit', 333 layoutMode: 'masonry' 334 }); 335 }); 336 } 337 } 338 339 $('.stm-media-tabs-nav a').on('shown.bs.tab', function (e) { 340 var tabId = $(this).attr('href'); 341 $(tabId + ' .stm-medias-unit').isotope('layout'); 342 }) 343 } 344 345 function default_widgets_scripts() { 346 var stm_menu_widget = $('.widget_nav_menu'); 347 var stm_categories_widget = $('.widget_categories'); 348 var stm_recent_entries = $('.widget_recent_entries'); 349 350 if(stm_menu_widget.length) { 351 stm_menu_widget.each(function () { 352 if($(this).closest('.footer-widgets-wrapper').length == 0) { 353 $(this).addClass('stm-widget-menu'); 354 $(this).find('a').each(function(){ 355 $(this).html('<span>' + $(this).text() + '</span>'); 356 }); 357 } 358 }); 359 } 360 361 if(stm_categories_widget.length) { 362 stm_categories_widget.each(function () { 363 $(this).find('a').each(function(){ 364 $(this).html('<span>' + $(this).text() + '</span>'); 365 }); 366 }); 367 } 368 369 if(stm_recent_entries.length) { 370 stm_recent_entries.each(function () { 371 if( !$(this).find('.post-date').length ) { 372 $(this).addClass('no-date'); 373 } 374 }); 375 } 376 } 377 378 function stmFullwidthRowJs() { 379 var winW = $(window).outerWidth(); 380 var contW = $('.stm-fullwidth-row-js').find('.container').width(); 381 var contMargins = (winW - contW) / 2; 382 $('.stm-fullwidth-row-js').css({ 383 'margin-left': -contMargins + 'px', 384 'margin-right': -contMargins + 'px' 385 }) 386 } 387 388 lightbox.option({ 389 'resizeDuration': 200, 390 'wrapAround': true 391 }) 392 function eventPaginations() { 393 if($('.stm-upcoming-events_list').length > 0 && $('.stm-upcoming-events_list').hasClass('paginated-list')){ 394 var container = $('.paginated-list'); 395 var limit = container.attr('data-rows'); 396 var listItem = container.find('li'); 397 var itemClass; 398 if($('body').hasClass('splashAmericanFootball') || $('body').hasClass('hockey')){ 399 listItem = $('.stm-upcoming-events_list tr.sp-row'); 400 } 401 if(listItem.length > limit){ 402 listItem.each(function(i){ 403 itemClass = 'page-num-' + Math.ceil((i + 1) / limit); 404 if((i + 1) > limit){ 405 $(this).addClass('hidden'); 406 } 407 $(this).addClass(itemClass); 408 }); 409 var paginate = '<ul class="custom-paginate">'; 410 for(var i = 1; i <= Math.ceil(listItem.length / limit); i++){ 411 var activeClass = i == 1 ? 'active' : ''; 412 paginate += '<li><a href="page-num-' + i + '" class="' + activeClass + '">' + i + '</a></li>'; 413 } 414 paginate += '</ul>'; 415 container.append(paginate); 416 } 417 418 $('body').on('click', '.custom-paginate a', function(e){ 419 e.preventDefault(); 420 $('.custom-paginate a').removeClass('active'); 421 $(this).addClass('active'); 422 var activePage = $(this).attr('href'); 423 var eventItems = $('.stm-upcoming-events_list.paginated-list ul li.stm-event-item'); 424 if($('body').hasClass('splashAmericanFootball') || $('body').hasClass('hockey')){ 425 eventItems = $('.stm-upcoming-events_list tr.sp-row'); 426 } 427 eventItems.each(function(){ 428 $(this).addClass('hidden'); 429 }); 430 $('.' + activePage).each(function(){ 431 $(this).removeClass('hidden'); 432 }); 433 $([document.documentElement, document.body]).animate({ 434 scrollTop: container.offset().top 435 }, 500); 436 }); 437 } 438 } 439
440 $('.sp-template-player-statistics .sp-table-wrapper').each(function(){ 441 new PerfectScrollbar(this); 442 }); 443 444 $('.widget_sp_player_list .sp-table-wrapper').each(function(){ 445 new PerfectScrollbar(this); 446 }); 447 448 $('.sp-template-event-performance .sp-table-wrapper').each(function(){ 449 new PerfectScrollbar(this); 450 }); 451 452 $('.sp-template-player-list .sp-table-wrapper').each(function(){ 453 new PerfectScrollbar(this); 454 }); 455 456})(jQuery); 457 458 459if (document.querySelector('.widget_league_table .sp-table-wrapper') !== null) { 460 new PerfectScrollbar('.widget_league_table .sp-table-wrapper'); 461} 462 463if (document.querySelector('.stm-af-template-event-list .stm-ipad-block') !== null) { 464 new PerfectScrollbar('.stm-af-template-event-list .stm-ipad-block'); 465} 466 467if (document.querySelector('.sp-template-league-table .sp-table-wrapper') !== null) { 468 new PerfectScrollbar('.sp-template-league-table .sp-table-wrapper'); 469} 470 471 472function stm_like(t) { 473 var post_id = t.attr('data-id'); 474 var count = parseInt(t.find("span").text()); 475 if (localStorage.getItem("liked_" + post_id)) { 476 return false; 477 } else { 478 localStorage.setItem("liked_" + post_id, 1); 479 jQuery.post(ajaxurl, {action: "stm_like", id: post_id, security: stm_like_nonce}).done(function () { 480 t.addClass("disabled"); 481 count++; 482 t.find("span").text(count); 483 }); 484 } 485} 486 487 488jQuery(window).on('load',function () { 489 jQuery('body.single #main > div.joomsport_team').each(function(){ 490 var jsPageTitle = ('.stm-page-title .container'); 491 var jsTeamEmbl = jQuery(this).find('.post-thumbnail'); 492 493 jQuery(jsTeamEmbl).detach().prependTo(jsPageTitle); 494 jQuery(jsPageTitle).parents('.stm-title-box-unit').addClass('js-title-page'); 495 }); 496 jQuery('body.single-joomsport_match #jsMatchViewID').each(function(){ 497 jQuery(this).children('div').slice(0,3).wrapAll('<div class="jsMatchScore">'); 498 }); 499 jQuery('#joomsport-container .namePlayerCart .PlayerCardPlNumber').each(function(){ 500 if( jQuery.trim(jQuery(this).text()) == "" ){ 501 jQuery(this).remove(); 502 } 503 }); 504});
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.