Ad Inserter – WordPress Ads Management with AdSense Header Integration - Version 2.6.16

Version Description

  • Added support for ad blocking detection action every n pageviews
  • Added support to individually disable pageview or click tracking (Pro only)
  • Changed IAB TCF v2 cookie check name from euconsent-v2 to tcf-v2 (euconsent-v2 will still work)
  • Fix for category check on category pages
  • Fix for issues with Safari browser
  • Few minor bug fixes, cosmetic changes and code improvements
Download this release

Release Info

Developer spacetime
Plugin Icon 128x128 Ad Inserter – WordPress Ads Management with AdSense Header Integration
Version 2.6.16
Comparing to
See all releases

Code changes from version 2.6.15 to 2.6.16

ad-inserter.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  /*
4
  Plugin Name: Ad Inserter
5
- Version: 2.6.15
6
  Description: Ad management with many advanced advertising features to insert ads at optimal positions
7
  Author: Igor Funa
8
  Author URI: http://igorfuna.com/
@@ -17,6 +17,14 @@ Requires PHP: 5.6
17
 
18
  Change Log
19
 
 
 
 
 
 
 
 
 
20
  Ad Inserter 2.6.15 - 2020-10-02
21
  - No ad blocking detection actions for crawlers and bots
22
  - Fix for processing Ad Inserter shortcodes inside HTML tags
@@ -390,6 +398,7 @@ function ai_toolbar_menu_items () {
390
 
391
  $disable_block_insertions = get_disable_block_insertions ();
392
  $disable_php_processing = get_disable_php_processing ();
 
393
  $disable_css_code = get_disable_css_code ();
394
  $disable_js_code = get_disable_js_code ();
395
  $disable_footer_code = get_disable_footer_code ();
@@ -399,10 +408,11 @@ function ai_toolbar_menu_items () {
399
  $statuses .= '<span class="ai-insertion-status"'. ($disable_footer_code ? ' style="color: #f22"' : '') . '">F</span> &nbsp; ';
400
  $statuses .= '<span class="ai-insertion-status"'. ($disable_js_code ? ' style="color: #f22"' : '') . '">JS</span> &nbsp; ';
401
  $statuses .= '<span class="ai-insertion-status"'. ($disable_css_code ? ' style="color: #f22"' : '') . '">CSS</span> &nbsp; ';
 
402
  $statuses .= '<span class="ai-insertion-status"'. ($disable_php_processing ? ' style="color: #f22"' : '') . '">PHP</span> &nbsp; ';
403
  $statuses .= '<span class="ai-insertion-status"'. ($disable_block_insertions ? ' style="color: #f22"' : '') . '">BLOCKS</span>';
404
 
405
- $insertion_disabled = $disable_block_insertions || $disable_php_processing || $disable_css_code || $disable_js_code || $disable_footer_code || $disable_header_code;
406
 
407
  $ai_wp_data [AI_DEBUG_MENU_ITEMS] = array ();
408
 
@@ -890,6 +900,10 @@ function ai_loop_check ($query, $action) {
890
 
891
  if ($ai_wp_data [AI_WP_AMP_PAGE]) return true;
892
 
 
 
 
 
893
  if (isset ($query) && method_exists ($query, 'is_main_query')) {
894
  if ($query->is_main_query()) {
895
  if (isset ($ai_wp_data [AI_HEAD]) && !$ai_wp_data [AI_HEAD]) {
@@ -1382,7 +1396,10 @@ function ai_post_check ($post, $action) {
1382
  }
1383
 
1384
  function ai_content_marker () {
1385
- if (get_disable_block_insertions ()) return;
 
 
 
1386
 
1387
  echo '<span class="ai-content"></span>', "\n";
1388
  }
@@ -2195,7 +2212,7 @@ function ai_get_client_side_styles () {
2195
  ".ai-rotate {position: relative;}\n" .
2196
  ".ai-rotate-hidden {visibility: hidden;}\n" .
2197
  ".ai-rotate-hidden-2 {position: absolute; top: 0; left: 0; width: 100%; height: 100%;}\n" .
2198
- ".ai-list-data, .ai-ip-data, .ai-fallback, .ai-list-block {".AI_ALIGNMENT_CSS_HIDDEN_LIST."}\n";
2199
  ".ai-list-data, .ai-ip-data, .ai-fallback {min-width: 1px;}\n";
2200
  "";
2201
  }
@@ -2299,11 +2316,16 @@ ul li#wp-admin-bar-ai-toolbar-status {
2299
  return $css;
2300
  }
2301
 
 
2302
  function add_head_inline_styles () {
2303
  global $ai_wp_data;
2304
 
2305
  if (get_disable_css_code ()) return; // Needed for iframes? $ai_wp_data [AI_CODE_FOR_IFRAME]
2306
 
 
 
 
 
2307
  if ($ai_wp_data [AI_CLIENT_SIDE_DETECTION] ||
2308
  get_dynamic_blocks () == AI_DYNAMIC_BLOCKS_CLIENT_SIDE_SHOW ||
2309
  isset ($ai_wp_data [AI_CLIENT_SIDE_ROTATION]) ||
@@ -2311,8 +2333,7 @@ function add_head_inline_styles () {
2311
  $ai_wp_data [AI_HTML_ELEMENT_SELECTION] ||
2312
  !get_inline_styles () ||
2313
  get_admin_toolbar_debugging () && (get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_LOGGED_IN) != 0) ||
2314
- defined ('AI_DEBUGGING_DEMO') ||
2315
- $ai_wp_data [AI_WP_DEBUGGING] != 0) {
2316
 
2317
  echo "<style>\n";
2318
 
@@ -2335,7 +2356,7 @@ function add_head_inline_styles () {
2335
  }
2336
 
2337
  // Before alignment CSS to not override alignment margin
2338
- if ($ai_wp_data [AI_WP_DEBUGGING] != 0) generate_debug_css_base ();
2339
 
2340
  if (!get_inline_styles () && !$ai_wp_data [AI_CODE_FOR_IFRAME]) {
2341
  echo get_alignment_css ();
@@ -2346,14 +2367,13 @@ function add_head_inline_styles () {
2346
  echo ".ai-close-fit {width: fit-content; width: -moz-fit-content;}\n";
2347
  }
2348
 
2349
- if ($ai_wp_data [AI_WP_DEBUGGING] != 0) generate_debug_css ();
2350
 
2351
  if ($ai_wp_data [AI_HTML_ELEMENT_SELECTION]) generate_selection_css ();
2352
 
2353
  echo ai_get_admin_toolbar_debugging_styles ();
2354
 
2355
  echo "</style>\n";
2356
- // No scripts on AMP pages
2357
  }
2358
  }
2359
 
@@ -3723,6 +3743,8 @@ function ai_wp_footer_hook () {
3723
  (get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_LOGGED_IN) != 0) &&
3724
  (($ai_wp_data [AI_WP_DEBUGGING] & (AI_DEBUG_POSITIONS | AI_DEBUG_BLOCKS)) != 0 || (isset ($_GET [AI_URL_DEBUG_PROCESSING_FE]) && $_GET [AI_URL_DEBUG_PROCESSING_FE] != 0))) {
3725
 
 
 
3726
  $class_0 = AI_DEBUG_STATUS_CLASS.' status-error';
3727
  $class_1 = AI_DEBUG_STATUS_CLASS.' status-ok';
3728
  $javascript_text = "<section class='ai-js-0 $class_0'>" . __('JAVASCRIPT NOT WORKING', 'ad-inserter') . "</section><section class='ai-js-1 $class_1' style='display: none;'>" . __('NO JAVASCRIPT ERRORS', 'ad-inserter') . "</section><section class='ai-js-2 $class_0' style='display: none;'>" . __('JAVASCRIPT ERRORS', 'ad-inserter') . "</section>";
@@ -3942,6 +3964,8 @@ function ai_write_debug_info ($write_processing_log = false) {
3942
  echo " (get_the_ID: ", get_the_ID (), ", get_queried_object: ", $queried_object_id, ")";
3943
  echo "\n";
3944
  echo 'POST TYPE: ', get_post_type (), "\n";
 
 
3945
  $category_data = get_the_category();
3946
  $categories = array ();
3947
  foreach ($category_data as $category) {
@@ -3999,12 +4023,13 @@ function ai_write_debug_info ($write_processing_log = false) {
3999
  }
4000
  echo 'POST META: ', str_replace (array ("<!--", "-->", "\n", "\r"), array ("[!--", "--]", "*n", "*r"), implode (', ', $meta_string)), "\n";
4001
  }
 
4002
  break;
4003
  case AI_PT_CATEGORY:
4004
- $category_data = get_the_category();
4005
  $categories = array ();
4006
- foreach ($category_data as $category) {
4007
- $categories []= $category->slug;
4008
  }
4009
  echo 'CATEGORY: ', implode (', ', $categories), "\n";
4010
  break;
@@ -4018,6 +4043,7 @@ function ai_write_debug_info ($write_processing_log = false) {
4018
  break;
4019
  }
4020
 
 
4021
  echo 'AMP PAGE: ', ($ai_wp_data [AI_WP_AMP_PAGE] ? 'YES' : 'NO'), "\n";
4022
  if ($ai_wp_data [AI_WP_AMP_PAGE]) {
4023
  echo 'AMP CSS: ', (isset ($ai_wp_data [AI_AMP_CSS]) ? $ai_wp_data [AI_AMP_CSS] : ''), "\n";
@@ -4700,6 +4726,7 @@ function ai_check_plugin_options ($plugin_options = array ()) {
4700
  if (!isset ($plugin_options ['FRONTEND_JS_DEBUGGING'])) $plugin_options ['FRONTEND_JS_DEBUGGING'] = DEFAULT_FRONTEND_JS_DEBUGGING;
4701
  if (!isset ($plugin_options ['DISABLE_BLOCK_INSERTIONS'])) $plugin_options ['DISABLE_BLOCK_INSERTIONS'] = DEFAULT_DISABLE_BLOCK_INSERTIONS;
4702
  if (!isset ($plugin_options ['DISABLE_PHP_PROCESSING'])) $plugin_options ['DISABLE_PHP_PROCESSING'] = DEFAULT_DISABLE_PHP_PROCESSING;
 
4703
  if (!isset ($plugin_options ['DISABLE_CSS_CODE'])) $plugin_options ['DISABLE_CSS_CODE'] = DEFAULT_DISABLE_CSS_CODE;
4704
  if (!isset ($plugin_options ['DISABLE_JS_CODE'])) $plugin_options ['DISABLE_JS_CODE'] = DEFAULT_DISABLE_JS_CODE;
4705
  if (!isset ($plugin_options ['DISABLE_HEADER_CODE'])) $plugin_options ['DISABLE_HEADER_CODE'] = DEFAULT_DISABLE_HEADER_CODE;
@@ -5119,8 +5146,8 @@ function get_disable_php_processing () {
5119
 
5120
  if (isset ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && get_remote_debugging ()) {
5121
  if ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS] == 'php') return true;
5122
- if (strpos ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS], ',') !== false) {
5123
- $blocks = explode (',', $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]);
5124
  if (in_array ('php', $blocks)) return true;
5125
  }
5126
  }
@@ -5130,6 +5157,24 @@ function get_disable_php_processing () {
5130
  return ($ai_db_options [AI_OPTION_GLOBAL]['DISABLE_PHP_PROCESSING']);
5131
  }
5132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5133
  function get_disable_css_code () {
5134
  global $ai_db_options;
5135
 
@@ -5137,8 +5182,8 @@ function get_disable_css_code () {
5137
 
5138
  if (isset ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && get_remote_debugging ()) {
5139
  if ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS] == 'css') return true;
5140
- if (strpos ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS], ',') !== false) {
5141
- $blocks = explode (',', $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]);
5142
  if (in_array ('css', $blocks)) return true;
5143
  }
5144
  }
@@ -5155,8 +5200,8 @@ function get_disable_js_code () {
5155
 
5156
  if (isset ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && get_remote_debugging ()) {
5157
  if ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS] == 'js') return true;
5158
- if (strpos ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS], ',') !== false) {
5159
- $blocks = explode (',', $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]);
5160
  if (in_array ('js', $blocks)) return true;
5161
  }
5162
  }
@@ -5173,8 +5218,8 @@ function get_disable_header_code () {
5173
 
5174
  if (isset ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && get_remote_debugging ()) {
5175
  if ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS] == 'h') return true;
5176
- if (strpos ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS], ',') !== false) {
5177
- $blocks = explode (',', $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]);
5178
  if (in_array ('h', $blocks)) return true;
5179
  }
5180
  }
@@ -5191,8 +5236,8 @@ function get_disable_footer_code () {
5191
 
5192
  if (isset ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && get_remote_debugging ()) {
5193
  if ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS] == 'f') return true;
5194
- if (strpos ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS], ',') !== false) {
5195
- $blocks = explode (',', $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]);
5196
  if (in_array ('f', $blocks)) return true;
5197
  }
5198
  }
@@ -5412,7 +5457,7 @@ function get_delay_action ($return_number = false) {
5412
  if ($return_number) {
5413
  $value = trim ($ai_db_options [AI_OPTION_GLOBAL]['ADB_DELAY_ACTION']);
5414
  if ($value == '') $value = 0;
5415
- if (is_numeric ($value)) return $value; else return 0;
5416
  }
5417
 
5418
  return ($ai_db_options [AI_OPTION_GLOBAL]['ADB_DELAY_ACTION']);
@@ -6368,7 +6413,7 @@ function generate_viewport_css () {
6368
  $viewport_styles = '';
6369
  $number_of_viewports = count ($viewports);
6370
  if ($number_of_viewports != 0) {
6371
- $viewport_styles = ".ai-viewports {--ai: 1;}\n"; // Dummy style to prevent not loading viewport rules when optimizers join them with other (broken) styles on the page
6372
  foreach ($viewports as $index => $viewport) {
6373
  // if ($viewport ['index'] == 1) {
6374
  if ($index == 0) {
@@ -6977,6 +7022,7 @@ function ai_settings () {
6977
  if (isset ($_POST ['frontend_js_debugging'])) $options ['FRONTEND_JS_DEBUGGING'] = filter_option ('FRONTEND_JS_DEBUGGING', $_POST ['frontend_js_debugging']);
6978
  if (isset ($_POST ['disable-blocks'])) $options ['DISABLE_BLOCK_INSERTIONS'] = filter_option ('DISABLE_BLOCK_INSERTIONS', $_POST ['disable-blocks']);
6979
  if (isset ($_POST ['disable-php-processing'])) $options ['DISABLE_PHP_PROCESSING'] = filter_option ('DISABLE_PHP_PROCESSING', $_POST ['disable-php-processing']);
 
6980
  if (isset ($_POST ['disable-css-code'])) $options ['DISABLE_CSS_CODE'] = filter_option ('DISABLE_CSS_CODE', $_POST ['disable-css-code']);
6981
  if (isset ($_POST ['disable-js-code'])) $options ['DISABLE_JS_CODE'] = filter_option ('DISABLE_JS_CODE', $_POST ['disable-js-code']);
6982
  if (isset ($_POST ['disable-footer-code'])) $options ['DISABLE_FOOTER_CODE'] = filter_option ('DISABLE_FOOTER_CODE', $_POST ['disable-footer-code']);
@@ -8218,7 +8264,14 @@ function ai_custom_hook ($action, $insertion_type, $name, $translated_name = '',
8218
 
8219
  $ai_last_check = AI_CHECK_DEBUG_NO_INSERTION;
8220
  if (!$obj->get_debug_disable_insertion ()) {
8221
- $ad_code .= $obj->get_code_for_serverside_insertion ();
 
 
 
 
 
 
 
8222
  $ai_last_check = AI_CHECK_INSERTED;
8223
  }
8224
  }
@@ -8730,9 +8783,19 @@ function ai_add_attr_data (&$tag, $attr, $new_data) {
8730
  return false;
8731
  }
8732
 
 
 
 
 
 
 
 
 
8733
  function ai_widget_draw ($args, $instance, &$block) {
8734
  global $block_object, $ad_inserter_globals, $ai_wp_data, $ai_last_check, $ai_total_hook_php_time, $filter_hooks;
8735
 
 
 
8736
  $block = isset ($instance ['block']) ? $instance ['block'] : 1;
8737
  $sticky = isset ($instance ['sticky']) ? $instance ['sticky'] : 0;
8738
 
@@ -8749,8 +8812,15 @@ function ai_widget_draw ($args, $instance, &$block) {
8749
  $before_widget = $args ['before_widget'];
8750
  ai_add_attr_data ($before_widget, 'style', 'padding: 0; border: 0; margin: 0; color: transparent; background: transparent;');
8751
  ai_add_attr_data ($before_widget, 'class', 'ai-sticky-widget');
 
 
8752
  echo $before_widget;
 
 
 
8753
  echo $args ['after_widget'];
 
 
8754
  return;
8755
  }
8756
  }
@@ -8801,8 +8871,14 @@ function ai_widget_draw ($args, $instance, &$block) {
8801
  $before_widget = $args ['before_widget'];
8802
  ai_add_attr_data ($before_widget, 'style', 'padding: 0; border: 0; margin: 0; color: transparent; background: transparent;');
8803
  ai_add_attr_data ($before_widget, 'class', 'ai-sticky-widget');
 
 
8804
  echo $before_widget;
 
 
 
8805
  echo $args ['after_widget'];
 
8806
  }
8807
  return;
8808
  }
@@ -8836,19 +8912,31 @@ function ai_widget_draw ($args, $instance, &$block) {
8836
  $sticky_class = $sticky ? ' ai-sticky-widget' : '';
8837
  $widget_classes = trim ($viewport_classes . $sticky_class);
8838
 
 
8839
  if ($widget_classes != "") {
8840
- $before_widget = $args ['before_widget'];
8841
  ai_add_attr_data ($before_widget, 'class', $widget_classes);
8842
- echo $before_widget;
8843
- } else echo $args ['before_widget'];
 
 
8844
 
8845
  if (!empty ($title)) {
8846
- echo $args ['before_title'], apply_filters ('widget_title', $title), $args ['after_title'];
 
 
 
 
 
 
 
 
8847
  }
8848
 
8849
  echo $obj->get_code_for_serverside_insertion (false);
8850
 
 
8851
  echo $args ['after_widget'];
 
8852
 
8853
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_BLOCKS) != 0 && $obj->get_detection_client_side () && $obj->get_client_side_action () == AI_CLIENT_SIDE_ACTION_SHOW)
8854
  echo $obj->get_code_for_serverside_insertion (false, true);
@@ -8990,18 +9078,31 @@ ul.ai-debug-tools .ai-debug-tools-positions {
8990
  function ai_special_widget ($args, $instance, $block) {
8991
  global $ai_wp_data, $ai_db_options, $block_object;
8992
 
 
 
8993
  $sticky = isset ($instance ['sticky']) ? $instance ['sticky'] : 0;
8994
 
8995
  if ($sticky) {
8996
  $ai_wp_data [AI_STICKY_WIDGETS] = true;
8997
  ai_add_attr_data ($args ['before_widget'], 'class', 'ai-sticky-widget');
8998
- echo $args ['before_widget'];
8999
- } else echo $args ['before_widget'];
 
 
 
9000
 
9001
  $title = !empty ($instance ['widget-title']) ? $instance ['widget-title'] : '';
9002
 
9003
  if (!empty ($title)) {
9004
- echo $args ['before_title'], apply_filters ('widget_title', $title), $args ['after_title'];
 
 
 
 
 
 
 
 
9005
  }
9006
 
9007
  switch ($block) {
@@ -9026,7 +9127,9 @@ function ai_special_widget ($args, $instance, $block) {
9026
  break;
9027
  }
9028
 
 
9029
  echo $args ['after_widget'];
 
9030
  }
9031
 
9032
  function ai_is_json ($string, $return_data = false) {
@@ -10034,9 +10137,9 @@ function replace_ai_tags ($content, $general_tag = '') {
10034
  $tags_spaces = $general_tag;
10035
  $smart_tag = $general_tag;
10036
  if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_CATEGORY) {
10037
- $wp_categories = get_the_category();
10038
- if (!empty ($wp_categories)) {
10039
- $first_category = reset ($wp_categories);
10040
  $category = str_replace ("&amp;", "and", $first_category->name);
10041
  if ($category == _x('Uncategorized', 'category name', 'ad-inserter')) $category = $general_tag;
10042
  } else {
@@ -10055,12 +10158,16 @@ function replace_ai_tags ($content, $general_tag = '') {
10055
  $tag = $short_title;
10056
  $smart_tag = $short_title;
10057
 
10058
- $wp_categories = get_the_category();
10059
- if (!empty ($wp_categories)) {
10060
- foreach ($wp_categories as $single_category) {
10061
- $categories_array [] = str_replace (array ("&amp;", "#"), array ("and", ""), isset ($single_category->name) ? $single_category->name : '');
10062
- $category_slugs_array [] = $single_category->slug;
10063
- }
 
 
 
 
10064
 
10065
  $categories = implode (',', $categories_array);
10066
  $categories_spaces = implode (' ', $categories_array);
@@ -10331,7 +10438,6 @@ $ai_wp_data [AI_WP_DEBUGGING_] = 0;
10331
  if (!is_admin()) {
10332
  if (!isset ($_GET [AI_URL_DEBUG_]) || $_GET [AI_URL_DEBUG_] != 0)
10333
  if (isset ($_GET [AI_URL_DEBUG_PROCESSING_]) || isset ($_GET [AI_URL_DEBUG_PROCESSING_FE_]) || (isset ($_COOKIE ['AI_WP_DEBUGGING']) && ($_COOKIE ['AI_WP_DEBUGGING'] & AI_DEBUG_PROCESSING_) != 0)) {
10334
- // if ((!isset ($_GET [AI_URL_DEBUG_PROCESSING_]) || $_GET [AI_URL_DEBUG_PROCESSING_] == 1) || (!isset ($_GET [AI_URL_DEBUG_PROCESSING_FE_]) || $_GET [AI_URL_DEBUG_PROCESSING_FE_] == 1)) {
10335
  if ((isset ($_GET [AI_URL_DEBUG_PROCESSING_]) && $_GET [AI_URL_DEBUG_PROCESSING_] == 1) || (isset ($_GET [AI_URL_DEBUG_PROCESSING_FE_]) && $_GET [AI_URL_DEBUG_PROCESSING_FE_] == 1)) {
10336
  $ai_wp_data [AI_WP_DEBUGGING_] |= AI_DEBUG_PROCESSING_;
10337
 
@@ -10786,7 +10892,9 @@ if (!class_exists ('ai_widget')) {
10786
  $ai_last_check = AI_CHECK_NONE;
10787
 
10788
  $block = 0;
 
10789
  ai_widget_draw ($args, $instance, $block);
 
10790
 
10791
  if ($debug_processing) {
10792
  $ai_total_plugin_time += microtime (true) - $start_time;
2
 
3
  /*
4
  Plugin Name: Ad Inserter
5
+ Version: 2.6.16
6
  Description: Ad management with many advanced advertising features to insert ads at optimal positions
7
  Author: Igor Funa
8
  Author URI: http://igorfuna.com/
17
 
18
  Change Log
19
 
20
+ Ad Inserter 2.6.16 - 2020-10-20
21
+ - Added support for ad blocking detection action every n pageviews
22
+ - Added support to individually disable pageview or click tracking (Pro only)
23
+ - Changed IAB TCF v2 cookie check name from euconsent-v2 to tcf-v2 (euconsent-v2 will still work)
24
+ - Fix for category check on category pages
25
+ - Fix for issues with Safari browser
26
+ - Few minor bug fixes, cosmetic changes and code improvements
27
+
28
  Ad Inserter 2.6.15 - 2020-10-02
29
  - No ad blocking detection actions for crawlers and bots
30
  - Fix for processing Ad Inserter shortcodes inside HTML tags
398
 
399
  $disable_block_insertions = get_disable_block_insertions ();
400
  $disable_php_processing = get_disable_php_processing ();
401
+ $disable_html_code = get_disable_html_code ();
402
  $disable_css_code = get_disable_css_code ();
403
  $disable_js_code = get_disable_js_code ();
404
  $disable_footer_code = get_disable_footer_code ();
408
  $statuses .= '<span class="ai-insertion-status"'. ($disable_footer_code ? ' style="color: #f22"' : '') . '">F</span> &nbsp; ';
409
  $statuses .= '<span class="ai-insertion-status"'. ($disable_js_code ? ' style="color: #f22"' : '') . '">JS</span> &nbsp; ';
410
  $statuses .= '<span class="ai-insertion-status"'. ($disable_css_code ? ' style="color: #f22"' : '') . '">CSS</span> &nbsp; ';
411
+ $statuses .= '<span class="ai-insertion-status"'. ($disable_html_code ? ' style="color: #f22"' : '') . '">HTML</span> &nbsp; ';
412
  $statuses .= '<span class="ai-insertion-status"'. ($disable_php_processing ? ' style="color: #f22"' : '') . '">PHP</span> &nbsp; ';
413
  $statuses .= '<span class="ai-insertion-status"'. ($disable_block_insertions ? ' style="color: #f22"' : '') . '">BLOCKS</span>';
414
 
415
+ $insertion_disabled = $disable_block_insertions || $disable_php_processing || $disable_html_code || $disable_css_code || $disable_js_code || $disable_footer_code || $disable_header_code;
416
 
417
  $ai_wp_data [AI_DEBUG_MENU_ITEMS] = array ();
418
 
900
 
901
  if ($ai_wp_data [AI_WP_AMP_PAGE]) return true;
902
 
903
+ if ($action == 'loop_end' && !method_exists ($query, 'is_main_query') && method_exists ($wp_query, 'is_main_query')) {
904
+ $query = $wp_query;
905
+ }
906
+
907
  if (isset ($query) && method_exists ($query, 'is_main_query')) {
908
  if ($query->is_main_query()) {
909
  if (isset ($ai_wp_data [AI_HEAD]) && !$ai_wp_data [AI_HEAD]) {
1396
  }
1397
 
1398
  function ai_content_marker () {
1399
+ global $ai_wp_data;
1400
+
1401
+ if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_AJAX ||
1402
+ get_disable_html_code ()) return;
1403
 
1404
  echo '<span class="ai-content"></span>', "\n";
1405
  }
2212
  ".ai-rotate {position: relative;}\n" .
2213
  ".ai-rotate-hidden {visibility: hidden;}\n" .
2214
  ".ai-rotate-hidden-2 {position: absolute; top: 0; left: 0; width: 100%; height: 100%;}\n" .
2215
+ ".ai-list-data, .ai-ip-data, .ai-fallback, .ai-list-block, .ai-list-block-ip {".AI_ALIGNMENT_CSS_HIDDEN_LIST."}\n";
2216
  ".ai-list-data, .ai-ip-data, .ai-fallback {min-width: 1px;}\n";
2217
  "";
2218
  }
2316
  return $css;
2317
  }
2318
 
2319
+
2320
  function add_head_inline_styles () {
2321
  global $ai_wp_data;
2322
 
2323
  if (get_disable_css_code ()) return; // Needed for iframes? $ai_wp_data [AI_CODE_FOR_IFRAME]
2324
 
2325
+ $debugging =
2326
+ $ai_wp_data [AI_WP_DEBUGGING] != 0 ||
2327
+ (get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_LOGGED_IN) != 0) && isset ($_GET [AI_URL_DEBUG_PROCESSING_FE]) && $_GET [AI_URL_DEBUG_PROCESSING_FE] != 0;
2328
+
2329
  if ($ai_wp_data [AI_CLIENT_SIDE_DETECTION] ||
2330
  get_dynamic_blocks () == AI_DYNAMIC_BLOCKS_CLIENT_SIDE_SHOW ||
2331
  isset ($ai_wp_data [AI_CLIENT_SIDE_ROTATION]) ||
2333
  $ai_wp_data [AI_HTML_ELEMENT_SELECTION] ||
2334
  !get_inline_styles () ||
2335
  get_admin_toolbar_debugging () && (get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_LOGGED_IN) != 0) ||
2336
+ $debugging) {
 
2337
 
2338
  echo "<style>\n";
2339
 
2356
  }
2357
 
2358
  // Before alignment CSS to not override alignment margin
2359
+ if ($debugging) generate_debug_css_base ();
2360
 
2361
  if (!get_inline_styles () && !$ai_wp_data [AI_CODE_FOR_IFRAME]) {
2362
  echo get_alignment_css ();
2367
  echo ".ai-close-fit {width: fit-content; width: -moz-fit-content;}\n";
2368
  }
2369
 
2370
+ if ($debugging) generate_debug_css ();
2371
 
2372
  if ($ai_wp_data [AI_HTML_ELEMENT_SELECTION]) generate_selection_css ();
2373
 
2374
  echo ai_get_admin_toolbar_debugging_styles ();
2375
 
2376
  echo "</style>\n";
 
2377
  }
2378
  }
2379
 
3743
  (get_remote_debugging () || ($ai_wp_data [AI_WP_USER] & AI_USER_LOGGED_IN) != 0) &&
3744
  (($ai_wp_data [AI_WP_DEBUGGING] & (AI_DEBUG_POSITIONS | AI_DEBUG_BLOCKS)) != 0 || (isset ($_GET [AI_URL_DEBUG_PROCESSING_FE]) && $_GET [AI_URL_DEBUG_PROCESSING_FE] != 0))) {
3745
 
3746
+
3747
+
3748
  $class_0 = AI_DEBUG_STATUS_CLASS.' status-error';
3749
  $class_1 = AI_DEBUG_STATUS_CLASS.' status-ok';
3750
  $javascript_text = "<section class='ai-js-0 $class_0'>" . __('JAVASCRIPT NOT WORKING', 'ad-inserter') . "</section><section class='ai-js-1 $class_1' style='display: none;'>" . __('NO JAVASCRIPT ERRORS', 'ad-inserter') . "</section><section class='ai-js-2 $class_0' style='display: none;'>" . __('JAVASCRIPT ERRORS', 'ad-inserter') . "</section>";
3964
  echo " (get_the_ID: ", get_the_ID (), ", get_queried_object: ", $queried_object_id, ")";
3965
  echo "\n";
3966
  echo 'POST TYPE: ', get_post_type (), "\n";
3967
+ echo 'AUTHOR: ', strtolower (get_the_author_meta ('user_login')), "\n";
3968
+
3969
  $category_data = get_the_category();
3970
  $categories = array ();
3971
  foreach ($category_data as $category) {
4023
  }
4024
  echo 'POST META: ', str_replace (array ("<!--", "-->", "\n", "\r"), array ("[!--", "--]", "*n", "*r"), implode (', ', $meta_string)), "\n";
4025
  }
4026
+
4027
  break;
4028
  case AI_PT_CATEGORY:
4029
+ $category_data = get_queried_object();
4030
  $categories = array ();
4031
+ if ($category_data instanceof WP_Term) {
4032
+ $categories []= $category_data->slug;
4033
  }
4034
  echo 'CATEGORY: ', implode (', ', $categories), "\n";
4035
  break;
4043
  break;
4044
  }
4045
 
4046
+
4047
  echo 'AMP PAGE: ', ($ai_wp_data [AI_WP_AMP_PAGE] ? 'YES' : 'NO'), "\n";
4048
  if ($ai_wp_data [AI_WP_AMP_PAGE]) {
4049
  echo 'AMP CSS: ', (isset ($ai_wp_data [AI_AMP_CSS]) ? $ai_wp_data [AI_AMP_CSS] : ''), "\n";
4726
  if (!isset ($plugin_options ['FRONTEND_JS_DEBUGGING'])) $plugin_options ['FRONTEND_JS_DEBUGGING'] = DEFAULT_FRONTEND_JS_DEBUGGING;
4727
  if (!isset ($plugin_options ['DISABLE_BLOCK_INSERTIONS'])) $plugin_options ['DISABLE_BLOCK_INSERTIONS'] = DEFAULT_DISABLE_BLOCK_INSERTIONS;
4728
  if (!isset ($plugin_options ['DISABLE_PHP_PROCESSING'])) $plugin_options ['DISABLE_PHP_PROCESSING'] = DEFAULT_DISABLE_PHP_PROCESSING;
4729
+ if (!isset ($plugin_options ['DISABLE_HTML_CODE'])) $plugin_options ['DISABLE_HTML_CODE'] = DEFAULT_DISABLE_HTML_CODE;
4730
  if (!isset ($plugin_options ['DISABLE_CSS_CODE'])) $plugin_options ['DISABLE_CSS_CODE'] = DEFAULT_DISABLE_CSS_CODE;
4731
  if (!isset ($plugin_options ['DISABLE_JS_CODE'])) $plugin_options ['DISABLE_JS_CODE'] = DEFAULT_DISABLE_JS_CODE;
4732
  if (!isset ($plugin_options ['DISABLE_HEADER_CODE'])) $plugin_options ['DISABLE_HEADER_CODE'] = DEFAULT_DISABLE_HEADER_CODE;
5146
 
5147
  if (isset ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && get_remote_debugging ()) {
5148
  if ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS] == 'php') return true;
5149
+ if (strpos ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS], '-') !== false) {
5150
+ $blocks = explode ('-', $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]);
5151
  if (in_array ('php', $blocks)) return true;
5152
  }
5153
  }
5157
  return ($ai_db_options [AI_OPTION_GLOBAL]['DISABLE_PHP_PROCESSING']);
5158
  }
5159
 
5160
+ function get_disable_html_code () {
5161
+ global $ai_db_options;
5162
+
5163
+ if (isset ($_GET [AI_URL_DEBUG_DISABLE_HTML_CODE]) && $_GET [AI_URL_DEBUG_DISABLE_HTML_CODE] && get_remote_debugging ()) return true;
5164
+
5165
+ if (isset ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && get_remote_debugging ()) {
5166
+ if ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS] == 'html') return true;
5167
+ if (strpos ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS], '-') !== false) {
5168
+ $blocks = explode ('-', $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]);
5169
+ if (in_array ('html', $blocks)) return true;
5170
+ }
5171
+ }
5172
+
5173
+ if (!isset ($ai_db_options [AI_OPTION_GLOBAL]['DISABLE_HTML_CODE'])) $ai_db_options [AI_OPTION_GLOBAL]['DISABLE_HTML_CODE'] = DEFAULT_DISABLE_CSS_CODE;
5174
+
5175
+ return ($ai_db_options [AI_OPTION_GLOBAL]['DISABLE_HTML_CODE']);
5176
+ }
5177
+
5178
  function get_disable_css_code () {
5179
  global $ai_db_options;
5180
 
5182
 
5183
  if (isset ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && get_remote_debugging ()) {
5184
  if ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS] == 'css') return true;
5185
+ if (strpos ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS], '-') !== false) {
5186
+ $blocks = explode ('-', $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]);
5187
  if (in_array ('css', $blocks)) return true;
5188
  }
5189
  }
5200
 
5201
  if (isset ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && get_remote_debugging ()) {
5202
  if ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS] == 'js') return true;
5203
+ if (strpos ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS], '-') !== false) {
5204
+ $blocks = explode ('-', $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]);
5205
  if (in_array ('js', $blocks)) return true;
5206
  }
5207
  }
5218
 
5219
  if (isset ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && get_remote_debugging ()) {
5220
  if ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS] == 'h') return true;
5221
+ if (strpos ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS], '-') !== false) {
5222
+ $blocks = explode ('-', $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]);
5223
  if (in_array ('h', $blocks)) return true;
5224
  }
5225
  }
5236
 
5237
  if (isset ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && get_remote_debugging ()) {
5238
  if ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS] == 'f') return true;
5239
+ if (strpos ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS], '-') !== false) {
5240
+ $blocks = explode ('-', $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]);
5241
  if (in_array ('f', $blocks)) return true;
5242
  }
5243
  }
5457
  if ($return_number) {
5458
  $value = trim ($ai_db_options [AI_OPTION_GLOBAL]['ADB_DELAY_ACTION']);
5459
  if ($value == '') $value = 0;
5460
+ // if (is_numeric ($value)) return $value; else return 0;
5461
  }
5462
 
5463
  return ($ai_db_options [AI_OPTION_GLOBAL]['ADB_DELAY_ACTION']);
6413
  $viewport_styles = '';
6414
  $number_of_viewports = count ($viewports);
6415
  if ($number_of_viewports != 0) {
6416
+ $viewport_styles = ".ai-viewports {--ai: 1;}\n"; // Mark unprocessed block for viewports, also dummy style to prevent not loading viewport rules when optimizers join them with other (broken) styles on the page
6417
  foreach ($viewports as $index => $viewport) {
6418
  // if ($viewport ['index'] == 1) {
6419
  if ($index == 0) {
7022
  if (isset ($_POST ['frontend_js_debugging'])) $options ['FRONTEND_JS_DEBUGGING'] = filter_option ('FRONTEND_JS_DEBUGGING', $_POST ['frontend_js_debugging']);
7023
  if (isset ($_POST ['disable-blocks'])) $options ['DISABLE_BLOCK_INSERTIONS'] = filter_option ('DISABLE_BLOCK_INSERTIONS', $_POST ['disable-blocks']);
7024
  if (isset ($_POST ['disable-php-processing'])) $options ['DISABLE_PHP_PROCESSING'] = filter_option ('DISABLE_PHP_PROCESSING', $_POST ['disable-php-processing']);
7025
+ if (isset ($_POST ['disable-html-code'])) $options ['DISABLE_HTML_CODE'] = filter_option ('DISABLE_HTML_CODE', $_POST ['disable-html-code']);
7026
  if (isset ($_POST ['disable-css-code'])) $options ['DISABLE_CSS_CODE'] = filter_option ('DISABLE_CSS_CODE', $_POST ['disable-css-code']);
7027
  if (isset ($_POST ['disable-js-code'])) $options ['DISABLE_JS_CODE'] = filter_option ('DISABLE_JS_CODE', $_POST ['disable-js-code']);
7028
  if (isset ($_POST ['disable-footer-code'])) $options ['DISABLE_FOOTER_CODE'] = filter_option ('DISABLE_FOOTER_CODE', $_POST ['disable-footer-code']);
8264
 
8265
  $ai_last_check = AI_CHECK_DEBUG_NO_INSERTION;
8266
  if (!$obj->get_debug_disable_insertion ()) {
8267
+ $block_code = $obj->get_code_for_serverside_insertion ();
8268
+
8269
+ if ($action == 'wp_head') {
8270
+ // Replace div tag in the head with meta tag
8271
+ $block_code = preg_replace ("#<div class='ai-dynamic (.+?)></div>#", "<meta class='ai-dynamic $1 />", $block_code);
8272
+ }
8273
+
8274
+ $ad_code .= $block_code;
8275
  $ai_last_check = AI_CHECK_INSERTED;
8276
  }
8277
  }
8783
  return false;
8784
  }
8785
 
8786
+ function ai_debug_widget_comment ($label, $end = false) {
8787
+ $end_label = '';
8788
+ if ($end) {
8789
+ $end_label = '/';
8790
+ }
8791
+ echo "<!-- {$end_label}AI $label -->";
8792
+ }
8793
+
8794
  function ai_widget_draw ($args, $instance, &$block) {
8795
  global $block_object, $ad_inserter_globals, $ai_wp_data, $ai_last_check, $ai_total_hook_php_time, $filter_hooks;
8796
 
8797
+ $debug_processing = ($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0;
8798
+
8799
  $block = isset ($instance ['block']) ? $instance ['block'] : 1;
8800
  $sticky = isset ($instance ['sticky']) ? $instance ['sticky'] : 0;
8801
 
8812
  $before_widget = $args ['before_widget'];
8813
  ai_add_attr_data ($before_widget, 'style', 'padding: 0; border: 0; margin: 0; color: transparent; background: transparent;');
8814
  ai_add_attr_data ($before_widget, 'class', 'ai-sticky-widget');
8815
+
8816
+ if ($debug_processing) echo ai_debug_widget_comment ('before_widget');
8817
  echo $before_widget;
8818
+ if ($debug_processing) echo ai_debug_widget_comment ('before_widget', true);
8819
+
8820
+ if ($debug_processing) echo ai_debug_widget_comment ('after_widget');
8821
  echo $args ['after_widget'];
8822
+ if ($debug_processing) echo ai_debug_widget_comment ('after_widget', true);
8823
+
8824
  return;
8825
  }
8826
  }
8871
  $before_widget = $args ['before_widget'];
8872
  ai_add_attr_data ($before_widget, 'style', 'padding: 0; border: 0; margin: 0; color: transparent; background: transparent;');
8873
  ai_add_attr_data ($before_widget, 'class', 'ai-sticky-widget');
8874
+
8875
+ if ($debug_processing) echo ai_debug_widget_comment ('before_widget');
8876
  echo $before_widget;
8877
+ if ($debug_processing) echo ai_debug_widget_comment ('before_widget', true);
8878
+
8879
+ if ($debug_processing) echo ai_debug_widget_comment ('after_widget');
8880
  echo $args ['after_widget'];
8881
+ if ($debug_processing) echo ai_debug_widget_comment ('after_widget', true);
8882
  }
8883
  return;
8884
  }
8912
  $sticky_class = $sticky ? ' ai-sticky-widget' : '';
8913
  $widget_classes = trim ($viewport_classes . $sticky_class);
8914
 
8915
+ $before_widget = $args ['before_widget'];
8916
  if ($widget_classes != "") {
 
8917
  ai_add_attr_data ($before_widget, 'class', $widget_classes);
8918
+ }
8919
+ if ($debug_processing) echo ai_debug_widget_comment ('before_widget');
8920
+ echo $before_widget;
8921
+ if ($debug_processing) echo ai_debug_widget_comment ('before_widget', true);
8922
 
8923
  if (!empty ($title)) {
8924
+ if ($debug_processing) echo ai_debug_widget_comment ('before_title');
8925
+ echo $args ['before_title'];
8926
+ if ($debug_processing) echo ai_debug_widget_comment ('before_title', true);
8927
+
8928
+ echo apply_filters ('widget_title', $title);
8929
+
8930
+ if ($debug_processing) echo ai_debug_widget_comment ('after_title');
8931
+ echo $args ['after_title'];
8932
+ if ($debug_processing) echo ai_debug_widget_comment ('after_title', true);
8933
  }
8934
 
8935
  echo $obj->get_code_for_serverside_insertion (false);
8936
 
8937
+ if ($debug_processing) echo ai_debug_widget_comment ('after_widget');
8938
  echo $args ['after_widget'];
8939
+ if ($debug_processing) echo ai_debug_widget_comment ('after_widget', true);
8940
 
8941
  if (($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_BLOCKS) != 0 && $obj->get_detection_client_side () && $obj->get_client_side_action () == AI_CLIENT_SIDE_ACTION_SHOW)
8942
  echo $obj->get_code_for_serverside_insertion (false, true);
9078
  function ai_special_widget ($args, $instance, $block) {
9079
  global $ai_wp_data, $ai_db_options, $block_object;
9080
 
9081
+ $debug_processing = ($ai_wp_data [AI_WP_DEBUGGING] & AI_DEBUG_PROCESSING) != 0;
9082
+
9083
  $sticky = isset ($instance ['sticky']) ? $instance ['sticky'] : 0;
9084
 
9085
  if ($sticky) {
9086
  $ai_wp_data [AI_STICKY_WIDGETS] = true;
9087
  ai_add_attr_data ($args ['before_widget'], 'class', 'ai-sticky-widget');
9088
+ }
9089
+
9090
+ if ($debug_processing) echo ai_debug_widget_comment ('before_widget');
9091
+ echo $args ['before_widget'];
9092
+ if ($debug_processing) echo ai_debug_widget_comment ('before_widget', true);
9093
 
9094
  $title = !empty ($instance ['widget-title']) ? $instance ['widget-title'] : '';
9095
 
9096
  if (!empty ($title)) {
9097
+ if ($debug_processing) echo ai_debug_widget_comment ('before_title');
9098
+ echo $args ['before_title'];
9099
+ if ($debug_processing) echo ai_debug_widget_comment ('before_title', true);
9100
+
9101
+ echo apply_filters ('widget_title', $title);
9102
+
9103
+ if ($debug_processing) echo ai_debug_widget_comment ('after_title');
9104
+ echo $args ['after_title'];
9105
+ if ($debug_processing) echo ai_debug_widget_comment ('after_title', true);
9106
  }
9107
 
9108
  switch ($block) {
9127
  break;
9128
  }
9129
 
9130
+ if ($debug_processing) echo ai_debug_widget_comment ('after_widget');
9131
  echo $args ['after_widget'];
9132
+ if ($debug_processing) echo ai_debug_widget_comment ('after_widget', true);
9133
  }
9134
 
9135
  function ai_is_json ($string, $return_data = false) {
10137
  $tags_spaces = $general_tag;
10138
  $smart_tag = $general_tag;
10139
  if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_CATEGORY) {
10140
+ $wp_categories = get_queried_object ();
10141
+ if (!empty ($wp_categories) && $wp_categories instanceof WP_Term) {
10142
+ $first_category = $wp_categories;
10143
  $category = str_replace ("&amp;", "and", $first_category->name);
10144
  if ($category == _x('Uncategorized', 'category name', 'ad-inserter')) $category = $general_tag;
10145
  } else {
10158
  $tag = $short_title;
10159
  $smart_tag = $short_title;
10160
 
10161
+ // $wp_categories = get_the_category();
10162
+ // if (!empty ($wp_categories)) {
10163
+ // foreach ($wp_categories as $single_category) {
10164
+ // $categories_array [] = str_replace (array ("&amp;", "#"), array ("and", ""), isset ($single_category->name) ? $single_category->name : '');
10165
+ // $category_slugs_array [] = $single_category->slug;
10166
+ // }
10167
+ $wp_categories = get_queried_object();
10168
+ if ($wp_categories instanceof WP_Term) {
10169
+ $categories_array [] = str_replace (array ("&amp;", "#"), array ("and", ""), isset ($wp_categories->name) ? $wp_categories->name : '');
10170
+ $category_slugs_array [] = $wp_categories->slug;
10171
 
10172
  $categories = implode (',', $categories_array);
10173
  $categories_spaces = implode (' ', $categories_array);
10438
  if (!is_admin()) {
10439
  if (!isset ($_GET [AI_URL_DEBUG_]) || $_GET [AI_URL_DEBUG_] != 0)
10440
  if (isset ($_GET [AI_URL_DEBUG_PROCESSING_]) || isset ($_GET [AI_URL_DEBUG_PROCESSING_FE_]) || (isset ($_COOKIE ['AI_WP_DEBUGGING']) && ($_COOKIE ['AI_WP_DEBUGGING'] & AI_DEBUG_PROCESSING_) != 0)) {
 
10441
  if ((isset ($_GET [AI_URL_DEBUG_PROCESSING_]) && $_GET [AI_URL_DEBUG_PROCESSING_] == 1) || (isset ($_GET [AI_URL_DEBUG_PROCESSING_FE_]) && $_GET [AI_URL_DEBUG_PROCESSING_FE_] == 1)) {
10442
  $ai_wp_data [AI_WP_DEBUGGING_] |= AI_DEBUG_PROCESSING_;
10443
 
10892
  $ai_last_check = AI_CHECK_NONE;
10893
 
10894
  $block = 0;
10895
+ if ($debug_processing) ai_debug_widget_comment ('widget');
10896
  ai_widget_draw ($args, $instance, $block);
10897
+ if ($debug_processing) ai_debug_widget_comment ('widget', true);
10898
 
10899
  if ($debug_processing) {
10900
  $ai_total_plugin_time += microtime (true) - $start_time;
class.php CHANGED
@@ -751,8 +751,8 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
751
 
752
  if (isset ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && get_remote_debugging ()) {
753
  if (is_numeric ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS] == $this->number) return true;
754
- if (strpos ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS], ',') !== false) {
755
- $blocks = explode (',', $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]);
756
  if (in_array ($this->number, $blocks)) return true;
757
  }
758
  }
@@ -1501,7 +1501,19 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1501
  return trim ($style);
1502
  }
1503
 
 
 
 
 
 
 
 
 
 
 
 
1504
  public function alignment_style ($alignment_type, $all_styles = false, $full_sticky_style = true) {
 
1505
 
1506
  $style = "";
1507
  switch ($alignment_type) {
@@ -1509,13 +1521,13 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
1509
  $style = AI_ALIGNMENT_CSS_DEFAULT;
1510
  break;
1511
  case AI_ALIGNMENT_LEFT:
1512
- $style = AI_ALIGNMENT_CSS_LEFT;
1513
  break;
1514
  case AI_ALIGNMENT_RIGHT:
1515
- $style = AI_ALIGNMENT_CSS_RIGHT;
1516
  break;
1517
  case AI_ALIGNMENT_CENTER:
1518
- $style = AI_ALIGNMENT_CSS_CENTER;
1519
  break;
1520
  case AI_ALIGNMENT_FLOAT_LEFT:
1521
  $style = AI_ALIGNMENT_CSS_FLOAT_LEFT;
@@ -2657,14 +2669,14 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
2657
  $script_class = ' class="' . $script_class . '"';
2658
  }
2659
 
2660
- $code = "<script{$script_class}>
2661
  ai_run_{$id} = function(){if (typeof ai_js_code == 'boolean') {{$js_code}};};
2662
  if (document.readyState === 'complete' || (document.readyState !== 'loading' && !document.documentElement.doScroll)) ai_run_{$id} (); else document.addEventListener ('DOMContentLoaded', ai_run_{$id});
2663
  </script>
2664
  ";
2665
- } else $code = '';
2666
 
2667
- return $code . ai_js_dom_ready ($js_code, $script_tag, $script_class);
2668
  }
2669
 
2670
  public function ai_check_wait_for ($js_code) {
@@ -2770,7 +2782,6 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
2770
 
2771
  $ai_dbg_code = base64_encode ($invisible_label);
2772
  $processed_code .= "<div class='{$code_id}-dbg' data-insertion='after' data-selector='.{$code_id}-dbg' data-insertion-no-dbg data-code='$ai_dbg_code'></div>\n";
2773
- // $js_code = "ai_insert_code (document.getElementsByClassName ('{$code_id}-dbg') [0]);";
2774
  $js_code = "ai_insert_code_by_class ('{$code_id}-dbg');";
2775
  $processed_code .= $this->ai_js_dom_ready ($js_code);
2776
  }
@@ -2884,7 +2895,14 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
2884
 
2885
  if (!$ai_wp_data [AI_CODE_FOR_IFRAME]) {
2886
  $alignment_type = $this->get_alignment_type ();
2887
- if ($force_close_button || (($close_button != AI_CLOSE_NONE || $auto_close_time) && !$ai_wp_data [AI_WP_AMP_PAGE] && $alignment_type != AI_ALIGNMENT_NO_WRAPPING && !$this->get_background ())) {
 
 
 
 
 
 
 
2888
  switch ($close_button) {
2889
  case AI_CLOSE_TOP_RIGHT:
2890
  $button_class = 'ai-close-button ai-close-unprocessed';
@@ -3899,7 +3917,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
3899
  $processed_code = $debug_processed_code . $processed_code;
3900
  }
3901
 
3902
- if ($url_parameter_attributes_dbg != '' && ($this->get_manual_loading () == AI_MANUAL_LOADING_AUTO || strpos ($url_parameters_raw, 'euconsent-v2') !== false)) {
3903
  $debug_manual_loading = new ai_block_labels ('ai-debug-lists');
3904
 
3905
  $version_name = $this->version_name == '' ? '' : ' - ' . $this->version_name;
@@ -4045,7 +4063,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
4045
  $this->client_side_list_detection = true;
4046
 
4047
  if ($ai_wp_data [AI_WP_AMP_PAGE]) $this->needs_class = true;
4048
- $this->wrapping_div_classes []= 'ai-list-block';
4049
 
4050
  switch ($dynamic_blocks) {
4051
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE_SHOW:
@@ -4382,7 +4400,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
4382
  $classes = array ();
4383
  if ($block_class_name != '' && ($block_class || $block_number_class || $block_name_class) || $alignment_class != '' || $size_class != '' || $viewport_classes != '') {
4384
  if ($block_class_name != '' && ($block_class || $this->needs_class)) $classes []= $block_class_name;
4385
- if ($alignment_class) $classes []= $alignment_class;
4386
  if ($size_class) $classes []= $size_class;
4387
  if ($block_class_name != '' && ($block_number_class || $this->needs_class)) $classes []= $block_class_name . "-" . $this->number;
4388
  if ($block_class_name != '' && $block_name_class) $classes []= $block_class_name . "-" . $this->get_name_class ();
@@ -4485,7 +4503,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
4485
  } else $class = "";
4486
 
4487
  if ($w3tc) {
4488
- if ($ai_wp_data [AI_WP_AMP_PAGE] || ($alignment_class != '' && defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !get_inline_styles ())) {
4489
  $wrapper_before = $this->hidden_viewports . "<div" . $class . $tracking_code_pre . $tracking_code_data . $tracking_code_post . $sticky_parameters . ">\n";
4490
  } else {
4491
  $wrapper_before = $this->hidden_viewports . "<div" . $class . $tracking_code_pre . $tracking_code_data . $tracking_code_post . $sticky_parameters . " style='" . $additional_block_style . $alignment_style . "'>\n";
@@ -4519,7 +4537,7 @@ abstract class ai_CodeBlock extends ai_BaseCodeBlock {
4519
 
4520
  $code = $this->generate_html_from_w3tc_code ();
4521
  } else {
4522
- if ($ai_wp_data [AI_WP_AMP_PAGE] || ($alignment_class != '' && defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !get_inline_styles ())) {
4523
  $wrapper_before = $this->hidden_viewports . "<div" . $class . $tracking_code . $sticky_parameters . ">\n";
4524
  } else {
4525
  $wrapper_before = $this->hidden_viewports . "<div" . $class . $tracking_code . $sticky_parameters . " style='" . $additional_block_style . $alignment_style . "'>\n";
@@ -7372,7 +7390,19 @@ echo '</body>
7372
 
7373
  if ($categories == AD_EMPTY_DATA) return true;
7374
 
7375
- $wp_categories = get_the_category ();
 
 
 
 
 
 
 
 
 
 
 
 
7376
 
7377
  if ($cat_type == AI_BLACK_LIST) {
7378
 
@@ -7540,7 +7570,7 @@ echo '</body>
7540
  }
7541
  elseif (strpos ($taxonomy_disabled, 'author:') === 0) {
7542
  if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_POST || $ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_STATIC)
7543
- $current_author = get_the_author_meta ('user_login'); else
7544
  $current_author = '';
7545
  $terms = explode (':', $taxonomy_disabled);
7546
  if ($terms [1] == $current_author) return false;
@@ -7650,7 +7680,7 @@ echo '</body>
7650
  }
7651
  elseif (strpos ($taxonomy_enabled, 'author:') === 0) {
7652
  if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_POST || $ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_STATIC)
7653
- $current_author = get_the_author_meta ('user_login'); else
7654
  $current_author = '';
7655
  $terms = explode (':', $taxonomy_enabled);
7656
  if ($terms [1] == $current_author) return true;
751
 
752
  if (isset ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && get_remote_debugging ()) {
753
  if (is_numeric ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]) && $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS] == $this->number) return true;
754
+ if (strpos ($_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS], '-') !== false) {
755
+ $blocks = explode ('-', $_GET [AI_URL_DEBUG_DISABLE_BLOCK_INSERTIONS]);
756
  if (in_array ($this->number, $blocks)) return true;
757
  }
758
  }
1501
  return trim ($style);
1502
  }
1503
 
1504
+ public function alignment_style_for_amp ($alignment_style) {
1505
+ global $ai_wp_data;
1506
+
1507
+ // Remove display property on AMP pages when using client-side device detection
1508
+ if ($ai_wp_data [AI_WP_AMP_PAGE] && $this->get_detection_client_side()) {
1509
+ return (str_replace ('display: block; ', '', $alignment_style));
1510
+ }
1511
+
1512
+ return $alignment_style;
1513
+ }
1514
+
1515
  public function alignment_style ($alignment_type, $all_styles = false, $full_sticky_style = true) {
1516
+ global $ai_wp_data;
1517
 
1518
  $style = "";
1519
  switch ($alignment_type) {
1521
  $style = AI_ALIGNMENT_CSS_DEFAULT;
1522
  break;
1523
  case AI_ALIGNMENT_LEFT:
1524
+ $style = $this->alignment_style_for_amp (AI_ALIGNMENT_CSS_LEFT);
1525
  break;
1526
  case AI_ALIGNMENT_RIGHT:
1527
+ $style = $this->alignment_style_for_amp (AI_ALIGNMENT_CSS_RIGHT);
1528
  break;
1529
  case AI_ALIGNMENT_CENTER:
1530
+ $style = $this->alignment_style_for_amp (AI_ALIGNMENT_CSS_CENTER);
1531
  break;
1532
  case AI_ALIGNMENT_FLOAT_LEFT:
1533
  $style = AI_ALIGNMENT_CSS_FLOAT_LEFT;
2669
  $script_class = ' class="' . $script_class . '"';
2670
  }
2671
 
2672
+ $code = "<script{$script_class}>". ai_get_js ('ai-base64') . "
2673
  ai_run_{$id} = function(){if (typeof ai_js_code == 'boolean') {{$js_code}};};
2674
  if (document.readyState === 'complete' || (document.readyState !== 'loading' && !document.documentElement.doScroll)) ai_run_{$id} (); else document.addEventListener ('DOMContentLoaded', ai_run_{$id});
2675
  </script>
2676
  ";
2677
+ } else $code = ai_js_dom_ready ($js_code, $script_tag, $script_class);
2678
 
2679
+ return $code;
2680
  }
2681
 
2682
  public function ai_check_wait_for ($js_code) {
2782
 
2783
  $ai_dbg_code = base64_encode ($invisible_label);
2784
  $processed_code .= "<div class='{$code_id}-dbg' data-insertion='after' data-selector='.{$code_id}-dbg' data-insertion-no-dbg data-code='$ai_dbg_code'></div>\n";
 
2785
  $js_code = "ai_insert_code_by_class ('{$code_id}-dbg');";
2786
  $processed_code .= $this->ai_js_dom_ready ($js_code);
2787
  }
2895
 
2896
  if (!$ai_wp_data [AI_CODE_FOR_IFRAME]) {
2897
  $alignment_type = $this->get_alignment_type ();
2898
+ if ($force_close_button ||
2899
+ (($close_button != AI_CLOSE_NONE || $auto_close_time) &&
2900
+ !$ai_wp_data [AI_WP_AMP_PAGE] &&
2901
+ $alignment_type != AI_ALIGNMENT_NO_WRAPPING &&
2902
+ !(($alignment_type == AI_ALIGNMENT_STICKY) && $this->get_background ())
2903
+ )
2904
+ ) {
2905
+
2906
  switch ($close_button) {
2907
  case AI_CLOSE_TOP_RIGHT:
2908
  $button_class = 'ai-close-button ai-close-unprocessed';
3917
  $processed_code = $debug_processed_code . $processed_code;
3918
  }
3919
 
3920
+ if ($url_parameter_attributes_dbg != '' && ($this->get_manual_loading () == AI_MANUAL_LOADING_AUTO || strpos ($url_parameters_raw, 'tcf-v2') !== false || strpos ($url_parameters_raw, 'euconsent-v2') !== false)) {
3921
  $debug_manual_loading = new ai_block_labels ('ai-debug-lists');
3922
 
3923
  $version_name = $this->version_name == '' ? '' : ' - ' . $this->version_name;
4063
  $this->client_side_list_detection = true;
4064
 
4065
  if ($ai_wp_data [AI_WP_AMP_PAGE]) $this->needs_class = true;
4066
+ $this->wrapping_div_classes []= 'ai-list-block-ip';
4067
 
4068
  switch ($dynamic_blocks) {
4069
  case AI_DYNAMIC_BLOCKS_CLIENT_SIDE_SHOW:
4400
  $classes = array ();
4401
  if ($block_class_name != '' && ($block_class || $block_number_class || $block_name_class) || $alignment_class != '' || $size_class != '' || $viewport_classes != '') {
4402
  if ($block_class_name != '' && ($block_class || $this->needs_class)) $classes []= $block_class_name;
4403
+ if ($alignment_class && !get_inline_styles ()) $classes []= $alignment_class;
4404
  if ($size_class) $classes []= $size_class;
4405
  if ($block_class_name != '' && ($block_number_class || $this->needs_class)) $classes []= $block_class_name . "-" . $this->number;
4406
  if ($block_class_name != '' && $block_name_class) $classes []= $block_class_name . "-" . $this->get_name_class ();
4503
  } else $class = "";
4504
 
4505
  if ($w3tc) {
4506
+ if (/*$ai_wp_data [AI_WP_AMP_PAGE] ||*/ ($alignment_class != '' && defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !get_inline_styles ())) {
4507
  $wrapper_before = $this->hidden_viewports . "<div" . $class . $tracking_code_pre . $tracking_code_data . $tracking_code_post . $sticky_parameters . ">\n";
4508
  } else {
4509
  $wrapper_before = $this->hidden_viewports . "<div" . $class . $tracking_code_pre . $tracking_code_data . $tracking_code_post . $sticky_parameters . " style='" . $additional_block_style . $alignment_style . "'>\n";
4537
 
4538
  $code = $this->generate_html_from_w3tc_code ();
4539
  } else {
4540
+ if (/*$ai_wp_data [AI_WP_AMP_PAGE] ||*/ ($alignment_class != '' && defined ('AI_NORMAL_HEADER_STYLES') && AI_NORMAL_HEADER_STYLES && !get_inline_styles ())) {
4541
  $wrapper_before = $this->hidden_viewports . "<div" . $class . $tracking_code . $sticky_parameters . ">\n";
4542
  } else {
4543
  $wrapper_before = $this->hidden_viewports . "<div" . $class . $tracking_code . $sticky_parameters . " style='" . $additional_block_style . $alignment_style . "'>\n";
7390
 
7391
  if ($categories == AD_EMPTY_DATA) return true;
7392
 
7393
+ switch ($ai_wp_data [AI_WP_PAGE_TYPE]) {
7394
+ case AI_PT_STATIC:
7395
+ case AI_PT_POST:
7396
+ $wp_categories = get_the_category ();
7397
+ break;
7398
+ default:
7399
+ $wp_categories = get_queried_object();
7400
+
7401
+ if ($wp_categories instanceof WP_Term) {
7402
+ $wp_categories = array ($wp_categories);
7403
+ } else $wp_categories = array ();
7404
+ break;
7405
+ }
7406
 
7407
  if ($cat_type == AI_BLACK_LIST) {
7408
 
7570
  }
7571
  elseif (strpos ($taxonomy_disabled, 'author:') === 0) {
7572
  if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_POST || $ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_STATIC)
7573
+ $current_author = strtolower (get_the_author_meta ('user_login')); else
7574
  $current_author = '';
7575
  $terms = explode (':', $taxonomy_disabled);
7576
  if ($terms [1] == $current_author) return false;
7680
  }
7681
  elseif (strpos ($taxonomy_enabled, 'author:') === 0) {
7682
  if ($ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_POST || $ai_wp_data [AI_WP_PAGE_TYPE] == AI_PT_STATIC)
7683
+ $current_author = strtolower (get_the_author_meta ('user_login')); else
7684
  $current_author = '';
7685
  $terms = explode (':', $taxonomy_enabled);
7686
  if ($terms [1] == $current_author) return true;
constants.php CHANGED
@@ -31,7 +31,7 @@ if (!defined( 'AD_INSERTER_NAME'))
31
  define ('AD_INSERTER_NAME', 'Ad Inserter');
32
 
33
  if (!defined( 'AD_INSERTER_VERSION'))
34
- define ('AD_INSERTER_VERSION', '2.6.15');
35
 
36
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
37
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
@@ -533,7 +533,7 @@ define('AI_ALIGNMENT_CSS_AMP_LEFT', 'display: flex; justify-content: flex-
533
  define('AI_ALIGNMENT_CSS_AMP_RIGHT', 'display: flex; justify-content: flex-end;');
534
  define('AI_ALIGNMENT_CSS_AMP_CENTER', 'display: flex; justify-content: center;');
535
 
536
- define('AI_ALIGNMENT_CSS_HIDDEN_LIST', 'visibility: hidden; position: absolute; width: 50%; height: 1px; z-index: -9999;');
537
 
538
 
539
  // List Type - deprecated
@@ -899,6 +899,7 @@ define ('DEFAULT_DISPLAY_FOR_DEVICES', AI_INSERT_FOR_DESKTOP_DEVICES);
899
  define ('DEFAULT_GENERAL_TAG', '');
900
  define ('DEFAULT_DISABLE_BLOCK_INSERTIONS', AI_DISABLED);
901
  define ('DEFAULT_DISABLE_PHP_PROCESSING', AI_DISABLED);
 
902
  define ('DEFAULT_DISABLE_CSS_CODE', AI_DISABLED);
903
  define ('DEFAULT_DISABLE_JS_CODE', AI_DISABLED);
904
  define ('DEFAULT_DISABLE_FOOTER_CODE', AI_DISABLED);
@@ -1185,6 +1186,7 @@ define ('AI_URL_DEBUG_AD_BLOCKING_STATUS', 'ai-debug-adb-status');
1185
  define ('AI_URL_DEBUG_JAVASCRIPT', 'ai-debug-js');
1186
  define ('AI_URL_DEBUG_META', 'ai-debug-meta');
1187
 
 
1188
  define ('AI_URL_DEBUG_DISABLE_CSS_CODE', 'ai-debug-disable-css-code');
1189
  define ('AI_URL_DEBUG_DISABLE_JS_CODE', 'ai-debug-disable-js-code');
1190
  define ('AI_URL_DEBUG_DISABLE_PHP_PROCESSING', 'ai-debug-disable-php-processing');
31
  define ('AD_INSERTER_NAME', 'Ad Inserter');
32
 
33
  if (!defined( 'AD_INSERTER_VERSION'))
34
+ define ('AD_INSERTER_VERSION', '2.6.16');
35
 
36
  if (!defined ('AD_INSERTER_PLUGIN_BASENAME'))
37
  define ('AD_INSERTER_PLUGIN_BASENAME', plugin_basename (__FILE__));
533
  define('AI_ALIGNMENT_CSS_AMP_RIGHT', 'display: flex; justify-content: flex-end;');
534
  define('AI_ALIGNMENT_CSS_AMP_CENTER', 'display: flex; justify-content: center;');
535
 
536
+ define('AI_ALIGNMENT_CSS_HIDDEN_LIST', 'visibility: hidden; position: absolute; width: 50%; height: 1px; top: -1000px; z-index: -9999; margin: 0px!important;');
537
 
538
 
539
  // List Type - deprecated
899
  define ('DEFAULT_GENERAL_TAG', '');
900
  define ('DEFAULT_DISABLE_BLOCK_INSERTIONS', AI_DISABLED);
901
  define ('DEFAULT_DISABLE_PHP_PROCESSING', AI_DISABLED);
902
+ define ('DEFAULT_DISABLE_HTML_CODE', AI_DISABLED);
903
  define ('DEFAULT_DISABLE_CSS_CODE', AI_DISABLED);
904
  define ('DEFAULT_DISABLE_JS_CODE', AI_DISABLED);
905
  define ('DEFAULT_DISABLE_FOOTER_CODE', AI_DISABLED);
1186
  define ('AI_URL_DEBUG_JAVASCRIPT', 'ai-debug-js');
1187
  define ('AI_URL_DEBUG_META', 'ai-debug-meta');
1188
 
1189
+ define ('AI_URL_DEBUG_DISABLE_HTML_CODE', 'ai-debug-disable-html-code');
1190
  define ('AI_URL_DEBUG_DISABLE_CSS_CODE', 'ai-debug-disable-css-code');
1191
  define ('AI_URL_DEBUG_DISABLE_JS_CODE', 'ai-debug-disable-js-code');
1192
  define ('AI_URL_DEBUG_DISABLE_PHP_PROCESSING', 'ai-debug-disable-php-processing');
css/ai-settings.css CHANGED
@@ -1,5 +1,5 @@
1
  #ai-data {
2
- font-family: "2.6.15"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
@@ -1267,47 +1267,85 @@ img.automatic-insertion.preview {
1267
  }
1268
 
1269
  .checkbox-icon.icon-css {
1270
- background: url('images/icons.png') 0 -120px;
 
 
 
1271
  }
1272
 
1273
  .checkbox-icon.icon-css.on {
1274
- background: url('images/icons.png') 0 -100px;
 
 
1275
  }
1276
 
1277
  .checkbox-icon.icon-js {
1278
- background: url('images/icons.png') -20px -120px;
 
 
 
1279
  }
1280
 
1281
  .checkbox-icon.icon-js.on {
1282
- background: url('images/icons.png') -20px -100px;
 
 
1283
  }
1284
 
1285
  .checkbox-icon.icon-php-red {
1286
- background: url('images/icons.png') -40px -120px;
 
 
 
1287
  }
1288
 
1289
  .checkbox-icon.icon-php-red.on {
1290
- background: url('images/icons.png') -40px -100px;
 
 
1291
  }
1292
 
1293
  .checkbox-icon.icon-h {
1294
- background: url('images/icons.png') -60px -120px;
 
 
 
1295
  }
1296
 
1297
  .checkbox-icon.icon-h.on {
1298
- background: url('images/icons.png') -60px -100px;
 
 
1299
  }
1300
 
1301
  .checkbox-icon.icon-f {
1302
- background: url('images/icons.png') -80px -120px;
 
 
 
1303
  }
1304
 
1305
  .checkbox-icon.icon-f.on {
1306
- background: url('images/icons.png') -80px -100px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1307
  }
1308
 
1309
  .checkbox-icon.icon-adsense {
1310
- background: url('images/icons.png') -100px -120px;
1311
  -webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
1312
  filter: grayscale(100%);
1313
  }
1
  #ai-data {
2
+ font-family: "2.6.16"; /* Used for version number of the file */
3
  }
4
 
5
  #blocked-warning {
1267
  }
1268
 
1269
  .checkbox-icon.icon-css {
1270
+ background: url('images/icons.png') 0 -100px;
1271
+ -webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
1272
+ filter: grayscale(100%);
1273
+ opacity: 0.5;
1274
  }
1275
 
1276
  .checkbox-icon.icon-css.on {
1277
+ -webkit-filter: unset;
1278
+ filter: unset;
1279
+ opacity: unset;
1280
  }
1281
 
1282
  .checkbox-icon.icon-js {
1283
+ background: url('images/icons.png') -20px -100px;
1284
+ -webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
1285
+ filter: grayscale(100%);
1286
+ opacity: 0.5;
1287
  }
1288
 
1289
  .checkbox-icon.icon-js.on {
1290
+ -webkit-filter: unset;
1291
+ filter: unset;
1292
+ opacity: unset;
1293
  }
1294
 
1295
  .checkbox-icon.icon-php-red {
1296
+ background: url('images/icons.png') -40px -100px;
1297
+ -webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
1298
+ filter: grayscale(100%);
1299
+ opacity: 0.5;
1300
  }
1301
 
1302
  .checkbox-icon.icon-php-red.on {
1303
+ -webkit-filter: unset;
1304
+ filter: unset;
1305
+ opacity: unset;
1306
  }
1307
 
1308
  .checkbox-icon.icon-h {
1309
+ background: url('images/icons.png') -60px -100px;
1310
+ -webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
1311
+ filter: grayscale(100%);
1312
+ opacity: 0.5;
1313
  }
1314
 
1315
  .checkbox-icon.icon-h.on {
1316
+ -webkit-filter: unset;
1317
+ filter: unset;
1318
+ opacity: unset;
1319
  }
1320
 
1321
  .checkbox-icon.icon-f {
1322
+ background: url('images/icons.png') -80px -100px;
1323
+ -webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
1324
+ filter: grayscale(100%);
1325
+ opacity: 0.5;
1326
  }
1327
 
1328
  .checkbox-icon.icon-f.on {
1329
+ -webkit-filter: unset;
1330
+ filter: unset;
1331
+ opacity: unset;
1332
+ }
1333
+
1334
+ .checkbox-icon.icon-html {
1335
+ background: url('images/icons.png') -100px -100px;
1336
+ -webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
1337
+ filter: grayscale(100%);
1338
+ opacity: 0.5;
1339
+ }
1340
+
1341
+ .checkbox-icon.icon-html.on {
1342
+ -webkit-filter: unset;
1343
+ filter: unset;
1344
+ opacity: unset;
1345
  }
1346
 
1347
  .checkbox-icon.icon-adsense {
1348
+ background: url('images/icons.png') -120px -100px;
1349
  -webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
1350
  filter: grayscale(100%);
1351
  }
css/images/icons.png CHANGED
Binary file
includes/js/ai-adb.js CHANGED
@@ -9,7 +9,7 @@ var ai_adb_message_window = AI_ADB_MESSAGE_WINDOW;
9
  var ai_adb_message_undismissible = AI_FUNCB_GET_UNDISMISSIBLE_MESSAGE;
10
  var ai_adb_message_cookie_lifetime = AI_FUNCT_GET_NO_ACTION_PERIOD;
11
  var ai_adb_action = AI_FUNC_GET_ADB_ACTION;
12
- var ai_adb_page_views = AI_FUNCT_GET_DELAY_ACTION;
13
  var ai_adb_selectors = "AI_ADB_SELECTORS";
14
  var ai_adb_redirection_url = "AI_ADB_REDIRECTION_PAGE";
15
 
@@ -392,19 +392,42 @@ var ai_adb_detected_actions = function(n) {
392
  }
393
  }
394
 
395
- if (ai_adb_page_views != 0) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
396
 
397
  var ai_adb_page_view_counter = 1;
398
  var cookie = AiCookies.get (ai_adb_pgv_cookie_name);
399
  if (typeof cookie != "undefined") ai_adb_page_view_counter = parseInt (cookie) + 1;
400
  if (ai_adb_debugging) console.log ("AI AD BLOCKING page views cookie:", cookie, "- page view:", ai_adb_page_view_counter);
401
- if (ai_adb_page_view_counter <= ai_adb_page_views) {
402
- if (ai_adb_debugging) console.log ("AI AD BLOCKING", ai_adb_page_views, "page views not reached, no action");
403
  AiCookies.set (ai_adb_pgv_cookie_name, ai_adb_page_view_counter, {expires: 365, path: "/"});
404
  window.ai_d1 = ai_adb_page_view_counter;
405
  window.AI_ADB_STATUS_MESSAGE=1;
406
  return;
407
  }
 
 
 
 
 
 
 
 
 
408
  }
409
 
410
  if (ai_adb_message_cookie_lifetime != 0 && (ai_adb_action != 1 || !ai_adb_message_undismissible)) {
9
  var ai_adb_message_undismissible = AI_FUNCB_GET_UNDISMISSIBLE_MESSAGE;
10
  var ai_adb_message_cookie_lifetime = AI_FUNCT_GET_NO_ACTION_PERIOD;
11
  var ai_adb_action = AI_FUNC_GET_ADB_ACTION;
12
+ var ai_adb_page_views = "AI_FUNC_GET_DELAY_ACTION";
13
  var ai_adb_selectors = "AI_ADB_SELECTORS";
14
  var ai_adb_redirection_url = "AI_ADB_REDIRECTION_PAGE";
15
 
392
  }
393
  }
394
 
395
+ if (ai_adb_page_views != '') {
396
+ if (ai_adb_debugging) console.log ("AI AD BLOCKING page views delay:", ai_adb_page_views);
397
+ if (ai_adb_page_views.includes (',')) {
398
+ var ai_adb_page_view_parts = ai_adb_page_views.split (',');
399
+
400
+ var ai_adb_page_view_delay = parseInt (ai_adb_page_view_parts [0]);
401
+ var ai_adb_page_view_repeat = parseInt (ai_adb_page_view_parts [1]);
402
+
403
+ if (ai_adb_debugging) console.log ("AI AD BLOCKING page views delay:", ai_adb_page_view_delay, "repeat:", ai_adb_page_view_repeat);
404
+ } else {
405
+ var ai_adb_page_view_delay = parseInt (ai_adb_page_views);
406
+ var ai_adb_page_view_repeat = 0
407
+
408
+ if (ai_adb_debugging) console.log ("AI AD BLOCKING page views delay:", ai_adb_page_view_delay);
409
+ }
410
 
411
  var ai_adb_page_view_counter = 1;
412
  var cookie = AiCookies.get (ai_adb_pgv_cookie_name);
413
  if (typeof cookie != "undefined") ai_adb_page_view_counter = parseInt (cookie) + 1;
414
  if (ai_adb_debugging) console.log ("AI AD BLOCKING page views cookie:", cookie, "- page view:", ai_adb_page_view_counter);
415
+ if (ai_adb_page_view_counter <= ai_adb_page_view_delay) {
416
+ if (ai_adb_debugging) console.log ("AI AD BLOCKING", ai_adb_page_view_delay, "page views not reached, no action");
417
  AiCookies.set (ai_adb_pgv_cookie_name, ai_adb_page_view_counter, {expires: 365, path: "/"});
418
  window.ai_d1 = ai_adb_page_view_counter;
419
  window.AI_ADB_STATUS_MESSAGE=1;
420
  return;
421
  }
422
+ if (ai_adb_page_view_repeat != 0) {
423
+ AiCookies.set (ai_adb_pgv_cookie_name, ai_adb_page_view_counter, {expires: 365, path: "/"});
424
+ if ((ai_adb_page_view_counter - ai_adb_page_view_delay - 1) % ai_adb_page_view_repeat != 0) {
425
+ if (ai_adb_debugging) console.log ("AI AD BLOCKING every", ai_adb_page_view_repeat, "page views, no action");
426
+ window.ai_d1 = ai_adb_page_view_counter;
427
+ window.AI_ADB_STATUS_MESSAGE=1;
428
+ return;
429
+ }
430
+ }
431
  }
432
 
433
  if (ai_adb_message_cookie_lifetime != 0 && (ai_adb_action != 1 || !ai_adb_message_undismissible)) {
includes/js/ai-adb.min.js CHANGED
@@ -1,23 +1,24 @@
1
- var ai_adb_active=!1,ai_adb_counter=0,ai_adb_act_cookie_name="aiADB",ai_adb_pgv_cookie_name="aiADB_PV",ai_adb_page_redirection_cookie_name="aiADB_PR",ai_adb_overlay=AI_ADB_OVERLAY_WINDOW,ai_adb_message_window=AI_ADB_MESSAGE_WINDOW,ai_adb_message_undismissible=AI_FUNCB_GET_UNDISMISSIBLE_MESSAGE,ai_adb_message_cookie_lifetime=AI_FUNCT_GET_NO_ACTION_PERIOD,ai_adb_action=AI_FUNC_GET_ADB_ACTION,ai_adb_page_views=AI_FUNCT_GET_DELAY_ACTION,ai_adb_selectors="AI_ADB_SELECTORS",ai_adb_redirection_url="AI_ADB_REDIRECTION_PAGE";
2
- function ai_adb_process_content(){(function(a){a(".AI_ADB_CONTENT_CSS_BEGIN_CLASS").each(function(){var c=a(this).parent(),b=a(this).data("css");"undefined"==typeof b&&(b="display: none !important;");var d=a(this).data("selectors");if("undefined"==typeof d||""==d)d="p";var g=!1;a(c).find(".AI_ADB_CONTENT_CSS_BEGIN_CLASS, .AI_ADB_CONTENT_CSS_END_CLASS, "+d).each(function(){if(a(this).hasClass("AI_ADB_CONTENT_CSS_BEGIN_CLASS"))a(this).remove(),g=!0;else if(a(this).hasClass("AI_ADB_CONTENT_CSS_END_CLASS"))a(this).remove(),
3
- g=!1;else if(g){var e=a(this).attr("style");"undefined"==typeof e?e="":(e=e.trim(),""!=e&&";"!=e[e.length-1]&&(e+=";"));a(this).attr("style",e+" "+b)}})});a(".AI_ADB_CONTENT_DELETE_BEGIN_CLASS").each(function(){var c=a(this).parent(),b=a(this).data("selectors");if("undefined"==typeof b||""==b)b="p";var d=!1;a(c).find(".AI_ADB_CONTENT_DELETE_BEGIN_CLASS, .AI_ADB_CONTENT_DELETE_END_CLASS, "+b).each(function(){a(this).hasClass("AI_ADB_CONTENT_DELETE_BEGIN_CLASS")?(a(this).remove(),d=!0):a(this).hasClass("AI_ADB_CONTENT_DELETE_END_CLASS")?
4
- (a(this).remove(),d=!1):d&&a(this).remove()})});a(".AI_ADB_CONTENT_REPLACE_BEGIN_CLASS").each(function(){var c=a(this).parent(),b=a(this).data("text");"undefined"==typeof b&&(b="");var d=a(this).data("css");"undefined"==typeof d&&(d="");var g=a(this).data("selectors");if("undefined"==typeof g||""==g)g="p";var e=!1;a(c).find(".AI_ADB_CONTENT_REPLACE_BEGIN_CLASS, .AI_ADB_CONTENT_REPLACE_END_CLASS, "+g).each(function(){if(a(this).hasClass("AI_ADB_CONTENT_REPLACE_BEGIN_CLASS"))a(this).remove(),e=!0;else if(a(this).hasClass("AI_ADB_CONTENT_REPLACE_END_CLASS"))a(this).remove(),
5
- e=!1;else if(e){if(0!=b.length){var f=Math.round(a(this).text().length/(b.length+1));a(this).text(Array(f+1).join(b+" ").trim())}else a(this).text("");""!=d&&(f=a(this).attr("style"),"undefined"==typeof f?f="":(f=f.trim(),""!=f&&";"!=f[f.length-1]&&(f+=";")),""!=d&&(d=" "+d),a(this).attr("style",f+d))}})})})(jQuery)}
6
- function ai_adb_process_blocks(a){(function(c){"undefined"==typeof a&&(a=c("body"));var b=c(b64d("Ym9keQ==")).attr(AI_ADB_ATTR_NAME),d="string"===typeof b?b==b64d("bWFzaw=="):null;if("string"===typeof b&&"boolean"===typeof d)if(d){do{var g=!1;c(".ai-adb-hide",a).each(function(){c(this).css({display:"none",visibility:"hidden"});c(this).removeClass("ai-adb-hide");var e=c(this).closest("div[data-ai]");if("undefined"!=typeof e.attr("data-ai")){var f=JSON.parse(b64d(e.attr("data-ai")));"undefined"!==typeof f&&
7
  f.constructor===Array&&(f[1]="",e.attr("data-ai",b64e(JSON.stringify(f))))}ai_disable_processing(c(this))});c(".ai-adb-show",a).each(function(){c(this).css({display:"block",visibility:"visible"});c(this).removeClass("ai-adb-show");if("undefined"!=typeof c(this).data("code")){var e=b64d(c(this).data("code"));c(this).append(e);g=!0;"function"==typeof ai_process_elements&&ai_process_elements()}e=c(this).attr("data-ai-tracking");if("undefined"!=typeof e){var f=c(this).closest("div[data-ai]");if("undefined"!=
8
  typeof f.attr("data-ai")){if(c(this).hasClass("ai-no-tracking")){var h=JSON.parse(b64d(f.attr("data-ai")));"undefined"!==typeof h&&h.constructor===Array&&(h[1]="",e=b64e(JSON.stringify(h)))}f.attr("data-ai",e)}}})}while(g);setTimeout(function(){"function"==typeof ai_process_impressions&&1==ai_tracking_finished&&ai_process_impressions();"function"==typeof ai_install_click_trackers&&1==ai_tracking_finished&&ai_install_click_trackers()},15);setTimeout(ai_adb_process_content,10)}else c(".ai-adb-hide",
9
  a).each(function(){c(this).removeClass("ai-adb-hide");if(0==c(this).outerHeight()&&0==c(this).closest(".ai-adb-show").length){var e=c(this).closest("div[data-ai]");if("undefined"!=typeof e.attr("data-ai")){var f=JSON.parse(b64d(e.attr("data-ai")));"undefined"!==typeof f&&f.constructor===Array&&(f[1]="",e.attr("data-ai",b64e(JSON.stringify(f))),e.addClass("ai-viewport-0").css("display","none"))}}}),c(".ai-adb-show",a).each(function(){ai_disable_processing(c(this));c(this).removeClass("ai-adb-show")})})(jQuery)}
10
- ai_adb_detection_type_log=function(a){var c=ai_adb_detection_type(a),b=jQuery("#ai-adb-events");if(0!=b.count){var d=b.text();b.text((""!=d?d+", ":d+", EVENTS: ")+a)}return c};ai_adb_detection_type=function(a){return""};
11
  var ai_adb_detected=function(a){setTimeout(function(){ai_adb_detected_actions(a)},2)},ai_disable_processing=function(a){jQuery(a).find(".ai-lazy").removeClass("ai-lazy");jQuery(a).find(".ai-manual").removeClass("ai-manual");jQuery(a).find(".ai-rotate").removeClass("ai-unprocessed").removeAttr("data-info");jQuery(a).find(".ai-list-data").removeClass("ai-list-data");jQuery(a).find(".ai-ip-data").removeClass("ai-ip-data");jQuery(a).find("[data-code]").removeAttr("data-code")},ai_adb_detected_actions=
12
- function(a){ai_adb_active||(ai_adb_active=!0,jQuery(b64d("Ym9keQ==")).attr(AI_ADB_ATTR_NAME,b64d("bWFzaw==")),function(c){c(window).ready(function(){ai_adb_process_blocks()});"undefined"!==typeof MobileDetect&&(new MobileDetect(window.navigator.userAgent)).is("bot")&&(ai_adb_action=0);if(0!=ai_adb_page_views){var b=1,d=AiCookies.get(ai_adb_pgv_cookie_name);"undefined"!=typeof d&&(b=parseInt(d)+1);if(b<=ai_adb_page_views){AiCookies.set(ai_adb_pgv_cookie_name,b,{expires:365,path:"/"});window.ai_d1=
13
- b;window.AI_ADB_STATUS_MESSAGE=1;return}}if(0==ai_adb_message_cookie_lifetime||1==ai_adb_action&&ai_adb_message_undismissible)AiCookies.remove(ai_adb_act_cookie_name,{path:"/"});else{d=AiCookies.get(ai_adb_act_cookie_name);if("undefined"!=typeof d&&"AI_CONST_AI_ADB_COOKIE_VALUE"==d){window.AI_ADB_STATUS_MESSAGE=2;return}AiCookies.set(ai_adb_act_cookie_name,"AI_CONST_AI_ADB_COOKIE_VALUE",{expires:ai_adb_message_cookie_lifetime,path:"/"})}0==ai_adb_action?(ai_dummy=16,window.AI_ADB_STATUS_MESSAGE=6,
14
- ai_dummy++):(window.AI_ADB_STATUS_MESSAGE=3,ai_dummy=13);switch(ai_adb_action){case 1:ai_adb_message_undismissible?(ai_adb_overlay.find('[style*="cursor"]').css("cursor","no-drop"),ai_adb_message_window.find('[style*="cursor"]').css("cursor","no-drop")):(ai_adb_overlay.click(function(){c(this).remove();ai_adb_message_window.remove()}),ai_adb_message_window.click(function(){c(this).remove();ai_adb_overlay.remove()}),window.onkeydown=function(g){27===g.keyCode&&(ai_adb_overlay.click(),ai_adb_message_window.click())});
15
- b=c(b64d("Ym9keQ==")).children();b.eq(Math.floor(Math.random()*b.length)).after(ai_adb_overlay);b.eq(Math.floor(Math.random()*b.length)).after(ai_adb_message_window);break;case 2:""!=ai_adb_redirection_url&&(b=!0,"http"==ai_adb_redirection_url.toLowerCase().substring(0,4)?window.location.href==ai_adb_redirection_url&&(b=!1):window.location.pathname==ai_adb_redirection_url&&(b=!1),b?(d=AiCookies.get(ai_adb_page_redirection_cookie_name),"undefined"==typeof d&&(b=new Date,b.setTime(b.getTime()+1E4),
16
- AiCookies.set(ai_adb_page_redirection_cookie_name,window.location.href,{expires:b,path:"/"}),window.location.replace(ai_adb_redirection_url))):AiCookies.remove(ai_adb_page_redirection_cookie_name,{path:"/"}))}}(jQuery))},ai_adb_undetected=function(a){ai_adb_counter++;ai_adb_active||4!=ai_adb_counter||(jQuery(b64d("Ym9keQ==")).attr(AI_ADB_ATTR_NAME,b64d("Y2xlYXI=")),ai_dummy=11,window.AI_ADB_STATUS_MESSAGE=4,ai_dummy=14,ai_adb_process_blocks())};AI_DBG_AI_DEBUG_AD_BLOCKING&&jQuery(document).ready(function(){ai_adb_detected(0)});
17
- jQuery(document).ready(function(a){a(window).ready(function(){ai_debugging_active="undefined"!==typeof ai_adb_fe_dbg;setTimeout(function(){a("#ai-adb-bar").click(function(){AiCookies.remove(ai_adb_act_cookie_name,{path:"/"});AiCookies.remove(ai_adb_pgv_cookie_name,{path:"/"});window.AI_ADB_STATUS_MESSAGE=5;ai_dummy=15})},2);if((!ai_adb_active||ai_debugging_active)&&""!=ai_adb_selectors){var c=0,b=0,d=ai_adb_selectors.split(",");a.each(d,function(e){d[e]=d[e].trim();0!=a(d[e]).length&&a(d[e]).each(function(f){var h=
18
- a(this).outerHeight();f=a(this).find(".ai-attributes");f.length&&f.each(function(){h>=a(this).outerHeight()&&(h-=a(this).outerHeight())});c++;if(0===h&&(a(document).ready(function(){ai_adb_active&&!ai_debugging_active||ai_adb_detected(4)}),b++,!ai_debugging_active))return!1})});0!=c&&0==b&&a(document).ready(function(){ai_adb_undetected(4)})}var g=b64d("aW1nI2FpLWFkYi1hZG54cw==");jQuery(g).length&&jQuery(g).on("load",function(){ai_adb_undetected(8)}).on("error",function(){ai_adb_active&&!ai_debugging_active||
 
19
  ai_adb_detected(8)}).attr("src",b64d("aHR0cHM6Ly9pYi5hZG54cy5jb20vZ2V0dWlkP2h0dHBzJTNBJTJGJTJGcm91dGVyLmluZm9saW5rcy5jb20lMkZkeW4lMkZhcG4tdXN5bmMlM0Z1c2VyX2lkJTNEJTI0VUlE"))})});
20
- function ai_adb_get_script(a,c){var b=document.createElement("script");b.src="ai-adb-url"+a+".js?ver="+(new Date).getTime();var d=document.getElementsByTagName("head")[0],g=!1;b.onerror=function(){c&&c();b.onerror=null;d.removeChild(b)};b.onload=b.onreadystatechange=function(){g||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(g=!0,c&&c(),b.onload=b.onreadystatechange=null,d.removeChild(b))};d.appendChild(b)}
21
- jQuery(window).on("load",function(){function a(){document.getElementById("AI_CONST_AI_ADB_1_NAME")?ai_adb_undetected(1):ai_adb_active&&!ai_debugging_active||ai_adb_detected(1)}function c(){"undefined"==typeof window.AI_CONST_AI_ADB_2_NAME?(!ai_adb_active||ai_debugging_active)&&ai_adb_detected(2):ai_adb_undetected(2)}setTimeout(function(){var b="undefined"!==typeof ai_adb_fe_dbg;jQuery(b64d("I2FpLWFkYi1hZHM=")).length&&(document.getElementById("AI_CONST_AI_ADB_1_NAME")?a():ai_adb_get_script("ads",
22
- a));jQuery(b64d("I2FpLWFkYi1nYQ==")).length&&("function"==typeof ga&&30<ga.toString().length||"function"==typeof __gaTracker&&30<__gaTracker.toString().length?ai_adb_undetected(5):ai_adb_active&&!b||ai_adb_detected(5));jQuery(b64d("I2FpLWFkYi1zcG9uc29ycw==")).length&&("undefined"==typeof window.AI_CONST_AI_ADB_2_NAME?ai_adb_get_script("sponsors",c):c());var d=b64d("I2Jhbm5lci1hZHZlcnQtY29udGFpbmVy"),g=b64d("I2Jhbm5lci1hZHZlcnQtY29udGFpbmVyIGltZw==");jQuery(d).length&&0<jQuery(g).length&&(0===jQuery(g).outerHeight()?
23
- (!ai_adb_active||b)&&ai_adb_detected(3):ai_adb_undetected(3),jQuery(g).remove());jQuery(b64d("I2FpLWFkYi1tbg==")).length&&("object"==typeof _mNDetails&&400<JSON.stringify(_mNDetails).length?ai_adb_undetected(6):ai_adb_active&&!b||ai_adb_detected(6))},120)});
1
+ var ai_adb_active=!1,ai_adb_counter=0,ai_adb_act_cookie_name="aiADB",ai_adb_pgv_cookie_name="aiADB_PV",ai_adb_page_redirection_cookie_name="aiADB_PR",ai_adb_overlay=AI_ADB_OVERLAY_WINDOW,ai_adb_message_window=AI_ADB_MESSAGE_WINDOW,ai_adb_message_undismissible=AI_FUNCB_GET_UNDISMISSIBLE_MESSAGE,ai_adb_message_cookie_lifetime=AI_FUNCT_GET_NO_ACTION_PERIOD,ai_adb_action=AI_FUNC_GET_ADB_ACTION,ai_adb_page_views="AI_FUNC_GET_DELAY_ACTION",ai_adb_selectors="AI_ADB_SELECTORS",ai_adb_redirection_url="AI_ADB_REDIRECTION_PAGE";
2
+ function ai_adb_process_content(){(function(a){a(".AI_ADB_CONTENT_CSS_BEGIN_CLASS").each(function(){var c=a(this).parent(),d=a(this).data("css");"undefined"==typeof d&&(d="display: none !important;");var b=a(this).data("selectors");if("undefined"==typeof b||""==b)b="p";var g=!1;a(c).find(".AI_ADB_CONTENT_CSS_BEGIN_CLASS, .AI_ADB_CONTENT_CSS_END_CLASS, "+b).each(function(){if(a(this).hasClass("AI_ADB_CONTENT_CSS_BEGIN_CLASS"))a(this).remove(),g=!0;else if(a(this).hasClass("AI_ADB_CONTENT_CSS_END_CLASS"))a(this).remove(),
3
+ g=!1;else if(g){var e=a(this).attr("style");"undefined"==typeof e?e="":(e=e.trim(),""!=e&&";"!=e[e.length-1]&&(e+=";"));a(this).attr("style",e+" "+d)}})});a(".AI_ADB_CONTENT_DELETE_BEGIN_CLASS").each(function(){var c=a(this).parent(),d=a(this).data("selectors");if("undefined"==typeof d||""==d)d="p";var b=!1;a(c).find(".AI_ADB_CONTENT_DELETE_BEGIN_CLASS, .AI_ADB_CONTENT_DELETE_END_CLASS, "+d).each(function(){a(this).hasClass("AI_ADB_CONTENT_DELETE_BEGIN_CLASS")?(a(this).remove(),b=!0):a(this).hasClass("AI_ADB_CONTENT_DELETE_END_CLASS")?
4
+ (a(this).remove(),b=!1):b&&a(this).remove()})});a(".AI_ADB_CONTENT_REPLACE_BEGIN_CLASS").each(function(){var c=a(this).parent(),d=a(this).data("text");"undefined"==typeof d&&(d="");var b=a(this).data("css");"undefined"==typeof b&&(b="");var g=a(this).data("selectors");if("undefined"==typeof g||""==g)g="p";var e=!1;a(c).find(".AI_ADB_CONTENT_REPLACE_BEGIN_CLASS, .AI_ADB_CONTENT_REPLACE_END_CLASS, "+g).each(function(){if(a(this).hasClass("AI_ADB_CONTENT_REPLACE_BEGIN_CLASS"))a(this).remove(),e=!0;else if(a(this).hasClass("AI_ADB_CONTENT_REPLACE_END_CLASS"))a(this).remove(),
5
+ e=!1;else if(e){if(0!=d.length){var f=Math.round(a(this).text().length/(d.length+1));a(this).text(Array(f+1).join(d+" ").trim())}else a(this).text("");""!=b&&(f=a(this).attr("style"),"undefined"==typeof f?f="":(f=f.trim(),""!=f&&";"!=f[f.length-1]&&(f+=";")),""!=b&&(b=" "+b),a(this).attr("style",f+b))}})})})(jQuery)}
6
+ function ai_adb_process_blocks(a){(function(c){"undefined"==typeof a&&(a=c("body"));var d=c(b64d("Ym9keQ==")).attr(AI_ADB_ATTR_NAME),b="string"===typeof d?d==b64d("bWFzaw=="):null;if("string"===typeof d&&"boolean"===typeof b)if(b){do{var g=!1;c(".ai-adb-hide",a).each(function(){c(this).css({display:"none",visibility:"hidden"});c(this).removeClass("ai-adb-hide");var e=c(this).closest("div[data-ai]");if("undefined"!=typeof e.attr("data-ai")){var f=JSON.parse(b64d(e.attr("data-ai")));"undefined"!==typeof f&&
7
  f.constructor===Array&&(f[1]="",e.attr("data-ai",b64e(JSON.stringify(f))))}ai_disable_processing(c(this))});c(".ai-adb-show",a).each(function(){c(this).css({display:"block",visibility:"visible"});c(this).removeClass("ai-adb-show");if("undefined"!=typeof c(this).data("code")){var e=b64d(c(this).data("code"));c(this).append(e);g=!0;"function"==typeof ai_process_elements&&ai_process_elements()}e=c(this).attr("data-ai-tracking");if("undefined"!=typeof e){var f=c(this).closest("div[data-ai]");if("undefined"!=
8
  typeof f.attr("data-ai")){if(c(this).hasClass("ai-no-tracking")){var h=JSON.parse(b64d(f.attr("data-ai")));"undefined"!==typeof h&&h.constructor===Array&&(h[1]="",e=b64e(JSON.stringify(h)))}f.attr("data-ai",e)}}})}while(g);setTimeout(function(){"function"==typeof ai_process_impressions&&1==ai_tracking_finished&&ai_process_impressions();"function"==typeof ai_install_click_trackers&&1==ai_tracking_finished&&ai_install_click_trackers()},15);setTimeout(ai_adb_process_content,10)}else c(".ai-adb-hide",
9
  a).each(function(){c(this).removeClass("ai-adb-hide");if(0==c(this).outerHeight()&&0==c(this).closest(".ai-adb-show").length){var e=c(this).closest("div[data-ai]");if("undefined"!=typeof e.attr("data-ai")){var f=JSON.parse(b64d(e.attr("data-ai")));"undefined"!==typeof f&&f.constructor===Array&&(f[1]="",e.attr("data-ai",b64e(JSON.stringify(f))),e.addClass("ai-viewport-0").css("display","none"))}}}),c(".ai-adb-show",a).each(function(){ai_disable_processing(c(this));c(this).removeClass("ai-adb-show")})})(jQuery)}
10
+ ai_adb_detection_type_log=function(a){var c=ai_adb_detection_type(a),d=jQuery("#ai-adb-events");if(0!=d.count){var b=d.text();d.text((""!=b?b+", ":b+", EVENTS: ")+a)}return c};ai_adb_detection_type=function(a){return""};
11
  var ai_adb_detected=function(a){setTimeout(function(){ai_adb_detected_actions(a)},2)},ai_disable_processing=function(a){jQuery(a).find(".ai-lazy").removeClass("ai-lazy");jQuery(a).find(".ai-manual").removeClass("ai-manual");jQuery(a).find(".ai-rotate").removeClass("ai-unprocessed").removeAttr("data-info");jQuery(a).find(".ai-list-data").removeClass("ai-list-data");jQuery(a).find(".ai-ip-data").removeClass("ai-ip-data");jQuery(a).find("[data-code]").removeAttr("data-code")},ai_adb_detected_actions=
12
+ function(a){ai_adb_active||(ai_adb_active=!0,jQuery(b64d("Ym9keQ==")).attr(AI_ADB_ATTR_NAME,b64d("bWFzaw==")),function(c){c(window).ready(function(){ai_adb_process_blocks()});"undefined"!==typeof MobileDetect&&(new MobileDetect(window.navigator.userAgent)).is("bot")&&(ai_adb_action=0);if(""!=ai_adb_page_views){if(ai_adb_page_views.includes(",")){var d=ai_adb_page_views.split(","),b=parseInt(d[0]);d=parseInt(d[1])}else b=parseInt(ai_adb_page_views),d=0;var g=1,e=AiCookies.get(ai_adb_pgv_cookie_name);
13
+ "undefined"!=typeof e&&(g=parseInt(e)+1);if(g<=b){AiCookies.set(ai_adb_pgv_cookie_name,g,{expires:365,path:"/"});window.ai_d1=g;window.AI_ADB_STATUS_MESSAGE=1;return}if(0!=d&&(AiCookies.set(ai_adb_pgv_cookie_name,g,{expires:365,path:"/"}),0!=(g-b-1)%d)){window.ai_d1=g;window.AI_ADB_STATUS_MESSAGE=1;return}}if(0==ai_adb_message_cookie_lifetime||1==ai_adb_action&&ai_adb_message_undismissible)AiCookies.remove(ai_adb_act_cookie_name,{path:"/"});else{e=AiCookies.get(ai_adb_act_cookie_name);if("undefined"!=
14
+ typeof e&&"AI_CONST_AI_ADB_COOKIE_VALUE"==e){window.AI_ADB_STATUS_MESSAGE=2;return}AiCookies.set(ai_adb_act_cookie_name,"AI_CONST_AI_ADB_COOKIE_VALUE",{expires:ai_adb_message_cookie_lifetime,path:"/"})}0==ai_adb_action?(ai_dummy=16,window.AI_ADB_STATUS_MESSAGE=6,ai_dummy++):(window.AI_ADB_STATUS_MESSAGE=3,ai_dummy=13);switch(ai_adb_action){case 1:ai_adb_message_undismissible?(ai_adb_overlay.find('[style*="cursor"]').css("cursor","no-drop"),ai_adb_message_window.find('[style*="cursor"]').css("cursor",
15
+ "no-drop")):(ai_adb_overlay.click(function(){c(this).remove();ai_adb_message_window.remove()}),ai_adb_message_window.click(function(){c(this).remove();ai_adb_overlay.remove()}),window.onkeydown=function(f){27===f.keyCode&&(ai_adb_overlay.click(),ai_adb_message_window.click())});b=c(b64d("Ym9keQ==")).children();b.eq(Math.floor(Math.random()*b.length)).after(ai_adb_overlay);b.eq(Math.floor(Math.random()*b.length)).after(ai_adb_message_window);break;case 2:""!=ai_adb_redirection_url&&(b=!0,"http"==ai_adb_redirection_url.toLowerCase().substring(0,
16
+ 4)?window.location.href==ai_adb_redirection_url&&(b=!1):window.location.pathname==ai_adb_redirection_url&&(b=!1),b?(e=AiCookies.get(ai_adb_page_redirection_cookie_name),"undefined"==typeof e&&(b=new Date,b.setTime(b.getTime()+1E4),AiCookies.set(ai_adb_page_redirection_cookie_name,window.location.href,{expires:b,path:"/"}),window.location.replace(ai_adb_redirection_url))):AiCookies.remove(ai_adb_page_redirection_cookie_name,{path:"/"}))}}(jQuery))},ai_adb_undetected=function(a){ai_adb_counter++;ai_adb_active||
17
+ 4!=ai_adb_counter||(jQuery(b64d("Ym9keQ==")).attr(AI_ADB_ATTR_NAME,b64d("Y2xlYXI=")),ai_dummy=11,window.AI_ADB_STATUS_MESSAGE=4,ai_dummy=14,ai_adb_process_blocks())};AI_DBG_AI_DEBUG_AD_BLOCKING&&jQuery(document).ready(function(){ai_adb_detected(0)});
18
+ jQuery(document).ready(function(a){a(window).ready(function(){ai_debugging_active="undefined"!==typeof ai_adb_fe_dbg;setTimeout(function(){a("#ai-adb-bar").click(function(){AiCookies.remove(ai_adb_act_cookie_name,{path:"/"});AiCookies.remove(ai_adb_pgv_cookie_name,{path:"/"});window.AI_ADB_STATUS_MESSAGE=5;ai_dummy=15})},2);if((!ai_adb_active||ai_debugging_active)&&""!=ai_adb_selectors){var c=0,d=0,b=ai_adb_selectors.split(",");a.each(b,function(e){b[e]=b[e].trim();0!=a(b[e]).length&&a(b[e]).each(function(f){var h=
19
+ a(this).outerHeight();f=a(this).find(".ai-attributes");f.length&&f.each(function(){h>=a(this).outerHeight()&&(h-=a(this).outerHeight())});c++;if(0===h&&(a(document).ready(function(){ai_adb_active&&!ai_debugging_active||ai_adb_detected(4)}),d++,!ai_debugging_active))return!1})});0!=c&&0==d&&a(document).ready(function(){ai_adb_undetected(4)})}var g=b64d("aW1nI2FpLWFkYi1hZG54cw==");jQuery(g).length&&jQuery(g).on("load",function(){ai_adb_undetected(8)}).on("error",function(){ai_adb_active&&!ai_debugging_active||
20
  ai_adb_detected(8)}).attr("src",b64d("aHR0cHM6Ly9pYi5hZG54cy5jb20vZ2V0dWlkP2h0dHBzJTNBJTJGJTJGcm91dGVyLmluZm9saW5rcy5jb20lMkZkeW4lMkZhcG4tdXN5bmMlM0Z1c2VyX2lkJTNEJTI0VUlE"))})});
21
+ function ai_adb_get_script(a,c){var d=document.createElement("script");d.src="ai-adb-url"+a+".js?ver="+(new Date).getTime();var b=document.getElementsByTagName("head")[0],g=!1;d.onerror=function(){c&&c();d.onerror=null;b.removeChild(d)};d.onload=d.onreadystatechange=function(){g||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(g=!0,c&&c(),d.onload=d.onreadystatechange=null,b.removeChild(d))};b.appendChild(d)}
22
+ jQuery(window).on("load",function(){function a(){document.getElementById("AI_CONST_AI_ADB_1_NAME")?ai_adb_undetected(1):ai_adb_active&&!ai_debugging_active||ai_adb_detected(1)}function c(){"undefined"==typeof window.AI_CONST_AI_ADB_2_NAME?(!ai_adb_active||ai_debugging_active)&&ai_adb_detected(2):ai_adb_undetected(2)}setTimeout(function(){var d="undefined"!==typeof ai_adb_fe_dbg;jQuery(b64d("I2FpLWFkYi1hZHM=")).length&&(document.getElementById("AI_CONST_AI_ADB_1_NAME")?a():ai_adb_get_script("ads",
23
+ a));jQuery(b64d("I2FpLWFkYi1nYQ==")).length&&("function"==typeof ga&&30<ga.toString().length||"function"==typeof __gaTracker&&30<__gaTracker.toString().length?ai_adb_undetected(5):ai_adb_active&&!d||ai_adb_detected(5));jQuery(b64d("I2FpLWFkYi1zcG9uc29ycw==")).length&&("undefined"==typeof window.AI_CONST_AI_ADB_2_NAME?ai_adb_get_script("sponsors",c):c());var b=b64d("I2Jhbm5lci1hZHZlcnQtY29udGFpbmVy"),g=b64d("I2Jhbm5lci1hZHZlcnQtY29udGFpbmVyIGltZw==");jQuery(b).length&&0<jQuery(g).length&&(0===jQuery(g).outerHeight()?
24
+ (!ai_adb_active||d)&&ai_adb_detected(3):ai_adb_undetected(3),jQuery(g).remove());jQuery(b64d("I2FpLWFkYi1tbg==")).length&&("object"==typeof _mNDetails&&400<JSON.stringify(_mNDetails).length?ai_adb_undetected(6):ai_adb_active&&!d||ai_adb_detected(6))},120)});
includes/js/ai-cookie.js CHANGED
@@ -387,11 +387,17 @@ ai_check_and_insert_block = function (block, id) {
387
  if (ai_check_block (block)) {
388
  ai_insert_code (ai_block_div);
389
  if (wrapping_div) {
390
- wrapping_div.classList.remove ('ai-list-block');
391
- wrapping_div.style.visibility = '';
392
- if (wrapping_div.classList.contains ('ai-remove-position')) {
393
- wrapping_div.style.position = '';
 
 
 
 
 
394
  }
 
395
  }
396
  } else {
397
  var ai_block_div_data = ai_block_div.closest ('div[data-ai]');
@@ -405,6 +411,7 @@ ai_check_and_insert_block = function (block, id) {
405
  var debug_block = wrapping_div.querySelectorAll ('.ai-debug-block');
406
  if (wrapping_div && debug_block.length) {
407
  wrapping_div.classList.remove ('ai-list-block');
 
408
  wrapping_div.style.visibility = '';
409
  if (wrapping_div.classList.contains ('ai-remove-position')) {
410
  wrapping_div.style.position = '';
@@ -416,7 +423,10 @@ ai_check_and_insert_block = function (block, id) {
416
  }
417
 
418
  var ai_debug_bars = document.querySelectorAll ('.' + id + '-dbg');
419
- for (let ai_debug_bar of ai_debug_bars) {
 
 
 
420
  ai_debug_bar.querySelector ('.ai-status').textContent = ai_debug_cookie_status;
421
  ai_debug_bar.querySelector ('.ai-cookie-data').textContent = ai_get_cookie_text (block);
422
  ai_debug_bar.classList.remove (id + '-dbg');
387
  if (ai_check_block (block)) {
388
  ai_insert_code (ai_block_div);
389
  if (wrapping_div) {
390
+
391
+ var debug_block = wrapping_div.querySelectorAll ('.ai-debug-block');
392
+ if (wrapping_div && debug_block.length) {
393
+ wrapping_div.classList.remove ('ai-list-block');
394
+ wrapping_div.classList.remove ('ai-list-block-ip');
395
+ wrapping_div.style.visibility = '';
396
+ if (wrapping_div.classList.contains ('ai-remove-position')) {
397
+ wrapping_div.style.position = '';
398
+ }
399
  }
400
+
401
  }
402
  } else {
403
  var ai_block_div_data = ai_block_div.closest ('div[data-ai]');
411
  var debug_block = wrapping_div.querySelectorAll ('.ai-debug-block');
412
  if (wrapping_div && debug_block.length) {
413
  wrapping_div.classList.remove ('ai-list-block');
414
+ wrapping_div.classList.remove ('ai-list-block-ip');
415
  wrapping_div.style.visibility = '';
416
  if (wrapping_div.classList.contains ('ai-remove-position')) {
417
  wrapping_div.style.position = '';
423
  }
424
 
425
  var ai_debug_bars = document.querySelectorAll ('.' + id + '-dbg');
426
+
427
+ // for (let ai_debug_bar of ai_debug_bars) {
428
+ for (var index = 0, len = ai_debug_bars.length; index < len; index++) {
429
+ var ai_debug_bar = ai_debug_bars [index];
430
  ai_debug_bar.querySelector ('.ai-status').textContent = ai_debug_cookie_status;
431
  ai_debug_bar.querySelector ('.ai-cookie-data').textContent = ai_get_cookie_text (block);
432
  ai_debug_bar.classList.remove (id + '-dbg');
includes/js/ai-cookie.min.js CHANGED
@@ -1,15 +1,14 @@
1
- var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};
2
- (function(a){if("function"===typeof define&&define.amd){define(a);var b=!0}"object"===typeof exports&&(module.exports=a(),b=!0);if(!b){var f=window.Cookies,c=window.Cookies=a();c.noConflict=function(){window.Cookies=f;return c}}})(function(){function a(){for(var a=0,c={};a<arguments.length;a++){var b=arguments[a],e;for(e in b)c[e]=b[e]}return c}function b(f){function c(){}function d(b,e,d){if("undefined"!==typeof document){d=a({path:"/"},c.defaults,d);"number"===typeof d.expires&&(d.expires=new Date(1*
3
- new Date+864E5*d.expires));d.expires=d.expires?d.expires.toUTCString():"";try{var g=JSON.stringify(e);/^[\{\[]/.test(g)&&(e=g)}catch(n){}e=f.write?f.write(e,b):encodeURIComponent(String(e)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent);b=encodeURIComponent(String(b)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);g="";for(var k in d)d[k]&&(g+="; "+k,!0!==d[k]&&(g+="="+d[k].split(";")[0]));return document.cookie=b+"="+e+g}}
4
- function e(a,b){if("undefined"!==typeof document){for(var c={},e=document.cookie?document.cookie.split("; "):[],d=0;d<e.length;d++){var g=e[d].split("="),h=g.slice(1).join("=");b||'"'!==h.charAt(0)||(h=h.slice(1,-1));try{var l=g[0].replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent);h=(f.read||f)(h,l)||h.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent);if(b)try{h=JSON.parse(h)}catch(m){}c[l]=h;if(a===l)break}catch(m){}}return a?c[a]:c}}c.set=d;c.get=function(a){return e(a,!1)};c.getJSON=function(a){return e(a,
5
- !0)};c.remove=function(b,c){d(b,"",a(c,{expires:-1}))};c.defaults={};c.withConverter=b;return c}return b(function(){})});AiCookies=Cookies.noConflict();
6
- ai_check_block=function(a){if(null==a)return!0;var b=AiCookies.getJSON("aiBLOCKS");ai_debug_cookie_status="";null==b&&(b={});"undefined"!==typeof ai_delay_showing_pageviews&&(b.hasOwnProperty(a)||(b[a]={}),b[a].hasOwnProperty("d")||(b[a].d=ai_delay_showing_pageviews));if(b.hasOwnProperty(a))for(var f in b[a]){if("x"==f){var c="",d=document.querySelectorAll('span[data-ai-block="'+a+'"]')[0];"aiHash"in d.dataset&&(c=d.dataset.aiHash);d="";b[a].hasOwnProperty("h")&&(d=b[a].h);var e=new Date;e=b[a][f]-
7
- Math.round(e.getTime()/1E3);if(0<e&&d==c)return ai_debug_cookie_status=a="closed for "+e+" s = "+Math.round(1E4*e/3600/24)/1E4+" days",!1;ai_set_cookie(a,"x","");b[a].hasOwnProperty("i")||b[a].hasOwnProperty("c")||ai_set_cookie(a,"h","")}else if("d"==f){if(0!=b[a][f])return ai_debug_cookie_status=a="delayed for "+b[a][f]+" pageviews",!1}else if("i"==f){c="";d=document.querySelectorAll('span[data-ai-block="'+a+'"]')[0];"aiHash"in d.dataset&&(c=d.dataset.aiHash);d="";b[a].hasOwnProperty("h")&&(d=b[a].h);
8
- if(0==b[a][f]&&d==c)return ai_debug_cookie_status=a="max impressions reached",!1;if(0>b[a][f]&&d==c){e=new Date;e=-b[a][f]-Math.round(e.getTime()/1E3);if(0<e)return ai_debug_cookie_status=a="max imp. reached ("+Math.round(1E4*e/24/3600)/1E4+" days = "+e+" s)",!1;ai_set_cookie(a,"i","");b[a].hasOwnProperty("c")||b[a].hasOwnProperty("x")||ai_set_cookie(a,"h","")}}if("ipt"==f&&0==b[a][f]&&(e=new Date,c=Math.round(e.getTime()/1E3),e=b[a].it-c,0<e))return ai_debug_cookie_status=a="max imp. per time reached ("+
9
- Math.round(1E4*e/24/3600)/1E4+" days = "+e+" s)",!1;if("c"==f){c="";d=document.querySelectorAll('span[data-ai-block="'+a+'"]')[0];"aiHash"in d.dataset&&(c=d.dataset.aiHash);d="";b[a].hasOwnProperty("h")&&(d=b[a].h);if(0==b[a][f]&&d==c)return ai_debug_cookie_status=a="max clicks reached",!1;if(0>b[a][f]&&d==c){e=new Date;e=-b[a][f]-Math.round(e.getTime()/1E3);if(0<e)return ai_debug_cookie_status=a="max clicks reached ("+Math.round(1E4*e/24/3600)/1E4+" days = "+e+" s)",!1;ai_set_cookie(a,"c","");b[a].hasOwnProperty("i")||
10
- b[a].hasOwnProperty("x")||ai_set_cookie(a,"h","")}}if("cpt"==f&&0==b[a][f]&&(e=new Date,c=Math.round(e.getTime()/1E3),e=b[a].ct-c,0<e))return ai_debug_cookie_status=a="max clicks per time reached ("+Math.round(1E4*e/24/3600)/1E4+" days = "+e+" s)",!1}ai_debug_cookie_status="OK";return!0};
11
- ai_check_and_insert_block=function(a,b){if(null==a)return!0;var f=document.getElementsByClassName(b);if(f.length){f=f[0];var c=f.closest(".AI_FUNCT_GET_BLOCK_CLASS_NAME");if(ai_check_block(a))ai_insert_code(f),c&&(c.classList.remove("ai-list-block"),c.style.visibility="",c.classList.contains("ai-remove-position")&&(c.style.position=""));else{var d=f.closest("div[data-ai]");if(null!=d&&"undefined"!=typeof d.getAttribute("data-ai")){var e=JSON.parse(b64d(d.getAttribute("data-ai")));"undefined"!==typeof e&&
12
- e.constructor===Array&&(e[1]="",d.setAttribute("data-ai",b64e(JSON.stringify(e))))}d=c.querySelectorAll(".ai-debug-block");c&&d.length&&(c.classList.remove("ai-list-block"),c.style.visibility="",c.classList.contains("ai-remove-position")&&(c.style.position=""))}f.classList.remove(b)}f=document.querySelectorAll("."+b+"-dbg");f=$jscomp.makeIterator(f);for(c=f.next();!c.done;c=f.next())c=c.value,c.querySelector(".ai-status").textContent=ai_debug_cookie_status,c.querySelector(".ai-cookie-data").textContent=
13
- ai_get_cookie_text(a),c.classList.remove(b+"-dbg")};function ai_load_cookie(){var a=AiCookies.getJSON("aiBLOCKS");null==a&&(a={});return a}function ai_get_cookie(a,b){var f="",c=ai_load_cookie();c.hasOwnProperty(a)&&c[a].hasOwnProperty(b)&&(f=c[a][b]);return f}
14
- function ai_set_cookie(a,b,f){var c=ai_load_cookie();if(""===f){if(c.hasOwnProperty(a)){delete c[a][b];a:{b=c[a];for(d in b)if(b.hasOwnProperty(d)){var d=!1;break a}d=!0}d&&delete c[a]}}else c.hasOwnProperty(a)||(c[a]={}),c[a][b]=f;0===Object.keys(c).length&&c.constructor===Object?AiCookies.remove("aiBLOCKS"):AiCookies.set("aiBLOCKS",c,{expires:365,path:"/"});return c}
15
- ai_get_cookie_text=function(a){var b=AiCookies.getJSON("aiBLOCKS");null==b&&(b={});return b.hasOwnProperty(a)?JSON.stringify(b[a]).replace(/"/g,"").replace("{","").replace("}",""):""};
1
+ (function(a){if("function"===typeof define&&define.amd){define(a);var c=!0}"object"===typeof exports&&(module.exports=a(),c=!0);if(!c){var d=window.Cookies,b=window.Cookies=a();b.noConflict=function(){window.Cookies=d;return b}}})(function(){function a(){for(var d=0,b={};d<arguments.length;d++){var f=arguments[d],e;for(e in f)b[e]=f[e]}return b}function c(d){function b(){}function f(h,k,g){if("undefined"!==typeof document){g=a({path:"/"},b.defaults,g);"number"===typeof g.expires&&(g.expires=new Date(1*
2
+ new Date+864E5*g.expires));g.expires=g.expires?g.expires.toUTCString():"";try{var l=JSON.stringify(k);/^[\{\[]/.test(l)&&(k=l)}catch(p){}k=d.write?d.write(k,h):encodeURIComponent(String(k)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent);h=encodeURIComponent(String(h)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);l="";for(var n in g)g[n]&&(l+="; "+n,!0!==g[n]&&(l+="="+g[n].split(";")[0]));return document.cookie=h+"="+k+l}}
3
+ function e(h,k){if("undefined"!==typeof document){for(var g={},l=document.cookie?document.cookie.split("; "):[],n=0;n<l.length;n++){var p=l[n].split("="),m=p.slice(1).join("=");k||'"'!==m.charAt(0)||(m=m.slice(1,-1));try{var q=p[0].replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent);m=(d.read||d)(m,q)||m.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent);if(k)try{m=JSON.parse(m)}catch(r){}g[q]=m;if(h===q)break}catch(r){}}return h?g[h]:g}}b.set=f;b.get=function(h){return e(h,!1)};b.getJSON=function(h){return e(h,
4
+ !0)};b.remove=function(h,k){f(h,"",a(k,{expires:-1}))};b.defaults={};b.withConverter=c;return b}return c(function(){})});AiCookies=Cookies.noConflict();
5
+ ai_check_block=function(a){if(null==a)return!0;var c=AiCookies.getJSON("aiBLOCKS");ai_debug_cookie_status="";null==c&&(c={});"undefined"!==typeof ai_delay_showing_pageviews&&(c.hasOwnProperty(a)||(c[a]={}),c[a].hasOwnProperty("d")||(c[a].d=ai_delay_showing_pageviews));if(c.hasOwnProperty(a))for(var d in c[a]){if("x"==d){var b="",f=document.querySelectorAll('span[data-ai-block="'+a+'"]')[0];"aiHash"in f.dataset&&(b=f.dataset.aiHash);f="";c[a].hasOwnProperty("h")&&(f=c[a].h);var e=new Date;e=c[a][d]-
6
+ Math.round(e.getTime()/1E3);if(0<e&&f==b)return ai_debug_cookie_status=a="closed for "+e+" s = "+Math.round(1E4*e/3600/24)/1E4+" days",!1;ai_set_cookie(a,"x","");c[a].hasOwnProperty("i")||c[a].hasOwnProperty("c")||ai_set_cookie(a,"h","")}else if("d"==d){if(0!=c[a][d])return ai_debug_cookie_status=a="delayed for "+c[a][d]+" pageviews",!1}else if("i"==d){b="";f=document.querySelectorAll('span[data-ai-block="'+a+'"]')[0];"aiHash"in f.dataset&&(b=f.dataset.aiHash);f="";c[a].hasOwnProperty("h")&&(f=c[a].h);
7
+ if(0==c[a][d]&&f==b)return ai_debug_cookie_status=a="max impressions reached",!1;if(0>c[a][d]&&f==b){e=new Date;e=-c[a][d]-Math.round(e.getTime()/1E3);if(0<e)return ai_debug_cookie_status=a="max imp. reached ("+Math.round(1E4*e/24/3600)/1E4+" days = "+e+" s)",!1;ai_set_cookie(a,"i","");c[a].hasOwnProperty("c")||c[a].hasOwnProperty("x")||ai_set_cookie(a,"h","")}}if("ipt"==d&&0==c[a][d]&&(e=new Date,b=Math.round(e.getTime()/1E3),e=c[a].it-b,0<e))return ai_debug_cookie_status=a="max imp. per time reached ("+
8
+ Math.round(1E4*e/24/3600)/1E4+" days = "+e+" s)",!1;if("c"==d){b="";f=document.querySelectorAll('span[data-ai-block="'+a+'"]')[0];"aiHash"in f.dataset&&(b=f.dataset.aiHash);f="";c[a].hasOwnProperty("h")&&(f=c[a].h);if(0==c[a][d]&&f==b)return ai_debug_cookie_status=a="max clicks reached",!1;if(0>c[a][d]&&f==b){e=new Date;e=-c[a][d]-Math.round(e.getTime()/1E3);if(0<e)return ai_debug_cookie_status=a="max clicks reached ("+Math.round(1E4*e/24/3600)/1E4+" days = "+e+" s)",!1;ai_set_cookie(a,"c","");c[a].hasOwnProperty("i")||
9
+ c[a].hasOwnProperty("x")||ai_set_cookie(a,"h","")}}if("cpt"==d&&0==c[a][d]&&(e=new Date,b=Math.round(e.getTime()/1E3),e=c[a].ct-b,0<e))return ai_debug_cookie_status=a="max clicks per time reached ("+Math.round(1E4*e/24/3600)/1E4+" days = "+e+" s)",!1}ai_debug_cookie_status="OK";return!0};
10
+ ai_check_and_insert_block=function(a,c){if(null==a)return!0;var d=document.getElementsByClassName(c);if(d.length){d=d[0];var b=d.closest(".AI_FUNCT_GET_BLOCK_CLASS_NAME");if(ai_check_block(a)){if(ai_insert_code(d),b){var f=b.querySelectorAll(".ai-debug-block");b&&f.length&&(b.classList.remove("ai-list-block"),b.classList.remove("ai-list-block-ip"),b.style.visibility="",b.classList.contains("ai-remove-position")&&(b.style.position=""))}}else{f=d.closest("div[data-ai]");if(null!=f&&"undefined"!=typeof f.getAttribute("data-ai")){var e=
11
+ JSON.parse(b64d(f.getAttribute("data-ai")));"undefined"!==typeof e&&e.constructor===Array&&(e[1]="",f.setAttribute("data-ai",b64e(JSON.stringify(e))))}f=b.querySelectorAll(".ai-debug-block");b&&f.length&&(b.classList.remove("ai-list-block"),b.classList.remove("ai-list-block-ip"),b.style.visibility="",b.classList.contains("ai-remove-position")&&(b.style.position=""))}d.classList.remove(c)}d=document.querySelectorAll("."+c+"-dbg");b=0;for(f=d.length;b<f;b++)e=d[b],e.querySelector(".ai-status").textContent=
12
+ ai_debug_cookie_status,e.querySelector(".ai-cookie-data").textContent=ai_get_cookie_text(a),e.classList.remove(c+"-dbg")};function ai_load_cookie(){var a=AiCookies.getJSON("aiBLOCKS");null==a&&(a={});return a}function ai_get_cookie(a,c){var d="",b=ai_load_cookie();b.hasOwnProperty(a)&&b[a].hasOwnProperty(c)&&(d=b[a][c]);return d}
13
+ function ai_set_cookie(a,c,d){var b=ai_load_cookie();if(""===d){if(b.hasOwnProperty(a)){delete b[a][c];a:{c=b[a];for(f in c)if(c.hasOwnProperty(f)){var f=!1;break a}f=!0}f&&delete b[a]}}else b.hasOwnProperty(a)||(b[a]={}),b[a][c]=d;0===Object.keys(b).length&&b.constructor===Object?AiCookies.remove("aiBLOCKS"):AiCookies.set("aiBLOCKS",b,{expires:365,path:"/"});return b}
14
+ ai_get_cookie_text=function(a){var c=AiCookies.getJSON("aiBLOCKS");null==c&&(c={});return c.hasOwnProperty(a)?JSON.stringify(c[a]).replace(/"/g,"").replace("{","").replace("}",""):""};
 
includes/js/ai-insert.js CHANGED
@@ -3,7 +3,10 @@ ai_insert = function (insertion, selector, insertion_code) {
3
  var elements = jQuery (selector);
4
  } else var elements = document.querySelectorAll (selector);
5
 
6
- Array.prototype.forEach.call (elements, function (element, index) {
 
 
 
7
  var ai_debug = typeof ai_debugging !== 'undefined'; // 1
8
  // var ai_debug = false;
9
 
@@ -54,28 +57,64 @@ ai_insert = function (insertion, selector, insertion_code) {
54
  }
55
 
56
  var range = document.createRange ();
57
- var fragment = range.createContextualFragment (template.innerHTML);
 
 
 
 
 
 
 
 
58
 
59
  if (insertion == 'before') {
 
 
 
 
60
  element.parentNode.insertBefore (fragment, element);
61
  } else
62
  if (insertion == 'after') {
 
 
 
 
63
  element.parentNode.insertBefore (fragment, element.nextSibling);
64
  } else
65
  if (insertion == 'prepend') {
 
 
 
 
66
  element.insertBefore (fragment, element.firstChild);
67
  } else
68
  if (insertion == 'append') {
 
 
 
 
69
  element.insertBefore (fragment, null);
70
  } else
71
  if (insertion == 'replace-content') {
72
- element.innerHTML = template.innerHTML;
 
 
 
 
 
 
73
  } else
74
  if (insertion == 'replace-element') {
 
 
 
 
75
  element.parentNode.insertBefore (fragment, element);
 
76
  element.parentNode.removeChild (element);
77
  }
78
- });
 
79
  }
80
 
81
  ai_insert_code = function (element) {
@@ -143,7 +182,20 @@ ai_insert_code = function (element) {
143
  if (ai_debug) console.log ('AI ELEMENT VISIBLE: block', block);
144
 
145
  var range = document.createRange ();
146
- var fragment = range.createContextualFragment (b64d (insertion_code));
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  element.parentNode.insertBefore (fragment, element.nextSibling);
148
 
149
  removeClass (element, 'ai-viewports');
@@ -152,11 +204,12 @@ ai_insert_code = function (element) {
152
 
153
  insertion = true;
154
 
155
- var ai_check_block_data = element.getElementsByClassName ('ai-check-block');
156
- if (typeof ai_check_block_data [0] != 'undefined') {
157
- // Remove span
158
- ai_check_block_data [0].parentNode.removeChild (ai_check_block_data [0]);
159
- }
 
160
  } else {
161
  if (ai_debug) console.log ('AI ELEMENT NOT VISIBLE: block', block, 'offsetWidth:', element.offsetWidth, 'offsetHeight:', element.offsetHeight, 'getClientRects().length:', element.getClientRects().length);
162
 
@@ -182,10 +235,15 @@ ai_insert_list_code = function (id) {
182
  if (!inserted) {
183
  wrapping_div.removeAttribute ('data-ai');
184
  }
185
- wrapping_div.classList.remove ('ai-list-block');
186
- wrapping_div.style.visibility = '';
187
- if (wrapping_div.classList.contains ('ai-remove-position')) {
188
- wrapping_div.style.position = '';
 
 
 
 
 
189
  }
190
  }
191
 
3
  var elements = jQuery (selector);
4
  } else var elements = document.querySelectorAll (selector);
5
 
6
+ // Array.prototype.forEach.call (elements, function (element, index) {
7
+ for (var index = 0, len = elements.length; index < len; index++) {
8
+ var element = elements [index];
9
+
10
  var ai_debug = typeof ai_debugging !== 'undefined'; // 1
11
  // var ai_debug = false;
12
 
57
  }
58
 
59
  var range = document.createRange ();
60
+
61
+ var fragment_ok = true;
62
+ try {
63
+ var fragment = range.createContextualFragment (template.innerHTML);
64
+ }
65
+ catch (err) {
66
+ var fragment_ok = false;
67
+ if (ai_debug) console.log ('AI INSERT', 'range.createContextualFragment ERROR:', err.message);
68
+ }
69
 
70
  if (insertion == 'before') {
71
+ if (!fragment_ok) {
72
+ jQuery (template.innerHTML).insertBefore (jQuery (element));
73
+ } else
74
+
75
  element.parentNode.insertBefore (fragment, element);
76
  } else
77
  if (insertion == 'after') {
78
+ if (!fragment_ok) {
79
+ jQuery (template.innerHTML).insertBefore (jQuery (element.nextSibling));
80
+ } else
81
+
82
  element.parentNode.insertBefore (fragment, element.nextSibling);
83
  } else
84
  if (insertion == 'prepend') {
85
+ if (!fragment_ok) {
86
+ jQuery (template.innerHTML).insertBefore (jQuery (element.firstChild));
87
+ } else
88
+
89
  element.insertBefore (fragment, element.firstChild);
90
  } else
91
  if (insertion == 'append') {
92
+ if (!fragment_ok) {
93
+ jQuery (template.innerHTML).appendTo (jQuery (element));
94
+ } else
95
+
96
  element.insertBefore (fragment, null);
97
  } else
98
  if (insertion == 'replace-content') {
99
+ element.innerHTML = '';
100
+
101
+ if (!fragment_ok) {
102
+ jQuery (template.innerHTML).appendTo (jQuery (element));
103
+ } else
104
+
105
+ element.insertBefore (fragment, null);
106
  } else
107
  if (insertion == 'replace-element') {
108
+ if (!fragment_ok) {
109
+ jQuery (template.innerHTML).insertBefore (jQuery (element));
110
+ } else
111
+
112
  element.parentNode.insertBefore (fragment, element);
113
+
114
  element.parentNode.removeChild (element);
115
  }
116
+ // });
117
+ };
118
  }
119
 
120
  ai_insert_code = function (element) {
182
  if (ai_debug) console.log ('AI ELEMENT VISIBLE: block', block);
183
 
184
  var range = document.createRange ();
185
+
186
+ var fragment_ok = true;
187
+ try {
188
+ var fragment = range.createContextualFragment (b64d (insertion_code));
189
+ }
190
+ catch (err) {
191
+ var fragment_ok = false;
192
+ if (ai_debug) console.log ('AI INSERT NEXT', 'range.createContextualFragment ERROR:', err.message);
193
+ }
194
+
195
+ if (!fragment_ok) {
196
+ jQuery (b64d (insertion_code)).insertBefore (jQuery (element.nextSibling));
197
+ } else
198
+
199
  element.parentNode.insertBefore (fragment, element.nextSibling);
200
 
201
  removeClass (element, 'ai-viewports');
204
 
205
  insertion = true;
206
 
207
+ // Should not be removed here as it is needed for tracking - removed there
208
+ // var ai_check_block_data = element.getElementsByClassName ('ai-check-block');
209
+ // if (typeof ai_check_block_data [0] != 'undefined') {
210
+ // // Remove span
211
+ // ai_check_block_data [0].parentNode.removeChild (ai_check_block_data [0]);
212
+ // }
213
  } else {
214
  if (ai_debug) console.log ('AI ELEMENT NOT VISIBLE: block', block, 'offsetWidth:', element.offsetWidth, 'offsetHeight:', element.offsetHeight, 'getClientRects().length:', element.getClientRects().length);
215
 
235
  if (!inserted) {
236
  wrapping_div.removeAttribute ('data-ai');
237
  }
238
+
239
+ var debug_block = wrapping_div.querySelectorAll ('.ai-debug-block');
240
+ if (wrapping_div && debug_block.length) {
241
+ wrapping_div.classList.remove ('ai-list-block');
242
+ wrapping_div.classList.remove ('ai-list-block-ip');
243
+ wrapping_div.style.visibility = '';
244
+ if (wrapping_div.classList.contains ('ai-remove-position')) {
245
+ wrapping_div.style.position = '';
246
+ }
247
  }
248
  }
249
 
includes/js/ai-insert.min.js CHANGED
@@ -1,19 +1,21 @@
1
- ai_insert=function(b,l,u){var r=-1!=l.indexOf(":eq")?jQuery(l):document.querySelectorAll(l);Array.prototype.forEach.call(r,function(g,w){selector_string=g.hasAttribute("id")?"#"+g.getAttribute("id"):g.hasAttribute("class")?"."+g.getAttribute("class").replace(RegExp(" ","g"),"."):"";var k=document.createElement("div");k.innerHTML=u;var m=k.getElementsByClassName("ai-selector-counter")[0];null!=m&&(m.innerText=w+1);m=k.getElementsByClassName("ai-debug-name ai-main")[0];if(null!=m){var t="";"before"==
2
- b?t=ai_front.insertion_before:"after"==b?t=ai_front.insertion_after:"prepend"==b?t=ai_front.insertion_prepend:"append"==b?t=ai_front.insertion_append:"replace-content"==b?t=ai_front.insertion_replace_content:"replace-element"==b&&(t=ai_front.insertion_replace_element);-1==selector_string.indexOf(".ai-viewports")&&(m.innerText=t+" "+l+" ("+g.tagName.toLowerCase()+selector_string+")")}m=document.createRange().createContextualFragment(k.innerHTML);"before"==b?g.parentNode.insertBefore(m,g):"after"==
3
- b?g.parentNode.insertBefore(m,g.nextSibling):"prepend"==b?g.insertBefore(m,g.firstChild):"append"==b?g.insertBefore(m,null):"replace-content"==b?g.innerHTML=k.innerHTML:"replace-element"==b&&(g.parentNode.insertBefore(m,g),g.parentNode.removeChild(g))})};
4
- ai_insert_code=function(b){function l(m,t){return null==m?!1:m.classList?m.classList.contains(t):-1<(" "+m.className+" ").indexOf(" "+t+" ")}function u(m,t){null!=m&&(m.classList?m.classList.add(t):m.className+=" "+t)}function r(m,t){null!=m&&(m.classList?m.classList.remove(t):m.className=m.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," "))}if("undefined"!=typeof b){var g=!1;if(l(b,"no-visibility-check")||b.offsetWidth||b.offsetHeight||b.getClientRects().length){g=
5
- b.getAttribute("data-code");var w=b.getAttribute("data-insertion"),k=b.getAttribute("data-selector");if(null!=g)if(null!=w&&null!=k){if(-1!=k.indexOf(":eq")?jQuery(k).length:document.querySelectorAll(k).length)ai_insert(w,k,b64d(g)),r(b,"ai-viewports")}else g=document.createRange().createContextualFragment(b64d(g)),b.parentNode.insertBefore(g,b.nextSibling),r(b,"ai-viewports");g=!0;b=b.getElementsByClassName("ai-check-block");"undefined"!=typeof b[0]&&b[0].parentNode.removeChild(b[0])}else w=b.previousElementSibling,
6
- l(w,"ai-debug-bar")&&l(w,"ai-debug-script")&&(r(w,"ai-debug-script"),u(w,"ai-debug-viewport-invisible")),r(b,"ai-viewports");return g}};ai_insert_list_code=function(b){var l=document.getElementsByClassName(b)[0];if("undefined"!=typeof l){var u=ai_insert_code(l),r=l.closest("div.AI_FUNCT_GET_BLOCK_CLASS_NAME");r&&(u||r.removeAttribute("data-ai"),r.classList.remove("ai-list-block"),r.style.visibility="",r.classList.contains("ai-remove-position")&&(r.style.position=""));l.classList.remove(b);u&&ai_process_elements()}};
7
- ai_insert_viewport_code=function(b){var l=document.getElementsByClassName(b)[0];"undefined"!=typeof l&&(ai_insert_code(l),l.classList.remove(b),ai_process_elements())};ai_insert_code_by_class=function(b){var l=document.getElementsByClassName(b)[0];"undefined"!=typeof l&&(ai_insert_code(l),l.classList.remove(b))};
8
- ai_insert_client_code=function(b,l){var u=document.getElementsByClassName(b)[0];if("undefined"!=typeof u){var r=u.getAttribute("data-code");null!=r&&ai_check_block()&&ai_check_and_insert_block()&&(u.setAttribute("data-code",r.substring(Math.floor(l/19))),ai_insert_code_by_class(b),u.remove())}};ai_process_elements_active=!1;
 
 
9
  function ai_process_elements(){ai_process_elements_active||setTimeout(function(){ai_process_elements_active=!1;"function"==typeof ai_process_rotations&&ai_process_rotations();"function"==typeof ai_process_lists&&ai_process_lists(jQuery("div.ai-list-data"));"function"==typeof ai_process_ip_addresses&&ai_process_ip_addresses(jQuery("div.ai-ip-data"));"function"==typeof ai_adb_process_blocks&&ai_adb_process_blocks()},5);ai_process_elements_active=!0}
10
- var Arrive=function(b,l,u){function r(q,c,d){k.addMethod(c,d,q.unbindEvent);k.addMethod(c,d,q.unbindEventWithSelectorOrCallback);k.addMethod(c,d,q.unbindEventWithSelectorAndCallback)}function g(q){q.arrive=x.bindEvent;r(x,q,"unbindArrive");q.leave=y.bindEvent;r(y,q,"unbindLeave")}if(b.MutationObserver&&"undefined"!==typeof HTMLElement){var w=0,k=function(){var q=HTMLElement.prototype.matches||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector;
11
- return{matchesSelector:function(c,d){return c instanceof HTMLElement&&q.call(c,d)},addMethod:function(c,d,e){var a=c[d];c[d]=function(){if(e.length==arguments.length)return e.apply(this,arguments);if("function"==typeof a)return a.apply(this,arguments)}},callCallbacks:function(c,d){d&&d.options.onceOnly&&1==d.firedElems.length&&(c=[c[0]]);for(var e=0,a;a=c[e];e++)a&&a.callback&&a.callback.call(a.elem,a.elem);d&&d.options.onceOnly&&1==d.firedElems.length&&d.me.unbindEventWithSelectorAndCallback.call(d.target,
12
- d.selector,d.callback)},checkChildNodesRecursively:function(c,d,e,a){for(var f=0,h;h=c[f];f++)e(h,d,a)&&a.push({callback:d.callback,elem:h}),0<h.childNodes.length&&k.checkChildNodesRecursively(h.childNodes,d,e,a)},mergeArrays:function(c,d){var e={},a;for(a in c)c.hasOwnProperty(a)&&(e[a]=c[a]);for(a in d)d.hasOwnProperty(a)&&(e[a]=d[a]);return e},toElementsArray:function(c){"undefined"===typeof c||"number"===typeof c.length&&c!==b||(c=[c]);return c}}}(),m=function(){var q=function(){this._eventsBucket=
13
- [];this._beforeRemoving=this._beforeAdding=null};q.prototype.addEvent=function(c,d,e,a){c={target:c,selector:d,options:e,callback:a,firedElems:[]};this._beforeAdding&&this._beforeAdding(c);this._eventsBucket.push(c);return c};q.prototype.removeEvent=function(c){for(var d=this._eventsBucket.length-1,e;e=this._eventsBucket[d];d--)c(e)&&(this._beforeRemoving&&this._beforeRemoving(e),(e=this._eventsBucket.splice(d,1))&&e.length&&(e[0].callback=null))};q.prototype.beforeAdding=function(c){this._beforeAdding=
14
- c};q.prototype.beforeRemoving=function(c){this._beforeRemoving=c};return q}(),t=function(q,c){var d=new m,e=this,a={fireOnAttributesModification:!1};d.beforeAdding(function(f){var h=f.target;if(h===b.document||h===b)h=document.getElementsByTagName("html")[0];var n=new MutationObserver(function(v){c.call(this,v,f)});var p=q(f.options);n.observe(h,p);f.observer=n;f.me=e});d.beforeRemoving(function(f){f.observer.disconnect()});this.bindEvent=function(f,h,n){h=k.mergeArrays(a,h);for(var p=k.toElementsArray(this),
15
- v=0;v<p.length;v++)d.addEvent(p[v],f,h,n)};this.unbindEvent=function(){var f=k.toElementsArray(this);d.removeEvent(function(h){for(var n=0;n<f.length;n++)if(this===u||h.target===f[n])return!0;return!1})};this.unbindEventWithSelectorOrCallback=function(f){var h=k.toElementsArray(this);d.removeEvent("function"===typeof f?function(n){for(var p=0;p<h.length;p++)if((this===u||n.target===h[p])&&n.callback===f)return!0;return!1}:function(n){for(var p=0;p<h.length;p++)if((this===u||n.target===h[p])&&n.selector===
16
- f)return!0;return!1})};this.unbindEventWithSelectorAndCallback=function(f,h){var n=k.toElementsArray(this);d.removeEvent(function(p){for(var v=0;v<n.length;v++)if((this===u||p.target===n[v])&&p.selector===f&&p.callback===h)return!0;return!1})};return this},x=new function(){function q(e,a,f){return k.matchesSelector(e,a.selector)&&(e._id===u&&(e._id=w++),-1==a.firedElems.indexOf(e._id))?(a.firedElems.push(e._id),!0):!1}var c={fireOnAttributesModification:!1,onceOnly:!1,existing:!1};x=new t(function(e){var a=
17
- {attributes:!1,childList:!0,subtree:!0};e.fireOnAttributesModification&&(a.attributes=!0);return a},function(e,a){e.forEach(function(f){var h=f.addedNodes,n=f.target,p=[];null!==h&&0<h.length?k.checkChildNodesRecursively(h,a,q,p):"attributes"===f.type&&q(n,a,p)&&p.push({callback:a.callback,elem:n});k.callCallbacks(p,a)})});var d=x.bindEvent;x.bindEvent=function(e,a,f){"undefined"===typeof f?(f=a,a=c):a=k.mergeArrays(c,a);var h=k.toElementsArray(this);if(a.existing){for(var n=[],p=0;p<h.length;p++)for(var v=
18
- h[p].querySelectorAll(e),z=0;z<v.length;z++)n.push({callback:f,elem:v[z]});if(a.onceOnly&&n.length)return f.call(n[0].elem,n[0].elem);setTimeout(k.callCallbacks,1,n)}d.call(this,e,a,f)};return x},y=new function(){function q(e,a){return k.matchesSelector(e,a.selector)}var c={};y=new t(function(){return{childList:!0,subtree:!0}},function(e,a){e.forEach(function(f){f=f.removedNodes;var h=[];null!==f&&0<f.length&&k.checkChildNodesRecursively(f,a,q,h);k.callCallbacks(h,a)})});var d=y.bindEvent;y.bindEvent=
19
- function(e,a,f){"undefined"===typeof f?(f=a,a=c):a=k.mergeArrays(c,a);d.call(this,e,a,f)};return y};l&&g(l.fn);g(HTMLElement.prototype);g(NodeList.prototype);g(HTMLCollection.prototype);g(HTMLDocument.prototype);g(Window.prototype);l={};r(x,l,"unbindAllArrive");r(y,l,"unbindAllLeave");return l}}(window,"undefined"===typeof jQuery?null:jQuery,void 0);
1
+ ai_insert=function(d,l,v){for(var p=-1!=l.indexOf(":eq")?jQuery(l):document.querySelectorAll(l),t=0,y=p.length;t<y;t++){var b=p[t];selector_string=b.hasAttribute("id")?"#"+b.getAttribute("id"):b.hasAttribute("class")?"."+b.getAttribute("class").replace(RegExp(" ","g"),"."):"";var u=document.createElement("div");u.innerHTML=v;var m=u.getElementsByClassName("ai-selector-counter")[0];null!=m&&(m.innerText=t+1);m=u.getElementsByClassName("ai-debug-name ai-main")[0];if(null!=m){var k="";"before"==d?k=
2
+ ai_front.insertion_before:"after"==d?k=ai_front.insertion_after:"prepend"==d?k=ai_front.insertion_prepend:"append"==d?k=ai_front.insertion_append:"replace-content"==d?k=ai_front.insertion_replace_content:"replace-element"==d&&(k=ai_front.insertion_replace_element);-1==selector_string.indexOf(".ai-viewports")&&(m.innerText=k+" "+l+" ("+b.tagName.toLowerCase()+selector_string+")")}m=document.createRange();k=!0;try{var w=m.createContextualFragment(u.innerHTML)}catch(r){k=!1}"before"==d?k?b.parentNode.insertBefore(w,
3
+ b):jQuery(u.innerHTML).insertBefore(jQuery(b)):"after"==d?k?b.parentNode.insertBefore(w,b.nextSibling):jQuery(u.innerHTML).insertBefore(jQuery(b.nextSibling)):"prepend"==d?k?b.insertBefore(w,b.firstChild):jQuery(u.innerHTML).insertBefore(jQuery(b.firstChild)):"append"==d?k?b.insertBefore(w,null):jQuery(u.innerHTML).appendTo(jQuery(b)):"replace-content"==d?(b.innerHTML="",k?b.insertBefore(w,null):jQuery(u.innerHTML).appendTo(jQuery(b))):"replace-element"==d&&(k?b.parentNode.insertBefore(w,b):jQuery(u.innerHTML).insertBefore(jQuery(b)),
4
+ b.parentNode.removeChild(b))}};
5
+ ai_insert_code=function(d){function l(m,k){return null==m?!1:m.classList?m.classList.contains(k):-1<(" "+m.className+" ").indexOf(" "+k+" ")}function v(m,k){null!=m&&(m.classList?m.classList.add(k):m.className+=" "+k)}function p(m,k){null!=m&&(m.classList?m.classList.remove(k):m.className=m.className.replace(new RegExp("(^|\\b)"+k.split(" ").join("|")+"(\\b|$)","gi")," "))}if("undefined"!=typeof d){var t=!1;if(l(d,"no-visibility-check")||d.offsetWidth||d.offsetHeight||d.getClientRects().length){t=
6
+ d.getAttribute("data-code");var y=d.getAttribute("data-insertion"),b=d.getAttribute("data-selector");if(null!=t)if(null!=y&&null!=b){if(-1!=b.indexOf(":eq")?jQuery(b).length:document.querySelectorAll(b).length)ai_insert(y,b,b64d(t)),p(d,"ai-viewports")}else{y=document.createRange();b=!0;try{var u=y.createContextualFragment(b64d(t))}catch(m){b=!1}b?d.parentNode.insertBefore(u,d.nextSibling):jQuery(b64d(t)).insertBefore(jQuery(d.nextSibling));p(d,"ai-viewports")}t=!0}else u=d.previousElementSibling,
7
+ l(u,"ai-debug-bar")&&l(u,"ai-debug-script")&&(p(u,"ai-debug-script"),v(u,"ai-debug-viewport-invisible")),p(d,"ai-viewports");return t}};
8
+ ai_insert_list_code=function(d){var l=document.getElementsByClassName(d)[0];if("undefined"!=typeof l){var v=ai_insert_code(l),p=l.closest("div.AI_FUNCT_GET_BLOCK_CLASS_NAME");if(p){v||p.removeAttribute("data-ai");var t=p.querySelectorAll(".ai-debug-block");p&&t.length&&(p.classList.remove("ai-list-block"),p.classList.remove("ai-list-block-ip"),p.style.visibility="",p.classList.contains("ai-remove-position")&&(p.style.position=""))}l.classList.remove(d);v&&ai_process_elements()}};
9
+ ai_insert_viewport_code=function(d){var l=document.getElementsByClassName(d)[0];"undefined"!=typeof l&&(ai_insert_code(l),l.classList.remove(d),ai_process_elements())};ai_insert_code_by_class=function(d){var l=document.getElementsByClassName(d)[0];"undefined"!=typeof l&&(ai_insert_code(l),l.classList.remove(d))};
10
+ ai_insert_client_code=function(d,l){var v=document.getElementsByClassName(d)[0];if("undefined"!=typeof v){var p=v.getAttribute("data-code");null!=p&&ai_check_block()&&ai_check_and_insert_block()&&(v.setAttribute("data-code",p.substring(Math.floor(l/19))),ai_insert_code_by_class(d),v.remove())}};ai_process_elements_active=!1;
11
  function ai_process_elements(){ai_process_elements_active||setTimeout(function(){ai_process_elements_active=!1;"function"==typeof ai_process_rotations&&ai_process_rotations();"function"==typeof ai_process_lists&&ai_process_lists(jQuery("div.ai-list-data"));"function"==typeof ai_process_ip_addresses&&ai_process_ip_addresses(jQuery("div.ai-ip-data"));"function"==typeof ai_adb_process_blocks&&ai_adb_process_blocks()},5);ai_process_elements_active=!0}
12
+ var Arrive=function(d,l,v){function p(r,c,e){b.addMethod(c,e,r.unbindEvent);b.addMethod(c,e,r.unbindEventWithSelectorOrCallback);b.addMethod(c,e,r.unbindEventWithSelectorAndCallback)}function t(r){r.arrive=k.bindEvent;p(k,r,"unbindArrive");r.leave=w.bindEvent;p(w,r,"unbindLeave")}if(d.MutationObserver&&"undefined"!==typeof HTMLElement){var y=0,b=function(){var r=HTMLElement.prototype.matches||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector;
13
+ return{matchesSelector:function(c,e){return c instanceof HTMLElement&&r.call(c,e)},addMethod:function(c,e,f){var a=c[e];c[e]=function(){if(f.length==arguments.length)return f.apply(this,arguments);if("function"==typeof a)return a.apply(this,arguments)}},callCallbacks:function(c,e){e&&e.options.onceOnly&&1==e.firedElems.length&&(c=[c[0]]);for(var f=0,a;a=c[f];f++)a&&a.callback&&a.callback.call(a.elem,a.elem);e&&e.options.onceOnly&&1==e.firedElems.length&&e.me.unbindEventWithSelectorAndCallback.call(e.target,
14
+ e.selector,e.callback)},checkChildNodesRecursively:function(c,e,f,a){for(var g=0,h;h=c[g];g++)f(h,e,a)&&a.push({callback:e.callback,elem:h}),0<h.childNodes.length&&b.checkChildNodesRecursively(h.childNodes,e,f,a)},mergeArrays:function(c,e){var f={},a;for(a in c)c.hasOwnProperty(a)&&(f[a]=c[a]);for(a in e)e.hasOwnProperty(a)&&(f[a]=e[a]);return f},toElementsArray:function(c){"undefined"===typeof c||"number"===typeof c.length&&c!==d||(c=[c]);return c}}}(),u=function(){var r=function(){this._eventsBucket=
15
+ [];this._beforeRemoving=this._beforeAdding=null};r.prototype.addEvent=function(c,e,f,a){c={target:c,selector:e,options:f,callback:a,firedElems:[]};this._beforeAdding&&this._beforeAdding(c);this._eventsBucket.push(c);return c};r.prototype.removeEvent=function(c){for(var e=this._eventsBucket.length-1,f;f=this._eventsBucket[e];e--)c(f)&&(this._beforeRemoving&&this._beforeRemoving(f),(f=this._eventsBucket.splice(e,1))&&f.length&&(f[0].callback=null))};r.prototype.beforeAdding=function(c){this._beforeAdding=
16
+ c};r.prototype.beforeRemoving=function(c){this._beforeRemoving=c};return r}(),m=function(r,c){var e=new u,f=this,a={fireOnAttributesModification:!1};e.beforeAdding(function(g){var h=g.target;if(h===d.document||h===d)h=document.getElementsByTagName("html")[0];var n=new MutationObserver(function(x){c.call(this,x,g)});var q=r(g.options);n.observe(h,q);g.observer=n;g.me=f});e.beforeRemoving(function(g){g.observer.disconnect()});this.bindEvent=function(g,h,n){h=b.mergeArrays(a,h);for(var q=b.toElementsArray(this),
17
+ x=0;x<q.length;x++)e.addEvent(q[x],g,h,n)};this.unbindEvent=function(){var g=b.toElementsArray(this);e.removeEvent(function(h){for(var n=0;n<g.length;n++)if(this===v||h.target===g[n])return!0;return!1})};this.unbindEventWithSelectorOrCallback=function(g){var h=b.toElementsArray(this);e.removeEvent("function"===typeof g?function(n){for(var q=0;q<h.length;q++)if((this===v||n.target===h[q])&&n.callback===g)return!0;return!1}:function(n){for(var q=0;q<h.length;q++)if((this===v||n.target===h[q])&&n.selector===
18
+ g)return!0;return!1})};this.unbindEventWithSelectorAndCallback=function(g,h){var n=b.toElementsArray(this);e.removeEvent(function(q){for(var x=0;x<n.length;x++)if((this===v||q.target===n[x])&&q.selector===g&&q.callback===h)return!0;return!1})};return this},k=new function(){function r(f,a,g){return b.matchesSelector(f,a.selector)&&(f._id===v&&(f._id=y++),-1==a.firedElems.indexOf(f._id))?(a.firedElems.push(f._id),!0):!1}var c={fireOnAttributesModification:!1,onceOnly:!1,existing:!1};k=new m(function(f){var a=
19
+ {attributes:!1,childList:!0,subtree:!0};f.fireOnAttributesModification&&(a.attributes=!0);return a},function(f,a){f.forEach(function(g){var h=g.addedNodes,n=g.target,q=[];null!==h&&0<h.length?b.checkChildNodesRecursively(h,a,r,q):"attributes"===g.type&&r(n,a,q)&&q.push({callback:a.callback,elem:n});b.callCallbacks(q,a)})});var e=k.bindEvent;k.bindEvent=function(f,a,g){"undefined"===typeof g?(g=a,a=c):a=b.mergeArrays(c,a);var h=b.toElementsArray(this);if(a.existing){for(var n=[],q=0;q<h.length;q++)for(var x=
20
+ h[q].querySelectorAll(f),z=0;z<x.length;z++)n.push({callback:g,elem:x[z]});if(a.onceOnly&&n.length)return g.call(n[0].elem,n[0].elem);setTimeout(b.callCallbacks,1,n)}e.call(this,f,a,g)};return k},w=new function(){function r(f,a){return b.matchesSelector(f,a.selector)}var c={};w=new m(function(){return{childList:!0,subtree:!0}},function(f,a){f.forEach(function(g){g=g.removedNodes;var h=[];null!==g&&0<g.length&&b.checkChildNodesRecursively(g,a,r,h);b.callCallbacks(h,a)})});var e=w.bindEvent;w.bindEvent=
21
+ function(f,a,g){"undefined"===typeof g?(g=a,a=c):a=b.mergeArrays(c,a);e.call(this,f,a,g)};return w};l&&t(l.fn);t(HTMLElement.prototype);t(NodeList.prototype);t(HTMLCollection.prototype);t(HTMLDocument.prototype);t(Window.prototype);l={};p(k,l,"unbindAllArrive");p(w,l,"unbindAllLeave");return l}}(window,"undefined"===typeof jQuery?null:jQuery,void 0);
includes/js/ai-lists.js CHANGED
@@ -21,15 +21,56 @@ jQuery (function ($) {
21
  }
22
 
23
  function ai_get_date (date_time_string) {
24
- var date;
 
25
  try {
26
- date = Date.parse (date_time_string);
27
- if (isNaN (date)) date = null;
28
  } catch (error) {
29
- date = null;
30
  }
31
 
32
- return date;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
34
 
35
  ai_process_lists = function (ai_list_blocks) {
@@ -116,7 +157,7 @@ jQuery (function ($) {
116
 
117
  if (typeof __tcfapi == 'function') {
118
 
119
- if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: calling __tcfapi getTCData");
120
 
121
  $('#ai-iab-tcf-status').text ('DETECTED');
122
 
@@ -136,7 +177,7 @@ jQuery (function ($) {
136
 
137
  setTimeout (function () {ai_process_lists ();}, 10);
138
 
139
- if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi getTCData success", ai_tcData);
140
  } else
141
  if (tcData.eventStatus == 'cmpuishown') {
142
  ai_cmpuishown = true;
@@ -147,10 +188,10 @@ jQuery (function ($) {
147
  $('#ai-iab-tcf-bar').addClass ('status-ok').removeClass ('status-error');
148
 
149
  } else {
150
- if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi getTCData, invalid status", tcData.eventStatus);
151
  }
152
  } else {
153
- if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi getTCData failed");
154
 
155
  $('#ai-iab-tcf-status').text ('__tcfapi getTCData failed');
156
  $('#ai-iab-tcf-bar').removeClass ('status-ok').addClass ('status-error');
@@ -165,6 +206,13 @@ jQuery (function ($) {
165
  // var ai_debug = false;
166
 
167
  if (typeof __tcfapi == 'function') {
 
 
 
 
 
 
 
168
  if (typeof ai_tcData_requested == 'undefined') {
169
  ai_tcData_requested = true;
170
 
@@ -172,11 +220,11 @@ jQuery (function ($) {
172
 
173
  url_parameters_need_tcData = true;
174
  } else {
175
- if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: tcData already requested");
176
  }
177
  } else {
178
  if (show_error) {
179
- if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi function not found");
180
 
181
  $('#ai-iab-tcf-bar').addClass ('status-error').removeClass ('status-ok');
182
  $('#ai-iab-tcf-status').text ('MISSING: __tcfapi function not found');
@@ -187,7 +235,8 @@ jQuery (function ($) {
187
 
188
 
189
  if (ai_list_blocks == null) {
190
- ai_list_blocks = $("div.ai-list-data");
 
191
  } else {
192
  ai_list_blocks = ai_list_blocks.filter ('.ai-list-data');
193
  }
@@ -228,7 +277,6 @@ jQuery (function ($) {
228
 
229
  ai_list_blocks.each (function () {
230
 
231
- // var block_wrapping_div = $(this).closest ('div.ai-list-block');
232
  var block_wrapping_div = $(this).closest ('div.AI_FUNCT_GET_BLOCK_CLASS_NAME');
233
 
234
  if (ai_debug) console.log ('AI LISTS BLOCK', block_wrapping_div.attr ('class'));
@@ -412,7 +460,7 @@ jQuery (function ($) {
412
  var cookie_value = '!@!';
413
  // General check
414
  var structured_data = list_parameter.indexOf ('[') != - 1;
415
- var euconsent_v2_check = list_parameter.indexOf ('euconsent-v2') == 0 && list_parameter.indexOf ('[') != - 1;
416
 
417
  if (list_parameter.indexOf ('=') != - 1) {
418
  var list_parameter_data = list_parameter.split ("=");
@@ -420,25 +468,25 @@ jQuery (function ($) {
420
  cookie_value = list_parameter_data [1];
421
  // Check again only cookie name (no value)
422
  structured_data = cookie_name.indexOf ('[') != - 1;
423
- euconsent_v2_check = cookie_name.indexOf ('euconsent-v2') == 0 && cookie_name.indexOf ('[') != - 1;
424
  }
425
 
426
  if (euconsent_v2_check) {
427
  // IAB Europe Transparency and Consent Framework (TCF v2)
428
- if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2");
429
 
430
  $('#ai-iab-tcf-bar').show ();
431
 
432
  if (typeof ai_tcData == 'object') {
433
- if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: ai_tcData set");
434
 
435
  $('#ai-iab-tcf-bar').addClass ('status-ok');
436
 
437
  var indexes = cookie_name.replace (/]| /gi, '').split ('[');
438
- // Remove cookie name (euconsent-v2)
439
  indexes.shift ();
440
 
441
- if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: tcData", ai_tcData);
442
 
443
  var structured_data_found = ai_structured_data_item (indexes, ai_tcData, cookie_value);
444
 
@@ -459,14 +507,14 @@ jQuery (function ($) {
459
  if (typeof ai_tcData_retrying == 'undefined') {
460
  ai_tcData_retrying = true;
461
 
462
- if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi not found, waiting...");
463
 
464
  setTimeout (function() {
465
- if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: checking again for __tcfapi");
466
  check_and_call__tcfapi (true);
467
  }, 200);
468
  } else {
469
- if (ai_debug) console.log ("AI LISTS COOKIE euconsent-v2: __tcfapi still waiting...");
470
  }
471
  }
472
  }
@@ -499,7 +547,7 @@ jQuery (function ($) {
499
  cookie_found = cookies.indexOf (list_parameter) != - 1;
500
  }
501
 
502
- if (ai_debug) console.log ("AI LISTS COOKIE", list_parameter, 'found: ', found);
503
 
504
  if (cookie_found) {
505
  list_passed = result;
@@ -539,13 +587,15 @@ jQuery (function ($) {
539
  }
540
  }
541
 
542
- var debug_info = $(this).data ('debug-info');
543
- if (typeof debug_info != 'undefined') {
544
- var debug_info_element = $('.' + debug_info);
545
- if (debug_info_element.length != 0) {
546
- var debug_bar = debug_info_element.parent ();
547
- if (debug_bar.hasClass ('ai-debug-info')) {
548
- debug_bar.remove ();
 
 
549
  }
550
  }
551
  }
@@ -589,6 +639,10 @@ jQuery (function ($) {
589
 
590
  if (ai_debug) console.log ('');
591
  if (ai_debug) console.log ("AI SCHEDULING:", b64d (scheduling_start), ' ', b64d (scheduling_end), ' ', b64d (scheduling_days), ' ', scheduling_type == 'W' ? 'IN' : 'OUT');
 
 
 
 
592
 
593
  var scheduling_ok = current_time >= scheduling_start_date && current_time < scheduling_end_date && scheduling_days_array.includes (current_day.toString ());
594
 
@@ -606,7 +660,16 @@ jQuery (function ($) {
606
  var date_time = date_time_string [0].replace ('T', ' ');
607
 
608
  var debug_bar = $(this).prevAll ('.ai-debug-bar.ai-debug-scheduling');
609
- debug_bar.find ('.ai-debug-name.ai-scheduling-info').text (date_time + ' ' + current_day);
 
 
 
 
 
 
 
 
 
610
  debug_bar.find ('.ai-debug-name.ai-scheduling-status').text (enable_block ? ai_front.visible : ai_front.hidden);
611
 
612
  if (ai_debug) console.log ("AI SCHEDULING:", date_time + ' ' + current_day);
@@ -663,7 +726,12 @@ jQuery (function ($) {
663
  if (ai_debug) console.log ('');
664
 
665
  ai_process_element (this);
666
- } else $(this).hide ();
 
 
 
 
 
667
 
668
  var tracking_data = block_wrapping_div.attr ('data-ai');
669
  if (typeof tracking_data !== typeof undefined && tracking_data !== false) {
@@ -673,7 +741,10 @@ jQuery (function ($) {
673
  }
674
  }
675
  } else {
676
- $(this).hide ();
 
 
 
677
 
678
  block_wrapping_div.removeAttr ('data-ai').removeClass ('ai-track');
679
 
@@ -692,7 +763,11 @@ jQuery (function ($) {
692
 
693
  if (typeof $(this).data ('code') != 'undefined') {
694
  var block_code = b64d ($(this).data ('code'));
695
- $(this).append (block_code);
 
 
 
 
696
 
697
  if (ai_debug) console.log ('AI INSERT CODE', block_wrapping_div.attr ('class'));
698
  if (ai_debug) console.log ('');
@@ -714,23 +789,9 @@ jQuery (function ($) {
714
  setTimeout (function() {
715
  ai_process_lists ();
716
 
717
- if ((jQuery('#ai-iab-tcf-bar').length || jQuery('.ai-list-manual').length) && typeof __tcfapi == 'function' && typeof ai_load_blocks == 'function') {
718
-
719
- function ai_iab_tcf_callback (tcData, success) {
720
- if (success) {
721
- if (tcData.eventStatus === 'useractioncomplete') {
722
- ai_tcData = tcData;
723
-
724
- ai_load_blocks ();
725
-
726
- jQuery('#ai-iab-tcf-status').text ('DATA LOADED');
727
- jQuery('#ai-iab-tcf-bar').addClass ('status-ok').removeClass ('status-error');
728
- }
729
- }
730
- }
731
-
732
- __tcfapi ('addEventListener', 2, ai_iab_tcf_callback);
733
- }
734
 
735
  if (typeof ai_load_blocks == 'function') {
736
  jQuery(document).on ("cmplzEnableScripts", ai_cmplzEnableScripts);
@@ -745,6 +806,15 @@ jQuery (function ($) {
745
  jQuery("#ai-iab-tcf-bar").click (function () {
746
  AiCookies.remove ('euconsent-v2', {path: "/", domain: '.' + window.location.hostname});
747
 
 
 
 
 
 
 
 
 
 
748
  jQuery('#ai-iab-tcf-status').text ('COOKIE DELETED');
749
  });
750
 
21
  }
22
 
23
  function ai_get_date (date_time_string) {
24
+ var date_time;
25
+
26
  try {
27
+ date_time = Date.parse (date_time_string);
28
+ if (isNaN (date_time)) date_time = null;
29
  } catch (error) {
30
+ date_time = null;
31
  }
32
 
33
+ // Try to parse separately date and time
34
+ if (date_time == null && date_time_string.includes (' ')) {
35
+ var date_time_parts = date_time_string.split (' ');
36
+
37
+ try {
38
+ date_time = Date.parse (date_time_parts [0]);
39
+
40
+ if (date_time_parts [1].includes (':')) {
41
+ var time_parts = date_time_parts [1].split (':');
42
+ date_time += (parseInt (time_parts [0]) * 3600 + parseInt (time_parts [1]) * 60 + parseInt (time_parts [2])) * 1000;
43
+ }
44
+
45
+ if (isNaN (date_time)) date_time = null;
46
+ } catch (error) {
47
+ date_time = null;
48
+ }
49
+ }
50
+
51
+ return date_time;
52
+ }
53
+
54
+ function ai_install_tcf_callback_useractioncomplete () {
55
+ if ((jQuery('#ai-iab-tcf-bar').length || jQuery('.ai-list-manual').length) && typeof __tcfapi == 'function' && typeof ai_load_blocks == 'function' && typeof ai_iab_tcf_callback_installed == 'undefined') {
56
+
57
+ function ai_iab_tcf_callback (tcData, success) {
58
+ if (success) {
59
+ if (tcData.eventStatus === 'useractioncomplete') {
60
+ ai_tcData = tcData;
61
+
62
+ ai_load_blocks ();
63
+
64
+ jQuery('#ai-iab-tcf-status').text ('DATA LOADED');
65
+ jQuery('#ai-iab-tcf-bar').addClass ('status-ok').removeClass ('status-error');
66
+ }
67
+ }
68
+ }
69
+
70
+ __tcfapi ('addEventListener', 2, ai_iab_tcf_callback);
71
+
72
+ ai_iab_tcf_callback_installed = true;
73
+ }
74
  }
75
 
76
  ai_process_lists = function (ai_list_blocks) {
157
 
158
  if (typeof __tcfapi == 'function') {
159
 
160
+ if (ai_debug) console.log ("AI LISTS COOKIE tcf-v2: calling __tcfapi getTCData");
161
 
162
  $('#ai-iab-tcf-status').text ('DETECTED');
163
 
177
 
178
  setTimeout (function () {ai_process_lists ();}, 10);
179
 
180
+ if (ai_debug) console.log ("AI LISTS COOKIE tcf-v2: __tcfapi getTCData success", ai_tcData);
181
  } else
182
  if (tcData.eventStatus == 'cmpuishown') {
183
  ai_cmpuishown = true;
188
  $('#ai-iab-tcf-bar').addClass ('status-ok').removeClass ('status-error');
189
 
190
  } else {
191
+ if (ai_debug) console.log ("AI LISTS COOKIE tcf-v2: __tcfapi getTCData, invalid status", tcData.eventStatus);
192
  }
193
  } else {
194
+ if (ai_debug) console.log ("AI LISTS COOKIE tcf-v2: __tcfapi getTCData failed");
195
 
196
  $('#ai-iab-tcf-status').text ('__tcfapi getTCData failed');
197
  $('#ai-iab-tcf-bar').removeClass ('status-ok').addClass ('status-error');
206
  // var ai_debug = false;
207
 
208
  if (typeof __tcfapi == 'function') {
209
+
210
+ if (typeof ai_iab_tcf_callback_installed == 'undefined') {
211
+ if (ai_debug) console.log ("AI LISTS COOKIE tcf-v2: callback for useractioncomplete not installed yet");
212
+
213
+ ai_install_tcf_callback_useractioncomplete ();
214
+ }
215
+
216
  if (typeof ai_tcData_requested == 'undefined') {
217
  ai_tcData_requested = true;
218
 
220
 
221
  url_parameters_need_tcData = true;
222
  } else {
223
+ if (ai_debug) console.log ("AI LISTS COOKIE tcf-v2: tcData already requested");
224
  }
225
  } else {
226
  if (show_error) {
227
+ if (ai_debug) console.log ("AI LISTS COOKIE tcf-v2: __tcfapi function not found");
228
 
229
  $('#ai-iab-tcf-bar').addClass ('status-error').removeClass ('status-ok');
230
  $('#ai-iab-tcf-status').text ('MISSING: __tcfapi function not found');
235
 
236
 
237
  if (ai_list_blocks == null) {
238
+ // ai_list_blocks = $("div.ai-list-data");
239
+ ai_list_blocks = $("div.ai-list-data, meta.ai-list-data");
240
  } else {
241
  ai_list_blocks = ai_list_blocks.filter ('.ai-list-data');
242
  }
277
 
278
  ai_list_blocks.each (function () {
279
 
 
280
  var block_wrapping_div = $(this).closest ('div.AI_FUNCT_GET_BLOCK_CLASS_NAME');
281
 
282
  if (ai_debug) console.log ('AI LISTS BLOCK', block_wrapping_div.attr ('class'));
460
  var cookie_value = '!@!';
461
  // General check
462
  var structured_data = list_parameter.indexOf ('[') != - 1;
463
+ var euconsent_v2_check = (list_parameter.indexOf ('tcf-v2') == 0 || list_parameter.indexOf ('euconsent-v2') == 0) && list_parameter.indexOf ('[') != - 1;
464
 
465
  if (list_parameter.indexOf ('=') != - 1) {
466
  var list_parameter_data = list_parameter.split ("=");
468
  cookie_value = list_parameter_data [1];
469
  // Check again only cookie name (no value)
470
  structured_data = cookie_name.indexOf ('[') != - 1;
471
+ euconsent_v2_check = (cookie_name.indexOf ('tcf-v2') == 0 || cookie_name.indexOf ('euconsent-v2') == 0) && cookie_name.indexOf ('[') != - 1;
472
  }
473
 
474
  if (euconsent_v2_check) {
475
  // IAB Europe Transparency and Consent Framework (TCF v2)
476
+ if (ai_debug) console.log ("AI LISTS COOKIE tcf-v2");
477
 
478
  $('#ai-iab-tcf-bar').show ();
479
 
480
  if (typeof ai_tcData == 'object') {
481
+ if (ai_debug) console.log ("AI LISTS COOKIE tcf-v2: ai_tcData set");
482
 
483
  $('#ai-iab-tcf-bar').addClass ('status-ok');
484
 
485
  var indexes = cookie_name.replace (/]| /gi, '').split ('[');
486
+ // Remove cookie name (tcf-v2)
487
  indexes.shift ();
488
 
489
+ if (ai_debug) console.log ("AI LISTS COOKIE tcf-v2: tcData", ai_tcData);
490
 
491
  var structured_data_found = ai_structured_data_item (indexes, ai_tcData, cookie_value);
492
 
507
  if (typeof ai_tcData_retrying == 'undefined') {
508
  ai_tcData_retrying = true;
509
 
510
+ if (ai_debug) console.log ("AI LISTS COOKIE tcf-v2: __tcfapi not found, waiting...");
511
 
512
  setTimeout (function() {
513
+ if (ai_debug) console.log ("AI LISTS COOKIE tcf-v2: checking again for __tcfapi");
514
  check_and_call__tcfapi (true);
515
  }, 200);
516
  } else {
517
+ if (ai_debug) console.log ("AI LISTS COOKIE tcf-v2: __tcfapi still waiting...");
518
  }
519
  }
520
  }
547
  cookie_found = cookies.indexOf (list_parameter) != - 1;
548
  }
549
 
550
+ if (ai_debug) console.log ("AI LISTS COOKIE", list_parameter, 'found: ', cookie_found);
551
 
552
  if (cookie_found) {
553
  list_passed = result;
587
  }
588
  }
589
 
590
+ if (!url_parameters_manual_loading && !url_parameters_no_ai_tcData_yet) {
591
+ var debug_info = $(this).data ('debug-info');
592
+ if (typeof debug_info != 'undefined') {
593
+ var debug_info_element = $('.' + debug_info);
594
+ if (debug_info_element.length != 0) {
595
+ var debug_bar = debug_info_element.parent ();
596
+ if (debug_bar.hasClass ('ai-debug-info')) {
597
+ debug_bar.remove ();
598
+ }
599
  }
600
  }
601
  }
639
 
640
  if (ai_debug) console.log ('');
641
  if (ai_debug) console.log ("AI SCHEDULING:", b64d (scheduling_start), ' ', b64d (scheduling_end), ' ', b64d (scheduling_days), ' ', scheduling_type == 'W' ? 'IN' : 'OUT');
642
+ // if (ai_debug) console.log ("AI SCHEDULING current time", current_time);
643
+ // if (ai_debug) console.log ("AI SCHEDULING start date", scheduling_start_date, current_time >= scheduling_start_date);
644
+ // if (ai_debug) console.log ("AI SCHEDULING end date ", scheduling_end_date, current_time < scheduling_end_date);
645
+ // if (ai_debug) console.log ("AI SCHEDULING days", scheduling_days_array, scheduling_days_array.includes (current_day.toString ()));
646
 
647
  var scheduling_ok = current_time >= scheduling_start_date && current_time < scheduling_end_date && scheduling_days_array.includes (current_day.toString ());
648
 
660
  var date_time = date_time_string [0].replace ('T', ' ');
661
 
662
  var debug_bar = $(this).prevAll ('.ai-debug-bar.ai-debug-scheduling');
663
+ // debug_bar.find ('.ai-debug-name.ai-scheduling-info').text (date_time + ' ' + current_day);
664
+ debug_bar.find ('.ai-debug-name.ai-scheduling-info').text (date_time + ' ' + current_day +
665
+ ' current_time:' + current_time.toString () + ' ' +
666
+ ' start_date:' + scheduling_start_date.toString () +
667
+ ' =' + (current_time >= scheduling_start_date).toString () +
668
+ ' end_date:' + scheduling_end_date.toString () +
669
+ ' =:' + (current_time < scheduling_end_date).toString () +
670
+ ' days:' + scheduling_days_array.toString () +
671
+ ' =:' + scheduling_days_array.includes (current_day.toString ()).toString ());
672
+
673
  debug_bar.find ('.ai-debug-name.ai-scheduling-status').text (enable_block ? ai_front.visible : ai_front.hidden);
674
 
675
  if (ai_debug) console.log ("AI SCHEDULING:", date_time + ' ' + current_day);
726
  if (ai_debug) console.log ('');
727
 
728
  ai_process_element (this);
729
+ } else {
730
+ $(this).hide (); // .ai-list-data
731
+ if (!block_wrapping_div.find ('.ai-debug-block').length) {
732
+ block_wrapping_div.hide ();
733
+ }
734
+ }
735
 
736
  var tracking_data = block_wrapping_div.attr ('data-ai');
737
  if (typeof tracking_data !== typeof undefined && tracking_data !== false) {
741
  }
742
  }
743
  } else {
744
+ $(this).hide (); // .ai-list-data
745
+ if (!block_wrapping_div.find ('.ai-debug-block').length) {
746
+ block_wrapping_div.hide ();
747
+ }
748
 
749
  block_wrapping_div.removeAttr ('data-ai').removeClass ('ai-track');
750
 
763
 
764
  if (typeof $(this).data ('code') != 'undefined') {
765
  var block_code = b64d ($(this).data ('code'));
766
+
767
+ if ($(this).closest ('head').length != 0) {
768
+ $(this).after (block_code);
769
+ if (!ai_debug) $(this).remove ();
770
+ } else $(this).append (block_code);
771
 
772
  if (ai_debug) console.log ('AI INSERT CODE', block_wrapping_div.attr ('class'));
773
  if (ai_debug) console.log ('');
789
  setTimeout (function() {
790
  ai_process_lists ();
791
 
792
+ setTimeout (function() {
793
+ ai_install_tcf_callback_useractioncomplete ();
794
+ }, 50);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
795
 
796
  if (typeof ai_load_blocks == 'function') {
797
  jQuery(document).on ("cmplzEnableScripts", ai_cmplzEnableScripts);
806
  jQuery("#ai-iab-tcf-bar").click (function () {
807
  AiCookies.remove ('euconsent-v2', {path: "/", domain: '.' + window.location.hostname});
808
 
809
+ // Clickio GDPR Cookie Consent
810
+ AiCookies.remove ('__lxG__consent__v2', {path: "/", domain: '.' + window.location.hostname});
811
+ AiCookies.remove ('__lxG__consent__v2_daisybit', {path: "/", domain: '.' + window.location.hostname});
812
+ AiCookies.remove ('__lxG__consent__v2_gdaisybit', {path: "/", domain: '.' + window.location.hostname});
813
+
814
+ AiCookies.remove ('cmplz_marketing', {path: "/", domain: '.' + window.location.hostname});
815
+ AiCookies.remove ('cmplz_stats', {path: "/", domain: '.' + window.location.hostname});
816
+ AiCookies.remove ('complianz_consent_status', {path: "/", domain: '.' + window.location.hostname});
817
+
818
  jQuery('#ai-iab-tcf-status').text ('COOKIE DELETED');
819
  });
820
 
includes/js/ai-lists.min.js CHANGED
@@ -1,19 +1,22 @@
1
  var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,k){a.raw=k;return a};$jscomp.arrayIteratorImpl=function(a){var k=0;return function(){return k<a.length?{done:!1,value:a[k++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var k="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return k?k.call(a):$jscomp.arrayIterator(a)};
2
- jQuery(function(a){function k(h){h=h.match(p);return null!=h&&1<h.length&&"string"===typeof h[1]&&0<h[1].length?h[1].toLowerCase():null}function y(h){try{var f=Date.parse(h);isNaN(f)&&(f=null)}catch(z){f=null}return f}Array.prototype.includes||(Array.prototype.includes=function(h){return!!~this.indexOf(h)});var p=/:\/\/(.[^/:]+)/i;ai_process_lists=function(h){function f(d,b,g){if(0==d.length){if("!@!"==g)return!0;b!=g&&("true"==g.toLowerCase()?g=!0:"false"==g.toLowerCase()&&(g=!1));return b==g}if("object"!=
3
- typeof b&&"array"!=typeof b)return!1;var e=d[0];d=d.slice(1);if("*"==e)for(b=$jscomp.makeIterator(Object.entries(b)),e=b.next();!e.done;e=b.next()){if(e=$jscomp.makeIterator(e.value),e.next(),e=e.next().value,f(d,e,g))return!0}else if(e in b)return f(d,b[e],g);return!1}function z(d,b,g){if("object"!=typeof d||-1==b.indexOf("["))return!1;b=b.replace(/]| /gi,"").split("[");return f(b,d,g)}function T(){"function"==typeof __tcfapi&&(a("#ai-iab-tcf-status").text("DETECTED"),__tcfapi("getTCData",2,function(d,
4
- b){b?(a("#ai-iab-tcf-bar").addClass("status-ok"),"tcloaded"==d.eventStatus||"useractioncomplete"==d.eventStatus?(ai_tcData=d,d.gdprApplies?a("#ai-iab-tcf-status").text("DATA LOADED"):jQuery("#ai-iab-tcf-status").text("GDPR DOES NOT APPLY"),a("#ai-iab-tcf-bar").addClass("status-ok").removeClass("status-error"),setTimeout(function(){ai_process_lists()},10)):"cmpuishown"==d.eventStatus&&(ai_cmpuishown=!0,a("#ai-iab-tcf-status").text("CMP UI SHOWN"),a("#ai-iab-tcf-bar").addClass("status-ok").removeClass("status-error"))):
5
- (a("#ai-iab-tcf-status").text("__tcfapi getTCData failed"),a("#ai-iab-tcf-bar").removeClass("status-ok").addClass("status-error"))}))}function K(d){"function"==typeof __tcfapi?"undefined"==typeof ai_tcData_requested&&(ai_tcData_requested=!0,T(),url_parameters_need_tcData=!0):d&&(a("#ai-iab-tcf-bar").addClass("status-error").removeClass("status-ok"),a("#ai-iab-tcf-status").text("MISSING: __tcfapi function not found"))}h=null==h?a("div.ai-list-data"):h.filter(".ai-list-data");if(h.length){h.removeClass("ai-list-data");
6
- var C=document.cookie.split(";");C.forEach(function(d,b){C[b]=d.trim()});var L=getAllUrlParams(window.location.search);if(null!=L.referrer)var q=L.referrer;else q=document.referrer,""!=q&&(q=k(q));var F=window.navigator.userAgent,G=F.toLowerCase();if("undefined"!==typeof MobileDetect)var M=new MobileDetect(F);h.each(function(){var d=a(this).closest("div.AI_FUNCT_GET_BLOCK_CLASS_NAME"),b=!0,g=a(this).attr("referer-list");if("undefined"!=typeof g){g=b64d(g).split(",");var e=a(this).attr("referer-list-type"),
7
- m=!1;a.each(g,function(u,c){if(""==c)return!0;if("*"==c.charAt(0))if("*"==c.charAt(c.length-1)){if(c=c.substr(1,c.length-2),-1!=q.indexOf(c))return m=!0,!1}else{if(c=c.substr(1),q.substr(-c.length)==c)return m=!0,!1}else if("*"==c.charAt(c.length-1)){if(c=c.substr(0,c.length-1),0==q.indexOf(c))return m=!0,!1}else if("#"==c){if(""==q)return m=!0,!1}else if(c==q)return m=!0,!1});switch(e){case "B":m&&(b=!1);break;case "W":m||(b=!1)}}if(b&&(g=a(this).attr("client-list"),"undefined"!=typeof g&&"undefined"!==
8
- typeof M))switch(g=b64d(g).split(","),e=a(this).attr("client-list-type"),m=!1,a.each(g,function(u,c){if(""==c)return!0;if("*"==c.charAt(0))if("*"==c.charAt(c.length-1)){if(c=c.substr(1,c.length-2).toLowerCase(),-1!=G.indexOf(c))return m=!0,!1}else{if(c=c.substr(1).toLowerCase(),G.substr(-c.length)==c)return m=!0,!1}else if("*"==c.charAt(c.length-1)){if(c=c.substr(0,c.length-1).toLowerCase(),0==G.indexOf(c))return m=!0,!1}else if(M.is(c))return m=!0,!1}),e){case "B":m&&(b=!1);break;case "W":m||(b=
9
- !1)}var N=g=!1;if(b&&(e=a(this).attr("parameter-list"),"undefined"!=typeof e)){e=b64d(e).split(",");var r=a(this).attr("parameter-list-type"),O=[];C.forEach(function(u){u=u.split("=");try{var c=JSON.parse(decodeURIComponent(u[1]))}catch(P){c=decodeURIComponent(u[1])}O[u[0]]=c});var v=!1,D=a(this);a.each(e,function(u,c){var P=c.split("&&");a.each(P,function(V,n){var w=!0;n=n.trim();"!!"==n.substring(0,2)&&(w=!1,n=n.substring(2));var t=n,x="!@!",Q=-1!=n.indexOf("["),R=0==n.indexOf("euconsent-v2")&&
10
- -1!=n.indexOf("[");-1!=n.indexOf("=")&&(x=n.split("="),t=x[0],x=x[1],Q=-1!=t.indexOf("["),R=0==t.indexOf("euconsent-v2")&&-1!=t.indexOf("["));if(R)a("#ai-iab-tcf-bar").show(),"object"==typeof ai_tcData?(a("#ai-iab-tcf-bar").addClass("status-ok"),t=t.replace(/]| /gi,"").split("["),t.shift(),v=(t=f(t,ai_tcData,x))?w:!w):(D.addClass("ai-list-data"),N=!0,"function"==typeof __tcfapi?K(!1):"undefined"==typeof ai_tcData_retrying&&(ai_tcData_retrying=!0,setTimeout(function(){K(!0)},200)));else if(Q)v=(t=
11
- z(O,t,x))?w:!w;else{var H=!1;"!@!"==x?C.every(function(U){return U.split("=")[0]==n?(H=!0,!1):!0}):H=-1!=C.indexOf(n);v=H?w:!w}if(!v)return!1});if(v)return!1});switch(r){case "B":v&&(b=!1);break;case "W":v||(b=!1)}a(this).hasClass("ai-list-manual")&&(b?(D.removeClass("ai-list-data"),D.removeClass("ai-list-manual")):(g=!0,D.addClass("ai-list-data")));e=a(this).data("debug-info");if("undefined"!=typeof e&&(e=a("."+e),0!=e.length)){var l=e.parent();l.hasClass("ai-debug-info")&&l.remove()}}l=a(this).prevAll(".ai-debug-bar.ai-debug-lists");
12
- e=""==q?"#":q;l.find(".ai-debug-name.ai-list-info").text(e).attr("title",F);l.find(".ai-debug-name.ai-list-status").text(b?ai_front.visible:ai_front.hidden);e=!1;if(b){var E=a(this).attr("scheduling-start");l=a(this).attr("scheduling-end");var A=a(this).attr("scheduling-days");if("undefined"!=typeof E&&"undefined"!=typeof l&&"undefined"!=typeof A){e=!0;var I=parseInt(a(this).attr("scheduling-fallback"));r=parseInt(a(this).attr("gmt"));var B=y(b64d(E))+r;l=y(b64d(l))+r;E=b64d(A).split(",");A=a(this).attr("scheduling-type");
13
- var J=(new Date).getTime()+r,S=new Date(J);r=S.getDay();0==r?r=6:r--;B=J>=B&&J<l&&E.includes(r.toString());switch(A){case "B":B=!B}B||(b=!1);A=S.toISOString().split(".")[0].replace("T"," ");l=a(this).prevAll(".ai-debug-bar.ai-debug-scheduling");l.find(".ai-debug-name.ai-scheduling-info").text(A+" "+r);l.find(".ai-debug-name.ai-scheduling-status").text(b?ai_front.visible:ai_front.hidden);b||0==I||(l.removeClass("ai-debug-scheduling").addClass("ai-debug-fallback"),l.find(".ai-debug-name.ai-scheduling-status").text(ai_front.fallback+
14
- "="+I))}}if(g||N)return!0;a(this).css({visibility:"",position:"",width:"",height:"","z-index":""});b?(d.css({visibility:""}),d.hasClass("ai-remove-position")&&d.css({position:""}),"undefined"!=typeof a(this).data("code")&&(b=b64d(a(this).data("code")),a(this).append(b),ai_process_element(this))):e&&!B&&0!=I?(d.css({visibility:""}),d.hasClass("ai-remove-position")&&d.css({position:""}),a(this).next(".ai-fallback").removeClass("ai-fallback"),"undefined"!=typeof a(this).data("fallback-code")?(b=b64d(a(this).data("fallback-code")),
15
- a(this).append(b),ai_process_element(this)):a(this).hide(),b=d.attr("data-ai"),"undefined"!==typeof b&&!1!==b&&(b=a(this).attr("fallback-tracking"),"undefined"!==typeof b&&!1!==b&&d.attr("data-ai",b))):(a(this).hide(),d.removeAttr("data-ai").removeClass("ai-track"),d.find(".ai-debug-block").length?(d.css({visibility:""}).removeClass("ai-close"),d.hasClass("ai-remove-position")&&d.css({position:""})):d.hide());a(this).attr("data-code","");a(this).attr("data-fallback-code","");d.removeClass("ai-list-block")})}};
16
- a(document).ready(function(h){setTimeout(function(){ai_process_lists();(jQuery("#ai-iab-tcf-bar").length||jQuery(".ai-list-manual").length)&&"function"==typeof __tcfapi&&"function"==typeof ai_load_blocks&&__tcfapi("addEventListener",2,function(f,z){z&&"useractioncomplete"===f.eventStatus&&(ai_tcData=f,ai_load_blocks(),jQuery("#ai-iab-tcf-status").text("DATA LOADED"),jQuery("#ai-iab-tcf-bar").addClass("status-ok").removeClass("status-error"))});if("function"==typeof ai_load_blocks)jQuery(document).on("cmplzEnableScripts",
17
- function(f){"all"===f.consentLevel&&ai_load_blocks()});jQuery("#ai-iab-tcf-bar").click(function(){AiCookies.remove("euconsent-v2",{path:"/",domain:"."+window.location.hostname});jQuery("#ai-iab-tcf-status").text("COOKIE DELETED")})},5)})});
 
 
 
18
  function ai_process_element(a){setTimeout(function(){"function"==typeof ai_process_rotations_in_element&&ai_process_rotations_in_element(a);"function"==typeof ai_process_lists&&ai_process_lists(jQuery("div.ai-list-data",a));"function"==typeof ai_process_ip_addresses&&ai_process_ip_addresses(jQuery("div.ai-ip-data",a));"function"==typeof ai_adb_process_blocks&&ai_adb_process_blocks(a)},5)}
19
- function getAllUrlParams(a){var k=a?a.split("?")[1]:window.location.search.slice(1);a={};if(k){k=k.split("#")[0];k=k.split("&");for(var y=0;y<k.length;y++){var p=k[y].split("="),h=void 0,f=p[0].replace(/\[\d*\]/,function(z){h=z.slice(1,-1);return""});p="undefined"===typeof p[1]?"":p[1];f=f.toLowerCase();p=p.toLowerCase();a[f]?("string"===typeof a[f]&&(a[f]=[a[f]]),"undefined"===typeof h?a[f].push(p):a[f][h]=p):a[f]=p}}return a};
1
  var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,k){a.raw=k;return a};$jscomp.arrayIteratorImpl=function(a){var k=0;return function(){return k<a.length?{done:!1,value:a[k++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var k="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return k?k.call(a):$jscomp.arrayIterator(a)};
2
+ jQuery(function(a){function k(e){e=e.match(E);return null!=e&&1<e.length&&"string"===typeof e[1]&&0<e[1].length?e[1].toLowerCase():null}function z(e){try{var h=Date.parse(e);isNaN(h)&&(h=null)}catch(J){h=null}if(null==h&&e.includes(" ")){e=e.split(" ");try{h=Date.parse(e[0]);if(e[1].includes(":")){var F=e[1].split(":");h+=1E3*(3600*parseInt(F[0])+60*parseInt(F[1])+parseInt(F[2]))}isNaN(h)&&(h=null)}catch(J){h=null}}return h}function n(){(jQuery("#ai-iab-tcf-bar").length||jQuery(".ai-list-manual").length)&&
3
+ "function"==typeof __tcfapi&&"function"==typeof ai_load_blocks&&"undefined"==typeof ai_iab_tcf_callback_installed&&(__tcfapi("addEventListener",2,function(e,h){h&&"useractioncomplete"===e.eventStatus&&(ai_tcData=e,ai_load_blocks(),jQuery("#ai-iab-tcf-status").text("DATA LOADED"),jQuery("#ai-iab-tcf-bar").addClass("status-ok").removeClass("status-error"))}),ai_iab_tcf_callback_installed=!0)}Array.prototype.includes||(Array.prototype.includes=function(e){return!!~this.indexOf(e)});var E=/:\/\/(.[^/:]+)/i;
4
+ ai_process_lists=function(e){function h(d,b,g){if(0==d.length){if("!@!"==g)return!0;b!=g&&("true"==g.toLowerCase()?g=!0:"false"==g.toLowerCase()&&(g=!1));return b==g}if("object"!=typeof b&&"array"!=typeof b)return!1;var f=d[0];d=d.slice(1);if("*"==f)for(b=$jscomp.makeIterator(Object.entries(b)),f=b.next();!f.done;f=b.next()){if(f=$jscomp.makeIterator(f.value),f.next(),f=f.next().value,h(d,f,g))return!0}else if(f in b)return h(d,b[f],g);return!1}function F(d,b,g){if("object"!=typeof d||-1==b.indexOf("["))return!1;
5
+ b=b.replace(/]| /gi,"").split("[");return h(b,d,g)}function J(){"function"==typeof __tcfapi&&(a("#ai-iab-tcf-status").text("DETECTED"),__tcfapi("getTCData",2,function(d,b){b?(a("#ai-iab-tcf-bar").addClass("status-ok"),"tcloaded"==d.eventStatus||"useractioncomplete"==d.eventStatus?(ai_tcData=d,d.gdprApplies?a("#ai-iab-tcf-status").text("DATA LOADED"):jQuery("#ai-iab-tcf-status").text("GDPR DOES NOT APPLY"),a("#ai-iab-tcf-bar").addClass("status-ok").removeClass("status-error"),setTimeout(function(){ai_process_lists()},
6
+ 10)):"cmpuishown"==d.eventStatus&&(ai_cmpuishown=!0,a("#ai-iab-tcf-status").text("CMP UI SHOWN"),a("#ai-iab-tcf-bar").addClass("status-ok").removeClass("status-error"))):(a("#ai-iab-tcf-status").text("__tcfapi getTCData failed"),a("#ai-iab-tcf-bar").removeClass("status-ok").addClass("status-error"))}))}function P(d){"function"==typeof __tcfapi?("undefined"==typeof ai_iab_tcf_callback_installed&&n(),"undefined"==typeof ai_tcData_requested&&(ai_tcData_requested=!0,J(),url_parameters_need_tcData=!0)):
7
+ d&&(a("#ai-iab-tcf-bar").addClass("status-error").removeClass("status-ok"),a("#ai-iab-tcf-status").text("MISSING: __tcfapi function not found"))}e=null==e?a("div.ai-list-data, meta.ai-list-data"):e.filter(".ai-list-data");if(e.length){e.removeClass("ai-list-data");var G=document.cookie.split(";");G.forEach(function(d,b){G[b]=d.trim()});var Q=getAllUrlParams(window.location.search);if(null!=Q.referrer)var r=Q.referrer;else r=document.referrer,""!=r&&(r=k(r));var K=window.navigator.userAgent,L=K.toLowerCase();
8
+ if("undefined"!==typeof MobileDetect)var R=new MobileDetect(K);e.each(function(){var d=a(this).closest("div.AI_FUNCT_GET_BLOCK_CLASS_NAME"),b=!0,g=a(this).attr("referer-list");if("undefined"!=typeof g){g=b64d(g).split(",");var f=a(this).attr("referer-list-type"),l=!1;a.each(g,function(t,c){if(""==c)return!0;if("*"==c.charAt(0))if("*"==c.charAt(c.length-1)){if(c=c.substr(1,c.length-2),-1!=r.indexOf(c))return l=!0,!1}else{if(c=c.substr(1),r.substr(-c.length)==c)return l=!0,!1}else if("*"==c.charAt(c.length-
9
+ 1)){if(c=c.substr(0,c.length-1),0==r.indexOf(c))return l=!0,!1}else if("#"==c){if(""==r)return l=!0,!1}else if(c==r)return l=!0,!1});switch(f){case "B":l&&(b=!1);break;case "W":l||(b=!1)}}if(b&&(g=a(this).attr("client-list"),"undefined"!=typeof g&&"undefined"!==typeof R))switch(g=b64d(g).split(","),f=a(this).attr("client-list-type"),l=!1,a.each(g,function(t,c){if(""==c)return!0;if("*"==c.charAt(0))if("*"==c.charAt(c.length-1)){if(c=c.substr(1,c.length-2).toLowerCase(),-1!=L.indexOf(c))return l=!0,
10
+ !1}else{if(c=c.substr(1).toLowerCase(),L.substr(-c.length)==c)return l=!0,!1}else if("*"==c.charAt(c.length-1)){if(c=c.substr(0,c.length-1).toLowerCase(),0==L.indexOf(c))return l=!0,!1}else if(R.is(c))return l=!0,!1}),f){case "B":l&&(b=!1);break;case "W":l||(b=!1)}var M=g=!1;if(b&&(f=a(this).attr("parameter-list"),"undefined"!=typeof f)){f=b64d(f).split(",");var u=a(this).attr("parameter-list-type"),S=[];G.forEach(function(t){t=t.split("=");try{var c=JSON.parse(decodeURIComponent(t[1]))}catch(T){c=
11
+ decodeURIComponent(t[1])}S[t[0]]=c});var w=!1,H=a(this);a.each(f,function(t,c){var T=c.split("&&");a.each(T,function(X,m){var x=!0;m=m.trim();"!!"==m.substring(0,2)&&(x=!1,m=m.substring(2));var p=m,y="!@!",U=-1!=m.indexOf("["),V=(0==m.indexOf("tcf-v2")||0==m.indexOf("euconsent-v2"))&&-1!=m.indexOf("[");-1!=m.indexOf("=")&&(y=m.split("="),p=y[0],y=y[1],U=-1!=p.indexOf("["),V=(0==p.indexOf("tcf-v2")||0==p.indexOf("euconsent-v2"))&&-1!=p.indexOf("["));if(V)a("#ai-iab-tcf-bar").show(),"object"==typeof ai_tcData?
12
+ (a("#ai-iab-tcf-bar").addClass("status-ok"),p=p.replace(/]| /gi,"").split("["),p.shift(),w=(p=h(p,ai_tcData,y))?x:!x):(H.addClass("ai-list-data"),M=!0,"function"==typeof __tcfapi?P(!1):"undefined"==typeof ai_tcData_retrying&&(ai_tcData_retrying=!0,setTimeout(function(){P(!0)},200)));else if(U)w=(p=F(S,p,y))?x:!x;else{var N=!1;"!@!"==y?G.every(function(W){return W.split("=")[0]==m?(N=!0,!1):!0}):N=-1!=G.indexOf(m);w=N?x:!x}if(!w)return!1});if(w)return!1});switch(u){case "B":w&&(b=!1);break;case "W":w||
13
+ (b=!1)}a(this).hasClass("ai-list-manual")&&(b?(H.removeClass("ai-list-data"),H.removeClass("ai-list-manual")):(g=!0,H.addClass("ai-list-data")));if(!g&&!M&&(f=a(this).data("debug-info"),"undefined"!=typeof f&&(f=a("."+f),0!=f.length))){var q=f.parent();q.hasClass("ai-debug-info")&&q.remove()}}q=a(this).prevAll(".ai-debug-bar.ai-debug-lists");f=""==r?"#":r;q.find(".ai-debug-name.ai-list-info").text(f).attr("title",K);q.find(".ai-debug-name.ai-list-status").text(b?ai_front.visible:ai_front.hidden);
14
+ f=!1;if(b){u=a(this).attr("scheduling-start");var A=a(this).attr("scheduling-end"),B=a(this).attr("scheduling-days");if("undefined"!=typeof u&&"undefined"!=typeof A&&"undefined"!=typeof B){f=!0;var O=parseInt(a(this).attr("scheduling-fallback")),v=parseInt(a(this).attr("gmt"));u=z(b64d(u))+v;A=z(b64d(A))+v;B=b64d(B).split(",");q=a(this).attr("scheduling-type");var C=(new Date).getTime()+v,I=new Date(C),D=I.getDay();0==D?D=6:D--;v=C>=u&&C<A&&B.includes(D.toString());switch(q){case "B":v=!v}v||(b=!1);
15
+ I=I.toISOString().split(".")[0].replace("T"," ");q=a(this).prevAll(".ai-debug-bar.ai-debug-scheduling");q.find(".ai-debug-name.ai-scheduling-info").text(I+" "+D+" current_time:"+C.toString()+" start_date:"+u.toString()+" ="+(C>=u).toString()+" end_date:"+A.toString()+" =:"+(C<A).toString()+" days:"+B.toString()+" =:"+B.includes(D.toString()).toString());q.find(".ai-debug-name.ai-scheduling-status").text(b?ai_front.visible:ai_front.hidden);b||0==O||(q.removeClass("ai-debug-scheduling").addClass("ai-debug-fallback"),
16
+ q.find(".ai-debug-name.ai-scheduling-status").text(ai_front.fallback+"="+O))}}if(g||M)return!0;a(this).css({visibility:"",position:"",width:"",height:"","z-index":""});b?(d.css({visibility:""}),d.hasClass("ai-remove-position")&&d.css({position:""}),"undefined"!=typeof a(this).data("code")&&(b=b64d(a(this).data("code")),0!=a(this).closest("head").length?(a(this).after(b),a(this).remove()):a(this).append(b),ai_process_element(this))):f&&!v&&0!=O?(d.css({visibility:""}),d.hasClass("ai-remove-position")&&
17
+ d.css({position:""}),a(this).next(".ai-fallback").removeClass("ai-fallback"),"undefined"!=typeof a(this).data("fallback-code")?(b=b64d(a(this).data("fallback-code")),a(this).append(b),ai_process_element(this)):(a(this).hide(),d.find(".ai-debug-block").length||d.hide()),b=d.attr("data-ai"),"undefined"!==typeof b&&!1!==b&&(b=a(this).attr("fallback-tracking"),"undefined"!==typeof b&&!1!==b&&d.attr("data-ai",b))):(a(this).hide(),d.find(".ai-debug-block").length||d.hide(),d.removeAttr("data-ai").removeClass("ai-track"),
18
+ d.find(".ai-debug-block").length?(d.css({visibility:""}).removeClass("ai-close"),d.hasClass("ai-remove-position")&&d.css({position:""})):d.hide());a(this).attr("data-code","");a(this).attr("data-fallback-code","");d.removeClass("ai-list-block")})}};a(document).ready(function(e){setTimeout(function(){ai_process_lists();setTimeout(function(){n()},50);if("function"==typeof ai_load_blocks)jQuery(document).on("cmplzEnableScripts",function(h){"all"===h.consentLevel&&ai_load_blocks()});jQuery("#ai-iab-tcf-bar").click(function(){AiCookies.remove("euconsent-v2",
19
+ {path:"/",domain:"."+window.location.hostname});AiCookies.remove("__lxG__consent__v2",{path:"/",domain:"."+window.location.hostname});AiCookies.remove("__lxG__consent__v2_daisybit",{path:"/",domain:"."+window.location.hostname});AiCookies.remove("__lxG__consent__v2_gdaisybit",{path:"/",domain:"."+window.location.hostname});AiCookies.remove("cmplz_marketing",{path:"/",domain:"."+window.location.hostname});AiCookies.remove("cmplz_stats",{path:"/",domain:"."+window.location.hostname});AiCookies.remove("complianz_consent_status",
20
+ {path:"/",domain:"."+window.location.hostname});jQuery("#ai-iab-tcf-status").text("COOKIE DELETED")})},5)})});
21
  function ai_process_element(a){setTimeout(function(){"function"==typeof ai_process_rotations_in_element&&ai_process_rotations_in_element(a);"function"==typeof ai_process_lists&&ai_process_lists(jQuery("div.ai-list-data",a));"function"==typeof ai_process_ip_addresses&&ai_process_ip_addresses(jQuery("div.ai-ip-data",a));"function"==typeof ai_adb_process_blocks&&ai_adb_process_blocks(a)},5)}
22
+ function getAllUrlParams(a){var k=a?a.split("?")[1]:window.location.search.slice(1);a={};if(k){k=k.split("#")[0];k=k.split("&");for(var z=0;z<k.length;z++){var n=k[z].split("="),E=void 0,e=n[0].replace(/\[\d*\]/,function(h){E=h.slice(1,-1);return""});n="undefined"===typeof n[1]?"":n[1];e=e.toLowerCase();n=n.toLowerCase();a[e]?("string"===typeof a[e]&&(a[e]=[a[e]]),"undefined"===typeof E?a[e].push(n):a[e][E]=n):a[e]=n}}return a};
includes/js/ai-mobile-detect.js CHANGED
@@ -1,3 +1,4 @@
 
1
  // THIS FILE IS GENERATED - DO NOT EDIT!
2
  /*!mobile-detect v1.4.4 2019-09-21*/
3
  /*global module:false, define:false*/
1
+ ;// Semicolon in the case it is missing in the code above
2
  // THIS FILE IS GENERATED - DO NOT EDIT!
3
  /*!mobile-detect v1.4.4 2019-09-21*/
4
  /*global module:false, define:false*/
includes/js/ai-mobile-detect.min.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(h,f){h(function(){function m(a,b){return null!=a&&null!=b&&a.toLowerCase()===b.toLowerCase()}function h(a,b){var c,d=a.length;if(!d||!b)return!1;var f=b.toLowerCase();for(c=0;c<d;++c)if(f===a[c].toLowerCase())return!0;return!1}function k(a){for(var b in a)l.call(a,b)&&(a[b]=new RegExp(a[b],"i"))}function g(a,b){this.ua=(a||"").substr(0,500);this._cache={};this.maxPhoneWidth=b||600}var b={mobileDetectRules:{phones:{iPhone:"\\biPhone\\b|\\biPod\\b",BlackBerry:"BlackBerry|\\bBB10\\b|rim[0-9]+|\\b(BBA100|BBB100|BBD100|BBE100|BBF100|STH100)\\b-[0-9]+",
2
  HTC:"HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m|Android [0-9.]+; Pixel",Nexus:"Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6",Dell:"Dell[;]? (Streak|Aero|Venue|Venue Pro|Flash|Smoke|Mini 3iX)|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b",Motorola:"Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b|XT1068|XT1092|XT1052",
3
  Samsung:"\\bSamsung\\b|SM-G950F|SM-G955F|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C|SM-A310F|GT-I9190|SM-J500FN|SM-G903F|SM-J330F",
4
  LG:"\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323|M257)|LM-G710",
1
+ ;(function(h,f){h(function(){function m(a,b){return null!=a&&null!=b&&a.toLowerCase()===b.toLowerCase()}function h(a,b){var c,d=a.length;if(!d||!b)return!1;var f=b.toLowerCase();for(c=0;c<d;++c)if(f===a[c].toLowerCase())return!0;return!1}function k(a){for(var b in a)l.call(a,b)&&(a[b]=new RegExp(a[b],"i"))}function g(a,b){this.ua=(a||"").substr(0,500);this._cache={};this.maxPhoneWidth=b||600}var b={mobileDetectRules:{phones:{iPhone:"\\biPhone\\b|\\biPod\\b",BlackBerry:"BlackBerry|\\bBB10\\b|rim[0-9]+|\\b(BBA100|BBB100|BBD100|BBE100|BBF100|STH100)\\b-[0-9]+",
2
  HTC:"HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m|Android [0-9.]+; Pixel",Nexus:"Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6",Dell:"Dell[;]? (Streak|Aero|Venue|Venue Pro|Flash|Smoke|Mini 3iX)|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b",Motorola:"Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b|XT1068|XT1092|XT1052",
3
  Samsung:"\\bSamsung\\b|SM-G950F|SM-G955F|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C|SM-A310F|GT-I9190|SM-J500FN|SM-G903F|SM-J330F",
4
  LG:"\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323|M257)|LM-G710",
js/ad-inserter.js CHANGED
@@ -1,4 +1,4 @@
1
- var javascript_version = "2.6.15";
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
@@ -2334,6 +2334,7 @@ jQuery(document).ready (function($) {
2334
  $('#disable-footer-code').checkboxButton ();
2335
  $('#disable-js-code').checkboxButton ();
2336
  $('#disable-css-code').checkboxButton ();
 
2337
  $('#disable-php-processing').checkboxButton ();
2338
  $('#disable-blocks').checkboxButton ();
2339
 
@@ -2353,6 +2354,10 @@ jQuery(document).ready (function($) {
2353
  $('#ai-page-css').toggleClass ('ai-page-code-disabled');
2354
  });
2355
 
 
 
 
 
2356
  $("input#disable-php-processing").change (function() {
2357
  $('#ai-page-php').toggleClass ('ai-page-code-disabled');
2358
  });
@@ -3249,7 +3254,9 @@ jQuery(document).ready (function($) {
3249
  $('div#tab-banner-' + block + ' table.ai-settings-table').css ('position', 'relative');
3250
  }
3251
 
3252
- image.attr ('src', new_image_src).load (function () {
 
 
3253
  image.show ();
3254
  $('div#tab-banner-' + block + ' table.ai-settings-table').css ('position', 'inherit');
3255
  $(this).closest ('.ai-banner').removeClass ('ai-banner-top');
@@ -3260,7 +3267,9 @@ jQuery(document).ready (function($) {
3260
  $(this).closest ('.ai-banner').addClass ('ai-banner-top');
3261
  }
3262
  })
3263
- .error (function() {
 
 
3264
  if (image.is(':visible')) {
3265
  // image.hide ().attr ('src', '//:0');
3266
  image.hide ().attr ('src', '');
@@ -3688,7 +3697,8 @@ jQuery(document).ready (function($) {
3688
 
3689
  configure_sticky_css (block);
3690
 
3691
- image.attr ('src', new_image_src).load (function () {
 
3692
  image.show ();
3693
  $('div#sticky-background-' + block + ' table.ai-settings-table').css ('position', 'inherit');
3694
  $(this).closest ('.ai-banner').removeClass ('ai-banner-top');
@@ -3699,7 +3709,8 @@ jQuery(document).ready (function($) {
3699
  $(this).closest ('.ai-banner').addClass ('ai-banner-top');
3700
  }
3701
  })
3702
- .error (function() {
 
3703
  if (image.is(':visible')) {
3704
  // image.hide ().attr ('src', '//:0');
3705
  image.hide ().attr ('src', '');
1
+ var javascript_version = "2.6.16";
2
  var ignore_key = true;
3
  var start = 1;
4
  var end = 16;
2334
  $('#disable-footer-code').checkboxButton ();
2335
  $('#disable-js-code').checkboxButton ();
2336
  $('#disable-css-code').checkboxButton ();
2337
+ $('#disable-html-code').checkboxButton ();
2338
  $('#disable-php-processing').checkboxButton ();
2339
  $('#disable-blocks').checkboxButton ();
2340
 
2354
  $('#ai-page-css').toggleClass ('ai-page-code-disabled');
2355
  });
2356
 
2357
+ $("input#disable-html-code").change (function() {
2358
+ $('#ai-page-html').toggleClass ('ai-page-code-disabled');
2359
+ });
2360
+
2361
  $("input#disable-php-processing").change (function() {
2362
  $('#ai-page-php').toggleClass ('ai-page-code-disabled');
2363
  });
3254
  $('div#tab-banner-' + block + ' table.ai-settings-table').css ('position', 'relative');
3255
  }
3256
 
3257
+ // Removed in jQuery 3
3258
+ // image.attr ('src', new_image_src).load (function () {
3259
+ image.attr ('src', new_image_src).on ("load", function () {
3260
  image.show ();
3261
  $('div#tab-banner-' + block + ' table.ai-settings-table').css ('position', 'inherit');
3262
  $(this).closest ('.ai-banner').removeClass ('ai-banner-top');
3267
  $(this).closest ('.ai-banner').addClass ('ai-banner-top');
3268
  }
3269
  })
3270
+ // Removed in jQuery 3
3271
+ // .error (function() {
3272
+ .on ("error", function() {
3273
  if (image.is(':visible')) {
3274
  // image.hide ().attr ('src', '//:0');
3275
  image.hide ().attr ('src', '');
3697
 
3698
  configure_sticky_css (block);
3699
 
3700
+ // image.attr ('src', new_image_src).load (function () {
3701
+ image.attr ('src', new_image_src).on ('load', function () {
3702
  image.show ();
3703
  $('div#sticky-background-' + block + ' table.ai-settings-table').css ('position', 'inherit');
3704
  $(this).closest ('.ai-banner').removeClass ('ai-banner-top');
3709
  $(this).closest ('.ai-banner').addClass ('ai-banner-top');
3710
  }
3711
  })
3712
+ // .error (function() {
3713
+ .on ('error', function() {
3714
  if (image.is(':visible')) {
3715
  // image.hide ().attr ('src', '//:0');
3716
  image.hide ().attr ('src', '');
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: ads, adsense, ad rotation, ad manager, amp, amazon, ad blocking detection,
6
  Requires at least: 4.6
7
  Tested up to: 5.5
8
  Requires PHP: 5.6
9
- Stable tag: 2.6.15
10
  License: GPLv3
11
 
12
  Manage Google AdSense, Media.net, Amazon banners, ads.txt, ad rotation, sticky widgets, AMP ads, DFP, tracking, AdSense header and footer code
@@ -335,6 +335,14 @@ If you are not happy to reveal this information and you have opted in, simply di
335
 
336
  == Changelog ==
337
 
 
 
 
 
 
 
 
 
338
  = 2.6.15 =
339
  - No ad blocking detection actions for crawlers and bots
340
  - Fix for processing Ad Inserter shortcodes inside HTML tags
@@ -463,6 +471,14 @@ For the changelog of earlier versions, please refer to the separate changelog.tx
463
 
464
  == Upgrade Notice ==
465
 
 
 
 
 
 
 
 
 
466
  = 2.6.15 =
467
  No ad blocking detection actions for crawlers and bots;
468
  Fix for processing Ad Inserter shortcodes inside HTML tags;
6
  Requires at least: 4.6
7
  Tested up to: 5.5
8
  Requires PHP: 5.6
9
+ Stable tag: 2.6.16
10
  License: GPLv3
11
 
12
  Manage Google AdSense, Media.net, Amazon banners, ads.txt, ad rotation, sticky widgets, AMP ads, DFP, tracking, AdSense header and footer code
335
 
336
  == Changelog ==
337
 
338
+ = 2.6.16 =
339
+ - Added support for ad blocking detection action every n pageviews
340
+ - Added support to individually disable pageview or click tracking (Pro only)
341
+ - Changed IAB TCF v2 cookie check name from euconsent-v2 to tcf-v2 (euconsent-v2 will still work)
342
+ - Fix for category check on category pages
343
+ - Fix for issues with Safari browser
344
+ - Few minor bug fixes, cosmetic changes and code improvements
345
+
346
  = 2.6.15 =
347
  - No ad blocking detection actions for crawlers and bots
348
  - Fix for processing Ad Inserter shortcodes inside HTML tags
471
 
472
  == Upgrade Notice ==
473
 
474
+ = 2.6.16 =
475
+ Added support for ad blocking detection action every n pageviews;
476
+ Added support to individually disable pageview or click tracking (Pro only);
477
+ Changed IAB TCF v2 cookie check name from euconsent-v2 to tcf-v2 (euconsent-v2 will still work);
478
+ Fix for category check on category pages;
479
+ Fix for issues with Safari browser;
480
+ Few minor bug fixes, cosmetic changes and code improvements
481
+
482
  = 2.6.15 =
483
  No ad blocking detection actions for crawlers and bots;
484
  Fix for processing Ad Inserter shortcodes inside HTML tags;
settings.php CHANGED
@@ -74,18 +74,20 @@ function generate_settings_form (){
74
 
75
  $disable_block_insertions = get_disable_block_insertions ();
76
  $disable_php_processing = get_disable_php_processing ();
 
77
  $disable_css_code = get_disable_css_code ();
78
  $disable_js_code = get_disable_js_code ();
79
  $disable_footer_code = get_disable_footer_code ();
80
  $disable_header_code = get_disable_header_code ();
81
 
82
- $insertion_disabled = $disable_block_insertions || $disable_php_processing || $disable_css_code || $disable_js_code || $disable_footer_code || $disable_header_code;
83
 
84
  if ($insertion_disabled) {
85
  $insertion_statuses = '<span class="ai-insertion-status"'. ($disable_header_code ? ' style="color: #f22"' : '') . '">H</span> &nbsp; ';
86
  $insertion_statuses .= '<span class="ai-insertion-status"'. ($disable_footer_code ? ' style="color: #f22"' : '') . '">F</span> &nbsp; ';
87
  $insertion_statuses .= '<span class="ai-insertion-status"'. ($disable_js_code ? ' style="color: #f22"' : '') . '">JS</span> &nbsp; ';
88
  $insertion_statuses .= '<span class="ai-insertion-status"'. ($disable_css_code ? ' style="color: #f22"' : '') . '">CSS</span> &nbsp; ';
 
89
  $insertion_statuses .= '<span class="ai-insertion-status"'. ($disable_php_processing ? ' style="color: #f22"' : '') . '">PHP</span> &nbsp; ';
90
  $insertion_statuses .= '<span class="ai-insertion-status"'. ($disable_block_insertions ? ' style="color: #f22"' : '') . '">BLOCKS</span>';
91
  } else $insertion_statuses = '';
@@ -2894,7 +2896,7 @@ function generate_settings_form (){
2894
  <?php _e ('Delay Action', 'ad-inserter'); ?>
2895
  </td>
2896
  <td>
2897
- <input style="width: 40px;" type="text" name="<?php echo AI_OPTION_ADB_DELAY_ACTION; ?>" title="<?php _e ('Number of page views to delay action when ad blocking is detected. Leave empty for no delay (action fires on first page view). Sets cookie.', 'ad-inserter'); ?>" value="<?php echo get_delay_action (); ?>" default="" size="3" maxlength="5" /> <?php _ex ('page views', 'Delay Action for x ', 'ad-inserter'); ?>
2898
  </td>
2899
  </tr>
2900
  <tr>
@@ -2902,7 +2904,7 @@ function generate_settings_form (){
2902
  <?php _e ('No Action Period', 'ad-inserter'); ?>
2903
  </td>
2904
  <td>
2905
- <input style="width: 40px;" type="text" name="<?php echo AI_OPTION_ADB_NO_ACTION_PERIOD; ?>" title="<?php _e ('Number of days to supress action when ad blocking is detected. Leave empty for no no-action period (action fires always after defined page view delay). Sets cookie.', 'ad-inserter'); ?>" value="<?php echo get_no_action_period (); ?>" default="<?php echo AI_DEFAULT_ADB_NO_ACTION_PERIOD; ?>" size="3" maxlength="5" /> <?php _ex ('days', 'no action period', 'ad-inserter'); ?>
2906
  </td>
2907
  </tr>
2908
  <tr>
@@ -3045,6 +3047,10 @@ function generate_settings_form (){
3045
  <input type="checkbox" name="disable-css-code" value="1" id="disable-css-code" default="<?php echo DEFAULT_DISABLE_CSS_CODE; ?>" <?php if ($disable_css_code == AI_ENABLED) echo 'checked '; ?> style="display: none;" />
3046
  <label class="checkbox-button" style="margin-left: 10px;" for="disable-css-code" title="<?php /* translators: %s: Ad Inserter */ printf (__ ('Disable %s CSS code', 'ad-inserter'), AD_INSERTER_NAME); ?>"><span class="checkbox-icon icon-css<?php if ($disable_css_code == AI_ENABLED) echo ' on'; ?>"></span></label>
3047
 
 
 
 
 
3048
  <input type="hidden" name="disable-php-processing" value="0" />
3049
  <input type="checkbox" name="disable-php-processing" value="1" id="disable-php-processing" default="<?php echo DEFAULT_DISABLE_PHP_PROCESSING; ?>" <?php if ($disable_php_processing == AI_ENABLED) echo 'checked '; ?> style="display: none;" />
3050
  <label class="checkbox-button" style="margin-left: 10px;" for="disable-php-processing" title="<?php _e ('Disable PHP code processing (in all blocks including header and footer code)', 'ad-inserter'); ?>"><span class="checkbox-icon icon-php-red<?php if ($disable_php_processing == AI_ENABLED) echo ' on'; ?>"></span></label>
@@ -3081,6 +3087,7 @@ function generate_settings_form (){
3081
 
3082
  &lt;/div&gt;</span>
3083
  ...
 
3084
  <span id="ai-page-js"<?php if ($disable_js_code) echo ' class="ai-page-code-disabled"'; ?>>&lt;script&gt;
3085
  <?php /* translators: %s: Ad Inserter */ printf (__ ('%s JS CODE', 'ad-inserter'), strtoupper (AD_INSERTER_NAME)); ?>
3086
 
74
 
75
  $disable_block_insertions = get_disable_block_insertions ();
76
  $disable_php_processing = get_disable_php_processing ();
77
+ $disable_html_code = get_disable_html_code ();
78
  $disable_css_code = get_disable_css_code ();
79
  $disable_js_code = get_disable_js_code ();
80
  $disable_footer_code = get_disable_footer_code ();
81
  $disable_header_code = get_disable_header_code ();
82
 
83
+ $insertion_disabled = $disable_block_insertions || $disable_php_processing || $disable_html_code || $disable_css_code || $disable_js_code || $disable_footer_code || $disable_header_code;
84
 
85
  if ($insertion_disabled) {
86
  $insertion_statuses = '<span class="ai-insertion-status"'. ($disable_header_code ? ' style="color: #f22"' : '') . '">H</span> &nbsp; ';
87
  $insertion_statuses .= '<span class="ai-insertion-status"'. ($disable_footer_code ? ' style="color: #f22"' : '') . '">F</span> &nbsp; ';
88
  $insertion_statuses .= '<span class="ai-insertion-status"'. ($disable_js_code ? ' style="color: #f22"' : '') . '">JS</span> &nbsp; ';
89
  $insertion_statuses .= '<span class="ai-insertion-status"'. ($disable_css_code ? ' style="color: #f22"' : '') . '">CSS</span> &nbsp; ';
90
+ $insertion_statuses .= '<span class="ai-insertion-status"'. ($disable_html_code ? ' style="color: #f22"' : '') . '">HTML</span> &nbsp; ';
91
  $insertion_statuses .= '<span class="ai-insertion-status"'. ($disable_php_processing ? ' style="color: #f22"' : '') . '">PHP</span> &nbsp; ';
92
  $insertion_statuses .= '<span class="ai-insertion-status"'. ($disable_block_insertions ? ' style="color: #f22"' : '') . '">BLOCKS</span>';
93
  } else $insertion_statuses = '';
2896
  <?php _e ('Delay Action', 'ad-inserter'); ?>
2897
  </td>
2898
  <td>
2899
+ <input style="width: 60px;" type="text" name="<?php echo AI_OPTION_ADB_DELAY_ACTION; ?>" title="<?php _e ('Number of page views to delay action when ad blocking is detected. Leave empty for no delay (action fires on first page view). Sets cookie.', 'ad-inserter'); ?>" value="<?php echo get_delay_action (); ?>" default="" size="3" maxlength="8" /> <?php _ex ('page views', 'Delay Action for x ', 'ad-inserter'); ?>
2900
  </td>
2901
  </tr>
2902
  <tr>
2904
  <?php _e ('No Action Period', 'ad-inserter'); ?>
2905
  </td>
2906
  <td>
2907
+ <input style="width: 60px;" type="text" name="<?php echo AI_OPTION_ADB_NO_ACTION_PERIOD; ?>" title="<?php _e ('Number of days to supress action when ad blocking is detected. Leave empty for no no-action period (action fires always after defined page view delay). Sets cookie.', 'ad-inserter'); ?>" value="<?php echo get_no_action_period (); ?>" default="<?php echo AI_DEFAULT_ADB_NO_ACTION_PERIOD; ?>" size="3" maxlength="5" /> <?php _ex ('days', 'no action period', 'ad-inserter'); ?>
2908
  </td>
2909
  </tr>
2910
  <tr>
3047
  <input type="checkbox" name="disable-css-code" value="1" id="disable-css-code" default="<?php echo DEFAULT_DISABLE_CSS_CODE; ?>" <?php if ($disable_css_code == AI_ENABLED) echo 'checked '; ?> style="display: none;" />
3048
  <label class="checkbox-button" style="margin-left: 10px;" for="disable-css-code" title="<?php /* translators: %s: Ad Inserter */ printf (__ ('Disable %s CSS code', 'ad-inserter'), AD_INSERTER_NAME); ?>"><span class="checkbox-icon icon-css<?php if ($disable_css_code == AI_ENABLED) echo ' on'; ?>"></span></label>
3049
 
3050
+ <input type="hidden" name="disable-html-code" value="0" />
3051
+ <input type="checkbox" name="disable-html-code" value="1" id="disable-html-code" default="<?php echo DEFAULT_DISABLE_HTML_CODE; ?>" <?php if ($disable_html_code == AI_ENABLED) echo 'checked '; ?> style="display: none;" />
3052
+ <label class="checkbox-button" style="margin-left: 10px;" for="disable-html-code" title="<?php /* translators: %s: Ad Inserter */ printf (__ ('Disable %s HTML code', 'ad-inserter'), AD_INSERTER_NAME); ?>"><span class="checkbox-icon icon-html<?php if ($disable_html_code == AI_ENABLED) echo ' on'; ?>"></span></label>
3053
+
3054
  <input type="hidden" name="disable-php-processing" value="0" />
3055
  <input type="checkbox" name="disable-php-processing" value="1" id="disable-php-processing" default="<?php echo DEFAULT_DISABLE_PHP_PROCESSING; ?>" <?php if ($disable_php_processing == AI_ENABLED) echo 'checked '; ?> style="display: none;" />
3056
  <label class="checkbox-button" style="margin-left: 10px;" for="disable-php-processing" title="<?php _e ('Disable PHP code processing (in all blocks including header and footer code)', 'ad-inserter'); ?>"><span class="checkbox-icon icon-php-red<?php if ($disable_php_processing == AI_ENABLED) echo ' on'; ?>"></span></label>
3087
 
3088
  &lt;/div&gt;</span>
3089
  ...
3090
+ <span id="ai-page-html"<?php if ($disable_html_code) echo ' class="ai-page-code-disabled"'; ?>>&lt;span&gt;<?php /* translators: %s: Ad Inserter */ printf (__ ('%s HTML CODE', 'ad-inserter'), strtoupper (AD_INSERTER_NAME)); ?>&lt;/span&gt;</span>
3091
  <span id="ai-page-js"<?php if ($disable_js_code) echo ' class="ai-page-code-disabled"'; ?>>&lt;script&gt;
3092
  <?php /* translators: %s: Ad Inserter */ printf (__ ('%s JS CODE', 'ad-inserter'), strtoupper (AD_INSERTER_NAME)); ?>
3093