Changeset 3367368
- Timestamp:
- 09/24/2025 06:17:22 PM (5 months ago)
- Location:
- flexmls-idx/trunk
- Files:
-
- 1 added
- 14 edited
-
Admin/NginxCompatibility.php (added)
-
Admin/Settings.php (modified) (3 diffs)
-
README.txt (modified) (2 diffs)
-
assets/js/blocks.js (modified) (1 diff)
-
assets/js/tinymce_plugin.js (modified) (1 diff)
-
flexmls_connect.php (modified) (9 diffs)
-
integration/divi/divi.php (modified) (3 diffs)
-
integration/divi/includes/FMCD_module.php (modified) (2 diffs)
-
integration/wpbakery/components/VCE_component.php (modified) (1 diff)
-
lib/base.php (modified) (2 diffs)
-
lib/flexmlsAPI/Core.php (modified) (2 diffs)
-
lib/gutenberg.php (modified) (3 diffs)
-
lib/settings-page.php (modified) (1 diff)
-
views/admin-settings-behavior.php (modified) (3 diffs)
-
views/admin-settings-cache.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
flexmls-idx/trunk/Admin/Settings.php
r3325113 r3367368 12 12 ?> 13 13 <div class="wrap about-wrap about-flexmls"> 14 15 <?php 16 // Display nginx warning if nginx is detected 17 \FlexMLS\Admin\NginxCompatibility::display_nginx_warning(); 18 19 // Always show debug info for administrators (even if nginx not detected) 20 if ( current_user_can( 'manage_options' ) ) { 21 $server_info = \FlexMLS\Admin\NginxCompatibility::get_server_info(); 22 $debug_enabled = defined( 'WP_DEBUG' ) && WP_DEBUG; 23 ?> 24 <?php if ( \FlexMLS\Admin\NginxCompatibility::is_nginx() ): ?> 25 <div style="background: #fff3cd; padding: 15px; margin: 10px 0; border: 1px solid #ffeaa7; border-radius: 4px;"> 26 <details> 27 <summary><h4 style="display: inline; margin: 0;">⚠️ nginx Configuration Required</h4></summary> 28 <div style="margin-top: 15px;"> 29 <p><strong>Your WordPress site is running on nginx.</strong> To ensure the Flexmls IDX plugin works correctly, you need to add the following rewrite rules to your nginx configuration file.</p> 30 31 <details style="margin: 15px 0;"> 32 <summary><strong>Required nginx Configuration</strong></summary> 33 <div style="margin-top: 10px;"> 34 <p>Add these rules to your nginx server block configuration file (usually located at <code>/etc/nginx/sites-available/your-site</code> or similar):</p> 35 <div style="position: relative;"> 36 <textarea id="nginx-config" readonly style="width: 100%; height: 300px; font-family: monospace; font-size: 12px; background: #fff; border: 1px solid #ddd; padding: 10px;"><?php 37 $rules = \FlexMLS\Admin\NginxCompatibility::get_nginx_rewrite_rules(); 38 echo esc_textarea( implode( "\n", $rules ) ); 39 ?></textarea> 40 <button type="button" onclick="copyNginxConfig()" style="position: absolute; top: 10px; right: 10px; background: #0073aa; color: white; border: none; padding: 8px 12px; border-radius: 3px; cursor: pointer; font-size: 12px;">Copy</button> 41 </div> 42 <script> 43 function copyNginxConfig() { 44 const textarea = document.getElementById('nginx-config'); 45 textarea.select(); 46 textarea.setSelectionRange(0, 99999); // For mobile devices 47 document.execCommand('copy'); 48 49 // Show feedback 50 const button = event.target; 51 const originalText = button.textContent; 52 button.textContent = 'Copied!'; 53 button.style.background = '#28a745'; 54 setTimeout(function() { 55 button.textContent = originalText; 56 button.style.background = '#0073aa'; 57 }, 2000); 58 } 59 </script> 60 </div> 61 </details> 62 63 <div style="background: #fff3cd; padding: 15px; margin: 10px 0; border: 1px solid #ffeaa7; border-radius: 4px;"> 64 <h4>⚠️ Important Steps:</h4> 65 <ol> 66 <li><strong>Add the rules above</strong> to your nginx configuration file</li> 67 <li><strong>Test your nginx configuration</strong> with: <code>nginx -t</code></li> 68 <li><strong>Reload nginx</strong> with: <code>systemctl reload nginx</code> or <code>service nginx reload</code></li> 69 <li><strong>Clear any caching</strong> (if you use caching plugins)</li> 70 </ol> 71 </div> 72 73 <div style="background: #d1ecf1; padding: 15px; margin: 10px 0; border: 1px solid #bee5eb; border-radius: 4px;"> 74 <h4>💡 Need Help?</h4> 75 <p>If you're not comfortable editing nginx configuration files, please <strong>contact your website hosting provider or system administrator</strong> for assistance. They can help you add these rewrite rules to your nginx configuration.</p> 76 </div> 77 </div> 78 </details> 79 </div> 80 <?php endif; ?> 81 <?php 82 } 83 ?> 14 84 15 85 <div class="intro-banner"> … … 296 366 $do_flush_rewrites = false; 297 367 $old_permabase = $fmc_settings[ 'permabase' ]; 368 $old_destlink = $fmc_settings[ 'destlink' ]; 298 369 foreach( $_POST[ 'fmc_settings' ] as $key => $val ){ 299 370 switch( $key ){ … … 354 425 $fmc_settings[ 'permabase' ] = 'idx'; 355 426 } 427 // Check for changes that require nginx configuration updates 428 $nginx_config_changed = false; 429 356 430 if( $old_permabase != $fmc_settings[ 'permabase' ] ){ 357 add_action( 'shutdown', 'flush_rewrite_rules' ); 431 // Set transient to indicate permalink base was recently changed 432 set_transient( 'fmc_permabase_changed', time(), 300 ); // 5 minutes 433 $nginx_config_changed = true; 434 } 435 436 if( $old_destlink != $fmc_settings[ 'destlink' ] ){ 437 // Set transient to indicate destination page was recently changed 438 set_transient( 'fmc_destlink_changed', time(), 300 ); // 5 minutes 439 $nginx_config_changed = true; 440 } 441 442 if( $nginx_config_changed ){ 443 // Use nginx-compatible rewrite rule handling 444 if( \FlexMLS\Admin\NginxCompatibility::is_nginx() ) { 445 // For nginx, we don't flush rewrite rules as they need to be configured in nginx config 446 // The rules are still added to WordPress for URL generation 447 } else { 448 add_action( 'shutdown', 'flush_rewrite_rules' ); 449 } 358 450 } 359 451 add_action( 'admin_notices', array( '\FlexMLS\Admin\Settings', 'did_update_settings' ) ); -
flexmls-idx/trunk/README.txt
r3363339 r3367368 3 3 Contributors: flexmls 4 4 Requires at least: 5.0 5 Tested up to: 6.8 5 Tested up to: 6.8.2 6 6 Requires PHP: 7.4 7 Stable tag: 3.15. 27 Stable tag: 3.15.3 8 8 9 9 Add Flexmls® IDX listings, market statistics, IDX searches, and a contact form on your web site. … … 86 86 87 87 == Changelog == 88 = 3.15.3 = 89 New Feature 90 * Added nginx permalink configuration info to credential and behavior setting pages 88 91 89 92 = 3.15.2 = -
flexmls-idx/trunk/assets/js/blocks.js
r2564556 r3367368 1 !function(e){function t(l){if(n[l])return n[l].exports;var i=n[l]={i:l,l:!1,exports:{}};return e[l].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,l){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:l})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(4),i=(n.n(l),wp.element.createElement),a=wp.blocks.registerBlockType,r=wp.components.ServerSideRender,o=wp.blockEditor.InspectorControls,s=function(){return wp.element.createElement(l.SVG,{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",class:"flex-gtb-icon"},wp.element.createElement(l.Path,{fill:"#4c75ba",d:"m94.024831,43.436709c0,14.114243 -6.789013,26.602533 -17.229692,34.460554l0.077148,0l-25.732598,21.522371l-25.729572,-21.534449l0.078661,0c-10.440679,-7.858021 -17.23423,-20.34631 -17.23423,-34.448476c0,-23.785421 19.196206,-43.073427 42.882116,-43.073427s42.888167,19.277438 42.888167,43.073427zm-42.764125,-37.575077c-20.421496,0 -36.973497,16.519205 -36.973497,36.898729s16.553513,36.898729 36.973497,36.898729s36.971984,-16.520715 36.971984,-36.898729s-16.553513,-36.898729 -36.971984,-36.898729z"}),wp.element.createElement(l.G,null,wp.element.createElement(l.Path,{fill:"#4c75ba",d:"m54.946207,60.811669a0.186312,0.197873 0 0 1 -0.186312,-0.197873l0,-15.59238a0.186312,0.197873 0 0 0 -0.186312,-0.197873l-6.317828,0a0.186312,0.197873 0 0 0 -0.186312,0.197873l-0.031673,15.554784a0.186312,0.197873 0 0 1 -0.186312,0.197873l-13.097708,0a0.186312,0.197873 0 0 1 -0.186312,-0.197873l0.117376,-20.8835a0.186312,0.197873 0 0 0 -0.186312,-0.197873l-6.315964,0c-0.102471,0 -0.122966,-0.057383 -0.044715,-0.128617l23.134316,-21.059607a0.223574,0.237447 0 0 1 0.283194,0l23.134316,21.059607c0.078251,0.071234 0.057757,0.128617 -0.044715,0.128617l-6.317828,0a0.186312,0.197873 0 0 0 -0.186312,0.197873l0,20.921096a0.186312,0.197873 0 0 1 -0.186312,0.197873l-13.008278,0z"})))},c=function(e,t,n){t.preventDefault();var l=flexGtb.getWidgetValue();if(l.widget_version)e({sendData:l,firstInitialization:!1});else{var i=flexGtb.getInspectorHtml(n);e("empty"!=l?{inspectorHtml:i,sendData:l,firstInitialization:!1}:{inspectorHtml:i,firstInitialization:!1})}},m=function(e){return e.firstInitialization||e.sendData&&e.sendData.widget_version},u=function(e,t,n){var l;return e?(l=n,t.sendData&&(l=flexGtb.getSettingsHtmlWithAttributes(l,t))):(l=t.inspectorHtml&&t.inspectorHtml.length>0?t.inspectorHtml:flexGtbData.htmlSearch,l=flexGtb.removeJsChanges(l)),l},p=function(e){var t=[];return jQuery(e).each(function(){t.push(jQuery(this).wrapAll("<div>").parent().html())}),t},f=function(e){return e.firstInitialization?"<img src id='imFirstLoad"+e.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>":""},d=function(e){return"<img src id='im"+1e4*Math.random()+"' onerror='"+e+"'>"};a("flex/market-stats",{title:"Market Statistics",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorMarketStats"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes,a=(i(r,{block:"flex/marketStats",attributes:n}),n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlMarketStats);a="<div>"+a+"</div>";var s=jQuery(a);s.find(".select2").remove(),a=s.html();var c="";n.firstInitialization&&(c="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>");var m="<img src id='im"+1e4*Math.random()+"' onerror='new AdminLocationSearch(\".inspectorMarketStats\");'>";return[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorMarketStats")}},wp.element.createElement("div",{class:"inspectorMarketStats",dangerouslySetInnerHTML:{__html:a}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:m},class:"eventImage"}),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:c},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"Flex MLS Market Statistics widget"))]},save:function(e){return null}}),a("flex/search",{title:"IDX Search",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){var t=e.attributes,n=e.setAttributes,l=m(t),i=flexGtbData.htmlSearch,a=u(l,t,i),r=function(){return flexGtb.panelOnLoad("inspectorSearch")},s=p(a),g=s.map(function(e){return wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:e}})}),b=f(t),v=d("flexGtb.colorPickerInit()");return[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return c(n,e,"inspectorSearch")},onFocus:l?"":r},l?g:wp.element.createElement("div",{class:"inspectorSearch",dangerouslySetInnerHTML:{__html:a}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:v},class:"eventImage"}),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:b},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"FlexMLS IDX Search widget"))]},save:function(e){return null}}),a("flex/location-links",{title:"1-Click Location Searches",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorLocationLinks"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes,i=n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlLocationLinks,a="";n.firstInitialization&&(a="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>");var r="<img src id='im"+1e4*Math.random()+"' onerror='flexGtb.locationsInit(\"inspectorLocationLinks\");'>";return[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorLocationLinks")}},wp.element.createElement("div",{class:"inspectorLocationLinks",dangerouslySetInnerHTML:{__html:i}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:r},class:"eventImage"}),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:a},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"FlexMLS 1-Click Location Searches"))]},save:function(e){return null}}),a("flex/idx-links-widget",{title:"1-Click Custom Searches",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorIDXLinksWidget"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes,i=n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlIDXLinksWidget,a="";return n.firstInitialization&&(a="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>"),[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorIDXLinksWidget")}},wp.element.createElement("div",{class:"inspectorIDXLinksWidget",dangerouslySetInnerHTML:{__html:i}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:a},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"FlexMLS 1-Click Custom Searches widget"))]},save:function(e){return null}}),a("flex/leadgen",{title:"Contact Me Form",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){try{var t=flexGtb.getInspectorHtml("inspectorLeadgen"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1})}catch(e){console.log(e)}finally{e.preventDefault()}}var n=e.attributes,l=e.setAttributes,i=n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlLeadgen,a="";return n.firstInitialization&&(a="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>"),[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorLeadgen")}},wp.element.createElement("div",{class:"inspectorLeadgen",dangerouslySetInnerHTML:{__html:i}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:a},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"FlexMLS Contact Me Form"))]},save:function(e){return null}}),a("flex/search-results",{title:"IDX Listing Summary",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){var t=e.attributes,n=e.setAttributes,l="inspectorSearchResults",i=m(t),a=flexGtbData.htmlSearchResults,r=u(i,t,a),s=function(){return flexGtb.panelOnLoad(l)},g=p(r),b=g.map(function(e){return wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:e}})}),v=f(t),I=i?'flexGtb.locationsInit("flexmls-v2-widget-wrapper");flexGtb.toggledInputsInit()':'flexGtb.locationsInit("inspectorSearchResults")',h=d(I);return[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return c(n,e,l)},onFocus:i?"":s},i?b:wp.element.createElement("div",{class:l,dangerouslySetInnerHTML:{__html:r}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:h},class:"eventImage"}),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:v},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"FlexMLS IDX Listing Summary widget"))]},save:function(e){return null}}),a("flex/photos",{title:"IDX Slideshow",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorPhotos"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes,a=(e.className,e.isSelected,i(r,{block:"flex/photos",attributes:n}),n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlPhotos);a="<div>"+a+"</div>";var s=jQuery(a);s.find(".select2").remove(),a=s.html();var c="";n.firstInitialization&&(c="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>");var m="<img src id='im"+1e4*Math.random()+"' onerror='new AdminLocationSearch(\".inspectorPhotos\");'>";return[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorPhotos")}},wp.element.createElement("div",{class:"inspectorPhotos",dangerouslySetInnerHTML:{__html:a}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:m},class:"eventImage"}),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:c},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"FlexMLS IDX Slideshow widget"))]},save:function(e){return null}}),a("flex/listing-details",{title:"IDX Listing Details",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},widgetName:{type:"string"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorListingDetails"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes;n.widgetName||(n.widgetName="listing-details");var a=(i(r,{block:"flex/listing-details",attributes:n}),n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlListingDetails),s="";return n.firstInitialization&&(s="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>"),[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorListingDetails")}},wp.element.createElement("div",{class:"inspectorListingDetails",dangerouslySetInnerHTML:{__html:a}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:s},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"Flexmls IDX Listing Details widget"))]},save:function(e){return null}}),a("flex/account",{title:"Log in",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorAccount"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes,i=n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlAccount,a="";return n.firstInitialization&&(a="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>"),[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorAccount")}},wp.element.createElement("div",{class:"inspectorAccount",dangerouslySetInnerHTML:{__html:i}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:a},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"FlexMLS Log in widget"))]},save:function(e){return null}}),a("flex/agents",{title:"IDX Agent List",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorAgents"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes,i=n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlAgents,a="";return n.firstInitialization&&(a="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorAgents\");'>"),[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorAgents")}},wp.element.createElement("div",{class:"inspectorAgents",dangerouslySetInnerHTML:{__html:i}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:a},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"FlexMLSIDX Agent List widget"))]},save:function(e){return null}})},function(e,t){e.exports=wp.components}]);1 !function(e){function t(l){if(n[l])return n[l].exports;var i=n[l]={i:l,l:!1,exports:{}};return e[l].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,l){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:l})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(4),i=(n.n(l),wp.element.createElement),a=wp.blocks.registerBlockType,r=wp.components.ServerSideRender,o=wp.blockEditor.InspectorControls,s=function(){return wp.element.createElement(l.SVG,{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",class:"flex-gtb-icon"},wp.element.createElement(l.Path,{fill:"#4c75ba",d:"m94.024831,43.436709c0,14.114243 -6.789013,26.602533 -17.229692,34.460554l0.077148,0l-25.732598,21.522371l-25.729572,-21.534449l0.078661,0c-10.440679,-7.858021 -17.23423,-20.34631 -17.23423,-34.448476c0,-23.785421 19.196206,-43.073427 42.882116,-43.073427s42.888167,19.277438 42.888167,43.073427zm-42.764125,-37.575077c-20.421496,0 -36.973497,16.519205 -36.973497,36.898729s16.553513,36.898729 36.973497,36.898729s36.971984,-16.520715 36.971984,-36.898729s-16.553513,-36.898729 -36.971984,-36.898729z"}),wp.element.createElement(l.G,null,wp.element.createElement(l.Path,{fill:"#4c75ba",d:"m54.946207,60.811669a0.186312,0.197873 0 0 1 -0.186312,-0.197873l0,-15.59238a0.186312,0.197873 0 0 0 -0.186312,-0.197873l-6.317828,0a0.186312,0.197873 0 0 0 -0.186312,0.197873l-0.031673,15.554784a0.186312,0.197873 0 0 1 -0.186312,0.197873l-13.097708,0a0.186312,0.197873 0 0 1 -0.186312,-0.197873l0.117376,-20.8835a0.186312,0.197873 0 0 0 -0.186312,-0.197873l-6.315964,0c-0.102471,0 -0.122966,-0.057383 -0.044715,-0.128617l23.134316,-21.059607a0.223574,0.237447 0 0 1 0.283194,0l23.134316,21.059607c0.078251,0.071234 0.057757,0.128617 -0.044715,0.128617l-6.317828,0a0.186312,0.197873 0 0 0 -0.186312,0.197873l0,20.921096a0.186312,0.197873 0 0 1 -0.186312,0.197873l-13.008278,0z"})))},c=function(e,t,n){t.preventDefault();var l=flexGtb.getWidgetValue();if(l.widget_version)e({sendData:l,firstInitialization:!1});else{var i=flexGtb.getInspectorHtml(n);e("empty"!=l?{inspectorHtml:i,sendData:l,firstInitialization:!1}:{inspectorHtml:i,firstInitialization:!1})}},m=function(e){return e.firstInitialization||e.sendData&&e.sendData.widget_version},u=function(e,t,n){var l;return e?(l=n,t.sendData&&(l=flexGtb.getSettingsHtmlWithAttributes(l,t))):(l=t.inspectorHtml&&t.inspectorHtml.length>0?t.inspectorHtml:flexGtbData.htmlSearch,l=flexGtb.removeJsChanges(l)),l},p=function(e){var t=[];return jQuery(e).each(function(){t.push(jQuery(this).wrapAll("<div>").parent().html())}),t},f=function(e){return e.firstInitialization?"<img src id='imFirstLoad"+e.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>":""},d=function(e){return"<img src id='im"+1e4*Math.random()+"' onerror='"+e+"'>"};a("flex/market-stats",{title:"Market Statistics",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorMarketStats"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes,a=(i(r,{block:"flex/marketStats",attributes:n}),n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlMarketStats);a="<div>"+a+"</div>";var s=jQuery(a);s.find(".select2").remove(),a=s.html();var c="";n.firstInitialization&&(c="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>");var m="<img src id='im"+1e4*Math.random()+"' onerror='new AdminLocationSearch(\".inspectorMarketStats\");'>";return[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorMarketStats")}},wp.element.createElement("div",{class:"inspectorMarketStats",dangerouslySetInnerHTML:{__html:a}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:m},class:"eventImage"}),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:c},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"Flexmls Market Statistics widget"))]},save:function(e){return null}}),a("flex/search",{title:"IDX Search",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){var t=e.attributes,n=e.setAttributes,l=m(t),i=flexGtbData.htmlSearch,a=u(l,t,i),r=function(){return flexGtb.panelOnLoad("inspectorSearch")},s=p(a),g=s.map(function(e){return wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:e}})}),b=f(t),v=d("flexGtb.colorPickerInit()");return[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return c(n,e,"inspectorSearch")},onFocus:l?"":r},l?g:wp.element.createElement("div",{class:"inspectorSearch",dangerouslySetInnerHTML:{__html:a}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:v},class:"eventImage"}),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:b},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"Flexmls IDX Search widget"))]},save:function(e){return null}}),a("flex/location-links",{title:"1-Click Location Searches",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorLocationLinks"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes,i=n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlLocationLinks,a="";n.firstInitialization&&(a="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>");var r="<img src id='im"+1e4*Math.random()+"' onerror='flexGtb.locationsInit(\"inspectorLocationLinks\");'>";return[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorLocationLinks")}},wp.element.createElement("div",{class:"inspectorLocationLinks",dangerouslySetInnerHTML:{__html:i}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:r},class:"eventImage"}),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:a},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"Flexmls 1-Click Location Searches"))]},save:function(e){return null}}),a("flex/idx-links-widget",{title:"1-Click Custom Searches",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorIDXLinksWidget"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes,i=n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlIDXLinksWidget,a="";return n.firstInitialization&&(a="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>"),[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorIDXLinksWidget")}},wp.element.createElement("div",{class:"inspectorIDXLinksWidget",dangerouslySetInnerHTML:{__html:i}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:a},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"Flexmls 1-Click Custom Searches widget"))]},save:function(e){return null}}),a("flex/leadgen",{title:"Contact Me Form",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){try{var t=flexGtb.getInspectorHtml("inspectorLeadgen"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1})}catch(e){console.log(e)}finally{e.preventDefault()}}var n=e.attributes,l=e.setAttributes,i=n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlLeadgen,a="";return n.firstInitialization&&(a="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>"),[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorLeadgen")}},wp.element.createElement("div",{class:"inspectorLeadgen",dangerouslySetInnerHTML:{__html:i}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:a},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"Flexmls Contact Me Form"))]},save:function(e){return null}}),a("flex/search-results",{title:"IDX Listing Summary",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){var t=e.attributes,n=e.setAttributes,l="inspectorSearchResults",i=m(t),a=flexGtbData.htmlSearchResults,r=u(i,t,a),s=function(){return flexGtb.panelOnLoad(l)},g=p(r),b=g.map(function(e){return wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:e}})}),v=f(t),I=i?'flexGtb.locationsInit("flexmls-v2-widget-wrapper");flexGtb.toggledInputsInit()':'flexGtb.locationsInit("inspectorSearchResults")',h=d(I);return[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return c(n,e,l)},onFocus:i?"":s},i?b:wp.element.createElement("div",{class:l,dangerouslySetInnerHTML:{__html:r}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:h},class:"eventImage"}),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:v},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"Flexmls IDX Listing Summary widget"))]},save:function(e){return null}}),a("flex/photos",{title:"IDX Slideshow",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorPhotos"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes,a=(e.className,e.isSelected,i(r,{block:"flex/photos",attributes:n}),n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlPhotos);a="<div>"+a+"</div>";var s=jQuery(a);s.find(".select2").remove(),a=s.html();var c="";n.firstInitialization&&(c="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>");var m="<img src id='im"+1e4*Math.random()+"' onerror='new AdminLocationSearch(\".inspectorPhotos\");'>";return[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorPhotos")}},wp.element.createElement("div",{class:"inspectorPhotos",dangerouslySetInnerHTML:{__html:a}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:m},class:"eventImage"}),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:c},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"Flexmls IDX Slideshow widget"))]},save:function(e){return null}}),a("flex/listing-details",{title:"IDX Listing Details",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},widgetName:{type:"string"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorListingDetails"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes;n.widgetName||(n.widgetName="listing-details");var a=(i(r,{block:"flex/listing-details",attributes:n}),n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlListingDetails),s="";return n.firstInitialization&&(s="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>"),[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorListingDetails")}},wp.element.createElement("div",{class:"inspectorListingDetails",dangerouslySetInnerHTML:{__html:a}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:s},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"Flexmls IDX Listing Details widget"))]},save:function(e){return null}}),a("flex/account",{title:"Log in",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorAccount"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes,i=n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlAccount,a="";return n.firstInitialization&&(a="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorLeadgen\");'>"),[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorAccount")}},wp.element.createElement("div",{class:"inspectorAccount",dangerouslySetInnerHTML:{__html:i}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:a},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"Flexmls Log in widget"))]},save:function(e){return null}}),a("flex/agents",{title:"IDX Agent List",icon:s,category:"flex",attributes:{sendData:{type:"object"},inspectorHtml:{type:"html"},className:{type:"object"},firstInitializationId:{type:"string",default:"i"+Math.floor(1e4*Math.random())},firstInitialization:{type:"boolean",default:!0}},edit:function(e){function t(e){var t=flexGtb.getInspectorHtml("inspectorAgents"),n=flexGtb.getWidgetValue();l("empty"!=n?{inspectorHtml:t,sendData:n,firstInitialization:!1}:{inspectorHtml:t,firstInitialization:!1}),e.preventDefault()}var n=e.attributes,l=e.setAttributes,i=n.inspectorHtml&&n.inspectorHtml.length>0?n.inspectorHtml:flexGtbData.htmlAgents,a="";return n.firstInitialization&&(a="<img src id='imFirstLoad"+n.firstInitializationId+"' onerror='flexGtb.firstLoad(\"inspectorAgents\");'>"),[wp.element.createElement(o,null,wp.element.createElement("form",{onSubmit:function(e){return t(e)},onFocus:function(){return flexGtb.panelOnLoad("inspectorAgents")}},wp.element.createElement("div",{class:"inspectorAgents",dangerouslySetInnerHTML:{__html:i}}),wp.element.createElement("button",{class:"inspectorSaveButton"},"Save"),wp.element.createElement("div",{dangerouslySetInnerHTML:{__html:a},class:"eventImage"}))),wp.element.createElement("div",{class:"flex-mls-gtb-block"},wp.element.createElement("div",null),wp.element.createElement("h3",null,"Flexmls IDX Agent List widget"))]},save:function(e){return null}})},function(e,t){e.exports=wp.components}]); -
flexmls-idx/trunk/assets/js/tinymce_plugin.js
r2772139 r3367368 1 !function(t){function e(n){if(o[n])return o[n].exports;var i=o[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var o={};e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=11)}([function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),o.d(e,"LocationSearch",function(){return n});var n=function(t){function e(e,o){return this.$element=t(e),"undefined"===typeof o&&(o={}),this.omniSearchUrl="//apps.flexmls.com/quick_launch/omni",this.portalSlug=o.portalSlug,this.init(),this}return e.prototype={constructor:e,init:function(){var e=this;this.s2=t(this.$element).select2({ajax:{url:e.omniSearchUrl,dataType:"jsonp",quietMillis:500,data:e.ajaxData.bind(e),processResults:e.processAjaxResults.bind(e),cache:!0},placeholder:"Enter an Address, City, Zip or MLS#",minimumInputLength:3,formatInputTooShort:function(t,e){return"Please enter "+(e-t.length)+" or more characters"}})},selectedValues:function(){var e=t(this.$element).select2("data"),o=[];return Array.isArray(e)||(e=[e]),e.forEach(function(t){o.push({id:t.id,text:t.text,fieldName:t.id.split("_")[0],value:t.id.split("_")[1]})}),o},ajaxData:function(t){var e={_q:t.term,_lo:!1};return"undefined"!==typeof this.portalSlug&&(e.portal_slug=this.portalSlug),e},processAjaxResults:function(t,e){var o=this,n=[];return t.D.Results.forEach(function(t){var e,i,c,a,r;"Field"==t.Type?(e=t.Field.Id,i=t.Field.Name,c="",a=t.Field.Value,r=t.Field.SparkQl):"Listing"==t.Type&&(e="ListingId",i=t.Listing.Name,c=t.Listing.Address,a=t.Listing.Number,r=t.Listing.SparkQl),a&&n.push({id:e+"_"+a,text:o.getDisplayText(e,c,a,i),fieldName:e,value:a,sparkQl:r})}),{results:n}},getDisplayText:function(t,e,o,n){return"ListingId"===t?e+" / "+o+" (MLS #)":"polygon"===o.substr(0,7)||"radius"===o.substr(0,6)?"Drawn Shape":o+" ("+n+")"}},e}(jQuery)},function(t,e,o){"use strict";o.d(e,"a",function(){return i});var n=o(0),i=function(t){function e(e){this.widgetContainer=t(e),this.locationSearchInput=this.widgetContainer.find(".flexmlsAdminLocationSearch"),this.locationSearchValues=this.widgetContainer.find(".flexmls_connect__location_fields"),this.locationSearchValues.length<=0&&(this.locationSearchValues=this.widgetContainer.find('[fmc-field="location_fields"]')),this.portalSlug=this.locationSearchInput.attr("data-portal-slug"),this.init()}return e.prototype={constructor:e,init:function(){this.locationSearchInput.length&&(this.locationSearch=new n.LocationSearch(this.locationSearchInput,{portalSlug:this.portalSlug}),this.insertInitiallySelectedValue(),this.locationSearchInput.change(this.updateLocationSearchValues.bind(this)))},insertInitiallySelectedValue:function(){var t=this,e=this.locationSearchValues.val();e.length&&(e.split("|").forEach(function(e){var o=e.split("="),n=o[0],i=o[1].split(/&(.+)/)[0],c=o[1].split(/&(.+)/)[1],a=t.locationSearch.getDisplayText(n,n,c,n),r=new Option(a,n+"_"+i,!0,!0);t.locationSearchInput.append(r)}),this.locationSearchInput.trigger("change"))},updateLocationSearchValues:function(t){var e=this.locationSearch.selectedValues(),o=[];e.forEach(function(t){var e=t.value,n=t.value;"SubdivisionName"==t.fieldName&&("'"!=e[0]&&"'"!=e[e.length-1]||(e=e.substr(1),e=e.slice(0,-1)),e+="*"),t.fieldName.indexOf(".")>-1&&(t.fieldName=t.fieldName.split(".").join("_")),o.push(encodeURIComponent(t.fieldName)+"="+e+"&"+n)}),this.locationSearchValues.val(o.join("|"))}},e}(jQuery)},,,,,,,,,,function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),i=o(12);!function(t){function e(){var e=t('<div id="fmc_shortcode_window" style="display: none;"></div>');e.appendTo("body"),t.post(ajaxurl,{action:"fmcShortcodeContainer"},function(o){t("#fmc_shortcode_window").html(o.body),e.find(".fmc_which_shortcode").click(function(){t(".flexmls_connect__widget_menu li").removeClass("fmc_selected_shortcode"),t(this).parent().addClass("fmc_selected_shortcode"),t("#fmc_shortcode_window_content").html('<p class="first">Loading...</p>');var e=t(this).attr("data-connect-shortcode");t.post(ajaxurl,{action:e+"_shortcode"},function(o){var c='<div class="flexmls-shorcode-generator">';if(c+='<form id="fmc-shortcode-generator" fmc-shortcode-form="true">',c+='<h3 id="fmc_box_title">'+o.title+"</h3>",c+=o.body,c+='<div class="flexmls-widget-settings-submit-row">',c+='<input type="button" class="fmc_shortcode_submit button-primary" value="Insert Widget">',c+="</div>",c+="</form>",c+="</div>",t("#fmc_shortcode_window_content").html(c),"fmcSearchResults"===e&&new i.a("#fmc_shortcode_field_property_type","#fmc_shortcode_field_property_sub_type"),["fmcMarketStats","fmcPhotos","fmcLocationLinks","fmcSearchResults"].indexOf(e)>=0){new n.a(t("#fmc_shortcode_window_content form"))}t(".fmc_shortcode_submit").click(function(){var e;if(t('input[name="shortcode_to_use"]').length){e={action:"tinymce_shortcodes_generate",shortcode_to_use:t('input[name="shortcode_to_use"]').val(),shortcode_fields_to_catch:{}};var o=t('input[name="shortcode_fields_to_catch"]').val().split(",");t.each(o,function(n,i){e.shortcode_fields_to_catch[o[n]]=t("#widget-fmcleadgen--"+i).val()})}else{var n=t("input[name='widget']").val();e={action:n+"_shortcode_gen"};var i=t('input[name="shortcode_fields_to_catch"]').val(),o=i.split(",");t.each(o,function(){var o=this.trim(),n=t('[fmc-field="'+o+'"]'),i=n.val();"select"==n.attr("fmc-type")?i=t(":selected",n).map(function(){return t(this).val()}).get().join():"checkbox"==n.attr("fmc-type")&&(i=jQuery(':checked[fmc-field="'+o+'"]').map(function(){return jQuery(this).val()}).get().join()),e[o]=i})}t.post(ajaxurl,e,function(t){return tinyMCE.activeEditor.execCommand("mceInsertContent",0,t.body),tb_remove(),!1},"json")})},"json")})},"json")}function o(e){var o=t('<div id="fmc_locationgenerator_window" style="display: none;"></div>'),i={},c="Generate Location String";e?(i={action:"fmcLocationGenerator",field_type:"multiple"},c="Generate Locations String"):i={action:"fmcLocationGenerator",field_type:"single"},o.appendTo("body"),t("#fmc_locationgenerator_window").html('<div id="fmc_box_body_location" class="fmc_box_body"><div class="fmc_shortcode_window_content fmc_location_window"><p class="first">Loading...</p></div></div>'),t.post(ajaxurl,i,function(e){console.log(e);var o='<div class="flexmls-shorcode-generator">';o+='<form id="fmc-shortcode-generator-loc" fmc-shortcode-form="true">',o+='<h3 id="fmc_box_title">'+e.title+"</h3>",o+=e.body,o+='<div class="flexmls-widget-settings-submit-row">',o+='<input type="button" class="fmc_location_shortcode_submit button-primary" value="'+c+'">',o+="</div>",o+="</form>",o+="</div>",t("#fmc_box_body_location .fmc_shortcode_window_content").html(o);new n.a(t("#fmc_box_body_location .fmc_shortcode_window_content form"));t(".fmc_location_shortcode_submit").click(function(){var e="{"+t("#fmc_box_body_location .fmc_shortcode_window_content").find(".flexmls_connect__location_fields").val()+"}";tinyMCE.activeEditor.execCommand("mceSetContent",0,e),t(o).remove(),tb_remove()})},"json")}tinymce.PluginManager.add("fmc",function(e,n){e.addButton("fmc_button",{text:!1,title:"Flexmls\xae Shortcode Generator",image:fmcPluginUrl+"/assets/images/fbs_small.png",onclick:function(){var e=t(window).height()-119;tb_show("Flex MLS® Shortcode Generator","#TB_inline?width=753&height="+e+"&inlineId=fmc_shortcode_window"),t("#TB_window").width(783)}}),e.addButton("fmc_button_location",{text:"Location Generator",title:"FlexMLS\xae Location Generator",image:!1,onclick:function(){var e=t(window).height()-119;o(),tb_show("FlexMLS® Location Generator","#TB_inline?width=753&height="+e+"&inlineId=fmc_locationgenerator_window"),t("#TB_window").width(783)}}),e.addButton("fmc_button_locations",{text:"Locations Generator",title:"FlexMLS\xae Locations Generator",image:!1,onclick:function(){var e=t(window).height()-119;o(!0),tb_show("FlexMLS® Locations Generator","#TB_inline?width=753&height="+e+"&inlineId=fmc_locationgenerator_window"),t("#TB_window").width(783)}})}),t(document).ready(function(){e()})}(jQuery)},function(t,e,o){"use strict";function n(t,e){this.masterSelect=jQuery(t),this.dependentSelect=jQuery(e),this.dependentHtml=this.dependentSelect.html(),this.updateDependentSelect(),this.masterSelect.change(jQuery.proxy(this.updateDependentSelect,this))}o.d(e,"a",function(){return n}),n.prototype={constructor:n,updateDependentSelect:function(){if(""===this.masterSelect.val())this.dependentSelect.prop("disabled","disabled");else{var t=this.masterSelect.val(),e=jQuery(this.dependentHtml).filter("optgroup[label='"+t+"']").find("option");e.length>1?(this.dependentSelect.html(e),this.dependentSelect.prop("disabled",null)):(this.dependentSelect.html('<option value="">none available</option>'),this.dependentSelect.prop("disabled",!0))}}}}]);1 !function(t){function e(n){if(o[n])return o[n].exports;var i=o[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var o={};e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=11)}([function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),o.d(e,"LocationSearch",function(){return n});var n=function(t){function e(e,o){return this.$element=t(e),"undefined"===typeof o&&(o={}),this.omniSearchUrl="//apps.flexmls.com/quick_launch/omni",this.portalSlug=o.portalSlug,this.init(),this}return e.prototype={constructor:e,init:function(){var e=this;this.s2=t(this.$element).select2({ajax:{url:e.omniSearchUrl,dataType:"jsonp",quietMillis:500,data:e.ajaxData.bind(e),processResults:e.processAjaxResults.bind(e),cache:!0},placeholder:"Enter an Address, City, Zip or MLS#",minimumInputLength:3,formatInputTooShort:function(t,e){return"Please enter "+(e-t.length)+" or more characters"}})},selectedValues:function(){var e=t(this.$element).select2("data"),o=[];return Array.isArray(e)||(e=[e]),e.forEach(function(t){o.push({id:t.id,text:t.text,fieldName:t.id.split("_")[0],value:t.id.split("_")[1]})}),o},ajaxData:function(t){var e={_q:t.term,_lo:!1};return"undefined"!==typeof this.portalSlug&&(e.portal_slug=this.portalSlug),e},processAjaxResults:function(t,e){var o=this,n=[];return t.D.Results.forEach(function(t){var e,i,c,a,r;"Field"==t.Type?(e=t.Field.Id,i=t.Field.Name,c="",a=t.Field.Value,r=t.Field.SparkQl):"Listing"==t.Type&&(e="ListingId",i=t.Listing.Name,c=t.Listing.Address,a=t.Listing.Number,r=t.Listing.SparkQl),a&&n.push({id:e+"_"+a,text:o.getDisplayText(e,c,a,i),fieldName:e,value:a,sparkQl:r})}),{results:n}},getDisplayText:function(t,e,o,n){return"ListingId"===t?e+" / "+o+" (MLS #)":"polygon"===o.substr(0,7)||"radius"===o.substr(0,6)?"Drawn Shape":o+" ("+n+")"}},e}(jQuery)},function(t,e,o){"use strict";o.d(e,"a",function(){return i});var n=o(0),i=function(t){function e(e){this.widgetContainer=t(e),this.locationSearchInput=this.widgetContainer.find(".flexmlsAdminLocationSearch"),this.locationSearchValues=this.widgetContainer.find(".flexmls_connect__location_fields"),this.locationSearchValues.length<=0&&(this.locationSearchValues=this.widgetContainer.find('[fmc-field="location_fields"]')),this.portalSlug=this.locationSearchInput.attr("data-portal-slug"),this.init()}return e.prototype={constructor:e,init:function(){this.locationSearchInput.length&&(this.locationSearch=new n.LocationSearch(this.locationSearchInput,{portalSlug:this.portalSlug}),this.insertInitiallySelectedValue(),this.locationSearchInput.change(this.updateLocationSearchValues.bind(this)))},insertInitiallySelectedValue:function(){var t=this,e=this.locationSearchValues.val();e.length&&(e.split("|").forEach(function(e){var o=e.split("="),n=o[0],i=o[1].split(/&(.+)/)[0],c=o[1].split(/&(.+)/)[1],a=t.locationSearch.getDisplayText(n,n,c,n),r=new Option(a,n+"_"+i,!0,!0);t.locationSearchInput.append(r)}),this.locationSearchInput.trigger("change"))},updateLocationSearchValues:function(t){var e=this.locationSearch.selectedValues(),o=[];e.forEach(function(t){var e=t.value,n=t.value;"SubdivisionName"==t.fieldName&&("'"!=e[0]&&"'"!=e[e.length-1]||(e=e.substr(1),e=e.slice(0,-1)),e+="*"),t.fieldName.indexOf(".")>-1&&(t.fieldName=t.fieldName.split(".").join("_")),o.push(encodeURIComponent(t.fieldName)+"="+e+"&"+n)}),this.locationSearchValues.val(o.join("|"))}},e}(jQuery)},,,,,,,,,,function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),i=o(12);!function(t){function e(){var e=t('<div id="fmc_shortcode_window" style="display: none;"></div>');e.appendTo("body"),t.post(ajaxurl,{action:"fmcShortcodeContainer"},function(o){t("#fmc_shortcode_window").html(o.body),e.find(".fmc_which_shortcode").click(function(){t(".flexmls_connect__widget_menu li").removeClass("fmc_selected_shortcode"),t(this).parent().addClass("fmc_selected_shortcode"),t("#fmc_shortcode_window_content").html('<p class="first">Loading...</p>');var e=t(this).attr("data-connect-shortcode");t.post(ajaxurl,{action:e+"_shortcode"},function(o){var c='<div class="flexmls-shorcode-generator">';if(c+='<form id="fmc-shortcode-generator" fmc-shortcode-form="true">',c+='<h3 id="fmc_box_title">'+o.title+"</h3>",c+=o.body,c+='<div class="flexmls-widget-settings-submit-row">',c+='<input type="button" class="fmc_shortcode_submit button-primary" value="Insert Widget">',c+="</div>",c+="</form>",c+="</div>",t("#fmc_shortcode_window_content").html(c),"fmcSearchResults"===e&&new i.a("#fmc_shortcode_field_property_type","#fmc_shortcode_field_property_sub_type"),["fmcMarketStats","fmcPhotos","fmcLocationLinks","fmcSearchResults"].indexOf(e)>=0){new n.a(t("#fmc_shortcode_window_content form"))}t(".fmc_shortcode_submit").click(function(){var e;if(t('input[name="shortcode_to_use"]').length){e={action:"tinymce_shortcodes_generate",shortcode_to_use:t('input[name="shortcode_to_use"]').val(),shortcode_fields_to_catch:{}};var o=t('input[name="shortcode_fields_to_catch"]').val().split(",");t.each(o,function(n,i){e.shortcode_fields_to_catch[o[n]]=t("#widget-fmcleadgen--"+i).val()})}else{var n=t("input[name='widget']").val();e={action:n+"_shortcode_gen"};var i=t('input[name="shortcode_fields_to_catch"]').val(),o=i.split(",");t.each(o,function(){var o=this.trim(),n=t('[fmc-field="'+o+'"]'),i=n.val();"select"==n.attr("fmc-type")?i=t(":selected",n).map(function(){return t(this).val()}).get().join():"checkbox"==n.attr("fmc-type")&&(i=jQuery(':checked[fmc-field="'+o+'"]').map(function(){return jQuery(this).val()}).get().join()),e[o]=i})}t.post(ajaxurl,e,function(t){return tinyMCE.activeEditor.execCommand("mceInsertContent",0,t.body),tb_remove(),!1},"json")})},"json")})},"json")}function o(e){var o=t('<div id="fmc_locationgenerator_window" style="display: none;"></div>'),i={},c="Generate Location String";e?(i={action:"fmcLocationGenerator",field_type:"multiple"},c="Generate Locations String"):i={action:"fmcLocationGenerator",field_type:"single"},o.appendTo("body"),t("#fmc_locationgenerator_window").html('<div id="fmc_box_body_location" class="fmc_box_body"><div class="fmc_shortcode_window_content fmc_location_window"><p class="first">Loading...</p></div></div>'),t.post(ajaxurl,i,function(e){console.log(e);var o='<div class="flexmls-shorcode-generator">';o+='<form id="fmc-shortcode-generator-loc" fmc-shortcode-form="true">',o+='<h3 id="fmc_box_title">'+e.title+"</h3>",o+=e.body,o+='<div class="flexmls-widget-settings-submit-row">',o+='<input type="button" class="fmc_location_shortcode_submit button-primary" value="'+c+'">',o+="</div>",o+="</form>",o+="</div>",t("#fmc_box_body_location .fmc_shortcode_window_content").html(o);new n.a(t("#fmc_box_body_location .fmc_shortcode_window_content form"));t(".fmc_location_shortcode_submit").click(function(){var e="{"+t("#fmc_box_body_location .fmc_shortcode_window_content").find(".flexmls_connect__location_fields").val()+"}";tinyMCE.activeEditor.execCommand("mceSetContent",0,e),t(o).remove(),tb_remove()})},"json")}tinymce.PluginManager.add("fmc",function(e,n){e.addButton("fmc_button",{text:!1,title:"Flexmls\xae Shortcode Generator",image:fmcPluginUrl+"/assets/images/fbs_small.png",onclick:function(){var e=t(window).height()-119;tb_show("Flexmls® Shortcode Generator","#TB_inline?width=753&height="+e+"&inlineId=fmc_shortcode_window"),t("#TB_window").width(783)}}),e.addButton("fmc_button_location",{text:"Location Generator",title:"Flexmls\xae Location Generator",image:!1,onclick:function(){var e=t(window).height()-119;o(),tb_show("Flexmls® Location Generator","#TB_inline?width=753&height="+e+"&inlineId=fmc_locationgenerator_window"),t("#TB_window").width(783)}}),e.addButton("fmc_button_locations",{text:"Locations Generator",title:"Flexmls\xae Locations Generator",image:!1,onclick:function(){var e=t(window).height()-119;o(!0),tb_show("Flexmls® Locations Generator","#TB_inline?width=753&height="+e+"&inlineId=fmc_locationgenerator_window"),t("#TB_window").width(783)}})}),t(document).ready(function(){e()})}(jQuery)},function(t,e,o){"use strict";function n(t,e){this.masterSelect=jQuery(t),this.dependentSelect=jQuery(e),this.dependentHtml=this.dependentSelect.html(),this.updateDependentSelect(),this.masterSelect.change(jQuery.proxy(this.updateDependentSelect,this))}o.d(e,"a",function(){return n}),n.prototype={constructor:n,updateDependentSelect:function(){if(""===this.masterSelect.val())this.dependentSelect.prop("disabled","disabled");else{var t=this.masterSelect.val(),e=jQuery(this.dependentHtml).filter("optgroup[label='"+t+"']").find("option");e.length>1?(this.dependentSelect.html(e),this.dependentSelect.prop("disabled",null)):(this.dependentSelect.html('<option value="">none available</option>'),this.dependentSelect.prop("disabled",!0))}}}}]); -
flexmls-idx/trunk/flexmls_connect.php
r3363339 r3367368 6 6 Description: Provides Flexmls® Customers with Flexmls® IDX features on their WordPress websites. <strong>Tips:</strong> <a href="admin.php?page=fmc_admin_settings">Activate your Flexmls® IDX plugin</a> on the settings page; <a href="widgets.php">add widgets to your sidebar</a> using the Widgets Admin under Appearance; and include widgets on your posts or pages using the Flexmls® IDX Widget Short-Code Generator on the Visual page editor. 7 7 Author: FBS 8 Version: 3.15. 28 Version: 3.15.3 9 9 Author URI: https://www.flexmls.com 10 10 Requires at least: 5.0 … … 17 17 const FMC_API_BASE = 'sparkapi.com'; 18 18 const FMC_API_VERSION = 'v1'; 19 const FMC_PLUGIN_VERSION = '3.15. 2';19 const FMC_PLUGIN_VERSION = '3.15.3'; 20 20 21 21 define( 'FMC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); … … 38 38 require_once( 'lib/functions.php' ); 39 39 require_once( 'Admin/autoloader.php' ); 40 require_once( 'Admin/NginxCompatibility.php' ); 40 41 require_once( 'Shortcodes/autoloader.php' ); 41 42 require_once( 'SparkAPI/autoloader.php' ); … … 76 77 add_action( 'plugins_loaded', array( '\FlexMLS\Admin\Settings', 'update_settings' ), 9 ); 77 78 add_action( 'plugins_loaded', array( $this, 'session_start' ) ); 79 add_filter( 'redirect_canonical', array( $this, 'prevent_idx_redirects' ), 10, 2 ); 78 80 add_action( 'widgets_init', array( $this, 'widgets_init' ) ); 79 81 //add_action( 'wp_ajax_fmcShortcodeContainer', array( 'flexmlsConnect', 'shortcode_container' ) ); … … 176 178 } 177 179 180 /** 181 * Prevent WordPress from redirecting IDX URLs 182 * This prevents WordPress from redirecting /idx/search/ to /search-2/ etc. 183 */ 184 function prevent_idx_redirects( $redirect_url, $requested_url ) { 185 $fmc_settings = get_option( 'fmc_settings' ); 186 $permabase = isset( $fmc_settings['permabase'] ) ? $fmc_settings['permabase'] : 'idx'; 187 188 // Check if the requested URL contains our permabase 189 if ( strpos( $requested_url, '/' . $permabase . '/' ) !== false ) { 190 // Don't redirect IDX URLs - let them be handled by our rewrite rules 191 return false; 192 } 193 194 return $redirect_url; 195 } 196 178 197 public static function plugin_activate(){ 179 198 $is_fresh_install = false; … … 182 201 } 183 202 \FlexMLS\Admin\Update::set_minimum_options( $is_fresh_install ); 184 add_action( 'shutdown', 'flush_rewrite_rules' ); 203 204 // Use nginx-compatible rewrite rule handling 205 if( \FlexMLS\Admin\NginxCompatibility::is_nginx() ) { 206 // For nginx, we don't flush rewrite rules on activation 207 // The rules need to be configured in nginx config file 208 } else { 209 add_action( 'shutdown', 'flush_rewrite_rules' ); 210 } 211 185 212 if( false === get_option( 'fmc_plugin_version' ) ){ 186 213 add_option( 'fmc_plugin_version', FMC_PLUGIN_VERSION, null, 'no' ); … … 191 218 $SparkAPI = new \SparkAPI\Core(); 192 219 $SparkAPI->clear_cache( true ); 193 flush_rewrite_rules(); 220 221 // Use nginx-compatible rewrite rule handling 222 \FlexMLS\Admin\NginxCompatibility::handle_rewrite_rules(); 194 223 } 195 224 … … 204 233 delete_option( 'fmc_plugin_version' ); 205 234 delete_option( 'fmc_settings' ); 206 flush_rewrite_rules(); 235 236 // Use nginx-compatible rewrite rule handling 237 \FlexMLS\Admin\NginxCompatibility::handle_rewrite_rules(); 207 238 } 208 239 … … 217 248 add_rewrite_tag( '%fmc_tag%', '([^&]+)' ); 218 249 add_rewrite_tag( '%fmc_vow_tag%', '([^&]+)' ); 219 flush_rewrite_rules(); 250 251 // Use nginx-compatible rewrite rule handling 252 \FlexMLS\Admin\NginxCompatibility::handle_rewrite_rules(); 220 253 } 221 254 -
flexmls-idx/trunk/integration/divi/divi.php
r2349140 r3367368 1 1 <?php 2 2 /* 3 Plugin Name: Flex MLS- Divi Integration3 Plugin Name: Flexmls - Divi Integration 4 4 Plugin URI: https://www.fbsidx.com/plugin/ 5 Description: Plugin for integrating Flex MLSplugin and Divi Page Builder5 Description: Plugin for integrating Flexmls plugin and Divi Page Builder 6 6 Version: 1.0.0 7 7 Author: FBS Data … … 12 12 Domain Path: /languages 13 13 14 Flex MLS- Divi Integration is free software: you can redistribute it and/or modify14 Flexmls - Divi Integration is free software: you can redistribute it and/or modify 15 15 it under the terms of the GNU General Public License as published by 16 16 the Free Software Foundation, either version 2 of the License, or 17 17 any later version. 18 18 19 Flex MLS- Divi Integration is distributed in the hope that it will be useful,19 Flexmls - Divi Integration is distributed in the hope that it will be useful, 20 20 but WITHOUT ANY WARRANTY; without even the implied warranty of 21 21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 23 23 24 24 You should have received a copy of the GNU General Public License 25 along with Flex MLS- Divi Integration. If not, see https://www.gnu.org/licenses/gpl-2.0.html.25 along with Flexmls - Divi Integration. If not, see https://www.gnu.org/licenses/gpl-2.0.html. 26 26 */ 27 27 -
flexmls-idx/trunk/integration/divi/includes/FMCD_module.php
r2349140 r3367368 65 65 'flexmls_search' => array( 66 66 'priority' => 24, 67 'title' => 'Flex MLSWidget Options',67 'title' => 'Flexmls Widget Options', 68 68 'sub_toggles' => array( 69 69 'basic_mls' => array( … … 91 91 'flexmls_basic' => array( 92 92 'priority' => 23, 93 'title' => 'Flex MLSWidget Options',93 'title' => 'Flexmls Widget Options', 94 94 ), 95 95 ), -
flexmls-idx/trunk/integration/wpbakery/components/VCE_component.php
r2564556 r3367368 53 53 "show_settings_on_create" => "false", 54 54 "icon" => "flexmls_pin", // or css class name which you can reffer in your css file later. Example: "vc_extend_my_class" 55 "category" => 'Flex MLS®',55 "category" => 'Flexmls®', 56 56 'admin_enqueue_js' => $this->initLocation(), 57 57 "params" => array_merge($this->setParams(), $this->setDesignOptions()), -
flexmls-idx/trunk/lib/base.php
r3251292 r3367368 187 187 188 188 if ($api->last_error_code == 1500) { 189 $message = "This widget requires a subscription to Flex MLS® IDX in order to work. <a href=''>Buy Now</a>.";189 $message = "This widget requires a subscription to Flexmls® IDX in order to work. <a href=''>Buy Now</a>."; 190 190 } 191 191 elseif ($detailed == true) { 192 $message = "There was an issue communicating with the Flex MLS® IDX API services required to generate this widget. Please refresh the page or try again later. Error code: ".$api->last_error_code;192 $message = "There was an issue communicating with the Flexmls® IDX API services required to generate this widget. Please refresh the page or try again later. Error code: ".$api->last_error_code; 193 193 } 194 194 else { … … 209 209 210 210 if (is_user_logged_in()) { 211 return "<span style='color:red;'>Flex MLS® IDX: {$reqs_missing} are required settings for the {$widget} widget.</span>";211 return "<span style='color:red;'>Flexmls® IDX: {$reqs_missing} are required settings for the {$widget} widget.</span>"; 212 212 } 213 213 else { -
flexmls-idx/trunk/lib/flexmlsAPI/Core.php
r3363339 r3367368 44 44 'Accept-Encoding' => "gzip,deflate", 45 45 'Content-Type' => "application/json", 46 'User-Agent' => "Flex MLS WordPress Plugin/3.15.2",47 'X-SparkApi-User-Agent' => "flexmls-WordPress-Plugin/3.15. 2"46 'User-Agent' => "Flexmls WordPress Plugin/3.15.3", 47 'X-SparkApi-User-Agent' => "flexmls-WordPress-Plugin/3.15.3" 48 48 ); 49 49 … … 61 61 static function admin_notices_api_connection_error(){ 62 62 echo ' <div class="notice notice-error"> 63 <p>There was an error connecting to the Flex MLS® IDX API. Please check your credentials and try again. If your credentials are correct and you continue to see this error message, please <a href="' . admin_url( 'admin.php?page=fmc_admin_settings&tab=support' ) . '">contact support</a>.</p>63 <p>There was an error connecting to the Flexmls® IDX API. Please check your credentials and try again. If your credentials are correct and you continue to see this error message, please <a href="' . admin_url( 'admin.php?page=fmc_admin_settings&tab=support' ) . '">contact support</a>.</p> 64 64 </div>'; 65 65 } -
flexmls-idx/trunk/lib/gutenberg.php
r3154099 r3367368 23 23 $htmlListingDetails = $htmlPhotos = $htmlMarketStats = $htmlSearch = $htmlLocationLinks = 24 24 $htmlIDXLinksWidget = $htmlLeadgen = $htmlSearchResults = $htmlAccount = $htmlAgents = 25 "<b>Flex connection error! Have you entered Flex MLS® API credentials?</b>";25 "<b>Flex connection error! Have you entered Flexmls® API credentials?</b>"; 26 26 $instance = array("_instance_type" => "shortcode", "_is_gutenberg_new" => true); 27 27 … … 109 109 array( 110 110 'slug' => 'flex', 111 'title' => 'Flex MLS'111 'title' => 'Flexmls' 112 112 ), 113 113 ) … … 314 314 } 315 315 else { 316 echo "<div>Flex MLSPlugin</div>";316 echo "<div>Flexmls Plugin</div>"; 317 317 } 318 318 -
flexmls-idx/trunk/lib/settings-page.php
r3358668 r3367368 50 50 } 51 51 update_option('fmc_settings', $options); 52 $wp_rewrite->flush_rules(true); 52 53 // Use nginx-compatible rewrite rule handling 54 if( \FlexMLS\Admin\NginxCompatibility::is_nginx() ) { 55 // For nginx, we don't flush rewrite rules as they need to be configured in nginx config 56 // The rules are still added to WordPress for URL generation 57 } else { 58 $wp_rewrite->flush_rules(true); 59 } 53 60 } 54 61 -
flexmls-idx/trunk/views/admin-settings-behavior.php
r3325113 r3367368 181 181 <p>Another Note: If you're using a SEO plugin, you may need to disable Permalink Cleaning for this feature to work.</p> 182 182 </div> 183 184 <?php 185 // Display nginx warning for destination page changes (only if nginx is detected and destlink is set) 186 if ( \FlexMLS\Admin\NginxCompatibility::is_nginx() && !empty( $fmc_settings[ 'destlink' ] ) ) { 187 $last_destlink_change = get_transient( 'fmc_destlink_changed' ); 188 $recently_changed_destlink = $last_destlink_change && ( time() - $last_destlink_change ) < 300; 189 190 if ( $recently_changed_destlink ) { 191 ?> 192 <div style="background: #f8d7da; padding: 10px; margin: 10px 0; border: 1px solid #f5c6cb; border-radius: 4px;"> 193 <p style="margin: 0; color: #721c24; font-size: 13px;"> 194 <strong>⚠️ nginx Update Required:</strong> You just changed the destination page. Your nginx configuration needs to be updated with the new page ID: <code><?php echo esc_html( $fmc_settings[ 'destlink' ] ); ?></code> 195 </p> 196 </div> 197 <?php 198 } 199 } 200 ?> 183 201 </td> 184 202 </tr> … … 190 208 <p><code><?php echo site_url( '/' ); ?></code> <input type="text" class="regular-text code" name="fmc_settings[permabase]" id="permabase" value="<?php echo $fmc_settings[ 'permabase' ]; ?>"></p> 191 209 <p class="description">Changes the URL for special plugin pages. e.g., <?php echo site_url( $fmc_settings[ 'permabase' ] . '/search' ); ?></p> 210 211 <?php 212 // Display nginx warning for permalink base changes 213 \FlexMLS\Admin\NginxCompatibility::display_nginx_permabase_warning(); 214 ?> 192 215 </td> 193 216 </tr> … … 298 321 <p><?php wp_nonce_field( 'update_fmc_behavior_action', 'update_fmc_behavior_nonce' ); ?><button type="submit" class="button-primary">Save Settings</button></p> 299 322 </form> 323 324 <script> 325 jQuery(document).ready(function($) { 326 // Show nginx warning when permalink base field is focused or changed 327 $('#permabase').on('focus change input', function() { 328 var currentValue = $(this).val(); 329 var nginxWarning = $(this).closest('td').find('.nginx-permabase-warning'); 330 331 // If nginx warning exists and value has changed, show a note and expand the warning 332 if (nginxWarning.length > 0 && currentValue !== '<?php echo esc_js( $fmc_settings[ 'permabase' ] ); ?>') { 333 // Expand the warning if it's collapsed 334 var details = nginxWarning.find('details'); 335 if (details.length > 0 && !details.attr('open')) { 336 details.attr('open', 'open'); 337 } 338 339 // Add the change notice if it doesn't exist 340 if (!nginxWarning.find('.value-changed-notice').length) { 341 nginxWarning.find('details > div').prepend('<div class="value-changed-notice" style="background: #d4edda; padding: 8px; margin-bottom: 10px; border: 1px solid #c3e6cb; border-radius: 4px; color: #155724; font-size: 13px;"><strong>Note:</strong> You will need to update your nginx configuration after saving this change.</div>'); 342 } 343 } 344 }); 345 346 // Hide the note when value is reverted to original 347 $('#permabase').on('input', function() { 348 var currentValue = $(this).val(); 349 var nginxWarning = $(this).closest('td').find('.nginx-permabase-warning'); 350 var valueChangedNotice = nginxWarning.find('.value-changed-notice'); 351 352 if (currentValue === '<?php echo esc_js( $fmc_settings[ 'permabase' ] ); ?>' && valueChangedNotice.length > 0) { 353 valueChangedNotice.remove(); 354 // Optionally collapse the warning if it was auto-expanded 355 var details = nginxWarning.find('details'); 356 if (details.length > 0 && details.attr('open') && !details.data('user-opened')) { 357 details.removeAttr('open'); 358 } 359 } 360 }); 361 362 // Show nginx warning when destination page is changed 363 $('select[name="fmc_settings[destlink]"]').on('change', function() { 364 var currentValue = $(this).val(); 365 var originalValue = '<?php echo esc_js( $fmc_settings[ 'destlink' ] ); ?>'; 366 var nginxWarning = $('.nginx-permabase-warning'); 367 368 // If nginx warning exists and value has changed, show a note and expand the warning 369 if (nginxWarning.length > 0 && currentValue !== originalValue) { 370 // Expand the warning if it's collapsed 371 var details = nginxWarning.find('details'); 372 if (details.length > 0 && !details.attr('open')) { 373 details.attr('open', 'open'); 374 } 375 376 // Add the change notice if it doesn't exist 377 if (!nginxWarning.find('.value-changed-notice').length) { 378 nginxWarning.find('details > div').prepend('<div class="value-changed-notice" style="background: #d4edda; padding: 8px; margin-bottom: 10px; border: 1px solid #c3e6cb; border-radius: 4px; color: #155724; font-size: 13px;"><strong>Note:</strong> You will need to update your nginx configuration after saving this change.</div>'); 379 } 380 } 381 382 // Hide the note when value is reverted to original 383 if (currentValue === originalValue) { 384 var valueChangedNotice = nginxWarning.find('.value-changed-notice'); 385 if (valueChangedNotice.length > 0) { 386 valueChangedNotice.remove(); 387 // Optionally collapse the warning if it was auto-expanded 388 var details = nginxWarning.find('details'); 389 if (details.length > 0 && details.attr('open') && !details.data('user-opened')) { 390 details.removeAttr('open'); 391 } 392 } 393 } 394 }); 395 }); 396 </script> -
flexmls-idx/trunk/views/admin-settings-cache.php
r2926110 r3367368 1 1 <form action="<?php echo admin_url( 'admin.php?page=fmc_admin_settings&tab=cache' ); ?>" method="post"> 2 2 <h4>Clear Cached Flexmls® API Responses</h4> 3 <p>If you’re having problems with your Flexmls® widgets or listings, you can click the button below which will clear out the cached information and fetch the latest data from the MLS and your Flex MLS® account.</p>3 <p>If you’re having problems with your Flexmls® widgets or listings, you can click the button below which will clear out the cached information and fetch the latest data from the MLS and your Flexmls® account.</p> 4 4 <p><?php wp_nonce_field( 'clear_api_cache_action', 'clear_api_cache_nonce' ); ?><button type="submit" class="button-secondary">Clear Cache</button></p> 5 5 </form>
Note: See TracChangeset
for help on using the changeset viewer.