SEO SQUIRRLY™ - Version 12.1.03

Version Description

Download this release

Release Info

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

Code changes from version 12.1.02 to 12.1.03

controllers/Automation.php CHANGED
@@ -81,13 +81,10 @@ class SQ_Controllers_Automation extends SQ_Classes_FrontController
81
 
82
  break;
83
 
84
- /************************ Automation *******************************************************/
85
  case 'sq_automation_addpostype':
86
  $response = array();
87
  if (!SQ_Classes_Helpers_Tools::userCan('sq_manage_settings')) {
88
- $response['error'] = SQ_Classes_Error::showNotices(esc_html__("You do not have permission to perform this action", 'squirrly-seo'), 'sq_error');
89
- echo wp_json_encode($response);
90
- exit();
91
  }
92
 
93
  //Get the new post type
@@ -128,6 +125,8 @@ class SQ_Controllers_Automation extends SQ_Classes_FrontController
128
  //Return error in case the post is not saved
129
  SQ_Classes_Error::setError(esc_html__("Could not add the post type.", 'squirrly-seo'));
130
  break;
 
 
131
 
132
  case 'sq_ajax_automation_deletepostype':
133
  SQ_Classes_Helpers_Tools::setHeader('json');
81
 
82
  break;
83
 
 
84
  case 'sq_automation_addpostype':
85
  $response = array();
86
  if (!SQ_Classes_Helpers_Tools::userCan('sq_manage_settings')) {
87
+ return;
 
 
88
  }
89
 
90
  //Get the new post type
125
  //Return error in case the post is not saved
126
  SQ_Classes_Error::setError(esc_html__("Could not add the post type.", 'squirrly-seo'));
127
  break;
128
+ /************************ Automation *******************************************************/
129
+
130
 
131
  case 'sq_ajax_automation_deletepostype':
132
  SQ_Classes_Helpers_Tools::setHeader('json');
models/services/JsonLD.php CHANGED
@@ -913,7 +913,7 @@ class SQ_Models_Services_JsonLD extends SQ_Models_Abstract_Seo
913
 
914
  if ($value) {
915
 
916
- if ($key == 'logo' && $value['url'] <> '') {
917
  if (defined('WP_CONTENT_DIR') && $imagepath = str_replace(content_url(), WP_CONTENT_DIR, $value['url'])) {
918
  if (file_exists($imagepath)) {
919
  list($width, $height) = @getimagesize($imagepath);
@@ -1182,6 +1182,10 @@ class SQ_Models_Services_JsonLD extends SQ_Models_Abstract_Seo
1182
  try {
1183
  $product = new WC_Product($this->_post->ID);
1184
 
 
 
 
 
1185
  if (!$product instanceof WC_Product) {
1186
  return;
1187
  }
@@ -1258,26 +1262,30 @@ class SQ_Models_Services_JsonLD extends SQ_Models_Abstract_Seo
1258
  ),
1259
  );
1260
 
1261
-
1262
  //Get the variation prices
1263
- if ($product->is_type('variable') && method_exists($product, 'get_variation_prices')) {
 
1264
  $prices = $product->get_variation_prices();
1265
-
1266
  if (isset($prices['price'])) {
1267
  //Get the product price
1268
  $price = $product->get_price();
 
 
1269
 
1270
  //Get the price with VAT if exists
1271
  if (function_exists('wc_get_price_including_tax') && function_exists('wc_tax_enabled') ) {
1272
  if ( wc_tax_enabled() && ! wc_prices_include_tax() && 'incl' === get_option( 'woocommerce_tax_display_shop' ) ) {
1273
  $price = wc_get_price_including_tax($product, array('price' => $price));
 
 
1274
  }
1275
  }
1276
 
1277
  $markup_offer['priceSpecification'] = array(
1278
  'price' => wc_format_decimal($price, wc_get_price_decimals()),
1279
- 'minPrice' => wc_format_decimal(current($prices['price']), wc_get_price_decimals()),
1280
- 'maxPrice' => wc_format_decimal(end($prices['price']), wc_get_price_decimals()),
1281
  'priceCurrency' => $currency,
1282
  );
1283
  }
913
 
914
  if ($value) {
915
 
916
+ if ($key == 'logo' && isset($value['url']) && $value['url'] <> '') {
917
  if (defined('WP_CONTENT_DIR') && $imagepath = str_replace(content_url(), WP_CONTENT_DIR, $value['url'])) {
918
  if (file_exists($imagepath)) {
919
  list($width, $height) = @getimagesize($imagepath);
1182
  try {
1183
  $product = new WC_Product($this->_post->ID);
1184
 
1185
+ if(class_exists('WC_Product_Variable')) {
1186
+ $product = WC_Product_Variable::sync($this->_post->ID);
1187
+ }
1188
+
1189
  if (!$product instanceof WC_Product) {
1190
  return;
1191
  }
1262
  ),
1263
  );
1264
 
 
1265
  //Get the variation prices
1266
+ if ($product->is_type('variable') && method_exists($product, 'get_variation_prices')
1267
+ && method_exists($product, 'get_variation_regular_price') && method_exists($product, 'get_variation_sale_price')) {
1268
  $prices = $product->get_variation_prices();
1269
+ $markup['aaaa'] = json_encode($prices);
1270
  if (isset($prices['price'])) {
1271
  //Get the product price
1272
  $price = $product->get_price();
1273
+ $minprice = $product->get_variation_price();
1274
+ $maxprice = $product->get_variation_price('max');
1275
 
1276
  //Get the price with VAT if exists
1277
  if (function_exists('wc_get_price_including_tax') && function_exists('wc_tax_enabled') ) {
1278
  if ( wc_tax_enabled() && ! wc_prices_include_tax() && 'incl' === get_option( 'woocommerce_tax_display_shop' ) ) {
1279
  $price = wc_get_price_including_tax($product, array('price' => $price));
1280
+ $minprice = wc_get_price_including_tax($product, array('price' => $minprice));
1281
+ $maxprice = wc_get_price_including_tax($product, array('price' => $maxprice));
1282
  }
1283
  }
1284
 
1285
  $markup_offer['priceSpecification'] = array(
1286
  'price' => wc_format_decimal($price, wc_get_price_decimals()),
1287
+ 'minPrice' => wc_format_decimal($minprice, wc_get_price_decimals()),
1288
+ 'maxPrice' => wc_format_decimal($maxprice, wc_get_price_decimals()),
1289
  'priceCurrency' => $currency,
1290
  );
1291
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.02
8
  Requires PHP: 7.0
9
  License: GPLv2 or later
10
 
@@ -669,11 +669,17 @@ Type a keyword to the right of the screen and start using Squirrly Seo. Enjoy!
669
  9. Squirrly SEO - Progress & Achievements
670
 
671
  == Changelog ==
672
- = 12.1.02- 05/19/2022 =
673
  Update - Live Assistant for integrated version & added the SLA integrate option in Live Assistant > Settings
674
  Fix - RTL CSS for Live Assistant and SEO Configuration
675
  Fix - Update the compatibility with JetPack
676
  Fix - DevKit instalation to load the correct custom logo
 
 
 
 
 
 
677
 
678
  = 12.1.01- 05/17/2022 =
679
  Fix - Show Squirrly logo in Page Editor toolbar to open/close Squirrly Live Assistant
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.03
8
  Requires PHP: 7.0
9
  License: GPLv2 or later
10
 
669
  9. Squirrly SEO - Progress & Achievements
670
 
671
  == Changelog ==
672
+ = 12.1.03- 05/19/2022 =
673
  Update - Live Assistant for integrated version & added the SLA integrate option in Live Assistant > Settings
674
  Fix - RTL CSS for Live Assistant and SEO Configuration
675
  Fix - Update the compatibility with JetPack
676
  Fix - DevKit instalation to load the correct custom logo
677
+ Fix - Prevent PHP Notifications in SEO Snippet
678
+ Fix - Prevent double border when SEO Automation is activated
679
+ Fix - Fixed the save process in SEO Automation to not show error message
680
+ Fix - Add the comparison images when other SEO plugins are activated
681
+ Fix - Update the tasks from Next SEO Goals
682
+ Fix - Update the Briefcase and Ranking Tables to select the number of rows to show
683
 
684
  = 12.1.01- 05/17/2022 =
685
  Fix - Show Squirrly logo in Page Editor toolbar to open/close Squirrly Live Assistant
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.02
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.02');
21
  //The last stable version
22
  define('SQ_STABLE_VERSION', '11.1.12');
23
  // Call config files
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.03
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.03');
21
  //The last stable version
22
  define('SQ_STABLE_VERSION', '11.1.12');
23
  // Call config files
view/Automation/Automation.php CHANGED
@@ -59,7 +59,7 @@
59
  <div class="small text-black-50 mt-1 mb-0"><?php echo esc_html__("Recommended Length: 10-75 chars", 'squirrly-seo'); ?></div>
60
  </div>
61
  <div class="col-8 p-0 sq_pattern_field">
62
- <textarea rows="1" class="form-control bg-input" name="patterns[<?php echo esc_attr($pattern) ?>][title]"><?php echo esc_html($type['title']) ?></textarea>
63
  </div>
64
  </div>
65
  <div class="col-12 row p-0 m-0 my-5">
@@ -69,7 +69,7 @@
69
  <div class="small text-black-50 mt-1 mb-0"><?php echo esc_html__("Recommended Length: 70-320 chars", 'squirrly-seo'); ?></div>
70
  </div>
71
  <div class="col-8 p-0 sq_pattern_field">
72
- <textarea class="form-control" name="patterns[<?php echo esc_attr($pattern) ?>][description]" rows="5"><?php echo esc_html($type['description']) ?></textarea>
73
  </div>
74
  </div>
75
 
@@ -85,7 +85,7 @@
85
  $seps = json_decode(SQ_ALL_SEP, true);
86
 
87
  foreach ($seps as $sep => $code) { ?>
88
- <option value="<?php echo esc_attr($sep) ?>" <?php echo ($type['sep'] == $sep) ? 'selected="selected"' : '' ?>><?php echo esc_html($code) ?></option>
89
  <?php } ?>
90
  </select>
91
  </div>
@@ -97,7 +97,7 @@
97
  <div class="col-12 row p-0 m-0 my-5">
98
  <div class="col-12 p-0 sq-switch sq-switch-sm">
99
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][noindex]" value="1"/>
100
- <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_noindex" name="patterns[<?php echo esc_attr($pattern) ?>][noindex]" class="sq-switch" <?php echo(($type['noindex'] == 0) ? 'checked="checked"' : '') ?> value="0"/>
101
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_noindex" class="ml-1"><?php echo esc_html__("Let Google Index it", 'squirrly-seo'); ?>
102
  <a href="https://howto12.squirrly.co/kb/seo-automation/#let_google_index" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
103
  </label>
@@ -112,7 +112,7 @@
112
  <div class="checker col-12 row m-0 p-0">
113
  <div class="col-12 p-0 sq-switch sq-switch-sm <?php echo((!SQ_Classes_Helpers_Tools::getOption('sq_auto_metas') || !SQ_Classes_Helpers_Tools::getOption('sq_auto_noindex')) ? 'sq_deactivated' : ''); ?>">
114
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][nofollow]" value="1"/>
115
- <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_nofollow" name="patterns[<?php echo esc_attr($pattern) ?>][nofollow]" class="sq-switch" <?php echo(($type['nofollow'] == 0) ? 'checked="checked"' : '') ?> value="0"/>
116
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_nofollow" class="ml-1"><?php echo esc_html__("Send Authority to it", 'squirrly-seo'); ?>
117
  <a href="https://howto12.squirrly.co/kb/seo-automation/#send_authority" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
118
  </label>
@@ -129,7 +129,7 @@
129
  <div class="checker col-12 row m-0 p-0">
130
  <div class="col-12 p-0 sq-switch sq-switch-sm <?php echo((!SQ_Classes_Helpers_Tools::getOption('sq_auto_sitemap')) ? 'sq_deactivated' : ''); ?>">
131
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_sitemap]" value="0"/>
132
- <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_sitemap" name="patterns[<?php echo esc_attr($pattern) ?>][do_sitemap]" class="sq-switch" <?php echo(($type['do_sitemap'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
133
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_sitemap" class="ml-1"><?php echo esc_html__("Include In Sitemap", 'squirrly-seo'); ?>
134
  <a href="https://howto12.squirrly.co/kb/seo-automation/#send_to_sitemap" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
135
  </label>
@@ -147,7 +147,7 @@
147
  <div class="checker col-12 row m-0 p-0">
148
  <div class="col-12 m-0 p-0 sq-switch sq-switch-sm">
149
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_redirects]" value="0"/>
150
- <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_redirects" name="patterns[<?php echo esc_attr($pattern) ?>][do_redirects]" class="sq-switch" <?php echo(($type['do_redirects'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
151
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_redirects" class="ml-1"><?php echo esc_html__("Redirect Broken URLs", 'squirrly-seo'); ?>
152
  <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>
153
  </label>
@@ -188,7 +188,7 @@
188
  <div class="checker col-12 row m-0 p-0">
189
  <div class="col-12 p-0 sq-switch sq-switch-sm">
190
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_metas]" value="0"/>
191
- <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_metas" name="patterns[<?php echo esc_attr($pattern) ?>][do_metas]" class="sq-switch" <?php echo(($type['do_metas'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
192
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_metas" class="ml-1"><?php echo esc_html__("Load Squirrly SEO METAs", 'squirrly-seo'); ?>
193
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_squirrly_metas" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
194
  </label>
@@ -203,7 +203,7 @@
203
  <div class="checker col-12 row m-0 p-0">
204
  <div class="col-12 p-0 sq-switch sq-switch-sm">
205
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_pattern]" value="0"/>
206
- <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_pattern" name="patterns[<?php echo esc_attr($pattern) ?>][do_pattern]" class="sq-switch" <?php echo(($type['do_pattern'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
207
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_pattern" class="ml-1"><?php echo esc_html__("Load Squirrly Patterns", 'squirrly-seo'); ?>
208
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_squirrly_patterns" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
209
  </label>
@@ -218,7 +218,7 @@
218
  <div class="checker col-12 row m-0 p-0">
219
  <div class="col-12 p-0 sq-switch sq-switch-sm">
220
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_jsonld]" value="0"/>
221
- <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_jsonld" name="patterns[<?php echo esc_attr($pattern) ?>][do_jsonld]" class="sq-switch" <?php echo(($type['do_jsonld'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
222
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_jsonld" class="ml-1"><?php echo esc_html__("Load JSON-LD Structured Data", 'squirrly-seo'); ?>
223
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_jsonld_schema" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
224
  </label>
@@ -260,7 +260,7 @@
260
  <div class="checker col-12 row m-0 p-0">
261
  <div class="col-12 p-0 sq-switch sq-switch-sm">
262
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_og]" value="0"/>
263
- <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_og" name="patterns[<?php echo esc_attr($pattern) ?>][do_og]" class="sq-switch" <?php echo(($type['do_og'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
264
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_og" class="ml-1"><?php echo esc_html__("Load Squirrly Open Graph", 'squirrly-seo'); ?>
265
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_open_graph" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
266
  </label>
@@ -284,7 +284,7 @@
284
  <div class="col-5 p-0">
285
  <select name="patterns[<?php echo esc_attr($pattern) ?>][og_type]" class="form-control bg-input mb-1 border">
286
  <?php foreach ($post_types as $post_type => $og_type) { ?>
287
- <option <?php echo(($type['og_type'] == $og_type) ? 'selected="selected"' : '') ?> value="<?php echo esc_attr($og_type) ?>">
288
  <?php echo esc_html(ucfirst($og_type)) ?>
289
  </option>
290
  <?php } ?>
@@ -301,7 +301,7 @@
301
  <div class="checker col-12 row m-0 p-0">
302
  <div class="col-12 p-0 sq-switch sq-switch-sm">
303
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_twc]" value="0"/>
304
- <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_twc" name="patterns[<?php echo esc_attr($pattern) ?>][do_twc]" class="sq-switch" <?php echo(($type['do_twc'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
305
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_twc" class="ml-1"><?php echo esc_html__("Load Squirrly Twitter Card", 'squirrly-seo'); ?>
306
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_twitter_card" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
307
  </label>
@@ -316,7 +316,7 @@
316
  <div class="checker col-12 row m-0 p-0">
317
  <div class="col-12 p-0 sq-switch sq-switch-sm">
318
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_analytics]" value="0"/>
319
- <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_analytics" name="patterns[<?php echo esc_attr($pattern) ?>][do_analytics]" class="sq-switch" <?php echo(($type['do_analytics'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
320
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_analytics" class="ml-1"><?php echo esc_html__("Load Google Analytics Tracking Script", 'squirrly-seo'); ?>
321
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_analytics_tracking" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
322
  </label>
@@ -333,7 +333,7 @@
333
  <div class="checker col-12 row m-0 p-0">
334
  <div class="col-12 p-0 sq-switch sq-switch-sm">
335
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_fpixel]" value="0"/>
336
- <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_fpixel" name="patterns[<?php echo esc_attr($pattern) ?>][do_fpixel]" class="sq-switch" <?php echo(($type['do_fpixel'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
337
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_fpixel" class="ml-1"><?php echo esc_html__("Load Facebook Pixel Tracking Script", 'squirrly-seo'); ?>
338
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_facebook_pixel" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
339
  </label>
59
  <div class="small text-black-50 mt-1 mb-0"><?php echo esc_html__("Recommended Length: 10-75 chars", 'squirrly-seo'); ?></div>
60
  </div>
61
  <div class="col-8 p-0 sq_pattern_field">
62
+ <textarea rows="1" class="form-control bg-input" name="patterns[<?php echo esc_attr($pattern) ?>][title]"><?php echo (isset($type['title'])) ? esc_html($type['title']) : '' ?></textarea>
63
  </div>
64
  </div>
65
  <div class="col-12 row p-0 m-0 my-5">
69
  <div class="small text-black-50 mt-1 mb-0"><?php echo esc_html__("Recommended Length: 70-320 chars", 'squirrly-seo'); ?></div>
70
  </div>
71
  <div class="col-8 p-0 sq_pattern_field">
72
+ <textarea class="form-control" name="patterns[<?php echo esc_attr($pattern) ?>][description]" rows="5"><?php echo (isset($type['description']) ? esc_html($type['description']) : '') ?></textarea>
73
  </div>
74
  </div>
75
 
85
  $seps = json_decode(SQ_ALL_SEP, true);
86
 
87
  foreach ($seps as $sep => $code) { ?>
88
+ <option value="<?php echo esc_attr($sep) ?>" <?php echo (isset($type['sep']) && $type['sep'] == $sep) ? 'selected="selected"' : '' ?>><?php echo esc_html($code) ?></option>
89
  <?php } ?>
90
  </select>
91
  </div>
97
  <div class="col-12 row p-0 m-0 my-5">
98
  <div class="col-12 p-0 sq-switch sq-switch-sm">
99
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][noindex]" value="1"/>
100
+ <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_noindex" name="patterns[<?php echo esc_attr($pattern) ?>][noindex]" class="sq-switch" <?php echo((isset($type['noindex']) && $type['noindex'] == 0) ? 'checked="checked"' : '') ?> value="0"/>
101
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_noindex" class="ml-1"><?php echo esc_html__("Let Google Index it", 'squirrly-seo'); ?>
102
  <a href="https://howto12.squirrly.co/kb/seo-automation/#let_google_index" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
103
  </label>
112
  <div class="checker col-12 row m-0 p-0">
113
  <div class="col-12 p-0 sq-switch sq-switch-sm <?php echo((!SQ_Classes_Helpers_Tools::getOption('sq_auto_metas') || !SQ_Classes_Helpers_Tools::getOption('sq_auto_noindex')) ? 'sq_deactivated' : ''); ?>">
114
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][nofollow]" value="1"/>
115
+ <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_nofollow" name="patterns[<?php echo esc_attr($pattern) ?>][nofollow]" class="sq-switch" <?php echo((isset($type['nofollow']) && $type['nofollow'] == 0) ? 'checked="checked"' : '') ?> value="0"/>
116
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_nofollow" class="ml-1"><?php echo esc_html__("Send Authority to it", 'squirrly-seo'); ?>
117
  <a href="https://howto12.squirrly.co/kb/seo-automation/#send_authority" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
118
  </label>
129
  <div class="checker col-12 row m-0 p-0">
130
  <div class="col-12 p-0 sq-switch sq-switch-sm <?php echo((!SQ_Classes_Helpers_Tools::getOption('sq_auto_sitemap')) ? 'sq_deactivated' : ''); ?>">
131
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_sitemap]" value="0"/>
132
+ <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_sitemap" name="patterns[<?php echo esc_attr($pattern) ?>][do_sitemap]" class="sq-switch" <?php echo((isset($type['do_sitemap']) && $type['do_sitemap'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
133
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_sitemap" class="ml-1"><?php echo esc_html__("Include In Sitemap", 'squirrly-seo'); ?>
134
  <a href="https://howto12.squirrly.co/kb/seo-automation/#send_to_sitemap" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
135
  </label>
147
  <div class="checker col-12 row m-0 p-0">
148
  <div class="col-12 m-0 p-0 sq-switch sq-switch-sm">
149
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_redirects]" value="0"/>
150
+ <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_redirects" name="patterns[<?php echo esc_attr($pattern) ?>][do_redirects]" class="sq-switch" <?php echo((isset($type['do_redirects']) && $type['do_redirects'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
151
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_redirects" class="ml-1"><?php echo esc_html__("Redirect Broken URLs", 'squirrly-seo'); ?>
152
  <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>
153
  </label>
188
  <div class="checker col-12 row m-0 p-0">
189
  <div class="col-12 p-0 sq-switch sq-switch-sm">
190
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_metas]" value="0"/>
191
+ <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_metas" name="patterns[<?php echo esc_attr($pattern) ?>][do_metas]" class="sq-switch" <?php echo((isset($type['do_metas']) && $type['do_metas'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
192
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_metas" class="ml-1"><?php echo esc_html__("Load Squirrly SEO METAs", 'squirrly-seo'); ?>
193
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_squirrly_metas" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
194
  </label>
203
  <div class="checker col-12 row m-0 p-0">
204
  <div class="col-12 p-0 sq-switch sq-switch-sm">
205
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_pattern]" value="0"/>
206
+ <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_pattern" name="patterns[<?php echo esc_attr($pattern) ?>][do_pattern]" class="sq-switch" <?php echo((isset($type['do_pattern']) && $type['do_pattern'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
207
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_pattern" class="ml-1"><?php echo esc_html__("Load Squirrly Patterns", 'squirrly-seo'); ?>
208
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_squirrly_patterns" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
209
  </label>
218
  <div class="checker col-12 row m-0 p-0">
219
  <div class="col-12 p-0 sq-switch sq-switch-sm">
220
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_jsonld]" value="0"/>
221
+ <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_jsonld" name="patterns[<?php echo esc_attr($pattern) ?>][do_jsonld]" class="sq-switch" <?php echo((isset($type['do_jsonld']) && $type['do_jsonld'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
222
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_jsonld" class="ml-1"><?php echo esc_html__("Load JSON-LD Structured Data", 'squirrly-seo'); ?>
223
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_jsonld_schema" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
224
  </label>
260
  <div class="checker col-12 row m-0 p-0">
261
  <div class="col-12 p-0 sq-switch sq-switch-sm">
262
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_og]" value="0"/>
263
+ <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_og" name="patterns[<?php echo esc_attr($pattern) ?>][do_og]" class="sq-switch" <?php echo((isset($type['do_og']) && $type['do_og'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
264
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_og" class="ml-1"><?php echo esc_html__("Load Squirrly Open Graph", 'squirrly-seo'); ?>
265
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_open_graph" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
266
  </label>
284
  <div class="col-5 p-0">
285
  <select name="patterns[<?php echo esc_attr($pattern) ?>][og_type]" class="form-control bg-input mb-1 border">
286
  <?php foreach ($post_types as $post_type => $og_type) { ?>
287
+ <option <?php echo((isset($type['og_type']) && $type['og_type'] == $og_type) ? 'selected="selected"' : '') ?> value="<?php echo esc_attr($og_type) ?>">
288
  <?php echo esc_html(ucfirst($og_type)) ?>
289
  </option>
290
  <?php } ?>
301
  <div class="checker col-12 row m-0 p-0">
302
  <div class="col-12 p-0 sq-switch sq-switch-sm">
303
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_twc]" value="0"/>
304
+ <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_twc" name="patterns[<?php echo esc_attr($pattern) ?>][do_twc]" class="sq-switch" <?php echo((isset($type['do_twc']) && $type['do_twc'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
305
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_twc" class="ml-1"><?php echo esc_html__("Load Squirrly Twitter Card", 'squirrly-seo'); ?>
306
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_twitter_card" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
307
  </label>
316
  <div class="checker col-12 row m-0 p-0">
317
  <div class="col-12 p-0 sq-switch sq-switch-sm">
318
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_analytics]" value="0"/>
319
+ <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_analytics" name="patterns[<?php echo esc_attr($pattern) ?>][do_analytics]" class="sq-switch" <?php echo((isset($type['do_analytics']) && $type['do_analytics'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
320
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_analytics" class="ml-1"><?php echo esc_html__("Load Google Analytics Tracking Script", 'squirrly-seo'); ?>
321
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_analytics_tracking" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
322
  </label>
333
  <div class="checker col-12 row m-0 p-0">
334
  <div class="col-12 p-0 sq-switch sq-switch-sm">
335
  <input type="hidden" name="patterns[<?php echo esc_attr($pattern) ?>][do_fpixel]" value="0"/>
336
+ <input type="checkbox" id="sq_patterns_<?php echo esc_attr($pattern) ?>_do_fpixel" name="patterns[<?php echo esc_attr($pattern) ?>][do_fpixel]" class="sq-switch" <?php echo((isset($type['do_fpixel']) && $type['do_fpixel'] == 1) ? 'checked="checked"' : '') ?> value="1"/>
337
  <label for="sq_patterns_<?php echo esc_attr($pattern) ?>_do_fpixel" class="ml-1"><?php echo esc_html__("Load Facebook Pixel Tracking Script", 'squirrly-seo'); ?>
338
  <a href="https://howto12.squirrly.co/kb/seo-automation/#load_facebook_pixel" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
339
  </label>
view/Automation/Types.php CHANGED
@@ -16,8 +16,8 @@
16
 
17
  <div class="col-12 p-0 m-0">
18
  <form method="POST">
19
- <?php SQ_Classes_Helpers_Tools::setNonce('sq_seosettings_automation', 'sq_nonce'); ?>
20
- <input type="hidden" name="action" value="sq_seosettings_automation"/>
21
 
22
  <div class="sq_breadcrumbs my-4"><?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getBreadcrumbs('sq_automation') ?></div>
23
  <h3 class="mt-4 card-title">
@@ -32,84 +32,80 @@
32
 
33
  <div class="col-12 p-0 m-0 my-5">
34
 
35
- <?php
36
- $filter = array('public' => true, '_builtin' => false);
37
- $types = get_post_types($filter);
38
 
39
- $new_types = array();
40
- foreach ($types as $pattern => $type) {
41
- if (in_array($pattern, array('elementor_library','ct_template','oxy_user_library','fusion_template'))) continue;
42
 
43
- if (in_array($pattern, array_keys(SQ_Classes_Helpers_Tools::getOption('patterns')))) {
44
- continue;
 
 
45
  }
46
- $new_types[$pattern] = $type;
47
- }
48
- foreach ($types as $pattern => $type) {
49
- if (in_array($pattern, array('shop_2'))) continue;
 
 
 
 
50
 
51
- if ($post_type_obj = get_post_type_object($pattern)) {
52
- if (!$post_type_obj->has_archive) {
53
  continue;
54
  }
55
- }
56
 
57
- if (in_array('archive-' . $pattern, array_keys(SQ_Classes_Helpers_Tools::getOption('patterns')))) {
58
- continue;
59
  }
60
 
61
- $new_types['archive-' . $pattern] = $type;
62
- }
63
-
64
- $filter = array('public' => true,);
65
- $taxonomies = get_taxonomies($filter);
66
- foreach ($taxonomies as $pattern => $type) {
67
- if (in_array($pattern, array('post_tag', 'post_format', 'product_cat', 'product_tag', 'product_shipping_class'))) continue;
68
 
69
- if (in_array('tax-' . $pattern, array_keys(SQ_Classes_Helpers_Tools::getOption('patterns')))) {
70
- continue;
 
 
71
  }
72
- $new_types['tax-' . $pattern] = $type;
73
- }
74
- if (!empty($new_types)) { ?>
75
- <div class="col-12 row m-0 p-0">
76
- <div class="col-12 row py-2 mx-0 my-3">
77
- <div class="col-4 p-1">
78
- <div class="font-weight-bold">
79
- <?php echo esc_html__("Add Post Type", 'squirrly-seo'); ?>:<a href="https://howto12.squirrly.co/kb/seo-automation/#add_post_type" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
80
  </div>
81
- <div class="small text-black-50"><?php echo esc_html__("Add new post types in the list and customize the automation for it.", 'squirrly-seo'); ?></div>
82
- </div>
83
- <div class="col-8 m-0 p-0 input-group">
84
- <select id="sq_select_post_types" name="posttype" class="form-control bg-input m-0">
85
- <?php
86
- foreach ($new_types as $pattern => $type) {
87
- ?>
88
- <option value="<?php echo esc_attr($pattern) ?>"><?php echo esc_html(ucwords(str_replace(array('-', '_'), ' ',$pattern))); ?> (<?php echo esc_html($pattern) ?>)</option>
89
- <?php } ?>
90
- </select>
91
 
92
- <button type="submit" data-input="sq_select_post_types" data-action="sq_automation_addpostype" data-name="post_type" class="btn btn-primary rounded-0"><?php echo esc_html__("Add Post Type", 'squirrly-seo'); ?></button>
93
 
 
94
  </div>
95
  </div>
96
- </div>
97
-
98
- <div class="col-12 m-0 p-0 mt-5">
99
- <button type="submit" class="btn btn-primary btn-lg m-0 p-0 py-2 px-4 rounded-0"><?php echo esc_html__("Save Settings", 'squirrly-seo'); ?></button>
100
- </div>
101
 
102
- <?php }else{?>
103
- <div class="col-12 p-0 m-0 my-3">
104
- <h4 class="my-3"><?php echo esc_html__("All the post types are sent for Automation", 'squirrly-seo'); ?></h4>
105
- <a href="<?php echo SQ_Classes_Helpers_Tools::getAdminUrl('sq_automation', 'automation') ?>" class="btn btn-primary btn-lg m-0 p-0 py-2 px-4 rounded-0"><?php echo esc_html__("Start Automation Setup", 'squirrly-seo'); ?></a>
106
- </div>
107
 
108
- <?php }?>
109
 
110
 
111
 
112
- </div>
113
  </form>
114
  </div>
115
 
16
 
17
  <div class="col-12 p-0 m-0">
18
  <form method="POST">
19
+ <?php SQ_Classes_Helpers_Tools::setNonce('sq_automation_addpostype', 'sq_nonce'); ?>
20
+ <input type="hidden" name="action" value="sq_automation_addpostype"/>
21
 
22
  <div class="sq_breadcrumbs my-4"><?php echo SQ_Classes_ObjController::getClass('SQ_Models_Menu')->getBreadcrumbs('sq_automation') ?></div>
23
  <h3 class="mt-4 card-title">
32
 
33
  <div class="col-12 p-0 m-0 my-5">
34
 
35
+ <?php
36
+ $filter = array('public' => true, '_builtin' => false);
37
+ $types = get_post_types($filter);
38
 
39
+ $new_types = array();
40
+ foreach ($types as $pattern => $type) {
41
+ if (in_array($pattern, array('elementor_library','ct_template','oxy_user_library','fusion_template'))) continue;
42
 
43
+ if (in_array($pattern, array_keys(SQ_Classes_Helpers_Tools::getOption('patterns')))) {
44
+ continue;
45
+ }
46
+ $new_types[$pattern] = $type;
47
  }
48
+ foreach ($types as $pattern => $type) {
49
+ if (in_array($pattern, array('shop_2'))) continue;
50
+
51
+ if ($post_type_obj = get_post_type_object($pattern)) {
52
+ if (!$post_type_obj->has_archive) {
53
+ continue;
54
+ }
55
+ }
56
 
57
+ if (in_array('archive-' . $pattern, array_keys(SQ_Classes_Helpers_Tools::getOption('patterns')))) {
 
58
  continue;
59
  }
 
60
 
61
+ $new_types['archive-' . $pattern] = $type;
 
62
  }
63
 
64
+ $filter = array('public' => true,);
65
+ $taxonomies = get_taxonomies($filter);
66
+ foreach ($taxonomies as $pattern => $type) {
67
+ if (in_array($pattern, array('post_tag', 'post_format', 'product_cat', 'product_tag', 'product_shipping_class'))) continue;
 
 
 
68
 
69
+ if (in_array('tax-' . $pattern, array_keys(SQ_Classes_Helpers_Tools::getOption('patterns')))) {
70
+ continue;
71
+ }
72
+ $new_types['tax-' . $pattern] = $type;
73
  }
74
+ if (!empty($new_types)) { ?>
75
+ <div class="col-12 row m-0 p-0">
76
+ <div class="col-12 row py-2 mx-0 my-3">
77
+ <div class="col-4 p-1">
78
+ <div class="font-weight-bold">
79
+ <?php echo esc_html__("Add Post Type", 'squirrly-seo'); ?>:<a href="https://howto12.squirrly.co/kb/seo-automation/#add_post_type" target="_blank"><i class="fa-solid fa-question-circle m-0 px-2" style="display: inline;"></i></a>
80
+ </div>
81
+ <div class="small text-black-50"><?php echo esc_html__("Add new post types in the list and customize the automation for it.", 'squirrly-seo'); ?></div>
82
  </div>
83
+ <div class="col-8 m-0 p-0 input-group">
84
+ <select id="sq_select_post_types" name="posttype" class="form-control bg-input m-0">
85
+ <?php
86
+ foreach ($new_types as $pattern => $type) {
87
+ ?>
88
+ <option value="<?php echo esc_attr($pattern) ?>"><?php echo esc_html(ucwords(str_replace(array('-', '_'), ' ',$pattern))); ?> (<?php echo esc_html($pattern) ?>)</option>
89
+ <?php } ?>
90
+ </select>
 
 
91
 
92
+ <button type="submit" class="btn btn-primary rounded-0"><?php echo esc_html__("Add Post Type", 'squirrly-seo'); ?></button>
93
 
94
+ </div>
95
  </div>
96
  </div>
 
 
 
 
 
97
 
98
+ <?php }else{?>
99
+ <div class="col-12 p-0 m-0 my-3">
100
+ <h4 class="my-3"><?php echo esc_html__("All the post types are sent for Automation", 'squirrly-seo'); ?></h4>
101
+ <a href="<?php echo SQ_Classes_Helpers_Tools::getAdminUrl('sq_automation', 'automation') ?>" class="btn btn-primary btn-lg m-0 p-0 py-2 px-4 rounded-0"><?php echo esc_html__("Start Automation Setup", 'squirrly-seo'); ?></a>
102
+ </div>
103
 
104
+ <?php }?>
105
 
106
 
107
 
108
+ </div>
109
  </form>
110
  </div>
111
 
view/assets/css/post.min.css CHANGED
@@ -1 +1 @@
1
- @import url(https://fonts.googleapis.com/css2?family=Noto+Sans&display=swap);@-ms-keyframes play{0%{background-position:0}to{background-position:-400px}}@-o-keyframes play{0%{background-position:0}to{background-position:-400px}}@keyframes play{0%{background-position:0}to{background-position:-400px}}.sq_minloading{position:relative;opacity:.5;min-height:40px}.sq_loading{height:60px;background:url(../img/loading.gif) no-repeat center!important}.sq_minloading:before{position:absolute!important;right:calc(50% - 10px)!important;top:calc(50% - 8px)!important;display:block!important;float:right!important;line-height:30px!important;content:""!important;padding:0!important;margin:0 0 0 5px!important;height:16px!important;width:20px!important;background:url(../img/minloading.png) no-repeat!important;-webkit-animation:play 1s steps(10) infinite;-moz-animation:play 1s steps(10) infinite;-o-animation:play 1s steps(10) infinite;animation:play 1s steps(10) infinite}#sq_preloading,.sq_sla_connect_notice{font-size:.875rem;line-height:24px;text-align:center}#sq_preloading{color:gray}.sq_sla_connect_notice{font-weight:600;margin:0 auto 10px}.sq_sla_connect_notice_content{text-align:center;margin:6px auto}#postsquirrly .sq_frontend_noapi a,.sq_sla_connect_notice a{text-decoration:none}#postsquirrly .sq_frontend_noapi_inner img,.sq_sla_connect_notice_content a img{width:277px}#postsquirrly *,#sq_blocksnippet *{box-sizing:border-box}#postsquirrly{color:#000}#postsquirrly a:not(.btn,.sq_button){color:#6200ee}#sq_blocksnippet.sq_sticky:not(.closed) .inside{display:block!important}#sq_blocksnippet.sq_sticky.closed .inside{display:none!important}#postsquirrly.sq_sticky{background:0 0;border:0;margin:0;-moz-box-shadow:none;-webkit-box-shadow:none}#postsquirrly:not(.sq_sticky){padding:0;border:1px solid #ddd}#postsquirrly :not(.fa,.fa-solid,.fa-brands),#sq_blog_preview *{font-family:"Noto Sans","Open Sans",Arial,sans-serif;font-size:.875rem;line-height:20px}#postsquirrly.sq_sticky .postbox-header,.edit-post-sidebar #sq_options{display:none}#postsquirrly.sq_sticky.closed .inside,#sq_briefcase #sq_briefcase_content li.sq_briefcase_item:hover .sq_briefcase_addbriefcase,#sq_briefcase #sq_briefcase_content li.sq_briefcase_item:hover .sq_briefcase_item_delete,#sq_briefcase #sq_briefcase_content li.sq_briefcase_item:hover .sq_briefcase_optimize{display:block}#postsquirrly div.inside,#postsquirrly p,#postsquirrly td,#sq_blocksearch ul,#sq_blockseo ul,#sq_options>ul{margin:0;padding:0}#postsquirrly:not(.sq_sticky) .sq_header{display:none}#postsquirrly.sq_sticky .sq_header{color:#a0a0a0;font-size:.875rem;font-weight:400;line-height:20px}#postsquirrly:not(.sq_sticky) .sq_block_tab{padding:.5em .2em!important;font-size:90%}#postsquirrly.sq_sticky .sq_header .sq_logo{width:30px!important;height:30px!important}#postsquirrly .sq_box{background-color:#fff;margin:0;padding:0;width:100%;height:100%}#normal-sortables #postsquirrly .sq_box{max-width:350px;margin:auto}#postsquirrly.sq_sticky{position:fixed!important;z-index:90000!important;left:calc(100% - 355px);bottom:0;top:auto;height:136px;width:350px!important;padding:0!important;background:#fff!important;overflow-x:auto!important;box-shadow:0 0 5px -3px #555!important}#postsquirrly.sq_sticky::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:#f5f5f5}#postsquirrly.sq_sticky::-webkit-scrollbar{width:7px;background-color:#f5f5f5}#postsquirrly.sq_sticky::-webkit-scrollbar-thumb{background-color:#bdafba;border:0}#postsquirrly.sq_sticky .hndle,#postsquirrly.sq_sticky.minimized #sq_briefcase_list,#postsquirrly.sq_sticky.minimized #sq_briefcase_topcontent{display:none!important}#postsquirrly.sq_sticky .handlediv,#postsquirrly:not(.sq_sticky) .hndle{padding:0 16px!important;font-size:13px!important}#postsquirrly.sq_sticky .sq_header{cursor:move}#postsquirrly .sq_box_close,#postsquirrly .sq_box_maximize,#postsquirrly .sq_box_minimize{display:block;float:right;margin:0;cursor:pointer;font-weight:300;font-size:.8rem;color:gray;padding:5px 10px 0 0;height:22px}#postsquirrly .sq_box_close{font-size:1.3rem;padding:3px 5px 0 0}#postsquirrly.sq_sticky.minimized{height:95px!important;overflow:hidden!important}#postsquirrly .inside{position:relative;height:100%}#postsquirrly .sq_box.sq_sticky{position:fixed;top:32px;z-index:99999;height:100%;max-width:291px;overflow-x:auto}#postsquirrly.sq_sticky .sq_box.sq_sticky{position:absolute;top:0;bottom:0;height:100%;margin:0}#postsquirrly .sq_box.sq_sticky>div{margin-bottom:25px}#postsquirrly .sq_box:hover:before{opacity:.8}#postsquirrly .sq_box:hover .sq_header{color:#444}#sq_blocklogin{background-color:#ffffe0}#sq_blocklogin input,#sq_blocklogin textarea{font-size:.875rem;height:30px;padding:6px}#postsquirrly .sq_button{display:block;text-decoration:none;line-height:30px;text-align:center;background-color:#6200ee!important;font-size:1.12rem;font-weight:700;color:#fff;margin:0;padding:0 15px;border:0;border-radius:0;cursor:pointer;vertical-align:top}#sq_blocklogin #sq_autologin #sq_loginimage,#sq_blocklogin #sq_login{background-color:#6200ee;color:#fff;border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;cursor:pointer}#sq_blocklogin #sq_login{border:0;min-width:100px;min-height:35px}#sq_blocklogin label{margin-top:0;margin-right:2px;width:72px;display:inline-block}#sq_blocklogin ul li{position:relative;padding:4px 0 4px 5px;margin:5px 0;line-height:16px;text-shadow:1px 1px #fff}#sq_blocklogin .sq_error,#sq_blocklogin .sq_info,#sq_blocklogin ul li{font-size:.875rem;text-align:center}#sq_blocklogin .sq_error{color:red;margin:5px auto}#sq_blocklogin #sq_register{margin:5px 0;font-size:.875rem;font-weight:700}#sq_blocklogin #sq_register_wait{display:inline-block;margin-left:2px}#sq_blocklogin #sq_autologin{padding:20px 10px 5px}#sq_blocklogin #sq_autologin #sq_loginimage{display:block;height:auto;width:100px;font-size:.875rem;font-weight:700;margin:13px;padding:10px 0;text-decoration:none}#sq_blocklogin #sq_register_email{text-align:center;width:250px;height:45px;margin:14px auto 11px}#sq_blocklogin #sq_register_email #sq_email{width:160px!important;border:2px solid #6200ee}#sq_blocklogin #sq_signin{color:#6200ee;margin:5px;cursor:pointer}#sq_options{float:right;position:relative;height:40px;margin:0;padding:0;z-index:13}#side-sortables #sq_options{z-index:1003}#postsquirrly #sq_options{float:none;background:0 0;border:0;box-shadow:none}#normal-sortables #postsquirrly #sq_options{display:flex;width:280px;margin:10px auto}#postsquirrly.sq_frontend .sq_frontend_noapi{font-size:1.1rem;line-height:24px;font-weight:600;margin:0 auto 10px;text-align:center}#postsquirrly .sq_frontend_noapi_inner{text-align:center;margin:6px auto}.sq_block_tab{cursor:pointer}#sq_blocksearch #sq_types ul li.sq_active,.sq_block_tab.sq_active{color:#fff!important;background-color:#6200ee!important}.sq_box #sq_keyword{border:0!important;background:#f8f9fa!important;box-shadow:none!important}#sq_briefcase #sq_briefcase_bottom{background-color:#f1f1f1;height:20px;margin:2px -1px 0;border-top:1px solid #ddd}#sq_briefcase #sq_briefcase_list #sq_briefcase_keyword_check{display:inline-block;line-height:26px;width:26px;height:28px;background-color:#6200ee;font-size:1.1rem;font-weight:700;color:#fff;margin:0;padding:0;border:1px solid #fff;cursor:pointer}#sq_briefcase #sq_briefcase_content ul.sq_briefcase_item_used{margin:0 0 7px;padding:0}#sq_briefcase #sq_briefcase_content ul.sq_briefcase_item_circles{margin:0;padding:5px 0;width:100%;height:auto;clear:both;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}#sq_briefcase #sq_briefcase_content ul.sq_briefcase_item_notused{clear:both;padding:0;margin:0}#sq_briefcase #sq_briefcase_content.sq_error{margin:15px 0!important}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item{position:relative;color:#4f1440;padding:0;text-align:left;margin:0 0 0 1px;line-height:20px}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item .sq_briefcase_item_percent{white-space:nowrap;display:inline-block;padding:5px 2px 0;text-align:right;font-weight:700;font-size:.875rem;cursor:pointer}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item_used .sq_briefcase_value{width:80%;cursor:pointer}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item .sq_briefcase_value{width:80%;max-width:275px;display:inline-block;padding:5px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;vertical-align:top}#sq_briefcase #sq_briefcase_content ul.sq_briefcase_item_notused li.sq_briefcase_item{padding:5px}#sq_briefcase #sq_briefcase_content ul.sq_briefcase_item_notused li.sq_briefcase_item .sq_briefcase_value{padding:0;display:block;clear:left}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item .sq_briefcase_addbriefcase{position:absolute;color:#6200ee;right:5px;top:5px;cursor:pointer;float:right;display:none;z-index:10}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item .sq_briefcase_optimize{position:absolute;color:#6200ee;right:5px;bottom:5px;cursor:pointer;float:right;display:none;z-index:10}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item:hover{background-color:#fbfbfb}#sq_briefcase #sq_briefcase_content .sq_briefcase_empty{font-weight:700;text-align:center;padding:5px;margin:0}#sq_briefcase #sq_briefcase_content .sq_briefcase_item_notused .sq_briefcase_empty{color:#a7a6a7}#sq_briefcase .sq_briefcase_item .sq_briefcase_item_circle{display:block;float:left;width:13px;height:3px;margin:0 2px 0 0}#sq_briefcase .sq_briefcase_item_circles .sq_briefcase_circle{display:block;font-family:'FontAwesome',Arial,sans-serif!important;float:left;width:44px;height:10px;margin:5px 3px 0 0;cursor:pointer}#sq_briefcase .sq_briefcase_item_circles .sq_briefcase_circle:before{content:" ";display:block;height:100%;width:100%;margin:-2px 0 2px}#sq_briefcase .sq_briefcase_item_circles .sq_briefcase_circle.sq_active:before{display:block;text-align:center;margin:-2px 0 2px;content:"\f00c";color:#fff;text-shadow:1px 0 #555}#sq_briefcase ul li.sq_main_keyword{background-color:#f9f5fd}#sq_briefcase ul li.sq_main_keyword:after{content:"\f005";font-family:'FontAwesome',Arial,sans-serif!important;font-size:.875rem;position:absolute;margin:5px 0;right:18px}#sq_briefcase #sq_briefcase_content li .sq_briefcase_item_delete{display:none;float:right;font-size:13px;font-weight:700;color:#999;line-height:15px;width:15px;text-align:center;padding:5px 4px 2px;border:0;cursor:pointer;z-index:2}#sq_blockseo .sq_tasks{padding:2px 0}#sq_blockseo .sq_auto_sticky input,#sq_blockseo .sq_tasks .sq_help,#sq_blockseo .sq_tasks ul li #sq_density_high,#sq_blockseo .sq_tasks ul li #sq_density_low,#sq_blockseo .sq_tasks ul li #sq_density_title_longtail,#sq_blockseo .sq_tasks ul li #sq_density_title_low,#sq_blockseo .sq_tasks ul li #sq_over_density_high,#sq_blockseo .sq_tasks ul li #sq_over_density_low{display:none}#sq_blockseo .sq_tasks ul{padding:10px 0}#sq_blockseo .sq_tasks ul li{position:relative;display:block;color:#000;background-color:#fff;font-weight:400;line-height:25px;padding:5px 40px 5px 5px;margin:5px;border:1px solid #e9e9e9}#sq_blockseo .sq_tasks ul li.sq_tasks_category{color:#999;background-color:transparent;padding:0;margin:5px;border:0!important;box-shadow:none!important;-moz-box-shadow:none!important;-webkit-box-shadow:none!important}#sq_blockseo .sq_tasks .sq_fp_title_task{color:#6200ee}#sq_blockseo .sq_tasks ul li.checked .sq_fp_title_task{color:#fff}#sq_blockseo .sq_tasks ul li.checked{background-color:#4caf50;color:#fff;text-shadow:1px 1px #777}#sq_blockseo .sq_tasks ul li .sq_seo_priority{display:none;position:absolute;height:25px;width:30px;right:23px;top:4px}#sq_blockseo .sq_tasks ul li .sq_seo_locked{display:block;position:absolute;height:20px;width:20px;right:23px;top:4px;cursor:pointer}#sq_blockseo .sq_auto_sticky label span,#sq_blockseo .sq_tasks ul li .sq_seo_priority_essential{cursor:pointer}#sq_blockseo .sq_tasks ul li .arrow:after{content:none;background-color:transparent}#sq_blockseo .sq_tasks ul li .arrow{display:block;position:absolute;right:5px;top:6px;bottom:auto;left:auto;height:16px;width:16px;overflow:visible;z-index:1;cursor:pointer}#sq_blockseo .sq_tasks ul li.checked .arrow{background-position:-121px -76px}#sq_blockseo .sq_tasks ul li .arrow:hover{background-position:-146px -76px;z-index:2}#sq_blockseo .sq_tasks ul li .arrow:hover .sq_help{display:table;position:absolute;background:#fff;font-weight:400;color:#333;right:-7px;top:22px;height:50px;width:260px;padding:10px 5px;overflow:hidden;z-index:5;border:1px solid #ccc;border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;text-shadow:none}#sq_blockseo .sq_tasks ul li.sq_density_high,#sq_blockseo .sq_tasks ul li.sq_density_title_high,#sq_blockseo .sq_tasks ul li.sq_over_density_high{background-color:red!important;color:#fff!important}#sq_blockseo .sq_tasks ul li.sq_locked{color:#d3d3d3;background-color:#f8f8f8}#sq_blockseo .sq_error{padding:15px}body ul.sq_notification{position:fixed;background-color:#4caf50;text-align:center;width:100%;height:auto;top:28px;padding:0;margin:0;list-style:none!important;box-shadow:0 4px 4px -3px #333;-moz-box-shadow:0 4px 4px -3px #333;-webkit-box-shadow:0 4px 4px -3px #333;z-index:100001}body ul.sq_notification_front{z-index:100002}body ul.sq_density_high,body ul.sq_density_low,body ul.sq_density_title_high,body ul.sq_density_title_low{background-color:red!important}body ul.sq_density_high li,body ul.sq_density_low li,body ul.sq_density_title_high li,body ul.sq_density_title_low li{color:#fff!important}body ul.sq_notification li{position:relative;font-weight:400;color:#fff;text-shadow:1px 1px #777;line-height:16px;list-style:none!important;width:380px;height:auto;margin:0 auto;padding:10px 0;text-align:left}body ul.sq_notification li .arrow{position:absolute;top:8px;left:-33px;width:25px;height:25px;float:left;margin:0 10px 0 0}body ul.sq_notification li .arrow::before{content:"";display:none}body ul.sq_notification li .arrow::after{background-color:transparent!important}body ul.sq_complete,body ul.sq_complete li{list-style:none!important;height:auto;text-align:center}body ul.sq_complete{position:fixed;background-color:#4caf50;width:100%;top:28px;padding:0;margin:0;box-shadow:0 4px 4px -3px #333;-moz-box-shadow:0 4px 4px -3px #333;-webkit-box-shadow:0 4px 4px -3px #333;z-index:100000003}body ul.sq_complete li{position:relative;font-weight:400;color:#fff;text-shadow:1px 1px #777;line-height:16px;margin:0 auto;padding:15px 0}#sq_blocksearch #sq_types{width:100%;height:auto;padding:5px 0;margin:0}#sq_blocksearch #sq_types ul{margin:0;padding:0;list-style:none}#sq_blocksearch #sq_types ul li{padding:8px;margin:0 12px;cursor:pointer;font-size:1.5rem}#postsquirrly:not(.sq_sticky) #sq_blocksearch #sq_types ul li{margin:0 6px}#postsquirrly:not(.sq_sticky) .sq_help,#postsquirrly:not(.sq_sticky) .sq_type_help{padding:0!important}#sq_blocksearch .sq_search{overflow:hidden;padding:0!important;margin:0!important;width:100%!important;height:auto;clear:both}#sq_blocksearch .sq_search .sq_search_notrelevant{text-align:center;text-decoration:none;color:#1c3c50;width:100%;display:block;margin:0;padding:5px;line-height:30px}#sq_blocksearch .sq_search #sq_search_second{text-align:center}#sq_blocksearch .sq_search #sq_keyword_second{display:inline-block;margin:13px 0;width:80%;line-height:26px;padding:6px;font-weight:400;color:#32373c;border-radius:0}#sq_blocksearch .sq_search #sq_keyword_second_check{display:inline-block;line-height:26px;width:18%;height:39px;background-color:#6200ee!important;font-weight:700;color:#fff;margin:0;padding:0;cursor:pointer}#sq_blocksearch .sq_search ul{padding:0;margin:0 auto;list-style:none;clear:both;max-width:335px}#sq_blocksearch .sq_search ul li.sq_search_li{display:block;width:95%;font-weight:400;padding:5px;margin:7px auto;background-color:#fff;border:1px solid #ddd;border-radius:0;-webkit-border-radius:0;-moz-border-radius:1px}#sq_blocksearch .sq_search .sq_attribution{clear:both;margin:0;padding:0}#sq_blocksearch .sq_search li.sq_search_li .sq_attribution>ul{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}#sq_blocksearch .sq_search li.sq_search_li .sq_attribution>ul>li{-ms-flex:0 0 auto;flex:0 0 auto;flex-grow:1;max-width:100%;text-align:center;padding:10px;color:#fff;background-color:#6200ee!important;border-color:transparent;cursor:pointer}#sq_blocksearch .sq_search ul .sq_info{clear:both;color:#bcc4c8;padding:3px 0 0;float:right}#sq_blocksearch .sq_search .sq_info ul li{float:left;font-size:.7rem;margin-right:5px;padding-right:5px;border-right:1px solid #ccc}#sq_blocksearch .sq_search .sq_info ul li:last-child{border-right-width:0!important}#sq_blocksearch .sq_search ul li.sq_search_img_li{position:relative;float:left;background-color:#fff;width:100px;height:70px;padding:2px;margin:0 3px 6px 7px;border:1px solid #bbb;box-shadow:0 0 2px #ccc;-moz-box-shadow:0 0 2px #ccc;-webkit-box-shadow:0 0 2px #ccc;transition-property:border-color;transition-duration:.33s;-moz-transition-property:border-color;-moz-transition-duration:.33s;-webkit-transition-property:border-color;-webkit-transition-duration:.33s;cursor:pointer}#sq_blocksearch .sq_search ul li.sq_search_img_li:hover{border-color:#333}#sq_blocksearch .sq_search ul li.sq_search_img_li>img{clip:rect(0,100px,70px,0);position:absolute;top:-3px;left:-3px;max-height:110px;max-width:140px;min-width:100px}#postsquirrly.sq_sticky .sq_search ul li.sq_search_img_li{margin:0 3px 6px 7px}#postsquirrly:not(.sq_sticky) #sq_blocksearch .sq_search ul li.sq_search_img_li{width:126px}#postsquirrly:not(.sq_sticky) #sq_blocksearch .sq_search ul li.sq_search_img_li>img{clip:rect(0,126px,70px,0);max-width:150px;max-height:150px;min-width:126px}#postsquirrly:not(.sq_sticky) #sq_nokeyword{display:none!important}#sq_blocksearch #sq_search_img_filter{width:100%;background-color:#fff;text-align:center;padding:10px 0;border-top:1px solid #e8e8e8}#sq_blocksearch #sq_search_img_filter #sq_search_img_nolicence{margin:0 5px}#sq_blocksearch #sq_search_img_filter label#sq_search_img_nolicence_label{position:relative;color:#1d1f24;text-shadow:1px 1px #fff}#sq_blocksearch #sq_search_img_filter label.checked span{background-color:#6200ee}.sq_zoomImg_img{width:auto;height:54px}.sq_zoomImg{position:absolute;visibility:visible}.sq_zoomImg_Inner{background-color:#fff;border:1px solid #d9d9d9;-moz-box-shadow:0 4px 16px rgba(0,0,0,.2);-webkit-box-shadow:0 4px 16px rgba(0,0,0,.2);box-shadow:0 4px 16px rgba(0,0,0,.2);color:#555;padding:5px;position:relative}.sq_zoomImg_frame img{border:1px solid #d9d9d9;display:block;margin:auto;max-width:115px;max-height:115px}#sq_blocksearch .sq_search li.sq_search_img_li .sq_attribute{position:absolute;bottom:-3px;right:-3px;background:#fff;border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;z-index:1;padding:0 5px}#sq_blocksearch .sq_search ul li.search_category{clear:both;color:#464646;width:100%;height:16px;border:0}#sq_blocksearch .sq_search ul li.sq_search_twitter_li .sq_author_avatar{float:left;width:36px;height:36px;margin:3px 10px 0 0}#sq_blocksearch .sq_search ul li.sq_search_twitter_li .sq_quote_content{margin-left:46px}#sq_blocksearch .sq_search ul li.sq_search_twitter_li .sq_quote_author{color:#555;line-height:15px}#sq_blocksearch .sq_search ul li.sq_search_twitter_li .sq_author_name{line-height:19px;margin-right:5px;color:#555;font-weight:400;text-align:left}#sq_blocksearch .sq_search ul li.sq_search_twitter_li .sq_quote_text{margin-left:0}#sq_blocksearch .sq_search ul li.sq_search_blog_li .sq_news_title{font-weight:700;color:#333;line-height:19px;margin:0 0 5px}#sq_blocksearch .sq_search ul li.sq_search_blog_li .sq_news_text{color:#333;line-height:19px;text-align:left}#sq_blocksearch .sq_show_mgs{clear:both;display:block;padding:10px;margin-top:10px;border-top:1px dashed #d1d1d1;text-align:center}#sq_blocksearch .sq_more{clear:both;position:relative;width:100%;text-align:center;padding:0;margin:0 0 5px}#sq_blocksearch .sq_more span{display:block;width:0;height:0;border-left:12px solid transparent;border-right:12px solid transparent;border-top:10px solid #6200ee;padding:0;margin:0 auto;cursor:pointer}#sq_suggestion .sq_show_mgs{margin:20px auto 0;border-top:none;text-align:center}#sq_blog_preview{position:fixed!important;border:1px solid #e5e5e5;padding:0;margin-bottom:15px;left:15%;top:10%;width:70%;height:80%;overflow:auto;background-color:#fff;z-index:999999}#sq_blog_preview_overlay{display:block;position:absolute;background-color:#999;border:0;content:" ";left:0;top:0;width:100%;height:100%;border-radius:2px 2px 0 0;opacity:.3;z-index:999998}#sq_blog_preview #sq_blog_preview_partner{position:absolute;top:15px;right:20px}#sq_blog_preview #sq_blog_preview_partner a{background-color:#333;text-decoration:none;color:#fff;font-size:.875rem;font-weight:700;margin-left:5px;padding:0 3px;border:1px solid #333}#sq_blog_preview #sq_blog_preview_title{display:block;font-size:1.2rem;font-weight:400;line-height:30px;color:#333;border-bottom:1px dashed #d1d1d1;margin:0 0 10px;padding:10px 0 10px 10px}#sq_blog_preview #sq_blog_preview_body{display:block;font-size:.875rem;color:#333;line-height:16px;text-align:left;padding:0 0 0 10px;max-height:300px;overflow-y:auto;overflow-x:hidden}#sq_blog_preview #sq_blog_preview_body p{position:relative;background-color:transparent;line-height:24px;padding:0;margin:0 0 16px;text-align:left;white-space:normal;color:#333}#sq_blog_preview #sq_blog_preview_body .sq_mark{background-color:#ffed5f;color:#000;padding:0 3px;font-size:.875rem;line-height:20px;box-shadow:0 0 5px #fff6ac;-moz-box-shadow:0 0 5px #fff6ac;-webkit-box-shadow:0 0 5px #fff6ac}#sq_blog_preview #sq_blog_preview_body .sq_blog_option{position:absolute;display:none;background-color:#f5f5f5;bottom:0;right:5px;cursor:pointer;z-index:1}#sq_blog_preview #sq_blog_preview_body p:hover{background-color:#f5f5f5}#sq_blog_preview #sq_blog_preview_body p:hover .sq_blog_option{display:block;-webkit-animation:fadeIn .3s;-moz-animation:fadeIn .3s;animation:fadeIn .3s}#sq_blocksearch{position:relative}#sq_blocksearch .sq_search ul li.sq_search_wiki_li .sq_wiki_title{font-weight:700;color:#333;margin:5px 0}#sq_blocksearch .sq_search ul li.sq_search_local_li .sq_local_title{font-weight:700;color:#333;line-height:18px;margin:0 0 5px}#sq_blocksearch .sq_research_div{display:none;clear:both;position:relative;width:100%!important;line-height:40px;padding:0;margin:0!important;text-align:center}#sq_blocksearch .sq_research_div #sq_research_link{font-weight:700;color:#21759b;margin-top:10px;text-align:center;cursor:pointer;text-decoration:none}#sq_blog_preview #sq_blog_preview_close{position:absolute;font-weight:700;color:#999;width:10px;line-height:16px;text-align:center;padding:0 4px 2px;border-radius:10px;cursor:pointer;z-index:2;top:20px;right:20px;font-size:20px}#sq_blockseo #sq_seo_refresh{text-align:center;height:29px!important;min-height:29px!important;cursor:pointer}#sq_blockseo progress::-webkit-progress-bar{background-color:#ccc;height:5px}#sq_blockseo progress::-webkit-progress-value{background-color:#6200ee;height:5px}#sq_blockseo progress{background-color:#6200ee;height:5px;line-height:5px}#postsquirrly.sq_frontend #sq_options{display:none}#postsquirrly.sq_frontend ul,#postsquirrly.sq_frontend ul li{list-style:none!important}
1
+ @import url(https://fonts.googleapis.com/css2?family=Noto+Sans&display=swap);@-ms-keyframes play{0%{background-position:0}to{background-position:-400px}}@-o-keyframes play{0%{background-position:0}to{background-position:-400px}}@keyframes play{0%{background-position:0}to{background-position:-400px}}.sq_minloading{position:relative;opacity:.5;min-height:40px}.sq_loading{height:60px;background:url(../img/loading.gif) no-repeat center!important}.sq_minloading:before{position:absolute!important;right:calc(50% - 10px)!important;top:calc(50% - 8px)!important;display:block!important;float:right!important;line-height:30px!important;content:""!important;padding:0!important;margin:0 0 0 5px!important;height:16px!important;width:20px!important;background:url(../img/minloading.png) no-repeat!important;-webkit-animation:play 1s steps(10) infinite;-moz-animation:play 1s steps(10) infinite;-o-animation:play 1s steps(10) infinite;animation:play 1s steps(10) infinite}#sq_preloading,.sq_sla_connect_notice{font-size:.875rem;line-height:24px;text-align:center}#sq_preloading{color:gray}.sq_sla_connect_notice{font-weight:600;margin:0 auto 10px}.sq_sla_connect_notice_content{text-align:center;margin:6px auto}#postsquirrly .sq_frontend_noapi a,.sq_sla_connect_notice a{text-decoration:none}#postsquirrly .sq_frontend_noapi_inner img,.sq_sla_connect_notice_content a img{width:277px}#postsquirrly *,#sq_blocksnippet *{box-sizing:border-box}#postsquirrly{color:#000}#postsquirrly a:not(.btn,.sq_button){color:#6200ee}#sq_blocksnippet.sq_sticky:not(.closed) .inside{display:block!important}#sq_blocksnippet.sq_sticky.closed .inside{display:none!important}#postsquirrly.sq_sticky{background:0 0;border:0;margin:0;-moz-box-shadow:none;-webkit-box-shadow:none}#postsquirrly:not(.sq_sticky){padding:0;border:1px solid #ddd}#postsquirrly :not(.fa,.fa-solid,.fa-brands),#sq_blog_preview *{font-family:"Noto Sans","Open Sans",Arial,sans-serif;font-size:.875rem;line-height:20px}#postsquirrly.sq_sticky .postbox-header,.edit-post-sidebar #sq_options{display:none}#postsquirrly.sq_sticky.closed .inside,#sq_briefcase #sq_briefcase_content li.sq_briefcase_item:hover .sq_briefcase_addbriefcase,#sq_briefcase #sq_briefcase_content li.sq_briefcase_item:hover .sq_briefcase_item_delete,#sq_briefcase #sq_briefcase_content li.sq_briefcase_item:hover .sq_briefcase_optimize{display:block}#postsquirrly div.inside,#postsquirrly p,#postsquirrly td,#sq_blocksearch ul,#sq_blockseo ul,#sq_options>ul{margin:0;padding:0}#postsquirrly:not(.sq_sticky) .sq_header{display:none}#postsquirrly.sq_sticky .sq_header{color:#a0a0a0;font-size:.875rem;font-weight:400;line-height:20px}#postsquirrly:not(.sq_sticky) .sq_block_tab{padding:.5em .2em!important;font-size:90%}#postsquirrly.sq_sticky .sq_header .sq_logo{width:30px!important;height:30px!important}#postsquirrly .sq_box{background-color:#fff;margin:0;padding:0;width:100%;height:100%}#normal-sortables #postsquirrly .sq_box{max-width:350px;margin:auto}#postsquirrly.sq_sticky{position:fixed!important;z-index:90000!important;left:calc(100% - 355px);bottom:0;top:auto;height:136px;width:350px!important;padding:0!important;background:#fff!important;overflow-x:auto!important;box-shadow:0 0 5px -3px #555!important}#postsquirrly.sq_sticky::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.3);background-color:#f5f5f5}#postsquirrly.sq_sticky::-webkit-scrollbar{width:7px;background-color:#f5f5f5}#postsquirrly.sq_sticky::-webkit-scrollbar-thumb{background-color:#bdafba;border:0}#postsquirrly.sq_sticky .hndle,#postsquirrly.sq_sticky.minimized #sq_briefcase_list,#postsquirrly.sq_sticky.minimized #sq_briefcase_topcontent{display:none!important}#postsquirrly.sq_sticky .handlediv,#postsquirrly:not(.sq_sticky) .hndle{padding:0 16px!important;font-size:13px!important}#postsquirrly.sq_sticky .sq_header{cursor:move}#postsquirrly .sq_box_close,#postsquirrly .sq_box_maximize,#postsquirrly .sq_box_minimize{display:block;float:right;margin:0;cursor:pointer;font-weight:300;font-size:.8rem;color:gray;padding:5px 10px 0 0;height:22px}#postsquirrly .sq_box_close{font-size:1.3rem;padding:3px 5px 0 0}#postsquirrly.sq_sticky.minimized{height:95px!important;overflow:hidden!important}#postsquirrly .inside{position:relative;height:100%}#postsquirrly .sq_box.sq_sticky{position:fixed;top:32px;z-index:99999;height:100%;max-width:291px;overflow-x:auto}#postsquirrly.sq_sticky .sq_box.sq_sticky{position:absolute;top:0;bottom:0;height:100%;margin:0}#postsquirrly .sq_box.sq_sticky>div{margin-bottom:25px}#postsquirrly .sq_box:hover:before{opacity:.8}#postsquirrly .sq_box:hover .sq_header{color:#444}#sq_blocklogin{background-color:#ffffe0}#sq_blocklogin input,#sq_blocklogin textarea{font-size:.875rem;height:30px;padding:6px}#postsquirrly .sq_button{display:block;text-decoration:none;line-height:30px;text-align:center;background-color:#6200ee!important;font-size:1.12rem;font-weight:700;color:#fff;margin:0;padding:0 15px;border:0;border-radius:0;cursor:pointer;vertical-align:top}#sq_blocklogin #sq_autologin #sq_loginimage,#sq_blocklogin #sq_login{background-color:#6200ee;color:#fff;border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;cursor:pointer}#sq_blocklogin #sq_login{border:0;min-width:100px;min-height:35px}#sq_blocklogin label{margin-top:0;margin-right:2px;width:72px;display:inline-block}#sq_blocklogin ul li{position:relative;padding:4px 0 4px 5px;margin:5px 0;line-height:16px;text-shadow:1px 1px #fff}#sq_blocklogin .sq_error,#sq_blocklogin .sq_info,#sq_blocklogin ul li{font-size:.875rem;text-align:center}#sq_blocklogin .sq_error{color:red;margin:5px auto}#sq_blocklogin #sq_register{margin:5px 0;font-size:.875rem;font-weight:700}#sq_blocklogin #sq_register_wait{display:inline-block;margin-left:2px}#sq_blocklogin #sq_autologin{padding:20px 10px 5px}#sq_blocklogin #sq_autologin #sq_loginimage{display:block;height:auto;width:100px;font-size:.875rem;font-weight:700;margin:13px;padding:10px 0;text-decoration:none}#sq_blocklogin #sq_register_email{text-align:center;width:250px;height:45px;margin:14px auto 11px}#sq_blocklogin #sq_register_email #sq_email{width:160px!important;border:2px solid #6200ee}#sq_blocklogin #sq_signin{color:#6200ee;margin:5px;cursor:pointer}#sq_options{float:right;position:relative;height:40px;margin:0;padding:0;z-index:13}#side-sortables #sq_options{z-index:1003}#postsquirrly #sq_options{float:none;background:0 0;border:0;box-shadow:none}#normal-sortables #postsquirrly #sq_options{display:flex;width:280px;margin:10px auto}#postsquirrly.sq_frontend .sq_frontend_noapi{font-size:1.1rem;line-height:24px;font-weight:600;margin:0 auto 10px;text-align:center}#postsquirrly .sq_frontend_noapi_inner{text-align:center;margin:6px auto}.sq_block_tab{cursor:pointer}#sq_blocksearch #sq_types ul li.sq_active,.sq_block_tab.sq_active{color:#fff!important;background-color:#6200ee!important}.sq_box #sq_keyword{border:0!important;background:#f8f9fa!important;box-shadow:none!important}#sq_briefcase #sq_briefcase_bottom{background-color:#f1f1f1;height:20px;margin:2px -1px 0;border-top:1px solid #ddd}#sq_briefcase #sq_briefcase_list #sq_briefcase_keyword_check{display:inline-block;line-height:26px;width:26px;height:28px;background-color:#6200ee;font-size:1.1rem;font-weight:700;color:#fff;margin:0;padding:0;border:1px solid #fff;cursor:pointer}#sq_briefcase #sq_briefcase_content ul.sq_briefcase_item_used{margin:0 0 7px;padding:0}#sq_briefcase #sq_briefcase_content ul.sq_briefcase_item_circles{margin:0;padding:5px 0;width:100%;height:auto;clear:both;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}#sq_briefcase #sq_briefcase_content ul.sq_briefcase_item_notused{clear:both;padding:0;margin:0}#sq_briefcase #sq_briefcase_content.sq_error{margin:15px 0!important}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item{position:relative;color:#4f1440;padding:0;text-align:left;margin:0 0 0 1px;line-height:20px}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item .sq_briefcase_item_percent{white-space:nowrap;display:inline-block;padding:5px 2px 0;text-align:right;font-weight:700;font-size:.875rem;cursor:pointer}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item_used .sq_briefcase_value{width:80%;cursor:pointer}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item .sq_briefcase_value{width:80%;max-width:275px;display:inline-block;padding:5px;white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden;vertical-align:top}#sq_briefcase #sq_briefcase_content ul.sq_briefcase_item_notused li.sq_briefcase_item{padding:5px}#sq_briefcase #sq_briefcase_content ul.sq_briefcase_item_notused li.sq_briefcase_item .sq_briefcase_value{padding:0;display:block;clear:left}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item .sq_briefcase_addbriefcase{position:absolute;color:#6200ee;right:5px;top:5px;cursor:pointer;float:right;display:none;z-index:10}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item .sq_briefcase_optimize{position:absolute;color:#6200ee;right:5px;bottom:5px;cursor:pointer;float:right;display:none;z-index:10}#sq_briefcase #sq_briefcase_content li.sq_briefcase_item:hover{background-color:#fbfbfb}#sq_briefcase #sq_briefcase_content .sq_briefcase_empty{font-weight:700;text-align:center;padding:5px;margin:0}#sq_briefcase #sq_briefcase_content .sq_briefcase_item_notused .sq_briefcase_empty{color:#a7a6a7}#sq_briefcase .sq_briefcase_item .sq_briefcase_item_circle{display:block;float:left;width:13px;height:3px;margin:0 2px 0 0}#sq_briefcase .sq_briefcase_item_circles .sq_briefcase_circle{display:block;font-family:'FontAwesome',Arial,sans-serif!important;float:left;width:44px;height:10px;margin:5px 3px 0 0;cursor:pointer}#sq_briefcase .sq_briefcase_item_circles .sq_briefcase_circle:before{content:" ";display:block;height:100%;width:100%;margin:-2px 0 2px}#sq_briefcase .sq_briefcase_item_circles .sq_briefcase_circle.sq_active:before{display:block;text-align:center;margin:-2px 0 2px;content:"\f00c";color:#fff;text-shadow:1px 0 #555}#sq_briefcase ul li.sq_main_keyword{background-color:#f9f5fd}#sq_briefcase ul li.sq_main_keyword:after{content:"\f005";font-family:'FontAwesome',Arial,sans-serif!important;font-size:.875rem;position:absolute;margin:5px 0;right:18px}#sq_briefcase #sq_briefcase_content li .sq_briefcase_item_delete{display:none;float:right;font-size:13px;font-weight:700;color:#999;line-height:15px;width:15px;text-align:center;padding:5px 4px 2px;border:0;cursor:pointer;z-index:2}#sq_blockseo .sq_tasks{padding:2px 0}#sq_blockseo .sq_auto_sticky input,#sq_blockseo .sq_tasks .sq_help,#sq_blockseo .sq_tasks ul li #sq_density_high,#sq_blockseo .sq_tasks ul li #sq_density_low,#sq_blockseo .sq_tasks ul li #sq_density_title_longtail,#sq_blockseo .sq_tasks ul li #sq_density_title_low,#sq_blockseo .sq_tasks ul li #sq_over_density_high,#sq_blockseo .sq_tasks ul li #sq_over_density_low{display:none}#sq_blockseo .sq_tasks ul{padding:10px 0}#sq_blockseo .sq_tasks ul li{position:relative;display:block;color:#000;background-color:#fff;font-weight:400;line-height:25px;padding:5px 40px 5px 5px;margin:5px;border:1px solid #e9e9e9}#sq_blockseo .sq_tasks ul li.sq_tasks_category{color:#999;background-color:transparent;padding:0;margin:5px;border:0!important;box-shadow:none!important;-moz-box-shadow:none!important;-webkit-box-shadow:none!important}#sq_blockseo .sq_tasks .sq_fp_title_task{color:#6200ee}#sq_blockseo .sq_tasks ul li.checked .sq_fp_title_task{color:#fff}#sq_blockseo .sq_tasks ul li.checked{background-color:#4caf50;color:#fff;text-shadow:1px 1px #777}#sq_blockseo .sq_tasks ul li .sq_seo_priority{display:none;position:absolute;height:25px;width:30px;right:23px;top:4px}#sq_blockseo .sq_tasks ul li .sq_seo_locked{display:block;position:absolute;height:20px;width:20px;right:23px;top:4px;cursor:pointer}#sq_blockseo .sq_auto_sticky label span,#sq_blockseo .sq_tasks ul li .sq_seo_priority_essential{cursor:pointer}#sq_blockseo .sq_tasks ul li .arrow:after{content:none;background-color:transparent}#sq_blockseo .sq_tasks ul li .arrow{display:block;position:absolute;right:5px;top:6px;bottom:auto;left:auto;height:16px;width:16px;overflow:visible;z-index:1;cursor:pointer}#sq_blockseo .sq_tasks ul li.checked .arrow{background-position:-121px -76px}#sq_blockseo .sq_tasks ul li .arrow:hover{background-position:-146px -76px;z-index:2}#sq_blockseo .sq_tasks ul li .arrow:hover .sq_help{display:table;position:absolute;background:#fff;font-weight:400;color:#333;right:-7px;top:22px;height:50px;width:260px;padding:10px 5px;overflow:hidden;z-index:5;border:1px solid #ccc;border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;text-shadow:none}#sq_blockseo .sq_tasks ul li.sq_density_high,#sq_blockseo .sq_tasks ul li.sq_density_title_high,#sq_blockseo .sq_tasks ul li.sq_over_density_high{background-color:red!important;color:#fff!important}#sq_blockseo .sq_tasks ul li.sq_locked{color:#d3d3d3;background-color:#f8f8f8}#sq_blockseo .sq_error{padding:15px}body ul.sq_notification{position:fixed;background-color:#4caf50;text-align:center;width:100%;height:auto;top:28px;padding:0;margin:0;list-style:none!important;box-shadow:0 4px 4px -3px #333;-moz-box-shadow:0 4px 4px -3px #333;-webkit-box-shadow:0 4px 4px -3px #333;z-index:100001}body ul.sq_notification_front{z-index:100002}body ul.sq_density_high,body ul.sq_density_low,body ul.sq_density_title_high,body ul.sq_density_title_low{background-color:red!important}body ul.sq_density_high li,body ul.sq_density_low li,body ul.sq_density_title_high li,body ul.sq_density_title_low li{color:#fff!important}body ul.sq_notification li{position:relative;font-weight:400;color:#fff;text-shadow:1px 1px #777;line-height:16px;list-style:none!important;width:380px;height:auto;margin:0 auto;padding:10px 0;text-align:left}body ul.sq_notification li .arrow{position:absolute;top:8px;left:-33px;width:25px;height:25px;float:left;margin:0 10px 0 0}body ul.sq_notification li .arrow::before{content:"";display:none}body ul.sq_notification li .arrow::after{background-color:transparent!important}body ul.sq_complete,body ul.sq_complete li{list-style:none!important;height:auto;text-align:center}body ul.sq_complete{position:fixed;background-color:#4caf50;width:100%;top:28px;padding:0;margin:0;box-shadow:0 4px 4px -3px #333;-moz-box-shadow:0 4px 4px -3px #333;-webkit-box-shadow:0 4px 4px -3px #333;z-index:100000003}body ul.sq_complete li{position:relative;font-weight:400;color:#fff;text-shadow:1px 1px #777;line-height:16px;margin:0 auto;padding:15px 0}#sq_blocksearch #sq_types{width:100%;height:auto;padding:5px 0;margin:0}#sq_blocksearch #sq_types ul{margin:0;padding:0;list-style:none}#sq_blocksearch #sq_types ul li{padding:8px;margin:0 12px;cursor:pointer;font-size:1.5rem}#postsquirrly:not(.sq_sticky) #sq_blocksearch #sq_types ul li{margin:0 6px}#postsquirrly:not(.sq_sticky) .sq_help,#postsquirrly:not(.sq_sticky) .sq_type_help{padding:0!important}#sq_blocksearch .sq_search{overflow:hidden;padding:0!important;margin:0!important;width:100%!important;height:auto;clear:both}#sq_blocksearch .sq_search .sq_search_notrelevant{text-align:center;text-decoration:none;color:#1c3c50;width:100%;display:block;margin:0;padding:5px;line-height:30px}#sq_blocksearch .sq_search #sq_search_second{text-align:center}#sq_blocksearch .sq_search #sq_keyword_second{display:inline-block;margin:13px 0;width:80%;line-height:26px;padding:6px;font-weight:400;color:#32373c;border-radius:0}#sq_blocksearch .sq_search #sq_keyword_second_check{display:inline-block;line-height:26px;width:18%;height:39px;background-color:#6200ee!important;font-weight:700;color:#fff;margin:0;padding:0;cursor:pointer}#sq_blocksearch .sq_search ul{padding:0;margin:0 auto;list-style:none;clear:both;max-width:335px}#sq_blocksearch .sq_search ul li.sq_search_li{display:block;width:95%;font-weight:400;padding:5px;margin:7px auto;background-color:#fff;border:1px solid #ddd;border-radius:0;-webkit-border-radius:0;-moz-border-radius:1px}#sq_blocksearch .sq_search .sq_attribution{clear:both;margin:0;padding:0}#sq_blocksearch .sq_search li.sq_search_li .sq_attribution>ul{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}#sq_blocksearch .sq_search li.sq_search_li .sq_attribution>ul>li{-ms-flex:0 0 auto;flex:0 0 auto;flex-grow:1;max-width:100%;text-align:center;padding:10px;color:#fff;background-color:#6200ee!important;border-color:transparent;cursor:pointer}#sq_blocksearch .sq_search ul .sq_info{clear:both;color:#bcc4c8;padding:3px 0 0;float:right}#sq_blocksearch .sq_search .sq_info ul li{float:left;font-size:.7rem;margin-right:5px;padding-right:5px;border-right:1px solid #ccc}#sq_blocksearch .sq_search .sq_info ul li:last-child{border-right-width:0!important}#sq_blocksearch .sq_search ul li.sq_search_img_li{position:relative;float:left;background-color:#fff;width:100px;height:70px;padding:2px;margin:0 3px 6px 7px;border:1px solid #bbb;box-shadow:0 0 2px #ccc;-moz-box-shadow:0 0 2px #ccc;-webkit-box-shadow:0 0 2px #ccc;transition-property:border-color;transition-duration:.33s;-moz-transition-property:border-color;-moz-transition-duration:.33s;-webkit-transition-property:border-color;-webkit-transition-duration:.33s;cursor:pointer}#sq_blocksearch .sq_search ul li.sq_search_img_li:hover{border-color:#333}#sq_blocksearch .sq_search ul li.sq_search_img_li>img{clip:rect(0,100px,70px,0);position:absolute;top:-3px;left:-3px;max-height:110px;max-width:140px;min-width:100px}#postsquirrly.sq_sticky .sq_search ul li.sq_search_img_li{margin:0 3px 6px 7px}#postsquirrly:not(.sq_sticky) #sq_blocksearch .sq_search ul li.sq_search_img_li{width:126px}#postsquirrly:not(.sq_sticky) #sq_blocksearch .sq_search ul li.sq_search_img_li>img{clip:rect(0,126px,70px,0);max-width:150px;max-height:150px;min-width:126px}#postsquirrly:not(.sq_sticky) #sq_nokeyword{display:none!important}#sq_blocksearch #sq_search_img_filter{width:100%;background-color:#fff;text-align:center;padding:10px 0;border-top:1px solid #e8e8e8}#sq_blocksearch #sq_search_img_filter #sq_search_img_nolicence{margin:0 5px}#sq_blocksearch #sq_search_img_filter label#sq_search_img_nolicence_label{position:relative;color:#1d1f24;text-shadow:1px 1px #fff}#sq_blocksearch #sq_search_img_filter label.checked span{background-color:#6200ee}.sq_zoomImg_img{width:auto;height:54px}.sq_zoomImg{position:absolute;visibility:visible}.sq_zoomImg_Inner{background-color:#fff;border:1px solid #d9d9d9;-moz-box-shadow:0 4px 16px rgba(0,0,0,.2);-webkit-box-shadow:0 4px 16px rgba(0,0,0,.2);box-shadow:0 4px 16px rgba(0,0,0,.2);color:#555;padding:5px;position:relative}.sq_zoomImg_frame img{border:1px solid #d9d9d9;display:block;margin:auto;max-width:115px;max-height:115px}#sq_blocksearch .sq_search li.sq_search_img_li .sq_attribute{position:absolute;bottom:-3px;right:-3px;background:#fff;border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;z-index:1;padding:0 5px}#sq_blocksearch .sq_search ul li.search_category{clear:both;color:#464646;width:100%;height:16px;border:0}#sq_blocksearch .sq_search ul li.sq_search_twitter_li .sq_author_avatar{float:left;width:36px;height:36px;margin:3px 10px 0 0}#sq_blocksearch .sq_search ul li.sq_search_twitter_li .sq_quote_content{margin-left:46px}#sq_blocksearch .sq_search ul li.sq_search_twitter_li .sq_quote_author{color:#555;line-height:15px}#sq_blocksearch .sq_search ul li.sq_search_twitter_li .sq_author_name{line-height:19px;margin-right:5px;color:#555;font-weight:400;text-align:left}#sq_blocksearch .sq_search ul li.sq_search_twitter_li .sq_quote_text{margin-left:0}#sq_blocksearch .sq_search ul li.sq_search_blog_li .sq_news_title{font-weight:700;color:#333;line-height:19px;margin:0 0 5px}#sq_blocksearch .sq_search ul li.sq_search_blog_li .sq_news_text{color:#333;line-height:19px;text-align:left}#sq_blocksearch .sq_show_mgs{clear:both;display:block;padding:10px;margin-top:10px;border-top:1px dashed #d1d1d1;text-align:center}#sq_blocksearch .sq_more{clear:both;position:relative;width:100%;text-align:center;padding:0;margin:0 0 5px}#sq_blocksearch .sq_more span{display:block;width:0;height:0;border-left:12px solid transparent;border-right:12px solid transparent;border-top:10px solid #6200ee;padding:0;margin:0 auto;cursor:pointer}#sq_suggestion .sq_show_mgs{margin:20px auto 0;border-top:none;text-align:center}#sq_blog_preview{position:fixed!important;border:1px solid #e5e5e5;padding:0;margin-bottom:15px;left:15%;top:10%;width:70%;height:80%;overflow:auto;background-color:#fff;z-index:999999}#sq_blog_preview_overlay{display:block;position:absolute;background-color:#999;border:0;content:" ";left:0;top:0;width:100%;height:100%;border-radius:2px 2px 0 0;opacity:.3;z-index:999998}#sq_blog_preview #sq_blog_preview_partner{position:absolute;top:15px;right:20px}#sq_blog_preview #sq_blog_preview_partner a{background-color:#333;text-decoration:none;color:#fff;font-size:.875rem;font-weight:700;margin-left:5px;padding:0 3px;border:1px solid #333}#sq_blog_preview #sq_blog_preview_title{display:block;font-size:1.2rem;font-weight:400;line-height:30px;color:#333;border-bottom:1px dashed #d1d1d1;margin:0 0 10px;padding:10px 0 10px 10px}#sq_blog_preview #sq_blog_preview_body{display:block;font-size:.875rem;color:#333;line-height:16px;text-align:left;padding:0 0 0 10px;overflow-y:auto;overflow-x:hidden}#sq_blog_preview #sq_blog_preview_body p{position:relative;background-color:transparent;line-height:24px;padding:0;margin:0 0 16px;text-align:left;white-space:normal;color:#333}#sq_blog_preview #sq_blog_preview_body .sq_mark{background-color:#ffed5f;color:#000;padding:0 3px;font-size:.875rem;line-height:20px;box-shadow:0 0 5px #fff6ac;-moz-box-shadow:0 0 5px #fff6ac;-webkit-box-shadow:0 0 5px #fff6ac}#sq_blog_preview #sq_blog_preview_body .sq_blog_option{position:absolute;display:none;background-color:#f5f5f5;bottom:0;right:5px;cursor:pointer;z-index:1}#sq_blog_preview #sq_blog_preview_body p:hover{background-color:#f5f5f5}#sq_blog_preview #sq_blog_preview_body p:hover .sq_blog_option{display:block;-webkit-animation:fadeIn .3s;-moz-animation:fadeIn .3s;animation:fadeIn .3s}#sq_blocksearch{position:relative}#sq_blocksearch .sq_search ul li.sq_search_wiki_li .sq_wiki_title{font-weight:700;color:#333;margin:5px 0}#sq_blocksearch .sq_search ul li.sq_search_local_li .sq_local_title{font-weight:700;color:#333;line-height:18px;margin:0 0 5px}#sq_blocksearch .sq_research_div{display:none;clear:both;position:relative;width:100%!important;line-height:40px;padding:0;margin:0!important;text-align:center}#sq_blocksearch .sq_research_div #sq_research_link{font-weight:700;color:#21759b;margin-top:10px;text-align:center;cursor:pointer;text-decoration:none}#sq_blog_preview #sq_blog_preview_close{position:absolute;font-weight:700;color:#999;width:10px;line-height:16px;text-align:center;padding:0 4px 2px;border-radius:10px;cursor:pointer;z-index:2;top:20px;right:20px;font-size:20px}#sq_blockseo #sq_seo_refresh{text-align:center;height:29px!important;min-height:29px!important;cursor:pointer}#sq_blockseo progress::-webkit-progress-bar{background-color:#ccc;height:5px}#sq_blockseo progress::-webkit-progress-value{background-color:#6200ee;height:5px}#sq_blockseo progress{background-color:#6200ee;height:5px;line-height:5px}#postsquirrly.sq_frontend #sq_options{display:none}#postsquirrly.sq_frontend ul,#postsquirrly.sq_frontend ul li{list-style:none!important}
view/assets/img/front/avatar-margin.png ADDED
Binary file
view/assets/js/assistant/sq_blocksearch.min.js CHANGED
@@ -1 +1 @@
1
- (function($){"use strict";$.fn.sq_blocksearch=function(options){var $this=this;var settings=$.extend({type:"img",delay:1e3,processing:null,timeout:null,ajaxCall:null,gtimeout:null},options);$.sq_fields=$.extend({sq_publish_alert:$this.find("#sq_publish_alert"),sq_more:$this.find(".sq_more"),sq_keywords_research_clear:$(".sq_keywords_research_clear"),sq_keywords_research_submit:$(".sq_keywords_research_submit")},$.sq_fields);$this.init=function(){if($.sq_config.keyword===""){$.sq_blockseo.close();$this.hideTypes()}};$this.hideTypes=function(){$.sq_fields.sq_types.hide();$this.hideSearch()};$this.showTypes=function(){$.sq_fields.sq_types.show()};$this.showActiveEditor=function(){var ed=$.sq_editor.getTinymceEditor();$.sq_tinymce.addEvents(ed)};$this.hideSearch=function(){$.sq_fields.sq_search.hide();$.sq_fields.sq_search_img_filter.hide()};$this.showSearch=function(){$.sq_fields.sq_search.html("");$.sq_fields.sq_search.show();$.sq_fields.sq_search_img_filter.hide()};$this.showNoResults=function(header,keyword){$this.showSearch();$.sq_fields.sq_search.addClass("sq_error").html($.sq_config.__no_results);if(typeof header!=="undefined"&&typeof keyword!=="undefined"&&header===1){$this.addHeaderSearch(keyword)}};$this.addHeaderSearch=function(keyword){if(typeof keyword==="undefined")keyword="";if(!$.sq_fields.sq_search.find("#sq_search_second").length){$.sq_fields.sq_search.prepend('<div id="sq_search_second" style="display: none"><input type="text" id="sq_keyword_second" placeholder="Search for new keyword..." '+($.sq_config.keyword===keyword||keyword===""?'value=""':'value="'+keyword+'"')+' autocomplete="off" /><input type="button" id="sq_keyword_second_check" value=">"/></div>')}$.sq_fields.sq_search_second=$this.find("#sq_search_second");$.sq_fields.sq_keyword_second=$this.find("#sq_keyword_second");$.sq_fields.sq_keyword_second_check=$this.find("#sq_keyword_second_check");if($.sq_config.keyword===keyword){if(!$.sq_fields.sq_search.find(".sq_search_notrelevant").length){$.sq_fields.sq_search.prepend('<a href="javascript:void(0);" class="sq_search_notrelevant">'+$.sq_config.__notrelevant+"</a>");$this.find(".sq_search_notrelevant").on("click",function(){$.sq_fields.sq_search_second.show();$.sq_fields.sq_keyword_second.focus();$(this).hide()})}}else{$.sq_fields.sq_search_second.show();$.sq_fields.sq_keyword_second.focus()}$this.initialFieldValue($.sq_fields.sq_keyword_second,"black","gray");$.sq_fields.sq_keyword_second.on("keypress",function(event){if(event.keyCode===$.ui.keyCode.ENTER)$.sq_fields.sq_keyword_second_check.trigger("click");return event.keyCode!==$.ui.keyCode.ENTER});$.sq_fields.sq_keyword_second_check.on("click",function(){if($.sq_fields.sq_keyword_second.val()!==""){$this.refreshSearch(settings.type)}})};$this.initialFieldValue=function(field,active_color,inactive_color){if(field.hasClass("default")){field.css("color",inactive_color);var default_values=[];field.focus(function(){if(!default_values[this.id]){default_values[this.id]=this.value}if(this.value===default_values[this.id]){this.value="";this.style.color=active_color}$(this).blur(function(){if(this.value===""){this.style.color=inactive_color;this.value=default_values[this.id]}})})}};$this.getSearch=function(type,start,extra_params){var keyword;if(settings.ajaxCall)settings.ajaxCall.abort();if($.sq_fields.sq_keyword_second.length>0&&$.sq_fields.sq_keyword_second.val()!==""){keyword=$.sq_fields.sq_keyword_second.val()}else{keyword=$.sq_config.keyword}var url="";var params="";if(typeof start==="undefined")start=0;if(start===0){$this.showSearch();$.sq_fields.sq_search.sq_loading()}switch(type){case"img":if($.sq_fields.sq_search_img_nolicence.is(":checked")){url=$.sq_config.sq_apiurl+"api/research/ib/images?callback=?";params="&user_url="+$.sq_config.user_url+"&url_token="+$.sq_config.url_token+"&token="+$.sq_config.token+"&page="+(start/$.sq_config.nrb+1)+"&nrb="+$.sq_config.nrb+"&hl="+$.sq_config.language+'&q="'+keyword+'"'}else{url=$.sq_config.sq_apiurl+"api/research/ib/gimages?callback=?";params="&user_url="+$.sq_config.user_url+"&url_token="+$.sq_config.url_token+"&token="+$.sq_config.token+"&page="+start+"&rpp="+$.sq_config.nrb+"&hl="+$.sq_config.language+'&q="'+keyword+'"'}break;case"twitter":url=$.sq_config.sq_apiurl+"api/research/ib/twitter?callback=?";params="&user_url="+$.sq_config.user_url+"&url_token="+$.sq_config.url_token+"&token="+$.sq_config.token+"&page="+(start/$.sq_config.nrb+1)+"&rpp="+$.sq_config.nrb+"&hl="+$.sq_config.language+'&q="'+keyword+'"';break;case"news":url="//ajax.googleapis.com/ajax/services/search/news?callback=?";params="&v=1.0&rsz="+$.sq_config.nrb+'&q="'+keyword+'"&hl='+$.sq_config.language+"&start="+start;break;case"blog":url=$.sq_config.sq_apiurl+"api/research/ib/blog?callback=?";params="&user_url="+$.sq_config.user_url+"&url_token="+$.sq_config.url_token+"&token="+$.sq_config.token+"&page="+start+"&rpp="+$.sq_config.nrb+"&hl="+$.sq_config.language+'&q="'+keyword+'"';break;case"wiki":url="//"+$.sq_config.language.substr(0,2)+".wikipedia.org/w/api.php?action=query&list=search&srwhat=text&srlimit="+(start/$.sq_config.nrb+1)*$.sq_config.nrb+"&format=json&callback=?";params='&srsearch="'+keyword+'"';break;case"local":url=sqQuery.ajaxurl;params="?action=sq_ajax_search_blog&nrb="+$.sq_config.nrb+"&sq_nonce="+sqQuery.nonce+"&exclude="+sqQuery.post+'&q="'+keyword+'"'+"&start="+start;break}if(typeof extra_params!=="undefined")params=params+"&"+extra_params;var cached=$.sq_getCache(url+params);if(cached){$this.showResults(keyword,cached,type,start)}else{settings.ajaxCall=$.getJSON(url+params,null).done(function(response){if(response instanceof Object){$this.showResults(keyword,response,type,start);$.sq_setCache(url+params,response)}else{$.sq_fields.sq_search.sq_doneloading().addClass("sq_error");if(start==0){$this.showNoResults(1,keyword)}else{$this.showNoResults(0)}}if(type==="img")$.sq_fields.sq_search_img_filter.show()}).fail(function(response){if(response.status===200&&response.responseText.indexOf("{")>0){response.responseText=response.responseText.substr(response.responseText.indexOf("{"),response.responseText.lastIndexOf("}"));try{response=$.parseJSON(response.responseText);if(response instanceof Object){$this.showResults(keyword,response,type,start);$.sq_setCache(url+params,response)}else{$.sq_fields.sq_search.sq_doneloading().addClass("sq_error");if(start===0){$this.showNoResults(1,keyword)}else{$this.showNoResults(0)}}if(type==="img")$.sq_fields.sq_search_img_filter.show()}catch(e){}}else{$.sq_fields.sq_search.sq_doneloading().addClass("sq_error");if(start===0){$this.showNoResults(1,keyword)}else{$this.showNoResults(0)}}if(type==="img")$.sq_fields.sq_search_img_filter.show()})}};$this.showResults=function(keyword,response,type,start){var items=[];var date;var domainName;$.sq_fields.sq_search.sq_doneloading().removeClass("sq_error");if(type==="img"){if(typeof response.data.responseData!=="undefined"&&typeof response.data.responseData.results!=="undefined"&&response.data.responseData.results.length>0){$.each(response.data.responseData.results,function(key,val){if(typeof val["detail"]!=="undefined"&&val["detail"]!==""){val["detail"]=val["detail"].replace(/\[a href=([^\]]*) title=([^\]]*)\]/,"$1")}items.push('<li class="sq_search_img_li" id="sq_search_img_li'+key+'" src="'+val["url"]+'" width="'+val["width"]+'" height="'+val["height"]+'" '+(typeof val["attribute"]!=="undefined"&&val["attribute"]!==""?'attribute="'+val["attribute"]+'"':"")+" >"+(typeof val["attribute"]!=="undefined"?val["attribute"]!==""?'<span class="sq_attribute" title="'+$.sq_config.__has_attributes+'">A</span>':'<span class="sq_attribute " title="'+$.sq_config.__no_attributes+'">N</span>':"")+'<img id="sq_search_img'+key+'" src="'+val["tbUrl"]+'" '+(typeof val["detail"]!=="undefined"&&val["detail"]!==""?'title="'+val["detail"]+'"':"")+' alt="'+val["contentNoFormatting"]+'" /></li>')})}else $this.showNoResults()}if(type==="twitter"){if(typeof response.data!=="undefined"&&response.data.length>0)$.each(response.data,function(key,val){date=new Date(val["created_at"]);date=$this.formatDate(date);items.push('<li class="sq_search_twitter_li sq_search_li" id="t_'+val["id"]+'" href="https://twitter.com/'+val["from_user"]+'"><a href="https://twitter.com/'+val["from_user"]+'" title="'+val["text"]+'" target="_blank" ><img src="'+val["profile_image_url"]+'" alt="'+val["from_user"]+'" class="sq_author_avatar" /></a><div class="sq_quote_content"><div class="sq_quote_author"><span class="sq_author_name">'+val["from_user"]+'</span></div> <div class="sq_quote_text truncated">'+val["text"]+'</div></div><div class="sq_info"><ul><li>'+$.sq_config.__date+": "+date+'</li></ul></div><div class="sq_attribution"><ul><li class="sq_insert">'+$.sq_config.__insertit+"</li></ul></div></li>")});else $this.showNoResults()}if(type==="news"){if(typeof response.responseData!=="undefined"&&response.responseData.results.length>0)$.each(response.responseData.results,function(key,val){date=new Date(val["publishedDate"]);date=$this.formatDate(date);domainName='<a href="'+val["unescapedUrl"]+'" target="_blank">'+$.sq_getDomain(val["unescapedUrl"])+"</a>";items.push('<li class="sq_search_blog_li sq_search_li" id="b_'+key+'" href="'+val["unescapedUrl"]+'" header="'+val["titleNoFormatting"]+'"><div class="sq_news_content"><div class="sq_news_title">'+val["titleNoFormatting"]+'</div><div class="sq_news_text">'+val["content"]+'</div><div class="sq_info"><ul><li>'+$.sq_config.__date+": "+date+"</li><li>source: "+domainName+'</li></ul></div></div><div class="sq_attribution"><ul><li class="sq_read">'+$.sq_config.__readit+'</li><li class="sq_insert">'+$.sq_config.__insertasbox+'</li><li class="sq_reference">'+$.sq_config.__reference+"</li></ul></div></li>")});else $this.showNoResults()}if(type==="blog"){if(typeof response!=="undefined"&&typeof response.data.results!=="undefined"&&response.data.results.length>0)$.each(response.data.results,function(key,val){domainName='<a href="'+val["url"]+'" target="_blank">'+val["visibleUrl"]+"</a>";items.push('<li class="sq_search_blog_li sq_search_li" id="b_'+key+'" href="'+val["url"]+'" header="'+val["titleNoFormatting"]+'" ><div class="sq_news_content"><div class="sq_news_title">'+val["titleNoFormatting"]+'</div><div class="sq_news_text">'+val["content"]+'</div><div class="sq_info"><ul><li>source: '+domainName+'</li></ul></div></div><div class="sq_attribution"><ul><li class="sq_read">'+$.sq_config.__readit+'</li><li class="sq_insert">'+$.sq_config.__insertasbox+'</li><li class="sq_reference">'+$.sq_config.__reference+"</li></ul></div></li>")});else $this.showNoResults()}if(type==="wiki"){var wikihref="//"+$.sq_config.language.substr(0,2)+".wikipedia.org/wiki/";if(typeof response.query!=="undefined"&&response.query.search.length>0)$.each(response.query.search,function(key,val){date=new Date(val.timestamp);date=$this.formatDate(date);if($("#w_"+key).length==0)items.push('<li class="sq_search_wiki_li sq_search_li" id="w_'+key+'" href="'+wikihref+val.title.replace(/ /g,"_")+'" ><div class="sq_wiki_content"><div class="sq_wiki_title">'+val.title+'</div><div class="sq_wiki_text truncated">'+val.snippet+'</div><div class="sq_info"><ul><li>'+$.sq_config.__date+": "+date+'</li></ul></div><div class="sq_attribution"><ul><li class="sq_read">'+$.sq_config.__readit+'</li><li class="sq_insert">'+$.sq_config.__insertit+"</li></ul></div></li>")});else $this.showNoResults()}if(type==="local"){if(typeof response.results!=="undefined"&&response.results.length>0)$.each(response.results,function(key,val){date=new Date(val.date);date=$this.formatDate(date);items.push('<li class="sq_search_local_li sq_search_li" id="l_'+val["id"]+'" href="'+val["url"]+'" header="'+val["title"]+'" ><div class="sq_local_content"><div class="sq_local_title">'+val["title"]+'</div><div class="sq_local_text truncated">'+val["content"]+'</div><div class="sq_info"><ul><li>'+$.sq_config.__date+": "+date+'</li></ul></div><div class="sq_attribution"><ul><li class="sq_insert">'+$.sq_config.__insertit+'</li><li class="sq_reference">'+$.sq_config.__reference+'</li><li class="sq_link">'+$.sq_config.__addlink+"</li></ul></div></li>")});else $this.showNoResults()}if(items.length>0){if(start===0){$.sq_fields.sq_search.append($("<ul/>",{html:items.join("")}));$this.addHeaderSearch(keyword)}else{$.sq_fields.sq_search.find("ul").first().append(items.join(""))}$this.addEvents("click",type,start)}else{if(start===0){$this.showNoResults(1,keyword)}else{$this.showNoResults(0)}}if($.sq_fields.sq_more.length>0){$.sq_fields.sq_more.html("<span />");$.sq_fields.sq_more.sq_doneloading();$.sq_fields.sq_more.on("click");if(items.length<$.sq_config.nrb)$.sq_fields.sq_more.hide()}$this.find(".sq_search li.sq_search_li .sq_attribution > ul").show()};$this.addEvents=function(event,type,start){if(type==="img"){$this.find("li.sq_search_img_li img").off(event).on(event,function(){if($.sq_isGutenberg()){var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(wp.blocks.createBlock("core/image",{url:$(this).parent("li").attr("src"),className:"sq_image",alt:$.sq_config.keyword.replace(/\"/g,"")}),undefined);$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packimg($(this).attr("id"),$(this).parent("li").attr("src"),$(this).parent("li")));if(typeof $(this).parent("li").attr("attribute")!=="undefined"&&typeof $.sq_config.__sq_photo_copyright!=="")$.sq_editor.insert($.sq_config.__sq_photo_copyright.replace("%s",$(this).parent("li").attr("attribute")))}});$this.find("li.sq_search_img_li img").on("dragstart",function(event){if($.sq_config.editor_type==="html"){event.originalEvent.dataTransfer.setData("text/plain",$(this).parent("li").html())}});$.sq_fields.sq_search_img_filter.show()}if(type==="twitter"){$this.find("li.sq_search_twitter_li .sq_insert").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packtweet($(this).parents("li:last"))});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packtweet($(this).parents("li:last")))}})}if(type==="wiki"){$this.find("li.sq_search_wiki_li .sq_insert").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packwiki($(this).parents("li:last"))});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packwiki($(this).parents("li:last")))}});$this.find(".sq_read").off(event).on(event,function(){$("body").after($.sq_fields.sq_blog_preview);$.sq_fields.sq_blog_preview.sq_loading();$.sq_fields.sq_blog_preview.find("#sq_blog_preview_title").html("&nbsp;");$.sq_fields.sq_blog_preview.find("#sq_blog_preview_body").html("");$.sq_fields.sq_blog_preview.find("#sq_blog_preview_close").off(event).on(event,function(){$.sq_fields.sq_blog_preview.remove()});$this.previewBlog($(this).parents("li:last"),false)})}if(type==="news"||type==="blog"){$this.find("li.sq_search_blog_li .sq_insert").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packblog($(this).parents("li:last"),"box")});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packblog($(this).parents("li:last"),"box"))}});$this.find("li.sq_search_blog_li .sq_reference").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packblog($(this).parents("li:last"),"reference")});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packblog($(this).parents("li:last"),"reference"))}});$this.find(".sq_read").off(event).on(event,function(){$("body").after($.sq_fields.sq_blog_preview);$.sq_fields.sq_blog_preview.sq_loading();$.sq_fields.sq_blog_preview.find("#sq_blog_preview_title").html("&nbsp;");$.sq_fields.sq_blog_preview.find("#sq_blog_preview_body").html("");$.sq_fields.sq_blog_preview.find("#sq_blog_preview_close").off(event).on(event,function(){$.sq_fields.sq_blog_preview.remove()});$this.previewBlog($(this).parents("li:last"),true)})}if(type==="local"){$this.find("li.sq_search_local_li .sq_insert").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packlocal($(this).parents("li:last"),"box")});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packlocal($(this).parents("li:last"),"box"))}});this.find("li.sq_search_local_li .sq_reference").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packlocal($(this).parents("li:last"),"reference")});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packlocal($(this).parents("li:last"),"reference"))}});this.find("li.sq_search_local_li .sq_link").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packlocal($(this).parents("li:last"),"link")});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packlocal($(this).parents("li:last"),"link"))}})}if(start===0){$.sq_fields.sq_search.append('<div class="sq_more"><span /></div>');$.sq_fields.sq_more=$this.find(".sq_more")}$.sq_fields.sq_more.off("click").on("click",function(){$(this).html("");$(this).sq_loading();$(this).off("click");$this.getSearch(type,start+$.sq_config.nrb)})};$this.pack=function(html){return'<div class="sq_box">'+html+"<div>"};$this.packimg=function(id,src,parent){if(id!==""){var content='<img src="'+src+'" id="img'+Math.floor(Math.random()*1e3)+'" class="aligncenter size-medium sq_image" width="'+(parent.attr("width")>500?"500":parent.attr("width"))+'" alt="'+$.sq_config.keyword.replace(/\"/g,"")+'" title="'+$.sq_config.keyword.replace(/\"/g,"")+'" />';return content}return""};$this.packtweet=function(parent){var content="";content='<div class="sq_quote_content" style="position: relative;clear: both;background: white;font-size: 14px;color: #333;max-width: 500px;margin: 5px auto 5px auto;padding: 13px;border: 1px solid #DDD;-webkit-box-shadow: 0 1px 0 #DDD;-moz-box-shadow: 0 1px 0 #ddd;box-shadow: 0 1px 0 #DDD;">';content=content+'<a id="'+parent.attr("id")+'" class="sq_tweet" href="'+parent.attr("href")+'" title="'+parent.find(".sq_author_avatar").attr("alt")+'" style="display: block;float: left;width: 48px;height: 48px;padding: 1px;margin: 0;border: 1px solid #DDD;" ><img class="sq_author_avatar" src="'+parent.find(".sq_author_avatar").attr("src")+'" alt="'+parent.find(".sq_author_avatar").attr("alt")+'" /></a>';content=content+'<div class="sq_quote_text" style="margin-left: 62px;line-height: 1.5em;padding-left: 21px;min-height: 52px;font-style:italic;">'+parent.find(".sq_quote_text").html()+"</div>";content=content+"</div>";return'<div id="tw'+Math.floor(Math.random()*1e3)+'" >'+content+"</div>"+$.sq_config.after_insert};$this.packwiki=function(parent){var content="";content='<div class="sq_wiki_content" style="position: relative;clear: both;background: white;font-size: 14px;color: #333;max-width: 500px;margin: 5px auto 5px auto;padding: 13px;border: 1px solid #DDD;-webkit-box-shadow: 0 1px 0 #DDD;-moz-box-shadow: 0 1px 0 #ddd;box-shadow: 0 1px 0 #DDD;">';content=content+'<a id="'+parent.attr("id")+'" class="sq_wiki" href="'+parent.attr("href")+'" title="'+parent.find(".sq_wiki_title").html()+'" style="display: block;font-weight: 700;color: #0074B7;line-height: 1.4em;margin-bottom: 5px;text-decoration: none;">'+parent.find(".sq_wiki_title").html()+"</a>";content=content+'<div class="sq_wiki_text" style="font-style:italic;color: #333;">'+parent.find(".sq_wiki_text").html()+"</div>";content=content+"</div>";return'<div id="wi'+Math.floor(Math.random()*1e3)+'">'+content+"</div>"+$.sq_config.after_insert};$this.packblog=function(parent,as){var content="";if(as==="box"){content='<div class="sq_blog_content" style="position: relative;clear: both;background: white;font-size: 14px;color: #333;max-width: 500px;margin: 5px auto 5px auto;padding: 13px;border: 1px solid #DDD;-webkit-box-shadow: 0 1px 0 #DDD;-moz-box-shadow: 0 1px 0 #ddd;box-shadow: 0 1px 0 #DDD;">';content=content+'<a id="'+parent.attr("id")+'" class="sq_news" href="'+parent.attr("href")+'" title="'+parent.find(".sq_news_title").html()+'" >'+parent.find(".sq_news_title").html()+"</a>";content=content+'<div class="sq_news_text" style="font-style:italic;color: #333;">'+parent.find(".sq_news_text").html()+"</div>";content=content+"</div>"}if(as==="reference"){content='<a class="sq_news" href="'+parent.attr("href")+'" rel="nofollow" title="'+parent.attr("header")+'" style="font-style:italic;color: #333;">'+$.sq_getDomain(parent.attr("href"),[1,7,8,10])+"</a>"}return'<div id="bl'+Math.floor(Math.random()*1e3)+'">'+content+"</div>"+$.sq_config.after_insert};$this.packlocal=function(parent,as){var content="";if(as==="box"){content='<div class="sq_local_content" style="position: relative;clear: both;background: white;font-size: 14px;color: #333;max-width: 500px;margin: 5px auto 5px auto;padding: 13px;border: 1px solid #DDD;-webkit-box-shadow: 0 1px 0 #DDD;-moz-box-shadow: 0 1px 0 #ddd;box-shadow: 0 1px 0 #DDD;">';content=content+'<a id="'+parent.attr("id")+'" class="sq_local" href="'+parent.attr("href")+'" title="'+parent.find(".sq_local_title").html()+'" style="display: block;font-weight: 700;color: #0074B7;line-height: 1.4em;margin-bottom: 5px;text-decoration: none;">'+parent.find(".sq_local_title").html()+"</a>";content=content+'<div class="sq_local_text" style="font-style:italic;color: #333;">'+parent.find(".sq_local_text").html()+"</div>";content=content+"</div>";content='<div id="lo'+Math.floor(Math.random()*1e3)+'">'+content+"</div>"+$.sq_config.after_insert}if(as==="reference"){content='<a class="sq_local" href="'+parent.attr("href")+'" title="'+parent.attr("header")+'" >'+decodeURIComponent(parent.attr("href"))+"</a>";content='<div id="lo'+Math.floor(Math.random()*1e3)+'" style="font-style:italic;color: #333;">'+content+"</div>"+$.sq_config.after_insert}if(as==="link"){content='<a href="'+parent.attr("href")+'" title="'+parent.attr("header")+'" style="font-style:italic;color: #333;">'+decodeURIComponent(parent.attr("href"))+"</a>"}return content};$this.formatDate=function(date){var mm=date.getMonth()+1;var dd=date.getDate();var yyyy=date.getFullYear();mm=mm<10?"0"+mm:mm;return mm+"."+dd+"."+yyyy};$this.showTypeHelp=function(type){$this.find(".sq_type_help").hide();$this.find(".sq_type_"+type+"_help").show()};$this.refreshSearch=function(type){settings.type=type;$this.getSearch(type,0)};$this.previewBlog=function(parent,filter){if($.sq_fields.sq_blog_preview===null)return;$.getJSON($.sq_config.sq_apiurl+"api/research/ib/preview?callback=?"+(filter?"&filter=1":"")+"",{user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token,link:parent.attr("href")}).done(function(response){if(response.data.content!==""){$.sq_fields.sq_blog_preview.removeClass("sq_error").sq_doneloading();$.sq_fields.sq_blog_preview.attr("href",response.link);$.sq_fields.sq_blog_preview.find("#sq_blog_preview_title").html(response.data.title);$.sq_fields.sq_blog_preview.find("#sq_blog_preview_body").html(response.data.content);$.sq_fields.sq_blog_preview.find("#sq_blog_preview_body p").each(function(){$(this).removeClass();if($(this).text().trim().length>5)$(this).prepend('<div class="sq_blog_option">'+$.sq_config.__insertparagraph+"</div>")});var ptext;$.sq_fields.sq_blog_preview.find(".sq_blog_option").off("click").on("click",function(){ptext=$(this).parent("p").clone();ptext=ptext.find(".sq_blog_option").remove();ptext=ptext.end().html();if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:ptext+$this.packblog($.sq_fields.sq_blog_preview,"reference")});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click")}else{$.sq_editor.insert(ptext+$this.packblog($.sq_fields.sq_blog_preview,"reference"))}});$.sq_fields.sq_blog_preview.find("#sq_blog_preview_body a").each(function(){$(this).attr("target","_blank")});$.sq_fields.sq_blog_preview.find(".editsection").hide()}else{$.sq_fields.sq_blog_preview.remove()}$.sq_fields.sq_blog_preview.find("#sq_blog_preview_close").off(event).on(event,function(){$.sq_fields.sq_blog_preview.remove()})}).fail(function(){$.sq_fields.sq_blog_preview.remove()})};$this.showNotOptimized=function(){$("#sq_nokeyword").show()};$this.hideNotOptimized=function(){$("#sq_publish_alert").hide()};$this.handleKey=function(event,gsuggestion_index){if(event.keyCode===$.ui.keyCode.UP&&gsuggestion_index>0){gsuggestion_index--}else if(event.keyCode===$.ui.keyCode.DOWN&&gsuggestion_index<$(".sq_gsuggestion .sq_item_gsuggestion").length){gsuggestion_index++}else{gsuggestion_index=0}$(".sq_gsuggestion .sq_item_gsuggestion").removeClass("sq_item_active");if(gsuggestion_index>0){var item_active=$(".sq_gsuggestion .sq_item_gsuggestion:nth-child("+gsuggestion_index+")");item_active.addClass("sq_item_active");$.sq_fields.sq_keyword.val(item_active.html())}return gsuggestion_index};$this.hideOptions=function(){if(settings.timeout){clearTimeout(settings.timeout);clearTimeout(settings.calltime)}if(settings.gtimeout){clearTimeout(settings.gtimeout)}if(settings.ajaxCall)settings.ajaxCall.abort()};$this.prepareParam=function(response,keyword){var j;var param={rank:-1,note:-1,stats:[]};if($.sq_isArray(response)){var responselen=response.length;for(j=0;j<responselen;j++){if(keyword===response[j].keyword){param.rank=response[j].stats.rank.value;param.note=response[j].note;param.stats=[response[j].stats.tw,response[j].stats.sv,response[j].stats.sc,response[j].stats.td];break}}}return param};$this.addTag=function(){if($.sq_config.sq_keywordtag==1){$("#new-tag-post_tag").val($.sq_config.keyword);$("input.tagadd").trigger("click")}};$this.sq_eventssearch={checkKeywordSet:function(){if($.sq_fields.sq_keyword.val()!==""){$.sq_config.keyword=$.sq_fields.sq_keyword.val();$.sq_fields.sq_selectit.trigger("click");$.sq_fields.sq_keyword_score.html("0%");$(".sq_keyword").show();if($.sq_config.firsttime){$.sq_fields.sq_box_maximize.trigger("click")}}if($.sq_config.keyword===""&&$(".sq_snippet_keywords").length>0){var snipet_keywords=$(".sq_snippet_keywords").text().split(",");if(snipet_keywords.length>0){$.sq_config.keyword=snipet_keywords[0];$.sq_fields.sq_keyword.val($.sq_config.keyword);$.sq_fields.sq_selectit.trigger("click")}}if($.sq_config.keyword===""){$this.hideTypes();$.sq_blockseo.overlay();$this.hideOptions();$this.showNotOptimized()}$this.initialFieldValue($.sq_fields.sq_keyword,"black","gray");$.sq_fields.div_blockseo.trigger("seo.keyword_loaded")},listen:function(){$.getJSON($.sq_config.sq_apiurl+"api/posts/keyword?callback=?",{post_id:$.sq_config.postID,user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token}).done(function(response){if(typeof $.sq_fields.sq_keyword==="undefined"){$.sq_setfields()}if(typeof response.data!=="undefined"){if(typeof response.data.keyword!=="undefined"){if(response.data.keyword===null){$.sq_config.firsttime=true;$this.sq_eventssearch.checkKeywordSet()}else{$.sq_config.firsttime=false;if($.sq_fields.sq_keyword.val()===""){$.sq_fields.sq_keyword.val(decodeURIComponent(response.data.keyword))}$this.sq_eventssearch.checkKeywordSet()}}}$.sq_fields.sq_preloading_keyword.hide();$.sq_fields.sq_blocktabs.show();$.sq_fields.div_blockbriefacse.show();$this.trigger("seo.keyword_loaded")}).fail(function(error){$.sq_fields.sq_preloading.show()});$.sq_fields.sq_keyword.on("keypress",function(event){if(event.keyCode===$.ui.keyCode.ENTER){$.sq_fields.sq_keyword_check.trigger("click")}return event.keyCode!==$.ui.keyCode.ENTER});$.sq_fields.sq_keyword.on("keyup",function(event){if(event.keyCode!==$.ui.keyCode.ENTER&&event.keyCode!==$.ui.keyCode.UP&&event.keyCode!==$.ui.keyCode.DOWN&&event.keyCode!==$.ui.keyCode.ESCAPE){if($.sq_fields.sq_keyword.val()!==""&&$.sq_config.keyword!==$.sq_clearText($.sq_fields.sq_keyword.val())){if($.sq_fields.sq_keyword.val()!==""){$.sq_config.keyword=$.sq_fields.sq_keyword.val();$.sq_blockseo.checkKeyword();$this.init()}else{$this.hideOptions()}$.sq_blockseo.overlay();$this.hideSearch()}}else if(event.keyCode===$.ui.keyCode.ESCAPE){if($.sq_fields.sq_keyword.val()!==""){$this.hideOptions()}}});$.sq_fields.sq_keyword.on("click",function(){if($.sq_fields.sq_keyword.val()===""){$this.hideOptions()}});$.sq_fields.sq_keyword_check.off("click").on("click",function(){if($.sq_fields.sq_keyword.val()!==""){$.sq_fields.sq_selectit.trigger("click")}});$.sq_fields.sq_selectit.off("click").on("click",function(){$.sq_config.manual=true;$("#sq_keyword_second").val("");if($.sq_fields.sq_keyword.val()!==""){$.sq_config.keyword=$.sq_fields.sq_keyword.val()}if($.sq_config.keyword!==""){if($("#sq_blocksnippet").find("input[name=sq_keyword]").length){$("#sq_blocksnippet").find("input[name=sq_keyword]").val($.sq_config.keyword)}$this.showTypes();$.sq_blockseo.load();$.sq_blockseo.closeOverlay();$this.trigger("seo.keyword_selected");$(".sq_request_highlight_key").html($.sq_config.keyword);$.sq_fields.sq_type_img.trigger("click");$this.hideNotOptimized()}if($.sq_fields.wp_content_wrap.length>0){if($.sq_fields.wp_content_wrap.attr("class").indexOf("html-active")==-1){$this.showActiveEditor()}}});$.sq_fields.sq_type_img.off("click").on("click",function(){$.sq_fields.sq_types.find("li").removeClass("sq_active");$(this).addClass("sq_active");$this.showTypeHelp("img");$this.refreshSearch("img")});$.sq_fields.sq_type_twitter.off("click").on("click",function(){$.sq_fields.sq_types.find("li").removeClass("sq_active");$(this).addClass("sq_active");$this.showTypeHelp("twitter");$this.refreshSearch("twitter")});$.sq_fields.sq_type_news.off("click").on("click",function(){$.sq_fields.sq_types.find("li").removeClass("sq_active");$(this).addClass("sq_active");$this.showTypeHelp("twitter");$this.refreshSearch("news")});$.sq_fields.sq_type_blog.off("click").on("click",function(){$.sq_fields.sq_types.find("li").removeClass("sq_active");$(this).addClass("sq_active");$this.showTypeHelp("blog");$this.refreshSearch("blog")});$.sq_fields.sq_type_wiki.off("click").on("click",function(){$.sq_fields.sq_types.find("li").removeClass("sq_active");$(this).addClass("sq_active");$this.showTypeHelp("wiki");$this.refreshSearch("wiki")});$.sq_fields.sq_type_local.off("click").on("click",function(){$.sq_fields.sq_types.find("li").removeClass("sq_active");$(this).addClass("sq_active");$this.showTypeHelp("local");$this.refreshSearch("local")});$.sq_fields.sq_search_img_nolicence.off("click").on("click",function(){var licence=1;if($.sq_fields.sq_search_img_nolicence.is(":checked")){$("#sq_search_img_nolicence_label").attr("class","checked");licence=1}else{$("#sq_search_img_nolicence_label").removeClass("checked");licence=0}$this.refreshSearch("img");$.post(sqQuery.ajaxurl,{action:"sq_ajax_type_click",licence:licence,sq_nonce:sqQuery.nonce})});$(".wp-switch-editor").on("click",function(){if(this.id.indexOf("tmce")!==-1){$this.sq_eventssearch.listenMCE()}else{$this.sq_eventssearch.listenHTML()}});$("#qt_content_fullscreen, .mce-i-wp_fullscreen").on("click",function(){$(".mce-btn").find("i").on("click",function(){$this.sq_eventssearch.listenMCE()});$(".wp-fullscreen-mode-tinymce").on("click",function(){$this.sq_eventssearch.listenMCE();$(".media-modal").find("a").on("click",function(){$this.sq_eventssearch.listenMCE()})});$(".wp-fullscreen-mode-html").on("click",function(){$this.sq_eventssearch.listenHTML();$(".media-modal").find("a").on("click",function(){$this.sq_eventssearch.listenHTML()})})});$("#wp-fullscreen-close, .mce-i-bold, .media-button").find("a").on("click",function(){if($.sq_fields.wp_content_wrap.length>0&&$.sq_fields.wp_content_wrap.attr("class").indexOf("html-active")!==-1){$.sq_blockseo.sq_eventsseo.listenHtml()}else{$.sq_blockseo.sq_eventsseo.listenTinymce()}})},listenMCE:function(){$this.showActiveEditor();$.sq_blockseo.sq_eventsseo.stopListenHtml();$.sq_blockseo.sq_eventsseo.listenTinymce();$.sq_fields.sq_selectit.trigger("click")},listenHTML:function(){$.sq_blockseo.sq_eventsseo.stopListenTinymce();$.sq_blockseo.sq_eventsseo.listenHtml();$.sq_fields.sq_selectit.trigger("click")}};$this.one("seo.loaded",function(){SQ_DEBUG&&console.log("sq_blocksearch seo.loaded");$this.sq_eventssearch.listen()});return $this}})(jQuery);
1
+ (function($){"use strict";$.fn.sq_blocksearch=function(options){var $this=this;var settings=$.extend({type:"img",delay:1e3,processing:null,timeout:null,ajaxCall:null,gtimeout:null},options);$.sq_fields=$.extend({sq_publish_alert:$this.find("#sq_publish_alert"),sq_more:$this.find(".sq_more"),sq_keywords_research_clear:$(".sq_keywords_research_clear"),sq_keywords_research_submit:$(".sq_keywords_research_submit")},$.sq_fields);$this.init=function(){if($.sq_config.keyword===""){$.sq_blockseo.close();$this.hideTypes()}};$this.hideTypes=function(){$.sq_fields.sq_types.hide();$this.hideSearch()};$this.showTypes=function(){$.sq_fields.sq_types.show()};$this.showActiveEditor=function(){var ed=$.sq_editor.getTinymceEditor();$.sq_tinymce.addEvents(ed)};$this.hideSearch=function(){$.sq_fields.sq_search.hide();$.sq_fields.sq_search_img_filter.hide()};$this.showSearch=function(){$.sq_fields.sq_search.html("");$.sq_fields.sq_search.show();$.sq_fields.sq_search_img_filter.hide()};$this.showNoResults=function(header,keyword){$this.showSearch();$.sq_fields.sq_search.addClass("sq_error").html($.sq_config.__no_results);if(typeof header!=="undefined"&&typeof keyword!=="undefined"&&header===1){$this.addHeaderSearch(keyword)}};$this.addHeaderSearch=function(keyword){if(typeof keyword==="undefined")keyword="";if(!$.sq_fields.sq_search.find("#sq_search_second").length){$.sq_fields.sq_search.prepend('<div id="sq_search_second" style="display: none"><input type="text" id="sq_keyword_second" placeholder="Search for new keyword..." '+($.sq_strEqual($.sq_config.keyword,keyword)||keyword===""?'value=""':'value="'+keyword+'"')+' autocomplete="off" /><input type="button" id="sq_keyword_second_check" value=">"/></div>')}$.sq_fields.sq_search_second=$this.find("#sq_search_second");$.sq_fields.sq_keyword_second=$this.find("#sq_keyword_second");$.sq_fields.sq_keyword_second_check=$this.find("#sq_keyword_second_check");if($.sq_strEqual($.sq_config.keyword,keyword)){if(!$.sq_fields.sq_search.find(".sq_search_notrelevant").length){$.sq_fields.sq_search.prepend('<a href="javascript:void(0);" class="sq_search_notrelevant">'+$.sq_config.__notrelevant+"</a>");$this.find(".sq_search_notrelevant").on("click",function(){$.sq_fields.sq_search_second.show();$.sq_fields.sq_keyword_second.focus();$(this).hide()})}}else{$.sq_fields.sq_search_second.show();$.sq_fields.sq_keyword_second.focus()}$this.initialFieldValue($.sq_fields.sq_keyword_second,"black","gray");$.sq_fields.sq_keyword_second.on("keypress",function(event){if(event.keyCode===$.ui.keyCode.ENTER)$.sq_fields.sq_keyword_second_check.trigger("click");return event.keyCode!==$.ui.keyCode.ENTER});$.sq_fields.sq_keyword_second_check.on("click",function(){if($.sq_fields.sq_keyword_second.val()!==""){$this.refreshSearch(settings.type)}})};$this.initialFieldValue=function(field,active_color,inactive_color){if(field.hasClass("default")){field.css("color",inactive_color);var default_values=[];field.focus(function(){if(!default_values[this.id]){default_values[this.id]=this.value}if($.sq_strEqual(this.value,default_values[this.id])){this.value="";this.style.color=active_color}$(this).blur(function(){if(this.value===""){this.style.color=inactive_color;this.value=default_values[this.id]}})})}};$this.getSearch=function(type,start,extra_params){var keyword;if(settings.ajaxCall)settings.ajaxCall.abort();if($.sq_fields.sq_keyword_second.length>0&&$.sq_fields.sq_keyword_second.val()!==""){keyword=$.sq_fields.sq_keyword_second.val()}else{keyword=$.sq_config.keyword}var url="";var params="";if(typeof start==="undefined")start=0;if(start===0){$this.showSearch();$.sq_fields.sq_search.sq_loading()}switch(type){case"img":if($.sq_fields.sq_search_img_nolicence.is(":checked")){url=$.sq_config.sq_apiurl+"api/research/ib/images?callback=?";params="&user_url="+$.sq_config.user_url+"&url_token="+$.sq_config.url_token+"&token="+$.sq_config.token+"&page="+(start/$.sq_config.nrb+1)+"&nrb="+$.sq_config.nrb+"&hl="+$.sq_config.language+'&q="'+keyword+'"'}else{url=$.sq_config.sq_apiurl+"api/research/ib/gimages?callback=?";params="&user_url="+$.sq_config.user_url+"&url_token="+$.sq_config.url_token+"&token="+$.sq_config.token+"&page="+start+"&rpp="+$.sq_config.nrb+"&hl="+$.sq_config.language+'&q="'+keyword+'"'}break;case"twitter":url=$.sq_config.sq_apiurl+"api/research/ib/twitter?callback=?";params="&user_url="+$.sq_config.user_url+"&url_token="+$.sq_config.url_token+"&token="+$.sq_config.token+"&page="+(start/$.sq_config.nrb+1)+"&rpp="+$.sq_config.nrb+"&hl="+$.sq_config.language+'&q="'+keyword+'"';break;case"news":url="//ajax.googleapis.com/ajax/services/search/news?callback=?";params="&v=1.0&rsz="+$.sq_config.nrb+'&q="'+keyword+'"&hl='+$.sq_config.language+"&start="+start;break;case"blog":url=$.sq_config.sq_apiurl+"api/research/ib/blog?callback=?";params="&user_url="+$.sq_config.user_url+"&url_token="+$.sq_config.url_token+"&token="+$.sq_config.token+"&page="+start+"&rpp="+$.sq_config.nrb+"&hl="+$.sq_config.language+'&q="'+keyword+'"';break;case"wiki":url="//"+$.sq_config.language.substr(0,2)+".wikipedia.org/w/api.php?action=query&list=search&srwhat=text&srlimit="+(start/$.sq_config.nrb+1)*$.sq_config.nrb+"&format=json&callback=?";params='&srsearch="'+keyword+'"';break;case"local":url=sqQuery.ajaxurl;params="?action=sq_ajax_search_blog&nrb="+$.sq_config.nrb+"&sq_nonce="+sqQuery.nonce+"&exclude="+sqQuery.post+'&q="'+keyword+'"'+"&start="+start;break}if(typeof extra_params!=="undefined")params=params+"&"+extra_params;var cached=$.sq_getCache(url+params);if(cached){$this.showResults(keyword,cached,type,start)}else{settings.ajaxCall=$.getJSON(url+params,null).done(function(response){if(response instanceof Object){$this.showResults(keyword,response,type,start);$.sq_setCache(url+params,response)}else{$.sq_fields.sq_search.sq_doneloading().addClass("sq_error");if(start==0){$this.showNoResults(1,keyword)}else{$this.showNoResults(0)}}if(type==="img")$.sq_fields.sq_search_img_filter.show()}).fail(function(response){if(response.status===200&&response.responseText.indexOf("{")>0){response.responseText=response.responseText.substr(response.responseText.indexOf("{"),response.responseText.lastIndexOf("}"));try{response=$.parseJSON(response.responseText);if(response instanceof Object){$this.showResults(keyword,response,type,start);$.sq_setCache(url+params,response)}else{$.sq_fields.sq_search.sq_doneloading().addClass("sq_error");if(start===0){$this.showNoResults(1,keyword)}else{$this.showNoResults(0)}}if(type==="img")$.sq_fields.sq_search_img_filter.show()}catch(e){}}else{$.sq_fields.sq_search.sq_doneloading().addClass("sq_error");if(start===0){$this.showNoResults(1,keyword)}else{$this.showNoResults(0)}}if(type==="img")$.sq_fields.sq_search_img_filter.show()})}};$this.showResults=function(keyword,response,type,start){var items=[];var date;var domainName;$.sq_fields.sq_search.sq_doneloading().removeClass("sq_error");if(type==="img"){if(typeof response.data.responseData!=="undefined"&&typeof response.data.responseData.results!=="undefined"&&response.data.responseData.results.length>0){$.each(response.data.responseData.results,function(key,val){if(typeof val["detail"]!=="undefined"&&val["detail"]!==""){val["detail"]=val["detail"].replace(/\[a href=([^\]]*) title=([^\]]*)\]/,"$1")}items.push('<li class="sq_search_img_li" id="sq_search_img_li'+key+'" src="'+val["url"]+'" width="'+val["width"]+'" height="'+val["height"]+'" '+(typeof val["attribute"]!=="undefined"&&val["attribute"]!==""?'attribute="'+val["attribute"]+'"':"")+" >"+(typeof val["attribute"]!=="undefined"?val["attribute"]!==""?'<span class="sq_attribute" title="'+$.sq_config.__has_attributes+'">A</span>':'<span class="sq_attribute " title="'+$.sq_config.__no_attributes+'">N</span>':"")+'<img id="sq_search_img'+key+'" src="'+val["tbUrl"]+'" '+(typeof val["detail"]!=="undefined"&&val["detail"]!==""?'title="'+val["detail"]+'"':"")+' alt="'+val["contentNoFormatting"]+'" /></li>')})}else $this.showNoResults()}if(type==="twitter"){if(typeof response.data!=="undefined"&&response.data.length>0)$.each(response.data,function(key,val){date=new Date(val["created_at"]);date=$this.formatDate(date);items.push('<li class="sq_search_twitter_li sq_search_li" id="t_'+val["id"]+'" href="https://twitter.com/'+val["from_user"]+'"><a href="https://twitter.com/'+val["from_user"]+'" title="'+val["text"]+'" target="_blank" ><img src="'+val["profile_image_url"]+'" alt="'+val["from_user"]+'" class="sq_author_avatar" /></a><div class="sq_quote_content"><div class="sq_quote_author"><span class="sq_author_name">'+val["from_user"]+'</span></div> <div class="sq_quote_text truncated">'+val["text"]+'</div></div><div class="sq_info"><ul><li>'+$.sq_config.__date+": "+date+'</li></ul></div><div class="sq_attribution"><ul><li class="sq_insert">'+$.sq_config.__insertit+"</li></ul></div></li>")});else $this.showNoResults()}if(type==="news"){if(typeof response.responseData!=="undefined"&&response.responseData.results.length>0)$.each(response.responseData.results,function(key,val){date=new Date(val["publishedDate"]);date=$this.formatDate(date);domainName='<a href="'+val["unescapedUrl"]+'" target="_blank">'+$.sq_getDomain(val["unescapedUrl"])+"</a>";items.push('<li class="sq_search_blog_li sq_search_li" id="b_'+key+'" href="'+val["unescapedUrl"]+'" header="'+val["titleNoFormatting"]+'"><div class="sq_news_content"><div class="sq_news_title">'+val["titleNoFormatting"]+'</div><div class="sq_news_text">'+val["content"]+'</div><div class="sq_info"><ul><li>'+$.sq_config.__date+": "+date+"</li><li>source: "+domainName+'</li></ul></div></div><div class="sq_attribution"><ul><li class="sq_read">'+$.sq_config.__readit+'</li><li class="sq_insert">'+$.sq_config.__insertasbox+'</li><li class="sq_reference">'+$.sq_config.__reference+"</li></ul></div></li>")});else $this.showNoResults()}if(type==="blog"){if(typeof response!=="undefined"&&typeof response.data.results!=="undefined"&&response.data.results.length>0)$.each(response.data.results,function(key,val){domainName='<a href="'+val["url"]+'" target="_blank">'+val["visibleUrl"]+"</a>";items.push('<li class="sq_search_blog_li sq_search_li" id="b_'+key+'" href="'+val["url"]+'" header="'+val["titleNoFormatting"]+'" ><div class="sq_news_content"><div class="sq_news_title">'+val["titleNoFormatting"]+'</div><div class="sq_news_text">'+val["content"]+'</div><div class="sq_info"><ul><li>source: '+domainName+'</li></ul></div></div><div class="sq_attribution"><ul><li class="sq_read">'+$.sq_config.__readit+'</li><li class="sq_insert">'+$.sq_config.__insertasbox+'</li><li class="sq_reference">'+$.sq_config.__reference+"</li></ul></div></li>")});else $this.showNoResults()}if(type==="wiki"){var wikihref="//"+$.sq_config.language.substr(0,2)+".wikipedia.org/wiki/";if(typeof response.query!=="undefined"&&response.query.search.length>0)$.each(response.query.search,function(key,val){date=new Date(val.timestamp);date=$this.formatDate(date);if($("#w_"+key).length==0)items.push('<li class="sq_search_wiki_li sq_search_li" id="w_'+key+'" href="'+wikihref+val.title.replace(/ /g,"_")+'" ><div class="sq_wiki_content"><div class="sq_wiki_title">'+val.title+'</div><div class="sq_wiki_text truncated">'+val.snippet+'</div><div class="sq_info"><ul><li>'+$.sq_config.__date+": "+date+'</li></ul></div><div class="sq_attribution"><ul><li class="sq_read">'+$.sq_config.__readit+'</li><li class="sq_insert">'+$.sq_config.__insertit+"</li></ul></div></li>")});else $this.showNoResults()}if(type==="local"){if(typeof response.results!=="undefined"&&response.results.length>0)$.each(response.results,function(key,val){date=new Date(val.date);date=$this.formatDate(date);items.push('<li class="sq_search_local_li sq_search_li" id="l_'+val["id"]+'" href="'+val["url"]+'" header="'+val["title"]+'" ><div class="sq_local_content"><div class="sq_local_title">'+val["title"]+'</div><div class="sq_local_text truncated">'+val["content"]+'</div><div class="sq_info"><ul><li>'+$.sq_config.__date+": "+date+'</li></ul></div><div class="sq_attribution"><ul><li class="sq_insert">'+$.sq_config.__insertit+'</li><li class="sq_reference">'+$.sq_config.__reference+'</li><li class="sq_link">'+$.sq_config.__addlink+"</li></ul></div></li>")});else $this.showNoResults()}if(items.length>0){if(start===0){$.sq_fields.sq_search.append($("<ul/>",{html:items.join("")}));$this.addHeaderSearch(keyword)}else{$.sq_fields.sq_search.find("ul").first().append(items.join(""))}$this.addEvents("click",type,start)}else{if(start===0){$this.showNoResults(1,keyword)}else{$this.showNoResults(0)}}if($.sq_fields.sq_more.length>0){$.sq_fields.sq_more.html("<span />");$.sq_fields.sq_more.sq_doneloading();$.sq_fields.sq_more.on("click");if(items.length<$.sq_config.nrb)$.sq_fields.sq_more.hide()}$this.find(".sq_search li.sq_search_li .sq_attribution > ul").show()};$this.addEvents=function(event,type,start){if(type==="img"){$this.find("li.sq_search_img_li img").off(event).on(event,function(){if($.sq_isGutenberg()){var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(wp.blocks.createBlock("core/image",{url:$(this).parent("li").attr("src"),className:"sq_image",alt:$.sq_config.keyword.replace(/\"/g,"")}),undefined);$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packimg($(this).attr("id"),$(this).parent("li").attr("src"),$(this).parent("li")));if(typeof $(this).parent("li").attr("attribute")!=="undefined"&&typeof $.sq_config.__sq_photo_copyright!=="")$.sq_editor.insert($.sq_config.__sq_photo_copyright.replace("%s",$(this).parent("li").attr("attribute")))}});$this.find("li.sq_search_img_li img").on("dragstart",function(event){if($.sq_config.editor_type==="html"){event.originalEvent.dataTransfer.setData("text/plain",$(this).parent("li").html())}});$.sq_fields.sq_search_img_filter.show()}if(type==="twitter"){$this.find("li.sq_search_twitter_li .sq_insert").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packtweet($(this).parents("li:last"))});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packtweet($(this).parents("li:last")))}})}if(type==="wiki"){$this.find("li.sq_search_wiki_li .sq_insert").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packwiki($(this).parents("li:last"))});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packwiki($(this).parents("li:last")))}});$this.find(".sq_read").off(event).on(event,function(){$("body").after($.sq_fields.sq_blog_preview);$.sq_fields.sq_blog_preview.sq_loading();$.sq_fields.sq_blog_preview.find("#sq_blog_preview_title").html("&nbsp;");$.sq_fields.sq_blog_preview.find("#sq_blog_preview_body").html("");$.sq_fields.sq_blog_preview.find("#sq_blog_preview_close").off(event).on(event,function(){$.sq_fields.sq_blog_preview.remove()});$this.previewBlog($(this).parents("li:last"),false)})}if(type==="news"||type==="blog"){$this.find("li.sq_search_blog_li .sq_insert").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packblog($(this).parents("li:last"),"box")});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packblog($(this).parents("li:last"),"box"))}});$this.find("li.sq_search_blog_li .sq_reference").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packblog($(this).parents("li:last"),"reference")});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packblog($(this).parents("li:last"),"reference"))}});$this.find(".sq_read").off(event).on(event,function(){$("body").after($.sq_fields.sq_blog_preview);$.sq_fields.sq_blog_preview.sq_loading();$.sq_fields.sq_blog_preview.find("#sq_blog_preview_title").html("&nbsp;");$.sq_fields.sq_blog_preview.find("#sq_blog_preview_body").html("");$.sq_fields.sq_blog_preview.find("#sq_blog_preview_close").off(event).on(event,function(){$.sq_fields.sq_blog_preview.remove()});$this.previewBlog($(this).parents("li:last"),true)})}if(type==="local"){$this.find("li.sq_search_local_li .sq_insert").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packlocal($(this).parents("li:last"),"box")});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packlocal($(this).parents("li:last"),"box"))}});this.find("li.sq_search_local_li .sq_reference").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packlocal($(this).parents("li:last"),"reference")});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packlocal($(this).parents("li:last"),"reference"))}});this.find("li.sq_search_local_li .sq_link").off(event).on(event,function(){if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:$this.packlocal($(this).parents("li:last"),"link")});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click");$.sq_blockseo.callback()}else{$.sq_editor.insert($this.packlocal($(this).parents("li:last"),"link"))}})}if(start===0){$.sq_fields.sq_search.append('<div class="sq_more"><span /></div>');$.sq_fields.sq_more=$this.find(".sq_more")}$.sq_fields.sq_more.off("click").on("click",function(){$(this).html("");$(this).sq_loading();$(this).off("click");$this.getSearch(type,start+$.sq_config.nrb)})};$this.pack=function(html){return'<div class="sq_box">'+html+"<div>"};$this.packimg=function(id,src,parent){if(id!==""){var content='<img src="'+src+'" id="img'+Math.floor(Math.random()*1e3)+'" class="aligncenter size-medium sq_image" width="'+(parent.attr("width")>500?"500":parent.attr("width"))+'" alt="'+$.sq_config.keyword.replace(/\"/g,"")+'" title="'+$.sq_config.keyword.replace(/\"/g,"")+'" />';return content}return""};$this.packtweet=function(parent){var content="";content='<div class="sq_quote_content" style="position: relative;clear: both;background: white;font-size: 14px;color: #333;max-width: 500px;margin: 5px auto 5px auto;padding: 13px;border: 1px solid #DDD;-webkit-box-shadow: 0 1px 0 #DDD;-moz-box-shadow: 0 1px 0 #ddd;box-shadow: 0 1px 0 #DDD;">';content=content+'<a id="'+parent.attr("id")+'" class="sq_tweet" href="'+parent.attr("href")+'" title="'+parent.find(".sq_author_avatar").attr("alt")+'" style="display: block;float: left;width: 48px;height: 48px;padding: 1px;margin: 0;border: 1px solid #DDD;" ><img class="sq_author_avatar" src="'+parent.find(".sq_author_avatar").attr("src")+'" alt="'+parent.find(".sq_author_avatar").attr("alt")+'" /></a>';content=content+'<div class="sq_quote_text" style="margin-left: 62px;line-height: 1.5em;padding-left: 21px;min-height: 52px;font-style:italic;">'+parent.find(".sq_quote_text").html()+"</div>";content=content+"</div>";return'<div id="tw'+Math.floor(Math.random()*1e3)+'" >'+content+"</div>"+$.sq_config.after_insert};$this.packwiki=function(parent){var content="";content='<div class="sq_wiki_content" style="position: relative;clear: both;background: white;font-size: 14px;color: #333;max-width: 500px;margin: 5px auto 5px auto;padding: 13px;border: 1px solid #DDD;-webkit-box-shadow: 0 1px 0 #DDD;-moz-box-shadow: 0 1px 0 #ddd;box-shadow: 0 1px 0 #DDD;">';content=content+'<a id="'+parent.attr("id")+'" class="sq_wiki" href="'+parent.attr("href")+'" title="'+parent.find(".sq_wiki_title").html()+'" style="display: block;font-weight: 700;color: #0074B7;line-height: 1.4em;margin-bottom: 5px;text-decoration: none;">'+parent.find(".sq_wiki_title").html()+"</a>";content=content+'<div class="sq_wiki_text" style="font-style:italic;color: #333;">'+parent.find(".sq_wiki_text").html()+"</div>";content=content+"</div>";return'<div id="wi'+Math.floor(Math.random()*1e3)+'">'+content+"</div>"+$.sq_config.after_insert};$this.packblog=function(parent,as){var content="";if(as==="box"){content='<div class="sq_blog_content" style="position: relative;clear: both;background: white;font-size: 14px;color: #333;max-width: 500px;margin: 5px auto 5px auto;padding: 13px;border: 1px solid #DDD;-webkit-box-shadow: 0 1px 0 #DDD;-moz-box-shadow: 0 1px 0 #ddd;box-shadow: 0 1px 0 #DDD;">';content=content+'<a id="'+parent.attr("id")+'" class="sq_news" href="'+parent.attr("href")+'" title="'+parent.find(".sq_news_title").html()+'" >'+parent.find(".sq_news_title").html()+"</a>";content=content+'<div class="sq_news_text" style="font-style:italic;color: #333;">'+parent.find(".sq_news_text").html()+"</div>";content=content+"</div>"}if(as==="reference"){content='<a class="sq_news" href="'+parent.attr("href")+'" rel="nofollow" title="'+parent.attr("header")+'" style="font-style:italic;color: #333;">'+$.sq_getDomain(parent.attr("href"),[1,7,8,10])+"</a>"}return'<div id="bl'+Math.floor(Math.random()*1e3)+'">'+content+"</div>"+$.sq_config.after_insert};$this.packlocal=function(parent,as){var content="";if(as==="box"){content='<div class="sq_local_content" style="position: relative;clear: both;background: white;font-size: 14px;color: #333;max-width: 500px;margin: 5px auto 5px auto;padding: 13px;border: 1px solid #DDD;-webkit-box-shadow: 0 1px 0 #DDD;-moz-box-shadow: 0 1px 0 #ddd;box-shadow: 0 1px 0 #DDD;">';content=content+'<a id="'+parent.attr("id")+'" class="sq_local" href="'+parent.attr("href")+'" title="'+parent.find(".sq_local_title").html()+'" style="display: block;font-weight: 700;color: #0074B7;line-height: 1.4em;margin-bottom: 5px;text-decoration: none;">'+parent.find(".sq_local_title").html()+"</a>";content=content+'<div class="sq_local_text" style="font-style:italic;color: #333;">'+parent.find(".sq_local_text").html()+"</div>";content=content+"</div>";content='<div id="lo'+Math.floor(Math.random()*1e3)+'">'+content+"</div>"+$.sq_config.after_insert}if(as==="reference"){content='<a class="sq_local" href="'+parent.attr("href")+'" title="'+parent.attr("header")+'" >'+decodeURIComponent(parent.attr("href"))+"</a>";content='<div id="lo'+Math.floor(Math.random()*1e3)+'" style="font-style:italic;color: #333;">'+content+"</div>"+$.sq_config.after_insert}if(as==="link"){content='<a href="'+parent.attr("href")+'" title="'+parent.attr("header")+'" style="font-style:italic;color: #333;">'+decodeURIComponent(parent.attr("href"))+"</a>"}return content};$this.formatDate=function(date){var mm=date.getMonth()+1;var dd=date.getDate();var yyyy=date.getFullYear();mm=mm<10?"0"+mm:mm;return mm+"."+dd+"."+yyyy};$this.showTypeHelp=function(type){$this.find(".sq_type_help").hide();$this.find(".sq_type_"+type+"_help").show()};$this.refreshSearch=function(type){settings.type=type;$this.getSearch(type,0)};$this.previewBlog=function(parent,filter){if($.sq_fields.sq_blog_preview===null)return;$.getJSON($.sq_config.sq_apiurl+"api/research/ib/preview?callback=?"+(filter?"&filter=1":"")+"",{user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token,link:parent.attr("href")}).done(function(response){if(response.data.content!==""){$.sq_fields.sq_blog_preview.removeClass("sq_error").sq_doneloading();$.sq_fields.sq_blog_preview.attr("href",response.link);$.sq_fields.sq_blog_preview.find("#sq_blog_preview_title").html(response.data.title);$.sq_fields.sq_blog_preview.find("#sq_blog_preview_body").html(response.data.content);$.sq_fields.sq_blog_preview.find("#sq_blog_preview_body p").each(function(){$(this).removeClass()});var ptext;$.sq_fields.sq_blog_preview.find(".sq_blog_option").off("click").on("click",function(){ptext=$(this).parent("p").clone();ptext=ptext.find(".sq_blog_option").remove();ptext=ptext.end().html();if($.sq_isGutenberg()){var sq_block=wp.blocks.createBlock("core/html",{content:ptext+$this.packblog($.sq_fields.sq_blog_preview,"reference")});var ed=$.sq_editor.getBlockEditor("dispatch");if(ed)ed.insertBlock(sq_block,undefined);$("#block-"+sq_block.clientId).find(".editor-block-toolbar").find("button").trigger("click")}else{$.sq_editor.insert(ptext+$this.packblog($.sq_fields.sq_blog_preview,"reference"))}});$.sq_fields.sq_blog_preview.find("#sq_blog_preview_body a").each(function(){$(this).attr("target","_blank")});$.sq_fields.sq_blog_preview.find(".editsection").hide()}else{$.sq_fields.sq_blog_preview.remove()}$.sq_fields.sq_blog_preview.find("#sq_blog_preview_close").off(event).on(event,function(){$.sq_fields.sq_blog_preview.remove()})}).fail(function(){$.sq_fields.sq_blog_preview.remove()})};$this.showNotOptimized=function(){$("#sq_nokeyword").show()};$this.hideNotOptimized=function(){$("#sq_publish_alert").hide()};$this.handleKey=function(event,gsuggestion_index){if(event.keyCode===$.ui.keyCode.UP&&gsuggestion_index>0){gsuggestion_index--}else if(event.keyCode===$.ui.keyCode.DOWN&&gsuggestion_index<$(".sq_gsuggestion .sq_item_gsuggestion").length){gsuggestion_index++}else{gsuggestion_index=0}$(".sq_gsuggestion .sq_item_gsuggestion").removeClass("sq_item_active");if(gsuggestion_index>0){var item_active=$(".sq_gsuggestion .sq_item_gsuggestion:nth-child("+gsuggestion_index+")");item_active.addClass("sq_item_active");$.sq_fields.sq_keyword.val(item_active.html())}return gsuggestion_index};$this.hideOptions=function(){if(settings.timeout){clearTimeout(settings.timeout);clearTimeout(settings.calltime)}if(settings.gtimeout){clearTimeout(settings.gtimeout)}if(settings.ajaxCall)settings.ajaxCall.abort()};$this.prepareParam=function(response,keyword){var j;var param={rank:-1,note:-1,stats:[]};if($.sq_isArray(response)){var responselen=response.length;for(j=0;j<responselen;j++){if($.sq_strEqual(keyword,response[j].keyword)){param.rank=response[j].stats.rank.value;param.note=response[j].note;param.stats=[response[j].stats.tw,response[j].stats.sv,response[j].stats.sc,response[j].stats.td];break}}}return param};$this.addTag=function(){if($.sq_config.sq_keywordtag==1){$("#new-tag-post_tag").val($.sq_config.keyword);$("input.tagadd").trigger("click")}};$this.sq_eventssearch={checkKeywordSet:function(){if($.sq_fields.sq_keyword.val()!==""){$.sq_config.keyword=$.sq_fields.sq_keyword.val();$.sq_fields.sq_selectit.trigger("click");$.sq_fields.sq_keyword_score.html("0%");$(".sq_keyword").show();if($.sq_config.firsttime){$.sq_fields.sq_box_maximize.trigger("click")}}if($.sq_config.keyword===""&&$(".sq_snippet_keywords").length>0){var snipet_keywords=$(".sq_snippet_keywords").text().split(",");if(snipet_keywords.length>0){$.sq_config.keyword=snipet_keywords[0];$.sq_fields.sq_keyword.val($.sq_config.keyword);$.sq_fields.sq_selectit.trigger("click")}}if($.sq_config.keyword===""){$this.hideTypes();$.sq_blockseo.overlay();$this.hideOptions();$this.showNotOptimized()}$this.initialFieldValue($.sq_fields.sq_keyword,"black","gray");$.sq_fields.div_blockseo.trigger("seo.keyword_loaded")},listen:function(){$.getJSON($.sq_config.sq_apiurl+"api/posts/keyword?callback=?",{post_id:$.sq_config.postID,user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token}).done(function(response){if(typeof $.sq_fields.sq_keyword==="undefined"){$.sq_setfields()}if(typeof response.data!=="undefined"){if(typeof response.data.keyword!=="undefined"){if(response.data.keyword===null){$.sq_config.firsttime=true;$this.sq_eventssearch.checkKeywordSet()}else{$.sq_config.firsttime=false;if($.sq_fields.sq_keyword.val()===""){$.sq_fields.sq_keyword.val(decodeURIComponent(response.data.keyword))}$this.sq_eventssearch.checkKeywordSet()}}}$.sq_fields.sq_preloading_keyword.hide();$.sq_fields.sq_blocktabs.show();$.sq_fields.div_blockbriefacse.show();$this.trigger("seo.keyword_loaded")}).fail(function(error){$.sq_fields.sq_preloading.show()});$.sq_fields.sq_keyword.on("keypress",function(event){if(event.keyCode===$.ui.keyCode.ENTER){$.sq_fields.sq_keyword_check.trigger("click")}return event.keyCode!==$.ui.keyCode.ENTER});$.sq_fields.sq_keyword.on("keyup",function(event){if(event.keyCode!==$.ui.keyCode.ENTER&&event.keyCode!==$.ui.keyCode.UP&&event.keyCode!==$.ui.keyCode.DOWN&&event.keyCode!==$.ui.keyCode.ESCAPE){if($.sq_fields.sq_keyword.val()!==""&&$.sq_config.keyword!==$.sq_clearText($.sq_fields.sq_keyword.val())){if($.sq_fields.sq_keyword.val()!==""){$.sq_config.keyword=$.sq_fields.sq_keyword.val();$.sq_blockseo.checkKeyword();$this.init()}else{$this.hideOptions()}$.sq_blockseo.overlay();$this.hideSearch()}}else if(event.keyCode===$.ui.keyCode.ESCAPE){if($.sq_fields.sq_keyword.val()!==""){$this.hideOptions()}}});$.sq_fields.sq_keyword.on("click",function(){if($.sq_fields.sq_keyword.val()===""){$this.hideOptions()}});$.sq_fields.sq_keyword_check.off("click").on("click",function(){if($.sq_fields.sq_keyword.val()!==""){$.sq_fields.sq_selectit.trigger("click")}});$.sq_fields.sq_selectit.off("click").on("click",function(){$.sq_config.manual=true;$("#sq_keyword_second").val("");if($.sq_fields.sq_keyword.val()!==""){$.sq_config.keyword=$.sq_fields.sq_keyword.val()}if($.sq_config.keyword!==""){if($("#sq_blocksnippet").find("input[name=sq_keyword]").length){$("#sq_blocksnippet").find("input[name=sq_keyword]").val($.sq_config.keyword)}$this.showTypes();$.sq_blockseo.load();$.sq_blockseo.closeOverlay();$this.trigger("seo.keyword_selected");$(".sq_request_highlight_key").html($.sq_config.keyword);$.sq_fields.sq_type_img.trigger("click");$this.hideNotOptimized()}if($.sq_fields.wp_content_wrap.length>0){if($.sq_fields.wp_content_wrap.attr("class").indexOf("html-active")==-1){$this.showActiveEditor()}}});$.sq_fields.sq_type_img.off("click").on("click",function(){$.sq_fields.sq_types.find("li").removeClass("sq_active");$(this).addClass("sq_active");$this.showTypeHelp("img");$this.refreshSearch("img")});$.sq_fields.sq_type_twitter.off("click").on("click",function(){$.sq_fields.sq_types.find("li").removeClass("sq_active");$(this).addClass("sq_active");$this.showTypeHelp("twitter");$this.refreshSearch("twitter")});$.sq_fields.sq_type_news.off("click").on("click",function(){$.sq_fields.sq_types.find("li").removeClass("sq_active");$(this).addClass("sq_active");$this.showTypeHelp("twitter");$this.refreshSearch("news")});$.sq_fields.sq_type_blog.off("click").on("click",function(){$.sq_fields.sq_types.find("li").removeClass("sq_active");$(this).addClass("sq_active");$this.showTypeHelp("blog");$this.refreshSearch("blog")});$.sq_fields.sq_type_wiki.off("click").on("click",function(){$.sq_fields.sq_types.find("li").removeClass("sq_active");$(this).addClass("sq_active");$this.showTypeHelp("wiki");$this.refreshSearch("wiki")});$.sq_fields.sq_type_local.off("click").on("click",function(){$.sq_fields.sq_types.find("li").removeClass("sq_active");$(this).addClass("sq_active");$this.showTypeHelp("local");$this.refreshSearch("local")});$.sq_fields.sq_search_img_nolicence.off("click").on("click",function(){var licence=1;if($.sq_fields.sq_search_img_nolicence.is(":checked")){$("#sq_search_img_nolicence_label").attr("class","checked");licence=1}else{$("#sq_search_img_nolicence_label").removeClass("checked");licence=0}$this.refreshSearch("img");$.post(sqQuery.ajaxurl,{action:"sq_ajax_type_click",licence:licence,sq_nonce:sqQuery.nonce})});$(".wp-switch-editor").on("click",function(){if(this.id.indexOf("tmce")!==-1){$this.sq_eventssearch.listenMCE()}else{$this.sq_eventssearch.listenHTML()}});$("#qt_content_fullscreen, .mce-i-wp_fullscreen").on("click",function(){$(".mce-btn").find("i").on("click",function(){$this.sq_eventssearch.listenMCE()});$(".wp-fullscreen-mode-tinymce").on("click",function(){$this.sq_eventssearch.listenMCE();$(".media-modal").find("a").on("click",function(){$this.sq_eventssearch.listenMCE()})});$(".wp-fullscreen-mode-html").on("click",function(){$this.sq_eventssearch.listenHTML();$(".media-modal").find("a").on("click",function(){$this.sq_eventssearch.listenHTML()})})});$("#wp-fullscreen-close, .mce-i-bold, .media-button").find("a").on("click",function(){if($.sq_fields.wp_content_wrap.length>0&&$.sq_fields.wp_content_wrap.attr("class").indexOf("html-active")!==-1){$.sq_blockseo.sq_eventsseo.listenHtml()}else{$.sq_blockseo.sq_eventsseo.listenTinymce()}})},listenMCE:function(){$this.showActiveEditor();$.sq_blockseo.sq_eventsseo.stopListenHtml();$.sq_blockseo.sq_eventsseo.listenTinymce();$.sq_fields.sq_selectit.trigger("click")},listenHTML:function(){$.sq_blockseo.sq_eventsseo.stopListenTinymce();$.sq_blockseo.sq_eventsseo.listenHtml();$.sq_fields.sq_selectit.trigger("click")}};$this.one("seo.loaded",function(){SQ_DEBUG&&console.log("sq_blocksearch seo.loaded");$this.sq_eventssearch.listen()});return $this}})(jQuery);
view/assets/js/assistant/sq_blockseo.min.js CHANGED
@@ -1 +1 @@
1
- (function($){"use strict";$.fn.sq_blockseo=function(options){var $this=this;var settings=$.extend({check:[],single_tag:[],double_tag:[],custom_tag:[],custom_tag_id:[],clicked:[]},options);$.sq_fields=$.extend({sq_wp_title_info:$('<span id="sq_wp_title_info" style="display: block; float: right;" />')},$.sq_fields);var seo={title:"",content:""};$this.setContent=function(content){seo.content=content};$this.callback=function(){$.sq_config.manual=true;$.sq_config.silent=false;$.sq_config.briefcase=false;if(typeof $.sq_config.keyword==="undefined"||$.sq_config.keyword==="")return;if($.sq_config.editor_type==="tinymce"){if($.sq_isGutenberg()){ed=$.sq_editor.getBlockEditor("select");if(ed)seo.content=ed.getEditedPostContent()}else if($.sq_config.active_editor&&typeof $.sq_config.active_editor.html=="function"){seo.content=$.sq_config.active_editor.html()}else{ed=$.sq_editor.getIframeEditor();seo.content=ed.html()}}else{if($.sq_isGutenberg()){var ed=$.sq_editor.getBlockEditor("select");if(ed)seo.content=ed.getEditedPostContent()}else if($.sq_isFrontend()){var ed=$.sq_editor.getFrontendEditor();if(ed)seo.content=ed.getPageContent()}else if($.sq_config.active_editor&&typeof $.sq_config.active_editor.val=="function"){seo.content=$.sq_fields.wp_content.val()}else if($.sq_fields.wp_content.length){seo.content=$.sq_fields.wp_content.val()}}$this.trigger("seo.content");$this.checkSEO();$this.trigger("seo.callback")};$this.checkSEO=function(){if(typeof seo.content!=="undefined"&&$.sq_clearText(seo.content)!==""){SQ_DEBUG&&console.log("check keywords in body and tags");$this.checkBody();$this.checkSingleTags();$this.checkCustomTags();$this.checkKPinguinUrl();$this.checkKeyword();if($.sq_fields.wp_thumbnail.length>0){$this.sq_eventsseo.listenMediaLibrary()}else if($("#postimagediv").length>0){$this.checkImage($("#postimagediv"))}else if($.sq_isFrontend()){var ed=$.sq_editor.getFrontendEditor();if(ed){$.sq_blockseo.checkImage($("<div>"+ed.getPageImages()+"</div>"))}}if($(".editor-post-featured-image").length>0){$this.checkImage($(".editor-post-featured-image"))}if($("#visual_composer_content").length>0){$this.sq_eventsseo.listenVComposer()}if($("#fusion_builder_container").length>0){$this.sq_eventsseo.listenFusion()}}if(typeof seo.content!=="undefined"&&($.sq_clearText(seo.content).length>1||$.sq_fields.wp_input_title.length>0&&$.sq_clearText($.sq_fields.wp_input_title.val()).length>1)){if(settings.check.indexOf("~density~")!==-1){$this.keywordDensity($.sq_fields.wp_input_title.val()+" "+seo.content,$.sq_params.low_density,$.sq_params.high_density,"density")}}};$this.checkWpFields=function(){if(typeof $.sq_config.keyword==="undefined"||$.sq_config.keyword==="")return;SQ_DEBUG&&console.log("=====TITLE=====");SQ_DEBUG&&console.log($.sq_fields.wp_input_title);if($.sq_fields.wp_input_title.length){if($.sq_clearText($.sq_fields.wp_input_title.val()).length>1){SQ_DEBUG&&console.log("check keywords in title: "+$.sq_fields.wp_input_title.val());$this.checkPinguin();$this.checkTitle();if(settings.check.indexOf("~density_title~")!==-1){var id="density_title";if($this.checkWordsLength($.sq_config.keyword,1,100)){if($.sq_fields.wp_input_title.val()===$.sq_config.keyword){$this.setChecked(true,id)}else{$this.keywordDensity($.sq_fields.wp_input_title.val(),$.sq_params.low_density_title,$.sq_params.high_density_title,"density_title")}}else{$("#sq_"+id+"_val").html($("#sq_"+id+"_longtail").html());$this.setChecked(false,id)}}if(settings.check.indexOf("~density~")!==-1)$this.keywordDensity($.sq_fields.wp_input_title.val()+" "+seo.content,$.sq_params.low_density,$.sq_params.high_density,"density")}}SQ_DEBUG&&console.log("=====END TITLE=====");return $this.getPercentCompleted()};$this.load=function(){$.sq_fields.div_blockseo.find(".sq_tasks > ul > li").not(".sq_tasks_category").removeClass("checked");if($.sq_config.timeout_seo){clearTimeout($.sq_config.timeout_seo)}$.sq_config.timeout_seo=setTimeout(function(){$this.checkWpFields();$this.callback()},100)};$this.close=function(){$.sq_fields.div_blockseo.hide()};$this.overlay=function(){if($(".sq_overlay").length==0){$.sq_fields.div_blockseo.prepend('<div class="sq_overlay" data-title="'+$.sq_config.__enter_keyword+'" title="'+$.sq_config.__enter_keyword+'"></div>');$(".sq_overlay").on("click",function(){if($.sq_fields.sq_keyword.val()===""){var previewtop=$.sq_fields.sq_keyword.offset().top-100;if($(".edit-post-layout__content").length>0){$(".edit-post-layout__content").animate({scrollTop:$(".edit-post-layout__content").scrollTop()+previewtop},1e3,function(){$.sq_fields.sq_keyword.focus();$.sq_blocksearch.showEnterKeyword()})}else{$("html,body").animate({scrollTop:previewtop},1e3,function(){$.sq_fields.sq_keyword.focus();$.sq_blocksearch.showEnterKeyword()})}}else{$.sq_fields.sq_selectit.trigger("click")}})}};$this.closeOverlay=function(){$(".sq_overlay").remove()};$this.checkKPinguinUrl=function(){if($("#custom_permalinks_home_url").length>0&&$("#custom_permalink").length>0){if(settings.check.indexOf("~pinguin_url~")!==-1&&$.sq_config.keyword!==""){var slug=$("#custom_permalinks_home_url").val()+" "+$("#custom_permalink").val();$this.setChecked($this.urlMatch(slug,$.sq_config.keyword),"pinguin_url")}}else if($("#editable-post-name-full").length>0){if(settings.check.indexOf("~pinguin_url~")!==-1&&$.sq_config.keyword!==""){var root="";if($("#sample-permalink").length>0){var sample_permalink=$("#sample-permalink").find("a").clone();sample_permalink.find("span").remove();root=sample_permalink.text()}var slug=root+" "+$("#editable-post-name-full").html();$this.setChecked($this.urlMatch(slug,$.sq_config.keyword),"pinguin_url")}}else if($("#new-post-slug").length>0){if(settings.check.indexOf("~pinguin_url~")!==-1&&$.sq_config.keyword!==""){var slug=$("#new-post-slug").val();$this.setChecked($this.urlMatch(slug,$.sq_config.keyword),"pinguin_url")}}else if($("#sample-permalink").length>0){if(settings.check.indexOf("~pinguin_url~")!==-1&&$.sq_config.keyword!==""){var slug=$("#sample-permalink").html().replace(/<\/?[^>]+>/gi," ");$this.setChecked($this.urlMatch(slug,$.sq_config.keyword),"pinguin_url")}}else if($.sq_isGutenberg()){var ed=$.sq_editor.getBlockEditor("select");if(ed){var slug=decodeURIComponent(ed.getPermalink()).replace(/<\/?[^>]+>/gi," ");$this.setChecked($this.urlMatch(slug,$.sq_config.keyword),"pinguin_url")}}};$this.checkKeyword=function(){if(settings.check.indexOf("~longtail_keyword~")!==-1&&$.sq_config.keyword!==""){$this.setChecked($this.checkWordsLength($.sq_config.keyword,2,0),"longtail_keyword")}};$this.checkKPinguin=function(){if(settings.check.indexOf("~pinguin_domain~")!==-1&&$.sq_config.keyword!==""){$this.setChecked(!$this.keywordMatch($.sq_getDomain(document.domain,[8]),$.sq_config.keyword,true),"pinguin_domain")}};$this.checkPinguin=function(){if(settings.check.indexOf("~pinguin_title~")!==-1){var domain=$.sq_getDomain(document.domain,[8])!==""?$.sq_getDomain(document.domain,[8]):document.domain;$this.setChecked(!$this.keywordMatch($.sq_fields.wp_input_title.val(),domain,true),"pinguin_title")}};$this.checkTitle=function(){if($.sq_fields.wp_input_title.length>0){if(settings.check.indexOf("~title_length~")!==-1)$this.setChecked($this.checkLength($.sq_fields.wp_input_title.val(),$.sq_params.min_length_title,$.sq_params.max_length_title),"title_length");if(settings.check.indexOf("~title~")!==-1)$this.setChecked($this.keywordMatch($.sq_fields.wp_input_title.val(),$.sq_config.keyword),"title")}};$this.checkImage=function(_this){$.sq_config.silent=true;var pattern=null;pattern=new RegExp("<img([^>]*)>","gi");if(_this.html()!==""&&$this.checkPattern(pattern)){$this.setChecked(true,"img",true)}else if(_this.html()!==""){SQ_DEBUG&&console.log("Check image in object");if($this.checkPattern(pattern,_this.html())){$this.setChecked($this.checkPattern(pattern,_this.html()).length>0,"img",true)}else{pattern=new RegExp("\\[gallery[^\\]]*ids=[^\\]]*\\]","gi");if($this.checkPattern(pattern)){$this.setChecked($this.checkPattern(pattern).length>0,"img")}else{$this.setChecked(0,"img")}}}pattern=new RegExp('alt="([^"]+)"',"gi");if(!$this.keywordMatch($this.checkPattern(pattern),$.sq_config.keyword)){SQ_DEBUG&&console.log("There is no alt image in content");$this.setChecked($this.keywordMatch($this.checkPattern(pattern,_this.html()),$.sq_config.keyword),"alt")}};$this.handleKey=function(event,gsuggestion_index){if(event.keyCode===$.ui.keyCode.UP&&gsuggestion_index>0){gsuggestion_index--}else if(event.keyCode===$.ui.keyCode.DOWN&&gsuggestion_index<$("#sq_wp_title_suggestion .sq_item_gsuggestion").length){gsuggestion_index++}else{gsuggestion_index=0}$("#sq_wp_title_suggestion .sq_item_gsuggestion").removeClass("sq_item_active");if(gsuggestion_index>0){var item_active=$("#sq_wp_title_suggestion .sq_item_gsuggestion:nth-child("+gsuggestion_index+")");item_active.addClass("sq_item_active");$.sq_fields.wp_input_title.val(item_active.html());$this.checkTitle()}return gsuggestion_index};$this.hideOptions=function(){$("#sq_wp_title_suggestion").remove();$this.checkTitle()};$this.checkBody=function(){var $str=$("<div></div>").html(seo.content);$str.find("form").remove();$.sq_highlight($str,$.sq_config.keyword,{counter:0,done:function(count,positions){SQ_DEBUG&&console.log($str.text(),$.sq_config.keyword,count,positions);$this.processBody($str.text(),count,positions)}})};$this.processBody=function(cleanContent,count,positions){var checked=false,id=false,words=[],density,i=0;if($.sq_config.editor_type==="tinymce"){var iframe_tinymce=$.sq_editor.getIframeEditor()}if(settings.check.indexOf("~first_sentence~")!==-1){if(count>1&&cleanContent.length>$.sq_params.beginning_length){$this.setChecked(positions[1]<$.sq_params.beginning_length,"first_sentence")}}if(settings.check.indexOf("~body_length~")!==-1){if($this.checkWordsLength(cleanContent,$.sq_params.min_length_body,$.sq_params.max_length_body)===false){$("#sq_request_body_length").remove();$("#sq_body_length").append(' <span id="sq_request_body_length">'+"("+$this.getWords2Min(cleanContent,$.sq_params.min_length_body)+" more)</span>")}else{$("#sq_request_body_length").remove()}$this.setChecked($this.checkWordsLength(cleanContent,$.sq_params.min_length_body,$.sq_params.max_length_body),"body_length")}if(settings.check.indexOf("~body~")!==-1){$this.setChecked(count>0,"body")}if(settings.check.indexOf("~over_density~")!==-1){checked=true;id="over_density";if($this.checkWordsLength(cleanContent,$.sq_params.min_length_body,$.sq_params.max_length_body)===false){$.sq_fields.div_blockseo.find("#sq_request_"+id+"").remove();$.sq_fields.div_blockseo.find("#sq_"+id+"").append('<span id="sq_request_'+id+'">: '+"("+$.sq_config.__addminimumwords.replace(/%s/g,$this.getWords2Min(cleanContent,$.sq_params.min_length_body))+")</span>");checked=false;$.sq_fields.div_blockseo.find("#sq_"+id+"_val").parent("li").removeClass("sq_"+id+"_high")}else{$.sq_fields.div_blockseo.find("#sq_request_"+id+"").remove();$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html($.sq_fields.div_blockseo.find("#sq_"+id+"_done").html());words=$.sq_clearText($.sq_config.keyword).split(" ");density=$this.getDensity(cleanContent,$.sq_config.keyword);if(density.val>0){var ignore=["and","und","or","the","yet","for","also","then","like","too","but","i","you","he","she","we","they"];var wordslen=words.length;for(i=0;i<wordslen;i++){if(words[i].length>2&&ignore.indexOf(words[i])===-1){var word=words[i];density=$this.getDensity(cleanContent,word);if(density.val>=$.sq_params.max_word_density){var need=density.keywords-$.sq_params.max_word_density*density.words/100+1;need=Math.round(need)<=0?1:need.toFixed();$.sq_fields.div_blockseo.find("#sq_request_"+id+"").remove();$.sq_fields.div_blockseo.find("#sq_"+id+"").append('<span id="sq_request_'+id+'">: '+'<span id="sq_request_'+id+'_highlight" style="color:yellow; text-decoration:underline; cursor: pointer;">'+word+"</span> "+$.sq_config.__toomanytimes.replace(/%s/g,need)+' <span id="sq_request_synonyms_oo"></span></span>');$this.getSynonyms(word,"sq_request_synonyms_oo");settings.clicked[id]=false;$.sq_fields.div_blockseo.find("#sq_request_"+id+"_highlight").parents("li:last").on("click",function(e){e.stopPropagation();settings.clicked[id]=true;$("body").on("mouseup",function(){if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}else{$.sq_removeHighlight($.sq_getBuilderEditorContainer())}})}).on("mouseenter",function(e){e.stopPropagation();$(this).css("cursor","pointer");if($.sq_config.editor_type==="tinymce"){if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_highlight($.sq_getBuilderEditorContainer($(this)),word)})}}else{$.sq_highlight($.sq_getBuilderEditorContainer($(this)),word)}}).on("mouseleave",function(){if($.sq_config.editor_type==="tinymce"){if(!settings.clicked[id]){if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}}}else{$.sq_removeHighlight($.sq_getBuilderEditorContainer())}});$.sq_fields.div_blockseo.find("#sq_"+id+"_val").parent("li").attr("class","sq_"+id+"_high");$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html("");checked=false;break}}}}else{checked=false}$this.setChecked(checked,id)}}if(settings.check.indexOf("~human_friendly~")!==-1){checked=true;id="human_friendly";$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html("");if($this.checkWordsLength(cleanContent,$.sq_params.min_length_body,$.sq_params.max_length_body)===false){$.sq_fields.div_blockseo.find("#sq_request_"+id+"").remove();$.sq_fields.div_blockseo.find("#sq_"+id+"").append('<span id="sq_request_'+id+'">: '+"("+$.sq_config.__writemorewords.replace(/%s/g,$this.getWords2Min(cleanContent,$.sq_params.min_length_body))+")</span>");checked=false;$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html("")}else{$.sq_fields.div_blockseo.find("#sq_request_"+id+"").remove();if(count>=2){for(i=2;i<=count;i++){SQ_DEBUG&&console.log(positions[i]-positions[i-1],$.sq_params.begin_last_max_chars);if(positions[i]-positions[i-1]<$.sq_params.begin_last_max_chars){$.sq_fields.div_blockseo.find("#sq_request_"+id+"").remove();var ndt=i===2?"st":i===3?"nd":i===4?"rd":"th";$.sq_fields.div_blockseo.find("#sq_"+id+"").append('<span id="sq_request_'+id+'">: '+"("+$.sq_config.__morewordsafter.replace(/%s/g,'<span id="sq_request_'+id+'_highlight_key" style="color:lightcoral; text-decoration:underline; cursor: pointer;">'+(i-1)+ndt+"</span>")+' <span id="sq_request_synonyms"></span>)</span>');$this.getSynonyms($.sq_config.keyword,"sq_request_synonyms");settings.clicked[id]=false;$.sq_fields.div_blockseo.find("#sq_request_"+id+"_highlight_key").parents("li:last").off().on("click",function(e){e.stopPropagation();settings.clicked[id]=true;$("body").on("mouseup",function(){if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}else{$.sq_removeHighlight($.sq_getBuilderEditorContainer())}})}).on("mouseenter",function(e){e.stopPropagation();$(this).css("cursor","pointer");if($.sq_config.editor_type==="tinymce"){if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_highlight($.sq_getBuilderEditorContainer($(this)),$.sq_config.keyword)})}}else{$.sq_highlight($.sq_getBuilderEditorContainer($(this)),$.sq_config.keyword)}}).on("mouseleave",function(){if($.sq_config.editor_type==="tinymce"){if(!settings.clicked[id]){if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}}}else{$.sq_removeHighlight($.sq_getBuilderEditorContainer())}});checked=false;$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html("");break}}}}$this.setChecked(checked,id)}};$this.getSynonyms=function(word,span){var ignore=["and","und","or","the","yet","for","also","then","like","too","but","i","you","he","she","we","they"];var words=$.sq_stripChars(word).split(" ");$this.find("#"+span).html(" "+$.sq_config.__orusesynonyms);var wordslen=words.length;for(var w=0;w<wordslen;w++)if(words[w].length>2&&ignore.indexOf(words[w])===-1){$this.find("#"+span).append(" "+(w===0?"for":"or for")+' <span class="'+span+"_"+words[w]+" "+span+'" style="text-decoration:underline; cursor: pointer;" title="">'+words[w]+"</span>");var synonyms_all=$.sq_getCache("synonyms_"+words[w]);if(synonyms_all!==""){if(synonyms_all.length>0)$this.find("."+span+"_"+words[w]).attr("title",synonyms_all.join("\n"))}else{$.getJSON("https://thesaurus.altervista.org/thesaurus/v1?callback=?",{word:words[w],language:$.sq_config.language.replace("-","_"),key:"TDm3SO7N3XEfRWuXYFb9",output:"json"}).done(function(word){return function(data){var response=data.response;var synonyms=[];var synonyms_all=[];if(typeof response!=="undefined"&&response.length>0){var responselen=response.length;for(var j=0;j<responselen;j++){if(typeof response[j].list.synonyms!=="undefined"){synonyms=response[j].list.synonyms.split("|");var synonymslen=synonyms.length;for(var k=0;k<synonymslen;k++){if(typeof synonyms[k]!=="undefined"&&synonyms[k]!==""&&synonyms[k].indexOf("antonym")===-1){synonyms_all.push(synonyms[k]);if(synonyms_all.length>10)break}}}}if(synonyms_all.length>0){$this.find("."+span+"_"+word).attr("title",synonyms_all.join("\n"))}}$.sq_setCache("synonyms_"+word,synonyms_all)}}(words[w])).error(function(word){var synonyms_all=[];synonyms_all.push("no synonyms found");$this.find("."+span+"_"+word).attr("title",synonyms_all.join("\n"));$.sq_setCache("synonyms_"+word,synonyms_all)}(words[w]))}}};$this.checkTags=function(){var id;var striptag="[\\],\\[]";striptag=new RegExp(striptag,"g");for(var i in settings.double_tag){id="";try{if(typeof settings.double_tag[i]==="string"||settings.double_tag[i]instanceof String){id=settings.double_tag[i];id=id.replace(striptag,"");if(id!=="")$this.setChecked($this.keywordMatch($this.checkTag(["<"+settings.double_tag[i]+">","</"+settings.double_tag[i]+">"])),id)}}catch(e){}}};$this.checkCustomTags=function(){var pattern;for(var i in settings.custom_tag){pattern="";try{if(typeof settings.custom_tag[i]==="string"||settings.custom_tag[i]instanceof String){pattern=new RegExp(settings.custom_tag[i],"gi");if(pattern!==""){$this.setChecked($this.keywordMatch($this.checkPattern(pattern),$.sq_config.keyword),settings.custom_tag_id[i])}}}catch(e){}}return false};$this.checkSingleTags=function(){var id;var striptag="[\\],\\[]";striptag=$.sq_regex(striptag);for(var i in settings.single_tag){id="";try{if(typeof settings.single_tag[i]==="string"||settings.single_tag[i]instanceof String){id=settings.single_tag[i].replace(striptag,"");if(id!==""){$this.setChecked($this.checkTag(["<"+settings.single_tag[i],">"]).length>0,id)}}}catch(e){}}};$this.checkTag=function(tag,content){var pattern="";if($.sq_isArray(tag)){if(tag[0]!==""&&tag[1]!==""){pattern=tag[0].replace("/","\\/")+"([^>]*)"+tag[1].replace("/","\\/");pattern=$.sq_regex(pattern)}}else{return false}SQ_DEBUG&&console.log("checkTag pattern: "+pattern);return $this.checkPattern(pattern,content)};$this.checkPattern=function(pattern,content){if(typeof content==="undefined")var content=seo.content;content=content.replace(/<img([^>]*)(mceItemMedia|mce-object)([^>]*)>/gi," ");var matches="";if(pattern!==""){matches=content.toLowerCase().match(pattern);SQ_DEBUG&&console.log((matches!==null)+" for "+pattern+" in content");if(matches!==null&&$.sq_isArray(matches)){return matches.join(", ")}}return false};$this.getPercentCompleted=function(){var all=$.sq_fields.div_blockseo.find(".sq_tasks > ul > li").not(".sq_tasks_category").length;var checked=$.sq_fields.div_blockseo.find(".sq_tasks > ul > li.checked").not(".sq_tasks_category").length;return checked*100/all};$this.checkCompleted=function(){if($.sq_config.silent){return}var cached=null;var ky=$.sq_config.keyword.replace(/[^a-zA-Z0-9]/g,"");var timeout=3e3;if(!$.sq_config.manual){timeout=1e3}cached=$.sq_getCache("complete_"+ky);if(cached!=="1")if($.sq_fields.div_blockseo.find(".sq_tasks > ul > li").length>10){if($.sq_fields.div_blockseo.find(".sq_tasks > ul > li").not(".sq_tasks_category").not(".checked").length==0){$("body").prepend($("<ul/>").html("<li>"+$.sq_config.__fulloptimized+"</li>").addClass("sq_complete"));if($("#wpadminbar").css("display")=="none"){$(".sq_complete").css("top","0")}else{$(".sq_complete").css("top","28px")}setTimeout(function(){$("ul.sq_complete").fadeOut("slow");$("ul.sq_complete").remove()},timeout);$.sq_setCache("complete_"+ky,"1");if($(".sq_helpnotice").length>0)$(".sq_helpnotice").slideDown()}$(".sq_blockseo_progress").val($this.getPercentCompleted());$.sq_fields.sq_keyword_score.html(parseInt($this.getPercentCompleted())+"%")}};$this.setChecked=function(cond,id,hidden){var cached=null;var ky=$.sq_config.keyword.replace(/[^a-zA-Z0-9]/g,"");if($.sq_getCookie("sq_sla")==="off"){hidden=1}if(cond){$.sq_fields.div_blockseo.find("#sq_"+id).attr("class","checked");if($.sq_fields.div_blockseo.find("#sq_"+id).find(".sq_request_highlight_key").length>0){$.sq_fields.div_blockseo.find("#sq_"+id).find(".sq_request_highlight_key").hide();$this.sq_eventsseo.listenHighlight(false)}cached=$.sq_getCache("task_"+ky+id);if(cached!=="1"){if($.sq_config.manual){if(typeof hidden==="undefined"){$this.addTopNotification(id)}}}SQ_DEBUG&&console.log("sq_setCache true: ",id);$.sq_setCache("task_"+ky+id,"1");$.sq_fields.div_blockseo.find("#sq_input_"+id+"").remove();$.sq_fields.div_blockseo.find("#sq_"+id).append('<input id="sq_input_'+id+'" type="hidden" name="sq_seo[]" value="'+id+'" />')}else{$.sq_setCache("task_"+ky+id,"0");if(id!=="img"&&id!=="alt"){SQ_DEBUG&&console.log("sq_setCache false: ",id);$.sq_setCache("complete_"+ky,"0")}$.sq_fields.div_blockseo.find("#sq_"+id).removeClass("checked");if($.sq_fields.div_blockseo.find("#sq_"+id).find(".sq_request_highlight_key").length>0){$.sq_fields.div_blockseo.find("#sq_"+id).find(".sq_request_highlight_key").show();$this.sq_eventsseo.listenHighlight(true)}$.sq_fields.div_blockseo.find("#sq_input_"+id).remove()}$this.checkCompleted();if(!$.sq_config.briefcase){$this.trigger("seo.after_checked",[id])}return Boolean(cond)};$this.addTopNotification=function(id){if($.sq_config.silent){return}var task=$.sq_fields.div_blockseo.find("#sq_"+id).clone();task=task.find(".sq_help").remove();task=task.end().html();$("ul.sq_notification").remove();$("body").append($("<ul/>").attr("id","sqt_"+id).html("<li>"+task+"</li>").addClass("sq_notification").css("zIndex","100000001"));if($("#wpadminbar").css("display")=="none"){$(".sq_notification").css("top","0")}else{$(".sq_notification").css("top","28px")}if($("#sq_"+id).find(".sq_seo_priority_essential").length>0){$("#sqt_"+id).addClass("sq_notification_front")}if($this.timeout)clearTimeout($this.timeout);$this.timeout=setTimeout(function(){$("ul.sq_notification").fadeOut("slow");$("ul.sq_notification").remove()},3e3)};$this.checkLength=function(str,min,max){str=$.sq_clearText(str);if(min>0&&str.length>=min&&(max===0||str.length<=max)){return true}return false};$this.checkWordsLength=function(str,min,max){if(min>0&&$this.wordCount(str)>=min&&(max===0||$this.wordCount(str)<=max)){return true}return false};$this.getWords2Min=function(str,min){if(min>0&&$this.wordCount(str)<min){return(min-$this.wordCount(str)+1).toFixed()}return 0};$this.urlMatch=function(str,keyword){if(str===false)return;if(typeof keyword==="undefined")return;var original=keyword;str=$.sq_clearText(str);str=$.sq_stripChars(str);keyword=$.sq_umlautsText(keyword);keyword=$.sq_clearText(keyword);keyword=$.sq_stripChars(keyword);SQ_DEBUG&&console.log("keywordMatch: "+keyword+"=>"+str);if(str!==""&&keyword!==""){var matches=0;$.sq_highlight($("<div>"+str+"</div>"),keyword,{counter:1,done:function(count){matches=count}});if(!matches){keyword=keyword.replace(/\s/g,"");$.sq_highlight($("<div>"+str+"</div>"),keyword,{counter:1,done:function(count){matches=count}})}if(!matches&&original.indexOf("ü")){keyword=original.replace("ü","ue");keyword=$.sq_clearText(keyword);keyword=$.sq_stripChars(keyword);$.sq_highlight($("<div>"+str+"</div>"),keyword,{counter:1,done:function(count){matches=count}})}SQ_DEBUG&&console.log("matches="+matches);return matches>0}};$this.keywordMatch=function(str,keyword,exact_match){var matches=0;if(str===false)return matches;if(typeof keyword==="undefined")return matches;str=$.sq_clearText(str);keyword=$.sq_clearText(keyword);keyword=keyword.replace(/[\"]/g,"");keyword=keyword.trim();if(typeof exact_match==="undefined")exact_match=false;if(typeof str!=="undefined"&&str!==""&&keyword!==""){if(exact_match){matches=str===keyword}else{$.sq_highlight($("<div>"+str+"</div>"),keyword,{counter:0,done:function(count){matches=count}});SQ_DEBUG&&console.log("matches="+matches)}}return matches};$this.keywordDensity=function(str,low,high,id){var density=$this.getDensity(str,$.sq_config.keyword);var cached=null;var ky=$.sq_config.keyword.replace(/[^a-zA-Z0-9]/g,"");if(density.words<$this.checkWordsLength($.sq_config.keyword)){SQ_DEBUG&&console.log("keywordDensity: TOO FEW WORDS ",density.words);$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html("");$this.setChecked(false,id);return}if(density.val<=low&&density.keywords<$.sq_params.max_keywords){SQ_DEBUG&&console.log("keywordDensity: TOO LOW ",density.val,low,density.keywords,$.sq_params.max_keywords);var need=density.words-100*density.keywords/low;need=Math.round(need)<=0?1:Math.round(need);var kr_need=Math.min(low*density.words/100-density.keywords+.5,$.sq_params.max_keywords-density.keywords);kr_need=Math.round(kr_need)<=0?1:kr_need.toFixed();$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html($.sq_fields.div_blockseo.find("#sq_"+id+"_low").html());$.sq_fields.div_blockseo.find("#sq_"+id+"_val").parent("li").attr("class","sq_"+id+"_low");cached=$.sq_getCache("task_"+ky+id);if(cached==="1"){if($.sq_config.manual){$this.addTopNotification(id);$this.find("#sqt_"+id).addClass("sq_"+id+"_low")}}$.sq_setCache("task_"+ky+id,"2");$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html($.sq_fields.div_blockseo.find("#sq_"+id+"_low").html()+" ("+$.sq_config.__addmorekeywords.replace(/%s/g,kr_need)+(need<density.words?" "+$.sq_config.__removewords.replace(/%s/g,Math.min(need,density.words)):"")+")");$.sq_fields.div_blockseo.find("#sq_input_"+id).remove()}else{if(density.val>=high){SQ_DEBUG&&console.log("keywordDensity: TOO HIGH ",density.val);var need=100*density.keywords/high-density.words+.5;need=Math.round(need)<=0?1:Math.round(need);var kr_need=density.keywords-high*density.words/100+.5;kr_need=Math.round(kr_need)<=0?1:kr_need.toFixed();$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html($.sq_fields.div_blockseo.find("#sq_"+id+"_high").html());$.sq_fields.div_blockseo.find("#sq_"+id+"_val").parent("li").attr("class","sq_"+id+"_high");cached=$.sq_getCache("task_"+ky+id);if(cached==="1"){if($.sq_config.manual){$this.addTopNotification(id);$this.find("#sqt_"+id).addClass("sq_"+id+"_high")}}$.sq_setCache("task_"+ky+id,"3");if($this.checkWordsLength(str,$.sq_params.min_length_body,$.sq_params.max_length_body)!==false)kr_need="remove "+kr_need+" keyword(s) or ";else kr_need="";$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html($.sq_fields.div_blockseo.find("#sq_"+id+"_high").html()+" ("+kr_need+$.sq_config.__addmorewords.replace(/%s/g,need)+")");$.sq_fields.div_blockseo.find("#sq_input_"+id).remove()}else{SQ_DEBUG&&console.log("keywordDensity: "+((density.val>low||density.keywords>=$.sq_params.max_keywords)&&density.val<high),density.val,low,density.keywords,$.sq_params.max_keywords);$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html($.sq_fields.div_blockseo.find("#sq_"+id+"_done").html());$this.setChecked((density.val>low||density.keywords>=$.sq_params.max_keywords)&&density.val<high,id)}}};$this.getDensity=function(str,keyword){var density={};keyword=$.sq_clearText(keyword);str=$.sq_clearText(str);density.keywords=$this.phraseCount(str,keyword);density.words=$this.wordCount(str);density.words=density.words-density.keywords*($this.keywordWords(keyword)-1);if(density.words>0){density.val=density.keywords*100/density.words}else if(density.keywords>=1){density.val=100}else{density.val=0}return density};$this.keywordWords=function(keyword){var pattern=new RegExp("[㐀-龿 -〿぀-ゟ゠-ヿ＀-゚一-龯㐀-䶿]|\\S+","gi");var words=keyword.match(pattern);if(words&&words.length>0)return words.length+1;else return 1};$this.phraseCount=function(str,keyword){var words=0;$.sq_highlight($("<div>"+str+"</div>"),keyword,{counter:1,done:function(count){words=count}});return words};$this.wordCount=function(str){str=$.sq_clearText(str);var matches=str.match(/[\u3400-\u9FBF\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]|\S+/g);if(matches)return matches.length;return 0};$this.sq_eventsseo={listen:function(){if($.sq_config.keyword!==""){$this.closeOverlay()}else{$this.overlay()}$.getJSON($.sq_config.sq_apiurl+"api/posts/seo/tasks?callback=?",{user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token}).done(function(response){$this.sq_doneloading("sq_minloading").removeClass("sq_error");if(typeof response.data!=="undefined"&&typeof response.data.tasks!=="undefined"&&$this.find(".sq_tasks").length>0){$this.find(".sq_tasks").append(response.data.tasks);settings.check=eval("sq_check");settings.custom_tag=eval("sq_custom_tag");settings.custom_tag_id=eval("sq_custom_tag_id");settings.single_tag=eval("sq_single_tag");if($.sq_fields.div_blockseo.find("#sq_seo_refresh").length==0){$.sq_fields.div_blockseo.find(".sq_header").append('<span id="sq_seo_refresh" style="float: right; line-height: 22px; text-align: center; width: 64px; height: 22px; background-color: #ff9b00; font-size: 12px; font-weight: bold; color: white; margin: -2px 0; padding: 0px; border: none; cursor: pointer;">Update</span>')}$this.sq_eventsseo.listenHighlight(true);$this.on("seo.refresh",function(){$.sq_fields.div_blockseo.find("#sq_seo_refresh").addClass("sq_minloading");setTimeout(function(){$.sq_fields.div_blockseo.find("#sq_seo_refresh").removeClass("sq_minloading");$this.load()},1e3)});$.sq_fields.div_blockseo.find("#sq_seo_refresh").on("lateclick",function(){$this.trigger("seo.refresh");$this.trigger("seo.refresh_lateclick")});$this.find("#sq_seo_refresh").on("click",function(){$this.trigger("seo.refresh");$this.trigger("seo.refresh_click")});$this.trigger("seo.refresh");$this.trigger("seo.task_loaded")}else{$this.sq_doneloading("sq_minloading").removeClass("sq_error");$this.find(".sq_tasks").html('<div class="sq_message" style="width: 100% !important;">'+$.sq_config.__ajaxerror+"</div>")}}).fail(function(){$.sq_fields.sq_errorloading.show();$.sq_fields.sq_preloading_keyword.hide();$this.sq_doneloading("sq_minloading").removeClass("sq_error");$this.find(".sq_tasks").html('<div class="sq_message" style="width: 100% !important;">'+$.sq_config.__ajaxerror+"</div>")});$this.sq_eventsseo.listenTitle();$this.sq_eventsseo.listenSlug();$this.sq_eventsseo.listenSticky();$.sq_fields.content_tmce.on("click",function(){$.sq_config.editor_type="tinymce"});$.sq_fields.content_html.on("click",function(){$.sq_config.editor_type="html"});$("#save-post,#publish,#post-preview").click(function(){if($.sq_blockbriefcase){$.sq_blockbriefcase.trigger("briefcase.save")}if($.sq_config.editor_type==="tinymce"){var iframe_tinymce=$.sq_editor.getIframeEditor();if(iframe_tinymce!==false)$(iframe_tinymce).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}else{$.sq_removeHighlight($.sq_getBuilderEditorContainer())}if($.sq_config.keyword!==""){$.sq_blocksearch.addTag();$.sq_fields.wp_publish.focus()}});$.sq_fields.wp_input_title.off("click").on("click",function(){if($this.find(".sq_overlay").length>0)if($.sq_fields.sq_keyword.val()!==""){$.sq_config.showInspiration=false;$.sq_fields.sq_selectit.trigger("click")}});if(typeof ET_PageBuilder!=="undefined"&&typeof ET_PageBuilder.Events!=="undefined"){ET_PageBuilder.Events.on("et-pb-loading:ended",function(){$(".et-pb-remove").on("click",function(){SQ_DEBUG&&console.log("Divi Save Pressed");$.sq_fields.div_blockseo.find("#sq_seo_refresh").trigger("lateclick")})});ET_PageBuilder.Events.on("et-modal-settings:save",function(){ET_PageBuilder.Events.on("et-modal-view-removed",function(){SQ_DEBUG&&console.log("Divi Save Pressed");$.sq_fields.div_blockseo.find("#sq_seo_refresh").trigger("lateclick");$(".et-pb-remove").on("click",function(){SQ_DEBUG&&console.log("Divi Save Pressed");$.sq_fields.div_blockseo.find("#sq_seo_refresh").trigger("lateclick")})})})}if($("#visual_composer_content").length>0){if($("div#vc_ui-panel-edit-element").length>0){$("div#vc_ui-panel-edit-element").find("span[data-vc-ui-element=button-save]").on("click",function(){SQ_DEBUG&&console.log("Visual Composer Save");$.sq_fields.div_blockseo.find("#sq_seo_refresh").trigger("lateclick");if($("#visual_composer_content").find(".vc-c-icon-delete_empty").length>0){$("#visual_composer_content").find(".vc-c-icon-delete_empty").on("click",function(){SQ_DEBUG&&console.log("Visual Composer Delete");$.sq_fields.div_blockseo.find("#sq_seo_refresh").trigger("lateclick")})}})}if($("#visual_composer_content").find(".vc-c-icon-delete_empty").length>0){$("#visual_composer_content").find(".vc-c-icon-delete_empty").on("click",function(){SQ_DEBUG&&console.log("Visual Composer Delete");$.sq_fields.div_blockseo.find("#sq_seo_refresh").trigger("lateclick")})}}},listenTinymce:function(){SQ_DEBUG&&console.log("listenTinymce");$.sq_config.editor_type="tinymce";if($.sq_config.interval_seo){clearInterval($.sq_config.interval_seo)}$.sq_config.interval_seo=setInterval(function(){var iframe_tinymce=$.sq_editor.getIframeEditor();if(iframe_tinymce!==false){$.sq_editor.insertHandler=function(e){$.sq_config.active_editor=$(this);if(e.target.nodeName==="IMG"){SQ_DEBUG&&console.log("DOMNodeInserted ",e);$.sq_editor.listen(e);$this.callback()}};$(iframe_tinymce).off("DOMNodeInserted",$.sq_editor.insertHandler).on("DOMNodeInserted",$.sq_editor.insertHandler);$.sq_editor.removeHandler=function(e){$.sq_config.active_editor=$(this);if(e.target.nodeName==="IMG"){SQ_DEBUG&&console.log("DOMNodeRemoved "+e.target.nodeName);$.sq_editor.lastimage="";$this.callback()}};$(iframe_tinymce).off("DOMNodeRemoved",$.sq_editor.removeHandler).on("DOMNodeRemoved",$.sq_editor.removeHandler);$.sq_editor.changeHandler=function(e){$.sq_config.active_editor=$(this);SQ_DEBUG&&console.log(" keyup mouseup ",e.type);if(e.type==="mouseup"){$(this).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}if($.sq_config.timeout_seo){clearTimeout($.sq_config.timeout_seo)}$.sq_config.timeout_seo=setTimeout(function(){if($this.find(".sq_overlay").length>0)if($.sq_fields.sq_keyword.val()!==""){$.sq_config.showInspiration=false;$.sq_fields.sq_selectit.trigger("click")}$this.callback()},$.sq_config.delay_seo)};$(iframe_tinymce).off("keyup mouseup",$.sq_editor.changeHandler).on("keyup mouseup",$.sq_editor.changeHandler);$this.callback();clearInterval($.sq_config.interval_seo);if($.sq_config.active_editor){$.sq_removeHighlight($.sq_getBuilderEditorContainer($.sq_config.active_editor))}}if(typeof $.sq_config.frontend_css!=="undefined"){if($.sq_editor.getIframeEditor("head link[href='"+$.sq_config.frontend_css+"']")===false){var iframe_head=$.sq_editor.getIframeEditor("head");if(iframe_head!==false){iframe_head.append($("<link/>",{rel:"stylesheet",href:$.sq_config.frontend_css,type:"text/css"}))}}}$this.sq_eventsseo.listenFeatureImage()},1e3)},stopListenTinymce:function(){SQ_DEBUG&&console.log("stop listen Tinymce");if($.sq_config.interval_seo){clearInterval($.sq_config.interval_seo)}var iframe_tinymce=$.sq_editor.getIframeEditor();if(iframe_tinymce!==false)$(iframe_tinymce).off("keyup mouseup")},listenHtml:function(){$.sq_config.editor_type="html";$.sq_fields.wp_content.on("click keyup",function(){$.sq_config.active_editor=$(this);if($.sq_config.editor_type==="html"){if($this.timeout_html){clearTimeout($this.timeout_html)}$this.timeout_html=setTimeout(function(){$this.callback()},$.sq_config.delay_seo)}});$.sq_fields.wp_content.on("dragover",false).on("dragenter",false).on("drop",function(e){if($.sq_config.editor_type==="html"){e.preventDefault();$.sq_editor.listenHtml(e)}});$this.sq_eventsseo.listenFeatureImage();$this.sq_eventsseo.listenMediaLibrary()},listenFeatureImage:function(){$("#postimagediv").on("DOMNodeInserted DOMNodeRemoved",function(){$this.checkImage($(this))});$(".editor-post-featured-image").on("DOMNodeInserted DOMNodeRemoved",function(){$this.checkImage($(this))})},listenMediaLibrary:function(){if($.sq_fields.wp_thumbnail_alt.length>0){$.sq_fields.wp_thumbnail_alt.on("keyup",function(){$this.setChecked($this.keywordMatch($.sq_fields.wp_thumbnail_alt.val(),$.sq_config.keyword),"alt")});$this.checkImage($.sq_fields.wp_thumbnail);$this.setChecked($this.keywordMatch($.sq_fields.wp_thumbnail_alt.val(),$.sq_config.keyword),"alt")}},listenVComposer:function(){if($("#visual_composer_content").length>0){var composer=$("#visual_composer_content");if(composer.find("img.attachment-thumbnail").length>0){SQ_DEBUG&&console.log("Visual Composer Image");$this.checkImage($("#visual_composer_content").find("img.attachment-thumbnail").parents(".wpb_content_element:last"))}if(composer.find("ul.attachment-thumbnails").length>0){SQ_DEBUG&&console.log("Visual Composer Galerry");$this.checkImage($("#visual_composer_content").find("ul.attachment-thumbnails"))}if(composer.find(".wpb_vc_custom_heading .admin_label_text").length>0){composer.find(".wpb_vc_custom_heading .admin_label_text").each(function(){if($this.keywordMatch($(this).text(),$.sq_config.keyword)){SQ_DEBUG&&console.log("Visual Composer Headline");return $this.setChecked($this.keywordMatch($(this).text(),$.sq_config.keyword),"h2_6")}})}}},listenFusion:function(){if($(".fusion_module_block_preview").find("img").length>0){SQ_DEBUG&&console.log("Fusion Image Preview");$this.checkImage($(".fusion_module_block_preview").find("img").parents("div:last"))}else if($("img.fusion-child-element-image").length>0){SQ_DEBUG&&console.log("Fusion Image Element");$this.checkImage($("img.fusion-child-element-image").parents("div:last"))}if($(".fusion_module_block_preview").find(".title_text").length>0){$(".fusion_module_block_preview").find(".title_text").each(function(){if($this.keywordMatch($(this).text(),$.sq_config.keyword)){SQ_DEBUG&&console.log("Fusion Headline");return $this.setChecked($this.keywordMatch($(this).text(),$.sq_config.keyword),"h2_6")}})}},stopListenHtml:function(){SQ_DEBUG&&console.log("stop listen HTML");$.sq_fields.wp_content.off("keyup");$.sq_fields.wp_content.off("drop")},listenTitle:function(){SQ_DEBUG&&console.log("listen title");$.sq_fields.wp_input_title.off("keyup change").on("keyup change",function(){$(this).trackLength("wp_title");$.sq_config.manual=true;$.sq_config.silent=false;$.sq_config.briefcase=false;$this.checkWpFields()});if($("#sq_wp_title_info").length==0){$.sq_fields.wp_input_title.after($.sq_fields.sq_wp_title_info)}},listenSlug:function(){var timeout_post_slug=setInterval(function(){if($("#new-post-slug").length>0){clearInterval(timeout_post_slug);$("#new-post-slug").off("keyup").on("keyup",function(){$this.checkKPinguinUrl()});$("#edit-slug-buttons").find("a").on("click",function(){$this.sq_eventsseo.listenSlug()})}},1e3);var timeout_sample_permalink=setInterval(function(){if($("#sample-permalink").length>0){clearInterval(timeout_sample_permalink);if(typeof $.sq_loadFrontMenu!=="undefined"){SQ_DEBUG&&console.log("Reload the Squirrly Snippet");$.sq_loadFrontMenu()}}},1e3)},listenSticky:function(){$this.on("sq_sticky",function(e,on){SQ_DEBUG&&console.log(on);if(on&&$.sq_config.keyword!==""){$.sq_fields.div_blockseo.addClass("sq_sticky");$(".sq_sticky_keyword").html($.sq_fields.sq_keyword.val());$("#submitdiv.postbox").before('<div id="submitdivplace"></div>');$this.after($("#submitdiv.postbox"))}else{$this.parents(".sq_box:last").removeClass("sq_sticky");$("#submitdivplace").after($("#submitdiv.postbox"));$("#submitdivplace").remove()}})},listenHighlight:function(on){if(on){settings.clicked["highlight"]=false;$this.find(".sq_request_highlight_key").parents("li:last").on("click",function(e){e.stopPropagation();settings.clicked["highlight"]=true}).on("mouseenter",function(e){e.stopPropagation();$(this).css("cursor","pointer");if($.sq_config.editor_type==="tinymce"){var iframe_tinymce=$.sq_editor.getIframeEditor();if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_highlight($.sq_getBuilderEditorContainer($(this)),$.sq_config.keyword)})}}else{$.sq_highlight($.sq_getBuilderEditorContainer($(this)),$.sq_config.keyword)}}).on("mouseleave",function(){if($.sq_config.editor_type==="tinymce"){if(!settings.clicked["highlight"]){var iframe_tinymce=$.sq_editor.getIframeEditor();if(iframe_tinymce!==false)$(iframe_tinymce).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}}else{$.sq_removeHighlight($.sq_getBuilderEditorContainer())}})}else{$this.find(".sq_request_highlight_key").parents("li:last").off()}}};$this.one("seo.loaded",function(){SQ_DEBUG&&console.log("sq_blockseo seo.loaded");if(!$.sq_config.subscription_active){return}if(!$.sq_isGutenberg()&&!$.sq_isFrontend()){if($.sq_fields.wp_content_wrap.length>0&&$.sq_fields.wp_content_wrap.attr("class").indexOf("html-active")!==-1){SQ_DEBUG&&console.log("seo.loaded listenHTML");$this.sq_eventsseo.listenHtml();$.sq_config.active_editor=$.sq_fields.wp_content}else{SQ_DEBUG&&console.log("seo.loaded listenTinymce");$this.sq_eventsseo.listenTinymce();$.sq_config.active_editor=$.sq_editor.getIframeEditor()}}else if($.sq_isGutenberg()){wp.data.subscribe(function(){var ed=$.sq_editor.getBlockEditor("select");if(ed&&ed.isTyping){if($.sq_config.timeout_seo){clearTimeout($.sq_config.timeout_seo)}$.sq_config.timeout_seo=setTimeout(function(){$this.callback()},$.sq_config.delay_seo)}if(ed&&ed.isSavingPost()&&!ed.isAutosavingPost()){if($.sq_floating){if($.sq_config.timeout_save){clearTimeout($.sq_config.timeout_save)}$.sq_config.timeout_save=setTimeout(function(){$.sq_floating.trigger("seo.floating.page_saved")},$.sq_config.delay_seo)}}})}$this.sq_loading();$this.one("seo.keyword_loaded",function(){$this.sq_eventsseo.listen()})});return $this};$.fn.trackLength=function(type){var $this=this;var min=0;var max=0;var color="green";if(typeof $this==="undefined")return;if(type==="title"||type==="wp_title"){min=$.sq_params.min_length_title;max=$.sq_params.max_length_title}else if(type==="description"){min=$.sq_params.min_length_description;max=$.sq_params.max_length_description}if(min>0&&min>$this.val().length){color="red"}else if(max>0&&max<$this.val().length){color="red"}else{color="green"}if(max>0){$("#sq_"+type+"_info").html($this.val().length+"/"+max);$("#sq_"+type+"_info").css("color",color)}}})(jQuery);
1
+ (function($){"use strict";$.fn.sq_blockseo=function(options){var $this=this;var settings=$.extend({check:[],single_tag:[],double_tag:[],custom_tag:[],custom_tag_id:[],clicked:[]},options);$.sq_fields=$.extend({sq_wp_title_info:$('<span id="sq_wp_title_info" style="display: block; float: right;" />')},$.sq_fields);var seo={title:"",content:""};$this.setContent=function(content){seo.content=content};$this.callback=function(){$.sq_config.manual=true;$.sq_config.silent=false;$.sq_config.briefcase=false;if(typeof $.sq_config.keyword==="undefined"||$.sq_config.keyword==="")return;if($.sq_config.editor_type==="tinymce"){if($.sq_isGutenberg()){ed=$.sq_editor.getBlockEditor("select");if(ed)seo.content=ed.getEditedPostContent()}else if($.sq_config.active_editor&&typeof $.sq_config.active_editor.html=="function"){seo.content=$.sq_config.active_editor.html()}else{ed=$.sq_editor.getIframeEditor();seo.content=ed.html()}}else{if($.sq_isGutenberg()){var ed=$.sq_editor.getBlockEditor("select");if(ed)seo.content=ed.getEditedPostContent()}else if($.sq_isFrontend()){var ed=$.sq_editor.getFrontendEditor();if(ed)seo.content=ed.getPageContent()}else if($.sq_config.active_editor&&typeof $.sq_config.active_editor.val=="function"){seo.content=$.sq_fields.wp_content.val()}else if($.sq_fields.wp_content.length){seo.content=$.sq_fields.wp_content.val()}}$this.trigger("seo.content");$this.checkSEO();$this.trigger("seo.callback")};$this.checkSEO=function(){if(typeof seo.content!=="undefined"&&$.sq_clearText(seo.content)!==""){SQ_DEBUG&&console.log("check keywords in body and tags");$this.checkBody();$this.checkSingleTags();$this.checkCustomTags();$this.checkKPinguinUrl();$this.checkKeyword();if($.sq_fields.wp_thumbnail.length>0){$this.sq_eventsseo.listenMediaLibrary()}else if($("#postimagediv").length>0){$this.checkImage($("#postimagediv"))}else if($.sq_isFrontend()){var ed=$.sq_editor.getFrontendEditor();if(ed){$.sq_blockseo.checkImage($("<div>"+ed.getPageImages()+"</div>"))}}if($(".editor-post-featured-image").length>0){$this.checkImage($(".editor-post-featured-image"))}if($("#visual_composer_content").length>0){$this.sq_eventsseo.listenVComposer()}if($("#fusion_builder_container").length>0){$this.sq_eventsseo.listenFusion()}}if(typeof seo.content!=="undefined"&&($.sq_clearText(seo.content).length>1||$.sq_fields.wp_input_title.length>0&&$.sq_clearText($.sq_fields.wp_input_title.val()).length>1)){if(settings.check.indexOf("~density~")!==-1){$this.keywordDensity($.sq_fields.wp_input_title.val()+" "+seo.content,$.sq_params.low_density,$.sq_params.high_density,"density")}}};$this.checkWpFields=function(){if(typeof $.sq_config.keyword==="undefined"||$.sq_config.keyword==="")return;SQ_DEBUG&&console.log("=====TITLE=====");SQ_DEBUG&&console.log($.sq_fields.wp_input_title);if($.sq_fields.wp_input_title.length){if($.sq_clearText($.sq_fields.wp_input_title.val()).length>1){SQ_DEBUG&&console.log("check keywords in title: "+$.sq_fields.wp_input_title.val());$this.checkPinguin();$this.checkTitle();if(settings.check.indexOf("~density_title~")!==-1){var id="density_title";if($this.checkWordsLength($.sq_config.keyword,1,100)){if($.sq_strEqual($.sq_fields.wp_input_title.val(),$.sq_config.keyword)){$this.setChecked(true,id)}else{$this.keywordDensity($.sq_fields.wp_input_title.val(),$.sq_params.low_density_title,$.sq_params.high_density_title,"density_title")}}else{$("#sq_"+id+"_val").html($("#sq_"+id+"_longtail").html());$this.setChecked(false,id)}}if(settings.check.indexOf("~density~")!==-1)$this.keywordDensity($.sq_fields.wp_input_title.val()+" "+seo.content,$.sq_params.low_density,$.sq_params.high_density,"density")}}SQ_DEBUG&&console.log("=====END TITLE=====");return $this.getPercentCompleted()};$this.load=function(){$.sq_fields.div_blockseo.find(".sq_tasks > ul > li").not(".sq_tasks_category").removeClass("checked");if($.sq_config.timeout_seo){clearTimeout($.sq_config.timeout_seo)}$.sq_config.timeout_seo=setTimeout(function(){$this.checkWpFields();$this.callback()},100)};$this.close=function(){$.sq_fields.div_blockseo.hide()};$this.overlay=function(){if($(".sq_overlay").length==0){$.sq_fields.div_blockseo.prepend('<div class="sq_overlay" data-title="'+$.sq_config.__enter_keyword+'" title="'+$.sq_config.__enter_keyword+'"></div>');$(".sq_overlay").on("click",function(){if($.sq_fields.sq_keyword.val()===""){var previewtop=$.sq_fields.sq_keyword.offset().top-100;if($(".edit-post-layout__content").length>0){$(".edit-post-layout__content").animate({scrollTop:$(".edit-post-layout__content").scrollTop()+previewtop},1e3,function(){$.sq_fields.sq_keyword.focus();$.sq_blocksearch.showEnterKeyword()})}else{$("html,body").animate({scrollTop:previewtop},1e3,function(){$.sq_fields.sq_keyword.focus();$.sq_blocksearch.showEnterKeyword()})}}else{$.sq_fields.sq_selectit.trigger("click")}})}};$this.closeOverlay=function(){$(".sq_overlay").remove()};$this.checkKPinguinUrl=function(){if($("#custom_permalinks_home_url").length>0&&$("#custom_permalink").length>0){if(settings.check.indexOf("~pinguin_url~")!==-1&&$.sq_config.keyword!==""){var slug=$("#custom_permalinks_home_url").val()+" "+$("#custom_permalink").val();$this.setChecked($this.urlMatch(slug,$.sq_config.keyword),"pinguin_url")}}else if($("#editable-post-name-full").length>0){if(settings.check.indexOf("~pinguin_url~")!==-1&&$.sq_config.keyword!==""){var root="";if($("#sample-permalink").length>0){var sample_permalink=$("#sample-permalink").find("a").clone();sample_permalink.find("span").remove();root=sample_permalink.text()}var slug=root+" "+$("#editable-post-name-full").html();$this.setChecked($this.urlMatch(slug,$.sq_config.keyword),"pinguin_url")}}else if($("#new-post-slug").length>0){if(settings.check.indexOf("~pinguin_url~")!==-1&&$.sq_config.keyword!==""){var slug=$("#new-post-slug").val();$this.setChecked($this.urlMatch(slug,$.sq_config.keyword),"pinguin_url")}}else if($("#sample-permalink").length>0){if(settings.check.indexOf("~pinguin_url~")!==-1&&$.sq_config.keyword!==""){var slug=$("#sample-permalink").html().replace(/<\/?[^>]+>/gi," ");$this.setChecked($this.urlMatch(slug,$.sq_config.keyword),"pinguin_url")}}else if($.sq_isGutenberg()){var ed=$.sq_editor.getBlockEditor("select");if(ed){var slug=decodeURIComponent(ed.getPermalink()).replace(/<\/?[^>]+>/gi," ");$this.setChecked($this.urlMatch(slug,$.sq_config.keyword),"pinguin_url")}}};$this.checkKeyword=function(){if(settings.check.indexOf("~longtail_keyword~")!==-1&&$.sq_config.keyword!==""){$this.setChecked($this.checkWordsLength($.sq_config.keyword,2,0),"longtail_keyword")}};$this.checkKPinguin=function(){if(settings.check.indexOf("~pinguin_domain~")!==-1&&$.sq_config.keyword!==""){$this.setChecked(!$this.keywordMatch($.sq_getDomain(document.domain,[8]),$.sq_config.keyword,true),"pinguin_domain")}};$this.checkPinguin=function(){if(settings.check.indexOf("~pinguin_title~")!==-1){var domain=$.sq_getDomain(document.domain,[8])!==""?$.sq_getDomain(document.domain,[8]):document.domain;$this.setChecked(!$this.keywordMatch($.sq_fields.wp_input_title.val(),domain,true),"pinguin_title")}};$this.checkTitle=function(){if($.sq_fields.wp_input_title.length>0){if(settings.check.indexOf("~title_length~")!==-1)$this.setChecked($this.checkLength($.sq_fields.wp_input_title.val(),$.sq_params.min_length_title,$.sq_params.max_length_title),"title_length");if(settings.check.indexOf("~title~")!==-1)$this.setChecked($this.keywordMatch($.sq_fields.wp_input_title.val(),$.sq_config.keyword),"title")}};$this.checkImage=function(_this){$.sq_config.silent=true;var pattern=null;pattern=new RegExp("<img([^>]*)>","gi");if(_this.html()!==""&&$this.checkPattern(pattern)){$this.setChecked(true,"img",true)}else if(_this.html()!==""){SQ_DEBUG&&console.log("Check image in object");if($this.checkPattern(pattern,_this.html())){$this.setChecked($this.checkPattern(pattern,_this.html()).length>0,"img",true)}else{pattern=new RegExp("\\[gallery[^\\]]*ids=[^\\]]*\\]","gi");if($this.checkPattern(pattern)){$this.setChecked($this.checkPattern(pattern).length>0,"img")}else{$this.setChecked(0,"img")}}}pattern=new RegExp('alt="([^"]+)"',"gi");if(!$this.keywordMatch($this.checkPattern(pattern),$.sq_config.keyword)){SQ_DEBUG&&console.log("There is no alt image in content");$this.setChecked($this.keywordMatch($this.checkPattern(pattern,_this.html()),$.sq_config.keyword),"alt")}};$this.handleKey=function(event,gsuggestion_index){if(event.keyCode===$.ui.keyCode.UP&&gsuggestion_index>0){gsuggestion_index--}else if(event.keyCode===$.ui.keyCode.DOWN&&gsuggestion_index<$("#sq_wp_title_suggestion .sq_item_gsuggestion").length){gsuggestion_index++}else{gsuggestion_index=0}$("#sq_wp_title_suggestion .sq_item_gsuggestion").removeClass("sq_item_active");if(gsuggestion_index>0){var item_active=$("#sq_wp_title_suggestion .sq_item_gsuggestion:nth-child("+gsuggestion_index+")");item_active.addClass("sq_item_active");$.sq_fields.wp_input_title.val(item_active.html());$this.checkTitle()}return gsuggestion_index};$this.hideOptions=function(){$("#sq_wp_title_suggestion").remove();$this.checkTitle()};$this.checkBody=function(){var $str=$("<div></div>").html(seo.content);$str.find("form").remove();$.sq_highlight($str,$.sq_config.keyword,{counter:0,done:function(count,positions){SQ_DEBUG&&console.log($str.text(),$.sq_config.keyword,count,positions);$this.processBody($str.text(),count,positions)}})};$this.processBody=function(cleanContent,count,positions){var checked=false,id=false,words=[],density,i=0;if($.sq_config.editor_type==="tinymce"){var iframe_tinymce=$.sq_editor.getIframeEditor()}if(settings.check.indexOf("~first_sentence~")!==-1){if(count>1&&cleanContent.length>$.sq_params.beginning_length){$this.setChecked(positions[1]<$.sq_params.beginning_length,"first_sentence")}}if(settings.check.indexOf("~body_length~")!==-1){if($this.checkWordsLength(cleanContent,$.sq_params.min_length_body,$.sq_params.max_length_body)===false){$("#sq_request_body_length").remove();$("#sq_body_length").append(' <span id="sq_request_body_length">'+"("+$this.getWords2Min(cleanContent,$.sq_params.min_length_body)+" more)</span>")}else{$("#sq_request_body_length").remove()}$this.setChecked($this.checkWordsLength(cleanContent,$.sq_params.min_length_body,$.sq_params.max_length_body),"body_length")}if(settings.check.indexOf("~body~")!==-1){$this.setChecked(count>0,"body")}if(settings.check.indexOf("~over_density~")!==-1){checked=true;id="over_density";if($this.checkWordsLength(cleanContent,$.sq_params.min_length_body,$.sq_params.max_length_body)===false){$.sq_fields.div_blockseo.find("#sq_request_"+id+"").remove();$.sq_fields.div_blockseo.find("#sq_"+id+"").append('<span id="sq_request_'+id+'">: '+"("+$.sq_config.__addminimumwords.replace(/%s/g,$this.getWords2Min(cleanContent,$.sq_params.min_length_body))+")</span>");checked=false;$.sq_fields.div_blockseo.find("#sq_"+id+"_val").parent("li").removeClass("sq_"+id+"_high")}else{$.sq_fields.div_blockseo.find("#sq_request_"+id+"").remove();$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html($.sq_fields.div_blockseo.find("#sq_"+id+"_done").html());words=$.sq_clearText($.sq_config.keyword).split(" ");density=$this.getDensity(cleanContent,$.sq_config.keyword);if(density.val>0){var ignore=["and","und","or","the","yet","for","also","then","like","too","but","i","you","he","she","we","they"];var wordslen=words.length;for(i=0;i<wordslen;i++){if(words[i].length>2&&ignore.indexOf(words[i])===-1){var word=words[i];density=$this.getDensity(cleanContent,word);if(density.val>=$.sq_params.max_word_density){var need=density.keywords-$.sq_params.max_word_density*density.words/100+1;need=Math.round(need)<=0?1:need.toFixed();$.sq_fields.div_blockseo.find("#sq_request_"+id+"").remove();$.sq_fields.div_blockseo.find("#sq_"+id+"").append('<span id="sq_request_'+id+'">: '+'<span id="sq_request_'+id+'_highlight" style="color:yellow; text-decoration:underline; cursor: pointer;">'+word+"</span> "+$.sq_config.__toomanytimes.replace(/%s/g,need)+' <span id="sq_request_synonyms_oo"></span></span>');$this.getSynonyms(word,"sq_request_synonyms_oo");settings.clicked[id]=false;$.sq_fields.div_blockseo.find("#sq_request_"+id+"_highlight").parents("li:last").on("click",function(e){e.stopPropagation();settings.clicked[id]=true;$("body").on("mouseup",function(){if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}else{$.sq_removeHighlight($.sq_getBuilderEditorContainer())}})}).on("mouseenter",function(e){e.stopPropagation();$(this).css("cursor","pointer");if($.sq_config.editor_type==="tinymce"){if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_highlight($.sq_getBuilderEditorContainer($(this)),word)})}}else{$.sq_highlight($.sq_getBuilderEditorContainer($(this)),word)}}).on("mouseleave",function(){if($.sq_config.editor_type==="tinymce"){if(!settings.clicked[id]){if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}}}else{$.sq_removeHighlight($.sq_getBuilderEditorContainer())}});$.sq_fields.div_blockseo.find("#sq_"+id+"_val").parent("li").attr("class","sq_"+id+"_high");$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html("");checked=false;break}}}}else{checked=false}$this.setChecked(checked,id)}}if(settings.check.indexOf("~human_friendly~")!==-1){checked=true;id="human_friendly";$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html("");if($this.checkWordsLength(cleanContent,$.sq_params.min_length_body,$.sq_params.max_length_body)===false){$.sq_fields.div_blockseo.find("#sq_request_"+id+"").remove();$.sq_fields.div_blockseo.find("#sq_"+id+"").append('<span id="sq_request_'+id+'">: '+"("+$.sq_config.__writemorewords.replace(/%s/g,$this.getWords2Min(cleanContent,$.sq_params.min_length_body))+")</span>");checked=false;$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html("")}else{$.sq_fields.div_blockseo.find("#sq_request_"+id+"").remove();if(count>=2){for(i=2;i<=count;i++){SQ_DEBUG&&console.log(positions[i]-positions[i-1],$.sq_params.begin_last_max_chars);if(positions[i]-positions[i-1]<$.sq_params.begin_last_max_chars){$.sq_fields.div_blockseo.find("#sq_request_"+id+"").remove();var ndt=i===2?"st":i===3?"nd":i===4?"rd":"th";$.sq_fields.div_blockseo.find("#sq_"+id+"").append('<span id="sq_request_'+id+'">: '+"("+$.sq_config.__morewordsafter.replace(/%s/g,'<span id="sq_request_'+id+'_highlight_key" style="color:lightcoral; text-decoration:underline; cursor: pointer;">'+(i-1)+ndt+"</span>")+' <span id="sq_request_synonyms"></span>)</span>');$this.getSynonyms($.sq_config.keyword,"sq_request_synonyms");settings.clicked[id]=false;$.sq_fields.div_blockseo.find("#sq_request_"+id+"_highlight_key").parents("li:last").off().on("click",function(e){e.stopPropagation();settings.clicked[id]=true;$("body").on("mouseup",function(){if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}else{$.sq_removeHighlight($.sq_getBuilderEditorContainer())}})}).on("mouseenter",function(e){e.stopPropagation();$(this).css("cursor","pointer");if($.sq_config.editor_type==="tinymce"){if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_highlight($.sq_getBuilderEditorContainer($(this)),$.sq_config.keyword)})}}else{$.sq_highlight($.sq_getBuilderEditorContainer($(this)),$.sq_config.keyword)}}).on("mouseleave",function(){if($.sq_config.editor_type==="tinymce"){if(!settings.clicked[id]){if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}}}else{$.sq_removeHighlight($.sq_getBuilderEditorContainer())}});checked=false;$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html("");break}}}}$this.setChecked(checked,id)}};$this.getSynonyms=function(word,span){var ignore=["and","und","or","the","yet","for","also","then","like","too","but","i","you","he","she","we","they"];var words=$.sq_stripChars(word).split(" ");$this.find("#"+span).html(" "+$.sq_config.__orusesynonyms);var wordslen=words.length;for(var w=0;w<wordslen;w++)if(words[w].length>2&&ignore.indexOf(words[w])===-1){$this.find("#"+span).append(" "+(w===0?"for":"or for")+' <span class="'+span+"_"+words[w]+" "+span+'" style="text-decoration:underline; cursor: pointer;" title="">'+words[w]+"</span>");var synonyms_all=$.sq_getCache("synonyms_"+words[w]);if(synonyms_all!==""){if(synonyms_all.length>0)$this.find("."+span+"_"+words[w]).attr("title",synonyms_all.join("\n"))}else{$.getJSON("https://thesaurus.altervista.org/thesaurus/v1?callback=?",{word:words[w],language:$.sq_config.language.replace("-","_"),key:"TDm3SO7N3XEfRWuXYFb9",output:"json"}).done(function(word){return function(data){var response=data.response;var synonyms=[];var synonyms_all=[];if(typeof response!=="undefined"&&response.length>0){var responselen=response.length;for(var j=0;j<responselen;j++){if(typeof response[j].list.synonyms!=="undefined"){synonyms=response[j].list.synonyms.split("|");var synonymslen=synonyms.length;for(var k=0;k<synonymslen;k++){if(typeof synonyms[k]!=="undefined"&&synonyms[k]!==""&&synonyms[k].indexOf("antonym")===-1){synonyms_all.push(synonyms[k]);if(synonyms_all.length>10)break}}}}if(synonyms_all.length>0){$this.find("."+span+"_"+word).attr("title",synonyms_all.join("\n"))}}$.sq_setCache("synonyms_"+word,synonyms_all)}}(words[w])).error(function(word){var synonyms_all=[];synonyms_all.push("no synonyms found");$this.find("."+span+"_"+word).attr("title",synonyms_all.join("\n"));$.sq_setCache("synonyms_"+word,synonyms_all)}(words[w]))}}};$this.checkTags=function(){var id;var striptag="[\\],\\[]";striptag=new RegExp(striptag,"g");for(var i in settings.double_tag){id="";try{if(typeof settings.double_tag[i]==="string"||settings.double_tag[i]instanceof String){id=settings.double_tag[i];id=id.replace(striptag,"");if(id!=="")$this.setChecked($this.keywordMatch($this.checkTag(["<"+settings.double_tag[i]+">","</"+settings.double_tag[i]+">"])),id)}}catch(e){}}};$this.checkCustomTags=function(){var pattern;for(var i in settings.custom_tag){pattern="";try{if(typeof settings.custom_tag[i]==="string"||settings.custom_tag[i]instanceof String){pattern=new RegExp(settings.custom_tag[i],"gi");if(pattern!==""){$this.setChecked($this.keywordMatch($this.checkPattern(pattern),$.sq_config.keyword),settings.custom_tag_id[i])}}}catch(e){}}return false};$this.checkSingleTags=function(){var id;var striptag="[\\],\\[]";striptag=$.sq_regex(striptag);for(var i in settings.single_tag){id="";try{if(typeof settings.single_tag[i]==="string"||settings.single_tag[i]instanceof String){id=settings.single_tag[i].replace(striptag,"");if(id!==""){$this.setChecked($this.checkTag(["<"+settings.single_tag[i],">"]).length>0,id)}}}catch(e){}}};$this.checkTag=function(tag,content){var pattern="";if($.sq_isArray(tag)){if(tag[0]!==""&&tag[1]!==""){pattern=tag[0].replace("/","\\/")+"([^>]*)"+tag[1].replace("/","\\/");pattern=$.sq_regex(pattern)}}else{return false}SQ_DEBUG&&console.log("checkTag pattern: "+pattern);return $this.checkPattern(pattern,content)};$this.checkPattern=function(pattern,content){if(typeof content==="undefined")var content=seo.content;content=content.replace(/<img([^>]*)(mceItemMedia|mce-object)([^>]*)>/gi," ");var matches="";if(pattern!==""){matches=content.toLowerCase().match(pattern);SQ_DEBUG&&console.log((matches!==null)+" for "+pattern+" in content");if(matches!==null&&$.sq_isArray(matches)){return matches.join(", ")}}return false};$this.getPercentCompleted=function(){var all=$.sq_fields.div_blockseo.find(".sq_tasks > ul > li").not(".sq_tasks_category").length;var checked=$.sq_fields.div_blockseo.find(".sq_tasks > ul > li.checked").not(".sq_tasks_category").length;return checked*100/all};$this.checkCompleted=function(){if($.sq_config.silent){return}var cached=null;var ky=$.sq_config.keyword.replace(/[^a-zA-Z0-9]/g,"");var timeout=3e3;if(!$.sq_config.manual){timeout=1e3}cached=$.sq_getCache("complete_"+ky);if(cached!=="1")if($.sq_fields.div_blockseo.find(".sq_tasks > ul > li").length>10){if($.sq_fields.div_blockseo.find(".sq_tasks > ul > li").not(".sq_tasks_category").not(".checked").length==0){$("body").prepend($("<ul/>").html("<li>"+$.sq_config.__fulloptimized+"</li>").addClass("sq_complete"));if($("#wpadminbar").css("display")=="none"){$(".sq_complete").css("top","0")}else{$(".sq_complete").css("top","28px")}setTimeout(function(){$("ul.sq_complete").fadeOut("slow");$("ul.sq_complete").remove()},timeout);$.sq_setCache("complete_"+ky,"1");if($(".sq_helpnotice").length>0)$(".sq_helpnotice").slideDown()}$(".sq_blockseo_progress").val($this.getPercentCompleted());$.sq_fields.sq_keyword_score.html(parseInt($this.getPercentCompleted())+"%")}};$this.setChecked=function(cond,id,hidden){var cached=null;var ky=$.sq_config.keyword.replace(/[^a-zA-Z0-9]/g,"");if($.sq_getCookie("sq_sla")==="off"){hidden=1}if(cond){$.sq_fields.div_blockseo.find("#sq_"+id).attr("class","checked");if($.sq_fields.div_blockseo.find("#sq_"+id).find(".sq_request_highlight_key").length>0){$.sq_fields.div_blockseo.find("#sq_"+id).find(".sq_request_highlight_key").hide();$this.sq_eventsseo.listenHighlight(false)}cached=$.sq_getCache("task_"+ky+id);if(cached!=="1"){if($.sq_config.manual){if(typeof hidden==="undefined"){$this.addTopNotification(id)}}}SQ_DEBUG&&console.log("sq_setCache true: ",id);$.sq_setCache("task_"+ky+id,"1");$.sq_fields.div_blockseo.find("#sq_input_"+id+"").remove();$.sq_fields.div_blockseo.find("#sq_"+id).append('<input id="sq_input_'+id+'" type="hidden" name="sq_seo[]" value="'+id+'" />')}else{$.sq_setCache("task_"+ky+id,"0");if(id!=="img"&&id!=="alt"){SQ_DEBUG&&console.log("sq_setCache false: ",id);$.sq_setCache("complete_"+ky,"0")}$.sq_fields.div_blockseo.find("#sq_"+id).removeClass("checked");if($.sq_fields.div_blockseo.find("#sq_"+id).find(".sq_request_highlight_key").length>0){$.sq_fields.div_blockseo.find("#sq_"+id).find(".sq_request_highlight_key").show();$this.sq_eventsseo.listenHighlight(true)}$.sq_fields.div_blockseo.find("#sq_input_"+id).remove()}$this.checkCompleted();if(!$.sq_config.briefcase){$this.trigger("seo.after_checked",[id])}return Boolean(cond)};$this.addTopNotification=function(id){if($.sq_config.silent){return}var task=$.sq_fields.div_blockseo.find("#sq_"+id).clone();task=task.find(".sq_help").remove();task=task.end().html();$("ul.sq_notification").remove();$("body").append($("<ul/>").attr("id","sqt_"+id).html("<li>"+task+"</li>").addClass("sq_notification").css("zIndex","100000001"));if($("#wpadminbar").css("display")=="none"){$(".sq_notification").css("top","0")}else{$(".sq_notification").css("top","28px")}if($("#sq_"+id).find(".sq_seo_priority_essential").length>0){$("#sqt_"+id).addClass("sq_notification_front")}if($this.timeout)clearTimeout($this.timeout);$this.timeout=setTimeout(function(){$("ul.sq_notification").fadeOut("slow");$("ul.sq_notification").remove()},3e3)};$this.checkLength=function(str,min,max){str=$.sq_clearText(str);if(min>0&&str.length>=min&&(max===0||str.length<=max)){return true}return false};$this.checkWordsLength=function(str,min,max){if(min>0&&$this.wordCount(str)>=min&&(max===0||$this.wordCount(str)<=max)){return true}return false};$this.getWords2Min=function(str,min){if(min>0&&$this.wordCount(str)<min){return(min-$this.wordCount(str)+1).toFixed()}return 0};$this.urlMatch=function(str,keyword){if(str===false)return;if(typeof keyword==="undefined")return;var original=keyword;str=$.sq_clearText(str);str=$.sq_stripChars(str);keyword=$.sq_umlautsText(keyword);keyword=$.sq_clearText(keyword);keyword=$.sq_stripChars(keyword);SQ_DEBUG&&console.log("keywordMatch: "+keyword+"=>"+str);if(str!==""&&keyword!==""){var matches=0;$.sq_highlight($("<div>"+str+"</div>"),keyword,{counter:1,done:function(count){matches=count}});if(!matches){keyword=keyword.replace(/\s/g,"");$.sq_highlight($("<div>"+str+"</div>"),keyword,{counter:1,done:function(count){matches=count}})}if(!matches&&original.indexOf("ü")){keyword=original.replace("ü","ue");keyword=$.sq_clearText(keyword);keyword=$.sq_stripChars(keyword);$.sq_highlight($("<div>"+str+"</div>"),keyword,{counter:1,done:function(count){matches=count}})}SQ_DEBUG&&console.log("matches="+matches);return matches>0}};$this.keywordMatch=function(str,keyword,exact_match){var matches=0;if(str===false)return matches;if(typeof keyword==="undefined")return matches;str=$.sq_clearText(str);keyword=$.sq_clearText(keyword);keyword=keyword.replace(/[\"]/g,"");keyword=keyword.trim();if(typeof exact_match==="undefined")exact_match=false;if(typeof str!=="undefined"&&str!==""&&keyword!==""){if(exact_match){matches=$.sq_strEqual(str,keyword)}else{$.sq_highlight($("<div>"+str+"</div>"),keyword,{counter:0,done:function(count){matches=count}});SQ_DEBUG&&console.log("matches="+matches)}}return matches};$this.keywordDensity=function(str,low,high,id){var density=$this.getDensity(str,$.sq_config.keyword);var cached=null;var ky=$.sq_config.keyword.replace(/[^a-zA-Z0-9]/g,"");if(density.words<$this.checkWordsLength($.sq_config.keyword)){SQ_DEBUG&&console.log("keywordDensity: TOO FEW WORDS ",density.words);$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html("");$this.setChecked(false,id);return}if(density.val<=low&&density.keywords<$.sq_params.max_keywords){SQ_DEBUG&&console.log("keywordDensity: TOO LOW ",density.val,low,density.keywords,$.sq_params.max_keywords);var need=density.words-100*density.keywords/low;need=Math.round(need)<=0?1:Math.round(need);var kr_need=Math.min(low*density.words/100-density.keywords+.5,$.sq_params.max_keywords-density.keywords);kr_need=Math.round(kr_need)<=0?1:kr_need.toFixed();$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html($.sq_fields.div_blockseo.find("#sq_"+id+"_low").html());$.sq_fields.div_blockseo.find("#sq_"+id+"_val").parent("li").attr("class","sq_"+id+"_low");cached=$.sq_getCache("task_"+ky+id);if(cached==="1"){if($.sq_config.manual){$this.addTopNotification(id);$this.find("#sqt_"+id).addClass("sq_"+id+"_low")}}$.sq_setCache("task_"+ky+id,"2");$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html($.sq_fields.div_blockseo.find("#sq_"+id+"_low").html()+" ("+$.sq_config.__addmorekeywords.replace(/%s/g,kr_need)+(need<density.words?" "+$.sq_config.__removewords.replace(/%s/g,Math.min(need,density.words)):"")+")");$.sq_fields.div_blockseo.find("#sq_input_"+id).remove()}else{if(density.val>=high){SQ_DEBUG&&console.log("keywordDensity: TOO HIGH ",density.val);var need=100*density.keywords/high-density.words+.5;need=Math.round(need)<=0?1:Math.round(need);var kr_need=density.keywords-high*density.words/100+.5;kr_need=Math.round(kr_need)<=0?1:kr_need.toFixed();$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html($.sq_fields.div_blockseo.find("#sq_"+id+"_high").html());$.sq_fields.div_blockseo.find("#sq_"+id+"_val").parent("li").attr("class","sq_"+id+"_high");cached=$.sq_getCache("task_"+ky+id);if(cached==="1"){if($.sq_config.manual){$this.addTopNotification(id);$this.find("#sqt_"+id).addClass("sq_"+id+"_high")}}$.sq_setCache("task_"+ky+id,"3");if($this.checkWordsLength(str,$.sq_params.min_length_body,$.sq_params.max_length_body)!==false)kr_need="remove "+kr_need+" keyword(s) or ";else kr_need="";$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html($.sq_fields.div_blockseo.find("#sq_"+id+"_high").html()+" ("+kr_need+$.sq_config.__addmorewords.replace(/%s/g,need)+")");$.sq_fields.div_blockseo.find("#sq_input_"+id).remove()}else{SQ_DEBUG&&console.log("keywordDensity: "+((density.val>low||density.keywords>=$.sq_params.max_keywords)&&density.val<high),density.val,low,density.keywords,$.sq_params.max_keywords);$.sq_fields.div_blockseo.find("#sq_"+id+"_val").html($.sq_fields.div_blockseo.find("#sq_"+id+"_done").html());$this.setChecked((density.val>low||density.keywords>=$.sq_params.max_keywords)&&density.val<high,id)}}};$this.getDensity=function(str,keyword){var density={};keyword=$.sq_clearText(keyword);str=$.sq_clearText(str);density.keywords=$this.phraseCount(str,keyword);density.words=$this.wordCount(str);density.words=density.words-density.keywords*($this.keywordWords(keyword)-1);if(density.words>0){density.val=density.keywords*100/density.words}else if(density.keywords>=1){density.val=100}else{density.val=0}return density};$this.keywordWords=function(keyword){var pattern=new RegExp("[㐀-龿 -〿぀-ゟ゠-ヿ＀-゚一-龯㐀-䶿]|\\S+","gi");var words=keyword.match(pattern);if(words&&words.length>0)return words.length+1;else return 1};$this.phraseCount=function(str,keyword){var words=0;$.sq_highlight($("<div>"+str+"</div>"),keyword,{counter:1,done:function(count){words=count}});return words};$this.wordCount=function(str){str=$.sq_clearText(str);var matches=str.match(/[\u3400-\u9FBF\u3000-\u303f\u3040-\u309f\u30a0-\u30ff\uff00-\uff9f\u4e00-\u9faf\u3400-\u4dbf]|\S+/g);if(matches)return matches.length;return 0};$this.sq_eventsseo={listen:function(){if($.sq_config.keyword!==""){$this.closeOverlay()}else{$this.overlay()}$.getJSON($.sq_config.sq_apiurl+"api/posts/seo/tasks?callback=?",{user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token}).done(function(response){$this.sq_doneloading("sq_minloading").removeClass("sq_error");if(typeof response.data!=="undefined"&&typeof response.data.tasks!=="undefined"&&$this.find(".sq_tasks").length>0){$this.find(".sq_tasks").append(response.data.tasks);settings.check=eval("sq_check");settings.custom_tag=eval("sq_custom_tag");settings.custom_tag_id=eval("sq_custom_tag_id");settings.single_tag=eval("sq_single_tag");if($.sq_fields.div_blockseo.find("#sq_seo_refresh").length==0){$.sq_fields.div_blockseo.find(".sq_header").append('<span id="sq_seo_refresh" style="float: right; line-height: 22px; text-align: center; width: 64px; height: 22px; background-color: #ff9b00; font-size: 12px; font-weight: bold; color: white; margin: -2px 0; padding: 0px; border: none; cursor: pointer;">Update</span>')}$this.sq_eventsseo.listenHighlight(true);$this.on("seo.refresh",function(){$.sq_fields.div_blockseo.find("#sq_seo_refresh").addClass("sq_minloading");setTimeout(function(){$.sq_fields.div_blockseo.find("#sq_seo_refresh").removeClass("sq_minloading");$this.load()},1e3)});$.sq_fields.div_blockseo.find("#sq_seo_refresh").on("lateclick",function(){$this.trigger("seo.refresh");$this.trigger("seo.refresh_lateclick")});$this.find("#sq_seo_refresh").on("click",function(){$this.trigger("seo.refresh");$this.trigger("seo.refresh_click")});$this.trigger("seo.refresh");$this.trigger("seo.task_loaded")}else{$this.sq_doneloading("sq_minloading").removeClass("sq_error");$this.find(".sq_tasks").html('<div class="sq_message" style="width: 100% !important;">'+$.sq_config.__ajaxerror+"</div>")}}).fail(function(){$.sq_fields.sq_errorloading.show();$.sq_fields.sq_preloading_keyword.hide();$this.sq_doneloading("sq_minloading").removeClass("sq_error");$this.find(".sq_tasks").html('<div class="sq_message" style="width: 100% !important;">'+$.sq_config.__ajaxerror+"</div>")});$this.sq_eventsseo.listenTitle();$this.sq_eventsseo.listenSlug();$this.sq_eventsseo.listenSticky();$.sq_fields.content_tmce.on("click",function(){$.sq_config.editor_type="tinymce"});$.sq_fields.content_html.on("click",function(){$.sq_config.editor_type="html"});$("#save-post,#publish,#post-preview").click(function(){if($.sq_blockbriefcase){$.sq_blockbriefcase.trigger("briefcase.save")}if($.sq_config.editor_type==="tinymce"){var iframe_tinymce=$.sq_editor.getIframeEditor();if(iframe_tinymce!==false)$(iframe_tinymce).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}else{$.sq_removeHighlight($.sq_getBuilderEditorContainer())}if($.sq_config.keyword!==""){$.sq_blocksearch.addTag();$.sq_fields.wp_publish.focus()}});$.sq_fields.wp_input_title.off("click").on("click",function(){if($this.find(".sq_overlay").length>0)if($.sq_fields.sq_keyword.val()!==""){$.sq_config.showInspiration=false;$.sq_fields.sq_selectit.trigger("click")}});if(typeof ET_PageBuilder!=="undefined"&&typeof ET_PageBuilder.Events!=="undefined"){ET_PageBuilder.Events.on("et-pb-loading:ended",function(){$(".et-pb-remove").on("click",function(){SQ_DEBUG&&console.log("Divi Save Pressed");$.sq_fields.div_blockseo.find("#sq_seo_refresh").trigger("lateclick")})});ET_PageBuilder.Events.on("et-modal-settings:save",function(){ET_PageBuilder.Events.on("et-modal-view-removed",function(){SQ_DEBUG&&console.log("Divi Save Pressed");$.sq_fields.div_blockseo.find("#sq_seo_refresh").trigger("lateclick");$(".et-pb-remove").on("click",function(){SQ_DEBUG&&console.log("Divi Save Pressed");$.sq_fields.div_blockseo.find("#sq_seo_refresh").trigger("lateclick")})})})}if($("#visual_composer_content").length>0){if($("div#vc_ui-panel-edit-element").length>0){$("div#vc_ui-panel-edit-element").find("span[data-vc-ui-element=button-save]").on("click",function(){SQ_DEBUG&&console.log("Visual Composer Save");$.sq_fields.div_blockseo.find("#sq_seo_refresh").trigger("lateclick");if($("#visual_composer_content").find(".vc-c-icon-delete_empty").length>0){$("#visual_composer_content").find(".vc-c-icon-delete_empty").on("click",function(){SQ_DEBUG&&console.log("Visual Composer Delete");$.sq_fields.div_blockseo.find("#sq_seo_refresh").trigger("lateclick")})}})}if($("#visual_composer_content").find(".vc-c-icon-delete_empty").length>0){$("#visual_composer_content").find(".vc-c-icon-delete_empty").on("click",function(){SQ_DEBUG&&console.log("Visual Composer Delete");$.sq_fields.div_blockseo.find("#sq_seo_refresh").trigger("lateclick")})}}},listenTinymce:function(){SQ_DEBUG&&console.log("listenTinymce");$.sq_config.editor_type="tinymce";if($.sq_config.interval_seo){clearInterval($.sq_config.interval_seo)}$.sq_config.interval_seo=setInterval(function(){var iframe_tinymce=$.sq_editor.getIframeEditor();if(iframe_tinymce!==false){$.sq_editor.insertHandler=function(e){$.sq_config.active_editor=$(this);if(e.target.nodeName==="IMG"){SQ_DEBUG&&console.log("DOMNodeInserted ",e);$.sq_editor.listen(e);$this.callback()}};$(iframe_tinymce).off("DOMNodeInserted",$.sq_editor.insertHandler).on("DOMNodeInserted",$.sq_editor.insertHandler);$.sq_editor.removeHandler=function(e){$.sq_config.active_editor=$(this);if(e.target.nodeName==="IMG"){SQ_DEBUG&&console.log("DOMNodeRemoved "+e.target.nodeName);$.sq_editor.lastimage="";$this.callback()}};$(iframe_tinymce).off("DOMNodeRemoved",$.sq_editor.removeHandler).on("DOMNodeRemoved",$.sq_editor.removeHandler);$.sq_editor.changeHandler=function(e){$.sq_config.active_editor=$(this);SQ_DEBUG&&console.log(" keyup mouseup ",e.type);if(e.type==="mouseup"){$(this).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}if($.sq_config.timeout_seo){clearTimeout($.sq_config.timeout_seo)}$.sq_config.timeout_seo=setTimeout(function(){if($this.find(".sq_overlay").length>0)if($.sq_fields.sq_keyword.val()!==""){$.sq_config.showInspiration=false;$.sq_fields.sq_selectit.trigger("click")}$this.callback()},$.sq_config.delay_seo)};$(iframe_tinymce).off("keyup mouseup",$.sq_editor.changeHandler).on("keyup mouseup",$.sq_editor.changeHandler);$this.callback();clearInterval($.sq_config.interval_seo);if($.sq_config.active_editor){$.sq_removeHighlight($.sq_getBuilderEditorContainer($.sq_config.active_editor))}}if(typeof $.sq_config.frontend_css!=="undefined"){if($.sq_editor.getIframeEditor("head link[href='"+$.sq_config.frontend_css+"']")===false){var iframe_head=$.sq_editor.getIframeEditor("head");if(iframe_head!==false){iframe_head.append($("<link/>",{rel:"stylesheet",href:$.sq_config.frontend_css,type:"text/css"}))}}}$this.sq_eventsseo.listenFeatureImage()},1e3)},stopListenTinymce:function(){SQ_DEBUG&&console.log("stop listen Tinymce");if($.sq_config.interval_seo){clearInterval($.sq_config.interval_seo)}var iframe_tinymce=$.sq_editor.getIframeEditor();if(iframe_tinymce!==false)$(iframe_tinymce).off("keyup mouseup")},listenHtml:function(){$.sq_config.editor_type="html";$.sq_fields.wp_content.on("click keyup",function(){$.sq_config.active_editor=$(this);if($.sq_config.editor_type==="html"){if($this.timeout_html){clearTimeout($this.timeout_html)}$this.timeout_html=setTimeout(function(){$this.callback()},$.sq_config.delay_seo)}});$.sq_fields.wp_content.on("dragover",false).on("dragenter",false).on("drop",function(e){if($.sq_config.editor_type==="html"){e.preventDefault();$.sq_editor.listenHtml(e)}});$this.sq_eventsseo.listenFeatureImage();$this.sq_eventsseo.listenMediaLibrary()},listenFeatureImage:function(){$("#postimagediv").on("DOMNodeInserted DOMNodeRemoved",function(){$this.checkImage($(this))});$(".editor-post-featured-image").on("DOMNodeInserted DOMNodeRemoved",function(){$this.checkImage($(this))})},listenMediaLibrary:function(){if($.sq_fields.wp_thumbnail_alt.length>0){$.sq_fields.wp_thumbnail_alt.on("keyup",function(){$this.setChecked($this.keywordMatch($.sq_fields.wp_thumbnail_alt.val(),$.sq_config.keyword),"alt")});$this.checkImage($.sq_fields.wp_thumbnail);$this.setChecked($this.keywordMatch($.sq_fields.wp_thumbnail_alt.val(),$.sq_config.keyword),"alt")}},listenVComposer:function(){if($("#visual_composer_content").length>0){var composer=$("#visual_composer_content");if(composer.find("img.attachment-thumbnail").length>0){SQ_DEBUG&&console.log("Visual Composer Image");$this.checkImage($("#visual_composer_content").find("img.attachment-thumbnail").parents(".wpb_content_element:last"))}if(composer.find("ul.attachment-thumbnails").length>0){SQ_DEBUG&&console.log("Visual Composer Galerry");$this.checkImage($("#visual_composer_content").find("ul.attachment-thumbnails"))}if(composer.find(".wpb_vc_custom_heading .admin_label_text").length>0){composer.find(".wpb_vc_custom_heading .admin_label_text").each(function(){if($this.keywordMatch($(this).text(),$.sq_config.keyword)){SQ_DEBUG&&console.log("Visual Composer Headline");return $this.setChecked($this.keywordMatch($(this).text(),$.sq_config.keyword),"h2_6")}})}}},listenFusion:function(){if($(".fusion_module_block_preview").find("img").length>0){SQ_DEBUG&&console.log("Fusion Image Preview");$this.checkImage($(".fusion_module_block_preview").find("img").parents("div:last"))}else if($("img.fusion-child-element-image").length>0){SQ_DEBUG&&console.log("Fusion Image Element");$this.checkImage($("img.fusion-child-element-image").parents("div:last"))}if($(".fusion_module_block_preview").find(".title_text").length>0){$(".fusion_module_block_preview").find(".title_text").each(function(){if($this.keywordMatch($(this).text(),$.sq_config.keyword)){SQ_DEBUG&&console.log("Fusion Headline");return $this.setChecked($this.keywordMatch($(this).text(),$.sq_config.keyword),"h2_6")}})}},stopListenHtml:function(){SQ_DEBUG&&console.log("stop listen HTML");$.sq_fields.wp_content.off("keyup");$.sq_fields.wp_content.off("drop")},listenTitle:function(){SQ_DEBUG&&console.log("listen title");$.sq_fields.wp_input_title.off("keyup change").on("keyup change",function(){$(this).trackLength("wp_title");$.sq_config.manual=true;$.sq_config.silent=false;$.sq_config.briefcase=false;$this.checkWpFields()});if($("#sq_wp_title_info").length==0){$.sq_fields.wp_input_title.after($.sq_fields.sq_wp_title_info)}},listenSlug:function(){var timeout_post_slug=setInterval(function(){if($("#new-post-slug").length>0){clearInterval(timeout_post_slug);$("#new-post-slug").off("keyup").on("keyup",function(){$this.checkKPinguinUrl()});$("#edit-slug-buttons").find("a").on("click",function(){$this.sq_eventsseo.listenSlug()})}},1e3);var timeout_sample_permalink=setInterval(function(){if($("#sample-permalink").length>0){clearInterval(timeout_sample_permalink);if(typeof $.sq_loadFrontMenu!=="undefined"){SQ_DEBUG&&console.log("Reload the Squirrly Snippet");$.sq_loadFrontMenu()}}},1e3)},listenSticky:function(){$this.on("sq_sticky",function(e,on){SQ_DEBUG&&console.log(on);if(on&&$.sq_config.keyword!==""){$.sq_fields.div_blockseo.addClass("sq_sticky");$(".sq_sticky_keyword").html($.sq_fields.sq_keyword.val());$("#submitdiv.postbox").before('<div id="submitdivplace"></div>');$this.after($("#submitdiv.postbox"))}else{$this.parents(".sq_box:last").removeClass("sq_sticky");$("#submitdivplace").after($("#submitdiv.postbox"));$("#submitdivplace").remove()}})},listenHighlight:function(on){if(on){settings.clicked["highlight"]=false;$this.find(".sq_request_highlight_key").parents("li:last").on("click",function(e){e.stopPropagation();settings.clicked["highlight"]=true}).on("mouseenter",function(e){e.stopPropagation();$(this).css("cursor","pointer");if($.sq_config.editor_type==="tinymce"){var iframe_tinymce=$.sq_editor.getIframeEditor();if(iframe_tinymce!==false){$(iframe_tinymce).each(function(){$.sq_highlight($.sq_getBuilderEditorContainer($(this)),$.sq_config.keyword)})}}else{$.sq_highlight($.sq_getBuilderEditorContainer($(this)),$.sq_config.keyword)}}).on("mouseleave",function(){if($.sq_config.editor_type==="tinymce"){if(!settings.clicked["highlight"]){var iframe_tinymce=$.sq_editor.getIframeEditor();if(iframe_tinymce!==false)$(iframe_tinymce).each(function(){$.sq_removeHighlight($.sq_getBuilderEditorContainer($(this)))})}}else{$.sq_removeHighlight($.sq_getBuilderEditorContainer())}})}else{$this.find(".sq_request_highlight_key").parents("li:last").off()}}};$this.one("seo.loaded",function(){SQ_DEBUG&&console.log("sq_blockseo seo.loaded");if(!$.sq_config.subscription_active){return}if(!$.sq_isGutenberg()&&!$.sq_isFrontend()){if($.sq_fields.wp_content_wrap.length>0&&$.sq_fields.wp_content_wrap.attr("class").indexOf("html-active")!==-1){SQ_DEBUG&&console.log("seo.loaded listenHTML");$this.sq_eventsseo.listenHtml();$.sq_config.active_editor=$.sq_fields.wp_content}else{SQ_DEBUG&&console.log("seo.loaded listenTinymce");$this.sq_eventsseo.listenTinymce();$.sq_config.active_editor=$.sq_editor.getIframeEditor()}}else if($.sq_isGutenberg()){wp.data.subscribe(function(){var ed=$.sq_editor.getBlockEditor("select");if(ed&&ed.isTyping){if($.sq_config.timeout_seo){clearTimeout($.sq_config.timeout_seo)}$.sq_config.timeout_seo=setTimeout(function(){$this.callback()},$.sq_config.delay_seo)}if(ed&&ed.isSavingPost()&&!ed.isAutosavingPost()){if($.sq_floating){if($.sq_config.timeout_save){clearTimeout($.sq_config.timeout_save)}$.sq_config.timeout_save=setTimeout(function(){$.sq_floating.trigger("seo.floating.page_saved")},$.sq_config.delay_seo)}}})}$this.sq_loading();$this.one("seo.keyword_loaded",function(){$this.sq_eventsseo.listen()})});return $this};$.fn.trackLength=function(type){var $this=this;var min=0;var max=0;var color="green";if(typeof $this==="undefined")return;if(type==="title"||type==="wp_title"){min=$.sq_params.min_length_title;max=$.sq_params.max_length_title}else if(type==="description"){min=$.sq_params.min_length_description;max=$.sq_params.max_length_description}if(min>0&&min>$this.val().length){color="red"}else if(max>0&&max<$this.val().length){color="red"}else{color="green"}if(max>0){$("#sq_"+type+"_info").html($this.val().length+"/"+max);$("#sq_"+type+"_info").css("color",color)}}})(jQuery);
view/assets/js/assistant/sq_briefcase.min.js CHANGED
@@ -1 +1 @@
1
- (function($){$.fn.sq_briefcase=function(options){var $this=this;var settings=$.extend({briefcase_keywords:[],optimizations:[],getapi:false,gettimeout:false,loaded:false,tmpk:false},options);$.sq_fields=$.extend({sq_briefcase:$.sq_config.div.find("#sq_briefcase"),sq_briefcase_help:$.sq_config.div.find("#sq_briefcase_help"),sq_keywords_briefcase:$this.find("#sq_keywords_briefcase"),sq_briefcase_content:$this.find("#sq_briefcase_content"),sq_briefcase_keyword:$this.find("#sq_briefcase_keyword"),sq_briefcase_close:$this.find("#sq_briefcase_close")},$.sq_fields);$this.init=function(){settings.loaded=true;$this.show();$.sq_fields.sq_briefcase_keyword.val("");$this.get()};$this.get=function(search,circles){$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_notused").sq_loading();labels=[];if(typeof circles!=="undefined"){circles.each(function(){labels.push($(this).data("id"))})}settings.getapi=$.ajax({url:$.sq_config.sq_apiurl+"api/briefcase/optimize/get?callback=?",type:"GET",dataType:"json",data:{post_id:$.sq_config.postID,search:search,label:labels.length>0?labels.join(","):"",return:"html",user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token},success:function(response){if(typeof response.data.briefcase!=="undefined"){$this.loadList(response.data.briefcase)}else{if(typeof search==="undefined"||search===""){$.sq_fields.sq_briefcase_content.html($.sq_config.__no_briefcase).addClass("sq_error")}}if(typeof search!=="undefined"&&search!==""){$.sq_fields.sq_briefcase_keyword.focus()}$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_notused").sq_doneloading();$this.trigger("briefcase.after_get")},error:function(){$.sq_fields.sq_errorloading.show();$.sq_fields.sq_preloading_keyword.hide();$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_notused").sq_doneloading()}})};$this.optimize=function(keyword){$.ajax({url:$.sq_config.sq_apiurl+"api/briefcase/optimize/add?callback=?",type:"GET",dataType:"json",data:{post_id:$.sq_config.postID,keyword:keyword,user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token},success:function(response){$this.get($.sq_fields.sq_briefcase_keyword.val(),$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle.sq_active"))},error:function(){$.sq_fields.sq_briefcase_content.html("Lost connection with the server. Please make sure you whitelisted the IP from https://api.squirrly.co").addClass("sq_error")}})};$this.blink=function($obj,$times){if(typeof $times==="undefined")$times=0;if($times>3)return;$obj.animate({opacity:0},150,"linear",function(){$(this).animate({opacity:1},150,"linear",function(){$this.blink($obj,$times+1)})})};$this.delete=function(id){$.ajax({url:$.sq_config.sq_apiurl+"api/briefcase/optimize/delete?callback=?",type:"GET",dataType:"json",data:{id:id,user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token},success:function(response){$this.get($.sq_fields.sq_briefcase_keyword.val(),$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle.sq_active"))},error:function(){$.sq_fields.sq_briefcase_content.html("Lost connection with the server. Please make sure you whitelisted the IP from https://api.squirrly.co").addClass("sq_error")}})};$this.loadList=function(briefcase){$.sq_fields.sq_briefcase_content.before($.sq_fields.sq_briefcase_keyword);$.sq_fields.sq_briefcase_content.html(briefcase).removeClass("sq_error");$.sq_fields.sq_briefcase_content.find("ul.sq_briefcase_item_used").after($.sq_fields.sq_briefcase_keyword);if(typeof $.sq_config.lsi!=="undefined"){$.each($.sq_config.lsi,function(key,value){if(value.main){$.sq_fields.sq_keyword.val(value.keyword)}})}$.sq_fields.sq_briefcase_keyword.show();$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_circles").show();var $briefcase_empty=$.sq_fields.sq_briefcase_content.find("ul.sq_briefcase_item_notused").find(".sq_briefcase_empty");if($briefcase_empty.length>0){$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_circles").hide();if($.sq_fields.sq_briefcase_keyword.val()!==""||$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle.sq_active").length>0){$briefcase_empty.append('<div style="color: #6200EE; padding: 3px; cursor: pointer;" ><i class="fa-solid fa-plus-circle" ></i> add this keyword</div>');$briefcase_empty.on("click",function(){$this.optimize($.sq_fields.sq_briefcase_keyword.val())})}}$this.setEvents();$this.setMainKeyword($.sq_fields.sq_keyword.val())};$this.setMainKeyword=function(keyword){if(typeof $.sq_fields.sq_briefcase_content!=="undefined"){if($.sq_fields.sq_briefcase_content.find("li.sq_briefcase_item_used").length>0){$.sq_fields.sq_briefcase_content.find("li.sq_briefcase_item_used").removeClass("sq_main_keyword");$.sq_fields.sq_briefcase_content.find("li.sq_briefcase_item_used").each(function(){if(keyword===""||keyword===$(this).find(".sq_briefcase_value").text()){$(this).addClass("sq_main_keyword");$("#sq_nokeyword").hide();$(".sq_keyword").show();$.sq_fields.sq_keyword.val($(this).find(".sq_briefcase_value").text());$.sq_fields.sq_keyword_score.html($(this).find(".sq_briefcase_item_percent").text());return false}});$("#sq_nokeyword").hide();$(".sq_keyword").show()}}$.sq_fields.sq_selectit.trigger("click")};$this.getColor=function(value){var hue=value.toString();return["hsl(",hue,",71%,43%)"].join("")};$this.setColor=function(obj,value){return;obj.css("color",$this.getColor(value));obj.css("font-weight","bold")};$this.setEvents=function(){$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_delete").on("click",function(){$this.delete($(this).data("id"))});$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_used").find(".sq_briefcase_value").on("click",function(){$this.setMainKeyword($(this).text())});$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle").on("click",function(){if($(this).hasClass("sq_active")){$(this).removeClass("sq_active")}else{$(this).addClass("sq_active")}$this.get($.sq_fields.sq_briefcase_keyword.val(),$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle.sq_active"))});$this.find(".sq_briefcase_optimize").on("click",function(){$this.optimize($(this).data("value"))});$this.checkKeywords()};$this.setOptimizations=function(){$.sq_config.silent=true;$.sq_config.briefcase=true;settings.show_addtobriefcasebutton=true;settings.tmpk=$.sq_config.keyword;settings.optimizations=[];if($.sq_fields.sq_briefcase_content.find("li.sq_briefcase_item_used").length>0){$.sq_fields.sq_briefcase_content.find("li.sq_briefcase_item_used").each(function(){$.sq_config.keyword=$(this).find(".sq_briefcase_value").text();if($.sq_fields.sq_keyword.val()===$(this).find(".sq_briefcase_value").text()){settings.show_addtobriefcasebutton=false}$.sq_fields.div_blockseo=$.sq_config.div.find("#sq_blockseo_briefcase");$.sq_fields.div_blockseo.find("li").removeClass("checked");$.sq_fields.div_blockseo.find("input").remove();$.sq_blockseo.checkWpFields();$.sq_blockseo.checkSEO();var completed=$.sq_blockseo.getPercentCompleted();if(completed){$(this).find(".sq_briefcase_item_percent").html(parseInt(completed)+"%");$this.setColor($(this).find(".sq_briefcase_value"),parseInt(completed));if($.sq_fields.sq_keyword.val()===$(this).find(".sq_briefcase_value").text()){$.sq_fields.sq_keyword_score.html(parseInt(completed)+"%")}}$(this).attr("data-position",parseInt(completed));settings.optimizations.push({keyword:$(this).find(".sq_briefcase_value").html(),score:completed,main:$(this).hasClass("sq_main_keyword")})});$.sq_fields.div_blockseo=$.sq_config.div.find("#sq_blockseo");$.sq_config.keyword=settings.tmpk}else{settings.show_addtobriefcasebutton=true}return settings.optimizations};$this.checkKeywords=function(){if($.sq_config.div.find("#sq_blockseo_briefcase").length==0){$.sq_fields.div_blockseo.after($.sq_fields.div_blockseo.clone().prop("id","sq_blockseo_briefcase").hide())}$this.setOptimizations();$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_used").find(".sq_briefcase_separator").attr("data-position",-2);$.sq_fields.sq_briefcase_content.find("ul.sq_briefcase_item_used li").sort($this.sortList).appendTo($.sq_fields.sq_briefcase_content.find("ul.sq_briefcase_item_used"));if(settings.show_addtobriefcasebutton){if($.sq_fields.wp_publish.find("#sq_publish_alert").length==0){$("#sq_publish_alert_briefcase").find("#sq_addtobriefcase").show()}}};$this.sortList=function(a,b){return $(b).data("position")<$(a).data("position")?-1:1};$this.sendOptimization=function(){$this.setOptimizations();if(settings.optimizations.length){$.ajax({url:$.sq_config.sq_apiurl+"api/briefcase/optimize/save?callback=?",type:"GET",dataType:"json",data:{post_id:$.sq_config.postID,optimizations:JSON.stringify(settings.optimizations),user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token}})}};$this.listen=function(){$.sq_fields.sq_briefcase_keyword.on("keypress",function(event){if(event.keyCode===$.ui.keyCode.ENTER){clearTimeout(settings.gettimeout);settings.getapi.abort();$this.get($.sq_fields.sq_briefcase_keyword.val(),$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle.sq_active"));return false}});$.sq_fields.sq_briefcase_keyword.on("keyup",function(event){if(event.keyCode!==$.ui.keyCode.ENTER){clearTimeout(settings.gettimeout);settings.getapi.abort();settings.gettimeout=setTimeout(function(){$this.get($.sq_fields.sq_briefcase_keyword.val(),$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle.sq_active"))},1e3)}});$this.on("briefcase.save",function(){$this.sendOptimization()})};$this.one("seo.loaded",function(){SQ_DEBUG&&console.log("sq_briefcase seo.loaded");if(!$.sq_config.subscription_active){return}$this.listen();$.sq_blockseo.on("seo.task_loaded",function(){$this.get()});$.sq_blockseo.on("seo.callback",function(){$this.checkKeywords()});setInterval(function(){$this.trigger("briefcase.save")},3e4);$this.on("briefcase.refresh",function(){SQ_DEBUG&&console.log("sq_briefcase refresh");$this.init(false)});$this.trigger("briefcase.refresh")});return $this}})(jQuery);
1
+ (function($){$.fn.sq_briefcase=function(options){var $this=this;var settings=$.extend({briefcase_keywords:[],optimizations:[],getapi:false,gettimeout:false,loaded:false,tmpk:false},options);$.sq_fields=$.extend({sq_briefcase:$.sq_config.div.find("#sq_briefcase"),sq_briefcase_help:$.sq_config.div.find("#sq_briefcase_help"),sq_keywords_briefcase:$this.find("#sq_keywords_briefcase"),sq_briefcase_content:$this.find("#sq_briefcase_content"),sq_briefcase_keyword:$this.find("#sq_briefcase_keyword"),sq_briefcase_close:$this.find("#sq_briefcase_close")},$.sq_fields);$this.init=function(){settings.loaded=true;$this.show();$.sq_fields.sq_briefcase_keyword.val("");$this.get()};$this.get=function(search,circles){$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_notused").sq_loading();labels=[];if(typeof circles!=="undefined"){circles.each(function(){labels.push($(this).data("id"))})}settings.getapi=$.ajax({url:$.sq_config.sq_apiurl+"api/briefcase/optimize/get?callback=?",type:"GET",dataType:"json",data:{post_id:$.sq_config.postID,search:search,label:labels.length>0?labels.join(","):"",return:"html",user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token},success:function(response){if(typeof response.data.briefcase!=="undefined"){$this.loadList(response.data.briefcase)}else{if(typeof search==="undefined"||search===""){$.sq_fields.sq_briefcase_content.html($.sq_config.__no_briefcase).addClass("sq_error")}}if(typeof search!=="undefined"&&search!==""){$.sq_fields.sq_briefcase_keyword.focus()}$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_notused").sq_doneloading();$this.trigger("briefcase.after_get")},error:function(){$.sq_fields.sq_errorloading.show();$.sq_fields.sq_preloading_keyword.hide();$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_notused").sq_doneloading()}})};$this.optimize=function(keyword){$.ajax({url:$.sq_config.sq_apiurl+"api/briefcase/optimize/add?callback=?",type:"GET",dataType:"json",data:{post_id:$.sq_config.postID,keyword:keyword,user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token},success:function(response){$this.get($.sq_fields.sq_briefcase_keyword.val(),$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle.sq_active"))},error:function(){$.sq_fields.sq_briefcase_content.html("Lost connection with the server. Please make sure you whitelisted the IP from https://api.squirrly.co").addClass("sq_error")}})};$this.blink=function($obj,$times){if(typeof $times==="undefined")$times=0;if($times>3)return;$obj.animate({opacity:0},150,"linear",function(){$(this).animate({opacity:1},150,"linear",function(){$this.blink($obj,$times+1)})})};$this.delete=function(id){$.ajax({url:$.sq_config.sq_apiurl+"api/briefcase/optimize/delete?callback=?",type:"GET",dataType:"json",data:{id:id,user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token},success:function(response){$this.get($.sq_fields.sq_briefcase_keyword.val(),$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle.sq_active"))},error:function(){$.sq_fields.sq_briefcase_content.html("Lost connection with the server. Please make sure you whitelisted the IP from https://api.squirrly.co").addClass("sq_error")}})};$this.loadList=function(briefcase){$.sq_fields.sq_briefcase_content.before($.sq_fields.sq_briefcase_keyword);$.sq_fields.sq_briefcase_content.html(briefcase).removeClass("sq_error");$.sq_fields.sq_briefcase_content.find("ul.sq_briefcase_item_used").after($.sq_fields.sq_briefcase_keyword);if(typeof $.sq_config.lsi!=="undefined"){$.each($.sq_config.lsi,function(key,value){if(value.main){$.sq_fields.sq_keyword.val(value.keyword)}})}$.sq_fields.sq_briefcase_keyword.show();$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_circles").show();var $briefcase_empty=$.sq_fields.sq_briefcase_content.find("ul.sq_briefcase_item_notused").find(".sq_briefcase_empty");if($briefcase_empty.length>0){$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_circles").hide();if($.sq_fields.sq_briefcase_keyword.val()!==""||$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle.sq_active").length>0){$briefcase_empty.append('<div style="color: #6200EE; padding: 3px; cursor: pointer;" ><i class="fa-solid fa-plus-circle" ></i> add this keyword</div>');$briefcase_empty.on("click",function(){$this.optimize($.sq_fields.sq_briefcase_keyword.val())})}}$this.setEvents();$this.setMainKeyword($.sq_fields.sq_keyword.val())};$this.setMainKeyword=function(keyword){if(typeof $.sq_fields.sq_briefcase_content!=="undefined"){if($.sq_fields.sq_briefcase_content.find("li.sq_briefcase_item_used").length>0){$.sq_fields.sq_briefcase_content.find("li.sq_briefcase_item_used").removeClass("sq_main_keyword");$.sq_fields.sq_briefcase_content.find("li.sq_briefcase_item_used").each(function(){if(keyword===""||$.sq_strEqual(keyword,$(this).find(".sq_briefcase_value").text())){$(this).addClass("sq_main_keyword");$("#sq_nokeyword").hide();$(".sq_keyword").show();$.sq_fields.sq_keyword.val($(this).find(".sq_briefcase_value").text());$.sq_fields.sq_keyword_score.html($(this).find(".sq_briefcase_item_percent").text());return false}});$("#sq_nokeyword").hide();$(".sq_keyword").show()}}$.sq_fields.sq_selectit.trigger("click")};$this.getColor=function(value){var hue=value.toString();return["hsl(",hue,",71%,43%)"].join("")};$this.setColor=function(obj,value){return;obj.css("color",$this.getColor(value));obj.css("font-weight","bold")};$this.setEvents=function(){$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_delete").on("click",function(){$this.delete($(this).data("id"))});$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_used").find(".sq_briefcase_value").on("click",function(){$this.setMainKeyword($(this).text())});$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle").on("click",function(){if($(this).hasClass("sq_active")){$(this).removeClass("sq_active")}else{$(this).addClass("sq_active")}$this.get($.sq_fields.sq_briefcase_keyword.val(),$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle.sq_active"))});$this.find(".sq_briefcase_optimize").on("click",function(){$this.optimize($(this).data("value"))});$this.checkKeywords()};$this.setOptimizations=function(){$.sq_config.silent=true;$.sq_config.briefcase=true;settings.show_addtobriefcasebutton=true;settings.tmpk=$.sq_config.keyword;settings.optimizations=[];if($.sq_fields.sq_briefcase_content.find("li.sq_briefcase_item_used").length>0){$.sq_fields.sq_briefcase_content.find("li.sq_briefcase_item_used").each(function(){$.sq_config.keyword=$(this).find(".sq_briefcase_value").text();if($.sq_strEqual($.sq_fields.sq_keyword.val(),$(this).find(".sq_briefcase_value").text())){settings.show_addtobriefcasebutton=false}$.sq_fields.div_blockseo=$.sq_config.div.find("#sq_blockseo_briefcase");$.sq_fields.div_blockseo.find("li").removeClass("checked");$.sq_fields.div_blockseo.find("input").remove();$.sq_blockseo.checkWpFields();$.sq_blockseo.checkSEO();var completed=$.sq_blockseo.getPercentCompleted();if(completed){$(this).find(".sq_briefcase_item_percent").html(parseInt(completed)+"%");$this.setColor($(this).find(".sq_briefcase_value"),parseInt(completed));if($.sq_strEqual($.sq_fields.sq_keyword.val(),$(this).find(".sq_briefcase_value").text())){$.sq_fields.sq_keyword_score.html(parseInt(completed)+"%")}}$(this).attr("data-position",parseInt(completed));settings.optimizations.push({keyword:$(this).find(".sq_briefcase_value").html(),score:completed,main:$(this).hasClass("sq_main_keyword")})});$.sq_fields.div_blockseo=$.sq_config.div.find("#sq_blockseo");$.sq_config.keyword=settings.tmpk}else{settings.show_addtobriefcasebutton=true}return settings.optimizations};$this.checkKeywords=function(){if($.sq_config.div.find("#sq_blockseo_briefcase").length==0){$.sq_fields.div_blockseo.after($.sq_fields.div_blockseo.clone().prop("id","sq_blockseo_briefcase").hide())}$this.setOptimizations();$.sq_fields.sq_briefcase_content.find(".sq_briefcase_item_used").find(".sq_briefcase_separator").attr("data-position",-2);$.sq_fields.sq_briefcase_content.find("ul.sq_briefcase_item_used li").sort($this.sortList).appendTo($.sq_fields.sq_briefcase_content.find("ul.sq_briefcase_item_used"));if(settings.show_addtobriefcasebutton){if($.sq_fields.wp_publish.find("#sq_publish_alert").length==0){$("#sq_publish_alert_briefcase").find("#sq_addtobriefcase").show()}}};$this.sortList=function(a,b){return $(b).data("position")<$(a).data("position")?-1:1};$this.sendOptimization=function(){$this.setOptimizations();if(settings.optimizations.length){$.ajax({url:$.sq_config.sq_apiurl+"api/briefcase/optimize/save?callback=?",type:"GET",dataType:"json",data:{post_id:$.sq_config.postID,optimizations:JSON.stringify(settings.optimizations),user_url:$.sq_config.user_url,token:$.sq_config.token,url_token:$.sq_config.url_token}})}};$this.listen=function(){$.sq_fields.sq_briefcase_keyword.on("keypress",function(event){if(event.keyCode===$.ui.keyCode.ENTER){clearTimeout(settings.gettimeout);settings.getapi.abort();$this.get($.sq_fields.sq_briefcase_keyword.val(),$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle.sq_active"));return false}});$.sq_fields.sq_briefcase_keyword.on("keyup",function(event){if(event.keyCode!==$.ui.keyCode.ENTER){clearTimeout(settings.gettimeout);settings.getapi.abort();settings.gettimeout=setTimeout(function(){$this.get($.sq_fields.sq_briefcase_keyword.val(),$.sq_fields.sq_briefcase_content.find(".sq_briefcase_circle.sq_active"))},1e3)}});$this.on("briefcase.save",function(){$this.sendOptimization()})};$this.one("seo.loaded",function(){SQ_DEBUG&&console.log("sq_briefcase seo.loaded");if(!$.sq_config.subscription_active){return}$this.listen();$.sq_blockseo.on("seo.task_loaded",function(){$this.get()});$.sq_blockseo.on("seo.callback",function(){$this.checkKeywords()});setInterval(function(){$this.trigger("briefcase.save")},3e4);$this.on("briefcase.refresh",function(){SQ_DEBUG&&console.log("sq_briefcase refresh");$this.init(false)});$this.trigger("briefcase.refresh")});return $this}})(jQuery);
view/assets/js/assistant/sq_floating.min.js CHANGED
@@ -1 +1 @@
1
- (function($){$.fn.sq_floating=function(options){var $this=this;var settings=$.extend({positions:[],minimize_height:60,maximize_height:100,top:53,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.find("#sq_options").remove();$.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();if($("#editor").length){$("#editor").prepend($.sq_config.div);if($(".edit-post-header").length){settings.top=$(".edit-post-header").height();if($("#wpadminbar").is(":visible")){settings.top+=$("#wpadminbar").height()}}}else{$("#wpbody").prepend($.sq_config.div)}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_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")});$.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.removeClass("minimized");$.sq_fields.sq_box_minimize.show();$.sq_fields.sq_box_maximize.hide()}});$.sq_fields.sq_keyword.on("click",function(){if($.sq_config.div.hasClass("minimized")){$.sq_fields.sq_box_maximize.trigger("click")}});$(".editor-writing-flow").css("height","auto");if($.sq_getCookie("sq_sla")==="off"){$.sq_fields.sq_box_close.trigger("click")}$(window).resize(function(){if($.sq_config.div.is(":slaoffscreen")){$.sq_config.div.css("left","auto");$.sq_config.div.css("right","0px")}})};$this.one("seo.loaded",function(){if($(".editor-post-title").find("textarea").length>0){$.sq_fields.wp_input_title=$(".editor-post-title").find("textarea")}else if($("h1.wp-block-post-title").length&&!$("#title").length){var $h1title=$("h1.wp-block-post-title");$.sq_fields.wp_input_title=$('<textarea id="title" style="display: none">'+$h1title.html()+"</textarea>");$h1title.after($.sq_fields.wp_input_title);$h1title.on("DOMSubtreeModified",function(){$.sq_fields.wp_input_title.val($h1title.html())})}$this.on("seo.floating.page_saved",function(){$.sq_savePost()});$.sq_editor.createEditorButton("components-squirrly-icon");$.sq_blocksearch.on("seo.published_alert",function(){$("#sq_publish_alert_yes").on("click",function(){$.sq_fields.sq_box_maximize.trigger("click")})});$(".components-squirrly-icon").on("click",function(){if($.sq_config.div.is(":visible")){$.sq_config.div.hide();$.sq_setCookie("sq_sla","off")}else{$.sq_config.div.show();$.sq_setCookie("sq_sla","on")}})});if($.sq_config.div.is(":slaoffscreen")){$.sq_config.div.css("left","auto");$.sq_config.div.css("right","0px")}return $this}})(jQuery);
1
+ (function($){$.fn.sq_floating=function(options){var $this=this;var settings=$.extend({positions:[],minimize_height:60,maximize_height:100,top:53,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.find("#sq_options").remove();$.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();if($("#editor").length){$("#editor").prepend($.sq_config.div);if($(".edit-post-header").length){settings.top=$(".edit-post-header").height();if($("#wpadminbar").is(":visible")){settings.top+=$("#wpadminbar").height()}}}else{$("#wpbody").prepend($.sq_config.div)}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_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")});$.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.removeClass("minimized");$.sq_fields.sq_box_minimize.show();$.sq_fields.sq_box_maximize.hide()}});$.sq_fields.sq_keyword.on("click",function(){if($.sq_config.div.hasClass("minimized")){$.sq_fields.sq_box_maximize.trigger("click")}});$(".editor-writing-flow").css("height","auto");if($.sq_getCookie("sq_sla")==="off"){$.sq_fields.sq_box_close.trigger("click")}$(window).resize(function(){if($.sq_config.div.is(":slaoffscreen")){$.sq_config.div.css("left","auto");$.sq_config.div.css("right","0px")}})};$this.one("seo.loaded",function(){if($(".editor-post-title").find("textarea").length>0){$.sq_fields.wp_input_title=$(".editor-post-title").find("textarea")}else if($("h1.wp-block-post-title").length&&!$("#title").length){var $h1title=$("h1.wp-block-post-title");$.sq_fields.wp_input_title=$('<textarea id="title" style="display: none">'+$h1title.html()+"</textarea>");$h1title.after($.sq_fields.wp_input_title);$h1title.on("DOMSubtreeModified",function(){$.sq_fields.wp_input_title.val($h1title.html())})}$this.on("seo.floating.page_saved",function(){$.sq_savePost()});$.sq_editor.createEditorButton("components-squirrly-icon");$.sq_blocksearch.on("seo.published_alert",function(){$("#sq_publish_alert_yes").on("click",function(){$.sq_fields.sq_box_maximize.trigger("click")})});$(".components-squirrly-icon").off("click").on("click",function(){if($.sq_config.div.is(":visible")){$.sq_config.div.hide();$.sq_setCookie("sq_sla","off")}else{$.sq_config.div.show();$.sq_setCookie("sq_sla","on")}})});if($.sq_config.div.is(":slaoffscreen")){$.sq_config.div.css("left","auto");$.sq_config.div.css("right","0px")}return $this}})(jQuery);
view/assets/js/assistant/sq_frontend.min.js CHANGED
@@ -1 +1 @@
1
- (function($){$.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.one("seo.loaded",function(){SQ_DEBUG&&console.log("sq_frontend seo.loaded");if($.sq_config.referer==="frontend"&&!$.sq_isFrontend()){$.sq_config.div.find("#sq_blocksearch").html('<div style="font-size: 13px; padding: 0px 5px; margin: 0; min-height: 140px; line-height: 20px; background-color: antiquewhite; text-align: center;">'+$.sq_config.__frontend_optimized+"</div>");$.sq_config.div.find(".sq_box:first").show();$.sq_config.div.find(".sq_box:last").remove();$.sq_config.div.find("#sq_briefcase_icon").remove();$.sq_config.div.find("#sq_briefcase_topcontent").remove();$.sq_config.div.find(".sq_box_minimize").remove();$.sq_config.div.find(".sq_box_maximize").remove();$.sq_config.div.find("#sq_blockseo").remove();$.sq_config.div.find("#sq_research").remove()}if($.sq_isFrontend()){var dragposition="";$.sq_config.div.find("#sq_options").remove();$.sq_editor.createEditorButton("components-squirrly-icon");$.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();$.sq_config.div.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_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");$(".components-squirrly-icon").show()});$.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.removeClass("minimized");$.sq_fields.sq_box_minimize.show();$.sq_fields.sq_box_maximize.hide()}});$(".editor-writing-flow").css("height","auto");$(window).resize(function(){if($.sq_config.div.is(":slaoffscreen")){$.sq_config.div.css("left","auto");$.sq_config.div.css("right","0px")}});$(".components-squirrly-icon").on("click",function(){$.sq_fields.sq_box_maximize.trigger("click");$.sq_setCookie("sq_sla","on");$(".components-squirrly-icon").hide()});$this.one("seo.frontend.content_loaded",function(){$this.sq_listenBuilderChange()});$this.sq_VisualBuilder()}});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(sqQuery.ajaxurl,{action:"sq_ajax_save_post",post_id:$.sq_config.postID,sq_keyword:$.sq_config.keyword,referer:"frontend",sq_seo:$sq_seo,sq_nonce:sqQuery.nonce})}SQ_DEBUG&&console.log("seo.frontend.page_saved DONE")});$this.checkPostAjax=function(){return $.post(sqQuery.ajaxurl,{action:"sq_ajax_get_post",post_id:$.sq_config.postID,sq_nonce:sqQuery.nonce}).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:"#page"},WPBakery:{enabled:true,name:"WPBakery",hasIframe:true,iframeSelector:"#vc_inline-frame",parrentDiv:"#vc_editor"},beaver:{enabled:true,name:"beaver",hasIframe:false,iframeSelector:"#vc_inline-frame",parrentDiv:".fl-builder"},liveComposer:{enabled:true,name:"liveComposer",hasIframe:true,iframeSelector:"#page-builder-frame",parrentDiv:".fl-builder"},divi:{enabled:true,name:"diviBuilder",hasIframe:true,iframeSelector:"#et-fb-app-frame",parrentDiv:".et_divi_builder"}};var pageData={url:"",title:"",content:"",h1:"",headline:"",hasMultipleH1:false,images:""};var builderSelectorsSettings={wrapper:"",preview:"",sections:"",h1:"",container:"",containerWidget:"",containerWidgetImages:"",saveButton:""};var currentNumberOfNodes=null;$this.init=function(){SQ_DEBUG&&console.log("checkBuilderExists");$this.checkBuilderExists();if($this.getBuilderExists()){$this.parseBuilders()}};$this.parseBuilders=function(){switch($this.getBuilderName()){case"elementor":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseElementor();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)){$(builder.iframeSelector).load(function(){$this.setBuilderExists(builder.name);$builderContents=$(builder.iframeSelector).contents()[0];$this.parseBuilders()});$(builder.iframeSelector).ready(function(){$this.setBuilderExists(builder.name);$builderContents=$(builder.iframeSelector).contents()[0];$this.parseBuilders()});return false}}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)}$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)}if($element=$this.elementExists(selector,where)){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={wrapper:["#elementor-editor-wrapper"],preview:["#elementor-preview-iframe"],sections:["section.elementor-element"],title:["h1.entry-title","h1.elementor-heading-title"],header:["h2.entry-title","h2.elementor-heading-title","h3.entry-title","h3.elementor-heading-title","h4.entry-title","h4.elementor-heading-title"],container:[".entry-content",".elementor-inner",".elementor-container"],containerWidget:"[data-element_type='widget'] .elementor-widget-container",containerWidgetImages:[".wp-block-image",".elementor-image",".featured-media-inner"],saveButton:"#elementor-panel-saver-button-publish",draftButton:"#elementor-panel-footer-sub-menu-item-save-draft"};$.each(builderSelectorsSettings.title,function(index,value){if($this.elementExists(value,$builderContents)){$this.setPageTitle($($builderContents).find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.elementExists(value,$builderContents)){$this.setPageHeadline($($builderContents).find(value+":first").text())}});$.each(builderSelectorsSettings.container,function(index,value){$this.waitForElementToDisplay(value,$builderContents,$.sq_config.delay_seo,function(){var $elementorWidgets=$($builderContents).find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$(builderSelectorsSettings.title).each(function(index,val){$element.find(val).remove()});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}})});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);$this.trigger("seo.frontend.content_loaded")})});$.each(builderSelectorsSettings.preview,function(index,value){$this.waitForElementToDisplay(value,$(document),$.sq_config.delay_seo,function(){$this.setPageURL($(value).attr("src").split("?")[0]);$this.trigger("seo.frontend.preview_loaded")})});$.each(builderSelectorsSettings.wrapper,function(index,value){$this.waitForElementToDisplay(value,$(document),$.sq_config.delay_seo,function(){$this.trigger("seo.frontend.wrapper_loaded")})})};$this.setBuilderExists=function(builderName){builderExists=true;builderInUse=builderName};$this.getBuilderExists=function(){return builderExists};$this.getBuilderName=function(){return builderInUse};$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()}});$(document).on("click","div",function(){if("#"+$(this).attr("id")===builderSelectorsSettings.draftButton){$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()}},1e3);$this.init();window.sq_editor=$this;$this.trigger("seo.frontend.editor_loaded");return $this}})(jQuery);
1
+ (function($){$.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.one("seo.loaded",function(){SQ_DEBUG&&console.log("sq_frontend seo.loaded");if($.sq_config.referer==="frontend"&&!$.sq_isFrontend()){var sq_header=$.sq_fields.sq_box.find(".sq_header");$.sq_fields.sq_box.html('<div style="font-size: 13px; padding: 2px; margin: 0; line-height: 19px; text-align: center;">'+$.sq_config.__frontend_optimized+"</div>");$.sq_fields.sq_box.prepend(sq_header);$.sq_fields.sq_box.find(".sq_box_maximize").hide();$.sq_fields.sq_box.find(".sq_box_close").on("click",function(){$.sq_config.div.hide();$.sq_setCookie("sq_sla","off")});$.sq_config.div.show();setTimeout(function(){$.sq_config.div.hide()},5e3)}if($.sq_isFrontend()){var dragposition="";$.sq_config.div.find("#sq_options").remove();$.sq_editor.createEditorButton("components-squirrly-icon");$.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();$.sq_config.div.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_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");$(".components-squirrly-icon").show()});$.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.removeClass("minimized");$.sq_fields.sq_box_minimize.show();$.sq_fields.sq_box_maximize.hide()}});$(".editor-writing-flow").css("height","auto");$(window).resize(function(){if($.sq_config.div.is(":slaoffscreen")){$.sq_config.div.css("left","auto");$.sq_config.div.css("right","0px")}});$(".components-squirrly-icon").on("click",function(){$.sq_fields.sq_box_maximize.trigger("click");$.sq_setCookie("sq_sla","on");$(".components-squirrly-icon").hide()});$this.one("seo.frontend.content_loaded",function(){$this.sq_listenBuilderChange()});$this.sq_VisualBuilder()}});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(sqQuery.ajaxurl,{action:"sq_ajax_save_post",post_id:$.sq_config.postID,sq_keyword:$.sq_config.keyword,referer:"frontend",sq_seo:$sq_seo,sq_nonce:sqQuery.nonce})}SQ_DEBUG&&console.log("seo.frontend.page_saved DONE")});$this.checkPostAjax=function(){return $.post(sqQuery.ajaxurl,{action:"sq_ajax_get_post",post_id:$.sq_config.postID,sq_nonce:sqQuery.nonce}).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:"#page"},WPBakery:{enabled:true,name:"WPBakery",hasIframe:true,iframeSelector:"#vc_inline-frame",parrentDiv:"#vc_editor"},beaver:{enabled:true,name:"beaver",hasIframe:false,iframeSelector:"#vc_inline-frame",parrentDiv:".fl-builder"},liveComposer:{enabled:true,name:"liveComposer",hasIframe:true,iframeSelector:"#page-builder-frame",parrentDiv:".fl-builder"},divi:{enabled:true,name:"diviBuilder",hasIframe:true,iframeSelector:"#et-fb-app-frame",parrentDiv:".et_divi_builder"}};var pageData={url:"",title:"",content:"",h1:"",headline:"",hasMultipleH1:false,images:""};var builderSelectorsSettings={wrapper:"",preview:"",sections:"",h1:"",container:"",containerWidget:"",containerWidgetImages:"",saveButton:""};var currentNumberOfNodes=null;$this.init=function(){SQ_DEBUG&&console.log("checkBuilderExists");$this.checkBuilderExists();if($this.getBuilderExists()){$this.parseBuilders()}};$this.parseBuilders=function(){switch($this.getBuilderName()){case"elementor":SQ_DEBUG&&console.log("Found "+$this.getBuilderName()+" builder");$this.parseElementor();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)){$(builder.iframeSelector).load(function(){$this.setBuilderExists(builder.name);$builderContents=$(builder.iframeSelector).contents()[0];$this.parseBuilders()});$(builder.iframeSelector).ready(function(){$this.setBuilderExists(builder.name);$builderContents=$(builder.iframeSelector).contents()[0];$this.parseBuilders()});return false}}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)}$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)}if($element=$this.elementExists(selector,where)){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={wrapper:["#elementor-editor-wrapper"],preview:["#elementor-preview-iframe"],sections:["section.elementor-element"],title:["h1.entry-title","h1.elementor-heading-title"],header:["h2.entry-title","h2.elementor-heading-title","h3.entry-title","h3.elementor-heading-title","h4.entry-title","h4.elementor-heading-title"],container:[".entry-content",".elementor-inner",".elementor-container"],containerWidget:"[data-element_type='widget'] .elementor-widget-container",containerWidgetImages:[".wp-block-image",".elementor-image",".featured-media-inner"],saveButton:"#elementor-panel-saver-button-publish",draftButton:"#elementor-panel-footer-sub-menu-item-save-draft"};$.each(builderSelectorsSettings.title,function(index,value){if($this.elementExists(value,$builderContents)){$this.setPageTitle($($builderContents).find(value+":first").text())}});$.each(builderSelectorsSettings.header,function(index,value){if($this.elementExists(value,$builderContents)){$this.setPageHeadline($($builderContents).find(value+":first").text())}});$.each(builderSelectorsSettings.container,function(index,value){$this.waitForElementToDisplay(value,$builderContents,$.sq_config.delay_seo,function(){var $elementorWidgets=$($builderContents).find(builderSelectorsSettings.containerWidget);$currentNumberOfNodes=$elementorWidgets.length;var textContainerToConcat="";var textContainerImagesToConcat="";$.each($elementorWidgets,function(){var $element=$(this).clone();$(builderSelectorsSettings.title).each(function(index,val){$element.find(val).remove()});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}})});$this.setPageContent(textContainerToConcat);$this.setPageImages(textContainerImagesToConcat);$this.trigger("seo.frontend.content_loaded")})});$.each(builderSelectorsSettings.preview,function(index,value){$this.waitForElementToDisplay(value,$(document),$.sq_config.delay_seo,function(){$this.setPageURL($(value).attr("src").split("?")[0]);$this.trigger("seo.frontend.preview_loaded")})});$.each(builderSelectorsSettings.wrapper,function(index,value){$this.waitForElementToDisplay(value,$(document),$.sq_config.delay_seo,function(){$this.trigger("seo.frontend.wrapper_loaded")})})};$this.setBuilderExists=function(builderName){builderExists=true;builderInUse=builderName};$this.getBuilderExists=function(){return builderExists};$this.getBuilderName=function(){return builderInUse};$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()}});$(document).on("click","div",function(){if("#"+$(this).attr("id")===builderSelectorsSettings.draftButton){$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()}},1e3);$this.init();window.sq_editor=$this;$this.trigger("seo.frontend.editor_loaded");return $this}})(jQuery);
view/assets/js/assistant/squirrly.min.js CHANGED
@@ -1 +1 @@
1
- if(typeof SQ_DEBUG==="undefined"){var SQ_DEBUG=false}(function($){"use strict";$.sq_initialized=false;if(!$.sq_initialized){$.sq_config=$.extend({div:$("#postsquirrly"),editor:false,editor_type:false,active_editor:false,token:"",url_token:"",sq_apiurl:"//api.squirrly.co/v2/",sq_version:"",is_gutenberg:0,referer:"",keyword:"",lsi:[],language:"en-US",subscription_active:1,subscription_paid:0,sq_keywordtag:"",postID:0,prevNonce:"",user_url:"http://"+document.domain,research_language:"us",timeout_seo:null,timeout_search:null,timeout_research:null,sq_windowerror:false,interval_seo:null,calltimeout:5e3,delay_seo:500,cookie_expires:60*24*2,nrb:8,after_insert:'<div><br style="clear:both" /></div>',firsttime:false,manual:false,silent:false,briefcase:false,sq_cache:[],__noconnection:"To load Squirrly Live Assistant and optimize this page, click to connect to Squirrly Data Cloud.",__date:"date",__keyword:"Keyword",__sq_snippet:"Snippet",__saved:"Saved!",__readit:"Read it!",__insertit:"Insert it!",__reference:"Reference",__insertasbox:"Insert as box",__addlink:"Insert Link",__notrelevant:"Not relevant?",__insertparagraph:"Insert in your article",__ajaxerror:"An error occurred while processing your request. Please try again",__whitelist:"Make sure your site can access our API: https://api.squirrly.co",__nofound:"No results found!",__no_results:"No results found!",__sq_photo_copyright:"[ ATTRIBUTE: Please check: %s to find out how to attribute this image ]",__has_attributes:"Has creative commons attributes",__no_attributes:"No known copyright restrictions",__noopt:"You haven`t used Squirrly SEO to optimize your article. Do you want to optimize for a keyword before publishing?",__error:"No results found!",__subscription_expired:"Your Subscription has Expired..",__usekeyword:"Select",__upgrade_account:"Upgrade your account",__no_briefcase:"There are no keywords saved in briefcase yet",__fulloptimized:"Congratulations! Your article is 100% optimized!",__toomanytimes:"appears too many times. Try to remove %s of them",__writemorewords:"write %s more words",__keywordinintroduction:"Add the keyword in the %s of your article",__clicktohighlight:"Click to keep the highlight on",__introduction:"introduction",__morewordsafter:"Write more words after the %s keyword",__orusesynonyms:"or use synonyms",__addmorewords:"add %s more word(s)",__removewords:"or remove %s word(s)",__addmorekeywords:"add %s more keyword(s)",__addminimumwords:"write %s more words to start calculating",__new_post_title:"Auto Draft",__frontend_optimized:"You’ve already used the Live Assistant to optimize this post when creating it in your Page Builder. Please go back and resume your optimization work there.",__enter_keyword:"Enter keyword above and press ENTER",__add_keyword:"Add Keywords from Briefcase",__maintenance:"Unfortunately Squirrly Cloud is down for a bit of maintenance right now. But we'll be back in a minute."},$.sq_config);$.sq_params=$.extend({low_density:1,high_density:2.5,high_density_title:35,low_density_title:2.5,min_length_title:10,max_length_title:75,min_length_body:80,max_length_body:0,min_length_description:20,max_length_description:160,begin_last_max_chars:400,max_word_density:3,beginning_length:255,ending_length:255,min_words_between_keywords:70,min_chars_between_keywords:200,max_keywords:5},$.sq_params);$.sq_setfields=function(){$.sq_fields=$.extend({wp_title:$("#titlediv"),wp_input_title:$("#title"),wp_postimagediv:$("#postimagediv"),wp_content_wrap:$(".wp-editor-wrap"),wp_content:$(".wp-editor-area"),wp_publish:$("#publish"),wp_postarea:$(".postarea"),wp_thumbnail_alt:$("#attachment_alt"),wp_thumbnail:$(".wp_attachment_image"),content_html:$("#content-html"),content_tmce:$("#content-tmce"),content_html_wp3:$("#edButtonHTML"),content_tmce_wp3:$("#edButtonPreview"),sq_box:$.sq_config.div.find(".sq_box"),sq_preloading:$.sq_config.div.find("#sq_preloading"),sq_preloading_keyword:$.sq_config.div.find("#sq_preloading_keyword"),sq_errorloading:$.sq_config.div.find("#sq_errorloading"),div_blocksearch:$.sq_config.div.find("#sq_blocksearch"),div_blockseo:$.sq_config.div.find("#sq_blockseo"),div_blockbriefacse:$("#sq_briefcase"),div_blocksnippet:$("#sq_blocksnippet"),sq_blocktabs:$.sq_config.div.find("#sq_block_tabs"),sq_blocksteps:$.sq_config.div.find(".sq_block_steps"),sq_search:$.sq_config.div.find(".sq_search"),sq_search_img_filter:$.sq_config.div.find("#sq_search_img_filter"),sq_search_second:$.sq_config.div.find("#sq_search_second"),sq_keyword_second:$.sq_config.div.find("#sq_keyword_second"),sq_keyword_second_check:$.sq_config.div.find("#sq_keyword_second_check"),sq_briefcase_icon:$.sq_config.div.find("#sq_briefcase_icon"),sq_briefcase_list:$.sq_config.div.find("#sq_briefcase_list"),sq_research_link:$.sq_config.div.find("#sq_research_link"),sq_selectit:$.sq_config.div.find("#sq_selectit"),sq_types:$.sq_config.div.find("#sq_types"),sq_type_img:$.sq_config.div.find("#sq_type_img"),sq_type_twitter:$.sq_config.div.find("#sq_type_twitter"),sq_type_news:$.sq_config.div.find("#sq_type_news"),sq_type_blog:$.sq_config.div.find("#sq_type_blog"),sq_type_wiki:$.sq_config.div.find("#sq_type_wiki"),sq_type_local:$.sq_config.div.find("#sq_type_local"),sq_research:$("#sq_research"),sq_blog_preview:$('<div id="sq_blog_preview"><div id="sq_blog_preview_close" >x</div><div id="sq_blog_preview_title"></div><div id="sq_blog_preview_body"></div></div><div id="sq_blog_preview_overlay"></div>'),sq_search_img_nolicence:$("#sq_search_img_nolicence"),sq_keyword:$.sq_config.div.find("#sq_keyword"),sq_keyword_score:$.sq_config.div.find("#sq_keyword_score"),sq_keyword_check:$.sq_config.div.find("#sq_keyword_check"),sq_keywords_research:$("#sq_keywords_research"),sq_keywords_research_add:$(".sq_keywords_research_add"),sq_keywords_research_submit:$(".sq_keywords_research_submit"),sq_keywords_research_clear:$(".sq_keywords_research_clear"),sq_research_close:$("#sq_research_close")},$.sq_fields)};$.isDom=function(inp){return inp&&inp.tagName&&inp.nodeName&&inp.ownerDocument&&inp.removeAttribute};$.sq_isGutenberg=function(){if(typeof wp!=="undefined"&&typeof wp.data!=="undefined"&&typeof wp.data.select("core/editor")!=="undefined"&&typeof wp.blocks!=="undefined"){if(wp.data.select("core/editor")&&$.isFunction(wp.data.select("core/editor").getEditedPostAttribute)&&$(".block-editor").length>0){return true}}return false};$.sq_isDiviBuilder=function(){if($("#et_pb_layout:visible").length>0){return true}return false};$.sq_getBuilderEditorContainer=function(object){if($.sq_isGutenberg()){if($(".block-editor-block-list__layout.is-root-container").length>0){return $(".block-editor-block-list__layout.is-root-container")}}if($("#wpb_visual_composer .metabox-composer-content").length>0){return $("#wpb_visual_composer .metabox-composer-content")}if($("#elementor-preview-iframe").length>0){var $elementor=$("#elementor-preview-iframe").contents()[0];if($($elementor).find(".elementor-container").length>0){return $($elementor).find(".elementor-container")}if($($elementor).find(".elementor-inner").length>0){return $($elementor).find(".elementor-inner")}}if(typeof object!==false){return object}return $("<div></div>")};$.sq_isFrontend=function(){if($.sq_config.div.length>0&&$.sq_config.div.hasClass("sq_frontend")){return true}return false};$.sq_getDomain=function(url,ret,separator){var domainName="";if(typeof ret==="undefined"){var ret=[8,10]}if(typeof separator==="undefined"){var separator=""}url=url.split(/([a-z0-9_\-]{1,5}:\/\/)?(([a-z0-9_\-]{1,}):([a-z0-9_\-]{1,})\@)?((www\.)|([a-z0-9_\-]{1,}\.)+)?([a-z0-9_\-]{3,})((\.[a-z]{2,4})(:(\d{1,5}))?)(\/([a-z0-9_\-]{1,}\/)+)?([a-z0-9_\-]{1,})?(\.[a-z]{2,})?(\?)?(((\&)?[a-z0-9_\-]{1,}(\=[a-z0-9_\-]{1,})?)+)?/g);$.each(ret,function(key,val){if(typeof url[val]!=="undefined"){domainName=domainName+(domainName!==""?separator:"")+url[val]}});return domainName};if(!$.sq_showMessage)$.sq_showMessage=function(text,time){$(".sq_notice").hide();var $div=$('<div class="sq_notice sq_fixed" ><div>'+text+"</div></div>");$("body").prepend($div);if(typeof time==="undefined"){time=2e3}setTimeout(function(){$div.remove()},time);return $div.find("div")};if(!$.sq_getHashParam)$.sq_getHashParam=function(key){if(location.href.indexOf("#")!==-1&&location.href.indexOf("#"+key)!==-1&&window.location.href.split("#")[1]!==""){var results=new RegExp("[\\?&#]"+key+"=([^&#]*)").exec(window.location.href);if(results){return results[1]||0}else{var results=new RegExp("[\\?&#]"+key+"[^&#]*").exec(window.location.href);if(results){return"1"}}}return false};if(!$.sq_setHashParam)$.sq_setHashParam=function(key){var separator="";if(!$.sq_getHashParam(key)){if(location.href.indexOf("#")!==-1){if(location.href.split("#")[1]!=="")separator="&"}else{separator="#"}window.location.href=window.location.href+separator+key}return false};if(!$.sq_deleteHashParam)$.sq_deleteHashParam=function(key){if($.sq_getHashParam(key)){window.location.href=window.location.href.replace("&"+key,"")}if($.sq_getHashParam(key)){window.location.href=window.location.href.replace(key,"")}return false};$.sq_formatNumber=function(number){var x,x1,x2;number+="";x=number.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,"$1"+","+"$2")}return x1+x2};$.sq_clearText=function(str){if(typeof str!=="undefined"&&str.length>0){str=$.sq_clearDiacritics(str);str=$.sq_stripTags(str)}return str};$.sq_umlautsText=function(str){str=str.replace("ä","ae");str=str.replace("ö","oe");str=str.replace("ß","ss");str=str.replace("ü","ue");str=str.replace("æ","ae");str=str.replace("ø","oe");str=str.replace("å","aa");str=str.replace("é","e");str=str.replace("è","e");return str};$.sq_stripTags=function(str){if(typeof str!=="undefined"&&str.length>0){str=$("<div />").html(str).text()}return str};$.sq_stripShortcode=function(str){if(typeof str!=="undefined"&&str.length>0){str=str.replace(/\\[[^\\]]+\\]/g,"")}return str};$.sq_stripChars=function(str){if(typeof str!=="undefined"&&str.length>0){str=str.replace(/[-.\/]+/g," ");var pattern=$.sq_regex("[^\\p{L}\\d\\s]");if(pattern){str=str.replace(pattern,"")}str=str.replace(/\s{2,}/g," ");str=str.trim()}return str};$.sq_clearDiacritics=function(str){if(typeof sqDiacritics!=="undefined"&&typeof str=="string"){return sqDiacritics.clear(str)}return str};$.sq_getCookie=function(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" ")c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return decodeURIComponent(c.substring(nameEQ.length,c.length))}return null};$.sq_setCookie=function(name,value){value=value.replace(new RegExp("\\\\","g"),"");document.cookie=name+"="+encodeURIComponent(value)+"; expires="+$.sq_config.cookie_expires+"; path=/"};$.sq_uriEncode=function(url){return url.replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")};$.sq_getCache=function(name){if(typeof $.sq_config.sq_cache!=="undefined")if(typeof $.sq_config.sq_cache[name]!=="undefined")return $.sq_config.sq_cache[name];return""};$.sq_setCache=function(name,value){$.sq_config.sq_cache[name]=value};$.sq_isArray=function(input){return typeof input==="object"&&input instanceof Array};$.sq_regex=function(striptag){if(typeof XRegExp!=="undefined"){return XRegExp(striptag,"gi")}return false};$.fn.sq_loading=function(name){var $this=this;if(typeof name==="undefined"){$this.sq_classname="sq_minloading"}else{$this.sq_classname=name}clearTimeout($.sq_loadprocess);$this.addClass($this.sq_classname);$this.frame=function(){$this.html('<span class="sq_error_message">'+$.sq_config.__ajaxerror+"</span>");$this.addClass("sq_error");$this.sq_doneloading()};$.sq_loadprocess=setTimeout($this.frame,1e4);return $this};$.fn.sq_doneloading=function(name){var $this=this;if(typeof name==="undefined"){name="sq_minloading"}clearTimeout($.sq_loadprocess);$this.removeClass(name);$this.find(".sq_error_message").remove();return $this};$.sq_checkin=function(){return $.getJSON($.sq_config.sq_apiurl+"api/user/checkin?callback=?",{user_url:$.sq_config.user_url,language:$.sq_config.language||"en-US",token:$.sq_config.token,url_token:$.sq_config.url_token,versq:$.sq_config.sq_version}).done(function(response){$.sq_fields.sq_box.show();$.sq_fields.sq_preloading.hide();$.sq_fields.sq_preloading_keyword.show();if(typeof response.error!=="undefined"){if(response.error==="invalid_token"){var $message=$('<div class="sq_error_message" style="opacity: 1;z-index: 1111;position: absolute;height: calc(100% - 34px);width: 100%;background-color: white;text-align: center;padding: 5px 10px;top: 35px;"><a href="admin.php?page=sq_dashboard" style="color: #df3434;font-size: 13px;font-weight: 500;">'+$.sq_config.__noconnection+"</a></div>");$.sq_fields.sq_box.prepend($message);if($.isFunction($.sq_config.div.sq_floating)){$.sq_floating=$.sq_config.div.sq_floating([]);$.sq_floating.init()}}else if(response.error==="maintenance"){var $message=$('<div class="sq_error_message" style="opacity: 1;z-index: 1111;position: absolute;height: calc(100% - 40px);width: 100%;background-color: white;text-align: center;padding: 10px 30px;top: 40px;color: #df3434;font-size: 14px;font-weight: 500;">'+$.sq_config.__maintenance+"</div>");$.sq_fields.sq_box.prepend($message);if($.isFunction($.sq_config.div.sq_floating)){$.sq_floating=$.sq_config.div.sq_floating([]);$.sq_floating.init()}}}if(typeof response.data!=="undefined"){$.sq_config.subscription_paid=response.data.subscription_paid;$.sq_config.subscription_onetime=response.data.subscription_onetime;if(typeof response.data.subscription_status!=="undefined"){if(response.data.subscription_status==="expired"||response.data.subscription_status==="suspended"){$.sq_config.subscription_active=false;if(typeof response.data.subscription_error!=="undefined"){$.sq_fields.sq_box.prepend(response.data.subscription_error);return}}}var triggerLoadInterval=setInterval(function(){if($.sq_triggerLoad("seo.loaded")){clearInterval(triggerLoadInterval)}},500)}}).fail(function(){$.sq_fields.sq_box.show();$.sq_fields.sq_preloading.hide();$.sq_fields.sq_errorloading.show()})};$.sq_triggerLoad=function(message){if(typeof $.sq_blockbriefcase!=="undefined"&&typeof $.sq_blockseo!=="undefined"&&typeof $.sq_blocksearch!=="undefined"){$.sq_blockbriefcase.trigger(message);$.sq_blockseo.trigger(message);$.sq_blocksearch.trigger(message);$.sq_config.div.trigger(message);return true}else{return false}};$.sq_savePost=function(){var $sq_seo=[];$.sq_config.div.find('input[name="sq_seo[]"]').each(function(){$sq_seo.push(this.value)});if($.sq_blockbriefcase){$.sq_blockbriefcase.trigger("briefcase.save")}$.post(sqQuery.ajaxurl,{action:"sq_ajax_save_post",post_id:$.sq_config.postID,sq_keyword:$.sq_config.keyword,referer:"backend",sq_seo:$sq_seo,sq_nonce:sqQuery.nonce})};$.sq_editor={getIframeEditor:function(element){var $this=$("#wpcontent");if(typeof element==="undefined"){element="#tinymce"}if($.sq_isGutenberg()){if($this.find("#editor").find("div.edit-post-visual-editor").length>0){return $this.find("#editor").find("div.edit-post-visual-editor")}if($this.find("#editor").find("div.edit-post-text-editor__body").length>0){return $this.find("#editor").find("div.edit-post-text-editor__body")}}if($this.find("#post").length>0&&$this.find("#post").find("iframe").length>0){if($this.find(".mce-container").find("iframe").contents().find(element+".has-focus").length>0){return $(".mce-container").find("iframe").contents().find(element+".has-focus")}if($this.find(".mce-container").find("iframe").contents().find(element).length>0){return $this.find(".mce-container").find("iframe").contents().find(element)}if($this.find("#content_ifr").contents().find(element).length>0){return $this.find("#content_ifr").contents().find(element)}if($this.find(".cke_contents").find("iframe").contents().find("body").length>0){return $this.find(".cke_contents").find("iframe").contents().find("body")}if($this.find("#cke_wysiwyg_frame").contents().find("body").length>0){return $this.find("#cke_wysiwyg_frame").contents().find("body")}}return false},getTinymceEditor:function(ed){var editor;if(typeof ed!=="undefined"&&typeof ed==="object"){editor=ed;if(typeof editor.activeEditor==="object")editor=editor.activeEditor}else{if(typeof tinyMCE==="object"){editor=tinyMCE;if(typeof tinyMCE.get("content")!=="undefined"){editor=tinyMCE.get("content")}else{if(typeof tinyMCE.activeEditor==="object"&&tinyMCE.activeEditor!==null){editor=tinyMCE.activeEditor}else{if(document.getElementById("content")!==null){editor=new tinymce.Editor("content");editor.contentCSS=["/wp-content/plugins/squirrly-seo/themes/default/css/sq_frontend.css"]}}}}}return editor},getBlockEditor:function(action){if($.sq_isGutenberg()){if(action==="select"){var ed=window.wp.data.select("core/editor")}else{var ed=window.wp.data.dispatch("core/editor")}return ed}return false},getFrontendEditor:function(action){if($.sq_isFrontend()){if(typeof window.sq_editor!=="undefined"){return window.sq_editor}}return false},createEditorButton:function(name){if($.sq_isFrontend()&&$("."+name).length==0){$("body").append('<button type="button" aria-label="Squirrly SEO" aria-expanded="false" class="'+name+'"><i class="sq_logo" ></i></button>')}else if($.sq_isGutenberg()){if($(".edit-post-more-menu").length>0){$(".edit-post-more-menu").before('<button type="button" aria-label="Squirrly SEO" aria-expanded="false" class="components-button components-icon-button '+name+'"><i class="sq_logo" ></i></button>')}else if($(".interface-pinned-items").length>0){$(".interface-pinned-items").after('<button type="button" aria-label="Squirrly SEO" aria-expanded="false" class="sq-ml-2 components-button components-icon-button '+name+'"><i class="sq_logo" ></i></button>')}else if($(".edit-post-header__settings").length>0){$(".edit-post-header__settings").append('<button type="button" aria-label="Squirrly SEO" aria-expanded="false" class="components-button components-icon-button '+name+'"><i class="sq_logo" ></i></button>')}}else if($(".page-title-action").length>0){$(".page-title-action").after('<button type="button" aria-label="Squirrly SEO" aria-expanded="false" class="components-button components-icon-button '+name+'" style="float: right; border: none; background: none; cursor: pointer;"><i class="sq_logo" ></i></button>')}},listenHtml:function(e){if(e.originalEvent.dataTransfer===null)return;var img=e.originalEvent.dataTransfer.getData("text");if($("#"+$(img).attr("id")).parent("li").attr("class")==="sq_search_img_li"){$.sq_fields.wp_content.val($.sq_fields.wp_content.val()+$.sq_blocksearch.packimg($(img).attr("id"),$("#"+$(img).attr("id")).parent("li").attr("src"),$("#"+$(img).attr("id")).parent("li")))}},listen:function(e){if($("#"+e.target.id).parent("li").attr("class")==="sq_search_img_li"){if($.sq_editor.lastimage!==$("#"+e.target.id).parent("li").attr("src")){$.sq_editor.insert($.sq_blocksearch.packimg(e.target.id,$("#"+e.target.id).parent("li").attr("src"),$("#"+e.target.id).parent("li")))}}$.sq_editor.lastimage=$("#"+e.target.id).parent("li").attr("src")},setContent:function(content,ed){if($.sq_config.editor_type==="tinymce"){var editor=$.sq_editor.getTinymceEditor(ed);if(typeof editor!=="undefined"){editor.setContent(content)}}},insert:function(content,ed){if($.sq_isDiviBuilder()||$.sq_isFrontend()){var input=document.createElement("textarea");document.body.prepend(input);input.value=content;input.focus();input.select();try{document.execCommand("copy");alert("We've copied the code and you can paste it in the Page Builder.")}catch(e){alert("You can copy the box and paste it in the Page Builder")}input.remove();if($(".edit-post-layout__content").length>0){$(".edit-post-layout__content").animate({scrollTop:$(".edit-post-layout__content").scrollTop()+$("#et_pb_layout").offset().top-50},"slow")}else{$("html,body").animate({scrollTop:$("#et_pb_layout").offset().top-50},"slow")}}else if($("#wpb_visual_composer:visible").length>0){var input=document.createElement("textarea");document.body.prepend(input);input.value=content;input.focus();input.select();try{document.execCommand("copy");alert("Visual Composer detected. We've copied the code and you can paste it in Visual Composer Editor.")}catch(e){alert("Visual Composer detected. You can copy the box and paste it in Visual Composer")}input.remove();if($(".edit-post-layout__content").length>0){$(".edit-post-layout__content").animate({scrollTop:$(".edit-post-layout__content").scrollTop()+$("#wpb_visual_composer").offset().top-50},"slow")}else{$("html,body").animate({scrollTop:$("#wpb_visual_composer").offset().top-50},"slow")}}else if($("#elementor-switch-mode-input").length>0&&$("#elementor-switch-mode-input").val()=="builder"){var input=document.createElement("textarea");document.body.appendChild(input);input.value=content;input.focus();input.select();try{document.execCommand("copy");alert("Elementor is detected. We've copied the code and you can paste it in Elementor Text Editor.")}catch(e){alert("Elementor detected. You can copy the box and paste it in Elementor Text Editor")}input.remove()}else if($("div.wp-editor-container").find("div.cs-editor-container.pro").length>0){var input=document.createElement("textarea");document.body.appendChild(input);input.value=content;input.focus();input.select();try{document.execCommand("copy");alert("Themeco PRO is detected. We've copied the code and you can paste it in Themeco PRO Text Editor.")}catch(e){alert("Themeco PRO detected. You can copy the box and paste it in Themeco PRO Text Editor")}input.remove()}else if($.sq_config.editor_type==="tinymce"){if(typeof tinyMCE==="object"){var editor=tinyMCE;if(typeof editor.activeEditor==="object"){editor=editor.activeEditor}}if(typeof editor!=="undefined"&&editor!==null){if(typeof editor.selection!=="undefined"){editor.selection.setContent(content)}else{editor.setContent(content)}$.sq_blockseo.callback()}}else{$.sq_fields.wp_content.val($.sq_fields.wp_content.val().substr(0,$.sq_fields.wp_content[0].selectionStart)+content+$.sq_fields.wp_content.val().substr($.sq_fields.wp_content[0].selectionEnd));$.sq_blockseo.callback()}}};$.sq_tinymce={callback:function(ed){if(ed.id!=="content")return false;var editor=$.sq_editor.getTinymceEditor(ed);if(typeof editor!=="undefined"&&typeof $.sq_blockseo==="object"){if($.sq_config.editor_type==="tinymce"){$.sq_blockseo.callback()}}},setup:function(ed){},addEvents:function(ed,dom){if(typeof $.sq_blockseo!=="undefined"&&typeof $.sq_editor==="object"&&!$.isDom($.sq_editor)){if($.sq_config.active_editor=$.sq_editor.getIframeEditor()){$.sq_blockseo.callback()}}}};$.fn.sq_main=function(){var $this=this;$this.load=function(){$.sq_setfields();$.sq_initialize();$.sq_loadtabs();$.sq_highlight=function(element,text,params){var options=$.extend({element:"mark","acrossElements ":1,ignoreJoiners:1,diacritics:0,separateWordSearch:0,caseSensitive:0,accuracy:{value:"exactly",limiters:["`","~","!","@","#","$","%","^","&","*","(",")","-","_","=","+","{","}","[","]","\\","|",":",";","'",'"',",",".","<",">","/","?","“","”"]},ignorePunctuation:[" ",",","`","~","!","@","#","$","%","^","*","(",")","-","_","=","+","{","}","[","]","\\","|",":",";","'",'"',"<",">","/","?"],counter:1},params);if(typeof element!=="undefined"&&$.isFunction(element.sq_unmark)){if(typeof options.range!=="undefined"){element.sq_unmark({done:function(){element.sq_markRanges(options.range,options)}})}else{element.sq_unmark({done:function(){element.sq_mark(text,options)}})}}};$.sq_removeHighlight=function(element){if(typeof element!=="undefined"&&$.isFunction(element.sq_unmark)&&!$.sq_isDiviBuilder()){element.sq_unmark()}};if($.sq_config.div.length>0){if($.isFunction($.sq_fields.sq_briefcase_list.sq_briefcase)){$.sq_blockbriefcase=$.sq_fields.sq_briefcase_list.sq_briefcase([])}if($.isFunction($.sq_config.div.sq_frontend)){$.sq_frontend=$.sq_config.div.sq_frontend([])}if($.sq_fields.div_blockseo.length>0&&$.isFunction($.sq_fields.div_blockseo.sq_blockseo)){$.sq_blockseo=$.sq_fields.div_blockseo.sq_blockseo([])}if($.sq_fields.div_blocksearch.length>0&&$.isFunction($.sq_fields.div_blocksearch.sq_blocksearch)){$.sq_blocksearch=$.sq_fields.div_blocksearch.sq_blocksearch([])}if($.isFunction($.sq_config.div.sq_floating)){$.sq_floating=$.sq_config.div.sq_floating([]);$.sq_floating.init()}else{$.sq_config.div.show()}}$.sq_checkin()};return $this};$.sq_initialize=function(){$.sq_config.__no_results='<span class="sq_show_mgs">'+$.sq_config.__nofound+"</span>";$.sq_initialized=true};$.sq_loadtabs=function(){$.sq_fields.sq_blocktabs.find("div").on("click",function(){$.sq_fields.sq_selectit.trigger("click");$.sq_fields.sq_blocktabs.find("div").removeClass("sq_active");$(this).addClass("sq_active");$(".sq_block_steps").hide();$($(this).data("target")).show()});$.sq_fields.sq_blocksteps.find(".sq_nextstep").on("click",function(){$('.sq_block_tab[data-target="'+$(this).data("target")+'"]').trigger("click")})}}$(document).ready(function(){if(!$.sq_initialized){if($.sq_config.div.length>0){$.sq_config.div.sq_main().load()}}});if($.sq_config.sq_windowerror){if(!$.sq_initialized){if($.sq_config.div.length>0){$.sq_config.div.sq_main().load()}}}window.onerror=function(){$.sq_config.sq_windowerror=true}})(jQuery);
1
+ if(typeof SQ_DEBUG==="undefined"){var SQ_DEBUG=false}(function($){"use strict";$.sq_initialized=false;if(!$.sq_initialized){$.sq_config=$.extend({div:$("#postsquirrly"),editor:false,editor_type:false,active_editor:false,token:"",url_token:"",sq_apiurl:"//api.squirrly.co/v2/",sq_version:"",is_gutenberg:0,referer:"",keyword:"",lsi:[],language:"en-US",subscription_active:1,subscription_paid:0,sq_keywordtag:"",postID:0,prevNonce:"",user_url:"http://"+document.domain,research_language:"us",timeout_seo:null,timeout_search:null,timeout_research:null,sq_windowerror:false,interval_seo:null,calltimeout:5e3,delay_seo:500,cookie_expires:60*24*2,nrb:8,after_insert:'<div><br style="clear:both" /></div>',firsttime:false,manual:false,silent:false,briefcase:false,sq_cache:[],__noconnection:"To load Squirrly Live Assistant and optimize this page, click to connect to Squirrly Data Cloud.",__date:"date",__keyword:"Keyword",__sq_snippet:"Snippet",__saved:"Saved!",__readit:"Read it!",__insertit:"Insert it!",__reference:"Reference",__insertasbox:"Insert as box",__addlink:"Insert Link",__notrelevant:"Not relevant?",__insertparagraph:"Insert in your article",__ajaxerror:"An error occurred while processing your request. Please try again",__whitelist:"Make sure your site can access our API: https://api.squirrly.co",__nofound:"No results found!",__no_results:"No results found!",__sq_photo_copyright:"[ ATTRIBUTE: Please check: %s to find out how to attribute this image ]",__has_attributes:"Has creative commons attributes",__no_attributes:"No known copyright restrictions",__noopt:"You haven`t used Squirrly SEO to optimize your article. Do you want to optimize for a keyword before publishing?",__error:"No results found!",__subscription_expired:"Your Subscription has Expired..",__usekeyword:"Select",__upgrade_account:"Upgrade your account",__no_briefcase:"There are no keywords saved in briefcase yet",__fulloptimized:"Congratulations! Your article is 100% optimized!",__toomanytimes:"appears too many times. Try to remove %s of them",__writemorewords:"write %s more words",__keywordinintroduction:"Add the keyword in the %s of your article",__clicktohighlight:"Click to keep the highlight on",__introduction:"introduction",__morewordsafter:"Write more words after the %s keyword",__orusesynonyms:"or use synonyms",__addmorewords:"add %s more word(s)",__removewords:"or remove %s word(s)",__addmorekeywords:"add %s more keyword(s)",__addminimumwords:"write %s more words to start calculating",__new_post_title:"Auto Draft",__frontend_optimized:"You’ve already used the Live Assistant to optimize this post when creating it in your Page Builder. Please go back and resume your optimization work there.",__enter_keyword:"Enter keyword above and press ENTER",__add_keyword:"Add Keywords from Briefcase",__maintenance:"Unfortunately Squirrly Cloud is down for a bit of maintenance right now. But we'll be back in a minute."},$.sq_config);$.sq_params=$.extend({low_density:1,high_density:2.5,high_density_title:35,low_density_title:2.5,min_length_title:10,max_length_title:75,min_length_body:80,max_length_body:0,min_length_description:20,max_length_description:160,begin_last_max_chars:400,max_word_density:3,beginning_length:255,ending_length:255,min_words_between_keywords:70,min_chars_between_keywords:200,max_keywords:5},$.sq_params);$.sq_setfields=function(){$.sq_fields=$.extend({wp_title:$("#titlediv"),wp_input_title:$("#title"),wp_postimagediv:$("#postimagediv"),wp_content_wrap:$(".wp-editor-wrap"),wp_content:$(".wp-editor-area"),wp_publish:$("#publish"),wp_postarea:$(".postarea"),wp_thumbnail_alt:$("#attachment_alt"),wp_thumbnail:$(".wp_attachment_image"),content_html:$("#content-html"),content_tmce:$("#content-tmce"),content_html_wp3:$("#edButtonHTML"),content_tmce_wp3:$("#edButtonPreview"),sq_box:$.sq_config.div.find(".sq_box"),sq_preloading:$.sq_config.div.find("#sq_preloading"),sq_preloading_keyword:$.sq_config.div.find("#sq_preloading_keyword"),sq_errorloading:$.sq_config.div.find("#sq_errorloading"),div_blocksearch:$.sq_config.div.find("#sq_blocksearch"),div_blockseo:$.sq_config.div.find("#sq_blockseo"),div_blockbriefacse:$("#sq_briefcase"),div_blocksnippet:$("#sq_blocksnippet"),sq_blocktabs:$.sq_config.div.find("#sq_block_tabs"),sq_blocksteps:$.sq_config.div.find(".sq_block_steps"),sq_search:$.sq_config.div.find(".sq_search"),sq_search_img_filter:$.sq_config.div.find("#sq_search_img_filter"),sq_search_second:$.sq_config.div.find("#sq_search_second"),sq_keyword_second:$.sq_config.div.find("#sq_keyword_second"),sq_keyword_second_check:$.sq_config.div.find("#sq_keyword_second_check"),sq_briefcase_icon:$.sq_config.div.find("#sq_briefcase_icon"),sq_briefcase_list:$.sq_config.div.find("#sq_briefcase_list"),sq_research_link:$.sq_config.div.find("#sq_research_link"),sq_selectit:$.sq_config.div.find("#sq_selectit"),sq_types:$.sq_config.div.find("#sq_types"),sq_type_img:$.sq_config.div.find("#sq_type_img"),sq_type_twitter:$.sq_config.div.find("#sq_type_twitter"),sq_type_news:$.sq_config.div.find("#sq_type_news"),sq_type_blog:$.sq_config.div.find("#sq_type_blog"),sq_type_wiki:$.sq_config.div.find("#sq_type_wiki"),sq_type_local:$.sq_config.div.find("#sq_type_local"),sq_research:$("#sq_research"),sq_blog_preview:$('<div id="sq_blog_preview"><div id="sq_blog_preview_close" >x</div><div id="sq_blog_preview_title"></div><div id="sq_blog_preview_body"></div></div><div id="sq_blog_preview_overlay"></div>'),sq_search_img_nolicence:$("#sq_search_img_nolicence"),sq_keyword:$.sq_config.div.find("#sq_keyword"),sq_keyword_score:$.sq_config.div.find("#sq_keyword_score"),sq_keyword_check:$.sq_config.div.find("#sq_keyword_check"),sq_keywords_research:$("#sq_keywords_research"),sq_keywords_research_add:$(".sq_keywords_research_add"),sq_keywords_research_submit:$(".sq_keywords_research_submit"),sq_keywords_research_clear:$(".sq_keywords_research_clear"),sq_research_close:$("#sq_research_close")},$.sq_fields)};$.isDom=function(inp){return inp&&inp.tagName&&inp.nodeName&&inp.ownerDocument&&inp.removeAttribute};$.sq_isGutenberg=function(){if(typeof wp!=="undefined"&&typeof wp.data!=="undefined"&&typeof wp.data.select("core/editor")!=="undefined"&&typeof wp.blocks!=="undefined"){if(wp.data.select("core/editor")&&$.isFunction(wp.data.select("core/editor").getEditedPostAttribute)&&$(".block-editor").length>0){return true}}return false};$.sq_isDiviBuilder=function(){if($("#et_pb_layout:visible").length>0){return true}return false};$.sq_getBuilderEditorContainer=function(object){if($.sq_isGutenberg()){if($(".block-editor-block-list__layout.is-root-container").length>0){return $(".block-editor-block-list__layout.is-root-container")}}if($("#wpb_visual_composer .metabox-composer-content").length>0){return $("#wpb_visual_composer .metabox-composer-content")}if($("#elementor-preview-iframe").length>0){var $elementor=$("#elementor-preview-iframe").contents()[0];if($($elementor).find(".elementor-container").length>0){return $($elementor).find(".elementor-container")}if($($elementor).find(".elementor-inner").length>0){return $($elementor).find(".elementor-inner")}}if(typeof object!==false){return object}return $("<div></div>")};$.sq_isFrontend=function(){if($.sq_config.div.length>0&&$.sq_config.div.hasClass("sq_frontend")){return true}return false};$.sq_getDomain=function(url,ret,separator){var domainName="";if(typeof ret==="undefined"){var ret=[8,10]}if(typeof separator==="undefined"){var separator=""}url=url.split(/([a-z0-9_\-]{1,5}:\/\/)?(([a-z0-9_\-]{1,}):([a-z0-9_\-]{1,})\@)?((www\.)|([a-z0-9_\-]{1,}\.)+)?([a-z0-9_\-]{3,})((\.[a-z]{2,4})(:(\d{1,5}))?)(\/([a-z0-9_\-]{1,}\/)+)?([a-z0-9_\-]{1,})?(\.[a-z]{2,})?(\?)?(((\&)?[a-z0-9_\-]{1,}(\=[a-z0-9_\-]{1,})?)+)?/g);$.each(ret,function(key,val){if(typeof url[val]!=="undefined"){domainName=domainName+(domainName!==""?separator:"")+url[val]}});return domainName};if(!$.sq_showMessage)$.sq_showMessage=function(text,time){$(".sq_notice").hide();var $div=$('<div class="sq_notice sq_fixed" ><div>'+text+"</div></div>");$("body").prepend($div);if(typeof time==="undefined"){time=2e3}setTimeout(function(){$div.remove()},time);return $div.find("div")};if(!$.sq_getHashParam)$.sq_getHashParam=function(key){if(location.href.indexOf("#")!==-1&&location.href.indexOf("#"+key)!==-1&&window.location.href.split("#")[1]!==""){var results=new RegExp("[\\?&#]"+key+"=([^&#]*)").exec(window.location.href);if(results){return results[1]||0}else{var results=new RegExp("[\\?&#]"+key+"[^&#]*").exec(window.location.href);if(results){return"1"}}}return false};if(!$.sq_setHashParam)$.sq_setHashParam=function(key){var separator="";if(!$.sq_getHashParam(key)){if(location.href.indexOf("#")!==-1){if(location.href.split("#")[1]!=="")separator="&"}else{separator="#"}window.location.href=window.location.href+separator+key}return false};if(!$.sq_deleteHashParam)$.sq_deleteHashParam=function(key){if($.sq_getHashParam(key)){window.location.href=window.location.href.replace("&"+key,"")}if($.sq_getHashParam(key)){window.location.href=window.location.href.replace(key,"")}return false};$.sq_formatNumber=function(number){var x,x1,x2;number+="";x=number.split(".");x1=x[0];x2=x.length>1?"."+x[1]:"";var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,"$1"+","+"$2")}return x1+x2};$.sq_clearText=function(str){if(typeof str!=="undefined"&&str.length>0){str=$.sq_clearDiacritics(str);str=$.sq_stripTags(str)}return str};$.sq_umlautsText=function(str){str=str.replace("ä","ae");str=str.replace("ö","oe");str=str.replace("ß","ss");str=str.replace("ü","ue");str=str.replace("æ","ae");str=str.replace("ø","oe");str=str.replace("å","aa");str=str.replace("é","e");str=str.replace("è","e");return str};$.sq_stripTags=function(str){if(typeof str!=="undefined"&&str.length>0){str=$("<div />").html(str).text()}return str};$.sq_stripShortcode=function(str){if(typeof str!=="undefined"&&str.length>0){str=str.replace(/\\[[^\\]]+\\]/g,"")}return str};$.sq_stripChars=function(str){if(typeof str!=="undefined"&&str.length>0){str=str.replace(/[-.\/]+/g," ");var pattern=$.sq_regex("[^\\p{L}\\d\\s]");if(pattern){str=str.replace(pattern,"")}str=str.replace(/\s{2,}/g," ");str=str.trim()}return str};$.sq_clearDiacritics=function(str){if(typeof sqDiacritics!=="undefined"&&typeof str=="string"){return sqDiacritics.clear(str)}return str};$.sq_getCookie=function(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" ")c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return decodeURIComponent(c.substring(nameEQ.length,c.length))}return null};$.sq_setCookie=function(name,value){value=value.replace(new RegExp("\\\\","g"),"");document.cookie=name+"="+encodeURIComponent(value)+"; expires="+$.sq_config.cookie_expires+"; path=/"};$.sq_uriEncode=function(url){return url.replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")};$.sq_getCache=function(name){if(typeof $.sq_config.sq_cache!=="undefined")if(typeof $.sq_config.sq_cache[name]!=="undefined")return $.sq_config.sq_cache[name];return""};$.sq_setCache=function(name,value){$.sq_config.sq_cache[name]=value};$.sq_strEqual=function(a,b){return typeof a==="string"&&typeof b==="string"?a.localeCompare(b,undefined,{sensitivity:"accent"})===0:a===b};$.sq_isArray=function(input){return typeof input==="object"&&input instanceof Array};$.sq_regex=function(striptag){if(typeof XRegExp!=="undefined"){return XRegExp(striptag,"gi")}return false};$.fn.sq_loading=function(name){var $this=this;if(typeof name==="undefined"){$this.sq_classname="sq_minloading"}else{$this.sq_classname=name}clearTimeout($.sq_loadprocess);$this.addClass($this.sq_classname);$this.frame=function(){$this.html('<span class="sq_error_message">'+$.sq_config.__ajaxerror+"</span>");$this.addClass("sq_error");$this.sq_doneloading()};$.sq_loadprocess=setTimeout($this.frame,1e4);return $this};$.fn.sq_doneloading=function(name){var $this=this;if(typeof name==="undefined"){name="sq_minloading"}clearTimeout($.sq_loadprocess);$this.removeClass(name);$this.find(".sq_error_message").remove();return $this};$.sq_checkin=function(){return $.getJSON($.sq_config.sq_apiurl+"api/user/checkin?callback=?",{user_url:$.sq_config.user_url,language:$.sq_config.language||"en-US",token:$.sq_config.token,url_token:$.sq_config.url_token,versq:$.sq_config.sq_version}).done(function(response){$.sq_fields.sq_box.show();$.sq_fields.sq_preloading.hide();$.sq_fields.sq_preloading_keyword.show();if(typeof response.error!=="undefined"){if(response.error==="invalid_token"){if($.isFunction($.sq_config.div.sq_floating)){$.sq_floating=$.sq_config.div.sq_floating([]);$.sq_floating.init()}var $message=$('<div class="sq_error_message" style="width: 100%;text-align: center;padding: 10px;"><a href="admin.php?page=sq_dashboard" style="color: #df3434;font-size: 13px;font-weight: 500;">'+$.sq_config.__noconnection+"</a></div>");var sq_header=$.sq_fields.sq_box.find(".sq_header");$.sq_fields.sq_box.html($message);$.sq_fields.sq_box.prepend(sq_header);$.sq_fields.sq_box.find(".sq_box_maximize").hide();$.sq_fields.sq_box.find(".sq_box_close").on("click",function(){$.sq_config.div.hide();$.sq_setCookie("sq_sla","off")});$.sq_config.div.show();setTimeout(function(){$.sq_config.div.hide()},5e3)}else if(response.error==="maintenance"){if($.isFunction($.sq_config.div.sq_floating)){$.sq_floating=$.sq_config.div.sq_floating([]);$.sq_floating.init()}var $message=$('<div class="sq_error_message" style="width: 100%;text-align: center;padding: 10px;font-size: 12px;">'+$.sq_config.__maintenance+"</div>");var sq_header=$.sq_fields.sq_box.find(".sq_header");$.sq_fields.sq_box.html($message);$.sq_fields.sq_box.prepend(sq_header);$.sq_fields.sq_box.find(".sq_box_maximize").hide();$.sq_fields.sq_box.find(".sq_box_close").on("click",function(){$.sq_config.div.hide();$.sq_setCookie("sq_sla","off")});$.sq_config.div.show();setTimeout(function(){$.sq_config.div.hide()},5e3)}}if(typeof response.data!=="undefined"){$.sq_config.subscription_paid=response.data.subscription_paid;$.sq_config.subscription_onetime=response.data.subscription_onetime;if(typeof response.data.subscription_status!=="undefined"){if(response.data.subscription_status==="expired"||response.data.subscription_status==="suspended"){$.sq_config.subscription_active=false;if(typeof response.data.subscription_error!=="undefined"){$.sq_fields.sq_box.prepend(response.data.subscription_error);return}}}var triggerLoadInterval=setInterval(function(){if($.sq_triggerLoad("seo.loaded")){clearInterval(triggerLoadInterval)}},500)}}).fail(function(){$.sq_fields.sq_box.show();$.sq_fields.sq_preloading.hide();$.sq_fields.sq_errorloading.show()})};$.sq_triggerLoad=function(message){if(typeof $.sq_blockbriefcase!=="undefined"&&typeof $.sq_blockseo!=="undefined"&&typeof $.sq_blocksearch!=="undefined"){$.sq_blockbriefcase.trigger(message);$.sq_blockseo.trigger(message);$.sq_blocksearch.trigger(message);$.sq_config.div.trigger(message);return true}else{return false}};$.sq_savePost=function(){var $sq_seo=[];$.sq_config.div.find('input[name="sq_seo[]"]').each(function(){$sq_seo.push(this.value)});if($.sq_blockbriefcase){$.sq_blockbriefcase.trigger("briefcase.save")}$.post(sqQuery.ajaxurl,{action:"sq_ajax_save_post",post_id:$.sq_config.postID,sq_keyword:$.sq_config.keyword,referer:"backend",sq_seo:$sq_seo,sq_nonce:sqQuery.nonce})};$.sq_editor={getIframeEditor:function(element){var $this=$("#wpcontent");if(typeof element==="undefined"){element="#tinymce"}if($.sq_isGutenberg()){if($this.find("#editor").find("div.edit-post-visual-editor").length>0){return $this.find("#editor").find("div.edit-post-visual-editor")}if($this.find("#editor").find("div.edit-post-text-editor__body").length>0){return $this.find("#editor").find("div.edit-post-text-editor__body")}}if($this.find("#post").length>0&&$this.find("#post").find("iframe").length>0){if($this.find(".mce-container").find("iframe").contents().find(element+".has-focus").length>0){return $(".mce-container").find("iframe").contents().find(element+".has-focus")}if($this.find(".mce-container").find("iframe").contents().find(element).length>0){return $this.find(".mce-container").find("iframe").contents().find(element)}if($this.find("#content_ifr").contents().find(element).length>0){return $this.find("#content_ifr").contents().find(element)}if($this.find(".cke_contents").find("iframe").contents().find("body").length>0){return $this.find(".cke_contents").find("iframe").contents().find("body")}if($this.find("#cke_wysiwyg_frame").contents().find("body").length>0){return $this.find("#cke_wysiwyg_frame").contents().find("body")}}return false},getTinymceEditor:function(ed){var editor;if(typeof ed!=="undefined"&&typeof ed==="object"){editor=ed;if(typeof editor.activeEditor==="object")editor=editor.activeEditor}else{if(typeof tinyMCE==="object"){editor=tinyMCE;if(typeof tinyMCE.get("content")!=="undefined"){editor=tinyMCE.get("content")}else{if(typeof tinyMCE.activeEditor==="object"&&tinyMCE.activeEditor!==null){editor=tinyMCE.activeEditor}else{if(document.getElementById("content")!==null){editor=new tinymce.Editor("content");editor.contentCSS=["/wp-content/plugins/squirrly-seo/themes/default/css/sq_frontend.css"]}}}}}return editor},getBlockEditor:function(action){if($.sq_isGutenberg()){if(action==="select"){var ed=window.wp.data.select("core/editor")}else{var ed=window.wp.data.dispatch("core/editor")}return ed}return false},getFrontendEditor:function(action){if($.sq_isFrontend()){if(typeof window.sq_editor!=="undefined"){return window.sq_editor}}return false},createEditorButton:function(name){if($.sq_isFrontend()&&$("."+name).length==0){$("body").append('<button type="button" aria-label="Squirrly SEO" aria-expanded="false" class="'+name+'"><i class="sq_logo" ></i></button>')}else if($.sq_isGutenberg()){if($(".edit-post-more-menu").length>0){$(".edit-post-more-menu").before('<button type="button" aria-label="Squirrly SEO" aria-expanded="false" class="components-button components-icon-button '+name+'"><i class="sq_logo" ></i></button>')}else if($(".interface-pinned-items").length>0){$(".interface-pinned-items").after('<button type="button" aria-label="Squirrly SEO" aria-expanded="false" class="sq-ml-2 components-button components-icon-button '+name+'"><i class="sq_logo" ></i></button>')}else if($(".edit-post-header__settings").length>0){$(".edit-post-header__settings").append('<button type="button" aria-label="Squirrly SEO" aria-expanded="false" class="components-button components-icon-button '+name+'"><i class="sq_logo" ></i></button>')}}else if($(".page-title-action").length>0){$(".page-title-action").after('<button type="button" aria-label="Squirrly SEO" aria-expanded="false" class="components-button components-icon-button '+name+'" style="display: inline-block;vertical-align: top;padding: 13px 0 0 15px;margin: 0;border: none;background: none;cursor: pointer;"><i class="sq_logo" ></i></button>')}},listenHtml:function(e){if(e.originalEvent.dataTransfer===null)return;var img=e.originalEvent.dataTransfer.getData("text");if($("#"+$(img).attr("id")).parent("li").attr("class")==="sq_search_img_li"){$.sq_fields.wp_content.val($.sq_fields.wp_content.val()+$.sq_blocksearch.packimg($(img).attr("id"),$("#"+$(img).attr("id")).parent("li").attr("src"),$("#"+$(img).attr("id")).parent("li")))}},listen:function(e){if($("#"+e.target.id).parent("li").attr("class")==="sq_search_img_li"){if($.sq_editor.lastimage!==$("#"+e.target.id).parent("li").attr("src")){$.sq_editor.insert($.sq_blocksearch.packimg(e.target.id,$("#"+e.target.id).parent("li").attr("src"),$("#"+e.target.id).parent("li")))}}$.sq_editor.lastimage=$("#"+e.target.id).parent("li").attr("src")},setContent:function(content,ed){if($.sq_config.editor_type==="tinymce"){var editor=$.sq_editor.getTinymceEditor(ed);if(typeof editor!=="undefined"){editor.setContent(content)}}},insert:function(content,ed){if($.sq_isDiviBuilder()||$.sq_isFrontend()){var input=document.createElement("textarea");document.body.prepend(input);input.value=content;input.focus();input.select();try{document.execCommand("copy");alert("We've copied the code and you can paste it in the Page Builder.")}catch(e){alert("You can copy the box and paste it in the Page Builder")}input.remove();if($(".edit-post-layout__content").length>0){$(".edit-post-layout__content").animate({scrollTop:$(".edit-post-layout__content").scrollTop()+$("#et_pb_layout").offset().top-50},"slow")}else{$("html,body").animate({scrollTop:$("#et_pb_layout").offset().top-50},"slow")}}else if($("#wpb_visual_composer:visible").length>0){var input=document.createElement("textarea");document.body.prepend(input);input.value=content;input.focus();input.select();try{document.execCommand("copy");alert("Visual Composer detected. We've copied the code and you can paste it in Visual Composer Editor.")}catch(e){alert("Visual Composer detected. You can copy the box and paste it in Visual Composer")}input.remove();if($(".edit-post-layout__content").length>0){$(".edit-post-layout__content").animate({scrollTop:$(".edit-post-layout__content").scrollTop()+$("#wpb_visual_composer").offset().top-50},"slow")}else{$("html,body").animate({scrollTop:$("#wpb_visual_composer").offset().top-50},"slow")}}else if($("#elementor-switch-mode-input").length>0&&$("#elementor-switch-mode-input").val()=="builder"){var input=document.createElement("textarea");document.body.appendChild(input);input.value=content;input.focus();input.select();try{document.execCommand("copy");alert("Elementor is detected. We've copied the code and you can paste it in Elementor Text Editor.")}catch(e){alert("Elementor detected. You can copy the box and paste it in Elementor Text Editor")}input.remove()}else if($("div.wp-editor-container").find("div.cs-editor-container.pro").length>0){var input=document.createElement("textarea");document.body.appendChild(input);input.value=content;input.focus();input.select();try{document.execCommand("copy");alert("Themeco PRO is detected. We've copied the code and you can paste it in Themeco PRO Text Editor.")}catch(e){alert("Themeco PRO detected. You can copy the box and paste it in Themeco PRO Text Editor")}input.remove()}else if($.sq_config.editor_type==="tinymce"){if(typeof tinyMCE==="object"){var editor=tinyMCE;if(typeof editor.activeEditor==="object"){editor=editor.activeEditor}}if(typeof editor!=="undefined"&&editor!==null){if(typeof editor.selection!=="undefined"){editor.selection.setContent(content)}else{editor.setContent(content)}$.sq_blockseo.callback()}}else{$.sq_fields.wp_content.val($.sq_fields.wp_content.val().substr(0,$.sq_fields.wp_content[0].selectionStart)+content+$.sq_fields.wp_content.val().substr($.sq_fields.wp_content[0].selectionEnd));$.sq_blockseo.callback()}}};$.sq_tinymce={callback:function(ed){if(ed.id!=="content")return false;var editor=$.sq_editor.getTinymceEditor(ed);if(typeof editor!=="undefined"&&typeof $.sq_blockseo==="object"){if($.sq_config.editor_type==="tinymce"){$.sq_blockseo.callback()}}},setup:function(ed){},addEvents:function(ed,dom){if(typeof $.sq_blockseo!=="undefined"&&typeof $.sq_editor==="object"&&!$.isDom($.sq_editor)){if($.sq_config.active_editor=$.sq_editor.getIframeEditor()){$.sq_blockseo.callback()}}}};$.fn.sq_main=function(){var $this=this;$this.load=function(){$.sq_setfields();$.sq_initialize();$.sq_loadtabs();$.sq_highlight=function(element,text,params){var options=$.extend({element:"mark","acrossElements ":1,ignoreJoiners:1,diacritics:false,separateWordSearch:false,caseSensitive:false,accuracy:{value:"exactly",limiters:["`","~","!","@","#","$","%","^","&","*","(",")","-","_","=","+","{","}","[","]","\\","|",":",";","'",'"',",",".","<",">","/","?","“","”"]},ignorePunctuation:[" ",",","`","~","!","@","#","$","%","^","*","(",")","-","_","=","+","{","}","[","]","\\","|",":",";","'",'"',"<",">","/","?"],counter:1},params);if(typeof element!=="undefined"&&$.isFunction(element.sq_unmark)){if(typeof options.range!=="undefined"){element.sq_unmark({done:function(){element.sq_markRanges(options.range,options)}})}else{element.sq_unmark({done:function(){element.sq_mark(text,options)}})}}};$.sq_removeHighlight=function(element){if(typeof element!=="undefined"&&$.isFunction(element.sq_unmark)&&!$.sq_isDiviBuilder()){element.sq_unmark()}};if($.sq_config.div.length>0){if($.isFunction($.sq_fields.sq_briefcase_list.sq_briefcase)){$.sq_blockbriefcase=$.sq_fields.sq_briefcase_list.sq_briefcase([])}if($.isFunction($.sq_config.div.sq_frontend)){$.sq_frontend=$.sq_config.div.sq_frontend([])}if($.sq_fields.div_blockseo.length>0&&$.isFunction($.sq_fields.div_blockseo.sq_blockseo)){$.sq_blockseo=$.sq_fields.div_blockseo.sq_blockseo([])}if($.sq_fields.div_blocksearch.length>0&&$.isFunction($.sq_fields.div_blocksearch.sq_blocksearch)){$.sq_blocksearch=$.sq_fields.div_blocksearch.sq_blocksearch([])}if($.isFunction($.sq_config.div.sq_floating)){$.sq_floating=$.sq_config.div.sq_floating([]);$.sq_floating.init()}else{$.sq_config.div.show()}}$.sq_checkin()};return $this};$.sq_initialize=function(){$.sq_config.__no_results='<span class="sq_show_mgs">'+$.sq_config.__nofound+"</span>";$.sq_initialized=true};$.sq_loadtabs=function(){$.sq_fields.sq_blocktabs.find("div").on("click",function(){$.sq_fields.sq_selectit.trigger("click");$.sq_fields.sq_blocktabs.find("div").removeClass("sq_active");$(this).addClass("sq_active");$(".sq_block_steps").hide();$($(this).data("target")).show()});$.sq_fields.sq_blocksteps.find(".sq_nextstep").on("click",function(){$('.sq_block_tab[data-target="'+$(this).data("target")+'"]').trigger("click")})}}$(document).ready(function(){if(!$.sq_initialized){if($.sq_config.div.length>0){$.sq_config.div.sq_main().load()}}});if($.sq_config.sq_windowerror){if(!$.sq_initialized){if($.sq_config.div.length>0){$.sq_config.div.sq_main().load()}}}window.onerror=function(){$.sq_config.sq_windowerror=true}})(jQuery);
view/assets/js/assistant/utils/upload.min.js DELETED
@@ -1 +0,0 @@
1
- (function(){var d=document,w=window;function get(element){if(typeof element=="string")element=d.getElementById(element);return element}function addEvent(el,type,fn){if(w.addEventListener){el.addEventListener(type,fn,false)}else if(w.attachEvent){var f=function(){fn.call(el,w.event)};el.attachEvent("on"+type,f)}}var toElement=function(){var div=d.createElement("div");return function(html){div.innerHTML=html;var el=div.childNodes[0];div.removeChild(el);return el}}();function hasClass(ele,cls){return ele.className.match(new RegExp("(\\s|^)"+cls+"(\\s|$)"))}function addClass(ele,cls){if(!hasClass(ele,cls))ele.className+=" "+cls}function removeClass(ele,cls){var reg=new RegExp("(\\s|^)"+cls+"(\\s|$)");ele.className=ele.className.replace(reg," ")}if(document.documentElement["getBoundingClientRect"]){var getOffset=function(el){var box=el.getBoundingClientRect(),doc=el.ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,zoom=1;if(body.getBoundingClientRect){var bound=body.getBoundingClientRect();zoom=(bound.right-bound.left)/body.clientWidth}if(zoom>1){clientTop=0;clientLeft=0}var top=box.top/zoom+(window.pageYOffset||docElem&&docElem.scrollTop/zoom||body.scrollTop/zoom)-clientTop,left=box.left/zoom+(window.pageXOffset||docElem&&docElem.scrollLeft/zoom||body.scrollLeft/zoom)-clientLeft;return{top:top,left:left}}}else{var getOffset=function(el){if(w.jQuery){return jQuery(el).offset()}var top=0,left=0;do{top+=el.offsetTop||0;left+=el.offsetLeft||0}while(el=el.offsetParent);return{left:left,top:top}}}function getBox(el){var left,right,top,bottom;var offset=getOffset(el);left=offset.left;top=offset.top;right=left+el.offsetWidth;bottom=top+el.offsetHeight;return{left:left,right:right,top:top,bottom:bottom}}function getMouseCoords(e){if(!e.pageX&&e.clientX){var zoom=1;var body=document.body;if(body.getBoundingClientRect){var bound=body.getBoundingClientRect();zoom=(bound.right-bound.left)/body.clientWidth}return{x:e.clientX/zoom+d.body.scrollLeft+d.documentElement.scrollLeft,y:e.clientY/zoom+d.body.scrollTop+d.documentElement.scrollTop}}return{x:e.pageX,y:e.pageY}}var getUID=function(){var id=0;return function(){return"ValumsAjaxUpload"+id++}}();function fileFromPath(file){return file.replace(/.*(\/|\\)/,"")}function getExt(file){return/[.]/.exec(file)?/[^.]+$/.exec(file.toLowerCase()):""}AjaxUpload=function(button,options){if(button.jquery){button=button[0]}else if(typeof button=="string"&&/^#.*/.test(button)){button=button.slice(1)}button=get(button);this._input=null;this._button=button;this._disabled=false;this._submitting=false;this._justClicked=false;this._parentDialog=d.body;if(window.jQuery&&jQuery.ui&&jQuery.ui.dialog){var parentDialog=jQuery(this._button).parents(".ui-dialog");if(parentDialog.length){this._parentDialog=parentDialog[0]}}this._settings={action:"index.php",name:"file",data:{},autoSubmit:true,responseType:"json",onChange:function(file,extension){},onSubmit:function(file,extension){},onComplete:function(file,response){}};for(var i in options){this._settings[i]=options[i]}this._createInput();this._rerouteClicks()};AjaxUpload.prototype={setData:function(data){this._settings.data=data},disable:function(){this._disabled=true},enable:function(){this._disabled=false},destroy:function(){if(this._input){if(this._input.parentNode){this._input.parentNode.removeChild(this._input)}this._input=null}},_createInput:function(){var self=this;var input=d.createElement("input");input.setAttribute("type","file");input.setAttribute("name",this._settings.name);var styles={position:"absolute",margin:"-5px 0 0 -175px",padding:0,width:"220px",height:"30px",fontSize:"14px",opacity:0,cursor:"pointer",display:"none",zIndex:2147483583};for(var i in styles){input.style[i]=styles[i]}if(!(input.style.opacity==="0")){input.style.filter="alpha(opacity=0)"}this._parentDialog.appendChild(input);addEvent(input,"change",function(){var file=fileFromPath(this.value);if(self._settings.onChange.call(self,file,getExt(file))==false){return}if(self._settings.autoSubmit){self.submit()}});addEvent(input,"click",function(){self.justClicked=true;setTimeout(function(){self.justClicked=false},3e3)});this._input=input},_rerouteClicks:function(){var self=this;var box,dialogOffset={top:0,left:0},over=false;addEvent(self._button,"mouseover",function(e){if(!self._input||over)return;over=true;box=getBox(self._button);if(self._parentDialog!=d.body){dialogOffset=getOffset(self._parentDialog)}});addEvent(document,"mousemove",function(e){var input=self._input;if(!input||!over)return;if(self._disabled){removeClass(self._button,"hover");input.style.display="none";return}var c=getMouseCoords(e);if(c.x>=box.left&&c.x<=box.right&&c.y>=box.top&&c.y<=box.bottom){input.style.top=c.y-dialogOffset.top+"px";input.style.left=c.x-dialogOffset.left+"px";input.style.display="block";addClass(self._button,"hover")}else{over=false;if(!self.justClicked){input.style.display="none"}removeClass(self._button,"hover")}})},_createIframe:function(){var id=getUID();var iframe=toElement('<iframe src="javascript:false;" name="'+id+'" />');iframe.id=id;iframe.style.display="none";d.body.appendChild(iframe);return iframe},submit:function(){var self=this,settings=this._settings;if(this._input.value===""){return}var file=fileFromPath(this._input.value);if(!(settings.onSubmit.call(this,file,getExt(file))==false)){var iframe=this._createIframe();var form=this._createForm(iframe);form.appendChild(this._input);form.submit();d.body.removeChild(form);form=null;this._input=null;this._createInput();var toDeleteFlag=false;addEvent(iframe,"load",function(e){if(iframe.src=="javascript:'%3Chtml%3E%3C/html%3E';"||iframe.src=="javascript:'<html></html>';"){if(toDeleteFlag){setTimeout(function(){d.body.removeChild(iframe)},0)}return}var doc=iframe.contentDocument?iframe.contentDocument:frames[iframe.id].document;if(doc.readyState&&doc.readyState!="complete"){return}if(doc.body&&doc.body.innerHTML=="false"){return}var response;if(doc.XMLDocument){response=doc.XMLDocument}else if(doc.body){response=doc.body.innerHTML;if(settings.responseType&&settings.responseType.toLowerCase()=="json"){if(doc.body.firstChild&&doc.body.firstChild.nodeName.toUpperCase()=="PRE"){response=doc.body.firstChild.firstChild.nodeValue}if(response){response=window["eval"]("("+response+")")}else{response={}}}}else{var response=doc}settings.onComplete.call(self,file,response);toDeleteFlag=true;iframe.src="javascript:'<html></html>';"})}else{d.body.removeChild(this._input);this._input=null;this._createInput()}},_createForm:function(iframe){var settings=this._settings;var form=toElement('<form method="post" enctype="multipart/form-data"></form>');form.style.display="none";form.action=settings.action;form.target=iframe.name;d.body.appendChild(form);for(var prop in settings.data){var el=d.createElement("input");el.type="hidden";el.name=prop;el.value=settings.data[prop];form.appendChild(el)}return form}}})();
 
view/assets/js/assistant/widgets/draggable.min.js DELETED
@@ -1 +0,0 @@
1
- (function(factory){if(typeof define==="function"&&define.amd){define(["jquery","./mouse","../data","../plugin","../safe-active-element","../safe-blur","../scroll-parent","../version","../widget"],factory)}else{factory(jQuery)}})(function($){$.widget("ui.draggable",$.ui.mouse,{version:"@VERSION",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative()}if(this.options.addClasses){this._addClass("ui-draggable")}this._setHandleClassName();this._mouseInit()},_setOption:function(key,value){this._super(key,value);if(key==="handle"){this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return}this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).closest(".ui-resizable-handle").length>0){return false}this.handle=this._getHandle(event);if(!this.handle){return false}this._blurActiveElement(event);this._blockFrames(o.iframeFix===true?"iframe":o.iframeFix);return true},_blockFrames:function(selector){this.iframeBlocks=this.document.find(selector).map(function(){var iframe=$(this);return $("<div>").css("position","absolute").appendTo(iframe.parent()).outerWidth(iframe.outerWidth()).outerHeight(iframe.outerHeight()).offset(iframe.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(event){var activeElement=$.ui.safeActiveElement(this.document[0]),target=$(event.target);if(target.closest(activeElement).length){return}$.ui.safeBlur(activeElement)},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if($.ui.ddmanager){$.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return $(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(event);this.originalPosition=this.position=this._generatePosition(event,false);this.originalPageX=event.pageX;this.originalPageY=event.pageY;o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt);this._setContainment();if(this._trigger("start",event)===false){this._clear();return false}this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event)}this._mouseDrag(event,true);if($.ui.ddmanager){$.ui.ddmanager.dragStart(this,event)}return true},_refreshOffsets:function(event){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:event.pageX-this.offset.left,top:event.pageY-this.offset.top}},_mouseDrag:function(event,noPropagation){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset()}this.position=this._generatePosition(event,true);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();if(this._trigger("drag",event,ui)===false){this._mouseUp(new $.Event("mouseup",event));return false}this.position=ui.position}this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if($.ui.ddmanager){$.ui.ddmanager.drag(this,event)}return false},_mouseStop:function(event){var that=this,dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour){dropped=$.ui.ddmanager.drop(this,event)}if(this.dropped){dropped=this.dropped;this.dropped=false}if(this.options.revert==="invalid"&&!dropped||this.options.revert==="valid"&&dropped||this.options.revert===true||$.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped)){$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(that._trigger("stop",event)!==false){that._clear()}})}else{if(this._trigger("stop",event)!==false){this._clear()}}return false},_mouseUp:function(event){this._unblockFrames();if($.ui.ddmanager){$.ui.ddmanager.dragStop(this,event)}if(this.handleElement.is(event.target)){this.element.trigger("focus")}return $.ui.mouse.prototype._mouseUp.call(this,event)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp(new $.Event("mouseup",{target:this.element[0]}))}else{this._clear()}return this},_getHandle:function(event){return this.options.handle?!!$(event.target).closest(this.element.find(this.options.handle)).length:true},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(event){var o=this.options,helperIsFunction=$.isFunction(o.helper),helper=helperIsFunction?$(o.helper.apply(this.element[0],[event])):o.helper==="clone"?this.element.clone().removeAttr("id"):this.element;if(!helper.parents("body").length){helper.appendTo(o.appendTo==="parent"?this.element[0].parentNode:o.appendTo)}if(helperIsFunction&&helper[0]===this.element[0]){this._setPositionRelative()}if(helper[0]!==this.element[0]&&!/(fixed|absolute)/.test(helper.css("position"))){helper.css("position","absolute")}return helper},_setPositionRelative:function(){if(!/^(?:r|a|f)/.test(this.element.css("position"))){this.element[0].style.position="relative"}},_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){obj=obj.split(" ")}if($.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0}}if("left"in obj){this.offset.click.left=obj.left+this.margins.left}if("right"in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left}if("top"in obj){this.offset.click.top=obj.top+this.margins.top}if("bottom"in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top}},_isRootNode:function(element){return/(html|body)/i.test(element.tagName)||element===this.document[0]},_getParentOffset:function(){var po=this.offsetParent.offset(),document=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop()}if(this._isRootNode(this.offsetParent[0])){po={top:0,left:0}}return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0}}var p=this.element.position(),scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+(!scrollIsRootNode?this.scrollParent.scrollTop():0),left:p.left-(parseInt(this.helper.css("left"),10)||0)+(!scrollIsRootNode?this.scrollParent.scrollLeft():0)}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var isUserScrollable,c,ce,o=this.options,document=this.document[0];this.relativeContainer=null;if(!o.containment){this.containment=null;return}if(o.containment==="window"){this.containment=[$(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,$(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,$(window).scrollLeft()+$(window).width()-this.helperProportions.width-this.margins.left,$(window).scrollTop()+($(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(o.containment==="document"){this.containment=[0,0,$(document).width()-this.helperProportions.width-this.margins.left,($(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(o.containment.constructor===Array){this.containment=o.containment;return}if(o.containment==="parent"){o.containment=this.helper[0].parentNode}c=$(o.containment);ce=c[0];if(!ce){return}isUserScrollable=/(scroll|auto)/.test(c.css("overflow"));this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(isUserScrollable?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(isUserScrollable?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt(c.css("borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=c},_convertPositionTo:function(d,pos){if(!pos){pos=this.position}var mod=d==="absolute"?1:-1,scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-(this.cssPosition==="fixed"?-this.offset.scroll.top:scrollIsRootNode?0:this.offset.scroll.top)*mod,left:pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-(this.cssPosition==="fixed"?-this.offset.scroll.left:scrollIsRootNode?0:this.offset.scroll.left)*mod}},_generatePosition:function(event,constrainPosition){var containment,co,top,left,o=this.options,scrollIsRootNode=this._isRootNode(this.scrollParent[0]),pageX=event.pageX,pageY=event.pageY;if(!scrollIsRootNode||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}}if(constrainPosition){if(this.containment){if(this.relativeContainer){co=this.relativeContainer.offset();containment=[this.containment[0]+co.left,this.containment[1]+co.top,this.containment[2]+co.left,this.containment[3]+co.top]}else{containment=this.containment}if(event.pageX-this.offset.click.left<containment[0]){pageX=containment[0]+this.offset.click.left}if(event.pageY-this.offset.click.top<containment[1]){pageY=containment[1]+this.offset.click.top}if(event.pageX-this.offset.click.left>containment[2]){pageX=containment[2]+this.offset.click.left}if(event.pageY-this.offset.click.top>containment[3]){pageY=containment[3]+this.offset.click.top}}if(o.grid){top=o.grid[1]?this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY;pageY=containment?top-this.offset.click.top>=containment[1]||top-this.offset.click.top>containment[3]?top:top-this.offset.click.top>=containment[1]?top-o.grid[1]:top+o.grid[1]:top;left=o.grid[0]?this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX;pageX=containment?left-this.offset.click.left>=containment[0]||left-this.offset.click.left>containment[2]?left:left-this.offset.click.left>=containment[0]?left-o.grid[0]:left+o.grid[0]:left}if(o.axis==="y"){pageX=this.originalPageX}if(o.axis==="x"){pageY=this.originalPageY}}return{top:pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:scrollIsRootNode?0:this.offset.scroll.top),left:pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:scrollIsRootNode?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false;if(this.destroyOnClear){this.destroy()}},_trigger:function(type,event,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui,this],true);if(/^(drag|start|stop)/.test(type)){this.positionAbs=this._convertPositionTo("absolute");ui.offset=this.positionAbs}return $.Widget.prototype._trigger.call(this,type,event,ui)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.sortables=[];$(draggable.options.connectToSortable).each(function(){var sortable=$(this).sortable("instance");if(sortable&&!sortable.options.disabled){draggable.sortables.push(sortable);sortable.refreshPositions();sortable._trigger("activate",event,uiSortable)}})},stop:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.cancelHelperRemoval=false;$.each(draggable.sortables,function(){var sortable=this;if(sortable.isOver){sortable.isOver=0;draggable.cancelHelperRemoval=true;sortable.cancelHelperRemoval=false;sortable._storedCSS={position:sortable.placeholder.css("position"),top:sortable.placeholder.css("top"),left:sortable.placeholder.css("left")};sortable._mouseStop(event);sortable.options.helper=sortable.options._helper}else{sortable.cancelHelperRemoval=true;sortable._trigger("deactivate",event,uiSortable)}})},drag:function(event,ui,draggable){$.each(draggable.sortables,function(){var innermostIntersecting=false,sortable=this;sortable.positionAbs=draggable.positionAbs;sortable.helperProportions=draggable.helperProportions;sortable.offset.click=draggable.offset.click;if(sortable._intersectsWith(sortable.containerCache)){innermostIntersecting=true;$.each(draggable.sortables,function(){this.positionAbs=draggable.positionAbs;this.helperProportions=draggable.helperProportions;this.offset.click=draggable.offset.click;if(this!==sortable&&this._intersectsWith(this.containerCache)&&$.contains(sortable.element[0],this.element[0])){innermostIntersecting=false}return innermostIntersecting})}if(innermostIntersecting){if(!sortable.isOver){sortable.isOver=1;draggable._parent=ui.helper.parent();sortable.currentItem=ui.helper.appendTo(sortable.element).data("ui-sortable-item",true);sortable.options._helper=sortable.options.helper;sortable.options.helper=function(){return ui.helper[0]};event.target=sortable.currentItem[0];sortable._mouseCapture(event,true);sortable._mouseStart(event,true,true);sortable.offset.click.top=draggable.offset.click.top;sortable.offset.click.left=draggable.offset.click.left;sortable.offset.parent.left-=draggable.offset.parent.left-sortable.offset.parent.left;sortable.offset.parent.top-=draggable.offset.parent.top-sortable.offset.parent.top;draggable._trigger("toSortable",event);draggable.dropped=sortable.element;$.each(draggable.sortables,function(){this.refreshPositions()});draggable.currentItem=draggable.element;sortable.fromOutside=draggable}if(sortable.currentItem){sortable._mouseDrag(event);ui.position=sortable.position}}else{if(sortable.isOver){sortable.isOver=0;sortable.cancelHelperRemoval=true;sortable.options._revert=sortable.options.revert;sortable.options.revert=false;sortable._trigger("out",event,sortable._uiHash(sortable));sortable._mouseStop(event,true);sortable.options.revert=sortable.options._revert;sortable.options.helper=sortable.options._helper;if(sortable.placeholder){sortable.placeholder.remove()}ui.helper.appendTo(draggable._parent);draggable._refreshOffsets(event);ui.position=draggable._generatePosition(event,true);draggable._trigger("fromSortable",event);draggable.dropped=false;$.each(draggable.sortables,function(){this.refreshPositions()})}}})}});$.ui.plugin.add("draggable","cursor",{start:function(event,ui,instance){var t=$("body"),o=instance.options;if(t.css("cursor")){o._cursor=t.css("cursor")}t.css("cursor",o.cursor)},stop:function(event,ui,instance){var o=instance.options;if(o._cursor){$("body").css("cursor",o._cursor)}}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;if(t.css("opacity")){o._opacity=t.css("opacity")}t.css("opacity",o.opacity)},stop:function(event,ui,instance){var o=instance.options;if(o._opacity){$(ui.helper).css("opacity",o._opacity)}}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui,i){if(!i.scrollParentNotHidden){i.scrollParentNotHidden=i.helper.scrollParent(false)}if(i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"){i.overflowOffset=i.scrollParentNotHidden.offset()}},drag:function(event,ui,i){var o=i.options,scrolled=false,scrollParent=i.scrollParentNotHidden[0],document=i.document[0];if(scrollParent!==document&&scrollParent.tagName!=="HTML"){if(!o.axis||o.axis!=="x"){if(i.overflowOffset.top+scrollParent.offsetHeight-event.pageY<o.scrollSensitivity){scrollParent.scrollTop=scrolled=scrollParent.scrollTop+o.scrollSpeed}else if(event.pageY-i.overflowOffset.top<o.scrollSensitivity){scrollParent.scrollTop=scrolled=scrollParent.scrollTop-o.scrollSpeed}}if(!o.axis||o.axis!=="y"){if(i.overflowOffset.left+scrollParent.offsetWidth-event.pageX<o.scrollSensitivity){scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft+o.scrollSpeed}else if(event.pageX-i.overflowOffset.left<o.scrollSensitivity){scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft-o.scrollSpeed}}}else{if(!o.axis||o.axis!=="x"){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed)}else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed)}}if(!o.axis||o.axis!=="y"){if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed)}else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed)}}}if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(i,event)}}});$.ui.plugin.add("draggable","snap",{start:function(event,ui,i){var o=i.options;i.snapElements=[];$(o.snap.constructor!==String?o.snap.items||":data(ui-draggable)":o.snap).each(function(){var $t=$(this),$o=$t.offset();if(this!==i.element[0]){i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left})}})},drag:function(event,ui,inst){var ts,bs,ls,rs,l,r,t,b,i,first,o=inst.options,d=o.snapTolerance,x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(i=inst.snapElements.length-1;i>=0;i--){l=inst.snapElements[i].left-inst.margins.left;r=l+inst.snapElements[i].width;t=inst.snapElements[i].top-inst.margins.top;b=t+inst.snapElements[i].height;if(x2<l-d||x1>r+d||y2<t-d||y1>b+d||!$.contains(inst.snapElements[i].item.ownerDocument,inst.snapElements[i].item)){if(inst.snapElements[i].snapping){inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item}))}inst.snapElements[i].snapping=false;continue}if(o.snapMode!=="inner"){ts=Math.abs(t-y2)<=d;bs=Math.abs(b-y1)<=d;ls=Math.abs(l-x2)<=d;rs=Math.abs(r-x1)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top}if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top}if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left}if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left}}first=ts||bs||ls||rs;if(o.snapMode!=="outer"){ts=Math.abs(t-y1)<=d;bs=Math.abs(b-y2)<=d;ls=Math.abs(l-x1)<=d;rs=Math.abs(r-x2)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top}if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top}if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left}if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left}}if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)){inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item}))}inst.snapElements[i].snapping=ts||bs||ls||rs||first}}});$.ui.plugin.add("draggable","stack",{start:function(event,ui,instance){var min,o=instance.options,group=$.makeArray($(o.stack)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)-(parseInt($(b).css("zIndex"),10)||0)});if(!group.length){return}min=parseInt($(group[0]).css("zIndex"),10)||0;$(group).each(function(i){$(this).css("zIndex",min+i)});this.css("zIndex",min+group.length)}});$.ui.plugin.add("draggable","zIndex",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;if(t.css("zIndex")){o._zIndex=t.css("zIndex")}t.css("zIndex",o.zIndex)},stop:function(event,ui,instance){var o=instance.options;if(o._zIndex){$(ui.helper).css("zIndex",o._zIndex)}}});return $.ui.draggable});
 
view/assets/js/assistant/widgets/resizable.min.js DELETED
@@ -1 +0,0 @@
1
- (function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else{factory(jQuery)}})(function($){$.ui=$.ui||{};var version=$.ui.version="1.12.1";var widgetUuid=0;var widgetSlice=Array.prototype.slice;$.cleanData=function(orig){return function(elems){var events,elem,i;for(i=0;(elem=elems[i])!=null;i++){try{events=$._data(elem,"events");if(events&&events.remove){$(elem).triggerHandler("remove")}}catch(e){}}orig(elems)}}($.cleanData);$.widget=function(name,base,prototype){var existingConstructor,constructor,basePrototype;var proxiedPrototype={};var namespace=name.split(".")[0];name=name.split(".")[1];var fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget}if($.isArray(prototype)){prototype=$.extend.apply(null,[{}].concat(prototype))}$.expr[":"][fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName)};$[namespace]=$[namespace]||{};existingConstructor=$[namespace][name];constructor=$[namespace][name]=function(options,element){if(!this._createWidget){return new constructor(options,element)}if(arguments.length){this._createWidget(options,element)}};$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]});basePrototype=new base;basePrototype.options=$.widget.extend({},basePrototype.options);$.each(prototype,function(prop,value){if(!$.isFunction(value)){proxiedPrototype[prop]=value;return}proxiedPrototype[prop]=function(){function _super(){return base.prototype[prop].apply(this,arguments)}function _superApply(args){return base.prototype[prop].apply(this,args)}return function(){var __super=this._super;var __superApply=this._superApply;var returnValue;this._super=_super;this._superApply=_superApply;returnValue=value.apply(this,arguments);this._super=__super;this._superApply=__superApply;return returnValue}}()});constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:existingConstructor?basePrototype.widgetEventPrefix||name:name},proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetFullName:fullName});if(existingConstructor){$.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto)});delete existingConstructor._childConstructors}else{base._childConstructors.push(constructor)}$.widget.bridge(name,constructor);return constructor};$.widget.extend=function(target){var input=widgetSlice.call(arguments,1);var inputIndex=0;var inputLength=input.length;var key;var value;for(;inputIndex<inputLength;inputIndex++){for(key in input[inputIndex]){value=input[inputIndex][key];if(input[inputIndex].hasOwnProperty(key)&&value!==undefined){if($.isPlainObject(value)){target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value)}else{target[key]=value}}}}return target};$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){var isMethodCall=typeof options==="string";var args=widgetSlice.call(arguments,1);var returnValue=this;if(isMethodCall){if(!this.length&&options==="instance"){returnValue=undefined}else{this.each(function(){var methodValue;var instance=$.data(this,fullName);if(options==="instance"){returnValue=instance;return false}if(!instance){return $.error("cannot call methods on "+name+" prior to initialization; "+"attempted to call method '"+options+"'")}if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for "+name+" widget instance")}methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return false}})}}else{if(args.length){options=$.widget.extend.apply(null,[options].concat(args))}this.each(function(){var instance=$.data(this,fullName);if(instance){instance.option(options||{});if(instance._init){instance._init()}}else{$.data(this,fullName,new object(options,this))}})}return returnValue}};$.Widget=function(){};$.Widget._childConstructors=[];$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:false,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0];this.element=$(element);this.uuid=widgetUuid++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=$();this.hoverable=$();this.focusable=$();this.classesElementLookup={};if(element!==this){$.data(element,this.widgetFullName,this);this._on(true,this.element,{remove:function(event){if(event.target===element){this.destroy()}}});this.document=$(element.style?element.ownerDocument:element.document||element);this.window=$(this.document[0].defaultView||this.document[0].parentWindow)}this.options=$.widget.extend({},this.options,this._getCreateOptions(),options);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled)}this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){var that=this;this._destroy();$.each(this.classesElementLookup,function(key,value){that._removeClass(value,key)});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace)},_destroy:$.noop,widget:function(){return this.element},option:function(key,value){var options=key;var parts;var curOption;var i;if(arguments.length===0){return $.widget.extend({},this.options)}if(typeof key==="string"){options={};parts=key.split(".");key=parts.shift();if(parts.length){curOption=options[key]=$.widget.extend({},this.options[key]);for(i=0;i<parts.length-1;i++){curOption[parts[i]]=curOption[parts[i]]||{};curOption=curOption[parts[i]]}key=parts.pop();if(arguments.length===1){return curOption[key]===undefined?null:curOption[key]}curOption[key]=value}else{if(arguments.length===1){return this.options[key]===undefined?null:this.options[key]}options[key]=value}}this._setOptions(options);return this},_setOptions:function(options){var key;for(key in options){this._setOption(key,options[key])}return this},_setOption:function(key,value){if(key==="classes"){this._setOptionClasses(value)}this.options[key]=value;if(key==="disabled"){this._setOptionDisabled(value)}return this},_setOptionClasses:function(value){var classKey,elements,currentElements;for(classKey in value){currentElements=this.classesElementLookup[classKey];if(value[classKey]===this.options.classes[classKey]||!currentElements||!currentElements.length){continue}elements=$(currentElements.get());this._removeClass(currentElements,classKey);elements.addClass(this._classes({element:elements,keys:classKey,classes:value,add:true}))}},_setOptionDisabled:function(value){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!value);if(value){this._removeClass(this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus")}},enable:function(){return this._setOptions({disabled:false})},disable:function(){return this._setOptions({disabled:true})},_classes:function(options){var full=[];var that=this;options=$.extend({element:this.element,classes:this.options.classes||{}},options);function processClassString(classes,checkOption){var current,i;for(i=0;i<classes.length;i++){current=that.classesElementLookup[classes[i]]||$();if(options.add){current=$($.unique(current.get().concat(options.element.get())))}else{current=$(current.not(options.element).get())}that.classesElementLookup[classes[i]]=current;full.push(classes[i]);if(checkOption&&options.classes[classes[i]]){full.push(options.classes[classes[i]])}}}this._on(options.element,{remove:"_untrackClassesElement"});if(options.keys){processClassString(options.keys.match(/\S+/g)||[],true)}if(options.extra){processClassString(options.extra.match(/\S+/g)||[])}return full.join(" ")},_untrackClassesElement:function(event){var that=this;$.each(that.classesElementLookup,function(key,value){if($.inArray(event.target,value)!==-1){that.classesElementLookup[key]=$(value.not(event.target).get())}})},_removeClass:function(element,keys,extra){return this._toggleClass(element,keys,extra,false)},_addClass:function(element,keys,extra){return this._toggleClass(element,keys,extra,true)},_toggleClass:function(element,keys,extra,add){add=typeof add==="boolean"?add:extra;var shift=typeof element==="string"||element===null,options={extra:shift?keys:extra,keys:shift?element:keys,element:shift?this.element:element,add:add};options.element.toggleClass(this._classes(options),add);return this},_on:function(suppressDisabledCheck,element,handlers){var delegateElement;var instance=this;if(typeof suppressDisabledCheck!=="boolean"){handlers=element;element=suppressDisabledCheck;suppressDisabledCheck=false}if(!handlers){handlers=element;element=this.element;delegateElement=this.widget()}else{element=delegateElement=$(element);this.bindings=this.bindings.add(element)}$.each(handlers,function(event,handler){function handlerProxy(){if(!suppressDisabledCheck&&(instance.options.disabled===true||$(this).hasClass("ui-state-disabled"))){return}return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments)}if(typeof handler!=="string"){handlerProxy.guid=handler.guid=handler.guid||handlerProxy.guid||$.guid++}var match=event.match(/^([\w:-]*)\s*(.*)$/);var eventName=match[1]+instance.eventNamespace;var selector=match[2];if(selector){delegateElement.on(eventName,selector,handlerProxy)}else{element.on(eventName,handlerProxy)}})},_off:function(element,eventName){eventName=(eventName||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;element.off(eventName).off(eventName);this.bindings=$(this.bindings.not(element).get());this.focusable=$(this.focusable.not(element).get());this.hoverable=$(this.hoverable.not(element).get())},_delay:function(handler,delay){function handlerProxy(){return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments)}var instance=this;return setTimeout(handlerProxy,delay||0)},_hoverable:function(element){this.hoverable=this.hoverable.add(element);this._on(element,{mouseenter:function(event){this._addClass($(event.currentTarget),null,"ui-state-hover")},mouseleave:function(event){this._removeClass($(event.currentTarget),null,"ui-state-hover")}})},_focusable:function(element){this.focusable=this.focusable.add(element);this._on(element,{focusin:function(event){this._addClass($(event.currentTarget),null,"ui-state-focus")},focusout:function(event){this._removeClass($(event.currentTarget),null,"ui-state-focus")}})},_trigger:function(type,event,data){var prop,orig;var callback=this.options[type];data=data||{};event=$.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();event.target=this.element[0];orig=event.originalEvent;if(orig){for(prop in orig){if(!(prop in event)){event[prop]=orig[prop]}}}this.element.trigger(event,data);return!($.isFunction(callback)&&callback.apply(this.element[0],[event].concat(data))===false||event.isDefaultPrevented())}};$.each({show:"fadeIn",hide:"fadeOut"},function(method,defaultEffect){$.Widget.prototype["_"+method]=function(element,options,callback){if(typeof options==="string"){options={effect:options}}var hasOptions;var effectName=!options?method:options===true||typeof options==="number"?defaultEffect:options.effect||defaultEffect;options=options||{};if(typeof options==="number"){options={duration:options}}hasOptions=!$.isEmptyObject(options);options.complete=callback;if(options.delay){element.delay(options.delay)}if(hasOptions&&$.effects&&$.effects.effect[effectName]){element[method](options)}else if(effectName!==method&&element[effectName]){element[effectName](options.duration,options.easing,callback)}else{element.queue(function(next){$(this)[method]();if(callback){callback.call(element[0])}next()})}}});var widget=$.widget;var disableSelection=$.fn.extend({disableSelection:function(){var eventType="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(eventType+".ui-disableSelection",function(event){event.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});var ie=$.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var mouseHandled=false;$(document).on("mouseup",function(){mouseHandled=false});var widgetsMouse=$.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var that=this;this.element.on("mousedown."+this.widgetName,function(event){return that._mouseDown(event)}).on("click."+this.widgetName,function(event){if(true===$.data(event.target,that.widgetName+".preventClickEvent")){$.removeData(event.target,that.widgetName+".preventClickEvent");event.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(this._mouseMoveDelegate){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(event){if(mouseHandled){return}this._mouseMoved=false;this._mouseStarted&&this._mouseUp(event);this._mouseDownEvent=event;var that=this,btnIsLeft=event.which===1,elIsCancel=typeof this.options.cancel==="string"&&event.target.nodeName?$(event.target).closest(this.options.cancel).length:false;if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){that.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=this._mouseStart(event)!==false;if(!this._mouseStarted){event.preventDefault();return true}}if(true===$.data(event.target,this.widgetName+".preventClickEvent")){$.removeData(event.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(event){return that._mouseMove(event)};this._mouseUpDelegate=function(event){return that._mouseUp(event)};this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate);event.preventDefault();mouseHandled=true;return true},_mouseMove:function(event){if(this._mouseMoved){if($.ui.ie&&(!document.documentMode||document.documentMode<9)&&!event.button){return this._mouseUp(event)}else if(!event.which){if(event.originalEvent.altKey||event.originalEvent.ctrlKey||event.originalEvent.metaKey||event.originalEvent.shiftKey){this.ignoreMissingWhich=true}else if(!this.ignoreMissingWhich){return this._mouseUp(event)}}}if(event.which||event.button){this._mouseMoved=true}if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault()}if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,event)!==false;this._mouseStarted?this._mouseDrag(event):this._mouseUp(event)}return!this._mouseStarted},_mouseUp:function(event){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(event.target===this._mouseDownEvent.target){$.data(event.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(event)}if(this._mouseDelayTimer){clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer}this.ignoreMissingWhich=false;mouseHandled=false;event.preventDefault()},_mouseDistanceMet:function(event){return Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}});var plugin=$.ui.plugin={add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]])}},call:function(instance,name,args,allowDisconnected){var i,set=instance.plugins[name];if(!set){return}if(!allowDisconnected&&(!instance.element[0].parentNode||instance.element[0].parentNode.nodeType===11)){return}for(i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args)}}}};$.widget("ui.resizable",$.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(value){return parseFloat(value)||0},_isNumber:function(value){return!isNaN(parseFloat(value))},_hasScroll:function(el,a){if($(el).css("overflow")==="hidden"){return false}var scroll=a&&a==="left"?"scrollLeft":"scrollTop",has=false;if(el[scroll]>0){return true}el[scroll]=1;has=el[scroll]>0;el[scroll]=0;return has},_create:function(){var margins,o=this.options,that=this;this._addClass("ui-resizable");$.extend(this,{_aspectRatio:!!o.aspectRatio,aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap($("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance"));this.elementIsWrapper=true;margins={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")};this.element.css(margins);this.originalElement.css("margin",0);this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css(margins);this._proportionallyResize()}this._setupHandles();if(o.autoHide){$(this.element).on("mouseenter",function(){if(o.disabled){return}that._removeClass("ui-resizable-autohide");that._handles.show()}).on("mouseleave",function(){if(o.disabled){return}if(!that.resizing){that._addClass("ui-resizable-autohide");that._handles.hide()}})}this._mouseInit()},_destroy:function(){this._mouseDestroy();var wrapper,_destroy=function(exp){$(exp).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){_destroy(this.element);wrapper=this.element;this.originalElement.css({position:wrapper.css("position"),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css("top"),left:wrapper.css("left")}).insertAfter(wrapper);wrapper.remove()}this.originalElement.css("resize",this.originalResizeStyle);_destroy(this.originalElement);return this},_setOption:function(key,value){this._super(key,value);switch(key){case"handles":this._removeHandles();this._setupHandles();break;default:break}},_setupHandles:function(){var o=this.options,handle,i,n,hname,axis,that=this;this.handles=o.handles||(!$(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});this._handles=$();if(this.handles.constructor===String){if(this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw"}n=this.handles.split(",");this.handles={};for(i=0;i<n.length;i++){handle=$.trim(n[i]);hname="ui-resizable-"+handle;axis=$("<div>");this._addClass(axis,"ui-resizable-handle "+hname);axis.css({zIndex:o.zIndex});this.handles[handle]=".ui-resizable-"+handle;this.element.append(axis)}}this._renderAxis=function(target){var i,axis,padPos,padWrapper;target=target||this.element;for(i in this.handles){if(this.handles[i].constructor===String){this.handles[i]=this.element.children(this.handles[i]).first().show()}else if(this.handles[i].jquery||this.handles[i].nodeType){this.handles[i]=$(this.handles[i]);this._on(this.handles[i],{mousedown:that._mouseDown})}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){axis=$(this.handles[i],this.element);padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();padPos=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");target.css(padPos,padWrapper);this._proportionallyResize()}this._handles=this._handles.add(this.handles[i])}};this._renderAxis(this.element);this._handles=this._handles.add(this.element.find(".ui-resizable-handle"));this._handles.disableSelection();this._handles.on("mouseover",function(){if(!that.resizing){if(this.className){axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}that.axis=axis&&axis[1]?axis[1]:"se"}});if(o.autoHide){this._handles.hide();this._addClass("ui-resizable-autohide")}},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(event){var i,handle,capture=false;for(i in this.handles){handle=$(this.handles[i])[0];if(handle===event.target||$.contains(handle,event.target)){capture=true}}return!this.options.disabled&&capture},_mouseStart:function(event){var curleft,curtop,cursor,o=this.options,el=this.element;this.resizing=true;this._renderProxy();curleft=this._num(this.helper.css("left"));curtop=this._num(this.helper.css("top"));if(o.containment){curleft+=$(o.containment).scrollLeft()||0;curtop+=$(o.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:el.width(),height:el.height()};this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalPosition={left:curleft,top:curtop};this.originalMousePosition={left:event.pageX,top:event.pageY};this.aspectRatio=typeof o.aspectRatio==="number"?o.aspectRatio:this.originalSize.width/this.originalSize.height||1;cursor=$(".ui-resizable-"+this.axis).css("cursor");$("body").css("cursor",cursor==="auto"?this.axis+"-resize":cursor);this._addClass("ui-resizable-resizing");this._propagate("start",event);return true},_mouseDrag:function(event){var data,props,smp=this.originalMousePosition,a=this.axis,dx=event.pageX-smp.left||0,dy=event.pageY-smp.top||0,trigger=this._change[a];this._updatePrevProperties();if(!trigger){return false}data=trigger.apply(this,[event,dx,dy]);this._updateVirtualBoundaries(event.shiftKey);if(this._aspectRatio||event.shiftKey){data=this._updateRatio(data,event)}data=this._respectSize(data,event);this._updateCache(data);this._propagate("resize",event);props=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}if(!$.isEmptyObject(props)){this._updatePrevProperties();this._trigger("resize",event,this.ui());this._applyChanges()}return false},_mouseStop:function(event){this.resizing=false;var pr,ista,soffseth,soffsetw,s,left,top,o=this.options,that=this;if(this._helper){pr=this._proportionallyResizeElements;ista=pr.length&&/textarea/i.test(pr[0].nodeName);soffseth=ista&&this._hasScroll(pr[0],"left")?0:that.sizeDiff.height;soffsetw=ista?0:that.sizeDiff.width;s={width:that.helper.width()-soffsetw,height:that.helper.height()-soffseth};left=parseFloat(that.element.css("left"))+(that.position.left-that.originalPosition.left)||null;top=parseFloat(that.element.css("top"))+(that.position.top-that.originalPosition.top)||null;if(!o.animate){this.element.css($.extend(s,{top:top,left:left}))}that.helper.height(that.size.height);that.helper.width(that.size.width);if(this._helper&&!o.animate){this._proportionallyResize()}}$("body").css("cursor","auto");this._removeClass("ui-resizable-resizing");this._propagate("stop",event);if(this._helper){this.helper.remove()}return false},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left};this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var props={};if(this.position.top!==this.prevPosition.top){props.top=this.position.top+"px"}if(this.position.left!==this.prevPosition.left){props.left=this.position.left+"px"}if(this.size.width!==this.prevSize.width){props.width=this.size.width+"px"}if(this.size.height!==this.prevSize.height){props.height=this.size.height+"px"}this.helper.css(props);return props},_updateVirtualBoundaries:function(forceAspectRatio){var pMinWidth,pMaxWidth,pMinHeight,pMaxHeight,b,o=this.options;b={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:Infinity,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:Infinity};if(this._aspectRatio||forceAspectRatio){pMinWidth=b.minHeight*this.aspectRatio;pMinHeight=b.minWidth/this.aspectRatio;pMaxWidth=b.maxHeight*this.aspectRatio;pMaxHeight=b.maxWidth/this.aspectRatio;if(pMinWidth>b.minWidth){b.minWidth=pMinWidth}if(pMinHeight>b.minHeight){b.minHeight=pMinHeight}if(pMaxWidth<b.maxWidth){b.maxWidth=pMaxWidth}if(pMaxHeight<b.maxHeight){b.maxHeight=pMaxHeight}}this._vBoundaries=b},_updateCache:function(data){this.offset=this.helper.offset();if(this._isNumber(data.left)){this.position.left=data.left}if(this._isNumber(data.top)){this.position.top=data.top}if(this._isNumber(data.height)){this.size.height=data.height}if(this._isNumber(data.width)){this.size.width=data.width}},_updateRatio:function(data){var cpos=this.position,csize=this.size,a=this.axis;if(this._isNumber(data.height)){data.width=data.height*this.aspectRatio}else if(this._isNumber(data.width)){data.height=data.width/this.aspectRatio}if(a==="sw"){data.left=cpos.left+(csize.width-data.width);data.top=null}if(a==="nw"){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width)}return data},_respectSize:function(data){var o=this._vBoundaries,a=this.axis,ismaxw=this._isNumber(data.width)&&o.maxWidth&&o.maxWidth<data.width,ismaxh=this._isNumber(data.height)&&o.maxHeight&&o.maxHeight<data.height,isminw=this._isNumber(data.width)&&o.minWidth&&o.minWidth>data.width,isminh=this._isNumber(data.height)&&o.minHeight&&o.minHeight>data.height,dw=this.originalPosition.left+this.originalSize.width,dh=this.originalPosition.top+this.originalSize.height,cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw){data.width=o.minWidth}if(isminh){data.height=o.minHeight}if(ismaxw){data.width=o.maxWidth}if(ismaxh){data.height=o.maxHeight}if(isminw&&cw){data.left=dw-o.minWidth}if(ismaxw&&cw){data.left=dw-o.maxWidth}if(isminh&&ch){data.top=dh-o.minHeight}if(ismaxh&&ch){data.top=dh-o.maxHeight}if(!data.width&&!data.height&&!data.left&&data.top){data.top=null}else if(!data.width&&!data.height&&!data.top&&data.left){data.left=null}return data},_getPaddingPlusBorderDimensions:function(element){var i=0,widths=[],borders=[element.css("borderTopWidth"),element.css("borderRightWidth"),element.css("borderBottomWidth"),element.css("borderLeftWidth")],paddings=[element.css("paddingTop"),element.css("paddingRight"),element.css("paddingBottom"),element.css("paddingLeft")];for(;i<4;i++){widths[i]=parseFloat(borders[i])||0;widths[i]+=parseFloat(paddings[i])||0}return{height:widths[0]+widths[2],width:widths[1]+widths[3]}},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return}var prel,i=0,element=this.helper||this.element;for(;i<this._proportionallyResizeElements.length;i++){prel=this._proportionallyResizeElements[i];if(!this.outerDimensions){this.outerDimensions=this._getPaddingPlusBorderDimensions(prel)}prel.css({height:element.height()-this.outerDimensions.height||0,width:element.width()-this.outerDimensions.width||0})}},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(this._helper){this.helper=this.helper||$("<div style='overflow:hidden;'></div>");this._addClass(this.helper,this._helper);this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++o.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(event,dx){return{width:this.originalSize.width+dx}},w:function(event,dx){var cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx}},n:function(event,dx,dy){var cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy}},s:function(event,dx,dy){return{height:this.originalSize.height+dy}},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]);n!=="resize"&&this._trigger(n,event,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});$.ui.plugin.add("resizable","animate",{stop:function(event){var that=$(this).resizable("instance"),o=that.options,pr=that._proportionallyResizeElements,ista=pr.length&&/textarea/i.test(pr[0].nodeName),soffseth=ista&&that._hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,style={width:that.size.width-soffsetw,height:that.size.height-soffseth},left=parseFloat(that.element.css("left"))+(that.position.left-that.originalPosition.left)||null,top=parseFloat(that.element.css("top"))+(that.position.top-that.originalPosition.top)||null;that.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseFloat(that.element.css("width")),height:parseFloat(that.element.css("height")),top:parseFloat(that.element.css("top")),left:parseFloat(that.element.css("left"))};if(pr&&pr.length){$(pr[0]).css({width:data.width,height:data.height})}that._updateCache(data);that._propagate("resize",event)}})}});$.ui.plugin.add("resizable","containment",{start:function(){var element,p,co,ch,cw,width,height,that=$(this).resizable("instance"),o=that.options,el=that.element,oc=o.containment,ce=oc instanceof $?oc.get(0):/parent/.test(oc)?el.parent().get(0):oc;if(!ce){return}that.containerElement=$(ce);if(/document/.test(oc)||oc===document){that.containerOffset={left:0,top:0};that.containerPosition={left:0,top:0};that.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight}}else{element=$(ce);p=[];$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=that._num(element.css("padding"+name))});that.containerOffset=element.offset();that.containerPosition=element.position();that.containerSize={height:element.innerHeight()-p[3],width:element.innerWidth()-p[1]};co=that.containerOffset;ch=that.containerSize.height;cw=that.containerSize.width;width=that._hasScroll(ce,"left")?ce.scrollWidth:cw;height=that._hasScroll(ce)?ce.scrollHeight:ch;that.parentData={element:ce,left:co.left,top:co.top,width:width,height:height}}},resize:function(event){var woset,hoset,isParent,isOffsetRelative,that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cp=that.position,pRatio=that._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=that.containerElement,continueResize=true;if(ce[0]!==document&&/static/.test(ce.css("position"))){cop=co}if(cp.left<(that._helper?co.left:0)){that.size.width=that.size.width+(that._helper?that.position.left-co.left:that.position.left-cop.left);if(pRatio){that.size.height=that.size.width/that.aspectRatio;continueResize=false}that.position.left=o.helper?co.left:0}if(cp.top<(that._helper?co.top:0)){that.size.height=that.size.height+(that._helper?that.position.top-co.top:that.position.top);if(pRatio){that.size.width=that.size.height*that.aspectRatio;continueResize=false}that.position.top=that._helper?co.top:0}isParent=that.containerElement.get(0)===that.element.parent().get(0);isOffsetRelative=/relative|absolute/.test(that.containerElement.css("position"));if(isParent&&isOffsetRelative){that.offset.left=that.parentData.left+that.position.left;that.offset.top=that.parentData.top+that.position.top}else{that.offset.left=that.element.offset().left;that.offset.top=that.element.offset().top}woset=Math.abs(that.sizeDiff.width+(that._helper?that.offset.left-cop.left:that.offset.left-co.left));hoset=Math.abs(that.sizeDiff.height+(that._helper?that.offset.top-cop.top:that.offset.top-co.top));if(woset+that.size.width>=that.parentData.width){that.size.width=that.parentData.width-woset;if(pRatio){that.size.height=that.size.width/that.aspectRatio;continueResize=false}}if(hoset+that.size.height>=that.parentData.height){that.size.height=that.parentData.height-hoset;if(pRatio){that.size.width=that.size.height*that.aspectRatio;continueResize=false}}if(!continueResize){that.position.left=that.prevPosition.left;that.position.top=that.prevPosition.top;that.size.width=that.prevSize.width;that.size.height=that.prevSize.height}},stop:function(){var that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cop=that.containerPosition,ce=that.containerElement,helper=$(that.helper),ho=helper.offset(),w=helper.outerWidth()-that.sizeDiff.width,h=helper.outerHeight()-that.sizeDiff.height;if(that._helper&&!o.animate&&/relative/.test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h})}if(that._helper&&!o.animate&&/static/.test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h})}}});$.ui.plugin.add("resizable","alsoResize",{start:function(){var that=$(this).resizable("instance"),o=that.options;$(o.alsoResize).each(function(){var el=$(this);el.data("ui-resizable-alsoresize",{width:parseFloat(el.width()),height:parseFloat(el.height()),left:parseFloat(el.css("left")),top:parseFloat(el.css("top"))})})},resize:function(event,ui){var that=$(this).resizable("instance"),o=that.options,os=that.originalSize,op=that.originalPosition,delta={height:that.size.height-os.height||0,width:that.size.width-os.width||0,top:that.position.top-op.top||0,left:that.position.left-op.left||0};$(o.alsoResize).each(function(){var el=$(this),start=$(this).data("ui-resizable-alsoresize"),style={},css=el.parents(ui.originalElement[0]).length?["width","height"]:["width","height","top","left"];$.each(css,function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum>=0){style[prop]=sum||null}});el.css(style)})},stop:function(){$(this).removeData("ui-resizable-alsoresize")}});$.ui.plugin.add("resizable","ghost",{start:function(){var that=$(this).resizable("instance"),cs=that.size;that.ghost=that.originalElement.clone();that.ghost.css({opacity:.25,display:"block",position:"relative",height:cs.height,width:cs.width,margin:0,left:0,top:0});that._addClass(that.ghost,"ui-resizable-ghost");if($.uiBackCompat!==false&&typeof that.options.ghost==="string"){that.ghost.addClass(this.options.ghost)}that.ghost.appendTo(that.helper)},resize:function(){var that=$(this).resizable("instance");if(that.ghost){that.ghost.css({position:"relative",height:that.size.height,width:that.size.width})}},stop:function(){var that=$(this).resizable("instance");if(that.ghost&&that.helper){that.helper.get(0).removeChild(that.ghost.get(0))}}});$.ui.plugin.add("resizable","grid",{resize:function(){var outerDimensions,that=$(this).resizable("instance"),o=that.options,cs=that.size,os=that.originalSize,op=that.originalPosition,a=that.axis,grid=typeof o.grid==="number"?[o.grid,o.grid]:o.grid,gridX=grid[0]||1,gridY=grid[1]||1,ox=Math.round((cs.width-os.width)/gridX)*gridX,oy=Math.round((cs.height-os.height)/gridY)*gridY,newWidth=os.width+ox,newHeight=os.height+oy,isMaxWidth=o.maxWidth&&o.maxWidth<newWidth,isMaxHeight=o.maxHeight&&o.maxHeight<newHeight,isMinWidth=o.minWidth&&o.minWidth>newWidth,isMinHeight=o.minHeight&&o.minHeight>newHeight;o.grid=grid;if(isMinWidth){newWidth+=gridX}if(isMinHeight){newHeight+=gridY}if(isMaxWidth){newWidth-=gridX}if(isMaxHeight){newHeight-=gridY}if(/^(se|s|e)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight}else if(/^(ne)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;that.position.top=op.top-oy}else if(/^(sw)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;that.position.left=op.left-ox}else{if(newHeight-gridY<=0||newWidth-gridX<=0){outerDimensions=that._getPaddingPlusBorderDimensions(this)}if(newHeight-gridY>0){that.size.height=newHeight;that.position.top=op.top-oy}else{newHeight=gridY-outerDimensions.height;that.size.height=newHeight;that.position.top=op.top+os.height-newHeight}if(newWidth-gridX>0){that.size.width=newWidth;that.position.left=op.left-ox}else{newWidth=gridX-outerDimensions.width;that.size.width=newWidth;that.position.left=op.left+os.width-newWidth}}}});var widgetsResizable=$.ui.resizable});