jQuery(function () {
	jQuery('.tooltip').darkTooltip();
	
	jQuery('#elex_save_settings_tab_data').on('click', function () {

		var meta_keys = [];
		var google_cat_language = 'en';
		var google_wpml_language = '';

	
		google_cat_language = jQuery('#elex_google_cat_language_selector').val();
		google_wpml_language = jQuery('#elex_google_wpml_language_selector').val();
		jQuery(".elex-fpf-loader").css("display", "block");
		
		jQuery.ajax({
	        type: 'post',
	        url: ajaxurl,
	        data: {
	        	_ajax_elex_fpf_nonce: jQuery('#_ajax_elex_fpf_nonce').val(),
	            action: 'elex_fpf_save_settings_tab_field',
	            cat_language : google_cat_language,
	            wpml_language : google_wpml_language
	        },
	        success: function (response) {
	        	jQuery('<div style="color:green;">Settings saved!</div>').insertBefore('#elex_save_settings_tab_data').delay(1000).fadeOut();
	           jQuery(".elex-fpf-loader").css("display", "none");
	        },
	        error: function (jqXHR, textStatus, errorThrown) {
	            console.log(textStatus, errorThrown);
	        }
    	});
	});

});
function elex_fpf_view_logfile_fun(file) {
	// var redirect_url = jQuery('#elex_fpf_log_files').val();
    window.open(file, "_blank");
}
