LuckyWP Table of Contents - Version 1.9.8

Version Description

2019-10-23 = * Minor fixes for compatibility with WordPress 5.3.

Download this release

Release Info

Developer theluckywp
Plugin Icon 128x128 LuckyWP Table of Contents
Version 1.9.8
Comparing to
See all releases

Code changes from version 1.9.7 to 1.9.8

admin/controllers/EditorBlockController.php CHANGED
@@ -39,7 +39,7 @@ class EditorBlockController extends AdminController
39
  if ($model->load(Core::$plugin->request->post())) {
40
  if ($model->validate()) {
41
  echo CustomizeSuccess::widget([
42
- 'after' => '<script>$(document).trigger("lwptocEditorBlockChanged", ' . Json::encode($model->getAttrs()) . ');</script>',
43
  ]);
44
  wp_die();
45
  }
39
  if ($model->load(Core::$plugin->request->post())) {
40
  if ($model->validate()) {
41
  echo CustomizeSuccess::widget([
42
+ 'after' => '<script>jQuery(document).trigger("lwptocEditorBlockChanged", ' . Json::encode($model->getAttrs()) . ');</script>',
43
  ]);
44
  wp_die();
45
  }
admin/controllers/MetaboxController.php CHANGED
@@ -77,7 +77,7 @@ class MetaboxController extends AdminController
77
  $model->toPostSettings($postSettings);
78
  $postSettings->save();
79
  echo CustomizeSuccess::widget([
80
- 'after' => '<script>$(document).trigger("lwptocMetaboxCustomized", ' . Json::encode([
81
  'metabox' => Metabox::widget(['post' => $post]),
82
  ]) . ');</script>',
83
  ]);
77
  $model->toPostSettings($postSettings);
78
  $postSettings->save();
79
  echo CustomizeSuccess::widget([
80
+ 'after' => '<script>jQuery(document).trigger("lwptocMetaboxCustomized", ' . Json::encode([
81
  'metabox' => Metabox::widget(['post' => $post]),
82
  ]) . ');</script>',
83
  ]);
admin/controllers/ShortcodeController.php CHANGED
@@ -40,7 +40,7 @@ class ShortcodeController extends AdminController
40
  if ($model->load(Core::$plugin->request->post())) {
41
  if ($model->validate()) {
42
  echo CustomizeSuccess::widget([
43
- 'after' => '<script>$(document).trigger("lwptocShortcodeGenerated", ' . Json::encode(['shortcode' => $model->generateShortcode()]) . ');</script>',
44
  ]);
45
  wp_die();
46
  }
40
  if ($model->load(Core::$plugin->request->post())) {
41
  if ($model->validate()) {
42
  echo CustomizeSuccess::widget([
43
+ 'after' => '<script>jQuery(document).trigger("lwptocShortcodeGenerated", ' . Json::encode(['shortcode' => $model->generateShortcode()]) . ');</script>',
44
  ]);
45
  wp_die();
46
  }
admin/controllers/WidgetController.php CHANGED
@@ -49,7 +49,7 @@ class WidgetController extends AdminController
49
  return $v !== null;
50
  });
51
  echo CustomizeSuccess::widget([
52
- 'after' => '<script>$(document).trigger("lwptocWidgetCustomized", ' . Json::encode([
53
  'id' => $widgetId,
54
  'override' => Widget::overrideHtml($attrs),
55
  'value' => Json::encode($attrs),
49
  return $v !== null;
50
  });
51
  echo CustomizeSuccess::widget([
52
+ 'after' => '<script>jQuery(document).trigger("lwptocWidgetCustomized", ' . Json::encode([
53
  'id' => $widgetId,
54
  'override' => Widget::overrideHtml($attrs),
55
  'value' => Json::encode($attrs),
admin/widgets/widget/views/form.php CHANGED
@@ -23,5 +23,5 @@ use luckywp\tableOfContents\core\helpers\Html;
23
  <?= Html::hiddenInput($inputName, $value, ['class' => 'lwptocWidget_input']) ?>
24
  </div>
25
  <script>
26
- $.lwptocWidget.init();
27
  </script>
23
  <?= Html::hiddenInput($inputName, $value, ['class' => 'lwptocWidget_input']) ?>
24
  </div>
25
  <script>
26
+ jQuery.lwptocWidget.init();
27
  </script>
luckywp-table-of-contents.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: LuckyWP Table of Contents
4
  Plugin URI: https://theluckywp.com/product/table-of-contents/
5
  Description: Creates a table of contents for your posts/pages. Works automatically or manually (via shortcode, Gutenberg block or widget).
6
- Version: 1.9.7
7
  Author: LuckyWP
8
  Author URI: https://theluckywp.com/
9
  Text Domain: luckywp-table-of-contents
@@ -29,6 +29,6 @@ $lwptocAutoloader->register();
29
  $lwptocAutoloader->addNamespace('luckywp\tableOfContents', __DIR__);
30
 
31
  $config = require(__DIR__ . '/config/plugin.php');
32
- (new \luckywp\tableOfContents\plugin\Plugin($config))->run('1.9.7', __FILE__, 'lwptoc_');
33
 
34
  require_once __DIR__ . '/functions.php';
3
  Plugin Name: LuckyWP Table of Contents
4
  Plugin URI: https://theluckywp.com/product/table-of-contents/
5
  Description: Creates a table of contents for your posts/pages. Works automatically or manually (via shortcode, Gutenberg block or widget).
6
+ Version: 1.9.8
7
  Author: LuckyWP
8
  Author URI: https://theluckywp.com/
9
  Text Domain: luckywp-table-of-contents
29
  $lwptocAutoloader->addNamespace('luckywp\tableOfContents', __DIR__);
30
 
31
  $config = require(__DIR__ . '/config/plugin.php');
32
+ (new \luckywp\tableOfContents\plugin\Plugin($config))->run('1.9.8', __FILE__, 'lwptoc_');
33
 
34
  require_once __DIR__ . '/functions.php';
plugin/editorBlock/editorBlock.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){var o={};function e(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,o){if(1&o&&(t=e(t)),8&o)return t;if(4&o&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&o&&"string"!=typeof t)for(var r in t)e.d(n,r,function(o){return t[o]}.bind(null,r));return n},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},e.p="",e(e.s=1)}([function(t,o){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(o){return"function"==typeof Symbol&&"symbol"===e(Symbol.iterator)?t.exports=n=function(t){return e(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":e(t)},n(o)}t.exports=n},function(t,o,e){"use strict";e.r(o);var n=e(0),r=e.n(n),i=wp.blocks.registerBlockType,l=wp.element,c=l.createElement,p=l.Fragment,u=wp.editor.BlockControls,s=wp.components,a=s.Toolbar,y=s.IconButton,f=0,d={};i("luckywp/tableofcontents",{title:lwptocMain.tableOfContents,icon:"list-view",category:"common",supports:{customClassName:!1,html:!1},attributes:{min:{type:"integer"},depth:{type:"integer"},hierarchical:{type:"boolean"},numeration:{type:"string"},numerationSuffix:{type:"string"},title:{type:"string"},toggle:{type:"boolean"},labelShow:{type:"string"},labelHide:{type:"string"},hideItems:{type:"boolean"},smoothScroll:{type:"boolean"},smoothScrollOffset:{type:"integer"},width:{type:"string"},float:{type:"string"},titleFontSize:{type:"string"},titleFontWeight:{type:"string"},itemsFontSize:{type:"string"},colorScheme:{type:"string"},backgroundColor:{type:"string"},borderColor:{type:"string"},titleColor:{type:"string"},linkColor:{type:"string"},hoverLinkColor:{type:"string"},visitedLinkColor:{type:"string"},wrapNoindex:{type:"boolean"},useNofollow:{type:"boolean"},skipHeadingLevel:{type:"string"},skipHeadingText:{type:"string"}},edit:function(t){var o=t.attributes,e=t.setAttributes,n={};$.each(o,function(t,o){r()(o)==r()(!0)&&(o=o?1:0),n[t]=o});var i="lwptocEditorBlock"+ ++f,l=JSON.stringify(o);return void 0===d[l]&&($.ajax({url:lwptocMain.ajaxUrl,data:{_ajax_nonce:lwptocMain.nonce,action:"lwptoc_block_view",attrs:n},success:function(t){d[l]=t,$("#"+i).replaceWith(t)}}),d[l]='<div class="lwptocEditorBlock_title lwptocEditorBlock_title-loading" id="'+i+'">'+lwptocMain.tableOfContents+"</div>"),c(p,null,c(u,null,c(a,null,c(y,{label:lwptocMain.Edit,icon:"edit",onClick:function(){$(document).one("lwptocEditorBlockChanged",function(t,o){_.each(o,function(t,e){null===t&&(o[e]=void 0)}),e(o)}),$.lwptocCustomize.show({action:"lwptoc_block_edit",attrs:n,postId:lwptocMain.postId},function(){$(document).off("lwptocEditorBlockChanged")})}}))),c("div",{class:"lwptocEditorBlock",dangerouslySetInnerHTML:{__html:d[l]}}))},save:function(t){return t.attributes.shortcode}})}]);
1
+ !function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=1)}([function(t,e){function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(e){return"function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?t.exports=n=function(t){return o(t)}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":o(t)},n(e)}t.exports=n},function(t,e,o){"use strict";o.r(e);var n=o(0),r=o.n(n),i=wp.blocks.registerBlockType,l=wp.element,c=l.createElement,u=l.Fragment,p=wp.editor.BlockControls,s=wp.components,a=s.Toolbar,y=s.IconButton,f=0,d={};i("luckywp/tableofcontents",{title:lwptocMain.tableOfContents,icon:"list-view",category:"common",supports:{customClassName:!1,html:!1},attributes:{min:{type:"integer"},depth:{type:"integer"},hierarchical:{type:"boolean"},numeration:{type:"string"},numerationSuffix:{type:"string"},title:{type:"string"},toggle:{type:"boolean"},labelShow:{type:"string"},labelHide:{type:"string"},hideItems:{type:"boolean"},smoothScroll:{type:"boolean"},smoothScrollOffset:{type:"integer"},width:{type:"string"},float:{type:"string"},titleFontSize:{type:"string"},titleFontWeight:{type:"string"},itemsFontSize:{type:"string"},colorScheme:{type:"string"},backgroundColor:{type:"string"},borderColor:{type:"string"},titleColor:{type:"string"},linkColor:{type:"string"},hoverLinkColor:{type:"string"},visitedLinkColor:{type:"string"},wrapNoindex:{type:"boolean"},useNofollow:{type:"boolean"},skipHeadingLevel:{type:"string"},skipHeadingText:{type:"string"}},edit:function(t){var e=t.attributes,o=t.setAttributes,n={};jQuery.each(e,function(t,e){r()(e)==r()(!0)&&(e=e?1:0),n[t]=e});var i="lwptocEditorBlock"+ ++f,l=JSON.stringify(e);return void 0===d[l]&&(jQuery.ajax({url:lwptocMain.ajaxUrl,data:{_ajax_nonce:lwptocMain.nonce,action:"lwptoc_block_view",attrs:n},success:function(t){d[l]=t,jQuery("#"+i).replaceWith(t)}}),d[l]='<div class="lwptocEditorBlock_title lwptocEditorBlock_title-loading" id="'+i+'">'+lwptocMain.tableOfContents+"</div>"),c(u,null,c(p,null,c(a,null,c(y,{label:lwptocMain.Edit,icon:"edit",onClick:function(){jQuery(document).one("lwptocEditorBlockChanged",function(t,e){_.each(e,function(t,o){null===t&&(e[o]=void 0)}),o(e)}),jQuery.lwptocCustomize.show({action:"lwptoc_block_edit",attrs:n,postId:lwptocMain.postId},function(){jQuery(document).off("lwptocEditorBlockChanged")})}}))),c("div",{class:"lwptocEditorBlock",dangerouslySetInnerHTML:{__html:d[l]}}))},save:function(t){return t.attributes.shortcode}})}]);
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: theluckywp
3
  Donate link: https://theluckywp.com/product/table-of-contents/
4
  Tags: table of contents, toc, navigation, links, seo
5
  Requires at least: 4.7
6
- Tested up to: 5.2.2
7
- Stable tag: 1.9.7
8
  Requires PHP: 5.6.20
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -151,6 +151,9 @@ For non-English websites it is recommended to enable the `Intl` PHP extension.
151
 
152
  == Changelog ==
153
 
 
 
 
154
  = 1.9.7 — 2019-10-17 =
155
  * Fixed: in some cases the widget was displayed incorrectly.
156
 
3
  Donate link: https://theluckywp.com/product/table-of-contents/
4
  Tags: table of contents, toc, navigation, links, seo
5
  Requires at least: 4.7
6
+ Tested up to: 5.3
7
+ Stable tag: 1.9.8
8
  Requires PHP: 5.6.20
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
151
 
152
  == Changelog ==
153
 
154
+ = 1.9.8 — 2019-10-23 =
155
+ * Minor fixes for compatibility with WordPress 5.3.
156
+
157
  = 1.9.7 — 2019-10-17 =
158
  * Fixed: in some cases the widget was displayed incorrectly.
159