Easy Table of Contents - Version 2.0.39

Version Description

11/30/2022 = * BUG: Toggle Icons going to opposite side when rtl option settings used #348 * BUG: Newsletter subscribe form is not popping up during plugin activation. #344 * BUG: Causing CLS issues #339 * BUG: Unable to access Divi module when Sticky Toggle is enable. #309 * BUG: When the name of the Open Button Text in sticky toggle is long, the sticky toggle is not working on mobile devices. #294

Download this release

Release Info

Developer magazine3
Plugin Icon 128x128 Easy Table of Contents
Version 2.0.39
Comparing to
See all releases

Code changes from version 2.0.38 to 2.0.39

README.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: magazine3
3
  Donate link: https://tocwp.com/
4
  Tags: table of contents, toc
5
  Requires at least: 5.3
6
- Tested up to: 6.1
7
  Requires PHP: 5.6.20
8
- Stable tag: 2.0.38
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -105,6 +105,13 @@ Easy Table Contents is a fork of the excellent [Table of Contents Plus](https://
105
  4. Activate the plugin on the Plugins admin page.
106
 
107
  == Changelog ==
 
 
 
 
 
 
 
108
  = 2.0.38 11/21/2022 =
109
  * BUG: Deactivate Feedback Form need to be filtered #345
110
  * NEW: BFCM internal offer #342
3
  Donate link: https://tocwp.com/
4
  Tags: table of contents, toc
5
  Requires at least: 5.3
6
+ Tested up to: 6.1.1
7
  Requires PHP: 5.6.20
8
+ Stable tag: 2.0.39
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
105
  4. Activate the plugin on the Plugins admin page.
106
 
107
  == Changelog ==
108
+ = 2.0.39 11/30/2022 =
109
+ * BUG: Toggle Icons going to opposite side when rtl option settings used #348
110
+ * BUG: Newsletter subscribe form is not popping up during plugin activation. #344
111
+ * BUG: Causing CLS issues #339
112
+ * BUG: Unable to access Divi module when Sticky Toggle is enable. #309
113
+ * BUG: When the name of the Open Button Text in sticky toggle is long, the sticky toggle is not working on mobile devices. #294
114
+
115
  = 2.0.38 11/21/2022 =
116
  * BUG: Deactivate Feedback Form need to be filtered #345
117
  * NEW: BFCM internal offer #342
assets/css/screen.css CHANGED
@@ -313,6 +313,10 @@ div.ez-toc-widget-container li {
313
  display: none;
314
  }
315
 
 
 
 
 
316
  #ez-toc-container label {
317
  float: right;
318
  position: relative;
313
  display: none;
314
  }
315
 
316
+ #ez-toc-container nav ul.eztoc-visibility-hide-by-default, #ez-toc-widget-container nav ul.eztoc-visibility-hide-by-default {
317
+ display: none;
318
+ }
319
+
320
  #ez-toc-container label {
321
  float: right;
322
  position: relative;
assets/css/screen.min.css CHANGED
@@ -1 +1 @@
1
- #ez-toc-container{background:#f9f9f9;border:1px solid #aaa;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05);display:table;margin-bottom:1em;padding:10px;position:relative;width:auto}div.ez-toc-widget-container{padding:0;position:relative}#ez-toc-container.ez-toc-light-blue{background:#edf6ff}#ez-toc-container.ez-toc-white{background:#fff}#ez-toc-container.ez-toc-black{background:#000}#ez-toc-container.ez-toc-transparent{background:none}div.ez-toc-widget-container ul{display:block}div.ez-toc-widget-container li{border:none;padding:0}div.ez-toc-widget-container ul.ez-toc-list{padding:10px}#ez-toc-container ul ul,.ez-toc div.ez-toc-widget-container ul ul{margin-left:1.5em}#ez-toc-container li,#ez-toc-container ul{padding:0}#ez-toc-container li,#ez-toc-container ul,#ez-toc-container ul li,div.ez-toc-widget-container,div.ez-toc-widget-container li{background:0 0;list-style:none;line-height:1.6;margin:0;overflow:hidden;z-index:1}#ez-toc-container p.ez-toc-title{text-align:left;line-height:1.45;margin:0;padding:0}.ez-toc-title-container{display:table;width:100%}.ez-toc-title,.ez-toc-title-toggle{display:inline;text-align:left;vertical-align:middle}.ez-toc-btn,.ez-toc-glyphicon{display:inline-block;font-weight:400}#ez-toc-container.ez-toc-black a,#ez-toc-container.ez-toc-black a:visited,#ez-toc-container.ez-toc-black p.ez-toc-title{color:#fff}#ez-toc-container div.ez-toc-title-container+ul.ez-toc-list{margin-top:1em}.ez-toc-wrap-left{float:left;margin-right:10px}.ez-toc-wrap-right{float:right;margin-left:10px}#ez-toc-container a{color:#444;box-shadow:none;text-decoration:none;text-shadow:none;display:inline-flex;align-items:stretch;flex-wrap:nowrap}#ez-toc-container a:visited{color:#9f9f9f}#ez-toc-container a:hover{text-decoration:underline}.ez-toc-widget-container ul.ez-toc-list li::before{content:' ';position:absolute;left:0;right:0;height:30px;line-height:30px;z-index:-1}.ez-toc-widget-container ul.ez-toc-list li.active{background-color:#ededed;height:auto!important}.ez-toc-widget-container li.active>a{font-weight:900}.ez-toc-btn{padding:6px 12px;margin-bottom:0;font-size:14px;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.ez-toc-btn:focus{outline:#333 dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.ez-toc-btn:focus,.ez-toc-btn:hover{color:#333;text-decoration:none}.ez-toc-btn.active,.ez-toc-btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.ez-toc-btn-default{color:#333;background-color:#fff;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);text-shadow:0 1px 0 #fff;background-image:-webkit-gradient(linear,left 0,left 100%,from(#fff),to(#e0e0e0));background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-moz-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);background-repeat:repeat-x;border-color:#ccc}.ez-toc-btn-default.active,.ez-toc-btn-default:active,.ez-toc-btn-default:focus,.ez-toc-btn-default:hover{color:#333;background-color:#ebebeb;border-color:#adadad}.ez-toc-btn-default.active,.ez-toc-btn-default:active{background-image:none;background-color:#e0e0e0;border-color:#dbdbdb}.ez-toc-btn-sm,.ez-toc-btn-xs{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.ez-toc-btn-xs{padding:1px 5px}.ez-toc-btn-default:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.active,.ez-toc-btn:active{background-image:none}.ez-toc-btn-default:focus,.ez-toc-btn-default:hover{background-color:#e0e0e0;background-position:0 -15px}.ez-toc-pull-right{float:right!important;margin-left:10px}#ez-toc-container label.cssicon,#ez-toc-widget-container label.cssicon{height:30px}.ez-toc-glyphicon{position:relative;top:1px;font-family:'Glyphicons Halflings';-webkit-font-smoothing:antialiased;font-style:normal;line-height:1;-moz-osx-font-smoothing:grayscale}.ez-toc-glyphicon:empty{width:1em}.ez-toc-toggle i.ez-toc-glyphicon,label.cssicon .ez-toc-glyphicon:empty{font-size:16px;margin-left:2px}#ez-toc-container input,.ez-toc-toggle #item{position:absolute;left:-999em}#ez-toc-container input[type=checkbox]:checked+nav,#ez-toc-widget-container input[type=checkbox]:checked+nav{opacity:0;max-height:0;border:none;display:none}#ez-toc-container label{float:right;position:relative;font-size:16px;padding:0 4px 0 5px;border:1px solid #999191;border-radius:5px;cursor:pointer;width:30px;left:10px}#ez-toc-container .ez-toc-toggle label,#ez-toc-container label.cssicon,#ez-toc-widget-container label.cssicon{float:right;position:relative;font-size:16px;padding:0;border:1px solid #999191;border-radius:5px;cursor:pointer;left:10px;width:35px}div#ez-toc-container p.ez-toc-title{display:contents}div#ez-toc-container{padding-right:20px}.ez-toc-wrap-center{margin:0 auto}#ez-toc-container a.ez-toc-toggle{display:flex;align-items:center;color:#444;background:inherit;border:inherit}label.cssiconcheckbox{display:none}.ez-toc-widget-container ul li a{padding-left:10px;display:inline-flex;align-items:stretch;flex-wrap:nowrap}
1
+ #ez-toc-container{background:#f9f9f9;border:1px solid #aaa;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05);display:table;margin-bottom:1em;padding:10px;position:relative;width:auto}div.ez-toc-widget-container{padding:0;position:relative}#ez-toc-container.ez-toc-light-blue{background:#edf6ff}#ez-toc-container.ez-toc-white{background:#fff}#ez-toc-container.ez-toc-black{background:#000}#ez-toc-container.ez-toc-transparent{background:none}div.ez-toc-widget-container ul{display:block}div.ez-toc-widget-container li{border:none;padding:0}div.ez-toc-widget-container ul.ez-toc-list{padding:10px}#ez-toc-container ul ul,.ez-toc div.ez-toc-widget-container ul ul{margin-left:1.5em}#ez-toc-container li,#ez-toc-container ul{padding:0}#ez-toc-container li,#ez-toc-container ul,#ez-toc-container ul li,div.ez-toc-widget-container,div.ez-toc-widget-container li{background:0 0;list-style:none;line-height:1.6;margin:0;overflow:hidden;z-index:1}#ez-toc-container p.ez-toc-title{text-align:left;line-height:1.45;margin:0;padding:0}.ez-toc-title-container{display:table;width:100%}.ez-toc-title,.ez-toc-title-toggle{display:inline;text-align:left;vertical-align:middle}.ez-toc-btn,.ez-toc-glyphicon{display:inline-block;font-weight:400}#ez-toc-container.ez-toc-black a,#ez-toc-container.ez-toc-black a:visited,#ez-toc-container.ez-toc-black p.ez-toc-title{color:#fff}#ez-toc-container div.ez-toc-title-container+ul.ez-toc-list{margin-top:1em}.ez-toc-wrap-left{float:left;margin-right:10px}.ez-toc-wrap-right{float:right;margin-left:10px}#ez-toc-container a{color:#444;box-shadow:none;text-decoration:none;text-shadow:none;display:inline-flex;align-items:stretch;flex-wrap:nowrap}#ez-toc-container a:visited{color:#9f9f9f}#ez-toc-container a:hover{text-decoration:underline}.ez-toc-widget-container ul.ez-toc-list li::before{content:' ';position:absolute;left:0;right:0;height:30px;line-height:30px;z-index:-1}.ez-toc-widget-container ul.ez-toc-list li.active{background-color:#ededed;height:auto!important}.ez-toc-widget-container li.active>a{font-weight:900}.ez-toc-btn{padding:6px 12px;margin-bottom:0;font-size:14px;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.ez-toc-btn:focus{outline:#333 dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.ez-toc-btn:focus,.ez-toc-btn:hover{color:#333;text-decoration:none}.ez-toc-btn.active,.ez-toc-btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.ez-toc-btn-default{color:#333;background-color:#fff;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);text-shadow:0 1px 0 #fff;background-image:-webkit-gradient(linear,left 0,left 100%,from(#fff),to(#e0e0e0));background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-moz-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);background-repeat:repeat-x;border-color:#ccc}.ez-toc-btn-default.active,.ez-toc-btn-default:active,.ez-toc-btn-default:focus,.ez-toc-btn-default:hover{color:#333;background-color:#ebebeb;border-color:#adadad}.ez-toc-btn-default.active,.ez-toc-btn-default:active{background-image:none;background-color:#e0e0e0;border-color:#dbdbdb}.ez-toc-btn-sm,.ez-toc-btn-xs{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.ez-toc-btn-xs{padding:1px 5px}.ez-toc-btn-default:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.active,.ez-toc-btn:active{background-image:none}.ez-toc-btn-default:focus,.ez-toc-btn-default:hover{background-color:#e0e0e0;background-position:0 -15px}.ez-toc-pull-right{float:right!important;margin-left:10px}#ez-toc-container label.cssicon,#ez-toc-widget-container label.cssicon{height:30px}.ez-toc-glyphicon{position:relative;top:1px;font-family:'Glyphicons Halflings';-webkit-font-smoothing:antialiased;font-style:normal;line-height:1;-moz-osx-font-smoothing:grayscale}.ez-toc-glyphicon:empty{width:1em}.ez-toc-toggle i.ez-toc-glyphicon,label.cssicon .ez-toc-glyphicon:empty{font-size:16px;margin-left:2px}#ez-toc-container input,.ez-toc-toggle #item{position:absolute;left:-999em}#ez-toc-container input[type=checkbox]:checked+nav,#ez-toc-widget-container input[type=checkbox]:checked+nav{opacity:0;max-height:0;border:none;display:none}#ez-toc-container nav ul.eztoc-visibility-hide-by-default,#ez-toc-widget-container nav ul.eztoc-visibility-hide-by-default,label.cssiconcheckbox{display:none}#ez-toc-container label{float:right;position:relative;font-size:16px;padding:0 4px 0 5px;border:1px solid #999191;border-radius:5px;cursor:pointer;width:30px;left:10px}#ez-toc-container .ez-toc-toggle label,#ez-toc-container label.cssicon,#ez-toc-widget-container label.cssicon{float:right;position:relative;font-size:16px;padding:0;border:1px solid #999191;border-radius:5px;cursor:pointer;left:10px;width:35px}div#ez-toc-container p.ez-toc-title{display:contents}div#ez-toc-container{padding-right:20px}.ez-toc-wrap-center{margin:0 auto}#ez-toc-container a.ez-toc-toggle{display:flex;align-items:center;color:#444;background:inherit;border:inherit}.ez-toc-widget-container ul li a{padding-left:10px;display:inline-flex;align-items:stretch;flex-wrap:nowrap}
assets/js/admin.js CHANGED
@@ -43,6 +43,11 @@ jQuery(document).ready(function ($) {
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},
45
  function (data) {
 
 
 
 
 
46
  }
47
  );
48
  });
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},
45
  function (data) {
46
+ if(data === 'security_nonce_not_verified' ){
47
+ alert('Security nonce not verified');
48
+ return false;
49
+ }
50
+
51
  }
52
  );
53
  });
assets/js/admin.min.js CHANGED
@@ -1 +1 @@
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 s=document.getElementById("ez-toc-settings[width]"),l=document.getElementById("ez-toc-settings[width_custom]");l&&("custom"!=s.value&&(l.parentNode.parentNode.style.display="none"),s.addEventListener("change",function(){"custom"==document.getElementById("ez-toc-settings[width]").value?l.parentNode.parentNode.style.display="revert":l.parentNode.parentNode.style.display="none"})),e("#reset-options-to-default-button").click(function(){!0==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 s=e("#subscribe-newsletter-form"),l=s.find('input[name="name"]').val(),o=s.find('input[name="email"]').val(),n=s.find('input[name="company"]').val();e.post(ajaxurl,{action:"eztoc_subscribe_newsletter",name:l,email:o,website:n,eztoc_security_nonce:cn_toc_admin_data.eztoc_security_nonce},function(e){})})});const unsecuredCopyToClipboard=e=>{let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(s){console.error("Unable to copy to clipboard",s)}document.body.removeChild(t)};function ez_toc_clipboard(e,t,s,l){l.preventDefault(),disableScrolling();var o=s.parentNode.parentNode.querySelectorAll("#"+e)[0];o.select(),o.setSelectionRange(0,99999),unsecuredCopyToClipboard(o.value),s.querySelectorAll("span."+t)[0].innerHTML="Copied: "+o.value}function ez_toc_outFunc(e,t,s){s.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");null!==e?window.onscroll=function(){var s=window.scrollY,l=document.getElementsByClassName("ez-toc-pro-settings-link-paid"),o=document.getElementsByClassName("general-pro-settings-container"),n=document.querySelector("#general #eztoc-tabs #eztoc-link-general"),a=document.querySelector("#general #eztoc-tabs #eztoc-link-appearance"),c=document.querySelector("#general #eztoc-tabs #eztoc-link-advanced"),i=document.querySelector("#general #eztoc-tabs #eztoc-link-shortcode"),r=document.querySelector("#general #eztoc-tabs #eztoc-link-prosettings"),v=document.querySelector("#general div#eztoc-general").offsetTop-100,u=document.querySelector("#general div#eztoc-appearance").offsetTop-100,d=document.querySelector("#general div#eztoc-advanced").offsetTop-100,g=document.querySelector("#general div#eztoc-shortcode").offsetTop-100;if(null!==l&&l.length>0)var p=document.querySelector("#general div#eztoc-prosettings").offsetTop-100-150;else g-=250;n.classList.add("active"),a.classList.remove("active"),c.classList.remove("active"),i.classList.remove("active"),o.length>0&&null!==r&&r.classList.remove("active"),s>=100?(e.classList.remove("stay"),e.classList.add("moving"),t.classList.add("moving"),null!==l&&l.length>0&&0==o.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!==l&&l.length>0&&o.length>0&&document.querySelector(".general-pro-settings-container").remove()),s>=v&&(n.classList.add("active"),a.classList.remove("active"),c.classList.remove("active"),i.classList.remove("active"),null!==l&&l.length>0&&o.length>0&&null!==r&&r.classList.remove("active")),s>=u&&(n.classList.remove("active"),a.classList.add("active"),c.classList.remove("active"),i.classList.remove("active"),null!==l&&l.length>0&&o.length>0&&null!==r&&r.classList.remove("active")),s>=d&&(n.classList.remove("active"),a.classList.remove("active"),c.classList.add("active"),i.classList.remove("active"),null!==l&&l.length>0&&o.length>0&&null!==r&&r.classList.remove("active")),s>=g&&(n.classList.remove("active"),a.classList.remove("active"),c.classList.remove("active"),i.classList.add("active"),null!==l&&l.length>0&&o.length>0&&null!==r&&r.classList.remove("active")),o.length>0&&s>=p&&(n.classList.remove("active"),a.classList.remove("active"),c.classList.remove("active"),i.classList.remove("active"),null!==l&&l.length>0&&o.length>0&&null!==r&&r.classList.add("active"))}:window.onscroll=function(){}}ezTocSettingsTabsFixed();
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 s=document.getElementById("ez-toc-settings[width]"),o=document.getElementById("ez-toc-settings[width_custom]");o&&("custom"!=s.value&&(o.parentNode.parentNode.style.display="none"),s.addEventListener("change",function(){"custom"==document.getElementById("ez-toc-settings[width]").value?o.parentNode.parentNode.style.display="revert":o.parentNode.parentNode.style.display="none"})),e("#reset-options-to-default-button").click(function(){!0==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 s=e("#subscribe-newsletter-form"),o=s.find('input[name="name"]').val(),l=s.find('input[name="email"]').val(),n=s.find('input[name="company"]').val();e.post(ajaxurl,{action:"eztoc_subscribe_newsletter",name:o,email:l,website:n,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})})});const unsecuredCopyToClipboard=e=>{let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(s){console.error("Unable to copy to clipboard",s)}document.body.removeChild(t)};function ez_toc_clipboard(e,t,s,o){o.preventDefault(),disableScrolling();var l=s.parentNode.parentNode.querySelectorAll("#"+e)[0];l.select(),l.setSelectionRange(0,99999),unsecuredCopyToClipboard(l.value),s.querySelectorAll("span."+t)[0].innerHTML="Copied: "+l.value}function ez_toc_outFunc(e,t,s){s.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");null!==e?window.onscroll=function(){var s=window.scrollY,o=document.getElementsByClassName("ez-toc-pro-settings-link-paid"),l=document.getElementsByClassName("general-pro-settings-container"),n=document.querySelector("#general #eztoc-tabs #eztoc-link-general"),c=document.querySelector("#general #eztoc-tabs #eztoc-link-appearance"),a=document.querySelector("#general #eztoc-tabs #eztoc-link-advanced"),i=document.querySelector("#general #eztoc-tabs #eztoc-link-shortcode"),r=document.querySelector("#general #eztoc-tabs #eztoc-link-prosettings"),v=document.querySelector("#general div#eztoc-general").offsetTop-100,u=document.querySelector("#general div#eztoc-appearance").offsetTop-100,d=document.querySelector("#general div#eztoc-advanced").offsetTop-100,g=document.querySelector("#general div#eztoc-shortcode").offsetTop-100;if(null!==o&&o.length>0)var p=document.querySelector("#general div#eztoc-prosettings").offsetTop-100-150;else g-=250;n.classList.add("active"),c.classList.remove("active"),a.classList.remove("active"),i.classList.remove("active"),l.length>0&&null!==r&&r.classList.remove("active"),s>=100?(e.classList.remove("stay"),e.classList.add("moving"),t.classList.add("moving"),null!==o&&o.length>0&&0==l.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!==o&&o.length>0&&l.length>0&&document.querySelector(".general-pro-settings-container").remove()),s>=v&&(n.classList.add("active"),c.classList.remove("active"),a.classList.remove("active"),i.classList.remove("active"),null!==o&&o.length>0&&l.length>0&&null!==r&&r.classList.remove("active")),s>=u&&(n.classList.remove("active"),c.classList.add("active"),a.classList.remove("active"),i.classList.remove("active"),null!==o&&o.length>0&&l.length>0&&null!==r&&r.classList.remove("active")),s>=d&&(n.classList.remove("active"),c.classList.remove("active"),a.classList.add("active"),i.classList.remove("active"),null!==o&&o.length>0&&l.length>0&&null!==r&&r.classList.remove("active")),s>=g&&(n.classList.remove("active"),c.classList.remove("active"),a.classList.remove("active"),i.classList.add("active"),null!==o&&o.length>0&&l.length>0&&null!==r&&r.classList.remove("active")),l.length>0&&s>=p&&(n.classList.remove("active"),c.classList.remove("active"),a.classList.remove("active"),i.classList.remove("active"),null!==o&&o.length>0&&l.length>0&&null!==r&&r.classList.add("active"))}:window.onscroll=function(){}}ezTocSettingsTabsFixed();
assets/js/front.js CHANGED
@@ -128,7 +128,7 @@ jQuery( function( $ ) {
128
  var toggles = $( 'a.ez-toc-toggle' );
129
  // var toc = $( 'ul.ez-toc-list' );
130
  var invert = ezTOC.visibility_hide_by_default;
131
- toggles.css( 'display', 'flex' );
132
  $.each(toggles, function(i, obj) {
133
 
134
  var toggle = $(this);
@@ -142,8 +142,7 @@ jQuery( function( $ ) {
142
  } else {
143
 
144
  $(toggle).data( 'visible', true );
145
- // Cookies.remove('ezTOC_hidetoc');
146
- delete_cookie('ezTOC_hidetoc-' + i);
147
  }
148
 
149
  if ( invert ) {
@@ -339,10 +338,4 @@ jQuery( function( $ ) {
339
  // Start EZ TOC on page load.
340
  ezTOCInit();
341
  }
342
- function set_cookie(name, value) {
343
- document.cookie = name +'='+ value +'; Path=/;';
344
- }
345
- function delete_cookie(name) {
346
- document.cookie = name +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
347
- }
348
  } );
128
  var toggles = $( 'a.ez-toc-toggle' );
129
  // var toc = $( 'ul.ez-toc-list' );
130
  var invert = ezTOC.visibility_hide_by_default;
131
+ // toggles.css( 'display', 'flex' );
132
  $.each(toggles, function(i, obj) {
133
 
134
  var toggle = $(this);
142
  } else {
143
 
144
  $(toggle).data( 'visible', true );
145
+ Cookies.remove('ezTOC_hidetoc-' + i);
 
146
  }
147
 
148
  if ( invert ) {
338
  // Start EZ TOC on page load.
339
  ezTOCInit();
340
  }
 
 
 
 
 
 
341
  } );
assets/js/front.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(t){if("undefined"!=typeof ezTOC){function e(){if(0!==t(".ez-toc-widget-container.ez-toc-affix").length){var e=30;void 0!==ezTOC.scroll_offset&&(e=parseInt(ezTOC.scroll_offset)),t(ezTOC.affixSelector).stick_in_parent({inner_scrolling:!1,offset_top:e})}if(t.fn.shrinkTOCWidth=function(){t(this).css({width:"auto",display:"table"}),/MSIE 7\./.test(navigator.userAgent)&&t(this).css("width","")},1===parseInt(ezTOC.smooth_scroll)&&t("a.ez-toc-link").on("click",function(){var e=t(this),i="",o=e.prop("hostname"),a=e.prop("pathname"),c=e.prop("search"),s=e.prop("hash");if(a.length>0&&"/"!==a.charAt(0)&&(a="/"+a),window.location.hostname===o&&window.location.pathname===a&&window.location.search===c&&""!==s){if(0===t(i='[id="'+s.replace("#","")+'"]').length&&(console.log("ezTOC scrollTarget Not Found: "+i),i=""),void 0!==ezTOC.scroll_offset)var l=-1*ezTOC.scroll_offset;else{var n=t("#wpadminbar");l=n.length>0&&n.is(":visible")?-30:0}i&&t.smoothScroll({scrollTarget:i,offset:l,beforeScroll:p,afterScroll:function(){f(),d()}})}}),void 0!==ezTOC.visibility_hide_by_default){var i=t("a.ez-toc-toggle"),o=ezTOC.visibility_hide_by_default;i.css("display","flex"),t.each(i,function(e,i){var a,c=t(this),s=t(c).parents("#ez-toc-container,#ez-toc-widget-container").find("ul.ez-toc-list");Cookies?(1==Cookies.get("ezTOC_hidetoc-"+e)?t(c).data("visible",!1):t(c).data("visible",!0),Cookies.remove("ezTOC_hidetoc-"+e)):(t(c).data("visible",!0),a="ezTOC_hidetoc-"+e,document.cookie=a+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"),o&&t(c).data("visible",!1),t(c).data("visible")||s.hide(),t(c).on("click",function(i){i.preventDefault();let a=document.querySelector("#ez-toc-container");if(a)a.classList.toggle("toc_close");else{let c=document.querySelector(".ez-toc-widget-container");c.classList.toggle("toc_close")}t(this).data("visible")?(t(this).data("visible",!1),Cookies&&(o?Cookies.set("ezTOC_hidetoc-"+e,null,{path:"/"}):Cookies.set("ezTOC_hidetoc-"+e,"1",{expires:30,path:"/"})),s.hide("fast")):(t(this).data("visible",!0),Cookies&&(o?Cookies.set("ezTOC_hidetoc-"+e,"1",{expires:30,path:"/"}):Cookies.set("ezTOC_hidetoc-"+e,null,{path:"/"})),s.show("fast"))})})}var a,c,s,l=t("span.ez-toc-section").toArray(),n=(a=l,a.reduce(function(e,i){var o;return e[i.id]=t('.ez-toc-widget-container .ez-toc-list a[href="#'+t(o=i).attr("id")+'"]'),e},{})),r=t.map(n,function(t,e){return t}),h=(c=5,void 0!==ezTOC.smooth_scroll&&1===parseInt(ezTOC.smooth_scroll)&&(c=void 0!==ezTOC.scroll_offset?parseInt(ezTOC.scroll_offset):30),s=t("#wpadminbar"),s.length&&(c+=s.height()),c);function f(){var e,i,o,a,c,s=(e=h,i=l,o=t(window).scrollTop()+e+1,a=i[0],c=o-t(a).offset().top,i.forEach(function(e){var i=o-t(e).offset().top;i>0&&i<c&&(c=i,a=e)}),a);if(s){var f,d,p,v,u,g,z,$,b,m=n[s.id];(function t(e,i){i.forEach(function(t){e!==t&&t.parent().hasClass("active")&&t.parent().removeClass("active")})})(m,r),(p=(f=m).parent()).hasClass("active")||p.addClass("active"),b=(v=d=p,u=t(v),g=u.html(),u.parent().append('<li id="ez-toc-height-test" class="active">'+g+"</li>"),z=t("#ez-toc-height-test"),$=z.height(),z.remove(),$-u.children("ul").first().height()),t("#ez-toc-active-height").remove(),t('<style id="ez-toc-active-height">.ez-toc-widget-container ul.ez-toc-list li.active {height:'+b+"px;} </style>").appendTo("head")}}function d(){l.length>0&&t(".ez-toc-widget-container").length&&t(window).on("load resize scroll",f)}function p(){t(window).off("load resize scroll",f)}d()}ezTOC.init=function(){e()},e()}function i(t,e){document.cookie=t+"="+e+"; Path=/;"}});
1
+ jQuery(function(t){if("undefined"!=typeof ezTOC){function e(){if(0!==t(".ez-toc-widget-container.ez-toc-affix").length){var e=30;void 0!==ezTOC.scroll_offset&&(e=parseInt(ezTOC.scroll_offset)),t(ezTOC.affixSelector).stick_in_parent({inner_scrolling:!1,offset_top:e})}if(t.fn.shrinkTOCWidth=function(){t(this).css({width:"auto",display:"table"}),/MSIE 7\./.test(navigator.userAgent)&&t(this).css("width","")},1===parseInt(ezTOC.smooth_scroll)&&t("a.ez-toc-link").on("click",function(){var e=t(this),i="",o=e.prop("hostname"),a=e.prop("pathname"),c=e.prop("search"),s=e.prop("hash");if(a.length>0&&"/"!==a.charAt(0)&&(a="/"+a),window.location.hostname===o&&window.location.pathname===a&&window.location.search===c&&""!==s){if(0===t(i='[id="'+s.replace("#","")+'"]').length&&(console.log("ezTOC scrollTarget Not Found: "+i),i=""),void 0!==ezTOC.scroll_offset)var l=-1*ezTOC.scroll_offset;else{var n=t("#wpadminbar");l=n.length>0&&n.is(":visible")?-30:0}i&&t.smoothScroll({scrollTarget:i,offset:l,beforeScroll:v,afterScroll:function(){f(),d()}})}}),void 0!==ezTOC.visibility_hide_by_default){var i=t("a.ez-toc-toggle"),o=ezTOC.visibility_hide_by_default;t.each(i,function(e,i){var a=t(this),c=t(a).parents("#ez-toc-container,#ez-toc-widget-container").find("ul.ez-toc-list");Cookies?(1==Cookies.get("ezTOC_hidetoc-"+e)?t(a).data("visible",!1):t(a).data("visible",!0),Cookies.remove("ezTOC_hidetoc-"+e)):(t(a).data("visible",!0),Cookies.remove("ezTOC_hidetoc-"+e)),o&&t(a).data("visible",!1),t(a).data("visible")||c.hide(),t(a).on("click",function(i){i.preventDefault();let a=document.querySelector("#ez-toc-container");if(a)a.classList.toggle("toc_close");else{let s=document.querySelector(".ez-toc-widget-container");s.classList.toggle("toc_close")}t(this).data("visible")?(t(this).data("visible",!1),Cookies&&(o?Cookies.set("ezTOC_hidetoc-"+e,null,{path:"/"}):Cookies.set("ezTOC_hidetoc-"+e,"1",{expires:30,path:"/"})),c.hide("fast")):(t(this).data("visible",!0),Cookies&&(o?Cookies.set("ezTOC_hidetoc-"+e,"1",{expires:30,path:"/"}):Cookies.set("ezTOC_hidetoc-"+e,null,{path:"/"})),c.show("fast"))})})}var a,c,s,l=t("span.ez-toc-section").toArray(),n=(a=l,a.reduce(function(e,i){var o;return e[i.id]=t('.ez-toc-widget-container .ez-toc-list a[href="#'+t(o=i).attr("id")+'"]'),e},{})),r=t.map(n,function(t,e){return t}),h=(c=5,void 0!==ezTOC.smooth_scroll&&1===parseInt(ezTOC.smooth_scroll)&&(c=void 0!==ezTOC.scroll_offset?parseInt(ezTOC.scroll_offset):30),s=t("#wpadminbar"),s.length&&(c+=s.height()),c);function f(){var e,i,o,a,c,s=(e=h,i=l,o=t(window).scrollTop()+e+1,a=i[0],c=o-t(a).offset().top,i.forEach(function(e){var i=o-t(e).offset().top;i>0&&i<c&&(c=i,a=e)}),a);if(s){var f,d,v,p,g,u,z,$,b,m=n[s.id];(function t(e,i){i.forEach(function(t){e!==t&&t.parent().hasClass("active")&&t.parent().removeClass("active")})})(m,r),(v=(f=m).parent()).hasClass("active")||v.addClass("active"),b=(p=d=v,g=t(p),u=g.html(),g.parent().append('<li id="ez-toc-height-test" class="active">'+u+"</li>"),z=t("#ez-toc-height-test"),$=z.height(),z.remove(),$-g.children("ul").first().height()),t("#ez-toc-active-height").remove(),t('<style id="ez-toc-active-height">.ez-toc-widget-container ul.ez-toc-list li.active {height:'+b+"px;} </style>").appendTo("head")}}function d(){l.length>0&&t(".ez-toc-widget-container").length&&t(window).on("load resize scroll",f)}function v(){t(window).off("load resize scroll",f)}d()}ezTOC.init=function(){e()},e()}});
assets/offer-gift-icon.png ADDED
Binary file
easy-table-of-contents.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Easy Table of Contents
4
  * Plugin URI: https://tocwp.com/
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.38
7
  * Author: Magazine3
8
  * Author URI: https://tocwp.com/
9
  * Text Domain: easy-table-of-contents
@@ -26,7 +26,7 @@
26
  * @package Easy Table of Contents
27
  * @category Plugin
28
  * @author Magazine3
29
- * @version 2.0.38
30
  */
31
 
32
  use Easy_Plugins\Table_Of_Contents\Debug;
@@ -49,7 +49,7 @@ if ( ! class_exists( 'ezTOC' ) ) {
49
  * @since 1.0
50
  * @var string
51
  */
52
- const VERSION = '2.0.38';
53
 
54
  /**
55
  * Stores the instance of this class.
@@ -673,125 +673,22 @@ COUNTERINCREMENTCSS;
673
  $custom_height = 'max-height: ' . ezTOC_Option::get('sticky-toggle-height-custom') . ';' . PHP_EOL;
674
  $custom_height .= 'min-height: ' . ezTOC_Option::get('sticky-toggle-height-custom') . ';' . PHP_EOL;
675
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
676
  $inlineStickyToggleCSS = <<<INLINESTICKYTOGGLECSS
677
- /**
678
- * Ez Toc Sidebar Sticky CSS
679
- */
680
- .ez-toc-sticky-fixed {
681
- position: fixed;
682
- top: 0;
683
- left: 0;
684
- z-index: 999999;
685
- width: auto;
686
- max-width: 100%;
687
- }
688
- .ez-toc-sticky-fixed .ez-toc-sidebar {
689
- position: relative;
690
- top: auto;
691
- width: auto !important;
692
- height: 100%;
693
- box-shadow: 1px 1px 10px 3px rgb(0 0 0 / 20%);
694
- box-sizing: border-box;
695
- padding: 20px 30px;
696
- background: white;
697
- margin-left: 0 !important;
698
- height: auto;
699
- {$custom_height}
700
- overflow-y: auto;
701
- overflow-x: hidden;
702
- }
703
- .ez-toc-sticky-fixed .ez-toc-sidebar #ez-toc-sticky-container {
704
- {$custom_width}
705
- max-width: auto;
706
- padding: 0px;
707
- border: none;
708
- margin-bottom: 0;
709
- margin-top: 65px;
710
- }
711
- #ez-toc-sticky-container a {
712
- color: #000;
713
- }
714
- .ez-toc-sticky-fixed .ez-toc-sidebar .ez-toc-sticky-title-container {
715
- border-bottom-color: #EEEEEE;
716
- background-color: #FAFAFA;
717
- padding: 15px;
718
- border-bottom: 1px solid #e5e5e5;
719
- width: 100%;
720
- position: absolute;
721
- height: auto;
722
- top: 0;
723
- left: 0;
724
- z-index: 99999999;
725
- }
726
- .ez-toc-sticky-fixed .ez-toc-sidebar .ez-toc-sticky-title-container .ez-toc-sticky-title {
727
- font-weight: 550;
728
- font-size: 18px;
729
- color: #111;
730
- }
731
- .ez-toc-sticky-fixed .ez-toc-close-icon {
732
- -webkit-appearance: none;
733
- padding: 0;
734
- cursor: pointer;
735
- background: 0 0;
736
- border: 0;
737
- float: right;
738
- font-size: 30px;
739
- font-weight: 600;
740
- line-height: 1;
741
- position: relative;
742
- color: #000;
743
- top: -2px;
744
- text-decoration: none;
745
- }
746
- .ez-toc-open-icon {
747
- position: fixed;
748
- left: 0px;
749
- top: 8%;
750
- text-decoration: none;
751
- font-weight: bold;
752
- padding: 5px 10px 15px 10px;
753
- box-shadow: 1px -5px 10px 5px rgb(0 0 0 / 10%);
754
- background-color: #fff;
755
- display: inline-grid;
756
- line-height: 1.4;
757
- border-radius: 0px 10px 10px 0px;
758
- z-index: 999999;
759
- }
760
- .ez-toc-sticky-fixed.hide {
761
- -webkit-transition: opacity 0.3s linear, left 0.3s cubic-bezier(0.4, 0, 1, 1);
762
- -ms-transition: opacity 0.3s linear, left 0.3s cubic-bezier(0.4, 0, 1, 1);
763
- -o-transition: opacity 0.3s linear, left 0.3s cubic-bezier(0.4, 0, 1, 1);
764
- transition: opacity 0.3s linear, left 0.3s cubic-bezier(0.4, 0, 1, 1);
765
- left: -100%;
766
- }
767
- .ez-toc-sticky-fixed.show {
768
- -webkit-transition: left 0.3s linear, left 0.3s easy-out;
769
- -moz-transition: left 0.3s linear;
770
- -o-transition: left 0.3s linear;
771
- transition: left 0.3s linear;
772
- left: 0;
773
- // opacity: 1;
774
- }
775
- .ez-toc-open-icon span.arrow {
776
- font-size: 18px;
777
- }
778
- .ez-toc-open-icon span.text {
779
- font-size: 13px;
780
- writing-mode: vertical-rl;
781
- text-orientation: mixed;
782
- }
783
- @media screen and (max-device-width: 640px) {
784
-
785
- .ez-toc-sticky-fixed .ez-toc-sidebar {
786
- min-width: auto;
787
- }
788
- .ez-toc-sticky-fixed .ez-toc-sidebar.show {
789
- padding-top: 35px;
790
- }
791
- .ez-toc-sticky-fixed .ez-toc-sidebar #ez-toc-sticky-container {
792
- min-width: 100%;
793
- }
794
- }
795
  INLINESTICKYTOGGLECSS;
796
  wp_add_inline_style( 'ez-toc-sticky', $inlineStickyToggleCSS );
797
  }
@@ -804,43 +701,8 @@ INLINESTICKYTOGGLECSS;
804
  * @static
805
  */
806
  private static function inlineStickyToggleJS() {
807
- $inlineStickyToggleJS = <<<'INLINESTICKYTOGGLEJS'
808
- /**
809
- * Sticky Sidebar JS
810
- */
811
- function hideBar(e) {
812
- // e.preventDefault();
813
- var sidebar = document.querySelector(".ez-toc-sticky-fixed");
814
- sidebar.classList.remove("show");
815
- sidebar.classList.add("hide");
816
- setTimeout(function() {
817
- document.querySelector(".ez-toc-open-icon").style = "z-index: 9999999";
818
- }, 200);
819
- }
820
- function showBar(e) {
821
- // e.preventDefault();
822
- document.querySelector(".ez-toc-open-icon").style = "z-index: -1;";
823
- setTimeout(function() {
824
- var sidebar = document.querySelector(".ez-toc-sticky-fixed");
825
- sidebar.classList.remove("hide");
826
- sidebar.classList.add("show");
827
- }, 200);
828
- }
829
- (function() {
830
- let ez_toc_sticky_fixed_container = document.querySelector('div.ez-toc-sticky-fixed');
831
- if(ez_toc_sticky_fixed_container) {
832
- document.body.addEventListener("click", function (evt) {
833
- hideBar(evt);
834
- evt.stopPropagation();
835
- });
836
- ez_toc_sticky_fixed_container.addEventListener('click', function(event) {
837
- event.stopPropagation();
838
- });
839
- document.querySelector('.ez-toc-open-icon').addEventListener('click', function(event) {
840
- event.stopPropagation();
841
- });
842
- }
843
- })();
844
  INLINESTICKYTOGGLEJS;
845
  wp_add_inline_script( 'ez-toc-sticky', $inlineStickyToggleJS );
846
  }
@@ -1264,7 +1126,7 @@ INLINESTICKYTOGGLEJS;
1264
  <div class="ez-toc-sticky-fixed hide">
1265
  <div class='ez-toc-sidebar'>{$stickyToggleTOC}</div>
1266
  </div>
1267
- <a class='ez-toc-open-icon' href='javascript:void(0)' onclick='showBar(event)'>
1268
  <span class="arrow">&#8594;</span>
1269
  <span class="text">{$openButtonText}</span>
1270
  </a>
@@ -1341,7 +1203,7 @@ STICKYTOGGLEHTML;
1341
  {
1342
  $iconColor = ezTOC_Option::get( 'custom_title_colour' );
1343
  }
1344
- return '<span style="display: flex;align-items: center;width: 35px;height: 30px;justify-content: center;"><svg style="fill: ' . esc_attr($iconColor, 'easy-table-of-contents') . ';color:' . esc_attr($iconColor, 'easy-table-of-contents') . '" xmlns="http://www.w3.org/2000/svg" class="list-377408" width="20px" height="20px" viewBox="0 0 24 24" fill="none"><path d="M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z" fill="currentColor"></path></svg><svg style="fill: ' . esc_attr($iconColor, 'easy-table-of-contents') . ';color:' . esc_attr($iconColor, 'easy-table-of-contents') . '" class="arrow-unsorted-368013" xmlns="http://www.w3.org/2000/svg" width="10px" height="10px" viewBox="0 0 24 24" version="1.2" baseProfile="tiny"><path d="M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z"/></svg></span>';
1345
  }
1346
 
1347
  }
3
  * Plugin Name: Easy Table of Contents
4
  * Plugin URI: https://tocwp.com/
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.39
7
  * Author: Magazine3
8
  * Author URI: https://tocwp.com/
9
  * Text Domain: easy-table-of-contents
26
  * @package Easy Table of Contents
27
  * @category Plugin
28
  * @author Magazine3
29
+ * @version 2.0.39
30
  */
31
 
32
  use Easy_Plugins\Table_Of_Contents\Debug;
49
  * @since 1.0
50
  * @var string
51
  */
52
+ const VERSION = '2.0.39';
53
 
54
  /**
55
  * Stores the instance of this class.
673
  $custom_height = 'max-height: ' . ezTOC_Option::get('sticky-toggle-height-custom') . ';' . PHP_EOL;
674
  $custom_height .= 'min-height: ' . ezTOC_Option::get('sticky-toggle-height-custom') . ';' . PHP_EOL;
675
  }
676
+
677
+ $topMarginStickyContainer = '65px';
678
+ if ( ezTOC_Option::get( 'show_heading_text' ) ) {
679
+ $toc_title = ezTOC_Option::get( 'heading_text' );
680
+ if( strlen($toc_title) > 20 ) {
681
+ $topMarginStickyContainer = '70px';
682
+ }
683
+ if( strlen($toc_title) > 40 ) {
684
+ $topMarginStickyContainer = '80px';
685
+ }
686
+ if( strlen($toc_title) > 60 ) {
687
+ $topMarginStickyContainer = '90px';
688
+ }
689
+ }
690
  $inlineStickyToggleCSS = <<<INLINESTICKYTOGGLECSS
691
+ .ez-toc-sticky-fixed{position: fixed;top: 0;left: 0;z-index: 999999;width: auto;max-width: 100%;} .ez-toc-sticky-fixed .ez-toc-sidebar {position: relative;top: auto;width: auto !important;height: 100%;box-shadow: 1px 1px 10px 3px rgb(0 0 0 / 20%);box-sizing: border-box;padding: 20px 30px;background: white;margin-left: 0 !important;height: auto; {$custom_height} overflow-y: auto;overflow-x: hidden;} .ez-toc-sticky-fixed .ez-toc-sidebar #ez-toc-sticky-container { {$custom_width} max-width: auto;padding: 0px;border: none;margin-bottom: 0;margin-top: $topMarginStickyContainer;} #ez-toc-sticky-container a { color: #000;} .ez-toc-sticky-fixed .ez-toc-sidebar .ez-toc-sticky-title-container {border-bottom-color: #EEEEEE;background-color: #FAFAFA;padding: 15px;border-bottom: 1px solid #e5e5e5;width: 100%;position: absolute;height: auto;top: 0;left: 0;z-index: 99999999;} .ez-toc-sticky-fixed .ez-toc-sidebar .ez-toc-sticky-title-container .ez-toc-sticky-title {font-weight: 550;font-size: 18px;color: #111;} .ez-toc-sticky-fixed .ez-toc-close-icon {-webkit-appearance: none;padding: 0;cursor: pointer;background: 0 0;border: 0;float: right;font-size: 30px;font-weight: 600;line-height: 1;position: relative;color: #000;top: -2px;text-decoration: none;} .ez-toc-open-icon {position: fixed;left: 0px;top: 8%;text-decoration: none;font-weight: bold;padding: 5px 10px 15px 10px;box-shadow: 1px -5px 10px 5px rgb(0 0 0 / 10%);background-color: #fff;display: inline-grid;line-height: 1.4;border-radius: 0px 10px 10px 0px;z-index: 999999;} .ez-toc-sticky-fixed.hide {-webkit-transition: opacity 0.3s linear, left 0.3s cubic-bezier(0.4, 0, 1, 1);-ms-transition: opacity 0.3s linear, left 0.3s cubic-bezier(0.4, 0, 1, 1);-o-transition: opacity 0.3s linear, left 0.3s cubic-bezier(0.4, 0, 1, 1);transition: opacity 0.3s linear, left 0.3s cubic-bezier(0.4, 0, 1, 1);left: -100%;} .ez-toc-sticky-fixed.show {-webkit-transition: left 0.3s linear, left 0.3s easy-out;-moz-transition: left 0.3s linear;-o-transition: left 0.3s linear;transition: left 0.3s linear;left: 0;} .ez-toc-open-icon span.arrow { font-size: 18px; } .ez-toc-open-icon span.text {font-size: 13px;writing-mode: vertical-rl;text-orientation: mixed;} @media screen and (max-device-width: 640px) {.ez-toc-sticky-fixed .ez-toc-sidebar {min-width: auto;} .ez-toc-sticky-fixed .ez-toc-sidebar.show { padding-top: 35px; } .ez-toc-sticky-fixed .ez-toc-sidebar #ez-toc-sticky-container { min-width: 100%; } }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
692
  INLINESTICKYTOGGLECSS;
693
  wp_add_inline_style( 'ez-toc-sticky', $inlineStickyToggleCSS );
694
  }
701
  * @static
702
  */
703
  private static function inlineStickyToggleJS() {
704
+ $inlineStickyToggleJS = <<<INLINESTICKYTOGGLEJS
705
+ function ezTOC_hideBar(e) { var sidebar = document.querySelector(".ez-toc-sticky-fixed"); if ( typeof(sidebar) !== "undefined" && sidebar !== null ) { sidebar.classList.remove("show"); sidebar.classList.add("hide"); setTimeout(function() { document.querySelector(".ez-toc-open-icon").style = "z-index: 9999999"; }, 200); } } function ezTOC_showBar(e) { document.querySelector(".ez-toc-open-icon").style = "z-index: -1;";setTimeout(function() { var sidebar = document.querySelector(".ez-toc-sticky-fixed"); sidebar.classList.remove("hide"); sidebar.classList.add("show"); }, 200); } (function() { let ez_toc_sticky_fixed_container = document.querySelector('div.ez-toc-sticky-fixed');if(ez_toc_sticky_fixed_container) { document.body.addEventListener("click", function (evt) { ezTOC_hideBar(evt); }); ez_toc_sticky_fixed_container.addEventListener('click', function(event) { event.stopPropagation(); }); document.querySelector('.ez-toc-open-icon').addEventListener('click', function(event) { event.stopPropagation(); }); } })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
706
  INLINESTICKYTOGGLEJS;
707
  wp_add_inline_script( 'ez-toc-sticky', $inlineStickyToggleJS );
708
  }
1126
  <div class="ez-toc-sticky-fixed hide">
1127
  <div class='ez-toc-sidebar'>{$stickyToggleTOC}</div>
1128
  </div>
1129
+ <a class='ez-toc-open-icon' href='javascript:void(0)' onclick='ezTOC_showBar(event)'>
1130
  <span class="arrow">&#8594;</span>
1131
  <span class="text">{$openButtonText}</span>
1132
  </a>
1203
  {
1204
  $iconColor = ezTOC_Option::get( 'custom_title_colour' );
1205
  }
1206
+ return '<span style="display: flex;align-items: center;width: 35px;height: 30px;justify-content: center;direction:ltr;"><svg style="fill: ' . esc_attr($iconColor) . ';color:' . esc_attr($iconColor) . '" xmlns="http://www.w3.org/2000/svg" class="list-377408" width="20px" height="20px" viewBox="0 0 24 24" fill="none"><path d="M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z" fill="currentColor"></path></svg><svg style="fill: ' . esc_attr($iconColor) . ';color:' . esc_attr($iconColor) . '" class="arrow-unsorted-368013" xmlns="http://www.w3.org/2000/svg" width="10px" height="10px" viewBox="0 0 24 24" version="1.2" baseProfile="tiny"><path d="M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z"/></svg></span>';
1207
  }
1208
 
1209
  }
includes/class.post.php CHANGED
@@ -1088,12 +1088,12 @@ class ezTOC_Post {
1088
  $html .= $this->createTOC( $page, $attribute['headings'], $prefix );
1089
  }
1090
 
1091
- $displayList = '';
1092
- if( ezTOC_Option::get( 'visibility_hide_by_default' ) )
1093
  {
1094
- $displayList = "style='display:block'";
1095
  }
1096
- $html = "<ul class='{$prefix}-list {$prefix}-list-level-1' $displayList>" . $html . "</ul>";
1097
  }
1098
 
1099
  return $html;
@@ -1142,12 +1142,12 @@ class ezTOC_Post {
1142
  // }
1143
  $htmlSticky .= '<p class="ez-toc-sticky-title">' . esc_html__( htmlentities( $toc_title, ENT_COMPAT, 'UTF-8' ), 'easy-table-of-contents' ) . '</p>' . PHP_EOL;
1144
  // if ( ezTOC_Option::get( 'toc_loading' ) !== 'css' ) {
1145
- $htmlSticky .= '<a class="ez-toc-close-icon" href="javascript:void(0)" onclick="hideBar(event)"><span aria-hidden="true">×</span></a>' . PHP_EOL;
1146
  $htmlSticky .= '</div>' . PHP_EOL;
1147
  // }
1148
  } else {
1149
  $htmlSticky .= '<div class="ez-toc-sticky-title-container">' . PHP_EOL;
1150
- $htmlSticky .= '<a class="ez-toc-close-icon" href="javascript:void(0)" onclick="hideBar(event)"><span aria-hidden="true">×</span></a>' . PHP_EOL;
1151
  $htmlSticky .= '</div>' . PHP_EOL;
1152
  }
1153
  $htmlSticky .= '<div id="ez-toc-sticky-container" class="' . implode( ' ', $classSticky ) . '">' . PHP_EOL;
@@ -1260,7 +1260,11 @@ class ezTOC_Post {
1260
  $class = array_map( 'sanitize_html_class', $class );
1261
 
1262
  $html .= '<div id="ez-toc-container" class="' . implode( ' ', $class ) . '">' . PHP_EOL;
1263
-
 
 
 
 
1264
  if ( ezTOC_Option::get( 'show_heading_text' ) ) {
1265
 
1266
  $toc_title = ezTOC_Option::get( 'heading_text' );
@@ -1275,46 +1279,41 @@ class ezTOC_Post {
1275
  $toc_title = str_replace( '%PAGE_NAME%', get_the_title(), $toc_title );
1276
  }
1277
 
1278
- if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1279
- $html .= '<div class="ez-toc-title-container">' . PHP_EOL;
1280
- }
1281
 
1282
  $html .= '<p class="ez-toc-title">' . esc_html__( htmlentities( $toc_title, ENT_COMPAT, 'UTF-8' ), 'easy-table-of-contents' ). '</p>' . PHP_EOL;
1283
-
1284
- if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1285
- $html .= '<span class="ez-toc-title-toggle">';
1286
- }
1287
-
1288
- if ( ezTOC_Option::get( 'visibility' ) ) {
1289
- if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1290
- $icon = ezTOC::getTOCToggleIcon();
1291
- if(function_exists('ez_toc_pro_activation_link')){
1292
- $icon = apply_filters('ez_toc_modify_icon',$icon);
1293
- }
1294
- $html .= '<a href="#" class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" style="display: none;"><label for="item" aria-label="'.__( 'Table of Content', 'easy-table-of-contents' ).'">'.$icon.'</label><input type="checkbox" id="item"></a>';
1295
- }else{
1296
- $toggle_view='';
1297
- if(ezTOC_Option::get('visibility_hide_by_default')==true){
1298
- $toggle_view= "checked";
1299
- }
1300
- $cssIconID = uniqid();
1301
- $html .= '<label for="ez-toc-cssicon-toggle-item-' . $cssIconID . '" class="cssicon">' . ezTOC::getTOCToggleIcon() . '</label><label for="ez-toc-cssicon-toggle-item-' . $cssIconID . '" class="cssiconcheckbox">1</label><input type="checkbox" id="ez-toc-cssicon-toggle-item-' . $cssIconID . '" '.$toggle_view.'>';
1302
- }
1303
- }
1304
-
1305
- if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1306
- $html .= '</span>';
1307
- }
1308
- if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1309
- $html .= '</div>' . PHP_EOL;
1310
- }
1311
- }else{
1312
- $html .= '<div class="ez-toc-title-container">' . PHP_EOL;
1313
- $html .= '<span class="ez-toc-title-toggle">';
1314
- $html .= '<a class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" style="display: none;">' . ezTOC::getTOCToggleIcon() . '</a>';
1315
- $html .= '</span>';
1316
- $html .= '</div>' . PHP_EOL;
1317
- }
1318
 
1319
  ob_start();
1320
  do_action( 'ez_toc_before' );
1088
  $html .= $this->createTOC( $page, $attribute['headings'], $prefix );
1089
  }
1090
 
1091
+ $visiblityClass = '';
1092
+ if( ezTOC_Option::get( 'visibility_hide_by_default' ) && 'css' != ezTOC_Option::get( 'toc_loading' ) )
1093
  {
1094
+ $visiblityClass = "eztoc-visibility-hide-by-default";
1095
  }
1096
+ $html = "<ul class='{$prefix}-list {$prefix}-list-level-1 $visiblityClass' >" . $html . "</ul>";
1097
  }
1098
 
1099
  return $html;
1142
  // }
1143
  $htmlSticky .= '<p class="ez-toc-sticky-title">' . esc_html__( htmlentities( $toc_title, ENT_COMPAT, 'UTF-8' ), 'easy-table-of-contents' ) . '</p>' . PHP_EOL;
1144
  // if ( ezTOC_Option::get( 'toc_loading' ) !== 'css' ) {
1145
+ $htmlSticky .= '<a class="ez-toc-close-icon" href="javascript:void(0)" onclick="ezTOC_hideBar(event)" aria-label="×"><span aria-hidden="true">×</span></a>' . PHP_EOL;
1146
  $htmlSticky .= '</div>' . PHP_EOL;
1147
  // }
1148
  } else {
1149
  $htmlSticky .= '<div class="ez-toc-sticky-title-container">' . PHP_EOL;
1150
+ $htmlSticky .= '<a class="ez-toc-close-icon" href="javascript:void(0)" onclick="ezTOC_hideBar(event)" aria-label="×"><span aria-hidden="true">×</span></a>' . PHP_EOL;
1151
  $htmlSticky .= '</div>' . PHP_EOL;
1152
  }
1153
  $htmlSticky .= '<div id="ez-toc-sticky-container" class="' . implode( ' ', $classSticky ) . '">' . PHP_EOL;
1260
  $class = array_map( 'sanitize_html_class', $class );
1261
 
1262
  $html .= '<div id="ez-toc-container" class="' . implode( ' ', $class ) . '">' . PHP_EOL;
1263
+
1264
+ if ( ezTOC_Option::get( 'toc_loading' ) != 'css' ) {
1265
+ $html .= '<div class="ez-toc-title-container">' . PHP_EOL;
1266
+ }
1267
+
1268
  if ( ezTOC_Option::get( 'show_heading_text' ) ) {
1269
 
1270
  $toc_title = ezTOC_Option::get( 'heading_text' );
1279
  $toc_title = str_replace( '%PAGE_NAME%', get_the_title(), $toc_title );
1280
  }
1281
 
 
 
 
1282
 
1283
  $html .= '<p class="ez-toc-title">' . esc_html__( htmlentities( $toc_title, ENT_COMPAT, 'UTF-8' ), 'easy-table-of-contents' ). '</p>' . PHP_EOL;
1284
+
1285
+ } else {
1286
+ $html .= '<p class="ez-toc-title">&nbsp;</p>' . PHP_EOL;
1287
+ }
1288
+
1289
+ if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1290
+ $html .= '<span class="ez-toc-title-toggle">';
1291
+ }
1292
+
1293
+ if ( ezTOC_Option::get( 'visibility' ) ) {
1294
+ $cssIconID = uniqid();
1295
+ if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1296
+ $icon = ezTOC::getTOCToggleIcon();
1297
+ if( function_exists( 'ez_toc_pro_activation_link' ) ) {
1298
+ $icon = apply_filters('ez_toc_modify_icon',$icon);
1299
+ }
1300
+
1301
+ $html .= '<a href="#" class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" area-label="ez-toc-toggle-icon-1"><label for="item-' . $cssIconID . '" aria-label="'.__( 'Table of Content', 'easy-table-of-contents' ).'">'.$icon.'</label><input type="checkbox" id="item-' . $cssIconID . '"></a>';
1302
+ } else {
1303
+ $toggle_view='';
1304
+ if(ezTOC_Option::get('visibility_hide_by_default')==true){
1305
+ $toggle_view= "checked";
1306
+ }
1307
+ $html .= '<label for="ez-toc-cssicon-toggle-item-' . $cssIconID . '" class="cssicon">' . ezTOC::getTOCToggleIcon() . '</label><label for="ez-toc-cssicon-toggle-item-' . $cssIconID . '" class="cssiconcheckbox">1</label><input type="checkbox" id="ez-toc-cssicon-toggle-item-' . $cssIconID . '" '.$toggle_view.'>';
1308
+ }
1309
+ }
1310
+
1311
+ if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1312
+ $html .= '</span>';
1313
+ }
1314
+ if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1315
+ $html .= '</div>' . PHP_EOL;
1316
+ }
 
 
1317
 
1318
  ob_start();
1319
  do_action( 'ez_toc_before' );
includes/class.widget-toc.php CHANGED
@@ -259,7 +259,7 @@ if ( ! class_exists( 'ezTOC_Widget' ) ) {
259
  <?php
260
  if ( ezTOC_Option::get( 'visibility' ) ) {
261
 
262
- echo '<a class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle">' . ezTOC::getTOCToggleIcon() . '</a>';
263
  }
264
  ?>
265
 
259
  <?php
260
  if ( ezTOC_Option::get( 'visibility' ) ) {
261
 
262
+ echo '<a href="#" class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" aria-label="Widget Easy TOC toggle icon">' . ezTOC::getTOCToggleIcon() . '</a>';
263
  }
264
  ?>
265
 
includes/feedback.js CHANGED
@@ -41,7 +41,7 @@ jQuery(document).ready(function ($) {
41
  },
42
  function (data) {
43
 
44
- if (data == 'Sent') {
45
  // deactivate the plugin and close the popup
46
  $('#eztoc-reloaded-feedback-overlay').remove();
47
  window.location.href = eztoc_deactivate_link_url;
41
  },
42
  function (data) {
43
 
44
+ if (data == 'sent') {
45
  // deactivate the plugin and close the popup
46
  $('#eztoc-reloaded-feedback-overlay').remove();
47
  window.location.href = eztoc_deactivate_link_url;
includes/helper-function.php CHANGED
@@ -56,7 +56,7 @@ function eztoc_send_feedback() {
56
  }
57
 
58
  if( !isset( $form['eztoc_security_nonce'] ) || isset( $form['eztoc_security_nonce'] ) && !wp_verify_nonce( sanitize_text_field( $form['eztoc_security_nonce'] ), 'eztoc_ajax_check_nonce' ) ) {
59
- echo _e( 'Security nonce not verified', 'easy-table-of-contents' );
60
  die();
61
  }
62
 
@@ -92,7 +92,7 @@ function eztoc_send_feedback() {
92
 
93
  $success = wp_mail( 'team@magazine3.in', $subject, $text, $headers );
94
 
95
- echo _e( 'Sent', 'easy-table-of-contents' );
96
  die();
97
  }
98
  add_action( 'wp_ajax_eztoc_send_feedback', 'eztoc_send_feedback' );
@@ -113,15 +113,16 @@ add_action( 'admin_enqueue_scripts', 'eztoc_enqueue_makebetter_email_js' );
113
  add_action('wp_ajax_eztoc_subscribe_newsletter','eztoc_subscribe_for_newsletter');
114
  add_action('wp_ajax_nopriv_eztoc_subscribe_newsletter','eztoc_subscribe_for_newsletter');
115
  function eztoc_subscribe_for_newsletter(){
116
- if( !wp_verify_nonce( $_POST['eztoc_security_nonce'], 'eztoc_security_nonce')){
117
- return 'nonce not verified';
118
- }
 
119
  $api_url = 'http://magazine3.company/wp-json/api/central/email/subscribe';
120
  $api_params = array(
121
  'name' => sanitize_text_field($_POST['name']),
122
  'email'=> sanitize_text_field($_POST['email']),
123
  'website'=> sanitize_text_field($_POST['website']),
124
- 'type'=> 'eztoc'
125
  );
126
  $response = wp_remote_post( $api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
127
  $response = wp_remote_retrieve_body( $response );
56
  }
57
 
58
  if( !isset( $form['eztoc_security_nonce'] ) || isset( $form['eztoc_security_nonce'] ) && !wp_verify_nonce( sanitize_text_field( $form['eztoc_security_nonce'] ), 'eztoc_ajax_check_nonce' ) ) {
59
+ echo 'security_nonce_not_verified';
60
  die();
61
  }
62
 
92
 
93
  $success = wp_mail( 'team@magazine3.in', $subject, $text, $headers );
94
 
95
+ echo 'sent';
96
  die();
97
  }
98
  add_action( 'wp_ajax_eztoc_send_feedback', 'eztoc_send_feedback' );
113
  add_action('wp_ajax_eztoc_subscribe_newsletter','eztoc_subscribe_for_newsletter');
114
  add_action('wp_ajax_nopriv_eztoc_subscribe_newsletter','eztoc_subscribe_for_newsletter');
115
  function eztoc_subscribe_for_newsletter(){
116
+ if( !wp_verify_nonce( sanitize_text_field( $_POST['eztoc_security_nonce'] ), 'eztoc_ajax_check_nonce' ) ) {
117
+ echo 'security_nonce_not_verified';
118
+ die();
119
+ }
120
  $api_url = 'http://magazine3.company/wp-json/api/central/email/subscribe';
121
  $api_params = array(
122
  'name' => sanitize_text_field($_POST['name']),
123
  'email'=> sanitize_text_field($_POST['email']),
124
  'website'=> sanitize_text_field($_POST['website']),
125
+ 'type'=> 'etoc'
126
  );
127
  $response = wp_remote_post( $api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
128
  $response = wp_remote_retrieve_body( $response );
includes/inc.admin-options-page.php CHANGED
@@ -668,7 +668,7 @@ function addCustomSpan()
668
  <span class="eztoc-promotion-close-btn"> &times; </span>
669
  <div class="eztoc-ocassional-pop-up-contents">
670
 
671
- <img src="https://cdn-icons-png.flaticon.com/512/2349/2349820.png" class="eztoc-promotion-surprise-icon" />
672
  <p class="eztoc-ocassional-pop-up-headline"><?= esc_html_e('40% OFF on', 'easy-table-of-contents'); ?> <span><?= esc_html_e('Easy TOC PRO', 'easy-table-of-contents');?></span></p>
673
  <p class="eztoc-ocassional-pop-up-second-headline"><?= esc_html_e('Upgrade the PRO version during this festive season and get our biggest discount of all time on New Purchases, Renewals &amp; Upgrades', 'easy-table-of-contents'); ?></p>
674
  <a class="eztoc-ocassional-pop-up-offer-btn" href="<?= esc_url('https://tocwp.com/november-deal/') ?>" target="_blank"><?= esc_html_e('Get This Offer Now', 'easy-table-of-contents'); ?></a>
668
  <span class="eztoc-promotion-close-btn"> &times; </span>
669
  <div class="eztoc-ocassional-pop-up-contents">
670
 
671
+ <img src="<?= plugins_url('assets/offer-gift-icon.png', dirname(__FILE__)) ?>" class="eztoc-promotion-surprise-icon" />
672
  <p class="eztoc-ocassional-pop-up-headline"><?= esc_html_e('40% OFF on', 'easy-table-of-contents'); ?> <span><?= esc_html_e('Easy TOC PRO', 'easy-table-of-contents');?></span></p>
673
  <p class="eztoc-ocassional-pop-up-second-headline"><?= esc_html_e('Upgrade the PRO version during this festive season and get our biggest discount of all time on New Purchases, Renewals &amp; Upgrades', 'easy-table-of-contents'); ?></p>
674
  <a class="eztoc-ocassional-pop-up-offer-btn" href="<?= esc_url('https://tocwp.com/november-deal/') ?>" target="_blank"><?= esc_html_e('Get This Offer Now', 'easy-table-of-contents'); ?></a>
includes/inc.functions.php CHANGED
@@ -108,7 +108,7 @@ function ez_toc_woo_category_desc() {
108
  $desc = $term_object->description;
109
  preg_match_all( '@<h1.*?>(.*?)<\/h1>@', $desc, $matches );
110
  $array = $matches[1];
111
- $container = '<div id="ez-toc-container" class="counter-hierarchy counter-decimal ez-toc-grey"><div class="ez-toc-title-container"><p class="ez-toc-title">' . esc_html_e('Table of Contents', 'easy-table-of-contents') . '</p><span class="ez-toc-title-toggle"><a class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" style="display: flex;">' . ezTOC::getTOCToggleIcon() . '</a></span></div><nav><ul class="ez-toc-list">';
112
  foreach ( $array as $val ) {
113
  $vals .= '<li><a class="anchor" href="#'.$val.'">'.$val.'</a></li>';
114
  $desc = preg_replace('/<h1>(.*?)<\/h1>/', "<h1 id='$1'>$1</h1>", $desc);
@@ -125,34 +125,6 @@ function ez_toc_woo_cat_desc_remove(){
125
  remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
126
  }
127
 
128
-
129
- //if (function_exists( 'mpg_run' )) {
130
- // add_filter('the_content', 'ez_toc_mpg');
131
- //}
132
- //function ez_toc_mpg($content){
133
- // if (is_front_page() || is_single()) {
134
- // return $content;
135
- // }
136
- /* preg_match_all( '/<h(.*?).*?>(.*?)<\/h(.*?)>/', $content, $matches );*/
137
- // $array = $matches[2];
138
- // $container = '<div id="ez-toc-container" class="container counter-hierarchy counter-decimal ez-toc-grey"><div class="ez-toc-title-container"><p class="ez-toc-title">' . esc_html_e('Table of Contents', 'easy-table-of-contents') . '</p><span class="ez-toc-title-toggle"><a class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" style="display: inline;"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></a></span></div><nav><ul class="ez-toc-list">';
139
- // foreach ( $array as $val ) {
140
- // $val = preg_replace('/\[(.*?)\](.*?)\[(.*?)\]/', '$2', $val);
141
- // $val = preg_replace('/{(.*?)\|(.*?)\|(.*?)}/', '$3', $val);
142
- // $vals .= '<li><a class="anchor" href="#'.$val.'">'.$val.'</a></li>';
143
- /* $content = preg_replace('/<h(.*?).*?>(.*?)<\/h(.*?)>/', "<h$3 id='$2'>$2</h$3>", $content);*/
144
- // }
145
- // $last .= '</ul></nav></div>';
146
- // $content = $container . $vals . $last . $content;
147
- //
148
- //return $content;
149
- //}
150
-
151
- //if( is_plugin_active('beaver-builder-lite-version/fl-builder.php') )
152
- //{
153
- // add_filter( 'the_content', array( ezTOC::class, 'the_content' ) );
154
- //}
155
-
156
  /**
157
  * EzPrintR method
158
  * to print_r content with pre tags
108
  $desc = $term_object->description;
109
  preg_match_all( '@<h1.*?>(.*?)<\/h1>@', $desc, $matches );
110
  $array = $matches[1];
111
+ $container = '<div id="ez-toc-container" class="counter-hierarchy counter-decimal ez-toc-grey"><div class="ez-toc-title-container"><p class="ez-toc-title">' . esc_html_e('Table of Contents', 'easy-table-of-contents') . '</p><span class="ez-toc-title-toggle"><a href="#" class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" style="display: flex;" aria-label="ez-toc-toggle-icon-3">' . ezTOC::getTOCToggleIcon() . '</a></span></div><nav><ul class="ez-toc-list">';
112
  foreach ( $array as $val ) {
113
  $vals .= '<li><a class="anchor" href="#'.$val.'">'.$val.'</a></li>';
114
  $desc = preg_replace('/<h1>(.*?)<\/h1>/', "<h1 id='$1'>$1</h1>", $desc);
125
  remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
126
  }
127
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  /**
129
  * EzPrintR method
130
  * to print_r content with pre tags
includes/inc.plugin-compatibility.php CHANGED
@@ -698,4 +698,23 @@ if ( in_array( 'js_composer/js_composer.php', apply_filters( 'active_plugins', g
698
  return $output;
699
  }
700
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
701
  }
698
  return $output;
699
  }
700
  }
701
+ }
702
+
703
+ /**
704
+ * Foodie Pro Theme Compatibility
705
+ * for working sticky toggle
706
+ * in right way
707
+ * @since 2.0.39
708
+ */
709
+ if ( 'Foodie Pro' == apply_filters( 'current_theme', get_option( 'current_theme' ) ) ) {
710
+ add_action( 'wp_head', 'enqueueScriptsforFoodieProTheme' );
711
+
712
+ if( ! function_exists( 'enqueueScriptsforFoodieProTheme' ) ) {
713
+ function enqueueScriptsforFoodieProTheme() {
714
+ echo <<<INLINECSSFOODPRO
715
+ <style>@media only screen and (max-width: 940px){ .ez-toc-sticky #ez-toc-sticky-container .menu-toggle,#ez-toc-container .menu-toggle, #ez-toc-widget-container .menu-toggle{display:none} .ez-toc-sticky #ez-toc-sticky-container nav,#ez-toc-container nav, #ez-toc-widget-container nav {display:block} }</style>
716
+ INLINECSSFOODPRO;
717
+ }
718
+ }
719
+
720
  }