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/wp-conte.../plugins/sitepres.../res/js
File: scripts.js
/*global jQuery, icl_ajx_url, icl_ajx_saved, icl_ajx_error, icl_ajxloaderimg_src */
[0] Fix | Delete
[1] Fix | Delete
var WPML_core = WPML_core || {};
[2] Fix | Delete
[3] Fix | Delete
WPML_core.htmlentities = function( s ) {
[4] Fix | Delete
return jQuery("<div/>").text( s ).html()
[5] Fix | Delete
};
[6] Fix | Delete
[7] Fix | Delete
[8] Fix | Delete
jQuery(document).ready(function($){
[9] Fix | Delete
var catAdder = jQuery('#category-adder');
[10] Fix | Delete
if (catAdder.html()) {
[11] Fix | Delete
catAdder.prepend('<p>' + icl_cat_adder_msg + '</p>');
[12] Fix | Delete
}
[13] Fix | Delete
jQuery('select[name="icl_translation_of"]').change(function(){jQuery('#icl_translate_options').fadeOut();});
[14] Fix | Delete
jQuery('#icl_dismiss_help').click(iclDismissHelp);
[15] Fix | Delete
jQuery('#icl_dismiss_upgrade_notice').click(iclDismissUpgradeNotice);
[16] Fix | Delete
jQuery(document).delegate('a.icl_toggle_show_translations', 'click', iclToggleShowTranslations);
[17] Fix | Delete
[18] Fix | Delete
/* needed for tagcloud */
[19] Fix | Delete
oldajaxurl = false;
[20] Fix | Delete
[21] Fix | Delete
jQuery(document).delegate("#icl_make_translatable_submit", 'click', icl_make_translatable);
[22] Fix | Delete
[23] Fix | Delete
jQuery('a.icl_user_notice_hide').click(icl_hide_user_notice);
[24] Fix | Delete
[25] Fix | Delete
var slugTranslation = jQuery('#icl_slug_translation');
[26] Fix | Delete
if (slugTranslation.length) {
[27] Fix | Delete
iclSaveForm_success_cb.push(function (form, response) {
[28] Fix | Delete
if (form.attr('name') === 'icl_slug_translation') {
[29] Fix | Delete
if (response[1] === 1) {
[30] Fix | Delete
jQuery('.icl_slug_translation_choice').show();
[31] Fix | Delete
} else {
[32] Fix | Delete
jQuery('.icl_slug_translation_choice').hide();
[33] Fix | Delete
}
[34] Fix | Delete
} else if (form.attr('name') === 'icl_custom_posts_sync_options') {
[35] Fix | Delete
jQuery('.icl_st_slug_tr_warn').hide();
[36] Fix | Delete
}
[37] Fix | Delete
});
[38] Fix | Delete
[39] Fix | Delete
slugTranslation.submit(iclSaveForm);
[40] Fix | Delete
jQuery('.icl_slug_translation_choice input[type=checkbox]').change(function () {
[41] Fix | Delete
var table_row = jQuery(this).closest('tr');
[42] Fix | Delete
var cpt_slugs = jQuery(table_row).find('.js-cpt-slugs');
[43] Fix | Delete
[44] Fix | Delete
if (jQuery(this).prop('checked')) {
[45] Fix | Delete
cpt_slugs.show();
[46] Fix | Delete
}
[47] Fix | Delete
else {
[48] Fix | Delete
cpt_slugs.hide();
[49] Fix | Delete
}
[50] Fix | Delete
});
[51] Fix | Delete
}
[52] Fix | Delete
[53] Fix | Delete
jQuery('.icl_sync_custom_posts').change(function(){
[54] Fix | Delete
var val = jQuery(this).val();
[55] Fix | Delete
var table_row = jQuery(this).closest('tr');
[56] Fix | Delete
var cpt_slugs = jQuery(table_row).find('.js-cpt-slugs');
[57] Fix | Delete
var icl_slug_translation = jQuery(table_row).find(':checkbox');
[58] Fix | Delete
if (val === 1) {
[59] Fix | Delete
icl_slug_translation.closest('.icl_slug_translation_choice').show();
[60] Fix | Delete
if( icl_slug_translation.prop('checked') && cpt_slugs) {
[61] Fix | Delete
cpt_slugs.show();
[62] Fix | Delete
}
[63] Fix | Delete
} else if(cpt_slugs) {
[64] Fix | Delete
icl_slug_translation.closest('.icl_slug_translation_choice').hide();
[65] Fix | Delete
cpt_slugs.hide();
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
});
[69] Fix | Delete
[70] Fix | Delete
function click_on_lock() {
[71] Fix | Delete
var radio_name = jQuery( this ).data( 'radio-name' ),
[72] Fix | Delete
unlocked_name = jQuery( this ).data( 'unlocked-name' );
[73] Fix | Delete
[74] Fix | Delete
jQuery( this ).fadeOut();
[75] Fix | Delete
jQuery( 'input[name="' + radio_name + '"]' ).prop( 'disabled', false );
[76] Fix | Delete
jQuery( 'input[name="' + unlocked_name + '"]' ).prop( 'value', '1' );
[77] Fix | Delete
[78] Fix | Delete
return false;
[79] Fix | Delete
}
[80] Fix | Delete
[81] Fix | Delete
function sync_lock_on_custom_fields_and_terms( form_id ) {
[82] Fix | Delete
var locks = jQuery( '#' + form_id ).find( '.js-wpml-sync-lock' );
[83] Fix | Delete
locks.on( 'click', click_on_lock );
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
$(document).on('icl-bind-locks', function( e ) {
[87] Fix | Delete
sync_lock_on_custom_fields_and_terms( e.detail );
[88] Fix | Delete
});
[89] Fix | Delete
[90] Fix | Delete
$( '#icl_custom_posts_sync_options .js-wpml-sync-lock, #icl_custom_tax_sync_options .js-wpml-sync-lock' ).on(
[91] Fix | Delete
'click',
[92] Fix | Delete
click_on_lock
[93] Fix | Delete
);
[94] Fix | Delete
[95] Fix | Delete
$(document).ready( function() {
[96] Fix | Delete
$( '.js-type-translation-row' ).each( function() {
[97] Fix | Delete
if ( $( this ).find( '.js-disabled-externally' ).length === 3 ) {
[98] Fix | Delete
$( this ).hide();
[99] Fix | Delete
}
[100] Fix | Delete
});
[101] Fix | Delete
});
[102] Fix | Delete
[103] Fix | Delete
jQuery(document).delegate('.icl_error_input', 'focus', function() {
[104] Fix | Delete
jQuery(this).removeClass('icl_error_input');
[105] Fix | Delete
});
[106] Fix | Delete
[107] Fix | Delete
$('.js-toggle-colors-edit').on('click', function(e) {
[108] Fix | Delete
e.preventDefault();
[109] Fix | Delete
[110] Fix | Delete
var $target = $( $(this).attr('href') );
[111] Fix | Delete
var $caret = $(this).find('.js-arrow-toggle');
[112] Fix | Delete
[113] Fix | Delete
if ( $target.is(':visible') ) {
[114] Fix | Delete
$target.slideUp();
[115] Fix | Delete
$caret.removeClass('dashicons-arrow-up').addClass('dashicons-arrow-down');
[116] Fix | Delete
}
[117] Fix | Delete
else {
[118] Fix | Delete
$target.slideDown();
[119] Fix | Delete
$caret.removeClass('dashicons-arrow-down').addClass('dashicons-arrow-up');
[120] Fix | Delete
}
[121] Fix | Delete
[122] Fix | Delete
return false;
[123] Fix | Delete
});
[124] Fix | Delete
[125] Fix | Delete
$('#js-post-availability').on('change', function(e) {
[126] Fix | Delete
[127] Fix | Delete
var $target = $( $(this).data('target') );
[128] Fix | Delete
[129] Fix | Delete
if ( $(this).prop('checked') ) {
[130] Fix | Delete
$target.show();
[131] Fix | Delete
}
[132] Fix | Delete
else {
[133] Fix | Delete
$target.hide();
[134] Fix | Delete
}
[135] Fix | Delete
[136] Fix | Delete
});
[137] Fix | Delete
[138] Fix | Delete
$('.js-wpml-navigation-links a').on('click', function(e) { // prevent default scrolling for navigation links
[139] Fix | Delete
e.preventDefault();
[140] Fix | Delete
[141] Fix | Delete
var $target = $( $(this).attr('href') );
[142] Fix | Delete
[143] Fix | Delete
if ( $target.length !== 0 ) {
[144] Fix | Delete
var offset = 0;
[145] Fix | Delete
var wpAdminBar = jQuery('#wpadminbar');
[146] Fix | Delete
if ( wpAdminBar.length !== 0 ) {
[147] Fix | Delete
offset = wpAdminBar.height();
[148] Fix | Delete
}
[149] Fix | Delete
[150] Fix | Delete
$('html, body').animate({
[151] Fix | Delete
scrollTop: $target.offset().top - offset
[152] Fix | Delete
}, 300, function() {
[153] Fix | Delete
var $header = $target.find('.wpml-section-header h3');
[154] Fix | Delete
$header.addClass('active');
[155] Fix | Delete
console.log($header);
[156] Fix | Delete
setTimeout(function(){
[157] Fix | Delete
$header.removeClass('active');
[158] Fix | Delete
}, 700);
[159] Fix | Delete
});
[160] Fix | Delete
}
[161] Fix | Delete
[162] Fix | Delete
return false;
[163] Fix | Delete
});
[164] Fix | Delete
[165] Fix | Delete
var icl_untranslated_blog_posts = $("input[name=icl_untranslated_blog_posts]");
[166] Fix | Delete
var icl_untranslated_blog_posts_help = $('#icl_untranslated_blog_posts_help');
[167] Fix | Delete
[168] Fix | Delete
var update_icl_untranslated_blog_posts = function () {
[169] Fix | Delete
//Get the value of currently selected radio option
[170] Fix | Delete
var value = icl_untranslated_blog_posts.filter(':checked').val();
[171] Fix | Delete
[172] Fix | Delete
if (value == 0) {
[173] Fix | Delete
icl_untranslated_blog_posts_help.fadeOut('slow');
[174] Fix | Delete
} else {
[175] Fix | Delete
icl_untranslated_blog_posts_help.fadeIn('slow');
[176] Fix | Delete
}
[177] Fix | Delete
};
[178] Fix | Delete
[179] Fix | Delete
update_icl_untranslated_blog_posts();
[180] Fix | Delete
icl_untranslated_blog_posts.bind('click', update_icl_untranslated_blog_posts);
[181] Fix | Delete
[182] Fix | Delete
var last_form_id = localStorage.getItem( 'wpml-mlcs-last-form-id' );
[183] Fix | Delete
if ( last_form_id ) {
[184] Fix | Delete
var last_form = jQuery( "#" + last_form_id );
[185] Fix | Delete
if ( last_form.length ) {
[186] Fix | Delete
jQuery( 'html, body' ).animate( {
[187] Fix | Delete
scrollTop: last_form.offset().top
[188] Fix | Delete
}, 1000 );
[189] Fix | Delete
}
[190] Fix | Delete
localStorage.removeItem( 'wpml-mlcs-last-form-id' );
[191] Fix | Delete
}
[192] Fix | Delete
[193] Fix | Delete
});
[194] Fix | Delete
[195] Fix | Delete
function fadeInAjxResp(spot, msg, err){
[196] Fix | Delete
if(err != undefined){
[197] Fix | Delete
col = jQuery(spot).css('color');
[198] Fix | Delete
jQuery(spot).css('color','red');
[199] Fix | Delete
}
[200] Fix | Delete
jQuery(spot).html(msg);
[201] Fix | Delete
jQuery(spot).fadeIn();
[202] Fix | Delete
window.setTimeout(fadeOutAjxResp, 3000, spot);
[203] Fix | Delete
if(err != undefined){
[204] Fix | Delete
jQuery(spot).css('color',col);
[205] Fix | Delete
}
[206] Fix | Delete
}
[207] Fix | Delete
[208] Fix | Delete
function fadeOutAjxResp(spot){
[209] Fix | Delete
jQuery(spot).fadeOut();
[210] Fix | Delete
}
[211] Fix | Delete
[212] Fix | Delete
/**
[213] Fix | Delete
* Create custom event
[214] Fix | Delete
* A kind of simple "polyfill" to support IE11
[215] Fix | Delete
*
[216] Fix | Delete
* @param eventName
[217] Fix | Delete
* @param eventDetail
[218] Fix | Delete
*/
[219] Fix | Delete
function wpmlCustomEvent( eventName, eventDetail ) {
[220] Fix | Delete
if ( !!window.MSInputMethodContext && !!document.documentMode ) {
[221] Fix | Delete
// Internet Explorer 11
[222] Fix | Delete
const event = document.createEvent( 'CustomEvent' );
[223] Fix | Delete
event.initCustomEvent(
[224] Fix | Delete
eventName,
[225] Fix | Delete
false,
[226] Fix | Delete
false,
[227] Fix | Delete
false
[228] Fix | Delete
);
[229] Fix | Delete
document.dispatchEvent(event);
[230] Fix | Delete
} else {
[231] Fix | Delete
document.dispatchEvent( new CustomEvent( eventName, eventDetail ) );
[232] Fix | Delete
}
[233] Fix | Delete
}
[234] Fix | Delete
[235] Fix | Delete
var icl_ajxloaderimg = '<img src="'+icl_ajxloaderimg_src+'" alt="loading" width="16" height="16" />';
[236] Fix | Delete
[237] Fix | Delete
var iclHaltSave = false; // use this for multiple 'submit events'
[238] Fix | Delete
var iclSaveForm_success_cb = [];
[239] Fix | Delete
function iclSaveForm() {
[240] Fix | Delete
[241] Fix | Delete
if (iclHaltSave) {
[242] Fix | Delete
return false;
[243] Fix | Delete
}
[244] Fix | Delete
var form_name = jQuery(this).attr('name');
[245] Fix | Delete
jQuery('form[name="' + form_name + '"] .icl_form_errors').html('').hide();
[246] Fix | Delete
var ajx_resp = jQuery('form[name="' + form_name + '"] .icl_ajx_response').attr('id');
[247] Fix | Delete
fadeInAjxResp('#' + ajx_resp, icl_ajxloaderimg);
[248] Fix | Delete
var serialized_form_data = jQuery(this).serialize();
[249] Fix | Delete
jQuery.ajax({
[250] Fix | Delete
type: "POST",
[251] Fix | Delete
url: icl_ajx_url,
[252] Fix | Delete
data: "icl_ajx_action=" + jQuery(this).attr('name') + "&" + serialized_form_data,
[253] Fix | Delete
success: function (msg) {
[254] Fix | Delete
var spl = msg.split('|');
[255] Fix | Delete
if (parseInt(spl[0]) == 1) {
[256] Fix | Delete
fadeInAjxResp('#' + ajx_resp, icl_ajx_saved);
[257] Fix | Delete
for (var i = 0; i < iclSaveForm_success_cb.length; i++) {
[258] Fix | Delete
iclSaveForm_success_cb[i](jQuery('form[name="' + form_name + '"]'), spl);
[259] Fix | Delete
}
[260] Fix | Delete
if (form_name == 'icl_slug_translation' ||
[261] Fix | Delete
form_name == 'wpml_ls_settings_form' ||
[262] Fix | Delete
form_name == 'icl_custom_posts_sync_options' ||
[263] Fix | Delete
form_name == 'icl_custom_tax_sync_options'
[264] Fix | Delete
) {
[265] Fix | Delete
localStorage.setItem( 'wpml-mlcs-last-form-id', form_name );
[266] Fix | Delete
location.reload( true );
[267] Fix | Delete
}
[268] Fix | Delete
var action = this.data.split( '&' )[0];
[269] Fix | Delete
action = action.split( '=' )[1];
[270] Fix | Delete
wpmlCustomEvent('icl-save-form-' + action );
[271] Fix | Delete
} else {
[272] Fix | Delete
var icl_form_errors = jQuery('form[name="' + form_name + '"] .icl_form_errors');
[273] Fix | Delete
var error_html = (typeof spl[1] != 'undefined') ? spl[1] : spl[0];
[274] Fix | Delete
icl_form_errors.html(error_html);
[275] Fix | Delete
icl_form_errors.fadeIn();
[276] Fix | Delete
fadeInAjxResp('#' + ajx_resp, icl_ajx_error, true);
[277] Fix | Delete
}
[278] Fix | Delete
}
[279] Fix | Delete
});
[280] Fix | Delete
return false;
[281] Fix | Delete
}
[282] Fix | Delete
[283] Fix | Delete
function iclDismissHelp(){
[284] Fix | Delete
var thisa = jQuery(this);
[285] Fix | Delete
jQuery.ajax({
[286] Fix | Delete
type: "POST",
[287] Fix | Delete
url: icl_ajx_url,
[288] Fix | Delete
data: "icl_ajx_action=dismiss_help&_icl_nonce=" + jQuery('#icl_dismiss_help_nonce').val(),
[289] Fix | Delete
success: function(msg){
[290] Fix | Delete
thisa.closest('#message').fadeOut();
[291] Fix | Delete
}
[292] Fix | Delete
});
[293] Fix | Delete
return false;
[294] Fix | Delete
}
[295] Fix | Delete
[296] Fix | Delete
function iclDismissUpgradeNotice(){
[297] Fix | Delete
var thisa = jQuery(this);
[298] Fix | Delete
jQuery.ajax({
[299] Fix | Delete
type: "POST",
[300] Fix | Delete
url: icl_ajx_url,
[301] Fix | Delete
data: "icl_ajx_action=dismiss_upgrade_notice&_icl_nonce=" + jQuery('#_icl_nonce_dun').val(),
[302] Fix | Delete
success: function(msg){
[303] Fix | Delete
thisa.parent().parent().fadeOut();
[304] Fix | Delete
}
[305] Fix | Delete
});
[306] Fix | Delete
return false;
[307] Fix | Delete
}
[308] Fix | Delete
[309] Fix | Delete
function iclToggleShowTranslations(){
[310] Fix | Delete
jQuery('a.icl_toggle_show_translations').toggle();
[311] Fix | Delete
jQuery('#icl_translations_table').toggle();
[312] Fix | Delete
jQuery.ajax({
[313] Fix | Delete
type: "POST",
[314] Fix | Delete
url: icl_ajx_url,
[315] Fix | Delete
data: "icl_ajx_action=toggle_show_translations&_icl_nonce=" + jQuery('#_icl_nonce_tst').val()
[316] Fix | Delete
});
[317] Fix | Delete
return false;
[318] Fix | Delete
}
[319] Fix | Delete
[320] Fix | Delete
function icl_copy_from_original(lang, trid){
[321] Fix | Delete
jQuery('#icl_cfo').after(icl_ajxloaderimg).attr('disabled', 'disabled');
[322] Fix | Delete
[323] Fix | Delete
//has visual = set to normal non-html editing mode
[324] Fix | Delete
var ed;
[325] Fix | Delete
var content_type = (typeof tinyMCE !== 'undefined' && ( ed = tinyMCE.get('content') ) && !ed.isHidden() && ed.hasVisual === true) ? 'rich' : 'html';
[326] Fix | Delete
var excerpt_type = (typeof tinyMCE !== 'undefined' && ( ed = tinyMCE.get('excerpt') ) && !ed.isHidden() && ed.hasVisual === true) ? 'rich' : 'html';
[327] Fix | Delete
[328] Fix | Delete
// figure out all available editors and their types
[329] Fix | Delete
jQuery.ajax({
[330] Fix | Delete
type: "POST",
[331] Fix | Delete
dataType: 'json',
[332] Fix | Delete
url: icl_ajx_url,
[333] Fix | Delete
data: "icl_ajx_action=copy_from_original&lang=" + lang + '&trid=' + trid + '&content_type=' + content_type + '&excerpt_type=' + excerpt_type + '&_icl_nonce=' + jQuery('#_icl_nonce_cfo_' + trid).val(),
[334] Fix | Delete
success: function (msg) {
[335] Fix | Delete
if (msg.error) {
[336] Fix | Delete
alert(msg.error);
[337] Fix | Delete
} else {
[338] Fix | Delete
try {
[339] Fix | Delete
if (msg.content) {
[340] Fix | Delete
if (typeof tinyMCE !== 'undefined' && (ed = tinyMCE.get('content')) && !ed.isHidden()) {
[341] Fix | Delete
ed.focus();
[342] Fix | Delete
if (tinymce.isIE) {
[343] Fix | Delete
ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);
[344] Fix | Delete
}
[345] Fix | Delete
ed.execCommand('mceInsertContent', false, msg.content);
[346] Fix | Delete
} else if (wpml_get_block_editor()) {
[347] Fix | Delete
wp.data.dispatch('core/editor').resetBlocks(wp.blocks.parse(msg.content));
[348] Fix | Delete
} else {
[349] Fix | Delete
wpActiveEditor = 'content';
[350] Fix | Delete
edInsertContent(edCanvas, msg.content);
[351] Fix | Delete
}
[352] Fix | Delete
[353] Fix | Delete
}
[354] Fix | Delete
if (typeof msg.title !== "undefined") {
[355] Fix | Delete
if (wpml_get_block_editor()) {
[356] Fix | Delete
wp.data.dispatch('core/editor').editPost({title: msg.title});
[357] Fix | Delete
} else {
[358] Fix | Delete
jQuery('#title-prompt-text').hide();
[359] Fix | Delete
jQuery('#title').val(msg.title);
[360] Fix | Delete
}
[361] Fix | Delete
}
[362] Fix | Delete
//handling of custom fields
[363] Fix | Delete
//these have to be of array type with the indexes editor_type editor_name and value
[364] Fix | Delete
//possible types are editor or text
[365] Fix | Delete
//in case of text te prompt to be removed might have to be provided
[366] Fix | Delete
for (var element in msg.builtin_custom_fields) {
[367] Fix | Delete
if (msg.builtin_custom_fields.hasOwnProperty(element) && msg.builtin_custom_fields[element].editor_type === 'editor') {
[368] Fix | Delete
if (typeof tinyMCE !== 'undefined' && ( ed = tinyMCE.get(msg.builtin_custom_fields[element].editor_name) ) && !ed.isHidden()) {
[369] Fix | Delete
ed.focus();
[370] Fix | Delete
if (tinymce.isIE) {
[371] Fix | Delete
ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);
[372] Fix | Delete
}
[373] Fix | Delete
ed.execCommand('mceInsertContent', false, msg.builtin_custom_fields[element].value);
[374] Fix | Delete
} else {
[375] Fix | Delete
wpActiveEditor = msg.builtin_custom_fields[element].editor_name;
[376] Fix | Delete
edInsertContent(edCanvas, msg.builtin_custom_fields[element].value);
[377] Fix | Delete
}
[378] Fix | Delete
} else {
[379] Fix | Delete
jQuery('#' + msg.builtin_custom_fields[element].editor_name).val(msg.builtin_custom_fields[element].value);
[380] Fix | Delete
}
[381] Fix | Delete
}
[382] Fix | Delete
[383] Fix | Delete
if (typeof msg.external_custom_fields !== "undefined") {
[384] Fix | Delete
wpml_copy_external_custom_fields_from_original(msg.external_custom_fields);
[385] Fix | Delete
}
[386] Fix | Delete
} catch (err) {
[387] Fix | Delete
}
[388] Fix | Delete
}
[389] Fix | Delete
jQuery('#icl_cfo').next().fadeOut();
[390] Fix | Delete
}
[391] Fix | Delete
});
[392] Fix | Delete
[393] Fix | Delete
return false;
[394] Fix | Delete
}
[395] Fix | Delete
[396] Fix | Delete
function wpml_get_block_editor() {
[397] Fix | Delete
return window._wpLoadBlockEditor || window._wpLoadGutenbergEditor;
[398] Fix | Delete
}
[399] Fix | Delete
[400] Fix | Delete
function wpml_copy_external_custom_fields_from_original(custom_fields) {
[401] Fix | Delete
var translation_already_contains_custom_fields = jQuery("#postcustomstuff #the-list tr input").length > 0;
[402] Fix | Delete
if (translation_already_contains_custom_fields) {
[403] Fix | Delete
return;
[404] Fix | Delete
}
[405] Fix | Delete
[406] Fix | Delete
var container = jQuery("#newmeta");
[407] Fix | Delete
var meta_key_field = container.find("#metakeyselect");
[408] Fix | Delete
var meta_value_field = container.find("#metavalue");
[409] Fix | Delete
var add_button = container.find("#newmeta-submit");
[410] Fix | Delete
[411] Fix | Delete
custom_fields.forEach(function(item) {
[412] Fix | Delete
meta_key_field.val(item.name);
[413] Fix | Delete
meta_value_field.val(item.value);
[414] Fix | Delete
add_button.click();
[415] Fix | Delete
});
[416] Fix | Delete
}
[417] Fix | Delete
[418] Fix | Delete
function icl_make_translatable(){
[419] Fix | Delete
var that = jQuery(this);
[420] Fix | Delete
jQuery(this).attr('disabled', 'disabled');
[421] Fix | Delete
jQuery('#icl_div_config').find('.icl_form_success').hide();
[422] Fix | Delete
var iclMakeTranslatable = jQuery('[name=icl_make_translatable]:checked');
[423] Fix | Delete
var translate_input = iclMakeTranslatable.val().split(',');
[424] Fix | Delete
var translate = parseInt(translate_input[1]);
[425] Fix | Delete
var custom_post = translate_input[0];
[426] Fix | Delete
var custom_taxs_on = [];
[427] Fix | Delete
var custom_taxs_off = [];
[428] Fix | Delete
jQuery(".icl_mcs_custom_taxs").each(function(){
[429] Fix | Delete
if(jQuery(this).attr('checked')){
[430] Fix | Delete
custom_taxs_on.push(jQuery(this).val());
[431] Fix | Delete
}else{
[432] Fix | Delete
custom_taxs_off.push(jQuery(this).val());
[433] Fix | Delete
}
[434] Fix | Delete
[435] Fix | Delete
});
[436] Fix | Delete
[437] Fix | Delete
var cfnames = [];
[438] Fix | Delete
var cfvals = [];
[439] Fix | Delete
jQuery('.icl_mcs_cfs:checked').each(function(){
[440] Fix | Delete
if(!jQuery(this).attr('disabled')){
[441] Fix | Delete
cfnames.push(jQuery(this).attr('name').replace(/^icl_mcs_cf_/,''));
[442] Fix | Delete
cfvals.push(jQuery(this).val());
[443] Fix | Delete
}
[444] Fix | Delete
});
[445] Fix | Delete
[446] Fix | Delete
jQuery.post(location.href,
[447] Fix | Delete
{
[448] Fix | Delete
'post_id' : jQuery('#post_ID').val(),
[449] Fix | Delete
'icl_action' : 'icl_mcs_inline',
[450] Fix | Delete
'custom_post' : custom_post,
[451] Fix | Delete
'translate' : translate,
[452] Fix | Delete
'custom_taxs_on[]' : custom_taxs_on,
[453] Fix | Delete
'custom_taxs_off[]' : custom_taxs_off,
[454] Fix | Delete
'cfnames[]' : cfnames,
[455] Fix | Delete
'cfvals[]' : cfvals,
[456] Fix | Delete
'_icl_nonce' : jQuery('#_icl_nonce_imi').val()
[457] Fix | Delete
[458] Fix | Delete
},
[459] Fix | Delete
function(data) {
[460] Fix | Delete
that.removeAttr('disabled');
[461] Fix | Delete
if(translate){
[462] Fix | Delete
var iclDiv = jQuery('#icl_div');
[463] Fix | Delete
if (iclDiv.length > 0) {
[464] Fix | Delete
iclDiv.remove();
[465] Fix | Delete
}
[466] Fix | Delete
var prependTo = jQuery('#side-sortables');
[467] Fix | Delete
prependTo = prependTo.html() ? prependTo : jQuery('#normal-sortables');
[468] Fix | Delete
prependTo.prepend(
[469] Fix | Delete
'<div id="icl_div" class="postbox">' + jQuery(data).find('#icl_div').html() + '</div>'
[470] Fix | Delete
);
[471] Fix | Delete
jQuery('#icl_mcs_details').html(jQuery(data).find('#icl_mcs_details').html());
[472] Fix | Delete
}else{
[473] Fix | Delete
jQuery('#icl_div').hide();
[474] Fix | Delete
jQuery('#icl_mcs_details').html('');
[475] Fix | Delete
}
[476] Fix | Delete
jQuery('#icl_div_config').find('.icl_form_success').fadeIn();
[477] Fix | Delete
[478] Fix | Delete
WPMLMetaBox.refresh.refreshMetaBox();
[479] Fix | Delete
}
[480] Fix | Delete
);
[481] Fix | Delete
[482] Fix | Delete
return false;
[483] Fix | Delete
}
[484] Fix | Delete
[485] Fix | Delete
function icl_hide_user_notice(){
[486] Fix | Delete
var notice = jQuery(this).attr('href').replace(/^#/, '');
[487] Fix | Delete
var thisa = jQuery(this);
[488] Fix | Delete
[489] Fix | Delete
jQuery.ajax({
[490] Fix | Delete
type: "POST",
[491] Fix | Delete
dataType: 'json',
[492] Fix | Delete
url: icl_ajx_url,
[493] Fix | Delete
data: "icl_ajx_action=save_user_preferences&user_preferences[notices]["+notice+"]=1&_icl_nonce="+jQuery('#_icl_nonce_sup').val(),
[494] Fix | Delete
success: function(msg){
[495] Fix | Delete
thisa.parent().parent().fadeOut();
[496] Fix | Delete
}
[497] Fix | Delete
});
[498] Fix | Delete
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function