Version Description
07/12/2022 = * TWEAK: Added subscribe to newsletters form on plugin activation #216 * TWEAK: Added user feedback form on plugin deactivation #216 * TWEAK: Added option to remove special characters from TOC Headings #217 * BUG: Corner Stone page builder heading are not working #200 * BUG: The links are not working using href with pure CSS option #208 * BUG: Attribute href is missing in an anchor element due to which links cannot be crawled #210 * BUG: Debug Warnings #212
Download this release
Release Info
Developer | magazine3 |
Plugin | Easy Table of Contents |
Version | 2.0.27 |
Comparing to | |
See all releases |
Code changes from version 2.0.25.1 to 2.0.27
- README.txt +18 -3
- assets/css/admin.css +8 -0
- assets/css/admin.min.css +8 -1
- assets/css/screen.css +6 -0
- assets/css/screen.min.css +5 -1
- assets/js/admin.js +21 -0
- assets/js/admin.min.js +1 -1
- assets/js/eztoc-admin.js +11 -0
- assets/js/front.min.js +1 -1
- easy-table-of-contents.php +5 -3
- includes/class.options.php +8 -0
- includes/class.post.php +15 -8
- includes/deactivate-feedback.php +37 -0
- includes/feedback.css +42 -0
- includes/feedback.js +79 -0
- includes/helper-function.php +121 -0
- includes/newsletter.php +140 -0
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.
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -97,8 +97,23 @@ Easy Table Contents is a fork of the excellent [Table of Contents Plus](https://
|
|
97 |
|
98 |
== Changelog ==
|
99 |
|
100 |
-
= 2.0.
|
101 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.27
|
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.27 07/12/2022 =
|
101 |
+
* TWEAK: Added subscribe to newsletters form on plugin activation #216
|
102 |
+
* TWEAK: Added user feedback form on plugin deactivation #216
|
103 |
+
* TWEAK: Added option to remove special characters from TOC Headings #217
|
104 |
+
* BUG: Corner Stone page builder heading are not working #200
|
105 |
+
* BUG: The links are not working using href with pure CSS option #208
|
106 |
+
* BUG: Attribute href is missing in an anchor element due to which links cannot be crawled #210
|
107 |
+
* BUG: Debug Warnings #212
|
108 |
+
|
109 |
+
= 2.0.26 07/05/2022 =
|
110 |
+
* BUG: TOC loading method should be same for CSS and JS #199
|
111 |
+
* BUG: Custom width option should come after selecting the User Define option #201
|
112 |
+
* BUG: Function added to front.js but not present in front.min.js #202
|
113 |
+
* BUG: The custom heading is not working with WP Bakery page builder #205
|
114 |
+
* BUG: TOC not working in the Avada themes in widgets #206
|
115 |
+
* BUG: Headers in content of shortcodes are not getting showing up in TOC #209
|
116 |
+
* BUG: TOC broken for non-English titles #211
|
117 |
|
118 |
= 2.0.25 06/27/2022 =
|
119 |
* TWEAK: Added Migration from Table of Contents Plus and LuckyWP Table of Contents #160
|
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 {
|
@@ -388,4 +389,9 @@ div#ez-toc-container p.ez-toc-title {
|
|
388 |
}
|
389 |
div#ez-toc-container {
|
390 |
padding-right: 20px;
|
|
|
|
|
|
|
|
|
|
|
391 |
}
|
370 |
opacity: 0;
|
371 |
max-height: 0;
|
372 |
border: none;
|
373 |
+
display: none;
|
374 |
}
|
375 |
|
376 |
#ez-toc-container label {
|
389 |
}
|
390 |
div#ez-toc-container {
|
391 |
padding-right: 20px;
|
392 |
+
}
|
393 |
+
|
394 |
+
label.cssicon .ez-toc-glyphicon:empty {
|
395 |
+
font-size: 16px;
|
396 |
+
margin-left: 2px;
|
397 |
}
|
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,
|
@@ -21,3 +21,7 @@
|
|
21 |
}
|
22 |
.ez-toc-toggle #item{position: absolute;left: -999em;}
|
23 |
|
|
|
|
|
|
|
|
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,
|
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,25 @@ 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 |
+
$("#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(
|
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 |
});
|
assets/js/front.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(
|
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.
|
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.
|
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.
|
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' );
|
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.27
|
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.27
|
30 |
*/
|
31 |
|
32 |
use Easy_Plugins\Table_Of_Contents\Debug;
|
48 |
* @since 1.0
|
49 |
* @var string
|
50 |
*/
|
51 |
+
const VERSION = '2.0.27';
|
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' );
|
includes/class.options.php
CHANGED
@@ -280,6 +280,13 @@ if ( ! class_exists( 'ezTOC_Option' ) ) {
|
|
280 |
),
|
281 |
'default' => 'js',
|
282 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
)
|
284 |
),
|
285 |
'appearance' => apply_filters(
|
@@ -636,6 +643,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,
|
280 |
),
|
281 |
'default' => 'js',
|
282 |
),
|
283 |
+
'remove_special_chars_from_title' => array(
|
284 |
+
'id' => 'remove_special_chars_from_title',
|
285 |
+
'name' => __( 'Remove \':\' from TOC Title', 'easy-table-of-contents' ),
|
286 |
+
'desc' => '',
|
287 |
+
'type' => 'checkbox',
|
288 |
+
'default' => false,
|
289 |
+
),
|
290 |
)
|
291 |
),
|
292 |
'appearance' => apply_filters(
|
643 |
'mobile_smooth_scroll_offset' => 0,
|
644 |
'visibility' => true,
|
645 |
'toc_loading' => 'js',
|
646 |
+
'remove_special_chars_from_title' => false,
|
647 |
//'visibility_show' => 'show',
|
648 |
//'visibility_hide' => 'hide',
|
649 |
'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 |
-
|
369 |
-
|
370 |
-
|
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
|
@@ -1215,13 +1219,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"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></label><input type="checkbox" id="item" '.$toggle_view.'>';
|
1225 |
}
|
1226 |
}
|
1227 |
|
@@ -1398,7 +1402,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
|
1219 |
|
1220 |
if ( ezTOC_Option::get( 'visibility' ) ) {
|
1221 |
if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
|
1222 |
+
$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>';
|
1223 |
}else{
|
1224 |
$toggle_view='';
|
1225 |
if(ezTOC_Option::get('visibility_hide_by_default')==true){
|
1226 |
$toggle_view= "checked";
|
1227 |
}
|
1228 |
+
$html .= '<label for="item" class="cssicon"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></label><input type="checkbox" id="item" '.$toggle_view.'>';
|
1229 |
}
|
1230 |
}
|
1231 |
|
1402 |
* @return string
|
1403 |
*/
|
1404 |
private function createTOCItemAnchor( $page, $id, $title, $count ) {
|
1405 |
+
if (ezTOC_Option::get( 'remove_special_chars_from_title' )) {
|
1406 |
+
$title = str_replace(':', '', $title);
|
1407 |
+
}
|
1408 |
+
|
1409 |
return sprintf(
|
1410 |
'<a class="ez-toc-link ez-toc-heading-' . $count . '" href="%1$s" title="%2$s">%3$s</a>',
|
1411 |
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/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 |
+
?>
|