Changeset 3042304 for advanced-iframe
- Timestamp:
- 02/28/2024 06:05:35 AM (14 months ago)
- Location:
- advanced-iframe/trunk
- Files:
-
- 12 edited
-
advanced-iframe-admin-page.php (modified) (2 diffs)
-
advanced-iframe.php (modified) (7 diffs)
-
css/ai.css (modified) (3 diffs)
-
includes/advanced-iframe-admin-quickstart.php (modified) (8 diffs)
-
includes/advanced-iframe-main-after-iframe.php (modified) (3 diffs)
-
includes/advanced-iframe-main-helper.php (modified) (1 diff)
-
includes/advanced-iframe-main-iframe.php (modified) (1 diff)
-
includes/advanced-iframe-main-prepare.php (modified) (3 diffs)
-
includes/advanced-iframe-main-read-config.php (modified) (3 diffs)
-
js/ai.js (modified) (4 diffs)
-
js/ai.min.js (modified) (1 diff)
-
readme.txt (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-iframe/trunk/advanced-iframe-admin-page.php
r3010215 r3042304 14 14 global $aiVersion; 15 15 global $isFreemius; 16 global $isFreemiusMigration; 16 17 17 18 $updated = false; … … 372 373 if (!$evanto && !$isDemo && $showProMessage) { 373 374 echo '<div id="test-pro-admin" class="notice notice-success is-dismissible is-permanent-closable"><p><strong>'; 374 echo __('Curious about the pro features? Enable them on the <a href="#" class="enable-admin">options tab</a> and test them in the preview.', 'advanced-iframe'); 375 if ($isFreemiusMigration) { 376 $pricingUrl = get_admin_url() . 'admin.php?page=advanced-iframe-pricing&trial=true'; 377 echo __('Curious about the pro features? <a href="', 'advanced-iframe'); 378 echo $pricingUrl; 379 echo __('">Start your 30-day free trial</a>.', 'advanced-iframe'); 380 } else { 381 echo __('Curious about the pro features? Enable them on the <a href="#" class="enable-admin">options tab</a> and test them in the preview.', 'advanced-iframe'); 382 } 375 383 echo '</strong></p></div>'; 376 384 } -
advanced-iframe/trunk/advanced-iframe.php
r3028439 r3042304 3 3 Plugin Name: Advanced iFrame 4 4 Plugin URI: https://1.envato.market/VDRDJ 5 Version: 2024. 05 Version: 2024.2 6 6 Text Domain: advanced-iframe 7 7 Domain Path: /languages … … 48 48 include dirname(__FILE__) . '/includes/advanced-iframe-main-cookie.php'; 49 49 50 $aiVersion = '2024. 0';50 $aiVersion = '2024.2'; 51 51 // check $aiJsSize 52 52 … … 678 678 * renders the iframe script 679 679 */ 680 function do_iframe_script($atts, $content = null) 681 {680 function do_iframe_script($atts, $content = null) { 681 global $isFreemiusMigration; 682 682 $start = microtime(true); 683 683 // Avoids that iframes are called before the body! … … 919 919 function createMinimizedAiJs($backend) { 920 920 global $aiVersion; 921 $aiJsSize = 89 201;921 $aiJsSize = 89306; 922 922 $newContent = file_get_contents(dirname(__FILE__) . '/js/ai.js'); 923 923 $oldFileName = dirname(__FILE__) . '/js/ai.min.js'; 924 $oldFile = file_get_contents($oldFileName);925 924 if ((strlen($newContent) == $aiJsSize) && file_exists($oldFileName)) { 926 925 return; … … 944 943 } else { 945 944 $minifiedContent = $newContent; 946 } 947 945 } 948 946 } 949 947 … … 1483 1481 $content = $this->filterAttribute('custom', $attsArray, $content); 1484 1482 $content = $this->filterAttribute('include_html', $attsArray, $content); 1483 $content = $this->filterAttribute('additional_js', $attsArray, $content); 1484 $content = $this->filterAttribute('additional_js_file_iframe', $attsArray, $content); 1485 1485 $content = $this->filterXSSAttributes($attsArray, $content); 1486 1486 } … … 1772 1772 function advanced_iframe_plugin_meta_pro($links, $file) 1773 1773 { 1774 global $isFreemiusMigration; 1774 1775 if (strpos($file, '/advanced-iframe') !== false) { 1775 1776 $iconstyle = 'style="-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;"'; 1776 1777 $links = array(); 1777 $links = array_merge($links, 1778 array('Version ' . advanced_iframe_plugin_version(), 1778 1779 if ($isFreemiusMigration) { 1780 $aiLinks = array('Version ' . advanced_iframe_plugin_version(), 1781 'By <a href="https://www.tinywebgallery.com">Michael Dempfle</a>', 1782 '<a href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo">Demos</a>' 1783 ); 1784 } else { 1785 $aiLinks = array('Version ' . advanced_iframe_plugin_version(), 1779 1786 'By <a href="https://www.tinywebgallery.com">Michael Dempfle</a>', 1780 1787 '<a target="_blank" href="https://1.envato.market/k2Q2x">Code canyon - Advanced iFrame Pro</a>', 1781 1788 '<a href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo">Demos</a>' 1782 )); 1789 ); 1790 } 1791 $links = array_merge($links, $aiLinks); 1783 1792 } 1784 1793 return $links; -
advanced-iframe/trunk/css/ai.css
r2961394 r3042304 93 93 height: 260px; 94 94 } 95 96 #ai .signup_account_container_freemius { 97 height: 320px; 98 } 99 95 100 #ai .signup_account_container#first { 96 101 margin-left: 50px; … … 126 131 height: 206px; 127 132 } 133 134 #ai .signup_inner_freemius { 135 height: 266px; 136 } 137 128 138 #ai .signup_inner_desc { 129 139 color: #484848; … … 763 773 } 764 774 765 766 767 775 #ai .opt_in_done { 776 background: green; 777 cursor: default; 778 pointer-events: none; 779 } 780 781 782 783 -
advanced-iframe/trunk/includes/advanced-iframe-admin-quickstart.php
r3028439 r3042304 39 39 40 40 function printDonation($devOptions, $evanto, $closedArray) { 41 global $isFreemius, $isFreemiusMigration ;41 global $isFreemius, $isFreemiusMigration, $ai_fs; 42 42 if ($evanto) { 43 43 echo '<br/> … … 64 64 } 65 65 66 $freeAdditional = $isFreemiusMigration ? __('<br><br>Advanced iframe pro has migrated to freemius. And this are the reasons why you should also move your existing license:<span>Automatic updates!</span><span>Different plans -> monthly, yearly, live time</span><span>Multi site support -> 1,5, unlimited sites plans available </span><span>You can switch plans or add additional site licenses how you need it.</span><span>Better support rules as for codecanyon. If you choose a subscription plan you get support as long as you plan runs.</span><br>If you have a codecanyon license already <a href="xxx">you can migrate it to freemius.</a><br><br>There is also a very good reason why I migrated: The fees are simply much lower than on codecanyon (7% vs. 30%-70%!) and I never liked that codecanyon does not offer auto update and multi site licenses which many people complained about. This is also the reason why the live time license on freemius is cheaper then the one on codecanyon!</p><p>Just check by yourself: <a href="https://freemius.com/wordpress/features-comparison/" target="_blank">https://freemius.com/wordpress/features-comparison/</a>', 'advanced-iframe' ) : " nix";66 $freeAdditional = $isFreemiusMigration ? __('<br><br>Advanced iframe pro has migrated to freemius. And this are the reasons why you should also move your existing license:<span>Automatic updates!</span><span>Different plans -> monthly, yearly, live time</span><span>Multi site support -> 1,5, unlimited sites plans available </span><span>You can switch plans or add additional site licenses how you need it.</span><span>Better support rules as for codecanyon. If you choose a subscription plan you get support as long as you plan runs.</span><br>If you have a codecanyon license already <a href="xxx">you can migrate it to freemius.</a><br><br>There is also a very good reason why I migrated: The fees are simply much lower than on codecanyon (7% vs. 30%-70%!) and I never liked that codecanyon does not offer auto update and multi site licenses which many people complained about. This is also the reason why the live time license on freemius is cheaper then the one on codecanyon!</p><p>Just check by yourself: <a href="https://freemius.com/wordpress/features-comparison/" target="_blank">https://freemius.com/wordpress/features-comparison/</a>', 'advanced-iframe' ) : ""; 67 67 68 68 printPurchaseCodeInput($devOptions, __('Purchase code', 'advanced-iframe' ), 'purchase_code', __('Please enter your purchase code here to finish the registration and unlock all features of advanced iframe pro. Your license key (purchase code) is located inside your digital purchase receipt on your <a href="https://codecanyon.net/downloads" target="_blank">CodeCanyon Downloads page</a>. To retrieve your license key, visit CodeCanyon.net/downloads and click "Download > License Certificate". Please note that your purchase code will be validated and logged together with relevant data to detect fraud. Also see the privacy policy here: https://www.tinywebgallery.com/blog/privacy-policy for details. Please do not share your purchase code as it will be blocked when misuse will be detected.', 'advanced-iframe') . $status . $freeAdditional); … … 172 172 _e('Advanced iFrame - Upgrading to Advanced iFrame Pro, quick start guide, plugin options', 'advanced-iframe'); 173 173 echo '</h2>'; 174 aiPostboxOpen("id-options-pro", "Upgrading to Advanced iFrame Pro", $closedArray); 175 _e('<p>Advanced iframe is <strong>free for personal use</strong> and the Pro version a bargain for your business. The personal version does already contain many of the cool features of the Pro version. It has a limit of 10.000 views a month without a notice text which should normally not been hit by a personal website.</p>', 'advanced-iframe' ); 176 177 echo '<div id="first" class="signup_account_container signup_account_container_active" style="cursor: default;" title="'; 174 aiPostboxOpen("id-options-pro", "Upgrading to Advanced iFrame Pro", $closedArray); 175 if ($isFreemiusMigration) { 176 _e('<p>Advanced iframe is <strong>free for personal use</strong> and the Pro version a bargain for your business. The personal version does already contain many of the cool features of the Pro version. It has a limit of 10.000 views a month without a notice text which should normally not been hit by a personal website.</p>', 'advanced-iframe' ); 177 } else { 178 _e('<p>Advanced iframe is <strong>free for personal use</strong> and the Pro version a bargain for your business. The personal version does already contain many of the cool features of the Pro version. It has after opt-in unlimited views and after 10.000 views/month a small "powered by" notice which should normally not been hit by a personal website.</p>', 'advanced-iframe' ); 179 } 180 181 $isRegistered = $ai_fs->is_registered() && $ai_fs->is_tracking_allowed(); 182 $freemius_css = ($isFreemiusMigration) ? " signup_account_container_freemius" : ""; 183 $freemius_inner_css = ($isFreemiusMigration) ? " signup_inner_freemius" : ""; 184 185 echo '<div id="first" class="signup_account_container signup_account_container_active'.$freemius_css.'" style="cursor: default;" title="'; 178 186 _e('Free - For personal and non-commercial sites', 'advanced-iframe'); 179 187 echo '"> 180 <div class="signup_inner ">188 <div class="signup_inner'.$freemius_inner_css.'"> 181 189 <div class="signup_inner_plan">'; 182 190 _e(' ', 'advanced-iframe'); … … 191 199 echo '</div> 192 200 <div class="signup_inner_desc">'; 193 _e('10.000 views/month without notice*', 'advanced-iframe'); 194 echo '</div> 195 <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal%40mdempfle%2ede&item_name=advanced%20iframe&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0¤cy_code=EUR&lc=EN&bn=PP%2dDonationsBF&charset=UTF%2d8" target="_blank" id="plan_button_pro" class="signup_inner_button">'; 196 _e('Donate with Paypal', 'advanced-iframe'); 197 echo '</a> 198 </div> 201 if ($isFreemiusMigration) { 202 _e('No OPT-IN: 5000 views/month<br>OPT-IN: Unlimited views*', 'advanced-iframe'); 203 } else { 204 _e('10.000 views/month without notice*', 'advanced-iframe'); 205 } 206 echo '</div>'; 207 208 if ($isFreemiusMigration) { 209 if ($isRegistered) { 210 echo '<a href="#" id="opt-in-button" class="signup_inner_button opt_in_done" title="">'; 211 _e('Opt-In done<br><strong>unlimited</strong> views*', 'advanced-iframe'); 212 echo '</a>'; 213 } else { 214 $optinUrl = $ai_fs->get_reconnect_url(); 215 echo '<a href="'.$optinUrl.'" id="opt-in-button" class="signup_inner_button" title="">'; 216 _e('Opt-In for <br><strong>Unlimited</strong> views', 'advanced-iframe'); 217 echo '</a>'; 218 } 219 echo '<br>'; 220 } 221 echo '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=paypal%40mdempfle%2ede&item_name=advanced%20iframe&item_number=Support%20Open%20Source&no_shipping=0&no_note=1&tax=0¤cy_code=EUR&lc=EN&bn=PP%2dDonationsBF&charset=UTF%2d8" target="_blank" id="plan_button_pro" class="signup_inner_button" title="">'; 222 _e('Donate with Paypal', 'advanced-iframe'); 223 224 echo '</a>'; 225 echo '</div> 199 226 </div> 200 227 '; 201 228 echo ' 202 <div class="signup_account_container signup_account_container_active " style="cursor: default;" title="';229 <div class="signup_account_container signup_account_container_active'.$freemius_css.'" style="cursor: default;" title="'; 203 230 _e('Pro - For commercial, business and professional sites', 'advanced-iframe'); 204 231 echo '"> 205 <div class="signup_inner ">232 <div class="signup_inner'.$freemius_inner_css.'"> 206 233 <div class="signup_inner_plan">'; 207 234 _e(' ', 'advanced-iframe'); … … 215 242 <div class="signup_inner_desc">'; 216 243 _e('+ <a href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/advanced-iframe-comparison-chart" target="_blank">Many additional features!</a><br /> ', 'advanced-iframe'); 217 echo '</div> 218 <a href="https://1.envato.market/OdoBZ" target="_blank" id="plan_button_pro" class="signup_inner_button">'; 244 echo '</div>'; 245 if ($isFreemiusMigration) { 246 $trialUrl = $ai_fs->get_trial_url(); 247 $pricingUrl = $ai_fs->get_upgrade_url(); 248 echo '<a href="' . $trialUrl . '&trial=true" id="plan_button_pro" class="signup_inner_button" title="">'; 249 _e('Start 30 days trial', 'advanced-iframe'); 250 echo '</a><br>'; 251 echo '<a href="' . $pricingUrl . '" target="_blank" id="plan_button_pro" class="signup_inner_button" title="">'; 252 _e('Upgrade to <br><strong>PRO</strong>', 'advanced-iframe'); 253 } else { 254 echo '<a href="https://1.envato.market/OdoBZ" target="_blank" id="plan_button_pro" class="signup_inner_button">'; 219 255 _e('Get pro at Codecanyon', 'advanced-iframe'); 256 } 220 257 echo '</a> 221 258 </div> … … 223 260 '; 224 261 echo ' 225 <div id="last" class="signup_account_container signup_account_container_active " style="cursor: default;">226 <div class="signup_inner ">262 <div id="last" class="signup_account_container signup_account_container_active'.$freemius_css.'" style="cursor: default;"> 263 <div class="signup_inner'.$freemius_inner_css.'"> 227 264 <div class="signup_inner_plan">'; 228 265 _e('Pro Version Benefits', 'advanced-iframe'); … … 232 269 <ul class="pro"><li>'; 233 270 _e('<a href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/show-only-a-part-of-the-iframe" target="_blank">Show/Hide specific areas of the iframe</a> if the iframe is on a different domain<br /><a target="_blank" href="//www.mdempfle.de/examples/configurator/advanced-iframe-area-selector.html">Show the graphical selector</a></li><li><a href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/widgets" target="_blank">Widget support</a>, <a href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/change-links-targets" target="_blank">change link targets</a></li><li>External workaround supports <a href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/external-workaround-auto-height-and-css-modifications" target="_blank">iframe modifications</a> and <a href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/responsive-iframes" target="_blank">responsive iframes</a></li><li><a href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/browser-detection" target="_blank">Browser dependant settings</a>, <a href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/lazy-loading" target="_blank">lazy load</a></li><li>No view limit, <a href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/zoom-iframe-content" target="_blank">zoom</a>, <a target="_blank" href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-standalone">standalone version!</a></li><li><a target="_blank" href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo">See the pro demo</a><li><a target="_blank" href="//www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-comparison-chart">Compare versions for all features</a>', 'advanced-iframe'); 234 echo '</li></ul> 271 echo '</li></ul>'; 272 if ($isFreemiusMigration) { 273 echo '<ul class="pro"><li>'; 274 _e('Multi site licenses', 'advanced-iframe'); 275 echo '</li><li>'; 276 _e('Monthly, yearly, live time licenses', 'advanced-iframe'); 277 echo '</li></ul>'; 278 } 279 echo ' 235 280 </div> 236 281 </div> … … 239 284 <div class="clear"></div><br /> 240 285 '; 241 286 if ($isFreemiusMigration) { 287 _e('<p>* After 10.000 views/month the iframe is still working and below all iframes a small "powered by" notice with a link to the pro version is shown. If you hit this limit and you qualify for the free license please contact <a href="//www.tinywebgallery.com/en/about.php" target="_blank">me</a> to get a version with a higher limit.</p>', 'advanced-iframe'); 288 } else { 242 289 _e('<p>* After 10.000 views/month the iframe is still working but below all iframes a small "powered by" notice with a link to the pro version is shown. If you hit this limit and you qualify for the free license please contact <a href="//www.tinywebgallery.com/en/about.php" target="_blank">me</a> to get a version with a higher limit.<br/>If you use the Advanced iFrame on a non personal website please first test the plugin carefully before buying. After that it is quick and painless to get Advanced iFrame Pro. Simply get <strong><a target="_blank" href="https://1.envato.market/OdoBZ">Advanced iFrame Pro on CodeCanyon</a></strong> and be pro in a few minutes!</p>', 'advanced-iframe'); 290 } 243 291 244 292 _e('<p><strong>Current status</strong>: ', 'advanced-iframe'); 245 echo get_option('default_a_options') / 100 . ' % of views for this month used.'; 293 if ($isFreemiusMigration) { 294 295 $viewsPercent = get_option('default_a_options') / 100; 296 $status .= $viewsPercent . ' % of views for this month used.'; 297 298 if ($viewsPercent > 100) { 299 $status .= __('<strong style="color: red"> The view li'.'mit is reached. A sm'.'all notice is shown be'.'low all iframes. Please reg'.'ister above.</strong>', 'advanced-iframe'); 300 } 301 302 if ($isRegistered) { 303 $viewsPercent = get_option('default_a_options') / 100; 304 echo $viewsPercent . ' % of views for this month used until a small notice is shown.'; 305 if ($viewsPercent > 100) { 306 _('<strong style="color: red"> 10.000 views are reached. A sm'.'all notice is shown be'.'low all iframes. Please reg'.'ister above.</strong>', 'advanced-iframe'); 307 } 308 } else { 309 $viewsPercent = get_option('default_a_options') / 50; 310 echo $viewsPercent . ' % of views for this month used. Please OPT-IN to get unlimited views*'; 311 if ($viewsPercent > 100) { 312 _('<strong style="color: red"> 5.000 views are reached. Your iframes are NOT shown anymore. Please OPT-IN to get unlimited views*</strong>', 'advanced-iframe'); 313 } 314 } 315 } else { 316 echo get_option('default_a_options') / 100 . ' % of views for this month used.'; 317 } 246 318 _e('</p>', 'advanced-iframe'); 247 319 aiPostboxClose(); -
advanced-iframe/trunk/includes/advanced-iframe-main-after-iframe.php
r3027702 r3042304 28 28 if ($add_iframe_url_as_param === 'remote') { 29 29 $html .= 'function aiChangeUrl(loc) {'; 30 $html .= ' aiChangeUrlParam(loc,"'.$map_parameter_to_url.'","'.$src_orig.'","'.$ this->filterXss($add_iframe_url_as_param_prefix).'",'.$add_iframe_url_as_param_direct.');';30 $html .= ' aiChangeUrlParam(loc,"'.$map_parameter_to_url.'","'.$src_orig.'","'.$add_iframe_url_as_param_prefix.'",'.$add_iframe_url_as_param_direct.');'; 31 31 $html .= '}'; 32 32 } … … 35 35 $html .= 'if (window.aiUseCookie) { aiUseCookie(); }'; 36 36 } 37 38 37 39 38 if ($show_part_of_iframe === 'true' && (!empty ($show_part_of_iframe_new_window) || … … 256 255 $html .= $this->interceptAjaxResize($id, $onload_resize_width, $resize_on_ajax, $resize_on_ajax_jquery, 257 256 $resize_on_click, $resize_on_click_elements, $resize_min_height); 258 if ($default_options > 100*100) { 259 $html .= __('<p style="display:block !important; visibility:visible !important"><small style="display:block !important;visibility:visible !important">pow'.'ered by Advanced iFrame. Get the <a target="_blank" href="https://1.envato.market/Kd23v">Pro version on CodeCanyon</a>.</small></p>', 'advanced-iframe'); 257 258 if ($isFreemiusMigration) { 259 $isRegistered = $ai_fs->is_registered() && $ai_fs->is_tracking_allowed(); 260 if ($isRegistered && $default_options > 100*100 ) { 261 $html .= __('<p style="display:block !important; visibility:visible !important"><small style="display:block !important;visibility:visible !important">pow'.'ered by Advanced iFrame.</small></p>', 'advanced-iframe'); 262 } else if ($default_options > 50*50*2) { 263 $html .= '<style>'.$id.' { display: none !important; }</style>'; 264 $html .= __('<p style="display:block !important; visibility:visible !important"><small style="display:block !important;visibility:visible !important">The maximum number of views is reached. Please contact the web master to enable unlimited views.</small></p>', 'advanced-iframe'); 265 } 266 } else { 267 if ($default_options > 100*100) { 268 $html .= __('<p style="display:block !important; visibility:visible !important"><small style="display:block !important;visibility:visible !important">pow'.'ered by Advanced iFrame. Get the <a target="_blank" href="https://1.envato.market/Kd23v">Pro version on CodeCanyon</a>.</small></p>', 'advanced-iframe'); 269 } 260 270 } 261 271 if ($loginPreview) { -
advanced-iframe/trunk/includes/advanced-iframe-main-helper.php
r3027702 r3042304 476 476 static function aiDelecteAiContentPages() { 477 477 $pages = get_pages( array( 'post_type' => 'ai_content_page', 'post_status' => get_post_stati())); 478 foreach( $pages as $page ) { 479 wp_delete_post( $page->ID, true); 480 } 478 if ($pages != false) { 479 foreach( $pages as $page ) { 480 wp_delete_post( $page->ID, true); 481 } 482 } 481 483 } 482 484 -
advanced-iframe/trunk/includes/advanced-iframe-main-iframe.php
r3027702 r3042304 526 526 } 527 527 // hide_page_until_loaded 528 if ($hide_page_until_loaded === 'true' ) {528 if ($hide_page_until_loaded === 'true' && $show_iframe_as_layer === 'false') { 529 529 $onload_str .= 'jQuery("#'.$id.'").css("visibility", "visible");'; 530 530 if (!empty($hide_part_of_iframe)) { -
advanced-iframe/trunk/includes/advanced-iframe-main-prepare.php
r3027702 r3042304 575 575 576 576 $aiReady = ''; 577 $hide_page_sum = ($hide_page_until_loaded === 'true' || $hide_page_until_loaded_external === 'true')? 'true':'false'; 577 578 578 // Change parent links target 579 580 579 if (!empty($change_parent_links_target) && $show_iframe_as_layer !== 'external') { 581 580 $fulljQueryStringArray = array(); … … 614 613 $show_iframe_as_layer_autoclick_hide_time = preg_replace('/[^0-9]/', '', $show_iframe_as_layer_autoclick_hide_time); 615 614 616 $aiLayerMethod = 'var reload=aiCheckReload(this, "' . $id . '"); aiShowLayerIframe(event,"' . $id . '","'.plugins_url() . $aiPath.'/img/","'.$ hide_page_sum.'","'.$show_iframe_loader_layer.'", '.$show_iframe_as_layer_keep_content.', reload);';615 $aiLayerMethod = 'var reload=aiCheckReload(this, "' . $id . '"); aiShowLayerIframe(event,"' . $id . '","'.plugins_url() . $aiPath.'/img/","'.$show_iframe_loader_layer.'", '.$show_iframe_as_layer_keep_content.', reload);'; 617 616 $aiReady .= 'jQuery("'. trim($el) .'").off( "click"); jQuery("'. trim($el) .'").on( "click", function(event) { '.$aiLayerMethod.' });'; 618 617 if (!empty($autoElement)) { // auto click - click on the link! … … 631 630 if (this.host !== location.host) { 632 631 jQuery(this).attr("target", "'.$id.'"); 633 jQuery(this).on("click", function(event) { var reload=aiCheckReload(this, "' . $id . '"); aiShowLayerIframe(event,"' . $id . '","'.plugins_url() . $aiPath.'/img/","'.$ hide_page_sum.'","'.$show_iframe_loader_layer.'", '.$show_iframe_as_layer_keep_content.', reload); });632 jQuery(this).on("click", function(event) { var reload=aiCheckReload(this, "' . $id . '"); aiShowLayerIframe(event,"' . $id . '","'.plugins_url() . $aiPath.'/img/","'.$show_iframe_loader_layer.'", '.$show_iframe_as_layer_keep_content.', reload); }); 634 633 } 635 634 });'; -
advanced-iframe/trunk/includes/advanced-iframe-main-read-config.php
r3027702 r3042304 41 41 $search = array("“","”","‘","’",'"'); 42 42 foreach($atts as $key => $value) { 43 $fix_value = str_replace($search, '', $value); 44 $atts[$key] = trim($fix_value, " \n\r\t\v\0,"); 43 if (is_string($value)) { 44 $fix_value = str_replace($search, '', $value); 45 $atts[$key] = trim($fix_value, " \n\r\t\v\0,"); 46 } else { 47 // invalid values not supported by ai are removed. 48 $atts[$key] = ''; 49 } 45 50 } 46 51 … … 604 609 } 605 610 606 $layer_div_base .= ';background-color:#fff; display:none;position:fixed;z-index:100003;margin:0px !important;padding:0px !important;';611 $layer_div_base .= ';background-color:#fff;visibility:hidden;position:fixed;z-index:100003;margin:0px !important;padding:0px !important;'; 607 612 if ($ios_scroll) { 608 613 $width='100%'; … … 623 628 $adHeight = esc_html($this->addPx($show_iframe_as_layer_header_height)); 624 629 $width='100%'; 625 $style .= "; display:none;margin:0px !important;padding:0px !important;height:calc(100% - ". $adHeight .")";630 $style .= ";visibility:hidden;margin:0px !important;padding:0px !important;height:calc(100% - ". $adHeight .")"; 626 631 } else { 627 632 $width=$layer_width; -
advanced-iframe/trunk/js/ai.js
r3027702 r3042304 1 1 /** 2 * Advanced iframe pro functions v2024. 02 * Advanced iframe pro functions v2024.2 3 3 */ 4 4 /* jslint devel: true, unused: false */ … … 1526 1526 } 1527 1527 1528 function aiShowLayerIframe(event, id, path, hideUntilLoaded,showLoadingIcon, keep, reload) {1528 function aiShowLayerIframe(event, id, path, showLoadingIcon, keep, reload) { 1529 1529 aiDebugExtended("aiShowLayerIframe"); 1530 1530 keep = (keep === undefined) ? false : keep; … … 1533 1533 var layerId = '#' + id; 1534 1534 jQuery('#ai-zoom-div-' + id).show(); 1535 if (reload && hideUntilLoaded === 'true') { 1536 jQuery(layerId).css('visibility', 'hidden'); 1537 } 1535 jQuery('#ai-zoom-div-' + id).css('visibility', 'visible'); 1538 1536 jQuery(layerId).show(); 1537 jQuery(layerId).css('visibility', 'visible'); 1538 1539 1539 if ( jQuery( '#ai-layer-div-' + id ).length ) { 1540 1540 layerId = '#ai-layer-div-' + id; 1541 1541 jQuery(layerId).show(); 1542 jQuery(layerId).css('visibility', 'visible'); 1542 1543 } 1543 1544 … … 1567 1568 function aiHideLayerIframe(id, keep) { 1568 1569 aiDebugExtended("aiHideLayerIframe"); 1569 jQuery('#' + id). hide();1570 jQuery('#' + id).css('visibility', 'hidden'); 1570 1571 if (!keep) { 1571 1572 jQuery('#' + id).attr('src', 'about:blank'); 1572 1573 aiLayerIframeHrefs[id] = 'about:blank'; 1573 1574 } 1574 jQuery('#ai-zoom-div-' + id). hide();1575 jQuery('#ai-layer-div-' + id). hide();1575 jQuery('#ai-zoom-div-' + id).css('visibility', 'hidden'); 1576 jQuery('#ai-layer-div-' + id).css('visibility', 'hidden'); 1576 1577 jQuery('#ai_backlink').remove(); 1577 1578 jQuery('#ai_backlayer').remove(); -
advanced-iframe/trunk/js/ai.min.js
r3027702 r3042304 1 /** Advanced iframe pro functions v2024. 0. Created: 2023-11-24 22:28:32*/2 var aiInstance,aiEnableCookie="undefined"!=typeof x&&aiEnableCookie,aiId="",aiExtraSpace=void 0===aiExtraSpace?0:aiExtraSpace,aiAccTime=0,aiRealFullscreen=void 0!==aiRealFullscreen&&aiRealFullscreen,aiInFullscreen=!1,aiOnloadEventsCounter=0,aiOverflowHtml=jQuery("html").css("overflow")??"visible",aiOverflowBody=jQuery("body").css("overflow")??"visible",aiCallbackExists=void 0!==aiReadyCallbacks&&aiReadyCallbacks instanceof Array,aiReadyCallbacks=aiCallbackExists?aiReadyCallbacks:[];function aiDebugExtended(a){"undefined"!=typeof aiShowDebug&&aiShowDebug&&console&&console.log&&console.log("Advanced iframe: "+a)}function aiResizeIframe(a,i,t){aiDebugExtended("aiResizeIframe");try{if("about:blank"===a.contentWindow.location.href)return;if(null!=a.contentWindow.document.body){var o=jQuery(window).scrollTop();a.style.marginTop=0,a.style.marginBottom=0,a.height=Number(t),a.style.height=Number(t)+"px";var r=aiGetIframeHeight(a);if(aiDebugExtended("aiResizeIframe - newheight: "+r),a.height=r,a.style.height=r+"px",0!==jQuery("#ai-zoom-div-"+a.id).length){var n=window["zoom_"+a.id];jQuery("#ai-zoom-div-"+a.id).css("height",r*n)}aiEnableCookie&&0===aiExtraSpace&&aiWriteCookie(r);var l=aiGetIframeHash(a.contentWindow.location.href);if(-1!==l){var s="#"+a.id;try{var d=jQuery(s).contents().find("#"+l);if(0!==d.length){var c=d.offset().top;o=Math.round(jQuery(s).offset().top+c)}}catch(h){}}if(setTimeout(function(){jQuery("html,body").scrollTop(o)},50),"true"===i){var f=aiGetIframeWidth(a);a.width=f,a.style.width=f+"px"}(0,window["resizeCallback"+a.id])(),null!=window.frameElement&&parent.jQuery("iframe").trigger("onload"),aiHandleAnchorLinkScrolling(a.id)}else setTimeout(function(){aiResizeIframe(a,i)},100)}catch(u){console&&console.error&&(console.error("Advanced iframe configuration error: You have enabled the resize of the iframe for pages on the same domain. But you use an iframe page on a different domain. You need to use the external workaround like described in the settings. Also check the next log. There the browser message for this error is displayed."),console.log(u))}}function aiHandleAnchorLinkScrolling(a){var i=jQuery("#"+a).offset().top;jQuery("#"+a).contents().find("body").on("click","a[href^='#']",function(t){var o=jQuery(this).attr("href"),r=jQuery("#"+a).contents().find(o);if(0!=r.length){var n=r.offset().top;jQuery("html,body").scrollTop(Math.round(i+n+2))}})}function aiGetIframeHash(a){var i;return a.split("#")[1]||"-1"}function aiGetIframeHeight(a){var i;return Math.max(a.contentWindow.document.body.scrollHeight,a.contentWindow.document.body.offsetHeight,a.contentWindow.document.documentElement.scrollHeight,a.contentWindow.document.documentElement.offsetHeight)+aiExtraSpace}function aiGetIframeWidth(a){var i=a.width;a.width=1,a.style.width="1px";var t=Math.max(a.contentWindow.document.body.scrollWidth,a.contentWindow.document.body.offsetWidth,a.contentWindow.document.documentElement.scrollWidth,a.contentWindow.document.documentElement.offsetWidth);return 1!==t?(a.width=t,a.style.width=t+"px"):(a.width=i,a.style.width=i+"px"),t}function aiGetParentIframeWidth(a){return null!=a&&0!==jQuery("#"+a.id).length?jQuery("#"+a.id).width():-1}function aiResizeIframeHeightById(a,i){aiDebugExtended("aiResizeIframeHeightById - id: "+a+", nHeight: "+i);try{(0,window["resizeCallback"+a])();var t=parseInt(i,10)+aiExtraSpace,o=document.getElementById(a);if(null===o&&console&&console.error){console.error("Advanced iframe configuration error: The iframe to resize could not be found. The id of the iframe and the one defined for ai_external.js ("+a+") are most likely different! Check your settings."),console.log(e);return}var r=jQuery(document).scrollTop();o.height=t,o.style.height=t+"px",jQuery("html,body").scrollTop(r),aiEnableCookie&&0===aiExtraSpace&&aiWriteCookie(t);var n=window["aiExecuteWorkaround_"+a];null!=n&&n()}catch(l){console&&console.error&&(console.error("Advanced iframe configuration error: The id of the parent and the external workaround are different! Check your settings."),console.log(l))}}function aiScrollToTop(a,i){if(aiDebugExtended("aiScrollToTop - id: "+a+", position: "+i),aiOnloadEventsCounter>0){var t=0;"iframe"===i&&(t=jQuery("#"+a).offset().top),setTimeout(function(){aiDebugExtended("aiScrollToTop - posTop: "+t),window.scrollTo(0,t)},100)}setTimeout(function(){aiOnloadEventsCounter++},1e3)}function aiWriteCookie(a){var i="ai-last-height";""!==aiId&&(i=i+"-"+aiId);var t=i+"="+a;document.cookie=t}function aiUseCookie(){var a="ai-last-height";""!==aiId&&(a=a+"-"+aiId);for(var i=document.cookie.split(";"),t=0;t<i.length;t++){var o=i[t].split("=")[0],r=i[t].split("=")[1];if(o===a&&null!==r&&aiIsNumeric(r)){var n=document.getElementById(aiId);n.height=parseInt(r,10),n.style.height=r+"px"}}}function aiIsNumeric(a){return!isNaN(a)}function aiDisableHeight(){jQuery("#additional_height").attr("readonly","readonly"),jQuery("#additional_height").val("0")}function aiEnableHeight(){jQuery("#additional_height").removeAttr("readonly")}function aiShowElementOnly(a,i){aiDebugExtended("aiShowElementOnly");try{var t=jQuery(a).contents().find("body"),o=t.find(i).clone(!0,!0);t.find("*").not(jQuery("script")).remove(),t.prepend(o)}catch(r){console&&console.error&&(console.error("Advanced iframe configuration error: You have enabled to show only one element of the iframe for pages on the same domain. But you use an iframe page on a different domain. You need to use the pro version of the external workaround like described in the settings. Also check the next log. There the browser message for this error is displayed."),console.log(r))}}function aiCheckIfValidTarget(a,i){a||(a=window.event),a.target?t=a.target:a.srcElement&&(t=a.srcElement),3===t.nodeType&&(t=t.parentNode);for(var t,o=i.split(","),r=0;r<o.length;++r){var n=o[r].split(":");if(n[0].toLowerCase()===t.nodeName.toLowerCase()&&(!(n.length>1)||-1!==t.id.toLowerCase().indexOf(n[1].toLowerCase())))return!0}return!1}function aiOpenSelectorWindow(a){aiDebugExtended("aiOpenSelectorWindow");var i=jQuery("#width").val(),t=jQuery("#ai-height-0").val();(i.indexOf("%")>=0||900>Number(i))&&(i=900),(i=Number(i)+40)>screen.width&&(i=screen.width),(t=t.indexOf("%")>=0?screen.height:Number(t)+480)>screen.height-50&&(t=screen.height-50);var o="width="+i+",height="+t+",left=0,top=0,resizable=1,scrollbars=1";window.open(a,"",o).focus()}function aiDisableAiResizeOptions(a){jQuery("#onload_resize_delay").prop("readonly",a),jQuery("input[id=store_height_in_cookie1]:radio, input[id=store_height_in_cookie2]:radio").attr("disabled",a),jQuery("#additional_height").prop("readonly",a),jQuery("input[id=onload_resize_width1]:radio, input[id=onload_resize_width2]:radio").attr("disabled",a),jQuery("#resize_on_click").prop("readonly",a),jQuery("#resize_on_click_elements").prop("readonly",a),jQuery("#resize_on_ajax").prop("readonly",a),jQuery("input[id=resize_on_ajax_jquery1]:radio, input[id=resize_on_ajax_jquery2]:radio").attr("disabled",a);var i="#onload_resize_delay, #store_height_in_cookie1, #additional_height, #onload_resize_width1, ";aiDisableTextSection(a,i+="#resize_on_click, #resize_on_click_elements, #resize_on_ajax, #resize_on_ajax_jquery1")}function aiDisablePartOfIframeOptions(a){jQuery("#show_part_of_iframe_x").prop("readonly",a),jQuery("#show_part_of_iframe_y").prop("readonly",a),jQuery("#show_part_of_iframe_height").prop("readonly",a),jQuery("#show_part_of_iframe_width").prop("readonly",a),jQuery("input[id=show_part_of_iframe_allow_scrollbar_horizontal1]:radio, input[id=show_part_of_iframe_allow_scrollbar_horizontal2]:radio").attr("disabled",a),jQuery("input[id=show_part_of_iframe_allow_scrollbar_vertical1]:radio, input[id=show_part_of_iframe_allow_scrollbar_vertical2]:radio").attr("disabled",a),jQuery("#show_part_of_iframe_next_viewports").prop("readonly",a),jQuery("input[id=show_part_of_iframe_next_viewports_loop1]:radio, input[id=show_part_of_iframe_next_viewports_loop2]:radio").attr("disabled",a),jQuery("#show_part_of_iframe_new_window").prop("readonly",a),jQuery("#show_part_of_iframe_new_url").prop("readonly",a),jQuery("input[id=show_part_of_iframe_next_viewports_hide1]:radio, input[id=show_part_of_iframe_next_viewports_hide2]:radio").attr("disabled",a),jQuery("#show_part_of_iframe_style").prop("readonly",a),jQuery("input[id=show_part_of_iframe_zoom1]:radio, input[id=show_part_of_iframe_zoom2]:radio, input[id=show_part_of_iframe_zoom3]:radio").attr("disabled",a),jQuery(".media-query-input").prop("readonly",a);var i="#show_part_of_iframe_x, #show_part_of_iframe_y, #show_part_of_iframe_height, #show_part_of_iframe_width, ";i+="#show_part_of_iframe_allow_scrollbar_horizontal1, #show_part_of_iframe_next_viewports, #show_part_of_iframe_next_viewports_loop1, ",i+="#show_part_of_iframe_new_window, #show_part_of_iframe_new_url, #show_part_of_iframe_next_viewports_hide1, #show_part_of_iframe_style, ",aiDisableTextSection(a,i+="#show_part_of_iframe_zoom1, #show_part_of_iframe_allow_scrollbar_vertical1, #add-media-query-show_part_of_iframe_media_query"),a?(jQuery("#add-media-query-show_part_of_iframe_media_query").hide(),jQuery(".ai-delete").hide()):(jQuery("#add-media-query-show_part_of_iframe_media_query").show(),jQuery(".ai-delete").show())}function aiDisableLazyLoadOptions(a){jQuery("#enable_lazy_load_threshold").prop("readonly",a),jQuery("#enable_lazy_load_fadetime").prop("readonly",a),jQuery("input[id=enable_lazy_load_reserve_space1]:radio, input[id=enable_lazy_load_reserve_space2]:radio").attr("disabled",a),jQuery("input[id=enable_lazy_load_manual1]:radio, input[id=enable_lazy_load_manual2]:radio, input[id=enable_lazy_load_manual3]:radio").attr("disabled",a),aiDisableTextSection(a,"#enable_lazy_load_threshold, #enable_lazy_load_fadetime, #enable_lazy_load_reserve_space1, #enable_lazy_load_manual1")}function aiDisableIframeAsLayerOptions(a){jQuery("input[id=show_iframe_as_layer_full]:radio").attr("disabled",a),jQuery("#show_iframe_as_layer_header_file").prop("readonly",a),jQuery("#show_iframe_as_layer_header_height").prop("readonly",a),jQuery("#show_iframe_as_layer_autoclick_delay").prop("readonly",a),jQuery("#show_iframe_as_layer_autoclick_hide_time").prop("readonly",a),jQuery("input[id=show_iframe_as_layer_header_position1]:radio, input[id=show_iframe_as_layer_header_position2]:radio").attr("disabled",a),jQuery("input[id=show_iframe_as_layer_full1]:radio, input[id=show_iframe_as_layer_full2]:radio, input[id=show_iframe_as_layer_full3]:radio").attr("disabled",a),jQuery("input[id=show_iframe_as_layer_keep_content1]:radio, input[id=show_iframe_as_layer_keep_content2]:radio").attr("disabled",a);var i="#show_iframe_as_layer_full, #show_iframe_as_layer_header_file, #show_iframe_as_layer_header_height, ";i+="#show_iframe_as_layer_header_position1, #show_iframe_as_layer_full1, #show_iframe_as_layer_keep_content1, ",aiDisableTextSection(a,i+="#show_iframe_as_layer_autoclick_delay, #show_iframe_as_layer_autoclick_hide_time")}function aiDisableAddParamOptions(a){jQuery("input[id=add_iframe_url_as_param_direct1]:radio, input[id=add_iframe_url_as_param_direct2]:radio").attr("disabled",a),jQuery("#add_iframe_url_as_param_prefix").prop("readonly",a),aiDisableTextSection(a,"#add_iframe_url_as_param_prefix, #add_iframe_url_as_param_direct1")}function aiDisableTextSection(a,i){a?jQuery(i).closest("tr").addClass("disabled"):jQuery(i).closest("tr").removeClass("disabled")}function aiInitAdminConfiguration(a,i){"false"===jQuery("input[type=radio][name=onload_resize]:checked").val()&&aiDisableAiResizeOptions(!0),jQuery("input[type=radio][name=onload_resize]").click(function(){"true"===jQuery(this).val()?(jQuery("input:radio[name=enable_external_height_workaround]")[1].checked=!0,aiDisableAiResizeOptions(!1)):(jQuery("#onload_resize_delay").val(""),aiDisableAiResizeOptions(!0))}),jQuery("input[type=radio][name=enable_external_height_workaround]").click(function(){"true"===jQuery(this).val()&&(jQuery("input:radio[name=onload_resize]")[1].checked=!0,jQuery("#onload_resize_delay").val(""),aiDisableAiResizeOptions(!0))}),"false"===jQuery("input[type=radio][name=show_part_of_iframe]:checked").val()&&aiDisablePartOfIframeOptions(!0),jQuery("input[type=radio][name=show_part_of_iframe]").click(function(){"false"===jQuery(this).val()?aiDisablePartOfIframeOptions(!0):aiDisablePartOfIframeOptions(!1)}),"false"===jQuery("input[type=radio][name=show_iframe_as_layer]:checked").val()&&aiDisableIframeAsLayerOptions(!0),jQuery("input[type=radio][name=show_iframe_as_layer]").click(function(){"false"===jQuery(this).val()?aiDisableIframeAsLayerOptions(!0):aiDisableIframeAsLayerOptions(!1)}),"true"===jQuery("input[type=radio][name=expert_mode]:checked").val()&&(jQuery(".description").css("display","none"),jQuery("table.form-table th").css("cursor","pointer"),jQuery("table.form-table th").css("padding-top","8px").css("padding-bottom","2px"),jQuery("table.form-table td").css("padding-top","5px").css("padding-bottom","5px"),jQuery("table.form-table th").click(function(){jQuery(".description").css("display","none"),jQuery(".description",jQuery(this).parent()).css("display","block")})),jQuery("input[type=radio][name=expert_mode]").click(function(){"false"===jQuery(this).val()?(jQuery(".description").css("display","block"),jQuery("table.form-table th").css("cursor","auto"),jQuery("table.form-table th").off("click"),jQuery("table.form-table th").css("padding-top","20px").css("padding-bottom","20px"),jQuery("table.form-table td").css("padding-top","15px").css("padding-bottom","15px")):(jQuery(".description").css("display","none"),jQuery("table.form-table th").css("cursor","pointer"),jQuery("table.form-table th").css("padding-top","8px").css("padding-bottom","2px"),jQuery("table.form-table td").css("padding-top","5px").css("padding-bottom","5px"),jQuery("table.form-table th").click(function(){jQuery(".description").css("display","none"),jQuery(".description",jQuery(this).parent()).css("display","block")}))}),jQuery("#accordion").find("h1").click(function(){jQuery(this).next().slideToggle(aiAccTime)}).next().hide(),jQuery("#accordion").find("a").click(function(){var a="#h1-"+jQuery(this).prop("hash").substring(1);jQuery(a).next().show(),location.hash=a}),"false"===jQuery("input[type=radio][name=enable_lazy_load_manual]:checked").val()&&jQuery("#enable_lazy_load_manual_element").prop("readonly",!0),jQuery("input[type=radio][name=enable_lazy_load_manual]").click(function(){"false"===jQuery(this).val()||"auto"===jQuery(this).val()?jQuery("#enable_lazy_load_manual_element").prop("readonly",!0):jQuery("#enable_lazy_load_manual_element").prop("readonly",!1)}),"false"===jQuery("input[type=radio][name=add_iframe_url_as_param]:checked").val()&&aiDisableAddParamOptions(!0),jQuery("input[type=radio][name=add_iframe_url_as_param]").click(function(){aiDisableAddParamOptions("false"===jQuery(this).val())}),"false"===jQuery("input[type=radio][name=enable_lazy_load]:checked").val()&&(aiDisableLazyLoadOptions(!0),jQuery("#enable_lazy_load_manual_element").prop("readonly",!0)),jQuery("input[type=radio][name=enable_lazy_load]").click(function(){"false"===jQuery(this).val()?(aiDisableLazyLoadOptions(!0),jQuery("#enable_lazy_load_manual_element").prop("readonly",!0)):(aiDisableLazyLoadOptions(!1),"false"===jQuery("input[type=radio][name=enable_lazy_load_manual]:checked").val()||"auto"===jQuery("input[type=radio][name=enable_lazy_load_manual]:checked").val()?jQuery("#enable_lazy_load_manual_element").prop("readonly",!0):jQuery("#enable_lazy_load_manual_element").prop("readonly",!1))}),jQuery(".confirmation").on("click",function(){return confirm("Are you sure? Selecting OK will set all settings to the default.")}),jQuery(".confirmation-file").on("click",function(){return confirm("Do you really want to delete the file?")}),jQuery(".confirmation-hash").on("click",function(){return confirm("Do you really want to delete the hash/URL cache?")}),jQuery("a.post").click(function(a){a.stopPropagation(),a.preventDefault();var i,t=this.href.split("?"),o=t[0],r=t[1].split("&"),n="";o+="?"+r[0];for(var l=1,s=r.length;l<s;l++)n+='<input type="hidden" name="'+(i=r[l].split("="))[0]+'" value="'+i[1]+'" />';var d=jQuery("#twg-options").val();n+='<input type="hidden" name="twg-options" value="'+d+'" />',jQuery("body").append('<form action="'+o+'" method="post" id="poster">'+n+"</form>"),jQuery("#poster").submit()}),jQuery(".ai-input-search").keyup(function(a){var t=jQuery("input.ai-input-search").val().toLowerCase();aiSettingsSearch(t,i)}),jQuery(".ai-input-search").on("click",function(a){setTimeout(function(){var a=jQuery("input.ai-input-search").val().toLowerCase();aiSettingsSearch(a,i)},100)}),jQuery(document).on("click",".nav-tab-wrapper a",function(){var a=jQuery(this).attr("id");return jQuery("section").hide(),jQuery("section."+a).show(),jQuery("#current_tab").val(a.substr(4,1)),jQuery(".nav-tab").removeClass("nav-tab-active"),jQuery(this).addClass("nav-tab-active"),jQuery(this).blur(),!1}),jQuery(document).on("click","a#external-workaround-link",function(){return jQuery(".external-workaround").click(),location.hash="tab_3",aiShowHeader("tab_3"),!1}),jQuery(document).on("click","a#resize-same-link",function(){return jQuery(".advanced-settings-tab").click(),jQuery("#id-advanced-resize").removeClass("closed"),location.hash="id-advanced-resize",aiShowHeader("id-advanced-resize"),!1}),jQuery(document).on("click","a.jquery-help-link",function(){return jQuery(".help-tab").click(),jQuery("#id-help-jquery").removeClass("closed"),jQuery("#jquery-help").show(),location.hash="id-help-jquery",aiShowHeader("id-help-jquery"),!1}),jQuery(document).on("click","a#browser-detection-link",function(){return jQuery(".help-tab").click(),jQuery("#id-help-browser").removeClass("closed"),jQuery("#browser-help").show(),location.hash="id-help-browser",aiShowHeader("id-help-browser"),!1}),jQuery(document).on("click","a.howto-id-link",function(){return jQuery(".help-tab").click(),jQuery("#id-help-id").removeClass("closed"),location.hash="id-help-id",aiShowHeader("id-help-id"),!1}),jQuery(document).on("click",".modifycontent-link",function(){return jQuery(".advanced-settings-tab").click(),jQuery("#id-advanced-modify-iframe").removeClass("closed"),location.hash="id-advanced-modify-iframe",aiShowHeader("id-advanced-modify-iframe","tr-"+jQuery(this).data("detail")),!1}),jQuery(document).on("click",".id-modify-css-iframe-link",function(){return jQuery(".advanced-settings-tab").click(),jQuery("#id-advanced-modify-iframe").removeClass("closed"),location.hash="id-modify-css-iframe",aiShowHeader("id-advanced-modify-iframe","tr-"+jQuery(this).data("detail")),!1}),jQuery(document).on("click",".modify-target",function(){return jQuery(".advanced-settings-tab").click(),jQuery("#id-advanced-modify-iframe").removeClass("closed"),location.hash="id-modify-target",aiShowHeader("id-advanced-modify-iframe","tr-"+jQuery(this).data("detail")),!1}),jQuery(document).on("click","a.link-external-domain",function(){return jQuery("#id-external-different").removeClass("closed"),location.hash="#id-external-different",aiShowHeader("id-external-different"),!1}),jQuery(document).on("click","a.link-id-external-ai-config-post",function(){return jQuery("#id-external-ai-config-post").removeClass("closed"),location.hash="#id-external-ai-config-post",aiShowHeader("id-external-ai-config-post","tr-use_post_message"),!1}),jQuery(document).on("click","a.link-id-external-ai-overview",function(){return jQuery("#id-external-ai-overview").removeClass("closed"),location.hash="#id-external-ai-overview",aiShowHeader("id-external-ai-overview","id-external-ai-overview"),!1}),jQuery(document).on("click","a.post-message-help-link",function(){return jQuery(".help-tab").click(),jQuery("#id-help-communication").removeClass("closed"),location.hash="#id-help-communication",aiShowHeader("id-help-communication","id-help-communication"),!1}),jQuery(document).on("click","a.enable-admin",function(){return jQuery(".options-tab").click(),jQuery("#id-options-display").removeClass("closed"),location.hash="#id-options-display",aiShowHeader("id-options-display","tr-demo"),!1}),jQuery(document).on("click","a.enter-registration",function(){return jQuery(".options-tab").click(),jQuery("#id-options-registration").removeClass("closed"),location.hash="#id-options-registration",aiShowHeader("id-options-registration","tr-demo"),!1}),jQuery(document).on("click","a#user-help-link",function(){return jQuery("#user-help").css("display","block"),!1}),jQuery(document).on("click","a#user-meta-link",function(){return jQuery("#meta-help").css("display","block"),!1}),jQuery(document).on("click","#ai-selector-help-link",function(){return jQuery("#ai-selector-help").slideDown(1e3),!1}),jQuery(document).on("click",".ai-selector-help-link-move",function(){return jQuery("#ai-selector-help").show("slow"),location.hash="#ai-selector-help-link",aiShowHeader("ai-selector-help-link"),!1}),jQuery("#ai_form").submit(function(){aiSetScrollposition()}),jQuery(".if-js-closed").removeClass("if-js-closed").addClass("closed"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles("toplevel_page_advanced-iframe"),jQuery(".ai-spinner").css("display","none"),jQuery("#"+i).next().show(),jQuery(document).on("click","#test-pro-admin.is-permanent-closable button",function(){closeInfoPermanent("test-pro-admin")}),jQuery(document).on("click","#show-registration-message.is-permanent-closable button",function(){closeInfoPermanent("show-registration-message")}),jQuery(document).on("click","#show-version-message.is-permanent-closable button",function(){closeInfoPermanent("show-version-message")}),jQuery(document).on("click",".mq-breakpoint-height a",function(a){return jQuery(this).parent().remove(),aiUpdateHeightHiddenField("height"),a.preventDefault(),!1}),jQuery(document).on("click","a#add-media-query-height",function(a){var i=jQuery(".mq-breakpoint-height").length+1;return jQuery(this).parent().append('<div id="breakpoint-row-height-'+i+'" class="mq-breakpoint-height"><input type="text" id="ai-height-'+i+'" style="width:150px;margin-top:5px;" onblur="aiCheckHeightNumber(this, \'height\');" placeholder="Insert height"/> Breakpoint: <input type="text" id="ai-breakpoint-height-'+i+'" style="width:130px;" onblur="aiCheckHeightNumber(this, \'height\');" placeholder="Insert breakpoint"/><a id="delete-media-query-'+i+'" href="#" class="delete ai-delete">Delete</a>'),a.preventDefault(),!1}),jQuery(document).on("click",".mq-breakpoint-show_part_of_iframe_media_query a",function(a){return jQuery(this).parent().remove(),aiUpdateHeightHiddenFieldMediaQuery("show_part_of_iframe_media_query"),a.preventDefault(),!1}),jQuery(document).on("click","a#add-media-query-show_part_of_iframe_media_query",function(a){var i=jQuery(".mq-breakpoint-show_part_of_iframe_media_query").length+1;return jQuery(this).parent().append('<div id="breakpoint-row-show_part_of_iframe_media_query-'+i+'" class="mq-breakpoint-show_part_of_iframe_media_query">x: <input type="text" id="ai-x-show_part_of_iframe_media_query-'+i+'" class="media-query-input" onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="x"/> y: <input type="text" id="ai-y-show_part_of_iframe_media_query-'+i+'" class="media-query-input" onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="y"/> w: <input type="text" id="ai-w-show_part_of_iframe_media_query-'+i+'" class="media-query-input" onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="width"/> h: <input type="text" id="ai-h-show_part_of_iframe_media_query-'+i+'" class="media-query-input" onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="height"/> iframe width: <input type="text" id="ai-i-show_part_of_iframe_media_query-'+i+'" class="media-query-input" style="width:100px;" onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="iframe width"/> Breakpoint: <input type="text" id="ai-breakpoint-show_part_of_iframe_media_query-'+i+'" class="media-query-input" style="width:130px;" onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="Insert breakpoint"/><a id="delete-media-query-show_part_of_iframe_media_query-'+i+'" href="#" class="delete ai-delete">Delete</a>'),a.preventDefault(),!1})}function aiCheckHeightNumber(a,i){aiCheckInputNumber(a),aiUpdateHeightHiddenField(i)}function aiCheckHeightNumberMediaQuery(a,i){aiCheckInputNumber(a),aiUpdateHeightHiddenFieldMediaQuery(i)}function aiUpdateHeightHiddenField(a){var i=jQuery("#ai-"+a+"-0").val(),t=[];jQuery(".mq-breakpoint-"+a).each(function(a){var i=jQuery(this).children().eq(0).val(),o=jQuery(this).children().eq(1).val();""!==i&&""!==o&&t.push({heightChild:i,breakpointChild:o})}),t.sort(function(a,i){return i.breakpointChild-a.breakpointChild});let o=i;t.forEach(function(a){o+=","+a.heightChild+"|"+a.breakpointChild}),jQuery("#"+a).val(o);let r=jQuery("#description-"+a).html().split("Shortcode attribute: ")[0];jQuery("#description-"+a).html(r+"Shortcode attribute: "+a+'="'+o+'"')}function aiUpdateHeightHiddenFieldMediaQuery(a){var i=[];jQuery(".mq-breakpoint-"+a).each(function(a){var t=jQuery(this).children().eq(0).val(),o=jQuery(this).children().eq(1).val(),r=jQuery(this).children().eq(2).val(),n=jQuery(this).children().eq(3).val(),l=jQuery(this).children().eq(4).val(),s=jQuery(this).children().eq(5).val();(""!==t||""!==o||""!==r||""!==n||""!==l)&&""!==s&&i.push({mediaX:t,mediaY:o,mediaW:r,mediaH:n,mediaIW:l,breakpointChild:s})}),i.sort(function(a,i){return i.breakpointChild-a.breakpointChild});let t="";i.forEach(function(a){t+=","+a.mediaX+"|"+a.mediaY+"|"+a.mediaW+"|"+a.mediaH+"|"+a.mediaIW+"|"+a.breakpointChild}),t=t.replace(/(^,)|(,$)/g,""),jQuery("#"+a).val(t);let o=jQuery("#description-"+a).html().split("Shortcode attribute: ")[0];jQuery("#description-"+a).html(o+"Shortcode attribute: "+a+'="'+t+'"')}function aiSettingsSearch(a,i){var t=0;""!==a?(jQuery("#ai p").not(".form-table p").hide(),jQuery("#ai ul").not(".form-table ul").hide(),jQuery("#ai ol").not(".form-table ol").hide(),"false"!==i&&(jQuery("#ai h1").not(".show-always").hide(),jQuery("#ai #accordion").attr("id","acc"),jQuery("#ai #acc > div").show(),jQuery("#ai #spacer-div").show()),jQuery("#ai h2,#ai .icon_ai,#ai h3,#ai h4").not(".show-always").hide(),jQuery("#ai .form-table").addClass("ai-remove-margin"),jQuery("#ai hr, .signup_account_container, .config-file-block").hide(),jQuery("#ai .hide-always").hide(),jQuery("#ai .hide-search").hide(),jQuery("#ai .postbox-container").not(".show-always").hide(),jQuery("#ai .show-always p").show(),jQuery("#ai .show-always ul").show(),jQuery("#ai .show-always ol").show(),jQuery("#ai .show-always h2,#ai .show-always .icon_ai,#ai .show-always h3,#ai .show-always h4").show()):(jQuery("#ai p").not(".form-table p").show(),jQuery("#ai section .ai-anchor").show(),jQuery("#ai ul").not(".form-table ul").show(),jQuery("#ai ol").not(".form-table ol").show(),"false"!==i&&(jQuery("#ai h1").not(".show-always").show(),jQuery("#ai #acc").attr("id","accordion"),jQuery("#ai #accordion > div").hide(),jQuery("#ai #spacer-div").hide()),jQuery("#ai h2,#ai .icon_ai,#ai h3,#ai h4").not(".show-always").show(),jQuery("#ai .form-table").removeClass("ai-remove-margin"),jQuery("#ai hr, .signup_account_container, .config-file-block").show(),jQuery("#ai .sub-domain-container").show(),jQuery("#ai .hide-search").show(),jQuery("#ai .hide-always").hide(),jQuery("#ai .postbox-container").show(),setTimeout(function(){jQuery("#ai .postbox-container .closed .inside").css("display","")},5)),jQuery("#ai .mark-tab-header").removeClass("mark-tab-header");var o="";if(jQuery("#ai tr").each(function(){var i=jQuery(this),r=i.find("th").text(),n=i.find("p.description").text();if(r=void 0!==r?r.toLowerCase():"XXXXXXX",n=void 0!==n?n.toLowerCase():"XXXXXXX",-1===r.indexOf(a)&&-1===n.indexOf(a))0==i.parents(".show-always").length&&i.addClass("hide-setting");else{if(i.closest("table").prevAll("h2:first").show(),i.closest(".postbox-container").show(),i.closest(".postbox-container").find("h2, .inside").show(),i.closest("table").prevAll("#ai .icon_ai:first").show(),i.closest("table").nextAll("p.button-submit:first").show(),i.removeClass("hide-setting"),i.closest(".hide-search").show(),a.length>2){var l=i.closest("section").attr("class");void 0!==l&&(jQuery("#"+l).addClass("mark-tab-header"),""===o&&(o=l))}t++}}),0===t)jQuery("#ai-input-search-result").show(),jQuery("#ai .mark-tab-header").removeClass("mark-tab-header");else{if(jQuery("#ai-input-search-result").hide(),aiInstance&&aiInstance.revert(),""!==a&&a.length>2){var r=RegExp(a,"gi");aiInstance=findAndReplaceDOMText(document.getElementById("tab_wrapper"),{find:r,wrap:"em"})}jQuery("#"+o).click()}}function aiResizeIframeRatio(a,i){aiDebugExtended("aiResizeIframeRatio");var t,o=Math.ceil(jQuery("#"+a.id).width()*parseFloat(i.replace(",",".")));a.height=o,a.style.height=o+"px"}function aiGenerateShortcode(a){var i="[advanced_iframe ";""!==jQuery("#securitykey").val()&&(i+='securitykey="'+jQuery("#securitykey").val()+'" '),i+='use_shortcode_attributes_only="true" ';var t=jQuery("#include_html").val(),o=jQuery("#include_url").val(),r=jQuery("#document_domain_add").val();if(void 0===t||""===t&&""===o){var n=jQuery("#src").val();""===n?alert("Required url is missing."):i+='src="'+n+'" ',i+=aiGenerateTextShortcode("src_hide"),i+=aiGenerateTextShortcode("width"),i+=aiGenerateTextShortcode("height"),i+=aiGenerateRadioShortcode("scrolling","none"),i+=aiGenerateRadioShortcode("add_surrounding_p","false"),i+=aiGenerateRadioShortcode("enable_ios_mobile_scolling","false"),i+=aiGenerateTextShortcode("marginwidth"),i+=aiGenerateTextShortcode("marginheight"),i+=aiGenerateTextShortcode("frameborder"),i+=aiGenerateRadioShortcode("transparency","true"),i+=aiGenerateTextShortcode("class"),i+=aiGenerateTextShortcode("style"),i+=aiGenerateTextShortcodeWithDefault("id","advanced_iframe"),i+=aiGenerateTextShortcode("name"),i+=aiGenerateRadioShortcode("allowfullscreen","false"),i+=aiGenerateTextShortcode("safari_fix_url"),i+=aiGenerateTextShortcode("sandbox"),i+=aiGenerateTextShortcode("title"),i+=aiGenerateTextShortcode("allow"),i+=aiGenerateRadioShortcode("loading","lazy"),i+=aiGenerateTextShortcode("referrerpolicy"),i+=aiGenerateTextShortcode("custom"),i+=aiGenerateTextShortcode("url_forward_parameter"),i+=aiGenerateTextShortcode("map_parameter_to_url"),i+=aiGenerateRadioShortcode("add_iframe_url_as_param","false"),i+=aiGenerateTextShortcode("add_iframe_url_as_param_prefix"),i+=aiGenerateRadioShortcode("add_iframe_url_as_param_direct","false"),i+=aiGenerateRadioShortcode("use_iframe_title_for_parent","false"),i+=aiGenerateRadioShortcode("onload_scroll_top","false"),i+=aiGenerateRadioShortcode("hide_page_until_loaded","false"),i+=aiGenerateRadioShortcode("show_iframe_loader","false"),i+=aiGenerateTextShortcode("hide_content_until_iframe_color"),i+=aiGenerateTextShortcode("iframe_zoom"),i+=aiGenerateRadioShortcode("iframe_zoom_ie8","false"),i+=aiGenerateRadioShortcode("use_zoom_absolute_fix","false"),i+=aiGenerateRadioShortcode("auto_zoom","false"),i+=aiGenerateTextShortcode("auto_zoom_by_ratio"),i+=aiGenerateRadioShortcode("enable_responsive_iframe","false"),i+=aiGenerateTextShortcode("iframe_height_ratio"),i+=aiGenerateRadioShortcode("enable_lazy_load","false"),i+=aiGenerateTextShortcodeWithDefault("enable_lazy_load_threshold","3000"),i+=aiGenerateRadioShortcode("enable_lazy_load_reserve_space","true"),i+=aiGenerateTextShortcode("enable_lazy_load_fadetime"),i+=aiGenerateRadioShortcode("enable_lazy_load_manual","false"),i+=aiGenerateRadioShortcode("enable_lazy_load_manual_element","false"),i+=aiGenerateTextShortcode("reload_interval"),i+=aiGenerateTextShortcode("hide_elements"),i+=aiGenerateTextShortcode("content_id"),i+=aiGenerateTextShortcode("content_styles"),i+=aiGenerateTextShortcode("parent_content_css"),i+=aiGenerateRadioShortcode("add_css_class_parent","false"),i+=aiGenerateTextShortcode("change_parent_links_target"),i+=aiGenerateRadioShortcode("show_iframe_as_layer","false"),i+=aiGenerateRadioShortcode("show_iframe_as_layer_full","false"),i+=aiGenerateTextShortcode("show_iframe_as_layer_autoclick_delay"),i+=aiGenerateTextShortcode("show_iframe_as_layer_autoclick_hide_time"),i+=aiGenerateTextShortcode("show_iframe_as_layer_header_file"),i+=aiGenerateTextShortcodeWithDefault("show_iframe_as_layer_header_height","100"),i+=aiGenerateRadioShortcode("show_iframe_as_layer_header_position","top"),i+=aiGenerateRadioShortcode("show_iframe_as_layer_keep_content","true");var l=aiGenerateRadioShortcode("show_part_of_iframe","false");i+=l,""!==l&&(i+=aiGenerateTextShortcodeWithDefault("show_part_of_iframe_x",-1),i+=aiGenerateTextShortcodeWithDefault("show_part_of_iframe_y",-1),i+=aiGenerateTextShortcode("show_part_of_iframe_width"),i+=aiGenerateTextShortcode("show_part_of_iframe_height"),i+=aiGenerateTextShortcode("show_part_of_iframe_media_query"),i+=aiGenerateRadioShortcode("show_part_of_iframe_allow_scrollbar_horizontal","false"),i+=aiGenerateRadioShortcode("show_part_of_iframe_allow_scrollbar_vertical","false"),i+=aiGenerateTextShortcode("show_part_of_iframe_style"),i+=aiGenerateRadioShortcode("show_part_of_iframe_zoom","false"),i+=aiGenerateTextShortcode("show_part_of_iframe_next_viewports"),i+=aiGenerateRadioShortcode("show_part_of_iframe_next_viewports_loop","false"),i+=aiGenerateTextShortcode("show_part_of_iframe_new_window"),i+=aiGenerateTextShortcode("show_part_of_iframe_new_url"),i+=aiGenerateRadioShortcode("show_part_of_iframe_next_viewports_hide","false")),i+=aiGenerateTextShortcode("hide_part_of_iframe"),i+=aiGenerateRadioShortcode("fullscreen_button","false"),i+=aiGenerateTextShortcode("fullscreen_button_hide_elements"),i+=aiGenerateRadioShortcode("fullscreen_button_full","false"),i+=aiGenerateRadioShortcode("fullscreen_button_style","black"),i+=aiGenerateRadioShortcode("add_css_class_iframe","false"),i+=aiGenerateTextShortcode("iframe_hide_elements"),i+=aiGenerateTextShortcode("onload_show_element_only"),i+=aiGenerateTextShortcode("iframe_content_id"),i+=aiGenerateTextShortcode("iframe_content_styles"),i+=aiGenerateTextShortcode("iframe_content_css"),i+=aiGenerateTextShortcode("change_iframe_links"),i+=aiGenerateTextShortcode("change_iframe_links_target"),i+=aiGenerateTextShortcode("change_iframe_links_href"),i+=aiGenerateTextShortcode("onload"),i+=aiGenerateRadioShortcode("onload_resize","false"),i+=aiGenerateTextShortcode("onload_resize_delay"),i+=aiGenerateRadioShortcode("store_height_in_cookie","false"),i+=aiGenerateTextShortcode("additional_height"),i+=aiGenerateRadioShortcode("onload_resize_width","false"),i+=aiGenerateTextShortcode("resize_on_ajax"),i+=aiGenerateRadioShortcode("resize_on_ajax_jquery","true"),i+=aiGenerateTextShortcode("resize_on_click"),i+=aiGenerateTextShortcodeWithDefault("resize_on_click_elements","a"),i+=aiGenerateTextShortcode("resize_on_element_resize"),i+=aiGenerateTextShortcodeWithDefault("resize_on_element_resize_delay","250"),i+=aiGenerateTextShortcode("tab_hidden"),i+=aiGenerateTextShortcode("tab_visible"),i+=aiGenerateRadioShortcode("add_document_domain","false"),"true"===r&&(i+=aiGenerateTextShortcode("document_domain")),i+=aiGenerateRadioShortcode("enable_external_height_workaround","external"),i+=aiGenerateRadioShortcode("hide_page_until_loaded_external","false"),i+=aiGenerateTextShortcode("pass_id_by_url"),i+=aiGenerateRadioShortcode("multi_domain_enabled","true"),"true"===a?i+=aiGenerateRadioShortcode("use_post_message","true"):i+=aiGenerateRadioShortcode("use_post_message","false"),i+=aiGenerateTextShortcode("additional_css"),i+=aiGenerateTextShortcode("additional_js"),i+=aiGenerateTextShortcode("additional_js_file_iframe"),i+=aiGenerateTextShortcode("additional_css_file_iframe")}else""===t?(i+=aiGenerateTextShortcode("include_url"),i+=aiGenerateTextShortcode("include_content"),i+=aiGenerateTextShortcode("include_height"),i+=aiGenerateTextShortcode("include_fade"),i+=aiGenerateRadioShortcode("include_hide_page_until_loaded","false")):i+=aiGenerateTextShortcode("include_html");i+=aiGenerateRadioShortcode("debug_js","false"),i=i.slice(0,-1),i+="]",jQuery("#gen-shortcode").html(i)}function aiGenerateTextShortcodeWithDefault(a,i){var t="",o=jQuery("#"+a),r=o.val();return o.length>0&&""!==r&&r!==i&&(t=a+'="'+r+'" '),t}function aiGenerateTextShortcode(a){var i="",t=jQuery("#"+a),o=t.val();return t.length>0&&""!==o&&"0"!==o&&(i=a+'="'+o+'" '),i}function aiGenerateRadioShortcode(a,i){var t="",o=jQuery("input:radio[name="+a+"]:checked"),r=o.val();return"enable_ios_mobile_scolling"===a&&(a="enable_ios_mobile_scrolling"),o.length>0&&r!==i&&(t+=a+'="'+r+'" '),t}function aiAddCssClassAllParents(a){for(var i=jQuery(a).parentsUntil("html"),t="ai-class-",o=0;o<i.length;o++){var r=jQuery(i[o]).attr("id");void 0!==r?0!==r.indexOf("ai-")&&jQuery(i[o]).addClass(t+r):jQuery(i[o]).addClass(t+o)}}function aiAutoZoomExternalHeight(a,i,t,o){aiDebugExtended("aiAutoZoomExternalHeight");var r=aiAutoZoomExternal(a,i,o),n=window["zoom_"+a],l=jQuery(document).scrollTop();return jQuery("#ai-zoom-div-"+a).css("height",Math.ceil(t*n)),jQuery("html,body").scrollTop(l),r}function aiAutoZoomExternal(a,i,t){aiDebugExtended("aiAutoZoomExternal");var o=document.getElementById(a),r=document.getElementById("ai-zoom-div-"+a),n=jQuery("#"+a);"true"===t&&n.css("max-width","100%");var l=i,s=aiGetParentIframeWidth(o);s===l&&(s=aiGetParentIframeWidth(r));var d=Math.floor(100*(s/l))/100;return d>1&&(d=1),aiSetZoom(a,d),window["zoom_"+a]=d,n.width(l).css("max-width","none"),s}function aiAutoZoom(a,i,t){aiDebugExtended("aiAutoZoom");var o,r=t.split("|");t=r[0];var n=-1;1!==r.length&&(n=r[1]);var l=document.getElementById(a);-1===n?(l.width=1,l.style.width="1px",o=aiGetIframeWidth(l),l.width=o,l.style.width=o+"px"):o=n;var s=aiAutoZoomExternal(a,o,i);if(""===t)aiResizeIframe(l,!1);else{var d=Math.ceil(o*t);if(l.height=d,l.style.height=d+"px",0!==jQuery("#ai-zoom-div-"+l.id).length){var c=window["zoom_"+l.id];jQuery("#ai-zoom-div-"+l.id).css("height",Math.ceil(d*c))}}return s}function aiSetZoom(a,i){var t=jQuery("#"+a);!0===aiIsIe8&&t.css("-ms-zoom",i),t.css({"-ms-transform":"scale("+i+")","-moz-transform":"scale("+i+")","-o-transform":"scale("+i+")","-webkit-transform":"scale("+i+")",transform:"scale("+i+")"})}function aiAutoZoomViewport(a,i){for(var t=jQuery(a),o=t.parent(),r=0;o.is("p")||void 0!==o.attr("id")&&0===o.attr("id").indexOf("ai-");)if(o=o.parent(),r++>10){alert("Unexpected div structure. Please disable the zoom.");break}var n=t.width(),l=o.width(),s=t.height(),d=l/n;"true"===i&&d>1&&(d=1),aiSetZoom(t.attr("id"),d);var c=-Math.round((n-n*d)/2),h=-Math.round((s-s*d)/2);t.css({"margin-left":c+"px","margin-right":c+"px","margin-top":h+"px","margin-bottom":h+"px"})}function aiResetAiSettings(){jQuery("#action").val("reset")}function aiCheckInputNumber(a){a.value=a.value.split(" ").join("");var i=a.value;""!==a.value&&(i.match(/^(\-){0,1}([\d.])+(px|%|em|pt|vh|vw|rem|ch)?(\-|\+){0,1}([\d.]){0,7}(px|%|em|pt|vh|vw|rem|ch)?$/)||(alert("Please check the value you have entered. Only numbers with a dot or with an optional px, %, em or pt are allowed."),setTimeout(function(){a.focus()},10)))}function aiCheckInputPurchaseCode(a){a.value=a.value.split(" ").join("");var i=a.value;""!==a.value&&(i.match(/^([a-f0-9]{8})-(([a-f0-9]{4})-){3}([a-f0-9]{12})$/i)||(alert("Please check the value you have entered. Your input seems not to be a valid purchase code."),a.value="",setTimeout(function(){a.focus()},10)))}function aiCheckInputNumberOnly(a){a.value=a.value.split(" ").join("");var i=a.value;if(""===a.value){a.value="0";return}i.match(/^(\-){0,1}([\d.])+$/)||(alert("Please check the value you have entered. Only numbers without a dot or optional px, %, em or pt are allowed."),setTimeout(function(){a.focus()},10))}function aiShowHeader(a,i){var t=jQuery(window).scrollTop();jQuery(window).scrollTop(t-40),void 0!==i&&aiFlashElement(i)}function aiFlashElement(a){setTimeout(function(){jQuery("#"+a).css("background-color","#eee")},500),setTimeout(function(){jQuery("#"+a).css("background-color","#fff")},900),setTimeout(function(){jQuery("#"+a).css("background-color","#eee")},1300),setTimeout(function(){jQuery("#"+a).css("background-color","#fff")},1700)}function aiSetScrollposition(){var a=jQuery(document).scrollTop();jQuery("#scrollposition").val(a)}function aiResetShowPartOfAnIframe(a){jQuery("#"+a).css("top","0px").css("left","0px").css("position","static"),jQuery("#ai-div-"+a).css("width","auto").css("height","auto").css("overflow","auto").css("position","static")}function aiShowLayerIframe(a,i,t,o,r,n ,l){aiDebugExtended("aiShowLayerIframe"),n=void 0!==n&&n,l=void 0===l||l;var s="#"+i;jQuery("#ai-zoom-div-"+i).show(),l&&"true"===o&&jQuery(s).css("visibility","hidden"),jQuery(s).show(),jQuery("#ai-layer-div-"+i).length&&jQuery(s="#ai-layer-div-"+i).show(),jQuery("body").css("overflow","hidden"),jQuery("html").css("overflow-y","visible"),jQuery("body").append('<img id="ai_backlink" src="'+t+'close.png" style="z-index:100005;position:fixed;top:0;right:0;cursor:pointer" />');var d="<!-- -->";l&&"true"===r&&(d='<div id="ai-div-loader-global" style="position: fixed;z-index:100004;margin-left:-33px;left: 50%;top:50%;margin-top:-33px"><img src="'+t+'loader.gif" width="66" height="66" title="Loading" alt="Loading"></div>'),0===jQuery("#ai_backlayer").length&&jQuery(s).parent().append('<div id="ai_backlayer" style="z-index:100001;position:fixed;top:0;left:0;width:100%;height:100%;background-color: rgba(50,50,50,0.5);overflow:hidden;cursor:pointer"><!-- --></div>'+d),jQuery("#ai_backlink, #ai_backlayer").click(function(){aiHideLayerIframe(i,n)}),l||(a.preventDefault(),a.stopPropagation())}function aiHideLayerIframe(a,i){aiDebugExtended("aiHideLayerIframe"),jQuery("#"+a).hide(),i||(jQuery("#"+a).attr("src","about:blank"),aiLayerIframeHrefs[a]="about:blank"),jQuery("#ai-zoom-div-"+a).hide(),jQuery("#ai-layer-div-"+a).hide(),jQuery("#ai_backlink").remove(),jQuery("#ai_backlayer").remove(),jQuery("#ai-div-loader-global").remove(),jQuery("body").css("overflow","auto"),jQuery("html").css("overflow-y","scroll")}var aiLayerIframeHrefs=[];function aiCheckReload(a,i){t=void 0===aiLayerIframeHrefs[i]?jQuery("#"+i).attr("src"):aiLayerIframeHrefs[i];var t,o=jQuery(a).attr("href");return aiLayerIframeHrefs[i]=o,t!==o}function aiChangeTitle(a){aiDebugExtended("aiChangeTitle");try{var i=document.getElementById(a).contentDocument.title;null!==i&&"undefined"!==i&&""!==i&&(document.title=i)}catch(t){console&&console.error&&(console.error("Advanced iframe configuration error: You have enabled to add the title if the iframe to the parent on the same domain. But you use an iframe page on a different domain. You need to use the pro version of the external workaround like described in the settings. Also check the next log. There the browser message for this error is displayed."),console.log(t))}}function aiChangeUrlParam(a,i,t,o,r){aiDebugExtended("aiChangeUrlParam");var n,l=!1;if(-1!==t.lastIndexOf("//",0)&&(t=location.protocol+t),a!==encodeURIComponent(t)){n=aiSetGetParameter(i,a);var s=!0;if(o.startsWith("hash"))return aiGetUrlMapping(a,i,o);if(o){var d=n.replace(o,"");d===n&&(s=!1),n=d}if(s&&(n=n.replace("http%3A%2F%2F",""),n=-1!==window.location.href.toLowerCase().lastIndexOf("http:",0)?n.replace("https%3A%2F%2F","s|"):n.replace("https%3A%2F%2F","")),r){var n=aiRemoveQueryString(window.location.href),c=decodeURIComponent(a),h=c.indexOf("?");-1!==h&&(n+="?"+c.slice(h+1),l=!0)}aiEndsWidth(n,i+"=")&&(n=aiRemoveURLParameter(n,i))}else{var f=window.location.href;n=aiRemoveURLParameter(f=f.split("/"+i+"/",1)[0],i)}aiSetBrowserUrl(n,l)}function aiGetUrlMappingUrl(a,i,t){var o,r=aiRemoveURLParameter(window.location.href,a=a.replace(":short",""));if(i.startsWith("hashrewrite")){var n="";if(r.indexOf("?")>=0){var l=r.split("?");r=l[0],n="?"+l[1]}var s=r.split("/"+a+"/",1)[0];aiEndsWidth(s,"/")||(s+="/"),r=s+(a+"/")+t+n}else{var d=r.indexOf("?")>=0?"&":"?";r+=d+a+"="+t}return r}function aiSetBrowserUrl(a,i){aiSupportsHistoryApi()&&(i||(a=a.replace(/%2F/g,"/")),window.history.pushState({},"",a),window.onpopstate=function(a){a&&a.state&&window.history.back()})}function aiRemoveQueryString(a){return a.indexOf("%3F")>=0?a.split("%3F")[0]:a.indexOf("?")>=0?a.split("?")[0]:a}function aiGetUrlMapping(a,i,t){var o={action:"aip_map_url_action",security:MyAjax.security,url:a};jQuery.post(MyAjax.ajaxurl,o,function(a){aiSetBrowserUrl(aiGetUrlMappingUrl(i,t,a),!1)})}function closeInfoPermanent(a){var i={action:"aip_close_message_permanent",security:MyAjax.security,id:a},t="The message before will only appear again when you reset the advanced iframe settings.";"show-discount-message"===a?t="The message of advanced iframe shown before will only appear again when you reset the advanced iframe settings or a new discount is available.":"show-registration-message"===a&&(t="The message will appear again until have entered your purchase code."),jQuery.post(MyAjax.ajaxurl,i,function(a){jQuery("h1").after('<div class="message-notice notice notice-success"><p>'+t+"</p></div>")}),setTimeout(function(){jQuery(".message-notice").fadeOut()},4e3)}function aiSupportsHistoryApi(){return!!(window.history&&history.pushState)}function aigetIframeLocation(a){try{var i=document.getElementById(a).contentWindow.location;return encodeURIComponent(i)}catch(t){console&&console.error&&(console.error("Advanced iframe configuration error: You have enabled to add the url to the url on the same domain. But you use an iframe page on a different domain. You need to use the pro version of the external workaround like described in the settings. Also check the next log. There the browser message for this error is displayed."),console.log(t))}}function aiSetGetParameter(a,i){var t=window.location.href,o=t.split("#");t=o[0];var r=void 0===o[1]?"":"#"+o[1];if(t.indexOf(a+"=")>=0){var n=t.substring(0,t.indexOf(a+"=")),l=t.substring(t.indexOf(a+"="));t=n+a+"="+i+(l=(l=l.substring(l.indexOf("=")+1)).indexOf("&")>=0?l.substring(l.indexOf("&")):"")}else 0>t.indexOf("?")?t+="?"+a+"="+i:t+="&"+a+"="+i;return t+r}function aiRemoveURLParameter(a,i){var t=a.split("?");if(!(t.length>=2))return a;for(var o=encodeURIComponent(i)+"=",r=t[1].split(/[&;]/g),n=r.length;n-- >0;)-1!==r[n].lastIndexOf(o,0)&&r.splice(n,1);return a=0!==r.length?t[0]+"?"+r.join("&"):t[0]}function aiEndsWidth(a,i){return a.substr(-i.length)===i}function aiAddCss(a,i){i=decodeURIComponent(i.replace(/\+/g,"%20"));var t=jQuery(a).contents().find("body"),o=document.createElement("style");o.setAttribute("type","text/css"),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(document.createTextNode(i)),t.append(o)}function aiAddCssFile(a,i){var t=jQuery(a).contents().find("body"),o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.href=i,t.append(o)}function aiAddJsFile(a,i){jQuery.ajaxSetup({cache:!0});var t=jQuery(a).contents().find("body"),o=document.createElement("script");o.type="text/javascript",o.src=i,t.append(o)}function aiPresetFullscreen(){jQuery("#style").val("position:fixed;z-index:9000;top:0px;left:0px;margin:0px"),jQuery("#width").val("100%"),jQuery("#ai-height-0").val("100%"),jQuery("#content_id").val("html,body"),jQuery("#content_styles").val("overflow:hidden"),jQuery("#hide_content_until_iframe_color").val("#ffffff")}function aiDisableCheckIframes(){var a=jQuery("<input>").attr("type","hidden").attr("name","checkIframes").val("true");jQuery("#ai_form").append(a),jQuery("#ai_form").submit(),jQuery("#checkIframes").prop("disabled","disabled")}function aiProcessMessage(a,i,t){var o;try{var o=JSON.parse(a.data)}catch(r){"debug"===t&&console&&console.log&&(console.log("Advanced iframe: The received message cannot be parsed and seems not to belong to advanced iframe pro. Please disable the postMessage debug mode if this o.k. and that this message is not shown anymore."),console.log("Advanced iframe: Unknown event: ",a));var o=a.data}try{if(o.hasOwnProperty("aitype")&&i===o.id){var n=o.aitype;if("debug"===n)aiProcessDebug(o);else if("scrollToTop"===n)aiProcessScrollToTop(o);else if("anchor"===n)aiProcessAnchor(o);else for(var l in"height"===n?aiProcessHeight(o):"show"===n&&aiProcessShow(o),o.data)o.data.hasOwnProperty(l)&&jQuery(l).html(o.data[l])}}catch(s){"debug"===t&&console&&console.log&&(console.log("Advanced iframe: The received message do not belong to advanced iframe pro. Please disable the postMessage debug mode if this o.k. and that this message is not shown anymore."),console.log(s))}}function aiProcessDebug(a){var i=a.data;0!==jQuery("#aiDebugDiv").length&&(i=(i=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")).replace('"','"').replace(/\\/g,""),jQuery("#aiDebugDiv").append('<p class="ai-debug-remote"> r: '+i+"</p>"))}function aiProcessScrollToTop(a){aiScrollToTop(a.id,aiOnloadScrollTop)}function aiProcessAnchor(a){var i=a.id,t=parseInt(a.position,10),o=jQuery("#"+i).offset().top;setTimeout(function(){jQuery("html,body").scrollTop(Math.round(o+t))},100)}function aiProcessHeight(a){var i=a.height,t=a.width,o=parseInt(a.anchor,10),r=a.id;if(null!=i)try{var n=a.loc;null==n||n.includes("send_console_log")||"function"!=typeof aiChangeUrl||aiChangeUrl(n);var l=a.title;if(null!=l&&"undefined"!=l&&""!=l&&(document.title=decodeURIComponent(l)),null!=r){var s=parseInt(i,10),d=parseInt(t,10);if(aiResizeIframeHeightId(s,d,r),!isNaN(o)&&o>-1){var c=jQuery("#"+r).offset().top;setTimeout(function(){jQuery("html,body").scrollTop(Math.round(c+o)),aiShowIframeId(r)},100)}else aiShowIframeId(r)}else alert("Please update the ai_external.js to the current version.")}catch(h){console&&console.log&&console.log(h)}}function aiProcessShow(a){var i=a.id;try{aiShowIframeId(i)}catch(t){console&&console.log&&console.log(t)}}function aiDisableRightClick(a){try{window.frames[a].document.oncontextmenu=function(){return!1}}catch(i){}}function aiRemoveElementsFromHeight(a,i,t){for(var o=jQuery("#"+a),r=t.split(","),n=0,l=0;l<r.length;l++)try{var s=r[l];if(s.includes("|")){var d=s.split("|"),c=jQuery(d[0]),h=Math.round(c.offset().top+c.outerHeight(!0)),f=Math.round(jQuery(d[1]).offset().top);n+=f-h}else"top"===s?n+=Math.round(jQuery("#"+a).offset().top):isNaN(s)?n+=jQuery(s).outerHeight(!0):n+=parseInt(s)}catch(u){console&&console.error&&(console.error('Advanced iframe configuration error: The configuration of remove_elements_from_height "'+t+'" is invalid. Please check if the elements you defined do exist and ids/classes are defined properly.'),console.log(u))}var p="calc("+i+" - "+n+"px)";o.css("height",p)}function aiTriggerAutoOpen(a,i,t,o){aiDebugExtended("aiTriggerAutoOpen"),0===t?aiOpenIframeOnClick(a,i):setTimeout(function(){aiOpenIframeOnClick(a,i)},t);var r=new Date,n=r.getTime();r.setTime(n+864e5*o);var l=i.replace(/[^A-Za-z0-9\-]/g,"");document.cookie="ai_disable_autoclick_iframe_"+l+"=Auto open is disabled until this cookie expires;expires="+r.toUTCString()+";path=/"}function aiCheckAutoOpenHash(a,i,t){if(window.location.hash){var o=window.location.hash.replace(/[^A-Za-z0-9\-]/g,"");0!==jQuery(o="#"+o).length&&jQuery(o).first().attr("target")==a&&aiTriggerAutoOpen(a,o,i,t)}}function aiOpenIframeOnClick(a,i){var t=jQuery(i).first().attr("href");jQuery("#"+a).attr("src",t),jQuery(i).first().click()}jQuery(document).ready(function(){aiDebugExtended("document.ready called"),jQuery("iframe").parent("p").css("margin","0"),aiWindowWidth=jQuery(window).width(),jQuery.each(aiReadyCallbacks,function(a,i){i()}),jQuery(".ai-fullscreen-open").on("click",function(){jQuery(this).closest(".ai-wrapper-div").addClass("ai-fullscreen-wrapper"),jQuery(this).closest(".ai-wrapper-div").find("iframe").addClass("ai-fullscreen"),jQuery(".ai-fullscreen-open").hide(),jQuery(".ai-fullscreen-hide").addClass("ai-fullscreen-display-none"),jQuery(".ai-fullscreen-hide").hide(),jQuery("html,body").css("overflow","hidden");var a=jQuery(this).data("id");jQuery(".ai-fullscreen-close-"+a).show(),jQuery(document).on("keydown",function(a){"Escape"==a.key&&jQuery(".ai-fullscreen-close").trigger("click")}),aiOpenFullscreen(),aiInFullscreen=!0}),jQuery(".ai-fullscreen-close").on("click",function(){jQuery("div.ai-wrapper-div").removeClass("ai-fullscreen-wrapper"),jQuery("iframe.ai-fullscreen").removeClass("ai-fullscreen"),jQuery("html").css("overflow",aiOverflowHtml),jQuery("body").css("overflow",aiOverflowBody),jQuery(".ai-fullscreen-close").hide(),jQuery(".ai-fullscreen-open").show(),jQuery(".ai-fullscreen-display-none").removeClass("ai-fullscreen-display-none"),jQuery(".ai-fullscreen-hide").show(),jQuery(document).off("keydown"),aiInFullscreen&&aiCloseFullscreen()}),setTimeout(function(){jQuery("#ai #ai-updated-text").css("visibility","hidden")},4e3),jQuery("#ai #checkIframes").on("click",function(){jQuery(".ai-spinner").css("display","inline-table"),jQuery(this).addClass("disabled"),setTimeout(aiDisableCheckIframes,200)});var a=!1;if(jQuery("#aiDebugDivTotal").mousedown(function(){a=!1}).mousemove(function(){a=!0}).mouseup(function(i){if(!a){var t=jQuery("#aiDebugDiv");Math.floor(t.height())>"300"?t.height("0px"):t.height("400px")}}),"undefined"!=typeof ai_show_id_only){if(0===jQuery("#"+ai_show_id_only).length)alert('The element with the id "'+ai_show_id_only+'" cannot be found. Please check your configuration.');else{var i=jQuery("#"+ai_show_id_only);i.siblings().hide();var t=i.parents();if(t.siblings().hide(),t.css("padding","0px").css("margin","0px").css("overflow","hidden"),parent===top){var o=i[0];o.style.marginTop=o.style.marginBottom=0,o.style.overflow="hidden";var r=JSON.stringify({aitype:"height",height:parseInt(Math.max(o.scrollHeight,o.offsetHeight),10),id:ai_show_id_only});window.parent.postMessage(r,"*")}}}jQuery("#ai #checkIframes").on("click",function(){jQuery(".ai-spinner").css("display","inline-table"),jQuery(this).addClass("disabled"),setTimeout(aiDisableCheckIframes,200)})}),String.prototype.includes||(String.prototype.includes=function(a,i){return"number"!=typeof i&&(i=0),!(i+a.length>this.length)&&-1!==this.indexOf(a,i)}),String.prototype.startsWith||(String.prototype.startsWith=function(a,i){return i=i||0,this.indexOf(a,i)===i});var elem=document.documentElement;function aiOpenFullscreen(){aiRealFullscreen&&(elem.requestFullscreen?elem.requestFullscreen():elem.webkitRequestFullscreen?elem.webkitRequestFullscreen():elem.msRequestFullscreen&&elem.msRequestFullscreen())}function aiCloseFullscreen(){aiRealFullscreen&&(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen())}function aiExitHandler(){document.fullscreenElement||document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||(aiInFullscreen=!1,jQuery(".ai-fullscreen-close").trigger("click"))}document.addEventListener("fullscreenchange",aiExitHandler),document.addEventListener("webkitfullscreenchange",aiExitHandler),document.addEventListener("mozfullscreenchange",aiExitHandler),document.addEventListener("MSFullscreenChange",aiExitHandler);1 /** Advanced iframe pro functions v2024.2. Created: 2024-02-18 22:41:56 */ 2 var aiInstance,aiEnableCookie="undefined"!=typeof x&&aiEnableCookie,aiId="",aiExtraSpace=void 0===aiExtraSpace?0:aiExtraSpace,aiAccTime=0,aiRealFullscreen=void 0!==aiRealFullscreen&&aiRealFullscreen,aiInFullscreen=!1,aiOnloadEventsCounter=0,aiOverflowHtml=jQuery("html").css("overflow")??"visible",aiOverflowBody=jQuery("body").css("overflow")??"visible",aiCallbackExists=void 0!==aiReadyCallbacks&&aiReadyCallbacks instanceof Array,aiReadyCallbacks=aiCallbackExists?aiReadyCallbacks:[];function aiDebugExtended(a){"undefined"!=typeof aiShowDebug&&aiShowDebug&&console&&console.log&&console.log("Advanced iframe: "+a)}function aiResizeIframe(a,i,t){aiDebugExtended("aiResizeIframe");try{if("about:blank"===a.contentWindow.location.href)return;if(null!=a.contentWindow.document.body){var o=jQuery(window).scrollTop();a.style.marginTop=0,a.style.marginBottom=0,a.height=Number(t),a.style.height=Number(t)+"px";var r=aiGetIframeHeight(a);if(aiDebugExtended("aiResizeIframe - newheight: "+r),a.height=r,a.style.height=r+"px",0!==jQuery("#ai-zoom-div-"+a.id).length){var n=window["zoom_"+a.id];jQuery("#ai-zoom-div-"+a.id).css("height",r*n)}aiEnableCookie&&0===aiExtraSpace&&aiWriteCookie(r);var l=aiGetIframeHash(a.contentWindow.location.href);if(-1!==l){var s="#"+a.id;try{var d=jQuery(s).contents().find("#"+l);if(0!==d.length){var c=d.offset().top;o=Math.round(jQuery(s).offset().top+c)}}catch(h){}}if(setTimeout(function(){jQuery("html,body").scrollTop(o)},50),"true"===i){var f=aiGetIframeWidth(a);a.width=f,a.style.width=f+"px"}(0,window["resizeCallback"+a.id])(),null!=window.frameElement&&parent.jQuery("iframe").trigger("onload"),aiHandleAnchorLinkScrolling(a.id)}else setTimeout(function(){aiResizeIframe(a,i)},100)}catch(u){console&&console.error&&(console.error("Advanced iframe configuration error: You have enabled the resize of the iframe for pages on the same domain. But you use an iframe page on a different domain. You need to use the external workaround like described in the settings. Also check the next log. There the browser message for this error is displayed."),console.log(u))}}function aiHandleAnchorLinkScrolling(a){var i=jQuery("#"+a).offset().top;jQuery("#"+a).contents().find("body").on("click","a[href^='#']",function(t){var o=jQuery(this).attr("href"),r=jQuery("#"+a).contents().find(o);if(0!=r.length){var n=r.offset().top;jQuery("html,body").scrollTop(Math.round(i+n+2))}})}function aiGetIframeHash(a){var i;return a.split("#")[1]||"-1"}function aiGetIframeHeight(a){var i;return Math.max(a.contentWindow.document.body.scrollHeight,a.contentWindow.document.body.offsetHeight,a.contentWindow.document.documentElement.scrollHeight,a.contentWindow.document.documentElement.offsetHeight)+aiExtraSpace}function aiGetIframeWidth(a){var i=a.width;a.width=1,a.style.width="1px";var t=Math.max(a.contentWindow.document.body.scrollWidth,a.contentWindow.document.body.offsetWidth,a.contentWindow.document.documentElement.scrollWidth,a.contentWindow.document.documentElement.offsetWidth);return 1!==t?(a.width=t,a.style.width=t+"px"):(a.width=i,a.style.width=i+"px"),t}function aiGetParentIframeWidth(a){return null!=a&&0!==jQuery("#"+a.id).length?jQuery("#"+a.id).width():-1}function aiResizeIframeHeightById(a,i){aiDebugExtended("aiResizeIframeHeightById - id: "+a+", nHeight: "+i);try{(0,window["resizeCallback"+a])();var t=parseInt(i,10)+aiExtraSpace,o=document.getElementById(a);if(null===o&&console&&console.error){console.error("Advanced iframe configuration error: The iframe to resize could not be found. The id of the iframe and the one defined for ai_external.js ("+a+") are most likely different! Check your settings."),console.log(e);return}var r=jQuery(document).scrollTop();o.height=t,o.style.height=t+"px",jQuery("html,body").scrollTop(r),aiEnableCookie&&0===aiExtraSpace&&aiWriteCookie(t);var n=window["aiExecuteWorkaround_"+a];null!=n&&n()}catch(l){console&&console.error&&(console.error("Advanced iframe configuration error: The id of the parent and the external workaround are different! Check your settings."),console.log(l))}}function aiScrollToTop(a,i){if(aiDebugExtended("aiScrollToTop - id: "+a+", position: "+i),aiOnloadEventsCounter>0){var t=0;"iframe"===i&&(t=jQuery("#"+a).offset().top),setTimeout(function(){aiDebugExtended("aiScrollToTop - posTop: "+t),window.scrollTo(0,t)},100)}setTimeout(function(){aiOnloadEventsCounter++},1e3)}function aiWriteCookie(a){var i="ai-last-height";""!==aiId&&(i=i+"-"+aiId);var t=i+"="+a;document.cookie=t}function aiUseCookie(){var a="ai-last-height";""!==aiId&&(a=a+"-"+aiId);for(var i=document.cookie.split(";"),t=0;t<i.length;t++){var o=i[t].split("=")[0],r=i[t].split("=")[1];if(o===a&&null!==r&&aiIsNumeric(r)){var n=document.getElementById(aiId);n.height=parseInt(r,10),n.style.height=r+"px"}}}function aiIsNumeric(a){return!isNaN(a)}function aiDisableHeight(){jQuery("#additional_height").attr("readonly","readonly"),jQuery("#additional_height").val("0")}function aiEnableHeight(){jQuery("#additional_height").removeAttr("readonly")}function aiShowElementOnly(a,i){aiDebugExtended("aiShowElementOnly");try{var t=jQuery(a).contents().find("body"),o=t.find(i).clone(!0,!0);t.find("*").not(jQuery("script")).remove(),t.prepend(o)}catch(r){console&&console.error&&(console.error("Advanced iframe configuration error: You have enabled to show only one element of the iframe for pages on the same domain. But you use an iframe page on a different domain. You need to use the pro version of the external workaround like described in the settings. Also check the next log. There the browser message for this error is displayed."),console.log(r))}}function aiCheckIfValidTarget(a,i){a||(a=window.event),a.target?t=a.target:a.srcElement&&(t=a.srcElement),3===t.nodeType&&(t=t.parentNode);for(var t,o=i.split(","),r=0;r<o.length;++r){var n=o[r].split(":");if(n[0].toLowerCase()===t.nodeName.toLowerCase()&&(!(n.length>1)||-1!==t.id.toLowerCase().indexOf(n[1].toLowerCase())))return!0}return!1}function aiOpenSelectorWindow(a){aiDebugExtended("aiOpenSelectorWindow");var i=jQuery("#width").val(),t=jQuery("#ai-height-0").val();(i.indexOf("%")>=0||900>Number(i))&&(i=900),(i=Number(i)+40)>screen.width&&(i=screen.width),(t=t.indexOf("%")>=0?screen.height:Number(t)+480)>screen.height-50&&(t=screen.height-50);var o="width="+i+",height="+t+",left=0,top=0,resizable=1,scrollbars=1";window.open(a,"",o).focus()}function aiDisableAiResizeOptions(a){jQuery("#onload_resize_delay").prop("readonly",a),jQuery("input[id=store_height_in_cookie1]:radio, input[id=store_height_in_cookie2]:radio").attr("disabled",a),jQuery("#additional_height").prop("readonly",a),jQuery("input[id=onload_resize_width1]:radio, input[id=onload_resize_width2]:radio").attr("disabled",a),jQuery("#resize_on_click").prop("readonly",a),jQuery("#resize_on_click_elements").prop("readonly",a),jQuery("#resize_on_ajax").prop("readonly",a),jQuery("input[id=resize_on_ajax_jquery1]:radio, input[id=resize_on_ajax_jquery2]:radio").attr("disabled",a);var i="#onload_resize_delay, #store_height_in_cookie1, #additional_height, #onload_resize_width1, ";aiDisableTextSection(a,i+="#resize_on_click, #resize_on_click_elements, #resize_on_ajax, #resize_on_ajax_jquery1")}function aiDisablePartOfIframeOptions(a){jQuery("#show_part_of_iframe_x").prop("readonly",a),jQuery("#show_part_of_iframe_y").prop("readonly",a),jQuery("#show_part_of_iframe_height").prop("readonly",a),jQuery("#show_part_of_iframe_width").prop("readonly",a),jQuery("input[id=show_part_of_iframe_allow_scrollbar_horizontal1]:radio, input[id=show_part_of_iframe_allow_scrollbar_horizontal2]:radio").attr("disabled",a),jQuery("input[id=show_part_of_iframe_allow_scrollbar_vertical1]:radio, input[id=show_part_of_iframe_allow_scrollbar_vertical2]:radio").attr("disabled",a),jQuery("#show_part_of_iframe_next_viewports").prop("readonly",a),jQuery("input[id=show_part_of_iframe_next_viewports_loop1]:radio, input[id=show_part_of_iframe_next_viewports_loop2]:radio").attr("disabled",a),jQuery("#show_part_of_iframe_new_window").prop("readonly",a),jQuery("#show_part_of_iframe_new_url").prop("readonly",a),jQuery("input[id=show_part_of_iframe_next_viewports_hide1]:radio, input[id=show_part_of_iframe_next_viewports_hide2]:radio").attr("disabled",a),jQuery("#show_part_of_iframe_style").prop("readonly",a),jQuery("input[id=show_part_of_iframe_zoom1]:radio, input[id=show_part_of_iframe_zoom2]:radio, input[id=show_part_of_iframe_zoom3]:radio").attr("disabled",a),jQuery(".media-query-input").prop("readonly",a);var i="#show_part_of_iframe_x, #show_part_of_iframe_y, #show_part_of_iframe_height, #show_part_of_iframe_width, ";i+="#show_part_of_iframe_allow_scrollbar_horizontal1, #show_part_of_iframe_next_viewports, #show_part_of_iframe_next_viewports_loop1, ",i+="#show_part_of_iframe_new_window, #show_part_of_iframe_new_url, #show_part_of_iframe_next_viewports_hide1, #show_part_of_iframe_style, ",aiDisableTextSection(a,i+="#show_part_of_iframe_zoom1, #show_part_of_iframe_allow_scrollbar_vertical1, #add-media-query-show_part_of_iframe_media_query"),a?(jQuery("#add-media-query-show_part_of_iframe_media_query").hide(),jQuery(".ai-delete").hide()):(jQuery("#add-media-query-show_part_of_iframe_media_query").show(),jQuery(".ai-delete").show())}function aiDisableLazyLoadOptions(a){jQuery("#enable_lazy_load_threshold").prop("readonly",a),jQuery("#enable_lazy_load_fadetime").prop("readonly",a),jQuery("input[id=enable_lazy_load_reserve_space1]:radio, input[id=enable_lazy_load_reserve_space2]:radio").attr("disabled",a),jQuery("input[id=enable_lazy_load_manual1]:radio, input[id=enable_lazy_load_manual2]:radio, input[id=enable_lazy_load_manual3]:radio").attr("disabled",a),aiDisableTextSection(a,"#enable_lazy_load_threshold, #enable_lazy_load_fadetime, #enable_lazy_load_reserve_space1, #enable_lazy_load_manual1")}function aiDisableIframeAsLayerOptions(a){jQuery("input[id=show_iframe_as_layer_full]:radio").attr("disabled",a),jQuery("#show_iframe_as_layer_header_file").prop("readonly",a),jQuery("#show_iframe_as_layer_header_height").prop("readonly",a),jQuery("#show_iframe_as_layer_autoclick_delay").prop("readonly",a),jQuery("#show_iframe_as_layer_autoclick_hide_time").prop("readonly",a),jQuery("input[id=show_iframe_as_layer_header_position1]:radio, input[id=show_iframe_as_layer_header_position2]:radio").attr("disabled",a),jQuery("input[id=show_iframe_as_layer_full1]:radio, input[id=show_iframe_as_layer_full2]:radio, input[id=show_iframe_as_layer_full3]:radio").attr("disabled",a),jQuery("input[id=show_iframe_as_layer_keep_content1]:radio, input[id=show_iframe_as_layer_keep_content2]:radio").attr("disabled",a);var i="#show_iframe_as_layer_full, #show_iframe_as_layer_header_file, #show_iframe_as_layer_header_height, ";i+="#show_iframe_as_layer_header_position1, #show_iframe_as_layer_full1, #show_iframe_as_layer_keep_content1, ",aiDisableTextSection(a,i+="#show_iframe_as_layer_autoclick_delay, #show_iframe_as_layer_autoclick_hide_time")}function aiDisableAddParamOptions(a){jQuery("input[id=add_iframe_url_as_param_direct1]:radio, input[id=add_iframe_url_as_param_direct2]:radio").attr("disabled",a),jQuery("#add_iframe_url_as_param_prefix").prop("readonly",a),aiDisableTextSection(a,"#add_iframe_url_as_param_prefix, #add_iframe_url_as_param_direct1")}function aiDisableTextSection(a,i){a?jQuery(i).closest("tr").addClass("disabled"):jQuery(i).closest("tr").removeClass("disabled")}function aiInitAdminConfiguration(a,i){"false"===jQuery("input[type=radio][name=onload_resize]:checked").val()&&aiDisableAiResizeOptions(!0),jQuery("input[type=radio][name=onload_resize]").click(function(){"true"===jQuery(this).val()?(jQuery("input:radio[name=enable_external_height_workaround]")[1].checked=!0,aiDisableAiResizeOptions(!1)):(jQuery("#onload_resize_delay").val(""),aiDisableAiResizeOptions(!0))}),jQuery("input[type=radio][name=enable_external_height_workaround]").click(function(){"true"===jQuery(this).val()&&(jQuery("input:radio[name=onload_resize]")[1].checked=!0,jQuery("#onload_resize_delay").val(""),aiDisableAiResizeOptions(!0))}),"false"===jQuery("input[type=radio][name=show_part_of_iframe]:checked").val()&&aiDisablePartOfIframeOptions(!0),jQuery("input[type=radio][name=show_part_of_iframe]").click(function(){"false"===jQuery(this).val()?aiDisablePartOfIframeOptions(!0):aiDisablePartOfIframeOptions(!1)}),"false"===jQuery("input[type=radio][name=show_iframe_as_layer]:checked").val()&&aiDisableIframeAsLayerOptions(!0),jQuery("input[type=radio][name=show_iframe_as_layer]").click(function(){"false"===jQuery(this).val()?aiDisableIframeAsLayerOptions(!0):aiDisableIframeAsLayerOptions(!1)}),"true"===jQuery("input[type=radio][name=expert_mode]:checked").val()&&(jQuery(".description").css("display","none"),jQuery("table.form-table th").css("cursor","pointer"),jQuery("table.form-table th").css("padding-top","8px").css("padding-bottom","2px"),jQuery("table.form-table td").css("padding-top","5px").css("padding-bottom","5px"),jQuery("table.form-table th").click(function(){jQuery(".description").css("display","none"),jQuery(".description",jQuery(this).parent()).css("display","block")})),jQuery("input[type=radio][name=expert_mode]").click(function(){"false"===jQuery(this).val()?(jQuery(".description").css("display","block"),jQuery("table.form-table th").css("cursor","auto"),jQuery("table.form-table th").off("click"),jQuery("table.form-table th").css("padding-top","20px").css("padding-bottom","20px"),jQuery("table.form-table td").css("padding-top","15px").css("padding-bottom","15px")):(jQuery(".description").css("display","none"),jQuery("table.form-table th").css("cursor","pointer"),jQuery("table.form-table th").css("padding-top","8px").css("padding-bottom","2px"),jQuery("table.form-table td").css("padding-top","5px").css("padding-bottom","5px"),jQuery("table.form-table th").click(function(){jQuery(".description").css("display","none"),jQuery(".description",jQuery(this).parent()).css("display","block")}))}),jQuery("#accordion").find("h1").click(function(){jQuery(this).next().slideToggle(aiAccTime)}).next().hide(),jQuery("#accordion").find("a").click(function(){var a="#h1-"+jQuery(this).prop("hash").substring(1);jQuery(a).next().show(),location.hash=a}),"false"===jQuery("input[type=radio][name=enable_lazy_load_manual]:checked").val()&&jQuery("#enable_lazy_load_manual_element").prop("readonly",!0),jQuery("input[type=radio][name=enable_lazy_load_manual]").click(function(){"false"===jQuery(this).val()||"auto"===jQuery(this).val()?jQuery("#enable_lazy_load_manual_element").prop("readonly",!0):jQuery("#enable_lazy_load_manual_element").prop("readonly",!1)}),"false"===jQuery("input[type=radio][name=add_iframe_url_as_param]:checked").val()&&aiDisableAddParamOptions(!0),jQuery("input[type=radio][name=add_iframe_url_as_param]").click(function(){aiDisableAddParamOptions("false"===jQuery(this).val())}),"false"===jQuery("input[type=radio][name=enable_lazy_load]:checked").val()&&(aiDisableLazyLoadOptions(!0),jQuery("#enable_lazy_load_manual_element").prop("readonly",!0)),jQuery("input[type=radio][name=enable_lazy_load]").click(function(){"false"===jQuery(this).val()?(aiDisableLazyLoadOptions(!0),jQuery("#enable_lazy_load_manual_element").prop("readonly",!0)):(aiDisableLazyLoadOptions(!1),"false"===jQuery("input[type=radio][name=enable_lazy_load_manual]:checked").val()||"auto"===jQuery("input[type=radio][name=enable_lazy_load_manual]:checked").val()?jQuery("#enable_lazy_load_manual_element").prop("readonly",!0):jQuery("#enable_lazy_load_manual_element").prop("readonly",!1))}),jQuery(".confirmation").on("click",function(){return confirm("Are you sure? Selecting OK will set all settings to the default.")}),jQuery(".confirmation-file").on("click",function(){return confirm("Do you really want to delete the file?")}),jQuery(".confirmation-hash").on("click",function(){return confirm("Do you really want to delete the hash/URL cache?")}),jQuery("a.post").click(function(a){a.stopPropagation(),a.preventDefault();var i,t=this.href.split("?"),o=t[0],r=t[1].split("&"),n="";o+="?"+r[0];for(var l=1,s=r.length;l<s;l++)n+='<input type="hidden" name="'+(i=r[l].split("="))[0]+'" value="'+i[1]+'" />';var d=jQuery("#twg-options").val();n+='<input type="hidden" name="twg-options" value="'+d+'" />',jQuery("body").append('<form action="'+o+'" method="post" id="poster">'+n+"</form>"),jQuery("#poster").submit()}),jQuery(".ai-input-search").keyup(function(a){var t=jQuery("input.ai-input-search").val().toLowerCase();aiSettingsSearch(t,i)}),jQuery(".ai-input-search").on("click",function(a){setTimeout(function(){var a=jQuery("input.ai-input-search").val().toLowerCase();aiSettingsSearch(a,i)},100)}),jQuery(document).on("click",".nav-tab-wrapper a",function(){var a=jQuery(this).attr("id");return jQuery("section").hide(),jQuery("section."+a).show(),jQuery("#current_tab").val(a.substr(4,1)),jQuery(".nav-tab").removeClass("nav-tab-active"),jQuery(this).addClass("nav-tab-active"),jQuery(this).blur(),!1}),jQuery(document).on("click","a#external-workaround-link",function(){return jQuery(".external-workaround").click(),location.hash="tab_3",aiShowHeader("tab_3"),!1}),jQuery(document).on("click","a#resize-same-link",function(){return jQuery(".advanced-settings-tab").click(),jQuery("#id-advanced-resize").removeClass("closed"),location.hash="id-advanced-resize",aiShowHeader("id-advanced-resize"),!1}),jQuery(document).on("click","a.jquery-help-link",function(){return jQuery(".help-tab").click(),jQuery("#id-help-jquery").removeClass("closed"),jQuery("#jquery-help").show(),location.hash="id-help-jquery",aiShowHeader("id-help-jquery"),!1}),jQuery(document).on("click","a#browser-detection-link",function(){return jQuery(".help-tab").click(),jQuery("#id-help-browser").removeClass("closed"),jQuery("#browser-help").show(),location.hash="id-help-browser",aiShowHeader("id-help-browser"),!1}),jQuery(document).on("click","a.howto-id-link",function(){return jQuery(".help-tab").click(),jQuery("#id-help-id").removeClass("closed"),location.hash="id-help-id",aiShowHeader("id-help-id"),!1}),jQuery(document).on("click",".modifycontent-link",function(){return jQuery(".advanced-settings-tab").click(),jQuery("#id-advanced-modify-iframe").removeClass("closed"),location.hash="id-advanced-modify-iframe",aiShowHeader("id-advanced-modify-iframe","tr-"+jQuery(this).data("detail")),!1}),jQuery(document).on("click",".id-modify-css-iframe-link",function(){return jQuery(".advanced-settings-tab").click(),jQuery("#id-advanced-modify-iframe").removeClass("closed"),location.hash="id-modify-css-iframe",aiShowHeader("id-advanced-modify-iframe","tr-"+jQuery(this).data("detail")),!1}),jQuery(document).on("click",".modify-target",function(){return jQuery(".advanced-settings-tab").click(),jQuery("#id-advanced-modify-iframe").removeClass("closed"),location.hash="id-modify-target",aiShowHeader("id-advanced-modify-iframe","tr-"+jQuery(this).data("detail")),!1}),jQuery(document).on("click","a.link-external-domain",function(){return jQuery("#id-external-different").removeClass("closed"),location.hash="#id-external-different",aiShowHeader("id-external-different"),!1}),jQuery(document).on("click","a.link-id-external-ai-config-post",function(){return jQuery("#id-external-ai-config-post").removeClass("closed"),location.hash="#id-external-ai-config-post",aiShowHeader("id-external-ai-config-post","tr-use_post_message"),!1}),jQuery(document).on("click","a.link-id-external-ai-overview",function(){return jQuery("#id-external-ai-overview").removeClass("closed"),location.hash="#id-external-ai-overview",aiShowHeader("id-external-ai-overview","id-external-ai-overview"),!1}),jQuery(document).on("click","a.post-message-help-link",function(){return jQuery(".help-tab").click(),jQuery("#id-help-communication").removeClass("closed"),location.hash="#id-help-communication",aiShowHeader("id-help-communication","id-help-communication"),!1}),jQuery(document).on("click","a.enable-admin",function(){return jQuery(".options-tab").click(),jQuery("#id-options-display").removeClass("closed"),location.hash="#id-options-display",aiShowHeader("id-options-display","tr-demo"),!1}),jQuery(document).on("click","a.enter-registration",function(){return jQuery(".options-tab").click(),jQuery("#id-options-registration").removeClass("closed"),location.hash="#id-options-registration",aiShowHeader("id-options-registration","tr-demo"),!1}),jQuery(document).on("click","a#user-help-link",function(){return jQuery("#user-help").css("display","block"),!1}),jQuery(document).on("click","a#user-meta-link",function(){return jQuery("#meta-help").css("display","block"),!1}),jQuery(document).on("click","#ai-selector-help-link",function(){return jQuery("#ai-selector-help").slideDown(1e3),!1}),jQuery(document).on("click",".ai-selector-help-link-move",function(){return jQuery("#ai-selector-help").show("slow"),location.hash="#ai-selector-help-link",aiShowHeader("ai-selector-help-link"),!1}),jQuery("#ai_form").submit(function(){aiSetScrollposition()}),jQuery(".if-js-closed").removeClass("if-js-closed").addClass("closed"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles("toplevel_page_advanced-iframe"),jQuery(".ai-spinner").css("display","none"),jQuery("#"+i).next().show(),jQuery(document).on("click","#test-pro-admin.is-permanent-closable button",function(){closeInfoPermanent("test-pro-admin")}),jQuery(document).on("click","#show-registration-message.is-permanent-closable button",function(){closeInfoPermanent("show-registration-message")}),jQuery(document).on("click","#show-version-message.is-permanent-closable button",function(){closeInfoPermanent("show-version-message")}),jQuery(document).on("click",".mq-breakpoint-height a",function(a){return jQuery(this).parent().remove(),aiUpdateHeightHiddenField("height"),a.preventDefault(),!1}),jQuery(document).on("click","a#add-media-query-height",function(a){var i=jQuery(".mq-breakpoint-height").length+1;return jQuery(this).parent().append('<div id="breakpoint-row-height-'+i+'" class="mq-breakpoint-height"><input type="text" id="ai-height-'+i+'" style="width:150px;margin-top:5px;" onblur="aiCheckHeightNumber(this, \'height\');" placeholder="Insert height"/> Breakpoint: <input type="text" id="ai-breakpoint-height-'+i+'" style="width:130px;" onblur="aiCheckHeightNumber(this, \'height\');" placeholder="Insert breakpoint"/><a id="delete-media-query-'+i+'" href="#" class="delete ai-delete">Delete</a>'),a.preventDefault(),!1}),jQuery(document).on("click",".mq-breakpoint-show_part_of_iframe_media_query a",function(a){return jQuery(this).parent().remove(),aiUpdateHeightHiddenFieldMediaQuery("show_part_of_iframe_media_query"),a.preventDefault(),!1}),jQuery(document).on("click","a#add-media-query-show_part_of_iframe_media_query",function(a){var i=jQuery(".mq-breakpoint-show_part_of_iframe_media_query").length+1;return jQuery(this).parent().append('<div id="breakpoint-row-show_part_of_iframe_media_query-'+i+'" class="mq-breakpoint-show_part_of_iframe_media_query">x: <input type="text" id="ai-x-show_part_of_iframe_media_query-'+i+'" class="media-query-input" onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="x"/> y: <input type="text" id="ai-y-show_part_of_iframe_media_query-'+i+'" class="media-query-input" onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="y"/> w: <input type="text" id="ai-w-show_part_of_iframe_media_query-'+i+'" class="media-query-input" onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="width"/> h: <input type="text" id="ai-h-show_part_of_iframe_media_query-'+i+'" class="media-query-input" onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="height"/> iframe width: <input type="text" id="ai-i-show_part_of_iframe_media_query-'+i+'" class="media-query-input" style="width:100px;" onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="iframe width"/> Breakpoint: <input type="text" id="ai-breakpoint-show_part_of_iframe_media_query-'+i+'" class="media-query-input" style="width:130px;" onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="Insert breakpoint"/><a id="delete-media-query-show_part_of_iframe_media_query-'+i+'" href="#" class="delete ai-delete">Delete</a>'),a.preventDefault(),!1})}function aiCheckHeightNumber(a,i){aiCheckInputNumber(a),aiUpdateHeightHiddenField(i)}function aiCheckHeightNumberMediaQuery(a,i){aiCheckInputNumber(a),aiUpdateHeightHiddenFieldMediaQuery(i)}function aiUpdateHeightHiddenField(a){var i=jQuery("#ai-"+a+"-0").val(),t=[];jQuery(".mq-breakpoint-"+a).each(function(a){var i=jQuery(this).children().eq(0).val(),o=jQuery(this).children().eq(1).val();""!==i&&""!==o&&t.push({heightChild:i,breakpointChild:o})}),t.sort(function(a,i){return i.breakpointChild-a.breakpointChild});let o=i;t.forEach(function(a){o+=","+a.heightChild+"|"+a.breakpointChild}),jQuery("#"+a).val(o);let r=jQuery("#description-"+a).html().split("Shortcode attribute: ")[0];jQuery("#description-"+a).html(r+"Shortcode attribute: "+a+'="'+o+'"')}function aiUpdateHeightHiddenFieldMediaQuery(a){var i=[];jQuery(".mq-breakpoint-"+a).each(function(a){var t=jQuery(this).children().eq(0).val(),o=jQuery(this).children().eq(1).val(),r=jQuery(this).children().eq(2).val(),n=jQuery(this).children().eq(3).val(),l=jQuery(this).children().eq(4).val(),s=jQuery(this).children().eq(5).val();(""!==t||""!==o||""!==r||""!==n||""!==l)&&""!==s&&i.push({mediaX:t,mediaY:o,mediaW:r,mediaH:n,mediaIW:l,breakpointChild:s})}),i.sort(function(a,i){return i.breakpointChild-a.breakpointChild});let t="";i.forEach(function(a){t+=","+a.mediaX+"|"+a.mediaY+"|"+a.mediaW+"|"+a.mediaH+"|"+a.mediaIW+"|"+a.breakpointChild}),t=t.replace(/(^,)|(,$)/g,""),jQuery("#"+a).val(t);let o=jQuery("#description-"+a).html().split("Shortcode attribute: ")[0];jQuery("#description-"+a).html(o+"Shortcode attribute: "+a+'="'+t+'"')}function aiSettingsSearch(a,i){var t=0;""!==a?(jQuery("#ai p").not(".form-table p").hide(),jQuery("#ai ul").not(".form-table ul").hide(),jQuery("#ai ol").not(".form-table ol").hide(),"false"!==i&&(jQuery("#ai h1").not(".show-always").hide(),jQuery("#ai #accordion").attr("id","acc"),jQuery("#ai #acc > div").show(),jQuery("#ai #spacer-div").show()),jQuery("#ai h2,#ai .icon_ai,#ai h3,#ai h4").not(".show-always").hide(),jQuery("#ai .form-table").addClass("ai-remove-margin"),jQuery("#ai hr, .signup_account_container, .config-file-block").hide(),jQuery("#ai .hide-always").hide(),jQuery("#ai .hide-search").hide(),jQuery("#ai .postbox-container").not(".show-always").hide(),jQuery("#ai .show-always p").show(),jQuery("#ai .show-always ul").show(),jQuery("#ai .show-always ol").show(),jQuery("#ai .show-always h2,#ai .show-always .icon_ai,#ai .show-always h3,#ai .show-always h4").show()):(jQuery("#ai p").not(".form-table p").show(),jQuery("#ai section .ai-anchor").show(),jQuery("#ai ul").not(".form-table ul").show(),jQuery("#ai ol").not(".form-table ol").show(),"false"!==i&&(jQuery("#ai h1").not(".show-always").show(),jQuery("#ai #acc").attr("id","accordion"),jQuery("#ai #accordion > div").hide(),jQuery("#ai #spacer-div").hide()),jQuery("#ai h2,#ai .icon_ai,#ai h3,#ai h4").not(".show-always").show(),jQuery("#ai .form-table").removeClass("ai-remove-margin"),jQuery("#ai hr, .signup_account_container, .config-file-block").show(),jQuery("#ai .sub-domain-container").show(),jQuery("#ai .hide-search").show(),jQuery("#ai .hide-always").hide(),jQuery("#ai .postbox-container").show(),setTimeout(function(){jQuery("#ai .postbox-container .closed .inside").css("display","")},5)),jQuery("#ai .mark-tab-header").removeClass("mark-tab-header");var o="";if(jQuery("#ai tr").each(function(){var i=jQuery(this),r=i.find("th").text(),n=i.find("p.description").text();if(r=void 0!==r?r.toLowerCase():"XXXXXXX",n=void 0!==n?n.toLowerCase():"XXXXXXX",-1===r.indexOf(a)&&-1===n.indexOf(a))0==i.parents(".show-always").length&&i.addClass("hide-setting");else{if(i.closest("table").prevAll("h2:first").show(),i.closest(".postbox-container").show(),i.closest(".postbox-container").find("h2, .inside").show(),i.closest("table").prevAll("#ai .icon_ai:first").show(),i.closest("table").nextAll("p.button-submit:first").show(),i.removeClass("hide-setting"),i.closest(".hide-search").show(),a.length>2){var l=i.closest("section").attr("class");void 0!==l&&(jQuery("#"+l).addClass("mark-tab-header"),""===o&&(o=l))}t++}}),0===t)jQuery("#ai-input-search-result").show(),jQuery("#ai .mark-tab-header").removeClass("mark-tab-header");else{if(jQuery("#ai-input-search-result").hide(),aiInstance&&aiInstance.revert(),""!==a&&a.length>2){var r=RegExp(a,"gi");aiInstance=findAndReplaceDOMText(document.getElementById("tab_wrapper"),{find:r,wrap:"em"})}jQuery("#"+o).click()}}function aiResizeIframeRatio(a,i){aiDebugExtended("aiResizeIframeRatio");var t,o=Math.ceil(jQuery("#"+a.id).width()*parseFloat(i.replace(",",".")));a.height=o,a.style.height=o+"px"}function aiGenerateShortcode(a){var i="[advanced_iframe ";""!==jQuery("#securitykey").val()&&(i+='securitykey="'+jQuery("#securitykey").val()+'" '),i+='use_shortcode_attributes_only="true" ';var t=jQuery("#include_html").val(),o=jQuery("#include_url").val(),r=jQuery("#document_domain_add").val();if(void 0===t||""===t&&""===o){var n=jQuery("#src").val();""===n?alert("Required url is missing."):i+='src="'+n+'" ',i+=aiGenerateTextShortcode("src_hide"),i+=aiGenerateTextShortcode("width"),i+=aiGenerateTextShortcode("height"),i+=aiGenerateRadioShortcode("scrolling","none"),i+=aiGenerateRadioShortcode("add_surrounding_p","false"),i+=aiGenerateRadioShortcode("enable_ios_mobile_scolling","false"),i+=aiGenerateTextShortcode("marginwidth"),i+=aiGenerateTextShortcode("marginheight"),i+=aiGenerateTextShortcode("frameborder"),i+=aiGenerateRadioShortcode("transparency","true"),i+=aiGenerateTextShortcode("class"),i+=aiGenerateTextShortcode("style"),i+=aiGenerateTextShortcodeWithDefault("id","advanced_iframe"),i+=aiGenerateTextShortcode("name"),i+=aiGenerateRadioShortcode("allowfullscreen","false"),i+=aiGenerateTextShortcode("safari_fix_url"),i+=aiGenerateTextShortcode("sandbox"),i+=aiGenerateTextShortcode("title"),i+=aiGenerateTextShortcode("allow"),i+=aiGenerateRadioShortcode("loading","lazy"),i+=aiGenerateTextShortcode("referrerpolicy"),i+=aiGenerateTextShortcode("custom"),i+=aiGenerateTextShortcode("url_forward_parameter"),i+=aiGenerateTextShortcode("map_parameter_to_url"),i+=aiGenerateRadioShortcode("add_iframe_url_as_param","false"),i+=aiGenerateTextShortcode("add_iframe_url_as_param_prefix"),i+=aiGenerateRadioShortcode("add_iframe_url_as_param_direct","false"),i+=aiGenerateRadioShortcode("use_iframe_title_for_parent","false"),i+=aiGenerateRadioShortcode("onload_scroll_top","false"),i+=aiGenerateRadioShortcode("hide_page_until_loaded","false"),i+=aiGenerateRadioShortcode("show_iframe_loader","false"),i+=aiGenerateTextShortcode("hide_content_until_iframe_color"),i+=aiGenerateTextShortcode("iframe_zoom"),i+=aiGenerateRadioShortcode("iframe_zoom_ie8","false"),i+=aiGenerateRadioShortcode("use_zoom_absolute_fix","false"),i+=aiGenerateRadioShortcode("auto_zoom","false"),i+=aiGenerateTextShortcode("auto_zoom_by_ratio"),i+=aiGenerateRadioShortcode("enable_responsive_iframe","false"),i+=aiGenerateTextShortcode("iframe_height_ratio"),i+=aiGenerateRadioShortcode("enable_lazy_load","false"),i+=aiGenerateTextShortcodeWithDefault("enable_lazy_load_threshold","3000"),i+=aiGenerateRadioShortcode("enable_lazy_load_reserve_space","true"),i+=aiGenerateTextShortcode("enable_lazy_load_fadetime"),i+=aiGenerateRadioShortcode("enable_lazy_load_manual","false"),i+=aiGenerateRadioShortcode("enable_lazy_load_manual_element","false"),i+=aiGenerateTextShortcode("reload_interval"),i+=aiGenerateTextShortcode("hide_elements"),i+=aiGenerateTextShortcode("content_id"),i+=aiGenerateTextShortcode("content_styles"),i+=aiGenerateTextShortcode("parent_content_css"),i+=aiGenerateRadioShortcode("add_css_class_parent","false"),i+=aiGenerateTextShortcode("change_parent_links_target"),i+=aiGenerateRadioShortcode("show_iframe_as_layer","false"),i+=aiGenerateRadioShortcode("show_iframe_as_layer_full","false"),i+=aiGenerateTextShortcode("show_iframe_as_layer_autoclick_delay"),i+=aiGenerateTextShortcode("show_iframe_as_layer_autoclick_hide_time"),i+=aiGenerateTextShortcode("show_iframe_as_layer_header_file"),i+=aiGenerateTextShortcodeWithDefault("show_iframe_as_layer_header_height","100"),i+=aiGenerateRadioShortcode("show_iframe_as_layer_header_position","top"),i+=aiGenerateRadioShortcode("show_iframe_as_layer_keep_content","true");var l=aiGenerateRadioShortcode("show_part_of_iframe","false");i+=l,""!==l&&(i+=aiGenerateTextShortcodeWithDefault("show_part_of_iframe_x",-1),i+=aiGenerateTextShortcodeWithDefault("show_part_of_iframe_y",-1),i+=aiGenerateTextShortcode("show_part_of_iframe_width"),i+=aiGenerateTextShortcode("show_part_of_iframe_height"),i+=aiGenerateTextShortcode("show_part_of_iframe_media_query"),i+=aiGenerateRadioShortcode("show_part_of_iframe_allow_scrollbar_horizontal","false"),i+=aiGenerateRadioShortcode("show_part_of_iframe_allow_scrollbar_vertical","false"),i+=aiGenerateTextShortcode("show_part_of_iframe_style"),i+=aiGenerateRadioShortcode("show_part_of_iframe_zoom","false"),i+=aiGenerateTextShortcode("show_part_of_iframe_next_viewports"),i+=aiGenerateRadioShortcode("show_part_of_iframe_next_viewports_loop","false"),i+=aiGenerateTextShortcode("show_part_of_iframe_new_window"),i+=aiGenerateTextShortcode("show_part_of_iframe_new_url"),i+=aiGenerateRadioShortcode("show_part_of_iframe_next_viewports_hide","false")),i+=aiGenerateTextShortcode("hide_part_of_iframe"),i+=aiGenerateRadioShortcode("fullscreen_button","false"),i+=aiGenerateTextShortcode("fullscreen_button_hide_elements"),i+=aiGenerateRadioShortcode("fullscreen_button_full","false"),i+=aiGenerateRadioShortcode("fullscreen_button_style","black"),i+=aiGenerateRadioShortcode("add_css_class_iframe","false"),i+=aiGenerateTextShortcode("iframe_hide_elements"),i+=aiGenerateTextShortcode("onload_show_element_only"),i+=aiGenerateTextShortcode("iframe_content_id"),i+=aiGenerateTextShortcode("iframe_content_styles"),i+=aiGenerateTextShortcode("iframe_content_css"),i+=aiGenerateTextShortcode("change_iframe_links"),i+=aiGenerateTextShortcode("change_iframe_links_target"),i+=aiGenerateTextShortcode("change_iframe_links_href"),i+=aiGenerateTextShortcode("onload"),i+=aiGenerateRadioShortcode("onload_resize","false"),i+=aiGenerateTextShortcode("onload_resize_delay"),i+=aiGenerateRadioShortcode("store_height_in_cookie","false"),i+=aiGenerateTextShortcode("additional_height"),i+=aiGenerateRadioShortcode("onload_resize_width","false"),i+=aiGenerateTextShortcode("resize_on_ajax"),i+=aiGenerateRadioShortcode("resize_on_ajax_jquery","true"),i+=aiGenerateTextShortcode("resize_on_click"),i+=aiGenerateTextShortcodeWithDefault("resize_on_click_elements","a"),i+=aiGenerateTextShortcode("resize_on_element_resize"),i+=aiGenerateTextShortcodeWithDefault("resize_on_element_resize_delay","250"),i+=aiGenerateTextShortcode("tab_hidden"),i+=aiGenerateTextShortcode("tab_visible"),i+=aiGenerateRadioShortcode("add_document_domain","false"),"true"===r&&(i+=aiGenerateTextShortcode("document_domain")),i+=aiGenerateRadioShortcode("enable_external_height_workaround","external"),i+=aiGenerateRadioShortcode("hide_page_until_loaded_external","false"),i+=aiGenerateTextShortcode("pass_id_by_url"),i+=aiGenerateRadioShortcode("multi_domain_enabled","true"),"true"===a?i+=aiGenerateRadioShortcode("use_post_message","true"):i+=aiGenerateRadioShortcode("use_post_message","false"),i+=aiGenerateTextShortcode("additional_css"),i+=aiGenerateTextShortcode("additional_js"),i+=aiGenerateTextShortcode("additional_js_file_iframe"),i+=aiGenerateTextShortcode("additional_css_file_iframe")}else""===t?(i+=aiGenerateTextShortcode("include_url"),i+=aiGenerateTextShortcode("include_content"),i+=aiGenerateTextShortcode("include_height"),i+=aiGenerateTextShortcode("include_fade"),i+=aiGenerateRadioShortcode("include_hide_page_until_loaded","false")):i+=aiGenerateTextShortcode("include_html");i+=aiGenerateRadioShortcode("debug_js","false"),i=i.slice(0,-1),i+="]",jQuery("#gen-shortcode").html(i)}function aiGenerateTextShortcodeWithDefault(a,i){var t="",o=jQuery("#"+a),r=o.val();return o.length>0&&""!==r&&r!==i&&(t=a+'="'+r+'" '),t}function aiGenerateTextShortcode(a){var i="",t=jQuery("#"+a),o=t.val();return t.length>0&&""!==o&&"0"!==o&&(i=a+'="'+o+'" '),i}function aiGenerateRadioShortcode(a,i){var t="",o=jQuery("input:radio[name="+a+"]:checked"),r=o.val();return"enable_ios_mobile_scolling"===a&&(a="enable_ios_mobile_scrolling"),o.length>0&&r!==i&&(t+=a+'="'+r+'" '),t}function aiAddCssClassAllParents(a){for(var i=jQuery(a).parentsUntil("html"),t="ai-class-",o=0;o<i.length;o++){var r=jQuery(i[o]).attr("id");void 0!==r?0!==r.indexOf("ai-")&&jQuery(i[o]).addClass(t+r):jQuery(i[o]).addClass(t+o)}}function aiAutoZoomExternalHeight(a,i,t,o){aiDebugExtended("aiAutoZoomExternalHeight");var r=aiAutoZoomExternal(a,i,o),n=window["zoom_"+a],l=jQuery(document).scrollTop();return jQuery("#ai-zoom-div-"+a).css("height",Math.ceil(t*n)),jQuery("html,body").scrollTop(l),r}function aiAutoZoomExternal(a,i,t){aiDebugExtended("aiAutoZoomExternal");var o=document.getElementById(a),r=document.getElementById("ai-zoom-div-"+a),n=jQuery("#"+a);"true"===t&&n.css("max-width","100%");var l=i,s=aiGetParentIframeWidth(o);s===l&&(s=aiGetParentIframeWidth(r));var d=Math.floor(100*(s/l))/100;return d>1&&(d=1),aiSetZoom(a,d),window["zoom_"+a]=d,n.width(l).css("max-width","none"),s}function aiAutoZoom(a,i,t){aiDebugExtended("aiAutoZoom");var o,r=t.split("|");t=r[0];var n=-1;1!==r.length&&(n=r[1]);var l=document.getElementById(a);-1===n?(l.width=1,l.style.width="1px",o=aiGetIframeWidth(l),l.width=o,l.style.width=o+"px"):o=n;var s=aiAutoZoomExternal(a,o,i);if(""===t)aiResizeIframe(l,!1);else{var d=Math.ceil(o*t);if(l.height=d,l.style.height=d+"px",0!==jQuery("#ai-zoom-div-"+l.id).length){var c=window["zoom_"+l.id];jQuery("#ai-zoom-div-"+l.id).css("height",Math.ceil(d*c))}}return s}function aiSetZoom(a,i){var t=jQuery("#"+a);!0===aiIsIe8&&t.css("-ms-zoom",i),t.css({"-ms-transform":"scale("+i+")","-moz-transform":"scale("+i+")","-o-transform":"scale("+i+")","-webkit-transform":"scale("+i+")",transform:"scale("+i+")"})}function aiAutoZoomViewport(a,i){for(var t=jQuery(a),o=t.parent(),r=0;o.is("p")||void 0!==o.attr("id")&&0===o.attr("id").indexOf("ai-");)if(o=o.parent(),r++>10){alert("Unexpected div structure. Please disable the zoom.");break}var n=t.width(),l=o.width(),s=t.height(),d=l/n;"true"===i&&d>1&&(d=1),aiSetZoom(t.attr("id"),d);var c=-Math.round((n-n*d)/2),h=-Math.round((s-s*d)/2);t.css({"margin-left":c+"px","margin-right":c+"px","margin-top":h+"px","margin-bottom":h+"px"})}function aiResetAiSettings(){jQuery("#action").val("reset")}function aiCheckInputNumber(a){a.value=a.value.split(" ").join("");var i=a.value;""!==a.value&&(i.match(/^(\-){0,1}([\d.])+(px|%|em|pt|vh|vw|rem|ch)?(\-|\+){0,1}([\d.]){0,7}(px|%|em|pt|vh|vw|rem|ch)?$/)||(alert("Please check the value you have entered. Only numbers with a dot or with an optional px, %, em or pt are allowed."),setTimeout(function(){a.focus()},10)))}function aiCheckInputPurchaseCode(a){a.value=a.value.split(" ").join("");var i=a.value;""!==a.value&&(i.match(/^([a-f0-9]{8})-(([a-f0-9]{4})-){3}([a-f0-9]{12})$/i)||(alert("Please check the value you have entered. Your input seems not to be a valid purchase code."),a.value="",setTimeout(function(){a.focus()},10)))}function aiCheckInputNumberOnly(a){a.value=a.value.split(" ").join("");var i=a.value;if(""===a.value){a.value="0";return}i.match(/^(\-){0,1}([\d.])+$/)||(alert("Please check the value you have entered. Only numbers without a dot or optional px, %, em or pt are allowed."),setTimeout(function(){a.focus()},10))}function aiShowHeader(a,i){var t=jQuery(window).scrollTop();jQuery(window).scrollTop(t-40),void 0!==i&&aiFlashElement(i)}function aiFlashElement(a){setTimeout(function(){jQuery("#"+a).css("background-color","#eee")},500),setTimeout(function(){jQuery("#"+a).css("background-color","#fff")},900),setTimeout(function(){jQuery("#"+a).css("background-color","#eee")},1300),setTimeout(function(){jQuery("#"+a).css("background-color","#fff")},1700)}function aiSetScrollposition(){var a=jQuery(document).scrollTop();jQuery("#scrollposition").val(a)}function aiResetShowPartOfAnIframe(a){jQuery("#"+a).css("top","0px").css("left","0px").css("position","static"),jQuery("#ai-div-"+a).css("width","auto").css("height","auto").css("overflow","auto").css("position","static")}function aiShowLayerIframe(a,i,t,o,r,n){aiDebugExtended("aiShowLayerIframe"),r=void 0!==r&&r,n=void 0===n||n;var l="#"+i;jQuery("#ai-zoom-div-"+i).show(),jQuery("#ai-zoom-div-"+i).css("visibility","visible"),jQuery(l).show(),jQuery(l).css("visibility","visible"),jQuery("#ai-layer-div-"+i).length&&(jQuery(l="#ai-layer-div-"+i).show(),jQuery(l).css("visibility","visible")),jQuery("body").css("overflow","hidden"),jQuery("html").css("overflow-y","visible"),jQuery("body").append('<img id="ai_backlink" src="'+t+'close.png" style="z-index:100005;position:fixed;top:0;right:0;cursor:pointer" />');var s="<!-- -->";n&&"true"===o&&(s='<div id="ai-div-loader-global" style="position: fixed;z-index:100004;margin-left:-33px;left: 50%;top:50%;margin-top:-33px"><img src="'+t+'loader.gif" width="66" height="66" title="Loading" alt="Loading"></div>'),0===jQuery("#ai_backlayer").length&&jQuery(l).parent().append('<div id="ai_backlayer" style="z-index:100001;position:fixed;top:0;left:0;width:100%;height:100%;background-color: rgba(50,50,50,0.5);overflow:hidden;cursor:pointer"><!-- --></div>'+s),jQuery("#ai_backlink, #ai_backlayer").click(function(){aiHideLayerIframe(i,r)}),n||(a.preventDefault(),a.stopPropagation())}function aiHideLayerIframe(a,i){aiDebugExtended("aiHideLayerIframe"),jQuery("#"+a).css("visibility","hidden"),i||(jQuery("#"+a).attr("src","about:blank"),aiLayerIframeHrefs[a]="about:blank"),jQuery("#ai-zoom-div-"+a).css("visibility","hidden"),jQuery("#ai-layer-div-"+a).css("visibility","hidden"),jQuery("#ai_backlink").remove(),jQuery("#ai_backlayer").remove(),jQuery("#ai-div-loader-global").remove(),jQuery("body").css("overflow","auto"),jQuery("html").css("overflow-y","scroll")}var aiLayerIframeHrefs=[];function aiCheckReload(a,i){t=void 0===aiLayerIframeHrefs[i]?jQuery("#"+i).attr("src"):aiLayerIframeHrefs[i];var t,o=jQuery(a).attr("href");return aiLayerIframeHrefs[i]=o,t!==o}function aiChangeTitle(a){aiDebugExtended("aiChangeTitle");try{var i=document.getElementById(a).contentDocument.title;null!==i&&"undefined"!==i&&""!==i&&(document.title=i)}catch(t){console&&console.error&&(console.error("Advanced iframe configuration error: You have enabled to add the title if the iframe to the parent on the same domain. But you use an iframe page on a different domain. You need to use the pro version of the external workaround like described in the settings. Also check the next log. There the browser message for this error is displayed."),console.log(t))}}function aiChangeUrlParam(a,i,t,o,r){aiDebugExtended("aiChangeUrlParam");var n,l=!1;if(-1!==t.lastIndexOf("//",0)&&(t=location.protocol+t),a!==encodeURIComponent(t)){n=aiSetGetParameter(i,a);var s=!0;if(o.startsWith("hash"))return aiGetUrlMapping(a,i,o);if(o){var d=n.replace(o,"");d===n&&(s=!1),n=d}if(s&&(n=n.replace("http%3A%2F%2F",""),n=-1!==window.location.href.toLowerCase().lastIndexOf("http:",0)?n.replace("https%3A%2F%2F","s|"):n.replace("https%3A%2F%2F","")),r){var n=aiRemoveQueryString(window.location.href),c=decodeURIComponent(a),h=c.indexOf("?");-1!==h&&(n+="?"+c.slice(h+1),l=!0)}aiEndsWidth(n,i+"=")&&(n=aiRemoveURLParameter(n,i))}else{var f=window.location.href;n=aiRemoveURLParameter(f=f.split("/"+i+"/",1)[0],i)}aiSetBrowserUrl(n,l)}function aiGetUrlMappingUrl(a,i,t){var o,r=aiRemoveURLParameter(window.location.href,a=a.replace(":short",""));if(i.startsWith("hashrewrite")){var n="";if(r.indexOf("?")>=0){var l=r.split("?");r=l[0],n="?"+l[1]}var s=r.split("/"+a+"/",1)[0];aiEndsWidth(s,"/")||(s+="/"),r=s+(a+"/")+t+n}else{var d=r.indexOf("?")>=0?"&":"?";r+=d+a+"="+t}return r}function aiSetBrowserUrl(a,i){aiSupportsHistoryApi()&&(i||(a=a.replace(/%2F/g,"/")),window.history.pushState({},"",a),window.onpopstate=function(a){a&&a.state&&window.history.back()})}function aiRemoveQueryString(a){return a.indexOf("%3F")>=0?a.split("%3F")[0]:a.indexOf("?")>=0?a.split("?")[0]:a}function aiGetUrlMapping(a,i,t){var o={action:"aip_map_url_action",security:MyAjax.security,url:a};jQuery.post(MyAjax.ajaxurl,o,function(a){aiSetBrowserUrl(aiGetUrlMappingUrl(i,t,a),!1)})}function closeInfoPermanent(a){var i={action:"aip_close_message_permanent",security:MyAjax.security,id:a},t="The message before will only appear again when you reset the advanced iframe settings.";"show-discount-message"===a?t="The message of advanced iframe shown before will only appear again when you reset the advanced iframe settings or a new discount is available.":"show-registration-message"===a&&(t="The message will appear again until have entered your purchase code."),jQuery.post(MyAjax.ajaxurl,i,function(a){jQuery("h1").after('<div class="message-notice notice notice-success"><p>'+t+"</p></div>")}),setTimeout(function(){jQuery(".message-notice").fadeOut()},4e3)}function aiSupportsHistoryApi(){return!!(window.history&&history.pushState)}function aigetIframeLocation(a){try{var i=document.getElementById(a).contentWindow.location;return encodeURIComponent(i)}catch(t){console&&console.error&&(console.error("Advanced iframe configuration error: You have enabled to add the url to the url on the same domain. But you use an iframe page on a different domain. You need to use the pro version of the external workaround like described in the settings. Also check the next log. There the browser message for this error is displayed."),console.log(t))}}function aiSetGetParameter(a,i){var t=window.location.href,o=t.split("#");t=o[0];var r=void 0===o[1]?"":"#"+o[1];if(t.indexOf(a+"=")>=0){var n=t.substring(0,t.indexOf(a+"=")),l=t.substring(t.indexOf(a+"="));t=n+a+"="+i+(l=(l=l.substring(l.indexOf("=")+1)).indexOf("&")>=0?l.substring(l.indexOf("&")):"")}else 0>t.indexOf("?")?t+="?"+a+"="+i:t+="&"+a+"="+i;return t+r}function aiRemoveURLParameter(a,i){var t=a.split("?");if(!(t.length>=2))return a;for(var o=encodeURIComponent(i)+"=",r=t[1].split(/[&;]/g),n=r.length;n-- >0;)-1!==r[n].lastIndexOf(o,0)&&r.splice(n,1);return a=0!==r.length?t[0]+"?"+r.join("&"):t[0]}function aiEndsWidth(a,i){return a.substr(-i.length)===i}function aiAddCss(a,i){i=decodeURIComponent(i.replace(/\+/g,"%20"));var t=jQuery(a).contents().find("body"),o=document.createElement("style");o.setAttribute("type","text/css"),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(document.createTextNode(i)),t.append(o)}function aiAddCssFile(a,i){var t=jQuery(a).contents().find("body"),o=document.createElement("link");o.rel="stylesheet",o.type="text/css",o.href=i,t.append(o)}function aiAddJsFile(a,i){jQuery.ajaxSetup({cache:!0});var t=jQuery(a).contents().find("body"),o=document.createElement("script");o.type="text/javascript",o.src=i,t.append(o)}function aiPresetFullscreen(){jQuery("#style").val("position:fixed;z-index:9000;top:0px;left:0px;margin:0px"),jQuery("#width").val("100%"),jQuery("#ai-height-0").val("100%"),jQuery("#content_id").val("html,body"),jQuery("#content_styles").val("overflow:hidden"),jQuery("#hide_content_until_iframe_color").val("#ffffff")}function aiDisableCheckIframes(){var a=jQuery("<input>").attr("type","hidden").attr("name","checkIframes").val("true");jQuery("#ai_form").append(a),jQuery("#ai_form").submit(),jQuery("#checkIframes").prop("disabled","disabled")}function aiProcessMessage(a,i,t){var o;try{var o=JSON.parse(a.data)}catch(r){"debug"===t&&console&&console.log&&(console.log("Advanced iframe: The received message cannot be parsed and seems not to belong to advanced iframe pro. Please disable the postMessage debug mode if this o.k. and that this message is not shown anymore."),console.log("Advanced iframe: Unknown event: ",a));var o=a.data}try{if(o.hasOwnProperty("aitype")&&i===o.id){var n=o.aitype;if("debug"===n)aiProcessDebug(o);else if("scrollToTop"===n)aiProcessScrollToTop(o);else if("anchor"===n)aiProcessAnchor(o);else for(var l in"height"===n?aiProcessHeight(o):"show"===n&&aiProcessShow(o),o.data)o.data.hasOwnProperty(l)&&jQuery(l).html(o.data[l])}}catch(s){"debug"===t&&console&&console.log&&(console.log("Advanced iframe: The received message do not belong to advanced iframe pro. Please disable the postMessage debug mode if this o.k. and that this message is not shown anymore."),console.log(s))}}function aiProcessDebug(a){var i=a.data;0!==jQuery("#aiDebugDiv").length&&(i=(i=i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")).replace('"','"').replace(/\\/g,""),jQuery("#aiDebugDiv").append('<p class="ai-debug-remote"> r: '+i+"</p>"))}function aiProcessScrollToTop(a){aiScrollToTop(a.id,aiOnloadScrollTop)}function aiProcessAnchor(a){var i=a.id,t=parseInt(a.position,10),o=jQuery("#"+i).offset().top;setTimeout(function(){jQuery("html,body").scrollTop(Math.round(o+t))},100)}function aiProcessHeight(a){var i=a.height,t=a.width,o=parseInt(a.anchor,10),r=a.id;if(null!=i)try{var n=a.loc;null==n||n.includes("send_console_log")||"function"!=typeof aiChangeUrl||aiChangeUrl(n);var l=a.title;if(null!=l&&"undefined"!=l&&""!=l&&(document.title=decodeURIComponent(l)),null!=r){var s=parseInt(i,10),d=parseInt(t,10);if(aiResizeIframeHeightId(s,d,r),!isNaN(o)&&o>-1){var c=jQuery("#"+r).offset().top;setTimeout(function(){jQuery("html,body").scrollTop(Math.round(c+o)),aiShowIframeId(r)},100)}else aiShowIframeId(r)}else alert("Please update the ai_external.js to the current version.")}catch(h){console&&console.log&&console.log(h)}}function aiProcessShow(a){var i=a.id;try{aiShowIframeId(i)}catch(t){console&&console.log&&console.log(t)}}function aiDisableRightClick(a){try{window.frames[a].document.oncontextmenu=function(){return!1}}catch(i){}}function aiRemoveElementsFromHeight(a,i,t){for(var o=jQuery("#"+a),r=t.split(","),n=0,l=0;l<r.length;l++)try{var s=r[l];if(s.includes("|")){var d=s.split("|"),c=jQuery(d[0]),h=Math.round(c.offset().top+c.outerHeight(!0)),f=Math.round(jQuery(d[1]).offset().top);n+=f-h}else"top"===s?n+=Math.round(jQuery("#"+a).offset().top):isNaN(s)?n+=jQuery(s).outerHeight(!0):n+=parseInt(s)}catch(u){console&&console.error&&(console.error('Advanced iframe configuration error: The configuration of remove_elements_from_height "'+t+'" is invalid. Please check if the elements you defined do exist and ids/classes are defined properly.'),console.log(u))}var p="calc("+i+" - "+n+"px)";o.css("height",p)}function aiTriggerAutoOpen(a,i,t,o){aiDebugExtended("aiTriggerAutoOpen"),0===t?aiOpenIframeOnClick(a,i):setTimeout(function(){aiOpenIframeOnClick(a,i)},t);var r=new Date,n=r.getTime();r.setTime(n+864e5*o);var l=i.replace(/[^A-Za-z0-9\-]/g,"");document.cookie="ai_disable_autoclick_iframe_"+l+"=Auto open is disabled until this cookie expires;expires="+r.toUTCString()+";path=/"}function aiCheckAutoOpenHash(a,i,t){if(window.location.hash){var o=window.location.hash.replace(/[^A-Za-z0-9\-]/g,"");0!==jQuery(o="#"+o).length&&jQuery(o).first().attr("target")==a&&aiTriggerAutoOpen(a,o,i,t)}}function aiOpenIframeOnClick(a,i){var t=jQuery(i).first().attr("href");jQuery("#"+a).attr("src",t),jQuery(i).first().click()}jQuery(document).ready(function(){aiDebugExtended("document.ready called"),jQuery("iframe").parent("p").css("margin","0"),aiWindowWidth=jQuery(window).width(),jQuery.each(aiReadyCallbacks,function(a,i){i()}),jQuery(".ai-fullscreen-open").on("click",function(){jQuery(this).closest(".ai-wrapper-div").addClass("ai-fullscreen-wrapper"),jQuery(this).closest(".ai-wrapper-div").find("iframe").addClass("ai-fullscreen"),jQuery(".ai-fullscreen-open").hide(),jQuery(".ai-fullscreen-hide").addClass("ai-fullscreen-display-none"),jQuery(".ai-fullscreen-hide").hide(),jQuery("html,body").css("overflow","hidden");var a=jQuery(this).data("id");jQuery(".ai-fullscreen-close-"+a).show(),jQuery(document).on("keydown",function(a){"Escape"==a.key&&jQuery(".ai-fullscreen-close").trigger("click")}),aiOpenFullscreen(),aiInFullscreen=!0}),jQuery(".ai-fullscreen-close").on("click",function(){jQuery("div.ai-wrapper-div").removeClass("ai-fullscreen-wrapper"),jQuery("iframe.ai-fullscreen").removeClass("ai-fullscreen"),jQuery("html").css("overflow",aiOverflowHtml),jQuery("body").css("overflow",aiOverflowBody),jQuery(".ai-fullscreen-close").hide(),jQuery(".ai-fullscreen-open").show(),jQuery(".ai-fullscreen-display-none").removeClass("ai-fullscreen-display-none"),jQuery(".ai-fullscreen-hide").show(),jQuery(document).off("keydown"),aiInFullscreen&&aiCloseFullscreen()}),setTimeout(function(){jQuery("#ai #ai-updated-text").css("visibility","hidden")},4e3),jQuery("#ai #checkIframes").on("click",function(){jQuery(".ai-spinner").css("display","inline-table"),jQuery(this).addClass("disabled"),setTimeout(aiDisableCheckIframes,200)});var a=!1;if(jQuery("#aiDebugDivTotal").mousedown(function(){a=!1}).mousemove(function(){a=!0}).mouseup(function(i){if(!a){var t=jQuery("#aiDebugDiv");Math.floor(t.height())>"300"?t.height("0px"):t.height("400px")}}),"undefined"!=typeof ai_show_id_only){if(0===jQuery("#"+ai_show_id_only).length)alert('The element with the id "'+ai_show_id_only+'" cannot be found. Please check your configuration.');else{var i=jQuery("#"+ai_show_id_only);i.siblings().hide();var t=i.parents();if(t.siblings().hide(),t.css("padding","0px").css("margin","0px").css("overflow","hidden"),parent===top){var o=i[0];o.style.marginTop=o.style.marginBottom=0,o.style.overflow="hidden";var r=JSON.stringify({aitype:"height",height:parseInt(Math.max(o.scrollHeight,o.offsetHeight),10),id:ai_show_id_only});window.parent.postMessage(r,"*")}}}jQuery("#ai #checkIframes").on("click",function(){jQuery(".ai-spinner").css("display","inline-table"),jQuery(this).addClass("disabled"),setTimeout(aiDisableCheckIframes,200)})}),String.prototype.includes||(String.prototype.includes=function(a,i){return"number"!=typeof i&&(i=0),!(i+a.length>this.length)&&-1!==this.indexOf(a,i)}),String.prototype.startsWith||(String.prototype.startsWith=function(a,i){return i=i||0,this.indexOf(a,i)===i});var elem=document.documentElement;function aiOpenFullscreen(){aiRealFullscreen&&(elem.requestFullscreen?elem.requestFullscreen():elem.webkitRequestFullscreen?elem.webkitRequestFullscreen():elem.msRequestFullscreen&&elem.msRequestFullscreen())}function aiCloseFullscreen(){aiRealFullscreen&&(document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen())}function aiExitHandler(){document.fullscreenElement||document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||(aiInFullscreen=!1,jQuery(".ai-fullscreen-close").trigger("click"))}document.addEventListener("fullscreenchange",aiExitHandler),document.addEventListener("webkitfullscreenchange",aiExitHandler),document.addEventListener("mozfullscreenchange",aiExitHandler),document.addEventListener("MSFullscreenChange",aiExitHandler); -
advanced-iframe/trunk/readme.txt
r3027702 r3042304 4 4 Tags: iframe, embed, resize, zoom, content, advanced, shortcode, modify css, widget 5 5 Requires at least: 3.3 6 Tested up to: 6.4. 27 Stable tag: 2024. 06 Tested up to: 6.4.3 7 Stable tag: 2024.2 8 8 Requires PHP: 5.4 9 9 License: Envato market standard or extended license … … 170 170 171 171 == Changelog == 172 = 2024.2 = 173 - Security fix: The additional_js and additional_js_file_iframe attribute are now only allowed to be used if you have the permission "unfiltered_html", that you need in WordPress to use iframes. If you do not have this permission, during save the attributes are removed and an error message is shown. 174 - Fix: Show iframe as layer was not working properly in Firefox. The link was opening in a new tab. Using a different way to hide the iframe solves the problem. 175 - Fix: Filtering all short code attributes failed because "The Plus Blocks for Block Editor" was adding their settings to the ai attributes. I will contact them, why they do such stupid things! 176 - Fix: Switching a theme could cause an error message when no content pages where existing. Now this is only executed if content pages do exist. 177 178 = 2024.1 = 179 - Fix: add_iframe_url_as_param thrown an error because of the additional security filter. Now it works fine again. 180 172 181 = 2024.0 = 173 - Security fix: The include_html attribute arenow only allowed to be used if you have the permission "unfiltered_html", that you need in WordPress to use iframes. If you do not have this permission, during save the attribute is removed and an error message is shown.182 - Security fix: The include_html attribute is now only allowed to be used if you have the permission "unfiltered_html", that you need in WordPress to use iframes. If you do not have this permission, during save the attribute is removed and an error message is shown. 174 183 - Security fix: All shortcode attributes have now input sanitation to avoid Stored Cross-Site Scripting at save if you do not have the permission "unfiltered_html"! This happens in the normal editor and also in the Gutenberg block! Please get the unfiltered_html permission if you get an error message while you want to use '();= or a space in attributes. This sanitation is very general and does not allow all possible things you can do with advanced iframe. As 99.9% of the users who add an iframe are editors or above this should affect almost no one directly and it makes the plugin more secure. 175 184 - Security fix: " inside advanced iframe shortcode attributes is not allowed anymore to avoid XSS attacks. … … 268 277 - Fix: The link in the registration message was linked to the wrong part of the options tab. Now it goes directly where you can enter the purchase code. 269 278 - Fix: When saving a post the url was not checked even it was not enabled. Now ai_checkUrlStatus is called properly when the classic editor is used. 279 270 280 = 2022.5 = 271 281 - New: Tested with Wordpress 6.0 … … 285 295 - New: If enable_lazy_load is enabled the HTML lazy loading is disabled as it does not make sense to have both. 286 296 - Fix: When you enter the URL directly in the administration WordPress replaces & with & This now replaced again by & internally again. 287 - Fix: "Support WP multi site" was not working in all situations when the iframe communication solution was used. It is now only supported when using postMessage and removed for the iframe communication. As this feature is part of the pro version where postMessage is the recommended solution anyway, only users should be affected who forgot to switch to postMessage.297 - Fix: "Support WP multi site" was not working in all situations when the iframe communication solution was used. It is now only supported when using postMessage and removed for the iframe communication. As this feature is part of the pro version where postMessage is the recommended solution anyway, only users should be affected who forgot to switch to postMessage. 288 298 - Fix: Resize on element resize was bound to one variable name for all iframes. Now every iframe on the page gets its own one. This prevents that 2 iframe overwrite the resize method of the other one. 289 299 - Fix: Resize on element resize and lazy load could lead to an error as a variable was not reinitialized when the iframe code is added to the page. 290 300 301 291 302 = 2022.2 = 292 303 - Fix: The title was set to a space on all pages if use_iframe_title_for_parent was activated. And only on iframe pages it was set properly. This part of the feature was now removed again. 304 293 305 = 2022.1 = 294 306 - Fix: use_iframe_title_for_parent was rending in the free version the Javascript variable where a backup of the title is stored into the title tag. This does actually work for normal users. Still this not very nice at all. … … 300 312 - New: iframe_height_ratio can now also be defined in a more common way: 16:9. The ratio with : as separator. The old way was the other way around 0.5625. Both settings are still supported. See the demo here: https://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/responsive-videos 301 313 - New: You can use the title of the iframe for the parent. After the iframe is loaded the title will be updated in the browser. This feature works on the same and the remote domain with the external workaround. The attribute for the shortcode and the external workaround is: is use_iframe_title_for_parent. Working examples can be found as part of this demos 32 and 33 https://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-pro-demo/add-iframe-url-to-parent 302 - New: Minimizer is back. Now the new urlis used and also a fall back was implemented which uses now the the not minimized file in case of a problem.314 - New: Minimizer is back. Now the new URL is used and also a fall back was implemented which uses now the the not minimized file in case of a problem. 303 315 - New: Improved validation of change_iframe_links. if change_iframe_links is empty but other settings are done an error is reported 304 316 - New: Improved validation of iframe_content_id and iframe_content_styles. Now also a error is shown when iframe_content_styles is set and iframe_content_id not. … … 311 323 = 2021.9 = 312 324 - Fix: The minimizer for ai.js changed the url and therefore minimized files where broken. The minimizer is now disabled until I find a new more reliable one. Please update asap. You administration will not work anymore! Please uninstall and install the new version. Sorry for the inconvenience. 325 313 326 = 2021.8 = 314 327 - Fix: Setting hide_content_until_iframe_color was causing a problem in the Gutenberg editor as there some code was rendered into the json response. Now in editor mode this part is rendered later and in normal mode still where it needs to be to work properly. The div which hides the whole page needs to be rendered before the plugin itself because otherwise you first see the page for a small time and then the page is hidden. And this is exatly what the feature should prevent! … … 317 330 = 2021.7 = 318 331 - New: Tested with Wordpress 5.8 319 - Fix: Updating failed: The response is not a valid JSON response. The detection for duplicated ids and the time debug was moved to be rendered later. This fixes the problem with e.g. the Oyxgen builder when included on the admin site and configuration errors are rendered to the Javascript console. Also some plugins together with the gutenberg block editor show a JSON error. They execute the shortcode because of ?? and where triggering this error.332 - Fix: Updating failed: The response is not a valid JSON response. The detection for duplicated ids and the time debug was moved to be rendered later. This fixes the problem with e.g. the Oyxgen builder when included on the admin site and configuration errors are rendered to the Javascript console. Also some plugins together with the Gutenberg block editor show a JSON error. They execute the shortcode because of ?? and where triggering this error. 320 333 321 334 = 2021.6 = … … 413 426 = 2020.8 = 414 427 - New: WordPress 5.5 changed the behaviour of the parameter page in the url! You now get a 301 redirect on normal pages if you use ?page=XXX. Unfortunately this also kills url features of advanced iframe pro. You can now set "Fix WordPress 5.5 page parameter change" to true on the administration. Then you can again use ?page=abc for example again. Numeric values are still not allowed because removing this internally would kill the pagination where the page paremater is really used! 415 428 416 429 = 2020.7 = 417 430 - New: The iframe can now be reloaded when the browser is resized or the device is rotated. This can be done in the reload feature by adding r as prefix.
Note: See TracChangeset
for help on using the changeset viewer.