This commit is contained in:
2024-05-20 15:37:46 +03:00
commit 00b7dbd0b7
10404 changed files with 3285853 additions and 0 deletions

View File

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@ -0,0 +1,20 @@
# Table of Contents Plus
A powerful yet user friendly WordPress plugin that automatically creates a context specific index or table of contents (TOC) for long pages (and custom post types). More than just a table of contents plugin, this plugin can also output a sitemap listing pages and/or categories across your entire site.
Built from the ground up and with Wikipedia in mind, the table of contents by default appears before the first heading on a page. This allows the author to insert lead-in content that may summarise or introduce the rest of the page. It also uses a unique numbering scheme that doesn't get lost through CSS differences across themes.
This plugin is a great companion for content rich sites such as content management system oriented configurations. That said, bloggers also have the same benefits when writing long structured articles. [Discover how Google](http://dublue.com/2012/05/12/another-benefit-to-structure-your-web-pages/) uses this index to provide 'Jump To' links to your content.
Includes an administration options panel where you can customise settings like display position, define the minimum number of headings before an index is displayed, other appearance, and more. For power users, expand the advanced options to further tweak its behaviour - eg: exclude undesired heading levels like h5 and h6 from being included; disable the output of the included CSS file; adjust the top offset and more. Using shortcodes, you can override default behaviour such as special exclusions on a specific page or even to hide the table of contents altogether.
Prefer to include the index in the sidebar? Go to Appearance > Widgets and drag the TOC+ to your desired sidebar and position.
Custom post types are supported, however, auto insertion works only when the_content() has been used by the custom post type. Each post type will appear in the options panel, so enable the ones you want.
Collaborate, participate, fork this plugin on [Github](https://github.com/zedzedzed/table-of-contents-plus/).
## Links
* [WordPress plugin page](https://wordpress.org/plugins/table-of-contents-plus/)
* [Plugin homepage](http://dublue.com/plugins/toc/)

View File

@ -0,0 +1,130 @@
div.tab_content table {
margin-bottom: 1em;
}
table.more_toc_options_table th, table.more_toc_options_table td {
padding: 0;
margin: 0;
}
table.more_toc_options_table th {
width: auto;
padding-right: 4px;
padding-top: 2px;
}
div.tab_content ul li {
margin-left: 2em;
list-style-type: disc;
}
div.tab_content ol li {
list-style: inherit;
}
div.tab_content pre {
margin-left: 2em;
}
ul#tabbed-nav {
margin-top: 1em;
}
#tabbed-nav {
margin: 0;
padding: 0;
float: left;
list-style: none;
height: 32px;
border-bottom: 1px solid #DFDFDF;
border-left: 1px solid #DFDFDF;
width: 100%;
}
#tabbed-nav li {
float: left;
margin: 0;
padding: 0;
height: 31px;
line-height: 31px;
border: 1px solid #DFDFDF;
border-left: none;
margin-bottom: -1px;
overflow: hidden;
position: relative;
background: #F5F5F5;
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#F5F5F5));
background-image: -webkit-linear-gradient(center top, #fff, #F5F5F5);
background-image: -moz-linear-gradient(center top, #fff, #F5F5F5);
background-image: -ms-linear-gradient(center top, #fff, #F5F5F5);
background-image: -o-linear-gradient(center top, #fff, #F5F5F5);
background-image: linear-gradient(center top, #fff, #F5F5F5);
}
#tabbed-nav li a {
text-decoration: none;
color: #000;
display: block;
font-size: 1.2em;
padding: 0 20px;
border: 1px solid #fff;
outline: none;
}
#tabbed-nav li a:hover {
background: #ECECEC;
}
html #tabbed-nav li.active, html #tabbed-nav li.active a:hover {
background: #fff;
border-bottom: 1px solid #fff;
}
div.tab_container {
border: 1px solid #DFDFDF;
border-top: none;
overflow: hidden;
clear: both;
float: left; width: 100%;
background: #fff;
margin-bottom: 2em;
padding-bottom: 2em;
}
div.tab_content {
padding: 10px;
padding-bottom: 0;
font-size: 1em;
}
h3 span.show_hide {
font-size: 0.85em;
font-weight: normal;
}
div.more_toc_options {
margin-top: 4px;
margin-left: 2em;
}
div.toc_theme_option {
width: 200px;
float: left;
margin-right: 5px;
}
#wpcontent select optgroup option {
padding-left: 15px;
}
input#width_custom,
input#font_size,
input#smooth_scroll_offset {
width: 50px;
text-align: center;
}
input.custom_colour_option {
width: 75px;
}
table#theme_custom, div#farbtastic_colour_wheel {
float: left;
}
table#theme_custom {
margin-top: 30px;
}
table#theme_custom img {
vertical-align: middle;
opacity: 0.4;
}
table#theme_custom img:hover {
cursor: pointer;
opacity: 1;
}
div#farbtastic_colour_wheel {
margin-left: 20px;
}
#tab3 h3:not(:first-child) {
margin-top: 2em;
}

View File

@ -0,0 +1,88 @@
jQuery(document).ready(function($) {
$('.tab_content, #toc_advanced_usage, #sitemap_advanced_usage, #toc_for_developers, div.more_toc_options.disabled, tr.disabled').hide();
$('ul#tabbed-nav li:first').addClass('active').show(); // show first tab
$('.tab_content:first').show(); // show first tab content
$('ul#tabbed-nav li').click(function(event) {
if ( !$(this).hasClass('url') ) {
event.preventDefault();
$('ul#tabbed-nav li').removeClass('active');
$(this).addClass('active');
$('.tab_content').hide();
var activeTab = $(this).find('a').attr('href');
$(activeTab).fadeIn();
}
});
$('h3 span.show_hide a').click(function(event) {
event.preventDefault();
$( $(this).attr('href') ).toggle('fast');
if ( $(this).text() == 'show' )
$(this).text('hide');
else
$(this).text('show');
});
$('input#show_heading_text, input#visibility').click(function() {
$(this).siblings('div.more_toc_options').toggle('fast');
});
$('input#smooth_scroll').click(function() {
$('#smooth_scroll_offset_tr').toggle('fast');
});
$('input[name="theme"]').click(function() {
// check custom theme selection
if ( $(this).val() == 100 ) {
$(this).parent().siblings('div.more_toc_options').show('fast');
}
else
$(this).parent().siblings('div.more_toc_options').hide('fast');
});
/* width drop down */
$('select#width').change(function() {
if ( $(this).find('option:selected').val() == 'User defined' ) {
$(this).siblings('div.more_toc_options').show('fast');
$('input#width_custom').focus();
}
else
$(this).siblings('div.more_toc_options').hide('fast');
});
$('input#width_custom, input#font_size, input#smooth_scroll_offset').keyup(function() {
var value = $(this).val();
$(this).val( value.replace(/[^0-9\.]/, '') );
});
$('input#fragment_prefix').keyup(function() {
var fragment = $(this).val();
$(this).val( fragment.replace(/[^a-zA-Z0-9_\-]/g, '') );
});
if ( $.farbtastic ) {
var f = $.farbtastic('#farbtastic_colour_wheel');
var selected;
$('#farbtastic_colour_wheel').css('opacity', 0.5).hide();
$('input.custom_colour_option')
.each(function() { f.linkTo(this); $(this).css('opacity', 0.5); })
.keyup(function() {
var hex = $(this).val();
hex = hex.replace(/[^a-fA-F0-9]/g, '');
if ( hex.length > 6 ) hex = hex.substr(0, 6);
$(this).val( '#' + hex );
})
.focus(function() {
if (selected) {
$(selected).css('opacity', 0.5);
$(selected).siblings('img').css('opacity', 0.4);
}
f.linkTo(this);
$('#farbtastic_colour_wheel').css('opacity', 1).show('fast');
$(this).siblings('img').css('opacity', 1);
$(selected = this).css('opacity', 1);
});
$('table#theme_custom img').click(function() {
$(this).siblings('input.custom_colour_option').focus();
});
}
});

View File

@ -0,0 +1,16 @@
{
"name": "dublue/table-of-contents-plus",
"authors": [
{
"name": "Michael Tran"
}
],
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"require-dev": {
"wp-coding-standards/wpcs": "^3.0"
}
}

View File

@ -0,0 +1,356 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "e82dabce6d4b401e7ad041d0de6e1dc6",
"packages": [],
"packages-dev": [
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
"version": "v1.0.0",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/composer-installer.git",
"reference": "4be43904336affa5c2f70744a348312336afd0da"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da",
"reference": "4be43904336affa5c2f70744a348312336afd0da",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0 || ^2.0",
"php": ">=5.4",
"squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0"
},
"require-dev": {
"composer/composer": "*",
"ext-json": "*",
"ext-zip": "*",
"php-parallel-lint/php-parallel-lint": "^1.3.1",
"phpcompatibility/php-compatibility": "^9.0",
"yoast/phpunit-polyfills": "^1.0"
},
"type": "composer-plugin",
"extra": {
"class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
},
"autoload": {
"psr-4": {
"PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Franck Nijhof",
"email": "franck.nijhof@dealerdirect.com",
"homepage": "http://www.frenck.nl",
"role": "Developer / IT Manager"
},
{
"name": "Contributors",
"homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors"
}
],
"description": "PHP_CodeSniffer Standards Composer Installer Plugin",
"homepage": "http://www.dealerdirect.com",
"keywords": [
"PHPCodeSniffer",
"PHP_CodeSniffer",
"code quality",
"codesniffer",
"composer",
"installer",
"phpcbf",
"phpcs",
"plugin",
"qa",
"quality",
"standard",
"standards",
"style guide",
"stylecheck",
"tests"
],
"support": {
"issues": "https://github.com/PHPCSStandards/composer-installer/issues",
"source": "https://github.com/PHPCSStandards/composer-installer"
},
"time": "2023-01-05T11:28:13+00:00"
},
{
"name": "phpcsstandards/phpcsextra",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHPCSExtra.git",
"reference": "98bcdbacbda14b1db85f710b1853125726795bbc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/98bcdbacbda14b1db85f710b1853125726795bbc",
"reference": "98bcdbacbda14b1db85f710b1853125726795bbc",
"shasum": ""
},
"require": {
"php": ">=5.4",
"phpcsstandards/phpcsutils": "^1.0.8",
"squizlabs/php_codesniffer": "^3.7.1"
},
"require-dev": {
"php-parallel-lint/php-console-highlighter": "^1.0",
"php-parallel-lint/php-parallel-lint": "^1.3.2",
"phpcsstandards/phpcsdevcs": "^1.1.6",
"phpcsstandards/phpcsdevtools": "^1.2.1",
"phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0"
},
"type": "phpcodesniffer-standard",
"extra": {
"branch-alias": {
"dev-stable": "1.x-dev",
"dev-develop": "1.x-dev"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "Juliette Reinders Folmer",
"homepage": "https://github.com/jrfnl",
"role": "lead"
},
{
"name": "Contributors",
"homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors"
}
],
"description": "A collection of sniffs and standards for use with PHP_CodeSniffer.",
"keywords": [
"PHP_CodeSniffer",
"phpcbf",
"phpcodesniffer-standard",
"phpcs",
"standards",
"static analysis"
],
"support": {
"issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues",
"source": "https://github.com/PHPCSStandards/PHPCSExtra"
},
"time": "2023-08-26T04:46:45+00:00"
},
{
"name": "phpcsstandards/phpcsutils",
"version": "1.0.8",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHPCSUtils.git",
"reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/69465cab9d12454e5e7767b9041af0cd8cd13be7",
"reference": "69465cab9d12454e5e7767b9041af0cd8cd13be7",
"shasum": ""
},
"require": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0",
"php": ">=5.4",
"squizlabs/php_codesniffer": "^3.7.1 || 4.0.x-dev@dev"
},
"require-dev": {
"ext-filter": "*",
"php-parallel-lint/php-console-highlighter": "^1.0",
"php-parallel-lint/php-parallel-lint": "^1.3.2",
"phpcsstandards/phpcsdevcs": "^1.1.6",
"yoast/phpunit-polyfills": "^1.0.5 || ^2.0.0"
},
"type": "phpcodesniffer-standard",
"extra": {
"branch-alias": {
"dev-stable": "1.x-dev",
"dev-develop": "1.x-dev"
}
},
"autoload": {
"classmap": [
"PHPCSUtils/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-3.0-or-later"
],
"authors": [
{
"name": "Juliette Reinders Folmer",
"homepage": "https://github.com/jrfnl",
"role": "lead"
},
{
"name": "Contributors",
"homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors"
}
],
"description": "A suite of utility functions for use with PHP_CodeSniffer",
"homepage": "https://phpcsutils.com/",
"keywords": [
"PHP_CodeSniffer",
"phpcbf",
"phpcodesniffer-standard",
"phpcs",
"phpcs3",
"standards",
"static analysis",
"tokens",
"utility"
],
"support": {
"docs": "https://phpcsutils.com/",
"issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues",
"source": "https://github.com/PHPCSStandards/PHPCSUtils"
},
"time": "2023-07-16T21:39:41+00:00"
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.7.2",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879",
"reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879",
"shasum": ""
},
"require": {
"ext-simplexml": "*",
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"bin": [
"bin/phpcs",
"bin/phpcbf"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.x-dev"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Greg Sherwood",
"role": "lead"
}
],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
"homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
"keywords": [
"phpcs",
"standards",
"static analysis"
],
"support": {
"issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
},
"time": "2023-02-22T23:07:41+00:00"
},
{
"name": "wp-coding-standards/wpcs",
"version": "3.0.1",
"source": {
"type": "git",
"url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
"reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b4caf9689f1a0e4a4c632679a44e638c1c67aff1",
"reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1",
"shasum": ""
},
"require": {
"ext-filter": "*",
"ext-libxml": "*",
"ext-tokenizer": "*",
"ext-xmlreader": "*",
"php": ">=5.4",
"phpcsstandards/phpcsextra": "^1.1.0",
"phpcsstandards/phpcsutils": "^1.0.8",
"squizlabs/php_codesniffer": "^3.7.2"
},
"require-dev": {
"php-parallel-lint/php-console-highlighter": "^1.0.0",
"php-parallel-lint/php-parallel-lint": "^1.3.2",
"phpcompatibility/php-compatibility": "^9.0",
"phpcsstandards/phpcsdevtools": "^1.2.0",
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
},
"suggest": {
"ext-iconv": "For improved results",
"ext-mbstring": "For improved results"
},
"type": "phpcodesniffer-standard",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Contributors",
"homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors"
}
],
"description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
"keywords": [
"phpcs",
"standards",
"static analysis",
"wordpress"
],
"support": {
"issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues",
"source": "https://github.com/WordPress/WordPress-Coding-Standards",
"wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki"
},
"funding": [
{
"url": "https://opencollective.com/thewpcc/contribute/wp-php-63406",
"type": "custom"
}
],
"time": "2023-09-14T07:06:09+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.6.0"
}

View File

@ -0,0 +1,169 @@
/*!
* jQuery Smooth Scroll - v1.6.0 - 2015-12-26
* https://github.com/kswedberg/jquery-smooth-scroll
* Copyright (c) 2015 Karl Swedberg
* Licensed MIT
*/
!function(a){"function"==typeof define&&define.amd?
// AMD. Register as an anonymous module.
define(["jquery"],a):a("object"==typeof module&&module.exports?require("jquery"):jQuery)}(function(a){function b(a){return a.replace(/(:|\.|\/)/g,"\\$1")}var c="1.6.0",d={},e={exclude:[],excludeWithin:[],offset:0,
// one of 'top' or 'left'
direction:"top",
// if set, bind click events through delegation
// supported since jQuery 1.4.2
delegateSelector:null,
// jQuery set of elements you wish to scroll (for $.smoothScroll).
// if null (default), $('html, body').firstScrollable() is used.
scrollElement:null,
// only use if you want to override default behavior
scrollTarget:null,
// fn(opts) function to be called before scrolling occurs.
// `this` is the element(s) being scrolled
beforeScroll:function(){},
// fn(opts) function to be called after scrolling occurs.
// `this` is the triggering element
afterScroll:function(){},easing:"swing",speed:400,
// coefficient for "auto" speed
autoCoefficient:2,
// $.fn.smoothScroll only: whether to prevent the default click action
preventDefault:!0},f=function(b){var c=[],d=!1,e=b.dir&&"left"===b.dir?"scrollLeft":"scrollTop";
// If no scrollable elements, fall back to <body>,
// if it's in the jQuery collection
// (doing this because Safari sets scrollTop async,
// so can't set it to 1 and immediately get the value.)
// Use the first scrollable element if we're calling firstScrollable()
return this.each(function(){var b=a(this);if(this!==document&&this!==window)
// if scroll(Top|Left) === 0, nudge the element 1px and see if it moves
// then put it back, of course
return!document.scrollingElement||this!==document.documentElement&&this!==document.body?void(b[e]()>0?c.push(this):(b[e](1),d=b[e]()>0,d&&c.push(this),b[e](0))):(c.push(document.scrollingElement),!1)}),c.length||this.each(function(){"BODY"===this.nodeName&&(c=[this])}),"first"===b.el&&c.length>1&&(c=[c[0]]),c};a.fn.extend({scrollable:function(a){var b=f.call(this,{dir:a});return this.pushStack(b)},firstScrollable:function(a){var b=f.call(this,{el:"first",dir:a});return this.pushStack(b)},smoothScroll:function(c,d){if(c=c||{},"options"===c)return d?this.each(function(){var b=a(this),c=a.extend(b.data("ssOpts")||{},d);a(this).data("ssOpts",c)}):this.first().data("ssOpts");var e=a.extend({},a.fn.smoothScroll.defaults,c),f=function(c){var d=this,f=a(this),g=a.extend({},e,f.data("ssOpts")||{}),h=e.exclude,i=g.excludeWithin,j=0,k=0,l=!0,m={},n=a.smoothScroll.filterPath(location.pathname),o=a.smoothScroll.filterPath(d.pathname),p=location.hostname===d.hostname||!d.hostname,q=g.scrollTarget||o===n,r=b(d.hash);if(g.scrollTarget||p&&q&&r){for(;l&&j<h.length;)f.is(b(h[j++]))&&(l=!1);for(;l&&k<i.length;)f.closest(i[k++]).length&&(l=!1)}else l=!1;l&&(g.preventDefault&&c.preventDefault(),a.extend(m,g,{scrollTarget:g.scrollTarget||r,link:d}),a.smoothScroll(m))};return null!==c.delegateSelector?this.undelegate(c.delegateSelector,"click.smoothscroll").delegate(c.delegateSelector,"click.smoothscroll",f):this.unbind("click.smoothscroll").bind("click.smoothscroll",f),this}}),a.smoothScroll=function(b,c){if("options"===b&&"object"==typeof c)return a.extend(d,c);var e,f,g,h,i,j=0,k="offset",l="scrollTop",m={},n={};"number"==typeof b?(e=a.extend({link:null},a.fn.smoothScroll.defaults,d),g=b):(e=a.extend({link:null},a.fn.smoothScroll.defaults,b||{},d),e.scrollElement&&(k="position","static"===e.scrollElement.css("position")&&e.scrollElement.css("position","relative"))),l="left"===e.direction?"scrollLeft":l,e.scrollElement?(f=e.scrollElement,/^(?:HTML|BODY)$/.test(f[0].nodeName)||(j=f[l]())):f=a("html, body").firstScrollable(e.direction),e.beforeScroll.call(f,e),g="number"==typeof b?b:c||a(e.scrollTarget)[k]()&&a(e.scrollTarget)[k]()[e.direction]||0,m[l]=g+j+e.offset,h=e.speed,"auto"===h&&(i=Math.abs(m[l]-f[l]()),h=i/e.autoCoefficient),n={duration:h,easing:e.easing,complete:function(){e.afterScroll.call(e.link,e)}},e.step&&(n.step=e.step),f.length?f.stop().animate(m,n):e.afterScroll.call(e.link,e)},a.smoothScroll.version=c,a.smoothScroll.filterPath=function(a){return a=a||"",a.replace(/^\//,"").replace(/(?:index|default).[a-zA-Z]{3,4}$/,"").replace(/\/$/,"")},
// default options
a.fn.smoothScroll.defaults=e});
/**
* jQuery Cookie plugin
*
* Copyright (c) 2010 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
jQuery.cookie=function(a,b,c){if(arguments.length>1&&String(b)!=="[object Object]"){c=jQuery.extend({},c);if(b===null||b===undefined){c.expires=-1}if(typeof c.expires==="number"){var d=c.expires,e=c.expires=new Date;e.setDate(e.getDate()+d)}b=String(b);return document.cookie=[encodeURIComponent(a),"=",c.raw?b:encodeURIComponent(b),c.expires?"; expires="+c.expires.toUTCString():"",c.path?"; path="+c.path:"",c.domain?"; domain="+c.domain:"",c.secure?"; secure":""].join("")}c=b||{};var f,g=c.raw?function(a){return a}:decodeURIComponent;return(f=(new RegExp("(?:^|; )"+encodeURIComponent(a)+"=([^;]*)")).exec(document.cookie))?g(f[1]):null}
jQuery(document).ready(function($) {
if ( typeof tocplus != 'undefined' ) {
$.fn.shrinkTOCWidth = function() {
$(this).css({
width: 'auto',
display: 'table'
});
if ( /MSIE 7\./.test(navigator.userAgent) )
$(this).css('width', '');
}
if ( tocplus.smooth_scroll == 1 ) {
var target = hostname = pathname = qs = hash = null;
$('body a').click(function(event) {
hostname = $(this).prop('hostname');
pathname = $(this).prop('pathname');
qs = $(this).prop('search');
hash = $(this).prop('hash');
// ie strips out the preceeding / from pathname
if ( pathname.length > 0 ) {
if ( pathname.charAt(0) != '/' ) {
pathname = '/' + pathname;
}
}
if ( (window.location.hostname == hostname) && (window.location.pathname == pathname) && (window.location.search == qs) && (hash !== '') ) {
// escape jquery selector chars, but keep the #
var hash_selector = hash.replace(/([ !"$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g, '\\$1');
// check if element exists with id=__
if ( $( hash_selector ).length > 0 )
target = hash;
else {
// must be an anchor (a name=__)
anchor = hash;
anchor = anchor.replace('#', '');
target = 'a[name="' + anchor + '"]';
// verify it exists
if ( $(target).length == 0 )
target = '';
}
// check offset setting
if (typeof tocplus.smooth_scroll_offset != 'undefined') {
offset = -1 * tocplus.smooth_scroll_offset;
}
else {
if ($('#wpadminbar').length > 0) {
if ($('#wpadminbar').is(':visible'))
offset = -30; // admin bar exists, give it the default
else
offset = 0; // there is an admin bar but it's hidden, so no offset!
}
else
offset = 0; // no admin bar, so no offset!
}
if ( target ) {
$.smoothScroll({
scrollTarget: target,
offset: offset
});
}
}
});
}
if ( typeof tocplus.visibility_show != 'undefined' ) {
var invert = ( typeof tocplus.visibility_hide_by_default != 'undefined' ) ? true : false ;
if ( $.cookie )
var visibility_text = ($.cookie('tocplus_hidetoc')) ? tocplus.visibility_show : tocplus.visibility_hide ;
else
var visibility_text = tocplus.visibility_hide;
if ( invert )
visibility_text = (visibility_text == tocplus.visibility_hide) ? tocplus.visibility_show : tocplus.visibility_hide;
$('#toc_container p.toc_title').append(' <span class="toc_toggle"><span class="toc_brackets">[</span><a href="#">' + visibility_text + '</a><span class="toc_brackets">]</span></span>');
if ( visibility_text == tocplus.visibility_show ) {
$('ul.toc_list').hide();
$('#toc_container').addClass('contracted').shrinkTOCWidth();
}
$('span.toc_toggle a').click(function(event) {
event.preventDefault();
switch( $(this).html() ) {
case $('<div/>').html(tocplus.visibility_hide).text():
$(this).html(tocplus.visibility_show);
if ( $.cookie ) {
if ( invert )
$.cookie('tocplus_hidetoc', null, { path: '/' });
else
$.cookie('tocplus_hidetoc', '1', { expires: 30, path: '/' });
}
$('ul.toc_list').hide('fast');
$('#toc_container').addClass('contracted').shrinkTOCWidth();
break;
case $('<div/>').html(tocplus.visibility_show).text(): // do next
default:
$(this).html(tocplus.visibility_hide);
if ( $.cookie ) {
if ( invert )
$.cookie('tocplus_hidetoc', '1', { expires: 30, path: '/' });
else
$.cookie('tocplus_hidetoc', null, { path: '/' });
}
$('#toc_container').css('width', tocplus.width).removeClass('contracted');
$('ul.toc_list').show('fast');
}
});
}
}
});

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,149 @@
<?php
if ( ! class_exists( 'TOC_Widget' ) ) :
class TOC_Widget extends WP_Widget {
public function __construct() {
$widget_options = [
'classname' => 'toc_widget',
'description' => __( 'Display the table of contents in the sidebar with this widget', 'table-of-contents-plus' ),
];
$control_options = [
'width' => 250,
'height' => 350,
'id_base' => 'toc-widget',
];
parent::__construct( 'toc-widget', 'TOC+', $widget_options, $control_options );
}
/**
* Widget output to the public
*/
public function widget( $args, $instance ) {
global $toc_plus, $wp_query;
if ( is_null( $wp_query->post ) ) {
return;
}
$html = '';
$items = '';
$custom_toc_position = '';
$find = [];
$replace = [];
$toc_options = $toc_plus->get_options();
$post = get_post( $wp_query->post->ID );
$custom_toc_position = strpos( $post->post_content, '[toc]' ); // at this point, shortcodes haven't run yet so we can't search for <!--TOC-->
if ( $toc_plus->is_eligible( $custom_toc_position ) ) {
$items = $toc_plus->extract_headings( $find, $replace, wptexturize( do_shortcode( $post->post_content ) ) );
$title = ( array_key_exists( 'title', $instance ) ) ? apply_filters( 'widget_title', $instance['title'] ) : '';
if ( false !== strpos( $title, '%PAGE_TITLE%' ) ) {
$title = str_replace( '%PAGE_TITLE%', get_the_title(), $title );
}
if ( false !== strpos( $title, '%PAGE_NAME%' ) ) {
$title = str_replace( '%PAGE_NAME%', get_the_title(), $title );
}
$hide_inline = $toc_options['show_toc_in_widget_only'];
$css_classes = '';
// bullets?
if ( $toc_options['bullet_spacing'] ) {
$css_classes .= ' have_bullets';
} else {
$css_classes .= ' no_bullets';
}
if ( $items ) {
// before widget (defined by themes)
$html .= $args['before_widget'];
// display the widget title if one was input (before and after titles defined by themes)
if ( $title ) {
$html .= $args['before_title'] . $title . $args['after_title'];
}
// display the list
$html .= '<ul class="toc_widget_list' . $css_classes . '">' . $items . '</ul>';
// after widget (defined by themes)
$html .= $args['after_widget'];
echo wp_kses_post( $html );
}
}
}
/**
* Update the widget settings
*/
public function update( $new_instance, $old_instance ) {
global $toc_plus;
$instance = $old_instance;
// strip tags for title to remove HTML (important for text inputs)
$instance['title'] = wp_strip_all_tags( trim( $new_instance['title'] ) );
// no need to strip tags for the following
//$instance['hide_inline'] = $new_instance['hide_inline'];
$toc_plus->set_show_toc_in_widget_only( $new_instance['hide_inline'] );
$toc_plus->set_show_toc_in_widget_only_post_types( (array) $new_instance['show_toc_in_widget_only_post_types'] );
return $instance;
}
/**
* Displays the widget settings on the widget panel.
*/
public function form( $instance ) {
global $toc_plus;
$toc_options = $toc_plus->get_options();
$defaults = [ 'title' => $toc_options['heading_text'] ];
$instance = wp_parse_args( (array) $instance, $defaults );
?>
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'table-of-contents-plus' ); ?>:</label>
<input type="text" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" style="width: 100%;">
</p>
<p>
<input class="checkbox" type="checkbox" <?php checked( $toc_options['show_toc_in_widget_only'], 1 ); ?> id="<?php echo esc_attr( $this->get_field_id( 'hide_inline' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'hide_inline' ) ); ?>" value="1">
<label for="<?php echo esc_attr( $this->get_field_id( 'hide_inline' ) ); ?>"> <?php esc_html_e( 'Show the table of contents only in the sidebar', 'table-of-contents-plus' ); ?></label>
</p>
<div class="show_toc_in_widget_only_post_types" style="margin: 0 0 25px 25px; display: <?php echo ( 1 === $toc_options['show_toc_in_widget_only'] ) ? 'block' : 'none'; ?>;">
<p><?php esc_html_e( 'For the following content types:', 'table-of-contents-plus' ); ?></p>
<?php
foreach ( get_post_types() as $post_type ) {
// make sure the post type isn't on the exclusion list
if ( ! in_array( $post_type, $toc_plus->get_exclude_post_types(), true ) ) {
echo '<input type="checkbox" value="' . esc_attr( $post_type ) . '" id="' . esc_attr( $this->get_field_id( 'show_toc_in_widget_only_post_types_' . $post_type ) ) . '" name="' . esc_attr( $this->get_field_name( 'show_toc_in_widget_only_post_types' ) ) . '[]"';
if ( in_array( $post_type, $toc_options['show_toc_in_widget_only_post_types'], true ) ) {
echo ' checked="checked"';
}
echo ' /><label for="' . esc_attr( $this->get_field_id( 'show_toc_in_widget_only_post_types_' . $post_type ) ) . '"> ' . esc_html( $post_type ) . '</label><br />';
}
}
?>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#<?php echo esc_js( $this->get_field_id( 'hide_inline' ) ); ?>').click(function() {
$(this).parent().siblings('div.show_toc_in_widget_only_post_types').toggle('fast');
});
});
</script>
<?php
}
} // end class
endif;

View File

@ -0,0 +1,47 @@
<?php
/**
* Returns a HTML formatted string of the table of contents without the surrounding UL or OL
* tags to enable the theme editor to supply their own ID and/or classes to the outer list.
*
* There are three optional parameters you can feed this function with:
*
* - $content is the entire content with headings. If blank, will default to the current $post
*
* - $link is the URL to prefix the anchor with. If provided a string, will use it as the prefix.
* If set to true then will try to obtain the permalink from the $post object.
*
* - $apply_eligibility bool, defaults to false. When set to true, will apply the check to
* see if bit of content has the prerequisites needed for a TOC, eg minimum number of headings
* enabled post type, etc.
*/
function toc_get_index( $content = '', $prefix_url = '', $apply_eligibility = false ) {
global $wp_query, $toc_plus;
$return = '';
$find = [];
$replace = [];
$proceed = true;
if ( ! $content ) {
$post = get_post( $wp_query->post->ID );
$content = wptexturize( $post->post_content );
}
if ( $apply_eligibility ) {
if ( ! $toc_plus->is_eligible() ) {
$proceed = false;
}
} else {
$toc_plus->set_option( [ 'start' => 0 ] );
}
if ( $proceed ) {
$return = $toc_plus->extract_headings( $find, $replace, $content );
if ( $prefix_url ) {
$return = str_replace( 'href="#', 'href="' . $prefix_url . '#', $return );
}
}
return $return;
}

View File

@ -0,0 +1,26 @@
<?php
define( 'TOC_VERSION', '2309' );
define( 'TOC_POSITION_BEFORE_FIRST_HEADING', 1 );
define( 'TOC_POSITION_TOP', 2 );
define( 'TOC_POSITION_BOTTOM', 3 );
define( 'TOC_POSITION_AFTER_FIRST_HEADING', 4 );
define( 'TOC_MIN_START', 2 );
define( 'TOC_MAX_START', 10 );
define( 'TOC_SMOOTH_SCROLL_OFFSET', 30 );
define( 'TOC_WRAPPING_NONE', 0 );
define( 'TOC_WRAPPING_LEFT', 1 );
define( 'TOC_WRAPPING_RIGHT', 2 );
define( 'TOC_THEME_GREY', 1 );
define( 'TOC_THEME_LIGHT_BLUE', 2 );
define( 'TOC_THEME_WHITE', 3 );
define( 'TOC_THEME_BLACK', 4 );
define( 'TOC_THEME_TRANSPARENT', 99 );
define( 'TOC_THEME_CUSTOM', 100 );
define( 'TOC_DEFAULT_BACKGROUND_COLOUR', '#f9f9f9' );
define( 'TOC_DEFAULT_BORDER_COLOUR', '#aaaaaa' );
define( 'TOC_DEFAULT_TITLE_COLOUR', '#' );
define( 'TOC_DEFAULT_LINKS_COLOUR', '#' );
define( 'TOC_DEFAULT_LINKS_HOVER_COLOUR', '#' );
define( 'TOC_DEFAULT_LINKS_VISITED_COLOUR', '#' );
define( 'TOC_PLUGIN_PATH', plugins_url( '', __DIR__ ) );

View File

@ -0,0 +1,9 @@
<?php
require_once __DIR__ . '/globals.php';
require_once __DIR__ . '/class-toc-plus.php';
require_once __DIR__ . '/class-toc-widget.php';
require_once __DIR__ . '/functions.php';
// do the magic
$toc_plus = new TOC_Plus();

View File

@ -0,0 +1,513 @@
# Copyright (C) 2015 Table of Contents Plus
# This file is distributed under the same license as the Table of Contents Plus package.
msgid ""
msgstr ""
"Project-Id-Version: Table of Contents Plus 1505\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/table-of-contents-"
"plus\n"
"POT-Creation-Date: 2015-06-26 12:23:49+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
#: toc.php:201
msgid "Settings"
msgstr ""
#: toc.php:482 toc.php:483
msgid "TOC"
msgstr ""
#: toc.php:653
msgid "Options saved."
msgstr ""
#: toc.php:655
msgid "Save failed."
msgstr ""
#: toc.php:667
msgid "Main Options"
msgstr ""
#: toc.php:668
msgid "Sitemap"
msgstr ""
#: toc.php:669
msgid "Help"
msgstr ""
#: toc.php:677
msgid "Position"
msgstr ""
#: toc.php:680
msgid "Before first heading (default)"
msgstr ""
#: toc.php:681
msgid "After first heading"
msgstr ""
#: toc.php:682
msgid "Top"
msgstr ""
#: toc.php:683
msgid "Bottom"
msgstr ""
#: toc.php:688
msgid "Show when"
msgstr ""
#. translators: text follows drop down list of numbers
#: toc.php:700
msgid "or more headings are present"
msgstr ""
#: toc.php:704
msgid "Auto insert for the following content types"
msgstr ""
#. translators: this is the title of the table of contents
#: toc.php:719
msgid "Heading text"
msgstr ""
#: toc.php:721
msgid "Show title on top of the table of contents"
msgstr ""
#: toc.php:724
msgid "Eg: Contents, Table of Contents, Page Contents"
msgstr ""
#: toc.php:726
msgid "Allow the user to toggle the visibility of the table of contents"
msgstr ""
#: toc.php:731
msgid "Show text"
msgstr ""
#. translators: example text to display when you want to expand the table of
#. contents
#: toc.php:735
msgid "Eg: show"
msgstr ""
#: toc.php:738
msgid "Hide text"
msgstr ""
#. translators: example text to display when you want to collapse the table of
#. contents
#: toc.php:742
msgid "Eg: hide"
msgstr ""
#: toc.php:746
msgid "Hide the table of contents initially"
msgstr ""
#: toc.php:752
msgid "Show hierarchy"
msgstr ""
#: toc.php:756
msgid "Number list items"
msgstr ""
#: toc.php:760
msgid "Enable smooth scroll effect"
msgstr ""
#: toc.php:761
msgid "Scroll rather than jump to the anchor link"
msgstr ""
#: toc.php:766
msgid "Appearance"
msgstr ""
#: toc.php:770
msgid "Width"
msgstr ""
#: toc.php:773
msgid "Fixed width"
msgstr ""
#: toc.php:784
msgid "Relative"
msgstr ""
#: toc.php:785
msgid "Auto (default)"
msgstr ""
#. translators: other width
#: toc.php:795
msgid "Other"
msgstr ""
#: toc.php:796
msgid "User defined"
msgstr ""
#. translators: ignore %s as it's some HTML label tags
#: toc.php:802
msgid "Please enter a number and %s select its units, eg: 100px, 10em"
msgstr ""
#: toc.php:813
msgid "Wrapping"
msgstr ""
#: toc.php:816
msgid "None (default)"
msgstr ""
#: toc.php:817
msgid "Left"
msgstr ""
#: toc.php:818
msgid "Right"
msgstr ""
#: toc.php:823
msgid "Font size"
msgstr ""
#. translators: appearance / colour / look and feel options
#: toc.php:836
msgid "Presentation"
msgstr ""
#: toc.php:839
msgid "Grey (default)"
msgstr ""
#: toc.php:844
msgid "Light blue"
msgstr ""
#: toc.php:849
msgid "White"
msgstr ""
#: toc.php:854
msgid "Black"
msgstr ""
#: toc.php:859
msgid "Transparent"
msgstr ""
#: toc.php:864
msgid "Custom"
msgstr ""
#: toc.php:874
msgid "Background"
msgstr ""
#: toc.php:878
msgid "Border"
msgstr ""
#: toc.php:882 toc.php:1658
msgid "Title"
msgstr ""
#: toc.php:886
msgid "Links"
msgstr ""
#: toc.php:890
msgid "Links (hover)"
msgstr ""
#: toc.php:894
msgid "Links (visited)"
msgstr ""
#: toc.php:901
msgid "Leaving the value as %s will inherit your theme's styles"
msgstr ""
#: toc.php:908
msgid "Advanced"
msgstr ""
#: toc.php:908 toc.php:1045
msgid "show"
msgstr ""
#: toc.php:910
msgid "Power options"
msgstr ""
#: toc.php:914
msgid "Lowercase"
msgstr ""
#: toc.php:915
msgid "Ensure anchors are in lowercase"
msgstr ""
#: toc.php:918
msgid "Hyphenate"
msgstr ""
#: toc.php:919
msgid "Use - rather than _ in anchors"
msgstr ""
#: toc.php:922
msgid "Include homepage"
msgstr ""
#: toc.php:923
msgid "Show the table of contents for qualifying items on the homepage"
msgstr ""
#: toc.php:926
msgid "Exclude CSS file"
msgstr ""
#: toc.php:927
msgid ""
"Prevent the loading of this plugin's CSS styles. When selected, the "
"appearance options from above will also be ignored."
msgstr ""
#: toc.php:930
msgid "Preserve theme bullets"
msgstr ""
#: toc.php:931
msgid ""
"If your theme includes background images for unordered list elements, enable "
"this to support them"
msgstr ""
#: toc.php:934
msgid "Heading levels"
msgstr ""
#: toc.php:936
msgid ""
"Include the following heading levels. Deselecting a heading will exclude it."
msgstr ""
#: toc.php:942
msgid "heading "
msgstr ""
#: toc.php:948
msgid "Exclude headings"
msgstr ""
#: toc.php:951
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. Note that this is not "
"case sensitive. Some examples:"
msgstr ""
#: toc.php:953
msgid "<code>Fruit*</code> ignore headings starting with \"Fruit\""
msgstr ""
#: toc.php:954
msgid ""
"<code>*Fruit Diet*</code> ignore headings with \"Fruit Diet\" somewhere in "
"the heading"
msgstr ""
#: toc.php:955
msgid ""
"<code>Apple Tree|Oranges|Yellow Bananas</code> ignore headings that are "
"exactly \"Apple Tree\", \"Oranges\" or \"Yellow Bananas\""
msgstr ""
#: toc.php:960
msgid "Smooth scroll top offset"
msgstr ""
#: toc.php:963
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 appears "
"after you have enabled smooth scrolling from above."
msgstr ""
#: toc.php:967
msgid "Restrict path"
msgstr ""
#: toc.php:970
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 ""
#. translators: example URL path restriction
#: toc.php:973
msgid "Eg: /wiki/, /corporate/annual-reports/"
msgstr ""
#: toc.php:977
msgid "Default anchor prefix"
msgstr ""
#: toc.php:980
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 ""
#: toc.php:981
msgid ""
"This option normally applies to content written in character sets other than "
"ASCII."
msgstr ""
#. translators: example anchor prefixes when no ascii characters match
#: toc.php:984
msgid "Eg: i, toc_index, index, _"
msgstr ""
#. translators: advanced usage
#: toc.php:992
msgid "Usage"
msgstr ""
#: toc.php:993
msgid ""
"If you would like to fully customise the position of the table of contents, "
"you can use the %s shortcode by placing it at the desired position of your "
"post, page or custom post type. This method allows you to generate the table "
"of contents despite having auto insertion disabled for its content type. "
"Please visit the help tab for further information about this shortcode."
msgstr ""
#: toc.php:1001
msgid ""
"At its simplest, placing %s into a page will automatically create a sitemap "
"of all pages and categories. This also works in a text widget."
msgstr ""
#: toc.php:1005
msgid "Show page listing"
msgstr ""
#: toc.php:1009
msgid "Show category listing"
msgstr ""
#: toc.php:1013
msgid "Heading type"
msgstr ""
#. translators: the full line is supposed to read - Use [1-6 drop down list] to
#. print out the titles
#: toc.php:1016
msgid "Use"
msgstr ""
#. translators: the full line is supposed to read - Use [h1-h6 drop down list]
#. to print out the titles
#: toc.php:1027
msgid "to print out the titles"
msgstr ""
#: toc.php:1031
msgid "Pages label"
msgstr ""
#: toc.php:1033
msgid "Eg: Pages, Page List"
msgstr ""
#: toc.php:1037
msgid "Categories label"
msgstr ""
#: toc.php:1039
msgid "Eg: Categories, Category List"
msgstr ""
#: toc.php:1045
msgid "Advanced usage"
msgstr ""
#: toc.php:1047
msgid ""
"lets you print out a listing of only pages. Similarly %s can be used to "
"print out a category listing. They both can accept a number of attributes so "
"visit the help tab for more information."
msgstr ""
#: toc.php:1048
msgid "Examples"
msgstr ""
#: toc.php:1050
msgid "hides the heading from a category listing"
msgstr ""
#: toc.php:1051
msgid ""
"Uses h6 to display %s on a page listing excluding pages with IDs 1 and 15"
msgstr ""
#: toc.php:1060
msgid "Update Options"
msgstr ""
#: toc.php:1563
msgid "Display the table of contents in the sidebar with this widget"
msgstr ""
#: toc.php:1664
msgid "Show the table of contents only in the sidebar"
msgstr ""
#: toc.php:1668
msgid "For the following content types:"
msgstr ""
#. Plugin Name of the plugin/theme
msgid "Table of Contents Plus"
msgstr ""
#. Plugin URI of the plugin/theme
msgid "http://dublue.com/plugins/toc/"
msgstr ""
#. Description of the plugin/theme
msgid ""
"A powerful yet user friendly plugin that automatically creates a table of "
"contents. Can also output a sitemap listing all pages and categories."
msgstr ""
#. Author of the plugin/theme
msgid "Michael Tran"
msgstr ""
#. Author URI of the plugin/theme
msgid "http://dublue.com/"
msgstr ""

View File

@ -0,0 +1,38 @@
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards">
<description>WordPress Coding Standards</description>
<!-- Scan all files in directory -->
<file>.</file>
<!-- Scan only PHP files -->
<arg name="extensions" value="php"/>
<!-- Show progress, show the error codes for each message (source). -->
<arg value="ps" />
<!-- Check up to 8 files simultaneously. -->
<arg name="parallel" value="8"/>
<!-- Exclude the Composer Vendor directory. -->
<exclude-pattern>/vendor/*</exclude-pattern>
<!-- Exclude minified Javascript files. -->
<exclude-pattern>*.min.js</exclude-pattern>
<!-- Include the WordPress-Extra standard. -->
<rule ref="WordPress-Extra">
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/>
<exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
<exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeEnd"/>
<exclude name="Squiz.PHP.EmbeddedPhp.ContentBeforeOpen"/>
<exclude name="WordPress.PHP.DisallowShortTernary.Found"/>
</rule>
<!-- Let's also check that everything is properly documented. -->
<!--<rule ref="WordPress-Docs"/>-->
<rule ref="Internal.NoCodeFound">
<severity>0</severity>
</rule>
</ruleset>

View File

@ -0,0 +1,370 @@
=== Table of Contents Plus ===
Contributors: conjur3r
Tags: table of contents, indexes, toc, sitemap, cms, options, list, page listing, category listing
Requires at least: 3.2
Tested up to: 6.4
Stable tag: 2311
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
A powerful yet user friendly plugin that automatically creates a table of contents. Can also output a sitemap listing all pages and categories.
== Description ==
A powerful yet user friendly plugin that automatically creates a context specific index or table of contents (TOC) for long pages (and custom post types). More than just a table of contents plugin, this plugin can also output a sitemap listing pages and/or categories across your entire site.
Built from the ground up and with Wikipedia in mind, the table of contents by default appears before the first heading on a page. This allows the author to insert lead-in content that may summarise or introduce the rest of the page. It also uses a unique numbering scheme that doesn't get lost through CSS differences across themes.
This plugin is a great companion for content rich sites such as content management system oriented configurations. That said, bloggers also have the same benefits when writing long structured articles. [Discover how Google](http://dublue.com/2012/05/12/another-benefit-to-structure-your-web-pages/) uses this index to provide 'Jump To' links to your content.
Includes an administration options panel where you can customise settings like display position, define the minimum number of headings before an index is displayed, other appearance, and more. For power users, expand the advanced options to further tweak its behaviour - eg: exclude undesired heading levels like h5 and h6 from being included; disable the output of the included CSS file; adjust the top offset and more. Using shortcodes, you can override default behaviour such as special exclusions on a specific page or even to hide the table of contents altogether.
Prefer to include the index in the sidebar? Go to Appearance > Widgets and drag the TOC+ to your desired sidebar and position.
Custom post types are supported, however, auto insertion works only when the_content() has been used by the custom post type. Each post type will appear in the options panel, so enable the ones you want.
Collaborate, participate, fork this plugin on [Github](https://github.com/zedzedzed/table-of-contents-plus/). Reach out on Github or place them at [http://dublue.com/plugins/toc/](http://dublue.com/plugins/toc/)
== Screenshots ==
1. An example of the table of contents, positioned at the top, right aligned, and a width of 275px
2. An example of the sitemap_pages shortcode
3. An example of the sitemap_posts shortcode
4. The options panel found in Settings > TOC+
5. Some advanced options
6. The sitemap tab
== Installation ==
The normal plugin install process applies, that is search for `table of contents plus` from your plugin screen or via the manual method:
1. Upload the `table-of-contents-plus` folder into your `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
That's it! The table of contents will appear on pages with at least four or more headings.
You can change the default settings and more under Settings > TOC+
== Shortcodes ==
The plugin was designed to be as seamless and painfree as possible and did not require you to insert a shortcode for operation. However, using the shortcode allows you to fully control the position of the table of contents within your page. The following shortcodes are available with this plugin.
When attributes are left out for the shortcodes below, they will fallback to the settings you defined under Settings > TOC+. The following are detailed in the help tab.
= [toc] =
Lets you generate the table of contents at the preferred position. Useful for sites that only require a TOC on a small handful of pages. Supports the following attributes:
* "label": text, title of the table of contents
* "no_label": true/false, shows or hides the title
* "wrapping": text, either "left" or "right"
* "heading_levels": numbers, this lets you select the heading levels you want included in the table of contents. Separate multiple levels with a comma. Example: include headings 3, 4 and 5 but exclude the others with `heading_levels="3,4,5"`
* "class": text, enter CSS classes to be added to the container. Separate multiple classes with a space.
* "start": number, show when this number of headings are present in the content.
= [no_toc] =
Allows you to disable the table of contents for the current post, page, or custom post type.
= [sitemap] =
Produces a listing of all pages and categories for your site. You can use this on any post, page or even in a text widget. Note that this will not include an index of posts so use sitemap_posts if you need this listing.
= [sitemap_pages] =
Lets you print out a listing of only pages. The following attributes are accepted:
* "heading": number between 1 and 6, defines which html heading to use
* "label": text, title of the list
* "no_label": true/false, shows or hides the list heading
* "exclude": IDs of the pages or categories you wish to exclude
* "exclude_tree": ID of the page or category you wish to exclude including its all descendants
* "child_of": "current" or page ID of the parent page. Defaults to 0 which includes all pages.
= [sitemap_categories] =
Same as `[sitemap_pages]` but for categories.
= [sitemap_posts] =
This lets you print out an index of all published posts on your site. By default, posts are listed in alphabetical order grouped by their first letters. The following attributes are accepted:
* "order": text, either ASC or DESC
* "orderby": text, popular options include "title", "date", "ID", and "rand". See [WP_Query](https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters) for a list.
* "separate": true/false (defaults to true), does not separate the lists by first letter when set to false.
Use the following CSS classes to customise the appearance of your listing:
* toc_sitemap_posts_section
* toc_sitemap_posts_letter
* toc_sitemap_posts_list
== I love it, how can I show my appreciation? ==
If you have been impressed with this plugin and would like to somehow show some appreciation, rather than send a donation my way, please donate to your charity of choice.
I will never ask for any form of reward or compensation. Helping others achieve their goals is satisfying for me :)
== Changelog ==
= 2311 =
* Released: 7 November 2023
* Bump tested WordPress version to 6.4
* Do not trigger on REST requests (props steffenster)
* Update include mechanism in init.php (props maciejmackowiak)
= 2309 =
* Released: 19 September 2023
* Bump tested version to 6.3.1
* Added `child_of` property to sitemap_pages shortcode (props flagsoft). This lets you output a listing of child pages for a set parent or "current". Property is optional and defaults to all pages.
* Fixed XSS possibility handling nonce while saving options (thanks to Patchstack)
* Updated WordPress Coding Standard to 3.0
= 2302 =
* Released: 9 February 2023
* Added `toc_brackets` CSS class to square brackets around show/hide text
* Added a filter to the `toc_extract_headings` function (props Raymond Radet)
* Refactor using WordPress-Extra coding standard
= 2212 =
* Released: 16 December 2022
* Bump tested version to 6.1.1
* When using the TOC+ widget, execute shortcodes beforehand (props endcoreCL)
* When using the TOC+ widget, abort early when no post for edge cases (props jonas-hoebenreich)
* Add start property to toc shortcode to override the minimum number of headings needed to display (props woutervanvliet)
* Add no_numbers property to toc shortcode to disable leading heading indexes (props TedAvery)
* Fixed XSS vulnerability in toc shortcode, class property (thanks to wpscan)
* Fixed XSS vulnerabilities in sitemap_pages and sitemap_categories shortcodes, label property
= 2106 =
* Released: 23 June 2021
* Add compatibility with Rank Math SEO
* Bump tested WordPress version to 5.7
* Add PHP coding style
* Adhere to majority of coding tips
= 2002 =
* Released: 9 February 2020
* Fixed encoding when using %PAGE_TITLE% or %PAGE_NAME%
* Bump tested WordPress version to 5.3
* Removed all local translations as you can find more up to date ones at translate.wordpress.org
* Removed translators links from readme
= 1601 =
* Released: 5 January 2016
* Bump tested WordPress version to 4.4
* Add 'enable' and 'disable' API functions so a developer can better control the execution.
* Add Brazilian Portuguese translation thanks to Blog de Niterói
* Add Spanish translation thanks to David Saiz
* TOC+ widget now adheres to a blank title if none provided. Thanks to [Dirk](http://dublue.com/plugins/toc/comment-page-11/#comment-5140) for the cue.
* Updated jQuery Smooth Scroll 1.5.5 to 1.6.0
* Updated text domain to better support translation packs.
= 1509 =
* Released: 4 September 2015
* Added Hebrew translation thanks to Ahrale
* Added Japaense translation thanks to シカマル
* Added Greek translation thanks to Dimitrios Kaisaris
* Updated jQuery Smooth Scroll 1.4.10 to 1.5.5
* Supply both minified and unminified CSS and JS files, use minified versions.
* Convert accented characters to ASCII in anchors.
* Bump tested WordPress version to 4.3
* Fixed: PHP notice introduced in WP 4.3
* Fixed: javascript error with $.browser testing for Internet Explorer 7.
* Plugin has moved to [GitHub](https://github.com/zedzedzed/table-of-contents-plus/) for better collaboration.
* Help needed: preg_match_all failing with bad UTF8 characters producing no TOC. If you can help, please participate in this [issue](https://github.com/zedzedzed/table-of-contents-plus/issues/105).
= 1507 =
* Released: 5 July 2015
* Added Danish translation courtesy of Cupunu
* Simplified the translation duty by moving the help material to the plugin's website.
* Updated translation file.
= 1505 =
* Released: 2 May 2015
* Huge thanks to Jason for an updated Simplified Chinese translation.
* Added collapse property to the toc shortcode. When set to true, this will hide the table of contents when it loads. Example usage: [toc collapse="true"]
* Added label_show and label_hide properties to the toc shortcode. This lets you change the "show" and "hide" link text when using the shortcode.
* Bump tested WordPress version to 4.2.1.
= 1408 =
* Released: 1 August 2014
* Added a human German translation courtesy Ben
* Added "class" attribute to the TOC shortcode to allow for custom CSS classes to be added to the container. Thanks to Joe for [suggesting it](http://dublue.com/plugins/toc/comment-page-7/#comment-2803)
= 1407 =
* Released: 5 July 2014
* Added Ukrainian translation courtesy Michael Yunat
* Added French translation courtesy Jean-Michel Duriez
* Empty headings are now ignored, as suggested by [archon810](http://wordpress.org/support/topic/patch-ignore-empty-tags)
* Removed German translation, may have been machine translated, [ref](http://wordpress.org/support/topic/excluding-headlines-special-characters)
* Fixed: Special chars in TOC+ > Settings > Exclude Headings no longer get mangled on save. Thanks to N-Z for [reporting it](http://wordpress.org/support/topic/excluding-headlines-special-characters).
= 1404 =
* Released: 18 April 2014
* Bump WordPress support to 3.9
* Fixed: Strip HTML tags from post titles for sitemap_posts so those items do not appear under a < heading. Thanks to [Rose](http://dublue.com/plugins/toc/comment-page-6/#comment-2311) for reporting it.
* Fictitious: This release was powered by three blind mice.
= 1402 =
* Released: 19 February 2014
* Added German translation courtesy Cord Peter
* Modify toc_get_index API function to also reset minimum number of headings to 0.
* Removing the TOC+ widget from the sidebar no longer requires you to uncheck the 'Show the table of contents only in the sidebar' option. It will be reset on removal.
* Delay count of headings until disqualified have been removed. Thanks to [Simone di Saintjust](http://dublue.com/plugins/toc/comment-page-6/#comment-2190) for raising it.
* Using the TOC+ widget, you can now limit the display to selected post types. Thanks to [Pete Markovic](http://dublue.com/plugins/toc/comment-page-6/#comment-2248) for the idea.
* Updated translation file (extra options added).
= 1311 =
* Released: 10 November 2013
* Added third parameter to toc_get_index API function to enable eligibility check (eg apply minimum heading check, is post type enabled, etc). This has been switched off by default and only affects those using the API. Thanks [Jonon](http://dublue.com/plugins/toc/comment-page-5/#comment-1943) for your comment.
* Added Dutch translation courtesy Renee
* Apply bullet option to TOC+ widget, thanks to [Thomas Pani for the patch](http://dublue.com/plugins/toc/comment-page-5/#comment-2040).
= 1308 =
* Released: 5 August 2013
* Fix javascript issue with minimum jQuery version check (broke smooth scrolling using WordPress 3.6).
* Replaced Slovak translation with a human translated version courtesy Boris Gereg.
* Remove <!--TOC--> signature from source when using the shortcode but not allowed to print (eg on homepage).
* Add "separate" attribute for sitemap_posts shortcode to not split by letter, thanks [DavidMjps](http://wordpress.org/support/topic/exclude-alphabetical-headings-on-sitemap) for the suggestion.
= 1303.1 =
* Released: 22 March 2013
* New: added Polish translation, curtesy Jakub
* Fixed: an issue in 1303 that ignored headings with the opening tag on the first line and the heading text on a new line. Thanks to [richardsng](http://wordpress.org/support/topic/unable-to-display-the-full-toc) for the quick discovery.
= 1303 =
* Released: 21 March 2013
* New: option auto insert after the first heading. Thanks to [@thelawnetwork](http://dublue.com/plugins/toc/comment-page-4/#comment-1782) for requesting it.
* New: allow headings to be excluded from the table of contents. This is available both globally under the advanced section of Settings > TOC+ and individually with the TOC shortcode. Check out the help material for examples. Thanks to the many of you that requested it.
* New: advanced option to lowercase all anchors. The default is off.
* New: advanced option to use hyphens rather than underscores in anchors. The default is off.
* New: shortcode to list all posts in alphabetical order grouped by first letter.
* New: added Slovak translation, curtesy Branco Radenovich.
* Add version numbers to CSS/JS files to better support setups that cache these files heavily for timely invalidation. Thanks to [boxcarpress](http://wordpress.org/support/topic/some-changes-we-made-that-you-might-consider) for the amendments.
* Add CSS class 'contracted' to #toc_container when the table of contents is hidden. Thanks to [Sam](http://wordpress.org/support/topic/hide-link-not-working?replies=6#post-3968019) for suggesting it.
* With smooth scroll enabled, do not use an offset if no admin bar is present and the offset value is default. This means that public users do not have the offset space at the top.
* New help material for developers under the help tab.
* Added API function: toc_get_index() lets you retrieve a table of contents to be placed within PHP. Check out the new developer help material for examples.
* Allow anchors to be filterable using toc_url_anchor_target to customise further through code. Check the new developer help material for an example. Thanks to [Russell Heimlich](http://dublue.com/plugins/toc/comment-page-4/#comment-1713) for the tip.
* Adjust CSS and JS registration.
* Updated jQuery Smooth Scroll to 1.4.10.
* Fixed: When using the widget, addressed an issue where the index with special characters (such as ' and ") would not link to the correct spot within the content. Thanks to [esandman](http://wordpress.org/support/topic/problems-with-apostrophes-and-quotation-marks) for raising it.
* Fixed: Saving at Settings > TOC+ resets TOC+ widget options. Thanks to [Chris](http://dublue.com/plugins/toc/comment-page-4/#comment-1808) for reporting it.
= 1211 =
* Released: 17 November 2012
* New: allow %PAGE_TITLE% to be used in the TOC title. Note that this also works in the widget title too. When used, this variable will be replaced with the current page's title. Thanks to [Peter](http://dublue.com/plugins/toc/comment-page-3/#comment-4782) for the request.
* New: new option to hide the TOC initially. Thanks to [Jonas](http://dublue.com/plugins/toc/comment-page-2/#comment-852), [Jonathan](http://dublue.com/plugins/toc/comment-page-2/#comment-2161), and [Doc Germanicus](http://dublue.com/plugins/toc/comment-page-4/#comment-5048) for requesting it.
* New: added ability to customise visited TOC link colour.
* New: option to restrict generation to a URL path match. For example, you can restrict to wiki pages that fall under http://domain/wiki/ by entering /wiki/ into the field. The setting can be found in the advanced options. Thanks to [Tux](http://dublue.com/plugins/toc/comment-page-3/#comment-4466) and [Justine Smithies](http://dublue.com/plugins/toc/comment-page-3/#comment-5000) for suggesting it.
* Make regular expressions less greedy. That means you can have multiple headings on a single line whereas before you needed to ensure each heading was on their own line. Thanks to [drdamour](http://wordpress.org/support/topic/widget-isnt-showing-up) for raising and providing a fix.
* Also make regular expressions match across multiple lines. This means you can have your single heading split across many lines.
* Better accessibility: when using smooth scrolling, allow for focus to follow the target, eg tabbing through will continue from the content block you clicked through to.
* Better performance: as requested by a few, javascript files have been consolidated into one and both javascript and CSS files are now minified.
* 'Auto' is now the default width which means it'll take up the needed amount of space up to 100%. The previous default was a fixed width of 275px.
* Added the ability to exclude entire branches when using [sitemap_pages] and [sitemap_categories] using the exclude_tree attribute. Thanks to [Benny Powers](http://dublue.com/plugins/toc/comment-page-3/#comment-3607) for requesting it.
* Wrap index numbers around span tags to enable easier CSS customisation. The spans are have two classes: toc_number and toc_depth_X where X is between 1 and 6. Thanks to [Matthias Krok](http://dublue.com/plugins/toc/comment-page-3/#comment-3922) for requesting it.
* Moved the 'preserve theme bullets' option into the advanced section.
* Updated and simplified the translation file.
* Fixed: [sitemap_categories] using the wrong label when none was specified. Thanks to [brandt-net](http://wordpress.org/support/topic/plugin-table-of-contents-plus-sitemap-setting-categories-label-of-sitemap_categories-not-shown) for raising it. The labels for both [sitemap_pages] and [sitemap_categories] may be removed in a future update as you can insert the title within your content.
= 1208 =
* Released: 2 August 2012
* New: advanced option to prevent the output of this plugin's CSS. This option allows the site owner to incorporate styles in one of their existing style sheets. Thanks to [Ivan](http://dublue.com/plugins/toc/comment-page-1/#comment-226) and [Swashata](http://dublue.com/plugins/toc/comment-page-3/#comment-3312) for suggesting it.
* Added Simplified Chinese translation thanks to icedream
* Make more translatable by adding a translation POT file in the languages folder. Translations welcome!
* Adjust multibyte string detection as reported by [johnnyvaughan](http://wordpress.org/support/topic/plugin-table-of-contents-plus-multibyte-string-detetction)
* Support PHP 5.4.x installations. Thanks to [Josh](http://dublue.com/plugins/toc/comment-page-3/#comment-3477) for raising it.
* Fixed: -2 appearing in links when using the TOC+ widget. Thanks to [Arturo](http://dublue.com/plugins/toc/comment-page-3/#comment-3337) for raising it.
= 1207 =
* Released: 23 July 2012
* New: when smooth scrolling is enabled, allow the top offset to be specified to support more than the WordPress admin bar (such as Twitter Bootstrap). The offset is displayed in the advanced section after you have enabled smooth scrolling. Thanks to [Nicolaus](http://dublue.com/2012/05/12/another-benefit-to-structure-your-web-pages/#comment-2611) for the suggestion.
* Allow 2 headings to be set as the minimum (used to be 3). Thanks to [Fran](http://dublue.com/plugins/toc/comment-page-2/#comment-779) for justifying it.
* Run later in the process so other plugins don't alter the anchor links (eg Google Analytics for WordPress).
* Do not show a TOC in RSS feeds. Thanks to [Swashata](http://dublue.com/plugins/toc/comment-page-3/#comment-2875) for raising it.
* Bump tested version to WordPress 3.5-alpha.
* Added help material about why some headings may not be appearing.
* Added banner image for WordPress repository listing.
* Updated readme.txt with GPLv2 licensing.
= 1112.1 =
* Released: 9 December 2011
* Forgot to update version number.
= 1112 =
* Released: 9 December 2011
* New: auto width option added which takes up only the needed amount of horizontal space up to 100%.
* Removed trailing - or _ characters from the anchor to make it more pretty.
* This plugin's long name has changed from "Table of Contents+" to "Table of Contents Plus". The short name remains as "TOC+".
* Fixed: when using the TOC shortcode within your content, your post or article would display the TOC on the homepage despite having the exclude from homepage option enabled. If you also used the "more tag", then you may have resulted with an empty TOC box. These are now addressed.
* Fixed: all anchors ending with "-2" when no headings were repeated. This was caused by plugins and themes that trigger `the_content` filter. The counters are now reset everytime `the_content` is run rather than only on initialisation.
= 1111 =
* Released: 11 November 2011
* New: option to adjust the font size. Thanks to [DJ](http://dublue.com/plugins/toc/comment-page-1/#comment-323) for the suggestion. The default remains at 95%.
* New: advanced option to select the heading levels (1 to 6) to be included. Thanks to those that hinted about wanting to achieve this.
* New: you can now have the TOC appear in the sidebar via the TOC+ widget. Thanks to [Nick Daugherty](http://dublue.com/plugins/toc/comment-page-1/#comment-172) and [DJ](http://dublue.com/plugins/toc/comment-page-1/#comment-323) for the suggestion.
* The TOC shortcode now supports the *heading_levels* attribute to allow you to limit the headings you want to appear in the table of contents on a per instance basis. Separate multiple headings with a comma. For example: include headings 3, 4 and 5 but exclude the others with `[toc heading_levels="3,4,5"]`
* The TOC shortcode also supports the *wrapping* attribute with possible values: "left" or "right". This lets you wrap text next to the table of contents on a per instance basis. Thanks to [Phil](http://dublue.com/plugins/toc/comment-page-1/#comment-331) for the suggestion.
* Better internal numbering system to avoid repeated headings. This means that for non-repeated headings, there is no trailing number in the anchor.
* Consolidated information about shortcodes and their attributes into the help tab.
* Fixed: repeated headings on the same level are no longer broken. For users with international character sets, please report any strange garbage characters in your headings (eg a character ends up being a question mark, square symbol, or diamond). Thanks to [Juozas](http://dublue.com/plugins/toc/comment-page-2/#comment-441) for the assistance.
* Fixed: removed PHP notices on a verbosely configured PHP setup.
* Fixed: suppress TOC frame output when heading count was less than the minimum required.
* Note: when removing the last TOC+ widget, please make sure you disable the "Show the table of contents only in the sidebar" option otherwise your table of contents won't appear where you'd expect. I will look to address this in the future.
= 1109 =
* Released: 12 September 2011
* Adjusted hide action for a smoother transition.
* Apply custom link and hover colours (when selected) to show/hide link in the title.
* Renamed jquery.cookie.min.js to jquery.c.min.js to overcome false positive with [mod_security](https://www.modsecurity.org/tracker/browse/CORERULES-29). Mod_security would block requests to this file which would break the ability to save a user's show/hide preference. In some cases, it has also broken other javascript functionality. Additionally, a better graceful non disruptive fallback is now in place to prevent possible repeat. Thanks goes to Shonie for helping debug the issue.
* Moved 'visibility option' into 'heading text'.
* Fixed: restored smooth scroll effect for Internet Explorer since 1108.2 introduced 'pathname' checks.
= 1108.2 =
* Released: 26 August 2011
* New: visibility option to show/hide the table of contents. This option is enabled by default so if you don't want it, turn it off in the options. Thanks to [Wafflecone](http://dublue.com/plugins/toc/#comment-123) and [Mike](http://dublue.com/plugins/toc/comment-page-1/#comment-160) for the suggestion.
* New: transparent presentation option added.
* New: custom presentation option with colour wheel for you to select your own background, border, title and link colours.
* TOC display on homepage has been disabled by default as most configurations would not require it there. If you want to enable it, you can do so under a new advanced admin option "Include homepage".
* Make smooth scrolling less zealous with anchors and be more compatible with other plugins that may use # to initiate custom javascript actions.
* Minor admin cross browser CSS enhancements like background gradients and indents.
= 1108.1 =
* Released: 3 August 2011
* Anchor targets (eg anything after #) are now limited to ASCII characters as some mobile user agents do not accept internationalised characters. This is also a recommendation in the [HTML spec](http://www.w3.org/TR/html4/struct/links.html#h-12.2.1). A new advanced admin option has been added to specify the default prefix when no characters qualify.
* Make TOC, Pages and Category labels compatible with UTF-8 characters.
* Support ' " \ characters in labels as it was being escaped by WordPress before saving.
= 1108 =
* Released: 1 August 2011
* New: option to hide the title on top of the table of contents. Thanks to [Andrew](http://dublue.com/plugins/toc/#comment-82) for the suggestion.
* New: option to preserve existing theme specified bullet images for unordered list elements.
* New: option to set the width of the table of contents. You can select from a number of common widths, or define your own.
* Allow 3 to be set as the minimum number of headings for auto insertion. The default stays at 4.
* Now accepts heading 1s (h1) within the body of a post, page or custom post type.
* Now creates new span tags for the target rather than the id of the heading.
* Now uses the heading as the anchor target rather than toc_index.
* Adjusted CSS styles for lists to be a little more consistent across themes (eg list-style, margins & paddings).
* Fixed: typo 'heirarchy' should be 'hierarchy'. Also thanks to Andrew.
* Fixed: addressed an issue while saving on networked installs using sub directories. Thanks to [Aubrey](http://dublue.com/plugins/toc/#comment-79).
* Fixed: closing of the last list item when deeply nested.
= 1107.1 =
* Released: 10 July 2011
* New: added `[toc]` shortcode to generate the table of contents at the preferred position. Also useful for sites that only require a TOC on a small handful of pages.
* New: smooth scroll effect added to animate to anchor rather than jump. It's off by default.
* New: appearance options to match your theme a little bit more.
= 1107 =
* Released: 1 July 2011
* First world release (functional & feature packed)
== Frequently Asked Questions ==
Check out the FAQs / Scenarios at [http://dublue.com/plugins/toc/#Scenarios_FAQs](http://dublue.com/plugins/toc/#Scenarios_FAQs)
== Upgrade Notice ==
Update folder with the latest files. All previous options will be saved.

View File

@ -0,0 +1,92 @@
#toc_container ul,#toc_container li {
margin:0;
padding:0;
}
#toc_container.no_bullets ul,
#toc_container.no_bullets li,
#toc_container.no_bullets ul li,
.toc_widget_list.no_bullets,
.toc_widget_list.no_bullets li {
background:none;
list-style-type:none;
list-style:none;
}
#toc_container.have_bullets li {
padding-left:12px;
}
#toc_container ul ul {
margin-left:1.5em;
}
#toc_container {
background:#f9f9f9;
border:1px solid #aaa;
padding:10px;
margin-bottom:1em;
width:auto;
display:table;
font-size:95%;
}
#toc_container.toc_light_blue {
background:#edf6ff;
}
#toc_container.toc_white {
background:#fff;
}
#toc_container.toc_black {
background:#000;
}
#toc_container.toc_transparent {
background:none transparent;
}
#toc_container p.toc_title {
text-align:center;
font-weight:700;
margin:0;
padding:0;
}
#toc_container.toc_black p.toc_title {
color:#aaa;
}
#toc_container span.toc_toggle {
font-weight:400;
font-size:90%;
}
#toc_container p.toc_title + ul.toc_list {
margin-top:1em;
}
.toc_wrap_left {
float:left;
margin-right:10px;
}
.toc_wrap_right {
float:right;
margin-left:10px;
}
#toc_container a {
text-decoration:none;
text-shadow:none;
}
#toc_container a:hover {
text-decoration:underline;
}
.toc_sitemap_posts_letter {
font-size:1.5em;
font-style:italic;
}

View File

@ -0,0 +1 @@
#toc_container li,#toc_container ul{margin:0;padding:0}#toc_container.no_bullets li,#toc_container.no_bullets ul,#toc_container.no_bullets ul li,.toc_widget_list.no_bullets,.toc_widget_list.no_bullets li{background:0 0;list-style-type:none;list-style:none}#toc_container.have_bullets li{padding-left:12px}#toc_container ul ul{margin-left:1.5em}#toc_container{background:#f9f9f9;border:1px solid #aaa;padding:10px;margin-bottom:1em;width:auto;display:table;font-size:95%}#toc_container.toc_light_blue{background:#edf6ff}#toc_container.toc_white{background:#fff}#toc_container.toc_black{background:#000}#toc_container.toc_transparent{background:none transparent}#toc_container p.toc_title{text-align:center;font-weight:700;margin:0;padding:0}#toc_container.toc_black p.toc_title{color:#aaa}#toc_container span.toc_toggle{font-weight:400;font-size:90%}#toc_container p.toc_title+ul.toc_list{margin-top:1em}.toc_wrap_left{float:left;margin-right:10px}.toc_wrap_right{float:right;margin-left:10px}#toc_container a{text-decoration:none;text-shadow:none}#toc_container a:hover{text-decoration:underline}.toc_sitemap_posts_letter{font-size:1.5em;font-style:italic}

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -0,0 +1,35 @@
<?php
/**
* Plugin Name: Table of Contents Plus
* Plugin URI : http://dublue.com/plugins/toc/
* Description: A powerful yet user friendly plugin that automatically creates a table of contents. Can also output a sitemap listing all pages and categories.
* Author: Michael Tran
* Author URI: http://dublue.com/
* Text Domain: table-of-contents-plus
* Domain Path: /languages
* Version: 2311
* License: GPL2
*/
/**
Table of Contents Plus is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
any later version.
Table of Contents Plus is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Table of Contents Plus. If not, see
https://github.com/zedzedzed/table-of-contents-plus/blob/main/LICENSE.md
*/
/**
* GPL licenced Oxygen icon used for the colour wheel
* http://www.iconfinder.com/search/?q=iconset%3Aoxygen
*/
require_once __DIR__ . '/includes/init.php';