Easy Table of Contents - Version 2.0.26

Version Description

07/05/2022 = * BUG: TOC loading method should be same for CSS and JS #199 * BUG: Custom width option should come after selecting the User Define option #201 * BUG: Function added to front.js but not present in front.min.js #202 * BUG: The custom heading is not working with WP Bakery page builder #205 * BUG: TOC not working in the Avada themes in widgets #206 * BUG: Headers in content of shortcodes are not getting showing up in TOC #209 * BUG: TOC broken for non-English titles #211

Download this release

Release Info

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

Code changes from version 2.0.25.1 to 2.0.26

README.txt CHANGED
@@ -5,7 +5,7 @@ Tags: table of contents, toc
5
  Requires at least: 5.3
6
  Tested up to: 6.0
7
  Requires PHP: 5.6.20
8
- Stable tag: 2.0.25.1
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -97,8 +97,14 @@ Easy Table Contents is a fork of the excellent [Table of Contents Plus](https://
97
 
98
  == Changelog ==
99
 
100
- = 2.0.25/1 06/30/2022 =
101
- * BUG: Reusable Block Headings are not rendering in TOC titles #215
 
 
 
 
 
 
102
 
103
  = 2.0.25 06/27/2022 =
104
  * TWEAK: Added Migration from Table of Contents Plus and LuckyWP Table of Contents #160
5
  Requires at least: 5.3
6
  Tested up to: 6.0
7
  Requires PHP: 5.6.20
8
+ Stable tag: 2.0.26
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
97
 
98
  == Changelog ==
99
 
100
+ = 2.0.26 07/05/2022 =
101
+ * BUG: TOC loading method should be same for CSS and JS #199
102
+ * BUG: Custom width option should come after selecting the User Define option #201
103
+ * BUG: Function added to front.js but not present in front.min.js #202
104
+ * BUG: The custom heading is not working with WP Bakery page builder #205
105
+ * BUG: TOC not working in the Avada themes in widgets #206
106
+ * BUG: Headers in content of shortcodes are not getting showing up in TOC #209
107
+ * BUG: TOC broken for non-English titles #211
108
 
109
  = 2.0.25 06/27/2022 =
110
  * TWEAK: Added Migration from Table of Contents Plus and LuckyWP Table of Contents #160
assets/css/screen.css CHANGED
@@ -388,4 +388,9 @@ div#ez-toc-container p.ez-toc-title {
388
  }
389
  div#ez-toc-container {
390
  padding-right: 20px;
 
 
 
 
 
391
  }
388
  }
389
  div#ez-toc-container {
390
  padding-right: 20px;
391
+ }
392
+
393
+ label.cssicon .ez-toc-glyphicon:empty {
394
+ font-size: 16px;
395
+ margin-left: 2px;
396
  }
assets/css/screen.min.css CHANGED
@@ -21,3 +21,7 @@
21
  }
22
  .ez-toc-toggle #item{position: absolute;left: -999em;}
23
 
 
 
 
 
21
  }
22
  .ez-toc-toggle #item{position: absolute;left: -999em;}
23
 
24
+ label.cssicon .ez-toc-glyphicon:empty {
25
+ font-size: 16px;
26
+ margin-left: 2px;
27
+ }
assets/js/admin.js CHANGED
@@ -5,4 +5,15 @@ jQuery(document).ready(function($) {
5
  if ( ez_toc_color_picker.length ) {
6
  ez_toc_color_picker.wpColorPicker();
7
  }
 
 
 
 
 
 
 
 
 
 
 
8
  });
5
  if ( ez_toc_color_picker.length ) {
6
  ez_toc_color_picker.wpColorPicker();
7
  }
8
+ var tableBody = document.getElementById('eztoc-appearance');
9
+ var tableRows = tableBody.getElementsByTagName('tr');
10
+ var targetElement = tableRows[1];
11
+ targetElement.style.display = "none";
12
+ document.getElementById('ez-toc-settings[width]').addEventListener('change', function () {
13
+ if(document.getElementById('ez-toc-settings[width]').value == 'custom'){
14
+ targetElement.style.display = "revert";
15
+ }else{
16
+ targetElement.style.display = "none";
17
+ }
18
+ });
19
  });
assets/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready((function($){var ez_toc_color_picker=$(".ez-toc-color-picker");ez_toc_color_picker.length&&ez_toc_color_picker.wpColorPicker()}));
1
+ jQuery(document).ready((function(e){var t=e(".ez-toc-color-picker");t.length&&t.wpColorPicker();var n=document.getElementById("eztoc-appearance").getElementsByTagName("tr")[1];n.style.display="none",document.getElementById("ez-toc-settings[width]").addEventListener("change",(function(){"custom"==document.getElementById("ez-toc-settings[width]").value?n.style.display="revert":n.style.display="none"}))}));
assets/js/front.min.js CHANGED
@@ -1 +1 @@
1
- jQuery((function($){if("undefined"!=typeof ezTOC){var affix,smoothScroll;if(0!==$(".ez-toc-widget-container.ez-toc-affix").length){var affixOffset=30;void 0!==ezTOC.scroll_offset&&(affixOffset=parseInt(ezTOC.scroll_offset)),$(ezTOC.affixSelector).stick_in_parent({inner_scrolling:!1,offset_top:affixOffset})}if($.fn.shrinkTOCWidth=function(){$(this).css({width:"auto",display:"table"}),/MSIE 7\./.test(navigator.userAgent)&&$(this).css("width","")},1===parseInt(ezTOC.smooth_scroll)&&$("a.ez-toc-link").on("click",(function(){var self=$(this),target="",hostname=self.prop("hostname"),pathname=self.prop("pathname"),qs=self.prop("search"),hash=self.prop("hash");if(pathname.length>0&&"/"!==pathname.charAt(0)&&(pathname="/"+pathname),window.location.hostname===hostname&&window.location.pathname===pathname&&window.location.search===qs&&""!==hash){if(target='[id="'+hash.replace("#","")+'"]',0===$(target).length&&(console.log("ezTOC scrollTarget Not Found: "+target),target=""),void 0!==ezTOC.scroll_offset)var offset=-1*ezTOC.scroll_offset;else{var adminbar=$("#wpadminbar");offset=adminbar.length>0&&adminbar.is(":visible")?-30:0}target&&$.smoothScroll({scrollTarget:target,offset:offset,beforeScroll:deactivateSetActiveEzTocListElement,afterScroll:function(){setActiveEzTocListElement(),activateSetActiveEzTocListElement()}})}})),void 0!==ezTOC.visibility_hide_by_default){var toc=$("ul.ez-toc-list"),toggle=$("a.ez-toc-toggle"),invert=ezTOC.visibility_hide_by_default;toggle.css("display","inline"),Cookies&&1==Cookies.get("ezTOC_hidetoc")?toggle.data("visible",!1):toggle.data("visible",!0),invert&&toggle.data("visible",!1),toggle.data("visible")||toc.hide(),toggle.on("click",(function(event){event.preventDefault(),$(this).data("visible")?($(this).data("visible",!1),Cookies&&(invert?Cookies.set("ezTOC_hidetoc",null,{path:"/"}):Cookies.set("ezTOC_hidetoc","1",{expires:30,path:"/"})),toc.hide("fast")):($(this).data("visible",!0),Cookies&&(invert?Cookies.set("ezTOC_hidetoc","1",{expires:30,path:"/"}):Cookies.set("ezTOC_hidetoc",null,{path:"/"})),toc.show("fast"))}))}var headings=$("span.ez-toc-section").toArray(),headingToListElementLinkMap=getHeadingToListElementLinkMap(headings),listElementLinks=$.map(headingToListElementLinkMap,(function(value,key){return value})),scrollOffset=getScrollOffset();function setActiveEzTocListElement(){var activeHeading=getActiveHeading(scrollOffset,headings);if(activeHeading){var activeListElementLink=headingToListElementLinkMap[activeHeading.id];removeStyleFromNonActiveListElement(activeListElementLink,listElementLinks),setStyleForActiveListElementElement(activeListElementLink)}}function activateSetActiveEzTocListElement(){headings.length>0&&$(".ez-toc-widget-container").length&&$(window).on("load resize scroll",setActiveEzTocListElement)}function deactivateSetActiveEzTocListElement(){$(window).off("load resize scroll",setActiveEzTocListElement)}function getEzTocListElementLinkByHeading(heading){return $('.ez-toc-widget-container .ez-toc-list a[href="#'+$(heading).attr("id")+'"]')}function getHeadingToListElementLinkMap(headings){return headings.reduce((function(map,heading){return map[heading.id]=getEzTocListElementLinkByHeading(heading),map}),{})}function getScrollOffset(){var scrollOffset=5;void 0!==ezTOC.smooth_scroll&&1===parseInt(ezTOC.smooth_scroll)&&(scrollOffset=void 0!==ezTOC.scroll_offset?parseInt(ezTOC.scroll_offset):30);var adminbar=$("#wpadminbar");return adminbar.length&&(scrollOffset+=adminbar.height()),scrollOffset}function getActiveHeading(topOffset,headings){var scrollTop,relevantOffset=$(window).scrollTop()+topOffset+1,activeHeading=headings[0],closestHeadingAboveOffset=relevantOffset-$(activeHeading).offset().top;return headings.forEach((function(section){var topOffset=relevantOffset-$(section).offset().top;topOffset>0&&topOffset<closestHeadingAboveOffset&&(closestHeadingAboveOffset=topOffset,activeHeading=section)})),activeHeading}function removeStyleFromNonActiveListElement(activeListElementLink,listElementLinks){listElementLinks.forEach((function(listElementLink){activeListElementLink!==listElementLink&&listElementLink.parent().hasClass("active")&&listElementLink.parent().removeClass("active")}))}function correctActiveListElementBackgroundColorHeight(activeListElement){var listElementHeight;addListElementBackgroundColorHeightStyleToHead(getListElementHeightWithoutUlChildren(activeListElement))}function getListElementHeightWithoutUlChildren(listElement){var $listElement=$(listElement),content=$listElement.html();$listElement.parent().append('<li id="ez-toc-height-test" class="active">'+content+"</li>");var listItem=$("#ez-toc-height-test"),height=listItem.height();return listItem.remove(),height-$listElement.children("ul").first().height()}function addListElementBackgroundColorHeightStyleToHead(listElementHeight){$("#ez-toc-active-height").remove(),$('<style id="ez-toc-active-height">.ez-toc-widget-container ul.ez-toc-list li.active::before {height:'+listElementHeight+"px;} </style>").appendTo("head")}function setStyleForActiveListElementElement(activeListElementLink){var activeListElement=activeListElementLink.parent();activeListElement.hasClass("active")||activeListElement.addClass("active"),correctActiveListElementBackgroundColorHeight(activeListElement)}activateSetActiveEzTocListElement()}}));
1
+ jQuery(function($){if("undefined"!=typeof ezTOC){function e(){if(0!==$(".ez-toc-widget-container.ez-toc-affix").length){var e=30;void 0!==ezTOC.scroll_offset&&(e=parseInt(ezTOC.scroll_offset));$(ezTOC.affixSelector).stick_in_parent({inner_scrolling:!1,offset_top:e})}$.fn.shrinkTOCWidth=function(){$(this).css({width:"auto",display:"table"});/MSIE 7\./.test(navigator.userAgent)&&$(this).css("width","")};1===parseInt(ezTOC.smooth_scroll)&&$("a.ez-toc-link").on("click",function(){var e=$(this),t="",i=e.prop("hostname"),o=e.prop("pathname"),s=e.prop("search"),e=e.prop("hash");0<o.length&&"/"!==o.charAt(0)&&(o="/"+o);if(window.location.hostname===i&&window.location.pathname===o&&window.location.search===s&&""!==e){t='[id="'+e.replace("#","")+'"]';if(0===$(t).length){console.log("ezTOC scrollTarget Not Found: "+t);t=""}o=void 0!==ezTOC.scroll_offset?-1*ezTOC.scroll_offset:0<(i=$("#wpadminbar")).length&&i.is(":visible")?-30:0;t&&$.smoothScroll({scrollTarget:t,offset:o,beforeScroll:r,afterScroll:function(){l();c()}})}});if(void 0!==ezTOC.visibility_hide_by_default){var t=$("ul.ez-toc-list"),e=$("a.ez-toc-toggle"),i=ezTOC.visibility_hide_by_default;e.css("display","inline");Cookies&&1==Cookies.get("ezTOC_hidetoc")?e.data("visible",!1):e.data("visible",!0);i&&e.data("visible",!1);e.data("visible")||t.hide();e.on("click",function(e){e.preventDefault();if($(this).data("visible")){$(this).data("visible",!1);Cookies&&(i?Cookies.set("ezTOC_hidetoc",null,{path:"/"}):Cookies.set("ezTOC_hidetoc","1",{expires:30,path:"/"}));t.hide("fast")}else{$(this).data("visible",!0);Cookies&&(i?Cookies.set("ezTOC_hidetoc","1",{expires:30,path:"/"}):Cookies.set("ezTOC_hidetoc",null,{path:"/"}));t.show("fast")}})}var o=$("span.ez-toc-section").toArray(),s=o.reduce(function(e,t){e[t.id]=$('.ez-toc-widget-container .ez-toc-list a[href="#'+$(t).attr("id")+'"]');return e},{}),a=$.map(s,function(e,t){return e}),n=function(){var e=5;void 0!==ezTOC.smooth_scroll&&1===parseInt(ezTOC.smooth_scroll)&&(e=void 0!==ezTOC.scroll_offset?parseInt(ezTOC.scroll_offset):30);var t=$("#wpadminbar");t.length&&(e+=t.height());return e}();c();function l(){var t,e=function(e,t){var i=$(window).scrollTop()+e+1,o=t[0],s=i-$(o).offset().top;t.forEach(function(e){var t=i-$(e).offset().top;if(0<t&&t<s){s=t;o=e}});return o}(n,o);if(e){e=s[e.id],t=e,a.forEach(function(e){t!==e&&e.parent().hasClass("active")&&e.parent().removeClass("active")});(e=e.parent()).hasClass("active")||e.addClass("active");e=function(e){var e=$(e),t=e.html(),t=(e.parent().append('<li id="ez-toc-height-test" class="active">'+t+"</li>"),$("#ez-toc-height-test")),i=t.height();t.remove();return i-e.children("ul").first().height()}(e);$("#ez-toc-active-height").remove();$('<style id="ez-toc-active-height">.ez-toc-widget-container ul.ez-toc-list li.active::before {height:'+e+"px;} </style>").appendTo("head")}}function c(){0<o.length&&$(".ez-toc-widget-container").length&&$(window).on("load resize scroll",l)}function r(){$(window).off("load resize scroll",l)}}ezTOC.init=function(){e()};e()}});
easy-table-of-contents.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Easy Table of Contents
4
  * Plugin URI: https://magazine3.company/
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.25.1
7
  * Author: Magazine3
8
  * Author URI: https://magazine3.company/
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.25.1
30
  */
31
 
32
  use Easy_Plugins\Table_Of_Contents\Debug;
@@ -48,7 +48,7 @@ if ( ! class_exists( 'ezTOC' ) ) {
48
  * @since 1.0
49
  * @var string
50
  */
51
- const VERSION = '2.0.25.1';
52
 
53
  /**
54
  * Stores the instance of this class.
3
  * Plugin Name: Easy Table of Contents
4
  * Plugin URI: https://magazine3.company/
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.26
7
  * Author: Magazine3
8
  * Author URI: https://magazine3.company/
9
  * Text Domain: easy-table-of-contents
26
  * @package Easy Table of Contents
27
  * @category Plugin
28
  * @author Magazine3
29
+ * @version 2.0.26
30
  */
31
 
32
  use Easy_Plugins\Table_Of_Contents\Debug;
48
  * @since 1.0
49
  * @var string
50
  */
51
+ const VERSION = '2.0.26';
52
 
53
  /**
54
  * Stores the instance of this class.
includes/class.post.php CHANGED
@@ -1221,7 +1221,7 @@ class ezTOC_Post {
1221
  if(ezTOC_Option::get('visibility_hide_by_default')==true){
1222
  $toggle_view= "checked";
1223
  }
1224
- $html .= '<label for="item"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></label><input type="checkbox" id="item" '.$toggle_view.'>';
1225
  }
1226
  }
1227
 
1221
  if(ezTOC_Option::get('visibility_hide_by_default')==true){
1222
  $toggle_view= "checked";
1223
  }
1224
+ $html .= '<label for="item" class="cssicon"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></label><input type="checkbox" id="item" '.$toggle_view.'>';
1225
  }
1226
  }
1227