LuckyWP Table of Contents - Version 1.5.2

Version Description

  • Added hook filter lwptoc_heading_id.
  • Implemented classic behavior on click "Back" in browser.
Download this release

Release Info

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

Code changes from version 1.5.1 to 1.5.2

admin/Admin.php CHANGED
@@ -4,6 +4,7 @@ namespace luckywp\tableOfContents\admin;
4
 
5
  use luckywp\tableOfContents\admin\controllers\EditorBlockController;
6
  use luckywp\tableOfContents\admin\controllers\MetaboxController;
 
7
  use luckywp\tableOfContents\admin\controllers\SettingsController;
8
  use luckywp\tableOfContents\admin\controllers\ShortcodeController;
9
  use luckywp\tableOfContents\admin\controllers\WidgetController;
@@ -39,6 +40,7 @@ class Admin extends BaseObject
39
  ShortcodeController::getInstance();
40
  EditorBlockController::getInstance();
41
  WidgetController::getInstance();
 
42
  }
43
  }
44
 
4
 
5
  use luckywp\tableOfContents\admin\controllers\EditorBlockController;
6
  use luckywp\tableOfContents\admin\controllers\MetaboxController;
7
+ use luckywp\tableOfContents\admin\controllers\RateController;
8
  use luckywp\tableOfContents\admin\controllers\SettingsController;
9
  use luckywp\tableOfContents\admin\controllers\ShortcodeController;
10
  use luckywp\tableOfContents\admin\controllers\WidgetController;
40
  ShortcodeController::getInstance();
41
  EditorBlockController::getInstance();
42
  WidgetController::getInstance();
43
+ RateController::getInstance();
44
  }
45
  }
46
 
admin/Rate.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace luckywp\tableOfContents\admin;
4
+
5
+ use luckywp\tableOfContents\core\base\BaseObject;
6
+ use luckywp\tableOfContents\core\Core;
7
+
8
+ class Rate extends BaseObject
9
+ {
10
+
11
+ const LINK = 'https://wordpress.org/support/plugin/luckywp-table-of-contents/reviews/?rate=5#new-post';
12
+
13
+ private $_isShow;
14
+
15
+ /**
16
+ * @return bool
17
+ */
18
+ public function isShow()
19
+ {
20
+ if ($this->_isShow === null) {
21
+ if (current_user_can('manage_options')) {
22
+ $time = Core::$plugin->options->get('rate_time');
23
+ if ($time === false) {
24
+ Core::$plugin->options->set('rate_time', time() + DAY_IN_SECONDS);
25
+ $this->_isShow = false;
26
+ } else {
27
+ $this->_isShow = time() > $time;
28
+ }
29
+ } else {
30
+ $this->_isShow = false;
31
+ }
32
+ }
33
+ return $this->_isShow;
34
+ }
35
+
36
+ public function rate()
37
+ {
38
+ Core::$plugin->options->set('rate_time', time() + YEAR_IN_SECONDS);
39
+ }
40
+
41
+ public function alreadyRate()
42
+ {
43
+ Core::$plugin->options->set('rate_time', time() + YEAR_IN_SECONDS);
44
+ }
45
+
46
+ public function showLater()
47
+ {
48
+ Core::$plugin->options->set('rate_time', time() + WEEK_IN_SECONDS);
49
+ }
50
+ }
admin/assets/main.min.css CHANGED
@@ -1 +1 @@
1
- @keyframes lwptocLightSpinnerKeyFrames{0%,100%,20%,80%{transform:scale(.7)}50%{transform:scale(1.5)}}.lwptocLightSpinner{display:inline-block;position:relative;width:64px;height:64px}.lwptocLightSpinner div{position:absolute;width:5px;height:5px;background:#fff;border-radius:50%;animation:lwptocLightSpinnerKeyFrames 1.2s linear infinite}.lwptocLightSpinner div:nth-child(1){animation-delay:0s;top:29px;left:53px}.lwptocLightSpinner div:nth-child(2){animation-delay:-.1s;top:18px;left:50px}.lwptocLightSpinner div:nth-child(3){animation-delay:-.2s;top:9px;left:41px}.lwptocLightSpinner div:nth-child(4){animation-delay:-.3s;top:6px;left:29px}.lwptocLightSpinner div:nth-child(5){animation-delay:-.4s;top:9px;left:18px}.lwptocLightSpinner div:nth-child(6){animation-delay:-.5s;top:18px;left:9px}.lwptocLightSpinner div:nth-child(7){animation-delay:-.6s;top:29px;left:6px}.lwptocLightSpinner div:nth-child(8){animation-delay:-.7s;top:41px;left:9px}.lwptocLightSpinner div:nth-child(9){animation-delay:-.8s;top:50px;left:18px}.lwptocLightSpinner div:nth-child(10){animation-delay:-.9s;top:53px;left:29px}.lwptocLightSpinner div:nth-child(11){animation-delay:-1s;top:50px;left:41px}.lwptocLightSpinner div:nth-child(12){animation-delay:-1.1s;top:41px;left:50px}@keyframes lwptocDarkSpinnerKeyFrames{0%,100%,20%,80%{transform:scale(.7)}50%{transform:scale(1.5)}}.lwptocDarkSpinner{display:inline-block;position:relative;width:64px;height:64px}.lwptocDarkSpinner div{position:absolute;width:5px;height:5px;background:#aaa;border-radius:50%;animation:lwptocDarkSpinnerKeyFrames 1.2s linear infinite}.lwptocDarkSpinner div:nth-child(1){animation-delay:0s;top:29px;left:53px}.lwptocDarkSpinner div:nth-child(2){animation-delay:-.1s;top:18px;left:50px}.lwptocDarkSpinner div:nth-child(3){animation-delay:-.2s;top:9px;left:41px}.lwptocDarkSpinner div:nth-child(4){animation-delay:-.3s;top:6px;left:29px}.lwptocDarkSpinner div:nth-child(5){animation-delay:-.4s;top:9px;left:18px}.lwptocDarkSpinner div:nth-child(6){animation-delay:-.5s;top:18px;left:9px}.lwptocDarkSpinner div:nth-child(7){animation-delay:-.6s;top:29px;left:6px}.lwptocDarkSpinner div:nth-child(8){animation-delay:-.7s;top:41px;left:9px}.lwptocDarkSpinner div:nth-child(9){animation-delay:-.8s;top:50px;left:18px}.lwptocDarkSpinner div:nth-child(10){animation-delay:-.9s;top:53px;left:29px}.lwptocDarkSpinner div:nth-child(11){animation-delay:-1s;top:50px;left:41px}.lwptocDarkSpinner div:nth-child(12){animation-delay:-1.1s;top:41px;left:50px}.lwptocPreloaderWrapper{position:relative!important}.lwptocPreloaderOverlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:50;background:rgba(255,255,255,.7)}.lwptocPreloaderOverlay>DIV{position:absolute;top:50%;left:50%;margin-left:-32px;margin-top:-32px}.lwptocModal-container,.lwptocModal-overlay{position:fixed;left:0;top:0;right:0;bottom:0;z-index:1000}.lwptocModal-container{overflow:auto}.lwptocModal-container_i{display:table;height:100%;margin:0 auto}.lwptocModal-container_i2{display:table-cell;padding:24px}.lwptocModal-error{padding:20px;border-radius:10px;background:#000;color:#fff}.lwptocModal-preloader{width:80px;height:80px;border-radius:10px;background:#000 url(preloader.gif) no-repeat 50% 50%}.lwptocModalBox{position:relative;width:500px;background:#fff;color:#000;box-shadow:0 3px 6px rgba(0,0,0,.3)}.lwptocModalBox_close{position:absolute;top:4px;right:8px;color:#666;text-align:center;line-height:29px;width:29px;height:29px;cursor:pointer}.lwptocModalBox_close:before{content:'\f158';font:normal 20px/29px dashicons}.lwptocModalBox_close:hover{color:#00a0d2}.lwptocModalBox_title{background:#fcfcfc;border-bottom:1px solid #dfdfdf;font-weight:600;font-size:13px;line-height:19px;padding:8px 29px 10px 18px}.lwptocModalBox_body{padding:18px 18px 22px 18px}.lwptocModalBox_footer{padding:18px;border-top:1px solid #dfdfdf}.lwptocModalBox_footer_buttons{text-align:right}.lwptocModalBox_footer_buttons .button{margin-left:4px}.lwptocModalBox_footer_buttons .button:first-child{margin-left:0}.lwptocModalBox_footer_buttons:after{content:".";display:block;height:0;font-size:0;line-height:0;clear:both;visibility:hidden}.lwptocMetabox P{padding:0;margin:12px 0 0!important}.lwptocMetabox P:first-child{margin-top:0}.lwptocMetabox .button-link{margin-left:12px}.lwptocMetabox_settings{margin:6px 0 18px;padding:6px 0 6px 4px;box-shadow:-2px 0 0 #fafafa,-4px 0 0 #ddd,4px 0 0 #fafafa;background:#fafafa}.lwptocMetabox_settings_item{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-top:4px}.lwptocMetabox_settings_item:first-child{margin-top:0}.lwptocMetabox_settings_item B{font-weight:400;color:#888}.lwptocMetabox_settings_item .lwptocColorBadge B{position:relative;top:1px;margin-left:2px}.lwptocWidget{padding-bottom:12px}.lwptocWidget P{padding:0;margin:12px 0 0!important}.lwptocWidget P:first-child{margin-top:0}.lwptocWidget_settings{margin:6px 0 18px;padding:6px 0 6px 4px;box-shadow:-2px 0 0 #fafafa,-4px 0 0 #ddd,4px 0 0 #fafafa;background:#fafafa}.lwptocWidget_settings_item{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-top:4px}.lwptocWidget_settings_item:first-child{margin-top:0}.lwptocWidget_settings_item B{font-weight:400;color:#888}.lwptocWidget_settings_item .lwptocColorBadge B{position:relative;top:1px;margin-left:2px}.lwptocCustomize .lwptocModalBox_body{padding:0 0 22px}.lwptocCustomize_errors{margin:14px;border-left:2px solid red;background:#fff4f6;padding:4px 12px 6px;color:red}.lwptocCustomize_errors P{margin:2px 0 0 0}.lwptocCustomize_errors P:first-child{margin-top:0}.lwptocCustomize_tabs{padding:0 14px;margin-top:12px;background:#f1f1f1}.lwptocCustomize_tabs:after{content:".";display:block;height:0;font-size:0;line-height:0;clear:both;visibility:hidden}.lwptocCustomize_tab{float:left;white-space:nowrap;padding:6px 12px 7px;cursor:pointer}.lwptocCustomize_tab:hover{background:#ddd}.lwptocCustomize_tab-active{background:#0073aa!important;color:#fff;cursor:default}.lwptocCustomize_fields{display:none;padding:16px 18px 0}.lwptocCustomize_field{position:relative;margin-top:12px}.lwptocCustomize_field:first-child{margin-top:0}.lwptocCustomize_field_label{font-weight:700}.lwptocCustomize_field_default{float:right;margin-left:4px;cursor:pointer;color:#0073aa;border-bottom:1px dotted #0073aa}.lwptocCustomize_field_default:hover{color:#00a0d2;border-color:#00a0d2}.lwptocCustomize_field_override{display:none;position:absolute;left:-4px;top:-4px;right:-4px;bottom:-4px;background:rgba(42,150,204,.8);color:#fff;font-size:16px;font-weight:700;text-align:center;padding-top:12px;cursor:pointer;-webkit-transition:.1s linear;-moz-transition:.1s linear;-o-transition:.1s linear;transition:.1s linear;opacity:0}.lwptocCustomize_field_defaultValue{display:none;font-size:16px;line-height:20px;font-style:italic;color:#aaa}.lwptocCustomize_field_el{margin-top:4px}.lwptocCustomize_field_el_select,.lwptocCustomize_field_el_textInput{width:100%}.lwptocCustomize_field_desc{margin-top:2px;font-size:90%;color:#888}.lwptocCustomize_field-default .lwptocCustomize_field_default,.lwptocCustomize_field-default .lwptocCustomize_field_el{display:none}.lwptocCustomize_field-default .lwptocCustomize_field_defaultValue,.lwptocCustomize_field-default .lwptocCustomize_field_override{display:block}.lwptocCustomize_field-default .lwptocCustomize_field_desc{margin-top:0}.lwptocCustomize_field-default:hover .lwptocCustomize_field_override{opacity:1}.lwptocWidthField_custom{display:inline}.lwptocWidthField_sizeInput{vertical-align:top;width:64px;padding-bottom:4px;text-align:center}.lwptocWidthField_unitInput{vertical-align:top}.lwptocFontSizeField_custom{display:inline}.lwptocFontSizeField_sizeInput{vertical-align:top;width:64px;padding-bottom:4px;text-align:center}.lwptocFontSizeField_unitInput{vertical-align:top}.lwptocSkipHeadingLevelField LABEL{margin-right:12px}.lwptocModalSuccess{text-align:center;cursor:default;color:#8bc34a}.lwptocModalSuccess_ico{font-family:dashicons;font-size:160px;line-height:124px}.lwptocModalSuccess_text{color:#fff;font-size:24px;line-height:30px}.lwptocColorBadge B{display:inline-block;margin-right:4px;width:12px;height:12px;border-radius:6px}.lwptocFloatLeft{float:left}.lwptocEditorBlock{display:block;padding:12px 16px 13px;border:2px dashed #ddd;background:#fff;color:#333;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif}.lwptocEditorBlock_title{font-size:14px;line-height:18px;font-weight:700}.lwptocEditorBlock_title-loading{color:#aaa}.lwptocEditorBlock_items{margin-top:4px;font-size:12px;line-height:16px}.lwptocEditorBlock_item{margin-top:2px}.lwptocEditorBlock_item:first-child{margin-top:0}.lwptocEditorBlock_item_label{color:#888}.lwptocEditorBlock .lwptocColorBadge B{position:relative;top:1px;margin-left:2px}.mce-i-lwptocButton:before{font:400 20px/1 dashicons;content:"\f163"}
1
+ @keyframes lwptocLightSpinnerKeyFrames{0%,100%,20%,80%{transform:scale(.7)}50%{transform:scale(1.5)}}.lwptocLightSpinner{display:inline-block;position:relative;width:64px;height:64px}.lwptocLightSpinner div{position:absolute;width:5px;height:5px;background:#fff;border-radius:50%;animation:lwptocLightSpinnerKeyFrames 1.2s linear infinite}.lwptocLightSpinner div:nth-child(1){animation-delay:0s;top:29px;left:53px}.lwptocLightSpinner div:nth-child(2){animation-delay:-.1s;top:18px;left:50px}.lwptocLightSpinner div:nth-child(3){animation-delay:-.2s;top:9px;left:41px}.lwptocLightSpinner div:nth-child(4){animation-delay:-.3s;top:6px;left:29px}.lwptocLightSpinner div:nth-child(5){animation-delay:-.4s;top:9px;left:18px}.lwptocLightSpinner div:nth-child(6){animation-delay:-.5s;top:18px;left:9px}.lwptocLightSpinner div:nth-child(7){animation-delay:-.6s;top:29px;left:6px}.lwptocLightSpinner div:nth-child(8){animation-delay:-.7s;top:41px;left:9px}.lwptocLightSpinner div:nth-child(9){animation-delay:-.8s;top:50px;left:18px}.lwptocLightSpinner div:nth-child(10){animation-delay:-.9s;top:53px;left:29px}.lwptocLightSpinner div:nth-child(11){animation-delay:-1s;top:50px;left:41px}.lwptocLightSpinner div:nth-child(12){animation-delay:-1.1s;top:41px;left:50px}@keyframes lwptocDarkSpinnerKeyFrames{0%,100%,20%,80%{transform:scale(.7)}50%{transform:scale(1.5)}}.lwptocDarkSpinner{display:inline-block;position:relative;width:64px;height:64px}.lwptocDarkSpinner div{position:absolute;width:5px;height:5px;background:#aaa;border-radius:50%;animation:lwptocDarkSpinnerKeyFrames 1.2s linear infinite}.lwptocDarkSpinner div:nth-child(1){animation-delay:0s;top:29px;left:53px}.lwptocDarkSpinner div:nth-child(2){animation-delay:-.1s;top:18px;left:50px}.lwptocDarkSpinner div:nth-child(3){animation-delay:-.2s;top:9px;left:41px}.lwptocDarkSpinner div:nth-child(4){animation-delay:-.3s;top:6px;left:29px}.lwptocDarkSpinner div:nth-child(5){animation-delay:-.4s;top:9px;left:18px}.lwptocDarkSpinner div:nth-child(6){animation-delay:-.5s;top:18px;left:9px}.lwptocDarkSpinner div:nth-child(7){animation-delay:-.6s;top:29px;left:6px}.lwptocDarkSpinner div:nth-child(8){animation-delay:-.7s;top:41px;left:9px}.lwptocDarkSpinner div:nth-child(9){animation-delay:-.8s;top:50px;left:18px}.lwptocDarkSpinner div:nth-child(10){animation-delay:-.9s;top:53px;left:29px}.lwptocDarkSpinner div:nth-child(11){animation-delay:-1s;top:50px;left:41px}.lwptocDarkSpinner div:nth-child(12){animation-delay:-1.1s;top:41px;left:50px}.lwptocPreloaderWrapper{position:relative!important}.lwptocPreloaderOverlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:50;background:rgba(255,255,255,.7)}.lwptocPreloaderOverlay>DIV{position:absolute;top:50%;left:50%;margin-left:-32px;margin-top:-32px}.lwptocModal-container,.lwptocModal-overlay{position:fixed;left:0;top:0;right:0;bottom:0;z-index:1000}.lwptocModal-container{overflow:auto}.lwptocModal-container_i{display:table;height:100%;margin:0 auto}.lwptocModal-container_i2{display:table-cell;padding:24px}.lwptocModal-error{padding:20px;border-radius:10px;background:#000;color:#fff}.lwptocModal-preloader{width:80px;height:80px;border-radius:10px;background:#000 url(preloader.gif) no-repeat 50% 50%}.lwptocModalBox{position:relative;width:500px;background:#fff;color:#000;box-shadow:0 3px 6px rgba(0,0,0,.3)}.lwptocModalBox_close{position:absolute;top:4px;right:8px;color:#666;text-align:center;line-height:29px;width:29px;height:29px;cursor:pointer}.lwptocModalBox_close:before{content:'\f158';font:normal 20px/29px dashicons}.lwptocModalBox_close:hover{color:#00a0d2}.lwptocModalBox_title{background:#fcfcfc;border-bottom:1px solid #dfdfdf;font-weight:600;font-size:13px;line-height:19px;padding:8px 29px 10px 18px}.lwptocModalBox_body{padding:18px 18px 22px 18px}.lwptocModalBox_footer{padding:18px;border-top:1px solid #dfdfdf}.lwptocModalBox_footer_buttons{text-align:right}.lwptocModalBox_footer_buttons .button{margin-left:4px}.lwptocModalBox_footer_buttons .button:first-child{margin-left:0}.lwptocModalBox_footer_buttons:after{content:".";display:block;height:0;font-size:0;line-height:0;clear:both;visibility:hidden}.lwptocMetabox P{padding:0;margin:12px 0 0!important}.lwptocMetabox P:first-child{margin-top:0}.lwptocMetabox .button-link{margin-left:12px}.lwptocMetabox_settings{margin:6px 0 18px;padding:6px 0 6px 4px;box-shadow:-2px 0 0 #fafafa,-4px 0 0 #ddd,4px 0 0 #fafafa;background:#fafafa}.lwptocMetabox_settings_item{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-top:4px}.lwptocMetabox_settings_item:first-child{margin-top:0}.lwptocMetabox_settings_item B{font-weight:400;color:#888}.lwptocMetabox_settings_item .lwptocColorBadge B{position:relative;top:1px;margin-left:2px}.lwptocWidget{padding-bottom:12px}.lwptocWidget P{padding:0;margin:12px 0 0!important}.lwptocWidget P:first-child{margin-top:0}.lwptocWidget_settings{margin:6px 0 18px;padding:6px 0 6px 4px;box-shadow:-2px 0 0 #fafafa,-4px 0 0 #ddd,4px 0 0 #fafafa;background:#fafafa}.lwptocWidget_settings_item{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-top:4px}.lwptocWidget_settings_item:first-child{margin-top:0}.lwptocWidget_settings_item B{font-weight:400;color:#888}.lwptocWidget_settings_item .lwptocColorBadge B{position:relative;top:1px;margin-left:2px}.lwptocCustomize .lwptocModalBox_body{padding:0 0 22px}.lwptocCustomize_errors{margin:14px;border-left:2px solid red;background:#fff4f6;padding:4px 12px 6px;color:red}.lwptocCustomize_errors P{margin:2px 0 0 0}.lwptocCustomize_errors P:first-child{margin-top:0}.lwptocCustomize_tabs{padding:0 14px;margin-top:12px;background:#f1f1f1}.lwptocCustomize_tabs:after{content:".";display:block;height:0;font-size:0;line-height:0;clear:both;visibility:hidden}.lwptocCustomize_tab{float:left;white-space:nowrap;padding:6px 12px 7px;cursor:pointer}.lwptocCustomize_tab:hover{background:#ddd}.lwptocCustomize_tab-active{background:#0073aa!important;color:#fff;cursor:default}.lwptocCustomize_fields{display:none;padding:16px 18px 0}.lwptocCustomize_field{position:relative;margin-top:12px}.lwptocCustomize_field:first-child{margin-top:0}.lwptocCustomize_field_label{font-weight:700}.lwptocCustomize_field_default{float:right;margin-left:4px;cursor:pointer;color:#0073aa;border-bottom:1px dotted #0073aa}.lwptocCustomize_field_default:hover{color:#00a0d2;border-color:#00a0d2}.lwptocCustomize_field_override{display:none;position:absolute;left:-4px;top:-4px;right:-4px;bottom:-4px;background:rgba(42,150,204,.8);color:#fff;font-size:16px;font-weight:700;text-align:center;padding-top:12px;cursor:pointer;-webkit-transition:.1s linear;-moz-transition:.1s linear;-o-transition:.1s linear;transition:.1s linear;opacity:0}.lwptocCustomize_field_defaultValue{display:none;font-size:16px;line-height:20px;font-style:italic;color:#aaa}.lwptocCustomize_field_el{margin-top:4px}.lwptocCustomize_field_el_select,.lwptocCustomize_field_el_textInput{width:100%}.lwptocCustomize_field_desc{margin-top:2px;font-size:90%;color:#888}.lwptocCustomize_field-default .lwptocCustomize_field_default,.lwptocCustomize_field-default .lwptocCustomize_field_el{display:none}.lwptocCustomize_field-default .lwptocCustomize_field_defaultValue,.lwptocCustomize_field-default .lwptocCustomize_field_override{display:block}.lwptocCustomize_field-default .lwptocCustomize_field_desc{margin-top:0}.lwptocCustomize_field-default:hover .lwptocCustomize_field_override{opacity:1}.lwptocWidthField_custom{display:inline}.lwptocWidthField_sizeInput{vertical-align:top;width:64px;padding-bottom:4px;text-align:center}.lwptocWidthField_unitInput{vertical-align:top}.lwptocFontSizeField_custom{display:inline}.lwptocFontSizeField_sizeInput{vertical-align:top;width:64px;padding-bottom:4px;text-align:center}.lwptocFontSizeField_unitInput{vertical-align:top}.lwptocSkipHeadingLevelField LABEL{margin-right:12px}.lwptocModalSuccess{text-align:center;cursor:default;color:#8bc34a}.lwptocModalSuccess_ico{font-family:dashicons;font-size:160px;line-height:124px}.lwptocModalSuccess_text{color:#fff;font-size:24px;line-height:30px}.lwptocColorBadge B{display:inline-block;margin-right:4px;width:12px;height:12px;border-radius:6px}.lwptocFloatLeft{float:left}.lwptocEditorBlock{display:block;padding:12px 16px 13px;border:2px dashed #ddd;background:#fff;color:#333;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif}.lwptocEditorBlock_title{font-size:14px;line-height:18px;font-weight:700}.lwptocEditorBlock_title-loading{color:#aaa}.lwptocEditorBlock_items{margin-top:4px;font-size:12px;line-height:16px}.lwptocEditorBlock_item{margin-top:2px}.lwptocEditorBlock_item:first-child{margin-top:0}.lwptocEditorBlock_item_label{color:#888}.lwptocEditorBlock .lwptocColorBadge B{position:relative;top:1px;margin-left:2px}.lwptocSettingsRate{float:right;margin-top:19px}@media screen and (max-width:960px){.lwptocSettingsRate{display:none}}.lwptocRate .button{margin-left:12px}.lwptocRate .button:first-child{margin-left:0}.mce-i-lwptocButton:before{font:400 20px/1 dashicons;content:"\f163"}
admin/assets/main.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){var o="lwptocPreloader";e.fn[o+"Show"]=function(){var t=e(this);t.addClass(o+"Wrapper"),t.append('<div class="'+o+'Overlay"><div class="lwptocDarkSpinner"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div></div>')},e.fn[o+"Hide"]=function(){var t=e(this);t.removeClass(o+"Wrapper"),t.find("."+o+"Overlay").remove()}}(jQuery),function(r,t){var l="lwptocModal",e={type:"html",content:"",url:"",ajax:{},ajaxRequest:null,closeOnEsc:!0,closeOnOverlayClick:!0,clone:!1,overlay:{block:void 0,tpl:'<div class="'+l+'-overlay"></div>',css:{backgroundColor:"#000",opacity:.6,zIndex:1e5}},container:{block:void 0,tpl:'<div class="'+l+'-container"><div class="'+l+'-container_i"><div class="'+l+'-container_i2"></div></div></div>'},preloader:{verticalAlign:void 0,tpl:'<div class="'+l+'-preloader" />'},wrap:void 0,body:void 0,errors:{tpl:'<div class="'+l+"-error "+l+'-close"></div>',autocloseDelay:2e3,ajaxUnsuccessfulLoad:"Error"},openEffect:{type:"fade",speed:400},closeEffect:{type:"fade",speed:400},width:"auto",verticalAlign:"middle",beforeOpen:r.noop,afterOpen:r.noop,beforeClose:r.noop,afterClose:r.noop,afterLoading:r.noop,afterLoadingOnShow:r.noop,errorLoading:r.noop},d=0,s=r([]),u=function(t,e){var o=!0;return r(t).each(function(){r(e.target).get(0)==r(this).get(0)&&(o=!1),0==r(e.target).closest("HTML",r(this).get(0)).length&&(o=!1)}),o},i={getParentEl:function(t){var e=r(t);return e.data(l)?e:(e=r(t).closest("."+l+"-container").data(l+"ParentEl"))||!1},transition:function(t,e,o,n){switch(n=null==n?r.noop:n,o.type){case"fade":"show"==e?t.fadeIn(o.speed,n):t.fadeOut(o.speed,n);break;case"none":"show"==e?t.show():t.hide(),n()}},setWrapMarginRight:function(t,e){t.wrap.css("marginRight",e+"px"),r(document).trigger(l+"_setWrapMarginRight",e)},initEl:function(e,t){var o=e.data(l);if(!o){if(d++,(o=t).modalID=d,o.overlay.block=r(o.overlay.tpl),o.overlay.block.css(o.overlay.css),o.container.block=r(o.container.tpl),o.body=r("."+l+"-container_i2",o.container.block),t.clone?o.body.html(e.clone(!0)):(e.before('<div id="'+l+"Reserve"+o.modalID+'" style="display: none" />'),o.body.html(e)),o.body.on("click","."+l+"-close",function(){return e[l]("close"),!1}),o.closeOnOverlayClick&&o.overlay.block.add(o.container.block).click(function(t){u(r(">*",o.body),t)&&e[l]("close")}),o.container.block.data(l+"ParentEl",e),e.data(l,o),s=r.merge(s,e),r.proxy(p.show,e)(),"html"==o.type)return e;if(null!=o.ajax.beforeSend){var n=o.ajax.beforeSend;delete o.ajax.beforeSend}if(null!=o.ajax.success){var i=o.ajax.success;delete o.ajax.success}if(null!=o.ajax.error){var a=o.ajax.error;delete o.ajax.error}var c=r.extend(!0,{url:o.url,beforeSend:function(){o.body.html(o.preloader.tpl).css("verticalAlign",void 0===o.preloader.verticalAlign?o.verticalAlign:o.preloader.verticalAlign),void 0!==n&&n(o,e)},success:function(t){e.trigger("afterLoading."+l),t=o.afterLoading(o,e,t)||t,o.body.css("verticalAlign",o.verticalAlign),null==i?o.body.html(t):i(o,e,t),e.trigger("afterLoadingOnShow."+l),o.afterLoadingOnShow(o,e,t)},error:function(){e.trigger("errorLoading."+l),o.errorLoading(o,e),null==a?(o.body.html(o.errors.tpl),r("."+l+"-error",o.body).html(o.errors.ajaxUnsuccessfulLoad),r("."+l+"-close",o.body).click(function(){return e[l]("close"),!1}),o.errors.autocloseDelay&&setTimeout(function(){e[l]("close")},o.errors.autocloseDelay)):a(o,e)}},o.ajax);o.ajaxRequest=r.ajax(c),e.data(l,o)}},init:function(t){return t=r.extend(!0,{},e,t),r.isFunction(this)?null==t?void r.error(l+": Uncorrect parameters"):""!=t.url?(t.type="ajax",i.initEl(r("<div />"),t)):""!=t.content?(t.type="html",i.initEl(r(t.content),t)):void r.error(l+': Set parameter "url" or "content"'):this.each(function(){i.initEl(r(this),r.extend(!0,{},t))})}},p={show:function(){var t=i.getParentEl(this);if(!1!==t){var e=t.data(l);if(e.overlay.block.hide(),e.container.block.hide(),r("BODY").append(e.overlay.block),r("BODY").append(e.container.block),e.container.block.css("zIndex",e.overlay.block.css("zIndex")),e.beforeOpen(e,t),t.trigger("beforeOpen."+l),"hidden"!=e.wrap.css("overflow-y")){e.wrap.data(l+"Overflow",e.wrap.css("overflow-y"));var o=e.wrap.outerWidth(!0);e.wrap.css("overflow-y","hidden");var n=e.wrap.outerWidth(!0);n!=o&&i.setWrapMarginRight(e,n-o)}return s.not(t).each(function(){r(this).data(l).overlay.block.hide()}),e.body.css("verticalAlign",e.verticalAlign),e.body.parent().css("width",e.width),i.transition(e.overlay.block,"show",1<s.length?{type:"none"}:e.openEffect),i.transition(e.container.block,"show",1<s.length?{type:"none"}:e.openEffect,function(){e.afterOpen(e,t),t.trigger("afterOpen."+l)}),t}r.error(l+": Uncorrect call")},close:function(){if(!r.isFunction(this))return this.each(function(){var t=i.getParentEl(this);if(!1!==t){var e=t.data(l);!1!==e.beforeClose(e,t)&&(t.trigger("beforeClose."+l),s.not(t).last().each(function(){r(this).data(l).overlay.block.show()}),i.transition(e.overlay.block,"hide",1<s.length?{type:"none"}:e.closeEffect),i.transition(e.container.block,"hide",1<s.length?{type:"none"}:e.closeEffect,function(){e.afterClose(e,t),t.trigger("afterClose."+l),e.clone||r("#"+l+"Reserve"+e.modalID).replaceWith(e.body.find(">*")),e.overlay.block.remove(),e.container.block.remove(),t.data(l,null),r("."+l+"-container").length||(e.wrap.data(l+"Overflow")&&e.wrap.css("overflow-y",e.wrap.data(l+"Overflow")),i.setWrapMarginRight(e,0))}),"ajax"==e.type&&e.ajaxRequest.abort(),s=s.not(t))}else r.error(l+": Uncorrect call")});s.each(function(){r(this)[l]("close")})},getActive:function(){var t=r("."+l+"-container").last();return!!t.length&&t.data(l+"ParentEl").data(l)},setDefault:function(t){r.extend(!0,e,t)}};r(function(){e.wrap=r(document.all&&!document.querySelector?"html":"body")}),r(document).bind("keyup."+l,function(t){var e=s.last();e.length&&(e.data(l).closeOnEsc&&27===t.keyCode&&e[l]("close"))}),r[l]=r.fn[l]=function(t){return p[t]?p[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void r.error(l+": Method "+t+" does not exist"):i.init.apply(this,arguments)}}(jQuery),function(n,t){var i="lwptocAjaxForm",e={afterInit:n.noop,beforeSend:n.noop,success:n.noop,error:function(){alert("Failed to execute the query. Reload the page and try again.")},b:{}},a={isForm:function(t){return"form"==t.get(0).tagName.toLowerCase()},makeData:function(t){return a.isForm(t)?t.serialize():(e=t.clone().wrap("<form/>"),t.find("select").each(function(t){e.find("select").eq(t).val(n(this).val())}),e.serialize());var e},submit:function(t,e){n.ajax({type:"POST",cache:!1,data:a.makeData(t),url:a.isForm(t)?t.attr("action"):t.data("action"),beforeSend:function(){e.beforeSend(e,t)},success:function(t){e.b.container.html(t),e.success(e)},error:function(){e.error(e,t)}})},initContainer:function(t,e){var o=t.data(i);o||(o=e,t.data(i,o),(o.b.container=t).on("submit","[data-ajax-form]",function(){return a.submit(n(this),o),!1}),o.afterInit(o))},init:function(t){return t=n.extend(!0,{},e,t),n.isFunction(this)?(n.error(i+": Uncorrect call"),!1):this.each(function(){a.initContainer(n(this),n.extend(!0,{},t))})}},o={setDefault:function(t){n.extend(!0,e,t)}};n[i]=n.fn[i]=function(t){return o[t]?o[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?(n.error(i+": Method "+t+" does not exist"),!1):a.init.apply(this,arguments)}}(jQuery),function(r){r.lwptocModal("setDefault",{preloader:{tpl:'<div class="lwptocLightSpinner"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>'},overlay:{css:{zIndex:999999}}}),r(function(){var t=r(".js-lwptocSmoothScrollCheckbox");if(t.length){var e=r(".js-lwptocSmoothScrollIOffsetInput").closest("TR");t.change(function(){t.prop("checked")?e.show():e.hide()}).change()}var o=r(".js-lwptocToggleCheckbox");if(o.length){var n=r(".js-lwptocToggleEl").closest("TR");o.change(function(){o.prop("checked")?n.show():n.hide()}).change()}var i=r(".js-lwptocAutoInsertEnableCheckbox");if(i.length){var a=r(".js-lwptocAutoInsertEl").closest("TR");i.change(function(){i.prop("checked")?a.show():a.hide()}).change()}var c=r(".lwptoc_colorPicker");c.length&&c.wpColorPicker()}),r.lwptocCustomize={init:function(e,o){n.init(e.find(".lwptocWidthField")),i.init(e.find(".lwptocFontSizeField")),e.find(".lwptoc_colorPicker").wpColorPicker(),e.on("click",".lwptocCustomize_field_override",function(){var t=r(this).closest(".lwptocCustomize_field");t.removeClass("lwptocCustomize_field-default"),t.find("INPUT[type=text]").focus(),t.find(".lwptocCustomize_field_inputDefault").val(0)}),e.on("click",".lwptocCustomize_field_default",function(){var t=r(this).closest(".lwptocCustomize_field");t.addClass("lwptocCustomize_field-default"),t.find(".lwptocCustomize_field_inputDefault").val(1)}),e.on("click",".lwptocCustomize_tab",function(){e.find(".lwptocCustomize_tab-active").removeClass("lwptocCustomize_tab-active"),r(this).addClass("lwptocCustomize_tab-active"),e.find(".lwptocCustomize_fields").hide(),e.find(".lwptocCustomize_fields-"+r(this).data("tab")).show()}),e.lwptocAjaxForm({beforeSend:function(){e.lwptocPreloaderShow()},success:function(t){e.lwptocPreloaderHide(),o()}})},show:function(t,e){t._ajax_nonce=lwptocMain.nonce,r.lwptocModal({url:lwptocMain.ajaxUrl,closeOnOverlayClick:!1,verticalAlign:"top",ajax:{data:t},afterLoadingOnShow:function(t){r.lwptocCustomize.init(t.body.find(".lwptocCustomize"),function(){t.body.lwptocModal("close")})},afterClose:e})}};var o={reload:function(t){var e=r(t);o.$container.replaceWith(e),o.init(e)},setEnabled:function(t){r.ajax({url:lwptocMain.ajaxUrl,data:{_ajax_nonce:lwptocMain.nonce,action:"lwptoc_metabox_set_enabled",postId:o.$container.data("postId"),enabled:t?1:0},beforeSend:function(){o.$container.lwptocPreloaderShow()},success:function(t){o.$container.lwptocPreloaderHide(),o.reload(t)}})},setProcessing:function(t){r.ajax({url:lwptocMain.ajaxUrl,data:{_ajax_nonce:lwptocMain.nonce,action:"lwptoc_metabox_set_processing",postId:o.$container.data("postId"),enabled:t?1:0},beforeSend:function(){o.$container.lwptocPreloaderShow()},success:function(t){o.$container.lwptocPreloaderHide(),o.reload(t)}})},init:function(){o.$container=r(".lwptocMetabox"),o.$container.length&&(o.$container.find(".lwptocMetabox_disable").click(function(){o.setEnabled(!1)}),o.$container.find(".lwptocMetabox_enable").click(function(){o.setEnabled(!0)}),o.$container.find(".lwptocMetabox_disableProcessing").click(function(){o.setProcessing(!1)}),o.$container.find(".lwptocMetabox_enableProcessing").click(function(){o.setProcessing(!0)}),o.$container.find(".lwptocMetabox_customize").click(function(){r.lwptocCustomize.show({action:"lwptoc_metabox_customize",postId:o.$container.data("postId")},r.noop)}),r(document).on("lwptocMetaboxCustomized",function(t,e){r(".lwptocCustomize-metabox").lwptocModal("close"),o.reload(e.metabox)}))}};r(function(){o.init()});var e={oneInited:!1,oneInit:function(){r(document).on("lwptocWidgetCustomized",function(t,e){r(".lwptocCustomize-metabox").lwptocModal("close"),r(".lwptocWidget-"+e.id+" .lwptocWidget_override").html(e.override),r(".lwptocWidget-"+e.id+" .lwptocWidget_input").val(e.value).change()})},init:function(){r(".lwptocWidget").each(function(){var t=r(this);t.data("inited")||(t.find(".lwptocWidget_customize").click(function(){r.lwptocCustomize.show({action:"lwptoc_widget_customize",value:t.find(".lwptocWidget_input").val(),widgetId:t.data("id")},r.noop)}),t.data("inited",1),e.oneInited||e.oneInit())})}};r.lwptocWidget=e;var n={update:function(t){"custom"==t.$typeInput.val()?(t.$input.val(t.$sizeInput.val()+t.$unitInput.val()),t.$custom.show()):(t.$input.val(t.$typeInput.val()),t.$custom.hide())},init:function(t){t.each(function(){var t={$container:r(this)};t.$typeInput=t.$container.find(".lwptocWidthField_typeInput"),t.$sizeInput=t.$container.find(".lwptocWidthField_sizeInput"),t.$unitInput=t.$container.find(".lwptocWidthField_unitInput"),t.$input=t.$container.find(".lwptocWidthField_input"),t.$custom=t.$container.find(".lwptocWidthField_custom"),t.$typeInput.add(t.$sizeInput).add(t.$unitInput).change(function(){n.update(t)})})}};r(function(){n.init(r(".lwptocWidthField"))});var i={update:function(t){"custom"==t.$typeInput.val()?(t.$input.val(t.$sizeInput.val()+t.$unitInput.val()),t.$custom.show()):(t.$input.val(t.$typeInput.val()),t.$custom.hide())},init:function(t){t.each(function(){var t={$container:r(this)};t.$typeInput=t.$container.find(".lwptocFontSizeField_typeInput"),t.$sizeInput=t.$container.find(".lwptocFontSizeField_sizeInput"),t.$unitInput=t.$container.find(".lwptocFontSizeField_unitInput"),t.$input=t.$container.find(".lwptocFontSizeField_input"),t.$custom=t.$container.find(".lwptocFontSizeField_custom"),t.$typeInput.add(t.$sizeInput).add(t.$unitInput).change(function(){i.update(t)})})}};r(function(){i.init(r(".lwptocFontSizeField"))})}(jQuery);
1
+ !function(e,t){var o="lwptocPreloader";e.fn[o+"Show"]=function(){var t=e(this);t.addClass(o+"Wrapper"),t.append('<div class="'+o+'Overlay"><div class="lwptocDarkSpinner"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div></div>')},e.fn[o+"Hide"]=function(){var t=e(this);t.removeClass(o+"Wrapper"),t.find("."+o+"Overlay").remove()}}(jQuery),function(r,t){var l="lwptocModal",e={type:"html",content:"",url:"",ajax:{},ajaxRequest:null,closeOnEsc:!0,closeOnOverlayClick:!0,clone:!1,overlay:{block:void 0,tpl:'<div class="'+l+'-overlay"></div>',css:{backgroundColor:"#000",opacity:.6,zIndex:1e5}},container:{block:void 0,tpl:'<div class="'+l+'-container"><div class="'+l+'-container_i"><div class="'+l+'-container_i2"></div></div></div>'},preloader:{verticalAlign:void 0,tpl:'<div class="'+l+'-preloader" />'},wrap:void 0,body:void 0,errors:{tpl:'<div class="'+l+"-error "+l+'-close"></div>',autocloseDelay:2e3,ajaxUnsuccessfulLoad:"Error"},openEffect:{type:"fade",speed:400},closeEffect:{type:"fade",speed:400},width:"auto",verticalAlign:"middle",beforeOpen:r.noop,afterOpen:r.noop,beforeClose:r.noop,afterClose:r.noop,afterLoading:r.noop,afterLoadingOnShow:r.noop,errorLoading:r.noop},d=0,s=r([]),u=function(t,e){var o=!0;return r(t).each(function(){r(e.target).get(0)==r(this).get(0)&&(o=!1),0==r(e.target).closest("HTML",r(this).get(0)).length&&(o=!1)}),o},i={getParentEl:function(t){var e=r(t);return e.data(l)?e:(e=r(t).closest("."+l+"-container").data(l+"ParentEl"))||!1},transition:function(t,e,o,n){switch(n=null==n?r.noop:n,o.type){case"fade":"show"==e?t.fadeIn(o.speed,n):t.fadeOut(o.speed,n);break;case"none":"show"==e?t.show():t.hide(),n()}},setWrapMarginRight:function(t,e){t.wrap.css("marginRight",e+"px"),r(document).trigger(l+"_setWrapMarginRight",e)},initEl:function(e,t){var o=e.data(l);if(!o){if(d++,(o=t).modalID=d,o.overlay.block=r(o.overlay.tpl),o.overlay.block.css(o.overlay.css),o.container.block=r(o.container.tpl),o.body=r("."+l+"-container_i2",o.container.block),t.clone?o.body.html(e.clone(!0)):(e.before('<div id="'+l+"Reserve"+o.modalID+'" style="display: none" />'),o.body.html(e)),o.body.on("click","."+l+"-close",function(){return e[l]("close"),!1}),o.closeOnOverlayClick&&o.overlay.block.add(o.container.block).click(function(t){u(r(">*",o.body),t)&&e[l]("close")}),o.container.block.data(l+"ParentEl",e),e.data(l,o),s=r.merge(s,e),r.proxy(p.show,e)(),"html"==o.type)return e;if(null!=o.ajax.beforeSend){var n=o.ajax.beforeSend;delete o.ajax.beforeSend}if(null!=o.ajax.success){var i=o.ajax.success;delete o.ajax.success}if(null!=o.ajax.error){var a=o.ajax.error;delete o.ajax.error}var c=r.extend(!0,{url:o.url,beforeSend:function(){o.body.html(o.preloader.tpl).css("verticalAlign",void 0===o.preloader.verticalAlign?o.verticalAlign:o.preloader.verticalAlign),void 0!==n&&n(o,e)},success:function(t){e.trigger("afterLoading."+l),t=o.afterLoading(o,e,t)||t,o.body.css("verticalAlign",o.verticalAlign),null==i?o.body.html(t):i(o,e,t),e.trigger("afterLoadingOnShow."+l),o.afterLoadingOnShow(o,e,t)},error:function(){e.trigger("errorLoading."+l),o.errorLoading(o,e),null==a?(o.body.html(o.errors.tpl),r("."+l+"-error",o.body).html(o.errors.ajaxUnsuccessfulLoad),r("."+l+"-close",o.body).click(function(){return e[l]("close"),!1}),o.errors.autocloseDelay&&setTimeout(function(){e[l]("close")},o.errors.autocloseDelay)):a(o,e)}},o.ajax);o.ajaxRequest=r.ajax(c),e.data(l,o)}},init:function(t){return t=r.extend(!0,{},e,t),r.isFunction(this)?null==t?void r.error(l+": Uncorrect parameters"):""!=t.url?(t.type="ajax",i.initEl(r("<div />"),t)):""!=t.content?(t.type="html",i.initEl(r(t.content),t)):void r.error(l+': Set parameter "url" or "content"'):this.each(function(){i.initEl(r(this),r.extend(!0,{},t))})}},p={show:function(){var t=i.getParentEl(this);if(!1!==t){var e=t.data(l);if(e.overlay.block.hide(),e.container.block.hide(),r("BODY").append(e.overlay.block),r("BODY").append(e.container.block),e.container.block.css("zIndex",e.overlay.block.css("zIndex")),e.beforeOpen(e,t),t.trigger("beforeOpen."+l),"hidden"!=e.wrap.css("overflow-y")){e.wrap.data(l+"Overflow",e.wrap.css("overflow-y"));var o=e.wrap.outerWidth(!0);e.wrap.css("overflow-y","hidden");var n=e.wrap.outerWidth(!0);n!=o&&i.setWrapMarginRight(e,n-o)}return s.not(t).each(function(){r(this).data(l).overlay.block.hide()}),e.body.css("verticalAlign",e.verticalAlign),e.body.parent().css("width",e.width),i.transition(e.overlay.block,"show",1<s.length?{type:"none"}:e.openEffect),i.transition(e.container.block,"show",1<s.length?{type:"none"}:e.openEffect,function(){e.afterOpen(e,t),t.trigger("afterOpen."+l)}),t}r.error(l+": Uncorrect call")},close:function(){if(!r.isFunction(this))return this.each(function(){var t=i.getParentEl(this);if(!1!==t){var e=t.data(l);!1!==e.beforeClose(e,t)&&(t.trigger("beforeClose."+l),s.not(t).last().each(function(){r(this).data(l).overlay.block.show()}),i.transition(e.overlay.block,"hide",1<s.length?{type:"none"}:e.closeEffect),i.transition(e.container.block,"hide",1<s.length?{type:"none"}:e.closeEffect,function(){e.afterClose(e,t),t.trigger("afterClose."+l),e.clone||r("#"+l+"Reserve"+e.modalID).replaceWith(e.body.find(">*")),e.overlay.block.remove(),e.container.block.remove(),t.data(l,null),r("."+l+"-container").length||(e.wrap.data(l+"Overflow")&&e.wrap.css("overflow-y",e.wrap.data(l+"Overflow")),i.setWrapMarginRight(e,0))}),"ajax"==e.type&&e.ajaxRequest.abort(),s=s.not(t))}else r.error(l+": Uncorrect call")});s.each(function(){r(this)[l]("close")})},getActive:function(){var t=r("."+l+"-container").last();return!!t.length&&t.data(l+"ParentEl").data(l)},setDefault:function(t){r.extend(!0,e,t)}};r(function(){e.wrap=r(document.all&&!document.querySelector?"html":"body")}),r(document).bind("keyup."+l,function(t){var e=s.last();e.length&&(e.data(l).closeOnEsc&&27===t.keyCode&&e[l]("close"))}),r[l]=r.fn[l]=function(t){return p[t]?p[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void r.error(l+": Method "+t+" does not exist"):i.init.apply(this,arguments)}}(jQuery),function(n,t){var i="lwptocAjaxForm",e={afterInit:n.noop,beforeSend:n.noop,success:n.noop,error:function(){alert("Failed to execute the query. Reload the page and try again.")},b:{}},a={isForm:function(t){return"form"==t.get(0).tagName.toLowerCase()},makeData:function(t){return a.isForm(t)?t.serialize():(e=t.clone().wrap("<form/>"),t.find("select").each(function(t){e.find("select").eq(t).val(n(this).val())}),e.serialize());var e},submit:function(t,e){n.ajax({type:"POST",cache:!1,data:a.makeData(t),url:a.isForm(t)?t.attr("action"):t.data("action"),beforeSend:function(){e.beforeSend(e,t)},success:function(t){e.b.container.html(t),e.success(e)},error:function(){e.error(e,t)}})},initContainer:function(t,e){var o=t.data(i);o||(o=e,t.data(i,o),(o.b.container=t).on("submit","[data-ajax-form]",function(){return a.submit(n(this),o),!1}),o.afterInit(o))},init:function(t){return t=n.extend(!0,{},e,t),n.isFunction(this)?(n.error(i+": Uncorrect call"),!1):this.each(function(){a.initContainer(n(this),n.extend(!0,{},t))})}},o={setDefault:function(t){n.extend(!0,e,t)}};n[i]=n.fn[i]=function(t){return o[t]?o[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?(n.error(i+": Method "+t+" does not exist"),!1):a.init.apply(this,arguments)}}(jQuery),function(r){r.lwptocModal("setDefault",{preloader:{tpl:'<div class="lwptocLightSpinner"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>'},overlay:{css:{zIndex:999999}}}),r(function(){var t=r(".js-lwptocSmoothScrollCheckbox");if(t.length){var e=r(".js-lwptocSmoothScrollIOffsetInput").closest("TR");t.change(function(){t.prop("checked")?e.show():e.hide()}).change()}var o=r(".js-lwptocToggleCheckbox");if(o.length){var n=r(".js-lwptocToggleEl").closest("TR");o.change(function(){o.prop("checked")?n.show():n.hide()}).change()}var i=r(".js-lwptocAutoInsertEnableCheckbox");if(i.length){var a=r(".js-lwptocAutoInsertEl").closest("TR");i.change(function(){i.prop("checked")?a.show():a.hide()}).change()}var c=r(".lwptoc_colorPicker");c.length&&c.wpColorPicker()}),r.lwptocCustomize={init:function(e,o){n.init(e.find(".lwptocWidthField")),i.init(e.find(".lwptocFontSizeField")),e.find(".lwptoc_colorPicker").wpColorPicker(),e.on("click",".lwptocCustomize_field_override",function(){var t=r(this).closest(".lwptocCustomize_field");t.removeClass("lwptocCustomize_field-default"),t.find("INPUT[type=text]").focus(),t.find(".lwptocCustomize_field_inputDefault").val(0)}),e.on("click",".lwptocCustomize_field_default",function(){var t=r(this).closest(".lwptocCustomize_field");t.addClass("lwptocCustomize_field-default"),t.find(".lwptocCustomize_field_inputDefault").val(1)}),e.on("click",".lwptocCustomize_tab",function(){e.find(".lwptocCustomize_tab-active").removeClass("lwptocCustomize_tab-active"),r(this).addClass("lwptocCustomize_tab-active"),e.find(".lwptocCustomize_fields").hide(),e.find(".lwptocCustomize_fields-"+r(this).data("tab")).show()}),e.lwptocAjaxForm({beforeSend:function(){e.lwptocPreloaderShow()},success:function(t){e.lwptocPreloaderHide(),o()}})},show:function(t,e){t._ajax_nonce=lwptocMain.nonce,r.lwptocModal({url:lwptocMain.ajaxUrl,closeOnOverlayClick:!1,verticalAlign:"top",ajax:{data:t},afterLoadingOnShow:function(t){r.lwptocCustomize.init(t.body.find(".lwptocCustomize"),function(){t.body.lwptocModal("close")})},afterClose:e})}};var o={reload:function(t){var e=r(t);o.$container.replaceWith(e),o.init(e)},setEnabled:function(t){r.ajax({url:lwptocMain.ajaxUrl,data:{_ajax_nonce:lwptocMain.nonce,action:"lwptoc_metabox_set_enabled",postId:o.$container.data("postId"),enabled:t?1:0},beforeSend:function(){o.$container.lwptocPreloaderShow()},success:function(t){o.$container.lwptocPreloaderHide(),o.reload(t)}})},setProcessing:function(t){r.ajax({url:lwptocMain.ajaxUrl,data:{_ajax_nonce:lwptocMain.nonce,action:"lwptoc_metabox_set_processing",postId:o.$container.data("postId"),enabled:t?1:0},beforeSend:function(){o.$container.lwptocPreloaderShow()},success:function(t){o.$container.lwptocPreloaderHide(),o.reload(t)}})},init:function(){o.$container=r(".lwptocMetabox"),o.$container.length&&(o.$container.find(".lwptocMetabox_disable").click(function(){o.setEnabled(!1)}),o.$container.find(".lwptocMetabox_enable").click(function(){o.setEnabled(!0)}),o.$container.find(".lwptocMetabox_disableProcessing").click(function(){o.setProcessing(!1)}),o.$container.find(".lwptocMetabox_enableProcessing").click(function(){o.setProcessing(!0)}),o.$container.find(".lwptocMetabox_customize").click(function(){r.lwptocCustomize.show({action:"lwptoc_metabox_customize",postId:o.$container.data("postId")},r.noop)}),r(document).on("lwptocMetaboxCustomized",function(t,e){r(".lwptocCustomize-metabox").lwptocModal("close"),o.reload(e.metabox)}))}};r(function(){o.init()});var e={oneInited:!1,oneInit:function(){r(document).on("lwptocWidgetCustomized",function(t,e){r(".lwptocCustomize-metabox").lwptocModal("close"),r(".lwptocWidget-"+e.id+" .lwptocWidget_override").html(e.override),r(".lwptocWidget-"+e.id+" .lwptocWidget_input").val(e.value).change()})},init:function(){r(".lwptocWidget").each(function(){var t=r(this);t.data("inited")||(t.find(".lwptocWidget_customize").click(function(){r.lwptocCustomize.show({action:"lwptoc_widget_customize",value:t.find(".lwptocWidget_input").val(),widgetId:t.data("id")},r.noop)}),t.data("inited",1),e.oneInited||e.oneInit())})}};r.lwptocWidget=e;var n={update:function(t){"custom"==t.$typeInput.val()?(t.$input.val(t.$sizeInput.val()+t.$unitInput.val()),t.$custom.show()):(t.$input.val(t.$typeInput.val()),t.$custom.hide())},init:function(t){t.each(function(){var t={$container:r(this)};t.$typeInput=t.$container.find(".lwptocWidthField_typeInput"),t.$sizeInput=t.$container.find(".lwptocWidthField_sizeInput"),t.$unitInput=t.$container.find(".lwptocWidthField_unitInput"),t.$input=t.$container.find(".lwptocWidthField_input"),t.$custom=t.$container.find(".lwptocWidthField_custom"),t.$typeInput.add(t.$sizeInput).add(t.$unitInput).change(function(){n.update(t)})})}};r(function(){n.init(r(".lwptocWidthField"))});var i={update:function(t){"custom"==t.$typeInput.val()?(t.$input.val(t.$sizeInput.val()+t.$unitInput.val()),t.$custom.show()):(t.$input.val(t.$typeInput.val()),t.$custom.hide())},init:function(t){t.each(function(){var t={$container:r(this)};t.$typeInput=t.$container.find(".lwptocFontSizeField_typeInput"),t.$sizeInput=t.$container.find(".lwptocFontSizeField_sizeInput"),t.$unitInput=t.$container.find(".lwptocFontSizeField_unitInput"),t.$input=t.$container.find(".lwptocFontSizeField_input"),t.$custom=t.$container.find(".lwptocFontSizeField_custom"),t.$typeInput.add(t.$sizeInput).add(t.$unitInput).change(function(){i.update(t)})})}};r(function(){i.init(r(".lwptocFontSizeField"))}),r(function(){var t=r(".lwptocRate");t.length&&t.on("click",".button",function(){r.ajax({url:lwptocMain.ajaxUrl,method:"POST",data:{action:r(this).data("action")},beforeSend:function(){t.lwptocPreloaderShow()},success:function(){t.remove()}})})})}(jQuery);
admin/controllers/RateController.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace luckywp\tableOfContents\admin\controllers;
4
+
5
+ use luckywp\tableOfContents\core\admin\AdminController;
6
+ use luckywp\tableOfContents\core\Core;
7
+
8
+ class RateController extends AdminController
9
+ {
10
+
11
+ public function init()
12
+ {
13
+ add_action('init', function () {
14
+ if (Core::$plugin->rate->isShow()) {
15
+ add_action('admin_notices', [$this, 'notice']);
16
+ }
17
+ });
18
+ add_action('wp_ajax_lwptoc_rate', [$this, 'ajaxRate']);
19
+ add_action('wp_ajax_lwptoc_show_later', [$this, 'ajaxShowLater']);
20
+ add_action('wp_ajax_lwptoc_already_rate', [$this, 'ajaxAlreadyRate']);
21
+ parent::init();
22
+ }
23
+
24
+ public function notice()
25
+ {
26
+ $this->render('notice');
27
+ }
28
+
29
+ public function ajaxRate()
30
+ {
31
+ Core::$plugin->rate->rate();
32
+ }
33
+
34
+ public function ajaxAlreadyRate()
35
+ {
36
+ Core::$plugin->rate->alreadyRate();
37
+ }
38
+
39
+ public function ajaxShowLater()
40
+ {
41
+ Core::$plugin->rate->showLater();
42
+ }
43
+ }
admin/views/rate/notice.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use luckywp\tableOfContents\admin\Rate;
4
+ use luckywp\tableOfContents\core\admin\helpers\AdminHtml;
5
+
6
+ ?>
7
+ <div class="notice notice-info lwptocRate">
8
+ <p>
9
+ <?= esc_html__('Hello!', 'lwptoc') ?>
10
+ <br>
11
+ <?= sprintf(
12
+ esc_html__('We are very pleased that you are using the %s plugin within a few days.', 'lwptoc'),
13
+ '<b>LuckyWP Table of Contents</b>'
14
+ ) ?>
15
+ <br>
16
+ <?= esc_html__('Please rate plugin. It will help us a lot.', 'lwptoc') ?>
17
+ </p>
18
+ <p>
19
+ <?= AdminHtml::buttonLink(esc_html__('Rate the plugin', 'lwptoc'), Rate::LINK, [
20
+ 'attrs' => [
21
+ 'data-action' => 'lwptoc_rate',
22
+ 'target' => '_blank',
23
+ ],
24
+ 'theme' => AdminHtml::BUTTON_THEME_PRIMARY,
25
+ ]) ?>
26
+ <?= AdminHtml::button(esc_html__('Remind later', 'lwptoc'), [
27
+ 'attrs' => [
28
+ 'data-action' => 'lwptoc_show_later',
29
+ ],
30
+ 'theme' => AdminHtml::BUTTON_THEME_LINK,
31
+ ]) ?>
32
+ <?= AdminHtml::button(esc_html__('I\'ve already rated the plugin', 'lwptoc'), [
33
+ 'attrs' => [
34
+ 'data-action' => 'lwptoc_already_rate',
35
+ ],
36
+ 'theme' => AdminHtml::BUTTON_THEME_LINK,
37
+ ]) ?>
38
+ </p>
39
+ <p>
40
+ <b><?= esc_html__('Thank you very much!', 'lwptoc') ?></b>
41
+ </p>
42
+ </div>
admin/views/settings/index.php CHANGED
@@ -1,9 +1,14 @@
1
  <?php
2
 
 
3
  use luckywp\tableOfContents\core\Core;
4
 
5
  ?>
6
  <div class="wrap">
 
 
 
 
7
  <h1><?= esc_html__('Table of Contents Settings', 'lwptoc') ?></h1>
8
  <?php Core::$plugin->settings->showPage(false) ?>
9
  </div>
1
  <?php
2
 
3
+ use luckywp\tableOfContents\admin\Rate;
4
  use luckywp\tableOfContents\core\Core;
5
 
6
  ?>
7
  <div class="wrap">
8
+ <a href="<?= Rate::LINK ?>" target="_blank" class="lwptocSettingsRate"><?= sprintf(
9
+ esc_html__('Leave a %s plugin review on WordPress.org', 'lwptoc'),
10
+ '★★★★★'
11
+ ) ?></a>
12
  <h1><?= esc_html__('Table of Contents Settings', 'lwptoc') ?></h1>
13
  <?php Core::$plugin->settings->showPage(false) ?>
14
  </div>
config/plugin.php CHANGED
@@ -17,6 +17,8 @@ return [
17
  'admin' => \luckywp\tableOfContents\admin\Admin::className(),
18
  'front' => \luckywp\tableOfContents\front\Front::className(),
19
  'mcePlugin' => \luckywp\tableOfContents\plugin\mcePlugin\McePlugin::className(),
 
 
20
  'request' => \luckywp\tableOfContents\core\base\Request::className(),
21
  'settings' => [
22
  'class' => \luckywp\tableOfContents\plugin\Settings::className(),
17
  'admin' => \luckywp\tableOfContents\admin\Admin::className(),
18
  'front' => \luckywp\tableOfContents\front\Front::className(),
19
  'mcePlugin' => \luckywp\tableOfContents\plugin\mcePlugin\McePlugin::className(),
20
+ 'options' => \luckywp\tableOfContents\core\wp\Options::className(),
21
+ 'rate' => \luckywp\tableOfContents\admin\Rate::className(),
22
  'request' => \luckywp\tableOfContents\core\base\Request::className(),
23
  'settings' => [
24
  'class' => \luckywp\tableOfContents\plugin\Settings::className(),
core/admin/helpers/AdminHtml.php CHANGED
@@ -64,6 +64,13 @@ class AdminHtml
64
  return Html::tag($tag, $content, $attrs);
65
  }
66
 
 
 
 
 
 
 
 
67
  const TEXT_INPUT_SIZE_REGULAR = 'regular';
68
  const TEXT_INPUT_SIZE_SMALL = 'small';
69
  const TEXT_INPUT_SIZE_LARGE = 'large';
64
  return Html::tag($tag, $content, $attrs);
65
  }
66
 
67
+ public static function buttonLink($content, $url, $options = [])
68
+ {
69
+ $options['tag'] = 'a';
70
+ $options['href'] = $url;
71
+ return static::button($content, $options);
72
+ }
73
+
74
  const TEXT_INPUT_SIZE_REGULAR = 'regular';
75
  const TEXT_INPUT_SIZE_SMALL = 'small';
76
  const TEXT_INPUT_SIZE_LARGE = 'large';
core/wp/Options.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace luckywp\tableOfContents\core\wp;
4
+
5
+ use luckywp\tableOfContents\core\base\BaseObject;
6
+ use luckywp\tableOfContents\core\Core;
7
+
8
+ class Options extends BaseObject
9
+ {
10
+
11
+ public function get($option, $default = false)
12
+ {
13
+ return get_option(Core::$plugin->prefix . $option, $default);
14
+ }
15
+
16
+ public function set($option, $value, $autoload = null)
17
+ {
18
+ return update_option(Core::$plugin->prefix . $option, $value, $autoload);
19
+ }
20
+
21
+ public function delete($option)
22
+ {
23
+ delete_option(Core::$plugin->prefix . $option);
24
+ }
25
+ }
front/assets/main.min.js CHANGED
@@ -1 +1 @@
1
- !function(n){var t=function(t){t.each(function(){var a=n(this);a.data("smoothScroll")&&a.find(".lwptoc_items").on("click",'A[href^="#"]',function(t){t.preventDefault();var l=this.hash,i=n(l);if(i.length){var o=i.offset().top-a.data("smoothScrollOffset");n("html, body").animate({scrollTop:o<0?0:o},500,function(){if(l!=location.hash){var t=i.attr("id"),o=n("<a> </a>").attr("id",t).css({position:"absolute",top:n(window).scrollTop(),left:n(window).scrollLeft(),visibility:"hidden"});i.attr("id",""),n("body").prepend(o),location.hash=l,o.remove(),i.attr("id",t)}})}})}),t.find(".lwptoc_toggle_label").click(function(){var t=n(this),o=t.closest(".lwptoc").find(".lwptoc_items"),l=t.data("label");return"none"==o.css("display")?(o.stop(!0).slideDown(300),t.data("label",t.html()).html(l)):o.stop(!0).slideUp(300,function(){t.data("label",t.html()).html(l)}),!1})};n(function(){t(n(".lwptoc"))})}(jQuery);
1
+ !function(s){var t=function(t){t.each(function(){var e=s(this);e.data("smoothScroll")&&e.find(".lwptoc_items").on("click",'A[href^="#"]',function(t){t.preventDefault();var o=this.hash,l=s(o);if(l.length){if(o!=location.hash){var i=l.attr("id"),a=s("<a> </a>").attr("id",i).css({position:"absolute",top:s(window).scrollTop(),left:s(window).scrollLeft(),visibility:"hidden"});l.attr("id",""),s("body").prepend(a),location.hash=o,a.remove(),l.attr("id",i)}var n=l.offset().top-e.data("smoothScrollOffset");s("html, body").animate({scrollTop:n<0?0:n},500)}})}),t.find(".lwptoc_toggle_label").click(function(){var t=s(this),o=t.closest(".lwptoc").find(".lwptoc_items"),l=t.data("label");return"none"==o.css("display")?(o.stop(!0).slideDown(300),t.data("label",t.html()).html(l)):o.stop(!0).slideUp(300,function(){t.data("label",t.html()).html(l)}),!1})};s(function(){t(s(".lwptoc"))})}(jQuery);
languages/lwptoc-ru_RU.mo CHANGED
Binary file
languages/lwptoc.pot CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
- "POT-Creation-Date: 2019-06-04 22:33+0300\n"
5
- "PO-Revision-Date: 2019-06-04 22:34+0300\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: ru_RU\n"
@@ -17,42 +17,42 @@ msgstr ""
17
  "X-Poedit-SearchPath-0: .\n"
18
  "X-Poedit-SearchPathExcluded-0: plugin/editorBlock/src\n"
19
 
20
- #: admin/Admin.php:33
21
  msgid "Settings"
22
  msgstr ""
23
 
24
- #: admin/Admin.php:49 admin/Admin.php:50 admin/Admin.php:70 admin/Admin.php:97
25
  #: admin/controllers/EditorBlockController.php:65
26
  #: admin/controllers/ShortcodeController.php:68 plugin/WpWidget.php:20
27
  msgid "Table of Contents"
28
  msgstr ""
29
 
30
- #: admin/Admin.php:98
31
  msgid "Edit"
32
  msgstr ""
33
 
34
- #: admin/Admin.php:125 admin/forms/CustomizeForm.php:235
35
  #: admin/widgets/customizeModal/views/modal.php:50 config/settings.php:285
36
  msgid "Position"
37
  msgstr ""
38
 
39
- #: admin/Admin.php:128 admin/widgets/customizeModal/views/modal.php:73
40
  #: config/settings.php:22
41
  msgid "Minimal Count of Headers"
42
  msgstr ""
43
 
44
- #: admin/Admin.php:131 admin/forms/CustomizeForm.php:231
45
  #: admin/widgets/customizeModal/views/modal.php:96 config/settings.php:34
46
  msgid "Depth"
47
  msgstr ""
48
 
49
- #: admin/Admin.php:134 admin/widgets/customizeModal/views/modal.php:118
50
  #: config/settings.php:43
51
  msgid "Hierarchical View"
52
  msgstr ""
53
 
54
- #: admin/Admin.php:134 admin/Admin.php:143 admin/Admin.php:152
55
- #: admin/Admin.php:155 admin/Admin.php:191
56
  #: admin/widgets/customizeModal/views/modal.php:134
57
  #: admin/widgets/customizeModal/views/modal.php:205
58
  #: admin/widgets/customizeModal/views/modal.php:268
@@ -61,8 +61,8 @@ msgstr ""
61
  msgid "Enabled"
62
  msgstr ""
63
 
64
- #: admin/Admin.php:134 admin/Admin.php:143 admin/Admin.php:152
65
- #: admin/Admin.php:155 admin/Admin.php:191
66
  #: admin/widgets/customizeModal/views/modal.php:134
67
  #: admin/widgets/customizeModal/views/modal.php:205
68
  #: admin/widgets/customizeModal/views/modal.php:268
@@ -71,80 +71,80 @@ msgstr ""
71
  msgid "Disabled"
72
  msgstr ""
73
 
74
- #: admin/Admin.php:137 admin/forms/CustomizeForm.php:232
75
  #: admin/widgets/customizeModal/views/modal.php:141 config/settings.php:54
76
  msgid "Numeration"
77
  msgstr ""
78
 
79
- #: admin/Admin.php:140 admin/widgets/customizeModal/views/modal.php:163
80
  #: config/settings.php:69
81
  msgid "Title"
82
  msgstr ""
83
 
84
- #: admin/Admin.php:143 admin/widgets/customizeModal/views/modal.php:189
85
  #: config/settings.php:75
86
  msgid "Toggle Show/Hide"
87
  msgstr ""
88
 
89
- #: admin/Admin.php:146 admin/forms/CustomizeForm.php:233
90
  #: admin/widgets/customizeModal/views/modal.php:212 config/settings.php:87
91
  msgid "Label Show"
92
  msgstr ""
93
 
94
- #: admin/Admin.php:149 admin/forms/CustomizeForm.php:234
95
  #: admin/widgets/customizeModal/views/modal.php:232 config/settings.php:98
96
  msgid "Label Hide"
97
  msgstr ""
98
 
99
- #: admin/Admin.php:152
100
  msgid "Hide Items"
101
  msgstr ""
102
 
103
- #: admin/Admin.php:155 admin/widgets/customizeModal/views/modal.php:275
104
  #: config/settings.php:126
105
  msgid "Smooth Scroll"
106
  msgstr ""
107
 
108
- #: admin/Admin.php:158 admin/widgets/customizeModal/views/modal.php:298
109
  msgid "Smooth Scroll Offset Top"
110
  msgstr ""
111
 
112
- #: admin/Admin.php:161 admin/widgets/customizeModal/views/modal.php:322
113
  #: config/settings.php:162
114
  msgid "Width"
115
  msgstr ""
116
 
117
- #: admin/Admin.php:164 admin/forms/CustomizeForm.php:236
118
  #: admin/widgets/customizeModal/views/modal.php:345 config/settings.php:174
119
  msgid "Float"
120
  msgstr ""
121
 
122
- #: admin/Admin.php:167 admin/widgets/customizeModal/views/modal.php:367
123
  #: config/settings.php:183
124
  msgid "Title Font Size"
125
  msgstr ""
126
 
127
- #: admin/Admin.php:170 admin/forms/CustomizeForm.php:237
128
  #: admin/widgets/customizeModal/views/modal.php:391 config/settings.php:196
129
  msgid "Title Font Weight"
130
  msgstr ""
131
 
132
- #: admin/Admin.php:173 admin/widgets/customizeModal/views/modal.php:413
133
  #: config/settings.php:205
134
  msgid "Items Font Size"
135
  msgstr ""
136
 
137
- #: admin/Admin.php:176 admin/forms/CustomizeForm.php:238
138
  #: admin/widgets/customizeModal/views/modal.php:437 config/settings.php:218
139
  msgid "Color Scheme"
140
  msgstr ""
141
 
142
- #: admin/Admin.php:191 admin/widgets/customizeModal/views/modal.php:492
143
  #: config/settings.php:352
144
  msgid "Wrap table of contents with <!--noindex--> tag"
145
  msgstr ""
146
 
147
- #: admin/Admin.php:194 admin/Admin.php:197
148
  msgid "Skip headings"
149
  msgstr ""
150
 
@@ -156,10 +156,44 @@ msgstr ""
156
  msgid "empty"
157
  msgstr ""
158
 
159
- #: admin/views/settings/index.php:7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  msgid "Table of Contents Settings"
161
  msgstr ""
162
 
 
 
 
 
 
163
  #: admin/widgets/OverrideColorBadge.php:17
164
  msgid "from scheme"
165
  msgstr ""
@@ -284,11 +318,11 @@ msgstr ""
284
  msgid "Saved!"
285
  msgstr ""
286
 
287
- #: admin/widgets/fontSizeField/views/widget.php:16 plugin/Plugin.php:262
288
  msgid "Default"
289
  msgstr ""
290
 
291
- #: admin/widgets/fontSizeField/views/widget.php:17 plugin/Plugin.php:227
292
  msgid "Custom Value"
293
  msgstr ""
294
 
@@ -448,135 +482,135 @@ msgstr ""
448
  msgid "{attribute} cannot be blank."
449
  msgstr ""
450
 
451
- #: plugin/Plugin.php:97
452
  msgid "Without numeration"
453
  msgstr ""
454
 
455
- #: plugin/Plugin.php:98
456
  msgid "Decimal numbers (nested)"
457
  msgstr ""
458
 
459
- #: plugin/Plugin.php:99
460
  msgid "Decimal numbers"
461
  msgstr ""
462
 
463
- #: plugin/Plugin.php:100
464
  msgid "Roman numbers (nested)"
465
  msgstr ""
466
 
467
- #: plugin/Plugin.php:101
468
  msgid "Roman numbers"
469
  msgstr ""
470
 
471
- #: plugin/Plugin.php:111
472
  msgid "Before first heading"
473
  msgstr ""
474
 
475
- #: plugin/Plugin.php:112
476
  msgid "After first heading"
477
  msgstr ""
478
 
479
- #: plugin/Plugin.php:113
480
  msgid "After first block (paragraph, list or heading)"
481
  msgstr ""
482
 
483
- #: plugin/Plugin.php:114
484
  msgid "Top"
485
  msgstr ""
486
 
487
- #: plugin/Plugin.php:115
488
  msgid "Bottom"
489
  msgstr ""
490
 
491
- #: plugin/Plugin.php:149
492
  msgid "Thin"
493
  msgstr ""
494
 
495
- #: plugin/Plugin.php:150
496
  msgid "Extra Light"
497
  msgstr ""
498
 
499
- #: plugin/Plugin.php:151
500
  msgid "Light"
501
  msgstr ""
502
 
503
- #: plugin/Plugin.php:152
504
  msgid "Normal"
505
  msgstr ""
506
 
507
- #: plugin/Plugin.php:153
508
  msgid "Medium"
509
  msgstr ""
510
 
511
- #: plugin/Plugin.php:154
512
  msgid "Semi Bold"
513
  msgstr ""
514
 
515
- #: plugin/Plugin.php:155
516
  msgid "Bold"
517
  msgstr ""
518
 
519
- #: plugin/Plugin.php:156
520
  msgid "Extra Bold"
521
  msgstr ""
522
 
523
- #: plugin/Plugin.php:157
524
  msgid "Heavy"
525
  msgstr ""
526
 
527
- #: plugin/Plugin.php:186 plugin/Plugin.php:313
528
  msgid "None"
529
  msgstr ""
530
 
531
- #: plugin/Plugin.php:187
532
  msgid "Left"
533
  msgstr ""
534
 
535
- #: plugin/Plugin.php:188
536
  msgid "Right"
537
  msgstr ""
538
 
539
- #: plugin/Plugin.php:189
540
  msgid "Right without flow"
541
  msgstr ""
542
 
543
- #: plugin/Plugin.php:190
544
  msgid "Center"
545
  msgstr ""
546
 
547
- #: plugin/Plugin.php:200
548
  msgid "Light Colors"
549
  msgstr ""
550
 
551
- #: plugin/Plugin.php:201
552
  msgid "Dark Colors"
553
  msgstr ""
554
 
555
- #: plugin/Plugin.php:202
556
  msgid "White"
557
  msgstr ""
558
 
559
- #: plugin/Plugin.php:203
560
  msgid "Transparent"
561
  msgstr ""
562
 
563
- #: plugin/Plugin.php:213
564
  msgid "As heading (#Example_Heading_Text)"
565
  msgstr ""
566
 
567
- #: plugin/Plugin.php:214
568
  msgid "Counter (#lpwtoc1, #lwptoc2, …)"
569
  msgstr ""
570
 
571
- #: plugin/Plugin.php:225
572
  msgid "Auto"
573
  msgstr ""
574
 
575
- #: plugin/Plugin.php:226
576
  msgid "Full Width"
577
  msgstr ""
578
 
579
- #: plugin/Plugin.php:389
580
  msgid ""
581
  "Creates a table of contents for your posts/pages. Works automatically or "
582
  "manually (via shortcode, Gutenberg block or widget)."
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
+ "POT-Creation-Date: 2019-06-17 22:31+0300\n"
5
+ "PO-Revision-Date: 2019-06-17 22:33+0300\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: ru_RU\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
  "X-Poedit-SearchPathExcluded-0: plugin/editorBlock/src\n"
19
 
20
+ #: admin/Admin.php:34
21
  msgid "Settings"
22
  msgstr ""
23
 
24
+ #: admin/Admin.php:51 admin/Admin.php:52 admin/Admin.php:72 admin/Admin.php:99
25
  #: admin/controllers/EditorBlockController.php:65
26
  #: admin/controllers/ShortcodeController.php:68 plugin/WpWidget.php:20
27
  msgid "Table of Contents"
28
  msgstr ""
29
 
30
+ #: admin/Admin.php:100
31
  msgid "Edit"
32
  msgstr ""
33
 
34
+ #: admin/Admin.php:127 admin/forms/CustomizeForm.php:235
35
  #: admin/widgets/customizeModal/views/modal.php:50 config/settings.php:285
36
  msgid "Position"
37
  msgstr ""
38
 
39
+ #: admin/Admin.php:130 admin/widgets/customizeModal/views/modal.php:73
40
  #: config/settings.php:22
41
  msgid "Minimal Count of Headers"
42
  msgstr ""
43
 
44
+ #: admin/Admin.php:133 admin/forms/CustomizeForm.php:231
45
  #: admin/widgets/customizeModal/views/modal.php:96 config/settings.php:34
46
  msgid "Depth"
47
  msgstr ""
48
 
49
+ #: admin/Admin.php:136 admin/widgets/customizeModal/views/modal.php:118
50
  #: config/settings.php:43
51
  msgid "Hierarchical View"
52
  msgstr ""
53
 
54
+ #: admin/Admin.php:136 admin/Admin.php:145 admin/Admin.php:154
55
+ #: admin/Admin.php:157 admin/Admin.php:193
56
  #: admin/widgets/customizeModal/views/modal.php:134
57
  #: admin/widgets/customizeModal/views/modal.php:205
58
  #: admin/widgets/customizeModal/views/modal.php:268
61
  msgid "Enabled"
62
  msgstr ""
63
 
64
+ #: admin/Admin.php:136 admin/Admin.php:145 admin/Admin.php:154
65
+ #: admin/Admin.php:157 admin/Admin.php:193
66
  #: admin/widgets/customizeModal/views/modal.php:134
67
  #: admin/widgets/customizeModal/views/modal.php:205
68
  #: admin/widgets/customizeModal/views/modal.php:268
71
  msgid "Disabled"
72
  msgstr ""
73
 
74
+ #: admin/Admin.php:139 admin/forms/CustomizeForm.php:232
75
  #: admin/widgets/customizeModal/views/modal.php:141 config/settings.php:54
76
  msgid "Numeration"
77
  msgstr ""
78
 
79
+ #: admin/Admin.php:142 admin/widgets/customizeModal/views/modal.php:163
80
  #: config/settings.php:69
81
  msgid "Title"
82
  msgstr ""
83
 
84
+ #: admin/Admin.php:145 admin/widgets/customizeModal/views/modal.php:189
85
  #: config/settings.php:75
86
  msgid "Toggle Show/Hide"
87
  msgstr ""
88
 
89
+ #: admin/Admin.php:148 admin/forms/CustomizeForm.php:233
90
  #: admin/widgets/customizeModal/views/modal.php:212 config/settings.php:87
91
  msgid "Label Show"
92
  msgstr ""
93
 
94
+ #: admin/Admin.php:151 admin/forms/CustomizeForm.php:234
95
  #: admin/widgets/customizeModal/views/modal.php:232 config/settings.php:98
96
  msgid "Label Hide"
97
  msgstr ""
98
 
99
+ #: admin/Admin.php:154
100
  msgid "Hide Items"
101
  msgstr ""
102
 
103
+ #: admin/Admin.php:157 admin/widgets/customizeModal/views/modal.php:275
104
  #: config/settings.php:126
105
  msgid "Smooth Scroll"
106
  msgstr ""
107
 
108
+ #: admin/Admin.php:160 admin/widgets/customizeModal/views/modal.php:298
109
  msgid "Smooth Scroll Offset Top"
110
  msgstr ""
111
 
112
+ #: admin/Admin.php:163 admin/widgets/customizeModal/views/modal.php:322
113
  #: config/settings.php:162
114
  msgid "Width"
115
  msgstr ""
116
 
117
+ #: admin/Admin.php:166 admin/forms/CustomizeForm.php:236
118
  #: admin/widgets/customizeModal/views/modal.php:345 config/settings.php:174
119
  msgid "Float"
120
  msgstr ""
121
 
122
+ #: admin/Admin.php:169 admin/widgets/customizeModal/views/modal.php:367
123
  #: config/settings.php:183
124
  msgid "Title Font Size"
125
  msgstr ""
126
 
127
+ #: admin/Admin.php:172 admin/forms/CustomizeForm.php:237
128
  #: admin/widgets/customizeModal/views/modal.php:391 config/settings.php:196
129
  msgid "Title Font Weight"
130
  msgstr ""
131
 
132
+ #: admin/Admin.php:175 admin/widgets/customizeModal/views/modal.php:413
133
  #: config/settings.php:205
134
  msgid "Items Font Size"
135
  msgstr ""
136
 
137
+ #: admin/Admin.php:178 admin/forms/CustomizeForm.php:238
138
  #: admin/widgets/customizeModal/views/modal.php:437 config/settings.php:218
139
  msgid "Color Scheme"
140
  msgstr ""
141
 
142
+ #: admin/Admin.php:193 admin/widgets/customizeModal/views/modal.php:492
143
  #: config/settings.php:352
144
  msgid "Wrap table of contents with <!--noindex--> tag"
145
  msgstr ""
146
 
147
+ #: admin/Admin.php:196 admin/Admin.php:199
148
  msgid "Skip headings"
149
  msgstr ""
150
 
156
  msgid "empty"
157
  msgstr ""
158
 
159
+ #: admin/views/rate/notice.php:9
160
+ msgid "Hello!"
161
+ msgstr ""
162
+
163
+ #: admin/views/rate/notice.php:12
164
+ #, php-format
165
+ msgid "We are very pleased that you are using the %s plugin within a few days."
166
+ msgstr ""
167
+
168
+ #: admin/views/rate/notice.php:16
169
+ msgid "Please rate plugin. It will help us a lot."
170
+ msgstr ""
171
+
172
+ #: admin/views/rate/notice.php:19
173
+ msgid "Rate the plugin"
174
+ msgstr ""
175
+
176
+ #: admin/views/rate/notice.php:26
177
+ msgid "Remind later"
178
+ msgstr ""
179
+
180
+ #: admin/views/rate/notice.php:32
181
+ msgid "I've already rated the plugin"
182
+ msgstr ""
183
+
184
+ #: admin/views/rate/notice.php:40
185
+ msgid "Thank you very much!"
186
+ msgstr ""
187
+
188
+ #: admin/views/settings/index.php:9
189
  msgid "Table of Contents Settings"
190
  msgstr ""
191
 
192
+ #: admin/views/settings/index.php:11
193
+ #, php-format
194
+ msgid "Leave a %s plugin review on WordPress.org"
195
+ msgstr ""
196
+
197
  #: admin/widgets/OverrideColorBadge.php:17
198
  msgid "from scheme"
199
  msgstr ""
318
  msgid "Saved!"
319
  msgstr ""
320
 
321
+ #: admin/widgets/fontSizeField/views/widget.php:16 plugin/Plugin.php:266
322
  msgid "Default"
323
  msgstr ""
324
 
325
+ #: admin/widgets/fontSizeField/views/widget.php:17 plugin/Plugin.php:231
326
  msgid "Custom Value"
327
  msgstr ""
328
 
482
  msgid "{attribute} cannot be blank."
483
  msgstr ""
484
 
485
+ #: plugin/Plugin.php:101
486
  msgid "Without numeration"
487
  msgstr ""
488
 
489
+ #: plugin/Plugin.php:102
490
  msgid "Decimal numbers (nested)"
491
  msgstr ""
492
 
493
+ #: plugin/Plugin.php:103
494
  msgid "Decimal numbers"
495
  msgstr ""
496
 
497
+ #: plugin/Plugin.php:104
498
  msgid "Roman numbers (nested)"
499
  msgstr ""
500
 
501
+ #: plugin/Plugin.php:105
502
  msgid "Roman numbers"
503
  msgstr ""
504
 
505
+ #: plugin/Plugin.php:115
506
  msgid "Before first heading"
507
  msgstr ""
508
 
509
+ #: plugin/Plugin.php:116
510
  msgid "After first heading"
511
  msgstr ""
512
 
513
+ #: plugin/Plugin.php:117
514
  msgid "After first block (paragraph, list or heading)"
515
  msgstr ""
516
 
517
+ #: plugin/Plugin.php:118
518
  msgid "Top"
519
  msgstr ""
520
 
521
+ #: plugin/Plugin.php:119
522
  msgid "Bottom"
523
  msgstr ""
524
 
525
+ #: plugin/Plugin.php:153
526
  msgid "Thin"
527
  msgstr ""
528
 
529
+ #: plugin/Plugin.php:154
530
  msgid "Extra Light"
531
  msgstr ""
532
 
533
+ #: plugin/Plugin.php:155
534
  msgid "Light"
535
  msgstr ""
536
 
537
+ #: plugin/Plugin.php:156
538
  msgid "Normal"
539
  msgstr ""
540
 
541
+ #: plugin/Plugin.php:157
542
  msgid "Medium"
543
  msgstr ""
544
 
545
+ #: plugin/Plugin.php:158
546
  msgid "Semi Bold"
547
  msgstr ""
548
 
549
+ #: plugin/Plugin.php:159
550
  msgid "Bold"
551
  msgstr ""
552
 
553
+ #: plugin/Plugin.php:160
554
  msgid "Extra Bold"
555
  msgstr ""
556
 
557
+ #: plugin/Plugin.php:161
558
  msgid "Heavy"
559
  msgstr ""
560
 
561
+ #: plugin/Plugin.php:190 plugin/Plugin.php:317
562
  msgid "None"
563
  msgstr ""
564
 
565
+ #: plugin/Plugin.php:191
566
  msgid "Left"
567
  msgstr ""
568
 
569
+ #: plugin/Plugin.php:192
570
  msgid "Right"
571
  msgstr ""
572
 
573
+ #: plugin/Plugin.php:193
574
  msgid "Right without flow"
575
  msgstr ""
576
 
577
+ #: plugin/Plugin.php:194
578
  msgid "Center"
579
  msgstr ""
580
 
581
+ #: plugin/Plugin.php:204
582
  msgid "Light Colors"
583
  msgstr ""
584
 
585
+ #: plugin/Plugin.php:205
586
  msgid "Dark Colors"
587
  msgstr ""
588
 
589
+ #: plugin/Plugin.php:206
590
  msgid "White"
591
  msgstr ""
592
 
593
+ #: plugin/Plugin.php:207
594
  msgid "Transparent"
595
  msgstr ""
596
 
597
+ #: plugin/Plugin.php:217
598
  msgid "As heading (#Example_Heading_Text)"
599
  msgstr ""
600
 
601
+ #: plugin/Plugin.php:218
602
  msgid "Counter (#lpwtoc1, #lwptoc2, …)"
603
  msgstr ""
604
 
605
+ #: plugin/Plugin.php:229
606
  msgid "Auto"
607
  msgstr ""
608
 
609
+ #: plugin/Plugin.php:230
610
  msgid "Full Width"
611
  msgstr ""
612
 
613
+ #: plugin/Plugin.php:393
614
  msgid ""
615
  "Creates a table of contents for your posts/pages. Works automatically or "
616
  "manually (via shortcode, Gutenberg block or widget)."
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.5.1
7
  Author: LuckyWP
8
  Author URI: https://theluckywp.com/
9
  Text Domain: lwptoc
@@ -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.5.1', __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.5.2
7
  Author: LuckyWP
8
  Author URI: https://theluckywp.com/
9
  Text Domain: lwptoc
29
  $lwptocAutoloader->addNamespace('luckywp\tableOfContents', __DIR__);
30
 
31
  $config = require(__DIR__ . '/config/plugin.php');
32
+ (new \luckywp\tableOfContents\plugin\Plugin($config))->run('1.5.2', __FILE__, 'lwptoc_');
33
 
34
  require_once __DIR__ . '/functions.php';
plugin/Plugin.php CHANGED
@@ -3,10 +3,12 @@
3
  namespace luckywp\tableOfContents\plugin;
4
 
5
  use luckywp\tableOfContents\admin\Admin;
 
6
  use luckywp\tableOfContents\core\base\BasePlugin;
7
  use luckywp\tableOfContents\core\base\Request;
8
  use luckywp\tableOfContents\core\base\View;
9
  use luckywp\tableOfContents\core\helpers\ArrayHelper;
 
10
  use luckywp\tableOfContents\front\Front;
11
  use luckywp\tableOfContents\plugin\editorBlock\EditorBlock;
12
  use luckywp\tableOfContents\plugin\mcePlugin\McePlugin;
@@ -19,6 +21,8 @@ use WP_Post_Type;
19
  * @property Settings $settings
20
  * @property EditorBlock $editorBlock
21
  * @property McePlugin $mcePlugin
 
 
22
  * @property Shortcode $shortcode
23
  * @property View $view
24
  *
3
  namespace luckywp\tableOfContents\plugin;
4
 
5
  use luckywp\tableOfContents\admin\Admin;
6
+ use luckywp\tableOfContents\admin\Rate;
7
  use luckywp\tableOfContents\core\base\BasePlugin;
8
  use luckywp\tableOfContents\core\base\Request;
9
  use luckywp\tableOfContents\core\base\View;
10
  use luckywp\tableOfContents\core\helpers\ArrayHelper;
11
+ use luckywp\tableOfContents\core\wp\Options;
12
  use luckywp\tableOfContents\front\Front;
13
  use luckywp\tableOfContents\plugin\editorBlock\EditorBlock;
14
  use luckywp\tableOfContents\plugin\mcePlugin\McePlugin;
21
  * @property Settings $settings
22
  * @property EditorBlock $editorBlock
23
  * @property McePlugin $mcePlugin
24
+ * @property Options $options
25
+ * @property Rate $rate
26
  * @property Shortcode $shortcode
27
  * @property View $view
28
  *
plugin/contentHandling/ContentHandling.php CHANGED
@@ -64,7 +64,8 @@ class ContentHandling
64
  {
65
  switch ($hashFormat) {
66
  case 'counter':
67
- return 'lwptoc' . ++static::$headingIdCounter;
 
68
 
69
  case 'asheading':
70
  default:
@@ -80,16 +81,18 @@ class ContentHandling
80
  if (!$id) {
81
  $id = 'lwptoc';
82
  }
 
83
 
84
- $baseId = $id;
85
- $c = 0;
86
- while (in_array($id, static::$headingIds)) {
87
- $c++;
88
- $id = $baseId . $c;
89
- }
90
- static::$headingIds[] = $id;
91
 
92
- return $id;
 
 
 
 
93
  }
 
 
 
94
  }
95
  }
64
  {
65
  switch ($hashFormat) {
66
  case 'counter':
67
+ $id = 'lwptoc' . ++static::$headingIdCounter;
68
+ break;
69
 
70
  case 'asheading':
71
  default:
81
  if (!$id) {
82
  $id = 'lwptoc';
83
  }
84
+ }
85
 
86
+ $id = (string)apply_filters('lwptoc_heading_id', $id, $label);
 
 
 
 
 
 
87
 
88
+ $baseId = $id;
89
+ $c = 0;
90
+ while (in_array($id, static::$headingIds)) {
91
+ $c++;
92
+ $id = $baseId . $c;
93
  }
94
+ static::$headingIds[] = $id;
95
+
96
+ return $id;
97
  }
98
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.1
7
- Stable tag: 1.5.1
8
  Requires PHP: 5.6.20
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -80,6 +80,16 @@ Example:
80
  return 'toc';
81
  });
82
 
 
 
 
 
 
 
 
 
 
 
83
  == Installation ==
84
 
85
  #### Installing from the WordPress control panel
@@ -128,6 +138,10 @@ For non-English websites it is recommended to enable the `Intl` PHP extension.
128
 
129
  == Changelog ==
130
 
 
 
 
 
131
  = 1.5.1 =
132
  * Bug fix
133
 
4
  Tags: table of contents, toc, navigation, links, seo
5
  Requires at least: 4.7
6
  Tested up to: 5.2.1
7
+ Stable tag: 1.5.2
8
  Requires PHP: 5.6.20
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
80
  return 'toc';
81
  });
82
 
83
+ #### Filter `lwptoc_heading_id`
84
+
85
+ Use for modify heading ID.
86
+
87
+ Example:
88
+
89
+ add_filter('lwptoc_heading_id', function ($id, $label) {
90
+ return $id;
91
+ }, 10, 2);
92
+
93
  == Installation ==
94
 
95
  #### Installing from the WordPress control panel
138
 
139
  == Changelog ==
140
 
141
+ = 1.5.2 =
142
+ + Added hook filter `lwptoc_heading_id`.
143
+ + Implemented classic behavior on click "Back" in browser.
144
+
145
  = 1.5.1 =
146
  * Bug fix
147
 
uninstall.php CHANGED
@@ -8,3 +8,5 @@ delete_option('lwptoc_general');
8
  delete_option('lwptoc_appearance');
9
  delete_option('lwptoc_autoInsert');
10
  delete_option('lwptoc_misc');
 
 
8
  delete_option('lwptoc_appearance');
9
  delete_option('lwptoc_autoInsert');
10
  delete_option('lwptoc_misc');
11
+
12
+ delete_option('rate_time');