SEO SQUIRRLY™ - Version 12.1.12

Version Description

  • 09/30/2022 =
  • Update - Added the option to send any post type from Automation to Google News sitemap
  • Update - Added the Semrush Ranking score in SEO Audit
  • Update - Added new hook "sq_post_images" when receiving the images for social media snippet
  • Update - Added new hook "sq_post_videos" when receiving the videos for social media snippet
  • Update - SLA to check the reusable divs in the posts/pages
  • Update - Frontend SLA script for Bricks Builder
  • Update - Inner links counting in Focus Pages
  • Fixed - Wrong number of params when calling loadMedia function
  • Fixed - Broken help URL https://howto12.squirrly.co/wordpress-seo/
  • Fixed - Remove Alexa Code as the service is not available anymore
  • Fixed - Show the correct notification text when requesting a new SEO Audit after an hour
  • Fixed - Increase security and remove unused functions from older version of Squirrly SEO
  • Fixed - Don't show tasks in Assistant for inactive features
  • Fixed - Focus Pages > SEO image to check only the filename and not the image path
  • Fixed - Correct the frontend buffer to work with other plugins better
  • Fixed - UnitPriceSpecification in JsonLD for Woocommerce products
  • Fixed - Sitemap to not include relative redirected URLs that are not valid
  • Fixed - Ranking to not show duplicare URLs
  • Fixed - Update the Google News to take the last 2 days from each post type included in the feed as requested
Download this release

Release Info

Developer cifi
Plugin Icon 128x128 SEO SQUIRRLY™
Version 12.1.12
Comparing to
See all releases

Code changes from version 12.1.11 to 12.1.12

classes/FrontController.php CHANGED
@@ -149,7 +149,6 @@ class SQ_Classes_FrontController
149
 
150
  // show the admin menu and post actions
151
  SQ_Classes_ObjController::getClass('SQ_Controllers_Menu');
152
- SQ_Classes_ObjController::getClass('SQ_Models_RoleManager');
153
 
154
  //Check cache plugin compatibility
155
  SQ_Classes_ObjController::getClass('SQ_Models_Compatibility')->hookBuildersBackend();
149
 
150
  // show the admin menu and post actions
151
  SQ_Classes_ObjController::getClass('SQ_Controllers_Menu');
 
152
 
153
  //Check cache plugin compatibility
154
  SQ_Classes_ObjController::getClass('SQ_Models_Compatibility')->hookBuildersBackend();
controllers/Sitemaps.php CHANGED
@@ -173,6 +173,7 @@ class SQ_Controllers_Sitemaps extends SQ_Classes_FrontController
173
  foreach (SQ_Classes_Helpers_Tools::getOption('patterns') as $pattern => $type) {
174
  if(isset($type['google_news']) && $type['google_news'] == 1){
175
  array_push($sq_query['post_type'],$pattern);
 
176
  }
177
  }
178
  $sq_query['date_query'] = array(
@@ -270,7 +271,6 @@ class SQ_Controllers_Sitemaps extends SQ_Classes_FrontController
270
  $header .= '<!-- generated-on="' . date('Y-m-d\TH:i:s+00:00') . '" -->' . "\n";
271
  $header .= '<!-- generator="Squirrly SEO Sitemap" -->' . "\n";
272
  $header .= '<!-- generator-url="https://wordpress.org/plugins/squirrly-seo/" -->' . "\n";
273
- $header .= '<!-- generator-version="' . esc_attr(SQ_VERSION) . '" -->' . "\n";
274
  }
275
 
276
  return $header;
173
  foreach (SQ_Classes_Helpers_Tools::getOption('patterns') as $pattern => $type) {
174
  if(isset($type['google_news']) && $type['google_news'] == 1){
175
  array_push($sq_query['post_type'],$pattern);
176
+ $sq_query['post_type'] = array_unique($sq_query['post_type']);
177
  }
178
  }
179
  $sq_query['date_query'] = array(
271
  $header .= '<!-- generated-on="' . date('Y-m-d\TH:i:s+00:00') . '" -->' . "\n";
272
  $header .= '<!-- generator="Squirrly SEO Sitemap" -->' . "\n";
273
  $header .= '<!-- generator-url="https://wordpress.org/plugins/squirrly-seo/" -->' . "\n";
 
274
  }
275
 
276
  return $header;
models/RoleManager.php CHANGED
@@ -5,11 +5,6 @@ class SQ_Models_RoleManager
5
 
6
  public $roles;
7
 
8
- public function __construct()
9
- {
10
- add_action('admin_init', array($this, 'addSQRoles'), 99);
11
- }
12
-
13
  /**
14
  * Get all the Squirrly Caps
15
  *
5
 
6
  public $roles;
7
 
 
 
 
 
 
8
  /**
9
  * Get all the Squirrly Caps
10
  *
models/focuspages/Image.php CHANGED
@@ -153,7 +153,7 @@ class SQ_Models_Focuspages_Image extends SQ_Models_Abstract_Assistant
153
  $task['completed'] = false;
154
  } elseif (!empty($this->_images)) {
155
  $keyword = html_entity_decode($this->_keyword, ENT_QUOTES);
156
- $keyword = preg_replace('~[^\p{L}\p{N}\n\'\"]+~u', ' ', $keyword);
157
  $keyword = preg_replace('/\s{2,}/', ' ', $keyword);
158
  $words = explode(' ', $keyword);
159
  foreach ($this->_images as $image) {
153
  $task['completed'] = false;
154
  } elseif (!empty($this->_images)) {
155
  $keyword = html_entity_decode($this->_keyword, ENT_QUOTES);
156
+ $keyword = preg_replace('~[^\p{L}\p{N}\n]+~u', ' ', $keyword);
157
  $keyword = preg_replace('/\s{2,}/', ' ', $keyword);
158
  $words = explode(' ', $keyword);
159
  foreach ($this->_images as $image) {
models/services/Redirects.php CHANGED
@@ -79,14 +79,14 @@ class SQ_Models_Services_Redirects extends SQ_Models_Abstract_Seo
79
  }
80
 
81
  //If there is no post found but the redirects are set for 404
82
- if (isset($this->_post->sq->do_redirects) && $this->_post->sq->do_redirects) {
 
 
83
  header('X-Redirect-By: Squirrly SEO');
84
 
85
  //check the default redirect URL and prevent loop redirects
86
- if(SQ_Classes_Helpers_Tools::getOption('404_url_redirect')) {
87
- if (parse_url(SQ_Classes_Helpers_Tools::getOption('404_url_redirect'), PHP_URL_PATH) <> $_SERVER['REQUEST_URI']) {
88
- header('Location: ' . SQ_Classes_Helpers_Tools::getOption('404_url_redirect'), true, 301);
89
- }
90
  } else {
91
  header('Location: ' . home_url(), true, 301);
92
  }
79
  }
80
 
81
  //If there is no post found but the redirects are set for 404
82
+ if (isset($this->_post->sq->do_redirects) && $this->_post->sq->do_redirects &&
83
+ SQ_Classes_Helpers_Tools::getOption('404_url_redirect')) {
84
+
85
  header('X-Redirect-By: Squirrly SEO');
86
 
87
  //check the default redirect URL and prevent loop redirects
88
+ if (parse_url(SQ_Classes_Helpers_Tools::getOption('404_url_redirect'), PHP_URL_PATH) <> $_SERVER['REQUEST_URI']) {
89
+ header('Location: ' . SQ_Classes_Helpers_Tools::getOption('404_url_redirect'), true, 301);
 
 
90
  } else {
91
  header('Location: ' . home_url(), true, 301);
92
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: cifi, calinvingan, florinmuresan, nagy.sorel
3
  Donate link: https://plugin.squirrly.co/squirrly-seo-pricing/
4
  Tags: SEO, SEO Plugin, XML sitemap, WooCommerce SEO, Search Engine, Open Graph, Video Sitemap, Google News Sitemap, Rich Snippets, Robotx.txt, SEO Automation, Local SEO, SEO Content analysis, SEO Content, SEO Optimization, WordPress SEO, Yoast, Yoast Compatible, Yoast Import, SEO Redirection, Redirection, SEO Sitemap, SEO Caching, Meta Title, Meta Description, Performance, SEO Audit, SEO Keyword Research, SEO Rank Math import, Google Search Console, Schema
5
  Requires at least: 4.3
6
- Tested up to: 6.0
7
- Stable tag: 12.1.11
8
  Requires PHP: 7.0
9
  License: GPLv2 or later
10
 
@@ -669,6 +669,27 @@ Type a keyword to the right of the screen and start using Squirrly Seo. Enjoy!
669
  7. Squirrly SEO - SEO Briefcase
670
 
671
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
672
  = 12.1.11 - 08/12/2022 =
673
  Update - SLA compatibility with Zion Builder
674
  Update - SLA compatibility with WPBakery Page Builder
3
  Donate link: https://plugin.squirrly.co/squirrly-seo-pricing/
4
  Tags: SEO, SEO Plugin, XML sitemap, WooCommerce SEO, Search Engine, Open Graph, Video Sitemap, Google News Sitemap, Rich Snippets, Robotx.txt, SEO Automation, Local SEO, SEO Content analysis, SEO Content, SEO Optimization, WordPress SEO, Yoast, Yoast Compatible, Yoast Import, SEO Redirection, Redirection, SEO Sitemap, SEO Caching, Meta Title, Meta Description, Performance, SEO Audit, SEO Keyword Research, SEO Rank Math import, Google Search Console, Schema
5
  Requires at least: 4.3
6
+ Tested up to: 6.1
7
+ Stable tag: 12.1.12
8
  Requires PHP: 7.0
9
  License: GPLv2 or later
10
 
669
  7. Squirrly SEO - SEO Briefcase
670
 
671
  == Changelog ==
672
+ = 12.1.12 - 09/30/2022 =
673
+ * Update - Added the option to send any post type from Automation to Google News sitemap
674
+ * Update - Added the Semrush Ranking score in SEO Audit
675
+ * Update - Added new hook "sq_post_images" when receiving the images for social media snippet
676
+ * Update - Added new hook "sq_post_videos" when receiving the videos for social media snippet
677
+ * Update - SLA to check the reusable divs in the posts/pages
678
+ * Update - Frontend SLA script for Bricks Builder
679
+ * Update - Inner links counting in Focus Pages
680
+ * Fixed - Wrong number of params when calling loadMedia function
681
+ * Fixed - Broken help URL https://howto12.squirrly.co/wordpress-seo/
682
+ * Fixed - Remove Alexa Code as the service is not available anymore
683
+ * Fixed - Show the correct notification text when requesting a new SEO Audit after an hour
684
+ * Fixed - Increase security and remove unused functions from older version of Squirrly SEO
685
+ * Fixed - Don't show tasks in Assistant for inactive features
686
+ * Fixed - Focus Pages > SEO image to check only the filename and not the image path
687
+ * Fixed - Correct the frontend buffer to work with other plugins better
688
+ * Fixed - UnitPriceSpecification in JsonLD for Woocommerce products
689
+ * Fixed - Sitemap to not include relative redirected URLs that are not valid
690
+ * Fixed - Ranking to not show duplicare URLs
691
+ * Fixed - Update the Google News to take the last 2 days from each post type included in the feed as requested
692
+
693
  = 12.1.11 - 08/12/2022 =
694
  Update - SLA compatibility with Zion Builder
695
  Update - SLA compatibility with WPBakery Page Builder
squirrly.php CHANGED
@@ -8,7 +8,7 @@
8
  * Description: A.I.-based Private SEO Consultant. In a Plugin. Powered by Machine Learning and Cloud Services. Over 300 functionalities for SEO available when you need them.
9
  * Author: Squirrly
10
  * Author URI: https://plugin.squirrly.co
11
- * Version: 12.1.11
12
  * License: GPLv2 or later
13
  * License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
14
  * Text Domain: squirrly-seo
@@ -17,7 +17,7 @@
17
 
18
  if (!defined('SQ_VERSION')) {
19
  /* SET THE CURRENT VERSION ABOVE AND BELOW */
20
- define('SQ_VERSION', '12.1.11');
21
  //The last stable version
22
  define('SQ_STABLE_VERSION', '12.1.10');
23
  // Call config files
@@ -50,3 +50,4 @@ if (!defined('SQ_VERSION')) {
50
  } catch (Exception $e) {
51
  }
52
  }
 
8
  * Description: A.I.-based Private SEO Consultant. In a Plugin. Powered by Machine Learning and Cloud Services. Over 300 functionalities for SEO available when you need them.
9
  * Author: Squirrly
10
  * Author URI: https://plugin.squirrly.co
11
+ * Version: 12.1.12
12
  * License: GPLv2 or later
13
  * License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
14
  * Text Domain: squirrly-seo
17
 
18
  if (!defined('SQ_VERSION')) {
19
  /* SET THE CURRENT VERSION ABOVE AND BELOW */
20
+ define('SQ_VERSION', '12.1.12');
21
  //The last stable version
22
  define('SQ_STABLE_VERSION', '12.1.10');
23
  // Call config files
50
  } catch (Exception $e) {
51
  }
52
  }
53
+
view/Automation/Automation.php CHANGED
@@ -183,7 +183,7 @@
183
  <?php }?>
184
 
185
  <?php if ($pattern == '404') { ?>
186
- <div class="col-12 row py-2 mx-0 my-3 ">
187
  <div class="col-4 p-0 pr-3 font-weight-bold">
188
  <?php echo esc_html__("Default Redirect URL", 'squirrly-seo'); ?>:
189
  <a href="https://howto12.squirrly.co/kb/seo-automation/#redirect_404_links" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
183
  <?php }?>
184
 
185
  <?php if ($pattern == '404') { ?>
186
+ <div class="col-12 row py-2 mx-0 my-3">
187
  <div class="col-4 p-0 pr-3 font-weight-bold">
188
  <?php echo esc_html__("Default Redirect URL", 'squirrly-seo'); ?>:
189
  <a href="https://howto12.squirrly.co/kb/seo-automation/#redirect_404_links" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
view/assets/js/assistant/sq_frontend.min.js CHANGED
@@ -1 +1 @@
1
- (function($){"use strict";if($.isFunction($.fn.sq_frontend)){return}$.fn.sq_frontend=function(options){var $this=this;var settings=$.extend({positions:[],minimize_height:134,maximize_height:100,top:25,bottom:0},options);$.sq_fields=$.extend({wp_form:$(".metabox-location-normal").length>0?$(".metabox-location-normal"):$("#side-sortables"),sq_box_close:$.sq_config.div.find(".sq_box_close"),sq_box_minimize:$.sq_config.div.find(".sq_box_minimize"),sq_box_maximize:$.sq_config.div.find(".sq_box_maximize"),sq_button_squirrly:$(".edit__PinnedPluginIcon-hNdeXr")},$.sq_fields);$.expr.filters.slaoffscreen=function(el){var rect=el.getBoundingClientRect();return rect.x+rect.width<0||rect.y+rect.height<0||(rect.x>window.innerWidth||rect.y>window.innerHeight)};$this.init=function(){var dragposition="";$.sq_config.div.addClass("sq_sticky");$.sq_config.div.addClass("minimized");$.sq_fields.sq_box_minimize.hide();$.sq_fields.sq_box_close.show();$.sq_fields.sq_box_maximize.show();var positions=JSON.parse(localStorage.positions||"{}");$(function(){$.each(positions,function(id,pos){$.sq_config.div.css(pos)});$.sq_config.div.css("height",settings.minimize_height);$.sq_config.div.css("top","auto");if($.fn.draggable){$.sq_config.div.draggable({containment:"body",handle:".sq_header",scroll:true,axis:"x",stop:function(event,ui){positions[this.id]=ui.position;localStorage.positions=JSON.stringify(positions)}})}});$.sq_fields.sq_box_minimize.on("click",function(e){e.stopPropagation();$.sq_config.div.css("height",settings.minimize_height+"px");$.sq_config.div.css("bottom",settings.bottom+"px");$.sq_config.div.css("top","auto");$.sq_config.div.addClass("minimized");$.sq_config.div.scrollTop(0);$.sq_fields.sq_box_minimize.hide();$.sq_fields.sq_box_maximize.show()});$.sq_fields.sq_box_close.on("click",function(){$.sq_config.div.hide();$.sq_setCookie("sq_sla","off")});if($.sq_getCookie("sq_sla")==="off"){$.sq_fields.sq_box_close.trigger("click")}$.sq_fields.sq_box_maximize.on("click",function(){$.sq_config.div.show();if($.sq_config.div.hasClass("minimized")){$.sq_config.div.css("top",settings.top+"px");$.sq_config.div.css("height","auto");$.sq_config.div.css("bottom",0);$.sq_config.div.scrollTop(0);$.sq_config.div.removeClass("minimized");$.sq_fields.sq_box_minimize.show();$.sq_fields.sq_box_maximize.hide()}});$(".editor-writing-flow").css("height","auto");$(window).resize(function(){if(typeof $.sq_config.div!=="undefined"&&$.sq_config.div.is(":slaoffscreen")){$.sq_config.div.css("left","auto");$.sq_config.div.css("right","0px")}})};$this.one("seo.loaded",function(){$this.sq_VisualBuilder()});$this.one("seo.frontend.content_loaded",function(){SQ_DEBUG&&console.log("sq_frontend seo.loaded");if(!$(".components-squirrly-icon").length){$.sq_editor.createEditorButton("components-squirrly-icon")}$(".components-squirrly-icon").on("click",function(){$.sq_fields.sq_box_maximize.trigger("click");$.sq_setCookie("sq_sla","on");$(".components-squirrly-icon").hide()});$.sq_fields.sq_box_close.on("click",function(){$(".components-squirrly-icon").show()});if($.sq_getCookie("sq_sla")==="off"){$(".components-squirrly-icon").show()}else{$.sq_config.div.show()}$this.sq_listenBuilderChange();$this.trigger("seo.frontend.refresh");$this.trigger("seo.frontend.new_changes")});if($.sq_config.div.is(":slaoffscreen")){$.sq_config.div.css("left","auto");$.sq_config.div.css("right","0px")}return $this};$.fn.sq_listenBuilderChange=function(){var $this=this;if(!$.sq_blockseo){return}$this.on("seo.frontend.editor_loaded seo.frontend.new_changes",function(){SQ_DEBUG&&console.log("seo.frontend.new_changes");var ed=$.sq_editor.getFrontendEditor();if(ed){if(ed.getPageTitle()!==""){$.sq_fields.wp_input_title.val(ed.getPageTitle())}$.sq_blockseo.trigger("seo.refresh")}SQ_DEBUG&&console.log("seo.frontend.new_changes DONE")});$.sq_blockseo.on("seo.refresh_click",function(){$this.checkPostAjax()});$this.on("seo.frontend.page_saved",function(){SQ_DEBUG&&console.log("seo.frontend.page_saved");var ed=$.sq_editor.getFrontendEditor();if(ed){if($.sq_blockbriefcase){$.sq_blockbriefcase.trigger("briefcase.save")}var $sq_seo=[];$this.find('input[name="sq_seo[]"]').each(function(){$sq_seo.push(this.value)});$.post($.sq_config.ajaxurl,{action:"sq_ajax_save_post",sq_nonce:$.sq_config.sq_nonce,post_id:$.sq_config.postID,sq_keyword:$.sq_config.keyword,referer:"frontend",sq_seo:$sq_seo}).done(function(){$this.trigger("seo.frontend.new_changes")})}SQ_DEBUG&&console.log("seo.frontend.page_saved DONE")});$this.checkPostAjax=function(){return $.post($.sq_config.ajaxurl,{action:"sq_ajax_get_post",sq_nonce:$.sq_config.sq_nonce,post_id:$.sq_config.postID}).done(function(data){if(typeof data.url!=="undefined"){if(!$.sq_config.div.find("#new-post-slug").length){$.sq_config.div.append('<input type="hidden" id="new-post-slug" />')}$("#new-post-slug").val(data.url)}if(typeof data.post_title!=="undefined"){$.sq_fields.wp_input_title.val(data.post_title)}$this.trigger("seo.frontend.new_changes")})};if(!$.sq_config.div.find("#sq_post_title").length){$.sq_config.div.append('<input type="hidden" id="sq_post_title" />');$.sq_fields.wp_input_title=$("#sq_post_title");$this.checkPostAjax()}};$.fn.sq_VisualBuilder=function(){var $this=this;if(typeof window.sq_editor!=="undefined"){return window.sq_editor}var builderExists=false;var builderInUse="";var $builderContents=null;var $lastNumberOfNodes=0;var $currentNumberOfNodes=0;var $elementLoadingTime=null;var buildersInfo={elementor:{enabled:true,name:"elementor",hasIframe:true,iframeSelector:"#elementor-preview-iframe",parrentDiv:".elementor-editor-active"},WPBakery:{enabled:true,name:"wpbakery",hasIframe:true,iframeSelector:"#vc_inline-frame",parrentDiv:"#vc_editor"},bricks:{enabled:true,name:"bricks",hasIframe:true,iframeSelector:"#bricks-builder-iframe",parrentDiv:"#bricks-builder-iframe-wrapper"},thrive:{enabled:true,name:"thrive",hasIframe:true,iframeSelector:"#tve-editor-frame",parrentDiv:".tcb-editor-main"},divi:{enabled:true,name:"divi",hasIframe:true,iframeSelector:"#et-fb-app-frame",parrentDiv:".et_divi_builder"},oxygen:{enabled:true,name:"oxygen",hasIframe:true,iframeSelector:"#ct-artificial-viewport",parrentDiv:"#oxygen-ui"},zion:{enabled:true,name:"zion",hasIframe:true,iframeSelector:"#znpb-editor-iframe",parrentDiv:".znpb"}};var pageData={url:"",title:"",content:"",h1:"",headline:"",hasMultipleH1:false,images:""};var builderSelectorsSettings={preview:"",h1:"",container:"",containerWidget:"",containerWidgetImages:"",saveButton:"",saveAction:""};var currentNumberOfNodes=null;$this.init=function(){SQ_DEBUG&&console.log("checkBuilderExists");$this.checkBuilderExists()};$this.parseBuilders=function(){SQ_DEBUG&&console.log("Check parseBuilders "+$this.getBuilderName());switch($this.getBuilderName()){case"elementor":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseElementor();break;case"oxygen":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseOxygen();break;case"divi":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");if(typeof $.sq_config.div==="undefined"||typeof $.sq_params.low_density==="undefined"||typeof $.sq_fields.wp_title==="undefined"){$.sq_setConfig();$.sq_setParams();$.sq_setfields()}$this.parseDivi();break;case"wpbakery":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseWPBakery();break;case"zion":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseZion();break;case"thrive":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseThrive();break;case"bricks":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseBricks();break}};$this.checkBuilderExists=function(){SQ_DEBUG&&console.log("Looking for builders");$.each(Object.values(buildersInfo),function(index,builder){SQ_DEBUG&&console.log("Checking for: "+builder.name+" builder");if(builder.enabled===false){return}if(builder.hasIframe){if($this.elementExists(builder.iframeSelector)){SQ_DEBUG&&console.log("Found: "+builder.iframeSelector+" iframe");$(builder.iframeSelector).ready(function(){SQ_DEBUG&&console.log("Ready iframeSelector: "+builder.iframeSelector+" from builder "+builder.name);$this.setBuilderExists(builder.name);$builderContents=$(builder.iframeSelector).contents()[0];$this.parseBuilders()});return false}}else if($this.elementExists(builder.parrentDiv)){$builderContents=$(builder.parrentDiv).contents();$this.setBuilderExists(builder.name);return false}})};$this.elementExists=function(element,where){var $whereToLook;if(typeof where==="undefined"){$whereToLook=$(document)}else{$whereToLook=$(where)}var $element=$whereToLook.find(element);if(typeof $element!=="undefined"&&$element.length>0){return $element}return false};$this.getBuilderInfo=function(builderName){return buildersInfo[builderName]};$this.waitForElementToDisplay=function(selector,where,time,callback){if($elementLoadingTime){clearTimeout($elementLoadingTime)}var $element=$this.elementExists(selector,where);if($element){callback()}else{$elementLoadingTime=setTimeout(function(){console.log("Waiting for: "+selector);$this.waitForElementToDisplay(selector,where,time,callback)},time)}};$this.parseElementor=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#elementor-preview-iframe"],title:["h1.elementor-heading-title","h1.entry-title"],header:["h2","h3","h4","h5","h6"],container:[".elementor-section-wrap",".elementor-inner"],containerWidget:".elementor-widget-container",containerWidgetImages:["img"],saveAction:"save_builder"};$.each(builderSelectorsSettings.title,function(index,value){if($this.elementExists(value,$builderContents)){$this.setPageTitle($($builderContents).find(value+":first").text())}});$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();if($element.find(builderSelectorsSettings.containerWidget).length){$element=$element.find(builderSelectorsSettings.containerWidget)}$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$("#elementor-loading").is(":visible")){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded")}},1e3)})})};$this.parseOxygen=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#ct-artificial-viewport"],title:["h1.ct-headline"],header:["div.bnb-subheading"],container:["#ct-builder"],containerWidget:".ct-inner-wrap",containerWidgetImages:[".ct-image"],saveAction:"oxygen-save-button",draftButton:"oxygen-save-button"};$.each(builderSelectorsSettings.title,function(index,value){if($this.elementExists(value,$builderContents)){$this.setPageTitle($($builderContents).find(value+":first").text())}});$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$(".ct-page-overlay").is(":visible")){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded");if($(".oxygen-left-button-wrap").length&&$("button.components-squirrly-icon").length){var $icon=$("button.components-squirrly-icon");$(".oxygen-left-button-wrap").after($icon);$icon.css("position","initial");$icon.css("margin-left","2px")}}},1e3)})})};$this.parseDivi=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#et-fb-app-frame"],title:["h1.entry-title","h1.et_pb_module_header"],header:["h2","h3","h4","h5","h6"],container:["#et-boc"],containerWidget:".et_pb_section",containerWidgetImages:[".et_pb_image_wrap"],saveButton:"et_fb_ajax_save",draftButton:"et-fb-button--save-draft"};$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$(".et-fb-page-preloading").length){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded");if($(".et-fb-button--help").length&&$("button.components-squirrly-icon").length){var $icon=$("button.components-squirrly-icon");$(".et-fb-button--help").after($icon);$icon.css("position","initial");$icon.css("margin-right","5px")}}},1e3)})})};$this.parseWPBakery=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#vc_inline-frame"],title:["h1.entry-title","h1.wp-block-post-title",".vc_container-block h1"],header:[".vc_container-block h2,.vc_container-block h3,.vc_container-block h4,.vc_container-block h5,.vc_container-block h6"],container:[".vc-main-sortable-container"],containerWidget:".wpb_wrapper",containerWidgetImages:[".vc_single_image-img",".wpb_gallery_slides"],saveAction:"vc_save"};$.each(builderSelectorsSettings.title,function(index,value){if($this.elementExists(value,$builderContents)){$this.setPageTitle($($builderContents).find(value+":first").text())}});$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$("#vc_preloader").is(":visible")){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded");if(!$("body > #postsquirrly").length){$("#postsquirrly").appendTo("body")}if($(".vc_navbar-header").length&&$("button.components-squirrly-icon").length){var $icon=$("button.components-squirrly-icon");$(".vc_navbar-header").append($icon);$icon.css("position","initial");$icon.css("margin-top","10px")}}},1e3)})})};$this.parseThrive=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#tve-editor-frame"],title:["h1"],header:["h2","h3","h4","h5","h6"],container:["#tve_editor"],containerWidget:".thrv_wrapper",containerWidgetImages:["img"],saveAction:"tcb_editor_ajax"};$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.children(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$("#tve-page-loader").is(":visible")){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded");if($("#sidebar-bottom").length&&$("button.components-squirrly-icon").length){var $icon=$("button.components-squirrly-icon");$("#sidebar-bottom").prepend($icon);$icon.css("position","initial");$icon.css("margin-right","2px")}}},1e3)})})};$this.parseZion=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#znpb-editor-iframe"],title:["h1.entry-title","h1.zb-el-zionHeading .mce-content-body"],header:["h2.zb-el-zionHeading .mce-content-body","h3.zb-el-zionHeading .mce-content-body","h4.zb-el-zionHeading .mce-content-body","h5.zb-el-zionHeading .mce-content-body","h6.zb-el-zionHeading .mce-content-body"],container:[".znpb-preview-page-wrapper"],containerWidget:".zb-section__innerWrapper",containerWidgetImages:[".znpb-element__wrapper img"],saveButton:".znpb-editor-header__page-save-wrapper--save",draftButton:".znpb-editor-header__page-save-wrapper"};$.each(builderSelectorsSettings.title,function(index,value){if($this.elementExists(value,$builderContents)){$this.setPageTitle($($builderContents).find(value+":first").text())}});$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$(".znpb-loading-wrapper-gif").is(":visible")){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded");if($(".znpb-editor-header__first").length&&$("button.components-squirrly-icon").length){var $icon=$("button.components-squirrly-icon");$(".znpb-editor-header__first").append($icon);$icon.css("position","initial");$icon.css("margin-top","5px")}}},1e3)})})};$this.parseBricks=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#bricks-builder-iframe"],title:["h1.entry-title","h1.brxe-post-title","h1.brxe-heading"],header:["h2","h3","h4","h5","h6"],container:[".brx-body"],containerWidget:"#brx-content",containerWidgetImages:[".brxe-image"],saveAction:"bricks_save_post"};$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$(".et-fb-page-preloading").is(":visible")){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded");if($("#bricks-toolbar").length&&$("button.components-squirrly-icon").length){var $icon=$("button.components-squirrly-icon");$("#bricks-toolbar .group-wrapper.left").append($icon);$icon.css("position","initial");$icon.css("margin-left","2px")}}},1e3)})})};$this.setBuilderExists=function(builderName){builderExists=true;builderInUse=builderName};$this.getBuilderExists=function(){return builderExists};$this.getBuilderName=function(){return builderInUse};$this.getBuilderContainer=function(){if($(builderSelectorsSettings.preview[0]).contents().find(builderSelectorsSettings.container[0]).length>0){return $(builderSelectorsSettings.preview[0]).contents().find(builderSelectorsSettings.container[0]).first()}if(builderSelectorsSettings.preview.length>0){return $(builderSelectorsSettings.preview[0]).contents().find("body")}return false};$this.getPageData=function(){return pageData};$this.getPageURL=function(){return pageData.url};$this.getPageTitle=function(){return pageData.title};$this.getMultipleH1=function(){return pageData.hasMultipleH1};$this.getH1=function(){return pageData.h1};$this.getPageContent=function(){return pageData.content};$this.getPageImages=function(){return pageData.images};$this.getPageHeadline=function(){return pageData.headline};$this.setPageURL=function(url){pageData.url=url};$this.setPageTitle=function(title){pageData.title=title};$this.setH1=function(h1Text){pageData.h1=h1Text};$this.setPageHeadline=function(headline){pageData.headline=headline};$this.setMultipleH1=function(flag){pageData.hasMultipleH1=flag};$this.setPageContent=function(content){pageData.content=content};$this.setPageImages=function(images){pageData.images=images};$this.triggerPageHasChanges=function(){SQ_DEBUG&&console.log("triggerPageHasChanges");$this.trigger("seo.frontend.refresh");$this.trigger("seo.frontend.new_changes")};$this.triggerButtonSaveClicked=function(){SQ_DEBUG&&console.log("triggerButtonSaveClicked");$this.trigger("seo.frontend.refresh");$this.trigger("seo.frontend.page_saved")};$this.on("seo.frontend.refresh",function(){$this.parseBuilders()});$(document).on("click","button",function(){if("#"+$(this).attr("id")===builderSelectorsSettings.saveButton){$this.triggerButtonSaveClicked()}if(typeof builderSelectorsSettings.saveButton!="undefined"){if(builderSelectorsSettings.saveButton.indexOf("#")===-1){if($(this).hasClass(builderSelectorsSettings.saveButton)){$this.triggerButtonSaveClicked()}}}});$(document).on("click","div",function(){if("#"+$(this).attr("id")===builderSelectorsSettings.draftButton){$this.triggerButtonSaveClicked()}if(typeof builderSelectorsSettings.saveButton!="undefined"){if(builderSelectorsSettings.saveButton.indexOf("#")===-1){if($(this).hasClass(builderSelectorsSettings.saveButton)){$this.triggerButtonSaveClicked()}}}if(typeof builderSelectorsSettings.draftButton!="undefined"){if(builderSelectorsSettings.draftButton.indexOf("#")===-1){if($(this).hasClass(builderSelectorsSettings.draftButton)){$this.triggerButtonSaveClicked()}}}});$(document).ajaxSend(function(event,jqxhr,settings){if(typeof settings.data!=="undefined"){if(typeof builderSelectorsSettings.saveAction!="undefined"&&$.isFunction(settings.data.indexOf)){if(settings.data.indexOf(builderSelectorsSettings.saveAction)!==-1){$this.triggerButtonSaveClicked()}}}});setInterval(function(){$this.trigger("seo.frontend.refresh");SQ_DEBUG&&console.log("Check Blocks number: "+$lastNumberOfNodes+" = "+$currentNumberOfNodes);if($lastNumberOfNodes!==$currentNumberOfNodes){$lastNumberOfNodes=$currentNumberOfNodes;$this.triggerPageHasChanges()}},3e4);$.sq_blockseo.on("seo.task_loaded",function(){$(".sq_tasks").find("#sq_alt").remove()});$this.init();window.sq_editor=$this;$this.trigger("seo.frontend.editor_loaded");return $this}})(jQuery);
1
+ (function($){"use strict";if($.isFunction($.fn.sq_frontend)){return}$.fn.sq_frontend=function(options){var $this=this;var settings=$.extend({positions:[],minimize_height:134,maximize_height:100,top:25,bottom:0},options);$.sq_fields=$.extend({wp_form:$(".metabox-location-normal").length>0?$(".metabox-location-normal"):$("#side-sortables"),sq_box_close:$.sq_config.div.find(".sq_box_close"),sq_box_minimize:$.sq_config.div.find(".sq_box_minimize"),sq_box_maximize:$.sq_config.div.find(".sq_box_maximize"),sq_button_squirrly:$(".edit__PinnedPluginIcon-hNdeXr")},$.sq_fields);$.expr.filters.slaoffscreen=function(el){var rect=el.getBoundingClientRect();return rect.x+rect.width<0||rect.y+rect.height<0||(rect.x>window.innerWidth||rect.y>window.innerHeight)};$this.init=function(){var dragposition="";$.sq_config.div.addClass("sq_sticky");$.sq_config.div.addClass("minimized");$.sq_fields.sq_box_minimize.hide();$.sq_fields.sq_box_close.show();$.sq_fields.sq_box_maximize.show();var positions=JSON.parse(localStorage.positions||"{}");$(function(){$.each(positions,function(id,pos){$.sq_config.div.css(pos)});$.sq_config.div.css("height",settings.minimize_height);$.sq_config.div.css("top","auto");if($.fn.draggable){$.sq_config.div.draggable({containment:"body",handle:".sq_header",scroll:true,axis:"x",stop:function(event,ui){positions[this.id]=ui.position;localStorage.positions=JSON.stringify(positions)}})}});$.sq_fields.sq_box_minimize.on("click",function(e){e.stopPropagation();$.sq_config.div.css("height",settings.minimize_height+"px");$.sq_config.div.css("bottom",settings.bottom+"px");$.sq_config.div.css("top","auto");$.sq_config.div.addClass("minimized");$.sq_config.div.scrollTop(0);$.sq_fields.sq_box_minimize.hide();$.sq_fields.sq_box_maximize.show()});$.sq_fields.sq_box_close.on("click",function(){$.sq_config.div.hide();$.sq_setCookie("sq_sla","off")});if($.sq_getCookie("sq_sla")==="off"){$.sq_fields.sq_box_close.trigger("click")}$.sq_fields.sq_box_maximize.on("click",function(){$.sq_config.div.show();if($.sq_config.div.hasClass("minimized")){$.sq_config.div.css("top",settings.top+"px");$.sq_config.div.css("height","auto");$.sq_config.div.css("bottom",0);$.sq_config.div.scrollTop(0);$.sq_config.div.removeClass("minimized");$.sq_fields.sq_box_minimize.show();$.sq_fields.sq_box_maximize.hide()}});$(".editor-writing-flow").css("height","auto");$(window).resize(function(){if(typeof $.sq_config.div!=="undefined"&&$.sq_config.div.is(":slaoffscreen")){$.sq_config.div.css("left","auto");$.sq_config.div.css("right","0px")}})};$this.one("seo.loaded",function(){$this.sq_VisualBuilder()});$this.one("seo.frontend.content_loaded",function(){SQ_DEBUG&&console.log("sq_frontend seo.loaded");if(!$(".components-squirrly-icon").length){$.sq_editor.createEditorButton("components-squirrly-icon")}$(".components-squirrly-icon").on("click",function(){$.sq_fields.sq_box_maximize.trigger("click");$.sq_setCookie("sq_sla","on");$(".components-squirrly-icon").hide()});$.sq_fields.sq_box_close.on("click",function(){$(".components-squirrly-icon").show()});if($.sq_getCookie("sq_sla")==="off"){$(".components-squirrly-icon").show()}else{$.sq_config.div.show()}$this.sq_listenBuilderChange();$this.trigger("seo.frontend.refresh");$this.trigger("seo.frontend.new_changes")});if($.sq_config.div.is(":slaoffscreen")){$.sq_config.div.css("left","auto");$.sq_config.div.css("right","0px")}return $this};$.fn.sq_listenBuilderChange=function(){var $this=this;if(!$.sq_blockseo){return}$this.on("seo.frontend.editor_loaded seo.frontend.new_changes",function(){SQ_DEBUG&&console.log("seo.frontend.new_changes");var ed=$.sq_editor.getFrontendEditor();if(ed){if(ed.getPageTitle()!==""){$.sq_fields.wp_input_title.val(ed.getPageTitle())}$.sq_blockseo.trigger("seo.refresh")}SQ_DEBUG&&console.log("seo.frontend.new_changes DONE")});$.sq_blockseo.on("seo.refresh_click",function(){$this.checkPostAjax()});$this.on("seo.frontend.page_saved",function(){SQ_DEBUG&&console.log("seo.frontend.page_saved");var ed=$.sq_editor.getFrontendEditor();if(ed){if($.sq_blockbriefcase){$.sq_blockbriefcase.trigger("briefcase.save")}var $sq_seo=[];$this.find('input[name="sq_seo[]"]').each(function(){$sq_seo.push(this.value)});$.post($.sq_config.ajaxurl,{action:"sq_ajax_save_post",sq_nonce:$.sq_config.sq_nonce,post_id:$.sq_config.postID,sq_keyword:$.sq_config.keyword,referer:"frontend",sq_seo:$sq_seo}).done(function(){$this.trigger("seo.frontend.new_changes")})}SQ_DEBUG&&console.log("seo.frontend.page_saved DONE")});$this.checkPostAjax=function(){return $.post($.sq_config.ajaxurl,{action:"sq_ajax_get_post",sq_nonce:$.sq_config.sq_nonce,post_id:$.sq_config.postID}).done(function(data){if(typeof data.url!=="undefined"){if(!$.sq_config.div.find("#new-post-slug").length){$.sq_config.div.append('<input type="hidden" id="new-post-slug" />')}$("#new-post-slug").val(data.url)}if(typeof data.post_title!=="undefined"){$.sq_fields.wp_input_title.val(data.post_title)}$this.trigger("seo.frontend.new_changes")})};if(!$.sq_config.div.find("#sq_post_title").length){$.sq_config.div.append('<input type="hidden" id="sq_post_title" />');$.sq_fields.wp_input_title=$("#sq_post_title");$this.checkPostAjax()}};$.fn.sq_VisualBuilder=function(){var $this=this;if(typeof window.sq_editor!=="undefined"){return window.sq_editor}var builderExists=false;var builderInUse="";var $builderContents=null;var $lastNumberOfNodes=0;var $currentNumberOfNodes=0;var $elementLoadingTime=null;var buildersInfo={elementor:{enabled:true,name:"elementor",hasIframe:true,iframeSelector:"#elementor-preview-iframe",parrentDiv:".elementor-editor-active"},WPBakery:{enabled:true,name:"wpbakery",hasIframe:true,iframeSelector:"#vc_inline-frame",parrentDiv:"#vc_editor"},bricks:{enabled:true,name:"bricks",hasIframe:true,iframeSelector:"#bricks-builder-iframe",parrentDiv:"#bricks-builder-iframe-wrapper"},thrive:{enabled:true,name:"thrive",hasIframe:true,iframeSelector:"#tve-editor-frame",parrentDiv:".tcb-editor-main"},divi:{enabled:true,name:"divi",hasIframe:true,iframeSelector:"#et-fb-app-frame",parrentDiv:".et_divi_builder"},oxygen:{enabled:true,name:"oxygen",hasIframe:true,iframeSelector:"#ct-artificial-viewport",parrentDiv:"#oxygen-ui"},zion:{enabled:true,name:"zion",hasIframe:true,iframeSelector:"#znpb-editor-iframe",parrentDiv:".znpb"}};var pageData={url:"",title:"",content:"",h1:"",headline:"",hasMultipleH1:false,images:""};var builderSelectorsSettings={preview:"",h1:"",container:"",containerWidget:"",containerWidgetImages:"",saveButton:"",saveAction:""};var currentNumberOfNodes=null;$this.init=function(){SQ_DEBUG&&console.log("checkBuilderExists");$this.checkBuilderExists()};$this.parseBuilders=function(){SQ_DEBUG&&console.log("Check parseBuilders "+$this.getBuilderName());switch($this.getBuilderName()){case"elementor":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseElementor();break;case"oxygen":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseOxygen();break;case"divi":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");if(typeof $.sq_config.div==="undefined"||typeof $.sq_params.low_density==="undefined"||typeof $.sq_fields.wp_title==="undefined"){$.sq_setConfig();$.sq_setParams();$.sq_setfields()}$this.parseDivi();break;case"wpbakery":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseWPBakery();break;case"zion":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseZion();break;case"thrive":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseThrive();break;case"bricks":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseBricks();break}};$this.checkBuilderExists=function(){SQ_DEBUG&&console.log("Looking for builders");$.each(Object.values(buildersInfo),function(index,builder){SQ_DEBUG&&console.log("Checking for: "+builder.name+" builder");if(builder.enabled===false){return}if(builder.hasIframe){if($this.elementExists(builder.iframeSelector)){SQ_DEBUG&&console.log("Found: "+builder.iframeSelector+" iframe");$(builder.iframeSelector).ready(function(){var iframeReadyInterval=setInterval(function(){SQ_DEBUG&&console.log("Ready iframeSelector: "+builder.iframeSelector+" from builder "+builder.name);$this.setBuilderExists(builder.name);$builderContents=$(builder.iframeSelector).contents()[0];if($($builderContents).text()!==""){clearInterval(iframeReadyInterval)}$this.parseBuilders()},1e3)});return false}}else if($this.elementExists(builder.parrentDiv)){$builderContents=$(builder.parrentDiv).contents();$this.setBuilderExists(builder.name);return false}})};$this.elementExists=function(element,where){var $whereToLook;if(typeof where==="undefined"){$whereToLook=$(document)}else{$whereToLook=$(where)}var $element=$whereToLook.find(element);if(typeof $element!=="undefined"&&$element.length>0){return $element}return false};$this.getBuilderInfo=function(builderName){return buildersInfo[builderName]};$this.waitForElementToDisplay=function(selector,where,time,callback){if($elementLoadingTime){clearTimeout($elementLoadingTime)}var $element=$this.elementExists(selector,where);if($element){callback()}else{$elementLoadingTime=setTimeout(function(){SQ_DEBUG&&console.log("Waiting for: "+selector);$this.waitForElementToDisplay(selector,where,time,callback)},time)}};$this.parseElementor=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#elementor-preview-iframe"],title:["h1.elementor-heading-title","h1.entry-title"],header:["h2","h3","h4","h5","h6"],container:[".elementor-section-wrap",".elementor-inner"],containerWidget:".elementor-widget-container",containerWidgetImages:["img"],saveAction:"save_builder"};$.each(builderSelectorsSettings.title,function(index,value){if($this.elementExists(value,$builderContents)){$this.setPageTitle($($builderContents).find(value+":first").text())}});$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();if($element.find(builderSelectorsSettings.containerWidget).length){$element=$element.find(builderSelectorsSettings.containerWidget)}$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$("#elementor-loading").is(":visible")){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded")}},1e3)})})};$this.parseOxygen=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#ct-artificial-viewport"],title:["h1.ct-headline"],header:["div.bnb-subheading"],container:["#ct-builder"],containerWidget:".ct-inner-wrap",containerWidgetImages:[".ct-image"],saveAction:"oxygen-save-button",draftButton:"oxygen-save-button"};$.each(builderSelectorsSettings.title,function(index,value){if($this.elementExists(value,$builderContents)){$this.setPageTitle($($builderContents).find(value+":first").text())}});$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$(".ct-page-overlay").is(":visible")){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded");if($(".oxygen-left-button-wrap").length&&$("button.components-squirrly-icon").length){var $icon=$("button.components-squirrly-icon");$(".oxygen-left-button-wrap").after($icon);$icon.css("position","initial");$icon.css("margin-left","2px")}}},1e3)})})};$this.parseDivi=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#et-fb-app-frame"],title:["h1.entry-title","h1.et_pb_module_header"],header:["h2","h3","h4","h5","h6"],container:["#et-boc"],containerWidget:".et_pb_section",containerWidgetImages:[".et_pb_image_wrap"],saveButton:"et_fb_ajax_save",draftButton:"et-fb-button--save-draft"};$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$(".et-fb-page-preloading").length){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded");if($(".et-fb-button--help").length&&$("button.components-squirrly-icon").length){var $icon=$("button.components-squirrly-icon");$(".et-fb-button--help").after($icon);$icon.css("position","initial");$icon.css("margin-right","5px")}}},1e3)})})};$this.parseWPBakery=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#vc_inline-frame"],title:["h1.entry-title","h1.wp-block-post-title",".vc_container-block h1"],header:[".vc_container-block h2,.vc_container-block h3,.vc_container-block h4,.vc_container-block h5,.vc_container-block h6"],container:[".vc-main-sortable-container"],containerWidget:".wpb_wrapper",containerWidgetImages:[".vc_single_image-img",".wpb_gallery_slides"],saveAction:"vc_save"};$.each(builderSelectorsSettings.title,function(index,value){if($this.elementExists(value,$builderContents)){$this.setPageTitle($($builderContents).find(value+":first").text())}});$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$("#vc_preloader").is(":visible")){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded");if(!$("body > #postsquirrly").length){$("#postsquirrly").appendTo("body")}if($(".vc_navbar-header").length&&$("button.components-squirrly-icon").length){var $icon=$("button.components-squirrly-icon");$(".vc_navbar-header").append($icon);$icon.css("position","initial");$icon.css("margin-top","10px")}}},1e3)})})};$this.parseThrive=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#tve-editor-frame"],title:["h1"],header:["h2","h3","h4","h5","h6"],container:["#tve_editor"],containerWidget:".thrv_wrapper",containerWidgetImages:["img"],saveAction:"tcb_editor_ajax"};$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.children(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$("#tve-page-loader").is(":visible")){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded");if($("#sidebar-bottom").length&&$("button.components-squirrly-icon").length){var $icon=$("button.components-squirrly-icon");$("#sidebar-bottom").prepend($icon);$icon.css("position","initial");$icon.css("margin-right","2px")}}},1e3)})})};$this.parseZion=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#znpb-editor-iframe"],title:["h1.entry-title","h1.zb-el-zionHeading .mce-content-body"],header:["h2.zb-el-zionHeading .mce-content-body","h3.zb-el-zionHeading .mce-content-body","h4.zb-el-zionHeading .mce-content-body","h5.zb-el-zionHeading .mce-content-body","h6.zb-el-zionHeading .mce-content-body"],container:[".znpb-preview-page-wrapper"],containerWidget:".zb-section__innerWrapper",containerWidgetImages:[".znpb-element__wrapper img"],saveButton:".znpb-editor-header__page-save-wrapper--save",draftButton:".znpb-editor-header__page-save-wrapper"};$.each(builderSelectorsSettings.title,function(index,value){if($this.elementExists(value,$builderContents)){$this.setPageTitle($($builderContents).find(value+":first").text())}});$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$(".znpb-loading-wrapper-gif").is(":visible")){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded");if($(".znpb-editor-header__first").length&&$("button.components-squirrly-icon").length){var $icon=$("button.components-squirrly-icon");$(".znpb-editor-header__first").append($icon);$icon.css("position","initial");$icon.css("margin-top","5px")}}},1e3)})})};$this.parseBricks=function(){SQ_DEBUG&&console.log("Start parsing "+$this.getBuilderName());builderSelectorsSettings={preview:["#bricks-builder-iframe"],title:["h1.entry-title","h1.brxe-post-title","h1.brxe-heading"],header:["h2","h3","h4","h5","h6"],container:[".brx-body"],containerWidget:"#brx-content",containerWidgetImages:[".brxe-image"],saveAction:"bricks_save_post"};$.each(builderSelectorsSettings.container,function(index,container){$this.waitForElementToDisplay(container,$builderContents,$.sq_config.delay_seo,function(){var $container=$($builderContents).find(container);var $elementorWidgets=$container.find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$.each(builderSelectorsSettings.title,function(index,value){if($this.getPageTitle()===""&&$this.elementExists(value,$element)){$this.setPageTitle($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.getPageHeadline()===""&&$this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.elementExists(value,$element)){$this.setPageHeadline($element.find(value+":first").text())}});if($.isFunction($element.html)){textContainerToConcat+=$element.html()}else if(typeof $element.context!="undefined"){textContainerToConcat+=$element.context.innerHTML}$.each(builderSelectorsSettings.containerWidgetImages,function(index,value){var $imagesContainers=$element.find(value);if($imagesContainers.length>0){$.each($imagesContainers,function(){if($.isFunction($(this).html)){textContainerImagesToConcat+=$(this).html()}else if(typeof $(this).context!="undefined"){textContainerImagesToConcat+=$(this).context.innerHTML}});return false}});$element.remove()});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);var triggerLoadInterval=setInterval(function(){if(!$(".et-fb-page-preloading").is(":visible")){clearInterval(triggerLoadInterval);$this.trigger("seo.frontend.content_loaded");if($("#bricks-toolbar").length&&$("button.components-squirrly-icon").length){var $icon=$("button.components-squirrly-icon");$("#bricks-toolbar .group-wrapper.left").append($icon);$icon.css("position","initial");$icon.css("margin-left","2px")}}},1e3)})})};$this.setBuilderExists=function(builderName){builderExists=true;builderInUse=builderName};$this.getBuilderExists=function(){return builderExists};$this.getBuilderName=function(){return builderInUse};$this.getBuilderContainer=function(){if($(builderSelectorsSettings.preview[0]).contents().find(builderSelectorsSettings.container[0]).length>0){return $(builderSelectorsSettings.preview[0]).contents().find(builderSelectorsSettings.container[0]).first()}if(builderSelectorsSettings.preview.length>0){return $(builderSelectorsSettings.preview[0]).contents().find("body")}return false};$this.getPageData=function(){return pageData};$this.getPageURL=function(){return pageData.url};$this.getPageTitle=function(){return pageData.title};$this.getMultipleH1=function(){return pageData.hasMultipleH1};$this.getH1=function(){return pageData.h1};$this.getPageContent=function(){return pageData.content};$this.getPageImages=function(){return pageData.images};$this.getPageHeadline=function(){return pageData.headline};$this.setPageURL=function(url){pageData.url=url};$this.setPageTitle=function(title){pageData.title=title};$this.setH1=function(h1Text){pageData.h1=h1Text};$this.setPageHeadline=function(headline){pageData.headline=headline};$this.setMultipleH1=function(flag){pageData.hasMultipleH1=flag};$this.setPageContent=function(content){pageData.content=content};$this.setPageImages=function(images){pageData.images=images};$this.triggerPageHasChanges=function(){SQ_DEBUG&&console.log("triggerPageHasChanges");$this.trigger("seo.frontend.refresh");$this.trigger("seo.frontend.new_changes")};$this.triggerButtonSaveClicked=function(){SQ_DEBUG&&console.log("triggerButtonSaveClicked");$this.trigger("seo.frontend.refresh");$this.trigger("seo.frontend.page_saved")};$this.on("seo.frontend.refresh",function(){$this.parseBuilders()});$(document).on("click","button",function(){if("#"+$(this).attr("id")===builderSelectorsSettings.saveButton){$this.triggerButtonSaveClicked()}if(typeof builderSelectorsSettings.saveButton!="undefined"){if(builderSelectorsSettings.saveButton.indexOf("#")===-1){if($(this).hasClass(builderSelectorsSettings.saveButton)){$this.triggerButtonSaveClicked()}}}});$(document).on("click","div",function(){if("#"+$(this).attr("id")===builderSelectorsSettings.draftButton){$this.triggerButtonSaveClicked()}if(typeof builderSelectorsSettings.saveButton!="undefined"){if(builderSelectorsSettings.saveButton.indexOf("#")===-1){if($(this).hasClass(builderSelectorsSettings.saveButton)){$this.triggerButtonSaveClicked()}}}if(typeof builderSelectorsSettings.draftButton!="undefined"){if(builderSelectorsSettings.draftButton.indexOf("#")===-1){if($(this).hasClass(builderSelectorsSettings.draftButton)){$this.triggerButtonSaveClicked()}}}});$(document).ajaxSend(function(event,jqxhr,settings){if(typeof settings.data!=="undefined"){if(typeof builderSelectorsSettings.saveAction!="undefined"&&$.isFunction(settings.data.indexOf)){if(settings.data.indexOf(builderSelectorsSettings.saveAction)!==-1){$this.triggerButtonSaveClicked()}}}});setInterval(function(){$this.trigger("seo.frontend.refresh");SQ_DEBUG&&console.log("Check Blocks number: "+$lastNumberOfNodes+" = "+$currentNumberOfNodes);if($lastNumberOfNodes!==$currentNumberOfNodes){$lastNumberOfNodes=$currentNumberOfNodes;$this.triggerPageHasChanges()}},3e4);$.sq_blockseo.on("seo.task_loaded",function(){$(".sq_tasks").find("#sq_alt").remove()});$this.init();window.sq_editor=$this;$this.trigger("seo.frontend.editor_loaded");return $this}})(jQuery);