Plugin Directory

Changeset 3307270


Ignore:
Timestamp:
06/05/2025 10:37:12 PM (10 months ago)
Author:
mdempfle
Message:

2025.5
Fix: == at the end of src caused the whole parameter to be removed. Now this is supported
Fix: filteredContent variable was not defined properly. Now it is.

Location:
advanced-iframe/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • advanced-iframe/trunk/advanced-iframe.php

    r3296849 r3307270  
    33Plugin Name: Advanced iFrame
    44Plugin URI: https://wordpress.org/plugins/advanced-iframe/
    5 Version: 2025.4
     5Version: 2025.5
    66Text Domain: advanced-iframe
    77Domain Path: /languages
     
    3232// error_reporting(E_ALL);
    3333
    34 $aiVersion = '2025.4';
     34$aiVersion = '2025.5';
    3535// check $aiJsSize
    3636
     
    15341534            // check if the user has the capability unfiltered_html and is therefore allowed to use the custom and onload shortcode attribute.
    15351535            if (!current_user_can('unfiltered_html')) {
    1536               while ($content != $filterContent) {
    1537                 $filterContent = $content;
     1536              while ($content != $filteredContent) {
     1537                $filteredContent = $content;
    15381538                $content = $this->filterAttribute('onload', $hit, $content);
    15391539                $content = $this->filterAttribute('custom', $hit, $content);
  • advanced-iframe/trunk/includes/advanced-iframe-main-helper.php

    r3255604 r3307270  
    225225    $qSplit = explode("&", $queryString);
    226226    $cleanedParams = array_filter($qSplit, function ($var) {
    227       return !AdvancedIframeHelper::ai_endsWith($var, "=");
     227      // valid params to not end with = AND have only one =
     228      return !(AdvancedIframeHelper::ai_endsWith($var, "=") && substr_count($var, '=') === 1);
    228229    });
    229230
  • advanced-iframe/trunk/js/ai.js

    r3296849 r3307270  
    11/**
    2  *  Advanced iframe functions v2025.4
     2 *  Advanced iframe functions v2025.5
    33 */
    44/* jslint devel: true, unused: false */
  • advanced-iframe/trunk/js/ai.min.js

    r3296849 r3307270  
    1 /** Advanced iframe functions v2025.4. Created: 2025-05-19 19:35:32 */
     1/** Advanced iframe functions v2025.5. Created: 2025-05-19 19:35:32 */
    22var 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(e){"undefined"!=typeof aiShowDebug&&aiShowDebug&&console&&console.log&&console.log("Advanced iframe: "+e)}function aiResizeIframe(e,a,i){aiDebugExtended("aiResizeIframe");try{if("about:blank"===e.contentWindow.location.href)return;if(null!=e.contentWindow.document.body){var t=jQuery(window).scrollTop();e.style.marginTop="0",e.style.marginBottom="0",e.height=Number(i),e.style.height=Number(i)+"px";var o=aiGetIframeHeight(e);aiDebugExtended("aiResizeIframe - newHeight: "+o),e.height=o,e.style.height=o+"px";let r=jQuery("#ai-zoom-div-"+e.id);if(0!==r.length){var n=window["zoom_"+e.id];r.css("height",o*n)}aiEnableCookie&&0===aiExtraSpace&&aiWriteCookie(o);var l=aiGetIframeHash(e.contentWindow.location.href);if("-1"!==l){var s="#"+e.id;try{var d=jQuery(s).contents().find("#"+l);if(0!==d.length){var c=d.offset().top;t=Math.round(jQuery(s).offset().top+c)}}catch(h){}}if(setTimeout(function(){jQuery("html,body").scrollTop(t)},50),"true"===a){var f=aiGetIframeWidth(e);e.width=f,e.style.width=f+"px"}(0,window["resizeCallback"+e.id])(),null!=window.frameElement&&parent.jQuery("iframe").trigger("onload"),aiHandleAnchorLinkScrolling(e.id)}else setTimeout(function(){aiResizeIframe(e,a)},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(e){var a=jQuery("#"+e),i=a.offset().top;a.contents().find("body").on("click","a[href^='#']",function(){var a=jQuery(this).attr("href"),t=jQuery("#"+e).contents().find(a);if(0!==t.length){var o=t.offset().top;jQuery("html,body").scrollTop(Math.round(i+o+2))}})}function aiGetIframeHash(e){var a;return e.split("#")[1]||"-1"}function aiGetIframeHeight(e){return Math.max(e.contentWindow.document.body.scrollHeight,e.contentWindow.document.body.offsetHeight,e.contentWindow.document.documentElement.scrollHeight,e.contentWindow.document.documentElement.offsetHeight)+aiExtraSpace}function aiGetIframeWidth(e){var a=e.width;e.width=1,e.style.width="1px";var i=Math.max(e.contentWindow.document.body.scrollWidth,e.contentWindow.document.body.offsetWidth,e.contentWindow.document.documentElement.scrollWidth,e.contentWindow.document.documentElement.offsetWidth);return 1!==i?(e.width=i,e.style.width=i+"px"):(e.width=a,e.style.width=a+"px"),i}function aiGetParentIframeWidth(e){if(null!=e){let a=jQuery("#"+e.id);return 0!==a.length?a.width():-1}}function aiResizeIframeHeightById(e,a){aiDebugExtended("aiResizeIframeHeightById - id: "+e+", nHeight: "+a);try{(0,window["resizeCallback"+e])();var i=parseInt(a,10)+aiExtraSpace,t=document.getElementById(e);if(null===t&&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 ("+e+") are most likely different! Check your settings.");return}var o=jQuery(document).scrollTop();t.height=i,t.style.height=i+"px",jQuery("html,body").scrollTop(o),aiEnableCookie&&0===aiExtraSpace&&aiWriteCookie(i);var r=window["aiExecuteWorkaround_"+e];null!=r&&r()}catch(n){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(n))}}function aiScrollToTop(e,a){if(aiDebugExtended("aiScrollToTop - id: "+e+", position: "+a),aiOnloadEventsCounter>0){var i=0;"iframe"===a&&(i=jQuery("#"+e).offset().top),setTimeout(function(){aiDebugExtended("aiScrollToTop - posTop: "+i),window.scrollTo(0,i)},100)}setTimeout(function(){aiOnloadEventsCounter++},1e3)}function aiWriteCookie(e){var a="ai-last-height";""!==aiId&&(a=a+"-"+aiId),document.cookie=a+"="+e}function aiUseCookie(){var e="ai-last-height";""!==aiId&&(e=e+"-"+aiId);for(var a=document.cookie.split(";"),i=0;i<a.length;i++){var t=a[i].split("=")[0],o=a[i].split("=")[1];if(t===e&&null!==o&&aiIsNumeric(o)){var r=document.getElementById(aiId);r.height=parseInt(o,10),r.style.height=o+"px"}}}function aiIsNumeric(e){return!isNaN(e)}function aiDisableHeight(){jQuery("#additional_height").attr("readonly","readonly").val("0")}function aiEnableHeight(){jQuery("#additional_height").removeAttr("readonly")}function aiShowElementOnly(e,a){aiDebugExtended("aiShowElementOnly");try{var i=jQuery(e).contents().find("body"),t=i.find(a).clone(!0,!0);i.find("*").not(jQuery("script")).remove(),i.prepend(t)}catch(o){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(o))}}function aiCheckIfValidTarget(e,a){e||(e=window.event),e.target?i=e.target:e.srcElement&&(i=e.srcElement),3===i.nodeType&&(i=i.parentNode);for(var i,t=a.split(","),o=0;o<t.length;++o){var r=t[o].split(":");if(r[0].toLowerCase()===i.nodeName.toLowerCase()&&(!(r.length>1)||-1!==i.id.toLowerCase().indexOf(r[1].toLowerCase())))return!0}return!1}function aiOpenSelectorWindow(e){aiDebugExtended("aiOpenSelectorWindow");var a=jQuery("#width").val(),i=jQuery("#ai-height-0").val();(a.indexOf("%")>=0||900>Number(a))&&(a=900),(a=Number(a)+40)>screen.width&&(a=screen.width),(i=i.indexOf("%")>=0?screen.height:Number(i)+480)>screen.height-50&&(i=screen.height-50);var t="width="+a+",height="+i+",left=0,top=0,resizable=1,scrollbars=1";window.open(e,"",t).focus()}function aiDisableAiResizeOptions(e){jQuery("#onload_resize_delay").prop("readonly",e),jQuery("input[id=store_height_in_cookie1]:radio, input[id=store_height_in_cookie2]:radio").attr("disabled",e),jQuery("#additional_height").prop("readonly",e),jQuery("input[id=onload_resize_width1]:radio, input[id=onload_resize_width2]:radio").attr("disabled",e),jQuery("#resize_on_click").prop("readonly",e),jQuery("#resize_on_click_elements").prop("readonly",e),jQuery("#resize_on_ajax").prop("readonly",e),jQuery("input[id=resize_on_ajax_jquery1]:radio, input[id=resize_on_ajax_jquery2]:radio").attr("disabled",e);var a="#onload_resize_delay, #store_height_in_cookie1, #additional_height, #onload_resize_width1, ";aiDisableTextSection(e,a+="#resize_on_click, #resize_on_click_elements, #resize_on_ajax, #resize_on_ajax_jquery1")}function aiDisablePartOfIframeOptions(e){jQuery("#show_part_of_iframe_x").prop("readonly",e),jQuery("#show_part_of_iframe_y").prop("readonly",e),jQuery("#show_part_of_iframe_height").prop("readonly",e),jQuery("#show_part_of_iframe_width").prop("readonly",e),jQuery("input[id=show_part_of_iframe_allow_scrollbar_horizontal1]:radio, input[id=show_part_of_iframe_allow_scrollbar_horizontal2]:radio").attr("disabled",e),jQuery("input[id=show_part_of_iframe_allow_scrollbar_vertical1]:radio, input[id=show_part_of_iframe_allow_scrollbar_vertical2]:radio").attr("disabled",e),jQuery("#show_part_of_iframe_next_viewports").prop("readonly",e),jQuery("input[id=show_part_of_iframe_next_viewports_loop1]:radio, input[id=show_part_of_iframe_next_viewports_loop2]:radio").attr("disabled",e),jQuery("#show_part_of_iframe_new_window").prop("readonly",e),jQuery("#show_part_of_iframe_new_url").prop("readonly",e),jQuery("input[id=show_part_of_iframe_next_viewports_hide1]:radio, input[id=show_part_of_iframe_next_viewports_hide2]:radio").attr("disabled",e),jQuery("#show_part_of_iframe_style").prop("readonly",e),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",e),jQuery(".media-query-input").prop("readonly",e);var a="#show_part_of_iframe_x, #show_part_of_iframe_y, #show_part_of_iframe_height, #show_part_of_iframe_width, ";a+="#show_part_of_iframe_allow_scrollbar_horizontal1, #show_part_of_iframe_next_viewports, #show_part_of_iframe_next_viewports_loop1, ",a+="#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(e,a+="#show_part_of_iframe_zoom1, #show_part_of_iframe_allow_scrollbar_vertical1, #add-media-query-show_part_of_iframe_media_query"),e?(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(e){jQuery("#enable_lazy_load_threshold").prop("readonly",e),jQuery("#enable_lazy_load_fadetime").prop("readonly",e),jQuery("input[id=enable_lazy_load_reserve_space1]:radio, input[id=enable_lazy_load_reserve_space2]:radio").attr("disabled",e),jQuery("input[id=enable_lazy_load_manual1]:radio, input[id=enable_lazy_load_manual2]:radio, input[id=enable_lazy_load_manual3]:radio").attr("disabled",e),aiDisableTextSection(e,"#enable_lazy_load_threshold, #enable_lazy_load_fadetime, #enable_lazy_load_reserve_space1, #enable_lazy_load_manual1")}function aiDisableIframeAsLayerOptions(e){jQuery("input[id=show_iframe_as_layer_full]:radio").attr("disabled",e),jQuery("#show_iframe_as_layer_header_file").prop("readonly",e),jQuery("#show_iframe_as_layer_header_height").prop("readonly",e),jQuery("#show_iframe_as_layer_autoclick_delay").prop("readonly",e),jQuery("#show_iframe_as_layer_autoclick_hide_time").prop("readonly",e),jQuery("input[id=show_iframe_as_layer_header_position1]:radio, input[id=show_iframe_as_layer_header_position2]:radio").attr("disabled",e),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",e),jQuery("input[id=show_iframe_as_layer_keep_content1]:radio, input[id=show_iframe_as_layer_keep_content2]:radio").attr("disabled",e);var a="#show_iframe_as_layer_full, #show_iframe_as_layer_header_file, #show_iframe_as_layer_header_height, ";a+="#show_iframe_as_layer_header_position1, #show_iframe_as_layer_full1, #show_iframe_as_layer_keep_content1, ",aiDisableTextSection(e,a+="#show_iframe_as_layer_autoclick_delay, #show_iframe_as_layer_autoclick_hide_time")}function aiDisableAddParamOptions(e){jQuery("input[id=add_iframe_url_as_param_direct1]:radio, input[id=add_iframe_url_as_param_direct2]:radio").attr("disabled",e),jQuery("#add_iframe_url_as_param_prefix").prop("readonly",e),aiDisableTextSection(e,"#add_iframe_url_as_param_prefix, #add_iframe_url_as_param_direct1")}function aiDisableTextSection(e,a){e?jQuery(a).closest("tr").addClass("disabled"):jQuery(a).closest("tr").removeClass("disabled")}function aiInitAdminConfiguration(e,a){"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").css("padding-top","8px").css("padding-bottom","2px").click(function(){jQuery(".description").css("display","none"),jQuery(".description",jQuery(this).parent()).css("display","block")}),jQuery("table.form-table td").css("padding-top","5px").css("padding-bottom","5px")),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").css("padding-top","20px").css("padding-bottom","20px").off("click"),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").css("padding-top","8px").css("padding-bottom","2px").click(function(){jQuery(".description").css("display","none"),jQuery(".description",jQuery(this).parent()).css("display","block")}),jQuery("table.form-table td").css("padding-top","5px").css("padding-bottom","5px"))});let i=jQuery("#accordion");i.find("h1").click(function(){jQuery(this).next().slideToggle(aiAccTime)}).next().hide(),i.find("a").click(function(){var e="#h1-"+jQuery(this).prop("hash").substring(1);jQuery(e).next().show(),location.hash=e}),"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(){if("false"===jQuery(this).val())aiDisableLazyLoadOptions(!0),jQuery("#enable_lazy_load_manual_element").prop("readonly",!0);else{aiDisableLazyLoadOptions(!1);let e=jQuery("input[type=radio][name=enable_lazy_load_manual]:checked").val();"false"===e||"auto"===e?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(e){e.stopPropagation(),e.preventDefault();var a,i=this.href.split("?"),t=i[0],o=i[1].split("&"),r="";t+="?"+o[0];for(var n=1,l=o.length;n<l;n++)r+='<input type="hidden" name="'+(a=o[n].split("="))[0]+'" value="'+a[1]+'" />';var s=jQuery("#twg-options").val();r+='<input type="hidden" name="twg-options" value="'+s+'" />',jQuery("body").append('<form action="'+t+'" method="post" id="poster">'+r+"</form>"),jQuery("#poster").submit()}),jQuery(".ai-input-search").keyup(function(){var e=jQuery("input.ai-input-search").val().toLowerCase();aiSettingsSearch(e,a)}).on("click",function(){setTimeout(function(){var e=jQuery("input.ai-input-search").val().toLowerCase();aiSettingsSearch(e,a)},100)}),jQuery(document).on("click",".nav-tab-wrapper a",function(){var e=jQuery(this).attr("id");return jQuery("section").hide(),jQuery("section."+e).show(),jQuery("#current_tab").val(e.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.enter-pro",function(){return jQuery(".options-tab").click(),jQuery("#id-options-pro").removeClass("closed"),location.hash="#id-options-pro",aiShowHeader("id-options-pro","first"),!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("#"+a).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(e){return jQuery(this).parent().remove(),aiUpdateHeightHiddenField("height"),e.preventDefault(),!1}),jQuery(document).on("click","a#add-media-query-height",function(e){var a=jQuery(".mq-breakpoint-height").length+1;return jQuery(this).parent().append('<div id="breakpoint-row-height-'+a+'" class="mq-breakpoint-height"><input type="text" id="ai-height-'+a+'" style="width:150px;margin-top:5px;"  onblur="aiCheckHeightNumber(this, \'height\');" placeholder="Insert height"/> &nbsp;Breakpoint: <input type="text" id="ai-breakpoint-height-'+a+'" style="width:130px;" onblur="aiCheckHeightNumber(this, \'height\');" placeholder="Insert breakpoint"/><a id="delete-media-query-'+a+'" href="#" class="delete ai-delete">Delete</a>'),e.preventDefault(),!1}),jQuery(document).on("click",".mq-breakpoint-show_part_of_iframe_media_query a",function(e){return jQuery(this).parent().remove(),aiUpdateHeightHiddenFieldMediaQuery("show_part_of_iframe_media_query"),e.preventDefault(),!1}),jQuery(document).on("click","a#add-media-query-show_part_of_iframe_media_query",function(e){var a=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-'+a+'" class="mq-breakpoint-show_part_of_iframe_media_query">x: <input type="text" id="ai-x-show_part_of_iframe_media_query-'+a+'" class="media-query-input"  onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="x"/> &nbsp;y: <input type="text" id="ai-y-show_part_of_iframe_media_query-'+a+'" class="media-query-input"  onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="y"/> &nbsp;w: <input type="text" id="ai-w-show_part_of_iframe_media_query-'+a+'" class="media-query-input"  onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="width"/> &nbsp;h: <input type="text" id="ai-h-show_part_of_iframe_media_query-'+a+'" class="media-query-input"  onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="height"/> &nbsp;iframe width: <input type="text" id="ai-i-show_part_of_iframe_media_query-'+a+'" class="media-query-input" style="width:100px;"  onblur="aiCheckHeightNumberMediaQuery(this, \'show_part_of_iframe_media_query\');" placeholder="iframe width"/> &nbsp;Breakpoint: <input type="text" id="ai-breakpoint-show_part_of_iframe_media_query-'+a+'" 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-'+a+'" href="#" class="delete ai-delete">Delete</a>'),e.preventDefault(),!1})}function aiCheckHeightNumber(e,a){aiCheckInputNumber(e),aiUpdateHeightHiddenField(a)}function aiCheckHeightNumberMediaQuery(e,a){aiCheckInputNumber(e),aiUpdateHeightHiddenFieldMediaQuery(a)}function aiUpdateHeightHiddenField(e){var a=jQuery("#ai-"+e+"-0").val(),i=[];jQuery(".mq-breakpoint-"+e).each(function(){var e=jQuery(this).children().eq(0).val(),a=jQuery(this).children().eq(1).val();""!==e&&""!==a&&i.push({heightChild:e,breakpointChild:a})}),i.sort(function(e,a){return a.breakpointChild-e.breakpointChild});let t=a;i.forEach(function(e){t+=","+e.heightChild+"|"+e.breakpointChild}),jQuery("#"+e).val(t);let o=jQuery("#description-"+e),r=o.html().split("Shortcode attribute: ")[0];o.html(r+"Shortcode attribute: "+e+'="'+t+'"')}function aiUpdateHeightHiddenFieldMediaQuery(e){var a=[];jQuery(".mq-breakpoint-"+e).each(function(){var e=jQuery(this).children().eq(0).val(),i=jQuery(this).children().eq(1).val(),t=jQuery(this).children().eq(2).val(),o=jQuery(this).children().eq(3).val(),r=jQuery(this).children().eq(4).val(),n=jQuery(this).children().eq(5).val();(""!==e||""!==i||""!==t||""!==o||""!==r)&&""!==n&&a.push({mediaX:e,mediaY:i,mediaW:t,mediaH:o,mediaIW:r,breakpointChild:n})}),a.sort(function(e,a){return a.breakpointChild-e.breakpointChild});let i="";a.forEach(function(e){i+=","+e.mediaX+"|"+e.mediaY+"|"+e.mediaW+"|"+e.mediaH+"|"+e.mediaIW+"|"+e.breakpointChild}),i=i.replace(/(^,)|(,$)/g,""),jQuery("#"+e).val(i);let t=jQuery("#description-"+e),o=t.html().split("Shortcode attribute: ")[0];t.html(o+"Shortcode attribute: "+e+'="'+i+'"')}function aiSettingsSearch(e,a){var i=0;""!==e?(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"!==a&&(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"!==a&&(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));let t=jQuery("#ai .mark-tab-header");t.removeClass("mark-tab-header");var o="";if(jQuery("#ai tr").each(function(){var a=jQuery(this),t=a.find("th").text(),r=a.find("p.description").text();if(t=void 0!==t?t.toLowerCase():"XXXXXXX",r=void 0!==r?r.toLowerCase():"XXXXXXX",-1===t.indexOf(e)&&-1===r.indexOf(e))0===a.parents(".show-always").length&&a.addClass("hide-setting");else{if(a.closest("table").prevAll("h2:first").show(),a.closest(".postbox-container").show(),a.closest(".postbox-container").find("h2, .inside").show(),a.closest("table").prevAll("#ai .icon_ai:first").show(),a.closest("table").nextAll("p.button-submit:first").show(),a.removeClass("hide-setting"),a.closest(".hide-search").show(),e.length>2){var n=a.closest("section").attr("class");void 0!==n&&(jQuery("#"+n).addClass("mark-tab-header"),""===o&&(o=n))}i++}}),0===i)jQuery("#ai-input-search-result").show(),t.removeClass("mark-tab-header");else{if(jQuery("#ai-input-search-result").hide(),aiInstance&&aiInstance.revert(),""!==e&&e.length>2){var r=RegExp(e,"gi");aiInstance=findAndReplaceDOMText(document.getElementById("tab_wrapper"),{find:r,wrap:"em"})}jQuery("#"+o).click()}}function aiResizeIframeRatio(e,a){aiDebugExtended("aiResizeIframeRatio");var i,t=Math.ceil(jQuery("#"+e.id).width()*parseFloat(a.replace(",",".")));e.height=t,e.style.height=t+"px"}function aiGenerateShortcode(e){var a="[advanced_iframe ";let i=jQuery("#securitykey").val();""!==i&&(a+='securitykey="'+i+'" '),a+='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."):a+='src="'+n+'" ',a+=aiGenerateTextShortcode("src_hide"),a+=aiGenerateTextShortcode("width"),a+=aiGenerateTextShortcode("height"),a+=aiGenerateRadioShortcode("scrolling","none"),a+=aiGenerateRadioShortcode("add_surrounding_p","false"),a+=aiGenerateRadioShortcode("enable_ios_mobile_scolling","false"),a+=aiGenerateTextShortcode("marginwidth"),a+=aiGenerateTextShortcode("marginheight"),a+=aiGenerateTextShortcode("frameborder"),a+=aiGenerateRadioShortcode("transparency","true"),a+=aiGenerateTextShortcode("class"),a+=aiGenerateTextShortcode("style"),a+=aiGenerateTextShortcodeWithDefault("id","advanced_iframe"),a+=aiGenerateTextShortcode("name"),a+=aiGenerateRadioShortcode("allowfullscreen","false"),a+=aiGenerateTextShortcode("safari_fix_url"),a+=aiGenerateTextShortcode("sandbox"),a+=aiGenerateTextShortcode("title"),a+=aiGenerateTextShortcode("allow"),a+=aiGenerateRadioShortcode("loading","lazy"),a+=aiGenerateTextShortcode("referrerpolicy"),a+=aiGenerateTextShortcode("custom"),a+=aiGenerateTextShortcode("url_forward_parameter"),a+=aiGenerateTextShortcode("map_parameter_to_url"),a+=aiGenerateRadioShortcode("add_iframe_url_as_param","false"),a+=aiGenerateTextShortcode("add_iframe_url_as_param_prefix"),a+=aiGenerateRadioShortcode("add_iframe_url_as_param_direct","false"),a+=aiGenerateRadioShortcode("use_iframe_title_for_parent","false"),a+=aiGenerateRadioShortcode("onload_scroll_top","false"),a+=aiGenerateRadioShortcode("hide_page_until_loaded","false"),a+=aiGenerateRadioShortcode("show_iframe_loader","false"),a+=aiGenerateTextShortcode("hide_content_until_iframe_color"),a+=aiGenerateTextShortcode("iframe_zoom"),a+=aiGenerateRadioShortcode("iframe_zoom_ie8","false"),a+=aiGenerateRadioShortcode("use_zoom_absolute_fix","false"),a+=aiGenerateRadioShortcode("auto_zoom","false"),a+=aiGenerateTextShortcode("auto_zoom_by_ratio"),a+=aiGenerateRadioShortcode("enable_responsive_iframe","false"),a+=aiGenerateTextShortcode("iframe_height_ratio"),a+=aiGenerateRadioShortcode("enable_lazy_load","false"),a+=aiGenerateTextShortcodeWithDefault("enable_lazy_load_threshold","3000"),a+=aiGenerateRadioShortcode("enable_lazy_load_reserve_space","true"),a+=aiGenerateTextShortcode("enable_lazy_load_fadetime"),a+=aiGenerateRadioShortcode("enable_lazy_load_manual","false"),a+=aiGenerateRadioShortcode("enable_lazy_load_manual_element","false"),a+=aiGenerateTextShortcode("reload_interval"),a+=aiGenerateTextShortcode("hide_elements"),a+=aiGenerateTextShortcode("content_id"),a+=aiGenerateTextShortcode("content_styles"),a+=aiGenerateTextShortcode("parent_content_css"),a+=aiGenerateRadioShortcode("add_css_class_parent","false"),a+=aiGenerateTextShortcode("change_parent_links_target"),a+=aiGenerateRadioShortcode("show_iframe_as_layer","false"),a+=aiGenerateRadioShortcode("show_iframe_as_layer_full","false"),a+=aiGenerateTextShortcode("show_iframe_as_layer_autoclick_delay"),a+=aiGenerateTextShortcode("show_iframe_as_layer_autoclick_hide_time"),a+=aiGenerateTextShortcode("show_iframe_as_layer_header_file"),a+=aiGenerateTextShortcodeWithDefault("show_iframe_as_layer_header_height","100"),a+=aiGenerateRadioShortcode("show_iframe_as_layer_header_position","top"),a+=aiGenerateRadioShortcode("show_iframe_as_layer_keep_content","true");var l=aiGenerateRadioShortcode("show_part_of_iframe","false");a+=l,""!==l&&(a+=aiGenerateTextShortcodeWithDefault("show_part_of_iframe_x",-1),a+=aiGenerateTextShortcodeWithDefault("show_part_of_iframe_y",-1),a+=aiGenerateTextShortcode("show_part_of_iframe_width"),a+=aiGenerateTextShortcode("show_part_of_iframe_height"),a+=aiGenerateTextShortcode("show_part_of_iframe_media_query"),a+=aiGenerateRadioShortcode("show_part_of_iframe_allow_scrollbar_horizontal","false"),a+=aiGenerateRadioShortcode("show_part_of_iframe_allow_scrollbar_vertical","false"),a+=aiGenerateTextShortcode("show_part_of_iframe_style"),a+=aiGenerateRadioShortcode("show_part_of_iframe_zoom","false"),a+=aiGenerateTextShortcode("show_part_of_iframe_next_viewports"),a+=aiGenerateRadioShortcode("show_part_of_iframe_next_viewports_loop","false"),a+=aiGenerateTextShortcode("show_part_of_iframe_new_window"),a+=aiGenerateTextShortcode("show_part_of_iframe_new_url"),a+=aiGenerateRadioShortcode("show_part_of_iframe_next_viewports_hide","false")),a+=aiGenerateTextShortcode("hide_part_of_iframe"),a+=aiGenerateRadioShortcode("fullscreen_button","false"),a+=aiGenerateTextShortcode("fullscreen_button_hide_elements"),a+=aiGenerateRadioShortcode("fullscreen_button_full","false"),a+=aiGenerateRadioShortcode("fullscreen_button_style","black"),a+=aiGenerateRadioShortcode("add_css_class_iframe","false"),a+=aiGenerateTextShortcode("iframe_hide_elements"),a+=aiGenerateTextShortcode("onload_show_element_only"),a+=aiGenerateTextShortcode("iframe_content_id"),a+=aiGenerateTextShortcode("iframe_content_styles"),a+=aiGenerateTextShortcode("iframe_content_css"),a+=aiGenerateTextShortcode("change_iframe_links"),a+=aiGenerateTextShortcode("change_iframe_links_target"),a+=aiGenerateTextShortcode("change_iframe_links_href"),a+=aiGenerateTextShortcode("onload"),a+=aiGenerateRadioShortcode("onload_resize","false"),a+=aiGenerateTextShortcode("onload_resize_delay"),a+=aiGenerateRadioShortcode("store_height_in_cookie","false"),a+=aiGenerateTextShortcode("additional_height"),a+=aiGenerateRadioShortcode("onload_resize_width","false"),a+=aiGenerateTextShortcode("resize_on_ajax"),a+=aiGenerateRadioShortcode("resize_on_ajax_jquery","true"),a+=aiGenerateTextShortcode("resize_on_click"),a+=aiGenerateTextShortcodeWithDefault("resize_on_click_elements","a"),a+=aiGenerateTextShortcode("resize_on_element_resize"),a+=aiGenerateTextShortcodeWithDefault("resize_on_element_resize_delay","250"),a+=aiGenerateTextShortcode("tab_hidden"),a+=aiGenerateTextShortcode("tab_visible"),a+=aiGenerateRadioShortcode("add_document_domain","false"),"true"===r&&(a+=aiGenerateTextShortcode("document_domain")),a+=aiGenerateRadioShortcode("enable_external_height_workaround","external"),a+=aiGenerateRadioShortcode("hide_page_until_loaded_external","false"),a+=aiGenerateTextShortcode("pass_id_by_url"),a+=aiGenerateRadioShortcode("multi_domain_enabled","true"),"true"===e?a+=aiGenerateRadioShortcode("use_post_message","true"):a+=aiGenerateRadioShortcode("use_post_message","false"),a+=aiGenerateTextShortcode("additional_css"),a+=aiGenerateTextShortcode("additional_js"),a+=aiGenerateTextShortcode("additional_js_file_iframe"),a+=aiGenerateTextShortcode("additional_css_file_iframe")}else""===t?(a+=aiGenerateTextShortcode("include_url"),a+=aiGenerateTextShortcode("include_content"),a+=aiGenerateTextShortcode("include_height"),a+=aiGenerateTextShortcode("include_fade"),a+=aiGenerateRadioShortcode("include_hide_page_until_loaded","false")):a+=aiGenerateTextShortcode("include_html");a+=aiGenerateRadioShortcode("debug_js","false"),a=a.slice(0,-1),a+="]",jQuery("#gen-shortcode").html(a)}function aiGenerateTextShortcodeWithDefault(e,a){var i="",t=jQuery("#"+e),o=t.val();return t.length>0&&""!==o&&o!==a&&(i=e+'="'+o+'" '),i}function aiGenerateTextShortcode(e){var a="",i=jQuery("#"+e),t=i.val();return i.length>0&&""!==t&&"0"!==t&&(a=e+'="'+t+'" '),a}function aiGenerateRadioShortcode(e,a){var i="",t=jQuery("input:radio[name="+e+"]:checked"),o=t.val();return"enable_ios_mobile_scolling"===e&&(e="enable_ios_mobile_scrolling"),t.length>0&&o!==a&&(i+=e+'="'+o+'" '),i}function aiAddCssClassAllParents(e){for(var a=jQuery(e).parentsUntil("html"),i="ai-class-",t=0;t<a.length;t++){var o=jQuery(a[t]).attr("id");void 0!==o?0!==o.indexOf("ai-")&&jQuery(a[t]).addClass(i+o):jQuery(a[t]).addClass(i+t)}}function aiAutoZoomExternalHeight(e,a,i,t){aiDebugExtended("aiAutoZoomExternalHeight");var o=aiAutoZoomExternal(e,a,t),r=window["zoom_"+e],n=jQuery(document).scrollTop();return jQuery("#ai-zoom-div-"+e).css("height",Math.ceil(i*r)),jQuery("html,body").scrollTop(n),o}function aiAutoZoomExternal(e,a,i){aiDebugExtended("aiAutoZoomExternal");var t=document.getElementById(e),o=document.getElementById("ai-zoom-div-"+e),r=jQuery("#"+e);"true"===i&&r.css("max-width","100%");var n=a,l=aiGetParentIframeWidth(t);l===n&&(l=aiGetParentIframeWidth(o));var s=Math.floor(100*(l/n))/100;return s>1&&(s=1),aiSetZoom(e,s),window["zoom_"+e]=s,r.width(n).css("max-width","none"),l}function aiAutoZoom(e,a,i){aiDebugExtended("aiAutoZoom");var t,o=i.split("|");i=o[0];var r=-1;1!==o.length&&(r=o[1]);var n=document.getElementById(e);-1===r?(n.width=1,n.style.width="1px",t=aiGetIframeWidth(n),n.width=t,n.style.width=t+"px"):t=r;var l=aiAutoZoomExternal(e,t,a);if(""===i)aiResizeIframe(n,!1);else{var s=Math.ceil(t*i);n.height=s,n.style.height=s+"px";let d=jQuery("#ai-zoom-div-"+n.id);if(0!==d.length){var c=window["zoom_"+n.id];d.css("height",Math.ceil(s*c))}}return l}function aiSetZoom(e,a){var i=jQuery("#"+e);!0===aiIsIe8&&i.css("-ms-zoom",a),i.css({"-ms-transform":"scale("+a+")","-moz-transform":"scale("+a+")","-o-transform":"scale("+a+")","-webkit-transform":"scale("+a+")",transform:"scale("+a+")"})}function aiAutoZoomViewport(e,a){for(var i=jQuery(e),t=i.parent(),o=0;t.is("p")||void 0!==t.attr("id")&&0===t.attr("id").indexOf("ai-");)if(t=t.parent(),o++>10){alert("Unexpected div structure. Please disable the zoom.");break}var r=i.width(),n=t.width(),l=i.height(),s=n/r;"true"===a&&s>1&&(s=1),aiSetZoom(i.attr("id"),s);var d=-Math.round((r-r*s)/2),c=-Math.round((l-l*s)/2);i.css({"margin-left":d+"px","margin-right":d+"px","margin-top":c+"px","margin-bottom":c+"px"})}function aiResetAiSettings(){jQuery("#action").val("reset")}function aiCheckInputNumber(e){e.value=e.value.split(" ").join("");var a=e.value;""!==e.value&&(a.match(/^(-)?([\d.])+(px|%|em|pt|vh|vw|rem|ch)?([-+])?([\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(){e.focus()},10)))}function aiCheckInputPurchaseCode(e){e.value=e.value.split(" ").join("");var a=e.value;""!==e.value&&(a.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."),e.value="",setTimeout(function(){e.focus()},10)))}function aiCheckInputNumberOnly(e){e.value=e.value.split(" ").join("");var a=e.value;if(""===e.value){e.value="0";return}a.match(/^(-)?([\d.])+$/)||(alert("Please check the value you have entered. Only numbers without a dot or optional px, %, em or pt are allowed."),setTimeout(function(){e.focus()},10))}function aiShowHeader(e,a){var i=jQuery(window).scrollTop();jQuery(window).scrollTop(i-40),void 0!==a&&aiFlashElement(a)}function aiFlashElement(e){setTimeout(function(){jQuery("#"+e).css("background-color","#eee")},500),setTimeout(function(){jQuery("#"+e).css("background-color","#fff")},900),setTimeout(function(){jQuery("#"+e).css("background-color","#eee")},1300),setTimeout(function(){jQuery("#"+e).css("background-color","#fff")},1700)}function aiSetScrollposition(){var e=jQuery(document).scrollTop();jQuery("#scrollposition").val(e)}function aiResetShowPartOfAnIframe(e){jQuery("#"+e).css("top","0px").css("left","0px").css("position","static"),jQuery("#ai-div-"+e).css("width","auto").css("height","auto").css("overflow","auto").css("position","static")}function aiShowLayerIframe(e,a,i,t,o,r){aiDebugExtended("aiShowLayerIframe"),o=void 0!==o&&o,r=void 0===r||r;var n="#"+a;jQuery("#ai-zoom-div-"+a).show().css("visibility","visible"),jQuery(n).show(),jQuery(n).css("visibility","visible"),jQuery("#ai-layer-div-"+a).length&&jQuery(n="#ai-layer-div-"+a).show().css("visibility","visible"),jQuery("html").css("overflow-y","visible"),jQuery("body").css("overflow","hidden").append('<img alt="" id="ai_backlink" src="'+i+'close.png" style="z-index:100005;position:fixed;top:0;right:0;cursor:pointer" />');var l="<!-- -->";r&&"true"===t&&(l='<div id="ai-div-loader-global" style="position: fixed;z-index:100004;margin-left:-33px;left: 50%;top:50%;margin-top:-33px"><img src="'+i+'loader.gif" width="66" height="66" title="Loading" alt="Loading"></div>'),0===jQuery("#ai_backlayer").length&&jQuery(n).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>'+l),jQuery("#ai_backlink, #ai_backlayer").click(function(){aiHideLayerIframe(a,o)}),r||(e.preventDefault(),e.stopPropagation())}function aiHideLayerIframe(e,a){aiDebugExtended("aiHideLayerIframe");let i=jQuery("#"+e);i.css("visibility","hidden"),a||(i.attr("src","about:blank"),aiLayerIframeHrefs[e]="about:blank"),jQuery("#ai-zoom-div-"+e).css("visibility","hidden"),jQuery("#ai-layer-div-"+e).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(e,a){i=void 0===aiLayerIframeHrefs[a]?jQuery("#"+a).attr("src"):aiLayerIframeHrefs[a];var i,t=jQuery(e).attr("href");return aiLayerIframeHrefs[a]=t,i!==t}function aiChangeTitle(e){aiDebugExtended("aiChangeTitle");try{var a=document.getElementById(e).contentDocument.title;null!==a&&"undefined"!==a&&""!==a&&(document.title=a)}catch(i){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(i))}}function aiChangeUrlParam(e,a,i,t,o){aiDebugExtended("aiChangeUrlParam");var r,n=!1;if(-1!==i.lastIndexOf("//",0)&&(i=location.protocol+i),e!==encodeURIComponent(i)){r=aiSetGetParameter(a,e);var l=!0;if(t.startsWith("hash"))return aiGetUrlMapping(e,a,t);if(t){var s=r.replace(t,"");s===r&&(l=!1),r=s}if(l&&(r=r.replace("http%3A%2F%2F",""),r=-1!==window.location.href.toLowerCase().lastIndexOf("http:",0)?r.replace("https%3A%2F%2F","s|"):r.replace("https%3A%2F%2F","")),o){r=aiRemoveQueryString(window.location.href);var d=decodeURIComponent(e),c=d.indexOf("?"),h=d.indexOf("#");-1!==c?(r+="?"+d.slice(c+1),n=!0):-1!==h&&(r+="?hash="+d.slice(h+1),n=!0)}aiEndsWidth(r,a+"=")&&(r=aiRemoveURLParameter(r,a))}else{var f=window.location.href;r=aiRemoveURLParameter(f=f.split("/"+a+"/",1)[0],a)}var u=r.indexOf("?")>=0?"&":"?";aiSetBrowserUrl(r=r.replace("#",u+"hash="),n)}function aiGetUrlMappingUrl(e,a,i){var t,o=aiRemoveURLParameter(window.location.href,e=e.replace(":short",""));if(a.startsWith("hashrewrite")){var r="";if(o.indexOf("?")>=0){var n=o.split("?");o=n[0],r="?"+n[1]}var l=o.split("/"+e+"/",1)[0];aiEndsWidth(l,"/")||(l+="/"),o=l+(e+"/")+i+r}else{var s=o.indexOf("?")>=0?"&":"?";o+=s+e+"="+i}return o}function aiSetBrowserUrl(e,a){aiSupportsHistoryApi()&&(a||(e=e.replace(/%2F/g,"/")),window.history.pushState({},"",e),window.onpopstate=function(e){e&&e.state&&window.history.back()})}function aiRemoveQueryString(e){return e.indexOf("%3F")>=0?e.split("%3F")[0]:e.indexOf("?")>=0?e.split("?")[0]:e}function aiGetUrlMapping(e,a,i){var t={action:"aip_map_url_action",security:MyAjax.security,url:e};jQuery.post(MyAjax.ajaxurl,t,function(e){aiSetBrowserUrl(aiGetUrlMappingUrl(a,i,e),!1)})}function closeInfoPermanent(e){var a={action:"aip_close_message_permanent",security:MyAjax.security,id:e},i="The message before will only appear again when you reset the advanced iframe settings.";"show-discount-message"===e?i="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"===e&&(i="The message will appear again after a page reload."),jQuery.post(MyAjax.ajaxurl,a,function(){jQuery("h1").after('<div class="message-notice notice notice-success"><p>'+i+"</p></div>")}),setTimeout(function(){jQuery(".message-notice").fadeOut()},4e3)}function aiSupportsHistoryApi(){return!!(window.history&&history.pushState)}function aigetIframeLocation(e){try{var a=document.getElementById(e).contentWindow.location;return encodeURIComponent(a)}catch(i){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(i))}}function aiSetGetParameter(e,a){var i=window.location.href,t=i.split("#");i=t[0];var o=void 0===t[1]?"":"#"+t[1];if(i.indexOf(e+"=")>=0){var r=i.substring(0,i.indexOf(e+"=")),n=i.substring(i.indexOf(e+"="));i=r+e+"="+a+(n=(n=n.substring(n.indexOf("=")+1)).indexOf("&")>=0?n.substring(n.indexOf("&")):"")}else 0>i.indexOf("?")?i+="?"+e+"="+a:i+="&"+e+"="+a;return i+o}function aiRemoveURLParameter(e,a){var i=e.split("?");if(!(i.length>=2))return e;for(var t=encodeURIComponent(a)+"=",o=i[1].split(/[&;]/g),r=o.length;r-- >0;)-1!==o[r].lastIndexOf(t,0)&&o.splice(r,1);return e=0!==o.length?i[0]+"?"+o.join("&"):i[0]}function aiEndsWidth(e,a){return e.substr(-a.length)===a}function aiAddCss(e,a){a=decodeURIComponent(a.replace(/\+/g,"%20"));var i=jQuery(e).contents().find("body"),t=document.createElement("style");t.setAttribute("type","text/css"),t.styleSheet?t.styleSheet.cssText=a:t.appendChild(document.createTextNode(a)),i.append(t)}function aiAddCssFile(e,a){var i=jQuery(e).contents().find("body"),t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href=a,i.append(t)}function aiAddJsFile(e,a){jQuery.ajaxSetup({cache:!0});var i=jQuery(e).contents().find("body"),t=document.createElement("script");t.type="text/javascript",t.src=a,i.append(t)}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 e=jQuery("<input>").attr("type","hidden").attr("name","checkIframes").val("true");jQuery("#ai_form").append(e).submit(),jQuery("#checkIframes").prop("disabled","disabled")}function aiProcessMessage(e,a,i){var t;try{t=JSON.parse(e.data)}catch(o){"debug"===i&&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: ",e)),t=e.data}try{if(t.hasOwnProperty("aitype")&&a===t.id){var r=t.aitype;if("debug"===r)aiProcessDebug(t);else if("scrollToTop"===r)aiProcessScrollToTop(t);else if("anchor"===r)aiProcessAnchor(t);else for(var n in"height"===r?aiProcessHeight(t):"show"===r&&aiProcessShow(t),t.data)t.data.hasOwnProperty(n)&&jQuery(n).html(t.data[n])}}catch(l){"debug"===i&&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(l))}}function aiProcessDebug(e){var a=e.data;let i=jQuery("#aiDebugDiv");0!==i.length&&(a=(a=a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")).replace('"','"').replace(/\\/g,""),i.append('<p class="ai-debug-remote"> r: '+a+"</p>"))}function aiProcessScrollToTop(e){aiScrollToTop(e.id,aiOnloadScrollTop)}function aiProcessAnchor(e){var a=e.id,i=parseInt(e.position,10),t=jQuery("#"+a).offset().top;setTimeout(function(){jQuery("html,body").scrollTop(Math.round(t+i))},100)}function aiProcessHeight(e){var a=e.height,i=e.width,t=parseInt(e.anchor,10),o=e.id;if(null!=a)try{var r=e.loc;null==r||r.includes("send_console_log")||"function"!=typeof aiChangeUrl||aiChangeUrl(r);var n=e.title;if(null!=n&&"undefined"!==n&&""!==n&&(document.title=decodeURIComponent(n)),null!=o){var l=parseInt(a,10),s=parseInt(i,10);if(aiResizeIframeHeightId(l,s,o),!isNaN(t)&&t>-1){var d=jQuery("#"+o).offset().top;setTimeout(function(){jQuery("html,body").scrollTop(Math.round(d+t)),aiShowIframeId(o)},100)}else aiShowIframeId(o)}else alert("Please update the ai_external.js to the current version.")}catch(c){console&&console.log&&console.log(c)}}function aiProcessShow(e){var a=e.id;try{aiShowIframeId(a)}catch(i){console&&console.log&&console.log(i)}}function aiDisableRightClick(e){try{window.frames[e].document.oncontextmenu=function(){return!1}}catch(a){}}function aiRemoveElementsFromHeight(e,a,i){let t=jQuery("#"+e);for(var o=i.split(","),r=0,n=0;n<o.length;n++)try{var l=o[n];if(l.includes("|")){var s=l.split("|"),d=jQuery(s[0]),c=Math.round(d.offset().top+d.outerHeight(!0)),h=Math.round(jQuery(s[1]).offset().top);r+=h-c}else"top"===l?r+=Math.round(t.offset().top):isNaN(l)?r+=jQuery(l).outerHeight(!0):r+=parseInt(l)}catch(f){console&&console.error&&(console.error('Advanced iframe configuration error: The configuration of remove_elements_from_height "'+i+'" is invalid. Please check if the elements you defined do exist and ids/classes are defined properly.'),console.log(f))}var u="calc("+a+" - "+r+"px)";t.css("height",u)}function aiTriggerAutoOpen(e,a,i,t){aiDebugExtended("aiTriggerAutoOpen"),0===i?aiOpenIframeOnClick(e,a):setTimeout(function(){aiOpenIframeOnClick(e,a)},i);var o=new Date,r=o.getTime();o.setTime(r+864e5*t);var n=a.replace(/[^A-Za-z0-9\-]/g,"");document.cookie="ai_disable_autoclick_iframe_"+n+"=Auto open is disabled until this cookie expires;expires="+o.toUTCString()+";path=/"}function aiCheckAutoOpenHash(e,a,i){if(window.location.hash){var t=window.location.hash.replace(/[^A-Za-z0-9\-]/g,"");0!==jQuery(t="#"+t).length&&jQuery(t).first().attr("target")===e&&aiTriggerAutoOpen(e,t,a,i)}}function aiOpenIframeOnClick(e,a){var i=jQuery(a).first().attr("href");jQuery("#"+e).attr("src",i),jQuery(a).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(e,a){a()}),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").hide(),jQuery("html,body").css("overflow","hidden");var e=jQuery(this).data("id");jQuery(".ai-fullscreen-close-"+e).show(),jQuery(document).on("keydown",function(e){"Escape"===e.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 e=!1;if(jQuery("#aiDebugDivTotal").mousedown(function(){e=!1}).mousemove(function(){e=!0}).mouseup(function(){if(!e){var a=jQuery("#aiDebugDiv");Math.floor(a.height())>"300"?a.height("0px"):a.height("400px")}}),"undefined"!=typeof ai_show_id_only){let a=jQuery("#"+ai_show_id_only);if(0===a.length)alert('The element with the id "'+ai_show_id_only+'" cannot be found. Please check your configuration.');else{a.siblings().hide();var i=a.parents();if(i.siblings().hide(),i.css("padding","0px").css("margin","0px").css("overflow","hidden"),parent===top){var t=a[0];t.style.marginTop=t.style.marginBottom="0",t.style.overflow="hidden";var o=JSON.stringify({aitype:"height",height:parseInt(Math.max(t.scrollHeight,t.offsetHeight)+"",10),id:ai_show_id_only});window.parent.postMessage(o,"*")}}}}),String.prototype.includes||(String.prototype.includes=function(e,a){return"number"!=typeof a&&(a=0),!(a+e.length>this.length)&&-1!==this.indexOf(e,a)}),String.prototype.startsWith||(String.prototype.startsWith=function(e,a){return a=a||0,this.indexOf(e,a)===a});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

    r3296849 r3307270  
    55Requires at least: 3.3
    66Tested up to: 6.8.1
    7 Stable tag: 2025.4
     7Stable tag: 2025.5
    88Requires PHP: 5.4
    99License: GPLv2 or later
     
    168168
    169169== Changelog ==
     170= 2025.5 =
     171- Fix: == at the end of src caused the whole parameter to be removed. Now this is supported
     172- Fix: filteredContent variable was not defined properly. Now it is. 
     173
    170174= 2025.4 =
    171175- New: Tested with WordPress 6.8.1
Note: See TracChangeset for help on using the changeset viewer.