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/core/admin/js
File: functions-init.js
/* <![CDATA[ */
[0] Fix | Delete
var clearpath = ePanelishSettings.clearpath;
[1] Fix | Delete
[2] Fix | Delete
jQuery( document ).ready( function( $ ) {
[3] Fix | Delete
var editors = [];
[4] Fix | Delete
[5] Fix | Delete
function addEditorInstance( codeEditor, $element, config ) {
[6] Fix | Delete
if ( !$element || $element.length === 0 ) {
[7] Fix | Delete
return;
[8] Fix | Delete
}
[9] Fix | Delete
var instance = codeEditor.initialize( $element, {
[10] Fix | Delete
codemirror: config
[11] Fix | Delete
} );
[12] Fix | Delete
if ( instance && instance.codemirror ) {
[13] Fix | Delete
editors.push( instance.codemirror );
[14] Fix | Delete
}
[15] Fix | Delete
}
[16] Fix | Delete
[17] Fix | Delete
// Use WP 4.9 CodeMirror Editor for Custom CSS
[18] Fix | Delete
var codeEditor = window.wp && window.wp.codeEditor;
[19] Fix | Delete
if ( codeEditor && codeEditor.initialize && codeEditor.defaultSettings && codeEditor.defaultSettings.codemirror ) {
[20] Fix | Delete
[21] Fix | Delete
// User ET CodeMirror theme
[22] Fix | Delete
var configCSS = $.extend( {}, codeEditor.defaultSettings.codemirror, {
[23] Fix | Delete
theme: 'et'
[24] Fix | Delete
} );
[25] Fix | Delete
var configHTML = $.extend( {}, configCSS, {
[26] Fix | Delete
mode: 'htmlmixed'
[27] Fix | Delete
} );
[28] Fix | Delete
[29] Fix | Delete
if ( $( '#divi_custom_css' ).length > 0 ) {
[30] Fix | Delete
// Divi Theme
[31] Fix | Delete
addEditorInstance( codeEditor, $( '#divi_custom_css' ), configCSS );
[32] Fix | Delete
addEditorInstance( codeEditor, $( '#divi_integration_head' ), configHTML );
[33] Fix | Delete
addEditorInstance( codeEditor, $( '#divi_integration_body' ), configHTML );
[34] Fix | Delete
addEditorInstance( codeEditor, $( '#divi_integration_single_top' ), configHTML );
[35] Fix | Delete
addEditorInstance( codeEditor, $( '#divi_integration_single_bottom' ), configHTML );
[36] Fix | Delete
} else if ( $( '#extra_custom_css' ).length > 0 ) {
[37] Fix | Delete
// Extra Theme
[38] Fix | Delete
addEditorInstance( codeEditor, $( '#extra_custom_css' ), configCSS );
[39] Fix | Delete
addEditorInstance( codeEditor, $( '#extra_integration_head' ), configHTML );
[40] Fix | Delete
addEditorInstance( codeEditor, $( '#extra_integration_body' ), configHTML );
[41] Fix | Delete
addEditorInstance( codeEditor, $( '#extra_integration_single_top' ), configHTML );
[42] Fix | Delete
addEditorInstance( codeEditor, $( '#extra_integration_single_bottom' ), configHTML );
[43] Fix | Delete
}
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
var $palette_inputs = $( '.et_color_palette_main_input' );
[47] Fix | Delete
[48] Fix | Delete
$( '#epanel-content,#epanel-content > div' ).tabs( {
[49] Fix | Delete
fx: {
[50] Fix | Delete
opacity: 'toggle',
[51] Fix | Delete
duration: 'fast'
[52] Fix | Delete
},
[53] Fix | Delete
selected: 0,
[54] Fix | Delete
activate: function( event, ui ) {
[55] Fix | Delete
$epanel = $( '#epanel' );
[56] Fix | Delete
[57] Fix | Delete
if ( $epanel.hasClass( 'onload' ) ) {
[58] Fix | Delete
$epanel.removeClass( 'onload' );
[59] Fix | Delete
}
[60] Fix | Delete
}
[61] Fix | Delete
} );
[62] Fix | Delete
[63] Fix | Delete
$( ".et-box-description" ).click( function() {
[64] Fix | Delete
var descheading = $( this ).parent( '.et-epanel-box' ).find( ".et-box-title h3" ).html();
[65] Fix | Delete
var desctext = $( this ).parent( '.et-epanel-box' ).find( ".et-box-title .et-box-descr" ).html();
[66] Fix | Delete
[67] Fix | Delete
$( 'body' ).append( "<div id='custom-lbox'><div class='et-box-desc'><div class='et-box-desc-top'>" + ePanelishSettings.help_label + "</div><div class='et-box-desc-content'><h3>" + descheading + "</h3>" + desctext + "<div class='et-lightbox-close'></div> </div> <div class='et-box-desc-bottom'></div> </div></div>" );
[68] Fix | Delete
[69] Fix | Delete
et_pb_center_modal( $( '.et-box-desc' ) );
[70] Fix | Delete
[71] Fix | Delete
$( '.et-lightbox-close' ).click( function() {
[72] Fix | Delete
et_pb_close_modal( $( '#custom-lbox' ) );
[73] Fix | Delete
} );
[74] Fix | Delete
} );
[75] Fix | Delete
[76] Fix | Delete
$( ".et-defaults-button.epanel-reset" ).click( function( e ) {
[77] Fix | Delete
e.preventDefault();
[78] Fix | Delete
$( ".reset-popup-overlay, .defaults-hover" ).addClass( 'active' );
[79] Fix | Delete
[80] Fix | Delete
et_pb_center_modal( $( '.defaults-hover' ) );
[81] Fix | Delete
} );
[82] Fix | Delete
[83] Fix | Delete
$( '.no' ).click( function() {
[84] Fix | Delete
et_pb_close_modal( $( '.reset-popup-overlay' ), 'no_remove' );
[85] Fix | Delete
[86] Fix | Delete
//clean the modal classes when animation complete
[87] Fix | Delete
setTimeout( function() {
[88] Fix | Delete
$( '.reset-popup-overlay, .defaults-hover' ).removeClass( 'active et_pb_modal_closing' );
[89] Fix | Delete
}, 600 );
[90] Fix | Delete
} );
[91] Fix | Delete
[92] Fix | Delete
// ":not([safari])" is desirable but not necessary selector
[93] Fix | Delete
// ":not([safari])" is desirable but not necessary selector
[94] Fix | Delete
$( '#epanel input:checkbox:not([safari]):not(.yes_no_button)' ).checkbox();
[95] Fix | Delete
$( '#epanel input[safari]:checkbox:not(.yes_no_button)' ).checkbox( { cls: 'jquery-safari-checkbox' } );
[96] Fix | Delete
$( '#epanel input:radio:not(.yes_no_button)' ).checkbox();
[97] Fix | Delete
[98] Fix | Delete
// Yes - No button UI
[99] Fix | Delete
$( '.yes_no_button' ).each( function() {
[100] Fix | Delete
var $checkbox = $( this );
[101] Fix | Delete
var value = $checkbox.is( ':checked' );
[102] Fix | Delete
var state = value ? 'et_pb_on_state' : 'et_pb_off_state';
[103] Fix | Delete
var $template = $( $( '#epanel-yes-no-button-template' ).html() ).find( '.et_pb_yes_no_button' ).addClass( state );
[104] Fix | Delete
[105] Fix | Delete
$checkbox.hide().after( $template );
[106] Fix | Delete
} );
[107] Fix | Delete
[108] Fix | Delete
$( '.et-box-content' ).on( 'click', '.et_pb_yes_no_button', function( e ) {
[109] Fix | Delete
e.preventDefault();
[110] Fix | Delete
// Fix for nested .et-box-content triggering checkboxes multiple times.
[111] Fix | Delete
e.stopPropagation();
[112] Fix | Delete
[113] Fix | Delete
var $click_area = $( this );
[114] Fix | Delete
var $box_content = $click_area.closest( '.et-box-content' );
[115] Fix | Delete
var $checkbox = $box_content.find( 'input[type="checkbox"]' );
[116] Fix | Delete
var $state = $box_content.find( '.et_pb_yes_no_button' );
[117] Fix | Delete
[118] Fix | Delete
if ( $state.parent().next().hasClass( 'et_pb_clear_static_css' ) ) {
[119] Fix | Delete
$state = $state.add( $state.parent() );
[120] Fix | Delete
[121] Fix | Delete
if ( $checkbox.is( ':checked' ) ) {
[122] Fix | Delete
$box_content.parent().next().hide();
[123] Fix | Delete
} else {
[124] Fix | Delete
$box_content.parent().next().show();
[125] Fix | Delete
}
[126] Fix | Delete
}
[127] Fix | Delete
[128] Fix | Delete
$state.toggleClass( 'et_pb_on_state et_pb_off_state' );
[129] Fix | Delete
[130] Fix | Delete
if ( $checkbox.is( ':checked' ) ) {
[131] Fix | Delete
$checkbox.prop( 'checked', false );
[132] Fix | Delete
} else {
[133] Fix | Delete
$checkbox.prop( 'checked', true );
[134] Fix | Delete
}
[135] Fix | Delete
[136] Fix | Delete
} );
[137] Fix | Delete
[138] Fix | Delete
var $save_message = $( "#epanel-ajax-saving" );
[139] Fix | Delete
[140] Fix | Delete
$( '#epanel-save-top' ).click( function( e ) {
[141] Fix | Delete
e.preventDefault();
[142] Fix | Delete
[143] Fix | Delete
$( '#epanel-save' ).trigger( 'click' );
[144] Fix | Delete
} );
[145] Fix | Delete
[146] Fix | Delete
$( '#epanel-save' ).click( function() {
[147] Fix | Delete
epanel_save( false, true );
[148] Fix | Delete
return false;
[149] Fix | Delete
} );
[150] Fix | Delete
[151] Fix | Delete
function epanel_save( callback, message ) {
[152] Fix | Delete
[153] Fix | Delete
// If CodeMirror is used
[154] Fix | Delete
if ( editors.length > 0 ) {
[155] Fix | Delete
$.each( editors, function( i, editor ) {
[156] Fix | Delete
if ( editor.save ) {
[157] Fix | Delete
// Make sure we store changes into original textarea
[158] Fix | Delete
editor.save();
[159] Fix | Delete
}
[160] Fix | Delete
} );
[161] Fix | Delete
}
[162] Fix | Delete
[163] Fix | Delete
var options_fromform = $( '#main_options_form' ).formSerialize();
[164] Fix | Delete
var add_nonce = '&_ajax_nonce=' + ePanelishSettings.epanelish_nonce;
[165] Fix | Delete
[166] Fix | Delete
options_fromform += add_nonce;
[167] Fix | Delete
[168] Fix | Delete
$.ajax( {
[169] Fix | Delete
type: "POST",
[170] Fix | Delete
url: ajaxurl,
[171] Fix | Delete
data: options_fromform,
[172] Fix | Delete
beforeSend: function( xhr ) {
[173] Fix | Delete
if ( message ) {
[174] Fix | Delete
$save_message.removeAttr( 'class' ).fadeIn( 'fast' );
[175] Fix | Delete
}
[176] Fix | Delete
},
[177] Fix | Delete
success: function( response ) {
[178] Fix | Delete
if ( message ) {
[179] Fix | Delete
$save_message.addClass( 'success-animation' );
[180] Fix | Delete
[181] Fix | Delete
setTimeout( function() {
[182] Fix | Delete
$save_message.fadeOut();
[183] Fix | Delete
}, 500 );
[184] Fix | Delete
}
[185] Fix | Delete
[186] Fix | Delete
if ( $.isFunction( callback ) ) {
[187] Fix | Delete
callback();
[188] Fix | Delete
}
[189] Fix | Delete
}
[190] Fix | Delete
} );
[191] Fix | Delete
}
[192] Fix | Delete
[193] Fix | Delete
function et_pb_close_modal( $overlay, no_overlay_remove ) {
[194] Fix | Delete
var $modal_container = $overlay;
[195] Fix | Delete
[196] Fix | Delete
// add class to apply the closing animation to modal
[197] Fix | Delete
$modal_container.addClass( 'et_pb_modal_closing' );
[198] Fix | Delete
[199] Fix | Delete
//remove the modal with overlay when animation complete
[200] Fix | Delete
setTimeout( function() {
[201] Fix | Delete
if ( 'no_remove' !== no_overlay_remove ) {
[202] Fix | Delete
$modal_container.remove();
[203] Fix | Delete
}
[204] Fix | Delete
}, 600 );
[205] Fix | Delete
}
[206] Fix | Delete
[207] Fix | Delete
if ( $palette_inputs.length ) {
[208] Fix | Delete
$palette_inputs.each( function() {
[209] Fix | Delete
var $this_input = $( this );
[210] Fix | Delete
var $palette_wrapper = $this_input.closest( '.et-box-content' );
[211] Fix | Delete
var $colorpalette_colorpickers = $palette_wrapper.find( '.input-colorpalette-colorpicker' );
[212] Fix | Delete
var colorpalette_colorpicker_index = 0;
[213] Fix | Delete
var saved_palette = $this_input.val().split( '|' );
[214] Fix | Delete
[215] Fix | Delete
$colorpalette_colorpickers.each( function() {
[216] Fix | Delete
var $colorpalette_colorpicker = $( this );
[217] Fix | Delete
var colorpalette_colorpicker_color = saved_palette[colorpalette_colorpicker_index];
[218] Fix | Delete
[219] Fix | Delete
$colorpalette_colorpicker.val( colorpalette_colorpicker_color ).wpColorPicker( {
[220] Fix | Delete
hide: false,
[221] Fix | Delete
default: $( this ).data( 'default-color' ),
[222] Fix | Delete
width: 313,
[223] Fix | Delete
palettes: false,
[224] Fix | Delete
change: function( event, ui ) {
[225] Fix | Delete
var $input = $( this );
[226] Fix | Delete
var data_index = $input.attr( 'data-index' );
[227] Fix | Delete
var $preview = $palette_wrapper.find( '.colorpalette-item-' + data_index + ' .color' );
[228] Fix | Delete
var color = ui.color.toString();
[229] Fix | Delete
[230] Fix | Delete
$input.val( color );
[231] Fix | Delete
$preview.css( { 'backgroundColor': color } );
[232] Fix | Delete
saved_palette[data_index - 1] = color;
[233] Fix | Delete
$this_input.val( saved_palette.join( '|' ) );
[234] Fix | Delete
}
[235] Fix | Delete
} );
[236] Fix | Delete
[237] Fix | Delete
$colorpalette_colorpicker.trigger( 'change' );
[238] Fix | Delete
[239] Fix | Delete
colorpalette_colorpicker_index++;
[240] Fix | Delete
} );
[241] Fix | Delete
[242] Fix | Delete
$palette_wrapper.on( 'click', '.colorpalette-item', function( e ) {
[243] Fix | Delete
e.preventDefault();
[244] Fix | Delete
[245] Fix | Delete
var $colorpalette_item = $( this );
[246] Fix | Delete
var data_index = $colorpalette_item.attr( 'data-index' );
[247] Fix | Delete
[248] Fix | Delete
// Hide other colorpalette colorpicker
[249] Fix | Delete
$palette_wrapper.find( '.colorpalette-colorpicker' ).removeClass( 'active' );
[250] Fix | Delete
[251] Fix | Delete
// Display selected colorpalette colorpicker
[252] Fix | Delete
$palette_wrapper.find( '.colorpalette-colorpicker[data-index="' + data_index + '"]' ).addClass( 'active' );
[253] Fix | Delete
} );
[254] Fix | Delete
} );
[255] Fix | Delete
}
[256] Fix | Delete
[257] Fix | Delete
if ( typeof etCore !== 'undefined' && typeof etCore.portability !== 'undefined' ) {
[258] Fix | Delete
// Portability integration.
[259] Fix | Delete
etCore.portability.save = function( callback ) {
[260] Fix | Delete
epanel_save( callback, false );
[261] Fix | Delete
};
[262] Fix | Delete
}
[263] Fix | Delete
[264] Fix | Delete
function et_pb_center_modal( $modal ) {
[265] Fix | Delete
var modal_height = $modal.outerHeight();
[266] Fix | Delete
var modal_height_adjustment = 0 - ( modal_height / 2 );
[267] Fix | Delete
[268] Fix | Delete
$modal.css( {
[269] Fix | Delete
top: '50%',
[270] Fix | Delete
bottom: 'auto',
[271] Fix | Delete
marginTop: modal_height_adjustment
[272] Fix | Delete
} );
[273] Fix | Delete
}
[274] Fix | Delete
[275] Fix | Delete
} );
[276] Fix | Delete
/* ]]> */
[277] Fix | Delete
[278] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function