first
1022
wp-content/plugins/easy-table-of-contents/README.txt
Normal file
After Width: | Height: | Size: 8.2 KiB |
After Width: | Height: | Size: 10 KiB |
1456
wp-content/plugins/easy-table-of-contents/assets/css/admin.css
Normal file
1
wp-content/plugins/easy-table-of-contents/assets/css/admin.min.css
vendored
Normal file
@ -0,0 +1,338 @@
|
||||
#ez-toc-sticky-container {
|
||||
background: transparent;
|
||||
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-sticky-widget-container {
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container.ez-toc-sticky-light-blue {
|
||||
background: #EDF6FF;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container.ez-toc-sticky-white {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container.ez-toc-sticky-black {
|
||||
background: #000000;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container.ez-toc-sticky-transparent {
|
||||
background: none transparent;
|
||||
}
|
||||
|
||||
div.ez-toc-sticky-widget-container ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
div.ez-toc-sticky-widget-container li {
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.ez-toc-sticky-widget-container ul.ez-toc-sticky-list {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container ul ul,
|
||||
.ez-toc div.ez-toc-sticky-widget-container ul ul {
|
||||
margin-left: 1.5em;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container ul,
|
||||
#ez-toc-sticky-container li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container ul,
|
||||
#ez-toc-sticky-container li,
|
||||
#ez-toc-sticky-container ul li,
|
||||
div.ez-toc-sticky-widget-container,
|
||||
div.ez-toc-sticky-widget-container li {
|
||||
background: none;
|
||||
list-style: none none;
|
||||
line-height: 1.6;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container p.ez-toc-sticky-title {
|
||||
text-align: left;
|
||||
line-height: 1.45;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ez-toc-sticky-title-container {
|
||||
display: table;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ez-toc-sticky-title,
|
||||
.ez-toc-sticky-title-toggle {
|
||||
display: table-cell;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container.ez-toc-sticky-black p.ez-toc-sticky-title {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container div.ez-toc-sticky-title-container + ul.ez-toc-sticky-list {
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.ez-toc-sticky-wrap-left {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.ez-toc-sticky-wrap-right {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.ez-toc-sticky-wrap-center {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container a {
|
||||
color: #444444;
|
||||
box-shadow: none;
|
||||
text-decoration: none;
|
||||
text-shadow: none;
|
||||
display: inline-flex;
|
||||
align-items: stretch;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container a:visited {
|
||||
color: #9f9f9f;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container.ez-toc-sticky-black a {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container.ez-toc-sticky-black a:visited {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container a.ez-toc-sticky-toggle {
|
||||
color: #444444;
|
||||
}
|
||||
|
||||
.ez-toc-sticky-widget-container ul.ez-toc-sticky-list li::before {
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.ez-toc-sticky-widget-container ul.ez-toc-sticky-list li.active {
|
||||
background-color: #EDEDED;
|
||||
}
|
||||
|
||||
.ez-toc-sticky-widget-container li.active > a {
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.ez-toc-sticky-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-sticky-btn:focus {
|
||||
outline: thin dotted #333;
|
||||
outline: 5px auto -webkit-focus-ring-color;
|
||||
outline-offset: -2px
|
||||
}
|
||||
|
||||
.ez-toc-sticky-btn:hover, .ez-toc-sticky-btn:focus {
|
||||
color: #333;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
.ez-toc-sticky-btn:active, .ez-toc-sticky-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-sticky-btn-default {
|
||||
color: #333;
|
||||
background-color: #fff;
|
||||
border-color: #ccc
|
||||
}
|
||||
|
||||
.ez-toc-sticky-btn-default:hover, .ez-toc-sticky-btn-default:focus, .ez-toc-sticky-btn-default:active, .ez-toc-sticky-btn-default.active {
|
||||
color: #333;
|
||||
background-color: #ebebeb;
|
||||
border-color: #adadad
|
||||
}
|
||||
|
||||
.ez-toc-sticky-btn-default:active, .ez-toc-sticky-btn-default.active {
|
||||
background-image: none
|
||||
}
|
||||
|
||||
.ez-toc-sticky-btn-sm, .ez-toc-sticky-btn-xs {
|
||||
padding: 5px 10px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
border-radius: 3px
|
||||
}
|
||||
|
||||
.ez-toc-sticky-btn-xs {
|
||||
padding: 1px 5px
|
||||
}
|
||||
|
||||
.ez-toc-sticky-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-sticky-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-sticky-btn:active, .btn.active {
|
||||
background-image: none
|
||||
}
|
||||
|
||||
.ez-toc-sticky-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-sticky-btn-default:hover, .ez-toc-sticky-btn-default:focus {
|
||||
background-color: #e0e0e0;
|
||||
background-position: 0 -15px
|
||||
}
|
||||
|
||||
.ez-toc-sticky-btn-default:active, .ez-toc-sticky-btn-default.active {
|
||||
background-color: #e0e0e0;
|
||||
border-color: #dbdbdb
|
||||
}
|
||||
|
||||
.ez-toc-sticky-pull-right {
|
||||
float: right !important;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.ez-toc-sticky-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-sticky-glyphicon:empty {
|
||||
width: 1em
|
||||
}
|
||||
|
||||
.ez-toc-sticky-toggle i.ez-toc-sticky-glyphicon {
|
||||
font-size: 16px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container input {
|
||||
position: absolute;
|
||||
left: -999em;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container input[type="checkbox"]:checked + nav {
|
||||
opacity: 0;
|
||||
max-height: 0;
|
||||
border: none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#ez-toc-sticky-container label {
|
||||
float: right;
|
||||
position: relative;
|
||||
left: 10px;
|
||||
font-size: 16px;
|
||||
background: #f9efef;
|
||||
padding: 0px 4px 0px 5px;
|
||||
border: 1px solid #999191;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
div#ez-toc-sticky-container p.ez-toc-sticky-title {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
div#ez-toc-sticky-container {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
label.cssicon .ez-toc-sticky-glyphicon:empty {
|
||||
font-size: 16px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
label.cssiconcheckbox {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ez-toc-sticky-widget-container ul li a {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.ez-toc-sticky-widget-container ul.ez-toc-sticky-list li.active {
|
||||
height: auto !important;
|
||||
}
|
1
wp-content/plugins/easy-table-of-contents/assets/css/ez-toc-sticky.min.css
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
/**
|
||||
* ------EZ TOC Widget CSS Admin-------
|
||||
* Ez Toc Widget Sticky css for admin panel to setup widget content
|
||||
* @plugin easy-table-of-contents
|
||||
* @since 2.0.41
|
||||
*
|
||||
*/
|
||||
|
||||
#ez-toc-widget-options-container{
|
||||
display: none;
|
||||
}
|
||||
.ez-toc-widget-appearance-title, .ez-toc-widget-advanced-title {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.ez-toc-widget-appearance-title label, .ez-toc-widget-advanced-title label {
|
||||
vertical-align: top;
|
||||
}
|
||||
input.ez_toc_widget_appearance_options:checked ~ #ez-toc-widget-options-container, input.ez_toc_widget_advanced_options:checked ~ #ez-toc-widget-options-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
text-align: left;
|
||||
justify-content: flex-start;
|
||||
align-items: baseline;
|
||||
}
|
||||
#ez-toc-widget-options-container .ez-toc-widget-form-group {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
flex-wrap: nowrap;
|
||||
flex-basis: 100%;
|
||||
justify-content: flex-start;
|
||||
margin-top: 15px;
|
||||
}
|
||||
.ez-toc-widget-form-group label {
|
||||
flex-basis: 55%;
|
||||
}
|
||||
#ez-toc-widget-options-container .ez-toc-widget-form-data {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.ez-toc-widget-appearance-options-container .ez-toc-widget-form-group {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
#ez-toc-widget-options-container .ez-toc-widget-form-group input[type=text], #ez-toc-widget-options-container .ez-toc-widget-form-group input[type=number] {
|
||||
width: 53px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
#ez-toc-widget-options-container .ez-toc-widget-form-group select {
|
||||
width: 53px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
#ez-toc-widget-options-container .ez-toc-widget-form-group input[type=checkbox] {
|
||||
margin-left: 8px;
|
||||
}
|
1
wp-content/plugins/easy-table-of-contents/assets/css/ez-toc-widget-sticky-admin.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
#ez-toc-widget-options-container{display:none}.ez-toc-widget-advanced-title,.ez-toc-widget-appearance-title{margin-bottom:12px}.ez-toc-widget-advanced-title label,.ez-toc-widget-appearance-title label{vertical-align:top}input.ez_toc_widget_advanced_options:checked~#ez-toc-widget-options-container,input.ez_toc_widget_appearance_options:checked~#ez-toc-widget-options-container{display:flex;flex-wrap:wrap;text-align:left;justify-content:flex-start;align-items:baseline}#ez-toc-widget-options-container .ez-toc-widget-form-group{display:flex;align-items:baseline;flex-wrap:nowrap;flex-basis:100%;justify-content:flex-start;margin-top:15px}.ez-toc-widget-form-group label{flex-basis:55%}#ez-toc-widget-options-container .ez-toc-widget-form-data{display:flex;justify-content:center}.ez-toc-widget-appearance-options-container .ez-toc-widget-form-group{margin-bottom:0}#ez-toc-widget-options-container .ez-toc-widget-form-group input[type=number],#ez-toc-widget-options-container .ez-toc-widget-form-group input[type=text],#ez-toc-widget-options-container .ez-toc-widget-form-group select{width:53px;margin-left:8px}#ez-toc-widget-options-container .ez-toc-widget-form-group input[type=checkbox]{margin-left:8px}
|
@ -0,0 +1,269 @@
|
||||
|
||||
div.ez-toc-widget-sticky-container {
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
div.ez-toc-widget-sticky-container ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
div.ez-toc-widget-sticky-container li {
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.ez-toc-widget-sticky-container ul.ez-toc-widget-sticky-list {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#ez-toc-widget-sticky-container ul ul,
|
||||
.ez-toc div.ez-toc-widget-sticky-container ul ul {
|
||||
margin-left: 1.5em;
|
||||
}
|
||||
|
||||
div.ez-toc-widget-sticky-container,
|
||||
div.ez-toc-widget-sticky-container li {
|
||||
background: none;
|
||||
list-style: none none;
|
||||
line-height: 1.6;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
|
||||
.ez-toc-widget-sticky-container ul.ez-toc-widget-sticky-list li::before {
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-container ul.ez-toc-widget-sticky-list li.active {
|
||||
background-color: #EDEDED;
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-container li.active > a {
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
#ez-toc-widget-sticky-container label.cssicon {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
#ez-toc-widget-sticky-container input[type="checkbox"]:checked + nav {
|
||||
opacity: 0;
|
||||
max-height: 0;
|
||||
border: none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#ez-toc-widget-sticky-container nav ul.eztoc-widget-sticky-visibility-hide-by-default {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#ez-toc-widget-sticky-container label.cssicon {
|
||||
float: right;
|
||||
position: relative;
|
||||
font-size: 16px;
|
||||
padding: 0;
|
||||
border: 1px solid #999191;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
left: 10px;
|
||||
width: 35px;
|
||||
}
|
||||
|
||||
|
||||
.ez-toc-widget-sticky-container ul li a {
|
||||
padding-left: 10px;
|
||||
display: inline-flex;
|
||||
align-items: stretch;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-container ul.ez-toc-widget-sticky-list li.active {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
|
||||
.ez-toc-title,
|
||||
.ez-toc-widget-sticky-title-toggle {
|
||||
display: inline;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-wrap-left {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-wrap-right {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
|
||||
.ez-toc-widget-sticky-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-widget-sticky-btn:focus {
|
||||
outline: thin dotted #333;
|
||||
outline: 5px auto -webkit-focus-ring-color;
|
||||
outline-offset: -2px
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-btn:hover,
|
||||
.ez-toc-widget-sticky-btn:focus {
|
||||
color: #333;
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-btn:active,
|
||||
.ez-toc-widget-sticky-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-widget-sticky-btn-default {
|
||||
color: #333;
|
||||
background-color: #fff;
|
||||
border-color: #ccc
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-btn-default:hover,
|
||||
.ez-toc-widget-sticky-btn-default:focus,
|
||||
.ez-toc-widget-sticky-btn-default:active,
|
||||
.ez-toc-widget-sticky-btn-default.active {
|
||||
color: #333;
|
||||
background-color: #ebebeb;
|
||||
border-color: #adadad
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-btn-default:active,
|
||||
.ez-toc-widget-sticky-btn-default.active {
|
||||
background-image: none
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-btn-sm,
|
||||
.ez-toc-widget-sticky-btn-xs {
|
||||
padding: 5px 10px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
border-radius: 3px
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-btn-xs {
|
||||
padding: 1px 5px
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-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-widget-sticky-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-widget-sticky-btn:active,
|
||||
.btn.active {
|
||||
background-image: none
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-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-widget-sticky-btn-default:hover,
|
||||
.ez-toc-widget-sticky-btn-default:focus {
|
||||
background-color: #e0e0e0;
|
||||
background-position: 0 -15px
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-btn-default:active,
|
||||
.ez-toc-widget-sticky-btn-default.active {
|
||||
background-color: #e0e0e0;
|
||||
border-color: #dbdbdb
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-pull-right {
|
||||
float: right !important;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-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-widget-sticky-glyphicon:empty {
|
||||
width: 1em
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-toggle i.ez-toc-widget-sticky-glyphicon {
|
||||
font-size: 16px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-wrap-center {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.ez-toc-widget-sticky-toggle #item {
|
||||
position: absolute;
|
||||
left: -999em;
|
||||
}
|
||||
|
||||
label.cssicon .ez-toc-widget-sticky-glyphicon:empty {
|
||||
font-size: 16px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
label.cssiconcheckbox {
|
||||
display: none;
|
||||
}
|
1
wp-content/plugins/easy-table-of-contents/assets/css/ez-toc-widget-sticky.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
div.ez-toc-widget-sticky-container{padding:0;position:relative}div.ez-toc-widget-sticky-container ul{display:block}div.ez-toc-widget-sticky-container li{border:none;padding:0}div.ez-toc-widget-sticky-container ul.ez-toc-widget-sticky-list{padding:10px}#ez-toc-widget-sticky-container ul ul,.ez-toc div.ez-toc-widget-sticky-container ul ul{margin-left:1.5em}div.ez-toc-widget-sticky-container,div.ez-toc-widget-sticky-container li{background:0 0;list-style:none;line-height:1.6;margin:0;overflow:hidden;z-index:1}.ez-toc-widget-sticky-container ul.ez-toc-widget-sticky-list li::before{content:' ';position:absolute;left:0;right:0;height:30px;line-height:30px;z-index:-1}.ez-toc-widget-sticky-container ul.ez-toc-widget-sticky-list li.active{background-color:#ededed;height:auto!important}.ez-toc-widget-sticky-container li.active>a{font-weight:900}#ez-toc-widget-sticky-container input[type=checkbox]:checked+nav{opacity:0;max-height:0;border:none;display:none}#ez-toc-widget-sticky-container nav ul.eztoc-widget-sticky-visibility-hide-by-default,label.cssiconcheckbox{display:none}#ez-toc-widget-sticky-container label.cssicon{height:30px;float:right;position:relative;font-size:16px;padding:0;border:1px solid #999191;border-radius:5px;cursor:pointer;left:10px;width:35px}.ez-toc-widget-sticky-container ul li a{padding-left:10px;display:inline-flex;align-items:stretch;flex-wrap:nowrap}.ez-toc-title,.ez-toc-widget-sticky-title-toggle{display:inline;text-align:left;vertical-align:middle}.ez-toc-widget-sticky-wrap-left{float:left;margin-right:10px}.ez-toc-widget-sticky-wrap-right{float:right;margin-left:10px}.ez-toc-widget-sticky-btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;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-widget-sticky-btn:focus{outline:#333 dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.ez-toc-widget-sticky-btn:focus,.ez-toc-widget-sticky-btn:hover{color:#333;text-decoration:none}.ez-toc-widget-sticky-btn.active,.ez-toc-widget-sticky-btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.ez-toc-widget-sticky-btn-default{color:#333;background-color:#fff;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);text-shadow:0 1px 0 #fff;background-image:-webkit-gradient(linear,left 0,left 100%,from(#fff),to(#e0e0e0));background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-moz-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);background-repeat:repeat-x;border-color:#ccc}.ez-toc-widget-sticky-btn-default.active,.ez-toc-widget-sticky-btn-default:active,.ez-toc-widget-sticky-btn-default:focus,.ez-toc-widget-sticky-btn-default:hover{color:#333;background-color:#ebebeb;border-color:#adadad}.ez-toc-widget-sticky-btn-default.active,.ez-toc-widget-sticky-btn-default:active{background-image:none;background-color:#e0e0e0;border-color:#dbdbdb}.ez-toc-widget-sticky-btn-sm,.ez-toc-widget-sticky-btn-xs{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.ez-toc-widget-sticky-btn-xs{padding:1px 5px}.ez-toc-widget-sticky-btn-default:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.active,.ez-toc-widget-sticky-btn:active{background-image:none}.ez-toc-widget-sticky-btn-default:focus,.ez-toc-widget-sticky-btn-default:hover{background-color:#e0e0e0;background-position:0 -15px}.ez-toc-widget-sticky-pull-right{float:right!important;margin-left:10px}.ez-toc-widget-sticky-glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';-webkit-font-smoothing:antialiased;font-style:normal;font-weight:400;line-height:1;-moz-osx-font-smoothing:grayscale}.ez-toc-widget-sticky-glyphicon:empty{width:1em}.ez-toc-widget-sticky-toggle i.ez-toc-widget-sticky-glyphicon,label.cssicon .ez-toc-widget-sticky-glyphicon:empty{font-size:16px;margin-left:2px}.ez-toc-widget-sticky-wrap-center{margin:0 auto}.ez-toc-widget-sticky-toggle #item{position:absolute;left:-999em}
|
411
wp-content/plugins/easy-table-of-contents/assets/css/screen.css
Normal file
@ -0,0 +1,411 @@
|
||||
#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-top: 10px;
|
||||
padding-right: 20px;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 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 .ez-toc-title {
|
||||
text-align: left;
|
||||
line-height: 1.45;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.ez-toc-title-container {
|
||||
display: table;
|
||||
width: 100%;
|
||||
}
|
||||
.ez-toc-title,
|
||||
.ez-toc-title-toggle {
|
||||
display: inline;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#ez-toc-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 {
|
||||
margin: 0px auto 1em 0px !important;
|
||||
}
|
||||
.ez-toc-wrap-left-text {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.ez-toc-wrap-right {
|
||||
margin: 0px 0px 1em auto !important;
|
||||
}
|
||||
.ez-toc-wrap-right-text {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#ez-toc-container a {
|
||||
color: #444444;
|
||||
box-shadow: none;
|
||||
text-decoration: none;
|
||||
text-shadow: none;
|
||||
display: inline-flex;
|
||||
align-items: stretch;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
#ez-toc-container a:visited {
|
||||
color: #9f9f9f;
|
||||
}
|
||||
|
||||
#ez-toc-container a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#ez-toc-container.ez-toc-black a {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
#ez-toc-container.ez-toc-black a:visited {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
|
||||
#ez-toc-container a.ez-toc-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #444444;
|
||||
}
|
||||
|
||||
.ez-toc-widget-container ul.ez-toc-list li::before {
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.ez-toc-widget-container ul.ez-toc-list li.active {
|
||||
background-color: #EDEDED;
|
||||
}
|
||||
|
||||
.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-container label.cssicon, #ez-toc-widget-container label.cssicon {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
#ez-toc-container input {
|
||||
position: absolute;
|
||||
left: -999em;
|
||||
}
|
||||
|
||||
#ez-toc-container input[type="checkbox"]:checked + nav, #ez-toc-widget-container input[type="checkbox"]:checked + nav {
|
||||
opacity: 0;
|
||||
max-height: 0;
|
||||
border: none;
|
||||
display: none;
|
||||
}
|
||||
#ez-toc-container label {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
display: initial;
|
||||
}
|
||||
#ez-toc-container .ez-toc-js-icon-con{
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
display: initial;
|
||||
}
|
||||
|
||||
#ez-toc-container .ez-toc-toggle label {
|
||||
float: right;
|
||||
position: relative;
|
||||
font-size: 16px;
|
||||
padding: 0;
|
||||
border: 1px solid #999191;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
left: 10px;
|
||||
width: 35px;
|
||||
}
|
||||
#ez-toc-container .ez-toc-js-icon-con {
|
||||
float: right;
|
||||
position: relative;
|
||||
font-size: 16px;
|
||||
padding: 0;
|
||||
border: 1px solid #999191;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
left: 10px;
|
||||
width: 35px;
|
||||
}
|
||||
|
||||
div#ez-toc-container .ez-toc-title {
|
||||
display: initial;
|
||||
}
|
||||
.ez-toc-wrap-center {
|
||||
margin: 0 auto 1em auto !important;
|
||||
}
|
||||
|
||||
#ez-toc-container a.ez-toc-toggle {
|
||||
color: #444444;
|
||||
background: inherit;
|
||||
border: inherit;
|
||||
}
|
||||
|
||||
.ez-toc-toggle #item {
|
||||
position: absolute;
|
||||
left: -999em;
|
||||
}
|
||||
|
||||
label.cssicon .ez-toc-glyphicon:empty {
|
||||
font-size: 16px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
label.cssiconcheckbox {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ez-toc-widget-container ul li a {
|
||||
padding-left: 10px;
|
||||
display: inline-flex;
|
||||
align-items: stretch;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.ez-toc-widget-container ul.ez-toc-list li {
|
||||
height: auto !important;
|
||||
}
|
||||
.ez-toc-cssicon{
|
||||
float: right;
|
||||
position: relative;
|
||||
font-size: 16px;
|
||||
padding: 0;
|
||||
border: 1px solid #999191;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
left: 10px;
|
||||
width: 35px;
|
||||
}
|
||||
.ez-toc-icon-toggle-span {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 35px;
|
||||
height: 30px;
|
||||
justify-content: center;
|
||||
direction:ltr;
|
||||
}
|
||||
#ez-toc-container .eztoc-toggle-hide-by-default{
|
||||
display:none;
|
||||
}
|
1
wp-content/plugins/easy-table-of-contents/assets/css/screen.min.css
vendored
Normal file
BIN
wp-content/plugins/easy-table-of-contents/assets/eztoc-logo.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
364
wp-content/plugins/easy-table-of-contents/assets/js/admin.js
Normal file
@ -0,0 +1,364 @@
|
||||
jQuery(document).ready(function ($) {
|
||||
|
||||
var ez_toc_color_picker = $('.ez-toc-color-picker');
|
||||
|
||||
if (ez_toc_color_picker.length) {
|
||||
ez_toc_color_picker.wpColorPicker();
|
||||
}
|
||||
|
||||
var ezTocSettingsWidth = document.getElementById('ez-toc-settings[width]');
|
||||
var ezTocSettingsCustomWidth = document.getElementById('ez-toc-settings[width_custom]');
|
||||
|
||||
if(ezTocSettingsCustomWidth) {
|
||||
if(ezTocSettingsWidth.value != 'custom')
|
||||
ezTocSettingsCustomWidth.parentNode.parentNode.style.display = "none";
|
||||
|
||||
ezTocSettingsWidth.addEventListener('change', function () {
|
||||
if (document.getElementById('ez-toc-settings[width]').value == 'custom') {
|
||||
ezTocSettingsCustomWidth.parentNode.parentNode.style.display = "revert";
|
||||
} else {
|
||||
ezTocSettingsCustomWidth.parentNode.parentNode.style.display = "none";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#reset-options-to-default-button").click(function() {
|
||||
let text = "Do you want reset settings to default options?";
|
||||
if (confirm(text) == true) {
|
||||
$.post(ajaxurl, { action: 'eztoc_reset_options_to_default', eztoc_security_nonce: cn_toc_admin_data.eztoc_security_nonce },
|
||||
function (data) {
|
||||
alert('Default Options Reset Now!');
|
||||
window.location.reload();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#subscribe-newsletter-form").on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
var $form = $("#subscribe-newsletter-form");
|
||||
var name = $form.find('input[name="name"]').val();
|
||||
var email = $form.find('input[name="email"]').val();
|
||||
var website = $form.find('input[name="company"]').val();
|
||||
$.post(ajaxurl, {action: 'eztoc_subscribe_newsletter', name: name, email: email, website: website, eztoc_security_nonce: cn_toc_admin_data.eztoc_security_nonce},
|
||||
function (data) {
|
||||
if(data === 'security_nonce_not_verified' ){
|
||||
alert('Security nonce not verified');
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
let position = $('#eztoc-general').find("select[name='ez-toc-settings[position]']");
|
||||
let customParaNumber = $('#eztoc-general').find("input[name='ez-toc-settings[custom_para_number]']");
|
||||
let customImgNumber = $('#eztoc-general').find("input[name='ez-toc-settings[custom_img_number]']");
|
||||
let blockQCheckB = $('#eztoc-general').find("input[name='ez-toc-settings[blockqoute_checkbox]']");
|
||||
if($(position).val() == 'aftercustompara'){
|
||||
$(customParaNumber).parents('tr').show();
|
||||
}else{
|
||||
$(customParaNumber).parents('tr').hide();
|
||||
}
|
||||
if($(position).val() == 'afterpara' || $(position).val() == 'aftercustompara'){
|
||||
$(blockQCheckB).parents('tr').show();
|
||||
}else{
|
||||
$(blockQCheckB).parents('tr').hide();
|
||||
}
|
||||
if($(position).val() == 'aftercustomimg'){
|
||||
$(customImgNumber).parents('tr').show();
|
||||
}else{
|
||||
$(customImgNumber).parents('tr').hide();
|
||||
}
|
||||
$(document).on("change", "select[name='ez-toc-settings[position]']", function() {
|
||||
if($(this).val() == 'aftercustompara'){
|
||||
$(customParaNumber).parents('tr').show(500);
|
||||
}else{
|
||||
$(customParaNumber).parents('tr').hide(500);
|
||||
}
|
||||
if($(this).val() == 'afterpara' || $(this).val() == 'aftercustompara'){
|
||||
$(blockQCheckB).parents('tr').show(500);
|
||||
}else{
|
||||
$(blockQCheckB).parents('tr').hide(500);
|
||||
}
|
||||
if($(this).val() == 'aftercustomimg'){
|
||||
$(customImgNumber).parents('tr').show(500);
|
||||
}else{
|
||||
$(customImgNumber).parents('tr').hide(500);
|
||||
}
|
||||
});
|
||||
let check_method = $('#eztoc-general').find("select[name='ez-toc-settings[toc_loading]']");
|
||||
let smoothCheck = $('#eztoc-general').find("input[name='ez-toc-settings[smooth_scroll]']");
|
||||
let anchsJump = $('#eztoc-general').find("input[name='ez-toc-settings[avoid_anch_jump]']");
|
||||
let js_where = $('#eztoc-advanced').find("select[name='ez-toc-settings[load_js_in]']");
|
||||
if($(check_method).val() == 'js'){
|
||||
$(smoothCheck).parents('tr').show();
|
||||
$(anchsJump).parents('tr').show();
|
||||
$(js_where).parents('tr').show();
|
||||
}else{
|
||||
$(smoothCheck).parents('tr').hide();
|
||||
$(anchsJump).parents('tr').hide();
|
||||
$(js_where).parents('tr').hide();
|
||||
}
|
||||
$(document).on("change", "select[name='ez-toc-settings[toc_loading]']", function() {
|
||||
if($(this).val() == 'js'){
|
||||
$(smoothCheck).parents('tr').show(500);
|
||||
$(anchsJump).parents('tr').show(500);
|
||||
$(js_where).parents('tr').show(500);
|
||||
}else{
|
||||
$(smoothCheck).parents('tr').hide(500);
|
||||
$(anchsJump).parents('tr').hide(500);
|
||||
$(js_where).parents('tr').hide(500);
|
||||
}
|
||||
});
|
||||
|
||||
let stickyHighlight = $('#eztoc-sticky').find("input[name='ez-toc-settings[sticky_highlight_heading]']");
|
||||
let stickyHighlightBg = $('#eztoc-sticky').find("input[name='ez-toc-settings[sticky_highlight_bg_colour]']");
|
||||
let stickyHighlightTitle = $('#eztoc-sticky').find("input[name='ez-toc-settings[sticky_highlight_title_colour]']");
|
||||
if($(stickyHighlight).prop('checked') == true){
|
||||
$(stickyHighlightBg).parents('tr').show();
|
||||
$(stickyHighlightTitle).parents('tr').show();
|
||||
}else{
|
||||
$(stickyHighlightBg).parents('tr').hide();
|
||||
$(stickyHighlightTitle).parents('tr').hide();
|
||||
}
|
||||
$(document).on("change", "input[name='ez-toc-settings[sticky_highlight_heading]']", function() {
|
||||
if($(this).prop('checked') == true){
|
||||
$(stickyHighlightBg).parents('tr').show(500);
|
||||
$(stickyHighlightTitle).parents('tr').show(500);
|
||||
}else{
|
||||
$(stickyHighlightBg).parents('tr').hide(500);
|
||||
$(stickyHighlightTitle).parents('tr').hide(500);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* DisableScrolling Function
|
||||
* @since 2.0.33
|
||||
*/
|
||||
function disableScrolling() {
|
||||
var x=window.scrollX;
|
||||
var y=window.scrollY;
|
||||
window.onscroll=function(){window.scrollTo(x, y);};
|
||||
}
|
||||
/**
|
||||
* EnableScrolling Function
|
||||
* @since 2.0.33
|
||||
*/
|
||||
function enableScrolling(){
|
||||
ezTocSettingsTabsFixed();
|
||||
}
|
||||
|
||||
/**
|
||||
* unsecuredCopyToClipboard Function
|
||||
* Clipboard JS
|
||||
* @since 2.0.33
|
||||
*/
|
||||
const unsecuredCopyToClipboard = (text) => {
|
||||
const textArea = document.createElement("textarea");
|
||||
textArea.value = text;
|
||||
document.body.appendChild(textArea);
|
||||
textArea.focus();
|
||||
textArea.select();
|
||||
try {
|
||||
document.execCommand('copy')
|
||||
} catch (err) {
|
||||
console.error('Unable to copy to clipboard', err)
|
||||
}
|
||||
document.body.removeChild(textArea)
|
||||
};
|
||||
/**
|
||||
* ez_toc_clipboard Function
|
||||
* Clipboard JS
|
||||
* @since 2.0.33
|
||||
*/
|
||||
function ez_toc_clipboard(id, tooltipId, $this, event) {
|
||||
event.preventDefault();
|
||||
disableScrolling();
|
||||
var copyText = $this.parentNode.parentNode.querySelectorAll("#" + id)[0];
|
||||
copyText.select();
|
||||
copyText.setSelectionRange(0, 99999);
|
||||
unsecuredCopyToClipboard(copyText.value);
|
||||
|
||||
var tooltip = $this.querySelectorAll('span.' + tooltipId)[0];
|
||||
tooltip.innerHTML = "Copied: " + copyText.value;
|
||||
}
|
||||
/**
|
||||
* ez_toc_outFunc Function
|
||||
* Clipboard JS
|
||||
* @since 2.0.33
|
||||
*/
|
||||
function ez_toc_outFunc(tooltipId, $this, event) {
|
||||
event.preventDefault();
|
||||
var tooltip = $this.querySelectorAll('span.' + tooltipId)[0];
|
||||
tooltip.innerHTML = "Copy to clipboard";
|
||||
enableScrolling();
|
||||
}
|
||||
|
||||
/**
|
||||
* ezTocSettingsTabsFixed Function
|
||||
* Apply Fixed CSS & JS for General Settings Tabs
|
||||
* @since 2.0.38
|
||||
*/
|
||||
function ezTocSettingsTabsFixed() {
|
||||
var ezTocProSettingsContainer = '<span class="general-pro-settings-container"> | <a href="#eztoc-prosettings" id="eztoc-link-prosettings">Pro Settings</a></span>';
|
||||
|
||||
var ezTocGeneralTabs = document.querySelector("#general #eztoc-tabs");
|
||||
var ezTocGeneralForm = document.querySelector("#general form");
|
||||
|
||||
if(ezTocGeneralTabs !== null) {
|
||||
window.onscroll = function () {
|
||||
var y = window.scrollY;
|
||||
|
||||
var ez_toc_pro_settings_link_paid = document.getElementsByClassName('ez-toc-pro-settings-link-paid');
|
||||
var ezTocElementProSettingsContainer = document.getElementsByClassName("general-pro-settings-container");
|
||||
|
||||
var ezTocGeneralTabsLinkGeneral = document.querySelector("#general #eztoc-tabs #eztoc-link-general");
|
||||
var ezTocGeneralTabsLinkAppearance = document.querySelector("#general #eztoc-tabs #eztoc-link-appearance");
|
||||
var ezTocGeneralTabsLinkAdvanced = document.querySelector("#general #eztoc-tabs #eztoc-link-advanced");
|
||||
var ezTocGeneralTabsLinkShortcode = document.querySelector("#general #eztoc-tabs #eztoc-link-shortcode");
|
||||
var ezTocGeneralTabsLinkSticky = document.querySelector("#general #eztoc-tabs #eztoc-link-sticky");
|
||||
var ezTocGeneralTabsLinkCompatibility = document.querySelector("#general #eztoc-tabs #eztoc-link-compatibility");
|
||||
var ezTocGeneralTabsLinkIeSettings = document.querySelector("#general #eztoc-tabs #eztoc-link-iesettings");
|
||||
var ezTocGeneralTabsLinkProSettings = document.querySelector("#general #eztoc-tabs #eztoc-link-prosettings");
|
||||
|
||||
var minusOffsetTop = 100;
|
||||
|
||||
var ezTocGeneralContainerGeneral = document.querySelector("#general div#eztoc-general").offsetTop - minusOffsetTop;
|
||||
var ezTocGeneralContainerAppearance = document.querySelector("#general div#eztoc-appearance").offsetTop - minusOffsetTop;
|
||||
var ezTocGeneralContainerAdvanced = document.querySelector("#general div#eztoc-advanced").offsetTop - minusOffsetTop;
|
||||
var ezTocGeneralContainerShortcode = document.querySelector("#general div#eztoc-shortcode").offsetTop - minusOffsetTop;
|
||||
var ezTocGeneralContainerCompatibility = document.querySelector("#general div#eztoc-compatibility").offsetTop - minusOffsetTop;
|
||||
var ezTocGeneralContainerIeSettings = document.querySelector("#general div#eztoc-iesettings").offsetTop - minusOffsetTop;
|
||||
var ezTocGeneralContainerSticky = document.querySelector("#eztoc-sticky").offsetTop - minusOffsetTop;
|
||||
|
||||
if(ez_toc_pro_settings_link_paid !== null && ez_toc_pro_settings_link_paid.length > 0) {
|
||||
var ezTocGeneralContainerProSettings = document.querySelector("#general div#eztoc-prosettings").offsetTop - minusOffsetTop - 150;
|
||||
} else {
|
||||
ezTocGeneralContainerCompatibility -= 150;
|
||||
ezTocGeneralContainerIeSettings -= 150;
|
||||
}
|
||||
ezTocGeneralTabsLinkGeneral.classList.add('active');
|
||||
ezTocGeneralTabsLinkAppearance.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAdvanced.classList.remove('active');
|
||||
ezTocGeneralTabsLinkShortcode.classList.remove('active');
|
||||
ezTocGeneralTabsLinkCompatibility.classList.remove('active');
|
||||
ezTocGeneralTabsLinkIeSettings.classList.remove('active');
|
||||
ezTocGeneralTabsLinkSticky.classList.remove('active');
|
||||
if (ezTocElementProSettingsContainer.length > 0 && ezTocGeneralTabsLinkProSettings !== null)
|
||||
ezTocGeneralTabsLinkProSettings.classList.remove('active');
|
||||
|
||||
if (y >= 100) {
|
||||
ezTocGeneralTabs.classList.remove('stay');
|
||||
ezTocGeneralTabs.classList.add('moving');
|
||||
ezTocGeneralForm.classList.add('moving');
|
||||
if(ez_toc_pro_settings_link_paid !== null && ez_toc_pro_settings_link_paid.length > 0 && ezTocElementProSettingsContainer.length == 0)
|
||||
ezTocGeneralTabs.innerHTML += ezTocProSettingsContainer;
|
||||
} else {
|
||||
ezTocGeneralTabs.classList.remove('moving');
|
||||
ezTocGeneralTabs.classList.add('stay');
|
||||
ezTocGeneralForm.classList.remove('moving');
|
||||
if(ez_toc_pro_settings_link_paid !== null && ez_toc_pro_settings_link_paid.length > 0 && ezTocElementProSettingsContainer.length > 0)
|
||||
document.querySelector(".general-pro-settings-container").remove();
|
||||
}
|
||||
|
||||
if (y >= ezTocGeneralContainerGeneral) {
|
||||
ezTocGeneralTabsLinkGeneral.classList.add('active');
|
||||
ezTocGeneralTabsLinkAppearance.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAdvanced.classList.remove('active');
|
||||
ezTocGeneralTabsLinkShortcode.classList.remove('active');
|
||||
ezTocGeneralTabsLinkCompatibility.classList.remove('active');
|
||||
ezTocGeneralTabsLinkIeSettings.classList.remove('active');
|
||||
ezTocGeneralTabsLinkSticky.classList.remove('active');
|
||||
if(ez_toc_pro_settings_link_paid !== null && ez_toc_pro_settings_link_paid.length > 0 && ezTocElementProSettingsContainer.length > 0 && ezTocGeneralTabsLinkProSettings !== null)
|
||||
ezTocGeneralTabsLinkProSettings.classList.remove('active');
|
||||
}
|
||||
if (y >= ezTocGeneralContainerAppearance) {
|
||||
ezTocGeneralTabsLinkGeneral.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAppearance.classList.add('active');
|
||||
ezTocGeneralTabsLinkAdvanced.classList.remove('active');
|
||||
ezTocGeneralTabsLinkShortcode.classList.remove('active');
|
||||
ezTocGeneralTabsLinkCompatibility.classList.remove('active');
|
||||
ezTocGeneralTabsLinkIeSettings.classList.remove('active');
|
||||
ezTocGeneralTabsLinkSticky.classList.remove('active');
|
||||
if(ez_toc_pro_settings_link_paid !== null && ez_toc_pro_settings_link_paid.length > 0 && ezTocElementProSettingsContainer.length > 0 && ezTocGeneralTabsLinkProSettings !== null)
|
||||
ezTocGeneralTabsLinkProSettings.classList.remove('active');
|
||||
}
|
||||
if (y >= ezTocGeneralContainerAdvanced) {
|
||||
ezTocGeneralTabsLinkGeneral.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAppearance.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAdvanced.classList.add('active');
|
||||
ezTocGeneralTabsLinkShortcode.classList.remove('active');
|
||||
ezTocGeneralTabsLinkCompatibility.classList.remove('active');
|
||||
ezTocGeneralTabsLinkIeSettings.classList.remove('active');
|
||||
ezTocGeneralTabsLinkSticky.classList.remove('active');
|
||||
if(ez_toc_pro_settings_link_paid !== null && ez_toc_pro_settings_link_paid.length > 0 && ezTocElementProSettingsContainer.length > 0 && ezTocGeneralTabsLinkProSettings !== null)
|
||||
ezTocGeneralTabsLinkProSettings.classList.remove('active');
|
||||
}
|
||||
if (y >= ezTocGeneralContainerShortcode) {
|
||||
ezTocGeneralTabsLinkGeneral.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAppearance.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAdvanced.classList.remove('active');
|
||||
ezTocGeneralTabsLinkShortcode.classList.add('active');
|
||||
ezTocGeneralTabsLinkCompatibility.classList.remove('active');
|
||||
ezTocGeneralTabsLinkIeSettings.classList.remove('active');
|
||||
ezTocGeneralTabsLinkSticky.classList.remove('active');
|
||||
if(ez_toc_pro_settings_link_paid !== null && ez_toc_pro_settings_link_paid.length > 0 && ezTocElementProSettingsContainer.length > 0 && ezTocGeneralTabsLinkProSettings !== null)
|
||||
ezTocGeneralTabsLinkProSettings.classList.remove('active');
|
||||
}
|
||||
if (y >= ezTocGeneralContainerSticky) {
|
||||
ezTocGeneralTabsLinkGeneral.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAppearance.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAdvanced.classList.remove('active');
|
||||
ezTocGeneralTabsLinkShortcode.classList.remove('active');
|
||||
ezTocGeneralTabsLinkCompatibility.classList.remove('active');
|
||||
ezTocGeneralTabsLinkIeSettings.classList.remove('active');
|
||||
ezTocGeneralTabsLinkSticky.classList.add('active');
|
||||
|
||||
if(ez_toc_pro_settings_link_paid !== null && ez_toc_pro_settings_link_paid.length > 0 && ezTocElementProSettingsContainer.length > 0 && ezTocGeneralTabsLinkProSettings !== null)
|
||||
ezTocGeneralTabsLinkProSettings.classList.remove('active');
|
||||
}
|
||||
if (y >= ezTocGeneralContainerCompatibility) {
|
||||
ezTocGeneralTabsLinkGeneral.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAppearance.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAdvanced.classList.remove('active');
|
||||
ezTocGeneralTabsLinkShortcode.classList.remove('active');
|
||||
ezTocGeneralTabsLinkCompatibility.classList.add('active');
|
||||
ezTocGeneralTabsLinkIeSettings.classList.remove('active');
|
||||
ezTocGeneralTabsLinkSticky.classList.remove('active');
|
||||
if(ez_toc_pro_settings_link_paid !== null && ez_toc_pro_settings_link_paid.length > 0 && ezTocElementProSettingsContainer.length > 0 && ezTocGeneralTabsLinkProSettings !== null)
|
||||
ezTocGeneralTabsLinkProSettings.classList.remove('active');
|
||||
}
|
||||
if (y >= ezTocGeneralContainerIeSettings) {
|
||||
ezTocGeneralTabsLinkGeneral.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAppearance.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAdvanced.classList.remove('active');
|
||||
ezTocGeneralTabsLinkShortcode.classList.remove('active');
|
||||
ezTocGeneralTabsLinkCompatibility.classList.remove('active');
|
||||
ezTocGeneralTabsLinkIeSettings.classList.add('active');
|
||||
ezTocGeneralTabsLinkSticky.classList.remove('active');
|
||||
if(ez_toc_pro_settings_link_paid !== null && ez_toc_pro_settings_link_paid.length > 0 && ezTocElementProSettingsContainer.length > 0 && ezTocGeneralTabsLinkProSettings !== null)
|
||||
ezTocGeneralTabsLinkProSettings.classList.remove('active');
|
||||
}
|
||||
if (ezTocElementProSettingsContainer.length > 0 && y >= ezTocGeneralContainerProSettings) {
|
||||
ezTocGeneralTabsLinkGeneral.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAppearance.classList.remove('active');
|
||||
ezTocGeneralTabsLinkAdvanced.classList.remove('active');
|
||||
ezTocGeneralTabsLinkShortcode.classList.remove('active');
|
||||
ezTocGeneralTabsLinkCompatibility.classList.remove('active');
|
||||
ezTocGeneralTabsLinkIeSettings.classList.remove('active');
|
||||
ezTocGeneralTabsLinkSticky.classList.remove('active');
|
||||
if(ez_toc_pro_settings_link_paid !== null && ez_toc_pro_settings_link_paid.length > 0 && ezTocElementProSettingsContainer.length > 0 && ezTocGeneralTabsLinkProSettings !== null)
|
||||
ezTocGeneralTabsLinkProSettings.classList.add('active');
|
||||
}
|
||||
};
|
||||
} else {
|
||||
window.onscroll = function () {}
|
||||
}
|
||||
}
|
||||
ezTocSettingsTabsFixed();
|
||||
|
1
wp-content/plugins/easy-table-of-contents/assets/js/admin.min.js
vendored
Normal file
@ -0,0 +1,163 @@
|
||||
jQuery(function ($) {
|
||||
// ======================================
|
||||
// Set active heading in ez-toc-widget list
|
||||
// ======================================
|
||||
|
||||
var ezTOCWidgetStickyheadings = $('span.ez-toc-section').toArray();
|
||||
var ezTOCWidgetStickyheadingToListElementLinkMap = ezTOCWidgetStickygetHeadingToListElementLinkMap(ezTOCWidgetStickyheadings);
|
||||
var ezTOCWidgetStickylistElementLinks = $.map(ezTOCWidgetStickyheadingToListElementLinkMap, function (value, key) {
|
||||
return value
|
||||
});
|
||||
var ezTOCWidgetStickyscrollOffset = ezTOCWidgetStickygetScrollOffset();
|
||||
|
||||
ezTOCWidgetStickyactivateSetActiveEzTocListElement();
|
||||
|
||||
function ezTOCWidgetStickysetActiveEzTocListElement() {
|
||||
var ezTOCWidgetStickyactiveHeading = ezTOCWidgetStickygetActiveHeading(ezTOCWidgetStickyscrollOffset, ezTOCWidgetStickyheadings);
|
||||
if (ezTOCWidgetStickyactiveHeading) {
|
||||
var ezTOCWidgetStickyactiveListElementLink = ezTOCWidgetStickyheadingToListElementLinkMap[ ezTOCWidgetStickyactiveHeading.id ];
|
||||
ezTOCWidgetStickyremoveStyleFromNonActiveListElement(ezTOCWidgetStickyactiveListElementLink, ezTOCWidgetStickylistElementLinks);
|
||||
ezTOCWidgetStickysetStyleForActiveListElementElement(ezTOCWidgetStickyactiveListElementLink);
|
||||
}
|
||||
}
|
||||
|
||||
function ezTOCWidgetStickyactivateSetActiveEzTocListElement() {
|
||||
if (ezTOCWidgetStickyheadings.length > 0 && $('.ez-toc-widget-sticky-container').length) {
|
||||
$(window).on('load resize scroll', ezTOCWidgetStickysetActiveEzTocListElement);
|
||||
}
|
||||
}
|
||||
|
||||
function ezTOCWidgetStickydeactivateSetActiveEzTocListElement() {
|
||||
$(window).off('load resize scroll', ezTOCWidgetStickysetActiveEzTocListElement);
|
||||
}
|
||||
|
||||
function ezTOCWidgetStickygetEzTocListElementLinkByHeading(ezTOCWidgetStickyheading) {
|
||||
return $('.ez-toc-widget-sticky-container .ez-toc-widget-sticky-list a[href="#' + $(ezTOCWidgetStickyheading).attr('id') + '"]');
|
||||
}
|
||||
|
||||
function ezTOCWidgetStickygetHeadingToListElementLinkMap(ezTOCWidgetStickyheadings) {
|
||||
return ezTOCWidgetStickyheadings.reduce(function (ezTOCWidgetStickymap, ezTOCWidgetStickyheading) {
|
||||
ezTOCWidgetStickymap[ ezTOCWidgetStickyheading.id ] = ezTOCWidgetStickygetEzTocListElementLinkByHeading(ezTOCWidgetStickyheading);
|
||||
return ezTOCWidgetStickymap;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function ezTOCWidgetStickygetScrollOffset() {
|
||||
var ezTOCWidgetStickyscrollOffset = 30; // so if smooth offset is off, the correct title is set as active
|
||||
if (typeof ezTOC != 'undefined' && typeof ezTOC.smooth_scroll != 'undefined' && parseInt(ezTOC.smooth_scroll) === 1) {
|
||||
ezTOCWidgetStickyscrollOffset = (typeof ezTOC.scroll_offset != 'undefined') ? parseInt(ezTOC.scroll_offset) : 30;
|
||||
}
|
||||
|
||||
var adminbar = $('#wpadminbar');
|
||||
|
||||
if (adminbar.length) {
|
||||
ezTOCWidgetStickyscrollOffset += adminbar.height();
|
||||
}
|
||||
return ezTOCWidgetStickyscrollOffset;
|
||||
}
|
||||
|
||||
function ezTOCWidgetStickygetActiveHeading(ezTOCWidgetStickytopOffset, ezTOCWidgetStickyheadings) {
|
||||
var ezTOCWidgetStickyscrollTop = $(window).scrollTop();
|
||||
var ezTOCWidgetStickyrelevantOffset = ezTOCWidgetStickyscrollTop + ezTOCWidgetStickytopOffset + 1;
|
||||
var ezTOCWidgetStickyactiveHeading = ezTOCWidgetStickyheadings[ 0 ];
|
||||
var ezTOCWidgetStickyclosestHeadingAboveOffset = ezTOCWidgetStickyrelevantOffset - $(ezTOCWidgetStickyactiveHeading).offset().top;
|
||||
ezTOCWidgetStickyheadings.forEach(function (ezTOCWidgetStickysection) {
|
||||
var ezTOCWidgetStickytopOffset = ezTOCWidgetStickyrelevantOffset - $(ezTOCWidgetStickysection).offset().top;
|
||||
if (ezTOCWidgetStickytopOffset > 0 && ezTOCWidgetStickytopOffset < ezTOCWidgetStickyclosestHeadingAboveOffset) {
|
||||
ezTOCWidgetStickyclosestHeadingAboveOffset = ezTOCWidgetStickytopOffset;
|
||||
ezTOCWidgetStickyactiveHeading = ezTOCWidgetStickysection;
|
||||
}
|
||||
});
|
||||
return ezTOCWidgetStickyactiveHeading;
|
||||
}
|
||||
|
||||
function ezTOCWidgetStickyremoveStyleFromNonActiveListElement(ezTOCWidgetStickyactiveListElementLink, ezTOCWidgetStickylistElementLinks) {
|
||||
ezTOCWidgetStickylistElementLinks.forEach(function (ezTOCWidgetStickylistElementLink) {
|
||||
if (ezTOCWidgetStickyactiveListElementLink !== ezTOCWidgetStickylistElementLink && ezTOCWidgetStickylistElementLink.parent().hasClass('active')) {
|
||||
ezTOCWidgetStickylistElementLink.parent().removeClass('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function ezTOCWidgetStickycorrectActiveListElementBackgroundColorHeight(ezTOCWidgetStickyactiveListElement) {
|
||||
var ezTOCWidgetStickylistElementHeight = ezTOCWidgetStickygetListElementHeightWithoutUlChildren(ezTOCWidgetStickyactiveListElement);
|
||||
ezTOCWidgetStickyaddListElementBackgroundColorHeightStyleToHead(ezTOCWidgetStickylistElementHeight);
|
||||
}
|
||||
|
||||
function ezTOCWidgetStickygetListElementHeightWithoutUlChildren(ezTOCWidgetStickylistElement) {
|
||||
var $ezTOCWidgetStickylistElement = $(ezTOCWidgetStickylistElement);
|
||||
var ezTOCWidgetStickycontent = $ezTOCWidgetStickylistElement.html();
|
||||
// Adding list item with class '.active' to get the real height.
|
||||
// When adding a class to an existing element and using jQuery(..).height() directly afterwards,
|
||||
// the height is the 'old' height. The height might change due to text-wraps when setting the text-weight bold for example
|
||||
// When adding a new item, the height is calculated correctly.
|
||||
// But only when it might be visible (so display:none; is not possible...)
|
||||
// But because it get's directly removed afterwards it never will be rendered by the browser
|
||||
// (at least in my tests in FF, Chrome, IE11 and Edge)
|
||||
$ezTOCWidgetStickylistElement.parent().append('<li id="ez-toc-widget-sticky-height-test" class="active">' + ezTOCWidgetStickycontent + '</li>');
|
||||
var ezTOCWidgetStickylistItem = $('#ez-toc-widget-sticky-height-test');
|
||||
var ezTOCWidgetStickyheight = ezTOCWidgetStickylistItem.height();
|
||||
ezTOCWidgetStickylistItem.remove();
|
||||
return ezTOCWidgetStickyheight - $ezTOCWidgetStickylistElement.children('ul').first().height();
|
||||
}
|
||||
|
||||
function ezTOCWidgetStickyaddListElementBackgroundColorHeightStyleToHead(ezTOCWidgetStickylistElementHeight) {
|
||||
// Remove existing
|
||||
$('#ez-toc-widget-sticky-active-height').remove();
|
||||
// jQuery(..).css(..) doesn't work, because ::before is a pseudo element and not part of the DOM
|
||||
// Workaround is to add it to head
|
||||
$('<style id="ez-toc-widget-sticky-active-height">' +
|
||||
'.ez-toc-widget-sticky-container ul.ez-toc-widget-sticky-list li.active {' +
|
||||
// 'line-heigh:' + listElementHeight + 'px; ' +
|
||||
'height:' + ezTOCWidgetStickylistElementHeight + 'px;' +
|
||||
'} </style>')
|
||||
.appendTo('head');
|
||||
}
|
||||
|
||||
function ezTOCWidgetStickysetStyleForActiveListElementElement(ezTOCWidgetStickyactiveListElementLink) {
|
||||
var ezTOCWidgetStickyactiveListElement = ezTOCWidgetStickyactiveListElementLink.parent();
|
||||
if (!ezTOCWidgetStickyactiveListElement.hasClass('active')) {
|
||||
ezTOCWidgetStickyactiveListElement.addClass('active');
|
||||
}
|
||||
ezTOCWidgetStickycorrectActiveListElementBackgroundColorHeight(ezTOCWidgetStickyactiveListElement);
|
||||
}
|
||||
|
||||
/**
|
||||
* EzTOC Widget Dynamic Scrolling JS
|
||||
*
|
||||
* @since 2.0.41
|
||||
*/
|
||||
|
||||
setTimeout(function () {
|
||||
jQuery(window).on('load resize scroll', ezTOCWidgetStickysetScrollActiveEzTocListElement);
|
||||
}, 100);
|
||||
|
||||
var ezTocActiveList = '';
|
||||
function ezTOCWidgetStickysetScrollActiveEzTocListElement(e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (jQuery(document).width() > 980 && jQuery(window).scrollTop() >= ezTocWidgetSticky.scroll_fixed_position && (jQuery('.post,.post-content').length == 0 || jQuery('.post,.post-content').length > 0 && jQuery(window).scrollTop() <= jQuery('.post,.post-content').height())) {
|
||||
jQuery('.ez-toc-widget-sticky').css({
|
||||
'position': 'fixed',
|
||||
'width': (ezTocWidgetSticky.sidebar_width != 'auto') ? ezTocWidgetSticky.sidebar_width + '' + ezTocWidgetSticky.sidebar_width_size_unit : $('#ez-toc-widget-sticky-container').parents('.widget-area').width(),
|
||||
'top': (ezTocWidgetSticky.fixed_top_position != '30') ? ezTocWidgetSticky.fixed_top_position + '' + ezTocWidgetSticky.fixed_top_position_size_unit : '30px',
|
||||
'z-index': '9999999',
|
||||
'background-color': jQuery(document).find('body').css("background-color"),
|
||||
});
|
||||
jQuery('.ez-toc-widget-sticky nav').css({
|
||||
'overflow-y': (ezTocWidgetSticky.navigation_scroll_bar == 'on') ? 'auto' : 'hidden',
|
||||
'max-height': (ezTocWidgetSticky.scroll_max_height != 'auto') ? ezTocWidgetSticky.scroll_max_height + '' + ezTocWidgetSticky.scroll_max_height_size_unit : 'calc(100vh - 111px)'
|
||||
});
|
||||
} else {
|
||||
jQuery('.ez-toc-widget-sticky,.ez-toc-widget-sticky nav').attr('style', false);
|
||||
}
|
||||
var ezTocHrefActive = jQuery("#ez-toc-widget-sticky-container li.active a").attr('href');
|
||||
var ezTocLastChild = "#ez-toc-widget-sticky-container nav>ul>li:last-child a";
|
||||
let ezTocOffsetTopDynamic = Math.round(jQuery("#ez-toc-widget-sticky-container .ez-toc-link[href='" + ezTocHrefActive + "']").position().top);
|
||||
var ezTocLastChildTop = Math.round(jQuery(ezTocLastChild).position().top);
|
||||
if (ezTocHrefActive != ezTocActiveList) {
|
||||
jQuery('.ez-toc-widget-sticky nav').scrollTop(Math.round(jQuery('.ez-toc-widget-sticky nav').scrollTop() + ezTocOffsetTopDynamic) - 50);
|
||||
}
|
||||
ezTocActiveList = ezTocHrefActive;
|
||||
}
|
||||
});
|
1
wp-content/plugins/easy-table-of-contents/assets/js/ez-toc-widget-sticky.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
jQuery(function(t){var i,e,o,c=t("span.ez-toc-section").toArray(),s=(i=c,i.reduce(function(i,e){var o;return i[e.id]=t('.ez-toc-widget-sticky-container .ez-toc-widget-sticky-list a[href="#'+t(o=e).attr("id")+'"]'),i},{})),n=t.map(s,function(t,i){return t}),a=(e=30,"undefined"!=typeof ezTOC&&void 0!==ezTOC.smooth_scroll&&1===parseInt(ezTOC.smooth_scroll)&&(e=void 0!==ezTOC.scroll_offset?parseInt(ezTOC.scroll_offset):30),o=t("#wpadminbar"),o.length&&(e+=o.height()),e);function r(){var i,e,o,r,l,d=(i=a,e=c,o=t(window).scrollTop()+i+1,r=e[0],l=o-t(r).offset().top,e.forEach(function(i){var e=o-t(i).offset().top;e>0&&e<l&&(l=e,r=i)}),r);if(d){var h,p,g,f,v,u,w,z,y,k=s[d.id];(function t(i,e){e.forEach(function(t){i!==t&&t.parent().hasClass("active")&&t.parent().removeClass("active")})})(k,n),(g=(h=k).parent()).hasClass("active")||g.addClass("active"),y=(f=p=g,v=t(f),u=v.html(),v.parent().append('<li id="ez-toc-widget-sticky-height-test" class="active">'+u+"</li>"),w=t("#ez-toc-widget-sticky-height-test"),z=w.height(),w.remove(),z-v.children("ul").first().height()),t("#ez-toc-widget-sticky-active-height").remove(),t('<style id="ez-toc-widget-sticky-active-height">.ez-toc-widget-sticky-container ul.ez-toc-widget-sticky-list li.active {height:'+y+"px;} </style>").appendTo("head")}}function l(){t(window).off("load resize scroll",r)}c.length>0&&t(".ez-toc-widget-sticky-container").length&&t(window).on("load resize scroll",r),setTimeout(function(){jQuery(window).on("load resize scroll",h)},100);var d="";function h(i){i.preventDefault(),jQuery(document).width()>980&&jQuery(window).scrollTop()>=ezTocWidgetSticky.scroll_fixed_position&&(0==jQuery(".post,.post-content").length||jQuery(".post,.post-content").length>0&&jQuery(window).scrollTop()<=jQuery(".post,.post-content").height())?(jQuery(".ez-toc-widget-sticky").css({position:"fixed",width:"auto"!=ezTocWidgetSticky.sidebar_width?ezTocWidgetSticky.sidebar_width+""+ezTocWidgetSticky.sidebar_width_size_unit:t("#ez-toc-widget-sticky-container").parents(".widget-area").width(),top:"30"!=ezTocWidgetSticky.fixed_top_position?ezTocWidgetSticky.fixed_top_position+""+ezTocWidgetSticky.fixed_top_position_size_unit:"30px","z-index":"9999999","background-color":jQuery(document).find("body").css("background-color")}),jQuery(".ez-toc-widget-sticky nav").css({"overflow-y":"on"==ezTocWidgetSticky.navigation_scroll_bar?"auto":"hidden","max-height":"auto"!=ezTocWidgetSticky.scroll_max_height?ezTocWidgetSticky.scroll_max_height+""+ezTocWidgetSticky.scroll_max_height_size_unit:"calc(100vh - 111px)"})):jQuery(".ez-toc-widget-sticky,.ez-toc-widget-sticky nav").attr("style",!1);var e=jQuery("#ez-toc-widget-sticky-container li.active a").attr("href");let o=Math.round(jQuery("#ez-toc-widget-sticky-container .ez-toc-link[href='"+e+"']").position().top);jQuery("#ez-toc-widget-sticky-container nav>ul>li:last-child a").position().top,e!=d&&jQuery(".ez-toc-widget-sticky nav").scrollTop(Math.round(jQuery(".ez-toc-widget-sticky nav").scrollTop()+o)-50),d=e}});
|
@ -0,0 +1,157 @@
|
||||
function ezTocTabToggle(evt, idname, tabContentClass = 'eztoc-tabcontent', tabLinksClass = 'eztoc-tablinks') {
|
||||
var i, tabcontent, tablinks;
|
||||
evt.preventDefault();
|
||||
tabcontent = document.getElementsByClassName(tabContentClass);
|
||||
for (i = 0; i < tabcontent.length; i++) {
|
||||
tabcontent[i].style.display = "none";
|
||||
}
|
||||
tablinks = document.getElementsByClassName(tabLinksClass);
|
||||
for (i = 0; i < tablinks.length; i++) {
|
||||
tablinks[i].className = tablinks[i].className.replace(" active", "");
|
||||
}
|
||||
document.getElementById(idname).style.display = "block";
|
||||
|
||||
evt.target.className += " active";
|
||||
}
|
||||
|
||||
function eztocIsEmail(email) {
|
||||
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
||||
return regex.test(email);
|
||||
}
|
||||
|
||||
|
||||
//query form send starts here
|
||||
jQuery(document).ready(function ($) {
|
||||
|
||||
var url = window.location.href;
|
||||
if (url.indexOf('#technical-support') > -1) {
|
||||
$("#eztoc-technical").click();
|
||||
} else if (url.indexOf('#freevspro-support') > -1) {
|
||||
$("#eztoc-freevspro").click();
|
||||
} else if (url.indexOf('#welcome') > -1) {
|
||||
$("#eztoc-welcome").click();
|
||||
} else {
|
||||
$("#eztoc-default").click();
|
||||
}
|
||||
|
||||
$(".eztoc-send-query").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
var message = $("#eztoc_query_message").val();
|
||||
var email = $("#eztoc_query_email").val();
|
||||
var premium_cus = $("#saswp_query_premium_cus").val();
|
||||
|
||||
if ($.trim(message) != '' && $.trim(email) != '' && eztocIsEmail(email) == true) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajaxurl,
|
||||
dataType: "json",
|
||||
data: {
|
||||
action: "eztoc_send_query_message",
|
||||
message: message,
|
||||
email: email,
|
||||
eztoc_security_nonce: eztoc_admin_data.eztoc_security_nonce
|
||||
},
|
||||
success: function (response) {
|
||||
if (response['status'] == 't') {
|
||||
$(".eztoc-query-success").show();
|
||||
$(".eztoc-query-error").hide();
|
||||
} else {
|
||||
$(".eztoc-query-success").hide();
|
||||
$(".eztoc-query-error").show();
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
console.log(response);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
if ($.trim(message) == '' && $.trim(email) == '') {
|
||||
alert('Please enter the message, email and select customer type');
|
||||
} else {
|
||||
|
||||
if ($.trim(message) == '') {
|
||||
alert('Please enter the message');
|
||||
}
|
||||
if ($.trim(email) == '') {
|
||||
alert('Please enter the email');
|
||||
}
|
||||
if (eztocIsEmail(email) == false) {
|
||||
alert('Please enter a valid email');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$("#subscribe-newsletter-form").on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
var $form = $("#subscribe-newsletter-form");
|
||||
var name = $form.find('input[name="name"]').val();
|
||||
var email = $form.find('input[name="email"]').val();
|
||||
var website = $form.find('input[name="company"]').val();
|
||||
$.post(ajaxurl, {action: 'eztoc_subscribe_newsletter', name: name, email: email, website: website, eztoc_security_nonce: eztoc_admin_data.eztoc_security_nonce},
|
||||
function (data) {
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
let stickyToggleCheckbox = $('#eztoc-sticky').find("input[name='ez-toc-settings[sticky-toggle]']");
|
||||
let stickyToggleWidth = $('#eztoc-sticky').find("select[name='ez-toc-settings[sticky-toggle-width]']");
|
||||
let stickyToggleWidthCustom = $('#eztoc-sticky').find("input[name='ez-toc-settings[sticky-toggle-width-custom]']");
|
||||
let stickyToggleHeight = $('#eztoc-sticky').find("select[name='ez-toc-settings[sticky-toggle-height]']");
|
||||
let stickyToggleHeightCustom = $('#eztoc-sticky').find("input[name='ez-toc-settings[sticky-toggle-height-custom]']");
|
||||
|
||||
if($(stickyToggleCheckbox).prop('checked') == false) {
|
||||
$('#eztoc-sticky').find('tr:not(:first-child)').hide(500);
|
||||
}
|
||||
|
||||
$(document).on("change", "input[name='ez-toc-settings[sticky-toggle]']", function() {
|
||||
|
||||
if($(stickyToggleCheckbox).prop('checked') == true) {
|
||||
|
||||
$('#eztoc-sticky').find('tr:not(:first-child)').show(500);
|
||||
|
||||
if($(stickyToggleWidth).val() == '' || $(stickyToggleWidth).val() != 'custom'){
|
||||
$(stickyToggleWidthCustom).parents('tr').hide();
|
||||
}
|
||||
if($(stickyToggleHeight).val() == '' || $(stickyToggleHeight).val() != 'custom'){
|
||||
$(stickyToggleHeightCustom).parents('tr').hide();
|
||||
}
|
||||
} else {
|
||||
$('#eztoc-sticky').find('tr:not(:first-child)').hide(500);
|
||||
}
|
||||
|
||||
});
|
||||
update_sticky_width_field(stickyToggleWidth.val());
|
||||
update_sticky_height_field(stickyToggleHeight.val());
|
||||
|
||||
$(document).on("change", "select[name='ez-toc-settings[sticky-toggle-width]']", function() {
|
||||
update_sticky_width_field($(this).val());
|
||||
});
|
||||
|
||||
$(document).on("change", "select[name='ez-toc-settings[sticky-toggle-height]']", function() {
|
||||
update_sticky_height_field($(this).val());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function update_sticky_width_field(width){
|
||||
let stickyToggleWidthCustom = jQuery('#eztoc-sticky').find("input[name='ez-toc-settings[sticky-toggle-width-custom]']");
|
||||
if(width == 'custom') {
|
||||
jQuery(stickyToggleWidthCustom).parents('tr').show(500);
|
||||
} else {
|
||||
jQuery(stickyToggleWidthCustom).parents('tr').hide(500);
|
||||
}
|
||||
}
|
||||
|
||||
function update_sticky_height_field(height){
|
||||
let stickyToggleHeightCustom = jQuery('#eztoc-sticky').find("input[name='ez-toc-settings[sticky-toggle-height-custom]']");
|
||||
if(height == 'custom') {
|
||||
jQuery(stickyToggleHeightCustom).parents('tr').show(500);
|
||||
} else {
|
||||
jQuery(stickyToggleHeightCustom).parents('tr').hide(500);
|
||||
}
|
||||
}
|
1
wp-content/plugins/easy-table-of-contents/assets/js/eztoc-admin.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
function ezTocTabToggle(e,t,c="eztoc-tabcontent",i="eztoc-tablinks"){var s,n,o;for(e.preventDefault(),n=document.getElementsByClassName(c),s=0;s<n.length;s++)n[s].style.display="none";for(o=document.getElementsByClassName(i),s=0;s<o.length;s++)o[s].className=o[s].className.replace(" active","");document.getElementById(t).style.display="block",e.target.className+=" active"}function eztocIsEmail(e){return/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(e)}function update_sticky_width_field(e){let t=jQuery("#eztoc-sticky").find("input[name='ez-toc-settings[sticky-toggle-width-custom]']");"custom"==e?jQuery(t).parents("tr").show(500):jQuery(t).parents("tr").hide(500)}function update_sticky_height_field(e){let t=jQuery("#eztoc-sticky").find("input[name='ez-toc-settings[sticky-toggle-height-custom]']");"custom"==e?jQuery(t).parents("tr").show(500):jQuery(t).parents("tr").hide(500)}jQuery(document).ready((function(e){var t=window.location.href;t.indexOf("#technical-support")>-1?e("#eztoc-technical").click():t.indexOf("#freevspro-support")>-1?e("#eztoc-freevspro").click():t.indexOf("#welcome")>-1?e("#eztoc-welcome").click():e("#eztoc-default").click(),e(".eztoc-send-query").on("click",(function(t){t.preventDefault();var c=e("#eztoc_query_message").val(),i=e("#eztoc_query_email").val();e("#saswp_query_premium_cus").val();""!=e.trim(c)&&""!=e.trim(i)&&1==eztocIsEmail(i)?e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"eztoc_send_query_message",message:c,email:i,eztoc_security_nonce:eztoc_admin_data.eztoc_security_nonce},success:function(t){"t"==t.status?(e(".eztoc-query-success").show(),e(".eztoc-query-error").hide()):(e(".eztoc-query-success").hide(),e(".eztoc-query-error").show())},error:function(e){console.log(e)}}):""==e.trim(c)&&""==e.trim(i)?alert("Please enter the message, email and select customer type"):(""==e.trim(c)&&alert("Please enter the message"),""==e.trim(i)&&alert("Please enter the email"),0==eztocIsEmail(i)&&alert("Please enter a valid email"))})),e("#subscribe-newsletter-form").on("submit",(function(t){t.preventDefault();var c=e("#subscribe-newsletter-form"),i=c.find('input[name="name"]').val(),s=c.find('input[name="email"]').val(),n=c.find('input[name="company"]').val();e.post(ajaxurl,{action:"eztoc_subscribe_newsletter",name:i,email:s,website:n,eztoc_security_nonce:eztoc_admin_data.eztoc_security_nonce},(function(e){}))})),e(".eztoc-set-pos-btn").hide(),e("[name='ez-toc-settings[fixedtoc]']").on("click",(function(t){e(this).is(":checked")?(e(".eztoc-set-pos-btn").show(),console.log("checkbox checked")):(e(".eztoc-set-pos-btn").hide(),console.log("checkbox unchecked"))}));let c=e("#eztoc-sticky").find("input[name='ez-toc-settings[sticky-toggle]']"),i=e("#eztoc-sticky").find("select[name='ez-toc-settings[sticky-toggle-width]']"),s=e("#eztoc-sticky").find("input[name='ez-toc-settings[sticky-toggle-width-custom]']"),n=e("#eztoc-sticky").find("select[name='ez-toc-settings[sticky-toggle-height]']"),o=e("#eztoc-sticky").find("input[name='ez-toc-settings[sticky-toggle-height-custom]']");0==e(c).prop("checked")&&e("#eztoc-sticky").find("tr:not(:first-child)").hide(500),e(document).on("change","input[name='ez-toc-settings[sticky-toggle]']",(function(){1==e(c).prop("checked")?(e("#eztoc-sticky").find("tr:not(:first-child)").show(500),""!=e(i).val()&&"custom"==e(i).val()||e(s).parents("tr").hide(),""!=e(n).val()&&"custom"==e(n).val()||e(o).parents("tr").hide()):e("#eztoc-sticky").find("tr:not(:first-child)").hide(500)})),update_sticky_width_field(i.val()),update_sticky_height_field(n.val()),e(document).on("change","select[name='ez-toc-settings[sticky-toggle-width]']",(function(){update_sticky_width_field(e(this).val())})),e(document).on("change","select[name='ez-toc-settings[sticky-toggle-height]']",(function(){update_sticky_height_field(e(this).val())}))}));
|
302
wp-content/plugins/easy-table-of-contents/assets/js/front.js
Normal file
@ -0,0 +1,302 @@
|
||||
jQuery( function( $ ) {
|
||||
|
||||
/**
|
||||
* @typedef ezTOC
|
||||
* @type {Object} ezTOC
|
||||
* @property {string} affixSelector
|
||||
* @property {string} scroll_offset
|
||||
* @property {string} smooth_scroll
|
||||
* @property {string} visibility_hide_by_default
|
||||
*/
|
||||
|
||||
if ( typeof ezTOC != 'undefined' ) {
|
||||
|
||||
/**
|
||||
* Init EZ TOC.
|
||||
*/
|
||||
function ezTOCInit() {
|
||||
|
||||
var affix = $( '.ez-toc-widget-container.ez-toc-affix' );
|
||||
|
||||
if ( 0 !== affix.length ) {
|
||||
|
||||
/**
|
||||
* The smooth scroll offset needs to be taken into account when defining the offset_top property.
|
||||
* @link https://github.com/shazahm1/Easy-Table-of-Contents/issues/19
|
||||
*
|
||||
* @type {number}
|
||||
*/
|
||||
var affixOffset = 30;
|
||||
|
||||
// check offset setting
|
||||
if ( typeof ezTOC.scroll_offset != 'undefined' ) {
|
||||
|
||||
affixOffset = parseInt( ezTOC.scroll_offset );
|
||||
}
|
||||
|
||||
$( ezTOC.affixSelector ).stick_in_parent( {
|
||||
inner_scrolling: false,
|
||||
offset_top: affixOffset
|
||||
} )
|
||||
}
|
||||
|
||||
$.fn.shrinkTOCWidth = function() {
|
||||
|
||||
$( this ).css( {
|
||||
width: 'auto',
|
||||
display: 'table'
|
||||
});
|
||||
|
||||
if ( /MSIE 7\./.test( navigator.userAgent ) )
|
||||
$( this ).css( 'width', '' );
|
||||
};
|
||||
|
||||
|
||||
if ( typeof ezTOC.visibility_hide_by_default != 'undefined' ) {
|
||||
|
||||
// Get all toggles that have not been loaded.
|
||||
var toggles = $( '.ez-toc-toggle:not(.ez-toc-loaded),.ez-toc-widget-sticky-toggle:not(.ez-toc-loaded)' );
|
||||
|
||||
var invert = ezTOC.visibility_hide_by_default;
|
||||
|
||||
$.each(toggles, function(i, obj) {
|
||||
|
||||
var toggle = $(this);
|
||||
$(toggle).addClass('ez-toc-loaded'); // Attach loaded class.
|
||||
var toc = $( toggle ).parents('#ez-toc-container,#ez-toc-widget-container,#ez-toc-widget-sticky-container').find( 'ul.ez-toc-list,ul.ez-toc-widget-sticky-list' );
|
||||
if($(toc).hasClass('eztoc-toggle-hide-by-default')){
|
||||
invert = 1;
|
||||
}
|
||||
if ( Cookies ) {
|
||||
|
||||
Cookies.get( 'ezTOC_hidetoc-' + i ) == 1 ? $(toggle).data( 'visible', false ) : $(toggle).data( 'visible', true );
|
||||
Cookies.remove('ezTOC_hidetoc-' + i)
|
||||
|
||||
} else {
|
||||
|
||||
$(toggle).data( 'visible', true );
|
||||
Cookies.remove('ezTOC_hidetoc-' + i);
|
||||
}
|
||||
|
||||
if ( invert ) {
|
||||
|
||||
$(toggle).data( 'visible', false )
|
||||
}
|
||||
|
||||
if ( ! $(toggle).data( 'visible' ) ) {
|
||||
|
||||
toc.hide();
|
||||
}
|
||||
|
||||
$(toggle).on( 'click', function( event ) {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
const main = document.querySelector("#ez-toc-container");
|
||||
if(main){
|
||||
main.classList.toggle("toc_close");
|
||||
}
|
||||
else
|
||||
{
|
||||
const side = document.querySelector(".ez-toc-widget-container,.ez-toc-widget-sticky-container");
|
||||
side.classList.toggle("toc_close");
|
||||
}
|
||||
|
||||
if ( $( this ).data( 'visible' ) ) {
|
||||
|
||||
$( this ).data( 'visible', false );
|
||||
|
||||
if ( Cookies ) {
|
||||
|
||||
if ( invert )
|
||||
Cookies.set( 'ezTOC_hidetoc-' + i, null, { path: '/' } );
|
||||
else
|
||||
Cookies.set( 'ezTOC_hidetoc-' + i, '1', { expires: 30, path: '/' } );
|
||||
}
|
||||
|
||||
toc.hide( 'fast' );
|
||||
|
||||
} else {
|
||||
|
||||
$( this ).data( 'visible', true );
|
||||
|
||||
if ( Cookies ) {
|
||||
|
||||
if ( invert )
|
||||
Cookies.set( 'ezTOC_hidetoc-' + i, '1', { expires: 30, path: '/' } );
|
||||
else
|
||||
Cookies.set( 'ezTOC_hidetoc-' + i, null, { path: '/' } );
|
||||
}
|
||||
|
||||
toc.show( 'fast' );
|
||||
|
||||
}
|
||||
|
||||
} );
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// ======================================
|
||||
// Set active heading in ez-toc-widget list
|
||||
// ======================================
|
||||
|
||||
var headings = $( 'span.ez-toc-section' ).toArray();
|
||||
var headingToListElementLinkMap = getHeadingToListElementLinkMap( headings );
|
||||
var listElementLinks = $.map( headingToListElementLinkMap, function ( value, key ) {
|
||||
return value
|
||||
} );
|
||||
var scrollOffset = getScrollOffset();
|
||||
|
||||
activateSetActiveEzTocListElement();
|
||||
|
||||
function setActiveEzTocListElement() {
|
||||
var activeHeading = getActiveHeading( scrollOffset, headings );
|
||||
if ( activeHeading ) {
|
||||
var activeListElementLink = headingToListElementLinkMap[ activeHeading.id ];
|
||||
removeStyleFromNonActiveListElement( activeListElementLink, listElementLinks );
|
||||
setStyleForActiveListElementElement( activeListElementLink );
|
||||
}
|
||||
}
|
||||
|
||||
function activateSetActiveEzTocListElement() {
|
||||
if ( headings.length > 0 && $('.ez-toc-widget-container').length) {
|
||||
$( window ).on( 'load resize scroll', setActiveEzTocListElement );
|
||||
}
|
||||
}
|
||||
|
||||
function deactivateSetActiveEzTocListElement() {
|
||||
$( window ).off( 'load resize scroll', setActiveEzTocListElement );
|
||||
}
|
||||
|
||||
function getEzTocListElementLinkByHeading( heading ) {
|
||||
return $( '.ez-toc-widget-container .ez-toc-list a[href="#' + $( heading ).attr( 'id' ) + '"]' );
|
||||
}
|
||||
|
||||
function getHeadingToListElementLinkMap( headings ) {
|
||||
return headings.reduce( function ( map, heading ) {
|
||||
map[ heading.id ] = getEzTocListElementLinkByHeading( heading );
|
||||
return map;
|
||||
}, {} );
|
||||
}
|
||||
|
||||
function getScrollOffset() {
|
||||
var scrollOffset = 5; // so if smooth offset is off, the correct title is set as active
|
||||
if ( typeof ezTOC.smooth_scroll != 'undefined' && parseInt( ezTOC.smooth_scroll ) === 1 ) {
|
||||
scrollOffset = ( typeof ezTOC.scroll_offset != 'undefined' ) ? parseInt( ezTOC.scroll_offset ) : 30;
|
||||
}
|
||||
|
||||
var adminbar = $( '#wpadminbar' );
|
||||
|
||||
if ( adminbar.length ) {
|
||||
scrollOffset += adminbar.height();
|
||||
}
|
||||
return scrollOffset;
|
||||
}
|
||||
|
||||
function getActiveHeading( topOffset, headings ) {
|
||||
var scrollTop = $( window ).scrollTop();
|
||||
var relevantOffset = scrollTop + topOffset + 1;
|
||||
var activeHeading = headings[ 0 ];
|
||||
var closestHeadingAboveOffset = relevantOffset - $( activeHeading ).offset().top;
|
||||
headings.forEach( function ( section ) {
|
||||
var topOffset = relevantOffset - $( section ).offset().top;
|
||||
if ( topOffset > 0 && topOffset < closestHeadingAboveOffset ) {
|
||||
closestHeadingAboveOffset = topOffset;
|
||||
activeHeading = section;
|
||||
}
|
||||
} );
|
||||
return activeHeading;
|
||||
}
|
||||
|
||||
function removeStyleFromNonActiveListElement( activeListElementLink, listElementLinks ) {
|
||||
listElementLinks.forEach( function ( listElementLink ) {
|
||||
if ( activeListElementLink !== listElementLink && listElementLink.parent().hasClass( 'active' ) ) {
|
||||
listElementLink.parent().removeClass( 'active' );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
function correctActiveListElementBackgroundColorHeight( activeListElement ) {
|
||||
var listElementHeight = getListElementHeightWithoutUlChildren( activeListElement );
|
||||
addListElementBackgroundColorHeightStyleToHead( listElementHeight );
|
||||
}
|
||||
|
||||
function getListElementHeightWithoutUlChildren( listElement ) {
|
||||
var $listElement = $( listElement );
|
||||
var content = $listElement.html();
|
||||
// Adding list item with class '.active' to get the real height.
|
||||
// When adding a class to an existing element and using jQuery(..).height() directly afterwards,
|
||||
// the height is the 'old' height. The height might change due to text-wraps when setting the text-weight bold for example
|
||||
// When adding a new item, the height is calculated correctly.
|
||||
// But only when it might be visible (so display:none; is not possible...)
|
||||
// But because it get's directly removed afterwards it never will be rendered by the browser
|
||||
// (at least in my tests in FF, Chrome, IE11 and Edge)
|
||||
$listElement.parent().append( '<li id="ez-toc-height-test" class="active">' + content + '</li>' );
|
||||
var listItem = $( '#ez-toc-height-test' );
|
||||
var height = listItem.height();
|
||||
listItem.remove();
|
||||
return height - ($listElement.children( 'ul' ).first().height() || 0);
|
||||
}
|
||||
|
||||
function addListElementBackgroundColorHeightStyleToHead( listElementHeight ) {
|
||||
// Remove existing
|
||||
//$( '#ez-toc-active-height' ).remove();
|
||||
// jQuery(..).css(..) doesn't work, because ::before is a pseudo element and not part of the DOM
|
||||
// Workaround is to add it to head
|
||||
// $( '<style id="ez-toc-active-height">.ez-toc-widget-container ul.ez-toc-list li.active {height:' + listElementHeight + 'px;' + '} </style>' ).appendTo( 'head' );
|
||||
$( '.ez-toc-widget-container ul.ez-toc-list li.active' ).css( 'height',listElementHeight + 'px' );
|
||||
}
|
||||
|
||||
function setStyleForActiveListElementElement( activeListElementLink ) {
|
||||
var activeListElement = activeListElementLink.parent();
|
||||
if ( !activeListElement.hasClass( 'active' ) ) {
|
||||
activeListElement.addClass( 'active' );
|
||||
}
|
||||
correctActiveListElementBackgroundColorHeight( activeListElement );
|
||||
}
|
||||
}
|
||||
if($( '#ez-toc-container').length){
|
||||
if(!$( '#ez-toc-container .ez-toc-toggle label span').html()){
|
||||
$( '#ez-toc-container .ez-toc-toggle label').html(ezTOC.fallbackIcon);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach global init handler to ezTOC window object.
|
||||
*/
|
||||
ezTOC.init = function(){
|
||||
ezTOCInit();
|
||||
}
|
||||
// Start EZ TOC on page load.
|
||||
ezTOCInit();
|
||||
|
||||
if ( typeof ezTOC.ajax_toggle != 'undefined' && parseInt( ezTOC.ajax_toggle ) === 1 ) {
|
||||
$( document ).ajaxComplete(function() {
|
||||
ezTOCInit();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
$("#ez-toc-more-links-enabler").click(function () {
|
||||
$(".ez-toc-more-link").show();
|
||||
$("#ez-toc-more-links-enabler").hide();
|
||||
$("#ez-toc-more-links-disabler").attr("style","display:inline-block");
|
||||
});
|
||||
$("#ez-toc-more-links-disabler").click(function () {
|
||||
$(".ez-toc-more-link").hide();
|
||||
$("#ez-toc-more-links-enabler").show();
|
||||
$("#ez-toc-more-links-disabler").hide();
|
||||
});
|
||||
|
||||
$(document).on('click', '#ez-toc-open-sub-hd', function(e) {
|
||||
$(this).attr("id","ez-toc-open-sub-hd-active");
|
||||
e.preventDefault();
|
||||
});
|
||||
$(document).on('click', '#ez-toc-open-sub-hd-active', function(e) {
|
||||
$(this).attr("id","ez-toc-open-sub-hd");
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
} );
|
1
wp-content/plugins/easy-table-of-contents/assets/js/front.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
jQuery((function(e){if("undefined"!=typeof ezTOC){function t(){if(0!==e(".ez-toc-widget-container.ez-toc-affix").length){var t=30;void 0!==ezTOC.scroll_offset&&(t=parseInt(ezTOC.scroll_offset)),e(ezTOC.affixSelector).stick_in_parent({inner_scrolling:!1,offset_top:t})}if(e.fn.shrinkTOCWidth=function(){e(this).css({width:"auto",display:"table"}),/MSIE 7\./.test(navigator.userAgent)&&e(this).css("width","")},void 0!==ezTOC.visibility_hide_by_default){var o=e(".ez-toc-toggle:not(.ez-toc-loaded),.ez-toc-widget-sticky-toggle:not(.ez-toc-loaded)"),i=ezTOC.visibility_hide_by_default;e.each(o,(function(t,o){var n=e(this);e(n).addClass("ez-toc-loaded");var c=e(n).parents("#ez-toc-container,#ez-toc-widget-container,#ez-toc-widget-sticky-container").find("ul.ez-toc-list,ul.ez-toc-widget-sticky-list");e(c).hasClass("eztoc-toggle-hide-by-default")&&(i=1),Cookies?(1==Cookies.get("ezTOC_hidetoc-"+t)?e(n).data("visible",!1):e(n).data("visible",!0),Cookies.remove("ezTOC_hidetoc-"+t)):(e(n).data("visible",!0),Cookies.remove("ezTOC_hidetoc-"+t)),i&&e(n).data("visible",!1),e(n).data("visible")||c.hide(),e(n).on("click",(function(o){o.preventDefault();const n=document.querySelector("#ez-toc-container");if(n)n.classList.toggle("toc_close");else{document.querySelector(".ez-toc-widget-container,.ez-toc-widget-sticky-container").classList.toggle("toc_close")}e(this).data("visible")?(e(this).data("visible",!1),Cookies&&(i?Cookies.set("ezTOC_hidetoc-"+t,null,{path:"/"}):Cookies.set("ezTOC_hidetoc-"+t,"1",{expires:30,path:"/"})),c.hide("fast")):(e(this).data("visible",!0),Cookies&&(i?Cookies.set("ezTOC_hidetoc-"+t,"1",{expires:30,path:"/"}):Cookies.set("ezTOC_hidetoc-"+t,null,{path:"/"})),c.show("fast"))}))}))}var n=e("span.ez-toc-section").toArray(),c=function(t){return t.reduce((function(t,o){return t[o.id]=function(t){return e('.ez-toc-widget-container .ez-toc-list a[href="#'+e(t).attr("id")+'"]')}(o),t}),{})}(n),a=e.map(c,(function(e,t){return e})),s=function(){var t=5;void 0!==ezTOC.smooth_scroll&&1===parseInt(ezTOC.smooth_scroll)&&(t=void 0!==ezTOC.scroll_offset?parseInt(ezTOC.scroll_offset):30);var o=e("#wpadminbar");o.length&&(t+=o.height());return t}();function l(){var t=function(t,o){var i=e(window).scrollTop()+t+1,n=o[0],c=i-e(n).offset().top;return o.forEach((function(t){var o=i-e(t).offset().top;o>0&&o<c&&(c=o,n=t)})),n}(s,n);if(t){var o=c[t.id];!function(e,t){t.forEach((function(t){e!==t&&t.parent().hasClass("active")&&t.parent().removeClass("active")}))}(o,a),function(t){var o=t.parent();o.hasClass("active")||o.addClass("active");!function(t){var o=function(t){var o=e(t),i=o.html();o.parent().append('<li id="ez-toc-height-test" class="active">'+i+"</li>");var n=e("#ez-toc-height-test"),c=n.height();return n.remove(),c-(o.children("ul").first().height()||0)}(t);!function(t){e(".ez-toc-widget-container ul.ez-toc-list li.active").css("height",t+"px")}(o)}(o)}(o)}}n.length>0&&e(".ez-toc-widget-container").length&&e(window).on("load resize scroll",l)}e("#ez-toc-container").length&&(e("#ez-toc-container .ez-toc-toggle label span").html()||e("#ez-toc-container .ez-toc-toggle label").html(ezTOC.fallbackIcon)),ezTOC.init=function(){t()},t(),void 0!==ezTOC.ajax_toggle&&1===parseInt(ezTOC.ajax_toggle)&&e(document).ajaxComplete((function(){t()}))}e("#ez-toc-more-links-enabler").click((function(){e(".ez-toc-more-link").show(),e("#ez-toc-more-links-enabler").hide(),e("#ez-toc-more-links-disabler").attr("style","display:inline-block")})),e("#ez-toc-more-links-disabler").click((function(){e(".ez-toc-more-link").hide(),e("#ez-toc-more-links-enabler").show(),e("#ez-toc-more-links-disabler").hide()})),e(document).on("click","#ez-toc-open-sub-hd",(function(t){e(this).attr("id","ez-toc-open-sub-hd-active"),t.preventDefault()})),e(document).on("click","#ez-toc-open-sub-hd-active",(function(t){e(this).attr("id","ez-toc-open-sub-hd"),t.preventDefault()}))}));
|
@ -0,0 +1,35 @@
|
||||
jQuery(document).ready((function() {
|
||||
var e = !1;
|
||||
void 0 !== eztoc_smooth_local.JumpJsLinks && 1 === parseInt(eztoc_smooth_local.JumpJsLinks) && (e = !0), document.querySelectorAll(".ez-toc-link").forEach((e => {
|
||||
e = e.replaceWith(e.cloneNode(!0))
|
||||
})), document.querySelectorAll(".ez-toc-section").forEach((e => {
|
||||
e.setAttribute("ez-toc-data-id", "#" + decodeURI(e.getAttribute("id")))
|
||||
})), jQuery("a.ez-toc-link").click((function() {
|
||||
|
||||
let dhref = jQuery(this).attr("data-href");
|
||||
let ahref = jQuery(this).attr("href");
|
||||
|
||||
if(1 === parseInt(eztoc_smooth_local.add_request_uri)){
|
||||
if(jQuery(this).attr("data-href")){
|
||||
let dsplit = jQuery(this).attr("data-href").split("#");
|
||||
if(dsplit && dsplit.length > 1){
|
||||
dhref = `#${dsplit[1]}`;
|
||||
}
|
||||
}
|
||||
if(jQuery(this).attr("href")){
|
||||
let asplit = jQuery(this).attr("href").split("#");
|
||||
if(asplit && asplit.length > 1){
|
||||
ahref = `#${asplit[1]}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let t = e ? dhref : ahref,
|
||||
o = jQuery("#wpadminbar"),
|
||||
c = jQuery("header"),
|
||||
r = 0;
|
||||
if (parseInt(eztoc_smooth_local.scroll_offset) > 30 && (r = parseInt(eztoc_smooth_local.scroll_offset)), o.length && (r += o.height()), (c.length && "fixed" == c.css("position") || "sticky" == c.css("position")) && (r += c.height()), jQuery('[ez-toc-data-id="' + decodeURI(t) + '"]').length > 0 && (r = jQuery('[ez-toc-data-id="' + decodeURI(t) + '"]').offset().top - r), jQuery("html, body").animate({
|
||||
scrollTop: r
|
||||
}, 500), e) return !1
|
||||
}))
|
||||
}));
|
1
wp-content/plugins/easy-table-of-contents/assets/js/smooth_scroll.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
jQuery(document).ready(function(){var t=!1;void 0!==eztoc_smooth_local.JumpJsLinks&&1===parseInt(eztoc_smooth_local.JumpJsLinks)&&(t=!0),document.querySelectorAll(".ez-toc-link").forEach(t=>{t=t.replaceWith(t.cloneNode(!0))}),document.querySelectorAll(".ez-toc-section").forEach(t=>{t.setAttribute("ez-toc-data-id","#"+decodeURI(t.getAttribute("id")))}),jQuery("a.ez-toc-link").click(function(){let e=jQuery(this).attr("data-href"),i=jQuery(this).attr("href");if(1===parseInt(eztoc_smooth_local.add_request_uri)){if(jQuery(this).attr("data-href")){let r=jQuery(this).attr("data-href").split("#");r&&r.length>1&&(e=`#${r[1]}`)}if(jQuery(this).attr("href")){let a=jQuery(this).attr("href").split("#");a&&a.length>1&&(i=`#${a[1]}`)}}let l=t?e:i,o=jQuery("#wpadminbar"),s=jQuery("header"),h=0;if(parseInt(eztoc_smooth_local.scroll_offset)>30&&(h=parseInt(eztoc_smooth_local.scroll_offset)),o.length&&(h+=o.height()),(s.length&&"fixed"==s.css("position")||"sticky"==s.css("position"))&&(h+=s.height()),jQuery('[ez-toc-data-id="'+decodeURI(l)+'"]').length>0&&(h=jQuery('[ez-toc-data-id="'+decodeURI(l)+'"]').offset().top-h),jQuery("html, body").animate({scrollTop:h},500),t)return!1})});
|
@ -0,0 +1,12 @@
|
||||
(function() {
|
||||
tinymce.PluginManager.add('toc_mce_button', function( editor, url ) {
|
||||
editor.addButton('toc_mce_button', {
|
||||
text: 'TOC',
|
||||
icon: false,
|
||||
onclick: function() {
|
||||
// change the shortcode as per your requirement
|
||||
editor.insertContent('[ez-toc]');
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
After Width: | Height: | Size: 20 KiB |
BIN
wp-content/plugins/easy-table-of-contents/assets/right-tick.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
wp-content/plugins/easy-table-of-contents/assets/sanjeev.jpg
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
wp-content/plugins/easy-table-of-contents/assets/toc-rating.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
1838
wp-content/plugins/easy-table-of-contents/easy-table-of-contents.php
Normal file
180
wp-content/plugins/easy-table-of-contents/includes/Debug.php
Normal file
@ -0,0 +1,180 @@
|
||||
<?php
|
||||
|
||||
namespace Easy_Plugins\Table_Of_Contents;
|
||||
|
||||
use WP_Error;
|
||||
|
||||
/**
|
||||
* Class Debug
|
||||
*
|
||||
* @package Easy_Plugins\Table_Of_Contents
|
||||
*/
|
||||
final class Debug extends WP_Error {
|
||||
|
||||
/**
|
||||
* @since 2.0.13
|
||||
* @var bool
|
||||
*/
|
||||
protected $display = false;
|
||||
|
||||
/**
|
||||
* @since 2.0.13
|
||||
* @var bool
|
||||
*/
|
||||
protected $enabled = false;
|
||||
|
||||
/**
|
||||
* @var self
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Debug constructor.
|
||||
*
|
||||
* @since 2.0.13
|
||||
*
|
||||
* @param string $code
|
||||
* @param string $message
|
||||
* @param string $data
|
||||
*/
|
||||
public function __construct( $code = '', $message = '', $data = '' ) {
|
||||
|
||||
parent::__construct( $code, $message, $data );
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.0.14
|
||||
*
|
||||
* @param string $code
|
||||
* @param string $message
|
||||
* @param string $data
|
||||
*
|
||||
* @return Debug
|
||||
*/
|
||||
public static function log( $code = '', $message = '', $data = '' ) {
|
||||
|
||||
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
|
||||
|
||||
self::$instance = new self( $code, $message, $data );
|
||||
|
||||
self::$instance->display = apply_filters(
|
||||
'Easy_Plugins/Table_Of_Contents/Debug/Display',
|
||||
defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY
|
||||
);
|
||||
|
||||
self::$instance->enabled = apply_filters(
|
||||
'Easy_Plugins/Table_Of_Contents/Debug/Enabled',
|
||||
( defined( 'WP_DEBUG' ) && WP_DEBUG ) && current_user_can( 'manage_options' )
|
||||
);
|
||||
|
||||
} else {
|
||||
|
||||
if ( ! empty( $code ) && ! empty( $message ) ) {
|
||||
|
||||
self::$instance->add( $code, $message, $data );
|
||||
}
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an error or appends an additional message to an existing error.
|
||||
*
|
||||
* NOTE: Overrides WP_Error::add() to allow support of passing `false` as `$data`.
|
||||
*
|
||||
* @since 2.0.14
|
||||
*
|
||||
* @param string|int $code Error code.
|
||||
* @param string $message Error message.
|
||||
* @param mixed $data Optional. Error data.
|
||||
*/
|
||||
public function add( $code, $message, $data = null ) {
|
||||
$this->errors[ $code ][] = $message;
|
||||
|
||||
if ( ! is_null( $data ) ) {
|
||||
$this->add_data( $data, $code );
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires when an error is added to a WP_Error object.
|
||||
*
|
||||
* @since 5.6.0
|
||||
*
|
||||
* @param string|int $code Error code.
|
||||
* @param string $message Error message.
|
||||
* @param mixed $data Error data. Might be empty.
|
||||
* @param WP_Error $wp_error The WP_Error object.
|
||||
*/
|
||||
do_action( 'wp_error_added', $code, $message, $data, $this );
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.0.13
|
||||
*
|
||||
* @param string $content
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function appendTo( $content = '' ) {
|
||||
|
||||
return $content . $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.0.13
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function dump() {
|
||||
|
||||
$dump = array();
|
||||
|
||||
foreach ( (array) $this->errors as $code => $messages ) {
|
||||
|
||||
$data = $this->get_error_data( $code );
|
||||
$data = is_string( $data ) ? $data : '<code>' . var_export( $data, true ) . '</code>';
|
||||
$data = "\t\t<li class=\"ez-toc-debug-message-data\">{$data}</li>" . PHP_EOL;
|
||||
|
||||
array_push(
|
||||
$dump,
|
||||
PHP_EOL . "\t<ul class=\"ez-toc-debug-message-{$code}\">" . PHP_EOL . "\t\t<li class=\"ez-toc-debug-message\">" . implode( '</li>' . PHP_EOL . '<li>' . PHP_EOL, $messages ) . '</li>' . PHP_EOL . "{$data}\t</ul>" . PHP_EOL
|
||||
);
|
||||
}
|
||||
|
||||
return '<div class="ez-toc-debug-message">' . implode( '</div>' . PHP_EOL . '<div class="ez-toc-debug-message">', $dump ) . '</div>' . PHP_EOL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.0.13
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString() {
|
||||
|
||||
if ( false === $this->enabled ) {
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
if ( false === $this->display ) {
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
if ( ! $this->has_errors() ) {
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
$intro = sprintf(
|
||||
'You see the following because <a href="%1$s"><code>WP_DEBUG</code></a> and <a href="%1$s"><code>WP_DEBUG_DISPLAY</code></a> are enabled on this site. Please disabled these to prevent the display of these developers\' debug messages.',
|
||||
'https://codex.wordpress.org/WP_DEBUG'
|
||||
);
|
||||
|
||||
$intro = PHP_EOL . "<p>{$intro}</p>" .PHP_EOL;
|
||||
$dump = $this->dump();
|
||||
|
||||
return PHP_EOL . "<div class='ez-toc-debug-messages'>{$intro}{$dump}</div>" . PHP_EOL;
|
||||
}
|
||||
}
|
@ -0,0 +1,935 @@
|
||||
<?php
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! class_exists( 'ezTOC_Admin' ) ) {
|
||||
|
||||
/**
|
||||
* Class ezTOC_Admin
|
||||
*/
|
||||
final class ezTOC_Admin {
|
||||
|
||||
/**
|
||||
* Setup plugin for admin use.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
* @static
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
$this->hooks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the core admin hooks.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
* @static
|
||||
*/
|
||||
private function hooks() {
|
||||
global $pagenow;
|
||||
|
||||
if($pagenow == 'options-general.php' && isset($_REQUEST['page']) && !empty($_REQUEST['page']) &&
|
||||
$_REQUEST['page'] == 'table-of-contents') {
|
||||
add_action( 'admin_head', array( $this,'_clean_other_plugins_stuff' ) );
|
||||
}
|
||||
add_action( 'admin_init', array( $this, 'registerScripts' ) );
|
||||
add_action( 'admin_menu', array( $this, 'menu' ) );
|
||||
add_action( 'init', array( $this, 'registerMetaboxes' ), 99 );
|
||||
add_filter( 'plugin_action_links_' . EZ_TOC_BASE_NAME, array( $this, 'pluginActionLinks' ), 10, 2 );
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'load_scripts' ) );
|
||||
add_action('wp_ajax_eztoc_send_query_message', array( $this, 'eztoc_send_query_message'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Attach to admin_head hook to hide all admin notices.
|
||||
*
|
||||
* @scope public
|
||||
* @since 2.0.33
|
||||
* @return void
|
||||
* @uses remove_all_actions()
|
||||
*/
|
||||
public function _clean_other_plugins_stuff()
|
||||
{
|
||||
remove_all_actions('admin_notices');
|
||||
remove_all_actions('network_admin_notices');
|
||||
remove_all_actions('all_admin_notices');
|
||||
remove_all_actions('user_admin_notices');
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to add the Settings link to the plugin action links.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
* @static
|
||||
*
|
||||
* @param $links
|
||||
* @param $file
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function pluginActionLinks( $links, $file ) {
|
||||
|
||||
$url = add_query_arg( 'page', 'table-of-contents', self_admin_url( 'options-general.php' ) );
|
||||
$setting_link = '<a href="' . esc_url( $url ) . '">' . __( 'Settings', 'easy-table-of-contents' ) . '</a> |';
|
||||
$setting_link .= '<a href="https://tocwp.com/contact/" target="_blank">' . __( ' Support', 'easy-table-of-contents' ) . '</a> |';
|
||||
$setting_link .= '<a href="https://tocwp.com/pricing/" target="_blank">' . __( ' Upgrade', 'easy-table-of-contents' ) . '</a> |';
|
||||
$setting_link .= '<a href="https://tocwp.com/" target="_blank">' . __( ' Website', 'easy-table-of-contents' ) . '</a>';
|
||||
array_push( $links, $setting_link );
|
||||
return $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the scripts used in the admin.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
* @static
|
||||
*/
|
||||
public function registerScripts() {
|
||||
$min = defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
||||
wp_register_script( 'cn_toc_admin_script', EZ_TOC_URL . "assets/js/admin$min.js", array( 'jquery', 'wp-color-picker' ), ezTOC::VERSION, true );
|
||||
wp_register_style( 'cn_toc_admin_style', EZ_TOC_URL . "assets/css/admin$min.css", array( 'wp-color-picker' ), ezTOC::VERSION );
|
||||
|
||||
wp_enqueue_script( 'cn_toc_admin_script' );
|
||||
$data = array(
|
||||
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
||||
'eztoc_security_nonce' => wp_create_nonce('eztoc_ajax_check_nonce'),
|
||||
);
|
||||
|
||||
$data = apply_filters( 'eztoc_localize_filter', $data, 'eztoc_admin_data' );
|
||||
|
||||
wp_localize_script( 'cn_toc_admin_script', 'cn_toc_admin_data', $data );
|
||||
|
||||
self::inlineAdminAMPNonJS();
|
||||
self::inlineAdminHeadingsPaddingJS();
|
||||
self::inlineAdminDisplayHeaderLabel();
|
||||
self::inlineAdminInitialView();
|
||||
}
|
||||
|
||||
/**
|
||||
* inlineAdminAMPNonJS Method
|
||||
* Prints out inline AMP Non JS.
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @since 2.0.46
|
||||
* @static
|
||||
*/
|
||||
private static function inlineAdminAMPNonJS() {
|
||||
|
||||
$isAmpActivated = false;
|
||||
if ( function_exists('ez_toc_is_amp_activated') ) {
|
||||
$isAmpActivated = ez_toc_is_amp_activated();
|
||||
}
|
||||
|
||||
if( false == $isAmpActivated ) {
|
||||
$inlineAdminAMPNonJS = <<<inlineAdminAMPNonJS
|
||||
jQuery(function($) {
|
||||
let tocAMPSupportOption = $(document).find("input[name='ez-toc-settings[toc-run-on-amp-pages]']");
|
||||
if( tocAMPSupportOption.length > 0 ) {
|
||||
$(tocAMPSupportOption).attr('disabled', true);
|
||||
}
|
||||
});
|
||||
inlineAdminAMPNonJS;
|
||||
|
||||
wp_add_inline_script( 'cn_toc_admin_script', $inlineAdminAMPNonJS );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* inlineAdminHeadingsPaddingJS Method
|
||||
* Prints out inline AMP Non JS.
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @since 2.0.48
|
||||
* @static
|
||||
*/
|
||||
private static function inlineAdminHeadingsPaddingJS() {
|
||||
|
||||
$inlineAdminHeadingsPaddingJS = <<<inlineAdminHeadingsPaddingJS
|
||||
jQuery(function($) {
|
||||
|
||||
let headingsPaddingCheckbox = $('#eztoc-appearance').find("input[name='ez-toc-settings[headings-padding]']");
|
||||
let headingsPaddingTop = $('#eztoc-appearance').find("input[name='ez-toc-settings[headings-padding-top]']");
|
||||
let headingsPaddingBottom = $('#eztoc-appearance').find("input[name='ez-toc-settings[headings-padding-bottom]']");
|
||||
let headingsPaddingLeft = $('#eztoc-appearance').find("input[name='ez-toc-settings[headings-padding-left]']");
|
||||
let headingsPaddingRight = $('#eztoc-appearance').find("input[name='ez-toc-settings[headings-padding-right]']");
|
||||
|
||||
let headingsPaddingTopHTML = $(headingsPaddingTop).parent();
|
||||
$(headingsPaddingTopHTML).find("input[name='ez-toc-settings[headings-padding-top]']").attr("type", "number");
|
||||
$(headingsPaddingTop).parents('tr').remove();
|
||||
$(headingsPaddingCheckbox).parent().append("<br/><br/><span id='headings-padding-top-container'><label for='ez-toc-settings[headings-padding-top]'><strong>Top</strong></label> " + $(headingsPaddingTopHTML).html() + "</span>");
|
||||
$('#eztoc-appearance').find("select[name='ez-toc-settings[headings-padding-top_units]']").html('<option value="px" selected="selected">px</option>');
|
||||
|
||||
|
||||
let headingsPaddingBottomHTML = $(headingsPaddingBottom).parent();
|
||||
$(headingsPaddingBottomHTML).find("input[name='ez-toc-settings[headings-padding-bottom]']").attr("type", "number");
|
||||
$(headingsPaddingBottom).parents('tr').remove();
|
||||
$(headingsPaddingCheckbox).parent().append(" <span id='headings-padding-bottom-container'><label for='ez-toc-settings[headings-padding-bottom]'><strong>Bottom</strong></label> " + $(headingsPaddingBottomHTML).html() + "</span>");
|
||||
$('#eztoc-appearance').find("select[name='ez-toc-settings[headings-padding-bottom_units]']").html('<option value="px" selected="selected">px</option>');
|
||||
|
||||
let headingsPaddingLeftHTML = $(headingsPaddingLeft).parent();
|
||||
$(headingsPaddingLeftHTML).find("input[name='ez-toc-settings[headings-padding-left]']").attr("type", "number");
|
||||
$(headingsPaddingLeft).parents('tr').remove();
|
||||
$(headingsPaddingCheckbox).parent().append(" <span id='headings-padding-left-container'><label for='ez-toc-settings[headings-padding-left]'><strong>Left</strong></label> " + $(headingsPaddingLeftHTML).html() + "</span>");
|
||||
$('#eztoc-appearance').find("select[name='ez-toc-settings[headings-padding-left_units]']").html('<option value="px" selected="selected">px</option>');
|
||||
|
||||
let headingsPaddingRightHTML = $(headingsPaddingRight).parent();
|
||||
$(headingsPaddingRightHTML).find("input[name='ez-toc-settings[headings-padding-right]']").attr("type", "number");
|
||||
$(headingsPaddingRight).parents('tr').remove();
|
||||
$(headingsPaddingCheckbox).parent().append(" <span id='headings-padding-right-container'><label for='ez-toc-settings[headings-padding-right]'><strong>Right</strong></label> " + $(headingsPaddingRightHTML).html() + "</span>");
|
||||
$('#eztoc-appearance').find("select[name='ez-toc-settings[headings-padding-right_units]']").html('<option value="px" selected="selected">px</option>');
|
||||
|
||||
let headingsPaddingContainerTop = $('#eztoc-appearance').find("span#headings-padding-top-container");
|
||||
let headingsPaddingContainerBottom = $('#eztoc-appearance').find("span#headings-padding-bottom-container");
|
||||
let headingsPaddingContainerLeft = $('#eztoc-appearance').find("span#headings-padding-left-container");
|
||||
let headingsPaddingContainerRight = $('#eztoc-appearance').find("span#headings-padding-right-container");
|
||||
|
||||
if($(headingsPaddingCheckbox).prop('checked') == false) {
|
||||
$(headingsPaddingContainerTop).hide(500);
|
||||
$(headingsPaddingContainerBottom).hide(500);
|
||||
$(headingsPaddingContainerLeft).hide(500);
|
||||
$(headingsPaddingContainerRight).hide(500);
|
||||
$(headingsPaddingTop).val(0);
|
||||
$(headingsPaddingBottom).val(0);
|
||||
$(headingsPaddingLeft).val(0);
|
||||
$(headingsPaddingRight).val(0);
|
||||
}
|
||||
|
||||
$(document).on("change, click", "input[name='ez-toc-settings[headings-padding]']", function() {
|
||||
if($(headingsPaddingCheckbox).prop('checked') == true) {
|
||||
$(headingsPaddingContainerTop).show(500);
|
||||
$(headingsPaddingContainerBottom).show(500);
|
||||
$(headingsPaddingContainerLeft).show(500);
|
||||
$(headingsPaddingContainerRight).show(500);
|
||||
} else {
|
||||
$(headingsPaddingContainerTop).hide(500);
|
||||
$(headingsPaddingContainerBottom).hide(500);
|
||||
$(headingsPaddingContainerLeft).hide(500);
|
||||
$(headingsPaddingContainerRight).hide(500);
|
||||
$(headingsPaddingTop).val(0);
|
||||
$(headingsPaddingBottom).val(0);
|
||||
$(headingsPaddingLeft).val(0);
|
||||
$(headingsPaddingRight).val(0);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
inlineAdminHeadingsPaddingJS;
|
||||
|
||||
wp_add_inline_script( 'cn_toc_admin_script', $inlineAdminHeadingsPaddingJS );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* inlineAdminDisplayHeaderLabel Method
|
||||
* Prints out inline AMP Non JS.
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @since 2.0.51
|
||||
* @static
|
||||
*/
|
||||
private static function inlineAdminDisplayHeaderLabel() {
|
||||
|
||||
$inlineAdminDisplayHeaderLabel = <<<inlineAdminDisplayHeaderLabel
|
||||
jQuery(function($) {
|
||||
|
||||
let showHeadingText = $('#eztoc-general').find("input[name='ez-toc-settings[show_heading_text]']");
|
||||
let visiblityOnHeaderText = $('#eztoc-general').find("input[name='ez-toc-settings[visibility_on_header_text]']");
|
||||
let headerText = $('#eztoc-general').find("input[name='ez-toc-settings[heading_text]']");
|
||||
|
||||
if($(showHeadingText).prop('checked') == false) {
|
||||
$(visiblityOnHeaderText).parents('tr').hide(500);
|
||||
$(headerText).parents('tr').hide(500);
|
||||
}
|
||||
|
||||
$(document).on("change, click", "input[name='ez-toc-settings[show_heading_text]']", function() {
|
||||
|
||||
if($(this).prop('checked') == true) {
|
||||
$(visiblityOnHeaderText).parents('tr').show(500);
|
||||
$(headerText).parents('tr').show(500);
|
||||
} else {
|
||||
$(visiblityOnHeaderText).parents('tr').hide(500);
|
||||
$(headerText).parents('tr').hide(500);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
inlineAdminDisplayHeaderLabel;
|
||||
|
||||
wp_add_inline_script( 'cn_toc_admin_script', $inlineAdminDisplayHeaderLabel );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* inlineAdminInitialView Method
|
||||
* Prints out inline AMP Non JS.
|
||||
*
|
||||
* @access private
|
||||
* @return void
|
||||
* @since 2.0.51
|
||||
* @static
|
||||
*/
|
||||
private static function inlineAdminInitialView() {
|
||||
|
||||
$inlineAdminInitialView = <<<inlineAdminInitialView
|
||||
jQuery(function($) {
|
||||
|
||||
let visibility = $('#eztoc-general').find("input[name='ez-toc-settings[visibility]']");
|
||||
let visiblityHideByDefault = $('#eztoc-general').find("input[name='ez-toc-settings[visibility_hide_by_default]']");
|
||||
|
||||
if($(visibility).prop('checked') == false) {
|
||||
$(visiblityHideByDefault).parents('tr').hide(500);
|
||||
}
|
||||
|
||||
$(document).on("change, click", "input[name='ez-toc-settings[visibility]']", function() {
|
||||
|
||||
if($(this).prop('checked') == true) {
|
||||
$(visiblityHideByDefault).parents('tr').show(500);
|
||||
} else {
|
||||
$(visiblityHideByDefault).parents('tr').hide(500);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
inlineAdminInitialView;
|
||||
|
||||
wp_add_inline_script( 'cn_toc_admin_script', $inlineAdminInitialView );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to add plugin as a submenu page of the Options page.
|
||||
*
|
||||
* This also adds the action to enqueue the scripts to be loaded on plugin's admin pages only.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
* @static
|
||||
*/
|
||||
public function menu() {
|
||||
|
||||
$page = add_submenu_page(
|
||||
'options-general.php',
|
||||
esc_html__( 'Table of Contents', 'easy-table-of-contents' ),
|
||||
esc_html__( 'Table of Contents', 'easy-table-of-contents' ),
|
||||
'manage_options',
|
||||
'table-of-contents',
|
||||
array( $this, 'page' )
|
||||
);
|
||||
|
||||
add_action( 'admin_print_styles-' . $page, array( $this, 'enqueueScripts' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue the scripts.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
* @static
|
||||
*/
|
||||
public function enqueueScripts() {
|
||||
|
||||
wp_enqueue_script( 'cn_toc_admin_script' );
|
||||
wp_enqueue_style( 'cn_toc_admin_style' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to add the action which will register the table of contents post metaboxes.
|
||||
*
|
||||
* Metaboxes will only be registered for the post types per user preferences.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
* @static
|
||||
*/
|
||||
public function registerMetaboxes() {
|
||||
if(apply_filters('ez_toc_register_metaboxes_flag', true)){
|
||||
foreach ( get_post_types() as $type ) {
|
||||
|
||||
if ( in_array( $type, ezTOC_Option::get( 'enabled_post_types', array() ) ) ) {
|
||||
|
||||
add_action( "add_meta_boxes_$type", array( $this, 'metabox' ) );
|
||||
add_action( "save_post_$type", array( $this, 'save' ), 10, 3 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to register the table of contents metaboxes.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
* @static
|
||||
*/
|
||||
public function metabox() {
|
||||
|
||||
add_meta_box( 'ez-toc', esc_html__( 'Table of Contents', 'easy-table-of-contents' ), array( $this, 'displayMetabox' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to render the content of the table of contents metaboxes.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
* @static
|
||||
*
|
||||
* @param object $post The post object.
|
||||
* @param $atts
|
||||
*/
|
||||
public function displayMetabox( $post, $atts ) {
|
||||
|
||||
// Add an nonce field so we can check for it on save.
|
||||
wp_nonce_field( 'ez_toc_save', '_ez_toc_nonce' );
|
||||
|
||||
$suppress = get_post_meta( $post->ID, '_ez-toc-disabled', true ) == 1 ? true : false;
|
||||
$insert = get_post_meta( $post->ID, '_ez-toc-insert', true ) == 1 ? true : false;
|
||||
$header_label = get_post_meta( $post->ID, '_ez-toc-header-label', true );
|
||||
$alignment = get_post_meta( $post->ID, '_ez-toc-alignment', true );
|
||||
$headings = get_post_meta( $post->ID, '_ez-toc-heading-levels', true );
|
||||
$exclude = get_post_meta( $post->ID, '_ez-toc-exclude', true );
|
||||
$altText = get_post_meta( $post->ID, '_ez-toc-alttext', true );
|
||||
$initial_view = get_post_meta( $post->ID, '_ez-toc-visibility_hide_by_default', true );
|
||||
$hide_counter = get_post_meta( $post->ID, '_ez-toc-hide_counter', true );
|
||||
|
||||
if ( ! is_array( $headings ) ) {
|
||||
|
||||
$headings = array();
|
||||
}
|
||||
?>
|
||||
|
||||
<table class="form-table">
|
||||
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td>
|
||||
|
||||
<?php if ( in_array( get_post_type( $post ), ezTOC_Option::get( 'auto_insert_post_types', array() ) ) ) :
|
||||
|
||||
ezTOC_Option::checkbox(
|
||||
array(
|
||||
'id' => 'disabled-toc',
|
||||
'desc' => esc_html__( 'Disable the automatic insertion of the table of contents.', 'easy-table-of-contents' ),
|
||||
'default' => $suppress,
|
||||
),
|
||||
$suppress
|
||||
);
|
||||
|
||||
elseif( in_array( get_post_type( $post ), ezTOC_Option::get( 'enabled_post_types', array() ) ) ):
|
||||
|
||||
ezTOC_Option::checkbox(
|
||||
array(
|
||||
'id' => 'insert-toc',
|
||||
'desc' => esc_html__( 'Insert table of contents.', 'easy-table-of-contents' ),
|
||||
'default' => $insert,
|
||||
),
|
||||
$insert
|
||||
);
|
||||
|
||||
endif; ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e( 'Header Label', 'easy-table-of-contents' ); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
ezTOC_Option::text(
|
||||
array(
|
||||
'id' => 'header-label',
|
||||
'desc' => '<br>'.__( 'Eg: Contents, Table of Contents, Page Contents', 'easy-table-of-contents' ),
|
||||
'default' => $header_label,
|
||||
),
|
||||
$header_label
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e( 'Appearance:', 'easy-table-of-contents' ); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
ezTOC_Option::descriptive_text(
|
||||
array(
|
||||
'id' => 'appearance-desc',
|
||||
'desc' => '<p><strong>' . esc_html__( 'NOTE:', 'easy-table-of-contents' ) . '</strong></p>' .
|
||||
'<ul>' .
|
||||
'<li>' . esc_html__( 'Using the appearance options below will override the global Appearance settings.', 'easy-table-of-contents' ) . '</li>' .
|
||||
'</ul>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e( 'Alignment', 'easy-table-of-contents' ); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
ezTOC_Option::select(
|
||||
array(
|
||||
'id' => 'toc-alignment',
|
||||
'options' => array(
|
||||
'none' => __( 'None (Default)', 'easy-table-of-contents' ),
|
||||
'left' => __( 'Left', 'easy-table-of-contents' ),
|
||||
'right' => __( 'Right', 'easy-table-of-contents' ),
|
||||
'center' => __( 'Center', 'easy-table-of-contents' ),
|
||||
),
|
||||
'default' => $alignment,
|
||||
),
|
||||
$alignment
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e( 'Advanced:', 'easy-table-of-contents' ); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
ezTOC_Option::descriptive_text(
|
||||
array(
|
||||
'id' => 'exclude-desc',
|
||||
'name' => '',
|
||||
'desc' => '<p><strong>' . esc_html__( 'NOTE:', 'easy-table-of-contents' ) . '</strong></p>' .
|
||||
'<ul>' .
|
||||
'<li>' . esc_html__( 'Using the advanced options below will override the global advanced settings.', 'easy-table-of-contents' ) . '</li>' .
|
||||
'</ul>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e( 'Headings:', 'easy-table-of-contents' ); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
ezTOC_Option::checkboxgroup(
|
||||
array(
|
||||
'id' => 'heading-levels',
|
||||
'desc' => esc_html__( 'Select the heading to consider when generating the table of contents. Deselecting a heading will exclude it.', 'easy-table-of-contents' ),
|
||||
'options' => array(
|
||||
'1' => __( 'Heading 1 (h1)', 'easy-table-of-contents' ),
|
||||
'2' => __( 'Heading 2 (h2)', 'easy-table-of-contents' ),
|
||||
'3' => __( 'Heading 3 (h3)', 'easy-table-of-contents' ),
|
||||
'4' => __( 'Heading 4 (h4)', 'easy-table-of-contents' ),
|
||||
'5' => __( 'Heading 5 (h5)', 'easy-table-of-contents' ),
|
||||
'6' => __( 'Heading 6 (h6)', 'easy-table-of-contents' ),
|
||||
),
|
||||
'default' => array(),
|
||||
),
|
||||
array_map( 'absint', $headings )
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e( 'Initial View', 'easy-table-of-contents' ); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
ezTOC_Option::checkbox(
|
||||
array(
|
||||
'id' => 'visibility_hide_by_default',
|
||||
'name' => __( 'Initial View', 'easy-table-of-contents' ),
|
||||
'desc' => __( 'Initially hide the table of contents.', 'easy-table-of-contents' ),
|
||||
'default' => false,
|
||||
),
|
||||
$initial_view
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e( 'Hide Counter', 'easy-table-of-contents' ); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
ezTOC_Option::checkbox(
|
||||
array(
|
||||
'id' => 'hide_counter',
|
||||
'name' => __( 'Hide Counter', 'easy-table-of-contents' ),
|
||||
'desc' => __( 'Do not show counters for the table of contents.', 'easy-table-of-contents' ),
|
||||
'default' => false,
|
||||
),
|
||||
$hide_counter
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e( 'Alternate Headings', 'easy-table-of-contents' ); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
ezTOC_Option::textarea(
|
||||
array(
|
||||
'id' => 'alttext',
|
||||
'desc' => __( 'Specify alternate table of contents header string. Add the header to be replaced and the alternate header on a single line separated with a pipe <code>|</code>. Put each additional original and alternate header on its own line.', 'easy-table-of-contents' ),
|
||||
'size' => 'large',
|
||||
'default' => '',
|
||||
),
|
||||
$altText
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td>
|
||||
<?php
|
||||
ezTOC_Option::descriptive_text(
|
||||
array(
|
||||
'id' => 'alttext-desc',
|
||||
'name' => '',
|
||||
'desc' => '<p><strong>' . esc_html__( 'Examples:', 'easy-table-of-contents' ) . '</strong></p>' .
|
||||
'<ul>' .
|
||||
'<li>' . __( '<code>Level [1.1]|Alternate TOC Header</code> Replaces Level [1.1] in the table of contents with Alternate TOC Header.', 'easy-table-of-contents' ) . '</li>' .
|
||||
'</ul>' .
|
||||
'<p>' . __( '<strong>Note:</strong> This is case sensitive.', 'easy-table-of-contents' ) . '</p>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php esc_html_e( 'Exclude Headings', 'easy-table-of-contents' ); ?></th>
|
||||
<td>
|
||||
<?php
|
||||
ezTOC_Option::text(
|
||||
array(
|
||||
'id' => 'exclude',
|
||||
'desc' => __( 'Specify headings to be excluded from appearing in the table of contents. Separate multiple headings with a pipe <code>|</code>. Use an asterisk <code>*</code> as a wildcard to match other text.', 'easy-table-of-contents' ),
|
||||
'size' => 'large',
|
||||
'default' => '',
|
||||
),
|
||||
$exclude
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td>
|
||||
<?php
|
||||
ezTOC_Option::descriptive_text(
|
||||
array(
|
||||
'id' => 'exclude-desc',
|
||||
'name' => '',
|
||||
'desc' => '<p><strong>' . esc_html__( 'Examples:', 'easy-table-of-contents' ) . '</strong></p>' .
|
||||
'<ul>' .
|
||||
'<li>' . __( '<code>Fruit*</code> Ignore headings starting with "Fruit".', 'easy-table-of-contents' ) . '</li>' .
|
||||
'<li>' . __( '<code>*Fruit Diet*</code> Ignore headings with "Fruit Diet" somewhere in the heading.', 'easy-table-of-contents' ) . '</li>' .
|
||||
'<li>' . __( '<code>Apple Tree|Oranges|Yellow Bananas</code> Ignore headings that are exactly "Apple Tree", "Oranges" or "Yellow Bananas".', 'easy-table-of-contents' ) . '</li>' .
|
||||
'</ul>' .
|
||||
'<p>' . __( '<strong>Note:</strong> This is not case sensitive.', 'easy-table-of-contents' ) . '</p>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback which saves the user preferences from the table of contents metaboxes.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
* @static
|
||||
*
|
||||
* @param int $post_id The post ID.
|
||||
* @param object $post The post object.
|
||||
* @param bool $update Whether this is an existing post being updated or not.
|
||||
*/
|
||||
public function save( $post_id, $post, $update ) {
|
||||
|
||||
if ( current_user_can( 'edit_post', $post_id ) &&
|
||||
isset( $_REQUEST['_ez_toc_nonce'] ) &&
|
||||
wp_verify_nonce( $_REQUEST['_ez_toc_nonce'], 'ez_toc_save' )
|
||||
) {
|
||||
|
||||
// Checkboxes are present if checked, absent if not.
|
||||
if ( isset( $_REQUEST['ez-toc-settings']['disabled-toc'] ) ) {
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-disabled', true );
|
||||
|
||||
} else {
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-disabled', false );
|
||||
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['ez-toc-settings']['insert-toc'] ) ) {
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-insert', true );
|
||||
|
||||
} else {
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-insert', false );
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['ez-toc-settings']['header-label'] )) {
|
||||
$header_label = sanitize_text_field( $_REQUEST['ez-toc-settings']['header-label'] );
|
||||
update_post_meta( $post_id, '_ez-toc-header-label', $header_label );
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['ez-toc-settings']['toc-alignment'] ) ) {
|
||||
$align_values = array(
|
||||
'none',
|
||||
'left',
|
||||
'right',
|
||||
'center'
|
||||
);
|
||||
$alignment = sanitize_text_field( $_REQUEST['ez-toc-settings']['toc-alignment'] );
|
||||
if( in_array( $alignment, $align_values ) ) {
|
||||
update_post_meta( $post_id, '_ez-toc-alignment', $alignment );
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['ez-toc-settings']['heading-levels'] ) && ! empty( $_REQUEST['ez-toc-settings']['heading-levels'] ) ) {
|
||||
|
||||
if ( is_array( $_REQUEST['ez-toc-settings']['heading-levels'] ) ) {
|
||||
|
||||
$headings = array_map( 'absint', $_REQUEST['ez-toc-settings']['heading-levels'] );
|
||||
|
||||
} else {
|
||||
|
||||
$headings = array();
|
||||
}
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-heading-levels', $headings );
|
||||
|
||||
} else {
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-heading-levels', array() );
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['ez-toc-settings']['alttext'] ) && ! empty( $_REQUEST['ez-toc-settings']['alttext'] ) ) {
|
||||
|
||||
$alttext = '';
|
||||
|
||||
if ( is_string( $_REQUEST['ez-toc-settings']['alttext'] ) ) {
|
||||
|
||||
$alttext = trim( $_REQUEST['ez-toc-settings']['alttext'] );
|
||||
|
||||
/*
|
||||
* This is basically `esc_html()` but does not encode quotes.
|
||||
* This is to allow angle brackets and such which `wp_kses_post` would strip as "evil" scripts.
|
||||
*/
|
||||
$alttext = wp_check_invalid_utf8( $alttext );
|
||||
$alttext = _wp_specialchars( $alttext, ENT_NOQUOTES );
|
||||
|
||||
}
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-alttext', wp_kses_post( $alttext ) );
|
||||
|
||||
} else {
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-alttext', '' );
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['ez-toc-settings']['visibility_hide_by_default'] ) && ! empty( $_REQUEST['ez-toc-settings']['visibility_hide_by_default'] ) ) {
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-visibility_hide_by_default', true );
|
||||
|
||||
} else {
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-visibility_hide_by_default', false );
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['ez-toc-settings']['hide_counter'] ) ) {
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-hide_counter', true );
|
||||
|
||||
} else {
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-hide_counter', false );
|
||||
}
|
||||
|
||||
if ( isset( $_REQUEST['ez-toc-settings']['exclude'] ) && ! empty( $_REQUEST['ez-toc-settings']['exclude'] ) ) {
|
||||
|
||||
$exclude = '';
|
||||
if ( is_string( $_REQUEST['ez-toc-settings']['exclude'] ) ) {
|
||||
|
||||
$exclude = trim( $_REQUEST['ez-toc-settings']['exclude'] );
|
||||
|
||||
/*
|
||||
* This is basically `esc_html()` but does not encode quotes.
|
||||
* This is to allow angle brackets and such which `wp_kses_post` would strip as "evil" scripts.
|
||||
*/
|
||||
$exclude = wp_check_invalid_utf8( $exclude );
|
||||
$exclude = _wp_specialchars( $exclude, ENT_NOQUOTES );
|
||||
|
||||
}
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-exclude', wp_kses_post( $exclude ) );
|
||||
|
||||
} else {
|
||||
|
||||
update_post_meta( $post_id, '_ez-toc-exclude', '' );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Enqueue Admin js scripts
|
||||
*
|
||||
*/
|
||||
public function load_scripts($pagenow){
|
||||
|
||||
if($pagenow == 'settings_page_table-of-contents'){
|
||||
$min = defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
||||
wp_enqueue_script( 'eztoc-admin-js', EZ_TOC_URL . "assets/js/eztoc-admin$min.js",array('jquery'), ezTOC::VERSION,true );
|
||||
|
||||
$data = array(
|
||||
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
||||
'eztoc_security_nonce' => wp_create_nonce('eztoc_ajax_check_nonce'),
|
||||
);
|
||||
|
||||
$data = apply_filters('eztoc_localize_filter',$data,'eztoc_admin_data');
|
||||
|
||||
wp_localize_script( 'eztoc-admin-js', 'eztoc_admin_data', $data );
|
||||
|
||||
$this->eztoc_dequeue_scripts();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a ajax handler function for sending email from user admin panel to us.
|
||||
* @return type json string
|
||||
*/
|
||||
|
||||
public function eztoc_send_query_message(){
|
||||
|
||||
if ( ! isset( $_POST['eztoc_security_nonce'] ) ){
|
||||
return;
|
||||
}
|
||||
if ( !wp_verify_nonce( $_POST['eztoc_security_nonce'], 'eztoc_ajax_check_nonce' ) ){
|
||||
return;
|
||||
}
|
||||
if ( !current_user_can( 'manage_options' ) ) {
|
||||
return;
|
||||
}
|
||||
$message = $this->eztoc_sanitize_textarea_field($_POST['message']);
|
||||
$email = sanitize_email($_POST['email']);
|
||||
|
||||
if(function_exists('wp_get_current_user')){
|
||||
|
||||
$user = wp_get_current_user();
|
||||
|
||||
|
||||
$message = '<p>'.$message.'</p><br><br>'.'Query from Easy Table of Content plugin support tab';
|
||||
|
||||
$user_data = $user->data;
|
||||
$user_email = $user_data->user_email;
|
||||
|
||||
if($email){
|
||||
$user_email = $email;
|
||||
}
|
||||
//php mailer variables
|
||||
$sendto = 'team@magazine3.in';
|
||||
$subject = "Easy Table of Content Query";
|
||||
|
||||
$headers[] = 'Content-Type: text/html; charset=UTF-8';
|
||||
$headers[] = 'From: '. esc_attr($user_email);
|
||||
$headers[] = 'Reply-To: ' . esc_attr($user_email);
|
||||
// Load WP components, no themes.
|
||||
|
||||
$sent = wp_mail($sendto, $subject, $message, $headers);
|
||||
|
||||
if($sent){
|
||||
|
||||
echo json_encode(array('status'=>'t'));
|
||||
|
||||
}else{
|
||||
|
||||
echo json_encode(array('status'=>'f'));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
wp_die();
|
||||
}
|
||||
|
||||
public function eztoc_sanitize_textarea_field( $str ) {
|
||||
|
||||
if ( is_object( $str ) || is_array( $str ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$str = (string) $str;
|
||||
|
||||
$filtered = wp_check_invalid_utf8( $str );
|
||||
|
||||
if ( strpos( $filtered, '<' ) !== false ) {
|
||||
$filtered = wp_pre_kses_less_than( $filtered );
|
||||
// This will strip extra whitespace for us.
|
||||
$filtered = wp_strip_all_tags( $filtered, false );
|
||||
|
||||
// Use HTML entities in a special case to make sure no later
|
||||
// newline stripping stage could lead to a functional tag.
|
||||
$filtered = str_replace( "<\n", "<\n", $filtered );
|
||||
}
|
||||
|
||||
$filtered = trim( $filtered );
|
||||
|
||||
$found = false;
|
||||
while ( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) {
|
||||
$filtered = str_replace( $match[0], '', $filtered );
|
||||
$found = true;
|
||||
}
|
||||
|
||||
if ( $found ) {
|
||||
// Strip out the whitespace that may now exist after removing the octets.
|
||||
$filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );
|
||||
}
|
||||
|
||||
return $filtered;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback used to render the admin options page.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
* @static
|
||||
*/
|
||||
public function page() {
|
||||
|
||||
include EZ_TOC_PATH . '/includes/inc.admin-options-page.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to dequeue unwanted scripts on ETOC settings page.
|
||||
*
|
||||
* @since 2.0.52
|
||||
*/
|
||||
public function eztoc_dequeue_scripts() {
|
||||
wp_dequeue_script( 'chats-js' );
|
||||
wp_dequeue_script( 'custom_wp_admin_js' );
|
||||
}
|
||||
}
|
||||
|
||||
new ezTOC_Admin();
|
||||
|
||||
}
|
2124
wp-content/plugins/easy-table-of-contents/includes/class.options.php
Normal file
1856
wp-content/plugins/easy-table-of-contents/includes/class.post.php
Normal file
@ -0,0 +1,654 @@
|
||||
<?php
|
||||
// Exit if accessed directly
|
||||
if ( ! defined ( 'ABSPATH' ) )
|
||||
exit;
|
||||
|
||||
if ( ! class_exists ( 'ezTOC_WidgetSticky' ) )
|
||||
{
|
||||
|
||||
/**
|
||||
* Class ezTOC_WidgetSticky
|
||||
*/
|
||||
class ezTOC_WidgetSticky extends WP_Widget
|
||||
{
|
||||
|
||||
/**
|
||||
* Setup and register the table of contents widget.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0.41
|
||||
*/
|
||||
public function __construct ()
|
||||
{
|
||||
|
||||
$options = array(
|
||||
'classname' => 'ez-toc-widget-sticky',
|
||||
'description' => __ ( 'Display the table of contents.', 'easy-table-of-contents' )
|
||||
);
|
||||
|
||||
parent::__construct (
|
||||
'ez_toc_widget_sticky',
|
||||
__ ( 'Sticky Sidebar Table of Contents', 'easy-table-of-contents' ),
|
||||
$options
|
||||
);
|
||||
|
||||
add_action ( 'admin_enqueue_scripts', array( $this, 'enqueueScripts' ) );
|
||||
add_action ( 'admin_footer-widgets.php', array( $this, 'printScripts' ), 9999 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback which registers the widget with the Widget API.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0.41
|
||||
* @static
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function register ()
|
||||
{
|
||||
|
||||
register_widget ( __CLASS__ );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to enqueue scripts on the Widgets admin page.
|
||||
*
|
||||
* @access private
|
||||
* @since 1 .0
|
||||
*
|
||||
* @param string $hook_suffix
|
||||
*/
|
||||
public function enqueueScripts ( $hook_suffix )
|
||||
{
|
||||
$min = defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
||||
|
||||
if ( 'widgets.php' !== $hook_suffix )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
wp_enqueue_style ( 'wp-color-picker' );
|
||||
wp_enqueue_script ( 'wp-color-picker' );
|
||||
wp_enqueue_script ( 'underscore' );
|
||||
|
||||
$widgetStickyAdminCSSVersion = ezTOC::VERSION . '-' . filemtime ( EZ_TOC_PATH . DIRECTORY_SEPARATOR . "assets" . DIRECTORY_SEPARATOR . "css" . DIRECTORY_SEPARATOR . "ez-toc-widget-sticky-admin$min.css" );
|
||||
wp_register_style ( 'ez-toc-widget-sticky-admin', EZ_TOC_URL . "assets/css/ez-toc-widget-sticky-admin$min.css", array(), $widgetStickyAdminCSSVersion );
|
||||
wp_enqueue_style ( 'ez-toc-widget-sticky-admin', EZ_TOC_URL . "assets/css/ez-toc-widget-sticky-admin$min.css", array(), $widgetStickyAdminCSSVersion );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to print the scripts to the Widgets admin page footer.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.0.41
|
||||
*/
|
||||
public function printScripts ()
|
||||
{
|
||||
?>
|
||||
<script>
|
||||
(function ($) {
|
||||
function initColorPicker(widget) {
|
||||
widget.find('.color-picker').wpColorPicker({
|
||||
change: _.throttle(function () { // For Customizer
|
||||
$(this).trigger('change');
|
||||
}, 3000)
|
||||
});
|
||||
}
|
||||
|
||||
function onFormUpdate(event, widget) {
|
||||
initColorPicker(widget);
|
||||
}
|
||||
|
||||
$(document).on('widget-added widget-updated', onFormUpdate);
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#widgets-right .widget:has(.color-picker)').each(function () {
|
||||
initColorPicker($(this));
|
||||
});
|
||||
});
|
||||
}(jQuery));
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the post content. Optionally allows post ID to be passed
|
||||
*
|
||||
* @link http://stephenharris.info/get-post-content-by-id/
|
||||
* @link http://wordpress.stackexchange.com/a/143316
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0.41
|
||||
*
|
||||
* @param int $post_id Optional. Post ID.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function the_content ( $post_id = 0 )
|
||||
{
|
||||
|
||||
global $post;
|
||||
$post = get_post ( $post_id );
|
||||
setup_postdata ( $post );
|
||||
ob_start ();
|
||||
the_content ();
|
||||
$content = ob_get_clean ();
|
||||
wp_reset_postdata ();
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the widgets.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.0.41
|
||||
*
|
||||
* @param array $args
|
||||
* @param array $instance
|
||||
*/
|
||||
public function widget ( $args, $instance )
|
||||
{
|
||||
$min = defined ( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
||||
|
||||
if ( is_404 () || is_archive () || is_search () || ( ! is_front_page () && is_home () ) )
|
||||
return;
|
||||
|
||||
$post = ezTOC::get ( get_the_ID () );
|
||||
|
||||
if( function_exists( 'post_password_required' ) ) {
|
||||
if( post_password_required() ) return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @link https://wordpress.org/support/topic/fatal-error-when-trying-to-access-widget-area/
|
||||
*/
|
||||
if ( ! $post instanceof ezTOC_Post )
|
||||
return;
|
||||
|
||||
if ( $post -> hasTOCItems () )
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string $before_widget
|
||||
* @var string $after_widget
|
||||
* @var string $before_title
|
||||
* @var string $after_title
|
||||
*/
|
||||
extract ( $args );
|
||||
|
||||
$js_vars = array();
|
||||
$js_vars[ 'appearance_options' ] = '';
|
||||
$js_vars[ 'advanced_options' ] = '';
|
||||
$js_vars[ 'scroll_fixed_position' ] = '30';
|
||||
$js_vars[ 'sidebar_sticky_title' ] = 120;
|
||||
$js_vars[ 'sidebar_sticky_title_size_unit' ] = '%';
|
||||
$js_vars[ 'sidebar_sticky_title_weight' ] = '500';
|
||||
$js_vars[ 'sidebar_sticky_title_color' ] = '#000';
|
||||
$js_vars[ 'sidebar_width' ] = 'auto';
|
||||
$js_vars[ 'sidebar_width_size_unit' ] = 'none';
|
||||
$js_vars[ 'fixed_top_position' ] = '30';
|
||||
$js_vars[ 'fixed_top_position_size_unit' ] = 'px';
|
||||
$js_vars[ 'navigation_scroll_bar' ] = 'on';
|
||||
$js_vars[ 'scroll_max_height' ] = 'auto';
|
||||
$js_vars[ 'scroll_max_height_size_unit' ] = 'none';
|
||||
|
||||
if ( 'on' == $instance[ 'appearance_options' ] || 'on' == $instance[ 'advanced_options' ] || $js_vars[ 'scroll_fixed_position' ] != $instance[ 'scroll_fixed_position' ] ||
|
||||
$js_vars[ 'scroll_fixed_position' ] != $instance[ 'scroll_fixed_position' ] ||
|
||||
$js_vars[ 'sidebar_sticky_title' ] != $instance[ 'sidebar_sticky_title' ] ||
|
||||
$js_vars[ 'sidebar_sticky_title_size_unit' ] != $instance[ 'sidebar_sticky_title_size_unit' ] ||
|
||||
$js_vars[ 'sidebar_sticky_title_weight' ] != $instance[ 'sidebar_sticky_title_weight' ] ||
|
||||
$js_vars[ 'sidebar_sticky_title_color' ] != $instance[ 'sidebar_sticky_title_color' ] ||
|
||||
$js_vars[ 'sidebar_width' ] != $instance[ 'sidebar_width' ] ||
|
||||
$js_vars[ 'sidebar_width_size_unit' ] != $instance[ 'sidebar_width_size_unit' ] ||
|
||||
$js_vars[ 'fixed_top_position' ] != $instance[ 'fixed_top_position' ] ||
|
||||
$js_vars[ 'fixed_top_position_size_unit' ] != $instance[ 'fixed_top_position_size_unit' ] ||
|
||||
$js_vars[ 'navigation_scroll_bar' ] != $instance[ 'navigation_scroll_bar' ] ||
|
||||
$js_vars[ 'scroll_max_height' ] != $instance[ 'scroll_max_height' ] ||
|
||||
$js_vars[ 'scroll_max_height_size_unit' ] != $instance[ 'scroll_max_height_size_unit' ]
|
||||
)
|
||||
{
|
||||
$js_vars[ 'appearance_options' ] = $instance[ 'appearance_options' ];
|
||||
|
||||
$js_vars[ 'advanced_options' ] = $instance[ 'advanced_options' ];
|
||||
|
||||
if ( empty ( $instance[ 'scroll_fixed_position' ] ) || ( ! empty ( $instance[ 'scroll_fixed_position' ] ) && ! is_int ( $instance[ 'scroll_fixed_position' ] ) && 'auto' != $instance[ 'scroll_fixed_position' ] ) )
|
||||
$js_vars[ 'scroll_fixed_position' ] = '30';
|
||||
else
|
||||
$js_vars[ 'scroll_fixed_position' ] = $instance[ 'scroll_fixed_position' ];
|
||||
|
||||
if ( empty ( $instance[ 'sidebar_sticky_title' ] ) || ( ! empty ( $instance[ 'sidebar_sticky_title' ] ) && ! is_int ( $instance[ 'sidebar_sticky_title' ] ) ) )
|
||||
$js_vars[ 'sidebar_sticky_title' ] = 120;
|
||||
else
|
||||
$js_vars[ 'sidebar_sticky_title' ] = $instance[ 'sidebar_sticky_title' ];
|
||||
|
||||
if ( empty ( $instance[ 'sidebar_sticky_title_size_unit' ] ) || ( ! empty ( $instance[ 'sidebar_sticky_title_size_unit' ] ) ) )
|
||||
$js_vars[ 'sidebar_sticky_title_size_unit' ] = '%';
|
||||
else
|
||||
$js_vars[ 'sidebar_sticky_title_size_unit' ] = $instance[ 'sidebar_sticky_title_size_unit' ];
|
||||
|
||||
if ( empty ( $instance[ 'sidebar_sticky_title_weight' ] ) || ( ! empty ( $instance[ 'sidebar_sticky_title_weight' ] ) ) )
|
||||
$js_vars[ 'sidebar_sticky_title_weight' ] = '500';
|
||||
else
|
||||
$js_vars[ 'sidebar_sticky_title_weight' ] = $instance[ 'sidebar_sticky_title_weight' ];
|
||||
|
||||
if ( empty ( $instance[ 'sidebar_sticky_title_color' ] ) || ( ! empty ( $instance[ 'sidebar_sticky_title_color' ] ) ) )
|
||||
$js_vars[ 'sidebar_sticky_title_color' ] = '#000';
|
||||
else
|
||||
$js_vars[ 'sidebar_sticky_title_color' ] = $instance[ 'sidebar_sticky_title_color' ];
|
||||
|
||||
if ( empty ( $instance[ 'sidebar_width' ] ) || ( ! empty ( $instance[ 'sidebar_width' ] ) && ! is_int ( $instance[ 'sidebar_width' ] ) && 'auto' != $instance[ 'sidebar_width' ] ) )
|
||||
$js_vars[ 'sidebar_width' ] = 'auto';
|
||||
else
|
||||
$js_vars[ 'sidebar_width' ] = $instance[ 'sidebar_width' ];
|
||||
|
||||
$js_vars[ 'sidebar_width_size_unit' ] = $instance[ 'sidebar_width_size_unit' ];
|
||||
|
||||
if ( empty ( $instance[ 'fixed_top_position' ] ) || ( ! empty ( $instance[ 'fixed_top_position' ] ) && ! is_int ( $instance[ 'fixed_top_position' ] ) && '30' != $instance[ 'fixed_top_position' ] ) )
|
||||
$js_vars[ 'fixed_top_position' ] = '30';
|
||||
else
|
||||
$js_vars[ 'fixed_top_position' ] = $instance[ 'fixed_top_position' ];
|
||||
|
||||
$js_vars[ 'fixed_top_position_size_unit' ] = $instance[ 'fixed_top_position_size_unit' ];
|
||||
$js_vars[ 'navigation_scroll_bar' ] = $instance[ 'navigation_scroll_bar' ];
|
||||
|
||||
if ( empty ( $instance[ 'scroll_max_height' ] ) || ( ! empty ( $instance[ 'scroll_max_height' ] ) && ! is_int ( $instance[ 'scroll_max_height' ] ) && 'auto' != $instance[ 'scroll_max_height' ] ) )
|
||||
$js_vars[ 'scroll_max_height' ] = 'auto';
|
||||
else
|
||||
$js_vars[ 'scroll_max_height' ] = $instance[ 'scroll_max_height' ];
|
||||
|
||||
$js_vars[ 'scroll_max_height_size_unit' ] = $instance[ 'scroll_max_height_size_unit' ];
|
||||
}
|
||||
|
||||
$class = array(
|
||||
'ez-toc-widget-sticky-v' . str_replace ( '.', '_', ezTOC::VERSION ),
|
||||
'ez-toc-widget-sticky',
|
||||
);
|
||||
|
||||
$title = apply_filters ( 'widget_title', $instance[ 'title' ], $instance, $this -> id_base );
|
||||
|
||||
if ( false !== strpos ( $title, '%PAGE_TITLE%' ) || false !== strpos ( $title, '%PAGE_NAME%' ) )
|
||||
{
|
||||
|
||||
$title = str_replace ( '%PAGE_TITLE%', get_the_title (), $title );
|
||||
}
|
||||
|
||||
if ( ezTOC_Option::get ( 'show_hierarchy' ) )
|
||||
{
|
||||
|
||||
$class[] = 'counter-hierarchy';
|
||||
} else
|
||||
{
|
||||
|
||||
$class[] = 'counter-flat';
|
||||
}
|
||||
|
||||
if ( ezTOC_Option::get ( 'heading-text-direction', 'ltr' ) == 'ltr' )
|
||||
{
|
||||
$class[] = 'ez-toc-widget-sticky-container';
|
||||
}
|
||||
if ( ezTOC_Option::get ( 'heading-text-direction', 'ltr' ) == 'rtl' )
|
||||
{
|
||||
$class[] = 'ez-toc-widget-sticky-container-rtl';
|
||||
}
|
||||
|
||||
$class[] = 'ez-toc-widget-sticky-direction';
|
||||
|
||||
$custom_classes = ezTOC_Option::get ( 'css_container_class', '' );
|
||||
|
||||
if ( 0 < strlen ( $custom_classes ) )
|
||||
{
|
||||
|
||||
$custom_classes = explode ( ' ', $custom_classes );
|
||||
$custom_classes = apply_filters ( 'ez_toc_widget_sticky_container_class', $custom_classes, $this );
|
||||
|
||||
if ( is_array ( $custom_classes ) )
|
||||
{
|
||||
|
||||
$class = array_merge ( $class, $custom_classes );
|
||||
}
|
||||
}
|
||||
|
||||
$class = array_filter ( $class );
|
||||
$class = array_map ( 'trim', $class );
|
||||
$class = array_map ( 'sanitize_html_class', $class );
|
||||
|
||||
echo $before_widget;
|
||||
do_action ( 'ez_toc_widget_sticky_before_widget_container' );
|
||||
|
||||
echo '<div id="ez-toc-widget-sticky-container" class="ez-toc-widget-sticky-container ' . implode ( ' ', $class ) . '">' . PHP_EOL;
|
||||
|
||||
do_action ( 'ez_toc_widget_sticky_before_widget' );
|
||||
|
||||
/**
|
||||
* @todo Instead of inline style, use the shadow DOM.
|
||||
* @link https://css-tricks.com/playing-shadow-dom/
|
||||
*
|
||||
* @todo Consider not outputting the style if CSS is disabled.
|
||||
* @link https://wordpress.org/support/topic/inline-styling-triggers-html-validation-error/
|
||||
*/
|
||||
if ( 0 < strlen ( $title ) )
|
||||
{
|
||||
?>
|
||||
|
||||
<?php echo $before_title; ?>
|
||||
|
||||
<?php $title_font_size = $instance[ 'sidebar_sticky_title' ].$instance[ 'sidebar_sticky_title_size_unit' ] ?>
|
||||
|
||||
<span class="ez-toc-widget-sticky-title-container">
|
||||
<style>
|
||||
#<?php echo $this -> id ?> .ez-toc-widget-sticky-title {
|
||||
font-size: <?php echo esc_attr ( $title_font_size ); ?>;
|
||||
font-weight: <?php echo esc_attr ( $instance[ 'sidebar_sticky_title_weight' ] ); ?>;
|
||||
color: <?php echo esc_attr ( $instance[ 'sidebar_sticky_title_color' ] ); ?>;
|
||||
}
|
||||
#<?php echo $this -> id ?> .ez-toc-widget-sticky-container ul.ez-toc-widget-sticky-list li.active{
|
||||
background-color: <?php echo esc_attr ( $instance[ 'highlight_color' ] ); ?>;
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
$headerTextToggleClass = '';
|
||||
$headerTextToggleStyle = '';
|
||||
|
||||
if ( ezTOC_Option::get( 'visibility_on_header_text' ) ) {
|
||||
$headerTextToggleClass = 'ez-toc-toggle';
|
||||
$headerTextToggleStyle = 'style="cursor: pointer"';
|
||||
}
|
||||
$header_label = '<span class="ez-toc-widget-sticky-title ' . $headerTextToggleClass . '" ' .$headerTextToggleStyle . '>' . $title . '</span>';
|
||||
?>
|
||||
<span class="ez-toc-widget-sticky-title-toggle">
|
||||
<?php if ( 'css' != ezTOC_Option::get ( 'toc_loading' ) ): ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
echo $header_label;
|
||||
if ( ezTOC_Option::get ( 'visibility' ) )
|
||||
{
|
||||
|
||||
echo '<a href="#" class="ez-toc-widget-sticky-pull-right ez-toc-widget-sticky-btn ez-toc-widget-sticky-btn-xs ez-toc-widget-sticky-btn-default ez-toc-widget-sticky-toggle" aria-label="Widget Easy TOC toggle icon"><span style="border: 0;padding: 0;margin: 0;position: absolute !important;height: 1px;width: 1px;overflow: hidden;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);clip-path: inset(50%);white-space: nowrap;">Toggle Table of Content</span>' . ezTOC::getTOCToggleIcon () . '</a>';
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php else: ?>
|
||||
<?php
|
||||
$toggle_view = '';
|
||||
if ( ezTOC_Option::get ( 'visibility_hide_by_default' ) == true )
|
||||
{
|
||||
$toggle_view = "checked";
|
||||
}
|
||||
if( true == get_post_meta( get_the_ID(), '_ez-toc-visibility_hide_by_default', true ) ) {
|
||||
$toggle_view = "checked";
|
||||
}
|
||||
$cssIconID = uniqid();
|
||||
if ( ezTOC_Option::get( 'visibility_on_header_text' ) ) {
|
||||
$htmlCSSIcon = '<label for="ez-toc-widget-sticky-cssicon-toggle-item-' . $cssIconID . '" style="cursor:pointer">' . $header_label . '<span class="ez-toc-widget-sticky-pull-right ez-toc-widget-sticky-btn ez-toc-widget-sticky-btn-xs ez-toc-widget-sticky-btn-default ez-toc-widget-sticky-toggle"><span style="border: 0;padding: 0;margin: 0;position: absolute !important;height: 1px;width: 1px;overflow: hidden;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);clip-path: inset(50%);white-space: nowrap;">Toggle Table of Content</span>' . ezTOC::getTOCToggleIcon( 'widget-with-visibility_on_header_text' ) . '</span></label>';
|
||||
} else {
|
||||
echo $header_label;
|
||||
$htmlCSSIcon = '<label for="ez-toc-widget-sticky-cssicon-toggle-item-' . $cssIconID . '" class="ez-toc-widget-sticky-pull-right ez-toc-widget-sticky-btn ez-toc-widget-sticky-btn-xs ez-toc-widget-sticky-btn-default ez-toc-widget-sticky-toggle"><span style="border: 0;padding: 0;margin: 0;position: absolute !important;height: 1px;width: 1px;overflow: hidden;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);clip-path: inset(50%);white-space: nowrap;">Toggle Table of Content</span>' . ezTOC::getTOCToggleIcon( 'widget-with-visibility_on_header_text' ) . '</label>';
|
||||
}
|
||||
echo $htmlCSSIcon;
|
||||
?>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<?php echo $after_title; ?>
|
||||
<?php if ( 'css' == ezTOC_Option::get ( 'toc_loading' ) ): ?>
|
||||
<label for="ez-toc-widget-sticky-cssicon-toggle-item-count-<?php $cssIconID ?>" class="cssiconcheckbox">1</label><input type="checkbox" id="ez-toc-widget-sticky-cssicon-toggle-item-<?php $cssIconID ?>" <?php $toggle_view ?> style="display:none" />
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
}
|
||||
do_action ( 'ez_toc_widget_sticky_before' );
|
||||
echo '<nav>' . PHP_EOL . $post -> getTOCList ( 'ez-toc-widget-sticky' ) . '</nav>' . PHP_EOL;
|
||||
do_action ( 'ez_toc_widget_sticky_after' );
|
||||
do_action ( 'ez_toc_widget_sticky_after_widget' );
|
||||
|
||||
echo '</div>' . PHP_EOL;
|
||||
do_action ( 'ez_toc_widget_sticky_after_widget_container' );
|
||||
|
||||
echo $after_widget;
|
||||
|
||||
// Enqueue the script.
|
||||
$widgetCSSVersion = ezTOC::VERSION . '-' . filemtime ( EZ_TOC_PATH . DIRECTORY_SEPARATOR . "assets" . DIRECTORY_SEPARATOR . "css" . DIRECTORY_SEPARATOR . "ez-toc-widget-sticky$min.css" );
|
||||
wp_register_style ( 'ez-toc-widget-sticky', EZ_TOC_URL . "assets/css/ez-toc-widget-sticky$min.css", array(), $widgetCSSVersion );
|
||||
wp_enqueue_style ( 'ez-toc-widget-sticky', EZ_TOC_URL . "assets/css/ez-toc-widget-sticky$min.css", array(), $widgetCSSVersion );
|
||||
|
||||
wp_add_inline_style ( 'ez-toc-widget-sticky', ezTOC::InlineCountingCSS ( ezTOC_Option::get ( 'heading-text-direction', 'ltr' ), 'ez-toc-widget-sticky-direction', 'ez-toc-widget-sticky-container', 'counter', 'ez-toc-widget-sticky-container' ) );
|
||||
|
||||
$widgetJSVersion = ezTOC::VERSION . '-' . filemtime ( EZ_TOC_PATH . DIRECTORY_SEPARATOR . "assets" . DIRECTORY_SEPARATOR . "js" . DIRECTORY_SEPARATOR . "ez-toc-widget-sticky$min.js" );
|
||||
wp_register_script ( 'ez-toc-widget-stickyjs', EZ_TOC_URL . "assets/js/ez-toc-widget-sticky$min.js", array( 'jquery' ), $widgetJSVersion );
|
||||
wp_enqueue_script ( 'ez-toc-widget-stickyjs', EZ_TOC_URL . "assets/js/ez-toc-widget-sticky$min.js", array( 'jquery' ), $widgetJSVersion );
|
||||
if ( 0 < count ( $js_vars ) )
|
||||
{
|
||||
wp_localize_script ( 'ez-toc-widget-stickyjs', 'ezTocWidgetSticky', $js_vars );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the widget settings.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.0.41
|
||||
*
|
||||
* @param array $new_instance
|
||||
* @param array $old_instance
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function update ( $new_instance, $old_instance )
|
||||
{
|
||||
|
||||
$instance = $old_instance;
|
||||
|
||||
$instance[ 'title' ] = strip_tags ( $new_instance[ 'title' ] );
|
||||
|
||||
$instance[ 'highlight_color' ] = strip_tags ( $new_instance[ 'highlight_color' ] );
|
||||
|
||||
$instance[ 'hide_inline' ] = array_key_exists ( 'hide_inline', $new_instance ) ? $new_instance[ 'hide_inline' ] : '0';
|
||||
|
||||
if ( isset ( $new_instance[ 'appearance_options' ] ) && $new_instance[ 'appearance_options' ] == 'on' )
|
||||
{
|
||||
$instance[ 'sidebar_sticky_title' ] = ( int ) strip_tags ( $new_instance[ 'sidebar_sticky_title' ] );
|
||||
$instance[ 'sidebar_sticky_title_size_unit' ] = strip_tags ( $new_instance[ 'sidebar_sticky_title_size_unit' ] );
|
||||
$instance[ 'sidebar_sticky_title_weight' ] = strip_tags ( $new_instance[ 'sidebar_sticky_title_weight' ] );
|
||||
$instance[ 'sidebar_sticky_title_color' ] = strip_tags ( $new_instance[ 'sidebar_sticky_title_color' ] );
|
||||
} else
|
||||
{
|
||||
$instance[ 'sidebar_sticky_title' ] = 120;
|
||||
$instance[ 'sidebar_sticky_title_size_unit' ] = '%';
|
||||
$instance[ 'sidebar_sticky_title_weight' ] = '500';
|
||||
$instance[ 'sidebar_sticky_title_color' ] = '#000';
|
||||
}
|
||||
|
||||
if ( isset ( $new_instance[ 'advanced_options' ] ) && $new_instance[ 'advanced_options' ] == 'on' )
|
||||
{
|
||||
$instance[ 'advanced_options' ] = 'on';
|
||||
$instance[ 'scroll_fixed_position' ] = ( int ) strip_tags ( $new_instance[ 'scroll_fixed_position' ] );
|
||||
$instance[ 'sidebar_width' ] = ( 'auto' == $new_instance[ 'sidebar_width' ] ) ? $new_instance[ 'sidebar_width' ] : ( int ) strip_tags ( $new_instance[ 'sidebar_width' ] );
|
||||
$instance[ 'sidebar_width_size_unit' ] = strip_tags ( $new_instance[ 'sidebar_width_size_unit' ] );
|
||||
$instance[ 'fixed_top_position' ] = ( 'auto' == $new_instance[ 'fixed_top_position' ] ) ? $new_instance[ 'fixed_top_position' ] : ( int ) strip_tags ( $new_instance[ 'fixed_top_position' ] );
|
||||
$instance[ 'fixed_top_position_size_unit' ] = strip_tags ( $new_instance[ 'fixed_top_position_size_unit' ] );
|
||||
|
||||
$instance[ 'navigation_scroll_bar' ] = strip_tags ( $new_instance[ 'navigation_scroll_bar' ] );
|
||||
|
||||
$instance[ 'scroll_max_height' ] = ( 'auto' == $new_instance[ 'scroll_max_height' ] ) ? $new_instance[ 'scroll_max_height' ] : ( int ) strip_tags ( $new_instance[ 'scroll_max_height' ] );
|
||||
$instance[ 'scroll_max_height_size_unit' ] = strip_tags ( $new_instance[ 'scroll_max_height_size_unit' ] );
|
||||
} else
|
||||
{
|
||||
$instance[ 'advanced_options' ] = '';
|
||||
$instance[ 'scroll_fixed_position' ] = 30;
|
||||
$instance[ 'sidebar_width' ] = 'auto';
|
||||
$instance[ 'sidebar_width_size_unit' ] = 'none';
|
||||
$instance[ 'fixed_top_position' ] = 30;
|
||||
$instance[ 'fixed_top_position_size_unit' ] = 'px';
|
||||
$instance[ 'navigation_scroll_bar' ] = 'on';
|
||||
$instance[ 'scroll_max_height' ] = 'auto';
|
||||
$instance[ 'scroll_max_height_size_unit' ] = 'none';
|
||||
}
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the widget settings on the Widgets admin page.
|
||||
*
|
||||
* @access private
|
||||
* @since 2.0.41
|
||||
*
|
||||
* @param array $instance
|
||||
*
|
||||
* @return string|void
|
||||
*/
|
||||
public function form ( $instance )
|
||||
{
|
||||
|
||||
$defaults = array(
|
||||
'highlight_color' => '#ededed',
|
||||
'title' => 'Table of Contents',
|
||||
'appearance_options' => '',
|
||||
'advanced_options' => '',
|
||||
'scroll_fixed_position' => 30,
|
||||
'sidebar_sticky_title' => 120,
|
||||
'sidebar_sticky_title_size_unit' => '%',
|
||||
'sidebar_sticky_title_weight' => '500',
|
||||
'sidebar_sticky_title_color' => '#000',
|
||||
'sidebar_width' => 'auto',
|
||||
'sidebar_width_size_unit' => 'none',
|
||||
'fixed_top_position' => 30,
|
||||
'fixed_top_position_size_unit' => 'px',
|
||||
'navigation_scroll_bar' => 'on',
|
||||
'scroll_max_height' => 'auto',
|
||||
'scroll_max_height_size_unit' => 'none',
|
||||
);
|
||||
|
||||
$instance = wp_parse_args ( ( array ) $instance, $defaults );
|
||||
|
||||
$highlight_color = esc_attr ( $instance[ 'highlight_color' ] );
|
||||
$title_color = esc_attr ( $instance[ 'sidebar_sticky_title_color' ] );
|
||||
?>
|
||||
<p>
|
||||
<label for="<?php echo $this -> get_field_id ( 'title' ); ?>"><?php _e ( 'Title', 'easy-table-of-contents' ); ?>:</label>
|
||||
<input type="text" id="<?php echo $this -> get_field_id ( 'title' ); ?>"
|
||||
name="<?php echo $this -> get_field_name ( 'title' ); ?>" value="<?php echo $instance[ 'title' ]; ?>"
|
||||
style="width:100%;"/>
|
||||
</p>
|
||||
|
||||
<div class="ez-toc-widget-appearance-title">
|
||||
<input type="checkbox" class="ez_toc_widget_appearance_options" id="<?php echo $this -> get_field_id ( 'appearance_options' ); ?>" name="<?php echo $this -> get_field_name ( 'appearance_options' ); ?>" <?php ( 'on' === $instance[ 'appearance_options' ] ) ? 'checked="checked"' : ''; ?>/>
|
||||
<label for="<?php echo $this -> get_field_id ( 'appearance_options' ); ?>"><?php _e ( 'Appearance', 'easy-table-of-contents' ); ?></label>
|
||||
<div id="ez-toc-widget-options-container" class="ez-toc-widget-appearance-options-container">
|
||||
<div class="ez-toc-widget-form-group">
|
||||
<label for="<?php echo $this -> get_field_id ( 'sidebar_sticky_title' ); ?>"><?php _e ( 'Title Font Size', 'easy-table-of-contents' ); ?>:</label>
|
||||
<input type="text" id="<?php echo $this -> get_field_id ( 'sidebar_sticky_title' ); ?>" name="<?php echo $this -> get_field_name ( 'sidebar_sticky_title' ); ?>" value="<?php echo $instance[ 'sidebar_sticky_title' ]; ?>" />
|
||||
|
||||
<select id="<?php echo $this -> get_field_id ( 'sidebar_sticky_title_size_unit' ); ?>" name="<?php echo $this -> get_field_name ( 'sidebar_sticky_title_size_unit' ); ?>" data-placeholder="" >
|
||||
<option value="%" <?php echo ( '%' == $instance[ 'sidebar_sticky_title_size_unit' ] ) ? 'selected' : ''; ?>><?php _e ( '%', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="pt" <?php echo ( 'pt' == $instance[ 'sidebar_sticky_title_size_unit' ] ) ? 'selected=' : ''; ?> ><?php _e ( 'pt', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="px" <?php echo ( 'px' == $instance[ 'sidebar_sticky_title_size_unit' ] ) ? 'selected=' : ''; ?>><?php _e ( 'px', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="em" <?php echo ( 'em' == $instance[ 'sidebar_sticky_title_size_unit' ] ) ? 'selected=' : ''; ?>><?php _e ( 'em', 'easy-table-of-contents' ); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="ez-toc-widget-form-group">
|
||||
<label for="<?php echo $this -> get_field_id ( 'sidebar_sticky_title_wgt' ); ?>"><?php _e ( 'Title Font Weight', 'easy-table-of-contents' ); ?>:</label>
|
||||
|
||||
<select id="<?php echo $this -> get_field_id ( 'sidebar_sticky_title_weight' ); ?>" name="<?php echo $this -> get_field_name ( 'sidebar_sticky_title_weight' ); ?>" data-placeholder="" style=" width: 60px; ">
|
||||
<option value="100" <?php echo ( '100' == $instance[ 'sidebar_sticky_title_weight' ] ) ? 'selected' : ''; ?>><?php _e ( '100', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="200" <?php echo ( '200' == $instance[ 'sidebar_sticky_title_weight' ] ) ? 'selected=' : ''; ?> ><?php _e ( '200', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="300" <?php echo ( '300' == $instance[ 'sidebar_sticky_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '300', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="400" <?php echo ( '400' == $instance[ 'sidebar_sticky_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '400', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="500" <?php echo ( '500' == $instance[ 'sidebar_sticky_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '500', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="600" <?php echo ( '600' == $instance[ 'sidebar_sticky_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '600', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="700" <?php echo ( '700' == $instance[ 'sidebar_sticky_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '700', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="800" <?php echo ( '800' == $instance[ 'sidebar_sticky_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '800', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="900" <?php echo ( '900' == $instance[ 'sidebar_sticky_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '900', 'easy-table-of-contents' ); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<p class="ez-toc-widget-form-group">
|
||||
<label for="<?php echo $this -> get_field_id ( 'sidebar_sticky_title_color' ); ?>" style="margin-right: 12px;"><?php _e ( 'Font Title Color:', 'easy-table-of-contents' ); ?></label><br>
|
||||
<input type="text" name="<?php echo $this -> get_field_name ( 'sidebar_sticky_title_color' ); ?>" class="color-picker" id="<?php echo $this -> get_field_id ( 'sidebar_sticky_title_color' ); ?>" value="<?php echo $title_color; ?>" data-default-color="<?php echo $defaults[ 'sidebar_sticky_title_color' ]; ?>" />
|
||||
</p>
|
||||
<p class="ez-toc-widget-form-group" style="margin: 0;margin-top: 7px;">
|
||||
<label for="<?php echo $this -> get_field_id ( 'highlight_color' ); ?>" style="margin-right: 12px;"><?php _e ( 'Active Section Highlight Color:', 'easy-table-of-contents' ); ?></label><br>
|
||||
<input type="text" name="<?php echo $this -> get_field_name ( 'highlight_color' ); ?>" class="color-picker" id="<?php echo $this -> get_field_id ( 'highlight_color' ); ?>" value="<?php echo $highlight_color; ?>" data-default-color="<?php echo $defaults[ 'highlight_color' ]; ?>" />
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ez-toc-widget-advanced-title">
|
||||
<input type="checkbox" class="ez_toc_widget_advanced_options" id="<?php echo $this -> get_field_id ( 'advanced_options' ); ?>" name="<?php echo $this -> get_field_name ( 'advanced_options' ); ?>" <?php ( 'on' === $instance[ 'advanced_options' ] ) ? 'checked="checked"' : ''; ?>/><label for="<?php echo $this -> get_field_id ( 'advanced_options' ); ?>"><?php _e ( 'Advanced Options', 'easy-table-of-contents' ); ?></label>
|
||||
|
||||
<div id="ez-toc-widget-options-container" class="ez-toc-widget-advanced-options-container">
|
||||
<div class="ez-toc-widget-form-group">
|
||||
<label for="<?php echo $this -> get_field_id ( 'scroll_fixed_position' ); ?>"><?php _e ( 'Scroll Fixed Position', 'easy-table-of-contents' ); ?>:</label>
|
||||
<input type="number" id="<?php echo $this -> get_field_id ( 'scroll_fixed_position' ); ?>" name="<?php echo $this -> get_field_name ( 'scroll_fixed_position' ); ?>" value="<?php echo $instance[ 'scroll_fixed_position' ]; ?>" />
|
||||
</div>
|
||||
|
||||
<div class="ez-toc-widget-form-group">
|
||||
<label for="<?php echo $this -> get_field_id ( 'sidebar_width' ); ?>"><?php _e ( 'Sidebar Width', 'easy-table-of-contents' ); ?>:</label>
|
||||
<input type="text" id="<?php echo $this -> get_field_id ( 'sidebar_width' ); ?>" name="<?php echo $this -> get_field_name ( 'sidebar_width' ); ?>" value="<?php echo $instance[ 'sidebar_width' ]; ?>" />
|
||||
|
||||
<select id="<?php echo $this -> get_field_id ( 'sidebar_width_size_unit' ); ?>" name="<?php echo $this -> get_field_name ( 'sidebar_width_size_unit' ); ?>" data-placeholder="" >
|
||||
<option value="pt" <?php ( 'pt' == $instance[ 'sidebar_width_size_unit' ] ) ? 'selected="selected"' : ''; ?> ><?php _e ( 'pt', 'easy-table-of-contents' ); ?></option>
|
||||
|
||||
<option value="px" <?php ( 'px' == $instance[ 'sidebar_width_size_unit' ] ) ? 'selected="selected"' : ''; ?>><?php _e ( 'px', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="%" <?php ( '%' == $instance[ 'sidebar_width_size_unit' ] ) ? 'selected="selected"' : ''; ?>><?php _e ( '%', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="em" <?php ( 'em' == $instance[ 'sidebar_width_size_unit' ] ) ? 'selected="selected"' : ''; ?>><?php _e ( 'em', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="none" <?php ( 'none' == $instance[ 'sidebar_width_size_unit' ] ) ? 'selected="selected"' : ''; ?>><?php _e ( 'none', 'easy-table-of-contents' ); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ez-toc-widget-form-group">
|
||||
<label for="<?php echo $this -> get_field_id ( 'fixed_top_position' ); ?>"><?php _e ( 'Fixed Top Position', 'easy-table-of-contents' ); ?>:</label>
|
||||
<input type="text" id="<?php echo $this -> get_field_id ( 'fixed_top_position' ); ?>" name="<?php echo $this -> get_field_name ( 'fixed_top_position' ); ?>" value="<?php echo $instance[ 'fixed_top_position' ]; ?>" />
|
||||
|
||||
<select id="<?php echo $this -> get_field_id ( 'fixed_top_position_size_unit' ); ?>" name="<?php echo $this -> get_field_name ( 'fixed_top_position_size_unit' ); ?>" data-placeholder="" >
|
||||
<option value="pt" <?php ( 'pt' == $instance[ 'fixed_top_position_size_unit' ] ) ? 'selected="selected"' : ''; ?> ><?php _e ( 'pt', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="px" <?php ( 'px' == $instance[ 'fixed_top_position_size_unit' ] ) ? 'selected="selected"' : ''; ?>><?php _e ( 'px', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="%" <?php ( '%' == $instance[ 'fixed_top_position_size_unit' ] ) ? 'selected="selected"' : ''; ?>><?php _e ( '%', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="em" <?php ( 'em' == $instance[ 'fixed_top_position_size_unit' ] ) ? 'selected="selected"' : ''; ?>><?php _e ( 'em', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="none" <?php ( 'none' == $instance[ 'fixed_top_position_size_unit' ] ) ? 'selected="selected"' : ''; ?>><?php _e ( 'none', 'easy-table-of-contents' ); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ez-toc-widget-form-group">
|
||||
<label for="<?php echo $this -> get_field_id ( 'navigation_scroll_bar' ); ?>"><?php _e ( 'Navigation Scroll Bar', 'easy-table-of-contents' ); ?>:</label>
|
||||
<input type="checkbox" id="<?php echo $this -> get_field_id ( 'navigation_scroll_bar' ); ?>" name="<?php echo $this -> get_field_name ( 'navigation_scroll_bar' ); ?>" <?php ( 'on' === $instance[ 'navigation_scroll_bar' ] ) ? 'checked="checked"' : ''; ?>/>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="ez-toc-widget-form-group">
|
||||
<label for="<?php echo $this -> get_field_id ( 'scroll_max_height' ); ?>"><?php _e ( 'Scroll Max Height', 'easy-table-of-contents' ); ?>:</label>
|
||||
<input type="text" id="<?php echo $this -> get_field_id ( 'scroll_max_height' ); ?>" name="<?php echo $this -> get_field_name ( 'scroll_max_height' ); ?>" value="<?php echo $instance[ 'scroll_max_height' ]; ?>" />
|
||||
|
||||
<select id="<?php echo $this -> get_field_id ( 'scroll_max_height_size_unit' ); ?>" name="<?php echo $this -> get_field_name ( 'scroll_max_height_size_unit' ); ?>" data-placeholder="" >
|
||||
<option value="pt" <?php ( 'pt' == $instance[ 'scroll_max_height_size_unit' ] ) ? 'selected="selected"' : ''; ?> ><?php _e ( 'pt', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="px" <?php ( 'px' == $instance[ 'scroll_max_height_size_unit' ] ) ? 'selected="selected"' : ''; ?>><?php _e ( 'px', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="%" <?php ( '%' == $instance[ 'scroll_max_height_size_unit' ] ) ? 'selected="selected"' : ''; ?>><?php _e ( '%', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="em" <?php ( 'em' == $instance[ 'scroll_max_height_size_unit' ] ) ? 'selected="selected"' : ''; ?>><?php _e ( 'em', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="none" <?php ( 'none' == $instance[ 'scroll_max_height_size_unit' ] ) ? 'selected="selected"' : ''; ?>><?php _e ( 'none', 'easy-table-of-contents' ); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// end class
|
||||
|
||||
add_action ( 'widgets_init', array( 'ezTOC_WidgetSticky', 'register' ) );
|
||||
}
|
@ -0,0 +1,471 @@
|
||||
<?php
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
if ( ! class_exists( 'ezTOC_Widget' ) ) {
|
||||
|
||||
/**
|
||||
* Class ezTOC_Widget
|
||||
*/
|
||||
class ezTOC_Widget extends WP_Widget {
|
||||
|
||||
/**
|
||||
* Setup and register the table of contents widget.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
*/
|
||||
public function __construct() {
|
||||
|
||||
$options = array(
|
||||
'classname' => 'ez-toc',
|
||||
'description' => __( 'Display the table of contents.', 'easy-table-of-contents' )
|
||||
);
|
||||
|
||||
parent::__construct(
|
||||
'ezw_tco',
|
||||
__( 'Table of Contents', 'easy-table-of-contents' ),
|
||||
$options
|
||||
);
|
||||
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'enqueueScripts' ) );
|
||||
add_action( 'admin_footer-widgets.php', array( $this, 'printScripts' ), 9999 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback which registers the widget with the Widget API.
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
* @static
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function register() {
|
||||
|
||||
register_widget( __CLASS__ );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to enqueue scripts on the Widgets admin page.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
*
|
||||
* @param string $hook_suffix
|
||||
*/
|
||||
public function enqueueScripts( $hook_suffix ) {
|
||||
|
||||
if ( 'widgets.php' !== $hook_suffix ) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_enqueue_style( 'wp-color-picker' );
|
||||
wp_enqueue_script( 'wp-color-picker' );
|
||||
wp_enqueue_script( 'underscore' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to print the scripts to the Widgets admin page footer.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
*/
|
||||
public function printScripts() {
|
||||
?>
|
||||
<script>
|
||||
( function( $ ){
|
||||
function initColorPicker( widget ) {
|
||||
widget.find( '.color-picker' ).wpColorPicker( {
|
||||
change: _.throttle( function() { // For Customizer
|
||||
$(this).trigger( 'change' );
|
||||
}, 3000 )
|
||||
});
|
||||
}
|
||||
|
||||
function onFormUpdate( event, widget ) {
|
||||
initColorPicker( widget );
|
||||
}
|
||||
|
||||
$( document ).on( 'widget-added widget-updated', onFormUpdate );
|
||||
|
||||
$( document ).ready( function() {
|
||||
$( '#widgets-right .widget:has(.color-picker)' ).each( function () {
|
||||
initColorPicker( $( this ) );
|
||||
} );
|
||||
} );
|
||||
}( jQuery ) );
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the post content. Optionally allows post ID to be passed
|
||||
*
|
||||
* @link http://stephenharris.info/get-post-content-by-id/
|
||||
* @link http://wordpress.stackexchange.com/a/143316
|
||||
*
|
||||
* @access public
|
||||
* @since 1.0
|
||||
*
|
||||
* @param int $post_id Optional. Post ID.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function the_content( $post_id = 0 ) {
|
||||
|
||||
global $post;
|
||||
$post = get_post( $post_id );
|
||||
setup_postdata( $post );
|
||||
ob_start();
|
||||
the_content();
|
||||
$content = ob_get_clean();
|
||||
wp_reset_postdata();
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the widgets.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
*
|
||||
* @param array $args
|
||||
* @param array $instance
|
||||
*/
|
||||
public function widget( $args, $instance ) {
|
||||
|
||||
if ( is_404() || is_archive() || is_search() || ( ! is_front_page() && is_home() ) ) return;
|
||||
|
||||
$post = ezTOC::get( get_the_ID() );
|
||||
|
||||
if( function_exists( 'post_password_required' ) ) {
|
||||
if( post_password_required() ) return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @link https://wordpress.org/support/topic/fatal-error-when-trying-to-access-widget-area/
|
||||
*/
|
||||
if ( ! $post instanceof ezTOC_Post ) return;
|
||||
|
||||
if ( $post->hasTOCItems() ) {
|
||||
|
||||
/**
|
||||
* @var string $before_widget
|
||||
* @var string $after_widget
|
||||
* @var string $before_title
|
||||
* @var string $after_title
|
||||
*/
|
||||
extract( $args );
|
||||
|
||||
$class = array(
|
||||
'ez-toc-v' . str_replace( '.', '_', ezTOC::VERSION ),
|
||||
'ez-toc-widget',
|
||||
);
|
||||
$instance_title = '';
|
||||
if(isset($instance['title'])){
|
||||
$instance_title = $instance['title'];
|
||||
}
|
||||
$title = apply_filters( 'widget_title', $instance_title, $instance, $this->id_base );
|
||||
|
||||
if ( false !== strpos( $title, '%PAGE_TITLE%' ) || false !== strpos( $title, '%PAGE_NAME%' ) ) {
|
||||
|
||||
$title = str_replace( '%PAGE_TITLE%', get_the_title(), $title );
|
||||
}
|
||||
|
||||
if ( ezTOC_Option::get( 'show_hierarchy' ) ) {
|
||||
|
||||
$class[] = 'counter-hierarchy';
|
||||
|
||||
} else {
|
||||
|
||||
$class[] = 'counter-flat';
|
||||
}
|
||||
|
||||
if( ezTOC_Option::get( 'heading-text-direction', 'ltr' ) == 'ltr' ) {
|
||||
$class[] = 'ez-toc-widget-container';
|
||||
}
|
||||
if( ezTOC_Option::get( 'heading-text-direction', 'ltr' ) == 'rtl' ) {
|
||||
$class[] = 'ez-toc-widget-container-rtl';
|
||||
}
|
||||
|
||||
if ( isset($instance['affix']) ) {
|
||||
|
||||
$class[] = 'ez-toc-affix';
|
||||
}
|
||||
|
||||
|
||||
$class[] = 'ez-toc-widget-direction';
|
||||
|
||||
$custom_classes = ezTOC_Option::get( 'css_container_class', '' );
|
||||
|
||||
if ( 0 < strlen( $custom_classes ) ) {
|
||||
|
||||
$custom_classes = explode( ' ', $custom_classes );
|
||||
$custom_classes = apply_filters( 'ez_toc_container_class', $custom_classes, $this );
|
||||
|
||||
if ( is_array( $custom_classes ) ) {
|
||||
|
||||
$class = array_merge( $class, $custom_classes );
|
||||
}
|
||||
}
|
||||
|
||||
$class = array_filter( $class );
|
||||
$class = array_map( 'trim', $class );
|
||||
$class = array_map( 'sanitize_html_class', $class );
|
||||
|
||||
echo $before_widget;
|
||||
do_action( 'ez_toc_before_widget_container');
|
||||
|
||||
echo '<div id="ez-toc-widget-container" class="ez-toc-widget-container ' . implode( ' ', $class ) . '">' . PHP_EOL;
|
||||
|
||||
do_action( 'ez_toc_before_widget' );
|
||||
|
||||
/**
|
||||
* @todo Instead of inline style, use the shadow DOM.
|
||||
* @link https://css-tricks.com/playing-shadow-dom/
|
||||
*
|
||||
* @todo Consider not outputting the style if CSS is disabled.
|
||||
* @link https://wordpress.org/support/topic/inline-styling-triggers-html-validation-error/
|
||||
*/
|
||||
|
||||
$title_font_size = $instance[ 'sidebar_title_size' ].$instance[ 'sidebar_title_size_unit' ];
|
||||
|
||||
if ( 0 < strlen( $title ) ) {
|
||||
|
||||
?>
|
||||
|
||||
<?php echo $before_title; ?>
|
||||
<span class="ez-toc-title-container">
|
||||
|
||||
<style>
|
||||
#<?php echo $this->id ?> .ez-toc-title{
|
||||
font-size: <?php echo esc_attr ( $title_font_size ); ?>;
|
||||
font-weight: <?php echo esc_attr ( $instance[ 'sidebar_title_weight' ] ); ?>;
|
||||
color: <?php echo esc_attr ( $instance[ 'sidebar_title_color' ] ); ?>;
|
||||
}
|
||||
#<?php echo $this->id ?> .ez-toc-widget-container ul.ez-toc-list li.active{
|
||||
background-color: <?php echo esc_attr( $instance['highlight_color'] ); ?>;
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
$headerTextToggleClass = '';
|
||||
$headerTextToggleStyle = '';
|
||||
|
||||
if ( ezTOC_Option::get( 'visibility_on_header_text' ) ) {
|
||||
$headerTextToggleClass = 'ez-toc-toggle';
|
||||
$headerTextToggleStyle = 'style="cursor: pointer"';
|
||||
}
|
||||
$header_label = '<span class="ez-toc-title ' . $headerTextToggleClass . '" ' .$headerTextToggleStyle . '>' . $title . '</span>';
|
||||
?>
|
||||
<span class="ez-toc-title-toggle">
|
||||
<?php if ( 'css' != ezTOC_Option::get( 'toc_loading' ) ): ?>
|
||||
|
||||
<?php
|
||||
echo $header_label;
|
||||
if ( ezTOC_Option::get( 'visibility' ) ) {
|
||||
|
||||
echo '<a href="#" class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" aria-label="Widget Easy TOC toggle icon"><span style="border: 0;padding: 0;margin: 0;position: absolute !important;height: 1px;width: 1px;overflow: hidden;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);clip-path: inset(50%);white-space: nowrap;">Toggle Table of Content</span>' . ezTOC::getTOCToggleIcon() . '</a>';
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php else: ?>
|
||||
<?php
|
||||
$toggle_view='';
|
||||
if(ezTOC_Option::get('visibility_hide_by_default')==true){
|
||||
$toggle_view= "checked";
|
||||
}
|
||||
if( true == get_post_meta( get_the_ID(), '_ez-toc-visibility_hide_by_default', true ) ) {
|
||||
$toggle_view = "checked";
|
||||
}
|
||||
$cssIconID = uniqid();
|
||||
if ( ezTOC_Option::get( 'visibility_on_header_text' ) ) {
|
||||
$htmlCSSIcon = '<label for="ez-toc-cssicon-toggle-item-' . $cssIconID . '" style="cursor:pointer">' . $header_label . '<span class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle">' . ezTOC::getTOCToggleIcon( 'widget-with-visibility_on_header_text' ) . '</span></label>';
|
||||
} else {
|
||||
echo $header_label;
|
||||
$htmlCSSIcon = '<label for="ez-toc-cssicon-toggle-item-' . $cssIconID . '" class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle">' . ezTOC::getTOCToggleIcon( 'widget-with-visibility_on_header_text' ) . '</span></label>';
|
||||
}
|
||||
echo $htmlCSSIcon;
|
||||
|
||||
?>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<?php echo $after_title; ?>
|
||||
<?php if ( 'css' == ezTOC_Option::get( 'toc_loading' ) ): ?>
|
||||
<label for="ez-toc-cssicon-toggle-item-count-<?php $cssIconID ?>" class="cssiconcheckbox">1</label><input type="checkbox" id="ez-toc-cssicon-toggle-item-<?php $cssIconID ?>" <?php $toggle_view?> style="display:none" />
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
|
||||
}
|
||||
do_action( 'ez_toc_before' );
|
||||
echo '<nav>'. PHP_EOL . $post->getTOCList() . '</nav>' . PHP_EOL;
|
||||
do_action( 'ez_toc_after' );
|
||||
do_action( 'ez_toc_after_widget' );
|
||||
|
||||
echo '</div>' . PHP_EOL;
|
||||
do_action( 'ez_toc_after_widget_container' );
|
||||
|
||||
echo $after_widget;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the widget settings.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
*
|
||||
* @param array $new_instance
|
||||
* @param array $old_instance
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function update( $new_instance, $old_instance ) {
|
||||
|
||||
$instance = $old_instance;
|
||||
|
||||
$instance['title'] = strip_tags( $new_instance['title'] );
|
||||
|
||||
$instance['affix'] = array_key_exists( 'affix', $new_instance ) ? $new_instance['affix'] : '0';
|
||||
|
||||
$instance['highlight_color'] = strip_tags( $new_instance['highlight_color'] );
|
||||
|
||||
if ( isset ( $new_instance[ 'eztoc_appearance' ] ) && $new_instance[ 'eztoc_appearance' ] == 'on' ){
|
||||
|
||||
$instance[ 'sidebar_title_size' ] = ( int ) strip_tags ( $new_instance[ 'sidebar_title_size' ] );
|
||||
|
||||
$instance[ 'sidebar_title_size_unit' ] = strip_tags ( $new_instance[ 'sidebar_title_size_unit' ] );
|
||||
|
||||
$instance[ 'sidebar_title_weight' ] = strip_tags ( $new_instance[ 'sidebar_title_weight' ] );
|
||||
|
||||
$instance[ 'sidebar_title_color' ] = strip_tags ( $new_instance[ 'sidebar_title_color' ] );
|
||||
|
||||
}else{
|
||||
|
||||
$instance[ 'sidebar_title_size' ] = 120;
|
||||
|
||||
$instance[ 'sidebar_title_size_unit' ] = '%';
|
||||
|
||||
$instance[ 'sidebar_title_weight' ] = '500';
|
||||
|
||||
$instance[ 'sidebar_title_color' ] = '#000';
|
||||
|
||||
}
|
||||
|
||||
$instance['hide_inline'] = array_key_exists( 'hide_inline', $new_instance ) ? $new_instance['hide_inline'] : '0';
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the widget settings on the Widgets admin page.
|
||||
*
|
||||
* @access private
|
||||
* @since 1.0
|
||||
*
|
||||
* @param array $instance
|
||||
*
|
||||
* @return string|void
|
||||
*/
|
||||
public function form( $instance ) {
|
||||
|
||||
$defaults = array(
|
||||
'affix' => '0',
|
||||
'eztoc_appearance' => '',
|
||||
'highlight_color' => '#ededed',
|
||||
'title' => __('Table of Contents', 'easy-table-of-contents' ),
|
||||
'sidebar_title_size' => 120,
|
||||
'sidebar_title_size_unit' => '%',
|
||||
'sidebar_title_weight' => '500',
|
||||
'sidebar_title_color' => '#000',
|
||||
);
|
||||
|
||||
$instance = wp_parse_args( (array) $instance, $defaults );
|
||||
|
||||
$highlight_color = esc_attr( $instance[ 'highlight_color' ] );
|
||||
|
||||
$title_color = esc_attr( $instance[ 'sidebar_title_color' ] );
|
||||
|
||||
?>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'easy-table-of-contents' ); ?>:</label>
|
||||
<input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>"
|
||||
name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>"
|
||||
style="width:100%;"/>
|
||||
</p>
|
||||
|
||||
<div class="ez-toc-widget-appearance-title">
|
||||
|
||||
<input type="checkbox" class="ez_toc_widget_appearance_options" id="<?php echo $this -> get_field_id ( 'eztoc_appearance' ); ?>" name="<?php echo $this -> get_field_name ( 'eztoc_appearance' ); ?>" <?php ( 'on' === $instance[ 'eztoc_appearance' ] ) ? 'checked="checked"' : ''; ?>/>
|
||||
|
||||
<label for="<?php echo $this -> get_field_id ( 'eztoc_appearance' ); ?>"><?php _e ( 'Appearance', 'easy-table-of-contents' ); ?></label>
|
||||
|
||||
<div id="ez-toc-widget-options-container" class="ez-toc-widget-appearance-options-container">
|
||||
|
||||
<p class="ez-toc-widget-form-group">
|
||||
<label for="<?php echo $this -> get_field_id ( 'sidebar_title_color' ); ?>" style="margin-right: 12px;"><?php _e ( 'Font Title Color:', 'easy-table-of-contents' ); ?></label><br>
|
||||
<input type="text" name="<?php echo $this -> get_field_name ( 'sidebar_title_color' ); ?>" class="color-picker" id="<?php echo $this -> get_field_id ( 'sidebar_title_color' ); ?>" value="<?php echo $title_color; ?>" data-default-color="<?php echo $defaults[ 'sidebar_title_color' ]; ?>" />
|
||||
</p>
|
||||
|
||||
<div class="ez-toc-widget-form-group">
|
||||
<label for="<?php echo $this -> get_field_id ( 'sidebar_title_size' ); ?>"><?php _e ( 'Title Font Size', 'easy-table-of-contents' ); ?>:</label>
|
||||
<input type="text" id="<?php echo $this -> get_field_id ( 'sidebar_title_size' ); ?>" name="<?php echo $this -> get_field_name ( 'sidebar_title_size' ); ?>" value="<?php echo $instance[ 'sidebar_title_size' ]; ?>" style="width: 60px;"/>
|
||||
|
||||
<select id="<?php echo $this -> get_field_id ( 'sidebar_title_size_unit' ); ?>" name="<?php echo $this -> get_field_name ( 'sidebar_title_size_unit' ); ?>" data-placeholder="" >
|
||||
<option value="%" <?php echo ( '%' == $instance[ 'sidebar_title_size_unit' ] ) ? 'selected' : ''; ?>><?php _e ( '%', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="pt" <?php echo ( 'pt' == $instance[ 'sidebar_title_size_unit' ] ) ? 'selected=' : ''; ?> ><?php _e ( 'pt', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="px" <?php echo ( 'px' == $instance[ 'sidebar_title_size_unit' ] ) ? 'selected=' : ''; ?>><?php _e ( 'px', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="em" <?php echo ( 'em' == $instance[ 'sidebar_title_size_unit' ] ) ? 'selected=' : ''; ?>><?php _e ( 'em', 'easy-table-of-contents' ); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="ez-toc-widget-form-group">
|
||||
<label for="<?php echo $this -> get_field_id ( 'sidebar_title_weight' ); ?>"><?php _e ( 'Title Font Weight', 'easy-table-of-contents' ); ?>:</label>
|
||||
|
||||
<select id="<?php echo $this -> get_field_id ( 'sidebar_title_weight' ); ?>" name="<?php echo $this -> get_field_name ( 'sidebar_title_weight' ); ?>" data-placeholder="" style=" width: 60px; ">
|
||||
<option value="100" <?php echo ( '100' == $instance[ 'sidebar_title_weight' ] ) ? 'selected' : ''; ?>><?php _e ( '100', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="200" <?php echo ( '200' == $instance[ 'sidebar_title_weight' ] ) ? 'selected=' : ''; ?> ><?php _e ( '200', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="300" <?php echo ( '300' == $instance[ 'sidebar_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '300', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="400" <?php echo ( '400' == $instance[ 'sidebar_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '400', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="500" <?php echo ( '500' == $instance[ 'sidebar_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '500', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="600" <?php echo ( '600' == $instance[ 'sidebar_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '600', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="700" <?php echo ( '700' == $instance[ 'sidebar_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '700', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="800" <?php echo ( '800' == $instance[ 'sidebar_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '800', 'easy-table-of-contents' ); ?></option>
|
||||
<option value="900" <?php echo ( '900' == $instance[ 'sidebar_title_weight' ] ) ? 'selected=' : ''; ?>><?php _e ( '900', 'easy-table-of-contents' ); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<p class="ez-toc-widget-form-group">
|
||||
<label for="<?php echo $this->get_field_id( 'highlight_color' ); ?>" style="margin-right: 12px;"><?php _e( 'Active Section Highlight Color:', 'easy-table-of-contents' ); ?></label><br>
|
||||
<input type="text" name="<?php echo $this->get_field_name( 'highlight_color' ); ?>" class="color-picker" id="<?php echo $this->get_field_id( 'highlight_color' ); ?>" value="<?php echo $highlight_color; ?>" data-default-color="<?php echo $defaults['highlight_color']; ?>" />
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<p style="display: <?php echo ezTOC_Option::get( 'widget_affix_selector' ) ? 'block' : 'none'; ?>;">
|
||||
<input class="checkbox" type="checkbox" <?php checked( $instance['affix'], 1 ); ?>
|
||||
id="<?php echo $this->get_field_id( 'affix' ); ?>"
|
||||
name="<?php echo $this->get_field_name( 'affix' ); ?>" value="1"/>
|
||||
<label for="<?php echo $this->get_field_id( 'affix' ); ?>"> <?php _e( 'Affix or pin the widget.', 'easy-table-of-contents' ); ?></label>
|
||||
</p>
|
||||
|
||||
<p class="description" style="display: <?php echo ezTOC_Option::get( 'widget_affix_selector' ) ? 'block' : 'none'; ?>;">
|
||||
<?php _e( 'If you choose to affix the widget, do not add any other widgets on the sidebar. Also, make sure you have only one instance Table of Contents widget on the page.', 'easy-table-of-contents' ); ?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
} // end class
|
||||
|
||||
add_action( 'widgets_init', array( 'ezTOC_Widget', 'register' ) );
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Deactivate Feedback Template
|
||||
* @since 2.0.27
|
||||
*/
|
||||
|
||||
$current_user = wp_get_current_user();
|
||||
$email = '';
|
||||
if( $current_user instanceof WP_User ) {
|
||||
$email = trim( $current_user->user_email );
|
||||
}
|
||||
|
||||
$reasons = array(
|
||||
1 => '<li><label><input type="radio" name="eztoc_disable_reason" required value="temporary"/>' . __('It is only temporary', 'easy-table-of-contents') . '</label></li>',
|
||||
2 => '<li><label><input type="radio" name="eztoc_disable_reason" required value="stopped showing toc"/>' . __('I stopped showing TOC on my site', 'easy-table-of-contents') . '</label></li>',
|
||||
3 => '<li><label><input type="radio" name="eztoc_disable_reason" required value="missing feature"/>' . __('I miss a feature', 'easy-table-of-contents') . '</label></li>
|
||||
<li><input type="text" name="eztoc_disable_text[]" value="" placeholder="Please describe the feature"/></li>',
|
||||
4 => '<li><label><input type="radio" name="eztoc_disable_reason" required value="technical issue"/>' . __('Technical Issue', 'easy-table-of-contents') . '</label></li>
|
||||
<li><textarea name="eztoc_disable_text[]" placeholder="' . __('Can we help? Please describe your problem', 'easy-table-of-contents') . '"></textarea></li>',
|
||||
5 => '<li><label><input type="radio" name="eztoc_disable_reason" required value="other plugin"/>' . __('I switched to another plugin', 'easy-table-of-contents') . '</label></li>
|
||||
<li><input type="text" name="eztoc_disable_text[]" value="" placeholder="Name of the plugin"/></li>',
|
||||
6 => '<li><label><input type="radio" name="eztoc_disable_reason" required value="other"/>' . __('Other reason', 'easy-table-of-contents') . '</label></li>
|
||||
<li><textarea name="eztoc_disable_text[]" placeholder="' . __('Please specify, if possible', 'easy-table-of-contents') . '"></textarea></li>',
|
||||
);
|
||||
shuffle($reasons);
|
||||
?>
|
||||
|
||||
|
||||
<div id="eztoc-reloaded-feedback-overlay" style="display: none;">
|
||||
<div id="eztoc-reloaded-feedback-content">
|
||||
<form action="" method="post">
|
||||
<h3><strong><?php _e('If you have a moment, please let us know why you are deactivating:', 'easy-table-of-contents'); ?></strong></h3>
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($reasons as $reason){
|
||||
echo $reason;
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php if( null !== $email && !empty( $email ) ) : ?>
|
||||
<input type="hidden" name="eztoc_disable_from" value="<?php echo $email; ?>" />
|
||||
<?php endif; ?>
|
||||
<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'); ?>"/>
|
||||
<a class="button eztoc-feedback-only-deactivate"><?php _e('Only Deactivate', 'easy-table-of-contents'); ?></a>
|
||||
<a class="eztoc-feedback-not-deactivate" href="#"><?php _e('Don\'t deactivate', 'easy-table-of-contents'); ?></a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,42 @@
|
||||
/* makebetter admin css*/
|
||||
|
||||
/**
|
||||
PLUGINS ADMIN PAGE
|
||||
*/
|
||||
#eztoc-reloaded-feedback-overlay {
|
||||
/* Height & width depends on how you want to reveal the overlay (see JS below) */
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: fixed; /* Stay in place */
|
||||
z-index: 10000; /* Sit on top */
|
||||
left: 0;
|
||||
top: 0;
|
||||
background-color: rgb(120,120,120); /* Black fallback color */
|
||||
background-color: rgba(0,0,0, 0.5); /* Black w/opacity */
|
||||
}
|
||||
#eztoc-reloaded-feedback-content {
|
||||
position: relative;
|
||||
top: 25%; /* 25% from the top */
|
||||
width: 500px;
|
||||
max-width: 100%;
|
||||
margin: auto;
|
||||
margin-top: 30px; /* 30px top margin to avoid conflict with the close button on smaller screens */
|
||||
max-height: 50%;
|
||||
padding: 20px;
|
||||
background-color: #fff;
|
||||
overflow-y: auto;
|
||||
}
|
||||
#eztoc-reloaded-feedback-content textarea,
|
||||
#eztoc-reloaded-feedback-content input[type="text"] { display:none;width:100%; }
|
||||
.eztoc-feedback-not-deactivate { display: block; text-align: right; }
|
||||
|
||||
#eztoc-reloaded-feedback-content h3{
|
||||
margin:5px;
|
||||
}
|
||||
|
||||
@media screen and (max-width:400px){
|
||||
#eztoc-reloaded-feedback-content {
|
||||
padding:0px;
|
||||
padding-bottom:50px;
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
var strict;
|
||||
|
||||
jQuery(document).ready(function ($) {
|
||||
/**
|
||||
* DEACTIVATION FEEDBACK FORM
|
||||
*/
|
||||
// show overlay when clicked on "deactivate"
|
||||
eztoc_deactivate_link = $('.wp-admin.plugins-php tr[data-slug="easy-table-of-contents"] .row-actions .deactivate a');
|
||||
eztoc_deactivate_link_url = eztoc_deactivate_link.attr('href');
|
||||
|
||||
eztoc_deactivate_link.click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
// only show feedback form once per 30 days
|
||||
var c_value = eztoc_admin_get_cookie("eztoc_hide_deactivate_feedback");
|
||||
|
||||
if (c_value === undefined) {
|
||||
$('#eztoc-reloaded-feedback-overlay').show();
|
||||
} else {
|
||||
// click on the link
|
||||
window.location.href = eztoc_deactivate_link_url;
|
||||
}
|
||||
});
|
||||
// show text fields
|
||||
$('#eztoc-reloaded-feedback-content input[type="radio"]').click(function () {
|
||||
// show text field if there is one
|
||||
var elementText = $(this).parents('li').next('li').children('input[type="text"], textarea');
|
||||
$(this).parents('ul').find('input[type="text"], textarea').not(elementText).hide().val('').attr('required', false);
|
||||
elementText.attr('required', 'required').show();
|
||||
});
|
||||
// send form or close it
|
||||
$('#eztoc-reloaded-feedback-content form').submit(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
eztoc_set_feedback_cookie();
|
||||
|
||||
// Send form data
|
||||
$.post(ajaxurl, {
|
||||
action: 'eztoc_send_feedback',
|
||||
data: $('#eztoc-reloaded-feedback-content form').serialize() + "&eztoc_security_nonce=" + cn_toc_admin_data.eztoc_security_nonce
|
||||
},
|
||||
function (data) {
|
||||
|
||||
if (data == 'sent') {
|
||||
// deactivate the plugin and close the popup
|
||||
$('#eztoc-reloaded-feedback-overlay').remove();
|
||||
window.location.href = eztoc_deactivate_link_url;
|
||||
} else {
|
||||
console.log('Error: ' + data);
|
||||
alert(data);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$("#eztoc-reloaded-feedback-content .eztoc-feedback-only-deactivate").click(function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
eztoc_set_feedback_cookie();
|
||||
|
||||
$('#eztoc-reloaded-feedback-overlay').remove();
|
||||
window.location.href = eztoc_deactivate_link_url;
|
||||
});
|
||||
|
||||
// close form without doing anything
|
||||
$('.eztoc-feedback-not-deactivate').click(function (e) {
|
||||
$('#eztoc-reloaded-feedback-content form')[0].reset();
|
||||
var elementText = $('#eztoc-reloaded-feedback-content input[type="radio"]').parents('li').next('li').children('input[type="text"], textarea');
|
||||
$(elementText).parents('ul').find('input[type="text"], textarea').hide().val('').attr('required', false);
|
||||
$('#eztoc-reloaded-feedback-overlay').hide();
|
||||
});
|
||||
|
||||
function eztoc_admin_get_cookie(name) {
|
||||
var i, x, y, eztoc_cookies = document.cookie.split(";");
|
||||
for (i = 0; i < eztoc_cookies.length; i++)
|
||||
{
|
||||
x = eztoc_cookies[i].substr(0, eztoc_cookies[i].indexOf("="));
|
||||
y = eztoc_cookies[i].substr(eztoc_cookies[i].indexOf("=") + 1);
|
||||
x = x.replace(/^\s+|\s+$/g, "");
|
||||
if (x === name)
|
||||
{
|
||||
return unescape(y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function eztoc_set_feedback_cookie() {
|
||||
// set cookie for 30 days
|
||||
var exdate = new Date();
|
||||
exdate.setSeconds(exdate.getSeconds() + 2592000);
|
||||
document.cookie = "eztoc_hide_deactivate_feedback=1; expires=" + exdate.toUTCString() + "; path=/";
|
||||
}
|
||||
});
|
@ -0,0 +1,143 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Helper Functions
|
||||
*
|
||||
* @package saswp
|
||||
* @subpackage Helper/Templates
|
||||
* @copyright Copyright (c) 2016, René Hermenau
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
||||
* @since 1.4.0
|
||||
*/
|
||||
// Exit if accessed directly
|
||||
if( !defined( 'ABSPATH' ) )
|
||||
exit;
|
||||
|
||||
/**
|
||||
* Helper method to check if user is in the plugins page.
|
||||
*
|
||||
* @author René Hermenau
|
||||
* @since 1.4.0
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
|
||||
/**
|
||||
* display deactivation logic on plugins page
|
||||
*
|
||||
* @since 1.4.0
|
||||
*/
|
||||
function eztoc_is_plugins_page() {
|
||||
|
||||
if(function_exists('get_current_screen')){
|
||||
$screen = get_current_screen();
|
||||
if(is_object($screen)){
|
||||
if($screen->id == 'plugins' || $screen->id == 'plugins-network'){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
add_filter('admin_footer', 'eztoc_add_deactivation_feedback_modal');
|
||||
function eztoc_add_deactivation_feedback_modal() {
|
||||
|
||||
if( !is_admin() && !eztoc_is_plugins_page()) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once EZ_TOC_PATH ."/includes/deactivate-feedback.php";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* send feedback via email
|
||||
*
|
||||
* @since 1.4.0
|
||||
*/
|
||||
function eztoc_send_feedback() {
|
||||
|
||||
if( isset( $_POST['data'] ) ) {
|
||||
parse_str( $_POST['data'], $form );
|
||||
}
|
||||
|
||||
if( !isset( $form['eztoc_security_nonce'] ) || isset( $form['eztoc_security_nonce'] ) && !wp_verify_nonce( sanitize_text_field( $form['eztoc_security_nonce'] ), 'eztoc_ajax_check_nonce' ) ) {
|
||||
echo 'security_nonce_not_verified';
|
||||
die();
|
||||
}
|
||||
if ( !current_user_can( 'manage_options' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
$text = '';
|
||||
if( isset( $form['eztoc_disable_text'] ) ) {
|
||||
$text = implode( "\n\r", $form['eztoc_disable_text'] );
|
||||
}
|
||||
|
||||
$headers = array();
|
||||
|
||||
$from = isset( $form['eztoc_disable_from'] ) ? $form['eztoc_disable_from'] : '';
|
||||
if( $from ) {
|
||||
$headers[] = "From: $from";
|
||||
$headers[] = "Reply-To: $from";
|
||||
}
|
||||
|
||||
$subject = isset( $form['eztoc_disable_reason'] ) ? $form['eztoc_disable_reason'] : '(no reason given)';
|
||||
|
||||
if($subject == 'technical issue'){
|
||||
|
||||
$text = trim($text);
|
||||
|
||||
if(!empty($text)){
|
||||
|
||||
$text = 'technical issue description: '.$text;
|
||||
|
||||
}else{
|
||||
|
||||
$text = 'no description: '.$text;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$success = wp_mail( 'team@magazine3.in', $subject, $text, $headers );
|
||||
|
||||
echo 'sent';
|
||||
die();
|
||||
}
|
||||
add_action( 'wp_ajax_eztoc_send_feedback', 'eztoc_send_feedback' );
|
||||
|
||||
function eztoc_enqueue_makebetter_email_js(){
|
||||
|
||||
if( !is_admin() && !eztoc_is_plugins_page()) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_enqueue_script( 'eztoc-make-better-js', EZ_TOC_URL . 'includes/feedback.js', array( 'jquery' ));
|
||||
|
||||
wp_enqueue_style( 'eztoc-make-better-css', EZ_TOC_URL . 'includes/feedback.css', false );
|
||||
}
|
||||
add_action( 'admin_enqueue_scripts', 'eztoc_enqueue_makebetter_email_js' );
|
||||
|
||||
|
||||
add_action('wp_ajax_eztoc_subscribe_newsletter','eztoc_subscribe_for_newsletter');
|
||||
function eztoc_subscribe_for_newsletter(){
|
||||
if( !wp_verify_nonce( sanitize_text_field( $_POST['eztoc_security_nonce'] ), 'eztoc_ajax_check_nonce' ) ) {
|
||||
echo 'security_nonce_not_verified';
|
||||
die();
|
||||
}
|
||||
if ( !current_user_can( 'manage_options' ) ) {
|
||||
die();
|
||||
}
|
||||
$api_url = 'http://magazine3.company/wp-json/api/central/email/subscribe';
|
||||
$api_params = array(
|
||||
'name' => sanitize_text_field($_POST['name']),
|
||||
'email'=> sanitize_email($_POST['email']),
|
||||
'website'=> sanitize_text_field($_POST['website']),
|
||||
'type'=> 'etoc'
|
||||
);
|
||||
$response = wp_remote_post( $api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
|
||||
$response = wp_remote_retrieve_body( $response );
|
||||
echo $response;
|
||||
die;
|
||||
}
|
@ -0,0 +1,873 @@
|
||||
<div id='toc' class='wrap'>
|
||||
<a href="https://tocwp.com/" target="_blank">
|
||||
<img src="<?php echo plugins_url('assets/eztoc-logo.png', dirname(__FILE__)) ?>" alt="tocwp"
|
||||
srcset="<?php echo plugins_url('assets/eztoc-logo.png', dirname(__FILE__)) ?> 1x, <?php echo plugins_url('assets/eztoc-logo.png', dirname(__FILE__)) ?> 2x">
|
||||
</a>
|
||||
<h1 style="display:none;"> </h1>
|
||||
<div class="toc-tab-panel">
|
||||
<a id="eztoc-welcome" class="eztoc-tablinks" data-href="no" href="#welcome"
|
||||
onclick="ezTocTabToggle(event, 'welcome')"><?php esc_html_e( 'Welcome', 'easy-table-of-contents' ) ?></a>
|
||||
<a id="eztoc-default" class="eztoc-tablinks" data-href="no" href="#general-settings"
|
||||
onclick="ezTocTabToggle(event, 'general')"><?php esc_html_e( 'Settings', 'easy-table-of-contents' ) ?></a>
|
||||
<?php
|
||||
$pro = '';
|
||||
|
||||
if (function_exists('ez_toc_pro_activation_link')) {
|
||||
$pro = '<a id="eztoc-default" class="eztoc-tablinks ez-toc-pro-settings-link-paid" data-href="no" href="#eztoc-prosettings" onclick="ezTocTabToggle(event, \'general\')">' . esc_html__( 'PRO Settings', 'easy-table-of-contents' ) . '</a>';
|
||||
}
|
||||
?>
|
||||
<?php echo $pro; ?>
|
||||
|
||||
<?php
|
||||
if (!function_exists('ez_toc_pro_activation_link')) { ?>
|
||||
<a class="eztoc-tablinks" id="eztoc-freevspro" href="#freevspro-support"
|
||||
onclick="ezTocTabToggle(event, 'freevspro')" data-href="no"><?php esc_html_e( 'Free vs PRO', 'easy-table-of-contents' ) ?></a>
|
||||
<?php }
|
||||
?>
|
||||
<a class="eztoc-tablinks" id="eztoc-technical" href="#technical-support"
|
||||
onclick="ezTocTabToggle(event, 'technical')" data-href="no"><?php esc_html_e( 'Help & Support', 'easy-table-of-contents' ) ?></a>
|
||||
<?php if (!function_exists('ez_toc_pro_activation_link')) { ?>
|
||||
<a class="eztoc-tablinks" id="eztoc-upgrade" href="https://tocwp.com/pricing/" target="_blank"><?php esc_html_e( 'UPGRADE to PRO', 'easy-table-of-contents' ) ?></a>
|
||||
<?php } ?>
|
||||
<?php
|
||||
|
||||
if (function_exists('ez_toc_pro_activation_link')) {
|
||||
$license_info = get_option("easytoc_pro_upgrade_license");
|
||||
$license_exp = null;
|
||||
if( !empty( $license_info['pro']['license_key_expires'] ) ) {
|
||||
$license_exp = date( 'Y-m-d', strtotime($license_info['pro']['license_key_expires'] ) );
|
||||
}
|
||||
|
||||
?>
|
||||
<a class="eztoc-tablinks" id="eztoc-license" href="#license"
|
||||
onclick="ezTocTabToggle(event, 'license')"
|
||||
data-href="no"><?php esc_html_e('License', 'easy-table-of-contents') ?>
|
||||
</a>
|
||||
<?php
|
||||
|
||||
$today = date('Y-m-d');
|
||||
$exp_date = $license_exp;
|
||||
$date1 = date_create($today);
|
||||
if($exp_date){
|
||||
$date2 = date_create($exp_date);
|
||||
$diff = date_diff($date1, $date2);
|
||||
$days = $diff->format("%a");
|
||||
$days = intval($days);
|
||||
if ($days < 30) {
|
||||
?>
|
||||
<span class="dashicons dashicons-warning" style="color: #ffb229;position: relative;top:
|
||||
15px;left: -10px;"></span>
|
||||
<?php }
|
||||
}
|
||||
|
||||
} ?>
|
||||
</div><!-- /.Tab panel -->
|
||||
<div class="eztoc_support_div eztoc-tabcontent" id="welcome" style="display: block;">
|
||||
<p style="font-weight: bold;font-size: 30px;color: #000;"><?php esc_html_e( 'Thank YOU for using Easy Table of Content.', 'easy-table-of-contents' ) ?></p>
|
||||
<p style="font-size: 18px;padding: 0 10%;line-height: 1.7;color: #000;"><?php esc_html_e( 'We strive to create the best TOC solution in WordPress. Our dedicated development team does continuous development and innovation to make sure we are able to meet your demand.', 'easy-table-of-contents' ) ?></p>
|
||||
<p style="font-size: 16px;font-weight: 600;color: #000;"><?php esc_html_e( 'Please support us by Upgrading to Premium version.', 'easy-table-of-contents' ) ?></p>
|
||||
<a target="_blank" href="https://tocwp.com/pricing/">
|
||||
<button class="button-toc" style="display: inline-block;font-size: 20px;">
|
||||
<span><?php esc_html_e( 'YES! I want to Support by UPGRADING.', 'easy-table-of-contents' ) ?></span></button>
|
||||
</a>
|
||||
<a href="<?php echo add_query_arg('page', 'table-of-contents', admin_url('options-general.php')); ?>"
|
||||
style="text-decoration: none;">
|
||||
<button class="button-toc1"
|
||||
style="display: block;text-align: center;border: 0;margin: 0 auto;background: none;">
|
||||
<span style="cursor: pointer;"><?php esc_html_e( 'No Thanks, I will stick with FREE version for now.', 'easy-table-of-contents' ) ?></span>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
<div class="eztoc-tabcontent" id="general">
|
||||
<div id="eztoc-tabs" style="margin-top: 10px;">
|
||||
<a href="#eztoc-general" id="eztoc-link-general" class="active"><?php esc_html_e( 'General', 'easy-table-of-contents' ) ?></a> | <a href="#eztoc-appearance" id="eztoc-link-appearance"><?php esc_html_e( 'Appearance', 'easy-table-of-contents' ) ?></a> | <a href="#eztoc-advanced" id="eztoc-link-advanced"><?php esc_html_e( 'Advanced', 'easy-table-of-contents' ) ?></a> | <a href="#eztoc-shortcode" id="eztoc-link-shortcode"><?php esc_html_e( 'Shortcode', 'easy-table-of-contents' ) ?></a> | <a href="#eztoc-sticky" id="eztoc-link-sticky"><?php esc_html_e( 'Sticky TOC', 'easy-table-of-contents' ) ?></a> | <a href="#eztoc-compatibility" id="eztoc-link-compatibility"><?php esc_html_e( 'Compatibility', 'easy-table-of-contents' ) ?></a> | <a href="#eztoc-iesettings" id="eztoc-link-iesettings"><?php esc_html_e( 'Import/Export', 'easy-table-of-contents' ) ?></a>
|
||||
</div>
|
||||
<form method="post" action="<?php echo esc_url(self_admin_url('options.php')); ?>" enctype="multipart/form-data">
|
||||
|
||||
<div class="metabox-holder">
|
||||
|
||||
<div class="postbox" id="eztoc-general">
|
||||
<br />
|
||||
<h3><span><?php esc_html_e('General', 'easy-table-of-contents'); ?></span></h3>
|
||||
|
||||
<div class="inside">
|
||||
|
||||
<table class="form-table">
|
||||
|
||||
<?php do_settings_fields('ez_toc_settings_general', 'ez_toc_settings_general'); ?>
|
||||
|
||||
</table>
|
||||
</div><!-- /.inside -->
|
||||
</div><!-- /.postbox -->
|
||||
|
||||
</div><!-- /.metabox-holder -->
|
||||
|
||||
<div class="metabox-holder">
|
||||
|
||||
<div class="postbox" id="eztoc-appearance">
|
||||
<br />
|
||||
<h3><span><?php esc_html_e('Appearance', 'easy-table-of-contents'); ?></span></h3>
|
||||
|
||||
<div class="inside">
|
||||
|
||||
<table class="form-table">
|
||||
|
||||
<?php do_settings_fields('ez_toc_settings_appearance', 'ez_toc_settings_appearance'); ?>
|
||||
|
||||
</table>
|
||||
|
||||
</div><!-- /.inside -->
|
||||
</div><!-- /.postbox -->
|
||||
|
||||
</div><!-- /.metabox-holder -->
|
||||
|
||||
<div class="metabox-holder">
|
||||
|
||||
<div class="postbox" id="eztoc-advanced">
|
||||
<br />
|
||||
<h3><span><?php esc_html_e('Advanced', 'easy-table-of-contents'); ?></span></h3>
|
||||
|
||||
<div class="inside">
|
||||
|
||||
<table class="form-table">
|
||||
|
||||
<?php do_settings_fields('ez_toc_settings_advanced', 'ez_toc_settings_advanced'); ?>
|
||||
|
||||
</table>
|
||||
|
||||
</div><!-- /.inside -->
|
||||
</div><!-- /.postbox -->
|
||||
|
||||
</div><!-- /.metabox-holder -->
|
||||
|
||||
<div class="metabox-holder">
|
||||
|
||||
<div class="postbox" id="eztoc-shortcode">
|
||||
<br />
|
||||
<h3><span><?php esc_html_e('Shortcode', 'easy-table-of-contents'); ?></span></h3>
|
||||
<div class="inside">
|
||||
|
||||
<table class="form-table">
|
||||
<?php do_settings_fields('ez_toc_settings_shortcode', 'ez_toc_settings_shortcode'); ?>
|
||||
</table>
|
||||
|
||||
</div><!-- /.inside -->
|
||||
</div><!-- /.postbox -->
|
||||
|
||||
</div><!-- /.metabox-holder -->
|
||||
|
||||
<div class="metabox-holder">
|
||||
|
||||
<div class="postbox" id="eztoc-sticky">
|
||||
<br />
|
||||
<h3><span><?php esc_html_e('Sticky TOC', 'easy-table-of-contents'); ?></span></h3>
|
||||
<div class="inside">
|
||||
|
||||
<table class="form-table">
|
||||
<?php do_settings_fields('ez_toc_settings_sticky', 'ez_toc_settings_sticky'); ?>
|
||||
</table>
|
||||
|
||||
</div><!-- /.inside -->
|
||||
</div><!-- /.postbox -->
|
||||
|
||||
</div><!-- /.metabox-holder -->
|
||||
|
||||
<div class="metabox-holder">
|
||||
|
||||
<div class="postbox" id="eztoc-compatibility">
|
||||
<br />
|
||||
<h3><span><?php esc_html_e('Compatibility', 'easy-table-of-contents'); ?></span></h3>
|
||||
<div class="inside">
|
||||
|
||||
<table class="form-table">
|
||||
<?php do_settings_fields('ez_toc_settings_compatibility', 'ez_toc_settings_compatibility'); ?>
|
||||
</table>
|
||||
|
||||
</div><!-- /.inside -->
|
||||
</div><!-- /.postbox -->
|
||||
|
||||
</div><!-- /.metabox-holder -->
|
||||
|
||||
<div class="metabox-holder">
|
||||
|
||||
<div class="postbox" id="eztoc-iesettings">
|
||||
<br />
|
||||
<h3><span><?php esc_html_e('Import/Export Settings', 'easy-table-of-contents'); ?></span></h3>
|
||||
<div class="inside">
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php $url = wp_nonce_url(admin_url('admin-ajax.php?action=ez_toc_export_all_settings'), '_wpnonce'); ?>
|
||||
<th scope="row"><?php echo __( 'Export Settings', 'easy-table-of-contents' ) ?></th>
|
||||
<td>
|
||||
<button type="button"><a href="<?php echo esc_url($url); ?>" style="text-decoration:none; color: black;"><?php echo __('Export', 'easy-table-of-contents'); ?></a></button>
|
||||
<label> <br><?php echo __('Export all ETOC settings to json file', 'easy-table-of-contents'); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php echo __( 'Import Settings', 'easy-table-of-contents' ) ?></th>
|
||||
<td>
|
||||
<input type="file" name="eztoc_import_backup" id="eztoc-import-backup">
|
||||
<label> <br><?php echo __('Upload json settings file to import', 'easy-table-of-contents'); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div><!-- /.inside -->
|
||||
</div><!-- /.postbox -->
|
||||
|
||||
</div><!-- /.metabox-holder -->
|
||||
|
||||
<?php if (function_exists('ez_toc_pro_activation_link')) { ?>
|
||||
<div class="metabox-holder">
|
||||
|
||||
<div class="postbox" id="eztoc-prosettings">
|
||||
<br />
|
||||
<h3><span><?php esc_html_e('PRO Settings', 'easy-table-of-contents'); ?></span></h3>
|
||||
<div class="inside">
|
||||
|
||||
<table class="form-table">
|
||||
<?php do_settings_fields('ez_toc_settings_prosettings', 'ez_toc_settings_prosettings'); ?>
|
||||
|
||||
</table>
|
||||
|
||||
</div><!-- /.inside -->
|
||||
</div><!-- /.postbox -->
|
||||
|
||||
</div><!-- /.metabox-holder -->
|
||||
<?php } ?>
|
||||
<?php settings_fields('ez-toc-settings'); ?>
|
||||
<p class="submit">
|
||||
<?php submit_button(esc_html__( 'Save Changes', 'easy-table-of-contents' ), 'primary large', 'submit', false) ; ?>
|
||||
<button type="button" id="reset-options-to-default-button" class="button button-primary button-large" style="background-color: #cd3241"><?php esc_html_e( 'Reset', 'easy-table-of-contents' ) ?></button>
|
||||
</p>
|
||||
</form>
|
||||
</div><!-- /.General Settings ended -->
|
||||
|
||||
|
||||
<div class="eztoc_support_div eztoc-tabcontent" id="technical">
|
||||
<div id="eztoc-tabs-technical">
|
||||
<a href="#" onclick="ezTocTabToggle(event, 'eztoc-technical-support',
|
||||
'eztoc-tabcontent-technical', 'eztoc-tablinks-technical')"
|
||||
class="eztoc-tablinks-technical active"><?php echo esc_html_e('Technical Support', 'easy-table-of-contents') ?></a>
|
||||
|
|
||||
<a href="#" onclick="ezTocTabToggle(event, 'eztoc-technical-how-to-use',
|
||||
'eztoc-tabcontent-technical', 'eztoc-tablinks-technical')"
|
||||
class="eztoc-tablinks-technical"><?php echo esc_html_e('How to Use', 'easy-table-of-contents') ?></a>
|
||||
|
|
||||
<a href="#" onclick="ezTocTabToggle(event, 'eztoc-technical-shortcode',
|
||||
'eztoc-tabcontent-technical', 'eztoc-tablinks-technical')"
|
||||
class="eztoc-tablinks-technical"><?php echo esc_html_e('Shortcode', 'easy-table-of-contents') ?></a>
|
||||
|
|
||||
<a href="https://tocwp.com/docs/" target="_blank" class="eztoc-tablinks-technical"><?php echo
|
||||
esc_html_e('Documentation', 'easy-table-of-contents') ?></a>
|
||||
|
|
||||
<a href="#" onclick="ezTocTabToggle(event, 'eztoc-technical-hooks-for-developers',
|
||||
'eztoc-tabcontent-technical', 'eztoc-tablinks-technical')"
|
||||
class="eztoc-tablinks-technical"><?php echo esc_html_e('Hooks (for Developers)', 'easy-table-of-contents') ?></a>
|
||||
</div>
|
||||
<div class="eztoc-form-page-ui">
|
||||
<div class="eztoc-left-side">
|
||||
<div class="eztoc-tabcontent-technical" id="eztoc-technical-support">
|
||||
<h1><?php esc_html_e('Technical Support', 'easy-table-of-contents'); ?></h1>
|
||||
<p class="ez-toc-tabcontent-technical-title-content"><?php echo esc_html_e('We are dedicated to provide Technical support & Help to our users. Use the below form for sending your questions.', 'easy-table-of-contents') ?> </p>
|
||||
<p><?php echo esc_html_e('You can also contact us from ', 'easy-table-of-contents') ?><a
|
||||
href="https://tocwp.com/contact/">https://tocwp.com/contact/</a>.</p>
|
||||
|
||||
<div class="eztoc_support_div_form" id="technical-form">
|
||||
<ul>
|
||||
<li>
|
||||
<label class="ez-toc-support-label"><?php esc_html_e( 'Email', 'easy-table-of-contents' ) ?><span class="star-mark">*</span></label>
|
||||
<div class="ez-toc-support-input">
|
||||
|
||||
<input type="text" id="eztoc_query_email" name="eztoc_query_email"
|
||||
placeholder="<?php esc_html_e( 'Enter your Email', 'easy-table-of-contents' ) ?>" required style="width: 350px;"/>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<label class="ez-toc-support-label"><?php esc_html_e( 'Query', 'easy-table-of-contents' ) ?><span class="star-mark">*</span></label>
|
||||
|
||||
<div class="ez-toc-support-input">
|
||||
<label for="eztoc_query_message">
|
||||
<textarea rows="5" cols="50" id="eztoc_query_message"
|
||||
name="eztoc_query_message"
|
||||
placeholder="<?php esc_html_e( 'Write your query', 'easy-table-of-contents' ) ?>"></textarea></label>
|
||||
</div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<div class="eztoc-customer-type">
|
||||
<label class="ez-toc-support-label"><?php esc_html_e( 'Type', 'easy-table-of-contents' ) ?></label>
|
||||
<div class="ez-toc-support-input">
|
||||
<select name="eztoc_customer_type" id="eztoc_customer_type" style="width: 350px;">
|
||||
<option value="select"><?php esc_html_e( 'Select Customer Type', 'easy-table-of-contents' ) ?></option>
|
||||
<option value="paid"><?php esc_html_e( 'Paid', 'easy-table-of-contents' ) ?><span> <?php esc_html_e( '(Response within 24 hrs)', 'easy-table-of-contents' ) ?></span>
|
||||
</option>
|
||||
<option value="free">
|
||||
<?php esc_html_e( 'Free', 'easy-table-of-contents' ) ?><span> <?php esc_html_e( '( Avg Response within 48-72 hrs)', 'easy-table-of-contents' ) ?></span>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<button class="button button-primary eztoc-send-query"><?php echo esc_html_e('Send Support Request', 'easy-table-of-contents'); ?></button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clear"></div>
|
||||
<span class="eztoc-query-success eztoc-result eztoc_hide"><?php echo esc_html_e('Message sent successfully, Please wait we will get back to you shortly', 'easy-table-of-contents'); ?></span>
|
||||
<span class="eztoc-query-error eztoc-result eztoc_hide"><?php echo esc_html_e('Message not sent. please check your network connection', 'easy-table-of-contents'); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="eztoc-tabcontent-technical" id="eztoc-technical-how-to-use" style="display:
|
||||
none;">
|
||||
<h1><?php esc_html_e('How to Use', 'easy-table-of-contents'); ?></h1>
|
||||
<p class="ez-toc-tabcontent-technical-title-content"><?php esc_html_e('You can check how to use `Easy Table of Contents`, follow the basic details below.', 'easy-table-of-contents'); ?></p>
|
||||
<h3><?php esc_html_e('1. AUTOMATICALLY', 'easy-table-of-contents'); ?></h3>
|
||||
<ol>
|
||||
<li><?php esc_html_e('Go to the tab Settings > General section, check Auto Insert', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('Select the post types which will have the table of contents automatically inserted.', 'easy-table-of-contents'); ?></li>
|
||||
<li><?php esc_html_e('NOTE: The table of contents will only be automatically inserted on post types for which it has been enabled.', 'easy-table-of-contents'); ?></li>
|
||||
<li><?php esc_html_e('After Auto Insert, the Position option for choosing where you want to display the `Easy Table of Contents`.', 'easy-table-of-contents'); ?></li>
|
||||
</ol>
|
||||
<h3><?php esc_html_e('2. MANUALLY', 'easy-table-of-contents'); ?></h3>
|
||||
<p><?php esc_html_e('There are two ways for manual adding & display `Easy Table of Contents`:', 'easy-table-of-contents');
|
||||
?></p>
|
||||
<ol>
|
||||
<li><?php esc_html_e('Using shortcode, you can copy shortcode and paste the shortcode on editor of any post type.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('Using Insert table of contents option on editor of any post type.',
|
||||
'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You have to choose post types on tab General > Enable Support section then `Easy Table of Contents` editor options would be shown to choose settings for particular post type.', 'easy-table-of-contents'); ?></li>
|
||||
</ol>
|
||||
<h3><?php esc_html_e('3. DESIGN CUSTOMIZATION', 'easy-table-of-contents');
|
||||
?></h3>
|
||||
<ol>
|
||||
<li><?php esc_html_e('Go to tab Settings > Appearance for design customization.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can change width of `Easy Table of Contents` from select Fixed or Relative sizes or you select custom width then it will be showing custom width option for enter manually width.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also choose Alignment of `Easy Table of Contents`.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also set Font Option of `Easy Table of Contents` according to your needs.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also choose Theme color of `Easy Table of Contents` on Theme Options section according to your choice.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also choose Custom Theme colors of `Easy Table of Contents`. according to your requirements', 'easy-table-of-contents');
|
||||
?></li>
|
||||
</ol>
|
||||
<h3><?php esc_html_e('4. STICKY TABLE', 'easy-table-of-contents');
|
||||
?></h3>
|
||||
<ol>
|
||||
<li><?php esc_html_e('Go to Sticky TOC tab to show Table of contents as sticky on your site.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('Select the post types on which sticky table of contents has been to be enabled.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also decide whether to have sticky table of contents enabled on Homepage.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also decide whether to have sticky table of contents enabled on Category|Tag.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also decide whether to have sticky table of contents enabled on Product Category.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also decide whether to have sticky table of contents enabled on Custom Taxonomy.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also decide on which device you want to show sticky table of contents Mobile or Laptop.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also decide the position of sticky table of contents on left or right.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also choose Alignment of Sticky `Easy Table of Contents`.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also decide whether the sticky toc should be opened by default on load.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can change width of Sticky `Easy Table of Contents` from select Fixed or Relative sizes or you select custom width then it will be showing custom width option for enter manually width.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can change height of Sticky `Easy Table of Contents` from select Fixed or Relative sizes or you select custom height then it will be showing custom height option for enter manually height.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can change Button Text of Sticky `Easy Table of Contents`.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also choose Click TOC Close on Mobile of Sticky `Easy Table of Contents`.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also choose Click TOC Close on desktop of Sticky `Easy Table of Contents`.', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also change title of Sticky `Easy Table of Contents`. (PRO)', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also highlight headings while scrolling of Sticky `Easy Table of Contents`. (PRO)', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also change background of highlight headings of Sticky `Easy Table of Contents`. (PRO)', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also change title of highlight headings of Sticky `Easy Table of Contents`. (PRO)', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also choose Theme color of Sticky `Easy Table of Contents` on Theme Options section according to your choice. (PRO)', 'easy-table-of-contents');
|
||||
?></li>
|
||||
<li><?php esc_html_e('You can also choose Custom Theme colors of Sticky `Easy Table of Contents` according to your requirements. (PRO)', 'easy-table-of-contents');
|
||||
?></li>
|
||||
</ol>
|
||||
<h3><?php esc_html_e('5. MORE DOCUMENTATION:', 'easy-table-of-contents'); ?></h3>
|
||||
<p><?php esc_html__('You can visit this link ', 'easy-table-of-contents') . '<a href="https://tocwp.com/docs/" target="_blank">' . esc_html__('More Documentation', 'easy-table-of-contents') . '</a>' . esc_html__(' for more documentation of `Easy Table of Contents`', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
<div class="eztoc-tabcontent-technical" id="eztoc-technical-shortcode" style="display: none;">
|
||||
<h1><?php esc_html_e('Shortcode', 'easy-table-of-contents'); ?></h1>
|
||||
<p class="ez-toc-tabcontent-technical-title-content"><?php esc_html_e('Use the following shortcode within your content to have the table of contents display where you wish to:', 'easy-table-of-contents'); ?></p>
|
||||
<table class="form-table">
|
||||
<?php do_settings_fields('ez_toc_settings_shortcode', 'ez_toc_settings_shortcode'); ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="eztoc-tabcontent-technical" id="eztoc-technical-hooks-for-developers" style="display:
|
||||
none;">
|
||||
<h1><?php esc_html_e('Hooks (for Developers)', 'easy-table-of-contents'); ?></h1>
|
||||
<p class="ez-toc-tabcontent-technical-title-content"><?php echo esc_html_e('This plugin has been designed for easiest way & best features for the users & also as well as for the developers, any developer follow the below advanced instructions:', 'easy-table-of-contents') ?> </p>
|
||||
|
||||
<h2><?php echo esc_html_e('Hooks', 'easy-table-of-contents') ?></h2>
|
||||
<p><?php echo esc_html_e('Developer can use these below hooks for customization of this plugin:', 'easy-table-of-contents')
|
||||
?></p>
|
||||
<h4><?php echo esc_html_e('Actions:', 'easy-table-of-contents') ?></h4>
|
||||
<ul>
|
||||
<li><code><?php echo esc_html_e('ez_toc_before', 'easy-table-of-contents') ?></code>
|
||||
</li>
|
||||
<li><code><?php echo esc_html_e('ez_toc_after', 'easy-table-of-contents')
|
||||
?></code></li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('ez_toc_sticky_toggle_before', 'easy-table-of-contents') ?></code>
|
||||
</li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('ez_toc_sticky_toggle_after', 'easy-table-of-contents')
|
||||
?></code></li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('ez_toc_before_widget_container', 'easy-table-of-contents')
|
||||
?></code></li>
|
||||
<li><code><?php echo esc_html_e('ez_toc_before_widget', 'easy-table-of-contents')
|
||||
?></code></li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('ez_toc_after_widget_container', 'easy-table-of-contents') ?></code>
|
||||
</li>
|
||||
<li><code><?php echo esc_html_e('ez_toc_after_widget', 'easy-table-of-contents')
|
||||
?></code></li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('ez_toc_title', 'easy-table-of-contents') ?></code>
|
||||
</li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('ez_toc_sticky_title', 'easy-table-of-contents') ?></code>
|
||||
</li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('ez_toc_container_class', 'easy-table-of-contents') ?></code>
|
||||
</li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('ez_toc_widget_sticky_container_class', 'easy-table-of-contents') ?></code>
|
||||
</li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('ez_toc_url_anchor_target', 'easy-table-of-contents') ?></code>
|
||||
</li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('ez_toc_sticky_enable_support', 'easy-table-of-contents') ?></code>
|
||||
</li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('ez_toc_sticky_post_types', 'easy-table-of-contents') ?></code>
|
||||
</li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('ez_toc_modify_icon', 'easy-table-of-contents') ?></code>
|
||||
</li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('ez_toc_label_below_html', 'easy-table-of-contents') ?></code>
|
||||
</li>
|
||||
<li>
|
||||
<code><?php echo esc_html_e('eztoc_wordpress_final_output', 'easy-table-of-contents') ?></code>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h4><?php echo esc_html_e('Example: adding a span tag before the `Easy Table of Contents`',
|
||||
'easy-table-of-contents') ?></h4>
|
||||
<p><?php echo esc_html_e("Get this following code and paste into your theme\'s function.php file:", 'easy-table-of-contents') ?></p>
|
||||
<pre>
|
||||
<?php
|
||||
$addCustomSpanText = esc_html_e("Some Text or Element here ", 'easy-table-of-contents');
|
||||
echo "
|
||||
add_action( 'ez_toc_before', 'addCustomSpan' );
|
||||
function addCustomSpan()
|
||||
{
|
||||
echo '<span>$addCustomSpanText</span>';
|
||||
}
|
||||
"; ?>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="eztoc-right-side">
|
||||
<div class="eztoc-bio-box" id="ez_Bio">
|
||||
<h1><?php echo esc_html_e("Vision & Mission", 'easy-table-of-contents') ?></h1>
|
||||
<p class="eztoc-p"><?php echo esc_html_e("We strive to provide the best TOC in the world.", 'easy-table-of-contents') ?></p>
|
||||
<section class="eztoc_dev-bio">
|
||||
<div class="ezoc-bio-wrap">
|
||||
<img width="50px" height="50px"
|
||||
src="<?php echo plugins_url('assets/ahmed-kaludi.jpg', dirname(__FILE__))
|
||||
?>" alt="ahmed-kaludi"/>
|
||||
<p><?php esc_html_e('Lead Dev', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
<div class="ezoc-bio-wrap">
|
||||
<img width="50px" height="50px"
|
||||
src="<?php echo plugins_url('assets/Mohammed-kaludi.jpeg', dirname
|
||||
(__FILE__)) ?>" alt="Mohammed-kaludi"/>
|
||||
<p><?php esc_html_e('Developer', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
<div class="ezoc-bio-wrap">
|
||||
<img width="50px" height="50px"
|
||||
src="<?php echo plugins_url('assets/sanjeev.jpg', dirname(__FILE__)) ?>"
|
||||
alt="Sanjeev"/>
|
||||
<p><?php esc_html_e('Developer', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
</section>
|
||||
<p class="eztoc_boxdesk"><?php esc_html_e('Delivering a good user experience means a lot to us, so we try our best to reply each and every question.', 'easy-table-of-contents'); ?></p>
|
||||
<p class="ez-toc-company-link"><?php esc_html_e('Support the innovation & development by upgrading to PRO ', 'easy-table-of-contents'); ?> <a href="https://tocwp.com/pricing/"><?php esc_html_e('I Want To Upgrade!', 'easy-table-of-contents'); ?></a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /.Technical support div ended -->
|
||||
|
||||
<div class="eztoc_support_div eztoc-tabcontent" id="freevspro">
|
||||
<div class="eztoc-wrapper">
|
||||
<div class="eztoc-wr">
|
||||
<div class="etoc-eztoc-img">
|
||||
<span class="sp_ov"></span>
|
||||
</div>
|
||||
<div class="etoc-eztoc-cnt">
|
||||
<h1><?php esc_html_e('UPGRADE to PRO Version', 'easy-table-of-contents'); ?></h1>
|
||||
<p><?php esc_html_e('Take your Table of Contents to the NEXT Level!', 'easy-table-of-contents'); ?></p>
|
||||
<a class="buy" href="#upgrade"><?php esc_html_e('Purchase Now', 'easy-table-of-contents'); ?></a>
|
||||
</div>
|
||||
<div class="pvf">
|
||||
<div class="ext">
|
||||
<div class="ex-1 e-1">
|
||||
<h4><?php esc_html_e('Premium Features', 'easy-table-of-contents'); ?></h4>
|
||||
<p><?php esc_html_e('Easy TOC Pro will enhances your website table of contents and takes it to a next level to help you reach more engagement and personalization with your users.', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
<div class="ex-1 e-2">
|
||||
<h4><?php esc_html_e('Continuous Innovation', 'easy-table-of-contents'); ?></h4>
|
||||
<p><?php esc_html_e('We are planning to continiously build premium features and release them. We have a roadmap and we listen to our customers to turn their feedback into reality.', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
<div class="ex-1 e-3">
|
||||
<h4><?php esc_html_e('Tech Support', 'easy-table-of-contents'); ?></h4>
|
||||
<p><?php esc_html_e('Get private ticketing help from our full-time technical staff & developers who helps you with the technical issues.', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
</div><!-- /. ext -->
|
||||
<div class="pvf-cnt">
|
||||
<div class="pvf-tlt">
|
||||
<h2><?php esc_html_e('Compare Pro vs. Free Version', 'easy-table-of-contents'); ?></h2>
|
||||
<span><?php esc_html_e('See what you\'ll get with the professional version', 'easy-table-of-contents'); ?></span>
|
||||
</div>
|
||||
<div class="pvf-cmp">
|
||||
<div class="fr">
|
||||
<h1><?php esc_html_e('FREE', 'easy-table-of-contents'); ?></h1>
|
||||
<div class="fr-fe">
|
||||
<div class="fe-1">
|
||||
<h4><?php esc_html_e('Continious Development', 'easy-table-of-contents'); ?></h4>
|
||||
<p><?php esc_html_e('We take bug reports and feature requests seriously. We’re continiously developing & improve this product for last 2 years with passion and love.', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
<div class="fe-1">
|
||||
<h4><?php esc_html_e('50+ Features', 'easy-table-of-contents'); ?></h4>
|
||||
<p><?php esc_html_e('We\'re constantly expanding the plugin and make it more useful. We have wide variety of features which will fit any use-case.', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
</div><!-- /. fr-fe -->
|
||||
</div><!-- /. fr -->
|
||||
<div class="pr">
|
||||
<h1><?php esc_html_e('PRO', 'easy-table-of-contents'); ?></h1>
|
||||
<div class="pr-fe">
|
||||
<span><?php esc_html_e('Everything in Free, and:', 'easy-table-of-contents'); ?></span>
|
||||
<div class="fet">
|
||||
<div class="fe-2">
|
||||
<div class="fe-t">
|
||||
<img src="<?php echo plugins_url('assets/right-tick.png',
|
||||
dirname(__FILE__)) ?>" alt="right-tick"/>
|
||||
<h4><?php esc_html_e('Gutenberg Block', 'easy-table-of-contents'); ?></h4>
|
||||
</div>
|
||||
<p><?php esc_html_e('Easily create TOC in Gutenberg block without the need any coding or shortcode.', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
<div class="fe-2">
|
||||
<div class="fe-t">
|
||||
<img src="<?php echo plugins_url('assets/right-tick.png',
|
||||
dirname(__FILE__)) ?>" alt="right-tick"/>
|
||||
<h4><?php esc_html_e('Elementor Widget', 'easy-table-of-contents'); ?></h4>
|
||||
</div>
|
||||
<p><?php esc_html_e('Easily create TOC in Elementor with the widget without the need any coding or shortcode.', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="fe-2">
|
||||
<div class="fe-t">
|
||||
<img src="<?php echo plugins_url('assets/right-tick.png',
|
||||
dirname(__FILE__)) ?>" alt="right-tick"/>
|
||||
<h4><?php esc_html_e('Fixed/Sticky TOC', 'easy-table-of-contents'); ?></h4>
|
||||
</div>
|
||||
<p><?php esc_html_e('Users can faster find the content they want with sticky. Also can change the position of Sticky table of contents with different options.', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="fe-2">
|
||||
<div class="fe-t">
|
||||
<img src="<?php echo plugins_url('assets/right-tick.png',
|
||||
dirname(__FILE__)) ?>" alt="right-tick"/>
|
||||
<h4><?php esc_html_e('Customize Sticky TOC', 'easy-table-of-contents'); ?></h4>
|
||||
</div>
|
||||
<p><?php esc_html_e('Users can alos customize the appearance of Sticky of the table of contents.', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="fe-2">
|
||||
<div class="fe-t">
|
||||
<img src="<?php echo plugins_url('assets/right-tick.png',
|
||||
dirname(__FILE__)) ?>" alt="right-tick"/>
|
||||
<h4><?php esc_html_e('View More', 'easy-table-of-contents'); ?></h4>
|
||||
</div>
|
||||
<p><?php esc_html_e('Users can show limited number of headings on initial view and show remaining headings on clicking a button.', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="fe-2">
|
||||
<div class="fe-t">
|
||||
<img src="<?php echo plugins_url('assets/right-tick.png',
|
||||
dirname(__FILE__)) ?>" alt="right-tick"/>
|
||||
<h4><?php esc_html_e('Read Time', 'easy-table-of-contents'); ?></h4>
|
||||
</div>
|
||||
<p><?php esc_html_e('Users can show estimated read time for your posts/pages inside the table of contents.', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="fe-2">
|
||||
<div class="fe-t">
|
||||
<img src="<?php echo plugins_url('assets/right-tick.png',
|
||||
dirname(__FILE__)) ?>" alt="right-tick"/>
|
||||
<h4><?php esc_html_e('Collapsable Sub Headings', 'easy-table-of-contents'); ?></h4>
|
||||
</div>
|
||||
<p><?php esc_html_e('Users can show/hide sub headings of the table of contents.', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="fe-2">
|
||||
<div class="fe-t">
|
||||
<img src="<?php echo plugins_url('assets/right-tick.png',
|
||||
dirname(__FILE__)) ?>" alt="right-tick"/>
|
||||
<h4><?php esc_html_e("ACF Support", 'easy-table-of-contents'); ?></h4>
|
||||
</div>
|
||||
<p><?php esc_html_e("Easily create TOC with your custom ACF fields.", 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="fe-2">
|
||||
<div class="fe-t">
|
||||
<img src="<?php echo plugins_url('assets/right-tick.png',
|
||||
dirname(__FILE__)) ?>" alt="right-tick"/>
|
||||
<h4><?php esc_html_e('Full AMP Support', 'easy-table-of-contents'); ?></h4>
|
||||
</div>
|
||||
<p><?php esc_html_e('Generates a table of contents with your existing setup and makes them AMP automatically.', 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
<div class="fe-2">
|
||||
<div class="fe-t">
|
||||
<img src="<?php echo plugins_url('assets/right-tick.png',
|
||||
dirname(__FILE__)) ?>" alt="right-tick"/>
|
||||
<h4><?php esc_html_e('Continuous Updates', 'easy-table-of-contents'); ?></h4>
|
||||
</div>
|
||||
<p><?php esc_html_e("We're continuously updating our premium features and releasing them.", 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
<div class="fe-2">
|
||||
<div class="fe-t">
|
||||
<img src="<?php echo plugins_url('assets/right-tick.png',
|
||||
dirname(__FILE__)) ?>" alt="right-tick"/>
|
||||
<h4><?php esc_html_e("Documentation", 'easy-table-of-contents'); ?></h4>
|
||||
</div>
|
||||
<p><?php esc_html_e("We create tutorials for every possible feature and keep it updated for you.", 'easy-table-of-contents'); ?></p>
|
||||
</div>
|
||||
</div><!-- /. fet -->
|
||||
<div class="pr-btn">
|
||||
<a href="#upgrade"><?php esc_html_e("Upgrade to Pro", 'easy-table-of-contents'); ?></a>
|
||||
</div><!-- /. pr-btn -->
|
||||
</div><!-- /. pr-fe -->
|
||||
</div><!-- /.pr -->
|
||||
</div><!-- /. pvf-cmp -->
|
||||
</div><!-- /. pvf-cnt -->
|
||||
<div id="upgrade" class="amp-upg">
|
||||
<div class="upg-t">
|
||||
<h2><?php esc_html_e("Let's Upgrade Your Easy Table of Contents", 'easy-table-of-contents'); ?></h2>
|
||||
<span><?php esc_html_e("Choose your plan and upgrade in minutes!", 'easy-table-of-contents'); ?></span>
|
||||
</div>
|
||||
<div class="etoc-pri-lst">
|
||||
<div class="pri-tb">
|
||||
<a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=1"
|
||||
target="_blank">
|
||||
<h5><?php esc_html_e("PERSONAL", 'easy-table-of-contents'); ?></h5>
|
||||
<span class="d-amt"><sup>$</sup>49</span>
|
||||
<span class="amt"><sup>$</sup>49</span>
|
||||
<span class="s-amt"><?php esc_html_e("(Save $59)", 'easy-table-of-contents'); ?></span>
|
||||
<span class="bil"><?php esc_html_e("Billed Annually", 'easy-table-of-contents'); ?></span>
|
||||
<span class="s"><?php esc_html_e("1 Site License", 'easy-table-of-contents'); ?></span>
|
||||
<span class="e"><?php esc_html_e("Tech Support", 'easy-table-of-contents'); ?></span>
|
||||
<span class="f"><?php esc_html_e("1 year Updates", 'easy-table-of-contents'); ?> </span>
|
||||
<span class="etoc-sv"><?php esc_html_e("Pro Features", 'easy-table-of-contents'); ?> </span>
|
||||
<span class="pri-by"><?php esc_html_e("Buy Now", 'easy-table-of-contents'); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="pri-tb rec">
|
||||
<a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=2"
|
||||
target="_blank">
|
||||
<h5><?php esc_html_e("MULTIPLE", 'easy-table-of-contents'); ?></h5>
|
||||
<span class="d-amt"><sup>$</sup>69</span>
|
||||
<span class="amt"><sup>$</sup>69</span>
|
||||
<span class="s-amt"><?php esc_html_e("(Save $79)", 'easy-table-of-contents'); ?></span>
|
||||
<span class="bil"><?php esc_html_e("Billed Annually", 'easy-table-of-contents'); ?></span>
|
||||
<span class="s"><?php esc_html_e("3 Site License", 'easy-table-of-contents'); ?></span>
|
||||
<span class="e"><?php esc_html_e("Tech Support", 'easy-table-of-contents'); ?></span>
|
||||
<span class="f"><?php esc_html_e("1 year Updates", 'easy-table-of-contents'); ?></span>
|
||||
<span class="etoc-sv"><?php esc_html_e("Save 78%", 'easy-table-of-contents'); ?></span>
|
||||
<span class="pri-by"><?php esc_html_e("Buy Now", 'easy-table-of-contents'); ?></span>
|
||||
<span class="etoc-rcm"><?php esc_html_e("RECOMMENDED", 'easy-table-of-contents'); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="pri-tb">
|
||||
<a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=3"
|
||||
target="_blank">
|
||||
<h5><?php esc_html_e("WEBMASTER", 'easy-table-of-contents'); ?></h5>
|
||||
<span class="d-amt"><sup>$</sup>79</span>
|
||||
<span class="amt"><sup>$</sup>79</span>
|
||||
<span class="s-amt"><?php esc_html_e("(Save $99)", 'easy-table-of-contents'); ?></span>
|
||||
<span class="bil"><?php esc_html_e("Billed Annually", 'easy-table-of-contents'); ?></span>
|
||||
<span class="s"><?php esc_html_e("10 Site License", 'easy-table-of-contents'); ?></span>
|
||||
<span class="e"><?php esc_html_e("Tech Support", 'easy-table-of-contents'); ?></span>
|
||||
<span class="f"><?php esc_html_e("1 year Updates", 'easy-table-of-contents'); ?></span>
|
||||
<span class="etoc-sv"><?php esc_html_e("Save 83%", 'easy-table-of-contents'); ?></span>
|
||||
<span class="pri-by"><?php esc_html_e("Buy Now", 'easy-table-of-contents'); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="pri-tb">
|
||||
<a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=4"
|
||||
target="_blank">
|
||||
<h5><?php esc_html_e("FREELANCER", 'easy-table-of-contents'); ?></h5>
|
||||
<span class="d-amt"><sup>$</sup>99</span>
|
||||
<span class="amt"><sup>$</sup>99</span>
|
||||
<span class="s-amt"><?php esc_html_e("(Save $119)", 'easy-table-of-contents'); ?></span>
|
||||
<span class="bil"><?php esc_html_e("Billed Annually", 'easy-table-of-contents'); ?></span>
|
||||
<span class="s"><?php esc_html_e("25 Site License", 'easy-table-of-contents'); ?></span>
|
||||
<span class="e"><?php esc_html_e("Tech Support", 'easy-table-of-contents'); ?></span>
|
||||
<span class="f"><?php esc_html_e("1 year Updates", 'easy-table-of-contents'); ?></span>
|
||||
<span class="etoc-sv"><?php esc_html_e("Save 90%", 'easy-table-of-contents'); ?></span>
|
||||
<span class="pri-by"><?php esc_html_e("Buy Now", 'easy-table-of-contents'); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="pri-tb">
|
||||
<a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=5"
|
||||
target="_blank">
|
||||
<h5><?php esc_html_e("AGENCY", 'easy-table-of-contents'); ?></h5>
|
||||
<span class="d-amt"><sup>$</sup>199</span>
|
||||
<span class="amt"><sup>$</sup>199</span>
|
||||
<span class="s-amt"><?php esc_html_e("(Save $199)", 'easy-table-of-contents'); ?></span>
|
||||
<span class="bil"><?php esc_html_e("Billed Annually", 'easy-table-of-contents'); ?></span>
|
||||
<span class="s"><?php esc_html_e("Unlimited Sites", 'easy-table-of-contents'); ?></span>
|
||||
<span class="e"><?php esc_html_e("E-mail support", 'easy-table-of-contents'); ?></span>
|
||||
<span class="f"><?php esc_html_e("1 year Updates", 'easy-table-of-contents'); ?></span>
|
||||
<span class="etoc-sv"><?php esc_html_e("UNLIMITED", 'easy-table-of-contents'); ?></span>
|
||||
<span class="pri-by"><?php esc_html_e("Buy Now", 'easy-table-of-contents'); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="pri-tb">
|
||||
<a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=6"
|
||||
target="_blank">
|
||||
<h5><?php esc_html_e("LIFETIME", 'easy-table-of-contents'); ?></h5>
|
||||
<span class="d-amt"><sup>$</sup>499</span>
|
||||
<span class="amt"><sup>$</sup>499</span>
|
||||
<span class="s-amt"><?php esc_html_e("(Save $199)", 'easy-table-of-contents'); ?></span>
|
||||
<span class="bil"><?php esc_html_e("One-Time Fee", 'easy-table-of-contents'); ?></span>
|
||||
<span class="s"><?php esc_html_e("Unlimited Sites", 'easy-table-of-contents'); ?></span>
|
||||
<span class="e"><?php esc_html_e("Unlimited E-mail support", 'easy-table-of-contents'); ?></span>
|
||||
<span class="f"><?php esc_html_e("Lifetime License", 'easy-table-of-contents'); ?></span>
|
||||
<span class="etoc-sv"><?php esc_html_e("UNLIMITED", 'easy-table-of-contents'); ?></span>
|
||||
<span class="pri-by"><?php esc_html_e("Buy Now", 'easy-table-of-contents'); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</div><!-- /.pri-lst -->
|
||||
<div class="tru-us">
|
||||
<img src="<?php echo plugins_url('assets/toc-rating.png', dirname(__FILE__))
|
||||
?>" alt="toc-rating"/>
|
||||
<h2><?php esc_html_e("Used by more than 5,00,000+ Users!", 'easy-table-of-contents'); ?></h2>
|
||||
<p><?php esc_html_e("More than 500k Websites, Blogs & E-Commerce shops are powered by our easy table of contents plugin making it the #1 Independent TOC plugin in WordPress.", 'easy-table-of-contents'); ?></p>
|
||||
<a href="https://wordpress.org/support/plugin/easy-table-of-contents/reviews/?filter=5"
|
||||
target="_blank"><?php esc_html_e("Read The Reviews", 'easy-table-of-contents'); ?></a>
|
||||
</div>
|
||||
</div><!--/ .amp-upg -->
|
||||
<div class="ampfaq">
|
||||
<h2><?php esc_html_e("Frequently Asked Questions", 'easy-table-of-contents'); ?></h2>
|
||||
<div class="faq-lst">
|
||||
<div class="lt">
|
||||
<ul>
|
||||
<li>
|
||||
<span><?php esc_html_e("Is there a setup fee?", 'easy-table-of-contents'); ?></span>
|
||||
<p><?php esc_html_e("No. There are no setup fees on any of our plans", 'easy-table-of-contents'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<span><?php esc_html_e("What's the time span for your contracts?", 'easy-table-of-contents'); ?></span>
|
||||
<p><?php esc_html_e("All the plans are year-to-year which are subscribed annually except for lifetime plan.", 'easy-table-of-contents'); ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<span><?php echo esc_html_e("What payment methods are accepted?", 'easy-table-of-contents') ?></span>
|
||||
<p><?php echo esc_html_e("We accepts PayPal and Credit Card payments.", 'easy-table-of-contents') ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<span><?php echo esc_html_e("Do you offer support if I need help?", 'easy-table-of-contents') ?></span>
|
||||
<p><?php echo esc_html_e("Yes! Top-notch customer support for our paid customers is key for a quality product, so we’ll do our very best to resolve any issues you encounter via our support page.", 'easy-table-of-contents') ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<span><?php echo esc_html_e("Can I use the plugins after my subscription is expired?", 'easy-table-of-contents') ?></span>
|
||||
<p><?php echo esc_html_e("Yes, you can use the plugins, but you will not get future updates for those plugins.", 'easy-table-of-contents') ?></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="rt">
|
||||
<ul>
|
||||
<li>
|
||||
<span><?php echo esc_html_e("Can I cancel my membership at any time?", 'easy-table-of-contents') ?></span>
|
||||
<p><?php echo esc_html_e("Yes. You can cancel your membership by contacting us.", 'easy-table-of-contents') ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<span><?php echo esc_html_e("Can I change my plan later on?", 'easy-table-of-contents') ?></span>
|
||||
<p><?php echo esc_html_e("Yes. You can upgrade your plan by contacting us.", 'easy-table-of-contents') ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<span><?php echo esc_html_e("Do you offer refunds?", 'easy-table-of-contents') ?></span>
|
||||
<p><?php echo esc_html_e("You are fully protected by our 100% Money-Back Guarantee Unconditional. If during the next 14 days you experience an issue that makes the plugin unusable, and we are unable to resolve it, we’ll happily offer a full refund.", 'easy-table-of-contents') ?></p>
|
||||
</li>
|
||||
<li>
|
||||
<span><?php echo esc_html_e("Do I get updates for the premium plugin?", 'easy-table-of-contents') ?></span>
|
||||
<p><?php echo esc_html_e("Yes, you will get updates for all the premium plugins until your subscription is active.", 'easy-table-of-contents') ?></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><!-- /.faq-lst -->
|
||||
<div class="f-cnt">
|
||||
<span><?php echo esc_html_e("I have other pre-sale questions, can you help?", 'easy-table-of-contents') ?></span>
|
||||
<p><?php echo esc_html_e("All the plans are year-to-year which are subscribed annually.", 'easy-table-of-contents') ?></p>
|
||||
<a href="https://tocwp.com/contact/'?utm_source=tocwp-plugin&utm_medium=addon-card'"
|
||||
target="_blank"><?php echo esc_html_e("Contact a Human", 'easy-table-of-contents') ?></a>
|
||||
</div><!-- /.f-cnt -->
|
||||
</div><!-- /.faq -->
|
||||
</div><!-- /. pvf -->
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- /.freevspro div ended -->
|
||||
|
||||
<div id="license" class="eztoc_support_div eztoc-tabcontent">
|
||||
<?php
|
||||
do_action("admin_upgrade_license_page");
|
||||
?>
|
||||
</div>
|
||||
<!--<details id="eztoc-ocassional-pop-up-container" open>
|
||||
<summary class="eztoc-ocassional-pop-up-open-close-button"><?php esc_html_e('40% OFF - Limited Time Only', 'easy-table-of-contents'); ?><svg fill="#fff" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 288.359 288.359" style="enable-background:new 0 0 288.359 288.359;" xml:space="preserve"><g><path d="M283.38,4.98c-3.311-3.311-7.842-5.109-12.522-4.972L163.754,3.166c-4.334,0.128-8.454,1.906-11.52,4.972L4.979,155.394 c-6.639,6.639-6.639,17.402,0,24.041L108.924,283.38c6.639,6.639,17.402,6.639,24.041,0l147.256-147.256 c3.065-3.065,4.844-7.186,4.972-11.52l3.159-107.103C288.49,12.821,286.691,8.291,283.38,4.98z M247.831,130.706L123.128,255.407 c-1.785,1.785-4.679,1.785-6.464,0l-83.712-83.712c-1.785-1.785-1.785-4.679,0-6.464L157.654,40.529 c1.785-1.785,4.679-1.785,6.464,0l83.713,83.713C249.616,126.027,249.616,128.921,247.831,130.706z M263.56,47.691 c-6.321,6.322-16.57,6.322-22.892,0c-6.322-6.321-6.322-16.57,0-22.892c6.321-6.322,16.569-6.322,22.892,0 C269.882,31.121,269.882,41.37,263.56,47.691z"/><path d="M99.697,181.278c-5.457,2.456-8.051,3.32-10.006,1.364c-1.592-1.591-1.5-4.411,1.501-7.412 c1.458-1.458,2.927-2.52,4.26-3.298c1.896-1.106,2.549-3.528,1.467-5.438l-0.018-0.029c-0.544-0.96-1.455-1.658-2.522-1.939 c-1.067-0.279-2.202-0.116-3.147,0.453c-1.751,1.054-3.64,2.48-5.587,4.428c-7.232,7.23-7.595,15.599-2.365,20.829 c4.457,4.457,10.597,3.956,17.463,0.637c5.004-2.364,7.55-2.729,9.46-0.819c2.002,2.002,1.638,5.004-1.545,8.186 c-1.694,1.694-3.672,3.044-5.582,4.06c-0.994,0.528-1.728,1.44-2.027,2.525c-0.3,1.085-0.139,2.245,0.443,3.208l0.036,0.06 c1.143,1.889,3.575,2.531,5.503,1.457c2.229-1.241,4.732-3.044,6.902-5.215c8.412-8.412,8.002-16.736,2.864-21.875 C112.475,178.141,107.109,177.868,99.697,181.278z"/><path d="M150.245,157.91l-31.508-16.594c-1.559-0.821-3.47-0.531-4.716,0.714l-4.897,4.898c-1.25,1.25-1.537,3.169-0.707,4.73 l16.834,31.654c0.717,1.347,2.029,2.274,3.538,2.5c1.509,0.225,3.035-0.278,4.114-1.357c1.528-1.528,1.851-3.89,0.786-5.771 l-3.884-6.866l8.777-8.777l6.944,3.734c1.952,1.05,4.361,0.696,5.928-0.871c1.129-1.129,1.654-2.726,1.415-4.303 C152.63,160.023,151.657,158.653,150.245,157.91z M125.621,165.632c0,0-7.822-13.37-9.187-15.644l0.091-0.092 c2.274,1.364,15.872,8.959,15.872,8.959L125.621,165.632z"/><path d="M173.694,133.727c-1.092,0-2.139,0.434-2.911,1.205l-9.278,9.278l-21.352-21.352c-0.923-0.923-2.175-1.441-3.479-1.441 s-2.557,0.519-3.479,1.441c-1.922,1.922-1.922,5.037,0,6.958l24.331,24.332c1.57,1.569,4.115,1.569,5.685,0l13.395-13.395 c1.607-1.607,1.607-4.213,0-5.821C175.833,134.16,174.786,133.727,173.694,133.727z"/><path d="M194.638,111.35l-9.755,9.755l-7.276-7.277l8.459-8.458c1.557-1.558,1.557-4.081-0.001-5.639 c-1.557-1.557-4.082-1.557-5.639,0l-8.458,8.458l-6.367-6.366l9.117-9.117c1.57-1.57,1.57-4.115,0-5.686 c-0.754-0.755-1.776-1.179-2.843-1.179c-1.066,0-2.089,0.424-2.843,1.178l-13.234,13.233c-0.753,0.754-1.177,1.776-1.177,2.843 c0,1.066,0.424,2.089,1.178,2.843l24.968,24.968c1.57,1.569,4.115,1.569,5.685,0l13.87-13.87c1.57-1.57,1.57-4.115,0-5.686 C198.752,109.78,196.208,109.78,194.638,111.35z"/></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g></svg></summary>
|
||||
<span class="eztoc-promotion-close-btn"> × </span>
|
||||
<div class="eztoc-ocassional-pop-up-contents">
|
||||
|
||||
<img src="<?php plugins_url('assets/offer-gift-icon.png', dirname(__FILE__)) ?>" class="eztoc-promotion-surprise-icon" />
|
||||
<p class="eztoc-ocassional-pop-up-headline"><?php esc_html_e('40% OFF on', 'easy-table-of-contents'); ?> <span><?php esc_html_e('Easy TOC PRO', 'easy-table-of-contents');?></span></p>
|
||||
<p class="eztoc-ocassional-pop-up-second-headline"><?php esc_html_e('Upgrade the PRO version during this festive season and get our biggest discount of all time on New Purchases, Renewals & Upgrades', 'easy-table-of-contents'); ?></p>
|
||||
<a class="eztoc-ocassional-pop-up-offer-btn" href="<?php esc_url('https://tocwp.com/november-deal/') ?>" target="_blank"><?php esc_html_e('Get This Offer Now', 'easy-table-of-contents'); ?></a>
|
||||
<p class="eztoc-ocassional-pop-up-last-line"><?php esc_html_e('Black Friday, Cyber Monday, Christmas & New year are the only times we offer discounts this big.', 'easy-table-of-contents'); ?> </p>
|
||||
|
||||
</div>
|
||||
|
||||
</details>-->
|
||||
</div>
|
@ -0,0 +1,380 @@
|
||||
<?php
|
||||
|
||||
namespace Easy_Plugins\Table_Of_Contents\Cord;
|
||||
|
||||
/**
|
||||
* Replace `<br />` tags with parameter.
|
||||
*
|
||||
* @since 2.0.8
|
||||
*
|
||||
* @param string $string
|
||||
* @param string $to
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function br2( $string, $to = "\r\n" ) {
|
||||
|
||||
$string = preg_replace( '`<br[/\s]*>`i', $to, $string );
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace `<br />` tags with new lines.
|
||||
*
|
||||
* @link https://stackoverflow.com/a/27509016/5351316
|
||||
*
|
||||
* @since 2.0.8
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function br2nl( $string ) {
|
||||
|
||||
return br2( $string );
|
||||
}
|
||||
|
||||
/**
|
||||
* Pulled from WordPress formatting functions.
|
||||
*
|
||||
* Edited to add space before self closing tags.
|
||||
*
|
||||
* @since 2.0
|
||||
*
|
||||
* @param string $text
|
||||
*
|
||||
* @return string|string[]
|
||||
*/
|
||||
function force_balance_tags( $text ) {
|
||||
$tagstack = array();
|
||||
$stacksize = 0;
|
||||
$tagqueue = '';
|
||||
$newtext = '';
|
||||
// Known single-entity/self-closing tags
|
||||
$single_tags = array( 'area', 'base', 'basefont', 'br', 'col', 'command', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param', 'source' );
|
||||
// Tags that can be immediately nested within themselves
|
||||
$nestable_tags = array( 'blockquote', 'div', 'object', 'q', 'span' );
|
||||
|
||||
// WP bug fix for comments - in case you REALLY meant to type '< !--'
|
||||
$text = str_replace( '< !--', '< !--', $text );
|
||||
// WP bug fix for LOVE <3 (and other situations with '<' before a number)
|
||||
$text = preg_replace( '#<([0-9]{1})#', '<$1', $text );
|
||||
|
||||
/**
|
||||
* Matches supported tags.
|
||||
*
|
||||
* To get the pattern as a string without the comments paste into a PHP
|
||||
* REPL like `php -a`.
|
||||
*
|
||||
* @see https://html.spec.whatwg.org/#elements-2
|
||||
* @see https://w3c.github.io/webcomponents/spec/custom/#valid-custom-element-name
|
||||
*
|
||||
* @example
|
||||
* ~# php -a
|
||||
* php > $s = [paste copied contents of expression below including parentheses];
|
||||
* php > echo $s;
|
||||
*/
|
||||
$tag_pattern = (
|
||||
'#<' . // Start with an opening bracket.
|
||||
'(/?)' . // Group 1 - If it's a closing tag it'll have a leading slash.
|
||||
'(' . // Group 2 - Tag name.
|
||||
// Custom element tags have more lenient rules than HTML tag names.
|
||||
'(?:[a-z](?:[a-z0-9._]*)-(?:[a-z0-9._-]+)+)' .
|
||||
'|' .
|
||||
// Traditional tag rules approximate HTML tag names.
|
||||
'(?:[\w:]+)' .
|
||||
')' .
|
||||
'(?:' .
|
||||
// We either immediately close the tag with its '>' and have nothing here.
|
||||
'\s*' .
|
||||
'(/?)' . // Group 3 - "attributes" for empty tag.
|
||||
'|' .
|
||||
// Or we must start with space characters to separate the tag name from the attributes (or whitespace).
|
||||
'(\s+)' . // Group 4 - Pre-attribute whitespace.
|
||||
'([^>]*)' . // Group 5 - Attributes.
|
||||
')' .
|
||||
'>#' // End with a closing bracket.
|
||||
);
|
||||
|
||||
while ( preg_match( $tag_pattern, $text, $regex ) ) {
|
||||
$full_match = $regex[0];
|
||||
$has_leading_slash = ! empty( $regex[1] );
|
||||
$tag_name = $regex[2];
|
||||
$tag = strtolower( $tag_name );
|
||||
$is_single_tag = in_array( $tag, $single_tags, true );
|
||||
$pre_attribute_ws = isset( $regex[4] ) ? $regex[4] : '';
|
||||
$attributes = trim( isset( $regex[5] ) ? $regex[5] : $regex[3] );
|
||||
$has_self_closer = '/' === substr( $attributes, -1 );
|
||||
|
||||
$newtext .= $tagqueue;
|
||||
|
||||
$i = strpos( $text, $full_match );
|
||||
$l = strlen( $full_match );
|
||||
|
||||
// Clear the shifter.
|
||||
$tagqueue = '';
|
||||
if ( $has_leading_slash ) { // End Tag.
|
||||
// If too many closing tags.
|
||||
if ( $stacksize <= 0 ) {
|
||||
$tag = '';
|
||||
// Or close to be safe $tag = '/' . $tag.
|
||||
|
||||
// If stacktop value = tag close value, then pop.
|
||||
} elseif ( $tagstack[ $stacksize - 1 ] === $tag ) { // Found closing tag.
|
||||
$tag = '</' . $tag . '>'; // Close Tag.
|
||||
array_pop( $tagstack );
|
||||
$stacksize--;
|
||||
} else { // Closing tag not at top, search for it.
|
||||
for ( $j = $stacksize - 1; $j >= 0; $j-- ) {
|
||||
if ( $tagstack[ $j ] === $tag ) {
|
||||
// Add tag to tagqueue.
|
||||
for ( $k = $stacksize - 1; $k >= $j; $k-- ) {
|
||||
$tagqueue .= '</' . array_pop( $tagstack ) . '>';
|
||||
$stacksize--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
$tag = '';
|
||||
}
|
||||
} else { // Begin Tag.
|
||||
if ( $has_self_closer ) { // If it presents itself as a self-closing tag...
|
||||
// ...but it isn't a known single-entity self-closing tag, then don't let it be treated as such and
|
||||
// immediately close it with a closing tag (the tag will encapsulate no text as a result)
|
||||
if ( ! $is_single_tag ) {
|
||||
$attributes = trim( substr( $attributes, 0, -1 ) ) . "></$tag";
|
||||
}
|
||||
} elseif ( $is_single_tag ) { // ElseIf it's a known single-entity tag but it doesn't close itself, do so
|
||||
$pre_attribute_ws = ' ';
|
||||
$attributes .= 0 < strlen( $attributes ) ? ' /' : '/'; // EDIT: If there are attributes, add space before closing tag to match how WP insert br, hr and img tags.
|
||||
} else { // It's not a single-entity tag.
|
||||
// If the top of the stack is the same as the tag we want to push, close previous tag.
|
||||
if ( $stacksize > 0 && ! in_array( $tag, $nestable_tags, true ) && $tagstack[ $stacksize - 1 ] === $tag ) {
|
||||
$tagqueue = '</' . array_pop( $tagstack ) . '>';
|
||||
$stacksize--;
|
||||
}
|
||||
$stacksize = array_push( $tagstack, $tag );
|
||||
}
|
||||
|
||||
// Attributes.
|
||||
if ( $has_self_closer && $is_single_tag ) {
|
||||
// We need some space - avoid <br/> and prefer <br />.
|
||||
$pre_attribute_ws = ' ';
|
||||
}
|
||||
|
||||
$tag = '<' . $tag . $pre_attribute_ws . $attributes . '>';
|
||||
// If already queuing a close tag, then put this tag on too.
|
||||
if ( ! empty( $tagqueue ) ) {
|
||||
$tagqueue .= $tag;
|
||||
$tag = '';
|
||||
}
|
||||
}
|
||||
$newtext .= substr( $text, 0, $i ) . $tag;
|
||||
$text = substr( $text, $i + $l );
|
||||
}
|
||||
|
||||
// Clear Tag Queue.
|
||||
$newtext .= $tagqueue;
|
||||
|
||||
// Add remaining text.
|
||||
$newtext .= $text;
|
||||
|
||||
while ( $x = array_pop( $tagstack ) ) {
|
||||
$newtext .= '</' . $x . '>'; // Add remaining tags to close.
|
||||
}
|
||||
|
||||
// WP fix for the bug with HTML comments.
|
||||
$newtext = str_replace( '< !--', '<!--', $newtext );
|
||||
$newtext = str_replace( '< !--', '< !--', $newtext );
|
||||
|
||||
return $newtext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Multibyte substr_replace(). The mbstring library does not come with a multibyte equivalent of substr_replace().
|
||||
* This function behaves exactly like substr_replace() even when the arguments are arrays.
|
||||
*
|
||||
* @link https://gist.github.com/stemar/8287074
|
||||
*
|
||||
* @since 2.0
|
||||
*
|
||||
* @param $string
|
||||
* @param $replacement
|
||||
* @param $start
|
||||
* @param null $length
|
||||
*
|
||||
* @return array|string
|
||||
*/
|
||||
if ( ! function_exists( __NAMESPACE__ . '\mb_substr_replace' ) ) :
|
||||
function mb_substr_replace( $string, $replacement, $start, $length = null ) {
|
||||
|
||||
if ( is_array( $string ) ) {
|
||||
|
||||
$num = count( $string );
|
||||
|
||||
// $replacement
|
||||
$replacement = is_array( $replacement ) ? array_slice( $replacement, 0, $num ) : array_pad( array( $replacement ), $num, $replacement );
|
||||
|
||||
// $start
|
||||
if ( is_array( $start ) ) {
|
||||
$start = array_slice( $start, 0, $num );
|
||||
foreach ( $start as $key => $value ) {
|
||||
$start[ $key ] = is_int( $value ) ? $value : 0;
|
||||
}
|
||||
} else {
|
||||
$start = array_pad( array( $start ), $num, $start );
|
||||
}
|
||||
|
||||
// $length
|
||||
if ( ! isset( $length ) ) {
|
||||
$length = array_fill( 0, $num, 0 );
|
||||
} elseif ( is_array( $length ) ) {
|
||||
$length = array_slice( $length, 0, $num );
|
||||
foreach ( $length as $key => $value ) {
|
||||
$length[ $key ] = isset( $value ) ? ( is_int( $value ) ? $value : $num ) : 0;
|
||||
}
|
||||
} else {
|
||||
$length = array_pad( array( $length ), $num, $length );
|
||||
}
|
||||
|
||||
// Recursive call
|
||||
return array_map( __FUNCTION__, $string, $replacement, $start, $length );
|
||||
}
|
||||
|
||||
preg_match_all( '/./us', (string) $string, $smatches );
|
||||
preg_match_all( '/./us', (string) $replacement, $rmatches );
|
||||
|
||||
if ( $length === null ) {
|
||||
|
||||
$length = mb_strlen( $string );
|
||||
}
|
||||
|
||||
array_splice( $smatches[0], $start, $length, $rmatches[0] );
|
||||
|
||||
return join( $smatches[0] );
|
||||
}
|
||||
endif;
|
||||
/**
|
||||
* Returns a string with all items from the $find array replaced with their matching
|
||||
* items in the $replace array. This does a one to one replacement (rather than globally).
|
||||
*
|
||||
* This function is multibyte safe.
|
||||
*
|
||||
* $find and $replace are arrays, $string is the haystack. All variables are passed by reference.
|
||||
*
|
||||
* @since 1.0
|
||||
*
|
||||
* @param bool $find
|
||||
* @param bool $replace
|
||||
* @param string $string
|
||||
*
|
||||
* @return mixed|string
|
||||
*/
|
||||
if ( ! function_exists( __NAMESPACE__ . '\mb_find_replace' ) ) :
|
||||
function mb_find_replace( &$find = false, &$replace = false, &$string = '' ) {
|
||||
|
||||
if ( is_array( $find ) && is_array( $replace ) && $string ) {
|
||||
|
||||
// check if multibyte strings are supported
|
||||
if ( function_exists( 'mb_strpos' ) ) {
|
||||
|
||||
|
||||
for ( $i = 0; $i < count( $find ); $i ++ ) {
|
||||
|
||||
$needle = $find[ $i ];
|
||||
$start = mb_strpos( $string, $needle );
|
||||
|
||||
// If heading can not be found, let try decoding entities to see if it can be found.
|
||||
if ( false === $start ) {
|
||||
|
||||
$needle = html_entity_decode(
|
||||
$needle,
|
||||
ENT_QUOTES,
|
||||
get_option( 'blog_charset' )
|
||||
);
|
||||
|
||||
$umlauts = false;
|
||||
$umlauts = apply_filters( 'eztoc_modify_umlauts', $umlauts );
|
||||
if($umlauts){
|
||||
$string = html_entity_decode(
|
||||
$string,
|
||||
ENT_QUOTES,
|
||||
get_option( 'blog_charset' )
|
||||
);
|
||||
}
|
||||
|
||||
$needle = str_replace(array('’','“','”'), array('\'','"','"'), $needle);
|
||||
|
||||
$start = mb_strpos( $string, $needle );
|
||||
}
|
||||
|
||||
/*
|
||||
* `mb_strpos()` can return `false`. Only process `mb_substr_replace()` if position in string is found.
|
||||
*/
|
||||
if ( is_int( $start ) ) {
|
||||
|
||||
$length = mb_strlen( $needle );
|
||||
$apply_new_function = apply_filters('eztoc_mb_subtr_replace',false,$string, $replace[ $i ], $start, $length);
|
||||
$string = $apply_new_function?$apply_new_function:mb_substr_replace( $string, $replace[ $i ], $start, $length );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
for ( $i = 0; $i < count( $find ); $i ++ ) {
|
||||
|
||||
$start = strpos( $string, $find[ $i ] );
|
||||
$length = strlen( $find[ $i ] );
|
||||
|
||||
/*
|
||||
* `strpos()` can return `false`. Only process `substr_replace()` if position in string is found.
|
||||
*/
|
||||
if ( is_int( $start ) ) {
|
||||
|
||||
$string = substr_replace( $string, $replace[ $i ], $start, $length );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $string;
|
||||
}
|
||||
endif;
|
||||
|
||||
if( ! function_exists( __NAMESPACE__ . '\insertElementByPTag' ) ):
|
||||
/**
|
||||
* insertElementByPTag Method
|
||||
*
|
||||
* @since 2.0.36
|
||||
* @param $content
|
||||
* @param $toc
|
||||
* @return false|string
|
||||
* @throws \DOMException
|
||||
*/
|
||||
function insertElementByPTag($content, $toc)
|
||||
{
|
||||
$find = array('</p>');
|
||||
$replace = array('</p>' . $toc);
|
||||
return mb_find_replace( $find, $replace, $content );
|
||||
}
|
||||
endif;
|
||||
|
||||
if( ! function_exists( __NAMESPACE__ . '\insertElementByImgTag' ) ):
|
||||
/**
|
||||
* insertElementByImgTag Method
|
||||
*
|
||||
* @since 2.0.60
|
||||
* @param $content
|
||||
* @param $toc
|
||||
* @return false|string
|
||||
* @throws \DOMException
|
||||
*/
|
||||
function insertElementByImgTag($content, $toc)
|
||||
{
|
||||
$find = array('</figure>');
|
||||
$replace = array('</figure>' . $toc);
|
||||
return mb_find_replace( $find, $replace, $content );
|
||||
}
|
||||
endif;
|
@ -0,0 +1,502 @@
|
||||
<?php
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
/**
|
||||
* Get the current post's TOC list or supplied post's TOC list.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*
|
||||
* @param int|null|WP_Post $post An instance of WP_Post or post ID. Defaults to current post.
|
||||
* @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_ez_toc_list( $post = null, $apply_content_filter = true ) {
|
||||
|
||||
if ( ! $post instanceof WP_Post ) {
|
||||
|
||||
$post = get_post( $post );
|
||||
}
|
||||
|
||||
if ( $apply_content_filter ) {
|
||||
|
||||
$ezPost = new ezTOC_Post( $post );
|
||||
|
||||
} else {
|
||||
|
||||
$ezPost = new ezTOC_Post( $post, false );
|
||||
}
|
||||
|
||||
return $ezPost->getTOCList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the current post's TOC list or supplied post's TOC list.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*
|
||||
* @param null|WP_Post $post An instance of WP_Post
|
||||
* @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings.
|
||||
*/
|
||||
function ez_toc_list( $post = null, $apply_content_filter = true ) {
|
||||
|
||||
echo get_ez_toc_list( $post, $apply_content_filter );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current post's TOC content block or supplied post's TOC content block.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*
|
||||
* @param int|null|WP_Post $post An instance of WP_Post or post ID. Defaults to current post.
|
||||
* @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function get_ez_toc_block( $post = null, $apply_content_filter = true ) {
|
||||
|
||||
if ( ! $post instanceof WP_Post ) {
|
||||
|
||||
$post = get_post( $post );
|
||||
}
|
||||
|
||||
if ( $apply_content_filter ) {
|
||||
|
||||
$ezPost = new ezTOC_Post( $post );
|
||||
|
||||
} else {
|
||||
|
||||
$ezPost = new ezTOC_Post( $post, false );
|
||||
}
|
||||
|
||||
return $ezPost->getTOC();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the current post's TOC content or supplied post's TOC content.
|
||||
*
|
||||
* @access public
|
||||
* @since 2.0
|
||||
*
|
||||
* @param null|WP_Post $post An instance of WP_Post
|
||||
* @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings.
|
||||
*/
|
||||
function ez_toc_block( $post = null, $apply_content_filter = true ) {
|
||||
|
||||
echo get_ez_toc_block( $post, $apply_content_filter );
|
||||
}
|
||||
// Non amp checker
|
||||
if ( ! function_exists('ez_toc_is_amp_activated') ){
|
||||
|
||||
function ez_toc_is_amp_activated() {
|
||||
$result = false;
|
||||
if (is_plugin_active('accelerated-mobile-pages/accelerated-moblie-pages.php') || is_plugin_active('amp/amp.php') ||
|
||||
is_plugin_active('better-amp/better-amp.php') ||
|
||||
is_plugin_active('wp-amp/wp-amp.php') ||
|
||||
is_plugin_active('amp-wp/amp-wp.php') ||
|
||||
is_plugin_active('bunyad-amp/bunyad-amp.php') )
|
||||
$result = true;
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Non amp checker
|
||||
if ( ! function_exists('ez_toc_non_amp') ) {
|
||||
|
||||
function ez_toc_non_amp() {
|
||||
|
||||
$non_amp = true;
|
||||
|
||||
if( function_exists('ampforwp_is_amp_endpoint') && @ampforwp_is_amp_endpoint() ) {
|
||||
$non_amp = false;
|
||||
}
|
||||
if( function_exists('is_amp_endpoint') && @is_amp_endpoint() ){
|
||||
$non_amp = false;
|
||||
}
|
||||
if( function_exists('is_better_amp') && @is_better_amp() ){
|
||||
$non_amp = false;
|
||||
}
|
||||
if( function_exists('is_amp_wp') && @is_amp_wp() ){
|
||||
$non_amp = false;
|
||||
}
|
||||
|
||||
return $non_amp;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* MBString Extension Admin Notice
|
||||
* if not loaded then msg to user
|
||||
* @since 2.0.47
|
||||
*/
|
||||
if ( function_exists('extension_loaded') && extension_loaded('mbstring') == false ) {
|
||||
function ez_toc_admin_notice_for_mbstring_extension() {
|
||||
echo '<div class="notice notice-error is-not-dismissible"><p>' . esc_html__( 'PHP MBString Extension is not enabled in your php setup, please enabled to work perfectly', 'easy-table-of-contents' ) . ' <strong>' . esc_html__( 'Easy Table of Contents', 'easy-table-of-contents' ) . '</strong>. ' . esc_html__( 'Check official doc:', 'easy-table-of-contents' ). ' <a href="https://www.php.net/manual/en/mbstring.installation.php" target="_blank">' . esc_html__( 'PHP Manual', 'easy-table-of-contents' ) .'</a></p></div>';
|
||||
}
|
||||
add_action('admin_notices', 'ez_toc_admin_notice_for_mbstring_extension');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* EzPrintR method
|
||||
* to print_r content with pre tags
|
||||
* @since 2.0.34
|
||||
* @param $content
|
||||
* @return void
|
||||
*/
|
||||
function EzPrintR($content){
|
||||
echo "<pre>";
|
||||
print_r($content);
|
||||
echo "</pre>";
|
||||
}
|
||||
|
||||
/**
|
||||
* EzDumper method
|
||||
* to var_dump content with pre tags
|
||||
* @since 2.0.34
|
||||
* @param $content
|
||||
* @return void
|
||||
*/
|
||||
function EzDumper($content){
|
||||
echo "<pre>";
|
||||
var_dump($content);
|
||||
echo "</pre>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Since version 2.0.52
|
||||
* Export all settings to json file
|
||||
*/
|
||||
add_action( 'wp_ajax_ez_toc_export_all_settings', 'ez_toc_export_all_settings');
|
||||
function ez_toc_export_all_settings()
|
||||
{
|
||||
if ( !current_user_can( 'manage_options' ) ) {
|
||||
die('-1');
|
||||
}
|
||||
if(!isset($_GET['_wpnonce'])){
|
||||
die('-1');
|
||||
}
|
||||
if( !wp_verify_nonce( $_GET['_wpnonce'] , '_wpnonce' ) ){
|
||||
die('-1');
|
||||
}
|
||||
|
||||
$export_settings_data = get_option('ez-toc-settings');
|
||||
if(!empty($export_settings_data)){
|
||||
header('Content-type: application/json');
|
||||
header('Content-disposition: attachment; filename=ez_toc_settings_backup.json');
|
||||
echo json_encode($export_settings_data);
|
||||
}
|
||||
wp_die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adding page/post title in TOC list
|
||||
* @since 2.0.56
|
||||
*/
|
||||
add_action( 'init', function() {
|
||||
if(ezTOC_Option::get('show_title_in_toc') == 1 && !is_admin())
|
||||
{
|
||||
ob_start();
|
||||
}
|
||||
} );
|
||||
add_action('shutdown', function() {
|
||||
if(ezTOC_Option::get('show_title_in_toc') == 1 && !is_admin()){
|
||||
$final = '';
|
||||
$levels = ob_get_level();
|
||||
|
||||
for ($i = 0; $i < $levels; $i++) {
|
||||
$final .= ob_get_clean();
|
||||
}
|
||||
echo apply_filters('eztoc_wordpress_final_output', $final);
|
||||
}
|
||||
|
||||
}, 10);
|
||||
|
||||
add_filter('eztoc_wordpress_final_output', function($content){
|
||||
if(!is_singular('post') && !is_page()) { return $content;}
|
||||
if(ezTOC_Option::get('show_title_in_toc') == 1 && !is_admin()){
|
||||
return preg_replace_callback(
|
||||
'/<h1(.*?)>(.*?)<\/h1>/i',
|
||||
function ($matches) {
|
||||
$title = $matches[2];
|
||||
$added_link ='<h1'.$matches[1].'><span class="ez-toc-section" id="'.esc_attr(ezTOCGenerateHeadingIDFromTitle($title)).'" ez-toc-data-id="#'.esc_attr(ezTOCGenerateHeadingIDFromTitle($title)).'"></span>';
|
||||
$added_link .= esc_attr($title);
|
||||
$added_link .= '<span class="ez-toc-section-end"></span></h1>';
|
||||
return $added_link;
|
||||
},
|
||||
$content
|
||||
);
|
||||
}
|
||||
}, 10, 1);
|
||||
|
||||
add_filter( 'ez_toc_modify_process_page_content', 'ez_toc_page_content_include_page_title', 10, 1 );
|
||||
function ez_toc_page_content_include_page_title( $content ) {
|
||||
if(ezTOC_Option::get('show_title_in_toc') == 1 && !is_admin()){
|
||||
$title = get_the_title();
|
||||
$added_page_title= '<h1 class="entry-title">'.wp_kses_post($title).'</h1>';
|
||||
$content = $added_page_title.$content;
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
function ezTOCGenerateHeadingIDFromTitle( $heading ) {
|
||||
$return = false;
|
||||
if ( $heading ) {
|
||||
$heading = apply_filters( 'ez_toc_url_anchor_target_before', $heading );
|
||||
$return = html_entity_decode( $heading, ENT_QUOTES, get_option( 'blog_charset' ) );
|
||||
$return = trim( strip_tags( $return ) );
|
||||
$return = remove_accents( $return );
|
||||
$return = str_replace( array( "\r", "\n", "\n\r", "\r\n" ), ' ', $return );
|
||||
$return = htmlentities2( $return );
|
||||
$return = str_replace( array( '&', ' '), ' ', $return );
|
||||
$return = str_replace( array( '­' ),'', $return ); // removed silent hypen
|
||||
$return = html_entity_decode( $return, ENT_QUOTES, get_option( 'blog_charset' ) );
|
||||
$return = preg_replace( '/[\x00-\x1F\x7F]*/u', '', $return );
|
||||
$return = str_replace(
|
||||
array( '*', '\'', '(', ')', ';', '@', '&', '=', '+', '$', ',', '/', '?', '#', '[', ']' ),
|
||||
'',
|
||||
$return
|
||||
);
|
||||
$return = str_replace(
|
||||
array( '%', '{', '}', '|', '\\', '^', '~', '[', ']', '`' ),
|
||||
'',
|
||||
$return
|
||||
);
|
||||
$return = str_replace(
|
||||
array( '$', '.', '+', '!', '*', '\'', '(', ')', ',', '’' ),
|
||||
'',
|
||||
$return
|
||||
);
|
||||
$return = str_replace(
|
||||
array( '-', '-', '–', '—' ),
|
||||
'-',
|
||||
$return
|
||||
);
|
||||
$return = str_replace(
|
||||
array( '‘', '’', '“', 'â€' ),
|
||||
'',
|
||||
$return
|
||||
);
|
||||
$return = str_replace( array( ':' ), '_', $return );
|
||||
$return = preg_replace( '/\s+/', '_', $return );
|
||||
$return = preg_replace( '/-+/', '-', $return );
|
||||
$return = preg_replace( '/_+/', '_', $return );
|
||||
$return = rtrim( $return, '-_' );
|
||||
$return = preg_replace_callback(
|
||||
"{[^0-9a-z_.!~*'();,/?:@&=+$#-]}i",
|
||||
function( $m ) {
|
||||
|
||||
return sprintf( '%%%02X', ord( $m[0] ) );
|
||||
},
|
||||
$return
|
||||
);
|
||||
if ( ezTOC_Option::get( 'lowercase' ) ) {
|
||||
|
||||
$return = strtolower( $return );
|
||||
}
|
||||
if ( !$return || true == ezTOC_Option::get( 'all_fragment_prefix' ) ) {
|
||||
|
||||
$return = ( ezTOC_Option::get( 'fragment_prefix' ) ) ? ezTOC_Option::get( 'fragment_prefix' ) : '_';
|
||||
}
|
||||
if ( ezTOC_Option::get( 'hyphenate' ) ) {
|
||||
|
||||
$return = str_replace( '_', '-', $return );
|
||||
$return = preg_replace( '/-+/', '-', $return );
|
||||
}
|
||||
}
|
||||
return apply_filters( 'ez_toc_url_anchor_target', $return, $heading );
|
||||
}
|
||||
//Device Eligibility
|
||||
//@since 2.0.60
|
||||
function ez_toc_auto_device_target_status(){
|
||||
$status = true;
|
||||
if(ezTOC_Option::get( 'device_target' ) == 'mobile'){
|
||||
if(function_exists('wp_is_mobile') && wp_is_mobile()){
|
||||
$status = true;
|
||||
}else{
|
||||
$status = false;
|
||||
}
|
||||
}
|
||||
if(ezTOC_Option::get( 'device_target' ) == 'desktop'){
|
||||
if(function_exists('wp_is_mobile') && wp_is_mobile()){
|
||||
$status = false;
|
||||
}else{
|
||||
$status = true;
|
||||
}
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
/**
|
||||
* Check for the enable support of sticky toc/toggle
|
||||
* @since 2.0.60
|
||||
*/
|
||||
function ez_toc_stikcy_enable_support_status(){
|
||||
|
||||
$status = false;
|
||||
|
||||
$stickyPostTypes = apply_filters('ez_toc_sticky_post_types', ezTOC_Option::get('sticky-post-types'));
|
||||
|
||||
if(!empty($stickyPostTypes)){
|
||||
if(is_singular()){
|
||||
$postType = get_post_type();
|
||||
if(in_array($postType,$stickyPostTypes)){
|
||||
$status = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(ezTOC_Option::get('sticky_include_homepage')){
|
||||
if ( is_front_page() ) {
|
||||
$status = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(ezTOC_Option::get('sticky_include_category')){
|
||||
if ( is_category() ) {
|
||||
$status = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(ezTOC_Option::get('sticky_include_tag')){
|
||||
if ( is_tag() ) {
|
||||
$status = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(ezTOC_Option::get('sticky_include_product_category')){
|
||||
if ( is_tax( 'product_cat' ) ) {
|
||||
$status = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(ezTOC_Option::get('sticky_include_custom_tax')){
|
||||
if ( is_tax() ) {
|
||||
$status = true;
|
||||
}
|
||||
}
|
||||
|
||||
//Device Eligibility
|
||||
//@since 2.0.60
|
||||
if(ezTOC_Option::get( 'sticky_device_target' ) == 'mobile'){
|
||||
if(function_exists('wp_is_mobile') && wp_is_mobile()){
|
||||
$status = true;
|
||||
}else{
|
||||
$status = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(ezTOC_Option::get( 'sticky_device_target' ) == 'desktop'){
|
||||
if(function_exists('wp_is_mobile') && wp_is_mobile()){
|
||||
$status = false;
|
||||
}else{
|
||||
$status = true;
|
||||
}
|
||||
}
|
||||
|
||||
return apply_filters('ez_toc_sticky_enable_support', $status);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Helps exclude blockquote
|
||||
* @since 2.0.58
|
||||
*/
|
||||
if(!function_exists('ez_toc_para_blockquote_replace')){
|
||||
function ez_toc_para_blockquote_replace($blockquotes, $content, $step){
|
||||
$bId = 0;
|
||||
if($step == 1){
|
||||
foreach($blockquotes[0] as $blockquote){
|
||||
$replace = '#eztocbq' . $bId . '#';
|
||||
$content = str_replace( trim($blockquote), $replace, $content );
|
||||
$bId++;
|
||||
}
|
||||
}elseif($step == 2){
|
||||
foreach($blockquotes[0] as $blockquote){
|
||||
$search = '#eztocbq' . $bId . '#';
|
||||
$content = str_replace( $search, trim($blockquote), $content );
|
||||
$bId++;
|
||||
}
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Helps allow line breaks
|
||||
* @since 2.0.59
|
||||
*/
|
||||
add_filter('ez_toc_title_allowable_tags', 'ez_toc_link_allow_br_tag');
|
||||
function ez_toc_link_allow_br_tag($tags){
|
||||
if(ezTOC_Option::get( 'prsrv_line_brk' )){
|
||||
$tags = '<br>';
|
||||
}
|
||||
return $tags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the status of shortcode enable support which is defined in shortcode attributes
|
||||
* @since 2.0.59
|
||||
*/
|
||||
function ez_toc_shortcode_enable_support_status($atts){
|
||||
|
||||
$status = true;
|
||||
|
||||
if(isset($atts['post_types'])){
|
||||
$exp_post_types = explode(',', $atts['post_types']);
|
||||
if(!empty($exp_post_types)){
|
||||
$exp_post_types = array_map("trim",$exp_post_types);
|
||||
if(is_singular()){
|
||||
$curr_post_type = get_post_type();
|
||||
if(in_array($curr_post_type, $exp_post_types )){
|
||||
$status = true;
|
||||
}else{
|
||||
$status = false;
|
||||
}
|
||||
}else{
|
||||
$status = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($atts['post_in'])){
|
||||
$exp_post_ids = explode(',', $atts['post_in']);
|
||||
if(!empty($exp_post_ids)){
|
||||
$exp_post_ids = array_map("trim",$exp_post_ids);
|
||||
if(is_singular()){
|
||||
$ID = get_the_ID();
|
||||
if(in_array($ID, $exp_post_ids )){
|
||||
$status = true;
|
||||
}else{
|
||||
$status = false;
|
||||
}
|
||||
}else{
|
||||
$status = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(isset($atts['device_target']) && $atts['device_target'] != ''){
|
||||
$status = false;
|
||||
$my_device = $atts['device_target'];
|
||||
if(function_exists('wp_is_mobile') && wp_is_mobile()){
|
||||
if($my_device == 'mobile'){
|
||||
$status = true;
|
||||
}
|
||||
}else{
|
||||
if($my_device == 'desktop'){
|
||||
$status = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
<?php
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class eztoc_pointers {
|
||||
const DISPLAY_VERSION = 'v1.0';
|
||||
function __construct () {
|
||||
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
|
||||
}
|
||||
function admin_enqueue_scripts () {
|
||||
$dismissed = explode (',', get_user_meta (wp_get_current_user ()->ID, 'dismissed_wp_pointers', true));
|
||||
$do_tour = !in_array ('eztoc_subscribe_pointer', $dismissed);
|
||||
if ($do_tour) {
|
||||
wp_enqueue_style ('wp-pointer');
|
||||
wp_enqueue_script ('wp-pointer');
|
||||
|
||||
add_action('admin_print_footer_scripts', array($this, 'admin_print_footer_scripts'));
|
||||
add_action('admin_head', array($this, 'admin_head')); // Hook to admin head
|
||||
}
|
||||
}
|
||||
function admin_head () {
|
||||
?>
|
||||
<style media="screen"> #pointer-primary { margin: 0 5px 0 0; } </style>
|
||||
<?php }
|
||||
function admin_print_footer_scripts () {
|
||||
global $pagenow;
|
||||
global $current_user;
|
||||
$tour = array ();
|
||||
$tab = isset($_GET['tab']) ? sanitize_text_field( wp_unslash($_GET['tab'])) : '';
|
||||
$function = '';
|
||||
$button2 = '';
|
||||
$options = array ();
|
||||
$show_pointer = false;
|
||||
|
||||
if (!array_key_exists($tab, $tour)) {
|
||||
|
||||
$show_pointer = true;
|
||||
$file_error = true;
|
||||
|
||||
$id = '.settings_page_table-of-contents'; // Define ID used on page html element where we want to display pointer
|
||||
|
||||
$content = '<h3>' . sprintf (esc_html__('Thank You for using Easy TOC!', 'easy-table-of-contents'), self::DISPLAY_VERSION) . '</h3>';
|
||||
$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>';
|
||||
$content .= '
|
||||
|
||||
<style>
|
||||
.wp-pointer-buttons{ padding:0; overflow: hidden; }
|
||||
.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; }
|
||||
</style>
|
||||
<div id="mc_embed_signup">
|
||||
<form method="POST" id="subscribe-newsletter-form">
|
||||
<div id="mc_embed_signup_scroll">
|
||||
<div class="mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">
|
||||
<input type="text" name="name" class="form-control" placeholder="Name" hidden value="' . esc_attr( $current_user->display_name ) . '" style="display:none">
|
||||
|
||||
<input type="text" value="' . esc_attr( $current_user->user_email ) . '" name="email" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">
|
||||
|
||||
<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() ) . '">
|
||||
|
||||
<input type="hidden" name="ml-submit" value="1" />
|
||||
</div>
|
||||
<div id="mce-responses">
|
||||
<div class="response" id="mce-error-response" style="display:none"></div>
|
||||
<div class="response" id="mce-success-response" style="display:none"></div>
|
||||
</div>
|
||||
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
|
||||
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>
|
||||
<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;">
|
||||
</div>
|
||||
</form>
|
||||
</div>';
|
||||
$options = array (
|
||||
'content' => $content,
|
||||
'position' => array ('edge' => 'left', 'align' => 'left')
|
||||
);
|
||||
}
|
||||
if ($show_pointer) {
|
||||
$this->eztoc_pointer_script ($id, $options, esc_html__('No Thanks', 'easy-table-of-contents'), $button2, $function);
|
||||
}
|
||||
}
|
||||
function get_admin_url($page, $tab) {
|
||||
$url = admin_url();
|
||||
$url .= $page.'?tab='.$tab;
|
||||
return $url;
|
||||
}
|
||||
function eztoc_pointer_script ($id, $options, $button1, $button2=false, $function='') {
|
||||
?>
|
||||
<script>
|
||||
(function ($) {
|
||||
var wp_pointers_tour_opts = <?php echo json_encode ($options); ?>, setup;
|
||||
wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, {
|
||||
buttons: function (event, t) {
|
||||
button= jQuery ('<a id="pointer-close" class="button-secondary">' + '<?php echo wp_kses_post($button1); ?>' + '</a>');
|
||||
button_2= jQuery ('#pointer-close.button');
|
||||
button.bind ('click.pointer', function () {
|
||||
t.element.pointer ('close');
|
||||
});
|
||||
button_2.on('click', function() {
|
||||
t.element.pointer ('close');
|
||||
} );
|
||||
return button;
|
||||
},
|
||||
close: function () {
|
||||
$.post (ajaxurl, {
|
||||
pointer: 'eztoc_subscribe_pointer',
|
||||
action: 'dismiss-wp-pointer'
|
||||
});
|
||||
}
|
||||
});
|
||||
setup = function () {
|
||||
$('<?php echo esc_attr($id); ?>').pointer(wp_pointers_tour_opts).pointer('open');
|
||||
<?php if ($button2) { ?>
|
||||
jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + '<?php echo wp_kses_post($button2); ?>' + '</a>');
|
||||
jQuery ('#pointer-primary').click (function () {
|
||||
<?php echo $function; ?>
|
||||
});
|
||||
jQuery ('#pointer-close').click (function () {
|
||||
$.post (ajaxurl, {
|
||||
pointer: 'eztoc_subscribe_pointer',
|
||||
action: 'dismiss-wp-pointer'
|
||||
});
|
||||
})
|
||||
<?php } ?>
|
||||
};
|
||||
if (wp_pointers_tour_opts.position && wp_pointers_tour_opts.position.defer_loading) {
|
||||
$(window).bind('load.wp-pointers', setup);
|
||||
}
|
||||
else {
|
||||
setup ();
|
||||
}
|
||||
}) (jQuery);
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
$eztoc_pointers = new eztoc_pointers();
|
||||
?>
|
3250
wp-content/plugins/easy-table-of-contents/includes/vendor/ultimate-web-scraper/tag_filter.php
vendored
Normal file
3247
wp-content/plugins/easy-table-of-contents/includes/vendor/ultimate-web-scraper/tag_filter56.php
vendored
Normal file
@ -0,0 +1,630 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Eazy TOC\n"
|
||||
"POT-Creation-Date: 2018-01-24 15:51+0000\n"
|
||||
"PO-Revision-Date: 2018-01-24 15:51+0000\n"
|
||||
"Last-Translator: Steven - Profile <shazahm1@hotmail.com>\n"
|
||||
"Language-Team: Dutch\n"
|
||||
"Language: nl-NL\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Loco - https://localise.biz/\n"
|
||||
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n_noop:1,2;_x:1,2c;_nx:4c,1,2;"
|
||||
"_nx_noop:4c,1,2;_ex:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;"
|
||||
"esc_html_e;esc_html_x:1,2c\n"
|
||||
"X-Poedit-Basepath: ..\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"Report-Msgid-Bugs-To: "
|
||||
|
||||
#. Plugin Name of the plugin/theme
|
||||
msgid "Easy Table of Contents"
|
||||
msgstr ""
|
||||
|
||||
#. Plugin URI of the plugin/theme
|
||||
#. Author URI of the plugin/theme
|
||||
msgid "http://connections-pro.com/"
|
||||
msgstr ""
|
||||
|
||||
#. Description of the plugin/theme
|
||||
msgid ""
|
||||
"Adds a user friendly and fully automatic way to create and display a table "
|
||||
"of contents generated from the page content."
|
||||
msgstr ""
|
||||
|
||||
#. Author of the plugin/theme
|
||||
msgid "Steven A. Zahm"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:60
|
||||
msgid "Settings"
|
||||
msgstr "Instellingen"
|
||||
|
||||
#: includes/class.admin.php:92 includes/class.admin.php:93
|
||||
#: includes/class.admin.php:145 includes/class.widget-toc.php:27
|
||||
#: includes/inc.admin-options-page.php:2
|
||||
msgid "Table of Contents"
|
||||
msgstr "Inhoudsopgave"
|
||||
|
||||
#: includes/class.admin.php:188
|
||||
msgid "Disable the automatic insertion of the table of contents."
|
||||
msgstr "Automatisch invoegen van de inhoudsopgave uitschakelen."
|
||||
|
||||
#: includes/class.admin.php:199
|
||||
msgid "Insert table of contents."
|
||||
msgstr "Inhoudsopgave invoegen."
|
||||
|
||||
#: includes/class.admin.php:211
|
||||
msgid "Advanced:"
|
||||
msgstr "Geavanceerd:"
|
||||
|
||||
#: includes/class.admin.php:218
|
||||
msgid "NOTE:"
|
||||
msgstr "Let op:"
|
||||
|
||||
#: includes/class.admin.php:220
|
||||
msgid ""
|
||||
"Using the advanced options below will override the global advanced settings."
|
||||
msgstr ""
|
||||
"Het gebruik van de geavanceerde opties zal de standaard instellingen "
|
||||
"overschrijven."
|
||||
|
||||
#: includes/class.admin.php:229 includes/class.options.php:446
|
||||
msgid "Headings:"
|
||||
msgstr "Koppen:"
|
||||
|
||||
#: includes/class.admin.php:235 includes/class.options.php:447
|
||||
msgid ""
|
||||
"Select the heading to consider when generating the table of contents. "
|
||||
"Deselecting a heading will exclude it."
|
||||
msgstr ""
|
||||
"Selecteer de koppen die gebruikt moeten worden om de inhoudsopgave te "
|
||||
"genereren. Een kop niet selecteren zal hem uitsluiten."
|
||||
|
||||
#: includes/class.admin.php:237 includes/class.options.php:450
|
||||
msgid "Heading 1 (h1)"
|
||||
msgstr "Kop 1 (h1)"
|
||||
|
||||
#: includes/class.admin.php:238 includes/class.options.php:451
|
||||
msgid "Heading 2 (h2)"
|
||||
msgstr "Kop 2 (h2)"
|
||||
|
||||
#: includes/class.admin.php:239 includes/class.options.php:452
|
||||
msgid "Heading 3 (h3)"
|
||||
msgstr "Kop 3 (h3)"
|
||||
|
||||
#: includes/class.admin.php:240 includes/class.options.php:453
|
||||
msgid "Heading 4 (h4)"
|
||||
msgstr "Kop 4 (h4)"
|
||||
|
||||
#: includes/class.admin.php:241 includes/class.options.php:454
|
||||
msgid "Heading 5 (h5)"
|
||||
msgstr "Kop 5 (h5)"
|
||||
|
||||
#: includes/class.admin.php:242 includes/class.options.php:455
|
||||
msgid "Heading 6 (h6)"
|
||||
msgstr "Kop 6 (h6)"
|
||||
|
||||
#: includes/class.admin.php:252
|
||||
msgid "Alternate Headings"
|
||||
msgstr "Alternatieve Koppen"
|
||||
|
||||
#: includes/class.admin.php:258
|
||||
msgid ""
|
||||
"Specify alternate table of contents header string. Add the header to be "
|
||||
"replaced and the alternate header on a single line separated with a pipe "
|
||||
"<code>|</code>. Put each additional original and alternate header on its own "
|
||||
"line."
|
||||
msgstr ""
|
||||
"Specificeer de alternatieve tekst voor de koppen. Iedere kop (titel) die "
|
||||
"vervangen moet worden plaats je op één regel gescheiden met een <code>"
|
||||
"|</code> en dan de alternatieve tekst. Plaats daarna de volgende op een "
|
||||
"nieuwe regel, etc."
|
||||
|
||||
#: includes/class.admin.php:275 includes/class.admin.php:309
|
||||
#: includes/class.options.php:470
|
||||
msgid "Examples:"
|
||||
msgstr "Voorbeelden:"
|
||||
|
||||
#: includes/class.admin.php:277
|
||||
msgid ""
|
||||
"<code>Level [1.1]|Alternate TOC Header</code> Replaces Level [1.1] in the "
|
||||
"table of contents with Alternate TOC Header."
|
||||
msgstr ""
|
||||
"<code>Niveau [1.1]|Alternatieve TOC Kop</code> Vervangt Niveau [1.1] in de "
|
||||
"inhoudsopgave met de Alternatieve TOC Kop."
|
||||
|
||||
#: includes/class.admin.php:279
|
||||
msgid "<strong>Note:</strong> This is case sensitive."
|
||||
msgstr "<strong>Opmerking:</strong> Dit is hoofdlettergevoelig."
|
||||
|
||||
#: includes/class.admin.php:286 includes/class.options.php:461
|
||||
msgid "Exclude Headings"
|
||||
msgstr "Koppen uitsluiten"
|
||||
|
||||
#: includes/class.admin.php:292 includes/class.options.php:462
|
||||
msgid ""
|
||||
"Specify headings to be excluded from appearing in the table of contents. "
|
||||
"Separate multiple headings with a pipe <code>|</code>. Use an asterisk <code>"
|
||||
"*</code> as a wildcard to match other text."
|
||||
msgstr ""
|
||||
"Specifieer welke koppen uit te sluiten uit de inhoudsopgave. Zet een "
|
||||
"sluisteken <code>|</code> tussen verschillende koppen en gebruik een "
|
||||
"asterisk <code>*</code> als een carte blanche om andere tekst te vinden."
|
||||
|
||||
#: includes/class.admin.php:311 includes/class.options.php:472
|
||||
msgid "<code>Fruit*</code> Ignore headings starting with \"Fruit\"."
|
||||
msgstr "<code>Fruit*</code> Negeer koppen startende met \"Fruit\"."
|
||||
|
||||
#: includes/class.admin.php:312 includes/class.options.php:473
|
||||
msgid ""
|
||||
"<code>*Fruit Diet*</code> Ignore headings with \"Fruit Diet\" somewhere in "
|
||||
"the heading."
|
||||
msgstr "<code>*Fruitdieet*</code> Negeer koppen die \"Fruitdieet\" bevatten."
|
||||
|
||||
#: includes/class.admin.php:313 includes/class.options.php:474
|
||||
msgid ""
|
||||
"<code>Apple Tree|Oranges|Yellow Bananas</code> Ignore headings that are "
|
||||
"exactly \"Apple Tree\", \"Oranges\" or \"Yellow Bananas\"."
|
||||
msgstr ""
|
||||
"<code>De appelboom|Appelsienen|Gele bananen</code> Negeer koppen die exact "
|
||||
"overeenkomen met \"De appelboom\", \"Appelsienen\" or \"Gele bananen\"."
|
||||
|
||||
#: includes/class.admin.php:315 includes/class.options.php:476
|
||||
msgid "<strong>Note:</strong> This is not case sensitive."
|
||||
msgstr "<strong>Opmerking:</strong> Dit is niet hoofdlettergevoelig."
|
||||
|
||||
#: includes/class.options.php:163
|
||||
msgid "Enable Support"
|
||||
msgstr "Ondersteuning inschakelen"
|
||||
|
||||
#: includes/class.options.php:164
|
||||
msgid "Select the post types to enable the support for table of contents."
|
||||
msgstr "Selecteer de berichttypes met ondersteuning voor inhoudsopgaves."
|
||||
|
||||
#: includes/class.options.php:171
|
||||
msgid "Auto Insert"
|
||||
msgstr "Automatisch invoegen"
|
||||
|
||||
#: includes/class.options.php:172
|
||||
msgid ""
|
||||
"Select the post types which will have the table of contents automatically "
|
||||
"inserted."
|
||||
msgstr ""
|
||||
"Selecteer de berichttypes die de inhoudsopgave automatisch ingevoegd krijgen."
|
||||
|
||||
#: includes/class.options.php:173
|
||||
msgid ""
|
||||
"NOTE: The table of contents will only be automatically inserted on post "
|
||||
"types for which it has been enabled."
|
||||
msgstr ""
|
||||
"OPMERKING: de inhoudsopgave zal enkel automatisch ingevoegd worden voor "
|
||||
"berichttypes waarvoor ondersteuning ingeschakeld is."
|
||||
|
||||
#: includes/class.options.php:180
|
||||
msgid "Position"
|
||||
msgstr "Positie"
|
||||
|
||||
#: includes/class.options.php:181
|
||||
msgid "Choose where where you want to display the table of contents."
|
||||
msgstr "Kies waar de inhoudsopgave moet komen."
|
||||
|
||||
#: includes/class.options.php:184
|
||||
msgid "Before first heading (default)"
|
||||
msgstr "Voor de eerste kop (standaard)"
|
||||
|
||||
#: includes/class.options.php:185
|
||||
msgid "After first heading"
|
||||
msgstr "Na de eerste kop"
|
||||
|
||||
#: includes/class.options.php:186
|
||||
msgid "Top"
|
||||
msgstr "Bovenaan"
|
||||
|
||||
#: includes/class.options.php:187
|
||||
msgid "Bottom"
|
||||
msgstr "Onderaan"
|
||||
|
||||
#: includes/class.options.php:194
|
||||
msgid "Show when"
|
||||
msgstr "Tonen wanneer"
|
||||
|
||||
#: includes/class.options.php:195
|
||||
msgid "or more headings are present"
|
||||
msgstr "of als meerdere koppen aanwezig zijn"
|
||||
|
||||
#: includes/class.options.php:202
|
||||
msgid "Display Header Label"
|
||||
msgstr "Koplabel tonen"
|
||||
|
||||
#: includes/class.options.php:203
|
||||
msgid "Show header text above the table of contents."
|
||||
msgstr "Toon een koptekst boven de inhoudsopgave."
|
||||
|
||||
#: includes/class.options.php:209
|
||||
msgid "Header Label"
|
||||
msgstr "Koplabel"
|
||||
|
||||
#: includes/class.options.php:210
|
||||
msgid "Eg: Contents, Table of Contents, Page Contents"
|
||||
msgstr "Bv. Inhoud, Inhoudsopgave, Op deze pagina"
|
||||
|
||||
#: includes/class.options.php:212
|
||||
msgid "Contents"
|
||||
msgstr "Inhoud"
|
||||
|
||||
#: includes/class.options.php:216
|
||||
msgid "Toggle View"
|
||||
msgstr "Zichtbaarheid wijzigen"
|
||||
|
||||
#: includes/class.options.php:217
|
||||
msgid "Allow the user to toggle the visibility of the table of contents."
|
||||
msgstr ""
|
||||
"Sta de gebruiker toe de zichtbaarheid van de inhoudsopgave te wijzigen."
|
||||
|
||||
#: includes/class.options.php:237
|
||||
msgid "Initial View"
|
||||
msgstr "Initiële zichtbaarheid"
|
||||
|
||||
#: includes/class.options.php:238
|
||||
msgid "Initially hide the table of contents."
|
||||
msgstr "Verberg initieel de inhoudsopgave."
|
||||
|
||||
#: includes/class.options.php:244
|
||||
msgid "Show as Hierarchy"
|
||||
msgstr "Toon als Hiërarchie"
|
||||
|
||||
#: includes/class.options.php:251
|
||||
msgid "Counter"
|
||||
msgstr "Teller"
|
||||
|
||||
#: includes/class.options.php:255
|
||||
msgid "Decimal (default)"
|
||||
msgstr "Decimaal (standaard)"
|
||||
|
||||
#: includes/class.options.php:256
|
||||
msgid "Numeric"
|
||||
msgstr "Numeriek"
|
||||
|
||||
#: includes/class.options.php:257
|
||||
msgid "Roman"
|
||||
msgstr "Romeins"
|
||||
|
||||
#: includes/class.options.php:258
|
||||
msgid "None"
|
||||
msgstr "Geen"
|
||||
|
||||
#: includes/class.options.php:264
|
||||
msgid "Smooth Scroll"
|
||||
msgstr "Vloeiend scrollen"
|
||||
|
||||
#: includes/class.options.php:276
|
||||
msgid "Width"
|
||||
msgstr "Breedte"
|
||||
|
||||
#: includes/class.options.php:281
|
||||
msgid "Fixed"
|
||||
msgstr "Vast"
|
||||
|
||||
#: includes/class.options.php:295
|
||||
msgid "Relative"
|
||||
msgstr "Relatief"
|
||||
|
||||
#: includes/class.options.php:307 includes/class.options.php:352
|
||||
msgid "Custom"
|
||||
msgstr "Aangepast"
|
||||
|
||||
#: includes/class.options.php:309
|
||||
msgid "User Defined"
|
||||
msgstr "Gebruikersgedefinieerd"
|
||||
|
||||
#: includes/class.options.php:317
|
||||
msgid "Custom Width"
|
||||
msgstr "Aangepaste breedte"
|
||||
|
||||
#: includes/class.options.php:318
|
||||
msgid ""
|
||||
"Select the User Defined option from the Width option to utilitze the custom "
|
||||
"width."
|
||||
msgstr ""
|
||||
"Selecteer de optie Gebruikersgedefinieerd bij de optie Breedte om de "
|
||||
"aangepaste breedte te gebruiken."
|
||||
|
||||
#: includes/class.options.php:324
|
||||
msgid "Float"
|
||||
msgstr "Zwevend"
|
||||
|
||||
#: includes/class.options.php:328
|
||||
msgid "None (Default)"
|
||||
msgstr "Geen (standaard)"
|
||||
|
||||
#: includes/class.options.php:329
|
||||
msgid "Left"
|
||||
msgstr "Links"
|
||||
|
||||
#: includes/class.options.php:330
|
||||
msgid "Right"
|
||||
msgstr "Rechts"
|
||||
|
||||
#: includes/class.options.php:336
|
||||
msgid "Font Size"
|
||||
msgstr "Lettergrootte"
|
||||
|
||||
#: includes/class.options.php:343
|
||||
msgid "Theme"
|
||||
msgstr "Thema"
|
||||
|
||||
#: includes/class.options.php:344
|
||||
msgid ""
|
||||
"The theme is only applied to the table of contents which is auto inserted "
|
||||
"into the post. The Table of Contents widget will inherit the theme widget "
|
||||
"styles."
|
||||
msgstr ""
|
||||
"Het thema wordt enkel gebruikt bij de inhoudsopgaves die automatisch "
|
||||
"ingevoegd worden. De widgets met een inhoudsopgave zullen de stijl van het "
|
||||
"thema overerven."
|
||||
|
||||
#: includes/class.options.php:347
|
||||
msgid "Grey"
|
||||
msgstr "Grijs"
|
||||
|
||||
#: includes/class.options.php:348
|
||||
msgid "Light Blue"
|
||||
msgstr "Lichtblauw"
|
||||
|
||||
#: includes/class.options.php:349
|
||||
msgid "White"
|
||||
msgstr "Wit"
|
||||
|
||||
#: includes/class.options.php:350
|
||||
msgid "Black"
|
||||
msgstr "Zwart"
|
||||
|
||||
#: includes/class.options.php:351
|
||||
msgid "Transparent"
|
||||
msgstr "Doorzichtig"
|
||||
|
||||
#: includes/class.options.php:358
|
||||
msgid "Custom Theme"
|
||||
msgstr "Aangepast thema"
|
||||
|
||||
#: includes/class.options.php:359
|
||||
msgid "For the following settings to apply, select the Custom Theme option."
|
||||
msgstr "Selecteer de optie Aangepast thema om volgende opties toe te passen."
|
||||
|
||||
#: includes/class.options.php:364
|
||||
msgid "Background Color"
|
||||
msgstr "Kleur achtergrond"
|
||||
|
||||
#: includes/class.options.php:371
|
||||
msgid "Border Color"
|
||||
msgstr "Kleur rand"
|
||||
|
||||
#: includes/class.options.php:378
|
||||
msgid "Title Color"
|
||||
msgstr "Kleur titel"
|
||||
|
||||
#: includes/class.options.php:385
|
||||
msgid "Link Color"
|
||||
msgstr "Kleur snelkoppeling"
|
||||
|
||||
#: includes/class.options.php:392
|
||||
msgid "Link Hover Color"
|
||||
msgstr "Kleur snelkoppeling bij hover"
|
||||
|
||||
#: includes/class.options.php:399
|
||||
msgid "Link Visited Color"
|
||||
msgstr "Kleur bezochte snelkoppeling"
|
||||
|
||||
#: includes/class.options.php:411
|
||||
msgid "Lowercase"
|
||||
msgstr "Kleine letters"
|
||||
|
||||
#: includes/class.options.php:412
|
||||
msgid "Ensure anchors are in lowercase."
|
||||
msgstr "Zorg ervoor dat de ankers in kleine letters zijn."
|
||||
|
||||
#: includes/class.options.php:418
|
||||
msgid "Hyphenate"
|
||||
msgstr "Met streepjes"
|
||||
|
||||
#: includes/class.options.php:419
|
||||
msgid "Use - rather than _ in anchors."
|
||||
msgstr "Gebruik - in plaats van _ in ankers."
|
||||
|
||||
#: includes/class.options.php:425
|
||||
msgid "Homepage"
|
||||
msgstr "Startpagina"
|
||||
|
||||
#: includes/class.options.php:426
|
||||
msgid "Show the table of contents for qualifying items on the homepage."
|
||||
msgstr ""
|
||||
"Toon de inhoudsopgave op de startpagina voor in aanmerking komende items."
|
||||
|
||||
#: includes/class.options.php:432
|
||||
msgid "CSS"
|
||||
msgstr "CSS"
|
||||
|
||||
#: includes/class.options.php:433
|
||||
msgid ""
|
||||
"Prevent the loading the core CSS styles. When selected, the appearance "
|
||||
"options from above will be ignored."
|
||||
msgstr ""
|
||||
"De basis CSS niet laden. Als dit geselecteerd is, zullen de opties hierboven "
|
||||
"genegeerd worden."
|
||||
|
||||
#: includes/class.options.php:481
|
||||
msgid "Smooth Scroll Offset"
|
||||
msgstr "Offset voor vloeiend schuiven"
|
||||
|
||||
#: includes/class.options.php:482
|
||||
msgid ""
|
||||
"If you have a consistent menu across the top of your site, you can adjust "
|
||||
"the top offset to stop the headings from appearing underneath the top menu. "
|
||||
"A setting of 30 accommodates the WordPress admin bar. This setting only has "
|
||||
"an effect after you have enabled Smooth Scroll option."
|
||||
msgstr ""
|
||||
"Als je een vaste menu hebt aan de bovenkant van je site, kan je de offset "
|
||||
"aanpassen om te vermijden dat de inhoudstafel onder de menu komt. 30 is een "
|
||||
"aanbevolen waarden om de WordPress-adminbar te compenseren. Deze optie werkt "
|
||||
"enkel als je de optie Vloeiend schuiven aan hebt staan."
|
||||
|
||||
#: includes/class.options.php:489
|
||||
msgid "Limit Path"
|
||||
msgstr "Pad beperken"
|
||||
|
||||
#: includes/class.options.php:490
|
||||
msgid ""
|
||||
"Restrict generation of the table of contents to pages that match the "
|
||||
"required path. This path is from the root of your site and always begins "
|
||||
"with a forward slash."
|
||||
msgstr ""
|
||||
"Beperk de generatie van de inhoudsopgave tot pagina's waarvoor het pad "
|
||||
"overeenkomt met het vereiste pad. Dit pad is vanaf de wortel van je site en "
|
||||
"begint met een voorwaartse schuine streep."
|
||||
|
||||
#: includes/class.options.php:491
|
||||
msgid "Eg: /wiki/, /corporate/annual-reports/"
|
||||
msgstr "Bv /wiki/, /bedrijf/rapporten/"
|
||||
|
||||
#: includes/class.options.php:496
|
||||
msgid "Default Anchor Prefix"
|
||||
msgstr "Standaard ankervoorvoegsel"
|
||||
|
||||
#: includes/class.options.php:497
|
||||
msgid ""
|
||||
"Anchor targets are restricted to alphanumeric characters as per HTML "
|
||||
"specification (see readme for more detail). The default anchor prefix will "
|
||||
"be used when no characters qualify. When left blank, a number will be used "
|
||||
"instead."
|
||||
msgstr ""
|
||||
"Ankers bestaan enkel uit alpanumerieke waarden, zoals de HTML-standaard "
|
||||
"vereist (zie readme voor meer details). Dit is het standaardanker als geen "
|
||||
"enkel ander teken in aanmerking komt. Indien leeg zal een getal gebruikt "
|
||||
"worden."
|
||||
|
||||
#: includes/class.options.php:498
|
||||
msgid ""
|
||||
"This option normally applies to content written in character sets other than "
|
||||
"ASCII."
|
||||
msgstr ""
|
||||
"Deze optie is normaal enkel nodig voor inhoud die niet in ASCII geschreven "
|
||||
"is."
|
||||
|
||||
#: includes/class.options.php:499
|
||||
msgid "Eg: i, toc_index, index, _"
|
||||
msgstr "Bv. i, toc, index, _"
|
||||
|
||||
#: includes/class.options.php:505
|
||||
msgid "Widget Affix Selector"
|
||||
msgstr "Widget affix selector"
|
||||
|
||||
#: includes/class.options.php:506
|
||||
msgid ""
|
||||
"To enable the option to affix or pin the Table of Contents widget enter the "
|
||||
"theme's sidebar class or id."
|
||||
msgstr ""
|
||||
"Om de optie om de widget met de inhoudsopgave vast te zetten moet je het id "
|
||||
"of de klasse van de zijbalk van het thema opgeven."
|
||||
|
||||
#: includes/class.options.php:507
|
||||
msgid ""
|
||||
"Since every theme is different, this can not be determined automatically. If "
|
||||
"you are unsure how to find the sidebar's class or id, please ask the theme's "
|
||||
"support persons."
|
||||
msgstr ""
|
||||
"Omdat elk thema anders is, kan dit niet vanzelf gebeuren. Als je niet goed "
|
||||
"weet wat je hier moet doen, is het best contact op te nemen met de auteur "
|
||||
"van het thema."
|
||||
|
||||
#: includes/class.options.php:508
|
||||
msgid "Eg: .widget-area or #sidebar"
|
||||
msgstr "Bv .widget-area of #sidebar"
|
||||
|
||||
#: includes/class.options.php:756
|
||||
#, php-format
|
||||
msgid ""
|
||||
"The callback function used for the <strong>%s</strong> setting is missing."
|
||||
msgstr ""
|
||||
"Deze callback-functie is gebruikt omdat de optie <strong>%s</strong> "
|
||||
"ontbreekt."
|
||||
|
||||
#: includes/class.widget-toc.php:22
|
||||
msgid "Display the table of contents."
|
||||
msgstr "Toon de inhoudsopgave."
|
||||
|
||||
#: includes/class.widget-toc.php:310
|
||||
msgid "Title"
|
||||
msgstr "Titel"
|
||||
|
||||
#: includes/class.widget-toc.php:317
|
||||
msgid "Active Section Highlight Color:"
|
||||
msgstr "Kleur actieve selectie:"
|
||||
|
||||
#: includes/class.widget-toc.php:325
|
||||
msgid "Affix or pin the widget."
|
||||
msgstr "Affix of zet de widget vast."
|
||||
|
||||
#: includes/class.widget-toc.php:329
|
||||
msgid ""
|
||||
"If you choose to affix the widget, do not add any other widgets on the "
|
||||
"sidebar. Also, make sure you have only one instance Table of Contents widget "
|
||||
"on the page."
|
||||
msgstr ""
|
||||
"Als je ervoor kiest de widget vast te zetten, mag je geen andere widgets aan "
|
||||
"de zijbalk toevoegen. Zorg er ook voor dat er slechts één widget met "
|
||||
"inhoudsopgave op de pagina te zien is."
|
||||
|
||||
#: includes/inc.admin-options-page.php:9
|
||||
msgid "General"
|
||||
msgstr "Algemeen"
|
||||
|
||||
#: includes/inc.admin-options-page.php:27
|
||||
msgid "Appearance"
|
||||
msgstr "Weergave"
|
||||
|
||||
#: includes/inc.admin-options-page.php:45
|
||||
msgid "Advanced"
|
||||
msgstr "Geavanceerd"
|
||||
|
||||
#: includes/inc.admin-options-page.php:61
|
||||
msgid "Save Changes"
|
||||
msgstr "Wijzigingen opslaan"
|
||||
|
||||
|
||||
#: Sticky Toggle Options
|
||||
#: includes/inc.admin-options-page.php:286
|
||||
msgid "Sticky Toggle Options"
|
||||
msgstr "Sticky Toggle-opties"
|
||||
|
||||
msgid "On/Off"
|
||||
msgstr "Aan uit"
|
||||
|
||||
msgid "Width"
|
||||
msgstr "Breedte"
|
||||
|
||||
msgid "Auto"
|
||||
msgstr "Auto"
|
||||
|
||||
msgid "Custom Width"
|
||||
msgstr "Aangepaste breedte"
|
||||
|
||||
msgid "Enter sticky toggle custom width here.."
|
||||
msgstr "Voer hier de sticky toggle aangepaste breedte in.."
|
||||
|
||||
msgid "Height"
|
||||
msgstr "Hoogte"
|
||||
|
||||
msgid "Custom Height"
|
||||
msgstr "Aangepaste hoogte"
|
||||
|
||||
msgid "Enter sticky toggle custom height here.."
|
||||
msgstr "Voer hier de sticky toggle aangepaste hoogte in.."
|
||||
|
||||
msgid "Open Button Text"
|
||||
msgstr "Knoptekst openen"
|
||||
|
||||
msgid "Enter sticky toggle open button text here.."
|
||||
msgstr "Voer hier de sticky toggle open-knoptekst in.."
|
@ -0,0 +1,580 @@
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
||||
"Project-Id-Version: Easy Table of Contents\n"
|
||||
"POT-Creation-Date: 2018-01-24 10:35-0500\n"
|
||||
"PO-Revision-Date: 2015-11-09 09:47-0500\n"
|
||||
"Last-Translator: Steven A. Zahm <helpdesk@connections-pro.com>\n"
|
||||
"Language-Team: Steven A. Zahm <helpdesk@connections-pro.com>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.0.4\n"
|
||||
"X-Poedit-Basepath: ..\n"
|
||||
"X-Poedit-WPHeader: easy-table-of-contents.php\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
||||
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
||||
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
||||
|
||||
#: includes/class.admin.php:60
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:92 includes/class.admin.php:93
|
||||
#: includes/class.admin.php:145 includes/class.widget-toc.php:27
|
||||
#: includes/inc.admin-options-page.php:2
|
||||
msgid "Table of Contents"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:188
|
||||
msgid "Disable the automatic insertion of the table of contents."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:199
|
||||
msgid "Insert table of contents."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:211
|
||||
msgid "Advanced:"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:218
|
||||
msgid "NOTE:"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:220
|
||||
msgid ""
|
||||
"Using the advanced options below will override the global advanced settings."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:229 includes/class.options.php:446
|
||||
msgid "Headings:"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:235 includes/class.options.php:447
|
||||
msgid ""
|
||||
"Select the heading to consider when generating the table of contents. "
|
||||
"Deselecting a heading will exclude it."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:237 includes/class.options.php:450
|
||||
msgid "Heading 1 (h1)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:238 includes/class.options.php:451
|
||||
msgid "Heading 2 (h2)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:239 includes/class.options.php:452
|
||||
msgid "Heading 3 (h3)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:240 includes/class.options.php:453
|
||||
msgid "Heading 4 (h4)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:241 includes/class.options.php:454
|
||||
msgid "Heading 5 (h5)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:242 includes/class.options.php:455
|
||||
msgid "Heading 6 (h6)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:252
|
||||
msgid "Alternate Headings"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:258
|
||||
msgid ""
|
||||
"Specify alternate table of contents header string. Add the header to be "
|
||||
"replaced and the alternate header on a single line separated with a pipe "
|
||||
"<code>|</code>. Put each additional original and alternate header on its own "
|
||||
"line."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:275 includes/class.admin.php:309
|
||||
#: includes/class.options.php:470
|
||||
msgid "Examples:"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:277
|
||||
msgid ""
|
||||
"<code>Level [1.1]|Alternate TOC Header</code> Replaces Level [1.1] in the "
|
||||
"table of contents with Alternate TOC Header."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:279
|
||||
msgid "<strong>Note:</strong> This is case sensitive."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:286 includes/class.options.php:461
|
||||
msgid "Exclude Headings"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:292 includes/class.options.php:462
|
||||
msgid ""
|
||||
"Specify headings to be excluded from appearing in the table of contents. "
|
||||
"Separate multiple headings with a pipe <code>|</code>. Use an asterisk "
|
||||
"<code>*</code> as a wildcard to match other text."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:311 includes/class.options.php:472
|
||||
msgid "<code>Fruit*</code> Ignore headings starting with \"Fruit\"."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:312 includes/class.options.php:473
|
||||
msgid ""
|
||||
"<code>*Fruit Diet*</code> Ignore headings with \"Fruit Diet\" somewhere in "
|
||||
"the heading."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:313 includes/class.options.php:474
|
||||
msgid ""
|
||||
"<code>Apple Tree|Oranges|Yellow Bananas</code> Ignore headings that are "
|
||||
"exactly \"Apple Tree\", \"Oranges\" or \"Yellow Bananas\"."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.admin.php:315 includes/class.options.php:476
|
||||
msgid "<strong>Note:</strong> This is not case sensitive."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:163
|
||||
msgid "Enable Support"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:164
|
||||
msgid "Select the post types to enable the support for table of contents."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:171
|
||||
msgid "Auto Insert"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:172
|
||||
msgid ""
|
||||
"Select the post types which will have the table of contents automatically "
|
||||
"inserted."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:173
|
||||
msgid ""
|
||||
"NOTE: The table of contents will only be automatically inserted on post "
|
||||
"types for which it has been enabled."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:180
|
||||
msgid "Position"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:181
|
||||
msgid "Choose where where you want to display the table of contents."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:184
|
||||
msgid "Before first heading (default)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:185
|
||||
msgid "After first heading"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:186
|
||||
msgid "Top"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:187
|
||||
msgid "Bottom"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:194
|
||||
msgid "Show when"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:195
|
||||
msgid "or more headings are present"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:202
|
||||
msgid "Display Header Label"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:203
|
||||
msgid "Show header text above the table of contents."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:209
|
||||
msgid "Header Label"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:210
|
||||
msgid "Eg: Contents, Table of Contents, Page Contents"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:212
|
||||
msgid "Contents"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:216
|
||||
msgid "Toggle View"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:217
|
||||
msgid "Allow the user to toggle the visibility of the table of contents."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:237
|
||||
msgid "Initial View"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:238
|
||||
msgid "Initially hide the table of contents."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:244
|
||||
msgid "Show as Hierarchy"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:251
|
||||
msgid "Counter"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:255
|
||||
msgid "Decimal (default)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:256
|
||||
msgid "Numeric"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:257
|
||||
msgid "Roman"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:258
|
||||
msgid "None"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:264
|
||||
msgid "Smooth Scroll"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:276
|
||||
msgid "Width"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:281
|
||||
msgid "Fixed"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:295
|
||||
msgid "Relative"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:307 includes/class.options.php:352
|
||||
msgid "Custom"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:309
|
||||
msgid "User Defined"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:317
|
||||
msgid "Custom Width"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:318
|
||||
msgid ""
|
||||
"Select the User Defined option from the Width option to utilitze the custom "
|
||||
"width."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:324
|
||||
msgid "Float"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:328
|
||||
msgid "None (Default)"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:329
|
||||
msgid "Left"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:330
|
||||
msgid "Right"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:336
|
||||
msgid "Font Size"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:343
|
||||
msgid "Theme"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:344
|
||||
msgid ""
|
||||
"The theme is only applied to the table of contents which is auto inserted "
|
||||
"into the post. The Table of Contents widget will inherit the theme widget "
|
||||
"styles."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:347
|
||||
msgid "Grey"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:348
|
||||
msgid "Light Blue"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:349
|
||||
msgid "White"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:350
|
||||
msgid "Black"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:351
|
||||
msgid "Transparent"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:358
|
||||
msgid "Custom Theme"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:359
|
||||
msgid "For the following settings to apply, select the Custom Theme option."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:364
|
||||
msgid "Background Color"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:371
|
||||
msgid "Border Color"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:378
|
||||
msgid "Title Color"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:385
|
||||
msgid "Link Color"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:392
|
||||
msgid "Link Hover Color"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:399
|
||||
msgid "Link Visited Color"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:411
|
||||
msgid "Lowercase"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:412
|
||||
msgid "Ensure anchors are in lowercase."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:418
|
||||
msgid "Hyphenate"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:419
|
||||
msgid "Use - rather than _ in anchors."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:425
|
||||
msgid "Homepage"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:426
|
||||
msgid "Show the table of contents for qualifying items on the homepage."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:432
|
||||
msgid "CSS"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:433
|
||||
msgid ""
|
||||
"Prevent the loading the core CSS styles. When selected, the appearance "
|
||||
"options from above will be ignored."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:481
|
||||
msgid "Smooth Scroll Offset"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:482
|
||||
msgid ""
|
||||
"If you have a consistent menu across the top of your site, you can adjust "
|
||||
"the top offset to stop the headings from appearing underneath the top menu. "
|
||||
"A setting of 30 accommodates the WordPress admin bar. This setting only has "
|
||||
"an effect after you have enabled Smooth Scroll option."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:489
|
||||
msgid "Limit Path"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:490
|
||||
msgid ""
|
||||
"Restrict generation of the table of contents to pages that match the "
|
||||
"required path. This path is from the root of your site and always begins "
|
||||
"with a forward slash."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:491
|
||||
msgid "Eg: /wiki/, /corporate/annual-reports/"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:496
|
||||
msgid "Default Anchor Prefix"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:497
|
||||
msgid ""
|
||||
"Anchor targets are restricted to alphanumeric characters as per HTML "
|
||||
"specification (see readme for more detail). The default anchor prefix will "
|
||||
"be used when no characters qualify. When left blank, a number will be used "
|
||||
"instead."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:498
|
||||
msgid ""
|
||||
"This option normally applies to content written in character sets other than "
|
||||
"ASCII."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:499
|
||||
msgid "Eg: i, toc_index, index, _"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:505
|
||||
msgid "Widget Affix Selector"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:506
|
||||
msgid ""
|
||||
"To enable the option to affix or pin the Table of Contents widget enter the "
|
||||
"theme's sidebar class or id."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:507
|
||||
msgid ""
|
||||
"Since every theme is different, this can not be determined automatically. If "
|
||||
"you are unsure how to find the sidebar's class or id, please ask the theme's "
|
||||
"support persons."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:508
|
||||
msgid "Eg: .widget-area or #sidebar"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.options.php:756
|
||||
#, php-format
|
||||
msgid ""
|
||||
"The callback function used for the <strong>%s</strong> setting is missing."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.widget-toc.php:22
|
||||
msgid "Display the table of contents."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.widget-toc.php:310
|
||||
msgid "Title"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.widget-toc.php:317
|
||||
msgid "Active Section Highlight Color:"
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.widget-toc.php:325
|
||||
msgid "Affix or pin the widget."
|
||||
msgstr ""
|
||||
|
||||
#: includes/class.widget-toc.php:329
|
||||
msgid ""
|
||||
"If you choose to affix the widget, do not add any other widgets on the "
|
||||
"sidebar. Also, make sure you have only one instance Table of Contents widget "
|
||||
"on the page."
|
||||
msgstr ""
|
||||
|
||||
#: includes/inc.admin-options-page.php:9
|
||||
msgid "General"
|
||||
msgstr ""
|
||||
|
||||
#: includes/inc.admin-options-page.php:27
|
||||
msgid "Appearance"
|
||||
msgstr ""
|
||||
|
||||
#: includes/inc.admin-options-page.php:45
|
||||
msgid "Advanced"
|
||||
msgstr ""
|
||||
|
||||
#: includes/inc.admin-options-page.php:61
|
||||
msgid "Save Changes"
|
||||
msgstr ""
|
||||
|
||||
#. Plugin Name of the plugin/theme
|
||||
msgid "Easy Table of Contents"
|
||||
msgstr ""
|
||||
|
||||
#. Plugin URI of the plugin/theme
|
||||
#. Author URI of the plugin/theme
|
||||
msgid "http://connections-pro.com/"
|
||||
msgstr ""
|
||||
|
||||
#. Description of the plugin/theme
|
||||
msgid ""
|
||||
"Adds a user friendly and fully automatic way to create and display a table "
|
||||
"of contents generated from the page content."
|
||||
msgstr ""
|
||||
|
||||
#. Author of the plugin/theme
|
||||
msgid "Steven A. Zahm"
|
||||
msgstr ""
|
||||
|
||||
#: Sticky Toggle Options
|
||||
#: includes/inc.admin-options-page.php:286
|
||||
msgid "Sticky Toggle Options"
|
||||
msgstr ""
|
||||
|
||||
msgid "On/Off"
|
||||
msgstr ""
|
||||
|
||||
msgid "Width"
|
||||
msgstr ""
|
||||
|
||||
msgid "Auto"
|
||||
msgstr ""
|
||||
|
||||
msgid "Custom Width"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enter sticky toggle custom width here.."
|
||||
msgstr ""
|
||||
|
||||
msgid "Height"
|
||||
msgstr ""
|
||||
|
||||
msgid "Custom Height"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enter sticky toggle custom height here.."
|
||||
msgstr ""
|
||||
|
||||
msgid "Open Button Text"
|
||||
msgstr ""
|
||||
|
||||
msgid "Enter sticky toggle open button text here.."
|
||||
msgstr ""
|
163
wp-content/plugins/easy-table-of-contents/vendor/js-cookie/js.cookie.js
vendored
Normal file
@ -0,0 +1,163 @@
|
||||
/*!
|
||||
* JavaScript Cookie v2.2.1
|
||||
* https://github.com/js-cookie/js-cookie
|
||||
*
|
||||
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
||||
* Released under the MIT license
|
||||
*/
|
||||
;(function (factory) {
|
||||
var registeredInModuleLoader;
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(factory);
|
||||
registeredInModuleLoader = true;
|
||||
}
|
||||
if (typeof exports === 'object') {
|
||||
module.exports = factory();
|
||||
registeredInModuleLoader = true;
|
||||
}
|
||||
if (!registeredInModuleLoader) {
|
||||
var OldCookies = window.Cookies;
|
||||
var api = window.Cookies = factory();
|
||||
api.noConflict = function () {
|
||||
window.Cookies = OldCookies;
|
||||
return api;
|
||||
};
|
||||
}
|
||||
}(function () {
|
||||
function extend () {
|
||||
var i = 0;
|
||||
var result = {};
|
||||
for (; i < arguments.length; i++) {
|
||||
var attributes = arguments[ i ];
|
||||
for (var key in attributes) {
|
||||
result[key] = attributes[key];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function decode (s) {
|
||||
return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
|
||||
}
|
||||
|
||||
function init (converter) {
|
||||
function api() {}
|
||||
|
||||
function set (key, value, attributes) {
|
||||
if (typeof document === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
attributes = extend({
|
||||
path: '/'
|
||||
}, api.defaults, attributes);
|
||||
|
||||
if (typeof attributes.expires === 'number') {
|
||||
attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
|
||||
}
|
||||
|
||||
// We're using "expires" because "max-age" is not supported by IE
|
||||
attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
|
||||
|
||||
try {
|
||||
var result = JSON.stringify(value);
|
||||
if (/^[\{\[]/.test(result)) {
|
||||
value = result;
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
value = converter.write ?
|
||||
converter.write(value, key) :
|
||||
encodeURIComponent(String(value))
|
||||
.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
|
||||
|
||||
key = encodeURIComponent(String(key))
|
||||
.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
|
||||
.replace(/[\(\)]/g, escape);
|
||||
|
||||
var stringifiedAttributes = '';
|
||||
for (var attributeName in attributes) {
|
||||
if (!attributes[attributeName]) {
|
||||
continue;
|
||||
}
|
||||
stringifiedAttributes += '; ' + attributeName;
|
||||
if (attributes[attributeName] === true) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Considers RFC 6265 section 5.2:
|
||||
// ...
|
||||
// 3. If the remaining unparsed-attributes contains a %x3B (";")
|
||||
// character:
|
||||
// Consume the characters of the unparsed-attributes up to,
|
||||
// not including, the first %x3B (";") character.
|
||||
// ...
|
||||
stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
|
||||
}
|
||||
|
||||
return (document.cookie = key + '=' + value + stringifiedAttributes);
|
||||
}
|
||||
|
||||
function get (key, json) {
|
||||
if (typeof document === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
var jar = {};
|
||||
// To prevent the for loop in the first place assign an empty array
|
||||
// in case there are no cookies at all.
|
||||
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
||||
var i = 0;
|
||||
|
||||
for (; i < cookies.length; i++) {
|
||||
var parts = cookies[i].split('=');
|
||||
var cookie = parts.slice(1).join('=');
|
||||
|
||||
if (!json && cookie.charAt(0) === '"') {
|
||||
cookie = cookie.slice(1, -1);
|
||||
}
|
||||
|
||||
try {
|
||||
var name = decode(parts[0]);
|
||||
cookie = (converter.read || converter)(cookie, name) ||
|
||||
decode(cookie);
|
||||
|
||||
if (json) {
|
||||
try {
|
||||
cookie = JSON.parse(cookie);
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
jar[name] = cookie;
|
||||
|
||||
if (key === name) {
|
||||
break;
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
return key ? jar[key] : jar;
|
||||
}
|
||||
|
||||
api.set = set;
|
||||
api.get = function (key) {
|
||||
return get(key, false /* read as raw */);
|
||||
};
|
||||
api.getJSON = function (key) {
|
||||
return get(key, true /* read as json */);
|
||||
};
|
||||
api.remove = function (key, attributes) {
|
||||
set(key, '', extend(attributes, {
|
||||
expires: -1
|
||||
}));
|
||||
};
|
||||
|
||||
api.defaults = {};
|
||||
|
||||
api.withConverter = init;
|
||||
|
||||
return api;
|
||||
}
|
||||
|
||||
return init(function () {});
|
||||
}));
|
8
wp-content/plugins/easy-table-of-contents/vendor/js-cookie/js.cookie.min.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/*!
|
||||
* JavaScript Cookie v2.2.1
|
||||
* https://github.com/js-cookie/js-cookie
|
||||
*
|
||||
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
|
||||
* Released under the MIT license
|
||||
*/
|
||||
!function(factory){var registeredInModuleLoader;if("function"==typeof define&&define.amd&&(define(factory),registeredInModuleLoader=!0),"object"==typeof exports&&(module.exports=factory(),registeredInModuleLoader=!0),!registeredInModuleLoader){var OldCookies=window.Cookies,api=window.Cookies=factory();api.noConflict=function(){return window.Cookies=OldCookies,api}}}((function(){function extend(){for(var i=0,result={};i<arguments.length;i++){var attributes=arguments[i];for(var key in attributes)result[key]=attributes[key]}return result}function decode(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function init(converter){function api(){}function set(key,value,attributes){if("undefined"!=typeof document){"number"==typeof(attributes=extend({path:"/"},api.defaults,attributes)).expires&&(attributes.expires=new Date(1*new Date+864e5*attributes.expires)),attributes.expires=attributes.expires?attributes.expires.toUTCString():"";try{var result=JSON.stringify(value);/^[\{\[]/.test(result)&&(value=result)}catch(e){}value=converter.write?converter.write(value,key):encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),key=encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var stringifiedAttributes="";for(var attributeName in attributes)attributes[attributeName]&&(stringifiedAttributes+="; "+attributeName,!0!==attributes[attributeName]&&(stringifiedAttributes+="="+attributes[attributeName].split(";")[0]));return document.cookie=key+"="+value+stringifiedAttributes}}function get(key,json){if("undefined"!=typeof document){for(var jar={},cookies=document.cookie?document.cookie.split("; "):[],i=0;i<cookies.length;i++){var parts=cookies[i].split("="),cookie=parts.slice(1).join("=");json||'"'!==cookie.charAt(0)||(cookie=cookie.slice(1,-1));try{var name=decode(parts[0]);if(cookie=(converter.read||converter)(cookie,name)||decode(cookie),json)try{cookie=JSON.parse(cookie)}catch(e){}if(jar[name]=cookie,key===name)break}catch(e){}}return key?jar[key]:jar}}return api.set=set,api.get=function(key){return get(key,!1)},api.getJSON=function(key){return get(key,!0)},api.remove=function(key,attributes){set(key,"",extend(attributes,{expires:-1}))},api.defaults={},api.withConverter=init,api}return init((function(){}))}));
|
248
wp-content/plugins/easy-table-of-contents/vendor/sticky-kit/jquery.sticky-kit.js
vendored
Normal file
@ -0,0 +1,248 @@
|
||||
// Generated by CoffeeScript 1.9.2
|
||||
|
||||
/**
|
||||
@license Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var $, win;
|
||||
|
||||
$ = this.jQuery || window.jQuery;
|
||||
|
||||
win = $(window);
|
||||
|
||||
$.fn.stick_in_parent = function(opts) {
|
||||
var doc, elm, enable_bottoming, fn, i, inner_scrolling, len, manual_spacer, offset_top, parent_selector, recalc_every, sticky_class;
|
||||
if (opts == null) {
|
||||
opts = {};
|
||||
}
|
||||
sticky_class = opts.sticky_class, inner_scrolling = opts.inner_scrolling, recalc_every = opts.recalc_every, parent_selector = opts.parent, offset_top = opts.offset_top, manual_spacer = opts.spacer, enable_bottoming = opts.bottoming;
|
||||
if (offset_top == null) {
|
||||
offset_top = 0;
|
||||
}
|
||||
if (parent_selector == null) {
|
||||
parent_selector = void 0;
|
||||
}
|
||||
if (inner_scrolling == null) {
|
||||
inner_scrolling = true;
|
||||
}
|
||||
if (sticky_class == null) {
|
||||
sticky_class = "is_stuck";
|
||||
}
|
||||
doc = $(document);
|
||||
if (enable_bottoming == null) {
|
||||
enable_bottoming = true;
|
||||
}
|
||||
fn = function(elm, padding_bottom, parent_top, parent_height, top, height, el_float, detached) {
|
||||
var bottomed, detach, fixed, last_pos, last_scroll_height, offset, parent, recalc, recalc_and_tick, recalc_counter, spacer, tick;
|
||||
if (elm.data("sticky_kit")) {
|
||||
return;
|
||||
}
|
||||
elm.data("sticky_kit", true);
|
||||
last_scroll_height = doc.height();
|
||||
parent = elm.parent();
|
||||
if (parent_selector != null) {
|
||||
parent = parent.closest(parent_selector);
|
||||
}
|
||||
if (!parent.length) {
|
||||
throw "failed to find stick parent";
|
||||
}
|
||||
fixed = false;
|
||||
bottomed = false;
|
||||
spacer = manual_spacer != null ? manual_spacer && elm.closest(manual_spacer) : $("<div />");
|
||||
recalc = function() {
|
||||
var border_top, padding_top, restore;
|
||||
if (detached) {
|
||||
return;
|
||||
}
|
||||
last_scroll_height = doc.height();
|
||||
border_top = parseInt(parent.css("border-top-width"), 10);
|
||||
padding_top = parseInt(parent.css("padding-top"), 10);
|
||||
padding_bottom = parseInt(parent.css("padding-bottom"), 10);
|
||||
parent_top = parent.offset().top + border_top + padding_top;
|
||||
parent_height = parent.height();
|
||||
if (fixed) {
|
||||
fixed = false;
|
||||
bottomed = false;
|
||||
if (manual_spacer == null) {
|
||||
elm.insertAfter(spacer);
|
||||
spacer.detach();
|
||||
}
|
||||
elm.css({
|
||||
position: "",
|
||||
top: "",
|
||||
width: "",
|
||||
bottom: ""
|
||||
}).removeClass(sticky_class);
|
||||
restore = true;
|
||||
}
|
||||
top = elm.offset().top - (parseInt(elm.css("margin-top"), 10) || 0) - offset_top;
|
||||
height = elm.outerHeight(true);
|
||||
el_float = elm.css("float");
|
||||
if (spacer) {
|
||||
spacer.css({
|
||||
width: elm.outerWidth(true),
|
||||
height: height,
|
||||
display: elm.css("display"),
|
||||
"vertical-align": elm.css("vertical-align"),
|
||||
"float": el_float
|
||||
});
|
||||
}
|
||||
if (restore) {
|
||||
return tick();
|
||||
}
|
||||
};
|
||||
recalc();
|
||||
if (height === parent_height) {
|
||||
return;
|
||||
}
|
||||
last_pos = void 0;
|
||||
offset = offset_top;
|
||||
recalc_counter = recalc_every;
|
||||
tick = function() {
|
||||
var css, delta, recalced, scroll, will_bottom, win_height;
|
||||
if (detached) {
|
||||
return;
|
||||
}
|
||||
recalced = false;
|
||||
if (recalc_counter != null) {
|
||||
recalc_counter -= 1;
|
||||
if (recalc_counter <= 0) {
|
||||
recalc_counter = recalc_every;
|
||||
recalc();
|
||||
recalced = true;
|
||||
}
|
||||
}
|
||||
if (!recalced && doc.height() !== last_scroll_height) {
|
||||
recalc();
|
||||
recalced = true;
|
||||
}
|
||||
scroll = win.scrollTop();
|
||||
if (last_pos != null) {
|
||||
delta = scroll - last_pos;
|
||||
}
|
||||
last_pos = scroll;
|
||||
if (fixed) {
|
||||
if (enable_bottoming) {
|
||||
will_bottom = scroll + height + offset > parent_height + parent_top;
|
||||
if (bottomed && !will_bottom) {
|
||||
bottomed = false;
|
||||
elm.css({
|
||||
position: "fixed",
|
||||
bottom: "",
|
||||
top: offset
|
||||
}).trigger("sticky_kit:unbottom");
|
||||
}
|
||||
}
|
||||
if (scroll < top) {
|
||||
fixed = false;
|
||||
offset = offset_top;
|
||||
if (manual_spacer == null) {
|
||||
if (el_float === "left" || el_float === "right") {
|
||||
elm.insertAfter(spacer);
|
||||
}
|
||||
spacer.detach();
|
||||
}
|
||||
css = {
|
||||
position: "",
|
||||
width: "",
|
||||
top: ""
|
||||
};
|
||||
elm.css(css).removeClass(sticky_class).trigger("sticky_kit:unstick");
|
||||
}
|
||||
if (inner_scrolling) {
|
||||
win_height = win.height();
|
||||
if (height + offset_top > win_height) {
|
||||
if (!bottomed) {
|
||||
offset -= delta;
|
||||
offset = Math.max(win_height - height, offset);
|
||||
offset = Math.min(offset_top, offset);
|
||||
if (fixed) {
|
||||
elm.css({
|
||||
top: offset + "px"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (scroll > top) {
|
||||
fixed = true;
|
||||
css = {
|
||||
position: "fixed",
|
||||
top: offset
|
||||
};
|
||||
css.width = elm.css("box-sizing") === "border-box" ? elm.outerWidth() + "px" : elm.width() + "px";
|
||||
elm.css(css).addClass(sticky_class);
|
||||
if (manual_spacer == null) {
|
||||
elm.after(spacer);
|
||||
if (el_float === "left" || el_float === "right") {
|
||||
spacer.append(elm);
|
||||
}
|
||||
}
|
||||
elm.trigger("sticky_kit:stick");
|
||||
}
|
||||
}
|
||||
if (fixed && enable_bottoming) {
|
||||
if (will_bottom == null) {
|
||||
will_bottom = scroll + height + offset > parent_height + parent_top;
|
||||
}
|
||||
if (!bottomed && will_bottom) {
|
||||
bottomed = true;
|
||||
if (parent.css("position") === "static") {
|
||||
parent.css({
|
||||
position: "relative"
|
||||
});
|
||||
}
|
||||
return elm.css({
|
||||
position: "absolute",
|
||||
bottom: padding_bottom,
|
||||
top: "auto"
|
||||
}).trigger("sticky_kit:bottom");
|
||||
}
|
||||
}
|
||||
};
|
||||
recalc_and_tick = function() {
|
||||
recalc();
|
||||
return tick();
|
||||
};
|
||||
detach = function() {
|
||||
detached = true;
|
||||
win.off("touchmove", tick);
|
||||
win.off("scroll", tick);
|
||||
win.off("resize", recalc_and_tick);
|
||||
$(document.body).off("sticky_kit:recalc", recalc_and_tick);
|
||||
elm.off("sticky_kit:detach", detach);
|
||||
elm.removeData("sticky_kit");
|
||||
elm.css({
|
||||
position: "",
|
||||
bottom: "",
|
||||
top: "",
|
||||
width: ""
|
||||
});
|
||||
parent.position("position", "");
|
||||
if (fixed) {
|
||||
if (manual_spacer == null) {
|
||||
if (el_float === "left" || el_float === "right") {
|
||||
elm.insertAfter(spacer);
|
||||
}
|
||||
spacer.remove();
|
||||
}
|
||||
return elm.removeClass(sticky_class);
|
||||
}
|
||||
};
|
||||
win.on("touchmove", tick);
|
||||
win.on("scroll", tick);
|
||||
win.on("resize", recalc_and_tick);
|
||||
$(document.body).on("sticky_kit:recalc", recalc_and_tick);
|
||||
elm.on("sticky_kit:detach", detach);
|
||||
return setTimeout(tick, 0);
|
||||
};
|
||||
for (i = 0, len = this.length; i < len; i++) {
|
||||
elm = this[i];
|
||||
fn($(elm));
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
}).call(this);
|
16
wp-content/plugins/easy-table-of-contents/vendor/sticky-kit/jquery.sticky-kit.min.js
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
(function(){var a,b;a=this.jQuery||window.jQuery;b=a(window);a.fn.stick_in_parent=function(d){var p,m,o,n,j,h,k,f,l,e,c,g;if(d==null){d={};}g=d.sticky_class,h=d.inner_scrolling,c=d.recalc_every,e=d.parent,l=d.offset_top,f=d.spacer,o=d.bottoming;
|
||||
if(l==null){l=0;}if(e==null){e=void 0;}if(h==null){h=true;}if(g==null){g="is_stuck";}p=a(document);if(o==null){o=true;}n=function(t,G,q,i,B,C,y,z){var D,H,r,F,I,s,w,u,x,A,v,E;
|
||||
if(t.data("sticky_kit")){return;}t.data("sticky_kit",true);I=p.height();w=t.parent();if(e!=null){w=w.closest(e);}if(!w.length){throw"failed to find stick parent";
|
||||
}r=false;D=false;v=f!=null?f&&t.closest(f):a("<div />");u=function(){var J,L,K;if(z){return;}I=p.height();J=parseInt(w.css("border-top-width"),10);L=parseInt(w.css("padding-top"),10);
|
||||
G=parseInt(w.css("padding-bottom"),10);q=w.offset().top+J+L;i=w.height();if(r){r=false;D=false;if(f==null){t.insertAfter(v);v.detach();}t.css({position:"",top:"",width:"",bottom:""}).removeClass(g);
|
||||
K=true;}B=t.offset().top-(parseInt(t.css("margin-top"),10)||0)-l;C=t.outerHeight(true);y=t.css("float");if(v){v.css({width:t.outerWidth(true),height:C,display:t.css("display"),"vertical-align":t.css("vertical-align"),"float":y});
|
||||
}if(K){return E();}};u();if(C===i){return;}F=void 0;s=l;A=c;E=function(){var L,O,M,K,J,N;if(z){return;}M=false;if(A!=null){A-=1;if(A<=0){A=c;u();M=true;
|
||||
}}if(!M&&p.height()!==I){u();M=true;}K=b.scrollTop();if(F!=null){O=K-F;}F=K;if(r){if(o){J=K+C+s>i+q;if(D&&!J){D=false;t.css({position:"fixed",bottom:"",top:s}).trigger("sticky_kit:unbottom");
|
||||
}}if(K<B){r=false;s=l;if(f==null){if(y==="left"||y==="right"){t.insertAfter(v);}v.detach();}L={position:"",width:"",top:""};t.css(L).removeClass(g).trigger("sticky_kit:unstick");
|
||||
}if(h){N=b.height();if(C+l>N){if(!D){s-=O;s=Math.max(N-C,s);s=Math.min(l,s);if(r){t.css({top:s+"px"});}}}}}else{if(K>B){r=true;L={position:"fixed",top:s};
|
||||
L.width=t.css("box-sizing")==="border-box"?t.outerWidth()+"px":t.width()+"px";t.css(L).addClass(g);if(f==null){t.after(v);if(y==="left"||y==="right"){v.append(t);
|
||||
}}t.trigger("sticky_kit:stick");}}if(r&&o){if(J==null){J=K+C+s>i+q;}if(!D&&J){D=true;if(w.css("position")==="static"){w.css({position:"relative"});}return t.css({position:"absolute",bottom:G,top:"auto"}).trigger("sticky_kit:bottom");
|
||||
}}};x=function(){u();return E();};H=function(){z=true;b.off("touchmove",E);b.off("scroll",E);b.off("resize",x);a(document.body).off("sticky_kit:recalc",x);
|
||||
t.off("sticky_kit:detach",H);t.removeData("sticky_kit");t.css({position:"",bottom:"",top:"",width:""});w.position("position","");if(r){if(f==null){if(y==="left"||y==="right"){t.insertAfter(v);
|
||||
}v.remove();}return t.removeClass(g);}};b.on("touchmove",E);b.on("scroll",E);b.on("resize",x);a(document.body).on("sticky_kit:recalc",x);t.on("sticky_kit:detach",H);
|
||||
return setTimeout(E,0);};for(j=0,k=this.length;j<k;j++){m=this[j];n(a(m));}return this;};}).call(this);
|
@ -0,0 +1,7 @@
|
||||
<wpml-config>
|
||||
<admin-texts>
|
||||
<key name="ez-toc-settings">
|
||||
<key name="heading_text"/>
|
||||
</key>
|
||||
</admin-texts>
|
||||
</wpml-config>
|