jQuery(document).ready(function(){
	dap_member_tiny_editor();
});
function dap_save_settings_info(page_action = '',form_id = '',tab_name = ''){
	
	if(form_id == '' || page_action == ''){
		return '';
	}
	var form_data_array = jQueryDM('#'+form_id).serializeArray();
	
	if(page_action == 'login' && tab_name  == "common_tab"){
		 var data_value = tinymce.get('dap_admin_already_login').getContent();
		 form_data_array.push({name: 'dap_admin_already_login', value: data_value});
		 
		 var data_value = tinymce.get('already_login').getContent();
		 form_data_array.push({name: 'already_login', value: data_value});
		 
	}else if(page_action == 'loginFB' && tab_name  == "loginFB_tab"){
		
		 var data_value = tinymce.get('link_account_confirm_box_msg').getContent();
		 form_data_array.push({name: 'link_account_confirm_box_msg', value: data_value});
	}
	
	dap_member_show_loader();
	jQueryDM.post(ajaxurl, {
				action: 'dap_save_settings_info',
				form_data:  form_data_array,
				page_action:  page_action,
			}, function(response) {
				response = JSON.parse(response);
				if(response.success){
					
					$type = 'success';
					$title = '';
					$message = response.success;
					
				}else if(response.error){

					$type = 'error';
					$title = 'Oops';
					$message = response.error;
					
				}
				dap_member_sweet_alert_popup_with_msg_type($title,$message,$type);
				
				dap_member_hide_loader();
				
			});
}
