');
if (data.loggedin === true) {
;
if (parseInt(jQuery('#loginpop').val(), 10) === 2) {
location.reload();
} else if (parseInt(data.ispop, 10) === 3) {
ajaxcalls_vars.userid = data.newuser;
jQuery('#user_menu_u.user_not_loged').unbind('click');
jQuery('#user_menu_u').removeClass('user_not_loged').addClass('user_loged');
jQuery('#modal_login_wrapper').hide();
wp_estate_update_menu_bar_mobile(data.newuser);
//wpestate_open_menu();
} else {
document.location.href = ajaxcalls_vars.login_redirect;
}
} else {
jQuery('#login_user_mobile').val('');
jQuery('#login_pwd_mobile').val('');
}
},
error: function (errorThrown) {
}
});
}
//////////////////////////////////////////////////////////////////////////////////
// login function -jslint checked
////////////////////////////////////////////////////////////////////////////////
function wpestate_login() {
"use strict";
var login_user, login_pwd, security, ispop, ajaxurl;
login_user = jQuery('#login_user').val();
login_pwd = jQuery('#login_pwd').val();
security = jQuery('#security-login').val();
ispop = jQuery('#loginpop').val();
ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
jQuery('#login_message_area').empty().append('
' + ajaxcalls_vars.login_loading + '
');
var nonce = jQuery('#wpestate_ajax_log_reg').val();
jQuery.ajax({
type: 'POST',
dataType: 'json',
url: ajaxurl,
data: {
'action': 'wpestate_ajax_loginx_form',
'login_user': login_user,
'login_pwd': login_pwd,
'ispop': ispop,
'security': nonce
},
success: function (data) {
jQuery('#login_message_area').empty().append('
' + data.message + '
');
if (data.loggedin === true) {
if (parseInt(data.ispop, 10) === 1) {
ajaxcalls_vars.userid = data.newuser;
jQuery('#loginmodal').modal('hide');
wp_estate_update_menu_bar(data.newuser);
} else {
document.location.href = ajaxcalls_vars.login_redirect;
}
jQuery('#user_not_logged_in').hide();
jQuery('#user_logged_in').show();
} else {
jQuery('#login_user').val('');
jQuery('#login_pwd').val('');
}
},
error: function (errorThrown) {
}
});
}
////////////////////////////////////////////////////////////////////////////////
// update bar after login -jslint checked
////////////////////////////////////////////////////////////////////////////////
function wp_estate_update_menu_bar(newuser) {
"use strict";
var usericon, ajaxurl;
ajaxurl = control_vars.admin_url + 'admin-ajax.php';
var nonce = jQuery('#wpestate_ajax_filtering').val();
jQuery.ajax({
type: 'POST',
dataType: 'json',
url: ajaxurl,
data: {
'action': "wpestate_update_menu_bar",
'newuser': newuser,
'security': nonce
},
success: function (data) {
jQuery('#user_menu_u').after(data.menu);
usericon = '
';
jQuery('#user_menu_u').append(usericon).addClass('user_loged');
jQuery('.submit_action').remove();
jQuery('.submit_listing').remove();
jQuery('#agent_property_ajax_nonce').val(data.nonce_contact);
},
error: function (errorThrown) {
}
});//end ajax
}
function wp_estate_update_menu_bar_mobile(newuser) {
"use strict";
var usericon, ajaxurl;
ajaxurl = control_vars.admin_url + 'admin-ajax.php';
var nonce = jQuery('#wpestate_ajax_filtering').val();
jQuery.ajax({
type: 'POST',
dataType: 'json',
url: ajaxurl,
data: {
'action': "wpestate_update_menu_bar_mobile",
'newuser': newuser,
'security': nonce
},
success: function (data) {
jQuery('.login_sidebar').hide();
jQuery('.mobilemenu-close-user').after(data.menu);
jQuery('.submit_action').remove();
jQuery('.submit_listing').remove();
jQuery('#agent_property_ajax_nonce').val(data.nonce_contact);
// for mobile
jQuery('.mobilemenu-close-user').trigger('click');
var mobile_user_icon = ''
jQuery('.mobile-trigger-user').empty().append(mobile_user_icon);
jQuery('#login_message_area_mobile .login-alert').empty().hide();
},
error: function (errorThrown) {
}
});//end ajax
}
////////////////////////////////////////////////////////////////////////////////////////////
// on ready -jslint checked
// developer listing on tab click !!
////////////////////////////////////////////////////////////////////////////////////////////
jQuery(document).ready(function ($) {
"use strict";
wpestate_add_to_favorites();
wpestate_js_pagination_ajax();
wpestate_enable_not_logged_favorites();
$('.wpestate_social_login').on('click', function () {
var ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
var social_type = $(this).attr('data-social');
var nonce = $(this).parent().find('.wpestate_social_login_nonce').val();
$.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action': 'wpestate_social_login_generate_link',
'social_type': social_type,
'nonce': nonce
},
success: function (data) {
window.location.href = data;
},
error: function (errorThrown) {
}
});
});
$('.developer_listing .term_bar_item').on('click', function (event) {
// display load more
var listing_parent_pointer = $(this).parents('.single_listing_block');
$('.load_more_ajax_cont .listing_load_more', listing_parent_pointer).fadeIn();
$('.term_bar_item').removeClass('active_term');
$(this).addClass('active_term');
var ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
var term_name = $(this).attr('data-term_name');
var agency_id = $('.term_bar_wrapper').attr('data-agency_id');
var post_id = $('.term_bar_wrapper').attr('data-post_id');
var is_agency = 0;
var nonce = jQuery('#wpestate_developer_listing_nonce').val();
if ($('.single-estate_agency').length > 0) {
is_agency = 1;
}
$('.agency_listings_wrapper').empty();
$('#listing_loader').show();
$.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action': 'wpestate_agency_listings',
'term_name': term_name,
'agency_id': agency_id,
'post_id': post_id,
'is_agency': is_agency,
'security': nonce
},
success: function (data) {
$('#listing_loader').hide();
$('.agency_listings_wrapper').append(data);
wpestate_restart_js_after_ajax();
},
error: function (errorThrown) {
}
});
});
////////////////////////////////////////////////////////////////////////////////////////////
// agent page listing tabs processing
////////////////////////////////////////////////////////////////////////////////////////////
$('.agent_listing .term_bar_item').on('click', function (event) {
// display load more
var listing_parent_pointer = $(this).parents('.single_listing_block');
$('.load_more_ajax_cont .listing_load_more', listing_parent_pointer).fadeIn();
$('.term_bar_item').removeClass('active_term');
$(this).addClass('active_term');
var ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
var term_name = $(this).attr('data-term_name');
var agent_id = $('.term_bar_wrapper').attr('data-agent_id');
var post_id = $('.term_bar_wrapper').attr('data-post_id');
var nonce = jQuery('#wpestate_agent_listings_nonce').val();
$('.agency_listings_wrapper').empty();
$('#listing_loader', listing_parent_pointer).show();
$.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action': 'wpestate_agent_listings',
'term_name': term_name,
'agent_id': agent_id,
'post_id': post_id,
'security': nonce,
},
success: function (data) {
$('#listing_loader', listing_parent_pointer).hide();
$('.agency_listings_wrapper').append(data);
wpestate_restart_js_after_ajax();
},
error: function (errorThrown) {
}
});
});
////////////////////////////////////////////////////////////////////////////////////////////
// agent / developer load more processing
////////////////////////////////////////////////////////////////////////////////////////////
$('body').on('click', '.listing_load_more', function (event) {
var this_point = $(this);
var listing_parent_pointer = $(this).parents('.single_listing_block');
var loaded_items = $('.agency_listings_wrapper .listing_wrapper', listing_parent_pointer).length;
var active_tab = $('.active_term', listing_parent_pointer);
var ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
var term_name = $(active_tab).attr('data-term_name');
var agent_id = $('.term_bar_wrapper', listing_parent_pointer).attr('data-agent_id');
var post_id = $('.term_bar_wrapper', listing_parent_pointer).attr('data-post_id');
var agency_id = $('.term_bar_wrapper', listing_parent_pointer).attr('data-agency_id');
var is_agency = 0;
if ($('.single-estate_agency').length > 0) {
is_agency = 1;
}
$('#listing_loader', listing_parent_pointer).fadeIn();
if (agent_id) {
var action_name = 'wpestate_agent_listings';
var nonce = jQuery('#wpestate_agent_listings_nonce').val();
}
if (agency_id) {
var action_name = 'wpestate_agency_listings';
var nonce = jQuery('#wpestate_developer_listing_nonce').val();
}
$.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action': action_name,
'term_name': term_name,
'agent_id': agent_id,
'agency_id': agency_id,
'post_id': post_id,
'loaded': loaded_items,
'is_agency': is_agency,
'security': nonce
},
success: function (data) {
$('#listing_loader', listing_parent_pointer).fadeOut();
var count = (data.match(/is/g) || []).length;
if (count === 0) {
this_point.fadeOut();
} else {
$('.agency_listings_wrapper').append(data);
}
wpestate_restart_js_after_ajax();
},
error: function (errorThrown) {
}
});
});
///////////////////////////////////////////////////////////////////////////////////////////
//// stripe cancel
///////////////////////////////////////////////////////////////////////////////////////////
$('#stripe_cancel').on('click', function (event) {
var stripe_user_id, ajaxurl;
stripe_user_id = $(this).attr('data-stripeid');
ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
$('#stripe_cancel').text(ajaxcalls_vars.saving);
var nonce = jQuery('#wpestate_stripe_cancel_nonce').val();
$.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action': 'wpestate_cancel_stripe',
'stripe_customer_id': stripe_user_id,
'security': nonce,
},
success: function (data) {
$('#stripe_cancel').text(ajaxcalls_vars.stripecancel);
},
error: function (errorThrown) {
}
});
});
////////////////////////////////////////////////////////////////////////////////////////////
/// resend for approval
///////////////////////////////////////////////////////////////////////////////////////////
$('.resend_pending').on('click', function (event) {
var prop_id = $(this).attr('data-listingid');
wpestate_resend_for_approval(prop_id, $(this));
});
jQuery('#wpestate_stripe_booking_recurring').on('click', function () {
var modalid = jQuery(this).attr('data-modalid');
var modal = jQuery('#' + modalid);
modal.appendTo('body');
modal.show();
jQuery('#' + modalid + ' .wpestate_stripe_form_1').show();
wpestate_start_stripe(1, modalid);
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// pack upgrade via paypal
///////////////////////////////////////////////////////////////////////////////////////////
$('#pick_pack').on('click', function (event) {
var pay_paypal;
pay_paypal = '
' + ajaxcalls_vars.paypal + '
';
jQuery('body').append(pay_paypal);
jQuery('#paypal_modal').modal();
if ($('#pack_recuring').is(':checked')) {
wpestate_recuring_pay_pack_via_paypal();
} else {
wpestate_pay_pack_via_paypal();
}
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// listing pay via paypal
///////////////////////////////////////////////////////////////////////////////////////////
$('.listing_submit_normal').on('click', function (event) {
var prop_id, featured_checker, is_featured, is_upgrade, pay_paypal;
pay_paypal = '
' + ajaxcalls_vars.paypal + '
';
jQuery('body').append(pay_paypal);
jQuery('#paypal_modal').modal();
prop_id = $(this).attr('data-listingid');
featured_checker = $(this).parent().find('input');
is_featured = 0;
is_upgrade = 0;
if (featured_checker.prop('checked')) {
is_featured = 1;
} else {
is_featured = 0;
}
wpestate_listing_pay(prop_id, $(this), is_featured, is_upgrade);
});
jQuery('.woo_pay_submit').on('click', function () {
var pay_paypal, prop_id, book_id, invoice_id, is_featured, is_upgrade, ajaxurl, depozit, is_submit, pack_id;
prop_id = jQuery(this).attr('data-propid');
depozit = jQuery(this).attr('data-deposit');
is_featured = jQuery(this).attr('data-is_featured');
pack_id = jQuery('.package_selected').attr('data-id');
is_upgrade = 0;
is_submit = 1;
if (jQuery('#open_packages').length > 0) {
is_submit = 0;
}
book_id = '';
invoice_id = '';
ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action': 'wpestate_woo_pay',
'propid': prop_id,
'depozit': depozit,
'is_submit': is_submit,
'is_featured': is_featured,
'pack_id': pack_id,
'book_id': book_id,
'invoiceid': invoice_id,
// 'price_pack' : price_pack,
// 'security' : nonce,
},
success: function (data) {
if (data !== false) {
window.location.href = ajaxcalls_vars.checkout_url;
}
},
error: function (errorThrown) {}
});//end ajax
});
$('.listing_upgrade').on('click', function (event) {
var is_upgrade, is_featured, prop_id;
is_upgrade = 1;
is_featured = 0;
prop_id = $(this).attr('data-listingid');
wpestate_listing_pay(prop_id, $(this), is_featured, is_upgrade);
});
///////////////////////////////////////////////////////////////////////////////////////////
/////// Property page + ajax call on contact
///////////////////////////////////////////////////////////////////////////////////////////
wpestate_agent_submit_email();
wpestate_theme_slider_show_contact();
wpestate_enable_schedule_contact();
///////////////////////////////////////////////////////////////////////////////////////////
//////// property listing listing
////////////////////////////////////////////////////////////////////////////////////////////
$('.listing_filters_head li').on('click', function (event) {
var pick, value, parent;
pick = $(this).text();
value = $(this).attr('data-value');
parent = $(this).parent().parent();
parent.find('.filter_menu_trigger').text(pick).append('
').attr('data-value', value);
parent.find('input:hidden').val(value);
wpestate_start_filtering(1);
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// advanced search filtering
////////////////////////////////////////////////////////////////////////////////////////////
$('.adv_listing_filters_head li').on('click', function (event) {
var pick, value, parent, args, page_id, ajaxurl;
ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
pick = $(this).text();
value = $(this).attr('data-value');
parent = $(this).parent().parent();
parent.find('.filter_menu_trigger').text(pick).append('
').attr('data-value', value);
args = $('#searcharg').val();
page_id = $('#page_idx').val();
$('#listing_ajax_container').empty();
$('#listing_loader').show();
var nonce = jQuery('#wpestate_search_nonce').val();
$.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action': 'wpestate_advanced_search_filters',
'args': args,
'value': value,
'page_id': page_id,
'security': nonce
},
success: function (data) {
$('#listing_loader').hide();
$('#listing_ajax_container').append(data);
wpestate_restart_js_after_ajax();
wpestate_add_pagination_orderby();
},
error: function (errorThrown) {
}
}); //end ajax
});
function wpestate_add_pagination_orderby() {
var order = $('#a_filter_order').attr('data-value');
jQuery('.pagination a').each(function () {
var href = $(this).attr('href');
href = href + "&order_search=" + order;
$(this).attr('href', href);
});
}
///////////////////////////////////////////////////////////////////////////////////////////
//////// Ajax add to favorites on listing
////////////////////////////////////////////////////////////////////////////////////////////
$('.icon-fav,.remove_fav_dash').on('click', function (event) {
event.stopPropagation();
var icon = $(this);
wpestate_add_remove_favorite(icon);
});
// remove from fav listing on user profile
$('.icon-fav-on-remove').on('click', function (event) {
event.stopPropagation();
$(this).parent().parent().remove();
});
////////////////////////////////////////////////////////////////////////////////
// register calls and functions
////////////////////////////////////////////////////////////////////////////////
$('#wp-submit-register').on('click', function (event) {
wpestate_register_user(3);
});
jQuery('#user_email_register, #user_login_register, #user_password, #user_password_retype').keydown(function (e) {
if (e.keyCode === 13) {
e.preventDefault();
wpestate_register_user(3);
}
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// WIDGET Register ajax
////////////////////////////////////////////////////////////////////////////////////////////
$('#wp-submit-register_wd').on('click', function () {
wpestate_register_user(2);
});
$('#user_email_register_wd, #user_login_register_wd').keydown(function (e) {
if (e.keyCode === 13) {
e.preventDefault();
wpestate_register_user(2);
}
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// TOPBAR Register ajax
////////////////////////////////////////////////////////////////////////////////////////////
$('#wp-submit-register_topbar').on('click', function () {
wpestate_register_user(1);
});
$('#user_email_register_topbar, #user_login_register_topbar, #user_password_topbar, #user_password_topbar_retype').keydown(function (e) {
if (e.keyCode === 13) {
e.preventDefault();
wpestate_register_user(1);
}
});
$('#wp-submit-register_mobile').on('click', function () {
wpestate_register_user(5);
});
$('#user_email_register_mobile, #user_login_register_mobile, #user_password_mobile, #user_password_mobile_retype').keydown(function (e) {
if (e.keyCode === 13) {
e.preventDefault();
wpestate_register_user(5);
}
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// login/forgot password actions
////////////////////////////////////////////////////////////////////////////////////////////
$('#forgot_pass').on('click', function (event) {
event.preventDefault();
$("#login-div").hide();
$("#forgot-pass-div-sh").show();
});
$('#return_login').on('click', function (event) {
event.preventDefault();
$("#forgot-pass-div-sh").hide();
$("#login-div").show();
});
$('#forgot_pass_topbar').on('click', function (event) {
event.preventDefault();
$("#login-div_topbar,#login-div-title-topbar,#register-div-topbar,#login-div_topbar,#register-div-title-topbar").hide();
$("#forgot-div-title-topbar,#forgot-pass-div").show().find('[autofocus]').focus();
$('#forgot_pass_topbar').hide();
});
$('#forgot_pass_mobile').on('click', function (event) {
event.preventDefault();
$("#login-div_mobile,#login-div-title-mobile").hide();
$("#forgot-div-title-mobile,#forgot-pass-div-mobile").show().find('[autofocus]').focus();
});
$('#return_login_topbar').on('click', function (event) {
event.preventDefault();
$("#forgot-div-title-topbar,#forgot-pass-div").hide();
$("#login-div_topbar,#login-div-title-topbar").show().find('[autofocus]').focus();
});
$('#return_login_mobile').on('click', function (event) {
event.preventDefault();
$("#forgot-div-title-mobile,#forgot-pass-div-mobile").hide();
$("#login-div_mobile,#login-div-title-mobile").show().find('[autofocus]').focus();
});
$('#forgot_pass_widget').on('click', function (event) {
event.preventDefault();
$("#login-div-title,#login-div").hide();
$("#forgot-pass-div_shortcode,#forgot-div-title_shortcode").show().find('[autofocus]').focus();
});
$('#return_login_shortcode').on('click', function (event) {
event.preventDefault();
$("#forgot-pass-div_shortcode,#forgot-div-title_shortcode").hide();
$("#login-div-title,#login-div").show().find('[autofocus]').focus();
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// forgot pass
////////////////////////////////////////////////////////////////////////////////////////////
$('#wp-forgot-but').on('click', function () {
wpestate_forgot(1);
});
$('#wp-forgot-but-topbar').on('click', function () {
wpestate_forgot(2);
});
$('#wp-forgot-but-mobile').on('click', function () {
wpestate_forgot(5);
});
$('#wp-forgot-but_shortcode').on('click', function () {
wpestate_forgot(3);
});
$('#forgot_email').keydown(function (e) {
if (e.keyCode === 13) {
e.preventDefault();
wpestate_forgot(1);
}
});
$('#forgot_email_topbar').keydown(function (e) {
if (e.keyCode === 13) {
e.preventDefault();
wpestate_forgot(2);
}
});
$('#forgot_email_topbar').keydown(function (e) {
if (e.keyCode === 13) {
e.preventDefault();
wpestate_forgot(3);
}
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// TOPBAR login/forgot password actions
////////////////////////////////////////////////////////////////////////////////////////////
$('#widget_register_topbar').on('click', function (event) {
event.preventDefault();
$('#login-div_topbar,#widget_register_topbar,#login-div-title-topbar,#forgot-div-title-topbar,#forgot-pass-div').hide();
$('#register-div-topbar,#register-div-title-topbar,#widget_login_topbar,#forgot_pass_topbar').show().find('[autofocus]').focus();
});
$('#widget_login_topbar').on('click', function (event) {
event.preventDefault();
$('#login-div_topbar,#widget_register_topbar,#login-div-title-topbar,#forgot_pass_topbar').show().find('[autofocus]').focus();
$('#register-div-topbar,#register-div-title-topbar,#widget_login_topbar,#forgot-div-title-topbar,#forgot-pass-div').hide();
});
$('#widget_register_mobile').on('click', function (event) {
event.preventDefault();
$('#login-div_mobile').hide();
$('#register-div-mobile').show().find('[autofocus]').focus();
$('#login-div-title-mobile').hide();
$('#register-div-title-mobile').show();
});
$('#widget_login_mobile').on('click', function (event) {
event.preventDefault();
$('#login-div_mobile').show().find('[autofocus]').focus();
$('#register-div-mobile').hide();
$('#login-div-title-mobile').show();
$('#register-div-title-mobile').hide();
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// WIDGET login/forgot password actions
////////////////////////////////////////////////////////////////////////////////////////////
$('#widget_register_sw').on('click', function (event) {
event.preventDefault();
$('.loginwd_sidebar #login-div').hide();
$('.loginwd_sidebar #register-div').show().find('[autofocus]').focus();
$('.loginwd_sidebar #login-div-title').hide();
$('.loginwd_sidebar #register-div-title').show();
});
$('#widget_login_sw').on('click', function (event) {
event.preventDefault();
$('.loginwd_sidebar #register-div').hide();
$('.loginwd_sidebar #login-div').show().find('[autofocus]').focus();
$('.loginwd_sidebar #register-div-title').hide();
$('.loginwd_sidebar #login-div-title').show();
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// login ajax
////////////////////////////////////////////////////////////////////////////////////////////
$('#wp-login-but').on('click', function () {
wpestate_login();
});
$('#login_pwd, #login_user').keydown(function (e) {
if (e.keyCode === 13) {
e.preventDefault();
wpestate_login();
}
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// WIDGET login ajax
////////////////////////////////////////////////////////////////////////////////////////////
$('#wp-login-but-wd').on('click', function () {
wpestate_login_wd();
});
$('#login_pwd_wd, #login_user_wd').keydown(function (e) {
if (e.keyCode === 13) {
e.preventDefault();
wpestate_login_wd();
}
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// TOPBAR login ajax
////////////////////////////////////////////////////////////////////////////////////////////
jQuery('.show_hide_password').on('click', function(){
var pass_field = jQuery(this).parent().find(':input');
if (pass_field.attr('type') === "password") {
pass_field.attr('type','text');
jQuery(this).removeClass('fa-eye-slash').addClass('fa-eye');
} else {
pass_field.attr('type','password');
jQuery(this).removeClass('fa-eye').addClass('fa-eye-slash');
}
});
$('#wp-login-but-topbar').on('click', function () {
wpestate_login_topbar();
});
$('#login_pwd_topbar, #login_user_topbar').keydown(function (e) {
if (e.keyCode === 13) {
e.preventDefault();
wpestate_login_topbar();
}
});
$('#wp-login-but-mobile').on('click', function () {
wpestate_login_mobile();
});
$('#login_pwd_mobile, #login_user_mobile').keydown(function (e) {
if (e.keyCode === 13) {
e.preventDefault();
wpestate_login_mobile();
}
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// Ajax update password
////////////////////////////////////////////////////////////////////////////////////////////
$('#oldpass, #newpass, #renewpass').keydown(function (e) {
if (e.keyCode === 13) {
e.preventDefault();
wpestate_change_pass_profile();
}
});
$('#change_pass').on('click', function (event) {
wpestate_change_pass_profile();
});
///////////////////////////////////////////////////////////////////////////////////////////
//////// update profile
////////////////////////////////////////////////////////////////////////////////////////////
$('#register_agent').on('click', function (event) {
var firstname = $('#firstname').val();
var secondname = $('#secondname').val();
var useremail = $('#useremail').val();
var userphone = $('#userphone').val();
var usermobile = $('#usermobile').val();
var userskype = $('#userskype').val();
var usertitle = $('#usertitle').val();
var description = $('#about_me').val();
var userfacebook = $('#userfacebook').val();
var usertwitter = $('#usertwitter').val();
var userlinkedin = $('#userlinkedin').val();
var userpinterest = $('#userpinterest').val();
var userinstagram = $('#userinstagram').val();
var userurl = $('#website').val();
var agent_username = $('#agent_username').val();
var agent_password = $('#agent_password').val();
var agent_repassword = $('#agent_repassword').val();
var agent_category_submit = $('#agent_category_submit').val();
var agent_action_submit = $('#agent_action_submit').val();
var agent_city = $('#agent_city').val();
var agent_county = $('#agent_county').val();
var agent_member = $('#agent_member').val();
var agent_area = $('#agent_area').val();
var is_agent_edit = $('#is_agent_edit').val();
var user_id = $('#user_id').val();
var agent_id = $('#agent_id').val();
var ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
var securityprofile = $('#security-profile').val();
var upload_picture = $('#upload_picture').val();
var profile_image_url = $('#profile-image').attr('data-profileurl');
var profile_image_url_small = $('#profile-image').attr('data-smallprofileurl');
// customparameters
var agent_custom_label = [];
$('.single_parameter_row .agent_custom_label').each(function () {
agent_custom_label.push($(this).val());
});
var agent_custom_value = [];
$('.single_parameter_row .agent_custom_value').each(function () {
agent_custom_value.push($(this).val());
});
var nonce = jQuery('#wpestate_register_agent_nonce').val();
window.scrollTo(0, 0);
$('#profile_message').empty().append('
' + ajaxcalls_vars.saving + '
');
$.ajax({
type: 'POST',
url: ajaxurl,
dataType: 'json',
data: {
'action': 'wpestate_ajax_register_agent',
'agent_username': agent_username,
'agent_password': agent_password,
'agent_repassword': agent_repassword,
'firstname': firstname,
'secondname': secondname,
'useremail': useremail,
'userphone': userphone,
'usermobile': usermobile,
'userskype': userskype,
'usertitle': usertitle,
'description': description,
'upload_picture': upload_picture,
'security-profile': securityprofile,
'profile_image_url': profile_image_url,
'profile_image_url_small': profile_image_url_small,
'userfacebook': userfacebook,
'usertwitter': usertwitter,
'userlinkedin': userlinkedin,
'userpinterest': userpinterest,
'userinstagram': userinstagram,
'userurl': userurl,
'agent_category_submit': agent_category_submit,
'agent_action_submit': agent_action_submit,
'agent_city': agent_city,
'agent_county': agent_county,
'agent_area': agent_area,
'agentedit': is_agent_edit,
'userid': user_id,
'agentid': agent_id,
'agent_member': agent_member,
'agent_custom_label': agent_custom_label,
'agent_custom_value': agent_custom_value,
'security': nonce
},
success: function (data) {
$('#profile_message').empty().append('
' + data.mesaj + '
');
if (data.added) {
setTimeout(function () {
window.open(ajaxcalls_vars.agent_list, '_self', false);
}, 1500);
}
},
error: function (errorThrown) {
}
});
});
$('#update_profile').on('click', function (event) {
var firstname, secondname, userurl, usermobile, userinstagram, userpinterest, userlinkedin, usertwitter, userfacebook, profile_image_url, profile_image_url_small, firstname, secondname, useremail, userphone, userskype, usertitle, description, ajaxurl, securityprofile, upload_picture;
firstname = $('#firstname').val();
secondname = $('#secondname').val();
useremail = $('#useremail').val();
userphone = $('#userphone').val();
usermobile = $('#usermobile').val();
userskype = $('#userskype').val();
usertitle = $('#usertitle').val();
description = $('#about_me').val();
userfacebook = $('#userfacebook').val();
usertwitter = $('#usertwitter').val();
userlinkedin = $('#userlinkedin').val();
userpinterest = $('#userpinterest').val();
userinstagram = $('#userinstagram').val();
userurl = $('#website').val();
var hubspot_api = $('#hubspot_api').val();
var agent_member = $('#agent_member').val();
var agent_category_submit = $('#agent_category_submit').val();
var agent_action_submit = $('#agent_action_submit').val();
var agent_city = $('#agent_city').val();
var agent_county = $('#agent_county').val();
var agent_area = $('#agent_area').val();
var nonce = jQuery('#wpestate_update_profile_nonce').val();
ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
securityprofile = $('#security-profile').val();
upload_picture = $('#upload_picture').val();
profile_image_url = $('#profile-image').attr('data-profileurl');
profile_image_url_small = $('#profile-image').attr('data-smallprofileurl');
// customparameters
var agent_custom_label = [];
$('.single_parameter_row .agent_custom_label').each(function () {
agent_custom_label.push($(this).val());
});
var agent_custom_value = [];
$('.single_parameter_row .agent_custom_value').each(function () {
agent_custom_value.push($(this).val());
});
window.scrollTo(0, 0);
$('#profile_message').append('
' + ajaxcalls_vars.saving + '
');
$.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action': 'wpestate_ajax_update_profile',
'firstname': firstname,
'secondname': secondname,
'useremail': useremail,
'userphone': userphone,
'usermobile': usermobile,
'userskype': userskype,
'usertitle': usertitle,
'description': description,
'upload_picture': upload_picture,
'security-profile': securityprofile,
'profile_image_url': profile_image_url,
'profile_image_url_small': profile_image_url_small,
'userfacebook': userfacebook,
'usertwitter': usertwitter,
'userlinkedin': userlinkedin,
'userpinterest': userpinterest,
'userinstagram': userinstagram,
'userurl': userurl,
'agent_category_submit': agent_category_submit,
'agent_action_submit': agent_action_submit,
'agent_city': agent_city,
'agent_county': agent_county,
'agent_area': agent_area,
'agent_member': agent_member,
'agent_custom_label': agent_custom_label,
'agent_custom_value': agent_custom_value,
'hubspot_api': hubspot_api,
'security': nonce,
},
success: function (data) {
$('#profile_message').empty().append('
' + data + '
');
window.scrollTo(0, 0);
},
error: function (errorThrown) {
}
});
});
$('#update_profile_agency').on('click', function () {
var hubspot_api, agency_opening_hours, agency_license, agency_long, agency_lat, agency_address, agency_area, agency_county, agency_city, agency_action_submit, agency_action_submit, agency_category_submit, agency_taxes, agency_website, agency_languages, agency_name, userurl, usermobile, userinstagram, userpinterest, userlinkedin, usertwitter, userfacebook, profile_image_url, profile_image_url_small, firstname, secondname, useremail, userphone, userskype, usertitle, description, ajaxurl, securityprofile, upload_picture;
agency_name = $('#agency_title').val();
useremail = $('#useremail').val();
userphone = $('#userphone').val();
usermobile = $('#usermobile').val();
userskype = $('#userskype').val();
description = $('#about_me').val();
userfacebook = $('#userfacebook').val();
usertwitter = $('#usertwitter').val();
userlinkedin = $('#userlinkedin').val();
userpinterest = $('#userpinterest').val();
userinstagram = $('#userinstagram').val();
agency_languages = $('#agency_languages').val();
agency_website = $('#agency_website').val();
agency_taxes = $('#agency_taxes').val();
agency_license = $('#agency_license').val();
agency_category_submit = $('#agency_category_submit').val();
agency_action_submit = $('#agency_action_submit').val();
agency_city = $('#agency_city').val();
agency_county = $('#agency_county').val();
agency_area = $('#agency_area').val();
agency_address = $('#agency_address').val();
agency_lat = $('#agency_lat').val();
agency_long = $('#agency_long').val();
agency_opening_hours = $('#agency_opening_hours ').val();
hubspot_api = $('#hubspot_api ').val();
securityprofile = $('#security-profile').val();
upload_picture = $('#upload_picture').val();
profile_image_url = $('#profile-image').attr('data-profileurl');
profile_image_url_small = $('#profile-image').attr('data-smallprofileurl');
ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
var nonce = jQuery('#wpestate_update_profile_nonce').val();
window.scrollTo(0, 0);
$.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action': 'wpestate_ajax_update_profile_agency',
'agency_name': agency_name,
'useremail': useremail,
'userphone': userphone,
'usermobile': usermobile,
'userskype': userskype,
'usertitle': usertitle,
'description': description,
'upload_picture': upload_picture,
'security-profile': securityprofile,
'profile_image_url': profile_image_url,
'profile_image_url_small': profile_image_url_small,
'userfacebook': userfacebook,
'usertwitter': usertwitter,
'userlinkedin': userlinkedin,
'userpinterest': userpinterest,
'userinstagram': userinstagram,
'userurl': userurl,
'agency_languages': agency_languages,
'agency_website': agency_website,
'agency_taxes': agency_taxes,
'agency_license': agency_license,
'agency_category_submit': agency_category_submit,
'agency_action_submit': agency_action_submit,
'agency_city': agency_city,
'agency_county': agency_county,
'agency_area': agency_area,
'agency_address': agency_address,
'agency_lat': agency_lat,
'agency_opening_hours': agency_opening_hours,
'agency_long': agency_long,
'hubspot_api': hubspot_api,
'security': nonce
},
success: function (data) {
$('#profile_message').append('
' + data + '
');
window.scrollTo(0, 0);
},
error: function (errorThrown) {
}
});
});
// update developer profile
$('#update_profile_developer').on('click', function () {
var hubspot_api, developer_license, developer_long, developer_lat, developer_address, developer_area, developer_county, developer_city, developer_action_submit, developer_action_submit, developer_category_submit, developer_taxes, developer_website, developer_languages, developer_name, userurl, usermobile, userinstagram, userpinterest, userlinkedin, usertwitter, userfacebook, profile_image_url, profile_image_url_small, firstname, secondname, useremail, userphone, userskype, usertitle, description, ajaxurl, securityprofile, upload_picture;
developer_name = $('#developer_title').val();
useremail = $('#useremail').val();
userphone = $('#userphone').val();
usermobile = $('#usermobile').val();
userskype = $('#userskype').val();
description = $('#about_me').val();
userfacebook = $('#userfacebook').val();
usertwitter = $('#usertwitter').val();
userlinkedin = $('#userlinkedin').val();
userpinterest = $('#userpinterest').val();
userinstagram = $('#userinstagram').val();
developer_languages = $('#developer_languages').val();
developer_website = $('#developer_website').val();
developer_taxes = $('#developer_taxes').val();
developer_license = $('#developer_license').val();
developer_category_submit = $('#developer_category_submit').val();
developer_action_submit = $('#developer_action_submit').val();
developer_city = $('#developer_city').val();
developer_county = $('#developer_county').val();
developer_area = $('#developer_area').val();
developer_address = $('#developer_address').val();
developer_lat = $('#developer_lat').val();
developer_long = $('#developer_long').val();
securityprofile = $('#security-profile').val();
upload_picture = $('#upload_picture').val();
profile_image_url = $('#profile-image').attr('data-profileurl');
profile_image_url_small = $('#profile-image').attr('data-smallprofileurl');
hubspot_api = $('#hubspot_api').val();
ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
var nonce = jQuery('#wpestate_update_profile_nonce').val();
window.scrollTo(0, 0);
$.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action': 'wpestate_ajax_update_profile_developer',
'developer_name': developer_name,
'useremail': useremail,
'userphone': userphone,
'usermobile': usermobile,
'userskype': userskype,
'usertitle': usertitle,
'description': description,
'upload_picture': upload_picture,
'security-profile': securityprofile,
'profile_image_url': profile_image_url,
'profile_image_url_small': profile_image_url_small,
'userfacebook': userfacebook,
'usertwitter': usertwitter,
'userlinkedin': userlinkedin,
'userpinterest': userpinterest,
'userinstagram': userinstagram,
'userurl': userurl,
'developer_languages': developer_languages,
'developer_website': developer_website,
'developer_taxes': developer_taxes,
'developer_license': developer_license,
'developer_category_submit': developer_category_submit,
'developer_action_submit': developer_action_submit,
'developer_city': developer_city,
'developer_county': developer_county,
'developer_area': developer_area,
'developer_address': developer_address,
'developer_lat': developer_lat,
'developer_long': developer_long,
'hubspot_api': hubspot_api,
'security': nonce
},
success: function (data) {
$('#profile_message').append('
' + data + '
');
window.scrollTo(0, 0);
},
error: function (errorThrown) {
}
});
});
//delete profile
$('#delete_profile').on('click', function (event) {
var ajaxurl;
ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
var nonce = jQuery('#wpestate_update_profile_nonce').val();
var result = confirm(ajaxcalls_vars.delete_account);
if (result) {
//Logic to delete the item
$.ajax({
type: 'POST',
url: ajaxurl,
data: {
'action': 'wpestate_delete_profile',
'security': nonce,
},
success: function (data) {
window.location = '/';
},
error: function (errorThrown) {
}
});
}
});
//end delete profile
}); // end ready jquery
//End ready ********************************************************************
function wpestate_add_to_favorites() {
jQuery('#add_favorites').on('click', function (event) {
var post_id, ajaxurl;
post_id = jQuery('#add_favorites').attr('data-postid');
var icon = jQuery('#add_favorites');
ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
var nonce = jQuery('#wpestate_ajax_filtering').val();
var use_favorite_login = ajaxcalls_vars.favorites_login;
if(use_favorite_login=="no"){
wpestate_add_remove_favorite_local_storage_single(icon,post_id);
return;
}
if (parseInt(ajaxcalls_vars.userid, 10) === 0) {
if (!Modernizr.mq('only all and (max-width: 768px)')) {
jQuery('#modal_login_wrapper').show();
jQuery('#modal_login_wrapper').find('[autofocus]').focus();
jQuery('#loginpop').val('1');
} else {
jQuery('.mobile-trigger-user').trigger('click');
}
} else {
jQuery('#add_favorites').text(ajaxcalls_vars.saving);
jQuery.ajax({
type: 'POST',
url: ajaxurl,
dataType: 'json',
data: {
'action': 'wpestate_ajax_add_fav',
'post_id': post_id,
'security': nonce
},
success: function (data) {
if (data.added) {
jQuery('#add_favorites').removeClass('isnotfavorite').addClass('isfavorite').attr('data-original-title', ajaxcalls_vars.remove_favorite);
jQuery('#add_favorites').html('
' + ajaxcalls_vars.favorite);
} else {
jQuery('#add_favorites').removeClass('isfavorite').addClass('isnotfavorite').attr('data-original-title', ajaxcalls_vars.add_favorite);
jQuery('#add_favorites').html('
' + ajaxcalls_vars.favorite);
}
},
error: function (errorThrown) {
}
}); //end ajax
}// end check login
});
}
///////////////////////////////////////////////////////////////////////////////////////////
/////// Property page + ajax call on contact
///////////////////////////////////////////////////////////////////////////////////////////
function wpestate_theme_slider_show_contact() {
jQuery('.wpestate_theme_slider_contact_agent').on('click', function () {
var acesta = jQuery(this).parent().parent();
acesta.find('#show_contact').text(ajaxcalls_vars.contact_agent);
acesta.find('.theme_slider_contact_form_wrapper').show('0').toggleClass('theme_slider_contact_form_wrapper_visible');
jQuery('#estate-carousel').carousel('pause');
});
jQuery('.theme_slider_details_modal_close').on('click', function () {
jQuery(this).parent().removeClass('theme_slider_contact_form_wrapper_visible');
jQuery('#estate-carousel').carousel('cycle');
});
jQuery('.theme_slider_contact_form_wrapper').on('click', function (event) {
event.stopPropagation();
});
}
function wpestate_enable_schedule_contact() {
jQuery('.schedule_meeting').on('click', function (event) {
var parent = jQuery(this).parent(); var schedule_wrapper= parent.find('.schedule_wrapper');
parent.find('.schedule_wrapper').slideToggle(400,function(){
if(schedule_wrapper.is(":visible")){
schedule_wrapper.css('display', 'flex');
}else{
schedule_wrapper.css('display','none');
}
});
});
jQuery(".schedule_day,#schedule_day").datepicker({
dateFormat: "yy-mm-dd",
}).datepicker('widget').wrap('
');
}
function wpestate_agent_submit_email() {
jQuery('.wpresidence_elementor_form').on('submit', function (event) {
event.preventDefault();
var form_submit = jQuery('.wpresidence_elementor_form').find('.agent_submit_class_elementor');
process_form_submit(form_submit);
});
jQuery('.agent_submit_class').on('click', function (event) {
process_form_submit(jQuery(this));
});
jQuery('.message_submit').on('click', function (event) {
process_form_submit(jQuery(this));
});
}
function process_form_submit(form_submit) {
var parent, contact_name, contact_email, contact_phone, contact_coment, agent_id, property_id, nonce, ajaxurl;
parent = form_submit.parent();
var is_private_message='no';
if(form_submit.hasClass('message_submit')){
is_private_message='yes';
}
contact_name = parent.find('#agent_contact_name').val();
contact_email = parent.find('#agent_user_email').val();
contact_phone = parent.find('#agent_phone').val();
contact_coment = parent.find('#agent_comment').val();
agent_id = parent.find('#agent_id').val();
property_id = parent.find('#agent_property_id').val();
nonce = parent.find('#agent_property_ajax_nonce').val();
ajaxurl = ajaxcalls_vars.admin_url + 'admin-ajax.php';
var schedule_day = parent.find('.schedule_day').val();
var schedule_hour = parent.find('.schedule_hour').val();
var schedule_mode ='in_person';
if( parent.hasClass('wpestate_schedule_tour_wrapper_content') ||
parent.hasClass('wpestate_shedule_tour_wrapper_type2_content') ||
parent.hasClass('wpestate_schedule_tour_wrapper') ){
schedule_day = parent.find('.shedule_day_option_selected').attr('data-scheudle-day');
schedule_hour = parent.find('#wpestate_schedule_tour_time').val();
var schedule_mode_button = parent.find('.shedule_option_selected');
if( schedule_mode_button.hasClass('schedule_video_chat') ){
schedule_mode ='video_chat';
}
}
var is_elementor = 0;
if (form_submit.parents('.wpresidence_elementor_form').length) {
parent = form_submit.parents('.wpresidence_elementor_form');
contact_name = parent.find('#form-field-name').val();
contact_email = parent.find('#form-field-email').val();
contact_coment = parent.find('#form-field-message').val();
contact_phone = parent.find('input[name="phone"]').val();
nonce = parent.find('#agent_property_ajax_nonce').val();
is_elementor = parent.find('#contact_form_elementor').val();
var wpresidence_form_id = parent.find('#wpresidence_form_id').val();
var elementor_email_subject = parent.find('#elementor_email_subject').val();
var temp_details;
temp_details = '';
var elementor_form = form_submit.parents('.wpresidence_elementor_form');
var form_items = elementor_form.find('.elementor-field');
var label_name ='';
var labelElement;
form_items.each(function () {
labelElement=jQuery(this).parent().find('.elementor-field-label');
if (labelElement.length > 0) {
label_name = labelElement.text();
label_name = label_name.replace('*', '');
} else {
label_name = jQuery(this).attr('name')
}
temp_details = temp_details + label_name + ": " + jQuery(this).val() + "/n";
});
contact_coment = temp_details ;
}
if (parent.find('.wpestate_agree_gdpr').length > 0) {
if (!parent.find('.wpestate_agree_gdpr').is(':checked')) {
parent.find('#alert-agent-contact').empty().append(ajaxcalls_vars.gdpr_terms);
return;
}
}
parent.find('#alert-agent-contact').empty().append(ajaxcalls_vars.sending);
jQuery.ajax({
type: 'POST',
dataType: 'json',
url: ajaxurl,
data: {
'action': 'wpestate_ajax_agent_contact_form',
'name': contact_name,
'email': contact_email,
'phone': contact_phone,
'comment': contact_coment,
'agent_id': agent_id,
'propid': property_id,
'schedule_day': schedule_day,
'schedule_hour': schedule_hour,
'schedule_mode':schedule_mode,
'elementor_wpresidence_form_id': wpresidence_form_id,
'elementor_email_subject': elementor_email_subject,
'is_elementor': is_elementor,
'is_private_message':is_private_message,
'nonce': nonce
},
success: function (data) {
if (data.sent) {
parent.find('#agent_contact_name').val('');
parent.find('#agent_user_email').val('');
parent.find('#agent_phone').val('');
parent.find('#agent_comment').val('');
parent.find('.schedule_day').val('');
parent.find('#schedule_hour').val('');
parent.find('#alert-agent-contact').addClass(' wpestate-agent-contact-sent ').empty().append(data.response);
if (typeof (form_items) !== 'undefined') {
form_items.each(function () {
jQuery(this).val('');
});
}
} else {
parent.find('#alert-agent-contact').empty().append(data.response);
}
},
error: function (errorThrown) {
}
});
jQuery.ajax({
type: 'POST',
// dataType: 'json',
url: ajaxurl,
data: {
'action': 'wpestate_ajax_agent_contact_form_forcrm',
'name': contact_name,
'email': contact_email,
'phone': contact_phone,
'comment': contact_coment,
'agent_id': agent_id,
'propid': property_id,
'schedule_day': schedule_day,
'schedule_hour': schedule_hour,
'schedule_mode':schedule_mode,
'nonce': nonce
},
success: function (data) {
},
error: function (errorThrown) {
}
});
}
///////////////////////////////////////////////////////////////////////////////////////////
/////// Property page + ajax call on contact
///////////////////////////////////////////////////////////////////////////////////////////
function wpestate_enable_share_unit(){
jQuery('.share_list').unbind('click');
jQuery('.share_list').on( 'click', function(event) {
event.stopPropagation();
var sharediv=jQuery(this).parent().find('.share_unit');
sharediv.toggle();
jQuery(this).toggleClass('share_on');
});
}
function setCookie(cname, cvalue, exdays) {
const d = new Date();
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
let expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function wpestate_enable_not_logged_favorites(){
var use_favorite_login = ajaxcalls_vars.favorites_login;
if(use_favorite_login=="yes"){
return;
}
var current_favorites = window.localStorage.getItem('wpestate_favorites');
setCookie('wpestate_favorites',current_favorites,10);
var prop_ids='';
if( current_favorites!==null ){
prop_ids = jQuery.map(current_favorites.split(','), function(value){
return parseInt(value);
});
}
jQuery('.icon-fav').each(function(){
var icon=jQuery(this);
var property_id=icon.attr('data-postid');
property_id=parseInt(property_id);
var index = prop_ids.indexOf( property_id );
if (index > -1) {
icon.removeClass('icon-fav-off').addClass('icon-fav-on');
icon.attr('data-original-title', ajaxcalls_vars.remove_fav);
}else{
icon.removeClass('icon-fav-on').addClass('icon-fav-off');
icon.attr('data-original-title', ajaxcalls_vars.add_favorite);
}
})
if(jQuery('#add_favorites').length>0){
var property_id=jQuery('#add_favorites').attr('data-postid');
property_id=parseInt(property_id);
var index = prop_ids.indexOf( property_id );
if (index > -1) {
jQuery('#add_favorites').removeClass('isnotfavorite').addClass('isfavorite').attr('data-original-title', ajaxcalls_vars.remove_favorite);
jQuery('#add_favorites').html('
' + ajaxcalls_vars.favorite);
}
}
}