Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/Divi/epanel/shortcod.../js
File: et_shortcodes_frontend.js
/*! ET et_shortcodes_frontend.js */
[0] Fix | Delete
// et_switcher plugin v2.2
[1] Fix | Delete
(function($)
[2] Fix | Delete
{
[3] Fix | Delete
$.fn.et_shortcodes_switcher = function(options)
[4] Fix | Delete
{
[5] Fix | Delete
var defaults =
[6] Fix | Delete
{
[7] Fix | Delete
slides: '>div',
[8] Fix | Delete
activeClass: 'active',
[9] Fix | Delete
linksNav: '',
[10] Fix | Delete
findParent: true, //use parent elements to define active states
[11] Fix | Delete
lengthElement: 'li', //parent element, used only if findParent is set to true
[12] Fix | Delete
useArrows: false,
[13] Fix | Delete
arrowLeft: 'a#prev-arrow',
[14] Fix | Delete
arrowRight: 'a#next-arrow',
[15] Fix | Delete
auto: false,
[16] Fix | Delete
autoSpeed: 5000,
[17] Fix | Delete
slidePadding: '',
[18] Fix | Delete
pauseOnHover: true,
[19] Fix | Delete
fx: 'fade',
[20] Fix | Delete
sliderType: ''
[21] Fix | Delete
};
[22] Fix | Delete
[23] Fix | Delete
var options = $.extend(defaults, options);
[24] Fix | Delete
[25] Fix | Delete
return this.each(function()
[26] Fix | Delete
{
[27] Fix | Delete
var slidesContainer = jQuery(this).parent().css('position','relative'),
[28] Fix | Delete
$slides = jQuery(this).css({'overflow':'hidden','position':'relative'}),
[29] Fix | Delete
$slides_wrapper_box = slidesContainer.find('.et-tabs-content-wrapper'),
[30] Fix | Delete
$slides_wrapper = $slides_wrapper_box.parent(),
[31] Fix | Delete
$slide = $slides.find( '.et-tabs-content-wrapper' + options.slides),
[32] Fix | Delete
slidesNum = $slide.length,
[33] Fix | Delete
zIndex = slidesNum,
[34] Fix | Delete
currentPosition = 1,
[35] Fix | Delete
slideHeight = 0,
[36] Fix | Delete
$activeSlide,
[37] Fix | Delete
$nextSlide,
[38] Fix | Delete
slides_wrapper_width = $slides_wrapper.width(),
[39] Fix | Delete
$et_shortcodes_mobile_nav,
[40] Fix | Delete
$et_shortcodes_mobile_controls;
[41] Fix | Delete
[42] Fix | Delete
if (options.fx === 'slide') {
[43] Fix | Delete
$slides_wrapper_box.width( ( ( slidesNum + 2 ) * 200 ) + '%' );
[44] Fix | Delete
$slide.css({ 'width' : slides_wrapper_width, 'visibility' : 'visible' });
[45] Fix | Delete
[46] Fix | Delete
$slides_wrapper_box.append( $slide.filter(':first').clone().removeClass().addClass('et_slidecontent_cloned') );
[47] Fix | Delete
$slides_wrapper_box.prepend( $slide.filter(':last').clone().removeClass().addClass('et_slidecontent_cloned') );
[48] Fix | Delete
[49] Fix | Delete
$slides_wrapper_box.css( 'left', -slides_wrapper_width );
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
$slide.filter(':first').css({'display':'block'}).addClass('et_shortcode_slide_active');
[53] Fix | Delete
[54] Fix | Delete
if (options.slidePadding != '') $slide.css('padding',options.slidePadding);
[55] Fix | Delete
[56] Fix | Delete
if (options.linksNav != '') {
[57] Fix | Delete
var linkSwitcher = jQuery(options.linksNav);
[58] Fix | Delete
[59] Fix | Delete
var linkSwitcherTab = '';
[60] Fix | Delete
if (options.findParent) linkSwitcherTab = linkSwitcher.parent();
[61] Fix | Delete
else linkSwitcherTab = linkSwitcher;
[62] Fix | Delete
[63] Fix | Delete
if (!linkSwitcherTab.filter('.active').length) linkSwitcherTab.filter(':first').addClass('active');
[64] Fix | Delete
[65] Fix | Delete
linkSwitcher.click(function(){
[66] Fix | Delete
[67] Fix | Delete
var targetElement, orderNum;
[68] Fix | Delete
[69] Fix | Delete
if (options.findParent) targetElement = jQuery(this).parent();
[70] Fix | Delete
else targetElement = jQuery(this);
[71] Fix | Delete
[72] Fix | Delete
orderNum = targetElement.prevAll(options.lengthElement).length+1;
[73] Fix | Delete
[74] Fix | Delete
if (orderNum > currentPosition) gotoSlide(orderNum, 1);
[75] Fix | Delete
else gotoSlide(orderNum, -1);
[76] Fix | Delete
[77] Fix | Delete
return false;
[78] Fix | Delete
});
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
[82] Fix | Delete
if (options.useArrows) {
[83] Fix | Delete
var $right_arrow = jQuery(options.arrowRight),
[84] Fix | Delete
$left_arrow = jQuery(options.arrowLeft);
[85] Fix | Delete
[86] Fix | Delete
$right_arrow.click( function(){
[87] Fix | Delete
et_shortcodes_go_to_next_slide();
[88] Fix | Delete
return false;
[89] Fix | Delete
} );
[90] Fix | Delete
[91] Fix | Delete
$left_arrow.click( function(){
[92] Fix | Delete
et_shortcodes_go_to_previous_slide();
[93] Fix | Delete
return false;
[94] Fix | Delete
} );
[95] Fix | Delete
[96] Fix | Delete
}
[97] Fix | Delete
[98] Fix | Delete
function changeTab(){
[99] Fix | Delete
if (linkSwitcherTab != '') {
[100] Fix | Delete
linkSwitcherTab.siblings().removeClass('active');
[101] Fix | Delete
linkSwitcherTab.filter(':eq('+(currentPosition-1)+')').addClass('active');
[102] Fix | Delete
}
[103] Fix | Delete
}
[104] Fix | Delete
[105] Fix | Delete
function gotoSlide(slideNumber,dir){
[106] Fix | Delete
if ($slide.filter(':animated').length) return;
[107] Fix | Delete
[108] Fix | Delete
$activeSlide = $slide.parent().find('.et_slidecontent').filter(':eq('+(currentPosition-1)+')');
[109] Fix | Delete
[110] Fix | Delete
if (currentPosition === slideNumber) return;
[111] Fix | Delete
[112] Fix | Delete
$activeSlide.removeClass('et_shortcode_slide_active');
[113] Fix | Delete
[114] Fix | Delete
$nextSlide = $slide.parent().find('.et_slidecontent').filter(':eq('+(slideNumber-1)+')').addClass('et_shortcode_slide_active');
[115] Fix | Delete
[116] Fix | Delete
if ((currentPosition > slideNumber || currentPosition === 1) && (dir === -1)) {
[117] Fix | Delete
if (options.fx === 'slide') slideBack(500);
[118] Fix | Delete
if (options.fx === 'fade') slideFade(500);
[119] Fix | Delete
} else {
[120] Fix | Delete
if (options.fx === 'slide') slideForward(500);
[121] Fix | Delete
if (options.fx === 'fade') slideFade(500);
[122] Fix | Delete
}
[123] Fix | Delete
[124] Fix | Delete
currentPosition = $nextSlide.prevAll('.et_slidecontent').length + 1;
[125] Fix | Delete
[126] Fix | Delete
if (options.linksNav != '') changeTab();
[127] Fix | Delete
[128] Fix | Delete
if ( options.sliderType === 'images' || options.sliderType === 'simple' ){
[129] Fix | Delete
$et_shortcodes_mobile_controls.find('li').removeClass('et_shortcodes_active_control');
[130] Fix | Delete
$et_shortcodes_mobile_controls.find('li').eq(currentPosition-1).addClass('et_shortcodes_active_control');
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
return false;
[134] Fix | Delete
}
[135] Fix | Delete
[136] Fix | Delete
[137] Fix | Delete
if (options.auto) {
[138] Fix | Delete
auto_rotate();
[139] Fix | Delete
var pauseSlider = false;
[140] Fix | Delete
}
[141] Fix | Delete
[142] Fix | Delete
if (options.pauseOnHover) {
[143] Fix | Delete
slidesContainer.hover(function(){
[144] Fix | Delete
pauseSlider = true;
[145] Fix | Delete
},function(){
[146] Fix | Delete
pauseSlider = false;
[147] Fix | Delete
});
[148] Fix | Delete
}
[149] Fix | Delete
[150] Fix | Delete
function auto_rotate(){
[151] Fix | Delete
interval_shortcodes = setInterval(function(){
[152] Fix | Delete
if (!pauseSlider) {
[153] Fix | Delete
if (currentPosition === slidesNum)
[154] Fix | Delete
gotoSlide(1,1);
[155] Fix | Delete
else
[156] Fix | Delete
gotoSlide(currentPosition+1,1);
[157] Fix | Delete
[158] Fix | Delete
if (options.linksNav != '') changeTab();
[159] Fix | Delete
}
[160] Fix | Delete
},options.autoSpeed);
[161] Fix | Delete
}
[162] Fix | Delete
[163] Fix | Delete
function slideFade(speed){
[164] Fix | Delete
$activeSlide.css( { 'display' : 'none', 'opacity' : '0' } );
[165] Fix | Delete
[166] Fix | Delete
$nextSlide.css({'opacity' : '0', 'display':'block'}).animate( { opacity : 1 }, 700 );
[167] Fix | Delete
}
[168] Fix | Delete
[169] Fix | Delete
function slideForward(speed){
[170] Fix | Delete
var next_slide_order = $nextSlide.prevAll('.et_slidecontent').length+1,
[171] Fix | Delete
go_to_first_slide = false;
[172] Fix | Delete
[173] Fix | Delete
if ( $activeSlide.next('.et_slidecontent_cloned').length ) {
[174] Fix | Delete
next_slide_order = $activeSlide.prevAll().length+1;
[175] Fix | Delete
go_to_first_slide = true;
[176] Fix | Delete
}
[177] Fix | Delete
[178] Fix | Delete
$slides_wrapper_box.animate( { left : - ( $slides_wrapper.width() * next_slide_order ) }, 500, function(){
[179] Fix | Delete
if ( go_to_first_slide ) $slides_wrapper_box.css( 'left', - ( $slides_wrapper.width() ) );
[180] Fix | Delete
} );
[181] Fix | Delete
}
[182] Fix | Delete
[183] Fix | Delete
function slideBack(speed){
[184] Fix | Delete
var next_slide_order = $nextSlide.prevAll('.et_slidecontent').length+1,
[185] Fix | Delete
go_to_last_slide = false;
[186] Fix | Delete
[187] Fix | Delete
if ( $activeSlide.prev('.et_slidecontent_cloned').length ) {
[188] Fix | Delete
next_slide_order = 0;
[189] Fix | Delete
go_to_last_slide = true;
[190] Fix | Delete
}
[191] Fix | Delete
[192] Fix | Delete
$slides_wrapper_box.animate( { left : - ( $slides_wrapper.width() * next_slide_order ) }, 500, function(){
[193] Fix | Delete
if ( go_to_last_slide ) $slides_wrapper_box.css( 'left', - ( $slides_wrapper.width() * slidesNum ) );
[194] Fix | Delete
} );
[195] Fix | Delete
}
[196] Fix | Delete
[197] Fix | Delete
if (options.fx === 'slide') {
[198] Fix | Delete
$(window).resize( function(){
[199] Fix | Delete
$slides_wrapper_box.find('>div').css({ 'width' : $slides_wrapper.width() });
[200] Fix | Delete
$slides_wrapper_box.css( 'left', -( $slides_wrapper.width() * currentPosition ) );
[201] Fix | Delete
} );
[202] Fix | Delete
}
[203] Fix | Delete
[204] Fix | Delete
et_generate_mobile_nav();
[205] Fix | Delete
[206] Fix | Delete
function et_generate_mobile_nav(){
[207] Fix | Delete
var et_shortcodes_slides_num = slidesContainer.find( '.et_slidecontent' ).length,
[208] Fix | Delete
et_shortcodes_controllers_html = '';
[209] Fix | Delete
[210] Fix | Delete
if ( et_shortcodes_slides_num > 1 && ( options.sliderType === 'images' || options.sliderType === 'simple' ) ){
[211] Fix | Delete
slidesContainer.append( '<div class="et_shortcodes_controller_nav">' + '<ul class="et_shortcodes_controls"></ul>' + '<ul class="et_shortcodes_controls_arrows"><li><a href="#" class="et_sc_nav_next">' + et_shortcodes_strings.next + '<span></span></a></li><li><a href="#" class="et_sc_nav_prev">' + et_shortcodes_strings.previous + '<span></span></a></li></ul>' + '</div>' );
[212] Fix | Delete
[213] Fix | Delete
$et_shortcodes_mobile_controls = slidesContainer.find('.et_shortcodes_controls');
[214] Fix | Delete
for ( var i = 0; i < et_shortcodes_slides_num; i++ ) {
[215] Fix | Delete
et_shortcodes_controllers_html += '<li><a href="#"></a></li>';
[216] Fix | Delete
}
[217] Fix | Delete
$et_shortcodes_mobile_controls.prepend( et_shortcodes_controllers_html );
[218] Fix | Delete
$et_shortcodes_mobile_controls.find( 'li:first' ).addClass('et_shortcodes_active_control');
[219] Fix | Delete
$et_shortcodes_mobile_controls.find( 'a' ).click( function(){
[220] Fix | Delete
var $this_control = $(this),
[221] Fix | Delete
$this_control_li = $this_control.parent('li'),
[222] Fix | Delete
this_order = $this_control_li.prevAll().length+1;
[223] Fix | Delete
[224] Fix | Delete
if ( this_order == currentPosition ) return false;
[225] Fix | Delete
[226] Fix | Delete
if ( this_order > currentPosition ) gotoSlide(this_order, 1);
[227] Fix | Delete
else gotoSlide(this_order, -1);
[228] Fix | Delete
[229] Fix | Delete
return false;
[230] Fix | Delete
} );
[231] Fix | Delete
[232] Fix | Delete
$et_shortcodes_mobile_nav = slidesContainer.find('.et_shortcodes_controls_arrows');
[233] Fix | Delete
$et_shortcodes_mobile_nav.find('a').click( function(){
[234] Fix | Delete
var $this_link = jQuery(this),
[235] Fix | Delete
et_active_slide_order;
[236] Fix | Delete
[237] Fix | Delete
if ( $this_link.hasClass( 'et_sc_nav_next' ) )
[238] Fix | Delete
et_shortcodes_go_to_next_slide();
[239] Fix | Delete
[240] Fix | Delete
if ( $this_link.hasClass( 'et_sc_nav_prev' ) )
[241] Fix | Delete
et_shortcodes_go_to_previous_slide();
[242] Fix | Delete
[243] Fix | Delete
$et_shortcodes_mobile_controls.find('li').removeClass('et_shortcodes_active_control');
[244] Fix | Delete
[245] Fix | Delete
et_active_slide_order = currentPosition - 1;
[246] Fix | Delete
[247] Fix | Delete
$et_shortcodes_mobile_controls.find('li').eq( et_active_slide_order ).addClass('et_shortcodes_active_control');
[248] Fix | Delete
[249] Fix | Delete
return false;
[250] Fix | Delete
} );
[251] Fix | Delete
} else if ( options.sliderType !== 'images' && options.sliderType !== 'simple' ) {
[252] Fix | Delete
slidesContainer.prepend( '<ul class="et_shortcodes_mobile_nav"><li><a href="#" class="et_sc_nav_next">' + et_shortcodes_strings.next + '<span></span></a></li><li><a href="#" class="et_sc_nav_prev">' + et_shortcodes_strings.previous + '<span></span></a></li></ul>' );
[253] Fix | Delete
$et_shortcodes_mobile_nav = slidesContainer.find('.et_shortcodes_mobile_nav');
[254] Fix | Delete
$et_shortcodes_mobile_nav.find('a').click( function(){
[255] Fix | Delete
var $this_link = jQuery(this);
[256] Fix | Delete
[257] Fix | Delete
if ( $this_link.hasClass( 'et_sc_nav_next' ) )
[258] Fix | Delete
et_shortcodes_go_to_next_slide();
[259] Fix | Delete
[260] Fix | Delete
if ( $this_link.hasClass( 'et_sc_nav_prev' ) )
[261] Fix | Delete
et_shortcodes_go_to_previous_slide();
[262] Fix | Delete
[263] Fix | Delete
return false;
[264] Fix | Delete
} );
[265] Fix | Delete
}
[266] Fix | Delete
}
[267] Fix | Delete
[268] Fix | Delete
function et_shortcodes_go_to_next_slide(){
[269] Fix | Delete
if (currentPosition === slidesNum)
[270] Fix | Delete
gotoSlide(1,1);
[271] Fix | Delete
else
[272] Fix | Delete
gotoSlide(currentPosition+1),1;
[273] Fix | Delete
[274] Fix | Delete
if (options.linksNav != '') changeTab();
[275] Fix | Delete
}
[276] Fix | Delete
[277] Fix | Delete
function et_shortcodes_go_to_previous_slide(){
[278] Fix | Delete
if (currentPosition === 1)
[279] Fix | Delete
gotoSlide(slidesNum,-1);
[280] Fix | Delete
else
[281] Fix | Delete
gotoSlide(currentPosition-1,-1);
[282] Fix | Delete
[283] Fix | Delete
if (options.linksNav != '') changeTab();
[284] Fix | Delete
}
[285] Fix | Delete
});
[286] Fix | Delete
}
[287] Fix | Delete
[288] Fix | Delete
window.et_shortcodes_init = function( $container ) {
[289] Fix | Delete
var $processed_container = typeof $container !== 'undefined' ? $container : $( 'body' );
[290] Fix | Delete
var $et_pricing_table_button = $processed_container.find('.pricing-table a.icon-button');
[291] Fix | Delete
[292] Fix | Delete
$et_tooltip = $processed_container.find('.et-tooltip');
[293] Fix | Delete
$et_tooltip.on('mouseover mouseout', function(event){
[294] Fix | Delete
if (event.type == 'mouseover') {
[295] Fix | Delete
$(this).find('.et-tooltip-box').stop(true,true).animate({ opacity: 'show', bottom: '25px' }, 300);
[296] Fix | Delete
} else {
[297] Fix | Delete
$(this).find('.et-tooltip-box').delay(200).animate({ opacity: 'hide', bottom: '35px' }, 300);
[298] Fix | Delete
}
[299] Fix | Delete
});
[300] Fix | Delete
// learn more
[301] Fix | Delete
$et_learn_more = $processed_container.find('.et-learn-more .heading-more');
[302] Fix | Delete
$et_learn_more.on('click', function() {
[303] Fix | Delete
if ( $(this).hasClass('open') ) {
[304] Fix | Delete
$(this).removeClass('open');
[305] Fix | Delete
} else {
[306] Fix | Delete
$(this).addClass('open');
[307] Fix | Delete
}
[308] Fix | Delete
[309] Fix | Delete
$(this).parent('.et-learn-more').find('.learn-more-content').animate({ opacity: 'toggle', height: 'toggle' }, 300);
[310] Fix | Delete
});
[311] Fix | Delete
[312] Fix | Delete
$processed_container.find('.et-learn-more').not('.et-open').find('.learn-more-content').css( { 'visibility' : 'visible', 'display' : 'none' } );
[313] Fix | Delete
[314] Fix | Delete
$et_pricing_table_button.each( function(){
[315] Fix | Delete
var $this_button = $(this),
[316] Fix | Delete
this_button_width = $this_button.width(),
[317] Fix | Delete
this_button_innerwidth = $this_button.innerWidth();
[318] Fix | Delete
[319] Fix | Delete
$this_button.css( { width : this_button_width, 'marginLeft' : '-' + ( this_button_innerwidth / 2 ) + 'px', 'visibility' : 'visible' } );
[320] Fix | Delete
} );
[321] Fix | Delete
[322] Fix | Delete
var $et_shortcodes_tabs = $processed_container.find('.et-tabs-container, .tabs-left, .et-simple-slider, .et-image-slider');
[323] Fix | Delete
$et_shortcodes_tabs.each(function(i){
[324] Fix | Delete
var et_shortcodes_tab_class = $(this).attr('class'),
[325] Fix | Delete
et_shortcodes_tab_autospeed_class_value = /et_sliderauto_speed_(\d+)/g,
[326] Fix | Delete
et_shortcodes_tab_autospeed = et_shortcodes_tab_autospeed_class_value.exec( et_shortcodes_tab_class ),
[327] Fix | Delete
et_shortcodes_tab_auto_class_value = /et_sliderauto_(\w+)/g,
[328] Fix | Delete
et_shortcodes_tab_auto = et_shortcodes_tab_auto_class_value.exec( et_shortcodes_tab_class ),
[329] Fix | Delete
et_shortcodes_tab_type_class_value = /et_slidertype_(\w+)/g,
[330] Fix | Delete
et_shortcodes_tab_type = et_shortcodes_tab_type_class_value.exec( et_shortcodes_tab_class ),
[331] Fix | Delete
et_shortcodes_tab_fx_class_value = /et_sliderfx_(\w+)/g,
[332] Fix | Delete
et_shortcodes_tab_fx = et_shortcodes_tab_fx_class_value.exec( et_shortcodes_tab_class ),
[333] Fix | Delete
et_shortcodes_tab_apply_to_element = '.et-tabs-content',
[334] Fix | Delete
et_shortcodes_tab_settings = {};
[335] Fix | Delete
[336] Fix | Delete
et_shortcodes_tab_settings.linksNav = $(this).find('.et-tabs-control li a');
[337] Fix | Delete
et_shortcodes_tab_settings.findParent = true;
[338] Fix | Delete
et_shortcodes_tab_settings.fx = et_shortcodes_tab_fx[1];
[339] Fix | Delete
et_shortcodes_tab_settings.auto = 'false' === et_shortcodes_tab_auto[1] ? false : true;
[340] Fix | Delete
et_shortcodes_tab_settings.autoSpeed = et_shortcodes_tab_autospeed[1];
[341] Fix | Delete
[342] Fix | Delete
if ( 'simple' === et_shortcodes_tab_type[1] ){
[343] Fix | Delete
et_shortcodes_tab_settings = {};
[344] Fix | Delete
et_shortcodes_tab_settings.fx = et_shortcodes_tab_fx[1];
[345] Fix | Delete
et_shortcodes_tab_settings.auto = 'false' === et_shortcodes_tab_auto[1] ? false : true;
[346] Fix | Delete
et_shortcodes_tab_settings.autoSpeed = et_shortcodes_tab_autospeed[1];
[347] Fix | Delete
et_shortcodes_tab_settings.sliderType = 'simple';
[348] Fix | Delete
et_shortcodes_tab_apply_to_element = '.et-simple-slides';
[349] Fix | Delete
} else if ( 'images' === et_shortcodes_tab_type[1] ){
[350] Fix | Delete
et_shortcodes_tab_settings.sliderType = 'images';
[351] Fix | Delete
et_shortcodes_tab_settings.linksNav = '#' + $(this).attr('id') + ' .controllers a.switch';
[352] Fix | Delete
et_shortcodes_tab_settings.findParent = false;
[353] Fix | Delete
et_shortcodes_tab_settings.lengthElement = '#' + $(this).attr('id') + ' a.switch';
[354] Fix | Delete
et_shortcodes_tab_apply_to_element = '.et-image-slides';
[355] Fix | Delete
}
[356] Fix | Delete
[357] Fix | Delete
$(this).find(et_shortcodes_tab_apply_to_element).et_shortcodes_switcher( et_shortcodes_tab_settings );
[358] Fix | Delete
});
[359] Fix | Delete
}
[360] Fix | Delete
})(jQuery);
[361] Fix | Delete
// end et_switcher plugin v2
[362] Fix | Delete
[363] Fix | Delete
/////// Shortcodes Javascript ///////
[364] Fix | Delete
jQuery(document).ready(function($){
[365] Fix | Delete
window.et_shortcodes_init();
[366] Fix | Delete
});
[367] Fix | Delete
[368] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function