Easy Table of Contents - Version 2.0.32

Version Description

08/16/2022 * NEW: Added Sticky Table of Content #241 * TWEAK: Improved admin UI & UX #245 * TWEAK: Audit onboarding as a first time user #243 * TWEAK: Audit default options #242 #246 * BUG: Capitalizing the first letter of each title in the table of content #252 * BUG: Need to fix the sidebar position #251

Download this release

Release Info

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

Code changes from version 2.0.31 to 2.0.32

README.txt CHANGED
@@ -1,582 +1,609 @@
1
- === Easy Table of Contents ===
2
- Contributors: magazine3
3
- Donate link: https://magazine3.company/
4
- Tags: table of contents, toc
5
- Requires at least: 5.3
6
- Tested up to: 6.0
7
- Requires PHP: 5.6.20
8
- Stable tag: 2.0.31
9
- License: GPLv2 or later
10
- License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
-
12
- Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content.
13
-
14
- == Description ==
15
-
16
- A user friendly, featured focused plugin which allows you to insert a table of contents into your posts, pages and custom post types.
17
-
18
- ### Features
19
- * Automatically generate a table of contents for your posts, pages and custom post types by parsing its contents for headers.
20
- * Supports the `<!--nextpage-->` tag.
21
- * Supports the Rank Math plugin.
22
- * Works with the Classic Editor, Gutenberg, Divi, Elementor, WPBakery Page Builder and Visual Composer page editors.
23
- * Optionally enable for pages and/or posts. Custom post types are supported, as long as their content is output with the `the_content()` template tag.
24
- * Optionally auto insert the table of contents into the page, selectable by enabled post type.
25
- * Provides many easy to understand options to configure when and where to insert the table of contents.
26
- * Many options are available to configure how the inserted table of contents appears which include several builtin themes. If the supplied themes do no meet you needs, you can create your own by choosing you own colors for the border, background and link color.
27
- * Multiple counter bullet formats to choose from; none, decimal, numeric and roman.
28
- * Choose to display the table of contents hierarchical or not. This means headings of lower priority will be nested under headings of higher priority.
29
- * User can optionally hide the table of contents. You full control of this feature. It can be disabled and you can choose to have it hidden by default.
30
- * Supports smooth scrolling.
31
- * Selectively enable or disabled the table of contents on a post by post basis.
32
- * Choose which headings are used to generate the table of contents. This too can be set on a post by post basis.
33
- * Easily exclude headers globally and on a post by post basis.
34
- * If you rather not insert the table of contents in the post content, you can use the supplied widget and place the table of contents in your theme's sidebar.
35
- * The widgets supports being affixed or stuck on the page so it is always visible as you scroll down the page. NOTE: this is an advanced option since every theme is different, you might need support from your theme developer to learn what the correct item selector to use in the settings to enable this feature.
36
- * The widget auto highlights the sections currently visible on the page. The highlight color is configurable.
37
- * Developer friendly with many action hooks and filters available. More can be added by request on [Github](https://github.com/shazahm1/Easy-Table-of-Contents). Pull requests are welcomed.
38
-
39
- ### Support
40
-
41
- We try our best to provide support on WordPress.org forums. However, We have a special [team support](https://magazine3.company/contact/) where you can ask us questions and get help. Delivering a good user experience means a lot to us and so we try our best to reply each and every question that gets asked.
42
-
43
- ### Bug Reports
44
-
45
- Bug reports for Easy Table of Contents are [welcomed on GitHub](https://github.com/ahmedkaludi/Easy-Table-of-Contents). Please note GitHub is not a support forum, and issues that aren't properly qualified as bugs will be closed.
46
-
47
- ### [JOIN TELEGRAM GROUP COMMUNITY](https://t.me/+XADGN24lHNk0YjE1/)**: Purpose of this group is to get proper suggestions and feedback from plugin users and the community so that we can make the plugin even better.
48
-
49
- ### Live Examples
50
-
51
- * [cMap Template Docs](http://connections-pro.com/documentation/cmap/)
52
- * [Circled Template Docs](http://connections-pro.com/documentation/circled/)
53
- * [Gridder Template Docs](http://connections-pro.com/documentation/gridder/)
54
-
55
- ### Roadmap
56
- * Fragment caching for improved performance.
57
- * Improve SEO by adding options to add nofollow to TOC link and wrap TOC nav in noindex tag.
58
- * Improve accessibility.
59
- * Add Bullet and Arrow options for list counter style.
60
-
61
- ### Credit
62
-
63
- Easy Table Contents is a fork of the excellent [Table of Contents Plus](https://wordpress.org/plugins/table-of-contents-plus/) plugin by [Michael Tran](http://dublue.com/plugins/toc/).
64
-
65
- ### Screenshots
66
-
67
- 1. The General section of the settings.
68
- 2. The Appearance section of the settings.
69
- 3. The Advanced section of the settings.
70
-
71
- ### Installation
72
-
73
- = Using the WordPress Plugin Search =
74
-
75
- 1. Navigate to the `Add New` sub-page under the Plugins admin page.
76
- 2. Search for `easy table of contents`.
77
- 3. The plugin should be listed first in the search results.
78
- 4. Click the `Install Now` link.
79
- 5. Lastly click the `Activate Plugin` link to activate the plugin.
80
-
81
- = Uploading in WordPress Admin =
82
-
83
- 1. [Download the plugin zip file](http://wordpress.org/plugins/easy-table-of-contents/) and save it to your computer.
84
- 2. Navigate to the `Add New` sub-page under the Plugins admin page.
85
- 3. Click the `Upload` link.
86
- 4. Select Easy Table of Contents zip file from where you saved the zip file on your computer.
87
- 5. Click the `Install Now` button.
88
- 6. Lastly click the `Activate Plugin` link to activate the plugin.
89
-
90
- = Using FTP =
91
-
92
- 1. [Download the plugin zip file](http://wordpress.org/plugins/easy-table-of-contents/) and save it to your computer.
93
- 2. Extract the Easy Table of Contents zip file.
94
- 3. Create a new directory named `easy-table-of-contents` directory in the `../wp-content/plugins/` directory.
95
- 4. Upload the files from the folder extracted in Step 2.
96
- 4. Activate the plugin on the Plugins admin page.
97
-
98
- == Changelog ==
99
-
100
- = 2.0.31 07/29/2022 =
101
- * BUG: Elementor editor is not accessible after latest update. #235
102
-
103
- = 2.0.30 07/28/2022 =
104
- * NEW: Added Hook Before/After Widget Container #119
105
- * NEW: Added wysiwyg button to Wordpress visual editor #140
106
- * TWEAK: Sticky Sidebar TOC improvements #226
107
- * TWEAK: Incorrect prefix in one function #227
108
- * BUG: Conflicts with WP-Typography #135
109
- * BUG: TOC does not show up in woocommerce product description #224
110
-
111
-
112
- = 2.0.29 07/19/2022 =
113
- * TWEAK: Added Oxygen pagebulider compatibility #198
114
- * TWEAK: Added toggle state class to container #129
115
- * TWEAK: Added Refresh Toggle State #149
116
- * BUG: TOC not showing in WooCommerce category description #134
117
- * BUG: TOC links not working with emoji in title #117
118
- * BUG: TOC not running on nested excluded filters #118
119
- * BUG: Showing incorrect excerpt in a grid with Genesis Framework and other themes #144
120
-
121
- = 2.0.28 07/15/2022 =
122
- * TWEAK: Added Sidebar placement option for TOC #156
123
- * TWEAK: Added SeedProd Pro compatibility #157
124
- * TWEAK: Added option to show the TOC content after the first paragraph #181
125
- * BUG: TOC not working in sidebar with Blocksy theme #220
126
- * BUG: Form elements do not have associated labels In lighthouse #219
127
- * BUG: Alternate Heading problem with Umlauts #148
128
-
129
- = 2.0.27 07/12/2022 =
130
- * TWEAK: Added subscribe to newsletters form on plugin activation #216
131
- * TWEAK: Added user feedback form on plugin deactivation #216
132
- * TWEAK: Added option to remove special characters from TOC Headings #217
133
- * BUG: Corner Stone page builder heading are not working #200
134
- * BUG: The links are not working using href with pure CSS option #208
135
- * BUG: Attribute href is missing in an anchor element due to which links cannot be crawled #210
136
- * BUG: Debug Warnings #212
137
-
138
- = 2.0.26 07/05/2022 =
139
- * BUG: TOC loading method should be same for CSS and JS #199
140
- * BUG: Custom width option should come after selecting the User Define option #201
141
- * BUG: Function added to front.js but not present in front.min.js #202
142
- * BUG: The custom heading is not working with WP Bakery page builder #205
143
- * BUG: TOC not working in the Avada themes in widgets #206
144
- * BUG: Headers in content of shortcodes are not getting showing up in TOC #209
145
- * BUG: TOC broken for non-English titles #211
146
-
147
- = 2.0.25 06/27/2022 =
148
- * TWEAK: Added Migration from Table of Contents Plus and LuckyWP Table of Contents #160
149
- * TWEAK: Added Option to add inline CSS and JS #189
150
- * TWEAK: Added Shortcode to show hidden view on particular posts #183
151
- * TWEAK: Added Hyphen Counter to display the TOC heading #192
152
- * TWEAK: Added Dot Counter to display the TOC heading #180
153
- * TWEAK: Improved the Web Accessibility in TOC Toggle #190
154
- * BUG: Shortcodes are not rendering in TOC titles #197
155
- * BUG: TOC heading are getting hidden in sticky header #186
156
- * BUG: No success or error message after support request is submitted #196
157
- * BUG: Same font size appearing in headings and sub-headings #161
158
- * BUG: Salient core plugin conflict with last update 2.0.24.1 #207
159
-
160
- = 2.0.24.1 06/14/2022 =
161
- * BUG: TOC not displaying properly when initial view option is disabled #195
162
- * BUG: Initial View option not working with Pure CSS Loading Method #194
163
-
164
- = 2.0.24 06/10/2022 =
165
- * TWEAK: Added TOC in Infinite Scroll #138
166
- * TWEAK: Improved the activation process #187
167
- * BUG: TOC Toggle not working with Magnolia Theme #174
168
- * BUG: Initial view not working with TOC Loading Method of CSS #179
169
- * BUG: Toggle is not visible when Display Header option is disable #171
170
- * BUG: CSS not loading when using shortcode in theme file #175
171
- * BUG: the_content filter run twice #182
172
- * BUG: Form UI looks ugly #169
173
- * BUG: Debug Warnings in multibyte string functions #185
174
-
175
- = 2.0.23 05/31/2022 =
176
- * TWEAK: Added filter to modify anchor links #167
177
- * TWEAK: Added filter to add TOC before or after the sidebar widget #166
178
- * TWEAK: Added option to align TOC to center #158
179
- * TWEAK: Design improvements in options panel #172
180
-
181
- = 2.0.22 05/06/2022 =
182
- * BUG: Double hyphens are getting removed from content issue fixed #163
183
-
184
- = 2.0.21 05/06/2022 =
185
- * BUG: Critical error fixed #147
186
-
187
- = 2.0.20 05/05/2022 =
188
- * TWEAK: Added Toggle with CSS for websites runs without jQuery #153
189
- * TWEAK: Added telegram group join link for suggestions and feedback #159
190
- * BUG: TOC links not jumping in some posts which have special characters #163
191
- * BUG: Incorrect email ID updated in the plugin #165
192
- * BUG: Proper documentation added for adding TOC with shortcodes & do_shortcode #152
193
- * BUG: TOC links not working when do_shortcode added directly in the template #147
194
- * BUG: TOC links not working with some specical character with Elementor #162
195
-
196
- = 2.0.19 04/16/2022 =
197
- * Bug Fixed : While Using Elementor Page builder TOC is not working when special characters are used in headings. #150
198
- * Bug Fixed : Need to load CSS/JS files only on the selected post types. #154
199
-
200
- = 2.0.18 03/29/2022 =
201
- * TWEAK: Added Technical Support Tab in Settings Panel.
202
-
203
- = 2.0.17 03/26/2021 =
204
- * TWEAK: Add additional check to prevent `Uncaught Error: Call to undefined function is_woocommerce()`.
205
- * TWEAK: Ensure an instance of `ezTOC_Post ` is returned before accessing methods/properties.
206
-
207
- = 2.0.16 02/01/2021 =
208
- * TWEAK: Remove special characters such as fancy quotes, en and, em dashes when generating in-page anchor IDs.
209
-
210
- = 2.0.15 01/27/2021 =
211
- * TWEAK: Remove additional reserved characters when generating in-page anchor IDs.
212
-
213
- = 2.0.14 01/26/2021 =
214
- * TWEAK: Refactor debug log as a Singleton.
215
- * TWEAK: Add additional logging to aid in debugging.
216
- * BUG: Correct logic for PHP where empty string no longer evaluates as integer `0`.
217
-
218
- = 2.0.13 01/25/2021 =
219
- * TWEAK: Restrict debug logging to when `WP_DEBUG` is enabled *and* current user capability of `manage_options`.
220
- * TWEAK: Add logging to aid in support.
221
- * DEV: phpDoc update.
222
-
223
- = 2.0.12 01/22/2021 =
224
- * TWEAK: Allow `_` and `-` in anchors.
225
- * TWEAK: Minor CSS tweaks that prevent theme from breaking the layout.
226
- * TWEAK: Minor tweak to class initialization.
227
- * TWEAK: Do not display the view toggle if JavaScript is broken on the site.
228
- * TWEAK: Add the ability to enable displaying of displaying debug information on the page.
229
- * BUG: Check for array and keys before accessing values.
230
- * BUG: Check for array key be fore access.
231
- * BUG: Remove reserved characters when generating in-page anchor IDs.
232
- * DEV: Remove unnecessary vendor library files.
233
- * DEV: Deal with phpStorm showing a warning about path not found when including files.
234
-
235
- = 2.0.11 05/01/2020 =
236
- * COMPATIBILITY: Add support for the Uncode theme.
237
- * COMPATIBILITY: Do not run on WooCommerce pages.
238
- * DEV: Correct typo in phpDoc.
239
-
240
- = 2.0.10 04/20/2020 =
241
- * TWEAK: Add trailing `span` to heading, to prepare for `#` option and to fix duplicate heading title matching.
242
- * TWEAK: Add second heading search/replace function to search for heading in content with heading html entities decoded. May help Beaver Builder users as it seems like it does not encode HTML entities as WP core does.
243
-
244
-
245
- = 2.0.9 04/08/2020 =
246
- * TWEAK: AMP/Caching plugins seems to break anchors with colons and periods even though they are valid characters for the id attribute in HTML5.
247
- * TWEAK: Replace multiple underscores with a single underscore.
248
- * DEV: Update the UWS library which fixes the deprecation notice for PHP 7.4.
249
- * DEV: Add phpcs.xml.dist.
250
- * DEV: Strict type checks.
251
- * DEV: Inline doc updates.
252
-
253
- = 2.0.8 04/03/2020 =
254
- * TWEAK: Convert `<br />` tags in headings to a space.
255
- * TWEAK: Add additional widget classes.
256
- * TWEAK: Improve the sanitization of the excluded headings field post setting.
257
- * TWEAK: Minor optimization of creating the matching pattern for excluding headings for improved performance.
258
- * COMPATIBILITY: Exclude Create by Mediavine from heading eligibility.
259
- * BUG: Ensure excluded headings are removed from the headings array.
260
- * BUG: Ensure empty headings are removed from the headings array.
261
-
262
- = 2.0.7 04/02/2020 =
263
- * NEW: Exclude any HTML nodes with the class of `.ez-toc-exclude-headings`.
264
- * TWEAK: Change smooth scroll selector from `'body a'` to `'a.ez-toc-link'`.
265
- * TWEAK: Declare JS variables.
266
- * TWEAK: Support unicode characters for the `id` attribute. Permitted by HTML5.
267
- * TWEAK: Move the in-page anchor/span to before the heading text to account for long headings where it line wraps.
268
- * TWEAK: Slight rework to ezTOC widget container classes logic.
269
- * TWEAK: Cache bust the JS to make dev easier.
270
- * TWEAK: JavaScript cleanup.
271
- * TWEAK: URI Encode the id attribute to deal with reserved characters in JavaScript. Technically not necessary for the id attribute but needed to work with the jQuery smoothScroll library.
272
- * COMPATIBILITY: Reintroduce filter to exclude Ultimate Addons for VC Composer Tabs from heading eligibility.
273
- * BUG: Correct array iteration logic when processing headings.
274
- * BUG: Tighten matching for headings in excluded HTML nodes. The loose matching was excluding far too many headings.
275
- * BUG: Use `esc_attr()` instead of `esc_url()` for the anchor href because valid id attribute characters would cause it to return an empty href which cause a nonworking link.
276
-
277
- = 2.0.6 03/30/2020 =
278
- * BUG: Ensure minified files are current.
279
-
280
- = 2.0.5 03/27/2020 =
281
- * BUG: Prevent possible "strpos(): Empty needle in" warnings when excluding nodes from TOC eligibility.
282
-
283
- = 2.0.4 03/16/2020 =
284
- * NEW: Introduce the `ez_toc_container_class` filter.
285
- * TWEAK: Slight rework to ezTOC container classes logic.
286
- * BUG: `sprintf()` was eating `%` in the TOC heading item.
287
- * BUG: Do not insert TOC at top of post if before first heading option is selected even if first heading can not be found. Some page builders cause the TOC to insert twice or on blog pages.
288
-
289
- = 2.0.3 03/12/2020 =
290
- * TWEAK: Slightly tighten heading matching, last update made it a little too loose.
291
- * BUG: Correct logic required to place TOC before first heading which is required for the more lax heading matching required for page builders.
292
-
293
- = 2.0.2 03/12/2020 =
294
- * COMPATIBILITY: Remove filter to exclude Ultimate Addons for VC Composer Tabs from heading eligibility.
295
- * COMPATIBILITY: Add additional filters to improve Elementor compatibility.
296
- * TWEAK: Loosen heading matching when doing find/replace to insert in page links. Excluding the opening heading tag to allow matching heading where page builders dynamically add classes and id which break heading matching during find/replace.
297
-
298
- = 2.0.1 03/09/2020 =
299
- * COMPATIBILITY: Exclude the WordPress Related Posts plugin nodes.
300
- * COMPATIBILITY: Exclude a couple Atomic Block plugin nodes.
301
- * COMPATIBILITY: Exclude JetPack Related Posts from heading eligibility.
302
- * COMPATIBILITY: Exclude Ultimate Addons for VC Composer Tabs from heading eligibility.
303
- * COMPATIBILITY: Exclude WP Product Reviews from heading eligibility.
304
- * TWEAK: Prevent possible "strpos(): Empty needle in" warnings when excluding nodes from TOC eligibility.
305
-
306
- = 2.0 02/01/2020 =
307
- * NEW: Major rewrite of all code and processing logic to make it faster and more reliable.
308
- * NEW: Support for the <!--nextpage--> tag.
309
- * NEW: Introduce helper functions for devs.
310
- * NEW: Support WPML.
311
- * NEW: Support Polylang.
312
- * NEW: Add filter to support the Rank Math plugin.
313
- * NEW: Introduce the `ez_toc_maybe_apply_the_content_filter` filter.
314
- * TWEAK: Improve translation compatibility.
315
- * TWEAK: Rework widget logic to allow multi-line TOC items, improve active item highlighting while removing the use of the jQuery Waypoints library.
316
- * TWEAK Add additional classes to TOC list items.
317
- * TWEAK: Add WOFF2 format for icon format and change font references in CSS.
318
- * TWEAK: Add font-display: swap for toggle icon.
319
- * TWEAK: Update JS Cookie to 2.2.1.
320
- * TWEAK: Update jQuery Smooth Scroll to 2.2.0.
321
- * TWEAK: Allow forward slash and angle brackets in headings and alternate headings.
322
- * TWEAK: Allow forward slash in excluded headings.
323
- * TWEAK: Remove new line/returns when matching excluded headings.
324
- * TWEAK: Simple transient cache to ensure a post is only processed once per request for a TOC.
325
- * TWEAK: Improve sanitization of alternate headings field value.
326
- * TWEAK: Deal with non-breaking-spaces in alternate headings.
327
- * TWEAK: Add the ability to exclude by selector content eligible to be included in the TOC.
328
- * TWEAK: Change the shortcode priority to a higher value.
329
- * TWEAK: Add filter to remove shortcodes from the content prior to the `the_content` filter being run to exclude shortcode content from being eligible as TOC items.
330
- * TWEAK: Add compatibility filters to remove shortcodes for Connections and Striking theme to remove them from eligible TOC item content.
331
- * TWEAK: Do not execute if root current filter is the `wp_head` or `get_the_excerpt` filters.
332
- * TWEAK: Add filter to exclude content by selector.
333
- * TWEAK: Move in-page anchor to after the heading instead of wrapping the heading to prevent conflicts with theme styling.
334
- * TWEAK: Utilize the `ez_toc_exclude_by_selector` filter the exclude the JetPack share buttons from eligible headings.
335
- * TWEAK: Remove the Elegant Themes Bloom plugin node from the post content before extracting headings.
336
- * TWEAK: Add compatibility filter for the Visual Composer plugin.
337
- * TWEAK: Utilize the `ez_toc_exclude_by_selector` filter the exclude the Starbox author heading from eligible headings.
338
- * I18N: Add wpml-config.xml file.
339
- * BUG: Correct option misspelling.
340
- * BUG: Do not need to run values for alternate and exclude headings thru `wp_unslash()` because `update_post_meta()` already does.
341
- * BUG: Do not need to run `stripslashes()` when escaping the alternate heading value.
342
- * BUG: Sanitize the excluded heading string before saving post meta.
343
- * DEV: Change PHP keywords to comply with PSR2.
344
- * DEV:Bump minimum PHP version to 5.6.20 which matches WP core.
345
-
346
- = 1.7 05/09/2018 =
347
- * NEW: Introduce the `ez_toc_shortcode` filter.
348
- * TWEAK: Fix notices due to late eligibility check. props unixtam
349
- * TWEAK: Tweak eligibility check to support the TOC widget.
350
- * TWEAK: Prefix a few CSS classes in order to prevent collisions with theme's and other plugins.
351
- * TWEAK: Avoid potential PHP notice in admin when saving the post by checking for nonce before validating it.
352
- * TWEAK: Using the shortcode now overrides global options.
353
- * TWEAK: `the_content()` now caches result of `is_eligible()`.
354
- * TWEAK: Refactor to pass the WP_Post object internally vs. accessing it via the `$wp_query->post` which may not in all cases exist.
355
- * TWEAK: Use `pre_replace()` to replace one or more spaces with an underscore.
356
- * TWEAK: Return original title in the `ez_toc_url_anchor_target` filter.
357
- * TWEAK: Strip `&nbsp;`, replacing it with a space character.
358
- * TWEAK: Minor tweaks to the in page URL creating.
359
- * TWEAK: Wrap TOC list in a nav element.
360
- * TWEAK: Init plugin on the `plugins_loaded` hook.
361
- * TWEAK: Tweak the minimum number of headers to 1.
362
- * BUG: The header options from the post meta should be used when building the TOC hierarchy, not the header options from the global settings.
363
- * BUG: Do not double escape field values.
364
- * BUG: Ensure Apostrophe / Single quote use in Exclude Headings work.
365
- * OTHER: Update CSS to include the newly prefixed classes.
366
- * DEV: Remove some commented out unused code.
367
-
368
- = 1.6.1 03/16/2018 =
369
- * TWEAK: Revert change made to allow HTML added via the `ez_toc_title` filter as it caused undesirable side effects.
370
- * BUG: Ensure Smooth Scroll Offset is parsed as an integer.
371
-
372
- = 1.6 03/15/2018 =
373
- * NEW: Add `px` option for font size unit.
374
- * NEW: Add title font size and weight settings options.
375
- * NEW: Add the Mobile Smooth Scroll Offset option.
376
- * TWEAK: Change default for font size unit from `px` to `%` to match the default options values.
377
- * TWEAK: Correct CSS selector so margin is properly applied between the title and TOC items.
378
- * TWEAK: Honor HTML added via `ez_toc_title` filter.
379
- * TWEAK: Ensure the ezTOC content filter is not applied when running `the_content` filter.
380
- * TWEAK: Only enqueue the javascript if the page is eligible for a TOC.
381
- * TWEAK: Update icomoon CSS to remove unecessary CSS selectors to prevent possible conflicts.
382
- * TWEAK: The smooth scroll offset needs to be taken into account when defining the offset_top property when affixing the widget.
383
- * OTHER: Update frontend minified CSS file.
384
- * OTHER: Update the frontend minified javascript file.
385
- * DEV: phpDoc corrections.
386
-
387
- = 1.5 02/20/2018 =
388
- * BUG: Correct CSS selector to properly target the link color.
389
- * OTHER: Update the WayPoints library.
390
- * DEV: Add a couple @todo's.
391
-
392
- = 1.4 01/29/2018 =
393
- * TWEAK: Change text domain from ez_toc to easy-table-of-contents.
394
- * TWEAK: Rename translation files with correct text domain.
395
- * BUG: Ensure page headers are processed to add the in page header link when using the shortcodes.
396
- * BUG: Add forward slash to domain path in the plugin header.
397
- * I18N: Update POT file.
398
- * I18N: Update Dutch (nl_NL) translation.
399
-
400
- = 1.3 12/18/2017 =
401
- * FEATURE: Add support for the `[ez-toc]` shortcode.
402
- * NEW: For backwards compatibility with "Table of Content Plus", register the `[toc]` shortcode.
403
- * NEW: Introduce the `ez_toc_extract_headings_content` filter.
404
- * TWEAK: Update the tested to and required readme header text.
405
- * TWEAK: Do not show the widget on the 404, archive, search and posts pages.
406
- * I18N: Add the nl_NL translation.
407
-
408
- = 1.2 04/29/2016 =
409
- * TWEAK: Remove the font family from styling the TOC title header.
410
- * TWEAK: Pass the raw title to the `ez_toc_title` filter.
411
- * BUG: A jQuery 1.12 fix for WordPress 4.5.
412
-
413
- = 1.1 02/24/2016 =
414
- * FEATURE: Add option to replace header wither alternate header text in the table of content.
415
- * NEW: Introduce the ez_toc_filter.
416
- * NEW: Introduce ezTOC_Option::textarea() to render textareas.
417
- * NEW: Introduce array_search_deep() to recursively search an array for a value.
418
- * TWEAK: Run table of contents headers thru wp_kses_post().
419
- * TWEAK: Escape URL.
420
- * TWEAK: Count excluded headings only once instead of multiple times.
421
- * TWEAK: Escape translated string before rendering.
422
- * TWEAK: Use wp_unslash() instead of stripslashes().
423
- * TWEAK: Escape translated string.
424
- * BUG: Fix restrict path logic.
425
- * OTHER: Readme tweaks.
426
- * I18N: Add POT file.
427
- * I18N: Add Dutch translation.
428
- * DEV: Update .gitignore to allow PO files.
429
- * DEV: phpDoc fix.
430
-
431
- = 1.0 09/08/2015 =
432
- * Initial release.
433
- - Complete refactor and restructure of the original code for better design and separation of function to make code base much easier to maintain and extend.
434
- - Update all third party libraries.
435
- - Make much better use of the WordPress Settings API.
436
- - Minified CSS and JS files are used by default. Using SCRIPT_DEBUG will use the un-minified versions.
437
- - Add substantial amounts of phpDoc for developers.
438
- - Add many hooks to permit third party integrations.
439
- - Widget can be affixed/stuck to the page so it is always visible.
440
- - Widget will highlight the table of content sections that are currently visible in the browser viewport.
441
- - Widget will now generate table of contents using output from third party shortcodes.
442
- - Use wpColorPicker instead of farbtastic.
443
- - Remove all shortcodes.
444
- - Per post options are saved in post meta instead of set by shortcode.
445
-
446
- == Frequently Asked Questions ==
447
-
448
- = Ok, I've installed this... what do I do next? =
449
-
450
- You first stop should be the Table of Contents settings admin page. You can find this under the Settings menu item.
451
-
452
- You first and only required decision is you need to decide which post types you want to enable Table of Contents support for. By default it is the Pages post type. If on Pages is the only place you plan on using Table of Contents, you have nothing to do on the Settings page. To keep things simple, I recommend not changing any of the other settings at this point. Many of the other settings control when and where the table of contents is inserted and changing these settings could cause it not to display making getting started a bit more difficult. After you get comfortable with how this works... then tweak away :)
453
-
454
- With that out of the way make sure to read the **How are the tables of contents created?** FAQ so you know how the Table of Contents is automatically generated. After you have the page headers setup, or before, either way... Scroll down on the page you'll see a metabox named "*Table of Contents*", enable the *Insert table of contents.* option and Update and/or Publish you page. The table of contents should automatically be shown at the top of the page.
455
-
456
- = How are the tables of contents created? =
457
-
458
- The table of contents is generated by the headers found on a page. Headers are the [`<h1>,<h2>,<h3>,<h4>,<h5>,<h6>` HTML tags](http://www.w3schools.com/tags/tag_hn.asp). If you are using the WordPres Visual Post Editor, these header tags are used and inserted into the post when you select one of the [*Heading n* options from the formatting drop down](http://torquemag.io/wordpress-heading-tags/). Each header that is found on the page will create a table of content item. Here's an example which will create a table of contents containing the six items.
459
-
460
- `<h1>Item 1</h1>
461
- <h1>Item 2</h1>
462
- <h1>Item 3</h1>
463
- <h1>Item 4</h1>
464
- <h1>Item 5</h1>
465
- <h1>Item 6</h1>`
466
-
467
- You can also create "nested" table of contents. This is difficult to explain so I'll illustrate building on the previous example. In this example a table of contents will be created with the same six items but now the first three will each an child item nested underneath it. The indentation is not necessary, it was only added for illustration purposes.
468
-
469
- `<h1>Item 1</h1>
470
- <h2>Item 1.1 -- Level 2</h2>
471
- <h1>Item 2</h1>
472
- <h2>Item 2.1 -- Level 2</h2>
473
- <h1>Item 3</h1>
474
- <h2>Item 3.1 -- Level 2</h2>
475
- <h1>Item 4</h1>
476
- <h1>Item 5</h1>
477
- <h1>Item 6</h1>`
478
-
479
- You are not limited to a single a single nested item either. You can add as many as you need. You can even create multiple nested levels...
480
-
481
- `<h1>Item 1</h1>
482
- <h2>Item 1.1 -- Level 2</h2>
483
- <h3>Item 1.1.1 -- Level 3</h3>
484
- <h3>Item 1.1.2 -- Level 3</h3>
485
- <h3>Item 1.1.3 -- Level 3</h3>
486
- <h2>Item 1.2 -- Level 2</h2>
487
- <h3>Item 1.2.1 -- Level 3</h3>
488
- <h3>Item 1.2.2 -- Level 3</h3>
489
- <h3>Item 1.2.3 -- Level 3</h3>
490
- <h2>Item 1.3 -- Level 2</h2>
491
- <h1>Item 2</h1>
492
- <h2>Item 2.1 -- Level 2</h2>
493
- <h2>Item 2.2 -- Level 2</h2>
494
- <h1>Item 3</h1>
495
- <h2>Item 3.1 -- Level 2</h2>
496
- <h2>Item 3.2 -- Level 2</h2>
497
- <h1>Item 4</h1>
498
- <h1>Item 5</h1>
499
- <h1>Item 6</h1>`
500
-
501
- You can nest up 6 levels deep if needed. I hope this helps you understand how to create and build your own auto generated table of contents on your sites!
502
-
503
- = Is there any shortcode to add the table of content to anywhere I want ? =
504
-
505
- Yes you can add the TOC with this shortcode – [ez-toc] and with the help of this you can easily add the TOC in the content or anywhere in the WordPress and if you want to add the shortcode on the theme file then you can add it with the help of this code – <?php echo do_shortcode( ‘[ez-toc]’ ); ?> and with this, you can add the TOC on any file according to your need.
506
-
507
- == Upgrade Notice ==
508
-
509
- = 1.0 =
510
- Initial release.
511
-
512
- = 1.3 =
513
- Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
514
-
515
- = 1.4 =
516
- Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
517
-
518
- = 1.5 =
519
- Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
520
-
521
- = 1.6 =
522
- Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
523
-
524
- = 1.6.1 =
525
- Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
526
-
527
- = 1.7 =
528
- Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
529
-
530
- = 2.0-rc4 =
531
- Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
532
-
533
- = 2.0.1 =
534
- Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
535
-
536
- = 2.0.2 =
537
- Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
538
-
539
- = 2.0.3 =
540
- Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
541
-
542
- = 2.0.4 =
543
- Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
544
-
545
- = 2.0.5 =
546
- Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
547
-
548
- = 2.0.6 =
549
- Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
550
-
551
- = 2.0.7 =
552
- Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
553
-
554
- = 2.0.8 =
555
- Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
556
-
557
- = 2.0.9 =
558
- Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
559
-
560
- = 2.0.10 =
561
- Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
562
-
563
- = 2.0.11 =
564
- Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
565
-
566
- = 2.0.12 =
567
- Requires WordPress >= 5.3 and PHP version >= 5.6.20 (>= 7.4 is recommended).
568
-
569
- = 2.0.13 =
570
- Requires WordPress >= 5.3 and PHP version >= 5.6.20 (>= 7.4 is recommended).
571
-
572
- = 2.0.14 =
573
- Requires WordPress >= 5.3 and PHP version >= 5.6.20 (>= 7.4 is recommended).
574
-
575
- = 2.0.15 =
576
- Requires WordPress >= 5.3 and PHP version >= 5.6.20 (>= 7.4 is recommended).
577
-
578
- = 2.0.16 =
579
- Requires WordPress >= 5.3 and PHP version >= 5.6.20 (>= 7.4 is recommended).
580
-
581
- = 2.0.17 =
582
- Requires WordPress >= 5.3 and PHP version >= 5.6.20 (>= 7.4 is recommended).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Easy Table of Contents ===
2
+ Contributors: magazine3
3
+ Donate link: https://magazine3.company/
4
+ Tags: table of contents, toc
5
+ Requires at least: 5.3
6
+ Tested up to: 6.0
7
+ Requires PHP: 5.6.20
8
+ Stable tag: 2.0.32
9
+ License: GPLv2 or later
10
+ License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
+
12
+ Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content.
13
+
14
+ == Description ==
15
+
16
+ A user friendly, featured focused [Easy Table of Contents](https://tocwp.com/) plugin which allows you to insert a table of contents into your posts, pages and custom post types.
17
+
18
+ [Home](https://tocwp.com/) | [Documentation](https://tocwp.com/docs/) | [Help](https://tocwp.com/contact/) | [Premium version Features](https://tocwp.com/pricing/)
19
+
20
+ ### Features
21
+ * Automatically generate a table of contents for your posts, pages and custom post types by parsing its contents for headers.
22
+ * Supports the `<!--nextpage-->` tag.
23
+ * Supports the Rank Math plugin.
24
+ * Works with the Classic Editor, Gutenberg, Divi, Elementor, WPBakery Page Builder and Visual Composer page editors.
25
+ * Optionally enable for pages and/or posts. Custom post types are supported, as long as their content is output with the `the_content()` template tag.
26
+ * Optionally auto insert the table of contents into the page, selectable by enabled post type.
27
+ * Provides many easy to understand options to configure when and where to insert the table of contents.
28
+ * Many options are available to configure how the inserted table of contents appears which include several builtin themes. If the supplied themes do no meet you needs, you can create your own by choosing you own colors for the border, background and link color.
29
+ * Multiple counter bullet formats to choose from; none, decimal, numeric and roman.
30
+ * Choose to display the table of contents hierarchical or not. This means headings of lower priority will be nested under headings of higher priority.
31
+ * User can optionally hide the table of contents. You full control of this feature. It can be disabled and you can choose to have it hidden by default.
32
+ * Supports smooth scrolling.
33
+ * Selectively enable or disabled the table of contents on a post by post basis.
34
+ * Choose which headings are used to generate the table of contents. This too can be set on a post by post basis.
35
+ * Easily exclude headers globally and on a post by post basis.
36
+ * If you rather not insert the table of contents in the post content, you can use the supplied widget and place the table of contents in your theme's sidebar.
37
+ * The widgets supports being affixed or stuck on the page so it is always visible as you scroll down the page. NOTE: this is an advanced option since every theme is different, you might need support from your theme developer to learn what the correct item selector to use in the settings to enable this feature.
38
+ * The widget auto highlights the sections currently visible on the page. The highlight color is configurable.
39
+ * Developer friendly with many action hooks and filters available. More can be added by request on [Github](https://github.com/shazahm1/Easy-Table-of-Contents). Pull requests are welcomed.
40
+
41
+ = TAKE IT A STEP FURTHER WITH EASY TABLE OF CONTENTS PRO =
42
+ With [EASY TABLE OF CONTENTS PRO](https://tocwp.com/pricing/) You will get access to more professional Settings, options and positions to really push your TOC to the next level.
43
+ * <strong>New - Gutenberg Block </strong>: Easily create TOC in Gutenberg block without the need of any coding or shortcode.
44
+ * <strong>New - Elementor Widget </strong>: Easily create TOC using Elementor Widget without the need of any coding or shortcode.
45
+ * <strong>New - Fixed/Sticky TOC </strong>: Users can find the content that they need, much faster through the option of sticky TOC.
46
+ * <strong>New - Full AMP Support </strong>: Generates a TOC with your existing setup and make it AMP compatible automatically.
47
+
48
+ ### Support
49
+
50
+ We try our best to provide support on WordPress.org forums. However, We have a special [team support](https://magazine3.company/contact/) where you can ask us questions and get help. Delivering a good user experience means a lot to us and so we try our best to reply each and every question that gets asked.
51
+
52
+ ### Bug Reports
53
+
54
+ Bug reports for Easy Table of Contents are [welcomed on GitHub](https://github.com/ahmedkaludi/Easy-Table-of-Contents). Please note GitHub is not a support forum, and issues that aren't properly qualified as bugs will be closed.
55
+
56
+ ### [JOIN TELEGRAM GROUP COMMUNITY](https://t.me/+XADGN24lHNk0YjE1/)**: Purpose of this group is to get proper suggestions and feedback from plugin users and the community so that we can make the plugin even better.
57
+
58
+ ### Live Examples
59
+
60
+ * [cMap Template Docs](http://connections-pro.com/documentation/cmap/)
61
+ * [Circled Template Docs](http://connections-pro.com/documentation/circled/)
62
+ * [Gridder Template Docs](http://connections-pro.com/documentation/gridder/)
63
+
64
+ ### Roadmap
65
+ * Fragment caching for improved performance.
66
+ * Improve SEO by adding options to add nofollow to TOC link and wrap TOC nav in noindex tag.
67
+ * Improve accessibility.
68
+ * Add Bullet and Arrow options for list counter style.
69
+
70
+ ### Credit
71
+
72
+ Easy Table Contents is a fork of the excellent [Table of Contents Plus](https://wordpress.org/plugins/table-of-contents-plus/) plugin by [Michael Tran](http://dublue.com/plugins/toc/).
73
+
74
+ ### Screenshots
75
+
76
+ 1. The General section of the settings.
77
+ 2. The Appearance section of the settings.
78
+ 3. The Advanced section of the settings.
79
+
80
+ ### Installation
81
+
82
+ = Using the WordPress Plugin Search =
83
+
84
+ 1. Navigate to the `Add New` sub-page under the Plugins admin page.
85
+ 2. Search for `easy table of contents`.
86
+ 3. The plugin should be listed first in the search results.
87
+ 4. Click the `Install Now` link.
88
+ 5. Lastly click the `Activate Plugin` link to activate the plugin.
89
+
90
+ = Uploading in WordPress Admin =
91
+
92
+ 1. [Download the plugin zip file](http://wordpress.org/plugins/easy-table-of-contents/) and save it to your computer.
93
+ 2. Navigate to the `Add New` sub-page under the Plugins admin page.
94
+ 3. Click the `Upload` link.
95
+ 4. Select Easy Table of Contents zip file from where you saved the zip file on your computer.
96
+ 5. Click the `Install Now` button.
97
+ 6. Lastly click the `Activate Plugin` link to activate the plugin.
98
+
99
+ = Using FTP =
100
+
101
+ 1. [Download the plugin zip file](http://wordpress.org/plugins/easy-table-of-contents/) and save it to your computer.
102
+ 2. Extract the Easy Table of Contents zip file.
103
+ 3. Create a new directory named `easy-table-of-contents` directory in the `../wp-content/plugins/` directory.
104
+ 4. Upload the files from the folder extracted in Step 2.
105
+ 4. Activate the plugin on the Plugins admin page.
106
+
107
+ == Changelog ==
108
+
109
+ = 2.0.32 08/16/2022
110
+ * NEW: Added Sticky Table of Content #241
111
+ * TWEAK: Improved admin UI & UX #245
112
+ * TWEAK: Audit onboarding as a first time user #243
113
+ * TWEAK: Audit default options #242 #246
114
+ * BUG: Capitalizing the first letter of each title in the table of content #252
115
+ * BUG: Need to fix the sidebar position #251
116
+
117
+ = 2.0.31.1 08/03/2022
118
+ * BUG: TOC not working with the SEOWP theme #230
119
+ * BUG: TOC rendering area’s height is always changing in sidebar #244
120
+ * BUG: The colon is getting removed from anchor links #248
121
+ * BUG: After 2.0.27 version updates making conflict with Avada theme #229
122
+ * BUG: Need to fix Easy table of content in sidebar #232
123
+ * BUG: TOC causes problems after updating my latest post #234
124
+ * BUG: TOC showing issue with video implemented posts/pages. #236
125
+ * BUG: When using TOC with Elementor then the animation content is not showing #237
126
+
127
+ = 2.0.31 07/29/2022
128
+ BUG: Elementor editor is not accessible after latest update. #235
129
+
130
+ = 2.0.30 07/28/2022 =
131
+ * NEW: Added Hook Before/After Widget Container #119
132
+ * NEW: Added wysiwyg button to Wordpress visual editor #140
133
+ * TWEAK: Sticky Sidebar TOC improvements #226
134
+ * TWEAK: Incorrect prefix in one function #227
135
+ * BUG: Conflicts with WP-Typography #135
136
+ * BUG: TOC does not show up in woocommerce product description #224
137
+
138
+
139
+ = 2.0.29 07/19/2022 =
140
+ * TWEAK: Added Oxygen pagebulider compatibility #198
141
+ * TWEAK: Added toggle state class to container #129
142
+ * TWEAK: Added Refresh Toggle State #149
143
+ * BUG: TOC not showing in WooCommerce category description #134
144
+ * BUG: TOC links not working with emoji in title #117
145
+ * BUG: TOC not running on nested excluded filters #118
146
+ * BUG: Showing incorrect excerpt in a grid with Genesis Framework and other themes #144
147
+
148
+ = 2.0.28 07/15/2022 =
149
+ * TWEAK: Added Sidebar placement option for TOC #156
150
+ * TWEAK: Added SeedProd Pro compatibility #157
151
+ * TWEAK: Added option to show the TOC content after the first paragraph #181
152
+ * BUG: TOC not working in sidebar with Blocksy theme #220
153
+ * BUG: Form elements do not have associated labels In lighthouse #219
154
+ * BUG: Alternate Heading problem with Umlauts #148
155
+
156
+ = 2.0.27 07/12/2022 =
157
+ * TWEAK: Added subscribe to newsletters form on plugin activation #216
158
+ * TWEAK: Added user feedback form on plugin deactivation #216
159
+ * TWEAK: Added option to remove special characters from TOC Headings #217
160
+ * BUG: Corner Stone page builder heading are not working #200
161
+ * BUG: The links are not working using href with pure CSS option #208
162
+ * BUG: Attribute href is missing in an anchor element due to which links cannot be crawled #210
163
+ * BUG: Debug Warnings #212
164
+
165
+ = 2.0.26 07/05/2022 =
166
+ * BUG: TOC loading method should be same for CSS and JS #199
167
+ * BUG: Custom width option should come after selecting the User Define option #201
168
+ * BUG: Function added to front.js but not present in front.min.js #202
169
+ * BUG: The custom heading is not working with WP Bakery page builder #205
170
+ * BUG: TOC not working in the Avada themes in widgets #206
171
+ * BUG: Headers in content of shortcodes are not getting showing up in TOC #209
172
+ * BUG: TOC broken for non-English titles #211
173
+
174
+ = 2.0.25 06/27/2022 =
175
+ * TWEAK: Added Migration from Table of Contents Plus and LuckyWP Table of Contents #160
176
+ * TWEAK: Added Option to add inline CSS and JS #189
177
+ * TWEAK: Added Shortcode to show hidden view on particular posts #183
178
+ * TWEAK: Added Hyphen Counter to display the TOC heading #192
179
+ * TWEAK: Added Dot Counter to display the TOC heading #180
180
+ * TWEAK: Improved the Web Accessibility in TOC Toggle #190
181
+ * BUG: Shortcodes are not rendering in TOC titles #197
182
+ * BUG: TOC heading are getting hidden in sticky header #186
183
+ * BUG: No success or error message after support request is submitted #196
184
+ * BUG: Same font size appearing in headings and sub-headings #161
185
+ * BUG: Salient core plugin conflict with last update 2.0.24.1 #207
186
+
187
+ = 2.0.24.1 06/14/2022 =
188
+ * BUG: TOC not displaying properly when initial view option is disabled #195
189
+ * BUG: Initial View option not working with Pure CSS Loading Method #194
190
+
191
+ = 2.0.24 06/10/2022 =
192
+ * TWEAK: Added TOC in Infinite Scroll #138
193
+ * TWEAK: Improved the activation process #187
194
+ * BUG: TOC Toggle not working with Magnolia Theme #174
195
+ * BUG: Initial view not working with TOC Loading Method of CSS #179
196
+ * BUG: Toggle is not visible when Display Header option is disable #171
197
+ * BUG: CSS not loading when using shortcode in theme file #175
198
+ * BUG: the_content filter run twice #182
199
+ * BUG: Form UI looks ugly #169
200
+ * BUG: Debug Warnings in multibyte string functions #185
201
+
202
+ = 2.0.23 05/31/2022 =
203
+ * TWEAK: Added filter to modify anchor links #167
204
+ * TWEAK: Added filter to add TOC before or after the sidebar widget #166
205
+ * TWEAK: Added option to align TOC to center #158
206
+ * TWEAK: Design improvements in options panel #172
207
+
208
+ = 2.0.22 05/06/2022 =
209
+ * BUG: Double hyphens are getting removed from content issue fixed #163
210
+
211
+ = 2.0.21 05/06/2022 =
212
+ * BUG: Critical error fixed #147
213
+
214
+ = 2.0.20 05/05/2022 =
215
+ * TWEAK: Added Toggle with CSS for websites runs without jQuery #153
216
+ * TWEAK: Added telegram group join link for suggestions and feedback #159
217
+ * BUG: TOC links not jumping in some posts which have special characters #163
218
+ * BUG: Incorrect email ID updated in the plugin #165
219
+ * BUG: Proper documentation added for adding TOC with shortcodes & do_shortcode #152
220
+ * BUG: TOC links not working when do_shortcode added directly in the template #147
221
+ * BUG: TOC links not working with some specical character with Elementor #162
222
+
223
+ = 2.0.19 04/16/2022 =
224
+ * Bug Fixed : While Using Elementor Page builder TOC is not working when special characters are used in headings. #150
225
+ * Bug Fixed : Need to load CSS/JS files only on the selected post types. #154
226
+
227
+ = 2.0.18 03/29/2022 =
228
+ * TWEAK: Added Technical Support Tab in Settings Panel.
229
+
230
+ = 2.0.17 03/26/2021 =
231
+ * TWEAK: Add additional check to prevent `Uncaught Error: Call to undefined function is_woocommerce()`.
232
+ * TWEAK: Ensure an instance of `ezTOC_Post ` is returned before accessing methods/properties.
233
+
234
+ = 2.0.16 02/01/2021 =
235
+ * TWEAK: Remove special characters such as fancy quotes, en and, em dashes when generating in-page anchor IDs.
236
+
237
+ = 2.0.15 01/27/2021 =
238
+ * TWEAK: Remove additional reserved characters when generating in-page anchor IDs.
239
+
240
+ = 2.0.14 01/26/2021 =
241
+ * TWEAK: Refactor debug log as a Singleton.
242
+ * TWEAK: Add additional logging to aid in debugging.
243
+ * BUG: Correct logic for PHP where empty string no longer evaluates as integer `0`.
244
+
245
+ = 2.0.13 01/25/2021 =
246
+ * TWEAK: Restrict debug logging to when `WP_DEBUG` is enabled *and* current user capability of `manage_options`.
247
+ * TWEAK: Add logging to aid in support.
248
+ * DEV: phpDoc update.
249
+
250
+ = 2.0.12 01/22/2021 =
251
+ * TWEAK: Allow `_` and `-` in anchors.
252
+ * TWEAK: Minor CSS tweaks that prevent theme from breaking the layout.
253
+ * TWEAK: Minor tweak to class initialization.
254
+ * TWEAK: Do not display the view toggle if JavaScript is broken on the site.
255
+ * TWEAK: Add the ability to enable displaying of displaying debug information on the page.
256
+ * BUG: Check for array and keys before accessing values.
257
+ * BUG: Check for array key be fore access.
258
+ * BUG: Remove reserved characters when generating in-page anchor IDs.
259
+ * DEV: Remove unnecessary vendor library files.
260
+ * DEV: Deal with phpStorm showing a warning about path not found when including files.
261
+
262
+ = 2.0.11 05/01/2020 =
263
+ * COMPATIBILITY: Add support for the Uncode theme.
264
+ * COMPATIBILITY: Do not run on WooCommerce pages.
265
+ * DEV: Correct typo in phpDoc.
266
+
267
+ = 2.0.10 04/20/2020 =
268
+ * TWEAK: Add trailing `span` to heading, to prepare for `#` option and to fix duplicate heading title matching.
269
+ * TWEAK: Add second heading search/replace function to search for heading in content with heading html entities decoded. May help Beaver Builder users as it seems like it does not encode HTML entities as WP core does.
270
+
271
+
272
+ = 2.0.9 04/08/2020 =
273
+ * TWEAK: AMP/Caching plugins seems to break anchors with colons and periods even though they are valid characters for the id attribute in HTML5.
274
+ * TWEAK: Replace multiple underscores with a single underscore.
275
+ * DEV: Update the UWS library which fixes the deprecation notice for PHP 7.4.
276
+ * DEV: Add phpcs.xml.dist.
277
+ * DEV: Strict type checks.
278
+ * DEV: Inline doc updates.
279
+
280
+ = 2.0.8 04/03/2020 =
281
+ * TWEAK: Convert `<br />` tags in headings to a space.
282
+ * TWEAK: Add additional widget classes.
283
+ * TWEAK: Improve the sanitization of the excluded headings field post setting.
284
+ * TWEAK: Minor optimization of creating the matching pattern for excluding headings for improved performance.
285
+ * COMPATIBILITY: Exclude Create by Mediavine from heading eligibility.
286
+ * BUG: Ensure excluded headings are removed from the headings array.
287
+ * BUG: Ensure empty headings are removed from the headings array.
288
+
289
+ = 2.0.7 04/02/2020 =
290
+ * NEW: Exclude any HTML nodes with the class of `.ez-toc-exclude-headings`.
291
+ * TWEAK: Change smooth scroll selector from `'body a'` to `'a.ez-toc-link'`.
292
+ * TWEAK: Declare JS variables.
293
+ * TWEAK: Support unicode characters for the `id` attribute. Permitted by HTML5.
294
+ * TWEAK: Move the in-page anchor/span to before the heading text to account for long headings where it line wraps.
295
+ * TWEAK: Slight rework to ezTOC widget container classes logic.
296
+ * TWEAK: Cache bust the JS to make dev easier.
297
+ * TWEAK: JavaScript cleanup.
298
+ * TWEAK: URI Encode the id attribute to deal with reserved characters in JavaScript. Technically not necessary for the id attribute but needed to work with the jQuery smoothScroll library.
299
+ * COMPATIBILITY: Reintroduce filter to exclude Ultimate Addons for VC Composer Tabs from heading eligibility.
300
+ * BUG: Correct array iteration logic when processing headings.
301
+ * BUG: Tighten matching for headings in excluded HTML nodes. The loose matching was excluding far too many headings.
302
+ * BUG: Use `esc_attr()` instead of `esc_url()` for the anchor href because valid id attribute characters would cause it to return an empty href which cause a nonworking link.
303
+
304
+ = 2.0.6 03/30/2020 =
305
+ * BUG: Ensure minified files are current.
306
+
307
+ = 2.0.5 03/27/2020 =
308
+ * BUG: Prevent possible "strpos(): Empty needle in" warnings when excluding nodes from TOC eligibility.
309
+
310
+ = 2.0.4 03/16/2020 =
311
+ * NEW: Introduce the `ez_toc_container_class` filter.
312
+ * TWEAK: Slight rework to ezTOC container classes logic.
313
+ * BUG: `sprintf()` was eating `%` in the TOC heading item.
314
+ * BUG: Do not insert TOC at top of post if before first heading option is selected even if first heading can not be found. Some page builders cause the TOC to insert twice or on blog pages.
315
+
316
+ = 2.0.3 03/12/2020 =
317
+ * TWEAK: Slightly tighten heading matching, last update made it a little too loose.
318
+ * BUG: Correct logic required to place TOC before first heading which is required for the more lax heading matching required for page builders.
319
+
320
+ = 2.0.2 03/12/2020 =
321
+ * COMPATIBILITY: Remove filter to exclude Ultimate Addons for VC Composer Tabs from heading eligibility.
322
+ * COMPATIBILITY: Add additional filters to improve Elementor compatibility.
323
+ * TWEAK: Loosen heading matching when doing find/replace to insert in page links. Excluding the opening heading tag to allow matching heading where page builders dynamically add classes and id which break heading matching during find/replace.
324
+
325
+ = 2.0.1 03/09/2020 =
326
+ * COMPATIBILITY: Exclude the WordPress Related Posts plugin nodes.
327
+ * COMPATIBILITY: Exclude a couple Atomic Block plugin nodes.
328
+ * COMPATIBILITY: Exclude JetPack Related Posts from heading eligibility.
329
+ * COMPATIBILITY: Exclude Ultimate Addons for VC Composer Tabs from heading eligibility.
330
+ * COMPATIBILITY: Exclude WP Product Reviews from heading eligibility.
331
+ * TWEAK: Prevent possible "strpos(): Empty needle in" warnings when excluding nodes from TOC eligibility.
332
+
333
+ = 2.0 02/01/2020 =
334
+ * NEW: Major rewrite of all code and processing logic to make it faster and more reliable.
335
+ * NEW: Support for the <!--nextpage--> tag.
336
+ * NEW: Introduce helper functions for devs.
337
+ * NEW: Support WPML.
338
+ * NEW: Support Polylang.
339
+ * NEW: Add filter to support the Rank Math plugin.
340
+ * NEW: Introduce the `ez_toc_maybe_apply_the_content_filter` filter.
341
+ * TWEAK: Improve translation compatibility.
342
+ * TWEAK: Rework widget logic to allow multi-line TOC items, improve active item highlighting while removing the use of the jQuery Waypoints library.
343
+ * TWEAK Add additional classes to TOC list items.
344
+ * TWEAK: Add WOFF2 format for icon format and change font references in CSS.
345
+ * TWEAK: Add font-display: swap for toggle icon.
346
+ * TWEAK: Update JS Cookie to 2.2.1.
347
+ * TWEAK: Update jQuery Smooth Scroll to 2.2.0.
348
+ * TWEAK: Allow forward slash and angle brackets in headings and alternate headings.
349
+ * TWEAK: Allow forward slash in excluded headings.
350
+ * TWEAK: Remove new line/returns when matching excluded headings.
351
+ * TWEAK: Simple transient cache to ensure a post is only processed once per request for a TOC.
352
+ * TWEAK: Improve sanitization of alternate headings field value.
353
+ * TWEAK: Deal with non-breaking-spaces in alternate headings.
354
+ * TWEAK: Add the ability to exclude by selector content eligible to be included in the TOC.
355
+ * TWEAK: Change the shortcode priority to a higher value.
356
+ * TWEAK: Add filter to remove shortcodes from the content prior to the `the_content` filter being run to exclude shortcode content from being eligible as TOC items.
357
+ * TWEAK: Add compatibility filters to remove shortcodes for Connections and Striking theme to remove them from eligible TOC item content.
358
+ * TWEAK: Do not execute if root current filter is the `wp_head` or `get_the_excerpt` filters.
359
+ * TWEAK: Add filter to exclude content by selector.
360
+ * TWEAK: Move in-page anchor to after the heading instead of wrapping the heading to prevent conflicts with theme styling.
361
+ * TWEAK: Utilize the `ez_toc_exclude_by_selector` filter the exclude the JetPack share buttons from eligible headings.
362
+ * TWEAK: Remove the Elegant Themes Bloom plugin node from the post content before extracting headings.
363
+ * TWEAK: Add compatibility filter for the Visual Composer plugin.
364
+ * TWEAK: Utilize the `ez_toc_exclude_by_selector` filter the exclude the Starbox author heading from eligible headings.
365
+ * I18N: Add wpml-config.xml file.
366
+ * BUG: Correct option misspelling.
367
+ * BUG: Do not need to run values for alternate and exclude headings thru `wp_unslash()` because `update_post_meta()` already does.
368
+ * BUG: Do not need to run `stripslashes()` when escaping the alternate heading value.
369
+ * BUG: Sanitize the excluded heading string before saving post meta.
370
+ * DEV: Change PHP keywords to comply with PSR2.
371
+ * DEV:Bump minimum PHP version to 5.6.20 which matches WP core.
372
+
373
+ = 1.7 05/09/2018 =
374
+ * NEW: Introduce the `ez_toc_shortcode` filter.
375
+ * TWEAK: Fix notices due to late eligibility check. props unixtam
376
+ * TWEAK: Tweak eligibility check to support the TOC widget.
377
+ * TWEAK: Prefix a few CSS classes in order to prevent collisions with theme's and other plugins.
378
+ * TWEAK: Avoid potential PHP notice in admin when saving the post by checking for nonce before validating it.
379
+ * TWEAK: Using the shortcode now overrides global options.
380
+ * TWEAK: `the_content()` now caches result of `is_eligible()`.
381
+ * TWEAK: Refactor to pass the WP_Post object internally vs. accessing it via the `$wp_query->post` which may not in all cases exist.
382
+ * TWEAK: Use `pre_replace()` to replace one or more spaces with an underscore.
383
+ * TWEAK: Return original title in the `ez_toc_url_anchor_target` filter.
384
+ * TWEAK: Strip `&nbsp;`, replacing it with a space character.
385
+ * TWEAK: Minor tweaks to the in page URL creating.
386
+ * TWEAK: Wrap TOC list in a nav element.
387
+ * TWEAK: Init plugin on the `plugins_loaded` hook.
388
+ * TWEAK: Tweak the minimum number of headers to 1.
389
+ * BUG: The header options from the post meta should be used when building the TOC hierarchy, not the header options from the global settings.
390
+ * BUG: Do not double escape field values.
391
+ * BUG: Ensure Apostrophe / Single quote use in Exclude Headings work.
392
+ * OTHER: Update CSS to include the newly prefixed classes.
393
+ * DEV: Remove some commented out unused code.
394
+
395
+ = 1.6.1 03/16/2018 =
396
+ * TWEAK: Revert change made to allow HTML added via the `ez_toc_title` filter as it caused undesirable side effects.
397
+ * BUG: Ensure Smooth Scroll Offset is parsed as an integer.
398
+
399
+ = 1.6 03/15/2018 =
400
+ * NEW: Add `px` option for font size unit.
401
+ * NEW: Add title font size and weight settings options.
402
+ * NEW: Add the Mobile Smooth Scroll Offset option.
403
+ * TWEAK: Change default for font size unit from `px` to `%` to match the default options values.
404
+ * TWEAK: Correct CSS selector so margin is properly applied between the title and TOC items.
405
+ * TWEAK: Honor HTML added via `ez_toc_title` filter.
406
+ * TWEAK: Ensure the ezTOC content filter is not applied when running `the_content` filter.
407
+ * TWEAK: Only enqueue the javascript if the page is eligible for a TOC.
408
+ * TWEAK: Update icomoon CSS to remove unecessary CSS selectors to prevent possible conflicts.
409
+ * TWEAK: The smooth scroll offset needs to be taken into account when defining the offset_top property when affixing the widget.
410
+ * OTHER: Update frontend minified CSS file.
411
+ * OTHER: Update the frontend minified javascript file.
412
+ * DEV: phpDoc corrections.
413
+
414
+ = 1.5 02/20/2018 =
415
+ * BUG: Correct CSS selector to properly target the link color.
416
+ * OTHER: Update the WayPoints library.
417
+ * DEV: Add a couple @todo's.
418
+
419
+ = 1.4 01/29/2018 =
420
+ * TWEAK: Change text domain from ez_toc to easy-table-of-contents.
421
+ * TWEAK: Rename translation files with correct text domain.
422
+ * BUG: Ensure page headers are processed to add the in page header link when using the shortcodes.
423
+ * BUG: Add forward slash to domain path in the plugin header.
424
+ * I18N: Update POT file.
425
+ * I18N: Update Dutch (nl_NL) translation.
426
+
427
+ = 1.3 12/18/2017 =
428
+ * FEATURE: Add support for the `[ez-toc]` shortcode.
429
+ * NEW: For backwards compatibility with "Table of Content Plus", register the `[toc]` shortcode.
430
+ * NEW: Introduce the `ez_toc_extract_headings_content` filter.
431
+ * TWEAK: Update the tested to and required readme header text.
432
+ * TWEAK: Do not show the widget on the 404, archive, search and posts pages.
433
+ * I18N: Add the nl_NL translation.
434
+
435
+ = 1.2 04/29/2016 =
436
+ * TWEAK: Remove the font family from styling the TOC title header.
437
+ * TWEAK: Pass the raw title to the `ez_toc_title` filter.
438
+ * BUG: A jQuery 1.12 fix for WordPress 4.5.
439
+
440
+ = 1.1 02/24/2016 =
441
+ * FEATURE: Add option to replace header wither alternate header text in the table of content.
442
+ * NEW: Introduce the ez_toc_filter.
443
+ * NEW: Introduce ezTOC_Option::textarea() to render textareas.
444
+ * NEW: Introduce array_search_deep() to recursively search an array for a value.
445
+ * TWEAK: Run table of contents headers thru wp_kses_post().
446
+ * TWEAK: Escape URL.
447
+ * TWEAK: Count excluded headings only once instead of multiple times.
448
+ * TWEAK: Escape translated string before rendering.
449
+ * TWEAK: Use wp_unslash() instead of stripslashes().
450
+ * TWEAK: Escape translated string.
451
+ * BUG: Fix restrict path logic.
452
+ * OTHER: Readme tweaks.
453
+ * I18N: Add POT file.
454
+ * I18N: Add Dutch translation.
455
+ * DEV: Update .gitignore to allow PO files.
456
+ * DEV: phpDoc fix.
457
+
458
+ = 1.0 09/08/2015 =
459
+ * Initial release.
460
+ - Complete refactor and restructure of the original code for better design and separation of function to make code base much easier to maintain and extend.
461
+ - Update all third party libraries.
462
+ - Make much better use of the WordPress Settings API.
463
+ - Minified CSS and JS files are used by default. Using SCRIPT_DEBUG will use the un-minified versions.
464
+ - Add substantial amounts of phpDoc for developers.
465
+ - Add many hooks to permit third party integrations.
466
+ - Widget can be affixed/stuck to the page so it is always visible.
467
+ - Widget will highlight the table of content sections that are currently visible in the browser viewport.
468
+ - Widget will now generate table of contents using output from third party shortcodes.
469
+ - Use wpColorPicker instead of farbtastic.
470
+ - Remove all shortcodes.
471
+ - Per post options are saved in post meta instead of set by shortcode.
472
+
473
+ == Frequently Asked Questions ==
474
+
475
+ = Ok, I've installed this... what do I do next? =
476
+
477
+ You first stop should be the Table of Contents settings admin page. You can find this under the Settings menu item.
478
+
479
+ You first and only required decision is you need to decide which post types you want to enable Table of Contents support for. By default it is the Pages post type. If on Pages is the only place you plan on using Table of Contents, you have nothing to do on the Settings page. To keep things simple, I recommend not changing any of the other settings at this point. Many of the other settings control when and where the table of contents is inserted and changing these settings could cause it not to display making getting started a bit more difficult. After you get comfortable with how this works... then tweak away :)
480
+
481
+ With that out of the way make sure to read the **How are the tables of contents created?** FAQ so you know how the Table of Contents is automatically generated. After you have the page headers setup, or before, either way... Scroll down on the page you'll see a metabox named "*Table of Contents*", enable the *Insert table of contents.* option and Update and/or Publish you page. The table of contents should automatically be shown at the top of the page.
482
+
483
+ = How are the tables of contents created? =
484
+
485
+ The table of contents is generated by the headers found on a page. Headers are the [`<h1>,<h2>,<h3>,<h4>,<h5>,<h6>` HTML tags](http://www.w3schools.com/tags/tag_hn.asp). If you are using the WordPres Visual Post Editor, these header tags are used and inserted into the post when you select one of the [*Heading n* options from the formatting drop down](http://torquemag.io/wordpress-heading-tags/). Each header that is found on the page will create a table of content item. Here's an example which will create a table of contents containing the six items.
486
+
487
+ `<h1>Item 1</h1>
488
+ <h1>Item 2</h1>
489
+ <h1>Item 3</h1>
490
+ <h1>Item 4</h1>
491
+ <h1>Item 5</h1>
492
+ <h1>Item 6</h1>`
493
+
494
+ You can also create "nested" table of contents. This is difficult to explain so I'll illustrate building on the previous example. In this example a table of contents will be created with the same six items but now the first three will each an child item nested underneath it. The indentation is not necessary, it was only added for illustration purposes.
495
+
496
+ `<h1>Item 1</h1>
497
+ <h2>Item 1.1 -- Level 2</h2>
498
+ <h1>Item 2</h1>
499
+ <h2>Item 2.1 -- Level 2</h2>
500
+ <h1>Item 3</h1>
501
+ <h2>Item 3.1 -- Level 2</h2>
502
+ <h1>Item 4</h1>
503
+ <h1>Item 5</h1>
504
+ <h1>Item 6</h1>`
505
+
506
+ You are not limited to a single a single nested item either. You can add as many as you need. You can even create multiple nested levels...
507
+
508
+ `<h1>Item 1</h1>
509
+ <h2>Item 1.1 -- Level 2</h2>
510
+ <h3>Item 1.1.1 -- Level 3</h3>
511
+ <h3>Item 1.1.2 -- Level 3</h3>
512
+ <h3>Item 1.1.3 -- Level 3</h3>
513
+ <h2>Item 1.2 -- Level 2</h2>
514
+ <h3>Item 1.2.1 -- Level 3</h3>
515
+ <h3>Item 1.2.2 -- Level 3</h3>
516
+ <h3>Item 1.2.3 -- Level 3</h3>
517
+ <h2>Item 1.3 -- Level 2</h2>
518
+ <h1>Item 2</h1>
519
+ <h2>Item 2.1 -- Level 2</h2>
520
+ <h2>Item 2.2 -- Level 2</h2>
521
+ <h1>Item 3</h1>
522
+ <h2>Item 3.1 -- Level 2</h2>
523
+ <h2>Item 3.2 -- Level 2</h2>
524
+ <h1>Item 4</h1>
525
+ <h1>Item 5</h1>
526
+ <h1>Item 6</h1>`
527
+
528
+ You can nest up 6 levels deep if needed. I hope this helps you understand how to create and build your own auto generated table of contents on your sites!
529
+
530
+ = Is there any shortcode to add the table of content to anywhere I want ? =
531
+
532
+ Yes you can add the TOC with this shortcode – [ez-toc] and with the help of this you can easily add the TOC in the content or anywhere in the WordPress and if you want to add the shortcode on the theme file then you can add it with the help of this code – <?php echo do_shortcode( ‘[ez-toc]’ ); ?> and with this, you can add the TOC on any file according to your need.
533
+
534
+ == Upgrade Notice ==
535
+
536
+ = 1.0 =
537
+ Initial release.
538
+
539
+ = 1.3 =
540
+ Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
541
+
542
+ = 1.4 =
543
+ Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
544
+
545
+ = 1.5 =
546
+ Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
547
+
548
+ = 1.6 =
549
+ Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
550
+
551
+ = 1.6.1 =
552
+ Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
553
+
554
+ = 1.7 =
555
+ Requires WordPress >= 4.4 and PHP >= 5.3. PHP version >= 7.1 recommended.
556
+
557
+ = 2.0-rc4 =
558
+ Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
559
+
560
+ = 2.0.1 =
561
+ Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
562
+
563
+ = 2.0.2 =
564
+ Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
565
+
566
+ = 2.0.3 =
567
+ Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
568
+
569
+ = 2.0.4 =
570
+ Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
571
+
572
+ = 2.0.5 =
573
+ Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
574
+
575
+ = 2.0.6 =
576
+ Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
577
+
578
+ = 2.0.7 =
579
+ Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
580
+
581
+ = 2.0.8 =
582
+ Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
583
+
584
+ = 2.0.9 =
585
+ Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
586
+
587
+ = 2.0.10 =
588
+ Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
589
+
590
+ = 2.0.11 =
591
+ Requires WordPress >= 5.0 and PHP version >= 5.6.20 (>= 7.1 is recommended).
592
+
593
+ = 2.0.12 =
594
+ Requires WordPress >= 5.3 and PHP version >= 5.6.20 (>= 7.4 is recommended).
595
+
596
+ = 2.0.13 =
597
+ Requires WordPress >= 5.3 and PHP version >= 5.6.20 (>= 7.4 is recommended).
598
+
599
+ = 2.0.14 =
600
+ Requires WordPress >= 5.3 and PHP version >= 5.6.20 (>= 7.4 is recommended).
601
+
602
+ = 2.0.15 =
603
+ Requires WordPress >= 5.3 and PHP version >= 5.6.20 (>= 7.4 is recommended).
604
+
605
+ = 2.0.16 =
606
+ Requires WordPress >= 5.3 and PHP version >= 5.6.20 (>= 7.4 is recommended).
607
+
608
+ = 2.0.17 =
609
+ Requires WordPress >= 5.3 and PHP version >= 5.6.20 (>= 7.4 is recommended).
assets/css/admin.css CHANGED
@@ -1,1243 +1,1243 @@
1
- div.tab_content table {
2
- margin-bottom: 1em;
3
- }
4
- table.more_toc_options_table th, table.more_toc_options_table td {
5
- padding: 0;
6
- margin: 0;
7
- }
8
- table.more_toc_options_table th {
9
- width: auto;
10
- padding-right: 4px;
11
- padding-top: 2px;
12
- }
13
- div.tab_content ul li {
14
- margin-left: 2em;
15
- list-style-type: disc;
16
- }
17
- div.tab_content ol li {
18
- list-style: inherit;
19
- }
20
- div.tab_content pre {
21
- margin-left: 2em;
22
- }
23
- ul#tabbed-nav {
24
- margin-top: 1em;
25
- }
26
- #tabbed-nav {
27
- margin: 0;
28
- padding: 0;
29
- float: left;
30
- list-style: none;
31
- height: 32px;
32
- border-bottom: 1px solid #DFDFDF;
33
- border-left: 1px solid #DFDFDF;
34
- width: 100%;
35
- }
36
- #tabbed-nav li {
37
- float: left;
38
- margin: 0;
39
- padding: 0;
40
- height: 31px;
41
- line-height: 31px;
42
- border: 1px solid #DFDFDF;
43
- border-left: none;
44
- margin-bottom: -1px;
45
- overflow: hidden;
46
- position: relative;
47
- background: #F5F5F5;
48
- background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#F5F5F5));
49
- background-image: -webkit-linear-gradient(center top, #fff, #F5F5F5);
50
- background-image: -moz-linear-gradient(center top, #fff, #F5F5F5);
51
- background-image: -ms-linear-gradient(center top, #fff, #F5F5F5);
52
- background-image: -o-linear-gradient(center top, #fff, #F5F5F5);
53
- background-image: linear-gradient(center top, #fff, #F5F5F5);
54
- }
55
- #tabbed-nav li a {
56
- text-decoration: none;
57
- color: #000;
58
- display: block;
59
- font-size: 1.2em;
60
- padding: 0 20px;
61
- border: 1px solid #fff;
62
- outline: none;
63
- }
64
- #tabbed-nav li a:hover {
65
- background: #ECECEC;
66
- }
67
- html #tabbed-nav li.active, html #tabbed-nav li.active a:hover {
68
- background: #fff;
69
- border-bottom: 1px solid #fff;
70
- }
71
- div.tab_container {
72
- border: 1px solid #DFDFDF;
73
- border-top: none;
74
- overflow: hidden;
75
- clear: both;
76
- float: left; width: 100%;
77
- background: #fff;
78
- margin-bottom: 2em;
79
- padding-bottom: 2em;
80
- }
81
- div.tab_content {
82
- padding: 10px;
83
- padding-bottom: 0;
84
- font-size: 1em;
85
- }
86
- h3 span.show_hide {
87
- font-size: 0.85em;
88
- font-weight: normal;
89
- }
90
- div.more_toc_options {
91
- margin-top: 4px;
92
- margin-left: 2em;
93
- }
94
- div.toc_theme_option {
95
- width: 200px;
96
- float: left;
97
- margin-right: 5px;
98
- }
99
- #wpcontent select optgroup option {
100
- padding-left: 15px;
101
- }
102
- input#width_custom,
103
- input#font_size,
104
- input#child_font_size,
105
- input#smooth_scroll_offset {
106
- width: 50px;
107
- text-align: center;
108
- }
109
- input.custom_colour_option {
110
- width: 75px;
111
- }
112
- table#theme_custom, div#farbtastic_colour_wheel {
113
- float: left;
114
- }
115
- table#theme_custom {
116
- margin-top: 30px;
117
- }
118
- table#theme_custom img {
119
- vertical-align: middle;
120
- opacity: 0.4;
121
- }
122
- table#theme_custom img:hover {
123
- cursor: pointer;
124
- opacity: 1;
125
- }
126
- div#farbtastic_colour_wheel {
127
- margin-left: 20px;
128
- }
129
- #tab3 h3:not(:first-child) {
130
- margin-top: 2em;
131
- }
132
-
133
- /* My styles */
134
- #toc input.small-text {
135
- width: 50px;
136
- padding: 2px;
137
- height: 28px;
138
- line-height: 28px;
139
- vertical-align: bottom;
140
- }
141
-
142
- #toc .form-table tr > th > strong {
143
- font-size: 18px;
144
- font-style: italic;
145
- }
146
- /* Tab panel styles */
147
- .postbox{
148
- padding: 10px;
149
- }
150
- html {
151
- scroll-behavior: smooth;
152
- }
153
- .toc-tab-panel {
154
- overflow: hidden;
155
- border: 1px solid #ccc;
156
- background-color: #fff;
157
- margin-top: 15px;}
158
- .toc-tab-panel a {
159
- background-color: inherit;
160
- text-decoration: none;
161
- float: left;
162
- border: none;
163
- outline: none;
164
- cursor: pointer;
165
- padding: 14px 16px;
166
- transition: 0s;
167
- font-size: 15px;
168
- color: #2271b1;
169
- font-weight: 500;
170
- }
171
- .toc-tab-panel a:hover {
172
- color: #0a4b78;
173
- }
174
- .toc-tab-panel a.active {
175
- box-shadow: none;
176
- border-bottom: 4px solid #646970;
177
- color: #1d2327;
178
- }
179
- .toc-tab-panel a:focus {
180
- box-shadow: none;
181
- outline: none;
182
- }
183
- .eztoc-tabcontent {
184
- display: none;
185
- border-top: none;
186
- animation: fadeEffect 1s;
187
- }
188
- #technical .eztoc-form-page-ui{
189
- display:flex;
190
- background: #fff;
191
- width: auto;
192
- height: auto;
193
- }
194
- #technical .eztoc-left-side{
195
- width: 70%;
196
-
197
- }
198
- .eztoc-right-side{
199
- width: 31%;
200
- margin-top: auto;
201
- margin-bottom: auto;
202
- text-align: center;
203
-
204
- }
205
- .eztoc-tabcontent {
206
- display: none;
207
- border-top: none;
208
- }
209
- #technical {
210
- background: #fff;
211
- margin-top: 10px;
212
- padding: 28px;
213
- padding: 15px 28px 28px 28px;
214
- min-width: 255px;
215
- box-shadow: 0 1px 1px rgb(0 0 0 / 4%);
216
- }
217
- /* #technical p{
218
- line-height: 0.5rem;
219
- } */
220
- #technical-form{
221
-
222
- width: 60%;
223
- }
224
- .support-label {
225
- margin-top: 4px;
226
- float: left;
227
- width: 70px;
228
-
229
- font-size: 14px;
230
- }
231
-
232
- .star-mark{
233
- color: red;
234
- margin-left: 4px;
235
- font-family: bold;
236
- }
237
- #technical li {
238
- margin:25px 0px 20px 0px;
239
- margin:10px 0px 10px 0px;
240
- list-style: none;
241
- }
242
- .eztoc_support_div_form{
243
- margin-top: 23px;
244
- }
245
- .eztoc-customer-type{
246
- display: block;
247
- }
248
- .support-input select{
249
- border-radius: 4px;
250
- margin-top: -7px;
251
- }
252
- .eztoc_dev-bio{
253
- display: block;
254
- }
255
- .ezoc-bio-wrap{
256
- float: left;
257
- text-align: center;
258
- width: 33.33%;
259
- text-transform: uppercase;
260
- }
261
- .ezoc-bio-wrap p{
262
- width: auto;
263
- font-size: 10px;
264
- color: #555;
265
- margin: 0px 0 20px 0;
266
- }
267
- .ezoc-bio-wrap img{
268
- margin: 25px 0 0 0;
269
- border-radius: 50%;
270
- }
271
- .eztoc-bio-box{
272
- background: #fff;
273
- border: 1px solid #ccc;
274
- padding: 15px 20px;
275
- border-radius: 4px;
276
- margin: 15px 15px 15px 0;
277
- /* height: 22rem; */
278
- padding: 0px 20px;
279
- }
280
- .eztoc-bio-box:hover{
281
- box-shadow: 5px 5px 8px #888888;
282
- }
283
- .eztoc-p{
284
- font-size: 15px;
285
- margin: 20px auto 0px auto;
286
- text-align: center;
287
- }
288
- .eztoc-p{
289
- line-height: 1.5rem;
290
- padding: 0 25px;
291
- margin-top: 10px;
292
- font-size: 16px;
293
- }
294
- .eztoc-bio-box h1{
295
- margin: 8px auto 0px auto;
296
- text-align: center;
297
- font-weight: bolder;
298
- }
299
- .eztoc_boxdesk{
300
- clear: left;
301
- font-size: 15px;
302
- text-align: center;
303
- margin: 20px 0 0 0;
304
-
305
- }
306
- .company-link{
307
- font-weight: 500;
308
- margin: 20px 0 0 0;
309
- }
310
- .company-link a{
311
-
312
- display: table;
313
- background: #e91e63;
314
- width: auto;
315
- margin: 0 auto;
316
- padding: 7px 25px;
317
- color: #fff;
318
- text-decoration: none;
319
- margin-top: 10px;
320
- margin-bottom: 15px;
321
- border-radius: 6px;
322
- border: 0;
323
- /* text-transform: uppercase; */
324
- font-size: 16px;
325
-
326
- }
327
- .eztoc-send-query{
328
- background: #2271b1;
329
- border-color: #2271b1;
330
- color:#fff;
331
- text-decoration: none;
332
- text-shadow: none;
333
- margin-left: 70px !important;;
334
- }
335
-
336
- @media screen and (min-width: 870px) and (max-width: 1300px ){
337
- .eztoc-bio-box{
338
- padding-top: 20px;
339
- height: 29.1rem;;
340
- }
341
- .eztoc-bio-box h1{
342
- font-size: 20px;
343
- }
344
- .eztoc-bio-box p{
345
- font-size: 13px;
346
- margin: 20px auto 0px auto;
347
- }
348
- .ezoc-bio-wrap img{
349
- width: 30px;
350
- height: 30px;
351
- }
352
- .ezoc-bio-wrap p{
353
- width: 55px;
354
- font-size: 12px;
355
- margin-bottom: 10px;
356
- }
357
-
358
- }
359
- @keyframes fadeEffect { from {opacity: 0;} to {opacity: 1;} }
360
-
361
-
362
- .eztoc-wrapper{
363
- max-width: 100%;
364
- width: 100%;
365
- display: flex;
366
- flex-wrap: wrap;
367
- margin: auto;
368
- }
369
-
370
- .eztoc-wrapper .table{
371
- margin: 0 auto;
372
- background: #fff;
373
- width: calc(30%);
374
- padding: 30px 20px;
375
- position: relative;
376
- box-shadow: 0 5px 10px rgb(0 0 0 / 10%);
377
- }
378
-
379
- .table .price-section{
380
- display: flex;
381
- justify-content: center;
382
- }
383
-
384
- .price-section .price-area{
385
- height: 120px;
386
- width: 120px;
387
- background: #ffd861;
388
- border-radius: 50%;
389
- padding: 2px;
390
- }
391
-
392
- .price-section .price-area .inner-area{
393
- height: 100%;
394
- width: 100%;
395
- border-radius: 50%;
396
- border: 3px solid #fff;
397
- color: #fff;
398
- line-height: 117px;
399
- text-align: center;
400
- position: relative;
401
- }
402
-
403
- .price-area .inner-area .text{
404
- font-size: 25px;
405
- font-weight: 400;
406
- position: absolute;
407
- top: -10px;
408
- left: 17px;
409
- }
410
-
411
- .price-area .inner-area .price{
412
- font-size: 55px;
413
- font-weight: 500;
414
- }
415
-
416
- .table .package-name{
417
- width: 100%;
418
- height: 2px;
419
- background: #ffecb3;
420
- margin: 35px 0;
421
- position: relative;
422
- }
423
-
424
- .table .package-name::before{
425
- position: absolute;
426
- content: "Basic";
427
- top: 50%;
428
- left: 50%;
429
- transform: translate(-50%, -50%);
430
- background: #fff;
431
- font-size: 25px;
432
- padding: 0 10px;
433
- font-weight: bolder;
434
- }
435
-
436
- .table .features li{
437
- list-style: none;
438
- display: flex;
439
- justify-content: space-between;
440
- margin-bottom: 15px;
441
- }
442
-
443
- .features li .list-name{
444
- font-size: 17px;
445
- font-weight: 400;
446
- }
447
-
448
- .features li .icon{
449
- font-size: 15px;
450
- }
451
-
452
- .features li .icon.check{
453
- color: #2db94d;
454
- }
455
-
456
- .features li .icon.cross{
457
- color: #cd3241;
458
- }
459
-
460
- .table .btn{
461
- display: flex;
462
- justify-content: center;
463
- margin-top: 35px;
464
- }
465
-
466
- .table .btn button{
467
- width: 80%;
468
- height: 50px;
469
- font-weight: 700;
470
- color: #fff;
471
- font-size: 20px;
472
- border: none;
473
- outline: none;
474
- border-radius: 25px;
475
- cursor: pointer;
476
- transition: all 0.3s ease;
477
- }
478
-
479
- .basic .price-area,
480
- .basic .inner-area{
481
- background: #ffd861;
482
- }
483
-
484
- .basic .btn button{
485
- background: #fff;
486
- color: #ffd861;
487
- border: 2px solid #ffd861;
488
- }
489
-
490
- .basic .btn button:hover{
491
- border-radius: 6px;
492
- background: #ffd861;
493
- color: #fff;
494
- }
495
-
496
- .Premium .price-area,
497
- .Premium .inner-area{
498
- background: #a26bfa;
499
- }
500
-
501
- .Premium .btn button{
502
- background: #fff;
503
- color: #a26bfa;
504
- border: 2px solid #a26bfa;
505
- }
506
-
507
- .Premium .btn button:hover{
508
- border-radius: 6px;
509
- background: #a26bfa;
510
- color: #fff;
511
- }
512
-
513
-
514
- .basic .package-name{
515
- background: #ffecb3;
516
- }
517
-
518
- .Premium .package-name{
519
- background: #a26bfa;
520
- }
521
-
522
-
523
-
524
- .basic .package-name::before{
525
- content: "Free";
526
- }
527
-
528
- .Premium .package-name::before{
529
- content: "PRO";
530
- }
531
-
532
-
533
-
534
- .basic ::selection,
535
- .basic .price-area,
536
- .basic .inner-area{
537
- background: #ffd861;
538
- }
539
-
540
- .Premium ::selection,
541
- .Premium .price-area,
542
- .Premium .inner-area{
543
- background: #a26bfa;
544
- }
545
-
546
- div#eztoc-tabs a {
547
- text-decoration: none;
548
- }
549
- div#eztoc-tabs a:first-child {
550
- color: #000;
551
- }
552
-
553
- #the-list{position: relative;}
554
- .eztoc-wr {
555
- width: 100%;
556
- margin: 0 auto;
557
- position: relative
558
- }
559
-
560
- .etoc-eztoc-img {
561
- width: 100%;
562
- margin: 0 auto;
563
- text-align: center;
564
- position: relative;
565
- line-height: 0;
566
- height: 300px;
567
- }
568
-
569
- .eztoc-img img {
570
- position: relative
571
- }
572
-
573
- .sp_ov {
574
- background: rgba(234, 76, 137, 1);
575
- bottom: 0;
576
- left: 0;
577
- position: absolute;
578
- right: 0;
579
- top: 0;
580
- }
581
-
582
- .etoc-eztoc-cnt {
583
- position: absolute;
584
- top: 40px;
585
- bottom: 0;
586
- left: 40px;
587
- right: 40px;
588
- margin: 0 auto;
589
- text-align: center
590
- }
591
-
592
- .etoc-eztoc-cnt h1 {
593
- font-size: 60px;
594
- color: #fff;
595
- font-weight: 600;
596
- }
597
-
598
- .etoc-eztoc-cnt p {
599
- margin-top: 0px;
600
- color: #371b24;
601
- font-size: 18px;
602
- padding: 0 100px;
603
- line-height: 1.4;
604
- font-weight: 500;
605
- }
606
-
607
- .etoc-eztoc-cnt .buy {
608
- border-width: 0px !important;
609
- font-size: 1.25rem;
610
- line-height: 2;
611
- text-decoration: none;
612
- background: white !important;
613
- border-radius: 8px !important;
614
- font-size: 16px !important;
615
- padding: 12px 18px;
616
- color: rgba(234, 76, 137, 1) !important;
617
- font-weight: 500;
618
- }
619
- .etoc-eztoc-cnt .buy:hover{
620
- box-shadow: 0px 2px 2px #999;
621
- background: linear-gradient(to left, #fdfc35, #ffe258) !important;
622
- }
623
- .pvf {
624
- position: relative;
625
- top: -16px;
626
- border: 1px solid #eee;
627
- padding-bottom: 40px
628
- }
629
-
630
- .ext {
631
- display: grid;
632
- grid-template-columns: 1fr 1fr 1fr;
633
- background: #f9f9f9;
634
- padding: 45px 0 45px 25px
635
- }
636
-
637
- .ex-1 {
638
- width: 80%;
639
- }
640
-
641
- .ex-1 h4 {
642
- margin: 15px 0 12px 0;
643
- font-weight: 600;
644
- font-size: 20px;
645
- color: rgba(234, 76, 137, 1);
646
- }
647
-
648
- .ex-1 p {
649
- font-size: 14px;
650
- font-weight: 400;
651
- margin: 0;
652
- color: #000;
653
- }
654
-
655
- .e-1 img {
656
- width: 65px!important
657
- }
658
-
659
- .e-2 img {
660
- width: 45px!important
661
- }
662
-
663
- .e-3 img {
664
- width: 49px!important
665
- }
666
-
667
- .pvf-cnt {
668
- width: 100%;
669
- display: inline-block
670
- }
671
-
672
- .pvf-tlt {
673
- text-align: center;
674
- width: 100%;
675
- margin: 70px 0 60px 0
676
- }
677
-
678
- .pvf-tlt h2 {
679
- font-size: 36px;
680
- line-height: 1.4;
681
- color: #000;
682
- font-weight: 500;
683
- margin: 0
684
- }
685
-
686
- .pvf-tlt span {
687
- font-size: 16px;
688
- color: #000;
689
- margin-top: 15px;
690
- display: inline-block;
691
- position: relative;
692
- top: 4px
693
- }
694
-
695
- .pvf-cmp {
696
- display: grid;
697
- grid-template-columns: 1fr 2fr
698
- }
699
-
700
- .fr {
701
- border-right: 1px solid #eee
702
- }
703
-
704
- .fr h1,
705
- .pr h1 {
706
- font-size: 36px;
707
- font-weight: 700;
708
- line-height: 1.5;
709
- border-bottom: 1px solid #efefef;
710
- padding: 0 0 20px 35px;
711
- }
712
-
713
- .pr h1 {
714
- padding-left: 50px;
715
- color: rgba(234, 76, 137, 1);
716
- }
717
-
718
- .fr-fe {
719
- color: #222;
720
- padding-top: 10px
721
- }
722
-
723
- .fe-1 {
724
- padding: 22px 35px 35px 35px
725
- }
726
-
727
- .fe-1 h4 {
728
- margin: 0 0 10px 0;
729
- font-size: 20px;
730
- line-height: 1.4;
731
- font-weight: 400;
732
- color: #000
733
- }
734
-
735
- .fe-1 p {
736
- font-size: 15px;
737
- line-height: 1.4;
738
- margin: 0;
739
- color: #333
740
- }
741
-
742
- .pr-fe {
743
- padding: 34px 35px 35px 35px
744
- }
745
-
746
- .pr-fe span {
747
- font-family: georgia;
748
- font-size: 16px;
749
- font-weight: 700;
750
- color: #000;
751
- font-style: italic;
752
- line-height: 1.3
753
- }
754
-
755
- .fet {
756
- width: 100%;
757
- display: grid;
758
- grid-template-columns: 1fr 1fr;
759
- grid-gap: 25px;
760
- margin-top: 40px
761
- }
762
-
763
- .fe-2 {
764
- color: #222
765
- }
766
-
767
- .fe-t img {
768
- width: 22px!important;
769
- display: inline-block;
770
- vertical-align: middle
771
- }
772
-
773
- .fe-t h4 {
774
- margin: 0;
775
- display: inline-block;
776
- vertical-align: middle;
777
- font-size: 19px;
778
- color: #000;
779
- font-weight: 400;
780
- line-height: 1.4;
781
- padding-left: 8px;
782
- margin-top: -5px;
783
- }
784
-
785
- .fe-2 p {
786
- font-size: 15px;
787
- line-height: 1.4;
788
- margin: 0;
789
- color: #555;
790
- padding-top: 8px
791
- }
792
-
793
- .pr-btn {
794
- width: 100%;
795
- display: inline-block;
796
- text-align: center;
797
- margin: 50px 0 25px 0
798
- }
799
-
800
- .pr-btn a {
801
- text-decoration: none;
802
- color: #fff;
803
- padding: 12px 35px 17px 35px;
804
- display: inline-block;
805
- border-radius: 5px;
806
- font-size: 28px;
807
- font-weight: 500;
808
- line-height: 1.2;
809
- background: -webkit-linear-gradient(to right, #e35796, #fc789f);
810
- font-weight: 600;
811
- background: linear-gradient(to right, #e35796, rgba(234, 76, 137, 1));
812
- margin-top: 0;
813
- box-shadow: 0 .15em .65em 0 rgba(0, 0, 0, .25);
814
- }
815
-
816
- .amp-upg {
817
- background: #f5f5f5;
818
- padding: 60px 10px 0 10px
819
- }
820
-
821
- .upg-t {
822
- text-align: center;
823
- color: #222
824
- }
825
-
826
- .upg-t h2 {
827
- margin: 0;
828
- font-size: 35px;
829
- color: #060606;
830
- line-height: 1.3;
831
- font-weight: 500
832
- }
833
-
834
- .upg-t>span {
835
- font-size: 14px;
836
- line-height: 1.2;
837
- margin-top: 15px;
838
- display: inline-block;
839
- color: #666
840
- }
841
-
842
- .etoc-pri-lst {
843
- width: 100%;
844
- display: grid;
845
- grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
846
- margin-top: 70px;
847
- grid-gap: 1px;
848
- box-shadow: 0 10px 15px 1px #ddd
849
- }
850
-
851
- .pri-tb {
852
- background: #fff;
853
- text-align: center;
854
- border: 1px solid #f9f9f9;
855
- position: relative
856
- }
857
-
858
- .pri-tb:hover {
859
- border: 1px solid #e04371;
860
- }
861
-
862
- .pri-tb a:hover .pri-by {
863
- background: #e04371;
864
- }
865
- .pri-tb a:hover .amt {
866
- color: #7241a7;
867
- }
868
-
869
- .pri-tb a {
870
- display: inline-block;
871
- text-decoration: none;
872
- color: #222;
873
- padding: 20px 12px;
874
- }
875
-
876
- .pri-tb h5 {
877
- margin: 0 0 20px 0;
878
- font-size: 13px;
879
- line-height: 1.2;
880
- letter-spacing: 2px;
881
- font-weight: 400;
882
- color: #000
883
- }
884
-
885
- .pri-tb span {
886
- display: inline-block
887
- }
888
-
889
- .pri-tb .amt {
890
- font-size: 40px;
891
- color: #e04371;
892
- font-weight: 500;
893
- margin-bottom: 20px;
894
- display: block;
895
- }
896
-
897
- .pri-tb .d-amt {
898
- font-size: 24px;
899
- color: #666;
900
- font-weight: 500;
901
- margin-bottom: 15px;
902
- display: none;
903
- text-decoration: line-through
904
- }
905
-
906
- .d-amt sup {
907
- line-height: 0;
908
- position: relative;
909
- top: 7px
910
- }
911
-
912
- .pri-tb .s-amt {
913
- font-size: 13px;
914
- color: #4caf50;
915
- font-weight: 500;
916
- margin-bottom: 10px;
917
- display: none
918
- }
919
-
920
- .pri-tb .amt sup {
921
- font-size: 22px;
922
- padding: 0 4px 0 0;
923
- position: relative;
924
- top: 7px
925
- }
926
-
927
- .pri-tb .bil {
928
- color: #aaa;
929
- font-size: 12px;
930
- margin-bottom: 20px
931
- }
932
-
933
- .pri-tb .e,
934
- .pri-tb .f,
935
- .pri-tb .s {
936
- font-size: 14px;
937
- margin-bottom: 15px;
938
- color: #3b4750;
939
- display: block;
940
- }
941
-
942
- .pri-tb .etoc-sv {
943
- display: none;
944
- font-size: 12px;
945
- color: #fff;
946
- background: #4caf50;
947
- margin: 0 auto;
948
- padding: 1px 7px 2px 7px;
949
- border-radius: 45px
950
- }
951
-
952
- .pri-by {
953
- font-size: 15px;
954
- line-height: 1.2;
955
- background: #333;
956
- border-radius: 2px;
957
- padding: 9px 18px 10px 18px;
958
- display: inline-block;
959
- color: #fff;
960
- margin-top: 29px;
961
- font-weight: 500
962
- }
963
-
964
- .etoc-pri-lst .rec {
965
- box-shadow: 0 1px 40px 0 #ccc;
966
- background: #fff;
967
- z-index: 9;
968
- margin-top: -20px;
969
- position: relative
970
- }
971
-
972
- .etoc-pri-lst .rec:hover .etoc-rcm {
973
- background: #000;
974
- color: #fff;
975
- }
976
-
977
- .etoc-pri-lst .rec .pri-by {
978
- background: #e04371;
979
- }
980
-
981
- .etoc-rcm {
982
- background: linear-gradient(to right, #e35796, #fc789f);
983
- color: #fff;
984
- position: absolute;
985
- top: -20px;
986
- left: 0;
987
- right: -1px;
988
- bottom: auto;
989
- padding: 2px 0;
990
- font-size: 11px;
991
- letter-spacing: 2px
992
- }
993
-
994
- .tru-us {
995
- text-align: center;
996
- padding: 60px 0;
997
- margin: 0 auto;
998
- font-size: 16px;
999
- color: #222
1000
- }
1001
-
1002
- .tru-us h2 {
1003
- margin: 20px 0 0 0;
1004
- font-size: 28px;
1005
- font-weight: 500
1006
- }
1007
-
1008
- .tru-us p {
1009
- font-size: 17px;
1010
- margin: 19px 15% 18px 15%;
1011
- color: #666;
1012
- line-height: 29px
1013
- }
1014
-
1015
- .tru-us a {
1016
- font-size: 18px;
1017
- color: #489bff;
1018
- text-decoration: none;
1019
- font-weight: 400
1020
- }
1021
-
1022
- .ampfaq {
1023
- width: 100%;
1024
- margin: 25px 0
1025
- }
1026
-
1027
- .ampfaq h4 {
1028
- margin: 0;
1029
- text-align: center;
1030
- font-size: 20px;
1031
- font-weight: 500;
1032
- color: #333
1033
- }
1034
-
1035
- .faq-lst {
1036
- margin-top: 50px;
1037
- display: grid;
1038
- grid-template-columns: 1fr 1fr
1039
- }
1040
-
1041
- .lt {
1042
- padding-left: 50px
1043
- }
1044
-
1045
- .lt,
1046
- .rt {
1047
- width: 70%
1048
- }
1049
-
1050
- .lt ul,
1051
- .rt ul {
1052
- margin: 0
1053
- }
1054
-
1055
- .lt ul li,
1056
- .rt ul li {
1057
- color: #222;
1058
- margin-bottom: 30px!important
1059
- }
1060
-
1061
- .lt span,
1062
- .rt span {
1063
- font-size: 17px;
1064
- font-weight: 500;
1065
- margin-bottom: 6px;
1066
- display: inline-block
1067
- }
1068
-
1069
- .lt p,
1070
- .rt p {
1071
- font-size: 15px;
1072
- margin: 0
1073
- }
1074
-
1075
- .f-cnt {
1076
- text-align: center;
1077
- margin-top: 20px;
1078
- color: #222
1079
- }
1080
-
1081
- .f-cnt span {
1082
- font-size: 17px;
1083
- margin: 8px 0;
1084
- font-weight: 500
1085
- }
1086
-
1087
- .f-cnt p {
1088
- font-size: 15px;
1089
- margin: 6px 0
1090
- }
1091
-
1092
- .f-cnt a {
1093
- background: #333;
1094
- color: #fff;
1095
- padding: 15px 30px;
1096
- text-decoration: none;
1097
- font-size: 18px;
1098
- font-weight: 500;
1099
- display: inline-block;
1100
- margin-top: 15px
1101
- }
1102
-
1103
- @media(max-width:1366px) {
1104
- .amp-upg {
1105
- padding: 60px 0 0 0
1106
- }
1107
- .etoc-eztoc-cnt p {
1108
-
1109
- line-height: 35px;
1110
- font-size: 18px;
1111
-
1112
- }
1113
- }
1114
-
1115
- @media(max-width:1280px) {
1116
- .etoc-eztoc-cnt {
1117
- top: 1.3%
1118
- }
1119
- }
1120
-
1121
- @media(max-width:768px) {
1122
- .ext {
1123
- grid-template-columns: 1fr;
1124
- grid-gap: 30px 0;
1125
- padding: 30px
1126
- }
1127
- .pvf-tlt h2 {
1128
- font-size: 26px
1129
- }
1130
- .pvf-cmp {
1131
- grid-template-columns: 1fr
1132
- }
1133
- .pr-btn a {
1134
- font-size: 22px
1135
- }
1136
- .etoc-pri-lst {
1137
- grid-template-columns: 1fr 1fr 1fr
1138
- }
1139
- .etoc-eztoc-cnt p {
1140
- line-height: 1.5;
1141
- font-size: 16px;
1142
- margin-top: 15px;
1143
- padding: 0 20px
1144
- }
1145
- .etoc-eztoc-cnt .buy {
1146
- font-size: 16px;
1147
- padding: 8px 30px
1148
- }
1149
- .etoc-eztoc-cnt {
1150
- top: 15px
1151
- }
1152
- .etoc-eztoc-cnt h1 {
1153
- font-size: 30px
1154
- }
1155
- .ex-1 {
1156
- width: 100%
1157
- }
1158
- .faq-lst {
1159
- grid-template-columns: 1fr
1160
- }
1161
- .rt {
1162
- padding-left: 50px
1163
- }
1164
- }
1165
- div#freevspro {
1166
- padding: 0;
1167
- }
1168
-
1169
- .ampfaq h2 {
1170
- margin: 40px 0 0 0;
1171
- font-size: 30px;
1172
- font-weight: 500;
1173
- text-align: center;
1174
- }
1175
- a#eztoc-upgrade {
1176
- color: #ffffff;
1177
- background: rgba(234, 76, 137, 1);
1178
- padding: 16px;
1179
- }
1180
- div#welcome {
1181
- text-align: center;
1182
- }
1183
- a#eztoc-welcome {
1184
- display: none;
1185
- }
1186
- .button-toc{
1187
- text-align: center;
1188
- cursor: pointer;
1189
- font-size: 16px;
1190
- margin: 20px;
1191
- color: #fff;
1192
- border-radius: 4px;
1193
- background-color: #ec407a;
1194
- border: none;
1195
- padding: 20px;
1196
- transition: all 0.5s;
1197
- font-weight: 600;
1198
- }
1199
- .button-toc span {
1200
- cursor: pointer;
1201
- display: inline-block;
1202
- position: relative;
1203
- transition: 0.5s;
1204
- }
1205
-
1206
- .button-toc span:after {
1207
- content: '»';
1208
- position: absolute;
1209
- opacity: 0;
1210
- top: 0;
1211
- right: -20px;
1212
- transition: 0.5s;
1213
- }
1214
-
1215
- .button-toc:hover span {
1216
- padding-right: 25px;
1217
- }
1218
-
1219
- .button-toc:hover span:after {
1220
- opacity: 1;
1221
- right: 0;
1222
- }
1223
-
1224
- .eztoc-query-success{
1225
- color: green;
1226
- }
1227
- .eztoc-query-error{
1228
- color: red;
1229
- }
1230
- .eztoc_hide{
1231
- display: none;
1232
- }
1233
- .eztoc-result{
1234
- margin-left: 70px;
1235
- }
1236
-
1237
- div#wp-pointer-0{
1238
- position: absolute;
1239
- width: 320px;
1240
- top: 515px!important;
1241
- left: 146px!important;
1242
- z-index: 9999;
1243
  }
1
+ div.tab_content table {
2
+ margin-bottom: 1em;
3
+ }
4
+ table.more_toc_options_table th, table.more_toc_options_table td {
5
+ padding: 0;
6
+ margin: 0;
7
+ }
8
+ table.more_toc_options_table th {
9
+ width: auto;
10
+ padding-right: 4px;
11
+ padding-top: 2px;
12
+ }
13
+ div.tab_content ul li {
14
+ margin-left: 2em;
15
+ list-style-type: disc;
16
+ }
17
+ div.tab_content ol li {
18
+ list-style: inherit;
19
+ }
20
+ div.tab_content pre {
21
+ margin-left: 2em;
22
+ }
23
+ ul#tabbed-nav {
24
+ margin-top: 1em;
25
+ }
26
+ #tabbed-nav {
27
+ margin: 0;
28
+ padding: 0;
29
+ float: left;
30
+ list-style: none;
31
+ height: 32px;
32
+ border-bottom: 1px solid #DFDFDF;
33
+ border-left: 1px solid #DFDFDF;
34
+ width: 100%;
35
+ }
36
+ #tabbed-nav li {
37
+ float: left;
38
+ margin: 0;
39
+ padding: 0;
40
+ height: 31px;
41
+ line-height: 31px;
42
+ border: 1px solid #DFDFDF;
43
+ border-left: none;
44
+ margin-bottom: -1px;
45
+ overflow: hidden;
46
+ position: relative;
47
+ background: #F5F5F5;
48
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#F5F5F5));
49
+ background-image: -webkit-linear-gradient(center top, #fff, #F5F5F5);
50
+ background-image: -moz-linear-gradient(center top, #fff, #F5F5F5);
51
+ background-image: -ms-linear-gradient(center top, #fff, #F5F5F5);
52
+ background-image: -o-linear-gradient(center top, #fff, #F5F5F5);
53
+ background-image: linear-gradient(center top, #fff, #F5F5F5);
54
+ }
55
+ #tabbed-nav li a {
56
+ text-decoration: none;
57
+ color: #000;
58
+ display: block;
59
+ font-size: 1.2em;
60
+ padding: 0 20px;
61
+ border: 1px solid #fff;
62
+ outline: none;
63
+ }
64
+ #tabbed-nav li a:hover {
65
+ background: #ECECEC;
66
+ }
67
+ html #tabbed-nav li.active, html #tabbed-nav li.active a:hover {
68
+ background: #fff;
69
+ border-bottom: 1px solid #fff;
70
+ }
71
+ div.tab_container {
72
+ border: 1px solid #DFDFDF;
73
+ border-top: none;
74
+ overflow: hidden;
75
+ clear: both;
76
+ float: left; width: 100%;
77
+ background: #fff;
78
+ margin-bottom: 2em;
79
+ padding-bottom: 2em;
80
+ }
81
+ div.tab_content {
82
+ padding: 10px;
83
+ padding-bottom: 0;
84
+ font-size: 1em;
85
+ }
86
+ h3 span.show_hide {
87
+ font-size: 0.85em;
88
+ font-weight: normal;
89
+ }
90
+ div.more_toc_options {
91
+ margin-top: 4px;
92
+ margin-left: 2em;
93
+ }
94
+ div.toc_theme_option {
95
+ width: 200px;
96
+ float: left;
97
+ margin-right: 5px;
98
+ }
99
+ #wpcontent select optgroup option {
100
+ padding-left: 15px;
101
+ }
102
+ input#width_custom,
103
+ input#font_size,
104
+ input#child_font_size,
105
+ input#smooth_scroll_offset {
106
+ width: 50px;
107
+ text-align: center;
108
+ }
109
+ input.custom_colour_option {
110
+ width: 75px;
111
+ }
112
+ table#theme_custom, div#farbtastic_colour_wheel {
113
+ float: left;
114
+ }
115
+ table#theme_custom {
116
+ margin-top: 30px;
117
+ }
118
+ table#theme_custom img {
119
+ vertical-align: middle;
120
+ opacity: 0.4;
121
+ }
122
+ table#theme_custom img:hover {
123
+ cursor: pointer;
124
+ opacity: 1;
125
+ }
126
+ div#farbtastic_colour_wheel {
127
+ margin-left: 20px;
128
+ }
129
+ #tab3 h3:not(:first-child) {
130
+ margin-top: 2em;
131
+ }
132
+
133
+ /* My styles */
134
+ #toc input.small-text {
135
+ width: 50px;
136
+ padding: 2px;
137
+ height: 28px;
138
+ line-height: 28px;
139
+ vertical-align: bottom;
140
+ }
141
+
142
+ #toc .form-table tr > th > strong {
143
+ font-size: 18px;
144
+ font-style: italic;
145
+ }
146
+ /* Tab panel styles */
147
+ .postbox{
148
+ padding: 10px;
149
+ }
150
+ html {
151
+ scroll-behavior: smooth;
152
+ }
153
+ .toc-tab-panel {
154
+ overflow: hidden;
155
+ border: 1px solid #ccc;
156
+ background-color: #fff;
157
+ margin-top: 15px;}
158
+ .toc-tab-panel a {
159
+ background-color: inherit;
160
+ text-decoration: none;
161
+ float: left;
162
+ border: none;
163
+ outline: none;
164
+ cursor: pointer;
165
+ padding: 14px 16px;
166
+ transition: 0s;
167
+ font-size: 15px;
168
+ color: #2271b1;
169
+ font-weight: 500;
170
+ }
171
+ .toc-tab-panel a:hover {
172
+ color: #0a4b78;
173
+ }
174
+ .toc-tab-panel a.active {
175
+ box-shadow: none;
176
+ border-bottom: 4px solid #646970;
177
+ color: #1d2327;
178
+ }
179
+ .toc-tab-panel a:focus {
180
+ box-shadow: none;
181
+ outline: none;
182
+ }
183
+ .eztoc-tabcontent {
184
+ display: none;
185
+ border-top: none;
186
+ animation: fadeEffect 1s;
187
+ }
188
+ #technical .eztoc-form-page-ui{
189
+ display:flex;
190
+ background: #fff;
191
+ width: auto;
192
+ height: auto;
193
+ }
194
+ #technical .eztoc-left-side{
195
+ width: 70%;
196
+
197
+ }
198
+ .eztoc-right-side{
199
+ width: 31%;
200
+ margin-top: auto;
201
+ margin-bottom: auto;
202
+ text-align: center;
203
+
204
+ }
205
+ .eztoc-tabcontent {
206
+ display: none;
207
+ border-top: none;
208
+ }
209
+ #technical {
210
+ background: #fff;
211
+ margin-top: 10px;
212
+ padding: 28px;
213
+ padding: 15px 28px 28px 28px;
214
+ min-width: 255px;
215
+ box-shadow: 0 1px 1px rgb(0 0 0 / 4%);
216
+ }
217
+ /* #technical p{
218
+ line-height: 0.5rem;
219
+ } */
220
+ #technical-form{
221
+
222
+ width: 60%;
223
+ }
224
+ .support-label {
225
+ margin-top: 4px;
226
+ float: left;
227
+ width: 70px;
228
+
229
+ font-size: 14px;
230
+ }
231
+
232
+ .star-mark{
233
+ color: red;
234
+ margin-left: 4px;
235
+ font-family: bold;
236
+ }
237
+ #technical li {
238
+ margin:25px 0px 20px 0px;
239
+ margin:10px 0px 10px 0px;
240
+ list-style: none;
241
+ }
242
+ .eztoc_support_div_form{
243
+ margin-top: 23px;
244
+ }
245
+ .eztoc-customer-type{
246
+ display: block;
247
+ }
248
+ .support-input select{
249
+ border-radius: 4px;
250
+ margin-top: -7px;
251
+ }
252
+ .eztoc_dev-bio{
253
+ display: block;
254
+ }
255
+ .ezoc-bio-wrap{
256
+ float: left;
257
+ text-align: center;
258
+ width: 33.33%;
259
+ text-transform: uppercase;
260
+ }
261
+ .ezoc-bio-wrap p{
262
+ width: auto;
263
+ font-size: 10px;
264
+ color: #555;
265
+ margin: 0px 0 20px 0;
266
+ }
267
+ .ezoc-bio-wrap img{
268
+ margin: 25px 0 0 0;
269
+ border-radius: 50%;
270
+ }
271
+ .eztoc-bio-box{
272
+ background: #fff;
273
+ border: 1px solid #ccc;
274
+ padding: 15px 20px;
275
+ border-radius: 4px;
276
+ margin: 15px 15px 15px 0;
277
+ /* height: 22rem; */
278
+ padding: 0px 20px;
279
+ }
280
+ .eztoc-bio-box:hover{
281
+ box-shadow: 5px 5px 8px #888888;
282
+ }
283
+ .eztoc-p{
284
+ font-size: 15px;
285
+ margin: 20px auto 0px auto;
286
+ text-align: center;
287
+ }
288
+ .eztoc-p{
289
+ line-height: 1.5rem;
290
+ padding: 0 25px;
291
+ margin-top: 10px;
292
+ font-size: 16px;
293
+ }
294
+ .eztoc-bio-box h1{
295
+ margin: 8px auto 0px auto;
296
+ text-align: center;
297
+ font-weight: bolder;
298
+ }
299
+ .eztoc_boxdesk{
300
+ clear: left;
301
+ font-size: 15px;
302
+ text-align: center;
303
+ margin: 20px 0 0 0;
304
+
305
+ }
306
+ .company-link{
307
+ font-weight: 500;
308
+ margin: 20px 0 0 0;
309
+ }
310
+ .company-link a{
311
+
312
+ display: table;
313
+ background: #e91e63;
314
+ width: auto;
315
+ margin: 0 auto;
316
+ padding: 7px 25px;
317
+ color: #fff;
318
+ text-decoration: none;
319
+ margin-top: 10px;
320
+ margin-bottom: 15px;
321
+ border-radius: 6px;
322
+ border: 0;
323
+ /* text-transform: uppercase; */
324
+ font-size: 16px;
325
+
326
+ }
327
+ .eztoc-send-query{
328
+ background: #2271b1;
329
+ border-color: #2271b1;
330
+ color:#fff;
331
+ text-decoration: none;
332
+ text-shadow: none;
333
+ margin-left: 70px !important;;
334
+ }
335
+
336
+ @media screen and (min-width: 870px) and (max-width: 1300px ){
337
+ .eztoc-bio-box{
338
+ padding-top: 20px;
339
+ height: 29.1rem;;
340
+ }
341
+ .eztoc-bio-box h1{
342
+ font-size: 20px;
343
+ }
344
+ .eztoc-bio-box p{
345
+ font-size: 13px;
346
+ margin: 20px auto 0px auto;
347
+ }
348
+ .ezoc-bio-wrap img{
349
+ width: 30px;
350
+ height: 30px;
351
+ }
352
+ .ezoc-bio-wrap p{
353
+ width: 55px;
354
+ font-size: 12px;
355
+ margin-bottom: 10px;
356
+ }
357
+
358
+ }
359
+ @keyframes fadeEffect { from {opacity: 0;} to {opacity: 1;} }
360
+
361
+
362
+ .eztoc-wrapper{
363
+ max-width: 100%;
364
+ width: 100%;
365
+ display: flex;
366
+ flex-wrap: wrap;
367
+ margin: auto;
368
+ }
369
+
370
+ .eztoc-wrapper .table{
371
+ margin: 0 auto;
372
+ background: #fff;
373
+ width: calc(30%);
374
+ padding: 30px 20px;
375
+ position: relative;
376
+ box-shadow: 0 5px 10px rgb(0 0 0 / 10%);
377
+ }
378
+
379
+ .table .price-section{
380
+ display: flex;
381
+ justify-content: center;
382
+ }
383
+
384
+ .price-section .price-area{
385
+ height: 120px;
386
+ width: 120px;
387
+ background: #ffd861;
388
+ border-radius: 50%;
389
+ padding: 2px;
390
+ }
391
+
392
+ .price-section .price-area .inner-area{
393
+ height: 100%;
394
+ width: 100%;
395
+ border-radius: 50%;
396
+ border: 3px solid #fff;
397
+ color: #fff;
398
+ line-height: 117px;
399
+ text-align: center;
400
+ position: relative;
401
+ }
402
+
403
+ .price-area .inner-area .text{
404
+ font-size: 25px;
405
+ font-weight: 400;
406
+ position: absolute;
407
+ top: -10px;
408
+ left: 17px;
409
+ }
410
+
411
+ .price-area .inner-area .price{
412
+ font-size: 55px;
413
+ font-weight: 500;
414
+ }
415
+
416
+ .table .package-name{
417
+ width: 100%;
418
+ height: 2px;
419
+ background: #ffecb3;
420
+ margin: 35px 0;
421
+ position: relative;
422
+ }
423
+
424
+ .table .package-name::before{
425
+ position: absolute;
426
+ content: "Basic";
427
+ top: 50%;
428
+ left: 50%;
429
+ transform: translate(-50%, -50%);
430
+ background: #fff;
431
+ font-size: 25px;
432
+ padding: 0 10px;
433
+ font-weight: bolder;
434
+ }
435
+
436
+ .table .features li{
437
+ list-style: none;
438
+ display: flex;
439
+ justify-content: space-between;
440
+ margin-bottom: 15px;
441
+ }
442
+
443
+ .features li .list-name{
444
+ font-size: 17px;
445
+ font-weight: 400;
446
+ }
447
+
448
+ .features li .icon{
449
+ font-size: 15px;
450
+ }
451
+
452
+ .features li .icon.check{
453
+ color: #2db94d;
454
+ }
455
+
456
+ .features li .icon.cross{
457
+ color: #cd3241;
458
+ }
459
+
460
+ .table .btn{
461
+ display: flex;
462
+ justify-content: center;
463
+ margin-top: 35px;
464
+ }
465
+
466
+ .table .btn button{
467
+ width: 80%;
468
+ height: 50px;
469
+ font-weight: 700;
470
+ color: #fff;
471
+ font-size: 20px;
472
+ border: none;
473
+ outline: none;
474
+ border-radius: 25px;
475
+ cursor: pointer;
476
+ transition: all 0.3s ease;
477
+ }
478
+
479
+ .basic .price-area,
480
+ .basic .inner-area{
481
+ background: #ffd861;
482
+ }
483
+
484
+ .basic .btn button{
485
+ background: #fff;
486
+ color: #ffd861;
487
+ border: 2px solid #ffd861;
488
+ }
489
+
490
+ .basic .btn button:hover{
491
+ border-radius: 6px;
492
+ background: #ffd861;
493
+ color: #fff;
494
+ }
495
+
496
+ .Premium .price-area,
497
+ .Premium .inner-area{
498
+ background: #a26bfa;
499
+ }
500
+
501
+ .Premium .btn button{
502
+ background: #fff;
503
+ color: #a26bfa;
504
+ border: 2px solid #a26bfa;
505
+ }
506
+
507
+ .Premium .btn button:hover{
508
+ border-radius: 6px;
509
+ background: #a26bfa;
510
+ color: #fff;
511
+ }
512
+
513
+
514
+ .basic .package-name{
515
+ background: #ffecb3;
516
+ }
517
+
518
+ .Premium .package-name{
519
+ background: #a26bfa;
520
+ }
521
+
522
+
523
+
524
+ .basic .package-name::before{
525
+ content: "Free";
526
+ }
527
+
528
+ .Premium .package-name::before{
529
+ content: "PRO";
530
+ }
531
+
532
+
533
+
534
+ .basic ::selection,
535
+ .basic .price-area,
536
+ .basic .inner-area{
537
+ background: #ffd861;
538
+ }
539
+
540
+ .Premium ::selection,
541
+ .Premium .price-area,
542
+ .Premium .inner-area{
543
+ background: #a26bfa;
544
+ }
545
+
546
+ div#eztoc-tabs a {
547
+ text-decoration: none;
548
+ }
549
+ div#eztoc-tabs a:first-child {
550
+ color: #000;
551
+ }
552
+
553
+ #the-list{position: relative;}
554
+ .eztoc-wr {
555
+ width: 100%;
556
+ margin: 0 auto;
557
+ position: relative
558
+ }
559
+
560
+ .etoc-eztoc-img {
561
+ width: 100%;
562
+ margin: 0 auto;
563
+ text-align: center;
564
+ position: relative;
565
+ line-height: 0;
566
+ height: 300px;
567
+ }
568
+
569
+ .eztoc-img img {
570
+ position: relative
571
+ }
572
+
573
+ .sp_ov {
574
+ background: rgba(234, 76, 137, 1);
575
+ bottom: 0;
576
+ left: 0;
577
+ position: absolute;
578
+ right: 0;
579
+ top: 0;
580
+ }
581
+
582
+ .etoc-eztoc-cnt {
583
+ position: absolute;
584
+ top: 40px;
585
+ bottom: 0;
586
+ left: 40px;
587
+ right: 40px;
588
+ margin: 0 auto;
589
+ text-align: center
590
+ }
591
+
592
+ .etoc-eztoc-cnt h1 {
593
+ font-size: 60px;
594
+ color: #fff;
595
+ font-weight: 600;
596
+ }
597
+
598
+ .etoc-eztoc-cnt p {
599
+ margin-top: 0px;
600
+ color: #371b24;
601
+ font-size: 18px;
602
+ padding: 0 100px;
603
+ line-height: 1.4;
604
+ font-weight: 500;
605
+ }
606
+
607
+ .etoc-eztoc-cnt .buy {
608
+ border-width: 0px !important;
609
+ font-size: 1.25rem;
610
+ line-height: 2;
611
+ text-decoration: none;
612
+ background: white !important;
613
+ border-radius: 8px !important;
614
+ font-size: 16px !important;
615
+ padding: 12px 18px;
616
+ color: rgba(234, 76, 137, 1) !important;
617
+ font-weight: 500;
618
+ }
619
+ .etoc-eztoc-cnt .buy:hover{
620
+ box-shadow: 0px 2px 2px #999;
621
+ background: linear-gradient(to left, #fdfc35, #ffe258) !important;
622
+ }
623
+ .pvf {
624
+ position: relative;
625
+ top: -16px;
626
+ border: 1px solid #eee;
627
+ padding-bottom: 40px
628
+ }
629
+
630
+ .ext {
631
+ display: grid;
632
+ grid-template-columns: 1fr 1fr 1fr;
633
+ background: #f9f9f9;
634
+ padding: 45px 0 45px 25px
635
+ }
636
+
637
+ .ex-1 {
638
+ width: 80%;
639
+ }
640
+
641
+ .ex-1 h4 {
642
+ margin: 15px 0 12px 0;
643
+ font-weight: 600;
644
+ font-size: 20px;
645
+ color: rgba(234, 76, 137, 1);
646
+ }
647
+
648
+ .ex-1 p {
649
+ font-size: 14px;
650
+ font-weight: 400;
651
+ margin: 0;
652
+ color: #000;
653
+ }
654
+
655
+ .e-1 img {
656
+ width: 65px!important
657
+ }
658
+
659
+ .e-2 img {
660
+ width: 45px!important
661
+ }
662
+
663
+ .e-3 img {
664
+ width: 49px!important
665
+ }
666
+
667
+ .pvf-cnt {
668
+ width: 100%;
669
+ display: inline-block
670
+ }
671
+
672
+ .pvf-tlt {
673
+ text-align: center;
674
+ width: 100%;
675
+ margin: 70px 0 60px 0
676
+ }
677
+
678
+ .pvf-tlt h2 {
679
+ font-size: 36px;
680
+ line-height: 1.4;
681
+ color: #000;
682
+ font-weight: 500;
683
+ margin: 0
684
+ }
685
+
686
+ .pvf-tlt span {
687
+ font-size: 16px;
688
+ color: #000;
689
+ margin-top: 15px;
690
+ display: inline-block;
691
+ position: relative;
692
+ top: 4px
693
+ }
694
+
695
+ .pvf-cmp {
696
+ display: grid;
697
+ grid-template-columns: 1fr 2fr
698
+ }
699
+
700
+ .fr {
701
+ border-right: 1px solid #eee
702
+ }
703
+
704
+ .fr h1,
705
+ .pr h1 {
706
+ font-size: 36px;
707
+ font-weight: 700;
708
+ line-height: 1.5;
709
+ border-bottom: 1px solid #efefef;
710
+ padding: 0 0 20px 35px;
711
+ }
712
+
713
+ .pr h1 {
714
+ padding-left: 50px;
715
+ color: rgba(234, 76, 137, 1);
716
+ }
717
+
718
+ .fr-fe {
719
+ color: #222;
720
+ padding-top: 10px
721
+ }
722
+
723
+ .fe-1 {
724
+ padding: 22px 35px 35px 35px
725
+ }
726
+
727
+ .fe-1 h4 {
728
+ margin: 0 0 10px 0;
729
+ font-size: 20px;
730
+ line-height: 1.4;
731
+ font-weight: 400;
732
+ color: #000
733
+ }
734
+
735
+ .fe-1 p {
736
+ font-size: 15px;
737
+ line-height: 1.4;
738
+ margin: 0;
739
+ color: #333
740
+ }
741
+
742
+ .pr-fe {
743
+ padding: 34px 35px 35px 35px
744
+ }
745
+
746
+ .pr-fe span {
747
+ font-family: georgia;
748
+ font-size: 16px;
749
+ font-weight: 700;
750
+ color: #000;
751
+ font-style: italic;
752
+ line-height: 1.3
753
+ }
754
+
755
+ .fet {
756
+ width: 100%;
757
+ display: grid;
758
+ grid-template-columns: 1fr 1fr;
759
+ grid-gap: 25px;
760
+ margin-top: 40px
761
+ }
762
+
763
+ .fe-2 {
764
+ color: #222
765
+ }
766
+
767
+ .fe-t img {
768
+ width: 22px!important;
769
+ display: inline-block;
770
+ vertical-align: middle
771
+ }
772
+
773
+ .fe-t h4 {
774
+ margin: 0;
775
+ display: inline-block;
776
+ vertical-align: middle;
777
+ font-size: 19px;
778
+ color: #000;
779
+ font-weight: 400;
780
+ line-height: 1.4;
781
+ padding-left: 8px;
782
+ margin-top: -5px;
783
+ }
784
+
785
+ .fe-2 p {
786
+ font-size: 15px;
787
+ line-height: 1.4;
788
+ margin: 0;
789
+ color: #555;
790
+ padding-top: 8px
791
+ }
792
+
793
+ .pr-btn {
794
+ width: 100%;
795
+ display: inline-block;
796
+ text-align: center;
797
+ margin: 50px 0 25px 0
798
+ }
799
+
800
+ .pr-btn a {
801
+ text-decoration: none;
802
+ color: #fff;
803
+ padding: 12px 35px 17px 35px;
804
+ display: inline-block;
805
+ border-radius: 5px;
806
+ font-size: 28px;
807
+ font-weight: 500;
808
+ line-height: 1.2;
809
+ background: -webkit-linear-gradient(to right, #e35796, #fc789f);
810
+ font-weight: 600;
811
+ background: linear-gradient(to right, #e35796, rgba(234, 76, 137, 1));
812
+ margin-top: 0;
813
+ box-shadow: 0 .15em .65em 0 rgba(0, 0, 0, .25);
814
+ }
815
+
816
+ .amp-upg {
817
+ background: #f5f5f5;
818
+ padding: 60px 10px 0 10px
819
+ }
820
+
821
+ .upg-t {
822
+ text-align: center;
823
+ color: #222
824
+ }
825
+
826
+ .upg-t h2 {
827
+ margin: 0;
828
+ font-size: 35px;
829
+ color: #060606;
830
+ line-height: 1.3;
831
+ font-weight: 500
832
+ }
833
+
834
+ .upg-t>span {
835
+ font-size: 14px;
836
+ line-height: 1.2;
837
+ margin-top: 15px;
838
+ display: inline-block;
839
+ color: #666
840
+ }
841
+
842
+ .etoc-pri-lst {
843
+ width: 100%;
844
+ display: grid;
845
+ grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
846
+ margin-top: 70px;
847
+ grid-gap: 1px;
848
+ box-shadow: 0 10px 15px 1px #ddd
849
+ }
850
+
851
+ .pri-tb {
852
+ background: #fff;
853
+ text-align: center;
854
+ border: 1px solid #f9f9f9;
855
+ position: relative
856
+ }
857
+
858
+ .pri-tb:hover {
859
+ border: 1px solid #e04371;
860
+ }
861
+
862
+ .pri-tb a:hover .pri-by {
863
+ background: #e04371;
864
+ }
865
+ .pri-tb a:hover .amt {
866
+ color: #7241a7;
867
+ }
868
+
869
+ .pri-tb a {
870
+ display: inline-block;
871
+ text-decoration: none;
872
+ color: #222;
873
+ padding: 20px 12px;
874
+ }
875
+
876
+ .pri-tb h5 {
877
+ margin: 0 0 20px 0;
878
+ font-size: 13px;
879
+ line-height: 1.2;
880
+ letter-spacing: 2px;
881
+ font-weight: 400;
882
+ color: #000
883
+ }
884
+
885
+ .pri-tb span {
886
+ display: inline-block
887
+ }
888
+
889
+ .pri-tb .amt {
890
+ font-size: 40px;
891
+ color: #e04371;
892
+ font-weight: 500;
893
+ margin-bottom: 20px;
894
+ display: block;
895
+ }
896
+
897
+ .pri-tb .d-amt {
898
+ font-size: 24px;
899
+ color: #666;
900
+ font-weight: 500;
901
+ margin-bottom: 15px;
902
+ display: none;
903
+ text-decoration: line-through
904
+ }
905
+
906
+ .d-amt sup {
907
+ line-height: 0;
908
+ position: relative;
909
+ top: 7px
910
+ }
911
+
912
+ .pri-tb .s-amt {
913
+ font-size: 13px;
914
+ color: #4caf50;
915
+ font-weight: 500;
916
+ margin-bottom: 10px;
917
+ display: none
918
+ }
919
+
920
+ .pri-tb .amt sup {
921
+ font-size: 22px;
922
+ padding: 0 4px 0 0;
923
+ position: relative;
924
+ top: 7px
925
+ }
926
+
927
+ .pri-tb .bil {
928
+ color: #aaa;
929
+ font-size: 12px;
930
+ margin-bottom: 20px
931
+ }
932
+
933
+ .pri-tb .e,
934
+ .pri-tb .f,
935
+ .pri-tb .s {
936
+ font-size: 14px;
937
+ margin-bottom: 15px;
938
+ color: #3b4750;
939
+ display: block;
940
+ }
941
+
942
+ .pri-tb .etoc-sv {
943
+ display: none;
944
+ font-size: 12px;
945
+ color: #fff;
946
+ background: #4caf50;
947
+ margin: 0 auto;
948
+ padding: 1px 7px 2px 7px;
949
+ border-radius: 45px
950
+ }
951
+
952
+ .pri-by {
953
+ font-size: 15px;
954
+ line-height: 1.2;
955
+ background: #333;
956
+ border-radius: 2px;
957
+ padding: 9px 18px 10px 18px;
958
+ display: inline-block;
959
+ color: #fff;
960
+ margin-top: 29px;
961
+ font-weight: 500
962
+ }
963
+
964
+ .etoc-pri-lst .rec {
965
+ box-shadow: 0 1px 40px 0 #ccc;
966
+ background: #fff;
967
+ z-index: 9;
968
+ margin-top: -20px;
969
+ position: relative
970
+ }
971
+
972
+ .etoc-pri-lst .rec:hover .etoc-rcm {
973
+ background: #000;
974
+ color: #fff;
975
+ }
976
+
977
+ .etoc-pri-lst .rec .pri-by {
978
+ background: #e04371;
979
+ }
980
+
981
+ .etoc-rcm {
982
+ background: linear-gradient(to right, #e35796, #fc789f);
983
+ color: #fff;
984
+ position: absolute;
985
+ top: -20px;
986
+ left: 0;
987
+ right: -1px;
988
+ bottom: auto;
989
+ padding: 2px 0;
990
+ font-size: 11px;
991
+ letter-spacing: 2px
992
+ }
993
+
994
+ .tru-us {
995
+ text-align: center;
996
+ padding: 60px 0;
997
+ margin: 0 auto;
998
+ font-size: 16px;
999
+ color: #222
1000
+ }
1001
+
1002
+ .tru-us h2 {
1003
+ margin: 20px 0 0 0;
1004
+ font-size: 28px;
1005
+ font-weight: 500
1006
+ }
1007
+
1008
+ .tru-us p {
1009
+ font-size: 17px;
1010
+ margin: 19px 15% 18px 15%;
1011
+ color: #666;
1012
+ line-height: 29px
1013
+ }
1014
+
1015
+ .tru-us a {
1016
+ font-size: 18px;
1017
+ color: #489bff;
1018
+ text-decoration: none;
1019
+ font-weight: 400
1020
+ }
1021
+
1022
+ .ampfaq {
1023
+ width: 100%;
1024
+ margin: 25px 0
1025
+ }
1026
+
1027
+ .ampfaq h4 {
1028
+ margin: 0;
1029
+ text-align: center;
1030
+ font-size: 20px;
1031
+ font-weight: 500;
1032
+ color: #333
1033
+ }
1034
+
1035
+ .faq-lst {
1036
+ margin-top: 50px;
1037
+ display: grid;
1038
+ grid-template-columns: 1fr 1fr
1039
+ }
1040
+
1041
+ .lt {
1042
+ padding-left: 50px
1043
+ }
1044
+
1045
+ .lt,
1046
+ .rt {
1047
+ width: 70%
1048
+ }
1049
+
1050
+ .lt ul,
1051
+ .rt ul {
1052
+ margin: 0
1053
+ }
1054
+
1055
+ .lt ul li,
1056
+ .rt ul li {
1057
+ color: #222;
1058
+ margin-bottom: 30px!important
1059
+ }
1060
+
1061
+ .lt span,
1062
+ .rt span {
1063
+ font-size: 17px;
1064
+ font-weight: 500;
1065
+ margin-bottom: 6px;
1066
+ display: inline-block
1067
+ }
1068
+
1069
+ .lt p,
1070
+ .rt p {
1071
+ font-size: 15px;
1072
+ margin: 0
1073
+ }
1074
+
1075
+ .f-cnt {
1076
+ text-align: center;
1077
+ margin-top: 20px;
1078
+ color: #222
1079
+ }
1080
+
1081
+ .f-cnt span {
1082
+ font-size: 17px;
1083
+ margin: 8px 0;
1084
+ font-weight: 500
1085
+ }
1086
+
1087
+ .f-cnt p {
1088
+ font-size: 15px;
1089
+ margin: 6px 0
1090
+ }
1091
+
1092
+ .f-cnt a {
1093
+ background: #333;
1094
+ color: #fff;
1095
+ padding: 15px 30px;
1096
+ text-decoration: none;
1097
+ font-size: 18px;
1098
+ font-weight: 500;
1099
+ display: inline-block;
1100
+ margin-top: 15px
1101
+ }
1102
+
1103
+ @media(max-width:1366px) {
1104
+ .amp-upg {
1105
+ padding: 60px 0 0 0
1106
+ }
1107
+ .etoc-eztoc-cnt p {
1108
+
1109
+ line-height: 35px;
1110
+ font-size: 18px;
1111
+
1112
+ }
1113
+ }
1114
+
1115
+ @media(max-width:1280px) {
1116
+ .etoc-eztoc-cnt {
1117
+ top: 1.3%
1118
+ }
1119
+ }
1120
+
1121
+ @media(max-width:768px) {
1122
+ .ext {
1123
+ grid-template-columns: 1fr;
1124
+ grid-gap: 30px 0;
1125
+ padding: 30px
1126
+ }
1127
+ .pvf-tlt h2 {
1128
+ font-size: 26px
1129
+ }
1130
+ .pvf-cmp {
1131
+ grid-template-columns: 1fr
1132
+ }
1133
+ .pr-btn a {
1134
+ font-size: 22px
1135
+ }
1136
+ .etoc-pri-lst {
1137
+ grid-template-columns: 1fr 1fr 1fr
1138
+ }
1139
+ .etoc-eztoc-cnt p {
1140
+ line-height: 1.5;
1141
+ font-size: 16px;
1142
+ margin-top: 15px;
1143
+ padding: 0 20px
1144
+ }
1145
+ .etoc-eztoc-cnt .buy {
1146
+ font-size: 16px;
1147
+ padding: 8px 30px
1148
+ }
1149
+ .etoc-eztoc-cnt {
1150
+ top: 15px
1151
+ }
1152
+ .etoc-eztoc-cnt h1 {
1153
+ font-size: 30px
1154
+ }
1155
+ .ex-1 {
1156
+ width: 100%
1157
+ }
1158
+ .faq-lst {
1159
+ grid-template-columns: 1fr
1160
+ }
1161
+ .rt {
1162
+ padding-left: 50px
1163
+ }
1164
+ }
1165
+ div#freevspro {
1166
+ padding: 0;
1167
+ }
1168
+
1169
+ .ampfaq h2 {
1170
+ margin: 40px 0 0 0;
1171
+ font-size: 30px;
1172
+ font-weight: 500;
1173
+ text-align: center;
1174
+ }
1175
+ a#eztoc-upgrade {
1176
+ color: #ffffff;
1177
+ background: rgba(234, 76, 137, 1);
1178
+ padding: 16px;
1179
+ }
1180
+ div#welcome {
1181
+ text-align: center;
1182
+ }
1183
+ a#eztoc-welcome {
1184
+ display: none;
1185
+ }
1186
+ .button-toc{
1187
+ text-align: center;
1188
+ cursor: pointer;
1189
+ font-size: 16px;
1190
+ margin: 20px;
1191
+ color: #fff;
1192
+ border-radius: 4px;
1193
+ background-color: #ec407a;
1194
+ border: none;
1195
+ padding: 20px;
1196
+ transition: all 0.5s;
1197
+ font-weight: 600;
1198
+ }
1199
+ .button-toc span {
1200
+ cursor: pointer;
1201
+ display: inline-block;
1202
+ position: relative;
1203
+ transition: 0.5s;
1204
+ }
1205
+
1206
+ .button-toc span:after {
1207
+ content: '»';
1208
+ position: absolute;
1209
+ opacity: 0;
1210
+ top: 0;
1211
+ right: -20px;
1212
+ transition: 0.5s;
1213
+ }
1214
+
1215
+ .button-toc:hover span {
1216
+ padding-right: 25px;
1217
+ }
1218
+
1219
+ .button-toc:hover span:after {
1220
+ opacity: 1;
1221
+ right: 0;
1222
+ }
1223
+
1224
+ .eztoc-query-success{
1225
+ color: green;
1226
+ }
1227
+ .eztoc-query-error{
1228
+ color: red;
1229
+ }
1230
+ .eztoc_hide{
1231
+ display: none;
1232
+ }
1233
+ .eztoc-result{
1234
+ margin-left: 70px;
1235
+ }
1236
+
1237
+ div#wp-pointer-0{
1238
+ position: absolute;
1239
+ width: 320px;
1240
+ top: 515px!important;
1241
+ left: 146px!important;
1242
+ z-index: 9999;
1243
  }
assets/css/admin.min.css CHANGED
@@ -1,8 +1,8 @@
1
- div.tab_content table {margin-bottom: 1em;}table.more_toc_options_table th, table.more_toc_options_table td {padding: 0;margin: 0;}table.more_toc_options_table th {width: auto;padding-right: 4px;padding-top: 2px;}div.tab_content ul li {margin-left: 2em;list-style-type: disc;}div.tab_content ol li {list-style: inherit;}div.tab_content pre {margin-left: 2em;}ul#tabbed-nav {margin-top: 1em;}#tabbed-nav {margin: 0;padding: 0;float: left;list-style: none;height: 32px;border-bottom: 1px solid #DFDFDF;border-left: 1px solid #DFDFDF;width: 100%;}#tabbed-nav li {float: left;margin: 0;padding: 0;height: 31px;line-height: 31px;border: 1px solid #DFDFDF;border-left: none;margin-bottom: -1px;overflow: hidden;position: relative;background: #F5F5F5;background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#F5F5F5));background-image: -webkit-linear-gradient(center top, #fff, #F5F5F5);background-image: -moz-linear-gradient(center top, #fff, #F5F5F5);background-image: -ms-linear-gradient(center top, #fff, #F5F5F5);background-image: -o-linear-gradient(center top, #fff, #F5F5F5);background-image: linear-gradient(center top, #fff, #F5F5F5);}#tabbed-nav li a {text-decoration: none;color: #000;display: block;font-size: 1.2em;padding: 0 20px;border: 1px solid #fff;outline: none;}#tabbed-nav li a:hover {background: #ECECEC;}html #tabbed-nav li.active, html #tabbed-nav li.active a:hover {background: #fff;border-bottom: 1px solid #fff;}div.tab_container {border: 1px solid #DFDFDF;border-top: none;overflow: hidden;clear: both;float: left;width: 100%;background: #fff;margin-bottom: 2em;padding-bottom: 2em;}div.tab_content {padding: 10px;padding-bottom: 0;font-size: 1em;}h3 span.show_hide {font-size: 0.85em;font-weight: normal;}div.more_toc_options {margin-top: 4px;margin-left: 2em;}div.toc_theme_option {width: 200px;float: left;margin-right: 5px;}#wpcontent select optgroup option {padding-left: 15px;}input#width_custom, input#font_size, input#child_font_size, input#smooth_scroll_offset {width: 50px;text-align: center;}input.custom_colour_option {width: 75px;}table#theme_custom, div#farbtastic_colour_wheel {float: left;}table#theme_custom {margin-top: 30px;}table#theme_custom img {vertical-align: middle;opacity: 0.4;}table#theme_custom img:hover {cursor: pointer;opacity: 1;}div#farbtastic_colour_wheel {margin-left: 20px;}#tab3 h3:not(:first-child) {margin-top: 2em;}#toc input.small-text {width: 50px;padding: 2px;height: 28px;line-height: 28px;vertical-align: bottom;}#toc .form-table tr > th > strong {font-size: 18px;font-style: italic;}.postbox{padding: 10px;}html {scroll-behavior: smooth;}.toc-tab-panel {overflow: hidden;border: 1px solid #ccc;background-color: #fff;margin-top: 15px;}.toc-tab-panel a {background-color: inherit;text-decoration: none;float: left;border: none;outline: none;cursor: pointer;padding: 14px 16px;transition: 0s;font-size: 15px;color: #2271b1;font-weight: 500;}.toc-tab-panel a:hover {color: #0a4b78;}.toc-tab-panel a.active {box-shadow: none;border-bottom: 4px solid #646970;color: #1d2327;}.toc-tab-panel a:focus {box-shadow: none;outline: none;}.eztoc-tabcontent {display: none;border-top: none;animation: fadeEffect 1s;}.eztoc_support_div {background: #fff;margin-top: 10px;padding: 28px;min-width: 255px;border: 1px solid #c3c4c7;box-shadow: 0 1px 1px rgb(0 0 0 / 4%);}.support-label {float: left;width: 70px;font-size: 14px;}.star-mark{color: red;margin-left: 4px;font-family:bold;}.eztoc_support_div li {margin:25px 0px 20px 0px;}.eztoc-query-success{color: green;}.eztoc-query-error{color: red;}.eztoc_hide{display: none;}.eztoc-result{margin-left: 70px;}.eztoc-send-query{margin-left: 70px !important;;}@keyframes fadeEffect {from {opacity: 0;}to {opacity: 1;}}.eztoc-wrapper{max-width: 1090px;width: 100%;display: flex;flex-wrap: wrap;margin: auto;}.eztoc-wrapper .table{margin: 0 auto;background: #fff;width: calc(30%);padding: 30px 20px;position: relative;box-shadow: 0 5px 10px rgb(0 0 0 / 10%);}.table .price-section{display: flex;justify-content: center;}.price-section .price-area{height: 120px;width: 120px;background: #ffd861;border-radius: 50%;padding: 2px;}.price-section .price-area .inner-area{height: 100%;width: 100%;border-radius: 50%;border: 3px solid #fff;color: #fff;line-height: 117px;text-align: center;position: relative;}.price-area .inner-area .text{font-size: 25px;font-weight: 400;position: absolute;top: -10px;left: 17px;}.price-area .inner-area .price{font-size: 55px;font-weight: 500;}.table .package-name{width: 100%;height: 2px;background: #ffecb3;margin: 35px 0;position: relative;}.table .package-name::before{position: absolute;content: "Basic";top: 50%;left: 50%;transform: translate(-50%, -50%);background: #fff;font-size: 25px;padding: 0 10px;font-weight: bolder;}.table .features li{list-style: none;display: flex;justify-content: space-between;margin-bottom: 15px;}.features li .list-name{font-size: 17px;font-weight: 400;}.features li .icon{font-size: 15px;}.features li .icon.check{color: #2db94d;}.features li .icon.cross{color: #cd3241;}.table .btn{display: flex;justify-content: center;margin-top: 35px;}.table .btn button{width: 80%;height: 50px;font-weight: 700;color: #fff;font-size: 20px;border: none;outline: none;border-radius: 25px;cursor: pointer;transition: all 0.3s ease;}.basic .price-area, .basic .inner-area{background: #ffd861;}.basic .btn button{background: #fff;color: #ffd861;border: 2px solid #ffd861;}.basic .btn button:hover{border-radius: 6px;background: #ffd861;color: #fff;}.Premium .price-area, .Premium .inner-area{background: #a26bfa;}.Premium .btn button{background: #fff;color: #a26bfa;border: 2px solid #a26bfa;}.Premium .btn button:hover{border-radius: 6px;background: #a26bfa;color: #fff;}.basic .package-name{background: #ffecb3;}.Premium .package-name{background: #a26bfa;}.basic .package-name::before{content: "Free";}.Premium .package-name::before{content: "PRO";}.basic ::selection, .basic .price-area, .basic .inner-area{background: #ffd861;}.Premium ::selection, .Premium .price-area, .Premium .inner-area{background: #a26bfa;}div#eztoc-tabs a {text-decoration: none;}div#eztoc-tabs a:first-child {color: #000;}a#eztoc-upgrade {color: #b8ef0e;background: #000;padding: 16px;}
2
- div#wp-pointer-0{
3
- position: absolute;
4
- width: 320px;
5
- top: 630px!important;
6
- left: 146px!important;
7
- z-index: 9999;
8
  }
1
+ div.tab_content table {margin-bottom: 1em;}table.more_toc_options_table th, table.more_toc_options_table td {padding: 0;margin: 0;}table.more_toc_options_table th {width: auto;padding-right: 4px;padding-top: 2px;}div.tab_content ul li {margin-left: 2em;list-style-type: disc;}div.tab_content ol li {list-style: inherit;}div.tab_content pre {margin-left: 2em;}ul#tabbed-nav {margin-top: 1em;}#tabbed-nav {margin: 0;padding: 0;float: left;list-style: none;height: 32px;border-bottom: 1px solid #DFDFDF;border-left: 1px solid #DFDFDF;width: 100%;}#tabbed-nav li {float: left;margin: 0;padding: 0;height: 31px;line-height: 31px;border: 1px solid #DFDFDF;border-left: none;margin-bottom: -1px;overflow: hidden;position: relative;background: #F5F5F5;background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#F5F5F5));background-image: -webkit-linear-gradient(center top, #fff, #F5F5F5);background-image: -moz-linear-gradient(center top, #fff, #F5F5F5);background-image: -ms-linear-gradient(center top, #fff, #F5F5F5);background-image: -o-linear-gradient(center top, #fff, #F5F5F5);background-image: linear-gradient(center top, #fff, #F5F5F5);}#tabbed-nav li a {text-decoration: none;color: #000;display: block;font-size: 1.2em;padding: 0 20px;border: 1px solid #fff;outline: none;}#tabbed-nav li a:hover {background: #ECECEC;}html #tabbed-nav li.active, html #tabbed-nav li.active a:hover {background: #fff;border-bottom: 1px solid #fff;}div.tab_container {border: 1px solid #DFDFDF;border-top: none;overflow: hidden;clear: both;float: left;width: 100%;background: #fff;margin-bottom: 2em;padding-bottom: 2em;}div.tab_content {padding: 10px;padding-bottom: 0;font-size: 1em;}h3 span.show_hide {font-size: 0.85em;font-weight: normal;}div.more_toc_options {margin-top: 4px;margin-left: 2em;}div.toc_theme_option {width: 200px;float: left;margin-right: 5px;}#wpcontent select optgroup option {padding-left: 15px;}input#width_custom, input#font_size, input#child_font_size, input#smooth_scroll_offset {width: 50px;text-align: center;}input.custom_colour_option {width: 75px;}table#theme_custom, div#farbtastic_colour_wheel {float: left;}table#theme_custom {margin-top: 30px;}table#theme_custom img {vertical-align: middle;opacity: 0.4;}table#theme_custom img:hover {cursor: pointer;opacity: 1;}div#farbtastic_colour_wheel {margin-left: 20px;}#tab3 h3:not(:first-child) {margin-top: 2em;}#toc input.small-text {width: 50px;padding: 2px;height: 28px;line-height: 28px;vertical-align: bottom;}#toc .form-table tr > th > strong {font-size: 18px;font-style: italic;}.postbox{padding: 10px;}html {scroll-behavior: smooth;}.toc-tab-panel {overflow: hidden;border: 1px solid #ccc;background-color: #fff;margin-top: 15px;}.toc-tab-panel a {background-color: inherit;text-decoration: none;float: left;border: none;outline: none;cursor: pointer;padding: 14px 16px;transition: 0s;font-size: 15px;color: #2271b1;font-weight: 500;}.toc-tab-panel a:hover {color: #0a4b78;}.toc-tab-panel a.active {box-shadow: none;border-bottom: 4px solid #646970;color: #1d2327;}.toc-tab-panel a:focus {box-shadow: none;outline: none;}.eztoc-tabcontent {display: none;border-top: none;animation: fadeEffect 1s;}.eztoc_support_div {background: #fff;margin-top: 10px;padding: 28px;min-width: 255px;border: 1px solid #c3c4c7;box-shadow: 0 1px 1px rgb(0 0 0 / 4%);}.support-label {float: left;width: 70px;font-size: 14px;}.star-mark{color: red;margin-left: 4px;font-family:bold;}.eztoc_support_div li {margin:25px 0px 20px 0px;}.eztoc-query-success{color: green;}.eztoc-query-error{color: red;}.eztoc_hide{display: none;}.eztoc-result{margin-left: 70px;}.eztoc-send-query{margin-left: 70px !important;;}@keyframes fadeEffect {from {opacity: 0;}to {opacity: 1;}}.eztoc-wrapper{max-width: 1090px;width: 100%;display: flex;flex-wrap: wrap;margin: auto;}.eztoc-wrapper .table{margin: 0 auto;background: #fff;width: calc(30%);padding: 30px 20px;position: relative;box-shadow: 0 5px 10px rgb(0 0 0 / 10%);}.table .price-section{display: flex;justify-content: center;}.price-section .price-area{height: 120px;width: 120px;background: #ffd861;border-radius: 50%;padding: 2px;}.price-section .price-area .inner-area{height: 100%;width: 100%;border-radius: 50%;border: 3px solid #fff;color: #fff;line-height: 117px;text-align: center;position: relative;}.price-area .inner-area .text{font-size: 25px;font-weight: 400;position: absolute;top: -10px;left: 17px;}.price-area .inner-area .price{font-size: 55px;font-weight: 500;}.table .package-name{width: 100%;height: 2px;background: #ffecb3;margin: 35px 0;position: relative;}.table .package-name::before{position: absolute;content: "Basic";top: 50%;left: 50%;transform: translate(-50%, -50%);background: #fff;font-size: 25px;padding: 0 10px;font-weight: bolder;}.table .features li{list-style: none;display: flex;justify-content: space-between;margin-bottom: 15px;}.features li .list-name{font-size: 17px;font-weight: 400;}.features li .icon{font-size: 15px;}.features li .icon.check{color: #2db94d;}.features li .icon.cross{color: #cd3241;}.table .btn{display: flex;justify-content: center;margin-top: 35px;}.table .btn button{width: 80%;height: 50px;font-weight: 700;color: #fff;font-size: 20px;border: none;outline: none;border-radius: 25px;cursor: pointer;transition: all 0.3s ease;}.basic .price-area, .basic .inner-area{background: #ffd861;}.basic .btn button{background: #fff;color: #ffd861;border: 2px solid #ffd861;}.basic .btn button:hover{border-radius: 6px;background: #ffd861;color: #fff;}.Premium .price-area, .Premium .inner-area{background: #a26bfa;}.Premium .btn button{background: #fff;color: #a26bfa;border: 2px solid #a26bfa;}.Premium .btn button:hover{border-radius: 6px;background: #a26bfa;color: #fff;}.basic .package-name{background: #ffecb3;}.Premium .package-name{background: #a26bfa;}.basic .package-name::before{content: "Free";}.Premium .package-name::before{content: "PRO";}.basic ::selection, .basic .price-area, .basic .inner-area{background: #ffd861;}.Premium ::selection, .Premium .price-area, .Premium .inner-area{background: #a26bfa;}div#eztoc-tabs a {text-decoration: none;}div#eztoc-tabs a:first-child {color: #000;}a#eztoc-upgrade {color: #b8ef0e;background: #000;padding: 16px;}
2
+ div#wp-pointer-0{
3
+ position: absolute;
4
+ width: 320px;
5
+ top: 630px!important;
6
+ left: 146px!important;
7
+ z-index: 9999;
8
  }
assets/css/ez-toc-sticky.css ADDED
@@ -0,0 +1,417 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #ez-toc-sticky-container {
2
+ background: #FFF;
3
+ border: 1px solid #AAAAAA;
4
+ border-radius: 4px;
5
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
6
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
7
+ display: table;
8
+ /*font-size: 95%;*/
9
+ margin-bottom: 1em;
10
+ padding: 10px;
11
+ position: relative;
12
+ width: auto;
13
+ }
14
+
15
+ div.ez-toc-sticky-widget-container {
16
+ padding: 0;
17
+ position: relative;
18
+ }
19
+
20
+ #ez-toc-sticky-container.ez-toc-sticky-light-blue {
21
+ background: #EDF6FF;
22
+ }
23
+
24
+ #ez-toc-sticky-container.ez-toc-sticky-white {
25
+ background: #FFFFFF;
26
+ }
27
+
28
+ #ez-toc-sticky-container.ez-toc-sticky-black {
29
+ background: #000000;
30
+ }
31
+
32
+ #ez-toc-sticky-container.ez-toc-sticky-transparent {
33
+ background: none transparent;
34
+ }
35
+
36
+ div.ez-toc-sticky-widget-container ul {
37
+ display: block;
38
+ }
39
+
40
+ div.ez-toc-sticky-widget-container li {
41
+ border: none;
42
+ padding: 0;
43
+ }
44
+
45
+ div.ez-toc-sticky-widget-container ul.ez-toc-sticky-list {
46
+ padding: 10px;
47
+ }
48
+
49
+ #ez-toc-sticky-container ul ul,
50
+ .ez-toc div.ez-toc-sticky-widget-container ul ul {
51
+ margin-left: 1.5em;
52
+ }
53
+
54
+ #ez-toc-sticky-container ul,
55
+ #ez-toc-sticky-container li {
56
+ margin: 0;
57
+ padding: 0;
58
+ }
59
+
60
+ #ez-toc-sticky-container ul,
61
+ #ez-toc-sticky-container li,
62
+ #ez-toc-sticky-container ul li,
63
+ div.ez-toc-sticky-widget-container,
64
+ div.ez-toc-sticky-widget-container li {
65
+ background: none;
66
+ list-style: none none;
67
+ line-height: 1.6;
68
+ margin: 0;
69
+ overflow: hidden;
70
+ z-index: 1;
71
+ }
72
+
73
+ /*#ez-toc-sticky-container.have_bullets li {*/
74
+ /*padding-left: 12px;*/
75
+ /*}*/
76
+
77
+ #ez-toc-sticky-container p.ez-toc-sticky-title {
78
+ text-align: left;
79
+ /*font-family: "Arial Narrow", sans-serif;*/
80
+ /*font-size: 120%;*/
81
+ /*font-weight: 500;*/
82
+ line-height: 1.45;
83
+ margin: 0;
84
+ padding: 0;
85
+ }
86
+
87
+ .ez-toc-sticky-title-container {
88
+ display: table;
89
+ width: 100%;
90
+ }
91
+
92
+ .ez-toc-sticky-title,
93
+ .ez-toc-sticky-title-toggle {
94
+ display: table-cell;
95
+ text-align: left;
96
+ vertical-align: middle;
97
+ }
98
+
99
+ #ez-toc-sticky-container.ez-toc-sticky-black p.ez-toc-sticky-title {
100
+ color: #FFF;
101
+ }
102
+
103
+ /*#ez-toc-sticky-container span.ez-toc-sticky-toggle {*/
104
+ /*font-weight: 400;*/
105
+ /*font-size: 90%;*/
106
+ /*}*/
107
+
108
+ #ez-toc-sticky-container div.ez-toc-sticky-title-container + ul.ez-toc-sticky-list {
109
+ margin-top: 1em;
110
+ }
111
+
112
+ .ez-toc-sticky-wrap-left {
113
+ float: left;
114
+ margin-right: 10px;
115
+ }
116
+
117
+ .ez-toc-sticky-wrap-right {
118
+ float: right;
119
+ margin-left: 10px;
120
+ }
121
+
122
+ .ez-toc-sticky-wrap-center {
123
+ margin: 0 auto;
124
+ }
125
+
126
+ #ez-toc-sticky-container a {
127
+ color: #444444;
128
+ box-shadow: none;
129
+ text-decoration: none;
130
+ text-shadow: none;
131
+ }
132
+
133
+ #ez-toc-sticky-container a:visited {
134
+ color: #9f9f9f;
135
+ }
136
+
137
+ #ez-toc-sticky-container a:hover {
138
+ text-decoration: underline;
139
+ }
140
+
141
+ #ez-toc-sticky-container.ez-toc-sticky-black a {
142
+ color: #FFF;
143
+ }
144
+
145
+ #ez-toc-sticky-container.ez-toc-sticky-black a:visited {
146
+ color: #FFF;
147
+ }
148
+
149
+ #ez-toc-sticky-container a.ez-toc-sticky-toggle {
150
+ color: #444444;
151
+ }
152
+
153
+ #ez-toc-sticky-container.counter-hierarchy ul,
154
+ .ez-toc-sticky-widget-container.counter-hierarchy ul,
155
+ #ez-toc-sticky-container.counter-flat ul,
156
+ .ez-toc-sticky-widget-container.counter-flat ul {
157
+ counter-reset: item;
158
+ }
159
+
160
+ #ez-toc-sticky-container.counter-numeric li,
161
+ .ez-toc-sticky-widget-container.counter-numeric li {
162
+ list-style-type: decimal;
163
+ list-style-position: inside;
164
+ }
165
+
166
+ #ez-toc-sticky-container.counter-disc li,
167
+ .ez-toc-sticky-widget-container.counter-disc li {
168
+ list-style-type: disc;
169
+ list-style-position: inside;
170
+ }
171
+
172
+ #ez-toc-sticky-container.counter-hyphen li,
173
+ .ez-toc-sticky-widget-container.counter-hyphen li {
174
+ list-style-type: '-';
175
+ list-style-position: inside;
176
+ }
177
+
178
+
179
+ #ez-toc-sticky-container.counter-decimal ul.ez-toc-sticky-list li a::before,
180
+ .ez-toc-sticky-widget-container.counter-decimal ul.ez-toc-sticky-list li a::before {
181
+ content: counters(item, ".") ". ";
182
+ display: inline-block;
183
+ counter-increment: item;
184
+ margin-right: .2em;
185
+ }
186
+
187
+ #ez-toc-sticky-container.counter-roman li a::before,
188
+ .ez-toc-sticky-widget-container.counter-roman ul.ez-toc-sticky-list li a::before {
189
+ content: counters(item, ".", upper-roman) ". ";
190
+ counter-increment: item;
191
+ }
192
+
193
+ .ez-toc-sticky-widget-container ul.ez-toc-sticky-list li::before {
194
+ content: ' ';
195
+ position: absolute;
196
+ left: 0;
197
+ right: 0;
198
+ height: 30px;
199
+ line-height: 30px;
200
+ z-index: -1;
201
+ }
202
+
203
+ .ez-toc-sticky-widget-container ul.ez-toc-sticky-list li.active {
204
+ background-color: #EDEDED;
205
+ }
206
+
207
+ .ez-toc-sticky-widget-container li.active > a {
208
+ font-weight: 900;
209
+ }
210
+
211
+ .ez-toc-sticky-btn {
212
+ display: inline-block;
213
+ padding: 6px 12px;
214
+ margin-bottom: 0;
215
+ font-size: 14px;
216
+ font-weight: normal;
217
+ line-height: 1.428571429;
218
+ text-align: center;
219
+ white-space: nowrap;
220
+ vertical-align: middle;
221
+ cursor: pointer;
222
+ background-image: none;
223
+ border: 1px solid transparent;
224
+ border-radius: 4px;
225
+ -webkit-user-select: none;
226
+ -moz-user-select: none;
227
+ -ms-user-select: none;
228
+ -o-user-select: none;
229
+ user-select: none
230
+ }
231
+
232
+ .ez-toc-sticky-btn:focus {
233
+ outline: thin dotted #333;
234
+ outline: 5px auto -webkit-focus-ring-color;
235
+ outline-offset: -2px
236
+ }
237
+
238
+ .ez-toc-sticky-btn:hover, .ez-toc-sticky-btn:focus {
239
+ color: #333;
240
+ text-decoration: none
241
+ }
242
+
243
+ .ez-toc-sticky-btn:active, .ez-toc-sticky-btn.active {
244
+ background-image: none;
245
+ outline: 0;
246
+ -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
247
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125)
248
+ }
249
+
250
+ .ez-toc-sticky-btn-default {
251
+ color: #333;
252
+ background-color: #fff;
253
+ border-color: #ccc
254
+ }
255
+
256
+ .ez-toc-sticky-btn-default:hover, .ez-toc-sticky-btn-default:focus, .ez-toc-sticky-btn-default:active, .ez-toc-sticky-btn-default.active {
257
+ color: #333;
258
+ background-color: #ebebeb;
259
+ border-color: #adadad
260
+ }
261
+
262
+ .ez-toc-sticky-btn-default:active, .ez-toc-sticky-btn-default.active {
263
+ background-image: none
264
+ }
265
+
266
+ /*.btn-lg {*/
267
+ /*padding: 10px 16px;*/
268
+ /*font-size: 18px;*/
269
+ /*line-height: 1.33;*/
270
+ /*border-radius: 6px*/
271
+ /*}*/
272
+
273
+ .ez-toc-sticky-btn-sm, .ez-toc-sticky-btn-xs {
274
+ padding: 5px 10px;
275
+ font-size: 12px;
276
+ line-height: 1.5;
277
+ border-radius: 3px
278
+ }
279
+
280
+ .ez-toc-sticky-btn-xs {
281
+ padding: 1px 5px
282
+ }
283
+
284
+ .ez-toc-sticky-btn-default {
285
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
286
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075);
287
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 1px 1px rgba(0, 0, 0, 0.075)
288
+ }
289
+
290
+ .ez-toc-sticky-btn-default:active {
291
+ -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
292
+ box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125)
293
+ }
294
+
295
+ .ez-toc-sticky-btn:active, .btn.active {
296
+ background-image: none
297
+ }
298
+
299
+ .ez-toc-sticky-btn-default {
300
+ text-shadow: 0 1px 0 #fff;
301
+ background-image: -webkit-gradient(linear, left 0, left 100%, from(#fff), to(#e0e0e0));
302
+ background-image: -webkit-linear-gradient(top, #fff 0, #e0e0e0 100%);
303
+ background-image: -moz-linear-gradient(top, #fff 0, #e0e0e0 100%);
304
+ background-image: linear-gradient(to bottom, #fff 0, #e0e0e0 100%);
305
+ background-repeat: repeat-x;
306
+ border-color: #dbdbdb;
307
+ border-color: #ccc;
308
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
309
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false)
310
+ }
311
+
312
+ .ez-toc-sticky-btn-default:hover, .ez-toc-sticky-btn-default:focus {
313
+ background-color: #e0e0e0;
314
+ background-position: 0 -15px
315
+ }
316
+
317
+ .ez-toc-sticky-btn-default:active, .ez-toc-sticky-btn-default.active {
318
+ background-color: #e0e0e0;
319
+ border-color: #dbdbdb
320
+ }
321
+
322
+ .ez-toc-sticky-pull-right {
323
+ float: right !important;
324
+ margin-left: 10px;
325
+ }
326
+
327
+ .ez-toc-sticky-glyphicon {
328
+ position: relative;
329
+ top: 1px;
330
+ display: inline-block;
331
+ font-family: 'Glyphicons Halflings';
332
+ -webkit-font-smoothing: antialiased;
333
+ font-style: normal;
334
+ font-weight: normal;
335
+ line-height: 1;
336
+ -moz-osx-font-smoothing: grayscale
337
+ }
338
+
339
+ .ez-toc-sticky-glyphicon:empty {
340
+ width: 1em
341
+ }
342
+
343
+ .ez-toc-sticky-toggle i.ez-toc-sticky-glyphicon {
344
+ font-size: 16px;
345
+ margin-left: 2px;
346
+ }
347
+
348
+ [class*="ez-toc-sticky-icon-"] {
349
+ font-family: 'ez-toc-sticky-icomoon' !important; /* For better glyphicon compatibility */
350
+ speak: none;
351
+ font-style: normal;
352
+ font-weight: normal;
353
+ font-variant: normal;
354
+ text-transform: none;
355
+ line-height: 1;
356
+
357
+ /* Better Font Rendering =========== */
358
+ -webkit-font-smoothing: antialiased;
359
+ -moz-osx-font-smoothing: grayscale;
360
+ }
361
+
362
+ .ez-toc-sticky-icon-toggle:before {
363
+ content: "\e87a";
364
+ }
365
+
366
+ #ez-toc-sticky-container input {
367
+ position: absolute;
368
+ left: -999em;
369
+ }
370
+
371
+ #ez-toc-sticky-container input[type="checkbox"]:checked + nav {
372
+ opacity: 0;
373
+ max-height: 0;
374
+ border: none;
375
+ display: none;
376
+ }
377
+
378
+ #ez-toc-sticky-container label {
379
+ float: right;
380
+ position: relative;
381
+ left: 10px;
382
+ font-size: 16px;
383
+ background: #f9efef;
384
+ padding: 0px 4px 0px 5px;
385
+ border: 1px solid #999191;
386
+ border-radius: 5px;
387
+ cursor: pointer;
388
+ }
389
+
390
+ div#ez-toc-sticky-container p.ez-toc-sticky-title {
391
+ display: contents;
392
+ }
393
+
394
+ div#ez-toc-sticky-container {
395
+ padding-right: 20px;
396
+ }
397
+
398
+ label.cssicon .ez-toc-sticky-glyphicon:empty {
399
+ font-size: 16px;
400
+ margin-left: 2px;
401
+ }
402
+
403
+ label.cssiconcheckbox {
404
+ display: none;
405
+ }
406
+
407
+ div#ez-toc-sticky-container.afterpara + p {
408
+ display: none;
409
+ }
410
+
411
+ .ez-toc-sticky-widget-container ul li a {
412
+ padding-left: 10px;
413
+ }
414
+
415
+ .ez-toc-sticky-widget-container ul.ez-toc-sticky-list li.active {
416
+ height: auto !important;
417
+ }
assets/css/ez-toc-sticky.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #ez-toc-sticky-container{background:#fff;border:1px solid #aaa;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05);display:table;margin-bottom:1em;padding:10px;position:relative;width:auto}div.ez-toc-sticky-widget-container{padding:0;position:relative}#ez-toc-sticky-container.ez-toc-sticky-light-blue{background:#edf6ff}#ez-toc-sticky-container.ez-toc-sticky-white{background:#fff}#ez-toc-sticky-container.ez-toc-sticky-black{background:#000}#ez-toc-sticky-container.ez-toc-sticky-transparent{background:none}div.ez-toc-sticky-widget-container ul{display:block}div.ez-toc-sticky-widget-container li{border:none;padding:0}div.ez-toc-sticky-widget-container ul.ez-toc-sticky-list{padding:10px}#ez-toc-sticky-container ul ul,.ez-toc div.ez-toc-sticky-widget-container ul ul{margin-left:1.5em}#ez-toc-sticky-container li,#ez-toc-sticky-container ul{padding:0}#ez-toc-sticky-container li,#ez-toc-sticky-container ul,#ez-toc-sticky-container ul li,div.ez-toc-sticky-widget-container,div.ez-toc-sticky-widget-container li{background:0 0;list-style:none;line-height:1.6;margin:0;overflow:hidden;z-index:1}#ez-toc-sticky-container p.ez-toc-sticky-title{text-align:left;line-height:1.45;margin:0;padding:0}.ez-toc-sticky-title-container{display:table;width:100%}.ez-toc-sticky-title,.ez-toc-sticky-title-toggle{display:table-cell;text-align:left;vertical-align:middle}#ez-toc-sticky-container.ez-toc-sticky-black a,#ez-toc-sticky-container.ez-toc-sticky-black a:visited,#ez-toc-sticky-container.ez-toc-sticky-black p.ez-toc-sticky-title{color:#fff}#ez-toc-sticky-container div.ez-toc-sticky-title-container+ul.ez-toc-sticky-list{margin-top:1em}.ez-toc-sticky-wrap-left{float:left;margin-right:10px}.ez-toc-sticky-wrap-right{float:right;margin-left:10px}.ez-toc-sticky-wrap-center{margin:0 auto}#ez-toc-sticky-container a{color:#444;box-shadow:none;text-decoration:none;text-shadow:none}#ez-toc-sticky-container a:visited{color:#9f9f9f}#ez-toc-sticky-container a:hover{text-decoration:underline}#ez-toc-sticky-container a.ez-toc-sticky-toggle{color:#444}#ez-toc-sticky-container.counter-flat ul,#ez-toc-sticky-container.counter-hierarchy ul,.ez-toc-sticky-widget-container.counter-flat ul,.ez-toc-sticky-widget-container.counter-hierarchy ul{counter-reset:item}#ez-toc-sticky-container.counter-numeric li,.ez-toc-sticky-widget-container.counter-numeric li{list-style-type:decimal;list-style-position:inside}#ez-toc-sticky-container.counter-disc li,.ez-toc-sticky-widget-container.counter-disc li{list-style-type:disc;list-style-position:inside}#ez-toc-sticky-container.counter-hyphen li,.ez-toc-sticky-widget-container.counter-hyphen li{list-style-type:'-';list-style-position:inside}#ez-toc-sticky-container.counter-decimal ul.ez-toc-sticky-list li a::before,.ez-toc-sticky-widget-container.counter-decimal ul.ez-toc-sticky-list li a::before{content:counters(item, ".") ". ";display:inline-block;counter-increment:item;margin-right:.2em}#ez-toc-sticky-container.counter-roman li a::before,.ez-toc-sticky-widget-container.counter-roman ul.ez-toc-sticky-list li a::before{content:counters(item, ".", upper-roman) ". ";counter-increment:item}.ez-toc-sticky-widget-container ul.ez-toc-sticky-list li::before{content:' ';position:absolute;left:0;right:0;height:30px;line-height:30px;z-index:-1}.ez-toc-sticky-widget-container ul.ez-toc-sticky-list li.active{background-color:#ededed;height:auto!important}.ez-toc-sticky-widget-container li.active>a{font-weight:900}.ez-toc-sticky-btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.ez-toc-sticky-btn:focus{outline:#333 dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.ez-toc-sticky-btn:focus,.ez-toc-sticky-btn:hover{color:#333;text-decoration:none}.ez-toc-sticky-btn.active,.ez-toc-sticky-btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.ez-toc-sticky-btn-default{color:#333;background-color:#fff;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);text-shadow:0 1px 0 #fff;background-image:-webkit-gradient(linear,left 0,left 100%,from(#fff),to(#e0e0e0));background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:-moz-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);background-repeat:repeat-x;border-color:#ccc}.ez-toc-sticky-btn-default.active,.ez-toc-sticky-btn-default:active,.ez-toc-sticky-btn-default:focus,.ez-toc-sticky-btn-default:hover{color:#333;background-color:#ebebeb;border-color:#adadad}.ez-toc-sticky-btn-default.active,.ez-toc-sticky-btn-default:active{background-image:none;background-color:#e0e0e0;border-color:#dbdbdb}.ez-toc-sticky-btn-sm,.ez-toc-sticky-btn-xs{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.ez-toc-sticky-glyphicon,[class*=ez-toc-sticky-icon-]{font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.ez-toc-sticky-btn-xs{padding:1px 5px}.ez-toc-sticky-btn-default:active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.active,.ez-toc-sticky-btn:active{background-image:none}.ez-toc-sticky-btn-default:focus,.ez-toc-sticky-btn-default:hover{background-color:#e0e0e0;background-position:0 -15px}.ez-toc-sticky-pull-right{float:right!important;margin-left:10px}.ez-toc-sticky-glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings'}.ez-toc-sticky-glyphicon:empty{width:1em}.ez-toc-sticky-toggle i.ez-toc-sticky-glyphicon,label.cssicon .ez-toc-sticky-glyphicon:empty{font-size:16px;margin-left:2px}[class*=ez-toc-sticky-icon-]{font-family:ez-toc-sticky-icomoon!important;speak:none;font-variant:normal;text-transform:none}.ez-toc-sticky-icon-toggle:before{content:"\e87a"}#ez-toc-sticky-container input{position:absolute;left:-999em}#ez-toc-sticky-container input[type=checkbox]:checked+nav{opacity:0;max-height:0;border:none;display:none}#ez-toc-sticky-container label{float:right;position:relative;left:10px;font-size:16px;background:#f9efef;padding:0 4px 0 5px;border:1px solid #999191;border-radius:5px;cursor:pointer}div#ez-toc-sticky-container p.ez-toc-sticky-title{display:contents}div#ez-toc-sticky-container{padding-right:20px}div#ez-toc-sticky-container.afterpara+p,label.cssiconcheckbox{display:none}.ez-toc-sticky-widget-container ul li a{padding-left:10px}
assets/css/screen.css CHANGED
@@ -1,408 +1,411 @@
1
- #ez-toc-container {
2
- background: #F9F9F9;
3
- border: 1px solid #AAAAAA;
4
- border-radius: 4px;
5
- -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
6
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
7
- display: table;
8
- /*font-size: 95%;*/
9
- margin-bottom: 1em;
10
- padding: 10px;
11
- position: relative;
12
- width: auto;
13
- }
14
-
15
- div.ez-toc-widget-container {
16
- padding: 0;
17
- position: relative;
18
- }
19
-
20
- #ez-toc-container.ez-toc-light-blue {
21
- background: #EDF6FF;
22
- }
23
-
24
- #ez-toc-container.ez-toc-white {
25
- background: #FFFFFF;
26
- }
27
-
28
- #ez-toc-container.ez-toc-black {
29
- background: #000000;
30
- }
31
-
32
- #ez-toc-container.ez-toc-transparent {
33
- background: none transparent;
34
- }
35
-
36
- div.ez-toc-widget-container ul {
37
- display: block;
38
- }
39
-
40
- div.ez-toc-widget-container li {
41
- border: none;
42
- padding: 0;
43
- }
44
-
45
- div.ez-toc-widget-container ul.ez-toc-list {
46
- padding: 10px;
47
- }
48
-
49
- #ez-toc-container ul ul,
50
- .ez-toc div.ez-toc-widget-container ul ul {
51
- margin-left: 1.5em;
52
- }
53
-
54
- #ez-toc-container ul,
55
- #ez-toc-container li {
56
- margin: 0;
57
- padding: 0;
58
- }
59
-
60
- #ez-toc-container ul,
61
- #ez-toc-container li,
62
- #ez-toc-container ul li,
63
- div.ez-toc-widget-container,
64
- div.ez-toc-widget-container li {
65
- background: none;
66
- list-style: none none;
67
- line-height: 1.6;
68
- margin: 0;
69
- overflow: hidden;
70
- z-index: 1;
71
- }
72
-
73
- /*#ez-toc-container.have_bullets li {*/
74
- /*padding-left: 12px;*/
75
- /*}*/
76
-
77
- #ez-toc-container p.ez-toc-title {
78
- text-align: left;
79
- /*font-family: "Arial Narrow", sans-serif;*/
80
- /*font-size: 120%;*/
81
- /*font-weight: 500;*/
82
- line-height: 1.45;
83
- margin: 0;
84
- padding: 0;
85
- }
86
-
87
- .ez-toc-title-container {
88
- display: table;
89
- width: 100%;
90
- }
91
-
92
- .ez-toc-title,
93
- .ez-toc-title-toggle {
94
- display: table-cell;
95
- text-align: left;
96
- vertical-align: middle;
97
- }
98
-
99
- #ez-toc-container.ez-toc-black p.ez-toc-title {
100
- color: #FFF;
101
- }
102
-
103
- /*#ez-toc-container span.ez-toc-toggle {*/
104
- /*font-weight: 400;*/
105
- /*font-size: 90%;*/
106
- /*}*/
107
-
108
- #ez-toc-container div.ez-toc-title-container + ul.ez-toc-list {
109
- margin-top: 1em;
110
- }
111
-
112
- .ez-toc-wrap-left {
113
- float: left;
114
- margin-right: 10px;
115
- }
116
-
117
- .ez-toc-wrap-right {
118
- float: right;
119
- margin-left: 10px;
120
- }
121
- .ez-toc-wrap-center {
122
- margin: 0 auto;
123
- }
124
- #ez-toc-container a {
125
- color: #444444;
126
- box-shadow: none;
127
- text-decoration: none;
128
- text-shadow: none;
129
- }
130
-
131
- #ez-toc-container a:visited {
132
- color: #9f9f9f;
133
- }
134
-
135
- #ez-toc-container a:hover {
136
- text-decoration: underline;
137
- }
138
-
139
- #ez-toc-container.ez-toc-black a {
140
- color: #FFF;
141
- }
142
-
143
- #ez-toc-container.ez-toc-black a:visited {
144
- color: #FFF;
145
- }
146
-
147
- #ez-toc-container a.ez-toc-toggle {
148
- color: #444444;
149
- }
150
-
151
- #ez-toc-container.counter-hierarchy ul,
152
- .ez-toc-widget-container.counter-hierarchy ul,
153
- #ez-toc-container.counter-flat ul,
154
- .ez-toc-widget-container.counter-flat ul {
155
- counter-reset: item;
156
- }
157
-
158
- #ez-toc-container.counter-numeric li,
159
- .ez-toc-widget-container.counter-numeric li {
160
- list-style-type: decimal;
161
- list-style-position: inside;
162
- }
163
-
164
- #ez-toc-container.counter-disc li,
165
- .ez-toc-widget-container.counter-disc li {
166
- list-style-type: disc;
167
- list-style-position: inside;
168
- }
169
-
170
- #ez-toc-container.counter-hyphen li,
171
- .ez-toc-widget-container.counter-hyphen li {
172
- list-style-type: '-';
173
- list-style-position: inside;
174
- }
175
-
176
-
177
-
178
-
179
- #ez-toc-container.counter-decimal ul.ez-toc-list li a::before,
180
- .ez-toc-widget-container.counter-decimal ul.ez-toc-list li a::before {
181
- content: counters(item, ".") ". ";
182
- display: inline-block;
183
- counter-increment: item;
184
- margin-right: .2em;
185
- }
186
-
187
- #ez-toc-container.counter-roman li a::before,
188
- .ez-toc-widget-container.counter-roman ul.ez-toc-list li a::before {
189
- content: counters(item, ".", upper-roman) ". ";
190
- counter-increment: item;
191
- }
192
-
193
- .ez-toc-widget-container ul.ez-toc-list li::before {
194
- content: ' ';
195
- position: absolute;
196
- left: 0;
197
- right: 0;
198
- height: 30px;
199
- line-height: 30px;
200
- z-index: -1;
201
- }
202
-
203
- .ez-toc-widget-container ul.ez-toc-list li.active {
204
- background-color: #EDEDED;
205
- }
206
-
207
- .ez-toc-widget-container li.active > a {
208
- font-weight: 900;
209
- }
210
-
211
- .ez-toc-btn {
212
- display: inline-block;
213
- padding: 6px 12px;
214
- margin-bottom: 0;
215
- font-size: 14px;
216
- font-weight: normal;
217
- line-height: 1.428571429;
218
- text-align: center;
219
- white-space: nowrap;
220
- vertical-align: middle;
221
- cursor: pointer;
222
- background-image: none;
223
- border: 1px solid transparent;
224
- border-radius: 4px;
225
- -webkit-user-select: none;
226
- -moz-user-select: none;
227
- -ms-user-select: none;
228
- -o-user-select: none;
229
- user-select: none
230
- }
231
-
232
- .ez-toc-btn:focus {
233
- outline: thin dotted #333;
234
- outline: 5px auto -webkit-focus-ring-color;
235
- outline-offset: -2px
236
- }
237
-
238
- .ez-toc-btn:hover,.ez-toc-btn:focus {
239
- color: #333;
240
- text-decoration: none
241
- }
242
-
243
- .ez-toc-btn:active,.ez-toc-btn.active {
244
- background-image: none;
245
- outline: 0;
246
- -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);
247
- box-shadow: inset 0 3px 5px rgba(0,0,0,0.125)
248
- }
249
-
250
- .ez-toc-btn-default {
251
- color: #333;
252
- background-color: #fff;
253
- border-color: #ccc
254
- }
255
-
256
- .ez-toc-btn-default:hover,.ez-toc-btn-default:focus,.ez-toc-btn-default:active,.ez-toc-btn-default.active {
257
- color: #333;
258
- background-color: #ebebeb;
259
- border-color: #adadad
260
- }
261
-
262
- .ez-toc-btn-default:active,.ez-toc-btn-default.active {
263
- background-image: none
264
- }
265
-
266
- /*.btn-lg {*/
267
- /*padding: 10px 16px;*/
268
- /*font-size: 18px;*/
269
- /*line-height: 1.33;*/
270
- /*border-radius: 6px*/
271
- /*}*/
272
-
273
- .ez-toc-btn-sm,.ez-toc-btn-xs {
274
- padding: 5px 10px;
275
- font-size: 12px;
276
- line-height: 1.5;
277
- border-radius: 3px
278
- }
279
-
280
- .ez-toc-btn-xs {
281
- padding: 1px 5px
282
- }
283
-
284
- .ez-toc-btn-default {
285
- text-shadow: 0 -1px 0 rgba(0,0,0,0.2);
286
- -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);
287
- box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075)
288
- }
289
-
290
- .ez-toc-btn-default:active {
291
- -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);
292
- box-shadow: inset 0 3px 5px rgba(0,0,0,0.125)
293
- }
294
-
295
- .ez-toc-btn:active,.btn.active {
296
- background-image: none
297
- }
298
-
299
- .ez-toc-btn-default {
300
- text-shadow: 0 1px 0 #fff;
301
- background-image: -webkit-gradient(linear,left 0,left 100%,from(#fff),to(#e0e0e0));
302
- background-image: -webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);
303
- background-image: -moz-linear-gradient(top,#fff 0,#e0e0e0 100%);
304
- background-image: linear-gradient(to bottom,#fff 0,#e0e0e0 100%);
305
- background-repeat: repeat-x;
306
- border-color: #dbdbdb;
307
- border-color: #ccc;
308
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe0e0e0',GradientType=0);
309
- filter: progid:DXImageTransform.Microsoft.gradient(enabled=false)
310
- }
311
-
312
- .ez-toc-btn-default:hover,.ez-toc-btn-default:focus {
313
- background-color: #e0e0e0;
314
- background-position: 0 -15px
315
- }
316
-
317
- .ez-toc-btn-default:active,.ez-toc-btn-default.active {
318
- background-color: #e0e0e0;
319
- border-color: #dbdbdb
320
- }
321
-
322
- .ez-toc-pull-right {
323
- float: right !important;
324
- margin-left: 10px;
325
- }
326
-
327
- .ez-toc-glyphicon {
328
- position: relative;
329
- top: 1px;
330
- display: inline-block;
331
- font-family: 'Glyphicons Halflings';
332
- -webkit-font-smoothing: antialiased;
333
- font-style: normal;
334
- font-weight: normal;
335
- line-height: 1;
336
- -moz-osx-font-smoothing: grayscale
337
- }
338
-
339
- .ez-toc-glyphicon:empty {
340
- width: 1em
341
- }
342
-
343
- .ez-toc-toggle i.ez-toc-glyphicon {
344
- font-size: 16px;
345
- margin-left: 2px;
346
- }
347
-
348
- [class*="ez-toc-icon-"] {
349
- font-family: 'ez-toc-icomoon' !important; /* For better glyphicon compatibility */
350
- speak: none;
351
- font-style: normal;
352
- font-weight: normal;
353
- font-variant: normal;
354
- text-transform: none;
355
- line-height: 1;
356
-
357
- /* Better Font Rendering =========== */
358
- -webkit-font-smoothing: antialiased;
359
- -moz-osx-font-smoothing: grayscale;
360
- }
361
-
362
- .ez-toc-icon-toggle:before {
363
- content: "\e87a";
364
- }
365
- #ez-toc-container input {
366
- position: absolute;
367
- left: -999em;
368
- }
369
- #ez-toc-container input[type="checkbox"]:checked + nav {
370
- opacity: 0;
371
- max-height: 0;
372
- border: none;
373
- display: none;
374
- }
375
-
376
- #ez-toc-container label {
377
- float: right;
378
- position: relative;
379
- left: 10px;
380
- font-size: 16px;
381
- background: #f9efef;
382
- padding: 0px 4px 0px 5px;
383
- border: 1px solid #999191;
384
- border-radius: 5px;
385
- cursor: pointer;
386
- }
387
- div#ez-toc-container p.ez-toc-title {
388
- display: contents;
389
- }
390
- div#ez-toc-container {
391
- padding-right: 20px;
392
- }
393
-
394
- label.cssicon .ez-toc-glyphicon:empty {
395
- font-size: 16px;
396
- margin-left: 2px;
397
- }
398
-
399
- label.cssiconcheckbox {
400
- display: none;
401
- }
402
-
403
- div#ez-toc-container.afterpara + p {
404
- display: none;
405
- }
406
- .ez-toc-widget-container ul li a {
407
- padding-left: 10px;
 
 
 
408
  }
1
+ #ez-toc-container {
2
+ background: #F9F9F9;
3
+ border: 1px solid #AAAAAA;
4
+ border-radius: 4px;
5
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
6
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
7
+ display: table;
8
+ /*font-size: 95%;*/
9
+ margin-bottom: 1em;
10
+ padding: 10px;
11
+ position: relative;
12
+ width: auto;
13
+ }
14
+
15
+ div.ez-toc-widget-container {
16
+ padding: 0;
17
+ position: relative;
18
+ }
19
+
20
+ #ez-toc-container.ez-toc-light-blue {
21
+ background: #EDF6FF;
22
+ }
23
+
24
+ #ez-toc-container.ez-toc-white {
25
+ background: #FFFFFF;
26
+ }
27
+
28
+ #ez-toc-container.ez-toc-black {
29
+ background: #000000;
30
+ }
31
+
32
+ #ez-toc-container.ez-toc-transparent {
33
+ background: none transparent;
34
+ }
35
+
36
+ div.ez-toc-widget-container ul {
37
+ display: block;
38
+ }
39
+
40
+ div.ez-toc-widget-container li {
41
+ border: none;
42
+ padding: 0;
43
+ }
44
+
45
+ div.ez-toc-widget-container ul.ez-toc-list {
46
+ padding: 10px;
47
+ }
48
+
49
+ #ez-toc-container ul ul,
50
+ .ez-toc div.ez-toc-widget-container ul ul {
51
+ margin-left: 1.5em;
52
+ }
53
+
54
+ #ez-toc-container ul,
55
+ #ez-toc-container li {
56
+ margin: 0;
57
+ padding: 0;
58
+ }
59
+
60
+ #ez-toc-container ul,
61
+ #ez-toc-container li,
62
+ #ez-toc-container ul li,
63
+ div.ez-toc-widget-container,
64
+ div.ez-toc-widget-container li {
65
+ background: none;
66
+ list-style: none none;
67
+ line-height: 1.6;
68
+ margin: 0;
69
+ overflow: hidden;
70
+ z-index: 1;
71
+ }
72
+
73
+ /*#ez-toc-container.have_bullets li {*/
74
+ /*padding-left: 12px;*/
75
+ /*}*/
76
+
77
+ #ez-toc-container p.ez-toc-title {
78
+ text-align: left;
79
+ /*font-family: "Arial Narrow", sans-serif;*/
80
+ /*font-size: 120%;*/
81
+ /*font-weight: 500;*/
82
+ line-height: 1.45;
83
+ margin: 0;
84
+ padding: 0;
85
+ }
86
+
87
+ .ez-toc-title-container {
88
+ display: table;
89
+ width: 100%;
90
+ }
91
+
92
+ .ez-toc-title,
93
+ .ez-toc-title-toggle {
94
+ display: table-cell;
95
+ text-align: left;
96
+ vertical-align: middle;
97
+ }
98
+
99
+ #ez-toc-container.ez-toc-black p.ez-toc-title {
100
+ color: #FFF;
101
+ }
102
+
103
+ /*#ez-toc-container span.ez-toc-toggle {*/
104
+ /*font-weight: 400;*/
105
+ /*font-size: 90%;*/
106
+ /*}*/
107
+
108
+ #ez-toc-container div.ez-toc-title-container + ul.ez-toc-list {
109
+ margin-top: 1em;
110
+ }
111
+
112
+ .ez-toc-wrap-left {
113
+ float: left;
114
+ margin-right: 10px;
115
+ }
116
+
117
+ .ez-toc-wrap-right {
118
+ float: right;
119
+ margin-left: 10px;
120
+ }
121
+ .ez-toc-wrap-center {
122
+ margin: 0 auto;
123
+ }
124
+ #ez-toc-container a {
125
+ color: #444444;
126
+ box-shadow: none;
127
+ text-decoration: none;
128
+ text-shadow: none;
129
+ }
130
+
131
+ #ez-toc-container a:visited {
132
+ color: #9f9f9f;
133
+ }
134
+
135
+ #ez-toc-container a:hover {
136
+ text-decoration: underline;
137
+ }
138
+
139
+ #ez-toc-container.ez-toc-black a {
140
+ color: #FFF;
141
+ }
142
+
143
+ #ez-toc-container.ez-toc-black a:visited {
144
+ color: #FFF;
145
+ }
146
+
147
+ #ez-toc-container a.ez-toc-toggle {
148
+ color: #444444;
149
+ }
150
+
151
+ #ez-toc-container.counter-hierarchy ul,
152
+ .ez-toc-widget-container.counter-hierarchy ul,
153
+ #ez-toc-container.counter-flat ul,
154
+ .ez-toc-widget-container.counter-flat ul {
155
+ counter-reset: item;
156
+ }
157
+
158
+ #ez-toc-container.counter-numeric li,
159
+ .ez-toc-widget-container.counter-numeric li {
160
+ list-style-type: decimal;
161
+ list-style-position: inside;
162
+ }
163
+
164
+ #ez-toc-container.counter-disc li,
165
+ .ez-toc-widget-container.counter-disc li {
166
+ list-style-type: disc;
167
+ list-style-position: inside;
168
+ }
169
+
170
+ #ez-toc-container.counter-hyphen li,
171
+ .ez-toc-widget-container.counter-hyphen li {
172
+ list-style-type: '-';
173
+ list-style-position: inside;
174
+ }
175
+
176
+
177
+
178
+
179
+ #ez-toc-container.counter-decimal ul.ez-toc-list li a::before,
180
+ .ez-toc-widget-container.counter-decimal ul.ez-toc-list li a::before {
181
+ content: counters(item, ".") ". ";
182
+ display: inline-block;
183
+ counter-increment: item;
184
+ margin-right: .2em;
185
+ }
186
+
187
+ #ez-toc-container.counter-roman li a::before,
188
+ .ez-toc-widget-container.counter-roman ul.ez-toc-list li a::before {
189
+ content: counters(item, ".", upper-roman) ". ";
190
+ counter-increment: item;
191
+ }
192
+
193
+ .ez-toc-widget-container ul.ez-toc-list li::before {
194
+ content: ' ';
195
+ position: absolute;
196
+ left: 0;
197
+ right: 0;
198
+ height: 30px;
199
+ line-height: 30px;
200
+ z-index: -1;
201
+ }
202
+
203
+ .ez-toc-widget-container ul.ez-toc-list li.active {
204
+ background-color: #EDEDED;
205
+ }
206
+
207
+ .ez-toc-widget-container li.active > a {
208
+ font-weight: 900;
209
+ }
210
+
211
+ .ez-toc-btn {
212
+ display: inline-block;
213
+ padding: 6px 12px;
214
+ margin-bottom: 0;
215
+ font-size: 14px;
216
+ font-weight: normal;
217
+ line-height: 1.428571429;
218
+ text-align: center;
219
+ white-space: nowrap;
220
+ vertical-align: middle;
221
+ cursor: pointer;
222
+ background-image: none;
223
+ border: 1px solid transparent;
224
+ border-radius: 4px;
225
+ -webkit-user-select: none;
226
+ -moz-user-select: none;
227
+ -ms-user-select: none;
228
+ -o-user-select: none;
229
+ user-select: none
230
+ }
231
+
232
+ .ez-toc-btn:focus {
233
+ outline: thin dotted #333;
234
+ outline: 5px auto -webkit-focus-ring-color;
235
+ outline-offset: -2px
236
+ }
237
+
238
+ .ez-toc-btn:hover,.ez-toc-btn:focus {
239
+ color: #333;
240
+ text-decoration: none
241
+ }
242
+
243
+ .ez-toc-btn:active,.ez-toc-btn.active {
244
+ background-image: none;
245
+ outline: 0;
246
+ -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);
247
+ box-shadow: inset 0 3px 5px rgba(0,0,0,0.125)
248
+ }
249
+
250
+ .ez-toc-btn-default {
251
+ color: #333;
252
+ background-color: #fff;
253
+ border-color: #ccc
254
+ }
255
+
256
+ .ez-toc-btn-default:hover,.ez-toc-btn-default:focus,.ez-toc-btn-default:active,.ez-toc-btn-default.active {
257
+ color: #333;
258
+ background-color: #ebebeb;
259
+ border-color: #adadad
260
+ }
261
+
262
+ .ez-toc-btn-default:active,.ez-toc-btn-default.active {
263
+ background-image: none
264
+ }
265
+
266
+ /*.btn-lg {*/
267
+ /*padding: 10px 16px;*/
268
+ /*font-size: 18px;*/
269
+ /*line-height: 1.33;*/
270
+ /*border-radius: 6px*/
271
+ /*}*/
272
+
273
+ .ez-toc-btn-sm,.ez-toc-btn-xs {
274
+ padding: 5px 10px;
275
+ font-size: 12px;
276
+ line-height: 1.5;
277
+ border-radius: 3px
278
+ }
279
+
280
+ .ez-toc-btn-xs {
281
+ padding: 1px 5px
282
+ }
283
+
284
+ .ez-toc-btn-default {
285
+ text-shadow: 0 -1px 0 rgba(0,0,0,0.2);
286
+ -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);
287
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075)
288
+ }
289
+
290
+ .ez-toc-btn-default:active {
291
+ -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);
292
+ box-shadow: inset 0 3px 5px rgba(0,0,0,0.125)
293
+ }
294
+
295
+ .ez-toc-btn:active,.btn.active {
296
+ background-image: none
297
+ }
298
+
299
+ .ez-toc-btn-default {
300
+ text-shadow: 0 1px 0 #fff;
301
+ background-image: -webkit-gradient(linear,left 0,left 100%,from(#fff),to(#e0e0e0));
302
+ background-image: -webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);
303
+ background-image: -moz-linear-gradient(top,#fff 0,#e0e0e0 100%);
304
+ background-image: linear-gradient(to bottom,#fff 0,#e0e0e0 100%);
305
+ background-repeat: repeat-x;
306
+ border-color: #dbdbdb;
307
+ border-color: #ccc;
308
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe0e0e0',GradientType=0);
309
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false)
310
+ }
311
+
312
+ .ez-toc-btn-default:hover,.ez-toc-btn-default:focus {
313
+ background-color: #e0e0e0;
314
+ background-position: 0 -15px
315
+ }
316
+
317
+ .ez-toc-btn-default:active,.ez-toc-btn-default.active {
318
+ background-color: #e0e0e0;
319
+ border-color: #dbdbdb
320
+ }
321
+
322
+ .ez-toc-pull-right {
323
+ float: right !important;
324
+ margin-left: 10px;
325
+ }
326
+
327
+ .ez-toc-glyphicon {
328
+ position: relative;
329
+ top: 1px;
330
+ display: inline-block;
331
+ font-family: 'Glyphicons Halflings';
332
+ -webkit-font-smoothing: antialiased;
333
+ font-style: normal;
334
+ font-weight: normal;
335
+ line-height: 1;
336
+ -moz-osx-font-smoothing: grayscale
337
+ }
338
+
339
+ .ez-toc-glyphicon:empty {
340
+ width: 1em
341
+ }
342
+
343
+ .ez-toc-toggle i.ez-toc-glyphicon {
344
+ font-size: 16px;
345
+ margin-left: 2px;
346
+ }
347
+
348
+ [class*="ez-toc-icon-"] {
349
+ font-family: 'ez-toc-icomoon' !important; /* For better glyphicon compatibility */
350
+ speak: none;
351
+ font-style: normal;
352
+ font-weight: normal;
353
+ font-variant: normal;
354
+ text-transform: none;
355
+ line-height: 1;
356
+
357
+ /* Better Font Rendering =========== */
358
+ -webkit-font-smoothing: antialiased;
359
+ -moz-osx-font-smoothing: grayscale;
360
+ }
361
+
362
+ .ez-toc-icon-toggle:before {
363
+ content: "\e87a";
364
+ }
365
+ #ez-toc-container input {
366
+ position: absolute;
367
+ left: -999em;
368
+ }
369
+ #ez-toc-container input[type="checkbox"]:checked + nav {
370
+ opacity: 0;
371
+ max-height: 0;
372
+ border: none;
373
+ display: none;
374
+ }
375
+
376
+ #ez-toc-container label {
377
+ float: right;
378
+ position: relative;
379
+ left: 10px;
380
+ font-size: 16px;
381
+ background: #f9efef;
382
+ padding: 0px 4px 0px 5px;
383
+ border: 1px solid #999191;
384
+ border-radius: 5px;
385
+ cursor: pointer;
386
+ }
387
+ div#ez-toc-container p.ez-toc-title {
388
+ display: contents;
389
+ }
390
+ div#ez-toc-container {
391
+ padding-right: 20px;
392
+ }
393
+
394
+ label.cssicon .ez-toc-glyphicon:empty {
395
+ font-size: 16px;
396
+ margin-left: 2px;
397
+ }
398
+
399
+ label.cssiconcheckbox {
400
+ display: none;
401
+ }
402
+
403
+ div#ez-toc-container.afterpara + p {
404
+ display: none;
405
+ }
406
+ .ez-toc-widget-container ul li a {
407
+ padding-left: 10px;
408
+ }
409
+ .ez-toc-widget-container ul.ez-toc-list li.active {
410
+ height: auto!important;
411
  }
assets/css/screen.min.css CHANGED
@@ -1,34 +1,37 @@
1
- #ez-toc-container {background: #F9F9F9;border: 1px solid #AAAAAA;border-radius: 4px;-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);display: table;margin-bottom: 1em;padding: 10px;position: relative;width: auto;}div.ez-toc-widget-container {padding: 0;position: relative;}#ez-toc-container.ez-toc-light-blue {background: #EDF6FF;}#ez-toc-container.ez-toc-white {background: #FFFFFF;}#ez-toc-container.ez-toc-black {background: #000000;}#ez-toc-container.ez-toc-transparent {background: none transparent;}div.ez-toc-widget-container ul {display: block;}div.ez-toc-widget-container li {border: none;padding: 0;}div.ez-toc-widget-container ul.ez-toc-list {padding: 10px;}#ez-toc-container ul ul, .ez-toc div.ez-toc-widget-container ul ul {margin-left: 1.5em;}#ez-toc-container ul, #ez-toc-container li {margin: 0;padding: 0;}#ez-toc-container ul, #ez-toc-container li, #ez-toc-container ul li, div.ez-toc-widget-container, div.ez-toc-widget-container li {background: none;list-style: none none;line-height: 1.6;margin: 0;overflow: hidden;z-index: 1;}#ez-toc-container p.ez-toc-title {text-align: left;line-height: 1.45;margin: 0;padding: 0;}.ez-toc-title-container {display: table;width: 100%;}.ez-toc-title, .ez-toc-title-toggle {display: table-cell;text-align: left;vertical-align: middle;}#ez-toc-container.ez-toc-black p.ez-toc-title {color: #FFF;}#ez-toc-container div.ez-toc-title-container + ul.ez-toc-list {margin-top: 1em;}.ez-toc-wrap-left {float: left;margin-right: 10px;}.ez-toc-wrap-right {float: right;margin-left: 10px;}#ez-toc-container a {color: #444444;box-shadow: none;text-decoration: none;text-shadow: none;}#ez-toc-container a:visited {color: #9f9f9f;}#ez-toc-container a:hover {text-decoration: underline;}#ez-toc-container.ez-toc-black a {color: #FFF;}#ez-toc-container.ez-toc-black a:visited {color: #FFF;}#ez-toc-container a.ez-toc-toggle {color: #444444;}#ez-toc-container.counter-hierarchy ul, .ez-toc-widget-container.counter-hierarchy ul, #ez-toc-container.counter-flat ul, .ez-toc-widget-container.counter-flat ul {counter-reset: item;}#ez-toc-container.counter-numeric li, .ez-toc-widget-container.counter-numeric li {list-style-type: decimal;list-style-position: inside;}#ez-toc-container.counter-decimal ul.ez-toc-list li a::before, .ez-toc-widget-container.counter-decimal ul.ez-toc-list li a::before {content: counters(item, ".") ". ";display: inline-block;counter-increment: item;margin-right: .2em;}#ez-toc-container.counter-roman li a::before, .ez-toc-widget-container.counter-roman ul.ez-toc-list li a::before {content: counters(item, ".", upper-roman) ". ";counter-increment: item;}.ez-toc-widget-container ul.ez-toc-list li::before {content: ' ';position: absolute;left: 0;right: 0;height: 30px;line-height: 30px;z-index: -1;}.ez-toc-widget-container ul.ez-toc-list li.active {background-color: #EDEDED;}.ez-toc-widget-container li.active > a {font-weight: 900;}.ez-toc-btn {display: inline-block;padding: 6px 12px;margin-bottom: 0;font-size: 14px;font-weight: normal;line-height: 1.428571429;text-align: center;white-space: nowrap;vertical-align: middle;cursor: pointer;background-image: none;border: 1px solid transparent;border-radius: 4px;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;-o-user-select: none;user-select: none }.ez-toc-btn:focus {outline: thin dotted #333;outline: 5px auto -webkit-focus-ring-color;outline-offset: -2px }.ez-toc-btn:hover,.ez-toc-btn:focus {color: #333;text-decoration: none }.ez-toc-btn:active,.ez-toc-btn.active {background-image: none;outline: 0;-webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }.ez-toc-btn-default {color: #333;background-color: #fff;border-color: #ccc }.ez-toc-btn-default:hover,.ez-toc-btn-default:focus,.ez-toc-btn-default:active,.ez-toc-btn-default.active {color: #333;background-color: #ebebeb;border-color: #adadad }.ez-toc-btn-default:active,.ez-toc-btn-default.active {background-image: none }.ez-toc-btn-sm,.ez-toc-btn-xs {padding: 5px 10px;font-size: 12px;line-height: 1.5;border-radius: 3px }.ez-toc-btn-xs {padding: 1px 5px }.ez-toc-btn-default {text-shadow: 0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075) }.ez-toc-btn-default:active {-webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }.ez-toc-btn:active,.btn.active {background-image: none }.ez-toc-btn-default {text-shadow: 0 1px 0 #fff;background-image: -webkit-gradient(linear,left 0,left 100%,from(#fff),to(#e0e0e0));background-image: -webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image: -moz-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image: linear-gradient(to bottom,#fff 0,#e0e0e0 100%);background-repeat: repeat-x;border-color: #dbdbdb;border-color: #ccc;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe0e0e0',GradientType=0);filter: progid:DXImageTransform.Microsoft.gradient(enabled=false) }.ez-toc-btn-default:hover,.ez-toc-btn-default:focus {background-color: #e0e0e0;background-position: 0 -15px }.ez-toc-btn-default:active,.ez-toc-btn-default.active {background-color: #e0e0e0;border-color: #dbdbdb }.ez-toc-pull-right {float: right !important;margin-left: 10px;}.ez-toc-glyphicon {position: relative;top: 1px;display: inline-block;font-family: 'Glyphicons Halflings';-webkit-font-smoothing: antialiased;font-style: normal;font-weight: normal;line-height: 1;-moz-osx-font-smoothing: grayscale }.ez-toc-glyphicon:empty {width: 1em }.ez-toc-toggle i.ez-toc-glyphicon {font-size: 16px;margin-left: 2px;}[class*="ez-toc-icon-"] {font-family: 'ez-toc-icomoon' !important;speak: none;font-style: normal;font-weight: normal;font-variant: normal;text-transform: none;line-height: 1;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}.ez-toc-icon-toggle:before {content: "\e87a";}#ez-toc-container input {position: absolute;left: -999em;}#ez-toc-container input[type="checkbox"]:checked + nav {opacity: 0;max-height: 0;border: none;display: none;}#ez-toc-container label {float: right;position: relative;left: 3px;font-size: 16px;/* background: #f9efef; */padding: 0px 4px 0px 5px;border: 1px solid #999191;border-radius: 5px;cursor: pointer;}div#ez-toc-container p.ez-toc-title {display: contents;}div#ez-toc-container {padding-right: 20px;}#ez-toc-container label {left: 10px;}.ez-toc-wrap-center {margin: 0 auto;}
2
- #ez-toc-container.counter-hyphen ul.ez-toc-list li a::before,
3
-
4
- #ez-toc-container.counter-disc li,
5
- .ez-toc-widget-container.counter-disc li {
6
- list-style-type: disc;
7
- list-style-position: inside;
8
- }
9
-
10
- #ez-toc-container.counter-hyphen li,
11
- .ez-toc-widget-container.counter-hyphen li {
12
- list-style-type: '- ';
13
- list-style-position: inside;
14
-
15
- }
16
-
17
- #ez-toc-container a.ez-toc-toggle {
18
- color: #444444;
19
- background: inherit;
20
- border: inherit;
21
- }
22
- .ez-toc-toggle #item{position: absolute;left: -999em;}
23
-
24
- label.cssicon .ez-toc-glyphicon:empty {
25
- font-size: 16px;
26
- margin-left: 2px;
27
- }
28
- label.cssiconcheckbox {
29
- display: none;
30
- }
31
- div#ez-toc-container.afterpara + p {
32
- display: none;
33
- }
34
- .ez-toc-widget-container ul li a{padding-left:10px}
 
 
 
1
+ #ez-toc-container {background: #F9F9F9;border: 1px solid #AAAAAA;border-radius: 4px;-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);display: table;margin-bottom: 1em;padding: 10px;position: relative;width: auto;}div.ez-toc-widget-container {padding: 0;position: relative;}#ez-toc-container.ez-toc-light-blue {background: #EDF6FF;}#ez-toc-container.ez-toc-white {background: #FFFFFF;}#ez-toc-container.ez-toc-black {background: #000000;}#ez-toc-container.ez-toc-transparent {background: none transparent;}div.ez-toc-widget-container ul {display: block;}div.ez-toc-widget-container li {border: none;padding: 0;}div.ez-toc-widget-container ul.ez-toc-list {padding: 10px;}#ez-toc-container ul ul, .ez-toc div.ez-toc-widget-container ul ul {margin-left: 1.5em;}#ez-toc-container ul, #ez-toc-container li {margin: 0;padding: 0;}#ez-toc-container ul, #ez-toc-container li, #ez-toc-container ul li, div.ez-toc-widget-container, div.ez-toc-widget-container li {background: none;list-style: none none;line-height: 1.6;margin: 0;overflow: hidden;z-index: 1;}#ez-toc-container p.ez-toc-title {text-align: left;line-height: 1.45;margin: 0;padding: 0;}.ez-toc-title-container {display: table;width: 100%;}.ez-toc-title, .ez-toc-title-toggle {display: table-cell;text-align: left;vertical-align: middle;}#ez-toc-container.ez-toc-black p.ez-toc-title {color: #FFF;}#ez-toc-container div.ez-toc-title-container + ul.ez-toc-list {margin-top: 1em;}.ez-toc-wrap-left {float: left;margin-right: 10px;}.ez-toc-wrap-right {float: right;margin-left: 10px;}#ez-toc-container a {color: #444444;box-shadow: none;text-decoration: none;text-shadow: none;}#ez-toc-container a:visited {color: #9f9f9f;}#ez-toc-container a:hover {text-decoration: underline;}#ez-toc-container.ez-toc-black a {color: #FFF;}#ez-toc-container.ez-toc-black a:visited {color: #FFF;}#ez-toc-container a.ez-toc-toggle {color: #444444;}#ez-toc-container.counter-hierarchy ul, .ez-toc-widget-container.counter-hierarchy ul, #ez-toc-container.counter-flat ul, .ez-toc-widget-container.counter-flat ul {counter-reset: item;}#ez-toc-container.counter-numeric li, .ez-toc-widget-container.counter-numeric li {list-style-type: decimal;list-style-position: inside;}#ez-toc-container.counter-decimal ul.ez-toc-list li a::before, .ez-toc-widget-container.counter-decimal ul.ez-toc-list li a::before {content: counters(item, ".") ". ";display: inline-block;counter-increment: item;margin-right: .2em;}#ez-toc-container.counter-roman li a::before, .ez-toc-widget-container.counter-roman ul.ez-toc-list li a::before {content: counters(item, ".", upper-roman) ". ";counter-increment: item;}.ez-toc-widget-container ul.ez-toc-list li::before {content: ' ';position: absolute;left: 0;right: 0;height: 30px;line-height: 30px;z-index: -1;}.ez-toc-widget-container ul.ez-toc-list li.active {background-color: #EDEDED;}.ez-toc-widget-container li.active > a {font-weight: 900;}.ez-toc-btn {display: inline-block;padding: 6px 12px;margin-bottom: 0;font-size: 14px;font-weight: normal;line-height: 1.428571429;text-align: center;white-space: nowrap;vertical-align: middle;cursor: pointer;background-image: none;border: 1px solid transparent;border-radius: 4px;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;-o-user-select: none;user-select: none }.ez-toc-btn:focus {outline: thin dotted #333;outline: 5px auto -webkit-focus-ring-color;outline-offset: -2px }.ez-toc-btn:hover,.ez-toc-btn:focus {color: #333;text-decoration: none }.ez-toc-btn:active,.ez-toc-btn.active {background-image: none;outline: 0;-webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }.ez-toc-btn-default {color: #333;background-color: #fff;border-color: #ccc }.ez-toc-btn-default:hover,.ez-toc-btn-default:focus,.ez-toc-btn-default:active,.ez-toc-btn-default.active {color: #333;background-color: #ebebeb;border-color: #adadad }.ez-toc-btn-default:active,.ez-toc-btn-default.active {background-image: none }.ez-toc-btn-sm,.ez-toc-btn-xs {padding: 5px 10px;font-size: 12px;line-height: 1.5;border-radius: 3px }.ez-toc-btn-xs {padding: 1px 5px }.ez-toc-btn-default {text-shadow: 0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075) }.ez-toc-btn-default:active {-webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }.ez-toc-btn:active,.btn.active {background-image: none }.ez-toc-btn-default {text-shadow: 0 1px 0 #fff;background-image: -webkit-gradient(linear,left 0,left 100%,from(#fff),to(#e0e0e0));background-image: -webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image: -moz-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image: linear-gradient(to bottom,#fff 0,#e0e0e0 100%);background-repeat: repeat-x;border-color: #dbdbdb;border-color: #ccc;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe0e0e0',GradientType=0);filter: progid:DXImageTransform.Microsoft.gradient(enabled=false) }.ez-toc-btn-default:hover,.ez-toc-btn-default:focus {background-color: #e0e0e0;background-position: 0 -15px }.ez-toc-btn-default:active,.ez-toc-btn-default.active {background-color: #e0e0e0;border-color: #dbdbdb }.ez-toc-pull-right {float: right !important;margin-left: 10px;}.ez-toc-glyphicon {position: relative;top: 1px;display: inline-block;font-family: 'Glyphicons Halflings';-webkit-font-smoothing: antialiased;font-style: normal;font-weight: normal;line-height: 1;-moz-osx-font-smoothing: grayscale }.ez-toc-glyphicon:empty {width: 1em }.ez-toc-toggle i.ez-toc-glyphicon {font-size: 16px;margin-left: 2px;}[class*="ez-toc-icon-"] {font-family: 'ez-toc-icomoon' !important;speak: none;font-style: normal;font-weight: normal;font-variant: normal;text-transform: none;line-height: 1;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}.ez-toc-icon-toggle:before {content: "\e87a";}#ez-toc-container input {position: absolute;left: -999em;}#ez-toc-container input[type="checkbox"]:checked + nav {opacity: 0;max-height: 0;border: none;display: none;}#ez-toc-container label {float: right;position: relative;left: 3px;font-size: 16px;/* background: #f9efef; */padding: 0px 4px 0px 5px;border: 1px solid #999191;border-radius: 5px;cursor: pointer;}div#ez-toc-container p.ez-toc-title {display: contents;}div#ez-toc-container {padding-right: 20px;}#ez-toc-container label {left: 10px;}.ez-toc-wrap-center {margin: 0 auto;}
2
+ #ez-toc-container.counter-hyphen ul.ez-toc-list li a::before,
3
+
4
+ #ez-toc-container.counter-disc li,
5
+ .ez-toc-widget-container.counter-disc li {
6
+ list-style-type: disc;
7
+ list-style-position: inside;
8
+ }
9
+
10
+ #ez-toc-container.counter-hyphen li,
11
+ .ez-toc-widget-container.counter-hyphen li {
12
+ list-style-type: '- ';
13
+ list-style-position: inside;
14
+
15
+ }
16
+
17
+ #ez-toc-container a.ez-toc-toggle {
18
+ color: #444444;
19
+ background: inherit;
20
+ border: inherit;
21
+ }
22
+ .ez-toc-toggle #item{position: absolute;left: -999em;}
23
+
24
+ label.cssicon .ez-toc-glyphicon:empty {
25
+ font-size: 16px;
26
+ margin-left: 2px;
27
+ }
28
+ label.cssiconcheckbox {
29
+ display: none;
30
+ }
31
+ div#ez-toc-container.afterpara + p {
32
+ display: none;
33
+ }
34
+ .ez-toc-widget-container ul li a{padding-left:10px}
35
+ .ez-toc-widget-container ul.ez-toc-list li.active {
36
+ height: auto!important;
37
+ }
assets/js/admin.js CHANGED
@@ -1,29 +1,29 @@
1
- jQuery(document).ready(function($) {
2
-
3
- var ez_toc_color_picker = $( '.ez-toc-color-picker' );
4
-
5
- if ( ez_toc_color_picker.length ) {
6
- ez_toc_color_picker.wpColorPicker();
7
- }
8
- var tableBody = document.getElementById('eztoc-appearance');
9
- var tableRows = tableBody.getElementsByTagName('tr');
10
- var targetElement = tableRows[1];
11
- targetElement.style.display = "none";
12
- document.getElementById('ez-toc-settings[width]').addEventListener('change', function () {
13
- if(document.getElementById('ez-toc-settings[width]').value == 'custom'){
14
- targetElement.style.display = "revert";
15
- }else{
16
- targetElement.style.display = "none";
17
- }
18
- });
19
- $("#subscribe-newsletter-form").on('submit',function(e){
20
- e.preventDefault();
21
- var $form = $("#subscribe-newsletter-form");
22
- var name = $form.find('input[name="name"]').val();
23
- var email = $form.find('input[name="email"]').val();
24
- var website = $form.find('input[name="company"]').val();
25
- $.post(ajaxurl, {action:'eztoc_subscribe_newsletter',name:name, email:email,website:website},
26
- function(data) {}
27
- );
28
- });
29
- });
1
+ jQuery(document).ready(function($) {
2
+
3
+ var ez_toc_color_picker = $( '.ez-toc-color-picker' );
4
+
5
+ if ( ez_toc_color_picker.length ) {
6
+ ez_toc_color_picker.wpColorPicker();
7
+ }
8
+ var tableBody = document.getElementById('eztoc-appearance');
9
+ var tableRows = tableBody.getElementsByTagName('tr');
10
+ var targetElement = tableRows[1];
11
+ targetElement.style.display = "none";
12
+ document.getElementById('ez-toc-settings[width]').addEventListener('change', function () {
13
+ if(document.getElementById('ez-toc-settings[width]').value == 'custom'){
14
+ targetElement.style.display = "revert";
15
+ }else{
16
+ targetElement.style.display = "none";
17
+ }
18
+ });
19
+ $("#subscribe-newsletter-form").on('submit',function(e){
20
+ e.preventDefault();
21
+ var $form = $("#subscribe-newsletter-form");
22
+ var name = $form.find('input[name="name"]').val();
23
+ var email = $form.find('input[name="email"]').val();
24
+ var website = $form.find('input[name="company"]').val();
25
+ $.post(ajaxurl, {action:'eztoc_subscribe_newsletter',name:name, email:email,website:website},
26
+ function(data) {}
27
+ );
28
+ });
29
+ });
assets/js/eztoc-admin.js CHANGED
@@ -1,94 +1,94 @@
1
- function tabToggle(evt, idname) {
2
- var i, tabcontent, tablinks;tabcontent = document.getElementsByClassName("eztoc-tabcontent");
3
- for (i = 0; i < tabcontent.length; i++) {
4
- tabcontent[i].style.display = "none";
5
- }
6
- tablinks = document.getElementsByClassName("eztoc-tablinks");
7
- for (i = 0; i < tablinks.length; i++) {
8
- tablinks[i].className = tablinks[i].className.replace(" active", "");
9
- }
10
- document.getElementById(idname).style.display = "block";
11
-
12
- evt.target.className += " active";
13
- }
14
-
15
- function eztocIsEmail(email) {
16
- var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
17
- return regex.test(email);
18
- }
19
-
20
-
21
- //query form send starts here
22
- jQuery(document).ready(function($) {
23
-
24
- var url = window.location.href;
25
- if(url.indexOf('#technical-support') > -1){
26
- $("#eztoc-technical").click();
27
- }else if(url.indexOf('#freevspro-support') > -1){
28
- $("#eztoc-freevspro").click();
29
- }
30
- else if(url.indexOf('#welcome') > -1){
31
- $("#eztoc-welcome").click();
32
- }
33
- else{
34
- $("#eztoc-default").click();
35
- }
36
-
37
- $(".eztoc-send-query").on("click", function(e){
38
- e.preventDefault();
39
- var message = $("#eztoc_query_message").val();
40
- var email = $("#eztoc_query_email").val();
41
- var premium_cus = $("#saswp_query_premium_cus").val();
42
-
43
- if($.trim(message) !='' && $.trim(email) !='' && eztocIsEmail(email) == true){
44
- $.ajax({
45
- type: "POST",
46
- url:ajaxurl,
47
- dataType: "json",
48
- data:{action:"eztoc_send_query_message",message:message,email:email, eztoc_security_nonce:eztoc_admin_data.eztoc_security_nonce},
49
- success:function(response){
50
- if(response['status'] =='t'){
51
- $(".eztoc-query-success").show();
52
- $(".eztoc-query-error").hide();
53
- }else{
54
- $(".eztoc-query-success").hide();
55
- $(".eztoc-query-error").show();
56
- }
57
- },
58
- error: function(response){
59
- console.log(response);
60
- }
61
- });
62
- }else{
63
-
64
- if($.trim(message) =='' && $.trim(email) ==''){
65
- alert('Please enter the message, email and select customer type');
66
- }else{
67
-
68
- if($.trim(message) == ''){
69
- alert('Please enter the message');
70
- }
71
- if($.trim(email) == ''){
72
- alert('Please enter the email');
73
- }
74
- if(eztocIsEmail(email) == false){
75
- alert('Please enter a valid email');
76
- }
77
-
78
- }
79
-
80
- }
81
-
82
- });
83
-
84
- $("#subscribe-newsletter-form").on('submit',function(e){
85
- e.preventDefault();
86
- var $form = $("#subscribe-newsletter-form");
87
- var name = $form.find('input[name="name"]').val();
88
- var email = $form.find('input[name="email"]').val();
89
- var website = $form.find('input[name="company"]').val();
90
- $.post(ajaxurl, {action:'eztoc_subscribe_newsletter',name:name, email:email,website:website},
91
- function(data) {}
92
- );
93
- });
94
  });
1
+ function tabToggle(evt, idname) {
2
+ var i, tabcontent, tablinks;tabcontent = document.getElementsByClassName("eztoc-tabcontent");
3
+ for (i = 0; i < tabcontent.length; i++) {
4
+ tabcontent[i].style.display = "none";
5
+ }
6
+ tablinks = document.getElementsByClassName("eztoc-tablinks");
7
+ for (i = 0; i < tablinks.length; i++) {
8
+ tablinks[i].className = tablinks[i].className.replace(" active", "");
9
+ }
10
+ document.getElementById(idname).style.display = "block";
11
+
12
+ evt.target.className += " active";
13
+ }
14
+
15
+ function eztocIsEmail(email) {
16
+ var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
17
+ return regex.test(email);
18
+ }
19
+
20
+
21
+ //query form send starts here
22
+ jQuery(document).ready(function($) {
23
+
24
+ var url = window.location.href;
25
+ if(url.indexOf('#technical-support') > -1){
26
+ $("#eztoc-technical").click();
27
+ }else if(url.indexOf('#freevspro-support') > -1){
28
+ $("#eztoc-freevspro").click();
29
+ }
30
+ else if(url.indexOf('#welcome') > -1){
31
+ $("#eztoc-welcome").click();
32
+ }
33
+ else{
34
+ $("#eztoc-default").click();
35
+ }
36
+
37
+ $(".eztoc-send-query").on("click", function(e){
38
+ e.preventDefault();
39
+ var message = $("#eztoc_query_message").val();
40
+ var email = $("#eztoc_query_email").val();
41
+ var premium_cus = $("#saswp_query_premium_cus").val();
42
+
43
+ if($.trim(message) !='' && $.trim(email) !='' && eztocIsEmail(email) == true){
44
+ $.ajax({
45
+ type: "POST",
46
+ url:ajaxurl,
47
+ dataType: "json",
48
+ data:{action:"eztoc_send_query_message",message:message,email:email, eztoc_security_nonce:eztoc_admin_data.eztoc_security_nonce},
49
+ success:function(response){
50
+ if(response['status'] =='t'){
51
+ $(".eztoc-query-success").show();
52
+ $(".eztoc-query-error").hide();
53
+ }else{
54
+ $(".eztoc-query-success").hide();
55
+ $(".eztoc-query-error").show();
56
+ }
57
+ },
58
+ error: function(response){
59
+ console.log(response);
60
+ }
61
+ });
62
+ }else{
63
+
64
+ if($.trim(message) =='' && $.trim(email) ==''){
65
+ alert('Please enter the message, email and select customer type');
66
+ }else{
67
+
68
+ if($.trim(message) == ''){
69
+ alert('Please enter the message');
70
+ }
71
+ if($.trim(email) == ''){
72
+ alert('Please enter the email');
73
+ }
74
+ if(eztocIsEmail(email) == false){
75
+ alert('Please enter a valid email');
76
+ }
77
+
78
+ }
79
+
80
+ }
81
+
82
+ });
83
+
84
+ $("#subscribe-newsletter-form").on('submit',function(e){
85
+ e.preventDefault();
86
+ var $form = $("#subscribe-newsletter-form");
87
+ var name = $form.find('input[name="name"]').val();
88
+ var email = $form.find('input[name="email"]').val();
89
+ var website = $form.find('input[name="company"]').val();
90
+ $.post(ajaxurl, {action:'eztoc_subscribe_newsletter',name:name, email:email,website:website},
91
+ function(data) {}
92
+ );
93
+ });
94
  });
assets/js/front.js CHANGED
@@ -1,336 +1,336 @@
1
- jQuery( function( $ ) {
2
-
3
- /**
4
- * @typedef ezTOC
5
- * @type {Object} ezTOC
6
- * @property {string} affixSelector
7
- * @property {string} scroll_offset
8
- * @property {string} smooth_scroll
9
- * @property {string} visibility_hide_by_default
10
- */
11
-
12
- if ( typeof ezTOC != 'undefined' ) {
13
-
14
- /**
15
- * Init EZ TOC.
16
- */
17
- function ezTOCInit() {
18
-
19
- var affix = $( '.ez-toc-widget-container.ez-toc-affix' );
20
-
21
- if ( 0 !== affix.length ) {
22
-
23
- /**
24
- * The smooth scroll offset needs to be taken into account when defining the offset_top property.
25
- * @link https://github.com/shazahm1/Easy-Table-of-Contents/issues/19
26
- *
27
- * @type {number}
28
- */
29
- var affixOffset = 30;
30
-
31
- // check offset setting
32
- if ( typeof ezTOC.scroll_offset != 'undefined' ) {
33
-
34
- affixOffset = parseInt( ezTOC.scroll_offset );
35
- }
36
-
37
- $( ezTOC.affixSelector ).stick_in_parent( {
38
- inner_scrolling: false,
39
- offset_top: affixOffset
40
- } )
41
- }
42
-
43
- $.fn.shrinkTOCWidth = function() {
44
-
45
- $( this ).css( {
46
- width: 'auto',
47
- display: 'table'
48
- });
49
-
50
- if ( /MSIE 7\./.test( navigator.userAgent ) )
51
- $( this ).css( 'width', '' );
52
- };
53
-
54
- var smoothScroll = parseInt( ezTOC.smooth_scroll );
55
-
56
- if ( 1 === smoothScroll ) {
57
-
58
- $( 'a.ez-toc-link' ).on( 'click', function() {
59
-
60
- var self = $( this );
61
-
62
- var target = '';
63
- var hostname = self.prop( 'hostname' );
64
- var pathname = self.prop( 'pathname' );
65
- var qs = self.prop( 'search' );
66
- var hash = self.prop( 'hash' );
67
-
68
- // ie strips out the preceding / from pathname
69
- if ( pathname.length > 0 ) {
70
- if ( pathname.charAt( 0 ) !== '/' ) {
71
- pathname = '/' + pathname;
72
- }
73
- }
74
-
75
- if ( ( window.location.hostname === hostname ) &&
76
- ( window.location.pathname === pathname ) &&
77
- ( window.location.search === qs ) &&
78
- ( hash !== '' )
79
- ) {
80
-
81
- // var id = decodeURIComponent( hash.replace( '#', '' ) );
82
- target = '[id="' + hash.replace( '#', '' ) + '"]';
83
-
84
- // verify it exists
85
- if ( $( target ).length === 0 ) {
86
- console.log( 'ezTOC scrollTarget Not Found: ' + target );
87
- target = '';
88
- }
89
-
90
- // check offset setting
91
- if ( typeof ezTOC.scroll_offset != 'undefined' ) {
92
-
93
- var offset = -1 * ezTOC.scroll_offset;
94
-
95
- } else {
96
-
97
- var adminbar = $( '#wpadminbar' );
98
-
99
- if ( adminbar.length > 0 ) {
100
-
101
- if ( adminbar.is( ':visible' ) )
102
- offset = -30; // admin bar exists, give it the default
103
- else
104
- offset = 0; // there is an admin bar but it's hidden, so no offset!
105
-
106
- } else {
107
-
108
- // no admin bar, so no offset!
109
- offset = 0;
110
- }
111
- }
112
-
113
- if ( target ) {
114
- $.smoothScroll( {
115
- scrollTarget: target,
116
- offset: offset,
117
- beforeScroll: deactivateSetActiveEzTocListElement,
118
- afterScroll: function() { setActiveEzTocListElement(); activateSetActiveEzTocListElement(); }
119
- } );
120
-
121
- }
122
- }
123
- } );
124
- }
125
-
126
- if ( typeof ezTOC.visibility_hide_by_default != 'undefined' ) {
127
-
128
- var toc = $( 'ul.ez-toc-list' );
129
- var toggle = $( 'a.ez-toc-toggle' );
130
- var invert = ezTOC.visibility_hide_by_default;
131
-
132
- toggle.css( 'display', 'inline' );
133
-
134
- if ( Cookies ) {
135
-
136
- Cookies.get( 'ezTOC_hidetoc' ) == 1 ? toggle.data( 'visible', false ) : toggle.data( 'visible', true );
137
- Cookies.remove('ezTOC_hidetoc')
138
-
139
- } else {
140
-
141
- toggle.data( 'visible', true );
142
- Cookies.remove('ezTOC_hidetoc')
143
- }
144
-
145
- if ( invert ) {
146
-
147
- toggle.data( 'visible', false )
148
- }
149
-
150
- if ( ! toggle.data( 'visible' ) ) {
151
-
152
- toc.hide();
153
- }
154
-
155
- toggle.on( 'click', function( event ) {
156
-
157
- event.preventDefault();
158
-
159
- const main = document.querySelector("#ez-toc-container");
160
- if(main){
161
- main.classList.toggle("toc_close");
162
- }
163
- else
164
- {
165
- const side = document.querySelector(".ez-toc-widget-container");
166
- side.classList.toggle("toc_close");
167
- }
168
-
169
- if ( $( this ).data( 'visible' ) ) {
170
-
171
- $( this ).data( 'visible', false );
172
-
173
- if ( Cookies ) {
174
-
175
- if ( invert )
176
- Cookies.set( 'ezTOC_hidetoc', null, { path: '/' } );
177
- else
178
- Cookies.set( 'ezTOC_hidetoc', '1', { expires: 30, path: '/' } );
179
- }
180
-
181
- toc.hide( 'fast' );
182
-
183
- } else {
184
-
185
- $( this ).data( 'visible', true );
186
-
187
- if ( Cookies ) {
188
-
189
- if ( invert )
190
- Cookies.set( 'ezTOC_hidetoc', '1', { expires: 30, path: '/' } );
191
- else
192
- Cookies.set( 'ezTOC_hidetoc', null, { path: '/' } );
193
- }
194
-
195
- toc.show( 'fast' );
196
-
197
- }
198
-
199
- } );
200
- }
201
-
202
-
203
- // ======================================
204
- // Set active heading in ez-toc-widget list
205
- // ======================================
206
-
207
- var headings = $( 'span.ez-toc-section' ).toArray();
208
- var headingToListElementLinkMap = getHeadingToListElementLinkMap( headings );
209
- var listElementLinks = $.map( headingToListElementLinkMap, function ( value, key ) {
210
- return value
211
- } );
212
- var scrollOffset = getScrollOffset();
213
-
214
- activateSetActiveEzTocListElement();
215
-
216
- function setActiveEzTocListElement() {
217
- var activeHeading = getActiveHeading( scrollOffset, headings );
218
- if ( activeHeading ) {
219
- var activeListElementLink = headingToListElementLinkMap[ activeHeading.id ];
220
- removeStyleFromNonActiveListElement( activeListElementLink, listElementLinks );
221
- setStyleForActiveListElementElement( activeListElementLink );
222
- }
223
- }
224
-
225
- function activateSetActiveEzTocListElement() {
226
- if ( headings.length > 0 && $('.ez-toc-widget-container').length) {
227
- $( window ).on( 'load resize scroll', setActiveEzTocListElement );
228
- }
229
- }
230
-
231
- function deactivateSetActiveEzTocListElement() {
232
- $( window ).off( 'load resize scroll', setActiveEzTocListElement );
233
- }
234
-
235
- function getEzTocListElementLinkByHeading( heading ) {
236
- return $( '.ez-toc-widget-container .ez-toc-list a[href="#' + $( heading ).attr( 'id' ) + '"]' );
237
- }
238
-
239
- function getHeadingToListElementLinkMap( headings ) {
240
- return headings.reduce( function ( map, heading ) {
241
- map[ heading.id ] = getEzTocListElementLinkByHeading( heading );
242
- return map;
243
- }, {} );
244
- }
245
-
246
- function getScrollOffset() {
247
- var scrollOffset = 5; // so if smooth offset is off, the correct title is set as active
248
- if ( typeof ezTOC.smooth_scroll != 'undefined' && parseInt( ezTOC.smooth_scroll ) === 1 ) {
249
- scrollOffset = ( typeof ezTOC.scroll_offset != 'undefined' ) ? parseInt( ezTOC.scroll_offset ) : 30;
250
- }
251
-
252
- var adminbar = $( '#wpadminbar' );
253
-
254
- if ( adminbar.length ) {
255
- scrollOffset += adminbar.height();
256
- }
257
- return scrollOffset;
258
- }
259
-
260
- function getActiveHeading( topOffset, headings ) {
261
- var scrollTop = $( window ).scrollTop();
262
- var relevantOffset = scrollTop + topOffset + 1;
263
- var activeHeading = headings[ 0 ];
264
- var closestHeadingAboveOffset = relevantOffset - $( activeHeading ).offset().top;
265
- headings.forEach( function ( section ) {
266
- var topOffset = relevantOffset - $( section ).offset().top;
267
- if ( topOffset > 0 && topOffset < closestHeadingAboveOffset ) {
268
- closestHeadingAboveOffset = topOffset;
269
- activeHeading = section;
270
- }
271
- } );
272
- return activeHeading;
273
- }
274
-
275
- function removeStyleFromNonActiveListElement( activeListElementLink, listElementLinks ) {
276
- listElementLinks.forEach( function ( listElementLink ) {
277
- if ( activeListElementLink !== listElementLink && listElementLink.parent().hasClass( 'active' ) ) {
278
- listElementLink.parent().removeClass( 'active' );
279
- }
280
- } );
281
- }
282
-
283
- function correctActiveListElementBackgroundColorHeight( activeListElement ) {
284
- var listElementHeight = getListElementHeightWithoutUlChildren( activeListElement );
285
- addListElementBackgroundColorHeightStyleToHead( listElementHeight );
286
- }
287
-
288
- function getListElementHeightWithoutUlChildren( listElement ) {
289
- var $listElement = $( listElement );
290
- var content = $listElement.html();
291
- // Adding list item with class '.active' to get the real height.
292
- // When adding a class to an existing element and using jQuery(..).height() directly afterwards,
293
- // the height is the 'old' height. The height might change due to text-wraps when setting the text-weight bold for example
294
- // When adding a new item, the height is calculated correctly.
295
- // But only when it might be visible (so display:none; is not possible...)
296
- // But because it get's directly removed afterwards it never will be rendered by the browser
297
- // (at least in my tests in FF, Chrome, IE11 and Edge)
298
- $listElement.parent().append( '<li id="ez-toc-height-test" class="active">' + content + '</li>' );
299
- var listItem = $( '#ez-toc-height-test' );
300
- var height = listItem.height();
301
- listItem.remove();
302
- return height - $listElement.children( 'ul' ).first().height();
303
- }
304
-
305
- function addListElementBackgroundColorHeightStyleToHead( listElementHeight ) {
306
- // Remove existing
307
- $( '#ez-toc-active-height' ).remove();
308
- // jQuery(..).css(..) doesn't work, because ::before is a pseudo element and not part of the DOM
309
- // Workaround is to add it to head
310
- $( '<style id="ez-toc-active-height">' +
311
- '.ez-toc-widget-container ul.ez-toc-list li.active {' +
312
- // 'line-heigh:' + listElementHeight + 'px; ' +
313
- 'height:' + listElementHeight + 'px;' +
314
- '} </style>' )
315
- .appendTo( 'head' );
316
- }
317
-
318
- function setStyleForActiveListElementElement( activeListElementLink ) {
319
- var activeListElement = activeListElementLink.parent();
320
- if ( !activeListElement.hasClass( 'active' ) ) {
321
- activeListElement.addClass( 'active' );
322
- }
323
- correctActiveListElementBackgroundColorHeight( activeListElement );
324
- }
325
- }
326
-
327
- /**
328
- * Attach global init handler to ezTOC window object.
329
- */
330
- ezTOC.init = function(){
331
- ezTOCInit();
332
- }
333
- // Start EZ TOC on page load.
334
- ezTOCInit();
335
- }
336
- } );
1
+ jQuery( function( $ ) {
2
+
3
+ /**
4
+ * @typedef ezTOC
5
+ * @type {Object} ezTOC
6
+ * @property {string} affixSelector
7
+ * @property {string} scroll_offset
8
+ * @property {string} smooth_scroll
9
+ * @property {string} visibility_hide_by_default
10
+ */
11
+
12
+ if ( typeof ezTOC != 'undefined' ) {
13
+
14
+ /**
15
+ * Init EZ TOC.
16
+ */
17
+ function ezTOCInit() {
18
+
19
+ var affix = $( '.ez-toc-widget-container.ez-toc-affix' );
20
+
21
+ if ( 0 !== affix.length ) {
22
+
23
+ /**
24
+ * The smooth scroll offset needs to be taken into account when defining the offset_top property.
25
+ * @link https://github.com/shazahm1/Easy-Table-of-Contents/issues/19
26
+ *
27
+ * @type {number}
28
+ */
29
+ var affixOffset = 30;
30
+
31
+ // check offset setting
32
+ if ( typeof ezTOC.scroll_offset != 'undefined' ) {
33
+
34
+ affixOffset = parseInt( ezTOC.scroll_offset );
35
+ }
36
+
37
+ $( ezTOC.affixSelector ).stick_in_parent( {
38
+ inner_scrolling: false,
39
+ offset_top: affixOffset
40
+ } )
41
+ }
42
+
43
+ $.fn.shrinkTOCWidth = function() {
44
+
45
+ $( this ).css( {
46
+ width: 'auto',
47
+ display: 'table'
48
+ });
49
+
50
+ if ( /MSIE 7\./.test( navigator.userAgent ) )
51
+ $( this ).css( 'width', '' );
52
+ };
53
+
54
+ var smoothScroll = parseInt( ezTOC.smooth_scroll );
55
+
56
+ if ( 1 === smoothScroll ) {
57
+
58
+ $( 'a.ez-toc-link' ).on( 'click', function() {
59
+
60
+ var self = $( this );
61
+
62
+ var target = '';
63
+ var hostname = self.prop( 'hostname' );
64
+ var pathname = self.prop( 'pathname' );
65
+ var qs = self.prop( 'search' );
66
+ var hash = self.prop( 'hash' );
67
+
68
+ // ie strips out the preceding / from pathname
69
+ if ( pathname.length > 0 ) {
70
+ if ( pathname.charAt( 0 ) !== '/' ) {
71
+ pathname = '/' + pathname;
72
+ }
73
+ }
74
+
75
+ if ( ( window.location.hostname === hostname ) &&
76
+ ( window.location.pathname === pathname ) &&
77
+ ( window.location.search === qs ) &&
78
+ ( hash !== '' )
79
+ ) {
80
+
81
+ // var id = decodeURIComponent( hash.replace( '#', '' ) );
82
+ target = '[id="' + hash.replace( '#', '' ) + '"]';
83
+
84
+ // verify it exists
85
+ if ( $( target ).length === 0 ) {
86
+ console.log( 'ezTOC scrollTarget Not Found: ' + target );
87
+ target = '';
88
+ }
89
+
90
+ // check offset setting
91
+ if ( typeof ezTOC.scroll_offset != 'undefined' ) {
92
+
93
+ var offset = -1 * ezTOC.scroll_offset;
94
+
95
+ } else {
96
+
97
+ var adminbar = $( '#wpadminbar' );
98
+
99
+ if ( adminbar.length > 0 ) {
100
+
101
+ if ( adminbar.is( ':visible' ) )
102
+ offset = -30; // admin bar exists, give it the default
103
+ else
104
+ offset = 0; // there is an admin bar but it's hidden, so no offset!
105
+
106
+ } else {
107
+
108
+ // no admin bar, so no offset!
109
+ offset = 0;
110
+ }
111
+ }
112
+
113
+ if ( target ) {
114
+ $.smoothScroll( {
115
+ scrollTarget: target,
116
+ offset: offset,
117
+ beforeScroll: deactivateSetActiveEzTocListElement,
118
+ afterScroll: function() { setActiveEzTocListElement(); activateSetActiveEzTocListElement(); }
119
+ } );
120
+
121
+ }
122
+ }
123
+ } );
124
+ }
125
+
126
+ if ( typeof ezTOC.visibility_hide_by_default != 'undefined' ) {
127
+
128
+ var toc = $( 'ul.ez-toc-list' );
129
+ var toggle = $( 'a.ez-toc-toggle' );
130
+ var invert = ezTOC.visibility_hide_by_default;
131
+
132
+ toggle.css( 'display', 'inline' );
133
+
134
+ if ( Cookies ) {
135
+
136
+ Cookies.get( 'ezTOC_hidetoc' ) == 1 ? toggle.data( 'visible', false ) : toggle.data( 'visible', true );
137
+ Cookies.remove('ezTOC_hidetoc')
138
+
139
+ } else {
140
+
141
+ toggle.data( 'visible', true );
142
+ Cookies.remove('ezTOC_hidetoc')
143
+ }
144
+
145
+ if ( invert ) {
146
+
147
+ toggle.data( 'visible', false )
148
+ }
149
+
150
+ if ( ! toggle.data( 'visible' ) ) {
151
+
152
+ toc.hide();
153
+ }
154
+
155
+ toggle.on( 'click', function( event ) {
156
+
157
+ event.preventDefault();
158
+
159
+ const main = document.querySelector("#ez-toc-container");
160
+ if(main){
161
+ main.classList.toggle("toc_close");
162
+ }
163
+ else
164
+ {
165
+ const side = document.querySelector(".ez-toc-widget-container");
166
+ side.classList.toggle("toc_close");
167
+ }
168
+
169
+ if ( $( this ).data( 'visible' ) ) {
170
+
171
+ $( this ).data( 'visible', false );
172
+
173
+ if ( Cookies ) {
174
+
175
+ if ( invert )
176
+ Cookies.set( 'ezTOC_hidetoc', null, { path: '/' } );
177
+ else
178
+ Cookies.set( 'ezTOC_hidetoc', '1', { expires: 30, path: '/' } );
179
+ }
180
+
181
+ toc.hide( 'fast' );
182
+
183
+ } else {
184
+
185
+ $( this ).data( 'visible', true );
186
+
187
+ if ( Cookies ) {
188
+
189
+ if ( invert )
190
+ Cookies.set( 'ezTOC_hidetoc', '1', { expires: 30, path: '/' } );
191
+ else
192
+ Cookies.set( 'ezTOC_hidetoc', null, { path: '/' } );
193
+ }
194
+
195
+ toc.show( 'fast' );
196
+
197
+ }
198
+
199
+ } );
200
+ }
201
+
202
+
203
+ // ======================================
204
+ // Set active heading in ez-toc-widget list
205
+ // ======================================
206
+
207
+ var headings = $( 'span.ez-toc-section' ).toArray();
208
+ var headingToListElementLinkMap = getHeadingToListElementLinkMap( headings );
209
+ var listElementLinks = $.map( headingToListElementLinkMap, function ( value, key ) {
210
+ return value
211
+ } );
212
+ var scrollOffset = getScrollOffset();
213
+
214
+ activateSetActiveEzTocListElement();
215
+
216
+ function setActiveEzTocListElement() {
217
+ var activeHeading = getActiveHeading( scrollOffset, headings );
218
+ if ( activeHeading ) {
219
+ var activeListElementLink = headingToListElementLinkMap[ activeHeading.id ];
220
+ removeStyleFromNonActiveListElement( activeListElementLink, listElementLinks );
221
+ setStyleForActiveListElementElement( activeListElementLink );
222
+ }
223
+ }
224
+
225
+ function activateSetActiveEzTocListElement() {
226
+ if ( headings.length > 0 && $('.ez-toc-widget-container').length) {
227
+ $( window ).on( 'load resize scroll', setActiveEzTocListElement );
228
+ }
229
+ }
230
+
231
+ function deactivateSetActiveEzTocListElement() {
232
+ $( window ).off( 'load resize scroll', setActiveEzTocListElement );
233
+ }
234
+
235
+ function getEzTocListElementLinkByHeading( heading ) {
236
+ return $( '.ez-toc-widget-container .ez-toc-list a[href="#' + $( heading ).attr( 'id' ) + '"]' );
237
+ }
238
+
239
+ function getHeadingToListElementLinkMap( headings ) {
240
+ return headings.reduce( function ( map, heading ) {
241
+ map[ heading.id ] = getEzTocListElementLinkByHeading( heading );
242
+ return map;
243
+ }, {} );
244
+ }
245
+
246
+ function getScrollOffset() {
247
+ var scrollOffset = 5; // so if smooth offset is off, the correct title is set as active
248
+ if ( typeof ezTOC.smooth_scroll != 'undefined' && parseInt( ezTOC.smooth_scroll ) === 1 ) {
249
+ scrollOffset = ( typeof ezTOC.scroll_offset != 'undefined' ) ? parseInt( ezTOC.scroll_offset ) : 30;
250
+ }
251
+
252
+ var adminbar = $( '#wpadminbar' );
253
+
254
+ if ( adminbar.length ) {
255
+ scrollOffset += adminbar.height();
256
+ }
257
+ return scrollOffset;
258
+ }
259
+
260
+ function getActiveHeading( topOffset, headings ) {
261
+ var scrollTop = $( window ).scrollTop();
262
+ var relevantOffset = scrollTop + topOffset + 1;
263
+ var activeHeading = headings[ 0 ];
264
+ var closestHeadingAboveOffset = relevantOffset - $( activeHeading ).offset().top;
265
+ headings.forEach( function ( section ) {
266
+ var topOffset = relevantOffset - $( section ).offset().top;
267
+ if ( topOffset > 0 && topOffset < closestHeadingAboveOffset ) {
268
+ closestHeadingAboveOffset = topOffset;
269
+ activeHeading = section;
270
+ }
271
+ } );
272
+ return activeHeading;
273
+ }
274
+
275
+ function removeStyleFromNonActiveListElement( activeListElementLink, listElementLinks ) {
276
+ listElementLinks.forEach( function ( listElementLink ) {
277
+ if ( activeListElementLink !== listElementLink && listElementLink.parent().hasClass( 'active' ) ) {
278
+ listElementLink.parent().removeClass( 'active' );
279
+ }
280
+ } );
281
+ }
282
+
283
+ function correctActiveListElementBackgroundColorHeight( activeListElement ) {
284
+ var listElementHeight = getListElementHeightWithoutUlChildren( activeListElement );
285
+ addListElementBackgroundColorHeightStyleToHead( listElementHeight );
286
+ }
287
+
288
+ function getListElementHeightWithoutUlChildren( listElement ) {
289
+ var $listElement = $( listElement );
290
+ var content = $listElement.html();
291
+ // Adding list item with class '.active' to get the real height.
292
+ // When adding a class to an existing element and using jQuery(..).height() directly afterwards,
293
+ // the height is the 'old' height. The height might change due to text-wraps when setting the text-weight bold for example
294
+ // When adding a new item, the height is calculated correctly.
295
+ // But only when it might be visible (so display:none; is not possible...)
296
+ // But because it get's directly removed afterwards it never will be rendered by the browser
297
+ // (at least in my tests in FF, Chrome, IE11 and Edge)
298
+ $listElement.parent().append( '<li id="ez-toc-height-test" class="active">' + content + '</li>' );
299
+ var listItem = $( '#ez-toc-height-test' );
300
+ var height = listItem.height();
301
+ listItem.remove();
302
+ return height - $listElement.children( 'ul' ).first().height();
303
+ }
304
+
305
+ function addListElementBackgroundColorHeightStyleToHead( listElementHeight ) {
306
+ // Remove existing
307
+ $( '#ez-toc-active-height' ).remove();
308
+ // jQuery(..).css(..) doesn't work, because ::before is a pseudo element and not part of the DOM
309
+ // Workaround is to add it to head
310
+ $( '<style id="ez-toc-active-height">' +
311
+ '.ez-toc-widget-container ul.ez-toc-list li.active {' +
312
+ // 'line-heigh:' + listElementHeight + 'px; ' +
313
+ 'height:' + listElementHeight + 'px;' +
314
+ '} </style>' )
315
+ .appendTo( 'head' );
316
+ }
317
+
318
+ function setStyleForActiveListElementElement( activeListElementLink ) {
319
+ var activeListElement = activeListElementLink.parent();
320
+ if ( !activeListElement.hasClass( 'active' ) ) {
321
+ activeListElement.addClass( 'active' );
322
+ }
323
+ correctActiveListElementBackgroundColorHeight( activeListElement );
324
+ }
325
+ }
326
+
327
+ /**
328
+ * Attach global init handler to ezTOC window object.
329
+ */
330
+ ezTOC.init = function(){
331
+ ezTOCInit();
332
+ }
333
+ // Start EZ TOC on page load.
334
+ ezTOCInit();
335
+ }
336
+ } );
assets/js/toc-mce-button.js CHANGED
@@ -1,12 +1,12 @@
1
- (function() {
2
- tinymce.PluginManager.add('toc_mce_button', function( editor, url ) {
3
- editor.addButton('toc_mce_button', {
4
- text: 'TOC',
5
- icon: false,
6
- onclick: function() {
7
- // change the shortcode as per your requirement
8
- editor.insertContent('[ez-toc]');
9
- }
10
- });
11
- });
12
  })();
1
+ (function() {
2
+ tinymce.PluginManager.add('toc_mce_button', function( editor, url ) {
3
+ editor.addButton('toc_mce_button', {
4
+ text: 'TOC',
5
+ icon: false,
6
+ onclick: function() {
7
+ // change the shortcode as per your requirement
8
+ editor.insertContent('[ez-toc]');
9
+ }
10
+ });
11
+ });
12
  })();
easy-table-of-contents.php CHANGED
@@ -1,827 +1,1066 @@
1
- <?php
2
- /**
3
- * Plugin Name: Easy Table of Contents
4
- * Plugin URI: https://magazine3.company/
5
- * Description: Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content.
6
- * Version: 2.0.31
7
- * Author: Magazine3
8
- * Author URI: https://magazine3.company/
9
- * Text Domain: easy-table-of-contents
10
- * Domain Path: /languages
11
- *
12
- * Copyright 2022 Magazine3 ( email : team@magazine3.in )
13
- *
14
- * Easy Table of Contents is free software; you can redistribute it and/or modify
15
- * it under the terms of the GNU General Public License, version 2, as
16
- * published by the Free Software Foundation.
17
- *
18
- * This program is distributed in the hope that it will be useful,
19
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- * GNU General Public License for more details.
22
- *
23
- * You should have received a copy of the GNU General Public License
24
- * along with Easy Table of Contents; if not, see <http://www.gnu.org/licenses/>.
25
- *
26
- * @package Easy Table of Contents
27
- * @category Plugin
28
- * @author Magazine3
29
- * @version 2.0.31
30
- */
31
-
32
- use Easy_Plugins\Table_Of_Contents\Debug;
33
- use function Easy_Plugins\Table_Of_Contents\String\mb_find_replace;
34
-
35
- // Exit if accessed directly
36
- if ( ! defined( 'ABSPATH' ) ) exit;
37
-
38
- if ( ! class_exists( 'ezTOC' ) ) {
39
-
40
- /**
41
- * Class ezTOC
42
- */
43
- final class ezTOC {
44
-
45
- /**
46
- * Current version.
47
- *
48
- * @since 1.0
49
- * @var string
50
- */
51
- const VERSION = '2.0.31';
52
-
53
- /**
54
- * Stores the instance of this class.
55
- *
56
- * @access private
57
- * @since 1.0
58
- * @static
59
- *
60
- * @var ezTOC
61
- */
62
- private static $instance;
63
-
64
- /**
65
- * @since 2.0
66
- * @var array
67
- */
68
- private static $store = array();
69
-
70
- /**
71
- * A dummy constructor to prevent the class from being loaded more than once.
72
- *
73
- * @access public
74
- * @since 1.0
75
- */
76
- public function __construct() { /* Do nothing here */ }
77
-
78
- /**
79
- * @access private
80
- * @since 1.0
81
- * @static
82
- *
83
- * @return ezTOC
84
- */
85
- public static function instance() {
86
-
87
- if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
88
-
89
- self::$instance = new self;
90
-
91
- self::defineConstants();
92
- self::includes();
93
- self::hooks();
94
-
95
- self::loadTextdomain();
96
- }
97
-
98
- return self::$instance;
99
- }
100
-
101
- /**
102
- * Define the plugin constants.
103
- *
104
- * @access private
105
- * @since 1.0
106
- * @static
107
- */
108
- private static function defineConstants() {
109
-
110
- define( 'EZ_TOC_DIR_NAME', plugin_basename( dirname( __FILE__ ) ) );
111
- define( 'EZ_TOC_BASE_NAME', plugin_basename( __FILE__ ) );
112
- define( 'EZ_TOC_PATH', dirname( __FILE__ ) );
113
- define( 'EZ_TOC_URL', plugin_dir_url( __FILE__ ) );
114
- }
115
-
116
- /**
117
- * Includes the plugin dependency files.
118
- *
119
- * @access private
120
- * @since 1.0
121
- * @static
122
- */
123
- private static function includes() {
124
-
125
- require_once( EZ_TOC_PATH . '/includes/class.options.php' );
126
-
127
- if ( is_admin() ) {
128
-
129
- // This must be included after `class.options.php` because it depends on it methods.
130
- require_once( EZ_TOC_PATH . '/includes/class.admin.php' );
131
- require_once(EZ_TOC_PATH. "/includes/helper-function.php" );
132
- require_once( EZ_TOC_PATH . '/includes/newsletter.php' );
133
- }
134
-
135
- require_once( EZ_TOC_PATH . '/includes/class.post.php' );
136
- require_once( EZ_TOC_PATH . '/includes/class.widget-toc.php' );
137
- require_once( EZ_TOC_PATH . '/includes/Debug.php' );
138
- require_once( EZ_TOC_PATH . '/includes/inc.functions.php' );
139
- require_once( EZ_TOC_PATH . '/includes/inc.string-functions.php' );
140
-
141
- require_once( EZ_TOC_PATH . '/includes/inc.plugin-compatibility.php' );
142
- }
143
-
144
- /**
145
- * Add the core action filter hook.
146
- *
147
- * @access private
148
- * @since 1.0
149
- * @static
150
- */
151
- private static function hooks() {
152
-
153
- //add_action( 'plugins_loaded', array( __CLASS__, 'loadTextdomain' ) );
154
- add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueueScripts' ) );
155
- add_action('admin_head', array( __CLASS__, 'addEditorButton' ));
156
- // Run after shortcodes are interpreted (priority 10).
157
- add_filter( 'the_content', array( __CLASS__, 'the_content' ), 100 );
158
- add_shortcode( 'ez-toc', array( __CLASS__, 'shortcode' ) );
159
- add_shortcode( 'lwptoc', array( __CLASS__, 'shortcode' ) );
160
- add_shortcode( apply_filters( 'ez_toc_shortcode', 'toc' ), array( __CLASS__, 'shortcode' ) );
161
- }
162
-
163
- /**
164
- * Load the plugin translation.
165
- *
166
- * Credit: Adapted from Ninja Forms / Easy Digital Downloads.
167
- *
168
- * @access private
169
- * @since 1.0
170
- * @static
171
- *
172
- * @uses apply_filters()
173
- * @uses get_locale()
174
- * @uses load_textdomain()
175
- * @uses load_plugin_textdomain()
176
- *
177
- * @return void
178
- */
179
- public static function loadTextdomain() {
180
-
181
- // Plugin textdomain. This should match the one set in the plugin header.
182
- $domain = 'easy-table-of-contents';
183
-
184
- // Set filter for plugin's languages directory
185
- $languagesDirectory = apply_filters( "ez_{$domain}_languages_directory", EZ_TOC_DIR_NAME . '/languages/' );
186
-
187
- // Traditional WordPress plugin locale filter
188
- $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
189
- $fileName = sprintf( '%1$s-%2$s.mo', $domain, $locale );
190
-
191
- // Setup paths to current locale file
192
- $local = $languagesDirectory . $fileName;
193
- $global = WP_LANG_DIR . "/{$domain}/" . $fileName;
194
-
195
- if ( file_exists( $global ) ) {
196
-
197
- // Look in global `../wp-content/languages/{$domain}/` folder.
198
- load_textdomain( $domain, $global );
199
-
200
- } elseif ( file_exists( $local ) ) {
201
-
202
- // Look in local `../wp-content/plugins/{plugin-directory}/languages/` folder.
203
- load_textdomain( $domain, $local );
204
-
205
- } else {
206
-
207
- // Load the default language files
208
- load_plugin_textdomain( $domain, false, $languagesDirectory );
209
- }
210
- }
211
-
212
- /**
213
- * Call back for the `wp_enqueue_scripts` action.
214
- *
215
- * Register and enqueue CSS and javascript files for frontend.
216
- *
217
- * @access private
218
- * @since 1.0
219
- * @static
220
- */
221
- public static function enqueueScripts() {
222
-
223
- // If SCRIPT_DEBUG is set and TRUE load the non-minified JS files, otherwise, load the minified files.
224
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
225
-
226
- $js_vars = array();
227
-
228
- $isEligible = self::is_eligible( get_post() );
229
-
230
- if ( ! $isEligible && ! is_active_widget( false, false, 'ezw_tco' ) ) {
231
- return false;
232
- }
233
-
234
- wp_register_style( 'ez-icomoon', EZ_TOC_URL . "vendor/icomoon/style$min.css", array(), ezTOC::VERSION );
235
- if (!ezTOC_Option::get( 'inline_css' )) {
236
- wp_register_style( 'ez-toc', EZ_TOC_URL . "assets/css/screen$min.css", array( 'ez-icomoon' ), ezTOC::VERSION );
237
- }
238
- wp_register_script( 'js-cookie', EZ_TOC_URL . "vendor/js-cookie/js.cookie$min.js", array(), '2.2.1', TRUE );
239
- wp_register_script( 'jquery-smooth-scroll', EZ_TOC_URL . "vendor/smooth-scroll/jquery.smooth-scroll$min.js", array( 'jquery' ), '2.2.0', TRUE );
240
- wp_register_script( 'jquery-sticky-kit', EZ_TOC_URL . "vendor/sticky-kit/jquery.sticky-kit$min.js", array( 'jquery' ), '1.9.2', TRUE );
241
-
242
- if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
243
- wp_register_script(
244
- 'ez-toc-js',
245
- EZ_TOC_URL . "assets/js/front{$min}.js",
246
- array( 'jquery-smooth-scroll', 'js-cookie', 'jquery-sticky-kit' ),
247
- ezTOC::VERSION . '-' . filemtime( EZ_TOC_PATH . "/assets/js/front{$min}.js" ),
248
- true
249
- );
250
- }
251
-
252
- if ( ! ezTOC_Option::get( 'exclude_css' ) ) {
253
-
254
- wp_enqueue_style( 'ez-toc' );
255
- self::inlineCSS();
256
- }
257
-
258
- if ( ezTOC_Option::get( 'smooth_scroll' ) ) {
259
-
260
- $js_vars['smooth_scroll'] = true;
261
- }
262
-
263
- //wp_enqueue_script( 'ez-toc-js' );
264
-
265
- if ( ezTOC_Option::get( 'show_heading_text' ) && ezTOC_Option::get( 'visibility' ) ) {
266
-
267
- $width = ezTOC_Option::get( 'width' ) !== 'custom' ? ezTOC_Option::get( 'width' ) : ezTOC_Option::get( 'width_custom' ) . ezTOC_Option::get( 'width_custom_units' );
268
-
269
- $js_vars['visibility_hide_by_default'] = ezTOC_Option::get( 'visibility_hide_by_default' ) ? true : false;
270
-
271
- $js_vars['width'] = esc_js( $width );
272
- }else{
273
- if(ezTOC_Option::get( 'visibility' )){
274
- $js_vars['visibility_hide_by_default'] = ezTOC_Option::get( 'visibility_hide_by_default' ) ? true : false;
275
- }
276
- }
277
-
278
- $offset = wp_is_mobile() ? ezTOC_Option::get( 'mobile_smooth_scroll_offset', 0 ) : ezTOC_Option::get( 'smooth_scroll_offset', 30 );
279
-
280
- $js_vars['scroll_offset'] = esc_js( $offset );
281
-
282
- if ( ezTOC_Option::get( 'widget_affix_selector' ) ) {
283
-
284
- $js_vars['affixSelector'] = ezTOC_Option::get( 'widget_affix_selector' );
285
- }
286
-
287
- if ( 0 < count( $js_vars ) ) {
288
-
289
- wp_localize_script( 'ez-toc-js', 'ezTOC', $js_vars );
290
- }
291
- }
292
-
293
- /**
294
- * Prints out inline CSS after the core CSS file to allow overriding core styles via options.
295
- *
296
- * @access private
297
- * @since 1.0
298
- * @static
299
- */
300
- public static function inlineCSS() {
301
-
302
- $css = '';
303
-
304
- if ( ! ezTOC_Option::get( 'exclude_css' ) ) {
305
-
306
- $css .= 'div#ez-toc-container p.ez-toc-title {font-size: ' . ezTOC_Option::get( 'title_font_size', 120 ) . ezTOC_Option::get( 'title_font_size_units', '%' ) . ';}';
307
- $css .= 'div#ez-toc-container p.ez-toc-title {font-weight: ' . ezTOC_Option::get( 'title_font_weight', 500 ) . ';}';
308
- $css .= 'div#ez-toc-container ul li {font-size: ' . ezTOC_Option::get( 'font_size' ) . ezTOC_Option::get( 'font_size_units' ) . ';}';
309
- $css .= 'div#ez-toc-container nav ul ul li ul li {font-size: ' . ezTOC_Option::get( 'child_font_size' ) . ezTOC_Option::get( 'font_size_units' ) . '!important;}';
310
-
311
- if ( ezTOC_Option::get( 'theme' ) === 'custom' || ezTOC_Option::get( 'width' ) != 'auto' ) {
312
-
313
- $css .= 'div#ez-toc-container {';
314
-
315
- if ( ezTOC_Option::get( 'theme' ) === 'custom' ) {
316
-
317
- $css .= 'background: ' . ezTOC_Option::get( 'custom_background_colour' ) . ';border: 1px solid ' . ezTOC_Option::get( 'custom_border_colour' ) . ';';
318
- }
319
-
320
- if ( 'auto' !== ezTOC_Option::get( 'width' ) ) {
321
-
322
- $css .= 'width: ';
323
-
324
- if ( 'custom' !== ezTOC_Option::get( 'width' ) ) {
325
-
326
- $css .= ezTOC_Option::get( 'width' );
327
-
328
- } else {
329
-
330
- $css .= ezTOC_Option::get( 'width_custom' ) . ezTOC_Option::get( 'width_custom_units' );
331
- }
332
-
333
- $css .= ';';
334
- }
335
-
336
- $css .= '}';
337
- }
338
-
339
- if ( 'custom' === ezTOC_Option::get( 'theme' ) ) {
340
-
341
- $css .= 'div#ez-toc-container p.ez-toc-title {color: ' . ezTOC_Option::get( 'custom_title_colour' ) . ';}';
342
- //$css .= 'div#ez-toc-container p.ez-toc-title a,div#ez-toc-container ul.ez-toc-list a {color: ' . ezTOC_Option::get( 'custom_link_colour' ) . ';}';
343
- $css .= 'div#ez-toc-container ul.ez-toc-list a {color: ' . ezTOC_Option::get( 'custom_link_colour' ) . ';}';
344
- $css .= 'div#ez-toc-container ul.ez-toc-list a:hover {color: ' . ezTOC_Option::get( 'custom_link_hover_colour' ) . ';}';
345
- $css .= 'div#ez-toc-container ul.ez-toc-list a:visited {color: ' . ezTOC_Option::get( 'custom_link_visited_colour' ) . ';}';
346
- }
347
- }
348
-
349
- if ( $css ) {
350
-
351
- wp_add_inline_style( 'ez-toc', $css );
352
- }
353
- }
354
-
355
- /**
356
- * Array search deep.
357
- *
358
- * Search an array recursively for a value.
359
- *
360
- * @link https://stackoverflow.com/a/5427665/5351316
361
- *
362
- * @param $search
363
- * @param array $array
364
- * @param string $mode
365
- *
366
- * @return bool
367
- */
368
- public static function array_search_deep( $search, array $array, $mode = 'value' ) {
369
-
370
- foreach ( new RecursiveIteratorIterator( new RecursiveArrayIterator( $array ) ) as $key => $value ) {
371
-
372
- if ( $search === ${${"mode"}} ) {
373
- return true;
374
- }
375
- }
376
-
377
- return false;
378
- }
379
-
380
- /**
381
- * Returns true if the table of contents is eligible to be printed, false otherwise.
382
- *
383
- * NOTE: Must bve use only within the loop.
384
- *
385
- * @access public
386
- * @since 1.0
387
- * @static
388
- *
389
- * @param WP_Post $post
390
- *
391
- * @return bool
392
- */
393
- public static function is_eligible( $post ) {
394
-
395
- //global $wp_current_filter;
396
-
397
- if ( empty( $post ) || ! $post instanceof WP_Post ) {
398
-
399
- Debug::log( 'not_instance_of_post', 'Not an instance if `WP_Post`.', $post );
400
- return false;
401
- }
402
-
403
- // This can likely be removed since it is checked in maybeApplyTheContentFilter().
404
- // Do not execute if root filter is one of those in the array.
405
- //if ( in_array( $wp_current_filter[0], array( 'get_the_excerpt', 'wp_head' ), true ) ) {
406
- //
407
- // return false;
408
- //}
409
-
410
- if ( has_shortcode( $post->post_content, apply_filters( 'ez_toc_shortcode', 'toc' ) ) ||
411
- has_shortcode( $post->post_content, 'ez-toc' ) ) {
412
-
413
- Debug::log( 'has_ez_toc_shortcode', 'Has instance of shortcode.', true );
414
- return true;
415
- }
416
-
417
- if ( is_front_page() && ! ezTOC_Option::get( 'include_homepage' ) ) {
418
-
419
- Debug::log( 'is_front_page', 'Is frontpage, TOC is not enabled.', false );
420
- return false;
421
- }
422
-
423
- $type = get_post_type( $post->ID );
424
-
425
- Debug::log( 'current_post_type', 'Post type is.', $type );
426
-
427
- $enabled = in_array( $type, ezTOC_Option::get( 'enabled_post_types', array() ), true );
428
- $insert = in_array( $type, ezTOC_Option::get( 'auto_insert_post_types', array() ), true );
429
-
430
- Debug::log( 'is_supported_post_type', 'Is supported post type?', $enabled );
431
- Debug::log( 'is_auto_insert_post_type', 'Is auto insert for post types?', $insert );
432
-
433
- if ( $insert || $enabled ) {
434
-
435
- if ( ezTOC_Option::get( 'restrict_path' ) ) {
436
-
437
- /**
438
- * @link https://wordpress.org/support/topic/restrict-path-logic-does-not-work-correctly?
439
- */
440
- if ( false !== strpos( ezTOC_Option::get( 'restrict_path' ), $_SERVER['REQUEST_URI'] ) ) {
441
-
442
- Debug::log( 'is_restricted_path', 'In restricted path, post not eligible.', ezTOC_Option::get( 'restrict_path' ) );
443
- return false;
444
-
445
- } else {
446
-
447
- Debug::log( 'is_not_restricted_path', 'Not in restricted path, post is eligible.', ezTOC_Option::get( 'restrict_path' ) );
448
- return true;
449
- }
450
-
451
- } else {
452
-
453
- if ( $insert && 1 === (int) get_post_meta( $post->ID, '_ez-toc-disabled', true ) ) {
454
-
455
- Debug::log( 'is_auto_insert_disable_post_meta', 'Auto insert enabled and disable TOC is enabled in post meta.', false );
456
- return false;
457
-
458
- } elseif ( $insert && 0 === (int) get_post_meta( $post->ID, '_ez-toc-disabled', true ) ) {
459
-
460
- Debug::log( 'is_auto_insert_enabled_post_meta', 'Auto insert enabled and disable TOC is not enabled in post meta.', true );
461
- return true;
462
-
463
- } elseif ( $enabled && 1 === (int) get_post_meta( $post->ID, '_ez-toc-insert', true ) ) {
464
-
465
- Debug::log( 'is_supported_post_type_disable_insert_post_meta', 'Supported post type and insert TOC is enabled in post meta.', true );
466
- return true;
467
-
468
- } elseif ( $enabled && $insert ) {
469
-
470
- Debug::log( 'supported_post_type_and_auto_insert', 'Supported post type and auto insert TOC is enabled.', true );
471
- return true;
472
- }
473
-
474
- Debug::log( 'not_auto_insert_or_not_supported_post_type', 'Not supported post type or insert TOC is disabled.', false );
475
- return false;
476
- }
477
-
478
- } else {
479
-
480
- Debug::log( 'not_auto_insert_and_not_supported post_type', 'Not supported post type and do not auto insert TOC.', false );
481
- return false;
482
- }
483
- }
484
-
485
- /**
486
- * Get TOC from store and if not in store process post and add it to the store.
487
- *
488
- * @since 2.0
489
- *
490
- * @param int $id
491
- *
492
- * @return ezTOC_Post|null
493
- */
494
- public static function get( $id ) {
495
-
496
- $post = null;
497
-
498
- if ( isset( self::$store[ $id ] ) && self::$store[ $id ] instanceof ezTOC_Post ) {
499
-
500
- $post = self::$store[ $id ];
501
-
502
- } else {
503
-
504
- $post = ezTOC_Post::get( get_the_ID() );
505
-
506
- if ( $post instanceof ezTOC_Post ) {
507
-
508
- self::$store[ $id ] = $post;
509
- }
510
- }
511
-
512
- return $post;
513
- }
514
-
515
- /**
516
- * Callback for the registered shortcode `[ez-toc]`
517
- *
518
- * NOTE: Shortcode is run before the callback @see ezTOC::the_content() for the `the_content` filter
519
- *
520
- * @access private
521
- * @since 1.3
522
- *
523
- * @param array|string $atts Shortcode attributes array or empty string.
524
- * @param string $content The enclosed content (if the shortcode is used in its enclosing form)
525
- * @param string $tag Shortcode name.
526
- *
527
- * @return string
528
- */
529
- public static function shortcode( $atts, $content, $tag ) {
530
-
531
- static $run = true;
532
- $html = '';
533
-
534
- if ( $run ) {
535
-
536
- $post = self::get( get_the_ID() );
537
-
538
- if ( ! $post instanceof ezTOC_Post ) {
539
-
540
- Debug::log( 'not_instance_of_post', 'Not an instance if `WP_Post`.', get_the_ID() );
541
-
542
- return Debug::log()->appendTo( $content );
543
- }
544
-
545
- $html = $post->getTOC();
546
- $run = false;
547
- }
548
- if (isset($atts["initial_view"]) && !empty($atts["initial_view"]) && $atts["initial_view"] == 'hide') {
549
- $html = preg_replace('/class="ez-toc-list ez-toc-list-level-1"/', 'class="ez-toc-list ez-toc-list-level-1" style="display:none"', $html);
550
- }
551
-
552
- return $html;
553
- }
554
-
555
- /**
556
- * Whether or not apply `the_content` filter.
557
- *
558
- * @since 2.0
559
- *
560
- * @return bool
561
- */
562
- private static function maybeApplyTheContentFilter() {
563
-
564
- $apply = true;
565
-
566
- global $wp_current_filter;
567
-
568
- // Do not execute if root current filter is one of those in the array.
569
- if ( in_array( $wp_current_filter[0], array( 'get_the_excerpt', 'init', 'wp_head' ), true ) ) {
570
-
571
- $apply = false;
572
- }
573
-
574
- // bail if feed, search or archive
575
- if ( is_feed() || is_search() || is_archive() ) {
576
-
577
- $apply = false;
578
- }
579
-
580
- if ( ! empty( array_intersect( $wp_current_filter, array( 'get_the_excerpt', 'init', 'wp_head' ) ) ) ) {
581
- $apply = false;
582
- }
583
- /**
584
- * Whether or not to apply `the_content` filter callback.
585
- *
586
- * @see ezTOC::the_content()
587
- *
588
- * @since 2.0
589
- *
590
- * @param bool $apply
591
- */
592
- return apply_filters( 'ez_toc_maybe_apply_the_content_filter', $apply );
593
- }
594
-
595
- /**
596
- * Callback for the `the_content` filter.
597
- *
598
- * This will add the inline table of contents page anchors to the post content. It will also insert the
599
- * table of contents inline with the post content as defined by the user defined preference.
600
- *
601
- * @since 1.0
602
- *
603
- * @param string $content
604
- *
605
- * @return string
606
- */
607
- public static function the_content( $content ) {
608
- $maybeApplyFilter = self::maybeApplyTheContentFilter();
609
-
610
- Debug::log( 'the_content_filter', 'The `the_content` filter applied.', $maybeApplyFilter );
611
-
612
- if ( ! $maybeApplyFilter ) {
613
-
614
- return Debug::log()->appendTo( $content );
615
- }
616
-
617
- // Bail if post not eligible and widget is not active.
618
- $isEligible = self::is_eligible( get_post() );
619
- $isEligible = apply_filters('eztoc_do_shortcode',$isEligible);
620
- Debug::log( 'post_eligible', 'Post eligible.', $isEligible );
621
-
622
- if ( ! $isEligible && ! is_active_widget( false, false, 'ezw_tco' ) ) {
623
-
624
- return Debug::log()->appendTo( $content );
625
- }
626
-
627
- $post = self::get( get_the_ID() );
628
-
629
- if ( ! $post instanceof ezTOC_Post ) {
630
-
631
- Debug::log( 'not_instance_of_post', 'Not an instance if `WP_Post`.', get_the_ID() );
632
-
633
- return Debug::log()->appendTo( $content );
634
- }
635
-
636
- // Bail if no headings found.
637
- if ( ! $post->hasTOCItems() ) {
638
-
639
- return Debug::log()->appendTo( $content );
640
- }
641
-
642
- $find = $post->getHeadings();
643
- $replace = $post->getHeadingsWithAnchors();
644
- $toc = $post->getTOC();
645
- $headings = implode( PHP_EOL, $find );
646
- $anchors = implode( PHP_EOL, $replace );
647
-
648
- $headingRows = count( $find ) + 1;
649
- $anchorRows = count( $replace ) + 1;
650
-
651
- $style = "background-image: linear-gradient(#F1F1F1 50%, #F9F9F9 50%); background-size: 100% 4em; border: 1px solid #CCC; font-family: monospace; font-size: 1em; line-height: 2em; margin: 0 auto; overflow: auto; padding: 0 8px 4px; white-space: nowrap; width: 100%;";
652
-
653
- Debug::log(
654
- 'found_post_headings',
655
- 'Found headings:',
656
- "<textarea rows='{$headingRows}' style='{$style}' wrap='soft'>{$headings}</textarea>"
657
- );
658
-
659
- Debug::log(
660
- 'replace_post_headings',
661
- 'Replace found headings with:',
662
- "<textarea rows='{$anchorRows}' style='{$style}' wrap='soft'>{$anchors}</textarea>"
663
- );
664
-
665
- // If shortcode used or post not eligible, return content with anchored headings.
666
- if ( strpos( $content, 'ez-toc-container' ) || ! $isEligible ) {
667
-
668
- Debug::log( 'shortcode_found', 'Shortcode found, add links to content.', true );
669
-
670
- return mb_find_replace( $find, $replace, $content );
671
- }
672
-
673
- $position = ezTOC_Option::get( 'position' );
674
-
675
- Debug::log( 'toc_insert_position', 'Insert TOC at position', $position );
676
-
677
- // else also add toc to content
678
- switch ( $position ) {
679
-
680
- case 'top':
681
- $content = $toc . mb_find_replace( $find, $replace, $content );
682
- break;
683
-
684
- case 'bottom':
685
- $content = mb_find_replace( $find, $replace, $content ) . $toc;
686
- break;
687
-
688
- case 'after':
689
- $replace[0] = $replace[0] . $toc;
690
- $content = mb_find_replace( $find, $replace, $content );
691
- break;
692
- case 'afterpara':
693
- $get_para = preg_match_all('%(<p[^>]*>.*?</p>)%i', $content, $matches);
694
- $first_para = $matches[1][0];
695
- $content = $first_para . $toc . $content;
696
- break;
697
- case 'before':
698
- default:
699
- //$replace[0] = $html . $replace[0];
700
- $content = mb_find_replace( $find, $replace, $content );
701
-
702
- /**
703
- * @link https://wordpress.org/support/topic/php-notice-undefined-offset-8/
704
- */
705
- if ( ! array_key_exists( 0, $replace ) ) {
706
- break;
707
- }
708
-
709
- $pattern = '`<h[1-6]{1}[^>]*' . preg_quote( $replace[0], '`' ) . '`msuU';
710
- $result = preg_match( $pattern, $content, $matches );
711
-
712
- /*
713
- * Try to place TOC before the first heading found in eligible heading, failing that,
714
- * insert TOC at top of content.
715
- */
716
- if ( 1 === $result ) {
717
-
718
- Debug::log( 'toc_insert_position_found', 'Insert TOC before first eligible heading.', $result );
719
-
720
- $start = strpos( $content, $matches[0] );
721
- $content = substr_replace( $content, $toc, $start, 0 );
722
-
723
- } else {
724
-
725
- Debug::log( 'toc_insert_position_not_found', 'Insert TOC before first eligible heading not found.', $result );
726
-
727
- // Somehow, there are scenarios where the processing get this far and
728
- // the TOC is being added to pages where it should not. Disable for now.
729
- //$content = $html . $content;
730
- }
731
- }
732
-
733
- return Debug::log()->appendTo( $content );
734
- }
735
-
736
- /**
737
- * Call back for the `wp_head` action.
738
- *
739
- * Add add button for shortcode in wysisyg editor .
740
- *
741
- * @access private
742
- * @since 1.0
743
- * @static
744
- */
745
- public static function addEditorButton() {
746
-
747
- if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {
748
- return;
749
- }
750
-
751
-
752
- if ( 'true' == get_user_option( 'rich_editing' ) ) {
753
- add_filter( 'mce_external_plugins', array( __CLASS__, 'toc_add_tinymce_plugin'));
754
- add_filter( 'mce_buttons', array( __CLASS__, 'toc_register_mce_button' ));
755
- }
756
-
757
- }
758
-
759
- /**
760
- * Call back for the `mce_external_plugins` action.
761
- *
762
- * Register new button in the editor.
763
- *
764
- * @access private
765
- * @since 1.0
766
- * @static
767
- */
768
-
769
- public static function toc_register_mce_button( $buttons ) {
770
-
771
- array_push( $buttons, 'toc_mce_button' );
772
- return $buttons;
773
- }
774
-
775
- /**
776
- * Call back for the `mce_buttons` action.
777
- *
778
- * Add js to insert the shortcode on the click event.
779
- *
780
- * @access private
781
- * @since 1.0
782
- * @static
783
- */
784
- public static function toc_add_tinymce_plugin( $plugin_array ) {
785
-
786
- $plugin_array['toc_mce_button'] = EZ_TOC_URL .'assets/js/toc-mce-button.js';
787
- return $plugin_array;
788
- }
789
-
790
- }
791
-
792
- /**
793
- * The main function responsible for returning the Easy Table of Contents instance to functions everywhere.
794
- *
795
- * Use this function like you would a global variable, except without needing to declare the global.
796
- *
797
- * Example: <?php $instance = ezTOC(); ?>
798
- *
799
- * @access public
800
- * @since 1.0
801
- *
802
- * @return ezTOC
803
- */
804
- function ezTOC() {
805
-
806
- return ezTOC::instance();
807
- }
808
-
809
- // Start Easy Table of Contents.
810
- add_action( 'plugins_loaded', 'ezTOC' );
811
- }
812
- register_activation_hook(__FILE__, 'ez_toc_activate');
813
- add_action('admin_init', 'ez_toc_redirect');
814
-
815
- function ez_toc_activate() {
816
- add_option('ez_toc_do_activation_redirect', true);
817
- }
818
-
819
- function ez_toc_redirect() {
820
- if (get_option('ez_toc_do_activation_redirect', false)) {
821
- delete_option('ez_toc_do_activation_redirect');
822
- if(!isset($_GET['activate-multi']))
823
- {
824
- wp_redirect("options-general.php?page=table-of-contents#welcome");
825
- }
826
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
827
  }
1
+ <?php
2
+ /**
3
+ * Plugin Name: Easy Table of Contents
4
+ * Plugin URI: https://magazine3.company/
5
+ * Description: Adds a user friendly and fully automatic way to create and display a table of contents generated from the page content.
6
+ * Version: 2.0.32
7
+ * Author: Magazine3
8
+ * Author URI: https://magazine3.company/
9
+ * Text Domain: easy-table-of-contents
10
+ * Domain Path: /languages
11
+ *
12
+ * Copyright 2022 Magazine3 ( email : team@magazine3.in )
13
+ *
14
+ * Easy Table of Contents is free software; you can redistribute it and/or modify
15
+ * it under the terms of the GNU General Public License, version 2, as
16
+ * published by the Free Software Foundation.
17
+ *
18
+ * This program is distributed in the hope that it will be useful,
19
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ * GNU General Public License for more details.
22
+ *
23
+ * You should have received a copy of the GNU General Public License
24
+ * along with Easy Table of Contents; if not, see <http://www.gnu.org/licenses/>.
25
+ *
26
+ * @package Easy Table of Contents
27
+ * @category Plugin
28
+ * @author Magazine3
29
+ * @version 2.0.32
30
+ */
31
+
32
+ use Easy_Plugins\Table_Of_Contents\Debug;
33
+ use function Easy_Plugins\Table_Of_Contents\String\mb_find_replace;
34
+
35
+ // Exit if accessed directly
36
+ if ( ! defined( 'ABSPATH' ) ) exit;
37
+
38
+ if ( ! class_exists( 'ezTOC' ) ) {
39
+
40
+ /**
41
+ * Class ezTOC
42
+ */
43
+ final class ezTOC {
44
+
45
+ /**
46
+ * Current version.
47
+ *
48
+ * @since 1.0
49
+ * @var string
50
+ */
51
+ const VERSION = '2.0.32';
52
+
53
+ /**
54
+ * Stores the instance of this class.
55
+ *
56
+ * @access private
57
+ * @since 1.0
58
+ * @static
59
+ *
60
+ * @var ezTOC
61
+ */
62
+ private static $instance;
63
+
64
+ /**
65
+ * @since 2.0
66
+ * @var array
67
+ */
68
+ private static $store = array();
69
+
70
+ /**
71
+ * A dummy constructor to prevent the class from being loaded more than once.
72
+ *
73
+ * @access public
74
+ * @since 1.0
75
+ */
76
+ public function __construct() { /* Do nothing here */ }
77
+
78
+ /**
79
+ * @access private
80
+ * @since 1.0
81
+ * @static
82
+ *
83
+ * @return ezTOC
84
+ */
85
+ public static function instance() {
86
+
87
+ if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
88
+
89
+ self::$instance = new self;
90
+
91
+ self::defineConstants();
92
+ self::includes();
93
+ self::hooks();
94
+
95
+ self::loadTextdomain();
96
+ }
97
+
98
+ return self::$instance;
99
+ }
100
+
101
+ /**
102
+ * Define the plugin constants.
103
+ *
104
+ * @access private
105
+ * @since 1.0
106
+ * @static
107
+ */
108
+ private static function defineConstants() {
109
+
110
+ define( 'EZ_TOC_DIR_NAME', plugin_basename( dirname( __FILE__ ) ) );
111
+ define( 'EZ_TOC_BASE_NAME', plugin_basename( __FILE__ ) );
112
+ define( 'EZ_TOC_PATH', dirname( __FILE__ ) );
113
+ define( 'EZ_TOC_URL', plugin_dir_url( __FILE__ ) );
114
+ }
115
+
116
+ /**
117
+ * Includes the plugin dependency files.
118
+ *
119
+ * @access private
120
+ * @since 1.0
121
+ * @static
122
+ */
123
+ private static function includes() {
124
+
125
+ require_once( EZ_TOC_PATH . '/includes/class.options.php' );
126
+
127
+ if ( is_admin() ) {
128
+
129
+ // This must be included after `class.options.php` because it depends on it methods.
130
+ require_once( EZ_TOC_PATH . '/includes/class.admin.php' );
131
+ require_once(EZ_TOC_PATH. "/includes/helper-function.php" );
132
+ require_once( EZ_TOC_PATH . '/includes/newsletter.php' );
133
+ }
134
+
135
+ require_once( EZ_TOC_PATH . '/includes/class.post.php' );
136
+ require_once( EZ_TOC_PATH . '/includes/class.widget-toc.php' );
137
+ require_once( EZ_TOC_PATH . '/includes/Debug.php' );
138
+ require_once( EZ_TOC_PATH . '/includes/inc.functions.php' );
139
+ require_once( EZ_TOC_PATH . '/includes/inc.string-functions.php' );
140
+
141
+ require_once( EZ_TOC_PATH . '/includes/inc.plugin-compatibility.php' );
142
+ }
143
+
144
+ /**
145
+ * Add the core action filter hook.
146
+ *
147
+ * @access private
148
+ * @since 1.0
149
+ * @static
150
+ */
151
+ private static function hooks() {
152
+
153
+ //add_action( 'plugins_loaded', array( __CLASS__, 'loadTextdomain' ) );
154
+ add_action( 'wp_enqueue_scripts', array( __CLASS__, 'enqueueScripts' ) );
155
+ add_action('admin_head', array( __CLASS__, 'addEditorButton' ));
156
+ // Run after shortcodes are interpreted (priority 10).
157
+ add_filter( 'the_content', array( __CLASS__, 'the_content' ), 100 );
158
+ add_shortcode( 'ez-toc', array( __CLASS__, 'shortcode' ) );
159
+ add_shortcode( 'lwptoc', array( __CLASS__, 'shortcode' ) );
160
+ add_shortcode( apply_filters( 'ez_toc_shortcode', 'toc' ), array( __CLASS__, 'shortcode' ) );
161
+ }
162
+
163
+ /**
164
+ * Load the plugin translation.
165
+ *
166
+ * Credit: Adapted from Ninja Forms / Easy Digital Downloads.
167
+ *
168
+ * @access private
169
+ * @since 1.0
170
+ * @static
171
+ *
172
+ * @uses apply_filters()
173
+ * @uses get_locale()
174
+ * @uses load_textdomain()
175
+ * @uses load_plugin_textdomain()
176
+ *
177
+ * @return void
178
+ */
179
+ public static function loadTextdomain() {
180
+
181
+ // Plugin textdomain. This should match the one set in the plugin header.
182
+ $domain = 'easy-table-of-contents';
183
+
184
+ // Set filter for plugin's languages directory
185
+ $languagesDirectory = apply_filters( "ez_{$domain}_languages_directory", EZ_TOC_DIR_NAME . '/languages/' );
186
+
187
+ // Traditional WordPress plugin locale filter
188
+ $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
189
+ $fileName = sprintf( '%1$s-%2$s.mo', $domain, $locale );
190
+
191
+ // Setup paths to current locale file
192
+ $local = $languagesDirectory . $fileName;
193
+ $global = WP_LANG_DIR . "/{$domain}/" . $fileName;
194
+
195
+ if ( file_exists( $global ) ) {
196
+
197
+ // Look in global `../wp-content/languages/{$domain}/` folder.
198
+ load_textdomain( $domain, $global );
199
+
200
+ } elseif ( file_exists( $local ) ) {
201
+
202
+ // Look in local `../wp-content/plugins/{plugin-directory}/languages/` folder.
203
+ load_textdomain( $domain, $local );
204
+
205
+ } else {
206
+
207
+ // Load the default language files
208
+ load_plugin_textdomain( $domain, false, $languagesDirectory );
209
+ }
210
+ }
211
+
212
+ /**
213
+ * Call back for the `wp_enqueue_scripts` action.
214
+ *
215
+ * Register and enqueue CSS and javascript files for frontend.
216
+ *
217
+ * @access private
218
+ * @since 1.0
219
+ * @static
220
+ */
221
+ public static function enqueueScripts() {
222
+
223
+ // If SCRIPT_DEBUG is set and TRUE load the non-minified JS files, otherwise, load the minified files.
224
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
225
+
226
+ $js_vars = array();
227
+
228
+ $isEligible = self::is_eligible( get_post() );
229
+
230
+ if ( ! $isEligible && ! is_active_widget( false, false, 'ezw_tco' ) ) {
231
+ return false;
232
+ }
233
+
234
+ wp_register_style( 'ez-icomoon', EZ_TOC_URL . "vendor/icomoon/style$min.css", array(), ezTOC::VERSION );
235
+ if (!ezTOC_Option::get( 'inline_css' )) {
236
+ wp_register_style( 'ez-toc', EZ_TOC_URL . "assets/css/screen$min.css", array( 'ez-icomoon' ), ezTOC::VERSION );
237
+ }
238
+ wp_register_script( 'js-cookie', EZ_TOC_URL . "vendor/js-cookie/js.cookie$min.js", array(), '2.2.1', TRUE );
239
+ wp_register_script( 'jquery-smooth-scroll', EZ_TOC_URL . "vendor/smooth-scroll/jquery.smooth-scroll$min.js", array( 'jquery' ), '2.2.0', TRUE );
240
+ wp_register_script( 'jquery-sticky-kit', EZ_TOC_URL . "vendor/sticky-kit/jquery.sticky-kit$min.js", array( 'jquery' ), '1.9.2', TRUE );
241
+
242
+ if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
243
+ wp_register_script(
244
+ 'ez-toc-js',
245
+ EZ_TOC_URL . "assets/js/front{$min}.js",
246
+ array( 'jquery-smooth-scroll', 'js-cookie', 'jquery-sticky-kit' ),
247
+ ezTOC::VERSION . '-' . filemtime( EZ_TOC_PATH . "/assets/js/front{$min}.js" ),
248
+ true
249
+ );
250
+ }
251
+
252
+ if ( ! ezTOC_Option::get( 'exclude_css' ) ) {
253
+
254
+ wp_enqueue_style( 'ez-toc' );
255
+ self::inlineCSS();
256
+ }
257
+
258
+ if ( ezTOC_Option::get( 'sticky-toggle' ) ) {
259
+ wp_register_style(
260
+ 'ez-toc-sticky',
261
+ EZ_TOC_URL . "assets/css/ez-toc-sticky{$min}.css",
262
+ array( 'ez-icomoon' ),
263
+ self::VERSION
264
+ );
265
+ wp_enqueue_style( 'ez-toc-sticky' );
266
+ self::inlineStickyToggleCSS();
267
+ wp_register_script( 'ez-toc-sticky', '', array(), '', true );
268
+ wp_enqueue_script( 'ez-toc-sticky', '', '','', true );
269
+ self::inlineStickyToggleJS();
270
+ }
271
+
272
+ if ( ezTOC_Option::get( 'smooth_scroll' ) ) {
273
+
274
+ $js_vars['smooth_scroll'] = true;
275
+ }
276
+
277
+ //wp_enqueue_script( 'ez-toc-js' );
278
+
279
+ if ( ezTOC_Option::get( 'show_heading_text' ) && ezTOC_Option::get( 'visibility' ) ) {
280
+
281
+ $width = ezTOC_Option::get( 'width' ) !== 'custom' ? ezTOC_Option::get( 'width' ) : ezTOC_Option::get( 'width_custom' ) . ezTOC_Option::get( 'width_custom_units' );
282
+
283
+ $js_vars['visibility_hide_by_default'] = ezTOC_Option::get( 'visibility_hide_by_default' ) ? true : false;
284
+
285
+ $js_vars['width'] = esc_js( $width );
286
+ }else{
287
+ if(ezTOC_Option::get( 'visibility' )){
288
+ $js_vars['visibility_hide_by_default'] = ezTOC_Option::get( 'visibility_hide_by_default' ) ? true : false;
289
+ }
290
+ }
291
+
292
+ $offset = wp_is_mobile() ? ezTOC_Option::get( 'mobile_smooth_scroll_offset', 0 ) : ezTOC_Option::get( 'smooth_scroll_offset', 30 );
293
+
294
+ $js_vars['scroll_offset'] = esc_js( $offset );
295
+
296
+ if ( ezTOC_Option::get( 'widget_affix_selector' ) ) {
297
+
298
+ $js_vars['affixSelector'] = ezTOC_Option::get( 'widget_affix_selector' );
299
+ }
300
+
301
+ if ( 0 < count( $js_vars ) ) {
302
+
303
+ wp_localize_script( 'ez-toc-js', 'ezTOC', $js_vars );
304
+ }
305
+ }
306
+
307
+ /**
308
+ * Prints out inline CSS after the core CSS file to allow overriding core styles via options.
309
+ *
310
+ * @access private
311
+ * @since 1.0
312
+ * @static
313
+ */
314
+ public static function inlineCSS() {
315
+
316
+ $css = '';
317
+
318
+ if ( ! ezTOC_Option::get( 'exclude_css' ) ) {
319
+
320
+ $css .= 'div#ez-toc-container p.ez-toc-title {font-size: ' . ezTOC_Option::get( 'title_font_size', 120 ) . ezTOC_Option::get( 'title_font_size_units', '%' ) . ';}';
321
+ $css .= 'div#ez-toc-container p.ez-toc-title {font-weight: ' . ezTOC_Option::get( 'title_font_weight', 500 ) . ';}';
322
+ $css .= 'div#ez-toc-container ul li {font-size: ' . ezTOC_Option::get( 'font_size' ) . ezTOC_Option::get( 'font_size_units' ) . ';}';
323
+ $css .= 'div#ez-toc-container nav ul ul li ul li {font-size: ' . ezTOC_Option::get( 'child_font_size' ) . ezTOC_Option::get( 'font_size_units' ) . '!important;}';
324
+
325
+ if ( ezTOC_Option::get( 'theme' ) === 'custom' || ezTOC_Option::get( 'width' ) != 'auto' ) {
326
+
327
+ $css .= 'div#ez-toc-container {';
328
+
329
+ if ( ezTOC_Option::get( 'theme' ) === 'custom' ) {
330
+
331
+ $css .= 'background: ' . ezTOC_Option::get( 'custom_background_colour' ) . ';border: 1px solid ' . ezTOC_Option::get( 'custom_border_colour' ) . ';';
332
+ }
333
+
334
+ if ( 'auto' !== ezTOC_Option::get( 'width' ) ) {
335
+
336
+ $css .= 'width: ';
337
+
338
+ if ( 'custom' !== ezTOC_Option::get( 'width' ) ) {
339
+
340
+ $css .= ezTOC_Option::get( 'width' );
341
+
342
+ } else {
343
+
344
+ $css .= ezTOC_Option::get( 'width_custom' ) . ezTOC_Option::get( 'width_custom_units' );
345
+ }
346
+
347
+ $css .= ';';
348
+ }
349
+
350
+ $css .= '}';
351
+ }
352
+
353
+ if ( 'custom' === ezTOC_Option::get( 'theme' ) ) {
354
+
355
+ $css .= 'div#ez-toc-container p.ez-toc-title {color: ' . ezTOC_Option::get( 'custom_title_colour' ) . ';}';
356
+ //$css .= 'div#ez-toc-container p.ez-toc-title a,div#ez-toc-container ul.ez-toc-list a {color: ' . ezTOC_Option::get( 'custom_link_colour' ) . ';}';
357
+ $css .= 'div#ez-toc-container ul.ez-toc-list a {color: ' . ezTOC_Option::get( 'custom_link_colour' ) . ';}';
358
+ $css .= 'div#ez-toc-container ul.ez-toc-list a:hover {color: ' . ezTOC_Option::get( 'custom_link_hover_colour' ) . ';}';
359
+ $css .= 'div#ez-toc-container ul.ez-toc-list a:visited {color: ' . ezTOC_Option::get( 'custom_link_visited_colour' ) . ';}';
360
+ }
361
+ }
362
+
363
+ if ( $css ) {
364
+
365
+ wp_add_inline_style( 'ez-toc', $css );
366
+ }
367
+ }
368
+
369
+ /**
370
+ * inlineStickyToggleCSS Method
371
+ * Prints out inline Sticky Toggle CSS after the core CSS file to allow overriding core styles via options.
372
+ *
373
+ * @since 2.0.32
374
+ * @static
375
+ */
376
+ private static function inlineStickyToggleCSS() {
377
+ $custom_width = 'max-width: auto;';
378
+ if ( null !== ezTOC_Option::get( 'sticky-toggle-width-custom' ) && ! empty( ezTOC_Option::get(
379
+ 'sticky-toggle-width-custom'
380
+ ) ) ) {
381
+ $custom_width = 'max-width: ' . ezTOC_Option::get( 'sticky-toggle-width-custom' ) . ';' . PHP_EOL;
382
+ $custom_width .= 'min-width: ' . ezTOC_Option::get( 'sticky-toggle-width-custom' ) . ';' . PHP_EOL;
383
+ }
384
+ $custom_height = 'max-height: 100vh;';
385
+ if ( null !== ezTOC_Option::get( 'sticky-toggle-height-custom' ) && ! empty( ezTOC_Option::get(
386
+ 'sticky-toggle-height-custom'
387
+ ) ) ) {
388
+ $custom_height = 'max-height: ' . ezTOC_Option::get( 'sticky-toggle-height-custom' ) . ';' . PHP_EOL;
389
+ $custom_height .= 'min-height: ' . ezTOC_Option::get( 'sticky-toggle-height-custom' ) . ';' . PHP_EOL;
390
+ }
391
+ $inlineStickyToggleCSS = <<<INLINESTICKYTOGGLECSS
392
+ /**
393
+ * Ez Toc Sidebar Sticky CSS
394
+ */
395
+ .ez-toc-sticky-fixed {
396
+ position: fixed;
397
+ top: 0;
398
+ left: 0;
399
+ z-index: 999999;
400
+ width: auto;
401
+ max-width: 100%;
402
+ }
403
+ .ez-toc-sticky-fixed .ez-toc-sidebar {
404
+ position: relative;
405
+ top: auto;
406
+ width: auto !important;
407
+ {$custom_width}
408
+ height: 100%;
409
+ box-shadow: 1px 1px 10px 3px rgb(0 0 0 / 20%);
410
+ box-sizing: border-box;
411
+ padding: 20px 30px;
412
+ background: white;
413
+ margin-left: 0 !important;
414
+ height: auto;
415
+ {$custom_height}
416
+ overflow-y: auto;
417
+ overflow-x: hidden;
418
+ }
419
+ .ez-toc-sticky-fixed .ez-toc-sidebar #ez-toc-sticky-container {
420
+ {$custom_width}
421
+ max-width: auto;
422
+ padding: 0px;
423
+ border: none;
424
+ margin-bottom: 0;
425
+ margin-top: 65px;
426
+ }
427
+ #ez-toc-sticky-container a {
428
+ color: #000;
429
+ }
430
+ .ez-toc-sticky-fixed .ez-toc-sidebar .ez-toc-sticky-title-container {
431
+ border-bottom-color: #EEEEEE;
432
+ background-color: #FAFAFA;
433
+ padding: 15px;
434
+ border-bottom: 1px solid #e5e5e5;
435
+ width: 100%;
436
+ position: absolute;
437
+ height: auto;
438
+ top: 0;
439
+ left: 0;
440
+ z-index: 99999999;
441
+ }
442
+ .ez-toc-sticky-fixed .ez-toc-sidebar .ez-toc-sticky-title-container .ez-toc-sticky-title {
443
+ font-weight: 550;
444
+ font-size: 18px;
445
+ color: #111;
446
+ }
447
+ .ez-toc-sticky-fixed .ez-toc-close-icon {
448
+ -webkit-appearance: none;
449
+ padding: 0;
450
+ cursor: pointer;
451
+ background: 0 0;
452
+ border: 0;
453
+ float: right;
454
+ font-size: 30px;
455
+ font-weight: 600;
456
+ line-height: 1;
457
+ position: relative;
458
+ color: #000;
459
+ top: -2px;
460
+ text-decoration: none;
461
+ }
462
+ .ez-toc-open-icon {
463
+ position: fixed;
464
+ left: 0px;
465
+ top: 8%;
466
+ text-decoration: none;
467
+ font-weight: bold;
468
+ padding: 5px 10px 15px 10px;
469
+ box-shadow: 1px -5px 10px 5px rgb(0 0 0 / 10%);
470
+ background-color: #fff;
471
+ display: inline-grid;
472
+ line-height: 1.4;
473
+ border-radius: 0px 10px 10px 0px;
474
+ z-index: 999999;
475
+ }
476
+ .ez-toc-sticky-fixed.hide {
477
+ -webkit-transition: opacity 0.3s linear, left 0.3s cubic-bezier(0.4, 0, 1, 1);
478
+ -ms-transition: opacity 0.3s linear, left 0.3s cubic-bezier(0.4, 0, 1, 1);
479
+ -o-transition: opacity 0.3s linear, left 0.3s cubic-bezier(0.4, 0, 1, 1);
480
+ transition: opacity 0.3s linear, left 0.3s cubic-bezier(0.4, 0, 1, 1);
481
+ left: -100%;
482
+ }
483
+ .ez-toc-sticky-fixed.show {
484
+ -webkit-transition: left 0.3s linear, left 0.3s easy-out;
485
+ -moz-transition: left 0.3s linear;
486
+ -o-transition: left 0.3s linear;
487
+ transition: left 0.3s linear;
488
+ left: 0;
489
+ // opacity: 1;
490
+ }
491
+ .ez-toc-open-icon span.arrow {
492
+ font-size: 18px;
493
+ }
494
+ .ez-toc-open-icon span.text {
495
+ font-size: 13px;
496
+ writing-mode: vertical-rl;
497
+ text-orientation: mixed;
498
+ }
499
+ @media screen and (max-device-width: 640px) {
500
+
501
+ .ez-toc-sticky-fixed .ez-toc-sidebar {
502
+ min-width: auto;
503
+ }
504
+ .ez-toc-sticky-fixed .ez-toc-sidebar.show {
505
+ padding-top: 35px;
506
+ }
507
+ .ez-toc-sticky-fixed .ez-toc-sidebar #ez-toc-sticky-container {
508
+ min-width: 100%;
509
+ }
510
+ }
511
+ INLINESTICKYTOGGLECSS;
512
+ wp_add_inline_style( 'ez-toc-sticky', $inlineStickyToggleCSS );
513
+ }
514
+
515
+ /**
516
+ * inlineStickyToggleJS Method
517
+ * Prints out inline Sticky Toggle JS after the core CSS file to allow overriding core styles via options.
518
+ *
519
+ * @since 2.0.32
520
+ * @static
521
+ */
522
+ private static function inlineStickyToggleJS() {
523
+ $inlineStickyToggleJS = <<<'INLINESTICKYTOGGLEJS'
524
+ /**
525
+ * Sticky Sidebar JS
526
+ */
527
+ function hideBar(e) {
528
+ e.preventDefault();
529
+ var sidebar = document.querySelector(".ez-toc-sticky-fixed");
530
+ sidebar.classList.remove("show");
531
+ sidebar.classList.add("hide");
532
+ setTimeout(function() {
533
+ document.querySelector(".ez-toc-open-icon").style = "z-index: 9999999";
534
+ }, 200);
535
+ }
536
+ function showBar(e) {
537
+ e.preventDefault();
538
+ document.querySelector(".ez-toc-open-icon").style = "z-index: -1;";
539
+ setTimeout(function() {
540
+ var sidebar = document.querySelector(".ez-toc-sticky-fixed");
541
+ sidebar.classList.remove("hide");
542
+ sidebar.classList.add("show");
543
+ }, 200);
544
+ }
545
+ (function() {
546
+ document.body.addEventListener("click", function (evt) {
547
+ hideBar(event);
548
+ });
549
+ document.querySelector('div.ez-toc-sticky-fixed').addEventListener('click', function(event) {
550
+ event.stopPropagation();
551
+ });
552
+ document.querySelector('.ez-toc-open-icon').addEventListener('click', function(event) {
553
+ event.stopPropagation();
554
+ });
555
+ })();
556
+ INLINESTICKYTOGGLEJS;
557
+ wp_add_inline_script( 'ez-toc-sticky', $inlineStickyToggleJS );
558
+ }
559
+
560
+ /**
561
+ * Array search deep.
562
+ *
563
+ * Search an array recursively for a value.
564
+ *
565
+ * @link https://stackoverflow.com/a/5427665/5351316
566
+ *
567
+ * @param $search
568
+ * @param array $array
569
+ * @param string $mode
570
+ *
571
+ * @return bool
572
+ */
573
+ public static function array_search_deep( $search, array $array, $mode = 'value' ) {
574
+
575
+ foreach ( new RecursiveIteratorIterator( new RecursiveArrayIterator( $array ) ) as $key => $value ) {
576
+
577
+ if ( $search === ${${"mode"}} ) {
578
+ return true;
579
+ }
580
+ }
581
+
582
+ return false;
583
+ }
584
+
585
+ /**
586
+ * Returns true if the table of contents is eligible to be printed, false otherwise.
587
+ *
588
+ * NOTE: Must bve use only within the loop.
589
+ *
590
+ * @access public
591
+ * @since 1.0
592
+ * @static
593
+ *
594
+ * @param WP_Post $post
595
+ *
596
+ * @return bool
597
+ */
598
+ public static function is_eligible( $post ) {
599
+
600
+ //global $wp_current_filter;
601
+
602
+ if ( empty( $post ) || ! $post instanceof WP_Post ) {
603
+
604
+ Debug::log( 'not_instance_of_post', 'Not an instance if `WP_Post`.', $post );
605
+ return false;
606
+ }
607
+
608
+ // This can likely be removed since it is checked in maybeApplyTheContentFilter().
609
+ // Do not execute if root filter is one of those in the array.
610
+ //if ( in_array( $wp_current_filter[0], array( 'get_the_excerpt', 'wp_head' ), true ) ) {
611
+ //
612
+ // return false;
613
+ //}
614
+
615
+ if ( has_shortcode( $post->post_content, apply_filters( 'ez_toc_shortcode', 'toc' ) ) ||
616
+ has_shortcode( $post->post_content, 'ez-toc' ) ) {
617
+
618
+ Debug::log( 'has_ez_toc_shortcode', 'Has instance of shortcode.', true );
619
+ return true;
620
+ }
621
+
622
+ if ( is_front_page() && ! ezTOC_Option::get( 'include_homepage' ) ) {
623
+
624
+ Debug::log( 'is_front_page', 'Is frontpage, TOC is not enabled.', false );
625
+ return false;
626
+ }
627
+
628
+ $type = get_post_type( $post->ID );
629
+
630
+ Debug::log( 'current_post_type', 'Post type is.', $type );
631
+
632
+ $enabled = in_array( $type, ezTOC_Option::get( 'enabled_post_types', array() ), true );
633
+ $insert = in_array( $type, ezTOC_Option::get( 'auto_insert_post_types', array() ), true );
634
+
635
+ Debug::log( 'is_supported_post_type', 'Is supported post type?', $enabled );
636
+ Debug::log( 'is_auto_insert_post_type', 'Is auto insert for post types?', $insert );
637
+
638
+ if ( $insert || $enabled ) {
639
+
640
+ if ( ezTOC_Option::get( 'restrict_path' ) ) {
641
+
642
+ /**
643
+ * @link https://wordpress.org/support/topic/restrict-path-logic-does-not-work-correctly?
644
+ */
645
+ if ( false !== strpos( ezTOC_Option::get( 'restrict_path' ), $_SERVER['REQUEST_URI'] ) ) {
646
+
647
+ Debug::log( 'is_restricted_path', 'In restricted path, post not eligible.', ezTOC_Option::get( 'restrict_path' ) );
648
+ return false;
649
+
650
+ } else {
651
+
652
+ Debug::log( 'is_not_restricted_path', 'Not in restricted path, post is eligible.', ezTOC_Option::get( 'restrict_path' ) );
653
+ return true;
654
+ }
655
+
656
+ } else {
657
+
658
+ if ( $insert && 1 === (int) get_post_meta( $post->ID, '_ez-toc-disabled', true ) ) {
659
+
660
+ Debug::log( 'is_auto_insert_disable_post_meta', 'Auto insert enabled and disable TOC is enabled in post meta.', false );
661
+ return false;
662
+
663
+ } elseif ( $insert && 0 === (int) get_post_meta( $post->ID, '_ez-toc-disabled', true ) ) {
664
+
665
+ Debug::log( 'is_auto_insert_enabled_post_meta', 'Auto insert enabled and disable TOC is not enabled in post meta.', true );
666
+ return true;
667
+
668
+ } elseif ( $enabled && 1 === (int) get_post_meta( $post->ID, '_ez-toc-insert', true ) ) {
669
+
670
+ Debug::log( 'is_supported_post_type_disable_insert_post_meta', 'Supported post type and insert TOC is enabled in post meta.', true );
671
+ return true;
672
+
673
+ } elseif ( $enabled && $insert ) {
674
+
675
+ Debug::log( 'supported_post_type_and_auto_insert', 'Supported post type and auto insert TOC is enabled.', true );
676
+ return true;
677
+ }
678
+
679
+ Debug::log( 'not_auto_insert_or_not_supported_post_type', 'Not supported post type or insert TOC is disabled.', false );
680
+ return false;
681
+ }
682
+
683
+ } else {
684
+
685
+ Debug::log( 'not_auto_insert_and_not_supported post_type', 'Not supported post type and do not auto insert TOC.', false );
686
+ return false;
687
+ }
688
+ }
689
+
690
+ /**
691
+ * Get TOC from store and if not in store process post and add it to the store.
692
+ *
693
+ * @since 2.0
694
+ *
695
+ * @param int $id
696
+ *
697
+ * @return ezTOC_Post|null
698
+ */
699
+ public static function get( $id ) {
700
+
701
+ $post = null;
702
+
703
+ if ( isset( self::$store[ $id ] ) && self::$store[ $id ] instanceof ezTOC_Post ) {
704
+
705
+ $post = self::$store[ $id ];
706
+
707
+ } else {
708
+
709
+ $post = ezTOC_Post::get( get_the_ID() );
710
+
711
+ if ( $post instanceof ezTOC_Post ) {
712
+
713
+ self::$store[ $id ] = $post;
714
+ }
715
+ }
716
+
717
+ return $post;
718
+ }
719
+
720
+ /**
721
+ * Callback for the registered shortcode `[ez-toc]`
722
+ *
723
+ * NOTE: Shortcode is run before the callback @see ezTOC::the_content() for the `the_content` filter
724
+ *
725
+ * @access private
726
+ * @since 1.3
727
+ *
728
+ * @param array|string $atts Shortcode attributes array or empty string.
729
+ * @param string $content The enclosed content (if the shortcode is used in its enclosing form)
730
+ * @param string $tag Shortcode name.
731
+ *
732
+ * @return string
733
+ */
734
+ public static function shortcode( $atts, $content, $tag ) {
735
+
736
+ static $run = true;
737
+ $html = '';
738
+
739
+ if ( $run ) {
740
+
741
+ $post = self::get( get_the_ID() );
742
+
743
+ if ( ! $post instanceof ezTOC_Post ) {
744
+
745
+ Debug::log( 'not_instance_of_post', 'Not an instance if `WP_Post`.', get_the_ID() );
746
+
747
+ return Debug::log()->appendTo( $content );
748
+ }
749
+
750
+ $html = $post->getTOC();
751
+ $run = false;
752
+ }
753
+ if (isset($atts["initial_view"]) && !empty($atts["initial_view"]) && $atts["initial_view"] == 'hide') {
754
+ $html = preg_replace('/class="ez-toc-list ez-toc-list-level-1"/', 'class="ez-toc-list ez-toc-list-level-1" style="display:none"', $html);
755
+ }
756
+
757
+ return $html;
758
+ }
759
+
760
+ /**
761
+ * Whether or not apply `the_content` filter.
762
+ *
763
+ * @since 2.0
764
+ *
765
+ * @return bool
766
+ */
767
+ private static function maybeApplyTheContentFilter() {
768
+
769
+ $apply = true;
770
+
771
+ global $wp_current_filter;
772
+
773
+ // Do not execute if root current filter is one of those in the array.
774
+ if ( in_array( $wp_current_filter[0], array( 'get_the_excerpt', 'init', 'wp_head' ), true ) ) {
775
+
776
+ $apply = false;
777
+ }
778
+
779
+ // bail if feed, search or archive
780
+ if ( is_feed() || is_search() || is_archive() ) {
781
+
782
+ $apply = false;
783
+ }
784
+
785
+ if ( ! empty( array_intersect( $wp_current_filter, array( 'get_the_excerpt', 'init', 'wp_head' ) ) ) ) {
786
+ $apply = false;
787
+ }
788
+ /**
789
+ * Whether or not to apply `the_content` filter callback.
790
+ *
791
+ * @see ezTOC::the_content()
792
+ *
793
+ * @since 2.0
794
+ *
795
+ * @param bool $apply
796
+ */
797
+ return apply_filters( 'ez_toc_maybe_apply_the_content_filter', $apply );
798
+ }
799
+
800
+ /**
801
+ * Callback for the `the_content` filter.
802
+ *
803
+ * This will add the inline table of contents page anchors to the post content. It will also insert the
804
+ * table of contents inline with the post content as defined by the user defined preference.
805
+ *
806
+ * @since 1.0
807
+ *
808
+ * @param string $content
809
+ *
810
+ * @return string
811
+ */
812
+ public static function the_content( $content ) {
813
+ $maybeApplyFilter = self::maybeApplyTheContentFilter();
814
+
815
+ Debug::log( 'the_content_filter', 'The `the_content` filter applied.', $maybeApplyFilter );
816
+
817
+ if ( ! $maybeApplyFilter ) {
818
+
819
+ return Debug::log()->appendTo( $content );
820
+ }
821
+
822
+ // Bail if post not eligible and widget is not active.
823
+ $isEligible = self::is_eligible( get_post() );
824
+ $isEligible = apply_filters('eztoc_do_shortcode',$isEligible);
825
+ Debug::log( 'post_eligible', 'Post eligible.', $isEligible );
826
+
827
+ if ( ! $isEligible && ! is_active_widget( false, false, 'ezw_tco' ) ) {
828
+
829
+ return Debug::log()->appendTo( $content );
830
+ }
831
+
832
+ $post = self::get( get_the_ID() );
833
+
834
+ if ( ! $post instanceof ezTOC_Post ) {
835
+
836
+ Debug::log( 'not_instance_of_post', 'Not an instance if `WP_Post`.', get_the_ID() );
837
+
838
+ return Debug::log()->appendTo( $content );
839
+ }
840
+
841
+ // Bail if no headings found.
842
+ if ( ! $post->hasTOCItems() ) {
843
+
844
+ return Debug::log()->appendTo( $content );
845
+ }
846
+
847
+ $find = $post->getHeadings();
848
+ $replace = $post->getHeadingsWithAnchors();
849
+ $toc = $post->getTOC();
850
+ $headings = implode( PHP_EOL, $find );
851
+ $anchors = implode( PHP_EOL, $replace );
852
+
853
+ $headingRows = count( $find ) + 1;
854
+ $anchorRows = count( $replace ) + 1;
855
+
856
+ $style = "background-image: linear-gradient(#F1F1F1 50%, #F9F9F9 50%); background-size: 100% 4em; border: 1px solid #CCC; font-family: monospace; font-size: 1em; line-height: 2em; margin: 0 auto; overflow: auto; padding: 0 8px 4px; white-space: nowrap; width: 100%;";
857
+
858
+ Debug::log(
859
+ 'found_post_headings',
860
+ 'Found headings:',
861
+ "<textarea rows='{$headingRows}' style='{$style}' wrap='soft'>{$headings}</textarea>"
862
+ );
863
+
864
+ Debug::log(
865
+ 'replace_post_headings',
866
+ 'Replace found headings with:',
867
+ "<textarea rows='{$anchorRows}' style='{$style}' wrap='soft'>{$anchors}</textarea>"
868
+ );
869
+
870
+ // If shortcode used or post not eligible, return content with anchored headings.
871
+ if ( strpos( $content, 'ez-toc-container' ) || ! $isEligible ) {
872
+
873
+ Debug::log( 'shortcode_found', 'Shortcode found, add links to content.', true );
874
+
875
+ return mb_find_replace( $find, $replace, $content );
876
+ }
877
+
878
+ $position = ezTOC_Option::get( 'position' );
879
+
880
+ Debug::log( 'toc_insert_position', 'Insert TOC at position', $position );
881
+
882
+ // else also add toc to content
883
+ switch ( $position ) {
884
+
885
+ case 'top':
886
+ $content = $toc . mb_find_replace( $find, $replace, $content );
887
+ break;
888
+
889
+ case 'bottom':
890
+ $content = mb_find_replace( $find, $replace, $content ) . $toc;
891
+ break;
892
+
893
+ case 'after':
894
+ $replace[0] = $replace[0] . $toc;
895
+ $content = mb_find_replace( $find, $replace, $content );
896
+ break;
897
+ case 'afterpara':
898
+ $get_para = preg_match_all('%(<p[^>]*>.*?</p>)%i', $content, $matches);
899
+ $first_para = $matches[1][0];
900
+ $content = $first_para . $toc . $content;
901
+ break;
902
+ case 'before':
903
+ default:
904
+ //$replace[0] = $html . $replace[0];
905
+ $content = mb_find_replace( $find, $replace, $content );
906
+
907
+ /**
908
+ * @link https://wordpress.org/support/topic/php-notice-undefined-offset-8/
909
+ */
910
+ if ( ! array_key_exists( 0, $replace ) ) {
911
+ break;
912
+ }
913
+
914
+ $pattern = '`<h[1-6]{1}[^>]*' . preg_quote( $replace[0], '`' ) . '`msuU';
915
+ $result = preg_match( $pattern, $content, $matches );
916
+
917
+ /*
918
+ * Try to place TOC before the first heading found in eligible heading, failing that,
919
+ * insert TOC at top of content.
920
+ */
921
+ if ( 1 === $result ) {
922
+
923
+ Debug::log( 'toc_insert_position_found', 'Insert TOC before first eligible heading.', $result );
924
+
925
+ $start = strpos( $content, $matches[0] );
926
+ $content = substr_replace( $content, $toc, $start, 0 );
927
+
928
+ } else {
929
+
930
+ Debug::log( 'toc_insert_position_not_found', 'Insert TOC before first eligible heading not found.', $result );
931
+
932
+ // Somehow, there are scenarios where the processing get this far and
933
+ // the TOC is being added to pages where it should not. Disable for now.
934
+ //$content = $html . $content;
935
+ }
936
+ }
937
+
938
+ // @since 2.0.32
939
+ if ( ezTOC_Option::get( 'sticky-toggle' ) ) {
940
+ add_action( 'wp_footer', [ __CLASS__, 'stickyToggleContent' ] );
941
+ }
942
+
943
+ return Debug::log()->appendTo( $content );
944
+ }
945
+
946
+ /**
947
+ * stickyToggleContent Method
948
+ * Call back for the `wp_footer` action.
949
+ *
950
+ * @since 2.0.32
951
+ * @static
952
+ */
953
+ public static function stickyToggleContent(): void {
954
+ $post = self::get( get_the_ID() );
955
+ if ( null !== $post ) {
956
+ $stickyToggleTOC = $post->getStickyToggleTOC();
957
+ $openButtonText = "Index";
958
+ if( !empty( ezTOC_Option::get( 'sticky-toggle-open-button-text' ) ) ) {
959
+ $openButtonText = ezTOC_Option::get( 'sticky-toggle-open-button-text' );
960
+ }
961
+ echo <<<STICKYTOGGLEHTML
962
+ <div class="ez-toc-sticky">
963
+ <div class="ez-toc-sticky-fixed hide">
964
+ <div class='ez-toc-sidebar'>{$stickyToggleTOC}</div>
965
+ </div>
966
+ <a class='ez-toc-open-icon' href='javascript:void(0)' onclick='showBar(event)'>
967
+ <span class="arrow">&#8594;</span>
968
+ <span class="text">{$openButtonText}</span>
969
+ </a>
970
+ </div>
971
+ STICKYTOGGLEHTML;
972
+ }
973
+ }
974
+
975
+ /**
976
+ * Call back for the `wp_head` action.
977
+ *
978
+ * Add add button for shortcode in wysisyg editor .
979
+ *
980
+ * @access private
981
+ * @since 1.0
982
+ * @static
983
+ */
984
+ public static function addEditorButton() {
985
+
986
+ if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {
987
+ return;
988
+ }
989
+
990
+
991
+ if ( 'true' == get_user_option( 'rich_editing' ) ) {
992
+ add_filter( 'mce_external_plugins', array( __CLASS__, 'toc_add_tinymce_plugin'));
993
+ add_filter( 'mce_buttons', array( __CLASS__, 'toc_register_mce_button' ));
994
+ }
995
+
996
+ }
997
+
998
+ /**
999
+ * Call back for the `mce_external_plugins` action.
1000
+ *
1001
+ * Register new button in the editor.
1002
+ *
1003
+ * @access private
1004
+ * @since 1.0
1005
+ * @static
1006
+ */
1007
+
1008
+ public static function toc_register_mce_button( $buttons ) {
1009
+
1010
+ array_push( $buttons, 'toc_mce_button' );
1011
+ return $buttons;
1012
+ }
1013
+
1014
+ /**
1015
+ * Call back for the `mce_buttons` action.
1016
+ *
1017
+ * Add js to insert the shortcode on the click event.
1018
+ *
1019
+ * @access private
1020
+ * @since 1.0
1021
+ * @static
1022
+ */
1023
+ public static function toc_add_tinymce_plugin( $plugin_array ) {
1024
+
1025
+ $plugin_array['toc_mce_button'] = EZ_TOC_URL .'assets/js/toc-mce-button.js';
1026
+ return $plugin_array;
1027
+ }
1028
+
1029
+ }
1030
+
1031
+ /**
1032
+ * The main function responsible for returning the Easy Table of Contents instance to functions everywhere.
1033
+ *
1034
+ * Use this function like you would a global variable, except without needing to declare the global.
1035
+ *
1036
+ * Example: <?php $instance = ezTOC(); ?>
1037
+ *
1038
+ * @access public
1039
+ * @since 1.0
1040
+ *
1041
+ * @return ezTOC
1042
+ */
1043
+ function ezTOC() {
1044
+
1045
+ return ezTOC::instance();
1046
+ }
1047
+
1048
+ // Start Easy Table of Contents.
1049
+ add_action( 'plugins_loaded', 'ezTOC' );
1050
+ }
1051
+ register_activation_hook(__FILE__, 'ez_toc_activate');
1052
+ add_action('admin_init', 'ez_toc_redirect');
1053
+
1054
+ function ez_toc_activate() {
1055
+ add_option('ez_toc_do_activation_redirect', true);
1056
+ }
1057
+
1058
+ function ez_toc_redirect() {
1059
+ if (get_option('ez_toc_do_activation_redirect', false)) {
1060
+ delete_option('ez_toc_do_activation_redirect');
1061
+ if(!isset($_GET['activate-multi']))
1062
+ {
1063
+ wp_redirect("options-general.php?page=table-of-contents#welcome");
1064
+ }
1065
+ }
1066
  }
includes/Debug.php CHANGED
@@ -1,180 +1,180 @@
1
- <?php
2
-
3
- namespace Easy_Plugins\Table_Of_Contents;
4
-
5
- use WP_Error;
6
-
7
- /**
8
- * Class Debug
9
- *
10
- * @package Easy_Plugins\Table_Of_Contents
11
- */
12
- final class Debug extends WP_Error {
13
-
14
- /**
15
- * @since 2.0.13
16
- * @var bool
17
- */
18
- protected $display = false;
19
-
20
- /**
21
- * @since 2.0.13
22
- * @var bool
23
- */
24
- protected $enabled = false;
25
-
26
- /**
27
- * @var self
28
- */
29
- private static $instance;
30
-
31
- /**
32
- * Debug constructor.
33
- *
34
- * @since 2.0.13
35
- *
36
- * @param string $code
37
- * @param string $message
38
- * @param string $data
39
- */
40
- public function __construct( $code = '', $message = '', $data = '' ) {
41
-
42
- parent::__construct( $code, $message, $data );
43
- }
44
-
45
- /**
46
- * @since 2.0.14
47
- *
48
- * @param string $code
49
- * @param string $message
50
- * @param string $data
51
- *
52
- * @return Debug
53
- */
54
- public static function log( $code = '', $message = '', $data = '' ) {
55
-
56
- if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
57
-
58
- self::$instance = new self( $code, $message, $data );
59
-
60
- self::$instance->display = apply_filters(
61
- 'Easy_Plugins/Table_Of_Contents/Debug/Display',
62
- defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY
63
- );
64
-
65
- self::$instance->enabled = apply_filters(
66
- 'Easy_Plugins/Table_Of_Contents/Debug/Enabled',
67
- ( defined( 'WP_DEBUG' ) && WP_DEBUG ) && current_user_can( 'manage_options' )
68
- );
69
-
70
- } else {
71
-
72
- if ( ! empty( $code ) && ! empty( $message ) ) {
73
-
74
- self::$instance->add( $code, $message, $data );
75
- }
76
- }
77
-
78
- return self::$instance;
79
- }
80
-
81
- /**
82
- * Adds an error or appends an additional message to an existing error.
83
- *
84
- * NOTE: Overrides WP_Error::add() to allow support of passing `false` as `$data`.
85
- *
86
- * @since 2.0.14
87
- *
88
- * @param string|int $code Error code.
89
- * @param string $message Error message.
90
- * @param mixed $data Optional. Error data.
91
- */
92
- public function add( $code, $message, $data = null ) {
93
- $this->errors[ $code ][] = $message;
94
-
95
- if ( ! is_null( $data ) ) {
96
- $this->add_data( $data, $code );
97
- }
98
-
99
- /**
100
- * Fires when an error is added to a WP_Error object.
101
- *
102
- * @since 5.6.0
103
- *
104
- * @param string|int $code Error code.
105
- * @param string $message Error message.
106
- * @param mixed $data Error data. Might be empty.
107
- * @param WP_Error $wp_error The WP_Error object.
108
- */
109
- do_action( 'wp_error_added', $code, $message, $data, $this );
110
- }
111
-
112
- /**
113
- * @since 2.0.13
114
- *
115
- * @param string $content
116
- *
117
- * @return string
118
- */
119
- public function appendTo( $content = '' ) {
120
-
121
- return $content . $this;
122
- }
123
-
124
- /**
125
- * @since 2.0.13
126
- *
127
- * @return string
128
- */
129
- public function dump() {
130
-
131
- $dump = array();
132
-
133
- foreach ( (array) $this->errors as $code => $messages ) {
134
-
135
- $data = $this->get_error_data( $code );
136
- $data = is_string( $data ) ? $data : '<code>' . var_export( $data, true ) . '</code>';
137
- $data = "\t\t<li class=\"ez-toc-debug-message-data\">{$data}</li>" . PHP_EOL;
138
-
139
- array_push(
140
- $dump,
141
- PHP_EOL . "\t<ul class=\"ez-toc-debug-message-{$code}\">" . PHP_EOL . "\t\t<li class=\"ez-toc-debug-message\">" . implode( '</li>' . PHP_EOL . '<li>' . PHP_EOL, $messages ) . '</li>' . PHP_EOL . "{$data}\t</ul>" . PHP_EOL
142
- );
143
- }
144
-
145
- return '<div class="ez-toc-debug-message">' . implode( '</div>' . PHP_EOL . '<div class="ez-toc-debug-message">', $dump ) . '</div>' . PHP_EOL;
146
- }
147
-
148
- /**
149
- * @since 2.0.13
150
- *
151
- * @return string
152
- */
153
- public function __toString() {
154
-
155
- if ( false === $this->enabled ) {
156
-
157
- return '';
158
- }
159
-
160
- if ( false === $this->display ) {
161
-
162
- return '';
163
- }
164
-
165
- if ( ! $this->has_errors() ) {
166
-
167
- return '';
168
- }
169
-
170
- $intro = sprintf(
171
- 'You see the following because <a href="%1$s"><code>WP_DEBUG</code></a> and <a href="%1$s"><code>WP_DEBUG_DISPLAY</code></a> are enabled on this site. Please disabled these to prevent the display of these developers\' debug messages.',
172
- 'https://codex.wordpress.org/WP_DEBUG'
173
- );
174
-
175
- $intro = PHP_EOL . "<p>{$intro}</p>" .PHP_EOL;
176
- $dump = $this->dump();
177
-
178
- return PHP_EOL . "<div class='ez-toc-debug-messages'>{$intro}{$dump}</div>" . PHP_EOL;
179
- }
180
- }
1
+ <?php
2
+
3
+ namespace Easy_Plugins\Table_Of_Contents;
4
+
5
+ use WP_Error;
6
+
7
+ /**
8
+ * Class Debug
9
+ *
10
+ * @package Easy_Plugins\Table_Of_Contents
11
+ */
12
+ final class Debug extends WP_Error {
13
+
14
+ /**
15
+ * @since 2.0.13
16
+ * @var bool
17
+ */
18
+ protected $display = false;
19
+
20
+ /**
21
+ * @since 2.0.13
22
+ * @var bool
23
+ */
24
+ protected $enabled = false;
25
+
26
+ /**
27
+ * @var self
28
+ */
29
+ private static $instance;
30
+
31
+ /**
32
+ * Debug constructor.
33
+ *
34
+ * @since 2.0.13
35
+ *
36
+ * @param string $code
37
+ * @param string $message
38
+ * @param string $data
39
+ */
40
+ public function __construct( $code = '', $message = '', $data = '' ) {
41
+
42
+ parent::__construct( $code, $message, $data );
43
+ }
44
+
45
+ /**
46
+ * @since 2.0.14
47
+ *
48
+ * @param string $code
49
+ * @param string $message
50
+ * @param string $data
51
+ *
52
+ * @return Debug
53
+ */
54
+ public static function log( $code = '', $message = '', $data = '' ) {
55
+
56
+ if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
57
+
58
+ self::$instance = new self( $code, $message, $data );
59
+
60
+ self::$instance->display = apply_filters(
61
+ 'Easy_Plugins/Table_Of_Contents/Debug/Display',
62
+ defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY
63
+ );
64
+
65
+ self::$instance->enabled = apply_filters(
66
+ 'Easy_Plugins/Table_Of_Contents/Debug/Enabled',
67
+ ( defined( 'WP_DEBUG' ) && WP_DEBUG ) && current_user_can( 'manage_options' )
68
+ );
69
+
70
+ } else {
71
+
72
+ if ( ! empty( $code ) && ! empty( $message ) ) {
73
+
74
+ self::$instance->add( $code, $message, $data );
75
+ }
76
+ }
77
+
78
+ return self::$instance;
79
+ }
80
+
81
+ /**
82
+ * Adds an error or appends an additional message to an existing error.
83
+ *
84
+ * NOTE: Overrides WP_Error::add() to allow support of passing `false` as `$data`.
85
+ *
86
+ * @since 2.0.14
87
+ *
88
+ * @param string|int $code Error code.
89
+ * @param string $message Error message.
90
+ * @param mixed $data Optional. Error data.
91
+ */
92
+ public function add( $code, $message, $data = null ) {
93
+ $this->errors[ $code ][] = $message;
94
+
95
+ if ( ! is_null( $data ) ) {
96
+ $this->add_data( $data, $code );
97
+ }
98
+
99
+ /**
100
+ * Fires when an error is added to a WP_Error object.
101
+ *
102
+ * @since 5.6.0
103
+ *
104
+ * @param string|int $code Error code.
105
+ * @param string $message Error message.
106
+ * @param mixed $data Error data. Might be empty.
107
+ * @param WP_Error $wp_error The WP_Error object.
108
+ */
109
+ do_action( 'wp_error_added', $code, $message, $data, $this );
110
+ }
111
+
112
+ /**
113
+ * @since 2.0.13
114
+ *
115
+ * @param string $content
116
+ *
117
+ * @return string
118
+ */
119
+ public function appendTo( $content = '' ) {
120
+
121
+ return $content . $this;
122
+ }
123
+
124
+ /**
125
+ * @since 2.0.13
126
+ *
127
+ * @return string
128
+ */
129
+ public function dump() {
130
+
131
+ $dump = array();
132
+
133
+ foreach ( (array) $this->errors as $code => $messages ) {
134
+
135
+ $data = $this->get_error_data( $code );
136
+ $data = is_string( $data ) ? $data : '<code>' . var_export( $data, true ) . '</code>';
137
+ $data = "\t\t<li class=\"ez-toc-debug-message-data\">{$data}</li>" . PHP_EOL;
138
+
139
+ array_push(
140
+ $dump,
141
+ PHP_EOL . "\t<ul class=\"ez-toc-debug-message-{$code}\">" . PHP_EOL . "\t\t<li class=\"ez-toc-debug-message\">" . implode( '</li>' . PHP_EOL . '<li>' . PHP_EOL, $messages ) . '</li>' . PHP_EOL . "{$data}\t</ul>" . PHP_EOL
142
+ );
143
+ }
144
+
145
+ return '<div class="ez-toc-debug-message">' . implode( '</div>' . PHP_EOL . '<div class="ez-toc-debug-message">', $dump ) . '</div>' . PHP_EOL;
146
+ }
147
+
148
+ /**
149
+ * @since 2.0.13
150
+ *
151
+ * @return string
152
+ */
153
+ public function __toString() {
154
+
155
+ if ( false === $this->enabled ) {
156
+
157
+ return '';
158
+ }
159
+
160
+ if ( false === $this->display ) {
161
+
162
+ return '';
163
+ }
164
+
165
+ if ( ! $this->has_errors() ) {
166
+
167
+ return '';
168
+ }
169
+
170
+ $intro = sprintf(
171
+ 'You see the following because <a href="%1$s"><code>WP_DEBUG</code></a> and <a href="%1$s"><code>WP_DEBUG_DISPLAY</code></a> are enabled on this site. Please disabled these to prevent the display of these developers\' debug messages.',
172
+ 'https://codex.wordpress.org/WP_DEBUG'
173
+ );
174
+
175
+ $intro = PHP_EOL . "<p>{$intro}</p>" .PHP_EOL;
176
+ $dump = $this->dump();
177
+
178
+ return PHP_EOL . "<div class='ez-toc-debug-messages'>{$intro}{$dump}</div>" . PHP_EOL;
179
+ }
180
+ }
includes/class.admin.php CHANGED
@@ -1,567 +1,670 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) exit;
5
-
6
- if ( ! class_exists( 'ezTOC_Admin' ) ) {
7
-
8
- /**
9
- * Class ezTOC_Admin
10
- */
11
- final class ezTOC_Admin {
12
-
13
- /**
14
- * Setup plugin for admin use.
15
- *
16
- * @access private
17
- * @since 1.0
18
- * @static
19
- */
20
- public function __construct() {
21
-
22
- $this->hooks();
23
- //$this->registerMetaboxes();
24
- }
25
-
26
- /**
27
- * Add the core admin hooks.
28
- *
29
- * @access private
30
- * @since 1.0
31
- * @static
32
- */
33
- private function hooks() {
34
-
35
- add_action( 'admin_init', array( $this, 'registerScripts' ) );
36
- add_action( 'admin_menu', array( $this, 'menu' ) );
37
- add_action( 'init', array( $this, 'registerMetaboxes' ), 99 );
38
- add_filter( 'plugin_action_links_' . EZ_TOC_BASE_NAME, array( $this, 'pluginActionLinks' ), 10, 2 );
39
- add_action( 'admin_enqueue_scripts', array( $this, 'load_scripts' ) );
40
- add_action('wp_ajax_eztoc_send_query_message', array( $this, 'eztoc_send_query_message'));
41
- }
42
-
43
- /**
44
- * Callback to add the Settings link to the plugin action links.
45
- *
46
- * @access private
47
- * @since 1.0
48
- * @static
49
- *
50
- * @param $links
51
- * @param $file
52
- *
53
- * @return array
54
- */
55
- public function pluginActionLinks( $links, $file ) {
56
-
57
- $url = add_query_arg( 'page', 'table-of-contents', self_admin_url( 'options-general.php' ) );
58
- $setting_link = '<a href="' . esc_url( $url ) . '">' . __( 'Settings', 'easy-table-of-contents' ) . '</a> |';
59
- $setting_link .= '<a href="https://tocwp.com/contact/" target="_blank">' . __( ' Support', 'easy-table-of-contents' ) . '</a> |';
60
- $setting_link .= '<a href="https://tocwp.com/pricing/" target="_blank">' . __( ' Upgrade', 'easy-table-of-contents' ) . '</a> |';
61
- $setting_link .= '<a href="https://tocwp.com/" target="_blank">' . __( ' Website', 'easy-table-of-contents' ) . '</a>';
62
- array_push( $links, $setting_link );
63
- return $links;
64
- }
65
-
66
- /**
67
- * Register the scripts used in the admin.
68
- *
69
- * @access private
70
- * @since 1.0
71
- * @static
72
- */
73
- public function registerScripts() {
74
-
75
- wp_register_script( 'cn_toc_admin_script', EZ_TOC_URL . 'assets/js/admin.js', array( 'jquery', 'wp-color-picker' ), ezTOC::VERSION, true );
76
- wp_register_style( 'cn_toc_admin_style', EZ_TOC_URL . 'assets/css/admin.css', array( 'wp-color-picker' ), ezTOC::VERSION );
77
- }
78
-
79
- /**
80
- * Callback to add plugin as a submenu page of the Options page.
81
- *
82
- * This also adds the action to enqueue the scripts to be loaded on plugin's admin pages only.
83
- *
84
- * @access private
85
- * @since 1.0
86
- * @static
87
- */
88
- public function menu() {
89
-
90
- $page = add_submenu_page(
91
- 'options-general.php',
92
- esc_html__( 'Table of Contents', 'easy-table-of-contents' ),
93
- esc_html__( 'Table of Contents', 'easy-table-of-contents' ),
94
- 'manage_options',
95
- 'table-of-contents',
96
- array( $this, 'page' )
97
- );
98
-
99
- add_action( 'admin_print_styles-' . $page, array( $this, 'enqueueScripts' ) );
100
- }
101
-
102
- /**
103
- * Enqueue the scripts.
104
- *
105
- * @access private
106
- * @since 1.0
107
- * @static
108
- */
109
- public function enqueueScripts() {
110
-
111
- wp_enqueue_script( 'cn_toc_admin_script' );
112
- wp_enqueue_style( 'cn_toc_admin_style' );
113
- }
114
-
115
- /**
116
- * Callback to add the action which will register the table of contents post metaboxes.
117
- *
118
- * Metaboxes will only be registered for the post types per user preferences.
119
- *
120
- * @access private
121
- * @since 1.0
122
- * @static
123
- */
124
- public function registerMetaboxes() {
125
-
126
- foreach ( get_post_types() as $type ) {
127
-
128
- if ( in_array( $type, ezTOC_Option::get( 'enabled_post_types', array() ) ) ) {
129
-
130
- add_action( "add_meta_boxes_$type", array( $this, 'metabox' ) );
131
- add_action( "save_post_$type", array( $this, 'save' ), 10, 3 );
132
- }
133
- }
134
- }
135
-
136
- /**
137
- * Callback to register the table of contents metaboxes.
138
- *
139
- * @access private
140
- * @since 1.0
141
- * @static
142
- */
143
- public function metabox() {
144
-
145
- add_meta_box( 'ez-toc', esc_html__( 'Table of Contents', 'ez-toc' ), array( $this, 'displayMetabox' ) );
146
- }
147
-
148
- /**
149
- * Callback to render the content of the table of contents metaboxes.
150
- *
151
- * @access private
152
- * @since 1.0
153
- * @static
154
- *
155
- * @param object $post The post object.
156
- * @param $atts
157
- */
158
- public function displayMetabox( $post, $atts ) {
159
-
160
- // Add an nonce field so we can check for it on save.
161
- wp_nonce_field( 'ez_toc_save', '_ez_toc_nonce' );
162
-
163
- $suppress = get_post_meta( $post->ID, '_ez-toc-disabled', true ) == 1 ? true : false;
164
- $insert = get_post_meta( $post->ID, '_ez-toc-insert', true ) == 1 ? true : false;
165
- $headings = get_post_meta( $post->ID, '_ez-toc-heading-levels', true );
166
- $exclude = get_post_meta( $post->ID, '_ez-toc-exclude', true );
167
- $altText = get_post_meta( $post->ID, '_ez-toc-alttext', true );
168
-
169
- if ( ! is_array( $headings ) ) {
170
-
171
- $headings = array();
172
- }
173
- ?>
174
-
175
- <table class="form-table">
176
-
177
- <tbody>
178
-
179
- <tr>
180
- <th scope="row"></th>
181
- <td>
182
-
183
- <?php if ( in_array( get_post_type( $post ), ezTOC_Option::get( 'auto_insert_post_types', array() ) ) ) :
184
-
185
- ezTOC_Option::checkbox(
186
- array(
187
- 'id' => 'disabled-toc',
188
- 'desc' => esc_html__( 'Disable the automatic insertion of the table of contents.', 'easy-table-of-contents' ),
189
- 'default' => $suppress,
190
- ),
191
- $suppress
192
- );
193
-
194
- elseif( in_array( get_post_type( $post ), ezTOC_Option::get( 'enabled_post_types', array() ) ) ):
195
-
196
- ezTOC_Option::checkbox(
197
- array(
198
- 'id' => 'insert-toc',
199
- 'desc' => esc_html__( 'Insert table of contents.', 'easy-table-of-contents' ),
200
- 'default' => $insert,
201
- ),
202
- $insert
203
- );
204
-
205
- endif; ?>
206
-
207
- </td>
208
- </tr>
209
-
210
- <tr>
211
- <th scope="row"><?php esc_html_e( 'Advanced:', 'easy-table-of-contents' ); ?></th>
212
- <td>
213
- <?php
214
- ezTOC_Option::descriptive_text(
215
- array(
216
- 'id' => 'exclude-desc',
217
- 'name' => '',
218
- 'desc' => '<p><strong>' . esc_html__( 'NOTE:', 'easy-table-of-contents' ) . '</strong></p>' .
219
- '<ul>' .
220
- '<li>' . esc_html__( 'Using the advanced options below will override the global advanced settings.', 'easy-table-of-contents' ) . '</li>' .
221
- '</ul>',
222
- )
223
- );
224
- ?>
225
- </td>
226
- </tr>
227
-
228
- <tr>
229
- <th scope="row"><?php esc_html_e( 'Headings:', 'easy-table-of-contents' ); ?></th>
230
- <td>
231
- <?php
232
- ezTOC_Option::checkboxgroup(
233
- array(
234
- 'id' => 'heading-levels',
235
- 'desc' => esc_html__( 'Select the heading to consider when generating the table of contents. Deselecting a heading will exclude it.', 'easy-table-of-contents' ),
236
- 'options' => array(
237
- '1' => __( 'Heading 1 (h1)', 'easy-table-of-contents' ),
238
- '2' => __( 'Heading 2 (h2)', 'easy-table-of-contents' ),
239
- '3' => __( 'Heading 3 (h3)', 'easy-table-of-contents' ),
240
- '4' => __( 'Heading 4 (h4)', 'easy-table-of-contents' ),
241
- '5' => __( 'Heading 5 (h5)', 'easy-table-of-contents' ),
242
- '6' => __( 'Heading 6 (h6)', 'easy-table-of-contents' ),
243
- ),
244
- 'default' => array(),
245
- ),
246
- array_map( 'absint', $headings )
247
- );
248
- ?>
249
- </td>
250
- </tr>
251
- <tr>
252
- <th scope="row"><?php esc_html_e( 'Alternate Headings', 'easy-table-of-contents' ); ?></th>
253
- <td>
254
- <?php
255
- ezTOC_Option::textarea(
256
- array(
257
- 'id' => 'alttext',
258
- 'desc' => __( 'Specify alternate table of contents header string. Add the header to be replaced and the alternate header on a single line separated with a pipe <code>|</code>. Put each additional original and alternate header on its own line.', 'easy-table-of-contents' ),
259
- 'size' => 'large',
260
- 'default' => '',
261
- ),
262
- $altText
263
- );
264
- ?>
265
- </td>
266
- </tr>
267
- <tr>
268
- <th scope="row"></th>
269
- <td>
270
- <?php
271
- ezTOC_Option::descriptive_text(
272
- array(
273
- 'id' => 'alttext-desc',
274
- 'name' => '',
275
- 'desc' => '<p><strong>' . esc_html__( 'Examples:', 'easy-table-of-contents' ) . '</strong></p>' .
276
- '<ul>' .
277
- '<li>' . __( '<code>Level [1.1]|Alternate TOC Header</code> Replaces Level [1.1] in the table of contents with Alternate TOC Header.', 'easy-table-of-contents' ) . '</li>' .
278
- '</ul>' .
279
- '<p>' . __( '<strong>Note:</strong> This is case sensitive.', 'easy-table-of-contents' ) . '</p>',
280
- )
281
- );
282
- ?>
283
- </td>
284
- </tr>
285
- <tr>
286
- <th scope="row"><?php esc_html_e( 'Exclude Headings', 'easy-table-of-contents' ); ?></th>
287
- <td>
288
- <?php
289
- ezTOC_Option::text(
290
- array(
291
- 'id' => 'exclude',
292
- 'desc' => __( 'Specify headings to be excluded from appearing in the table of contents. Separate multiple headings with a pipe <code>|</code>. Use an asterisk <code>*</code> as a wildcard to match other text.', 'easy-table-of-contents' ),
293
- 'size' => 'large',
294
- 'default' => '',
295
- ),
296
- $exclude
297
- );
298
- ?>
299
- </td>
300
- </tr>
301
- <tr>
302
- <th scope="row"></th>
303
- <td>
304
- <?php
305
- ezTOC_Option::descriptive_text(
306
- array(
307
- 'id' => 'exclude-desc',
308
- 'name' => '',
309
- 'desc' => '<p><strong>' . esc_html__( 'Examples:', 'easy-table-of-contents' ) . '</strong></p>' .
310
- '<ul>' .
311
- '<li>' . __( '<code>Fruit*</code> Ignore headings starting with "Fruit".', 'easy-table-of-contents' ) . '</li>' .
312
- '<li>' . __( '<code>*Fruit Diet*</code> Ignore headings with "Fruit Diet" somewhere in the heading.', 'easy-table-of-contents' ) . '</li>' .
313
- '<li>' . __( '<code>Apple Tree|Oranges|Yellow Bananas</code> Ignore headings that are exactly "Apple Tree", "Oranges" or "Yellow Bananas".', 'easy-table-of-contents' ) . '</li>' .
314
- '</ul>' .
315
- '<p>' . __( '<strong>Note:</strong> This is not case sensitive.', 'easy-table-of-contents' ) . '</p>',
316
- )
317
- );
318
- ?>
319
- </td>
320
- </tr>
321
- </tbody>
322
- </table>
323
-
324
- <?php
325
- }
326
-
327
- /**
328
- * Callback which saves the user preferences from the table of contents metaboxes.
329
- *
330
- * @access private
331
- * @since 1.0
332
- * @static
333
- *
334
- * @param int $post_id The post ID.
335
- * @param object $post The post object.
336
- * @param bool $update Whether this is an existing post being updated or not.
337
- */
338
- public function save( $post_id, $post, $update ) {
339
-
340
- if ( current_user_can( 'edit_post', $post_id ) &&
341
- isset( $_REQUEST['_ez_toc_nonce'] ) &&
342
- wp_verify_nonce( $_REQUEST['_ez_toc_nonce'], 'ez_toc_save' )
343
- ) {
344
-
345
- // Checkboxes are present if checked, absent if not.
346
- if ( isset( $_REQUEST['ez-toc-settings']['disabled-toc'] ) ) {
347
-
348
- update_post_meta( $post_id, '_ez-toc-disabled', true );
349
-
350
- } else {
351
-
352
- update_post_meta( $post_id, '_ez-toc-disabled', false );
353
-
354
- }
355
-
356
- if ( isset( $_REQUEST['ez-toc-settings']['insert-toc'] ) ) {
357
-
358
- update_post_meta( $post_id, '_ez-toc-insert', true );
359
-
360
- } else {
361
-
362
- update_post_meta( $post_id, '_ez-toc-insert', false );
363
- }
364
-
365
- if ( isset( $_REQUEST['ez-toc-settings']['heading-levels'] ) && ! empty( $_REQUEST['ez-toc-settings']['heading-levels'] ) ) {
366
-
367
- if ( is_array( $_REQUEST['ez-toc-settings']['heading-levels'] ) ) {
368
-
369
- $headings = array_map( 'absint', $_REQUEST['ez-toc-settings']['heading-levels'] );
370
-
371
- } else {
372
-
373
- $headings = array();
374
- }
375
-
376
- update_post_meta( $post_id, '_ez-toc-heading-levels', $headings );
377
-
378
- } else {
379
-
380
- update_post_meta( $post_id, '_ez-toc-heading-levels', array() );
381
- }
382
-
383
- if ( isset( $_REQUEST['ez-toc-settings']['alttext'] ) && ! empty( $_REQUEST['ez-toc-settings']['alttext'] ) ) {
384
-
385
- if ( is_string( $_REQUEST['ez-toc-settings']['alttext'] ) ) {
386
-
387
- $alttext = trim( $_REQUEST['ez-toc-settings']['alttext'] );
388
-
389
- } else {
390
-
391
- $alttext = '';
392
- }
393
-
394
- /*
395
- * This is basically `esc_html()` but does not encode quotes.
396
- * This is to allow angle brackets and such which `wp_kses_post` would strip as "evil" scripts.
397
- */
398
- $alttext = wp_check_invalid_utf8( $alttext );
399
- $alttext = _wp_specialchars( $alttext, ENT_NOQUOTES );
400
-
401
- update_post_meta( $post_id, '_ez-toc-alttext', wp_kses_post( $alttext ) );
402
-
403
- } else {
404
-
405
- update_post_meta( $post_id, '_ez-toc-alttext', '' );
406
- }
407
-
408
- if ( isset( $_REQUEST['ez-toc-settings']['exclude'] ) && ! empty( $_REQUEST['ez-toc-settings']['exclude'] ) ) {
409
-
410
- if ( is_string( $_REQUEST['ez-toc-settings']['exclude'] ) ) {
411
-
412
- $exclude = trim( $_REQUEST['ez-toc-settings']['exclude'] );
413
-
414
- } else {
415
-
416
- $exclude = '';
417
- }
418
-
419
- /*
420
- * This is basically `esc_html()` but does not encode quotes.
421
- * This is to allow angle brackets and such which `wp_kses_post` would strip as "evil" scripts.
422
- */
423
- $exclude = wp_check_invalid_utf8( $exclude );
424
- $exclude = _wp_specialchars( $exclude, ENT_NOQUOTES );
425
-
426
- update_post_meta( $post_id, '_ez-toc-exclude', wp_kses_post( $exclude ) );
427
-
428
- } else {
429
-
430
- update_post_meta( $post_id, '_ez-toc-exclude', '' );
431
- }
432
-
433
- }
434
-
435
- }
436
-
437
-
438
- /**
439
- * Enqueue Admin js scripts
440
- *
441
- */
442
- public function load_scripts($pagenow){
443
-
444
- if (isset($pagenow) && $pagenow != 'settings_page_table-of-contents' && strpos($pagenow, 'table-of-contents') == false) {
445
-
446
- return false;
447
- }
448
-
449
- wp_enqueue_script( 'eztoc-admin-js', EZ_TOC_URL . 'assets/js/eztoc-admin.js',array('jquery'), ezTOC::VERSION,true );
450
-
451
- $data = array(
452
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
453
- 'eztoc_security_nonce' => wp_create_nonce('eztoc_ajax_check_nonce'),
454
- );
455
-
456
- $data = apply_filters('eztoc_localize_filter',$data,'eztoc_admin_data');
457
-
458
- wp_localize_script( 'eztoc-admin-js', 'eztoc_admin_data', $data );
459
- }
460
-
461
- /**
462
- * This is a ajax handler function for sending email from user admin panel to us.
463
- * @return type json string
464
- */
465
-
466
- public function eztoc_send_query_message(){
467
-
468
- if ( ! isset( $_POST['eztoc_security_nonce'] ) ){
469
- return;
470
- }
471
- if ( !wp_verify_nonce( $_POST['eztoc_security_nonce'], 'eztoc_ajax_check_nonce' ) ){
472
- return;
473
- }
474
- $message = $this->eztoc_sanitize_textarea_field($_POST['message']);
475
- $email = $this->eztoc_sanitize_textarea_field($_POST['email']);
476
-
477
- if(function_exists('wp_get_current_user')){
478
-
479
- $user = wp_get_current_user();
480
-
481
-
482
- $message = '<p>'.$message.'</p><br><br>'.'Query from Easy Table of Content plugin support tab';
483
-
484
- $user_data = $user->data;
485
- $user_email = $user_data->user_email;
486
-
487
- if($email){
488
- $user_email = $email;
489
- }
490
- //php mailer variables
491
- $sendto = 'team@magazine3.in';
492
- $subject = "Easy Table of Content Query";
493
-
494
- $headers[] = 'Content-Type: text/html; charset=UTF-8';
495
- $headers[] = 'From: '. esc_attr($user_email);
496
- $headers[] = 'Reply-To: ' . esc_attr($user_email);
497
- // Load WP components, no themes.
498
-
499
- $sent = wp_mail($sendto, $subject, $message, $headers);
500
-
501
- if($sent){
502
-
503
- echo json_encode(array('status'=>'t'));
504
-
505
- }else{
506
-
507
- echo json_encode(array('status'=>'f'));
508
-
509
- }
510
-
511
- }
512
-
513
- wp_die();
514
- }
515
-
516
- public function eztoc_sanitize_textarea_field( $str ) {
517
-
518
- if ( is_object( $str ) || is_array( $str ) ) {
519
- return '';
520
- }
521
-
522
- $str = (string) $str;
523
-
524
- $filtered = wp_check_invalid_utf8( $str );
525
-
526
- if ( strpos( $filtered, '<' ) !== false ) {
527
- $filtered = wp_pre_kses_less_than( $filtered );
528
- // This will strip extra whitespace for us.
529
- $filtered = wp_strip_all_tags( $filtered, false );
530
-
531
- // Use HTML entities in a special case to make sure no later
532
- // newline stripping stage could lead to a functional tag.
533
- $filtered = str_replace( "<\n", "&lt;\n", $filtered );
534
- }
535
-
536
- $filtered = trim( $filtered );
537
-
538
- $found = false;
539
- while ( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) {
540
- $filtered = str_replace( $match[0], '', $filtered );
541
- $found = true;
542
- }
543
-
544
- if ( $found ) {
545
- // Strip out the whitespace that may now exist after removing the octets.
546
- $filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );
547
- }
548
-
549
- return $filtered;
550
- }
551
-
552
- /**
553
- * Callback used to render the admin options page.
554
- *
555
- * @access private
556
- * @since 1.0
557
- * @static
558
- */
559
- public function page() {
560
-
561
- include EZ_TOC_PATH . '/includes/inc.admin-options-page.php';
562
- }
563
- }
564
-
565
- new ezTOC_Admin();
566
-
567
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Exit if accessed directly
4
+ if ( ! defined( 'ABSPATH' ) ) exit;
5
+
6
+ if ( ! class_exists( 'ezTOC_Admin' ) ) {
7
+
8
+ /**
9
+ * Class ezTOC_Admin
10
+ */
11
+ final class ezTOC_Admin {
12
+
13
+ /**
14
+ * Setup plugin for admin use.
15
+ *
16
+ * @access private
17
+ * @since 1.0
18
+ * @static
19
+ */
20
+ public function __construct() {
21
+
22
+ $this->hooks();
23
+ //$this->registerMetaboxes();
24
+ }
25
+
26
+ /**
27
+ * Add the core admin hooks.
28
+ *
29
+ * @access private
30
+ * @since 1.0
31
+ * @static
32
+ */
33
+ private function hooks() {
34
+
35
+ add_action( 'admin_init', array( $this, 'registerScripts' ) );
36
+ add_action( 'admin_menu', array( $this, 'menu' ) );
37
+ add_action( 'init', array( $this, 'registerMetaboxes' ), 99 );
38
+ add_filter( 'plugin_action_links_' . EZ_TOC_BASE_NAME, array( $this, 'pluginActionLinks' ), 10, 2 );
39
+ add_action( 'admin_enqueue_scripts', array( $this, 'load_scripts' ) );
40
+ add_action('wp_ajax_eztoc_send_query_message', array( $this, 'eztoc_send_query_message'));
41
+ }
42
+
43
+ /**
44
+ * Callback to add the Settings link to the plugin action links.
45
+ *
46
+ * @access private
47
+ * @since 1.0
48
+ * @static
49
+ *
50
+ * @param $links
51
+ * @param $file
52
+ *
53
+ * @return array
54
+ */
55
+ public function pluginActionLinks( $links, $file ) {
56
+
57
+ $url = add_query_arg( 'page', 'table-of-contents', self_admin_url( 'options-general.php' ) );
58
+ $setting_link = '<a href="' . esc_url( $url ) . '">' . __( 'Settings', 'easy-table-of-contents' ) . '</a> |';
59
+ $setting_link .= '<a href="https://tocwp.com/contact/" target="_blank">' . __( ' Support', 'easy-table-of-contents' ) . '</a> |';
60
+ $setting_link .= '<a href="https://tocwp.com/pricing/" target="_blank">' . __( ' Upgrade', 'easy-table-of-contents' ) . '</a> |';
61
+ $setting_link .= '<a href="https://tocwp.com/" target="_blank">' . __( ' Website', 'easy-table-of-contents' ) . '</a>';
62
+ array_push( $links, $setting_link );
63
+ return $links;
64
+ }
65
+
66
+ /**
67
+ * Register the scripts used in the admin.
68
+ *
69
+ * @access private
70
+ * @since 1.0
71
+ * @static
72
+ */
73
+ public function registerScripts() {
74
+
75
+ wp_register_script( 'cn_toc_admin_script', EZ_TOC_URL . 'assets/js/admin.js', array( 'jquery', 'wp-color-picker' ), ezTOC::VERSION, true );
76
+ wp_register_style( 'cn_toc_admin_style', EZ_TOC_URL . 'assets/css/admin.css', array( 'wp-color-picker' ), ezTOC::VERSION );
77
+
78
+
79
+ // wp_enqueue_style( 'ez-toc' );
80
+ // self::inlineStickyToggleCSS();
81
+ wp_enqueue_script( 'cn_toc_admin_script' );
82
+ self::inlineAdminStickyToggleJS();
83
+
84
+ }
85
+
86
+ /**
87
+ * inlineAdminStickyToggleJS Method
88
+ * Prints out inline Sticky Toggle JS after the core CSS file to allow overriding core styles via options.
89
+ *
90
+ * @access private
91
+ * @return void
92
+ * @since 2.0.32
93
+ * @static
94
+ */
95
+ private static function inlineAdminStickyToggleJS() {
96
+ $stickyToggleOpenButtonTextJS = "";
97
+ if( empty( ezTOC_Option::get( 'sticky-toggle-open-button-text' ) ) ) {
98
+ $stickyToggleOpenButtonTextJS = "$('input[name=\"ez-toc-settings[sticky-toggle-open-button-text]\"').val('Index')";
99
+ }
100
+ $inlineAdminStickyToggleJS = <<<INLINESTICKYTOGGLEJS
101
+ /**
102
+ * Admin Sticky Sidebar JS
103
+ */
104
+ jQuery(function($) {
105
+
106
+ var stickyToggleCheckbox = $('#eztoc-general').find("input[name='ez-toc-settings[sticky-toggle]']");
107
+ var stickyToggleWidth = $('#eztoc-general').find("select[name='ez-toc-settings[sticky-toggle-width]']");
108
+ var stickyToggleWidthCustom = $('#eztoc-general').find("input[name='ez-toc-settings[sticky-toggle-width-custom]']");
109
+ var stickyToggleHeight = $('#eztoc-general').find("select[name='ez-toc-settings[sticky-toggle-height]']");
110
+ var stickyToggleHeightCustom = $('#eztoc-general').find("input[name='ez-toc-settings[sticky-toggle-height-custom]']");
111
+
112
+
113
+ $stickyToggleOpenButtonTextJS
114
+
115
+
116
+ if($(stickyToggleCheckbox).prop('checked') == false) {
117
+ $(stickyToggleWidth).parents('tr').hide(500);
118
+ $(stickyToggleWidthCustom).parents('tr').hide(500);
119
+ $(stickyToggleHeight).parents('tr').hide(500);
120
+ $(stickyToggleHeightCustom).parents('tr').hide(500);
121
+ $(stickyToggleWidth).val('auto');
122
+ $(stickyToggleHeight).val('auto');
123
+ $('input[name="ez-toc-settings[sticky-toggle-open-button-text]"').parents('tr').hide(500);
124
+ $('input[name="ez-toc-settings[sticky-toggle-open-button-text]"').val('Index');
125
+ }
126
+ $(document).on("change, click", "input[name='ez-toc-settings[sticky-toggle]']", function() {
127
+
128
+ if($(stickyToggleCheckbox).prop('checked') == true) {
129
+ $(stickyToggleWidth).parents('tr').show(500);
130
+ $(stickyToggleHeight).parents('tr').show(500);
131
+ $('input[name="ez-toc-settings[sticky-toggle-open-button-text]"').parents('tr').show(500);
132
+ $('input[name="ez-toc-settings[sticky-toggle-open-button-text]"').val('Index');
133
+ } else {
134
+ $(stickyToggleWidth).parents('tr').hide(500);
135
+ $(stickyToggleWidthCustom).parents('tr').hide(500);
136
+ $(stickyToggleHeight).parents('tr').hide(500);
137
+ $(stickyToggleHeightCustom).parents('tr').hide(500);
138
+ $('input[name="ez-toc-settings[sticky-toggle-open-button-text]"').parents('tr').hide(500);
139
+ $(stickyToggleWidth).val('auto');
140
+ $(stickyToggleHeight).val('auto');
141
+ $('input[name="ez-toc-settings[sticky-toggle-open-button-text]"').val('Index');
142
+ }
143
+
144
+ });
145
+
146
+
147
+ if($(stickyToggleWidth).val() == '' || $(stickyToggleWidth).val() != 'custom')
148
+ $(stickyToggleWidthCustom).parents('tr').hide();
149
+
150
+ $(document).on("change", "select[name='ez-toc-settings[sticky-toggle-width]']", function() {
151
+ console.log("change-stickyToggleWidth");
152
+ if($(stickyToggleWidth).val() == 'custom') {
153
+ $(stickyToggleWidthCustom).val('350px');
154
+ $(stickyToggleWidthCustom).parents('tr').show(500);
155
+ } else {
156
+ $(stickyToggleWidthCustom).val('');
157
+ $(stickyToggleWidthCustom).parents('tr').hide(500);
158
+ }
159
+ });
160
+
161
+
162
+ if($(stickyToggleHeight).val() == '' || $(stickyToggleHeight).val() != 'custom')
163
+ $(stickyToggleHeightCustom).parents('tr').hide();
164
+
165
+ $(document).on("change", "select[name='ez-toc-settings[sticky-toggle-height]']", function() {
166
+ console.log("change-stickyToggleHeight");
167
+ if($(stickyToggleHeight).val() == 'custom') {
168
+ $(stickyToggleHeightCustom).val('800px');
169
+ $(stickyToggleHeightCustom).parents('tr').show(500);
170
+ } else {
171
+ $(stickyToggleHeightCustom).val('');
172
+ $(stickyToggleHeightCustom).parents('tr').hide(500);
173
+ }
174
+ });
175
+
176
+
177
+ });
178
+ INLINESTICKYTOGGLEJS;
179
+ wp_add_inline_script( 'cn_toc_admin_script', $inlineAdminStickyToggleJS );
180
+ }
181
+
182
+ /**
183
+ * Callback to add plugin as a submenu page of the Options page.
184
+ *
185
+ * This also adds the action to enqueue the scripts to be loaded on plugin's admin pages only.
186
+ *
187
+ * @access private
188
+ * @since 1.0
189
+ * @static
190
+ */
191
+ public function menu() {
192
+
193
+ $page = add_submenu_page(
194
+ 'options-general.php',
195
+ esc_html__( 'Table of Contents', 'easy-table-of-contents' ),
196
+ esc_html__( 'Table of Contents', 'easy-table-of-contents' ),
197
+ 'manage_options',
198
+ 'table-of-contents',
199
+ array( $this, 'page' )
200
+ );
201
+
202
+ add_action( 'admin_print_styles-' . $page, array( $this, 'enqueueScripts' ) );
203
+ }
204
+
205
+ /**
206
+ * Enqueue the scripts.
207
+ *
208
+ * @access private
209
+ * @since 1.0
210
+ * @static
211
+ */
212
+ public function enqueueScripts() {
213
+
214
+ wp_enqueue_script( 'cn_toc_admin_script' );
215
+ wp_enqueue_style( 'cn_toc_admin_style' );
216
+ }
217
+
218
+ /**
219
+ * Callback to add the action which will register the table of contents post metaboxes.
220
+ *
221
+ * Metaboxes will only be registered for the post types per user preferences.
222
+ *
223
+ * @access private
224
+ * @since 1.0
225
+ * @static
226
+ */
227
+ public function registerMetaboxes() {
228
+
229
+ foreach ( get_post_types() as $type ) {
230
+
231
+ if ( in_array( $type, ezTOC_Option::get( 'enabled_post_types', array() ) ) ) {
232
+
233
+ add_action( "add_meta_boxes_$type", array( $this, 'metabox' ) );
234
+ add_action( "save_post_$type", array( $this, 'save' ), 10, 3 );
235
+ }
236
+ }
237
+ }
238
+
239
+ /**
240
+ * Callback to register the table of contents metaboxes.
241
+ *
242
+ * @access private
243
+ * @since 1.0
244
+ * @static
245
+ */
246
+ public function metabox() {
247
+
248
+ add_meta_box( 'ez-toc', esc_html__( 'Table of Contents', 'ez-toc' ), array( $this, 'displayMetabox' ) );
249
+ }
250
+
251
+ /**
252
+ * Callback to render the content of the table of contents metaboxes.
253
+ *
254
+ * @access private
255
+ * @since 1.0
256
+ * @static
257
+ *
258
+ * @param object $post The post object.
259
+ * @param $atts
260
+ */
261
+ public function displayMetabox( $post, $atts ) {
262
+
263
+ // Add an nonce field so we can check for it on save.
264
+ wp_nonce_field( 'ez_toc_save', '_ez_toc_nonce' );
265
+
266
+ $suppress = get_post_meta( $post->ID, '_ez-toc-disabled', true ) == 1 ? true : false;
267
+ $insert = get_post_meta( $post->ID, '_ez-toc-insert', true ) == 1 ? true : false;
268
+ $headings = get_post_meta( $post->ID, '_ez-toc-heading-levels', true );
269
+ $exclude = get_post_meta( $post->ID, '_ez-toc-exclude', true );
270
+ $altText = get_post_meta( $post->ID, '_ez-toc-alttext', true );
271
+
272
+ if ( ! is_array( $headings ) ) {
273
+
274
+ $headings = array();
275
+ }
276
+ ?>
277
+
278
+ <table class="form-table">
279
+
280
+ <tbody>
281
+
282
+ <tr>
283
+ <th scope="row"></th>
284
+ <td>
285
+
286
+ <?php if ( in_array( get_post_type( $post ), ezTOC_Option::get( 'auto_insert_post_types', array() ) ) ) :
287
+
288
+ ezTOC_Option::checkbox(
289
+ array(
290
+ 'id' => 'disabled-toc',
291
+ 'desc' => esc_html__( 'Disable the automatic insertion of the table of contents.', 'easy-table-of-contents' ),
292
+ 'default' => $suppress,
293
+ ),
294
+ $suppress
295
+ );
296
+
297
+ elseif( in_array( get_post_type( $post ), ezTOC_Option::get( 'enabled_post_types', array() ) ) ):
298
+
299
+ ezTOC_Option::checkbox(
300
+ array(
301
+ 'id' => 'insert-toc',
302
+ 'desc' => esc_html__( 'Insert table of contents.', 'easy-table-of-contents' ),
303
+ 'default' => $insert,
304
+ ),
305
+ $insert
306
+ );
307
+
308
+ endif; ?>
309
+
310
+ </td>
311
+ </tr>
312
+
313
+ <tr>
314
+ <th scope="row"><?php esc_html_e( 'Advanced:', 'easy-table-of-contents' ); ?></th>
315
+ <td>
316
+ <?php
317
+ ezTOC_Option::descriptive_text(
318
+ array(
319
+ 'id' => 'exclude-desc',
320
+ 'name' => '',
321
+ 'desc' => '<p><strong>' . esc_html__( 'NOTE:', 'easy-table-of-contents' ) . '</strong></p>' .
322
+ '<ul>' .
323
+ '<li>' . esc_html__( 'Using the advanced options below will override the global advanced settings.', 'easy-table-of-contents' ) . '</li>' .
324
+ '</ul>',
325
+ )
326
+ );
327
+ ?>
328
+ </td>
329
+ </tr>
330
+
331
+ <tr>
332
+ <th scope="row"><?php esc_html_e( 'Headings:', 'easy-table-of-contents' ); ?></th>
333
+ <td>
334
+ <?php
335
+ ezTOC_Option::checkboxgroup(
336
+ array(
337
+ 'id' => 'heading-levels',
338
+ 'desc' => esc_html__( 'Select the heading to consider when generating the table of contents. Deselecting a heading will exclude it.', 'easy-table-of-contents' ),
339
+ 'options' => array(
340
+ '1' => __( 'Heading 1 (h1)', 'easy-table-of-contents' ),
341
+ '2' => __( 'Heading 2 (h2)', 'easy-table-of-contents' ),
342
+ '3' => __( 'Heading 3 (h3)', 'easy-table-of-contents' ),
343
+ '4' => __( 'Heading 4 (h4)', 'easy-table-of-contents' ),
344
+ '5' => __( 'Heading 5 (h5)', 'easy-table-of-contents' ),
345
+ '6' => __( 'Heading 6 (h6)', 'easy-table-of-contents' ),
346
+ ),
347
+ 'default' => array(),
348
+ ),
349
+ array_map( 'absint', $headings )
350
+ );
351
+ ?>
352
+ </td>
353
+ </tr>
354
+ <tr>
355
+ <th scope="row"><?php esc_html_e( 'Alternate Headings', 'easy-table-of-contents' ); ?></th>
356
+ <td>
357
+ <?php
358
+ ezTOC_Option::textarea(
359
+ array(
360
+ 'id' => 'alttext',
361
+ 'desc' => __( 'Specify alternate table of contents header string. Add the header to be replaced and the alternate header on a single line separated with a pipe <code>|</code>. Put each additional original and alternate header on its own line.', 'easy-table-of-contents' ),
362
+ 'size' => 'large',
363
+ 'default' => '',
364
+ ),
365
+ $altText
366
+ );
367
+ ?>
368
+ </td>
369
+ </tr>
370
+ <tr>
371
+ <th scope="row"></th>
372
+ <td>
373
+ <?php
374
+ ezTOC_Option::descriptive_text(
375
+ array(
376
+ 'id' => 'alttext-desc',
377
+ 'name' => '',
378
+ 'desc' => '<p><strong>' . esc_html__( 'Examples:', 'easy-table-of-contents' ) . '</strong></p>' .
379
+ '<ul>' .
380
+ '<li>' . __( '<code>Level [1.1]|Alternate TOC Header</code> Replaces Level [1.1] in the table of contents with Alternate TOC Header.', 'easy-table-of-contents' ) . '</li>' .
381
+ '</ul>' .
382
+ '<p>' . __( '<strong>Note:</strong> This is case sensitive.', 'easy-table-of-contents' ) . '</p>',
383
+ )
384
+ );
385
+ ?>
386
+ </td>
387
+ </tr>
388
+ <tr>
389
+ <th scope="row"><?php esc_html_e( 'Exclude Headings', 'easy-table-of-contents' ); ?></th>
390
+ <td>
391
+ <?php
392
+ ezTOC_Option::text(
393
+ array(
394
+ 'id' => 'exclude',
395
+ 'desc' => __( 'Specify headings to be excluded from appearing in the table of contents. Separate multiple headings with a pipe <code>|</code>. Use an asterisk <code>*</code> as a wildcard to match other text.', 'easy-table-of-contents' ),
396
+ 'size' => 'large',
397
+ 'default' => '',
398
+ ),
399
+ $exclude
400
+ );
401
+ ?>
402
+ </td>
403
+ </tr>
404
+ <tr>
405
+ <th scope="row"></th>
406
+ <td>
407
+ <?php
408
+ ezTOC_Option::descriptive_text(
409
+ array(
410
+ 'id' => 'exclude-desc',
411
+ 'name' => '',
412
+ 'desc' => '<p><strong>' . esc_html__( 'Examples:', 'easy-table-of-contents' ) . '</strong></p>' .
413
+ '<ul>' .
414
+ '<li>' . __( '<code>Fruit*</code> Ignore headings starting with "Fruit".', 'easy-table-of-contents' ) . '</li>' .
415
+ '<li>' . __( '<code>*Fruit Diet*</code> Ignore headings with "Fruit Diet" somewhere in the heading.', 'easy-table-of-contents' ) . '</li>' .
416
+ '<li>' . __( '<code>Apple Tree|Oranges|Yellow Bananas</code> Ignore headings that are exactly "Apple Tree", "Oranges" or "Yellow Bananas".', 'easy-table-of-contents' ) . '</li>' .
417
+ '</ul>' .
418
+ '<p>' . __( '<strong>Note:</strong> This is not case sensitive.', 'easy-table-of-contents' ) . '</p>',
419
+ )
420
+ );
421
+ ?>
422
+ </td>
423
+ </tr>
424
+ </tbody>
425
+ </table>
426
+
427
+ <?php
428
+ }
429
+
430
+ /**
431
+ * Callback which saves the user preferences from the table of contents metaboxes.
432
+ *
433
+ * @access private
434
+ * @since 1.0
435
+ * @static
436
+ *
437
+ * @param int $post_id The post ID.
438
+ * @param object $post The post object.
439
+ * @param bool $update Whether this is an existing post being updated or not.
440
+ */
441
+ public function save( $post_id, $post, $update ) {
442
+
443
+ if ( current_user_can( 'edit_post', $post_id ) &&
444
+ isset( $_REQUEST['_ez_toc_nonce'] ) &&
445
+ wp_verify_nonce( $_REQUEST['_ez_toc_nonce'], 'ez_toc_save' )
446
+ ) {
447
+
448
+ // Checkboxes are present if checked, absent if not.
449
+ if ( isset( $_REQUEST['ez-toc-settings']['disabled-toc'] ) ) {
450
+
451
+ update_post_meta( $post_id, '_ez-toc-disabled', true );
452
+
453
+ } else {
454
+
455
+ update_post_meta( $post_id, '_ez-toc-disabled', false );
456
+
457
+ }
458
+
459
+ if ( isset( $_REQUEST['ez-toc-settings']['insert-toc'] ) ) {
460
+
461
+ update_post_meta( $post_id, '_ez-toc-insert', true );
462
+
463
+ } else {
464
+
465
+ update_post_meta( $post_id, '_ez-toc-insert', false );
466
+ }
467
+
468
+ if ( isset( $_REQUEST['ez-toc-settings']['heading-levels'] ) && ! empty( $_REQUEST['ez-toc-settings']['heading-levels'] ) ) {
469
+
470
+ if ( is_array( $_REQUEST['ez-toc-settings']['heading-levels'] ) ) {
471
+
472
+ $headings = array_map( 'absint', $_REQUEST['ez-toc-settings']['heading-levels'] );
473
+
474
+ } else {
475
+
476
+ $headings = array();
477
+ }
478
+
479
+ update_post_meta( $post_id, '_ez-toc-heading-levels', $headings );
480
+
481
+ } else {
482
+
483
+ update_post_meta( $post_id, '_ez-toc-heading-levels', array() );
484
+ }
485
+
486
+ if ( isset( $_REQUEST['ez-toc-settings']['alttext'] ) && ! empty( $_REQUEST['ez-toc-settings']['alttext'] ) ) {
487
+
488
+ if ( is_string( $_REQUEST['ez-toc-settings']['alttext'] ) ) {
489
+
490
+ $alttext = trim( $_REQUEST['ez-toc-settings']['alttext'] );
491
+
492
+ } else {
493
+
494
+ $alttext = '';
495
+ }
496
+
497
+ /*
498
+ * This is basically `esc_html()` but does not encode quotes.
499
+ * This is to allow angle brackets and such which `wp_kses_post` would strip as "evil" scripts.
500
+ */
501
+ $alttext = wp_check_invalid_utf8( $alttext );
502
+ $alttext = _wp_specialchars( $alttext, ENT_NOQUOTES );
503
+
504
+ update_post_meta( $post_id, '_ez-toc-alttext', wp_kses_post( $alttext ) );
505
+
506
+ } else {
507
+
508
+ update_post_meta( $post_id, '_ez-toc-alttext', '' );
509
+ }
510
+
511
+ if ( isset( $_REQUEST['ez-toc-settings']['exclude'] ) && ! empty( $_REQUEST['ez-toc-settings']['exclude'] ) ) {
512
+
513
+ if ( is_string( $_REQUEST['ez-toc-settings']['exclude'] ) ) {
514
+
515
+ $exclude = trim( $_REQUEST['ez-toc-settings']['exclude'] );
516
+
517
+ } else {
518
+
519
+ $exclude = '';
520
+ }
521
+
522
+ /*
523
+ * This is basically `esc_html()` but does not encode quotes.
524
+ * This is to allow angle brackets and such which `wp_kses_post` would strip as "evil" scripts.
525
+ */
526
+ $exclude = wp_check_invalid_utf8( $exclude );
527
+ $exclude = _wp_specialchars( $exclude, ENT_NOQUOTES );
528
+
529
+ update_post_meta( $post_id, '_ez-toc-exclude', wp_kses_post( $exclude ) );
530
+
531
+ } else {
532
+
533
+ update_post_meta( $post_id, '_ez-toc-exclude', '' );
534
+ }
535
+
536
+ }
537
+
538
+ }
539
+
540
+
541
+ /**
542
+ * Enqueue Admin js scripts
543
+ *
544
+ */
545
+ public function load_scripts($pagenow){
546
+
547
+ if (isset($pagenow) && $pagenow != 'settings_page_table-of-contents' && strpos($pagenow, 'table-of-contents') == false) {
548
+
549
+ return false;
550
+ }
551
+
552
+ wp_enqueue_script( 'eztoc-admin-js', EZ_TOC_URL . 'assets/js/eztoc-admin.js',array('jquery'), ezTOC::VERSION,true );
553
+
554
+ $data = array(
555
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
556
+ 'eztoc_security_nonce' => wp_create_nonce('eztoc_ajax_check_nonce'),
557
+ );
558
+
559
+ $data = apply_filters('eztoc_localize_filter',$data,'eztoc_admin_data');
560
+
561
+ wp_localize_script( 'eztoc-admin-js', 'eztoc_admin_data', $data );
562
+ }
563
+
564
+ /**
565
+ * This is a ajax handler function for sending email from user admin panel to us.
566
+ * @return type json string
567
+ */
568
+
569
+ public function eztoc_send_query_message(){
570
+
571
+ if ( ! isset( $_POST['eztoc_security_nonce'] ) ){
572
+ return;
573
+ }
574
+ if ( !wp_verify_nonce( $_POST['eztoc_security_nonce'], 'eztoc_ajax_check_nonce' ) ){
575
+ return;
576
+ }
577
+ $message = $this->eztoc_sanitize_textarea_field($_POST['message']);
578
+ $email = $this->eztoc_sanitize_textarea_field($_POST['email']);
579
+
580
+ if(function_exists('wp_get_current_user')){
581
+
582
+ $user = wp_get_current_user();
583
+
584
+
585
+ $message = '<p>'.$message.'</p><br><br>'.'Query from Easy Table of Content plugin support tab';
586
+
587
+ $user_data = $user->data;
588
+ $user_email = $user_data->user_email;
589
+
590
+ if($email){
591
+ $user_email = $email;
592
+ }
593
+ //php mailer variables
594
+ $sendto = 'team@magazine3.in';
595
+ $subject = "Easy Table of Content Query";
596
+
597
+ $headers[] = 'Content-Type: text/html; charset=UTF-8';
598
+ $headers[] = 'From: '. esc_attr($user_email);
599
+ $headers[] = 'Reply-To: ' . esc_attr($user_email);
600
+ // Load WP components, no themes.
601
+
602
+ $sent = wp_mail($sendto, $subject, $message, $headers);
603
+
604
+ if($sent){
605
+
606
+ echo json_encode(array('status'=>'t'));
607
+
608
+ }else{
609
+
610
+ echo json_encode(array('status'=>'f'));
611
+
612
+ }
613
+
614
+ }
615
+
616
+ wp_die();
617
+ }
618
+
619
+ public function eztoc_sanitize_textarea_field( $str ) {
620
+
621
+ if ( is_object( $str ) || is_array( $str ) ) {
622
+ return '';
623
+ }
624
+
625
+ $str = (string) $str;
626
+
627
+ $filtered = wp_check_invalid_utf8( $str );
628
+
629
+ if ( strpos( $filtered, '<' ) !== false ) {
630
+ $filtered = wp_pre_kses_less_than( $filtered );
631
+ // This will strip extra whitespace for us.
632
+ $filtered = wp_strip_all_tags( $filtered, false );
633
+
634
+ // Use HTML entities in a special case to make sure no later
635
+ // newline stripping stage could lead to a functional tag.
636
+ $filtered = str_replace( "<\n", "&lt;\n", $filtered );
637
+ }
638
+
639
+ $filtered = trim( $filtered );
640
+
641
+ $found = false;
642
+ while ( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) {
643
+ $filtered = str_replace( $match[0], '', $filtered );
644
+ $found = true;
645
+ }
646
+
647
+ if ( $found ) {
648
+ // Strip out the whitespace that may now exist after removing the octets.
649
+ $filtered = trim( preg_replace( '/ +/', ' ', $filtered ) );
650
+ }
651
+
652
+ return $filtered;
653
+ }
654
+
655
+ /**
656
+ * Callback used to render the admin options page.
657
+ *
658
+ * @access private
659
+ * @since 1.0
660
+ * @static
661
+ */
662
+ public function page() {
663
+
664
+ include EZ_TOC_PATH . '/includes/inc.admin-options-page.php';
665
+ }
666
+ }
667
+
668
+ new ezTOC_Admin();
669
+
670
+ }
includes/class.options.php CHANGED
@@ -1,1409 +1,1513 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) exit;
5
-
6
- if ( ! class_exists( 'ezTOC_Option' ) ) {
7
-
8
- /**
9
- * Class ezTOC_Option
10
- *
11
- * Credit: Adapted from Easy Digital Downloads.
12
- */
13
- final class ezTOC_Option {
14
-
15
- /**
16
- * Register the plugins core settings and options.
17
- *
18
- * @access private
19
- * @since 1.0
20
- * @static
21
- */
22
- public static function register() {
23
-
24
- if ( false === get_option( 'ez-toc-settings' ) ) {
25
-
26
- add_option( 'ez-toc-settings', self::getDefaults() );
27
- }
28
-
29
- foreach ( self::getRegistered() as $section => $settings ) {
30
-
31
- add_settings_section(
32
- 'ez_toc_settings_' . $section,
33
- __return_null(),
34
- '__return_false',
35
- 'ez_toc_settings_' . $section
36
- );
37
-
38
- foreach ( $settings as $option ) {
39
-
40
- $name = isset( $option['name'] ) ? $option['name'] : '';
41
-
42
- add_settings_field(
43
- 'ez-toc-settings[' . $option['id'] . ']',
44
- $name,
45
- method_exists( __CLASS__, $option['type'] ) ? array( __CLASS__, $option['type'] ) : array( __CLASS__, 'missingCallback' ),
46
- 'ez_toc_settings_' . $section,
47
- 'ez_toc_settings_' . $section,
48
- array(
49
- 'section' => $section,
50
- 'id' => isset( $option['id'] ) ? $option['id'] : null,
51
- 'desc' => ! empty( $option['desc'] ) ? $option['desc'] : '',
52
- 'name' => isset( $option['name'] ) ? $option['name'] : null,
53
- 'size' => isset( $option['size'] ) ? $option['size'] : null,
54
- 'options' => isset( $option['options'] ) ? $option['options'] : '',
55
- 'default' => isset( $option['default'] ) ? $option['default'] : '',
56
- 'min' => isset( $option['min'] ) ? $option['min'] : null,
57
- 'max' => isset( $option['max'] ) ? $option['max'] : null,
58
- 'step' => isset( $option['step'] ) ? $option['step'] : null,
59
- 'chosen' => isset( $option['chosen'] ) ? $option['chosen'] : null,
60
- 'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : null,
61
- 'allow_blank' => isset( $option['allow_blank'] ) ? $option['allow_blank'] : true,
62
- 'readonly' => isset( $option['readonly'] ) ? $option['readonly'] : false,
63
- 'faux' => isset( $option['faux'] ) ? $option['faux'] : false,
64
- )
65
- );
66
- }
67
-
68
- }
69
-
70
- // Creates our settings in the options table
71
- register_setting( 'ez-toc-settings', 'ez-toc-settings', array( __CLASS__, 'sanitize' ) );
72
- }
73
-
74
- /**
75
- * Callback for settings sanitization.
76
- *
77
- * @access private
78
- * @since 1.0
79
- * @static
80
- *
81
- * @param array $input The value inputted in the field.
82
- *
83
- * @return string $input Sanitized value.
84
- */
85
- public static function sanitize( $input = array() ) {
86
-
87
- $options = self::getOptions();
88
-
89
- if ( empty( $_POST['_wp_http_referer'] ) ) {
90
-
91
- return $input;
92
- }
93
-
94
- $registered = self::getRegistered();
95
-
96
- foreach ( $registered as $sectionID => $sectionOptions ) {
97
-
98
- $input = $input ? $input : array();
99
- $input = apply_filters( 'ez_toc_settings_' . $sectionID . '_sanitize', $input );
100
-
101
- // Loop through each setting being saved and pass it through a sanitization filter
102
- foreach ( $input as $key => $value ) {
103
-
104
- // Get the setting type (checkbox, select, etc)
105
- $type = isset( $registered[ $sectionID ][ $key ]['type'] ) ? $registered[ $sectionID ][ $key ]['type'] : false;
106
-
107
- if ( $type ) {
108
-
109
- // Field type specific filter
110
- $input[ $key ] = apply_filters( 'ez_toc_settings_sanitize_' . $type, $value, $key );
111
- }
112
-
113
- // General filter
114
- $input[ $key ] = apply_filters( 'ez_toc_settings_sanitize', $input[ $key ], $key );
115
- }
116
-
117
- // Loop through the registered options.
118
- foreach ( $sectionOptions as $optionID => $optionProperties ) {
119
-
120
- // Unset any that are empty for the section being saved.
121
- if ( empty( $input[ $optionID ] ) ) {
122
-
123
- unset( $options[ $optionID ] );
124
- }
125
-
126
- // Check for the checkbox option type.
127
- if ( array_key_exists( 'type', $optionProperties ) && 'checkbox' == $optionProperties['type'] ) {
128
-
129
- // If it does not exist in the options values being saved, add the option ID and set its value to `0`.
130
- // This matches WP core behavior for saving checkbox option values.
131
- if ( ! array_key_exists( $optionID, $input ) ) {
132
-
133
- $input[ $optionID ] = '0';
134
- }
135
- }
136
- }
137
-
138
- }
139
-
140
- // Merge our new settings with the existing
141
- $output = array_merge( $options, $input );
142
-
143
- return $output;
144
- }
145
-
146
- /**
147
- * The core registered settings and options.
148
- *
149
- * @access private
150
- * @since 1.0
151
- * @static
152
- *
153
- * @return array
154
- */
155
- private static function getRegistered() {
156
-
157
- $options = array(
158
- 'general' => apply_filters(
159
- 'ez_toc_settings_general',
160
- array(
161
- 'enabled_post_types' => array(
162
- 'id' => 'enabled_post_types',
163
- 'name' => __( 'Enable Support', 'easy-table-of-contents' ),
164
- 'desc' => __( 'Select the post types to enable the support for table of contents.', 'easy-table-of-contents' ),
165
- 'type' => 'checkboxgroup',
166
- 'options' => self::getPostTypes(),
167
- 'default' => array(),
168
- ),
169
- 'auto_insert_post_types' => array(
170
- 'id' => 'auto_insert_post_types',
171
- 'name' => __( 'Auto Insert', 'easy-table-of-contents' ),
172
- 'desc' => __( 'Select the post types which will have the table of contents automatically inserted.', 'easy-table-of-contents' ) .
173
- '<br><span class="description">' . __( 'NOTE: The table of contents will only be automatically inserted on post types for which it has been enabled.', 'easy-table-of-contents' ) . '<span>',
174
- 'type' => 'checkboxgroup',
175
- 'options' => self::getPostTypes(),
176
- 'default' => array(),
177
- ),
178
- 'position' => array(
179
- 'id' => 'position',
180
- 'name' => __( 'Position', 'easy-table-of-contents' ),
181
- 'desc' => __( 'Choose where where you want to display the table of contents.', 'easy-table-of-contents' ),
182
- 'type' => 'select',
183
- 'options' => array(
184
- 'before' => __( 'Before first heading (default)', 'easy-table-of-contents' ),
185
- 'after' => __( 'After first heading', 'easy-table-of-contents' ),
186
- 'afterpara' => __( 'After first paragraph', 'easy-table-of-contents' ),
187
- 'top' => __( 'Top', 'easy-table-of-contents' ),
188
- 'bottom' => __( 'Bottom', 'easy-table-of-contents' ),
189
- //'placeholder' => __( 'Replace [toc] placeholder. For backwards compatibility with Table of Content Plus.', 'easy-table-of-contents' ),
190
- ),
191
- 'default' => 1,
192
- ),
193
- 'start' => array(
194
- 'id' => 'start',
195
- 'name' => __( 'Show when', 'easy-table-of-contents' ),
196
- 'desc' => __( 'or more headings are present', 'easy-table-of-contents' ),
197
- 'type' => 'select',
198
- 'options' => array_combine( range( 1, 10 ), range( 1, 10 ) ),
199
- 'default' => 4,
200
- ),
201
- 'show_heading_text' => array(
202
- 'id' => 'show_heading_text',
203
- 'name' => __( 'Display Header Label', 'easy-table-of-contents' ),
204
- 'desc' => __( 'Show header text above the table of contents.', 'easy-table-of-contents' ),
205
- 'type' => 'checkbox',
206
- 'default' => true,
207
- ),
208
- 'heading_text' => array(
209
- 'id' => 'heading_text',
210
- 'name' => __( 'Header Label', 'easy-table-of-contents' ),
211
- 'desc' => __( 'Eg: Contents, Table of Contents, Page Contents', 'easy-table-of-contents' ),
212
- 'type' => 'text',
213
- 'default' => __( 'Contents', 'easy-table-of-contents' ),
214
- ),
215
- 'visibility' => array(
216
- 'id' => 'visibility',
217
- 'name' => __( 'Toggle View', 'easy-table-of-contents' ),
218
- 'desc' => __( 'Allow the user to toggle the visibility of the table of contents.', 'easy-table-of-contents' ),
219
- 'type' => 'checkbox',
220
- 'default' => true,
221
- ),
222
- //'visibility_show' => array(
223
- // 'id' => 'visibility_show',
224
- // 'name' => __( 'Show Label', 'easy-table-of-contents' ),
225
- // 'desc' => __( 'Eg: show', 'easy-table-of-contents' ),
226
- // 'type' => 'text',
227
- // 'default' => __( 'show', 'easy-table-of-contents' ),
228
- //),
229
- //'visibility_hide' => array(
230
- // 'id' => 'visibility_hide',
231
- // 'name' => __( 'Hide Label', 'easy-table-of-contents' ),
232
- // 'desc' => __( 'Eg: hide', 'easy-table-of-contents' ),
233
- // 'type' => 'text',
234
- // 'default' => __( 'hide', 'easy-table-of-contents' ),
235
- //),
236
- 'visibility_hide_by_default' => array(
237
- 'id' => 'visibility_hide_by_default',
238
- 'name' => __( 'Initial View', 'easy-table-of-contents' ),
239
- 'desc' => __( 'Initially hide the table of contents.', 'easy-table-of-contents' ),
240
- 'type' => 'checkbox',
241
- 'default' => false,
242
- ),
243
- 'show_hierarchy' => array(
244
- 'id' => 'show_hierarchy',
245
- 'name' => __( 'Show as Hierarchy', 'easy-table-of-contents' ),
246
- 'desc' => '',
247
- 'type' => 'checkbox',
248
- 'default' => true,
249
- ),
250
- 'counter' => array(
251
- 'id' => 'counter',
252
- 'name' => __( 'Counter', 'easy-table-of-contents' ),
253
- 'desc' => '',
254
- 'type' => 'select',
255
- 'options' => array(
256
- 'decimal' => __( 'Decimal (default)', 'easy-table-of-contents' ),
257
- 'disc' => __( 'Disc', 'easy-table-of-contents' ),
258
- 'hyphen' => __( 'Hyphen', 'easy-table-of-contents' ),
259
- 'numeric' => __( 'Numeric', 'easy-table-of-contents' ),
260
- 'roman' => __( 'Roman', 'easy-table-of-contents' ),
261
- 'none' => __( 'None', 'easy-table-of-contents' ),
262
- ),
263
- 'default' => 'decimal',
264
- ),
265
- 'smooth_scroll' => array(
266
- 'id' => 'smooth_scroll',
267
- 'name' => __( 'Smooth Scroll', 'easy-table-of-contents' ),
268
- 'desc' => '',
269
- 'type' => 'checkbox',
270
- 'default' => true,
271
- ),
272
- 'toc_loading' => array(
273
- 'id' => 'toc_loading',
274
- 'name' => __( 'TOC Loading Method', 'easy-table-of-contents' ),
275
- 'desc' => '',
276
- 'type' => 'select',
277
- 'options' => array(
278
- 'js' => __( 'JavaScript (default)', 'easy-table-of-contents' ),
279
- 'css' => __( 'Pure CSS', 'easy-table-of-contents' ),
280
-
281
- ),
282
- 'default' => 'js',
283
- ),
284
- 'remove_special_chars_from_title' => array(
285
- 'id' => 'remove_special_chars_from_title',
286
- 'name' => __( 'Remove \':\' from TOC Title', 'easy-table-of-contents' ),
287
- 'desc' => '',
288
- 'type' => 'checkbox',
289
- 'default' => false,
290
- ),
291
- )
292
- ),
293
- 'appearance' => apply_filters(
294
- 'ez_toc_settings_appearance',
295
- array(
296
- 'width' => array(
297
- 'id' => 'width',
298
- 'name' => __( 'Width', 'easy-table-of-contents' ),
299
- 'desc' => '',
300
- 'type' => 'selectgroup',
301
- 'options' => array(
302
- 'fixed' => array(
303
- 'name' => __( 'Fixed', 'easy-table-of-contents' ),
304
- 'options' => array(
305
- '200px' => '200px',
306
- '225px' => '225px',
307
- '250px' => '250px',
308
- '275px' => '275px',
309
- '300px' => '300px',
310
- '325px' => '325px',
311
- '350px' => '350px',
312
- '375px' => '375px',
313
- '400px' => '400px',
314
- ),
315
- ),
316
- 'relative' => array(
317
- 'name' => __( 'Relative', 'easy-table-of-contents' ),
318
- 'options' => array(
319
- 'auto' => 'Auto',
320
- '25%' => '25%',
321
- '33%' => '33%',
322
- '50%' => '50%',
323
- '66%' => '66%',
324
- '75%' => '75%',
325
- '100%' => '100%',
326
- ),
327
- ),
328
- 'other' => array(
329
- 'name' => __( 'Custom', 'easy-table-of-contents' ),
330
- 'options' => array(
331
- 'custom' => __( 'User Defined', 'easy-table-of-contents' ),
332
- ),
333
- ),
334
- ),
335
- 'default' => 'auto',
336
- ),
337
- 'width_custom' => array(
338
- 'id' => 'width_custom',
339
- 'name' => __( 'Custom Width', 'easy-table-of-contents' ),
340
- 'desc' => __( 'Select the User Defined option from the Width option to utilitze the custom width.', 'easy-table-of-contents' ),
341
- 'type' => 'custom_width',
342
- 'default' => 275,
343
- ),
344
- 'wrapping' => array(
345
- 'id' => 'wrapping',
346
- 'name' => __( 'Alignment', 'easy-table-of-contents' ),
347
- 'desc' => '',
348
- 'type' => 'select',
349
- 'options' => array(
350
- 'none' => __( 'None (Default)', 'easy-table-of-contents' ),
351
- 'left' => __( 'Left', 'easy-table-of-contents' ),
352
- 'right' => __( 'Right', 'easy-table-of-contents' ),
353
- 'center' => __( 'Center', 'easy-table-of-contents' ),
354
- ),
355
- 'default' => 'none',
356
- ),
357
- 'font_options_header' => array(
358
- 'id' => 'font_options',
359
- 'name' => '<strong>' . __( 'Font Option', 'easy-table-of-contents' ) . '</strong>',
360
- //'desc' => __( 'For the following settings to apply, select the Custom Font option.', 'easy-table-of-contents' ),
361
- 'type' => 'header',
362
- ),
363
- 'title_font_size' => array(
364
- 'id' => 'title_font_size',
365
- 'name' => __( 'Title Font Size', 'easy-table-of-contents' ),
366
- 'desc' => '',
367
- 'type' => 'font_size',
368
- 'default' => 120,
369
- ),
370
- 'title_font_weight' => array(
371
- 'id' => 'title_font_weight',
372
- 'name' => __( 'Title Font Weight', 'easy-table-of-contents' ),
373
- 'desc' => '',
374
- 'type' => 'select',
375
- 'options' => array(
376
- '100' => __( 'Thin', 'easy-table-of-contents' ),
377
- '200' => __( 'Extra Light', 'easy-table-of-contents' ),
378
- '300' => __( 'Light', 'easy-table-of-contents' ),
379
- '400' => __( 'Normal', 'easy-table-of-contents' ),
380
- '500' => __( 'Medium', 'easy-table-of-contents' ),
381
- '600' => __( 'Semi Bold', 'easy-table-of-contents' ),
382
- '700' => __( 'Bold', 'easy-table-of-contents' ),
383
- '800' => __( 'Extra Bold', 'easy-table-of-contents' ),
384
- '900' => __( 'Heavy', 'easy-table-of-contents' ),
385
- ),
386
- 'default' => '500',
387
- ),
388
- 'font_size' => array(
389
- 'id' => 'font_size',
390
- 'name' => __( 'Font Size', 'easy-table-of-contents' ),
391
- 'desc' => '',
392
- 'type' => 'font_size',
393
- 'default' => 95,
394
- ),
395
- 'child_font_size' => array(
396
- 'id' => 'child_font_size',
397
- 'name' => __( 'Child Font Size', 'easy-table-of-contents' ),
398
- 'desc' => '',
399
- 'type' => 'child_font_size',
400
- 'default' => 90,
401
- ),
402
- 'theme_option_header' => array(
403
- 'id' => 'theme_option_header',
404
- 'name' => '<strong>' . __( 'Theme Options', 'easy-table-of-contents' ) . '</strong>',
405
- //'desc' => __( 'For the following settings to apply, select the Custom Theme option.', 'easy-table-of-contents' ),
406
- 'type' => 'header',
407
- ),
408
- 'theme' => array(
409
- 'id' => 'theme',
410
- 'name' => __( 'Theme', 'easy-table-of-contents' ),
411
- 'desc' => __( 'The theme is only applied to the table of contents which is auto inserted into the post. The Table of Contents widget will inherit the theme widget styles.', 'easy-table-of-contents' ),
412
- 'type' => 'radio',
413
- 'options' => array(
414
- 'grey' => __( 'Grey', 'easy-table-of-contents' ),
415
- 'light-blue' => __( 'Light Blue', 'easy-table-of-contents' ),
416
- 'white' => __( 'White', 'easy-table-of-contents' ),
417
- 'black' => __( 'Black', 'easy-table-of-contents' ),
418
- 'transparent' => __( 'Transparent', 'easy-table-of-contents' ),
419
- 'custom' => __( 'Custom', 'easy-table-of-contents' ),
420
- ),
421
- 'default' => 'grey',
422
- ),
423
- 'custom_theme_header' => array(
424
- 'id' => 'custom_theme_header',
425
- 'name' => '<strong>' . __( 'Custom Theme', 'easy-table-of-contents' ) . '</strong>',
426
- 'desc' => __( 'For the following settings to apply, select the Custom Theme option.', 'easy-table-of-contents' ),
427
- 'type' => 'header',
428
- ),
429
- 'custom_background_colour' => array(
430
- 'id' => 'custom_background_colour',
431
- 'name' => __( 'Background Color', 'easy-table-of-contents' ),
432
- 'desc' => '',
433
- 'type' => 'color',
434
- 'default' => '#fff',
435
- ),
436
- 'custom_border_colour' => array(
437
- 'id' => 'custom_border_colour',
438
- 'name' => __( 'Border Color', 'easy-table-of-contents' ),
439
- 'desc' => '',
440
- 'type' => 'color',
441
- 'default' => '#ddd',
442
- ),
443
- 'custom_title_colour' => array(
444
- 'id' => 'custom_title_colour',
445
- 'name' => __( 'Title Color', 'easy-table-of-contents' ),
446
- 'desc' => '',
447
- 'type' => 'color',
448
- 'default' => '#999',
449
- ),
450
- 'custom_link_colour' => array(
451
- 'id' => 'custom_link_colour',
452
- 'name' => __( 'Link Color', 'easy-table-of-contents' ),
453
- 'desc' => '',
454
- 'type' => 'color',
455
- 'default' => '#428bca',
456
- ),
457
- 'custom_link_hover_colour' => array(
458
- 'id' => 'custom_link_hover_colour',
459
- 'name' => __( 'Link Hover Color', 'easy-table-of-contents' ),
460
- 'desc' => '',
461
- 'type' => 'color',
462
- 'default' => '#2a6496',
463
- ),
464
- 'custom_link_visited_colour' => array(
465
- 'id' => 'custom_link_visited_colour',
466
- 'name' => __( 'Link Visited Color', 'easy-table-of-contents' ),
467
- 'desc' => '',
468
- 'type' => 'color',
469
- 'default' => '#428bca',
470
- ),
471
- )
472
- ),
473
- 'advanced' => apply_filters(
474
- 'ez_toc_settings_advanced',
475
- array(
476
- 'lowercase' => array(
477
- 'id' => 'lowercase',
478
- 'name' => __( 'Lowercase', 'easy-table-of-contents' ),
479
- 'desc' => __( 'Ensure anchors are in lowercase.', 'easy-table-of-contents' ),
480
- 'type' => 'checkbox',
481
- 'default' => false,
482
- ),
483
- 'hyphenate' => array(
484
- 'id' => 'hyphenate',
485
- 'name' => __( 'Hyphenate', 'easy-table-of-contents' ),
486
- 'desc' => __( 'Use - rather than _ in anchors.', 'easy-table-of-contents' ),
487
- 'type' => 'checkbox',
488
- 'default' => false,
489
- ),
490
- 'include_homepage' => array(
491
- 'id' => 'include_homepage',
492
- 'name' => __( 'Homepage', 'easy-table-of-contents' ),
493
- 'desc' => __( 'Show the table of contents for qualifying items on the homepage.', 'easy-table-of-contents' ),
494
- 'type' => 'checkbox',
495
- 'default' => false,
496
- ),
497
- 'exclude_css' => array(
498
- 'id' => 'exclude_css',
499
- 'name' => __( 'CSS', 'easy-table-of-contents' ),
500
- 'desc' => __( "Prevent the loading the core CSS styles. When selected, the appearance options from above will be ignored.", 'easy-table-of-contents' ),
501
- 'type' => 'checkbox',
502
- 'default' => false,
503
- ),
504
- 'inline_css' => array(
505
- 'id' => 'inline_css',
506
- 'name' => __( 'Inline CSS', 'easy-table-of-contents' ),
507
- 'desc' => __( "Improve your website performance by inlining your CSS.", 'easy-table-of-contents' ),
508
- 'type' => 'checkbox',
509
- 'default' => false,
510
- ),
511
- //'bullet_spacing' => array(
512
- // 'id' => 'bullet_spacing',
513
- // 'name' => __( 'Theme Bullets', 'easy-table-of-contents' ),
514
- // 'desc' => __( 'If your theme includes background images for unordered list elements, enable this option to support them.', 'easy-table-of-contents' ),
515
- // 'type' => 'checkbox',
516
- // 'default' => false,
517
- //),
518
- 'heading_levels' => array(
519
- 'id' => 'heading_levels',
520
- 'name' => __( 'Headings:', 'easy-table-of-contents' ),
521
- 'desc' => __( 'Select the heading to consider when generating the table of contents. Deselecting a heading will exclude it.', 'easy-table-of-contents' ),
522
- 'type' => 'checkboxgroup',
523
- 'options' => array(
524
- '1' => __( 'Heading 1 (h1)', 'easy-table-of-contents' ),
525
- '2' => __( 'Heading 2 (h2)', 'easy-table-of-contents' ),
526
- '3' => __( 'Heading 3 (h3)', 'easy-table-of-contents' ),
527
- '4' => __( 'Heading 4 (h4)', 'easy-table-of-contents' ),
528
- '5' => __( 'Heading 5 (h5)', 'easy-table-of-contents' ),
529
- '6' => __( 'Heading 6 (h6)', 'easy-table-of-contents' ),
530
- ),
531
- 'default' => array( '1', '2', '3', '4', '5', '6' ),
532
- ),
533
- 'exclude' => array(
534
- 'id' => 'exclude',
535
- 'name' => __( 'Exclude Headings', 'easy-table-of-contents' ),
536
- 'desc' => __( 'Specify headings to be excluded from appearing in the table of contents. Separate multiple headings with a pipe <code>|</code>. Use an asterisk <code>*</code> as a wildcard to match other text.', 'easy-table-of-contents' ),
537
- 'type' => 'text',
538
- 'size' => 'large',
539
- 'default' => '',
540
- ),
541
- 'exclude_desc' => array(
542
- 'id' => 'exclude_desc',
543
- 'name' => '',
544
- 'desc' => '<p><strong>' . __( 'Examples:', 'easy-table-of-contents' ) . '</strong></p>' .
545
- '<ul>' .
546
- '<li>' . __( '<code>Fruit*</code> Ignore headings starting with "Fruit".', 'easy-table-of-contents' ) . '</li>' .
547
- '<li>' . __( '<code>*Fruit Diet*</code> Ignore headings with "Fruit Diet" somewhere in the heading.', 'easy-table-of-contents' ) . '</li>' .
548
- '<li>' . __( '<code>Apple Tree|Oranges|Yellow Bananas</code> Ignore headings that are exactly "Apple Tree", "Oranges" or "Yellow Bananas".', 'easy-table-of-contents' ) . '</li>' .
549
- '</ul>' .
550
- '<p>' . __( '<strong>Note:</strong> This is not case sensitive.', 'easy-table-of-contents' ) . '</p>',
551
- 'type' => 'descriptive_text',
552
- ),
553
- 'smooth_scroll_offset' => array(
554
- 'id' => 'smooth_scroll_offset',
555
- 'name' => __( 'Smooth Scroll Offset', 'easy-table-of-contents' ),
556
- 'desc' => 'px<br/>' . __( 'If you have a consistent menu across the top of your site, you can adjust the top offset to stop the headings from appearing underneath the top menu. A setting of 30 accommodates the WordPress admin bar. This setting only has an effect after you have enabled Smooth Scroll option.', 'easy-table-of-contents' ),
557
- 'type' => 'number',
558
- 'size' => 'small',
559
- 'default' => 30
560
- ),
561
- 'mobile_smooth_scroll_offset' => array(
562
- 'id' => 'mobile_smooth_scroll_offset',
563
- 'name' => __( 'Mobile Smooth Scroll Offset', 'easy-table-of-contents' ),
564
- 'desc' => 'px<br/>' . __( 'This provides the same function as the Smooth Scroll Offset option above but applied when the user is visiting your site on a mobile device.', 'easy-table-of-contents' ),
565
- 'type' => 'number',
566
- 'size' => 'small',
567
- 'default' => 0
568
- ),
569
- 'restrict_path' => array(
570
- 'id' => 'restrict_path',
571
- 'name' => __( 'Limit Path', 'easy-table-of-contents' ),
572
- 'desc' => '<br/>' . __( '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.', 'easy-table-of-contents' ) .
573
- '<br/><span class="description">' . __( 'Eg: /wiki/, /corporate/annual-reports/', 'easy-table-of-contents' ) . '</span>',
574
- 'type' => 'text',
575
- ),
576
- 'fragment_prefix' => array(
577
- 'id' => 'fragment_prefix',
578
- 'name' => __( 'Default Anchor Prefix', 'easy-table-of-contents' ),
579
- 'desc' => '<br/>' . __( '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.', 'easy-table-of-contents' ) .
580
- '<br/>' . __( 'This option normally applies to content written in character sets other than ASCII.', 'easy-table-of-contents' ) .
581
- '<br/><span class="description">' . __( 'Eg: i, toc_index, index, _', 'easy-table-of-contents' ) . '</span>',
582
- 'type' => 'text',
583
- 'default' => 'i',
584
- ),
585
- 'widget_affix_selector' => array(
586
- 'id' => 'widget_affix_selector',
587
- 'name' => __( 'Widget Affix Selector', 'easy-table-of-contents' ),
588
- 'desc' => '<br/>' . __( 'To enable the option to affix or pin the Table of Contents widget enter the theme\'s sidebar class or id.', 'easy-table-of-contents' ) .
589
- '<br/>' . __( 'Since every theme is different, this can not be determined automatically. If you are unsure how to find the sidebar\'s class or id, please ask the theme\'s support persons.', 'easy-table-of-contents' ) .
590
- '<br/><span class="description">' . __( 'Eg: .widget-area or #sidebar', 'easy-table-of-contents' ) . '</span>',
591
- 'type' => 'text',
592
- 'default' => '',
593
- ),
594
-
595
- )
596
- ),
597
- 'prosettings' => apply_filters(
598
- 'ez_toc_settings_prosettings',
599
- array(
600
- 'exclude_by_class' => array(
601
- 'id' => 'exclude_by_class',
602
- 'name' => __( 'Exclude Headings by Class', 'easy-table-of-contents' ),
603
- 'desc' => '<br/>' . __( 'You can hide the TOC heading by its class and if you want to hide multiple headings then please saparate them with a comma (,)', 'easy-table-of-contents' ),
604
- 'type' => 'text',
605
- 'default' => '',
606
- ),
607
- 'fixedtoc' => array(
608
- 'id' => 'fixedtoc',
609
- 'name' => __( 'Fixed TOC', 'easy-table-of-contents' ),
610
- 'desc' => __( 'Fixed TOC in the page display so it can be easier to navigate', 'easy-table-of-contents' ),
611
- 'type' => 'checkbox',
612
- 'default' => false,
613
- ),
614
- 'highlightheadings' => array(
615
- 'id' => 'highlightheadings',
616
- 'name' => __( 'Highlight TOC Headings ', 'easy-table-of-contents' ),
617
- 'desc' => __( 'Highlight TOC headings while scrolling ', 'easy-table-of-contents' ),
618
- 'type' => 'checkbox',
619
- 'default' => false,
620
- ),
621
- 'shrinkthewidth' => array(
622
- 'id' => 'shrinkthewidth',
623
- 'name' => __( 'Shrink the width', 'easy-table-of-contents' ),
624
- 'desc' => __( 'Shrink the width to the size of the title' ),
625
- 'type' => 'checkbox',
626
- 'default' => false,
627
- ),
628
- )
629
- ),
630
- );
631
-
632
- return apply_filters( 'ez_toc_registered_settings', $options );
633
- }
634
-
635
- /**
636
- * The default values for the registered settings and options.
637
- *
638
- * @access private
639
- * @since 1.0
640
- * @static
641
- *
642
- * @return array
643
- */
644
- private static function getDefaults() {
645
-
646
- $defaults = array(
647
- 'fragment_prefix' => 'i',
648
- 'position' => 'before',
649
- 'start' => 4,
650
- 'show_heading_text' => true,
651
- 'heading_text' => 'Table of Contents',
652
- 'enabled_post_types' => array( 'page' ),
653
- 'auto_insert_post_types' => array(),
654
- 'show_hierarchy' => true,
655
- 'counter' => 'decimal',
656
- 'smooth_scroll' => true,
657
- 'smooth_scroll_offset' => 30,
658
- 'mobile_smooth_scroll_offset' => 0,
659
- 'visibility' => true,
660
- 'toc_loading' => 'js',
661
- 'remove_special_chars_from_title' => false,
662
- //'visibility_show' => 'show',
663
- //'visibility_hide' => 'hide',
664
- 'visibility_hide_by_default' => false,
665
- 'width' => 'auto',
666
- 'width_custom' => 275,
667
- 'width_custom_units' => 'px',
668
- 'wrapping' => 'none',
669
- 'title_font_size' => 120,
670
- 'title_font_size_units' => '%',
671
- 'title_font_weight' => 500,
672
- 'font_size' => 95,
673
- 'child_font_size' => 90,
674
- 'font_size_units' => '%',
675
- 'theme' => 'grey',
676
- 'custom_background_colour' => '#fff',
677
- 'custom_border_colour' => '#ddd',
678
- 'custom_title_colour' => '#999',
679
- 'custom_link_colour' => '#428bca',
680
- 'custom_link_hover_colour' => '#2a6496',
681
- 'custom_link_visited_colour' => '#428bca',
682
- 'lowercase' => false,
683
- 'hyphenate' => false,
684
- //'bullet_spacing' => false,
685
- 'include_homepage' => false,
686
- 'exclude_css' => false,
687
- 'inline_css' => false,
688
- 'exclude' => '',
689
- 'heading_levels' => array( '1', '2', '3', '4', '5', '6' ),
690
- 'restrict_path' => '',
691
- 'css_container_class' => '',
692
- //'show_toc_in_widget_only' => false,
693
- //'show_toc_in_widget_only_post_types' => array(),
694
- 'widget_affix_selector' => '',
695
- );
696
-
697
- return apply_filters( 'ez_toc_get_default_options', $defaults );
698
- }
699
-
700
- /**
701
- * Get the default options array.
702
- *
703
- * @access private
704
- * @since 1.0
705
- * @static
706
- *
707
- * @return array
708
- */
709
- private static function getOptions() {
710
-
711
- $defaults = self::getDefaults();
712
- $options = get_option( 'ez-toc-settings', $defaults );
713
-
714
- //return apply_filters( 'ez_toc_get_options', wp_parse_args( $options, $defaults ) );
715
- return apply_filters( 'ez_toc_get_options', $options );
716
- }
717
-
718
- /**
719
- * Get option value by key name.
720
- *
721
- * @access public
722
- * @since 1.0
723
- * @static
724
- *
725
- * @param string $key
726
- * @param bool|false $default
727
- *
728
- * @return mixed
729
- */
730
- public static function get( $key, $default = false ) {
731
-
732
- $options = self::getOptions();
733
-
734
- $value = array_key_exists( $key, $options ) ? $options[ $key ] : $default;
735
- $value = apply_filters( 'ez_toc_get_option', $value, $key, $default );
736
-
737
- return apply_filters( 'ez_toc_get_option_' . $key, $value, $key, $default );
738
- }
739
-
740
- /**
741
- * Set an option value by key name.
742
- *
743
- * @access public
744
- * @since 1.0
745
- * @static
746
- *
747
- * @param string $key
748
- * @param bool|false $value
749
- *
750
- * @return bool
751
- */
752
- public static function set( $key, $value = false ) {
753
-
754
- if ( empty( $value ) ) {
755
-
756
- $remove_option = self::delete( $key );
757
-
758
- return $remove_option;
759
- }
760
-
761
- $options = self::getOptions();
762
-
763
- $options[ $key ] = apply_filters( 'ez_toc_update_option', $value, $key );
764
-
765
- return update_option( 'ez-toc-settings', $options );
766
- }
767
-
768
- /**
769
- * Delete an option from the options table by option key name.
770
- *
771
- * @access public
772
- * @since 1.0
773
- * @static
774
- *
775
- * @param string $key
776
- *
777
- * @return bool
778
- */
779
- public static function delete( $key ) {
780
-
781
- // First let's grab the current settings
782
- $options = get_option( 'ez-toc-settings' );
783
-
784
- // Next let's try to update the value
785
- if ( array_key_exists( $key, $options ) ) {
786
-
787
- unset( $options[ $key ] );
788
- }
789
-
790
- return update_option( 'ez-toc-settings', $options );
791
- }
792
-
793
- /**
794
- * Sanitize a hex color from user input.
795
- *
796
- * Tries to convert $string into a valid hex colour.
797
- * Returns $default if $string is not a hex value, otherwise returns verified hex.
798
- *
799
- * @access private
800
- * @since 1.0
801
- * @static
802
- *
803
- * @param string $string
804
- * @param string $default
805
- *
806
- * @return mixed|string
807
- */
808
- private static function hex_value( $string = '', $default = '#' ) {
809
-
810
- $return = $default;
811
-
812
- if ( $string ) {
813
- // strip out non hex chars
814
- $return = preg_replace( '/[^a-fA-F0-9]*/', '', $string );
815
-
816
- switch ( strlen( $return ) ) {
817
- case 3: // do next
818
- case 6:
819
- $return = '#' . $return;
820
- break;
821
-
822
- default:
823
- if ( strlen( $return ) > 6 ) {
824
- $return = '#' . substr( $return, 0, 6 );
825
- } // if > 6 chars, then take the first 6
826
- elseif ( strlen( $return ) > 3 && strlen( $return ) < 6 ) {
827
- $return = '#' . substr( $return, 0, 3 );
828
- } // if between 3 and 6, then take first 3
829
- else {
830
- $return = $default;
831
- } // not valid, return $default
832
- }
833
- }
834
-
835
- return $return;
836
- }
837
-
838
- /**
839
- * Get the registered post types minus excluded core types.
840
- *
841
- * @access public
842
- * @since 1.0
843
- * @static
844
- *
845
- * @return array
846
- */
847
- public static function getPostTypes() {
848
-
849
- $exclude = apply_filters( 'ez_toc_exclude_post_types', array( 'attachment', 'revision', 'nav_menu_item', 'safecss' ) );
850
- $registered = get_post_types( array(), 'objects' );
851
- $types = array();
852
-
853
- foreach ( $registered as $post ) {
854
-
855
- if ( in_array( $post->name, $exclude ) ) {
856
-
857
- continue;
858
- }
859
-
860
- $types[ $post->name ] = $post->label;
861
- }
862
-
863
- return $types;
864
- }
865
-
866
- /**
867
- * Missing Callback
868
- *
869
- * If a settings field type callback is not callable, alert the user.
870
- *
871
- * @access public
872
- * @since 1.0
873
- * @static
874
- *
875
- * @param array $args Arguments passed by the setting
876
- */
877
- public static function missingCallback( $args ) {
878
-
879
- printf(
880
- __( 'The callback function used for the <strong>%s</strong> setting is missing.', 'easy-table-of-contents' ),
881
- $args['id']
882
- );
883
- }
884
-
885
- /**
886
- * Text Callback
887
- *
888
- * Renders text fields.
889
- *
890
- * @access public
891
- * @since 1.0
892
- * @static
893
- *
894
- * @param array $args Arguments passed by the setting
895
- * @param null $value
896
- */
897
- public static function text( $args, $value = null ) {
898
-
899
- if ( is_null( $value ) ) {
900
-
901
- $value = self::get( $args['id'], $args['default'] );
902
- }
903
-
904
- if ( isset( $args['faux'] ) && true === $args['faux'] ) {
905
-
906
- $args['readonly'] = true;
907
- $value = isset( $args['default'] ) ? $args['default'] : '';
908
- $name = '';
909
-
910
- } else {
911
-
912
- $name = ' name="ez-toc-settings[' . $args['id'] . ']"';
913
- }
914
-
915
- $readonly = isset( $args['readonly'] ) && $args['readonly'] === true ? ' readonly="readonly"' : '';
916
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
917
-
918
- $html = '<input type="text" class="' . $size . '-text" id="ez-toc-settings[' . $args['id'] . ']"' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '"' . $readonly . '/>';
919
-
920
- if ( 0 < strlen( $args['desc'] ) ) {
921
-
922
- $html .= '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
923
- }
924
-
925
- echo $html;
926
- }
927
-
928
- /**
929
- * Textarea Callback.
930
- *
931
- * Renders a textarea.
932
- *
933
- * @access public
934
- * @since 1.1
935
- * @static
936
- *
937
- * @param array $args Arguments passed by the setting
938
- * @param null $value
939
- */
940
- public static function textarea( $args, $value = null ) {
941
-
942
- $html = '';
943
-
944
- if ( is_null( $value ) ) {
945
-
946
- $value = self::get( $args['id'], $args['default'] );
947
- }
948
-
949
- if ( isset( $args['faux'] ) && true === $args['faux'] ) {
950
-
951
- $args['readonly'] = true;
952
- $value = isset( $args['default'] ) ? $args['default'] : '';
953
- $name = '';
954
-
955
- } else {
956
-
957
- $name = ' name="ez-toc-settings[' . $args['id'] . ']"';
958
- }
959
-
960
- $readonly = isset( $args['readonly'] ) && $args['readonly'] === true ? ' readonly="readonly"' : '';
961
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
962
-
963
- if ( 0 < strlen( $args['desc'] ) ) {
964
-
965
- $html .= '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
966
- }
967
-
968
- $html .= '<textarea rows="10" cols="50" class="' . $size . '-text" id="ez-toc-settings[' . $args['id'] . ']"' . $name . $readonly . '/>' . esc_textarea( $value ) . '</textarea>';
969
-
970
- echo $html;
971
- }
972
-
973
- /**
974
- * Number Callback
975
- *
976
- * Renders number fields.
977
- *
978
- * @access public
979
- * @since 1.0
980
- * @static
981
- *
982
- * @param array $args Arguments passed by the setting
983
- */
984
- public static function number( $args ) {
985
-
986
- $value = self::get( $args['id'], $args['default'] );
987
-
988
- if ( isset( $args['faux'] ) && true === $args['faux'] ) {
989
-
990
- $args['readonly'] = true;
991
- $value = isset( $args['default'] ) ? $args['default'] : '';
992
- $name = '';
993
-
994
- } else {
995
-
996
- $name = ' name="ez-toc-settings[' . $args['id'] . ']"';
997
- }
998
-
999
- $readonly = isset( $args['readonly'] ) && $args['readonly'] === true ? ' readonly="readonly"' : '';
1000
- $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
1001
-
1002
- $html = '<input type="number" class="' . $size . '-text" id="ez-toc-settings[' . $args['id'] . ']"' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '"' . $readonly . '/>';
1003
-
1004
- if ( 0 < strlen( $args['desc'] ) ) {
1005
-
1006
- $html .= '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1007
- }
1008
-
1009
- echo $html;
1010
- }
1011
-
1012
- /**
1013
- * Checkbox Callback
1014
- *
1015
- * Renders checkboxes.
1016
- *
1017
- * @access public
1018
- * @since 1.0
1019
- * @static
1020
- *
1021
- * @param array $args Arguments passed by the setting
1022
- * @param null $value
1023
- */
1024
- public static function checkbox( $args, $value = null ) {
1025
-
1026
- if ( is_null( $value ) ) {
1027
-
1028
- $value = self::get( $args['id'], $args['default'] );
1029
- }
1030
-
1031
- if ( isset( $args['faux'] ) && true === $args['faux'] ) {
1032
-
1033
- $name = '';
1034
-
1035
- } else {
1036
-
1037
- $name = ' name="ez-toc-settings[' . $args['id'] . ']"';
1038
- }
1039
-
1040
- $checked = $value ? checked( 1, $value, false ) : '';
1041
-
1042
- $html = '<input type="checkbox" id="ez-toc-settings[' . $args['id'] . ']"' . $name . ' value="1" ' . $checked . '/>';
1043
-
1044
- if ( 0 < strlen( $args['desc'] ) ) {
1045
-
1046
- $html .= '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1047
- }
1048
-
1049
- echo $html;
1050
- }
1051
-
1052
- /**
1053
- * Multicheck Callback
1054
- *
1055
- * Renders multiple checkboxes.
1056
- *
1057
- * @access public
1058
- * @since 1.0
1059
- * @static
1060
- *
1061
- * @param array $args Arguments passed by the setting
1062
- * @param null $value
1063
- */
1064
- public static function checkboxgroup( $args, $value = null ) {
1065
-
1066
- if ( is_null( $value ) ) {
1067
-
1068
- $value = self::get( $args['id'], $args['default'] );
1069
- }
1070
-
1071
- if ( ! empty( $args['options'] ) ) {
1072
-
1073
- foreach ( $args['options'] as $key => $option ):
1074
-
1075
- if ( in_array( $key, $value ) ) {
1076
-
1077
- $enabled = $option;
1078
-
1079
- } else {
1080
-
1081
- $enabled = null;
1082
- }
1083
-
1084
- echo '<input name="ez-toc-settings[' . $args['id'] . '][' . $key . ']" id="ez-toc-settings[' . $args['id'] . '][' . $key . ']" type="checkbox" value="' . $key . '" ' . checked( $option, $enabled, false ) . '/>&nbsp;';
1085
- echo '<label for="ez-toc-settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>';
1086
-
1087
- endforeach;
1088
-
1089
- if ( 0 < strlen( $args['desc'] ) ) {
1090
-
1091
- echo '<p class="description">' . $args['desc'] . '</p>';
1092
- }
1093
- }
1094
- }
1095
-
1096
- /**
1097
- * Radio Callback
1098
- *
1099
- * Renders radio groups.
1100
- *
1101
- * @access public
1102
- * @since 1.0
1103
- * @static
1104
- *
1105
- * @param array $args Arguments passed by the setting
1106
- */
1107
- public static function radio( $args ) {
1108
-
1109
- $value = self::get( $args['id'], $args['default'] );
1110
-
1111
- foreach ( $args['options'] as $key => $option ) {
1112
-
1113
- echo '<input name="ez-toc-settings[' . $args['id'] . ']"" id="ez-toc-settings[' . $args['id'] . '][' . $key . ']" type="radio" value="' . $key . '" ' . checked( $key, $value, false ) . '/>&nbsp;';
1114
- echo '<label for="ez-toc-settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>';
1115
- }
1116
-
1117
- if ( 0 < strlen( $args['desc'] ) ) {
1118
-
1119
- echo '<p class="description">' . $args['desc'] . '</p>';
1120
- }
1121
- }
1122
-
1123
- /**
1124
- * Select Callback
1125
- *
1126
- * Renders select fields.
1127
- *
1128
- * @access public
1129
- * @since 1.0
1130
- * @static
1131
- *
1132
- * @param array $args Arguments passed by the setting.
1133
- */
1134
- public static function select( $args ) {
1135
-
1136
- $value = self::get( $args['id'], $args['default'] );
1137
-
1138
- if ( isset( $args['placeholder'] ) ) {
1139
- $placeholder = $args['placeholder'];
1140
- } else {
1141
- $placeholder = '';
1142
- }
1143
-
1144
- if ( isset( $args['chosen'] ) ) {
1145
- $chosen = 'class="enhanced"';
1146
- } else {
1147
- $chosen = '';
1148
- }
1149
-
1150
- $html = '<select id="ez-toc-settings[' . $args['id'] . ']" name="ez-toc-settings[' . $args['id'] . ']" ' . $chosen . 'data-placeholder="' . $placeholder . '" />';
1151
-
1152
- foreach ( $args['options'] as $option => $name ) {
1153
- $selected = selected( $option, $value, false );
1154
- $html .= '<option value="' . $option . '" ' . $selected . '>' . $name . '</option>';
1155
- }
1156
-
1157
- $html .= '</select>';
1158
-
1159
- if ( 0 < strlen( $args['desc'] ) ) {
1160
-
1161
- $html .= '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1162
- }
1163
-
1164
- echo $html;
1165
- }
1166
-
1167
- /**
1168
- * Select Drop Down Callback
1169
- *
1170
- * Renders select with option group fields.
1171
- *
1172
- * @access public
1173
- * @since 1.0
1174
- * @static
1175
- *
1176
- * @param array $args Arguments passed by the setting.
1177
- */
1178
- public static function selectgroup( $args ) {
1179
-
1180
- $value = self::get( $args['id'], $args['default'] );
1181
-
1182
- if ( isset( $args['placeholder'] ) ) {
1183
- $placeholder = $args['placeholder'];
1184
- } else {
1185
- $placeholder = '';
1186
- }
1187
-
1188
- if ( isset( $args['chosen'] ) ) {
1189
- $chosen = 'class="enhanced"';
1190
- } else {
1191
- $chosen = '';
1192
- }
1193
-
1194
- $html = '<select id="ez-toc-settings[' . $args['id'] . ']" name="ez-toc-settings[' . $args['id'] . ']" ' . $chosen . 'data-placeholder="' . $placeholder . '" />';
1195
-
1196
- foreach ( $args['options'] as $group ) {
1197
-
1198
- $html .= sprintf( '<optgroup label="%1$s">', $group['name'] );
1199
-
1200
- foreach ( $group['options'] as $option => $name ) {
1201
-
1202
- $selected = selected( $option, $value, false );
1203
- $html .= '<option value="' . $option . '" ' . $selected . '>' . $name . '</option>';
1204
- }
1205
-
1206
- $html .= '</optgroup>';
1207
- }
1208
-
1209
- $html .= '</select>';
1210
-
1211
- if ( 0 < strlen( $args['desc'] ) ) {
1212
-
1213
- $html .= '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1214
- }
1215
-
1216
- echo $html;
1217
- }
1218
-
1219
- /**
1220
- * Header Callback
1221
- *
1222
- * Renders the header.
1223
- *
1224
- * @access public
1225
- * @since 1.0
1226
- * @static
1227
- *
1228
- * @param array $args Arguments passed by the setting
1229
- */
1230
- public static function header( $args ) {
1231
-
1232
- echo '<hr/>';
1233
-
1234
- if ( 0 < strlen( $args['desc'] ) ) {
1235
-
1236
- echo '<p>' . wp_kses_post( $args['desc'] ) . '</p>';
1237
- }
1238
- }
1239
-
1240
- /**
1241
- * Descriptive text callback.
1242
- *
1243
- * Renders descriptive text onto the settings field.
1244
- *
1245
- * @access public
1246
- * @since 1.0
1247
- * @static
1248
- *
1249
- * @param array $args Arguments passed by the setting
1250
- */
1251
- public static function descriptive_text( $args ) {
1252
-
1253
- echo wp_kses_post( $args['desc'] );
1254
- }
1255
-
1256
- /**
1257
- * Color picker Callback
1258
- *
1259
- * Renders color picker fields.
1260
- *
1261
- * @access public
1262
- * @since 1.0
1263
- * @static
1264
- *
1265
- * @param array $args Arguments passed by the setting
1266
- */
1267
- public static function color( $args ) {
1268
-
1269
- $value = self::get( $args['id'], $args['default'] );
1270
-
1271
- $default = isset( $args['default'] ) ? $args['default'] : '';
1272
-
1273
- $html = '<input type="text" class="ez-toc-color-picker" id="ez-toc-settings[' . $args['id'] . ']" name="ez-toc-settings[' . $args['id'] . ']" value="' . esc_attr( $value ) . '" data-default-color="' . esc_attr( $default ) . '" />';
1274
-
1275
- if ( 0 < strlen( $args['desc'] ) ) {
1276
-
1277
- echo '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1278
- }
1279
-
1280
- echo $html;
1281
- }
1282
-
1283
- /**
1284
- * Custom table of contents width.
1285
- *
1286
- * @access public
1287
- * @since 1.0
1288
- * @static
1289
- *
1290
- * @param array $args
1291
- */
1292
- public static function custom_width( $args ) {
1293
-
1294
- //$value = self::get( $args['id'], $args['default'] );
1295
-
1296
- self::text(
1297
- array(
1298
- 'id' => $args['id'],
1299
- 'desc' => '',
1300
- 'size' => 'small',
1301
- 'default' => $args['default'],
1302
- )
1303
- );
1304
-
1305
- self::select(
1306
- array(
1307
- 'id' => $args['id'] . '_units',
1308
- 'desc' => '',
1309
- 'options' => array(
1310
- 'px' => 'px',
1311
- '%' => '%',
1312
- 'em' => 'em',
1313
- ),
1314
- 'default' => 'px',
1315
- )
1316
- );
1317
-
1318
- if ( 0 < strlen( $args['desc'] ) ) {
1319
-
1320
- echo '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1321
- }
1322
- }
1323
-
1324
- /**
1325
- * Custom font size callback.
1326
- *
1327
- * @access public
1328
- * @since 1.0
1329
- * @static
1330
- *
1331
- * @param array $args
1332
- */
1333
- public static function font_size( $args ) {
1334
-
1335
- //$value = self::get( $args['id'], $args['default'] );
1336
-
1337
- self::text(
1338
- array(
1339
- 'id' => $args['id'],
1340
- 'desc' => '',
1341
- 'size' => 'small',
1342
- 'default' => $args['default'],
1343
- )
1344
- );
1345
-
1346
- self::select(
1347
- array(
1348
- 'id' => $args['id'] . '_units',
1349
- 'desc' => '',
1350
- 'options' => array(
1351
- 'pt' => 'pt',
1352
- 'px' => 'px',
1353
- '%' => '%',
1354
- 'em' => 'em',
1355
- ),
1356
- 'default' => '%',
1357
- )
1358
- );
1359
-
1360
- if ( 0 < strlen( $args['desc'] ) ) {
1361
-
1362
- echo '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1363
- }
1364
- }
1365
- /**
1366
- * Custom font size callback.
1367
- *
1368
- * @access public
1369
- * @since 1.0
1370
- * @static
1371
- *
1372
- * @param array $args
1373
- */
1374
- public static function child_font_size( $args ) {
1375
-
1376
- //$value = self::get( $args['id'], $args['default'] );
1377
-
1378
- self::text(
1379
- array(
1380
- 'id' => $args['id'],
1381
- 'desc' => '',
1382
- 'size' => 'small',
1383
- 'default' => $args['default'],
1384
- )
1385
- );
1386
-
1387
- self::select(
1388
- array(
1389
- 'id' => $args['id'] . '_units',
1390
- 'desc' => '',
1391
- 'options' => array(
1392
- 'pt' => 'pt',
1393
- 'px' => 'px',
1394
- '%' => '%',
1395
- 'em' => 'em',
1396
- ),
1397
- 'default' => '%',
1398
- )
1399
- );
1400
-
1401
- if ( 0 < strlen( $args['desc'] ) ) {
1402
-
1403
- echo '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1404
- }
1405
- }
1406
- }
1407
-
1408
- add_action( 'admin_init', array( 'ezTOC_Option', 'register' ) );
1409
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Exit if accessed directly
4
+ if ( ! defined( 'ABSPATH' ) ) exit;
5
+
6
+ if ( ! class_exists( 'ezTOC_Option' ) ) {
7
+
8
+ /**
9
+ * Class ezTOC_Option
10
+ *
11
+ * Credit: Adapted from Easy Digital Downloads.
12
+ */
13
+ final class ezTOC_Option {
14
+
15
+ /**
16
+ * Register the plugins core settings and options.
17
+ *
18
+ * @access private
19
+ * @since 1.0
20
+ * @static
21
+ */
22
+ public static function register() {
23
+
24
+ if ( false === get_option( 'ez-toc-settings' ) ) {
25
+
26
+ add_option( 'ez-toc-settings', self::getDefaults() );
27
+ }
28
+
29
+ foreach ( self::getRegistered() as $section => $settings ) {
30
+
31
+ add_settings_section(
32
+ 'ez_toc_settings_' . $section,
33
+ __return_null(),
34
+ '__return_false',
35
+ 'ez_toc_settings_' . $section
36
+ );
37
+
38
+ foreach ( $settings as $option ) {
39
+
40
+ $name = isset( $option['name'] ) ? $option['name'] : '';
41
+
42
+ add_settings_field(
43
+ 'ez-toc-settings[' . $option['id'] . ']',
44
+ $name,
45
+ method_exists( __CLASS__, $option['type'] ) ? array( __CLASS__, $option['type'] ) : array( __CLASS__, 'missingCallback' ),
46
+ 'ez_toc_settings_' . $section,
47
+ 'ez_toc_settings_' . $section,
48
+ array(
49
+ 'section' => $section,
50
+ 'id' => isset( $option['id'] ) ? $option['id'] : null,
51
+ 'desc' => ! empty( $option['desc'] ) ? $option['desc'] : '',
52
+ 'name' => isset( $option['name'] ) ? $option['name'] : null,
53
+ 'size' => isset( $option['size'] ) ? $option['size'] : null,
54
+ 'options' => isset( $option['options'] ) ? $option['options'] : '',
55
+ 'default' => isset( $option['default'] ) ? $option['default'] : '',
56
+ 'min' => isset( $option['min'] ) ? $option['min'] : null,
57
+ 'max' => isset( $option['max'] ) ? $option['max'] : null,
58
+ 'step' => isset( $option['step'] ) ? $option['step'] : null,
59
+ 'chosen' => isset( $option['chosen'] ) ? $option['chosen'] : null,
60
+ 'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : null,
61
+ 'allow_blank' => isset( $option['allow_blank'] ) ? $option['allow_blank'] : true,
62
+ 'readonly' => isset( $option['readonly'] ) ? $option['readonly'] : false,
63
+ 'faux' => isset( $option['faux'] ) ? $option['faux'] : false,
64
+ )
65
+ );
66
+ }
67
+
68
+ }
69
+
70
+ // Creates our settings in the options table
71
+ register_setting( 'ez-toc-settings', 'ez-toc-settings', array( __CLASS__, 'sanitize' ) );
72
+ }
73
+
74
+ /**
75
+ * Callback for settings sanitization.
76
+ *
77
+ * @access private
78
+ * @since 1.0
79
+ * @static
80
+ *
81
+ * @param array $input The value inputted in the field.
82
+ *
83
+ * @return string $input Sanitized value.
84
+ */
85
+ public static function sanitize( $input = array() ) {
86
+
87
+ $options = self::getOptions();
88
+
89
+ if ( empty( $_POST['_wp_http_referer'] ) ) {
90
+
91
+ return $input;
92
+ }
93
+
94
+ $registered = self::getRegistered();
95
+
96
+ foreach ( $registered as $sectionID => $sectionOptions ) {
97
+
98
+ $input = $input ? $input : array();
99
+ $input = apply_filters( 'ez_toc_settings_' . $sectionID . '_sanitize', $input );
100
+
101
+ // Loop through each setting being saved and pass it through a sanitization filter
102
+ foreach ( $input as $key => $value ) {
103
+
104
+ // Get the setting type (checkbox, select, etc)
105
+ $type = isset( $registered[ $sectionID ][ $key ]['type'] ) ? $registered[ $sectionID ][ $key ]['type'] : false;
106
+
107
+ if ( $type ) {
108
+
109
+ // Field type specific filter
110
+ $input[ $key ] = apply_filters( 'ez_toc_settings_sanitize_' . $type, $value, $key );
111
+ }
112
+
113
+ // General filter
114
+ $input[ $key ] = apply_filters( 'ez_toc_settings_sanitize', $input[ $key ], $key );
115
+ }
116
+
117
+ // Loop through the registered options.
118
+ foreach ( $sectionOptions as $optionID => $optionProperties ) {
119
+
120
+ // Unset any that are empty for the section being saved.
121
+ if ( empty( $input[ $optionID ] ) ) {
122
+
123
+ unset( $options[ $optionID ] );
124
+ }
125
+
126
+ // Check for the checkbox option type.
127
+ if ( array_key_exists( 'type', $optionProperties ) && 'checkbox' == $optionProperties['type'] ) {
128
+
129
+ // If it does not exist in the options values being saved, add the option ID and set its value to `0`.
130
+ // This matches WP core behavior for saving checkbox option values.
131
+ if ( ! array_key_exists( $optionID, $input ) ) {
132
+
133
+ $input[ $optionID ] = '0';
134
+ }
135
+ }
136
+ }
137
+
138
+ }
139
+
140
+ // Merge our new settings with the existing
141
+ $output = array_merge( $options, $input );
142
+
143
+ return $output;
144
+ }
145
+
146
+ /**
147
+ * The core registered settings and options.
148
+ *
149
+ * @access private
150
+ * @since 1.0
151
+ * @static
152
+ *
153
+ * @return array
154
+ */
155
+ private static function getRegistered() {
156
+
157
+ $options = array(
158
+ 'general' => apply_filters(
159
+ 'ez_toc_settings_general',
160
+ array(
161
+ 'enabled_post_types' => array(
162
+ 'id' => 'enabled_post_types',
163
+ 'name' => __( 'Enable Support', 'easy-table-of-contents' ),
164
+ 'desc' => __( 'Select the post types to enable the support for table of contents.', 'easy-table-of-contents' ),
165
+ 'type' => 'checkboxgroup',
166
+ 'options' => self::getPostTypes(),
167
+ 'default' => array(),
168
+ ),
169
+ 'auto_insert_post_types' => array(
170
+ 'id' => 'auto_insert_post_types',
171
+ 'name' => __( 'Auto Insert', 'easy-table-of-contents' ),
172
+ 'desc' => __( 'Select the post types which will have the table of contents automatically inserted.', 'easy-table-of-contents' ) .
173
+ '<br><span class="description">' . __( 'NOTE: The table of contents will only be automatically inserted on post types for which it has been enabled.', 'easy-table-of-contents' ) . '<span>',
174
+ 'type' => 'checkboxgroup',
175
+ 'options' => self::getPostTypes(),
176
+ 'default' => array(),
177
+ ),
178
+ 'position' => array(
179
+ 'id' => 'position',
180
+ 'name' => __( 'Position', 'easy-table-of-contents' ),
181
+ 'desc' => __( 'Choose where where you want to display the table of contents.', 'easy-table-of-contents' ),
182
+ 'type' => 'select',
183
+ 'options' => array(
184
+ 'before' => __( 'Before first heading (default)', 'easy-table-of-contents' ),
185
+ 'after' => __( 'After first heading', 'easy-table-of-contents' ),
186
+ 'afterpara' => __( 'After first paragraph', 'easy-table-of-contents' ),
187
+ 'top' => __( 'Top', 'easy-table-of-contents' ),
188
+ 'bottom' => __( 'Bottom', 'easy-table-of-contents' ),
189
+ //'placeholder' => __( 'Replace [toc] placeholder. For backwards compatibility with Table of Content Plus.', 'easy-table-of-contents' ),
190
+ ),
191
+ 'default' => 1,
192
+ ),
193
+ 'start' => array(
194
+ 'id' => 'start',
195
+ 'name' => __( 'Show when', 'easy-table-of-contents' ),
196
+ 'desc' => __( 'or more headings are present', 'easy-table-of-contents' ),
197
+ 'type' => 'select',
198
+ 'options' => array_combine( range( 1, 10 ), range( 1, 10 ) ),
199
+ 'default' => 2,
200
+ ),
201
+ 'show_heading_text' => array(
202
+ 'id' => 'show_heading_text',
203
+ 'name' => __( 'Display Header Label', 'easy-table-of-contents' ),
204
+ 'desc' => __( 'Show header text above the table of contents.', 'easy-table-of-contents' ),
205
+ 'type' => 'checkbox',
206
+ 'default' => true,
207
+ ),
208
+ 'heading_text' => array(
209
+ 'id' => 'heading_text',
210
+ 'name' => __( 'Header Label', 'easy-table-of-contents' ),
211
+ 'desc' => __( 'Eg: Contents, Table of Contents, Page Contents', 'easy-table-of-contents' ),
212
+ 'type' => 'text',
213
+ 'default' => __( 'Contents', 'easy-table-of-contents' ),
214
+ ),
215
+ 'visibility' => array(
216
+ 'id' => 'visibility',
217
+ 'name' => __( 'Toggle View', 'easy-table-of-contents' ),
218
+ 'desc' => __( 'Allow the user to toggle the visibility of the table of contents.', 'easy-table-of-contents' ),
219
+ 'type' => 'checkbox',
220
+ 'default' => true,
221
+ ),
222
+ //'visibility_show' => array(
223
+ // 'id' => 'visibility_show',
224
+ // 'name' => __( 'Show Label', 'easy-table-of-contents' ),
225
+ // 'desc' => __( 'Eg: show', 'easy-table-of-contents' ),
226
+ // 'type' => 'text',
227
+ // 'default' => __( 'show', 'easy-table-of-contents' ),
228
+ //),
229
+ //'visibility_hide' => array(
230
+ // 'id' => 'visibility_hide',
231
+ // 'name' => __( 'Hide Label', 'easy-table-of-contents' ),
232
+ // 'desc' => __( 'Eg: hide', 'easy-table-of-contents' ),
233
+ // 'type' => 'text',
234
+ // 'default' => __( 'hide', 'easy-table-of-contents' ),
235
+ //),
236
+ 'visibility_hide_by_default' => array(
237
+ 'id' => 'visibility_hide_by_default',
238
+ 'name' => __( 'Initial View', 'easy-table-of-contents' ),
239
+ 'desc' => __( 'Initially hide the table of contents.', 'easy-table-of-contents' ),
240
+ 'type' => 'checkbox',
241
+ 'default' => false,
242
+ ),
243
+ 'show_hierarchy' => array(
244
+ 'id' => 'show_hierarchy',
245
+ 'name' => __( 'Show as Hierarchy', 'easy-table-of-contents' ),
246
+ 'desc' => '',
247
+ 'type' => 'checkbox',
248
+ 'default' => true,
249
+ ),
250
+ 'counter' => array(
251
+ 'id' => 'counter',
252
+ 'name' => __( 'Counter', 'easy-table-of-contents' ),
253
+ 'desc' => '',
254
+ 'type' => 'select',
255
+ 'options' => array(
256
+ 'decimal' => __( 'Decimal (default)', 'easy-table-of-contents' ),
257
+ 'disc' => __( 'Disc', 'easy-table-of-contents' ),
258
+ 'hyphen' => __( 'Hyphen', 'easy-table-of-contents' ),
259
+ 'numeric' => __( 'Numeric', 'easy-table-of-contents' ),
260
+ 'roman' => __( 'Roman', 'easy-table-of-contents' ),
261
+ 'none' => __( 'None', 'easy-table-of-contents' ),
262
+ ),
263
+ 'default' => 'decimal',
264
+ ),
265
+ 'smooth_scroll' => array(
266
+ 'id' => 'smooth_scroll',
267
+ 'name' => __( 'Smooth Scroll', 'easy-table-of-contents' ),
268
+ 'desc' => '',
269
+ 'type' => 'checkbox',
270
+ 'default' => true,
271
+ ),
272
+ 'toc_loading' => array(
273
+ 'id' => 'toc_loading',
274
+ 'name' => __( 'TOC Loading Method', 'easy-table-of-contents' ),
275
+ 'desc' => '',
276
+ 'type' => 'select',
277
+ 'options' => array(
278
+ 'js' => __( 'JavaScript (default)', 'easy-table-of-contents' ),
279
+ 'css' => __( 'Pure CSS', 'easy-table-of-contents' ),
280
+
281
+ ),
282
+ 'default' => 'js',
283
+ ),
284
+ 'sticky-toggle-above-header' => array(
285
+ 'id' => 'sticky-toggle-above-header',
286
+ 'name' => '<strong>' . __( 'Sticky Toggle Options', 'easy-table-of-contents' ) . '</strong>',
287
+ // 'desc' => __( '', 'easy-table-of-contents' ),
288
+ 'type' => 'header',
289
+ ),
290
+ // 'sticky-toggle-above-hr' => array(
291
+ // 'id' => 'sticky-toggle-above-hr',
292
+ // 'type' => 'hr',
293
+ // ),
294
+ 'sticky-toggle' => array(
295
+ 'id' => 'sticky-toggle',
296
+ 'name' => __( 'On/Off', 'easy-table-of-contents' ),
297
+ 'desc' => '',
298
+ 'type' => 'checkbox',
299
+ 'default' => false,
300
+ ),
301
+ 'sticky-toggle-width' => array(
302
+ 'id' => 'sticky-toggle-width',
303
+ 'name' => __( 'Width', 'easy-table-of-contents' ),
304
+ 'desc' => '',
305
+ 'type' => 'select',
306
+ 'options' => array(
307
+ 'auto' => __( 'Auto', 'easy-table-of-contents' ),
308
+ 'custom' => __( 'User Defined', 'easy-table-of-contents' ),
309
+ ),
310
+ 'default' => 'auto',
311
+ ),
312
+ 'sticky-toggle-width-custom' => array(
313
+ 'id' => 'sticky-toggle-width-custom',
314
+ 'name' => __( 'Custom Width', 'easy-table-of-contents' ),
315
+ 'desc' => '',
316
+ 'type' => 'text',
317
+ 'default' => false,
318
+ 'placeholder' => __( 'Enter sticky toggle custom width here..', 'easy-table-of-contents' )
319
+ ),
320
+ 'sticky-toggle-height' => array(
321
+ 'id' => 'sticky-toggle-height',
322
+ 'name' => __( 'Height', 'easy-table-of-contents' ),
323
+ 'desc' => '',
324
+ 'type' => 'select',
325
+ 'options' => array(
326
+ 'auto' => __( 'Auto', 'easy-table-of-contents' ),
327
+ 'custom' => __( 'User Defined', 'easy-table-of-contents' ),
328
+ ),
329
+ 'default' => 'auto',
330
+ ),
331
+ 'sticky-toggle-height-custom' => array(
332
+ 'id' => 'sticky-toggle-height-custom',
333
+ 'name' => __( 'Custom Height', 'easy-table-of-contents' ),
334
+ 'desc' => '',
335
+ 'type' => 'text',
336
+ 'default' => false,
337
+ 'placeholder' => __( 'Enter sticky toggle custom height here..', 'easy-table-of-contents' )
338
+ ),
339
+ 'sticky-toggle-open-button-text' => array(
340
+ 'id' => 'sticky-toggle-open-button-text',
341
+ 'name' => __( 'Open Button Text', 'easy-table-of-contents' ),
342
+ 'desc' => '',
343
+ 'type' => 'text',
344
+ 'default' => false,
345
+ 'placeholder' => __( 'Enter sticky toggle open button text here..', 'easy-table-of-contents' )
346
+ ),
347
+ // 'sticky-toggle-position' => array(
348
+ // 'id' => 'sticky-toggle-position',
349
+ // 'name' => __( 'Sticky Toggle Position', 'easy-table-of-contents' ),
350
+ // 'desc' => '',
351
+ // 'type' => 'radio',
352
+ // 'options' => array(
353
+ // 'left' => __( 'Left', 'easy-table-of-position' ),
354
+ // 'right' => __( 'Right', 'easy-table-of-position' ),
355
+ // ),
356
+ // 'default' => 'left',
357
+ // ),
358
+ )
359
+ ),
360
+ 'appearance' => apply_filters(
361
+ 'ez_toc_settings_appearance',
362
+ array(
363
+ 'width' => array(
364
+ 'id' => 'width',
365
+ 'name' => __( 'Width', 'easy-table-of-contents' ),
366
+ 'desc' => '',
367
+ 'type' => 'selectgroup',
368
+ 'options' => array(
369
+ 'fixed' => array(
370
+ 'name' => __( 'Fixed', 'easy-table-of-contents' ),
371
+ 'options' => array(
372
+ '200px' => '200px',
373
+ '225px' => '225px',
374
+ '250px' => '250px',
375
+ '275px' => '275px',
376
+ '300px' => '300px',
377
+ '325px' => '325px',
378
+ '350px' => '350px',
379
+ '375px' => '375px',
380
+ '400px' => '400px',
381
+ ),
382
+ ),
383
+ 'relative' => array(
384
+ 'name' => __( 'Relative', 'easy-table-of-contents' ),
385
+ 'options' => array(
386
+ 'auto' => 'Auto',
387
+ '25%' => '25%',
388
+ '33%' => '33%',
389
+ '50%' => '50%',
390
+ '66%' => '66%',
391
+ '75%' => '75%',
392
+ '100%' => '100%',
393
+ ),
394
+ ),
395
+ 'other' => array(
396
+ 'name' => __( 'Custom', 'easy-table-of-contents' ),
397
+ 'options' => array(
398
+ 'custom' => __( 'User Defined', 'easy-table-of-contents' ),
399
+ ),
400
+ ),
401
+ ),
402
+ 'default' => 'auto',
403
+ ),
404
+ 'width_custom' => array(
405
+ 'id' => 'width_custom',
406
+ 'name' => __( 'Custom Width', 'easy-table-of-contents' ),
407
+ 'desc' => __( 'Select the User Defined option from the Width option to utilitze the custom width.', 'easy-table-of-contents' ),
408
+ 'type' => 'custom_width',
409
+ 'default' => 275,
410
+ ),
411
+ 'wrapping' => array(
412
+ 'id' => 'wrapping',
413
+ 'name' => __( 'Alignment', 'easy-table-of-contents' ),
414
+ 'desc' => '',
415
+ 'type' => 'select',
416
+ 'options' => array(
417
+ 'none' => __( 'None (Default)', 'easy-table-of-contents' ),
418
+ 'left' => __( 'Left', 'easy-table-of-contents' ),
419
+ 'right' => __( 'Right', 'easy-table-of-contents' ),
420
+ 'center' => __( 'Center', 'easy-table-of-contents' ),
421
+ ),
422
+ 'default' => 'none',
423
+ ),
424
+ 'font_options_header' => array(
425
+ 'id' => 'font_options',
426
+ 'name' => '<strong>' . __( 'Font Option', 'easy-table-of-contents' ) . '</strong>',
427
+ //'desc' => __( 'For the following settings to apply, select the Custom Font option.', 'easy-table-of-contents' ),
428
+ 'type' => 'header',
429
+ ),
430
+ 'title_font_size' => array(
431
+ 'id' => 'title_font_size',
432
+ 'name' => __( 'Title Font Size', 'easy-table-of-contents' ),
433
+ 'desc' => '',
434
+ 'type' => 'font_size',
435
+ 'default' => 120,
436
+ ),
437
+ 'title_font_weight' => array(
438
+ 'id' => 'title_font_weight',
439
+ 'name' => __( 'Title Font Weight', 'easy-table-of-contents' ),
440
+ 'desc' => '',
441
+ 'type' => 'select',
442
+ 'options' => array(
443
+ '100' => __( 'Thin', 'easy-table-of-contents' ),
444
+ '200' => __( 'Extra Light', 'easy-table-of-contents' ),
445
+ '300' => __( 'Light', 'easy-table-of-contents' ),
446
+ '400' => __( 'Normal', 'easy-table-of-contents' ),
447
+ '500' => __( 'Medium', 'easy-table-of-contents' ),
448
+ '600' => __( 'Semi Bold', 'easy-table-of-contents' ),
449
+ '700' => __( 'Bold', 'easy-table-of-contents' ),
450
+ '800' => __( 'Extra Bold', 'easy-table-of-contents' ),
451
+ '900' => __( 'Heavy', 'easy-table-of-contents' ),
452
+ ),
453
+ 'default' => '500',
454
+ ),
455
+ 'font_size' => array(
456
+ 'id' => 'font_size',
457
+ 'name' => __( 'Font Size', 'easy-table-of-contents' ),
458
+ 'desc' => '',
459
+ 'type' => 'font_size',
460
+ 'default' => 95,
461
+ ),
462
+ 'child_font_size' => array(
463
+ 'id' => 'child_font_size',
464
+ 'name' => __( 'Child Font Size', 'easy-table-of-contents' ),
465
+ 'desc' => '',
466
+ 'type' => 'child_font_size',
467
+ 'default' => 90,
468
+ ),
469
+ 'theme_option_header' => array(
470
+ 'id' => 'theme_option_header',
471
+ 'name' => '<strong>' . __( 'Theme Options', 'easy-table-of-contents' ) . '</strong>',
472
+ //'desc' => __( 'For the following settings to apply, select the Custom Theme option.', 'easy-table-of-contents' ),
473
+ 'type' => 'header',
474
+ ),
475
+ 'theme' => array(
476
+ 'id' => 'theme',
477
+ 'name' => __( 'Theme', 'easy-table-of-contents' ),
478
+ 'desc' => __( 'The theme is only applied to the table of contents which is auto inserted into the post. The Table of Contents widget will inherit the theme widget styles.', 'easy-table-of-contents' ),
479
+ 'type' => 'radio',
480
+ 'options' => array(
481
+ 'grey' => __( 'Grey', 'easy-table-of-contents' ),
482
+ 'light-blue' => __( 'Light Blue', 'easy-table-of-contents' ),
483
+ 'white' => __( 'White', 'easy-table-of-contents' ),
484
+ 'black' => __( 'Black', 'easy-table-of-contents' ),
485
+ 'transparent' => __( 'Transparent', 'easy-table-of-contents' ),
486
+ 'custom' => __( 'Custom', 'easy-table-of-contents' ),
487
+ ),
488
+ 'default' => 'grey',
489
+ ),
490
+ 'custom_theme_header' => array(
491
+ 'id' => 'custom_theme_header',
492
+ 'name' => '<strong>' . __( 'Custom Theme', 'easy-table-of-contents' ) . '</strong>',
493
+ 'desc' => __( 'For the following settings to apply, select the Custom Theme option.', 'easy-table-of-contents' ),
494
+ 'type' => 'header',
495
+ ),
496
+ 'custom_background_colour' => array(
497
+ 'id' => 'custom_background_colour',
498
+ 'name' => __( 'Background Color', 'easy-table-of-contents' ),
499
+ 'desc' => '',
500
+ 'type' => 'color',
501
+ 'default' => '#fff',
502
+ ),
503
+ 'custom_border_colour' => array(
504
+ 'id' => 'custom_border_colour',
505
+ 'name' => __( 'Border Color', 'easy-table-of-contents' ),
506
+ 'desc' => '',
507
+ 'type' => 'color',
508
+ 'default' => '#ddd',
509
+ ),
510
+ 'custom_title_colour' => array(
511
+ 'id' => 'custom_title_colour',
512
+ 'name' => __( 'Title Color', 'easy-table-of-contents' ),
513
+ 'desc' => '',
514
+ 'type' => 'color',
515
+ 'default' => '#999',
516
+ ),
517
+ 'custom_link_colour' => array(
518
+ 'id' => 'custom_link_colour',
519
+ 'name' => __( 'Link Color', 'easy-table-of-contents' ),
520
+ 'desc' => '',
521
+ 'type' => 'color',
522
+ 'default' => '#428bca',
523
+ ),
524
+ 'custom_link_hover_colour' => array(
525
+ 'id' => 'custom_link_hover_colour',
526
+ 'name' => __( 'Link Hover Color', 'easy-table-of-contents' ),
527
+ 'desc' => '',
528
+ 'type' => 'color',
529
+ 'default' => '#2a6496',
530
+ ),
531
+ 'custom_link_visited_colour' => array(
532
+ 'id' => 'custom_link_visited_colour',
533
+ 'name' => __( 'Link Visited Color', 'easy-table-of-contents' ),
534
+ 'desc' => '',
535
+ 'type' => 'color',
536
+ 'default' => '#428bca',
537
+ ),
538
+ )
539
+ ),
540
+ 'advanced' => apply_filters(
541
+ 'ez_toc_settings_advanced',
542
+ array(
543
+ 'lowercase' => array(
544
+ 'id' => 'lowercase',
545
+ 'name' => __( 'Lowercase', 'easy-table-of-contents' ),
546
+ 'desc' => __( 'Ensure anchors are in lowercase.', 'easy-table-of-contents' ),
547
+ 'type' => 'checkbox',
548
+ 'default' => false,
549
+ ),
550
+ 'hyphenate' => array(
551
+ 'id' => 'hyphenate',
552
+ 'name' => __( 'Hyphenate', 'easy-table-of-contents' ),
553
+ 'desc' => __( 'Use - rather than _ in anchors.', 'easy-table-of-contents' ),
554
+ 'type' => 'checkbox',
555
+ 'default' => false,
556
+ ),
557
+ 'include_homepage' => array(
558
+ 'id' => 'include_homepage',
559
+ 'name' => __( 'Homepage', 'easy-table-of-contents' ),
560
+ 'desc' => __( 'Show the table of contents for qualifying items on the homepage.', 'easy-table-of-contents' ),
561
+ 'type' => 'checkbox',
562
+ 'default' => false,
563
+ ),
564
+ 'exclude_css' => array(
565
+ 'id' => 'exclude_css',
566
+ 'name' => __( 'CSS', 'easy-table-of-contents' ),
567
+ 'desc' => __( "Prevent the loading the core CSS styles. When selected, the appearance options from above will be ignored.", 'easy-table-of-contents' ),
568
+ 'type' => 'checkbox',
569
+ 'default' => false,
570
+ ),
571
+ 'inline_css' => array(
572
+ 'id' => 'inline_css',
573
+ 'name' => __( 'Inline CSS', 'easy-table-of-contents' ),
574
+ 'desc' => __( "Improve your website performance by inlining your CSS.", 'easy-table-of-contents' ),
575
+ 'type' => 'checkbox',
576
+ 'default' => false,
577
+ ),
578
+ //'bullet_spacing' => array(
579
+ // 'id' => 'bullet_spacing',
580
+ // 'name' => __( 'Theme Bullets', 'easy-table-of-contents' ),
581
+ // 'desc' => __( 'If your theme includes background images for unordered list elements, enable this option to support them.', 'easy-table-of-contents' ),
582
+ // 'type' => 'checkbox',
583
+ // 'default' => false,
584
+ //),
585
+ 'heading_levels' => array(
586
+ 'id' => 'heading_levels',
587
+ 'name' => __( 'Headings:', 'easy-table-of-contents' ),
588
+ 'desc' => __( 'Select the heading to consider when generating the table of contents. Deselecting a heading will exclude it.', 'easy-table-of-contents' ),
589
+ 'type' => 'checkboxgroup',
590
+ 'options' => array(
591
+ '1' => __( 'Heading 1 (h1)', 'easy-table-of-contents' ),
592
+ '2' => __( 'Heading 2 (h2)', 'easy-table-of-contents' ),
593
+ '3' => __( 'Heading 3 (h3)', 'easy-table-of-contents' ),
594
+ '4' => __( 'Heading 4 (h4)', 'easy-table-of-contents' ),
595
+ '5' => __( 'Heading 5 (h5)', 'easy-table-of-contents' ),
596
+ '6' => __( 'Heading 6 (h6)', 'easy-table-of-contents' ),
597
+ ),
598
+ 'default' => array( '1', '2', '3', '4', '5', '6' ),
599
+ ),
600
+ 'exclude' => array(
601
+ 'id' => 'exclude',
602
+ 'name' => __( 'Exclude Headings', 'easy-table-of-contents' ),
603
+ 'desc' => __( 'Specify headings to be excluded from appearing in the table of contents. Separate multiple headings with a pipe <code>|</code>. Use an asterisk <code>*</code> as a wildcard to match other text.', 'easy-table-of-contents' ),
604
+ 'type' => 'text',
605
+ 'size' => 'large',
606
+ 'default' => '',
607
+ ),
608
+ 'exclude_desc' => array(
609
+ 'id' => 'exclude_desc',
610
+ 'name' => '',
611
+ 'desc' => '<p><strong>' . __( 'Examples:', 'easy-table-of-contents' ) . '</strong></p>' .
612
+ '<ul>' .
613
+ '<li>' . __( '<code>Fruit*</code> Ignore headings starting with "Fruit".', 'easy-table-of-contents' ) . '</li>' .
614
+ '<li>' . __( '<code>*Fruit Diet*</code> Ignore headings with "Fruit Diet" somewhere in the heading.', 'easy-table-of-contents' ) . '</li>' .
615
+ '<li>' . __( '<code>Apple Tree|Oranges|Yellow Bananas</code> Ignore headings that are exactly "Apple Tree", "Oranges" or "Yellow Bananas".', 'easy-table-of-contents' ) . '</li>' .
616
+ '</ul>' .
617
+ '<p>' . __( '<strong>Note:</strong> This is not case sensitive.', 'easy-table-of-contents' ) . '</p>',
618
+ 'type' => 'descriptive_text',
619
+ ),
620
+ 'smooth_scroll_offset' => array(
621
+ 'id' => 'smooth_scroll_offset',
622
+ 'name' => __( 'Smooth Scroll Offset', 'easy-table-of-contents' ),
623
+ 'desc' => 'px<br/>' . __( 'If you have a consistent menu across the top of your site, you can adjust the top offset to stop the headings from appearing underneath the top menu. A setting of 30 accommodates the WordPress admin bar. This setting only has an effect after you have enabled Smooth Scroll option.', 'easy-table-of-contents' ),
624
+ 'type' => 'number',
625
+ 'size' => 'small',
626
+ 'default' => 30
627
+ ),
628
+ 'mobile_smooth_scroll_offset' => array(
629
+ 'id' => 'mobile_smooth_scroll_offset',
630
+ 'name' => __( 'Mobile Smooth Scroll Offset', 'easy-table-of-contents' ),
631
+ 'desc' => 'px<br/>' . __( 'This provides the same function as the Smooth Scroll Offset option above but applied when the user is visiting your site on a mobile device.', 'easy-table-of-contents' ),
632
+ 'type' => 'number',
633
+ 'size' => 'small',
634
+ 'default' => 0
635
+ ),
636
+ 'restrict_path' => array(
637
+ 'id' => 'restrict_path',
638
+ 'name' => __( 'Limit Path', 'easy-table-of-contents' ),
639
+ 'desc' => '<br/>' . __( '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.', 'easy-table-of-contents' ) .
640
+ '<br/><span class="description">' . __( 'Eg: /wiki/, /corporate/annual-reports/', 'easy-table-of-contents' ) . '</span>',
641
+ 'type' => 'text',
642
+ ),
643
+ 'fragment_prefix' => array(
644
+ 'id' => 'fragment_prefix',
645
+ 'name' => __( 'Default Anchor Prefix', 'easy-table-of-contents' ),
646
+ 'desc' => '<br/>' . __( '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.', 'easy-table-of-contents' ) .
647
+ '<br/>' . __( 'This option normally applies to content written in character sets other than ASCII.', 'easy-table-of-contents' ) .
648
+ '<br/><span class="description">' . __( 'Eg: i, toc_index, index, _', 'easy-table-of-contents' ) . '</span>',
649
+ 'type' => 'text',
650
+ 'default' => 'i',
651
+ ),
652
+ 'widget_affix_selector' => array(
653
+ 'id' => 'widget_affix_selector',
654
+ 'name' => __( 'Widget Affix Selector', 'easy-table-of-contents' ),
655
+ 'desc' => '<br/>' . __( 'To enable the option to affix or pin the Table of Contents widget enter the theme\'s sidebar class or id.', 'easy-table-of-contents' ) .
656
+ '<br/>' . __( 'Since every theme is different, this can not be determined automatically. If you are unsure how to find the sidebar\'s class or id, please ask the theme\'s support persons.', 'easy-table-of-contents' ) .
657
+ '<br/><span class="description">' . __( 'Eg: .widget-area or #sidebar', 'easy-table-of-contents' ) . '</span>',
658
+ 'type' => 'text',
659
+ 'default' => '',
660
+ ),
661
+ 'remove_special_chars_from_title' => array(
662
+ 'id' => 'remove_special_chars_from_title',
663
+ 'name' => __( 'Remove \':\' from TOC Title', 'easy-table-of-contents' ),
664
+ 'desc' => '',
665
+ 'type' => 'checkbox',
666
+ 'default' => false,
667
+ ),
668
+
669
+ )
670
+ ),
671
+ 'prosettings' => apply_filters(
672
+ 'ez_toc_settings_prosettings',
673
+ array(
674
+ 'exclude_by_class' => array(
675
+ 'id' => 'exclude_by_class',
676
+ 'name' => __( 'Exclude Headings by Class', 'easy-table-of-contents' ),
677
+ 'desc' => '<br/>' . __( 'You can hide the TOC heading by its class and if you want to hide multiple headings then please saparate them with a comma (,)', 'easy-table-of-contents' ),
678
+ 'type' => 'text',
679
+ 'default' => '',
680
+ ),
681
+ 'fixedtoc' => array(
682
+ 'id' => 'fixedtoc',
683
+ 'name' => __( 'Fixed TOC', 'easy-table-of-contents' ),
684
+ 'desc' => __( 'Fixed TOC in the page display so it can be easier to navigate', 'easy-table-of-contents' ),
685
+ 'type' => 'checkbox',
686
+ 'default' => false,
687
+ ),
688
+ 'highlightheadings' => array(
689
+ 'id' => 'highlightheadings',
690
+ 'name' => __( 'Highlight TOC Headings ', 'easy-table-of-contents' ),
691
+ 'desc' => __( 'Highlight TOC headings while scrolling ', 'easy-table-of-contents' ),
692
+ 'type' => 'checkbox',
693
+ 'default' => false,
694
+ ),
695
+ 'shrinkthewidth' => array(
696
+ 'id' => 'shrinkthewidth',
697
+ 'name' => __( 'Shrink the width', 'easy-table-of-contents' ),
698
+ 'desc' => __( 'Shrink the width to the size of the title' ),
699
+ 'type' => 'checkbox',
700
+ 'default' => false,
701
+ ),
702
+ )
703
+ ),
704
+ );
705
+
706
+ return apply_filters( 'ez_toc_registered_settings', $options );
707
+ }
708
+
709
+ /**
710
+ * The default values for the registered settings and options.
711
+ *
712
+ * @access private
713
+ * @since 1.0
714
+ * @static
715
+ *
716
+ * @return array
717
+ */
718
+ private static function getDefaults() {
719
+
720
+ $defaults = array(
721
+ 'fragment_prefix' => 'i',
722
+ 'position' => 'before',
723
+ 'start' => 2,
724
+ 'show_heading_text' => true,
725
+ 'heading_text' => 'Table of Contents',
726
+ 'enabled_post_types' => array( 'post','page' ),
727
+ 'auto_insert_post_types' => array( 'post','page' ),
728
+ 'show_hierarchy' => true,
729
+ 'counter' => 'decimal',
730
+ 'smooth_scroll' => true,
731
+ 'smooth_scroll_offset' => 30,
732
+ 'mobile_smooth_scroll_offset' => 0,
733
+ 'visibility' => true,
734
+ 'toc_loading' => 'js',
735
+ 'remove_special_chars_from_title' => false,
736
+ //'visibility_show' => 'show',
737
+ //'visibility_hide' => 'hide',
738
+ 'visibility_hide_by_default' => false,
739
+ 'width' => 'auto',
740
+ 'width_custom' => 275,
741
+ 'width_custom_units' => 'px',
742
+ 'wrapping' => 'none',
743
+ 'title_font_size' => 120,
744
+ 'title_font_size_units' => '%',
745
+ 'title_font_weight' => 500,
746
+ 'font_size' => 95,
747
+ 'child_font_size' => 90,
748
+ 'font_size_units' => '%',
749
+ 'theme' => 'grey',
750
+ 'custom_background_colour' => '#fff',
751
+ 'custom_border_colour' => '#ddd',
752
+ 'custom_title_colour' => '#999',
753
+ 'custom_link_colour' => '#428bca',
754
+ 'custom_link_hover_colour' => '#2a6496',
755
+ 'custom_link_visited_colour' => '#428bca',
756
+ 'lowercase' => false,
757
+ 'hyphenate' => false,
758
+ //'bullet_spacing' => false,
759
+ 'include_homepage' => false,
760
+ 'exclude_css' => false,
761
+ 'inline_css' => false,
762
+ 'exclude' => '',
763
+ 'heading_levels' => array( '1', '2', '3', '4', '5', '6' ),
764
+ 'restrict_path' => '',
765
+ 'css_container_class' => '',
766
+ //'show_toc_in_widget_only' => false,
767
+ //'show_toc_in_widget_only_post_types' => array(),
768
+ 'widget_affix_selector' => '',
769
+ );
770
+
771
+ return apply_filters( 'ez_toc_get_default_options', $defaults );
772
+ }
773
+
774
+ /**
775
+ * Get the default options array.
776
+ *
777
+ * @access private
778
+ * @since 1.0
779
+ * @static
780
+ *
781
+ * @return array
782
+ */
783
+ private static function getOptions() {
784
+
785
+ $defaults = self::getDefaults();
786
+ $options = get_option( 'ez-toc-settings', $defaults );
787
+
788
+ //return apply_filters( 'ez_toc_get_options', wp_parse_args( $options, $defaults ) );
789
+ return apply_filters( 'ez_toc_get_options', $options );
790
+ }
791
+
792
+ /**
793
+ * Get option value by key name.
794
+ *
795
+ * @access public
796
+ * @since 1.0
797
+ * @static
798
+ *
799
+ * @param string $key
800
+ * @param bool|false $default
801
+ *
802
+ * @return mixed
803
+ */
804
+ public static function get( $key, $default = false ) {
805
+
806
+ $options = self::getOptions();
807
+
808
+ $value = array_key_exists( $key, $options ) ? $options[ $key ] : $default;
809
+ $value = apply_filters( 'ez_toc_get_option', $value, $key, $default );
810
+
811
+ return apply_filters( 'ez_toc_get_option_' . $key, $value, $key, $default );
812
+ }
813
+
814
+ /**
815
+ * Set an option value by key name.
816
+ *
817
+ * @access public
818
+ * @since 1.0
819
+ * @static
820
+ *
821
+ * @param string $key
822
+ * @param bool|false $value
823
+ *
824
+ * @return bool
825
+ */
826
+ public static function set( $key, $value = false ) {
827
+
828
+ if ( empty( $value ) ) {
829
+
830
+ $remove_option = self::delete( $key );
831
+
832
+ return $remove_option;
833
+ }
834
+
835
+ $options = self::getOptions();
836
+
837
+ $options[ $key ] = apply_filters( 'ez_toc_update_option', $value, $key );
838
+
839
+ return update_option( 'ez-toc-settings', $options );
840
+ }
841
+
842
+ /**
843
+ * Delete an option from the options table by option key name.
844
+ *
845
+ * @access public
846
+ * @since 1.0
847
+ * @static
848
+ *
849
+ * @param string $key
850
+ *
851
+ * @return bool
852
+ */
853
+ public static function delete( $key ) {
854
+
855
+ // First let's grab the current settings
856
+ $options = get_option( 'ez-toc-settings' );
857
+
858
+ // Next let's try to update the value
859
+ if ( array_key_exists( $key, $options ) ) {
860
+
861
+ unset( $options[ $key ] );
862
+ }
863
+
864
+ return update_option( 'ez-toc-settings', $options );
865
+ }
866
+
867
+ /**
868
+ * Sanitize a hex color from user input.
869
+ *
870
+ * Tries to convert $string into a valid hex colour.
871
+ * Returns $default if $string is not a hex value, otherwise returns verified hex.
872
+ *
873
+ * @access private
874
+ * @since 1.0
875
+ * @static
876
+ *
877
+ * @param string $string
878
+ * @param string $default
879
+ *
880
+ * @return mixed|string
881
+ */
882
+ private static function hex_value( $string = '', $default = '#' ) {
883
+
884
+ $return = $default;
885
+
886
+ if ( $string ) {
887
+ // strip out non hex chars
888
+ $return = preg_replace( '/[^a-fA-F0-9]*/', '', $string );
889
+
890
+ switch ( strlen( $return ) ) {
891
+ case 3: // do next
892
+ case 6:
893
+ $return = '#' . $return;
894
+ break;
895
+
896
+ default:
897
+ if ( strlen( $return ) > 6 ) {
898
+ $return = '#' . substr( $return, 0, 6 );
899
+ } // if > 6 chars, then take the first 6
900
+ elseif ( strlen( $return ) > 3 && strlen( $return ) < 6 ) {
901
+ $return = '#' . substr( $return, 0, 3 );
902
+ } // if between 3 and 6, then take first 3
903
+ else {
904
+ $return = $default;
905
+ } // not valid, return $default
906
+ }
907
+ }
908
+
909
+ return $return;
910
+ }
911
+
912
+ /**
913
+ * Get the registered post types minus excluded core types.
914
+ *
915
+ * @access public
916
+ * @since 1.0
917
+ * @static
918
+ *
919
+ * @return array
920
+ */
921
+ public static function getPostTypes() {
922
+
923
+ $exclude = apply_filters( 'ez_toc_exclude_post_types', array( 'attachment', 'revision', 'nav_menu_item', 'safecss' ) );
924
+ $registered = get_post_types( array(), 'objects' );
925
+ $types = array();
926
+
927
+ foreach ( $registered as $post ) {
928
+
929
+ if ( in_array( $post->name, $exclude ) ) {
930
+
931
+ continue;
932
+ }
933
+
934
+ $types[ $post->name ] = $post->label;
935
+ }
936
+
937
+ return $types;
938
+ }
939
+
940
+ /**
941
+ * Missing Callback
942
+ *
943
+ * If a settings field type callback is not callable, alert the user.
944
+ *
945
+ * @access public
946
+ * @since 1.0
947
+ * @static
948
+ *
949
+ * @param array $args Arguments passed by the setting
950
+ */
951
+ public static function missingCallback( $args ) {
952
+
953
+ printf(
954
+ __( 'The callback function used for the <strong>%s</strong> setting is missing.', 'easy-table-of-contents' ),
955
+ $args['id']
956
+ );
957
+ }
958
+
959
+ /**
960
+ * HR Callback
961
+ *
962
+ * Renders hr html tag.
963
+ *
964
+ * @access public
965
+ *
966
+ * @param array $args Arguments passed by the setting
967
+ *
968
+ * @since 1.0
969
+ * @static
970
+ *
971
+ */
972
+ public static function hr( array $args ) {
973
+ $class = '';
974
+ if ( isset( $args['class'] ) && true === $args['class'] ) {
975
+ $class = self::get( $args['class'], $args['default'] );
976
+ }
977
+ echo <<<HR_TAG
978
+ <hr class='$class' />
979
+ HR_TAG;
980
+ }
981
+
982
+ /**
983
+ * Text Callback
984
+ *
985
+ * Renders text fields.
986
+ *
987
+ * @access public
988
+ * @since 1.0
989
+ * @static
990
+ *
991
+ * @param array $args Arguments passed by the setting
992
+ * @param null $value
993
+ */
994
+ public static function text( $args, $value = null ) {
995
+
996
+ if ( is_null( $value ) ) {
997
+
998
+ $value = self::get( $args['id'], $args['default'] );
999
+ }
1000
+
1001
+ if ( isset( $args['faux'] ) && true === $args['faux'] ) {
1002
+
1003
+ $args['readonly'] = true;
1004
+ $value = isset( $args['default'] ) ? $args['default'] : '';
1005
+ $name = '';
1006
+
1007
+ } else {
1008
+
1009
+ $name = ' name="ez-toc-settings[' . $args['id'] . ']"';
1010
+ }
1011
+
1012
+ $placeholder = '';
1013
+ if ( isset( $args['placeholder'] ) && ! empty( $args['placeholder'] ) ) {
1014
+ $placeholder = $args['placeholder'];
1015
+ }
1016
+
1017
+ $readonly = isset( $args['readonly'] ) && $args['readonly'] === true ? ' readonly="readonly"' : '';
1018
+ $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
1019
+
1020
+ $html = '<input type="text" class="' . $size . '-text" id="ez-toc-settings[' . $args['id'] . ']"' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '"' . $readonly . ' placeholder="' .
1021
+ $placeholder . '" />';
1022
+
1023
+
1024
+ if ( 0 < strlen( $args['desc'] ) ) {
1025
+
1026
+ $html .= '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1027
+ }
1028
+
1029
+ echo $html;
1030
+ }
1031
+
1032
+ /**
1033
+ * Textarea Callback.
1034
+ *
1035
+ * Renders a textarea.
1036
+ *
1037
+ * @access public
1038
+ * @since 1.1
1039
+ * @static
1040
+ *
1041
+ * @param array $args Arguments passed by the setting
1042
+ * @param null $value
1043
+ */
1044
+ public static function textarea( $args, $value = null ) {
1045
+
1046
+ $html = '';
1047
+
1048
+ if ( is_null( $value ) ) {
1049
+
1050
+ $value = self::get( $args['id'], $args['default'] );
1051
+ }
1052
+
1053
+ if ( isset( $args['faux'] ) && true === $args['faux'] ) {
1054
+
1055
+ $args['readonly'] = true;
1056
+ $value = isset( $args['default'] ) ? $args['default'] : '';
1057
+ $name = '';
1058
+
1059
+ } else {
1060
+
1061
+ $name = ' name="ez-toc-settings[' . $args['id'] . ']"';
1062
+ }
1063
+
1064
+ $readonly = isset( $args['readonly'] ) && $args['readonly'] === true ? ' readonly="readonly"' : '';
1065
+ $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
1066
+
1067
+ if ( 0 < strlen( $args['desc'] ) ) {
1068
+
1069
+ $html .= '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1070
+ }
1071
+
1072
+ $html .= '<textarea rows="10" cols="50" class="' . $size . '-text" id="ez-toc-settings[' . $args['id'] . ']"' . $name . $readonly . '/>' . esc_textarea( $value ) . '</textarea>';
1073
+
1074
+ echo $html;
1075
+ }
1076
+
1077
+ /**
1078
+ * Number Callback
1079
+ *
1080
+ * Renders number fields.
1081
+ *
1082
+ * @access public
1083
+ * @since 1.0
1084
+ * @static
1085
+ *
1086
+ * @param array $args Arguments passed by the setting
1087
+ */
1088
+ public static function number( $args ) {
1089
+
1090
+ $value = self::get( $args['id'], $args['default'] );
1091
+
1092
+ if ( isset( $args['faux'] ) && true === $args['faux'] ) {
1093
+
1094
+ $args['readonly'] = true;
1095
+ $value = isset( $args['default'] ) ? $args['default'] : '';
1096
+ $name = '';
1097
+
1098
+ } else {
1099
+
1100
+ $name = ' name="ez-toc-settings[' . $args['id'] . ']"';
1101
+ }
1102
+
1103
+ $readonly = isset( $args['readonly'] ) && $args['readonly'] === true ? ' readonly="readonly"' : '';
1104
+ $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular';
1105
+
1106
+ $html = '<input type="number" class="' . $size . '-text" id="ez-toc-settings[' . $args['id'] . ']"' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '"' . $readonly . '/>';
1107
+
1108
+ if ( 0 < strlen( $args['desc'] ) ) {
1109
+
1110
+ $html .= '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1111
+ }
1112
+
1113
+ echo $html;
1114
+ }
1115
+
1116
+ /**
1117
+ * Checkbox Callback
1118
+ *
1119
+ * Renders checkboxes.
1120
+ *
1121
+ * @access public
1122
+ * @since 1.0
1123
+ * @static
1124
+ *
1125
+ * @param array $args Arguments passed by the setting
1126
+ * @param null $value
1127
+ */
1128
+ public static function checkbox( $args, $value = null ) {
1129
+
1130
+ if ( is_null( $value ) ) {
1131
+
1132
+ $value = self::get( $args['id'], $args['default'] );
1133
+ }
1134
+
1135
+ if ( isset( $args['faux'] ) && true === $args['faux'] ) {
1136
+
1137
+ $name = '';
1138
+
1139
+ } else {
1140
+
1141
+ $name = ' name="ez-toc-settings[' . $args['id'] . ']"';
1142
+ }
1143
+
1144
+ $checked = $value ? checked( 1, $value, false ) : '';
1145
+
1146
+ $html = '<input type="checkbox" id="ez-toc-settings[' . $args['id'] . ']"' . $name . ' value="1" ' . $checked . '/>';
1147
+
1148
+ if ( 0 < strlen( $args['desc'] ) ) {
1149
+
1150
+ $html .= '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1151
+ }
1152
+
1153
+ echo $html;
1154
+ }
1155
+
1156
+ /**
1157
+ * Multicheck Callback
1158
+ *
1159
+ * Renders multiple checkboxes.
1160
+ *
1161
+ * @access public
1162
+ * @since 1.0
1163
+ * @static
1164
+ *
1165
+ * @param array $args Arguments passed by the setting
1166
+ * @param null $value
1167
+ */
1168
+ public static function checkboxgroup( $args, $value = null ) {
1169
+
1170
+ if ( is_null( $value ) ) {
1171
+
1172
+ $value = self::get( $args['id'], $args['default'] );
1173
+ }
1174
+
1175
+ if ( ! empty( $args['options'] ) ) {
1176
+
1177
+ foreach ( $args['options'] as $key => $option ):
1178
+
1179
+ if ( in_array( $key, $value ) ) {
1180
+
1181
+ $enabled = $option;
1182
+
1183
+ } else {
1184
+
1185
+ $enabled = null;
1186
+ }
1187
+
1188
+ echo '<input name="ez-toc-settings[' . $args['id'] . '][' . $key . ']" id="ez-toc-settings[' . $args['id'] . '][' . $key . ']" type="checkbox" value="' . $key . '" ' . checked( $option, $enabled, false ) . '/>&nbsp;';
1189
+ echo '<label for="ez-toc-settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>';
1190
+
1191
+ endforeach;
1192
+
1193
+ if ( 0 < strlen( $args['desc'] ) ) {
1194
+
1195
+ echo '<p class="description">' . $args['desc'] . '</p>';
1196
+ }
1197
+ }
1198
+ }
1199
+
1200
+ /**
1201
+ * Radio Callback
1202
+ *
1203
+ * Renders radio groups.
1204
+ *
1205
+ * @access public
1206
+ * @since 1.0
1207
+ * @static
1208
+ *
1209
+ * @param array $args Arguments passed by the setting
1210
+ */
1211
+ public static function radio( $args ) {
1212
+
1213
+ $value = self::get( $args['id'], $args['default'] );
1214
+
1215
+ foreach ( $args['options'] as $key => $option ) {
1216
+
1217
+ echo '<input name="ez-toc-settings[' . $args['id'] . ']"" id="ez-toc-settings[' . $args['id'] . '][' . $key . ']" type="radio" value="' . $key . '" ' . checked( $key, $value, false ) . '/>&nbsp;';
1218
+ echo '<label for="ez-toc-settings[' . $args['id'] . '][' . $key . ']">' . $option . '</label><br/>';
1219
+ }
1220
+
1221
+ if ( 0 < strlen( $args['desc'] ) ) {
1222
+
1223
+ echo '<p class="description">' . $args['desc'] . '</p>';
1224
+ }
1225
+ }
1226
+
1227
+ /**
1228
+ * Select Callback
1229
+ *
1230
+ * Renders select fields.
1231
+ *
1232
+ * @access public
1233
+ * @since 1.0
1234
+ * @static
1235
+ *
1236
+ * @param array $args Arguments passed by the setting.
1237
+ */
1238
+ public static function select( $args ) {
1239
+
1240
+ $value = self::get( $args['id'], $args['default'] );
1241
+
1242
+ if ( isset( $args['placeholder'] ) ) {
1243
+ $placeholder = $args['placeholder'];
1244
+ } else {
1245
+ $placeholder = '';
1246
+ }
1247
+
1248
+ if ( isset( $args['chosen'] ) ) {
1249
+ $chosen = 'class="enhanced"';
1250
+ } else {
1251
+ $chosen = '';
1252
+ }
1253
+
1254
+ $html = '<select id="ez-toc-settings[' . $args['id'] . ']" name="ez-toc-settings[' . $args['id'] . ']" ' . $chosen . 'data-placeholder="' . $placeholder . '" />';
1255
+
1256
+ foreach ( $args['options'] as $option => $name ) {
1257
+ $selected = selected( $option, $value, false );
1258
+ $html .= '<option value="' . $option . '" ' . $selected . '>' . $name . '</option>';
1259
+ }
1260
+
1261
+ $html .= '</select>';
1262
+
1263
+ if ( 0 < strlen( $args['desc'] ) ) {
1264
+
1265
+ $html .= '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1266
+ }
1267
+
1268
+ echo $html;
1269
+ }
1270
+
1271
+ /**
1272
+ * Select Drop Down Callback
1273
+ *
1274
+ * Renders select with option group fields.
1275
+ *
1276
+ * @access public
1277
+ * @since 1.0
1278
+ * @static
1279
+ *
1280
+ * @param array $args Arguments passed by the setting.
1281
+ */
1282
+ public static function selectgroup( $args ) {
1283
+
1284
+ $value = self::get( $args['id'], $args['default'] );
1285
+
1286
+ if ( isset( $args['placeholder'] ) ) {
1287
+ $placeholder = $args['placeholder'];
1288
+ } else {
1289
+ $placeholder = '';
1290
+ }
1291
+
1292
+ if ( isset( $args['chosen'] ) ) {
1293
+ $chosen = 'class="enhanced"';
1294
+ } else {
1295
+ $chosen = '';
1296
+ }
1297
+
1298
+ $html = '<select id="ez-toc-settings[' . $args['id'] . ']" name="ez-toc-settings[' . $args['id'] . ']" ' . $chosen . 'data-placeholder="' . $placeholder . '" />';
1299
+
1300
+ foreach ( $args['options'] as $group ) {
1301
+
1302
+ $html .= sprintf( '<optgroup label="%1$s">', $group['name'] );
1303
+
1304
+ foreach ( $group['options'] as $option => $name ) {
1305
+
1306
+ $selected = selected( $option, $value, false );
1307
+ $html .= '<option value="' . $option . '" ' . $selected . '>' . $name . '</option>';
1308
+ }
1309
+
1310
+ $html .= '</optgroup>';
1311
+ }
1312
+
1313
+ $html .= '</select>';
1314
+
1315
+ if ( 0 < strlen( $args['desc'] ) ) {
1316
+
1317
+ $html .= '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1318
+ }
1319
+
1320
+ echo $html;
1321
+ }
1322
+
1323
+ /**
1324
+ * Header Callback
1325
+ *
1326
+ * Renders the header.
1327
+ *
1328
+ * @access public
1329
+ * @since 1.0
1330
+ * @static
1331
+ *
1332
+ * @param array $args Arguments passed by the setting
1333
+ */
1334
+ public static function header( $args ) {
1335
+
1336
+ echo '<hr/>';
1337
+
1338
+ if ( 0 < strlen( $args['desc'] ) ) {
1339
+
1340
+ echo '<p>' . wp_kses_post( $args['desc'] ) . '</p>';
1341
+ }
1342
+ }
1343
+
1344
+ /**
1345
+ * Descriptive text callback.
1346
+ *
1347
+ * Renders descriptive text onto the settings field.
1348
+ *
1349
+ * @access public
1350
+ * @since 1.0
1351
+ * @static
1352
+ *
1353
+ * @param array $args Arguments passed by the setting
1354
+ */
1355
+ public static function descriptive_text( $args ) {
1356
+
1357
+ echo wp_kses_post( $args['desc'] );
1358
+ }
1359
+
1360
+ /**
1361
+ * Color picker Callback
1362
+ *
1363
+ * Renders color picker fields.
1364
+ *
1365
+ * @access public
1366
+ * @since 1.0
1367
+ * @static
1368
+ *
1369
+ * @param array $args Arguments passed by the setting
1370
+ */
1371
+ public static function color( $args ) {
1372
+
1373
+ $value = self::get( $args['id'], $args['default'] );
1374
+
1375
+ $default = isset( $args['default'] ) ? $args['default'] : '';
1376
+
1377
+ $html = '<input type="text" class="ez-toc-color-picker" id="ez-toc-settings[' . $args['id'] . ']" name="ez-toc-settings[' . $args['id'] . ']" value="' . esc_attr( $value ) . '" data-default-color="' . esc_attr( $default ) . '" />';
1378
+
1379
+ if ( 0 < strlen( $args['desc'] ) ) {
1380
+
1381
+ echo '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1382
+ }
1383
+
1384
+ echo $html;
1385
+ }
1386
+
1387
+ /**
1388
+ * Custom table of contents width.
1389
+ *
1390
+ * @access public
1391
+ * @since 1.0
1392
+ * @static
1393
+ *
1394
+ * @param array $args
1395
+ */
1396
+ public static function custom_width( $args ) {
1397
+
1398
+ //$value = self::get( $args['id'], $args['default'] );
1399
+
1400
+ self::text(
1401
+ array(
1402
+ 'id' => $args['id'],
1403
+ 'desc' => '',
1404
+ 'size' => 'small',
1405
+ 'default' => $args['default'],
1406
+ )
1407
+ );
1408
+
1409
+ self::select(
1410
+ array(
1411
+ 'id' => $args['id'] . '_units',
1412
+ 'desc' => '',
1413
+ 'options' => array(
1414
+ 'px' => 'px',
1415
+ '%' => '%',
1416
+ 'em' => 'em',
1417
+ ),
1418
+ 'default' => 'px',
1419
+ )
1420
+ );
1421
+
1422
+ if ( 0 < strlen( $args['desc'] ) ) {
1423
+
1424
+ echo '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1425
+ }
1426
+ }
1427
+
1428
+ /**
1429
+ * Custom font size callback.
1430
+ *
1431
+ * @access public
1432
+ * @since 1.0
1433
+ * @static
1434
+ *
1435
+ * @param array $args
1436
+ */
1437
+ public static function font_size( $args ) {
1438
+
1439
+ //$value = self::get( $args['id'], $args['default'] );
1440
+
1441
+ self::text(
1442
+ array(
1443
+ 'id' => $args['id'],
1444
+ 'desc' => '',
1445
+ 'size' => 'small',
1446
+ 'default' => $args['default'],
1447
+ )
1448
+ );
1449
+
1450
+ self::select(
1451
+ array(
1452
+ 'id' => $args['id'] . '_units',
1453
+ 'desc' => '',
1454
+ 'options' => array(
1455
+ 'pt' => 'pt',
1456
+ 'px' => 'px',
1457
+ '%' => '%',
1458
+ 'em' => 'em',
1459
+ ),
1460
+ 'default' => '%',
1461
+ )
1462
+ );
1463
+
1464
+ if ( 0 < strlen( $args['desc'] ) ) {
1465
+
1466
+ echo '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1467
+ }
1468
+ }
1469
+ /**
1470
+ * Custom font size callback.
1471
+ *
1472
+ * @access public
1473
+ * @since 1.0
1474
+ * @static
1475
+ *
1476
+ * @param array $args
1477
+ */
1478
+ public static function child_font_size( $args ) {
1479
+
1480
+ //$value = self::get( $args['id'], $args['default'] );
1481
+
1482
+ self::text(
1483
+ array(
1484
+ 'id' => $args['id'],
1485
+ 'desc' => '',
1486
+ 'size' => 'small',
1487
+ 'default' => $args['default'],
1488
+ )
1489
+ );
1490
+
1491
+ self::select(
1492
+ array(
1493
+ 'id' => $args['id'] . '_units',
1494
+ 'desc' => '',
1495
+ 'options' => array(
1496
+ 'pt' => 'pt',
1497
+ 'px' => 'px',
1498
+ '%' => '%',
1499
+ 'em' => 'em',
1500
+ ),
1501
+ 'default' => '%',
1502
+ )
1503
+ );
1504
+
1505
+ if ( 0 < strlen( $args['desc'] ) ) {
1506
+
1507
+ echo '<label for="ez-toc-settings[' . $args['id'] . ']"> ' . $args['desc'] . '</label>';
1508
+ }
1509
+ }
1510
+ }
1511
+
1512
+ add_action( 'admin_init', array( 'ezTOC_Option', 'register' ) );
1513
+ }
includes/class.post.php CHANGED
@@ -1,1452 +1,1527 @@
1
- <?php
2
-
3
- use function Easy_Plugins\Table_Of_Contents\String\br2;
4
-
5
- class ezTOC_Post {
6
-
7
- /**
8
- * @since 2.0
9
- * @var int
10
- */
11
- private $queriedObjectID;
12
-
13
- /**
14
- * @since 2.0
15
- * @var WP_Post
16
- */
17
- private $post;
18
-
19
- /**
20
- * @since 2.0
21
- * @var false|string
22
- */
23
- private $permalink;
24
-
25
- /**
26
- * The post content broken into pages by user inserting `<!--nextpage-->` into the post content.
27
- * @see ezTOC_Post::extractPages()
28
- * @since 2.0
29
- * @var array
30
- */
31
- private $pages = array();
32
-
33
- /**
34
- * The user defined heading levels to be included in the TOC.
35
- * @see ezTOC_Post::getHeadingLevels()
36
- * @since 2.0
37
- * @var array
38
- */
39
- private $headingLevels = array();
40
-
41
- /**
42
- * Array of nodes that are excluded by class/id selector.
43
- * @since 2.0
44
- * @var string[]
45
- */
46
- private $excludedNodes = array();
47
-
48
- /**
49
- * Keeps a track of used anchors for collision detecting.
50
- * @see ezTOC_Post::generateHeadingIDFromTitle()
51
- * @since 2.0
52
- * @var array
53
- */
54
- private $collision_collector = array();
55
-
56
- /**
57
- * @var bool
58
- */
59
- private $hasTOCItems = false;
60
-
61
- /**
62
- * ezTOC_Post constructor.
63
- *
64
- * @since 2.0
65
- *
66
- * @param WP_Post $post
67
- * @param bool $apply_content_filter Whether or not to apply the `the_content` filter on the post content.
68
- */
69
- public function __construct( WP_Post $post, $apply_content_filter = true ) {
70
-
71
- $this->post = $post;
72
- $this->permalink = get_permalink( $post );
73
- $this->queriedObjectID = get_queried_object_id();
74
-
75
- if ( $apply_content_filter ) {
76
-
77
- $this->applyContentFilter()->process();
78
-
79
- } else {
80
-
81
- $this->process();
82
- }
83
- }
84
-
85
- /**
86
- * @access public
87
- * @since 2.0
88
- *
89
- * @param $id
90
- *
91
- * @return ezTOC_Post|null
92
- */
93
- public static function get( $id ) {
94
-
95
- $post = get_post( $id );
96
-
97
- if ( ! $post instanceof WP_Post ) {
98
-
99
- return null;
100
- }
101
-
102
- return new static( $post );
103
- }
104
-
105
- /**
106
- * Process post content for headings.
107
- *
108
- * This must be run after object init or after @see ezTOC_Post::applyContentFilter().
109
- *
110
- * @since 2.0
111
- *
112
- * @return static
113
- */
114
- private function process() {
115
-
116
- $this->processPages();
117
-
118
- return $this;
119
- }
120
-
121
- /**
122
- * Apply `the_content` filter to the post content.
123
- *
124
- * @since 2.0
125
- *
126
- * @return static
127
- */
128
- private function applyContentFilter() {
129
-
130
- add_filter( 'strip_shortcodes_tagnames', array( __CLASS__, 'stripShortcodes' ), 10, 2 );
131
-
132
- /*
133
- * Ensure the ezTOC content filter is not applied when running `the_content` filter.
134
- */
135
- remove_filter( 'the_content', array( 'ezTOC', 'the_content' ), 100 );
136
-
137
- $this->post->post_content = apply_filters( 'the_content', strip_shortcodes( $this->post->post_content ) );
138
-
139
- add_filter( 'the_content', array( 'ezTOC', 'the_content' ), 100 ); // increased priority to fix other plugin filter overwriting our changes
140
-
141
- remove_filter( 'strip_shortcodes_tagnames', array( __CLASS__, 'stripShortcodes' ) );
142
-
143
- return $this;
144
- }
145
-
146
- /**
147
- * Callback for the `strip_shortcodes_tagnames` filter.
148
- *
149
- * Strip the shortcodes so their content is no processed for headings.
150
- *
151
- * @see ezTOC_Post::applyContentFilter()
152
- *
153
- * @since 2.0
154
- *
155
- * @param array $tags_to_remove Array of shortcode tags to remove.
156
- * @param string $content Content shortcodes are being removed from.
157
- *
158
- * @return array
159
- */
160
- public static function stripShortcodes( $tags_to_remove, $content ) {
161
-
162
- //error_log( var_export( $tags_to_remove, true ) );
163
-
164
- /*
165
- * Ensure the ezTOC shortcodes are not processed when applying `the_content` filter
166
- * otherwise an infinite loop may occur.
167
- */
168
- $tags_to_remove = apply_filters(
169
- 'ez_toc_strip_shortcodes_tagnames',
170
- array(
171
- 'ez-toc',
172
- apply_filters( 'ez_toc_shortcode', 'toc' ),
173
- ),
174
- $content
175
- );
176
-
177
- //error_log( var_export( $tags_to_remove, true ) );
178
-
179
- return $tags_to_remove;
180
- }
181
-
182
- /**
183
- * This is a work around for theme's and plugins
184
- * which break the WordPress global $wp_query var by unsetting it
185
- * or overwriting it which breaks the method call
186
- * that `get_query_var()` uses to return the query variable.
187
- *
188
- * @access protected
189
- * @since 2.0
190
- *
191
- * @return int
192
- */
193
- protected function getCurrentPage() {
194
-
195
- global $wp_query;
196
-
197
- // Check to see if the global `$wp_query` var is an instance of WP_Query and that the get() method is callable.
198
- // If it is then when can simply use the get_query_var() function.
199
- if ( $wp_query instanceof WP_Query && is_callable( array( $wp_query, 'get' ) ) ) {
200
-
201
- $page = get_query_var( 'page', 1 );
202
-
203
- return 1 > $page ? 1 : $page;
204
-
205
- // If a theme or plugin broke the global `$wp_query` var, check to see if the $var was parsed and saved in $GLOBALS['wp_query']->query_vars.
206
- } elseif ( isset( $GLOBALS['wp_query']->query_vars[ 'page' ] ) ) {
207
-
208
- return $GLOBALS['wp_query']->query_vars[ 'page' ];
209
-
210
- // We should not reach this, but if we do, lets check the original parsed query vars in $GLOBALS['wp_the_query']->query_vars.
211
- } elseif ( isset( $GLOBALS['wp_the_query']->query_vars[ 'page' ] ) ) {
212
-
213
- return $GLOBALS['wp_the_query']->query_vars[ 'page' ];
214
-
215
- // Ok, if all else fails, check the $_REQUEST super global.
216
- } elseif ( isset( $_REQUEST[ 'page' ] ) ) {
217
-
218
- return $_REQUEST[ 'page' ];
219
- }
220
-
221
- // Finally, return the $default if it was supplied.
222
- return 1;
223
- }
224
-
225
- /**
226
- * Get the number of page the post has.
227
- *
228
- * @access protected
229
- * @since 2.0
230
- *
231
- * @return int
232
- */
233
- protected function getNumberOfPages() {
234
-
235
- return count( $this->pages );
236
- }
237
-
238
- /**
239
- * Whether or not the post has multiple pages.
240
- *
241
- * @access protected
242
- * @since 2.0
243
- *
244
- * @return bool
245
- */
246
- protected function isMultipage() {
247
-
248
- return 1 < $this->getNumberOfPages();
249
- }
250
-
251
- /**
252
- * Parse the post content and headings.
253
- *
254
- * @access private
255
- * @since 2.0
256
- */
257
- private function processPages() {
258
-
259
- //if ( ! class_exists( 'TagFilter' ) ) {
260
- //
261
- // require_once( EZ_TOC_PATH . '/includes/vendor/ultimate-web-scraper/tag_filter.php' );
262
- //}
263
-
264
- $split = preg_split( '/<!--nextpage-->/msuU', $this->post->post_content );
265
- $pages = array();
266
-
267
- if ( is_array( $split ) ) {
268
-
269
- $page = 1;
270
-
271
- //$tagFilterOptions = TagFilter::GetHTMLOptions();
272
-
273
- //// Set custom TagFilter options.
274
- //$tagFilterOptions['charset'] = get_option( 'blog_charset' );
275
- ////$tagFilterOptions['output_mode'] = 'xml';
276
-
277
- foreach ( $split as $content ) {
278
-
279
- //$html = TagFilter::Explode( $content, $tagFilterOptions );
280
- //
281
- ///**
282
- // * @since 2.0
283
- // *
284
- // * @param $selectors array Array of classes/id selector to exclude from TOC.
285
- // * @param $content string Post content.
286
- // */
287
- //$selectors = apply_filters( 'ez_toc_exclude_by_selector', array(), $content );
288
- //
289
- //$nodes = $html->Find( implode( ',', $selectors ) );
290
- //
291
- //foreach ( $nodes['ids'] as $id ) {
292
- //
293
- // $html->Remove( $id );
294
- //}
295
- //
296
- //$eligibleContent = $html->Implode( 0, $tagFilterOptions );
297
- //
298
- ///**
299
- // * TagFilter::Implode() writes br tags as `<br>` while WP normalizes to `<br />`.
300
- // * Normalize `$eligibleContent` to match WP.
301
- // *
302
- // * @see wpautop()
303
- // */
304
- ////$eligibleContent = str_replace( array( '<br>', '<br/>' ), array( '<br />' ), $eligibleContent );
305
- //$eligibleContent = \Easy_Plugins\Table_Of_Contents\String\force_balance_tags( $eligibleContent );
306
-
307
- $this->extractExcludedNodes( $page, $content );
308
-
309
- $pages[ $page ] = array(
310
- 'headings' => $this->extractHeadings( $content ),
311
- 'content' => $content,
312
- );
313
-
314
- $page++;
315
- }
316
-
317
- }
318
-
319
- $this->pages = $pages;
320
- }
321
-
322
- /**
323
- * Get the post's parse content and headings.
324
- *
325
- * @access public
326
- * @since 2.0
327
- *
328
- * @return array
329
- */
330
- public function getPages() {
331
-
332
- return $this->pages;
333
- }
334
-
335
- /**
336
- * Extract nodes that heading are to be excluded.
337
- *
338
- * @since 2.0
339
- *
340
- * @param int $page
341
- * @param string $content
342
- */
343
- private function extractExcludedNodes( $page, $content ) {
344
-
345
- if ( ! class_exists( 'TagFilter' ) ) {
346
-
347
- require_once( EZ_TOC_PATH . '/includes/vendor/ultimate-web-scraper/tag_filter.php' );
348
- }
349
-
350
- $tagFilterOptions = TagFilter::GetHTMLOptions();
351
-
352
- // Set custom TagFilter options.
353
- $tagFilterOptions['charset'] = get_option( 'blog_charset' );
354
- //$tagFilterOptions['output_mode'] = 'xml';
355
-
356
- $html = TagFilter::Explode( $content, $tagFilterOptions );
357
-
358
- /**
359
- * @since 2.0
360
- *
361
- * @param $selectors array Array of classes/id selector to exclude from TOC.
362
- * @param $content string Post content.
363
- */
364
- $selectors = apply_filters( 'ez_toc_exclude_by_selector', array( '.ez-toc-exclude-headings' ), $content );
365
-
366
- $nodes = $html->Find( implode( ',', $selectors ) );
367
- if(isset($nodes['ids'])){
368
- foreach ( $nodes['ids'] as $id ) {
369
-
370
- //$this->excludedNodes[ $page ][ $id ] = $html->Implode( $id, $tagFilterOptions );
371
- array_push( $this->excludedNodes, $html->Implode( $id, $tagFilterOptions ) );
372
- }
373
- }
374
- //$eligibleContent = $html->Implode( 0, $tagFilterOptions );
375
-
376
- /**
377
- * TagFilter::Implode() writes br tags as `<br>` while WP normalizes to `<br />`.
378
- * Normalize `$eligibleContent` to match WP.
379
- *
380
- * @see wpautop()
381
- */
382
- //$eligibleContent = \Easy_Plugins\Table_Of_Contents\String\force_balance_tags( $eligibleContent );
383
- }
384
-
385
- /**
386
- * Extract the posts content for headings.
387
- *
388
- * @access private
389
- * @since 2.0
390
- *
391
- * @param string $content
392
- *
393
- * @return array
394
- */
395
- private function extractHeadings( $content ) {
396
-
397
- $matches = array();
398
-
399
- // reset the internal collision collection as the_content may have been triggered elsewhere
400
- // eg by themes or other plugins that need to read in content such as metadata fields in
401
- // the head html tag, or to provide descriptions to twitter/facebook
402
- /** @todo does this need to be used??? */
403
- //self::$collision_collector = array();
404
-
405
- $content = apply_filters( 'ez_toc_extract_headings_content', wptexturize( $content ) );
406
-
407
- // get all headings
408
- // the html spec allows for a maximum of 6 heading depths
409
- if ( preg_match_all( '/(<h([1-6]{1})[^>]*>)(.*)<\/h\2>/msuU', $content, $matches, PREG_SET_ORDER ) ) {
410
-
411
- $minimum = absint( ezTOC_Option::get( 'start' ) );
412
-
413
- $this->removeHeadingsFromExcludedNodes( $matches );
414
- $this->removeHeadings( $matches );
415
- $this->excludeHeadings( $matches );
416
- $this->removeEmptyHeadings( $matches );
417
-
418
- if ( count( $matches ) >= $minimum ) {
419
-
420
- $this->alternateHeadings( $matches );
421
- $this->headingIDs( $matches );
422
- $this->hasTOCItems = true;
423
-
424
- } else {
425
-
426
- return array();
427
- }
428
-
429
- }
430
-
431
- return array_values( $matches ); // Rest the array index.
432
- }
433
-
434
- /**
435
- * Whether or not the string is in one of the excluded nodes.
436
- *
437
- * @since 2.0
438
- *
439
- * @param string $string
440
- *
441
- * @return bool
442
- */
443
- private function inExcludedNode( $string ) {
444
-
445
- foreach ( $this->excludedNodes as $node ) {
446
-
447
- if ( empty( $node ) || empty( $string ) ) {
448
-
449
- return false;
450
- }
451
-
452
- if ( false !== strpos( $node, $string ) ) {
453
-
454
- return true;
455
- }
456
- }
457
-
458
- return false;
459
- }
460
-
461
- /**
462
- * Remove headings that are in excluded nodes.
463
- *
464
- * @since 2.0
465
- *
466
- * @param array $matches
467
- *
468
- * @return array
469
- */
470
- private function removeHeadingsFromExcludedNodes( &$matches ) {
471
-
472
- foreach ( $matches as $i => $match ) {
473
-
474
- if ( $this->inExcludedNode( "{$match[3]}</h$match[2]>" ) ) {
475
-
476
- unset( $matches[ $i ] );
477
- }
478
- }
479
-
480
- return $matches;
481
- }
482
-
483
- /**
484
- * Get the heading levels to be included in the TOC.
485
- *
486
- * @access private
487
- * @since 2.0
488
- *
489
- * @return array
490
- */
491
- private function getHeadingLevels() {
492
-
493
- $levels = get_post_meta( $this->post->ID, '_ez-toc-heading-levels', true );
494
-
495
- if ( ! is_array( $levels ) ) {
496
-
497
- $levels = array();
498
- }
499
-
500
- if ( empty( $levels ) ) {
501
-
502
- $levels = ezTOC_Option::get( 'heading_levels', array() );
503
- }
504
-
505
- $this->headingLevels = $levels;
506
-
507
- return $this->headingLevels;
508
- }
509
-
510
- /**
511
- * Remove the heading levels as defined by user settings from the TOC heading matches.
512
- *
513
- * @see ezTOC_Post::extractHeadings()
514
- *
515
- * @access private
516
- * @since 2.0
517
- *
518
- * @param array $matches The heading from the post content extracted with preg_match_all().
519
- *
520
- * @return array
521
- */
522
- private function removeHeadings( &$matches ) {
523
-
524
- $levels = $this->getHeadingLevels();
525
-
526
- if ( count( $levels ) != 6 ) {
527
-
528
- $new_matches = array();
529
- //$count = count( $matches );
530
-
531
- //for ( $i = 0; $i < $count; $i++ ) {
532
- foreach ( $matches as $i => $match ) {
533
-
534
- if ( in_array( $matches[ $i ][2], $levels ) ) {
535
-
536
- $new_matches[ $i ] = $matches[ $i ];
537
- }
538
- }
539
-
540
- $matches = $new_matches;
541
- }
542
-
543
- return $matches;
544
- }
545
-
546
- /**
547
- * Exclude the heading, by title, as defined by the user settings from the TOC matches.
548
- *
549
- * @see ezTOC_Post::extractHeadings()
550
- *
551
- * @access private
552
- * @since 2.0
553
- *
554
- * @param array $matches The headings from the post content extracted with preg_match_all().
555
- *
556
- * @return array
557
- */
558
- private function excludeHeadings( &$matches ) {
559
-
560
- $exclude = get_post_meta( $this->post->ID, '_ez-toc-exclude', true );
561
-
562
- if ( empty( $exclude ) ) {
563
-
564
- $exclude = ezTOC_Option::get( 'exclude' );
565
- }
566
-
567
- if ( $exclude ) {
568
-
569
- $excluded_headings = explode( '|', $exclude );
570
- $excluded_count = count( $excluded_headings );
571
-
572
- if ( $excluded_count > 0 ) {
573
-
574
- for ( $j = 0; $j < $excluded_count; $j++ ) {
575
-
576
- $excluded_headings[ $j ] = preg_quote( $excluded_headings[ $j ] );
577
-
578
- // escape some regular expression characters
579
- // others: http://www.php.net/manual/en/regexp.reference.meta.php
580
- $excluded_headings[ $j ] = str_replace(
581
- array( '\*', '/', '%' ),
582
- array( '.*', '\/', '\%' ),
583
- trim( $excluded_headings[ $j ] )
584
- );
585
- }
586
-
587
- $new_matches = array();
588
- //$count = count( $matches );
589
-
590
- //for ( $i = 0; $i < $count; $i++ ) {
591
- foreach ( $matches as $i => $match ) {
592
-
593
- $found = false;
594
-
595
- $against = html_entity_decode(
596
- wptexturize( strip_tags( str_replace( array( "\r", "\n" ), ' ', $matches[ $i ][0] ) ) ),
597
- ENT_NOQUOTES,
598
- get_option( 'blog_charset' )
599
- );
600
-
601
- for ( $j = 0; $j < $excluded_count; $j++ ) {
602
-
603
- // Since WP manipulates the post content it is required that the excluded header and
604
- // the actual header be manipulated similarly so a match can be made.
605
- $pattern = html_entity_decode(
606
- wptexturize( $excluded_headings[ $j ] ),
607
- ENT_NOQUOTES,
608
- get_option( 'blog_charset' )
609
- );
610
-
611
- if ( @preg_match( '/^' . $pattern . '$/imU', $against ) ) {
612
-
613
- $found = true;
614
- break;
615
- }
616
- }
617
-
618
- if ( ! $found ) {
619
-
620
- $new_matches[ $i ] = $matches[ $i ];
621
- }
622
- }
623
-
624
- //if ( count( $matches ) != count( $new_matches ) ) {
625
-
626
- $matches = $new_matches;
627
- //}
628
- }
629
- }
630
-
631
- return $matches;
632
- }
633
-
634
- /**
635
- * Return the alternate headings added by the user, saved in the post meta.
636
- *
637
- * The result is an associative array where the `key` is the original post heading
638
- * and the `value` is the alternate heading.
639
- *
640
- * @access private
641
- * @since 2.0
642
- *
643
- * @return array
644
- */
645
- private function getAlternateHeadings() {
646
-
647
- $alternates = array();
648
- $value = get_post_meta( $this->post->ID, '_ez-toc-alttext', true );
649
-
650
- if ( $value ) {
651
-
652
- $headings = preg_split( '/\r\n|[\r\n]/', $value );
653
- $count = count( $headings );
654
-
655
- if ( $headings ) {
656
-
657
- for ( $k = 0; $k < $count; $k++ ) {
658
-
659
- $heading = explode( '|', $headings[ $k ] );
660
-
661
- /**
662
- * @link https://wordpress.org/support/topic/undefined-offset-1-home-blog-public-wp-content-plugins-easy-table-of-contents/
663
- */
664
- if ( ! is_array( $heading) ||
665
- ! array_key_exists( 0, $heading ) ||
666
- ! array_key_exists( 1, $heading )
667
- ) {
668
- continue;
669
- }
670
-
671
- if ( 0 < strlen( $heading[0] ) && 0 < strlen( $heading[1] ) ) {
672
-
673
- $alternates[ $heading[0] ] = $heading[1];
674
- }
675
- }
676
-
677
- }
678
-
679
- }
680
-
681
- return $alternates;
682
- }
683
-
684
- /**
685
- * Add the alternate headings to the array.
686
- *
687
- * @see ezTOC_Post::extractHeadings()
688
- *
689
- * @access private
690
- * @since 2.0
691
- *
692
- * @param array $matches The heading from the post content extracted with preg_match_all().
693
- *
694
- * @return array
695
- */
696
- private function alternateHeadings( &$matches ) {
697
-
698
- $alt_headings = $this->getAlternateHeadings();
699
- //$count = count( $matches );
700
-
701
- if ( 0 < count( $alt_headings ) ) {
702
-
703
- //for ( $i = 0; $i < $count; $i++ ) {
704
- foreach ( $matches as $i => $match ) {
705
-
706
- foreach ( $alt_headings as $original_heading => $alt_heading ) {
707
-
708
- // Cleanup and texturize so alt heading can match heading in post content.
709
- $original_heading = wptexturize( trim( $original_heading ) );
710
-
711
- // Deal with special characters such as non-breakable space.
712
- $original_heading = str_replace(
713
- array( "\xc2\xa0" ),
714
- array( ' ' ),
715
- $original_heading
716
- );
717
-
718
- // Escape for regular expression.
719
- $original_heading = preg_quote( $original_heading );
720
-
721
- // Escape for regular expression some other characters: http://www.php.net/manual/en/regexp.reference.meta.php
722
- $original_heading = str_replace(
723
- array( '\*', '/', '%' ),
724
- array( '.*', '\/', '\%' ),
725
- $original_heading
726
- );
727
-
728
- // Cleanup subject so alt heading can match heading in post content.
729
- $subject = strip_tags( $matches[ $i ][0] );
730
-
731
- // Deal with special characters such as non-breakable space.
732
- $subject = str_replace(
733
- array( "\xc2\xa0" ),
734
- array( ' ' ),
735
- $subject
736
- );
737
-
738
- if ( @preg_match( '/^' . $original_heading . '$/imU', $subject ) ) {
739
-
740
- $matches[ $i ]['alternate'] = $alt_heading;
741
- }
742
- }
743
- }
744
- }
745
-
746
- return $matches;
747
- }
748
-
749
- /**
750
- * Add the heading `id` to the array.
751
- *
752
- * @see ezTOC_Post::extractHeadings()
753
- *
754
- * @access private
755
- * @since 2.0
756
- *
757
- * @param array $matches The heading from the post content extracted with preg_match_all().
758
- *
759
- * @return mixed
760
- */
761
- private function headingIDs( &$matches ) {
762
-
763
- //$count = count( $matches );
764
-
765
- //for ( $i = 0; $i < $count; $i++ ) {
766
- foreach ( $matches as $i => $match ) {
767
-
768
- $matches[ $i ]['id'] = $this->generateHeadingIDFromTitle( $matches[ $i ][0] );
769
- }
770
-
771
- return $matches;
772
- }
773
-
774
- /**
775
- * Create unique heading ID from heading string.
776
- *
777
- * @access private
778
- * @since 2.0
779
- *
780
- * @param string $heading
781
- *
782
- * @return bool|string
783
- */
784
- private function generateHeadingIDFromTitle( $heading ) {
785
-
786
- $return = false;
787
-
788
- if ( $heading ) {
789
- $heading = apply_filters( 'ez_toc_url_anchor_target_before', $heading );
790
- // WP entity encodes the post content.
791
- $return = html_entity_decode( $heading, ENT_QUOTES, get_option( 'blog_charset' ) );
792
- $return = br2( $return, ' ' );
793
- $return = trim( strip_tags( $return ) );
794
-
795
- // Convert accented characters to ASCII.
796
- $return = remove_accents( $return );
797
-
798
- // replace newlines with spaces (eg when headings are split over multiple lines)
799
- $return = str_replace( array( "\r", "\n", "\n\r", "\r\n" ), ' ', $return );
800
-
801
- // Remove `&amp;` and `&nbsp;` NOTE: in order to strip "hidden" `&nbsp;`,
802
- // title needs to be converted to HTML entities.
803
- // @link https://stackoverflow.com/a/21801444/5351316
804
- $return = htmlentities2( $return );
805
- $return = str_replace( array( '&amp;', '&nbsp;'), ' ', $return );
806
- $return = str_replace( array( '&shy;' ),'', $return ); // removed silent hypen
807
- $return = html_entity_decode( $return, ENT_QUOTES, get_option( 'blog_charset' ) );
808
-
809
- // remove non alphanumeric chars
810
- //$return = preg_replace( '/[^a-zA-Z0-9 \-_]*/', '', $return );
811
- $return = preg_replace( '/[\x00-\x1F\x7F]*/u', '', $return );
812
-
813
- // Reserved Characters.
814
- // * ' ( ) ; : @ & = + $ , / ? # [ ]
815
- $return = str_replace(
816
- array( '*', '\'', '(', ')', ';', '@', '&', '=', '+', '$', ',', '/', '?', '#', '[', ']' ),
817
- '',
818
- $return
819
- );
820
-
821
- // Unsafe Characters.
822
- // % { } | \ ^ ~ [ ] `
823
- $return = str_replace(
824
- array( '%', '{', '}', '|', '\\', '^', '~', '[', ']', '`' ),
825
- '',
826
- $return
827
- );
828
-
829
- // Special Characters.
830
- // $ - _ . + ! * ' ( ) ,
831
- $return = str_replace(
832
- array( '$', '.', '+', '!', '*', '\'', '(', ')', ',' ),
833
- '',
834
- $return
835
- );
836
-
837
- // Dashes
838
- // Special Characters.
839
- // - (minus) - (dash) – (en dash) — (em dash)
840
- $return = str_replace(
841
- array( '-', '-', '–', '—' ),
842
- '-',
843
- $return
844
- );
845
-
846
- // Curley quotes.
847
- // ‘ (curly single open quote) ’ (curly single close quote) “ (curly double open quote) ” (curly double close quote)
848
- $return = str_replace(
849
- array( '‘', '’', '“', '”' ),
850
- '',
851
- $return
852
- );
853
-
854
- // AMP/Caching plugins seems to break URL with the following characters, so lets replace them.
855
- $return = str_replace( array( ':' ), '_', $return );
856
-
857
- // Convert space characters to an `_` (underscore).
858
- $return = preg_replace( '/\s+/', '_', $return );
859
-
860
- // Replace multiple `-` (hyphen) with a single `-` (hyphen).
861
- $return = preg_replace( '/-+/', '-', $return );
862
-
863
- // Replace multiple `_` (underscore) with a single `_` (underscore).
864
- $return = preg_replace( '/_+/', '_', $return );
865
-
866
- // Remove trailing `-` (hyphen) and `_` (underscore).
867
- $return = rtrim( $return, '-_' );
868
-
869
- /*
870
- * Encode URI based on ECMA-262.
871
- *
872
- * Only required to support the jQuery smoothScroll library.
873
- *
874
- * @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI#Description
875
- * @link https://stackoverflow.com/a/19858404/5351316
876
- */
877
- $return = preg_replace_callback(
878
- "{[^0-9a-z_.!~*'();,/?:@&=+$#-]}i",
879
- function( $m ) {
880
-
881
- return sprintf( '%%%02X', ord( $m[0] ) );
882
- },
883
- $return
884
- );
885
-
886
- // lowercase everything?
887
- if ( ezTOC_Option::get( 'lowercase' ) ) {
888
-
889
- $return = strtolower( $return );
890
- }
891
-
892
- // if blank, then prepend with the fragment prefix
893
- // blank anchors normally appear on sites that don't use the latin charset
894
- if ( ! $return ) {
895
-
896
- $return = ( ezTOC_Option::get( 'fragment_prefix' ) ) ? ezTOC_Option::get( 'fragment_prefix' ) : '_';
897
- }
898
-
899
- // hyphenate?
900
- if ( ezTOC_Option::get( 'hyphenate' ) ) {
901
-
902
- $return = str_replace( '_', '-', $return );
903
- $return = preg_replace( '/-+/', '-', $return );
904
- }
905
- }
906
-
907
- if ( array_key_exists( $return, $this->collision_collector ) ) {
908
-
909
- $this->collision_collector[ $return ]++;
910
- $return .= '-' . $this->collision_collector[ $return ];
911
-
912
- } else {
913
-
914
- $this->collision_collector[ $return ] = 1;
915
- }
916
-
917
- return apply_filters( 'ez_toc_url_anchor_target', $return, $heading );
918
- }
919
-
920
- /**
921
- * Remove any empty headings from the TOC.
922
- *
923
- * @access private
924
- * @since 2.0
925
- *
926
- * @param array $matches The heading from the post content extracted with preg_match_all().
927
- *
928
- * @return array
929
- */
930
- private function removeEmptyHeadings( &$matches ) {
931
-
932
- $new_matches = array();
933
- //$count = count( $matches );
934
-
935
- //for ( $i = 0; $i < $count; $i ++ ) {
936
- foreach ( $matches as $i => $match ) {
937
-
938
- if ( trim( strip_tags( $matches[ $i ][0] ) ) != false ) {
939
-
940
- $new_matches[ $i ] = $matches[ $i ];
941
- }
942
- }
943
-
944
- //if ( count( $matches ) != count( $new_matches ) ) {
945
-
946
- $matches = $new_matches;
947
- //}
948
-
949
- return $matches;
950
- }
951
-
952
- /**
953
- * Whether or not the post has TOC items.
954
- *
955
- * @see ezTOC_Post::extractHeadings()
956
- *
957
- * @access public
958
- * @since 2.0
959
- *
960
- * @return bool
961
- */
962
- public function hasTOCItems() {
963
-
964
- return $this->hasTOCItems;
965
- }
966
-
967
- /**
968
- * Get the headings of the current page of the post.
969
- *
970
- * @access public
971
- * @since 2.0
972
- *
973
- * @param int|null $page
974
- *
975
- * @return array
976
- */
977
- public function getHeadings( $page = null ) {
978
-
979
- $headings = array();
980
-
981
- if ( is_null( $page ) ) {
982
-
983
- $page = $this->getCurrentPage();
984
- }
985
-
986
- if ( isset( $this->pages[ $page ] ) ) {
987
-
988
- //$headings = wp_list_pluck( $this->pages[ $page ]['headings'], 0 );
989
-
990
- $matches = $this->pages[ $page ]['headings'];
991
- //$count = count( $matches );
992
-
993
- //for ( $i = 0; $i < $count; $i++ ) {
994
- foreach ( $matches as $i => $match ) {
995
-
996
- //$anchor = $matches[ $i ]['id'];
997
- $headings[] = str_replace(
998
- array(
999
- $matches[ $i ][1], // start of heading
1000
- '</h' . $matches[ $i ][2] . '>' // end of heading
1001
- ),
1002
- array(
1003
- '>',
1004
- '</h' . $matches[ $i ][2] . '>'
1005
- ),
1006
- $matches[ $i ][0]
1007
- );
1008
- }
1009
- }
1010
-
1011
- return $headings;
1012
- }
1013
-
1014
- /**
1015
- * Get the heading with in page anchors of the current page of the post.
1016
- *
1017
- * @access public
1018
- * @since 2.0
1019
- *
1020
- * @param int|null $page
1021
- *
1022
- * @return array
1023
- */
1024
- public function getHeadingsWithAnchors( $page = null ) {
1025
-
1026
- $headings = array();
1027
-
1028
- if ( is_null( $page ) ) {
1029
-
1030
- $page = $this->getCurrentPage();
1031
- }
1032
-
1033
- if ( isset( $this->pages[ $page ] ) ) {
1034
-
1035
- $matches = $this->pages[ $page ]['headings'];
1036
- //$count = count( $matches );
1037
-
1038
- //for ( $i = 0; $i < $count; $i++ ) {
1039
- foreach ( $matches as $i => $match ) {
1040
-
1041
- $anchor = $matches[ $i ]['id'];
1042
- if (ezTOC_Option::get( 'remove_special_chars_from_title' )) {
1043
- $matches[ $i ][0] = str_replace(':', '', $matches[ $i ][0]);
1044
- }
1045
-
1046
- $headings[] = str_replace(
1047
- array(
1048
- $matches[ $i ][1], // start of heading
1049
- '</h' . $matches[ $i ][2] . '>' // end of heading
1050
- ),
1051
- array(
1052
- '><span class="ez-toc-section" id="' . $anchor . '"></span>',
1053
- '<span class="ez-toc-section-end"></span></h' . $matches[ $i ][2] . '>'
1054
- ),
1055
- $matches[ $i ][0]
1056
- );
1057
- }
1058
- }
1059
-
1060
- return $headings;
1061
- }
1062
-
1063
- /**
1064
- * Get the post TOC list.
1065
- *
1066
- * @access public
1067
- * @since 2.0
1068
- *
1069
- * @return string
1070
- */
1071
- public function getTOCList() {
1072
-
1073
- $html = '';
1074
-
1075
- if ( $this->hasTOCItems ) {
1076
-
1077
- foreach ( $this->pages as $page => $attribute ) {
1078
-
1079
- $html .= $this->createTOC( $page, $attribute['headings'] );
1080
- }
1081
-
1082
- $html = '<ul class="ez-toc-list ez-toc-list-level-1">' . $html . '</ul>';
1083
- }
1084
-
1085
- return $html;
1086
- }
1087
-
1088
- /**
1089
- * Get the post TOC content block.
1090
- *
1091
- * @access public
1092
- * @since 2.0
1093
- *
1094
- * @return string
1095
- */
1096
- public function getTOC() {
1097
-
1098
- $class = array( 'ez-toc-v' . str_replace( '.', '_', ezTOC::VERSION ) );
1099
- $html = '';
1100
-
1101
- if ( $this->hasTOCItems() ) {
1102
-
1103
- // wrapping css classes
1104
- switch ( ezTOC_Option::get( 'wrapping' ) ) {
1105
-
1106
- case 'left':
1107
- $class[] = 'ez-toc-wrap-left';
1108
- break;
1109
-
1110
- case 'right':
1111
- $class[] = 'ez-toc-wrap-right';
1112
- break;
1113
- case 'center':
1114
- $class[] = 'ez-toc-wrap-center';
1115
- break;
1116
-
1117
- case 'none':
1118
- default:
1119
- // do nothing
1120
- }
1121
-
1122
- if ( ezTOC_Option::get( 'show_hierarchy' ) ) {
1123
-
1124
- $class[] = 'counter-hierarchy';
1125
-
1126
- } else {
1127
-
1128
- $class[] .= 'counter-flat';
1129
- }
1130
-
1131
- switch ( ezTOC_Option::get( 'counter' ) ) {
1132
-
1133
- case 'numeric':
1134
- $class[] .= 'counter-numeric';
1135
- break;
1136
-
1137
- case 'roman':
1138
- $class[] = 'counter-roman';
1139
- break;
1140
-
1141
- case 'decimal':
1142
- $class[] = 'counter-decimal';
1143
- break;
1144
-
1145
- case 'hyphen':
1146
- $class[] = 'counter-hyphen';
1147
- break;
1148
-
1149
- case 'disc':
1150
- $class[] = 'counter-disc';
1151
- break;
1152
- }
1153
-
1154
- // colour themes
1155
- switch ( ezTOC_Option::get( 'theme' ) ) {
1156
-
1157
- case 'light-blue':
1158
- $class[] = 'ez-toc-light-blue';
1159
- break;
1160
-
1161
- case 'white':
1162
- $class[] = 'ez-toc-white';
1163
- break;
1164
-
1165
- case 'black':
1166
- $class[] = 'ez-toc-black';
1167
- break;
1168
-
1169
- case 'transparent':
1170
- $class[] .= 'ez-toc-transparent';
1171
- break;
1172
-
1173
- case 'grey':
1174
- $class[] = 'ez-toc-grey';
1175
- break;
1176
- }
1177
-
1178
- $custom_classes = ezTOC_Option::get( 'css_container_class', '' );
1179
-
1180
- $position = ezTOC_Option::get( 'position' );
1181
- if($position == 'afterpara'){
1182
- $custom_classes .= "afterpara";
1183
- }
1184
-
1185
- if ( 0 < strlen( $custom_classes ) ) {
1186
-
1187
- $custom_classes = explode( ' ', $custom_classes );
1188
- $custom_classes = apply_filters( 'ez_toc_container_class', $custom_classes, $this );
1189
-
1190
- if ( is_array( $custom_classes ) ) {
1191
-
1192
- $class = array_merge( $class, $custom_classes );
1193
- }
1194
- }
1195
-
1196
- $class = array_filter( $class );
1197
- $class = array_map( 'trim', $class );
1198
- $class = array_map( 'sanitize_html_class', $class );
1199
- $html .= '<div id="ez-toc-container" class="' . implode( ' ', $class ) . '">' . PHP_EOL;
1200
-
1201
- if ( ezTOC_Option::get( 'show_heading_text' ) ) {
1202
-
1203
- $toc_title = ezTOC_Option::get( 'heading_text' );
1204
-
1205
- if ( strpos( $toc_title, '%PAGE_TITLE%' ) !== false ) {
1206
-
1207
- $toc_title = str_replace( '%PAGE_TITLE%', get_the_title(), $toc_title );
1208
- }
1209
-
1210
- if ( strpos( $toc_title, '%PAGE_NAME%' ) !== false ) {
1211
-
1212
- $toc_title = str_replace( '%PAGE_NAME%', get_the_title(), $toc_title );
1213
- }
1214
-
1215
- if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1216
- $html .= '<div class="ez-toc-title-container">' . PHP_EOL;
1217
- }
1218
-
1219
- $html .= '<p class="ez-toc-title">' . esc_html__( htmlentities( $toc_title, ENT_COMPAT, 'UTF-8' ), 'easy-table-of-contents' ). '</p>' . PHP_EOL;
1220
-
1221
- if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1222
- $html .= '<span class="ez-toc-title-toggle">';
1223
- }
1224
-
1225
- if ( ezTOC_Option::get( 'visibility' ) ) {
1226
- if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1227
- $icon = '<i class="ez-toc-glyphicon ez-toc-icon-toggle"></i>';
1228
- if(function_exists('ez_toc_pro_activation_link')){
1229
- $icon = apply_filters('ez_toc_modify_icon',$icon);
1230
- }
1231
- $html .= '<a href="#" class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" style="display: none;"><label for="item" aria-label="'.__( 'Table of Content', 'easy-table-of-contents' ).'">'.$icon.'</label><input type="checkbox" id="item"></a>';
1232
- }else{
1233
- $toggle_view='';
1234
- if(ezTOC_Option::get('visibility_hide_by_default')==true){
1235
- $toggle_view= "checked";
1236
- }
1237
- $html .= '<label for="item" class="cssicon"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></label><label for="item" class="cssiconcheckbox">1</label><input type="checkbox" id="item" '.$toggle_view.'>';
1238
- }
1239
- }
1240
-
1241
- if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1242
- $html .= '</span>';
1243
- }
1244
- if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1245
- $html .= '</div>' . PHP_EOL;
1246
- }
1247
- }else{
1248
- $html .= '<div class="ez-toc-title-container">' . PHP_EOL;
1249
- $html .= '<span class="ez-toc-title-toggle">';
1250
- $html .= '<a class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" style="display: none;"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></a>';
1251
- $html .= '</span>';
1252
- $html .= '</div>' . PHP_EOL;
1253
- }
1254
-
1255
- ob_start();
1256
- do_action( 'ez_toc_before' );
1257
- $html .= ob_get_clean();
1258
-
1259
- $html .= '<nav>' . $this->getTOCList() . '</nav>';
1260
-
1261
- ob_start();
1262
- do_action( 'ez_toc_after' );
1263
- $html .= ob_get_clean();
1264
-
1265
- $html .= '</div>' . PHP_EOL;
1266
-
1267
- // Enqueue the script.
1268
- wp_enqueue_script( 'ez-toc-js' );
1269
- }
1270
-
1271
- return $html;
1272
- }
1273
-
1274
- /**
1275
- * Displays the post's TOC.
1276
- *
1277
- * @access public
1278
- * @since 2.0
1279
- */
1280
- public function toc() {
1281
-
1282
- echo $this->getTOC();
1283
- }
1284
-
1285
- /**
1286
- * Generate the TOC list items for a given page within a post.
1287
- *
1288
- * @access private
1289
- * @since 2.0
1290
- *
1291
- * @param int $page The page of the post to create the TOC items for.
1292
- * @param array $matches The heading from the post content extracted with preg_match_all().
1293
- *
1294
- * @return string The HTML list of TOC items.
1295
- */
1296
- private function createTOC( $page, $matches ) {
1297
-
1298
- // Whether or not the TOC should be built flat or hierarchical.
1299
- $hierarchical = ezTOC_Option::get( 'show_hierarchy' );
1300
- $html = '';
1301
-
1302
- if ( $hierarchical ) {
1303
-
1304
- $current_depth = 100; // headings can't be larger than h6 but 100 as a default to be sure
1305
- $numbered_items = array();
1306
- $numbered_items_min = null;
1307
-
1308
- // reset the internal collision collection
1309
- /** @todo does this need to be used??? */
1310
- //self::$collision_collector = array();
1311
-
1312
- // find the minimum heading to establish our baseline
1313
- //for ( $i = 0; $i < count( $matches ); $i ++ ) {
1314
- foreach ( $matches as $i => $match ) {
1315
- if ( $current_depth > $matches[ $i ][2] ) {
1316
- $current_depth = (int) $matches[ $i ][2];
1317
- }
1318
- }
1319
-
1320
- $numbered_items[ $current_depth ] = 0;
1321
- $numbered_items_min = $current_depth;
1322
-
1323
- //for ( $i = 0; $i < count( $matches ); $i ++ ) {
1324
- foreach ( $matches as $i => $match ) {
1325
-
1326
- $level = $matches[ $i ][2];
1327
- $count = $i + 1;
1328
-
1329
- if ( $current_depth == (int) $matches[ $i ][2] ) {
1330
-
1331
- $html .= '<li class="ez-toc-page-' . $page . ' ez-toc-heading-level-' . $current_depth . '">';
1332
- }
1333
-
1334
- // start lists
1335
- if ( $current_depth != (int) $matches[ $i ][2] ) {
1336
-
1337
- for ( $current_depth; $current_depth < (int) $matches[ $i ][2]; $current_depth++ ) {
1338
-
1339
- $numbered_items[ $current_depth + 1 ] = 0;
1340
- $html .= '<ul class="ez-toc-list-level-' . $level . '"><li class="ez-toc-heading-level-' . $level . '">';
1341
- }
1342
- }
1343
-
1344
- $title = isset( $matches[ $i ]['alternate'] ) ? $matches[ $i ]['alternate'] : $matches[ $i ][0];
1345
- $title = br2( $title, ' ' );
1346
- $title = strip_tags( apply_filters( 'ez_toc_title', $title ), apply_filters( 'ez_toc_title_allowable_tags', '' ) );
1347
-
1348
- $html .= $this->createTOCItemAnchor( $page, $matches[ $i ]['id'], $title, $count );
1349
-
1350
- // end lists
1351
- if ( $i != count( $matches ) - 1 ) {
1352
-
1353
- if ( $current_depth > (int) $matches[ $i + 1 ][2] ) {
1354
-
1355
- for ( $current_depth; $current_depth > (int) $matches[ $i + 1 ][2]; $current_depth-- ) {
1356
-
1357
- $html .= '</li></ul>';
1358
- $numbered_items[ $current_depth ] = 0;
1359
- }
1360
- }
1361
-
1362
- if ( $current_depth == (int) @$matches[ $i + 1 ][2] ) {
1363
-
1364
- $html .= '</li>';
1365
- }
1366
-
1367
- } else {
1368
-
1369
- // this is the last item, make sure we close off all tags
1370
- for ( $current_depth; $current_depth >= $numbered_items_min; $current_depth-- ) {
1371
-
1372
- $html .= '</li>';
1373
-
1374
- if ( $current_depth != $numbered_items_min ) {
1375
- $html .= '</ul>';
1376
- }
1377
- }
1378
- }
1379
- }
1380
-
1381
- } else {
1382
-
1383
- //for ( $i = 0; $i < count( $matches ); $i++ ) {
1384
- foreach ( $matches as $i => $match ) {
1385
-
1386
- $count = $i + 1;
1387
-
1388
- $title = isset( $matches[ $i ]['alternate'] ) ? $matches[ $i ]['alternate'] : $matches[ $i ][0];
1389
- $title = strip_tags( apply_filters( 'ez_toc_title', $title ), apply_filters( 'ez_toc_title_allowable_tags', '' ) );
1390
-
1391
- $html .= '<li class="ez-toc-page-' . $page . '">';
1392
-
1393
- $html .= $this->createTOCItemAnchor( $page, $matches[ $i ]['id'], $title, $count );
1394
-
1395
- $html .= '</li>';
1396
- }
1397
- }
1398
-
1399
- return do_shortcode($html);
1400
- }
1401
-
1402
- /**
1403
- * @access private
1404
- * @since 2.0
1405
- *
1406
- * @param int $page
1407
- * @param string $id
1408
- * @param string $title
1409
- * @param int $count
1410
- *
1411
- * @return string
1412
- */
1413
- private function createTOCItemAnchor( $page, $id, $title, $count ) {
1414
- if (ezTOC_Option::get( 'remove_special_chars_from_title' )) {
1415
- $title = str_replace(':', '', $title);
1416
- }
1417
-
1418
- return sprintf(
1419
- '<a class="ez-toc-link ez-toc-heading-' . $count . '" href="%1$s" title="%2$s">%3$s</a>',
1420
- esc_attr( $this->createTOCItemURL( $id, $page ) ),
1421
- esc_attr( strip_tags( $title ) ),
1422
- $title
1423
- );
1424
- }
1425
-
1426
- /**
1427
- * @access private
1428
- * @since 2.0
1429
- *
1430
- * @param string $id
1431
- * @param int $page
1432
- *
1433
- * @return string
1434
- */
1435
- private function createTOCItemURL( $id, $page ) {
1436
-
1437
- $current_post = $this->post->ID === $this->queriedObjectID;
1438
- $current_page = $this->getCurrentPage();
1439
-
1440
- if ( $page === $current_page && $current_post ) {
1441
-
1442
- return '#' . $id;
1443
-
1444
- } elseif ( 1 === $page ) {
1445
-
1446
- return trailingslashit( $this->permalink ) . '#' . $id;
1447
-
1448
- }
1449
-
1450
- return trailingslashit( $this->permalink ) . $page . '/#' . $id;
1451
- }
1452
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use function Easy_Plugins\Table_Of_Contents\String\br2;
4
+
5
+ class ezTOC_Post {
6
+
7
+ /**
8
+ * @since 2.0
9
+ * @var int
10
+ */
11
+ private $queriedObjectID;
12
+
13
+ /**
14
+ * @since 2.0
15
+ * @var WP_Post
16
+ */
17
+ private $post;
18
+
19
+ /**
20
+ * @since 2.0
21
+ * @var false|string
22
+ */
23
+ private $permalink;
24
+
25
+ /**
26
+ * The post content broken into pages by user inserting `<!--nextpage-->` into the post content.
27
+ * @see ezTOC_Post::extractPages()
28
+ * @since 2.0
29
+ * @var array
30
+ */
31
+ private $pages = array();
32
+
33
+ /**
34
+ * The user defined heading levels to be included in the TOC.
35
+ * @see ezTOC_Post::getHeadingLevels()
36
+ * @since 2.0
37
+ * @var array
38
+ */
39
+ private $headingLevels = array();
40
+
41
+ /**
42
+ * Array of nodes that are excluded by class/id selector.
43
+ * @since 2.0
44
+ * @var string[]
45
+ */
46
+ private $excludedNodes = array();
47
+
48
+ /**
49
+ * Keeps a track of used anchors for collision detecting.
50
+ * @see ezTOC_Post::generateHeadingIDFromTitle()
51
+ * @since 2.0
52
+ * @var array
53
+ */
54
+ private $collision_collector = array();
55
+
56
+ /**
57
+ * @var bool
58
+ */
59
+ private $hasTOCItems = false;
60
+
61
+ /**
62
+ * ezTOC_Post constructor.
63
+ *
64
+ * @since 2.0
65
+ *
66
+ * @param WP_Post $post
67
+ * @param bool $apply_content_filter Whether or not to apply the `the_content` filter on the post content.
68
+ */
69
+ public function __construct( WP_Post $post, $apply_content_filter = true ) {
70
+
71
+ $this->post = $post;
72
+ $this->permalink = get_permalink( $post );
73
+ $this->queriedObjectID = get_queried_object_id();
74
+
75
+ if ( $apply_content_filter ) {
76
+
77
+ $this->applyContentFilter()->process();
78
+
79
+ } else {
80
+
81
+ $this->process();
82
+ }
83
+ }
84
+
85
+ /**
86
+ * @access public
87
+ * @since 2.0
88
+ *
89
+ * @param $id
90
+ *
91
+ * @return ezTOC_Post|null
92
+ */
93
+ public static function get( $id ) {
94
+
95
+ $post = get_post( $id );
96
+
97
+ if ( ! $post instanceof WP_Post ) {
98
+
99
+ return null;
100
+ }
101
+
102
+ return new static( $post );
103
+ }
104
+
105
+ /**
106
+ * Process post content for headings.
107
+ *
108
+ * This must be run after object init or after @see ezTOC_Post::applyContentFilter().
109
+ *
110
+ * @since 2.0
111
+ *
112
+ * @return static
113
+ */
114
+ private function process() {
115
+
116
+ $this->processPages();
117
+
118
+ return $this;
119
+ }
120
+
121
+ /**
122
+ * Apply `the_content` filter to the post content.
123
+ *
124
+ * @since 2.0
125
+ *
126
+ * @return static
127
+ */
128
+ private function applyContentFilter() {
129
+
130
+ add_filter( 'strip_shortcodes_tagnames', array( __CLASS__, 'stripShortcodes' ), 10, 2 );
131
+
132
+ /*
133
+ * Ensure the ezTOC content filter is not applied when running `the_content` filter.
134
+ */
135
+ remove_filter( 'the_content', array( 'ezTOC', 'the_content' ), 100 );
136
+
137
+ $this->post->post_content = apply_filters( 'the_content', strip_shortcodes( $this->post->post_content ) );
138
+
139
+ add_filter( 'the_content', array( 'ezTOC', 'the_content' ), 100 ); // increased priority to fix other plugin filter overwriting our changes
140
+
141
+ remove_filter( 'strip_shortcodes_tagnames', array( __CLASS__, 'stripShortcodes' ) );
142
+
143
+ return $this;
144
+ }
145
+
146
+ /**
147
+ * Callback for the `strip_shortcodes_tagnames` filter.
148
+ *
149
+ * Strip the shortcodes so their content is no processed for headings.
150
+ *
151
+ * @see ezTOC_Post::applyContentFilter()
152
+ *
153
+ * @since 2.0
154
+ *
155
+ * @param array $tags_to_remove Array of shortcode tags to remove.
156
+ * @param string $content Content shortcodes are being removed from.
157
+ *
158
+ * @return array
159
+ */
160
+ public static function stripShortcodes( $tags_to_remove, $content ) {
161
+
162
+ //error_log( var_export( $tags_to_remove, true ) );
163
+
164
+ /*
165
+ * Ensure the ezTOC shortcodes are not processed when applying `the_content` filter
166
+ * otherwise an infinite loop may occur.
167
+ */
168
+ $tags_to_remove = apply_filters(
169
+ 'ez_toc_strip_shortcodes_tagnames',
170
+ array(
171
+ 'ez-toc',
172
+ apply_filters( 'ez_toc_shortcode', 'toc' ),
173
+ ),
174
+ $content
175
+ );
176
+
177
+ //error_log( var_export( $tags_to_remove, true ) );
178
+
179
+ return $tags_to_remove;
180
+ }
181
+
182
+ /**
183
+ * This is a work around for theme's and plugins
184
+ * which break the WordPress global $wp_query var by unsetting it
185
+ * or overwriting it which breaks the method call
186
+ * that `get_query_var()` uses to return the query variable.
187
+ *
188
+ * @access protected
189
+ * @since 2.0
190
+ *
191
+ * @return int
192
+ */
193
+ protected function getCurrentPage() {
194
+
195
+ global $wp_query;
196
+
197
+ // Check to see if the global `$wp_query` var is an instance of WP_Query and that the get() method is callable.
198
+ // If it is then when can simply use the get_query_var() function.
199
+ if ( $wp_query instanceof WP_Query && is_callable( array( $wp_query, 'get' ) ) ) {
200
+
201
+ $page = get_query_var( 'page', 1 );
202
+
203
+ return 1 > $page ? 1 : $page;
204
+
205
+ // If a theme or plugin broke the global `$wp_query` var, check to see if the $var was parsed and saved in $GLOBALS['wp_query']->query_vars.
206
+ } elseif ( isset( $GLOBALS['wp_query']->query_vars[ 'page' ] ) ) {
207
+
208
+ return $GLOBALS['wp_query']->query_vars[ 'page' ];
209
+
210
+ // We should not reach this, but if we do, lets check the original parsed query vars in $GLOBALS['wp_the_query']->query_vars.
211
+ } elseif ( isset( $GLOBALS['wp_the_query']->query_vars[ 'page' ] ) ) {
212
+
213
+ return $GLOBALS['wp_the_query']->query_vars[ 'page' ];
214
+
215
+ // Ok, if all else fails, check the $_REQUEST super global.
216
+ } elseif ( isset( $_REQUEST[ 'page' ] ) ) {
217
+
218
+ return $_REQUEST[ 'page' ];
219
+ }
220
+
221
+ // Finally, return the $default if it was supplied.
222
+ return 1;
223
+ }
224
+
225
+ /**
226
+ * Get the number of page the post has.
227
+ *
228
+ * @access protected
229
+ * @since 2.0
230
+ *
231
+ * @return int
232
+ */
233
+ protected function getNumberOfPages() {
234
+
235
+ return count( $this->pages );
236
+ }
237
+
238
+ /**
239
+ * Whether or not the post has multiple pages.
240
+ *
241
+ * @access protected
242
+ * @since 2.0
243
+ *
244
+ * @return bool
245
+ */
246
+ protected function isMultipage() {
247
+
248
+ return 1 < $this->getNumberOfPages();
249
+ }
250
+
251
+ /**
252
+ * Parse the post content and headings.
253
+ *
254
+ * @access private
255
+ * @since 2.0
256
+ */
257
+ private function processPages() {
258
+
259
+ //if ( ! class_exists( 'TagFilter' ) ) {
260
+ //
261
+ // require_once( EZ_TOC_PATH . '/includes/vendor/ultimate-web-scraper/tag_filter.php' );
262
+ //}
263
+
264
+ $split = preg_split( '/<!--nextpage-->/msuU', $this->post->post_content );
265
+ $pages = array();
266
+
267
+ if ( is_array( $split ) ) {
268
+
269
+ $page = 1;
270
+
271
+ //$tagFilterOptions = TagFilter::GetHTMLOptions();
272
+
273
+ //// Set custom TagFilter options.
274
+ //$tagFilterOptions['charset'] = get_option( 'blog_charset' );
275
+ ////$tagFilterOptions['output_mode'] = 'xml';
276
+
277
+ foreach ( $split as $content ) {
278
+
279
+ //$html = TagFilter::Explode( $content, $tagFilterOptions );
280
+ //
281
+ ///**
282
+ // * @since 2.0
283
+ // *
284
+ // * @param $selectors array Array of classes/id selector to exclude from TOC.
285
+ // * @param $content string Post content.
286
+ // */
287
+ //$selectors = apply_filters( 'ez_toc_exclude_by_selector', array(), $content );
288
+ //
289
+ //$nodes = $html->Find( implode( ',', $selectors ) );
290
+ //
291
+ //foreach ( $nodes['ids'] as $id ) {
292
+ //
293
+ // $html->Remove( $id );
294
+ //}
295
+ //
296
+ //$eligibleContent = $html->Implode( 0, $tagFilterOptions );
297
+ //
298
+ ///**
299
+ // * TagFilter::Implode() writes br tags as `<br>` while WP normalizes to `<br />`.
300
+ // * Normalize `$eligibleContent` to match WP.
301
+ // *
302
+ // * @see wpautop()
303
+ // */
304
+ ////$eligibleContent = str_replace( array( '<br>', '<br/>' ), array( '<br />' ), $eligibleContent );
305
+ //$eligibleContent = \Easy_Plugins\Table_Of_Contents\String\force_balance_tags( $eligibleContent );
306
+
307
+ $this->extractExcludedNodes( $page, $content );
308
+
309
+ $pages[ $page ] = array(
310
+ 'headings' => $this->extractHeadings( $content ),
311
+ 'content' => $content,
312
+ );
313
+
314
+ $page++;
315
+ }
316
+
317
+ }
318
+
319
+ $this->pages = $pages;
320
+ }
321
+
322
+ /**
323
+ * Get the post's parse content and headings.
324
+ *
325
+ * @access public
326
+ * @since 2.0
327
+ *
328
+ * @return array
329
+ */
330
+ public function getPages() {
331
+
332
+ return $this->pages;
333
+ }
334
+
335
+ /**
336
+ * Extract nodes that heading are to be excluded.
337
+ *
338
+ * @since 2.0
339
+ *
340
+ * @param int $page
341
+ * @param string $content
342
+ */
343
+ private function extractExcludedNodes( $page, $content ) {
344
+
345
+ if ( ! class_exists( 'TagFilter' ) ) {
346
+
347
+ require_once( EZ_TOC_PATH . '/includes/vendor/ultimate-web-scraper/tag_filter.php' );
348
+ }
349
+
350
+ $tagFilterOptions = TagFilter::GetHTMLOptions();
351
+
352
+ // Set custom TagFilter options.
353
+ $tagFilterOptions['charset'] = get_option( 'blog_charset' );
354
+ //$tagFilterOptions['output_mode'] = 'xml';
355
+
356
+ $html = TagFilter::Explode( $content, $tagFilterOptions );
357
+
358
+ /**
359
+ * @since 2.0
360
+ *
361
+ * @param $selectors array Array of classes/id selector to exclude from TOC.
362
+ * @param $content string Post content.
363
+ */
364
+ $selectors = apply_filters( 'ez_toc_exclude_by_selector', array( '.ez-toc-exclude-headings' ), $content );
365
+
366
+ $nodes = $html->Find( implode( ',', $selectors ) );
367
+ if(isset($nodes['ids'])){
368
+ foreach ( $nodes['ids'] as $id ) {
369
+
370
+ //$this->excludedNodes[ $page ][ $id ] = $html->Implode( $id, $tagFilterOptions );
371
+ array_push( $this->excludedNodes, $html->Implode( $id, $tagFilterOptions ) );
372
+ }
373
+ }
374
+ //$eligibleContent = $html->Implode( 0, $tagFilterOptions );
375
+
376
+ /**
377
+ * TagFilter::Implode() writes br tags as `<br>` while WP normalizes to `<br />`.
378
+ * Normalize `$eligibleContent` to match WP.
379
+ *
380
+ * @see wpautop()
381
+ */
382
+ //$eligibleContent = \Easy_Plugins\Table_Of_Contents\String\force_balance_tags( $eligibleContent );
383
+ }
384
+
385
+ /**
386
+ * Extract the posts content for headings.
387
+ *
388
+ * @access private
389
+ * @since 2.0
390
+ *
391
+ * @param string $content
392
+ *
393
+ * @return array
394
+ */
395
+ private function extractHeadings( $content ) {
396
+
397
+ $matches = array();
398
+
399
+ // reset the internal collision collection as the_content may have been triggered elsewhere
400
+ // eg by themes or other plugins that need to read in content such as metadata fields in
401
+ // the head html tag, or to provide descriptions to twitter/facebook
402
+ /** @todo does this need to be used??? */
403
+ //self::$collision_collector = array();
404
+
405
+ $content = apply_filters( 'ez_toc_extract_headings_content', wptexturize( $content ) );
406
+
407
+ // get all headings
408
+ // the html spec allows for a maximum of 6 heading depths
409
+ if ( preg_match_all( '/(<h([1-6]{1})[^>]*>)(.*)<\/h\2>/msuU', $content, $matches, PREG_SET_ORDER ) ) {
410
+
411
+ $minimum = absint( ezTOC_Option::get( 'start' ) );
412
+
413
+ $this->removeHeadingsFromExcludedNodes( $matches );
414
+ $this->removeHeadings( $matches );
415
+ $this->excludeHeadings( $matches );
416
+ $this->removeEmptyHeadings( $matches );
417
+
418
+ if ( count( $matches ) >= $minimum ) {
419
+
420
+ $this->alternateHeadings( $matches );
421
+ $this->headingIDs( $matches );
422
+ $this->hasTOCItems = true;
423
+
424
+ } else {
425
+
426
+ return array();
427
+ }
428
+
429
+ }
430
+
431
+ return array_values( $matches ); // Rest the array index.
432
+ }
433
+
434
+ /**
435
+ * Whether or not the string is in one of the excluded nodes.
436
+ *
437
+ * @since 2.0
438
+ *
439
+ * @param string $string
440
+ *
441
+ * @return bool
442
+ */
443
+ private function inExcludedNode( $string ) {
444
+
445
+ foreach ( $this->excludedNodes as $node ) {
446
+
447
+ if ( empty( $node ) || empty( $string ) ) {
448
+
449
+ return false;
450
+ }
451
+
452
+ if ( false !== strpos( $node, $string ) ) {
453
+
454
+ return true;
455
+ }
456
+ }
457
+
458
+ return false;
459
+ }
460
+
461
+ /**
462
+ * Remove headings that are in excluded nodes.
463
+ *
464
+ * @since 2.0
465
+ *
466
+ * @param array $matches
467
+ *
468
+ * @return array
469
+ */
470
+ private function removeHeadingsFromExcludedNodes( &$matches ) {
471
+
472
+ foreach ( $matches as $i => $match ) {
473
+
474
+ if ( $this->inExcludedNode( "{$match[3]}</h$match[2]>" ) ) {
475
+
476
+ unset( $matches[ $i ] );
477
+ }
478
+ }
479
+
480
+ return $matches;
481
+ }
482
+
483
+ /**
484
+ * Get the heading levels to be included in the TOC.
485
+ *
486
+ * @access private
487
+ * @since 2.0
488
+ *
489
+ * @return array
490
+ */
491
+ private function getHeadingLevels() {
492
+
493
+ $levels = get_post_meta( $this->post->ID, '_ez-toc-heading-levels', true );
494
+
495
+ if ( ! is_array( $levels ) ) {
496
+
497
+ $levels = array();
498
+ }
499
+
500
+ if ( empty( $levels ) ) {
501
+
502
+ $levels = ezTOC_Option::get( 'heading_levels', array() );
503
+ }
504
+
505
+ $this->headingLevels = $levels;
506
+
507
+ return $this->headingLevels;
508
+ }
509
+
510
+ /**
511
+ * Remove the heading levels as defined by user settings from the TOC heading matches.
512
+ *
513
+ * @see ezTOC_Post::extractHeadings()
514
+ *
515
+ * @access private
516
+ * @since 2.0
517
+ *
518
+ * @param array $matches The heading from the post content extracted with preg_match_all().
519
+ *
520
+ * @return array
521
+ */
522
+ private function removeHeadings( &$matches ) {
523
+
524
+ $levels = $this->getHeadingLevels();
525
+
526
+ if ( count( $levels ) != 6 ) {
527
+
528
+ $new_matches = array();
529
+ //$count = count( $matches );
530
+
531
+ //for ( $i = 0; $i < $count; $i++ ) {
532
+ foreach ( $matches as $i => $match ) {
533
+
534
+ if ( in_array( $matches[ $i ][2], $levels ) ) {
535
+
536
+ $new_matches[ $i ] = $matches[ $i ];
537
+ }
538
+ }
539
+
540
+ $matches = $new_matches;
541
+ }
542
+
543
+ return $matches;
544
+ }
545
+
546
+ /**
547
+ * Exclude the heading, by title, as defined by the user settings from the TOC matches.
548
+ *
549
+ * @see ezTOC_Post::extractHeadings()
550
+ *
551
+ * @access private
552
+ * @since 2.0
553
+ *
554
+ * @param array $matches The headings from the post content extracted with preg_match_all().
555
+ *
556
+ * @return array
557
+ */
558
+ private function excludeHeadings( &$matches ) {
559
+
560
+ $exclude = get_post_meta( $this->post->ID, '_ez-toc-exclude', true );
561
+
562
+ if ( empty( $exclude ) ) {
563
+
564
+ $exclude = ezTOC_Option::get( 'exclude' );
565
+ }
566
+
567
+ if ( $exclude ) {
568
+
569
+ $excluded_headings = explode( '|', $exclude );
570
+ $excluded_count = count( $excluded_headings );
571
+
572
+ if ( $excluded_count > 0 ) {
573
+
574
+ for ( $j = 0; $j < $excluded_count; $j++ ) {
575
+
576
+ $excluded_headings[ $j ] = preg_quote( $excluded_headings[ $j ] );
577
+
578
+ // escape some regular expression characters
579
+ // others: http://www.php.net/manual/en/regexp.reference.meta.php
580
+ $excluded_headings[ $j ] = str_replace(
581
+ array( '\*', '/', '%' ),
582
+ array( '.*', '\/', '\%' ),
583
+ trim( $excluded_headings[ $j ] )
584
+ );
585
+ }
586
+
587
+ $new_matches = array();
588
+ //$count = count( $matches );
589
+
590
+ //for ( $i = 0; $i < $count; $i++ ) {
591
+ foreach ( $matches as $i => $match ) {
592
+
593
+ $found = false;
594
+
595
+ $against = html_entity_decode(
596
+ wptexturize( strip_tags( str_replace( array( "\r", "\n" ), ' ', $matches[ $i ][0] ) ) ),
597
+ ENT_NOQUOTES,
598
+ get_option( 'blog_charset' )
599
+ );
600
+
601
+ for ( $j = 0; $j < $excluded_count; $j++ ) {
602
+
603
+ // Since WP manipulates the post content it is required that the excluded header and
604
+ // the actual header be manipulated similarly so a match can be made.
605
+ $pattern = html_entity_decode(
606
+ wptexturize( $excluded_headings[ $j ] ),
607
+ ENT_NOQUOTES,
608
+ get_option( 'blog_charset' )
609
+ );
610
+
611
+ if ( @preg_match( '/^' . $pattern . '$/imU', $against ) ) {
612
+
613
+ $found = true;
614
+ break;
615
+ }
616
+ }
617
+
618
+ if ( ! $found ) {
619
+
620
+ $new_matches[ $i ] = $matches[ $i ];
621
+ }
622
+ }
623
+
624
+ //if ( count( $matches ) != count( $new_matches ) ) {
625
+
626
+ $matches = $new_matches;
627
+ //}
628
+ }
629
+ }
630
+
631
+ return $matches;
632
+ }
633
+
634
+ /**
635
+ * Return the alternate headings added by the user, saved in the post meta.
636
+ *
637
+ * The result is an associative array where the `key` is the original post heading
638
+ * and the `value` is the alternate heading.
639
+ *
640
+ * @access private
641
+ * @since 2.0
642
+ *
643
+ * @return array
644
+ */
645
+ private function getAlternateHeadings() {
646
+
647
+ $alternates = array();
648
+ $value = get_post_meta( $this->post->ID, '_ez-toc-alttext', true );
649
+
650
+ if ( $value ) {
651
+
652
+ $headings = preg_split( '/\r\n|[\r\n]/', $value );
653
+ $count = count( $headings );
654
+
655
+ if ( $headings ) {
656
+
657
+ for ( $k = 0; $k < $count; $k++ ) {
658
+
659
+ $heading = explode( '|', $headings[ $k ] );
660
+
661
+ /**
662
+ * @link https://wordpress.org/support/topic/undefined-offset-1-home-blog-public-wp-content-plugins-easy-table-of-contents/
663
+ */
664
+ if ( ! is_array( $heading) ||
665
+ ! array_key_exists( 0, $heading ) ||
666
+ ! array_key_exists( 1, $heading )
667
+ ) {
668
+ continue;
669
+ }
670
+
671
+ if ( 0 < strlen( $heading[0] ) && 0 < strlen( $heading[1] ) ) {
672
+
673
+ $alternates[ $heading[0] ] = $heading[1];
674
+ }
675
+ }
676
+
677
+ }
678
+
679
+ }
680
+
681
+ return $alternates;
682
+ }
683
+
684
+ /**
685
+ * Add the alternate headings to the array.
686
+ *
687
+ * @see ezTOC_Post::extractHeadings()
688
+ *
689
+ * @access private
690
+ * @since 2.0
691
+ *
692
+ * @param array $matches The heading from the post content extracted with preg_match_all().
693
+ *
694
+ * @return array
695
+ */
696
+ private function alternateHeadings( &$matches ) {
697
+
698
+ $alt_headings = $this->getAlternateHeadings();
699
+ //$count = count( $matches );
700
+
701
+ if ( 0 < count( $alt_headings ) ) {
702
+
703
+ //for ( $i = 0; $i < $count; $i++ ) {
704
+ foreach ( $matches as $i => $match ) {
705
+
706
+ foreach ( $alt_headings as $original_heading => $alt_heading ) {
707
+
708
+ // Cleanup and texturize so alt heading can match heading in post content.
709
+ $original_heading = wptexturize( trim( $original_heading ) );
710
+
711
+ // Deal with special characters such as non-breakable space.
712
+ $original_heading = str_replace(
713
+ array( "\xc2\xa0" ),
714
+ array( ' ' ),
715
+ $original_heading
716
+ );
717
+
718
+ // Escape for regular expression.
719
+ $original_heading = preg_quote( $original_heading );
720
+
721
+ // Escape for regular expression some other characters: http://www.php.net/manual/en/regexp.reference.meta.php
722
+ $original_heading = str_replace(
723
+ array( '\*', '/', '%' ),
724
+ array( '.*', '\/', '\%' ),
725
+ $original_heading
726
+ );
727
+
728
+ // Cleanup subject so alt heading can match heading in post content.
729
+ $subject = strip_tags( $matches[ $i ][0] );
730
+
731
+ // Deal with special characters such as non-breakable space.
732
+ $subject = str_replace(
733
+ array( "\xc2\xa0" ),
734
+ array( ' ' ),
735
+ $subject
736
+ );
737
+
738
+ if ( @preg_match( '/^' . $original_heading . '$/imU', $subject ) ) {
739
+
740
+ $matches[ $i ]['alternate'] = $alt_heading;
741
+ }
742
+ }
743
+ }
744
+ }
745
+
746
+ return $matches;
747
+ }
748
+
749
+ /**
750
+ * Add the heading `id` to the array.
751
+ *
752
+ * @see ezTOC_Post::extractHeadings()
753
+ *
754
+ * @access private
755
+ * @since 2.0
756
+ *
757
+ * @param array $matches The heading from the post content extracted with preg_match_all().
758
+ *
759
+ * @return mixed
760
+ */
761
+ private function headingIDs( &$matches ) {
762
+
763
+ //$count = count( $matches );
764
+
765
+ //for ( $i = 0; $i < $count; $i++ ) {
766
+ foreach ( $matches as $i => $match ) {
767
+
768
+ $matches[ $i ]['id'] = $this->generateHeadingIDFromTitle( $matches[ $i ][0] );
769
+ }
770
+
771
+ return $matches;
772
+ }
773
+
774
+ /**
775
+ * Create unique heading ID from heading string.
776
+ *
777
+ * @access private
778
+ * @since 2.0
779
+ *
780
+ * @param string $heading
781
+ *
782
+ * @return bool|string
783
+ */
784
+ private function generateHeadingIDFromTitle( $heading ) {
785
+
786
+ $return = false;
787
+
788
+ if ( $heading ) {
789
+ $heading = apply_filters( 'ez_toc_url_anchor_target_before', $heading );
790
+ // WP entity encodes the post content.
791
+ $return = html_entity_decode( $heading, ENT_QUOTES, get_option( 'blog_charset' ) );
792
+ $return = br2( $return, ' ' );
793
+ $return = trim( strip_tags( $return ) );
794
+
795
+ // Convert accented characters to ASCII.
796
+ $return = remove_accents( $return );
797
+
798
+ // replace newlines with spaces (eg when headings are split over multiple lines)
799
+ $return = str_replace( array( "\r", "\n", "\n\r", "\r\n" ), ' ', $return );
800
+
801
+ // Remove `&amp;` and `&nbsp;` NOTE: in order to strip "hidden" `&nbsp;`,
802
+ // title needs to be converted to HTML entities.
803
+ // @link https://stackoverflow.com/a/21801444/5351316
804
+ $return = htmlentities2( $return );
805
+ $return = str_replace( array( '&amp;', '&nbsp;'), ' ', $return );
806
+ $return = str_replace( array( '&shy;' ),'', $return ); // removed silent hypen
807
+ $return = html_entity_decode( $return, ENT_QUOTES, get_option( 'blog_charset' ) );
808
+
809
+ // remove non alphanumeric chars
810
+ //$return = preg_replace( '/[^a-zA-Z0-9 \-_]*/', '', $return );
811
+ $return = preg_replace( '/[\x00-\x1F\x7F]*/u', '', $return );
812
+
813
+ // Reserved Characters.
814
+ // * ' ( ) ; : @ & = + $ , / ? # [ ]
815
+ $return = str_replace(
816
+ array( '*', '\'', '(', ')', ';', '@', '&', '=', '+', '$', ',', '/', '?', '#', '[', ']' ),
817
+ '',
818
+ $return
819
+ );
820
+
821
+ // Unsafe Characters.
822
+ // % { } | \ ^ ~ [ ] `
823
+ $return = str_replace(
824
+ array( '%', '{', '}', '|', '\\', '^', '~', '[', ']', '`' ),
825
+ '',
826
+ $return
827
+ );
828
+
829
+ // Special Characters.
830
+ // $ - _ . + ! * ' ( ) ,
831
+ $return = str_replace(
832
+ array( '$', '.', '+', '!', '*', '\'', '(', ')', ',' ),
833
+ '',
834
+ $return
835
+ );
836
+
837
+ // Dashes
838
+ // Special Characters.
839
+ // - (minus) - (dash) – (en dash) — (em dash)
840
+ $return = str_replace(
841
+ array( '-', '-', '–', '—' ),
842
+ '-',
843
+ $return
844
+ );
845
+
846
+ // Curley quotes.
847
+ // ‘ (curly single open quote) ’ (curly single close quote) “ (curly double open quote) ” (curly double close quote)
848
+ $return = str_replace(
849
+ array( '‘', '’', '“', '”' ),
850
+ '',
851
+ $return
852
+ );
853
+
854
+ // AMP/Caching plugins seems to break URL with the following characters, so lets replace them.
855
+ $return = str_replace( array( ':' ), '_', $return );
856
+
857
+ // Convert space characters to an `_` (underscore).
858
+ $return = preg_replace( '/\s+/', '_', $return );
859
+
860
+ // Replace multiple `-` (hyphen) with a single `-` (hyphen).
861
+ $return = preg_replace( '/-+/', '-', $return );
862
+
863
+ // Replace multiple `_` (underscore) with a single `_` (underscore).
864
+ $return = preg_replace( '/_+/', '_', $return );
865
+
866
+ // Remove trailing `-` (hyphen) and `_` (underscore).
867
+ $return = rtrim( $return, '-_' );
868
+
869
+ /*
870
+ * Encode URI based on ECMA-262.
871
+ *
872
+ * Only required to support the jQuery smoothScroll library.
873
+ *
874
+ * @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI#Description
875
+ * @link https://stackoverflow.com/a/19858404/5351316
876
+ */
877
+ $return = preg_replace_callback(
878
+ "{[^0-9a-z_.!~*'();,/?:@&=+$#-]}i",
879
+ function( $m ) {
880
+
881
+ return sprintf( '%%%02X', ord( $m[0] ) );
882
+ },
883
+ $return
884
+ );
885
+
886
+ // lowercase everything?
887
+ if ( ezTOC_Option::get( 'lowercase' ) ) {
888
+
889
+ $return = strtolower( $return );
890
+ }
891
+
892
+ // if blank, then prepend with the fragment prefix
893
+ // blank anchors normally appear on sites that don't use the latin charset
894
+ if ( ! $return ) {
895
+
896
+ $return = ( ezTOC_Option::get( 'fragment_prefix' ) ) ? ezTOC_Option::get( 'fragment_prefix' ) : '_';
897
+ }
898
+
899
+ // hyphenate?
900
+ if ( ezTOC_Option::get( 'hyphenate' ) ) {
901
+
902
+ $return = str_replace( '_', '-', $return );
903
+ $return = preg_replace( '/-+/', '-', $return );
904
+ }
905
+ }
906
+
907
+ if ( array_key_exists( $return, $this->collision_collector ) ) {
908
+
909
+ $this->collision_collector[ $return ]++;
910
+ $return .= '-' . $this->collision_collector[ $return ];
911
+
912
+ } else {
913
+
914
+ $this->collision_collector[ $return ] = 1;
915
+ }
916
+
917
+ return apply_filters( 'ez_toc_url_anchor_target', $return, $heading );
918
+ }
919
+
920
+ /**
921
+ * Remove any empty headings from the TOC.
922
+ *
923
+ * @access private
924
+ * @since 2.0
925
+ *
926
+ * @param array $matches The heading from the post content extracted with preg_match_all().
927
+ *
928
+ * @return array
929
+ */
930
+ private function removeEmptyHeadings( &$matches ) {
931
+
932
+ $new_matches = array();
933
+ //$count = count( $matches );
934
+
935
+ //for ( $i = 0; $i < $count; $i ++ ) {
936
+ foreach ( $matches as $i => $match ) {
937
+
938
+ if ( trim( strip_tags( $matches[ $i ][0] ) ) != false ) {
939
+
940
+ $new_matches[ $i ] = $matches[ $i ];
941
+ }
942
+ }
943
+
944
+ //if ( count( $matches ) != count( $new_matches ) ) {
945
+
946
+ $matches = $new_matches;
947
+ //}
948
+
949
+ return $matches;
950
+ }
951
+
952
+ /**
953
+ * Whether or not the post has TOC items.
954
+ *
955
+ * @see ezTOC_Post::extractHeadings()
956
+ *
957
+ * @access public
958
+ * @since 2.0
959
+ *
960
+ * @return bool
961
+ */
962
+ public function hasTOCItems() {
963
+
964
+ return $this->hasTOCItems;
965
+ }
966
+
967
+ /**
968
+ * Get the headings of the current page of the post.
969
+ *
970
+ * @access public
971
+ * @since 2.0
972
+ *
973
+ * @param int|null $page
974
+ *
975
+ * @return array
976
+ */
977
+ public function getHeadings( $page = null ) {
978
+
979
+ $headings = array();
980
+
981
+ if ( is_null( $page ) ) {
982
+
983
+ $page = $this->getCurrentPage();
984
+ }
985
+
986
+ if ( isset( $this->pages[ $page ] ) ) {
987
+
988
+ //$headings = wp_list_pluck( $this->pages[ $page ]['headings'], 0 );
989
+
990
+ $matches = $this->pages[ $page ]['headings'];
991
+ //$count = count( $matches );
992
+
993
+ //for ( $i = 0; $i < $count; $i++ ) {
994
+ foreach ( $matches as $i => $match ) {
995
+
996
+ //$anchor = $matches[ $i ]['id'];
997
+ $headings[] = str_replace(
998
+ array(
999
+ $matches[ $i ][1], // start of heading
1000
+ '</h' . $matches[ $i ][2] . '>' // end of heading
1001
+ ),
1002
+ array(
1003
+ '>',
1004
+ '</h' . $matches[ $i ][2] . '>'
1005
+ ),
1006
+ $matches[ $i ][0]
1007
+ );
1008
+ }
1009
+ }
1010
+
1011
+ return $headings;
1012
+ }
1013
+
1014
+ /**
1015
+ * Get the heading with in page anchors of the current page of the post.
1016
+ *
1017
+ * @access public
1018
+ * @since 2.0
1019
+ *
1020
+ * @param int|null $page
1021
+ *
1022
+ * @return array
1023
+ */
1024
+ public function getHeadingsWithAnchors( $page = null ) {
1025
+
1026
+ $headings = array();
1027
+
1028
+ if ( is_null( $page ) ) {
1029
+
1030
+ $page = $this->getCurrentPage();
1031
+ }
1032
+
1033
+ if ( isset( $this->pages[ $page ] ) ) {
1034
+
1035
+ $matches = $this->pages[ $page ]['headings'];
1036
+ //$count = count( $matches );
1037
+
1038
+ //for ( $i = 0; $i < $count; $i++ ) {
1039
+ foreach ( $matches as $i => $match ) {
1040
+
1041
+ $anchor = $matches[ $i ]['id'];
1042
+
1043
+ $headings[] = str_replace(
1044
+ array(
1045
+ $matches[ $i ][1], // start of heading
1046
+ '</h' . $matches[ $i ][2] . '>' // end of heading
1047
+ ),
1048
+ array(
1049
+ '><span class="ez-toc-section" id="' . $anchor . '"></span>',
1050
+ '<span class="ez-toc-section-end"></span></h' . $matches[ $i ][2] . '>'
1051
+ ),
1052
+ $matches[ $i ][0]
1053
+ );
1054
+ }
1055
+ }
1056
+
1057
+ return $headings;
1058
+ }
1059
+
1060
+ /**
1061
+ * Get the post TOC list.
1062
+ *
1063
+ * @access public
1064
+ * @param string $prefix
1065
+ * @since 2.0
1066
+ *
1067
+ * @return string
1068
+ */
1069
+ public function getTOCList($prefix = "ez-toc") {
1070
+
1071
+ $html = '';
1072
+
1073
+ if ( $this->hasTOCItems ) {
1074
+
1075
+ foreach ( $this->pages as $page => $attribute ) {
1076
+
1077
+ $html .= $this->createTOC( $page, $attribute['headings'], $prefix );
1078
+ }
1079
+
1080
+ $html = "<ul class='{$prefix}-list {$prefix}-list-level-1'>" . $html . "</ul>";
1081
+ }
1082
+
1083
+ return $html;
1084
+ }
1085
+
1086
+ /**
1087
+ /**
1088
+ * Get the post Sticky Toggle TOC content block.
1089
+ *
1090
+ * @access public
1091
+ * @return string
1092
+ * @since 2.0.32
1093
+ *
1094
+ */
1095
+ public function getStickyToggleTOC() {
1096
+ $classSticky = array( 'ez-toc-sticky-v' . str_replace( '.', '_', ezTOC::VERSION ) );
1097
+ $htmlSticky = '';
1098
+ if ( $this->hasTOCItems() ) {
1099
+ $classSticky[] = 'counter-flat';
1100
+ switch ( ezTOC_Option::get( 'counter' ) ) {
1101
+
1102
+ case 'numeric':
1103
+ $classSticky[] .= 'counter-numeric';
1104
+ break;
1105
+
1106
+ case 'roman':
1107
+ $classSticky[] = 'counter-roman';
1108
+ break;
1109
+
1110
+ case 'decimal':
1111
+ $classSticky[] = 'counter-decimal';
1112
+ break;
1113
+
1114
+ case 'hyphen':
1115
+ $classSticky[] = 'counter-hyphen';
1116
+ break;
1117
+
1118
+ case 'disc':
1119
+ $classSticky[] = 'counter-disc';
1120
+ break;
1121
+ }
1122
+ $classSticky = array_filter( $classSticky );
1123
+ $classSticky = array_map( 'trim', $classSticky );
1124
+ $classSticky = array_map( 'sanitize_html_class', $classSticky );
1125
+
1126
+
1127
+ if ( ezTOC_Option::get( 'show_heading_text' ) ) {
1128
+ $toc_title = ezTOC_Option::get( 'heading_text' );
1129
+ if ( strpos( $toc_title, '%PAGE_TITLE%' ) !== false ) {
1130
+ $toc_title = str_replace( '%PAGE_TITLE%', get_the_title(), $toc_title );
1131
+ }
1132
+ if ( strpos( $toc_title, '%PAGE_NAME%' ) !== false ) {
1133
+ $toc_title = str_replace( '%PAGE_NAME%', get_the_title(), $toc_title );
1134
+ }
1135
+ // if ( ezTOC_Option::get( 'toc_loading' ) !== 'css' ) {
1136
+ $htmlSticky .= '<div class="ez-toc-sticky-title-container">' . PHP_EOL;
1137
+ // }
1138
+ $htmlSticky .= '<p class="ez-toc-sticky-title">' . esc_html__( htmlentities( $toc_title, ENT_COMPAT, 'UTF-8' ), 'easy-table-of-contents' ) . '</p>' . PHP_EOL;
1139
+ // if ( ezTOC_Option::get( 'toc_loading' ) !== 'css' ) {
1140
+ $htmlSticky .= '<a class="ez-toc-close-icon" href="javascript:void(0)" onclick="hideBar(event)"><span aria-hidden="true">×</span></a>' . PHP_EOL;
1141
+ $htmlSticky .= '</div>' . PHP_EOL;
1142
+ // }
1143
+ } else {
1144
+ $htmlSticky .= '<div class="ez-toc-sticky-title-container">' . PHP_EOL;
1145
+ $htmlSticky .= '<a class="ez-toc-close-icon" href="javascript:void(0)" onclick="hideBar(event)"><span aria-hidden="true">×</span></a>' . PHP_EOL;
1146
+ $htmlSticky .= '</div>' . PHP_EOL;
1147
+ }
1148
+ $htmlSticky .= '<div id="ez-toc-sticky-container" class="' . implode( ' ', $classSticky ) . '">' . PHP_EOL;
1149
+ ob_start();
1150
+ do_action( 'ez_toc_before' );
1151
+ $htmlSticky .= ob_get_clean();
1152
+ $htmlSticky .= '<nav>' . $this->getTOCList( "ez-toc-sticky" ) . '</nav>';
1153
+ ob_start();
1154
+ do_action( 'ez_toc_after' );
1155
+ $htmlSticky .= ob_get_clean();
1156
+ $htmlSticky .= '</div>' . PHP_EOL;
1157
+ // Enqueue the script.
1158
+ wp_enqueue_script( 'ez-toc-js' );
1159
+ }
1160
+ return $htmlSticky;
1161
+ }
1162
+
1163
+ /**
1164
+ * Get the post TOC content block.
1165
+ *
1166
+ * @access public
1167
+ * @since 2.0
1168
+ *
1169
+ * @return string
1170
+ */
1171
+ public function getTOC() {
1172
+
1173
+ $class = array( 'ez-toc-v' . str_replace( '.', '_', ezTOC::VERSION ) );
1174
+ $html = '';
1175
+
1176
+ if ( $this->hasTOCItems() ) {
1177
+
1178
+ // wrapping css classes
1179
+ switch ( ezTOC_Option::get( 'wrapping' ) ) {
1180
+
1181
+ case 'left':
1182
+ $class[] = 'ez-toc-wrap-left';
1183
+ break;
1184
+
1185
+ case 'right':
1186
+ $class[] = 'ez-toc-wrap-right';
1187
+ break;
1188
+ case 'center':
1189
+ $class[] = 'ez-toc-wrap-center';
1190
+ break;
1191
+
1192
+ case 'none':
1193
+ default:
1194
+ // do nothing
1195
+ }
1196
+
1197
+ if ( ezTOC_Option::get( 'show_hierarchy' ) ) {
1198
+
1199
+ $class[] = 'counter-hierarchy';
1200
+
1201
+ } else {
1202
+
1203
+ $class[] .= 'counter-flat';
1204
+ }
1205
+
1206
+ switch ( ezTOC_Option::get( 'counter' ) ) {
1207
+
1208
+ case 'numeric':
1209
+ $class[] .= 'counter-numeric';
1210
+ break;
1211
+
1212
+ case 'roman':
1213
+ $class[] = 'counter-roman';
1214
+ break;
1215
+
1216
+ case 'decimal':
1217
+ $class[] = 'counter-decimal';
1218
+ break;
1219
+
1220
+ case 'hyphen':
1221
+ $class[] = 'counter-hyphen';
1222
+ break;
1223
+
1224
+ case 'disc':
1225
+ $class[] = 'counter-disc';
1226
+ break;
1227
+ }
1228
+
1229
+ // colour themes
1230
+ switch ( ezTOC_Option::get( 'theme' ) ) {
1231
+
1232
+ case 'light-blue':
1233
+ $class[] = 'ez-toc-light-blue';
1234
+ break;
1235
+
1236
+ case 'white':
1237
+ $class[] = 'ez-toc-white';
1238
+ break;
1239
+
1240
+ case 'black':
1241
+ $class[] = 'ez-toc-black';
1242
+ break;
1243
+
1244
+ case 'transparent':
1245
+ $class[] .= 'ez-toc-transparent';
1246
+ break;
1247
+
1248
+ case 'grey':
1249
+ $class[] = 'ez-toc-grey';
1250
+ break;
1251
+ }
1252
+
1253
+ $custom_classes = ezTOC_Option::get( 'css_container_class', '' );
1254
+
1255
+ $position = ezTOC_Option::get( 'position' );
1256
+ if($position == 'afterpara'){
1257
+ $custom_classes .= "afterpara";
1258
+ }
1259
+
1260
+ if ( 0 < strlen( $custom_classes ) ) {
1261
+
1262
+ $custom_classes = explode( ' ', $custom_classes );
1263
+ $custom_classes = apply_filters( 'ez_toc_container_class', $custom_classes, $this );
1264
+
1265
+ if ( is_array( $custom_classes ) ) {
1266
+
1267
+ $class = array_merge( $class, $custom_classes );
1268
+ }
1269
+ }
1270
+
1271
+ $class = array_filter( $class );
1272
+ $class = array_map( 'trim', $class );
1273
+ $class = array_map( 'sanitize_html_class', $class );
1274
+ $html .= '<div id="ez-toc-container" class="' . implode( ' ', $class ) . '">' . PHP_EOL;
1275
+
1276
+ if ( ezTOC_Option::get( 'show_heading_text' ) ) {
1277
+
1278
+ $toc_title = ezTOC_Option::get( 'heading_text' );
1279
+
1280
+ if ( strpos( $toc_title, '%PAGE_TITLE%' ) !== false ) {
1281
+
1282
+ $toc_title = str_replace( '%PAGE_TITLE%', get_the_title(), $toc_title );
1283
+ }
1284
+
1285
+ if ( strpos( $toc_title, '%PAGE_NAME%' ) !== false ) {
1286
+
1287
+ $toc_title = str_replace( '%PAGE_NAME%', get_the_title(), $toc_title );
1288
+ }
1289
+
1290
+ if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1291
+ $html .= '<div class="ez-toc-title-container">' . PHP_EOL;
1292
+ }
1293
+
1294
+ $html .= '<p class="ez-toc-title">' . esc_html__( htmlentities( $toc_title, ENT_COMPAT, 'UTF-8' ), 'easy-table-of-contents' ). '</p>' . PHP_EOL;
1295
+
1296
+ if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1297
+ $html .= '<span class="ez-toc-title-toggle">';
1298
+ }
1299
+
1300
+ if ( ezTOC_Option::get( 'visibility' ) ) {
1301
+ if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1302
+ $icon = '<i class="ez-toc-glyphicon ez-toc-icon-toggle"></i>';
1303
+ if(function_exists('ez_toc_pro_activation_link')){
1304
+ $icon = apply_filters('ez_toc_modify_icon',$icon);
1305
+ }
1306
+ $html .= '<a href="#" class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" style="display: none;"><label for="item" aria-label="'.__( 'Table of Content', 'easy-table-of-contents' ).'">'.$icon.'</label><input type="checkbox" id="item"></a>';
1307
+ }else{
1308
+ $toggle_view='';
1309
+ if(ezTOC_Option::get('visibility_hide_by_default')==true){
1310
+ $toggle_view= "checked";
1311
+ }
1312
+ $html .= '<label for="item" class="cssicon"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></label><label for="item" class="cssiconcheckbox">1</label><input type="checkbox" id="item" '.$toggle_view.'>';
1313
+ }
1314
+ }
1315
+
1316
+ if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1317
+ $html .= '</span>';
1318
+ }
1319
+ if (ezTOC_Option::get( 'toc_loading' ) != 'css') {
1320
+ $html .= '</div>' . PHP_EOL;
1321
+ }
1322
+ }else{
1323
+ $html .= '<div class="ez-toc-title-container">' . PHP_EOL;
1324
+ $html .= '<span class="ez-toc-title-toggle">';
1325
+ $html .= '<a class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" style="display: none;"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></a>';
1326
+ $html .= '</span>';
1327
+ $html .= '</div>' . PHP_EOL;
1328
+ }
1329
+
1330
+ ob_start();
1331
+ do_action( 'ez_toc_before' );
1332
+ $html .= ob_get_clean();
1333
+
1334
+ $html .= '<nav>' . $this->getTOCList() . '</nav>';
1335
+
1336
+ ob_start();
1337
+ do_action( 'ez_toc_after' );
1338
+ $html .= ob_get_clean();
1339
+
1340
+ $html .= '</div>' . PHP_EOL;
1341
+
1342
+ // Enqueue the script.
1343
+ wp_enqueue_script( 'ez-toc-js' );
1344
+ }
1345
+
1346
+ return $html;
1347
+ }
1348
+
1349
+ /**
1350
+ * Displays the post's TOC.
1351
+ *
1352
+ * @access public
1353
+ * @since 2.0
1354
+ */
1355
+ public function toc() {
1356
+
1357
+ echo $this->getTOC();
1358
+ }
1359
+
1360
+ /**
1361
+ * Generate the TOC list items for a given page within a post.
1362
+ *
1363
+ * @access private
1364
+ * @since 2.0
1365
+ *
1366
+ * @param int $page The page of the post to create the TOC items for.
1367
+ * @param array $matches The heading from the post content extracted with preg_match_all().
1368
+ *
1369
+ * @return string The HTML list of TOC items.
1370
+ */
1371
+ private function createTOC( $page, $matches, $prefix = "ez-toc" ) {
1372
+
1373
+ // Whether or not the TOC should be built flat or hierarchical.
1374
+ $hierarchical = ezTOC_Option::get( 'show_hierarchy' );
1375
+ $html = '';
1376
+
1377
+ if ( $hierarchical ) {
1378
+
1379
+ $current_depth = 100; // headings can't be larger than h6 but 100 as a default to be sure
1380
+ $numbered_items = array();
1381
+ $numbered_items_min = null;
1382
+
1383
+ // reset the internal collision collection
1384
+ /** @todo does this need to be used??? */
1385
+ //self::$collision_collector = array();
1386
+
1387
+ // find the minimum heading to establish our baseline
1388
+ //for ( $i = 0; $i < count( $matches ); $i ++ ) {
1389
+ foreach ( $matches as $i => $match ) {
1390
+ if ( $current_depth > $matches[ $i ][2] ) {
1391
+ $current_depth = (int) $matches[ $i ][2];
1392
+ }
1393
+ }
1394
+
1395
+ $numbered_items[ $current_depth ] = 0;
1396
+ $numbered_items_min = $current_depth;
1397
+
1398
+ //for ( $i = 0; $i < count( $matches ); $i ++ ) {
1399
+ foreach ( $matches as $i => $match ) {
1400
+
1401
+ $level = $matches[ $i ][2];
1402
+ $count = $i + 1;
1403
+
1404
+ if ( $current_depth == (int) $matches[ $i ][2] ) {
1405
+
1406
+ $html .= "<li class='{$prefix}-page-" . $page . " {$prefix}-heading-level-" . $current_depth . "'>";
1407
+ }
1408
+
1409
+ // start lists
1410
+ if ( $current_depth != (int) $matches[ $i ][2] ) {
1411
+
1412
+ for ( $current_depth; $current_depth < (int) $matches[ $i ][2]; $current_depth++ ) {
1413
+
1414
+ $numbered_items[ $current_depth + 1 ] = 0;
1415
+ $html .= "<ul class='{$prefix}-list-level-" . $level . "'><li class='{$prefix}-heading-level-" . $level . "'>";
1416
+ }
1417
+ }
1418
+
1419
+ $title = isset( $matches[ $i ]['alternate'] ) ? $matches[ $i ]['alternate'] : $matches[ $i ][0];
1420
+ $title = br2( $title, ' ' );
1421
+ $title = strip_tags( apply_filters( 'ez_toc_title', $title ), apply_filters( 'ez_toc_title_allowable_tags', '' ) );
1422
+
1423
+ $html .= $this->createTOCItemAnchor( $page, $matches[ $i ]['id'], $title, $count );
1424
+
1425
+ // end lists
1426
+ if ( $i != count( $matches ) - 1 ) {
1427
+
1428
+ if ( $current_depth > (int) $matches[ $i + 1 ][2] ) {
1429
+
1430
+ for ( $current_depth; $current_depth > (int) $matches[ $i + 1 ][2]; $current_depth-- ) {
1431
+
1432
+ $html .= '</li></ul>';
1433
+ $numbered_items[ $current_depth ] = 0;
1434
+ }
1435
+ }
1436
+
1437
+ if ( $current_depth == (int) @$matches[ $i + 1 ][2] ) {
1438
+
1439
+ $html .= '</li>';
1440
+ }
1441
+
1442
+ } else {
1443
+
1444
+ // this is the last item, make sure we close off all tags
1445
+ for ( $current_depth; $current_depth >= $numbered_items_min; $current_depth-- ) {
1446
+
1447
+ $html .= '</li>';
1448
+
1449
+ if ( $current_depth != $numbered_items_min ) {
1450
+ $html .= '</ul>';
1451
+ }
1452
+ }
1453
+ }
1454
+ }
1455
+
1456
+ } else {
1457
+
1458
+ //for ( $i = 0; $i < count( $matches ); $i++ ) {
1459
+ foreach ( $matches as $i => $match ) {
1460
+
1461
+ $count = $i + 1;
1462
+
1463
+ $title = isset( $matches[ $i ]['alternate'] ) ? $matches[ $i ]['alternate'] : $matches[ $i ][0];
1464
+ $title = strip_tags( apply_filters( 'ez_toc_title', $title ), apply_filters( 'ez_toc_title_allowable_tags', '' ) );
1465
+
1466
+ $html .= "<li class='{$prefix}-page-" . $page . "'>";
1467
+
1468
+ $html .= $this->createTOCItemAnchor( $page, $matches[ $i ]['id'], $title, $count );
1469
+
1470
+ $html .= '</li>';
1471
+ }
1472
+ }
1473
+
1474
+ return do_shortcode($html);
1475
+ }
1476
+
1477
+ /**
1478
+ * @access private
1479
+ * @since 2.0
1480
+ *
1481
+ * @param int $page
1482
+ * @param string $id
1483
+ * @param string $title
1484
+ * @param int $count
1485
+ *
1486
+ * @return string
1487
+ */
1488
+ private function createTOCItemAnchor( $page, $id, $title, $count ) {
1489
+ if (ezTOC_Option::get( 'remove_special_chars_from_title' )) {
1490
+ $title = str_replace(':', '', $title);
1491
+ }
1492
+
1493
+ return sprintf(
1494
+ '<a class="ez-toc-link ez-toc-heading-' . $count . '" href="%1$s" title="%2$s">%3$s</a>',
1495
+ esc_attr( $this->createTOCItemURL( $id, $page ) ),
1496
+ esc_attr( strip_tags( $title ) ),
1497
+ $title
1498
+ );
1499
+ }
1500
+
1501
+ /**
1502
+ * @access private
1503
+ * @since 2.0
1504
+ *
1505
+ * @param string $id
1506
+ * @param int $page
1507
+ *
1508
+ * @return string
1509
+ */
1510
+ private function createTOCItemURL( $id, $page ) {
1511
+
1512
+ $current_post = $this->post->ID === $this->queriedObjectID;
1513
+ $current_page = $this->getCurrentPage();
1514
+
1515
+ if ( $page === $current_page && $current_post ) {
1516
+
1517
+ return '#' . $id;
1518
+
1519
+ } elseif ( 1 === $page ) {
1520
+
1521
+ return trailingslashit( $this->permalink ) . '#' . $id;
1522
+
1523
+ }
1524
+
1525
+ return trailingslashit( $this->permalink ) . $page . '/#' . $id;
1526
+ }
1527
+ }
includes/class.widget-toc.php CHANGED
@@ -1,381 +1,381 @@
1
- <?php
2
- // Exit if accessed directly
3
- if ( ! defined( 'ABSPATH' ) ) exit;
4
-
5
- if ( ! class_exists( 'ezTOC_Widget' ) ) {
6
-
7
- /**
8
- * Class ezTOC_Widget
9
- */
10
- class ezTOC_Widget extends WP_Widget {
11
-
12
- /**
13
- * Setup and register the table of contents widget.
14
- *
15
- * @access public
16
- * @since 1.0
17
- */
18
- public function __construct() {
19
-
20
- $options = array(
21
- 'classname' => 'ez-toc',
22
- 'description' => __( 'Display the table of contents.', 'easy-table-of-contents' )
23
- );
24
-
25
- parent::__construct(
26
- 'ezw_tco',
27
- __( 'Table of Contents', 'easy-table-of-contents' ),
28
- $options
29
- );
30
-
31
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueueScripts' ) );
32
- add_action( 'admin_footer-widgets.php', array( $this, 'printScripts' ), 9999 );
33
- }
34
-
35
- /**
36
- * Callback which registers the widget with the Widget API.
37
- *
38
- * @access public
39
- * @since 1.0
40
- * @static
41
- *
42
- * @return void
43
- */
44
- public static function register() {
45
-
46
- register_widget( __CLASS__ );
47
- }
48
-
49
- /**
50
- * Callback to enqueue scripts on the Widgets admin page.
51
- *
52
- * @access private
53
- * @since 1.0
54
- *
55
- * @param string $hook_suffix
56
- */
57
- public function enqueueScripts( $hook_suffix ) {
58
-
59
- if ( 'widgets.php' !== $hook_suffix ) {
60
- return;
61
- }
62
-
63
- wp_enqueue_style( 'wp-color-picker' );
64
- wp_enqueue_script( 'wp-color-picker' );
65
- wp_enqueue_script( 'underscore' );
66
- }
67
-
68
- /**
69
- * Callback to print the scripts to the Widgets admin page footer.
70
- *
71
- * @access private
72
- * @since 1.0
73
- */
74
- public function printScripts() {
75
- ?>
76
- <script>
77
- ( function( $ ){
78
- function initColorPicker( widget ) {
79
- widget.find( '.color-picker' ).wpColorPicker( {
80
- change: _.throttle( function() { // For Customizer
81
- $(this).trigger( 'change' );
82
- }, 3000 )
83
- });
84
- }
85
-
86
- function onFormUpdate( event, widget ) {
87
- initColorPicker( widget );
88
- }
89
-
90
- $( document ).on( 'widget-added widget-updated', onFormUpdate );
91
-
92
- $( document ).ready( function() {
93
- $( '#widgets-right .widget:has(.color-picker)' ).each( function () {
94
- initColorPicker( $( this ) );
95
- } );
96
- } );
97
- }( jQuery ) );
98
- </script>
99
- <?php
100
- }
101
-
102
- /**
103
- * Display the post content. Optionally allows post ID to be passed
104
- *
105
- * @link http://stephenharris.info/get-post-content-by-id/
106
- * @link http://wordpress.stackexchange.com/a/143316
107
- *
108
- * @access public
109
- * @since 1.0
110
- *
111
- * @param int $post_id Optional. Post ID.
112
- *
113
- * @return string
114
- */
115
- public function the_content( $post_id = 0 ) {
116
-
117
- global $post;
118
- $post = get_post( $post_id );
119
- setup_postdata( $post );
120
- ob_start();
121
- the_content();
122
- $content = ob_get_clean();
123
- wp_reset_postdata();
124
-
125
- return $content;
126
- }
127
-
128
- /**
129
- * Renders the widgets.
130
- *
131
- * @access private
132
- * @since 1.0
133
- *
134
- * @param array $args
135
- * @param array $instance
136
- */
137
- public function widget( $args, $instance ) {
138
-
139
- if ( is_404() || is_archive() || is_search() || ( ! is_front_page() && is_home() ) ) return;
140
-
141
- //global $wp_query;
142
-
143
- //$find = $replace = array();
144
- //$post = get_post( $wp_query->post->ID );
145
- //$post = ezTOC_Post::get( get_the_ID() );//->applyContentFilter()->process();
146
- $post = ezTOC::get( get_the_ID() );
147
-
148
- /**
149
- * @link https://wordpress.org/support/topic/fatal-error-when-trying-to-access-widget-area/
150
- */
151
- if ( ! $post instanceof ezTOC_Post ) return;
152
-
153
- /*
154
- * Ensure the ezTOC content filter is not applied when running `the_content` filter.
155
- */
156
- //remove_filter( 'the_content', array( 'ezTOC', 'the_content' ), 100 );
157
- //$post->post_content = apply_filters( 'the_content', $post->post_content );
158
- //add_filter( 'the_content', array( 'ezTOC', 'the_content' ), 100 );
159
-
160
- if ( $post->hasTOCItems() ) {
161
-
162
- /**
163
- * @var string $before_widget
164
- * @var string $after_widget
165
- * @var string $before_title
166
- * @var string $after_title
167
- */
168
- extract( $args );
169
-
170
- $class = array(
171
- 'ez-toc-v' . str_replace( '.', '_', ezTOC::VERSION ),
172
- 'ez-toc-widget',
173
- );
174
-
175
- $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
176
- //$items = ezTOC::extract_headings( $find, $replace, $post );
177
-
178
- if ( false !== strpos( $title, '%PAGE_TITLE%' ) || false !== strpos( $title, '%PAGE_NAME%' ) ) {
179
-
180
- $title = str_replace( '%PAGE_TITLE%', get_the_title(), $title );
181
- }
182
-
183
- if ( ezTOC_Option::get( 'show_hierarchy' ) ) {
184
-
185
- $class[] = 'counter-hierarchy';
186
-
187
- } else {
188
-
189
- $class[] = 'counter-flat';
190
- }
191
-
192
- switch ( ezTOC_Option::get( 'counter' ) ) {
193
-
194
- case 'numeric':
195
- $class[] = 'counter-numeric';
196
- break;
197
-
198
- case 'roman':
199
- $class[] = 'counter-roman';
200
- break;
201
-
202
- case 'decimal':
203
- $class[] = 'counter-decimal';
204
- break;
205
-
206
- case 'hyphen':
207
- $class[] = 'counter-hyphen';
208
- break;
209
-
210
- case 'disc':
211
- $class[] = 'counter-disc';
212
- break;
213
-
214
- }
215
-
216
- if ( $instance['affix'] ) {
217
-
218
- $class[] = 'ez-toc-affix';
219
- }
220
-
221
- $custom_classes = ezTOC_Option::get( 'css_container_class', '' );
222
-
223
- if ( 0 < strlen( $custom_classes ) ) {
224
-
225
- $custom_classes = explode( ' ', $custom_classes );
226
- $custom_classes = apply_filters( 'ez_toc_container_class', $custom_classes, $this );
227
-
228
- if ( is_array( $custom_classes ) ) {
229
-
230
- $class = array_merge( $class, $custom_classes );
231
- }
232
- }
233
-
234
- $class = array_filter( $class );
235
- $class = array_map( 'trim', $class );
236
- $class = array_map( 'sanitize_html_class', $class );
237
-
238
- echo $before_widget;
239
- do_action( 'ez_toc_before_widget_container');
240
-
241
- echo '<div class="ez-toc-widget-container ' . implode( ' ', $class ) . '">' . PHP_EOL;
242
-
243
- do_action( 'ez_toc_before_widget' );
244
-
245
- /**
246
- * @todo Instead of inline style, use the shadow DOM.
247
- * @link https://css-tricks.com/playing-shadow-dom/
248
- *
249
- * @todo Consider not outputting the style if CSS is disabled.
250
- * @link https://wordpress.org/support/topic/inline-styling-triggers-html-validation-error/
251
- */
252
-
253
- if ( 0 < strlen( $title ) ) {
254
-
255
- ?>
256
-
257
- <?php echo $before_title; ?>
258
-
259
- <span class="ez-toc-title-container">
260
-
261
- <style type="text/css">
262
- #<?php echo $this->id ?> .ez-toc-widget-container ul.ez-toc-list li.active{
263
- background-color: <?php echo esc_attr( $instance['highlight_color'] ); ?>;
264
- }
265
- </style>
266
-
267
- <span class="ez-toc-title"><?php echo $title; ?></span>
268
-
269
- <span class="ez-toc-title-toggle">
270
-
271
- <?php
272
- if ( ezTOC_Option::get( 'visibility' ) ) {
273
-
274
- echo '<a class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></a>';
275
- }
276
- ?>
277
-
278
- </span>
279
-
280
- </span>
281
-
282
- <?php echo $after_title; ?>
283
-
284
- <?php
285
- }
286
- do_action( 'ez_toc_before' );
287
- echo '<nav>'. PHP_EOL . $post->getTOCList() . '</nav>' . PHP_EOL;
288
- do_action( 'ez_toc_after' );
289
- do_action( 'ez_toc_after_widget' );
290
-
291
- echo '</div>' . PHP_EOL;
292
- do_action( 'ez_toc_after_widget_container' );
293
-
294
- echo $after_widget;
295
-
296
- // Enqueue the script.
297
- wp_enqueue_script( 'ez-toc-js' );
298
- }
299
- }
300
-
301
- /**
302
- * Update the widget settings.
303
- *
304
- * @access private
305
- * @since 1.0
306
- *
307
- * @param array $new_instance
308
- * @param array $old_instance
309
- *
310
- * @return array
311
- */
312
- public function update( $new_instance, $old_instance ) {
313
-
314
- $instance = $old_instance;
315
-
316
- $instance['title'] = strip_tags( $new_instance['title'] );
317
-
318
- $instance['affix'] = array_key_exists( 'affix', $new_instance ) ? $new_instance['affix'] : '0';
319
-
320
- $instance['highlight_color'] = strip_tags( $new_instance['highlight_color'] );
321
-
322
- $instance['hide_inline'] = array_key_exists( 'hide_inline', $new_instance ) ? $new_instance['hide_inline'] : '0';
323
-
324
- //ezTOC_Option::set( 'show_toc_in_widget_only', $instance['hide_inline'] );
325
- //ezTOC_Option::set( 'show_toc_in_widget_only_post_types', $new_instance['show_toc_in_widget_only_post_types'] );
326
-
327
- return $instance;
328
- }
329
-
330
- /**
331
- * Displays the widget settings on the Widgets admin page.
332
- *
333
- * @access private
334
- * @since 1.0
335
- *
336
- * @param array $instance
337
- *
338
- * @return string|void
339
- */
340
- public function form( $instance ) {
341
-
342
- $defaults = array(
343
- 'affix' => '0',
344
- 'highlight_color' => '#ededed',
345
- 'title' => '',
346
- );
347
-
348
- $instance = wp_parse_args( (array) $instance, $defaults );
349
-
350
- $highlight_color = esc_attr( $instance[ 'highlight_color' ] );
351
-
352
- ?>
353
- <p>
354
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'easy-table-of-contents' ); ?>:</label>
355
- <input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>"
356
- name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>"
357
- style="width:100%;"/>
358
- </p>
359
-
360
- <p>
361
- <label for="<?php echo $this->get_field_id( 'highlight_color' ); ?>"><?php _e( 'Active Section Highlight Color:', 'easy-table-of-contents' ); ?></label><br>
362
- <input type="text" name="<?php echo $this->get_field_name( 'highlight_color' ); ?>" class="color-picker" id="<?php echo $this->get_field_id( 'highlight_color' ); ?>" value="<?php echo $highlight_color; ?>" data-default-color="<?php echo $defaults['highlight_color']; ?>" />
363
- </p>
364
-
365
- <p style="display: <?php echo ezTOC_Option::get( 'widget_affix_selector' ) ? 'block' : 'none'; ?>;">
366
- <input class="checkbox" type="checkbox" <?php checked( $instance['affix'], 1 ); ?>
367
- id="<?php echo $this->get_field_id( 'affix' ); ?>"
368
- name="<?php echo $this->get_field_name( 'affix' ); ?>" value="1"/>
369
- <label for="<?php echo $this->get_field_id( 'affix' ); ?>"> <?php _e( 'Affix or pin the widget.', 'easy-table-of-contents' ); ?></label>
370
- </p>
371
-
372
- <p class="description" style="display: <?php echo ezTOC_Option::get( 'widget_affix_selector' ) ? 'block' : 'none'; ?>;">
373
- <?php _e( 'If you choose to affix the widget, do not add any other widgets on the sidebar. Also, make sure you have only one instance Table of Contents widget on the page.', 'easy-table-of-contents' ); ?>
374
- </p>
375
- <?php
376
- }
377
-
378
- } // end class
379
-
380
- add_action( 'widgets_init', array( 'ezTOC_Widget', 'register' ) );
381
- }
1
+ <?php
2
+ // Exit if accessed directly
3
+ if ( ! defined( 'ABSPATH' ) ) exit;
4
+
5
+ if ( ! class_exists( 'ezTOC_Widget' ) ) {
6
+
7
+ /**
8
+ * Class ezTOC_Widget
9
+ */
10
+ class ezTOC_Widget extends WP_Widget {
11
+
12
+ /**
13
+ * Setup and register the table of contents widget.
14
+ *
15
+ * @access public
16
+ * @since 1.0
17
+ */
18
+ public function __construct() {
19
+
20
+ $options = array(
21
+ 'classname' => 'ez-toc',
22
+ 'description' => __( 'Display the table of contents.', 'easy-table-of-contents' )
23
+ );
24
+
25
+ parent::__construct(
26
+ 'ezw_tco',
27
+ __( 'Table of Contents', 'easy-table-of-contents' ),
28
+ $options
29
+ );
30
+
31
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueueScripts' ) );
32
+ add_action( 'admin_footer-widgets.php', array( $this, 'printScripts' ), 9999 );
33
+ }
34
+
35
+ /**
36
+ * Callback which registers the widget with the Widget API.
37
+ *
38
+ * @access public
39
+ * @since 1.0
40
+ * @static
41
+ *
42
+ * @return void
43
+ */
44
+ public static function register() {
45
+
46
+ register_widget( __CLASS__ );
47
+ }
48
+
49
+ /**
50
+ * Callback to enqueue scripts on the Widgets admin page.
51
+ *
52
+ * @access private
53
+ * @since 1.0
54
+ *
55
+ * @param string $hook_suffix
56
+ */
57
+ public function enqueueScripts( $hook_suffix ) {
58
+
59
+ if ( 'widgets.php' !== $hook_suffix ) {
60
+ return;
61
+ }
62
+
63
+ wp_enqueue_style( 'wp-color-picker' );
64
+ wp_enqueue_script( 'wp-color-picker' );
65
+ wp_enqueue_script( 'underscore' );
66
+ }
67
+
68
+ /**
69
+ * Callback to print the scripts to the Widgets admin page footer.
70
+ *
71
+ * @access private
72
+ * @since 1.0
73
+ */
74
+ public function printScripts() {
75
+ ?>
76
+ <script>
77
+ ( function( $ ){
78
+ function initColorPicker( widget ) {
79
+ widget.find( '.color-picker' ).wpColorPicker( {
80
+ change: _.throttle( function() { // For Customizer
81
+ $(this).trigger( 'change' );
82
+ }, 3000 )
83
+ });
84
+ }
85
+
86
+ function onFormUpdate( event, widget ) {
87
+ initColorPicker( widget );
88
+ }
89
+
90
+ $( document ).on( 'widget-added widget-updated', onFormUpdate );
91
+
92
+ $( document ).ready( function() {
93
+ $( '#widgets-right .widget:has(.color-picker)' ).each( function () {
94
+ initColorPicker( $( this ) );
95
+ } );
96
+ } );
97
+ }( jQuery ) );
98
+ </script>
99
+ <?php
100
+ }
101
+
102
+ /**
103
+ * Display the post content. Optionally allows post ID to be passed
104
+ *
105
+ * @link http://stephenharris.info/get-post-content-by-id/
106
+ * @link http://wordpress.stackexchange.com/a/143316
107
+ *
108
+ * @access public
109
+ * @since 1.0
110
+ *
111
+ * @param int $post_id Optional. Post ID.
112
+ *
113
+ * @return string
114
+ */
115
+ public function the_content( $post_id = 0 ) {
116
+
117
+ global $post;
118
+ $post = get_post( $post_id );
119
+ setup_postdata( $post );
120
+ ob_start();
121
+ the_content();
122
+ $content = ob_get_clean();
123
+ wp_reset_postdata();
124
+
125
+ return $content;
126
+ }
127
+
128
+ /**
129
+ * Renders the widgets.
130
+ *
131
+ * @access private
132
+ * @since 1.0
133
+ *
134
+ * @param array $args
135
+ * @param array $instance
136
+ */
137
+ public function widget( $args, $instance ) {
138
+
139
+ if ( is_404() || is_archive() || is_search() || ( ! is_front_page() && is_home() ) ) return;
140
+
141
+ //global $wp_query;
142
+
143
+ //$find = $replace = array();
144
+ //$post = get_post( $wp_query->post->ID );
145
+ //$post = ezTOC_Post::get( get_the_ID() );//->applyContentFilter()->process();
146
+ $post = ezTOC::get( get_the_ID() );
147
+
148
+ /**
149
+ * @link https://wordpress.org/support/topic/fatal-error-when-trying-to-access-widget-area/
150
+ */
151
+ if ( ! $post instanceof ezTOC_Post ) return;
152
+
153
+ /*
154
+ * Ensure the ezTOC content filter is not applied when running `the_content` filter.
155
+ */
156
+ //remove_filter( 'the_content', array( 'ezTOC', 'the_content' ), 100 );
157
+ //$post->post_content = apply_filters( 'the_content', $post->post_content );
158
+ //add_filter( 'the_content', array( 'ezTOC', 'the_content' ), 100 );
159
+
160
+ if ( $post->hasTOCItems() ) {
161
+
162
+ /**
163
+ * @var string $before_widget
164
+ * @var string $after_widget
165
+ * @var string $before_title
166
+ * @var string $after_title
167
+ */
168
+ extract( $args );
169
+
170
+ $class = array(
171
+ 'ez-toc-v' . str_replace( '.', '_', ezTOC::VERSION ),
172
+ 'ez-toc-widget',
173
+ );
174
+
175
+ $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base );
176
+ //$items = ezTOC::extract_headings( $find, $replace, $post );
177
+
178
+ if ( false !== strpos( $title, '%PAGE_TITLE%' ) || false !== strpos( $title, '%PAGE_NAME%' ) ) {
179
+
180
+ $title = str_replace( '%PAGE_TITLE%', get_the_title(), $title );
181
+ }
182
+
183
+ if ( ezTOC_Option::get( 'show_hierarchy' ) ) {
184
+
185
+ $class[] = 'counter-hierarchy';
186
+
187
+ } else {
188
+
189
+ $class[] = 'counter-flat';
190
+ }
191
+
192
+ switch ( ezTOC_Option::get( 'counter' ) ) {
193
+
194
+ case 'numeric':
195
+ $class[] = 'counter-numeric';
196
+ break;
197
+
198
+ case 'roman':
199
+ $class[] = 'counter-roman';
200
+ break;
201
+
202
+ case 'decimal':
203
+ $class[] = 'counter-decimal';
204
+ break;
205
+
206
+ case 'hyphen':
207
+ $class[] = 'counter-hyphen';
208
+ break;
209
+
210
+ case 'disc':
211
+ $class[] = 'counter-disc';
212
+ break;
213
+
214
+ }
215
+
216
+ if ( $instance['affix'] ) {
217
+
218
+ $class[] = 'ez-toc-affix';
219
+ }
220
+
221
+ $custom_classes = ezTOC_Option::get( 'css_container_class', '' );
222
+
223
+ if ( 0 < strlen( $custom_classes ) ) {
224
+
225
+ $custom_classes = explode( ' ', $custom_classes );
226
+ $custom_classes = apply_filters( 'ez_toc_container_class', $custom_classes, $this );
227
+
228
+ if ( is_array( $custom_classes ) ) {
229
+
230
+ $class = array_merge( $class, $custom_classes );
231
+ }
232
+ }
233
+
234
+ $class = array_filter( $class );
235
+ $class = array_map( 'trim', $class );
236
+ $class = array_map( 'sanitize_html_class', $class );
237
+
238
+ echo $before_widget;
239
+ do_action( 'ez_toc_before_widget_container');
240
+
241
+ echo '<div class="ez-toc-widget-container ' . implode( ' ', $class ) . '">' . PHP_EOL;
242
+
243
+ do_action( 'ez_toc_before_widget' );
244
+
245
+ /**
246
+ * @todo Instead of inline style, use the shadow DOM.
247
+ * @link https://css-tricks.com/playing-shadow-dom/
248
+ *
249
+ * @todo Consider not outputting the style if CSS is disabled.
250
+ * @link https://wordpress.org/support/topic/inline-styling-triggers-html-validation-error/
251
+ */
252
+
253
+ if ( 0 < strlen( $title ) ) {
254
+
255
+ ?>
256
+
257
+ <?php echo $before_title; ?>
258
+
259
+ <span class="ez-toc-title-container">
260
+
261
+ <style type="text/css">
262
+ #<?php echo $this->id ?> .ez-toc-widget-container ul.ez-toc-list li.active{
263
+ background-color: <?php echo esc_attr( $instance['highlight_color'] ); ?>;
264
+ }
265
+ </style>
266
+
267
+ <span class="ez-toc-title"><?php echo $title; ?></span>
268
+
269
+ <span class="ez-toc-title-toggle">
270
+
271
+ <?php
272
+ if ( ezTOC_Option::get( 'visibility' ) ) {
273
+
274
+ echo '<a class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></a>';
275
+ }
276
+ ?>
277
+
278
+ </span>
279
+
280
+ </span>
281
+
282
+ <?php echo $after_title; ?>
283
+
284
+ <?php
285
+ }
286
+ do_action( 'ez_toc_before' );
287
+ echo '<nav>'. PHP_EOL . $post->getTOCList() . '</nav>' . PHP_EOL;
288
+ do_action( 'ez_toc_after' );
289
+ do_action( 'ez_toc_after_widget' );
290
+
291
+ echo '</div>' . PHP_EOL;
292
+ do_action( 'ez_toc_after_widget_container' );
293
+
294
+ echo $after_widget;
295
+
296
+ // Enqueue the script.
297
+ wp_enqueue_script( 'ez-toc-js' );
298
+ }
299
+ }
300
+
301
+ /**
302
+ * Update the widget settings.
303
+ *
304
+ * @access private
305
+ * @since 1.0
306
+ *
307
+ * @param array $new_instance
308
+ * @param array $old_instance
309
+ *
310
+ * @return array
311
+ */
312
+ public function update( $new_instance, $old_instance ) {
313
+
314
+ $instance = $old_instance;
315
+
316
+ $instance['title'] = strip_tags( $new_instance['title'] );
317
+
318
+ $instance['affix'] = array_key_exists( 'affix', $new_instance ) ? $new_instance['affix'] : '0';
319
+
320
+ $instance['highlight_color'] = strip_tags( $new_instance['highlight_color'] );
321
+
322
+ $instance['hide_inline'] = array_key_exists( 'hide_inline', $new_instance ) ? $new_instance['hide_inline'] : '0';
323
+
324
+ //ezTOC_Option::set( 'show_toc_in_widget_only', $instance['hide_inline'] );
325
+ //ezTOC_Option::set( 'show_toc_in_widget_only_post_types', $new_instance['show_toc_in_widget_only_post_types'] );
326
+
327
+ return $instance;
328
+ }
329
+
330
+ /**
331
+ * Displays the widget settings on the Widgets admin page.
332
+ *
333
+ * @access private
334
+ * @since 1.0
335
+ *
336
+ * @param array $instance
337
+ *
338
+ * @return string|void
339
+ */
340
+ public function form( $instance ) {
341
+
342
+ $defaults = array(
343
+ 'affix' => '0',
344
+ 'highlight_color' => '#ededed',
345
+ 'title' => '',
346
+ );
347
+
348
+ $instance = wp_parse_args( (array) $instance, $defaults );
349
+
350
+ $highlight_color = esc_attr( $instance[ 'highlight_color' ] );
351
+
352
+ ?>
353
+ <p>
354
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'easy-table-of-contents' ); ?>:</label>
355
+ <input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>"
356
+ name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>"
357
+ style="width:100%;"/>
358
+ </p>
359
+
360
+ <p>
361
+ <label for="<?php echo $this->get_field_id( 'highlight_color' ); ?>"><?php _e( 'Active Section Highlight Color:', 'easy-table-of-contents' ); ?></label><br>
362
+ <input type="text" name="<?php echo $this->get_field_name( 'highlight_color' ); ?>" class="color-picker" id="<?php echo $this->get_field_id( 'highlight_color' ); ?>" value="<?php echo $highlight_color; ?>" data-default-color="<?php echo $defaults['highlight_color']; ?>" />
363
+ </p>
364
+
365
+ <p style="display: <?php echo ezTOC_Option::get( 'widget_affix_selector' ) ? 'block' : 'none'; ?>;">
366
+ <input class="checkbox" type="checkbox" <?php checked( $instance['affix'], 1 ); ?>
367
+ id="<?php echo $this->get_field_id( 'affix' ); ?>"
368
+ name="<?php echo $this->get_field_name( 'affix' ); ?>" value="1"/>
369
+ <label for="<?php echo $this->get_field_id( 'affix' ); ?>"> <?php _e( 'Affix or pin the widget.', 'easy-table-of-contents' ); ?></label>
370
+ </p>
371
+
372
+ <p class="description" style="display: <?php echo ezTOC_Option::get( 'widget_affix_selector' ) ? 'block' : 'none'; ?>;">
373
+ <?php _e( 'If you choose to affix the widget, do not add any other widgets on the sidebar. Also, make sure you have only one instance Table of Contents widget on the page.', 'easy-table-of-contents' ); ?>
374
+ </p>
375
+ <?php
376
+ }
377
+
378
+ } // end class
379
+
380
+ add_action( 'widgets_init', array( 'ezTOC_Widget', 'register' ) );
381
+ }
includes/helper-function.php CHANGED
@@ -1,121 +1,121 @@
1
- <?php
2
-
3
- /**
4
- * Helper Functions
5
- *
6
- * @package saswp
7
- * @subpackage Helper/Templates
8
- * @copyright Copyright (c) 2016, René Hermenau
9
- * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10
- * @since 1.4.0
11
- */
12
- // Exit if accessed directly
13
- if( !defined( 'ABSPATH' ) )
14
- exit;
15
-
16
- /**
17
- * Helper method to check if user is in the plugins page.
18
- *
19
- * @author René Hermenau
20
- * @since 1.4.0
21
- *
22
- * @return bool
23
- */
24
-
25
- /**
26
- * display deactivation logic on plugins page
27
- *
28
- * @since 1.4.0
29
- */
30
-
31
- add_filter('admin_footer', 'eztoc_add_deactivation_feedback_modal');
32
- function eztoc_add_deactivation_feedback_modal() {
33
-
34
- if( !is_admin()) {
35
- return;
36
- }
37
-
38
- $current_user = wp_get_current_user();
39
- if( !($current_user instanceof WP_User) ) {
40
- $email = '';
41
- } else {
42
- $email = trim( $current_user->user_email );
43
- }
44
- require_once EZ_TOC_PATH ."/includes/deactivate-feedback.php";
45
- }
46
-
47
- /**
48
- * send feedback via email
49
- *
50
- * @since 1.4.0
51
- */
52
- function eztoc_send_feedback() {
53
-
54
- if( isset( $_POST['data'] ) ) {
55
- parse_str( $_POST['data'], $form );
56
- }
57
-
58
- $text = '';
59
- if( isset( $form['eztoc_disable_text'] ) ) {
60
- $text = implode( "\n\r", $form['eztoc_disable_text'] );
61
- }
62
-
63
- $headers = array();
64
-
65
- $from = isset( $form['eztoc_disable_from'] ) ? $form['eztoc_disable_from'] : '';
66
- if( $from ) {
67
- $headers[] = "From: $from";
68
- $headers[] = "Reply-To: $from";
69
- }
70
-
71
- $subject = isset( $form['eztoc_disable_reason'] ) ? $form['eztoc_disable_reason'] : '(no reason given)';
72
-
73
- if($subject == 'technical issue'){
74
-
75
- $text = trim($text);
76
-
77
- if(!empty($text)){
78
-
79
- $text = 'technical issue description: '.$text;
80
-
81
- }else{
82
-
83
- $text = 'no description: '.$text;
84
- }
85
-
86
- }
87
-
88
- $success = wp_mail( 'team@magazine3.in', $subject, $text, $headers );
89
-
90
- die();
91
- }
92
- add_action( 'wp_ajax_eztoc_send_feedback', 'eztoc_send_feedback' );
93
-
94
- function eztoc_enqueue_makebetter_email_js(){
95
-
96
- if( !is_admin() ) {
97
- return;
98
- }
99
-
100
- wp_enqueue_script( 'eztoc-make-better-js', EZ_TOC_URL . 'includes/feedback.js', array( 'jquery' ));
101
-
102
- wp_enqueue_style( 'eztoc-make-better-css', EZ_TOC_URL . 'includes/feedback.css', false );
103
- }
104
- add_action( 'admin_enqueue_scripts', 'eztoc_enqueue_makebetter_email_js' );
105
-
106
-
107
- add_action('wp_ajax_eztoc_subscribe_newsletter','eztoc_subscribe_for_newsletter');
108
- add_action('wp_ajax_nopriv_eztoc_subscribe_newsletter','eztoc_subscribe_for_newsletter');
109
- function eztoc_subscribe_for_newsletter(){
110
- $api_url = 'http://magazine3.company/wp-json/api/central/email/subscribe';
111
- $api_params = array(
112
- 'name' => sanitize_text_field($_POST['name']),
113
- 'email'=> sanitize_text_field($_POST['email']),
114
- 'website'=> sanitize_text_field($_POST['website']),
115
- 'type'=> 'eztoc'
116
- );
117
- $response = wp_remote_post( $api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
118
- $response = wp_remote_retrieve_body( $response );
119
- echo $response;
120
- die;
121
  }
1
+ <?php
2
+
3
+ /**
4
+ * Helper Functions
5
+ *
6
+ * @package saswp
7
+ * @subpackage Helper/Templates
8
+ * @copyright Copyright (c) 2016, René Hermenau
9
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10
+ * @since 1.4.0
11
+ */
12
+ // Exit if accessed directly
13
+ if( !defined( 'ABSPATH' ) )
14
+ exit;
15
+
16
+ /**
17
+ * Helper method to check if user is in the plugins page.
18
+ *
19
+ * @author René Hermenau
20
+ * @since 1.4.0
21
+ *
22
+ * @return bool
23
+ */
24
+
25
+ /**
26
+ * display deactivation logic on plugins page
27
+ *
28
+ * @since 1.4.0
29
+ */
30
+
31
+ add_filter('admin_footer', 'eztoc_add_deactivation_feedback_modal');
32
+ function eztoc_add_deactivation_feedback_modal() {
33
+
34
+ if( !is_admin()) {
35
+ return;
36
+ }
37
+
38
+ $current_user = wp_get_current_user();
39
+ if( !($current_user instanceof WP_User) ) {
40
+ $email = '';
41
+ } else {
42
+ $email = trim( $current_user->user_email );
43
+ }
44
+ require_once EZ_TOC_PATH ."/includes/deactivate-feedback.php";
45
+ }
46
+
47
+ /**
48
+ * send feedback via email
49
+ *
50
+ * @since 1.4.0
51
+ */
52
+ function eztoc_send_feedback() {
53
+
54
+ if( isset( $_POST['data'] ) ) {
55
+ parse_str( $_POST['data'], $form );
56
+ }
57
+
58
+ $text = '';
59
+ if( isset( $form['eztoc_disable_text'] ) ) {
60
+ $text = implode( "\n\r", $form['eztoc_disable_text'] );
61
+ }
62
+
63
+ $headers = array();
64
+
65
+ $from = isset( $form['eztoc_disable_from'] ) ? $form['eztoc_disable_from'] : '';
66
+ if( $from ) {
67
+ $headers[] = "From: $from";
68
+ $headers[] = "Reply-To: $from";
69
+ }
70
+
71
+ $subject = isset( $form['eztoc_disable_reason'] ) ? $form['eztoc_disable_reason'] : '(no reason given)';
72
+
73
+ if($subject == 'technical issue'){
74
+
75
+ $text = trim($text);
76
+
77
+ if(!empty($text)){
78
+
79
+ $text = 'technical issue description: '.$text;
80
+
81
+ }else{
82
+
83
+ $text = 'no description: '.$text;
84
+ }
85
+
86
+ }
87
+
88
+ $success = wp_mail( 'team@magazine3.in', $subject, $text, $headers );
89
+
90
+ die();
91
+ }
92
+ add_action( 'wp_ajax_eztoc_send_feedback', 'eztoc_send_feedback' );
93
+
94
+ function eztoc_enqueue_makebetter_email_js(){
95
+
96
+ if( !is_admin() ) {
97
+ return;
98
+ }
99
+
100
+ wp_enqueue_script( 'eztoc-make-better-js', EZ_TOC_URL . 'includes/feedback.js', array( 'jquery' ));
101
+
102
+ wp_enqueue_style( 'eztoc-make-better-css', EZ_TOC_URL . 'includes/feedback.css', false );
103
+ }
104
+ add_action( 'admin_enqueue_scripts', 'eztoc_enqueue_makebetter_email_js' );
105
+
106
+
107
+ add_action('wp_ajax_eztoc_subscribe_newsletter','eztoc_subscribe_for_newsletter');
108
+ add_action('wp_ajax_nopriv_eztoc_subscribe_newsletter','eztoc_subscribe_for_newsletter');
109
+ function eztoc_subscribe_for_newsletter(){
110
+ $api_url = 'http://magazine3.company/wp-json/api/central/email/subscribe';
111
+ $api_params = array(
112
+ 'name' => sanitize_text_field($_POST['name']),
113
+ 'email'=> sanitize_text_field($_POST['email']),
114
+ 'website'=> sanitize_text_field($_POST['website']),
115
+ 'type'=> 'eztoc'
116
+ );
117
+ $response = wp_remote_post( $api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
118
+ $response = wp_remote_retrieve_body( $response );
119
+ echo $response;
120
+ die;
121
  }
includes/inc.admin-options-page.php CHANGED
@@ -1,466 +1,466 @@
1
- <div id='toc' class='wrap'>
2
- <a href="https://tocwp.com/" target="_blank" >
3
- <img src="<?php echo plugins_url( 'assets/eztoc-logo.png', dirname(__FILE__) ) ?>" alt="tocwp" srcset="<?php echo plugins_url( 'assets/eztoc-logo.png', dirname(__FILE__) ) ?> 1x, <?php echo plugins_url( 'assets/eztoc-logo.png', dirname(__FILE__) ) ?> 2x" >
4
- </a>
5
- <div class="toc-tab-panel">
6
- <a id="eztoc-welcome" class="eztoc-tablinks" data-href="no" href="#welcome" onclick="tabToggle(event, 'welcome')">Welcome</a>
7
- <a id="eztoc-default" class="eztoc-tablinks" data-href="no" href="#general-settings" onclick="tabToggle(event, 'general')">Settings</a>
8
- <?php
9
- $pro = '';
10
-
11
- if (function_exists('ez_toc_pro_activation_link')) {
12
- $pro = '<a id="eztoc-default" class="eztoc-tablinks" data-href="no" href="#eztoc-prosettings" onclick="tabToggle(event, "prosettings")">PRO Settings</a>';
13
- }?>
14
- <?php echo $pro; ?>
15
-
16
- <?php
17
- if (!function_exists('ez_toc_pro_activation_link')) {?>
18
- <a class="eztoc-tablinks" id="eztoc-freevspro" href="#freevspro-support" onclick="tabToggle(event, 'freevspro')" data-href="no">Free vs PRO</a>
19
- <?php }
20
- ?>
21
- <a class="eztoc-tablinks" id="eztoc-technical" href="#technical-support" onclick="tabToggle(event, 'technical')" data-href="no">Help & Support</a>
22
- <a class="eztoc-tablinks" id="eztoc-upgrade" href="https://tocwp.com/pricing/" target="_blank" >UPGRADE to PRO</a>
23
- <?php
24
-
25
- if (function_exists('ez_toc_pro_activation_link')) {
26
- $license_info = get_option("easytoc_pro_upgrade_license");
27
- $license_exp = date('Y-m-d', strtotime($license_info['pro']['license_key_expires']));
28
- $today = date('Y-m-d');
29
- $exp_date = $license_exp;
30
- $date1 = date_create($today);
31
- $date2 = date_create($exp_date);
32
- $diff = date_diff($date1,$date2);
33
- $days = $diff->format("%a");
34
- $days = intval($days);?>
35
- <a class="eztoc-tablinks" id="eztoc-license" href="#license" onclick="tabToggle(event, 'license')" data-href="no">License</a>
36
- <?php
37
- if( $days < 30 ){?>
38
- <span class="dashicons dashicons-warning" style="color: #ffb229;position: relative;top: 15px;left: -10px;"></span>
39
- <?php } }?>
40
- </div><!-- /.Tab panel -->
41
- <div class="eztoc_support_div eztoc-tabcontent" id="welcome" style="display: block;">
42
- <p style="font-weight: bold;font-size: 30px;color: #000;">Thank YOU for using Easy Table of Content. </p>
43
- <p style="font-size: 18px;padding: 0 10%;line-height: 1.7;color: #000;">We strive to create the best TOC solution in WordPress. Our dedicated development team does continious development and innoviation to make sure we are able to meet your demand.</p>
44
- <p style="font-size: 16px;font-weight: 600;color: #000;">Please support us by Upgrading to Premium verison.</p>
45
- <a target="_blank" href="https://tocwp.com/pricing/"><button class="button-toc" style="display: inline-block;font-size: 20px;">
46
- <span>YES! I want to Support by UPGRADING.</span></button></a>
47
- <a href="<?php echo add_query_arg( 'page', 'table-of-contents', admin_url( 'options-general.php' ) ); ?>" style="text-decoration: none;"><button class="button-toc1" style="display: block;text-align: center;border: 0;margin: 0 auto;background: none;">
48
- <span style="cursor: pointer;">No Thanks, I will stick with FREE version for now.</span></button></a>
49
- </div><!-- /.Welcome ended -->
50
- <div class="eztoc-tabcontent" id="general">
51
- <div id="eztoc-tabs" style="margin-top: 10px;"><a href="#eztoc-general">General</a> | <a href="#eztoc-appearance" >Appearance</a> | <a href="#eztoc-advanced" >Advanced</a></div>
52
- <form method="post" action="<?php echo esc_url( self_admin_url( 'options.php' ) ); ?>">
53
-
54
- <div class="metabox-holder">
55
-
56
- <div class="postbox" id="eztoc-general">
57
- <h3><span><?php _e( 'General', 'easy-table-of-contents' ); ?></span></h3>
58
-
59
- <div class="inside">
60
-
61
- <table class="form-table">
62
-
63
- <?php do_settings_fields( 'ez_toc_settings_general', 'ez_toc_settings_general' ); ?>
64
-
65
- </table>
66
-
67
- </div><!-- /.inside -->
68
- </div><!-- /.postbox -->
69
-
70
- </div><!-- /.metabox-holder -->
71
-
72
- <div class="metabox-holder">
73
-
74
- <div class="postbox" id="eztoc-appearance">
75
- <h3><span><?php _e( 'Appearance', 'easy-table-of-contents' ); ?></span></h3>
76
-
77
- <div class="inside">
78
-
79
- <table class="form-table">
80
-
81
- <?php do_settings_fields( 'ez_toc_settings_appearance', 'ez_toc_settings_appearance' ); ?>
82
-
83
- </table>
84
-
85
- </div><!-- /.inside -->
86
- </div><!-- /.postbox -->
87
-
88
- </div><!-- /.metabox-holder -->
89
-
90
- <div class="metabox-holder">
91
-
92
- <div class="postbox" id="eztoc-advanced">
93
- <h3><span><?php _e( 'Advanced', 'easy-table-of-contents' ); ?></span></h3>
94
-
95
- <div class="inside">
96
-
97
- <table class="form-table">
98
-
99
- <?php do_settings_fields( 'ez_toc_settings_advanced', 'ez_toc_settings_advanced' ); ?>
100
-
101
- </table>
102
-
103
- </div><!-- /.inside -->
104
- </div><!-- /.postbox -->
105
-
106
- </div><!-- /.metabox-holder -->
107
- <?php if (function_exists('ez_toc_pro_activation_link')) {?>
108
- <div class="metabox-holder">
109
-
110
- <div class="postbox" id="eztoc-prosettings">
111
- <h3><span><?php _e( 'PRO Settings', 'easy-table-of-contents' ); ?></span></h3>
112
- <div class="inside">
113
-
114
- <table class="form-table">
115
- <?php do_settings_fields( 'ez_toc_settings_prosettings', 'ez_toc_settings_prosettings' ); ?>
116
-
117
- </table>
118
-
119
- </div><!-- /.inside -->
120
- </div><!-- /.postbox -->
121
-
122
- </div><!-- /.metabox-holder -->
123
- <?php } ?>
124
- <?php settings_fields( 'ez-toc-settings' ); ?>
125
- <?php submit_button( __( 'Save Changes', 'easy-table-of-contents' ) ); ?>
126
- </form>
127
- </div><!-- /.General Settings ended -->
128
-
129
-
130
-
131
-
132
- <div class="eztoc_support_div eztoc-tabcontent" id="technical">
133
- <div class="eztoc-form-page-ui">
134
- <div class="eztoc-left-side">
135
- <p><?php echo esc_html__('We are dedicated to provide Technical support & Help to our users. Use the below form for sending your questions.','easy-table-of-contents') ?> </p>
136
- <p><?php echo esc_html__('You can also contact us from ','easy-table-of-contents') ?><a href="https://tocwp.com/contact/">https://tocwp.com/contact/</a>.</p>
137
-
138
- <div class="eztoc_support_div_form" id="technical-form">
139
- <ul>
140
- <li>
141
- <label class="support-label">Email<span class="star-mark">*</span></label>
142
- <div class="support-input">
143
-
144
- <input type="text" id="eztoc_query_email" name="eztoc_query_email" placeholder="Enter your Email" required>
145
- </div>
146
- </li>
147
-
148
- <li>
149
- <label class="support-label">Query<span class="star-mark">*</span></label>
150
-
151
- <div class="support-input"><textarea rows="5" cols="50" id="eztoc_query_message" name="eztoc_query_message" placeholder="Write your query"></textarea>
152
- </div>
153
-
154
-
155
- </li>
156
-
157
- </ul>
158
- <li>
159
- <div class="eztoc-customer-type">
160
- <label class="support-label">Type</label>
161
- <div class="support-input">
162
- <select name="eztoc_customer_type" id="eztoc_customer_type">
163
- <option value="select">Select Customer Type</option>
164
- <option value="paid">Paid<span> (Response within 24 hrs)</span></option>
165
- <option value="free">Free<span> ( Avg Response within 48-72 hrs)</span></option>
166
- </select>
167
- </div>
168
- </div>
169
- </li>
170
- <li><button class="button button-primary eztoc-send-query"><?php echo esc_html__('Send Support Request','easy-table-of-contents'); ?></button></li>
171
- </ul>
172
- <div class="clear"> </div>
173
- <span class="eztoc-query-success eztoc-result eztoc_hide"><?php echo esc_html__('Message sent successfully, Please wait we will get back to you shortly','easy-table-of-contents'); ?></span>
174
- <span class="eztoc-query-error eztoc-result eztoc_hide"><?php echo esc_html__('Message not sent. please check your network connection','easy-table-of-contents'); ?></span>
175
- </div>
176
- </div>
177
- <div class="eztoc-right-side">
178
- <div class="eztoc-bio-box" id="ez_Bio">
179
- <h1>Vision & Mission</h1>
180
- <p class="eztoc-p">We strive to provide the best TOC in the world.</p>
181
- <section class="eztoc_dev-bio">
182
- <div class="ezoc-bio-wrap">
183
- <img width="50px" height="50px" src="<?php echo plugins_url( 'assets/ahmed-kaludi.jpg', dirname(__FILE__) ) ?>">
184
- <p>Lead Dev</p>
185
- </div>
186
- <div class="ezoc-bio-wrap">
187
- <img width="50px" height="50px" src="<?php echo plugins_url( 'assets/Mohammed-kaludi.jpeg', dirname(__FILE__) ) ?>">
188
- <p>Developer</p>
189
- </div>
190
- <div class="ezoc-bio-wrap">
191
- <img width="50px" height="50px" src="<?php echo plugins_url( 'assets/zabi.jpg', dirname(__FILE__) ) ?>">
192
- <p>Developer</p>
193
- </div>
194
- </section>
195
- <p class="eztoc_boxdesk"> Delivering a good user experience means a lot to us, so we try our best to reply each and every question.</p>
196
- <p class="company-link"> Support the innovation & development by upgrading to PRO <a href="https://tocwp.com/pricing/">I Want To Upgrade!</a></p>
197
- </div>
198
- </div> </div> </div> <!-- /.Technical support div ended -->
199
-
200
- <div class="eztoc_support_div eztoc-tabcontent" id="freevspro">
201
- <div class="eztoc-wrapper">
202
- <div class="eztoc-wr">
203
- <div class="etoc-eztoc-img">
204
- <span class="sp_ov"></span>
205
- </div>
206
- <div class="etoc-eztoc-cnt">
207
- <h1><?php _e( 'UPGRADE to PRO Version'); ?></h1>
208
- <p><?php _e( 'Take your Table of Contents to the NEXT Level!', 'easy-table-of-contents' ); ?></p>
209
- <a class="buy" href="#upgrade"><?php _e( 'Purchase Now', 'easy-table-of-contents' ); ?></a>
210
- </div>
211
- <div class="pvf">
212
- <div class="ext">
213
- <div class="ex-1 e-1">
214
- <h4><?php _e( 'Premium Features', 'easy-table-of-contents' ); ?></h4>
215
- <p><?php _e( 'Easy TOC Pro will enhances your website table of contents and takes it to a next level to help you reach more engagement and personalization with your users.', 'easy-table-of-contents' ); ?></p>
216
- </div>
217
- <div class="ex-1 e-2">
218
- <h4><?php _e( 'Continuous Innovation', 'easy-table-of-contents' ); ?></h4>
219
- <p><?php _e( 'We are planning to continiously build premium features and release them. We have a roadmap and we listen to our customers to turn their feedback into reality.', 'easy-table-of-contents' ); ?></p>
220
- </div>
221
- <div class="ex-1 e-3">
222
- <h4><?php _e( 'Tech Support', 'easy-table-of-contents' ); ?></h4>
223
- <p><?php _e( 'Get private ticketing help from our full-time technical staff & developers who helps you with the technical issues.', 'easy-table-of-contents' ); ?></p>
224
- </div>
225
- </div><!-- /. ext -->
226
- <div class="pvf-cnt">
227
- <div class="pvf-tlt">
228
- <h2><?php _e( 'Compare Pro vs. Free Version', 'easy-table-of-contents' ); ?></h2>
229
- <span><?php _e( 'See what you\'ll get with the professional version', 'easy-table-of-contents' ); ?></span>
230
- </div>
231
- <div class="pvf-cmp">
232
- <div class="fr">
233
- <h1>FREE</h1>
234
- <div class="fr-fe">
235
- <div class="fe-1">
236
- <h4><?php _e( 'Continious Development', 'easy-table-of-contents' ); ?></h4>
237
- <p><?php _e( 'We take bug reports and feature requests seriously. We’re continiously developing &amp; improve this product for last 2 years with passion and love.', 'easy-table-of-contents' ); ?></p>
238
- </div>
239
- <div class="fe-1">
240
- <h4><?php _e( '50+ Features', 'easy-table-of-contents' ); ?></h4>
241
- <p><?php _e( 'We\'re constantly expanding the plugin and make it more useful. We have wide variety of features which will fit any use-case.', 'easy-table-of-contents' ); ?></p>
242
- </div>
243
- </div><!-- /. fr-fe -->
244
- </div><!-- /. fr -->
245
- <div class="pr">
246
- <h1>PRO</h1>
247
- <div class="pr-fe">
248
- <span><?php _e( 'Everything in Free, and:', 'easy-table-of-contents' ); ?></span>
249
- <div class="fet">
250
- <div class="fe-2">
251
- <div class="fe-t">
252
- <img src="<?php echo plugins_url( 'assets/right-tick.png', dirname(__FILE__) ) ?>">
253
- <h4><?php _e( 'Gutenberg Block', 'easy-table-of-contents' ); ?></h4>
254
- </div>
255
- <p><?php _e( 'Easily create TOC in Gutenberg block without the need any coding or shortcode.', 'easy-table-of-contents' ); ?></p>
256
- </div>
257
- <div class="fe-2">
258
- <div class="fe-t">
259
- <img src="<?php echo plugins_url( 'assets/right-tick.png', dirname(__FILE__) ) ?>">
260
- <h4><?php _e( 'Elementor Widget', 'easy-table-of-contents' ); ?></h4>
261
- </div>
262
- <p><?php _e( 'Easily create TOC in Elementor with the widget without the need any coding or shortcode.', 'easy-table-of-contents' ); ?></p>
263
- </div>
264
-
265
- <div class="fe-2">
266
- <div class="fe-t">
267
- <img src="<?php echo plugins_url( 'assets/right-tick.png', dirname(__FILE__) ) ?>">
268
- <h4>Fixed/Sticky TOC</h4>
269
- </div>
270
- <p>Users can faster find the content they want with sticky</p>
271
- </div>
272
-
273
-
274
- <div class="fe-2">
275
- <div class="fe-t">
276
- <img src="<?php echo plugins_url( 'assets/right-tick.png', dirname(__FILE__) ) ?>">
277
- <h4>Full AMP Support</h4>
278
- </div>
279
- <p>Generates a table of contents with your existing setup and makes them AMP automatically.</p>
280
- </div>
281
- <div class="fe-2">
282
- <div class="fe-t">
283
- <img src="<?php echo plugins_url( 'assets/right-tick.png', dirname(__FILE__) ) ?>">
284
- <h4>Continious Updates</h4>
285
- </div>
286
- <p>We're continiously updating our premium features and releasing them.</p>
287
- </div>
288
- <div class="fe-2">
289
- <div class="fe-t">
290
- <img src="<?php echo plugins_url( 'assets/right-tick.png', dirname(__FILE__) ) ?>">
291
- <h4>Documentation</h4>
292
- </div>
293
- <p>We create tutorials for every possible feature and keep it updated for you.</p>
294
- </div>
295
- </div><!-- /. fet -->
296
- <div class="pr-btn">
297
- <a href="#upgrade">Upgrade to Pro</a>
298
- </div><!-- /. pr-btn -->
299
- </div><!-- /. pr-fe -->
300
- </div><!-- /.pr -->
301
- </div><!-- /. pvf-cmp -->
302
- </div><!-- /. pvf-cnt -->
303
- <div id="upgrade" class="amp-upg">
304
- <div class="upg-t">
305
- <h2>Let's Upgrade Your Easy Table of Contents</h2>
306
- <span>Choose your plan and upgrade in minutes!</span>
307
- </div>
308
- <div class="etoc-pri-lst">
309
- <div class="pri-tb">
310
- <a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=1" target="_blank">
311
- <h5>PERSONAL</h5>
312
- <span class="d-amt"><sup>$</sup>49</span>
313
- <span class="amt"><sup>$</sup>49</span>
314
- <span class="s-amt">(Save $59)</span>
315
- <span class="bil">Billed Annually</span>
316
- <span class="s">1 Site License</span>
317
- <span class="e">Tech Support</span>
318
- <span class="f">1 year Updates </span>
319
- <span class="etoc-sv">Pro Features </span>
320
- <span class="pri-by">Buy Now</span>
321
- </a>
322
- </div>
323
- <div class="pri-tb rec">
324
- <a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=2" target="_blank">
325
- <h5>MULTIPLE</h5>
326
- <span class="d-amt"><sup>$</sup>69</span>
327
- <span class="amt"><sup>$</sup>69</span>
328
- <span class="s-amt">(Save $79)</span>
329
- <span class="bil">Billed Annually</span>
330
- <span class="s">3 Site License</span>
331
- <span class="e">Tech Support</span>
332
- <span class="f">1 year Updates</span>
333
- <span class="etoc-sv">Save 78%</span>
334
- <span class="pri-by">Buy Now</span>
335
- <span class="etoc-rcm">RECOMMENDED</span>
336
- </a>
337
- </div>
338
- <div class="pri-tb">
339
- <a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=3" target="_blank">
340
- <h5>WEBMASTER</h5>
341
- <span class="d-amt"><sup>$</sup>79</span>
342
- <span class="amt"><sup>$</sup>79</span>
343
- <span class="s-amt">(Save $99)</span>
344
- <span class="bil">Billed Annually</span>
345
- <span class="s">10 Site License</span>
346
- <span class="e">Tech Support</span>
347
- <span class="f">1 year Updates</span>
348
- <span class="etoc-sv">Save 83%</span>
349
- <span class="pri-by">Buy Now</span>
350
- </a>
351
- </div>
352
- <div class="pri-tb">
353
- <a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=4" target="_blank">
354
- <h5>FREELANCER</h5>
355
- <span class="d-amt"><sup>$</sup>99</span>
356
- <span class="amt"><sup>$</sup>99</span>
357
- <span class="s-amt">(Save $119)</span>
358
- <span class="bil">Billed Annually</span>
359
- <span class="s">25 Site License</span>
360
- <span class="e">Tech Support</span>
361
- <span class="f">1 year Updates</span>
362
- <span class="etoc-sv">Save 90%</span>
363
- <span class="pri-by">Buy Now</span>
364
- </a>
365
- </div>
366
- <div class="pri-tb">
367
- <a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=5" target="_blank">
368
- <h5>AGENCY</h5>
369
- <span class="d-amt"><sup>$</sup>199</span>
370
- <span class="amt"><sup>$</sup>199</span>
371
- <span class="s-amt">(Save $199)</span>
372
- <span class="bil">Billed Annually</span>
373
- <span class="s">Unlimited Sites</span>
374
- <span class="e">E-mail support</span>
375
- <span class="f">1 year Updates</span>
376
- <span class="etoc-sv">UNLIMITED</span>
377
- <span class="pri-by">Buy Now</span>
378
- </a>
379
- </div>
380
- <div class="pri-tb">
381
- <a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=6" target="_blank">
382
- <h5>LIFETIME</h5>
383
- <span class="d-amt"><sup>$</sup>499</span>
384
- <span class="amt"><sup>$</sup>499</span>
385
- <span class="s-amt">(Save $199)</span>
386
- <span class="bil">Billed Annually</span>
387
- <span class="s">Unlimited Sites</span>
388
- <span class="e">Unlimited E-mail support</span>
389
- <span class="f">Lifetime License</span>
390
- <span class="etoc-sv">UNLIMITED</span>
391
- <span class="pri-by">Buy Now</span>
392
- </a>
393
- </div>
394
- </div><!-- /.pri-lst -->
395
- <div class="tru-us">
396
- <img src="<?php echo plugins_url( 'assets/toc-rating.png', dirname(__FILE__) ) ?>">
397
- <h2>Used by more than 300,000+ Users!</h2>
398
- <p>More than 300k Websites, Blogs &amp; E-Commerce shops are powered by our easy table of contents plugin making it the #1 Independent TOC plugin in WordPress.</p>
399
- <a href="https://wordpress.org/support/plugin/easy-table-of-contents/reviews/?filter=5" target="_blank">Read The Reviews</a>
400
- </div>
401
- </div><!--/ .amp-upg -->
402
- <div class="ampfaq">
403
- <h2>Frequently Asked Questions</h2>
404
- <div class="faq-lst">
405
- <div class="lt">
406
- <ul>
407
- <li>
408
- <span>Is there a setup fee?</span>
409
- <p>No. There are no setup fees on any of our plans</p>
410
- </li>
411
- <li>
412
- <span>What's the time span for your contracts?</span>
413
- <p>All the plans are year-to-year which are subscribed annually except for lifetime plan.</p>
414
- </li>
415
- <li>
416
- <span>What payment methods are accepted?</span>
417
- <p>We accepts PayPal and Credit Card payments.</p>
418
- </li>
419
- <li>
420
- <span>Do you offer support if I need help?</span>
421
- <p>Yes! Top-notch customer support for our paid customers is key for a quality product, so we’ll do our very best to resolve any issues you encounter via our support page.</p>
422
- </li>
423
- <li>
424
- <span>Can I use the plugins after my subscription is expired?</span>
425
- <p>Yes, you can use the plugins but you will not get future updates for those plugins.</p>
426
- </li>
427
- </ul>
428
- </div>
429
- <div class="rt">
430
- <ul>
431
- <li>
432
- <span>Can I cancel my membership at any time?</span>
433
- <p>Yes. You can cancel your membership by contacting us.</p>
434
- </li>
435
- <li>
436
- <span>Can I change my plan later on?</span>
437
- <p>Yes. You can upgrade your plan by contacting us.</p>
438
- </li>
439
- <li>
440
- <span>Do you offer refunds?</span>
441
- <p>You are fully protected by our 100% Money Back Guarantee Unconditional. If during the next 14 days you experience an issue that makes the plugin unusable and we are unable to resolve it, we’ll happily offer a full refund.</p>
442
- </li>
443
- <li>
444
- <span>Do I get updates for the premium plugin?</span>
445
- <p>Yes, you will get updates for all the premium plugins until your subscription is active.</p>
446
- </li>
447
- </ul>
448
- </div>
449
- </div><!-- /.faq-lst -->
450
- <div class="f-cnt">
451
- <span>I have other pre-sale questions, can you help?</span>
452
- <p>All the plans are year-to-year which are subscribed annually.</p>
453
- <a href="https://tocwp.com/contact/'?utm_source=tocwp-plugin&utm_medium=addon-card'" target="_blank">Contact a Human</a>
454
- </div><!-- /.f-cnt -->
455
- </div><!-- /.faq -->
456
- </div><!-- /. pvf -->
457
- </div>
458
- </div>
459
- </div><!-- /.freevspro div ended -->
460
-
461
- <div id="license" class="eztoc_support_div eztoc-tabcontent">
462
- <?php
463
- do_action("admin_upgrade_license_page");
464
- ?>
465
- </div>
466
- </div>
1
+ <div id='toc' class='wrap'>
2
+ <a href="https://tocwp.com/" target="_blank" >
3
+ <img src="<?php echo plugins_url( 'assets/eztoc-logo.png', dirname(__FILE__) ) ?>" alt="tocwp" srcset="<?php echo plugins_url( 'assets/eztoc-logo.png', dirname(__FILE__) ) ?> 1x, <?php echo plugins_url( 'assets/eztoc-logo.png', dirname(__FILE__) ) ?> 2x" >
4
+ </a>
5
+ <div class="toc-tab-panel">
6
+ <a id="eztoc-welcome" class="eztoc-tablinks" data-href="no" href="#welcome" onclick="tabToggle(event, 'welcome')">Welcome</a>
7
+ <a id="eztoc-default" class="eztoc-tablinks" data-href="no" href="#general-settings" onclick="tabToggle(event, 'general')">Settings</a>
8
+ <?php
9
+ $pro = '';
10
+
11
+ if (function_exists('ez_toc_pro_activation_link')) {
12
+ $pro = '<a id="eztoc-default" class="eztoc-tablinks" data-href="no" href="#eztoc-prosettings" onclick="tabToggle(event, "prosettings")">PRO Settings</a>';
13
+ }?>
14
+ <?php echo $pro; ?>
15
+
16
+ <?php
17
+ if (!function_exists('ez_toc_pro_activation_link')) {?>
18
+ <a class="eztoc-tablinks" id="eztoc-freevspro" href="#freevspro-support" onclick="tabToggle(event, 'freevspro')" data-href="no">Free vs PRO</a>
19
+ <?php }
20
+ ?>
21
+ <a class="eztoc-tablinks" id="eztoc-technical" href="#technical-support" onclick="tabToggle(event, 'technical')" data-href="no">Help & Support</a>
22
+ <a class="eztoc-tablinks" id="eztoc-upgrade" href="https://tocwp.com/pricing/" target="_blank" >UPGRADE to PRO</a>
23
+ <?php
24
+
25
+ if (function_exists('ez_toc_pro_activation_link')) {
26
+ $license_info = get_option("easytoc_pro_upgrade_license");
27
+ $license_exp = date('Y-m-d', strtotime($license_info['pro']['license_key_expires']));
28
+ $today = date('Y-m-d');
29
+ $exp_date = $license_exp;
30
+ $date1 = date_create($today);
31
+ $date2 = date_create($exp_date);
32
+ $diff = date_diff($date1,$date2);
33
+ $days = $diff->format("%a");
34
+ $days = intval($days);?>
35
+ <a class="eztoc-tablinks" id="eztoc-license" href="#license" onclick="tabToggle(event, 'license')" data-href="no">License</a>
36
+ <?php
37
+ if( $days < 30 ){?>
38
+ <span class="dashicons dashicons-warning" style="color: #ffb229;position: relative;top: 15px;left: -10px;"></span>
39
+ <?php } }?>
40
+ </div><!-- /.Tab panel -->
41
+ <div class="eztoc_support_div eztoc-tabcontent" id="welcome" style="display: block;">
42
+ <p style="font-weight: bold;font-size: 30px;color: #000;">Thank YOU for using Easy Table of Content. </p>
43
+ <p style="font-size: 18px;padding: 0 10%;line-height: 1.7;color: #000;">We strive to create the best TOC solution in WordPress. Our dedicated development team does continious development and innoviation to make sure we are able to meet your demand.</p>
44
+ <p style="font-size: 16px;font-weight: 600;color: #000;">Please support us by Upgrading to Premium verison.</p>
45
+ <a target="_blank" href="https://tocwp.com/pricing/"><button class="button-toc" style="display: inline-block;font-size: 20px;">
46
+ <span>YES! I want to Support by UPGRADING.</span></button></a>
47
+ <a href="<?php echo add_query_arg( 'page', 'table-of-contents', admin_url( 'options-general.php' ) ); ?>" style="text-decoration: none;"><button class="button-toc1" style="display: block;text-align: center;border: 0;margin: 0 auto;background: none;">
48
+ <span style="cursor: pointer;">No Thanks, I will stick with FREE version for now.</span></button></a>
49
+ </div><!-- /.Welcome ended -->
50
+ <div class="eztoc-tabcontent" id="general">
51
+ <div id="eztoc-tabs" style="margin-top: 10px;"><a href="#eztoc-general">General</a> | <a href="#eztoc-appearance" >Appearance</a> | <a href="#eztoc-advanced" >Advanced</a></div>
52
+ <form method="post" action="<?php echo esc_url( self_admin_url( 'options.php' ) ); ?>">
53
+
54
+ <div class="metabox-holder">
55
+
56
+ <div class="postbox" id="eztoc-general">
57
+ <h3><span><?php _e( 'General', 'easy-table-of-contents' ); ?></span></h3>
58
+
59
+ <div class="inside">
60
+
61
+ <table class="form-table">
62
+
63
+ <?php do_settings_fields( 'ez_toc_settings_general', 'ez_toc_settings_general' ); ?>
64
+
65
+ </table>
66
+
67
+ </div><!-- /.inside -->
68
+ </div><!-- /.postbox -->
69
+
70
+ </div><!-- /.metabox-holder -->
71
+
72
+ <div class="metabox-holder">
73
+
74
+ <div class="postbox" id="eztoc-appearance">
75
+ <h3><span><?php _e( 'Appearance', 'easy-table-of-contents' ); ?></span></h3>
76
+
77
+ <div class="inside">
78
+
79
+ <table class="form-table">
80
+
81
+ <?php do_settings_fields( 'ez_toc_settings_appearance', 'ez_toc_settings_appearance' ); ?>
82
+
83
+ </table>
84
+
85
+ </div><!-- /.inside -->
86
+ </div><!-- /.postbox -->
87
+
88
+ </div><!-- /.metabox-holder -->
89
+
90
+ <div class="metabox-holder">
91
+
92
+ <div class="postbox" id="eztoc-advanced">
93
+ <h3><span><?php _e( 'Advanced', 'easy-table-of-contents' ); ?></span></h3>
94
+
95
+ <div class="inside">
96
+
97
+ <table class="form-table">
98
+
99
+ <?php do_settings_fields( 'ez_toc_settings_advanced', 'ez_toc_settings_advanced' ); ?>
100
+
101
+ </table>
102
+
103
+ </div><!-- /.inside -->
104
+ </div><!-- /.postbox -->
105
+
106
+ </div><!-- /.metabox-holder -->
107
+ <?php if (function_exists('ez_toc_pro_activation_link')) {?>
108
+ <div class="metabox-holder">
109
+
110
+ <div class="postbox" id="eztoc-prosettings">
111
+ <h3><span><?php _e( 'PRO Settings', 'easy-table-of-contents' ); ?></span></h3>
112
+ <div class="inside">
113
+
114
+ <table class="form-table">
115
+ <?php do_settings_fields( 'ez_toc_settings_prosettings', 'ez_toc_settings_prosettings' ); ?>
116
+
117
+ </table>
118
+
119
+ </div><!-- /.inside -->
120
+ </div><!-- /.postbox -->
121
+
122
+ </div><!-- /.metabox-holder -->
123
+ <?php } ?>
124
+ <?php settings_fields( 'ez-toc-settings' ); ?>
125
+ <?php submit_button( __( 'Save Changes', 'easy-table-of-contents' ) ); ?>
126
+ </form>
127
+ </div><!-- /.General Settings ended -->
128
+
129
+
130
+
131
+
132
+ <div class="eztoc_support_div eztoc-tabcontent" id="technical">
133
+ <div class="eztoc-form-page-ui">
134
+ <div class="eztoc-left-side">
135
+ <p><?php echo esc_html__('We are dedicated to provide Technical support & Help to our users. Use the below form for sending your questions.','easy-table-of-contents') ?> </p>
136
+ <p><?php echo esc_html__('You can also contact us from ','easy-table-of-contents') ?><a href="https://tocwp.com/contact/">https://tocwp.com/contact/</a>.</p>
137
+
138
+ <div class="eztoc_support_div_form" id="technical-form">
139
+ <ul>
140
+ <li>
141
+ <label class="support-label">Email<span class="star-mark">*</span></label>
142
+ <div class="support-input">
143
+
144
+ <input type="text" id="eztoc_query_email" name="eztoc_query_email" placeholder="Enter your Email" required>
145
+ </div>
146
+ </li>
147
+
148
+ <li>
149
+ <label class="support-label">Query<span class="star-mark">*</span></label>
150
+
151
+ <div class="support-input"><textarea rows="5" cols="50" id="eztoc_query_message" name="eztoc_query_message" placeholder="Write your query"></textarea>
152
+ </div>
153
+
154
+
155
+ </li>
156
+
157
+ </ul>
158
+ <li>
159
+ <div class="eztoc-customer-type">
160
+ <label class="support-label">Type</label>
161
+ <div class="support-input">
162
+ <select name="eztoc_customer_type" id="eztoc_customer_type">
163
+ <option value="select">Select Customer Type</option>
164
+ <option value="paid">Paid<span> (Response within 24 hrs)</span></option>
165
+ <option value="free">Free<span> ( Avg Response within 48-72 hrs)</span></option>
166
+ </select>
167
+ </div>
168
+ </div>
169
+ </li>
170
+ <li><button class="button button-primary eztoc-send-query"><?php echo esc_html__('Send Support Request','easy-table-of-contents'); ?></button></li>
171
+ </ul>
172
+ <div class="clear"> </div>
173
+ <span class="eztoc-query-success eztoc-result eztoc_hide"><?php echo esc_html__('Message sent successfully, Please wait we will get back to you shortly','easy-table-of-contents'); ?></span>
174
+ <span class="eztoc-query-error eztoc-result eztoc_hide"><?php echo esc_html__('Message not sent. please check your network connection','easy-table-of-contents'); ?></span>
175
+ </div>
176
+ </div>
177
+ <div class="eztoc-right-side">
178
+ <div class="eztoc-bio-box" id="ez_Bio">
179
+ <h1>Vision & Mission</h1>
180
+ <p class="eztoc-p">We strive to provide the best TOC in the world.</p>
181
+ <section class="eztoc_dev-bio">
182
+ <div class="ezoc-bio-wrap">
183
+ <img width="50px" height="50px" src="<?php echo plugins_url( 'assets/ahmed-kaludi.jpg', dirname(__FILE__) ) ?>">
184
+ <p>Lead Dev</p>
185
+ </div>
186
+ <div class="ezoc-bio-wrap">
187
+ <img width="50px" height="50px" src="<?php echo plugins_url( 'assets/Mohammed-kaludi.jpeg', dirname(__FILE__) ) ?>">
188
+ <p>Developer</p>
189
+ </div>
190
+ <div class="ezoc-bio-wrap">
191
+ <img width="50px" height="50px" src="<?php echo plugins_url( 'assets/zabi.jpg', dirname(__FILE__) ) ?>">
192
+ <p>Developer</p>
193
+ </div>
194
+ </section>
195
+ <p class="eztoc_boxdesk"> Delivering a good user experience means a lot to us, so we try our best to reply each and every question.</p>
196
+ <p class="company-link"> Support the innovation & development by upgrading to PRO <a href="https://tocwp.com/pricing/">I Want To Upgrade!</a></p>
197
+ </div>
198
+ </div> </div> </div> <!-- /.Technical support div ended -->
199
+
200
+ <div class="eztoc_support_div eztoc-tabcontent" id="freevspro">
201
+ <div class="eztoc-wrapper">
202
+ <div class="eztoc-wr">
203
+ <div class="etoc-eztoc-img">
204
+ <span class="sp_ov"></span>
205
+ </div>
206
+ <div class="etoc-eztoc-cnt">
207
+ <h1><?php _e( 'UPGRADE to PRO Version'); ?></h1>
208
+ <p><?php _e( 'Take your Table of Contents to the NEXT Level!', 'easy-table-of-contents' ); ?></p>
209
+ <a class="buy" href="#upgrade"><?php _e( 'Purchase Now', 'easy-table-of-contents' ); ?></a>
210
+ </div>
211
+ <div class="pvf">
212
+ <div class="ext">
213
+ <div class="ex-1 e-1">
214
+ <h4><?php _e( 'Premium Features', 'easy-table-of-contents' ); ?></h4>
215
+ <p><?php _e( 'Easy TOC Pro will enhances your website table of contents and takes it to a next level to help you reach more engagement and personalization with your users.', 'easy-table-of-contents' ); ?></p>
216
+ </div>
217
+ <div class="ex-1 e-2">
218
+ <h4><?php _e( 'Continuous Innovation', 'easy-table-of-contents' ); ?></h4>
219
+ <p><?php _e( 'We are planning to continiously build premium features and release them. We have a roadmap and we listen to our customers to turn their feedback into reality.', 'easy-table-of-contents' ); ?></p>
220
+ </div>
221
+ <div class="ex-1 e-3">
222
+ <h4><?php _e( 'Tech Support', 'easy-table-of-contents' ); ?></h4>
223
+ <p><?php _e( 'Get private ticketing help from our full-time technical staff & developers who helps you with the technical issues.', 'easy-table-of-contents' ); ?></p>
224
+ </div>
225
+ </div><!-- /. ext -->
226
+ <div class="pvf-cnt">
227
+ <div class="pvf-tlt">
228
+ <h2><?php _e( 'Compare Pro vs. Free Version', 'easy-table-of-contents' ); ?></h2>
229
+ <span><?php _e( 'See what you\'ll get with the professional version', 'easy-table-of-contents' ); ?></span>
230
+ </div>
231
+ <div class="pvf-cmp">
232
+ <div class="fr">
233
+ <h1>FREE</h1>
234
+ <div class="fr-fe">
235
+ <div class="fe-1">
236
+ <h4><?php _e( 'Continious Development', 'easy-table-of-contents' ); ?></h4>
237
+ <p><?php _e( 'We take bug reports and feature requests seriously. We’re continiously developing &amp; improve this product for last 2 years with passion and love.', 'easy-table-of-contents' ); ?></p>
238
+ </div>
239
+ <div class="fe-1">
240
+ <h4><?php _e( '50+ Features', 'easy-table-of-contents' ); ?></h4>
241
+ <p><?php _e( 'We\'re constantly expanding the plugin and make it more useful. We have wide variety of features which will fit any use-case.', 'easy-table-of-contents' ); ?></p>
242
+ </div>
243
+ </div><!-- /. fr-fe -->
244
+ </div><!-- /. fr -->
245
+ <div class="pr">
246
+ <h1>PRO</h1>
247
+ <div class="pr-fe">
248
+ <span><?php _e( 'Everything in Free, and:', 'easy-table-of-contents' ); ?></span>
249
+ <div class="fet">
250
+ <div class="fe-2">
251
+ <div class="fe-t">
252
+ <img src="<?php echo plugins_url( 'assets/right-tick.png', dirname(__FILE__) ) ?>">
253
+ <h4><?php _e( 'Gutenberg Block', 'easy-table-of-contents' ); ?></h4>
254
+ </div>
255
+ <p><?php _e( 'Easily create TOC in Gutenberg block without the need any coding or shortcode.', 'easy-table-of-contents' ); ?></p>
256
+ </div>
257
+ <div class="fe-2">
258
+ <div class="fe-t">
259
+ <img src="<?php echo plugins_url( 'assets/right-tick.png', dirname(__FILE__) ) ?>">
260
+ <h4><?php _e( 'Elementor Widget', 'easy-table-of-contents' ); ?></h4>
261
+ </div>
262
+ <p><?php _e( 'Easily create TOC in Elementor with the widget without the need any coding or shortcode.', 'easy-table-of-contents' ); ?></p>
263
+ </div>
264
+
265
+ <div class="fe-2">
266
+ <div class="fe-t">
267
+ <img src="<?php echo plugins_url( 'assets/right-tick.png', dirname(__FILE__) ) ?>">
268
+ <h4>Fixed/Sticky TOC</h4>
269
+ </div>
270
+ <p>Users can faster find the content they want with sticky</p>
271
+ </div>
272
+
273
+
274
+ <div class="fe-2">
275
+ <div class="fe-t">
276
+ <img src="<?php echo plugins_url( 'assets/right-tick.png', dirname(__FILE__) ) ?>">
277
+ <h4>Full AMP Support</h4>
278
+ </div>
279
+ <p>Generates a table of contents with your existing setup and makes them AMP automatically.</p>
280
+ </div>
281
+ <div class="fe-2">
282
+ <div class="fe-t">
283
+ <img src="<?php echo plugins_url( 'assets/right-tick.png', dirname(__FILE__) ) ?>">
284
+ <h4>Continious Updates</h4>
285
+ </div>
286
+ <p>We're continiously updating our premium features and releasing them.</p>
287
+ </div>
288
+ <div class="fe-2">
289
+ <div class="fe-t">
290
+ <img src="<?php echo plugins_url( 'assets/right-tick.png', dirname(__FILE__) ) ?>">
291
+ <h4>Documentation</h4>
292
+ </div>
293
+ <p>We create tutorials for every possible feature and keep it updated for you.</p>
294
+ </div>
295
+ </div><!-- /. fet -->
296
+ <div class="pr-btn">
297
+ <a href="#upgrade">Upgrade to Pro</a>
298
+ </div><!-- /. pr-btn -->
299
+ </div><!-- /. pr-fe -->
300
+ </div><!-- /.pr -->
301
+ </div><!-- /. pvf-cmp -->
302
+ </div><!-- /. pvf-cnt -->
303
+ <div id="upgrade" class="amp-upg">
304
+ <div class="upg-t">
305
+ <h2>Let's Upgrade Your Easy Table of Contents</h2>
306
+ <span>Choose your plan and upgrade in minutes!</span>
307
+ </div>
308
+ <div class="etoc-pri-lst">
309
+ <div class="pri-tb">
310
+ <a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=1" target="_blank">
311
+ <h5>PERSONAL</h5>
312
+ <span class="d-amt"><sup>$</sup>49</span>
313
+ <span class="amt"><sup>$</sup>49</span>
314
+ <span class="s-amt">(Save $59)</span>
315
+ <span class="bil">Billed Annually</span>
316
+ <span class="s">1 Site License</span>
317
+ <span class="e">Tech Support</span>
318
+ <span class="f">1 year Updates </span>
319
+ <span class="etoc-sv">Pro Features </span>
320
+ <span class="pri-by">Buy Now</span>
321
+ </a>
322
+ </div>
323
+ <div class="pri-tb rec">
324
+ <a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=2" target="_blank">
325
+ <h5>MULTIPLE</h5>
326
+ <span class="d-amt"><sup>$</sup>69</span>
327
+ <span class="amt"><sup>$</sup>69</span>
328
+ <span class="s-amt">(Save $79)</span>
329
+ <span class="bil">Billed Annually</span>
330
+ <span class="s">3 Site License</span>
331
+ <span class="e">Tech Support</span>
332
+ <span class="f">1 year Updates</span>
333
+ <span class="etoc-sv">Save 78%</span>
334
+ <span class="pri-by">Buy Now</span>
335
+ <span class="etoc-rcm">RECOMMENDED</span>
336
+ </a>
337
+ </div>
338
+ <div class="pri-tb">
339
+ <a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=3" target="_blank">
340
+ <h5>WEBMASTER</h5>
341
+ <span class="d-amt"><sup>$</sup>79</span>
342
+ <span class="amt"><sup>$</sup>79</span>
343
+ <span class="s-amt">(Save $99)</span>
344
+ <span class="bil">Billed Annually</span>
345
+ <span class="s">10 Site License</span>
346
+ <span class="e">Tech Support</span>
347
+ <span class="f">1 year Updates</span>
348
+ <span class="etoc-sv">Save 83%</span>
349
+ <span class="pri-by">Buy Now</span>
350
+ </a>
351
+ </div>
352
+ <div class="pri-tb">
353
+ <a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=4" target="_blank">
354
+ <h5>FREELANCER</h5>
355
+ <span class="d-amt"><sup>$</sup>99</span>
356
+ <span class="amt"><sup>$</sup>99</span>
357
+ <span class="s-amt">(Save $119)</span>
358
+ <span class="bil">Billed Annually</span>
359
+ <span class="s">25 Site License</span>
360
+ <span class="e">Tech Support</span>
361
+ <span class="f">1 year Updates</span>
362
+ <span class="etoc-sv">Save 90%</span>
363
+ <span class="pri-by">Buy Now</span>
364
+ </a>
365
+ </div>
366
+ <div class="pri-tb">
367
+ <a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=5" target="_blank">
368
+ <h5>AGENCY</h5>
369
+ <span class="d-amt"><sup>$</sup>199</span>
370
+ <span class="amt"><sup>$</sup>199</span>
371
+ <span class="s-amt">(Save $199)</span>
372
+ <span class="bil">Billed Annually</span>
373
+ <span class="s">Unlimited Sites</span>
374
+ <span class="e">E-mail support</span>
375
+ <span class="f">1 year Updates</span>
376
+ <span class="etoc-sv">UNLIMITED</span>
377
+ <span class="pri-by">Buy Now</span>
378
+ </a>
379
+ </div>
380
+ <div class="pri-tb">
381
+ <a href="https://tocwp.com/checkout/?edd_action=add_to_cart&download_id=1618&edd_options[price_id]=6" target="_blank">
382
+ <h5>LIFETIME</h5>
383
+ <span class="d-amt"><sup>$</sup>499</span>
384
+ <span class="amt"><sup>$</sup>499</span>
385
+ <span class="s-amt">(Save $199)</span>
386
+ <span class="bil">Billed Annually</span>
387
+ <span class="s">Unlimited Sites</span>
388
+ <span class="e">Unlimited E-mail support</span>
389
+ <span class="f">Lifetime License</span>
390
+ <span class="etoc-sv">UNLIMITED</span>
391
+ <span class="pri-by">Buy Now</span>
392
+ </a>
393
+ </div>
394
+ </div><!-- /.pri-lst -->
395
+ <div class="tru-us">
396
+ <img src="<?php echo plugins_url( 'assets/toc-rating.png', dirname(__FILE__) ) ?>">
397
+ <h2>Used by more than 300,000+ Users!</h2>
398
+ <p>More than 300k Websites, Blogs &amp; E-Commerce shops are powered by our easy table of contents plugin making it the #1 Independent TOC plugin in WordPress.</p>
399
+ <a href="https://wordpress.org/support/plugin/easy-table-of-contents/reviews/?filter=5" target="_blank">Read The Reviews</a>
400
+ </div>
401
+ </div><!--/ .amp-upg -->
402
+ <div class="ampfaq">
403
+ <h2>Frequently Asked Questions</h2>
404
+ <div class="faq-lst">
405
+ <div class="lt">
406
+ <ul>
407
+ <li>
408
+ <span>Is there a setup fee?</span>
409
+ <p>No. There are no setup fees on any of our plans</p>
410
+ </li>
411
+ <li>
412
+ <span>What's the time span for your contracts?</span>
413
+ <p>All the plans are year-to-year which are subscribed annually except for lifetime plan.</p>
414
+ </li>
415
+ <li>
416
+ <span>What payment methods are accepted?</span>
417
+ <p>We accepts PayPal and Credit Card payments.</p>
418
+ </li>
419
+ <li>
420
+ <span>Do you offer support if I need help?</span>
421
+ <p>Yes! Top-notch customer support for our paid customers is key for a quality product, so we’ll do our very best to resolve any issues you encounter via our support page.</p>
422
+ </li>
423
+ <li>
424
+ <span>Can I use the plugins after my subscription is expired?</span>
425
+ <p>Yes, you can use the plugins but you will not get future updates for those plugins.</p>
426
+ </li>
427
+ </ul>
428
+ </div>
429
+ <div class="rt">
430
+ <ul>
431
+ <li>
432
+ <span>Can I cancel my membership at any time?</span>
433
+ <p>Yes. You can cancel your membership by contacting us.</p>
434
+ </li>
435
+ <li>
436
+ <span>Can I change my plan later on?</span>
437
+ <p>Yes. You can upgrade your plan by contacting us.</p>
438
+ </li>
439
+ <li>
440
+ <span>Do you offer refunds?</span>
441
+ <p>You are fully protected by our 100% Money Back Guarantee Unconditional. If during the next 14 days you experience an issue that makes the plugin unusable and we are unable to resolve it, we’ll happily offer a full refund.</p>
442
+ </li>
443
+ <li>
444
+ <span>Do I get updates for the premium plugin?</span>
445
+ <p>Yes, you will get updates for all the premium plugins until your subscription is active.</p>
446
+ </li>
447
+ </ul>
448
+ </div>
449
+ </div><!-- /.faq-lst -->
450
+ <div class="f-cnt">
451
+ <span>I have other pre-sale questions, can you help?</span>
452
+ <p>All the plans are year-to-year which are subscribed annually.</p>
453
+ <a href="https://tocwp.com/contact/'?utm_source=tocwp-plugin&utm_medium=addon-card'" target="_blank">Contact a Human</a>
454
+ </div><!-- /.f-cnt -->
455
+ </div><!-- /.faq -->
456
+ </div><!-- /. pvf -->
457
+ </div>
458
+ </div>
459
+ </div><!-- /.freevspro div ended -->
460
+
461
+ <div id="license" class="eztoc_support_div eztoc-tabcontent">
462
+ <?php
463
+ do_action("admin_upgrade_license_page");
464
+ ?>
465
+ </div>
466
+ </div>
includes/inc.functions.php CHANGED
@@ -1,125 +1,125 @@
1
- <?php
2
-
3
- // Exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) exit;
5
-
6
- /**
7
- * Get the current post's TOC list or supplied post's TOC list.
8
- *
9
- * @access public
10
- * @since 2.0
11
- *
12
- * @param int|null|WP_Post $post An instance of WP_Post or post ID. Defaults to current post.
13
- * @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings.
14
- *
15
- * @return string
16
- */
17
- function get_ez_toc_list( $post = null, $apply_content_filter = true ) {
18
-
19
- if ( ! $post instanceof WP_Post ) {
20
-
21
- $post = get_post( $post );
22
- }
23
-
24
- if ( $apply_content_filter ) {
25
-
26
- $ezPost = new ezTOC_Post( $post );
27
-
28
- } else {
29
-
30
- $ezPost = new ezTOC_Post( $post, false );
31
- }
32
-
33
- return $ezPost->getTOCList();
34
- }
35
-
36
- /**
37
- * Display the current post's TOC list or supplied post's TOC list.
38
- *
39
- * @access public
40
- * @since 2.0
41
- *
42
- * @param null|WP_Post $post An instance of WP_Post
43
- * @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings.
44
- */
45
- function ez_toc_list( $post = null, $apply_content_filter = true ) {
46
-
47
- echo get_ez_toc_list( $post, $apply_content_filter );
48
- }
49
-
50
- /**
51
- * Get the current post's TOC content block or supplied post's TOC content block.
52
- *
53
- * @access public
54
- * @since 2.0
55
- *
56
- * @param int|null|WP_Post $post An instance of WP_Post or post ID. Defaults to current post.
57
- * @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings.
58
- *
59
- * @return string
60
- */
61
- function get_ez_toc_block( $post = null, $apply_content_filter = true ) {
62
-
63
- if ( ! $post instanceof WP_Post ) {
64
-
65
- $post = get_post( $post );
66
- }
67
-
68
- if ( $apply_content_filter ) {
69
-
70
- $ezPost = new ezTOC_Post( $post );
71
-
72
- } else {
73
-
74
- $ezPost = new ezTOC_Post( $post, false );
75
- }
76
-
77
- return $ezPost->getTOC();
78
- }
79
-
80
- /**
81
- * Display the current post's TOC content or supplied post's TOC content.
82
- *
83
- * @access public
84
- * @since 2.0
85
- *
86
- * @param null|WP_Post $post An instance of WP_Post
87
- * @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings.
88
- */
89
- function ez_toc_block( $post = null, $apply_content_filter = true ) {
90
-
91
- echo get_ez_toc_block( $post, $apply_content_filter );
92
- }
93
-
94
- function ez_toc_inline_styles(){
95
- echo "<style>@font-face{font-display:swap;font-family:ez-toc-icomoon;src:url('".EZ_TOC_URL."vendor/icomoon/fonts/ez-toc-icomoon.eot');src:url('".EZ_TOC_URL."vendor/icomoon/fonts/ez-toc-icomoon.eot?#iefix') format('embedded-opentype'),url('".EZ_TOC_URL."vendor/icomoon/fonts/ez-toc-icomoon.woff2') format('woff2'),url('".EZ_TOC_URL."vendor/icomoon/fonts/ez-toc-icomoon.woff') format('woff'),url('".EZ_TOC_URL."vendor/icomoon/fonts/ez-toc-icomoon.ttf') format('truetype'),url('".EZ_TOC_URL."vendor/icomoon/fonts/ez-toc-icomoon.svg#ez-toc-icomoon') format('svg');font-weight:400;font-style:normal}#ez-toc-container {background: #F9F9F9;border: 1px solid #AAAAAA;border-radius: 4px;-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);display: table;margin-bottom: 1em;padding: 10px;position: relative;width: auto;}div.ez-toc-widget-container {padding: 0;position: relative;}#ez-toc-container.ez-toc-light-blue {background: #EDF6FF;}#ez-toc-container.ez-toc-white {background: #FFFFFF;}#ez-toc-container.ez-toc-black {background: #000000;}#ez-toc-container.ez-toc-transparent {background: none transparent;}div.ez-toc-widget-container ul {display: block;}div.ez-toc-widget-container li {border: none;padding: 0;}div.ez-toc-widget-container ul.ez-toc-list {padding: 10px;}#ez-toc-container ul ul, .ez-toc div.ez-toc-widget-container ul ul {margin-left: 1.5em;}#ez-toc-container ul, #ez-toc-container li {margin: 0;padding: 0;}#ez-toc-container ul, #ez-toc-container li, #ez-toc-container ul li, div.ez-toc-widget-container, div.ez-toc-widget-container li {background: none;list-style: none none;line-height: 1.6;margin: 0;overflow: hidden;z-index: 1;}#ez-toc-container p.ez-toc-title {text-align: left;line-height: 1.45;margin: 0;padding: 0;}.ez-toc-title-container {display: table;width: 100%;}.ez-toc-title, .ez-toc-title-toggle {display: table-cell;text-align: left;vertical-align: middle;}#ez-toc-container.ez-toc-black p.ez-toc-title {color: #FFF;}#ez-toc-container div.ez-toc-title-container + ul.ez-toc-list {margin-top: 1em;}.ez-toc-wrap-left {float: left;margin-right: 10px;}.ez-toc-wrap-right {float: right;margin-left: 10px;}#ez-toc-container a {color: #444444;box-shadow: none;text-decoration: none;text-shadow: none;}#ez-toc-container a:visited {color: #9f9f9f;}#ez-toc-container a:hover {text-decoration: underline;}#ez-toc-container.ez-toc-black a {color: #FFF;}#ez-toc-container.ez-toc-black a:visited {color: #FFF;}#ez-toc-container a.ez-toc-toggle {color: #444444;}#ez-toc-container.counter-hierarchy ul, .ez-toc-widget-container.counter-hierarchy ul, #ez-toc-container.counter-flat ul, .ez-toc-widget-container.counter-flat ul {counter-reset: item;}#ez-toc-container.counter-numeric li, .ez-toc-widget-container.counter-numeric li {list-style-type: decimal;list-style-position: inside;}#ez-toc-container.counter-decimal ul.ez-toc-list li a::before, .ez-toc-widget-container.counter-decimal ul.ez-toc-list li a::before {content: counters(item, ".") ". ";display: inline-block;counter-increment: item;margin-right: .2em;}#ez-toc-container.counter-roman li a::before, .ez-toc-widget-container.counter-roman ul.ez-toc-list li a::before {content: counters(item, ".", upper-roman) ". ";counter-increment: item;}.ez-toc-widget-container ul.ez-toc-list li::before {content: ' ';position: absolute;left: 0;right: 0;height: 30px;line-height: 30px;z-index: -1;}.ez-toc-widget-container ul.ez-toc-list li.active::before {background-color: #EDEDED;}.ez-toc-widget-container li.active > a {font-weight: 900;}.ez-toc-btn {display: inline-block;padding: 6px 12px;margin-bottom: 0;font-size: 14px;font-weight: normal;line-height: 1.428571429;text-align: center;white-space: nowrap;vertical-align: middle;cursor: pointer;background-image: none;border: 1px solid transparent;border-radius: 4px;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;-o-user-select: none;user-select: none }.ez-toc-btn:focus {outline: thin dotted #333;outline: 5px auto -webkit-focus-ring-color;outline-offset: -2px }.ez-toc-btn:hover,.ez-toc-btn:focus {color: #333;text-decoration: none }.ez-toc-btn:active,.ez-toc-btn.active {background-image: none;outline: 0;-webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }.ez-toc-btn-default {color: #333;background-color: #fff;border-color: #ccc }.ez-toc-btn-default:hover,.ez-toc-btn-default:focus,.ez-toc-btn-default:active,.ez-toc-btn-default.active {color: #333;background-color: #ebebeb;border-color: #adadad }.ez-toc-btn-default:active,.ez-toc-btn-default.active {background-image: none }.ez-toc-btn-sm,.ez-toc-btn-xs {padding: 5px 10px;font-size: 12px;line-height: 1.5;border-radius: 3px }.ez-toc-btn-xs {padding: 1px 5px }.ez-toc-btn-default {text-shadow: 0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075) }.ez-toc-btn-default:active {-webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }.ez-toc-btn:active,.btn.active {background-image: none }.ez-toc-btn-default {text-shadow: 0 1px 0 #fff;background-image: -webkit-gradient(linear,left 0,left 100%,from(#fff),to(#e0e0e0));background-image: -webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image: -moz-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image: linear-gradient(to bottom,#fff 0,#e0e0e0 100%);background-repeat: repeat-x;border-color: #dbdbdb;border-color: #ccc;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe0e0e0',GradientType=0);filter: progid:DXImageTransform.Microsoft.gradient(enabled=false) }.ez-toc-btn-default:hover,.ez-toc-btn-default:focus {background-color: #e0e0e0;background-position: 0 -15px }.ez-toc-btn-default:active,.ez-toc-btn-default.active {background-color: #e0e0e0;border-color: #dbdbdb }.ez-toc-pull-right {float: right !important;margin-left: 10px;}.ez-toc-glyphicon {position: relative;top: 1px;display: inline-block;font-family: 'Glyphicons Halflings';-webkit-font-smoothing: antialiased;font-style: normal;font-weight: normal;line-height: 1;-moz-osx-font-smoothing: grayscale }.ez-toc-glyphicon:empty {width: 1em }.ez-toc-toggle i.ez-toc-glyphicon {font-size: 16px;margin-left: 2px;}[class*=\"ez-toc-icon-\"] {font-family: 'ez-toc-icomoon' !important;speak: none;font-style: normal;font-weight: normal;font-variant: normal;text-transform: none;line-height: 1;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}.ez-toc-icon-toggle:before {content: \"\\e87a\";}#ez-toc-container input {position: absolute;left: -999em;}#ez-toc-container input[type=\"checkbox\"]:checked + nav {opacity: 0;max-height: 0;border: none;}#ez-toc-container label {float: right;position: relative;left: 3px;font-size: 16px;/* background: #f9efef; */padding: 0px 4px 0px 5px;border: 1px solid #999191;border-radius: 5px;cursor: pointer;}div#ez-toc-container p.ez-toc-title {display: contents;}div#ez-toc-container {padding-right: 20px;}#ez-toc-container label {left: 10px;}.ez-toc-wrap-center {margin: 0 auto;}#ez-toc-container.counter-hyphen ul.ez-toc-list li a::before,#ez-toc-container.counter-disc li,.ez-toc-widget-container.counter-disc li {list-style-type: disc;list-style-position: inside;}#ez-toc-container.counter-hyphen li,.ez-toc-widget-container.counter-hyphen li {list-style-type: '- ';list-style-position: inside;}#ez-toc-container a.ez-toc-toggle {color: #444444;background: inherit;border: inherit;}.ez-toc-toggle #item{position: absolute;left: -999em;}</style>";
96
- }
97
- if (ezTOC_Option::get( 'inline_css' )) {
98
- add_action('wp_head', 'ez_toc_inline_styles');
99
- }
100
-
101
- add_action( 'woocommerce_archive_description', 'ez_toc_woo_category_desc' );
102
- function ez_toc_woo_category_desc() {
103
- if (!function_exists('vtde_php_upgrade_notice')) {
104
- return false;
105
- }
106
- $term_object = get_queried_object();
107
- $desc = $term_object->description;
108
- preg_match_all( '@<h1.*?>(.*?)<\/h1>@', $desc, $matches );
109
- $array = $matches[1];
110
- $container = '<div id="ez-toc-container" class="counter-hierarchy counter-decimal ez-toc-grey"><div class="ez-toc-title-container"><p class="ez-toc-title">Table of Contents</p><span class="ez-toc-title-toggle"><a class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" style="display: inline;"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></a></span></div><nav><ul class="ez-toc-list">';
111
- foreach ( $array as $val ) {
112
- $vals .= '<li><a class="anchor" href="#'.$val.'">'.$val.'</a></li>';
113
- $desc = preg_replace('/<h1>(.*?)<\/h1>/', "<h1 id='$1'>$1</h1>", $desc);
114
- }
115
- $last .= '</ul></nav></div>';
116
- $desc = $container . $vals . $last . $desc;
117
- echo $desc;
118
- }
119
- add_action('wp_head', 'ez_toc_woo_cat_desc_remove');
120
- function ez_toc_woo_cat_desc_remove(){
121
- if (!function_exists('vtde_php_upgrade_notice')) {
122
- return false;
123
- }
124
- remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
125
  }
1
+ <?php
2
+
3
+ // Exit if accessed directly
4
+ if ( ! defined( 'ABSPATH' ) ) exit;
5
+
6
+ /**
7
+ * Get the current post's TOC list or supplied post's TOC list.
8
+ *
9
+ * @access public
10
+ * @since 2.0
11
+ *
12
+ * @param int|null|WP_Post $post An instance of WP_Post or post ID. Defaults to current post.
13
+ * @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings.
14
+ *
15
+ * @return string
16
+ */
17
+ function get_ez_toc_list( $post = null, $apply_content_filter = true ) {
18
+
19
+ if ( ! $post instanceof WP_Post ) {
20
+
21
+ $post = get_post( $post );
22
+ }
23
+
24
+ if ( $apply_content_filter ) {
25
+
26
+ $ezPost = new ezTOC_Post( $post );
27
+
28
+ } else {
29
+
30
+ $ezPost = new ezTOC_Post( $post, false );
31
+ }
32
+
33
+ return $ezPost->getTOCList();
34
+ }
35
+
36
+ /**
37
+ * Display the current post's TOC list or supplied post's TOC list.
38
+ *
39
+ * @access public
40
+ * @since 2.0
41
+ *
42
+ * @param null|WP_Post $post An instance of WP_Post
43
+ * @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings.
44
+ */
45
+ function ez_toc_list( $post = null, $apply_content_filter = true ) {
46
+
47
+ echo get_ez_toc_list( $post, $apply_content_filter );
48
+ }
49
+
50
+ /**
51
+ * Get the current post's TOC content block or supplied post's TOC content block.
52
+ *
53
+ * @access public
54
+ * @since 2.0
55
+ *
56
+ * @param int|null|WP_Post $post An instance of WP_Post or post ID. Defaults to current post.
57
+ * @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings.
58
+ *
59
+ * @return string
60
+ */
61
+ function get_ez_toc_block( $post = null, $apply_content_filter = true ) {
62
+
63
+ if ( ! $post instanceof WP_Post ) {
64
+
65
+ $post = get_post( $post );
66
+ }
67
+
68
+ if ( $apply_content_filter ) {
69
+
70
+ $ezPost = new ezTOC_Post( $post );
71
+
72
+ } else {
73
+
74
+ $ezPost = new ezTOC_Post( $post, false );
75
+ }
76
+
77
+ return $ezPost->getTOC();
78
+ }
79
+
80
+ /**
81
+ * Display the current post's TOC content or supplied post's TOC content.
82
+ *
83
+ * @access public
84
+ * @since 2.0
85
+ *
86
+ * @param null|WP_Post $post An instance of WP_Post
87
+ * @param bool $apply_content_filter Whether or not to apply `the_content` filter when processing post for headings.
88
+ */
89
+ function ez_toc_block( $post = null, $apply_content_filter = true ) {
90
+
91
+ echo get_ez_toc_block( $post, $apply_content_filter );
92
+ }
93
+
94
+ function ez_toc_inline_styles(){
95
+ echo "<style>@font-face{font-display:swap;font-family:ez-toc-icomoon;src:url('".EZ_TOC_URL."vendor/icomoon/fonts/ez-toc-icomoon.eot');src:url('".EZ_TOC_URL."vendor/icomoon/fonts/ez-toc-icomoon.eot?#iefix') format('embedded-opentype'),url('".EZ_TOC_URL."vendor/icomoon/fonts/ez-toc-icomoon.woff2') format('woff2'),url('".EZ_TOC_URL."vendor/icomoon/fonts/ez-toc-icomoon.woff') format('woff'),url('".EZ_TOC_URL."vendor/icomoon/fonts/ez-toc-icomoon.ttf') format('truetype'),url('".EZ_TOC_URL."vendor/icomoon/fonts/ez-toc-icomoon.svg#ez-toc-icomoon') format('svg');font-weight:400;font-style:normal}#ez-toc-container {background: #F9F9F9;border: 1px solid #AAAAAA;border-radius: 4px;-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);display: table;margin-bottom: 1em;padding: 10px;position: relative;width: auto;}div.ez-toc-widget-container {padding: 0;position: relative;}#ez-toc-container.ez-toc-light-blue {background: #EDF6FF;}#ez-toc-container.ez-toc-white {background: #FFFFFF;}#ez-toc-container.ez-toc-black {background: #000000;}#ez-toc-container.ez-toc-transparent {background: none transparent;}div.ez-toc-widget-container ul {display: block;}div.ez-toc-widget-container li {border: none;padding: 0;}div.ez-toc-widget-container ul.ez-toc-list {padding: 10px;}#ez-toc-container ul ul, .ez-toc div.ez-toc-widget-container ul ul {margin-left: 1.5em;}#ez-toc-container ul, #ez-toc-container li {margin: 0;padding: 0;}#ez-toc-container ul, #ez-toc-container li, #ez-toc-container ul li, div.ez-toc-widget-container, div.ez-toc-widget-container li {background: none;list-style: none none;line-height: 1.6;margin: 0;overflow: hidden;z-index: 1;}#ez-toc-container p.ez-toc-title {text-align: left;line-height: 1.45;margin: 0;padding: 0;}.ez-toc-title-container {display: table;width: 100%;}.ez-toc-title, .ez-toc-title-toggle {display: table-cell;text-align: left;vertical-align: middle;}#ez-toc-container.ez-toc-black p.ez-toc-title {color: #FFF;}#ez-toc-container div.ez-toc-title-container + ul.ez-toc-list {margin-top: 1em;}.ez-toc-wrap-left {float: left;margin-right: 10px;}.ez-toc-wrap-right {float: right;margin-left: 10px;}#ez-toc-container a {color: #444444;box-shadow: none;text-decoration: none;text-shadow: none;}#ez-toc-container a:visited {color: #9f9f9f;}#ez-toc-container a:hover {text-decoration: underline;}#ez-toc-container.ez-toc-black a {color: #FFF;}#ez-toc-container.ez-toc-black a:visited {color: #FFF;}#ez-toc-container a.ez-toc-toggle {color: #444444;}#ez-toc-container.counter-hierarchy ul, .ez-toc-widget-container.counter-hierarchy ul, #ez-toc-container.counter-flat ul, .ez-toc-widget-container.counter-flat ul {counter-reset: item;}#ez-toc-container.counter-numeric li, .ez-toc-widget-container.counter-numeric li {list-style-type: decimal;list-style-position: inside;}#ez-toc-container.counter-decimal ul.ez-toc-list li a::before, .ez-toc-widget-container.counter-decimal ul.ez-toc-list li a::before {content: counters(item, ".") ". ";display: inline-block;counter-increment: item;margin-right: .2em;}#ez-toc-container.counter-roman li a::before, .ez-toc-widget-container.counter-roman ul.ez-toc-list li a::before {content: counters(item, ".", upper-roman) ". ";counter-increment: item;}.ez-toc-widget-container ul.ez-toc-list li::before {content: ' ';position: absolute;left: 0;right: 0;height: 30px;line-height: 30px;z-index: -1;}.ez-toc-widget-container ul.ez-toc-list li.active::before {background-color: #EDEDED;}.ez-toc-widget-container li.active > a {font-weight: 900;}.ez-toc-btn {display: inline-block;padding: 6px 12px;margin-bottom: 0;font-size: 14px;font-weight: normal;line-height: 1.428571429;text-align: center;white-space: nowrap;vertical-align: middle;cursor: pointer;background-image: none;border: 1px solid transparent;border-radius: 4px;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;-o-user-select: none;user-select: none }.ez-toc-btn:focus {outline: thin dotted #333;outline: 5px auto -webkit-focus-ring-color;outline-offset: -2px }.ez-toc-btn:hover,.ez-toc-btn:focus {color: #333;text-decoration: none }.ez-toc-btn:active,.ez-toc-btn.active {background-image: none;outline: 0;-webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }.ez-toc-btn-default {color: #333;background-color: #fff;border-color: #ccc }.ez-toc-btn-default:hover,.ez-toc-btn-default:focus,.ez-toc-btn-default:active,.ez-toc-btn-default.active {color: #333;background-color: #ebebeb;border-color: #adadad }.ez-toc-btn-default:active,.ez-toc-btn-default.active {background-image: none }.ez-toc-btn-sm,.ez-toc-btn-xs {padding: 5px 10px;font-size: 12px;line-height: 1.5;border-radius: 3px }.ez-toc-btn-xs {padding: 1px 5px }.ez-toc-btn-default {text-shadow: 0 -1px 0 rgba(0,0,0,0.2);-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075);box-shadow: inset 0 1px 0 rgba(255,255,255,0.15),0 1px 1px rgba(0,0,0,0.075) }.ez-toc-btn-default:active {-webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.125);box-shadow: inset 0 3px 5px rgba(0,0,0,0.125) }.ez-toc-btn:active,.btn.active {background-image: none }.ez-toc-btn-default {text-shadow: 0 1px 0 #fff;background-image: -webkit-gradient(linear,left 0,left 100%,from(#fff),to(#e0e0e0));background-image: -webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image: -moz-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image: linear-gradient(to bottom,#fff 0,#e0e0e0 100%);background-repeat: repeat-x;border-color: #dbdbdb;border-color: #ccc;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe0e0e0',GradientType=0);filter: progid:DXImageTransform.Microsoft.gradient(enabled=false) }.ez-toc-btn-default:hover,.ez-toc-btn-default:focus {background-color: #e0e0e0;background-position: 0 -15px }.ez-toc-btn-default:active,.ez-toc-btn-default.active {background-color: #e0e0e0;border-color: #dbdbdb }.ez-toc-pull-right {float: right !important;margin-left: 10px;}.ez-toc-glyphicon {position: relative;top: 1px;display: inline-block;font-family: 'Glyphicons Halflings';-webkit-font-smoothing: antialiased;font-style: normal;font-weight: normal;line-height: 1;-moz-osx-font-smoothing: grayscale }.ez-toc-glyphicon:empty {width: 1em }.ez-toc-toggle i.ez-toc-glyphicon {font-size: 16px;margin-left: 2px;}[class*=\"ez-toc-icon-\"] {font-family: 'ez-toc-icomoon' !important;speak: none;font-style: normal;font-weight: normal;font-variant: normal;text-transform: none;line-height: 1;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}.ez-toc-icon-toggle:before {content: \"\\e87a\";}#ez-toc-container input {position: absolute;left: -999em;}#ez-toc-container input[type=\"checkbox\"]:checked + nav {opacity: 0;max-height: 0;border: none;}#ez-toc-container label {float: right;position: relative;left: 3px;font-size: 16px;/* background: #f9efef; */padding: 0px 4px 0px 5px;border: 1px solid #999191;border-radius: 5px;cursor: pointer;}div#ez-toc-container p.ez-toc-title {display: contents;}div#ez-toc-container {padding-right: 20px;}#ez-toc-container label {left: 10px;}.ez-toc-wrap-center {margin: 0 auto;}#ez-toc-container.counter-hyphen ul.ez-toc-list li a::before,#ez-toc-container.counter-disc li,.ez-toc-widget-container.counter-disc li {list-style-type: disc;list-style-position: inside;}#ez-toc-container.counter-hyphen li,.ez-toc-widget-container.counter-hyphen li {list-style-type: '- ';list-style-position: inside;}#ez-toc-container a.ez-toc-toggle {color: #444444;background: inherit;border: inherit;}.ez-toc-toggle #item{position: absolute;left: -999em;}</style>";
96
+ }
97
+ if (ezTOC_Option::get( 'inline_css' )) {
98
+ add_action('wp_head', 'ez_toc_inline_styles');
99
+ }
100
+
101
+ add_action( 'woocommerce_archive_description', 'ez_toc_woo_category_desc' );
102
+ function ez_toc_woo_category_desc() {
103
+ if (!function_exists('vtde_php_upgrade_notice')) {
104
+ return false;
105
+ }
106
+ $term_object = get_queried_object();
107
+ $desc = $term_object->description;
108
+ preg_match_all( '@<h1.*?>(.*?)<\/h1>@', $desc, $matches );
109
+ $array = $matches[1];
110
+ $container = '<div id="ez-toc-container" class="counter-hierarchy counter-decimal ez-toc-grey"><div class="ez-toc-title-container"><p class="ez-toc-title">Table of Contents</p><span class="ez-toc-title-toggle"><a class="ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle" style="display: inline;"><i class="ez-toc-glyphicon ez-toc-icon-toggle"></i></a></span></div><nav><ul class="ez-toc-list">';
111
+ foreach ( $array as $val ) {
112
+ $vals .= '<li><a class="anchor" href="#'.$val.'">'.$val.'</a></li>';
113
+ $desc = preg_replace('/<h1>(.*?)<\/h1>/', "<h1 id='$1'>$1</h1>", $desc);
114
+ }
115
+ $last .= '</ul></nav></div>';
116
+ $desc = $container . $vals . $last . $desc;
117
+ echo $desc;
118
+ }
119
+ add_action('wp_head', 'ez_toc_woo_cat_desc_remove');
120
+ function ez_toc_woo_cat_desc_remove(){
121
+ if (!function_exists('vtde_php_upgrade_notice')) {
122
+ return false;
123
+ }
124
+ remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
125
  }
includes/inc.plugin-compatibility.php CHANGED
@@ -1,563 +1,563 @@
1
- <?php
2
- /**
3
- * Filter to add plugins to the TOC list.
4
- *
5
- * @link https://rankmath.com/kb/filters-hooks-api-developer/#add-toc-plugin
6
- *
7
- * @since 2.0
8
- *
9
- * @param array TOC plugins.
10
- */
11
- add_filter(
12
- 'rank_math/researches/toc_plugins',
13
- function( $toc_plugins ) {
14
-
15
- $toc_plugins[ EZ_TOC_BASE_NAME ] = 'Easy Table of Contents';
16
-
17
- return $toc_plugins;
18
- }
19
- );
20
-
21
- /**
22
- * Filter to remove Connections Business Directory related shortcodes from being processed as eligible TOC items.
23
- *
24
- * @since 2.0
25
- */
26
- add_filter(
27
- 'ez_toc_strip_shortcodes_tagnames',
28
- function( $tags_to_remove ) {
29
-
30
- $shortcodes = array (
31
- 'connections_form',
32
- 'cn_multi_category_search',
33
- 'cn_widget',
34
- 'cn_carousel',
35
- 'connections_categories',
36
- 'connections_link_view',
37
- 'connections_link_edit',
38
- 'connections_login',
39
- 'siteshot',
40
- 'connections',
41
- 'upcoming_list',
42
- 'cn-mapblock',
43
- 'connections_vcard',
44
- 'connections_qtip',
45
- 'cn_thumb',
46
- 'cn_thumbr',
47
- );
48
-
49
- $tags_to_remove = array_merge( $tags_to_remove, $shortcodes );
50
-
51
- return $tags_to_remove;
52
- }
53
- );
54
-
55
-
56
- /**
57
- * Filter to remove Striking theme related shortcodes from being processed as eligible TOC items.
58
- *
59
- * @since 2.0
60
- */
61
- add_filter(
62
- 'ez_toc_strip_shortcodes_tagnames',
63
- function( $tags_to_remove ) {
64
-
65
- $shortcodes = array (
66
- 'iconbox',
67
- 'toggle',
68
- );
69
-
70
- $tags_to_remove = array_merge( $tags_to_remove, $shortcodes );
71
-
72
- return $tags_to_remove;
73
- }
74
- );
75
-
76
- /**
77
- * Remove the JetPack share buttons node from the post content before extracting headings.
78
- *
79
- * @since 2.0
80
- */
81
- add_filter(
82
- 'ez_toc_exclude_by_selector',
83
- function( $selectors ) {
84
-
85
- $selectors['jetpack-sharedaddy'] = '.sharedaddy';
86
- $selectors['jetpack-relatedposts'] = '.jp-relatedposts';
87
-
88
- return $selectors;
89
- }
90
- );
91
-
92
- /**
93
- * Remove the Elegant Themes Bloom plugin node from the post content before extracting headings.
94
- *
95
- * @since 2.0
96
- */
97
- add_filter(
98
- 'ez_toc_exclude_by_selector',
99
- function( $selectors ) {
100
-
101
- $selectors['elegant-themes-bloom'] = '.et_bloom_below_post';
102
-
103
- return $selectors;
104
- }
105
- );
106
-
107
- /**
108
- * Do not allow `the_content` TOC callback to run when editing a page in Visual Composer.
109
- *
110
- * @link https://wordpress.org/support/topic/correct-method-to-determine-if-using-frontend-editor/#post-12404679
111
- *
112
- * @since 2.0
113
- */
114
- add_filter(
115
- 'ez_toc_maybe_apply_the_content_filter',
116
- function( $apply ) {
117
-
118
- if ( function_exists( 'vchelper' ) ) {
119
-
120
- //$sourceId = intval( vchelper( "Request" )->input( 'vcv-source-id' ) );
121
- //
122
- //if ( $sourceId === get_the_ID() ) {
123
- //
124
- // $apply = false;
125
- //}
126
-
127
- if ( vchelper( 'Frontend' )->isPageEditable() ) {
128
-
129
- $apply = false;
130
- }
131
- }
132
-
133
- return $apply;
134
- }
135
- );
136
-
137
- /**
138
- * Do not allow `the_content` TOC callback to run when editing a page in WPBakery Page Builder.
139
- *
140
- * @link https://wordpress.org/support/topic/correct-method-to-determine-if-using-frontend-editor/#post-12404679
141
- *
142
- * @since 2.0
143
- */
144
- add_filter(
145
- 'ez_toc_maybe_apply_the_content_filter',
146
- function( $apply ) {
147
-
148
- if ( function_exists( 'vc_is_page_editable' ) ) {
149
-
150
- if ( vc_is_page_editable() ) {
151
-
152
- $apply = false;
153
- }
154
- }
155
-
156
- return $apply;
157
- }
158
- );
159
-
160
- /**
161
- * Filter to remove WPBakery Page Builder related shortcodes from being processed as eligible TOC items.
162
- *
163
- * @since 2.0
164
- */
165
- add_filter(
166
- 'ez_toc_strip_shortcodes_tagnames',
167
- function( $tags_to_remove ) {
168
-
169
- $shortcodes = array (
170
- 'vc_tta_section',
171
- );
172
-
173
- $tags_to_remove = array_merge( $tags_to_remove, $shortcodes );
174
-
175
- return $tags_to_remove;
176
- }
177
- );
178
-
179
- /**
180
- * Exclude the TOC shortcodes from being processed in the admin in the Divi Theme by Elegant Themes.
181
- *
182
- * @since 2.0
183
- */
184
- add_action(
185
- 'et_pb_admin_excluded_shortcodes',
186
- function( $shortcodes ) {
187
-
188
- $shortcodes[] = 'ez-toc';
189
- $shortcodes[] = apply_filters( 'ez_toc_shortcode', 'toc' );
190
-
191
- return $shortcodes;
192
- }
193
- );
194
-
195
- /**
196
- * Disabled for now as it does not appear to be required.
197
- *
198
- * Do not allow `the_content` TOC callback to run when rendering a Divi layout.
199
- *
200
- * @since 2.0
201
- */
202
- //add_filter(
203
- // 'ez_toc_maybe_apply_the_content_filter',
204
- // function( $apply ) {
205
- //
206
- // global $wp_current_filter;
207
- //
208
- // // Do not execute if root current filter is one of those in the array.
209
- // if ( in_array( $wp_current_filter[0], array( 'et_builder_render_layout' ), true ) ) {
210
- //
211
- // $apply = false;
212
- // }
213
- //
214
- // return $apply;
215
- // }
216
- //);
217
-
218
- /**
219
- * Callback the for `et_builder_render_layout` filter.
220
- *
221
- * Attaches the ezTOC `the_content` filter callback to the Divi layout content filter so the in page anchors will be
222
- * added the post content.
223
- *
224
- * NOTE: Set priority 12 to run after Divi runs the `do_shortcode` filter on its layout content.
225
- *
226
- * @link https://wordpress.org/support/topic/anchor-links-not-being-added-with-divi/
227
- *
228
- * @since 2.0
229
- */
230
- add_filter(
231
- 'et_builder_render_layout',
232
- array( 'ezTOC', 'the_content' ),
233
- 12,
234
- 1
235
- );
236
-
237
- /**
238
- * Add support for the Uncode Theme.
239
- *
240
- * @link http://www.undsgn.com/
241
- *
242
- * @since 2.0.11
243
- */
244
- add_action(
245
- 'after_setup_theme',
246
- function() {
247
-
248
- if ( function_exists( 'uncode_setup' ) ) {
249
-
250
- /**
251
- * Callback the for `the_content` filter.
252
- *
253
- * Trick the theme into applying its content filter.
254
- *
255
- * In its page/post templates it applies `the_content` filter passing an empty string.
256
- * If the value passed pack is `null` or an empty string, the theme will not run its content filter.
257
- *
258
- * This simply wraps the page/post content in comment tags that way it is not possible to return empty
259
- * and its content filter will be run. Now ezTOC can hook into the theme's content filter to insert the TOC.
260
- *
261
- * @since 2.0.11
262
- */
263
- add_filter(
264
- 'the_content',
265
- function( $content ) {
266
- return '<!-- <ezTOC> -->' . $content . '<!-- </ezTOC> -->';
267
- },
268
- 9,
269
- 1
270
- );
271
-
272
- /**
273
- * Callback the for `uncode_single_content` filter.
274
- *
275
- * Need to texturize the page/post content first.
276
- *
277
- * @since 2.0.11
278
- */
279
- add_filter(
280
- 'uncode_single_content',
281
- function( $content ) {
282
- return wptexturize( $content );
283
- },
284
- 10,
285
- 1
286
- );
287
- add_filter(
288
- 'uncode_single_content',
289
- array( 'ezTOC', 'the_content' ),
290
- 11,
291
- 1
292
- );
293
- }
294
-
295
- },
296
- 11
297
- );
298
-
299
- /**
300
- * Remove the Starbox plugin node from the post content before extracting headings.
301
- * @link https://wordpress.org/plugins/starbox/
302
- * @since 2.0
303
- */
304
- add_filter(
305
- 'ez_toc_exclude_by_selector',
306
- function( $selectors ) {
307
-
308
- $selectors['starbox'] = '.abh_box';
309
-
310
- return $selectors;
311
- }
312
- );
313
-
314
- /**
315
- * Remove the WordPress Related Posts plugin node from the post content before extracting headings.
316
- * @link
317
- * @since 2.0
318
- */
319
- add_filter(
320
- 'ez_toc_exclude_by_selector',
321
- function( $selectors ) {
322
-
323
- $selectors['wordpress-23-related-posts-plugin'] = '.wp_rp_content';
324
-
325
- return $selectors;
326
- }
327
- );
328
-
329
- /**
330
- * Remove the Atomic Blocks plugin node from the post content before extracting headings.
331
- * @link
332
- * @since 2.0
333
- */
334
- add_filter(
335
- 'ez_toc_exclude_by_selector',
336
- function( $selectors ) {
337
-
338
- $selectors['atomic-blocks-cta'] = '.ab-block-cta';
339
- $selectors['atomic-blocks-testimonial'] = '.ab-block-testimonial';
340
-
341
- return $selectors;
342
- }
343
- );
344
-
345
- /**
346
- * Remove the Ultimate Addons for VC Composer node from the post content before extracting headings.
347
- * @link
348
- * @since 2.0
349
- */
350
- add_filter(
351
- 'ez_toc_exclude_by_selector',
352
- function( $selectors ) {
353
-
354
- $selectors['ultimate-addons-for-vc-composer'] = '.ult_tabs';
355
-
356
- return $selectors;
357
- }
358
- );
359
-
360
- /**
361
- * Remove the WP Product Review node from the post content before extracting headings.
362
- * @link
363
- * @since 2.0
364
- */
365
- add_filter(
366
- 'ez_toc_exclude_by_selector',
367
- function( $selectors ) {
368
-
369
- $selectors['wp-product-review'] = '.wppr-review-container';
370
-
371
- return $selectors;
372
- }
373
- );
374
-
375
- /**
376
- * Remove the Create by Mediavine node from the post content before extracting headings.
377
- *
378
- * @link https://wordpress.org/plugins/mediavine-create/
379
- * @since 2.0.8
380
- */
381
- add_filter(
382
- 'ez_toc_exclude_by_selector',
383
- function( $selectors ) {
384
-
385
- $selectors['mediavine-create'] = '.mv-create-card';
386
-
387
- return $selectors;
388
- }
389
- );
390
-
391
- /**
392
- * Remove the Contextual Related Posts node from the post content before extracting headings.
393
- *
394
- * @link https://wordpress.org/plugins/contextual-related-posts/
395
- * @since 2.0.9
396
- */
397
- add_filter(
398
- 'ez_toc_exclude_by_selector',
399
- function( $selectors ) {
400
-
401
- $selectors['contextual-related-posts'] = '.crp_related';
402
-
403
- return $selectors;
404
- }
405
- );
406
-
407
- class ezTOC_Elementor {
408
-
409
- /**
410
- * Whether the excerpt is being called.
411
- *
412
- * Used to determine whether the call to `the_content()` came from `get_the_excerpt()`.
413
- *
414
- * @since 2.0.2
415
- *
416
- * @var bool Whether the excerpt is being used. Default is false.
417
- */
418
- private $_is_excerpt = false;
419
-
420
- /**
421
- * ezTOC_Elementor constructor.
422
- *
423
- * @since 2.0.2
424
- */
425
- public function __construct() {
426
-
427
- //add_filter( 'elementor/frontend/the_content', array( 'ezTOC', 'the_content' ), 100 );
428
-
429
- // Hack to avoid enqueue post CSS while it's a `the_excerpt` call.
430
- add_filter( 'get_the_excerpt', array( $this, 'start_excerpt_flag' ), 1 );
431
- add_filter( 'get_the_excerpt', array( $this, 'end_excerpt_flag' ), 20 );
432
- add_filter( 'ez_toc_maybe_apply_the_content_filter', array( $this, 'maybe_apply_the_content_filter' ) );
433
-
434
- add_filter(
435
- 'ez_toc_strip_shortcodes_tagnames',
436
- function( $tags_to_remove ) {
437
-
438
- $shortcodes = array (
439
- 'elementor-template',
440
- );
441
-
442
- $tags_to_remove = array_merge( $tags_to_remove, $shortcodes );
443
-
444
- return $tags_to_remove;
445
- }
446
- );
447
- }
448
-
449
- /**
450
- * Callback for the `elementor/init` action.
451
- *
452
- * Add the compatibility filters for Elementor.
453
- *
454
- * @since 2.0.2
455
- */
456
- public static function start() {
457
-
458
- new self();
459
- }
460
-
461
- /**
462
- * Callback for the `get_the_excerpt` filter.
463
- *
464
- * Start excerpt flag.
465
- *
466
- * Flags when `the_excerpt` is called. Used to avoid enqueueing CSS in the excerpt.
467
- *
468
- * @since 2.0.2
469
- *
470
- * @param string $excerpt The post excerpt.
471
- *
472
- * @return string The post excerpt.
473
- */
474
- public function start_excerpt_flag( $excerpt ) {
475
- $this->_is_excerpt = true;
476
- return $excerpt;
477
- }
478
-
479
- /**
480
- * Callback for the `get_the_excerpt` filter.
481
- *
482
- * End excerpt flag.
483
- *
484
- * Flags when `the_excerpt` call ended.
485
- *
486
- * @since 2.0.2
487
- *
488
- * @param string $excerpt The post excerpt.
489
- *
490
- * @return string The post excerpt.
491
- */
492
- public function end_excerpt_flag( $excerpt ) {
493
- $this->_is_excerpt = false;
494
- return $excerpt;
495
- }
496
-
497
- /**
498
- * Callback for the `ez_toc_maybe_apply_the_content_filter` filter.
499
- *
500
- * If doing Elementor excerpt, which calls `the_content` filter, do not apply the ezTOC `the_content` filter.
501
- *
502
- * @since 2.0.2
503
- *
504
- * @param bool $apply
505
- *
506
- * @return bool mixed
507
- */
508
- public function maybe_apply_the_content_filter( $apply ) {
509
-
510
- if ( $this->_is_excerpt ) {
511
-
512
- $apply = false;
513
- }
514
-
515
- return $apply;
516
- }
517
- }
518
- //new ezTOC_Elementor();
519
- add_action( 'elementor/init', array( 'ezTOC_Elementor', 'start' ) );
520
-
521
-
522
- /**
523
- * Do not allow `the_content` TOC callback to run when on WooCommerce pages.
524
- *
525
- * @link https://docs.woocommerce.com/document/conditional-tags/
526
- * @link https://wordpress.stackexchange.com/a/246525/59053
527
- *
528
- * @since 2.0.11
529
- */
530
- add_filter(
531
- 'ez_toc_maybe_apply_the_content_filter',
532
- function( $apply ) {
533
-
534
- $active_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins' ) );
535
-
536
- // Just in case an array is not returned.
537
- if ( ! is_array( $active_plugins ) ) {
538
-
539
- $active_plugins = array();
540
- }
541
-
542
- $string = implode( '|', $active_plugins );
543
-
544
- if ( class_exists( 'WooCommerce' ) && FALSE !== stripos( $string, 'woocommerce.php' ) ) {
545
-
546
- /** @noinspection PhpUndefinedFunctionInspection */
547
- if ( is_shop() ||
548
- is_product_category() ||
549
- is_product_tag() ||
550
- is_cart() ||
551
- is_checkout() ||
552
- is_account_page() ||
553
- is_wc_endpoint_url()
554
- ) {
555
-
556
- $apply = false;
557
- }
558
-
559
- }
560
-
561
- return $apply;
562
- }
563
- );
1
+ <?php
2
+ /**
3
+ * Filter to add plugins to the TOC list.
4
+ *
5
+ * @link https://rankmath.com/kb/filters-hooks-api-developer/#add-toc-plugin
6
+ *
7
+ * @since 2.0
8
+ *
9
+ * @param array TOC plugins.
10
+ */
11
+ add_filter(
12
+ 'rank_math/researches/toc_plugins',
13
+ function( $toc_plugins ) {
14
+
15
+ $toc_plugins[ EZ_TOC_BASE_NAME ] = 'Easy Table of Contents';
16
+
17
+ return $toc_plugins;
18
+ }
19
+ );
20
+
21
+ /**
22
+ * Filter to remove Connections Business Directory related shortcodes from being processed as eligible TOC items.
23
+ *
24
+ * @since 2.0
25
+ */
26
+ add_filter(
27
+ 'ez_toc_strip_shortcodes_tagnames',
28
+ function( $tags_to_remove ) {
29
+
30
+ $shortcodes = array (
31
+ 'connections_form',
32
+ 'cn_multi_category_search',
33
+ 'cn_widget',
34
+ 'cn_carousel',
35
+ 'connections_categories',
36
+ 'connections_link_view',
37
+ 'connections_link_edit',
38
+ 'connections_login',
39
+ 'siteshot',
40
+ 'connections',
41
+ 'upcoming_list',
42
+ 'cn-mapblock',
43
+ 'connections_vcard',
44
+ 'connections_qtip',
45
+ 'cn_thumb',
46
+ 'cn_thumbr',
47
+ );
48
+
49
+ $tags_to_remove = array_merge( $tags_to_remove, $shortcodes );
50
+
51
+ return $tags_to_remove;
52
+ }
53
+ );
54
+
55
+
56
+ /**
57
+ * Filter to remove Striking theme related shortcodes from being processed as eligible TOC items.
58
+ *
59
+ * @since 2.0
60
+ */
61
+ add_filter(
62
+ 'ez_toc_strip_shortcodes_tagnames',
63
+ function( $tags_to_remove ) {
64
+
65
+ $shortcodes = array (
66
+ 'iconbox',
67
+ 'toggle',
68
+ );
69
+
70
+ $tags_to_remove = array_merge( $tags_to_remove, $shortcodes );
71
+
72
+ return $tags_to_remove;
73
+ }
74
+ );
75
+
76
+ /**
77
+ * Remove the JetPack share buttons node from the post content before extracting headings.
78
+ *
79
+ * @since 2.0
80
+ */
81
+ add_filter(
82
+ 'ez_toc_exclude_by_selector',
83
+ function( $selectors ) {
84
+
85
+ $selectors['jetpack-sharedaddy'] = '.sharedaddy';
86
+ $selectors['jetpack-relatedposts'] = '.jp-relatedposts';
87
+
88
+ return $selectors;
89
+ }
90
+ );
91
+
92
+ /**
93
+ * Remove the Elegant Themes Bloom plugin node from the post content before extracting headings.
94
+ *
95
+ * @since 2.0
96
+ */
97
+ add_filter(
98
+ 'ez_toc_exclude_by_selector',
99
+ function( $selectors ) {
100
+
101
+ $selectors['elegant-themes-bloom'] = '.et_bloom_below_post';
102
+
103
+ return $selectors;
104
+ }
105
+ );
106
+
107
+ /**
108
+ * Do not allow `the_content` TOC callback to run when editing a page in Visual Composer.
109
+ *
110
+ * @link https://wordpress.org/support/topic/correct-method-to-determine-if-using-frontend-editor/#post-12404679
111
+ *
112
+ * @since 2.0
113
+ */
114
+ add_filter(
115
+ 'ez_toc_maybe_apply_the_content_filter',
116
+ function( $apply ) {
117
+
118
+ if ( function_exists( 'vchelper' ) ) {
119
+
120
+ //$sourceId = intval( vchelper( "Request" )->input( 'vcv-source-id' ) );
121
+ //
122
+ //if ( $sourceId === get_the_ID() ) {
123
+ //
124
+ // $apply = false;
125
+ //}
126
+
127
+ if ( vchelper( 'Frontend' )->isPageEditable() ) {
128
+
129
+ $apply = false;
130
+ }
131
+ }
132
+
133
+ return $apply;
134
+ }
135
+ );
136
+
137
+ /**
138
+ * Do not allow `the_content` TOC callback to run when editing a page in WPBakery Page Builder.
139
+ *
140
+ * @link https://wordpress.org/support/topic/correct-method-to-determine-if-using-frontend-editor/#post-12404679
141
+ *
142
+ * @since 2.0
143
+ */
144
+ add_filter(
145
+ 'ez_toc_maybe_apply_the_content_filter',
146
+ function( $apply ) {
147
+
148
+ if ( function_exists( 'vc_is_page_editable' ) ) {
149
+
150
+ if ( vc_is_page_editable() ) {
151
+
152
+ $apply = false;
153
+ }
154
+ }
155
+
156
+ return $apply;
157
+ }
158
+ );
159
+
160
+ /**
161
+ * Filter to remove WPBakery Page Builder related shortcodes from being processed as eligible TOC items.
162
+ *
163
+ * @since 2.0
164
+ */
165
+ add_filter(
166
+ 'ez_toc_strip_shortcodes_tagnames',
167
+ function( $tags_to_remove ) {
168
+
169
+ $shortcodes = array (
170
+ 'vc_tta_section',
171
+ );
172
+
173
+ $tags_to_remove = array_merge( $tags_to_remove, $shortcodes );
174
+
175
+ return $tags_to_remove;
176
+ }
177
+ );
178
+
179
+ /**
180
+ * Exclude the TOC shortcodes from being processed in the admin in the Divi Theme by Elegant Themes.
181
+ *
182
+ * @since 2.0
183
+ */
184
+ add_action(
185
+ 'et_pb_admin_excluded_shortcodes',
186
+ function( $shortcodes ) {
187
+
188
+ $shortcodes[] = 'ez-toc';
189
+ $shortcodes[] = apply_filters( 'ez_toc_shortcode', 'toc' );
190
+
191
+ return $shortcodes;
192
+ }
193
+ );
194
+
195
+ /**
196
+ * Disabled for now as it does not appear to be required.
197
+ *
198
+ * Do not allow `the_content` TOC callback to run when rendering a Divi layout.
199
+ *
200
+ * @since 2.0
201
+ */
202
+ //add_filter(
203
+ // 'ez_toc_maybe_apply_the_content_filter',
204
+ // function( $apply ) {
205
+ //
206
+ // global $wp_current_filter;
207
+ //
208
+ // // Do not execute if root current filter is one of those in the array.
209
+ // if ( in_array( $wp_current_filter[0], array( 'et_builder_render_layout' ), true ) ) {
210
+ //
211
+ // $apply = false;
212
+ // }
213
+ //
214
+ // return $apply;
215
+ // }
216
+ //);
217
+
218
+ /**
219
+ * Callback the for `et_builder_render_layout` filter.
220
+ *
221
+ * Attaches the ezTOC `the_content` filter callback to the Divi layout content filter so the in page anchors will be
222
+ * added the post content.
223
+ *
224
+ * NOTE: Set priority 12 to run after Divi runs the `do_shortcode` filter on its layout content.
225
+ *
226
+ * @link https://wordpress.org/support/topic/anchor-links-not-being-added-with-divi/
227
+ *
228
+ * @since 2.0
229
+ */
230
+ add_filter(
231
+ 'et_builder_render_layout',
232
+ array( 'ezTOC', 'the_content' ),
233
+ 12,
234
+ 1
235
+ );
236
+
237
+ /**
238
+ * Add support for the Uncode Theme.
239
+ *
240
+ * @link http://www.undsgn.com/
241
+ *
242
+ * @since 2.0.11
243
+ */
244
+ add_action(
245
+ 'after_setup_theme',
246
+ function() {
247
+
248
+ if ( function_exists( 'uncode_setup' ) ) {
249
+
250
+ /**
251
+ * Callback the for `the_content` filter.
252
+ *
253
+ * Trick the theme into applying its content filter.
254
+ *
255
+ * In its page/post templates it applies `the_content` filter passing an empty string.
256
+ * If the value passed pack is `null` or an empty string, the theme will not run its content filter.
257
+ *
258
+ * This simply wraps the page/post content in comment tags that way it is not possible to return empty
259
+ * and its content filter will be run. Now ezTOC can hook into the theme's content filter to insert the TOC.
260
+ *
261
+ * @since 2.0.11
262
+ */
263
+ add_filter(
264
+ 'the_content',
265
+ function( $content ) {
266
+ return '<!-- <ezTOC> -->' . $content . '<!-- </ezTOC> -->';
267
+ },
268
+ 9,
269
+ 1
270
+ );
271
+
272
+ /**
273
+ * Callback the for `uncode_single_content` filter.
274
+ *
275
+ * Need to texturize the page/post content first.
276
+ *
277
+ * @since 2.0.11
278
+ */
279
+ add_filter(
280
+ 'uncode_single_content',
281
+ function( $content ) {
282
+ return wptexturize( $content );
283
+ },
284
+ 10,
285
+ 1
286
+ );
287
+ add_filter(
288
+ 'uncode_single_content',
289
+ array( 'ezTOC', 'the_content' ),
290
+ 11,
291
+ 1
292
+ );
293
+ }
294
+
295
+ },
296
+ 11
297
+ );
298
+
299
+ /**
300
+ * Remove the Starbox plugin node from the post content before extracting headings.
301
+ * @link https://wordpress.org/plugins/starbox/
302
+ * @since 2.0
303
+ */
304
+ add_filter(
305
+ 'ez_toc_exclude_by_selector',
306
+ function( $selectors ) {
307
+
308
+ $selectors['starbox'] = '.abh_box';
309
+
310
+ return $selectors;
311
+ }
312
+ );
313
+
314
+ /**
315
+ * Remove the WordPress Related Posts plugin node from the post content before extracting headings.
316
+ * @link
317
+ * @since 2.0
318
+ */
319
+ add_filter(
320
+ 'ez_toc_exclude_by_selector',
321
+ function( $selectors ) {
322
+
323
+ $selectors['wordpress-23-related-posts-plugin'] = '.wp_rp_content';
324
+
325
+ return $selectors;
326
+ }
327
+ );
328
+
329
+ /**
330
+ * Remove the Atomic Blocks plugin node from the post content before extracting headings.
331
+ * @link
332
+ * @since 2.0
333
+ */
334
+ add_filter(
335
+ 'ez_toc_exclude_by_selector',
336
+ function( $selectors ) {
337
+
338
+ $selectors['atomic-blocks-cta'] = '.ab-block-cta';
339
+ $selectors['atomic-blocks-testimonial'] = '.ab-block-testimonial';
340
+
341
+ return $selectors;
342
+ }
343
+ );
344
+
345
+ /**
346
+ * Remove the Ultimate Addons for VC Composer node from the post content before extracting headings.
347
+ * @link
348
+ * @since 2.0
349
+ */
350
+ add_filter(
351
+ 'ez_toc_exclude_by_selector',
352
+ function( $selectors ) {
353
+
354
+ $selectors['ultimate-addons-for-vc-composer'] = '.ult_tabs';
355
+
356
+ return $selectors;
357
+ }
358
+ );
359
+
360
+ /**
361
+ * Remove the WP Product Review node from the post content before extracting headings.
362
+ * @link
363
+ * @since 2.0
364
+ */
365
+ add_filter(
366
+ 'ez_toc_exclude_by_selector',
367
+ function( $selectors ) {
368
+
369
+ $selectors['wp-product-review'] = '.wppr-review-container';
370
+
371
+ return $selectors;
372
+ }
373
+ );
374
+
375
+ /**
376
+ * Remove the Create by Mediavine node from the post content before extracting headings.
377
+ *
378
+ * @link https://wordpress.org/plugins/mediavine-create/
379
+ * @since 2.0.8
380
+ */
381
+ add_filter(
382
+ 'ez_toc_exclude_by_selector',
383
+ function( $selectors ) {
384
+
385
+ $selectors['mediavine-create'] = '.mv-create-card';
386
+
387
+ return $selectors;
388
+ }
389
+ );
390
+
391
+ /**
392
+ * Remove the Contextual Related Posts node from the post content before extracting headings.
393
+ *
394
+ * @link https://wordpress.org/plugins/contextual-related-posts/
395
+ * @since 2.0.9
396
+ */
397
+ add_filter(
398
+ 'ez_toc_exclude_by_selector',
399
+ function( $selectors ) {
400
+
401
+ $selectors['contextual-related-posts'] = '.crp_related';
402
+
403
+ return $selectors;
404
+ }
405
+ );
406
+
407
+ class ezTOC_Elementor {
408
+
409
+ /**
410
+ * Whether the excerpt is being called.
411
+ *
412
+ * Used to determine whether the call to `the_content()` came from `get_the_excerpt()`.
413
+ *
414
+ * @since 2.0.2
415
+ *
416
+ * @var bool Whether the excerpt is being used. Default is false.
417
+ */
418
+ private $_is_excerpt = false;
419
+
420
+ /**
421
+ * ezTOC_Elementor constructor.
422
+ *
423
+ * @since 2.0.2
424
+ */
425
+ public function __construct() {
426
+
427
+ //add_filter( 'elementor/frontend/the_content', array( 'ezTOC', 'the_content' ), 100 );
428
+
429
+ // Hack to avoid enqueue post CSS while it's a `the_excerpt` call.
430
+ add_filter( 'get_the_excerpt', array( $this, 'start_excerpt_flag' ), 1 );
431
+ add_filter( 'get_the_excerpt', array( $this, 'end_excerpt_flag' ), 20 );
432
+ add_filter( 'ez_toc_maybe_apply_the_content_filter', array( $this, 'maybe_apply_the_content_filter' ) );
433
+
434
+ add_filter(
435
+ 'ez_toc_strip_shortcodes_tagnames',
436
+ function( $tags_to_remove ) {
437
+
438
+ $shortcodes = array (
439
+ 'elementor-template',
440
+ );
441
+
442
+ $tags_to_remove = array_merge( $tags_to_remove, $shortcodes );
443
+
444
+ return $tags_to_remove;
445
+ }
446
+ );
447
+ }
448
+
449
+ /**
450
+ * Callback for the `elementor/init` action.
451
+ *
452
+ * Add the compatibility filters for Elementor.
453
+ *
454
+ * @since 2.0.2
455
+ */
456
+ public static function start() {
457
+
458
+ new self();
459
+ }
460
+
461
+ /**
462
+ * Callback for the `get_the_excerpt` filter.
463
+ *
464
+ * Start excerpt flag.
465
+ *
466
+ * Flags when `the_excerpt` is called. Used to avoid enqueueing CSS in the excerpt.
467
+ *
468
+ * @since 2.0.2
469
+ *
470
+ * @param string $excerpt The post excerpt.
471
+ *
472
+ * @return string The post excerpt.
473
+ */
474
+ public function start_excerpt_flag( $excerpt ) {
475
+ $this->_is_excerpt = true;
476
+ return $excerpt;
477
+ }
478
+
479
+ /**
480
+ * Callback for the `get_the_excerpt` filter.
481
+ *
482
+ * End excerpt flag.
483
+ *
484
+ * Flags when `the_excerpt` call ended.
485
+ *
486
+ * @since 2.0.2
487
+ *
488
+ * @param string $excerpt The post excerpt.
489
+ *
490
+ * @return string The post excerpt.
491
+ */
492
+ public function end_excerpt_flag( $excerpt ) {
493
+ $this->_is_excerpt = false;
494
+ return $excerpt;
495
+ }
496
+
497
+ /**
498
+ * Callback for the `ez_toc_maybe_apply_the_content_filter` filter.
499
+ *
500
+ * If doing Elementor excerpt, which calls `the_content` filter, do not apply the ezTOC `the_content` filter.
501
+ *
502
+ * @since 2.0.2
503
+ *
504
+ * @param bool $apply
505
+ *
506
+ * @return bool mixed
507
+ */
508
+ public function maybe_apply_the_content_filter( $apply ) {
509
+
510
+ if ( $this->_is_excerpt ) {
511
+
512
+ $apply = false;
513
+ }
514
+
515
+ return $apply;
516
+ }
517
+ }
518
+ //new ezTOC_Elementor();
519
+ add_action( 'elementor/init', array( 'ezTOC_Elementor', 'start' ) );
520
+
521
+
522
+ /**
523
+ * Do not allow `the_content` TOC callback to run when on WooCommerce pages.
524
+ *
525
+ * @link https://docs.woocommerce.com/document/conditional-tags/
526
+ * @link https://wordpress.stackexchange.com/a/246525/59053
527
+ *
528
+ * @since 2.0.11
529
+ */
530
+ add_filter(
531
+ 'ez_toc_maybe_apply_the_content_filter',
532
+ function( $apply ) {
533
+
534
+ $active_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins' ) );
535
+
536
+ // Just in case an array is not returned.
537
+ if ( ! is_array( $active_plugins ) ) {
538
+
539
+ $active_plugins = array();
540
+ }
541
+
542
+ $string = implode( '|', $active_plugins );
543
+
544
+ if ( class_exists( 'WooCommerce' ) && FALSE !== stripos( $string, 'woocommerce.php' ) ) {
545
+
546
+ /** @noinspection PhpUndefinedFunctionInspection */
547
+ if ( is_shop() ||
548
+ is_product_category() ||
549
+ is_product_tag() ||
550
+ is_cart() ||
551
+ is_checkout() ||
552
+ is_account_page() ||
553
+ is_wc_endpoint_url()
554
+ ) {
555
+
556
+ $apply = false;
557
+ }
558
+
559
+ }
560
+
561
+ return $apply;
562
+ }
563
+ );
includes/inc.string-functions.php CHANGED
@@ -1,353 +1,357 @@
1
- <?php
2
-
3
- namespace Easy_Plugins\Table_Of_Contents\String;
4
-
5
- /**
6
- * Replace `<br />` tags with parameter.
7
- *
8
- * @since 2.0.8
9
- *
10
- * @param string $string
11
- * @param string $to
12
- *
13
- * @return string
14
- */
15
- function br2( $string, $to = "\r\n" ) {
16
-
17
- $string = preg_replace( '`<br[/\s]*>`i', $to, $string );
18
-
19
- return $string;
20
- }
21
-
22
- /**
23
- * Replace `<br />` tags with new lines.
24
- *
25
- * @link https://stackoverflow.com/a/27509016/5351316
26
- *
27
- * @since 2.0.8
28
- *
29
- * @param string $string
30
- *
31
- * @return string
32
- */
33
- function br2nl( $string ) {
34
-
35
- return br2( $string );
36
- }
37
-
38
- /**
39
- * Pulled from WordPress formatting functions.
40
- *
41
- * Edited to add space before self closing tags.
42
- *
43
- * @since 2.0
44
- *
45
- * @param string $text
46
- *
47
- * @return string|string[]
48
- */
49
- function force_balance_tags( $text ) {
50
- $tagstack = array();
51
- $stacksize = 0;
52
- $tagqueue = '';
53
- $newtext = '';
54
- // Known single-entity/self-closing tags
55
- $single_tags = array( 'area', 'base', 'basefont', 'br', 'col', 'command', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param', 'source' );
56
- // Tags that can be immediately nested within themselves
57
- $nestable_tags = array( 'blockquote', 'div', 'object', 'q', 'span' );
58
-
59
- // WP bug fix for comments - in case you REALLY meant to type '< !--'
60
- $text = str_replace( '< !--', '< !--', $text );
61
- // WP bug fix for LOVE <3 (and other situations with '<' before a number)
62
- $text = preg_replace( '#<([0-9]{1})#', '&lt;$1', $text );
63
-
64
- /**
65
- * Matches supported tags.
66
- *
67
- * To get the pattern as a string without the comments paste into a PHP
68
- * REPL like `php -a`.
69
- *
70
- * @see https://html.spec.whatwg.org/#elements-2
71
- * @see https://w3c.github.io/webcomponents/spec/custom/#valid-custom-element-name
72
- *
73
- * @example
74
- * ~# php -a
75
- * php > $s = [paste copied contents of expression below including parentheses];
76
- * php > echo $s;
77
- */
78
- $tag_pattern = (
79
- '#<' . // Start with an opening bracket.
80
- '(/?)' . // Group 1 - If it's a closing tag it'll have a leading slash.
81
- '(' . // Group 2 - Tag name.
82
- // Custom element tags have more lenient rules than HTML tag names.
83
- '(?:[a-z](?:[a-z0-9._]*)-(?:[a-z0-9._-]+)+)' .
84
- '|' .
85
- // Traditional tag rules approximate HTML tag names.
86
- '(?:[\w:]+)' .
87
- ')' .
88
- '(?:' .
89
- // We either immediately close the tag with its '>' and have nothing here.
90
- '\s*' .
91
- '(/?)' . // Group 3 - "attributes" for empty tag.
92
- '|' .
93
- // Or we must start with space characters to separate the tag name from the attributes (or whitespace).
94
- '(\s+)' . // Group 4 - Pre-attribute whitespace.
95
- '([^>]*)' . // Group 5 - Attributes.
96
- ')' .
97
- '>#' // End with a closing bracket.
98
- );
99
-
100
- while ( preg_match( $tag_pattern, $text, $regex ) ) {
101
- $full_match = $regex[0];
102
- $has_leading_slash = ! empty( $regex[1] );
103
- $tag_name = $regex[2];
104
- $tag = strtolower( $tag_name );
105
- $is_single_tag = in_array( $tag, $single_tags, true );
106
- $pre_attribute_ws = isset( $regex[4] ) ? $regex[4] : '';
107
- $attributes = trim( isset( $regex[5] ) ? $regex[5] : $regex[3] );
108
- $has_self_closer = '/' === substr( $attributes, -1 );
109
-
110
- $newtext .= $tagqueue;
111
-
112
- $i = strpos( $text, $full_match );
113
- $l = strlen( $full_match );
114
-
115
- // Clear the shifter.
116
- $tagqueue = '';
117
- if ( $has_leading_slash ) { // End Tag.
118
- // If too many closing tags.
119
- if ( $stacksize <= 0 ) {
120
- $tag = '';
121
- // Or close to be safe $tag = '/' . $tag.
122
-
123
- // If stacktop value = tag close value, then pop.
124
- } elseif ( $tagstack[ $stacksize - 1 ] === $tag ) { // Found closing tag.
125
- $tag = '</' . $tag . '>'; // Close Tag.
126
- array_pop( $tagstack );
127
- $stacksize--;
128
- } else { // Closing tag not at top, search for it.
129
- for ( $j = $stacksize - 1; $j >= 0; $j-- ) {
130
- if ( $tagstack[ $j ] === $tag ) {
131
- // Add tag to tagqueue.
132
- for ( $k = $stacksize - 1; $k >= $j; $k-- ) {
133
- $tagqueue .= '</' . array_pop( $tagstack ) . '>';
134
- $stacksize--;
135
- }
136
- break;
137
- }
138
- }
139
- $tag = '';
140
- }
141
- } else { // Begin Tag.
142
- if ( $has_self_closer ) { // If it presents itself as a self-closing tag...
143
- // ...but it isn't a known single-entity self-closing tag, then don't let it be treated as such and
144
- // immediately close it with a closing tag (the tag will encapsulate no text as a result)
145
- if ( ! $is_single_tag ) {
146
- $attributes = trim( substr( $attributes, 0, -1 ) ) . "></$tag";
147
- }
148
- } elseif ( $is_single_tag ) { // ElseIf it's a known single-entity tag but it doesn't close itself, do so
149
- $pre_attribute_ws = ' ';
150
- $attributes .= 0 < strlen( $attributes ) ? ' /' : '/'; // EDIT: If there are attributes, add space before closing tag to match how WP insert br, hr and img tags.
151
- } else { // It's not a single-entity tag.
152
- // If the top of the stack is the same as the tag we want to push, close previous tag.
153
- if ( $stacksize > 0 && ! in_array( $tag, $nestable_tags, true ) && $tagstack[ $stacksize - 1 ] === $tag ) {
154
- $tagqueue = '</' . array_pop( $tagstack ) . '>';
155
- $stacksize--;
156
- }
157
- $stacksize = array_push( $tagstack, $tag );
158
- }
159
-
160
- // Attributes.
161
- if ( $has_self_closer && $is_single_tag ) {
162
- // We need some space - avoid <br/> and prefer <br />.
163
- $pre_attribute_ws = ' ';
164
- }
165
-
166
- $tag = '<' . $tag . $pre_attribute_ws . $attributes . '>';
167
- // If already queuing a close tag, then put this tag on too.
168
- if ( ! empty( $tagqueue ) ) {
169
- $tagqueue .= $tag;
170
- $tag = '';
171
- }
172
- }
173
- $newtext .= substr( $text, 0, $i ) . $tag;
174
- $text = substr( $text, $i + $l );
175
- }
176
-
177
- // Clear Tag Queue.
178
- $newtext .= $tagqueue;
179
-
180
- // Add remaining text.
181
- $newtext .= $text;
182
-
183
- while ( $x = array_pop( $tagstack ) ) {
184
- $newtext .= '</' . $x . '>'; // Add remaining tags to close.
185
- }
186
-
187
- // WP fix for the bug with HTML comments.
188
- $newtext = str_replace( '< !--', '<!--', $newtext );
189
- $newtext = str_replace( '< !--', '< !--', $newtext );
190
-
191
- return $newtext;
192
- }
193
-
194
- /**
195
- * Multibyte substr_replace(). The mbstring library does not come with a multibyte equivalent of substr_replace().
196
- * This function behaves exactly like substr_replace() even when the arguments are arrays.
197
- *
198
- * @link https://gist.github.com/stemar/8287074
199
- *
200
- * @since 2.0
201
- *
202
- * @param $string
203
- * @param $replacement
204
- * @param $start
205
- * @param null $length
206
- *
207
- * @return array|string
208
- */
209
- if ( ! function_exists( __NAMESPACE__ . '\mb_substr_replace' ) ) :
210
- function mb_substr_replace( $string, $replacement, $start, $length = null ) {
211
-
212
- if ( is_array( $string ) ) {
213
-
214
- $num = count( $string );
215
-
216
- // $replacement
217
- $replacement = is_array( $replacement ) ? array_slice( $replacement, 0, $num ) : array_pad( array( $replacement ), $num, $replacement );
218
-
219
- // $start
220
- if ( is_array( $start ) ) {
221
- $start = array_slice( $start, 0, $num );
222
- foreach ( $start as $key => $value ) {
223
- $start[ $key ] = is_int( $value ) ? $value : 0;
224
- }
225
- } else {
226
- $start = array_pad( array( $start ), $num, $start );
227
- }
228
-
229
- // $length
230
- if ( ! isset( $length ) ) {
231
- $length = array_fill( 0, $num, 0 );
232
- } elseif ( is_array( $length ) ) {
233
- $length = array_slice( $length, 0, $num );
234
- foreach ( $length as $key => $value ) {
235
- $length[ $key ] = isset( $value ) ? ( is_int( $value ) ? $value : $num ) : 0;
236
- }
237
- } else {
238
- $length = array_pad( array( $length ), $num, $length );
239
- }
240
-
241
- // Recursive call
242
- return array_map( __FUNCTION__, $string, $replacement, $start, $length );
243
- }
244
-
245
- preg_match_all( '/./us', (string) $string, $smatches );
246
- preg_match_all( '/./us', (string) $replacement, $rmatches );
247
-
248
- if ( $length === null ) {
249
-
250
- $length = mb_strlen( $string );
251
- }
252
-
253
- array_splice( $smatches[0], $start, $length, $rmatches[0] );
254
-
255
- return join( $smatches[0] );
256
- }
257
- endif;
258
- /**
259
- * Returns a string with all items from the $find array replaced with their matching
260
- * items in the $replace array. This does a one to one replacement (rather than globally).
261
- *
262
- * This function is multibyte safe.
263
- *
264
- * $find and $replace are arrays, $string is the haystack. All variables are passed by reference.
265
- *
266
- * @since 1.0
267
- *
268
- * @param bool $find
269
- * @param bool $replace
270
- * @param string $string
271
- *
272
- * @return mixed|string
273
- */
274
- if ( ! function_exists( __NAMESPACE__ . '\mb_find_replace' ) ) :
275
- function mb_find_replace( &$find = false, &$replace = false, &$string = '' ) {
276
-
277
- if ( is_array( $find ) && is_array( $replace ) && $string ) {
278
-
279
- // check if multibyte strings are supported
280
- if ( function_exists( 'mb_strpos' ) ) {
281
-
282
- //for ( $i = 0; $i < count( $find ); $i ++ ) {
283
- //
284
- // $string = mb_substr(
285
- // $string,
286
- // 0,
287
- // mb_strpos( $string, $find[ $i ] )
288
- // ) . // everything before $find
289
- // $replace[ $i ] . // its replacement
290
- // mb_substr(
291
- // $string,
292
- // mb_strpos( $string, $find[ $i ] ) + mb_strlen( $find[ $i ] )
293
- // ) // everything after $find
294
- // ;
295
- //}
296
-
297
- for ( $i = 0; $i < count( $find ); $i ++ ) {
298
-
299
- $needle = $find[ $i ];
300
- $start = mb_strpos( $string, $needle );
301
-
302
- // If heading can not be found, let try decoding entities to see if it can be found.
303
- if ( false === $start ) {
304
-
305
- $needle = html_entity_decode(
306
- $needle,
307
- ENT_QUOTES,
308
- get_option( 'blog_charset' )
309
- );
310
-
311
- $string = html_entity_decode(
312
- $string,
313
- ENT_QUOTES,
314
- get_option( 'blog_charset' )
315
- );
316
-
317
- $needle = str_replace(array('’','“','”'), array('\'','"','"'), $needle);
318
-
319
- $start = mb_strpos( $string, $needle );
320
- }
321
-
322
- /*
323
- * `mb_strpos()` can return `false`. Only process `mb_substr_replace()` if position in string is found.
324
- */
325
- if ( is_int( $start ) ) {
326
-
327
- $length = mb_strlen( $needle );
328
- $string = mb_substr_replace( $string, $replace[ $i ], $start, $length );
329
- }
330
-
331
- }
332
-
333
- } else {
334
-
335
- for ( $i = 0; $i < count( $find ); $i ++ ) {
336
-
337
- $start = strpos( $string, $find[ $i ] );
338
- $length = strlen( $find[ $i ] );
339
-
340
- /*
341
- * `strpos()` can return `false`. Only process `substr_replace()` if position in string is found.
342
- */
343
- if ( is_int( $start ) ) {
344
-
345
- $string = substr_replace( $string, $replace[ $i ], $start, $length );
346
- }
347
- }
348
- }
349
- }
350
-
351
- return $string;
352
- }
 
 
 
 
353
  endif;
1
+ <?php
2
+
3
+ namespace Easy_Plugins\Table_Of_Contents\String;
4
+
5
+ /**
6
+ * Replace `<br />` tags with parameter.
7
+ *
8
+ * @since 2.0.8
9
+ *
10
+ * @param string $string
11
+ * @param string $to
12
+ *
13
+ * @return string
14
+ */
15
+ function br2( $string, $to = "\r\n" ) {
16
+
17
+ $string = preg_replace( '`<br[/\s]*>`i', $to, $string );
18
+
19
+ return $string;
20
+ }
21
+
22
+ /**
23
+ * Replace `<br />` tags with new lines.
24
+ *
25
+ * @link https://stackoverflow.com/a/27509016/5351316
26
+ *
27
+ * @since 2.0.8
28
+ *
29
+ * @param string $string
30
+ *
31
+ * @return string
32
+ */
33
+ function br2nl( $string ) {
34
+
35
+ return br2( $string );
36
+ }
37
+
38
+ /**
39
+ * Pulled from WordPress formatting functions.
40
+ *
41
+ * Edited to add space before self closing tags.
42
+ *
43
+ * @since 2.0
44
+ *
45
+ * @param string $text
46
+ *
47
+ * @return string|string[]
48
+ */
49
+ function force_balance_tags( $text ) {
50
+ $tagstack = array();
51
+ $stacksize = 0;
52
+ $tagqueue = '';
53
+ $newtext = '';
54
+ // Known single-entity/self-closing tags
55
+ $single_tags = array( 'area', 'base', 'basefont', 'br', 'col', 'command', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param', 'source' );
56
+ // Tags that can be immediately nested within themselves
57
+ $nestable_tags = array( 'blockquote', 'div', 'object', 'q', 'span' );
58
+
59
+ // WP bug fix for comments - in case you REALLY meant to type '< !--'
60
+ $text = str_replace( '< !--', '< !--', $text );
61
+ // WP bug fix for LOVE <3 (and other situations with '<' before a number)
62
+ $text = preg_replace( '#<([0-9]{1})#', '&lt;$1', $text );
63
+
64
+ /**
65
+ * Matches supported tags.
66
+ *
67
+ * To get the pattern as a string without the comments paste into a PHP
68
+ * REPL like `php -a`.
69
+ *
70
+ * @see https://html.spec.whatwg.org/#elements-2
71
+ * @see https://w3c.github.io/webcomponents/spec/custom/#valid-custom-element-name
72
+ *
73
+ * @example
74
+ * ~# php -a
75
+ * php > $s = [paste copied contents of expression below including parentheses];
76
+ * php > echo $s;
77
+ */
78
+ $tag_pattern = (
79
+ '#<' . // Start with an opening bracket.
80
+ '(/?)' . // Group 1 - If it's a closing tag it'll have a leading slash.
81
+ '(' . // Group 2 - Tag name.
82
+ // Custom element tags have more lenient rules than HTML tag names.
83
+ '(?:[a-z](?:[a-z0-9._]*)-(?:[a-z0-9._-]+)+)' .
84
+ '|' .
85
+ // Traditional tag rules approximate HTML tag names.
86
+ '(?:[\w:]+)' .
87
+ ')' .
88
+ '(?:' .
89
+ // We either immediately close the tag with its '>' and have nothing here.
90
+ '\s*' .
91
+ '(/?)' . // Group 3 - "attributes" for empty tag.
92
+ '|' .
93
+ // Or we must start with space characters to separate the tag name from the attributes (or whitespace).
94
+ '(\s+)' . // Group 4 - Pre-attribute whitespace.
95
+ '([^>]*)' . // Group 5 - Attributes.
96
+ ')' .
97
+ '>#' // End with a closing bracket.
98
+ );
99
+
100
+ while ( preg_match( $tag_pattern, $text, $regex ) ) {
101
+ $full_match = $regex[0];
102
+ $has_leading_slash = ! empty( $regex[1] );
103
+ $tag_name = $regex[2];
104
+ $tag = strtolower( $tag_name );
105
+ $is_single_tag = in_array( $tag, $single_tags, true );
106
+ $pre_attribute_ws = isset( $regex[4] ) ? $regex[4] : '';
107
+ $attributes = trim( isset( $regex[5] ) ? $regex[5] : $regex[3] );
108
+ $has_self_closer = '/' === substr( $attributes, -1 );
109
+
110
+ $newtext .= $tagqueue;
111
+
112
+ $i = strpos( $text, $full_match );
113
+ $l = strlen( $full_match );
114
+
115
+ // Clear the shifter.
116
+ $tagqueue = '';
117
+ if ( $has_leading_slash ) { // End Tag.
118
+ // If too many closing tags.
119
+ if ( $stacksize <= 0 ) {
120
+ $tag = '';
121
+ // Or close to be safe $tag = '/' . $tag.
122
+
123
+ // If stacktop value = tag close value, then pop.
124
+ } elseif ( $tagstack[ $stacksize - 1 ] === $tag ) { // Found closing tag.
125
+ $tag = '</' . $tag . '>'; // Close Tag.
126
+ array_pop( $tagstack );
127
+ $stacksize--;
128
+ } else { // Closing tag not at top, search for it.
129
+ for ( $j = $stacksize - 1; $j >= 0; $j-- ) {
130
+ if ( $tagstack[ $j ] === $tag ) {
131
+ // Add tag to tagqueue.
132
+ for ( $k = $stacksize - 1; $k >= $j; $k-- ) {
133
+ $tagqueue .= '</' . array_pop( $tagstack ) . '>';
134
+ $stacksize--;
135
+ }
136
+ break;
137
+ }
138
+ }
139
+ $tag = '';
140
+ }
141
+ } else { // Begin Tag.
142
+ if ( $has_self_closer ) { // If it presents itself as a self-closing tag...
143
+ // ...but it isn't a known single-entity self-closing tag, then don't let it be treated as such and
144
+ // immediately close it with a closing tag (the tag will encapsulate no text as a result)
145
+ if ( ! $is_single_tag ) {
146
+ $attributes = trim( substr( $attributes, 0, -1 ) ) . "></$tag";
147
+ }
148
+ } elseif ( $is_single_tag ) { // ElseIf it's a known single-entity tag but it doesn't close itself, do so
149
+ $pre_attribute_ws = ' ';
150
+ $attributes .= 0 < strlen( $attributes ) ? ' /' : '/'; // EDIT: If there are attributes, add space before closing tag to match how WP insert br, hr and img tags.
151
+ } else { // It's not a single-entity tag.
152
+ // If the top of the stack is the same as the tag we want to push, close previous tag.
153
+ if ( $stacksize > 0 && ! in_array( $tag, $nestable_tags, true ) && $tagstack[ $stacksize - 1 ] === $tag ) {
154
+ $tagqueue = '</' . array_pop( $tagstack ) . '>';
155
+ $stacksize--;
156
+ }
157
+ $stacksize = array_push( $tagstack, $tag );
158
+ }
159
+
160
+ // Attributes.
161
+ if ( $has_self_closer && $is_single_tag ) {
162
+ // We need some space - avoid <br/> and prefer <br />.
163
+ $pre_attribute_ws = ' ';
164
+ }
165
+
166
+ $tag = '<' . $tag . $pre_attribute_ws . $attributes . '>';
167
+ // If already queuing a close tag, then put this tag on too.
168
+ if ( ! empty( $tagqueue ) ) {
169
+ $tagqueue .= $tag;
170
+ $tag = '';
171
+ }
172
+ }
173
+ $newtext .= substr( $text, 0, $i ) . $tag;
174
+ $text = substr( $text, $i + $l );
175
+ }
176
+
177
+ // Clear Tag Queue.
178
+ $newtext .= $tagqueue;
179
+
180
+ // Add remaining text.
181
+ $newtext .= $text;
182
+
183
+ while ( $x = array_pop( $tagstack ) ) {
184
+ $newtext .= '</' . $x . '>'; // Add remaining tags to close.
185
+ }
186
+
187
+ // WP fix for the bug with HTML comments.
188
+ $newtext = str_replace( '< !--', '<!--', $newtext );
189
+ $newtext = str_replace( '< !--', '< !--', $newtext );
190
+
191
+ return $newtext;
192
+ }
193
+
194
+ /**
195
+ * Multibyte substr_replace(). The mbstring library does not come with a multibyte equivalent of substr_replace().
196
+ * This function behaves exactly like substr_replace() even when the arguments are arrays.
197
+ *
198
+ * @link https://gist.github.com/stemar/8287074
199
+ *
200
+ * @since 2.0
201
+ *
202
+ * @param $string
203
+ * @param $replacement
204
+ * @param $start
205
+ * @param null $length
206
+ *
207
+ * @return array|string
208
+ */
209
+ if ( ! function_exists( __NAMESPACE__ . '\mb_substr_replace' ) ) :
210
+ function mb_substr_replace( $string, $replacement, $start, $length = null ) {
211
+
212
+ if ( is_array( $string ) ) {
213
+
214
+ $num = count( $string );
215
+
216
+ // $replacement
217
+ $replacement = is_array( $replacement ) ? array_slice( $replacement, 0, $num ) : array_pad( array( $replacement ), $num, $replacement );
218
+
219
+ // $start
220
+ if ( is_array( $start ) ) {
221
+ $start = array_slice( $start, 0, $num );
222
+ foreach ( $start as $key => $value ) {
223
+ $start[ $key ] = is_int( $value ) ? $value : 0;
224
+ }
225
+ } else {
226
+ $start = array_pad( array( $start ), $num, $start );
227
+ }
228
+
229
+ // $length
230
+ if ( ! isset( $length ) ) {
231
+ $length = array_fill( 0, $num, 0 );
232
+ } elseif ( is_array( $length ) ) {
233
+ $length = array_slice( $length, 0, $num );
234
+ foreach ( $length as $key => $value ) {
235
+ $length[ $key ] = isset( $value ) ? ( is_int( $value ) ? $value : $num ) : 0;
236
+ }
237
+ } else {
238
+ $length = array_pad( array( $length ), $num, $length );
239
+ }
240
+
241
+ // Recursive call
242
+ return array_map( __FUNCTION__, $string, $replacement, $start, $length );
243
+ }
244
+
245
+ preg_match_all( '/./us', (string) $string, $smatches );
246
+ preg_match_all( '/./us', (string) $replacement, $rmatches );
247
+
248
+ if ( $length === null ) {
249
+
250
+ $length = mb_strlen( $string );
251
+ }
252
+
253
+ array_splice( $smatches[0], $start, $length, $rmatches[0] );
254
+
255
+ return join( $smatches[0] );
256
+ }
257
+ endif;
258
+ /**
259
+ * Returns a string with all items from the $find array replaced with their matching
260
+ * items in the $replace array. This does a one to one replacement (rather than globally).
261
+ *
262
+ * This function is multibyte safe.
263
+ *
264
+ * $find and $replace are arrays, $string is the haystack. All variables are passed by reference.
265
+ *
266
+ * @since 1.0
267
+ *
268
+ * @param bool $find
269
+ * @param bool $replace
270
+ * @param string $string
271
+ *
272
+ * @return mixed|string
273
+ */
274
+ if ( ! function_exists( __NAMESPACE__ . '\mb_find_replace' ) ) :
275
+ function mb_find_replace( &$find = false, &$replace = false, &$string = '' ) {
276
+
277
+ if ( is_array( $find ) && is_array( $replace ) && $string ) {
278
+
279
+ // check if multibyte strings are supported
280
+ if ( function_exists( 'mb_strpos' ) ) {
281
+
282
+ //for ( $i = 0; $i < count( $find ); $i ++ ) {
283
+ //
284
+ // $string = mb_substr(
285
+ // $string,
286
+ // 0,
287
+ // mb_strpos( $string, $find[ $i ] )
288
+ // ) . // everything before $find
289
+ // $replace[ $i ] . // its replacement
290
+ // mb_substr(
291
+ // $string,
292
+ // mb_strpos( $string, $find[ $i ] ) + mb_strlen( $find[ $i ] )
293
+ // ) // everything after $find
294
+ // ;
295
+ //}
296
+
297
+ for ( $i = 0; $i < count( $find ); $i ++ ) {
298
+
299
+ $needle = $find[ $i ];
300
+ $start = mb_strpos( $string, $needle );
301
+
302
+ // If heading can not be found, let try decoding entities to see if it can be found.
303
+ if ( false === $start ) {
304
+
305
+ $needle = html_entity_decode(
306
+ $needle,
307
+ ENT_QUOTES,
308
+ get_option( 'blog_charset' )
309
+ );
310
+
311
+ $umlauts = false;
312
+ $umlauts = apply_filters( 'eztoc_modify_umlauts', $umlauts );
313
+ if($umlauts){
314
+ $string = html_entity_decode(
315
+ $string,
316
+ ENT_QUOTES,
317
+ get_option( 'blog_charset' )
318
+ );
319
+ }
320
+
321
+ $needle = str_replace(array('’','“','”'), array('\'','"','"'), $needle);
322
+
323
+ $start = mb_strpos( $string, $needle );
324
+ }
325
+
326
+ /*
327
+ * `mb_strpos()` can return `false`. Only process `mb_substr_replace()` if position in string is found.
328
+ */
329
+ if ( is_int( $start ) ) {
330
+
331
+ $length = mb_strlen( $needle );
332
+ $string = mb_substr_replace( $string, $replace[ $i ], $start, $length );
333
+ }
334
+
335
+ }
336
+
337
+ } else {
338
+
339
+ for ( $i = 0; $i < count( $find ); $i ++ ) {
340
+
341
+ $start = strpos( $string, $find[ $i ] );
342
+ $length = strlen( $find[ $i ] );
343
+
344
+ /*
345
+ * `strpos()` can return `false`. Only process `substr_replace()` if position in string is found.
346
+ */
347
+ if ( is_int( $start ) ) {
348
+
349
+ $string = substr_replace( $string, $replace[ $i ], $start, $length );
350
+ }
351
+ }
352
+ }
353
+ }
354
+
355
+ return $string;
356
+ }
357
  endif;
includes/newsletter.php CHANGED
@@ -1,140 +1,140 @@
1
- <?php
2
- // Exit if accessed directly
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- class eztoc_pointers {
8
- const DISPLAY_VERSION = 'v1.0';
9
- function __construct () {
10
- add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
11
- }
12
- function admin_enqueue_scripts () {
13
- $dismissed = explode (',', get_user_meta (wp_get_current_user ()->ID, 'dismissed_wp_pointers', true));
14
- $do_tour = !in_array ('eztoc_subscribe_pointer', $dismissed);
15
- if ($do_tour) {
16
- wp_enqueue_style ('wp-pointer');
17
- wp_enqueue_script ('wp-pointer');
18
-
19
- add_action('admin_print_footer_scripts', array($this, 'admin_print_footer_scripts'));
20
- add_action('admin_head', array($this, 'admin_head')); // Hook to admin head
21
- }
22
- }
23
- function admin_head () {
24
- ?>
25
- <style type="text/css" media="screen"> #pointer-primary { margin: 0 5px 0 0; } </style>
26
- <?php }
27
- function admin_print_footer_scripts () {
28
- global $pagenow;
29
- global $current_user;
30
- $tour = array ();
31
- $tab = isset($_GET['tab']) ? sanitize_text_field( wp_unslash($_GET['tab'])) : '';
32
- $function = '';
33
- $button2 = '';
34
- $options = array ();
35
- $show_pointer = false;
36
-
37
- if (!array_key_exists($tab, $tour)) {
38
-
39
- $show_pointer = true;
40
- $file_error = true;
41
-
42
- $id = '.settings_page_table-of-contents'; // Define ID used on page html element where we want to display pointer
43
-
44
- $content = '<h3>' . sprintf (esc_html__('Thank You for using Easy TOC!', 'easy-table-of-contents'), self::DISPLAY_VERSION) . '</h3>';
45
- $content .= '<p>' . esc_html__('Do you want the latest update on', 'easy-table-of-contents') . '<b>' . esc_html__(' Easy TOC ', 'easy-table-of-contents') . '</b>' . esc_html__('before others and some best resources on Easy TOC in a single email? - Free just for users of Easy TOC!', 'easy-table-of-contents').'</p>';
46
- $content .= '
47
-
48
- <style type="text/css">
49
- .wp-pointer-buttons{ padding:0; overflow: hidden; }
50
- .wp-pointer-content .button-secondary{ left: -25px;background: transparent;top: 5px; border: 0;position: relative; padding: 0; box-shadow: none;margin: 0;color: #0085ba;} .wp-pointer-content .button-primary{ display:none} #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
51
- </style>
52
- <div id="mc_embed_signup">
53
- <form method="POST" id="subscribe-newsletter-form">
54
- <div id="mc_embed_signup_scroll">
55
- <div class="mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">
56
- <input type="text" name="name" class="form-control" placeholder="Name" hidden value="' . esc_attr( $current_user->display_name ) . '" style="display:none">
57
-
58
- <input type="text" value="' . esc_attr( $current_user->user_email ) . '" name="email" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">
59
-
60
- <input type="text" name="company" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="' . esc_url( get_home_url() ) . '">
61
-
62
- <input type="hidden" name="ml-submit" value="1" />
63
- </div>
64
- <div id="mce-responses">
65
- <div class="response" id="mce-error-response" style="display:none"></div>
66
- <div class="response" id="mce-success-response" style="display:none"></div>
67
- </div>
68
- <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
69
- <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>
70
- <input type="submit" value="Subscribe" name="subscribe" id="pointer-close" class="button mc-newsletter-sent" style=" background: #0085ba; border-color: #006799; padding: 0px 16px; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px; margin-top: 1px; color: #fff; box-shadow: 0 1px 0 #006799;">
71
- </div>
72
- </form>
73
- </div>';
74
- $options = array (
75
- 'content' => $content,
76
- 'position' => array ('edge' => 'left', 'align' => 'left')
77
- );
78
- }
79
- if ($show_pointer) {
80
- //var_dump($id);die;
81
- $this->eztoc_pointer_script ($id, $options, esc_html__('No Thanks', 'easy-table-of-contents'), $button2, $function);
82
- }
83
- }
84
- function get_admin_url($page, $tab) {
85
- $url = admin_url();
86
- $url .= $page.'?tab='.$tab;
87
- return $url;
88
- }
89
- function eztoc_pointer_script ($id, $options, $button1, $button2=false, $function='') {
90
- ?>
91
- <script type="text/javascript">
92
- (function ($) {
93
- var wp_pointers_tour_opts = <?php echo json_encode ($options); ?>, setup;
94
- wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, {
95
- buttons: function (event, t) {
96
- button= jQuery ('<a id="pointer-close" class="button-secondary">' + '<?php echo wp_kses_post($button1); ?>' + '</a>');
97
- button_2= jQuery ('#pointer-close.button');
98
- button.bind ('click.pointer', function () {
99
- t.element.pointer ('close');
100
- });
101
- button_2.on('click', function() {
102
- t.element.pointer ('close');
103
- } );
104
- return button;
105
- },
106
- close: function () {
107
- $.post (ajaxurl, {
108
- pointer: 'eztoc_subscribe_pointer',
109
- action: 'dismiss-wp-pointer'
110
- });
111
- }
112
- });
113
- setup = function () {
114
- $('<?php echo esc_attr($id); ?>').pointer(wp_pointers_tour_opts).pointer('open');
115
- <?php if ($button2) { ?>
116
- jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + '<?php echo wp_kses_post($button2); ?>' + '</a>');
117
- jQuery ('#pointer-primary').click (function () {
118
- <?php echo $function; ?>
119
- });
120
- jQuery ('#pointer-close').click (function () {
121
- $.post (ajaxurl, {
122
- pointer: 'eztoc_subscribe_pointer',
123
- action: 'dismiss-wp-pointer'
124
- });
125
- })
126
- <?php } ?>
127
- };
128
- if (wp_pointers_tour_opts.position && wp_pointers_tour_opts.position.defer_loading) {
129
- $(window).bind('load.wp-pointers', setup);
130
- }
131
- else {
132
- setup ();
133
- }
134
- }) (jQuery);
135
- </script>
136
- <?php
137
- }
138
- }
139
- $eztoc_pointers = new eztoc_pointers();
140
  ?>
1
+ <?php
2
+ // Exit if accessed directly
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ class eztoc_pointers {
8
+ const DISPLAY_VERSION = 'v1.0';
9
+ function __construct () {
10
+ add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
11
+ }
12
+ function admin_enqueue_scripts () {
13
+ $dismissed = explode (',', get_user_meta (wp_get_current_user ()->ID, 'dismissed_wp_pointers', true));
14
+ $do_tour = !in_array ('eztoc_subscribe_pointer', $dismissed);
15
+ if ($do_tour) {
16
+ wp_enqueue_style ('wp-pointer');
17
+ wp_enqueue_script ('wp-pointer');
18
+
19
+ add_action('admin_print_footer_scripts', array($this, 'admin_print_footer_scripts'));
20
+ add_action('admin_head', array($this, 'admin_head')); // Hook to admin head
21
+ }
22
+ }
23
+ function admin_head () {
24
+ ?>
25
+ <style type="text/css" media="screen"> #pointer-primary { margin: 0 5px 0 0; } </style>
26
+ <?php }
27
+ function admin_print_footer_scripts () {
28
+ global $pagenow;
29
+ global $current_user;
30
+ $tour = array ();
31
+ $tab = isset($_GET['tab']) ? sanitize_text_field( wp_unslash($_GET['tab'])) : '';
32
+ $function = '';
33
+ $button2 = '';
34
+ $options = array ();
35
+ $show_pointer = false;
36
+
37
+ if (!array_key_exists($tab, $tour)) {
38
+
39
+ $show_pointer = true;
40
+ $file_error = true;
41
+
42
+ $id = '.settings_page_table-of-contents'; // Define ID used on page html element where we want to display pointer
43
+
44
+ $content = '<h3>' . sprintf (esc_html__('Thank You for using Easy TOC!', 'easy-table-of-contents'), self::DISPLAY_VERSION) . '</h3>';
45
+ $content .= '<p>' . esc_html__('Do you want the latest update on', 'easy-table-of-contents') . '<b>' . esc_html__(' Easy TOC ', 'easy-table-of-contents') . '</b>' . esc_html__('before others and some best resources on Easy TOC in a single email? - Free just for users of Easy TOC!', 'easy-table-of-contents').'</p>';
46
+ $content .= '
47
+
48
+ <style type="text/css">
49
+ .wp-pointer-buttons{ padding:0; overflow: hidden; }
50
+ .wp-pointer-content .button-secondary{ left: -25px;background: transparent;top: 5px; border: 0;position: relative; padding: 0; box-shadow: none;margin: 0;color: #0085ba;} .wp-pointer-content .button-primary{ display:none} #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
51
+ </style>
52
+ <div id="mc_embed_signup">
53
+ <form method="POST" id="subscribe-newsletter-form">
54
+ <div id="mc_embed_signup_scroll">
55
+ <div class="mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">
56
+ <input type="text" name="name" class="form-control" placeholder="Name" hidden value="' . esc_attr( $current_user->display_name ) . '" style="display:none">
57
+
58
+ <input type="text" value="' . esc_attr( $current_user->user_email ) . '" name="email" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">
59
+
60
+ <input type="text" name="company" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="' . esc_url( get_home_url() ) . '">
61
+
62
+ <input type="hidden" name="ml-submit" value="1" />
63
+ </div>
64
+ <div id="mce-responses">
65
+ <div class="response" id="mce-error-response" style="display:none"></div>
66
+ <div class="response" id="mce-success-response" style="display:none"></div>
67
+ </div>
68
+ <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
69
+ <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>
70
+ <input type="submit" value="Subscribe" name="subscribe" id="pointer-close" class="button mc-newsletter-sent" style=" background: #0085ba; border-color: #006799; padding: 0px 16px; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px; margin-top: 1px; color: #fff; box-shadow: 0 1px 0 #006799;">
71
+ </div>
72
+ </form>
73
+ </div>';
74
+ $options = array (
75
+ 'content' => $content,
76
+ 'position' => array ('edge' => 'left', 'align' => 'left')
77
+ );
78
+ }
79
+ if ($show_pointer) {
80
+ //var_dump($id);die;
81
+ $this->eztoc_pointer_script ($id, $options, esc_html__('No Thanks', 'easy-table-of-contents'), $button2, $function);
82
+ }
83
+ }
84
+ function get_admin_url($page, $tab) {
85
+ $url = admin_url();
86
+ $url .= $page.'?tab='.$tab;
87
+ return $url;
88
+ }
89
+ function eztoc_pointer_script ($id, $options, $button1, $button2=false, $function='') {
90
+ ?>
91
+ <script type="text/javascript">
92
+ (function ($) {
93
+ var wp_pointers_tour_opts = <?php echo json_encode ($options); ?>, setup;
94
+ wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, {
95
+ buttons: function (event, t) {
96
+ button= jQuery ('<a id="pointer-close" class="button-secondary">' + '<?php echo wp_kses_post($button1); ?>' + '</a>');
97
+ button_2= jQuery ('#pointer-close.button');
98
+ button.bind ('click.pointer', function () {
99
+ t.element.pointer ('close');
100
+ });
101
+ button_2.on('click', function() {
102
+ t.element.pointer ('close');
103
+ } );
104
+ return button;
105
+ },
106
+ close: function () {
107
+ $.post (ajaxurl, {
108
+ pointer: 'eztoc_subscribe_pointer',
109
+ action: 'dismiss-wp-pointer'
110
+ });
111
+ }
112
+ });
113
+ setup = function () {
114
+ $('<?php echo esc_attr($id); ?>').pointer(wp_pointers_tour_opts).pointer('open');
115
+ <?php if ($button2) { ?>
116
+ jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + '<?php echo wp_kses_post($button2); ?>' + '</a>');
117
+ jQuery ('#pointer-primary').click (function () {
118
+ <?php echo $function; ?>
119
+ });
120
+ jQuery ('#pointer-close').click (function () {
121
+ $.post (ajaxurl, {
122
+ pointer: 'eztoc_subscribe_pointer',
123
+ action: 'dismiss-wp-pointer'
124
+ });
125
+ })
126
+ <?php } ?>
127
+ };
128
+ if (wp_pointers_tour_opts.position && wp_pointers_tour_opts.position.defer_loading) {
129
+ $(window).bind('load.wp-pointers', setup);
130
+ }
131
+ else {
132
+ setup ();
133
+ }
134
+ }) (jQuery);
135
+ </script>
136
+ <?php
137
+ }
138
+ }
139
+ $eztoc_pointers = new eztoc_pointers();
140
  ?>
languages/easy-table-of-contents-nl_NL.po CHANGED
@@ -1,594 +1,630 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Eazy TOC\n"
4
- "POT-Creation-Date: 2018-01-24 15:51+0000\n"
5
- "PO-Revision-Date: 2018-01-24 15:51+0000\n"
6
- "Last-Translator: Steven - Profile <shazahm1@hotmail.com>\n"
7
- "Language-Team: Dutch\n"
8
- "Language: nl-NL\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Loco - https://localise.biz/\n"
13
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n_noop:1,2;_x:1,2c;_nx:4c,1,2;"
14
- "_nx_noop:4c,1,2;_ex:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;"
15
- "esc_html_e;esc_html_x:1,2c\n"
16
- "X-Poedit-Basepath: ..\n"
17
- "X-Poedit-SourceCharset: UTF-8\n"
18
- "Plural-Forms: nplurals=2; plural=n != 1\n"
19
- "X-Poedit-SearchPath-0: .\n"
20
- "Report-Msgid-Bugs-To: "
21
-
22
- #. Plugin Name of the plugin/theme
23
- msgid "Easy Table of Contents"
24
- msgstr ""
25
-
26
- #. Plugin URI of the plugin/theme
27
- #. Author URI of the plugin/theme
28
- msgid "http://connections-pro.com/"
29
- msgstr ""
30
-
31
- #. Description of the plugin/theme
32
- msgid ""
33
- "Adds a user friendly and fully automatic way to create and display a table "
34
- "of contents generated from the page content."
35
- msgstr ""
36
-
37
- #. Author of the plugin/theme
38
- msgid "Steven A. Zahm"
39
- msgstr ""
40
-
41
- #: includes/class.admin.php:60
42
- msgid "Settings"
43
- msgstr "Instellingen"
44
-
45
- #: includes/class.admin.php:92 includes/class.admin.php:93
46
- #: includes/class.admin.php:145 includes/class.widget-toc.php:27
47
- #: includes/inc.admin-options-page.php:2
48
- msgid "Table of Contents"
49
- msgstr "Inhoudsopgave"
50
-
51
- #: includes/class.admin.php:188
52
- msgid "Disable the automatic insertion of the table of contents."
53
- msgstr "Automatisch invoegen van de inhoudsopgave uitschakelen."
54
-
55
- #: includes/class.admin.php:199
56
- msgid "Insert table of contents."
57
- msgstr "Inhoudsopgave invoegen."
58
-
59
- #: includes/class.admin.php:211
60
- msgid "Advanced:"
61
- msgstr "Geavanceerd:"
62
-
63
- #: includes/class.admin.php:218
64
- msgid "NOTE:"
65
- msgstr "Let op:"
66
-
67
- #: includes/class.admin.php:220
68
- msgid ""
69
- "Using the advanced options below will override the global advanced settings."
70
- msgstr ""
71
- "Het gebruik van de geavanceerde opties zal de standaard instellingen "
72
- "overschrijven."
73
-
74
- #: includes/class.admin.php:229 includes/class.options.php:446
75
- msgid "Headings:"
76
- msgstr "Koppen:"
77
-
78
- #: includes/class.admin.php:235 includes/class.options.php:447
79
- msgid ""
80
- "Select the heading to consider when generating the table of contents. "
81
- "Deselecting a heading will exclude it."
82
- msgstr ""
83
- "Selecteer de koppen die gebruikt moeten worden om de inhoudsopgave te "
84
- "genereren. Een kop niet selecteren zal hem uitsluiten."
85
-
86
- #: includes/class.admin.php:237 includes/class.options.php:450
87
- msgid "Heading 1 (h1)"
88
- msgstr "Kop 1 (h1)"
89
-
90
- #: includes/class.admin.php:238 includes/class.options.php:451
91
- msgid "Heading 2 (h2)"
92
- msgstr "Kop 2 (h2)"
93
-
94
- #: includes/class.admin.php:239 includes/class.options.php:452
95
- msgid "Heading 3 (h3)"
96
- msgstr "Kop 3 (h3)"
97
-
98
- #: includes/class.admin.php:240 includes/class.options.php:453
99
- msgid "Heading 4 (h4)"
100
- msgstr "Kop 4 (h4)"
101
-
102
- #: includes/class.admin.php:241 includes/class.options.php:454
103
- msgid "Heading 5 (h5)"
104
- msgstr "Kop 5 (h5)"
105
-
106
- #: includes/class.admin.php:242 includes/class.options.php:455
107
- msgid "Heading 6 (h6)"
108
- msgstr "Kop 6 (h6)"
109
-
110
- #: includes/class.admin.php:252
111
- msgid "Alternate Headings"
112
- msgstr "Alternatieve Koppen"
113
-
114
- #: includes/class.admin.php:258
115
- msgid ""
116
- "Specify alternate table of contents header string. Add the header to be "
117
- "replaced and the alternate header on a single line separated with a pipe "
118
- "<code>|</code>. Put each additional original and alternate header on its own "
119
- "line."
120
- msgstr ""
121
- "Specificeer de alternatieve tekst voor de koppen. Iedere kop (titel) die "
122
- "vervangen moet worden plaats je op één regel gescheiden met een <code>"
123
- "|</code> en dan de alternatieve tekst. Plaats daarna de volgende op een "
124
- "nieuwe regel, etc."
125
-
126
- #: includes/class.admin.php:275 includes/class.admin.php:309
127
- #: includes/class.options.php:470
128
- msgid "Examples:"
129
- msgstr "Voorbeelden:"
130
-
131
- #: includes/class.admin.php:277
132
- msgid ""
133
- "<code>Level [1.1]|Alternate TOC Header</code> Replaces Level [1.1] in the "
134
- "table of contents with Alternate TOC Header."
135
- msgstr ""
136
- "<code>Niveau [1.1]|Alternatieve TOC Kop</code> Vervangt Niveau [1.1] in de "
137
- "inhoudsopgave met de Alternatieve TOC Kop."
138
-
139
- #: includes/class.admin.php:279
140
- msgid "<strong>Note:</strong> This is case sensitive."
141
- msgstr "<strong>Opmerking:</strong> Dit is hoofdlettergevoelig."
142
-
143
- #: includes/class.admin.php:286 includes/class.options.php:461
144
- msgid "Exclude Headings"
145
- msgstr "Koppen uitsluiten"
146
-
147
- #: includes/class.admin.php:292 includes/class.options.php:462
148
- msgid ""
149
- "Specify headings to be excluded from appearing in the table of contents. "
150
- "Separate multiple headings with a pipe <code>|</code>. Use an asterisk <code>"
151
- "*</code> as a wildcard to match other text."
152
- msgstr ""
153
- "Specifieer welke koppen uit te sluiten uit de inhoudsopgave. Zet een "
154
- "sluisteken <code>|</code> tussen verschillende koppen en gebruik een "
155
- "asterisk <code>*</code> als een carte blanche om andere tekst te vinden."
156
-
157
- #: includes/class.admin.php:311 includes/class.options.php:472
158
- msgid "<code>Fruit*</code> Ignore headings starting with \"Fruit\"."
159
- msgstr "<code>Fruit*</code> Negeer koppen startende met \"Fruit\"."
160
-
161
- #: includes/class.admin.php:312 includes/class.options.php:473
162
- msgid ""
163
- "<code>*Fruit Diet*</code> Ignore headings with \"Fruit Diet\" somewhere in "
164
- "the heading."
165
- msgstr "<code>*Fruitdieet*</code> Negeer koppen die \"Fruitdieet\" bevatten."
166
-
167
- #: includes/class.admin.php:313 includes/class.options.php:474
168
- msgid ""
169
- "<code>Apple Tree|Oranges|Yellow Bananas</code> Ignore headings that are "
170
- "exactly \"Apple Tree\", \"Oranges\" or \"Yellow Bananas\"."
171
- msgstr ""
172
- "<code>De appelboom|Appelsienen|Gele bananen</code> Negeer koppen die exact "
173
- "overeenkomen met \"De appelboom\", \"Appelsienen\" or \"Gele bananen\"."
174
-
175
- #: includes/class.admin.php:315 includes/class.options.php:476
176
- msgid "<strong>Note:</strong> This is not case sensitive."
177
- msgstr "<strong>Opmerking:</strong> Dit is niet hoofdlettergevoelig."
178
-
179
- #: includes/class.options.php:163
180
- msgid "Enable Support"
181
- msgstr "Ondersteuning inschakelen"
182
-
183
- #: includes/class.options.php:164
184
- msgid "Select the post types to enable the support for table of contents."
185
- msgstr "Selecteer de berichttypes met ondersteuning voor inhoudsopgaves."
186
-
187
- #: includes/class.options.php:171
188
- msgid "Auto Insert"
189
- msgstr "Automatisch invoegen"
190
-
191
- #: includes/class.options.php:172
192
- msgid ""
193
- "Select the post types which will have the table of contents automatically "
194
- "inserted."
195
- msgstr ""
196
- "Selecteer de berichttypes die de inhoudsopgave automatisch ingevoegd krijgen."
197
-
198
- #: includes/class.options.php:173
199
- msgid ""
200
- "NOTE: The table of contents will only be automatically inserted on post "
201
- "types for which it has been enabled."
202
- msgstr ""
203
- "OPMERKING: de inhoudsopgave zal enkel automatisch ingevoegd worden voor "
204
- "berichttypes waarvoor ondersteuning ingeschakeld is."
205
-
206
- #: includes/class.options.php:180
207
- msgid "Position"
208
- msgstr "Positie"
209
-
210
- #: includes/class.options.php:181
211
- msgid "Choose where where you want to display the table of contents."
212
- msgstr "Kies waar de inhoudsopgave moet komen."
213
-
214
- #: includes/class.options.php:184
215
- msgid "Before first heading (default)"
216
- msgstr "Voor de eerste kop (standaard)"
217
-
218
- #: includes/class.options.php:185
219
- msgid "After first heading"
220
- msgstr "Na de eerste kop"
221
-
222
- #: includes/class.options.php:186
223
- msgid "Top"
224
- msgstr "Bovenaan"
225
-
226
- #: includes/class.options.php:187
227
- msgid "Bottom"
228
- msgstr "Onderaan"
229
-
230
- #: includes/class.options.php:194
231
- msgid "Show when"
232
- msgstr "Tonen wanneer"
233
-
234
- #: includes/class.options.php:195
235
- msgid "or more headings are present"
236
- msgstr "of als meerdere koppen aanwezig zijn"
237
-
238
- #: includes/class.options.php:202
239
- msgid "Display Header Label"
240
- msgstr "Koplabel tonen"
241
-
242
- #: includes/class.options.php:203
243
- msgid "Show header text above the table of contents."
244
- msgstr "Toon een koptekst boven de inhoudsopgave."
245
-
246
- #: includes/class.options.php:209
247
- msgid "Header Label"
248
- msgstr "Koplabel"
249
-
250
- #: includes/class.options.php:210
251
- msgid "Eg: Contents, Table of Contents, Page Contents"
252
- msgstr "Bv. Inhoud, Inhoudsopgave, Op deze pagina"
253
-
254
- #: includes/class.options.php:212
255
- msgid "Contents"
256
- msgstr "Inhoud"
257
-
258
- #: includes/class.options.php:216
259
- msgid "Toggle View"
260
- msgstr "Zichtbaarheid wijzigen"
261
-
262
- #: includes/class.options.php:217
263
- msgid "Allow the user to toggle the visibility of the table of contents."
264
- msgstr ""
265
- "Sta de gebruiker toe de zichtbaarheid van de inhoudsopgave te wijzigen."
266
-
267
- #: includes/class.options.php:237
268
- msgid "Initial View"
269
- msgstr "Initiële zichtbaarheid"
270
-
271
- #: includes/class.options.php:238
272
- msgid "Initially hide the table of contents."
273
- msgstr "Verberg initieel de inhoudsopgave."
274
-
275
- #: includes/class.options.php:244
276
- msgid "Show as Hierarchy"
277
- msgstr "Toon als Hiërarchie"
278
-
279
- #: includes/class.options.php:251
280
- msgid "Counter"
281
- msgstr "Teller"
282
-
283
- #: includes/class.options.php:255
284
- msgid "Decimal (default)"
285
- msgstr "Decimaal (standaard)"
286
-
287
- #: includes/class.options.php:256
288
- msgid "Numeric"
289
- msgstr "Numeriek"
290
-
291
- #: includes/class.options.php:257
292
- msgid "Roman"
293
- msgstr "Romeins"
294
-
295
- #: includes/class.options.php:258
296
- msgid "None"
297
- msgstr "Geen"
298
-
299
- #: includes/class.options.php:264
300
- msgid "Smooth Scroll"
301
- msgstr "Vloeiend scrollen"
302
-
303
- #: includes/class.options.php:276
304
- msgid "Width"
305
- msgstr "Breedte"
306
-
307
- #: includes/class.options.php:281
308
- msgid "Fixed"
309
- msgstr "Vast"
310
-
311
- #: includes/class.options.php:295
312
- msgid "Relative"
313
- msgstr "Relatief"
314
-
315
- #: includes/class.options.php:307 includes/class.options.php:352
316
- msgid "Custom"
317
- msgstr "Aangepast"
318
-
319
- #: includes/class.options.php:309
320
- msgid "User Defined"
321
- msgstr "Gebruikersgedefinieerd"
322
-
323
- #: includes/class.options.php:317
324
- msgid "Custom Width"
325
- msgstr "Aangepaste breedte"
326
-
327
- #: includes/class.options.php:318
328
- msgid ""
329
- "Select the User Defined option from the Width option to utilitze the custom "
330
- "width."
331
- msgstr ""
332
- "Selecteer de optie Gebruikersgedefinieerd bij de optie Breedte om de "
333
- "aangepaste breedte te gebruiken."
334
-
335
- #: includes/class.options.php:324
336
- msgid "Float"
337
- msgstr "Zwevend"
338
-
339
- #: includes/class.options.php:328
340
- msgid "None (Default)"
341
- msgstr "Geen (standaard)"
342
-
343
- #: includes/class.options.php:329
344
- msgid "Left"
345
- msgstr "Links"
346
-
347
- #: includes/class.options.php:330
348
- msgid "Right"
349
- msgstr "Rechts"
350
-
351
- #: includes/class.options.php:336
352
- msgid "Font Size"
353
- msgstr "Lettergrootte"
354
-
355
- #: includes/class.options.php:343
356
- msgid "Theme"
357
- msgstr "Thema"
358
-
359
- #: includes/class.options.php:344
360
- msgid ""
361
- "The theme is only applied to the table of contents which is auto inserted "
362
- "into the post. The Table of Contents widget will inherit the theme widget "
363
- "styles."
364
- msgstr ""
365
- "Het thema wordt enkel gebruikt bij de inhoudsopgaves die automatisch "
366
- "ingevoegd worden. De widgets met een inhoudsopgave zullen de stijl van het "
367
- "thema overerven."
368
-
369
- #: includes/class.options.php:347
370
- msgid "Grey"
371
- msgstr "Grijs"
372
-
373
- #: includes/class.options.php:348
374
- msgid "Light Blue"
375
- msgstr "Lichtblauw"
376
-
377
- #: includes/class.options.php:349
378
- msgid "White"
379
- msgstr "Wit"
380
-
381
- #: includes/class.options.php:350
382
- msgid "Black"
383
- msgstr "Zwart"
384
-
385
- #: includes/class.options.php:351
386
- msgid "Transparent"
387
- msgstr "Doorzichtig"
388
-
389
- #: includes/class.options.php:358
390
- msgid "Custom Theme"
391
- msgstr "Aangepast thema"
392
-
393
- #: includes/class.options.php:359
394
- msgid "For the following settings to apply, select the Custom Theme option."
395
- msgstr "Selecteer de optie Aangepast thema om volgende opties toe te passen."
396
-
397
- #: includes/class.options.php:364
398
- msgid "Background Color"
399
- msgstr "Kleur achtergrond"
400
-
401
- #: includes/class.options.php:371
402
- msgid "Border Color"
403
- msgstr "Kleur rand"
404
-
405
- #: includes/class.options.php:378
406
- msgid "Title Color"
407
- msgstr "Kleur titel"
408
-
409
- #: includes/class.options.php:385
410
- msgid "Link Color"
411
- msgstr "Kleur snelkoppeling"
412
-
413
- #: includes/class.options.php:392
414
- msgid "Link Hover Color"
415
- msgstr "Kleur snelkoppeling bij hover"
416
-
417
- #: includes/class.options.php:399
418
- msgid "Link Visited Color"
419
- msgstr "Kleur bezochte snelkoppeling"
420
-
421
- #: includes/class.options.php:411
422
- msgid "Lowercase"
423
- msgstr "Kleine letters"
424
-
425
- #: includes/class.options.php:412
426
- msgid "Ensure anchors are in lowercase."
427
- msgstr "Zorg ervoor dat de ankers in kleine letters zijn."
428
-
429
- #: includes/class.options.php:418
430
- msgid "Hyphenate"
431
- msgstr "Met streepjes"
432
-
433
- #: includes/class.options.php:419
434
- msgid "Use - rather than _ in anchors."
435
- msgstr "Gebruik - in plaats van _ in ankers."
436
-
437
- #: includes/class.options.php:425
438
- msgid "Homepage"
439
- msgstr "Startpagina"
440
-
441
- #: includes/class.options.php:426
442
- msgid "Show the table of contents for qualifying items on the homepage."
443
- msgstr ""
444
- "Toon de inhoudsopgave op de startpagina voor in aanmerking komende items."
445
-
446
- #: includes/class.options.php:432
447
- msgid "CSS"
448
- msgstr "CSS"
449
-
450
- #: includes/class.options.php:433
451
- msgid ""
452
- "Prevent the loading the core CSS styles. When selected, the appearance "
453
- "options from above will be ignored."
454
- msgstr ""
455
- "De basis CSS niet laden. Als dit geselecteerd is, zullen de opties hierboven "
456
- "genegeerd worden."
457
-
458
- #: includes/class.options.php:481
459
- msgid "Smooth Scroll Offset"
460
- msgstr "Offset voor vloeiend schuiven"
461
-
462
- #: includes/class.options.php:482
463
- msgid ""
464
- "If you have a consistent menu across the top of your site, you can adjust "
465
- "the top offset to stop the headings from appearing underneath the top menu. "
466
- "A setting of 30 accommodates the WordPress admin bar. This setting only has "
467
- "an effect after you have enabled Smooth Scroll option."
468
- msgstr ""
469
- "Als je een vaste menu hebt aan de bovenkant van je site, kan je de offset "
470
- "aanpassen om te vermijden dat de inhoudstafel onder de menu komt. 30 is een "
471
- "aanbevolen waarden om de WordPress-adminbar te compenseren. Deze optie werkt "
472
- "enkel als je de optie Vloeiend schuiven aan hebt staan."
473
-
474
- #: includes/class.options.php:489
475
- msgid "Limit Path"
476
- msgstr "Pad beperken"
477
-
478
- #: includes/class.options.php:490
479
- msgid ""
480
- "Restrict generation of the table of contents to pages that match the "
481
- "required path. This path is from the root of your site and always begins "
482
- "with a forward slash."
483
- msgstr ""
484
- "Beperk de generatie van de inhoudsopgave tot pagina's waarvoor het pad "
485
- "overeenkomt met het vereiste pad. Dit pad is vanaf de wortel van je site en "
486
- "begint met een voorwaartse schuine streep."
487
-
488
- #: includes/class.options.php:491
489
- msgid "Eg: /wiki/, /corporate/annual-reports/"
490
- msgstr "Bv /wiki/, /bedrijf/rapporten/"
491
-
492
- #: includes/class.options.php:496
493
- msgid "Default Anchor Prefix"
494
- msgstr "Standaard ankervoorvoegsel"
495
-
496
- #: includes/class.options.php:497
497
- msgid ""
498
- "Anchor targets are restricted to alphanumeric characters as per HTML "
499
- "specification (see readme for more detail). The default anchor prefix will "
500
- "be used when no characters qualify. When left blank, a number will be used "
501
- "instead."
502
- msgstr ""
503
- "Ankers bestaan enkel uit alpanumerieke waarden, zoals de HTML-standaard "
504
- "vereist (zie readme voor meer details). Dit is het standaardanker als geen "
505
- "enkel ander teken in aanmerking komt. Indien leeg zal een getal gebruikt "
506
- "worden."
507
-
508
- #: includes/class.options.php:498
509
- msgid ""
510
- "This option normally applies to content written in character sets other than "
511
- "ASCII."
512
- msgstr ""
513
- "Deze optie is normaal enkel nodig voor inhoud die niet in ASCII geschreven "
514
- "is."
515
-
516
- #: includes/class.options.php:499
517
- msgid "Eg: i, toc_index, index, _"
518
- msgstr "Bv. i, toc, index, _"
519
-
520
- #: includes/class.options.php:505
521
- msgid "Widget Affix Selector"
522
- msgstr "Widget affix selector"
523
-
524
- #: includes/class.options.php:506
525
- msgid ""
526
- "To enable the option to affix or pin the Table of Contents widget enter the "
527
- "theme's sidebar class or id."
528
- msgstr ""
529
- "Om de optie om de widget met de inhoudsopgave vast te zetten moet je het id "
530
- "of de klasse van de zijbalk van het thema opgeven."
531
-
532
- #: includes/class.options.php:507
533
- msgid ""
534
- "Since every theme is different, this can not be determined automatically. If "
535
- "you are unsure how to find the sidebar's class or id, please ask the theme's "
536
- "support persons."
537
- msgstr ""
538
- "Omdat elk thema anders is, kan dit niet vanzelf gebeuren. Als je niet goed "
539
- "weet wat je hier moet doen, is het best contact op te nemen met de auteur "
540
- "van het thema."
541
-
542
- #: includes/class.options.php:508
543
- msgid "Eg: .widget-area or #sidebar"
544
- msgstr "Bv .widget-area of #sidebar"
545
-
546
- #: includes/class.options.php:756
547
- #, php-format
548
- msgid ""
549
- "The callback function used for the <strong>%s</strong> setting is missing."
550
- msgstr ""
551
- "Deze callback-functie is gebruikt omdat de optie <strong>%s</strong> "
552
- "ontbreekt."
553
-
554
- #: includes/class.widget-toc.php:22
555
- msgid "Display the table of contents."
556
- msgstr "Toon de inhoudsopgave."
557
-
558
- #: includes/class.widget-toc.php:310
559
- msgid "Title"
560
- msgstr "Titel"
561
-
562
- #: includes/class.widget-toc.php:317
563
- msgid "Active Section Highlight Color:"
564
- msgstr "Kleur actieve selectie:"
565
-
566
- #: includes/class.widget-toc.php:325
567
- msgid "Affix or pin the widget."
568
- msgstr "Affix of zet de widget vast."
569
-
570
- #: includes/class.widget-toc.php:329
571
- msgid ""
572
- "If you choose to affix the widget, do not add any other widgets on the "
573
- "sidebar. Also, make sure you have only one instance Table of Contents widget "
574
- "on the page."
575
- msgstr ""
576
- "Als je ervoor kiest de widget vast te zetten, mag je geen andere widgets aan "
577
- "de zijbalk toevoegen. Zorg er ook voor dat er slechts één widget met "
578
- "inhoudsopgave op de pagina te zien is."
579
-
580
- #: includes/inc.admin-options-page.php:9
581
- msgid "General"
582
- msgstr "Algemeen"
583
-
584
- #: includes/inc.admin-options-page.php:27
585
- msgid "Appearance"
586
- msgstr "Weergave"
587
-
588
- #: includes/inc.admin-options-page.php:45
589
- msgid "Advanced"
590
- msgstr "Geavanceerd"
591
-
592
- #: includes/inc.admin-options-page.php:61
593
- msgid "Save Changes"
594
- msgstr "Wijzigingen opslaan"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Eazy TOC\n"
4
+ "POT-Creation-Date: 2018-01-24 15:51+0000\n"
5
+ "PO-Revision-Date: 2018-01-24 15:51+0000\n"
6
+ "Last-Translator: Steven - Profile <shazahm1@hotmail.com>\n"
7
+ "Language-Team: Dutch\n"
8
+ "Language: nl-NL\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Loco - https://localise.biz/\n"
13
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n_noop:1,2;_x:1,2c;_nx:4c,1,2;"
14
+ "_nx_noop:4c,1,2;_ex:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;"
15
+ "esc_html_e;esc_html_x:1,2c\n"
16
+ "X-Poedit-Basepath: ..\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "Plural-Forms: nplurals=2; plural=n != 1\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+ "Report-Msgid-Bugs-To: "
21
+
22
+ #. Plugin Name of the plugin/theme
23
+ msgid "Easy Table of Contents"
24
+ msgstr ""
25
+
26
+ #. Plugin URI of the plugin/theme
27
+ #. Author URI of the plugin/theme
28
+ msgid "http://connections-pro.com/"
29
+ msgstr ""
30
+
31
+ #. Description of the plugin/theme
32
+ msgid ""
33
+ "Adds a user friendly and fully automatic way to create and display a table "
34
+ "of contents generated from the page content."
35
+ msgstr ""
36
+
37
+ #. Author of the plugin/theme
38
+ msgid "Steven A. Zahm"
39
+ msgstr ""
40
+
41
+ #: includes/class.admin.php:60
42
+ msgid "Settings"
43
+ msgstr "Instellingen"
44
+
45
+ #: includes/class.admin.php:92 includes/class.admin.php:93
46
+ #: includes/class.admin.php:145 includes/class.widget-toc.php:27
47
+ #: includes/inc.admin-options-page.php:2
48
+ msgid "Table of Contents"
49
+ msgstr "Inhoudsopgave"
50
+
51
+ #: includes/class.admin.php:188
52
+ msgid "Disable the automatic insertion of the table of contents."
53
+ msgstr "Automatisch invoegen van de inhoudsopgave uitschakelen."
54
+
55
+ #: includes/class.admin.php:199
56
+ msgid "Insert table of contents."
57
+ msgstr "Inhoudsopgave invoegen."
58
+
59
+ #: includes/class.admin.php:211
60
+ msgid "Advanced:"
61
+ msgstr "Geavanceerd:"
62
+
63
+ #: includes/class.admin.php:218
64
+ msgid "NOTE:"
65
+ msgstr "Let op:"
66
+
67
+ #: includes/class.admin.php:220
68
+ msgid ""
69
+ "Using the advanced options below will override the global advanced settings."
70
+ msgstr ""
71
+ "Het gebruik van de geavanceerde opties zal de standaard instellingen "
72
+ "overschrijven."
73
+
74
+ #: includes/class.admin.php:229 includes/class.options.php:446
75
+ msgid "Headings:"
76
+ msgstr "Koppen:"
77
+
78
+ #: includes/class.admin.php:235 includes/class.options.php:447
79
+ msgid ""
80
+ "Select the heading to consider when generating the table of contents. "
81
+ "Deselecting a heading will exclude it."
82
+ msgstr ""
83
+ "Selecteer de koppen die gebruikt moeten worden om de inhoudsopgave te "
84
+ "genereren. Een kop niet selecteren zal hem uitsluiten."
85
+
86
+ #: includes/class.admin.php:237 includes/class.options.php:450
87
+ msgid "Heading 1 (h1)"
88
+ msgstr "Kop 1 (h1)"
89
+
90
+ #: includes/class.admin.php:238 includes/class.options.php:451
91
+ msgid "Heading 2 (h2)"
92
+ msgstr "Kop 2 (h2)"
93
+
94
+ #: includes/class.admin.php:239 includes/class.options.php:452
95
+ msgid "Heading 3 (h3)"
96
+ msgstr "Kop 3 (h3)"
97
+
98
+ #: includes/class.admin.php:240 includes/class.options.php:453
99
+ msgid "Heading 4 (h4)"
100
+ msgstr "Kop 4 (h4)"
101
+
102
+ #: includes/class.admin.php:241 includes/class.options.php:454
103
+ msgid "Heading 5 (h5)"
104
+ msgstr "Kop 5 (h5)"
105
+
106
+ #: includes/class.admin.php:242 includes/class.options.php:455
107
+ msgid "Heading 6 (h6)"
108
+ msgstr "Kop 6 (h6)"
109
+
110
+ #: includes/class.admin.php:252
111
+ msgid "Alternate Headings"
112
+ msgstr "Alternatieve Koppen"
113
+
114
+ #: includes/class.admin.php:258
115
+ msgid ""
116
+ "Specify alternate table of contents header string. Add the header to be "
117
+ "replaced and the alternate header on a single line separated with a pipe "
118
+ "<code>|</code>. Put each additional original and alternate header on its own "
119
+ "line."
120
+ msgstr ""
121
+ "Specificeer de alternatieve tekst voor de koppen. Iedere kop (titel) die "
122
+ "vervangen moet worden plaats je op één regel gescheiden met een <code>"
123
+ "|</code> en dan de alternatieve tekst. Plaats daarna de volgende op een "
124
+ "nieuwe regel, etc."
125
+
126
+ #: includes/class.admin.php:275 includes/class.admin.php:309
127
+ #: includes/class.options.php:470
128
+ msgid "Examples:"
129
+ msgstr "Voorbeelden:"
130
+
131
+ #: includes/class.admin.php:277
132
+ msgid ""
133
+ "<code>Level [1.1]|Alternate TOC Header</code> Replaces Level [1.1] in the "
134
+ "table of contents with Alternate TOC Header."
135
+ msgstr ""
136
+ "<code>Niveau [1.1]|Alternatieve TOC Kop</code> Vervangt Niveau [1.1] in de "
137
+ "inhoudsopgave met de Alternatieve TOC Kop."
138
+
139
+ #: includes/class.admin.php:279
140
+ msgid "<strong>Note:</strong> This is case sensitive."
141
+ msgstr "<strong>Opmerking:</strong> Dit is hoofdlettergevoelig."
142
+
143
+ #: includes/class.admin.php:286 includes/class.options.php:461
144
+ msgid "Exclude Headings"
145
+ msgstr "Koppen uitsluiten"
146
+
147
+ #: includes/class.admin.php:292 includes/class.options.php:462
148
+ msgid ""
149
+ "Specify headings to be excluded from appearing in the table of contents. "
150
+ "Separate multiple headings with a pipe <code>|</code>. Use an asterisk <code>"
151
+ "*</code> as a wildcard to match other text."
152
+ msgstr ""
153
+ "Specifieer welke koppen uit te sluiten uit de inhoudsopgave. Zet een "
154
+ "sluisteken <code>|</code> tussen verschillende koppen en gebruik een "
155
+ "asterisk <code>*</code> als een carte blanche om andere tekst te vinden."
156
+
157
+ #: includes/class.admin.php:311 includes/class.options.php:472
158
+ msgid "<code>Fruit*</code> Ignore headings starting with \"Fruit\"."
159
+ msgstr "<code>Fruit*</code> Negeer koppen startende met \"Fruit\"."
160
+
161
+ #: includes/class.admin.php:312 includes/class.options.php:473
162
+ msgid ""
163
+ "<code>*Fruit Diet*</code> Ignore headings with \"Fruit Diet\" somewhere in "
164
+ "the heading."
165
+ msgstr "<code>*Fruitdieet*</code> Negeer koppen die \"Fruitdieet\" bevatten."
166
+
167
+ #: includes/class.admin.php:313 includes/class.options.php:474
168
+ msgid ""
169
+ "<code>Apple Tree|Oranges|Yellow Bananas</code> Ignore headings that are "
170
+ "exactly \"Apple Tree\", \"Oranges\" or \"Yellow Bananas\"."
171
+ msgstr ""
172
+ "<code>De appelboom|Appelsienen|Gele bananen</code> Negeer koppen die exact "
173
+ "overeenkomen met \"De appelboom\", \"Appelsienen\" or \"Gele bananen\"."
174
+
175
+ #: includes/class.admin.php:315 includes/class.options.php:476
176
+ msgid "<strong>Note:</strong> This is not case sensitive."
177
+ msgstr "<strong>Opmerking:</strong> Dit is niet hoofdlettergevoelig."
178
+
179
+ #: includes/class.options.php:163
180
+ msgid "Enable Support"
181
+ msgstr "Ondersteuning inschakelen"
182
+
183
+ #: includes/class.options.php:164
184
+ msgid "Select the post types to enable the support for table of contents."
185
+ msgstr "Selecteer de berichttypes met ondersteuning voor inhoudsopgaves."
186
+
187
+ #: includes/class.options.php:171
188
+ msgid "Auto Insert"
189
+ msgstr "Automatisch invoegen"
190
+
191
+ #: includes/class.options.php:172
192
+ msgid ""
193
+ "Select the post types which will have the table of contents automatically "
194
+ "inserted."
195
+ msgstr ""
196
+ "Selecteer de berichttypes die de inhoudsopgave automatisch ingevoegd krijgen."
197
+
198
+ #: includes/class.options.php:173
199
+ msgid ""
200
+ "NOTE: The table of contents will only be automatically inserted on post "
201
+ "types for which it has been enabled."
202
+ msgstr ""
203
+ "OPMERKING: de inhoudsopgave zal enkel automatisch ingevoegd worden voor "
204
+ "berichttypes waarvoor ondersteuning ingeschakeld is."
205
+
206
+ #: includes/class.options.php:180
207
+ msgid "Position"
208
+ msgstr "Positie"
209
+
210
+ #: includes/class.options.php:181
211
+ msgid "Choose where where you want to display the table of contents."
212
+ msgstr "Kies waar de inhoudsopgave moet komen."
213
+
214
+ #: includes/class.options.php:184
215
+ msgid "Before first heading (default)"
216
+ msgstr "Voor de eerste kop (standaard)"
217
+
218
+ #: includes/class.options.php:185
219
+ msgid "After first heading"
220
+ msgstr "Na de eerste kop"
221
+
222
+ #: includes/class.options.php:186
223
+ msgid "Top"
224
+ msgstr "Bovenaan"
225
+
226
+ #: includes/class.options.php:187
227
+ msgid "Bottom"
228
+ msgstr "Onderaan"
229
+
230
+ #: includes/class.options.php:194
231
+ msgid "Show when"
232
+ msgstr "Tonen wanneer"
233
+
234
+ #: includes/class.options.php:195
235
+ msgid "or more headings are present"
236
+ msgstr "of als meerdere koppen aanwezig zijn"
237
+
238
+ #: includes/class.options.php:202
239
+ msgid "Display Header Label"
240
+ msgstr "Koplabel tonen"
241
+
242
+ #: includes/class.options.php:203
243
+ msgid "Show header text above the table of contents."
244
+ msgstr "Toon een koptekst boven de inhoudsopgave."
245
+
246
+ #: includes/class.options.php:209
247
+ msgid "Header Label"
248
+ msgstr "Koplabel"
249
+
250
+ #: includes/class.options.php:210
251
+ msgid "Eg: Contents, Table of Contents, Page Contents"
252
+ msgstr "Bv. Inhoud, Inhoudsopgave, Op deze pagina"
253
+
254
+ #: includes/class.options.php:212
255
+ msgid "Contents"
256
+ msgstr "Inhoud"
257
+
258
+ #: includes/class.options.php:216
259
+ msgid "Toggle View"
260
+ msgstr "Zichtbaarheid wijzigen"
261
+
262
+ #: includes/class.options.php:217
263
+ msgid "Allow the user to toggle the visibility of the table of contents."
264
+ msgstr ""
265
+ "Sta de gebruiker toe de zichtbaarheid van de inhoudsopgave te wijzigen."
266
+
267
+ #: includes/class.options.php:237
268
+ msgid "Initial View"
269
+ msgstr "Initiële zichtbaarheid"
270
+
271
+ #: includes/class.options.php:238
272
+ msgid "Initially hide the table of contents."
273
+ msgstr "Verberg initieel de inhoudsopgave."
274
+
275
+ #: includes/class.options.php:244
276
+ msgid "Show as Hierarchy"
277
+ msgstr "Toon als Hiërarchie"
278
+
279
+ #: includes/class.options.php:251
280
+ msgid "Counter"
281
+ msgstr "Teller"
282
+
283
+ #: includes/class.options.php:255
284
+ msgid "Decimal (default)"
285
+ msgstr "Decimaal (standaard)"
286
+
287
+ #: includes/class.options.php:256
288
+ msgid "Numeric"
289
+ msgstr "Numeriek"
290
+
291
+ #: includes/class.options.php:257
292
+ msgid "Roman"
293
+ msgstr "Romeins"
294
+
295
+ #: includes/class.options.php:258
296
+ msgid "None"
297
+ msgstr "Geen"
298
+
299
+ #: includes/class.options.php:264
300
+ msgid "Smooth Scroll"
301
+ msgstr "Vloeiend scrollen"
302
+
303
+ #: includes/class.options.php:276
304
+ msgid "Width"
305
+ msgstr "Breedte"
306
+
307
+ #: includes/class.options.php:281
308
+ msgid "Fixed"
309
+ msgstr "Vast"
310
+
311
+ #: includes/class.options.php:295
312
+ msgid "Relative"
313
+ msgstr "Relatief"
314
+
315
+ #: includes/class.options.php:307 includes/class.options.php:352
316
+ msgid "Custom"
317
+ msgstr "Aangepast"
318
+
319
+ #: includes/class.options.php:309
320
+ msgid "User Defined"
321
+ msgstr "Gebruikersgedefinieerd"
322
+
323
+ #: includes/class.options.php:317
324
+ msgid "Custom Width"
325
+ msgstr "Aangepaste breedte"
326
+
327
+ #: includes/class.options.php:318
328
+ msgid ""
329
+ "Select the User Defined option from the Width option to utilitze the custom "
330
+ "width."
331
+ msgstr ""
332
+ "Selecteer de optie Gebruikersgedefinieerd bij de optie Breedte om de "
333
+ "aangepaste breedte te gebruiken."
334
+
335
+ #: includes/class.options.php:324
336
+ msgid "Float"
337
+ msgstr "Zwevend"
338
+
339
+ #: includes/class.options.php:328
340
+ msgid "None (Default)"
341
+ msgstr "Geen (standaard)"
342
+
343
+ #: includes/class.options.php:329
344
+ msgid "Left"
345
+ msgstr "Links"
346
+
347
+ #: includes/class.options.php:330
348
+ msgid "Right"
349
+ msgstr "Rechts"
350
+
351
+ #: includes/class.options.php:336
352
+ msgid "Font Size"
353
+ msgstr "Lettergrootte"
354
+
355
+ #: includes/class.options.php:343
356
+ msgid "Theme"
357
+ msgstr "Thema"
358
+
359
+ #: includes/class.options.php:344
360
+ msgid ""
361
+ "The theme is only applied to the table of contents which is auto inserted "
362
+ "into the post. The Table of Contents widget will inherit the theme widget "
363
+ "styles."
364
+ msgstr ""
365
+ "Het thema wordt enkel gebruikt bij de inhoudsopgaves die automatisch "
366
+ "ingevoegd worden. De widgets met een inhoudsopgave zullen de stijl van het "
367
+ "thema overerven."
368
+
369
+ #: includes/class.options.php:347
370
+ msgid "Grey"
371
+ msgstr "Grijs"
372
+
373
+ #: includes/class.options.php:348
374
+ msgid "Light Blue"
375
+ msgstr "Lichtblauw"
376
+
377
+ #: includes/class.options.php:349
378
+ msgid "White"
379
+ msgstr "Wit"
380
+
381
+ #: includes/class.options.php:350
382
+ msgid "Black"
383
+ msgstr "Zwart"
384
+
385
+ #: includes/class.options.php:351
386
+ msgid "Transparent"
387
+ msgstr "Doorzichtig"
388
+
389
+ #: includes/class.options.php:358
390
+ msgid "Custom Theme"
391
+ msgstr "Aangepast thema"
392
+
393
+ #: includes/class.options.php:359
394
+ msgid "For the following settings to apply, select the Custom Theme option."
395
+ msgstr "Selecteer de optie Aangepast thema om volgende opties toe te passen."
396
+
397
+ #: includes/class.options.php:364
398
+ msgid "Background Color"
399
+ msgstr "Kleur achtergrond"
400
+
401
+ #: includes/class.options.php:371
402
+ msgid "Border Color"
403
+ msgstr "Kleur rand"
404
+
405
+ #: includes/class.options.php:378
406
+ msgid "Title Color"
407
+ msgstr "Kleur titel"
408
+
409
+ #: includes/class.options.php:385
410
+ msgid "Link Color"
411
+ msgstr "Kleur snelkoppeling"
412
+
413
+ #: includes/class.options.php:392
414
+ msgid "Link Hover Color"
415
+ msgstr "Kleur snelkoppeling bij hover"
416
+
417
+ #: includes/class.options.php:399
418
+ msgid "Link Visited Color"
419
+ msgstr "Kleur bezochte snelkoppeling"
420
+
421
+ #: includes/class.options.php:411
422
+ msgid "Lowercase"
423
+ msgstr "Kleine letters"
424
+
425
+ #: includes/class.options.php:412
426
+ msgid "Ensure anchors are in lowercase."
427
+ msgstr "Zorg ervoor dat de ankers in kleine letters zijn."
428
+
429
+ #: includes/class.options.php:418
430
+ msgid "Hyphenate"
431
+ msgstr "Met streepjes"
432
+
433
+ #: includes/class.options.php:419
434
+ msgid "Use - rather than _ in anchors."
435
+ msgstr "Gebruik - in plaats van _ in ankers."
436
+
437
+ #: includes/class.options.php:425
438
+ msgid "Homepage"
439
+ msgstr "Startpagina"
440
+
441
+ #: includes/class.options.php:426
442
+ msgid "Show the table of contents for qualifying items on the homepage."
443
+ msgstr ""
444
+ "Toon de inhoudsopgave op de startpagina voor in aanmerking komende items."
445
+
446
+ #: includes/class.options.php:432
447
+ msgid "CSS"
448
+ msgstr "CSS"
449
+
450
+ #: includes/class.options.php:433
451
+ msgid ""
452
+ "Prevent the loading the core CSS styles. When selected, the appearance "
453
+ "options from above will be ignored."
454
+ msgstr ""
455
+ "De basis CSS niet laden. Als dit geselecteerd is, zullen de opties hierboven "
456
+ "genegeerd worden."
457
+
458
+ #: includes/class.options.php:481
459
+ msgid "Smooth Scroll Offset"
460
+ msgstr "Offset voor vloeiend schuiven"
461
+
462
+ #: includes/class.options.php:482
463
+ msgid ""
464
+ "If you have a consistent menu across the top of your site, you can adjust "
465
+ "the top offset to stop the headings from appearing underneath the top menu. "
466
+ "A setting of 30 accommodates the WordPress admin bar. This setting only has "
467
+ "an effect after you have enabled Smooth Scroll option."
468
+ msgstr ""
469
+ "Als je een vaste menu hebt aan de bovenkant van je site, kan je de offset "
470
+ "aanpassen om te vermijden dat de inhoudstafel onder de menu komt. 30 is een "
471
+ "aanbevolen waarden om de WordPress-adminbar te compenseren. Deze optie werkt "
472
+ "enkel als je de optie Vloeiend schuiven aan hebt staan."
473
+
474
+ #: includes/class.options.php:489
475
+ msgid "Limit Path"
476
+ msgstr "Pad beperken"
477
+
478
+ #: includes/class.options.php:490
479
+ msgid ""
480
+ "Restrict generation of the table of contents to pages that match the "
481
+ "required path. This path is from the root of your site and always begins "
482
+ "with a forward slash."
483
+ msgstr ""
484
+ "Beperk de generatie van de inhoudsopgave tot pagina's waarvoor het pad "
485
+ "overeenkomt met het vereiste pad. Dit pad is vanaf de wortel van je site en "
486
+ "begint met een voorwaartse schuine streep."
487
+
488
+ #: includes/class.options.php:491
489
+ msgid "Eg: /wiki/, /corporate/annual-reports/"
490
+ msgstr "Bv /wiki/, /bedrijf/rapporten/"
491
+
492
+ #: includes/class.options.php:496
493
+ msgid "Default Anchor Prefix"
494
+ msgstr "Standaard ankervoorvoegsel"
495
+
496
+ #: includes/class.options.php:497
497
+ msgid ""
498
+ "Anchor targets are restricted to alphanumeric characters as per HTML "
499
+ "specification (see readme for more detail). The default anchor prefix will "
500
+ "be used when no characters qualify. When left blank, a number will be used "
501
+ "instead."
502
+ msgstr ""
503
+ "Ankers bestaan enkel uit alpanumerieke waarden, zoals de HTML-standaard "
504
+ "vereist (zie readme voor meer details). Dit is het standaardanker als geen "
505
+ "enkel ander teken in aanmerking komt. Indien leeg zal een getal gebruikt "
506
+ "worden."
507
+
508
+ #: includes/class.options.php:498
509
+ msgid ""
510
+ "This option normally applies to content written in character sets other than "
511
+ "ASCII."
512
+ msgstr ""
513
+ "Deze optie is normaal enkel nodig voor inhoud die niet in ASCII geschreven "
514
+ "is."
515
+
516
+ #: includes/class.options.php:499
517
+ msgid "Eg: i, toc_index, index, _"
518
+ msgstr "Bv. i, toc, index, _"
519
+
520
+ #: includes/class.options.php:505
521
+ msgid "Widget Affix Selector"
522
+ msgstr "Widget affix selector"
523
+
524
+ #: includes/class.options.php:506
525
+ msgid ""
526
+ "To enable the option to affix or pin the Table of Contents widget enter the "
527
+ "theme's sidebar class or id."
528
+ msgstr ""
529
+ "Om de optie om de widget met de inhoudsopgave vast te zetten moet je het id "
530
+ "of de klasse van de zijbalk van het thema opgeven."
531
+
532
+ #: includes/class.options.php:507
533
+ msgid ""
534
+ "Since every theme is different, this can not be determined automatically. If "
535
+ "you are unsure how to find the sidebar's class or id, please ask the theme's "
536
+ "support persons."
537
+ msgstr ""
538
+ "Omdat elk thema anders is, kan dit niet vanzelf gebeuren. Als je niet goed "
539
+ "weet wat je hier moet doen, is het best contact op te nemen met de auteur "
540
+ "van het thema."
541
+
542
+ #: includes/class.options.php:508
543
+ msgid "Eg: .widget-area or #sidebar"
544
+ msgstr "Bv .widget-area of #sidebar"
545
+
546
+ #: includes/class.options.php:756
547
+ #, php-format
548
+ msgid ""
549
+ "The callback function used for the <strong>%s</strong> setting is missing."
550
+ msgstr ""
551
+ "Deze callback-functie is gebruikt omdat de optie <strong>%s</strong> "
552
+ "ontbreekt."
553
+
554
+ #: includes/class.widget-toc.php:22
555
+ msgid "Display the table of contents."
556
+ msgstr "Toon de inhoudsopgave."
557
+
558
+ #: includes/class.widget-toc.php:310
559
+ msgid "Title"
560
+ msgstr "Titel"
561
+
562
+ #: includes/class.widget-toc.php:317
563
+ msgid "Active Section Highlight Color:"
564
+ msgstr "Kleur actieve selectie:"
565
+
566
+ #: includes/class.widget-toc.php:325
567
+ msgid "Affix or pin the widget."
568
+ msgstr "Affix of zet de widget vast."
569
+
570
+ #: includes/class.widget-toc.php:329
571
+ msgid ""
572
+ "If you choose to affix the widget, do not add any other widgets on the "
573
+ "sidebar. Also, make sure you have only one instance Table of Contents widget "
574
+ "on the page."
575
+ msgstr ""
576
+ "Als je ervoor kiest de widget vast te zetten, mag je geen andere widgets aan "
577
+ "de zijbalk toevoegen. Zorg er ook voor dat er slechts één widget met "
578
+ "inhoudsopgave op de pagina te zien is."
579
+
580
+ #: includes/inc.admin-options-page.php:9
581
+ msgid "General"
582
+ msgstr "Algemeen"
583
+
584
+ #: includes/inc.admin-options-page.php:27
585
+ msgid "Appearance"
586
+ msgstr "Weergave"
587
+
588
+ #: includes/inc.admin-options-page.php:45
589
+ msgid "Advanced"
590
+ msgstr "Geavanceerd"
591
+
592
+ #: includes/inc.admin-options-page.php:61
593
+ msgid "Save Changes"
594
+ msgstr "Wijzigingen opslaan"
595
+
596
+
597
+ #: Sticky Toggle Options
598
+ #: includes/inc.admin-options-page.php:286
599
+ msgid "Sticky Toggle Options"
600
+ msgstr "Sticky Toggle-opties"
601
+
602
+ msgid "On/Off"
603
+ msgstr "Aan uit"
604
+
605
+ msgid "Width"
606
+ msgstr "Breedte"
607
+
608
+ msgid "Auto"
609
+ msgstr "Auto"
610
+
611
+ msgid "Custom Width"
612
+ msgstr "Aangepaste breedte"
613
+
614
+ msgid "Enter sticky toggle custom width here.."
615
+ msgstr "Voer hier de sticky toggle aangepaste breedte in.."
616
+
617
+ msgid "Height"
618
+ msgstr "Hoogte"
619
+
620
+ msgid "Custom Height"
621
+ msgstr "Aangepaste hoogte"
622
+
623
+ msgid "Enter sticky toggle custom height here.."
624
+ msgstr "Voer hier de sticky toggle aangepaste hoogte in.."
625
+
626
+ msgid "Open Button Text"
627
+ msgstr "Knoptekst openen"
628
+
629
+ msgid "Enter sticky toggle open button text here.."
630
+ msgstr "Voer hier de sticky toggle open-knoptekst in.."
languages/easy-table-of-contents.pot CHANGED
@@ -1,545 +1,580 @@
1
- #, fuzzy
2
- msgid ""
3
- msgstr ""
4
- "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
- "Project-Id-Version: Easy Table of Contents\n"
6
- "POT-Creation-Date: 2018-01-24 10:35-0500\n"
7
- "PO-Revision-Date: 2015-11-09 09:47-0500\n"
8
- "Last-Translator: Steven A. Zahm <helpdesk@connections-pro.com>\n"
9
- "Language-Team: Steven A. Zahm <helpdesk@connections-pro.com>\n"
10
- "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=UTF-8\n"
12
- "Content-Transfer-Encoding: 8bit\n"
13
- "X-Generator: Poedit 2.0.4\n"
14
- "X-Poedit-Basepath: ..\n"
15
- "X-Poedit-WPHeader: easy-table-of-contents.php\n"
16
- "X-Poedit-SourceCharset: UTF-8\n"
17
- "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
- "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
19
- "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
- "X-Poedit-SearchPath-0: .\n"
21
- "X-Poedit-SearchPathExcluded-0: *.js\n"
22
-
23
- #: includes/class.admin.php:60
24
- msgid "Settings"
25
- msgstr ""
26
-
27
- #: includes/class.admin.php:92 includes/class.admin.php:93
28
- #: includes/class.admin.php:145 includes/class.widget-toc.php:27
29
- #: includes/inc.admin-options-page.php:2
30
- msgid "Table of Contents"
31
- msgstr ""
32
-
33
- #: includes/class.admin.php:188
34
- msgid "Disable the automatic insertion of the table of contents."
35
- msgstr ""
36
-
37
- #: includes/class.admin.php:199
38
- msgid "Insert table of contents."
39
- msgstr ""
40
-
41
- #: includes/class.admin.php:211
42
- msgid "Advanced:"
43
- msgstr ""
44
-
45
- #: includes/class.admin.php:218
46
- msgid "NOTE:"
47
- msgstr ""
48
-
49
- #: includes/class.admin.php:220
50
- msgid ""
51
- "Using the advanced options below will override the global advanced settings."
52
- msgstr ""
53
-
54
- #: includes/class.admin.php:229 includes/class.options.php:446
55
- msgid "Headings:"
56
- msgstr ""
57
-
58
- #: includes/class.admin.php:235 includes/class.options.php:447
59
- msgid ""
60
- "Select the heading to consider when generating the table of contents. "
61
- "Deselecting a heading will exclude it."
62
- msgstr ""
63
-
64
- #: includes/class.admin.php:237 includes/class.options.php:450
65
- msgid "Heading 1 (h1)"
66
- msgstr ""
67
-
68
- #: includes/class.admin.php:238 includes/class.options.php:451
69
- msgid "Heading 2 (h2)"
70
- msgstr ""
71
-
72
- #: includes/class.admin.php:239 includes/class.options.php:452
73
- msgid "Heading 3 (h3)"
74
- msgstr ""
75
-
76
- #: includes/class.admin.php:240 includes/class.options.php:453
77
- msgid "Heading 4 (h4)"
78
- msgstr ""
79
-
80
- #: includes/class.admin.php:241 includes/class.options.php:454
81
- msgid "Heading 5 (h5)"
82
- msgstr ""
83
-
84
- #: includes/class.admin.php:242 includes/class.options.php:455
85
- msgid "Heading 6 (h6)"
86
- msgstr ""
87
-
88
- #: includes/class.admin.php:252
89
- msgid "Alternate Headings"
90
- msgstr ""
91
-
92
- #: includes/class.admin.php:258
93
- msgid ""
94
- "Specify alternate table of contents header string. Add the header to be "
95
- "replaced and the alternate header on a single line separated with a pipe "
96
- "<code>|</code>. Put each additional original and alternate header on its own "
97
- "line."
98
- msgstr ""
99
-
100
- #: includes/class.admin.php:275 includes/class.admin.php:309
101
- #: includes/class.options.php:470
102
- msgid "Examples:"
103
- msgstr ""
104
-
105
- #: includes/class.admin.php:277
106
- msgid ""
107
- "<code>Level [1.1]|Alternate TOC Header</code> Replaces Level [1.1] in the "
108
- "table of contents with Alternate TOC Header."
109
- msgstr ""
110
-
111
- #: includes/class.admin.php:279
112
- msgid "<strong>Note:</strong> This is case sensitive."
113
- msgstr ""
114
-
115
- #: includes/class.admin.php:286 includes/class.options.php:461
116
- msgid "Exclude Headings"
117
- msgstr ""
118
-
119
- #: includes/class.admin.php:292 includes/class.options.php:462
120
- msgid ""
121
- "Specify headings to be excluded from appearing in the table of contents. "
122
- "Separate multiple headings with a pipe <code>|</code>. Use an asterisk "
123
- "<code>*</code> as a wildcard to match other text."
124
- msgstr ""
125
-
126
- #: includes/class.admin.php:311 includes/class.options.php:472
127
- msgid "<code>Fruit*</code> Ignore headings starting with \"Fruit\"."
128
- msgstr ""
129
-
130
- #: includes/class.admin.php:312 includes/class.options.php:473
131
- msgid ""
132
- "<code>*Fruit Diet*</code> Ignore headings with \"Fruit Diet\" somewhere in "
133
- "the heading."
134
- msgstr ""
135
-
136
- #: includes/class.admin.php:313 includes/class.options.php:474
137
- msgid ""
138
- "<code>Apple Tree|Oranges|Yellow Bananas</code> Ignore headings that are "
139
- "exactly \"Apple Tree\", \"Oranges\" or \"Yellow Bananas\"."
140
- msgstr ""
141
-
142
- #: includes/class.admin.php:315 includes/class.options.php:476
143
- msgid "<strong>Note:</strong> This is not case sensitive."
144
- msgstr ""
145
-
146
- #: includes/class.options.php:163
147
- msgid "Enable Support"
148
- msgstr ""
149
-
150
- #: includes/class.options.php:164
151
- msgid "Select the post types to enable the support for table of contents."
152
- msgstr ""
153
-
154
- #: includes/class.options.php:171
155
- msgid "Auto Insert"
156
- msgstr ""
157
-
158
- #: includes/class.options.php:172
159
- msgid ""
160
- "Select the post types which will have the table of contents automatically "
161
- "inserted."
162
- msgstr ""
163
-
164
- #: includes/class.options.php:173
165
- msgid ""
166
- "NOTE: The table of contents will only be automatically inserted on post "
167
- "types for which it has been enabled."
168
- msgstr ""
169
-
170
- #: includes/class.options.php:180
171
- msgid "Position"
172
- msgstr ""
173
-
174
- #: includes/class.options.php:181
175
- msgid "Choose where where you want to display the table of contents."
176
- msgstr ""
177
-
178
- #: includes/class.options.php:184
179
- msgid "Before first heading (default)"
180
- msgstr ""
181
-
182
- #: includes/class.options.php:185
183
- msgid "After first heading"
184
- msgstr ""
185
-
186
- #: includes/class.options.php:186
187
- msgid "Top"
188
- msgstr ""
189
-
190
- #: includes/class.options.php:187
191
- msgid "Bottom"
192
- msgstr ""
193
-
194
- #: includes/class.options.php:194
195
- msgid "Show when"
196
- msgstr ""
197
-
198
- #: includes/class.options.php:195
199
- msgid "or more headings are present"
200
- msgstr ""
201
-
202
- #: includes/class.options.php:202
203
- msgid "Display Header Label"
204
- msgstr ""
205
-
206
- #: includes/class.options.php:203
207
- msgid "Show header text above the table of contents."
208
- msgstr ""
209
-
210
- #: includes/class.options.php:209
211
- msgid "Header Label"
212
- msgstr ""
213
-
214
- #: includes/class.options.php:210
215
- msgid "Eg: Contents, Table of Contents, Page Contents"
216
- msgstr ""
217
-
218
- #: includes/class.options.php:212
219
- msgid "Contents"
220
- msgstr ""
221
-
222
- #: includes/class.options.php:216
223
- msgid "Toggle View"
224
- msgstr ""
225
-
226
- #: includes/class.options.php:217
227
- msgid "Allow the user to toggle the visibility of the table of contents."
228
- msgstr ""
229
-
230
- #: includes/class.options.php:237
231
- msgid "Initial View"
232
- msgstr ""
233
-
234
- #: includes/class.options.php:238
235
- msgid "Initially hide the table of contents."
236
- msgstr ""
237
-
238
- #: includes/class.options.php:244
239
- msgid "Show as Hierarchy"
240
- msgstr ""
241
-
242
- #: includes/class.options.php:251
243
- msgid "Counter"
244
- msgstr ""
245
-
246
- #: includes/class.options.php:255
247
- msgid "Decimal (default)"
248
- msgstr ""
249
-
250
- #: includes/class.options.php:256
251
- msgid "Numeric"
252
- msgstr ""
253
-
254
- #: includes/class.options.php:257
255
- msgid "Roman"
256
- msgstr ""
257
-
258
- #: includes/class.options.php:258
259
- msgid "None"
260
- msgstr ""
261
-
262
- #: includes/class.options.php:264
263
- msgid "Smooth Scroll"
264
- msgstr ""
265
-
266
- #: includes/class.options.php:276
267
- msgid "Width"
268
- msgstr ""
269
-
270
- #: includes/class.options.php:281
271
- msgid "Fixed"
272
- msgstr ""
273
-
274
- #: includes/class.options.php:295
275
- msgid "Relative"
276
- msgstr ""
277
-
278
- #: includes/class.options.php:307 includes/class.options.php:352
279
- msgid "Custom"
280
- msgstr ""
281
-
282
- #: includes/class.options.php:309
283
- msgid "User Defined"
284
- msgstr ""
285
-
286
- #: includes/class.options.php:317
287
- msgid "Custom Width"
288
- msgstr ""
289
-
290
- #: includes/class.options.php:318
291
- msgid ""
292
- "Select the User Defined option from the Width option to utilitze the custom "
293
- "width."
294
- msgstr ""
295
-
296
- #: includes/class.options.php:324
297
- msgid "Float"
298
- msgstr ""
299
-
300
- #: includes/class.options.php:328
301
- msgid "None (Default)"
302
- msgstr ""
303
-
304
- #: includes/class.options.php:329
305
- msgid "Left"
306
- msgstr ""
307
-
308
- #: includes/class.options.php:330
309
- msgid "Right"
310
- msgstr ""
311
-
312
- #: includes/class.options.php:336
313
- msgid "Font Size"
314
- msgstr ""
315
-
316
- #: includes/class.options.php:343
317
- msgid "Theme"
318
- msgstr ""
319
-
320
- #: includes/class.options.php:344
321
- msgid ""
322
- "The theme is only applied to the table of contents which is auto inserted "
323
- "into the post. The Table of Contents widget will inherit the theme widget "
324
- "styles."
325
- msgstr ""
326
-
327
- #: includes/class.options.php:347
328
- msgid "Grey"
329
- msgstr ""
330
-
331
- #: includes/class.options.php:348
332
- msgid "Light Blue"
333
- msgstr ""
334
-
335
- #: includes/class.options.php:349
336
- msgid "White"
337
- msgstr ""
338
-
339
- #: includes/class.options.php:350
340
- msgid "Black"
341
- msgstr ""
342
-
343
- #: includes/class.options.php:351
344
- msgid "Transparent"
345
- msgstr ""
346
-
347
- #: includes/class.options.php:358
348
- msgid "Custom Theme"
349
- msgstr ""
350
-
351
- #: includes/class.options.php:359
352
- msgid "For the following settings to apply, select the Custom Theme option."
353
- msgstr ""
354
-
355
- #: includes/class.options.php:364
356
- msgid "Background Color"
357
- msgstr ""
358
-
359
- #: includes/class.options.php:371
360
- msgid "Border Color"
361
- msgstr ""
362
-
363
- #: includes/class.options.php:378
364
- msgid "Title Color"
365
- msgstr ""
366
-
367
- #: includes/class.options.php:385
368
- msgid "Link Color"
369
- msgstr ""
370
-
371
- #: includes/class.options.php:392
372
- msgid "Link Hover Color"
373
- msgstr ""
374
-
375
- #: includes/class.options.php:399
376
- msgid "Link Visited Color"
377
- msgstr ""
378
-
379
- #: includes/class.options.php:411
380
- msgid "Lowercase"
381
- msgstr ""
382
-
383
- #: includes/class.options.php:412
384
- msgid "Ensure anchors are in lowercase."
385
- msgstr ""
386
-
387
- #: includes/class.options.php:418
388
- msgid "Hyphenate"
389
- msgstr ""
390
-
391
- #: includes/class.options.php:419
392
- msgid "Use - rather than _ in anchors."
393
- msgstr ""
394
-
395
- #: includes/class.options.php:425
396
- msgid "Homepage"
397
- msgstr ""
398
-
399
- #: includes/class.options.php:426
400
- msgid "Show the table of contents for qualifying items on the homepage."
401
- msgstr ""
402
-
403
- #: includes/class.options.php:432
404
- msgid "CSS"
405
- msgstr ""
406
-
407
- #: includes/class.options.php:433
408
- msgid ""
409
- "Prevent the loading the core CSS styles. When selected, the appearance "
410
- "options from above will be ignored."
411
- msgstr ""
412
-
413
- #: includes/class.options.php:481
414
- msgid "Smooth Scroll Offset"
415
- msgstr ""
416
-
417
- #: includes/class.options.php:482
418
- msgid ""
419
- "If you have a consistent menu across the top of your site, you can adjust "
420
- "the top offset to stop the headings from appearing underneath the top menu. "
421
- "A setting of 30 accommodates the WordPress admin bar. This setting only has "
422
- "an effect after you have enabled Smooth Scroll option."
423
- msgstr ""
424
-
425
- #: includes/class.options.php:489
426
- msgid "Limit Path"
427
- msgstr ""
428
-
429
- #: includes/class.options.php:490
430
- msgid ""
431
- "Restrict generation of the table of contents to pages that match the "
432
- "required path. This path is from the root of your site and always begins "
433
- "with a forward slash."
434
- msgstr ""
435
-
436
- #: includes/class.options.php:491
437
- msgid "Eg: /wiki/, /corporate/annual-reports/"
438
- msgstr ""
439
-
440
- #: includes/class.options.php:496
441
- msgid "Default Anchor Prefix"
442
- msgstr ""
443
-
444
- #: includes/class.options.php:497
445
- msgid ""
446
- "Anchor targets are restricted to alphanumeric characters as per HTML "
447
- "specification (see readme for more detail). The default anchor prefix will "
448
- "be used when no characters qualify. When left blank, a number will be used "
449
- "instead."
450
- msgstr ""
451
-
452
- #: includes/class.options.php:498
453
- msgid ""
454
- "This option normally applies to content written in character sets other than "
455
- "ASCII."
456
- msgstr ""
457
-
458
- #: includes/class.options.php:499
459
- msgid "Eg: i, toc_index, index, _"
460
- msgstr ""
461
-
462
- #: includes/class.options.php:505
463
- msgid "Widget Affix Selector"
464
- msgstr ""
465
-
466
- #: includes/class.options.php:506
467
- msgid ""
468
- "To enable the option to affix or pin the Table of Contents widget enter the "
469
- "theme's sidebar class or id."
470
- msgstr ""
471
-
472
- #: includes/class.options.php:507
473
- msgid ""
474
- "Since every theme is different, this can not be determined automatically. If "
475
- "you are unsure how to find the sidebar's class or id, please ask the theme's "
476
- "support persons."
477
- msgstr ""
478
-
479
- #: includes/class.options.php:508
480
- msgid "Eg: .widget-area or #sidebar"
481
- msgstr ""
482
-
483
- #: includes/class.options.php:756
484
- #, php-format
485
- msgid ""
486
- "The callback function used for the <strong>%s</strong> setting is missing."
487
- msgstr ""
488
-
489
- #: includes/class.widget-toc.php:22
490
- msgid "Display the table of contents."
491
- msgstr ""
492
-
493
- #: includes/class.widget-toc.php:310
494
- msgid "Title"
495
- msgstr ""
496
-
497
- #: includes/class.widget-toc.php:317
498
- msgid "Active Section Highlight Color:"
499
- msgstr ""
500
-
501
- #: includes/class.widget-toc.php:325
502
- msgid "Affix or pin the widget."
503
- msgstr ""
504
-
505
- #: includes/class.widget-toc.php:329
506
- msgid ""
507
- "If you choose to affix the widget, do not add any other widgets on the "
508
- "sidebar. Also, make sure you have only one instance Table of Contents widget "
509
- "on the page."
510
- msgstr ""
511
-
512
- #: includes/inc.admin-options-page.php:9
513
- msgid "General"
514
- msgstr ""
515
-
516
- #: includes/inc.admin-options-page.php:27
517
- msgid "Appearance"
518
- msgstr ""
519
-
520
- #: includes/inc.admin-options-page.php:45
521
- msgid "Advanced"
522
- msgstr ""
523
-
524
- #: includes/inc.admin-options-page.php:61
525
- msgid "Save Changes"
526
- msgstr ""
527
-
528
- #. Plugin Name of the plugin/theme
529
- msgid "Easy Table of Contents"
530
- msgstr ""
531
-
532
- #. Plugin URI of the plugin/theme
533
- #. Author URI of the plugin/theme
534
- msgid "http://connections-pro.com/"
535
- msgstr ""
536
-
537
- #. Description of the plugin/theme
538
- msgid ""
539
- "Adds a user friendly and fully automatic way to create and display a table "
540
- "of contents generated from the page content."
541
- msgstr ""
542
-
543
- #. Author of the plugin/theme
544
- msgid "Steven A. Zahm"
545
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
+ msgid ""
3
+ msgstr ""
4
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
+ "Project-Id-Version: Easy Table of Contents\n"
6
+ "POT-Creation-Date: 2018-01-24 10:35-0500\n"
7
+ "PO-Revision-Date: 2015-11-09 09:47-0500\n"
8
+ "Last-Translator: Steven A. Zahm <helpdesk@connections-pro.com>\n"
9
+ "Language-Team: Steven A. Zahm <helpdesk@connections-pro.com>\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 2.0.4\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-WPHeader: easy-table-of-contents.php\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
19
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
22
+
23
+ #: includes/class.admin.php:60
24
+ msgid "Settings"
25
+ msgstr ""
26
+
27
+ #: includes/class.admin.php:92 includes/class.admin.php:93
28
+ #: includes/class.admin.php:145 includes/class.widget-toc.php:27
29
+ #: includes/inc.admin-options-page.php:2
30
+ msgid "Table of Contents"
31
+ msgstr ""
32
+
33
+ #: includes/class.admin.php:188
34
+ msgid "Disable the automatic insertion of the table of contents."
35
+ msgstr ""
36
+
37
+ #: includes/class.admin.php:199
38
+ msgid "Insert table of contents."
39
+ msgstr ""
40
+
41
+ #: includes/class.admin.php:211
42
+ msgid "Advanced:"
43
+ msgstr ""
44
+
45
+ #: includes/class.admin.php:218
46
+ msgid "NOTE:"
47
+ msgstr ""
48
+
49
+ #: includes/class.admin.php:220
50
+ msgid ""
51
+ "Using the advanced options below will override the global advanced settings."
52
+ msgstr ""
53
+
54
+ #: includes/class.admin.php:229 includes/class.options.php:446
55
+ msgid "Headings:"
56
+ msgstr ""
57
+
58
+ #: includes/class.admin.php:235 includes/class.options.php:447
59
+ msgid ""
60
+ "Select the heading to consider when generating the table of contents. "
61
+ "Deselecting a heading will exclude it."
62
+ msgstr ""
63
+
64
+ #: includes/class.admin.php:237 includes/class.options.php:450
65
+ msgid "Heading 1 (h1)"
66
+ msgstr ""
67
+
68
+ #: includes/class.admin.php:238 includes/class.options.php:451
69
+ msgid "Heading 2 (h2)"
70
+ msgstr ""
71
+
72
+ #: includes/class.admin.php:239 includes/class.options.php:452
73
+ msgid "Heading 3 (h3)"
74
+ msgstr ""
75
+
76
+ #: includes/class.admin.php:240 includes/class.options.php:453
77
+ msgid "Heading 4 (h4)"
78
+ msgstr ""
79
+
80
+ #: includes/class.admin.php:241 includes/class.options.php:454
81
+ msgid "Heading 5 (h5)"
82
+ msgstr ""
83
+
84
+ #: includes/class.admin.php:242 includes/class.options.php:455
85
+ msgid "Heading 6 (h6)"
86
+ msgstr ""
87
+
88
+ #: includes/class.admin.php:252
89
+ msgid "Alternate Headings"
90
+ msgstr ""
91
+
92
+ #: includes/class.admin.php:258
93
+ msgid ""
94
+ "Specify alternate table of contents header string. Add the header to be "
95
+ "replaced and the alternate header on a single line separated with a pipe "
96
+ "<code>|</code>. Put each additional original and alternate header on its own "
97
+ "line."
98
+ msgstr ""
99
+
100
+ #: includes/class.admin.php:275 includes/class.admin.php:309
101
+ #: includes/class.options.php:470
102
+ msgid "Examples:"
103
+ msgstr ""
104
+
105
+ #: includes/class.admin.php:277
106
+ msgid ""
107
+ "<code>Level [1.1]|Alternate TOC Header</code> Replaces Level [1.1] in the "
108
+ "table of contents with Alternate TOC Header."
109
+ msgstr ""
110
+
111
+ #: includes/class.admin.php:279
112
+ msgid "<strong>Note:</strong> This is case sensitive."
113
+ msgstr ""
114
+
115
+ #: includes/class.admin.php:286 includes/class.options.php:461
116
+ msgid "Exclude Headings"
117
+ msgstr ""
118
+
119
+ #: includes/class.admin.php:292 includes/class.options.php:462
120
+ msgid ""
121
+ "Specify headings to be excluded from appearing in the table of contents. "
122
+ "Separate multiple headings with a pipe <code>|</code>. Use an asterisk "
123
+ "<code>*</code> as a wildcard to match other text."
124
+ msgstr ""
125
+
126
+ #: includes/class.admin.php:311 includes/class.options.php:472
127
+ msgid "<code>Fruit*</code> Ignore headings starting with \"Fruit\"."
128
+ msgstr ""
129
+
130
+ #: includes/class.admin.php:312 includes/class.options.php:473
131
+ msgid ""
132
+ "<code>*Fruit Diet*</code> Ignore headings with \"Fruit Diet\" somewhere in "
133
+ "the heading."
134
+ msgstr ""
135
+
136
+ #: includes/class.admin.php:313 includes/class.options.php:474
137
+ msgid ""
138
+ "<code>Apple Tree|Oranges|Yellow Bananas</code> Ignore headings that are "
139
+ "exactly \"Apple Tree\", \"Oranges\" or \"Yellow Bananas\"."
140
+ msgstr ""
141
+
142
+ #: includes/class.admin.php:315 includes/class.options.php:476
143
+ msgid "<strong>Note:</strong> This is not case sensitive."
144
+ msgstr ""
145
+
146
+ #: includes/class.options.php:163
147
+ msgid "Enable Support"
148
+ msgstr ""
149
+
150
+ #: includes/class.options.php:164
151
+ msgid "Select the post types to enable the support for table of contents."
152
+ msgstr ""
153
+
154
+ #: includes/class.options.php:171
155
+ msgid "Auto Insert"
156
+ msgstr ""
157
+
158
+ #: includes/class.options.php:172
159
+ msgid ""
160
+ "Select the post types which will have the table of contents automatically "
161
+ "inserted."
162
+ msgstr ""
163
+
164
+ #: includes/class.options.php:173
165
+ msgid ""
166
+ "NOTE: The table of contents will only be automatically inserted on post "
167
+ "types for which it has been enabled."
168
+ msgstr ""
169
+
170
+ #: includes/class.options.php:180
171
+ msgid "Position"
172
+ msgstr ""
173
+
174
+ #: includes/class.options.php:181
175
+ msgid "Choose where where you want to display the table of contents."
176
+ msgstr ""
177
+
178
+ #: includes/class.options.php:184
179
+ msgid "Before first heading (default)"
180
+ msgstr ""
181
+
182
+ #: includes/class.options.php:185
183
+ msgid "After first heading"
184
+ msgstr ""
185
+
186
+ #: includes/class.options.php:186
187
+ msgid "Top"
188
+ msgstr ""
189
+
190
+ #: includes/class.options.php:187
191
+ msgid "Bottom"
192
+ msgstr ""
193
+
194
+ #: includes/class.options.php:194
195
+ msgid "Show when"
196
+ msgstr ""
197
+
198
+ #: includes/class.options.php:195
199
+ msgid "or more headings are present"
200
+ msgstr ""
201
+
202
+ #: includes/class.options.php:202
203
+ msgid "Display Header Label"
204
+ msgstr ""
205
+
206
+ #: includes/class.options.php:203
207
+ msgid "Show header text above the table of contents."
208
+ msgstr ""
209
+
210
+ #: includes/class.options.php:209
211
+ msgid "Header Label"
212
+ msgstr ""
213
+
214
+ #: includes/class.options.php:210
215
+ msgid "Eg: Contents, Table of Contents, Page Contents"
216
+ msgstr ""
217
+
218
+ #: includes/class.options.php:212
219
+ msgid "Contents"
220
+ msgstr ""
221
+
222
+ #: includes/class.options.php:216
223
+ msgid "Toggle View"
224
+ msgstr ""
225
+
226
+ #: includes/class.options.php:217
227
+ msgid "Allow the user to toggle the visibility of the table of contents."
228
+ msgstr ""
229
+
230
+ #: includes/class.options.php:237
231
+ msgid "Initial View"
232
+ msgstr ""
233
+
234
+ #: includes/class.options.php:238
235
+ msgid "Initially hide the table of contents."
236
+ msgstr ""
237
+
238
+ #: includes/class.options.php:244
239
+ msgid "Show as Hierarchy"
240
+ msgstr ""
241
+
242
+ #: includes/class.options.php:251
243
+ msgid "Counter"
244
+ msgstr ""
245
+
246
+ #: includes/class.options.php:255
247
+ msgid "Decimal (default)"
248
+ msgstr ""
249
+
250
+ #: includes/class.options.php:256
251
+ msgid "Numeric"
252
+ msgstr ""
253
+
254
+ #: includes/class.options.php:257
255
+ msgid "Roman"
256
+ msgstr ""
257
+
258
+ #: includes/class.options.php:258
259
+ msgid "None"
260
+ msgstr ""
261
+
262
+ #: includes/class.options.php:264
263
+ msgid "Smooth Scroll"
264
+ msgstr ""
265
+
266
+ #: includes/class.options.php:276
267
+ msgid "Width"
268
+ msgstr ""
269
+
270
+ #: includes/class.options.php:281
271
+ msgid "Fixed"
272
+ msgstr ""
273
+
274
+ #: includes/class.options.php:295
275
+ msgid "Relative"
276
+ msgstr ""
277
+
278
+ #: includes/class.options.php:307 includes/class.options.php:352
279
+ msgid "Custom"
280
+ msgstr ""
281
+
282
+ #: includes/class.options.php:309
283
+ msgid "User Defined"
284
+ msgstr ""
285
+
286
+ #: includes/class.options.php:317
287
+ msgid "Custom Width"
288
+ msgstr ""
289
+
290
+ #: includes/class.options.php:318
291
+ msgid ""
292
+ "Select the User Defined option from the Width option to utilitze the custom "
293
+ "width."
294
+ msgstr ""
295
+
296
+ #: includes/class.options.php:324
297
+ msgid "Float"
298
+ msgstr ""
299
+
300
+ #: includes/class.options.php:328
301
+ msgid "None (Default)"
302
+ msgstr ""
303
+
304
+ #: includes/class.options.php:329
305
+ msgid "Left"
306
+ msgstr ""
307
+
308
+ #: includes/class.options.php:330
309
+ msgid "Right"
310
+ msgstr ""
311
+
312
+ #: includes/class.options.php:336
313
+ msgid "Font Size"
314
+ msgstr ""
315
+
316
+ #: includes/class.options.php:343
317
+ msgid "Theme"
318
+ msgstr ""
319
+
320
+ #: includes/class.options.php:344
321
+ msgid ""
322
+ "The theme is only applied to the table of contents which is auto inserted "
323
+ "into the post. The Table of Contents widget will inherit the theme widget "
324
+ "styles."
325
+ msgstr ""
326
+
327
+ #: includes/class.options.php:347
328
+ msgid "Grey"
329
+ msgstr ""
330
+
331
+ #: includes/class.options.php:348
332
+ msgid "Light Blue"
333
+ msgstr ""
334
+
335
+ #: includes/class.options.php:349
336
+ msgid "White"
337
+ msgstr ""
338
+
339
+ #: includes/class.options.php:350
340
+ msgid "Black"
341
+ msgstr ""
342
+
343
+ #: includes/class.options.php:351
344
+ msgid "Transparent"
345
+ msgstr ""
346
+
347
+ #: includes/class.options.php:358
348
+ msgid "Custom Theme"
349
+ msgstr ""
350
+
351
+ #: includes/class.options.php:359
352
+ msgid "For the following settings to apply, select the Custom Theme option."
353
+ msgstr ""
354
+
355
+ #: includes/class.options.php:364
356
+ msgid "Background Color"
357
+ msgstr ""
358
+
359
+ #: includes/class.options.php:371
360
+ msgid "Border Color"
361
+ msgstr ""
362
+
363
+ #: includes/class.options.php:378
364
+ msgid "Title Color"
365
+ msgstr ""
366
+
367
+ #: includes/class.options.php:385
368
+ msgid "Link Color"
369
+ msgstr ""
370
+
371
+ #: includes/class.options.php:392
372
+ msgid "Link Hover Color"
373
+ msgstr ""
374
+
375
+ #: includes/class.options.php:399
376
+ msgid "Link Visited Color"
377
+ msgstr ""
378
+
379
+ #: includes/class.options.php:411
380
+ msgid "Lowercase"
381
+ msgstr ""
382
+
383
+ #: includes/class.options.php:412
384
+ msgid "Ensure anchors are in lowercase."
385
+ msgstr ""
386
+
387
+ #: includes/class.options.php:418
388
+ msgid "Hyphenate"
389
+ msgstr ""
390
+
391
+ #: includes/class.options.php:419
392
+ msgid "Use - rather than _ in anchors."
393
+ msgstr ""
394
+
395
+ #: includes/class.options.php:425
396
+ msgid "Homepage"
397
+ msgstr ""
398
+
399
+ #: includes/class.options.php:426
400
+ msgid "Show the table of contents for qualifying items on the homepage."
401
+ msgstr ""
402
+
403
+ #: includes/class.options.php:432
404
+ msgid "CSS"
405
+ msgstr ""
406
+
407
+ #: includes/class.options.php:433
408
+ msgid ""
409
+ "Prevent the loading the core CSS styles. When selected, the appearance "
410
+ "options from above will be ignored."
411
+ msgstr ""
412
+
413
+ #: includes/class.options.php:481
414
+ msgid "Smooth Scroll Offset"
415
+ msgstr ""
416
+
417
+ #: includes/class.options.php:482
418
+ msgid ""
419
+ "If you have a consistent menu across the top of your site, you can adjust "
420
+ "the top offset to stop the headings from appearing underneath the top menu. "
421
+ "A setting of 30 accommodates the WordPress admin bar. This setting only has "
422
+ "an effect after you have enabled Smooth Scroll option."
423
+ msgstr ""
424
+
425
+ #: includes/class.options.php:489
426
+ msgid "Limit Path"
427
+ msgstr ""
428
+
429
+ #: includes/class.options.php:490
430
+ msgid ""
431
+ "Restrict generation of the table of contents to pages that match the "
432
+ "required path. This path is from the root of your site and always begins "
433
+ "with a forward slash."
434
+ msgstr ""
435
+
436
+ #: includes/class.options.php:491
437
+ msgid "Eg: /wiki/, /corporate/annual-reports/"
438
+ msgstr ""
439
+
440
+ #: includes/class.options.php:496
441
+ msgid "Default Anchor Prefix"
442
+ msgstr ""
443
+
444
+ #: includes/class.options.php:497
445
+ msgid ""
446
+ "Anchor targets are restricted to alphanumeric characters as per HTML "
447
+ "specification (see readme for more detail). The default anchor prefix will "
448
+ "be used when no characters qualify. When left blank, a number will be used "
449
+ "instead."
450
+ msgstr ""
451
+
452
+ #: includes/class.options.php:498
453
+ msgid ""
454
+ "This option normally applies to content written in character sets other than "
455
+ "ASCII."
456
+ msgstr ""
457
+
458
+ #: includes/class.options.php:499
459
+ msgid "Eg: i, toc_index, index, _"
460
+ msgstr ""
461
+
462
+ #: includes/class.options.php:505
463
+ msgid "Widget Affix Selector"
464
+ msgstr ""
465
+
466
+ #: includes/class.options.php:506
467
+ msgid ""
468
+ "To enable the option to affix or pin the Table of Contents widget enter the "
469
+ "theme's sidebar class or id."
470
+ msgstr ""
471
+
472
+ #: includes/class.options.php:507
473
+ msgid ""
474
+ "Since every theme is different, this can not be determined automatically. If "
475
+ "you are unsure how to find the sidebar's class or id, please ask the theme's "
476
+ "support persons."
477
+ msgstr ""
478
+
479
+ #: includes/class.options.php:508
480
+ msgid "Eg: .widget-area or #sidebar"
481
+ msgstr ""
482
+
483
+ #: includes/class.options.php:756
484
+ #, php-format
485
+ msgid ""
486
+ "The callback function used for the <strong>%s</strong> setting is missing."
487
+ msgstr ""
488
+
489
+ #: includes/class.widget-toc.php:22
490
+ msgid "Display the table of contents."
491
+ msgstr ""
492
+
493
+ #: includes/class.widget-toc.php:310
494
+ msgid "Title"
495
+ msgstr ""
496
+
497
+ #: includes/class.widget-toc.php:317
498
+ msgid "Active Section Highlight Color:"
499
+ msgstr ""
500
+
501
+ #: includes/class.widget-toc.php:325
502
+ msgid "Affix or pin the widget."
503
+ msgstr ""
504
+
505
+ #: includes/class.widget-toc.php:329
506
+ msgid ""
507
+ "If you choose to affix the widget, do not add any other widgets on the "
508
+ "sidebar. Also, make sure you have only one instance Table of Contents widget "
509
+ "on the page."
510
+ msgstr ""
511
+
512
+ #: includes/inc.admin-options-page.php:9
513
+ msgid "General"
514
+ msgstr ""
515
+
516
+ #: includes/inc.admin-options-page.php:27
517
+ msgid "Appearance"
518
+ msgstr ""
519
+
520
+ #: includes/inc.admin-options-page.php:45
521
+ msgid "Advanced"
522
+ msgstr ""
523
+
524
+ #: includes/inc.admin-options-page.php:61
525
+ msgid "Save Changes"
526
+ msgstr ""
527
+
528
+ #. Plugin Name of the plugin/theme
529
+ msgid "Easy Table of Contents"
530
+ msgstr ""
531
+
532
+ #. Plugin URI of the plugin/theme
533
+ #. Author URI of the plugin/theme
534
+ msgid "http://connections-pro.com/"
535
+ msgstr ""
536
+
537
+ #. Description of the plugin/theme
538
+ msgid ""
539
+ "Adds a user friendly and fully automatic way to create and display a table "
540
+ "of contents generated from the page content."
541
+ msgstr ""
542
+
543
+ #. Author of the plugin/theme
544
+ msgid "Steven A. Zahm"
545
+ msgstr ""
546
+
547
+ #: Sticky Toggle Options
548
+ #: includes/inc.admin-options-page.php:286
549
+ msgid "Sticky Toggle Options"
550
+ msgstr ""
551
+
552
+ msgid "On/Off"
553
+ msgstr ""
554
+
555
+ msgid "Width"
556
+ msgstr ""
557
+
558
+ msgid "Auto"
559
+ msgstr ""
560
+
561
+ msgid "Custom Width"
562
+ msgstr ""
563
+
564
+ msgid "Enter sticky toggle custom width here.."
565
+ msgstr ""
566
+
567
+ msgid "Height"
568
+ msgstr ""
569
+
570
+ msgid "Custom Height"
571
+ msgstr ""
572
+
573
+ msgid "Enter sticky toggle custom height here.."
574
+ msgstr ""
575
+
576
+ msgid "Open Button Text"
577
+ msgstr ""
578
+
579
+ msgid "Enter sticky toggle open button text here.."
580
+ msgstr ""
vendor/js-cookie/js.cookie.min.js CHANGED
@@ -1,8 +1,8 @@
1
- /*!
2
- * JavaScript Cookie v2.2.1
3
- * https://github.com/js-cookie/js-cookie
4
- *
5
- * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
6
- * Released under the MIT license
7
- */
8
  !function(factory){var registeredInModuleLoader;if("function"==typeof define&&define.amd&&(define(factory),registeredInModuleLoader=!0),"object"==typeof exports&&(module.exports=factory(),registeredInModuleLoader=!0),!registeredInModuleLoader){var OldCookies=window.Cookies,api=window.Cookies=factory();api.noConflict=function(){return window.Cookies=OldCookies,api}}}((function(){function extend(){for(var i=0,result={};i<arguments.length;i++){var attributes=arguments[i];for(var key in attributes)result[key]=attributes[key]}return result}function decode(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function init(converter){function api(){}function set(key,value,attributes){if("undefined"!=typeof document){"number"==typeof(attributes=extend({path:"/"},api.defaults,attributes)).expires&&(attributes.expires=new Date(1*new Date+864e5*attributes.expires)),attributes.expires=attributes.expires?attributes.expires.toUTCString():"";try{var result=JSON.stringify(value);/^[\{\[]/.test(result)&&(value=result)}catch(e){}value=converter.write?converter.write(value,key):encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),key=encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var stringifiedAttributes="";for(var attributeName in attributes)attributes[attributeName]&&(stringifiedAttributes+="; "+attributeName,!0!==attributes[attributeName]&&(stringifiedAttributes+="="+attributes[attributeName].split(";")[0]));return document.cookie=key+"="+value+stringifiedAttributes}}function get(key,json){if("undefined"!=typeof document){for(var jar={},cookies=document.cookie?document.cookie.split("; "):[],i=0;i<cookies.length;i++){var parts=cookies[i].split("="),cookie=parts.slice(1).join("=");json||'"'!==cookie.charAt(0)||(cookie=cookie.slice(1,-1));try{var name=decode(parts[0]);if(cookie=(converter.read||converter)(cookie,name)||decode(cookie),json)try{cookie=JSON.parse(cookie)}catch(e){}if(jar[name]=cookie,key===name)break}catch(e){}}return key?jar[key]:jar}}return api.set=set,api.get=function(key){return get(key,!1)},api.getJSON=function(key){return get(key,!0)},api.remove=function(key,attributes){set(key,"",extend(attributes,{expires:-1}))},api.defaults={},api.withConverter=init,api}return init((function(){}))}));
1
+ /*!
2
+ * JavaScript Cookie v2.2.1
3
+ * https://github.com/js-cookie/js-cookie
4
+ *
5
+ * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
6
+ * Released under the MIT license
7
+ */
8
  !function(factory){var registeredInModuleLoader;if("function"==typeof define&&define.amd&&(define(factory),registeredInModuleLoader=!0),"object"==typeof exports&&(module.exports=factory(),registeredInModuleLoader=!0),!registeredInModuleLoader){var OldCookies=window.Cookies,api=window.Cookies=factory();api.noConflict=function(){return window.Cookies=OldCookies,api}}}((function(){function extend(){for(var i=0,result={};i<arguments.length;i++){var attributes=arguments[i];for(var key in attributes)result[key]=attributes[key]}return result}function decode(s){return s.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function init(converter){function api(){}function set(key,value,attributes){if("undefined"!=typeof document){"number"==typeof(attributes=extend({path:"/"},api.defaults,attributes)).expires&&(attributes.expires=new Date(1*new Date+864e5*attributes.expires)),attributes.expires=attributes.expires?attributes.expires.toUTCString():"";try{var result=JSON.stringify(value);/^[\{\[]/.test(result)&&(value=result)}catch(e){}value=converter.write?converter.write(value,key):encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),key=encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var stringifiedAttributes="";for(var attributeName in attributes)attributes[attributeName]&&(stringifiedAttributes+="; "+attributeName,!0!==attributes[attributeName]&&(stringifiedAttributes+="="+attributes[attributeName].split(";")[0]));return document.cookie=key+"="+value+stringifiedAttributes}}function get(key,json){if("undefined"!=typeof document){for(var jar={},cookies=document.cookie?document.cookie.split("; "):[],i=0;i<cookies.length;i++){var parts=cookies[i].split("="),cookie=parts.slice(1).join("=");json||'"'!==cookie.charAt(0)||(cookie=cookie.slice(1,-1));try{var name=decode(parts[0]);if(cookie=(converter.read||converter)(cookie,name)||decode(cookie),json)try{cookie=JSON.parse(cookie)}catch(e){}if(jar[name]=cookie,key===name)break}catch(e){}}return key?jar[key]:jar}}return api.set=set,api.get=function(key){return get(key,!1)},api.getJSON=function(key){return get(key,!0)},api.remove=function(key,attributes){set(key,"",extend(attributes,{expires:-1}))},api.defaults={},api.withConverter=init,api}return init((function(){}))}));