Changeset 3491493
- Timestamp:
- 03/26/2026 06:53:10 AM (9 days ago)
- Location:
- easy-table-of-contents/trunk
- Files:
-
- 9 edited
-
README.txt (modified) (3 diffs)
-
assets/js/admin.js (modified) (9 diffs)
-
assets/js/admin.min.js (modified) (1 diff)
-
assets/js/feedback.js (modified) (1 diff)
-
assets/js/feedback.min.js (modified) (1 diff)
-
changelog.txt (modified) (1 diff)
-
easy-table-of-contents.php (modified) (3 diffs)
-
includes/inc.functions.php (modified) (1 diff)
-
includes/inc.plugin-compatibility.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
easy-table-of-contents/trunk/README.txt
r3487716 r3491493 6 6 Tested up to: 6.9 7 7 Requires PHP: 5.6.20 8 Stable tag: 2.0.82. 18 Stable tag: 2.0.82.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 135 135 136 136 == Changelog == 137 = 2.0.82.2 26/03/2026 = 138 * Fixed: Missing null check for global $post causing PHP warnings in REST API post creation #951 139 * Fixed: cn_toc_admin_data is not defined ReferenceError: #950 140 137 141 = 2.0.82.1 21/03/2026 = 138 142 * Fixed: Sticky TOC does not open after the latest update (version 2.0.82). #949 … … 265 269 = 2.0.68.1 21/07/2024 = 266 270 * Fix: Fatal error when inline css is enabled in version 2.0.68 267 268 = 2.0.68 20/07/2024 =269 * Fix: Stored XSS Security Vulnerability disclosed by Cleantalk (Dmitrii Ignatyev)270 * Compatibility: Tested with WordPress version 6.6 #780271 271 272 272 -
easy-table-of-contents/trunk/assets/js/admin.js
r3229539 r3491493 26 26 let text = "Do you want reset settings to default options?"; 27 27 if (confirm(text) == true) { 28 $.post(ajaxurl, { action: 'eztoc_reset_options_to_default', eztoc_security_nonce: cn_toc_admin_data.eztoc_security_nonce },28 $.post(ajaxurl, { action: 'eztoc_reset_options_to_default', eztoc_security_nonce: eztoc_admin_data.eztoc_security_nonce }, 29 29 function (data) { 30 30 alert('Default Options Reset Now!'); … … 42 42 var email = $form.find('input[name="email"]').val(); 43 43 var website = $form.find('input[name="company"]').val(); 44 $.post(ajaxurl, {action: 'eztoc_subscribe_newsletter', name: name, email: email, website: website, eztoc_security_nonce: cn_toc_admin_data.eztoc_security_nonce},44 $.post(ajaxurl, {action: 'eztoc_subscribe_newsletter', name: name, email: email, website: website, eztoc_security_nonce: eztoc_admin_data.eztoc_security_nonce}, 45 45 function (data) { 46 46 if(data === 'security_nonce_not_verified' ){ … … 175 175 /* Newletters js starts here */ 176 176 177 if( cn_toc_admin_data.do_tour){177 if(eztoc_admin_data.do_tour){ 178 178 179 var content = '<h3>'+ cn_toc_admin_data.translable_txt.using_eztoc+'</h3>';180 content += '<p>'+ cn_toc_admin_data.translable_txt.do_you_want+' <b>'+cn_toc_admin_data.translable_txt.sd_update+'</b> '+cn_toc_admin_data.translable_txt.before_others+'</p>';179 var content = '<h3>'+eztoc_admin_data.translable_txt.using_eztoc+'</h3>'; 180 content += '<p>'+eztoc_admin_data.translable_txt.do_you_want+' <b>'+eztoc_admin_data.translable_txt.sd_update+'</b> '+eztoc_admin_data.translable_txt.before_others+'</p>'; 181 181 content += '<style type="text/css">'; 182 182 content += '.wp-pointer-buttons{ padding:0; overflow: hidden; }'; … … 187 187 content += '<div id="eztoc_mc_embed_signup_scroll">'; 188 188 content += '<div class="eztoc-mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">'; 189 content += '<input type="text" name="eztoc_subscriber_name" class="form-control" placeholder="Name" hidden value="'+ cn_toc_admin_data.current_user_name+'" style="display:none">';190 content += '<input type="text" value="'+ cn_toc_admin_data.current_user_email+'" name="eztoc_subscriber_email" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">';191 content += '<input type="text" name="eztoc_subscriber_website" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="'+ cn_toc_admin_data.get_home_url+'">';189 content += '<input type="text" name="eztoc_subscriber_name" class="form-control" placeholder="Name" hidden value="'+eztoc_admin_data.current_user_name+'" style="display:none">'; 190 content += '<input type="text" value="'+eztoc_admin_data.current_user_email+'" name="eztoc_subscriber_email" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">'; 191 content += '<input type="text" name="eztoc_subscriber_website" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="'+eztoc_admin_data.get_home_url+'">'; 192 192 content += '<input type="hidden" name="ml-submit" value="1" />'; 193 193 content += '</div>'; … … 208 208 website = $form.find('input[name="eztoc_subscriber_website"]').val(); 209 209 210 jQuery.post( cn_toc_admin_data.ajax_url,210 jQuery.post(eztoc_admin_data.ajax_url, 211 211 {action:'eztoc_subscribe_newsletter', 212 eztoc_security_nonce: cn_toc_admin_data.eztoc_security_nonce,212 eztoc_security_nonce:eztoc_admin_data.eztoc_security_nonce, 213 213 name:name, email:email, website:website }, 214 214 function(data) { … … 262 262 wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, { 263 263 buttons: function (event, t) { 264 button= $ ('<a id="pointer-close" class="button-secondary">' + cn_toc_admin_data.button1 + '</a>');264 button= $ ('<a id="pointer-close" class="button-secondary">' + eztoc_admin_data.button1 + '</a>'); 265 265 button_2= $ ('#pointer-close.button'); 266 266 button.bind ('click.pointer', function () { … … 276 276 }, 277 277 close: function () { 278 $.post ( cn_toc_admin_data.ajax_url, {278 $.post (eztoc_admin_data.ajax_url, { 279 279 pointer: 'eztoc_subscribe_pointer', 280 280 action: 'dismiss-wp-pointer' … … 286 286 }); 287 287 setup = function () { 288 $( cn_toc_admin_data.displayID).pointer(wp_pointers_tour_opts).pointer('open');289 if ( cn_toc_admin_data.button2) {290 $ ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + cn_toc_admin_data.button2+ '</a>');288 $(eztoc_admin_data.displayID).pointer(wp_pointers_tour_opts).pointer('open'); 289 if (eztoc_admin_data.button2) { 290 $ ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + eztoc_admin_data.button2+ '</a>'); 291 291 $ ('#pointer-primary').click (function () { 292 cn_toc_admin_data.function_name;292 eztoc_admin_data.function_name; 293 293 }); 294 294 $ ('#pointer-close').click (function () { 295 $.post ( cn_toc_admin_data.ajax_url, {295 $.post (eztoc_admin_data.ajax_url, { 296 296 pointer: 'eztoc_subscribe_pointer', 297 297 action: 'dismiss-wp-pointer' … … 555 555 556 556 /* AMP Support Option js starts here */ 557 if( cn_toc_admin_data.is_amp_activated == 0 ){557 if( eztoc_admin_data.is_amp_activated == 0 ){ 558 558 let tocAMPSupportOption = $('input[name="ez-toc-settings[toc-run-on-amp-pages]"]'); 559 559 if (tocAMPSupportOption.length > 0) { -
easy-table-of-contents/trunk/assets/js/admin.min.js
r3229539 r3491493 1 function disableScrolling(){var e=window.scrollX,t=window.scrollY;window.onscroll=function(){window.scrollTo(e,t)}}function enableScrolling(){ezTocSettingsTabsFixed()}jQuery(document).ready((function(e){var t=e(".ez-toc-color-picker");t.length&&t.wpColorPicker();var n=document.getElementById("ez-toc-settings[width]"),s=document.getElementById("ez-toc-settings[width_custom]");s&&("custom"!=n.value&&(s.parentNode.parentNode.style.display="none"),n.addEventListener("change",(function(){"custom"==document.getElementById("ez-toc-settings[width]").value?s.parentNode.parentNode.style.display="revert":s.parentNode.parentNode.style.display="none"}))),e("#reset-options-to-default-button").click((function(){1==confirm("Do you want reset settings to default options?")&&e.post(ajaxurl,{action:"eztoc_reset_options_to_default",eztoc_security_nonce: cn_toc_admin_data.eztoc_security_nonce},(function(e){alert("Default Options Reset Now!"),window.location.reload()}))})),e("#subscribe-newsletter-form").on("submit",(function(t){t.preventDefault();var n=e("#subscribe-newsletter-form"),s=n.find('input[name="name"]').val(),a=n.find('input[name="email"]').val(),i=n.find('input[name="company"]').val();e.post(ajaxurl,{action:"eztoc_subscribe_newsletter",name:s,email:a,website:i,eztoc_security_nonce:cn_toc_admin_data.eztoc_security_nonce},(function(e){if("security_nonce_not_verified"===e)return alert("Security nonce not verified"),!1}))}));let a=e("#eztoc-general").find("select[name='ez-toc-settings[position]']"),i=e("#eztoc-general").find("input[name='ez-toc-settings[custom_para_number]']"),o=e("#eztoc-general").find("input[name='ez-toc-settings[custom_img_number]']"),c=e("#eztoc-general").find("input[name='ez-toc-settings[blockqoute_checkbox]']");"aftercustompara"==e(a).val()?e(i).parents("tr").show():e(i).parents("tr").hide(),"afterpara"==e(a).val()||"aftercustompara"==e(a).val()?e(c).parents("tr").show():e(c).parents("tr").hide(),"aftercustomimg"==e(a).val()?e(o).parents("tr").show():e(o).parents("tr").hide(),e(document).on("change","select[name='ez-toc-settings[position]']",(function(){"aftercustompara"==e(this).val()?e(i).parents("tr").show(500):e(i).parents("tr").hide(500),"afterpara"==e(this).val()||"aftercustompara"==e(this).val()?e(c).parents("tr").show(500):e(c).parents("tr").hide(500),"aftercustomimg"==e(this).val()?e(o).parents("tr").show(500):e(o).parents("tr").hide(500)}));let r=e("#eztoc-general").find("select[name='ez-toc-settings[toc_loading]']"),l=e("#eztoc-general").find("input[name='ez-toc-settings[smooth_scroll]']"),d=e("#eztoc-general").find("input[name='ez-toc-settings[avoid_anch_jump]']"),u=e("#eztoc-advanced").find("select[name='ez-toc-settings[load_js_in]']");"js"==e(r).val()?(e(l).parents("tr").show(),e(d).parents("tr").show(),e(u).parents("tr").show()):(e(l).parents("tr").hide(),e(d).parents("tr").hide(),e(u).parents("tr").hide()),e(document).on("change","select[name='ez-toc-settings[toc_loading]']",(function(){"js"==e(this).val()?(e(l).parents("tr").show(500),e(d).parents("tr").show(500),e(u).parents("tr").show(500)):(e(l).parents("tr").hide(500),e(d).parents("tr").hide(500),e(u).parents("tr").hide(500))}));let p=e("#eztoc-sticky").find("input[name='ez-toc-settings[sticky_highlight_heading]']"),m=e("#eztoc-sticky").find("input[name='ez-toc-settings[sticky_highlight_bg_colour]']"),_=e("#eztoc-sticky").find("input[name='ez-toc-settings[sticky_highlight_title_colour]']");1==e(p).prop("checked")?(e(m).parents("tr").show(),e(_).parents("tr").show()):(e(m).parents("tr").hide(),e(_).parents("tr").hide()),e(document).on("change","input[name='ez-toc-settings[sticky_highlight_heading]']",(function(){1==e(this).prop("checked")?(e(m).parents("tr").show(500),e(_).parents("tr").show(500)):(e(m).parents("tr").hide(500),e(_).parents("tr").hide(500))}));let v=jQuery("#ez-toc").find("select[name='ez-toc-settings[position-specific]']"),g=jQuery("#ez-toc").find("input[name='ez-toc-settings[s_custom_para_number]']"),h=jQuery("#ez-toc").find("input[name='ez-toc-settings[s_custom_img_number]']"),f=jQuery("#ez-toc").find("input[name='ez-toc-settings[s_blockqoute_checkbox]']");if("aftercustompara"==jQuery(v).val()?jQuery(g).parents("tr").show():jQuery(g).parents("tr").hide(),"afterpara"==jQuery(v).val()||"aftercustompara"==jQuery(v).val()?jQuery(f).parents("tr").show():jQuery(f).parents("tr").hide(),"aftercustomimg"==jQuery(v).val()?jQuery(h).parents("tr").show():jQuery(h).parents("tr").hide(),jQuery("#ez-toc").on("change","select[name='ez-toc-settings[position-specific]']",(function(){"aftercustompara"==jQuery(this).val()?jQuery(g).parents("tr").show(500):jQuery(g).parents("tr").hide(500),"afterpara"==jQuery(this).val()||"aftercustompara"==jQuery(this).val()?jQuery(f).parents("tr").show(500):jQuery(f).parents("tr").hide(500),"aftercustomimg"==jQuery(this).val()?jQuery(h).parents("tr").show(500):jQuery(h).parents("tr").hide(500)})),cn_toc_admin_data.do_tour){var y,b="<h3>"+cn_toc_admin_data.translable_txt.using_eztoc+"</h3>";b+="<p>"+cn_toc_admin_data.translable_txt.do_you_want+" <b>"+cn_toc_admin_data.translable_txt.sd_update+"</b> "+cn_toc_admin_data.translable_txt.before_others+"</p>",b+='<style type="text/css">',b+=".wp-pointer-buttons{ padding:0; overflow: hidden; }",b+=".wp-pointer-content .button-secondary{ left: -25px;background: transparent;top: 5px; border: 0;position: relative; padding: 0; box-shadow: none;margin: 0;color: #0085ba;} .wp-pointer-content .button-primary{ display:none} #eztoc_mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }",b+="</style>",b+='<div id="eztoc_mc_embed_signup">',b+='<form method="POST" accept-charset="utf-8" id="eztoc-news-letter-form">',b+='<div id="eztoc_mc_embed_signup_scroll">',b+='<div class="eztoc-mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">',b+='<input type="text" name="eztoc_subscriber_name" class="form-control" placeholder="Name" hidden value="'+cn_toc_admin_data.current_user_name+'" style="display:none">',b+='<input type="text" value="'+cn_toc_admin_data.current_user_email+'" name="eztoc_subscriber_email" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">',b+='<input type="text" name="eztoc_subscriber_website" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="'+cn_toc_admin_data.get_home_url+'">',b+='<input type="hidden" name="ml-submit" value="1" />',b+="</div>",b+='<div id="mce-responses">',b+="</div>",b+='<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>',b+='<input type="submit" value="Subscribe" name="subscribe" id="pointer-close" class="button mc-newsletter-sent" style=" background: #0085ba; border-color: #006799; padding: 0px 16px; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px; margin-top: 1px; color: #fff; box-shadow: 0 1px 0 #006799;">',b+='<p id="eztoc-news-letter-status"></p>',b+="</div>",b+="</form>",b+="</div>",jQuery(document).on("submit","#eztoc-news-letter-form",(function(e){e.preventDefault();var t=jQuery(this),n=t.find('input[name="eztoc_subscriber_name"]').val(),s=t.find('input[name="eztoc_subscriber_email"]').val();website=t.find('input[name="eztoc_subscriber_website"]').val(),jQuery.post(cn_toc_admin_data.ajax_url,{action:"eztoc_subscribe_newsletter",eztoc_security_nonce:cn_toc_admin_data.eztoc_security_nonce,name:n,email:s,website:website},(function(e){e?"Some fields are missing."==e.response||"Invalid email address."==e.response||"Invalid list ID."==e.response||"Already subscribed."==e.response?(jQuery("#eztoc-news-letter-status").text(""),jQuery("#eztoc-news-letter-status").css("color","red")):(jQuery("#eztoc-news-letter-status").text("You're subscribed!"),jQuery("#eztoc-news-letter-status").css("color","green")):alert("Sorry, unable to subscribe. Please try again later!")}),"json")}));var z={content:b,position:{edge:"top",align:"left"}};y=function(){e(cn_toc_admin_data.displayID).pointer(z).pointer("open"),cn_toc_admin_data.button2&&(e("#pointer-close").after('<a id="pointer-primary" class="button-primary">'+cn_toc_admin_data.button2+"</a>"),e("#pointer-primary").click((function(){cn_toc_admin_data.function_name})),e("#pointer-close").click((function(){e.post(cn_toc_admin_data.ajax_url,{pointer:"eztoc_subscribe_pointer",action:"dismiss-wp-pointer"})})))},(z=e.extend(z,{buttons:function(t,n){return button=e('<a id="pointer-close" class="button-secondary">'+cn_toc_admin_data.button1+"</a>"),button_2=e("#pointer-close.button"),button.bind("click.pointer",(function(){n.element.pointer("close")})),button_2.on("click",(function(){setTimeout((function(){n.element.pointer("close")}),3e3)})),button},close:function(){e.post(cn_toc_admin_data.ajax_url,{pointer:"eztoc_subscribe_pointer",action:"dismiss-wp-pointer"})},show:function(e,t){t.pointer.css({left:"170px",top:"160px"})}})).position&&z.position.defer_loading?e(window).bind("load.wp-pointers",y):y()}}));const unsecuredCopyToClipboard=e=>{const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(e){console.error("Unable to copy to clipboard",e)}document.body.removeChild(t)};function ez_toc_clipboard(e,t,n,s){s.preventDefault(),disableScrolling();var a=n.parentNode.parentNode.querySelectorAll("#"+e)[0];a.select(),a.setSelectionRange(0,99999),navigator.clipboard.writeText(a.value),n.querySelectorAll("span."+t)[0].innerHTML="Copied: "+a.value}function ez_toc_outFunc(e,t,n){n.preventDefault(),t.querySelectorAll("span."+e)[0].innerHTML="Copy to clipboard",enableScrolling()}function ezTocSettingsTabsFixed(){var e=document.querySelector("#general #eztoc-tabs"),t=document.querySelector("#general form");window.onscroll=null!==e?function(){var n=window.scrollY,s=document.getElementsByClassName("ez-toc-pro-settings-link-paid"),a=document.getElementsByClassName("general-pro-settings-container"),i=document.querySelector("#general #eztoc-tabs #eztoc-link-general"),o=document.querySelector("#general #eztoc-tabs #eztoc-link-appearance"),c=document.querySelector("#general #eztoc-tabs #eztoc-link-advanced"),r=document.querySelector("#general #eztoc-tabs #eztoc-link-shortcode"),l=document.querySelector("#general #eztoc-tabs #eztoc-link-sticky"),d=document.querySelector("#general #eztoc-tabs #eztoc-link-compatibility"),u=document.querySelector("#general #eztoc-tabs #eztoc-link-iesettings"),p=document.querySelector("#general #eztoc-tabs #eztoc-link-prosettings"),m=100,_=document.querySelector("#general div#eztoc-general").offsetTop-m,v=document.querySelector("#general div#eztoc-appearance").offsetTop-m,g=document.querySelector("#general div#eztoc-advanced").offsetTop-m,h=document.querySelector("#general div#eztoc-shortcode").offsetTop-m,f=document.querySelector("#general div#eztoc-compatibility").offsetTop-m,y=document.querySelector("#general div#eztoc-iesettings").offsetTop-m,b=document.querySelector("#eztoc-sticky").offsetTop-m;if(null!==s&&s.length>0)var z=document.querySelector("#general div#eztoc-prosettings").offsetTop-m-150;else f-=150,y-=150;i.classList.add("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.remove("active"),a.length>0&&null!==p&&p.classList.remove("active"),n>=100?(e.classList.remove("stay"),e.classList.add("moving"),t.classList.add("moving"),null!==s&&s.length>0&&0==a.length&&(e.innerHTML+='<span class="general-pro-settings-container"> | <a href="#eztoc-prosettings" id="eztoc-link-prosettings">Pro Settings</a></span>')):(e.classList.remove("moving"),e.classList.add("stay"),t.classList.remove("moving"),null!==s&&s.length>0&&a.length>0&&document.querySelector(".general-pro-settings-container").remove()),n>=_&&(i.classList.add("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),n>=v&&(i.classList.remove("active"),o.classList.add("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),n>=g&&(i.classList.remove("active"),o.classList.remove("active"),c.classList.add("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),n>=h&&(i.classList.remove("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.add("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),n>=b&&(i.classList.remove("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.add("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),n>=f&&(i.classList.remove("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.add("active"),u.classList.remove("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),n>=y&&(i.classList.remove("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.add("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),a.length>0&&n>=z&&(i.classList.remove("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.add("active"))}:function(){}}function no_heading_text(e){1==jQuery("input[name='ez-toc-settings[no_heading_text]']").prop("checked")?jQuery("input[name='ez-toc-settings[no_heading_text_value]']").parents("tr").show(200):jQuery("input[name='ez-toc-settings[no_heading_text_value]']").parents("tr").hide(200)}function eztoc_truncate_headings(e){let t=jQuery("select[name='ez-toc-settings[truncate_headings]']").val();"words"==t?(jQuery("input[name='ez-toc-settings[truncate_headings_special]']").parents("tr").hide(200),jQuery("input[name='ez-toc-settings[truncate_headings_words]']").parents("tr").show(200)):"special"==t?(jQuery("input[name='ez-toc-settings[truncate_headings_words]']").parents("tr").hide(200),jQuery("input[name='ez-toc-settings[truncate_headings_special]']").parents("tr").show(200)):(jQuery("input[name='ez-toc-settings[truncate_headings_words]']").parents("tr").hide(200),jQuery("input[name='ez-toc-settings[truncate_headings_special]']").parents("tr").hide(200))}function eztoc_schema_sitenav_yoast_compat(){1==jQuery("input[name='ez-toc-settings[schema_sitenav_checkbox]']").prop("checked")?jQuery("input[name='ez-toc-settings[schema_sitenav_yoast_compat]']").parents("tr").show(200):jQuery("input[name='ez-toc-settings[schema_sitenav_yoast_compat]']").parents("tr").hide(200)}ezTocSettingsTabsFixed(),jQuery(document).on("change","input[name='ez-toc-settings[no_heading_text]']",(function(){no_heading_text()})),no_heading_text(),jQuery((function(e){if(0==cn_toc_admin_data.is_amp_activated){let t=e('input[name="ez-toc-settings[toc-run-on-amp-pages]"]');t.length>0&&t.attr("disabled",!0)}})),jQuery((function(e){let t=e("#eztoc-appearance"),n=t.find("input[name='ez-toc-settings[headings-padding]']"),s=["top","bottom","left","right"];s.forEach((e=>{let s=t.find(`input[name='ez-toc-settings[headings-padding-${e}]']`),a=s.parent();var i;s.attr("type","number"),s.parents("tr").remove(),n.parent().append(` <span id='headings-padding-${e}-container'><label for='ez-toc-settings[headings-padding-${e}]'><strong>${i=e,i.charAt(0).toUpperCase()+i.slice(1)}</strong></label> ${a.html()}</span>`),t.find(`select[name='ez-toc-settings[headings-padding-${e}_units]']`).html('<option value="px" selected="selected">px</option>')}));let a={};function i(){s.forEach((e=>{a[e].hide(500),t.find(`input[name='ez-toc-settings[headings-padding-${e}]']`).val(0)}))}s.forEach((e=>{a[e]=t.find(`span#headings-padding-${e}-container`)})),n.prop("checked")||i(),e(document).on("change click","input[name='ez-toc-settings[headings-padding]']",(function(){n.prop("checked")?s.forEach((e=>{a[e].show(500)})):i()}))})),jQuery((function(e){let t=e("#eztoc-general"),n=t.find("input[name='ez-toc-settings[show_heading_text]']"),s=t.find("input[name='ez-toc-settings[visibility_on_header_text]']"),a=t.find("input[name='ez-toc-settings[heading_text]']");function i(){n.prop("checked")?(s.parents("tr").show(500),a.parents("tr").show(500)):(s.parents("tr").hide(500),a.parents("tr").hide(500))}i(),e(document).on("change click","input[name='ez-toc-settings[show_heading_text]']",i)})),jQuery((function(e){let t=e("#eztoc-general"),n=t.find("input[name='ez-toc-settings[visibility]']"),s=t.find("input[name='ez-toc-settings[visibility_hide_by_default]']"),a=t.find("input[name='ez-toc-settings[visibility_hide_by_device][mobile]']"),i=t.find("input[name='ez-toc-settings[visibility_hide_by_device][desktop]']");function o(){n.prop("checked")?(s.parents("tr").show(500),s.prop("checked")&&a.parents("tr").show(500),a.prop("checked")||i.prop("checked")||(i.prop("checked",!0),a.prop("checked",!0))):(s.parents("tr").hide(500),a.parents("tr").hide(500))}function c(){s.prop("checked")?a.parents("tr").show(500):a.parents("tr").hide(500)}function r(){a.prop("checked")||i.prop("checked")||(s.prop("checked",!1),a.parents("tr").hide(500))}o(),c(),e(document).on("change click","input[name='ez-toc-settings[visibility]']",o),e(document).on("change click","input[name='ez-toc-settings[visibility_hide_by_default]']",c),e(document).on("change click","input[name='ez-toc-settings[visibility_hide_by_device][mobile]']",r),e(document).on("change click","input[name='ez-toc-settings[visibility_hide_by_device][desktop]']",r)})),jQuery("#eztoc_migrate_toc").on("click",(function(e){if(e.preventDefault(),!confirm("Migration will overwrite the current Easy TOC settings."))return;jQuery("#eztoc-importer-loader").show();const t=new FormData;t.append("action","eztoc_migrate_tocplus"),t.append("nonce",eztoc_admin_data.eztoc_security_nonce),jQuery.ajax({url:eztoc_admin_data.ajax_url,method:"POST",data:t,processData:!1,contentType:!1,success:function(e){jQuery("#eztoc-importer-loader").hide(),e.success?(alert(e.data),window.location.reload()):alert(e.data)},error:function(){jQuery("#eztoc-importer-loader").hide(),alert("An error occurred while importing the settings.")}})})),jQuery(document).on("change","select[name='ez-toc-settings[truncate_headings]']",(function(){eztoc_truncate_headings()})),eztoc_truncate_headings(),jQuery(document).on("click","input[name='ez-toc-settings[schema_sitenav_checkbox]']",(function(){eztoc_schema_sitenav_yoast_compat()})),eztoc_schema_sitenav_yoast_compat();1 function disableScrolling(){var e=window.scrollX,t=window.scrollY;window.onscroll=function(){window.scrollTo(e,t)}}function enableScrolling(){ezTocSettingsTabsFixed()}jQuery(document).ready((function(e){var t=e(".ez-toc-color-picker");t.length&&t.wpColorPicker();var n=document.getElementById("ez-toc-settings[width]"),s=document.getElementById("ez-toc-settings[width_custom]");s&&("custom"!=n.value&&(s.parentNode.parentNode.style.display="none"),n.addEventListener("change",(function(){"custom"==document.getElementById("ez-toc-settings[width]").value?s.parentNode.parentNode.style.display="revert":s.parentNode.parentNode.style.display="none"}))),e("#reset-options-to-default-button").click((function(){1==confirm("Do you want reset settings to default options?")&&e.post(ajaxurl,{action:"eztoc_reset_options_to_default",eztoc_security_nonce:eztoc_admin_data.eztoc_security_nonce},(function(e){alert("Default Options Reset Now!"),window.location.reload()}))})),e("#subscribe-newsletter-form").on("submit",(function(t){t.preventDefault();var n=e("#subscribe-newsletter-form"),s=n.find('input[name="name"]').val(),a=n.find('input[name="email"]').val(),i=n.find('input[name="company"]').val();e.post(ajaxurl,{action:"eztoc_subscribe_newsletter",name:s,email:a,website:i,eztoc_security_nonce:eztoc_admin_data.eztoc_security_nonce},(function(e){if("security_nonce_not_verified"===e)return alert("Security nonce not verified"),!1}))}));let a=e("#eztoc-general").find("select[name='ez-toc-settings[position]']"),i=e("#eztoc-general").find("input[name='ez-toc-settings[custom_para_number]']"),o=e("#eztoc-general").find("input[name='ez-toc-settings[custom_img_number]']"),c=e("#eztoc-general").find("input[name='ez-toc-settings[blockqoute_checkbox]']");"aftercustompara"==e(a).val()?e(i).parents("tr").show():e(i).parents("tr").hide(),"afterpara"==e(a).val()||"aftercustompara"==e(a).val()?e(c).parents("tr").show():e(c).parents("tr").hide(),"aftercustomimg"==e(a).val()?e(o).parents("tr").show():e(o).parents("tr").hide(),e(document).on("change","select[name='ez-toc-settings[position]']",(function(){"aftercustompara"==e(this).val()?e(i).parents("tr").show(500):e(i).parents("tr").hide(500),"afterpara"==e(this).val()||"aftercustompara"==e(this).val()?e(c).parents("tr").show(500):e(c).parents("tr").hide(500),"aftercustomimg"==e(this).val()?e(o).parents("tr").show(500):e(o).parents("tr").hide(500)}));let r=e("#eztoc-general").find("select[name='ez-toc-settings[toc_loading]']"),l=e("#eztoc-general").find("input[name='ez-toc-settings[smooth_scroll]']"),d=e("#eztoc-general").find("input[name='ez-toc-settings[avoid_anch_jump]']"),u=e("#eztoc-advanced").find("select[name='ez-toc-settings[load_js_in]']");"js"==e(r).val()?(e(l).parents("tr").show(),e(d).parents("tr").show(),e(u).parents("tr").show()):(e(l).parents("tr").hide(),e(d).parents("tr").hide(),e(u).parents("tr").hide()),e(document).on("change","select[name='ez-toc-settings[toc_loading]']",(function(){"js"==e(this).val()?(e(l).parents("tr").show(500),e(d).parents("tr").show(500),e(u).parents("tr").show(500)):(e(l).parents("tr").hide(500),e(d).parents("tr").hide(500),e(u).parents("tr").hide(500))}));let p=e("#eztoc-sticky").find("input[name='ez-toc-settings[sticky_highlight_heading]']"),m=e("#eztoc-sticky").find("input[name='ez-toc-settings[sticky_highlight_bg_colour]']"),_=e("#eztoc-sticky").find("input[name='ez-toc-settings[sticky_highlight_title_colour]']");1==e(p).prop("checked")?(e(m).parents("tr").show(),e(_).parents("tr").show()):(e(m).parents("tr").hide(),e(_).parents("tr").hide()),e(document).on("change","input[name='ez-toc-settings[sticky_highlight_heading]']",(function(){1==e(this).prop("checked")?(e(m).parents("tr").show(500),e(_).parents("tr").show(500)):(e(m).parents("tr").hide(500),e(_).parents("tr").hide(500))}));let v=jQuery("#ez-toc").find("select[name='ez-toc-settings[position-specific]']"),g=jQuery("#ez-toc").find("input[name='ez-toc-settings[s_custom_para_number]']"),h=jQuery("#ez-toc").find("input[name='ez-toc-settings[s_custom_img_number]']"),f=jQuery("#ez-toc").find("input[name='ez-toc-settings[s_blockqoute_checkbox]']");if("aftercustompara"==jQuery(v).val()?jQuery(g).parents("tr").show():jQuery(g).parents("tr").hide(),"afterpara"==jQuery(v).val()||"aftercustompara"==jQuery(v).val()?jQuery(f).parents("tr").show():jQuery(f).parents("tr").hide(),"aftercustomimg"==jQuery(v).val()?jQuery(h).parents("tr").show():jQuery(h).parents("tr").hide(),jQuery("#ez-toc").on("change","select[name='ez-toc-settings[position-specific]']",(function(){"aftercustompara"==jQuery(this).val()?jQuery(g).parents("tr").show(500):jQuery(g).parents("tr").hide(500),"afterpara"==jQuery(this).val()||"aftercustompara"==jQuery(this).val()?jQuery(f).parents("tr").show(500):jQuery(f).parents("tr").hide(500),"aftercustomimg"==jQuery(this).val()?jQuery(h).parents("tr").show(500):jQuery(h).parents("tr").hide(500)})),eztoc_admin_data.do_tour){var y,b="<h3>"+eztoc_admin_data.translable_txt.using_eztoc+"</h3>";b+="<p>"+eztoc_admin_data.translable_txt.do_you_want+" <b>"+eztoc_admin_data.translable_txt.sd_update+"</b> "+eztoc_admin_data.translable_txt.before_others+"</p>",b+='<style type="text/css">',b+=".wp-pointer-buttons{ padding:0; overflow: hidden; }",b+=".wp-pointer-content .button-secondary{ left: -25px;background: transparent;top: 5px; border: 0;position: relative; padding: 0; box-shadow: none;margin: 0;color: #0085ba;} .wp-pointer-content .button-primary{ display:none} #eztoc_mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }",b+="</style>",b+='<div id="eztoc_mc_embed_signup">',b+='<form method="POST" accept-charset="utf-8" id="eztoc-news-letter-form">',b+='<div id="eztoc_mc_embed_signup_scroll">',b+='<div class="eztoc-mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">',b+='<input type="text" name="eztoc_subscriber_name" class="form-control" placeholder="Name" hidden value="'+eztoc_admin_data.current_user_name+'" style="display:none">',b+='<input type="text" value="'+eztoc_admin_data.current_user_email+'" name="eztoc_subscriber_email" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">',b+='<input type="text" name="eztoc_subscriber_website" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="'+eztoc_admin_data.get_home_url+'">',b+='<input type="hidden" name="ml-submit" value="1" />',b+="</div>",b+='<div id="mce-responses">',b+="</div>",b+='<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>',b+='<input type="submit" value="Subscribe" name="subscribe" id="pointer-close" class="button mc-newsletter-sent" style=" background: #0085ba; border-color: #006799; padding: 0px 16px; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px; margin-top: 1px; color: #fff; box-shadow: 0 1px 0 #006799;">',b+='<p id="eztoc-news-letter-status"></p>',b+="</div>",b+="</form>",b+="</div>",jQuery(document).on("submit","#eztoc-news-letter-form",(function(e){e.preventDefault();var t=jQuery(this),n=t.find('input[name="eztoc_subscriber_name"]').val(),s=t.find('input[name="eztoc_subscriber_email"]').val();website=t.find('input[name="eztoc_subscriber_website"]').val(),jQuery.post(eztoc_admin_data.ajax_url,{action:"eztoc_subscribe_newsletter",eztoc_security_nonce:eztoc_admin_data.eztoc_security_nonce,name:n,email:s,website:website},(function(e){e?"Some fields are missing."==e.response||"Invalid email address."==e.response||"Invalid list ID."==e.response||"Already subscribed."==e.response?(jQuery("#eztoc-news-letter-status").text(""),jQuery("#eztoc-news-letter-status").css("color","red")):(jQuery("#eztoc-news-letter-status").text("You're subscribed!"),jQuery("#eztoc-news-letter-status").css("color","green")):alert("Sorry, unable to subscribe. Please try again later!")}),"json")}));var z={content:b,position:{edge:"top",align:"left"}};y=function(){e(eztoc_admin_data.displayID).pointer(z).pointer("open"),eztoc_admin_data.button2&&(e("#pointer-close").after('<a id="pointer-primary" class="button-primary">'+eztoc_admin_data.button2+"</a>"),e("#pointer-primary").click((function(){eztoc_admin_data.function_name})),e("#pointer-close").click((function(){e.post(eztoc_admin_data.ajax_url,{pointer:"eztoc_subscribe_pointer",action:"dismiss-wp-pointer"})})))},(z=e.extend(z,{buttons:function(t,n){return button=e('<a id="pointer-close" class="button-secondary">'+eztoc_admin_data.button1+"</a>"),button_2=e("#pointer-close.button"),button.bind("click.pointer",(function(){n.element.pointer("close")})),button_2.on("click",(function(){setTimeout((function(){n.element.pointer("close")}),3e3)})),button},close:function(){e.post(eztoc_admin_data.ajax_url,{pointer:"eztoc_subscribe_pointer",action:"dismiss-wp-pointer"})},show:function(e,t){t.pointer.css({left:"170px",top:"160px"})}})).position&&z.position.defer_loading?e(window).bind("load.wp-pointers",y):y()}}));const unsecuredCopyToClipboard=e=>{const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(e){console.error("Unable to copy to clipboard",e)}document.body.removeChild(t)};function ez_toc_clipboard(e,t,n,s){s.preventDefault(),disableScrolling();var a=n.parentNode.parentNode.querySelectorAll("#"+e)[0];a.select(),a.setSelectionRange(0,99999),navigator.clipboard.writeText(a.value),n.querySelectorAll("span."+t)[0].innerHTML="Copied: "+a.value}function ez_toc_outFunc(e,t,n){n.preventDefault(),t.querySelectorAll("span."+e)[0].innerHTML="Copy to clipboard",enableScrolling()}function ezTocSettingsTabsFixed(){var e=document.querySelector("#general #eztoc-tabs"),t=document.querySelector("#general form");window.onscroll=null!==e?function(){var n=window.scrollY,s=document.getElementsByClassName("ez-toc-pro-settings-link-paid"),a=document.getElementsByClassName("general-pro-settings-container"),i=document.querySelector("#general #eztoc-tabs #eztoc-link-general"),o=document.querySelector("#general #eztoc-tabs #eztoc-link-appearance"),c=document.querySelector("#general #eztoc-tabs #eztoc-link-advanced"),r=document.querySelector("#general #eztoc-tabs #eztoc-link-shortcode"),l=document.querySelector("#general #eztoc-tabs #eztoc-link-sticky"),d=document.querySelector("#general #eztoc-tabs #eztoc-link-compatibility"),u=document.querySelector("#general #eztoc-tabs #eztoc-link-iesettings"),p=document.querySelector("#general #eztoc-tabs #eztoc-link-prosettings"),m=100,_=document.querySelector("#general div#eztoc-general").offsetTop-m,v=document.querySelector("#general div#eztoc-appearance").offsetTop-m,g=document.querySelector("#general div#eztoc-advanced").offsetTop-m,h=document.querySelector("#general div#eztoc-shortcode").offsetTop-m,f=document.querySelector("#general div#eztoc-compatibility").offsetTop-m,y=document.querySelector("#general div#eztoc-iesettings").offsetTop-m,b=document.querySelector("#eztoc-sticky").offsetTop-m;if(null!==s&&s.length>0)var z=document.querySelector("#general div#eztoc-prosettings").offsetTop-m-150;else f-=150,y-=150;i.classList.add("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.remove("active"),a.length>0&&null!==p&&p.classList.remove("active"),n>=100?(e.classList.remove("stay"),e.classList.add("moving"),t.classList.add("moving"),null!==s&&s.length>0&&0==a.length&&(e.innerHTML+='<span class="general-pro-settings-container"> | <a href="#eztoc-prosettings" id="eztoc-link-prosettings">Pro Settings</a></span>')):(e.classList.remove("moving"),e.classList.add("stay"),t.classList.remove("moving"),null!==s&&s.length>0&&a.length>0&&document.querySelector(".general-pro-settings-container").remove()),n>=_&&(i.classList.add("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),n>=v&&(i.classList.remove("active"),o.classList.add("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),n>=g&&(i.classList.remove("active"),o.classList.remove("active"),c.classList.add("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),n>=h&&(i.classList.remove("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.add("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),n>=b&&(i.classList.remove("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.add("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),n>=f&&(i.classList.remove("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.add("active"),u.classList.remove("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),n>=y&&(i.classList.remove("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.add("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.remove("active")),a.length>0&&n>=z&&(i.classList.remove("active"),o.classList.remove("active"),c.classList.remove("active"),r.classList.remove("active"),d.classList.remove("active"),u.classList.remove("active"),l.classList.remove("active"),null!==s&&s.length>0&&a.length>0&&null!==p&&p.classList.add("active"))}:function(){}}function no_heading_text(e){1==jQuery("input[name='ez-toc-settings[no_heading_text]']").prop("checked")?jQuery("input[name='ez-toc-settings[no_heading_text_value]']").parents("tr").show(200):jQuery("input[name='ez-toc-settings[no_heading_text_value]']").parents("tr").hide(200)}function eztoc_truncate_headings(e){let t=jQuery("select[name='ez-toc-settings[truncate_headings]']").val();"words"==t?(jQuery("input[name='ez-toc-settings[truncate_headings_special]']").parents("tr").hide(200),jQuery("input[name='ez-toc-settings[truncate_headings_words]']").parents("tr").show(200)):"special"==t?(jQuery("input[name='ez-toc-settings[truncate_headings_words]']").parents("tr").hide(200),jQuery("input[name='ez-toc-settings[truncate_headings_special]']").parents("tr").show(200)):(jQuery("input[name='ez-toc-settings[truncate_headings_words]']").parents("tr").hide(200),jQuery("input[name='ez-toc-settings[truncate_headings_special]']").parents("tr").hide(200))}function eztoc_schema_sitenav_yoast_compat(){1==jQuery("input[name='ez-toc-settings[schema_sitenav_checkbox]']").prop("checked")?jQuery("input[name='ez-toc-settings[schema_sitenav_yoast_compat]']").parents("tr").show(200):jQuery("input[name='ez-toc-settings[schema_sitenav_yoast_compat]']").parents("tr").hide(200)}ezTocSettingsTabsFixed(),jQuery(document).on("change","input[name='ez-toc-settings[no_heading_text]']",(function(){no_heading_text()})),no_heading_text(),jQuery((function(e){if(0==eztoc_admin_data.is_amp_activated){let t=e('input[name="ez-toc-settings[toc-run-on-amp-pages]"]');t.length>0&&t.attr("disabled",!0)}})),jQuery((function(e){let t=e("#eztoc-appearance"),n=t.find("input[name='ez-toc-settings[headings-padding]']"),s=["top","bottom","left","right"];s.forEach((e=>{let s=t.find(`input[name='ez-toc-settings[headings-padding-${e}]']`),a=s.parent();var i;s.attr("type","number"),s.parents("tr").remove(),n.parent().append(` <span id='headings-padding-${e}-container'><label for='ez-toc-settings[headings-padding-${e}]'><strong>${i=e,i.charAt(0).toUpperCase()+i.slice(1)}</strong></label> ${a.html()}</span>`),t.find(`select[name='ez-toc-settings[headings-padding-${e}_units]']`).html('<option value="px" selected="selected">px</option>')}));let a={};function i(){s.forEach((e=>{a[e].hide(500),t.find(`input[name='ez-toc-settings[headings-padding-${e}]']`).val(0)}))}s.forEach((e=>{a[e]=t.find(`span#headings-padding-${e}-container`)})),n.prop("checked")||i(),e(document).on("change click","input[name='ez-toc-settings[headings-padding]']",(function(){n.prop("checked")?s.forEach((e=>{a[e].show(500)})):i()}))})),jQuery((function(e){let t=e("#eztoc-general"),n=t.find("input[name='ez-toc-settings[show_heading_text]']"),s=t.find("input[name='ez-toc-settings[visibility_on_header_text]']"),a=t.find("input[name='ez-toc-settings[heading_text]']");function i(){n.prop("checked")?(s.parents("tr").show(500),a.parents("tr").show(500)):(s.parents("tr").hide(500),a.parents("tr").hide(500))}i(),e(document).on("change click","input[name='ez-toc-settings[show_heading_text]']",i)})),jQuery((function(e){let t=e("#eztoc-general"),n=t.find("input[name='ez-toc-settings[visibility]']"),s=t.find("input[name='ez-toc-settings[visibility_hide_by_default]']"),a=t.find("input[name='ez-toc-settings[visibility_hide_by_device][mobile]']"),i=t.find("input[name='ez-toc-settings[visibility_hide_by_device][desktop]']");function o(){n.prop("checked")?(s.parents("tr").show(500),s.prop("checked")&&a.parents("tr").show(500),a.prop("checked")||i.prop("checked")||(i.prop("checked",!0),a.prop("checked",!0))):(s.parents("tr").hide(500),a.parents("tr").hide(500))}function c(){s.prop("checked")?a.parents("tr").show(500):a.parents("tr").hide(500)}function r(){a.prop("checked")||i.prop("checked")||(s.prop("checked",!1),a.parents("tr").hide(500))}o(),c(),e(document).on("change click","input[name='ez-toc-settings[visibility]']",o),e(document).on("change click","input[name='ez-toc-settings[visibility_hide_by_default]']",c),e(document).on("change click","input[name='ez-toc-settings[visibility_hide_by_device][mobile]']",r),e(document).on("change click","input[name='ez-toc-settings[visibility_hide_by_device][desktop]']",r)})),jQuery("#eztoc_migrate_toc").on("click",(function(e){if(e.preventDefault(),!confirm("Migration will overwrite the current Easy TOC settings."))return;jQuery("#eztoc-importer-loader").show();const t=new FormData;t.append("action","eztoc_migrate_tocplus"),t.append("nonce",eztoc_admin_data.eztoc_security_nonce),jQuery.ajax({url:eztoc_admin_data.ajax_url,method:"POST",data:t,processData:!1,contentType:!1,success:function(e){jQuery("#eztoc-importer-loader").hide(),e.success?(alert(e.data),window.location.reload()):alert(e.data)},error:function(){jQuery("#eztoc-importer-loader").hide(),alert("An error occurred while importing the settings.")}})})),jQuery(document).on("change","select[name='ez-toc-settings[truncate_headings]']",(function(){eztoc_truncate_headings()})),eztoc_truncate_headings(),jQuery(document).on("click","input[name='ez-toc-settings[schema_sitenav_checkbox]']",(function(){eztoc_schema_sitenav_yoast_compat()})),eztoc_schema_sitenav_yoast_compat(); -
easy-table-of-contents/trunk/assets/js/feedback.js
r3142663 r3491493 38 38 $.post(ajaxurl, { 39 39 action: 'eztoc_send_feedback', 40 data: $('#eztoc-reloaded-feedback-content form').serialize() + "&eztoc_security_nonce=" + cn_toc_admin_data.eztoc_security_nonce40 data: $('#eztoc-reloaded-feedback-content form').serialize() + "&eztoc_security_nonce=" + eztoc_admin_data.eztoc_security_nonce 41 41 }, 42 42 function (data) { -
easy-table-of-contents/trunk/assets/js/feedback.min.js
r3142663 r3491493 1 var strict;jQuery(document).ready(function(e){eztoc_deactivate_link_url=(eztoc_deactivate_link=e('.wp-admin.plugins-php tr[data-slug="easy-table-of-contents"] .row-actions .deactivate a')).attr("href"),eztoc_deactivate_link.click(function(t){t.preventDefault(),void 0===function e(t){var a,o,c,n=document.cookie.split(";");for(a=0;a<n.length;a++)if(o=n[a].substr(0,n[a].indexOf("=")),c=n[a].substr(n[a].indexOf("=")+1),(o=o.replace(/^\s+|\s+$/g,""))===t)return unescape(c)}("eztoc_hide_deactivate_feedback")?e("#eztoc-reloaded-feedback-overlay").show():window.location.href=eztoc_deactivate_link_url}),e('#eztoc-reloaded-feedback-content input[type="radio"]').click(function(){var t=e(this).parents("li").next("li").children('input[type="text"], textarea');e(this).parents("ul").find('input[type="text"], textarea').not(t).hide().val("").attr("required",!1),t.attr("required","required").show()}),e("#eztoc-reloaded-feedback-content form").submit(function(a){a.preventDefault(),t(),e.post(ajaxurl,{action:"eztoc_send_feedback",data:e("#eztoc-reloaded-feedback-content form").serialize()+"&eztoc_security_nonce="+ cn_toc_admin_data.eztoc_security_nonce},function(t){"sent"==t?(e("#eztoc-reloaded-feedback-overlay").remove(),window.location.href=eztoc_deactivate_link_url):(console.log("Error: "+t),alert(t))})}),e("#eztoc-reloaded-feedback-content .eztoc-feedback-only-deactivate").click(function(a){a.preventDefault(),t(),e("#eztoc-reloaded-feedback-overlay").remove(),window.location.href=eztoc_deactivate_link_url}),e(".eztoc-feedback-not-deactivate").click(function(t){e("#eztoc-reloaded-feedback-content form")[0].reset();var a=e('#eztoc-reloaded-feedback-content input[type="radio"]').parents("li").next("li").children('input[type="text"], textarea');e(a).parents("ul").find('input[type="text"], textarea').hide().val("").attr("required",!1),e("#eztoc-reloaded-feedback-overlay").hide()});function t(){var e=new Date;e.setSeconds(e.getSeconds()+2592e3),document.cookie="eztoc_hide_deactivate_feedback=1; expires="+e.toUTCString()+"; path=/"}});1 var strict;jQuery(document).ready(function(e){eztoc_deactivate_link_url=(eztoc_deactivate_link=e('.wp-admin.plugins-php tr[data-slug="easy-table-of-contents"] .row-actions .deactivate a')).attr("href"),eztoc_deactivate_link.click(function(t){t.preventDefault(),void 0===function e(t){var a,o,c,n=document.cookie.split(";");for(a=0;a<n.length;a++)if(o=n[a].substr(0,n[a].indexOf("=")),c=n[a].substr(n[a].indexOf("=")+1),(o=o.replace(/^\s+|\s+$/g,""))===t)return unescape(c)}("eztoc_hide_deactivate_feedback")?e("#eztoc-reloaded-feedback-overlay").show():window.location.href=eztoc_deactivate_link_url}),e('#eztoc-reloaded-feedback-content input[type="radio"]').click(function(){var t=e(this).parents("li").next("li").children('input[type="text"], textarea');e(this).parents("ul").find('input[type="text"], textarea').not(t).hide().val("").attr("required",!1),t.attr("required","required").show()}),e("#eztoc-reloaded-feedback-content form").submit(function(a){a.preventDefault(),t(),e.post(ajaxurl,{action:"eztoc_send_feedback",data:e("#eztoc-reloaded-feedback-content form").serialize()+"&eztoc_security_nonce="+eztoc_admin_data.eztoc_security_nonce},function(t){"sent"==t?(e("#eztoc-reloaded-feedback-overlay").remove(),window.location.href=eztoc_deactivate_link_url):(console.log("Error: "+t),alert(t))})}),e("#eztoc-reloaded-feedback-content .eztoc-feedback-only-deactivate").click(function(a){a.preventDefault(),t(),e("#eztoc-reloaded-feedback-overlay").remove(),window.location.href=eztoc_deactivate_link_url}),e(".eztoc-feedback-not-deactivate").click(function(t){e("#eztoc-reloaded-feedback-content form")[0].reset();var a=e('#eztoc-reloaded-feedback-content input[type="radio"]').parents("li").next("li").children('input[type="text"], textarea');e(a).parents("ul").find('input[type="text"], textarea').hide().val("").attr("required",!1),e("#eztoc-reloaded-feedback-overlay").hide()});function t(){var e=new Date;e.setSeconds(e.getSeconds()+2592e3),document.cookie="eztoc_hide_deactivate_feedback=1; expires="+e.toUTCString()+"; path=/"}}); -
easy-table-of-contents/trunk/changelog.txt
r3487716 r3491493 1 1 == Changelog == 2 = 2.0.82.2 26/03/2026 = 3 * Fixed: Missing null check for global $post causing PHP warnings in REST API post creation #951 4 * Fixed: cn_toc_admin_data is not defined ReferenceError: #950 5 2 6 = 2.0.82.1 21/03/2026 = 3 7 * Fixed: Sticky TOC does not open after the latest update (version 2.0.82). #949 -
easy-table-of-contents/trunk/easy-table-of-contents.php
r3487716 r3491493 4 4 * Plugin URI: https://tocwp.com/ 5 5 * Description: Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content. 6 * Version: 2.0.82. 16 * Version: 2.0.82.2 7 7 * Author: Magazine3 8 8 * Author URI: https://tocwp.com/ … … 29 29 * @category Plugin 30 30 * @author Magazine3 31 * @version 2.0.82. 131 * @version 2.0.82.2 32 32 */ 33 33 … … 53 53 * @var string 54 54 */ 55 const VERSION = '2.0.82. 1';55 const VERSION = '2.0.82.2'; 56 56 57 57 /** -
easy-table-of-contents/trunk/includes/inc.functions.php
r3487103 r3491493 311 311 function eztoc_auto_device_target_status(){ 312 312 global $post; 313 if ( ! ( $post instanceof WP_Post ) || empty( $post->ID ) ) { 314 return true; 315 } 313 316 $status = true; 314 317 $global_target = ezTOC_Option::get( 'device_target' ); -
easy-table-of-contents/trunk/includes/inc.plugin-compatibility.php
r3429975 r3491493 745 745 746 746 global $post; 747 if ( ! ( $post instanceof WP_Post ) || empty( $post->ID ) ) { 748 return $status; 749 } 747 750 if(function_exists('CFS')){ 748 751 $fields = CFS()->get(false, $post->ID);
Note: See TracChangeset
for help on using the changeset viewer.