Easy Table of Contents - Version 2.0.28

Version Description

07/15/2022 = * TWEAK: Added Sidebar placement option for TOC #156 * TWEAK: Added SeedProd Pro compatibility #157 * TWEAK: Added option to show the TOC content after the first paragraph #181 * BUG: TOC not working in sidebar with Blocksy theme #220 * BUG: Form elements do not have associated labels In lighthouse #219 * BUG: Alternate Heading problem with Umlauts #148

Download this release

Release Info

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

Code changes from version 2.0.26 to 2.0.28

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.26
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -97,6 +97,23 @@ Easy Table Contents is a fork of the excellent [Table of Contents Plus](https://
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
5
  Requires at least: 5.3
6
  Tested up to: 6.0
7
  Requires PHP: 5.6.20
8
+ Stable tag: 2.0.28
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.28 07/15/2022 =
101
+ * TWEAK: Added Sidebar placement option for TOC #156
102
+ * TWEAK: Added SeedProd Pro compatibility #157
103
+ * TWEAK: Added option to show the TOC content after the first paragraph #181
104
+ * BUG: TOC not working in sidebar with Blocksy theme #220
105
+ * BUG: Form elements do not have associated labels In lighthouse #219
106
+ * BUG: Alternate Heading problem with Umlauts #148
107
+
108
+ = 2.0.27 07/12/2022 =
109
+ * TWEAK: Added subscribe to newsletters form on plugin activation #216
110
+ * TWEAK: Added user feedback form on plugin deactivation #216
111
+ * TWEAK: Added option to remove special characters from TOC Headings #217
112
+ * BUG: Corner Stone page builder heading are not working #200
113
+ * BUG: The links are not working using href with pure CSS option #208
114
+ * BUG: Attribute href is missing in an anchor element due to which links cannot be crawled #210
115
+ * BUG: Debug Warnings #212
116
+
117
  = 2.0.26 07/05/2022 =
118
  * BUG: TOC loading method should be same for CSS and JS #199
119
  * BUG: Custom width option should come after selecting the User Define option #201
assets/css/admin.css CHANGED
@@ -1232,4 +1232,12 @@ a#eztoc-welcome {
1232
  }
1233
  .eztoc-result{
1234
  margin-left: 70px;
 
 
 
 
 
 
 
 
1235
  }
1232
  }
1233
  .eztoc-result{
1234
  margin-left: 70px;
1235
+ }
1236
+
1237
+ div#wp-pointer-0{
1238
+ position: absolute;
1239
+ width: 320px;
1240
+ top: 515px!important;
1241
+ left: 146px!important;
1242
+ z-index: 9999;
1243
  }
assets/css/admin.min.css CHANGED
@@ -1 +1,8 @@
1
- div.tab_content table {margin-bottom: 1em;}table.more_toc_options_table th, table.more_toc_options_table td {padding: 0;margin: 0;}table.more_toc_options_table th {width: auto;padding-right: 4px;padding-top: 2px;}div.tab_content ul li {margin-left: 2em;list-style-type: disc;}div.tab_content ol li {list-style: inherit;}div.tab_content pre {margin-left: 2em;}ul#tabbed-nav {margin-top: 1em;}#tabbed-nav {margin: 0;padding: 0;float: left;list-style: none;height: 32px;border-bottom: 1px solid #DFDFDF;border-left: 1px solid #DFDFDF;width: 100%;}#tabbed-nav li {float: left;margin: 0;padding: 0;height: 31px;line-height: 31px;border: 1px solid #DFDFDF;border-left: none;margin-bottom: -1px;overflow: hidden;position: relative;background: #F5F5F5;background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#F5F5F5));background-image: -webkit-linear-gradient(center top, #fff, #F5F5F5);background-image: -moz-linear-gradient(center top, #fff, #F5F5F5);background-image: -ms-linear-gradient(center top, #fff, #F5F5F5);background-image: -o-linear-gradient(center top, #fff, #F5F5F5);background-image: linear-gradient(center top, #fff, #F5F5F5);}#tabbed-nav li a {text-decoration: none;color: #000;display: block;font-size: 1.2em;padding: 0 20px;border: 1px solid #fff;outline: none;}#tabbed-nav li a:hover {background: #ECECEC;}html #tabbed-nav li.active, html #tabbed-nav li.active a:hover {background: #fff;border-bottom: 1px solid #fff;}div.tab_container {border: 1px solid #DFDFDF;border-top: none;overflow: hidden;clear: both;float: left;width: 100%;background: #fff;margin-bottom: 2em;padding-bottom: 2em;}div.tab_content {padding: 10px;padding-bottom: 0;font-size: 1em;}h3 span.show_hide {font-size: 0.85em;font-weight: normal;}div.more_toc_options {margin-top: 4px;margin-left: 2em;}div.toc_theme_option {width: 200px;float: left;margin-right: 5px;}#wpcontent select optgroup option {padding-left: 15px;}input#width_custom, input#font_size, input#child_font_size, input#smooth_scroll_offset {width: 50px;text-align: center;}input.custom_colour_option {width: 75px;}table#theme_custom, div#farbtastic_colour_wheel {float: left;}table#theme_custom {margin-top: 30px;}table#theme_custom img {vertical-align: middle;opacity: 0.4;}table#theme_custom img:hover {cursor: pointer;opacity: 1;}div#farbtastic_colour_wheel {margin-left: 20px;}#tab3 h3:not(:first-child) {margin-top: 2em;}#toc input.small-text {width: 50px;padding: 2px;height: 28px;line-height: 28px;vertical-align: bottom;}#toc .form-table tr > th > strong {font-size: 18px;font-style: italic;}.postbox{padding: 10px;}html {scroll-behavior: smooth;}.toc-tab-panel {overflow: hidden;border: 1px solid #ccc;background-color: #fff;margin-top: 15px;}.toc-tab-panel a {background-color: inherit;text-decoration: none;float: left;border: none;outline: none;cursor: pointer;padding: 14px 16px;transition: 0s;font-size: 15px;color: #2271b1;font-weight: 500;}.toc-tab-panel a:hover {color: #0a4b78;}.toc-tab-panel a.active {box-shadow: none;border-bottom: 4px solid #646970;color: #1d2327;}.toc-tab-panel a:focus {box-shadow: none;outline: none;}.eztoc-tabcontent {display: none;border-top: none;animation: fadeEffect 1s;}.eztoc_support_div {background: #fff;margin-top: 10px;padding: 28px;min-width: 255px;border: 1px solid #c3c4c7;box-shadow: 0 1px 1px rgb(0 0 0 / 4%);}.support-label {float: left;width: 70px;font-size: 14px;}.star-mark{color: red;margin-left: 4px;font-family:bold;}.eztoc_support_div li {margin:25px 0px 20px 0px;}.eztoc-query-success{color: green;}.eztoc-query-error{color: red;}.eztoc_hide{display: none;}.eztoc-result{margin-left: 70px;}.eztoc-send-query{margin-left: 70px !important;;}@keyframes fadeEffect {from {opacity: 0;}to {opacity: 1;}}.eztoc-wrapper{max-width: 1090px;width: 100%;display: flex;flex-wrap: wrap;margin: auto;}.eztoc-wrapper .table{margin: 0 auto;background: #fff;width: calc(30%);padding: 30px 20px;position: relative;box-shadow: 0 5px 10px rgb(0 0 0 / 10%);}.table .price-section{display: flex;justify-content: center;}.price-section .price-area{height: 120px;width: 120px;background: #ffd861;border-radius: 50%;padding: 2px;}.price-section .price-area .inner-area{height: 100%;width: 100%;border-radius: 50%;border: 3px solid #fff;color: #fff;line-height: 117px;text-align: center;position: relative;}.price-area .inner-area .text{font-size: 25px;font-weight: 400;position: absolute;top: -10px;left: 17px;}.price-area .inner-area .price{font-size: 55px;font-weight: 500;}.table .package-name{width: 100%;height: 2px;background: #ffecb3;margin: 35px 0;position: relative;}.table .package-name::before{position: absolute;content: "Basic";top: 50%;left: 50%;transform: translate(-50%, -50%);background: #fff;font-size: 25px;padding: 0 10px;font-weight: bolder;}.table .features li{list-style: none;display: flex;justify-content: space-between;margin-bottom: 15px;}.features li .list-name{font-size: 17px;font-weight: 400;}.features li .icon{font-size: 15px;}.features li .icon.check{color: #2db94d;}.features li .icon.cross{color: #cd3241;}.table .btn{display: flex;justify-content: center;margin-top: 35px;}.table .btn button{width: 80%;height: 50px;font-weight: 700;color: #fff;font-size: 20px;border: none;outline: none;border-radius: 25px;cursor: pointer;transition: all 0.3s ease;}.basic .price-area, .basic .inner-area{background: #ffd861;}.basic .btn button{background: #fff;color: #ffd861;border: 2px solid #ffd861;}.basic .btn button:hover{border-radius: 6px;background: #ffd861;color: #fff;}.Premium .price-area, .Premium .inner-area{background: #a26bfa;}.Premium .btn button{background: #fff;color: #a26bfa;border: 2px solid #a26bfa;}.Premium .btn button:hover{border-radius: 6px;background: #a26bfa;color: #fff;}.basic .package-name{background: #ffecb3;}.Premium .package-name{background: #a26bfa;}.basic .package-name::before{content: "Free";}.Premium .package-name::before{content: "PRO";}.basic ::selection, .basic .price-area, .basic .inner-area{background: #ffd861;}.Premium ::selection, .Premium .price-area, .Premium .inner-area{background: #a26bfa;}div#eztoc-tabs a {text-decoration: none;}div#eztoc-tabs a:first-child {color: #000;}a#eztoc-upgrade {color: #b8ef0e;background: #000;padding: 16px;}
 
 
 
 
 
 
 
1
+ div.tab_content table {margin-bottom: 1em;}table.more_toc_options_table th, table.more_toc_options_table td {padding: 0;margin: 0;}table.more_toc_options_table th {width: auto;padding-right: 4px;padding-top: 2px;}div.tab_content ul li {margin-left: 2em;list-style-type: disc;}div.tab_content ol li {list-style: inherit;}div.tab_content pre {margin-left: 2em;}ul#tabbed-nav {margin-top: 1em;}#tabbed-nav {margin: 0;padding: 0;float: left;list-style: none;height: 32px;border-bottom: 1px solid #DFDFDF;border-left: 1px solid #DFDFDF;width: 100%;}#tabbed-nav li {float: left;margin: 0;padding: 0;height: 31px;line-height: 31px;border: 1px solid #DFDFDF;border-left: none;margin-bottom: -1px;overflow: hidden;position: relative;background: #F5F5F5;background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#F5F5F5));background-image: -webkit-linear-gradient(center top, #fff, #F5F5F5);background-image: -moz-linear-gradient(center top, #fff, #F5F5F5);background-image: -ms-linear-gradient(center top, #fff, #F5F5F5);background-image: -o-linear-gradient(center top, #fff, #F5F5F5);background-image: linear-gradient(center top, #fff, #F5F5F5);}#tabbed-nav li a {text-decoration: none;color: #000;display: block;font-size: 1.2em;padding: 0 20px;border: 1px solid #fff;outline: none;}#tabbed-nav li a:hover {background: #ECECEC;}html #tabbed-nav li.active, html #tabbed-nav li.active a:hover {background: #fff;border-bottom: 1px solid #fff;}div.tab_container {border: 1px solid #DFDFDF;border-top: none;overflow: hidden;clear: both;float: left;width: 100%;background: #fff;margin-bottom: 2em;padding-bottom: 2em;}div.tab_content {padding: 10px;padding-bottom: 0;font-size: 1em;}h3 span.show_hide {font-size: 0.85em;font-weight: normal;}div.more_toc_options {margin-top: 4px;margin-left: 2em;}div.toc_theme_option {width: 200px;float: left;margin-right: 5px;}#wpcontent select optgroup option {padding-left: 15px;}input#width_custom, input#font_size, input#child_font_size, input#smooth_scroll_offset {width: 50px;text-align: center;}input.custom_colour_option {width: 75px;}table#theme_custom, div#farbtastic_colour_wheel {float: left;}table#theme_custom {margin-top: 30px;}table#theme_custom img {vertical-align: middle;opacity: 0.4;}table#theme_custom img:hover {cursor: pointer;opacity: 1;}div#farbtastic_colour_wheel {margin-left: 20px;}#tab3 h3:not(:first-child) {margin-top: 2em;}#toc input.small-text {width: 50px;padding: 2px;height: 28px;line-height: 28px;vertical-align: bottom;}#toc .form-table tr > th > strong {font-size: 18px;font-style: italic;}.postbox{padding: 10px;}html {scroll-behavior: smooth;}.toc-tab-panel {overflow: hidden;border: 1px solid #ccc;background-color: #fff;margin-top: 15px;}.toc-tab-panel a {background-color: inherit;text-decoration: none;float: left;border: none;outline: none;cursor: pointer;padding: 14px 16px;transition: 0s;font-size: 15px;color: #2271b1;font-weight: 500;}.toc-tab-panel a:hover {color: #0a4b78;}.toc-tab-panel a.active {box-shadow: none;border-bottom: 4px solid #646970;color: #1d2327;}.toc-tab-panel a:focus {box-shadow: none;outline: none;}.eztoc-tabcontent {display: none;border-top: none;animation: fadeEffect 1s;}.eztoc_support_div {background: #fff;margin-top: 10px;padding: 28px;min-width: 255px;border: 1px solid #c3c4c7;box-shadow: 0 1px 1px rgb(0 0 0 / 4%);}.support-label {float: left;width: 70px;font-size: 14px;}.star-mark{color: red;margin-left: 4px;font-family:bold;}.eztoc_support_div li {margin:25px 0px 20px 0px;}.eztoc-query-success{color: green;}.eztoc-query-error{color: red;}.eztoc_hide{display: none;}.eztoc-result{margin-left: 70px;}.eztoc-send-query{margin-left: 70px !important;;}@keyframes fadeEffect {from {opacity: 0;}to {opacity: 1;}}.eztoc-wrapper{max-width: 1090px;width: 100%;display: flex;flex-wrap: wrap;margin: auto;}.eztoc-wrapper .table{margin: 0 auto;background: #fff;width: calc(30%);padding: 30px 20px;position: relative;box-shadow: 0 5px 10px rgb(0 0 0 / 10%);}.table .price-section{display: flex;justify-content: center;}.price-section .price-area{height: 120px;width: 120px;background: #ffd861;border-radius: 50%;padding: 2px;}.price-section .price-area .inner-area{height: 100%;width: 100%;border-radius: 50%;border: 3px solid #fff;color: #fff;line-height: 117px;text-align: center;position: relative;}.price-area .inner-area .text{font-size: 25px;font-weight: 400;position: absolute;top: -10px;left: 17px;}.price-area .inner-area .price{font-size: 55px;font-weight: 500;}.table .package-name{width: 100%;height: 2px;background: #ffecb3;margin: 35px 0;position: relative;}.table .package-name::before{position: absolute;content: "Basic";top: 50%;left: 50%;transform: translate(-50%, -50%);background: #fff;font-size: 25px;padding: 0 10px;font-weight: bolder;}.table .features li{list-style: none;display: flex;justify-content: space-between;margin-bottom: 15px;}.features li .list-name{font-size: 17px;font-weight: 400;}.features li .icon{font-size: 15px;}.features li .icon.check{color: #2db94d;}.features li .icon.cross{color: #cd3241;}.table .btn{display: flex;justify-content: center;margin-top: 35px;}.table .btn button{width: 80%;height: 50px;font-weight: 700;color: #fff;font-size: 20px;border: none;outline: none;border-radius: 25px;cursor: pointer;transition: all 0.3s ease;}.basic .price-area, .basic .inner-area{background: #ffd861;}.basic .btn button{background: #fff;color: #ffd861;border: 2px solid #ffd861;}.basic .btn button:hover{border-radius: 6px;background: #ffd861;color: #fff;}.Premium .price-area, .Premium .inner-area{background: #a26bfa;}.Premium .btn button{background: #fff;color: #a26bfa;border: 2px solid #a26bfa;}.Premium .btn button:hover{border-radius: 6px;background: #a26bfa;color: #fff;}.basic .package-name{background: #ffecb3;}.Premium .package-name{background: #a26bfa;}.basic .package-name::before{content: "Free";}.Premium .package-name::before{content: "PRO";}.basic ::selection, .basic .price-area, .basic .inner-area{background: #ffd861;}.Premium ::selection, .Premium .price-area, .Premium .inner-area{background: #a26bfa;}div#eztoc-tabs a {text-decoration: none;}div#eztoc-tabs a:first-child {color: #000;}a#eztoc-upgrade {color: #b8ef0e;background: #000;padding: 16px;}
2
+ div#wp-pointer-0{
3
+ position: absolute;
4
+ width: 320px;
5
+ top: 630px!important;
6
+ left: 146px!important;
7
+ z-index: 9999;
8
+ }
assets/css/screen.css CHANGED
@@ -370,6 +370,7 @@ div.ez-toc-widget-container li {
370
  opacity: 0;
371
  max-height: 0;
372
  border: none;
 
373
  }
374
 
375
  #ez-toc-container label {
@@ -393,4 +394,12 @@ div#ez-toc-container {
393
  label.cssicon .ez-toc-glyphicon:empty {
394
  font-size: 16px;
395
  margin-left: 2px;
 
 
 
 
 
 
 
 
396
  }
370
  opacity: 0;
371
  max-height: 0;
372
  border: none;
373
+ display: none;
374
  }
375
 
376
  #ez-toc-container label {
394
  label.cssicon .ez-toc-glyphicon:empty {
395
  font-size: 16px;
396
  margin-left: 2px;
397
+ }
398
+
399
+ label.cssiconcheckbox {
400
+ display: none;
401
+ }
402
+
403
+ div#ez-toc-container.afterpara + p {
404
+ display: none;
405
  }
assets/css/screen.min.css CHANGED
@@ -1,4 +1,4 @@
1
- #ez-toc-container {background: #F9F9F9;border: 1px solid #AAAAAA;border-radius: 4px;-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(0, 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: #FFFFFF;}#ez-toc-container.ez-toc-black {background: #000000;}#ez-toc-container.ez-toc-transparent {background: none transparent;}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 ul, #ez-toc-container li {margin: 0;padding: 0;}#ez-toc-container ul, #ez-toc-container li, #ez-toc-container ul li, div.ez-toc-widget-container, div.ez-toc-widget-container li {background: none;list-style: none 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: table-cell;text-align: left;vertical-align: middle;}#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: #444444;box-shadow: none;text-decoration: none;text-shadow: none;}#ez-toc-container a:visited {color: #9f9f9f;}#ez-toc-container a:hover {text-decoration: underline;}#ez-toc-container.ez-toc-black a {color: #FFF;}#ez-toc-container.ez-toc-black a:visited {color: #FFF;}#ez-toc-container a.ez-toc-toggle {color: #444444;}#ez-toc-container.counter-hierarchy ul, .ez-toc-widget-container.counter-hierarchy ul, #ez-toc-container.counter-flat ul, .ez-toc-widget-container.counter-flat ul {counter-reset: item;}#ez-toc-container.counter-numeric li, .ez-toc-widget-container.counter-numeric li {list-style-type: decimal;list-style-position: inside;}#ez-toc-container.counter-decimal ul.ez-toc-list li a::before, .ez-toc-widget-container.counter-decimal ul.ez-toc-list li a::before {content: counters(item, ".") ". ";display: inline-block;counter-increment: item;margin-right: .2em;}#ez-toc-container.counter-roman li a::before, .ez-toc-widget-container.counter-roman ul.ez-toc-list li a::before {content: counters(item, ".", upper-roman) ". ";counter-increment: item;}.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::before {background-color: #EDEDED;}.ez-toc-widget-container li.active > a {font-weight: 900;}.ez-toc-btn {display: inline-block;padding: 6px 12px;margin-bottom: 0;font-size: 14px;font-weight: normal;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: thin dotted #333;outline: 5px auto -webkit-focus-ring-color;outline-offset: -2px }.ez-toc-btn:hover,.ez-toc-btn:focus {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,0.125);box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }.ez-toc-btn-default {color: #333;background-color: #fff;border-color: #ccc }.ez-toc-btn-default:hover,.ez-toc-btn-default:focus,.ez-toc-btn-default:active,.ez-toc-btn-default.active {color: #333;background-color: #ebebeb;border-color: #adadad }.ez-toc-btn-default:active,.ez-toc-btn-default.active {background-image: none }.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 {text-shadow: 0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075) }.ez-toc-btn-default:active {-webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }.ez-toc-btn:active,.btn.active {background-image: none }.ez-toc-btn-default {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: #dbdbdb;border-color: #ccc;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe0e0e0',GradientType=0);filter: progid:DXImageTransform.Microsoft.gradient(enabled=false) }.ez-toc-btn-default:hover,.ez-toc-btn-default:focus {background-color: #e0e0e0;background-position: 0 -15px }.ez-toc-btn-default:active,.ez-toc-btn-default.active {background-color: #e0e0e0;border-color: #dbdbdb }.ez-toc-pull-right {float: right !important;margin-left: 10px;}.ez-toc-glyphicon {position: relative;top: 1px;display: inline-block;font-family: 'Glyphicons Halflings';-webkit-font-smoothing: antialiased;font-style: normal;font-weight: normal;line-height: 1;-moz-osx-font-smoothing: grayscale }.ez-toc-glyphicon:empty {width: 1em }.ez-toc-toggle i.ez-toc-glyphicon {font-size: 16px;margin-left: 2px;}[class*="ez-toc-icon-"] {font-family: 'ez-toc-icomoon' !important;speak: none;font-style: normal;font-weight: normal;font-variant: normal;text-transform: none;line-height: 1;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}.ez-toc-icon-toggle:before {content: "\e87a";}#ez-toc-container input {position: absolute;left: -999em;}#ez-toc-container input[type="checkbox"]:checked + nav {opacity: 0;max-height: 0;border: none;}#ez-toc-container label {float: right;position: relative;left: 3px;font-size: 16px;/* background: #f9efef; */padding: 0px 4px 0px 5px;border: 1px solid #999191;border-radius: 5px;cursor: pointer;}div#ez-toc-container p.ez-toc-title {display: contents;}div#ez-toc-container {padding-right: 20px;}#ez-toc-container label {left: 10px;}.ez-toc-wrap-center {margin: 0 auto;}
2
  #ez-toc-container.counter-hyphen ul.ez-toc-list li a::before,
3
 
4
  #ez-toc-container.counter-disc li,
@@ -24,4 +24,10 @@
24
  label.cssicon .ez-toc-glyphicon:empty {
25
  font-size: 16px;
26
  margin-left: 2px;
 
 
 
 
 
 
27
  }
1
+ #ez-toc-container {background: #F9F9F9;border: 1px solid #AAAAAA;border-radius: 4px;-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(0, 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: #FFFFFF;}#ez-toc-container.ez-toc-black {background: #000000;}#ez-toc-container.ez-toc-transparent {background: none transparent;}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 ul, #ez-toc-container li {margin: 0;padding: 0;}#ez-toc-container ul, #ez-toc-container li, #ez-toc-container ul li, div.ez-toc-widget-container, div.ez-toc-widget-container li {background: none;list-style: none 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: table-cell;text-align: left;vertical-align: middle;}#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: #444444;box-shadow: none;text-decoration: none;text-shadow: none;}#ez-toc-container a:visited {color: #9f9f9f;}#ez-toc-container a:hover {text-decoration: underline;}#ez-toc-container.ez-toc-black a {color: #FFF;}#ez-toc-container.ez-toc-black a:visited {color: #FFF;}#ez-toc-container a.ez-toc-toggle {color: #444444;}#ez-toc-container.counter-hierarchy ul, .ez-toc-widget-container.counter-hierarchy ul, #ez-toc-container.counter-flat ul, .ez-toc-widget-container.counter-flat ul {counter-reset: item;}#ez-toc-container.counter-numeric li, .ez-toc-widget-container.counter-numeric li {list-style-type: decimal;list-style-position: inside;}#ez-toc-container.counter-decimal ul.ez-toc-list li a::before, .ez-toc-widget-container.counter-decimal ul.ez-toc-list li a::before {content: counters(item, ".") ". ";display: inline-block;counter-increment: item;margin-right: .2em;}#ez-toc-container.counter-roman li a::before, .ez-toc-widget-container.counter-roman ul.ez-toc-list li a::before {content: counters(item, ".", upper-roman) ". ";counter-increment: item;}.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::before {background-color: #EDEDED;}.ez-toc-widget-container li.active > a {font-weight: 900;}.ez-toc-btn {display: inline-block;padding: 6px 12px;margin-bottom: 0;font-size: 14px;font-weight: normal;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: thin dotted #333;outline: 5px auto -webkit-focus-ring-color;outline-offset: -2px }.ez-toc-btn:hover,.ez-toc-btn:focus {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,0.125);box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }.ez-toc-btn-default {color: #333;background-color: #fff;border-color: #ccc }.ez-toc-btn-default:hover,.ez-toc-btn-default:focus,.ez-toc-btn-default:active,.ez-toc-btn-default.active {color: #333;background-color: #ebebeb;border-color: #adadad }.ez-toc-btn-default:active,.ez-toc-btn-default.active {background-image: none }.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 {text-shadow: 0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075) }.ez-toc-btn-default:active {-webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }.ez-toc-btn:active,.btn.active {background-image: none }.ez-toc-btn-default {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: #dbdbdb;border-color: #ccc;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe0e0e0',GradientType=0);filter: progid:DXImageTransform.Microsoft.gradient(enabled=false) }.ez-toc-btn-default:hover,.ez-toc-btn-default:focus {background-color: #e0e0e0;background-position: 0 -15px }.ez-toc-btn-default:active,.ez-toc-btn-default.active {background-color: #e0e0e0;border-color: #dbdbdb }.ez-toc-pull-right {float: right !important;margin-left: 10px;}.ez-toc-glyphicon {position: relative;top: 1px;display: inline-block;font-family: 'Glyphicons Halflings';-webkit-font-smoothing: antialiased;font-style: normal;font-weight: normal;line-height: 1;-moz-osx-font-smoothing: grayscale }.ez-toc-glyphicon:empty {width: 1em }.ez-toc-toggle i.ez-toc-glyphicon {font-size: 16px;margin-left: 2px;}[class*="ez-toc-icon-"] {font-family: 'ez-toc-icomoon' !important;speak: none;font-style: normal;font-weight: normal;font-variant: normal;text-transform: none;line-height: 1;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}.ez-toc-icon-toggle:before {content: "\e87a";}#ez-toc-container input {position: absolute;left: -999em;}#ez-toc-container input[type="checkbox"]:checked + nav {opacity: 0;max-height: 0;border: none;display: none;}#ez-toc-container label {float: right;position: relative;left: 3px;font-size: 16px;/* background: #f9efef; */padding: 0px 4px 0px 5px;border: 1px solid #999191;border-radius: 5px;cursor: pointer;}div#ez-toc-container p.ez-toc-title {display: contents;}div#ez-toc-container {padding-right: 20px;}#ez-toc-container label {left: 10px;}.ez-toc-wrap-center {margin: 0 auto;}
2
  #ez-toc-container.counter-hyphen ul.ez-toc-list li a::before,
3
 
4
  #ez-toc-container.counter-disc li,
24
  label.cssicon .ez-toc-glyphicon:empty {
25
  font-size: 16px;
26
  margin-left: 2px;
27
+ }
28
+ label.cssiconcheckbox {
29
+ display: none;
30
+ }
31
+ div#ez-toc-container.afterpara + p {
32
+ display: none;
33
  }
assets/js/admin.js CHANGED
@@ -16,4 +16,14 @@ jQuery(document).ready(function($) {
16
  targetElement.style.display = "none";
17
  }
18
  });
 
 
 
 
 
 
 
 
 
 
19
  });
16
  targetElement.style.display = "none";
17
  }
18
  });
19
+ $("#subscribe-newsletter-form").on('submit',function(e){
20
+ e.preventDefault();
21
+ var $form = $("#subscribe-newsletter-form");
22
+ var name = $form.find('input[name="name"]').val();
23
+ var email = $form.find('input[name="email"]').val();
24
+ var website = $form.find('input[name="company"]').val();
25
+ $.post(ajaxurl, {action:'eztoc_subscribe_newsletter',name:name, email:email,website:website},
26
+ function(data) {}
27
+ );
28
+ });
29
  });
assets/js/admin.min.js CHANGED
@@ -1 +1 @@
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"}))}));
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"})),e("#subscribe-newsletter-form").on("submit",(function(t){t.preventDefault();var n=e("#subscribe-newsletter-form"),a=n.find('input[name="name"]').val(),i=n.find('input[name="email"]').val(),o=n.find('input[name="company"]').val();e.post(ajaxurl,{action:"eztoc_subscribe_newsletter",name:a,email:i,website:o},(function(e){}))}))}));
assets/js/eztoc-admin.js CHANGED
@@ -80,4 +80,15 @@ jQuery(document).ready(function($) {
80
  }
81
 
82
  });
 
 
 
 
 
 
 
 
 
 
 
83
  });
80
  }
81
 
82
  });
83
+
84
+ $("#subscribe-newsletter-form").on('submit',function(e){
85
+ e.preventDefault();
86
+ var $form = $("#subscribe-newsletter-form");
87
+ var name = $form.find('input[name="name"]').val();
88
+ var email = $form.find('input[name="email"]').val();
89
+ var website = $form.find('input[name="company"]').val();
90
+ $.post(ajaxurl, {action:'eztoc_subscribe_newsletter',name:name, email:email,website:website},
91
+ function(data) {}
92
+ );
93
+ });
94
  });
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.26
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.26
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.26';
52
 
53
  /**
54
  * Stores the instance of this class.
@@ -128,6 +128,8 @@ if ( ! class_exists( 'ezTOC' ) ) {
128
 
129
  // This must be included after `class.options.php` because it depends on it methods.
130
  require_once( EZ_TOC_PATH . '/includes/class.admin.php' );
 
 
131
  }
132
 
133
  require_once( EZ_TOC_PATH . '/includes/class.post.php' );
@@ -684,7 +686,11 @@ if ( ! class_exists( 'ezTOC' ) ) {
684
  $replace[0] = $replace[0] . $toc;
685
  $content = mb_find_replace( $find, $replace, $content );
686
  break;
687
-
 
 
 
 
688
  case 'before':
689
  default:
690
  //$replace[0] = $html . $replace[0];
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.28
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.28
30
  */
31
 
32
  use Easy_Plugins\Table_Of_Contents\Debug;
48
  * @since 1.0
49
  * @var string
50
  */
51
+ const VERSION = '2.0.28';
52
 
53
  /**
54
  * Stores the instance of this class.
128
 
129
  // This must be included after `class.options.php` because it depends on it methods.
130
  require_once( EZ_TOC_PATH . '/includes/class.admin.php' );
131
+ require_once(EZ_TOC_PATH. "/includes/helper-function.php" );
132
+ require_once( EZ_TOC_PATH . '/includes/newsletter.php' );
133
  }
134
 
135
  require_once( EZ_TOC_PATH . '/includes/class.post.php' );
686
  $replace[0] = $replace[0] . $toc;
687
  $content = mb_find_replace( $find, $replace, $content );
688
  break;
689
+ case 'afterpara':
690
+ $get_para = preg_match_all('%(<p[^>]*>.*?</p>)%i', $content, $matches);
691
+ $first_para = $matches[1][0];
692
+ $content = $first_para . $toc . $content;
693
+ break;
694
  case 'before':
695
  default:
696
  //$replace[0] = $html . $replace[0];
includes/class.options.php CHANGED
@@ -183,6 +183,7 @@ if ( ! class_exists( 'ezTOC_Option' ) ) {
183
  'options' => array(
184
  'before' => __( 'Before first heading (default)', 'easy-table-of-contents' ),
185
  'after' => __( 'After first heading', 'easy-table-of-contents' ),
 
186
  'top' => __( 'Top', 'easy-table-of-contents' ),
187
  'bottom' => __( 'Bottom', 'easy-table-of-contents' ),
188
  //'placeholder' => __( 'Replace [toc] placeholder. For backwards compatibility with Table of Content Plus.', 'easy-table-of-contents' ),
@@ -280,6 +281,13 @@ if ( ! class_exists( 'ezTOC_Option' ) ) {
280
  ),
281
  'default' => 'js',
282
  ),
 
 
 
 
 
 
 
283
  )
284
  ),
285
  'appearance' => apply_filters(
@@ -636,6 +644,7 @@ if ( ! class_exists( 'ezTOC_Option' ) ) {
636
  'mobile_smooth_scroll_offset' => 0,
637
  'visibility' => true,
638
  'toc_loading' => 'js',
 
639
  //'visibility_show' => 'show',
640
  //'visibility_hide' => 'hide',
641
  'visibility_hide_by_default' => false,
183
  'options' => array(
184
  'before' => __( 'Before first heading (default)', 'easy-table-of-contents' ),
185
  'after' => __( 'After first heading', 'easy-table-of-contents' ),
186
+ 'afterpara' => __( 'After first paragraph', 'easy-table-of-contents' ),
187
  'top' => __( 'Top', 'easy-table-of-contents' ),
188
  'bottom' => __( 'Bottom', 'easy-table-of-contents' ),
189
  //'placeholder' => __( 'Replace [toc] placeholder. For backwards compatibility with Table of Content Plus.', 'easy-table-of-contents' ),
281
  ),
282
  'default' => 'js',
283
  ),
284
+ 'remove_special_chars_from_title' => array(
285
+ 'id' => 'remove_special_chars_from_title',
286
+ 'name' => __( 'Remove \':\' from TOC Title', 'easy-table-of-contents' ),
287
+ 'desc' => '',
288
+ 'type' => 'checkbox',
289
+ 'default' => false,
290
+ ),
291
  )
292
  ),
293
  'appearance' => apply_filters(
644
  'mobile_smooth_scroll_offset' => 0,
645
  'visibility' => true,
646
  'toc_loading' => 'js',
647
+ 'remove_special_chars_from_title' => false,
648
  //'visibility_show' => 'show',
649
  //'visibility_hide' => 'hide',
650
  'visibility_hide_by_default' => false,
includes/class.post.php CHANGED
@@ -364,13 +364,13 @@ class ezTOC_Post {
364
  $selectors = apply_filters( 'ez_toc_exclude_by_selector', array( '.ez-toc-exclude-headings' ), $content );
365
 
366
  $nodes = $html->Find( implode( ',', $selectors ) );
 
 
367
 
368
- foreach ( $nodes['ids'] as $id ) {
369
-
370
- //$this->excludedNodes[ $page ][ $id ] = $html->Implode( $id, $tagFilterOptions );
371
- array_push( $this->excludedNodes, $html->Implode( $id, $tagFilterOptions ) );
372
  }
373
-
374
  //$eligibleContent = $html->Implode( 0, $tagFilterOptions );
375
 
376
  /**
@@ -1038,6 +1038,10 @@ class ezTOC_Post {
1038
  foreach ( $matches as $i => $match ) {
1039
 
1040
  $anchor = $matches[ $i ]['id'];
 
 
 
 
1041
  $headings[] = str_replace(
1042
  array(
1043
  $matches[ $i ][1], // start of heading
@@ -1172,6 +1176,11 @@ class ezTOC_Post {
1172
 
1173
  $custom_classes = ezTOC_Option::get( 'css_container_class', '' );
1174
 
 
 
 
 
 
1175
  if ( 0 < strlen( $custom_classes ) ) {
1176
 
1177
  $custom_classes = explode( ' ', $custom_classes );
@@ -1215,13 +1224,13 @@ class ezTOC_Post {
1215
 
1216
  if ( ezTOC_Option::get( 'visibility' ) ) {
1217
  if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1218
- $html .= '<a 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' ).'"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></label><input type="checkbox" id="item"></a>';
1219
  }else{
1220
  $toggle_view='';
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
 
@@ -1398,7 +1407,10 @@ class ezTOC_Post {
1398
  * @return string
1399
  */
1400
  private function createTOCItemAnchor( $page, $id, $title, $count ) {
1401
-
 
 
 
1402
  return sprintf(
1403
  '<a class="ez-toc-link ez-toc-heading-' . $count . '" href="%1$s" title="%2$s">%3$s</a>',
1404
  esc_attr( $this->createTOCItemURL( $id, $page ) ),
364
  $selectors = apply_filters( 'ez_toc_exclude_by_selector', array( '.ez-toc-exclude-headings' ), $content );
365
 
366
  $nodes = $html->Find( implode( ',', $selectors ) );
367
+ if(isset($nodes['ids'])){
368
+ foreach ( $nodes['ids'] as $id ) {
369
 
370
+ //$this->excludedNodes[ $page ][ $id ] = $html->Implode( $id, $tagFilterOptions );
371
+ array_push( $this->excludedNodes, $html->Implode( $id, $tagFilterOptions ) );
372
+ }
 
373
  }
 
374
  //$eligibleContent = $html->Implode( 0, $tagFilterOptions );
375
 
376
  /**
1038
  foreach ( $matches as $i => $match ) {
1039
 
1040
  $anchor = $matches[ $i ]['id'];
1041
+ if (ezTOC_Option::get( 'remove_special_chars_from_title' )) {
1042
+ $matches[ $i ][0] = str_replace(':', '', $matches[ $i ][0]);
1043
+ }
1044
+
1045
  $headings[] = str_replace(
1046
  array(
1047
  $matches[ $i ][1], // start of heading
1176
 
1177
  $custom_classes = ezTOC_Option::get( 'css_container_class', '' );
1178
 
1179
+ $position = ezTOC_Option::get( 'position' );
1180
+ if($position == 'afterpara'){
1181
+ $custom_classes .= "afterpara";
1182
+ }
1183
+
1184
  if ( 0 < strlen( $custom_classes ) ) {
1185
 
1186
  $custom_classes = explode( ' ', $custom_classes );
1224
 
1225
  if ( ezTOC_Option::get( 'visibility' ) ) {
1226
  if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1227
+ $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' ).'"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></label><input type="checkbox" id="item"></a>';
1228
  }else{
1229
  $toggle_view='';
1230
  if(ezTOC_Option::get('visibility_hide_by_default')==true){
1231
  $toggle_view= "checked";
1232
  }
1233
+ $html .= '<label for="item" class="cssicon"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></label><label for="item" class="cssiconcheckbox">1</label><input type="checkbox" id="item" '.$toggle_view.'>';
1234
  }
1235
  }
1236
 
1407
  * @return string
1408
  */
1409
  private function createTOCItemAnchor( $page, $id, $title, $count ) {
1410
+ if (ezTOC_Option::get( 'remove_special_chars_from_title' )) {
1411
+ $title = str_replace(':', '', $title);
1412
+ }
1413
+
1414
  return sprintf(
1415
  '<a class="ez-toc-link ez-toc-heading-' . $count . '" href="%1$s" title="%2$s">%3$s</a>',
1416
  esc_attr( $this->createTOCItemURL( $id, $page ) ),
includes/deactivate-feedback.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $reasons = array(
3
+ 1 => '<li><label><input type="radio" name="eztoc_disable_reason" value="temporary"/>' . __('It is only temporary', 'easy-table-of-contents') . '</label></li>',
4
+ 2 => '<li><label><input type="radio" name="eztoc_disable_reason" value="stopped showing toc"/>' . __('I stopped showing TOC on my site', 'easy-table-of-contents') . '</label></li>',
5
+ 3 => '<li><label><input type="radio" name="eztoc_disable_reason" value="missing feature"/>' . __('I miss a feature', 'easy-table-of-contents') . '</label></li>
6
+ <li><input type="text" name="eztoc_disable_text[]" value="" placeholder="Please describe the feature"/></li>',
7
+ 4 => '<li><label><input type="radio" name="eztoc_disable_reason" value="technical issue"/>' . __('Technical Issue', 'easy-table-of-contents') . '</label></li>
8
+ <li><textarea name="eztoc_disable_text[]" placeholder="' . __('Can we help? Please describe your problem', 'easy-table-of-contents') . '"></textarea></li>',
9
+ 5 => '<li><label><input type="radio" name="eztoc_disable_reason" value="other plugin"/>' . __('I switched to another plugin', 'easy-table-of-contents') . '</label></li>
10
+ <li><input type="text" name="eztoc_disable_text[]" value="" placeholder="Name of the plugin"/></li>',
11
+ 6 => '<li><label><input type="radio" name="eztoc_disable_reason" value="other"/>' . __('Other reason', 'easy-table-of-contents') . '</label></li>
12
+ <li><textarea name="eztoc_disable_text[]" placeholder="' . __('Please specify, if possible', 'easy-table-of-contents') . '"></textarea></li>',
13
+ );
14
+ shuffle($reasons);
15
+ ?>
16
+
17
+
18
+ <div id="eztoc-reloaded-feedback-overlay" style="display: none;">
19
+ <div id="eztoc-reloaded-feedback-content">
20
+ <form action="" method="post">
21
+ <h3><strong><?php _e('If you have a moment, please let us know why you are deactivating:', 'easy-table-of-contents'); ?></strong></h3>
22
+ <ul>
23
+ <?php
24
+ foreach ($reasons as $reason){
25
+ echo $reason;
26
+ }
27
+ ?>
28
+ </ul>
29
+ <?php if ($email) : ?>
30
+ <input type="hidden" name="eztoc_disable_from" value="<?php echo $email; ?>"/>
31
+ <?php endif; ?>
32
+ <input id="eztoc-reloaded-feedback-submit" class="button button-primary" type="submit" name="eztoc_disable_submit" value="<?php _e('Submit & Deactivate', 'easy-table-of-contents'); ?>"/>
33
+ <a class="button"><?php _e('Only Deactivate', 'easy-table-of-contents'); ?></a>
34
+ <a class="eztoc-feedback-not-deactivate" href="#"><?php _e('Don\'t deactivate', 'easy-table-of-contents'); ?></a>
35
+ </form>
36
+ </div>
37
+ </div>
includes/feedback.css ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* makebetter admin css*/
2
+
3
+ /**
4
+ PLUGINS ADMIN PAGE
5
+ */
6
+ #eztoc-reloaded-feedback-overlay {
7
+ /* Height & width depends on how you want to reveal the overlay (see JS below) */
8
+ height: 100%;
9
+ width: 100%;
10
+ position: fixed; /* Stay in place */
11
+ z-index: 10000; /* Sit on top */
12
+ left: 0;
13
+ top: 0;
14
+ background-color: rgb(120,120,120); /* Black fallback color */
15
+ background-color: rgba(0,0,0, 0.5); /* Black w/opacity */
16
+ }
17
+ #eztoc-reloaded-feedback-content {
18
+ position: relative;
19
+ top: 25%; /* 25% from the top */
20
+ width: 500px;
21
+ max-width: 100%;
22
+ margin: auto;
23
+ margin-top: 30px; /* 30px top margin to avoid conflict with the close button on smaller screens */
24
+ max-height: 50%;
25
+ padding: 20px;
26
+ background-color: #fff;
27
+ overflow-y: auto;
28
+ }
29
+ #eztoc-reloaded-feedback-content textarea,
30
+ #eztoc-reloaded-feedback-content input[type="text"] { display:none;width:100%; }
31
+ .eztoc-feedback-not-deactivate { display: block; text-align: right; }
32
+
33
+ #eztoc-reloaded-feedback-content h3{
34
+ margin:5px;
35
+ }
36
+
37
+ @media screen and (max-width:400px){
38
+ #eztoc-reloaded-feedback-content {
39
+ padding:0px;
40
+ padding-bottom:50px;
41
+ }
42
+ }
includes/feedback.js ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var strict;
2
+
3
+ jQuery(document).ready(function ($) {
4
+ /**
5
+ * DEACTIVATION FEEDBACK FORM
6
+ */
7
+ // show overlay when clicked on "deactivate"
8
+ eztoc_deactivate_link = $('.wp-admin.plugins-php tr[data-slug="easy-table-of-contents"] .row-actions .deactivate a');
9
+ eztoc_deactivate_link_url = eztoc_deactivate_link.attr('href');
10
+
11
+ eztoc_deactivate_link.click(function (e) {
12
+ e.preventDefault();
13
+
14
+ // only show feedback form once per 30 days
15
+ var c_value = eztoc_admin_get_cookie("eztoc_hide_deactivate_feedback");
16
+
17
+ if (c_value === undefined) {
18
+ $('#eztoc-reloaded-feedback-overlay').show();
19
+ } else {
20
+ // click on the link
21
+ window.location.href = eztoc_deactivate_link_url;
22
+ }
23
+ });
24
+ // show text fields
25
+ $('#eztoc-reloaded-feedback-content input[type="radio"]').click(function () {
26
+ // show text field if there is one
27
+ $(this).parents('li').next('li').children('input[type="text"], textarea').show();
28
+ });
29
+ // send form or close it
30
+ $('#eztoc-reloaded-feedback-content .button').click(function (e) {
31
+ e.preventDefault();
32
+ // set cookie for 30 days
33
+ var exdate = new Date();
34
+ exdate.setSeconds(exdate.getSeconds() + 2592000);
35
+ document.cookie = "eztoc_hide_deactivate_feedback=1; expires=" + exdate.toUTCString() + "; path=/";
36
+
37
+ $('#eztoc-reloaded-feedback-overlay').hide();
38
+ if ('eztoc-reloaded-feedback-submit' === this.id) {
39
+ // Send form data
40
+ $.ajax({
41
+ type: 'POST',
42
+ url: ajaxurl,
43
+ dataType: 'json',
44
+ data: {
45
+ action: 'eztoc_send_feedback',
46
+ data: $('#eztoc-reloaded-feedback-content form').serialize()
47
+ },
48
+ complete: function (MLHttpRequest, textStatus, errorThrown) {
49
+ // deactivate the plugin and close the popup
50
+ $('#eztoc-reloaded-feedback-overlay').remove();
51
+ window.location.href = eztoc_deactivate_link_url;
52
+
53
+ }
54
+ });
55
+ } else {
56
+ $('#eztoc-reloaded-feedback-overlay').remove();
57
+ window.location.href = eztoc_deactivate_link_url;
58
+ }
59
+ });
60
+ // close form without doing anything
61
+ $('.eztoc-feedback-not-deactivate').click(function (e) {
62
+ $('#eztoc-reloaded-feedback-overlay').hide();
63
+ });
64
+
65
+ function eztoc_admin_get_cookie (name) {
66
+ var i, x, y, eztoc_cookies = document.cookie.split( ";" );
67
+ for (i = 0; i < eztoc_cookies.length; i++)
68
+ {
69
+ x = eztoc_cookies[i].substr( 0, eztoc_cookies[i].indexOf( "=" ) );
70
+ y = eztoc_cookies[i].substr( eztoc_cookies[i].indexOf( "=" ) + 1 );
71
+ x = x.replace( /^\s+|\s+$/g, "" );
72
+ if (x === name)
73
+ {
74
+ return unescape( y );
75
+ }
76
+ }
77
+ }
78
+
79
+ }); // document ready
includes/helper-function.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Helper Functions
5
+ *
6
+ * @package saswp
7
+ * @subpackage Helper/Templates
8
+ * @copyright Copyright (c) 2016, René Hermenau
9
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10
+ * @since 1.4.0
11
+ */
12
+ // Exit if accessed directly
13
+ if( !defined( 'ABSPATH' ) )
14
+ exit;
15
+
16
+ /**
17
+ * Helper method to check if user is in the plugins page.
18
+ *
19
+ * @author René Hermenau
20
+ * @since 1.4.0
21
+ *
22
+ * @return bool
23
+ */
24
+
25
+ /**
26
+ * display deactivation logic on plugins page
27
+ *
28
+ * @since 1.4.0
29
+ */
30
+
31
+ add_filter('admin_footer', 'eztoc_add_deactivation_feedback_modal');
32
+ function eztoc_add_deactivation_feedback_modal() {
33
+
34
+ if( !is_admin()) {
35
+ return;
36
+ }
37
+
38
+ $current_user = wp_get_current_user();
39
+ if( !($current_user instanceof WP_User) ) {
40
+ $email = '';
41
+ } else {
42
+ $email = trim( $current_user->user_email );
43
+ }
44
+ require_once EZ_TOC_PATH ."/includes/deactivate-feedback.php";
45
+ }
46
+
47
+ /**
48
+ * send feedback via email
49
+ *
50
+ * @since 1.4.0
51
+ */
52
+ function eztoc_send_feedback() {
53
+
54
+ if( isset( $_POST['data'] ) ) {
55
+ parse_str( $_POST['data'], $form );
56
+ }
57
+
58
+ $text = '';
59
+ if( isset( $form['eztoc_disable_text'] ) ) {
60
+ $text = implode( "\n\r", $form['eztoc_disable_text'] );
61
+ }
62
+
63
+ $headers = array();
64
+
65
+ $from = isset( $form['eztoc_disable_from'] ) ? $form['eztoc_disable_from'] : '';
66
+ if( $from ) {
67
+ $headers[] = "From: $from";
68
+ $headers[] = "Reply-To: $from";
69
+ }
70
+
71
+ $subject = isset( $form['eztoc_disable_reason'] ) ? $form['eztoc_disable_reason'] : '(no reason given)';
72
+
73
+ if($subject == 'technical issue'){
74
+
75
+ $text = trim($text);
76
+
77
+ if(!empty($text)){
78
+
79
+ $text = 'technical issue description: '.$text;
80
+
81
+ }else{
82
+
83
+ $text = 'no description: '.$text;
84
+ }
85
+
86
+ }
87
+
88
+ $success = wp_mail( 'team@magazine3.in', $subject, $text, $headers );
89
+
90
+ die();
91
+ }
92
+ add_action( 'wp_ajax_eztoc_send_feedback', 'eztoc_send_feedback' );
93
+
94
+ function cwv_enqueue_makebetter_email_js(){
95
+
96
+ if( !is_admin() ) {
97
+ return;
98
+ }
99
+
100
+ wp_enqueue_script( 'cwv-make-better-js', EZ_TOC_URL . 'includes/feedback.js', array( 'jquery' ));
101
+
102
+ wp_enqueue_style( 'cwv-make-better-css', EZ_TOC_URL . 'includes/feedback.css', false );
103
+ }
104
+ add_action( 'admin_enqueue_scripts', 'cwv_enqueue_makebetter_email_js' );
105
+
106
+
107
+ add_action('wp_ajax_eztoc_subscribe_newsletter','eztoc_subscribe_for_newsletter');
108
+ add_action('wp_ajax_nopriv_eztoc_subscribe_newsletter','eztoc_subscribe_for_newsletter');
109
+ function eztoc_subscribe_for_newsletter(){
110
+ $api_url = 'http://magazine3.company/wp-json/api/central/email/subscribe';
111
+ $api_params = array(
112
+ 'name' => sanitize_text_field($_POST['name']),
113
+ 'email'=> sanitize_text_field($_POST['email']),
114
+ 'website'=> sanitize_text_field($_POST['website']),
115
+ 'type'=> 'eztoc'
116
+ );
117
+ $response = wp_remote_post( $api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
118
+ $response = wp_remote_retrieve_body( $response );
119
+ echo $response;
120
+ die;
121
+ }
includes/inc.string-functions.php CHANGED
@@ -308,6 +308,12 @@ function mb_find_replace( &$find = false, &$replace = false, &$string = '' ) {
308
  get_option( 'blog_charset' )
309
  );
310
 
 
 
 
 
 
 
311
  $needle = str_replace(array('’','“','”'), array('\'','"','"'), $needle);
312
 
313
  $start = mb_strpos( $string, $needle );
308
  get_option( 'blog_charset' )
309
  );
310
 
311
+ $string = html_entity_decode(
312
+ $string,
313
+ ENT_QUOTES,
314
+ get_option( 'blog_charset' )
315
+ );
316
+
317
  $needle = str_replace(array('’','“','”'), array('\'','"','"'), $needle);
318
 
319
  $start = mb_strpos( $string, $needle );
includes/newsletter.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Exit if accessed directly
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ class eztoc_pointers {
8
+ const DISPLAY_VERSION = 'v1.0';
9
+ function __construct () {
10
+ add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
11
+ }
12
+ function admin_enqueue_scripts () {
13
+ $dismissed = explode (',', get_user_meta (wp_get_current_user ()->ID, 'dismissed_wp_pointers', true));
14
+ $do_tour = !in_array ('eztoc_subscribe_pointer', $dismissed);
15
+ if ($do_tour) {
16
+ wp_enqueue_style ('wp-pointer');
17
+ wp_enqueue_script ('wp-pointer');
18
+
19
+ add_action('admin_print_footer_scripts', array($this, 'admin_print_footer_scripts'));
20
+ add_action('admin_head', array($this, 'admin_head')); // Hook to admin head
21
+ }
22
+ }
23
+ function admin_head () {
24
+ ?>
25
+ <style type="text/css" media="screen"> #pointer-primary { margin: 0 5px 0 0; } </style>
26
+ <?php }
27
+ function admin_print_footer_scripts () {
28
+ global $pagenow;
29
+ global $current_user;
30
+ $tour = array ();
31
+ $tab = isset($_GET['tab']) ? sanitize_text_field( wp_unslash($_GET['tab'])) : '';
32
+ $function = '';
33
+ $button2 = '';
34
+ $options = array ();
35
+ $show_pointer = false;
36
+
37
+ if (!array_key_exists($tab, $tour)) {
38
+
39
+ $show_pointer = true;
40
+ $file_error = true;
41
+
42
+ $id = '.settings_page_table-of-contents'; // Define ID used on page html element where we want to display pointer
43
+
44
+ $content = '<h3>' . sprintf (esc_html__('Thank You for using Easy TOC!', 'easy-table-of-contents'), self::DISPLAY_VERSION) . '</h3>';
45
+ $content .= '<p>' . esc_html__('Do you want the latest update on', 'easy-table-of-contents') . '<b>' . esc_html__(' Easy TOC ', 'easy-table-of-contents') . '</b>' . esc_html__('before others and some best resources on Easy TOC in a single email? - Free just for users of Easy TOC!', 'easy-table-of-contents').'</p>';
46
+ $content .= '
47
+
48
+ <style type="text/css">
49
+ .wp-pointer-buttons{ padding:0; overflow: hidden; }
50
+ .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} #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
51
+ </style>
52
+ <div id="mc_embed_signup">
53
+ <form method="POST" id="subscribe-newsletter-form">
54
+ <div id="mc_embed_signup_scroll">
55
+ <div class="mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">
56
+ <input type="text" name="name" class="form-control" placeholder="Name" hidden value="' . esc_attr( $current_user->display_name ) . '" style="display:none">
57
+
58
+ <input type="text" value="' . esc_attr( $current_user->user_email ) . '" name="email" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">
59
+
60
+ <input type="text" name="company" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="' . esc_url( get_home_url() ) . '">
61
+
62
+ <input type="hidden" name="ml-submit" value="1" />
63
+ </div>
64
+ <div id="mce-responses">
65
+ <div class="response" id="mce-error-response" style="display:none"></div>
66
+ <div class="response" id="mce-success-response" style="display:none"></div>
67
+ </div>
68
+ <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
69
+ <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>
70
+ <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;">
71
+ </div>
72
+ </form>
73
+ </div>';
74
+ $options = array (
75
+ 'content' => $content,
76
+ 'position' => array ('edge' => 'left', 'align' => 'left')
77
+ );
78
+ }
79
+ if ($show_pointer) {
80
+ //var_dump($id);die;
81
+ $this->eztoc_pointer_script ($id, $options, esc_html__('No Thanks', 'easy-table-of-contents'), $button2, $function);
82
+ }
83
+ }
84
+ function get_admin_url($page, $tab) {
85
+ $url = admin_url();
86
+ $url .= $page.'?tab='.$tab;
87
+ return $url;
88
+ }
89
+ function eztoc_pointer_script ($id, $options, $button1, $button2=false, $function='') {
90
+ ?>
91
+ <script type="text/javascript">
92
+ (function ($) {
93
+ var wp_pointers_tour_opts = <?php echo json_encode ($options); ?>, setup;
94
+ wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, {
95
+ buttons: function (event, t) {
96
+ button= jQuery ('<a id="pointer-close" class="button-secondary">' + '<?php echo wp_kses_post($button1); ?>' + '</a>');
97
+ button_2= jQuery ('#pointer-close.button');
98
+ button.bind ('click.pointer', function () {
99
+ t.element.pointer ('close');
100
+ });
101
+ button_2.on('click', function() {
102
+ t.element.pointer ('close');
103
+ } );
104
+ return button;
105
+ },
106
+ close: function () {
107
+ $.post (ajaxurl, {
108
+ pointer: 'eztoc_subscribe_pointer',
109
+ action: 'dismiss-wp-pointer'
110
+ });
111
+ }
112
+ });
113
+ setup = function () {
114
+ $('<?php echo esc_attr($id); ?>').pointer(wp_pointers_tour_opts).pointer('open');
115
+ <?php if ($button2) { ?>
116
+ jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + '<?php echo wp_kses_post($button2); ?>' + '</a>');
117
+ jQuery ('#pointer-primary').click (function () {
118
+ <?php echo $function; ?>
119
+ });
120
+ jQuery ('#pointer-close').click (function () {
121
+ $.post (ajaxurl, {
122
+ pointer: 'eztoc_subscribe_pointer',
123
+ action: 'dismiss-wp-pointer'
124
+ });
125
+ })
126
+ <?php } ?>
127
+ };
128
+ if (wp_pointers_tour_opts.position && wp_pointers_tour_opts.position.defer_loading) {
129
+ $(window).bind('load.wp-pointers', setup);
130
+ }
131
+ else {
132
+ setup ();
133
+ }
134
+ }) (jQuery);
135
+ </script>
136
+ <?php
137
+ }
138
+ }
139
+ $eztoc_pointers = new eztoc_pointers();
140
+ ?>