Nested Pages - Version 3.1.16

Version Description

  • Includes security updates. Thanks to Ram Gall at Wordfence for reporting
Download this release

Release Info

Developer kylephillips
Plugin Icon 128x128 Nested Pages
Version 3.1.16
Comparing to
See all releases

Code changes from version 3.1.15 to 3.1.16

app/Entities/Listing/Listing.php CHANGED
@@ -419,7 +419,7 @@ class Listing
419
 
420
  // CSS Classes for the <li> row element
421
  $template = ( $this->post->template )
422
- ? ' tpl-' . str_replace('.php', '', sanitize_html_class( $this->post->template ) )
423
  : '';
424
 
425
  $row_classes = '';
419
 
420
  // CSS Classes for the <li> row element
421
  $template = ( $this->post->template )
422
+ ? ' tpl-' . sanitize_html_class( str_replace('.php', '', $this->post->template ) )
423
  : '';
424
 
425
  $row_classes = '';
app/Form/Listeners/BaseHandler.php CHANGED
@@ -48,6 +48,12 @@ abstract class BaseHandler
48
  */
49
  protected $response;
50
 
 
 
 
 
 
 
51
  /**
52
  * Plugin Integrations
53
  * @var object;
@@ -91,7 +97,7 @@ abstract class BaseHandler
91
  protected function validateNonce()
92
  {
93
  if ( ! wp_verify_nonce( $this->nonce, 'nestedpages-nonce' ) ){
94
- $this->response = [ 'status' => 'error', 'message' => __('Incorrect Form Field', 'wp-nested-pages') ];
95
  $this->sendResponse();
96
  die();
97
  }
@@ -151,4 +157,12 @@ abstract class BaseHandler
151
  {
152
  return wp_send_json($this->response);
153
  }
 
 
 
 
 
 
 
 
154
  }
48
  */
49
  protected $response;
50
 
51
+ /**
52
+ * URL to redirect to
53
+ * @var string
54
+ */
55
+ protected $url;
56
+
57
  /**
58
  * Plugin Integrations
59
  * @var object;
97
  protected function validateNonce()
98
  {
99
  if ( ! wp_verify_nonce( $this->nonce, 'nestedpages-nonce' ) ){
100
+ $this->response = [ 'status' => 'error', 'message' => __('Invalid Nonce', 'wp-nested-pages') ];
101
  $this->sendResponse();
102
  die();
103
  }
157
  {
158
  return wp_send_json($this->response);
159
  }
160
+
161
+ /**
162
+ * Redirect to new URL
163
+ */
164
+ protected function redirect()
165
+ {
166
+ wp_safe_redirect($this->url);
167
+ }
168
  }
app/Form/Listeners/BulkActions.php CHANGED
@@ -4,14 +4,8 @@ namespace NestedPages\Form\Listeners;
4
  /**
5
  * Perform Bulk Actions
6
  */
7
- class BulkActions
8
  {
9
- /**
10
- * URL to redirect to
11
- * @var string
12
- */
13
- private $url;
14
-
15
  /**
16
  * Post IDs (Comma-separated)
17
  * @var string
@@ -38,6 +32,7 @@ class BulkActions
38
 
39
  public function __construct()
40
  {
 
41
  $this->setURL();
42
  $this->setPostIds();
43
  $this->performAction();
@@ -109,12 +104,4 @@ class BulkActions
109
  if ( $this->post_ids != '' ) $this->url = $this->url . '&ids=' . $this->post_ids;
110
  if ( $this->redirect_post_ids != '' ) $this->url = $this->url . '&link_ids=' . $this->redirect_post_ids;
111
  }
112
-
113
- /**
114
- * Redirect to new URL
115
- */
116
- private function redirect()
117
- {
118
- header('Location:' . $this->url);
119
- }
120
  }
4
  /**
5
  * Perform Bulk Actions
6
  */
7
+ class BulkActions extends BaseHandler
8
  {
 
 
 
 
 
 
9
  /**
10
  * Post IDs (Comma-separated)
11
  * @var string
32
 
33
  public function __construct()
34
  {
35
+ parent::__construct();
36
  $this->setURL();
37
  $this->setPostIds();
38
  $this->performAction();
104
  if ( $this->post_ids != '' ) $this->url = $this->url . '&ids=' . $this->post_ids;
105
  if ( $this->redirect_post_ids != '' ) $this->url = $this->url . '&link_ids=' . $this->redirect_post_ids;
106
  }
 
 
 
 
 
 
 
 
107
  }
app/Form/Listeners/BulkEdit.php CHANGED
@@ -6,33 +6,17 @@ use NestedPages\Entities\Post\PostUpdateRepository;
6
  /**
7
  * Perform a Bulk Edit
8
  */
9
- class BulkEdit
10
  {
11
- /**
12
- * URL to redirect to
13
- * @var string
14
- */
15
- private $url;
16
-
17
  /**
18
  * Post IDs (Comma-separated)
19
  * @var string
20
  */
21
  private $post_ids;
22
 
23
- /**
24
- * The Field Data
25
- */
26
- private $data;
27
-
28
- /**
29
- * Post Update Repo
30
- */
31
- private $post_update_repo;
32
-
33
  public function __construct()
34
  {
35
- $this->post_update_repo = new PostUpdateRepository;
36
  $this->setURL();
37
  $this->setFieldData();
38
  $this->performEdits();
@@ -69,12 +53,4 @@ class BulkEdit
69
  $this->post_update_repo->updatePost($data, $append_taxonomies = true);
70
  }
71
  }
72
-
73
- /**
74
- * Redirect to new URL
75
- */
76
- private function redirect()
77
- {
78
- header('Location:' . $this->url);
79
- }
80
  }
6
  /**
7
  * Perform a Bulk Edit
8
  */
9
+ class BulkEdit extends BaseHandler
10
  {
 
 
 
 
 
 
11
  /**
12
  * Post IDs (Comma-separated)
13
  * @var string
14
  */
15
  private $post_ids;
16
 
 
 
 
 
 
 
 
 
 
 
17
  public function __construct()
18
  {
19
+ parent::__construct();
20
  $this->setURL();
21
  $this->setFieldData();
22
  $this->performEdits();
53
  $this->post_update_repo->updatePost($data, $append_taxonomies = true);
54
  }
55
  }
 
 
 
 
 
 
 
 
56
  }
app/Form/Listeners/CategoryFilter.php CHANGED
@@ -4,16 +4,11 @@ namespace NestedPages\Form\Listeners;
4
  /**
5
  * Filter Pages by Category
6
  */
7
- class CategoryFilter
8
  {
9
- /**
10
- * URL to redirect to
11
- * @var string
12
- */
13
- private $url;
14
-
15
  public function __construct()
16
  {
 
17
  $this->setURL();
18
  $this->redirect();
19
  }
@@ -34,13 +29,4 @@ class CategoryFilter
34
  {
35
  $this->url .= '&category=' . sanitize_text_field($_POST['np_category']);
36
  }
37
-
38
-
39
- /**
40
- * Redirect to new URL
41
- */
42
- private function redirect()
43
- {
44
- header('Location:' . $this->url);
45
- }
46
  }
4
  /**
5
  * Filter Pages by Category
6
  */
7
+ class CategoryFilter extends BaseHandler
8
  {
 
 
 
 
 
 
9
  public function __construct()
10
  {
11
+ parent::__construct();
12
  $this->setURL();
13
  $this->redirect();
14
  }
29
  {
30
  $this->url .= '&category=' . sanitize_text_field($_POST['np_category']);
31
  }
 
 
 
 
 
 
 
 
 
32
  }
app/Form/Listeners/ListingSort.php CHANGED
@@ -6,14 +6,8 @@ use NestedPages\Entities\PostType\PostTypeRepository;
6
  /**
7
  * Redirect to Listing with Specified Sorting Options Applied
8
  */
9
- class ListingSort
10
  {
11
- /**
12
- * URL to redirect to
13
- * @var string
14
- */
15
- private $url;
16
-
17
  /**
18
  * The Post Type
19
  * @var string
@@ -28,6 +22,7 @@ class ListingSort
28
 
29
  public function __construct()
30
  {
 
31
  $this->post_type_repo = new PostTypeRepository;
32
  $this->setURL();
33
  $this->redirect();
@@ -86,12 +81,4 @@ class ListingSort
86
  endif;
87
  endforeach;
88
  }
89
-
90
- /**
91
- * Redirect to new URL
92
- */
93
- private function redirect()
94
- {
95
- header('Location:' . $this->url);
96
- }
97
  }
6
  /**
7
  * Redirect to Listing with Specified Sorting Options Applied
8
  */
9
+ class ListingSort extends BaseHandler
10
  {
 
 
 
 
 
 
11
  /**
12
  * The Post Type
13
  * @var string
22
 
23
  public function __construct()
24
  {
25
+ parent::__construct();
26
  $this->post_type_repo = new PostTypeRepository;
27
  $this->setURL();
28
  $this->redirect();
81
  endif;
82
  endforeach;
83
  }
 
 
 
 
 
 
 
 
84
  }
app/Form/Listeners/Search.php CHANGED
@@ -3,12 +3,6 @@ namespace NestedPages\Form\Listeners;
3
 
4
  class Search extends BaseHandler
5
  {
6
- /**
7
- * URL to redirect to
8
- * @var string
9
- */
10
- private $url;
11
-
12
  public function __construct()
13
  {
14
  parent::__construct();
@@ -23,12 +17,4 @@ class Search extends BaseHandler
23
  {
24
  $this->url = sanitize_text_field($_POST['page']) . '&search=' . sanitize_text_field($_POST['search_term']);
25
  }
26
-
27
- /**
28
- * Redirect to new URL
29
- */
30
- private function redirect()
31
- {
32
- header('Location:' . $this->url);
33
- }
34
  }
3
 
4
  class Search extends BaseHandler
5
  {
 
 
 
 
 
 
6
  public function __construct()
7
  {
8
  parent::__construct();
17
  {
18
  $this->url = sanitize_text_field($_POST['page']) . '&search=' . sanitize_text_field($_POST['search_term']);
19
  }
 
 
 
 
 
 
 
 
20
  }
app/NestedPages.php CHANGED
@@ -12,7 +12,7 @@ class NestedPages
12
  $np_env = 'live';
13
 
14
  global $np_version;
15
- $np_version = '3.1.15';
16
 
17
  if ( is_admin() ) $app = new NestedPages\Bootstrap;
18
  if ( !is_admin() ) $app = new NestedPages\FrontEndBootstrap;
12
  $np_env = 'live';
13
 
14
  global $np_version;
15
+ $np_version = '3.1.16';
16
 
17
  if ( is_admin() ) $app = new NestedPages\Bootstrap;
18
  if ( !is_admin() ) $app = new NestedPages\FrontEndBootstrap;
app/Views/partials/bulk-edit.php CHANGED
@@ -1,11 +1,12 @@
1
  <?php
2
- $post_type_object = get_post_type_object( $this->post_type->name );
3
- $can_publish = current_user_can( $post_type_object->cap->publish_posts );
4
- $wpml_pages = ( $this->integrations->plugins->wpml->installed && $this->integrations->plugins->wpml->isDefaultLanguage()) ? true : false;
5
- $has_menu_options = ( $this->user->canSortPosts($this->post_type->name) && $this->post_type->name == 'page' && !$this->listing_repo->isSearch() && !$this->settings->menusDisabled() ) ? true : false;
6
  ?>
7
  <form data-np-bulk-edit-form class="nestedpages-bulk-edit" action="<?php echo admin_url('admin-post.php'); ?>" method="post">
8
  <input type="hidden" name="action" value="npBulkEdit">
 
9
  <input type="hidden" name="page" value="<?php echo $this->pageURL(); ?>">
10
  <input type="hidden" name="post_type" value="<?php echo $this->post_type->name; ?>">
11
 
1
  <?php
2
+ $post_type_object = get_post_type_object( $this->post_type->name );
3
+ $can_publish = current_user_can( $post_type_object->cap->publish_posts );
4
+ $wpml_pages = ( $this->integrations->plugins->wpml->installed && $this->integrations->plugins->wpml->isDefaultLanguage()) ? true : false;
5
+ $has_menu_options = ( $this->user->canSortPosts($this->post_type->name) && $this->post_type->name == 'page' && !$this->listing_repo->isSearch() && !$this->settings->menusDisabled() ) ? true : false;
6
  ?>
7
  <form data-np-bulk-edit-form class="nestedpages-bulk-edit" action="<?php echo admin_url('admin-post.php'); ?>" method="post">
8
  <input type="hidden" name="action" value="npBulkEdit">
9
+ <?php wp_nonce_field('nestedpages-nonce', 'nonce'); ?>
10
  <input type="hidden" name="page" value="<?php echo $this->pageURL(); ?>">
11
  <input type="hidden" name="post_type" value="<?php echo $this->post_type->name; ?>">
12
 
app/Views/partials/list-header.php CHANGED
@@ -5,6 +5,7 @@
5
  <form data-np-bulk-form style="display:none;" action="<?php echo admin_url('admin-post.php'); ?>" method="post" class="np-bulk-form">
6
  <input type="hidden" name="action" value="npBulkActions">
7
  <input type="hidden" name="page" value="<?php echo $this->pageURL(); ?>">
 
8
  <input type="hidden" name="redirect_post_ids" value="" data-np-bulk-redirect-ids>
9
  <input type="hidden" name="post_ids" value="" data-np-bulk-ids>
10
  <select id="np_bulk" name="np_bulk_action" class="nestedpages-sort">
5
  <form data-np-bulk-form style="display:none;" action="<?php echo admin_url('admin-post.php'); ?>" method="post" class="np-bulk-form">
6
  <input type="hidden" name="action" value="npBulkActions">
7
  <input type="hidden" name="page" value="<?php echo $this->pageURL(); ?>">
8
+ <?php wp_nonce_field('nestedpages-nonce', 'nonce'); ?>
9
  <input type="hidden" name="redirect_post_ids" value="" data-np-bulk-redirect-ids>
10
  <input type="hidden" name="post_ids" value="" data-np-bulk-ids>
11
  <select id="np_bulk" name="np_bulk_action" class="nestedpages-sort">
app/Views/partials/row.php CHANGED
@@ -128,7 +128,7 @@ if ( !$wpml ) $wpml_pages = true;
128
  <li>
129
  <a href="<?php echo admin_url( 'edit-comments.php?p=' . get_the_id() ); ?>">
130
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path class="primary" d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
131
- <?php echo sprintf(__('%i Comments', 'wp-nested-pages'), intval($comments->total_comments)); ?>
132
  </a>
133
  </li>
134
  <?php else : $cs = 'closed'; endif; ?>
128
  <li>
129
  <a href="<?php echo admin_url( 'edit-comments.php?p=' . get_the_id() ); ?>">
130
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path class="primary" d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
131
+ <?php echo sprintf(__('%d Comments', 'wp-nested-pages'), intval($comments->total_comments)); ?>
132
  </a>
133
  </li>
134
  <?php else : $cs = 'closed'; endif; ?>
app/Views/partials/tool-list.php CHANGED
@@ -146,6 +146,7 @@ if ( $wpml && $current_lang ) $searchLabel .= ' (' . $this->integrations->plugin
146
  <div class="select">
147
  <input type="hidden" name="action" value="npListingSort">
148
  <input type="hidden" name="page" value="<?php echo $this->pageURL(); ?>">
 
149
  <input type="hidden" name="post_type" value="<?php echo esc_attr($this->post_type->name); ?>">
150
  <input type="submit" id="nestedpages-sort" class="button" value="<?php echo esc_attr__('Apply', 'wp-nested-pages'); ?>">
151
  </div>
@@ -174,6 +175,7 @@ if ( $wpml && $current_lang ) $searchLabel .= ' (' . $this->integrations->plugin
174
  </div>
175
  <div class="select">
176
  <input type="hidden" name="action" value="npCategoryFilter">
 
177
  <input type="hidden" name="page" value="<?php echo esc_url($this->pageURL()); ?>">
178
  <input type="submit" id="nestedpages-sort" class="button" value="Apply">
179
  </div>
146
  <div class="select">
147
  <input type="hidden" name="action" value="npListingSort">
148
  <input type="hidden" name="page" value="<?php echo $this->pageURL(); ?>">
149
+ <?php wp_nonce_field('nestedpages-nonce', 'nonce'); ?>
150
  <input type="hidden" name="post_type" value="<?php echo esc_attr($this->post_type->name); ?>">
151
  <input type="submit" id="nestedpages-sort" class="button" value="<?php echo esc_attr__('Apply', 'wp-nested-pages'); ?>">
152
  </div>
175
  </div>
176
  <div class="select">
177
  <input type="hidden" name="action" value="npCategoryFilter">
178
+ <?php wp_nonce_field('nestedpages-nonce', 'nonce'); ?>
179
  <input type="hidden" name="page" value="<?php echo esc_url($this->pageURL()); ?>">
180
  <input type="submit" id="nestedpages-sort" class="button" value="Apply">
181
  </div>
assets/css/nestedpages.css CHANGED
@@ -1 +1 @@
1
- .np-btn{text-decoration:none;color:#555;display:inline-block;background-color:#f7f7f7;border:1px solid #e1e1e1;padding:5px 8px;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;vertical-align:top}.np-btn:hover{background-color:#0074a2;color:#fff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;border-color:#0074a2}.np-btn:disabled,.np-btn.disabled{opacity:.6;cursor:not-allowed}.np-btn.has-icon{padding:0}.np-btn-half{float:left;width:47%;padding:3px 0px;text-align:center}.np-btn-half.btn-right{float:right}.np-btn-trash{background-color:#e14d43;border-color:#e14d43;color:#fff}.np-btn-trash:hover{background-color:#ba281e;border-color:#ba281e}.np-quickedit-error{border-left:4px solid #dd3d36;padding:4px 0 4px 8px;margin-bottom:10px;background-color:#f9f9f9}.np-quickedit-info{border-left:4px solid #0074a2;padding:4px 0 4px 8px;margin-bottom:10px;background-color:#f9f9f9}.nestedpages-modal-backdrop{position:fixed;width:100%;height:100%;background-color:rgba(0,0,0,0.85);top:0;left:0;z-index:9999;visibility:hidden;opacity:0;-webkit-transition:all 500ms ease;-o-transition:all 500ms ease;transition:all 500ms ease}.nestedpages-modal-backdrop.active{visibility:visible;opacity:1;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease}.nestedpages-modal-content{z-index:99999;position:fixed;top:-200%;width:90%;height:80%;margin:10px auto 0px auto;background-color:#fff;left:5%;-webkit-transition:all 500ms ease;-o-transition:all 500ms ease;transition:all 500ms ease}.nestedpages-modal-content.small{width:400px;left:50%;margin-left:-200px}.nestedpages-modal-content.short{height:auto}.nestedpages-modal-content.active{top:50%;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.nestedpages-modal-content h5{font-size:1.1em}.nestedpages-modal-content .modal-body{position:relative;padding:10px}.nestedpages-modal-content .modal-body.new-child{padding:0}.nestedpages-modal-content .modal-footer{padding:10px;text-align:right;background-color:#404040;zoom:1}.nestedpages-modal-content .modal-footer:before,.nestedpages-modal-content .modal-footer:after{content:" ";display:table}.nestedpages-modal-content .modal-footer:after{clear:both}.nestedpages-modal-content .modal-footer .modal-close{float:left}.nestedpages-modal-content .modal-open .modal{overflow-x:hidden;overflow-y:auto}.nestedpages-modal-content .modal-content{position:relative;background-color:#fff;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);-webkit-background-clip:padding-box;background-clip:padding-box;outline:0}.nestedpages-modal-full{width:94%;height:94%;-webkit-transform:none;-ms-transform:none;transform:none;left:3%}.nestedpages-modal-full.active{top:3%}.nestedpages-modal-full .modal-header{position:absolute;top:0;left:0;width:100%;height:50px;z-index:4;zoom:1;padding-left:.5em}.nestedpages-modal-full .modal-header:before,.nestedpages-modal-full .modal-header:after{content:" ";display:table}.nestedpages-modal-full .modal-header:after{clear:both}.nestedpages-modal-full .modal-content-interior{padding-top:50px;height:100%}.nestedpages-modal-full .modal-content-interior .modal-content-body{height:100%;max-height:100%}.np-trash-modal{text-align:center}.np-trash-modal .modal-body{padding-bottom:30px}.np-trash-modal .button-primary{margin-left:10px}.clone-modal h3{margin:0;padding:8px;background-color:#e5e5e5}.clone-modal .form-control{margin:0 !important;padding:5px 10px}.np-inline-overlay{position:fixed;width:100%;height:100%;background-color:rgba(0,0,0,0.4);z-index:998;top:0;right:0;bottom:0;left:0;opacity:0;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease}.np-inline-overlay.active{opacity:1;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease}.np-inline-modal{position:relative;z-index:999;background-color:#fff;-webkit-border-radius:0;border-radius:0;-webkit-box-shadow:0px 0px 4px 0px rgba(0,0,0,0.5);box-shadow:0px 0px 4px 0px rgba(0,0,0,0.5)}.nestedpages-listing-title{zoom:1}.nestedpages-listing-title:before,.nestedpages-listing-title:after{content:" ";display:table}.nestedpages-listing-title:after{clear:both}.nestedpages .updated{clear:both}.nestedpages-toggleall.np-btn{float:right}.np-toggle-publish{color:#999}.np-toggle-publish.active{color:#333;font-weight:bold}.np-sync-menu-cont{float:right;margin:0px 15px 0px 0px}.np-sync-menu-cont button{position:relative;top:-5px;padding:5px 8px}.np-sync-menu-cont label{position:relative;top:4px}.nestedpages-top-toggles{float:right;zoom:1;padding-top:10px}.nestedpages-top-toggles:before,.nestedpages-top-toggles:after{content:" ";display:table}.nestedpages-top-toggles:after{clear:both}.np-tab-pane{display:none}.ul.np-tabs,.nestedpages ul.np-tabs{background:transparent;text-align:left;list-style-type:none;margin:0;padding:0;border-bottom:1px solid #ccc;margin-bottom:10px;font-size:0;line-height:0}.ul.np-tabs li,.nestedpages ul.np-tabs li{font-size:13px;line-height:1.4em;display:inline-block;margin:0 0 0 6px;border:0}.ul.np-tabs li a,.nestedpages ul.np-tabs li a{background-color:#e6e6e6;display:block;text-decoration:none;padding:8px 15px;color:#333;border:1px solid #ccc;border-bottom:0}.ul.np-tabs li a:hover,.nestedpages ul.np-tabs li a:hover{background-color:#fff}.ul.np-tabs li a:focus,.ul.np-tabs li a:active,.nestedpages ul.np-tabs li a:focus,.nestedpages ul.np-tabs li a:active{outline:none;-webkit-box-shadow:none;box-shadow:none}.ul.np-tabs li.active a,.nestedpages ul.np-tabs li.active a{font-weight:bold;position:relative;color:#333;background-color:#fff}.ul.np-tabs li.active a:after,.nestedpages ul.np-tabs li.active a:after{position:absolute;width:100%;height:2px;content:'';background-color:#fff;left:0;bottom:-1px}.nestedpages-datepicker.ui-datepicker{background-color:#fff;font-size:90%;-webkit-box-shadow:0px 0px 3px 0px rgba(0,0,0,0.4);box-shadow:0px 0px 3px 0px rgba(0,0,0,0.4);-webkit-border-radius:3px;border-radius:3px;padding:0;width:auto}.nestedpages-datepicker.ui-datepicker .ui-datepicker-next,.nestedpages-datepicker.ui-datepicker .ui-datepicker-prev{position:absolute;color:#fff;top:0px;right:0px;cursor:pointer;display:block;width:35px;height:35px;font-size:0;background:url("../images/datepicker-arrow-next.png");background-position:center;opacity:1;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease}.nestedpages-datepicker.ui-datepicker .ui-datepicker-next:hover,.nestedpages-datepicker.ui-datepicker .ui-datepicker-prev:hover{opacity:.5;-webkit-transition:opacity 200ms ease;-o-transition:opacity 200ms ease;transition:opacity 200ms ease}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar{margin:0}.nestedpages-datepicker.ui-datepicker .ui-datepicker-prev{right:auto;left:0px;background:url("../images/datepicker-arrow-prev.png")}.nestedpages-datepicker.ui-datepicker .ui-datepicker-header{padding:0}.nestedpages-datepicker.ui-datepicker .ui-datepicker-title{background-color:#1a1a1a;text-align:center;color:#fff;height:35px;line-height:35px;-webkit-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;margin:0}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar{border-collapse:collapse}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar table{width:auto}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar th,.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar td{text-align:center;width:30px;height:30px}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar th{background-color:#e6e6e6;text-transform:uppercase;font-size:11px;letter-spacing:1px;padding:0}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar td{border-top:1px solid #ebebeb;border-left:1px solid #ebebeb;padding:0}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar td:first-child{border-left:0}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar a{text-align:center;padding:0;text-decoration:none;color:#333;display:block;background-color:#fff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;width:30px;height:30px;line-height:30px}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar a.ui-state-active{background-color:#1a1a1a;color:#fff}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar a:hover{background-color:#333;color:#fff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease}.nestedpages-dropdown{position:relative;z-index:3;display:inline-block}.nestedpages-dropdown-content{display:none;position:absolute;top:40px;left:0;z-index:2;background-color:#fff;width:250px;text-align:left;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:1px 1px 3px 0px rgba(51,51,51,0.4);box-shadow:1px 1px 3px 0px rgba(51,51,51,0.4)}.nestedpages-dropdown-content.padded{padding:1em}.nestedpages-dropdown-content p{line-height:1.4;margin:0}.nestedpages-dropdown-content.right{left:auto;right:0}.nestedpages-dropdown-content ul{list-style-type:none;margin:0;padding:0;zoom:1}.nestedpages-dropdown-content ul:before,.nestedpages-dropdown-content ul:after{content:" ";display:table}.nestedpages-dropdown-content ul:after{clear:both}.nestedpages-dropdown-content ul li{float:none;width:100%;margin:0;line-height:1}.nestedpages-dropdown-content ul li a{display:block;color:#333;text-decoration:none}.nestedpages-dropdown-content ul li:first-child a{border:0}.nestedpages-dropdown-content.active{display:block}#nested-loading{display:none;float:right;width:30px;height:30px;margin:0px 20px 0 0;position:relative}#nested-loading svg{width:30px;height:30px;-webkit-animation:nestedpagesRotate linear 1.25s infinite;animation:nestedpagesRotate linear 1.25s infinite;position:absolute;left:0;top:0;line-height:.1}#nested-loading svg path{fill:#999}.np-qe-loading,.np-default-loading,.np-menu-search-loading{display:none;float:right;width:25px;height:25px;margin:2px 10px 0 0;position:relative;-webkit-animation:nestedpagesRotate linear 1.25s infinite;animation:nestedpagesRotate linear 1.25s infinite}.np-qe-loading svg,.np-default-loading svg,.np-menu-search-loading svg{position:absolute;left:0;top:0;width:25px;height:25px}.np-qe-loading svg path,.np-default-loading svg path,.np-menu-search-loading svg path{fill:#fff}.np-default-loading{float:none;margin:0}.np-default-loading svg path{fill:#999}@-webkit-keyframes nestedpagesRotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);-webkit-transform-origin:center center;transform-origin:center center}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transform-origin:center center;transform-origin:center center}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg);-webkit-transform-origin:center center;transform-origin:center center}}@keyframes nestedpagesRotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);-webkit-transform-origin:center center;transform-origin:center center}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transform-origin:center center;transform-origin:center center}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg);-webkit-transform-origin:center center;transform-origin:center center}}.nestedpages-tools{zoom:1;clear:both;clear:both;margin:20px 0px 5px 0px}.nestedpages-tools:before,.nestedpages-tools:after{content:" ";display:table}.nestedpages-tools:after{clear:both}.nestedpages-tools .subsubsub{margin:0}.nestedpages-tools .np-tools-primary{clear:left;padding-top:8px}.nestedpages-tools .select{float:left;margin-left:5px}.nestedpages-tools .select:first-child{margin-left:0}.nestedpages-tools .np-tools-sort{float:left}.nestedpages-tools .np-tools-search{float:right}.wppages-handle-expand{float:left;background-color:#f2f2f2;font-size:18px;width:46px;height:46px;margin-right:5px;text-align:center;border-right:1px solid #e1e1e1}.wppages-handle-expand div{background-color:#fff;border:1px solid #e1e1e1;width:24px;height:24px;line-height:24px;-webkit-border-radius:15px;border-radius:15px;margin-top:9px;cursor:pointer;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease}.wppages-handle-expand div:hover{background-color:#0074a2;border-color:#0074a2;color:#fff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease}.nestedpages{clear:both;-webkit-border-radius:4px;border-radius:4px}.nestedpages .ui-sortable-placeholder{display:block !important;position:relative;min-height:46px;border:0;border:1px dashed #0074a2 !important;background-color:#effaff;margin:0}.nestedpages .ui-sortable-helper{opacity:0.8;-webkit-box-shadow:2px 2px 3px 0px rgba(0,0,0,0.5);box-shadow:2px 2px 3px 0px rgba(0,0,0,0.5)}.nestedpages ol{list-style-type:none;clear:both;margin:0;border:1px solid #e5e5e5;-webkit-border-radius:3px;border-radius:3px}.nestedpages ol a{text-decoration:none}.nestedpages ol .page-link .edit-indicator{margin-left:10px;display:none}.nestedpages ol .page-link .edit-indicator i{font-size:12px;margin-right:3px}.nestedpages ol .page-link:hover .edit-indicator{display:inline}.nestedpages ol .np-page-type{color:#333}.nestedpages ol .locked{color:#333;margin-left:10px;padding-left:20px;position:relative}.nestedpages ol .locked svg{position:absolute;left:0;top:-5px;width:15px;height:24px}.nestedpages ol .locked em{font-style:normal}.nestedpages ol .row-status-icon{width:18px;height:18px;display:inline-block;vertical-align:middle;margin-left:5px}.nestedpages ol .row-status-icon .icon{fill:#b3b3b3}.nestedpages ol .status{color:#999}.nestedpages ol .sticky{color:#999}.nestedpages ol .np-icon-eye-blocked{color:#999}.nestedpages ol .nav-status{color:#b3b3b3}.nestedpages ol .np-hide{display:none}.nestedpages ol .np-assigned-pt-actions{list-style-type:none;margin:0;padding:0;display:inline-block;vertical-align:middle;margin-left:10px}.nestedpages ol .np-assigned-pt-actions li{display:none;background:transparent;border:0}.nestedpages ol .np-assigned-pt-actions li.visible{display:inline-block}.nestedpages ol .np-assigned-pt-actions li a{color:#333;display:block;border-left:1px solid #e1e1e1;padding:0 5px}.nestedpages ol .np-assigned-pt-actions li:first-child a{border:0;padding-left:0}.nestedpages ol .np-seo-indicator{display:block;position:absolute;right:10px;top:50%;margin-top:-6px;width:12px;height:12px;-webkit-border-radius:50%;border-radius:50%;background-color:#999}.nestedpages ol .np-seo-indicator.good{background-color:#7ad03a}.nestedpages ol .np-seo-indicator.ok{background-color:#ffba00}.nestedpages ol .np-seo-indicator.poor{background-color:#ee7c1b}.nestedpages ol .np-seo-indicator.bad{background-color:#dd3d36}.nestedpages ol .np-seo-indicator.warn{background-color:maroon}.nestedpages ol .np-seo-indicator.wrong{background-color:red}.nestedpages ol .np-seo-indicator.noindex{background-color:#1e8cbe}.nestedpages ol li{margin:0;border-top:1px solid #e1e1e1;background-color:#0074a2}.nestedpages ol li.first{border:0}.nestedpages ol li:first-child{border:0}.nestedpages ol li.no-border{border:0}.nestedpages ol ol{display:none;-webkit-border-radius:0;border-radius:0;list-style-type:none;border:0;-webkit-box-shadow:none;box-shadow:none;border-top:1px solid #e1e1e1}.nestedpages .np-search-results .np-hide{display:block}.nestedpages .child-toggle{display:table-cell;width:30px;text-align:left}.nestedpages .child-toggle .child-toggle-spacer{display:inline-block;vertical-align:middle;height:50px;width:1px}.nestedpages .child-toggle a{display:inline-block;text-align:center;vertical-align:middle;width:29px;height:29px;line-height:29px;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;-webkit-transform-origin:center;-ms-transform-origin:center;transform-origin:center;-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg)}.nestedpages .child-toggle a.open{-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.nestedpages .child-toggle a:focus,.nestedpages .child-toggle a:active{outline:none}.nestedpages .np-icon-arrow{display:inline-block;vertical-align:middle;width:0;height:0;position:relative;top:-3px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:6px solid #333}.nestedpages .non-indent .child-toggle{width:46px;background-color:#f0f0f0;position:relative}.nestedpages .non-indent .child-toggle .child-toggle-spacer{display:block;height:46px;width:46px}.nestedpages .non-indent .child-toggle a{position:absolute;top:50%;display:inline-block;vertical-align:middle;left:8px;margin-top:-16px;width:28px;height:28px;background-color:#fff;border:1px solid #e1e1e1;-webkit-border-radius:50%;border-radius:50%;line-height:28px;color:#333;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg)}.nestedpages .non-indent .child-toggle a.open{-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.nestedpages .non-indent .child-toggle a:hover{background-color:#333;border-color:#333}.nestedpages .non-indent .child-toggle a:hover .np-icon-arrow{border-left-color:#fff}.nestedpages .non-indent .np-icon-arrow{border-top-width:4px;border-bottom-width:4px;border-left-width:6px}.nestedpages .handle{display:inline-block;opacity:.4;vertical-align:middle;cursor:move;position:relative;top:-1px;width:20px;height:20px;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease}.nestedpages .handle .bars{fill:#b3b3b3}.nestedpages .handle:hover{-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;color:#0074a2}.nestedpages .np-icon-sub-menu{display:none;vertical-align:middle;width:20px;height:20px}.nestedpages .np-icon-sub-menu .arrow{fill:#999}.nestedpages .row.no-sort .page-title{padding-left:10px}.nestedpages .row.no-sort-filtered .page-title{padding-left:34px}.nestedpages .page-title{display:inline-block;vertical-align:middle}.nestedpages .page-title .link-icon{width:20px;height:20px;display:inline;vertical-align:middle;margin-left:8px;position:relative;top:-2px}.nestedpages .page-title .link-icon .icon{fill:#b3b3b3}.nestedpages .np-thumbnail{display:table-cell;width:80px;vertical-align:middle;zoom:1}.nestedpages .np-thumbnail:before,.nestedpages .np-thumbnail:after{content:" ";display:table}.nestedpages .np-thumbnail:after{clear:both}.nestedpages .np-thumbnail img{float:right;width:100%;height:auto}.nestedpages .np-thumbnail.large{width:150px}.nestedpages .np-thumbnail.small{width:50px}.nestedpages .np-thumbnail.link{text-align:center}.nestedpages .np-bulk-checkbox{display:table-cell;width:33px;vertical-align:middle;text-align:center;background-color:#f0f0f0}.nestedpages .np-bulk-checkbox input[type="checkbox"]{margin-right:0}.nestedpages .handle,.nestedpages .np-icon-sub-menu{width:30px;text-align:center;vertical-align:middle}.nestedpages .non-indent li ol .row .np-icon-sub-menu{display:inline-block}.nestedpages .non-indent li ol .row .handle{display:none}.nestedpages .non-indent li ol .row:hover .np-icon-sub-menu{display:none}.nestedpages .non-indent li ol .row:hover .handle{display:inline-block}.nestedpages .non-indent li ol .row.no-sort .np-icon-sub-menu{display:inline-block}.nestedpages .no-sort ol li .row:hover .np-icon-sub-menu{display:inline-block}.nestedpages .row{background-color:#fff;display:table;width:100%}.nestedpages .row:hover,.nestedpages .row.active{background-color:#f0f0f0}.nestedpages .row:hover .handle,.nestedpages .row.active .handle{opacity:1}.nestedpages .row:hover .np-assigned-pt-actions li,.nestedpages .row.active .np-assigned-pt-actions li{display:inline-block}.nestedpages .row:hover .cell.custom-column,.nestedpages .row.active .cell.custom-column{visibility:hidden}.nestedpages .row.np-updated{background-color:#e9f7df;-webkit-transition:background-color 400ms ease;-o-transition:background-color 400ms ease;transition:background-color 400ms ease}.nestedpages .row.np-updated-show{background-color:#fff;-webkit-transition:background-color 400ms ease;-o-transition:background-color 400ms ease;transition:background-color 400ms ease}.nestedpages .row.search .page-title{padding-left:10px}.nestedpages .non-hierarchical-spacer{height:47px}.nestedpages .row-inner{display:table-cell;vertical-align:middle;position:relative}.nestedpages ol li ol .row-inner{padding-left:0px}.nestedpages ol li ol li ol .row-inner{padding-left:20px}.nestedpages ol li ol li ol li ol .row-inner{padding-left:40px}.nestedpages ol li ol li ol li ol li ol .row-inner{padding-left:60px}.nestedpages ol li ol li ol li ol li ol li ol .row-inner{padding-left:80px}.nestedpages .np-post-columns{float:right;margin:3px 20px 0px 0px;zoom:1}.nestedpages .np-post-columns:before,.nestedpages .np-post-columns:after{content:" ";display:table}.nestedpages .np-post-columns:after{clear:both}.nestedpages .np-post-columns ul li{background:transparent;color:gray;border:0;float:left;margin-left:8px;padding-left:8px;border-left:1px solid #ccc}.nestedpages .np-post-columns ul li:first-child{margin-left:0;padding-left:0;border:0}.nestedpages .has-yoast .np-post-columns{margin-right:30px}.nestedpages .has-custom-columns .np-post-columns{display:none}.nestedpages .action-buttons{display:none;position:absolute;right:10px;top:50%;margin-top:-15px}.nestedpages .action-buttons a{margin:0 0 0 -5px;padding:0 .5em;height:30px;line-height:30px}.nestedpages .action-buttons a.np-btn-trash{margin-left:4px}.nestedpages .action-buttons a.np-btn-trash svg{width:20px;height:20px;position:relative;top:4px}.nestedpages .action-buttons a.np-btn-trash svg .icon{fill:#fff}.nestedpages .action-buttons .nestedpages-dropdown{display:inline-block;vertical-align:middle}.nestedpages .action-buttons .nestedpages-dropdown .np-btn.toggle{background:transparent;border:0}.nestedpages .action-buttons .nestedpages-dropdown .np-btn.toggle svg{position:relative;top:4px}.nestedpages .action-buttons .nestedpages-dropdown .np-btn.toggle:active,.nestedpages .action-buttons .nestedpages-dropdown .np-btn.toggle:focus{-webkit-box-shadow:none;box-shadow:none}.nestedpages .action-buttons .nestedpages-dropdown .np-btn.toggle.active{color:gray}.nestedpages .action-buttons .nestedpages-dropdown ul{left:auto;right:5px;width:180px}.nestedpages .action-buttons .nestedpages-dropdown ul li{background-color:#fff}.nestedpages .action-buttons .nestedpages-dropdown ul li a{display:block;color:#333;line-height:1.2;height:auto;margin:0;padding:10px 5px 10px 30px;position:relative}.nestedpages .action-buttons .nestedpages-dropdown ul li a.disabled{opacity:.3}.nestedpages .action-buttons .nestedpages-dropdown ul li a svg{position:absolute;left:0;width:20px;height:20px;top:8px;margin-right:5px;margin-left:5px}.np-search{float:right}.nestedpages-list-header{background-color:#fff;border:1px solid #e1e1e1;border-bottom:0;height:46px;zoom:1}.nestedpages-list-header:before,.nestedpages-list-header:after{content:" ";display:table}.nestedpages-list-header:after{clear:both}.nestedpages-list-header .np-check-all{float:right;width:33px;text-align:center;line-height:46px;background-color:#f0f0f0}.nestedpages-list-header .np-check-all input[type="checkbox"]{margin:0}.nestedpages-list-header .np-check-all input[type="checkbox"].check-all-partial:checked:before{content:"-";margin:0;margin-top:-9px}.nestedpages-list-header .np-hidden-select-count{display:none;float:right;margin:0 1em 0 0;line-height:46px;font-style:oblique}.nestedpages-list-header .np-bulk-form{padding-right:3px;float:right;margin-right:5px;position:relative;top:9px}.nestedpages-list-header .np-bulk-form select,.nestedpages-list-header .np-bulk-form input[type="submit"]{display:inline-block}@media (min-width: 768px){.nestedpages .row:hover .action-buttons,.nestedpages .row.active .action-buttons{display:block}.nestedpages .row:hover .np-post-columns,.nestedpages .row.active .np-post-columns{display:none}}@media (max-width: 767px){.nestedpages ol .page-link{line-height:24px}.nestedpages ol .page-link:hover span{display:none}.nestedpages ol .locked em{display:none}.nestedpages .child-toggle{background:transparent}.nestedpages .row{height:auto}.nestedpages .action-buttons{display:none;background-color:#0074a2;float:none;margin:0;padding:8px}.nestedpages .action-buttons a{margin-left:5px}}.nestedpages .quick-edit .header,.nestedpages .new-child .header{padding:10px 0px 0 0px;background-color:#f2f2f2;position:relative}.nestedpages .quick-edit .header h3,.nestedpages .new-child .header h3{position:absolute;right:10px;top:15px;font-size:12px}.nestedpages .quick-edit .header h3 span,.nestedpages .new-child .header h3 span{display:inline-block;float:none;margin-left:10px}.nestedpages .quick-edit .header.no-tabs,.nestedpages .new-child .header.no-tabs{zoom:1;padding:10px;border-bottom:1px solid #ccc}.nestedpages .quick-edit .header.no-tabs:before,.nestedpages .quick-edit .header.no-tabs:after,.nestedpages .new-child .header.no-tabs:before,.nestedpages .new-child .header.no-tabs:after{content:" ";display:table}.nestedpages .quick-edit .header.no-tabs:after,.nestedpages .new-child .header.no-tabs:after{clear:both}.nestedpages .quick-edit .header.no-tabs h3,.nestedpages .new-child .header.no-tabs h3{position:relative;top:5px;right:auto;float:right}.nestedpages .quick-edit .np-menuoptions-description,.nestedpages .new-child .np-menuoptions-description{background-color:#f2f2f2;margin-bottom:15px;margin-top:-8px;padding:8px 10px;border:1px solid #e1e1e1}.nestedpages .quick-edit .np-menuoptions-description p,.nestedpages .new-child .np-menuoptions-description p{margin:0 0 2px 0}.nestedpages .quick-edit .np-menuoptions-description p.note,.nestedpages .new-child .np-menuoptions-description p.note{font-size:.9em;margin:0;opacity:.7}.nestedpages .quick-edit .form-interior,.nestedpages .new-child .form-interior{padding:10px}.nestedpages .quick-edit h3,.nestedpages .new-child h3{margin:0 0 8px 0;font-size:14px}.nestedpages .quick-edit h3 span,.nestedpages .new-child h3 span{float:right;font-size:12px}.nestedpages .quick-edit h3 span em,.nestedpages .new-child h3 span em{font-weight:normal;font-style:normal;color:gray}.nestedpages .quick-edit .fields,.nestedpages .new-child .fields{margin-bottom:10px;background:url("../images/border.png") repeat-y;background-position:center;zoom:1}.nestedpages .quick-edit .fields:before,.nestedpages .quick-edit .fields:after,.nestedpages .new-child .fields:before,.nestedpages .new-child .fields:after{content:" ";display:table}.nestedpages .quick-edit .fields:after,.nestedpages .new-child .fields:after{clear:both}.nestedpages .quick-edit .left,.nestedpages .new-child .left{float:left;width:48%}.nestedpages .quick-edit .right,.nestedpages .new-child .right{float:right;width:48%}.nestedpages .quick-edit label,.nestedpages .new-child label{font-style:oblique}.nestedpages .quick-edit .buttons,.nestedpages .new-child .buttons{clear:both;zoom:1;background-color:#404040;padding:8px}.nestedpages .quick-edit .buttons:before,.nestedpages .quick-edit .buttons:after,.nestedpages .new-child .buttons:before,.nestedpages .new-child .buttons:after{content:" ";display:table}.nestedpages .quick-edit .buttons:after,.nestedpages .new-child .buttons:after{clear:both}.nestedpages .quick-edit .form-control,.nestedpages .new-child .form-control{clear:both;zoom:1;margin-bottom:5px}.nestedpages .quick-edit .form-control:before,.nestedpages .quick-edit .form-control:after,.nestedpages .new-child .form-control:before,.nestedpages .new-child .form-control:after{content:" ";display:table}.nestedpages .quick-edit .form-control:after,.nestedpages .new-child .form-control:after{clear:both}.nestedpages .quick-edit .form-control input[type='text'],.nestedpages .quick-edit .form-control input[type='password'],.nestedpages .quick-edit .form-control select,.nestedpages .new-child .form-control input[type='text'],.nestedpages .new-child .form-control input[type='password'],.nestedpages .new-child .form-control select{float:right;width:75%}.nestedpages .quick-edit .form-control label,.nestedpages .new-child .form-control label{float:left;width:20%}.nestedpages .quick-edit .form-control.original-link,.nestedpages .new-child .form-control.original-link{background-color:#f9f9f9;border:1px solid #e1e1e1;padding:5px;font-style:oblique;margin-bottom:8px}.nestedpages .quick-edit .form-control.password label,.nestedpages .new-child .form-control.password label{width:25%}.nestedpages .quick-edit .form-control.password input[type="text"],.nestedpages .new-child .form-control.password input[type="text"]{float:left;width:35%}.nestedpages .quick-edit .form-control.password .private,.nestedpages .new-child .form-control.password .private{float:right;width:35%;margin-top:4px}.nestedpages .quick-edit .form-control.password .private label,.nestedpages .new-child .form-control.password .private label{width:auto;float:none}.nestedpages .quick-edit .form-control.np-datepicker-container .datetime,.nestedpages .new-child .form-control.np-datepicker-container .datetime{float:right;width:75%}.nestedpages .quick-edit .form-control.np-datepicker-container .np-time-container,.nestedpages .new-child .form-control.np-datepicker-container .np-time-container{float:left;width:45%;margin:0;position:relative}.nestedpages .quick-edit .form-control.np-datepicker-container .np-time-container input[type="text"],.nestedpages .new-child .form-control.np-datepicker-container .np-time-container input[type="text"]{float:left;width:55%}.nestedpages .quick-edit .form-control.np-datepicker-container .np-time-container select,.nestedpages .new-child .form-control.np-datepicker-container .np-time-container select{float:right;width:35%}.nestedpages .quick-edit .form-control.np-datepicker-container .np_datepicker,.nestedpages .new-child .form-control.np-datepicker-container .np_datepicker{float:left;width:45%;margin:0}.nestedpages .quick-edit .form-control.np-datepicker-container .np_datepicker.full,.nestedpages .new-child .form-control.np-datepicker-container .np_datepicker.full{width:100%}.nestedpages .quick-edit .form-control.np-datepicker-container span,.nestedpages .new-child .form-control.np-datepicker-container span{float:left;width:10%;display:block;text-align:center;padding-top:3px}.nestedpages .quick-edit .form-control.full label,.nestedpages .new-child .form-control.full label{width:auto}.nestedpages .quick-edit .form-control.full.checkbox label,.nestedpages .new-child .form-control.full.checkbox label{padding:5px 0 5px 25%}.nestedpages .quick-edit .comments,.nestedpages .new-child .comments{float:right;width:75%;margin-bottom:10px;zoom:1}.nestedpages .quick-edit .comments:before,.nestedpages .quick-edit .comments:after,.nestedpages .new-child .comments:before,.nestedpages .new-child .comments:after{content:" ";display:table}.nestedpages .quick-edit .comments:after,.nestedpages .new-child .comments:after{clear:both}.nestedpages .quick-edit .dates,.nestedpages .new-child .dates{float:right;width:75%;margin-bottom:6px}.nestedpages .quick-edit .dates select,.nestedpages .new-child .dates select{width:25%}.nestedpages .quick-edit .dates input,.nestedpages .new-child .dates input{width:12%}.nestedpages .quick-edit .np-taxonomies,.nestedpages .quick-edit .np-menuoptions,.nestedpages .new-child .np-taxonomies,.nestedpages .new-child .np-menuoptions{zoom:1;background-color:#fff}.nestedpages .quick-edit .np-taxonomies:before,.nestedpages .quick-edit .np-taxonomies:after,.nestedpages .quick-edit .np-menuoptions:before,.nestedpages .quick-edit .np-menuoptions:after,.nestedpages .new-child .np-taxonomies:before,.nestedpages .new-child .np-taxonomies:after,.nestedpages .new-child .np-menuoptions:before,.nestedpages .new-child .np-menuoptions:after{content:" ";display:table}.nestedpages .quick-edit .np-taxonomies:after,.nestedpages .quick-edit .np-menuoptions:after,.nestedpages .new-child .np-taxonomies:after,.nestedpages .new-child .np-menuoptions:after{clear:both}.nestedpages .quick-edit .np-taxonomy,.nestedpages .new-child .np-taxonomy{float:left;width:30%;margin-right:3.33%}.nestedpages .quick-edit .np-taxonomy .title,.nestedpages .new-child .np-taxonomy .title{font-weight:bold;margin-bottom:4px;display:block}.nestedpages .quick-edit .np-taxonomy li,.nestedpages .new-child .np-taxonomy li{background-color:#fff;border:0}.nestedpages .quick-edit .np-taxonomy textarea,.nestedpages .new-child .np-taxonomy textarea{width:100%;height:6.5em}.nestedpages .quick-edit .np-menuoptions .left label,.nestedpages .new-child .np-menuoptions .left label{width:30%}.nestedpages .quick-edit .np-menuoptions .left input,.nestedpages .new-child .np-menuoptions .left input{width:65%}.nestedpages .quick-edit .np-menuoptions .right label,.nestedpages .new-child .np-menuoptions .right label{margin-bottom:5px;display:block;float:none;width:100%}.nestedpages .quick-edit .np-hide-options,.nestedpages .new-child .np-hide-options{display:none;background-color:#f0f0f0;-webkit-border-radius:3px;border-radius:3px;clear:both;padding:6px;-webkit-box-sizing:border-box;box-sizing:border-box}.nestedpages .quick-edit .np-hide-options p,.nestedpages .new-child .np-hide-options p{margin:0}.nestedpages .quick-edit .np-hide-options label,.nestedpages .new-child .np-hide-options label{display:block;margin-top:4px;font-style:normal}.nestedpages .quick-edit .new-page-titles,.nestedpages .new-child .new-page-titles{display:block;border:0}.nestedpages .quick-edit .new-page-titles li,.nestedpages .new-child .new-page-titles li{background:transparent;border:0;padding:4px;zoom:1}.nestedpages .quick-edit .new-page-titles li:before,.nestedpages .quick-edit .new-page-titles li:after,.nestedpages .new-child .new-page-titles li:before,.nestedpages .new-child .new-page-titles li:after{content:" ";display:table}.nestedpages .quick-edit .new-page-titles li:after,.nestedpages .new-child .new-page-titles li:after{clear:both}.nestedpages .quick-edit .new-page-titles li:nth-child(even),.nestedpages .new-child .new-page-titles li:nth-child(even){background-color:#f0f0f0}.nestedpages .quick-edit .new-page-titles li label,.nestedpages .new-child .new-page-titles li label{margin-top:7px}.nestedpages .quick-edit .new-page-titles .form-control,.nestedpages .new-child .new-page-titles .form-control{float:right;width:90%;clear:none}.nestedpages .quick-edit .new-page-titles .np-icon-menu,.nestedpages .new-child .new-page-titles .np-icon-menu{float:left;margin-top:0px;width:24px;height:24px;position:relative;top:5px}.nestedpages .quick-edit .new-page-titles .new-child-row div,.nestedpages .new-child .new-page-titles .new-child-row div{float:right;width:75%;margin:2px;zoom:1}.nestedpages .quick-edit .new-page-titles .new-child-row div:before,.nestedpages .quick-edit .new-page-titles .new-child-row div:after,.nestedpages .new-child .new-page-titles .new-child-row div:before,.nestedpages .new-child .new-page-titles .new-child-row div:after{content:" ";display:table}.nestedpages .quick-edit .new-page-titles .new-child-row div:after,.nestedpages .new-child .new-page-titles .new-child-row div:after{clear:both}.nestedpages .quick-edit .new-page-titles .new-child-row div input[type='text'],.nestedpages .new-child .new-page-titles .new-child-row div input[type='text']{float:left;width:80%}.nestedpages .quick-edit .new-page-titles .new-child-row div a,.nestedpages .new-child .new-page-titles .new-child-row div a{float:right}.np-modal.nestedpages .new-child .right .form-control input[type='text'],.np-modal.nestedpages .new-child .right .form-control input[type='password'],.np-modal.nestedpages .new-child .right .form-control select{float:none;width:100%}.np-modal.nestedpages .new-child .right .form-control label{float:none;width:100%}.np-modal.nestedpages .new-child .right .form-control.full label{padding-left:0}.np-modal.nestedpages .new-child .new-page-titles .form-control{width:85%}.np-modal.nestedpages .new-child .new-page-titles .form-control div{width:100%}.np-modal.nestedpages .new-child .left label{display:none}@media (max-width: 767px){.nestedpages .quick-edit .fields{background:transparent}.nestedpages .quick-edit .left,.nestedpages .quick-edit .right{float:none;width:100%}.nestedpages .quick-edit .form-control{margin-bottom:10px}.nestedpages .quick-edit .form-control input[type='text'],.nestedpages .quick-edit .form-control input[type='password'],.nestedpages .quick-edit .form-control select{float:none;width:100%}.nestedpages .quick-edit .form-control label{display:block;float:none;width:100%;margin-bottom:4px}.nestedpages .quick-edit .form-control.np-datepicker-container .datetime{float:none;width:100%}.nestedpages .quick-edit .comments{float:none;width:100%}.nestedpages .quick-edit .dates{float:none;width:100%;margin-bottom:6px}}.np-modal-form .form-interior{zoom:1;background:url("../images/border.png") repeat-y;background-position:center;padding:5px 0}.np-modal-form .form-interior:before,.np-modal-form .form-interior:after{content:" ";display:table}.np-modal-form .form-interior:after{clear:both}.np-modal-form .form-control{zoom:1;margin-bottom:10px}.np-modal-form .form-control:before,.np-modal-form .form-control:after{content:" ";display:table}.np-modal-form .form-control:after{clear:both}.np-modal-form .checkbox{margin-bottom:10px}.np-modal-form .left{float:left;width:45%}.np-modal-form .right{float:right;width:45%;padding-top:18px}.np-modal-form label{display:block}.np-modal-form input[type="text"],.np-modal-form select{width:100%}.np-modal-form .buttons{clear:both}.np-new-child-form.in-modal{padding-bottom:50px}.modal-body.np-menu-item-form{height:100%;padding:0;border-top:1px solid #e1e1e1;position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-webkit-align-items:stretch;-ms-flex-align:stretch;align-items:stretch}.np-link-modal-content .np-tabbed-content,.np-link-modal-content .new-child{height:100%}.np-link-modal-content .np-tabbed-content form,.np-link-modal-content .new-child form{height:94%}.np-link-modal-content .modal-content,.np-link-modal-content .form-interior{position:relative;height:100%}.np-link-modal-content .form-interior{overflow:auto}.np-link-modal-content .modal-footer,.np-link-modal-content .buttons{position:absolute;left:0;width:100%;bottom:0;padding:0}.np-link-modal-content .buttons{padding:0 !important}.np-link-modal-content .footer-inner,.np-link-modal-content .buttons-inner{padding:10px;zoom:1}.np-link-modal-content .footer-inner:before,.np-link-modal-content .footer-inner:after,.np-link-modal-content .buttons-inner:before,.np-link-modal-content .buttons-inner:after{content:" ";display:table}.np-link-modal-content .footer-inner:after,.np-link-modal-content .buttons-inner:after{clear:both}.np-menu-type-selection{overflow:auto;width:35%;padding:15px;background-color:#f9f9f9;border-right:1px solid #e1e1e1;-webkit-box-sizing:border-box;box-sizing:border-box}.np-menu-type-selection ul{list-style-type:none;margin:0;padding:0;border:1px solid #e5e5e5;-webkit-border-radius:3px;border-radius:3px;border:0}.np-menu-type-selection ul li{margin:0;border:1px solid #e5e5e5;border-top:0}.np-menu-type-selection ul li a{background-color:#fff;display:block;text-decoration:none;padding:15px 10px;position:relative;color:#333;font-weight:bold;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease}.np-menu-type-selection ul li a:hover{background-color:#ebebeb;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease}.np-menu-type-selection ul li a:after{position:absolute;font-family:"dashicons";content:"\f140";font-size:18px;right:10px;top:15px;color:gray}.np-menu-type-selection ul li a.active:after{content:"\f142"}.np-menu-type-selection ul li a.np-custom-link:after{content:"\f139"}.np-menu-type-selection ul li a.np-custom-link.active{background-color:#0074a2;color:#fff}.np-menu-type-selection ul li a.np-custom-link.active:after{content:"\f335";color:#fff}.np-menu-type-selection ul li a:active,.np-menu-type-selection ul li a:focus{-webkit-box-shadow:none;box-shadow:none}.np-menu-type-selection ul li a.no-terms{color:#b3b3b3}.np-menu-type-selection ul li a.no-terms span{float:right;font-weight:normal;font-style:oblique}.np-menu-type-selection ul li a.no-terms:after{content:''}.np-menu-type-selection ul li a.no-terms:hover{background-color:#fff;cursor:default}.np-menu-type-selection ul li a.no-terms.section{padding:8px 10px;background-color:#333;color:#fff}.np-menu-type-selection ul li:first-child{border-top:1px solid #e5e5e5}.np-menu-type-selection ul li ul{display:none;-webkit-box-shadow:none;box-shadow:none;padding:10px;background-color:#fff}.np-menu-type-selection ul li ul li{border-color:#e0e0e0}.np-menu-type-selection ul li ul li a{padding:8px;background-color:#f9f9f9;font-weight:normal}.np-menu-type-selection ul li ul li a:after{content:"\f139";top:8px;right:5px}.np-menu-type-selection ul li ul li a.active{background-color:#0074a2;color:#fff}.np-menu-type-selection ul li ul li a.active:after{content:"\f335";color:#fff}.np-menu-link-object{width:65%;overflow:auto}.np-menu-link-object-placeholder{text-align:center;position:relative;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);color:#b3b3b3}.np-menu-search{padding:10px;background-color:#f9f9f9}.np-menu-search input[type="text"]{width:100%;height:35px}.np-menu-search .np-menu-search-loading{margin-top:5px}.np-menu-search .np-menu-search-noresults{display:none;text-align:center;padding-top:8px;font-style:oblique}.np-menu-link-details{padding:20px}.np-menu-link-details h3{margin-top:0}.np-menu-link-details h3 em{float:right;font-size:13px;font-weight:normal;font-style:normal;color:gray}.np-menu-link-details .original-link{border:1px solid #e5e5e5;font-size:12px;margin-bottom:15px;padding:5px;font-style:oblique}.np-menu-link-details .fields{background-color:#f9f9f9;padding:15px}.np-menu-link-details p{margin-top:0}.np-menu-link-details .checkbox{margin-bottom:10px}.np-menu-link-details label{display:block}.np-menu-link-details input[type="text"]{width:100%}.nestedpages .nestedpages-bulk-edit{display:none;background-color:#fff;margin:0;border:1px solid #e1e1e1;border-bottom:0}.nestedpages .nestedpages-bulk-edit h3{padding:1em;margin:0}.nestedpages .nestedpages-bulk-edit .np-bulk-edit-link-info{padding:0 1em}.nestedpages .nestedpages-bulk-edit .fields{padding:1em;margin:0}.nestedpages .nestedpages-bulk-edit .np-taxonomies{margin:0}.nestedpages .nestedpages-bulk-edit .np-bulk-titles{list-style-type:none;margin:0;padding:0;background-color:#f9f9f9;border:1px solid #e5e5e5;border-left:0;border-right:0;padding:.5em}.nestedpages .nestedpages-bulk-edit .np-bulk-titles li{padding:0;margin:.5em 0 0 0}.nestedpages .nestedpages-bulk-edit .np-bulk-titles li:first-child{margin:0}.nestedpages .nestedpages-bulk-edit .np-bulk-titles .np-remove{display:inline-block;background-color:#333;width:22px;height:22px;-webkit-border-radius:50%;border-radius:50%;text-align:center;text-decoration:none;color:#fff;line-height:18px;font-size:1.5em;margin-right:.3em}.nestedpages .nestedpages-bulk-edit .np-bulk-titles .np-remove:hover{background-color:gray}.nestedpages .nestedpages-bulk-edit .np-taxonomies{display:block;padding:1em}.nestedpages .nestedpages-bulk-edit .np-bulk-footer{padding:10px;text-align:right;background-color:#404040;zoom:1}.nestedpages .nestedpages-bulk-edit .np-bulk-footer:before,.nestedpages .nestedpages-bulk-edit .np-bulk-footer:after{content:" ";display:table}.nestedpages .nestedpages-bulk-edit .np-bulk-footer:after{clear:both}.nestedpages .nestedpages-bulk-edit .np-bulk-footer .pull-left{float:left}.nestedpages-columns-header{display:table;border-collapse:collapse;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#f0f0f0;border:1px solid #e1e1e1;border-bottom:0}.nestedpages-columns-header .cell{font-weight:bold;text-align:left;display:table-cell;padding:1em .5em 1em 0;-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:middle}.nestedpages-columns-header .toggle-spacer span{display:block;width:50px}.nestedpages-columns-header .bulk-spacer span{display:block;width:33px}.nestedpages-columns-header .thumbnail-spacer span{display:block;width:100%}.nestedpages-columns-header .title{width:30%;padding:0 5px}.nestedpages-row-columns{display:table;width:100%;border-collapse:collapse;-webkit-box-sizing:border-box;box-sizing:border-box}.nestedpages-row-columns .cell{text-align:left;display:table-cell;padding:1em .5em 1em 0;-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:middle}.nestedpages-row-columns .title-cell{width:30%;position:relative}.nestedpages-row-columns .title-cell-spacer{position:absolute;display:block;width:100%}@media (max-width: 767px){.nestedpages-row-columns .custom-column,.nestedpages-columns-header{display:none}.nestedpages-row-columns .title-cell.cell{width:100%}}.np-wpml-translations-modal .np-qe-loading{margin:1em 0;text-align:center;float:left}.np-wpml-translations-modal .np-qe-loading svg path{fill:#999}.np-wpml-translations-modal.loading .np-translations-table{display:none}.np-wpml-translations-modal.loading .np-qe-loading{display:block}.np-wpml-translations-modal .np-translations-table{display:table;border-collapse:collapse;width:100%}.np-wpml-translations-modal .np-translations-table tr td{padding:10px;border:1px solid #e1e1e1}.np-wpml-translations-modal .np-translations-table tr td:first-child{border-left:0;padding-left:0}.np-wpml-translations-modal .np-translations-table tr td:last-child{border-right:0}.np-wpml-translations-modal .np-translations-table tr:last-child td{border-bottom:0}.nestedpages-settings-table{border:1px solid #d9d9d9;border-collapse:collapse}.nestedpages-settings-table thead th{background-color:#d9d9d9;padding:5px}.nestedpages-settings-table tbody tr td{padding:5px;border-left:1px solid #e0e0e0}.nestedpages-settings-table tbody tr td:first-child{border:0}.nestedpages-settings-table tbody tr:nth-child(odd) td{background-color:#fff}.nestedpages-settings-table i{font-size:20px}.nestedpages-settings-table .np-btn{cursor:pointer;text-decoration:none;color:#555;display:inline-block;background-color:#f7f7f7;border:1px solid #e1e1e1;padding:5px 8px;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease}.nestedpages-settings-table .np-btn:hover{background-color:#0074a2;color:#fff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;border-color:#0074a2}.nestedpages-settings-table .np-btn:disabled,.nestedpages-settings-table .np-btn.disabled{opacity:.6;cursor:not-allowed}.nestedpages-settings-table .np-btn-trash{background-color:#e14d43;border-color:#e14d43;color:#fff}.nestedpages-settings-table .np-btn-trash:hover{background-color:#ba281e;border-color:#ba281e}.nestedpages-settings-general-wrapper{padding-top:1em;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start}.nestedpages-settings-general-wrapper .nestedpages-settings-table{width:67%;border:0}.nestedpages-settings-general-wrapper .nestedpages-settings-table .row{border-left:1px solid #e1e1e1;border-right:1px solid #e1e1e1}.nestedpages-settings-general-wrapper .nestedpages-settings-table .row.submit{border:0}.nestedpages-settings-general-wrapper .nestedpages-settings-support{width:30%;background-color:#fff;text-align:center;border:1px solid #e5e5e5;-webkit-border-radius:3px;border-radius:3px}.nestedpages-settings-general-wrapper .nestedpages-settings-support .inner{padding:2em}.nestedpages-settings-general-wrapper .nestedpages-settings-support .or{margin:2em 0}.nestedpages-settings-general-wrapper h3{color:#ff2d20;margin:0 0 3px 0;font-size:20px}.nestedpages-settings-general-wrapper h4{margin:0}.nestedpages-settings-general-wrapper .support-button{display:block;background-color:rgba(255,45,32,0.1);border:1px solid rgba(255,45,32,0.15);text-align:center;color:#333;text-decoration:none;padding:1em;-webkit-border-radius:4px;border-radius:4px;font-weight:bold;font-size:16px;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease}.nestedpages-settings-general-wrapper .support-button svg{display:inline-block;vertical-align:middle;margin-right:8px}.nestedpages-settings-general-wrapper .support-button svg .heart{fill:#ff2d20}.nestedpages-settings-general-wrapper .support-button:hover{background-color:#ff2d20;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;color:#fff}.nestedpages-settings-general-wrapper .support-button:hover svg .heart{fill:#fff}@media (max-width: 768px){.nestedpages-settings-general-wrapper{display:block}.nestedpages-settings-general-wrapper .nestedpages-settings-table,.nestedpages-settings-general-wrapper .nestedpages-settings-support{width:100%}}.nestedpages-settings-table{border:1px solid #e5e5e5;-webkit-border-radius:3px;border-radius:3px}.nestedpages-settings-table .row-container{border-bottom:1px solid #e1e1e1}.nestedpages-settings-table .row-container:last-child{border:0}.nestedpages-settings-table .row-container .head{zoom:1;line-height:46px;background-color:#fff;padding-right:10px}.nestedpages-settings-table .row-container .head:before,.nestedpages-settings-table .row-container .head:after{content:" ";display:table}.nestedpages-settings-table .row-container .head:after{clear:both}.nestedpages-settings-table .row-container .head .checkbox{float:left;width:46px;height:46px;background-color:rgba(51,51,51,0.06);text-align:center;line-height:46px;margin-right:10px}.nestedpages-settings-table .row-container .head label{float:left;line-height:46px;margin:0}.nestedpages-settings-table .row-container .head label em{color:#999}.nestedpages-settings-table .row-container .head .button{float:right;margin-top:10px}.nestedpages-settings-table .row-container.active .head{background-color:#0074a2;color:#fff}.nestedpages-settings-table .row-container .row{display:table;width:100%}.nestedpages-settings-table .row-container .row.submit{display:block}.nestedpages-settings-table .row-container .row.submit p{margin:0}.nestedpages-settings-table .row-container .row .description{display:table-cell;vertical-align:top;width:25%;border-bottom:1px solid #e1e1e1;background-color:#f9f9f9;padding:1em}.nestedpages-settings-table .row-container .row .description p{color:gray;font-size:.9em}.nestedpages-settings-table .row-container .row .description strong{color:#333;font-size:1.2em}.nestedpages-settings-table .row-container .row .field{display:table-cell;vertical-align:top;width:75%;background-color:#fff;border-bottom:1px solid #e1e1e1;border-left:1px solid #e1e1e1;padding:1em}.nestedpages-settings-table .row-container .row .field.padded-sides{padding:1em 2em}.nestedpages-settings-table .row-container .row .field.extra-padding{padding:2em}.nestedpages-settings-table .row-container .row .field label.block{display:block}.nestedpages-settings-table .row-container .row .field input[type="text"],.nestedpages-settings-table .row-container .row .field input[type="tel"],.nestedpages-settings-table .row-container .row .field select{width:100%}.nestedpages-settings-table .row-container .body{display:none}.nestedpages-settings-table .row-container .body h4{margin:0;padding:10px 0 0 10px}.nestedpages-settings-table .row-container .body .settings-details{margin:0}.nestedpages-settings-table .row-container .body li{margin:0}.nestedpages-settings-table .row-container .settings-details li:last-child .field,.nestedpages-settings-table .row-container .settings-details li:last-child .description{border-bottom:0}.nestedpages-settings-table .row-container .custom-fields,.nestedpages-settings-table .row-container .standard-fields,.nestedpages-settings-table .row-container .columns{display:none;padding-top:20px}.nestedpages-settings-table .row-container .custom-fields .custom-field-group,.nestedpages-settings-table .row-container .standard-fields .custom-field-group,.nestedpages-settings-table .row-container .columns .custom-field-group{height:150px;overflow:auto;background-color:#f9f9f9;padding:10px;border:1px solid #e1e1e1}.nestedpages-settings-table .row-container .custom-fields h5,.nestedpages-settings-table .row-container .standard-fields h5,.nestedpages-settings-table .row-container .columns h5{padding:0;font-weight:normal;font-style:oblique;margin:0;color:#999;margin-bottom:6px}.nestedpages-settings-table .row-container .custom-fields p,.nestedpages-settings-table .row-container .standard-fields p,.nestedpages-settings-table .row-container .columns p{margin:0 0 6px 0;font-weight:bold}.nestedpages-settings-table .row-container .custom-fields ul,.nestedpages-settings-table .row-container .standard-fields ul,.nestedpages-settings-table .row-container .columns ul{margin:0}.nestedpages-settings-table .row-container .custom-fields ul.indented,.nestedpages-settings-table .row-container .standard-fields ul.indented,.nestedpages-settings-table .row-container .columns ul.indented{padding-left:15px}.nestedpages-settings-table .row-container .custom-fields ul li,.nestedpages-settings-table .row-container .standard-fields ul li,.nestedpages-settings-table .row-container .columns ul li{margin:3px 0 0 0}.nestedpages-settings-table .row-container .thumbnail-options{background-color:#f9f9f9;padding:10px;border:1px solid #e1e1e1;margin-top:1em}.nestedpages-settings-table .row-container .thumbnail-options label{display:block}.nestedpages-settings-table .row-container .thumbnail-options select{margin-bottom:1em}.nestedpages-page-pt-assignment{background-color:#f9f9f9;padding:10px;border:1px solid #e1e1e1;margin-top:1em}.nestedpages-page-pt-assignment input[type="search"]{width:100%;margin-bottom:1em}.nestedpages-page-pt-assignment .np-quickedit-info{background-color:#fff;border-right:1px solid #e5e5e5;border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5}.nestedpages-page-pt-assignment .nestedpages-page-search-results{height:100px;overflow:auto}.nestedpages-page-pt-assignment .nestedpages-page-search-results ul{list-style-type:none;margin:0;padding:0}.nestedpages-page-pt-assignment .nestedpages-page-search-results a{display:block;text-decoration:none;border-top:1px solid #dcdcdc;padding:3px 0;color:#333;background-color:#f9f9f9}.nestedpages-page-pt-assignment .nestedpages-page-search-results a:hover{background-color:#0074a2;color:#fff;padding-left:5px}.nestedpages-page-pt-assignment .nestedpages-page-search-results li:first-child a{border:0;padding-top:0}.nestedpages-page-pt-assignment-selection{background-color:#f9f9f9;border:1px solid #e1e1e1;margin-top:1em;padding:.5em}.nestedpages-sort-options-selection,.nestedpages-checklist-field{background-color:#f9f9f9;border:1px solid #e1e1e1;margin-top:1em;padding:.5em}.nestedpages-sort-options-selection label,.nestedpages-checklist-field label{display:block;margin-top:3px}.nestedpages-sort-options-selection label:first-child,.nestedpages-checklist-field label:first-child{margin:0}.nestedpages-sort-options-selection .sort-options-default,.nestedpages-checklist-field .sort-options-default{display:none;background-color:#fff;margin:.5em 0 1.5em 0;padding:.75em;border:1px solid #e1e1e1}.nestedpages-sort-options-selection .sort-options-default label,.nestedpages-checklist-field .sort-options-default label{display:inline-block}.nestedpages-sort-options-selection .sort-options-default select,.nestedpages-checklist-field .sort-options-default select{width:auto !important}.np-menu-customization{display:none;padding:.5em 1em 1em 1em}.np-menu-customization .np-menu-customization-header{background-color:#f9f9f9;border:1px solid #e1e1e1;border-bottom:0;height:60px;position:relative;padding:15px 180px 0 10px;-webkit-box-sizing:border-box;box-sizing:border-box;zoom:1}.np-menu-customization .np-menu-customization-header:before,.np-menu-customization .np-menu-customization-header:after{content:" ";display:table}.np-menu-customization .np-menu-customization-header:after{clear:both}.np-menu-customization .np-menu-customization-header .hide,.np-menu-customization .np-menu-customization-header .new{position:absolute;right:0;top:0;height:60px;width:80px;text-align:center;line-height:60px;border-left:1px solid #e1e1e1;background-color:#ececec;font-size:.9em}.np-menu-customization .np-menu-customization-header .role-select{float:left;width:100%}.np-menu-customization .np-menu-customization-header .new{right:80px;background-color:#fff}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-toggle{display:block;height:60px;width:80px;text-decoration:none;color:#333}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-toggle .np-caret{display:inline-block;width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid #333;vertical-align:middle;margin-left:3px}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-toggle:active,.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-toggle:focus{outline:none;-webkit-box-shadow:none;box-shadow:none}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-content{width:150px;font-size:1.1em}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-content ul li{border-top:1px solid #e1e1e1}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-content ul li a{display:block;padding:1em .5em;background-color:#fff}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-content ul li a:hover{background-color:#333;color:#fff}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-content ul li:first-child{border:0}.np-nav-menu-settings li{border:1px solid #e1e1e1;position:relative;border-top:0}.np-nav-menu-settings li.disabled{text-decoration:line-through}.np-nav-menu-settings li.disabled:hover{background-color:inherit !important}.np-nav-menu-settings li.disabled .menu-item .title{opacity:.2}.np-nav-menu-settings li.disabled .menu-item .title:hover .details-button{display:none}.np-nav-menu-settings li.disabled .submenu-toggle a{display:none}.np-nav-menu-settings li.disabled.submenu-open .submenu-listing{display:none}.np-nav-menu-settings li:first-child{border-top:1px solid #e1e1e1}.np-nav-menu-settings li:first-child .hide-checkbox{border-top:0}.np-nav-menu-settings .update-count{display:none}.np-nav-menu-settings .ui-sortable-helper{border:1px solid #e1e1e1;-webkit-box-shadow:1px 1px 1px 0px rgba(0,0,0,0.3);box-shadow:1px 1px 1px 0px rgba(0,0,0,0.3)}.np-nav-menu-settings .menu-item{height:50px;zoom:1;padding:0 80px 0 100px;background-color:#fff}.np-nav-menu-settings .menu-item:before,.np-nav-menu-settings .menu-item:after{content:" ";display:table}.np-nav-menu-settings .menu-item:after{clear:both}.np-nav-menu-settings .menu-item .title{zoom:1;position:relative;padding-right:120px;height:50px}.np-nav-menu-settings .menu-item .title:before,.np-nav-menu-settings .menu-item .title:after{content:" ";display:table}.np-nav-menu-settings .menu-item .title:after{clear:both}.np-nav-menu-settings .menu-item .title.separator{padding-left:40px}.np-nav-menu-settings .menu-item .title p{margin:0;font-size:1em;line-height:50px}.np-nav-menu-settings .menu-item .title .menu-icon{position:absolute;left:0;top:0;height:50px;width:40px;text-align:center}.np-nav-menu-settings .menu-item .title .menu-icon:before{font-size:1.6em;line-height:50px}.np-nav-menu-settings .menu-item .title .details-button{display:none;position:absolute;right:0;top:0;margin:12px 10px 0 0}.np-nav-menu-settings .menu-item .title:hover .details-button{display:block}.np-nav-menu-settings .menu-item .menu-title-field{float:left;margin:0 0 0 40px;position:relative;padding:0;line-height:50px;border:0;-webkit-box-shadow:none;box-shadow:none}.np-nav-menu-settings .menu-item .menu-title-field::-webkit-input-placeholder{color:#333}.np-nav-menu-settings .menu-item .menu-title-field::-moz-placeholder{color:#333}.np-nav-menu-settings .menu-item .menu-title-field::-ms-input-placeholder{color:#333}.np-nav-menu-settings .menu-item .menu-title-field::placeholder{color:#333}.np-nav-menu-settings li.separator .menu-item{background-color:#f9f9f9;padding-right:10px}.np-nav-menu-settings li.separator .menu-item .menu-icon{display:none}.np-nav-menu-settings li.separator .menu-item .details-button{margin-right:0}.np-nav-menu-settings li.separator .menu-item .title{padding-left:10px;padding-right:0;color:#999}.np-nav-menu-settings .ui-sortable-placeholder{background-color:#f9f9f9;border:1px dashed #0074a2 !important;display:block;visibility:visible !important}.np-nav-menu-settings .submenu-toggle{width:50px;height:50px;left:0;border-right:1px solid #e1e1e1;background-color:#f9f9f9;position:absolute}.np-nav-menu-settings .submenu-toggle a{margin:0;display:block;text-decoration:none;width:26px;height:26px;background-color:#fff;border:1px solid #e1e1e1;-webkit-border-radius:50%;border-radius:50%;text-align:center;color:#333;position:relative;top:10px;left:10px;-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease}.np-nav-menu-settings .submenu-toggle a span{margin:0;position:absolute;left:11px;top:8px;display:block;width:0;height:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:6px solid #333}.np-nav-menu-settings .submenu-toggle a.active{background-color:#333;color:#fff;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);border-color:#333}.np-nav-menu-settings .submenu-toggle a.active span{border-left-color:#fff}.np-nav-menu-settings .submenu-toggle a:focus,.np-nav-menu-settings .submenu-toggle a:active{outline:none;-webkit-box-shadow:none;box-shadow:none}.np-nav-menu-settings .handle{position:absolute;width:50px;height:50px;left:51px;background-color:#f9f9f9;border-right:1px solid #e5e5e5;text-align:center;line-height:40px;cursor:move}.np-nav-menu-settings .handle .bars{fill:#b3b3b3}.np-nav-menu-settings .handle svg{position:relative;top:10px;width:20px;width:20px}.np-nav-menu-settings .handle:hover{color:#333}.np-nav-menu-settings .hide-checkbox{position:absolute;width:80px;height:50px;top:0;text-align:center;right:0;background-color:#ececec;border-left:1px solid #e1e1e1}.np-nav-menu-settings .hide-checkbox input[type="checkbox"]{position:relative;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);margin-top:-5px;left:2px}.np-nav-menu-settings .np-extra-options{display:none;border-top:1px solid #e1e1e1;padding:1em;zoom:1;background-color:#f9f9f9}.np-nav-menu-settings .np-extra-options:before,.np-nav-menu-settings .np-extra-options:after{content:" ";display:table}.np-nav-menu-settings .np-extra-options:after{clear:both}.np-nav-menu-settings .np-extra-options .half{float:left;width:48%;clear:both}.np-nav-menu-settings .np-extra-options .half.right{clear:none;float:right}.np-nav-menu-settings .options-open .np-extra-options{display:block}.np-nav-menu-settings .options-open .menu-item .title .details-button{display:block}.np-nav-menu-settings .options-open.disabled .np-extra-options{display:none}.np-nav-menu-settings .options-open.disabled .menu-item .title .details-button{display:none}.np-nav-menu-settings .submenu-listing{display:none;padding-left:50px;background-color:#f9f9f9;border-top:1px solid #e1e1e1;border-bottom:3px solid #e1e1e1}.np-nav-menu-settings li.submenu-open .submenu-listing{display:block}.np-nav-menu-settings .submenu-item{border:0;border-left:1px solid #e1e1e1;border-top:1px solid #e1e1e1;background-color:#f9f9f9}.np-nav-menu-settings .submenu-item .menu-item{padding-left:50px}.np-nav-menu-settings .submenu-item .title{padding-left:1em}.np-nav-menu-settings .submenu-item:first-child{border-top:0}.np-nav-menu-settings .submenu-item .handle{left:0}.nestedpages.np-dark-mode ol,.np-dark-mode ol{border:0;-webkit-border-radius:0;border-radius:0}.nestedpages.np-dark-mode ol .np-page-type,.np-dark-mode ol .np-page-type{color:#bbc8d4}.nestedpages.np-dark-mode ol .locked,.np-dark-mode ol .locked{color:#fff}.nestedpages.np-dark-mode ol .row-status-icon .icon,.np-dark-mode ol .row-status-icon .icon{fill:#50626f}.nestedpages.np-dark-mode ol .status,.nestedpages.np-dark-mode ol .sticky,.nestedpages.np-dark-mode ol .np-icon-eye-blocked,.nestedpages.np-dark-mode ol .nav-status,.np-dark-mode ol .status,.np-dark-mode ol .sticky,.np-dark-mode ol .np-icon-eye-blocked,.np-dark-mode ol .nav-status{color:#50626f}.nestedpages.np-dark-mode ol .np-assigned-pt-actions li a,.np-dark-mode ol .np-assigned-pt-actions li a{color:#fff;border-color:rgba(0,0,0,0.2)}.nestedpages.np-dark-mode ol .np-seo-indicator,.np-dark-mode ol .np-seo-indicator{background-color:#50626f}.nestedpages.np-dark-mode ol .np-seo-indicator.good,.np-dark-mode ol .np-seo-indicator.good{background-color:#7ad03a}.nestedpages.np-dark-mode ol .np-seo-indicator.ok,.np-dark-mode ol .np-seo-indicator.ok{background-color:#ffba00}.nestedpages.np-dark-mode ol .np-seo-indicator.poor,.np-dark-mode ol .np-seo-indicator.poor{background-color:#ee7c1b}.nestedpages.np-dark-mode ol .np-seo-indicator.bad,.np-dark-mode ol .np-seo-indicator.bad{background-color:#dd3d36}.nestedpages.np-dark-mode ol .np-seo-indicator.warn,.np-dark-mode ol .np-seo-indicator.warn{background-color:maroon}.nestedpages.np-dark-mode ol .np-seo-indicator.wrong,.np-dark-mode ol .np-seo-indicator.wrong{background-color:red}.nestedpages.np-dark-mode ol .np-seo-indicator.noindex,.np-dark-mode ol .np-seo-indicator.noindex{background-color:#1e8cbe}.nestedpages.np-dark-mode ol li,.np-dark-mode ol li{border-top-color:#32373c;background:transparent}.nestedpages.np-dark-mode ol ol,.np-dark-mode ol ol{border-top:1px solid #32373c}.nestedpages.np-dark-mode .np-icon-arrow,.np-dark-mode .np-icon-arrow{border-left-color:#fff}.nestedpages.np-dark-mode .child-toggle a:active,.nestedpages.np-dark-mode .child-toggle a:focus,.np-dark-mode .child-toggle a:active,.np-dark-mode .child-toggle a:focus{-webkit-box-shadow:none;box-shadow:none}.nestedpages.np-dark-mode .non-indent .child-toggle,.np-dark-mode .non-indent .child-toggle{background-color:rgba(0,0,0,0.15)}.nestedpages.np-dark-mode .non-indent .child-toggle a,.np-dark-mode .non-indent .child-toggle a{background-color:#50626f;border:0;color:#fff}.nestedpages.np-dark-mode .non-indent .child-toggle a .np-icon-arrow,.np-dark-mode .non-indent .child-toggle a .np-icon-arrow{border-left-color:#fff}.nestedpages.np-dark-mode .non-indent .child-toggle a:hover,.np-dark-mode .non-indent .child-toggle a:hover{background-color:rgba(0,0,0,0.5)}.nestedpages.np-dark-mode .non-indent .child-toggle a:hover .np-icon-arrow,.np-dark-mode .non-indent .child-toggle a:hover .np-icon-arrow{border-left-color:#fff}.nestedpages.np-dark-mode .handle,.np-dark-mode .handle{color:#50626f}.nestedpages.np-dark-mode .handle .bars,.np-dark-mode .handle .bars{fill:#50626f}.nestedpages.np-dark-mode .np-icon-sub-menu .arrow,.np-dark-mode .np-icon-sub-menu .arrow{fill:#50626f}.nestedpages.np-dark-mode .page-title .link-icon .icon,.np-dark-mode .page-title .link-icon .icon{fill:#50626f}.nestedpages.np-dark-mode .np-bulk-checkbox,.np-dark-mode .np-bulk-checkbox{background:transparent}.nestedpages.np-dark-mode .row,.np-dark-mode .row{background:transparent}.nestedpages.np-dark-mode .row:hover,.nestedpages.np-dark-mode .row.active,.np-dark-mode .row:hover,.np-dark-mode .row.active{background-color:#32373c}.nestedpages.np-dark-mode .row.np-updated,.np-dark-mode .row.np-updated{background-color:#32373c}.nestedpages.np-dark-mode .row.np-updated-show,.np-dark-mode .row.np-updated-show{background-color:#32373c}.nestedpages.np-dark-mode .np-post-columns ul li,.np-dark-mode .np-post-columns ul li{color:#fff;border-left:1px solid rgba(0,0,0,0.4)}.nestedpages.np-dark-mode .np-post-columns ul li:first-child,.np-dark-mode .np-post-columns ul li:first-child{border:0}.nestedpages.np-dark-mode .action-buttons .nestedpages-dropdown .np-btn.toggle svg path.circles,.np-dark-mode .action-buttons .nestedpages-dropdown .np-btn.toggle svg path.circles{fill:#fff}.nestedpages.np-dark-mode .action-buttons .nestedpages-dropdown ul li,.np-dark-mode .action-buttons .nestedpages-dropdown ul li{background-color:#50626f}.nestedpages.np-dark-mode .action-buttons .nestedpages-dropdown ul li a,.np-dark-mode .action-buttons .nestedpages-dropdown ul li a{color:#fff}.nestedpages.np-dark-mode .action-buttons .nestedpages-dropdown ul li a svg path.primary,.np-dark-mode .action-buttons .nestedpages-dropdown ul li a svg path.primary{fill:#fff}.nestedpages.np-dark-mode .nestedpages-list-header,.np-dark-mode .nestedpages-list-header{background-color:#32373c;border:0}.nestedpages.np-dark-mode .nestedpages-list-header .np-check-all,.np-dark-mode .nestedpages-list-header .np-check-all{background:transparent}.nestedpages.np-dark-mode .np-btn,.np-dark-mode .np-btn{color:#fff;display:inline-block;background-color:#50626f;border:1px solid #444}.nestedpages.np-dark-mode .np-btn:hover,.np-dark-mode .np-btn:hover{background-color:#32373c;border-color:#32373c}.nestedpages.np-dark-mode .np-inline-modal,.np-dark-mode .np-inline-modal{background-color:#32373c}.nestedpages.np-dark-mode .quick-edit h3,.nestedpages.np-dark-mode .new-child h3,.np-dark-mode .quick-edit h3,.np-dark-mode .new-child h3{color:#fff}.nestedpages.np-dark-mode .quick-edit h3 span em,.nestedpages.np-dark-mode .new-child h3 span em,.np-dark-mode .quick-edit h3 span em,.np-dark-mode .new-child h3 span em{color:#50626f}.nestedpages.np-dark-mode .quick-edit .fields,.nestedpages.np-dark-mode .new-child .fields,.np-dark-mode .quick-edit .fields,.np-dark-mode .new-child .fields{background:transparent}.nestedpages.np-dark-mode .quick-edit .buttons,.nestedpages.np-dark-mode .new-child .buttons,.np-dark-mode .quick-edit .buttons,.np-dark-mode .new-child .buttons{background-color:rgba(0,0,0,0.15)}.nestedpages.np-dark-mode .quick-edit .form-control.original-link,.nestedpages.np-dark-mode .new-child .form-control.original-link,.np-dark-mode .quick-edit .form-control.original-link,.np-dark-mode .new-child .form-control.original-link{background-color:rgba(0,0,0,0.15);border:0}.nestedpages.np-dark-mode .quick-edit .np-toggle-options,.nestedpages.np-dark-mode .new-child .np-toggle-options,.np-dark-mode .quick-edit .np-toggle-options,.np-dark-mode .new-child .np-toggle-options{background-color:rgba(0,0,0,0.1)}.nestedpages.np-dark-mode .quick-edit .np-taxonomies,.nestedpages.np-dark-mode .quick-edit .np-menuoptions,.nestedpages.np-dark-mode .new-child .np-taxonomies,.nestedpages.np-dark-mode .new-child .np-menuoptions,.np-dark-mode .quick-edit .np-taxonomies,.np-dark-mode .quick-edit .np-menuoptions,.np-dark-mode .new-child .np-taxonomies,.np-dark-mode .new-child .np-menuoptions{background:transparent}.nestedpages.np-dark-mode .quick-edit .np-taxonomy li,.nestedpages.np-dark-mode .new-child .np-taxonomy li,.np-dark-mode .quick-edit .np-taxonomy li,.np-dark-mode .new-child .np-taxonomy li{background:transparent}.nestedpages.np-dark-mode .nestedpages-bulk-edit,.np-dark-mode .nestedpages-bulk-edit{background-color:#32373c;border:0}.nestedpages.np-dark-mode .nestedpages-bulk-edit .np-bulk-titles,.np-dark-mode .nestedpages-bulk-edit .np-bulk-titles{background-color:rgba(0,0,0,0.15);border:0}.nestedpages.np-dark-mode .nestedpages-bulk-edit .np-bulk-titles .np-remove,.np-dark-mode .nestedpages-bulk-edit .np-bulk-titles .np-remove{background-color:#50626f}.nestedpages.np-dark-mode .nestedpages-bulk-edit .np-bulk-footer,.np-dark-mode .nestedpages-bulk-edit .np-bulk-footer{background-color:rgba(0,0,0,0.15)}.nestedpages.np-dark-mode .np-quickedit-error,.np-dark-mode .np-quickedit-error{background-color:#e14d43;color:#fff}.np-modal-form.np-dark-mode .form-interior{background:transparent}.nestedpages-modal-content.np-dark-mode{background-color:#32373c}.nestedpages-modal-content.np-dark-mode h3,.nestedpages-modal-content.np-dark-mode .new-child h3{color:#fff}.nestedpages-modal-content.np-dark-mode .modal-content{background-color:#32373c}.nestedpages-modal-content.np-dark-mode .modal-footer{background-color:rgba(0,0,0,0.15)}.nestedpages-modal-content.np-dark-mode .clone-modal h3{background:transparent}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection{background-color:#32373c;border:0}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li{border:1px solid #32373c;border-top:0}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li a{background-color:#50626f;color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li a:after{color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li a:active,.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li a:focus{-webkit-box-shadow:none;box-shadow:none}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li:first-child{border-top:0}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li ul{padding:0;background:transparent}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li ul li{border-color:#32373c}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li ul li a{background-color:rgba(0,0,0,0.15)}.nestedpages-modal-content.np-dark-mode .np-menu-search{background-color:rgba(0,0,0,0.15)}.nestedpages-modal-content.np-dark-mode .np-menu-search input[type="text"]::-webkit-input-placeholder{color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-search input[type="text"]::-moz-placeholder{color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-search input[type="text"]::-ms-input-placeholder{color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-search input[type="text"]::placeholder{color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-link-details h3 em{color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-link-details .original-link{border:0;background-color:rgba(0,0,0,0.15)}.nestedpages-modal-content.np-dark-mode .np-menu-link-details .fields{background:transparent;padding:0}
1
+ .nestedpages .updated,.nestedpages-dropdown-content ul:after,.nestedpages-listing-title:after,.nestedpages-modal-content .modal-footer:after,.nestedpages-modal-full .modal-header:after,.nestedpages-tools,.nestedpages-tools:after,.nestedpages-top-toggles:after{clear:both}.np-btn{text-decoration:none;color:#555;display:inline-block;background-color:#f7f7f7;border:1px solid #e1e1e1;padding:5px 8px;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;vertical-align:top}.np-btn:hover{background-color:#0074a2;color:#fff;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;border-color:#0074a2}.np-btn.disabled,.np-btn:disabled{opacity:.6;cursor:not-allowed}.np-btn.has-icon{padding:0}.np-btn-half{float:left;width:47%;padding:3px 0;text-align:center}.np-btn-half.btn-right{float:right}.np-btn-trash{background-color:#e14d43;border-color:#e14d43;color:#fff}.np-btn-trash:hover{background-color:#ba281e;border-color:#ba281e}.np-quickedit-error,.np-quickedit-info{padding:4px 0 4px 8px;margin-bottom:10px;background-color:#f9f9f9}.np-quickedit-error{border-left:4px solid #dd3d36}.np-quickedit-info{border-left:4px solid #0074a2}.nestedpages-modal-backdrop{position:fixed;width:100%;height:100%;background-color:rgba(0,0,0,.85);top:0;left:0;z-index:9999;visibility:hidden;opacity:0;-webkit-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease}.nestedpages-modal-backdrop.active{visibility:visible;opacity:1;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease}.nestedpages-modal-content{z-index:99999;position:fixed;top:-200%;width:90%;height:80%;margin:10px auto 0;background-color:#fff;left:5%;-webkit-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease}.nestedpages-modal-content.small{width:400px;left:50%;margin-left:-200px}.nestedpages-modal-content.short{height:auto}.nestedpages-modal-content.active{top:50%;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.nestedpages-modal-content h5{font-size:1.1em}.nestedpages-modal-content .modal-body{position:relative;padding:10px}.nestedpages-modal-content .modal-body.new-child{padding:0}.nestedpages-modal-content .modal-footer{padding:10px;text-align:right;background-color:#404040;zoom:1}.nestedpages-modal-content .modal-footer:after,.nestedpages-modal-content .modal-footer:before{content:" ";display:table}.nestedpages-modal-content .modal-footer .modal-close{float:left}.nestedpages-modal-content .modal-open .modal{overflow-x:hidden;overflow-y:auto}.nestedpages-modal-content .modal-content{position:relative;background-color:#fff;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);background-clip:padding-box;outline:0}.nestedpages-modal-full{width:94%;height:94%;-webkit-transform:none;-ms-transform:none;transform:none;left:3%}.nestedpages-modal-full.active{top:3%}.nestedpages-modal-full .modal-header{position:absolute;top:0;left:0;width:100%;height:50px;z-index:4;zoom:1;padding-left:.5em}.nestedpages-modal-full .modal-header:after,.nestedpages-modal-full .modal-header:before{content:" ";display:table}.nestedpages-modal-full .modal-content-interior{padding-top:50px;height:100%}.nestedpages-modal-full .modal-content-interior .modal-content-body{height:100%;max-height:100%}.np-trash-modal{text-align:center}.np-trash-modal .modal-body{padding-bottom:30px}.np-trash-modal .button-primary{margin-left:10px}.clone-modal h3{margin:0;padding:8px;background-color:#e5e5e5}.clone-modal .form-control{margin:0!important;padding:5px 10px}.np-inline-overlay{position:fixed;width:100%;height:100%;background-color:rgba(0,0,0,.4);z-index:998;top:0;right:0;bottom:0;left:0;opacity:0;-webkit-transition:opacity .2s ease;-o-transition:opacity .2s ease;transition:opacity .2s ease}.np-inline-overlay.active{opacity:1;-webkit-transition:opacity .2s ease;-o-transition:opacity .2s ease;transition:opacity .2s ease}.np-inline-modal{position:relative;z-index:999;background-color:#fff;border-radius:0;-webkit-box-shadow:0 0 4px 0 rgba(0,0,0,.5);box-shadow:0 0 4px 0 rgba(0,0,0,.5)}.nestedpages-listing-title{zoom:1}.nestedpages-listing-title:after,.nestedpages-listing-title:before{content:" ";display:table}.nestedpages-toggleall.np-btn{float:right}.np-toggle-publish{color:#999}.np-toggle-publish.active{color:#333;font-weight:700}.np-sync-menu-cont{float:right;margin:0 15px 0 0}.np-sync-menu-cont button{position:relative;top:-5px;padding:5px 8px}.np-sync-menu-cont label{position:relative;top:4px}.nestedpages-top-toggles{float:right;zoom:1;padding-top:10px}.nestedpages-top-toggles:after,.nestedpages-top-toggles:before{content:" ";display:table}.np-tab-pane{display:none}.nestedpages ul.np-tabs,.ul.np-tabs{background:0 0;text-align:left;list-style-type:none;margin:0 0 10px;padding:0;border-bottom:1px solid #ccc;font-size:0;line-height:0}.nestedpages ul.np-tabs li,.ul.np-tabs li{font-size:13px;line-height:1.4em;display:inline-block;margin:0 0 0 6px;border:0}.nestedpages ul.np-tabs li a,.ul.np-tabs li a{background-color:#e6e6e6;display:block;text-decoration:none;padding:8px 15px;color:#333;border:1px solid #ccc;border-bottom:0}.nestedpages ul.np-tabs li a:hover,.ul.np-tabs li a:hover{background-color:#fff}.nestedpages ul.np-tabs li a:active,.nestedpages ul.np-tabs li a:focus,.ul.np-tabs li a:active,.ul.np-tabs li a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}.nestedpages ul.np-tabs li.active a,.ul.np-tabs li.active a{font-weight:700;position:relative;color:#333;background-color:#fff}.nestedpages ul.np-tabs li.active a:after,.ul.np-tabs li.active a:after{position:absolute;width:100%;height:2px;content:'';background-color:#fff;left:0;bottom:-1px}.nestedpages-datepicker.ui-datepicker{background-color:#fff;font-size:90%;-webkit-box-shadow:0 0 3px 0 rgba(0,0,0,.4);box-shadow:0 0 3px 0 rgba(0,0,0,.4);border-radius:3px;padding:0;width:auto}.nestedpages-datepicker.ui-datepicker .ui-datepicker-next,.nestedpages-datepicker.ui-datepicker .ui-datepicker-prev{position:absolute;color:#fff;top:0;right:0;cursor:pointer;display:block;width:35px;height:35px;font-size:0;background:url(../images/datepicker-arrow-next.png) center;opacity:1;-webkit-transition:opacity .2s ease;-o-transition:opacity .2s ease;transition:opacity .2s ease}.nestedpages-datepicker.ui-datepicker .ui-datepicker-next:hover,.nestedpages-datepicker.ui-datepicker .ui-datepicker-prev:hover{opacity:.5;-webkit-transition:opacity .2s ease;-o-transition:opacity .2s ease;transition:opacity .2s ease}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar{margin:0;border-collapse:collapse}.nestedpages-datepicker.ui-datepicker .ui-datepicker-prev{right:auto;left:0;background:url(../images/datepicker-arrow-prev.png)}.nestedpages-datepicker.ui-datepicker .ui-datepicker-header{padding:0}.nestedpages-datepicker.ui-datepicker .ui-datepicker-title{background-color:#1a1a1a;text-align:center;color:#fff;height:35px;line-height:35px;border-radius:3px 3px 0 0;margin:0}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar table{width:auto}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar td,.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar th{text-align:center;width:30px;height:30px}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar th{background-color:#e6e6e6;text-transform:uppercase;font-size:11px;letter-spacing:1px;padding:0}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar td{border-top:1px solid #ebebeb;border-left:1px solid #ebebeb;padding:0}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar td:first-child{border-left:0}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar a{text-align:center;padding:0;text-decoration:none;color:#333;display:block;background-color:#fff;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;width:30px;height:30px;line-height:30px}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar a.ui-state-active{background-color:#1a1a1a;color:#fff}.nestedpages-datepicker.ui-datepicker .ui-datepicker-calendar a:hover{background-color:#333;color:#fff;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease}.nestedpages-dropdown{position:relative;z-index:3;display:inline-block}.nestedpages-dropdown-content{display:none;position:absolute;top:40px;left:0;z-index:2;background-color:#fff;width:250px;text-align:left;border-radius:2px;-webkit-box-shadow:1px 1px 3px 0 rgba(51,51,51,.4);box-shadow:1px 1px 3px 0 rgba(51,51,51,.4)}.nestedpages-dropdown-content.padded{padding:1em}.nestedpages-dropdown-content p{line-height:1.4;margin:0}.nestedpages-dropdown-content.right{left:auto;right:0}.nestedpages-dropdown-content ul{list-style-type:none;margin:0;padding:0;zoom:1}.nestedpages-dropdown-content ul:after,.nestedpages-dropdown-content ul:before{content:" ";display:table}.nestedpages-dropdown-content ul li{float:none;width:100%;margin:0;line-height:1}.nestedpages-dropdown-content ul li a{display:block;color:#333;text-decoration:none}.nestedpages-dropdown-content ul li:first-child a{border:0}.nestedpages-dropdown-content.active{display:block}#nested-loading{display:none;float:right;width:30px;height:30px;margin:0 20px 0 0;position:relative}#nested-loading svg{width:30px;height:30px;-webkit-animation:nestedpagesRotate linear 1.25s infinite;animation:nestedpagesRotate linear 1.25s infinite;position:absolute;left:0;top:0;line-height:.1}#nested-loading svg path{fill:#999}.np-default-loading,.np-menu-search-loading,.np-qe-loading{display:none;float:right;width:25px;height:25px;margin:2px 10px 0 0;position:relative;-webkit-animation:nestedpagesRotate linear 1.25s infinite;animation:nestedpagesRotate linear 1.25s infinite}.np-default-loading svg,.np-menu-search-loading svg,.np-qe-loading svg{position:absolute;left:0;top:0;width:25px;height:25px}.np-default-loading svg path,.np-menu-search-loading svg path,.np-qe-loading svg path{fill:#fff}.np-default-loading{float:none;margin:0}.np-default-loading svg path{fill:#999}@-webkit-keyframes nestedpagesRotate{0%{-webkit-transform:rotate(0);transform:rotate(0);-webkit-transform-origin:center center;transform-origin:center center}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transform-origin:center center;transform-origin:center center}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg);-webkit-transform-origin:center center;transform-origin:center center}}@keyframes nestedpagesRotate{0%{-webkit-transform:rotate(0);transform:rotate(0);-webkit-transform-origin:center center;transform-origin:center center}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transform-origin:center center;transform-origin:center center}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg);-webkit-transform-origin:center center;transform-origin:center center}}.nestedpages-tools{zoom:1;margin:20px 0 5px}.nestedpages-tools:after,.nestedpages-tools:before{content:" ";display:table}.nestedpages-tools .subsubsub{margin:0}.nestedpages-tools .np-tools-primary{clear:left;padding-top:8px}.nestedpages-tools .select{float:left;margin-left:5px}.nestedpages-tools .select:first-child{margin-left:0}.nestedpages-tools .np-tools-sort{float:left}.nestedpages-tools .np-tools-search{float:right}.wppages-handle-expand{float:left;background-color:#f2f2f2;font-size:18px;width:46px;height:46px;margin-right:5px;text-align:center;border-right:1px solid #e1e1e1}.wppages-handle-expand div{background-color:#fff;border:1px solid #e1e1e1;width:24px;height:24px;line-height:24px;border-radius:15px;margin-top:9px;cursor:pointer;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease}.wppages-handle-expand div:hover{background-color:#0074a2;border-color:#0074a2;color:#fff;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease}.nestedpages{clear:both;border-radius:4px}.nestedpages .ui-sortable-placeholder{display:block!important;position:relative;min-height:46px;border:1px dashed #0074a2!important;background-color:#effaff;margin:0}.nestedpages .ui-sortable-helper{opacity:.8;-webkit-box-shadow:2px 2px 3px 0 rgba(0,0,0,.5);box-shadow:2px 2px 3px 0 rgba(0,0,0,.5)}.nestedpages ol{list-style-type:none;clear:both;margin:0;border:1px solid #e5e5e5;border-radius:3px}.nestedpages ol a{text-decoration:none}.nestedpages ol .page-link .edit-indicator{margin-left:10px;display:none}.nestedpages ol .page-link .edit-indicator i{font-size:12px;margin-right:3px}.nestedpages ol .page-link:hover .edit-indicator{display:inline}.nestedpages ol .np-page-type{color:#333}.nestedpages ol .locked{color:#333;margin-left:10px;padding-left:20px;position:relative}.nestedpages ol .locked svg{position:absolute;left:0;top:-5px;width:15px;height:24px}.nestedpages ol .locked em{font-style:normal}.nestedpages ol .row-status-icon{width:18px;height:18px;display:inline-block;vertical-align:middle;margin-left:5px}.nestedpages ol .row-status-icon .icon{fill:#b3b3b3}.nestedpages ol .np-icon-eye-blocked,.nestedpages ol .status,.nestedpages ol .sticky{color:#999}.nestedpages ol .nav-status{color:#b3b3b3}.nestedpages ol .np-hide{display:none}.nestedpages ol .np-assigned-pt-actions{list-style-type:none;margin:0 0 0 10px;padding:0;display:inline-block;vertical-align:middle}.nestedpages ol .np-assigned-pt-actions li{display:none;background:0 0;border:0}.nestedpages ol .np-assigned-pt-actions li.visible{display:inline-block}.nestedpages ol .np-assigned-pt-actions li a{color:#333;display:block;border-left:1px solid #e1e1e1;padding:0 5px}.nestedpages ol .np-assigned-pt-actions li:first-child a{border:0;padding-left:0}.nestedpages ol .np-seo-indicator{display:block;position:absolute;right:10px;top:50%;margin-top:-6px;width:12px;height:12px;border-radius:50%;background-color:#999}.nestedpages ol .np-seo-indicator.good{background-color:#7ad03a}.nestedpages ol .np-seo-indicator.ok{background-color:#ffba00}.nestedpages ol .np-seo-indicator.poor{background-color:#ee7c1b}.nestedpages ol .np-seo-indicator.bad{background-color:#dd3d36}.nestedpages ol .np-seo-indicator.warn{background-color:maroon}.nestedpages ol .np-seo-indicator.wrong{background-color:red}.nestedpages ol .np-seo-indicator.noindex{background-color:#1e8cbe}.nestedpages ol li{margin:0;border-top:1px solid #e1e1e1;background-color:#0074a2}.nestedpages ol li.first,.nestedpages ol li.no-border,.nestedpages ol li:first-child{border:0}.nestedpages ol ol{display:none;border-radius:0;list-style-type:none;border:0;-webkit-box-shadow:none;box-shadow:none;border-top:1px solid #e1e1e1}.nestedpages .np-search-results .np-hide{display:block}.nestedpages .child-toggle{display:table-cell;width:30px;text-align:left}.nestedpages .child-toggle .child-toggle-spacer{display:inline-block;vertical-align:middle;height:50px;width:1px}.nestedpages .child-toggle a{display:inline-block;text-align:center;vertical-align:middle;width:29px;height:29px;line-height:29px;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-transform-origin:center;-ms-transform-origin:center;transform-origin:center;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0)}.nestedpages .child-toggle a.open{-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.nestedpages .child-toggle a:active,.nestedpages .child-toggle a:focus{outline:0}.nestedpages .np-icon-arrow{display:inline-block;vertical-align:middle;width:0;height:0;position:relative;top:-3px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:6px solid #333}.nestedpages .non-indent .child-toggle{width:46px;background-color:#f0f0f0;position:relative}.nestedpages .non-indent .child-toggle .child-toggle-spacer{display:block;height:46px;width:46px}.nestedpages .non-indent .child-toggle a{position:absolute;top:50%;display:inline-block;vertical-align:middle;left:8px;margin-top:-16px;width:28px;height:28px;background-color:#fff;border:1px solid #e1e1e1;border-radius:50%;line-height:28px;color:#333;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0)}.nestedpages .non-indent .child-toggle a.open{-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.nestedpages .non-indent .child-toggle a:hover{background-color:#333;border-color:#333}.nestedpages .non-indent .child-toggle a:hover .np-icon-arrow{border-left-color:#fff}.nestedpages .non-indent .np-icon-arrow{border-top-width:4px;border-bottom-width:4px;border-left-width:6px}.nestedpages .handle{display:inline-block;opacity:.4;cursor:move;position:relative;top:-1px;height:20px;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease}.nestedpages .handle:hover,.np-menu-type-selection ul li a{-webkit-transition:all .2s ease;-o-transition:all .2s ease}.nestedpages .handle .bars{fill:#b3b3b3}.nestedpages .np-icon-sub-menu .arrow,.np-wpml-translations-modal .np-qe-loading svg path{fill:#999}.nestedpages .handle:hover{transition:all .2s ease;color:#0074a2}.nestedpages .np-icon-sub-menu{display:none;height:20px}.nestedpages .page-title .link-icon .icon,.np-nav-menu-settings .handle .bars{fill:#b3b3b3}.nestedpages .row.no-sort .page-title{padding-left:10px}.nestedpages .row.no-sort-filtered .page-title{padding-left:34px}.nestedpages .page-title{display:inline-block;vertical-align:middle}.nestedpages .page-title .link-icon{width:20px;height:20px;display:inline;vertical-align:middle;margin-left:8px;position:relative;top:-2px}.nestedpages .np-thumbnail{display:table-cell;width:80px;vertical-align:middle;zoom:1}.nestedpages .np-thumbnail:after,.nestedpages .np-thumbnail:before{content:" ";display:table}.nestedpages .np-thumbnail:after{clear:both}.nestedpages .np-thumbnail img{float:right;width:100%;height:auto}.nestedpages .np-thumbnail.large{width:150px}.nestedpages .np-thumbnail.small{width:50px}.nestedpages .np-thumbnail.link{text-align:center}.nestedpages .np-bulk-checkbox{display:table-cell;width:33px;vertical-align:middle;text-align:center;background-color:#f0f0f0}.nestedpages .np-bulk-checkbox input[type=checkbox]{margin-right:0}.nestedpages .handle,.nestedpages .np-icon-sub-menu{width:30px;text-align:center;vertical-align:middle}.nestedpages .non-indent li ol .row .np-icon-sub-menu{display:inline-block}.nestedpages .non-indent li ol .row .handle,.nestedpages .non-indent li ol .row:hover .np-icon-sub-menu{display:none}.nestedpages .no-sort ol li .row:hover .np-icon-sub-menu,.nestedpages .non-indent li ol .row.no-sort .np-icon-sub-menu,.nestedpages .non-indent li ol .row:hover .handle{display:inline-block}.nestedpages .row{background-color:#fff;display:table;width:100%}.nestedpages .row.active,.nestedpages .row:hover{background-color:#f0f0f0}.nestedpages .row.active .handle,.nestedpages .row:hover .handle{opacity:1}.nestedpages .row.active .np-assigned-pt-actions li,.nestedpages .row:hover .np-assigned-pt-actions li{display:inline-block}.nestedpages .row.active .cell.custom-column,.nestedpages .row:hover .cell.custom-column{visibility:hidden}.nestedpages .row.np-updated{background-color:#e9f7df;-webkit-transition:background-color .4s ease;-o-transition:background-color .4s ease;transition:background-color .4s ease}.nestedpages .row.np-updated-show{background-color:#fff;-webkit-transition:background-color .4s ease;-o-transition:background-color .4s ease;transition:background-color .4s ease}.nestedpages .row.search .page-title{padding-left:10px}.nestedpages .non-hierarchical-spacer{height:47px}.nestedpages .row-inner{display:table-cell;vertical-align:middle;position:relative}.nestedpages ol li ol .row-inner{padding-left:0}.nestedpages ol li ol li ol .row-inner{padding-left:20px}.nestedpages ol li ol li ol li ol .row-inner{padding-left:40px}.nestedpages ol li ol li ol li ol li ol .row-inner{padding-left:60px}.nestedpages ol li ol li ol li ol li ol li ol .row-inner{padding-left:80px}.nestedpages .np-post-columns{float:right;margin:3px 20px 0 0;zoom:1}.nestedpages .np-post-columns:after,.nestedpages .np-post-columns:before{content:" ";display:table}.nestedpages .np-post-columns:after{clear:both}.nestedpages .np-post-columns ul li{background:0 0;color:gray;border:0;float:left;margin-left:8px;padding-left:8px;border-left:1px solid #ccc}.nestedpages .np-post-columns ul li:first-child{margin-left:0;padding-left:0;border:0}.nestedpages .has-yoast .np-post-columns{margin-right:30px}.nestedpages .has-custom-columns .np-post-columns{display:none}.nestedpages .action-buttons{display:none;position:absolute;right:10px;top:50%;margin-top:-15px}.nestedpages .action-buttons a{margin:0 0 0 -5px;padding:0 .5em;height:30px;line-height:30px}.nestedpages .action-buttons a.np-btn-trash{margin-left:4px}.nestedpages .action-buttons a.np-btn-trash svg{width:20px;height:20px;position:relative;top:4px}.nestedpages .action-buttons a.np-btn-trash svg .icon{fill:#fff}.nestedpages .action-buttons .nestedpages-dropdown{display:inline-block;vertical-align:middle}.nestedpages .action-buttons .nestedpages-dropdown .np-btn.toggle{background:0 0;border:0}.nestedpages .action-buttons .nestedpages-dropdown .np-btn.toggle svg{position:relative;top:4px}.nestedpages .action-buttons .nestedpages-dropdown .np-btn.toggle:active,.nestedpages .action-buttons .nestedpages-dropdown .np-btn.toggle:focus{-webkit-box-shadow:none;box-shadow:none}.nestedpages .action-buttons .nestedpages-dropdown .np-btn.toggle.active{color:gray}.nestedpages .action-buttons .nestedpages-dropdown ul{left:auto;right:5px;width:180px}.nestedpages .action-buttons .nestedpages-dropdown ul li{background-color:#fff}.nestedpages .action-buttons .nestedpages-dropdown ul li a{display:block;color:#333;line-height:1.2;height:auto;margin:0;padding:10px 5px 10px 30px;position:relative}.nestedpages .action-buttons .nestedpages-dropdown ul li a.disabled{opacity:.3}.nestedpages .action-buttons .nestedpages-dropdown ul li a svg{position:absolute;left:0;width:20px;height:20px;top:8px;margin-right:5px;margin-left:5px}.np-search{float:right}.nestedpages-list-header{background-color:#fff;border:1px solid #e1e1e1;border-bottom:0;height:46px;zoom:1}.nestedpages-list-header:after,.nestedpages-list-header:before{content:" ";display:table}.nestedpages-list-header:after{clear:both}.nestedpages-list-header .np-check-all{float:right;width:33px;text-align:center;line-height:46px;background-color:#f0f0f0}.nestedpages-list-header .np-check-all input[type=checkbox]{margin:0}.nestedpages-list-header .np-check-all input[type=checkbox].check-all-partial:checked:before{content:"-";margin:-9px 0 0}.nestedpages-list-header .np-hidden-select-count{display:none;float:right;margin:0 1em 0 0;line-height:46px;font-style:oblique}.nestedpages-list-header .np-bulk-form{padding-right:3px;float:right;margin-right:5px;position:relative;top:9px}.nestedpages-list-header .np-bulk-form input[type=submit],.nestedpages-list-header .np-bulk-form select{display:inline-block}@media (min-width:768px){.nestedpages .row.active .action-buttons,.nestedpages .row:hover .action-buttons{display:block}.nestedpages .row.active .np-post-columns,.nestedpages .row:hover .np-post-columns{display:none}}@media (max-width:767px){.nestedpages ol .page-link{line-height:24px}.nestedpages ol .locked em,.nestedpages ol .page-link:hover span{display:none}.nestedpages .child-toggle{background:0 0}.nestedpages .row{height:auto}.nestedpages .action-buttons{display:none;background-color:#0074a2;float:none;margin:0;padding:8px}.nestedpages .action-buttons a{margin-left:5px}}.nestedpages .new-child .header,.nestedpages .quick-edit .header{padding:10px 0 0;background-color:#f2f2f2;position:relative}.nestedpages .new-child .header h3,.nestedpages .quick-edit .header h3{position:absolute;right:10px;top:15px;font-size:12px}.nestedpages .new-child .header h3 span,.nestedpages .quick-edit .header h3 span{display:inline-block;float:none;margin-left:10px}.nestedpages .new-child .header.no-tabs,.nestedpages .quick-edit .header.no-tabs{zoom:1;padding:10px;border-bottom:1px solid #ccc}.nestedpages .new-child .header.no-tabs:after,.nestedpages .new-child .header.no-tabs:before,.nestedpages .quick-edit .header.no-tabs:after,.nestedpages .quick-edit .header.no-tabs:before{content:" ";display:table}.nestedpages .new-child .header.no-tabs:after,.nestedpages .quick-edit .header.no-tabs:after{clear:both}.nestedpages .new-child .header.no-tabs h3,.nestedpages .quick-edit .header.no-tabs h3{position:relative;top:5px;right:auto;float:right}.nestedpages .new-child .np-menuoptions-description,.nestedpages .quick-edit .np-menuoptions-description{background-color:#f2f2f2;margin-bottom:15px;margin-top:-8px;padding:8px 10px;border:1px solid #e1e1e1}.nestedpages .new-child .np-menuoptions-description p,.nestedpages .quick-edit .np-menuoptions-description p{margin:0 0 2px}.nestedpages .new-child .np-menuoptions-description p.note,.nestedpages .quick-edit .np-menuoptions-description p.note{font-size:.9em;margin:0;opacity:.7}.nestedpages .new-child .form-interior,.nestedpages .quick-edit .form-interior{padding:10px}.nestedpages .new-child h3,.nestedpages .quick-edit h3{margin:0 0 8px;font-size:14px}.nestedpages .new-child h3 span,.nestedpages .quick-edit h3 span{float:right;font-size:12px}.nestedpages .new-child h3 span em,.nestedpages .quick-edit h3 span em{font-weight:400;font-style:normal;color:gray}.nestedpages .new-child .fields,.nestedpages .quick-edit .fields{margin-bottom:10px;background:url(../images/border.png) center repeat-y;zoom:1}.nestedpages .new-child .fields:after,.nestedpages .new-child .fields:before,.nestedpages .quick-edit .fields:after,.nestedpages .quick-edit .fields:before{content:" ";display:table}.nestedpages .new-child .fields:after,.nestedpages .quick-edit .fields:after{clear:both}.nestedpages .new-child .left,.nestedpages .quick-edit .left{float:left;width:48%}.nestedpages .new-child .right,.nestedpages .quick-edit .right{float:right;width:48%}.nestedpages .new-child label,.nestedpages .quick-edit label{font-style:oblique}.nestedpages .new-child .buttons,.nestedpages .quick-edit .buttons{clear:both;zoom:1;background-color:#404040;padding:8px}.nestedpages .new-child .buttons:after,.nestedpages .new-child .buttons:before,.nestedpages .quick-edit .buttons:after,.nestedpages .quick-edit .buttons:before{content:" ";display:table}.nestedpages .new-child .buttons:after,.nestedpages .quick-edit .buttons:after{clear:both}.nestedpages .new-child .form-control,.nestedpages .quick-edit .form-control{clear:both;zoom:1;margin-bottom:5px}.nestedpages .new-child .form-control:after,.nestedpages .new-child .form-control:before,.nestedpages .quick-edit .form-control:after,.nestedpages .quick-edit .form-control:before{content:" ";display:table}.nestedpages .new-child .form-control:after,.nestedpages .quick-edit .form-control:after{clear:both}.nestedpages .new-child .form-control input[type=text],.nestedpages .new-child .form-control input[type=password],.nestedpages .new-child .form-control select,.nestedpages .quick-edit .form-control input[type=text],.nestedpages .quick-edit .form-control input[type=password],.nestedpages .quick-edit .form-control select{float:right;width:75%}.nestedpages .new-child .form-control label,.nestedpages .quick-edit .form-control label{float:left;width:20%}.nestedpages .new-child .form-control.original-link,.nestedpages .quick-edit .form-control.original-link{background-color:#f9f9f9;border:1px solid #e1e1e1;padding:5px;font-style:oblique;margin-bottom:8px}.nestedpages .new-child .form-control.password label,.nestedpages .quick-edit .form-control.password label{width:25%}.nestedpages .new-child .form-control.password input[type=text],.nestedpages .quick-edit .form-control.password input[type=text]{float:left;width:35%}.nestedpages .new-child .form-control.password .private,.nestedpages .quick-edit .form-control.password .private{float:right;width:35%;margin-top:4px}.nestedpages .new-child .form-control.password .private label,.nestedpages .quick-edit .form-control.password .private label{width:auto;float:none}.nestedpages .new-child .form-control.np-datepicker-container .datetime,.nestedpages .quick-edit .form-control.np-datepicker-container .datetime{float:right;width:75%}.nestedpages .new-child .form-control.np-datepicker-container .np-time-container,.nestedpages .quick-edit .form-control.np-datepicker-container .np-time-container{float:left;width:45%;margin:0;position:relative}.nestedpages .new-child .form-control.np-datepicker-container .np-time-container input[type=text],.nestedpages .quick-edit .form-control.np-datepicker-container .np-time-container input[type=text]{float:left;width:55%}.nestedpages .new-child .form-control.np-datepicker-container .np-time-container select,.nestedpages .quick-edit .form-control.np-datepicker-container .np-time-container select{float:right;width:35%}.nestedpages .new-child .form-control.np-datepicker-container .np_datepicker,.nestedpages .quick-edit .form-control.np-datepicker-container .np_datepicker{float:left;width:45%;margin:0}.nestedpages .new-child .form-control.np-datepicker-container .np_datepicker.full,.nestedpages .quick-edit .form-control.np-datepicker-container .np_datepicker.full{width:100%}.nestedpages .new-child .form-control.np-datepicker-container span,.nestedpages .quick-edit .form-control.np-datepicker-container span{float:left;width:10%;display:block;text-align:center;padding-top:3px}.nestedpages .new-child .form-control.full label,.nestedpages .quick-edit .form-control.full label{width:auto}.nestedpages .new-child .form-control.full.checkbox label,.nestedpages .quick-edit .form-control.full.checkbox label{padding:5px 0 5px 25%}.nestedpages .new-child .comments,.nestedpages .quick-edit .comments{float:right;width:75%;margin-bottom:10px;zoom:1}.nestedpages .new-child .comments:after,.nestedpages .new-child .comments:before,.nestedpages .quick-edit .comments:after,.nestedpages .quick-edit .comments:before{content:" ";display:table}.nestedpages .new-child .comments:after,.nestedpages .quick-edit .comments:after{clear:both}.nestedpages .new-child .dates,.nestedpages .quick-edit .dates{float:right;width:75%;margin-bottom:6px}.nestedpages .new-child .dates select,.nestedpages .quick-edit .dates select{width:25%}.nestedpages .new-child .dates input,.nestedpages .quick-edit .dates input{width:12%}.nestedpages .new-child .np-menuoptions,.nestedpages .new-child .np-taxonomies,.nestedpages .quick-edit .np-menuoptions,.nestedpages .quick-edit .np-taxonomies{zoom:1;background-color:#fff}.nestedpages .new-child .np-menuoptions:after,.nestedpages .new-child .np-menuoptions:before,.nestedpages .new-child .np-taxonomies:after,.nestedpages .new-child .np-taxonomies:before,.nestedpages .quick-edit .np-menuoptions:after,.nestedpages .quick-edit .np-menuoptions:before,.nestedpages .quick-edit .np-taxonomies:after,.nestedpages .quick-edit .np-taxonomies:before{content:" ";display:table}.nestedpages .new-child .np-menuoptions:after,.nestedpages .new-child .np-taxonomies:after,.nestedpages .quick-edit .np-menuoptions:after,.nestedpages .quick-edit .np-taxonomies:after{clear:both}.nestedpages .new-child .np-taxonomy,.nestedpages .quick-edit .np-taxonomy{float:left;width:30%;margin-right:3.33%}.nestedpages .new-child .np-taxonomy .title,.nestedpages .quick-edit .np-taxonomy .title{font-weight:700;margin-bottom:4px;display:block}.nestedpages .new-child .np-taxonomy li,.nestedpages .quick-edit .np-taxonomy li{background-color:#fff;border:0}.nestedpages .new-child .np-taxonomy textarea,.nestedpages .quick-edit .np-taxonomy textarea{width:100%;height:6.5em}.nestedpages .new-child .np-menuoptions .left label,.nestedpages .quick-edit .np-menuoptions .left label{width:30%}.nestedpages .new-child .np-menuoptions .left input,.nestedpages .quick-edit .np-menuoptions .left input{width:65%}.nestedpages .new-child .np-menuoptions .right label,.nestedpages .quick-edit .np-menuoptions .right label{margin-bottom:5px;display:block;float:none;width:100%}.nestedpages .new-child .np-hide-options,.nestedpages .quick-edit .np-hide-options{display:none;background-color:#f0f0f0;border-radius:3px;clear:both;padding:6px;-webkit-box-sizing:border-box;box-sizing:border-box}.nestedpages .new-child .np-hide-options p,.nestedpages .quick-edit .np-hide-options p{margin:0}.nestedpages .new-child .np-hide-options label,.nestedpages .quick-edit .np-hide-options label{display:block;margin-top:4px;font-style:normal}.nestedpages .new-child .new-page-titles,.nestedpages .quick-edit .new-page-titles{display:block;border:0}.nestedpages .new-child .new-page-titles li,.nestedpages .quick-edit .new-page-titles li{background:0 0;border:0;padding:4px;zoom:1}.nestedpages .new-child .new-page-titles li:after,.nestedpages .new-child .new-page-titles li:before,.nestedpages .quick-edit .new-page-titles li:after,.nestedpages .quick-edit .new-page-titles li:before{content:" ";display:table}.nestedpages .new-child .new-page-titles li:after,.nestedpages .quick-edit .new-page-titles li:after{clear:both}.nestedpages .new-child .new-page-titles li:nth-child(even),.nestedpages .quick-edit .new-page-titles li:nth-child(even){background-color:#f0f0f0}.nestedpages .new-child .new-page-titles li label,.nestedpages .quick-edit .new-page-titles li label{margin-top:7px}.nestedpages .new-child .new-page-titles .form-control,.nestedpages .quick-edit .new-page-titles .form-control{float:right;width:90%;clear:none}.nestedpages .nestedpages-bulk-edit .np-bulk-footer:after,.nestedpages .new-child .new-page-titles .new-child-row div:after,.nestedpages .quick-edit .new-page-titles .new-child-row div:after,.nestedpages-settings-table .row-container .head:after,.np-link-modal-content .buttons-inner:after,.np-link-modal-content .footer-inner:after,.np-menu-customization .np-menu-customization-header:after,.np-modal-form .buttons,.np-modal-form .form-control:after,.np-modal-form .form-interior:after,.np-nav-menu-settings .menu-item .title:after,.np-nav-menu-settings .menu-item:after,.np-nav-menu-settings .np-extra-options .half,.np-nav-menu-settings .np-extra-options:after{clear:both}.nestedpages .new-child .new-page-titles .np-icon-menu,.nestedpages .quick-edit .new-page-titles .np-icon-menu{float:left;margin-top:0;width:24px;height:24px;position:relative;top:5px}.nestedpages .new-child .new-page-titles .new-child-row div,.nestedpages .quick-edit .new-page-titles .new-child-row div{float:right;width:75%;margin:2px;zoom:1}.nestedpages .new-child .new-page-titles .new-child-row div:after,.nestedpages .new-child .new-page-titles .new-child-row div:before,.nestedpages .quick-edit .new-page-titles .new-child-row div:after,.nestedpages .quick-edit .new-page-titles .new-child-row div:before{content:" ";display:table}.nestedpages .new-child .new-page-titles .new-child-row div input[type=text],.nestedpages .quick-edit .new-page-titles .new-child-row div input[type=text]{float:left;width:80%}.nestedpages .new-child .new-page-titles .new-child-row div a,.nestedpages .quick-edit .new-page-titles .new-child-row div a{float:right}.np-modal.nestedpages .new-child .right .form-control input[type=text],.np-modal.nestedpages .new-child .right .form-control input[type=password],.np-modal.nestedpages .new-child .right .form-control label,.np-modal.nestedpages .new-child .right .form-control select{float:none;width:100%}.np-modal.nestedpages .new-child .right .form-control.full label{padding-left:0}.np-modal.nestedpages .new-child .new-page-titles .form-control{width:85%}.np-modal.nestedpages .new-child .new-page-titles .form-control div{width:100%}.np-modal.nestedpages .new-child .left label{display:none}@media (max-width:767px){.nestedpages .quick-edit .comments,.nestedpages .quick-edit .dates,.nestedpages .quick-edit .form-control input[type=text],.nestedpages .quick-edit .form-control input[type=password],.nestedpages .quick-edit .form-control label,.nestedpages .quick-edit .form-control select,.nestedpages .quick-edit .form-control.np-datepicker-container .datetime,.nestedpages .quick-edit .left,.nestedpages .quick-edit .right{float:none;width:100%}.nestedpages .quick-edit .fields{background:0 0}.nestedpages .quick-edit .form-control{margin-bottom:10px}.nestedpages .quick-edit .form-control label{display:block;margin-bottom:4px}.nestedpages .quick-edit .dates{margin-bottom:6px}}.np-modal-form .form-interior{zoom:1;background:url(../images/border.png) center repeat-y;padding:5px 0}.np-modal-form .form-interior:after,.np-modal-form .form-interior:before{content:" ";display:table}.np-modal-form .form-control{zoom:1;margin-bottom:10px}.np-modal-form .form-control:after,.np-modal-form .form-control:before{content:" ";display:table}.np-modal-form .checkbox{margin-bottom:10px}.np-modal-form .left{float:left;width:45%}.np-modal-form .right{float:right;width:45%;padding-top:18px}.np-modal-form label{display:block}.np-modal-form input[type=text],.np-modal-form select{width:100%}.np-new-child-form.in-modal{padding-bottom:50px}.modal-body.np-menu-item-form{height:100%;padding:0;border-top:1px solid #e1e1e1;position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch}.np-link-modal-content .new-child,.np-link-modal-content .np-tabbed-content{height:100%}.np-link-modal-content .new-child form,.np-link-modal-content .np-tabbed-content form{height:94%}.np-link-modal-content .form-interior,.np-link-modal-content .modal-content{position:relative;height:100%}.np-link-modal-content .form-interior{overflow:auto}.np-link-modal-content .buttons,.np-link-modal-content .modal-footer{position:absolute;left:0;width:100%;bottom:0;padding:0}.np-link-modal-content .buttons{padding:0!important}.np-link-modal-content .buttons-inner,.np-link-modal-content .footer-inner{padding:10px;zoom:1}.np-link-modal-content .buttons-inner:after,.np-link-modal-content .buttons-inner:before,.np-link-modal-content .footer-inner:after,.np-link-modal-content .footer-inner:before{content:" ";display:table}.np-menu-type-selection{overflow:auto;width:35%;padding:15px;background-color:#f9f9f9;border-right:1px solid #e1e1e1;-webkit-box-sizing:border-box;box-sizing:border-box}.np-menu-type-selection ul{list-style-type:none;margin:0;padding:0;border-radius:3px;border:0}.np-menu-type-selection ul li{margin:0;border:1px solid #e5e5e5;border-top:0}.np-menu-type-selection ul li a{background-color:#fff;display:block;text-decoration:none;padding:15px 10px;position:relative;color:#333;font-weight:700;transition:all .2s ease}.np-menu-type-selection ul li a:hover{background-color:#ebebeb;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease}.np-menu-type-selection ul li a:after{position:absolute;font-family:dashicons;content:"\f140";font-size:18px;right:10px;top:15px;color:gray}.np-menu-type-selection ul li a.active:after{content:"\f142"}.np-menu-type-selection ul li a.np-custom-link:after{content:"\f139"}.np-menu-type-selection ul li a.np-custom-link.active{background-color:#0074a2;color:#fff}.np-menu-type-selection ul li a.np-custom-link.active:after{content:"\f335";color:#fff}.np-menu-type-selection ul li a:active,.np-menu-type-selection ul li a:focus{-webkit-box-shadow:none;box-shadow:none}.np-menu-type-selection ul li a.no-terms{color:#b3b3b3}.np-menu-type-selection ul li a.no-terms span{float:right;font-weight:400;font-style:oblique}.np-menu-type-selection ul li a.no-terms:after{content:''}.np-menu-type-selection ul li a.no-terms:hover{background-color:#fff;cursor:default}.np-menu-type-selection ul li a.no-terms.section{padding:8px 10px;background-color:#333;color:#fff}.np-menu-type-selection ul li:first-child{border-top:1px solid #e5e5e5}.np-menu-type-selection ul li ul{display:none;-webkit-box-shadow:none;box-shadow:none;padding:10px;background-color:#fff}.np-menu-type-selection ul li ul li{border-color:#e0e0e0}.np-menu-type-selection ul li ul li a{padding:8px;background-color:#f9f9f9;font-weight:400}.np-menu-type-selection ul li ul li a:after{content:"\f139";top:8px;right:5px}.np-menu-type-selection ul li ul li a.active{background-color:#0074a2;color:#fff}.np-menu-type-selection ul li ul li a.active:after{content:"\f335";color:#fff}.np-menu-link-object{width:65%;overflow:auto}.np-menu-link-object-placeholder{text-align:center;position:relative;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);color:#b3b3b3}.np-menu-search{padding:10px;background-color:#f9f9f9}.np-menu-search input[type=text]{width:100%;height:35px}.np-menu-search .np-menu-search-loading{margin-top:5px}.np-menu-link-details h3,.np-menu-link-details p{margin-top:0}.np-menu-search .np-menu-search-noresults{display:none;text-align:center;padding-top:8px;font-style:oblique}.np-menu-link-details{padding:20px}.np-menu-link-details h3 em{float:right;font-size:13px;font-weight:400;font-style:normal;color:gray}.np-menu-link-details .original-link{border:1px solid #e5e5e5;font-size:12px;margin-bottom:15px;padding:5px;font-style:oblique}.np-menu-link-details .fields{background-color:#f9f9f9;padding:15px}.np-menu-link-details .checkbox{margin-bottom:10px}.np-menu-link-details label{display:block}.np-menu-link-details input[type=text]{width:100%}.nestedpages .nestedpages-bulk-edit{display:none;background-color:#fff;margin:0;border:1px solid #e1e1e1;border-bottom:0}.nestedpages .nestedpages-bulk-edit h3{padding:1em;margin:0}.nestedpages .nestedpages-bulk-edit .np-bulk-edit-link-info{padding:0 1em}.nestedpages .nestedpages-bulk-edit .fields{padding:1em;margin:0}.nestedpages .nestedpages-bulk-edit .np-taxonomies{margin:0}.nestedpages .nestedpages-bulk-edit .np-bulk-titles{list-style-type:none;margin:0;background-color:#f9f9f9;border:1px solid #e5e5e5;border-left:0;border-right:0;padding:.5em}.nestedpages .nestedpages-bulk-edit .np-bulk-titles li{padding:0;margin:.5em 0 0}.nestedpages .nestedpages-bulk-edit .np-bulk-titles li:first-child{margin:0}.nestedpages .nestedpages-bulk-edit .np-bulk-titles .np-remove{display:inline-block;background-color:#333;width:22px;height:22px;border-radius:50%;text-align:center;text-decoration:none;color:#fff;line-height:18px;font-size:1.5em;margin-right:.3em}.nestedpages .nestedpages-bulk-edit .np-bulk-titles .np-remove:hover{background-color:gray}.nestedpages .nestedpages-bulk-edit .np-taxonomies{display:block;padding:1em}.nestedpages .nestedpages-bulk-edit .np-bulk-footer{padding:10px;text-align:right;background-color:#404040;zoom:1}.nestedpages .nestedpages-bulk-edit .np-bulk-footer:after,.nestedpages .nestedpages-bulk-edit .np-bulk-footer:before{content:" ";display:table}.nestedpages .nestedpages-bulk-edit .np-bulk-footer .pull-left{float:left}.nestedpages-columns-header{display:table;border-collapse:collapse;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#f0f0f0;border:1px solid #e1e1e1;border-bottom:0}.nestedpages-columns-header .cell{font-weight:700;text-align:left;display:table-cell;padding:1em .5em 1em 0;-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:middle}.nestedpages-columns-header .toggle-spacer span{display:block;width:50px}.nestedpages-columns-header .bulk-spacer span{display:block;width:33px}.nestedpages-columns-header .thumbnail-spacer span{display:block;width:100%}.nestedpages-columns-header .title{width:30%;padding:0 5px}.nestedpages-row-columns{display:table;width:100%;border-collapse:collapse;-webkit-box-sizing:border-box;box-sizing:border-box}.nestedpages-row-columns .cell{text-align:left;display:table-cell;padding:1em .5em 1em 0;-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:middle}.nestedpages-row-columns .title-cell{width:30%;position:relative}.nestedpages-row-columns .title-cell-spacer{position:absolute;display:block;width:100%}@media (max-width:767px){.nestedpages-columns-header,.nestedpages-row-columns .custom-column{display:none}.nestedpages-row-columns .title-cell.cell{width:100%}}.np-wpml-translations-modal .np-qe-loading{margin:1em 0;text-align:center;float:left}.np-wpml-translations-modal.loading .np-translations-table{display:none}.np-wpml-translations-modal.loading .np-qe-loading{display:block}.np-wpml-translations-modal .np-translations-table{display:table;border-collapse:collapse;width:100%}.np-wpml-translations-modal .np-translations-table tr td{padding:10px;border:1px solid #e1e1e1}.np-wpml-translations-modal .np-translations-table tr td:first-child{border-left:0;padding-left:0}.np-wpml-translations-modal .np-translations-table tr td:last-child{border-right:0}.np-wpml-translations-modal .np-translations-table tr:last-child td{border-bottom:0}.nestedpages-settings-table thead th{background-color:#d9d9d9;padding:5px}.nestedpages-settings-table tbody tr td{padding:5px;border-left:1px solid #e0e0e0}.nestedpages-settings-table tbody tr td:first-child{border:0}.nestedpages-settings-table tbody tr:nth-child(odd) td{background-color:#fff}.nestedpages-settings-table i{font-size:20px}.nestedpages-settings-table .np-btn{cursor:pointer;text-decoration:none;color:#555;display:inline-block;background-color:#f7f7f7;border:1px solid #e1e1e1;padding:5px 8px;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease}.nestedpages-settings-table .np-btn:hover{background-color:#0074a2;color:#fff;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;border-color:#0074a2}.nestedpages-settings-table .np-btn.disabled,.nestedpages-settings-table .np-btn:disabled{opacity:.6;cursor:not-allowed}.nestedpages-settings-table .np-btn-trash{background-color:#e14d43;border-color:#e14d43;color:#fff}.nestedpages-settings-table .np-btn-trash:hover{background-color:#ba281e;border-color:#ba281e}.nestedpages-settings-general-wrapper{padding-top:1em;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.nestedpages-settings-general-wrapper .nestedpages-settings-table{width:67%;border:0}.nestedpages-settings-general-wrapper .nestedpages-settings-table .row{border-left:1px solid #e1e1e1;border-right:1px solid #e1e1e1}.nestedpages-settings-general-wrapper .nestedpages-settings-table .row.submit{border:0}.nestedpages-settings-general-wrapper .nestedpages-settings-support{width:30%;background-color:#fff;text-align:center;border:1px solid #e5e5e5;border-radius:3px}.nestedpages-settings-general-wrapper .nestedpages-settings-support .inner{padding:2em}.nestedpages-settings-general-wrapper .nestedpages-settings-support .or{margin:2em 0}.nestedpages-settings-general-wrapper h3{color:#ff2d20;margin:0 0 3px;font-size:20px}.nestedpages-settings-general-wrapper h4{margin:0}.nestedpages-settings-general-wrapper .support-button{display:block;background-color:rgba(255,45,32,.1);border:1px solid rgba(255,45,32,.15);text-align:center;color:#333;text-decoration:none;padding:1em;border-radius:4px;font-weight:700;font-size:16px;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease}.nestedpages-settings-general-wrapper .support-button svg{display:inline-block;vertical-align:middle;margin-right:8px}.nestedpages-settings-general-wrapper .support-button svg .heart{fill:#ff2d20}.nestedpages-settings-general-wrapper .support-button:hover{background-color:#ff2d20;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;color:#fff}.nestedpages-settings-general-wrapper .support-button:hover svg .heart{fill:#fff}@media (max-width:768px){.nestedpages-settings-general-wrapper{display:block}.nestedpages-settings-general-wrapper .nestedpages-settings-support,.nestedpages-settings-general-wrapper .nestedpages-settings-table{width:100%}}.nestedpages-settings-table{border-collapse:collapse;border:1px solid #e5e5e5;border-radius:3px}.nestedpages-settings-table .row-container{border-bottom:1px solid #e1e1e1}.nestedpages-settings-table .row-container:last-child{border:0}.nestedpages-settings-table .row-container .head{zoom:1;line-height:46px;background-color:#fff;padding-right:10px}.nestedpages-settings-table .row-container .head:after,.nestedpages-settings-table .row-container .head:before{content:" ";display:table}.nestedpages-settings-table .row-container .head .checkbox{float:left;width:46px;height:46px;background-color:rgba(51,51,51,.06);text-align:center;line-height:46px;margin-right:10px}.nestedpages-settings-table .row-container .head label{float:left;line-height:46px;margin:0}.nestedpages-settings-table .row-container .head label em{color:#999}.nestedpages-settings-table .row-container .head .button{float:right;margin-top:10px}.nestedpages-settings-table .row-container.active .head{background-color:#0074a2;color:#fff}.nestedpages-settings-table .row-container .row{display:table;width:100%}.nestedpages-settings-table .row-container .row.submit{display:block}.nestedpages-settings-table .row-container .row.submit p{margin:0}.nestedpages-settings-table .row-container .row .description{display:table-cell;vertical-align:top;width:25%;border-bottom:1px solid #e1e1e1;background-color:#f9f9f9;padding:1em}.nestedpages-settings-table .row-container .row .description p{color:gray;font-size:.9em}.nestedpages-settings-table .row-container .row .description strong{color:#333;font-size:1.2em}.nestedpages-settings-table .row-container .row .field{display:table-cell;vertical-align:top;width:75%;background-color:#fff;border-bottom:1px solid #e1e1e1;border-left:1px solid #e1e1e1;padding:1em}.nestedpages-settings-table .row-container .row .field.padded-sides{padding:1em 2em}.nestedpages-settings-table .row-container .row .field.extra-padding{padding:2em}.nestedpages-settings-table .row-container .row .field label.block{display:block}.nestedpages-settings-table .row-container .row .field input[type=tel],.nestedpages-settings-table .row-container .row .field input[type=text],.nestedpages-settings-table .row-container .row .field select{width:100%}.nestedpages-settings-table .row-container .body{display:none}.nestedpages-settings-table .row-container .body h4{margin:0;padding:10px 0 0 10px}.nestedpages-settings-table .row-container .body .settings-details,.nestedpages-settings-table .row-container .body li{margin:0}.nestedpages-settings-table .row-container .settings-details li:last-child .description,.nestedpages-settings-table .row-container .settings-details li:last-child .field{border-bottom:0}.nestedpages-settings-table .row-container .columns,.nestedpages-settings-table .row-container .custom-fields,.nestedpages-settings-table .row-container .standard-fields{display:none;padding-top:20px}.nestedpages-settings-table .row-container .columns .custom-field-group,.nestedpages-settings-table .row-container .custom-fields .custom-field-group,.nestedpages-settings-table .row-container .standard-fields .custom-field-group{height:150px;overflow:auto;background-color:#f9f9f9;padding:10px;border:1px solid #e1e1e1}.nestedpages-settings-table .row-container .columns h5,.nestedpages-settings-table .row-container .custom-fields h5,.nestedpages-settings-table .row-container .standard-fields h5{padding:0;font-weight:400;font-style:oblique;margin:0 0 6px;color:#999}.nestedpages-settings-table .row-container .columns p,.nestedpages-settings-table .row-container .custom-fields p,.nestedpages-settings-table .row-container .standard-fields p{margin:0 0 6px;font-weight:700}.nestedpages-settings-table .row-container .columns ul,.nestedpages-settings-table .row-container .custom-fields ul,.nestedpages-settings-table .row-container .standard-fields ul{margin:0}.nestedpages-settings-table .row-container .columns ul.indented,.nestedpages-settings-table .row-container .custom-fields ul.indented,.nestedpages-settings-table .row-container .standard-fields ul.indented{padding-left:15px}.nestedpages-settings-table .row-container .columns ul li,.nestedpages-settings-table .row-container .custom-fields ul li,.nestedpages-settings-table .row-container .standard-fields ul li{margin:3px 0 0}.nestedpages-page-pt-assignment,.nestedpages-settings-table .row-container .thumbnail-options{background-color:#f9f9f9;padding:10px;border:1px solid #e1e1e1;margin-top:1em}.nestedpages-settings-table .row-container .thumbnail-options label{display:block}.nestedpages-settings-table .row-container .thumbnail-options select{margin-bottom:1em}.nestedpages-page-pt-assignment input[type=search]{width:100%;margin-bottom:1em}.nestedpages-page-pt-assignment .np-quickedit-info{background-color:#fff;border-right:1px solid #e5e5e5;border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5}.nestedpages-page-pt-assignment .nestedpages-page-search-results{height:100px;overflow:auto}.nestedpages-page-pt-assignment .nestedpages-page-search-results ul{list-style-type:none;margin:0;padding:0}.nestedpages-page-pt-assignment .nestedpages-page-search-results a{display:block;text-decoration:none;border-top:1px solid #dcdcdc;padding:3px 0;color:#333;background-color:#f9f9f9}.nestedpages-page-pt-assignment .nestedpages-page-search-results a:hover{background-color:#0074a2;color:#fff;padding-left:5px}.nestedpages-page-pt-assignment .nestedpages-page-search-results li:first-child a{border:0;padding-top:0}.nestedpages-checklist-field,.nestedpages-page-pt-assignment-selection,.nestedpages-sort-options-selection{background-color:#f9f9f9;border:1px solid #e1e1e1;margin-top:1em;padding:.5em}.nestedpages-checklist-field label,.nestedpages-sort-options-selection label{display:block;margin-top:3px}.nestedpages-checklist-field label:first-child,.nestedpages-sort-options-selection label:first-child{margin:0}.nestedpages-checklist-field .sort-options-default,.nestedpages-sort-options-selection .sort-options-default{display:none;background-color:#fff;margin:.5em 0 1.5em;padding:.75em;border:1px solid #e1e1e1}.nestedpages-checklist-field .sort-options-default label,.nestedpages-sort-options-selection .sort-options-default label{display:inline-block}.nestedpages-checklist-field .sort-options-default select,.nestedpages-sort-options-selection .sort-options-default select{width:auto!important}.np-menu-customization{display:none;padding:.5em 1em 1em}.np-menu-customization .np-menu-customization-header{background-color:#f9f9f9;border:1px solid #e1e1e1;border-bottom:0;height:60px;position:relative;padding:15px 180px 0 10px;-webkit-box-sizing:border-box;box-sizing:border-box;zoom:1}.np-menu-customization .np-menu-customization-header:after,.np-menu-customization .np-menu-customization-header:before{content:" ";display:table}.np-menu-customization .np-menu-customization-header .hide,.np-menu-customization .np-menu-customization-header .new{position:absolute;right:0;top:0;height:60px;width:80px;text-align:center;line-height:60px;border-left:1px solid #e1e1e1;background-color:#ececec;font-size:.9em}.np-menu-customization .np-menu-customization-header .role-select{float:left;width:100%}.np-menu-customization .np-menu-customization-header .new{right:80px;background-color:#fff}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-toggle{display:block;height:60px;width:80px;text-decoration:none;color:#333}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-toggle .np-caret{display:inline-block;width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid #333;vertical-align:middle;margin-left:3px}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-toggle:active,.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-toggle:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-content{width:150px;font-size:1.1em}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-content ul li{border-top:1px solid #e1e1e1}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-content ul li a{display:block;padding:1em .5em;background-color:#fff}.np-nav-menu-settings .update-count,.np-nav-menu-settings li.disabled .menu-item .title:hover .details-button,.np-nav-menu-settings li.disabled .submenu-toggle a,.np-nav-menu-settings li.disabled.submenu-open .submenu-listing{display:none}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-content ul li a:hover{background-color:#333;color:#fff}.np-menu-customization .np-menu-customization-header .nestedpages-dropdown-content ul li:first-child{border:0}.np-nav-menu-settings li{border:1px solid #e1e1e1;position:relative;border-top:0}.np-nav-menu-settings li.disabled{text-decoration:line-through}.np-nav-menu-settings li.disabled:hover{background-color:inherit!important}.np-nav-menu-settings li.disabled .menu-item .title{opacity:.2}.np-nav-menu-settings li:first-child{border-top:1px solid #e1e1e1}.np-nav-menu-settings li:first-child .hide-checkbox{border-top:0}.np-nav-menu-settings .ui-sortable-helper{border:1px solid #e1e1e1;-webkit-box-shadow:1px 1px 1px 0 rgba(0,0,0,.3);box-shadow:1px 1px 1px 0 rgba(0,0,0,.3)}.np-nav-menu-settings .menu-item{height:50px;zoom:1;padding:0 80px 0 100px;background-color:#fff}.np-nav-menu-settings .menu-item:after,.np-nav-menu-settings .menu-item:before{content:" ";display:table}.np-nav-menu-settings .menu-item .title{zoom:1;position:relative;padding-right:120px;height:50px}.np-nav-menu-settings .menu-item .title:after,.np-nav-menu-settings .menu-item .title:before{content:" ";display:table}.np-nav-menu-settings .menu-item .title.separator{padding-left:40px}.np-nav-menu-settings .menu-item .title p{margin:0;font-size:1em;line-height:50px}.np-nav-menu-settings .menu-item .title .menu-icon{position:absolute;left:0;top:0;height:50px;width:40px;text-align:center}.np-nav-menu-settings .menu-item .title .menu-icon:before{font-size:1.6em;line-height:50px}.np-nav-menu-settings .menu-item .title .details-button{display:none;position:absolute;right:0;top:0;margin:12px 10px 0 0}.np-nav-menu-settings .menu-item .title:hover .details-button{display:block}.np-nav-menu-settings .menu-item .menu-title-field{float:left;margin:0 0 0 40px;position:relative;padding:0;line-height:50px;border:0;-webkit-box-shadow:none;box-shadow:none}.np-nav-menu-settings .menu-item .menu-title-field::-webkit-input-placeholder{color:#333}.np-nav-menu-settings .menu-item .menu-title-field::-moz-placeholder{color:#333}.np-nav-menu-settings .menu-item .menu-title-field:-ms-input-placeholder{color:#333}.np-nav-menu-settings .menu-item .menu-title-field::-ms-input-placeholder{color:#333}.np-nav-menu-settings .menu-item .menu-title-field::placeholder{color:#333}.np-nav-menu-settings li.separator .menu-item{background-color:#f9f9f9;padding-right:10px}.np-nav-menu-settings li.separator .menu-item .menu-icon{display:none}.np-nav-menu-settings li.separator .menu-item .details-button{margin-right:0}.np-nav-menu-settings li.separator .menu-item .title{padding-left:10px;padding-right:0;color:#999}.np-nav-menu-settings .ui-sortable-placeholder{background-color:#f9f9f9;border:1px dashed #0074a2!important;display:block;visibility:visible!important}.np-nav-menu-settings .submenu-toggle{width:50px;height:50px;left:0;border-right:1px solid #e1e1e1;background-color:#f9f9f9;position:absolute}.np-nav-menu-settings .submenu-toggle a{margin:0;display:block;text-decoration:none;width:26px;height:26px;background-color:#fff;border:1px solid #e1e1e1;border-radius:50%;text-align:center;color:#333;position:relative;top:10px;left:10px;-webkit-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(0);-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease}.np-nav-menu-settings .submenu-toggle a span{margin:0;position:absolute;left:11px;top:8px;display:block;width:0;height:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:6px solid #333}.np-nav-menu-settings .submenu-toggle a.active{background-color:#333;color:#fff;-webkit-transition:all .2s ease;-o-transition:all .2s ease;transition:all .2s ease;-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg);border-color:#333}.np-nav-menu-settings .submenu-toggle a.active span{border-left-color:#fff}.np-nav-menu-settings .submenu-toggle a:active,.np-nav-menu-settings .submenu-toggle a:focus{outline:0;-webkit-box-shadow:none;box-shadow:none}.np-nav-menu-settings .handle{position:absolute;width:50px;height:50px;left:51px;background-color:#f9f9f9;border-right:1px solid #e5e5e5;text-align:center;line-height:40px;cursor:move}.nestedpages.np-dark-mode .handle .bars,.nestedpages.np-dark-mode .np-icon-sub-menu .arrow,.nestedpages.np-dark-mode .page-title .link-icon .icon,.nestedpages.np-dark-mode ol .row-status-icon .icon,.np-dark-mode .handle .bars,.np-dark-mode .np-icon-sub-menu .arrow,.np-dark-mode .page-title .link-icon .icon,.np-dark-mode ol .row-status-icon .icon{fill:#50626f}.np-nav-menu-settings .handle svg{position:relative;top:10px;width:20px}.np-nav-menu-settings .handle:hover{color:#333}.np-nav-menu-settings .hide-checkbox{position:absolute;width:80px;height:50px;top:0;text-align:center;right:0;background-color:#ececec;border-left:1px solid #e1e1e1}.np-nav-menu-settings .hide-checkbox input[type=checkbox]{position:relative;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);margin-top:-5px;left:2px}.np-nav-menu-settings .np-extra-options{display:none;border-top:1px solid #e1e1e1;padding:1em;zoom:1;background-color:#f9f9f9}.np-nav-menu-settings .np-extra-options:after,.np-nav-menu-settings .np-extra-options:before{content:" ";display:table}.np-nav-menu-settings .np-extra-options .half{float:left;width:48%}.np-nav-menu-settings .np-extra-options .half.right{clear:none;float:right}.np-nav-menu-settings .options-open .menu-item .title .details-button,.np-nav-menu-settings .options-open .np-extra-options{display:block}.np-nav-menu-settings .options-open.disabled .menu-item .title .details-button,.np-nav-menu-settings .options-open.disabled .np-extra-options{display:none}.np-nav-menu-settings .submenu-listing{display:none;padding-left:50px;background-color:#f9f9f9;border-top:1px solid #e1e1e1;border-bottom:3px solid #e1e1e1}.np-nav-menu-settings li.submenu-open .submenu-listing{display:block}.np-nav-menu-settings .submenu-item{border:0;border-left:1px solid #e1e1e1;border-top:1px solid #e1e1e1;background-color:#f9f9f9}.np-nav-menu-settings .submenu-item .menu-item{padding-left:50px}.np-nav-menu-settings .submenu-item .title{padding-left:1em}.np-nav-menu-settings .submenu-item:first-child{border-top:0}.np-nav-menu-settings .submenu-item .handle{left:0}.nestedpages.np-dark-mode ol,.np-dark-mode ol{border:0;border-radius:0}.nestedpages.np-dark-mode ol .np-page-type,.np-dark-mode ol .np-page-type{color:#bbc8d4}.nestedpages.np-dark-mode ol .locked,.np-dark-mode ol .locked{color:#fff}.nestedpages.np-dark-mode ol .nav-status,.nestedpages.np-dark-mode ol .np-icon-eye-blocked,.nestedpages.np-dark-mode ol .status,.nestedpages.np-dark-mode ol .sticky,.np-dark-mode ol .nav-status,.np-dark-mode ol .np-icon-eye-blocked,.np-dark-mode ol .status,.np-dark-mode ol .sticky{color:#50626f}.nestedpages.np-dark-mode ol .np-assigned-pt-actions li a,.np-dark-mode ol .np-assigned-pt-actions li a{color:#fff;border-color:rgba(0,0,0,.2)}.nestedpages.np-dark-mode ol .np-seo-indicator,.np-dark-mode ol .np-seo-indicator{background-color:#50626f}.nestedpages.np-dark-mode ol .np-seo-indicator.good,.np-dark-mode ol .np-seo-indicator.good{background-color:#7ad03a}.nestedpages.np-dark-mode ol .np-seo-indicator.ok,.np-dark-mode ol .np-seo-indicator.ok{background-color:#ffba00}.nestedpages.np-dark-mode ol .np-seo-indicator.poor,.np-dark-mode ol .np-seo-indicator.poor{background-color:#ee7c1b}.nestedpages.np-dark-mode ol .np-seo-indicator.bad,.np-dark-mode ol .np-seo-indicator.bad{background-color:#dd3d36}.nestedpages.np-dark-mode ol .np-seo-indicator.warn,.np-dark-mode ol .np-seo-indicator.warn{background-color:maroon}.nestedpages.np-dark-mode ol .np-seo-indicator.wrong,.np-dark-mode ol .np-seo-indicator.wrong{background-color:red}.nestedpages.np-dark-mode ol .np-seo-indicator.noindex,.np-dark-mode ol .np-seo-indicator.noindex{background-color:#1e8cbe}.nestedpages.np-dark-mode ol li,.np-dark-mode ol li{border-top-color:#32373c;background:0 0}.nestedpages.np-dark-mode ol ol,.np-dark-mode ol ol{border-top:1px solid #32373c}.nestedpages.np-dark-mode .np-icon-arrow,.np-dark-mode .np-icon-arrow{border-left-color:#fff}.nestedpages.np-dark-mode .child-toggle a:active,.nestedpages.np-dark-mode .child-toggle a:focus,.np-dark-mode .child-toggle a:active,.np-dark-mode .child-toggle a:focus{-webkit-box-shadow:none;box-shadow:none}.nestedpages.np-dark-mode .non-indent .child-toggle,.np-dark-mode .non-indent .child-toggle{background-color:rgba(0,0,0,.15)}.nestedpages.np-dark-mode .non-indent .child-toggle a,.np-dark-mode .non-indent .child-toggle a{background-color:#50626f;border:0;color:#fff}.nestedpages.np-dark-mode .non-indent .child-toggle a .np-icon-arrow,.nestedpages.np-dark-mode .non-indent .child-toggle a:hover .np-icon-arrow,.np-dark-mode .non-indent .child-toggle a .np-icon-arrow,.np-dark-mode .non-indent .child-toggle a:hover .np-icon-arrow{border-left-color:#fff}.nestedpages.np-dark-mode .non-indent .child-toggle a:hover,.np-dark-mode .non-indent .child-toggle a:hover{background-color:rgba(0,0,0,.5)}.nestedpages.np-dark-mode .handle,.np-dark-mode .handle{color:#50626f}.nestedpages.np-dark-mode .action-buttons .nestedpages-dropdown .np-btn.toggle svg path.circles,.nestedpages.np-dark-mode .action-buttons .nestedpages-dropdown ul li a svg path.primary,.np-dark-mode .action-buttons .nestedpages-dropdown .np-btn.toggle svg path.circles,.np-dark-mode .action-buttons .nestedpages-dropdown ul li a svg path.primary{fill:#fff}.nestedpages.np-dark-mode .np-bulk-checkbox,.nestedpages.np-dark-mode .row,.np-dark-mode .np-bulk-checkbox,.np-dark-mode .row{background:0 0}.nestedpages.np-dark-mode .row.active,.nestedpages.np-dark-mode .row.np-updated,.nestedpages.np-dark-mode .row.np-updated-show,.nestedpages.np-dark-mode .row:hover,.np-dark-mode .row.active,.np-dark-mode .row.np-updated,.np-dark-mode .row.np-updated-show,.np-dark-mode .row:hover{background-color:#32373c}.nestedpages.np-dark-mode .np-post-columns ul li,.np-dark-mode .np-post-columns ul li{color:#fff;border-left:1px solid rgba(0,0,0,.4)}.nestedpages.np-dark-mode .np-post-columns ul li:first-child,.np-dark-mode .np-post-columns ul li:first-child{border:0}.nestedpages.np-dark-mode .action-buttons .nestedpages-dropdown ul li,.np-dark-mode .action-buttons .nestedpages-dropdown ul li{background-color:#50626f}.nestedpages.np-dark-mode .action-buttons .nestedpages-dropdown ul li a,.np-dark-mode .action-buttons .nestedpages-dropdown ul li a{color:#fff}.nestedpages.np-dark-mode .nestedpages-list-header,.np-dark-mode .nestedpages-list-header{background-color:#32373c;border:0}.nestedpages.np-dark-mode .nestedpages-list-header .np-check-all,.np-dark-mode .nestedpages-list-header .np-check-all{background:0 0}.nestedpages.np-dark-mode .np-btn,.np-dark-mode .np-btn{color:#fff;display:inline-block;background-color:#50626f;border:1px solid #444}.nestedpages.np-dark-mode .np-btn:hover,.np-dark-mode .np-btn:hover{background-color:#32373c;border-color:#32373c}.nestedpages.np-dark-mode .np-inline-modal,.np-dark-mode .np-inline-modal{background-color:#32373c}.nestedpages.np-dark-mode .new-child h3,.nestedpages.np-dark-mode .quick-edit h3,.np-dark-mode .new-child h3,.np-dark-mode .quick-edit h3{color:#fff}.nestedpages.np-dark-mode .new-child h3 span em,.nestedpages.np-dark-mode .quick-edit h3 span em,.np-dark-mode .new-child h3 span em,.np-dark-mode .quick-edit h3 span em{color:#50626f}.nestedpages.np-dark-mode .new-child .fields,.nestedpages.np-dark-mode .quick-edit .fields,.np-dark-mode .new-child .fields,.np-dark-mode .quick-edit .fields{background:0 0}.nestedpages.np-dark-mode .new-child .buttons,.nestedpages.np-dark-mode .quick-edit .buttons,.np-dark-mode .new-child .buttons,.np-dark-mode .quick-edit .buttons{background-color:rgba(0,0,0,.15)}.nestedpages.np-dark-mode .new-child .form-control.original-link,.nestedpages.np-dark-mode .quick-edit .form-control.original-link,.np-dark-mode .new-child .form-control.original-link,.np-dark-mode .quick-edit .form-control.original-link{background-color:rgba(0,0,0,.15);border:0}.nestedpages.np-dark-mode .new-child .np-toggle-options,.nestedpages.np-dark-mode .quick-edit .np-toggle-options,.np-dark-mode .new-child .np-toggle-options,.np-dark-mode .quick-edit .np-toggle-options{background-color:rgba(0,0,0,.1)}.nestedpages.np-dark-mode .new-child .np-menuoptions,.nestedpages.np-dark-mode .new-child .np-taxonomies,.nestedpages.np-dark-mode .new-child .np-taxonomy li,.nestedpages.np-dark-mode .quick-edit .np-menuoptions,.nestedpages.np-dark-mode .quick-edit .np-taxonomies,.nestedpages.np-dark-mode .quick-edit .np-taxonomy li,.np-dark-mode .new-child .np-menuoptions,.np-dark-mode .new-child .np-taxonomies,.np-dark-mode .new-child .np-taxonomy li,.np-dark-mode .quick-edit .np-menuoptions,.np-dark-mode .quick-edit .np-taxonomies,.np-dark-mode .quick-edit .np-taxonomy li{background:0 0}.nestedpages.np-dark-mode .nestedpages-bulk-edit,.np-dark-mode .nestedpages-bulk-edit{background-color:#32373c;border:0}.nestedpages.np-dark-mode .nestedpages-bulk-edit .np-bulk-titles,.np-dark-mode .nestedpages-bulk-edit .np-bulk-titles{background-color:rgba(0,0,0,.15);border:0}.nestedpages.np-dark-mode .nestedpages-bulk-edit .np-bulk-titles .np-remove,.np-dark-mode .nestedpages-bulk-edit .np-bulk-titles .np-remove{background-color:#50626f}.nestedpages.np-dark-mode .nestedpages-bulk-edit .np-bulk-footer,.np-dark-mode .nestedpages-bulk-edit .np-bulk-footer{background-color:rgba(0,0,0,.15)}.nestedpages.np-dark-mode .np-quickedit-error,.np-dark-mode .np-quickedit-error{background-color:#e14d43;color:#fff}.np-modal-form.np-dark-mode .form-interior{background:0 0}.nestedpages-modal-content.np-dark-mode,.nestedpages-modal-content.np-dark-mode .modal-content{background-color:#32373c}.nestedpages-modal-content.np-dark-mode .new-child h3,.nestedpages-modal-content.np-dark-mode h3{color:#fff}.nestedpages-modal-content.np-dark-mode .modal-footer{background-color:rgba(0,0,0,.15)}.nestedpages-modal-content.np-dark-mode .clone-modal h3{background:0 0}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection{background-color:#32373c;border:0}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li{border:1px solid #32373c;border-top:0}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li a{background-color:#50626f;color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li a:after{color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li a:active,.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li a:focus{-webkit-box-shadow:none;box-shadow:none}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li:first-child{border-top:0}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li ul{padding:0;background:0 0}.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li ul li{border-color:#32373c}.nestedpages-modal-content.np-dark-mode .np-menu-search,.nestedpages-modal-content.np-dark-mode .np-menu-type-selection ul li ul li a{background-color:rgba(0,0,0,.15)}.nestedpages-modal-content.np-dark-mode .np-menu-search input[type=text]::-webkit-input-placeholder{color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-search input[type=text]::-moz-placeholder{color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-search input[type=text]:-ms-input-placeholder{color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-search input[type=text]::-ms-input-placeholder{color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-search input[type=text]::placeholder{color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-link-details h3 em{color:#fff}.nestedpages-modal-content.np-dark-mode .np-menu-link-details .original-link{border:0;background-color:rgba(0,0,0,.15)}.nestedpages-modal-content.np-dark-mode .np-menu-link-details .fields{background:0 0;padding:0}
assets/js/lib/nestedpages.bulk-actions.js CHANGED
@@ -14,11 +14,6 @@ NestedPages.BulkActions = function()
14
  plugin.selectedLinks = [];
15
  plugin.selectedPosts = []; // array
16
 
17
- plugin.init = function()
18
- {
19
- plugin.bindEvents();
20
- }
21
-
22
  plugin.bindEvents = function()
23
  {
24
  $(document).on('change', NestedPages.selectors.bulkActionsCheckbox, function(){
@@ -223,5 +218,5 @@ NestedPages.BulkActions = function()
223
  });
224
  }
225
 
226
- return plugin.init();
227
  }
14
  plugin.selectedLinks = [];
15
  plugin.selectedPosts = []; // array
16
 
 
 
 
 
 
17
  plugin.bindEvents = function()
18
  {
19
  $(document).on('change', NestedPages.selectors.bulkActionsCheckbox, function(){
218
  });
219
  }
220
 
221
+ return plugin.bindEvents();
222
  }
assets/js/nestedpages.js CHANGED
@@ -1,3736 +1 @@
1
- var NestedPages = NestedPages || {};
2
-
3
- /**
4
- * Formatting updates
5
- * @package Nested Pages
6
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
7
- */
8
- NestedPages.Formatter = function()
9
- {
10
-
11
- var plugin = this;
12
- var $ = jQuery;
13
-
14
-
15
- // Update the Submenu Toggle Button State based on if the child menu is visible
16
- plugin.updateSubMenuToggle = function()
17
- {
18
- var allButtons = $(NestedPages.selectors.childToggle);
19
- for ( var i = 0; i < allButtons.length; i++ ){
20
- var button = allButtons[i];
21
- var row = $(button).parent('.row').parent('li');
22
- if ( $(row).children('ol').length > 0 ){ // Row has a child menu
23
-
24
- // Hide the toggle and child list if all items are in the trash
25
- if ( $(row).children('ol').find('li.page-row').length < 1 ){
26
- $(row).children('ol').hide();
27
- continue;
28
- }
29
-
30
- var open = ( $(row).children('ol:visible').length > 0 ) ? true : false;
31
- var html = '<div class="child-toggle-spacer"></div>';
32
- html += '<a href="#"';
33
- if ( open ) html += ' class="open"';
34
- html += '><span class="np-icon-arrow"></span></a>';
35
- $(button).html(html);
36
-
37
- if ( ($(row).children('ol').children('.np-hide').length > 0) && ($(row).children('ol').children('.np-hide.shown').length === 0) ){
38
- $(button).find('a').hide();
39
- } else if ( ($(row).children('ol').children('.np-hide').length > 0) && ($(row).children('ol').children('.np-hide.shown').length > 0) ){
40
- $(button).find('a').show();
41
- }
42
-
43
- continue;
44
- }
45
- $(button).empty().html('<div class="child-toggle-spacer"></div>'); // No Child Menu
46
- }
47
- }
48
-
49
-
50
- // Fix :visible :first css limitation when toggling various options
51
- plugin.setBorders = function()
52
- {
53
- $(NestedPages.selectors.rows).removeClass(NestedPages.cssClasses.noborder);
54
- $.each($(NestedPages.selectors.lists), function(){
55
- $(this).find('.page-row:visible:first').addClass(NestedPages.cssClasses.noborder);
56
- });
57
- }
58
-
59
-
60
- // Adjust nested margins based on how deep the list is nested
61
- plugin.setNestedMargins = function()
62
- {
63
- plugin.setIndent();
64
- }
65
-
66
- plugin.setIndent = function()
67
- {
68
- var amount = ( nestedpages.non_indent === '1' ) ? 20 : 30;
69
- var indent_element = ( nestedpages.non_indent === '1' ) ? '.row-inner' : '.child-toggle';
70
- $.each($(NestedPages.selectors.lists), function(i, v){
71
- var parent_count = $(this).parents(NestedPages.selectors.lists).length;
72
- var padding = 0;
73
- if ( !NestedPages.jsData.sortable ) padding = 10;
74
- if ( parent_count > 0 ){
75
- var padding = ( parent_count * amount ) + padding;
76
- $(this).find(indent_element).css('padding-left', padding + 'px');
77
- return;
78
- }
79
- if ( !NestedPages.jsData.sortable || $(this).hasClass('no-sort') ){
80
- $(this).find('.row-inner').css('padding-left', '10px');
81
- return;
82
- }
83
- $(this).find('.row-inner').css('padding-left', '0px');
84
- });
85
- }
86
-
87
- plugin.setClassicIndent = function()
88
- {
89
- $.each($(NestedPages.selectors.lists), function(i, v){
90
- var parent_count = $(this).parents(NestedPages.selectors.lists).length;
91
- var padding = 0;
92
- if ( !NestedPages.jsData.sortable ) padding = 10;
93
- if ( parent_count > 0 ){
94
- var padding = ( parent_count * 20 ) + padding;
95
- $(this).find('.row-inner').css('padding-left', padding + 'px');
96
- return;
97
- }
98
- if ( !NestedPages.jsData.sortable || $(this).hasClass('no-sort') ){
99
- $(this).find('.row-inner').css('padding-left', '10px');
100
- return;
101
- }
102
- $(this).find('.row-inner').css('padding-left', '0px');
103
- });
104
- }
105
-
106
-
107
- // Update the width of the placeholder ( width changes depending on level of nesting )
108
- plugin.updatePlaceholderWidth = function(ui)
109
- {
110
- if ( NestedPages.jsData.nestable ){
111
- var parentCount = $(ui.placeholder).parents('ol').length;
112
- var listWidth = $(NestedPages.selectors.sortable).width();
113
- var offset = ( parentCount * 40 ) - 40;
114
- var newWidth = listWidth - offset;
115
- $(ui.placeholder).width(newWidth).css('margin-left', offset + 'px');
116
- }
117
- plugin.updateListVisibility(ui);
118
- }
119
-
120
-
121
- // Update the list visibility on sort (prevent lists from collapsing when nesting)
122
- plugin.updateListVisibility = function(ui)
123
- {
124
- var parentList = $(ui.placeholder).parent('ol');
125
- if ( !$(parentList).is(':visible') ){
126
- $(parentList).addClass('nplist');
127
- $(parentList).show();
128
- }
129
- }
130
-
131
-
132
- // Remove the Quick Edit Overlay
133
- plugin.removeQuickEdit = function()
134
- {
135
- $(NestedPages.selectors.quickEditOverlay).removeClass('active').remove();
136
- $('.sortable .quick-edit').remove();
137
- $('.row').show();
138
- }
139
-
140
-
141
- // Show the Quick Edit Overlay
142
- plugin.showQuickEdit = function()
143
- {
144
- $('body').append('<div class="np-inline-overlay"></div>');
145
- setTimeout(function(){
146
- $('.np-inline-overlay').addClass('active');
147
- }, 50);
148
- }
149
-
150
-
151
- // Flash an updated row
152
- plugin.flashRow = function(row)
153
- {
154
- $(row).addClass('np-updated');
155
- plugin.setBorders();
156
- setTimeout(function(){
157
- $(row).addClass('np-updated-show');
158
- }, 1500);
159
- }
160
-
161
-
162
- // Show an error message
163
- plugin.showAjaxError = function(message)
164
- {
165
- $(NestedPages.selectors.ajaxError).find('p').text(message);
166
- $(NestedPages.selectors.ajaxError).show();
167
- }
168
-
169
-
170
- // Hide the error message
171
- plugin.hideAjaxError = function(message)
172
- {
173
- $(NestedPages.selectors.ajaxError).hide();
174
- }
175
-
176
-
177
- // Size the link thumbnails to the same as the page/post thumbnails
178
- plugin.sizeLinkThumbnails = function()
179
- {
180
- var thumbnail = $(NestedPages.selectors.thumbnailContainer).not(NestedPages.selectors.thumbnailContainerLink).first().find('img');
181
- var width = $(thumbnail).width();
182
- var height = $(thumbnail).height();
183
- $.each($(NestedPages.selectors.thumbnailContainerLink), function(){
184
- $(this).width(width);
185
- $(this).height(height);
186
- });
187
- }
188
-
189
- }
190
- var NestedPages = NestedPages || {};
191
- /**
192
- * Dropdowns
193
- *
194
- * @author Kyle Phillips
195
- *
196
- * To use, wrap dropdown content and toggle link/button in an element with data attribute of data-dropdown
197
- * Give content data attribute of data-dropdown-content and toggle element data attribute of data-dropdown-toggle
198
- * For CSS, wrapping/parent element gets class of "dropdown", content gets class of "dropdown-content"
199
- */
200
- NestedPages.Dropdowns = function()
201
- {
202
- var self = this;
203
- var $ = jQuery;
204
-
205
- self.dropdown = ''; // The Active Dropdown
206
- self.activeBtn = ''; // The Active Button
207
- self.activeContent = ''; // The Active Dropdown Content
208
- self.toggleBtn = '[data-dropdown-toggle]';
209
- self.dropdownContainer = '[data-dropdown]';
210
- self.dropdownContent = '[data-dropdown-content]'
211
-
212
- self.selectors = {
213
- caret_up : 'icon-arrow_drop_up',
214
- caret_down : 'icon-arrow_drop_down'
215
- }
216
-
217
- self.bindEvents = function()
218
- {
219
- $(document).on('click', self.toggleBtn, function(e){
220
- e.preventDefault();
221
- self.activeBtn = $(this);
222
- self.dropdown = $(this).parents(self.dropdownContainer);
223
- self.toggleDropdown();
224
- });
225
- $(document).on('click', function(e){
226
- self.closeDropdowns(e.target);
227
- });
228
- $(document).on('dropdown-opened', function(e, content){
229
- if ( $(content).parents(NestedPages.selectors.row).length > 0 ){
230
- $(content).parents(NestedPages.selectors.row).addClass('active');
231
- }
232
- });
233
- $(document).on('dropdown-closed', function(){
234
- $(NestedPages.selectors.row).removeClass('active');
235
- });
236
- }
237
-
238
- self.toggleDropdown = function()
239
- {
240
- $('.' + self.selectors.caret_up).attr('class', self.selectors.caret_down);
241
- var content = $(self.dropdown).find(self.dropdownContent);
242
- self.activeContent = content;
243
- if ( $(content).hasClass('active') ){
244
- $(content).removeClass('active');
245
- $(self.activeBtn).removeClass('active');
246
- $(self.activeBtn).find('.' + self.selectors.caret_up).attr('class', self.selectors.caret_down);
247
- $(document).trigger('dropdown-closed', content);
248
- return;
249
- }
250
- self.setPositioning();
251
- $(self.toggleBtn).removeClass('active');
252
- $(self.dropdownContent).removeClass('active');
253
- $(content).addClass('active');
254
- $(self.activeBtn).find('.' + self.selectors.caret_down).attr('class', self.selectors.caret_up);
255
- $(self.activeBtn).addClass('active');
256
- $(document).trigger('dropdown-opened', content);
257
- }
258
-
259
-
260
- self.setPositioning = function()
261
- {
262
- var buttonHeight = $(self.activeBtn).outerHeight();
263
- $(self.activeContent).css('top', buttonHeight + 'px');
264
- }
265
-
266
- self.closeDropdowns = function(target)
267
- {
268
- if ( $(target).parents(self.dropdownContainer).length === 0 ){
269
- $(self.dropdownContent).removeClass('active');
270
- $(self.toggleBtn).removeClass('active');
271
- $(self.activeBtn).find('.' + self.selectors.caret_up).attr('class', self.selectors.caret_down);
272
- var content;
273
- $(document).trigger('dropdown-closed', content);
274
- }
275
- }
276
-
277
- return self.bindEvents();
278
- }
279
- var NestedPages = NestedPages || {};
280
- /**
281
- * Modal Windows
282
- *
283
- * @author Kyle Phillips
284
- *
285
- * To use, include a modal backdrop and modal content window with the appropriate data-attributes
286
- * The data attributes should match the value of the toggle buttons data-modal-toggle attribute
287
- */
288
- NestedPages.Modals = function()
289
- {
290
- var self = this;
291
- var $ = jQuery;
292
-
293
- self.activeBtn = '';
294
- self.activeModal = '';
295
- self.modalOpen = false;
296
-
297
- self.selectors = {
298
- toggleBtn : '[data-nestedpages-modal-toggle]',
299
- backdrop : '[data-nestedpages-modal-backdrop]',
300
- closeBtn : '[data-nestedpages-modal-close]',
301
- title : 'data-nestedpages-modal-title',
302
- content : 'data-nestedpages-modal-content'
303
- }
304
-
305
- self.bindEvents = function()
306
- {
307
- $(document).on('click', self.selectors.toggleBtn, function(e){
308
- e.preventDefault();
309
- self.activeBtn = $(this);
310
- self.openModal();
311
- });
312
- $(document).on('click', self.selectors.closeBtn, function(e){
313
- e.preventDefault();
314
- self.closeModals();
315
- });
316
- $(document).on('open-modal-manual', function(e, modal){
317
- self.activeModal = $('[data-nestedpages-modal="' + modal + '"]');
318
- self.openModal();
319
- });
320
- $(document).on('close-modal-manual', function(e){
321
- self.closeModals();
322
- });
323
- $(document).on('click', self.selectors.backdrop, function(e){
324
- self.closeModals();
325
- });
326
- $(document).ready(function(){
327
- self.checkHash();
328
- });
329
- }
330
-
331
- /**
332
- * Open the Modal Window
333
- */
334
- self.openModal = function()
335
- {
336
- if ( self.modalOpen ){
337
- self.closeModals();
338
- return;
339
- }
340
- if ( $(self.activeBtn).length > 0 ){
341
- var modal = $(self.activeBtn).attr('data-nestedpages-modal-toggle');
342
- self.activeModal = $('*[data-nestedpages-modal="' + modal + '"]');
343
- }
344
- $(self.activeModal).addClass('active');
345
- self.modalOpen = true;
346
- self.populateModal();
347
- $(document).trigger('open-modal', [self.activeBtn, self.activeModal]);
348
- }
349
-
350
- /**
351
- * Close the Modal Window
352
- */
353
- self.closeModals = function()
354
- {
355
- self.modalOpen = false;
356
- $('[data-nestedpages-modal]').removeClass('active');
357
- self.activeModal = '';
358
- self.activeBtn = '';
359
- }
360
-
361
- /**
362
- * Populate the Modal if needed
363
- */
364
- self.populateModal = function()
365
- {
366
- var title = $(self.activeBtn).attr(self.selectors.title);
367
- if ( typeof title !== 'undefined' && title !== '' ){
368
- $(self.activeModal).find('[data-nestedpages-modal-title]').text(title);
369
- }
370
- var content = $(self.activeBtn).attr(self.selectors.content);
371
- if ( typeof content !== 'undefined' && content !== '' ){
372
- $(self.activeModal).find('[data-nestedpages-modal-content]').html(content);
373
- }
374
- }
375
-
376
- /**
377
- * Check for Hash
378
- */
379
- self.checkHash = function()
380
- {
381
- if ( !window.location.hash ) return;
382
- var hashType = window.location.hash.substring(0, 6);
383
- if ( hashType !== '#modal' ) return;
384
-
385
- var modalId = window.location.hash.substring(7);
386
- self.activeModal = $('*[data-nestedpages-modal="' + modalId + '"]');
387
- self.openModal();
388
- }
389
-
390
- return self.bindEvents();
391
- }
392
- var NestedPages = NestedPages || {};
393
-
394
- /**
395
- * Check All functionality for Nested Pages
396
- * @package Nested Pages
397
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
398
- */
399
- NestedPages.CheckAll = function()
400
- {
401
- var plugin = this;
402
- var $ = jQuery;
403
-
404
- plugin.activeCheckbox = "";
405
-
406
- plugin.selectors = {
407
- checkbox : '[data-np-check-all]',
408
- }
409
-
410
- plugin.bindEvents = function()
411
- {
412
- $(document).on('change', plugin.selectors.checkbox, function(){
413
- plugin.activeCheckbox = $(this);
414
- plugin.toggleCheckboxes();
415
- });
416
- $(document).on('change', 'input[type=checkbox]', function(){
417
- plugin.checkAllStatus($(this));
418
- });
419
- }
420
-
421
- plugin.init = function()
422
- {
423
- plugin.bindEvents();
424
- }
425
-
426
- plugin.toggleCheckboxes = function()
427
- {
428
- var checked = ( $(plugin.activeCheckbox).is(':checked') ) ? true : false;
429
- var name = $(plugin.activeCheckbox).attr('data-np-check-all');
430
-
431
- var checkboxes = $('*[name="' + name + '"]');
432
- $.each(checkboxes, function(){
433
- var row = $(this).parents(NestedPages.selectors.rows);
434
- $(this).prop('checked', checked);
435
- // Uncheck any hidden checkboxes
436
- if ( $(row).hasClass('np-hide') && !$(row).is(':visible') ) {
437
- $(row).find(NestedPages.selectors.bulkActionsCheckbox).prop('checked', false)
438
- };
439
- });
440
-
441
- plugin.toggleCheckAll();
442
- }
443
-
444
- /**
445
- * Toggle the "Partial" class for the checkall checkbox
446
- */
447
- plugin.toggleCheckAll = function()
448
- {
449
- var name = $(plugin.activeCheckbox).attr('data-np-check-all');
450
-
451
- var checkboxes_total = $('*[name="' + name + '"]').length;
452
- var hidden_checkboxes = $('.np-hide').find(NestedPages.selectors.bulkActionsCheckbox).length;
453
- var hidden_checkboxes_visible = $('.np-hide:visible').find(NestedPages.selectors.bulkActionsCheckbox).length;
454
-
455
- checkboxes_total = ( checkboxes_total - hidden_checkboxes ) + hidden_checkboxes_visible;
456
-
457
- var checkboxes_checked = $('*[name="' + name + '"]:checked').length;
458
-
459
- if ( checkboxes_total == checkboxes_checked ){
460
- $(plugin.activeCheckbox).prop('checked', true);
461
- $(plugin.activeCheckbox).removeClass('check-all-partial');
462
- return;
463
- }
464
- if ( checkboxes_checked > 0 ){
465
- $(plugin.activeCheckbox).addClass('check-all-partial');
466
- return;
467
- }
468
- $(plugin.activeCheckbox).attr('checked', false);
469
- $(plugin.activeCheckbox).removeClass('check-all-partial');
470
- }
471
-
472
- plugin.checkAllStatus = function(checkbox)
473
- {
474
- var name = $(checkbox).attr('name');
475
- var toggleAllCheckbox = $('*[data-np-check-all="' + name + '"]');
476
- if ( toggleAllCheckbox.length === 0 ) return;
477
- plugin.activeCheckbox = $(toggleAllCheckbox)[0];
478
- plugin.toggleCheckAll();
479
- }
480
-
481
- return plugin.init();
482
- }
483
- var NestedPages = NestedPages || {};
484
-
485
- /**
486
- * Bulk Actions for Nested View
487
- * @package Nested Pages
488
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
489
- */
490
- NestedPages.BulkActions = function()
491
- {
492
- var plugin = this;
493
- var $ = jQuery;
494
-
495
- plugin.selectedNumber = 0;
496
- plugin.selectedLinks = [];
497
- plugin.selectedPosts = []; // array
498
-
499
- plugin.init = function()
500
- {
501
- plugin.bindEvents();
502
- }
503
-
504
- plugin.bindEvents = function()
505
- {
506
- $(document).on('change', NestedPages.selectors.bulkActionsCheckbox, function(){
507
- plugin.toggleBulkForm();
508
- });
509
- $(document).on('submit', NestedPages.selectors.bulkActionsForm, function(e){
510
- if ( $('select[name=np_bulk_action]').val() === 'edit' ){
511
- e.preventDefault();
512
- plugin.toggleBulkEdit(true);
513
- }
514
- });
515
- $(document).on('click', NestedPages.selectors.bulkEditRemoveItem, function(e){
516
- e.preventDefault();
517
- var id = $(this).siblings('input[type=hidden]').val();
518
- plugin.uncheckBulkItem(id);
519
- });
520
- $(document).on('click', NestedPages.selectors.bulkEditCancel, function(e){
521
- e.preventDefault();
522
- plugin.uncheckAllBulkItems();
523
- });
524
- }
525
-
526
- /**
527
- * Toggle the Bulk Actions Form & Populate the Hidden ID Fields for posts and redirects
528
- */
529
- plugin.toggleBulkForm = function()
530
- {
531
- var checked = false;
532
- var checked_ids = '';
533
- var checked_redirect_ids = '';
534
- plugin.selectedPosts = [];
535
- plugin.selectedLinks = [];
536
- $.each($(NestedPages.selectors.bulkActionsCheckbox), function(){
537
- if ( $(this).is(':checked') ) {
538
- var row = $(this).parents(NestedPages.selectors.rows);
539
- checked = true;
540
- if ( !$(this).parent('div').hasClass('np-check-all') && !$(row).hasClass('post-type-np-redirect') ) checked_ids += $(this).val() + ',';
541
- if ( $(row).hasClass('post-type-np-redirect') ) {
542
- checked_redirect_ids += $(this).val() + ',';
543
- plugin.selectedLinks.push($(this).val());
544
- }
545
- if ( $(this).attr('data-np-post-type') !== 'np-redirect' && !$(this).parent('div').hasClass('np-check-all') ){
546
- var post = [];
547
- post['title'] = $(this).attr('data-np-bulk-checkbox');
548
- post['id'] = $(this).val();
549
- plugin.selectedPosts.push(post);
550
- }
551
- }
552
- });
553
- plugin.setBulkEditPosts();
554
- plugin.toggleEditOption();
555
- plugin.toggleLinkCountAlert();
556
- if ( checked ){
557
- $(NestedPages.selectors.bulkActionsForm).show();
558
- $(NestedPages.selectors.bulkActionsIds).val(checked_ids);
559
- $(NestedPages.selectors.bulkActionRedirectIds).val(checked_redirect_ids);
560
- plugin.setSelectedNumber();
561
- return;
562
- }
563
- $(NestedPages.selectors.bulkActionsIds).val('');
564
- $(NestedPages.selectors.bulkActionsForm).hide();
565
- }
566
-
567
- /**
568
- * Set the Posts for Bulk Edit
569
- */
570
- plugin.setBulkEditPosts = function()
571
- {
572
- var html = '';
573
- for ( var i = 0; i < plugin.selectedPosts.length; i++ ){
574
- html += '<li><a href="#" class="np-remove" data-np-remove-bulk-item>&times;</a>';
575
- html += plugin.selectedPosts[i].title;
576
- html += '<input type="hidden" name="post_ids[]" value="' + plugin.selectedPosts[i].id + '"></li>';
577
- }
578
- $(NestedPages.selectors.bulkEditTitles).html(html);
579
- }
580
-
581
- /**
582
- * Uncheck a bulk item
583
- */
584
- plugin.uncheckBulkItem = function(id)
585
- {
586
- $.each($(NestedPages.selectors.bulkActionsCheckbox), function(){
587
- if ( $(this).val() == id ) {
588
- $(this).prop('checked', false).change();
589
- }
590
- });
591
- // Hide the form if all posts are removed
592
- if ( $(NestedPages.selectors.bulkEditRemoveItem).length === 0 ){
593
- plugin.toggleBulkEdit(false);
594
- }
595
- }
596
-
597
- /**
598
- * Uncheck all bulk items
599
- */
600
- plugin.uncheckAllBulkItems = function()
601
- {
602
- $.each($(NestedPages.selectors.bulkActionsCheckbox), function(){
603
- $(this).prop('checked', false).change();
604
- });
605
- plugin.toggleBulkEdit(false);
606
- }
607
-
608
- /**
609
- * Set the number of total selected
610
- */
611
- plugin.setSelectedNumber = function()
612
- {
613
- var checkedLength = $(NestedPages.selectors.bulkActionsCheckbox + ':checked').not('.np-check-all input').length;
614
- var option = $(NestedPages.selectors.bulkActionsForm).find('select option').first();
615
- $(option).text(nestedpages.bulk_actions + ' (' + checkedLength + ')');
616
- }
617
-
618
- /**
619
- * Toggle the edit option to disabled if no post checkboxes are checked
620
- * Prevents opening the bulk edit form with only np-redirects checked
621
- */
622
- plugin.toggleEditOption = function()
623
- {
624
- var checkedLength = $(NestedPages.selectors.bulkActionsCheckbox + ':checked').not('.np-check-all input').not('.np-redirect-bulk').length;
625
- var option = $(NestedPages.selectors.bulkActionsForm).find('select option[value=edit]');
626
- if ( checkedLength === 0 ){
627
- $(option).prop('disabled', true);
628
- $(NestedPages.selectors.bulkActionsForm).find('select option').first().prop('selected', true);
629
- plugin.toggleBulkEdit(false);
630
- return;
631
- }
632
- $(option).prop('disabled', false);
633
- }
634
-
635
- /**
636
- * Toggle the bulk edit form
637
- */
638
- plugin.toggleBulkEdit = function(visible)
639
- {
640
- plugin.toggleLinkCountAlert();
641
- if ( visible ){
642
- plugin.disableParentOptions();
643
- $(NestedPages.selectors.bulkEditForm).show();
644
- $(NestedPages.selectors.bulkActionsForm).hide();
645
- plugin.setWPSuggest();
646
- return;
647
- }
648
- $(NestedPages.selectors.bulkEditForm).hide();
649
- $(NestedPages.selectors.bulkActionsForm).show();
650
- $(NestedPages.selectors.bulkEditLinkCount).parent('div').hide();
651
- $(NestedPages.selectors.bulkActionsForm).find('select option').first().text(nestedpages.bulk_actions);
652
- plugin.resetBulkEditFields();
653
- }
654
-
655
- /**
656
- * Toggle the bulk edit link count alert
657
- */
658
- plugin.toggleLinkCountAlert = function()
659
- {
660
- var selectedLinkCount = plugin.selectedLinks.length;
661
- if ( selectedLinkCount === 0 ) {
662
- $(NestedPages.selectors.bulkEditLinkCount).parent('div').hide();
663
- return;
664
- }
665
- $(NestedPages.selectors.bulkEditLinkCount).parent('div').show();
666
- }
667
-
668
- /**
669
- * Set parent options to disabled for selected posts
670
- */
671
- plugin.disableParentOptions = function()
672
- {
673
- var selectElement = $(NestedPages.selectors.bulkEditForm).find('select[name=post_parent]');
674
- for ( var i = 0; i < plugin.selectedPosts.length; i++ )
675
- {
676
- $(selectElement).find('option[value=' + plugin.selectedPosts[i].id + ']').attr('disabled', true);
677
- }
678
- }
679
-
680
- /**
681
- * Initialize WP Auto Suggest on Flat Taxonomy fields
682
- */
683
- plugin.setWPSuggest = function()
684
- {
685
- var tagfields = $(NestedPages.selectors.bulkEditForm).find('[data-autotag]');
686
- $.each(tagfields, function(i, v){
687
- var taxonomy = $(this).attr('data-taxonomy');
688
- $(this).suggest(ajaxurl + '?action=ajax-tag-search&tax=' + taxonomy , {multiple:true, multipleSep: ","});
689
- });
690
- }
691
-
692
- /**
693
- * Clear out the bulk edit fields
694
- */
695
- plugin.resetBulkEditFields = function()
696
- {
697
- var selectFields = $(NestedPages.selectors.bulkEditForm).find('select');
698
- $.each(selectFields, function(){
699
- $(this).find('option').first().prop('selected', true);
700
- $(this).find('option').removeAttr('disabled');
701
- });
702
- var categoryChecklists = $(NestedPages.selectors.bulkEditForm).find('.cat-checklist');
703
- $.each(categoryChecklists, function(){
704
- $(this).find('input[type=checkbox]').prop('checked', false);
705
- });
706
- }
707
-
708
- return plugin.init();
709
- }
710
- var NestedPages = NestedPages || {};
711
-
712
- /**
713
- * The Hidden Item Count for selected items in the Nested View
714
- * @package Nested Pages
715
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
716
- */
717
- NestedPages.HiddenItemCount = function()
718
- {
719
- var plugin = this;
720
- var $ = jQuery;
721
-
722
- plugin.init = function()
723
- {
724
- plugin.bindEvents();
725
- }
726
-
727
- plugin.bindEvents = function()
728
- {
729
- $(document).on('change', NestedPages.selectors.bulkActionsCheckbox, function(){
730
- plugin.toggleHiddenCount();
731
- });
732
- $(document).on('click', NestedPages.selectors.toggleAll, function(){
733
- plugin.toggleHiddenCount();
734
- });
735
- $(document).on('click', NestedPages.selectors.pageToggle, function(){
736
- plugin.toggleHiddenCount();
737
- });
738
- }
739
-
740
- /**
741
- * Toggle the Hidden Count
742
- */
743
- plugin.toggleHiddenCount = function()
744
- {
745
- var hiddenCount = 0;
746
- $.each($(NestedPages.selectors.bulkActionsCheckbox), function(){
747
- if ( $(this).is(':checked') ) {
748
- if ( $(this).parent('div').hasClass('np-check-all') ) return;
749
- var row = $(this).closest('.page-row');
750
- if ( !$(row).is(':visible') ) hiddenCount++;
751
- }
752
- });
753
- if ( hiddenCount < 1 ){
754
- $(NestedPages.selectors.hiddenItemCountParent).hide();
755
- return;
756
- }
757
- $(NestedPages.selectors.hiddenItemCount).text(hiddenCount);
758
- $(NestedPages.selectors.hiddenItemCountParent).show();
759
- }
760
-
761
- return plugin.init();
762
- }
763
- var NestedPages = NestedPages || {};
764
-
765
- /**
766
- * Toggles Menu Elements
767
- * @package Nested Pages
768
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
769
- */
770
- NestedPages.MenuToggle = function()
771
- {
772
- var plugin = this;
773
- var $ = jQuery;
774
-
775
- plugin.formatter = new NestedPages.Formatter;
776
-
777
- plugin.bindEvents = function()
778
- {
779
- $(document).on('click', NestedPages.selectors.childToggleLink, function(e){
780
- e.preventDefault();
781
- plugin.toggleSingleMenu($(this));
782
- });
783
- $(document).on('click', NestedPages.selectors.toggleAll, function(e){
784
- e.preventDefault();
785
- plugin.toggleAllMenus();
786
- });
787
- }
788
-
789
-
790
- // Toggle individual submenus
791
- plugin.toggleSingleMenu = function(button)
792
- {
793
- var submenu = $(button).parent(NestedPages.selectors.childToggle).parent(NestedPages.selectors.row).siblings('ol');
794
- $(button).toggleClass('open');
795
- $(submenu).toggle();
796
- plugin.formatter.setBorders();
797
- plugin.formatter.setNestedMargins();
798
- plugin.syncUserToggles();
799
- }
800
-
801
-
802
- // Toggle All Submenus
803
- plugin.toggleAllMenus = function()
804
- {
805
- var button = NestedPages.selectors.toggleAll;
806
- if ( $(button).attr('data-toggle') === 'closed' ){
807
- $(NestedPages.selectors.lists).show();
808
- $(button).attr('data-toggle', 'opened').text(NestedPages.jsData.collapseText);
809
- $(NestedPages.selectors.childToggle + ' a').addClass('open');
810
- plugin.formatter.setBorders();
811
- plugin.syncUserToggles();
812
- return;
813
- }
814
-
815
- $(NestedPages.selectors.lists).not($(NestedPages.selectors.lists)[0]).hide();
816
- $(button).attr('data-toggle', 'closed').text(NestedPages.jsData.expandText);
817
- $(NestedPages.selectors.childToggle + ' a').removeClass('open');
818
- plugin.formatter.setBorders();
819
- plugin.syncUserToggles();
820
- }
821
-
822
-
823
- // Get an array of visible rows
824
- plugin.visibleRowIDs = function()
825
- {
826
- var visible_ids = [];
827
- var visible = $(NestedPages.selectors.rows + ':visible');
828
- $.each(visible, function(i, v){
829
- var id = $(this).attr('id');
830
- visible_ids.push(id.replace("menuItem_", ""));
831
- });
832
- return visible_ids;
833
- }
834
-
835
-
836
- // Save the user's toggled menus
837
- plugin.syncUserToggles = function()
838
- {
839
- $.ajax({
840
- url: NestedPages.jsData.ajaxurl,
841
- type: 'post',
842
- datatype: 'json',
843
- data: {
844
- action : NestedPages.formActions.syncToggles,
845
- nonce : NestedPages.jsData.nonce,
846
- ids : plugin.visibleRowIDs(),
847
- posttype : NestedPages.jsData.posttype
848
- },
849
- success: function(data){
850
- if ( data.status !== 'success' ){
851
- console.log('There was an error saving toggled pages.');
852
- }
853
- }
854
- });
855
- }
856
-
857
-
858
- return plugin.bindEvents();
859
- }
860
- var NestedPages = NestedPages || {};
861
-
862
- /**
863
- * Toggle Page Rows
864
- * @package Nested Pages
865
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
866
- */
867
- NestedPages.PageToggle = function()
868
- {
869
- var plugin = this;
870
- var $ = jQuery;
871
-
872
- plugin.activeButton = '';
873
-
874
- plugin.formatter = new NestedPages.Formatter;
875
-
876
- plugin.init = function()
877
- {
878
- plugin.bindEvents();
879
- }
880
-
881
- plugin.bindEvents = function()
882
- {
883
- $(document).on('click', NestedPages.selectors.toggleHidden, function(e){
884
- e.preventDefault();
885
- plugin.activeButton = $(this);
886
- plugin.toggleHidden();
887
- });
888
- $(document).on('click', NestedPages.selectors.toggleStatus, function(e){
889
- e.preventDefault();
890
- plugin.toggleStatus($(this));
891
- });
892
- }
893
-
894
-
895
- // Toggle Hidden Pages
896
- plugin.toggleHidden = function()
897
- {
898
- var button = $(plugin.activeButton);
899
- var action = $(button).attr('href');
900
-
901
- if ( action == '#show' ){
902
- $(button).attr('href', '#hide').text(NestedPages.jsData.showHiddenText);
903
- $(NestedPages.selectors.hiddenRows).removeClass('shown').hide();
904
- plugin.formatter.updateSubMenuToggle();
905
- plugin.formatter.setBorders();
906
- return;
907
- }
908
-
909
- if ( action == '#hide' ){
910
- $(button).attr('href', '#show').text(NestedPages.jsData.hideHiddenText);
911
- $(NestedPages.selectors.hiddenRows).addClass('shown').show();
912
- plugin.formatter.updateSubMenuToggle();
913
- plugin.formatter.setBorders();
914
- }
915
- }
916
-
917
-
918
- // Toggle Pages based on status
919
- plugin.toggleStatus = function(button)
920
- {
921
- var target = $(button).attr('href');
922
- target = target.substring(1);
923
- $(NestedPages.selectors.syncCheckbox).attr('disabled', false);
924
- $(NestedPages.selectors.toggleStatus).removeClass('active');
925
- $(button).addClass('active');
926
- if ( target == 'draft' ){
927
- $(NestedPages.selectors.syncCheckbox).attr('disabled', true);
928
- $('.' + target).addClass('nested-visible');
929
- }
930
- if ( target == 'all' ){
931
- $(NestedPages.selectors.rows).show();
932
- return;
933
- }
934
- $(NestedPages.selectors.rows).hide();
935
- $('.' + target).show();
936
- return;
937
- }
938
-
939
-
940
- return plugin.init();
941
-
942
- }
943
- var NestedPages = NestedPages || {};
944
-
945
- /**
946
- * Enables and Saves Nesting
947
- * @package Nested Pages
948
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
949
- */
950
- NestedPages.Nesting = function()
951
- {
952
- var plugin = this;
953
- var $ = jQuery;
954
-
955
- plugin.formatter = new NestedPages.Formatter;
956
-
957
- // Make the Menu sortable
958
- plugin.initializeSortable = function()
959
- {
960
- if ( !NestedPages.jsData.nestable ) return plugin.initializeSortableFlat();
961
-
962
- $(NestedPages.selectors.sortable).not(NestedPages.selectors.notSortable).nestedSortable({
963
- items : NestedPages.selectors.rows,
964
- toleranceElement: '> .row',
965
- handle: NestedPages.selectors.handle,
966
- placeholder: "ui-sortable-placeholder",
967
- tabSize : 56,
968
- isAllowed: function(placeholder, placeholderParent, currentItem){
969
- return ( $(placeholderParent).hasClass('post-type-np-redirect') && !$(currentItem).hasClass('post-type-np-redirect') ) ? false : true;
970
- },
971
- start: function(e, ui){
972
- ui.placeholder.height(ui.item.height());
973
- },
974
- sort: function(e, ui){
975
- plugin.formatter.updatePlaceholderWidth(ui);
976
- },
977
- stop: function(e, ui){
978
- setTimeout(
979
- function(){
980
- plugin.formatter.updateSubMenuToggle();
981
- plugin.formatter.setBorders();
982
- plugin.formatter.setNestedMargins();
983
- }, 100
984
- );
985
- plugin.syncNesting();
986
- },
987
- });
988
- }
989
-
990
- // Initialize Flat Sortable (Non-Hierarchical Post Types)
991
- plugin.initializeSortableFlat = function()
992
- {
993
- var lists = $(NestedPages.selectors.lists).not(NestedPages.selectors.notSortable);
994
- $.each(lists, function(){
995
- $(this).sortable({
996
- items : '>' + NestedPages.selectors.rows,
997
- handle: NestedPages.selectors.handle,
998
- placeholder: "ui-sortable-placeholder",
999
- forcePlaceholderSize: true,
1000
- start: function(e, ui){
1001
- ui.placeholder.height(ui.item.height());
1002
- },
1003
- sort: function(e, ui){
1004
- plugin.formatter.updatePlaceholderWidth(ui);
1005
- },
1006
- stop: function(e, ui){
1007
- setTimeout(
1008
- function(){
1009
- plugin.formatter.updateSubMenuToggle();
1010
- plugin.formatter.setBorders();
1011
- plugin.formatter.setNestedMargins();
1012
- }, 100
1013
- );
1014
- plugin.syncNesting();
1015
- },
1016
- });
1017
- });
1018
- }
1019
-
1020
- // Disable Nesting
1021
- plugin.disableNesting = function()
1022
- {
1023
- $(NestedPages.selectors.sortable).sortable('destroy');
1024
- }
1025
-
1026
-
1027
- // Sync Nesting
1028
- plugin.syncNesting = function(manual, callback)
1029
- {
1030
- var list,
1031
- filtered;
1032
-
1033
- if ( nestedpages.manual_order_sync === '1' && !manual) return;
1034
- $(NestedPages.selectors.errorDiv).hide();
1035
- $(NestedPages.selectors.loadingIndicator).show();
1036
- filtered = ( $(NestedPages.selectors.lists).first().hasClass('filtered') ) ? true : false;
1037
- if ( NestedPages.jsData.nestable && !filtered ){
1038
- list = $(NestedPages.selectors.sortable).nestedSortable('toHierarchy', {startDepthCount: 0});
1039
- } else {
1040
- list = plugin.setNestingArray();
1041
- }
1042
- plugin.disableNesting();
1043
-
1044
- var syncmenu = NestedPages.jsData.syncmenu;
1045
- if ( nestedpages.manual_menu_sync === '1' ) syncmenu = 'nosync';
1046
-
1047
- $.ajax({
1048
- url: ajaxurl,
1049
- type: 'post',
1050
- datatype: 'json',
1051
- data: {
1052
- action : NestedPages.formActions.syncNesting,
1053
- nonce : NestedPages.jsData.nonce,
1054
- list : list,
1055
- post_type : NestedPages.jsData.posttype,
1056
- syncmenu : syncmenu,
1057
- filtered : filtered
1058
- },
1059
- success: function(data, callback){
1060
- plugin.initializeSortable();
1061
- if (data.status === 'error'){
1062
- $(NestedPages.selectors.errorDiv).text(data.message).show();
1063
- $(NestedPages.selectors.loadingIndicator).hide();
1064
- } else {
1065
- if ( callback && typeof callback === 'function') {
1066
- callback();
1067
- return;
1068
- }
1069
- $(NestedPages.selectors.loadingIndicator).hide();
1070
- }
1071
- }
1072
- });
1073
- }
1074
-
1075
- plugin.setNestingArray = function(list)
1076
- {
1077
- ret = [];
1078
- $(NestedPages.selectors.lists).first().children('li.page-row').each(function() {
1079
- var level = plugin.recursiveNesting(this);
1080
- ret.push(level);
1081
- });
1082
- return ret;
1083
- }
1084
-
1085
- plugin.recursiveNesting = function(item) {
1086
- var id = $(item).attr('id');
1087
- var currentItem;
1088
- if (id) {
1089
- id = id.replace('menuItem_', '');
1090
- currentItem = {
1091
- "id": id
1092
- };
1093
- if ($(item).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).length > 0) {
1094
- currentItem.children = [];
1095
- $(item).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).each(function() {
1096
- var level = plugin.recursiveNesting(this);
1097
- currentItem.children.push(level);
1098
- });
1099
- }
1100
- return currentItem;
1101
- }
1102
- }
1103
- }
1104
- var NestedPages = NestedPages || {};
1105
-
1106
- /**
1107
- * Sync the "sync menu" setting
1108
- * @package Nested Pages
1109
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
1110
- */
1111
- NestedPages.SyncMenuSetting = function()
1112
- {
1113
- var plugin = this;
1114
- var $ = jQuery;
1115
-
1116
- plugin.formatter = new NestedPages.Formatter;
1117
-
1118
- plugin.init = function()
1119
- {
1120
- plugin.bindEvents();
1121
- }
1122
-
1123
- plugin.bindEvents = function()
1124
- {
1125
- $(document).ready(function(){ // catches trash updates
1126
- if ( nestedpages.manual_menu_sync === '1' ) return;
1127
- if ( nestedpages.syncmenu === '1' ) plugin.syncSetting();
1128
- });
1129
- $(document).on('change', NestedPages.selectors.syncCheckbox, function(){
1130
- plugin.syncSetting();
1131
- });
1132
- }
1133
-
1134
- // Sync the "Sync menu" preference / setting
1135
- plugin.syncSetting = function()
1136
- {
1137
-
1138
- if ( NestedPages.jsData.posttype !== 'page' ) return;
1139
- if ($(NestedPages.selectors.syncCheckbox).length === 0) return;
1140
-
1141
- NestedPages.jsData.syncmenu = ( $(NestedPages.selectors.syncCheckbox).is(':checked') ) ? 'sync' : 'nosync';
1142
-
1143
- $.ajax({
1144
- url: NestedPages.jsData.ajaxurl,
1145
- type: 'post',
1146
- datatype: 'json',
1147
- data: {
1148
- action : NestedPages.formActions.syncMenu,
1149
- nonce : NestedPages.jsData.nonce,
1150
- post_type : NestedPages.jsData.posttype,
1151
- syncmenu : NestedPages.jsData.syncmenu
1152
- },
1153
- success: function(data){
1154
- if (data.status === 'error'){
1155
- plugin.formatter.showAjaxError(data.message);
1156
- }
1157
- },
1158
- error: function(data){
1159
- console.log(data);
1160
- }
1161
- });
1162
- }
1163
-
1164
- return plugin.bindEvents();
1165
- }
1166
- var NestedPages = NestedPages || {};
1167
-
1168
- /**
1169
- * Add new post(s) - Top level & child
1170
- * @package Nested Pages
1171
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
1172
- */
1173
- NestedPages.NewPost = function()
1174
- {
1175
- var plugin = this;
1176
- var $ = jQuery;
1177
-
1178
- plugin.formatter = new NestedPages.Formatter;
1179
- plugin.parent_id = 0; // Parent ID for the post(s) to add
1180
- plugin.posts = ''; // The newly added posts
1181
- plugin.form = ''; // The active form
1182
-
1183
- plugin.bindEvents = function()
1184
- {
1185
- $(document).on('open-modal', function(e, button, modal){
1186
- var target = $(button).attr('data-nestedpages-modal-toggle');
1187
- if ( typeof target !== 'undefined' && target == 'np-bulk-modal' ){
1188
- plugin.openModal();
1189
- }
1190
- });
1191
- $(document).on('submit', NestedPages.selectors.newPageForm, function(e){
1192
- e.preventDefault();
1193
- });
1194
- $(document).on('click', NestedPages.selectors.newPageSubmitButton, function(e){
1195
- e.preventDefault();
1196
- plugin.submitForm($(this));
1197
- });
1198
- $(document).on('click', NestedPages.selectors.newPageTitle, function(e){
1199
- e.preventDefault();
1200
- plugin.addTitleField($(this));
1201
- });
1202
- $(document).on('click', NestedPages.selectors.newPageRemoveTitle, function(e){
1203
- e.preventDefault();
1204
- plugin.removeTitleField($(this));
1205
- });
1206
- $(document).on('click', NestedPages.selectors.addChildButton, function(e){
1207
- e.preventDefault();
1208
- plugin.openQuickEdit($(this));
1209
- });
1210
- $(document).on('click', NestedPages.selectors.cancelNewChildButton, function(e){
1211
- e.preventDefault();
1212
- plugin.cancelNewPage();
1213
- });
1214
- $(document).on('click', '[' + NestedPages.selectors.newBeforeButton + ']', function(e){
1215
- e.preventDefault();
1216
- plugin.openQuickEdit($(this));
1217
- });
1218
- $(document).on('click', '[' + NestedPages.selectors.newAfterButton + ']', function(e){
1219
- e.preventDefault();
1220
- plugin.openQuickEdit($(this));
1221
- });
1222
- $(document).on('keydown', function(e){
1223
- if ( e.keyCode === 27 ) {
1224
- plugin.cancelNewPage();
1225
- $(document).click(); // Close Dropdown
1226
- }
1227
- });
1228
- }
1229
-
1230
- // Open the form modal
1231
- plugin.openModal = function()
1232
- {
1233
- var newform = $(NestedPages.selectors.newPageFormContainer).clone().find(NestedPages.selectors.newPageForm);
1234
- $(newform).addClass('in-modal');
1235
- $(NestedPages.selectors.newPageModal).find('.modal-body').html(newform);
1236
- $(NestedPages.selectors.newPageModal).find('h3').text(nestedpages.add_multiple);
1237
- $(NestedPages.selectors.newPageModal).find('.page_parent_id').val(plugin.parent_id);
1238
- $(newform).find('.np_title').first().focus();
1239
- $(newform).find(NestedPages.selectors.newPageTitle).first().prop('tabindex', '2');
1240
- }
1241
-
1242
- // Open the new child quick edit
1243
- plugin.openQuickEdit = function(button)
1244
- {
1245
- var before = $(button).attr(NestedPages.selectors.newBeforeButton);
1246
- before = ( typeof before === 'undefined' || before === '' ) ? false : before;
1247
-
1248
- var after = $(button).attr(NestedPages.selectors.newAfterButton);
1249
- after = ( typeof after === 'undefined' || after === '' ) ? false : after;
1250
-
1251
- var parent_li = $(button).closest(NestedPages.selectors.row).parent('li');
1252
- var newform = $(NestedPages.selectors.newPageFormContainer).clone();
1253
-
1254
- // Append the form to the list item
1255
- if ( $(parent_li).children('ol').length > 0 ){
1256
- var child_ol = $(parent_li).children('ol');
1257
- $(newform).insertBefore(child_ol);
1258
- } else {
1259
- $(newform).appendTo(parent_li);
1260
- }
1261
-
1262
-
1263
- $(newform).siblings(NestedPages.selectors.row).hide();
1264
-
1265
- plugin.formatter.showQuickEdit();
1266
-
1267
- $(newform).find('.parent_name').html('<em>Parent:</em> ' + $(button).attr('data-parentname'));
1268
- if ( !before && !after ) $(newform).find('.page_parent_id').val($(button).attr('data-id'));
1269
-
1270
- if ( before ) {
1271
- $(newform).find('.page_before_id').val(before);
1272
- $(newform).find('[data-new-post-relation-title]').text(nestedpages.insert_before + ': ' + $(button).attr('data-parentname'));
1273
- }
1274
- if ( after ) {
1275
- $(newform).find('.page_after_id').val(after);
1276
- $(newform).find('[data-new-post-relation-title]').text(nestedpages.insert_after + ': ' + $(button).attr('data-parentname'));
1277
- }
1278
-
1279
- $(newform).show();
1280
- $(newform).find('.np_title').focus();
1281
- $(newform).find(NestedPages.selectors.newPageTitle).prop('tabindex', '2');
1282
- }
1283
-
1284
- // Close the form modal
1285
- plugin.cancelNewPage = function()
1286
- {
1287
- plugin.formatter.removeQuickEdit();
1288
- $(NestedPages.selectors.newChildError).hide();
1289
- $(NestedPages.selectors.newPageModal).find('.modal-body').empty();
1290
- $(NestedPages.selectors.sortable).find('.new-child').remove();
1291
- $(NestedPages.selectors.row).show();
1292
- }
1293
-
1294
- // Add a page title field to the form
1295
- plugin.addTitleField = function(button)
1296
- {
1297
- var form = $(button).parents('form');
1298
- var fieldcount = $(button).siblings('.new-page-titles').children('li').length + 1;
1299
- var html = '<li><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="handle np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg><div class="form-control new-child-row"><label>' + NestedPages.jsData.titleText + '</label><div><input type="text" name="post_title[]" class="np_title" placeholder="' + NestedPages.jsData.titleText + '" value="" tabindex="' + fieldcount + '" /><a href="#" class="button-secondary np-remove-child">-</a></div></div></li>';
1300
- var container = $(button).siblings('.new-page-titles').append(html);
1301
- $(form).find('.np_title').last().focus();
1302
- $(form).find(NestedPages.selectors.newPageTitle).prop('tabindex', fieldcount++);
1303
- $('.new-page-titles').sortable({
1304
- items : 'li',
1305
- handle: '.handle',
1306
- });
1307
- plugin.toggleAddEditButton(form);
1308
- }
1309
-
1310
- // Remove a page title field
1311
- plugin.removeTitleField = function(button)
1312
- {
1313
- var form = $(button).parents('form');
1314
- $(button).parents('.new-child-row').parent('li').remove();
1315
- plugin.toggleAddEditButton(form);
1316
- }
1317
-
1318
- // Submit the New Page Form
1319
- plugin.submitForm = function(button)
1320
- {
1321
- plugin.toggleLoading(true);
1322
- plugin.form = $(button).parents('form');
1323
-
1324
- var addedit = ( $(button).hasClass('add-edit') ) ? true : false;
1325
- var action = NestedPages.formActions.newPage;
1326
- if ( $(plugin.form).find('.page_before_id').val() !== '' ) action = NestedPages.formActions.newBeforeAfter;
1327
- if ( $(plugin.form).find('.page_after_id').val() !== '' ) action = NestedPages.formActions.newBeforeAfter;
1328
-
1329
- $.ajax({
1330
- url: NestedPages.jsData.ajaxurl,
1331
- type: 'post',
1332
- datatype: 'json',
1333
- data: $(plugin.form).serialize() + '&action=' + action + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
1334
- success: function(data){
1335
- if (data.status === 'error'){
1336
- plugin.toggleLoading(false);
1337
- $(plugin.form).find(NestedPages.selectors.quickEditErrorDiv).text(data.message).show();
1338
- return;
1339
- }
1340
- if ( addedit === true ){ // Redirect to Edit Screen
1341
- var link = data.new_pages[0].edit_link;
1342
- link = link.replace(/&amp;/g, '&');
1343
- window.location.replace(link);
1344
- return;
1345
- }
1346
- plugin.toggleLoading(false);
1347
- plugin.posts = data.new_pages;
1348
- plugin.addPosts();
1349
- },
1350
- error: function(data){
1351
- console.log(data);
1352
- plugin.toggleLoading(false);
1353
- $(plugin.form).find(NestedPages.selectors.quickEditErrorDiv).text('The form could not be saved at this time.').show();
1354
- }
1355
- });
1356
- }
1357
-
1358
- // Add the new posts
1359
- plugin.addPosts = function()
1360
- {
1361
- // Before/After ID if applicable
1362
- var before = $(plugin.form).find('.page_before_id').val();
1363
- before = ( before !== '' ) ? before : false;
1364
- var after = $(plugin.form).find('.page_after_id').val();
1365
- after = ( after !== '' ) ? after : false;
1366
-
1367
- var parent_li = $(plugin.form).parent('.new-child').parent('.page-row');
1368
-
1369
- // If parent li doesn't have a child ol, add one
1370
- if ( $(parent_li).children('ol').length === 0 && !before && !after ){
1371
- $(parent_li).append('<ol class="nplist"></ol>');
1372
- }
1373
-
1374
- if ( $(plugin.form).hasClass('in-modal') ){
1375
- var appendto = $('.nplist.sortable li.page-row:first');
1376
- } else {
1377
- var appendto = $(parent_li).children('ol');
1378
- }
1379
-
1380
- for (i = 0; i < plugin.posts.length; i++){
1381
- plugin.appendRows(appendto, plugin.posts[i], before, after);
1382
- }
1383
-
1384
- // Show the child page list and reset submenu toggles
1385
- if ( !before && !after ){
1386
- $(appendto).show();
1387
- }
1388
-
1389
- plugin.formatter.updateSubMenuToggle();
1390
- plugin.formatter.setNestedMargins();
1391
- plugin.cancelNewPage();
1392
- $(document).trigger('close-modal-manual');
1393
- }
1394
-
1395
- // Append new post rows to the nested view
1396
- plugin.appendRows = function(appendto, post, before, after)
1397
- {
1398
- var html = '<li id="menuItem_' + post.id + '" class="page-row';
1399
- if ( post.status === 'publish' ) html += ' published';
1400
- html += '">';
1401
-
1402
- if ( NestedPages.jsData.hierarchical ){
1403
- html += '<div class="row">';
1404
- html += '<div class="child-toggle"></div>';
1405
- } else {
1406
- html += '<div class="row non-hierarchical">';
1407
- html += '<div class="non-hierarchical-spacer"></div>';
1408
- }
1409
-
1410
- html += '<div class="row-inner">';
1411
- // Submenu
1412
- html += '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="np-icon-sub-menu"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M19 15l-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9l6 6z" class="arrow" /></svg>';
1413
- // Handle
1414
- html += '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="handle np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg>';
1415
- html += '<a href="' + post.edit_link + '" class="page-link page-title">';
1416
- html += '<span class="title">' + post.title + '</span>';
1417
-
1418
- // Status
1419
- if ( post.status !== 'Publish' ){
1420
- html += '<span class="status">(' + post.status + ')</span>';
1421
- } else {
1422
- html += '<span class="status"></span>';
1423
- }
1424
-
1425
- // Nav Status
1426
- html += '<span class="nav-status">';
1427
- if ( post.np_nav_status === 'hide' ){
1428
- html += ' ' + nestedpages.hidden;
1429
- }
1430
- html += '</span>';
1431
-
1432
- html += '<span class="edit-indicator">Edit</span>';
1433
- html += '</a>';
1434
-
1435
- // Non-Hierarchical Data
1436
- if ( !NestedPages.jsData.hierarchical ){
1437
- html += '<div class="np-post-columns">';
1438
- html += '<ul class="np-post-info">';
1439
- html += '<li><span class="np-author-display">' + post.author_formatted + '</span></li>';
1440
- html += '<li>' + post.date_formatted + '</li>';
1441
- html += '</ul>';
1442
- html += '</div>';
1443
- }
1444
-
1445
- // Yoast
1446
- if ( $('.nplist').first().hasClass('has-yoast') ) {
1447
- html += '<span class="np-seo-indicator na"></span>';
1448
- }
1449
-
1450
- // Action Buttons
1451
- html += '<div class="action-buttons">';
1452
- html += '<div class="nestedpages-dropdown" data-dropdown><a href="#" class="np-btn has-icon toggle" data-dropdown-toggle><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></a><ul class="nestedpages-dropdown-content" data-dropdown-content>';
1453
- // Add Link
1454
- html += '<li><a href="#" class="open-redirect-modal" data-parentid="' + post.id + '"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>' + nestedpages.add_link + '</a></li>';
1455
- // Add Child
1456
- html += '<li><a href="#" class="add-new-child" data-id="' + post.id + '" data-parentname="' + post.title + '"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zM3 8v8l4-4-4-4zm8 9h10v-2H11v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z"/><path d="M0 0h24v24H0z" fill="none"/></svg>' + nestedpages.add_child_short + '</a></li>';
1457
- html += '</ul></div>';
1458
-
1459
- // Quick Edit (data attrs)
1460
- html += '<a href="#" class="np-btn np-quick-edit" data-id="' + post.id + '" data-template="' + post.page_template + '" data-title="' + post.title + '" data-slug="' + post.slug + '" data-commentstatus="closed" data-status="' + post.status.toLowerCase() + '" data-np-status="show" data-navstatus="show" data-author="' + post.author + '" data-template="' + post.template + '" data-month="' + post.month + '" data-day="' + post.day + '" data-year="' + post.year + '" data-hour="' + post.hour + '" data-minute="' + post.minute + '" data-datepicker="' + post.datepicker + '" data-time="' + post.time + '" data-formattedtime="' + post.formattedtime + '" data-ampm="' + post.ampm + '">' + nestedpages.quick_edit + '</a>';
1461
-
1462
- html += '<a href="' + post.view_link + '" class="np-btn" target="_blank">' + nestedpages.view + '</a>';
1463
-
1464
- // Trash
1465
- html += '<a href="' + post.delete_link + '" class="np-btn np-btn-trash"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="np-icon-remove"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" class="icon"/><path d="M0 0h24v24H0z" fill="none"/></svg></a>';
1466
- html += '</div><!-- .action-buttons -->';
1467
-
1468
- html += '</div><!-- .row-inner --></div><!-- .row -->';
1469
- html += '</li>';
1470
-
1471
- if ( before ){
1472
- var row = plugin.findRowById(before);
1473
- $(html).insertBefore(row);
1474
- return;
1475
- }
1476
- if ( after ){
1477
- var row = plugin.findRowById(after);
1478
- $(html).insertAfter(row);
1479
- return;
1480
- }
1481
-
1482
- $(appendto).append(html);
1483
- }
1484
-
1485
- // Find the row for inserting before/after
1486
- plugin.findRowById = function(id)
1487
- {
1488
- var row = $(NestedPages.selectors.rows + '#menuItem_' + id);
1489
- return row;
1490
- }
1491
-
1492
- // Toggle the "Add & Edit" & "Add" buttons depending on row count
1493
- plugin.toggleAddEditButton = function(form)
1494
- {
1495
- var titleCount = $(form).find('.np_title').length;
1496
- if ( titleCount < 1 ){
1497
- $(NestedPages.selectors.newPageSubmitButton).hide();
1498
- return;
1499
- }
1500
- $(NestedPages.selectors.newPageSubmitButton).show();
1501
- if ( titleCount > 1 ){
1502
- $(NestedPages.selectors.newPageSubmitButton + '.add-edit').hide()
1503
- return;
1504
- }
1505
- $(NestedPages.selectors.newPageSubmitButton + '.add-edit').show()
1506
- }
1507
-
1508
- // Toggle the form loading state
1509
- plugin.toggleLoading = function(loading)
1510
- {
1511
- if ( loading ){
1512
- $(NestedPages.selectors.quickEditErrorDiv).hide();
1513
- $(NestedPages.selectors.newPageSubmitButton).attr('disabled', 'disabled');
1514
- $(NestedPages.selectors.quickEditLoadingIndicator).show();
1515
- return;
1516
- }
1517
- $(NestedPages.selectors.newPageSubmitButton).attr('disabled', false);
1518
- $(NestedPages.selectors.quickEditLoadingIndicator).hide();
1519
- }
1520
-
1521
- return plugin.bindEvents();
1522
- }
1523
- var NestedPages = NestedPages || {};
1524
-
1525
- /**
1526
- * Quick Edit functionality for posts
1527
- * @package Nested Pages
1528
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
1529
- */
1530
- NestedPages.QuickEditPost = function()
1531
- {
1532
- var plugin = this;
1533
- var $ = jQuery;
1534
-
1535
- plugin.formatter = new NestedPages.Formatter;
1536
- plugin.button = ''; // The quick edit button
1537
- plugin.initialData = ''; // The unedited post data
1538
- plugin.parent_li = ''; // The post's nested pages list element
1539
- plugin.form = ''; // The newly created form
1540
- plugin.flatTerms = ''; // Object containing flat taxonomy IDs
1541
- plugin.termNames = ''; // Flat Taxonomy Term Names
1542
- plugin.saveButton = ''; // Save button
1543
- plugin.newData = ''; // New Data, after save
1544
- plugin.row = ''; // The row being edited
1545
-
1546
- plugin.bindEvents = function()
1547
- {
1548
- $(document).on('click', NestedPages.selectors.quickEditOpen, function(e){
1549
- e.preventDefault();
1550
- plugin.button = $(this);
1551
- plugin.openForm();
1552
- });
1553
- $(document).on('click', NestedPages.selectors.quickEditCancel, function(e){
1554
- e.preventDefault();
1555
- plugin.formatter.removeQuickEdit();
1556
- });
1557
- $(document).on('change', '.keep_private', function(){
1558
- if ( this.checked ){
1559
- $('.post_password').val('').prop('readonly', true);
1560
- } else {
1561
- $('.post_password').prop('readonly', false);
1562
- }
1563
- });
1564
- $(document).on('click', NestedPages.selectors.quickEditSaveButton, function(e){
1565
- e.preventDefault();
1566
- plugin.saveButton = $(this);
1567
- plugin.save();
1568
- });
1569
- $(document).on('keydown', function(e){
1570
- if ( e.keyCode === 27 ) plugin.formatter.removeQuickEdit();
1571
- });
1572
- }
1573
-
1574
-
1575
- // Create and open the quick edit form
1576
- plugin.openForm = function()
1577
- {
1578
- plugin.setInitialData();
1579
- plugin.createForm();
1580
- plugin.populateForm();
1581
- plugin.populateFlatTaxonomies();
1582
- }
1583
-
1584
-
1585
- // Set the unedited initial data
1586
- plugin.setInitialData = function()
1587
- {
1588
- plugin.initialData = {
1589
- id : $(plugin.button).attr('data-id'),
1590
- title : $(plugin.button).attr('data-title'),
1591
- slug : $(plugin.button).attr('data-slug'),
1592
- author : $(plugin.button).attr('data-author'),
1593
- cs : $(plugin.button).attr('data-commentstatus'),
1594
- status : $(plugin.button).attr('data-status'),
1595
- template : $(plugin.button).attr('data-template'),
1596
- month : $(plugin.button).attr('data-month'),
1597
- day : $(plugin.button).attr('data-day'),
1598
- year : $(plugin.button).attr('data-year'),
1599
- hour : $(plugin.button).attr('data-hour'),
1600
- minute : $(plugin.button).attr('data-minute'),
1601
- navstatus : $(plugin.button).attr('data-navstatus'),
1602
- npstatus : $(plugin.button).attr('data-np-status'),
1603
- navtitle : $(plugin.button).attr('data-navtitle'),
1604
- navtitleattr : $(plugin.button).attr('data-navtitleattr'),
1605
- navcss : $(plugin.button).attr('data-navcss'),
1606
- linktarget : $(plugin.button).attr('data-linktarget'),
1607
- password : $(plugin.button).attr('data-password'),
1608
- datepicker : $(plugin.button).attr('data-datepicker'),
1609
- time: $(plugin.button).attr('data-formattedtime'),
1610
- timeTwentyFour : $(plugin.button).attr('data-time'),
1611
- ampm: $(plugin.button).attr('data-ampm'),
1612
- timeFormat: $(plugin.button).attr('data-timeformat'),
1613
- sticky: $(plugin.button).attr('data-sticky')
1614
- };
1615
-
1616
- // Add Custom Fields if Available
1617
- var attrs = $(plugin.button)[0].attributes;
1618
- $.each(attrs, function(i, attr){
1619
- if ( !attr.name.includes('data-npcustom') ) return;
1620
- plugin.initialData[attr.name] = attr.value;
1621
- });
1622
-
1623
- // Add Array of Taxonomies to the data object using classes applied to the list element
1624
- plugin.initialData.h_taxonomies = [];
1625
- plugin.initialData.f_taxonomies = [];
1626
-
1627
- plugin.parent_li = $(plugin.button).closest(NestedPages.selectors.row).parent('li');
1628
- var classes = $(plugin.parent_li).attr('class').split(/\s+/);
1629
- for ( i = 0; i < classes.length; i++ ){
1630
- if ( classes[i].substring(0, 3) === 'in-'){
1631
- plugin.initialData.h_taxonomies.push(classes[i]);
1632
- }
1633
- if ( classes[i].substring(0, 4) === 'inf-' ){
1634
- plugin.initialData.f_taxonomies.push(classes[i]);
1635
- }
1636
- }
1637
- }
1638
-
1639
-
1640
- // Create the form and append it to the row
1641
- plugin.createForm = function()
1642
- {
1643
- plugin.form = $(NestedPages.selectors.quickEditPostForm).clone();
1644
- if ( $(plugin.parent_li).children('ol').length > 0 ){
1645
- var child_ol = $(plugin.parent_li).children('ol');
1646
- $(plugin.form).insertBefore(child_ol);
1647
- } else {
1648
- $(plugin.form).appendTo(plugin.parent_li);
1649
- }
1650
- $(plugin.form).siblings(NestedPages.selectors.row).hide();
1651
- $(plugin.form).show();
1652
- }
1653
-
1654
-
1655
- // Populate the new quick edit form
1656
- plugin.populateForm = function()
1657
- {
1658
- $(plugin.form).find('.page_id').html('<em>ID:</em> ' + plugin.initialData.id);
1659
- $(plugin.form).find('.np_id').val(plugin.initialData.id);
1660
- $(plugin.form).find('.np_title').val(plugin.initialData.title);
1661
- $(plugin.form).find('.np_slug').val(plugin.initialData.slug);
1662
- $(plugin.form).find('.np_author select').val(plugin.initialData.author);
1663
- $(plugin.form).find('.np_status').val(plugin.initialData.status);
1664
- $(plugin.form).find('.np_nav_title').val(plugin.initialData.navtitle);
1665
- $(plugin.form).find('.np_title_attribute').val(plugin.initialData.navtitleattr);
1666
- $(plugin.form).find('.np_nav_css_classes').val(plugin.initialData.navcss);
1667
- $(plugin.form).find('.post_password').val(plugin.initialData.password);
1668
- $(plugin.form).find('.np_publish_date').val(plugin.initialData.datepicker);
1669
- if ( plugin.initialData.cs === 'open' ) $(plugin.form).find('.np_cs').attr('checked', 'checked');
1670
-
1671
- if ( plugin.initialData.template !== '' ){
1672
- $(plugin.form).find('.np_template').val(plugin.initialData.template);
1673
- } else {
1674
- $(plugin.form).find('.np_template').val('default');
1675
- }
1676
-
1677
- if ( plugin.initialData.status === 'private' ){
1678
- $(plugin.form).find('.post_password').attr('readonly', true);
1679
- $(plugin.form).find('.keep_private').attr('checked', true);
1680
- }
1681
-
1682
- if ( plugin.initialData.npstatus === 'hide' ){
1683
- $(plugin.form).find('.nested_pages_status').attr('checked', 'checked');
1684
- } else {
1685
- $(plugin.form).find('.nested_pages_status').removeAttr('checked');
1686
- }
1687
-
1688
- if ( plugin.initialData.navstatus === 'hide' ) {
1689
- $(plugin.form).find('.np_nav_status').attr('checked', 'checked');
1690
- } else {
1691
- $(plugin.form).find('.np_nav_status').attr('checked', false);
1692
- }
1693
-
1694
- if ( plugin.initialData.linktarget === "_blank" ) {
1695
- $(plugin.form).find('.link_target').attr('checked', 'checked');
1696
- } else {
1697
- $(plugin.form).find('.link_target').attr('checked', false);
1698
- }
1699
-
1700
- if ( plugin.initialData.status === "private" ) {
1701
- $(plugin.form).find('.np_status').val('publish');
1702
- }
1703
-
1704
- if ( plugin.initialData.sticky === 'sticky' ){
1705
- $(plugin.form).find('.np-sticky').attr('checked', 'checked');
1706
- } else {
1707
- $(plugin.form).find('.np-sticky').removeAttr('checked');
1708
- }
1709
-
1710
- // Date Fields
1711
- if ( plugin.initialData.timeFormat === 'H:i' ){
1712
- $(plugin.form).find('.np_time').val(plugin.initialData.timeTwentyFour);
1713
- } else {
1714
- $(plugin.form).find('.np_time').val(plugin.initialData.time);
1715
- $(plugin.form).find('.np_ampm').val(plugin.initialData.ampm);
1716
- $(plugin.form).find('select[name="mm"]').val(plugin.initialData.month);
1717
- $(plugin.form).find('input[name="jj"]').val(plugin.initialData.day);
1718
- $(plugin.form).find('input[name="aa"]').val(plugin.initialData.year);
1719
- $(plugin.form).find('input[name="hh"]').val(plugin.initialData.hour);
1720
- $(plugin.form).find('input[name="mn"]').val(plugin.initialData.minute);
1721
- }
1722
-
1723
- // Custom Fields
1724
- for ( var key in plugin.initialData ){
1725
- if ( !key.includes('npcustom') ) continue;
1726
- if ( plugin.initialData.hasOwnProperty(key) ){
1727
- var inputName = key.replace('data-npcustom-', '');
1728
- inputName = inputName.toLowerCase();
1729
- $(plugin.form).find('[data-np-custom-field="' + inputName + '"]').val(plugin.initialData[key]);
1730
- }
1731
- }
1732
-
1733
- plugin.populateFlatTaxonomies();
1734
-
1735
- // Populate Hierarchical Taxonomy Checkboxes
1736
- if ( plugin.initialData.hasOwnProperty('h_taxonomies') ){
1737
- var taxonomies = plugin.initialData.h_taxonomies;
1738
- for ( i = 0; i < taxonomies.length; i++ ){
1739
- var tax = '#' + taxonomies[i];
1740
- $(plugin.form).find(tax).attr('checked', 'checked');
1741
- }
1742
- }
1743
-
1744
- var datepickers = $(plugin.form).find('.np_datepicker');
1745
- $.each(datepickers, function(){
1746
- var $this = $(this);
1747
- $this.datepicker({
1748
- dateFormat: $this.attr('data-datepicker-format'),
1749
- beforeShow: function(input, inst) {
1750
- $('#ui-datepicker-div').addClass('nestedpages-datepicker');
1751
- }
1752
- });
1753
- });
1754
-
1755
- plugin.formatter.showQuickEdit();
1756
- $(plugin.form).show();
1757
- }
1758
-
1759
-
1760
- // Populate the flat taxonomies
1761
- plugin.populateFlatTaxonomies = function()
1762
- {
1763
- if ( !plugin.initialData.hasOwnProperty('f_taxonomies') ) return;
1764
- plugin.createTaxonomyObject();
1765
- plugin.getTermNames();
1766
- plugin.setWPSuggest();
1767
- }
1768
-
1769
-
1770
- // Create an object of taxonomies from class names
1771
- plugin.createTaxonomyObject = function()
1772
- {
1773
- var out = "";
1774
- var terms = {};
1775
- for ( i = 0; i < plugin.initialData.f_taxonomies.length; i++ ){
1776
-
1777
- // Get the term
1778
- var singleTerm = plugin.initialData.f_taxonomies[i];
1779
-
1780
- var tax_array = singleTerm.split('-'); // split the string into an array
1781
- var splitter = tax_array.indexOf('nps'); // find the index of the name splitter
1782
- var term = tax_array.splice(splitter + 1); // Splice off the name
1783
- term = term.join('-'); // Join the name back into a string
1784
-
1785
-
1786
- // Get the taxonomy
1787
- var tax = singleTerm.split('-').splice(0, splitter);
1788
- tax.shift('inf');
1789
- var taxonomy = tax.join('-');
1790
-
1791
- // Add taxonomy array to object
1792
- if ( !(taxonomy in terms) ){
1793
- terms[taxonomy] = [];
1794
- }
1795
- // push term to taxonomy array
1796
- var term_array = terms[taxonomy];
1797
- term_array.push(term);
1798
- }
1799
- plugin.flatTerms = terms;
1800
- }
1801
-
1802
-
1803
- // Get the taxonomy names from the ids
1804
- plugin.getTermNames = function()
1805
- {
1806
- $.ajax({
1807
- url: NestedPages.jsData.ajaxurl,
1808
- type: 'post',
1809
- datatype: 'json',
1810
- data : {
1811
- action : NestedPages.formActions.getTaxonomies,
1812
- nonce : NestedPages.jsData.nonce,
1813
- terms : plugin.flatTerms
1814
- },
1815
- success: function(data){
1816
- plugin.termNames = data.terms;
1817
- plugin.populateFlatTaxonomyFields();
1818
- }
1819
- });
1820
- }
1821
-
1822
-
1823
- // Populate the flat taxonomy fields in the form
1824
- plugin.populateFlatTaxonomyFields = function()
1825
- {
1826
- if ( !plugin.termNames ) return;
1827
- $.each(plugin.termNames, function(i, v){
1828
- var textarea = $('#' + i + '-quickedit');
1829
- $(textarea).val(v.join(','));
1830
- });
1831
- }
1832
-
1833
-
1834
- // Initialize WP Auto Suggest on Flat Taxonomy fields
1835
- plugin.setWPSuggest = function()
1836
- {
1837
- var tagfields = $(plugin.form).find('[data-autotag]');
1838
- $.each(tagfields, function(i, v){
1839
- var taxonomy = $(this).attr('data-taxonomy');
1840
- $(this).suggest(ajaxurl + '?action=ajax-tag-search&tax=' + taxonomy , {multiple:true, multipleSep: ","});
1841
- });
1842
- }
1843
-
1844
-
1845
- // Save the quick edit
1846
- plugin.save = function()
1847
- {
1848
- plugin.toggleLoading(true);
1849
-
1850
- $.ajax({
1851
- url: NestedPages.jsData.ajaxurl,
1852
- type: 'post',
1853
- datatype: 'json',
1854
- data: $(plugin.form).find('form').serialize() + '&action=' + NestedPages.formActions.quickEditPost + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
1855
- success: function(data){
1856
- if (data.status === 'error'){
1857
- plugin.toggleLoading(false);
1858
- $(plugin.form).find(NestedPages.selectors.quickEditErrorDiv).text(data.message).show();
1859
- } else {
1860
- plugin.toggleLoading(false);
1861
- plugin.newData = data.post_data;
1862
- plugin.updatePostRow();
1863
- }
1864
- },
1865
- error: function(data){
1866
- console.log(data);
1867
- }
1868
- });
1869
- }
1870
-
1871
-
1872
- // Update the Row after saving quick edit data
1873
- plugin.updatePostRow = function()
1874
- {
1875
- plugin.row = $(plugin.button).parents('.row-inner');
1876
-
1877
- $(plugin.row).find('.title').text(plugin.newData.post_title);
1878
- $(plugin.row).find('.np-view-button').attr('href', plugin.newData.permalink);
1879
-
1880
- var status = $(plugin.row).find('.status');
1881
- if ( (plugin.newData._status !== 'publish') && (plugin.newData._status !== 'future') ){
1882
- var newStatus = nestedpages.post_statuses[plugin.newData._status].label;
1883
- $(status).text('(' + newStatus + ')');
1884
- } else {
1885
- $(status).text('');
1886
- }
1887
- if ( plugin.newData.keep_private === 'private' ){
1888
- $(status).text(nestedpages.private);
1889
- }
1890
-
1891
- // Password Lock Icon
1892
- if ( plugin.newData.post_password !== "" && typeof plugin.newData.post_password !== 'undefined'){
1893
- var statustext = $(status).text();
1894
- statustext += ' <span class="locked">';
1895
- statustext += '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/></svg>'
1896
- statustext += '</span>';
1897
- $(status).html(statustext);
1898
- }
1899
-
1900
- // Hide / Show in Nav
1901
- var nav_status = $(plugin.row).find('.nav-status');
1902
- if ( (plugin.newData.nav_status == 'hide') ){
1903
- $(nav_status).text('(Hidden)');
1904
- } else {
1905
- $(nav_status).text('');
1906
- }
1907
-
1908
- // Hide / Show in Nested Pages
1909
- var li = $(plugin.row).parent('li');
1910
- if ( (plugin.newData.np_status == 'hide') ){
1911
- $(li).addClass('np-hide');
1912
- $(plugin.row).find('.status').after('<svg class="row-status-icon status-np-hidden" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z" fill="none"/><path class="icon" d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>');
1913
- } else {
1914
- $(li).removeClass('np-hide');
1915
- $(plugin.row).find('.status-np-hidden').remove();
1916
- }
1917
-
1918
- // Sticky
1919
- var sticky = $(plugin.row).find('.sticky');
1920
- if ( (plugin.newData.sticky == 'sticky') ){
1921
- $(sticky).show();
1922
- } else {
1923
- $(sticky).hide();
1924
- }
1925
-
1926
- // Author for Non-Hierarchical Types
1927
- if ( !NestedPages.jsData.hierarchical ){
1928
- $(plugin.row).find('.np-author-display').text(plugin.newData.author_name);
1929
- }
1930
-
1931
- var button = $(plugin.row).find(NestedPages.selectors.quickEditOpen);
1932
-
1933
- $(button).attr('data-id', plugin.newData.post_id);
1934
- $(button).attr('data-template', plugin.newData.page_template);
1935
- $(button).attr('data-title', plugin.newData.post_title);
1936
- $(button).attr('data-slug', plugin.newData.post_name);
1937
- $(button).attr('data-commentstatus', plugin.newData.comment_status);
1938
- $(button).attr('data-status', plugin.newData._status);
1939
- $(button).attr('data-sticky', plugin.newData.sticky);
1940
-
1941
- // Private Status
1942
- if ( plugin.newData.keep_private === 'private' ) {
1943
- $(button).attr('data-status', 'private');
1944
- }
1945
-
1946
- $(button).attr('data-author', plugin.newData.post_author);
1947
- $(button).attr('data-np-status', plugin.newData.np_status);
1948
- $(button).attr('data-password', plugin.newData.post_password);
1949
-
1950
- $(button).attr('data-navstatus', plugin.newData.nav_status);
1951
- $(button).attr('data-navtitle', plugin.newData.np_nav_title);
1952
- $(button).attr('data-linktarget', plugin.newData.link_target);
1953
- $(button).attr('data-navtitleattr', plugin.newData.np_title_attribute);
1954
- $(button).attr('data-navcss', plugin.newData.np_nav_css_classes);
1955
-
1956
- $(button).attr('data-month', plugin.newData.mm);
1957
- $(button).attr('data-day', plugin.newData.jj);
1958
- $(button).attr('data-year', plugin.newData.aa);
1959
- $(button).attr('data-hour', plugin.newData.hh);
1960
- $(button).attr('data-minute', plugin.newData.mn);
1961
- $(button).attr('data-datepicker', plugin.newData.np_date);
1962
- $(button).attr('data-time', plugin.newData.np_time);
1963
- $(button).attr('data-formattedtime', plugin.newData.np_time);
1964
- $(button).attr('data-ampm', plugin.newData.np_ampm);
1965
-
1966
- // Custom Fields
1967
- for ( var key in plugin.newData ){
1968
- if ( !key.includes('np_custom') ) continue;
1969
- if ( plugin.newData.hasOwnProperty(key) ){
1970
- var attrName = key.replace('np_custom_', 'data-npcustom-');
1971
- $(button).attr(attrName, plugin.newData[key]);
1972
- }
1973
- }
1974
-
1975
- plugin.removeTaxonomyClasses();
1976
- plugin.addCategoryClasses();
1977
- plugin.addHierarchicalClasses();
1978
- plugin.addFlatClasses();
1979
- plugin.addStatusClass();
1980
-
1981
- plugin.formatter.removeQuickEdit();
1982
- plugin.formatter.flashRow(plugin.row);
1983
- }
1984
-
1985
-
1986
- // Add Status Class
1987
- plugin.addStatusClass = function()
1988
- {
1989
- var statuses = ['published', 'draft', 'pending', 'future'];
1990
- for ( i = 0; i < statuses.length; i++ ){
1991
- $(plugin.row).removeClass(statuses[i]);
1992
- }
1993
- $(plugin.row).addClass(plugin.newData._status);
1994
- }
1995
-
1996
-
1997
- // Remove Taxonomy Classes from the updated row
1998
- plugin.removeTaxonomyClasses = function()
1999
- {
2000
- taxonomies = [];
2001
- var classes = $(plugin.row).attr('class').split(/\s+/);
2002
- for ( i = 0; i < classes.length; i++ ){
2003
- if ( classes[i].substring(0, 3) === 'in-'){ // hierarchical
2004
- $(plugin.row).removeClass(classes[i]);
2005
- }
2006
- if ( classes[i].substring(0, 4) === 'inf-'){ // flat
2007
- $(plugin.row).removeClass(classes[i]);
2008
- }
2009
- }
2010
- }
2011
-
2012
-
2013
- // Add Category Classes to the Row
2014
- plugin.addCategoryClasses = function()
2015
- {
2016
- if ( !plugin.newData.hasOwnProperty('post_category') ) return;
2017
- var cats = plugin.newData.post_category;
2018
- for ( i = 0; i < cats.length; i++ ){
2019
- var taxclass = 'in-category-' + cats[i];
2020
- $(plugin.row).addClass(taxclass);
2021
- }
2022
- }
2023
-
2024
-
2025
- // Add hierarchical taxonomy classes to the row
2026
- plugin.addHierarchicalClasses = function()
2027
- {
2028
- if ( !plugin.newData.hasOwnProperty('tax_input') ) return;
2029
- var taxonomies = plugin.newData.tax_input;
2030
- $.each(taxonomies, function(tax, terms){
2031
- for (i = 0; i < terms.length; i++){
2032
- var taxclass = 'in-' + tax + '-' + terms[i];
2033
- $(plugin.row).addClass(taxclass);
2034
- }
2035
- });
2036
- }
2037
-
2038
-
2039
- // Add flat taxonomy classes to the row
2040
- plugin.addFlatClasses = function()
2041
- {
2042
- if ( !plugin.newData.hasOwnProperty('flat_tax') ) return;
2043
- var taxonomies = plugin.newData.flat_tax;
2044
- $.each(taxonomies, function(tax, terms){
2045
- for (i = 0; i < terms.length; i++){
2046
- var taxclass = 'inf-' + tax + '-nps-' + terms[i];
2047
- $(plugin.row).addClass(taxclass);
2048
- }
2049
- });
2050
- }
2051
-
2052
-
2053
- // Toggle Form Loading State
2054
- plugin.toggleLoading = function(loading)
2055
- {
2056
- if ( loading ){
2057
- $(NestedPages.selectors.quickEditErrorDiv).hide();
2058
- $(plugin.saveButton).attr('disabled', 'disabled');
2059
- $(NestedPages.selectors.quickEditLoadingIndicator).show();
2060
- return;
2061
- }
2062
- $(plugin.saveButton).attr('disabled', false);
2063
- $(NestedPages.selectors.quickEditLoadingIndicator).hide();
2064
- }
2065
-
2066
- return plugin.bindEvents();
2067
-
2068
- }
2069
- var NestedPages = NestedPages || {};
2070
-
2071
- /**
2072
- * Quick Edit functionality for links
2073
- * @package Nested Pages
2074
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
2075
- */
2076
- NestedPages.QuickEditLink = function()
2077
- {
2078
- var plugin = this;
2079
- var $ = jQuery;
2080
-
2081
- plugin.formatter = new NestedPages.Formatter;
2082
- plugin.button = ''; // The Active Quick Edit Button
2083
- plugin.postData = ''; // Data for Post being edited (before update)
2084
- plugin.newPostData = ''; // Data after update
2085
- plugin.form = ''; // The newly created Quick Edit Form
2086
-
2087
- plugin.bindEvents = function()
2088
- {
2089
- $(document).on('click', NestedPages.selectors.quickEditButtonLink, function(e){
2090
- e.preventDefault();
2091
- plugin.formatter.removeQuickEdit();
2092
- plugin.button = $(this);
2093
- plugin.openQuickEdit();
2094
- });
2095
- $(document).on('click', NestedPages.selectors.quickEditLinkSaveButton, function(e){
2096
- e.preventDefault();
2097
- plugin.submitForm();
2098
- });
2099
- $(document).on('keydown', function(e){
2100
- if ( e.keyCode === 27 ) plugin.formatter.removeQuickEdit();
2101
- });
2102
- }
2103
-
2104
-
2105
- // Open the Quick Edit Form
2106
- plugin.openQuickEdit = function()
2107
- {
2108
- plugin.setData();
2109
- plugin.createForm();
2110
- plugin.populateForm();
2111
- }
2112
-
2113
-
2114
- // Set the Quick Edit Data
2115
- plugin.setData = function()
2116
- {
2117
- plugin.postData = {
2118
- id : $(plugin.button).attr('data-id'),
2119
- url : $(plugin.button).attr('data-url'),
2120
- title : $(plugin.button).attr('data-title'),
2121
- status : $(plugin.button).attr('data-status'),
2122
- navstatus : $(plugin.button).attr('data-navstatus'),
2123
- npstatus : $(plugin.button).attr('data-np-status'),
2124
- linktarget : $(plugin.button).attr('data-linktarget'),
2125
- parentid : $(plugin.button).attr('data-parentid'),
2126
- navtitleattr : $(plugin.button).attr('data-navtitleattr'),
2127
- navcss : $(plugin.button).attr('data-navcss'),
2128
- navtype : $(plugin.button).attr('data-nav-type'),
2129
- navobject : $(plugin.button).attr('data-nav-object'),
2130
- navobjectid : $(plugin.button).attr('data-nav-object-id'),
2131
- navoriginallink : $(plugin.button).attr('data-nav-original-link'),
2132
- navoriginaltitle : $(plugin.button).attr('data-nav-original-title')
2133
- };
2134
- }
2135
-
2136
-
2137
- // Create the quick edit form
2138
- plugin.createForm = function()
2139
- {
2140
- var parent_li = $(plugin.button).closest(NestedPages.selectors.row).parent('li');
2141
- plugin.form = $(NestedPages.selectors.quickEditLinkForm).clone();
2142
-
2143
- // Append the form to the list item
2144
- if ( $(parent_li).children('ol').length > 0 ){
2145
- var child_ol = $(parent_li).children('ol');
2146
- $(plugin.form).insertBefore(child_ol);
2147
- } else {
2148
- $(plugin.form).appendTo(parent_li);
2149
- }
2150
-
2151
- var row = $(plugin.form).siblings(NestedPages.selectors.row).hide();
2152
- }
2153
-
2154
-
2155
- // Populate the Quick Edit form with the post data
2156
- plugin.populateForm = function()
2157
- {
2158
- $(plugin.form).find('.np_id').val(plugin.postData.id);
2159
- $(plugin.form).find('.np_title').val(plugin.postData.title);
2160
- $(plugin.form).find('.np_author select').val(plugin.postData.author);
2161
- $(plugin.form).find('.np_status').val(plugin.postData.status);
2162
- $(plugin.form).find('.np_content').val(plugin.postData.url);
2163
- $(plugin.form).find('.np_parent_id').val(plugin.postData.parentid);
2164
- $(plugin.form).find('.np_title_attribute').val(plugin.postData.navtitleattr);
2165
- $(plugin.form).find('.np_nav_css_classes').val(plugin.postData.navcss);
2166
-
2167
- if ( plugin.postData.npstatus === 'hide' ){
2168
- $(plugin.form).find('.np_status').prop('checked', 'checked');
2169
- } else {
2170
- $(plugin.form).find('.np_status').removeAttr('checked');
2171
- }
2172
-
2173
- if ( plugin.postData.navstatus === 'hide' ) {
2174
- $(plugin.form).find('.np_nav_status').prop('checked', 'checked');
2175
- } else {
2176
- $(plugin.form).find('.np_nav_status').removeAttr('checked');
2177
- }
2178
-
2179
- if ( plugin.postData.linktarget === "_blank" ) {
2180
- $(plugin.form).find('.link_target').prop('checked', 'checked');
2181
- } else {
2182
- $(plugin.form).find('.link_target').removeAttr('checked');
2183
- }
2184
-
2185
- // Relationship Links
2186
- if ( plugin.postData.navobject !== 'custom' && plugin.postData.navobject !== '' ){
2187
- var html = '<div class="form-control original-link">Original: <a href="' + plugin.postData.navoriginallink + '" target="_blank">' + plugin.postData.navoriginaltitle + '</a></div>';
2188
- $(plugin.form).find('[data-url-field]').remove();
2189
- $(html).insertAfter($(plugin.form).find('h3'));
2190
- $(plugin.form).find('[data-np-menu-object-input]').val(plugin.postData.navobject);
2191
- $(plugin.form).find('[data-np-menu-objectid-input]').val(plugin.postData.navobjectid);
2192
- $(plugin.form).find('[data-np-menu-type-input]').val(plugin.postData.navtype);
2193
- $(plugin.form).find('h3').text('Link: ' + plugin.postData.navoriginaltitle);
2194
- } else {
2195
- $(plugin.form).find('h3').text('Link');
2196
- $(plugin.form).find('[data-np-menu-object-input]').val('custom');
2197
- $(plugin.form).find('[data-np-menu-type-input]').val('custom');
2198
- }
2199
-
2200
- plugin.formatter.showQuickEdit();
2201
- $(plugin.form).show();
2202
- }
2203
-
2204
-
2205
- // Submit the form
2206
- plugin.submitForm = function()
2207
- {
2208
- plugin.toggleLoading(true);
2209
-
2210
- $.ajax({
2211
- url: NestedPages.jsData.ajaxurl,
2212
- type: 'post',
2213
- datatype: 'json',
2214
- data: $(plugin.form).find('form').serialize() + '&action=' + NestedPages.formActions.quickEditLink + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
2215
- success: function(data){
2216
- if (data.status === 'error'){
2217
- plugin.toggleLoading(false);
2218
- $(plugin.form).find(NestedPages.selectors.quickEditErrorDiv).text(data.message).show();
2219
- } else {
2220
- plugin.toggleLoading(false);
2221
- plugin.newPostData = data.post_data;
2222
- plugin.updateRow();
2223
- }
2224
- },
2225
- error: function(data){
2226
- plugin.toggleLoading(false);
2227
- $(plugin.form).find(NestedPages.selectors.quickEditErrorDiv).text('The form could not be saved at this time.').show();
2228
- }
2229
- });
2230
- }
2231
-
2232
-
2233
- // Update the row after successfully saving quick edit data
2234
- plugin.updateRow = function()
2235
- {
2236
- var row = $(plugin.form).siblings('.row');
2237
- $(row).find('.title').html(plugin.newPostData.post_title + ' <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path class="icon" d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>');
2238
-
2239
- var status = $(row).find('.status');
2240
- if ( (plugin.newPostData._status !== 'publish') && (plugin.newPostData._status !== 'future') ){
2241
- $(status).text('(' + plugin.newPostData._status + ')');
2242
- } else {
2243
- $(status).text('');
2244
- }
2245
-
2246
- // Hide / Show in Nav
2247
- var nav_status = $(row).find('.nav-status');
2248
- if ( (plugin.newPostData.nav_status == 'hide') ){
2249
- $(nav_status).text('(' + NestedPages.jsData.hiddenText + ')');
2250
- } else {
2251
- $(nav_status).text('');
2252
- }
2253
-
2254
- // Hide / Show in Nested Pages
2255
- var li = $(row).parent('li');
2256
- if ( (plugin.newPostData.np_status == 'hide') ){
2257
- $(li).addClass('np-hide');
2258
- $(row).find('.status').after('<svg class="row-status-icon status-np-hidden" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z" fill="none"/><path class="icon" d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>');
2259
- } else {
2260
- $(li).removeClass('np-hide');
2261
- $(row).find('.status-np-hidden').remove();
2262
- }
2263
-
2264
- var button = $(row).find(NestedPages.selectors.quickEditButtonLink);
2265
-
2266
- $(button).attr('data-id', plugin.newPostData.post_id);
2267
- $(button).attr('data-title', plugin.newPostData.post_title);
2268
- $(button).attr('data-url', plugin.newPostData.post_content);
2269
- $(button).attr('data-status', plugin.newPostData._status);
2270
- $(button).attr('data-navstatus', plugin.newPostData.nav_status);
2271
- $(button).attr('data-np-status', plugin.newPostData.np_status);
2272
- $(button).attr('data-linkTarget', plugin.newPostData.linkTarget);
2273
- $(button).attr('data-navtitleattr', plugin.newPostData.titleAttribute);
2274
- $(button).attr('data-navcss', plugin.newPostData.cssClasses);
2275
-
2276
- plugin.formatter.removeQuickEdit();
2277
- plugin.formatter.flashRow(row);
2278
- }
2279
-
2280
-
2281
- // Toggle loading state in form
2282
- plugin.toggleLoading = function(loading)
2283
- {
2284
- $('.row').removeClass('np-updated').removeClass('np-updated-show');
2285
- if ( loading ){
2286
- $(NestedPages.selectors.quickEditErrorDiv).hide();
2287
- $(NestedPages.selectors.quickEditLinkSaveButton).attr('disabled', 'disabled');
2288
- $(NestedPages.selectors.quickEditLoadingIndicator).show();
2289
- return;
2290
- }
2291
- $(NestedPages.selectors.quickEditLinkSaveButton).attr('disabled', false);
2292
- $(NestedPages.selectors.quickEditLoadingIndicator).hide();
2293
- }
2294
-
2295
- return plugin.bindEvents();
2296
-
2297
- }
2298
- var NestedPages = NestedPages || {};
2299
-
2300
- /**
2301
- * Post clone functionality
2302
- * @package Nested Pages
2303
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
2304
- */
2305
- NestedPages.Clone = function()
2306
- {
2307
- var plugin = this;
2308
- var $ = jQuery;
2309
-
2310
- plugin.parent_id = ''; // The parent/source post ID
2311
- plugin.parent_title = ''; // The parent title
2312
- plugin.parentLi = null;
2313
-
2314
- plugin.formatter = new NestedPages.Formatter;
2315
-
2316
- plugin.bindEvents = function()
2317
- {
2318
- $(document).on('click', NestedPages.selectors.cloneButton, function(e){
2319
- e.preventDefault();
2320
- plugin.parent_id = $(this).attr('data-id');
2321
- plugin.parent_title = $(this).attr('data-parentname');
2322
- plugin.parentLi = $(this).parent('.row').parent('.page-row').parent('.npList');
2323
- plugin.openModal();
2324
- });
2325
- $(document).on('click', NestedPages.selectors.confirmClone, function(e){
2326
- e.preventDefault();
2327
- plugin.clone();
2328
- });
2329
- }
2330
-
2331
- // Open the modal with clone options
2332
- plugin.openModal = function()
2333
- {
2334
- $('#' + NestedPages.selectors.cloneModal).find('[data-clone-parent]').text(plugin.parent_title);
2335
- $(document).trigger('open-modal-manual', NestedPages.selectors.cloneModal);
2336
- }
2337
-
2338
- // Clone the post
2339
- plugin.clone = function()
2340
- {
2341
- plugin.toggleLoading(true);
2342
- $.ajax({
2343
- url : NestedPages.jsData.ajaxurl,
2344
- type : 'post',
2345
- data : {
2346
- action : NestedPages.formActions.clonePost,
2347
- parent_id : plugin.parent_id,
2348
- quantity : $(NestedPages.selectors.cloneQuantity).val(),
2349
- status : $(NestedPages.selectors.cloneStatus).val(),
2350
- author : $(NestedPages.selectors.cloneAuthor).find('select').val(),
2351
- nonce : NestedPages.jsData.nonce,
2352
- posttype : NestedPages.jsData.posttype
2353
- },
2354
- success : function(data){
2355
- plugin.toggleLoading(false);
2356
- $(document).trigger('close-modal-manual');
2357
- location.reload();
2358
- }
2359
- });
2360
- }
2361
-
2362
- // Toggle Loading
2363
- plugin.toggleLoading = function(loading)
2364
- {
2365
- if ( loading ){
2366
- $('#' + NestedPages.selectors.cloneModal).find('[data-clone-loading]').show();
2367
- $(NestedPages.selectors.confirmClone).attr('disabled', 'disabled');
2368
- return;
2369
- }
2370
- $('#' + NestedPages.selectors.cloneModal).find('[data-clone-loading]').hide();
2371
- $(NestedPages.selectors.confirmClone).attr('disabled', false);
2372
- }
2373
-
2374
- return plugin.bindEvents();
2375
- }
2376
- /**
2377
- * Tabs
2378
- *
2379
- * @author Kyle Phillips
2380
- *
2381
- * To use, include links with a data-tab-toggle attribute which matches the tab pane's data-tab-pane attribute
2382
- * The tabs and panes should all the same data-tab-group attribute value
2383
- * Add a CSS selector of .tab-pane to panes to hide them
2384
- */
2385
- var NestedPages = NestedPages || {};
2386
- NestedPages.Tabs = function()
2387
- {
2388
- var self = this;
2389
- var $ = jQuery;
2390
-
2391
- self.selectors = {
2392
- tabToggle : 'data-np-tab-toggle',
2393
- tabPane : 'data-np-tab-pane',
2394
- tabGroup : 'data-np-tab-group'
2395
- }
2396
-
2397
- self.bindEvents = function()
2398
- {
2399
- $(document).on('click', '[' + self.selectors.tabToggle + ']', function(e){
2400
- e.preventDefault();
2401
- self.toggleTabs($(this));
2402
- });
2403
- }
2404
-
2405
- /**
2406
- * Toggle the Tabs
2407
- */
2408
- self.toggleTabs = function(tab)
2409
- {
2410
- var tabGroup = $(tab).attr(self.selectors.tabGroup);
2411
- var tabPanes = $('*[' + self.selectors.tabGroup + '=' + tabGroup + '][' + self.selectors.tabPane + ']');
2412
- var activeTab = $(tab).attr(self.selectors.tabToggle);
2413
- var buttons = $('*[' + self.selectors.tabGroup + '=' + tabGroup + '][' + self.selectors.tabToggle + ']');
2414
- var listItems = [];
2415
-
2416
- for ( var i = 0; i < buttons.length; i++ ){
2417
- listItems[i] = $(buttons[i]).parent('li')[0];
2418
- }
2419
-
2420
- $(tabPanes).hide();
2421
- $(buttons).removeClass('active');
2422
- $(listItems).removeClass('active');
2423
-
2424
- $.each(tabPanes, function(){
2425
- if ( $(this).attr(self.selectors.tabPane) == activeTab ) $(this).show();
2426
- });
2427
-
2428
- $.each(buttons, function(){
2429
- if ( $(this).attr(self.selectors.tabToggle) == activeTab ) {
2430
- $(this).addClass('active');
2431
- $(this).parent('li').addClass('active');
2432
- }
2433
- });
2434
-
2435
- $(document).trigger('tabs-changed', [activeTab, tabGroup, tab]);
2436
- }
2437
-
2438
- return self.bindEvents();
2439
- }
2440
- /**
2441
- * Primary Nested Pages Initialization
2442
- * @package Nested Pages
2443
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
2444
- */
2445
-
2446
- jQuery(document).ready(function(){
2447
- new NestedPages.Factory;
2448
- });
2449
-
2450
- var NestedPages = NestedPages || {};
2451
-
2452
-
2453
- // DOM Selectors
2454
- NestedPages.selectors = {
2455
- childToggle : '.child-toggle', // Child Toggle Buttons
2456
- childToggleLink : '.child-toggle a', // Actual link in button
2457
- toggleAll : '.nestedpages-toggleall', // Toggle All Button
2458
- toggleHidden : '.np-toggle-hidden', // Toggle Hidden Pages
2459
- toggleStatus : '.np-toggle-publish', // Toggle Published Pages
2460
- lists : '.nplist', // OL elements
2461
- rows : '.page-row', // Page Row,
2462
- row : '.row', // Inner row div element
2463
- sortable : '.sortable', // Sortable List
2464
- notSortable : '.no-sort', // Unsortable List
2465
- handle : '.handle', // Sortable Handle
2466
- published : '.published', // Published Rows
2467
- hiddenRows : '.np-hide', // Hidden Rows
2468
- errorDiv : '#np-error', // Error Alert
2469
- loadingIndicator : '#nested-loading', // Loading Indicator,
2470
- syncCheckbox : '.np-sync-menu', // Sync menu checkbox
2471
- syncForm: '.np-sync-menu-cont', // The form/container for the sync menu element
2472
- ajaxError : '[data-nestedpages-error]', // AJAX error notification
2473
- trashWithChildrenButton : '[data-nestedpages-trash-children]',
2474
-
2475
- // Responsive Toggle
2476
- toggleEditButtons : '.np-toggle-edit', // Button that toggles responsive buttons
2477
-
2478
- // Bulk Actions
2479
- bulkActionsHeader : '.nestedpages-list-header',
2480
- bulkActionsForm : '[data-np-bulk-form]',
2481
- bulkActionsCheckbox : '[data-np-bulk-checkbox]',
2482
- bulkActionsIds : '[data-np-bulk-ids]',
2483
- bulkActionRedirectIds : '[data-np-bulk-redirect-ids]',
2484
- hiddenItemCount : '[data-np-hidden-count]',
2485
- hiddenItemCountParent : '[data-np-hidden-count-parent]',
2486
- bulkEditForm : '[data-np-bulk-edit-form]', // The primary bulk edit form
2487
- bulkEditTitles : '[data-np-bulk-titles]', // Titles to perform bulk edits on (includes hidden ids),
2488
- bulkEditRemoveItem : '[data-np-remove-bulk-item]', // Remove an item from bulk edit
2489
- bulkEditCancel : '[data-np-cancel-bulk-edit]', // Cancel button in bulk edit form
2490
- bulkEditLinkCount : '[data-bulk-edit-link-count]', // Count of selected links in bulk edit
2491
-
2492
- // Quick Edit
2493
- quickEditOverlay : '.np-inline-overlay', // The inline modal
2494
- quickEditLoadingIndicator : '.np-qe-loading', // Loading indicator in Quick Edit
2495
- quickEditErrorDiv : '.np-quickedit-error', // Error Div in Quick Edit
2496
- quickEditCancel : '.np-cancel-quickedit', // Cancel button in quick edit
2497
-
2498
- // Quick Edit - Links
2499
- quickEditButtonLink : '.np-quick-edit-redirect', // Button to open link quick edit
2500
- quickEditLinkForm : '.quick-edit-form-redirect', // Form for link quick edits
2501
- quickEditLinkSaveButton : '.np-save-quickedit-redirect', // Save button in link quick edit form
2502
-
2503
- // Quick Edit - Posts
2504
- quickEditOpen : '.np-quick-edit', // Button to open post quick edit
2505
- quickEditPostForm : '.quick-edit-form', // Form container
2506
- quickEditSaveButton : '.np-save-quickedit', // Save button in quick edit (posts)
2507
-
2508
- // Link Items
2509
- openLinkModal : '.open-redirect-modal', // Opens new link modal
2510
- linkModal : 'np-link-modal', // The add a link modal
2511
- saveLink : '.np-save-link', // Save Link Button
2512
- linkLoadingIndicator : '.np-link-loading', // Loading Indicator in Link Modal
2513
- linkErrorDiv : '.np-new-link-error', // Error Div in Link Modal
2514
- linkForm : '.np-new-link-form', // The form element for a new link
2515
-
2516
- // Link Deletion
2517
- linkDeleteButton : '[data-np-confirm-delete]',
2518
- linkDeleteConfirmationButton : '[data-delete-confirmation]',
2519
- linkDeleteConfirmationModal : 'np-delete-confirmation-modal',
2520
- linkDeleteConfirmationModalText : '[data-np-link-delete-text]',
2521
-
2522
- // New Page Items
2523
- openPageModal : '.open-bulk-modal', // Opens the new page(s) modal
2524
- newPageModal : '#np-bulk-modal', // The modal with the new page form
2525
- newPageFormContainer : '.new-child-form', // The new page form container
2526
- newPageForm : '.np-new-child-form', // The form element
2527
- newPageSubmitButton : '.np-save-newchild', // Submit button in new page form
2528
- newPageTitle : '.add-new-child-row', // Button to add a new page title field to the form
2529
- newPageRemoveTitle : '.np-remove-child', // Button to remove a title field in the form
2530
- addChildButton : '.add-new-child', // Button to add child page(s)
2531
- newChildError : '.np-newchild-error', // Error div in new child quick edit
2532
- cancelNewChildButton : '.np-cancel-newchild', // Cancel button in new child quick edit
2533
- newBeforeButton : 'data-insert-before', // Add new post(s) before a post
2534
- newAfterButton : 'data-insert-after', // Add new post(s) after a post
2535
-
2536
- // Clone
2537
- cloneButton : '.clone-post', // Button to clone a post
2538
- confirmClone : '[data-confirm-clone]', // Button in modal to confirm clone
2539
- cloneModal : 'np-clone-modal', // Modal with clone options
2540
- cloneQuantity : '[data-clone-quantity]', // Quantity to Clone
2541
- cloneStatus : '[data-clone-status]', // Clone Status
2542
- cloneAuthor : '[data-clone-author]', // Clone Author
2543
-
2544
- // Tabs
2545
- tabButtonParent : '[data-np-tabs]', // Tab Parent
2546
- tabButton : '[data-np-tab]', // Tab Link
2547
- tabContent : '[data-np-tab-pane]', // Tab Pane
2548
-
2549
- // Thumbnails
2550
- thumbnailContainer : '.np-thumbnail', // Container for Thumbnail
2551
- thumbnailContainerLink : '.np-thumbnail.link', // Link Thumbnail Container
2552
-
2553
- // Manual Sync Buttons
2554
- manualMenuSync : '[data-np-manual-menu-sync]', // Button for Triggering Manual Menu Sync
2555
- manualOrderSync : '[data-np-manual-order-sync]', // Button for Triggering Manual Order Sync
2556
-
2557
- }
2558
-
2559
-
2560
- // CSS Classes
2561
- NestedPages.cssClasses = {
2562
- noborder : 'no-border'
2563
- }
2564
-
2565
-
2566
- // JS Data
2567
- NestedPages.jsData = {
2568
- ajaxurl : ajaxurl,
2569
- nonce : nestedpages.np_nonce,
2570
- allPostTypes : nestedpages.post_types, // Localized data with all post types
2571
- syncmenu : 'nosync', // Whether to sync the menu
2572
- posttype : '', // current Screen's post type
2573
- nestable : true, // boolean - whether post type is nestable
2574
- sortable : true, // boolean - whether post type is sortable
2575
- hierarchical : true, // boolean - whether post type is hierarchical
2576
- expandText : nestedpages.expand_text, // Expand all button text
2577
- collapseText : nestedpages.collapse_text, // Collapse all button text
2578
- showHiddenText : nestedpages.show_hidden, // Show Hidden Pages Link Text
2579
- hideHiddenText : nestedpages.hide_hidden, // Hide Hidden Pages Link Text
2580
- quickEditText : nestedpages.quick_edit, // Quick Edit Button Text
2581
- hiddenText : nestedpages.hidden, // Localized "Hidden"
2582
- titleText : nestedpages.title, // Localized "Title"
2583
- }
2584
-
2585
-
2586
- // Form Actions
2587
- NestedPages.formActions = {
2588
- syncToggles : 'npnestToggle',
2589
- syncNesting : 'npsort',
2590
- syncMenu : 'npsyncMenu',
2591
- newPage : 'npnewChild',
2592
- newBeforeAfter : 'npnewBeforeAfter',
2593
- quickEditLink : 'npquickEditLink',
2594
- getTaxonomies : 'npgetTaxonomies',
2595
- quickEditPost : 'npquickEdit',
2596
- clonePost : 'npclonePost',
2597
- search : 'npmenuSearch',
2598
- newMenuItem : 'npnewMenuItem',
2599
- manualMenuSync : 'npmanualMenuSync',
2600
- postSearch: 'nppostSearch',
2601
- wpmlTranslations : 'npWpmlTranslations',
2602
- resetSettings : 'npresetSettings',
2603
- resetUserPrefs : 'npresetUserPreferences',
2604
- resetAdminMenuSettings : 'npresetAdminMenuSettings',
2605
- trashWithChildren : 'nptrashWithChildren'
2606
- }
2607
-
2608
-
2609
- /**
2610
- * Primary Nested Pages Class
2611
- */
2612
- NestedPages.Factory = function()
2613
- {
2614
- var plugin = this;
2615
- var $ = jQuery;
2616
-
2617
- plugin.formatter = new NestedPages.Formatter;
2618
- plugin.dropdowns = new NestedPages.Dropdowns;
2619
- plugin.modals = new NestedPages.Modals;
2620
- plugin.checkAll = new NestedPages.CheckAll;
2621
- plugin.bulkActions = new NestedPages.BulkActions;
2622
- plugin.menuToggle = new NestedPages.MenuToggle;
2623
- plugin.pageToggle = new NestedPages.PageToggle;
2624
- plugin.nesting = new NestedPages.Nesting;
2625
- plugin.syncMenuSetting = new NestedPages.SyncMenuSetting;
2626
- plugin.newPage = new NestedPages.NewPost;
2627
- plugin.quickEditLink = new NestedPages.QuickEditLink;
2628
- plugin.quickEditPost = new NestedPages.QuickEditPost;
2629
- plugin.clone = new NestedPages.Clone;
2630
- plugin.tabs = new NestedPages.Tabs;
2631
- plugin.menuLinks = new NestedPages.MenuLinks;
2632
- plugin.hiddenItemCount = new NestedPages.HiddenItemCount;
2633
- plugin.confirmDelete = new NestedPages.ConfirmDelete;
2634
- plugin.manualSync = new NestedPages.ManualSync;
2635
- plugin.postSearch = new NestedPages.PostSearch;
2636
- plugin.postMove = new NestedPages.MovePost;
2637
- plugin.wpml = new NestedPages.Wpml;
2638
- plugin.trashWithChildren = new NestedPages.TrashWithChildren;
2639
-
2640
- plugin.init = function()
2641
- {
2642
- if ( nestedpages.settings_page ) return;
2643
- plugin.bindEvents();
2644
- plugin.setPostType();
2645
- plugin.setMenuSync();
2646
- plugin.setNestable();
2647
- plugin.setSortable();
2648
- plugin.formatter.updateSubMenuToggle();
2649
- plugin.formatter.setBorders();
2650
- plugin.formatter.setNestedMargins();
2651
- plugin.nesting.initializeSortable();
2652
- }
2653
-
2654
-
2655
- plugin.bindEvents = function()
2656
- {
2657
- $(document).on('click', NestedPages.selectors.quickEditOverlay, function(e){
2658
- plugin.formatter.removeQuickEdit();
2659
- plugin.newPage.cancelNewPage();
2660
- });
2661
- $(document).ready(function(){
2662
- plugin.formatter.hideAjaxError();
2663
- plugin.formatter.sizeLinkThumbnails();
2664
- });
2665
- }
2666
-
2667
-
2668
- // Set whether or not post type is nestable
2669
- plugin.setNestable = function()
2670
- {
2671
- var nestable = false;
2672
- $.each(NestedPages.jsData.allPostTypes, function(i, v){
2673
- if ( v.name !== NestedPages.jsData.posttype ) return;
2674
- if ( v.hierarchical === true ) nestable = true;
2675
- if ( v.disable_nesting === true ) nestable = false;
2676
- });
2677
- NestedPages.jsData.nestable = nestable;
2678
- }
2679
-
2680
-
2681
- // Set whether or not post type is sortable
2682
- plugin.setSortable = function()
2683
- {
2684
- var sortable = true;
2685
- $.each(NestedPages.jsData.allPostTypes, function(i, v){
2686
- if ( v.name !== NestedPages.jsData.posttype ) return;
2687
- if ( typeof v.disable_sorting === 'undefined' || v.disable_sorting === '' ) return;
2688
- if ( v.disable_sorting === "true" ) sortable = false;
2689
- });
2690
- NestedPages.jsData.sortable = sortable;
2691
- }
2692
-
2693
-
2694
- // Set the Screen's Post Type
2695
- plugin.setPostType = function()
2696
- {
2697
- NestedPages.jsData.posttype = nestedpages.current_post_type;
2698
- if ( typeof NestedPages.jsData.posttype === 'undefined' || NestedPages.jsData.posttype === '' ){
2699
- NestedPages.jsData.posttype = $(NestedPages.selectors.sortable).attr('id').substring(3);
2700
- }
2701
- NestedPages.jsData.hierarchical = NestedPages.jsData.allPostTypes[NestedPages.jsData.posttype].hierarchical;
2702
- }
2703
-
2704
-
2705
- // Set menu sync
2706
- plugin.setMenuSync = function()
2707
- {
2708
- NestedPages.jsData.syncmenu = ( nestedpages.syncmenu === '1' ) ? 'sync' : 'nosync';
2709
- }
2710
-
2711
-
2712
- return plugin.init();
2713
- }
2714
- var NestedPages = NestedPages || {};
2715
-
2716
- /**
2717
- * Menu Item Selection in Modal Link Form
2718
- * @package Nested Pages
2719
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
2720
- */
2721
- NestedPages.MenuLinks = function()
2722
- {
2723
- var plugin = this;
2724
- var $ = jQuery;
2725
-
2726
- plugin.typeButton = ''; // The Link Type selected button
2727
- plugin.post = ''; // The new post created
2728
-
2729
- plugin.formatter = new NestedPages.Formatter;
2730
-
2731
- plugin.selectors = {
2732
- form : '[data-np-menu-item-form]', // The form element
2733
- typeSelect : '[data-np-menu-selection]', // Link in left column to choose type of link
2734
- accordion : '[data-np-menu-accordion]', // Accordion of objects
2735
- accordionItem : '[data-np-menu-accordion-item]', // Single item in the accordion
2736
- formPlaceholder : '.np-menu-link-object-placeholder', // Placeholder element
2737
- formDetails : '.np-menu-link-details', // Right pane form details
2738
- searchResults : '[data-np-search-result]', // Appended search result rows
2739
- defaultResults : '[data-default-result]', // Default results,
2740
- originalLink : '[data-np-original-link]', // Original Link Preview
2741
- saveButton : '[data-np-save-link]', // The Form Submit Button
2742
- urlInputCont : '[data-np-menu-url-cont]', // Container for URL input (only for custom links)
2743
- errorDiv : '[data-np-error]', // The error notification
2744
- }
2745
-
2746
- plugin.fields = {
2747
- object : '[data-np-menu-object-input]', // The object (ex: post/category/custom)
2748
- objectid : '[data-np-menu-objectid-input]', // ex: term id, post id
2749
- itemType : '[data-np-menu-type-input]', // ex: post_type, taxonomy
2750
- url : '[data-np-menu-url]', // custom url
2751
- navigationLabel : '[data-np-menu-navigation-label]',
2752
- titleAttribute : '[data-np-menu-title-attr]',
2753
- cssClasses : '[data-np-menu-css-classes]',
2754
- npStatus : '[data-np-menu-np-status]',
2755
- linkTarget : '[data-np-menu-link-target]',
2756
- menuTitle : '[data-np-menu-title]',
2757
- parentPostType : '[data-np-menu-parent-post-type]'
2758
- }
2759
-
2760
- plugin.search = new NestedPages.MenuSearch;
2761
-
2762
- plugin.bindEvents = function()
2763
- {
2764
- $(document).on('click', NestedPages.selectors.openLinkModal, function(e){
2765
- e.preventDefault();
2766
- plugin.postParent = $(this).attr('data-parentid');
2767
- $(plugin.selectors.form).find('.parent_id').val($(this).attr('data-parentid'));
2768
- plugin.openModal();
2769
- });
2770
- $(document).on('click', plugin.selectors.accordionItem, function(e){
2771
- e.preventDefault();
2772
- plugin.accordion($(this));
2773
- });
2774
- $(document).on('click', plugin.selectors.typeSelect, function(e){
2775
- e.preventDefault();
2776
- plugin.typeButton = $(this);
2777
- plugin.setLinkType();
2778
- });
2779
- $(document).on('keyup', plugin.fields.navigationLabel, function(){
2780
- plugin.updateTitle();
2781
- });
2782
- $(document).on('click', plugin.selectors.saveButton, function(e){
2783
- e.preventDefault();
2784
- plugin.submitForm();
2785
- });
2786
- $(document).on('keydown', function(e){
2787
- if ( e.keyCode === 27 ) $(document).trigger('close-modal-manual');
2788
- });
2789
- }
2790
-
2791
- // Open the Modal and Clear/Populate hidden fields
2792
- plugin.openModal = function()
2793
- {
2794
- $(NestedPages.selectors.linkErrorDiv).hide();
2795
- $(NestedPages.selectors.linkModal).find('input').val('');
2796
- $(NestedPages.selectors.linkModal).find('.parent_id').val(plugin.postParent);
2797
- plugin.clearForm();
2798
- $(plugin.selectors.accordion).find('ul').hide();
2799
- $(plugin.selectors.typeSelect).removeClass('active');
2800
- $(document).trigger('open-modal-manual', NestedPages.selectors.linkModal);
2801
- }
2802
-
2803
- // Accordion Menu
2804
- plugin.accordion = function(button)
2805
- {
2806
- plugin.clearForm();
2807
- var submenu = $(button).siblings('ul');
2808
- if ( $(submenu).is(':visible') ){
2809
- $(button).removeClass('active');
2810
- $(submenu).slideUp('fast');
2811
- return;
2812
- }
2813
- $(plugin.selectors.accordionItem).removeClass('active');
2814
- $(button).addClass('active');
2815
- $(button).parents(plugin.selectors.accordion).find('ul').slideUp('fast');
2816
- $(submenu).slideDown('fast');
2817
- }
2818
-
2819
- // Set the link type
2820
- plugin.setLinkType = function()
2821
- {
2822
- if ( $(plugin.typeButton).hasClass('active') ){
2823
- plugin.clearForm();
2824
- return;
2825
- }
2826
- if ( $(plugin.typeButton).hasClass('np-custom-link') ){
2827
- $(plugin.selectors.accordionItem).removeClass('active');
2828
- $(plugin.selectors.accordion).find('ul').slideUp('fast');
2829
- }
2830
- $(plugin.selectors.formPlaceholder).hide();
2831
- plugin.populateForm();
2832
- }
2833
-
2834
- // Populate the form
2835
- plugin.populateForm = function()
2836
- {
2837
- $(plugin.selectors.saveButton).show();
2838
- $(plugin.selectors.typeSelect).removeClass('active');
2839
- $(plugin.typeButton).addClass('active');
2840
- $(plugin.fields.menuTitle).text($(plugin.typeButton).text()).val($(plugin.typeButton).text());
2841
- $(plugin.selectors.form).find('h3').find('em').text($(plugin.typeButton).attr('data-np-object-name'));
2842
- if ( $(plugin.typeButton).attr('data-np-permalink') !== "" ){
2843
- $(plugin.selectors.form).find(plugin.selectors.urlInputCont).hide();
2844
- $(plugin.selectors.form).find(plugin.selectors.originalLink).html('<a href="' + $(plugin.typeButton).attr('data-np-permalink') + '">' + $(plugin.typeButton).text() + '</a>');
2845
- $(plugin.selectors.form).find(plugin.selectors.originalLink).parent('.original-link').show();
2846
- } else {
2847
- $(plugin.selectors.form).find(plugin.selectors.urlInputCont).show();
2848
- $(plugin.selectors.form).find(plugin.selectors.originalLink).parent('.original-link').hide();
2849
- }
2850
- $(plugin.fields.object).val($(plugin.typeButton).attr('data-np-menu-object'));
2851
- $(plugin.fields.objectid).val($(plugin.typeButton).attr('data-np-menu-objectid'));
2852
- $(plugin.fields.itemType).val($(plugin.typeButton).attr('data-np-menu-type'));
2853
- $(plugin.selectors.formDetails).show();
2854
- }
2855
-
2856
- // Clear the form
2857
- plugin.clearForm = function()
2858
- {
2859
- $(plugin.selectors.form).find(plugin.selectors.errorDiv).hide();
2860
- $(plugin.selectors.saveButton).hide();
2861
- $(plugin.selectors.formDetails).hide();
2862
- $(plugin.selectors.formPlaceholder).show();
2863
- $(plugin.selectors.form).find('input').not('.parent_id').not('.parent-post-type').val('');
2864
- $(plugin.selectors.form).find(plugin.fields.linkTarget).val('_blank');
2865
- $(plugin.selectors.form).find('input[type="checkbox"]').attr('checked', false);
2866
- $(plugin.selectors.typeSelect).removeClass('active');
2867
- plugin.search.toggleLoading(false);
2868
- $(plugin.selectors.searchResults).remove();
2869
- $(plugin.selectors.defaultResults).show();
2870
- }
2871
-
2872
- // Update the title text
2873
- plugin.updateTitle = function()
2874
- {
2875
- var value = $(plugin.fields.navigationLabel).val();
2876
- var title = $(plugin.selectors.form).find('h3').find('span');
2877
- if ( value !== "" ){
2878
- $(plugin.fields.menuTitle).val(value);
2879
- $(title).text(value);
2880
- } else {
2881
- $(plugin.fields.menuTitle).val($(plugin.typeButton).text());
2882
- $(title).text($(plugin.typeButton).text());
2883
- }
2884
- }
2885
-
2886
- // Submit the Form
2887
- plugin.submitForm = function()
2888
- {
2889
- plugin.toggleLoading(true);
2890
- $.ajax({
2891
- url : NestedPages.jsData.ajaxurl,
2892
- type : 'post',
2893
- data: $(plugin.selectors.form).serialize() + '&action=' + NestedPages.formActions.newMenuItem + '&nonce=' + NestedPages.jsData.nonce + '&post_type=' + NestedPages.jsData.posttype + '&syncmenu=' + NestedPages.jsData.syncmenu,
2894
- success : function(data){
2895
- plugin.toggleLoading(false);
2896
- if ( data.status === 'error' ){
2897
- $(plugin.selectors.form).find(plugin.selectors.errorDiv).text(data.message).show();
2898
- return;
2899
- }
2900
- plugin.post = data.post_data;
2901
- plugin.createRow();
2902
- },
2903
- error : function(data){
2904
- console.log(data);
2905
- }
2906
- });
2907
- }
2908
-
2909
- // Create the nested pages row for the new link
2910
- plugin.createRow = function()
2911
- {
2912
- var html = '<li id="menuItem_' + plugin.post.id + '" class="page-row published';
2913
- html += '">'
2914
-
2915
- html += '<div class="row"><div class="child-toggle"><div class="child-toggle-spacer"></div></div><div class="row-inner">';
2916
- html += '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="np-icon-sub-menu"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M19 15l-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9l6 6z" class="arrow" /></svg>';
2917
- html += '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="handle np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg>';
2918
- html += '<a href="' + plugin.post.np_link_content + '" class="page-link page-title" target="_blank"><span class="title">' + plugin.post.menuTitle + ' <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path class="icon" d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg></span>';
2919
-
2920
- // Quick Edit Button
2921
- html += '</a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ';
2922
- html += 'data-id="' + plugin.post.id + '"';
2923
- html += 'data-parentid="' + plugin.post.parent_id + '"';
2924
- html += 'data-title="' + plugin.post.menuTitle + '" ';
2925
- html += 'data-url="' + plugin.post.url + '" ';
2926
- html += 'data-status="publish" ';
2927
- html += 'data-np-status="show" ';
2928
- html += 'data-navstatus="show" ';
2929
- html += 'data-navcss="' + plugin.post.cssClasses + '" ';
2930
- html += 'data-navtitleattr="' + plugin.post.titleAttribute + '" ';
2931
- html += 'data-nav-type="' + plugin.post.menuType + '" ';
2932
- html += 'data-nav-object="' + plugin.post.objectType + '" ';
2933
- html += 'data-nav-object-id="' + plugin.post.objectId + '" ';
2934
- html += 'data-nav-original-link="' + plugin.post.original_link + '" ';
2935
- html += 'data-nav-original-title="' + plugin.post.original_title + '" ';
2936
- html += 'data-linktarget="' + plugin.post.link_target + '">';
2937
- html += NestedPages.jsData.quickEditText;
2938
- html += '</a>';
2939
-
2940
- // Delete Link
2941
- html += '<a href="' + plugin.post.delete_link + '" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>';
2942
-
2943
- html += '</div></div></div></li>';
2944
-
2945
- if ( plugin.post.parent_id === "0" ){
2946
- $('.nplist:first li:first').after(html);
2947
- } else {
2948
- plugin.appendChildRow(html);
2949
- }
2950
-
2951
- $(document).trigger('close-modal-manual');
2952
-
2953
- plugin.row = $('#menuItem_' + plugin.post.id).find('.row');
2954
- plugin.formatter.flashRow(plugin.row);
2955
- }
2956
-
2957
- // Append a new child link to the appropriate menu
2958
- plugin.appendChildRow = function(html)
2959
- {
2960
- var parent_row = $('#menuItem_' + plugin.post.parent_id);
2961
- if ( $(parent_row).children('ol').length === 0 ){
2962
- html = '<ol class="sortable nplist" style="display:block;">' + html + '</ol>';
2963
- $(parent_row).append(html);
2964
- } else {
2965
- $(parent_row).find('ol:first').prepend(html);
2966
- }
2967
- plugin.formatter.updateSubMenuToggle();
2968
- }
2969
-
2970
- // Toggle Loading
2971
- plugin.toggleLoading = function(loading)
2972
- {
2973
- if ( loading ){
2974
- $(plugin.selectors.form).find(plugin.selectors.errorDiv).hide();
2975
- $(plugin.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).show();
2976
- $(plugin.selectors.saveButton).attr('disabled', 'disabled');
2977
- return;
2978
- }
2979
- $(plugin.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).hide();
2980
- $(plugin.selectors.saveButton).attr('disabled', false);
2981
- }
2982
-
2983
- return plugin.bindEvents();
2984
- }
2985
- var NestedPages = NestedPages || {};
2986
-
2987
- /**
2988
- * Menu Item Search in Modal Link Form
2989
- * @package Nested Pages
2990
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
2991
- */
2992
- NestedPages.MenuSearch = function()
2993
- {
2994
- var plugin = this;
2995
- var $ = jQuery;
2996
-
2997
- plugin.selectors = {
2998
- searchForms : '*[data-np-menu-search]', // Search form selector
2999
- defaultResults : '[data-default-result]', // Default results list items
3000
- loadingIndicator : '.np-menu-search-loading', // loading indicator
3001
- noResults : '.np-menu-search-noresults', // No results
3002
- searchType : 'data-search-type', // The search object type (post_type, taxonomy)
3003
- searchObject : 'data-search-object', // The object to search (post, category, etc)
3004
- searchResults : '[data-np-search-result]', // Appended search result rows
3005
- }
3006
-
3007
- plugin.activeForm = ''; // The active form
3008
- plugin.results = ''; // Search results
3009
- plugin.defaultResults = ''; // The default, loaded results
3010
- plugin.searchType = ''; // The type of search (post_type, taxonomy)
3011
- plugin.searchObject = ''; // The object being searched (post, category, post_tag, etc…)
3012
-
3013
- plugin.init = function()
3014
- {
3015
- plugin.bindEvents();
3016
- }
3017
-
3018
- plugin.bindEvents = function()
3019
- {
3020
- $(document).on('keyup', plugin.selectors.searchForms, function(){
3021
- plugin.activeForm = $(this);
3022
- $(plugin.selectors.searchResults).remove();
3023
- plugin.performSearch();
3024
- });
3025
- }
3026
-
3027
-
3028
- // Perform the search
3029
- plugin.performSearch = function()
3030
- {
3031
- plugin.defaultResults = $(plugin.activeForm).parent('li').siblings(plugin.selectors.defaultResults);
3032
- if ( $(plugin.activeForm).val().length > 2 ){
3033
- $(plugin.defaultResults).hide();
3034
- plugin.toggleLoading(true);
3035
- plugin.query();
3036
- return;
3037
- }
3038
- plugin.toggleLoading(false);
3039
- $(plugin.defaultResults).show();
3040
- }
3041
-
3042
-
3043
- // Query Search
3044
- plugin.query = function()
3045
- {
3046
- plugin.searchType = $(plugin.activeForm).attr(plugin.selectors.searchType);
3047
- plugin.searchObject = $(plugin.activeForm).attr(plugin.selectors.searchObject);
3048
- $.ajax({
3049
- url: NestedPages.jsData.ajaxurl,
3050
- type: 'post',
3051
- datatype: 'json',
3052
- data: {
3053
- action : NestedPages.formActions.search,
3054
- nonce : NestedPages.jsData.nonce,
3055
- term : $(plugin.activeForm).val(),
3056
- searchType : plugin.searchType,
3057
- searchObject : plugin.searchObject,
3058
- },
3059
- success: function(data){
3060
- console.log(data);
3061
- if ( data.results ){
3062
- plugin.results = data.results;
3063
- plugin.toggleLoading(false);
3064
- if ( plugin.searchType === 'post_type' ){
3065
- plugin.appendPosts();
3066
- } else {
3067
- plugin.appendTaxonomies();
3068
- }
3069
- } else {
3070
- plugin.toggleLoading(false);
3071
- $(plugin.activeForm).siblings(plugin.selectors.noResults).show();
3072
- }
3073
- }
3074
- });
3075
- }
3076
-
3077
-
3078
- // Append post type results
3079
- plugin.appendPosts = function()
3080
- {
3081
- var html = "";
3082
- $.each(plugin.results, function(i, v){
3083
- html += '<li data-np-search-result><a href="#" data-np-menu-object="' + plugin.searchObject + '" data-np-menu-type="post_type" data-np-menu-objectid="' + v.ID + '" data-np-permalink="' + v.permalink + '" data-np-object-name="' + v.singular_name + '" data-np-menu-selection>' + v.post_title + '</a></li>';
3084
- });
3085
- $(html).insertAfter($(plugin.activeForm).parent('li'));
3086
- plugin.toggleLoading(false);
3087
- }
3088
-
3089
-
3090
- // Append taxonomy results
3091
- plugin.appendTaxonomies = function()
3092
- {
3093
- var html = "";
3094
- $.each(plugin.results, function(i, v){
3095
- html += '<li data-np-search-result><a href="#" data-np-menu-object="' + plugin.searchObject + '" data-np-menu-type="post_type" data-np-menu-objectid="' + v.term_id + '" data-np-permalink="' + v.permalink + '" data-np-object-name="' + v.taxonomy + '" data-np-menu-selection>' + v.name + '</a></li>';
3096
- });
3097
- $(html).insertAfter($(plugin.activeForm).parent('li'));
3098
- plugin.toggleLoading(false);
3099
- }
3100
-
3101
-
3102
- // Toggle the loading indicator
3103
- plugin.toggleLoading = function(loading)
3104
- {
3105
- var loadingIndicator = $(plugin.activeForm).siblings(plugin.selectors.loadingIndicator);
3106
- $(plugin.selectors.noResults).hide();
3107
- if ( loading ){
3108
- $(loadingIndicator).show();
3109
- return;
3110
- }
3111
- $(loadingIndicator).hide();
3112
- }
3113
-
3114
- return plugin.init();
3115
- }
3116
- /**
3117
- * Empty Trash Functionality
3118
- * @package Nested Pages
3119
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
3120
- */
3121
- jQuery(document).ready(function(){
3122
- new NestedPagesTrash;
3123
- });
3124
-
3125
- var NestedPagesTrash = function()
3126
- {
3127
- var plugin = this;
3128
- var $ = jQuery;
3129
-
3130
- // DOM Selectors
3131
- plugin.trashButton = '.np-empty-trash'; // Trash Link
3132
- plugin.confirmButton = '.np-trash-confirm'; // Confirm button in modal
3133
- plugin.warningModal = '#np-trash-modal'; // Modal with empty confirmation
3134
- plugin.errorAlert = '#np-error'; // Alert Error Notification
3135
- plugin.loadingIndicator = '#nested-loading'; // Loading Indication
3136
- plugin.trashLinks = '.np-trash-links';
3137
- plugin.postType = $('#np-trash-posttype').val();
3138
-
3139
- // JS Data
3140
- plugin.nonce = nestedpages.np_nonce;
3141
- plugin.formAction = 'npEmptyTrash';
3142
-
3143
- plugin.bindEvents = function(){
3144
- $(document).on('click', plugin.confirmButton, function(e){
3145
- e.preventDefault();
3146
- plugin.confirmEmpty();
3147
- });
3148
- }
3149
-
3150
- // Confirm Trash Empty
3151
- plugin.confirmEmpty = function(){
3152
- plugin.loading(true);
3153
- $(document).trigger('close-modal-manual');
3154
- $(plugin.errorAlert).hide();
3155
- plugin.emptyTrash();
3156
- }
3157
-
3158
- // Empty the Trash
3159
- plugin.emptyTrash = function(){
3160
- $.ajax({
3161
- url: ajaxurl,
3162
- type: 'post',
3163
- datatype: 'json',
3164
- data: {
3165
- action : plugin.formAction,
3166
- nonce : plugin.nonce,
3167
- posttype : plugin.postType
3168
- },
3169
- success: function(data){
3170
- plugin.loading(false);
3171
- if (data.status === 'error'){
3172
- $(plugin.errorAlert).text(data.message).show();
3173
- } else {
3174
- $(plugin.trashLinks).hide();
3175
- $('.notice-dismiss').click();
3176
- }
3177
- }
3178
- });
3179
- }
3180
-
3181
- // Loading Indication
3182
- plugin.loading = function(loading){
3183
- if ( loading ){
3184
- $(plugin.loadingIndicator).show();
3185
- return;
3186
- }
3187
- $(plugin.loadingIndicator).hide();
3188
- }
3189
-
3190
- return plugin.bindEvents();
3191
- }
3192
- var NestedPages = NestedPages || {};
3193
-
3194
- /**
3195
- * Confirm deletion of links
3196
- * @package Nested Pages
3197
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
3198
- */
3199
- NestedPages.ConfirmDelete = function()
3200
- {
3201
- var plugin = this;
3202
- var $ = jQuery;
3203
-
3204
- // JS Data
3205
- plugin.deleteLink = ''; // Link for deleting the item
3206
-
3207
- plugin.bindEvents = function()
3208
- {
3209
- $(document).on('click', NestedPages.selectors.linkDeleteButton, function(e){
3210
- e.preventDefault();
3211
- plugin.confirmSingle($(this));
3212
- });
3213
- $(document).on('click', NestedPages.selectors.linkDeleteConfirmationButton, function(e){
3214
- e.preventDefault();
3215
- if ( !$(this).hasClass('bulk') ){
3216
- plugin.deleteSingle();
3217
- return;
3218
- }
3219
- plugin.deleteMultiple();
3220
- });
3221
- $(document).on('submit', NestedPages.selectors.bulkActionsForm, function(e){
3222
- plugin.confirmMultiple(e);
3223
- });
3224
- }
3225
-
3226
- // Confirm a single link deletion
3227
- plugin.confirmSingle = function(button)
3228
- {
3229
- plugin.deleteLink = $(button).attr('href');
3230
- $(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation_singular);
3231
- $(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.delete).removeClass('bulk');
3232
- $(document).trigger('open-modal-manual', NestedPages.selectors.linkDeleteConfirmationModal);
3233
- }
3234
-
3235
- // Confirm Multiple link deletion
3236
- plugin.confirmMultiple = function(event)
3237
- {
3238
- if ( $('select[name="np_bulk_action"]').val() !== 'trash' ) return;
3239
- var linkCount = $(NestedPages.selectors.bulkActionRedirectIds).val();
3240
- if ( linkCount === '' ) return;
3241
- event.preventDefault();
3242
- $(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation);
3243
- $(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.trash_delete_links).addClass('bulk');
3244
- $(document).trigger('open-modal-manual', [NestedPages.selectors.linkDeleteConfirmationModal]);
3245
- }
3246
-
3247
- // Submit the form to delete multiple
3248
- plugin.deleteMultiple = function()
3249
- {
3250
- $(NestedPages.selectors.bulkActionsForm)[0].submit();
3251
- }
3252
-
3253
- // Delete the single
3254
- plugin.deleteSingle = function()
3255
- {
3256
- window.location.replace(plugin.deleteLink);
3257
- }
3258
-
3259
- return plugin.bindEvents();
3260
- }
3261
-
3262
- var NestedPages = NestedPages || {};
3263
-
3264
- /**
3265
- * Manual Sync functionality for nested view
3266
- * @package Nested Pages
3267
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
3268
- */
3269
- NestedPages.ManualSync = function()
3270
- {
3271
- var plugin = this;
3272
- var $ = jQuery;
3273
-
3274
- plugin.activeBtn = '';
3275
-
3276
- plugin.bindEvents = function()
3277
- {
3278
- $(document).on('click', NestedPages.selectors.manualMenuSync, function(e){
3279
- e.preventDefault();
3280
- plugin.activeBtn = $(this);
3281
- plugin.syncMenu();
3282
- });
3283
- $(document).on('click', NestedPages.selectors.manualOrderSync, function(e){
3284
- e.preventDefault();
3285
- plugin.activeBtn = $(this);
3286
- plugin.syncOrder();
3287
- });
3288
- }
3289
-
3290
- plugin.syncMenu = function()
3291
- {
3292
- plugin.loading(true);
3293
-
3294
- $.ajax({
3295
- url: ajaxurl,
3296
- type: 'post',
3297
- datatype: 'json',
3298
- data: {
3299
- action : NestedPages.formActions.manualMenuSync,
3300
- nonce : NestedPages.jsData.nonce,
3301
- post_type : NestedPages.jsData.posttype,
3302
- syncmenu : 'sync'
3303
- },
3304
- success: function(data){
3305
- if (data.status === 'error'){
3306
- $(NestedPages.selectors.errorDiv).text(data.message).show();
3307
- $(NestedPages.selectors.loadingIndicator).hide();
3308
- } else {
3309
- plugin.loading(false);
3310
- }
3311
- }
3312
- });
3313
- }
3314
-
3315
- plugin.syncOrder = function()
3316
- {
3317
- plugin.loading(true);
3318
- var nestingClass = new NestedPages.Nesting;
3319
- nestingClass.syncNesting(true, plugin.loading(false));
3320
- }
3321
-
3322
- plugin.loading = function(loading)
3323
- {
3324
- if ( loading ){
3325
- $(plugin.activeBtn).addClass('disabled');
3326
- $(NestedPages.selectors.loadingIndicator).show();
3327
- return;
3328
- }
3329
- $(plugin.activeBtn).removeClass('disabled');
3330
- $(NestedPages.selectors.loadingIndicator).hide();
3331
- }
3332
-
3333
- return plugin.bindEvents();
3334
- }
3335
- var NestedPages = NestedPages || {};
3336
-
3337
- /**
3338
- * Perform an AJAX search for posts by type
3339
- * @package Nested Pages
3340
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
3341
- */
3342
- NestedPages.PostSearch = function()
3343
- {
3344
- var plugin = this;
3345
- var $ = jQuery;
3346
-
3347
- plugin.selectors = {
3348
- input : 'data-nestedpages-post-search',
3349
- form : 'data-nestedpages-post-search-form',
3350
- loadingIndicator : 'data-nestedpages-loading',
3351
- noResults : 'data-nestedpages-no-results',
3352
- results: 'data-nestedpages-search-results'
3353
- }
3354
-
3355
- plugin.changed = false;
3356
- plugin.activeInput = ''; // The active input
3357
- plugin.results = ''; // Search results
3358
- plugin.defaultResults = ''; // The default, loaded results
3359
- plugin.postType = ''; // The type of search (post_type, taxonomy)
3360
- plugin.activeForm = '';
3361
-
3362
- plugin.bindEvents = function()
3363
- {
3364
- $('['+ plugin.selectors.input + ']').on('input', function(){
3365
- plugin.activeInput = $(this);
3366
- plugin.setOptions();
3367
- if ( !plugin.changed ) plugin.setDefaultResults();
3368
- if ( $(this).val() === '' ) {
3369
- $(plugin.activeForm).find('[' + plugin.selectors.noResults + ']').hide();
3370
- plugin.showDefaultResults();
3371
- return;
3372
- }
3373
- plugin.query();
3374
- });
3375
- }
3376
-
3377
- /**
3378
- * Set the default results
3379
- */
3380
- plugin.setDefaultResults = function()
3381
- {
3382
- plugin.defaultResults = $(plugin.activeForm).find('[' + plugin.selectors.results + ']').html();
3383
- plugin.changed = true;
3384
- }
3385
-
3386
- /**
3387
- * Show the default results
3388
- */
3389
- plugin.showDefaultResults = function()
3390
- {
3391
- $(plugin.activeForm).find('[' + plugin.selectors.results + ']').html(plugin.defaultResults);
3392
- }
3393
-
3394
- /**
3395
- * Set the options
3396
- */
3397
- plugin.setOptions = function()
3398
- {
3399
- plugin.postType = $(plugin.activeInput).attr(plugin.selectors.input);
3400
- plugin.activeForm = $(plugin.activeInput).parents('[' + plugin.selectors.form + ']');
3401
- }
3402
-
3403
- // Perform the search
3404
- plugin.performSearch = function()
3405
- {
3406
- plugin.defaultResults = $(plugin.activeForm).parent('li').siblings(plugin.selectors.defaultResults);
3407
- if ( $(plugin.activeForm).val().length > 2 ){
3408
- $(plugin.defaultResults).hide();
3409
- plugin.toggleLoading(true);
3410
- plugin.query();
3411
- return;
3412
- }
3413
- plugin.toggleLoading(false);
3414
- $(plugin.defaultResults).show();
3415
- }
3416
-
3417
-
3418
- // Query Search
3419
- plugin.query = function()
3420
- {
3421
- $(plugin.activeForm).find('[' + plugin.selectors.results + ']').empty();
3422
- plugin.toggleLoading(true);
3423
- $.ajax({
3424
- url: NestedPages.jsData.ajaxurl,
3425
- type: 'post',
3426
- datatype: 'json',
3427
- data: {
3428
- action : NestedPages.formActions.postSearch,
3429
- nonce : NestedPages.jsData.nonce,
3430
- term : $(plugin.activeInput).val(),
3431
- postType : plugin.postType
3432
- },
3433
- success: function(data){
3434
- if ( data.results ){
3435
- plugin.results = data.results;
3436
- plugin.loadResults();
3437
- plugin.toggleLoading(false);
3438
- } else {
3439
- plugin.toggleLoading(false);
3440
- $(plugin.activeForm).find('[' + plugin.selectors.noResults + ']').show();
3441
- }
3442
- }
3443
- });
3444
- }
3445
-
3446
- // Load the results into view
3447
- plugin.loadResults = function()
3448
- {
3449
- var html = "<ul>";
3450
- $.each(plugin.results, function(i, v){
3451
- html += '<li><a href="#" data-assignment-page-id="' + v.ID + '" data-assignment-page-title="' + v.post_title + '">' + v.post_title + '</a></li>';
3452
- });
3453
- html += '</ul>';
3454
- $(plugin.activeForm).find('[' + plugin.selectors.results + ']').html(html);
3455
- plugin.toggleLoading(false);
3456
- }
3457
-
3458
- // Toggle the loading indicator
3459
- plugin.toggleLoading = function(loading)
3460
- {
3461
- var loadingIndicator = $(plugin.activeForm).find('[' + plugin.selectors.loadingIndicator + ']');
3462
- var noResults = $(plugin.activeForm).find('[' + plugin.selectors.noResults + ']');
3463
- $(noResults).hide();
3464
- if ( loading ){
3465
- $(loadingIndicator).show();
3466
- return;
3467
- }
3468
- $(loadingIndicator).hide();
3469
- }
3470
-
3471
- return plugin.bindEvents();
3472
- }
3473
- var NestedPages = NestedPages || {};
3474
-
3475
- /**
3476
- * Move a Post Up or Down in the list
3477
- * @package Nested Pages
3478
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
3479
- */
3480
- NestedPages.MovePost = function()
3481
- {
3482
- var plugin = this;
3483
- var $ = jQuery;
3484
-
3485
- plugin.formatter = new NestedPages.Formatter;
3486
- plugin.nesting = new NestedPages.Nesting;
3487
- plugin.activeRow;
3488
-
3489
- plugin.selectors = {
3490
- moveToTop : 'data-push-to-top',
3491
- moveToBottom : 'data-push-to-bottom'
3492
- }
3493
-
3494
- plugin.bindEvents = function()
3495
- {
3496
- $(document).ready(function(){
3497
- plugin.disableTopOnFirst();
3498
- plugin.disableBottomOnLast();
3499
- });
3500
- $(document).on('click', '[' + plugin.selectors.moveToTop + ']', function(e){
3501
- e.preventDefault();
3502
- if ( $(this).hasClass('disabled') ) return;
3503
- plugin.activeRow = $(this).closest(NestedPages.selectors.rows);
3504
- plugin.moveToTop();
3505
- });
3506
- $(document).on('click', '[' + plugin.selectors.moveToBottom + ']', function(e){
3507
- e.preventDefault();
3508
- if ( $(this).hasClass('disabled') ) return;
3509
- plugin.activeRow = $(this).closest(NestedPages.selectors.rows);
3510
- plugin.moveToBottom();
3511
- });
3512
- }
3513
-
3514
- /**
3515
- * Move a post to the top of its list
3516
- */
3517
- plugin.moveToTop = function()
3518
- {
3519
- var parent = $(plugin.activeRow).parent(NestedPages.selectors.lists);
3520
- var first = $(parent).find(NestedPages.selectors.rows).first();
3521
- $(plugin.activeRow).insertBefore(first);
3522
- plugin.formatter.setBorders();
3523
- $(document).click(); // Close Dropdowns
3524
- plugin.nesting.syncNesting();
3525
- plugin.disableTopOnFirst();
3526
- plugin.disableBottomOnLast();
3527
- }
3528
-
3529
- /**
3530
- * Move a post to the bottom of its list
3531
- */
3532
- plugin.moveToBottom = function()
3533
- {
3534
- var parent = $(plugin.activeRow).parent(NestedPages.selectors.lists);
3535
- var last = $(parent).children(NestedPages.selectors.rows).last();
3536
- $(plugin.activeRow).insertAfter(last);
3537
- plugin.formatter.setBorders();
3538
- $(document).click(); // Close Dropdowns
3539
- plugin.nesting.syncNesting();
3540
- plugin.disableTopOnFirst();
3541
- plugin.disableBottomOnLast();
3542
- }
3543
-
3544
- plugin.disableTopOnFirst = function()
3545
- {
3546
- var lists = $(NestedPages.selectors.lists);
3547
- $.each(lists, function(){
3548
- $(this).find('[' + plugin.selectors.moveToTop + ']').removeClass('disabled');
3549
- var first = $(this).find(NestedPages.selectors.rows).first();
3550
- $(first).find('[' + plugin.selectors.moveToTop + ']').addClass('disabled');
3551
- });
3552
- }
3553
-
3554
- plugin.disableBottomOnLast = function()
3555
- {
3556
- var lists = $(NestedPages.selectors.lists);
3557
- $.each(lists, function(){
3558
- $(this).find('[' + plugin.selectors.moveToBottom + ']').removeClass('disabled');
3559
- var last = $(this).find(NestedPages.selectors.rows).last();
3560
- $(last).find('[' + plugin.selectors.moveToBottom + ']').addClass('disabled');
3561
- });
3562
- }
3563
-
3564
- return plugin.bindEvents();
3565
- }
3566
- var NestedPages = NestedPages || {};
3567
-
3568
- /**
3569
- * Trash post with all children
3570
- * @package Nested Pages
3571
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
3572
- */
3573
- NestedPages.TrashWithChildren = function()
3574
- {
3575
- var plugin = this;
3576
- var $ = jQuery;
3577
-
3578
- plugin.post_id = ''; // The parent/source post ID
3579
-
3580
- plugin.bindEvents = function()
3581
- {
3582
- $(document).on('click', NestedPages.selectors.trashWithChildrenButton, function(e){
3583
- e.preventDefault();
3584
- plugin.post_id = $(this).attr('data-post-id');
3585
- plugin.trash();
3586
- });
3587
- }
3588
-
3589
- // Trash the posts
3590
- plugin.trash = function()
3591
- {
3592
- $.ajax({
3593
- url : NestedPages.jsData.ajaxurl,
3594
- type : 'post',
3595
- data : {
3596
- action : NestedPages.formActions.trashWithChildren,
3597
- nonce : NestedPages.jsData.nonce,
3598
- post_id : plugin.post_id,
3599
- screen : nestedpages.current_page
3600
- },
3601
- success : function(data){
3602
- window.location.replace(data.redirect);
3603
- }, error : function(data){
3604
- console.log(data);
3605
- }
3606
- });
3607
- }
3608
-
3609
- return plugin.bindEvents();
3610
- }
3611
- var NestedPages = NestedPages || {};
3612
-
3613
- /**
3614
- * WPML functionality
3615
- * @package Nested Pages
3616
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
3617
- */
3618
- NestedPages.Wpml = function()
3619
- {
3620
- var plugin = this;
3621
- var $ = jQuery;
3622
-
3623
- plugin.button = null; // The quick edit button with all the data-attributes for the post
3624
- plugin.postData = null; // Object containing post data
3625
- plugin.modal = null; // The modal element
3626
- plugin.parent_li = null; // The post's nested pages list element
3627
- plugin.formatter = new NestedPages.Formatter;
3628
-
3629
- plugin.selectors = {
3630
- translationsBtn : 'data-nestedpages-translations',
3631
- modal : 'data-np-wpml-translations-modal',
3632
- title : 'data-wmpl-translation-title',
3633
- table : 'data-np-wpml-translations-modal-table'
3634
- }
3635
-
3636
- plugin.bindEvents = function()
3637
- {
3638
- if ( !nestedpages.wpml ) return;
3639
- $(document).on('click', '[' + plugin.selectors.translationsBtn + ']', function(e){
3640
- e.preventDefault();
3641
- plugin.createTranslationsModal($(this));
3642
- });
3643
- }
3644
-
3645
- /**
3646
- * Create the translations modal
3647
- */
3648
- plugin.createTranslationsModal = function(button)
3649
- {
3650
- plugin.parent_li = $(button).parents('.action-buttons').closest(NestedPages.selectors.row).parent('li');
3651
- plugin.button = $(plugin.parent_li).find(NestedPages.selectors.quickEditOpen);
3652
- plugin.postData = {
3653
- id : $(plugin.button).attr('data-id'),
3654
- title : $(plugin.button).attr('data-title'),
3655
- slug : $(plugin.button).attr('data-slug')
3656
- }
3657
- plugin.modal = $('[' + plugin.selectors.modal + ']').clone();
3658
-
3659
- if ( $(plugin.parent_li).children('ol').length > 0 ){
3660
- var child_ol = $(plugin.parent_li).children('ol');
3661
- $(plugin.modal).insertBefore(child_ol);
3662
- } else {
3663
- $(plugin.modal).appendTo(plugin.parent_li);
3664
- }
3665
- $(plugin.modal).find('[' + plugin.selectors.title + ']').text(plugin.postData.title);
3666
- plugin.formatter.showQuickEdit();
3667
- $(plugin.modal).show();
3668
- plugin.getTranslationData();
3669
- }
3670
-
3671
- /**
3672
- * Get the Translation Data for the Post
3673
- */
3674
- plugin.getTranslationData = function()
3675
- {
3676
- $.ajax({
3677
- url: NestedPages.jsData.ajaxurl,
3678
- type: 'post',
3679
- datatype: 'json',
3680
- data : {
3681
- action : NestedPages.formActions.wpmlTranslations,
3682
- post_id : plugin.postData.id,
3683
- nonce : NestedPages.jsData.nonce
3684
- },
3685
- success: function(data){
3686
- console.log(data);
3687
- console.log(plugin.postData.id);
3688
- if ( data.status === 'success' ){
3689
- plugin.populateModal(data.translations);
3690
- } else {
3691
- $(plugin.modal).find(NestedPages.selectors.quickEditErrorDiv).text(data.message).show();
3692
- plugin.toggleLoading(false);
3693
- }
3694
- }
3695
- });
3696
- }
3697
-
3698
- /**
3699
- * Open the Modal
3700
- */
3701
- plugin.populateModal = function(translations)
3702
- {
3703
- var html = '<tbody>';
3704
- $.each(translations, function(i, v){
3705
- var translation = translations[i];
3706
- html += '<tr>';
3707
- html += '<td><img src="' + translation.country_flag_url + '" alt="' + translation.translated_name + '" /> ' + translation.translated_name + '</td>';
3708
- html += '<td>';
3709
- if ( translation.has_translation && translation.edit_link ){
3710
- html += '<a href="' + translation.edit_link + '">' + translation.translation.post_title + ' (' + nestedpages.edit + ')</a>';
3711
- } else {
3712
- html += '<a href="' + translation.add_link + '" class="np-btn">+ ' + nestedpages.add_translation + '</a>';
3713
- }
3714
- html += '</td>';
3715
- html += '</tr>';
3716
- });
3717
- html += '</tbody>';
3718
- $(plugin.modal).find('[' + plugin.selectors.table + ']').html(html);
3719
- plugin.toggleLoading(false);
3720
- }
3721
-
3722
- /**
3723
- * Toggle the Loading State
3724
- */
3725
- plugin.toggleLoading = function(loading)
3726
- {
3727
- if ( loading ){
3728
- $(plugin.modal).addClass('loading');
3729
- return;
3730
- }
3731
- $(plugin.modal).removeClass('loading');
3732
- }
3733
-
3734
-
3735
- return plugin.bindEvents();
3736
- }
1
+ var NestedPages=NestedPages||{};NestedPages.Formatter=function(){var s=this,i=jQuery;s.updateSubMenuToggle=function(){for(var e=i(NestedPages.selectors.childToggle),t=0;t<e.length;t++){var a,s=e[t],n=i(s).parent(".row").parent("li");0<i(n).children("ol").length?i(n).children("ol").find("li.page-row").length<1?i(n).children("ol").hide():(a='<div class="child-toggle-spacer"></div>',a+='<a href="#"',0<i(n).children("ol:visible").length&&(a+=' class="open"'),a+='><span class="np-icon-arrow"></span></a>',i(s).html(a),0<i(n).children("ol").children(".np-hide").length&&0===i(n).children("ol").children(".np-hide.shown").length?i(s).find("a").hide():0<i(n).children("ol").children(".np-hide").length&&0<i(n).children("ol").children(".np-hide.shown").length&&i(s).find("a").show()):i(s).empty().html('<div class="child-toggle-spacer"></div>')}},s.setBorders=function(){i(NestedPages.selectors.rows).removeClass(NestedPages.cssClasses.noborder),i.each(i(NestedPages.selectors.lists),function(){i(this).find(".page-row:visible:first").addClass(NestedPages.cssClasses.noborder)})},s.setNestedMargins=function(){s.setIndent()},s.setIndent=function(){var n="1"===nestedpages.non_indent?20:30,o="1"===nestedpages.non_indent?".row-inner":".child-toggle";i.each(i(NestedPages.selectors.lists),function(e,t){var a=i(this).parents(NestedPages.selectors.lists).length,s=0;NestedPages.jsData.sortable||(s=10),0<a?(s=a*n+s,i(this).find(o).css("padding-left",s+"px")):NestedPages.jsData.sortable&&!i(this).hasClass("no-sort")?i(this).find(".row-inner").css("padding-left","0px"):i(this).find(".row-inner").css("padding-left","10px")})},s.setClassicIndent=function(){i.each(i(NestedPages.selectors.lists),function(e,t){var a=i(this).parents(NestedPages.selectors.lists).length,s=0;NestedPages.jsData.sortable||(s=10),0<a?(s=20*a+s,i(this).find(".row-inner").css("padding-left",s+"px")):NestedPages.jsData.sortable&&!i(this).hasClass("no-sort")?i(this).find(".row-inner").css("padding-left","0px"):i(this).find(".row-inner").css("padding-left","10px")})},s.updatePlaceholderWidth=function(e){var t,a;NestedPages.jsData.nestable&&(t=40*i(e.placeholder).parents("ol").length-40,a=i(NestedPages.selectors.sortable).width()-t,i(e.placeholder).width(a).css("margin-left",t+"px")),s.updateListVisibility(e)},s.updateListVisibility=function(e){e=i(e.placeholder).parent("ol");i(e).is(":visible")||(i(e).addClass("nplist"),i(e).show())},s.removeQuickEdit=function(){i(NestedPages.selectors.quickEditOverlay).removeClass("active").remove(),i(".sortable .quick-edit").remove(),i(".row").show()},s.showQuickEdit=function(){i("body").append('<div class="np-inline-overlay"></div>'),setTimeout(function(){i(".np-inline-overlay").addClass("active")},50)},s.flashRow=function(e){i(e).addClass("np-updated"),s.setBorders(),setTimeout(function(){i(e).addClass("np-updated-show")},1500)},s.showAjaxError=function(e){i(NestedPages.selectors.ajaxError).find("p").text(e),i(NestedPages.selectors.ajaxError).show()},s.hideAjaxError=function(e){i(NestedPages.selectors.ajaxError).hide()},s.sizeLinkThumbnails=function(){var e=i(NestedPages.selectors.thumbnailContainer).not(NestedPages.selectors.thumbnailContainerLink).first().find("img"),t=i(e).width(),a=i(e).height();i.each(i(NestedPages.selectors.thumbnailContainerLink),function(){i(this).width(t),i(this).height(a)})}},(NestedPages=NestedPages||{}).Dropdowns=function(){var t=this,a=jQuery;return t.dropdown="",t.activeBtn="",t.activeContent="",t.toggleBtn="[data-dropdown-toggle]",t.dropdownContainer="[data-dropdown]",t.dropdownContent="[data-dropdown-content]",t.selectors={caret_up:"icon-arrow_drop_up",caret_down:"icon-arrow_drop_down"},t.bindEvents=function(){a(document).on("click",t.toggleBtn,function(e){e.preventDefault(),t.activeBtn=a(this),t.dropdown=a(this).parents(t.dropdownContainer),t.toggleDropdown()}),a(document).on("click",function(e){t.closeDropdowns(e.target)}),a(document).on("dropdown-opened",function(e,t){0<a(t).parents(NestedPages.selectors.row).length&&a(t).parents(NestedPages.selectors.row).addClass("active")}),a(document).on("dropdown-closed",function(){a(NestedPages.selectors.row).removeClass("active")})},t.toggleDropdown=function(){a("."+t.selectors.caret_up).attr("class",t.selectors.caret_down);var e=a(t.dropdown).find(t.dropdownContent);if(t.activeContent=e,a(e).hasClass("active"))return a(e).removeClass("active"),a(t.activeBtn).removeClass("active"),a(t.activeBtn).find("."+t.selectors.caret_up).attr("class",t.selectors.caret_down),void a(document).trigger("dropdown-closed",e);t.setPositioning(),a(t.toggleBtn).removeClass("active"),a(t.dropdownContent).removeClass("active"),a(e).addClass("active"),a(t.activeBtn).find("."+t.selectors.caret_down).attr("class",t.selectors.caret_up),a(t.activeBtn).addClass("active"),a(document).trigger("dropdown-opened",e)},t.setPositioning=function(){var e=a(t.activeBtn).outerHeight();a(t.activeContent).css("top",e+"px")},t.closeDropdowns=function(e){0===a(e).parents(t.dropdownContainer).length&&(a(t.dropdownContent).removeClass("active"),a(t.toggleBtn).removeClass("active"),a(t.activeBtn).find("."+t.selectors.caret_up).attr("class",t.selectors.caret_down),a(document).trigger("dropdown-closed",void 0))},t.bindEvents()},(NestedPages=NestedPages||{}).Modals=function(){var a=this,s=jQuery;return a.activeBtn="",a.activeModal="",a.modalOpen=!1,a.selectors={toggleBtn:"[data-nestedpages-modal-toggle]",backdrop:"[data-nestedpages-modal-backdrop]",closeBtn:"[data-nestedpages-modal-close]",title:"data-nestedpages-modal-title",content:"data-nestedpages-modal-content"},a.bindEvents=function(){s(document).on("click",a.selectors.toggleBtn,function(e){e.preventDefault(),a.activeBtn=s(this),a.openModal()}),s(document).on("click",a.selectors.closeBtn,function(e){e.preventDefault(),a.closeModals()}),s(document).on("open-modal-manual",function(e,t){a.activeModal=s('[data-nestedpages-modal="'+t+'"]'),a.openModal()}),s(document).on("close-modal-manual",function(e){a.closeModals()}),s(document).on("click",a.selectors.backdrop,function(e){a.closeModals()}),s(document).ready(function(){a.checkHash()})},a.openModal=function(){var e;a.modalOpen?a.closeModals():(0<s(a.activeBtn).length&&(e=s(a.activeBtn).attr("data-nestedpages-modal-toggle"),a.activeModal=s('*[data-nestedpages-modal="'+e+'"]')),s(a.activeModal).addClass("active"),a.modalOpen=!0,a.populateModal(),s(document).trigger("open-modal",[a.activeBtn,a.activeModal]))},a.closeModals=function(){a.modalOpen=!1,s("[data-nestedpages-modal]").removeClass("active"),a.activeModal="",a.activeBtn=""},a.populateModal=function(){var e=s(a.activeBtn).attr(a.selectors.title);void 0!==e&&""!==e&&s(a.activeModal).find("[data-nestedpages-modal-title]").text(e);e=s(a.activeBtn).attr(a.selectors.content);void 0!==e&&""!==e&&s(a.activeModal).find("[data-nestedpages-modal-content]").html(e)},a.checkHash=function(){var e;window.location.hash&&"#modal"===window.location.hash.substring(0,6)&&(e=window.location.hash.substring(7),a.activeModal=s('*[data-nestedpages-modal="'+e+'"]'),a.openModal())},a.bindEvents()},(NestedPages=NestedPages||{}).CheckAll=function(){var a=this,s=jQuery;return a.activeCheckbox="",a.selectors={checkbox:"[data-np-check-all]"},a.bindEvents=function(){s(document).on("change",a.selectors.checkbox,function(){a.activeCheckbox=s(this),a.toggleCheckboxes()}),s(document).on("change","input[type=checkbox]",function(){a.checkAllStatus(s(this))})},a.init=function(){a.bindEvents()},a.toggleCheckboxes=function(){var t=!!s(a.activeCheckbox).is(":checked"),e=s(a.activeCheckbox).attr("data-np-check-all"),e=s('*[name="'+e+'"]');s.each(e,function(){var e=s(this).parents(NestedPages.selectors.rows);s(this).prop("checked",t),s(e).hasClass("np-hide")&&!s(e).is(":visible")&&s(e).find(NestedPages.selectors.bulkActionsCheckbox).prop("checked",!1)}),a.toggleCheckAll()},a.toggleCheckAll=function(){var e=s(a.activeCheckbox).attr("data-np-check-all"),t=(t=s('*[name="'+e+'"]').length)-s(".np-hide").find(NestedPages.selectors.bulkActionsCheckbox).length+s(".np-hide:visible").find(NestedPages.selectors.bulkActionsCheckbox).length,e=s('*[name="'+e+'"]:checked').length;if(t==e)return s(a.activeCheckbox).prop("checked",!0),void s(a.activeCheckbox).removeClass("check-all-partial");0<e?s(a.activeCheckbox).addClass("check-all-partial"):(s(a.activeCheckbox).attr("checked",!1),s(a.activeCheckbox).removeClass("check-all-partial"))},a.checkAllStatus=function(e){e=s(e).attr("name"),e=s('*[data-np-check-all="'+e+'"]');0!==e.length&&(a.activeCheckbox=s(e)[0],a.toggleCheckAll())},a.init()},(NestedPages=NestedPages||{}).BulkActions=function(){var n=this,o=jQuery;return n.selectedNumber=0,n.selectedLinks=[],n.selectedPosts=[],n.bindEvents=function(){o(document).on("change",NestedPages.selectors.bulkActionsCheckbox,function(){n.toggleBulkForm()}),o(document).on("submit",NestedPages.selectors.bulkActionsForm,function(e){"edit"===o("select[name=np_bulk_action]").val()&&(e.preventDefault(),n.toggleBulkEdit(!0))}),o(document).on("click",NestedPages.selectors.bulkEditRemoveItem,function(e){e.preventDefault();e=o(this).siblings("input[type=hidden]").val();n.uncheckBulkItem(e)}),o(document).on("click",NestedPages.selectors.bulkEditCancel,function(e){e.preventDefault(),n.uncheckAllBulkItems()})},n.toggleBulkForm=function(){var t=!1,a="",s="";if(n.selectedPosts=[],n.selectedLinks=[],o.each(o(NestedPages.selectors.bulkActionsCheckbox),function(){var e;o(this).is(":checked")&&(e=o(this).parents(NestedPages.selectors.rows),t=!0,o(this).parent("div").hasClass("np-check-all")||o(e).hasClass("post-type-np-redirect")||(a+=o(this).val()+","),o(e).hasClass("post-type-np-redirect")&&(s+=o(this).val()+",",n.selectedLinks.push(o(this).val())),"np-redirect"===o(this).attr("data-np-post-type")||o(this).parent("div").hasClass("np-check-all")||((e=[]).title=o(this).attr("data-np-bulk-checkbox"),e.id=o(this).val(),n.selectedPosts.push(e)))}),n.setBulkEditPosts(),n.toggleEditOption(),n.toggleLinkCountAlert(),t)return o(NestedPages.selectors.bulkActionsForm).show(),o(NestedPages.selectors.bulkActionsIds).val(a),o(NestedPages.selectors.bulkActionRedirectIds).val(s),void n.setSelectedNumber();o(NestedPages.selectors.bulkActionsIds).val(""),o(NestedPages.selectors.bulkActionsForm).hide()},n.setBulkEditPosts=function(){for(var e="",t=0;t<n.selectedPosts.length;t++)e+='<li><a href="#" class="np-remove" data-np-remove-bulk-item>&times;</a>',e+=n.selectedPosts[t].title,e+='<input type="hidden" name="post_ids[]" value="'+n.selectedPosts[t].id+'"></li>';o(NestedPages.selectors.bulkEditTitles).html(e)},n.uncheckBulkItem=function(e){o.each(o(NestedPages.selectors.bulkActionsCheckbox),function(){o(this).val()==e&&o(this).prop("checked",!1).change()}),0===o(NestedPages.selectors.bulkEditRemoveItem).length&&n.toggleBulkEdit(!1)},n.uncheckAllBulkItems=function(){o.each(o(NestedPages.selectors.bulkActionsCheckbox),function(){o(this).prop("checked",!1).change()}),n.toggleBulkEdit(!1)},n.setSelectedNumber=function(){var e=o(NestedPages.selectors.bulkActionsCheckbox+":checked").not(".np-check-all input").length,t=o(NestedPages.selectors.bulkActionsForm).find("select option").first();o(t).text(nestedpages.bulk_actions+" ("+e+")")},n.toggleEditOption=function(){var e=o(NestedPages.selectors.bulkActionsCheckbox+":checked").not(".np-check-all input").not(".np-redirect-bulk").length,t=o(NestedPages.selectors.bulkActionsForm).find("select option[value=edit]");if(0===e)return o(t).prop("disabled",!0),o(NestedPages.selectors.bulkActionsForm).find("select option").first().prop("selected",!0),void n.toggleBulkEdit(!1);o(t).prop("disabled",!1)},n.toggleBulkEdit=function(e){if(n.toggleLinkCountAlert(),e)return n.disableParentOptions(),o(NestedPages.selectors.bulkEditForm).show(),o(NestedPages.selectors.bulkActionsForm).hide(),void n.setWPSuggest();o(NestedPages.selectors.bulkEditForm).hide(),o(NestedPages.selectors.bulkActionsForm).show(),o(NestedPages.selectors.bulkEditLinkCount).parent("div").hide(),o(NestedPages.selectors.bulkActionsForm).find("select option").first().text(nestedpages.bulk_actions),n.resetBulkEditFields()},n.toggleLinkCountAlert=function(){0!==n.selectedLinks.length?o(NestedPages.selectors.bulkEditLinkCount).parent("div").show():o(NestedPages.selectors.bulkEditLinkCount).parent("div").hide()},n.disableParentOptions=function(){for(var e=o(NestedPages.selectors.bulkEditForm).find("select[name=post_parent]"),t=0;t<n.selectedPosts.length;t++)o(e).find("option[value="+n.selectedPosts[t].id+"]").attr("disabled",!0)},n.setWPSuggest=function(){var e=o(NestedPages.selectors.bulkEditForm).find("[data-autotag]");o.each(e,function(e,t){var a=o(this).attr("data-taxonomy");o(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+a,{multiple:!0,multipleSep:","})})},n.resetBulkEditFields=function(){var e=o(NestedPages.selectors.bulkEditForm).find("select");o.each(e,function(){o(this).find("option").first().prop("selected",!0),o(this).find("option").removeAttr("disabled")});e=o(NestedPages.selectors.bulkEditForm).find(".cat-checklist");o.each(e,function(){o(this).find("input[type=checkbox]").prop("checked",!1)})},n.bindEvents()},(NestedPages=NestedPages||{}).HiddenItemCount=function(){var e=this,a=jQuery;return e.init=function(){e.bindEvents()},e.bindEvents=function(){a(document).on("change",NestedPages.selectors.bulkActionsCheckbox,function(){e.toggleHiddenCount()}),a(document).on("click",NestedPages.selectors.toggleAll,function(){e.toggleHiddenCount()}),a(document).on("click",NestedPages.selectors.pageToggle,function(){e.toggleHiddenCount()})},e.toggleHiddenCount=function(){var t=0;a.each(a(NestedPages.selectors.bulkActionsCheckbox),function(){var e;a(this).is(":checked")&&(a(this).parent("div").hasClass("np-check-all")||(e=a(this).closest(".page-row"),a(e).is(":visible")||t++))}),t<1?a(NestedPages.selectors.hiddenItemCountParent).hide():(a(NestedPages.selectors.hiddenItemCount).text(t),a(NestedPages.selectors.hiddenItemCountParent).show())},e.init()},(NestedPages=NestedPages||{}).MenuToggle=function(){var a=this,n=jQuery;return a.formatter=new NestedPages.Formatter,a.bindEvents=function(){n(document).on("click",NestedPages.selectors.childToggleLink,function(e){e.preventDefault(),a.toggleSingleMenu(n(this))}),n(document).on("click",NestedPages.selectors.toggleAll,function(e){e.preventDefault(),a.toggleAllMenus()})},a.toggleSingleMenu=function(e){var t=n(e).parent(NestedPages.selectors.childToggle).parent(NestedPages.selectors.row).siblings("ol");n(e).toggleClass("open"),n(t).toggle(),a.formatter.setBorders(),a.formatter.setNestedMargins(),a.syncUserToggles()},a.toggleAllMenus=function(){var e=NestedPages.selectors.toggleAll;if("closed"===n(e).attr("data-toggle"))return n(NestedPages.selectors.lists).show(),n(e).attr("data-toggle","opened").text(NestedPages.jsData.collapseText),n(NestedPages.selectors.childToggle+" a").addClass("open"),a.formatter.setBorders(),void a.syncUserToggles();n(NestedPages.selectors.lists).not(n(NestedPages.selectors.lists)[0]).hide(),n(e).attr("data-toggle","closed").text(NestedPages.jsData.expandText),n(NestedPages.selectors.childToggle+" a").removeClass("open"),a.formatter.setBorders(),a.syncUserToggles()},a.visibleRowIDs=function(){var s=[],e=n(NestedPages.selectors.rows+":visible");return n.each(e,function(e,t){var a=n(this).attr("id");s.push(a.replace("menuItem_",""))}),s},a.syncUserToggles=function(){n.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.syncToggles,nonce:NestedPages.jsData.nonce,ids:a.visibleRowIDs(),posttype:NestedPages.jsData.posttype},success:function(e){"success"!==e.status&&console.log("There was an error saving toggled pages.")}})},a.bindEvents()},(NestedPages=NestedPages||{}).PageToggle=function(){var a=this,s=jQuery;return a.activeButton="",a.formatter=new NestedPages.Formatter,a.init=function(){a.bindEvents()},a.bindEvents=function(){s(document).on("click",NestedPages.selectors.toggleHidden,function(e){e.preventDefault(),a.activeButton=s(this),a.toggleHidden()}),s(document).on("click",NestedPages.selectors.toggleStatus,function(e){e.preventDefault(),a.toggleStatus(s(this))})},a.toggleHidden=function(){var e=s(a.activeButton),t=s(e).attr("href");if("#show"==t)return s(e).attr("href","#hide").text(NestedPages.jsData.showHiddenText),s(NestedPages.selectors.hiddenRows).removeClass("shown").hide(),a.formatter.updateSubMenuToggle(),void a.formatter.setBorders();"#hide"==t&&(s(e).attr("href","#show").text(NestedPages.jsData.hideHiddenText),s(NestedPages.selectors.hiddenRows).addClass("shown").show(),a.formatter.updateSubMenuToggle(),a.formatter.setBorders())},a.toggleStatus=function(e){var t=(t=s(e).attr("href")).substring(1);s(NestedPages.selectors.syncCheckbox).attr("disabled",!1),s(NestedPages.selectors.toggleStatus).removeClass("active"),s(e).addClass("active"),"draft"==t&&(s(NestedPages.selectors.syncCheckbox).attr("disabled",!0),s("."+t).addClass("nested-visible")),"all"!=t?(s(NestedPages.selectors.rows).hide(),s("."+t).show()):s(NestedPages.selectors.rows).show()},a.init()},(NestedPages=NestedPages||{}).Nesting=function(){var n=this,o=jQuery;n.formatter=new NestedPages.Formatter,n.initializeSortable=function(){if(!NestedPages.jsData.nestable)return n.initializeSortableFlat();o(NestedPages.selectors.sortable).not(NestedPages.selectors.notSortable).nestedSortable({items:NestedPages.selectors.rows,toleranceElement:"> .row",handle:NestedPages.selectors.handle,placeholder:"ui-sortable-placeholder",tabSize:56,isAllowed:function(e,t,a){return!(o(t).hasClass("post-type-np-redirect")&&!o(a).hasClass("post-type-np-redirect"))},start:function(e,t){t.placeholder.height(t.item.height())},sort:function(e,t){n.formatter.updatePlaceholderWidth(t)},stop:function(e,t){setTimeout(function(){n.formatter.updateSubMenuToggle(),n.formatter.setBorders(),n.formatter.setNestedMargins()},100),n.syncNesting()}})},n.initializeSortableFlat=function(){var e=o(NestedPages.selectors.lists).not(NestedPages.selectors.notSortable);o.each(e,function(){o(this).sortable({items:">"+NestedPages.selectors.rows,handle:NestedPages.selectors.handle,placeholder:"ui-sortable-placeholder",forcePlaceholderSize:!0,start:function(e,t){t.placeholder.height(t.item.height())},sort:function(e,t){n.formatter.updatePlaceholderWidth(t)},stop:function(e,t){setTimeout(function(){n.formatter.updateSubMenuToggle(),n.formatter.setBorders(),n.formatter.setNestedMargins()},100),n.syncNesting()}})})},n.disableNesting=function(){o(NestedPages.selectors.sortable).sortable("destroy")},n.syncNesting=function(e,t){var a,s;"1"===nestedpages.manual_order_sync&&!e||(o(NestedPages.selectors.errorDiv).hide(),o(NestedPages.selectors.loadingIndicator).show(),s=!!o(NestedPages.selectors.lists).first().hasClass("filtered"),a=NestedPages.jsData.nestable&&!s?o(NestedPages.selectors.sortable).nestedSortable("toHierarchy",{startDepthCount:0}):n.setNestingArray(),n.disableNesting(),e=NestedPages.jsData.syncmenu,"1"===nestedpages.manual_menu_sync&&(e="nosync"),o.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.syncNesting,nonce:NestedPages.jsData.nonce,list:a,post_type:NestedPages.jsData.posttype,syncmenu:e,filtered:s},success:function(e,t){n.initializeSortable(),"error"===e.status?(o(NestedPages.selectors.errorDiv).text(e.message).show(),o(NestedPages.selectors.loadingIndicator).hide()):t&&"function"==typeof t?t():o(NestedPages.selectors.loadingIndicator).hide()}}))},n.setNestingArray=function(e){return ret=[],o(NestedPages.selectors.lists).first().children("li.page-row").each(function(){var e=n.recursiveNesting(this);ret.push(e)}),ret},n.recursiveNesting=function(e){var t,a=o(e).attr("id");if(a)return a=a.replace("menuItem_",""),t={id:a},0<o(e).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).length&&(t.children=[],o(e).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).each(function(){var e=n.recursiveNesting(this);t.children.push(e)})),t}},(NestedPages=NestedPages||{}).SyncMenuSetting=function(){var t=this,e=jQuery;return t.formatter=new NestedPages.Formatter,t.init=function(){t.bindEvents()},t.bindEvents=function(){e(document).ready(function(){"1"!==nestedpages.manual_menu_sync&&"1"===nestedpages.syncmenu&&t.syncSetting()}),e(document).on("change",NestedPages.selectors.syncCheckbox,function(){t.syncSetting()})},t.syncSetting=function(){"page"===NestedPages.jsData.posttype&&0!==e(NestedPages.selectors.syncCheckbox).length&&(NestedPages.jsData.syncmenu=e(NestedPages.selectors.syncCheckbox).is(":checked")?"sync":"nosync",e.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.syncMenu,nonce:NestedPages.jsData.nonce,post_type:NestedPages.jsData.posttype,syncmenu:NestedPages.jsData.syncmenu},success:function(e){"error"===e.status&&t.formatter.showAjaxError(e.message)},error:function(e){console.log(e)}}))},t.bindEvents()},(NestedPages=NestedPages||{}).NewPost=function(){var r=this,d=jQuery;return r.formatter=new NestedPages.Formatter,r.parent_id=0,r.posts="",r.form="",r.bindEvents=function(){d(document).on("open-modal",function(e,t,a){t=d(t).attr("data-nestedpages-modal-toggle");void 0!==t&&"np-bulk-modal"==t&&r.openModal()}),d(document).on("submit",NestedPages.selectors.newPageForm,function(e){e.preventDefault()}),d(document).on("click",NestedPages.selectors.newPageSubmitButton,function(e){e.preventDefault(),r.submitForm(d(this))}),d(document).on("click",NestedPages.selectors.newPageTitle,function(e){e.preventDefault(),r.addTitleField(d(this))}),d(document).on("click",NestedPages.selectors.newPageRemoveTitle,function(e){e.preventDefault(),r.removeTitleField(d(this))}),d(document).on("click",NestedPages.selectors.addChildButton,function(e){e.preventDefault(),r.openQuickEdit(d(this))}),d(document).on("click",NestedPages.selectors.cancelNewChildButton,function(e){e.preventDefault(),r.cancelNewPage()}),d(document).on("click","["+NestedPages.selectors.newBeforeButton+"]",function(e){e.preventDefault(),r.openQuickEdit(d(this))}),d(document).on("click","["+NestedPages.selectors.newAfterButton+"]",function(e){e.preventDefault(),r.openQuickEdit(d(this))}),d(document).on("keydown",function(e){27===e.keyCode&&(r.cancelNewPage(),d(document).click())})},r.openModal=function(){var e=d(NestedPages.selectors.newPageFormContainer).clone().find(NestedPages.selectors.newPageForm);d(e).addClass("in-modal"),d(NestedPages.selectors.newPageModal).find(".modal-body").html(e),d(NestedPages.selectors.newPageModal).find("h3").text(nestedpages.add_multiple),d(NestedPages.selectors.newPageModal).find(".page_parent_id").val(r.parent_id),d(e).find(".np_title").first().focus(),d(e).find(NestedPages.selectors.newPageTitle).first().prop("tabindex","2")},r.openQuickEdit=function(e){var t,a=void 0!==(a=d(e).attr(NestedPages.selectors.newBeforeButton))&&""!==a&&a,s=void 0!==(s=d(e).attr(NestedPages.selectors.newAfterButton))&&""!==s&&s,n=d(e).closest(NestedPages.selectors.row).parent("li"),o=d(NestedPages.selectors.newPageFormContainer).clone();0<d(n).children("ol").length?(t=d(n).children("ol"),d(o).insertBefore(t)):d(o).appendTo(n),d(o).siblings(NestedPages.selectors.row).hide(),r.formatter.showQuickEdit(),d(o).find(".parent_name").html("<em>Parent:</em> "+d(e).attr("data-parentname")),a||s||d(o).find(".page_parent_id").val(d(e).attr("data-id")),a&&(d(o).find(".page_before_id").val(a),d(o).find("[data-new-post-relation-title]").text(nestedpages.insert_before+": "+d(e).attr("data-parentname"))),s&&(d(o).find(".page_after_id").val(s),d(o).find("[data-new-post-relation-title]").text(nestedpages.insert_after+": "+d(e).attr("data-parentname"))),d(o).show(),d(o).find(".np_title").focus(),d(o).find(NestedPages.selectors.newPageTitle).prop("tabindex","2")},r.cancelNewPage=function(){r.formatter.removeQuickEdit(),d(NestedPages.selectors.newChildError).hide(),d(NestedPages.selectors.newPageModal).find(".modal-body").empty(),d(NestedPages.selectors.sortable).find(".new-child").remove(),d(NestedPages.selectors.row).show()},r.addTitleField=function(e){var t=d(e).parents("form"),a=d(e).siblings(".new-page-titles").children("li").length+1,s='<li><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="handle np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg><div class="form-control new-child-row"><label>'+NestedPages.jsData.titleText+'</label><div><input type="text" name="post_title[]" class="np_title" placeholder="'+NestedPages.jsData.titleText+'" value="" tabindex="'+a+'" /><a href="#" class="button-secondary np-remove-child">-</a></div></div></li>';d(e).siblings(".new-page-titles").append(s);d(t).find(".np_title").last().focus(),d(t).find(NestedPages.selectors.newPageTitle).prop("tabindex",+a),d(".new-page-titles").sortable({items:"li",handle:".handle"}),r.toggleAddEditButton(t)},r.removeTitleField=function(e){var t=d(e).parents("form");d(e).parents(".new-child-row").parent("li").remove(),r.toggleAddEditButton(t)},r.submitForm=function(e){r.toggleLoading(!0),r.form=d(e).parents("form");var t=!!d(e).hasClass("add-edit"),e=NestedPages.formActions.newPage;""!==d(r.form).find(".page_before_id").val()&&(e=NestedPages.formActions.newBeforeAfter),""!==d(r.form).find(".page_after_id").val()&&(e=NestedPages.formActions.newBeforeAfter),d.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:d(r.form).serialize()+"&action="+e+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(e){if("error"===e.status)return r.toggleLoading(!1),void d(r.form).find(NestedPages.selectors.quickEditErrorDiv).text(e.message).show();!0!=t?(r.toggleLoading(!1),r.posts=e.new_pages,r.addPosts()):(e=(e=e.new_pages[0].edit_link).replace(/&amp;/g,"&"),window.location.replace(e))},error:function(e){console.log(e),r.toggleLoading(!1),d(r.form).find(NestedPages.selectors.quickEditErrorDiv).text("The form could not be saved at this time.").show()}})},r.addPosts=function(){var e,t=""!==(t=d(r.form).find(".page_before_id").val())&&t,a=""!==(a=d(r.form).find(".page_after_id").val())&&a,s=d(r.form).parent(".new-child").parent(".page-row");for(0!==d(s).children("ol").length||t||a||d(s).append('<ol class="nplist"></ol>'),e=d(r.form).hasClass("in-modal")?d(".nplist.sortable li.page-row:first"):d(s).children("ol"),i=0;i<r.posts.length;i++)r.appendRows(e,r.posts[i],t,a);t||a||d(e).show(),r.formatter.updateSubMenuToggle(),r.formatter.setNestedMargins(),r.cancelNewPage(),d(document).trigger("close-modal-manual")},r.appendRows=function(e,t,a,s){var n,o='<li id="menuItem_'+t.id+'" class="page-row';"publish"===t.status&&(o+=" published"),o+='">',NestedPages.jsData.hierarchical?(o+='<div class="row">',o+='<div class="child-toggle"></div>'):(o+='<div class="row non-hierarchical">',o+='<div class="non-hierarchical-spacer"></div>'),o+='<div class="row-inner">',o+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="np-icon-sub-menu"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M19 15l-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9l6 6z" class="arrow" /></svg>',o+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="handle np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg>',o+='<a href="'+t.edit_link+'" class="page-link page-title">',o+='<span class="title">'+t.title+"</span>","Publish"!==t.status?o+='<span class="status">('+t.status+")</span>":o+='<span class="status"></span>',o+='<span class="nav-status">',"hide"===t.np_nav_status&&(o+=" "+nestedpages.hidden),o+="</span>",o+='<span class="edit-indicator">Edit</span>',o+="</a>",NestedPages.jsData.hierarchical||(o+='<div class="np-post-columns">',o+='<ul class="np-post-info">',o+='<li><span class="np-author-display">'+t.author_formatted+"</span></li>",o+="<li>"+t.date_formatted+"</li>",o+="</ul>",o+="</div>"),d(".nplist").first().hasClass("has-yoast")&&(o+='<span class="np-seo-indicator na"></span>'),o+='<div class="action-buttons">',o+='<div class="nestedpages-dropdown" data-dropdown><a href="#" class="np-btn has-icon toggle" data-dropdown-toggle><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></a><ul class="nestedpages-dropdown-content" data-dropdown-content>',o+='<li><a href="#" class="open-redirect-modal" data-parentid="'+t.id+'"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>'+nestedpages.add_link+"</a></li>",o+='<li><a href="#" class="add-new-child" data-id="'+t.id+'" data-parentname="'+t.title+'"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zM3 8v8l4-4-4-4zm8 9h10v-2H11v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'+nestedpages.add_child_short+"</a></li>",o+="</ul></div>",o+='<a href="#" class="np-btn np-quick-edit" data-id="'+t.id+'" data-template="'+t.page_template+'" data-title="'+t.title+'" data-slug="'+t.slug+'" data-commentstatus="closed" data-status="'+t.status.toLowerCase()+'" data-np-status="show"\tdata-navstatus="show" data-author="'+t.author+'" data-template="'+t.template+'" data-month="'+t.month+'" data-day="'+t.day+'" data-year="'+t.year+'" data-hour="'+t.hour+'" data-minute="'+t.minute+'" data-datepicker="'+t.datepicker+'" data-time="'+t.time+'" data-formattedtime="'+t.formattedtime+'" data-ampm="'+t.ampm+'">'+nestedpages.quick_edit+"</a>",o+='<a href="'+t.view_link+'" class="np-btn" target="_blank">'+nestedpages.view+"</a>",o+='<a href="'+t.delete_link+'" class="np-btn np-btn-trash"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="np-icon-remove"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" class="icon"/><path d="M0 0h24v24H0z" fill="none"/></svg></a>',o+="</div>\x3c!-- .action-buttons --\x3e",o+="</div>\x3c!-- .row-inner --\x3e</div>\x3c!-- .row --\x3e",o+="</li>",a?(n=r.findRowById(a),d(o).insertBefore(n)):s?(n=r.findRowById(s),d(o).insertAfter(n)):d(e).append(o)},r.findRowById=function(e){return d(NestedPages.selectors.rows+"#menuItem_"+e)},r.toggleAddEditButton=function(e){e=d(e).find(".np_title").length;e<1?d(NestedPages.selectors.newPageSubmitButton).hide():(d(NestedPages.selectors.newPageSubmitButton).show(),1<e?d(NestedPages.selectors.newPageSubmitButton+".add-edit").hide():d(NestedPages.selectors.newPageSubmitButton+".add-edit").show())},r.toggleLoading=function(e){if(e)return d(NestedPages.selectors.quickEditErrorDiv).hide(),d(NestedPages.selectors.newPageSubmitButton).attr("disabled","disabled"),void d(NestedPages.selectors.quickEditLoadingIndicator).show();d(NestedPages.selectors.newPageSubmitButton).attr("disabled",!1),d(NestedPages.selectors.quickEditLoadingIndicator).hide()},r.bindEvents()},(NestedPages=NestedPages||{}).QuickEditPost=function(){var r=this,d=jQuery;return r.formatter=new NestedPages.Formatter,r.button="",r.initialData="",r.parent_li="",r.form="",r.flatTerms="",r.termNames="",r.saveButton="",r.newData="",r.row="",r.bindEvents=function(){d(document).on("click",NestedPages.selectors.quickEditOpen,function(e){e.preventDefault(),r.button=d(this),r.openForm()}),d(document).on("click",NestedPages.selectors.quickEditCancel,function(e){e.preventDefault(),r.formatter.removeQuickEdit()}),d(document).on("change",".keep_private",function(){this.checked?d(".post_password").val("").prop("readonly",!0):d(".post_password").prop("readonly",!1)}),d(document).on("click",NestedPages.selectors.quickEditSaveButton,function(e){e.preventDefault(),r.saveButton=d(this),r.save()}),d(document).on("keydown",function(e){27===e.keyCode&&r.formatter.removeQuickEdit()})},r.openForm=function(){r.setInitialData(),r.createForm(),r.populateForm(),r.populateFlatTaxonomies()},r.setInitialData=function(){r.initialData={id:d(r.button).attr("data-id"),title:d(r.button).attr("data-title"),slug:d(r.button).attr("data-slug"),author:d(r.button).attr("data-author"),cs:d(r.button).attr("data-commentstatus"),status:d(r.button).attr("data-status"),template:d(r.button).attr("data-template"),month:d(r.button).attr("data-month"),day:d(r.button).attr("data-day"),year:d(r.button).attr("data-year"),hour:d(r.button).attr("data-hour"),minute:d(r.button).attr("data-minute"),navstatus:d(r.button).attr("data-navstatus"),npstatus:d(r.button).attr("data-np-status"),navtitle:d(r.button).attr("data-navtitle"),navtitleattr:d(r.button).attr("data-navtitleattr"),navcss:d(r.button).attr("data-navcss"),linktarget:d(r.button).attr("data-linktarget"),password:d(r.button).attr("data-password"),datepicker:d(r.button).attr("data-datepicker"),time:d(r.button).attr("data-formattedtime"),timeTwentyFour:d(r.button).attr("data-time"),ampm:d(r.button).attr("data-ampm"),timeFormat:d(r.button).attr("data-timeformat"),sticky:d(r.button).attr("data-sticky")};var e=d(r.button)[0].attributes;d.each(e,function(e,t){t.name.includes("data-npcustom")&&(r.initialData[t.name]=t.value)}),r.initialData.h_taxonomies=[],r.initialData.f_taxonomies=[],r.parent_li=d(r.button).closest(NestedPages.selectors.row).parent("li");var t=d(r.parent_li).attr("class").split(/\s+/);for(i=0;i<t.length;i++)"in-"===t[i].substring(0,3)&&r.initialData.h_taxonomies.push(t[i]),"inf-"===t[i].substring(0,4)&&r.initialData.f_taxonomies.push(t[i])},r.createForm=function(){var e;r.form=d(NestedPages.selectors.quickEditPostForm).clone(),0<d(r.parent_li).children("ol").length?(e=d(r.parent_li).children("ol"),d(r.form).insertBefore(e)):d(r.form).appendTo(r.parent_li),d(r.form).siblings(NestedPages.selectors.row).hide(),d(r.form).show()},r.populateForm=function(){for(var e in d(r.form).find(".page_id").html("<em>ID:</em> "+r.initialData.id),d(r.form).find(".np_id").val(r.initialData.id),d(r.form).find(".np_title").val(r.initialData.title),d(r.form).find(".np_slug").val(r.initialData.slug),d(r.form).find(".np_author select").val(r.initialData.author),d(r.form).find(".np_status").val(r.initialData.status),d(r.form).find(".np_nav_title").val(r.initialData.navtitle),d(r.form).find(".np_title_attribute").val(r.initialData.navtitleattr),d(r.form).find(".np_nav_css_classes").val(r.initialData.navcss),d(r.form).find(".post_password").val(r.initialData.password),d(r.form).find(".np_publish_date").val(r.initialData.datepicker),"open"===r.initialData.cs&&d(r.form).find(".np_cs").attr("checked","checked"),""!==r.initialData.template?d(r.form).find(".np_template").val(r.initialData.template):d(r.form).find(".np_template").val("default"),"private"===r.initialData.status&&(d(r.form).find(".post_password").attr("readonly",!0),d(r.form).find(".keep_private").attr("checked",!0)),"hide"===r.initialData.npstatus?d(r.form).find(".nested_pages_status").attr("checked","checked"):d(r.form).find(".nested_pages_status").removeAttr("checked"),"hide"===r.initialData.navstatus?d(r.form).find(".np_nav_status").attr("checked","checked"):d(r.form).find(".np_nav_status").attr("checked",!1),"_blank"===r.initialData.linktarget?d(r.form).find(".link_target").attr("checked","checked"):d(r.form).find(".link_target").attr("checked",!1),"private"===r.initialData.status&&d(r.form).find(".np_status").val("publish"),"sticky"===r.initialData.sticky?d(r.form).find(".np-sticky").attr("checked","checked"):d(r.form).find(".np-sticky").removeAttr("checked"),"H:i"===r.initialData.timeFormat?d(r.form).find(".np_time").val(r.initialData.timeTwentyFour):(d(r.form).find(".np_time").val(r.initialData.time),d(r.form).find(".np_ampm").val(r.initialData.ampm),d(r.form).find('select[name="mm"]').val(r.initialData.month),d(r.form).find('input[name="jj"]').val(r.initialData.day),d(r.form).find('input[name="aa"]').val(r.initialData.year),d(r.form).find('input[name="hh"]').val(r.initialData.hour),d(r.form).find('input[name="mn"]').val(r.initialData.minute)),r.initialData){var t;e.includes("npcustom")&&r.initialData.hasOwnProperty(e)&&(t=(t=e.replace("data-npcustom-","")).toLowerCase(),d(r.form).find('[data-np-custom-field="'+t+'"]').val(r.initialData[e]))}if(r.populateFlatTaxonomies(),r.initialData.hasOwnProperty("h_taxonomies")){var a=r.initialData.h_taxonomies;for(i=0;i<a.length;i++){var s="#"+a[i];d(r.form).find(s).attr("checked","checked")}}var n=d(r.form).find(".np_datepicker");d.each(n,function(){var e=d(this);e.datepicker({dateFormat:e.attr("data-datepicker-format"),beforeShow:function(e,t){d("#ui-datepicker-div").addClass("nestedpages-datepicker")}})}),r.formatter.showQuickEdit(),d(r.form).show()},r.populateFlatTaxonomies=function(){r.initialData.hasOwnProperty("f_taxonomies")&&(r.createTaxonomyObject(),r.getTermNames(),r.setWPSuggest())},r.createTaxonomyObject=function(){var e={};for(i=0;i<r.initialData.f_taxonomies.length;i++){var t=r.initialData.f_taxonomies[i],a=t.split("-"),s=a.indexOf("nps"),a=(a=a.splice(s+1)).join("-"),s=t.split("-").splice(0,s);s.shift("inf");s=s.join("-");s in e||(e[s]=[]),e[s].push(a)}r.flatTerms=e},r.getTermNames=function(){d.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.getTaxonomies,nonce:NestedPages.jsData.nonce,terms:r.flatTerms},success:function(e){r.termNames=e.terms,r.populateFlatTaxonomyFields()}})},r.populateFlatTaxonomyFields=function(){r.termNames&&d.each(r.termNames,function(e,t){e=d("#"+e+"-quickedit");d(e).val(t.join(","))})},r.setWPSuggest=function(){var e=d(r.form).find("[data-autotag]");d.each(e,function(e,t){var a=d(this).attr("data-taxonomy");d(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+a,{multiple:!0,multipleSep:","})})},r.save=function(){r.toggleLoading(!0),d.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:d(r.form).find("form").serialize()+"&action="+NestedPages.formActions.quickEditPost+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(e){"error"===e.status?(r.toggleLoading(!1),d(r.form).find(NestedPages.selectors.quickEditErrorDiv).text(e.message).show()):(r.toggleLoading(!1),r.newData=e.post_data,r.updatePostRow())},error:function(e){console.log(e)}})},r.updatePostRow=function(){r.row=d(r.button).parents(".row-inner"),d(r.row).find(".title").text(r.newData.post_title),d(r.row).find(".np-view-button").attr("href",r.newData.permalink);var e,t=d(r.row).find(".status");"publish"!==r.newData._status&&"future"!==r.newData._status?(e=nestedpages.post_statuses[r.newData._status].label,d(t).text("("+e+")")):d(t).text(""),"private"===r.newData.keep_private&&d(t).text(nestedpages.private),""!==r.newData.post_password&&void 0!==r.newData.post_password&&(a=d(t).text(),a+=' <span class="locked">',a+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/></svg>',a+="</span>",d(t).html(a));var a=d(r.row).find(".nav-status");"hide"==r.newData.nav_status?d(a).text("(Hidden)"):d(a).text("");a=d(r.row).parent("li");"hide"==r.newData.np_status?(d(a).addClass("np-hide"),d(r.row).find(".status").after('<svg class="row-status-icon status-np-hidden" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z" fill="none"/><path class="icon" d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>')):(d(a).removeClass("np-hide"),d(r.row).find(".status-np-hidden").remove());a=d(r.row).find(".sticky");"sticky"==r.newData.sticky?d(a).show():d(a).hide(),NestedPages.jsData.hierarchical||d(r.row).find(".np-author-display").text(r.newData.author_name);var s,n,o=d(r.row).find(NestedPages.selectors.quickEditOpen);for(s in d(o).attr("data-id",r.newData.post_id),d(o).attr("data-template",r.newData.page_template),d(o).attr("data-title",r.newData.post_title),d(o).attr("data-slug",r.newData.post_name),d(o).attr("data-commentstatus",r.newData.comment_status),d(o).attr("data-status",r.newData._status),d(o).attr("data-sticky",r.newData.sticky),"private"===r.newData.keep_private&&d(o).attr("data-status","private"),d(o).attr("data-author",r.newData.post_author),d(o).attr("data-np-status",r.newData.np_status),d(o).attr("data-password",r.newData.post_password),d(o).attr("data-navstatus",r.newData.nav_status),d(o).attr("data-navtitle",r.newData.np_nav_title),d(o).attr("data-linktarget",r.newData.link_target),d(o).attr("data-navtitleattr",r.newData.np_title_attribute),d(o).attr("data-navcss",r.newData.np_nav_css_classes),d(o).attr("data-month",r.newData.mm),d(o).attr("data-day",r.newData.jj),d(o).attr("data-year",r.newData.aa),d(o).attr("data-hour",r.newData.hh),d(o).attr("data-minute",r.newData.mn),d(o).attr("data-datepicker",r.newData.np_date),d(o).attr("data-time",r.newData.np_time),d(o).attr("data-formattedtime",r.newData.np_time),d(o).attr("data-ampm",r.newData.np_ampm),r.newData)s.includes("np_custom")&&r.newData.hasOwnProperty(s)&&(n=s.replace("np_custom_","data-npcustom-"),d(o).attr(n,r.newData[s]));r.removeTaxonomyClasses(),r.addCategoryClasses(),r.addHierarchicalClasses(),r.addFlatClasses(),r.addStatusClass(),r.formatter.removeQuickEdit(),r.formatter.flashRow(r.row)},r.addStatusClass=function(){var e=["published","draft","pending","future"];for(i=0;i<e.length;i++)d(r.row).removeClass(e[i]);d(r.row).addClass(r.newData._status)},r.removeTaxonomyClasses=function(){taxonomies=[];var e=d(r.row).attr("class").split(/\s+/);for(i=0;i<e.length;i++)"in-"===e[i].substring(0,3)&&d(r.row).removeClass(e[i]),"inf-"===e[i].substring(0,4)&&d(r.row).removeClass(e[i])},r.addCategoryClasses=function(){if(r.newData.hasOwnProperty("post_category")){var e=r.newData.post_category;for(i=0;i<e.length;i++){var t="in-category-"+e[i];d(r.row).addClass(t)}}},r.addHierarchicalClasses=function(){var e;r.newData.hasOwnProperty("tax_input")&&(e=r.newData.tax_input,d.each(e,function(e,t){for(i=0;i<t.length;i++){var a="in-"+e+"-"+t[i];d(r.row).addClass(a)}}))},r.addFlatClasses=function(){var e;r.newData.hasOwnProperty("flat_tax")&&(e=r.newData.flat_tax,d.each(e,function(e,t){for(i=0;i<t.length;i++){var a="inf-"+e+"-nps-"+t[i];d(r.row).addClass(a)}}))},r.toggleLoading=function(e){if(e)return d(NestedPages.selectors.quickEditErrorDiv).hide(),d(r.saveButton).attr("disabled","disabled"),void d(NestedPages.selectors.quickEditLoadingIndicator).show();d(r.saveButton).attr("disabled",!1),d(NestedPages.selectors.quickEditLoadingIndicator).hide()},r.bindEvents()},(NestedPages=NestedPages||{}).QuickEditLink=function(){var a=this,s=jQuery;return a.formatter=new NestedPages.Formatter,a.button="",a.postData="",a.newPostData="",a.form="",a.bindEvents=function(){s(document).on("click",NestedPages.selectors.quickEditButtonLink,function(e){e.preventDefault(),a.formatter.removeQuickEdit(),a.button=s(this),a.openQuickEdit()}),s(document).on("click",NestedPages.selectors.quickEditLinkSaveButton,function(e){e.preventDefault(),a.submitForm()}),s(document).on("keydown",function(e){27===e.keyCode&&a.formatter.removeQuickEdit()})},a.openQuickEdit=function(){a.setData(),a.createForm(),a.populateForm()},a.setData=function(){a.postData={id:s(a.button).attr("data-id"),url:s(a.button).attr("data-url"),title:s(a.button).attr("data-title"),status:s(a.button).attr("data-status"),navstatus:s(a.button).attr("data-navstatus"),npstatus:s(a.button).attr("data-np-status"),linktarget:s(a.button).attr("data-linktarget"),parentid:s(a.button).attr("data-parentid"),navtitleattr:s(a.button).attr("data-navtitleattr"),navcss:s(a.button).attr("data-navcss"),navtype:s(a.button).attr("data-nav-type"),navobject:s(a.button).attr("data-nav-object"),navobjectid:s(a.button).attr("data-nav-object-id"),navoriginallink:s(a.button).attr("data-nav-original-link"),navoriginaltitle:s(a.button).attr("data-nav-original-title")}},a.createForm=function(){var e,t=s(a.button).closest(NestedPages.selectors.row).parent("li");a.form=s(NestedPages.selectors.quickEditLinkForm).clone(),0<s(t).children("ol").length?(e=s(t).children("ol"),s(a.form).insertBefore(e)):s(a.form).appendTo(t);s(a.form).siblings(NestedPages.selectors.row).hide()},a.populateForm=function(){var e;s(a.form).find(".np_id").val(a.postData.id),s(a.form).find(".np_title").val(a.postData.title),s(a.form).find(".np_author select").val(a.postData.author),s(a.form).find(".np_status").val(a.postData.status),s(a.form).find(".np_content").val(a.postData.url),s(a.form).find(".np_parent_id").val(a.postData.parentid),s(a.form).find(".np_title_attribute").val(a.postData.navtitleattr),s(a.form).find(".np_nav_css_classes").val(a.postData.navcss),"hide"===a.postData.npstatus?s(a.form).find(".np_status").prop("checked","checked"):s(a.form).find(".np_status").removeAttr("checked"),"hide"===a.postData.navstatus?s(a.form).find(".np_nav_status").prop("checked","checked"):s(a.form).find(".np_nav_status").removeAttr("checked"),"_blank"===a.postData.linktarget?s(a.form).find(".link_target").prop("checked","checked"):s(a.form).find(".link_target").removeAttr("checked"),"custom"!==a.postData.navobject&&""!==a.postData.navobject?(e='<div class="form-control original-link">Original: <a href="'+a.postData.navoriginallink+'" target="_blank">'+a.postData.navoriginaltitle+"</a></div>",s(a.form).find("[data-url-field]").remove(),s(e).insertAfter(s(a.form).find("h3")),s(a.form).find("[data-np-menu-object-input]").val(a.postData.navobject),s(a.form).find("[data-np-menu-objectid-input]").val(a.postData.navobjectid),s(a.form).find("[data-np-menu-type-input]").val(a.postData.navtype),s(a.form).find("h3").text("Link: "+a.postData.navoriginaltitle)):(s(a.form).find("h3").text("Link"),s(a.form).find("[data-np-menu-object-input]").val("custom"),s(a.form).find("[data-np-menu-type-input]").val("custom")),a.formatter.showQuickEdit(),s(a.form).show()},a.submitForm=function(){a.toggleLoading(!0),s.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:s(a.form).find("form").serialize()+"&action="+NestedPages.formActions.quickEditLink+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(e){"error"===e.status?(a.toggleLoading(!1),s(a.form).find(NestedPages.selectors.quickEditErrorDiv).text(e.message).show()):(a.toggleLoading(!1),a.newPostData=e.post_data,a.updateRow())},error:function(e){a.toggleLoading(!1),s(a.form).find(NestedPages.selectors.quickEditErrorDiv).text("The form could not be saved at this time.").show()}})},a.updateRow=function(){var e=s(a.form).siblings(".row");s(e).find(".title").html(a.newPostData.post_title+' <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path class="icon" d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>');var t=s(e).find(".status");"publish"!==a.newPostData._status&&"future"!==a.newPostData._status?s(t).text("("+a.newPostData._status+")"):s(t).text("");t=s(e).find(".nav-status");"hide"==a.newPostData.nav_status?s(t).text("("+NestedPages.jsData.hiddenText+")"):s(t).text("");t=s(e).parent("li");"hide"==a.newPostData.np_status?(s(t).addClass("np-hide"),s(e).find(".status").after('<svg class="row-status-icon status-np-hidden" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z" fill="none"/><path class="icon" d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>')):(s(t).removeClass("np-hide"),s(e).find(".status-np-hidden").remove());t=s(e).find(NestedPages.selectors.quickEditButtonLink);s(t).attr("data-id",a.newPostData.post_id),s(t).attr("data-title",a.newPostData.post_title),s(t).attr("data-url",a.newPostData.post_content),s(t).attr("data-status",a.newPostData._status),s(t).attr("data-navstatus",a.newPostData.nav_status),s(t).attr("data-np-status",a.newPostData.np_status),s(t).attr("data-linkTarget",a.newPostData.linkTarget),s(t).attr("data-navtitleattr",a.newPostData.titleAttribute),s(t).attr("data-navcss",a.newPostData.cssClasses),a.formatter.removeQuickEdit(),a.formatter.flashRow(e)},a.toggleLoading=function(e){if(s(".row").removeClass("np-updated").removeClass("np-updated-show"),e)return s(NestedPages.selectors.quickEditErrorDiv).hide(),s(NestedPages.selectors.quickEditLinkSaveButton).attr("disabled","disabled"),void s(NestedPages.selectors.quickEditLoadingIndicator).show();s(NestedPages.selectors.quickEditLinkSaveButton).attr("disabled",!1),s(NestedPages.selectors.quickEditLoadingIndicator).hide()},a.bindEvents()},(NestedPages=NestedPages||{}).Clone=function(){var t=this,a=jQuery;return t.parent_id="",t.parent_title="",t.parentLi=null,t.formatter=new NestedPages.Formatter,t.bindEvents=function(){a(document).on("click",NestedPages.selectors.cloneButton,function(e){e.preventDefault(),t.parent_id=a(this).attr("data-id"),t.parent_title=a(this).attr("data-parentname"),t.parentLi=a(this).parent(".row").parent(".page-row").parent(".npList"),t.openModal()}),a(document).on("click",NestedPages.selectors.confirmClone,function(e){e.preventDefault(),t.clone()})},t.openModal=function(){a("#"+NestedPages.selectors.cloneModal).find("[data-clone-parent]").text(t.parent_title),a(document).trigger("open-modal-manual",NestedPages.selectors.cloneModal)},t.clone=function(){t.toggleLoading(!0),a.ajax({url:NestedPages.jsData.ajaxurl,type:"post",data:{action:NestedPages.formActions.clonePost,parent_id:t.parent_id,quantity:a(NestedPages.selectors.cloneQuantity).val(),status:a(NestedPages.selectors.cloneStatus).val(),author:a(NestedPages.selectors.cloneAuthor).find("select").val(),nonce:NestedPages.jsData.nonce,posttype:NestedPages.jsData.posttype},success:function(e){t.toggleLoading(!1),a(document).trigger("close-modal-manual"),location.reload()}})},t.toggleLoading=function(e){if(e)return a("#"+NestedPages.selectors.cloneModal).find("[data-clone-loading]").show(),void a(NestedPages.selectors.confirmClone).attr("disabled","disabled");a("#"+NestedPages.selectors.cloneModal).find("[data-clone-loading]").hide(),a(NestedPages.selectors.confirmClone).attr("disabled",!1)},t.bindEvents()},(NestedPages=NestedPages||{}).Tabs=function(){var r=this,d=jQuery;return r.selectors={tabToggle:"data-np-tab-toggle",tabPane:"data-np-tab-pane",tabGroup:"data-np-tab-group"},r.bindEvents=function(){d(document).on("click","["+r.selectors.tabToggle+"]",function(e){e.preventDefault(),r.toggleTabs(d(this))})},r.toggleTabs=function(e){for(var t=d(e).attr(r.selectors.tabGroup),a=d("*["+r.selectors.tabGroup+"="+t+"]["+r.selectors.tabPane+"]"),s=d(e).attr(r.selectors.tabToggle),n=d("*["+r.selectors.tabGroup+"="+t+"]["+r.selectors.tabToggle+"]"),o=[],i=0;i<n.length;i++)o[i]=d(n[i]).parent("li")[0];d(a).hide(),d(n).removeClass("active"),d(o).removeClass("active"),d.each(a,function(){d(this).attr(r.selectors.tabPane)==s&&d(this).show()}),d.each(n,function(){d(this).attr(r.selectors.tabToggle)==s&&(d(this).addClass("active"),d(this).parent("li").addClass("active"))}),d(document).trigger("tabs-changed",[s,t,e])},r.bindEvents()},jQuery(document).ready(function(){new NestedPages.Factory}),(NestedPages=NestedPages||{}).selectors={childToggle:".child-toggle",childToggleLink:".child-toggle a",toggleAll:".nestedpages-toggleall",toggleHidden:".np-toggle-hidden",toggleStatus:".np-toggle-publish",lists:".nplist",rows:".page-row",row:".row",sortable:".sortable",notSortable:".no-sort",handle:".handle",published:".published",hiddenRows:".np-hide",errorDiv:"#np-error",loadingIndicator:"#nested-loading",syncCheckbox:".np-sync-menu",syncForm:".np-sync-menu-cont",ajaxError:"[data-nestedpages-error]",trashWithChildrenButton:"[data-nestedpages-trash-children]",toggleEditButtons:".np-toggle-edit",bulkActionsHeader:".nestedpages-list-header",bulkActionsForm:"[data-np-bulk-form]",bulkActionsCheckbox:"[data-np-bulk-checkbox]",bulkActionsIds:"[data-np-bulk-ids]",bulkActionRedirectIds:"[data-np-bulk-redirect-ids]",hiddenItemCount:"[data-np-hidden-count]",hiddenItemCountParent:"[data-np-hidden-count-parent]",bulkEditForm:"[data-np-bulk-edit-form]",bulkEditTitles:"[data-np-bulk-titles]",bulkEditRemoveItem:"[data-np-remove-bulk-item]",bulkEditCancel:"[data-np-cancel-bulk-edit]",bulkEditLinkCount:"[data-bulk-edit-link-count]",quickEditOverlay:".np-inline-overlay",quickEditLoadingIndicator:".np-qe-loading",quickEditErrorDiv:".np-quickedit-error",quickEditCancel:".np-cancel-quickedit",quickEditButtonLink:".np-quick-edit-redirect",quickEditLinkForm:".quick-edit-form-redirect",quickEditLinkSaveButton:".np-save-quickedit-redirect",quickEditOpen:".np-quick-edit",quickEditPostForm:".quick-edit-form",quickEditSaveButton:".np-save-quickedit",openLinkModal:".open-redirect-modal",linkModal:"np-link-modal",saveLink:".np-save-link",linkLoadingIndicator:".np-link-loading",linkErrorDiv:".np-new-link-error",linkForm:".np-new-link-form",linkDeleteButton:"[data-np-confirm-delete]",linkDeleteConfirmationButton:"[data-delete-confirmation]",linkDeleteConfirmationModal:"np-delete-confirmation-modal",linkDeleteConfirmationModalText:"[data-np-link-delete-text]",openPageModal:".open-bulk-modal",newPageModal:"#np-bulk-modal",newPageFormContainer:".new-child-form",newPageForm:".np-new-child-form",newPageSubmitButton:".np-save-newchild",newPageTitle:".add-new-child-row",newPageRemoveTitle:".np-remove-child",addChildButton:".add-new-child",newChildError:".np-newchild-error",cancelNewChildButton:".np-cancel-newchild",newBeforeButton:"data-insert-before",newAfterButton:"data-insert-after",cloneButton:".clone-post",confirmClone:"[data-confirm-clone]",cloneModal:"np-clone-modal",cloneQuantity:"[data-clone-quantity]",cloneStatus:"[data-clone-status]",cloneAuthor:"[data-clone-author]",tabButtonParent:"[data-np-tabs]",tabButton:"[data-np-tab]",tabContent:"[data-np-tab-pane]",thumbnailContainer:".np-thumbnail",thumbnailContainerLink:".np-thumbnail.link",manualMenuSync:"[data-np-manual-menu-sync]",manualOrderSync:"[data-np-manual-order-sync]"},NestedPages.cssClasses={noborder:"no-border"},NestedPages.jsData={ajaxurl:ajaxurl,nonce:nestedpages.np_nonce,allPostTypes:nestedpages.post_types,syncmenu:"nosync",posttype:"",nestable:!0,sortable:!0,hierarchical:!0,expandText:nestedpages.expand_text,collapseText:nestedpages.collapse_text,showHiddenText:nestedpages.show_hidden,hideHiddenText:nestedpages.hide_hidden,quickEditText:nestedpages.quick_edit,hiddenText:nestedpages.hidden,titleText:nestedpages.title},NestedPages.formActions={syncToggles:"npnestToggle",syncNesting:"npsort",syncMenu:"npsyncMenu",newPage:"npnewChild",newBeforeAfter:"npnewBeforeAfter",quickEditLink:"npquickEditLink",getTaxonomies:"npgetTaxonomies",quickEditPost:"npquickEdit",clonePost:"npclonePost",search:"npmenuSearch",newMenuItem:"npnewMenuItem",manualMenuSync:"npmanualMenuSync",postSearch:"nppostSearch",wpmlTranslations:"npWpmlTranslations",resetSettings:"npresetSettings",resetUserPrefs:"npresetUserPreferences",resetAdminMenuSettings:"npresetAdminMenuSettings",trashWithChildren:"nptrashWithChildren"},NestedPages.Factory=function(){var t=this,e=jQuery;return t.formatter=new NestedPages.Formatter,t.dropdowns=new NestedPages.Dropdowns,t.modals=new NestedPages.Modals,t.checkAll=new NestedPages.CheckAll,t.bulkActions=new NestedPages.BulkActions,t.menuToggle=new NestedPages.MenuToggle,t.pageToggle=new NestedPages.PageToggle,t.nesting=new NestedPages.Nesting,t.syncMenuSetting=new NestedPages.SyncMenuSetting,t.newPage=new NestedPages.NewPost,t.quickEditLink=new NestedPages.QuickEditLink,t.quickEditPost=new NestedPages.QuickEditPost,t.clone=new NestedPages.Clone,t.tabs=new NestedPages.Tabs,t.menuLinks=new NestedPages.MenuLinks,t.hiddenItemCount=new NestedPages.HiddenItemCount,t.confirmDelete=new NestedPages.ConfirmDelete,t.manualSync=new NestedPages.ManualSync,t.postSearch=new NestedPages.PostSearch,t.postMove=new NestedPages.MovePost,t.wpml=new NestedPages.Wpml,t.trashWithChildren=new NestedPages.TrashWithChildren,t.init=function(){nestedpages.settings_page||(t.bindEvents(),t.setPostType(),t.setMenuSync(),t.setNestable(),t.setSortable(),t.formatter.updateSubMenuToggle(),t.formatter.setBorders(),t.formatter.setNestedMargins(),t.nesting.initializeSortable())},t.bindEvents=function(){e(document).on("click",NestedPages.selectors.quickEditOverlay,function(e){t.formatter.removeQuickEdit(),t.newPage.cancelNewPage()}),e(document).ready(function(){t.formatter.hideAjaxError(),t.formatter.sizeLinkThumbnails()})},t.setNestable=function(){var a=!1;e.each(NestedPages.jsData.allPostTypes,function(e,t){t.name===NestedPages.jsData.posttype&&(!0===t.hierarchical&&(a=!0),!0===t.disable_nesting&&(a=!1))}),NestedPages.jsData.nestable=a},t.setSortable=function(){var a=!0;e.each(NestedPages.jsData.allPostTypes,function(e,t){t.name===NestedPages.jsData.posttype&&void 0!==t.disable_sorting&&""!==t.disable_sorting&&"true"===t.disable_sorting&&(a=!1)}),NestedPages.jsData.sortable=a},t.setPostType=function(){NestedPages.jsData.posttype=nestedpages.current_post_type,void 0!==NestedPages.jsData.posttype&&""!==NestedPages.jsData.posttype||(NestedPages.jsData.posttype=e(NestedPages.selectors.sortable).attr("id").substring(3)),NestedPages.jsData.hierarchical=NestedPages.jsData.allPostTypes[NestedPages.jsData.posttype].hierarchical},t.setMenuSync=function(){NestedPages.jsData.syncmenu="1"===nestedpages.syncmenu?"sync":"nosync"},t.init()},(NestedPages=NestedPages||{}).MenuLinks=function(){var a=this,s=jQuery;return a.typeButton="",a.post="",a.formatter=new NestedPages.Formatter,a.selectors={form:"[data-np-menu-item-form]",typeSelect:"[data-np-menu-selection]",accordion:"[data-np-menu-accordion]",accordionItem:"[data-np-menu-accordion-item]",formPlaceholder:".np-menu-link-object-placeholder",formDetails:".np-menu-link-details",searchResults:"[data-np-search-result]",defaultResults:"[data-default-result]",originalLink:"[data-np-original-link]",saveButton:"[data-np-save-link]",urlInputCont:"[data-np-menu-url-cont]",errorDiv:"[data-np-error]"},a.fields={object:"[data-np-menu-object-input]",objectid:"[data-np-menu-objectid-input]",itemType:"[data-np-menu-type-input]",url:"[data-np-menu-url]",navigationLabel:"[data-np-menu-navigation-label]",titleAttribute:"[data-np-menu-title-attr]",cssClasses:"[data-np-menu-css-classes]",npStatus:"[data-np-menu-np-status]",linkTarget:"[data-np-menu-link-target]",menuTitle:"[data-np-menu-title]",parentPostType:"[data-np-menu-parent-post-type]"},a.search=new NestedPages.MenuSearch,a.bindEvents=function(){s(document).on("click",NestedPages.selectors.openLinkModal,function(e){e.preventDefault(),a.postParent=s(this).attr("data-parentid"),s(a.selectors.form).find(".parent_id").val(s(this).attr("data-parentid")),a.openModal()}),s(document).on("click",a.selectors.accordionItem,function(e){e.preventDefault(),a.accordion(s(this))}),s(document).on("click",a.selectors.typeSelect,function(e){e.preventDefault(),a.typeButton=s(this),a.setLinkType()}),s(document).on("keyup",a.fields.navigationLabel,function(){a.updateTitle()}),s(document).on("click",a.selectors.saveButton,function(e){e.preventDefault(),a.submitForm()}),s(document).on("keydown",function(e){27===e.keyCode&&s(document).trigger("close-modal-manual")})},a.openModal=function(){s(NestedPages.selectors.linkErrorDiv).hide(),s(NestedPages.selectors.linkModal).find("input").val(""),s(NestedPages.selectors.linkModal).find(".parent_id").val(a.postParent),a.clearForm(),s(a.selectors.accordion).find("ul").hide(),s(a.selectors.typeSelect).removeClass("active"),s(document).trigger("open-modal-manual",NestedPages.selectors.linkModal)},a.accordion=function(e){a.clearForm();var t=s(e).siblings("ul");if(s(t).is(":visible"))return s(e).removeClass("active"),void s(t).slideUp("fast");s(a.selectors.accordionItem).removeClass("active"),s(e).addClass("active"),s(e).parents(a.selectors.accordion).find("ul").slideUp("fast"),s(t).slideDown("fast")},a.setLinkType=function(){s(a.typeButton).hasClass("active")?a.clearForm():(s(a.typeButton).hasClass("np-custom-link")&&(s(a.selectors.accordionItem).removeClass("active"),s(a.selectors.accordion).find("ul").slideUp("fast")),s(a.selectors.formPlaceholder).hide(),a.populateForm())},a.populateForm=function(){s(a.selectors.saveButton).show(),s(a.selectors.typeSelect).removeClass("active"),s(a.typeButton).addClass("active"),s(a.fields.menuTitle).text(s(a.typeButton).text()).val(s(a.typeButton).text()),s(a.selectors.form).find("h3").find("em").text(s(a.typeButton).attr("data-np-object-name")),""!==s(a.typeButton).attr("data-np-permalink")?(s(a.selectors.form).find(a.selectors.urlInputCont).hide(),s(a.selectors.form).find(a.selectors.originalLink).html('<a href="'+s(a.typeButton).attr("data-np-permalink")+'">'+s(a.typeButton).text()+"</a>"),s(a.selectors.form).find(a.selectors.originalLink).parent(".original-link").show()):(s(a.selectors.form).find(a.selectors.urlInputCont).show(),s(a.selectors.form).find(a.selectors.originalLink).parent(".original-link").hide()),s(a.fields.object).val(s(a.typeButton).attr("data-np-menu-object")),s(a.fields.objectid).val(s(a.typeButton).attr("data-np-menu-objectid")),s(a.fields.itemType).val(s(a.typeButton).attr("data-np-menu-type")),s(a.selectors.formDetails).show()},a.clearForm=function(){s(a.selectors.form).find(a.selectors.errorDiv).hide(),s(a.selectors.saveButton).hide(),s(a.selectors.formDetails).hide(),s(a.selectors.formPlaceholder).show(),s(a.selectors.form).find("input").not(".parent_id").not(".parent-post-type").val(""),s(a.selectors.form).find(a.fields.linkTarget).val("_blank"),s(a.selectors.form).find('input[type="checkbox"]').attr("checked",!1),s(a.selectors.typeSelect).removeClass("active"),a.search.toggleLoading(!1),s(a.selectors.searchResults).remove(),s(a.selectors.defaultResults).show()},a.updateTitle=function(){var e=s(a.fields.navigationLabel).val(),t=s(a.selectors.form).find("h3").find("span");""!==e?(s(a.fields.menuTitle).val(e),s(t).text(e)):(s(a.fields.menuTitle).val(s(a.typeButton).text()),s(t).text(s(a.typeButton).text()))},a.submitForm=function(){a.toggleLoading(!0),s.ajax({url:NestedPages.jsData.ajaxurl,type:"post",data:s(a.selectors.form).serialize()+"&action="+NestedPages.formActions.newMenuItem+"&nonce="+NestedPages.jsData.nonce+"&post_type="+NestedPages.jsData.posttype+"&syncmenu="+NestedPages.jsData.syncmenu,success:function(e){a.toggleLoading(!1),"error"!==e.status?(a.post=e.post_data,a.createRow()):s(a.selectors.form).find(a.selectors.errorDiv).text(e.message).show()},error:function(e){console.log(e)}})},a.createRow=function(){var e='<li id="menuItem_'+a.post.id+'" class="page-row published';e+='">',e+='<div class="row"><div class="child-toggle"><div class="child-toggle-spacer"></div></div><div class="row-inner">',e+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="np-icon-sub-menu"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M19 15l-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9l6 6z" class="arrow" /></svg>',e+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="handle np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg>',e+='<a href="'+a.post.np_link_content+'" class="page-link page-title" target="_blank"><span class="title">'+a.post.menuTitle+' <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path class="icon" d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg></span>',e+='</a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ',e+='data-id="'+a.post.id+'"',e+='data-parentid="'+a.post.parent_id+'"',e+='data-title="'+a.post.menuTitle+'" ',e+='data-url="'+a.post.url+'" ',e+='data-status="publish" ',e+='data-np-status="show" ',e+='data-navstatus="show" ',e+='data-navcss="'+a.post.cssClasses+'" ',e+='data-navtitleattr="'+a.post.titleAttribute+'" ',e+='data-nav-type="'+a.post.menuType+'" ',e+='data-nav-object="'+a.post.objectType+'" ',e+='data-nav-object-id="'+a.post.objectId+'" ',e+='data-nav-original-link="'+a.post.original_link+'" ',e+='data-nav-original-title="'+a.post.original_title+'" ',e+='data-linktarget="'+a.post.link_target+'">',e+=NestedPages.jsData.quickEditText,e+="</a>",e+='<a href="'+a.post.delete_link+'" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>',e+="</div></div></div></li>","0"===a.post.parent_id?s(".nplist:first li:first").after(e):a.appendChildRow(e),s(document).trigger("close-modal-manual"),a.row=s("#menuItem_"+a.post.id).find(".row"),a.formatter.flashRow(a.row)},a.appendChildRow=function(e){var t=s("#menuItem_"+a.post.parent_id);0===s(t).children("ol").length?(e='<ol class="sortable nplist" style="display:block;">'+e+"</ol>",s(t).append(e)):s(t).find("ol:first").prepend(e),a.formatter.updateSubMenuToggle()},a.toggleLoading=function(e){if(e)return s(a.selectors.form).find(a.selectors.errorDiv).hide(),s(a.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).show(),void s(a.selectors.saveButton).attr("disabled","disabled");s(a.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).hide(),s(a.selectors.saveButton).attr("disabled",!1)},a.bindEvents()},(NestedPages=NestedPages||{}).MenuSearch=function(){var s=this,n=jQuery;return s.selectors={searchForms:"*[data-np-menu-search]",defaultResults:"[data-default-result]",loadingIndicator:".np-menu-search-loading",noResults:".np-menu-search-noresults",searchType:"data-search-type",searchObject:"data-search-object",searchResults:"[data-np-search-result]"},s.activeForm="",s.results="",s.defaultResults="",s.searchType="",s.searchObject="",s.init=function(){s.bindEvents()},s.bindEvents=function(){n(document).on("keyup",s.selectors.searchForms,function(){s.activeForm=n(this),n(s.selectors.searchResults).remove(),s.performSearch()})},s.performSearch=function(){if(s.defaultResults=n(s.activeForm).parent("li").siblings(s.selectors.defaultResults),2<n(s.activeForm).val().length)return n(s.defaultResults).hide(),s.toggleLoading(!0),void s.query();s.toggleLoading(!1),n(s.defaultResults).show()},s.query=function(){s.searchType=n(s.activeForm).attr(s.selectors.searchType),s.searchObject=n(s.activeForm).attr(s.selectors.searchObject),n.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.search,nonce:NestedPages.jsData.nonce,term:n(s.activeForm).val(),searchType:s.searchType,searchObject:s.searchObject},success:function(e){console.log(e),e.results?(s.results=e.results,s.toggleLoading(!1),"post_type"===s.searchType?s.appendPosts():s.appendTaxonomies()):(s.toggleLoading(!1),n(s.activeForm).siblings(s.selectors.noResults).show())}})},s.appendPosts=function(){var a="";n.each(s.results,function(e,t){a+='<li data-np-search-result><a href="#" data-np-menu-object="'+s.searchObject+'" data-np-menu-type="post_type" data-np-menu-objectid="'+t.ID+'" data-np-permalink="'+t.permalink+'" data-np-object-name="'+t.singular_name+'" data-np-menu-selection>'+t.post_title+"</a></li>"}),n(a).insertAfter(n(s.activeForm).parent("li")),s.toggleLoading(!1)},s.appendTaxonomies=function(){var a="";n.each(s.results,function(e,t){a+='<li data-np-search-result><a href="#" data-np-menu-object="'+s.searchObject+'" data-np-menu-type="post_type" data-np-menu-objectid="'+t.term_id+'" data-np-permalink="'+t.permalink+'" data-np-object-name="'+t.taxonomy+'" data-np-menu-selection>'+t.name+"</a></li>"}),n(a).insertAfter(n(s.activeForm).parent("li")),s.toggleLoading(!1)},s.toggleLoading=function(e){var t=n(s.activeForm).siblings(s.selectors.loadingIndicator);n(s.selectors.noResults).hide(),e?n(t).show():n(t).hide()},s.init()},jQuery(document).ready(function(){new NestedPagesTrash});var NestedPagesTrash=function(){var t=this,a=jQuery;return t.trashButton=".np-empty-trash",t.confirmButton=".np-trash-confirm",t.warningModal="#np-trash-modal",t.errorAlert="#np-error",t.loadingIndicator="#nested-loading",t.trashLinks=".np-trash-links",t.postType=a("#np-trash-posttype").val(),t.nonce=nestedpages.np_nonce,t.formAction="npEmptyTrash",t.bindEvents=function(){a(document).on("click",t.confirmButton,function(e){e.preventDefault(),t.confirmEmpty()})},t.confirmEmpty=function(){t.loading(!0),a(document).trigger("close-modal-manual"),a(t.errorAlert).hide(),t.emptyTrash()},t.emptyTrash=function(){a.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:t.formAction,nonce:t.nonce,posttype:t.postType},success:function(e){t.loading(!1),"error"===e.status?a(t.errorAlert).text(e.message).show():(a(t.trashLinks).hide(),a(".notice-dismiss").click())}})},t.loading=function(e){e?a(t.loadingIndicator).show():a(t.loadingIndicator).hide()},t.bindEvents()};(NestedPages=NestedPages||{}).ConfirmDelete=function(){var t=this,a=jQuery;return t.deleteLink="",t.bindEvents=function(){a(document).on("click",NestedPages.selectors.linkDeleteButton,function(e){e.preventDefault(),t.confirmSingle(a(this))}),a(document).on("click",NestedPages.selectors.linkDeleteConfirmationButton,function(e){e.preventDefault(),a(this).hasClass("bulk")?t.deleteMultiple():t.deleteSingle()}),a(document).on("submit",NestedPages.selectors.bulkActionsForm,function(e){t.confirmMultiple(e)})},t.confirmSingle=function(e){t.deleteLink=a(e).attr("href"),a(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation_singular),a(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.delete).removeClass("bulk"),a(document).trigger("open-modal-manual",NestedPages.selectors.linkDeleteConfirmationModal)},t.confirmMultiple=function(e){"trash"===a('select[name="np_bulk_action"]').val()&&""!==a(NestedPages.selectors.bulkActionRedirectIds).val()&&(e.preventDefault(),a(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation),a(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.trash_delete_links).addClass("bulk"),a(document).trigger("open-modal-manual",[NestedPages.selectors.linkDeleteConfirmationModal]))},t.deleteMultiple=function(){a(NestedPages.selectors.bulkActionsForm)[0].submit()},t.deleteSingle=function(){window.location.replace(t.deleteLink)},t.bindEvents()},(NestedPages=NestedPages||{}).ManualSync=function(){var t=this,a=jQuery;return t.activeBtn="",t.bindEvents=function(){a(document).on("click",NestedPages.selectors.manualMenuSync,function(e){e.preventDefault(),t.activeBtn=a(this),t.syncMenu()}),a(document).on("click",NestedPages.selectors.manualOrderSync,function(e){e.preventDefault(),t.activeBtn=a(this),t.syncOrder()})},t.syncMenu=function(){t.loading(!0),a.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.manualMenuSync,nonce:NestedPages.jsData.nonce,post_type:NestedPages.jsData.posttype,syncmenu:"sync"},success:function(e){"error"===e.status?(a(NestedPages.selectors.errorDiv).text(e.message).show(),a(NestedPages.selectors.loadingIndicator).hide()):t.loading(!1)}})},t.syncOrder=function(){t.loading(!0),(new NestedPages.Nesting).syncNesting(!0,t.loading(!1))},t.loading=function(e){if(e)return a(t.activeBtn).addClass("disabled"),void a(NestedPages.selectors.loadingIndicator).show();a(t.activeBtn).removeClass("disabled"),a(NestedPages.selectors.loadingIndicator).hide()},t.bindEvents()},(NestedPages=NestedPages||{}).PostSearch=function(){var s=this,n=jQuery;return s.selectors={input:"data-nestedpages-post-search",form:"data-nestedpages-post-search-form",loadingIndicator:"data-nestedpages-loading",noResults:"data-nestedpages-no-results",results:"data-nestedpages-search-results"},s.changed=!1,s.activeInput="",s.results="",s.defaultResults="",s.postType="",s.activeForm="",s.bindEvents=function(){n("["+s.selectors.input+"]").on("input",function(){return s.activeInput=n(this),s.setOptions(),s.changed||s.setDefaultResults(),""===n(this).val()?(n(s.activeForm).find("["+s.selectors.noResults+"]").hide(),void s.showDefaultResults()):void s.query()})},s.setDefaultResults=function(){s.defaultResults=n(s.activeForm).find("["+s.selectors.results+"]").html(),s.changed=!0},s.showDefaultResults=function(){n(s.activeForm).find("["+s.selectors.results+"]").html(s.defaultResults)},s.setOptions=function(){s.postType=n(s.activeInput).attr(s.selectors.input),s.activeForm=n(s.activeInput).parents("["+s.selectors.form+"]")},s.performSearch=function(){if(s.defaultResults=n(s.activeForm).parent("li").siblings(s.selectors.defaultResults),2<n(s.activeForm).val().length)return n(s.defaultResults).hide(),s.toggleLoading(!0),void s.query();s.toggleLoading(!1),n(s.defaultResults).show()},s.query=function(){n(s.activeForm).find("["+s.selectors.results+"]").empty(),s.toggleLoading(!0),n.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.postSearch,nonce:NestedPages.jsData.nonce,term:n(s.activeInput).val(),postType:s.postType},success:function(e){e.results?(s.results=e.results,s.loadResults(),s.toggleLoading(!1)):(s.toggleLoading(!1),n(s.activeForm).find("["+s.selectors.noResults+"]").show())}})},s.loadResults=function(){var a="<ul>";n.each(s.results,function(e,t){a+='<li><a href="#" data-assignment-page-id="'+t.ID+'" data-assignment-page-title="'+t.post_title+'">'+t.post_title+"</a></li>"}),a+="</ul>",n(s.activeForm).find("["+s.selectors.results+"]").html(a),s.toggleLoading(!1)},s.toggleLoading=function(e){var t=n(s.activeForm).find("["+s.selectors.loadingIndicator+"]"),a=n(s.activeForm).find("["+s.selectors.noResults+"]");n(a).hide(),e?n(t).show():n(t).hide()},s.bindEvents()},(NestedPages=NestedPages||{}).MovePost=function(){var t=this,a=jQuery;return t.formatter=new NestedPages.Formatter,t.nesting=new NestedPages.Nesting,t.activeRow,t.selectors={moveToTop:"data-push-to-top",moveToBottom:"data-push-to-bottom"},t.bindEvents=function(){a(document).ready(function(){t.disableTopOnFirst(),t.disableBottomOnLast()}),a(document).on("click","["+t.selectors.moveToTop+"]",function(e){e.preventDefault(),a(this).hasClass("disabled")||(t.activeRow=a(this).closest(NestedPages.selectors.rows),t.moveToTop())}),a(document).on("click","["+t.selectors.moveToBottom+"]",function(e){e.preventDefault(),a(this).hasClass("disabled")||(t.activeRow=a(this).closest(NestedPages.selectors.rows),t.moveToBottom())})},t.moveToTop=function(){var e=a(t.activeRow).parent(NestedPages.selectors.lists),e=a(e).find(NestedPages.selectors.rows).first();a(t.activeRow).insertBefore(e),t.formatter.setBorders(),a(document).click(),t.nesting.syncNesting(),t.disableTopOnFirst(),t.disableBottomOnLast()},t.moveToBottom=function(){var e=a(t.activeRow).parent(NestedPages.selectors.lists),e=a(e).children(NestedPages.selectors.rows).last();a(t.activeRow).insertAfter(e),t.formatter.setBorders(),a(document).click(),t.nesting.syncNesting(),t.disableTopOnFirst(),t.disableBottomOnLast()},t.disableTopOnFirst=function(){var e=a(NestedPages.selectors.lists);a.each(e,function(){a(this).find("["+t.selectors.moveToTop+"]").removeClass("disabled");var e=a(this).find(NestedPages.selectors.rows).first();a(e).find("["+t.selectors.moveToTop+"]").addClass("disabled")})},t.disableBottomOnLast=function(){var e=a(NestedPages.selectors.lists);a.each(e,function(){a(this).find("["+t.selectors.moveToBottom+"]").removeClass("disabled");var e=a(this).find(NestedPages.selectors.rows).last();a(e).find("["+t.selectors.moveToBottom+"]").addClass("disabled")})},t.bindEvents()},(NestedPages=NestedPages||{}).TrashWithChildren=function(){var t=this,a=jQuery;return t.post_id="",t.bindEvents=function(){a(document).on("click",NestedPages.selectors.trashWithChildrenButton,function(e){e.preventDefault(),t.post_id=a(this).attr("data-post-id"),t.trash()})},t.trash=function(){a.ajax({url:NestedPages.jsData.ajaxurl,type:"post",data:{action:NestedPages.formActions.trashWithChildren,nonce:NestedPages.jsData.nonce,post_id:t.post_id,screen:nestedpages.current_page},success:function(e){window.location.replace(e.redirect)},error:function(e){console.log(e)}})},t.bindEvents()},(NestedPages=NestedPages||{}).Wpml=function(){var t=this,n=jQuery;return t.button=null,t.postData=null,t.modal=null,t.parent_li=null,t.formatter=new NestedPages.Formatter,t.selectors={translationsBtn:"data-nestedpages-translations",modal:"data-np-wpml-translations-modal",title:"data-wmpl-translation-title",table:"data-np-wpml-translations-modal-table"},t.bindEvents=function(){nestedpages.wpml&&n(document).on("click","["+t.selectors.translationsBtn+"]",function(e){e.preventDefault(),t.createTranslationsModal(n(this))})},t.createTranslationsModal=function(e){t.parent_li=n(e).parents(".action-buttons").closest(NestedPages.selectors.row).parent("li"),t.button=n(t.parent_li).find(NestedPages.selectors.quickEditOpen),t.postData={id:n(t.button).attr("data-id"),title:n(t.button).attr("data-title"),slug:n(t.button).attr("data-slug")},t.modal=n("["+t.selectors.modal+"]").clone(),0<n(t.parent_li).children("ol").length?(e=n(t.parent_li).children("ol"),n(t.modal).insertBefore(e)):n(t.modal).appendTo(t.parent_li),n(t.modal).find("["+t.selectors.title+"]").text(t.postData.title),t.formatter.showQuickEdit(),n(t.modal).show(),t.getTranslationData()},t.getTranslationData=function(){n.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.wpmlTranslations,post_id:t.postData.id,nonce:NestedPages.jsData.nonce},success:function(e){console.log(e),console.log(t.postData.id),"success"===e.status?t.populateModal(e.translations):(n(t.modal).find(NestedPages.selectors.quickEditErrorDiv).text(e.message).show(),t.toggleLoading(!1))}})},t.populateModal=function(a){var s="<tbody>";n.each(a,function(e,t){e=a[e];s+="<tr>",s+='<td><img src="'+e.country_flag_url+'" alt="'+e.translated_name+'" /> '+e.translated_name+"</td>",s+="<td>",e.has_translation&&e.edit_link?s+='<a href="'+e.edit_link+'">'+e.translation.post_title+" ("+nestedpages.edit+")</a>":s+='<a href="'+e.add_link+'" class="np-btn">+ '+nestedpages.add_translation+"</a>",s+="</td>",s+="</tr>"}),s+="</tbody>",n(t.modal).find("["+t.selectors.table+"]").html(s),t.toggleLoading(!1)},t.toggleLoading=function(e){e?n(t.modal).addClass("loading"):n(t.modal).removeClass("loading")},t.bindEvents()};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/nestedpages.min.js CHANGED
@@ -1 +1 @@
1
- (NestedPages=NestedPages||{}).Formatter=function(){var s=this,i=jQuery;s.updateSubMenuToggle=function(){for(var e=i(NestedPages.selectors.childToggle),t=0;t<e.length;t++){var a=e[t],s=i(a).parent(".row").parent("li");if(0<i(s).children("ol").length){if(i(s).children("ol").find("li.page-row").length<1){i(s).children("ol").hide();continue}var n='<div class="child-toggle-spacer"></div>';n+='<a href="#"',0<i(s).children("ol:visible").length&&(n+=' class="open"'),n+='><span class="np-icon-arrow"></span></a>',i(a).html(n),0<i(s).children("ol").children(".np-hide").length&&0===i(s).children("ol").children(".np-hide.shown").length?i(a).find("a").hide():0<i(s).children("ol").children(".np-hide").length&&0<i(s).children("ol").children(".np-hide.shown").length&&i(a).find("a").show()}else i(a).empty().html('<div class="child-toggle-spacer"></div>')}},s.setBorders=function(){i(NestedPages.selectors.rows).removeClass(NestedPages.cssClasses.noborder),i.each(i(NestedPages.selectors.lists),function(){i(this).find(".page-row:visible:first").addClass(NestedPages.cssClasses.noborder)})},s.setNestedMargins=function(){s.setIndent()},s.setIndent=function(){var n="1"===nestedpages.non_indent?20:30,o="1"===nestedpages.non_indent?".row-inner":".child-toggle";i.each(i(NestedPages.selectors.lists),function(e,t){var a=i(this).parents(NestedPages.selectors.lists).length,s=0;if(NestedPages.jsData.sortable||(s=10),0<a){s=a*n+s;i(this).find(o).css("padding-left",s+"px")}else NestedPages.jsData.sortable&&!i(this).hasClass("no-sort")?i(this).find(".row-inner").css("padding-left","0px"):i(this).find(".row-inner").css("padding-left","10px")})},s.setClassicIndent=function(){i.each(i(NestedPages.selectors.lists),function(e,t){var a=i(this).parents(NestedPages.selectors.lists).length,s=0;if(NestedPages.jsData.sortable||(s=10),0<a){s=20*a+s;i(this).find(".row-inner").css("padding-left",s+"px")}else NestedPages.jsData.sortable&&!i(this).hasClass("no-sort")?i(this).find(".row-inner").css("padding-left","0px"):i(this).find(".row-inner").css("padding-left","10px")})},s.updatePlaceholderWidth=function(e){if(NestedPages.jsData.nestable){var t=40*i(e.placeholder).parents("ol").length-40,a=i(NestedPages.selectors.sortable).width()-t;i(e.placeholder).width(a).css("margin-left",t+"px")}s.updateListVisibility(e)},s.updateListVisibility=function(e){var t=i(e.placeholder).parent("ol");i(t).is(":visible")||(i(t).addClass("nplist"),i(t).show())},s.removeQuickEdit=function(){i(NestedPages.selectors.quickEditOverlay).removeClass("active").remove(),i(".sortable .quick-edit").remove(),i(".row").show()},s.showQuickEdit=function(){i("body").append('<div class="np-inline-overlay"></div>'),setTimeout(function(){i(".np-inline-overlay").addClass("active")},50)},s.flashRow=function(e){i(e).addClass("np-updated"),s.setBorders(),setTimeout(function(){i(e).addClass("np-updated-show")},1500)},s.showAjaxError=function(e){i(NestedPages.selectors.ajaxError).find("p").text(e),i(NestedPages.selectors.ajaxError).show()},s.hideAjaxError=function(e){i(NestedPages.selectors.ajaxError).hide()},s.sizeLinkThumbnails=function(){var e=i(NestedPages.selectors.thumbnailContainer).not(NestedPages.selectors.thumbnailContainerLink).first().find("img"),t=i(e).width(),a=i(e).height();i.each(i(NestedPages.selectors.thumbnailContainerLink),function(){i(this).width(t),i(this).height(a)})}},(NestedPages=NestedPages||{}).Dropdowns=function(){var t=this,a=jQuery;return t.dropdown="",t.activeBtn="",t.activeContent="",t.toggleBtn="[data-dropdown-toggle]",t.dropdownContainer="[data-dropdown]",t.dropdownContent="[data-dropdown-content]",t.selectors={caret_up:"icon-arrow_drop_up",caret_down:"icon-arrow_drop_down"},t.bindEvents=function(){a(document).on("click",t.toggleBtn,function(e){e.preventDefault(),t.activeBtn=a(this),t.dropdown=a(this).parents(t.dropdownContainer),t.toggleDropdown()}),a(document).on("click",function(e){t.closeDropdowns(e.target)}),a(document).on("dropdown-opened",function(e,t){0<a(t).parents(NestedPages.selectors.row).length&&a(t).parents(NestedPages.selectors.row).addClass("active")}),a(document).on("dropdown-closed",function(){a(NestedPages.selectors.row).removeClass("active")})},t.toggleDropdown=function(){a("."+t.selectors.caret_up).attr("class",t.selectors.caret_down);var e=a(t.dropdown).find(t.dropdownContent);if(t.activeContent=e,a(e).hasClass("active"))return a(e).removeClass("active"),a(t.activeBtn).removeClass("active"),a(t.activeBtn).find("."+t.selectors.caret_up).attr("class",t.selectors.caret_down),void a(document).trigger("dropdown-closed",e);t.setPositioning(),a(t.toggleBtn).removeClass("active"),a(t.dropdownContent).removeClass("active"),a(e).addClass("active"),a(t.activeBtn).find("."+t.selectors.caret_down).attr("class",t.selectors.caret_up),a(t.activeBtn).addClass("active"),a(document).trigger("dropdown-opened",e)},t.setPositioning=function(){var e=a(t.activeBtn).outerHeight();a(t.activeContent).css("top",e+"px")},t.closeDropdowns=function(e){0===a(e).parents(t.dropdownContainer).length&&(a(t.dropdownContent).removeClass("active"),a(t.toggleBtn).removeClass("active"),a(t.activeBtn).find("."+t.selectors.caret_up).attr("class",t.selectors.caret_down),a(document).trigger("dropdown-closed",void 0))},t.bindEvents()},(NestedPages=NestedPages||{}).Modals=function(){var a=this,s=jQuery;return a.activeBtn="",a.activeModal="",a.modalOpen=!1,a.selectors={toggleBtn:"[data-nestedpages-modal-toggle]",backdrop:"[data-nestedpages-modal-backdrop]",closeBtn:"[data-nestedpages-modal-close]",title:"data-nestedpages-modal-title",content:"data-nestedpages-modal-content"},a.bindEvents=function(){s(document).on("click",a.selectors.toggleBtn,function(e){e.preventDefault(),a.activeBtn=s(this),a.openModal()}),s(document).on("click",a.selectors.closeBtn,function(e){e.preventDefault(),a.closeModals()}),s(document).on("open-modal-manual",function(e,t){a.activeModal=s('[data-nestedpages-modal="'+t+'"]'),a.openModal()}),s(document).on("close-modal-manual",function(e){a.closeModals()}),s(document).on("click",a.selectors.backdrop,function(e){a.closeModals()}),s(document).ready(function(){a.checkHash()})},a.openModal=function(){if(a.modalOpen)a.closeModals();else{if(0<s(a.activeBtn).length){var e=s(a.activeBtn).attr("data-nestedpages-modal-toggle");a.activeModal=s('*[data-nestedpages-modal="'+e+'"]')}s(a.activeModal).addClass("active"),a.modalOpen=!0,a.populateModal(),s(document).trigger("open-modal",[a.activeBtn,a.activeModal])}},a.closeModals=function(){a.modalOpen=!1,s("[data-nestedpages-modal]").removeClass("active"),a.activeModal="",a.activeBtn=""},a.populateModal=function(){var e=s(a.activeBtn).attr(a.selectors.title);void 0!==e&&""!==e&&s(a.activeModal).find("[data-nestedpages-modal-title]").text(e);var t=s(a.activeBtn).attr(a.selectors.content);void 0!==t&&""!==t&&s(a.activeModal).find("[data-nestedpages-modal-content]").html(t)},a.checkHash=function(){if(window.location.hash&&"#modal"===window.location.hash.substring(0,6)){var e=window.location.hash.substring(7);a.activeModal=s('*[data-nestedpages-modal="'+e+'"]'),a.openModal()}},a.bindEvents()},(NestedPages=NestedPages||{}).CheckAll=function(){var s=this,n=jQuery;return s.activeCheckbox="",s.selectors={checkbox:"[data-np-check-all]"},s.bindEvents=function(){n(document).on("change",s.selectors.checkbox,function(){s.activeCheckbox=n(this),s.toggleCheckboxes()}),n(document).on("change","input[type=checkbox]",function(){s.checkAllStatus(n(this))})},s.init=function(){s.bindEvents()},s.toggleCheckboxes=function(){var t=!!n(s.activeCheckbox).is(":checked"),e=n(s.activeCheckbox).attr("data-np-check-all"),a=n('*[name="'+e+'"]');n.each(a,function(){var e=n(this).parents(NestedPages.selectors.rows);n(this).prop("checked",t),n(e).hasClass("np-hide")&&!n(e).is(":visible")&&n(e).find(NestedPages.selectors.bulkActionsCheckbox).prop("checked",!1)}),s.toggleCheckAll()},s.toggleCheckAll=function(){var e=n(s.activeCheckbox).attr("data-np-check-all"),t=n('*[name="'+e+'"]').length;t=t-n(".np-hide").find(NestedPages.selectors.bulkActionsCheckbox).length+n(".np-hide:visible").find(NestedPages.selectors.bulkActionsCheckbox).length;var a=n('*[name="'+e+'"]:checked').length;if(t==a)return n(s.activeCheckbox).prop("checked",!0),void n(s.activeCheckbox).removeClass("check-all-partial");0<a?n(s.activeCheckbox).addClass("check-all-partial"):(n(s.activeCheckbox).attr("checked",!1),n(s.activeCheckbox).removeClass("check-all-partial"))},s.checkAllStatus=function(e){var t=n(e).attr("name"),a=n('*[data-np-check-all="'+t+'"]');0!==a.length&&(s.activeCheckbox=n(a)[0],s.toggleCheckAll())},s.init()},(NestedPages=NestedPages||{}).BulkActions=function(){var o=this,i=jQuery;return o.selectedNumber=0,o.selectedLinks=[],o.selectedPosts=[],o.init=function(){o.bindEvents()},o.bindEvents=function(){i(document).on("change",NestedPages.selectors.bulkActionsCheckbox,function(){o.toggleBulkForm()}),i(document).on("submit",NestedPages.selectors.bulkActionsForm,function(e){"edit"===i("select[name=np_bulk_action]").val()&&(e.preventDefault(),o.toggleBulkEdit(!0))}),i(document).on("click",NestedPages.selectors.bulkEditRemoveItem,function(e){e.preventDefault();var t=i(this).siblings("input[type=hidden]").val();o.uncheckBulkItem(t)}),i(document).on("click",NestedPages.selectors.bulkEditCancel,function(e){e.preventDefault(),o.uncheckAllBulkItems()})},o.toggleBulkForm=function(){var a=!1,s="",n="";if(o.selectedPosts=[],o.selectedLinks=[],i.each(i(NestedPages.selectors.bulkActionsCheckbox),function(){if(i(this).is(":checked")){var e=i(this).parents(NestedPages.selectors.rows);if(a=!0,i(this).parent("div").hasClass("np-check-all")||i(e).hasClass("post-type-np-redirect")||(s+=i(this).val()+","),i(e).hasClass("post-type-np-redirect")&&(n+=i(this).val()+",",o.selectedLinks.push(i(this).val())),"np-redirect"!==i(this).attr("data-np-post-type")&&!i(this).parent("div").hasClass("np-check-all")){var t=[];t.title=i(this).attr("data-np-bulk-checkbox"),t.id=i(this).val(),o.selectedPosts.push(t)}}}),o.setBulkEditPosts(),o.toggleEditOption(),o.toggleLinkCountAlert(),a)return i(NestedPages.selectors.bulkActionsForm).show(),i(NestedPages.selectors.bulkActionsIds).val(s),i(NestedPages.selectors.bulkActionRedirectIds).val(n),void o.setSelectedNumber();i(NestedPages.selectors.bulkActionsIds).val(""),i(NestedPages.selectors.bulkActionsForm).hide()},o.setBulkEditPosts=function(){for(var e="",t=0;t<o.selectedPosts.length;t++)e+='<li><a href="#" class="np-remove" data-np-remove-bulk-item>&times;</a>',e+=o.selectedPosts[t].title,e+='<input type="hidden" name="post_ids[]" value="'+o.selectedPosts[t].id+'"></li>';i(NestedPages.selectors.bulkEditTitles).html(e)},o.uncheckBulkItem=function(e){i.each(i(NestedPages.selectors.bulkActionsCheckbox),function(){i(this).val()==e&&i(this).prop("checked",!1).change()}),0===i(NestedPages.selectors.bulkEditRemoveItem).length&&o.toggleBulkEdit(!1)},o.uncheckAllBulkItems=function(){i.each(i(NestedPages.selectors.bulkActionsCheckbox),function(){i(this).prop("checked",!1).change()}),o.toggleBulkEdit(!1)},o.setSelectedNumber=function(){var e=i(NestedPages.selectors.bulkActionsCheckbox+":checked").not(".np-check-all input").length,t=i(NestedPages.selectors.bulkActionsForm).find("select option").first();i(t).text(nestedpages.bulk_actions+" ("+e+")")},o.toggleEditOption=function(){var e=i(NestedPages.selectors.bulkActionsCheckbox+":checked").not(".np-check-all input").not(".np-redirect-bulk").length,t=i(NestedPages.selectors.bulkActionsForm).find("select option[value=edit]");if(0===e)return i(t).prop("disabled",!0),i(NestedPages.selectors.bulkActionsForm).find("select option").first().prop("selected",!0),void o.toggleBulkEdit(!1);i(t).prop("disabled",!1)},o.toggleBulkEdit=function(e){if(o.toggleLinkCountAlert(),e)return o.disableParentOptions(),i(NestedPages.selectors.bulkEditForm).show(),i(NestedPages.selectors.bulkActionsForm).hide(),void o.setWPSuggest();i(NestedPages.selectors.bulkEditForm).hide(),i(NestedPages.selectors.bulkActionsForm).show(),i(NestedPages.selectors.bulkEditLinkCount).parent("div").hide(),i(NestedPages.selectors.bulkActionsForm).find("select option").first().text(nestedpages.bulk_actions),o.resetBulkEditFields()},o.toggleLinkCountAlert=function(){0!==o.selectedLinks.length?i(NestedPages.selectors.bulkEditLinkCount).parent("div").show():i(NestedPages.selectors.bulkEditLinkCount).parent("div").hide()},o.disableParentOptions=function(){for(var e=i(NestedPages.selectors.bulkEditForm).find("select[name=post_parent]"),t=0;t<o.selectedPosts.length;t++)i(e).find("option[value="+o.selectedPosts[t].id+"]").attr("disabled",!0)},o.setWPSuggest=function(){var e=i(NestedPages.selectors.bulkEditForm).find("[data-autotag]");i.each(e,function(e,t){var a=i(this).attr("data-taxonomy");i(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+a,{multiple:!0,multipleSep:","})})},o.resetBulkEditFields=function(){var e=i(NestedPages.selectors.bulkEditForm).find("select");i.each(e,function(){i(this).find("option").first().prop("selected",!0),i(this).find("option").removeAttr("disabled")});var t=i(NestedPages.selectors.bulkEditForm).find(".cat-checklist");i.each(t,function(){i(this).find("input[type=checkbox]").prop("checked",!1)})},o.init()},(NestedPages=NestedPages||{}).HiddenItemCount=function(){var e=this,a=jQuery;return e.init=function(){e.bindEvents()},e.bindEvents=function(){a(document).on("change",NestedPages.selectors.bulkActionsCheckbox,function(){e.toggleHiddenCount()}),a(document).on("click",NestedPages.selectors.toggleAll,function(){e.toggleHiddenCount()}),a(document).on("click",NestedPages.selectors.pageToggle,function(){e.toggleHiddenCount()})},e.toggleHiddenCount=function(){var t=0;a.each(a(NestedPages.selectors.bulkActionsCheckbox),function(){if(a(this).is(":checked")){if(a(this).parent("div").hasClass("np-check-all"))return;var e=a(this).closest(".page-row");a(e).is(":visible")||t++}}),t<1?a(NestedPages.selectors.hiddenItemCountParent).hide():(a(NestedPages.selectors.hiddenItemCount).text(t),a(NestedPages.selectors.hiddenItemCountParent).show())},e.init()},(NestedPages=NestedPages||{}).MenuToggle=function(){var a=this,n=jQuery;return a.formatter=new NestedPages.Formatter,a.bindEvents=function(){n(document).on("click",NestedPages.selectors.childToggleLink,function(e){e.preventDefault(),a.toggleSingleMenu(n(this))}),n(document).on("click",NestedPages.selectors.toggleAll,function(e){e.preventDefault(),a.toggleAllMenus()})},a.toggleSingleMenu=function(e){var t=n(e).parent(NestedPages.selectors.childToggle).parent(NestedPages.selectors.row).siblings("ol");n(e).toggleClass("open"),n(t).toggle(),a.formatter.setBorders(),a.formatter.setNestedMargins(),a.syncUserToggles()},a.toggleAllMenus=function(){var e=NestedPages.selectors.toggleAll;if("closed"===n(e).attr("data-toggle"))return n(NestedPages.selectors.lists).show(),n(e).attr("data-toggle","opened").text(NestedPages.jsData.collapseText),n(NestedPages.selectors.childToggle+" a").addClass("open"),a.formatter.setBorders(),void a.syncUserToggles();n(NestedPages.selectors.lists).not(n(NestedPages.selectors.lists)[0]).hide(),n(e).attr("data-toggle","closed").text(NestedPages.jsData.expandText),n(NestedPages.selectors.childToggle+" a").removeClass("open"),a.formatter.setBorders(),a.syncUserToggles()},a.visibleRowIDs=function(){var s=[],e=n(NestedPages.selectors.rows+":visible");return n.each(e,function(e,t){var a=n(this).attr("id");s.push(a.replace("menuItem_",""))}),s},a.syncUserToggles=function(){n.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.syncToggles,nonce:NestedPages.jsData.nonce,ids:a.visibleRowIDs(),posttype:NestedPages.jsData.posttype},success:function(e){"success"!==e.status&&console.log("There was an error saving toggled pages.")}})},a.bindEvents()},(NestedPages=NestedPages||{}).PageToggle=function(){var a=this,s=jQuery;return a.activeButton="",a.formatter=new NestedPages.Formatter,a.init=function(){a.bindEvents()},a.bindEvents=function(){s(document).on("click",NestedPages.selectors.toggleHidden,function(e){e.preventDefault(),a.activeButton=s(this),a.toggleHidden()}),s(document).on("click",NestedPages.selectors.toggleStatus,function(e){e.preventDefault(),a.toggleStatus(s(this))})},a.toggleHidden=function(){var e=s(a.activeButton),t=s(e).attr("href");if("#show"==t)return s(e).attr("href","#hide").text(NestedPages.jsData.showHiddenText),s(NestedPages.selectors.hiddenRows).removeClass("shown").hide(),a.formatter.updateSubMenuToggle(),void a.formatter.setBorders();"#hide"==t&&(s(e).attr("href","#show").text(NestedPages.jsData.hideHiddenText),s(NestedPages.selectors.hiddenRows).addClass("shown").show(),a.formatter.updateSubMenuToggle(),a.formatter.setBorders())},a.toggleStatus=function(e){var t=s(e).attr("href");t=t.substring(1),s(NestedPages.selectors.syncCheckbox).attr("disabled",!1),s(NestedPages.selectors.toggleStatus).removeClass("active"),s(e).addClass("active"),"draft"==t&&(s(NestedPages.selectors.syncCheckbox).attr("disabled",!0),s("."+t).addClass("nested-visible")),"all"!=t?(s(NestedPages.selectors.rows).hide(),s("."+t).show()):s(NestedPages.selectors.rows).show()},a.init()},(NestedPages=NestedPages||{}).Nesting=function(){var o=this,i=jQuery;o.formatter=new NestedPages.Formatter,o.initializeSortable=function(){if(!NestedPages.jsData.nestable)return o.initializeSortableFlat();i(NestedPages.selectors.sortable).not(NestedPages.selectors.notSortable).nestedSortable({items:NestedPages.selectors.rows,toleranceElement:"> .row",handle:NestedPages.selectors.handle,placeholder:"ui-sortable-placeholder",tabSize:56,isAllowed:function(e,t,a){return!(i(t).hasClass("post-type-np-redirect")&&!i(a).hasClass("post-type-np-redirect"))},start:function(e,t){t.placeholder.height(t.item.height())},sort:function(e,t){o.formatter.updatePlaceholderWidth(t)},stop:function(e,t){setTimeout(function(){o.formatter.updateSubMenuToggle(),o.formatter.setBorders(),o.formatter.setNestedMargins()},100),o.syncNesting()}})},o.initializeSortableFlat=function(){var e=i(NestedPages.selectors.lists).not(NestedPages.selectors.notSortable);i.each(e,function(){i(this).sortable({items:">"+NestedPages.selectors.rows,handle:NestedPages.selectors.handle,placeholder:"ui-sortable-placeholder",forcePlaceholderSize:!0,start:function(e,t){t.placeholder.height(t.item.height())},sort:function(e,t){o.formatter.updatePlaceholderWidth(t)},stop:function(e,t){setTimeout(function(){o.formatter.updateSubMenuToggle(),o.formatter.setBorders(),o.formatter.setNestedMargins()},100),o.syncNesting()}})})},o.disableNesting=function(){i(NestedPages.selectors.sortable).sortable("destroy")},o.syncNesting=function(e,t){var a,s;if("1"!==nestedpages.manual_order_sync||e){i(NestedPages.selectors.errorDiv).hide(),i(NestedPages.selectors.loadingIndicator).show(),s=!!i(NestedPages.selectors.lists).first().hasClass("filtered"),a=NestedPages.jsData.nestable&&!s?i(NestedPages.selectors.sortable).nestedSortable("toHierarchy",{startDepthCount:0}):o.setNestingArray(),o.disableNesting();var n=NestedPages.jsData.syncmenu;"1"===nestedpages.manual_menu_sync&&(n="nosync"),i.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.syncNesting,nonce:NestedPages.jsData.nonce,list:a,post_type:NestedPages.jsData.posttype,syncmenu:n,filtered:s},success:function(e,t){if(o.initializeSortable(),"error"===e.status)i(NestedPages.selectors.errorDiv).text(e.message).show(),i(NestedPages.selectors.loadingIndicator).hide();else{if(t&&"function"==typeof t)return void t();i(NestedPages.selectors.loadingIndicator).hide()}}})}},o.setNestingArray=function(e){return ret=[],i(NestedPages.selectors.lists).first().children("li.page-row").each(function(){var e=o.recursiveNesting(this);ret.push(e)}),ret},o.recursiveNesting=function(e){var t,a=i(e).attr("id");if(a)return a=a.replace("menuItem_",""),t={id:a},0<i(e).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).length&&(t.children=[],i(e).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).each(function(){var e=o.recursiveNesting(this);t.children.push(e)})),t}},(NestedPages=NestedPages||{}).SyncMenuSetting=function(){var t=this,e=jQuery;return t.formatter=new NestedPages.Formatter,t.init=function(){t.bindEvents()},t.bindEvents=function(){e(document).ready(function(){"1"!==nestedpages.manual_menu_sync&&"1"===nestedpages.syncmenu&&t.syncSetting()}),e(document).on("change",NestedPages.selectors.syncCheckbox,function(){t.syncSetting()})},t.syncSetting=function(){"page"===NestedPages.jsData.posttype&&0!==e(NestedPages.selectors.syncCheckbox).length&&(NestedPages.jsData.syncmenu=e(NestedPages.selectors.syncCheckbox).is(":checked")?"sync":"nosync",e.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.syncMenu,nonce:NestedPages.jsData.nonce,post_type:NestedPages.jsData.posttype,syncmenu:NestedPages.jsData.syncmenu},success:function(e){"error"===e.status&&t.formatter.showAjaxError(e.message)},error:function(e){console.log(e)}}))},t.bindEvents()},(NestedPages=NestedPages||{}).NewPost=function(){var r=this,d=jQuery;return r.formatter=new NestedPages.Formatter,r.parent_id=0,r.posts="",r.form="",r.bindEvents=function(){d(document).on("open-modal",function(e,t,a){var s=d(t).attr("data-nestedpages-modal-toggle");void 0!==s&&"np-bulk-modal"==s&&r.openModal()}),d(document).on("submit",NestedPages.selectors.newPageForm,function(e){e.preventDefault()}),d(document).on("click",NestedPages.selectors.newPageSubmitButton,function(e){e.preventDefault(),r.submitForm(d(this))}),d(document).on("click",NestedPages.selectors.newPageTitle,function(e){e.preventDefault(),r.addTitleField(d(this))}),d(document).on("click",NestedPages.selectors.newPageRemoveTitle,function(e){e.preventDefault(),r.removeTitleField(d(this))}),d(document).on("click",NestedPages.selectors.addChildButton,function(e){e.preventDefault(),r.openQuickEdit(d(this))}),d(document).on("click",NestedPages.selectors.cancelNewChildButton,function(e){e.preventDefault(),r.cancelNewPage()}),d(document).on("click","["+NestedPages.selectors.newBeforeButton+"]",function(e){e.preventDefault(),r.openQuickEdit(d(this))}),d(document).on("click","["+NestedPages.selectors.newAfterButton+"]",function(e){e.preventDefault(),r.openQuickEdit(d(this))}),d(document).on("keydown",function(e){27===e.keyCode&&(r.cancelNewPage(),d(document).click())})},r.openModal=function(){var e=d(NestedPages.selectors.newPageFormContainer).clone().find(NestedPages.selectors.newPageForm);d(e).addClass("in-modal"),d(NestedPages.selectors.newPageModal).find(".modal-body").html(e),d(NestedPages.selectors.newPageModal).find("h3").text(nestedpages.add_multiple),d(NestedPages.selectors.newPageModal).find(".page_parent_id").val(r.parent_id),d(e).find(".np_title").first().focus(),d(e).find(NestedPages.selectors.newPageTitle).first().prop("tabindex","2")},r.openQuickEdit=function(e){var t=d(e).attr(NestedPages.selectors.newBeforeButton);t=void 0!==t&&""!==t&&t;var a=d(e).attr(NestedPages.selectors.newAfterButton);a=void 0!==a&&""!==a&&a;var s=d(e).closest(NestedPages.selectors.row).parent("li"),n=d(NestedPages.selectors.newPageFormContainer).clone();if(0<d(s).children("ol").length){var o=d(s).children("ol");d(n).insertBefore(o)}else d(n).appendTo(s);d(n).siblings(NestedPages.selectors.row).hide(),r.formatter.showQuickEdit(),d(n).find(".parent_name").html("<em>Parent:</em> "+d(e).attr("data-parentname")),t||a||d(n).find(".page_parent_id").val(d(e).attr("data-id")),t&&(d(n).find(".page_before_id").val(t),d(n).find("[data-new-post-relation-title]").text(nestedpages.insert_before+": "+d(e).attr("data-parentname"))),a&&(d(n).find(".page_after_id").val(a),d(n).find("[data-new-post-relation-title]").text(nestedpages.insert_after+": "+d(e).attr("data-parentname"))),d(n).show(),d(n).find(".np_title").focus(),d(n).find(NestedPages.selectors.newPageTitle).prop("tabindex","2")},r.cancelNewPage=function(){r.formatter.removeQuickEdit(),d(NestedPages.selectors.newChildError).hide(),d(NestedPages.selectors.newPageModal).find(".modal-body").empty(),d(NestedPages.selectors.sortable).find(".new-child").remove(),d(NestedPages.selectors.row).show()},r.addTitleField=function(e){var t=d(e).parents("form"),a=d(e).siblings(".new-page-titles").children("li").length+1,s='<li><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="handle np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg><div class="form-control new-child-row"><label>'+NestedPages.jsData.titleText+'</label><div><input type="text" name="post_title[]" class="np_title" placeholder="'+NestedPages.jsData.titleText+'" value="" tabindex="'+a+'" /><a href="#" class="button-secondary np-remove-child">-</a></div></div></li>';d(e).siblings(".new-page-titles").append(s);d(t).find(".np_title").last().focus(),d(t).find(NestedPages.selectors.newPageTitle).prop("tabindex",a++),d(".new-page-titles").sortable({items:"li",handle:".handle"}),r.toggleAddEditButton(t)},r.removeTitleField=function(e){var t=d(e).parents("form");d(e).parents(".new-child-row").parent("li").remove(),r.toggleAddEditButton(t)},r.submitForm=function(e){r.toggleLoading(!0),r.form=d(e).parents("form");var a=!!d(e).hasClass("add-edit"),t=NestedPages.formActions.newPage;""!==d(r.form).find(".page_before_id").val()&&(t=NestedPages.formActions.newBeforeAfter),""!==d(r.form).find(".page_after_id").val()&&(t=NestedPages.formActions.newBeforeAfter),d.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:d(r.form).serialize()+"&action="+t+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(e){if("error"===e.status)return r.toggleLoading(!1),void d(r.form).find(NestedPages.selectors.quickEditErrorDiv).text(e.message).show();if(!0==a){var t=e.new_pages[0].edit_link;return t=t.replace(/&amp;/g,"&"),void window.location.replace(t)}r.toggleLoading(!1),r.posts=e.new_pages,r.addPosts()},error:function(e){console.log(e),r.toggleLoading(!1),d(r.form).find(NestedPages.selectors.quickEditErrorDiv).text("The form could not be saved at this time.").show()}})},r.addPosts=function(){var e=d(r.form).find(".page_before_id").val();e=""!==e&&e;var t=d(r.form).find(".page_after_id").val();t=""!==t&&t;var a=d(r.form).parent(".new-child").parent(".page-row");if(0!==d(a).children("ol").length||e||t||d(a).append('<ol class="nplist"></ol>'),d(r.form).hasClass("in-modal"))var s=d(".nplist.sortable li.page-row:first");else s=d(a).children("ol");for(i=0;i<r.posts.length;i++)r.appendRows(s,r.posts[i],e,t);e||t||d(s).show(),r.formatter.updateSubMenuToggle(),r.formatter.setNestedMargins(),r.cancelNewPage(),d(document).trigger("close-modal-manual")},r.appendRows=function(e,t,a,s){var n='<li id="menuItem_'+t.id+'" class="page-row';if("publish"===t.status&&(n+=" published"),n+='">',NestedPages.jsData.hierarchical?(n+='<div class="row">',n+='<div class="child-toggle"></div>'):(n+='<div class="row non-hierarchical">',n+='<div class="non-hierarchical-spacer"></div>'),n+='<div class="row-inner">',n+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="np-icon-sub-menu"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M19 15l-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9l6 6z" class="arrow" /></svg>',n+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="handle np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg>',n+='<a href="'+t.edit_link+'" class="page-link page-title">',n+='<span class="title">'+t.title+"</span>","Publish"!==t.status?n+='<span class="status">('+t.status+")</span>":n+='<span class="status"></span>',n+='<span class="nav-status">',"hide"===t.np_nav_status&&(n+=" "+nestedpages.hidden),n+="</span>",n+='<span class="edit-indicator">Edit</span>',n+="</a>",NestedPages.jsData.hierarchical||(n+='<div class="np-post-columns">',n+='<ul class="np-post-info">',n+='<li><span class="np-author-display">'+t.author_formatted+"</span></li>",n+="<li>"+t.date_formatted+"</li>",n+="</ul>",n+="</div>"),d(".nplist").first().hasClass("has-yoast")&&(n+='<span class="np-seo-indicator na"></span>'),n+='<div class="action-buttons">',n+='<div class="nestedpages-dropdown" data-dropdown><a href="#" class="np-btn has-icon toggle" data-dropdown-toggle><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></a><ul class="nestedpages-dropdown-content" data-dropdown-content>',n+='<li><a href="#" class="open-redirect-modal" data-parentid="'+t.id+'"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>'+nestedpages.add_link+"</a></li>",n+='<li><a href="#" class="add-new-child" data-id="'+t.id+'" data-parentname="'+t.title+'"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zM3 8v8l4-4-4-4zm8 9h10v-2H11v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'+nestedpages.add_child_short+"</a></li>",n+="</ul></div>",n+='<a href="#" class="np-btn np-quick-edit" data-id="'+t.id+'" data-template="'+t.page_template+'" data-title="'+t.title+'" data-slug="'+t.slug+'" data-commentstatus="closed" data-status="'+t.status.toLowerCase()+'" data-np-status="show"\tdata-navstatus="show" data-author="'+t.author+'" data-template="'+t.template+'" data-month="'+t.month+'" data-day="'+t.day+'" data-year="'+t.year+'" data-hour="'+t.hour+'" data-minute="'+t.minute+'" data-datepicker="'+t.datepicker+'" data-time="'+t.time+'" data-formattedtime="'+t.formattedtime+'" data-ampm="'+t.ampm+'">'+nestedpages.quick_edit+"</a>",n+='<a href="'+t.view_link+'" class="np-btn" target="_blank">'+nestedpages.view+"</a>",n+='<a href="'+t.delete_link+'" class="np-btn np-btn-trash"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="np-icon-remove"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" class="icon"/><path d="M0 0h24v24H0z" fill="none"/></svg></a>',n+="</div>\x3c!-- .action-buttons --\x3e",n+="</div>\x3c!-- .row-inner --\x3e</div>\x3c!-- .row --\x3e",n+="</li>",a){var o=r.findRowById(a);d(n).insertBefore(o)}else if(s){o=r.findRowById(s);d(n).insertAfter(o)}else d(e).append(n)},r.findRowById=function(e){return d(NestedPages.selectors.rows+"#menuItem_"+e)},r.toggleAddEditButton=function(e){var t=d(e).find(".np_title").length;t<1?d(NestedPages.selectors.newPageSubmitButton).hide():(d(NestedPages.selectors.newPageSubmitButton).show(),1<t?d(NestedPages.selectors.newPageSubmitButton+".add-edit").hide():d(NestedPages.selectors.newPageSubmitButton+".add-edit").show())},r.toggleLoading=function(e){if(e)return d(NestedPages.selectors.quickEditErrorDiv).hide(),d(NestedPages.selectors.newPageSubmitButton).attr("disabled","disabled"),void d(NestedPages.selectors.quickEditLoadingIndicator).show();d(NestedPages.selectors.newPageSubmitButton).attr("disabled",!1),d(NestedPages.selectors.quickEditLoadingIndicator).hide()},r.bindEvents()},(NestedPages=NestedPages||{}).QuickEditPost=function(){var l=this,c=jQuery;return l.formatter=new NestedPages.Formatter,l.button="",l.initialData="",l.parent_li="",l.form="",l.flatTerms="",l.termNames="",l.saveButton="",l.newData="",l.row="",l.bindEvents=function(){c(document).on("click",NestedPages.selectors.quickEditOpen,function(e){e.preventDefault(),l.button=c(this),l.openForm()}),c(document).on("click",NestedPages.selectors.quickEditCancel,function(e){e.preventDefault(),l.formatter.removeQuickEdit()}),c(document).on("change",".keep_private",function(){this.checked?c(".post_password").val("").prop("readonly",!0):c(".post_password").prop("readonly",!1)}),c(document).on("click",NestedPages.selectors.quickEditSaveButton,function(e){e.preventDefault(),l.saveButton=c(this),l.save()}),c(document).on("keydown",function(e){27===e.keyCode&&l.formatter.removeQuickEdit()})},l.openForm=function(){l.setInitialData(),l.createForm(),l.populateForm(),l.populateFlatTaxonomies()},l.setInitialData=function(){l.initialData={id:c(l.button).attr("data-id"),title:c(l.button).attr("data-title"),slug:c(l.button).attr("data-slug"),author:c(l.button).attr("data-author"),cs:c(l.button).attr("data-commentstatus"),status:c(l.button).attr("data-status"),template:c(l.button).attr("data-template"),month:c(l.button).attr("data-month"),day:c(l.button).attr("data-day"),year:c(l.button).attr("data-year"),hour:c(l.button).attr("data-hour"),minute:c(l.button).attr("data-minute"),navstatus:c(l.button).attr("data-navstatus"),npstatus:c(l.button).attr("data-np-status"),navtitle:c(l.button).attr("data-navtitle"),navtitleattr:c(l.button).attr("data-navtitleattr"),navcss:c(l.button).attr("data-navcss"),linktarget:c(l.button).attr("data-linktarget"),password:c(l.button).attr("data-password"),datepicker:c(l.button).attr("data-datepicker"),time:c(l.button).attr("data-formattedtime"),timeTwentyFour:c(l.button).attr("data-time"),ampm:c(l.button).attr("data-ampm"),timeFormat:c(l.button).attr("data-timeformat"),sticky:c(l.button).attr("data-sticky")};var e=c(l.button)[0].attributes;c.each(e,function(e,t){t.name.includes("data-npcustom")&&(l.initialData[t.name]=t.value)}),l.initialData.h_taxonomies=[],l.initialData.f_taxonomies=[],l.parent_li=c(l.button).closest(NestedPages.selectors.row).parent("li");var t=c(l.parent_li).attr("class").split(/\s+/);for(i=0;i<t.length;i++)"in-"===t[i].substring(0,3)&&l.initialData.h_taxonomies.push(t[i]),"inf-"===t[i].substring(0,4)&&l.initialData.f_taxonomies.push(t[i])},l.createForm=function(){if(l.form=c(NestedPages.selectors.quickEditPostForm).clone(),0<c(l.parent_li).children("ol").length){var e=c(l.parent_li).children("ol");c(l.form).insertBefore(e)}else c(l.form).appendTo(l.parent_li);c(l.form).siblings(NestedPages.selectors.row).hide(),c(l.form).show()},l.populateForm=function(){for(var e in c(l.form).find(".page_id").html("<em>ID:</em> "+l.initialData.id),c(l.form).find(".np_id").val(l.initialData.id),c(l.form).find(".np_title").val(l.initialData.title),c(l.form).find(".np_slug").val(l.initialData.slug),c(l.form).find(".np_author select").val(l.initialData.author),c(l.form).find(".np_status").val(l.initialData.status),c(l.form).find(".np_nav_title").val(l.initialData.navtitle),c(l.form).find(".np_title_attribute").val(l.initialData.navtitleattr),c(l.form).find(".np_nav_css_classes").val(l.initialData.navcss),c(l.form).find(".post_password").val(l.initialData.password),c(l.form).find(".np_publish_date").val(l.initialData.datepicker),"open"===l.initialData.cs&&c(l.form).find(".np_cs").attr("checked","checked"),""!==l.initialData.template?c(l.form).find(".np_template").val(l.initialData.template):c(l.form).find(".np_template").val("default"),"private"===l.initialData.status&&(c(l.form).find(".post_password").attr("readonly",!0),c(l.form).find(".keep_private").attr("checked",!0)),"hide"===l.initialData.npstatus?c(l.form).find(".nested_pages_status").attr("checked","checked"):c(l.form).find(".nested_pages_status").removeAttr("checked"),"hide"===l.initialData.navstatus?c(l.form).find(".np_nav_status").attr("checked","checked"):c(l.form).find(".np_nav_status").attr("checked",!1),"_blank"===l.initialData.linktarget?c(l.form).find(".link_target").attr("checked","checked"):c(l.form).find(".link_target").attr("checked",!1),"private"===l.initialData.status&&c(l.form).find(".np_status").val("publish"),"sticky"===l.initialData.sticky?c(l.form).find(".np-sticky").attr("checked","checked"):c(l.form).find(".np-sticky").removeAttr("checked"),"H:i"===l.initialData.timeFormat?c(l.form).find(".np_time").val(l.initialData.timeTwentyFour):(c(l.form).find(".np_time").val(l.initialData.time),c(l.form).find(".np_ampm").val(l.initialData.ampm),c(l.form).find('select[name="mm"]').val(l.initialData.month),c(l.form).find('input[name="jj"]').val(l.initialData.day),c(l.form).find('input[name="aa"]').val(l.initialData.year),c(l.form).find('input[name="hh"]').val(l.initialData.hour),c(l.form).find('input[name="mn"]').val(l.initialData.minute)),l.initialData)if(e.includes("npcustom")&&l.initialData.hasOwnProperty(e)){var t=e.replace("data-npcustom-","");t=t.toLowerCase(),c(l.form).find('[data-np-custom-field="'+t+'"]').val(l.initialData[e])}if(l.populateFlatTaxonomies(),l.initialData.hasOwnProperty("h_taxonomies")){var a=l.initialData.h_taxonomies;for(i=0;i<a.length;i++){var s="#"+a[i];c(l.form).find(s).attr("checked","checked")}}var n=c(l.form).find(".np_datepicker");c.each(n,function(){var e=c(this);e.datepicker({dateFormat:e.attr("data-datepicker-format"),beforeShow:function(e,t){c("#ui-datepicker-div").addClass("nestedpages-datepicker")}})}),l.formatter.showQuickEdit(),c(l.form).show()},l.populateFlatTaxonomies=function(){l.initialData.hasOwnProperty("f_taxonomies")&&(l.createTaxonomyObject(),l.getTermNames(),l.setWPSuggest())},l.createTaxonomyObject=function(){var e={};for(i=0;i<l.initialData.f_taxonomies.length;i++){var t=l.initialData.f_taxonomies[i],a=t.split("-"),s=a.indexOf("nps"),n=a.splice(s+1);n=n.join("-");var o=t.split("-").splice(0,s);o.shift("inf");var r=o.join("-");r in e||(e[r]=[]),e[r].push(n)}l.flatTerms=e},l.getTermNames=function(){c.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.getTaxonomies,nonce:NestedPages.jsData.nonce,terms:l.flatTerms},success:function(e){l.termNames=e.terms,l.populateFlatTaxonomyFields()}})},l.populateFlatTaxonomyFields=function(){l.termNames&&c.each(l.termNames,function(e,t){var a=c("#"+e+"-quickedit");c(a).val(t.join(","))})},l.setWPSuggest=function(){var e=c(l.form).find("[data-autotag]");c.each(e,function(e,t){var a=c(this).attr("data-taxonomy");c(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+a,{multiple:!0,multipleSep:","})})},l.save=function(){l.toggleLoading(!0),c.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:c(l.form).find("form").serialize()+"&action="+NestedPages.formActions.quickEditPost+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(e){"error"===e.status?(l.toggleLoading(!1),c(l.form).find(NestedPages.selectors.quickEditErrorDiv).text(e.message).show()):(l.toggleLoading(!1),l.newData=e.post_data,l.updatePostRow())},error:function(e){console.log(e)}})},l.updatePostRow=function(){l.row=c(l.button).parents(".row-inner"),c(l.row).find(".title").text(l.newData.post_title),c(l.row).find(".np-view-button").attr("href",l.newData.permalink);var e=c(l.row).find(".status");if("publish"!==l.newData._status&&"future"!==l.newData._status){var t=nestedpages.post_statuses[l.newData._status].label;c(e).text("("+t+")")}else c(e).text("");if("private"===l.newData.keep_private&&c(e).text(nestedpages.private),""!==l.newData.post_password&&void 0!==l.newData.post_password){var a=c(e).text();a+=' <span class="locked">',a+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/></svg>',a+="</span>",c(e).html(a)}var s=c(l.row).find(".nav-status");"hide"==l.newData.nav_status?c(s).text("(Hidden)"):c(s).text("");var n=c(l.row).parent("li");"hide"==l.newData.np_status?(c(n).addClass("np-hide"),c(l.row).find(".status").after('<svg class="row-status-icon status-np-hidden" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z" fill="none"/><path class="icon" d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>')):(c(n).removeClass("np-hide"),c(l.row).find(".status-np-hidden").remove());var o=c(l.row).find(".sticky");"sticky"==l.newData.sticky?c(o).show():c(o).hide(),NestedPages.jsData.hierarchical||c(l.row).find(".np-author-display").text(l.newData.author_name);var i=c(l.row).find(NestedPages.selectors.quickEditOpen);for(var r in c(i).attr("data-id",l.newData.post_id),c(i).attr("data-template",l.newData.page_template),c(i).attr("data-title",l.newData.post_title),c(i).attr("data-slug",l.newData.post_name),c(i).attr("data-commentstatus",l.newData.comment_status),c(i).attr("data-status",l.newData._status),c(i).attr("data-sticky",l.newData.sticky),"private"===l.newData.keep_private&&c(i).attr("data-status","private"),c(i).attr("data-author",l.newData.post_author),c(i).attr("data-np-status",l.newData.np_status),c(i).attr("data-password",l.newData.post_password),c(i).attr("data-navstatus",l.newData.nav_status),c(i).attr("data-navtitle",l.newData.np_nav_title),c(i).attr("data-linktarget",l.newData.link_target),c(i).attr("data-navtitleattr",l.newData.np_title_attribute),c(i).attr("data-navcss",l.newData.np_nav_css_classes),c(i).attr("data-month",l.newData.mm),c(i).attr("data-day",l.newData.jj),c(i).attr("data-year",l.newData.aa),c(i).attr("data-hour",l.newData.hh),c(i).attr("data-minute",l.newData.mn),c(i).attr("data-datepicker",l.newData.np_date),c(i).attr("data-time",l.newData.np_time),c(i).attr("data-formattedtime",l.newData.np_time),c(i).attr("data-ampm",l.newData.np_ampm),l.newData)if(r.includes("np_custom")&&l.newData.hasOwnProperty(r)){var d=r.replace("np_custom_","data-npcustom-");c(i).attr(d,l.newData[r])}l.removeTaxonomyClasses(),l.addCategoryClasses(),l.addHierarchicalClasses(),l.addFlatClasses(),l.addStatusClass(),l.formatter.removeQuickEdit(),l.formatter.flashRow(l.row)},l.addStatusClass=function(){var e=["published","draft","pending","future"];for(i=0;i<e.length;i++)c(l.row).removeClass(e[i]);c(l.row).addClass(l.newData._status)},l.removeTaxonomyClasses=function(){taxonomies=[];var e=c(l.row).attr("class").split(/\s+/);for(i=0;i<e.length;i++)"in-"===e[i].substring(0,3)&&c(l.row).removeClass(e[i]),"inf-"===e[i].substring(0,4)&&c(l.row).removeClass(e[i])},l.addCategoryClasses=function(){if(l.newData.hasOwnProperty("post_category")){var e=l.newData.post_category;for(i=0;i<e.length;i++){var t="in-category-"+e[i];c(l.row).addClass(t)}}},l.addHierarchicalClasses=function(){if(l.newData.hasOwnProperty("tax_input")){var e=l.newData.tax_input;c.each(e,function(e,t){for(i=0;i<t.length;i++){var a="in-"+e+"-"+t[i];c(l.row).addClass(a)}})}},l.addFlatClasses=function(){if(l.newData.hasOwnProperty("flat_tax")){var e=l.newData.flat_tax;c.each(e,function(e,t){for(i=0;i<t.length;i++){var a="inf-"+e+"-nps-"+t[i];c(l.row).addClass(a)}})}},l.toggleLoading=function(e){if(e)return c(NestedPages.selectors.quickEditErrorDiv).hide(),c(l.saveButton).attr("disabled","disabled"),void c(NestedPages.selectors.quickEditLoadingIndicator).show();c(l.saveButton).attr("disabled",!1),c(NestedPages.selectors.quickEditLoadingIndicator).hide()},l.bindEvents()},(NestedPages=NestedPages||{}).QuickEditLink=function(){var o=this,i=jQuery;return o.formatter=new NestedPages.Formatter,o.button="",o.postData="",o.newPostData="",o.form="",o.bindEvents=function(){i(document).on("click",NestedPages.selectors.quickEditButtonLink,function(e){e.preventDefault(),o.formatter.removeQuickEdit(),o.button=i(this),o.openQuickEdit()}),i(document).on("click",NestedPages.selectors.quickEditLinkSaveButton,function(e){e.preventDefault(),o.submitForm()}),i(document).on("keydown",function(e){27===e.keyCode&&o.formatter.removeQuickEdit()})},o.openQuickEdit=function(){o.setData(),o.createForm(),o.populateForm()},o.setData=function(){o.postData={id:i(o.button).attr("data-id"),url:i(o.button).attr("data-url"),title:i(o.button).attr("data-title"),status:i(o.button).attr("data-status"),navstatus:i(o.button).attr("data-navstatus"),npstatus:i(o.button).attr("data-np-status"),linktarget:i(o.button).attr("data-linktarget"),parentid:i(o.button).attr("data-parentid"),navtitleattr:i(o.button).attr("data-navtitleattr"),navcss:i(o.button).attr("data-navcss"),navtype:i(o.button).attr("data-nav-type"),navobject:i(o.button).attr("data-nav-object"),navobjectid:i(o.button).attr("data-nav-object-id"),navoriginallink:i(o.button).attr("data-nav-original-link"),navoriginaltitle:i(o.button).attr("data-nav-original-title")}},o.createForm=function(){var e=i(o.button).closest(NestedPages.selectors.row).parent("li");if(o.form=i(NestedPages.selectors.quickEditLinkForm).clone(),0<i(e).children("ol").length){var t=i(e).children("ol");i(o.form).insertBefore(t)}else i(o.form).appendTo(e);i(o.form).siblings(NestedPages.selectors.row).hide()},o.populateForm=function(){if(i(o.form).find(".np_id").val(o.postData.id),i(o.form).find(".np_title").val(o.postData.title),i(o.form).find(".np_author select").val(o.postData.author),i(o.form).find(".np_status").val(o.postData.status),i(o.form).find(".np_content").val(o.postData.url),i(o.form).find(".np_parent_id").val(o.postData.parentid),i(o.form).find(".np_title_attribute").val(o.postData.navtitleattr),i(o.form).find(".np_nav_css_classes").val(o.postData.navcss),"hide"===o.postData.npstatus?i(o.form).find(".np_status").prop("checked","checked"):i(o.form).find(".np_status").removeAttr("checked"),"hide"===o.postData.navstatus?i(o.form).find(".np_nav_status").prop("checked","checked"):i(o.form).find(".np_nav_status").removeAttr("checked"),"_blank"===o.postData.linktarget?i(o.form).find(".link_target").prop("checked","checked"):i(o.form).find(".link_target").removeAttr("checked"),"custom"!==o.postData.navobject&&""!==o.postData.navobject){var e='<div class="form-control original-link">Original: <a href="'+o.postData.navoriginallink+'" target="_blank">'+o.postData.navoriginaltitle+"</a></div>";i(o.form).find("[data-url-field]").remove(),i(e).insertAfter(i(o.form).find("h3")),i(o.form).find("[data-np-menu-object-input]").val(o.postData.navobject),i(o.form).find("[data-np-menu-objectid-input]").val(o.postData.navobjectid),i(o.form).find("[data-np-menu-type-input]").val(o.postData.navtype),i(o.form).find("h3").text("Link: "+o.postData.navoriginaltitle)}else i(o.form).find("h3").text("Link"),i(o.form).find("[data-np-menu-object-input]").val("custom"),i(o.form).find("[data-np-menu-type-input]").val("custom");o.formatter.showQuickEdit(),i(o.form).show()},o.submitForm=function(){o.toggleLoading(!0),i.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:i(o.form).find("form").serialize()+"&action="+NestedPages.formActions.quickEditLink+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(e){"error"===e.status?(o.toggleLoading(!1),i(o.form).find(NestedPages.selectors.quickEditErrorDiv).text(e.message).show()):(o.toggleLoading(!1),o.newPostData=e.post_data,o.updateRow())},error:function(e){o.toggleLoading(!1),i(o.form).find(NestedPages.selectors.quickEditErrorDiv).text("The form could not be saved at this time.").show()}})},o.updateRow=function(){var e=i(o.form).siblings(".row");i(e).find(".title").html(o.newPostData.post_title+' <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path class="icon" d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>');var t=i(e).find(".status");"publish"!==o.newPostData._status&&"future"!==o.newPostData._status?i(t).text("("+o.newPostData._status+")"):i(t).text("");var a=i(e).find(".nav-status");"hide"==o.newPostData.nav_status?i(a).text("("+NestedPages.jsData.hiddenText+")"):i(a).text("");var s=i(e).parent("li");"hide"==o.newPostData.np_status?(i(s).addClass("np-hide"),i(e).find(".status").after('<svg class="row-status-icon status-np-hidden" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z" fill="none"/><path class="icon" d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>')):(i(s).removeClass("np-hide"),i(e).find(".status-np-hidden").remove());var n=i(e).find(NestedPages.selectors.quickEditButtonLink);i(n).attr("data-id",o.newPostData.post_id),i(n).attr("data-title",o.newPostData.post_title),i(n).attr("data-url",o.newPostData.post_content),i(n).attr("data-status",o.newPostData._status),i(n).attr("data-navstatus",o.newPostData.nav_status),i(n).attr("data-np-status",o.newPostData.np_status),i(n).attr("data-linkTarget",o.newPostData.linkTarget),i(n).attr("data-navtitleattr",o.newPostData.titleAttribute),i(n).attr("data-navcss",o.newPostData.cssClasses),o.formatter.removeQuickEdit(),o.formatter.flashRow(e)},o.toggleLoading=function(e){if(i(".row").removeClass("np-updated").removeClass("np-updated-show"),e)return i(NestedPages.selectors.quickEditErrorDiv).hide(),i(NestedPages.selectors.quickEditLinkSaveButton).attr("disabled","disabled"),void i(NestedPages.selectors.quickEditLoadingIndicator).show();i(NestedPages.selectors.quickEditLinkSaveButton).attr("disabled",!1),i(NestedPages.selectors.quickEditLoadingIndicator).hide()},o.bindEvents()},(NestedPages=NestedPages||{}).Clone=function(){var t=this,a=jQuery;return t.parent_id="",t.parent_title="",t.parentLi=null,t.formatter=new NestedPages.Formatter,t.bindEvents=function(){a(document).on("click",NestedPages.selectors.cloneButton,function(e){e.preventDefault(),t.parent_id=a(this).attr("data-id"),t.parent_title=a(this).attr("data-parentname"),t.parentLi=a(this).parent(".row").parent(".page-row").parent(".npList"),t.openModal()}),a(document).on("click",NestedPages.selectors.confirmClone,function(e){e.preventDefault(),t.clone()})},t.openModal=function(){a("#"+NestedPages.selectors.cloneModal).find("[data-clone-parent]").text(t.parent_title),a(document).trigger("open-modal-manual",NestedPages.selectors.cloneModal)},t.clone=function(){t.toggleLoading(!0),a.ajax({url:NestedPages.jsData.ajaxurl,type:"post",data:{action:NestedPages.formActions.clonePost,parent_id:t.parent_id,quantity:a(NestedPages.selectors.cloneQuantity).val(),status:a(NestedPages.selectors.cloneStatus).val(),author:a(NestedPages.selectors.cloneAuthor).find("select").val(),nonce:NestedPages.jsData.nonce,posttype:NestedPages.jsData.posttype},success:function(e){t.toggleLoading(!1),a(document).trigger("close-modal-manual"),location.reload()}})},t.toggleLoading=function(e){if(e)return a("#"+NestedPages.selectors.cloneModal).find("[data-clone-loading]").show(),void a(NestedPages.selectors.confirmClone).attr("disabled","disabled");a("#"+NestedPages.selectors.cloneModal).find("[data-clone-loading]").hide(),a(NestedPages.selectors.confirmClone).attr("disabled",!1)},t.bindEvents()},(NestedPages=NestedPages||{}).Tabs=function(){var r=this,d=jQuery;return r.selectors={tabToggle:"data-np-tab-toggle",tabPane:"data-np-tab-pane",tabGroup:"data-np-tab-group"},r.bindEvents=function(){d(document).on("click","["+r.selectors.tabToggle+"]",function(e){e.preventDefault(),r.toggleTabs(d(this))})},r.toggleTabs=function(e){for(var t=d(e).attr(r.selectors.tabGroup),a=d("*["+r.selectors.tabGroup+"="+t+"]["+r.selectors.tabPane+"]"),s=d(e).attr(r.selectors.tabToggle),n=d("*["+r.selectors.tabGroup+"="+t+"]["+r.selectors.tabToggle+"]"),o=[],i=0;i<n.length;i++)o[i]=d(n[i]).parent("li")[0];d(a).hide(),d(n).removeClass("active"),d(o).removeClass("active"),d.each(a,function(){d(this).attr(r.selectors.tabPane)==s&&d(this).show()}),d.each(n,function(){d(this).attr(r.selectors.tabToggle)==s&&(d(this).addClass("active"),d(this).parent("li").addClass("active"))}),d(document).trigger("tabs-changed",[s,t,e])},r.bindEvents()},jQuery(document).ready(function(){new NestedPages.Factory}),(NestedPages=NestedPages||{}).selectors={childToggle:".child-toggle",childToggleLink:".child-toggle a",toggleAll:".nestedpages-toggleall",toggleHidden:".np-toggle-hidden",toggleStatus:".np-toggle-publish",lists:".nplist",rows:".page-row",row:".row",sortable:".sortable",notSortable:".no-sort",handle:".handle",published:".published",hiddenRows:".np-hide",errorDiv:"#np-error",loadingIndicator:"#nested-loading",syncCheckbox:".np-sync-menu",syncForm:".np-sync-menu-cont",ajaxError:"[data-nestedpages-error]",trashWithChildrenButton:"[data-nestedpages-trash-children]",toggleEditButtons:".np-toggle-edit",bulkActionsHeader:".nestedpages-list-header",bulkActionsForm:"[data-np-bulk-form]",bulkActionsCheckbox:"[data-np-bulk-checkbox]",bulkActionsIds:"[data-np-bulk-ids]",bulkActionRedirectIds:"[data-np-bulk-redirect-ids]",hiddenItemCount:"[data-np-hidden-count]",hiddenItemCountParent:"[data-np-hidden-count-parent]",bulkEditForm:"[data-np-bulk-edit-form]",bulkEditTitles:"[data-np-bulk-titles]",bulkEditRemoveItem:"[data-np-remove-bulk-item]",bulkEditCancel:"[data-np-cancel-bulk-edit]",bulkEditLinkCount:"[data-bulk-edit-link-count]",quickEditOverlay:".np-inline-overlay",quickEditLoadingIndicator:".np-qe-loading",quickEditErrorDiv:".np-quickedit-error",quickEditCancel:".np-cancel-quickedit",quickEditButtonLink:".np-quick-edit-redirect",quickEditLinkForm:".quick-edit-form-redirect",quickEditLinkSaveButton:".np-save-quickedit-redirect",quickEditOpen:".np-quick-edit",quickEditPostForm:".quick-edit-form",quickEditSaveButton:".np-save-quickedit",openLinkModal:".open-redirect-modal",linkModal:"np-link-modal",saveLink:".np-save-link",linkLoadingIndicator:".np-link-loading",linkErrorDiv:".np-new-link-error",linkForm:".np-new-link-form",linkDeleteButton:"[data-np-confirm-delete]",linkDeleteConfirmationButton:"[data-delete-confirmation]",linkDeleteConfirmationModal:"np-delete-confirmation-modal",linkDeleteConfirmationModalText:"[data-np-link-delete-text]",openPageModal:".open-bulk-modal",newPageModal:"#np-bulk-modal",newPageFormContainer:".new-child-form",newPageForm:".np-new-child-form",newPageSubmitButton:".np-save-newchild",newPageTitle:".add-new-child-row",newPageRemoveTitle:".np-remove-child",addChildButton:".add-new-child",newChildError:".np-newchild-error",cancelNewChildButton:".np-cancel-newchild",newBeforeButton:"data-insert-before",newAfterButton:"data-insert-after",cloneButton:".clone-post",confirmClone:"[data-confirm-clone]",cloneModal:"np-clone-modal",cloneQuantity:"[data-clone-quantity]",cloneStatus:"[data-clone-status]",cloneAuthor:"[data-clone-author]",tabButtonParent:"[data-np-tabs]",tabButton:"[data-np-tab]",tabContent:"[data-np-tab-pane]",thumbnailContainer:".np-thumbnail",thumbnailContainerLink:".np-thumbnail.link",manualMenuSync:"[data-np-manual-menu-sync]",manualOrderSync:"[data-np-manual-order-sync]"},NestedPages.cssClasses={noborder:"no-border"},NestedPages.jsData={ajaxurl:ajaxurl,nonce:nestedpages.np_nonce,allPostTypes:nestedpages.post_types,syncmenu:"nosync",posttype:"",nestable:!0,sortable:!0,hierarchical:!0,expandText:nestedpages.expand_text,collapseText:nestedpages.collapse_text,showHiddenText:nestedpages.show_hidden,hideHiddenText:nestedpages.hide_hidden,quickEditText:nestedpages.quick_edit,hiddenText:nestedpages.hidden,titleText:nestedpages.title},NestedPages.formActions={syncToggles:"npnestToggle",syncNesting:"npsort",syncMenu:"npsyncMenu",newPage:"npnewChild",newBeforeAfter:"npnewBeforeAfter",quickEditLink:"npquickEditLink",getTaxonomies:"npgetTaxonomies",quickEditPost:"npquickEdit",clonePost:"npclonePost",search:"npmenuSearch",newMenuItem:"npnewMenuItem",manualMenuSync:"npmanualMenuSync",postSearch:"nppostSearch",wpmlTranslations:"npWpmlTranslations",resetSettings:"npresetSettings",resetUserPrefs:"npresetUserPreferences",resetAdminMenuSettings:"npresetAdminMenuSettings",trashWithChildren:"nptrashWithChildren"},NestedPages.Factory=function(){var t=this,e=jQuery;return t.formatter=new NestedPages.Formatter,t.dropdowns=new NestedPages.Dropdowns,t.modals=new NestedPages.Modals,t.checkAll=new NestedPages.CheckAll,t.bulkActions=new NestedPages.BulkActions,t.menuToggle=new NestedPages.MenuToggle,t.pageToggle=new NestedPages.PageToggle,t.nesting=new NestedPages.Nesting,t.syncMenuSetting=new NestedPages.SyncMenuSetting,t.newPage=new NestedPages.NewPost,t.quickEditLink=new NestedPages.QuickEditLink,t.quickEditPost=new NestedPages.QuickEditPost,t.clone=new NestedPages.Clone,t.tabs=new NestedPages.Tabs,t.menuLinks=new NestedPages.MenuLinks,t.hiddenItemCount=new NestedPages.HiddenItemCount,t.confirmDelete=new NestedPages.ConfirmDelete,t.manualSync=new NestedPages.ManualSync,t.postSearch=new NestedPages.PostSearch,t.postMove=new NestedPages.MovePost,t.wpml=new NestedPages.Wpml,t.trashWithChildren=new NestedPages.TrashWithChildren,t.init=function(){nestedpages.settings_page||(t.bindEvents(),t.setPostType(),t.setMenuSync(),t.setNestable(),t.setSortable(),t.formatter.updateSubMenuToggle(),t.formatter.setBorders(),t.formatter.setNestedMargins(),t.nesting.initializeSortable())},t.bindEvents=function(){e(document).on("click",NestedPages.selectors.quickEditOverlay,function(e){t.formatter.removeQuickEdit(),t.newPage.cancelNewPage()}),e(document).ready(function(){t.formatter.hideAjaxError(),t.formatter.sizeLinkThumbnails()})},t.setNestable=function(){var a=!1;e.each(NestedPages.jsData.allPostTypes,function(e,t){t.name===NestedPages.jsData.posttype&&(!0===t.hierarchical&&(a=!0),!0===t.disable_nesting&&(a=!1))}),NestedPages.jsData.nestable=a},t.setSortable=function(){var a=!0;e.each(NestedPages.jsData.allPostTypes,function(e,t){t.name===NestedPages.jsData.posttype&&void 0!==t.disable_sorting&&""!==t.disable_sorting&&"true"===t.disable_sorting&&(a=!1)}),NestedPages.jsData.sortable=a},t.setPostType=function(){NestedPages.jsData.posttype=nestedpages.current_post_type,void 0!==NestedPages.jsData.posttype&&""!==NestedPages.jsData.posttype||(NestedPages.jsData.posttype=e(NestedPages.selectors.sortable).attr("id").substring(3)),NestedPages.jsData.hierarchical=NestedPages.jsData.allPostTypes[NestedPages.jsData.posttype].hierarchical},t.setMenuSync=function(){NestedPages.jsData.syncmenu="1"===nestedpages.syncmenu?"sync":"nosync"},t.init()},(NestedPages=NestedPages||{}).MenuLinks=function(){var a=this,s=jQuery;return a.typeButton="",a.post="",a.formatter=new NestedPages.Formatter,a.selectors={form:"[data-np-menu-item-form]",typeSelect:"[data-np-menu-selection]",accordion:"[data-np-menu-accordion]",accordionItem:"[data-np-menu-accordion-item]",formPlaceholder:".np-menu-link-object-placeholder",formDetails:".np-menu-link-details",searchResults:"[data-np-search-result]",defaultResults:"[data-default-result]",originalLink:"[data-np-original-link]",saveButton:"[data-np-save-link]",urlInputCont:"[data-np-menu-url-cont]",errorDiv:"[data-np-error]"},a.fields={object:"[data-np-menu-object-input]",objectid:"[data-np-menu-objectid-input]",itemType:"[data-np-menu-type-input]",url:"[data-np-menu-url]",navigationLabel:"[data-np-menu-navigation-label]",titleAttribute:"[data-np-menu-title-attr]",cssClasses:"[data-np-menu-css-classes]",npStatus:"[data-np-menu-np-status]",linkTarget:"[data-np-menu-link-target]",menuTitle:"[data-np-menu-title]",parentPostType:"[data-np-menu-parent-post-type]"},a.search=new NestedPages.MenuSearch,a.bindEvents=function(){s(document).on("click",NestedPages.selectors.openLinkModal,function(e){e.preventDefault(),a.postParent=s(this).attr("data-parentid"),s(a.selectors.form).find(".parent_id").val(s(this).attr("data-parentid")),a.openModal()}),s(document).on("click",a.selectors.accordionItem,function(e){e.preventDefault(),a.accordion(s(this))}),s(document).on("click",a.selectors.typeSelect,function(e){e.preventDefault(),a.typeButton=s(this),a.setLinkType()}),s(document).on("keyup",a.fields.navigationLabel,function(){a.updateTitle()}),s(document).on("click",a.selectors.saveButton,function(e){e.preventDefault(),a.submitForm()}),s(document).on("keydown",function(e){27===e.keyCode&&s(document).trigger("close-modal-manual")})},a.openModal=function(){s(NestedPages.selectors.linkErrorDiv).hide(),s(NestedPages.selectors.linkModal).find("input").val(""),s(NestedPages.selectors.linkModal).find(".parent_id").val(a.postParent),a.clearForm(),s(a.selectors.accordion).find("ul").hide(),s(a.selectors.typeSelect).removeClass("active"),s(document).trigger("open-modal-manual",NestedPages.selectors.linkModal)},a.accordion=function(e){a.clearForm();var t=s(e).siblings("ul");if(s(t).is(":visible"))return s(e).removeClass("active"),void s(t).slideUp("fast");s(a.selectors.accordionItem).removeClass("active"),s(e).addClass("active"),s(e).parents(a.selectors.accordion).find("ul").slideUp("fast"),s(t).slideDown("fast")},a.setLinkType=function(){s(a.typeButton).hasClass("active")?a.clearForm():(s(a.typeButton).hasClass("np-custom-link")&&(s(a.selectors.accordionItem).removeClass("active"),s(a.selectors.accordion).find("ul").slideUp("fast")),s(a.selectors.formPlaceholder).hide(),a.populateForm())},a.populateForm=function(){s(a.selectors.saveButton).show(),s(a.selectors.typeSelect).removeClass("active"),s(a.typeButton).addClass("active"),s(a.fields.menuTitle).text(s(a.typeButton).text()).val(s(a.typeButton).text()),s(a.selectors.form).find("h3").find("em").text(s(a.typeButton).attr("data-np-object-name")),""!==s(a.typeButton).attr("data-np-permalink")?(s(a.selectors.form).find(a.selectors.urlInputCont).hide(),s(a.selectors.form).find(a.selectors.originalLink).html('<a href="'+s(a.typeButton).attr("data-np-permalink")+'">'+s(a.typeButton).text()+"</a>"),s(a.selectors.form).find(a.selectors.originalLink).parent(".original-link").show()):(s(a.selectors.form).find(a.selectors.urlInputCont).show(),s(a.selectors.form).find(a.selectors.originalLink).parent(".original-link").hide()),s(a.fields.object).val(s(a.typeButton).attr("data-np-menu-object")),s(a.fields.objectid).val(s(a.typeButton).attr("data-np-menu-objectid")),s(a.fields.itemType).val(s(a.typeButton).attr("data-np-menu-type")),s(a.selectors.formDetails).show()},a.clearForm=function(){s(a.selectors.form).find(a.selectors.errorDiv).hide(),s(a.selectors.saveButton).hide(),s(a.selectors.formDetails).hide(),s(a.selectors.formPlaceholder).show(),s(a.selectors.form).find("input").not(".parent_id").not(".parent-post-type").val(""),s(a.selectors.form).find(a.fields.linkTarget).val("_blank"),s(a.selectors.form).find('input[type="checkbox"]').attr("checked",!1),s(a.selectors.typeSelect).removeClass("active"),a.search.toggleLoading(!1),s(a.selectors.searchResults).remove(),s(a.selectors.defaultResults).show()},a.updateTitle=function(){var e=s(a.fields.navigationLabel).val(),t=s(a.selectors.form).find("h3").find("span");""!==e?(s(a.fields.menuTitle).val(e),s(t).text(e)):(s(a.fields.menuTitle).val(s(a.typeButton).text()),s(t).text(s(a.typeButton).text()))},a.submitForm=function(){a.toggleLoading(!0),s.ajax({url:NestedPages.jsData.ajaxurl,type:"post",data:s(a.selectors.form).serialize()+"&action="+NestedPages.formActions.newMenuItem+"&nonce="+NestedPages.jsData.nonce+"&post_type="+NestedPages.jsData.posttype+"&syncmenu="+NestedPages.jsData.syncmenu,success:function(e){a.toggleLoading(!1),"error"!==e.status?(a.post=e.post_data,a.createRow()):s(a.selectors.form).find(a.selectors.errorDiv).text(e.message).show()},error:function(e){console.log(e)}})},a.createRow=function(){var e='<li id="menuItem_'+a.post.id+'" class="page-row published';e+='">',e+='<div class="row"><div class="child-toggle"><div class="child-toggle-spacer"></div></div><div class="row-inner">',e+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="np-icon-sub-menu"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M19 15l-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9l6 6z" class="arrow" /></svg>',e+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="handle np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg>',e+='<a href="'+a.post.np_link_content+'" class="page-link page-title" target="_blank"><span class="title">'+a.post.menuTitle+' <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path class="icon" d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg></span>',e+='</a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ',e+='data-id="'+a.post.id+'"',e+='data-parentid="'+a.post.parent_id+'"',e+='data-title="'+a.post.menuTitle+'" ',e+='data-url="'+a.post.url+'" ',e+='data-status="publish" ',e+='data-np-status="show" ',e+='data-navstatus="show" ',e+='data-navcss="'+a.post.cssClasses+'" ',e+='data-navtitleattr="'+a.post.titleAttribute+'" ',e+='data-nav-type="'+a.post.menuType+'" ',e+='data-nav-object="'+a.post.objectType+'" ',e+='data-nav-object-id="'+a.post.objectId+'" ',e+='data-nav-original-link="'+a.post.original_link+'" ',e+='data-nav-original-title="'+a.post.original_title+'" ',e+='data-linktarget="'+a.post.link_target+'">',e+=NestedPages.jsData.quickEditText,e+="</a>",e+='<a href="'+a.post.delete_link+'" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>',e+="</div></div></div></li>","0"===a.post.parent_id?s(".nplist:first li:first").after(e):a.appendChildRow(e),s(document).trigger("close-modal-manual"),a.row=s("#menuItem_"+a.post.id).find(".row"),a.formatter.flashRow(a.row)},a.appendChildRow=function(e){var t=s("#menuItem_"+a.post.parent_id);0===s(t).children("ol").length?(e='<ol class="sortable nplist" style="display:block;">'+e+"</ol>",s(t).append(e)):s(t).find("ol:first").prepend(e),a.formatter.updateSubMenuToggle()},a.toggleLoading=function(e){if(e)return s(a.selectors.form).find(a.selectors.errorDiv).hide(),s(a.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).show(),void s(a.selectors.saveButton).attr("disabled","disabled");s(a.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).hide(),s(a.selectors.saveButton).attr("disabled",!1)},a.bindEvents()},(NestedPages=NestedPages||{}).MenuSearch=function(){var s=this,n=jQuery;return s.selectors={searchForms:"*[data-np-menu-search]",defaultResults:"[data-default-result]",loadingIndicator:".np-menu-search-loading",noResults:".np-menu-search-noresults",searchType:"data-search-type",searchObject:"data-search-object",searchResults:"[data-np-search-result]"},s.activeForm="",s.results="",s.defaultResults="",s.searchType="",s.searchObject="",s.init=function(){s.bindEvents()},s.bindEvents=function(){n(document).on("keyup",s.selectors.searchForms,function(){s.activeForm=n(this),n(s.selectors.searchResults).remove(),s.performSearch()})},s.performSearch=function(){if(s.defaultResults=n(s.activeForm).parent("li").siblings(s.selectors.defaultResults),2<n(s.activeForm).val().length)return n(s.defaultResults).hide(),s.toggleLoading(!0),void s.query();s.toggleLoading(!1),n(s.defaultResults).show()},s.query=function(){s.searchType=n(s.activeForm).attr(s.selectors.searchType),s.searchObject=n(s.activeForm).attr(s.selectors.searchObject),n.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.search,nonce:NestedPages.jsData.nonce,term:n(s.activeForm).val(),searchType:s.searchType,searchObject:s.searchObject},success:function(e){console.log(e),e.results?(s.results=e.results,s.toggleLoading(!1),"post_type"===s.searchType?s.appendPosts():s.appendTaxonomies()):(s.toggleLoading(!1),n(s.activeForm).siblings(s.selectors.noResults).show())}})},s.appendPosts=function(){var a="";n.each(s.results,function(e,t){a+='<li data-np-search-result><a href="#" data-np-menu-object="'+s.searchObject+'" data-np-menu-type="post_type" data-np-menu-objectid="'+t.ID+'" data-np-permalink="'+t.permalink+'" data-np-object-name="'+t.singular_name+'" data-np-menu-selection>'+t.post_title+"</a></li>"}),n(a).insertAfter(n(s.activeForm).parent("li")),s.toggleLoading(!1)},s.appendTaxonomies=function(){var a="";n.each(s.results,function(e,t){a+='<li data-np-search-result><a href="#" data-np-menu-object="'+s.searchObject+'" data-np-menu-type="post_type" data-np-menu-objectid="'+t.term_id+'" data-np-permalink="'+t.permalink+'" data-np-object-name="'+t.taxonomy+'" data-np-menu-selection>'+t.name+"</a></li>"}),n(a).insertAfter(n(s.activeForm).parent("li")),s.toggleLoading(!1)},s.toggleLoading=function(e){var t=n(s.activeForm).siblings(s.selectors.loadingIndicator);n(s.selectors.noResults).hide(),e?n(t).show():n(t).hide()},s.init()},jQuery(document).ready(function(){new NestedPagesTrash});var NestedPages,NestedPagesTrash=function(){var t=this,a=jQuery;return t.trashButton=".np-empty-trash",t.confirmButton=".np-trash-confirm",t.warningModal="#np-trash-modal",t.errorAlert="#np-error",t.loadingIndicator="#nested-loading",t.trashLinks=".np-trash-links",t.postType=a("#np-trash-posttype").val(),t.nonce=nestedpages.np_nonce,t.formAction="npEmptyTrash",t.bindEvents=function(){a(document).on("click",t.confirmButton,function(e){e.preventDefault(),t.confirmEmpty()})},t.confirmEmpty=function(){t.loading(!0),a(document).trigger("close-modal-manual"),a(t.errorAlert).hide(),t.emptyTrash()},t.emptyTrash=function(){a.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:t.formAction,nonce:t.nonce,posttype:t.postType},success:function(e){t.loading(!1),"error"===e.status?a(t.errorAlert).text(e.message).show():(a(t.trashLinks).hide(),a(".notice-dismiss").click())}})},t.loading=function(e){e?a(t.loadingIndicator).show():a(t.loadingIndicator).hide()},t.bindEvents()};(NestedPages=NestedPages||{}).ConfirmDelete=function(){var t=this,a=jQuery;return t.deleteLink="",t.bindEvents=function(){a(document).on("click",NestedPages.selectors.linkDeleteButton,function(e){e.preventDefault(),t.confirmSingle(a(this))}),a(document).on("click",NestedPages.selectors.linkDeleteConfirmationButton,function(e){e.preventDefault(),a(this).hasClass("bulk")?t.deleteMultiple():t.deleteSingle()}),a(document).on("submit",NestedPages.selectors.bulkActionsForm,function(e){t.confirmMultiple(e)})},t.confirmSingle=function(e){t.deleteLink=a(e).attr("href"),a(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation_singular),a(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.delete).removeClass("bulk"),a(document).trigger("open-modal-manual",NestedPages.selectors.linkDeleteConfirmationModal)},t.confirmMultiple=function(e){"trash"===a('select[name="np_bulk_action"]').val()&&""!==a(NestedPages.selectors.bulkActionRedirectIds).val()&&(e.preventDefault(),a(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation),a(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.trash_delete_links).addClass("bulk"),a(document).trigger("open-modal-manual",[NestedPages.selectors.linkDeleteConfirmationModal]))},t.deleteMultiple=function(){a(NestedPages.selectors.bulkActionsForm)[0].submit()},t.deleteSingle=function(){window.location.replace(t.deleteLink)},t.bindEvents()},(NestedPages=NestedPages||{}).ManualSync=function(){var t=this,a=jQuery;return t.activeBtn="",t.bindEvents=function(){a(document).on("click",NestedPages.selectors.manualMenuSync,function(e){e.preventDefault(),t.activeBtn=a(this),t.syncMenu()}),a(document).on("click",NestedPages.selectors.manualOrderSync,function(e){e.preventDefault(),t.activeBtn=a(this),t.syncOrder()})},t.syncMenu=function(){t.loading(!0),a.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.manualMenuSync,nonce:NestedPages.jsData.nonce,post_type:NestedPages.jsData.posttype,syncmenu:"sync"},success:function(e){"error"===e.status?(a(NestedPages.selectors.errorDiv).text(e.message).show(),a(NestedPages.selectors.loadingIndicator).hide()):t.loading(!1)}})},t.syncOrder=function(){t.loading(!0),(new NestedPages.Nesting).syncNesting(!0,t.loading(!1))},t.loading=function(e){if(e)return a(t.activeBtn).addClass("disabled"),void a(NestedPages.selectors.loadingIndicator).show();a(t.activeBtn).removeClass("disabled"),a(NestedPages.selectors.loadingIndicator).hide()},t.bindEvents()},(NestedPages=NestedPages||{}).PostSearch=function(){var s=this,n=jQuery;return s.selectors={input:"data-nestedpages-post-search",form:"data-nestedpages-post-search-form",loadingIndicator:"data-nestedpages-loading",noResults:"data-nestedpages-no-results",results:"data-nestedpages-search-results"},s.changed=!1,s.activeInput="",s.results="",s.defaultResults="",s.postType="",s.activeForm="",s.bindEvents=function(){n("["+s.selectors.input+"]").on("input",function(){if(s.activeInput=n(this),s.setOptions(),s.changed||s.setDefaultResults(),""===n(this).val())return n(s.activeForm).find("["+s.selectors.noResults+"]").hide(),void s.showDefaultResults();s.query()})},s.setDefaultResults=function(){s.defaultResults=n(s.activeForm).find("["+s.selectors.results+"]").html(),s.changed=!0},s.showDefaultResults=function(){n(s.activeForm).find("["+s.selectors.results+"]").html(s.defaultResults)},s.setOptions=function(){s.postType=n(s.activeInput).attr(s.selectors.input),s.activeForm=n(s.activeInput).parents("["+s.selectors.form+"]")},s.performSearch=function(){if(s.defaultResults=n(s.activeForm).parent("li").siblings(s.selectors.defaultResults),2<n(s.activeForm).val().length)return n(s.defaultResults).hide(),s.toggleLoading(!0),void s.query();s.toggleLoading(!1),n(s.defaultResults).show()},s.query=function(){n(s.activeForm).find("["+s.selectors.results+"]").empty(),s.toggleLoading(!0),n.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.postSearch,nonce:NestedPages.jsData.nonce,term:n(s.activeInput).val(),postType:s.postType},success:function(e){e.results?(s.results=e.results,s.loadResults(),s.toggleLoading(!1)):(s.toggleLoading(!1),n(s.activeForm).find("["+s.selectors.noResults+"]").show())}})},s.loadResults=function(){var a="<ul>";n.each(s.results,function(e,t){a+='<li><a href="#" data-assignment-page-id="'+t.ID+'" data-assignment-page-title="'+t.post_title+'">'+t.post_title+"</a></li>"}),a+="</ul>",n(s.activeForm).find("["+s.selectors.results+"]").html(a),s.toggleLoading(!1)},s.toggleLoading=function(e){var t=n(s.activeForm).find("["+s.selectors.loadingIndicator+"]"),a=n(s.activeForm).find("["+s.selectors.noResults+"]");n(a).hide(),e?n(t).show():n(t).hide()},s.bindEvents()},(NestedPages=NestedPages||{}).MovePost=function(){var a=this,s=jQuery;return a.formatter=new NestedPages.Formatter,a.nesting=new NestedPages.Nesting,a.activeRow,a.selectors={moveToTop:"data-push-to-top",moveToBottom:"data-push-to-bottom"},a.bindEvents=function(){s(document).ready(function(){a.disableTopOnFirst(),a.disableBottomOnLast()}),s(document).on("click","["+a.selectors.moveToTop+"]",function(e){e.preventDefault(),s(this).hasClass("disabled")||(a.activeRow=s(this).closest(NestedPages.selectors.rows),a.moveToTop())}),s(document).on("click","["+a.selectors.moveToBottom+"]",function(e){e.preventDefault(),s(this).hasClass("disabled")||(a.activeRow=s(this).closest(NestedPages.selectors.rows),a.moveToBottom())})},a.moveToTop=function(){var e=s(a.activeRow).parent(NestedPages.selectors.lists),t=s(e).find(NestedPages.selectors.rows).first();s(a.activeRow).insertBefore(t),a.formatter.setBorders(),s(document).click(),a.nesting.syncNesting(),a.disableTopOnFirst(),a.disableBottomOnLast()},a.moveToBottom=function(){var e=s(a.activeRow).parent(NestedPages.selectors.lists),t=s(e).children(NestedPages.selectors.rows).last();s(a.activeRow).insertAfter(t),a.formatter.setBorders(),s(document).click(),a.nesting.syncNesting(),a.disableTopOnFirst(),a.disableBottomOnLast()},a.disableTopOnFirst=function(){var e=s(NestedPages.selectors.lists);s.each(e,function(){s(this).find("["+a.selectors.moveToTop+"]").removeClass("disabled");var e=s(this).find(NestedPages.selectors.rows).first();s(e).find("["+a.selectors.moveToTop+"]").addClass("disabled")})},a.disableBottomOnLast=function(){var e=s(NestedPages.selectors.lists);s.each(e,function(){s(this).find("["+a.selectors.moveToBottom+"]").removeClass("disabled");var e=s(this).find(NestedPages.selectors.rows).last();s(e).find("["+a.selectors.moveToBottom+"]").addClass("disabled")})},a.bindEvents()},(NestedPages=NestedPages||{}).TrashWithChildren=function(){var t=this,a=jQuery;return t.post_id="",t.bindEvents=function(){a(document).on("click",NestedPages.selectors.trashWithChildrenButton,function(e){e.preventDefault(),t.post_id=a(this).attr("data-post-id"),t.trash()})},t.trash=function(){a.ajax({url:NestedPages.jsData.ajaxurl,type:"post",data:{action:NestedPages.formActions.trashWithChildren,nonce:NestedPages.jsData.nonce,post_id:t.post_id,screen:nestedpages.current_page},success:function(e){window.location.replace(e.redirect)},error:function(e){console.log(e)}})},t.bindEvents()},(NestedPages=NestedPages||{}).Wpml=function(){var a=this,o=jQuery;return a.button=null,a.postData=null,a.modal=null,a.parent_li=null,a.formatter=new NestedPages.Formatter,a.selectors={translationsBtn:"data-nestedpages-translations",modal:"data-np-wpml-translations-modal",title:"data-wmpl-translation-title",table:"data-np-wpml-translations-modal-table"},a.bindEvents=function(){nestedpages.wpml&&o(document).on("click","["+a.selectors.translationsBtn+"]",function(e){e.preventDefault(),a.createTranslationsModal(o(this))})},a.createTranslationsModal=function(e){if(a.parent_li=o(e).parents(".action-buttons").closest(NestedPages.selectors.row).parent("li"),a.button=o(a.parent_li).find(NestedPages.selectors.quickEditOpen),a.postData={id:o(a.button).attr("data-id"),title:o(a.button).attr("data-title"),slug:o(a.button).attr("data-slug")},a.modal=o("["+a.selectors.modal+"]").clone(),0<o(a.parent_li).children("ol").length){var t=o(a.parent_li).children("ol");o(a.modal).insertBefore(t)}else o(a.modal).appendTo(a.parent_li);o(a.modal).find("["+a.selectors.title+"]").text(a.postData.title),a.formatter.showQuickEdit(),o(a.modal).show(),a.getTranslationData()},a.getTranslationData=function(){o.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.wpmlTranslations,post_id:a.postData.id,nonce:NestedPages.jsData.nonce},success:function(e){console.log(e),console.log(a.postData.id),"success"===e.status?a.populateModal(e.translations):(o(a.modal).find(NestedPages.selectors.quickEditErrorDiv).text(e.message).show(),a.toggleLoading(!1))}})},a.populateModal=function(s){var n="<tbody>";o.each(s,function(e,t){var a=s[e];n+="<tr>",n+='<td><img src="'+a.country_flag_url+'" alt="'+a.translated_name+'" /> '+a.translated_name+"</td>",n+="<td>",a.has_translation&&a.edit_link?n+='<a href="'+a.edit_link+'">'+a.translation.post_title+" ("+nestedpages.edit+")</a>":n+='<a href="'+a.add_link+'" class="np-btn">+ '+nestedpages.add_translation+"</a>",n+="</td>",n+="</tr>"}),n+="</tbody>",o(a.modal).find("["+a.selectors.table+"]").html(n),a.toggleLoading(!1)},a.toggleLoading=function(e){e?o(a.modal).addClass("loading"):o(a.modal).removeClass("loading")},a.bindEvents()};
1
+ var NestedPages=NestedPages||{};NestedPages.Formatter=function(){var s=this,i=jQuery;s.updateSubMenuToggle=function(){for(var e=i(NestedPages.selectors.childToggle),t=0;t<e.length;t++){var a,s=e[t],n=i(s).parent(".row").parent("li");0<i(n).children("ol").length?i(n).children("ol").find("li.page-row").length<1?i(n).children("ol").hide():(a='<div class="child-toggle-spacer"></div>',a+='<a href="#"',0<i(n).children("ol:visible").length&&(a+=' class="open"'),a+='><span class="np-icon-arrow"></span></a>',i(s).html(a),0<i(n).children("ol").children(".np-hide").length&&0===i(n).children("ol").children(".np-hide.shown").length?i(s).find("a").hide():0<i(n).children("ol").children(".np-hide").length&&0<i(n).children("ol").children(".np-hide.shown").length&&i(s).find("a").show()):i(s).empty().html('<div class="child-toggle-spacer"></div>')}},s.setBorders=function(){i(NestedPages.selectors.rows).removeClass(NestedPages.cssClasses.noborder),i.each(i(NestedPages.selectors.lists),function(){i(this).find(".page-row:visible:first").addClass(NestedPages.cssClasses.noborder)})},s.setNestedMargins=function(){s.setIndent()},s.setIndent=function(){var n="1"===nestedpages.non_indent?20:30,o="1"===nestedpages.non_indent?".row-inner":".child-toggle";i.each(i(NestedPages.selectors.lists),function(e,t){var a=i(this).parents(NestedPages.selectors.lists).length,s=0;NestedPages.jsData.sortable||(s=10),0<a?(s=a*n+s,i(this).find(o).css("padding-left",s+"px")):NestedPages.jsData.sortable&&!i(this).hasClass("no-sort")?i(this).find(".row-inner").css("padding-left","0px"):i(this).find(".row-inner").css("padding-left","10px")})},s.setClassicIndent=function(){i.each(i(NestedPages.selectors.lists),function(e,t){var a=i(this).parents(NestedPages.selectors.lists).length,s=0;NestedPages.jsData.sortable||(s=10),0<a?(s=20*a+s,i(this).find(".row-inner").css("padding-left",s+"px")):NestedPages.jsData.sortable&&!i(this).hasClass("no-sort")?i(this).find(".row-inner").css("padding-left","0px"):i(this).find(".row-inner").css("padding-left","10px")})},s.updatePlaceholderWidth=function(e){var t,a;NestedPages.jsData.nestable&&(t=40*i(e.placeholder).parents("ol").length-40,a=i(NestedPages.selectors.sortable).width()-t,i(e.placeholder).width(a).css("margin-left",t+"px")),s.updateListVisibility(e)},s.updateListVisibility=function(e){e=i(e.placeholder).parent("ol");i(e).is(":visible")||(i(e).addClass("nplist"),i(e).show())},s.removeQuickEdit=function(){i(NestedPages.selectors.quickEditOverlay).removeClass("active").remove(),i(".sortable .quick-edit").remove(),i(".row").show()},s.showQuickEdit=function(){i("body").append('<div class="np-inline-overlay"></div>'),setTimeout(function(){i(".np-inline-overlay").addClass("active")},50)},s.flashRow=function(e){i(e).addClass("np-updated"),s.setBorders(),setTimeout(function(){i(e).addClass("np-updated-show")},1500)},s.showAjaxError=function(e){i(NestedPages.selectors.ajaxError).find("p").text(e),i(NestedPages.selectors.ajaxError).show()},s.hideAjaxError=function(e){i(NestedPages.selectors.ajaxError).hide()},s.sizeLinkThumbnails=function(){var e=i(NestedPages.selectors.thumbnailContainer).not(NestedPages.selectors.thumbnailContainerLink).first().find("img"),t=i(e).width(),a=i(e).height();i.each(i(NestedPages.selectors.thumbnailContainerLink),function(){i(this).width(t),i(this).height(a)})}},(NestedPages=NestedPages||{}).Dropdowns=function(){var t=this,a=jQuery;return t.dropdown="",t.activeBtn="",t.activeContent="",t.toggleBtn="[data-dropdown-toggle]",t.dropdownContainer="[data-dropdown]",t.dropdownContent="[data-dropdown-content]",t.selectors={caret_up:"icon-arrow_drop_up",caret_down:"icon-arrow_drop_down"},t.bindEvents=function(){a(document).on("click",t.toggleBtn,function(e){e.preventDefault(),t.activeBtn=a(this),t.dropdown=a(this).parents(t.dropdownContainer),t.toggleDropdown()}),a(document).on("click",function(e){t.closeDropdowns(e.target)}),a(document).on("dropdown-opened",function(e,t){0<a(t).parents(NestedPages.selectors.row).length&&a(t).parents(NestedPages.selectors.row).addClass("active")}),a(document).on("dropdown-closed",function(){a(NestedPages.selectors.row).removeClass("active")})},t.toggleDropdown=function(){a("."+t.selectors.caret_up).attr("class",t.selectors.caret_down);var e=a(t.dropdown).find(t.dropdownContent);if(t.activeContent=e,a(e).hasClass("active"))return a(e).removeClass("active"),a(t.activeBtn).removeClass("active"),a(t.activeBtn).find("."+t.selectors.caret_up).attr("class",t.selectors.caret_down),void a(document).trigger("dropdown-closed",e);t.setPositioning(),a(t.toggleBtn).removeClass("active"),a(t.dropdownContent).removeClass("active"),a(e).addClass("active"),a(t.activeBtn).find("."+t.selectors.caret_down).attr("class",t.selectors.caret_up),a(t.activeBtn).addClass("active"),a(document).trigger("dropdown-opened",e)},t.setPositioning=function(){var e=a(t.activeBtn).outerHeight();a(t.activeContent).css("top",e+"px")},t.closeDropdowns=function(e){0===a(e).parents(t.dropdownContainer).length&&(a(t.dropdownContent).removeClass("active"),a(t.toggleBtn).removeClass("active"),a(t.activeBtn).find("."+t.selectors.caret_up).attr("class",t.selectors.caret_down),a(document).trigger("dropdown-closed",void 0))},t.bindEvents()},(NestedPages=NestedPages||{}).Modals=function(){var a=this,s=jQuery;return a.activeBtn="",a.activeModal="",a.modalOpen=!1,a.selectors={toggleBtn:"[data-nestedpages-modal-toggle]",backdrop:"[data-nestedpages-modal-backdrop]",closeBtn:"[data-nestedpages-modal-close]",title:"data-nestedpages-modal-title",content:"data-nestedpages-modal-content"},a.bindEvents=function(){s(document).on("click",a.selectors.toggleBtn,function(e){e.preventDefault(),a.activeBtn=s(this),a.openModal()}),s(document).on("click",a.selectors.closeBtn,function(e){e.preventDefault(),a.closeModals()}),s(document).on("open-modal-manual",function(e,t){a.activeModal=s('[data-nestedpages-modal="'+t+'"]'),a.openModal()}),s(document).on("close-modal-manual",function(e){a.closeModals()}),s(document).on("click",a.selectors.backdrop,function(e){a.closeModals()}),s(document).ready(function(){a.checkHash()})},a.openModal=function(){var e;a.modalOpen?a.closeModals():(0<s(a.activeBtn).length&&(e=s(a.activeBtn).attr("data-nestedpages-modal-toggle"),a.activeModal=s('*[data-nestedpages-modal="'+e+'"]')),s(a.activeModal).addClass("active"),a.modalOpen=!0,a.populateModal(),s(document).trigger("open-modal",[a.activeBtn,a.activeModal]))},a.closeModals=function(){a.modalOpen=!1,s("[data-nestedpages-modal]").removeClass("active"),a.activeModal="",a.activeBtn=""},a.populateModal=function(){var e=s(a.activeBtn).attr(a.selectors.title);void 0!==e&&""!==e&&s(a.activeModal).find("[data-nestedpages-modal-title]").text(e);e=s(a.activeBtn).attr(a.selectors.content);void 0!==e&&""!==e&&s(a.activeModal).find("[data-nestedpages-modal-content]").html(e)},a.checkHash=function(){var e;window.location.hash&&"#modal"===window.location.hash.substring(0,6)&&(e=window.location.hash.substring(7),a.activeModal=s('*[data-nestedpages-modal="'+e+'"]'),a.openModal())},a.bindEvents()},(NestedPages=NestedPages||{}).CheckAll=function(){var a=this,s=jQuery;return a.activeCheckbox="",a.selectors={checkbox:"[data-np-check-all]"},a.bindEvents=function(){s(document).on("change",a.selectors.checkbox,function(){a.activeCheckbox=s(this),a.toggleCheckboxes()}),s(document).on("change","input[type=checkbox]",function(){a.checkAllStatus(s(this))})},a.init=function(){a.bindEvents()},a.toggleCheckboxes=function(){var t=!!s(a.activeCheckbox).is(":checked"),e=s(a.activeCheckbox).attr("data-np-check-all"),e=s('*[name="'+e+'"]');s.each(e,function(){var e=s(this).parents(NestedPages.selectors.rows);s(this).prop("checked",t),s(e).hasClass("np-hide")&&!s(e).is(":visible")&&s(e).find(NestedPages.selectors.bulkActionsCheckbox).prop("checked",!1)}),a.toggleCheckAll()},a.toggleCheckAll=function(){var e=s(a.activeCheckbox).attr("data-np-check-all"),t=(t=s('*[name="'+e+'"]').length)-s(".np-hide").find(NestedPages.selectors.bulkActionsCheckbox).length+s(".np-hide:visible").find(NestedPages.selectors.bulkActionsCheckbox).length,e=s('*[name="'+e+'"]:checked').length;if(t==e)return s(a.activeCheckbox).prop("checked",!0),void s(a.activeCheckbox).removeClass("check-all-partial");0<e?s(a.activeCheckbox).addClass("check-all-partial"):(s(a.activeCheckbox).attr("checked",!1),s(a.activeCheckbox).removeClass("check-all-partial"))},a.checkAllStatus=function(e){e=s(e).attr("name"),e=s('*[data-np-check-all="'+e+'"]');0!==e.length&&(a.activeCheckbox=s(e)[0],a.toggleCheckAll())},a.init()},(NestedPages=NestedPages||{}).BulkActions=function(){var n=this,o=jQuery;return n.selectedNumber=0,n.selectedLinks=[],n.selectedPosts=[],n.bindEvents=function(){o(document).on("change",NestedPages.selectors.bulkActionsCheckbox,function(){n.toggleBulkForm()}),o(document).on("submit",NestedPages.selectors.bulkActionsForm,function(e){"edit"===o("select[name=np_bulk_action]").val()&&(e.preventDefault(),n.toggleBulkEdit(!0))}),o(document).on("click",NestedPages.selectors.bulkEditRemoveItem,function(e){e.preventDefault();e=o(this).siblings("input[type=hidden]").val();n.uncheckBulkItem(e)}),o(document).on("click",NestedPages.selectors.bulkEditCancel,function(e){e.preventDefault(),n.uncheckAllBulkItems()})},n.toggleBulkForm=function(){var t=!1,a="",s="";if(n.selectedPosts=[],n.selectedLinks=[],o.each(o(NestedPages.selectors.bulkActionsCheckbox),function(){var e;o(this).is(":checked")&&(e=o(this).parents(NestedPages.selectors.rows),t=!0,o(this).parent("div").hasClass("np-check-all")||o(e).hasClass("post-type-np-redirect")||(a+=o(this).val()+","),o(e).hasClass("post-type-np-redirect")&&(s+=o(this).val()+",",n.selectedLinks.push(o(this).val())),"np-redirect"===o(this).attr("data-np-post-type")||o(this).parent("div").hasClass("np-check-all")||((e=[]).title=o(this).attr("data-np-bulk-checkbox"),e.id=o(this).val(),n.selectedPosts.push(e)))}),n.setBulkEditPosts(),n.toggleEditOption(),n.toggleLinkCountAlert(),t)return o(NestedPages.selectors.bulkActionsForm).show(),o(NestedPages.selectors.bulkActionsIds).val(a),o(NestedPages.selectors.bulkActionRedirectIds).val(s),void n.setSelectedNumber();o(NestedPages.selectors.bulkActionsIds).val(""),o(NestedPages.selectors.bulkActionsForm).hide()},n.setBulkEditPosts=function(){for(var e="",t=0;t<n.selectedPosts.length;t++)e+='<li><a href="#" class="np-remove" data-np-remove-bulk-item>&times;</a>',e+=n.selectedPosts[t].title,e+='<input type="hidden" name="post_ids[]" value="'+n.selectedPosts[t].id+'"></li>';o(NestedPages.selectors.bulkEditTitles).html(e)},n.uncheckBulkItem=function(e){o.each(o(NestedPages.selectors.bulkActionsCheckbox),function(){o(this).val()==e&&o(this).prop("checked",!1).change()}),0===o(NestedPages.selectors.bulkEditRemoveItem).length&&n.toggleBulkEdit(!1)},n.uncheckAllBulkItems=function(){o.each(o(NestedPages.selectors.bulkActionsCheckbox),function(){o(this).prop("checked",!1).change()}),n.toggleBulkEdit(!1)},n.setSelectedNumber=function(){var e=o(NestedPages.selectors.bulkActionsCheckbox+":checked").not(".np-check-all input").length,t=o(NestedPages.selectors.bulkActionsForm).find("select option").first();o(t).text(nestedpages.bulk_actions+" ("+e+")")},n.toggleEditOption=function(){var e=o(NestedPages.selectors.bulkActionsCheckbox+":checked").not(".np-check-all input").not(".np-redirect-bulk").length,t=o(NestedPages.selectors.bulkActionsForm).find("select option[value=edit]");if(0===e)return o(t).prop("disabled",!0),o(NestedPages.selectors.bulkActionsForm).find("select option").first().prop("selected",!0),void n.toggleBulkEdit(!1);o(t).prop("disabled",!1)},n.toggleBulkEdit=function(e){if(n.toggleLinkCountAlert(),e)return n.disableParentOptions(),o(NestedPages.selectors.bulkEditForm).show(),o(NestedPages.selectors.bulkActionsForm).hide(),void n.setWPSuggest();o(NestedPages.selectors.bulkEditForm).hide(),o(NestedPages.selectors.bulkActionsForm).show(),o(NestedPages.selectors.bulkEditLinkCount).parent("div").hide(),o(NestedPages.selectors.bulkActionsForm).find("select option").first().text(nestedpages.bulk_actions),n.resetBulkEditFields()},n.toggleLinkCountAlert=function(){0!==n.selectedLinks.length?o(NestedPages.selectors.bulkEditLinkCount).parent("div").show():o(NestedPages.selectors.bulkEditLinkCount).parent("div").hide()},n.disableParentOptions=function(){for(var e=o(NestedPages.selectors.bulkEditForm).find("select[name=post_parent]"),t=0;t<n.selectedPosts.length;t++)o(e).find("option[value="+n.selectedPosts[t].id+"]").attr("disabled",!0)},n.setWPSuggest=function(){var e=o(NestedPages.selectors.bulkEditForm).find("[data-autotag]");o.each(e,function(e,t){var a=o(this).attr("data-taxonomy");o(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+a,{multiple:!0,multipleSep:","})})},n.resetBulkEditFields=function(){var e=o(NestedPages.selectors.bulkEditForm).find("select");o.each(e,function(){o(this).find("option").first().prop("selected",!0),o(this).find("option").removeAttr("disabled")});e=o(NestedPages.selectors.bulkEditForm).find(".cat-checklist");o.each(e,function(){o(this).find("input[type=checkbox]").prop("checked",!1)})},n.bindEvents()},(NestedPages=NestedPages||{}).HiddenItemCount=function(){var e=this,a=jQuery;return e.init=function(){e.bindEvents()},e.bindEvents=function(){a(document).on("change",NestedPages.selectors.bulkActionsCheckbox,function(){e.toggleHiddenCount()}),a(document).on("click",NestedPages.selectors.toggleAll,function(){e.toggleHiddenCount()}),a(document).on("click",NestedPages.selectors.pageToggle,function(){e.toggleHiddenCount()})},e.toggleHiddenCount=function(){var t=0;a.each(a(NestedPages.selectors.bulkActionsCheckbox),function(){var e;a(this).is(":checked")&&(a(this).parent("div").hasClass("np-check-all")||(e=a(this).closest(".page-row"),a(e).is(":visible")||t++))}),t<1?a(NestedPages.selectors.hiddenItemCountParent).hide():(a(NestedPages.selectors.hiddenItemCount).text(t),a(NestedPages.selectors.hiddenItemCountParent).show())},e.init()},(NestedPages=NestedPages||{}).MenuToggle=function(){var a=this,n=jQuery;return a.formatter=new NestedPages.Formatter,a.bindEvents=function(){n(document).on("click",NestedPages.selectors.childToggleLink,function(e){e.preventDefault(),a.toggleSingleMenu(n(this))}),n(document).on("click",NestedPages.selectors.toggleAll,function(e){e.preventDefault(),a.toggleAllMenus()})},a.toggleSingleMenu=function(e){var t=n(e).parent(NestedPages.selectors.childToggle).parent(NestedPages.selectors.row).siblings("ol");n(e).toggleClass("open"),n(t).toggle(),a.formatter.setBorders(),a.formatter.setNestedMargins(),a.syncUserToggles()},a.toggleAllMenus=function(){var e=NestedPages.selectors.toggleAll;if("closed"===n(e).attr("data-toggle"))return n(NestedPages.selectors.lists).show(),n(e).attr("data-toggle","opened").text(NestedPages.jsData.collapseText),n(NestedPages.selectors.childToggle+" a").addClass("open"),a.formatter.setBorders(),void a.syncUserToggles();n(NestedPages.selectors.lists).not(n(NestedPages.selectors.lists)[0]).hide(),n(e).attr("data-toggle","closed").text(NestedPages.jsData.expandText),n(NestedPages.selectors.childToggle+" a").removeClass("open"),a.formatter.setBorders(),a.syncUserToggles()},a.visibleRowIDs=function(){var s=[],e=n(NestedPages.selectors.rows+":visible");return n.each(e,function(e,t){var a=n(this).attr("id");s.push(a.replace("menuItem_",""))}),s},a.syncUserToggles=function(){n.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.syncToggles,nonce:NestedPages.jsData.nonce,ids:a.visibleRowIDs(),posttype:NestedPages.jsData.posttype},success:function(e){"success"!==e.status&&console.log("There was an error saving toggled pages.")}})},a.bindEvents()},(NestedPages=NestedPages||{}).PageToggle=function(){var a=this,s=jQuery;return a.activeButton="",a.formatter=new NestedPages.Formatter,a.init=function(){a.bindEvents()},a.bindEvents=function(){s(document).on("click",NestedPages.selectors.toggleHidden,function(e){e.preventDefault(),a.activeButton=s(this),a.toggleHidden()}),s(document).on("click",NestedPages.selectors.toggleStatus,function(e){e.preventDefault(),a.toggleStatus(s(this))})},a.toggleHidden=function(){var e=s(a.activeButton),t=s(e).attr("href");if("#show"==t)return s(e).attr("href","#hide").text(NestedPages.jsData.showHiddenText),s(NestedPages.selectors.hiddenRows).removeClass("shown").hide(),a.formatter.updateSubMenuToggle(),void a.formatter.setBorders();"#hide"==t&&(s(e).attr("href","#show").text(NestedPages.jsData.hideHiddenText),s(NestedPages.selectors.hiddenRows).addClass("shown").show(),a.formatter.updateSubMenuToggle(),a.formatter.setBorders())},a.toggleStatus=function(e){var t=(t=s(e).attr("href")).substring(1);s(NestedPages.selectors.syncCheckbox).attr("disabled",!1),s(NestedPages.selectors.toggleStatus).removeClass("active"),s(e).addClass("active"),"draft"==t&&(s(NestedPages.selectors.syncCheckbox).attr("disabled",!0),s("."+t).addClass("nested-visible")),"all"!=t?(s(NestedPages.selectors.rows).hide(),s("."+t).show()):s(NestedPages.selectors.rows).show()},a.init()},(NestedPages=NestedPages||{}).Nesting=function(){var n=this,o=jQuery;n.formatter=new NestedPages.Formatter,n.initializeSortable=function(){if(!NestedPages.jsData.nestable)return n.initializeSortableFlat();o(NestedPages.selectors.sortable).not(NestedPages.selectors.notSortable).nestedSortable({items:NestedPages.selectors.rows,toleranceElement:"> .row",handle:NestedPages.selectors.handle,placeholder:"ui-sortable-placeholder",tabSize:56,isAllowed:function(e,t,a){return!(o(t).hasClass("post-type-np-redirect")&&!o(a).hasClass("post-type-np-redirect"))},start:function(e,t){t.placeholder.height(t.item.height())},sort:function(e,t){n.formatter.updatePlaceholderWidth(t)},stop:function(e,t){setTimeout(function(){n.formatter.updateSubMenuToggle(),n.formatter.setBorders(),n.formatter.setNestedMargins()},100),n.syncNesting()}})},n.initializeSortableFlat=function(){var e=o(NestedPages.selectors.lists).not(NestedPages.selectors.notSortable);o.each(e,function(){o(this).sortable({items:">"+NestedPages.selectors.rows,handle:NestedPages.selectors.handle,placeholder:"ui-sortable-placeholder",forcePlaceholderSize:!0,start:function(e,t){t.placeholder.height(t.item.height())},sort:function(e,t){n.formatter.updatePlaceholderWidth(t)},stop:function(e,t){setTimeout(function(){n.formatter.updateSubMenuToggle(),n.formatter.setBorders(),n.formatter.setNestedMargins()},100),n.syncNesting()}})})},n.disableNesting=function(){o(NestedPages.selectors.sortable).sortable("destroy")},n.syncNesting=function(e,t){var a,s;"1"===nestedpages.manual_order_sync&&!e||(o(NestedPages.selectors.errorDiv).hide(),o(NestedPages.selectors.loadingIndicator).show(),s=!!o(NestedPages.selectors.lists).first().hasClass("filtered"),a=NestedPages.jsData.nestable&&!s?o(NestedPages.selectors.sortable).nestedSortable("toHierarchy",{startDepthCount:0}):n.setNestingArray(),n.disableNesting(),e=NestedPages.jsData.syncmenu,"1"===nestedpages.manual_menu_sync&&(e="nosync"),o.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.syncNesting,nonce:NestedPages.jsData.nonce,list:a,post_type:NestedPages.jsData.posttype,syncmenu:e,filtered:s},success:function(e,t){n.initializeSortable(),"error"===e.status?(o(NestedPages.selectors.errorDiv).text(e.message).show(),o(NestedPages.selectors.loadingIndicator).hide()):t&&"function"==typeof t?t():o(NestedPages.selectors.loadingIndicator).hide()}}))},n.setNestingArray=function(e){return ret=[],o(NestedPages.selectors.lists).first().children("li.page-row").each(function(){var e=n.recursiveNesting(this);ret.push(e)}),ret},n.recursiveNesting=function(e){var t,a=o(e).attr("id");if(a)return a=a.replace("menuItem_",""),t={id:a},0<o(e).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).length&&(t.children=[],o(e).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).each(function(){var e=n.recursiveNesting(this);t.children.push(e)})),t}},(NestedPages=NestedPages||{}).SyncMenuSetting=function(){var t=this,e=jQuery;return t.formatter=new NestedPages.Formatter,t.init=function(){t.bindEvents()},t.bindEvents=function(){e(document).ready(function(){"1"!==nestedpages.manual_menu_sync&&"1"===nestedpages.syncmenu&&t.syncSetting()}),e(document).on("change",NestedPages.selectors.syncCheckbox,function(){t.syncSetting()})},t.syncSetting=function(){"page"===NestedPages.jsData.posttype&&0!==e(NestedPages.selectors.syncCheckbox).length&&(NestedPages.jsData.syncmenu=e(NestedPages.selectors.syncCheckbox).is(":checked")?"sync":"nosync",e.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.syncMenu,nonce:NestedPages.jsData.nonce,post_type:NestedPages.jsData.posttype,syncmenu:NestedPages.jsData.syncmenu},success:function(e){"error"===e.status&&t.formatter.showAjaxError(e.message)},error:function(e){console.log(e)}}))},t.bindEvents()},(NestedPages=NestedPages||{}).NewPost=function(){var r=this,d=jQuery;return r.formatter=new NestedPages.Formatter,r.parent_id=0,r.posts="",r.form="",r.bindEvents=function(){d(document).on("open-modal",function(e,t,a){t=d(t).attr("data-nestedpages-modal-toggle");void 0!==t&&"np-bulk-modal"==t&&r.openModal()}),d(document).on("submit",NestedPages.selectors.newPageForm,function(e){e.preventDefault()}),d(document).on("click",NestedPages.selectors.newPageSubmitButton,function(e){e.preventDefault(),r.submitForm(d(this))}),d(document).on("click",NestedPages.selectors.newPageTitle,function(e){e.preventDefault(),r.addTitleField(d(this))}),d(document).on("click",NestedPages.selectors.newPageRemoveTitle,function(e){e.preventDefault(),r.removeTitleField(d(this))}),d(document).on("click",NestedPages.selectors.addChildButton,function(e){e.preventDefault(),r.openQuickEdit(d(this))}),d(document).on("click",NestedPages.selectors.cancelNewChildButton,function(e){e.preventDefault(),r.cancelNewPage()}),d(document).on("click","["+NestedPages.selectors.newBeforeButton+"]",function(e){e.preventDefault(),r.openQuickEdit(d(this))}),d(document).on("click","["+NestedPages.selectors.newAfterButton+"]",function(e){e.preventDefault(),r.openQuickEdit(d(this))}),d(document).on("keydown",function(e){27===e.keyCode&&(r.cancelNewPage(),d(document).click())})},r.openModal=function(){var e=d(NestedPages.selectors.newPageFormContainer).clone().find(NestedPages.selectors.newPageForm);d(e).addClass("in-modal"),d(NestedPages.selectors.newPageModal).find(".modal-body").html(e),d(NestedPages.selectors.newPageModal).find("h3").text(nestedpages.add_multiple),d(NestedPages.selectors.newPageModal).find(".page_parent_id").val(r.parent_id),d(e).find(".np_title").first().focus(),d(e).find(NestedPages.selectors.newPageTitle).first().prop("tabindex","2")},r.openQuickEdit=function(e){var t,a=void 0!==(a=d(e).attr(NestedPages.selectors.newBeforeButton))&&""!==a&&a,s=void 0!==(s=d(e).attr(NestedPages.selectors.newAfterButton))&&""!==s&&s,n=d(e).closest(NestedPages.selectors.row).parent("li"),o=d(NestedPages.selectors.newPageFormContainer).clone();0<d(n).children("ol").length?(t=d(n).children("ol"),d(o).insertBefore(t)):d(o).appendTo(n),d(o).siblings(NestedPages.selectors.row).hide(),r.formatter.showQuickEdit(),d(o).find(".parent_name").html("<em>Parent:</em> "+d(e).attr("data-parentname")),a||s||d(o).find(".page_parent_id").val(d(e).attr("data-id")),a&&(d(o).find(".page_before_id").val(a),d(o).find("[data-new-post-relation-title]").text(nestedpages.insert_before+": "+d(e).attr("data-parentname"))),s&&(d(o).find(".page_after_id").val(s),d(o).find("[data-new-post-relation-title]").text(nestedpages.insert_after+": "+d(e).attr("data-parentname"))),d(o).show(),d(o).find(".np_title").focus(),d(o).find(NestedPages.selectors.newPageTitle).prop("tabindex","2")},r.cancelNewPage=function(){r.formatter.removeQuickEdit(),d(NestedPages.selectors.newChildError).hide(),d(NestedPages.selectors.newPageModal).find(".modal-body").empty(),d(NestedPages.selectors.sortable).find(".new-child").remove(),d(NestedPages.selectors.row).show()},r.addTitleField=function(e){var t=d(e).parents("form"),a=d(e).siblings(".new-page-titles").children("li").length+1,s='<li><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="handle np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg><div class="form-control new-child-row"><label>'+NestedPages.jsData.titleText+'</label><div><input type="text" name="post_title[]" class="np_title" placeholder="'+NestedPages.jsData.titleText+'" value="" tabindex="'+a+'" /><a href="#" class="button-secondary np-remove-child">-</a></div></div></li>';d(e).siblings(".new-page-titles").append(s);d(t).find(".np_title").last().focus(),d(t).find(NestedPages.selectors.newPageTitle).prop("tabindex",+a),d(".new-page-titles").sortable({items:"li",handle:".handle"}),r.toggleAddEditButton(t)},r.removeTitleField=function(e){var t=d(e).parents("form");d(e).parents(".new-child-row").parent("li").remove(),r.toggleAddEditButton(t)},r.submitForm=function(e){r.toggleLoading(!0),r.form=d(e).parents("form");var t=!!d(e).hasClass("add-edit"),e=NestedPages.formActions.newPage;""!==d(r.form).find(".page_before_id").val()&&(e=NestedPages.formActions.newBeforeAfter),""!==d(r.form).find(".page_after_id").val()&&(e=NestedPages.formActions.newBeforeAfter),d.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:d(r.form).serialize()+"&action="+e+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(e){if("error"===e.status)return r.toggleLoading(!1),void d(r.form).find(NestedPages.selectors.quickEditErrorDiv).text(e.message).show();!0!=t?(r.toggleLoading(!1),r.posts=e.new_pages,r.addPosts()):(e=(e=e.new_pages[0].edit_link).replace(/&amp;/g,"&"),window.location.replace(e))},error:function(e){console.log(e),r.toggleLoading(!1),d(r.form).find(NestedPages.selectors.quickEditErrorDiv).text("The form could not be saved at this time.").show()}})},r.addPosts=function(){var e,t=""!==(t=d(r.form).find(".page_before_id").val())&&t,a=""!==(a=d(r.form).find(".page_after_id").val())&&a,s=d(r.form).parent(".new-child").parent(".page-row");for(0!==d(s).children("ol").length||t||a||d(s).append('<ol class="nplist"></ol>'),e=d(r.form).hasClass("in-modal")?d(".nplist.sortable li.page-row:first"):d(s).children("ol"),i=0;i<r.posts.length;i++)r.appendRows(e,r.posts[i],t,a);t||a||d(e).show(),r.formatter.updateSubMenuToggle(),r.formatter.setNestedMargins(),r.cancelNewPage(),d(document).trigger("close-modal-manual")},r.appendRows=function(e,t,a,s){var n,o='<li id="menuItem_'+t.id+'" class="page-row';"publish"===t.status&&(o+=" published"),o+='">',NestedPages.jsData.hierarchical?(o+='<div class="row">',o+='<div class="child-toggle"></div>'):(o+='<div class="row non-hierarchical">',o+='<div class="non-hierarchical-spacer"></div>'),o+='<div class="row-inner">',o+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="np-icon-sub-menu"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M19 15l-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9l6 6z" class="arrow" /></svg>',o+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="handle np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg>',o+='<a href="'+t.edit_link+'" class="page-link page-title">',o+='<span class="title">'+t.title+"</span>","Publish"!==t.status?o+='<span class="status">('+t.status+")</span>":o+='<span class="status"></span>',o+='<span class="nav-status">',"hide"===t.np_nav_status&&(o+=" "+nestedpages.hidden),o+="</span>",o+='<span class="edit-indicator">Edit</span>',o+="</a>",NestedPages.jsData.hierarchical||(o+='<div class="np-post-columns">',o+='<ul class="np-post-info">',o+='<li><span class="np-author-display">'+t.author_formatted+"</span></li>",o+="<li>"+t.date_formatted+"</li>",o+="</ul>",o+="</div>"),d(".nplist").first().hasClass("has-yoast")&&(o+='<span class="np-seo-indicator na"></span>'),o+='<div class="action-buttons">',o+='<div class="nestedpages-dropdown" data-dropdown><a href="#" class="np-btn has-icon toggle" data-dropdown-toggle><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></a><ul class="nestedpages-dropdown-content" data-dropdown-content>',o+='<li><a href="#" class="open-redirect-modal" data-parentid="'+t.id+'"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>'+nestedpages.add_link+"</a></li>",o+='<li><a href="#" class="add-new-child" data-id="'+t.id+'" data-parentname="'+t.title+'"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zM3 8v8l4-4-4-4zm8 9h10v-2H11v2zM3 3v2h18V3H3zm8 6h10V7H11v2zm0 4h10v-2H11v2z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'+nestedpages.add_child_short+"</a></li>",o+="</ul></div>",o+='<a href="#" class="np-btn np-quick-edit" data-id="'+t.id+'" data-template="'+t.page_template+'" data-title="'+t.title+'" data-slug="'+t.slug+'" data-commentstatus="closed" data-status="'+t.status.toLowerCase()+'" data-np-status="show"\tdata-navstatus="show" data-author="'+t.author+'" data-template="'+t.template+'" data-month="'+t.month+'" data-day="'+t.day+'" data-year="'+t.year+'" data-hour="'+t.hour+'" data-minute="'+t.minute+'" data-datepicker="'+t.datepicker+'" data-time="'+t.time+'" data-formattedtime="'+t.formattedtime+'" data-ampm="'+t.ampm+'">'+nestedpages.quick_edit+"</a>",o+='<a href="'+t.view_link+'" class="np-btn" target="_blank">'+nestedpages.view+"</a>",o+='<a href="'+t.delete_link+'" class="np-btn np-btn-trash"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="np-icon-remove"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" class="icon"/><path d="M0 0h24v24H0z" fill="none"/></svg></a>',o+="</div>\x3c!-- .action-buttons --\x3e",o+="</div>\x3c!-- .row-inner --\x3e</div>\x3c!-- .row --\x3e",o+="</li>",a?(n=r.findRowById(a),d(o).insertBefore(n)):s?(n=r.findRowById(s),d(o).insertAfter(n)):d(e).append(o)},r.findRowById=function(e){return d(NestedPages.selectors.rows+"#menuItem_"+e)},r.toggleAddEditButton=function(e){e=d(e).find(".np_title").length;e<1?d(NestedPages.selectors.newPageSubmitButton).hide():(d(NestedPages.selectors.newPageSubmitButton).show(),1<e?d(NestedPages.selectors.newPageSubmitButton+".add-edit").hide():d(NestedPages.selectors.newPageSubmitButton+".add-edit").show())},r.toggleLoading=function(e){if(e)return d(NestedPages.selectors.quickEditErrorDiv).hide(),d(NestedPages.selectors.newPageSubmitButton).attr("disabled","disabled"),void d(NestedPages.selectors.quickEditLoadingIndicator).show();d(NestedPages.selectors.newPageSubmitButton).attr("disabled",!1),d(NestedPages.selectors.quickEditLoadingIndicator).hide()},r.bindEvents()},(NestedPages=NestedPages||{}).QuickEditPost=function(){var r=this,d=jQuery;return r.formatter=new NestedPages.Formatter,r.button="",r.initialData="",r.parent_li="",r.form="",r.flatTerms="",r.termNames="",r.saveButton="",r.newData="",r.row="",r.bindEvents=function(){d(document).on("click",NestedPages.selectors.quickEditOpen,function(e){e.preventDefault(),r.button=d(this),r.openForm()}),d(document).on("click",NestedPages.selectors.quickEditCancel,function(e){e.preventDefault(),r.formatter.removeQuickEdit()}),d(document).on("change",".keep_private",function(){this.checked?d(".post_password").val("").prop("readonly",!0):d(".post_password").prop("readonly",!1)}),d(document).on("click",NestedPages.selectors.quickEditSaveButton,function(e){e.preventDefault(),r.saveButton=d(this),r.save()}),d(document).on("keydown",function(e){27===e.keyCode&&r.formatter.removeQuickEdit()})},r.openForm=function(){r.setInitialData(),r.createForm(),r.populateForm(),r.populateFlatTaxonomies()},r.setInitialData=function(){r.initialData={id:d(r.button).attr("data-id"),title:d(r.button).attr("data-title"),slug:d(r.button).attr("data-slug"),author:d(r.button).attr("data-author"),cs:d(r.button).attr("data-commentstatus"),status:d(r.button).attr("data-status"),template:d(r.button).attr("data-template"),month:d(r.button).attr("data-month"),day:d(r.button).attr("data-day"),year:d(r.button).attr("data-year"),hour:d(r.button).attr("data-hour"),minute:d(r.button).attr("data-minute"),navstatus:d(r.button).attr("data-navstatus"),npstatus:d(r.button).attr("data-np-status"),navtitle:d(r.button).attr("data-navtitle"),navtitleattr:d(r.button).attr("data-navtitleattr"),navcss:d(r.button).attr("data-navcss"),linktarget:d(r.button).attr("data-linktarget"),password:d(r.button).attr("data-password"),datepicker:d(r.button).attr("data-datepicker"),time:d(r.button).attr("data-formattedtime"),timeTwentyFour:d(r.button).attr("data-time"),ampm:d(r.button).attr("data-ampm"),timeFormat:d(r.button).attr("data-timeformat"),sticky:d(r.button).attr("data-sticky")};var e=d(r.button)[0].attributes;d.each(e,function(e,t){t.name.includes("data-npcustom")&&(r.initialData[t.name]=t.value)}),r.initialData.h_taxonomies=[],r.initialData.f_taxonomies=[],r.parent_li=d(r.button).closest(NestedPages.selectors.row).parent("li");var t=d(r.parent_li).attr("class").split(/\s+/);for(i=0;i<t.length;i++)"in-"===t[i].substring(0,3)&&r.initialData.h_taxonomies.push(t[i]),"inf-"===t[i].substring(0,4)&&r.initialData.f_taxonomies.push(t[i])},r.createForm=function(){var e;r.form=d(NestedPages.selectors.quickEditPostForm).clone(),0<d(r.parent_li).children("ol").length?(e=d(r.parent_li).children("ol"),d(r.form).insertBefore(e)):d(r.form).appendTo(r.parent_li),d(r.form).siblings(NestedPages.selectors.row).hide(),d(r.form).show()},r.populateForm=function(){for(var e in d(r.form).find(".page_id").html("<em>ID:</em> "+r.initialData.id),d(r.form).find(".np_id").val(r.initialData.id),d(r.form).find(".np_title").val(r.initialData.title),d(r.form).find(".np_slug").val(r.initialData.slug),d(r.form).find(".np_author select").val(r.initialData.author),d(r.form).find(".np_status").val(r.initialData.status),d(r.form).find(".np_nav_title").val(r.initialData.navtitle),d(r.form).find(".np_title_attribute").val(r.initialData.navtitleattr),d(r.form).find(".np_nav_css_classes").val(r.initialData.navcss),d(r.form).find(".post_password").val(r.initialData.password),d(r.form).find(".np_publish_date").val(r.initialData.datepicker),"open"===r.initialData.cs&&d(r.form).find(".np_cs").attr("checked","checked"),""!==r.initialData.template?d(r.form).find(".np_template").val(r.initialData.template):d(r.form).find(".np_template").val("default"),"private"===r.initialData.status&&(d(r.form).find(".post_password").attr("readonly",!0),d(r.form).find(".keep_private").attr("checked",!0)),"hide"===r.initialData.npstatus?d(r.form).find(".nested_pages_status").attr("checked","checked"):d(r.form).find(".nested_pages_status").removeAttr("checked"),"hide"===r.initialData.navstatus?d(r.form).find(".np_nav_status").attr("checked","checked"):d(r.form).find(".np_nav_status").attr("checked",!1),"_blank"===r.initialData.linktarget?d(r.form).find(".link_target").attr("checked","checked"):d(r.form).find(".link_target").attr("checked",!1),"private"===r.initialData.status&&d(r.form).find(".np_status").val("publish"),"sticky"===r.initialData.sticky?d(r.form).find(".np-sticky").attr("checked","checked"):d(r.form).find(".np-sticky").removeAttr("checked"),"H:i"===r.initialData.timeFormat?d(r.form).find(".np_time").val(r.initialData.timeTwentyFour):(d(r.form).find(".np_time").val(r.initialData.time),d(r.form).find(".np_ampm").val(r.initialData.ampm),d(r.form).find('select[name="mm"]').val(r.initialData.month),d(r.form).find('input[name="jj"]').val(r.initialData.day),d(r.form).find('input[name="aa"]').val(r.initialData.year),d(r.form).find('input[name="hh"]').val(r.initialData.hour),d(r.form).find('input[name="mn"]').val(r.initialData.minute)),r.initialData){var t;e.includes("npcustom")&&r.initialData.hasOwnProperty(e)&&(t=(t=e.replace("data-npcustom-","")).toLowerCase(),d(r.form).find('[data-np-custom-field="'+t+'"]').val(r.initialData[e]))}if(r.populateFlatTaxonomies(),r.initialData.hasOwnProperty("h_taxonomies")){var a=r.initialData.h_taxonomies;for(i=0;i<a.length;i++){var s="#"+a[i];d(r.form).find(s).attr("checked","checked")}}var n=d(r.form).find(".np_datepicker");d.each(n,function(){var e=d(this);e.datepicker({dateFormat:e.attr("data-datepicker-format"),beforeShow:function(e,t){d("#ui-datepicker-div").addClass("nestedpages-datepicker")}})}),r.formatter.showQuickEdit(),d(r.form).show()},r.populateFlatTaxonomies=function(){r.initialData.hasOwnProperty("f_taxonomies")&&(r.createTaxonomyObject(),r.getTermNames(),r.setWPSuggest())},r.createTaxonomyObject=function(){var e={};for(i=0;i<r.initialData.f_taxonomies.length;i++){var t=r.initialData.f_taxonomies[i],a=t.split("-"),s=a.indexOf("nps"),a=(a=a.splice(s+1)).join("-"),s=t.split("-").splice(0,s);s.shift("inf");s=s.join("-");s in e||(e[s]=[]),e[s].push(a)}r.flatTerms=e},r.getTermNames=function(){d.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.getTaxonomies,nonce:NestedPages.jsData.nonce,terms:r.flatTerms},success:function(e){r.termNames=e.terms,r.populateFlatTaxonomyFields()}})},r.populateFlatTaxonomyFields=function(){r.termNames&&d.each(r.termNames,function(e,t){e=d("#"+e+"-quickedit");d(e).val(t.join(","))})},r.setWPSuggest=function(){var e=d(r.form).find("[data-autotag]");d.each(e,function(e,t){var a=d(this).attr("data-taxonomy");d(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+a,{multiple:!0,multipleSep:","})})},r.save=function(){r.toggleLoading(!0),d.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:d(r.form).find("form").serialize()+"&action="+NestedPages.formActions.quickEditPost+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(e){"error"===e.status?(r.toggleLoading(!1),d(r.form).find(NestedPages.selectors.quickEditErrorDiv).text(e.message).show()):(r.toggleLoading(!1),r.newData=e.post_data,r.updatePostRow())},error:function(e){console.log(e)}})},r.updatePostRow=function(){r.row=d(r.button).parents(".row-inner"),d(r.row).find(".title").text(r.newData.post_title),d(r.row).find(".np-view-button").attr("href",r.newData.permalink);var e,t=d(r.row).find(".status");"publish"!==r.newData._status&&"future"!==r.newData._status?(e=nestedpages.post_statuses[r.newData._status].label,d(t).text("("+e+")")):d(t).text(""),"private"===r.newData.keep_private&&d(t).text(nestedpages.private),""!==r.newData.post_password&&void 0!==r.newData.post_password&&(a=d(t).text(),a+=' <span class="locked">',a+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/></svg>',a+="</span>",d(t).html(a));var a=d(r.row).find(".nav-status");"hide"==r.newData.nav_status?d(a).text("(Hidden)"):d(a).text("");a=d(r.row).parent("li");"hide"==r.newData.np_status?(d(a).addClass("np-hide"),d(r.row).find(".status").after('<svg class="row-status-icon status-np-hidden" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z" fill="none"/><path class="icon" d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>')):(d(a).removeClass("np-hide"),d(r.row).find(".status-np-hidden").remove());a=d(r.row).find(".sticky");"sticky"==r.newData.sticky?d(a).show():d(a).hide(),NestedPages.jsData.hierarchical||d(r.row).find(".np-author-display").text(r.newData.author_name);var s,n,o=d(r.row).find(NestedPages.selectors.quickEditOpen);for(s in d(o).attr("data-id",r.newData.post_id),d(o).attr("data-template",r.newData.page_template),d(o).attr("data-title",r.newData.post_title),d(o).attr("data-slug",r.newData.post_name),d(o).attr("data-commentstatus",r.newData.comment_status),d(o).attr("data-status",r.newData._status),d(o).attr("data-sticky",r.newData.sticky),"private"===r.newData.keep_private&&d(o).attr("data-status","private"),d(o).attr("data-author",r.newData.post_author),d(o).attr("data-np-status",r.newData.np_status),d(o).attr("data-password",r.newData.post_password),d(o).attr("data-navstatus",r.newData.nav_status),d(o).attr("data-navtitle",r.newData.np_nav_title),d(o).attr("data-linktarget",r.newData.link_target),d(o).attr("data-navtitleattr",r.newData.np_title_attribute),d(o).attr("data-navcss",r.newData.np_nav_css_classes),d(o).attr("data-month",r.newData.mm),d(o).attr("data-day",r.newData.jj),d(o).attr("data-year",r.newData.aa),d(o).attr("data-hour",r.newData.hh),d(o).attr("data-minute",r.newData.mn),d(o).attr("data-datepicker",r.newData.np_date),d(o).attr("data-time",r.newData.np_time),d(o).attr("data-formattedtime",r.newData.np_time),d(o).attr("data-ampm",r.newData.np_ampm),r.newData)s.includes("np_custom")&&r.newData.hasOwnProperty(s)&&(n=s.replace("np_custom_","data-npcustom-"),d(o).attr(n,r.newData[s]));r.removeTaxonomyClasses(),r.addCategoryClasses(),r.addHierarchicalClasses(),r.addFlatClasses(),r.addStatusClass(),r.formatter.removeQuickEdit(),r.formatter.flashRow(r.row)},r.addStatusClass=function(){var e=["published","draft","pending","future"];for(i=0;i<e.length;i++)d(r.row).removeClass(e[i]);d(r.row).addClass(r.newData._status)},r.removeTaxonomyClasses=function(){taxonomies=[];var e=d(r.row).attr("class").split(/\s+/);for(i=0;i<e.length;i++)"in-"===e[i].substring(0,3)&&d(r.row).removeClass(e[i]),"inf-"===e[i].substring(0,4)&&d(r.row).removeClass(e[i])},r.addCategoryClasses=function(){if(r.newData.hasOwnProperty("post_category")){var e=r.newData.post_category;for(i=0;i<e.length;i++){var t="in-category-"+e[i];d(r.row).addClass(t)}}},r.addHierarchicalClasses=function(){var e;r.newData.hasOwnProperty("tax_input")&&(e=r.newData.tax_input,d.each(e,function(e,t){for(i=0;i<t.length;i++){var a="in-"+e+"-"+t[i];d(r.row).addClass(a)}}))},r.addFlatClasses=function(){var e;r.newData.hasOwnProperty("flat_tax")&&(e=r.newData.flat_tax,d.each(e,function(e,t){for(i=0;i<t.length;i++){var a="inf-"+e+"-nps-"+t[i];d(r.row).addClass(a)}}))},r.toggleLoading=function(e){if(e)return d(NestedPages.selectors.quickEditErrorDiv).hide(),d(r.saveButton).attr("disabled","disabled"),void d(NestedPages.selectors.quickEditLoadingIndicator).show();d(r.saveButton).attr("disabled",!1),d(NestedPages.selectors.quickEditLoadingIndicator).hide()},r.bindEvents()},(NestedPages=NestedPages||{}).QuickEditLink=function(){var a=this,s=jQuery;return a.formatter=new NestedPages.Formatter,a.button="",a.postData="",a.newPostData="",a.form="",a.bindEvents=function(){s(document).on("click",NestedPages.selectors.quickEditButtonLink,function(e){e.preventDefault(),a.formatter.removeQuickEdit(),a.button=s(this),a.openQuickEdit()}),s(document).on("click",NestedPages.selectors.quickEditLinkSaveButton,function(e){e.preventDefault(),a.submitForm()}),s(document).on("keydown",function(e){27===e.keyCode&&a.formatter.removeQuickEdit()})},a.openQuickEdit=function(){a.setData(),a.createForm(),a.populateForm()},a.setData=function(){a.postData={id:s(a.button).attr("data-id"),url:s(a.button).attr("data-url"),title:s(a.button).attr("data-title"),status:s(a.button).attr("data-status"),navstatus:s(a.button).attr("data-navstatus"),npstatus:s(a.button).attr("data-np-status"),linktarget:s(a.button).attr("data-linktarget"),parentid:s(a.button).attr("data-parentid"),navtitleattr:s(a.button).attr("data-navtitleattr"),navcss:s(a.button).attr("data-navcss"),navtype:s(a.button).attr("data-nav-type"),navobject:s(a.button).attr("data-nav-object"),navobjectid:s(a.button).attr("data-nav-object-id"),navoriginallink:s(a.button).attr("data-nav-original-link"),navoriginaltitle:s(a.button).attr("data-nav-original-title")}},a.createForm=function(){var e,t=s(a.button).closest(NestedPages.selectors.row).parent("li");a.form=s(NestedPages.selectors.quickEditLinkForm).clone(),0<s(t).children("ol").length?(e=s(t).children("ol"),s(a.form).insertBefore(e)):s(a.form).appendTo(t);s(a.form).siblings(NestedPages.selectors.row).hide()},a.populateForm=function(){var e;s(a.form).find(".np_id").val(a.postData.id),s(a.form).find(".np_title").val(a.postData.title),s(a.form).find(".np_author select").val(a.postData.author),s(a.form).find(".np_status").val(a.postData.status),s(a.form).find(".np_content").val(a.postData.url),s(a.form).find(".np_parent_id").val(a.postData.parentid),s(a.form).find(".np_title_attribute").val(a.postData.navtitleattr),s(a.form).find(".np_nav_css_classes").val(a.postData.navcss),"hide"===a.postData.npstatus?s(a.form).find(".np_status").prop("checked","checked"):s(a.form).find(".np_status").removeAttr("checked"),"hide"===a.postData.navstatus?s(a.form).find(".np_nav_status").prop("checked","checked"):s(a.form).find(".np_nav_status").removeAttr("checked"),"_blank"===a.postData.linktarget?s(a.form).find(".link_target").prop("checked","checked"):s(a.form).find(".link_target").removeAttr("checked"),"custom"!==a.postData.navobject&&""!==a.postData.navobject?(e='<div class="form-control original-link">Original: <a href="'+a.postData.navoriginallink+'" target="_blank">'+a.postData.navoriginaltitle+"</a></div>",s(a.form).find("[data-url-field]").remove(),s(e).insertAfter(s(a.form).find("h3")),s(a.form).find("[data-np-menu-object-input]").val(a.postData.navobject),s(a.form).find("[data-np-menu-objectid-input]").val(a.postData.navobjectid),s(a.form).find("[data-np-menu-type-input]").val(a.postData.navtype),s(a.form).find("h3").text("Link: "+a.postData.navoriginaltitle)):(s(a.form).find("h3").text("Link"),s(a.form).find("[data-np-menu-object-input]").val("custom"),s(a.form).find("[data-np-menu-type-input]").val("custom")),a.formatter.showQuickEdit(),s(a.form).show()},a.submitForm=function(){a.toggleLoading(!0),s.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:s(a.form).find("form").serialize()+"&action="+NestedPages.formActions.quickEditLink+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(e){"error"===e.status?(a.toggleLoading(!1),s(a.form).find(NestedPages.selectors.quickEditErrorDiv).text(e.message).show()):(a.toggleLoading(!1),a.newPostData=e.post_data,a.updateRow())},error:function(e){a.toggleLoading(!1),s(a.form).find(NestedPages.selectors.quickEditErrorDiv).text("The form could not be saved at this time.").show()}})},a.updateRow=function(){var e=s(a.form).siblings(".row");s(e).find(".title").html(a.newPostData.post_title+' <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path class="icon" d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>');var t=s(e).find(".status");"publish"!==a.newPostData._status&&"future"!==a.newPostData._status?s(t).text("("+a.newPostData._status+")"):s(t).text("");t=s(e).find(".nav-status");"hide"==a.newPostData.nav_status?s(t).text("("+NestedPages.jsData.hiddenText+")"):s(t).text("");t=s(e).parent("li");"hide"==a.newPostData.np_status?(s(t).addClass("np-hide"),s(e).find(".status").after('<svg class="row-status-icon status-np-hidden" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0zm0 0h24v24H0z" fill="none"/><path class="icon" d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>')):(s(t).removeClass("np-hide"),s(e).find(".status-np-hidden").remove());t=s(e).find(NestedPages.selectors.quickEditButtonLink);s(t).attr("data-id",a.newPostData.post_id),s(t).attr("data-title",a.newPostData.post_title),s(t).attr("data-url",a.newPostData.post_content),s(t).attr("data-status",a.newPostData._status),s(t).attr("data-navstatus",a.newPostData.nav_status),s(t).attr("data-np-status",a.newPostData.np_status),s(t).attr("data-linkTarget",a.newPostData.linkTarget),s(t).attr("data-navtitleattr",a.newPostData.titleAttribute),s(t).attr("data-navcss",a.newPostData.cssClasses),a.formatter.removeQuickEdit(),a.formatter.flashRow(e)},a.toggleLoading=function(e){if(s(".row").removeClass("np-updated").removeClass("np-updated-show"),e)return s(NestedPages.selectors.quickEditErrorDiv).hide(),s(NestedPages.selectors.quickEditLinkSaveButton).attr("disabled","disabled"),void s(NestedPages.selectors.quickEditLoadingIndicator).show();s(NestedPages.selectors.quickEditLinkSaveButton).attr("disabled",!1),s(NestedPages.selectors.quickEditLoadingIndicator).hide()},a.bindEvents()},(NestedPages=NestedPages||{}).Clone=function(){var t=this,a=jQuery;return t.parent_id="",t.parent_title="",t.parentLi=null,t.formatter=new NestedPages.Formatter,t.bindEvents=function(){a(document).on("click",NestedPages.selectors.cloneButton,function(e){e.preventDefault(),t.parent_id=a(this).attr("data-id"),t.parent_title=a(this).attr("data-parentname"),t.parentLi=a(this).parent(".row").parent(".page-row").parent(".npList"),t.openModal()}),a(document).on("click",NestedPages.selectors.confirmClone,function(e){e.preventDefault(),t.clone()})},t.openModal=function(){a("#"+NestedPages.selectors.cloneModal).find("[data-clone-parent]").text(t.parent_title),a(document).trigger("open-modal-manual",NestedPages.selectors.cloneModal)},t.clone=function(){t.toggleLoading(!0),a.ajax({url:NestedPages.jsData.ajaxurl,type:"post",data:{action:NestedPages.formActions.clonePost,parent_id:t.parent_id,quantity:a(NestedPages.selectors.cloneQuantity).val(),status:a(NestedPages.selectors.cloneStatus).val(),author:a(NestedPages.selectors.cloneAuthor).find("select").val(),nonce:NestedPages.jsData.nonce,posttype:NestedPages.jsData.posttype},success:function(e){t.toggleLoading(!1),a(document).trigger("close-modal-manual"),location.reload()}})},t.toggleLoading=function(e){if(e)return a("#"+NestedPages.selectors.cloneModal).find("[data-clone-loading]").show(),void a(NestedPages.selectors.confirmClone).attr("disabled","disabled");a("#"+NestedPages.selectors.cloneModal).find("[data-clone-loading]").hide(),a(NestedPages.selectors.confirmClone).attr("disabled",!1)},t.bindEvents()},(NestedPages=NestedPages||{}).Tabs=function(){var r=this,d=jQuery;return r.selectors={tabToggle:"data-np-tab-toggle",tabPane:"data-np-tab-pane",tabGroup:"data-np-tab-group"},r.bindEvents=function(){d(document).on("click","["+r.selectors.tabToggle+"]",function(e){e.preventDefault(),r.toggleTabs(d(this))})},r.toggleTabs=function(e){for(var t=d(e).attr(r.selectors.tabGroup),a=d("*["+r.selectors.tabGroup+"="+t+"]["+r.selectors.tabPane+"]"),s=d(e).attr(r.selectors.tabToggle),n=d("*["+r.selectors.tabGroup+"="+t+"]["+r.selectors.tabToggle+"]"),o=[],i=0;i<n.length;i++)o[i]=d(n[i]).parent("li")[0];d(a).hide(),d(n).removeClass("active"),d(o).removeClass("active"),d.each(a,function(){d(this).attr(r.selectors.tabPane)==s&&d(this).show()}),d.each(n,function(){d(this).attr(r.selectors.tabToggle)==s&&(d(this).addClass("active"),d(this).parent("li").addClass("active"))}),d(document).trigger("tabs-changed",[s,t,e])},r.bindEvents()},jQuery(document).ready(function(){new NestedPages.Factory}),(NestedPages=NestedPages||{}).selectors={childToggle:".child-toggle",childToggleLink:".child-toggle a",toggleAll:".nestedpages-toggleall",toggleHidden:".np-toggle-hidden",toggleStatus:".np-toggle-publish",lists:".nplist",rows:".page-row",row:".row",sortable:".sortable",notSortable:".no-sort",handle:".handle",published:".published",hiddenRows:".np-hide",errorDiv:"#np-error",loadingIndicator:"#nested-loading",syncCheckbox:".np-sync-menu",syncForm:".np-sync-menu-cont",ajaxError:"[data-nestedpages-error]",trashWithChildrenButton:"[data-nestedpages-trash-children]",toggleEditButtons:".np-toggle-edit",bulkActionsHeader:".nestedpages-list-header",bulkActionsForm:"[data-np-bulk-form]",bulkActionsCheckbox:"[data-np-bulk-checkbox]",bulkActionsIds:"[data-np-bulk-ids]",bulkActionRedirectIds:"[data-np-bulk-redirect-ids]",hiddenItemCount:"[data-np-hidden-count]",hiddenItemCountParent:"[data-np-hidden-count-parent]",bulkEditForm:"[data-np-bulk-edit-form]",bulkEditTitles:"[data-np-bulk-titles]",bulkEditRemoveItem:"[data-np-remove-bulk-item]",bulkEditCancel:"[data-np-cancel-bulk-edit]",bulkEditLinkCount:"[data-bulk-edit-link-count]",quickEditOverlay:".np-inline-overlay",quickEditLoadingIndicator:".np-qe-loading",quickEditErrorDiv:".np-quickedit-error",quickEditCancel:".np-cancel-quickedit",quickEditButtonLink:".np-quick-edit-redirect",quickEditLinkForm:".quick-edit-form-redirect",quickEditLinkSaveButton:".np-save-quickedit-redirect",quickEditOpen:".np-quick-edit",quickEditPostForm:".quick-edit-form",quickEditSaveButton:".np-save-quickedit",openLinkModal:".open-redirect-modal",linkModal:"np-link-modal",saveLink:".np-save-link",linkLoadingIndicator:".np-link-loading",linkErrorDiv:".np-new-link-error",linkForm:".np-new-link-form",linkDeleteButton:"[data-np-confirm-delete]",linkDeleteConfirmationButton:"[data-delete-confirmation]",linkDeleteConfirmationModal:"np-delete-confirmation-modal",linkDeleteConfirmationModalText:"[data-np-link-delete-text]",openPageModal:".open-bulk-modal",newPageModal:"#np-bulk-modal",newPageFormContainer:".new-child-form",newPageForm:".np-new-child-form",newPageSubmitButton:".np-save-newchild",newPageTitle:".add-new-child-row",newPageRemoveTitle:".np-remove-child",addChildButton:".add-new-child",newChildError:".np-newchild-error",cancelNewChildButton:".np-cancel-newchild",newBeforeButton:"data-insert-before",newAfterButton:"data-insert-after",cloneButton:".clone-post",confirmClone:"[data-confirm-clone]",cloneModal:"np-clone-modal",cloneQuantity:"[data-clone-quantity]",cloneStatus:"[data-clone-status]",cloneAuthor:"[data-clone-author]",tabButtonParent:"[data-np-tabs]",tabButton:"[data-np-tab]",tabContent:"[data-np-tab-pane]",thumbnailContainer:".np-thumbnail",thumbnailContainerLink:".np-thumbnail.link",manualMenuSync:"[data-np-manual-menu-sync]",manualOrderSync:"[data-np-manual-order-sync]"},NestedPages.cssClasses={noborder:"no-border"},NestedPages.jsData={ajaxurl:ajaxurl,nonce:nestedpages.np_nonce,allPostTypes:nestedpages.post_types,syncmenu:"nosync",posttype:"",nestable:!0,sortable:!0,hierarchical:!0,expandText:nestedpages.expand_text,collapseText:nestedpages.collapse_text,showHiddenText:nestedpages.show_hidden,hideHiddenText:nestedpages.hide_hidden,quickEditText:nestedpages.quick_edit,hiddenText:nestedpages.hidden,titleText:nestedpages.title},NestedPages.formActions={syncToggles:"npnestToggle",syncNesting:"npsort",syncMenu:"npsyncMenu",newPage:"npnewChild",newBeforeAfter:"npnewBeforeAfter",quickEditLink:"npquickEditLink",getTaxonomies:"npgetTaxonomies",quickEditPost:"npquickEdit",clonePost:"npclonePost",search:"npmenuSearch",newMenuItem:"npnewMenuItem",manualMenuSync:"npmanualMenuSync",postSearch:"nppostSearch",wpmlTranslations:"npWpmlTranslations",resetSettings:"npresetSettings",resetUserPrefs:"npresetUserPreferences",resetAdminMenuSettings:"npresetAdminMenuSettings",trashWithChildren:"nptrashWithChildren"},NestedPages.Factory=function(){var t=this,e=jQuery;return t.formatter=new NestedPages.Formatter,t.dropdowns=new NestedPages.Dropdowns,t.modals=new NestedPages.Modals,t.checkAll=new NestedPages.CheckAll,t.bulkActions=new NestedPages.BulkActions,t.menuToggle=new NestedPages.MenuToggle,t.pageToggle=new NestedPages.PageToggle,t.nesting=new NestedPages.Nesting,t.syncMenuSetting=new NestedPages.SyncMenuSetting,t.newPage=new NestedPages.NewPost,t.quickEditLink=new NestedPages.QuickEditLink,t.quickEditPost=new NestedPages.QuickEditPost,t.clone=new NestedPages.Clone,t.tabs=new NestedPages.Tabs,t.menuLinks=new NestedPages.MenuLinks,t.hiddenItemCount=new NestedPages.HiddenItemCount,t.confirmDelete=new NestedPages.ConfirmDelete,t.manualSync=new NestedPages.ManualSync,t.postSearch=new NestedPages.PostSearch,t.postMove=new NestedPages.MovePost,t.wpml=new NestedPages.Wpml,t.trashWithChildren=new NestedPages.TrashWithChildren,t.init=function(){nestedpages.settings_page||(t.bindEvents(),t.setPostType(),t.setMenuSync(),t.setNestable(),t.setSortable(),t.formatter.updateSubMenuToggle(),t.formatter.setBorders(),t.formatter.setNestedMargins(),t.nesting.initializeSortable())},t.bindEvents=function(){e(document).on("click",NestedPages.selectors.quickEditOverlay,function(e){t.formatter.removeQuickEdit(),t.newPage.cancelNewPage()}),e(document).ready(function(){t.formatter.hideAjaxError(),t.formatter.sizeLinkThumbnails()})},t.setNestable=function(){var a=!1;e.each(NestedPages.jsData.allPostTypes,function(e,t){t.name===NestedPages.jsData.posttype&&(!0===t.hierarchical&&(a=!0),!0===t.disable_nesting&&(a=!1))}),NestedPages.jsData.nestable=a},t.setSortable=function(){var a=!0;e.each(NestedPages.jsData.allPostTypes,function(e,t){t.name===NestedPages.jsData.posttype&&void 0!==t.disable_sorting&&""!==t.disable_sorting&&"true"===t.disable_sorting&&(a=!1)}),NestedPages.jsData.sortable=a},t.setPostType=function(){NestedPages.jsData.posttype=nestedpages.current_post_type,void 0!==NestedPages.jsData.posttype&&""!==NestedPages.jsData.posttype||(NestedPages.jsData.posttype=e(NestedPages.selectors.sortable).attr("id").substring(3)),NestedPages.jsData.hierarchical=NestedPages.jsData.allPostTypes[NestedPages.jsData.posttype].hierarchical},t.setMenuSync=function(){NestedPages.jsData.syncmenu="1"===nestedpages.syncmenu?"sync":"nosync"},t.init()},(NestedPages=NestedPages||{}).MenuLinks=function(){var a=this,s=jQuery;return a.typeButton="",a.post="",a.formatter=new NestedPages.Formatter,a.selectors={form:"[data-np-menu-item-form]",typeSelect:"[data-np-menu-selection]",accordion:"[data-np-menu-accordion]",accordionItem:"[data-np-menu-accordion-item]",formPlaceholder:".np-menu-link-object-placeholder",formDetails:".np-menu-link-details",searchResults:"[data-np-search-result]",defaultResults:"[data-default-result]",originalLink:"[data-np-original-link]",saveButton:"[data-np-save-link]",urlInputCont:"[data-np-menu-url-cont]",errorDiv:"[data-np-error]"},a.fields={object:"[data-np-menu-object-input]",objectid:"[data-np-menu-objectid-input]",itemType:"[data-np-menu-type-input]",url:"[data-np-menu-url]",navigationLabel:"[data-np-menu-navigation-label]",titleAttribute:"[data-np-menu-title-attr]",cssClasses:"[data-np-menu-css-classes]",npStatus:"[data-np-menu-np-status]",linkTarget:"[data-np-menu-link-target]",menuTitle:"[data-np-menu-title]",parentPostType:"[data-np-menu-parent-post-type]"},a.search=new NestedPages.MenuSearch,a.bindEvents=function(){s(document).on("click",NestedPages.selectors.openLinkModal,function(e){e.preventDefault(),a.postParent=s(this).attr("data-parentid"),s(a.selectors.form).find(".parent_id").val(s(this).attr("data-parentid")),a.openModal()}),s(document).on("click",a.selectors.accordionItem,function(e){e.preventDefault(),a.accordion(s(this))}),s(document).on("click",a.selectors.typeSelect,function(e){e.preventDefault(),a.typeButton=s(this),a.setLinkType()}),s(document).on("keyup",a.fields.navigationLabel,function(){a.updateTitle()}),s(document).on("click",a.selectors.saveButton,function(e){e.preventDefault(),a.submitForm()}),s(document).on("keydown",function(e){27===e.keyCode&&s(document).trigger("close-modal-manual")})},a.openModal=function(){s(NestedPages.selectors.linkErrorDiv).hide(),s(NestedPages.selectors.linkModal).find("input").val(""),s(NestedPages.selectors.linkModal).find(".parent_id").val(a.postParent),a.clearForm(),s(a.selectors.accordion).find("ul").hide(),s(a.selectors.typeSelect).removeClass("active"),s(document).trigger("open-modal-manual",NestedPages.selectors.linkModal)},a.accordion=function(e){a.clearForm();var t=s(e).siblings("ul");if(s(t).is(":visible"))return s(e).removeClass("active"),void s(t).slideUp("fast");s(a.selectors.accordionItem).removeClass("active"),s(e).addClass("active"),s(e).parents(a.selectors.accordion).find("ul").slideUp("fast"),s(t).slideDown("fast")},a.setLinkType=function(){s(a.typeButton).hasClass("active")?a.clearForm():(s(a.typeButton).hasClass("np-custom-link")&&(s(a.selectors.accordionItem).removeClass("active"),s(a.selectors.accordion).find("ul").slideUp("fast")),s(a.selectors.formPlaceholder).hide(),a.populateForm())},a.populateForm=function(){s(a.selectors.saveButton).show(),s(a.selectors.typeSelect).removeClass("active"),s(a.typeButton).addClass("active"),s(a.fields.menuTitle).text(s(a.typeButton).text()).val(s(a.typeButton).text()),s(a.selectors.form).find("h3").find("em").text(s(a.typeButton).attr("data-np-object-name")),""!==s(a.typeButton).attr("data-np-permalink")?(s(a.selectors.form).find(a.selectors.urlInputCont).hide(),s(a.selectors.form).find(a.selectors.originalLink).html('<a href="'+s(a.typeButton).attr("data-np-permalink")+'">'+s(a.typeButton).text()+"</a>"),s(a.selectors.form).find(a.selectors.originalLink).parent(".original-link").show()):(s(a.selectors.form).find(a.selectors.urlInputCont).show(),s(a.selectors.form).find(a.selectors.originalLink).parent(".original-link").hide()),s(a.fields.object).val(s(a.typeButton).attr("data-np-menu-object")),s(a.fields.objectid).val(s(a.typeButton).attr("data-np-menu-objectid")),s(a.fields.itemType).val(s(a.typeButton).attr("data-np-menu-type")),s(a.selectors.formDetails).show()},a.clearForm=function(){s(a.selectors.form).find(a.selectors.errorDiv).hide(),s(a.selectors.saveButton).hide(),s(a.selectors.formDetails).hide(),s(a.selectors.formPlaceholder).show(),s(a.selectors.form).find("input").not(".parent_id").not(".parent-post-type").val(""),s(a.selectors.form).find(a.fields.linkTarget).val("_blank"),s(a.selectors.form).find('input[type="checkbox"]').attr("checked",!1),s(a.selectors.typeSelect).removeClass("active"),a.search.toggleLoading(!1),s(a.selectors.searchResults).remove(),s(a.selectors.defaultResults).show()},a.updateTitle=function(){var e=s(a.fields.navigationLabel).val(),t=s(a.selectors.form).find("h3").find("span");""!==e?(s(a.fields.menuTitle).val(e),s(t).text(e)):(s(a.fields.menuTitle).val(s(a.typeButton).text()),s(t).text(s(a.typeButton).text()))},a.submitForm=function(){a.toggleLoading(!0),s.ajax({url:NestedPages.jsData.ajaxurl,type:"post",data:s(a.selectors.form).serialize()+"&action="+NestedPages.formActions.newMenuItem+"&nonce="+NestedPages.jsData.nonce+"&post_type="+NestedPages.jsData.posttype+"&syncmenu="+NestedPages.jsData.syncmenu,success:function(e){a.toggleLoading(!1),"error"!==e.status?(a.post=e.post_data,a.createRow()):s(a.selectors.form).find(a.selectors.errorDiv).text(e.message).show()},error:function(e){console.log(e)}})},a.createRow=function(){var e='<li id="menuItem_'+a.post.id+'" class="page-row published';e+='">',e+='<div class="row"><div class="child-toggle"><div class="child-toggle-spacer"></div></div><div class="row-inner">',e+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="np-icon-sub-menu"><path fill="none" d="M0 0h24v24H0V0z"/><path d="M19 15l-6 6-1.42-1.42L15.17 16H4V4h2v10h9.17l-3.59-3.58L13 9l6 6z" class="arrow" /></svg>',e+='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class="handle np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg>',e+='<a href="'+a.post.np_link_content+'" class="page-link page-title" target="_blank"><span class="title">'+a.post.menuTitle+' <svg class="link-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path class="icon" d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg></span>',e+='</a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ',e+='data-id="'+a.post.id+'"',e+='data-parentid="'+a.post.parent_id+'"',e+='data-title="'+a.post.menuTitle+'" ',e+='data-url="'+a.post.url+'" ',e+='data-status="publish" ',e+='data-np-status="show" ',e+='data-navstatus="show" ',e+='data-navcss="'+a.post.cssClasses+'" ',e+='data-navtitleattr="'+a.post.titleAttribute+'" ',e+='data-nav-type="'+a.post.menuType+'" ',e+='data-nav-object="'+a.post.objectType+'" ',e+='data-nav-object-id="'+a.post.objectId+'" ',e+='data-nav-original-link="'+a.post.original_link+'" ',e+='data-nav-original-title="'+a.post.original_title+'" ',e+='data-linktarget="'+a.post.link_target+'">',e+=NestedPages.jsData.quickEditText,e+="</a>",e+='<a href="'+a.post.delete_link+'" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>',e+="</div></div></div></li>","0"===a.post.parent_id?s(".nplist:first li:first").after(e):a.appendChildRow(e),s(document).trigger("close-modal-manual"),a.row=s("#menuItem_"+a.post.id).find(".row"),a.formatter.flashRow(a.row)},a.appendChildRow=function(e){var t=s("#menuItem_"+a.post.parent_id);0===s(t).children("ol").length?(e='<ol class="sortable nplist" style="display:block;">'+e+"</ol>",s(t).append(e)):s(t).find("ol:first").prepend(e),a.formatter.updateSubMenuToggle()},a.toggleLoading=function(e){if(e)return s(a.selectors.form).find(a.selectors.errorDiv).hide(),s(a.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).show(),void s(a.selectors.saveButton).attr("disabled","disabled");s(a.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).hide(),s(a.selectors.saveButton).attr("disabled",!1)},a.bindEvents()},(NestedPages=NestedPages||{}).MenuSearch=function(){var s=this,n=jQuery;return s.selectors={searchForms:"*[data-np-menu-search]",defaultResults:"[data-default-result]",loadingIndicator:".np-menu-search-loading",noResults:".np-menu-search-noresults",searchType:"data-search-type",searchObject:"data-search-object",searchResults:"[data-np-search-result]"},s.activeForm="",s.results="",s.defaultResults="",s.searchType="",s.searchObject="",s.init=function(){s.bindEvents()},s.bindEvents=function(){n(document).on("keyup",s.selectors.searchForms,function(){s.activeForm=n(this),n(s.selectors.searchResults).remove(),s.performSearch()})},s.performSearch=function(){if(s.defaultResults=n(s.activeForm).parent("li").siblings(s.selectors.defaultResults),2<n(s.activeForm).val().length)return n(s.defaultResults).hide(),s.toggleLoading(!0),void s.query();s.toggleLoading(!1),n(s.defaultResults).show()},s.query=function(){s.searchType=n(s.activeForm).attr(s.selectors.searchType),s.searchObject=n(s.activeForm).attr(s.selectors.searchObject),n.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.search,nonce:NestedPages.jsData.nonce,term:n(s.activeForm).val(),searchType:s.searchType,searchObject:s.searchObject},success:function(e){console.log(e),e.results?(s.results=e.results,s.toggleLoading(!1),"post_type"===s.searchType?s.appendPosts():s.appendTaxonomies()):(s.toggleLoading(!1),n(s.activeForm).siblings(s.selectors.noResults).show())}})},s.appendPosts=function(){var a="";n.each(s.results,function(e,t){a+='<li data-np-search-result><a href="#" data-np-menu-object="'+s.searchObject+'" data-np-menu-type="post_type" data-np-menu-objectid="'+t.ID+'" data-np-permalink="'+t.permalink+'" data-np-object-name="'+t.singular_name+'" data-np-menu-selection>'+t.post_title+"</a></li>"}),n(a).insertAfter(n(s.activeForm).parent("li")),s.toggleLoading(!1)},s.appendTaxonomies=function(){var a="";n.each(s.results,function(e,t){a+='<li data-np-search-result><a href="#" data-np-menu-object="'+s.searchObject+'" data-np-menu-type="post_type" data-np-menu-objectid="'+t.term_id+'" data-np-permalink="'+t.permalink+'" data-np-object-name="'+t.taxonomy+'" data-np-menu-selection>'+t.name+"</a></li>"}),n(a).insertAfter(n(s.activeForm).parent("li")),s.toggleLoading(!1)},s.toggleLoading=function(e){var t=n(s.activeForm).siblings(s.selectors.loadingIndicator);n(s.selectors.noResults).hide(),e?n(t).show():n(t).hide()},s.init()},jQuery(document).ready(function(){new NestedPagesTrash});var NestedPagesTrash=function(){var t=this,a=jQuery;return t.trashButton=".np-empty-trash",t.confirmButton=".np-trash-confirm",t.warningModal="#np-trash-modal",t.errorAlert="#np-error",t.loadingIndicator="#nested-loading",t.trashLinks=".np-trash-links",t.postType=a("#np-trash-posttype").val(),t.nonce=nestedpages.np_nonce,t.formAction="npEmptyTrash",t.bindEvents=function(){a(document).on("click",t.confirmButton,function(e){e.preventDefault(),t.confirmEmpty()})},t.confirmEmpty=function(){t.loading(!0),a(document).trigger("close-modal-manual"),a(t.errorAlert).hide(),t.emptyTrash()},t.emptyTrash=function(){a.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:t.formAction,nonce:t.nonce,posttype:t.postType},success:function(e){t.loading(!1),"error"===e.status?a(t.errorAlert).text(e.message).show():(a(t.trashLinks).hide(),a(".notice-dismiss").click())}})},t.loading=function(e){e?a(t.loadingIndicator).show():a(t.loadingIndicator).hide()},t.bindEvents()};(NestedPages=NestedPages||{}).ConfirmDelete=function(){var t=this,a=jQuery;return t.deleteLink="",t.bindEvents=function(){a(document).on("click",NestedPages.selectors.linkDeleteButton,function(e){e.preventDefault(),t.confirmSingle(a(this))}),a(document).on("click",NestedPages.selectors.linkDeleteConfirmationButton,function(e){e.preventDefault(),a(this).hasClass("bulk")?t.deleteMultiple():t.deleteSingle()}),a(document).on("submit",NestedPages.selectors.bulkActionsForm,function(e){t.confirmMultiple(e)})},t.confirmSingle=function(e){t.deleteLink=a(e).attr("href"),a(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation_singular),a(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.delete).removeClass("bulk"),a(document).trigger("open-modal-manual",NestedPages.selectors.linkDeleteConfirmationModal)},t.confirmMultiple=function(e){"trash"===a('select[name="np_bulk_action"]').val()&&""!==a(NestedPages.selectors.bulkActionRedirectIds).val()&&(e.preventDefault(),a(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation),a(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.trash_delete_links).addClass("bulk"),a(document).trigger("open-modal-manual",[NestedPages.selectors.linkDeleteConfirmationModal]))},t.deleteMultiple=function(){a(NestedPages.selectors.bulkActionsForm)[0].submit()},t.deleteSingle=function(){window.location.replace(t.deleteLink)},t.bindEvents()},(NestedPages=NestedPages||{}).ManualSync=function(){var t=this,a=jQuery;return t.activeBtn="",t.bindEvents=function(){a(document).on("click",NestedPages.selectors.manualMenuSync,function(e){e.preventDefault(),t.activeBtn=a(this),t.syncMenu()}),a(document).on("click",NestedPages.selectors.manualOrderSync,function(e){e.preventDefault(),t.activeBtn=a(this),t.syncOrder()})},t.syncMenu=function(){t.loading(!0),a.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.manualMenuSync,nonce:NestedPages.jsData.nonce,post_type:NestedPages.jsData.posttype,syncmenu:"sync"},success:function(e){"error"===e.status?(a(NestedPages.selectors.errorDiv).text(e.message).show(),a(NestedPages.selectors.loadingIndicator).hide()):t.loading(!1)}})},t.syncOrder=function(){t.loading(!0),(new NestedPages.Nesting).syncNesting(!0,t.loading(!1))},t.loading=function(e){if(e)return a(t.activeBtn).addClass("disabled"),void a(NestedPages.selectors.loadingIndicator).show();a(t.activeBtn).removeClass("disabled"),a(NestedPages.selectors.loadingIndicator).hide()},t.bindEvents()},(NestedPages=NestedPages||{}).PostSearch=function(){var s=this,n=jQuery;return s.selectors={input:"data-nestedpages-post-search",form:"data-nestedpages-post-search-form",loadingIndicator:"data-nestedpages-loading",noResults:"data-nestedpages-no-results",results:"data-nestedpages-search-results"},s.changed=!1,s.activeInput="",s.results="",s.defaultResults="",s.postType="",s.activeForm="",s.bindEvents=function(){n("["+s.selectors.input+"]").on("input",function(){return s.activeInput=n(this),s.setOptions(),s.changed||s.setDefaultResults(),""===n(this).val()?(n(s.activeForm).find("["+s.selectors.noResults+"]").hide(),void s.showDefaultResults()):void s.query()})},s.setDefaultResults=function(){s.defaultResults=n(s.activeForm).find("["+s.selectors.results+"]").html(),s.changed=!0},s.showDefaultResults=function(){n(s.activeForm).find("["+s.selectors.results+"]").html(s.defaultResults)},s.setOptions=function(){s.postType=n(s.activeInput).attr(s.selectors.input),s.activeForm=n(s.activeInput).parents("["+s.selectors.form+"]")},s.performSearch=function(){if(s.defaultResults=n(s.activeForm).parent("li").siblings(s.selectors.defaultResults),2<n(s.activeForm).val().length)return n(s.defaultResults).hide(),s.toggleLoading(!0),void s.query();s.toggleLoading(!1),n(s.defaultResults).show()},s.query=function(){n(s.activeForm).find("["+s.selectors.results+"]").empty(),s.toggleLoading(!0),n.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.postSearch,nonce:NestedPages.jsData.nonce,term:n(s.activeInput).val(),postType:s.postType},success:function(e){e.results?(s.results=e.results,s.loadResults(),s.toggleLoading(!1)):(s.toggleLoading(!1),n(s.activeForm).find("["+s.selectors.noResults+"]").show())}})},s.loadResults=function(){var a="<ul>";n.each(s.results,function(e,t){a+='<li><a href="#" data-assignment-page-id="'+t.ID+'" data-assignment-page-title="'+t.post_title+'">'+t.post_title+"</a></li>"}),a+="</ul>",n(s.activeForm).find("["+s.selectors.results+"]").html(a),s.toggleLoading(!1)},s.toggleLoading=function(e){var t=n(s.activeForm).find("["+s.selectors.loadingIndicator+"]"),a=n(s.activeForm).find("["+s.selectors.noResults+"]");n(a).hide(),e?n(t).show():n(t).hide()},s.bindEvents()},(NestedPages=NestedPages||{}).MovePost=function(){var t=this,a=jQuery;return t.formatter=new NestedPages.Formatter,t.nesting=new NestedPages.Nesting,t.activeRow,t.selectors={moveToTop:"data-push-to-top",moveToBottom:"data-push-to-bottom"},t.bindEvents=function(){a(document).ready(function(){t.disableTopOnFirst(),t.disableBottomOnLast()}),a(document).on("click","["+t.selectors.moveToTop+"]",function(e){e.preventDefault(),a(this).hasClass("disabled")||(t.activeRow=a(this).closest(NestedPages.selectors.rows),t.moveToTop())}),a(document).on("click","["+t.selectors.moveToBottom+"]",function(e){e.preventDefault(),a(this).hasClass("disabled")||(t.activeRow=a(this).closest(NestedPages.selectors.rows),t.moveToBottom())})},t.moveToTop=function(){var e=a(t.activeRow).parent(NestedPages.selectors.lists),e=a(e).find(NestedPages.selectors.rows).first();a(t.activeRow).insertBefore(e),t.formatter.setBorders(),a(document).click(),t.nesting.syncNesting(),t.disableTopOnFirst(),t.disableBottomOnLast()},t.moveToBottom=function(){var e=a(t.activeRow).parent(NestedPages.selectors.lists),e=a(e).children(NestedPages.selectors.rows).last();a(t.activeRow).insertAfter(e),t.formatter.setBorders(),a(document).click(),t.nesting.syncNesting(),t.disableTopOnFirst(),t.disableBottomOnLast()},t.disableTopOnFirst=function(){var e=a(NestedPages.selectors.lists);a.each(e,function(){a(this).find("["+t.selectors.moveToTop+"]").removeClass("disabled");var e=a(this).find(NestedPages.selectors.rows).first();a(e).find("["+t.selectors.moveToTop+"]").addClass("disabled")})},t.disableBottomOnLast=function(){var e=a(NestedPages.selectors.lists);a.each(e,function(){a(this).find("["+t.selectors.moveToBottom+"]").removeClass("disabled");var e=a(this).find(NestedPages.selectors.rows).last();a(e).find("["+t.selectors.moveToBottom+"]").addClass("disabled")})},t.bindEvents()},(NestedPages=NestedPages||{}).TrashWithChildren=function(){var t=this,a=jQuery;return t.post_id="",t.bindEvents=function(){a(document).on("click",NestedPages.selectors.trashWithChildrenButton,function(e){e.preventDefault(),t.post_id=a(this).attr("data-post-id"),t.trash()})},t.trash=function(){a.ajax({url:NestedPages.jsData.ajaxurl,type:"post",data:{action:NestedPages.formActions.trashWithChildren,nonce:NestedPages.jsData.nonce,post_id:t.post_id,screen:nestedpages.current_page},success:function(e){window.location.replace(e.redirect)},error:function(e){console.log(e)}})},t.bindEvents()},(NestedPages=NestedPages||{}).Wpml=function(){var t=this,n=jQuery;return t.button=null,t.postData=null,t.modal=null,t.parent_li=null,t.formatter=new NestedPages.Formatter,t.selectors={translationsBtn:"data-nestedpages-translations",modal:"data-np-wpml-translations-modal",title:"data-wmpl-translation-title",table:"data-np-wpml-translations-modal-table"},t.bindEvents=function(){nestedpages.wpml&&n(document).on("click","["+t.selectors.translationsBtn+"]",function(e){e.preventDefault(),t.createTranslationsModal(n(this))})},t.createTranslationsModal=function(e){t.parent_li=n(e).parents(".action-buttons").closest(NestedPages.selectors.row).parent("li"),t.button=n(t.parent_li).find(NestedPages.selectors.quickEditOpen),t.postData={id:n(t.button).attr("data-id"),title:n(t.button).attr("data-title"),slug:n(t.button).attr("data-slug")},t.modal=n("["+t.selectors.modal+"]").clone(),0<n(t.parent_li).children("ol").length?(e=n(t.parent_li).children("ol"),n(t.modal).insertBefore(e)):n(t.modal).appendTo(t.parent_li),n(t.modal).find("["+t.selectors.title+"]").text(t.postData.title),t.formatter.showQuickEdit(),n(t.modal).show(),t.getTranslationData()},t.getTranslationData=function(){n.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.wpmlTranslations,post_id:t.postData.id,nonce:NestedPages.jsData.nonce},success:function(e){console.log(e),console.log(t.postData.id),"success"===e.status?t.populateModal(e.translations):(n(t.modal).find(NestedPages.selectors.quickEditErrorDiv).text(e.message).show(),t.toggleLoading(!1))}})},t.populateModal=function(a){var s="<tbody>";n.each(a,function(e,t){e=a[e];s+="<tr>",s+='<td><img src="'+e.country_flag_url+'" alt="'+e.translated_name+'" /> '+e.translated_name+"</td>",s+="<td>",e.has_translation&&e.edit_link?s+='<a href="'+e.edit_link+'">'+e.translation.post_title+" ("+nestedpages.edit+")</a>":s+='<a href="'+e.add_link+'" class="np-btn">+ '+nestedpages.add_translation+"</a>",s+="</td>",s+="</tr>"}),s+="</tbody>",n(t.modal).find("["+t.selectors.table+"]").html(s),t.toggleLoading(!1)},t.toggleLoading=function(e){e?n(t.modal).addClass("loading"):n(t.modal).removeClass("loading")},t.bindEvents()};
assets/js/nestedpages.settings.min.js CHANGED
@@ -1 +1 @@
1
- var NestedPages;(NestedPages=NestedPages||{}).SettingsReset=function(){var t=this,s=jQuery;return t.selectors={resetButton:"data-nestedpages-reset-settings",resetForm:".nestedpages-reset-settings",formComplete:".nestedpages-reset-settings-complete",resetAdminMenu:"data-nestedpages-reset-admin-menu"},t.bindEvents=function(){s(document).on("click","["+t.selectors.resetButton+"]",function(e){e.preventDefault(),t.resetSettings()}),s(document).on("click","["+t.selectors.resetAdminMenu+"]",function(e){e.preventDefault(),t.resetAdminMenu()})},t.resetSettings=function(){t.loading(!0),s.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.resetSettings,nonce:NestedPages.jsData.nonce},success:function(e){t.loading(!1),s(t.selectors.resetForm).hide(),s(t.selectors.formComplete).show(),"success"!==e.status&&console.log("There was an error saving toggled pages.")}})},t.resetAdminMenu=function(){t.loading(!0),s.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.resetAdminMenuSettings,nonce:NestedPages.jsData.nonce},success:function(e){t.loading(!1),"success"==e.status&&location.reload(),"success"!==e.status&&console.log("There was an error saving toggled pages.")}})},t.loading=function(e){if(e)return s("["+t.selectors.resetButton+"]").attr("disabled",!0),void s("["+t.selectors.resetAdminMenu+"]").attr("disabled",!0);s("["+t.selectors.resetButton+"]").removeAttr("disabled"),s("["+t.selectors.resetAdminMenu+"]").removeAttr("disabled")},t.bindEvents()},new NestedPages.SettingsReset,(NestedPages=NestedPages||{}).UserPreferencesReset=function(){var t=this,s=jQuery;return t.selectors={resetButton:"data-nestedpages-reset-user-prefs",resetForm:".nestedpages-reset-user-prefs",formComplete:".nestedpages-reset-user-prefs-complete"},t.bindEvents=function(){s(document).on("click","["+t.selectors.resetButton+"]",function(e){e.preventDefault(),t.resetPreferences()})},t.resetPreferences=function(){t.loading(!0),s.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.resetUserPrefs,nonce:NestedPages.jsData.nonce},success:function(e){t.loading(!1),s(t.selectors.resetForm).hide(),s(t.selectors.formComplete).show(),"success"!==e.status&&console.log("There was an error clearing user preferences.")}})},t.loading=function(e){e?s("["+t.selectors.resetButton+"]").attr("disabled",!0):s("["+t.selectors.resetButton+"]").removeAttr("disabled")},t.bindEvents()},new NestedPages.UserPreferencesReset,(NestedPages=NestedPages||{}).AdminCustomizationSettings=function(){var o=this,a=jQuery;return o.selectors={navItemCheckbox:"data-nestedpages-admin-nav-item-checkbox",adminNavList:"data-np-sortable-admin-nav",adminNavRoleSelect:"data-np-nav-menu-user-role-select",adminNavRoleMenu:"data-np-nav-menu-customization",adminNavDetails:"data-np-extra-options",adminNavDetailsToggle:"data-np-extra-options-button",adminSubNavList:"data-np-sortable-admin-subnav",submenuToggle:"data-np-nav-menu-customization-submenu-toggle",separatorRow:"data-np-separator-row",separatorRemoveButton:"data-np-remove-separator-button",separatorAddButton:"data-np-add-separator-button"},o.bindEvents=function(){a(document).ready(function(){o.enableSortableAdminSorting(),o.defaultAdminMenuRoleSelect()}),a(document).on("change","["+o.selectors.navItemCheckbox+"]",function(e){o.toggleNavItemVisibility(a(this))}),a(document).on("change","["+o.selectors.adminNavRoleSelect+"]",function(e){var t=a(this).val();o.toggleNavRoleMenu(t)}),a(document).on("click","["+o.selectors.adminNavDetailsToggle+"]",function(e){e.preventDefault(),o.toggleNavExtraOptions(a(this))}),a(document).on("click","["+o.selectors.submenuToggle+"]",function(e){e.preventDefault(),o.toggleSubmenu(a(this))}),a(document).on("click","["+o.selectors.separatorRemoveButton+"]",function(e){e.preventDefault(),o.removeSeparator(a(this))}),a(document).on("click","["+o.selectors.separatorAddButton+"]",function(e){e.preventDefault(),o.addSeparator()})},o.enableSortableAdminSorting=function(){a("["+o.selectors.adminNavList+"]").sortable({handle:".handle",items:".np-nav-preview",stop:function(e,t){var s=a("["+o.selectors.adminNavList+"] li");a.each(s,function(){a(this).find("[data-np-menu-order]").val(a(this).index())})}}),a("["+o.selectors.adminSubNavList+"]").sortable({handle:".handle",items:".submenu-item",stop:function(e,t){var s=a("["+o.selectors.adminSubNavList+"] li");a.each(s,function(){a(this).find("[data-np-submenu-order]").val(a(this).index())})}})},o.defaultAdminMenuRoleSelect=function(){a("["+o.selectors.adminNavRoleSelect+"]").find("option:eq(0)").prop("selected",!0)},o.toggleNavItemVisibility=function(e){var t=a(e).closest("li.np-nav-preview");!a(e).is(":checked")?a(t).removeClass("disabled"):a(t).addClass("disabled")},o.toggleNavRoleMenu=function(e){a("["+o.selectors.adminNavRoleMenu+"]").hide();var t=a("["+o.selectors.adminNavRoleMenu+'="'+e+'"]');a("["+o.selectors.adminNavRoleSelect+"]").val(e),a(t).show()},o.toggleNavExtraOptions=function(e){a(e).parents(".np-nav-preview").find("["+o.selectors.adminNavDetails+"]");a(e).parents(".np-nav-preview").toggleClass("options-open")},o.toggleSubmenu=function(e){a(e).toggleClass("active"),a(e).parents("li").toggleClass("submenu-open")},o.removeSeparator=function(e){a(e).closest("["+o.selectors.separatorRow+"]").fadeOut(function(){a(this).remove()})},o.addSeparator=function(){var e=a("["+o.selectors.adminNavList+"]:visible"),t=a(e).find("["+o.selectors.separatorRow+"]").length+1,s=a("["+o.selectors.adminNavRoleSelect+"]").val(),n='<li class="np-nav-preview separator" data-np-separator-row>';n+='<div class="menu-item">',n+='<div class="submenu-toggle"></div>',n+='<div class="handle"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class=" np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg></div>',n+='<div class="title"><div class="menu-icon dashicons-before dashicons-admin-post"></div><p>Separator<button class="button button-small details-button" data-np-remove-separator-button="">Remove</button></p></div>\x3c!-- .title --\x3e',n+="</div>\x3c!-- .menu-item --\x3e",n+='<input type="hidden" name="nestedpages_admin[nav_menu_options]['+(s=s.replace("menu_role_",""))+"][custom_sep"+t+']" value="true">',n+='<input type="hidden" name="nestedpages_admin[nav_menu_options]['+s+"][custom_sep"+t+'][order]" value="" data-np-menu-order>',n+="</li>",a(e).prepend(n),o.resetNavOrder(a(e))},o.resetNavOrder=function(e){var t=a(e).find("[data-np-menu-order]");a.each(t,function(e,t){a(this).val(e)}),o.enableSortableAdminSorting()},o.bindEvents()},new NestedPages.AdminCustomizationSettings,(NestedPages=NestedPages||{}).Settings=function(){var a=this,i=jQuery;return a.selectors={postTypeToggle:"[data-toggle-nestedpages-pt-settings]",postTypeCheckbox:"[data-nestedpages-settings-row-checkbox]",customFieldsCheckbox:"[data-toggle-nestedpages-cf-settings]",standardFieldsCheckbox:"[data-toggle-nestedpages-sf-settings]",taxonomiesFieldCheckbox:"[data-hide-taxonomies]",thumbnailsCheckbox:"[data-enable-thumbnails]",menuEnabledOption:"[data-menu-enabled-option]",disableMenuCheckbox:"[data-disable-menu-checkbox]",disableAutoCheckbox:"[data-menu-disable-auto-checkbox]",assignPostTypeCheckbox:"[data-nestedpages-assign-post-type]",assignPostTypeId:"[data-nested-pages-assign-post-type-id]",assignPostTypeTitle:"[data-nested-pages-assign-post-type-title]",assignPostTypeOption:"[data-assignment-page-id]",assignPostTypeRemove:"[data-nestedpages-page-pt-assignment-remove]",assignPostTypeSelection:"[data-nestedpages-page-pt-assignment-selection]",sortOptionCheckbox:"[data-nestedpages-sort-option-checkbox]",defaultSortOptions:"[data-nestedpages-sort-option-default]"},a.bindEvents=function(){i(document).ready(function(){a.toggleAllSettingsButtons(),a.toogleAllFieldSettings(".custom-fields"),a.toogleAllFieldSettings(".standard-fields"),a.toggleMenuCheckboxes(),a.toggleHideCheckbox(),a.toggleAssignPostType(),a.toggleAllDefaultSortOptions()}),i(document).on("click",a.selectors.postTypeToggle,function(e){e.preventDefault(),a.toggleRow(i(this))}),i(document).on("change",a.selectors.postTypeCheckbox,function(){a.toggleSettingsButton(i(this))}),i(document).on("change",a.selectors.customFieldsCheckbox,function(){a.toogleFieldSettings(i(this),".custom-fields")}),i(document).on("change",a.selectors.standardFieldsCheckbox,function(){a.toogleFieldSettings(i(this),".standard-fields")}),i(document).on("change",a.selectors.taxonomiesFieldCheckbox,function(){a.toggleTaxonomyCheckboxes(i(this))}),i(document).on("change",a.selectors.thumbnailsCheckbox,function(){a.toggleThumbnailSettings(i(this))}),i(document).on("change",a.selectors.disableMenuCheckbox,function(){a.toggleMenuCheckboxes()}),i(document).on("change",a.selectors.disableAutoCheckbox,function(){a.toggleHideCheckbox()}),i(document).on("change",a.selectors.assignPostTypeCheckbox,function(){a.toggleAssignPostType()}),i(document).on("click",a.selectors.assignPostTypeOption,function(e){e.preventDefault(),a.chooseAssignPostType(i(this))}),i(document).on("click",a.selectors.assignPostTypeRemove,function(e){e.preventDefault(),a.removeAssignPostType(i(this))}),i(document).on("change",a.selectors.sortOptionCheckbox,function(){a.toggleDefaultSortOptions(i(this))})},a.toggleRow=function(e){i(e).parent(".head").siblings(".body").toggle(),i(e).parents(".row-container").toggleClass("active")},a.toggleSettingsButton=function(e){var t=i(e).parents(".head").find(a.selectors.postTypeToggle);if(i(e).is(":checked"))return i(t).show(),void i(t).parents(".head").siblings(".body").find('input[type="hidden"]').attr("disabled",!1);i(t).hide(),i(t).parents(".head").siblings(".body").hide(),i(t).parents(".row-container").removeClass("active"),i(t).parents(".head").siblings(".body").find('input[type="checkbox"]').attr("checked",!1),i(t).parents(".head").siblings(".body").find('input[type="hidden"]').attr("disabled",!0),i(t).parents(".head").siblings(".body").find("select").val(!1)},a.toggleAllSettingsButtons=function(){var e=i(a.selectors.postTypeCheckbox);i.each(e,function(){a.toggleSettingsButton(i(this))})},a.toogleFieldSettings=function(e,t){var s=i(e).parents(".body").find(t);i(e).is(":checked")?i(s).show():i(s).hide()},a.toogleAllFieldSettings=function(e){var t=i(a.selectors.customFieldsCheckbox);if(".standard-fields"==e)t=i(a.selectors.standardFieldsCheckbox);i.each(t,function(){a.toogleFieldSettings(i(this),e)})},a.toggleTaxonomyCheckboxes=function(e){var t=i(e).parents("ul").find(i("*[data-taxonomy-single]"));i(e).is(":checked")?i(t).hide():i(t).show()},a.toggleThumbnailSettings=function(e){var t=i(e).parents(".field").find(i("*[data-thumbnail-options]"));i(e).is(":checked")?i(t).show():i(t).hide()},a.toggleMenuCheckboxes=function(){var e=i(a.selectors.disableMenuCheckbox),t=i(a.selectors.menuEnabledOption);i(e).is(":checked")?i(t).hide():i(t).show()},a.toggleHideCheckbox=function(){var e=i(a.selectors.disableAutoCheckbox),t=i("[data-menu-hide-checkbox]");i(e).is(":checked")?i(t).hide():i(t).show()},a.toggleAssignPostType=function(){var e=i(a.selectors.assignPostTypeCheckbox);i.each(e,function(){var e=i(this),t=i(this).parents(".field").find(".nestedpages-assignment-display");i(e).is(":checked")?i(t).show():i(t).hide()})},a.chooseAssignPostType=function(e){var t=i(e).attr("data-assignment-page-id"),s=i(e).attr("data-assignment-page-title"),n=i(e).parents(".field"),o=nestedpages.currently_assigned_to+" "+s+' <a href="#" data-nestedpages-page-pt-assignment-remove>('+nestedpages.remove+")</a>";i(n).find(a.selectors.assignPostTypeId).val(t),i(n).find(a.selectors.assignPostTypeTitle).val(s),i(n).find(a.selectors.assignPostTypeSelection).html(o).show(),i(n).find("[data-nestedpages-post-search-form]").hide()},a.removeAssignPostType=function(e){var t=i(e).parents(".field");i(t).find(a.selectors.assignPostTypeSelection).hide(),i(t).find("[data-nestedpages-post-search-form]").show(),i(t).find(a.selectors.assignPostTypeId).val(""),i(t).find(a.selectors.assignPostTypeTitle).val("")},a.toggleAllDefaultSortOptions=function(){var e=i(a.selectors.sortOptionCheckbox);i.each(e,function(){a.toggleDefaultSortOptions(i(this))})},a.toggleDefaultSortOptions=function(e){var t=!!i(e).is(":checked"),s=i(e).parent("label").next(a.selectors.defaultSortOptions);i(s).length<1||(t?i(s).show():i(s).hide())},a.bindEvents()},new NestedPages.Settings;
1
+ var NestedPages=NestedPages||{};NestedPages.SettingsReset=function(){var t=this,s=jQuery;return t.selectors={resetButton:"data-nestedpages-reset-settings",resetForm:".nestedpages-reset-settings",formComplete:".nestedpages-reset-settings-complete",resetAdminMenu:"data-nestedpages-reset-admin-menu"},t.bindEvents=function(){s(document).on("click","["+t.selectors.resetButton+"]",function(e){e.preventDefault(),t.resetSettings()}),s(document).on("click","["+t.selectors.resetAdminMenu+"]",function(e){e.preventDefault(),t.resetAdminMenu()})},t.resetSettings=function(){t.loading(!0),s.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.resetSettings,nonce:NestedPages.jsData.nonce},success:function(e){t.loading(!1),s(t.selectors.resetForm).hide(),s(t.selectors.formComplete).show(),"success"!==e.status&&console.log("There was an error saving toggled pages.")}})},t.resetAdminMenu=function(){t.loading(!0),s.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.resetAdminMenuSettings,nonce:NestedPages.jsData.nonce},success:function(e){t.loading(!1),"success"==e.status&&location.reload(),"success"!==e.status&&console.log("There was an error saving toggled pages.")}})},t.loading=function(e){if(e)return s("["+t.selectors.resetButton+"]").attr("disabled",!0),void s("["+t.selectors.resetAdminMenu+"]").attr("disabled",!0);s("["+t.selectors.resetButton+"]").removeAttr("disabled"),s("["+t.selectors.resetAdminMenu+"]").removeAttr("disabled")},t.bindEvents()},new NestedPages.SettingsReset,(NestedPages=NestedPages||{}).UserPreferencesReset=function(){var t=this,s=jQuery;return t.selectors={resetButton:"data-nestedpages-reset-user-prefs",resetForm:".nestedpages-reset-user-prefs",formComplete:".nestedpages-reset-user-prefs-complete"},t.bindEvents=function(){s(document).on("click","["+t.selectors.resetButton+"]",function(e){e.preventDefault(),t.resetPreferences()})},t.resetPreferences=function(){t.loading(!0),s.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.resetUserPrefs,nonce:NestedPages.jsData.nonce},success:function(e){t.loading(!1),s(t.selectors.resetForm).hide(),s(t.selectors.formComplete).show(),"success"!==e.status&&console.log("There was an error clearing user preferences.")}})},t.loading=function(e){e?s("["+t.selectors.resetButton+"]").attr("disabled",!0):s("["+t.selectors.resetButton+"]").removeAttr("disabled")},t.bindEvents()},new NestedPages.UserPreferencesReset,(NestedPages=NestedPages||{}).AdminCustomizationSettings=function(){var o=this,a=jQuery;return o.selectors={navItemCheckbox:"data-nestedpages-admin-nav-item-checkbox",adminNavList:"data-np-sortable-admin-nav",adminNavRoleSelect:"data-np-nav-menu-user-role-select",adminNavRoleMenu:"data-np-nav-menu-customization",adminNavDetails:"data-np-extra-options",adminNavDetailsToggle:"data-np-extra-options-button",adminSubNavList:"data-np-sortable-admin-subnav",submenuToggle:"data-np-nav-menu-customization-submenu-toggle",separatorRow:"data-np-separator-row",separatorRemoveButton:"data-np-remove-separator-button",separatorAddButton:"data-np-add-separator-button"},o.bindEvents=function(){a(document).ready(function(){o.enableSortableAdminSorting(),o.defaultAdminMenuRoleSelect()}),a(document).on("change","["+o.selectors.navItemCheckbox+"]",function(e){o.toggleNavItemVisibility(a(this))}),a(document).on("change","["+o.selectors.adminNavRoleSelect+"]",function(e){var t=a(this).val();o.toggleNavRoleMenu(t)}),a(document).on("click","["+o.selectors.adminNavDetailsToggle+"]",function(e){e.preventDefault(),o.toggleNavExtraOptions(a(this))}),a(document).on("click","["+o.selectors.submenuToggle+"]",function(e){e.preventDefault(),o.toggleSubmenu(a(this))}),a(document).on("click","["+o.selectors.separatorRemoveButton+"]",function(e){e.preventDefault(),o.removeSeparator(a(this))}),a(document).on("click","["+o.selectors.separatorAddButton+"]",function(e){e.preventDefault(),o.addSeparator()})},o.enableSortableAdminSorting=function(){a("["+o.selectors.adminNavList+"]").sortable({handle:".handle",items:".np-nav-preview",stop:function(e,t){var s=a("["+o.selectors.adminNavList+"] li");a.each(s,function(){a(this).find("[data-np-menu-order]").val(a(this).index())})}}),a("["+o.selectors.adminSubNavList+"]").sortable({handle:".handle",items:".submenu-item",stop:function(e,t){var s=a("["+o.selectors.adminSubNavList+"] li");a.each(s,function(){a(this).find("[data-np-submenu-order]").val(a(this).index())})}})},o.defaultAdminMenuRoleSelect=function(){a("["+o.selectors.adminNavRoleSelect+"]").find("option:eq(0)").prop("selected",!0)},o.toggleNavItemVisibility=function(e){var t=a(e).closest("li.np-nav-preview");!a(e).is(":checked")?a(t).removeClass("disabled"):a(t).addClass("disabled")},o.toggleNavRoleMenu=function(e){a("["+o.selectors.adminNavRoleMenu+"]").hide();var t=a("["+o.selectors.adminNavRoleMenu+'="'+e+'"]');a("["+o.selectors.adminNavRoleSelect+"]").val(e),a(t).show()},o.toggleNavExtraOptions=function(e){a(e).parents(".np-nav-preview").find("["+o.selectors.adminNavDetails+"]");a(e).parents(".np-nav-preview").toggleClass("options-open")},o.toggleSubmenu=function(e){a(e).toggleClass("active"),a(e).parents("li").toggleClass("submenu-open")},o.removeSeparator=function(e){a(e).closest("["+o.selectors.separatorRow+"]").fadeOut(function(){a(this).remove()})},o.addSeparator=function(){var e=a("["+o.selectors.adminNavList+"]:visible"),t=a(e).find("["+o.selectors.separatorRow+"]").length+1,s=a("["+o.selectors.adminNavRoleSelect+"]").val(),n='<li class="np-nav-preview separator" data-np-separator-row>';n+='<div class="menu-item">',n+='<div class="submenu-toggle"></div>',n+='<div class="handle"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" class=" np-icon-menu"><path d="M0 0h24v24H0z" fill="none" /><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" class="bars" /></svg></div>',n+='<div class="title"><div class="menu-icon dashicons-before dashicons-admin-post"></div><p>Separator<button class="button button-small details-button" data-np-remove-separator-button="">Remove</button></p></div>\x3c!-- .title --\x3e',n+="</div>\x3c!-- .menu-item --\x3e",n+='<input type="hidden" name="nestedpages_admin[nav_menu_options]['+(s=s.replace("menu_role_",""))+"][custom_sep"+t+']" value="true">',n+='<input type="hidden" name="nestedpages_admin[nav_menu_options]['+s+"][custom_sep"+t+'][order]" value="" data-np-menu-order>',n+="</li>",a(e).prepend(n),o.resetNavOrder(a(e))},o.resetNavOrder=function(e){e=a(e).find("[data-np-menu-order]");a.each(e,function(e,t){a(this).val(e)}),o.enableSortableAdminSorting()},o.bindEvents()},new NestedPages.AdminCustomizationSettings,(NestedPages=NestedPages||{}).Settings=function(){var o=this,a=jQuery;return o.selectors={postTypeToggle:"[data-toggle-nestedpages-pt-settings]",postTypeCheckbox:"[data-nestedpages-settings-row-checkbox]",customFieldsCheckbox:"[data-toggle-nestedpages-cf-settings]",standardFieldsCheckbox:"[data-toggle-nestedpages-sf-settings]",taxonomiesFieldCheckbox:"[data-hide-taxonomies]",thumbnailsCheckbox:"[data-enable-thumbnails]",menuEnabledOption:"[data-menu-enabled-option]",disableMenuCheckbox:"[data-disable-menu-checkbox]",disableAutoCheckbox:"[data-menu-disable-auto-checkbox]",assignPostTypeCheckbox:"[data-nestedpages-assign-post-type]",assignPostTypeId:"[data-nested-pages-assign-post-type-id]",assignPostTypeTitle:"[data-nested-pages-assign-post-type-title]",assignPostTypeOption:"[data-assignment-page-id]",assignPostTypeRemove:"[data-nestedpages-page-pt-assignment-remove]",assignPostTypeSelection:"[data-nestedpages-page-pt-assignment-selection]",sortOptionCheckbox:"[data-nestedpages-sort-option-checkbox]",defaultSortOptions:"[data-nestedpages-sort-option-default]"},o.bindEvents=function(){a(document).ready(function(){o.toggleAllSettingsButtons(),o.toogleAllFieldSettings(".custom-fields"),o.toogleAllFieldSettings(".standard-fields"),o.toggleMenuCheckboxes(),o.toggleHideCheckbox(),o.toggleAssignPostType(),o.toggleAllDefaultSortOptions()}),a(document).on("click",o.selectors.postTypeToggle,function(e){e.preventDefault(),o.toggleRow(a(this))}),a(document).on("change",o.selectors.postTypeCheckbox,function(){o.toggleSettingsButton(a(this))}),a(document).on("change",o.selectors.customFieldsCheckbox,function(){o.toogleFieldSettings(a(this),".custom-fields")}),a(document).on("change",o.selectors.standardFieldsCheckbox,function(){o.toogleFieldSettings(a(this),".standard-fields")}),a(document).on("change",o.selectors.taxonomiesFieldCheckbox,function(){o.toggleTaxonomyCheckboxes(a(this))}),a(document).on("change",o.selectors.thumbnailsCheckbox,function(){o.toggleThumbnailSettings(a(this))}),a(document).on("change",o.selectors.disableMenuCheckbox,function(){o.toggleMenuCheckboxes()}),a(document).on("change",o.selectors.disableAutoCheckbox,function(){o.toggleHideCheckbox()}),a(document).on("change",o.selectors.assignPostTypeCheckbox,function(){o.toggleAssignPostType()}),a(document).on("click",o.selectors.assignPostTypeOption,function(e){e.preventDefault(),o.chooseAssignPostType(a(this))}),a(document).on("click",o.selectors.assignPostTypeRemove,function(e){e.preventDefault(),o.removeAssignPostType(a(this))}),a(document).on("change",o.selectors.sortOptionCheckbox,function(){o.toggleDefaultSortOptions(a(this))})},o.toggleRow=function(e){a(e).parent(".head").siblings(".body").toggle(),a(e).parents(".row-container").toggleClass("active")},o.toggleSettingsButton=function(e){var t=a(e).parents(".head").find(o.selectors.postTypeToggle);if(a(e).is(":checked"))return a(t).show(),void a(t).parents(".head").siblings(".body").find('input[type="hidden"]').attr("disabled",!1);a(t).hide(),a(t).parents(".head").siblings(".body").hide(),a(t).parents(".row-container").removeClass("active"),a(t).parents(".head").siblings(".body").find('input[type="checkbox"]').attr("checked",!1),a(t).parents(".head").siblings(".body").find('input[type="hidden"]').attr("disabled",!0),a(t).parents(".head").siblings(".body").find("select").val(!1)},o.toggleAllSettingsButtons=function(){var e=a(o.selectors.postTypeCheckbox);a.each(e,function(){o.toggleSettingsButton(a(this))})},o.toogleFieldSettings=function(e,t){t=a(e).parents(".body").find(t);a(e).is(":checked")?a(t).show():a(t).hide()},o.toogleAllFieldSettings=function(e){var t=a(o.selectors.customFieldsCheckbox);".standard-fields"==e&&(t=a(o.selectors.standardFieldsCheckbox)),a.each(t,function(){o.toogleFieldSettings(a(this),e)})},o.toggleTaxonomyCheckboxes=function(e){var t=a(e).parents("ul").find(a("*[data-taxonomy-single]"));a(e).is(":checked")?a(t).hide():a(t).show()},o.toggleThumbnailSettings=function(e){var t=a(e).parents(".field").find(a("*[data-thumbnail-options]"));a(e).is(":checked")?a(t).show():a(t).hide()},o.toggleMenuCheckboxes=function(){var e=a(o.selectors.disableMenuCheckbox),t=a(o.selectors.menuEnabledOption);a(e).is(":checked")?a(t).hide():a(t).show()},o.toggleHideCheckbox=function(){var e=a(o.selectors.disableAutoCheckbox),t=a("[data-menu-hide-checkbox]");a(e).is(":checked")?a(t).hide():a(t).show()},o.toggleAssignPostType=function(){var e=a(o.selectors.assignPostTypeCheckbox);a.each(e,function(){var e=a(this),t=a(this).parents(".field").find(".nestedpages-assignment-display");a(e).is(":checked")?a(t).show():a(t).hide()})},o.chooseAssignPostType=function(e){var t=a(e).attr("data-assignment-page-id"),s=a(e).attr("data-assignment-page-title"),n=a(e).parents(".field"),e=nestedpages.currently_assigned_to+" "+s+' <a href="#" data-nestedpages-page-pt-assignment-remove>('+nestedpages.remove+")</a>";a(n).find(o.selectors.assignPostTypeId).val(t),a(n).find(o.selectors.assignPostTypeTitle).val(s),a(n).find(o.selectors.assignPostTypeSelection).html(e).show(),a(n).find("[data-nestedpages-post-search-form]").hide()},o.removeAssignPostType=function(e){e=a(e).parents(".field");a(e).find(o.selectors.assignPostTypeSelection).hide(),a(e).find("[data-nestedpages-post-search-form]").show(),a(e).find(o.selectors.assignPostTypeId).val(""),a(e).find(o.selectors.assignPostTypeTitle).val("")},o.toggleAllDefaultSortOptions=function(){var e=a(o.selectors.sortOptionCheckbox);a.each(e,function(){o.toggleDefaultSortOptions(a(this))})},o.toggleDefaultSortOptions=function(e){var t=!!a(e).is(":checked"),e=a(e).parent("label").next(o.selectors.defaultSortOptions);a(e).length<1||(t?a(e).show():a(e).hide())},o.bindEvents()},new NestedPages.Settings;
nestedpages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Nested Pages
4
  Plugin URI: http://nestedpages.com
5
  Description: Provides an intuitive drag and drop interface for managing pages in the Wordpress admin, while enhancing quick edit. Includes an auto-generated menu to match the nested interface, support for all post types and more.
6
- Version: 3.1.15
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: wp-nested-pages
3
  Plugin Name: Nested Pages
4
  Plugin URI: http://nestedpages.com
5
  Description: Provides an intuitive drag and drop interface for managing pages in the Wordpress admin, while enhancing quick edit. Includes an auto-generated menu to match the nested interface, support for all post types and more.
6
+ Version: 3.1.16
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: wp-nested-pages
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: pages, admin, nested, tree view, page tree, sort, quick edit, structure
5
  Requires at least: 3.8
6
  Tested up to: 5.7
7
  Requires PHP: 5.4
8
- Stable tag: 3.1.14
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -105,7 +105,10 @@ No. The menu synchronization currently only works within the pages post type.
105
 
106
  == Changelog ==
107
 
108
- = 3.1.5 =
 
 
 
109
  * Action added for outputting markup along with the add new/add multiple buttons (nestedpages_top_buttons)
110
  * PHP 8 deprecation errors corrected
111
  * Tested with WordPress v5.8
5
  Requires at least: 3.8
6
  Tested up to: 5.7
7
  Requires PHP: 5.4
8
+ Stable tag: 3.1.15
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
105
 
106
  == Changelog ==
107
 
108
+ = 3.1.16 =
109
+ * Includes security updates. Thanks to Ram Gall at Wordfence for reporting
110
+
111
+ = 3.1.15 =
112
  * Action added for outputting markup along with the add new/add multiple buttons (nestedpages_top_buttons)
113
  * PHP 8 deprecation errors corrected
114
  * Tested with WordPress v5.8