/* Plugin Name: Breadcrumb NavXT Plugin URI: http://mtekk.us/code/breadcrumb-navxt/ Description: Adds a breadcrumb navigation showing the visitor's path to their current location. For details on how to use this plugin visit Breadcrumb NavXT. Version: 7.4.1 Author: John Havlik Author URI: http://mtekk.us/ License: GPL2 Text Domain: breadcrumb-navxt Domain Path: /languages */ /* Copyright 2007-2025 John Havlik (email : john.havlik@mtekk.us) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ //Do a PHP version check, require 5.6 or newer if(version_compare(phpversion(), '5.6.0', '<')) { //Only purpose of this function is to echo out the PHP version error function bcn_phpold() { printf('

' . esc_html__('Your PHP version is too old, please upgrade to a newer version. Your version is %1$s, Breadcrumb NavXT requires %2$s', 'breadcrumb-navxt') . '

', phpversion(), '5.6.0'); } //If we are in the admin, let's print a warning then return if(is_admin()) { add_action('admin_notices', 'bcn_phpold'); } return; } require_once(dirname(__FILE__) . '/includes/multibyte_supplicant.php'); //Include admin base class if(!class_exists('\mtekk\adminKit\adminKit')) { require_once(dirname(__FILE__) . '/includes/adminKit/class-mtekk_adminkit.php'); } //Include the breadcrumb class require_once(dirname(__FILE__) . '/class.bcn_breadcrumb.php'); //Include the breadcrumb trail class require_once(dirname(__FILE__) . '/class.bcn_breadcrumb_trail.php'); if(class_exists('WP_Widget')) { //Include the WP 2.8+ widget class require_once(dirname(__FILE__) . '/class.bcn_widget.php'); } use mtekk\adminKit\adminKit as adminKit; use mtekk\adminKit\setting; $breadcrumb_navxt = null; //TODO change to extends \mtekk\plugKit class breadcrumb_navxt { const version = '7.4.1'; protected $name = 'Breadcrumb NavXT'; protected $identifier = 'breadcrumb-navxt'; protected $unique_prefix = 'bcn'; protected $plugin_basename = null; protected $opt = null; protected $settings = array(); protected $breadcrumb_trail = null; protected $admin = null; protected $rest_controller = null; /** * Constructor for a new breadcrumb_navxt object * */ public function __construct() { //We set the plugin basename here $this->plugin_basename = plugin_basename(__FILE__); add_action('rest_api_init', array($this, 'rest_api_init'), 10); //Run much later than everyone else to give other plugins a chance to hook into the filters and actions in this add_action('init', array($this, 'init'), 9000); //Register the WordPress 2.8 Widget add_action('widgets_init', array($this, 'register_widget')); } public function init() { //Create an instance of bcn_breadcrumb_trail $bcn_breadcrumb_trail = new bcn_breadcrumb_trail(); //Allow others to swap out the breadcrumb trail object $this->breadcrumb_trail = apply_filters('bcn_breadcrumb_trail_object', $bcn_breadcrumb_trail); add_filter('bcn_allowed_html', array($this, 'allowed_html'), 1, 1); add_filter('mtekk_adminkit_allowed_html', array($this, 'adminkit_allowed_html'), 1, 1); //We want to run late for using our breadcrumbs add_filter('tha_breadcrumb_navigation', array($this, 'tha_compat'), 99); //Only include the REST API if enabled if(!defined('BCN_DISABLE_REST_API') || !BCN_DISABLE_REST_API) { require_once(dirname(__FILE__) . '/class.bcn_rest_controller.php'); $this->rest_controller = new bcn_rest_controller($this->breadcrumb_trail, $this->unique_prefix); } breadcrumb_navxt::setup_setting_defaults($this->settings); if(!is_admin() || (!isset($_POST[$this->unique_prefix . '_admin_reset']) && !isset($_POST[$this->unique_prefix . '_admin_options']))) { $this->get_settings(); //This breaks the reset options script, so only do it if we're not trying to reset the settings } //Register Guternberg Block $this->register_block(); //Load our network admin if in the network dashboard (yes is_network_admin() doesn't exist) if(defined('WP_NETWORK_ADMIN') && WP_NETWORK_ADMIN) { require_once(dirname(__FILE__) . '/class.bcn_network_admin.php'); //Instantiate our new admin object $this->admin = new bcn_network_admin($this->breadcrumb_trail->opt, $this->plugin_basename, $this->settings); } //Load our main admin if in the dashboard, but only if we're not in the network dashboard (prevents goofy bugs) else if(is_admin() || defined('WP_UNINSTALL_PLUGIN')) { require_once(dirname(__FILE__) . '/class.bcn_admin.php'); //Instantiate our new admin object $this->admin = new bcn_admin($this->breadcrumb_trail->opt, $this->plugin_basename, $this->settings); } } public function rest_api_init() { add_filter('bcn_register_rest_endpoint', array($this, 'api_enable_for_block'), 10, 4); } public function register_widget() { return register_widget($this->unique_prefix . '_widget'); } /** * Handles registering the Breadcrumb Trail Gutenberg block */ public function register_block() { if(function_exists('register_block_type')) { register_block_type( dirname(__FILE__) . '/includes/blocks/build/breadcrumb-trail'); } } public function api_enable_for_block($register_rest_endpoint, $endpoint, $version, $methods) { //Enable if the current user can edit posts if(current_user_can('edit_posts') && $endpoint === 'post') { return true; } return $register_rest_endpoint; } public function adminkit_allowed_html($tags) { //Hoop through normal allowed_html filters return apply_filters('bcn_allowed_html', $tags); } public function allowed_html($tags) { $allowed_html = array( 'a' => array( 'href' => true, 'title' => true, 'class' => true, 'id' => true, 'media' => true, 'dir' => true, 'relList' => true, 'rel' => true, 'aria-hidden' => true, 'data-icon' => true, 'itemref' => true, 'itemid' => true, 'itemprop' => true, 'itemscope' => true, 'itemtype' => true, 'xmlns:v' => true, 'typeof' => true, 'property' => true, 'vocab' => true, 'translate' => true, 'lang' => true, 'bcn-aria-current' => true ), 'img' => array( 'alt' => true, 'align' => true, 'height' => true, 'width' => true, 'src' => true, 'srcset' => true, 'sizes' => true, 'id' => true, 'class' => true, 'aria-hidden' => true, 'data-icon' => true, 'itemref' => true, 'itemid' => true, 'itemprop' => true, 'itemscope' => true, 'itemtype' => true, 'xmlns:v' => true, 'typeof' => true, 'property' => true, 'vocab' => true, 'lang' => true ), 'span' => array( 'title' => true, 'class' => true, 'id' => true, 'dir' => true, 'align' => true, 'lang' => true, 'xml:lang' => true, 'aria-hidden' => true, 'data-icon' => true, 'itemref' => true, 'itemid' => true, 'itemprop' => true, 'itemscope' => true, 'itemtype' => true, 'xmlns:v' => true, 'typeof' => true, 'property' => true, 'vocab' => true, 'translate' => true, 'lang' => true ), 'h1' => array( 'title' => true, 'class' => true, 'id' => true, 'dir' => true, 'align' => true, 'lang' => true, 'xml:lang' => true, 'aria-hidden' => true, 'data-icon' => true, 'itemref' => true, 'itemid' => true, 'itemprop' => true, 'itemscope' => true, 'itemtype' => true, 'xmlns:v' => true, 'typeof' => true, 'property' => true, 'vocab' => true, 'translate' => true, 'lang' => true ), 'h2' => array( 'title' => true, 'class' => true, 'id' => true, 'dir' => true, 'align' => true, 'lang' => true, 'xml:lang' => true, 'aria-hidden' => true, 'data-icon' => true, 'itemref' => true, 'itemid' => true, 'itemprop' => true, 'itemscope' => true, 'itemtype' => true, 'xmlns:v' => true, 'typeof' => true, 'property' => true, 'vocab' => true, 'translate' => true, 'lang' => true ), 'meta' => array( 'content' => true, 'property' => true, 'vocab' => true, 'itemprop' => true ) ); if(!is_array($tags)) { $tags = array(); } return adminKit::array_merge_recursive($tags, $allowed_html); } public function get_version() { return self::version; } public function uninstall() { $this->admin->uninstall(); } static function setup_setting_defaults(array &$settings) { //Hook for letting other plugins add in their default settings (has to go first to prevent other from overriding base settings) $settings = apply_filters('bcn_settings_init', $settings); //Now on to our settings $settings['bmainsite_display'] = new setting\setting_bool( 'mainsite_display', true, __('Main Site Breadcrumb', 'breadcrumb-navxt')); $settings['Hmainsite_template'] = new setting\setting_html( 'mainsite_template', bcn_breadcrumb::get_default_template(), __('Main Site Home Template', 'breadcrumb-navxt')); $settings['Hmainsite_template_no_anchor'] = new setting\setting_html( 'mainsite_template_no_anchor', bcn_breadcrumb::default_template_no_anchor, __('Main Site Home Template (Unlinked)', 'breadcrumb-navxt')); $settings['bhome_display'] = new setting\setting_bool( 'home_display', true, __('Home Breadcrumb', 'breadcrumb-navxt')); $settings['Hhome_template'] = new setting\setting_html( 'home_template', (isset($settings['Hhome_template']) && is_string($settings['Hhome_template'])) ? $settings['Hhome_template'] : bcn_breadcrumb::get_default_template(), __('Home Template', 'breadcrumb-navxt')); $settings['Hhome_template_no_anchor'] = new setting\setting_html( 'home_template_no_anchor', (isset($settings['Hhome_template_no_anchor']) && is_string($settings['Hhome_template_no_anchor'])) ? $settings['Hhome_template_no_anchor'] : bcn_breadcrumb::default_template_no_anchor, __('Home Template (Unlinked)', 'breadcrumb-navxt')); $settings['bblog_display'] = new setting\setting_bool( 'blog_display', true, __('Blog Breadcrumb', 'breadcrumb-navxt')); $settings['hseparator'] = new setting\setting_html( 'separator', (isset($settings['hseparator']) && is_string($settings['hseparator'])) ? $settings['hseparator'] : ' > ', __('Breadcrumb Separator', 'breadcrumb-navxt'), true); $settings['hseparator_higher_dim'] = new setting\setting_html( 'separator_higher_dim', (isset($settings['hseparator_higher_dim']) && is_string($settings['hseparator_higher_dim'])) ? $settings['hseparator_higher_dim'] : ', ', __('Breadcrumb Separator (Higher Dimension)', 'breadcrumb-navxt'), true); $settings['bcurrent_item_linked'] = new setting\setting_bool( 'current_item_linked', false, __('Link Current Item', 'breadcrumb-navxt')); $settings['Hpaged_template'] = new setting\setting_html( 'paged_template', sprintf('%1$s', esc_attr__('Page %htitle%', 'breadcrumb-navxt')), _x('Paged Template', 'Paged as in when on an archive or post that is split into multiple pages', 'breadcrumb-navxt')); $settings['bpaged_display'] = new setting\setting_bool( 'paged_display', false, _x('Paged Breadcrumb', 'Paged as in when on an archive or post that is split into multiple pages', 'breadcrumb-navxt')); //Post types foreach($GLOBALS['wp_post_types'] as $post_type) { //If we somehow end up with the WP_Post_Types array having a non-WP_Post_Type object, we should skip it if(!($post_type instanceof WP_Post_Type)) { continue; } $settings['Hpost_' . $post_type->name . '_template'] = new setting\setting_html( 'post_' . $post_type->name . '_template', bcn_breadcrumb::get_default_template(), sprintf(__('%s Template', 'breadcrumb-navxt'), $post_type->labels->singular_name)); $settings['Hpost_' . $post_type->name . '_template_no_anchor'] = new setting\setting_html( 'post_' . $post_type->name . '_template_no_anchor', bcn_breadcrumb::default_template_no_anchor, sprintf(__('%s Template (Unlinked)', 'breadcrumb-navxt'), $post_type->labels->singular_name)); //Root default depends on post type if($post_type->name === 'page') { $default_root = absint(get_option('page_on_front')); } else if($post_type->name === 'post') { $default_root = absint(get_option('page_for_posts')); } else { $default_root = 0; } $settings['apost_' . $post_type->name . '_root'] = new setting\setting_absint( 'post_' . $post_type->name . '_root', $default_root, sprintf(__('%s Root Page', 'breadcrumb-navxt'), $post_type->labels->singular_name)); //Archive display default depends on post type if($post_type->has_archive == true || is_string($post_type->has_archive)) { $default_archive_display = true; } else { $default_archive_display = false; } $settings['bpost_' . $post_type->name . '_archive_display'] = new setting\setting_bool( 'post_' . $post_type->name . '_archive_display', $default_archive_display, sprintf(__('%s Archive Display', 'breadcrumb-navxt'), $post_type->labels->singular_name)); $settings['bpost_' . $post_type->name . '_taxonomy_referer'] = new setting\setting_bool( 'post_' . $post_type->name . '_taxonomy_referer', false, sprintf(__('%s Hierarchy Referer Influence', 'breadcrumb-navxt'), $post_type->labels->singular_name)); //Hierarchy use parent first depends on post type if(in_array($post_type->name, array('page', 'post'))) { $default_parent_first = false; } else if($post_type->name === 'attachment') { $default_parent_first = true; } else { $default_parent_first = apply_filters('bcn_default_hierarchy_parent_first', false, $post_type->name); } $settings['bpost_' . $post_type->name . '_hierarchy_parent_first'] = new setting\setting_bool( 'post_' . $post_type->name . '_hierarchy_parent_first', $default_parent_first, sprintf(__('%s Hierarchy Use Parent First', 'breadcrumb-navxt'), $post_type->labels->singular_name)); //Hierarchy depends on post type if($post_type->name === 'page') { $hierarchy_type_allowed_values = array('BCN_POST_PARENT'); $hierarchy_type_default = 'BCN_POST_PARENT'; $default_hierarchy_display = true; } else { $hierarchy_type_allowed_values = array('BCN_POST_PARENT', 'BCN_DATE'); $hierarchy_type_default = 'BCN_POST_PARENT'; $default_hierarchy_display = false; //Loop through all of the possible taxonomies foreach($GLOBALS['wp_taxonomies'] as $taxonomy) { //Check for non-public taxonomies if(!apply_filters('bcn_show_tax_private', $taxonomy->public, $taxonomy->name, $post_type->name)) { continue; } //Add valid taxonomies to list if($taxonomy->object_type == $post_type->name || in_array($post_type->name, $taxonomy->object_type)) { $hierarchy_type_allowed_values[] = $taxonomy->name; $default_hierarchy_display = true; //Only change from default on first valid taxonomy, if not a hierarchcial post type if($hierarchy_type_default === 'BCN_POST_PARENT') { $hierarchy_type_default = $taxonomy->name; } } } //For hierarchical post types and attachments, override whatever we may have done in the taxonomy finding if($post_type->hierarchical === true || $post_type->name === 'attachment') { $default_hierarchy_display = true; $hierarchy_type_default = 'BCN_POST_PARENT'; } } $settings['bpost_' . $post_type->name . '_hierarchy_display'] = new setting\setting_bool( 'post_' . $post_type->name . '_hierarchy_display', $default_hierarchy_display, sprintf(__('%s Hierarchy Display', 'breadcrumb-navxt'), $post_type->labels->singular_name)); $settings['Epost_' . $post_type->name . '_hierarchy_type'] = new setting\setting_enum( 'post_' . $post_type->name . '_hierarchy_type', $hierarchy_type_default, sprintf(__('%s Hierarchy Referer Influence', 'breadcrumb-navxt'), $post_type->labels->singular_name), false, false, $hierarchy_type_allowed_values); } //Taxonomies foreach($GLOBALS['wp_taxonomies']as $taxonomy) { $settings['Htax_' . $taxonomy->name. '_template'] = new setting\setting_html( 'tax_' . $taxonomy->name. '_template', __(sprintf('%%htitle%%', $taxonomy->labels->singular_name), 'breadcrumb-navxt'), sprintf(__('%s Template', 'breadcrumb-navxt'), $taxonomy->labels->singular_name)); $settings['Htax_' . $taxonomy->name. '_template_no_anchor'] = new setting\setting_html( 'tax_' . $taxonomy->name. '_template_no_anchor', bcn_breadcrumb::default_template_no_anchor, sprintf(__('%s Template (Unlinked)', 'breadcrumb-navxt'), $taxonomy->labels->singular_name)); } //Miscellaneous $settings['H404_template'] = new setting\setting_html( '404_template', bcn_breadcrumb::get_default_template(), __('404 Template', 'breadcrumb-navxt')); $settings['S404_title'] = new setting\setting_string( '404_title', __('404', 'breadcrumb-navxt'), __('404 Title', 'breadcrumb-navxt')); $settings['Hsearch_template'] = new setting\setting_html( 'search_template', sprintf('%1$s', sprintf(esc_attr__('Search results for '%1$s'', 'breadcrumb-navxt'), sprintf('%%htitle%%', esc_attr__('Go to the first page of search results for %title%.', 'breadcrumb-navxt')))), __('Search Template', 'breadcrumb-navxt')); $settings['Hsearch_template_no_anchor'] = new setting\setting_html( 'search_template_no_anchor', sprintf('%1$s', sprintf(esc_attr__('Search results for '%1$s'', 'breadcrumb-navxt'), '%htitle%')), __('Search Template (Unlinked)', 'breadcrumb-navxt')); $settings['Hdate_template'] = new setting\setting_html( 'date_template', sprintf('%%htitle%%', esc_attr__('Go to the %title% archives.', 'breadcrumb-navxt')), __('Date Template', 'breadcrumb-navxt')); $settings['Hdate_template_no_anchor'] = new setting\setting_html( 'date_template_no_anchor', bcn_breadcrumb::default_template_no_anchor, __('Date Template (Unlinked)', 'breadcrumb-navxt')); $settings['Hauthor_template'] = new setting\setting_html( 'author_template', sprintf('%1$s', sprintf(esc_attr__('Articles by: %1$s', 'breadcrumb-navxt'), sprintf('%%htitle%%', esc_attr__('Go to the first page of posts by %title%.', 'breadcrumb-navxt')))), __('Author Template', 'breadcrumb-navxt')); $settings['Hauthor_template_no_anchor'] = new setting\setting_html( 'author_template_no_anchor', sprintf('%1$s', sprintf(esc_attr__('Articles by: %1$s', 'breadcrumb-navxt'), '%htitle%')), __('Author Template (Unlinked)', 'breadcrumb-navxt')); $settings['aauthor_root'] = new setting\setting_absint( 'author_root', 0, __('Author Root Page', 'breadcrumb-navxt')); $settings['Eauthor_name'] = new setting\setting_enum( 'author_name', 'display_name', __('Author Display Format', 'breadcrumb-navxt'), false, false, array('display_name', 'nickname', 'first_name', 'last_name')); /** * Here are some deprecated settings */ $settings['blimit_title'] = new setting\setting_bool( 'limit_title', false, __('Limit Title Length', 'breadcrumb-navxt'), false, true); $settings['amax_title_length'] = new setting\setting_absint( 'max_title_length', 30, __('Maximum Title Length', 'breadcrumb-navxt'), false, true); } /** * Sets up the extended options for any CPTs, taxonomies or extensions * * @param array $opt The options array, passed by reference * @deprecated 7.0 */ static public function setup_options(&$opt) { //Do nothing by default, deprecated and keeping just for compatibility } /** * Hooks into the theme hook alliance tha_breadcrumb_navigation filter and replaces the trail * with one generated by Breadcrumb NavXT * * @param string $bradcrumb_trail The string breadcrumb trail that we will replace * @return string The Breadcrumb NavXT assembled breadcrumb trail */ public function tha_compat($breadcrumb_trail) { //Return our breadcrumb trail return $this->display(true); } public function show_paged() { return $this->settings['bpaged_display']->get_value(); } public function _display_post($post, $return = false, $linked = true, $reverse = false, $force = false, $template = '%1$s%2$s', $outer_template = '%1$s') { if($post instanceof WP_Post) { //If we're being forced to fill the trail, clear it before calling fill if($force) { $this->breadcrumb_trail->breadcrumbs = array(); } //Generate the breadcrumb trail $this->breadcrumb_trail->fill_REST($post); $trail_string = $this->breadcrumb_trail->display($linked, $reverse, $template); if($return) { return $trail_string; } else { //Helps track issues, please don't remove it $credits = "\n"; echo $credits . $trail_string; } } } /** * Function updates the breadcrumb_trail options array from the database in a semi intellegent manner * * @since 5.0.0 */ private function get_settings() { //Convert our settings to opts $opts = adminKit::settings_to_opts($this->settings); //Run setup_options for compatibilty reasons breadcrumb_navxt::setup_options($opts); //TODO: Unit tests needed to ensure the expected behavior exists //Grab the current settings for the current local site from the db $this->breadcrumb_trail->opt = wp_parse_args(get_option('bcn_options'), $opts); //If we're in multisite mode, look at the three BCN_SETTINGS globals if(is_multisite()) { $multisite_opts = wp_parse_args(get_site_option('bcn_options'), $opts); if(defined('BCN_SETTINGS_USE_NETWORK') && BCN_SETTINGS_USE_NETWORK) { //Grab the current network wide settings $this->breadcrumb_trail->opt = $multisite_opts; } else if(defined('BCN_SETTINGS_FAVOR_LOCAL') && BCN_SETTINGS_FAVOR_LOCAL) { //Grab the current local site settings and merge into network site settings + defaults $this->breadcrumb_trail->opt = wp_parse_args(get_option('bcn_options'), $multisite_opts); } else if(defined('BCN_SETTINGS_FAVOR_NETWORK') && BCN_SETTINGS_FAVOR_NETWORK) { //Grab the current network site settings and merge into local site settings + defaults $this->breadcrumb_trail->opt = wp_parse_args(get_site_option('bcn_options'), $this->breadcrumb_trail->opt); } } //Currently only support using post_parent for the page hierarchy $this->breadcrumb_trail->opt['bpost_page_hierarchy_display'] = true; $this->breadcrumb_trail->opt['bpost_page_hierarchy_parent_first'] = true; $this->breadcrumb_trail->opt['Epost_page_hierarchy_type'] = 'BCN_POST_PARENT'; $this->breadcrumb_trail->opt['apost_page_root'] = get_option('page_on_front'); //This one isn't needed as it is performed in bcn_breadcrumb_trail::fill(), it's here for completeness only $this->breadcrumb_trail->opt['apost_post_root'] = get_option('page_for_posts'); } /** * Outputs the breadcrumb trail * * @param bool $return Whether to return or echo the trail. * @param bool $linked Whether to allow hyperlinks in the trail or not. * @param bool $reverse Whether to reverse the output or not. * @param bool $force Whether or not to force the fill function to run. * @param string $template The template to use for the string output. * @param string $outer_template The template to place an entire dimension of the trail into for all dimensions higher than 1. * * @return void Void if Option to print out breadcrumb trail was chosen. * @return string String-Data of breadcrumb trail. */ public function display($return = false, $linked = true, $reverse = false, $force = false, $template = '%1$s%2$s', $outer_template = '%1$s') { //If we're being forced to fill the trail, clear it before calling fill if($force) { $this->breadcrumb_trail->breadcrumbs = array(); } //Generate the breadcrumb trail $this->breadcrumb_trail->fill($force); $trail_string = $this->breadcrumb_trail->display($linked, $reverse, $template, $outer_template); if($return) { return $trail_string; } else { //Helps track issues, please don't remove it $credits = "\n"; echo $credits . $trail_string; } } /** * Outputs the breadcrumb trail with each element encapsulated with li tags * * @deprecated 6.0.0 No longer needed, superceeded by $template parameter in display * * @param bool $return Whether to return or echo the trail. * @param bool $linked Whether to allow hyperlinks in the trail or not. * @param bool $reverse Whether to reverse the output or not. * @param bool $force Whether or not to force the fill function to run. * * @return void Void if Option to print out breadcrumb trail was chosen. * @return string String-Data of breadcrumb trail. */ public function display_list($return = false, $linked = true, $reverse = false, $force = false) { _deprecated_function( __FUNCTION__, '6.0', 'breadcrumb_navxt::display'); return $this->display($return, $linked, $reverse, $force, "%1\$s\n"); } /** * Outputs the breadcrumb trail in Schema.org BreadcrumbList compatible JSON-LD * * @param bool $return Whether to return or echo the trail. * @param bool $reverse Whether to reverse the output or not. * @param bool $force Whether or not to force the fill function to run. * * @return void Void if Option to print out breadcrumb trail was chosen. * @return string String-Data of breadcrumb trail. */ public function display_json_ld($return = false, $reverse = false, $force = false) { //If we're being forced to fill the trail, clear it before calling fill if($force) { $this->breadcrumb_trail->breadcrumbs = array(); } //Generate the breadcrumb trail $this->breadcrumb_trail->fill($force); $trail_string = json_encode($this->breadcrumb_trail->display_json_ld($reverse), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); if($return) { return $trail_string; } else { echo $trail_string; } } } //Have to bootstrap our startup so that other plugins can replace the bcn_breadcrumb_trail object if they need to add_action('plugins_loaded', 'bcn_init', 15); function bcn_init() { global $breadcrumb_navxt; $breadcrumb_navxt = new breadcrumb_navxt(); } /** * Outputs the breadcrumb trail * * @param bool $return Whether to return or echo the trail. (optional) * @param bool $linked Whether to allow hyperlinks in the trail or not. (optional) * @param bool $reverse Whether to reverse the output or not. (optional) * @param bool $force Whether or not to force the fill function to run. (optional) * * @return void Void if Option to print out breadcrumb trail was chosen. * @return string String-Data of breadcrumb trail. */ function bcn_display($return = false, $linked = true, $reverse = false, $force = false) { global $breadcrumb_navxt; if($breadcrumb_navxt !== null) { return $breadcrumb_navxt->display($return, $linked, $reverse, $force); } } /** * Outputs the breadcrumb trail with each element encapsulated with li tags * * @param bool $return Whether to return or echo the trail. (optional) * @param bool $linked Whether to allow hyperlinks in the trail or not. (optional) * @param bool $reverse Whether to reverse the output or not. (optional) * @param bool $force Whether or not to force the fill function to run. (optional) * * @return void Void if Option to print out breadcrumb trail was chosen. * @return string String-Data of breadcrumb trail. */ function bcn_display_list($return = false, $linked = true, $reverse = false, $force = false) { global $breadcrumb_navxt; if($breadcrumb_navxt !== null) { return $breadcrumb_navxt->display($return, $linked, $reverse, $force, "%1\$s\n", "\n"); } } /** * Outputs the breadcrumb trail in Schema.org BreadcrumbList compatible JSON-LD * * @param bool $return Whether to return or echo the trail. (optional) * @param bool $reverse Whether to reverse the output or not. (optional) * @param bool $force Whether or not to force the fill function to run. (optional) * * @return void Void if Option to print out breadcrumb trail was chosen. * @return string String-Data of breadcrumb trail. */ function bcn_display_json_ld($return = false, $reverse = false, $force = false) { global $breadcrumb_navxt; if($breadcrumb_navxt !== null) { return $breadcrumb_navxt->display_json_ld($return, $reverse, $force); } } /** * Plugin Name: Elementor Pro * Description: Elevate your designs and unlock the full power of Elementor. Gain access to dozens of Pro widgets and kits, Theme Builder, Pop Ups, Forms and WooCommerce building capabilities. * Plugin URI: https://go.elementor.com/wp-dash-wp-plugins-author-uri/ * Version: 3.31.3 * Author: Elementor.com * Author URI: https://go.elementor.com/wp-dash-wp-plugins-author-uri/ * Text Domain: elementor-pro * Requires Plugins: elementor * Elementor tested up to: 3.31.0 */ if ( get_option('_elementor_pro_license_data') ) { delete_option( '_elementor_pro_license_data'); } if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'ELEMENTOR_PRO_VERSION', '3.31.3' ); /** * All versions should be `major.minor`, without patch, in order to compare them properly. * Therefore, we can't set a patch version as a requirement. * (e.g. Core 3.15.0-beta1 and Core 3.15.0-cloud2 should be fine when requiring 3.15, while * requiring 3.15.2 is not allowed) */ define( 'ELEMENTOR_PRO_REQUIRED_CORE_VERSION', '3.29' ); define( 'ELEMENTOR_PRO_RECOMMENDED_CORE_VERSION', '3.31' ); define( 'ELEMENTOR_PRO__FILE__', __FILE__ ); define( 'ELEMENTOR_PRO_PLUGIN_BASE', plugin_basename( ELEMENTOR_PRO__FILE__ ) ); define( 'ELEMENTOR_PRO_PATH', plugin_dir_path( ELEMENTOR_PRO__FILE__ ) ); define( 'ELEMENTOR_PRO_ASSETS_PATH', ELEMENTOR_PRO_PATH . 'assets/' ); define( 'ELEMENTOR_PRO_MODULES_PATH', ELEMENTOR_PRO_PATH . 'modules/' ); define( 'ELEMENTOR_PRO_URL', plugins_url( '/', ELEMENTOR_PRO__FILE__ ) ); define( 'ELEMENTOR_PRO_ASSETS_URL', ELEMENTOR_PRO_URL . 'assets/' ); define( 'ELEMENTOR_PRO_MODULES_URL', ELEMENTOR_PRO_URL . 'modules/' ); // Include Composer's autoloader if ( file_exists( ELEMENTOR_PRO_PATH . 'vendor/autoload.php' ) ) { require_once ELEMENTOR_PRO_PATH . 'vendor/autoload.php'; // We need this file because of the DI\create function that we are using. // Autoload classmap doesn't include this file. require_once ELEMENTOR_PRO_PATH . 'vendor_prefixed/php-di/php-di/src/functions.php'; } /** * Load gettext translate for our text domain. * * @since 1.0.0 * * @return void */ function elementor_pro_load_plugin() { if ( ! did_action( 'elementor/loaded' ) ) { add_action( 'admin_notices', 'elementor_pro_fail_load' ); return; } $core_version = ELEMENTOR_VERSION; $core_version_required = ELEMENTOR_PRO_REQUIRED_CORE_VERSION; $core_version_recommended = ELEMENTOR_PRO_RECOMMENDED_CORE_VERSION; if ( ! elementor_pro_compare_major_version( $core_version, $core_version_required, '>=' ) ) { add_action( 'admin_notices', 'elementor_pro_fail_load_out_of_date' ); return; } if ( ! elementor_pro_compare_major_version( $core_version, $core_version_recommended, '>=' ) ) { add_action( 'admin_notices', 'elementor_pro_admin_notice_upgrade_recommendation' ); } require ELEMENTOR_PRO_PATH . 'plugin.php'; } function elementor_pro_compare_major_version( $left, $right, $operator ) { $pattern = '/^(\d+\.\d+).*/'; $replace = '$1.0'; $left = preg_replace( $pattern, $replace, $left ); $right = preg_replace( $pattern, $replace, $right ); return version_compare( $left, $right, $operator ); } add_action( 'plugins_loaded', 'elementor_pro_load_plugin' ); function print_error( $message ) { if ( ! $message ) { return; } // PHPCS - $message should not be escaped echo '
' . $message . '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Show in WP Dashboard notice about the plugin is not activated. * * @since 1.0.0 * * @return void */ function elementor_pro_fail_load() { $screen = get_current_screen(); if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) { return; } $plugin = 'elementor/elementor.php'; if ( _is_elementor_installed() ) { if ( ! current_user_can( 'activate_plugins' ) ) { return; } $activation_url = wp_nonce_url( 'plugins.php?action=activate&plugin=' . $plugin . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $plugin ); $message = '

' . esc_html__( 'You\'re not using Elementor Pro yet!', 'elementor-pro' ) . '

'; $message .= '

' . esc_html__( 'Activate the Elementor plugin to start using all of Elementor Pro plugin’s features.', 'elementor-pro' ) . '

'; $message .= '

' . sprintf( '%s', $activation_url, esc_html__( 'Activate Now', 'elementor-pro' ) ) . '

'; } else { if ( ! current_user_can( 'install_plugins' ) ) { return; } $install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' ); $message = '

' . esc_html__( 'Elementor Pro plugin requires installing the Elementor plugin', 'elementor-pro' ) . '

'; $message .= '

' . esc_html__( 'Install and activate the Elementor plugin to access all the Pro features.', 'elementor-pro' ) . '

'; $message .= '

' . sprintf( '%s', $install_url, esc_html__( 'Install Now', 'elementor-pro' ) ) . '

'; } print_error( $message ); } function elementor_pro_fail_load_out_of_date() { if ( ! current_user_can( 'update_plugins' ) ) { return; } $file_path = 'elementor/elementor.php'; $upgrade_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file_path, 'upgrade-plugin_' . $file_path ); $message = sprintf( '

%1$s

%2$s %4$s

', esc_html__( 'Elementor Pro requires newer version of the Elementor plugin', 'elementor-pro' ), esc_html__( 'Update the Elementor plugin to reactivate the Elementor Pro plugin.', 'elementor-pro' ), $upgrade_link, esc_html__( 'Update Now', 'elementor-pro' ) ); print_error( $message ); } function elementor_pro_admin_notice_upgrade_recommendation() { if ( ! current_user_can( 'update_plugins' ) ) { return; } $file_path = 'elementor/elementor.php'; $upgrade_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file_path, 'upgrade-plugin_' . $file_path ); $message = sprintf( '

%1$s

%2$s %4$s

', esc_html__( 'Don’t miss out on the new version of Elementor', 'elementor-pro' ), esc_html__( 'Update to the latest version of Elementor to enjoy new features, better performance and compatibility.', 'elementor-pro' ), $upgrade_link, esc_html__( 'Update Now', 'elementor-pro' ) ); print_error( $message ); } if ( ! function_exists( '_is_elementor_installed' ) ) { function _is_elementor_installed() { $file_path = 'elementor/elementor.php'; $installed_plugins = get_plugins(); return isset( $installed_plugins[ $file_path ] ); } } /** * Plugin Name: Ultimate Addons for Elementor Lite * Plugin URI: https://wordpress.org/plugins/header-footer-elementor/ * Description: Formerly known as "Elementor Header & Footer Builder", this powerful plugin allows you to create custom headers and footers with Elementor and display them in selected locations. You can also create custom Elementor blocks and place them anywhere on your website using a shortcode. * Author: Brainstorm Force * Author URI: https://www.brainstormforce.com/ * Text Domain: header-footer-elementor * Domain Path: /languages * Version: 2.6.1 * Elementor tested up to: 3.32 * Elementor Pro tested up to: 3.32 * * @package header-footer-elementor */ define( 'HFE_VER', '2.6.1' ); define( 'HFE_FILE', __FILE__ ); define( 'HFE_DIR', plugin_dir_path( __FILE__ ) ); define( 'HFE_URL', plugins_url( '/', __FILE__ ) ); define( 'HFE_PATH', plugin_basename( __FILE__ ) ); define( 'HFE_DOMAIN', trailingslashit( 'https://ultimateelementor.com' ) ); define( 'UAE_LITE', true ); /** * Load the class loader. */ require_once HFE_DIR . '/inc/class-header-footer-elementor.php'; /** * Load the Plugin Class. * * @return void */ function hfe_plugin_activation() { update_option( 'uae_lite_is_activated', 'yes' ); update_option( 'hfe_start_onboarding', true ); } register_activation_hook( HFE_FILE, 'hfe_plugin_activation' ); /** * Load the Plugin Class. * * @return void */ function hfe_init() { Header_Footer_Elementor::instance(); } add_action( 'plugins_loaded', 'hfe_init' ); /** Function for FA5, Social Icons, Icon List */ function hfe_enqueue_font_awesome() { if ( class_exists( 'Elementor\Plugin' ) ) { // Ensure Elementor Icons CSS is loaded. wp_enqueue_style( 'hfe-elementor-icons', plugins_url( '/elementor/assets/lib/eicons/css/elementor-icons.min.css', 'elementor' ), [], '5.34.0' ); wp_enqueue_style( 'hfe-icons-list', plugins_url( '/elementor/assets/css/widget-icon-list.min.css', 'elementor' ), [], '3.24.3' ); wp_enqueue_style( 'hfe-social-icons', plugins_url( '/elementor/assets/css/widget-social-icons.min.css', 'elementor' ), [], '3.24.0' ); wp_enqueue_style( 'hfe-social-share-icons-brands', plugins_url( '/elementor/assets/lib/font-awesome/css/brands.css', 'elementor' ), [], '5.15.3' ); wp_enqueue_style( 'hfe-social-share-icons-fontawesome', plugins_url( '/elementor/assets/lib/font-awesome/css/fontawesome.css', 'elementor' ), [], '5.15.3' ); wp_enqueue_style( 'hfe-nav-menu-icons', plugins_url( '/elementor/assets/lib/font-awesome/css/solid.css', 'elementor' ), [], '5.15.3' ); } if ( class_exists( '\ElementorPro\Plugin' ) ) { wp_enqueue_style( 'hfe-widget-blockquote', plugins_url( '/elementor-pro/assets/css/widget-blockquote.min.css', 'elementor' ), [], '3.25.0' ); wp_enqueue_style( 'hfe-mega-menu', plugins_url( '/elementor-pro/assets/css/widget-mega-menu.min.css', 'elementor' ), [], '3.26.2' ); wp_enqueue_style( 'hfe-nav-menu-widget', plugins_url( '/elementor-pro/assets/css/widget-nav-menu.min.css', 'elementor' ), [], '3.26.0' ); } } add_action( 'wp_enqueue_scripts', 'hfe_enqueue_font_awesome', 20 ); /* * @wordpress-plugin * Plugin Name: WordPress Importer * Plugin URI: https://wordpress.org/plugins/wordpress-importer/ * Description: Import posts, pages, comments, custom fields, categories, tags and more from a WordPress export file. * Author: wordpressdotorg * Author URI: https://wordpress.org/ * Version: 0.9.3 * Requires at least: 5.2 * Requires PHP: 7.2 * Text Domain: wordpress-importer * License: GPLv2 or later * License URI: https://www.gnu.org/licenses/gpl-2.0.html */ if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) { return; } /** Display verbose errors */ if ( ! defined( 'IMPORT_DEBUG' ) ) { define( 'IMPORT_DEBUG', WP_DEBUG ); } /** WordPress Import Administration API */ require_once ABSPATH . 'wp-admin/includes/import.php'; if ( ! class_exists( 'WP_Importer' ) ) { $class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php'; if ( file_exists( $class_wp_importer ) ) { require $class_wp_importer; } } /** Functions missing in older WordPress versions. */ require_once __DIR__ . '/compat.php'; if ( ! class_exists( 'WordPress\XML\XMLProcessor' ) ) { require_once __DIR__ . '/php-toolkit/load.php'; } /** WXR_Parser class */ require_once __DIR__ . '/parsers/class-wxr-parser.php'; /** WXR_Parser_SimpleXML class */ require_once __DIR__ . '/parsers/class-wxr-parser-simplexml.php'; /** WXR_Parser_XML class */ require_once __DIR__ . '/parsers/class-wxr-parser-xml.php'; /** * WXR_Parser_Regex class * @deprecated 0.9.0 Use WXR_Parser_XML_Processor instead. The WXR_Parser_Regex class * is no longer used by the importer or maintained with bug fixes. The only * reason it is still included in the codebase is for backwards compatibility * with plugins that directly reference it. */ require_once __DIR__ . '/parsers/class-wxr-parser-regex.php'; /** WXR_Parser_XML_Processor class */ require_once __DIR__ . '/parsers/class-wxr-parser-xml-processor.php'; /** WP_Import class */ require_once __DIR__ . '/class-wp-import.php'; function wordpress_importer_init() { load_plugin_textdomain( 'wordpress-importer' ); /** * WordPress Importer object for registering the import callback * @global WP_Import $wp_import */ $GLOBALS['wp_import'] = new WP_Import(); // phpcs:ignore WordPress.WP.CapitalPDangit register_importer( 'wordpress', 'WordPress', __( 'Import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.', 'wordpress-importer' ), array( $GLOBALS['wp_import'], 'dispatch' ) ); } add_action( 'admin_init', 'wordpress_importer_init' ); __( 'Save as a template', 'elementor' ); __( 'New', 'elementor' ); __( 'Save as a component', 'elementor' ); __( 'New', 'elementor' ); __( 'Add %s', 'elementor' ); __( 'Edit %s', 'elementor' ); __( 'Duplicate %s', 'elementor' ); __( 'Delete %s', 'elementor' );__( 'Save as a template', 'elementor' ); __( 'New', 'elementor' ); __( 'Save as a component', 'elementor' ); __( 'New', 'elementor' ); __( 'Add %s', 'elementor' ); __( 'Edit %s', 'elementor' ); __( 'Duplicate %s', 'elementor' ); __( 'Delete %s', 'elementor' );__( 'Save as a template', 'elementor' ); __( 'New', 'elementor' ); __( 'Save as a component', 'elementor' ); __( 'New', 'elementor' ); __( 'Add %s', 'elementor' ); __( 'Edit %s', 'elementor' ); __( 'Duplicate %s', 'elementor' ); __( 'Delete %s', 'elementor' );__( 'Save as a template', 'elementor' ); __( 'New', 'elementor' ); __( 'Save as a component', 'elementor' ); __( 'New', 'elementor' ); __( 'Add %s', 'elementor' ); __( 'Edit %s', 'elementor' ); __( 'Duplicate %s', 'elementor' ); __( 'Delete %s', 'elementor' );var view_options; var sort_options; var FILTER_PAGE_URL; var FILTER_PAGE_CURRENT; var IB_IS_REGULAR_FILTER_PAGE = true; var textprueba = '', inifil_default = 4; var idxboost_filter_countacti = false, idxboostcondition = ''; (function($) { var ajax_request_filter; var idxboost_filter_forms; $(function() { idxboost_filter_forms = $(".flex-idx-filter-form"); FILTER_PAGE_URL = $('#flex_idx_sort').data('permalink'); FILTER_PAGE_CURRENT = $('#flex_idx_sort').data('currpage'); if (idxboost_filter_forms.length) { idxboost_filter_forms.each(function() { var form = $(this); var inputs = form.find("input"); if (inputs.length) { inputs.on("change", function() { var filter_form = $(this).parent(); var filter_form_data = filter_form.serialize(); }); } }); } }); })(jQuery); var ib_event_mobile=true; var myLazyLoad; var arraytest; var arrayother; var search_params = flex_idx_filter_params.params; var baths_slider_values = _.pluck(search_params.baths_range, 'value'); var beds_slider_values = _.pluck(search_params.beds_range, 'value'); var sqft_slider_values = _.pluck(search_params.living_size_range, 'value'); var lotsize_slider_values = _.pluck(search_params.lot_size_range, 'value'); var price_rent_slider_values = _.pluck(search_params.price_rent_range, 'value'); var price_sale_slider_values = _.pluck(search_params.price_sale_range, 'value'); var year_built_slider_values = _.pluck(search_params.year_built_range, 'value'); var property_type_values = _.pluck(search_params.property_types, 'value'); var flex_ui_loaded = false; var baths_slider; var beds_slider; var sqft_slider; var lotsize_slider; var price_sale_slider; var price_rent_slider; var year_built_slider; var flex_filter_sort; var flex_pagination; var flex_search_rental_switch; var flex_waterfront_switch; var flex_parking_switch; var flex_autocomplete; var flex_autocomplete_inner; var $cuerpo = jQuery("body"); var $ventana = jQuery(window); var arraytest_pryueba = ''; var currentfiltemid = ''; var xDown = null; var yDown = null; (function($) { $(function() { // handle save search on filter pages $("#filter-save-search").on("click", function() { var current_count = $(this).data("count"); if (__flex_g_settings.anonymous === "yes") { //active_modal($('#modal_login')); $("#modal_login").addClass("active_modal").find('[data-tab]').removeClass('active'); $("#modal_login").addClass("active_modal").find('[data-tab]:eq(1)').addClass('active'); $("#modal_login").find(".item_tab").removeClass("active"); $("#tabRegister").addClass("active"); $("button.close-modal").addClass("ib-close-mproperty"); $(".overlay_modal").css("background-color", "rgba(0,0,0,0.8);"); $("#modal_login h2").html( $("#modal_login").find("[data-tab]:eq(1)").data("text-force")); /*Asigamos el texto personalizado*/ var titleText = $(".header-tab a[data-tab='tabRegister']").attr('data-text') $("#modal_login .modal_cm .content_md .heder_md .ms-title-modal").html(titleText); } else if (__flex_g_settings.anonymous === "no" && (current_count > 500)) { sweetAlert(word_translate.oops, word_translate.you_cannot_save_search_with_more_than_500_properties, "error"); return; } else { active_modal($('#modal_save_search')); setTimeout(function() { $('#modal_properties_send').find('.close').click(); }, 2000); } }); // fix touch slider $('body').on('touchstart', '.slider-generator .propertie', function(evt) { evt.stopPropagation(); xDown = evt.originalEvent.touches[0].clientX; yDown = evt.originalEvent.touches[0].clientY; }); $('body').on('touchmove', '.slider-generator .propertie', function(evt) { if (!xDown || !yDown) { return; } var xUp = evt.originalEvent.touches[0].clientX; var yUp = evt.originalEvent.touches[0].clientY; var xDiff = xDown - xUp; var yDiff = yDown - yUp; if (Math.abs(xDiff) > Math.abs(yDiff)) { // si se mueve derecha o izquierda evt.preventDefault(); if (xDiff > 0) { // izquierda $(this).find('.next').click(); } else { // derecha $(this).find('.prev').click(); } } xDown = null; yDown = null; }); $('#result-search').scroll(function() { new LazyLoad({ callback_error: function(element){ $(element).attr('src','https://idxboost.com/i/default_thumbnail.jpg').removeClass('error').addClass('loaded'); $(element).attr('data-origin','https://idxboost.com/i/default_thumbnail.jpg'); } }); }); // Expande y contrae los mini filtros de 'all filters' en versión mobile de la web var $miniFilters = $('#mini-filters'); if ($miniFilters.length) { // Expando y contrigo el filtro $miniFilters.find('h4').on('click', function() { var $theLi = $(this).parents('li'); $theLi.toggleClass('expanded').siblings().removeClass('expanded'); }); } // Abre y cierra el 'All Filters' var $theFilters = $('#filters'); if ($theFilters.length) { var $allFilters = $('#all-filters'); var $wrapFilters = $('#wrap-filters'); $theFilters.on('click', 'button', function() { var $bedsActive = $('#mini-filters .price').addClass('expanded'); var $liClicked = $(this).parent(); var $nameClass = $liClicked.attr('class').split(' ')[0]; // [A] verifico si existe un LI de mini filter vinculado al LI de la cabezera de filtros que se acaba de crear. var $miniFilter = $miniFilters.find('li.' + $nameClass); if (!$miniFilter.length) { //El LI clickeado no está vinculado a la visualizacion de un mini filtro, verifiquemos si se hizo click en "All Filter". if ($nameClass !== 'all') { //console.log('no se hizo click en "All filters"'); return; } else { $liClicked.toggleClass('active').siblings().removeClass('active'); // se hizo click en 'All Filter', activo su flecha } } else { //console.log('si hay vinculación'); $liClicked.toggleClass('active').siblings().removeClass('active'); // activo su flecha, xq si hay vinculación y continuo.. apareciendo el mini filter. //return; } // [/A] switch ($nameClass) { case 'all': // Mostrar el 'All Filter' // [B] Apareciendo y/o mutando if (!$allFilters.hasClass('visible')) { // lo pongo asi, x siacaso yá esté visible individualmente y no se oculte, sino, muestre todos $allFilters.addClass('visible'); } else { if ($allFilters.hasClass('individual') && $allFilters.hasClass('visible')) { // Está visible, pero individualmente, le quitaré eso... $allFilters.removeClass('individual'); } else { if (!$allFilters.hasClass('individual') && $allFilters.hasClass('visible')) { // Está visible, y sin individual, lo ocultaré... $allFilters.removeClass('visible'); } } } if ($wrapFilters.width() <= 959) { //$cuerpo.toggleClass('fixed'); $('html').toggleClass('fixed'); } // [/C] // [D] Posiciono el 'All filter' dependiendo el ancho de la pantalla. if ($wrapFilters.width() <= 640) { $allFilters.css({ // porque la cabezera de los filtros están en una sola linea. 'top': ($wrapFilters.outerHeight() + $wrapFilters.position().top) + 'px', 'left': '0px', 'height': 'calc(100vh - ' + ($wrapFilters.outerHeight() + $theFilters.find('li.save').outerHeight()) + 'px)' }); } else if ($wrapFilters.width() > 640 && $wrapFilters.width() <= 959) { // mayor a 640 pero menor a 768 pixeles de ancho. if (!$allFilters.hasClass('neighborhood')) { // si no estoy en 'neighborhood' tengo todo el ancho de la pantalla. $allFilters.css({ // porque la cabezera de los filtros están en 2 lineas. 'left': '0px', 'top': $wrapFilters.outerHeight() + 'px', 'height': 'calc(100vh - ' + ($wrapFilters.outerHeight() + $applyFilters.outerHeight()) + 'px)' }); } else { // estoy en 'neighborhood', lo aparesco diferente; $allFilters.removeAttr('style'); console.log('Widt all filter: ' + $allFilters.width() + ' | position left clicked: ' + $liClicked.position().left + ' | Li clicked widht: ' + $liClicked.width()); $allFilters.css({ 'top': $wrapFilters.outerHeight() + 'px', //'left': ($allFilters.width() - ($liClicked.position().left + $liClicked.width())) + 'px' 'right': '0', 'left': 'auto', 'transform': 'none' }); } } else { // cuando la cabezera de los filtros se muestran en 1 sola linea y el 'all filter' debe ser modal (de 960px para arriba). $allFilters.removeAttr('style'); $allFilters.css('top', $wrapFilters.outerHeight() + 'px'); //creaScrollTemporal($allFilters, $citiesList); } // [/D] break default: if ($('html').hasClass('fixed')) { $('html').removeClass('fixed'); } if ($liClicked.hasClass('active')) { // activo la flecha del LI clickeado $miniFilter.addClass('visible').siblings().removeClass('visible'); // aparesco el 'Mimi filter' if (!$allFilters.hasClass('individual')) { // agrego la 'individualidad' solo si se viene de 'All filter', xq sino, yá la tiene. $allFilters.addClass('individual'); $allFilters.css('height', 'auto'); } if (!$allFilters.hasClass('visible')) { // agrego la 'individualidad' solo si se viene de 'All filter', xq sino, yá la tiene. $allFilters.addClass('visible'); } $allFilters.css({ 'top': $wrapFilters.outerHeight() + 'px', // aparesco el filtro individual, justo abajito del boton LI que se hizo click 'left': (($liClicked.position().left + ($liClicked.outerWidth() / 2)) - 150) + 'px' }); } else { $allFilters.removeClass('visible'); $miniFilter.removeClass('visible'); $liClicked.removeClass('active'); setTimeout(function() { $allFilters.removeClass('individual'); }, Number($allFilters.css('transition-duration').replace('s', '')) * 1000) } } }); // Escondo el 'All Filters' con el boton 'Apply filters', simulando click en 'All Filters' var $applyFilters = $('#apply-filters'); if ($applyFilters.length) { $applyFilters.on('click', function() { $theFilters.find('.all button').trigger('click'); }); } // Click fuera de 'All filters', desaparece. $(document).on('mouseup', function(e) { if ($allFilters.hasClass('visible')) { if (!$wrapFilters.is(e.target) && $wrapFilters.has(e.target).length === 0) { $theFilters.find('.active button').trigger('click'); } } }); $theFilters.find('.mini-search, .save').on('click', function() { if ($allFilters.hasClass('visible')) { $theFilters.find('.active button').trigger('click'); } }); } }); var $textThComplet = 'Page % - LISTINGS % to %'; // Éste es el texto que aparecerá en el separador cuando se cargue más items en la vista mapa, de la página 'Search Results'. Ejm: Page 2 - LISTINGS 25 to 48 // var $cuerpo = $('body'); var $ventana = $(window); var $htmlcuerpo = $('html, body'); //alert('Ancho: ' + $ventana.width() + 'px - Alto: ' + $ventana.height() + 'px'); $ventana.on('load', function() { $cuerpo.removeClass('loading'); }); // Seleccionador de clases en los filtros. var $viewFilter = $('.filter-views'); if ($viewFilter.length) { var $wrapResult = $('.wrap-result'); // Cambio de vista por SELECT NATIVO $viewFilter.on('change', 'select', function() { console.log($viewFilter); switch ($(this).find('option:selected').val()) { case 'grid': $viewFilter.removeClass('list map').addClass('grid'); $wrapResult.removeClass('view-list view-map').addClass('view-grid'); $cuerpo.removeClass('view-list view-map'); $("#idx_view").val("grid"); break case 'list': $viewFilter.removeClass('grid map').addClass('list'); $wrapResult.removeClass('view-grid view-map').addClass('view-list'); $cuerpo.addClass('view-list').removeClass('view-map'); $("#idx_view").val("list"); break case 'map': $viewFilter.removeClass('list grid').addClass('map'); $wrapResult.removeClass('view-list view-grid').addClass('view-map'); $cuerpo.removeClass('view-list').addClass('view-map'); $("#idx_view").val("map"); setTimeout(function() { var map_center = map.getCenter(); var map_zoom = map.getZoom(); google.maps.event.trigger(map, 'resize'); if (renderedMarkers === false) { var bounds = new google.maps.LatLngBounds(); for (var i = 0, l = markers.length; i < l; i++) { bounds.extend(markers[i].position); } map.fitBounds(bounds); } else { map.setCenter(map_center); map.setZoom(map_zoom); } }, 100); break } new LazyLoad({ callback_error: function(element){ $(element).attr('src','https://idxboost.com/i/default_thumbnail.jpg').removeClass('error').addClass('loaded'); $(element).attr('data-origin','https://idxboost.com/i/default_thumbnail.jpg'); } }); }); // Cambio de estado por select combertido a lista $viewFilter.on('click', 'li', function() { currentfiltemid=$(this).parent('ul').parent('li').attr('filtemid'); $(this).addClass('active').siblings().removeClass('active'); switch ($(this).attr('class').split(' ')[0]) { case 'grid': $('.idxboost-content-filter-'+currentfiltemid+' ').find($wrapResult).removeClass('view-list view-map').addClass('view-grid'); $cuerpo.removeClass('view-list view-map'); break case 'list': $('.idxboost-content-filter-'+currentfiltemid+' ').find($wrapResult).removeClass('view-grid view-map').addClass('view-list'); $cuerpo.addClass('view-list').removeClass('view-map'); break case 'map': $('.idxboost-content-filter-'+currentfiltemid+' ').find($wrapResult).removeClass('view-list view-grid').addClass('view-map'); $cuerpo.removeClass('view-list').addClass('view-map'); break } new LazyLoad({ callback_error: function(element){ $(element).attr('src','https://idxboost.com/i/default_thumbnail.jpg').removeClass('error').addClass('loaded'); $(element).attr('data-origin','https://idxboost.com/i/default_thumbnail.jpg'); } }); }); var $wrapListResult = $('#wrap-list-result'); //seteo esto if ($ventana.width() >= 768) { mutaSelectViews(true); //,por defecto que mute } $ventana.on('resize', function() { var $widthVentana = $ventana.width(); if ($widthVentana >= 768) { mutaSelectViews(true) } else if ($widthVentana < 768) { mutaSelectViews(false); } }); function mutaSelectViews(estado) { if (estado) { if (!$viewFilter.find('ul').length) { //console.log('muto a lista, el Ancho es: ' + $ventana.width()); var $optionActive = $viewFilter.find('option:selected').val(); $viewFilter.find('option').each(function() { $(this).replaceWith('
  • ' + $(this).text() + '
  • '); }); var $theSelect = $viewFilter.find('select'); $theSelect.replaceWith(''); $viewFilter.find('.' + $optionActive).addClass('active'); $viewFilter.removeClass($optionActive); } } else { if (!$viewFilter.find('select').length) { //console.log('muto a select nativo, el Ancho es: ' + $ventana.width()); var $indexLiActive = $viewFilter.find('.active').index(); var $classLiActive = $viewFilter.find('.active').attr('class').split(' ')[0]; $viewFilter.find('li').each(function() { $(this).replaceWith(''); }); var $theUl = $viewFilter.find('ul'); $theUl.replaceWith(''); $viewFilter.find('option').eq($indexLiActive).prop('selected', true).siblings().prop('selected', false); $viewFilter.addClass($classLiActive); } } } } // Results Search var $resultSearch = $('#result-search'); if ($resultSearch.length) { function creaMiniSliders() { var $properties = $resultSearch.find('.propertie'); var nproperties = $properties.length; for (var p = 0; p < nproperties; p++) { var $miniSlider = $properties.eq(p).find('.wrap-slider'); if ($miniSlider.length) { var $ulSlider = $miniSlider.find('> ul'); var $lisSlider = $ulSlider.find('> li'); var nLisEx = $lisSlider.length; if (nLisEx > 1) { $ulSlider.css('width', (nLisEx * 100) + '%'); $lisSlider.css('width', (100 / nLisEx) + '%'); } }; } } // Escondo el 'All Filters' con el boton 'Apply filters', simulando click en 'All Filters' var $applyFilters = $('#apply-filters'); if ($applyFilters.length) { $applyFilters.on('click', function() { $theFilters.find('.all button').trigger('click'); }); } // Click fuera de 'All filters', desaparece. } // Crea scroll para resultados , si es neighboorhood; var $neighborhood = $('#neighborhood'); if ($neighborhood.length) { if ($ventana.width() >= 1280) { $('#neighborhood').perfectScrollbar({ suppressScrollX: true, minScrollbarLength: '42' }); } } // Escoge en el menu de 'neighborhood-menu' de Neighboorhood Results var $neighborhoodMenu = $('#neighborhood-menu'); if ($neighborhoodMenu.length) { // Desaparece el menu cuando se hizo click en un LI $neighborhoodMenu.on('click', 'li', function() { $neighborhoodMenu.toggleClass('active'); $(this).addClass('active').siblings().removeClass('active'); }) } // Abre y cierra el mapa en los resultados de busqueda: (Botones, Open y close) var $buttonsMap = $('#map-actions'); if ($buttonsMap.length) { $buttonsMap.on('click', 'button', function() { $wrapListResult.toggleClass('closed'); $(this).addClass('hide').siblings().removeClass('hide'); setTimeout(function() { google.maps.event.trigger(map, 'resize'); setTimeout(function() { google.maps.event.trigger(map, 'resize'); }, 200); }, 100); }); } // Slider del menu de neighboorhood. // analizar, si se necesita convertir en funcion para luego anidar su ejecución permanente al evento .resize if ($neighborhoodMenu.width() >= 700) { // no pongo 768, xq en MAC: (1280), el espacio para el '$neighborhoodMenu' es solo de 720 // Dando ancho relativo al contenedor de los enlaces; setTimeout(function() { var $enlacesNbh = $neighborhoodMenu.find('li'); var nEnlacesNbh = $enlacesNbh.length if (nEnlacesNbh) { // Compruebo que existan enlaces var anchoUlNbh = 0; $enlacesNbh.each(function() { anchoUlNbh = anchoUlNbh + $(this).outerWidth(); }); // Calculo el margen total de los items y luego doy ancho real al Ul var $anchoFinalUl = anchoUlNbh + (Number($enlacesNbh.eq(0).css('margin-right').replace('px', '')) * (nEnlacesNbh - 1)) var $ulNbhMenu = $neighborhoodMenu.find('ul') // Si los enlaces no son muchos, escondo las flechas var $menuNbhWidth = Number($neighborhoodMenu.find('.gwr').width()); if ($anchoFinalUl < $neighborhoodMenu.width()) { $neighborhoodMenu.find('button').addClass('hide'); var $porcentaje = Math.floor(($anchoFinalUl * 100) / $menuNbhWidth); if ($porcentaje >= 65) { // si el porcentaje del ancho de los items sumados es mayor al 65%, damos flex $ulNbhMenu.addClass('flex'); } } else { $ulNbhMenu.css('width', $anchoFinalUl + 'px'); var $nextItemNbh = $neighborhoodMenu.find('.next-item'); var $prevItemNbh = $neighborhoodMenu.find('.prev-item'); // Asignando el desplazamiento para la flecha 'NEXT' $nextItemNbh.on('click', function() { // Boton siguiente var $lastItemMenuNbh = $enlacesNbh.eq(nEnlacesNbh - 1); // Moviendo el menu $ulNbhMenu.css('margin-left', '-' + (($menuNbhWidth - $lastItemMenuNbh.position().left) + $lastItemMenuNbh.width()) + 'px'); // Desactivando el boton $(this).addClass('hide'); $prevItemNbh.removeClass('hide') }); $prevItemNbh.on('click', function() { $ulNbhMenu.css('margin-left', '0'); $(this).addClass('hide'); $nextItemNbh.removeClass('hide'); }) } } }, 0); } widthTitleModal(); $ventana.resize(function() { widthTitleModal(); }); var $openCloseMap = $('.map-actions button'); if (typeof($openCloseMap) != 'undefined') { $openCloseMap.on('click', function() { $openCloseMap.removeClass('no-show'); $(this).addClass('no-show'); $('#wrap-list-result').toggleClass('hidden-results'); }); } var $showModal = $('.show-modal'); if (typeof($showModal) != 'undefined') { $showModal.on('click', function() { var $idModal = $(this).attr('data-modal'); //Identificador del Modal a mostrar var $positionModal = $(this).attr('data-position'); //Posición en la que se encuentra el Modal var $modalImg = $('#' + $idModal).find('.lazy-img').attr('data-src'); //Consultamos si existe una imagen para mostrar en el Modal if (typeof($modalImg) != 'undefined') { $('#' + $idModal).find('.lazy-img').attr('src', $modalImg).removeAttr('data-src'); } active_modal($idModal, $positionModal); }); } //var $overlayModal = $('.overlay_modal'); var $bodyModal = $('.modal_cm'); var $bodyHtml = $('html'); function active_modal(modal, positionmodal) { var $modal = $('#' + modal); var $positionModal = positionmodal; if ($modal.hasClass('active_modal')) { $('.overlay_modal').removeClass('active_modal'); } else { $modal.addClass('active_modal'); if ($positionModal == 0) { $bodyHtml.addClass('modal_fmobile'); var $positionClose = 0; } else { $bodyHtml.addClass('modal_mobile'); var $positionClose = 1; } } close_modal(modal, $positionClose); } function close_modal(modal, positionClose) { var $this, $parentModal; var $positionClose = positionClose; //Posición para cerrar el modal //Condición relacionada al botón close del modal if ($positionClose == 0) { $this = $('#' + modal).find('.close-btn'); //Boton close del modal $parentModal = 'modal_fmobile'; } else { $this = $('#' + modal).find('.close'); //Boton close del modal $parentModal = 'modal_mobile'; } $this.click(function() { var $modal = $this.closest('.active_modal'); $modal.removeClass('active_modal'); $bodyHtml.removeClass($parentModal); }); $('#' + modal).find(".overlay_modal_closer").click(function() { $('#' + modal).removeClass('active_modal'); $bodyHtml.removeClass('modal_mobile'); }); } function showFullMap() { console.log('activo'); var flex_map_mini_view = $("#code-map"); var myLatLng2 = { lat: parseFloat(flex_map_mini_view.data('lat')), lng: parseFloat(flex_map_mini_view.data('lng')) }; var miniMap = new google.maps.Map(document.getElementById('code-map'), { zoom: 16, center: myLatLng2 }); var marker = new google.maps.Marker({ position: myLatLng2, map: miniMap }); google.maps.event.trigger(miniMap, "resize"); $("#code-map").removeAttr("data-lat"); $("#code-map").removeAttr("data-lng"); } function widthTitleModal() { var $titleModal = $('#md-title'); if (typeof($titleModal) != 'undefined') { var widthSize = $("#md-body").width(); $titleModal.css({ 'width': widthSize + 'px' }); } } //Final de Funciones agregadas el 20/04/2017 // Funciones generales function apareceImagen(li) { var $laImagen = li.find('img'); var $srcOriginal = $laImagen.attr('data-src'); if ($srcOriginal !== undefined) { $laImagen.attr('src', $srcOriginal).removeAttr('data-src'); li.addClass('loading'); $laImagen.on('load', function() { li.removeClass('loading'); }); } } function itemActivo(losLi) { // refactorizar esto (nueva idea para la función). var nLis = losLi.length; for (var s = 0; s < nLis; s++) { if (losLi.eq(s).hasClass('active')) { return s; } } } function getGallery(mls, counter) { // ejemplo: http://retsimages.s3.amazonaws.com/34/A10172834_2.jpg var cdn = '//retsimages.s3.amazonaws.com'; var folder = mls.substring((mls.length) - 2); // 34 var list = []; var img = ''; if (counter <= 0) { list.push(dgtCredential.imgComingSoon); } else { for (var i = 1; i <= counter; i++) { img = cdn + '/' + folder + '/' + mls + '_' + i + '.jpg'; list.push(img); } } return list; } function creaScrollTemporal(creador, objetivo) { if (!objetivo.hasClass('ps-container')) { setTimeout(function() { objetivo.perfectScrollbar({ suppressScrollX: true, minScrollbarLength: '42' }); }, ((Number(creador.css('transition-duration').replace('s', '')) * 1000) * 2)); } } function dgt_rangeSlide(elementRange, minr, maxr, stepTo, pricefrom, priceto, typev1, typev2, boolComa, maxStep, newStep) { $(elementRange).slider({ range: true, min: minr, max: maxr, values: [minr, maxr], step: stepTo, slide: function(event, ui) { if (ui.values[0] > maxStep) { newSepTo(elementRange, newStep); //console.log('soy mas que: ' + maxStep); } else { //if (step != stepTo) { newSepTo(elementRange, stepTo); //console.log('soy menos que: ' + maxStep); //} } if (boolComa == true) { $(pricefrom).val(typev1 + separadorComa(ui.values[0]) + " " + typev2); $(priceto).val(typev1 + separadorComa(ui.values[1]) + " " + typev2); } else { $(pricefrom).val(typev1 + ui.values[0] + " " + typev2); $(priceto).val(typev1 + ui.values[1] + " " + typev2); } }, }); }; function newSepTo(elementRange, newStep) { $(elementRange).slider({ step: newStep }); }; function separadorComa(valor) { var nums = new Array(); var simb = ","; //Éste es el separador valor = valor.toString(); valor = valor.replace(/\D/g, ""); //Ésta expresión regular solo permitira ingresar números nums = valor.split(""); //Se vacia el valor en un arreglo var long = nums.length - 1; // Se saca la longitud del arreglo var patron = 3; //Indica cada cuanto se ponen las comas var prox = 2; // Indica en que lugar se debe insertar la siguiente coma var res = ""; while (long > prox) { nums.splice((long - prox), 0, simb); //Se agrega la coma prox += patron; //Se incrementa la posición próxima para colocar la coma } for (var i = 0; i <= nums.length - 1; i++) { res += nums[i]; //Se crea la nueva cadena para devolver el valor formateado } return res; }; (function($) { var extensionMethods = { pips: function(settings) { options = { first: "number", last: "number", rest: "pip" }; $.extend(options, settings); this.element.addClass('ui-slider-pips').find('.ui-slider-pip').remove(); var pips = this.options.max - this.options.min; for (i = 0; i <= pips; i++) { var s = $('' + i + ''); if (0 == i) { s.addClass('ui-slider-pip-first'); if ("number" == options.first) { s.addClass('ui-slider-pip-number'); } if (false == options.first) { s.addClass('ui-slider-pip-hide'); } } else if (pips == i) { s.addClass('ui-slider-pip-last'); if ("number" == options.last) { s.addClass('ui-slider-pip-number'); } if (false == options.last) { s.addClass('ui-slider-pip-hide'); } } else { if ("number" == options.rest) { s.addClass('ui-slider-pip-number'); } if (false == options.rest) { s.addClass('ui-slider-pip-hide'); } } if (this.options.orientation == "horizontal") s.css({ left: '' + (100 / pips) * i + '%' }); else s.css({ top: '' + (100 / pips) * i + '%' }); this.element.append(s); } } }; $.extend(true, $['ui']['slider'].prototype, extensionMethods); })(jQuery); function active_modal($modal) { if ($modal.hasClass('active_modal')) { $('.overlay_modal').removeClass('active_modal'); // $("html, body").animate({ // scrollTop: 0 // }, 1500); } else { $modal.addClass('active_modal'); $modal.find('form').find('input').eq(0).focus(); $('html').addClass('modal_mobile'); } close_modal($modal); } function close_modal($obj) { var $this = $obj.find('.close'); $this.click(function() { var $modal = $this.closest('.active_modal'); $modal.removeClass('active_modal'); $('html').removeClass('modal_mobile'); }); } $(function() { $("#wrap-list-result").on('scroll',function(){ myLazyLoad.update(); }); $("#result-search, .result-search").on("click", ".view-detail", function() { var mlsNumber = $(this).parent('li').data('mls') loadPropertyInModal(mlsNumber); }); $('.property_type_checkbox').change(function(event){ var typeProperty=[],text_type=[]; $(".property_type_checkbox:checked").each(function(){ typeProperty.push($(this).val()); }); if (typeProperty.indexOf("2") != -1 ) text_type.push(word_translate.homes); if (typeProperty.indexOf("1") != -1 ) text_type.push(word_translate.condominiums); if (typeProperty.indexOf("tw") != -1 ) text_type.push(word_translate.townhouses); if (typeProperty.indexOf("mf") != -1 ) text_type.push(word_translate.multi_family); if(text_type.length==4) { $('#text-type').text(word_translate.any_type); }else if (typeProperty.length>0){ $('#text-type').text(text_type.join(', ')); }else{ $('#text-type').text(word_translate.any_type); } }); $('#result-search, .result-search').on("click", ".flex-favorite-btn", function(event) { event.stopPropagation(); event.preventDefault(); // active var buton_corazon = $(this); if (__flex_g_settings.anonymous === "yes") { //active_modal($('#modal_login')); $("#modal_login").addClass("active_modal").find('[data-tab]').removeClass('active'); $("#modal_login").addClass("active_modal").find('[data-tab]:eq(1)').addClass('active'); $("#modal_login").find(".item_tab").removeClass("active"); $("#tabRegister").addClass("active"); $("button.close-modal").addClass("ib-close-mproperty"); $(".overlay_modal").css("background-color", "rgba(0,0,0,0.8);"); $("#modal_login h2").html( $("#modal_login").find("[data-tab]:eq(1)").data("text-force")); /*Asigamos el texto personalizado*/ var titleText = $(".header-tab a[data-tab='tabRegister']").attr('data-text') $("#modal_login .modal_cm .content_md .heder_md .ms-title-modal").html(titleText); } else { // ajax favorite var class_id = $(this).parents('.propertie').data('class-id'); var mls_num = $(this).parents('.propertie').data("mls"); var property_subject = $(this).parents('.propertie').data("address"); if (!$(this).find('.clidxboost-icon-check').hasClass('active')) { //console.log('mark as favorite'); $(this).find('.clidxboost-icon-check').addClass('active'); $.ajax({ url: flex_idx_filter_params.ajaxUrl, method: "POST", data: { action: "flex_favorite", class_id: class_id, mls_num: mls_num, subject:property_subject, search_url: window.location.href, type_action: 'add' }, dataType: "json", success: function(data) { $(buton_corazon).attr("data-alert-token", data.token_alert); } }); } else { //console.log('remove from favorites'); $(this).find('.clidxboost-icon-check').removeClass('active'); var token_alert = $(this).attr("data-alert-token"); $.ajax({ url: flex_idx_filter_params.ajaxUrl, method: "POST", data: { action: "flex_favorite", class_id: class_id, mls_num: mls_num, type_action: 'remove', token_alert: token_alert }, dataType: "json", success: function(data) { //console.log(data.message); $(buton_corazon).attr("data-alert-token", ''); } }); } } }); }); if (document.getElementById('code-map') === null) { return; } // console.dir(property_items); /******** MAP BEHAVIOR ********/ var map; var markers = []; var infoWindow; var mapButtonsWrapper; var mapZoomInButton; var mapZoomOutButton; var mapDrawButton; var userIsDrawing = false; var userHasMapFigure = false; var renderedMarkers = false; var mapIsVisible = false; var polyStrokeColor = '#015288'; var polyFillColor = '#0099FF'; var hashed_properties = []; var filtered_properties = []; var unique_properties = []; var infobox_content = []; var geocode; var poly; var move; var properties = []; function initialize() { myLazyLoad = new LazyLoad({ elements_selector: ".flex-lazy-image", callback_load: function() {}, callback_error: function(element){ $(element).attr('src','https://idxboost.com/i/default_thumbnail.jpg').removeClass('error').addClass('loaded'); $(element).attr('data-origin','https://idxboost.com/i/default_thumbnail.jpg'); } }); map = new google.maps.Map( document.getElementById('code-map'), { center: new google.maps.LatLng(25.761680, -80.19179), mapTypeId: google.maps.MapTypeId.ROADMAP, zoom: 16, disableDoubleClickZoom: true, scrollwheel: false, panControl: false, streetViewControl: false, disableDefaultUI: true, clickableIcons: false, gestureHandling: ("1" == __flex_g_settings.is_mobile) ? 'greedy' : 'cooperative' }); google.maps.event.addListenerOnce(map, 'tilesloaded', setupMapControls); flex_ui_loaded = true; ib_event_mobile = true; idxboost_filter_countacti = true; filter_refresh_search(); //setupMarkers(filter_metadata.map_items); } function handleZoomInButton(event) { event.stopPropagation(); event.preventDefault(); map.setZoom(map.getZoom() + 1); } function handleZoomOutButton(event) { event.stopPropagation(); event.preventDefault(); map.setZoom(map.getZoom() - 1); } function handleDrawButton(event) { event.stopPropagation(); event.preventDefault(); if (this.classList.contains('flex-map-is-drawing')) { google.maps.event.clearListeners(map.getDiv(), "mousedown"); google.maps.event.removeListener(move); stopDrawingMap(); } else { startDrawingMap(); google.maps.event.addDomListener(map.getDiv(), "mousedown", handleMouseDown); } } function stopDrawingMap() { map.setOptions({ draggable: true, zoomControl: true }); mapDrawButton.classList.remove("flex-map-is-drawing"); userIsDrawing = false; } function startDrawingMap() { if (infoWindow.isOpen()) { infoWindow.close(); } map.setOptions({ draggable: false, zoomControl: false }); if (userHasMapFigure === true) { poly.setMap(null); } mapDrawButton.classList.add("flex-map-is-drawing"); userIsDrawing = true; } function handleMapDrawing() { if (userIsDrawing === false) { return; } poly = new google.maps.Polyline({ map: map, clickable: false, strokeColor: polyStrokeColor, strokeOpacity: 1, strokeWeight: 1 }); move = google.maps.event.addListener(map, "mousemove", handleMouseMove); google.maps.event.addListener(map, "mouseup", handleMouseUp); } function handleMouseMove(event) { poly.getPath().push(event.latLng); } function handleMouseUp(event) { google.maps.event.removeListener(move); if (userIsDrawing === false) { return; } poly.setMap(null); var path = poly.getPath(); var theArrayOfLatLng = path.getArray(); var arrayForPolygonSearch = []; var polyOptions = { map: map, fillColor: polyFillColor, fillOpacity: 0.25, strokeColor: polyStrokeColor, strokeWeight: 1, clickable: false, zIndex: 1, path: theArrayOfLatLng, editable: false }; for (var i = 0, l = theArrayOfLatLng.length; i < l; i++) { arrayForPolygonSearch.push(theArrayOfLatLng[i].lat() + " " + theArrayOfLatLng[i].lng()); } if (path.getArray().length) { arrayForPolygonSearch.push(path.getAt(0).lat() + ' ' + path.getAt(0).lng()); } poly = new google.maps.Polygon(polyOptions); poly.setMap(map); google.maps.event.clearListeners(map.getDiv(), "mousedown"); if (arrayForPolygonSearch.length) { var geometry = 'POLYGON((' + arrayForPolygonSearch.join(",") + '))'; userHasMapFigure = true; // set polygon draw // $('#idx_page').val(1); // $('#idx_polygon').val(geometry); // filter_refresh_search(); } else { userHasMapFigure = false; } stopDrawingMap(); } function handleMouseDown(event) { event.stopPropagation(); event.preventDefault(); handleMapDrawing(); } function setupMapControls() { // setup buttons wrapper mapButtonsWrapper = document.createElement("div"); mapButtonsWrapper.classList.add('flex-map-controls-ct'); // setup zoom in button mapZoomInButton = document.createElement("div"); mapZoomInButton.classList.add('flex-map-zoomIn'); mapButtonsWrapper.appendChild(mapZoomInButton); // setup zoom out button mapZoomOutButton = document.createElement("div"); mapZoomOutButton.classList.add('flex-map-zoomOut'); mapButtonsWrapper.appendChild(mapZoomOutButton); // setup draw button // mapDrawButton = document.createElement("div"); // mapDrawButton.classList.add('flex-map-draw'); // mapButtonsWrapper.appendChild(mapDrawButton); // setup listeners on buttons google.maps.event.addDomListener(mapZoomInButton, "click", handleZoomInButton); google.maps.event.addDomListener(mapZoomOutButton, "click", handleZoomOutButton); // google.maps.event.addDomListener(mapDrawButton, "click", handleDrawButton); // push controls to google map canvas map.controls[google.maps.ControlPosition.TOP_RIGHT].push(mapButtonsWrapper); } function setInitialStateSlider() { $("#wrap-result").find(".wrap-slider > ul li:first").each(function() { $(this).addClass("flex-slider-current"); }); } view_options = $(".filter-views li"); sort_options = $(".flex_idx_sort"); sort_options.on("change", function() { currentfiltemid=$(this).attr('filtemid'); var current_view = $('#filter-views li.active:eq(0)').html(); var current_sort = $(this).val(); // update hidden form $('.market_order').val(current_sort); $('.market_page').val(1); // do ajax filter_refresh_search(); // window.location.href = FILTER_PAGE_URL + "order-" + current_sort + "/view-" + current_view.toLowerCase() + "/page-1"; }); function filter_refresh_search(topElementContent) { var filter_refresh_search = parseInt(topElementContent, 10); if(filter_refresh_search > 0){ filter_refresh_search = filter_refresh_search }else{ filter_refresh_search = 0; } if (flex_ui_loaded === false) { return; } if (idxboost_filter_countacti==false) { return false; } if (ib_event_mobile==false){ return false; } var currentfiltemid = $(".flex-idx-filter-form:eq(0)").attr("filtemid"); var flex_filter_form = $('.flex-idx-filter-form-listing'); var idxboost_filter_class = flex_filter_form.attr('class'); idxboost_filter_class = '.flex-idx-filter-form-'+ currentfiltemid; var idxboostnavresult ='.idxboost-content-filter-'+currentfiltemid+' #nav-results'; var idxboostresult ='.idx-off-market-result-search'; if (flex_filter_form.length) { var flex_form_data = flex_filter_form.serialize(); if(typeof ajax_request_filter !== 'undefined') ajax_request_filter.abort(); ajax_request_filter=$.ajax({ url: flex_idx_filter_params.ajaxUrl, type: "POST", data: flex_form_data, dataType: "json", success: function(response) { if ("yes" === __flex_g_settings.anonymous) { var buildObjectFilter = { search_url: location.href, search_count: response.counter, name: response.title, search_query: response.condition }; localStorage.setItem("IB_SAVE_FILTER_PAYLOAD", JSON.stringify(buildObjectFilter)); } var items = response.items; var listingHTML = []; var paginationHTML = []; var paging = response.pagination; for (var i = 0, l = items.length; i < l; i++) { var item = response.items[i]; var text_is_rental=''; if (item.is_rental=='1') text_is_rental='/'+word_translate.month; listingHTML.push('
  • '); if (item.hasOwnProperty("status")) { if (item.status == "5") { listingHTML.push('
    '+word_translate.rented+'
    '); } else if (item.status == "2") { listingHTML.push('
    '+word_translate.sold+'
    '); } } else { if (item.recently_listed === "yes") { listingHTML.push('
    '+word_translate.new_listing+'
    '); } } listingHTML.push('

    ' + item.address + '

    '); listingHTML.push('
      '); listingHTML.push('
    • ' + item.address + '
    • '); listingHTML.push('
    • $' + _.formatPrice(item.listing_price) + text_is_rental + '
    • '); listingHTML.push('
    • ' + item.property_title + '
    • '); /* if (item.reduced == '') { listingHTML.push('
    • ' + item.reduced + '
    • '); } else if (item.reduced < 0) { listingHTML.push('
    • ' + item.reduced + '%
    • '); } else { listingHTML.push('
    • ' + item.reduced + '%
    • '); } */ var textbed = word_translate.bed; if (item.bedrooms > 1) { textbed = word_translate.beds; } else { textbed = word_translate.bed; } listingHTML.push('
    • ' + item.bedrooms + ' ' + textbed + '
    • '); var textbath = word_translate.bath; if (item.full_bathrooms > 1) { textbath = word_translate.baths; } else { textbath = word_translate.bath; } if (item.half_bath > 0) { listingHTML.push('
    • ' + item.full_bathrooms + '.5 ' + textbath + '
    • '); } else { listingHTML.push('
    • ' + item.full_bathrooms + ' ' + textbath + '
    • '); } listingHTML.push('
    • ' + _.formatPrice(item.sqft) + ' '+word_translate.sqft+'
    • '); listingHTML.push('
    • $' + item.price_sqft + ' / '+word_translate.sqft+'
    • '); if (item.development !== '') { listingHTML.push('
    • ' + item.development + '
    • '); } else if (item.complex !== '') { listingHTML.push('
    • ' + item.complex + '
    • '); } else { listingHTML.push('
    • ' + item.subdivision + '
    • '); } listingHTML.push('
    '); var totgallery=''; if (item.gallery != null && item.gallery != '' && item.gallery.length <= 1) { totgallery='no-zoom'; } listingHTML.push('
    '); listingHTML.push('
      '); for (var k = 0, m = item.gallery.length; k < m; k++) { // listingHTML.push('
    • '); if (k <= 0) { listingHTML.push('
    • '); } else { listingHTML.push('
    • '); } } listingHTML.push('
    '); if (item.gallery.length > 1) { listingHTML.push(''); listingHTML.push(''); } if (!item.hasOwnProperty("status")) { if (item.is_favorite) { listingHTML.push(''); } else { listingHTML.push(''); } } listingHTML.push('
    '); listingHTML.push(''+item.full_address+''); listingHTML.push('View Map'); listingHTML.push('
  • '); } $(idxboostresult).html(listingHTML.join("")).ready(function() { idxboostTypeIcon(); $(idxboostresult).addClass("loaded"); }); $(idxboostnavresult).html(paginationHTML.join("")); $('.flex-loading-ct').fadeIn(); var idx_param_url=[]; if (response.hasOwnProperty("only_count") && (true === response.only_count)) { var flex_filter_heading = $("#flex-idx-filter-heading_" + currentfiltemid); var flex_filter_heading_tpl = flex_filter_heading.data("heading"); flex_filter_heading_tpl = flex_filter_heading_tpl.replace(/\{\{count\}\}/, _.formatPrice(response.counter)); flex_filter_heading_tpl = flex_filter_heading_tpl.replace(/\{\{rental\}\}/, (response.info.rental_type == 1 ? " For Rent " : " For Sale ")); flex_filter_heading.find("h4").html(flex_filter_heading_tpl); } $("#search_count").val(response.counter); idxboostcondition = response.condition; if (typeof infoWindow !== 'undefined') { if (infoWindow.isOpen()) { infoWindow.close(); } } $('#wrap-list-result').show(); $('#paginator-cnt').show(); jQuery('#form-save .list-check .flex-save-type-options').removeAttr("disabled"); // reset scroll if ($('.wrap-result').hasClass('view-map')){ $('#wrap-list-result').scrollTop(0); } //removeMarkers(); //scroll top paginador $(window).scrollTop($('.clidxboost-sc-filters').offset().top); $("html, body").animate({ scrollTop: filter_refresh_search }, 0); //setupMarkers(response.items); // check lazy images myLazyLoad.update(); setInitialStateSlider(); inifil_default=5; } }); } } function idxboost_Hackedbox_cpanel() { var ib_object = jQuery('#result-search li.propertie, .result-search li.propertie'); if(idxboost_hackbox_filter.status) if (idxboost_hackbox_filter.result.content != '') if(ib_object.length<3) ib_object.eq(ib_object.length-1).after('
  • '+idxboost_hackbox_filter.result.content+'
  • '); else ib_object.eq(2).after('
  • '+idxboost_hackbox_filter.result.content+'
  • '); } function removeMarkers() { if (hashed_properties.length) { hashed_properties.length = 0; } if (filtered_properties.length) { filtered_properties.length = 0; } if (unique_properties.length) { unique_properties.length = 0; } if (markers.length) { for (var i = 0, l = markers.length; i < l; i++) { markers[i].setMap(null); } markers.length = 0; } } function setupMarkers(properties) { arrayother = properties; var bounds = new google.maps.LatLngBounds(), marker, property, row, i; infoWindow = new InfoBubble({ map: map, disableAutoPan: true, shadowStyle: 0, padding: 0, borderRadius: 0, borderWidth: 0, disableAnimation: true, maxWidth: 380 }); infoWindow.addListener("domready", function() { $(".ib-load-property-iw").on("click", function(event) { event.preventDefault(); event.stopPropagation(); var _self = $(this); var mlsNum = _self.data("mls"); if (__flex_g_settings.anonymous === 'yes') { //active_modal($('#modal_login')); $("#modal_login").addClass("active_modal").find('[data-tab]').removeClass('active'); $("#modal_login").addClass("active_modal").find('[data-tab]:eq(1)').addClass('active'); $("#modal_login").find(".item_tab").removeClass("active"); $("#tabRegister").addClass("active"); $("button.close-modal").addClass("ib-close-mproperty"); $(".overlay_modal").css("background-color", "rgba(0,0,0,0.8);"); $("#modal_login h2").html( $("#modal_login").find("[data-tab]:eq(1)").data("text-force")); /*Asigamos el texto personalizado*/ var titleText = $(".header-tab a[data-tab='tabRegister']").attr('data-text') $("#modal_login .modal_cm .content_md .heder_md .ms-title-modal").html(titleText); localStorage.setItem("ib_anon_mls", mlsNum); return; } $('html').addClass('modal_mobile'); $('#modal_property_detail').addClass('active_modal'); $("#modal_property_detail .detail-modal").html('Loading property details...'); $.ajax({ type: "POST", url: __flex_g_settings.ajaxUrl, data: { mlsNumber: mlsNum, action: "load_modal_property" }, success: function (response) { $(document.body).addClass("modal-property-active"); $("#modal_property_detail .detail-modal").html(response); }, complete: function(){ $('#full-main #clidxboost-data-loadMore-niche').trigger("click"); loadFullSlider(".clidxboost-full-slider"); } }); }); }); // reduce markers [first step] for (var i = 0, l = properties.length; i < l; i++) { row = properties[i]; geocode = row.lat + ':' + row.lng; if (_.indexOf(hashed_properties, geocode) === -1) { hashed_properties.push(geocode); filtered_properties.push(row); } } // reduce markers [second step] for (var i = 0, l = filtered_properties.length; i < l; i++) { row = filtered_properties[i]; geocode = [row.lat, row.lng]; // reset array var related_properties = []; for (var k = 0, m = properties.length; k < m; k++) { inner = properties[k]; if ((inner.lat == geocode[0]) && (inner.lng == geocode[1])) { related_properties.push(inner); } } unique_properties.push({ item: row, group: related_properties }); } // console.dir(unique_properties); for (i = 0; i < unique_properties.length; i++) { property = unique_properties[i]; marker = new RichMarker({ position: new google.maps.LatLng(parseFloat(property.item.lat), parseFloat(property.item.lng)), map: map, flat: true, draggable: false, content: (property.group.length > 1) ? '
    ' + property.group.length + 'Units
    ' : '
    $' + _.formatShortPrice(property.item.price) + '
    ', anchor: RichMarkerPosition.TOP }); marker.geocode = property.item.lat + ':' + property.item.lng; bounds.extend(marker.position); markers.push(marker); google.maps.event.addListener(marker, "click", handleMarkerClick(marker, property, map)); google.maps.event.addListener(marker, "mouseover", handleMarkerMouseOver(marker)); google.maps.event.addListener(marker, "mouseout", handleMarkerMouseOut(marker)); } if (typeof map !== "undefined") { map.fitBounds(bounds); } } function handleMarkerClick(marker, property, map) { return function() { if (property.group.length > 1) { // multiple infobox_content.push('
    '); infobox_content.push('
    '); infobox_content.push('

    ' + property.item.heading + '

    '); infobox_content.push('' + property.group.length + ''); infobox_content.push(''); infobox_content.push('
    '); infobox_content.push('
    '); for (var i = 0, l = property.group.length; i < l; i++) { var property_group = property.group[i]; infobox_content.push('
    '); infobox_content.push('

    ' + property_group.address + ''); infobox_content.push('
  • $' + _.formatPrice(property_group.price) + '
  • '); var textpropertybed = word_translate.beds; var textpropertybath = word_translate.baths; if (property_group.bed > 1) { textpropertybed = word_translate.beds; } else { textpropertybed = word_translate.bed; } if (property_group.bath > 1) { textpropertybath = word_translate.baths; } else { textpropertybath = word_translate.bath; } infobox_content.push(''); infobox_content.push('
    '); infobox_content.push('
    '); infobox_content.push('

    '); } infobox_content.push('
    '); infobox_content.push('
    '); } else { var text_is_rental=''; if (property.item.is_rental=='1') text_is_rental='/'+word_translate.month; // single infobox_content.push('
    '); infobox_content.push('
    '); infobox_content.push('

    ' + property.item.heading + '

    '); infobox_content.push(''); infobox_content.push('
    '); infobox_content.push('
    '); infobox_content.push('
    '); infobox_content.push('

    ' + property.item.address_short.replace(/# /, "#") + '

    '); infobox_content.push('
      '); infobox_content.push('
    • ' + property.item.address_large.replace(/ , /, ", ") + '
    • '); infobox_content.push('
    • $' + _.formatPrice(property.item.price)+text_is_rental + '
    • '); var textpropertyitembed = word_translate.beds; var textpropertyitembath = word_translate.baths; if (property.item.bedrooms > 1) { textpropertyitembed = word_translate.beds; } else { textpropertyitembed = word_translate.bed; } if (property.item.full_bathrooms > 1) { textpropertyitembath = word_translate.baths; } else { textpropertyitembath = word_translate.bath; } infobox_content.push('
    • ' + property.item.bedrooms + ' ' + textpropertyitembed + '
    • '); infobox_content.push('
    • ' + property.item.full_bathrooms + ' ' + textpropertyitembath + '
    • '); infobox_content.push('
    • ' + _.formatPrice(property.item.sqft) + ' Sq.Ft(' + property.item.living_size_m2 + ' m²)
    • '); infobox_content.push('
    • $' + property.item.price_sqft + ' / Sq.Ft.($' + property.item.price_sqft_m2 + ' m²)
    • '); infobox_content.push('
    '); infobox_content.push('
    '); if ( __flex_g_settings.hasOwnProperty("board_info") && __flex_g_settings.board_info.hasOwnProperty("board_logo_url") && !(["", null, undefined, "undefined", "null"].includes(__flex_g_settings.board_info.board_logo_url)) ) { infobox_content.push('' + property.item.address_short.replace(/# /, '); }else{ infobox_content.push('' + property.item.address_short.replace(/# /, '); } infobox_content.push('
    '); infobox_content.push('' + property.item.address_short.replace(/# /, "#") + ', ' + property.item.address_large.replace(/ , /, ", ") + ''); infobox_content.push('
    '); infobox_content.push('
    '); infobox_content.push('
    '); } if (infobox_content.length) { infoWindow.setContent(infobox_content.join("")); infoWindow.open(map, marker); infobox_content.length = 0; } }; } function handleMarkerMouseOver(marker) { return function() { marker.setZIndex(google.maps.Marker.MAX_ZINDEX + 1); }; } function handleMarkerMouseOut(marker) { return function() { marker.setZIndex(google.maps.Marker.MAX_ZINDEX - 1); }; } google.maps.event.addDomListener(window, 'load', initialize); $(function() { $("#filter-views").on("click", "li", function() { if ($(this).hasClass("map")) { mapIsVisible = true; setTimeout(function() { var map_center = map.getCenter(); var map_zoom = map.getZoom(); google.maps.event.trigger(map, 'resize'); if (renderedMarkers === false) { var bounds = new google.maps.LatLngBounds(); for (var i = 0, l = markers.length; i < l; i++) { bounds.extend(markers[i].position); } map.fitBounds(bounds); } else { map.setCenter(map_center); map.setZoom(map_zoom); } }, 100); } else { mapIsVisible = false; } new LazyLoad({ callback_error: function(element){ $(element).attr('src','https://idxboost.com/i/default_thumbnail.jpg').removeClass('error').addClass('loaded'); $(element).attr('data-origin','https://idxboost.com/i/default_thumbnail.jpg'); } }); }); flex_pagination = $('.nav-results'); if (flex_pagination.length) { flex_pagination.on('click', 'a', function(event) { event.preventDefault(); var currentPage = $(this).data('page'); //console.log($(this).parent('nav ul li')); currentfiltemid = $(this).parent('li').parent('ul').parent('nav').attr('filtemid'); if($(this).attr('id')=='nextn' || $(this).attr('id')=='lastp' || $(this).attr('id')=='firstp' || $(this).attr('id')=='prevn' ) { currentfiltemid=$(this).parent('nav').attr('filtemid'); } $('.nav-results-'+currentfiltemid+' ul#principal-nav li').removeClass('active'); $('.nav-results-'+currentfiltemid+' ul#principal-nav #page_' + currentPage).addClass('active'); // history.pushState(null, '', $(this).attr('norefre')); $('.flex-idx-filter-form-'+currentfiltemid+' #idx_page').val(currentPage); // do ajax //filter_refresh_search(); // filter_change_page(); var scrollTopElement = $(".clidxboost-sc-filters"); if(scrollTopElement.length){ scrollTopElement = (($(".clidxboost-sc-filters").offset().top) * 1) - 100; }else{ scrollTopElement = 0; } filter_refresh_search(scrollTopElement); }); } function update_view_page(evento) { $('#nav-results ul#principal-nav li').removeClass('active'); $('#nav-results ul#principal-nav #page_' + $(evento).attr('page')).addClass('active'); history.pushState(null, '', $(evento).attr('norefre')); $('#idx_page').val($(this).attr('page')); // filter_change_page(); } $("#result-search").on("mouseover", ">li", function(event) { if ($(this).hasClass("propertie")) { var geocodePoint = $(this).data("geocode"); if (typeof geocodePoint === 'undefined') { return; } if (!geocodePoint.length) { return; } for (var i = 0, l = markers.length; i < l; i++) { if (geocodePoint == markers[i].geocode) { new google.maps.event.trigger(markers[i], 'click'); break; } } } }); $("#result-search").on("mouseleave", ">li", function(event) { if (typeof infoWindow !== 'undefined') { if (infoWindow.isOpen()) { infoWindow.close(); } } }); var $wrapListResult = $('#wrap-list-result'); $wrapListResult.on('ps-y-reach-end', _.debounce(function() { // next page // var has_next_page = $("#flex-idx-search-form").data("next_page"); var has_next_page = filter_metadata.pagination.has_next_page; // var current_page = $("#flex-idx-search-form").data("current_page"); var current_page = filter_metadata.pagination.current_page_number; if ($('#filter-views').find('.map:eq(0)').hasClass('active') && has_next_page == true) { } }, 800)); }); if (typeof search_metadata === 'undefined') { return; } var baths_slider_values = _.pluck(search_metadata.baths_range, 'value'); var beds_slider_values = _.pluck(search_metadata.beds_range, 'value'); var sqft_slider_values = _.pluck(search_metadata.living_size_range, 'value'); var lotsize_slider_values = _.pluck(search_metadata.lot_size_range, 'value'); var year_built_slider_values = _.pluck(search_metadata.year_built_range, 'value'); var price_slider_values = _.pluck(search_metadata.price_sale_range, 'value'); var price_rent_slider_values = _.pluck(search_metadata.price_rent_range, 'value'); var baths_slider; var beds_slider; var sqft_slider; var lotsize_slider; var price_slider; var price_rent_slider; var year_built_slider; //INICIO_FORMULARIO $(function() { // DOM ready // Setup sliders $(document).on("click", "#modal_login .close-modal", function(event) { event.preventDefault(); $(".ib-pbtnclose").click(); }); $('.overlay_modal_closer').click(function(){ event.preventDefault(); $(".ib-pbtnclose").click(); }); }); var IB_SEARCH_FILTER; IB_SEARCH_FILTER= $('#flex-idx-filter-form'); $(function() { if (view_options.length) { view_options.on("click", function() { currentfiltemid=$(this).attr('filtemid'); if ($(this).hasClass("active")) { return; } var current_view = $(this).html().toLowerCase(); var current_sort = sort_options.val(); }); } flex_ui_loaded = true; }); })(jQuery); (function($) { $(function() { if (typeof myLazyLoad === 'undefined') { myLazyLoad = new LazyLoad({ elements_selector: ".flex-lazy-image", callback_load: function() {}, callback_error: function(element){ $(element).attr('src','https://idxboost.com/i/default_thumbnail.jpg').removeClass('error').addClass('loaded'); $(element).attr('data-origin','https://idxboost.com/i/default_thumbnail.jpg'); } }); } $(document).on("click", ".flex-slider-prev", function(event) { event.stopPropagation(); var node = $(this).prev().find('li.flex-slider-current'); var index = node.index(); var total = $(this).prev().find('li').length; index = (index === 0) ? (total - 1) : (index - 1); $(this).prev().find('li').removeClass('flex-slider-current'); $(this).prev().find('li').addClass('flex-slider-item-hidden'); $(this).prev().find('li').eq(index).removeClass('flex-slider-item-hidden').addClass('flex-slider-current'); myLazyLoad.update(); }); $(document).on("click", ".flex-slider-next", function(event) { event.stopPropagation(); var node = $(this).prev().prev().find('li.flex-slider-current'); var index = node.index(); var total = $(this).prev().prev().find('li').length; if (index >= (total - 1)) { index = 0; } else { index = index + 1; } // index = (index >= (total - 1)) ? 0 : (index + 1); $(this).prev().prev().find('li').removeClass('flex-slider-current'); $(this).prev().prev().find('li').addClass('flex-slider-item-hidden'); $(this).prev().prev().find('li').eq(index).removeClass('flex-slider-item-hidden').addClass('flex-slider-current'); myLazyLoad.update(); }); }); })(jQuery); defined('ABSPATH') or exit; mc4wp_register_integration('gravity-forms', 'MC4WP_Gravity_Forms_Integration', true); add_action('plugins_loaded', function () { if (class_exists('GF_Fields')) { GF_Fields::register(new MC4WP_Gravity_Forms_Field()); } }); mc4wp_register_integration('ninja-forms', 'MC4WP_Ninja_Forms_Integration', true); add_filter('ninja_forms_register_fields', function ($fields) { if (class_exists(NF_Abstracts_Input::class)) { $fields['mc4wp_optin'] = new MC4WP_Ninja_Forms_Field(); } return $fields; }); add_filter('ninja_forms_register_actions', function ($actions) { if (class_exists(NF_Abstracts_Action::class)) { $actions['mc4wp_subscribe'] = new MC4WP_Ninja_Forms_Action(); } return $actions; }); //Post views counter function stm_single_post_counter() { if ( is_singular('post') || is_singular('listing') ) { $cookies = ''; if ( empty( $_COOKIE['stm_post_watched'] ) ) { $cookies = get_the_ID(); setcookie( 'stm_post_watched', $cookies, time() + (86400 * 30), '/' ); stm_increase_views( get_the_ID() ); } if ( !empty( $_COOKIE['stm_post_watched'] ) ) { $cookies = $_COOKIE['stm_post_watched']; $cookies = explode( ',', $cookies ); if ( !in_array( get_the_ID(), $cookies ) ) { $cookies[] = get_the_ID(); $cookies = implode( ',', $cookies) ; stm_increase_views( get_the_ID() ); setcookie( 'stm_post_watched', $cookies, time() + (86400 * 30), '/' ); } } if ( !empty( $_COOKIE['stm_post_watched'] ) ) { $watched = explode( ',', $_COOKIE['stm_post_watched'] ); } } } function stm_increase_views( $post_id ) { $keys = array( 'stm_post_views', 'stm_day_' . date( 'j' ), 'stm_month_' . date( 'm' ) ); foreach ( $keys as $key ) { $current_views = intval( get_post_meta( $post_id, $key, true ) ); $new_views = ( !empty( $current_views ) ) ? $current_views + 1 : 1; update_post_meta( $post_id, $key, $new_views ); } } add_action('wp', 'stm_single_post_counter', 100, 1); __( 'Desktop', 'elementor' ); __( 'Switch Device', 'elementor' ); // translators: %s: Breakpoint label, %d: Breakpoint size. __( '%s (%dpx and up)', 'elementor' ); // translators: %s: Breakpoint label, %d: Breakpoint size. __( '%s (up to %dpx)', 'elementor' ); Azure Buyer's Agent

    You deserve the best of Cyprus.

    And we have it on our website. From cozy apartments to spacious villas,
    we have the perfect property for you to find your slice of paradise on Cyprus.

    Explore the Neighborhoods

    Cleveland
    Cleveland
    Listings: 2
    Price: $2,500 - $880,000
    Las Vegas
    Las Vegas
    Listings: 2
    Price: $840 - $134,000
    Los Angeles
    Los Angeles
    Listings: 3
    Price: $1,500 - $120,000
    Philadelphia
    Philadelphia
    Listings: 5
    Price: $345 - $108,000
    Sacramento
    Sacramento
    Listings: 2
    Price: $1,450 - $108,000
    San Diego
    San Diego
    Listings: 1
    Price: $45,000
    San Francisco
    San Francisco
    Listings: 2
    Price: $1,600 - $28,000
    San Jose
    San Jose
    Listings: 2
    Price: $2,600 - $24,000

    Featured Properties

    1,300+ Available Properties

    Recent Properties for Rent

    All Properties for Rent

    Rent
    19
    $1,200/mo
    /** * Builder element quick view * * Template can be modified by copying it to yourtheme/ulisting/builder/element/quickview.php. * * @see # * @package uListing/Templates * @version 1.5.7 */ $element['params']['class'] = "qview"; $element['params']['class'] .= " ".$element['params']['style_template']; ?>
    Quick View

    3
    2
    2766
    2
    Rent
    19
    $1,500/mo
    /** * Builder element quick view * * Template can be modified by copying it to yourtheme/ulisting/builder/element/quickview.php. * * @see # * @package uListing/Templates * @version 1.5.7 */ $element['params']['class'] = "qview"; $element['params']['class'] .= " ".$element['params']['style_template']; ?>
    Quick View

    2
    1
    2013
    1
    Rent
    19
    $1,600/mo
    /** * Builder element quick view * * Template can be modified by copying it to yourtheme/ulisting/builder/element/quickview.php. * * @see # * @package uListing/Templates * @version 1.5.7 */ $element['params']['class'] = "qview"; $element['params']['class'] .= " ".$element['params']['style_template']; ?>
    Quick View

    3
    2
    2013
    2
    Rent
    19
    $4,500/mo
    $3,600/mo
    /** * Builder element quick view * * Template can be modified by copying it to yourtheme/ulisting/builder/element/quickview.php. * * @see # * @package uListing/Templates * @version 1.5.7 */ $element['params']['class'] = "qview"; $element['params']['class'] .= " ".$element['params']['style_template']; ?>
    Quick View

    4
    2
    1992
    2

    Properties by Cities

    Philadelphia
    13 Properties
    Las Vegas
    8 Properties
    San Francisco
    8 Properties
    Sacramento
    7 Properties

    Why Choose Us

    Trusted by Thousands

    10 new offers every day. 350 offers on site, trusted by a community of thousands of users.

    Wide Range of Properties

    With a robust selection of popular properties on hand, as well as leading properties from real estate experts.

    Financing Made Easy

    Our stress-free finance department that can find financial solutions to save you money.

    Become a Real Estate Agent

    Our Partners

    $footer_type = (defined('HFE_VER')) ? 'elementor' : 'default'; get_template_part('partials/footer/footer', $footer_type);