Nested Pages - Version 3.0.1

Version Description

= 1.3.12 = Resolves issue with custom user roles/permissions and deleting posts. Important patch for sites using custom user roles. Thanks to Yuksel Beyti for finding/patching.

= 1.3.10 = Resolves deprecated function issue with SEO by Yoast update v1.7.3. Critical for sites running both Nested Pages and WordPress SEO by Yoast

= 1.3.8 = Critical bug fix in saving menus. Existing menus outside of the generated menu now unaltered.

= 1.3.4 = Minor bug fixes and expanded menu functionality.

= 1.3.3 = Russian translation added along with minor bug fixes.

= 1.3.2 = Minor bug fixes in menu.

= 1.3.1 = Date fields in Quick Edit windows are now replaced with a date picker and formatted time. If the formatting conflicts with your specific locale, disable the datepicker under Settings > Nested Pages > General.

= 1.3.0 = All post types are now supported. Also includes minor bug fixes and UI improvements.

= 1.2.1 = Bug fix when using custom roles.

= 1.2 = PHP 5.3.2 now required Nested Pages will not install on older versions of PHP. If you are running less than 5.3.2, continue to use Nested Pages version 1.1.9.

= 1.1.9 = Italian translation included along with minor bug fixes.

= 1.1.8 = New Child Pages Interface, various UI enhancements

= 1.1.6 = Minor UI enhancements and bug fixes.

= 1.1.5 = Various bug fixes in the menu system and localization.

= 1.1.4 = Added additional quick edit functionality along with UI enhancements.

= 1.1.3 = Added option to rename the generated nav menu.

= 1.1.2 = Includes fix for pages view that was preventing draft and private pages from being loaded.

= 1.1 = Several new features have been added in version 1.1, including: saved toggle states, additional menu options, trash functionality, ability to add "link" menu items, and more.

Download this release

Release Info

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

Code changes from version 2.0.4 to 3.0.1

Files changed (114) hide show
  1. app/Activation/Dependencies.php +16 -20
  2. app/Activation/Updates/CustomFieldsToHidden.php +4 -4
  3. app/Activation/Updates/Updates.php +2 -2
  4. app/Bootstrap.php +4 -4
  5. app/Config/Settings.php +6 -6
  6. app/Config/SettingsRepository.php +9 -9
  7. app/Entities/AdminMenu/AdminMenu.php +2 -2
  8. app/Entities/AdminMenu/AdminSubmenu.php +5 -5
  9. app/Entities/AdminMenu/AdminSubmenuExpander.php +1 -0
  10. app/Entities/AdminMenu/EnabledMenus.php +2 -2
  11. app/Entities/DefaultList/NestedViewLink.php +2 -2
  12. app/Entities/Listing/Listing.php +54 -6
  13. app/Entities/Listing/ListingActions.php +1 -1
  14. app/Entities/Listing/ListingQuery.php +77 -42
  15. app/Entities/Listing/ListingRepository.php +30 -7
  16. app/Entities/NavMenu/NavMenuActions.php +2 -2
  17. app/Entities/NavMenu/NavMenuFrontEnd.php +2 -1
  18. app/Entities/NavMenu/NavMenuRepository.php +6 -2
  19. app/Entities/NavMenu/NavMenuSyncListing.php +5 -5
  20. app/Entities/NavMenu/NavMenuSyncMenu.php +6 -6
  21. app/Entities/NavMenu/NavMenuTrashActions.php +3 -3
  22. app/Entities/PluginIntegration/AdvancedCustomFields.php +5 -5
  23. app/Entities/PluginIntegration/EditorialAccessManager.php +1 -1
  24. app/Entities/PluginIntegration/WPML.php +6 -6
  25. app/Entities/Post/PostCloner.php +5 -3
  26. app/Entities/Post/PostDataFactory.php +1 -0
  27. app/Entities/Post/PostFactory.php +47 -3
  28. app/Entities/Post/PostRepository.php +9 -9
  29. app/Entities/Post/PostTrashActions.php +4 -4
  30. app/Entities/Post/PostUpdateRepository.php +14 -10
  31. app/Entities/PostType/PostTypeRepository.php +40 -15
  32. app/Entities/PostType/RegisterPostTypes.php +7 -7
  33. app/Entities/User/UserRepository.php +9 -9
  34. app/Form/Events.php +3 -2
  35. app/Form/Listeners/BaseHandler.php +6 -6
  36. app/Form/Listeners/ClonePost.php +3 -3
  37. app/Form/Listeners/EmptyTrash.php +2 -2
  38. app/Form/Listeners/GetTaxonomies.php +1 -1
  39. app/Form/Listeners/ListingSort.php +2 -2
  40. app/Form/Listeners/ManualMenuSync.php +1 -1
  41. app/Form/Listeners/MenuSearch.php +5 -5
  42. app/Form/Listeners/NestToggle.php +1 -1
  43. app/Form/Listeners/NewBeforeAfter.php +64 -0
  44. app/Form/Listeners/NewChild.php +2 -2
  45. app/Form/Listeners/NewMenuItem.php +2 -2
  46. app/Form/Listeners/PostSearch.php +3 -3
  47. app/Form/Listeners/QuickEdit.php +3 -3
  48. app/Form/Listeners/QuickEditLink.php +2 -2
  49. app/Form/Listeners/ResetSettings.php +1 -1
  50. app/Form/Listeners/Sort.php +2 -2
  51. app/Form/Listeners/SyncMenu.php +2 -2
  52. app/Form/Listeners/WpmlTranslations.php +4 -4
  53. app/Form/Validation/Validation.php +25 -11
  54. app/Helpers.php +8 -0
  55. app/NestedPages.php +1 -1
  56. app/Redirects.php +6 -6
  57. app/RedirectsFrontEnd.php +6 -6
  58. app/Views/forms/bulk-add.php +3 -6
  59. app/Views/forms/clone-form.php +56 -52
  60. app/Views/forms/delete-confirmation-modal.php +7 -10
  61. app/Views/forms/empty-trash-modal.php +8 -11
  62. app/Views/forms/link-form.php +107 -99
  63. app/Views/forms/more-options-modal.php +0 -14
  64. app/Views/forms/new-child.php +10 -6
  65. app/Views/forms/quickedit-link.php +3 -1
  66. app/Views/forms/quickedit-post.php +6 -4
  67. app/Views/listing.php +24 -18
  68. app/Views/partials/bulk-edit.php +39 -23
  69. app/Views/partials/list-header.php +1 -1
  70. app/Views/partials/row-link.php +16 -20
  71. app/Views/partials/row.php +114 -48
  72. app/Views/partials/tool-list.php +29 -19
  73. app/Views/partials/wpml-translations.php +2 -2
  74. app/Views/settings/settings-posttypes.php +48 -10
  75. assets/css/fonts/nestedpages.eot +0 -0
  76. assets/css/fonts/nestedpages.svg +0 -30
  77. assets/css/fonts/nestedpages.ttf +0 -0
  78. assets/css/fonts/nestedpages.woff +0 -0
  79. assets/css/fonts/nestedpages.woff2 +0 -0
  80. assets/css/nestedpages.css +1 -1
  81. assets/images/loading-white.gif +0 -0
  82. assets/images/loading.gif +0 -0
  83. assets/images/spinner-2x.gif +0 -0
  84. assets/images/spinner.gif +0 -0
  85. assets/images/spinner.svg +4 -0
  86. assets/js/lib/bootstrap.min.js +0 -7
  87. assets/js/lib/bs-modal.js +0 -281
  88. assets/js/lib/nestedpages-factory.js +9 -6
  89. assets/js/lib/nestedpages-responsive.js +0 -55
  90. assets/js/lib/nestedpages.bulk-actions.js +14 -0
  91. assets/js/lib/nestedpages.clone.js +6 -14
  92. assets/js/lib/nestedpages.confirm-delete.js +2 -2
  93. assets/js/lib/nestedpages.dropdowns.js +89 -0
  94. assets/js/lib/nestedpages.formatter.js +6 -5
  95. assets/js/lib/nestedpages.menu-links.js +8 -5
  96. assets/js/lib/nestedpages.menu-toggle.js +3 -7
  97. assets/js/lib/nestedpages.modals.js +113 -0
  98. assets/js/lib/nestedpages.move-post.js +93 -0
  99. assets/js/lib/nestedpages.nesting.js +85 -20
  100. assets/js/lib/nestedpages.new-link.js +0 -157
  101. assets/js/lib/nestedpages.new-post.js +84 -31
  102. assets/js/lib/nestedpages.quickedit-link.js +4 -13
  103. assets/js/lib/nestedpages.quickedit-post.js +5 -3
  104. assets/js/lib/nestedpages.settings.js +31 -3
  105. assets/js/lib/nestedpages.sync-menu-setting.js +3 -0
  106. assets/js/lib/nestedpages.trash.js +3 -14
  107. assets/js/lib/nestedpages.wpml.js +4 -2
  108. assets/js/nestedpages.js +530 -177
  109. assets/js/nestedpages.min.js +1 -1
  110. assets/js/nestedpages.settings.min.js +1 -1
  111. nestedpages.php +3 -3
  112. readme.txt +20 -2
  113. vendor/composer/ClassLoader.php +1 -1
  114. vendor/composer/autoload_real.php +2 -2
app/Activation/Dependencies.php CHANGED
@@ -42,9 +42,9 @@ class Dependencies
42
  $this->integrations = new IntegrationFactory;
43
  $this->settings = new SettingsRepository;
44
  $this->setPluginVersion();
45
- add_action( 'admin_enqueue_scripts', array($this, 'styles') );
46
- add_action( 'admin_enqueue_scripts', array($this, 'scripts') );
47
- add_action( 'admin_enqueue_scripts', array($this, 'settingsScripts') );
48
  $this->plugin_dir = Helpers::plugin_url();
49
  }
50
 
@@ -65,7 +65,7 @@ class Dependencies
65
  wp_enqueue_style(
66
  'nestedpages',
67
  $this->plugin_dir . '/assets/css/nestedpages.css',
68
- array(),
69
  $this->plugin_version
70
  );
71
  if ( $this->integrations->plugins->acf->installed ) wp_enqueue_style('acf-input');
@@ -86,40 +86,34 @@ class Dependencies
86
  wp_enqueue_script('jquery-ui-core');
87
  wp_enqueue_script('jquery-ui-sortable');
88
  wp_enqueue_script('jquery-ui-datepicker');
89
- wp_enqueue_script(
90
- 'bootstrap',
91
- $this->plugin_dir . '/assets/js/lib/bootstrap.min.js',
92
- array('jquery'),
93
- '3.3.2'
94
- );
95
  wp_enqueue_script(
96
  'ui-touch-punch',
97
  $this->plugin_dir . '/assets/js/lib/jquery.ui.touch-punch.min.js',
98
- array('jquery', 'jquery-ui-sortable'),
99
  $this->plugin_version
100
  );
101
  wp_enqueue_script(
102
  'nested-sortable',
103
  $this->plugin_dir . '/assets/js/lib/jquery.mjs.nestedSortable.js',
104
- array('jquery', 'jquery-ui-sortable'),
105
  $this->plugin_version
106
  );
107
  if ( $np_env == 'dev' ){
108
  wp_enqueue_script(
109
  'nestedpages',
110
  $this->plugin_dir . '/assets/js/nestedpages.js',
111
- array('jquery'),
112
  $this->plugin_version
113
  );
114
  } else {
115
  wp_enqueue_script(
116
  'nestedpages',
117
  $this->plugin_dir . '/assets/js/nestedpages.min.js',
118
- array('jquery'),
119
  $this->plugin_version
120
  );
121
  }
122
- $localized_data = array(
123
  'np_nonce' => wp_create_nonce( 'nestedpages-nonce' ),
124
  'expand_text' => __('Expand All', 'wp-nested-pages'),
125
  'collapse_text' => __('Collapse All', 'wp-nested-pages'),
@@ -138,11 +132,11 @@ class Dependencies
138
  'add_page' => __('Add Page', 'wp-nested-pages'),
139
  'add_pages' => __('Add Pages', 'wp-nested-pages'),
140
  'add_multiple' => __('Add Multiple', 'wp-nested-pages'),
141
- 'trash_confirm' => __('Are you sure you would like to empty the trash? This action is not reversable.', 'wp-nested-pages'),
142
  'hidden' => __('Hidden', 'wp-nested-pages'),
143
  'bulk_actions' => __('Bulk Actions', 'wp-nested-pages'),
144
  'link_delete_confirmation' => __('Your selection includes link items, which cannot be recovered after deleting. Would you like to continue? (Other items are moved to the trash)', 'wp-nested-pages'),
145
- 'link_delete_confirmation_singular' => __('Are you sure you would like to delete this item? This action is not reversable.', 'wp-nested-pages'),
146
  'delete' => __('Delete', 'wp-nested-pages'),
147
  'trash_delete_links' => __('Trash Posts and Delete Links', 'wp-nested-pages'),
148
  'manual_menu_sync' => $this->settings->autoMenuDisabled(),
@@ -152,8 +146,10 @@ class Dependencies
152
  'settings_page' => $settings_page,
153
  'wpml' => ( $this->integrations->plugins->wpml->installed ) ? true : false,
154
  'add_translation' => __('Add Translation', 'wp-nested-pages'),
155
- 'edit' => __('Edit', 'wp-nested-pages')
156
- );
 
 
157
  $syncmenu = ( get_option('nestedpages_menusync') == 'sync' ) ? true : false;
158
  $localized_data['syncmenu'] = $syncmenu;
159
  $localized_data['post_types'] = $this->post_type_repo->getPostTypesObject();
@@ -179,7 +175,7 @@ class Dependencies
179
  wp_enqueue_script(
180
  'nestedpages-settings',
181
  $this->plugin_dir . '/assets/js/nestedpages.settings.min.js',
182
- array('jquery'),
183
  $this->plugin_version
184
  );
185
  endif;
42
  $this->integrations = new IntegrationFactory;
43
  $this->settings = new SettingsRepository;
44
  $this->setPluginVersion();
45
+ add_action( 'admin_enqueue_scripts', [$this, 'styles']);
46
+ add_action( 'admin_enqueue_scripts', [$this, 'scripts']);
47
+ add_action( 'admin_enqueue_scripts', [$this, 'settingsScripts']);
48
  $this->plugin_dir = Helpers::plugin_url();
49
  }
50
 
65
  wp_enqueue_style(
66
  'nestedpages',
67
  $this->plugin_dir . '/assets/css/nestedpages.css',
68
+ [],
69
  $this->plugin_version
70
  );
71
  if ( $this->integrations->plugins->acf->installed ) wp_enqueue_style('acf-input');
86
  wp_enqueue_script('jquery-ui-core');
87
  wp_enqueue_script('jquery-ui-sortable');
88
  wp_enqueue_script('jquery-ui-datepicker');
 
 
 
 
 
 
89
  wp_enqueue_script(
90
  'ui-touch-punch',
91
  $this->plugin_dir . '/assets/js/lib/jquery.ui.touch-punch.min.js',
92
+ ['jquery', 'jquery-ui-sortable'],
93
  $this->plugin_version
94
  );
95
  wp_enqueue_script(
96
  'nested-sortable',
97
  $this->plugin_dir . '/assets/js/lib/jquery.mjs.nestedSortable.js',
98
+ ['jquery', 'jquery-ui-sortable'],
99
  $this->plugin_version
100
  );
101
  if ( $np_env == 'dev' ){
102
  wp_enqueue_script(
103
  'nestedpages',
104
  $this->plugin_dir . '/assets/js/nestedpages.js',
105
+ ['jquery'],
106
  $this->plugin_version
107
  );
108
  } else {
109
  wp_enqueue_script(
110
  'nestedpages',
111
  $this->plugin_dir . '/assets/js/nestedpages.min.js',
112
+ ['jquery'],
113
  $this->plugin_version
114
  );
115
  }
116
+ $localized_data = [
117
  'np_nonce' => wp_create_nonce( 'nestedpages-nonce' ),
118
  'expand_text' => __('Expand All', 'wp-nested-pages'),
119
  'collapse_text' => __('Collapse All', 'wp-nested-pages'),
132
  'add_page' => __('Add Page', 'wp-nested-pages'),
133
  'add_pages' => __('Add Pages', 'wp-nested-pages'),
134
  'add_multiple' => __('Add Multiple', 'wp-nested-pages'),
135
+ 'trash_confirm' => __('Are you sure you would like to empty the trash? This action is not reversible.', 'wp-nested-pages'),
136
  'hidden' => __('Hidden', 'wp-nested-pages'),
137
  'bulk_actions' => __('Bulk Actions', 'wp-nested-pages'),
138
  'link_delete_confirmation' => __('Your selection includes link items, which cannot be recovered after deleting. Would you like to continue? (Other items are moved to the trash)', 'wp-nested-pages'),
139
+ 'link_delete_confirmation_singular' => __('Are you sure you would like to delete this item? This action is not reversible.', 'wp-nested-pages'),
140
  'delete' => __('Delete', 'wp-nested-pages'),
141
  'trash_delete_links' => __('Trash Posts and Delete Links', 'wp-nested-pages'),
142
  'manual_menu_sync' => $this->settings->autoMenuDisabled(),
146
  'settings_page' => $settings_page,
147
  'wpml' => ( $this->integrations->plugins->wpml->installed ) ? true : false,
148
  'add_translation' => __('Add Translation', 'wp-nested-pages'),
149
+ 'edit' => __('Edit', 'wp-nested-pages'),
150
+ 'insert_before' => __('Insert Before', 'wp-nested-pages'),
151
+ 'insert_after' => __('Insert After', 'wp-nested-pages')
152
+ ];
153
  $syncmenu = ( get_option('nestedpages_menusync') == 'sync' ) ? true : false;
154
  $localized_data['syncmenu'] = $syncmenu;
155
  $localized_data['post_types'] = $this->post_type_repo->getPostTypesObject();
175
  wp_enqueue_script(
176
  'nestedpages-settings',
177
  $this->plugin_dir . '/assets/js/nestedpages.settings.min.js',
178
+ ['jquery'],
179
  $this->plugin_version
180
  );
181
  endif;
app/Activation/Updates/CustomFieldsToHidden.php CHANGED
@@ -21,7 +21,7 @@ class CustomFieldsToHidden
21
  */
22
  private function setKeys()
23
  {
24
- $this->meta_keys = array(
25
  'np_nav_title',
26
  'nested_pages_status',
27
  'np_title_attribute',
@@ -31,7 +31,7 @@ class CustomFieldsToHidden
31
  'np_nav_menu_item_type',
32
  'np_nav_menu_item_object',
33
  'np_nav_menu_item_object_id'
34
- );
35
  }
36
 
37
  /**
@@ -45,8 +45,8 @@ class CustomFieldsToHidden
45
  $newKey = '_' . $key;
46
  $sql = $wpdb->update(
47
  $meta_table,
48
- array('meta_key' => $newKey),
49
- array('meta_key' => $key)
50
  );
51
  }
52
  $this->setOption();
21
  */
22
  private function setKeys()
23
  {
24
+ $this->meta_keys = [
25
  'np_nav_title',
26
  'nested_pages_status',
27
  'np_title_attribute',
31
  'np_nav_menu_item_type',
32
  'np_nav_menu_item_object',
33
  'np_nav_menu_item_object_id'
34
+ ];
35
  }
36
 
37
  /**
45
  $newKey = '_' . $key;
46
  $sql = $wpdb->update(
47
  $meta_table,
48
+ ['meta_key' => $newKey],
49
+ ['meta_key' => $key]
50
  );
51
  }
52
  $this->setOption();
app/Activation/Updates/Updates.php CHANGED
@@ -110,9 +110,9 @@ class Updates
110
  {
111
  if ( version_compare( $this->current_version, '1.3.1', '<' ) ){
112
  $enabled = get_option('nestedpages_ui', false);
113
- $default = array(
114
  'datepicker' => 'true'
115
- );
116
  if ( !$enabled ) update_option('nestedpages_ui', $default);
117
  }
118
  }
110
  {
111
  if ( version_compare( $this->current_version, '1.3.1', '<' ) ){
112
  $enabled = get_option('nestedpages_ui', false);
113
+ $default = [
114
  'datepicker' => 'true'
115
+ ];
116
  if ( !$enabled ) update_option('nestedpages_ui', $default);
117
  }
118
  }
app/Bootstrap.php CHANGED
@@ -9,9 +9,9 @@ class Bootstrap
9
  public function __construct()
10
  {
11
  $this->initializePlugin();
12
- add_action( 'wp_loaded', array($this, 'wpLoaded'));
13
- add_action( 'init', array($this, 'initializeWordPress') );
14
- add_filter( 'plugin_action_links_' . 'wp-nested-pages/nestedpages.php', array($this, 'settingsLink' ) );
15
  }
16
 
17
  /**
@@ -63,7 +63,7 @@ class Bootstrap
63
  */
64
  public function settingsLink($links)
65
  {
66
- $settings_link = '<a href="options-general.php?page=nested-pages-settings">' . __('Settings') . '</a>';
67
  array_unshift($links, $settings_link);
68
  return $links;
69
  }
9
  public function __construct()
10
  {
11
  $this->initializePlugin();
12
+ add_action( 'wp_loaded', [$this, 'wpLoaded']);
13
+ add_action( 'init', [$this, 'initializeWordPress']);
14
+ add_filter( 'plugin_action_links_' . 'wp-nested-pages/nestedpages.php', [$this, 'settingsLink']);
15
  }
16
 
17
  /**
63
  */
64
  public function settingsLink($links)
65
  {
66
+ $settings_link = '<a href="options-general.php?page=nested-pages-settings">' . __('Settings', 'wp-nested-pages') . '</a>';
67
  array_unshift($links, $settings_link);
68
  return $links;
69
  }
app/Config/Settings.php CHANGED
@@ -57,9 +57,9 @@ class Settings
57
 
58
  public function __construct()
59
  {
60
- add_action( 'admin_menu', array( $this, 'registerSettingsPage' ) );
61
- add_action( 'admin_init', array( $this, 'registerSettings' ) );
62
- add_action( 'updated_option', array( $this, 'updateMenuName'), 10, 3);
63
  $this->user_repo = new UserRepository;
64
  $this->settings = new SettingsRepository;
65
  $this->post_type_repo = new PostTypeRepository;
@@ -79,7 +79,7 @@ class Settings
79
  __('Nested Pages', 'wp-nested-pages'),
80
  'manage_options',
81
  'nested-pages-settings',
82
- array( $this, 'settingsPage' )
83
  );
84
  }
85
 
@@ -110,10 +110,10 @@ class Settings
110
  if ( $menu ) {
111
  delete_option('nestedpages_menu'); // Delete the option to prevent infinite loop
112
  update_option('nestedpages_menu', $old_value);
113
- wp_update_term($menu->term_id, 'nav_menu', array(
114
  'name' => $value,
115
  'slug' => sanitize_title($value)
116
- ));
117
  }
118
  }
119
  }
57
 
58
  public function __construct()
59
  {
60
+ add_action( 'admin_menu', [$this, 'registerSettingsPage' ]);
61
+ add_action( 'admin_init', [$this, 'registerSettings']);
62
+ add_action( 'updated_option', [$this, 'updateMenuName'], 10, 3);
63
  $this->user_repo = new UserRepository;
64
  $this->settings = new SettingsRepository;
65
  $this->post_type_repo = new PostTypeRepository;
79
  __('Nested Pages', 'wp-nested-pages'),
80
  'manage_options',
81
  'nested-pages-settings',
82
+ [$this, 'settingsPage']
83
  );
84
  }
85
 
110
  if ( $menu ) {
111
  delete_option('nestedpages_menu'); // Delete the option to prevent infinite loop
112
  update_option('nestedpages_menu', $old_value);
113
+ wp_update_term($menu->term_id, 'nav_menu', [
114
  'name' => $value,
115
  'slug' => sanitize_title($value)
116
+ ]);
117
  }
118
  }
119
  }
app/Config/SettingsRepository.php CHANGED
@@ -74,7 +74,7 @@ class SettingsRepository
74
  {
75
  $post_type_repo = new PostTypeRepository;
76
 
77
- $fields = array(
78
  'title' => __('Post Title', 'wp-nested-pages'),
79
  'slug' => __('Slug', 'wp-nested-pages'),
80
  'date' => __('Post Date', 'wp-nested-pages'),
@@ -82,7 +82,7 @@ class SettingsRepository
82
  'status' => __('Post Status', 'wp-nested-pages'),
83
  'password' => __('Password/Private', 'wp-nested-pages'),
84
  'allow_comments' => __('Allow Comments', 'wp-nested-pages')
85
- );
86
 
87
  if ( $post_type == 'page' ) {
88
  $fields['template'] = __('Template', 'wp-nested-pages');
@@ -98,7 +98,7 @@ class SettingsRepository
98
  if ( empty($enabled_taxonomies) ) return $fields;
99
 
100
  $fields['hide_taxonomies'] = __('Taxonomies', 'wp-nested-pages');
101
- $fields['taxonomies'] = array();
102
  foreach($enabled_taxonomies as $taxonomy){
103
  $fields['taxonomies'][$taxonomy->name] = $taxonomy->labels->name;
104
  }
@@ -112,18 +112,18 @@ class SettingsRepository
112
  public function getImageSizes()
113
  {
114
  global $_wp_additional_image_sizes;
115
- $sizes = array();
116
  foreach ( get_intermediate_image_sizes() as $_size ) {
117
- if ( in_array( $_size, array('thumbnail', 'medium', 'medium_large', 'large') ) ) {
118
  $sizes[ $_size ]['width'] = get_option( "{$_size}_size_w" );
119
  $sizes[ $_size ]['height'] = get_option( "{$_size}_size_h" );
120
  $sizes[ $_size ]['crop'] = (bool) get_option( "{$_size}_crop" );
121
  } elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
122
- $sizes[ $_size ] = array(
123
  'width' => $_wp_additional_image_sizes[ $_size ]['width'],
124
  'height' => $_wp_additional_image_sizes[ $_size ]['height'],
125
  'crop' => $_wp_additional_image_sizes[ $_size ]['crop'],
126
- );
127
  }
128
  }
129
  return $sizes;
@@ -144,7 +144,7 @@ class SettingsRepository
144
  */
145
  public function resetSettings()
146
  {
147
- $options = array(
148
  'nested_pages_custom_fields_hidden',
149
  'nestedpages_allowsorting',
150
  'nestedpages_disable_menu',
@@ -153,7 +153,7 @@ class SettingsRepository
153
  'nestedpages_posttypes',
154
  'nestedpages_ui',
155
  'nestedpages_version'
156
- );
157
  foreach($options as $option){
158
  delete_option($option);
159
  }
74
  {
75
  $post_type_repo = new PostTypeRepository;
76
 
77
+ $fields = [
78
  'title' => __('Post Title', 'wp-nested-pages'),
79
  'slug' => __('Slug', 'wp-nested-pages'),
80
  'date' => __('Post Date', 'wp-nested-pages'),
82
  'status' => __('Post Status', 'wp-nested-pages'),
83
  'password' => __('Password/Private', 'wp-nested-pages'),
84
  'allow_comments' => __('Allow Comments', 'wp-nested-pages')
85
+ ];
86
 
87
  if ( $post_type == 'page' ) {
88
  $fields['template'] = __('Template', 'wp-nested-pages');
98
  if ( empty($enabled_taxonomies) ) return $fields;
99
 
100
  $fields['hide_taxonomies'] = __('Taxonomies', 'wp-nested-pages');
101
+ $fields['taxonomies'] = [];
102
  foreach($enabled_taxonomies as $taxonomy){
103
  $fields['taxonomies'][$taxonomy->name] = $taxonomy->labels->name;
104
  }
112
  public function getImageSizes()
113
  {
114
  global $_wp_additional_image_sizes;
115
+ $sizes = [];
116
  foreach ( get_intermediate_image_sizes() as $_size ) {
117
+ if ( in_array( $_size, ['thumbnail', 'medium', 'medium_large', 'large'] ) ) {
118
  $sizes[ $_size ]['width'] = get_option( "{$_size}_size_w" );
119
  $sizes[ $_size ]['height'] = get_option( "{$_size}_size_h" );
120
  $sizes[ $_size ]['crop'] = (bool) get_option( "{$_size}_crop" );
121
  } elseif ( isset( $_wp_additional_image_sizes[ $_size ] ) ) {
122
+ $sizes[ $_size ] = [
123
  'width' => $_wp_additional_image_sizes[ $_size ]['width'],
124
  'height' => $_wp_additional_image_sizes[ $_size ]['height'],
125
  'crop' => $_wp_additional_image_sizes[ $_size ]['crop'],
126
+ ];
127
  }
128
  }
129
  return $sizes;
144
  */
145
  public function resetSettings()
146
  {
147
+ $options = [
148
  'nested_pages_custom_fields_hidden',
149
  'nestedpages_allowsorting',
150
  'nestedpages_disable_menu',
153
  'nestedpages_posttypes',
154
  'nestedpages_ui',
155
  'nestedpages_version'
156
+ ];
157
  foreach($options as $option){
158
  delete_option($option);
159
  }
app/Entities/AdminMenu/AdminMenu.php CHANGED
@@ -12,8 +12,8 @@ class AdminMenu
12
  {
13
  public function __construct()
14
  {
15
- add_action( 'admin_menu', array($this, 'setMenus') );
16
- add_action( 'admin_head', array($this, 'expandSubMenus') );
17
  }
18
 
19
  /**
12
  {
13
  public function __construct()
14
  {
15
+ add_action('admin_menu', [$this, 'setMenus']);
16
+ add_action('admin_head', [$this, 'expandSubMenus']);
17
  }
18
 
19
  /**
app/Entities/AdminMenu/AdminSubmenu.php CHANGED
@@ -43,7 +43,7 @@ class AdminSubmenu
43
  foreach($submenu as $key => $sub){
44
  if ($key == $this->post_type_repo->editSlug($this->post_type)){
45
  // Add the "All Link"
46
- $submenu[$this->slug][50] = array( $sub[5][0], 'publish_pages', esc_url(admin_url('admin.php?page=' . $this->slug)) );
47
  unset($sub['5']); // Remove Top Level
48
  $menu_items = $sub;
49
  }
@@ -53,7 +53,7 @@ class AdminSubmenu
53
  foreach($menu_items as $item){
54
  // Make sure URLs for custom menu items are correct
55
  $url = ( isset($item[3]) ) ? 'edit.php?post_type=' . $this->post_type->name . '&page=' . $item[2] : $item[2];
56
- $submenu[$this->slug][$c] = array( $item[0], $item[1], esc_url(admin_url($url)) );
57
  $c = $c + 10;
58
  }
59
  }
@@ -68,11 +68,11 @@ class AdminSubmenu
68
  {
69
  global $submenu;
70
  if ( !$this->post_type_repo->postTypeSetting($this->post_type->name, 'hide_default') ){
71
- $submenu[$this->slug][$c] = array(
72
  __('Default', 'wp-nested-pages') . ' ' . $this->post_type->labels->name,
73
- 'publish_pages',
74
  $this->post_type_repo->editSlug($this->post_type)
75
- );
76
  }
77
  }
78
 
43
  foreach($submenu as $key => $sub){
44
  if ($key == $this->post_type_repo->editSlug($this->post_type)){
45
  // Add the "All Link"
46
+ $submenu[$this->slug][50] = [$sub[5][0], 'edit_pages', esc_url(admin_url('admin.php?page=' . $this->slug))];
47
  unset($sub['5']); // Remove Top Level
48
  $menu_items = $sub;
49
  }
53
  foreach($menu_items as $item){
54
  // Make sure URLs for custom menu items are correct
55
  $url = ( isset($item[3]) ) ? 'edit.php?post_type=' . $this->post_type->name . '&page=' . $item[2] : $item[2];
56
+ $submenu[$this->slug][$c] = [$item[0], $item[1], esc_url(admin_url($url))];
57
  $c = $c + 10;
58
  }
59
  }
68
  {
69
  global $submenu;
70
  if ( !$this->post_type_repo->postTypeSetting($this->post_type->name, 'hide_default') ){
71
+ $submenu[$this->slug][$c] = [
72
  __('Default', 'wp-nested-pages') . ' ' . $this->post_type->labels->name,
73
+ 'edit_pages',
74
  $this->post_type_repo->editSlug($this->post_type)
75
+ ];
76
  }
77
  }
78
 
app/Entities/AdminMenu/AdminSubmenuExpander.php CHANGED
@@ -23,6 +23,7 @@ class AdminSubmenuExpander
23
  {
24
  $this->post_type_repo = new PostTypeRepository;
25
  $this->page = get_current_screen();
 
26
  $this->addHighlighting();
27
  }
28
 
23
  {
24
  $this->post_type_repo = new PostTypeRepository;
25
  $this->page = get_current_screen();
26
+ if ( !$this->page ) return;
27
  $this->addHighlighting();
28
  }
29
 
app/Entities/AdminMenu/EnabledMenus.php CHANGED
@@ -67,7 +67,7 @@ class EnabledMenus
67
  }
68
  } else {
69
  $default = new AdminSubmenuDefault($type);
70
- $np_page_params[$default->getHook()] = array('post_type' => $type->name);
71
  }
72
  $c++;
73
  }
@@ -89,7 +89,7 @@ class EnabledMenus
89
  $this->menuIcon(),
90
  $this->menuPosition($c)
91
  );
92
- $np_page_params[$hook] = array('post_type' => $this->post_type->name);
93
  }
94
 
95
  /**
67
  }
68
  } else {
69
  $default = new AdminSubmenuDefault($type);
70
+ $np_page_params[$default->getHook()] = ['post_type' => $type->name];
71
  }
72
  $c++;
73
  }
89
  $this->menuIcon(),
90
  $this->menuPosition($c)
91
  );
92
+ $np_page_params[$hook] = ['post_type' => $this->post_type->name];
93
  }
94
 
95
  /**
app/Entities/DefaultList/NestedViewLink.php CHANGED
@@ -31,7 +31,7 @@ class NestedViewLink
31
  */
32
  private function addFilter()
33
  {
34
- add_filter( 'views_edit-' . $this->post_type->name, array($this, 'addLink' ) );
35
  }
36
 
37
  /**
@@ -43,7 +43,7 @@ class NestedViewLink
43
  if ( $screen->parent_file == $this->post_type_repo->editSlug($this->post_type) ){
44
  $link_text = $this->post_type_repo->getSubmenuText($this->post_type);
45
  $link_href = esc_url(admin_url('admin.php?page=' . $this->post_type_repo->getMenuSlug($this->post_type)));
46
- $link = array($link_text => '<a href="' . $link_href . '">' . $link_text . '</a>');
47
  $views = array_merge($views, $link);
48
  }
49
  return $views;
31
  */
32
  private function addFilter()
33
  {
34
+ add_filter( 'views_edit-' . $this->post_type->name, [$this, 'addLink']);
35
  }
36
 
37
  /**
43
  if ( $screen->parent_file == $this->post_type_repo->editSlug($this->post_type) ){
44
  $link_text = $this->post_type_repo->getSubmenuText($this->post_type);
45
  $link_href = esc_url(admin_url('admin.php?page=' . $this->post_type_repo->getMenuSlug($this->post_type)));
46
+ $link = [$link_text => '<a href="' . $link_href . '">' . $link_text . '</a>'];
47
  $views = array_merge($views, $link);
48
  }
49
  return $views;
app/Entities/Listing/Listing.php CHANGED
@@ -147,7 +147,7 @@ class Listing
147
  {
148
  $class_name = get_class();
149
  $classinstance = new $class_name($post_type);
150
- return array(&$classinstance, "listPosts");
151
  }
152
 
153
  /**
@@ -175,7 +175,7 @@ class Listing
175
  private function setStickyPosts()
176
  {
177
  $this->sticky_posts = get_option('sticky_posts');
178
- if ( !$this->sticky_posts ) $this->sticky_posts = array();
179
  }
180
 
181
  /**
@@ -195,7 +195,7 @@ class Listing
195
  {
196
  // The standard fields checkbox is explicitly not set
197
  if ( isset($this->post_type_settings->standard_fields_enabled) && !$this->post_type_settings->standard_fields_enabled ){
198
- $this->disabled_standard_fields = array();
199
  return;
200
  }
201
 
@@ -206,10 +206,52 @@ class Listing
206
  }
207
  return;
208
  }
209
- $this->disabled_standard_fields = array();
210
  return;
211
  }
212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  /**
214
  * The Main View
215
  * Replaces Default Post Listing
@@ -239,7 +281,7 @@ class Listing
239
  if ( $this->post_type_settings->disable_sorting ) $sortable = false;
240
 
241
  // Get array of child pages
242
- $children = array();
243
  $all_children = $pages;
244
  foreach($all_children as $child){
245
  array_push($children, $child->ID);
@@ -249,6 +291,7 @@ class Listing
249
 
250
  $list_classes = 'sortable visible nplist';
251
  if ( !$this->user->canSortPages() || !$sortable || $this->listing_repo->isSearch() ) $list_classes .= ' no-sort';
 
252
  if ( $this->integrations->plugins->wpml->installed && $this->integrations->plugins->wpml->getCurrentLanguage() == 'all' ) $list_classes .= ' no-sort';
253
  if ( $this->integrations->plugins->yoast->installed ) $list_classes .= ' has-yoast';
254
  if ( $this->listing_repo->isSearch() ) $list_classes .= ' np-search-results';
@@ -356,11 +399,16 @@ class Listing
356
  $row_view = ( $this->post->type !== 'np-redirect' ) ? 'partials/row' : 'partials/row-link';
357
 
358
  // CSS Classes for the <li> row element
 
 
 
 
359
  $row_classes = '';
360
  if ( !$this->post_type->hierarchical ) $row_classes .= ' non-hierarchical';
361
  if ( !$this->user->canSortPages() ) $row_classes .= ' no-sort';
362
  if ( $wpml_current_language == 'all' ) $row_classes .= ' no-sort';
363
- if ( $this->listing_repo->isSearch() ) $row_classes .= ' search';
 
364
 
365
  // Page Assignment for Post Type
366
  $assigned_pt = ( $this->listing_repo->isAssignedPostType($this->post->id, $this->assigned_pt_pages) )
147
  {
148
  $class_name = get_class();
149
  $classinstance = new $class_name($post_type);
150
+ return [&$classinstance, "listPosts"];
151
  }
152
 
153
  /**
175
  private function setStickyPosts()
176
  {
177
  $this->sticky_posts = get_option('sticky_posts');
178
+ if ( !$this->sticky_posts ) $this->sticky_posts = [];
179
  }
180
 
181
  /**
195
  {
196
  // The standard fields checkbox is explicitly not set
197
  if ( isset($this->post_type_settings->standard_fields_enabled) && !$this->post_type_settings->standard_fields_enabled ){
198
+ $this->disabled_standard_fields = [];
199
  return;
200
  }
201
 
206
  }
207
  return;
208
  }
209
+ $this->disabled_standard_fields = [];
210
  return;
211
  }
212
 
213
+ /**
214
+ * Get the Post States
215
+ */
216
+ private function postStates()
217
+ {
218
+ $out = '';
219
+ $post_states = apply_filters('display_post_states', [], $this->post);
220
+ if ( empty($post_states) ) return $out;
221
+ $state_count = count($post_states);
222
+ $i = 0;
223
+ foreach ( $post_states as $state ) {
224
+ ++$i;
225
+ ( $i == $state_count ) ? $sep = '' : $sep = ', ';
226
+ $out .= " <em class='np-page-type'><strong>&ndash; $state</strong>$sep</em>";
227
+ }
228
+ return $out;
229
+ }
230
+
231
+ /**
232
+ * Row Actions
233
+ * Adds assigned pt actions as well as any custom actions registered through page_row_actions filter
234
+ */
235
+ private function rowActions($assigned_pt)
236
+ {
237
+ $actions = [];
238
+ if ( $assigned_pt ) {
239
+ if ( current_user_can('publish_posts') ) $actions['add_new'] = '<a href="' . $this->post_type_repo->addNewPostLink($assigned_pt->name) . '">' . $assigned_pt->labels->add_new . '</a>';
240
+ $actions['view_all'] = '<a href="' . $this->post_type_repo->allPostsLink($assigned_pt->name) . '">' . $assigned_pt->labels->all_items . ' (' . $this->listing_repo->postCount($assigned_pt->name) . ')</a>';
241
+ }
242
+ $actions = apply_filters('post_row_actions', $actions, $this->post);
243
+ if ( $this->post_type->name == 'page' ) $actions = apply_filters('page_row_actions', $actions, $this->post);
244
+ if ( empty($actions) ) return null;
245
+ $out = '<ul class="np-assigned-pt-actions">';
246
+ foreach ( $actions as $key => $action ){
247
+ $out .= '<li class="' . $key;
248
+ if ( $key == 'add_new' || $key == 'view_all' ) $out .= ' visible';
249
+ $out .= '">' . $action . '</li>';
250
+ }
251
+ $out .= '</ul>';
252
+ return $out;
253
+ }
254
+
255
  /**
256
  * The Main View
257
  * Replaces Default Post Listing
281
  if ( $this->post_type_settings->disable_sorting ) $sortable = false;
282
 
283
  // Get array of child pages
284
+ $children = [];
285
  $all_children = $pages;
286
  foreach($all_children as $child){
287
  array_push($children, $child->ID);
291
 
292
  $list_classes = 'sortable visible nplist';
293
  if ( !$this->user->canSortPages() || !$sortable || $this->listing_repo->isSearch() ) $list_classes .= ' no-sort';
294
+ if ( $this->listing_repo->isOrdered($this->post_type->name) ) $list_classes .= ' no-sort';
295
  if ( $this->integrations->plugins->wpml->installed && $this->integrations->plugins->wpml->getCurrentLanguage() == 'all' ) $list_classes .= ' no-sort';
296
  if ( $this->integrations->plugins->yoast->installed ) $list_classes .= ' has-yoast';
297
  if ( $this->listing_repo->isSearch() ) $list_classes .= ' np-search-results';
399
  $row_view = ( $this->post->type !== 'np-redirect' ) ? 'partials/row' : 'partials/row-link';
400
 
401
  // CSS Classes for the <li> row element
402
+ $template = ( $this->post->template )
403
+ ? ' tpl-' . str_replace('.php', '', $this->post->template)
404
+ : '';
405
+
406
  $row_classes = '';
407
  if ( !$this->post_type->hierarchical ) $row_classes .= ' non-hierarchical';
408
  if ( !$this->user->canSortPages() ) $row_classes .= ' no-sort';
409
  if ( $wpml_current_language == 'all' ) $row_classes .= ' no-sort';
410
+ if ( $this->listing_repo->isSearch() || $this->listing_repo->isOrdered($this->post_type->name) ) $row_classes .= ' search';
411
+ if ( $this->post->template ) $row_classes .= $template;
412
 
413
  // Page Assignment for Post Type
414
  $assigned_pt = ( $this->listing_repo->isAssignedPostType($this->post->id, $this->assigned_pt_pages) )
app/Entities/Listing/ListingActions.php CHANGED
@@ -5,7 +5,7 @@ class ListingActions
5
  {
6
  public function __construct()
7
  {
8
- add_filter( 'posts_where', array($this, 'titleSearch'), 10, 2 );
9
  }
10
 
11
  /**
5
  {
6
  public function __construct()
7
  {
8
+ add_filter('posts_where', [$this, 'titleSearch'], 10, 2 );
9
  }
10
 
11
  /**
app/Entities/Listing/ListingQuery.php CHANGED
@@ -33,7 +33,6 @@ class ListingQuery
33
  $this->post_type_repo = new PostTypeRepository;
34
  $this->settings = new SettingsRepository;
35
  $this->integrations = new IntegrationFactory;
36
- $this->setSortOptions();
37
  }
38
 
39
  /**
@@ -42,53 +41,73 @@ class ListingQuery
42
  private function setSortOptions()
43
  {
44
  $this->sort_options = new \StdClass();
45
- $this->sort_options->orderby = isset($_GET['orderby'])
46
- ? sanitize_text_field($_GET['orderby'])
47
- : 'menu_order';
48
- $this->sort_options->order = isset($_GET['order'])
49
- ? sanitize_text_field($_GET['order'])
50
- : 'ASC';
51
  $this->sort_options->author = isset($_GET['author'])
52
  ? sanitize_text_field($_GET['author'])
53
  : null;
54
  }
55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  /**
57
  * Get the Posts
58
  */
59
- public function getPosts($post_type, $h_taxonomies = array(), $f_taxonomies = array())
60
  {
 
 
61
  $wpml = $this->integrations->plugins->wpml->installed;
62
  $this->h_taxonomies = $h_taxonomies;
63
  $this->f_taxonomies = $f_taxonomies;
64
- $this->post_type = $post_type;
65
 
66
  $this->setTaxonomyFilters();
67
 
68
  if ( $this->post_type->name == 'page' ) {
69
- $post_type = array('page');
70
  if ( !$this->settings->menusDisabled() && !$wpml ) $post_type[] = 'np-redirect';
71
  } else {
72
- $post_type = array($post_type->name);
73
  }
74
 
75
- $query_args = array(
76
  'post_type' => $post_type,
77
  'posts_per_page' => -1,
78
  'author' => $this->sort_options->author,
79
  'orderby' => $this->sort_options->orderby,
80
- 'post_status' => array('publish', 'pending', 'draft', 'private', 'future', 'trash'),
81
  'order' => $this->sort_options->order
82
- );
83
 
84
  if ( $this->listing_repo->isSearch() ) $query_args = $this->searchParams($query_args);
85
  if ( $this->listing_repo->isFiltered() ) $query_args = $this->filterParams($query_args);
 
86
 
87
  $query_args = apply_filters('nestedpages_page_listing', $query_args);
88
 
89
- add_filter( 'posts_clauses', array($this, 'queryFilter') );
90
  $all_posts = new \WP_Query($query_args);
91
- remove_filter( 'posts_clauses', array($this, 'queryFilter') );
92
 
93
  if ( $all_posts->have_posts() ) :
94
  return $all_posts->posts;
@@ -122,17 +141,17 @@ class ListingQuery
122
  private function setTaxonomyFilters()
123
  {
124
  $taxonomies = array_merge($this->h_taxonomies, $this->f_taxonomies);
125
- $tax_query = array();
126
  foreach ( $taxonomies as $tax ) :
127
  if ( $this->post_type_repo->sortOptionEnabled($this->post_type->name, $tax->name, true) && isset($_GET[$tax->name]) ) :
128
- $tax_query[] = array(
129
  'taxonomy' => $tax->name,
130
  'fields' => 'term_id',
131
  'terms' => sanitize_text_field($_GET[$tax->name])
132
- );
133
  endif;
134
  endforeach;
135
- if ( !empty($tax_query) ) $this->sort_options->tax_query = $tax_query;
136
  }
137
 
138
  /**
@@ -144,33 +163,49 @@ class ListingQuery
144
  global $wpdb;
145
 
146
  // Add Hierarchical Categories
 
147
  foreach($this->h_taxonomies as $tax){
148
- $name = $tax->name;
149
- $name_simple = sanitize_text_field(str_replace('-', '', $tax->name));
150
- $tr = 'tr_' . $name_simple;
151
- $tt = 'tt_' . $name_simple;
152
- $t = 't_' . $name_simple;
153
-
154
- $pieces['join'] .= "
155
- LEFT JOIN `$wpdb->term_relationships` AS $tr ON $tr.object_id = $wpdb->posts.ID
156
- LEFT JOIN `$wpdb->term_taxonomy` AS $tt ON $tt.term_taxonomy_id = $tr.term_taxonomy_id AND $tt.taxonomy = '$name'
157
- LEFT JOIN `$wpdb->terms` AS $t ON $t.term_id = $tt.term_id";
158
- $pieces['fields'] .= ", GROUP_CONCAT(DISTINCT $t.term_id SEPARATOR ',') AS '$name'";
 
 
 
 
 
 
 
159
  }
160
 
161
  // Add Flat Categories
 
162
  foreach($this->f_taxonomies as $tax){
163
- $name = $tax->name;
164
- $name_simple = sanitize_text_field(str_replace('-', '', $tax->name));
165
- $tr = 'tr_' . $name_simple;
166
- $tt = 'tt_' . $name_simple;
167
- $t = 't_' . $name_simple;
168
-
169
- $pieces['join'] .= "
170
- LEFT JOIN `$wpdb->term_relationships` AS $tr ON $tr.object_id = $wpdb->posts.ID
171
- LEFT JOIN `$wpdb->term_taxonomy` AS $tt ON $tt.term_taxonomy_id = $tr.term_taxonomy_id AND $tt.taxonomy = '$name'
172
- LEFT JOIN `$wpdb->terms` AS $t ON $t.term_id = $tt.term_id";
173
- $pieces['fields'] .= ",GROUP_CONCAT(DISTINCT $t.term_id SEPARATOR ',') AS '$name'";
 
 
 
 
 
 
 
174
  }
175
 
176
  $pieces['groupby'] = "$wpdb->posts.ID";
33
  $this->post_type_repo = new PostTypeRepository;
34
  $this->settings = new SettingsRepository;
35
  $this->integrations = new IntegrationFactory;
 
36
  }
37
 
38
  /**
41
  private function setSortOptions()
42
  {
43
  $this->sort_options = new \StdClass();
44
+ $this->setOrderBy();
45
+ $this->setOrder();
 
 
 
 
46
  $this->sort_options->author = isset($_GET['author'])
47
  ? sanitize_text_field($_GET['author'])
48
  : null;
49
  }
50
 
51
+ /**
52
+ * Set Order By
53
+ */
54
+ private function setOrderBy()
55
+ {
56
+ $orderby = ( isset($_GET['orderby']) && $_GET['orderby'] !== "" ) ? sanitize_text_field($_GET['orderby']) : 'menu_order';
57
+ $initial_orderby = $this->post_type_repo->defaultSortOption($this->post_type->name, 'orderby');
58
+ if ( $initial_orderby && !isset($_GET['orderby']) ) $orderby = $initial_orderby;
59
+ $this->sort_options->orderby = $orderby;
60
+ }
61
+
62
+ /**
63
+ * Set Order
64
+ */
65
+ private function setOrder()
66
+ {
67
+ $order = ( isset($_GET['order']) && $_GET['order'] !== "" ) ? sanitize_text_field($_GET['order']) : 'ASC';
68
+ $initial_order = $this->post_type_repo->defaultSortOption($this->post_type->name, 'order');
69
+ if ( $initial_order && !isset($_GET['order']) ) $order = $initial_order;
70
+ $this->sort_options->order = $order;
71
+ }
72
+
73
  /**
74
  * Get the Posts
75
  */
76
+ public function getPosts($post_type, $h_taxonomies = [], $f_taxonomies = [])
77
  {
78
+ $this->post_type = $post_type;
79
+ $this->setSortOptions();
80
  $wpml = $this->integrations->plugins->wpml->installed;
81
  $this->h_taxonomies = $h_taxonomies;
82
  $this->f_taxonomies = $f_taxonomies;
 
83
 
84
  $this->setTaxonomyFilters();
85
 
86
  if ( $this->post_type->name == 'page' ) {
87
+ $post_type = ['page'];
88
  if ( !$this->settings->menusDisabled() && !$wpml ) $post_type[] = 'np-redirect';
89
  } else {
90
+ $post_type = [$post_type->name];
91
  }
92
 
93
+ $query_args = [
94
  'post_type' => $post_type,
95
  'posts_per_page' => -1,
96
  'author' => $this->sort_options->author,
97
  'orderby' => $this->sort_options->orderby,
98
+ 'post_status' => ['publish', 'pending', 'draft', 'private', 'future', 'trash'],
99
  'order' => $this->sort_options->order
100
+ ];
101
 
102
  if ( $this->listing_repo->isSearch() ) $query_args = $this->searchParams($query_args);
103
  if ( $this->listing_repo->isFiltered() ) $query_args = $this->filterParams($query_args);
104
+ if ( $this->sort_options->tax_query ) $query_args['tax_query'] = $this->sort_options->tax_query;
105
 
106
  $query_args = apply_filters('nestedpages_page_listing', $query_args);
107
 
108
+ add_filter( 'posts_clauses', [$this, 'queryFilter']);
109
  $all_posts = new \WP_Query($query_args);
110
+ remove_filter( 'posts_clauses', [$this, 'queryFilter']);
111
 
112
  if ( $all_posts->have_posts() ) :
113
  return $all_posts->posts;
141
  private function setTaxonomyFilters()
142
  {
143
  $taxonomies = array_merge($this->h_taxonomies, $this->f_taxonomies);
144
+ $tax_query = [];
145
  foreach ( $taxonomies as $tax ) :
146
  if ( $this->post_type_repo->sortOptionEnabled($this->post_type->name, $tax->name, true) && isset($_GET[$tax->name]) ) :
147
+ $tax_query[] = [
148
  'taxonomy' => $tax->name,
149
  'fields' => 'term_id',
150
  'terms' => sanitize_text_field($_GET[$tax->name])
151
+ ];
152
  endif;
153
  endforeach;
154
+ $this->sort_options->tax_query = ( !empty($tax_query) ) ? $tax_query : false;
155
  }
156
 
157
  /**
163
  global $wpdb;
164
 
165
  // Add Hierarchical Categories
166
+ $c = 0;
167
  foreach($this->h_taxonomies as $tax){
168
+ $name = $tax->name;
169
+ $name_simple = sanitize_text_field(str_replace('-', '', $tax->name));
170
+ if ( $c == 0 ) $tr = 'tr_' . $name_simple;
171
+ $tt = 'tt_' . $name_simple;
172
+ $t = 't_' . $name_simple;
173
+
174
+ if ( $c == 0 ) :
175
+ $pieces['join'] .= "
176
+ LEFT JOIN `$wpdb->term_relationships` AS $tr ON $tr.object_id = $wpdb->posts.ID
177
+ LEFT JOIN `$wpdb->term_taxonomy` AS $tt ON $tt.term_taxonomy_id = $tr.term_taxonomy_id AND $tt.taxonomy = '$name'
178
+ LEFT JOIN `$wpdb->terms` AS $t ON $t.term_id = $tt.term_id";
179
+ else :
180
+ $pieces['join'] .= "
181
+ LEFT JOIN `$wpdb->term_taxonomy` AS $tt ON $tt.term_taxonomy_id = $tr.term_taxonomy_id AND $tt.taxonomy = '$name'
182
+ LEFT JOIN `$wpdb->terms` AS $t ON $t.term_id = $tt.term_id";
183
+ endif ;
184
+ $pieces['fields'] .= ", GROUP_CONCAT(DISTINCT $t.term_id SEPARATOR ',') AS '$name'";
185
+ $c++;
186
  }
187
 
188
  // Add Flat Categories
189
+ $c = 0;
190
  foreach($this->f_taxonomies as $tax){
191
+ $name = $tax->name;
192
+ $name_simple = sanitize_text_field(str_replace('-', '', $tax->name));
193
+ if ( $c == 0 ) $tr = 'tr_' . $name_simple;
194
+ $tt = 'tt_' . $name_simple;
195
+ $t = 't_' . $name_simple;
196
+
197
+ if ( $c == 0 ) :
198
+ $pieces['join'] .= "
199
+ LEFT JOIN `$wpdb->term_relationships` AS $tr ON $tr.object_id = $wpdb->posts.ID
200
+ LEFT JOIN `$wpdb->term_taxonomy` AS $tt ON $tt.term_taxonomy_id = $tr.term_taxonomy_id AND $tt.taxonomy = '$name'
201
+ LEFT JOIN `$wpdb->terms` AS $t ON $t.term_id = $tt.term_id";
202
+ else :
203
+ $pieces['join'] .= "
204
+ LEFT JOIN `$wpdb->term_taxonomy` AS $tt ON $tt.term_taxonomy_id = $tr.term_taxonomy_id AND $tt.taxonomy = '$name'
205
+ LEFT JOIN `$wpdb->terms` AS $t ON $t.term_id = $tt.term_id";
206
+ endif ;
207
+ $pieces['fields'] .= ",GROUP_CONCAT(DISTINCT $t.term_id SEPARATOR ',') AS '$name'";
208
+ $c++;
209
  }
210
 
211
  $pieces['groupby'] = "$wpdb->posts.ID";
app/Entities/Listing/ListingRepository.php CHANGED
@@ -2,6 +2,7 @@
2
  namespace NestedPages\Entities\Listing;
3
 
4
  use NestedPages\Entities\PluginIntegration\IntegrationFactory;
 
5
 
6
  class ListingRepository
7
  {
@@ -10,9 +11,15 @@ class ListingRepository
10
  */
11
  private $integrations;
12
 
 
 
 
 
 
13
  public function __construct()
14
  {
15
  $this->integrations = new IntegrationFactory;
 
16
  }
17
 
18
  /**
@@ -21,7 +28,7 @@ class ListingRepository
21
  public function visiblePages($post_type)
22
  {
23
  $visible = unserialize(get_user_meta(get_current_user_id(), 'np_visible_posts', true));
24
- if ( !isset($visible[$post_type]) ) $visible[$post_type] = array();
25
  return $visible[$post_type];
26
  }
27
 
@@ -30,9 +37,9 @@ class ListingRepository
30
  */
31
  public function taxonomies()
32
  {
33
- $taxonomies = get_taxonomies(array(
34
  'public' => true,
35
- ), 'objects');
36
  return $taxonomies;
37
  }
38
 
@@ -49,9 +56,9 @@ class ListingRepository
49
  */
50
  public function postTypes()
51
  {
52
- $types = get_post_types(array(
53
  'public' => true
54
- ), 'objects');
55
  return $types;
56
  }
57
 
@@ -60,10 +67,10 @@ class ListingRepository
60
  */
61
  public function recentPosts($post_type)
62
  {
63
- $pq = new \WP_Query(array(
64
  'post_type' => $post_type,
65
  'posts_per_page' => 10
66
- ));
67
  if ( $pq->have_posts() ) :
68
  return $pq->posts;
69
  else :
@@ -127,4 +134,20 @@ class ListingRepository
127
  {
128
  return ( isset($_GET['category']) && $_GET['category'] !== "all" ) ? true : false;
129
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  }
2
  namespace NestedPages\Entities\Listing;
3
 
4
  use NestedPages\Entities\PluginIntegration\IntegrationFactory;
5
+ use NestedPages\Entities\PostType\PostTypeRepository;
6
 
7
  class ListingRepository
8
  {
11
  */
12
  private $integrations;
13
 
14
+ /**
15
+ * Post Type Repository
16
+ */
17
+ private $post_type_repo;
18
+
19
  public function __construct()
20
  {
21
  $this->integrations = new IntegrationFactory;
22
+ $this->post_type_repo = new PostTypeRepository;
23
  }
24
 
25
  /**
28
  public function visiblePages($post_type)
29
  {
30
  $visible = unserialize(get_user_meta(get_current_user_id(), 'np_visible_posts', true));
31
+ if ( !isset($visible[$post_type]) || !$visible ) $visible[$post_type] = [];
32
  return $visible[$post_type];
33
  }
34
 
37
  */
38
  public function taxonomies()
39
  {
40
+ $taxonomies = get_taxonomies([
41
  'public' => true,
42
+ ], 'objects');
43
  return $taxonomies;
44
  }
45
 
56
  */
57
  public function postTypes()
58
  {
59
+ $types = get_post_types([
60
  'public' => true
61
+ ], 'objects');
62
  return $types;
63
  }
64
 
67
  */
68
  public function recentPosts($post_type)
69
  {
70
+ $pq = new \WP_Query([
71
  'post_type' => $post_type,
72
  'posts_per_page' => 10
73
+ ]);
74
  if ( $pq->have_posts() ) :
75
  return $pq->posts;
76
  else :
134
  {
135
  return ( isset($_GET['category']) && $_GET['category'] !== "all" ) ? true : false;
136
  }
137
+
138
+ /**
139
+ * Is the list ordered?
140
+ */
141
+ public function isOrdered($post_type = null)
142
+ {
143
+ $ordered = ( isset($_GET['orderby']) && $_GET['orderby'] !== "" ) ? true : false;
144
+ if ( $post_type ){
145
+ $initial_orderby = $this->post_type_repo->defaultSortOption($post_type, 'orderby');
146
+ if ( $initial_orderby ) $ordered = true;
147
+ }
148
+ if ( $ordered && isset($_GET['orderby']) && $_GET['orderby'] == 'menu_order' && !isset($_GET['order']) ) $ordered = false;
149
+ // Enbales nesting if sorted by menu order in ascending order
150
+ if ( isset($_GET['orderby']) && $_GET['orderby'] == 'menu_order' && isset($_GET['order']) && $_GET['order'] == 'ASC' ) $ordered = false;
151
+ return $ordered;
152
+ }
153
  }
app/Entities/NavMenu/NavMenuActions.php CHANGED
@@ -24,12 +24,12 @@ class NavMenuActions
24
 
25
  private function addUpdateHook()
26
  {
27
- add_action( 'wp_update_nav_menu', array($this, 'syncMenu'), 10, 2 );
28
  }
29
 
30
  private function removeUpdateHook()
31
  {
32
- remove_action( 'wp_update_nav_menu', array($this, 'syncMenu'), 10);
33
  }
34
 
35
  /**
24
 
25
  private function addUpdateHook()
26
  {
27
+ add_action( 'wp_update_nav_menu', [$this, 'syncMenu'], 10, 2 );
28
  }
29
 
30
  private function removeUpdateHook()
31
  {
32
+ remove_action( 'wp_update_nav_menu', [$this, 'syncMenu'], 10);
33
  }
34
 
35
  /**
app/Entities/NavMenu/NavMenuFrontEnd.php CHANGED
@@ -16,7 +16,7 @@ class NavMenuFrontEnd
16
  public function __construct()
17
  {
18
  $this->nav_menu_repo = new NavMenuRepository;
19
- add_filter('nav_menu_link_attributes', array($this, 'attributeFilter'), 10, 3);
20
  }
21
 
22
  /**
@@ -32,6 +32,7 @@ class NavMenuFrontEnd
32
  foreach($atts as $attribute => $value){
33
  if ( strtolower($attribute) != 'rel' ) continue;
34
  if ( $value == $item->object ) unset($atts[$attribute]);
 
35
  }
36
 
37
  return $atts;
16
  public function __construct()
17
  {
18
  $this->nav_menu_repo = new NavMenuRepository;
19
+ add_filter('nav_menu_link_attributes', [$this, 'attributeFilter'], 10, 3);
20
  }
21
 
22
  /**
32
  foreach($atts as $attribute => $value){
33
  if ( strtolower($attribute) != 'rel' ) continue;
34
  if ( $value == $item->object ) unset($atts[$attribute]);
35
+ if ( is_numeric($value) ) unset($atts[$attribute]);
36
  }
37
 
38
  return $atts;
app/Entities/NavMenu/NavMenuRepository.php CHANGED
@@ -85,7 +85,7 @@ class NavMenuRepository
85
  public function getMenuTermObject()
86
  {
87
  $menu_id = get_option('nestedpages_menu');
88
- $term = get_term_by('id', $menu_id, 'nav_menu');
89
  if ( $term ) return $term;
90
 
91
  // No Menu Yet
@@ -111,6 +111,10 @@ class NavMenuRepository
111
  private function createNewMenu()
112
  {
113
  $menu_id = wp_create_nav_menu('Nested Pages');
 
 
 
 
114
  update_option('nestedpages_menu', $menu_id);
115
  }
116
 
@@ -157,7 +161,7 @@ class NavMenuRepository
157
  $meta_table = $wpdb->prefix . 'postmeta';
158
  $sql = "SELECT p.ID AS nav_status FROM $post_table AS p LEFT JOIN $meta_table AS m ON p.ID = m.post_id AND m.meta_key = 'np_nav_status' WHERE p.post_type = 'page' AND (m.meta_value = 'show' OR m.meta_value IS NULL)";
159
  $results = $wpdb->get_results($sql, ARRAY_N);
160
- if ( !$results ) return array();
161
  foreach($results as $key => $result){
162
  $visible[$key] = $result[0];
163
  }
85
  public function getMenuTermObject()
86
  {
87
  $menu_id = get_option('nestedpages_menu');
88
+ $term = ( is_numeric($menu_id) ) ? get_term_by('id', $menu_id, 'nav_menu') : false;
89
  if ( $term ) return $term;
90
 
91
  // No Menu Yet
111
  private function createNewMenu()
112
  {
113
  $menu_id = wp_create_nav_menu('Nested Pages');
114
+ if ( is_wp_error($menu_id) ){
115
+ $name = 'Nested Pages ' . rand(1, 5);
116
+ $menu_id = wp_create_nav_menu($name);
117
+ }
118
  update_option('nestedpages_menu', $menu_id);
119
  }
120
 
161
  $meta_table = $wpdb->prefix . 'postmeta';
162
  $sql = "SELECT p.ID AS nav_status FROM $post_table AS p LEFT JOIN $meta_table AS m ON p.ID = m.post_id AND m.meta_key = 'np_nav_status' WHERE p.post_type = 'page' AND (m.meta_value = 'show' OR m.meta_value IS NULL)";
163
  $results = $wpdb->get_results($sql, ARRAY_N);
164
+ if ( !$results ) return [];
165
  foreach($results as $key => $result){
166
  $visible[$key] = $result[0];
167
  }
app/Entities/NavMenu/NavMenuSyncListing.php CHANGED
@@ -38,18 +38,18 @@ class NavMenuSyncListing extends NavMenuSync
38
  */
39
  public function sync($parent = 0, $menu_parent = 0, $nest_level = 0)
40
  {
41
- $post_types = array('page');
42
  if ( !$this->integrations->plugins->wpml->installed ) $post_types[] = 'np-redirect';
43
  try {
44
  $this->count = $this->count + 1;
45
- $args = array(
46
  'post_type' => $post_types,
47
  'posts_per_page' => -1,
48
  'post_status' => 'publish',
49
  'orderby' => 'menu_order',
50
  'order' => 'ASC',
51
  'post_parent' => $parent
52
- );
53
  $page_q = new \WP_Query(apply_filters('nestedpages_menu_sync', $args, $nest_level));
54
  if ( $page_q->have_posts() ) : while ( $page_q->have_posts() ) : $page_q->the_post();
55
  $nest_level++;
@@ -100,7 +100,7 @@ class NavMenuSyncListing extends NavMenuSync
100
  // WP 4.4 Fix, empty nav title attribute causing post_excerpt null error
101
  $attr_title = ( $this->post->nav_title_attr ) ? $this->post->nav_title_attr : '';
102
 
103
- $args = array(
104
  'menu-item-title' => $title,
105
  'menu-item-position' => $this->count,
106
  'menu-item-url' => $url,
@@ -114,7 +114,7 @@ class NavMenuSyncListing extends NavMenuSync
114
  'menu-item-xfn' => $xfn,
115
  'menu-item-target' => $this->post->link_target,
116
  'menu-item-description' => ' '
117
- );
118
  $menu = wp_update_nav_menu_item($this->id, $menu_item_id, $args);
119
  return $menu;
120
  }
38
  */
39
  public function sync($parent = 0, $menu_parent = 0, $nest_level = 0)
40
  {
41
+ $post_types = ['page'];
42
  if ( !$this->integrations->plugins->wpml->installed ) $post_types[] = 'np-redirect';
43
  try {
44
  $this->count = $this->count + 1;
45
+ $args = [
46
  'post_type' => $post_types,
47
  'posts_per_page' => -1,
48
  'post_status' => 'publish',
49
  'orderby' => 'menu_order',
50
  'order' => 'ASC',
51
  'post_parent' => $parent
52
+ ];
53
  $page_q = new \WP_Query(apply_filters('nestedpages_menu_sync', $args, $nest_level));
54
  if ( $page_q->have_posts() ) : while ( $page_q->have_posts() ) : $page_q->the_post();
55
  $nest_level++;
100
  // WP 4.4 Fix, empty nav title attribute causing post_excerpt null error
101
  $attr_title = ( $this->post->nav_title_attr ) ? $this->post->nav_title_attr : '';
102
 
103
+ $args = [
104
  'menu-item-title' => $title,
105
  'menu-item-position' => $this->count,
106
  'menu-item-url' => $url,
114
  'menu-item-xfn' => $xfn,
115
  'menu-item-target' => $this->post->link_target,
116
  'menu-item-description' => ' '
117
+ ];
118
  $menu = wp_update_nav_menu_item($this->id, $menu_item_id, $args);
119
  return $menu;
120
  }
app/Entities/NavMenu/NavMenuSyncMenu.php CHANGED
@@ -73,10 +73,10 @@ class NavMenuSyncMenu extends NavMenuSync
73
  private function setMenuIndex()
74
  {
75
  foreach($this->menu_items as $key => $item){
76
- $this->index[$item->ID] = array(
77
  'ID' => $item->object_id,
78
  'title' => $item->title
79
- );
80
  }
81
  }
82
 
@@ -95,7 +95,7 @@ class NavMenuSyncMenu extends NavMenuSync
95
  ? $item->xfn
96
  : $item->object_id;
97
 
98
- $post_data = array(
99
  'menu_order' => $item->menu_order,
100
  'post_id' => $post_id,
101
  'link_target' => $item->target,
@@ -103,7 +103,7 @@ class NavMenuSyncMenu extends NavMenuSync
103
  'np_title_attribute' => $item->attr_title,
104
  'post_parent' => $parent_id,
105
  'np_nav_css_classes' => $item->classes
106
- );
107
  if ( $item->type == 'custom' ) {
108
  $post_data['content'] = $item->url;
109
  $post_data['post_id'] = $item->xfn;
@@ -122,7 +122,7 @@ class NavMenuSyncMenu extends NavMenuSync
122
  private function syncNewLink($item, $parent_id)
123
  {
124
  if ( $this->integrations->plugins->wpml->installed ) return;
125
- $post_data = array(
126
  'menuTitle' => $item->title,
127
  'np_link_title' => $item->title,
128
  '_status' => 'publish',
@@ -135,7 +135,7 @@ class NavMenuSyncMenu extends NavMenuSync
135
  'objectType' => $item->object,
136
  'objectId' => $item->object_id,
137
  'titleAttribute' => $item->attr_title
138
- );
139
  $post_id = $this->post_update_repo->saveRedirect($post_data);
140
  update_post_meta($item->ID, '_menu_item_xfn', absint($post_id));
141
  }
73
  private function setMenuIndex()
74
  {
75
  foreach($this->menu_items as $key => $item){
76
+ $this->index[$item->ID] = [
77
  'ID' => $item->object_id,
78
  'title' => $item->title
79
+ ];
80
  }
81
  }
82
 
95
  ? $item->xfn
96
  : $item->object_id;
97
 
98
+ $post_data = [
99
  'menu_order' => $item->menu_order,
100
  'post_id' => $post_id,
101
  'link_target' => $item->target,
103
  'np_title_attribute' => $item->attr_title,
104
  'post_parent' => $parent_id,
105
  'np_nav_css_classes' => $item->classes
106
+ ];
107
  if ( $item->type == 'custom' ) {
108
  $post_data['content'] = $item->url;
109
  $post_data['post_id'] = $item->xfn;
122
  private function syncNewLink($item, $parent_id)
123
  {
124
  if ( $this->integrations->plugins->wpml->installed ) return;
125
+ $post_data = [
126
  'menuTitle' => $item->title,
127
  'np_link_title' => $item->title,
128
  '_status' => 'publish',
135
  'objectType' => $item->object,
136
  'objectId' => $item->object_id,
137
  'titleAttribute' => $item->attr_title
138
+ ];
139
  $post_id = $this->post_update_repo->saveRedirect($post_data);
140
  update_post_meta($item->ID, '_menu_item_xfn', absint($post_id));
141
  }
app/Entities/NavMenu/NavMenuTrashActions.php CHANGED
@@ -16,8 +16,8 @@ class NavMenuTrashActions
16
  public function __construct()
17
  {
18
  $this->nav_menu_repo = new NavMenuRepository;
19
- add_action( 'before_delete_post', array( $this, 'removeLinkItem'), 10 );
20
- add_action( 'before_delete_post', array( $this, 'hidePagefromNav'), 10 );
21
  }
22
 
23
  /**
@@ -25,7 +25,7 @@ class NavMenuTrashActions
25
  */
26
  public function removeLinkItem($post_id)
27
  {
28
- remove_action( 'before_delete_post', array( $this, 'removeLinkItem'), 10 );
29
  $redirect_id = get_post_meta($post_id, '_menu_item_xfn', true);
30
  if ( $redirect_id !== "" ) wp_delete_post($redirect_id, true);
31
  return true;
16
  public function __construct()
17
  {
18
  $this->nav_menu_repo = new NavMenuRepository;
19
+ add_action( 'before_delete_post', [$this, 'removeLinkItem'], 10 );
20
+ add_action( 'before_delete_post', [$this, 'hidePagefromNav'], 10 );
21
  }
22
 
23
  /**
25
  */
26
  public function removeLinkItem($post_id)
27
  {
28
+ remove_action( 'before_delete_post', [$this, 'removeLinkItem'], 10 );
29
  $redirect_id = get_post_meta($post_id, '_menu_item_xfn', true);
30
  if ( $redirect_id !== "" ) wp_delete_post($redirect_id, true);
31
  return true;
app/Entities/PluginIntegration/AdvancedCustomFields.php CHANGED
@@ -35,9 +35,9 @@ class AdvancedCustomFields
35
  */
36
  private function setUnsupportedFieldTypes()
37
  {
38
- $this->unsupported = array(
39
  'relationship'
40
- );
41
  }
42
 
43
  /**
@@ -48,11 +48,11 @@ class AdvancedCustomFields
48
  public function getFieldsForPostType($post_type)
49
  {
50
  if ( !function_exists('get_field') ) return false;
51
- $field_groups = acf_get_field_groups(array(
52
  'post_type' => $post_type
53
- ));
54
  if ( !$field_groups ) return false;
55
- $all_fields = array();
56
  $c = 0;
57
  foreach ( $field_groups as $key => $group ){
58
  $fields = acf_get_fields($group);
35
  */
36
  private function setUnsupportedFieldTypes()
37
  {
38
+ $this->unsupported = [
39
  'relationship'
40
+ ];
41
  }
42
 
43
  /**
48
  public function getFieldsForPostType($post_type)
49
  {
50
  if ( !function_exists('get_field') ) return false;
51
+ $field_groups = acf_get_field_groups([
52
  'post_type' => $post_type
53
+ ]);
54
  if ( !$field_groups ) return false;
55
+ $all_fields = [];
56
  $c = 0;
57
  foreach ( $field_groups as $key => $group ){
58
  $fields = acf_get_fields($group);
app/Entities/PluginIntegration/EditorialAccessManager.php CHANGED
@@ -20,7 +20,7 @@ class EditorialAccessManager
20
 
21
  public function __construct()
22
  {
23
- add_action( 'init', array( $this, 'init' ) );
24
  }
25
 
26
  /**
20
 
21
  public function __construct()
22
  {
23
+ add_action( 'init', [$this, 'init']);
24
  }
25
 
26
  /**
app/Entities/PluginIntegration/WPML.php CHANGED
@@ -78,7 +78,7 @@ class WPML
78
  public function getSingleLanguage($language = 'en')
79
  {
80
  $languages = $this->getLanguages();
81
- return ( array_key_exists($language, $languages) ) ? $languages[$language] : array();
82
  }
83
 
84
  /**
@@ -96,7 +96,7 @@ class WPML
96
  */
97
  public function getAllTranslations($post_id, $return = 'array')
98
  {
99
- if ( !$post_id && $return == 'array' ) return array();
100
  if ( !$post_id && $return == 'count' ) return 0;
101
  $true_id = $this->sitepress->get_element_trid($post_id);
102
  if ( $return == 'array' ) return $this->sitepress->get_element_translations($true_id);
@@ -153,7 +153,7 @@ class WPML
153
  */
154
  public function getAllTranslatedIds($post_ids)
155
  {
156
- if ( !is_array($post_ids) ) return array();
157
  foreach ( $post_ids as $id ){
158
  $translations = $this->getAllTranslations($id);
159
  if ( empty($translations) ) continue;
@@ -258,7 +258,7 @@ class WPML
258
  $all_translations = $this->getAllTranslations($post_id);
259
  $source_template = get_post_meta($post_id, '_wp_page_template', true);
260
  $source_post = get_post($post_id);
261
- $sticky_flag = ( $this->settings['sync_sticky_flag'] ) ? get_option('sticky_posts') : array();
262
  foreach ( $all_translations as $translation ) :
263
  if ( $translation->element_id == $post_id ) continue;
264
  if ( $this->settings['sync_page_template'] && $source_template ){
@@ -268,7 +268,7 @@ class WPML
268
  $source_template
269
  );
270
  }
271
- $update_args = array();
272
  if ( $this->settings['sync_comment_status'] ) $update_args['comment_status'] = $source_post->comment_status;
273
  if ( $this->settings['sync_post_date'] ) $update_args['post_date'] = $source_post->post_date;
274
  if ( $this->settings['sync_post_date'] ) $update_args['post_date_gmt'] = $source_post->post_date_gmt;
@@ -287,7 +287,7 @@ class WPML
287
  global $wpdb;
288
  $all_translations = $this->getAllTranslations($source_post_id);
289
  $terms = $this->post_repo->getAllTerms($source_post_id);
290
- $translated_terms = array();
291
 
292
  // Get all translations for the terms
293
  foreach ( $terms as $term ){
78
  public function getSingleLanguage($language = 'en')
79
  {
80
  $languages = $this->getLanguages();
81
+ return ( array_key_exists($language, $languages) ) ? $languages[$language] : [];
82
  }
83
 
84
  /**
96
  */
97
  public function getAllTranslations($post_id, $return = 'array')
98
  {
99
+ if ( !$post_id && $return == 'array' ) return [];
100
  if ( !$post_id && $return == 'count' ) return 0;
101
  $true_id = $this->sitepress->get_element_trid($post_id);
102
  if ( $return == 'array' ) return $this->sitepress->get_element_translations($true_id);
153
  */
154
  public function getAllTranslatedIds($post_ids)
155
  {
156
+ if ( !is_array($post_ids) ) return [];
157
  foreach ( $post_ids as $id ){
158
  $translations = $this->getAllTranslations($id);
159
  if ( empty($translations) ) continue;
258
  $all_translations = $this->getAllTranslations($post_id);
259
  $source_template = get_post_meta($post_id, '_wp_page_template', true);
260
  $source_post = get_post($post_id);
261
+ $sticky_flag = ( $this->settings['sync_sticky_flag'] ) ? get_option('sticky_posts') : [];
262
  foreach ( $all_translations as $translation ) :
263
  if ( $translation->element_id == $post_id ) continue;
264
  if ( $this->settings['sync_page_template'] && $source_template ){
268
  $source_template
269
  );
270
  }
271
+ $update_args = [];
272
  if ( $this->settings['sync_comment_status'] ) $update_args['comment_status'] = $source_post->comment_status;
273
  if ( $this->settings['sync_post_date'] ) $update_args['post_date'] = $source_post->post_date;
274
  if ( $this->settings['sync_post_date'] ) $update_args['post_date_gmt'] = $source_post->post_date_gmt;
287
  global $wpdb;
288
  $all_translations = $this->getAllTranslations($source_post_id);
289
  $terms = $this->post_repo->getAllTerms($source_post_id);
290
+ $translated_terms = [];
291
 
292
  // Get all translations for the terms
293
  foreach ( $terms as $term ){
app/Entities/Post/PostCloner.php CHANGED
@@ -31,7 +31,7 @@ class PostCloner
31
  * Clone Options
32
  * @var array
33
  */
34
- private $clone_options = array();
35
 
36
  /**
37
  * New Posts
@@ -97,7 +97,7 @@ class PostCloner
97
  {
98
  $taxonomies = get_object_taxonomies($this->original_post->post_type);
99
  foreach ($taxonomies as $taxonomy) {
100
- $post_terms = wp_get_object_terms($this->original_id, $taxonomy, array('fields' => 'slugs'));
101
  wp_set_object_terms($this->new_id, $post_terms, $taxonomy, false);
102
  }
103
  }
@@ -109,7 +109,9 @@ class PostCloner
109
  {
110
  $meta = get_post_meta($this->original_id);
111
  foreach($meta as $key => $value){
112
- add_post_meta($this->new_id, $key, $value[0]);
 
 
113
  }
114
  }
115
  }
31
  * Clone Options
32
  * @var array
33
  */
34
+ private $clone_options = [];
35
 
36
  /**
37
  * New Posts
97
  {
98
  $taxonomies = get_object_taxonomies($this->original_post->post_type);
99
  foreach ($taxonomies as $taxonomy) {
100
+ $post_terms = wp_get_object_terms($this->original_id, $taxonomy, ['fields' => 'slugs']);
101
  wp_set_object_terms($this->new_id, $post_terms, $taxonomy, false);
102
  }
103
  }
109
  {
110
  $meta = get_post_meta($this->original_id);
111
  foreach($meta as $key => $value){
112
+ foreach( $value as $entry ){
113
+ add_post_meta($this->new_id, $key, $entry);
114
+ }
115
  }
116
  }
117
  }
app/Entities/Post/PostDataFactory.php CHANGED
@@ -42,6 +42,7 @@ class PostDataFactory
42
  public function addPostVars($post)
43
  {
44
  $this->post_data->id = $post->ID;
 
45
  $this->post_data->parent_id = $post->post_parent;
46
  $this->post_data->title = $post->post_title;
47
  $this->post_data->password = $post->post_password;
42
  public function addPostVars($post)
43
  {
44
  $this->post_data->id = $post->ID;
45
+ $this->post_data->ID = $post->ID;
46
  $this->post_data->parent_id = $post->post_parent;
47
  $this->post_data->title = $post->post_title;
48
  $this->post_data->password = $post->post_password;
app/Entities/Post/PostFactory.php CHANGED
@@ -25,7 +25,7 @@ class PostFactory
25
  * New Page IDs
26
  * @var array
27
  */
28
- private $new_ids = array();
29
 
30
 
31
  public function __construct()
@@ -41,13 +41,13 @@ class PostFactory
41
  {
42
  foreach($data['post_title'] as $key => $title){
43
  $post_type = sanitize_text_field($data['post_type']);
44
- $post = array(
45
  'post_title' => sanitize_text_field($title),
46
  'post_status' => sanitize_text_field($data['_status']),
47
  'post_author' => sanitize_text_field($data['post_author']),
48
  'post_parent' => sanitize_text_field($data['parent_id']),
49
  'post_type' => $post_type
50
- );
51
  $new_page_id = wp_insert_post($post);
52
  $data['post_id'] = $new_page_id;
53
  if ( isset($data['page_template']) ) $this->post_update_repo->updateTemplate($data);
@@ -57,6 +57,50 @@ class PostFactory
57
  return $this->getNewPosts($post_type);
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  /**
61
  * Get Array of New Pages
62
  */
25
  * New Page IDs
26
  * @var array
27
  */
28
+ private $new_ids = [];
29
 
30
 
31
  public function __construct()
41
  {
42
  foreach($data['post_title'] as $key => $title){
43
  $post_type = sanitize_text_field($data['post_type']);
44
+ $post = [
45
  'post_title' => sanitize_text_field($title),
46
  'post_status' => sanitize_text_field($data['_status']),
47
  'post_author' => sanitize_text_field($data['post_author']),
48
  'post_parent' => sanitize_text_field($data['parent_id']),
49
  'post_type' => $post_type
50
+ ];
51
  $new_page_id = wp_insert_post($post);
52
  $data['post_id'] = $new_page_id;
53
  if ( isset($data['page_template']) ) $this->post_update_repo->updateTemplate($data);
57
  return $this->getNewPosts($post_type);
58
  }
59
 
60
+ /**
61
+ * Create new Posts before/after a specified post
62
+ */
63
+ public function createBeforeAfterPosts($data)
64
+ {
65
+ global $wpdb;
66
+ $menu_order = 0;
67
+ $parent = false;
68
+ $post_type = sanitize_text_field($data['post_type']);
69
+ $after = ( isset($data['after_id']) && $data['after_id'] !== '' ) ? true : false;
70
+ $reference_post = ( $after ) ? intval($data['after_id']) : intval($data['before_id']);
71
+
72
+ // Get the source post, so the reference points for menu order can be determined
73
+ $pq = new \WP_Query([
74
+ 'post_type' => $post_type,
75
+ 'posts_per_page' => 1,
76
+ 'p' => $reference_post
77
+ ]);
78
+ if ( $pq->have_posts() ) :
79
+ $parent = intval($pq->posts[0]->post_parent);
80
+ $menu_order = $pq->posts[0]->menu_order;
81
+ endif; wp_reset_postdata();
82
+
83
+ if ( $parent ) $data['parent_id'] = $parent;
84
+ $new_posts = $this->createChildPosts($data);
85
+
86
+ if ( $after ) $menu_order = $menu_order + 1;
87
+ $new_post_count = count($new_posts);
88
+ $first_new_id = $new_posts[0]['id'];
89
+ $last_new_id = $new_posts[count($new_posts) - 1]['id'];
90
+
91
+ $sql = "UPDATE `$wpdb->posts` SET menu_order = menu_order+%d WHERE post_parent = %d AND (post_status = 'publish' OR post_status = 'draft') AND (post_type = '%s'";
92
+ if ( $post_type == 'page' ) $sql .= " OR post_type = 'np-redirect'";
93
+ $sql .= ") AND (menu_order >= %d) ORDER BY menu_order;";
94
+
95
+ // Reorder All posts after the new ones
96
+ $wpdb->query($wpdb->prepare($sql, [$new_post_count, $parent, $post_type, $menu_order]));
97
+ // Reorder the new posts menu_order
98
+ $wpdb->query($wpdb->prepare("SET @start_order := %d;", [$menu_order-1]));
99
+ $wpdb->query($wpdb->prepare("UPDATE `$wpdb->posts` SET menu_order = (@start_order:=@start_order+1) WHERE post_parent = %d AND (post_type = '%s') AND (ID BETWEEN %d AND %d) ORDER BY menu_order;", [$parent, $post_type, $first_new_id, $last_new_id]));
100
+
101
+ return $new_posts;
102
+ }
103
+
104
  /**
105
  * Get Array of New Pages
106
  */
app/Entities/Post/PostRepository.php CHANGED
@@ -10,11 +10,11 @@ class PostRepository
10
  public function getHiddenCount($type)
11
  {
12
  if ( in_array('page', $type) ) array_push($type, 'np-redirect');
13
- $hidden = new \WP_Query(array(
14
  'post_type' => $type,
15
  'meta_key' => '_nested_pages_status',
16
  'meta_value' => 'hide',
17
- 'perm' => 'readable'));
18
  return $hidden->found_posts;
19
  }
20
 
@@ -24,7 +24,7 @@ class PostRepository
24
  */
25
  public function trashedCount($post_type)
26
  {
27
- $trashed = new \WP_Query(array('post_type'=>$post_type,'post_status'=>'trash','posts_per_page'=>-1));
28
  return $trashed->found_posts;
29
  }
30
 
@@ -46,7 +46,7 @@ class PostRepository
46
  * @param object post object with taxonomies added
47
  * @return string
48
  */
49
- public function getTaxonomyCSS($post, $h_taxonomies = array(), $f_taxonomies = array())
50
  {
51
  $out = ' ';
52
 
@@ -84,13 +84,13 @@ class PostRepository
84
  */
85
  public function postArray($ids, $post_type)
86
  {
87
- $pages = array();
88
- $page_query = new \WP_Query(array(
89
  'post_type' => $post_type,
90
  'posts_per_page' => -1,
91
  'post__in' => $ids,
92
  'post_status' => array('publish', 'draft')
93
- ));
94
  if ( $page_query->have_posts() ) : $c = 0; while ( $page_query->have_posts() ) : $page_query->the_post();
95
  global $post;
96
 
@@ -135,7 +135,7 @@ class PostRepository
135
  */
136
  public function emptyTrash($post_type)
137
  {
138
- $posts_q = new \WP_Query(array('post_type'=>$post_type, 'post_status'=>'trash', 'posts_per_page'=>-1));
139
  if ( $posts_q->have_posts() ) : while ( $posts_q->have_posts() ) : $posts_q->the_post();
140
  $capability = ( $post_type == 'page' ) ? 'delete_page' : 'delete_posts';
141
  if( current_user_can( $capability, get_the_id() ) )
@@ -152,7 +152,7 @@ class PostRepository
152
  */
153
  public function postExists($post_id, $post_type = 'post')
154
  {
155
- $post_q = new \WP_Query(array('post_type' => $post_type, 'p' => $post_id));
156
  if ( $post_q->have_posts() ){
157
  wp_reset_postdata();
158
  return true;
10
  public function getHiddenCount($type)
11
  {
12
  if ( in_array('page', $type) ) array_push($type, 'np-redirect');
13
+ $hidden = new \WP_Query([
14
  'post_type' => $type,
15
  'meta_key' => '_nested_pages_status',
16
  'meta_value' => 'hide',
17
+ 'perm' => 'readable']);
18
  return $hidden->found_posts;
19
  }
20
 
24
  */
25
  public function trashedCount($post_type)
26
  {
27
+ $trashed = new \WP_Query(['post_type'=>$post_type,'post_status'=>'trash','posts_per_page'=>-1]);
28
  return $trashed->found_posts;
29
  }
30
 
46
  * @param object post object with taxonomies added
47
  * @return string
48
  */
49
+ public function getTaxonomyCSS($post, $h_taxonomies = [], $f_taxonomies = [])
50
  {
51
  $out = ' ';
52
 
84
  */
85
  public function postArray($ids, $post_type)
86
  {
87
+ $pages = [];
88
+ $page_query = new \WP_Query([
89
  'post_type' => $post_type,
90
  'posts_per_page' => -1,
91
  'post__in' => $ids,
92
  'post_status' => array('publish', 'draft')
93
+ ]);
94
  if ( $page_query->have_posts() ) : $c = 0; while ( $page_query->have_posts() ) : $page_query->the_post();
95
  global $post;
96
 
135
  */
136
  public function emptyTrash($post_type)
137
  {
138
+ $posts_q = new \WP_Query(['post_type'=>$post_type, 'post_status'=>'trash', 'posts_per_page'=>-1]);
139
  if ( $posts_q->have_posts() ) : while ( $posts_q->have_posts() ) : $posts_q->the_post();
140
  $capability = ( $post_type == 'page' ) ? 'delete_page' : 'delete_posts';
141
  if( current_user_can( $capability, get_the_id() ) )
152
  */
153
  public function postExists($post_id, $post_type = 'post')
154
  {
155
+ $post_q = new \WP_Query(['post_type' => $post_type, 'p' => $post_id]);
156
  if ( $post_q->have_posts() ){
157
  wp_reset_postdata();
158
  return true;
app/Entities/Post/PostTrashActions.php CHANGED
@@ -26,8 +26,8 @@ class PostTrashActions
26
  {
27
  $this->user_repo = new UserRepository;
28
  $this->nav_menu_repo = new NavMenuRepository;
29
- add_action( 'trashed_post', array( $this, 'trashHook' ) );
30
- add_action( 'delete_post', array( $this, 'removeLinkNavItem'), 10 );
31
  }
32
 
33
  /**
@@ -78,9 +78,9 @@ class PostTrashActions
78
 
79
  if ( !isset($visible_pages[$post_type]) ) return;
80
 
81
- $child_pages = array();
82
 
83
- $children = new \WP_Query(array('post_type'=>$post_type, 'posts_per_page'=>-1, 'post_parent'=>$post_id));
84
  if ( $children->have_posts() ) : while ( $children->have_posts() ) : $children->the_post();
85
  array_push($child_pages, get_the_id());
86
  endwhile; endif; wp_reset_postdata();
26
  {
27
  $this->user_repo = new UserRepository;
28
  $this->nav_menu_repo = new NavMenuRepository;
29
+ add_action( 'trashed_post', [$this, 'trashHook']);
30
+ add_action( 'delete_post', [$this, 'removeLinkNavItem'], 10 );
31
  }
32
 
33
  /**
78
 
79
  if ( !isset($visible_pages[$post_type]) ) return;
80
 
81
+ $child_pages = [];
82
 
83
+ $children = new \WP_Query(['post_type'=>$post_type, 'posts_per_page'=>-1, 'post_parent'=>$post_id]);
84
  if ( $children->have_posts() ) : while ( $children->have_posts() ) : $children->the_post();
85
  array_push($child_pages, get_the_id());
86
  endwhile; endif; wp_reset_postdata();
app/Entities/Post/PostUpdateRepository.php CHANGED
@@ -82,9 +82,9 @@ class PostUpdateRepository
82
  */
83
  public function updatePost($data, $append_taxonomies = false)
84
  {
85
- $updated_post = array(
86
  'ID' => sanitize_text_field($data['post_id'])
87
- );
88
 
89
  if ( isset($data['post_title']) && $data['post_title'] == "" ){
90
  $this->validation->checkEmpty($data['post_title'], __('Title', 'wp-nested-pages'));
@@ -105,6 +105,10 @@ class PostUpdateRepository
105
  $updated_post['comment_status'] = ( isset($data['comment_status']) ) ? 'open' : 'closed';
106
  }
107
 
 
 
 
 
108
  if ( isset($data['np_date']) ) {
109
  $date = $this->validation->validateDate($data);
110
  $updated_post['post_date'] = $date;
@@ -253,7 +257,7 @@ class PostUpdateRepository
253
  if ( isset($data['post_category']) )
254
  {
255
  $this->validation->validateIntegerArray($data['post_category']);
256
- $cats = array();
257
  foreach($data['post_category'] as $cat) {
258
  if ( $cat !== 0 ) $cats[] = (int) $cat;
259
  }
@@ -288,7 +292,7 @@ class PostUpdateRepository
288
  */
289
  private function updateHierarchicalTaxonomies($data, $taxonomy, $term_ids, $append_taxonomies)
290
  {
291
- $terms = array();
292
  foreach ( $term_ids as $term ){
293
  if ( $term !== 0 ) $terms[] = (int) $term;
294
  }
@@ -381,13 +385,13 @@ class PostUpdateRepository
381
  public function updateRedirect($data)
382
  {
383
  $menu_order = isset($data['menu_order']) ? $data['menu_order'] : 0;
384
- $updated_post = array(
385
  'ID' => sanitize_text_field($data['post_id']),
386
  'post_title' => sanitize_text_field($data['post_title']),
387
  'post_status' => sanitize_text_field($data['_status']),
388
  'post_parent' => sanitize_text_field($data['parent_id']),
389
  'menu_order' => $menu_order
390
- );
391
 
392
  if ( isset($data['post_content']) && $data['post_content'] !== "" ){
393
  $updated_post['post_content'] = esc_url($data['post_content']);
@@ -405,13 +409,13 @@ class PostUpdateRepository
405
  */
406
  public function saveRedirect($data)
407
  {
408
- $new_link = array(
409
  'post_title' => sanitize_text_field($data['menuTitle']),
410
  'post_status' => sanitize_text_field('publish'),
411
  'post_parent' => sanitize_text_field($data['parent_id']),
412
  'post_type' => 'np-redirect',
413
  'post_excerpt' => ''
414
- );
415
  if ( isset($data['url']) && $data['url'] !== "" ){
416
  $new_link['post_content'] = esc_url($data['url']);
417
  }
@@ -427,11 +431,11 @@ class PostUpdateRepository
427
  */
428
  public function updateFromMenuItem($data)
429
  {
430
- $updated_post = array(
431
  'ID' => sanitize_text_field($data['post_id']),
432
  'menu_order' => sanitize_text_field($data['menu_order']),
433
  'post_parent' => sanitize_text_field($data['post_parent'])
434
- );
435
  if ( isset($data['content']) ){
436
  $updated_post['post_content'] = $data['content'];
437
  $updated_post['post_title'] = $data['np_nav_title'];
82
  */
83
  public function updatePost($data, $append_taxonomies = false)
84
  {
85
+ $updated_post = [
86
  'ID' => sanitize_text_field($data['post_id'])
87
+ ];
88
 
89
  if ( isset($data['post_title']) && $data['post_title'] == "" ){
90
  $this->validation->checkEmpty($data['post_title'], __('Title', 'wp-nested-pages'));
105
  $updated_post['comment_status'] = ( isset($data['comment_status']) ) ? 'open' : 'closed';
106
  }
107
 
108
+ if ( isset($data['post_parent']) && $data['post_parent'] != '-1' ){
109
+ $updated_post['post_parent'] = intval(sanitize_text_field($data['post_parent']));
110
+ }
111
+
112
  if ( isset($data['np_date']) ) {
113
  $date = $this->validation->validateDate($data);
114
  $updated_post['post_date'] = $date;
257
  if ( isset($data['post_category']) )
258
  {
259
  $this->validation->validateIntegerArray($data['post_category']);
260
+ $cats = [];
261
  foreach($data['post_category'] as $cat) {
262
  if ( $cat !== 0 ) $cats[] = (int) $cat;
263
  }
292
  */
293
  private function updateHierarchicalTaxonomies($data, $taxonomy, $term_ids, $append_taxonomies)
294
  {
295
+ $terms = [];
296
  foreach ( $term_ids as $term ){
297
  if ( $term !== 0 ) $terms[] = (int) $term;
298
  }
385
  public function updateRedirect($data)
386
  {
387
  $menu_order = isset($data['menu_order']) ? $data['menu_order'] : 0;
388
+ $updated_post = [
389
  'ID' => sanitize_text_field($data['post_id']),
390
  'post_title' => sanitize_text_field($data['post_title']),
391
  'post_status' => sanitize_text_field($data['_status']),
392
  'post_parent' => sanitize_text_field($data['parent_id']),
393
  'menu_order' => $menu_order
394
+ ];
395
 
396
  if ( isset($data['post_content']) && $data['post_content'] !== "" ){
397
  $updated_post['post_content'] = esc_url($data['post_content']);
409
  */
410
  public function saveRedirect($data)
411
  {
412
+ $new_link = [
413
  'post_title' => sanitize_text_field($data['menuTitle']),
414
  'post_status' => sanitize_text_field('publish'),
415
  'post_parent' => sanitize_text_field($data['parent_id']),
416
  'post_type' => 'np-redirect',
417
  'post_excerpt' => ''
418
+ ];
419
  if ( isset($data['url']) && $data['url'] !== "" ){
420
  $new_link['post_content'] = esc_url($data['url']);
421
  }
431
  */
432
  public function updateFromMenuItem($data)
433
  {
434
+ $updated_post = [
435
  'ID' => sanitize_text_field($data['post_id']),
436
  'menu_order' => sanitize_text_field($data['menu_order']),
437
  'post_parent' => sanitize_text_field($data['post_parent'])
438
+ ];
439
  if ( isset($data['content']) ){
440
  $updated_post['post_content'] = $data['content'];
441
  $updated_post['post_title'] = $data['np_nav_title'];
app/Entities/PostType/PostTypeRepository.php CHANGED
@@ -22,7 +22,7 @@ class PostTypeRepository
22
  public function setEnabledPostTypes()
23
  {
24
  $types = get_option('nestedpages_posttypes');
25
- $this->enabled_post_types = ( !$types ) ? array() : $types;
26
  }
27
 
28
  /**
@@ -33,7 +33,7 @@ class PostTypeRepository
33
  public function enabledPostTypes()
34
  {
35
  $types = get_option('nestedpages_posttypes');
36
- return ( !$types ) ? array() : $types;
37
  }
38
 
39
  /**
@@ -43,7 +43,7 @@ class PostTypeRepository
43
  */
44
  public function getPostTypes($return = 'names')
45
  {
46
- return get_post_types(array('show_ui'=>true), $return);
47
  }
48
 
49
  /**
@@ -54,12 +54,12 @@ class PostTypeRepository
54
  public function getPostTypesObject()
55
  {
56
  $all_types = $this->getPostTypes('objects');
57
- $post_types = array();
58
  $enabled_types = $this->enabled_post_types;
59
- $invalid_types = array(
60
  'acf-field-group',
61
  'attachment'
62
- );
63
  foreach($all_types as $key => $type){
64
  if ( in_array($type->name, $invalid_types) ) continue;
65
  $post_types[$type->name] = new \stdClass();
@@ -110,6 +110,7 @@ class PostTypeRepository
110
  if ( !is_array($type_settings) ) return false;
111
  foreach ( $type_settings as $option_key => $setting ){
112
  if ( $option_key !== $setting_key ) continue;
 
113
  return $setting;
114
  }
115
  }
@@ -124,7 +125,7 @@ class PostTypeRepository
124
  */
125
  public function configuredFields($post_type, $field_type = 'custom_fields')
126
  {
127
- $fields = array();
128
  foreach($this->enabled_post_types as $key => $type){
129
  if ( $key == $post_type ){
130
  if ( isset($type[$field_type]) ) $fields = $type[$field_type];
@@ -169,12 +170,31 @@ class PostTypeRepository
169
  if ( empty($options) ) return $enabled;
170
  foreach ( $options as $option => $value ){
171
  if ( $option == $sort_option && $value == 'true' ) $enabled = true;
 
172
  }
173
  if ( $taxonomy && !isset($options['taxonomies']) ) $enabled = false;
174
  if ( $taxonomy && isset($options['taxonomies'][$sort_option]) && $options['taxonomies'][$sort_option] == 'true' ) $enabled = true;
175
  return $enabled;
176
  }
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  /**
179
  * Does the post type have any sort options
180
  * @return boolean
@@ -182,7 +202,12 @@ class PostTypeRepository
182
  public function hasSortOptions($post_type)
183
  {
184
  $options = $this->configuredFields($post_type, 'sort_options');
185
- return ( empty($options) ) ? false : true;
 
 
 
 
 
186
  }
187
 
188
  /**
@@ -193,7 +218,7 @@ class PostTypeRepository
193
  public function thumbnails($post_type, $key = 'enabled')
194
  {
195
  $types = $this->enabled_post_types;
196
- $type_settings = array();
197
  foreach ( $types as $type => $settings ){
198
  if ( $type !== $post_type ) continue;
199
  $type_settings = $settings;
@@ -217,7 +242,7 @@ class PostTypeRepository
217
  public function thumbnailDisplaySize($post_type)
218
  {
219
  $types = $this->enabled_post_types;
220
- $type_settings = array();
221
  foreach ( $types as $type => $settings ){
222
  if ( $type !== $post_type ) continue;
223
  $type_settings = $settings;
@@ -318,8 +343,8 @@ class PostTypeRepository
318
  public function getTaxonomies($post_type, $hierarchical = true)
319
  {
320
  $taxonomy_names = get_object_taxonomies( $post_type );
321
- $hierarchical_taxonomies = array();
322
- $flat_taxonomies = array();
323
  foreach ( $taxonomy_names as $taxonomy_name ) {
324
  $taxonomy = get_taxonomy( $taxonomy_name );
325
  if ( !$taxonomy->show_ui )continue;
@@ -392,8 +417,8 @@ class PostTypeRepository
392
  */
393
  private function fieldsArray($results)
394
  {
395
- $fields = array();
396
- $exclude = array('_wp_page_template', '_edit_lock', '_edit_last', '_wp_trash_meta_status', '_wp_trash_meta_time', 'layout', 'position', 'rule', 'hide_on_screen', '_np_link_target', '_np_nav_title', '_np_title_attribute', '_np_nav_status', '_nested_pages_status', '_np_nav_css_classes');
397
  foreach ( $results as $field ){
398
  if ( !in_array($field->meta_key, $exclude) )
399
  array_push($fields, $field->meta_key);
@@ -407,7 +432,7 @@ class PostTypeRepository
407
  public function getAssignedPages()
408
  {
409
  $post_types = $this->getPostTypesObject();
410
- $array = array();
411
  foreach($post_types as $type => $options){
412
  if ( isset($options->page_assignment) && $options->page_assignment == 'true' && isset($options->page_assignment_id) && $options->page_assignment_id !== '' ) $array[$options->page_assignment_id] = $type;
413
  }
22
  public function setEnabledPostTypes()
23
  {
24
  $types = get_option('nestedpages_posttypes');
25
+ $this->enabled_post_types = ( !$types ) ? [] : $types;
26
  }
27
 
28
  /**
33
  public function enabledPostTypes()
34
  {
35
  $types = get_option('nestedpages_posttypes');
36
+ return ( !$types ) ? [] : $types;
37
  }
38
 
39
  /**
43
  */
44
  public function getPostTypes($return = 'names')
45
  {
46
+ return get_post_types(['show_ui'=>true], $return);
47
  }
48
 
49
  /**
54
  public function getPostTypesObject()
55
  {
56
  $all_types = $this->getPostTypes('objects');
57
+ $post_types = [];
58
  $enabled_types = $this->enabled_post_types;
59
+ $invalid_types = [
60
  'acf-field-group',
61
  'attachment'
62
+ ];
63
  foreach($all_types as $key => $type){
64
  if ( in_array($type->name, $invalid_types) ) continue;
65
  $post_types[$type->name] = new \stdClass();
110
  if ( !is_array($type_settings) ) return false;
111
  foreach ( $type_settings as $option_key => $setting ){
112
  if ( $option_key !== $setting_key ) continue;
113
+ if ( $setting == 'true' ) return true;
114
  return $setting;
115
  }
116
  }
125
  */
126
  public function configuredFields($post_type, $field_type = 'custom_fields')
127
  {
128
+ $fields = [];
129
  foreach($this->enabled_post_types as $key => $type){
130
  if ( $key == $post_type ){
131
  if ( isset($type[$field_type]) ) $fields = $type[$field_type];
170
  if ( empty($options) ) return $enabled;
171
  foreach ( $options as $option => $value ){
172
  if ( $option == $sort_option && $value == 'true' ) $enabled = true;
173
+ if ( $option == $sort_option && isset($value['enabled']) ) $enabled = true;
174
  }
175
  if ( $taxonomy && !isset($options['taxonomies']) ) $enabled = false;
176
  if ( $taxonomy && isset($options['taxonomies'][$sort_option]) && $options['taxonomies'][$sort_option] == 'true' ) $enabled = true;
177
  return $enabled;
178
  }
179
 
180
+ /**
181
+ * Is there a default option set for a sort parameter?
182
+ * @param $post_type - post type name
183
+ * @param $sort_option - option to search for
184
+ */
185
+ public function defaultSortOption($post_type, $sort_option)
186
+ {
187
+ $enabled = false;
188
+ $options = $this->configuredFields($post_type, 'sort_options');
189
+ if ( !is_array($options) ) return $enabled;
190
+ if ( empty($options) ) return $enabled;
191
+ foreach ( $options as $option => $value ){
192
+ if ( $option == $sort_option && isset($value['initial']) ) $enabled = $value['initial'];
193
+ if ( $option == $sort_option && !isset($value['enabled']) ) $enabled = false;
194
+ }
195
+ return $enabled;
196
+ }
197
+
198
  /**
199
  * Does the post type have any sort options
200
  * @return boolean
202
  public function hasSortOptions($post_type)
203
  {
204
  $options = $this->configuredFields($post_type, 'sort_options');
205
+ if ( empty($options) ) return false;
206
+ $enabled = false;
207
+ foreach ( $options as $option ){
208
+ if ( isset($option['enabled']) ) $enabled = true;
209
+ }
210
+ return $enabled;
211
  }
212
 
213
  /**
218
  public function thumbnails($post_type, $key = 'enabled')
219
  {
220
  $types = $this->enabled_post_types;
221
+ $type_settings = [];
222
  foreach ( $types as $type => $settings ){
223
  if ( $type !== $post_type ) continue;
224
  $type_settings = $settings;
242
  public function thumbnailDisplaySize($post_type)
243
  {
244
  $types = $this->enabled_post_types;
245
+ $type_settings = [];
246
  foreach ( $types as $type => $settings ){
247
  if ( $type !== $post_type ) continue;
248
  $type_settings = $settings;
343
  public function getTaxonomies($post_type, $hierarchical = true)
344
  {
345
  $taxonomy_names = get_object_taxonomies( $post_type );
346
+ $hierarchical_taxonomies = [];
347
+ $flat_taxonomies = [];
348
  foreach ( $taxonomy_names as $taxonomy_name ) {
349
  $taxonomy = get_taxonomy( $taxonomy_name );
350
  if ( !$taxonomy->show_ui )continue;
417
  */
418
  private function fieldsArray($results)
419
  {
420
+ $fields = [];
421
+ $exclude = ['_wp_page_template', '_edit_lock', '_edit_last', '_wp_trash_meta_status', '_wp_trash_meta_time', 'layout', 'position', 'rule', 'hide_on_screen', '_np_link_target', '_np_nav_title', '_np_title_attribute', '_np_nav_status', '_nested_pages_status', '_np_nav_css_classes'];
422
  foreach ( $results as $field ){
423
  if ( !in_array($field->meta_key, $exclude) )
424
  array_push($fields, $field->meta_key);
432
  public function getAssignedPages()
433
  {
434
  $post_types = $this->getPostTypesObject();
435
+ $array = [];
436
  foreach($post_types as $type => $options){
437
  if ( isset($options->page_assignment) && $options->page_assignment == 'true' && isset($options->page_assignment_id) && $options->page_assignment_id !== '' ) $array[$options->page_assignment_id] = $type;
438
  }
app/Entities/PostType/RegisterPostTypes.php CHANGED
@@ -17,7 +17,7 @@ class RegisterPostTypes
17
  {
18
  $this->integrations = new IntegrationFactory;
19
  if ( $this->integrations->plugins->wpml->installed ) return;
20
- add_action( 'init', array( $this, 'registerRedirects') );
21
  }
22
 
23
  /**
@@ -25,14 +25,14 @@ class RegisterPostTypes
25
  */
26
  public function registerRedirects()
27
  {
28
- $labels = array(
29
  'name' => __('Redirects', 'wp-nested-pages'),
30
  'singular_name' => __('Redirect', 'wp-nested-pages'),
31
  'add_new_item'=> 'Add Redirect',
32
  'edit_item' => 'Edit Redirect',
33
  'view_item' => 'View Redirect'
34
- );
35
- $args = array(
36
  'labels' => $labels,
37
  'public' => false,
38
  'show_ui' => false,
@@ -40,10 +40,10 @@ class RegisterPostTypes
40
  'capability_type' => 'post',
41
  'hierarchical' => true,
42
  'has_archive' => false,
43
- 'supports' => array('title','editor'),
44
  '_edit_link' => 'post.php?post=%d',
45
- 'rewrite' => array('slug' => 'np-redirect', 'with_front' => false)
46
- );
47
  register_post_type( 'np-redirect' , $args );
48
  }
49
  }
17
  {
18
  $this->integrations = new IntegrationFactory;
19
  if ( $this->integrations->plugins->wpml->installed ) return;
20
+ add_action( 'init', [ $this, 'registerRedirects'] );
21
  }
22
 
23
  /**
25
  */
26
  public function registerRedirects()
27
  {
28
+ $labels = [
29
  'name' => __('Redirects', 'wp-nested-pages'),
30
  'singular_name' => __('Redirect', 'wp-nested-pages'),
31
  'add_new_item'=> 'Add Redirect',
32
  'edit_item' => 'Edit Redirect',
33
  'view_item' => 'View Redirect'
34
+ ];
35
+ $args = [
36
  'labels' => $labels,
37
  'public' => false,
38
  'show_ui' => false,
40
  'capability_type' => 'post',
41
  'hierarchical' => true,
42
  'has_archive' => false,
43
+ 'supports' => ['title','editor'],
44
  '_edit_link' => 'post.php?post=%d',
45
+ 'rewrite' => ['slug' => 'np-redirect', 'with_front' => false]
46
+ ];
47
  register_post_type( 'np-redirect' , $args );
48
  }
49
  }
app/Entities/User/UserRepository.php CHANGED
@@ -47,14 +47,14 @@ class UserRepository
47
  global $wp_roles;
48
  $all_roles = $wp_roles->roles;
49
  $editable_roles = apply_filters('editable_roles', $all_roles);
50
- $roles = array();
51
- if ( !is_array($exclude) ) $exclude = array();
52
  foreach($editable_roles as $key=>$editable_role){
53
  if ( !in_array($editable_role['name'], $exclude) ){
54
- $role = array(
55
  'name' => $key,
56
  'label' => $editable_role['name']
57
- );
58
  array_push($roles, $role);
59
  }
60
  }
@@ -80,8 +80,8 @@ class UserRepository
80
  public function canSortPages()
81
  {
82
  $roles = $this->getRoles();
83
- $cansort = get_option('nestedpages_allowsorting', array());
84
- if ( $cansort == "" ) $cansort = array();
85
 
86
  foreach($roles as $role){
87
  if ( $role == 'administrator' ) return true;
@@ -97,9 +97,9 @@ class UserRepository
97
  */
98
  public function allUsers()
99
  {
100
- $users = get_users(array(
101
- 'fields' => array('ID', 'display_name')
102
- ));
103
  return $users;
104
  }
105
 
47
  global $wp_roles;
48
  $all_roles = $wp_roles->roles;
49
  $editable_roles = apply_filters('editable_roles', $all_roles);
50
+ $roles = [];
51
+ if ( !is_array($exclude) ) $exclude = [];
52
  foreach($editable_roles as $key=>$editable_role){
53
  if ( !in_array($editable_role['name'], $exclude) ){
54
+ $role = [
55
  'name' => $key,
56
  'label' => $editable_role['name']
57
+ ];
58
  array_push($roles, $role);
59
  }
60
  }
80
  public function canSortPages()
81
  {
82
  $roles = $this->getRoles();
83
+ $cansort = get_option('nestedpages_allowsorting', []);
84
+ if ( $cansort == "" ) $cansort = [];
85
 
86
  foreach($roles as $role){
87
  if ( $role == 'administrator' ) return true;
97
  */
98
  public function allUsers()
99
  {
100
+ $users = get_users([
101
+ 'fields' => ['ID', 'display_name']
102
+ ]);
103
  return $users;
104
  }
105
 
app/Form/Events.php CHANGED
@@ -28,7 +28,7 @@ class Events
28
  */
29
  public function registerEvents()
30
  {
31
- $this->actions = array(
32
  'wp_ajax_npsort',
33
  'wp_ajax_npquickEdit',
34
  'wp_ajax_npsyncMenu',
@@ -36,6 +36,7 @@ class Events
36
  'wp_ajax_npquickEditLink',
37
  'wp_ajax_npgetTaxonomies',
38
  'wp_ajax_npnewChild',
 
39
  'admin_post_npListingSort',
40
  'wp_ajax_npEmptyTrash',
41
  'admin_post_npSearch',
@@ -49,7 +50,7 @@ class Events
49
  'wp_ajax_nppostSearch',
50
  'wp_ajax_npWpmlTranslations',
51
  'wp_ajax_npresetSettings'
52
- );
53
  $this->setHandlers();
54
  }
55
 
28
  */
29
  public function registerEvents()
30
  {
31
+ $this->actions = [
32
  'wp_ajax_npsort',
33
  'wp_ajax_npquickEdit',
34
  'wp_ajax_npsyncMenu',
36
  'wp_ajax_npquickEditLink',
37
  'wp_ajax_npgetTaxonomies',
38
  'wp_ajax_npnewChild',
39
+ 'wp_ajax_npnewBeforeAfter',
40
  'admin_post_npListingSort',
41
  'wp_ajax_npEmptyTrash',
42
  'admin_post_npSearch',
50
  'wp_ajax_nppostSearch',
51
  'wp_ajax_npWpmlTranslations',
52
  'wp_ajax_npresetSettings'
53
+ ];
54
  $this->setHandlers();
55
  }
56
 
app/Form/Listeners/BaseHandler.php CHANGED
@@ -78,7 +78,7 @@ abstract class BaseHandler
78
  protected function setData()
79
  {
80
  $this->nonce = sanitize_text_field($_POST['nonce']);
81
- $data = array();
82
  foreach( $_POST as $key => $value ){
83
  $data[$key] = $value;
84
  }
@@ -91,7 +91,7 @@ abstract class BaseHandler
91
  protected function validateNonce()
92
  {
93
  if ( ! wp_verify_nonce( $this->nonce, 'nestedpages-nonce' ) ){
94
- $this->response = array( 'status' => 'error', 'message' => __('Incorrect Form Field', 'wp-nested-pages') );
95
  $this->sendResponse();
96
  die();
97
  }
@@ -125,10 +125,10 @@ abstract class BaseHandler
125
  */
126
  protected function sendErrorResponse()
127
  {
128
- $this->response = array(
129
  'status' => 'error',
130
  'message' => __('There was an error updating the page.', 'wp-nested-pages')
131
- );
132
  $this->sendResponse();
133
  }
134
 
@@ -137,10 +137,10 @@ abstract class BaseHandler
137
  */
138
  protected function exception($message)
139
  {
140
- return wp_send_json(array(
141
  'status' => 'error',
142
  'message' => $message
143
- ));
144
  }
145
 
146
  /**
78
  protected function setData()
79
  {
80
  $this->nonce = sanitize_text_field($_POST['nonce']);
81
+ $data = [];
82
  foreach( $_POST as $key => $value ){
83
  $data[$key] = $value;
84
  }
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
  }
125
  */
126
  protected function sendErrorResponse()
127
  {
128
+ $this->response = [
129
  'status' => 'error',
130
  'message' => __('There was an error updating the page.', 'wp-nested-pages')
131
+ ];
132
  $this->sendResponse();
133
  }
134
 
137
  */
138
  protected function exception($message)
139
  {
140
+ return wp_send_json([
141
  'status' => 'error',
142
  'message' => $message
143
+ ]);
144
  }
145
 
146
  /**
app/Form/Listeners/ClonePost.php CHANGED
@@ -32,7 +32,7 @@ class ClonePost extends BaseHandler
32
  private function setPostID()
33
  {
34
  if ( !isset($_POST['parent_id']) ){
35
- return $this->sendResponse(array('status' => 'error', 'message' => __('Post Not Found', 'nestedapges')));
36
  }
37
  $this->data['post_id'] = intval(sanitize_text_field($_POST['parent_id']));
38
  $this->data['status'] = sanitize_text_field($_POST['status']);
@@ -47,9 +47,9 @@ class ClonePost extends BaseHandler
47
  private function clonePost()
48
  {
49
  $new_posts = $this->cloner->clonePost($this->data['post_id'], $this->data['quantity'], $this->data['status'], $this->data['author']);
50
- return wp_send_json(array(
51
  'status' => 'success',
52
  'posts' => $this->post_repo->postArray($new_posts, $this->data['post_type'])
53
- ));
54
  }
55
  }
32
  private function setPostID()
33
  {
34
  if ( !isset($_POST['parent_id']) ){
35
+ return $this->sendResponse(['status' => 'error', 'message' => __('Post Not Found', 'nestedapges')]);
36
  }
37
  $this->data['post_id'] = intval(sanitize_text_field($_POST['parent_id']));
38
  $this->data['status'] = sanitize_text_field($_POST['status']);
47
  private function clonePost()
48
  {
49
  $new_posts = $this->cloner->clonePost($this->data['post_id'], $this->data['quantity'], $this->data['status'], $this->data['author']);
50
+ return wp_send_json([
51
  'status' => 'success',
52
  'posts' => $this->post_repo->postArray($new_posts, $this->data['post_type'])
53
+ ]);
54
  }
55
  }
app/Form/Listeners/EmptyTrash.php CHANGED
@@ -12,10 +12,10 @@ class EmptyTrash extends BaseHandler
12
  private function emptyTrash()
13
  {
14
  if ( $this->post_repo->emptyTrash($_POST['posttype']) ){
15
- return wp_send_json(array(
16
  'status'=>'success',
17
  'message'=> __('Trash successfully emptied.', 'wp-nested-pages')
18
- ));
19
  }
20
  $this->sendErrorResponse();
21
  }
12
  private function emptyTrash()
13
  {
14
  if ( $this->post_repo->emptyTrash($_POST['posttype']) ){
15
+ return wp_send_json([
16
  'status'=>'success',
17
  'message'=> __('Trash successfully emptied.', 'wp-nested-pages')
18
+ ]);
19
  }
20
  $this->sendErrorResponse();
21
  }
app/Form/Listeners/GetTaxonomies.php CHANGED
@@ -51,6 +51,6 @@ class GetTaxonomies extends BaseHandler
51
  */
52
  private function setResponse()
53
  {
54
- $this->response = array('status'=>'success', 'terms'=>$this->terms);
55
  }
56
  }
51
  */
52
  private function setResponse()
53
  {
54
+ $this->response = ['status'=>'success', 'terms'=>$this->terms];
55
  }
56
  }
app/Form/Listeners/ListingSort.php CHANGED
@@ -51,7 +51,7 @@ class ListingSort
51
  */
52
  private function setOrderBy()
53
  {
54
- $allowed = array('menu_order', 'date', 'title'); // prevent tomfoolery
55
  if ( isset($_POST['np_orderby']) && $_POST['np_orderby'] !== "" && in_array($_POST['np_orderby'], $allowed) ) $this->url .= '&orderby=' . sanitize_text_field($_POST['np_orderby']);
56
  }
57
 
@@ -60,7 +60,7 @@ class ListingSort
60
  */
61
  private function setOrder()
62
  {
63
- $allowed = array('ASC', 'DESC'); // prevent tomfoolery
64
  if ( isset($_POST['np_order']) && in_array($_POST['np_order'], $allowed) ) $this->url .= '&order=' . sanitize_text_field($_POST['np_order']);
65
  }
66
 
51
  */
52
  private function setOrderBy()
53
  {
54
+ $allowed = ['menu_order', 'date', 'title']; // prevent tomfoolery
55
  if ( isset($_POST['np_orderby']) && $_POST['np_orderby'] !== "" && in_array($_POST['np_orderby'], $allowed) ) $this->url .= '&orderby=' . sanitize_text_field($_POST['np_orderby']);
56
  }
57
 
60
  */
61
  private function setOrder()
62
  {
63
+ $allowed = ['ASC', 'DESC']; // prevent tomfoolery
64
  if ( isset($_POST['np_order']) && in_array($_POST['np_order'], $allowed) ) $this->url .= '&order=' . sanitize_text_field($_POST['np_order']);
65
  }
66
 
app/Form/Listeners/ManualMenuSync.php CHANGED
@@ -11,7 +11,7 @@ class ManualMenuSync extends BaseHandler
11
  {
12
  parent::__construct();
13
  $this->syncMenu();
14
- $this->response = array('status' => 'success');
15
  $this->sendResponse();
16
  }
17
  }
11
  {
12
  parent::__construct();
13
  $this->syncMenu();
14
+ $this->response = ['status' => 'success'];
15
  $this->sendResponse();
16
  }
17
  }
app/Form/Listeners/MenuSearch.php CHANGED
@@ -18,7 +18,7 @@ class MenuSearch extends BaseHandler
18
  parent::__construct();
19
  $this->setFormData();
20
  $this->search();
21
- return wp_send_json(array('status' => 'success', 'results' => $this->results));
22
  }
23
 
24
  /**
@@ -45,10 +45,10 @@ class MenuSearch extends BaseHandler
45
  */
46
  private function searchPosts()
47
  {
48
- $sq = new \WP_Query(array(
49
  'post_type' => $this->data['searchObject'],
50
  's' => $this->data['term']
51
- ));
52
  if ( $sq->have_posts() ) :
53
  $this->results = $sq->posts;
54
  $pt = get_post_type_object($this->data['searchObject']);
@@ -67,9 +67,9 @@ class MenuSearch extends BaseHandler
67
  */
68
  private function searchTaxonomies()
69
  {
70
- $terms = get_terms($this->data['searchObject'], array(
71
  'name__like' => $this->data['term']
72
- ));
73
  if ( $terms ){
74
  $this->results = $terms;
75
  foreach($terms as $key => $term){
18
  parent::__construct();
19
  $this->setFormData();
20
  $this->search();
21
+ return wp_send_json(['status' => 'success', 'results' => $this->results]);
22
  }
23
 
24
  /**
45
  */
46
  private function searchPosts()
47
  {
48
+ $sq = new \WP_Query([
49
  'post_type' => $this->data['searchObject'],
50
  's' => $this->data['term']
51
+ ]);
52
  if ( $sq->have_posts() ) :
53
  $this->results = $sq->posts;
54
  $pt = get_post_type_object($this->data['searchObject']);
67
  */
68
  private function searchTaxonomies()
69
  {
70
+ $terms = get_terms($this->data['searchObject'], [
71
  'name__like' => $this->data['term']
72
+ ]);
73
  if ( $terms ){
74
  $this->results = $terms;
75
  foreach($terms as $key => $term){
app/Form/Listeners/NestToggle.php CHANGED
@@ -31,7 +31,7 @@ class NestToggle extends BaseHandler
31
  private function updateUserMeta()
32
  {
33
  $this->user->updateVisiblePages($this->data['posttype'], $this->data['ids']);
34
- $this->response = array('status'=>'success', 'data'=>$this->data);
35
  $this->sendResponse();
36
  }
37
  }
31
  private function updateUserMeta()
32
  {
33
  $this->user->updateVisiblePages($this->data['posttype'], $this->data['ids']);
34
+ $this->response = ['status'=>'success', 'data'=>$this->data];
35
  $this->sendResponse();
36
  }
37
  }
app/Form/Listeners/NewBeforeAfter.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace NestedPages\Form\Listeners;
3
+
4
+ use NestedPages\Form\Validation\Validation;
5
+ use NestedPages\Entities\Post\PostFactory;
6
+
7
+ /**
8
+ * Adds posts before or after a specified post
9
+ * @return json response
10
+ */
11
+ class NewBeforeAfter extends BaseHandler
12
+ {
13
+ /**
14
+ * Post Factory
15
+ */
16
+ private $factory;
17
+
18
+ /**
19
+ * Validation
20
+ */
21
+ private $validation;
22
+
23
+ public function __construct()
24
+ {
25
+ parent::__construct();
26
+ $this->factory = new PostFactory;
27
+ $this->validation = new Validation;
28
+ $this->savePages();
29
+ $this->syncMenu();
30
+ $this->sendResponse();
31
+ }
32
+
33
+ /**
34
+ * Run Validation
35
+ */
36
+ private function validates()
37
+ {
38
+ return $this->validation->validateNewPages($this->data);
39
+ }
40
+
41
+ /**
42
+ * Save the new page(s)
43
+ */
44
+ private function savePages()
45
+ {
46
+ if ( $this->validates() ){
47
+ $this->data['new_pages'] = $this->factory->createBeforeAfterPosts($this->data);
48
+ $this->setResponse();
49
+ return;
50
+ }
51
+ $this->sendErrorResponse();
52
+ }
53
+
54
+ /**
55
+ * Set the Response
56
+ */
57
+ private function setResponse()
58
+ {
59
+ $this->response = [
60
+ 'status'=>'success',
61
+ 'new_pages' => $this->data['new_pages']
62
+ ];
63
+ }
64
+ }
app/Form/Listeners/NewChild.php CHANGED
@@ -56,9 +56,9 @@ class NewChild extends BaseHandler
56
  */
57
  private function setResponse()
58
  {
59
- $this->response = array(
60
  'status'=>'success',
61
  'new_pages' => $this->data['new_pages']
62
- );
63
  }
64
  }
56
  */
57
  private function setResponse()
58
  {
59
+ $this->response = [
60
  'status'=>'success',
61
  'new_pages' => $this->data['new_pages']
62
+ ];
63
  }
64
  }
app/Form/Listeners/NewMenuItem.php CHANGED
@@ -41,11 +41,11 @@ class NewMenuItem extends BaseHandler
41
  $this->data['post']['delete_link'] = get_delete_post_link($new_link, '', true);
42
  $this->addExtras($new_link);
43
 
44
- $this->response = array(
45
  'status' => 'success',
46
  'message' => __('Link successfully updated.', 'wp-nested-pages'),
47
  'post_data' => $this->data['post']
48
- );
49
  }
50
 
51
  /**
41
  $this->data['post']['delete_link'] = get_delete_post_link($new_link, '', true);
42
  $this->addExtras($new_link);
43
 
44
+ $this->response = [
45
  'status' => 'success',
46
  'message' => __('Link successfully updated.', 'wp-nested-pages'),
47
  'post_data' => $this->data['post']
48
+ ];
49
  }
50
 
51
  /**
app/Form/Listeners/PostSearch.php CHANGED
@@ -18,7 +18,7 @@ class PostSearch extends BaseHandler
18
  parent::__construct();
19
  $this->setFormData();
20
  $this->searchPosts();
21
- return wp_send_json(array('status' => 'success', 'results' => $this->results));
22
  }
23
 
24
  /**
@@ -35,11 +35,11 @@ class PostSearch extends BaseHandler
35
  */
36
  private function searchPosts()
37
  {
38
- $sq = new \WP_Query(array(
39
  'post_type' => $this->data['postType'],
40
  's' => $this->data['term'],
41
  'posts_per_page' => -1
42
- ));
43
  if ( $sq->have_posts() ) :
44
  $this->results = $sq->posts;
45
  else :
18
  parent::__construct();
19
  $this->setFormData();
20
  $this->searchPosts();
21
+ return wp_send_json(['status' => 'success', 'results' => $this->results]);
22
  }
23
 
24
  /**
35
  */
36
  private function searchPosts()
37
  {
38
+ $sq = new \WP_Query([
39
  'post_type' => $this->data['postType'],
40
  's' => $this->data['term'],
41
  'posts_per_page' => -1
42
+ ]);
43
  if ( $sq->have_posts() ) :
44
  $this->results = $sq->posts;
45
  else :
app/Form/Listeners/QuickEdit.php CHANGED
@@ -26,11 +26,11 @@ class QuickEdit extends BaseHandler
26
  if ( isset($this->data['tax_input']) ) $this->addFlatTaxonomies();
27
  if ( $this->integrations->plugins->wpml->installed ) $this->integrations->plugins->wpml->syncPosts($this->data['post_id']);
28
  $this->addData();
29
- $this->response = array(
30
  'status' => 'success',
31
- 'message' => __('Post successfully updated.'),
32
  'post_data' => $this->data
33
- );
34
  }
35
 
36
  /**
26
  if ( isset($this->data['tax_input']) ) $this->addFlatTaxonomies();
27
  if ( $this->integrations->plugins->wpml->installed ) $this->integrations->plugins->wpml->syncPosts($this->data['post_id']);
28
  $this->addData();
29
+ $this->response = [
30
  'status' => 'success',
31
+ 'message' => __('Post successfully updated.', 'wp-nested-pages'),
32
  'post_data' => $this->data
33
+ ];
34
  }
35
 
36
  /**
app/Form/Listeners/QuickEditLink.php CHANGED
@@ -23,11 +23,11 @@ class QuickEditLink extends BaseHandler
23
  $updated = $this->post_update_repo->updateRedirect($this->data);
24
  if ( !$updated ) $this->sendErrorResponse();
25
  $this->addData();
26
- $this->response = array(
27
  'status' => 'success',
28
  'message' => __('Link successfully updated.', 'wp-nested-pages'),
29
  'post_data' => $this->data
30
- );
31
  }
32
 
33
  /**
23
  $updated = $this->post_update_repo->updateRedirect($this->data);
24
  if ( !$updated ) $this->sendErrorResponse();
25
  $this->addData();
26
+ $this->response = [
27
  'status' => 'success',
28
  'message' => __('Link successfully updated.', 'wp-nested-pages'),
29
  'post_data' => $this->data
30
+ ];
31
  }
32
 
33
  /**
app/Form/Listeners/ResetSettings.php CHANGED
@@ -12,6 +12,6 @@ class ResetSettings extends BaseHandler
12
  private function reset()
13
  {
14
  $this->settings->resetSettings();
15
- return wp_send_json(array('status' => 'success'));
16
  }
17
  }
12
  private function reset()
13
  {
14
  $this->settings->resetSettings();
15
+ return wp_send_json(['status' => 'success']);
16
  }
17
  }
app/Form/Listeners/Sort.php CHANGED
@@ -27,9 +27,9 @@ class Sort extends BaseHandler
27
  $order = $this->post_update_repo->updateOrder($posts);
28
  if ( $order ){
29
  if ( $this->integrations->plugins->wpml->installed ) $this->integrations->plugins->wpml->syncPostOrder($posts);
30
- $this->response = array('status' => 'success', 'message' => __('Page order successfully updated.','wp-nested-pages') );
31
  } else {
32
- $this->response = array('status'=>'error', 'message'=> __('There was an error updating the page order.','wp-nested-pages') );
33
  }
34
  }
35
  }
27
  $order = $this->post_update_repo->updateOrder($posts);
28
  if ( $order ){
29
  if ( $this->integrations->plugins->wpml->installed ) $this->integrations->plugins->wpml->syncPostOrder($posts);
30
+ $this->response = ['status' => 'success', 'message' => __('Page order successfully updated.','wp-nested-pages') ];
31
  } else {
32
+ $this->response = ['status'=>'error', 'message'=> __('There was an error updating the page order.','wp-nested-pages') ];
33
  }
34
  }
35
  }
app/Form/Listeners/SyncMenu.php CHANGED
@@ -21,7 +21,7 @@ class SyncMenu extends BaseHandler
21
  {
22
  if ( $this->data['syncmenu'] == 'sync' ) return $this->sync();
23
  update_option('nestedpages_menusync', 'nosync');
24
- $this->response = array('status'=>'success', 'message'=> __('Menu sync disabled.'));
25
  }
26
 
27
  /**
@@ -31,6 +31,6 @@ class SyncMenu extends BaseHandler
31
  {
32
  update_option('nestedpages_menusync', 'sync');
33
  $this->syncMenu();
34
- $this->response = array('status'=>'success', 'message'=> __('Menu sync enabled.', 'wp-nested-pages'));
35
  }
36
  }
21
  {
22
  if ( $this->data['syncmenu'] == 'sync' ) return $this->sync();
23
  update_option('nestedpages_menusync', 'nosync');
24
+ $this->response = ['status'=>'success', 'message'=> __('Menu sync disabled.', 'wp-nested-pages')];
25
  }
26
 
27
  /**
31
  {
32
  update_option('nestedpages_menusync', 'sync');
33
  $this->syncMenu();
34
+ $this->response = ['status'=>'success', 'message'=> __('Menu sync enabled.', 'wp-nested-pages')];
35
  }
36
  }
app/Form/Listeners/WpmlTranslations.php CHANGED
@@ -35,7 +35,7 @@ class WpmlTranslations extends BaseHandler
35
  $this->exception(__('There are currently no translations for the selected post.', 'wp-nested-pages'));
36
  return;
37
  }
38
- return wp_send_json(array('status' => 'success', 'translations' => $this->translations));
39
  }
40
 
41
  /**
@@ -44,7 +44,7 @@ class WpmlTranslations extends BaseHandler
44
  private function setPostId()
45
  {
46
  if ( !isset($_POST['post_id']) ){
47
- return $this->sendResponse(array('status' => 'error', 'message' => __('Post Not Found', 'nestedapges')));
48
  }
49
  $this->data['post_id'] = intval(sanitize_text_field($_POST['post_id']));
50
  }
@@ -68,12 +68,12 @@ class WpmlTranslations extends BaseHandler
68
  foreach ( $all_languages as $lang_code => $lang )
69
  {
70
  $add_link = 'post-new.php?' . http_build_query (
71
- array(
72
  'lang' => $lang_code,
73
  'post_type' => get_post_type ( $this->data['post_id'] ),
74
  'trid' => $sitepress->get_element_trid($this->data['post_id']),
75
  'source_lang' => $current_language
76
- )
77
  );
78
  $all_languages[$lang_code]['add_link'] = $add_link;
79
  if ( array_key_exists($lang_code, $this->translations) ){
35
  $this->exception(__('There are currently no translations for the selected post.', 'wp-nested-pages'));
36
  return;
37
  }
38
+ return wp_send_json(['status' => 'success', 'translations' => $this->translations]);
39
  }
40
 
41
  /**
44
  private function setPostId()
45
  {
46
  if ( !isset($_POST['post_id']) ){
47
+ return $this->sendResponse(['status' => 'error', 'message' => __('Post Not Found', 'nestedapges')]);
48
  }
49
  $this->data['post_id'] = intval(sanitize_text_field($_POST['post_id']));
50
  }
68
  foreach ( $all_languages as $lang_code => $lang )
69
  {
70
  $add_link = 'post-new.php?' . http_build_query (
71
+ [
72
  'lang' => $lang_code,
73
  'post_type' => get_post_type ( $this->data['post_id'] ),
74
  'trid' => $sitepress->get_element_trid($this->data['post_id']),
75
  'source_lang' => $current_language
76
+ ]
77
  );
78
  $all_languages[$lang_code]['add_link'] = $add_link;
79
  if ( array_key_exists($lang_code, $this->translations) ){
app/Form/Validation/Validation.php CHANGED
@@ -26,7 +26,7 @@ class Validation
26
  foreach ($posts as $post)
27
  {
28
  if ( !is_numeric($post['id']) ){
29
- return wp_send_json(array('status'=>'error', 'message'=>'Incorrect Form Field'));
30
  }
31
  }
32
  }
@@ -39,7 +39,7 @@ class Validation
39
  foreach ( $items as $item )
40
  {
41
  if ( !is_numeric($item) ){
42
- return wp_send_json(array('status'=>'error', 'message'=>'Incorrect Form Field'));
43
  }
44
  }
45
  }
@@ -131,10 +131,10 @@ class Validation
131
  */
132
  private function sendDateError()
133
  {
134
- wp_send_json(array(
135
  'status' => 'error',
136
  'message' => __('Please provide a valid date.', 'wp-nested-pages')
137
- ));
138
  die();
139
  }
140
 
@@ -158,7 +158,7 @@ class Validation
158
  {
159
  if ( $var == "" ){
160
  $message = __('Please provide a ', 'wp-nested-pages') . $title;
161
- return wp_send_json(array('status' => 'error', 'message' => $message));
162
  die();
163
  }
164
  }
@@ -168,17 +168,31 @@ class Validation
168
  */
169
  public function validateNewPages($data)
170
  {
171
- // Check for Parent ID
172
- if ( (!isset($data['parent_id'])) || (!is_numeric($data['parent_id'])) ){
173
- $message = __('A valid parent page was not provided.', 'wp-nested-pages');
174
- return wp_send_json(array('status' => 'error', 'message' => $message));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  die();
176
  }
177
 
178
  // Make sure there's at least one page
179
  if ( !isset($data['post_title']) ){
180
  $message = __('Please provide at least one page title.', 'wp-nested-pages');
181
- return wp_send_json(array('status' => 'error', 'message' => $message));
182
  die();
183
  }
184
 
@@ -186,7 +200,7 @@ class Validation
186
  foreach ( $data['post_title'] as $title ){
187
  if ( $title == "" ){
188
  $message = __('Page titles cannot be blank.', 'wp-nested-pages');
189
- return wp_send_json(array('status' => 'error', 'message' => $message));
190
  die();
191
  }
192
  }
26
  foreach ($posts as $post)
27
  {
28
  if ( !is_numeric($post['id']) ){
29
+ return wp_send_json(['status'=>'error', 'message'=>'Incorrect Form Field']);
30
  }
31
  }
32
  }
39
  foreach ( $items as $item )
40
  {
41
  if ( !is_numeric($item) ){
42
+ return wp_send_json(['status'=>'error', 'message'=>'Incorrect Form Field']);
43
  }
44
  }
45
  }
131
  */
132
  private function sendDateError()
133
  {
134
+ wp_send_json([
135
  'status' => 'error',
136
  'message' => __('Please provide a valid date.', 'wp-nested-pages')
137
+ ]);
138
  die();
139
  }
140
 
158
  {
159
  if ( $var == "" ){
160
  $message = __('Please provide a ', 'wp-nested-pages') . $title;
161
+ return wp_send_json(['status' => 'error', 'message' => $message]);
162
  die();
163
  }
164
  }
168
  */
169
  public function validateNewPages($data)
170
  {
171
+ // Check for Parent ID or Before/After IDs
172
+ if ( !isset($data['before_id']) && !isset($data['after_id']) ){
173
+ if ( (!isset($data['parent_id'])) || (!is_numeric($data['parent_id'])) ){
174
+ $message = __('A valid parent page was not provided.', 'wp-nested-pages');
175
+ return wp_send_json(['status' => 'error', 'message' => $message]);
176
+ die();
177
+ }
178
+ }
179
+
180
+ if ( isset($data['before_id']) && $data['before_id'] !== '' && !is_numeric($data['before_id']) ){
181
+ $message = __('A valid parent page was not provided to insert before.', 'wp-nested-pages');
182
+ return wp_send_json(['status' => 'error', 'message' => $message, 'data' => $data]);
183
+ die();
184
+ }
185
+
186
+ if ( isset($data['after_id']) && $data['after_id'] !== '' && !is_numeric($data['after_id']) ){
187
+ $message = __('A valid parent page was not provided to insert after.', 'wp-nested-pages');
188
+ return wp_send_json(['status' => 'error', 'message' => $message, 'data' => $data]);
189
  die();
190
  }
191
 
192
  // Make sure there's at least one page
193
  if ( !isset($data['post_title']) ){
194
  $message = __('Please provide at least one page title.', 'wp-nested-pages');
195
+ return wp_send_json(['status' => 'error', 'message' => $message]);
196
  die();
197
  }
198
 
200
  foreach ( $data['post_title'] as $title ){
201
  if ( $title == "" ){
202
  $message = __('Page titles cannot be blank.', 'wp-nested-pages');
203
+ return wp_send_json(['status' => 'error', 'message' => $message, 'data' => $data]);
204
  die();
205
  }
206
  }
app/Helpers.php CHANGED
@@ -32,6 +32,14 @@ class Helpers
32
  return dirname(__FILE__) . '/Views/' . $file . '.php';
33
  }
34
 
 
 
 
 
 
 
 
 
35
  /**
36
  * Link to the default WP Pages listing
37
  * @since 1.2
32
  return dirname(__FILE__) . '/Views/' . $file . '.php';
33
  }
34
 
35
+ /**
36
+ * Asset
37
+ */
38
+ public static function asset($file)
39
+ {
40
+ return dirname(dirname(__FILE__)) . '/assets/' . $file;
41
+ }
42
+
43
  /**
44
  * Link to the default WP Pages listing
45
  * @since 1.2
app/NestedPages.php CHANGED
@@ -12,7 +12,7 @@ class NestedPages
12
  $np_env = 'live';
13
 
14
  global $np_version;
15
- $np_version = '2.0.4';
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.0.1';
16
 
17
  if ( is_admin() ) $app = new NestedPages\Bootstrap;
18
  if ( !is_admin() ) $app = new NestedPages\FrontEndBootstrap;
app/Redirects.php CHANGED
@@ -8,9 +8,9 @@ class Redirects
8
  {
9
  public function __construct()
10
  {
11
- add_action('load-edit.php', array($this, 'pageTrashed'));
12
- add_action('load-edit.php', array($this, 'pageRestored'));
13
- add_action('deleted_post', array($this, 'linkDeleted'), 10, 1);
14
  }
15
 
16
  /**
@@ -31,7 +31,7 @@ class Redirects
31
  'trashed' => true
32
  );
33
  if ( isset($_GET['ids']) ) $query_args['ids'] = urlencode($_GET['ids']);
34
- $redirect = add_query_arg(array('page'=>'nestedpages', 'trashed' => true ));
35
  wp_redirect($redirect);
36
  exit();
37
  }
@@ -50,7 +50,7 @@ class Redirects
50
  (!isset($_GET['bulk'])) &&
51
  $this->arePagesNested()
52
  ){
53
- $redirect = add_query_arg(array('page'=>'nestedpages', 'untrashed' => true, 'untrashed' => urlencode($_GET['untrashed']) ));
54
  wp_redirect($redirect);
55
  exit();
56
  }
@@ -68,7 +68,7 @@ class Redirects
68
  ($screen->id == 'np-redirect') &&
69
  $this->arePagesNested()
70
  ){
71
- $redirect = add_query_arg(array('page'=>'nestedpages', 'linkdeleted' => true, '_wpnonce' => false, 'post' => false, 'action'=>false));
72
  wp_redirect($redirect);
73
  exit();
74
  }
8
  {
9
  public function __construct()
10
  {
11
+ add_action('load-edit.php', [$this, 'pageTrashed']);
12
+ add_action('load-edit.php', [$this, 'pageRestored']);
13
+ add_action('deleted_post', [$this, 'linkDeleted'], 10, 1);
14
  }
15
 
16
  /**
31
  'trashed' => true
32
  );
33
  if ( isset($_GET['ids']) ) $query_args['ids'] = urlencode($_GET['ids']);
34
+ $redirect = add_query_arg(['page'=>'nestedpages', 'trashed' => true ]);
35
  wp_redirect($redirect);
36
  exit();
37
  }
50
  (!isset($_GET['bulk'])) &&
51
  $this->arePagesNested()
52
  ){
53
+ $redirect = add_query_arg(['page'=>'nestedpages', 'untrashed' => true, 'untrashed' => urlencode($_GET['untrashed']) ]);
54
  wp_redirect($redirect);
55
  exit();
56
  }
68
  ($screen->id == 'np-redirect') &&
69
  $this->arePagesNested()
70
  ){
71
+ $redirect = add_query_arg(['page'=>'nestedpages', 'linkdeleted' => true, '_wpnonce' => false, 'post' => false, 'action'=>false]);
72
  wp_redirect($redirect);
73
  exit();
74
  }
app/RedirectsFrontEnd.php CHANGED
@@ -8,8 +8,8 @@ class RedirectsFrontEnd
8
  {
9
  public function __construct()
10
  {
11
- add_filter('page_link', array($this, 'pageLinks'),10,2);
12
- add_action('parse_request', array($this, 'parseRequest'));
13
  }
14
 
15
  /**
@@ -50,18 +50,18 @@ class RedirectsFrontEnd
50
  $redirect = true;
51
  $parent_slug = substr($parent_slug, 0, -5);
52
  }
53
- $parent_args = array(
54
  'name' => sanitize_text_field($parent_slug),
55
  'posts_per_page' => 1
56
- );
57
  $parent_args['post_type'] = ( $redirect ) ? 'np-redirect' : 'any';
58
  $parent_post = get_posts($parent_args);
59
 
60
- $page_args = array(
61
  'name' => sanitize_text_field($slug),
62
  'post_type' => 'any',
63
  'posts_per_page' => 1
64
- );
65
  $page_args['post_parent'] = ( isset($parent_post) && $redirect ) ? $parent_post[0]->ID : null;
66
  $page = get_posts($page_args);
67
  if ( !$page ) return;
8
  {
9
  public function __construct()
10
  {
11
+ add_filter('page_link', [$this, 'pageLinks'],10,2);
12
+ add_action('parse_request', [$this, 'parseRequest']);
13
  }
14
 
15
  /**
50
  $redirect = true;
51
  $parent_slug = substr($parent_slug, 0, -5);
52
  }
53
+ $parent_args = [
54
  'name' => sanitize_text_field($parent_slug),
55
  'posts_per_page' => 1
56
+ ];
57
  $parent_args['post_type'] = ( $redirect ) ? 'np-redirect' : 'any';
58
  $parent_post = get_posts($parent_args);
59
 
60
+ $page_args = [
61
  'name' => sanitize_text_field($slug),
62
  'post_type' => 'any',
63
  'posts_per_page' => 1
64
+ ];
65
  $page_args['post_parent'] = ( isset($parent_post) && $redirect ) ? $parent_post[0]->ID : null;
66
  $page = get_posts($page_args);
67
  if ( !$page ) return;
app/Views/forms/bulk-add.php CHANGED
@@ -4,10 +4,7 @@
4
  * Populated via JS function
5
  */
6
  ?>
7
- <div class="np-modal fade nestedpages" id="np-bulk-modal">
8
- <div class="modal-dialog">
9
- <div class="modal-content">
10
- <div class="modal-body new-child"></div>
11
- </div><!-- /.modal-content -->
12
- </div><!-- /.modal-dialog -->
13
  </div><!-- /.modal -->
4
  * Populated via JS function
5
  */
6
  ?>
7
+ <div class="nestedpages-modal-backdrop" data-nestedpages-modal="np-bulk-modal"></div>
8
+ <div class="nestedpages-modal-content nestedpages" id="np-bulk-modal" data-nestedpages-modal="np-bulk-modal">
9
+ <div class="modal-body new-child"></div>
 
 
 
10
  </div><!-- /.modal -->
app/Views/forms/clone-form.php CHANGED
@@ -3,68 +3,72 @@
3
  * Modal Form for cloning posts
4
  */
5
  ?>
6
- <div class="np-modal fade nestedpages np-modal-form" id="np-clone-modal">
7
- <div class="modal-dialog">
8
- <div class="modal-content clone-modal">
9
- <h3><?php _e('Clone', 'wp-nested-pages'); ?> <span data-clone-parent></span></h3>
10
 
11
- <div class="modal-body">
 
12
 
13
- <div class="form-control">
14
- <label for="clone-quantity"><?php _e('Number of Copies', 'wp-nested-pages'); ?></label>
15
- <select id="clone-quantity" data-clone-quantity>
16
- <option value="1" selected="">1</option>
17
- <?php
18
- for ( $i = 2; $i < 11; $i++ ){
19
- echo '<option value="' . absint($i) . '">' . absint($i) . '</option>';
20
- }
21
- ?>
22
- </select>
23
- </div>
24
-
25
- <div class="form-control">
26
- <label><?php _e( 'Status' ); ?></label>
27
- <select name="_status" data-clone-status>
28
- <?php if ( $can_publish ) : ?>
29
- <option value="publish"><?php _e( 'Published' ); ?></option>
30
- <?php endif; ?>
31
- <option value="pending"><?php _e( 'Pending Review' ); ?></option>
32
- <option value="draft"><?php _e( 'Draft' ); ?></option>
33
- </select>
34
- </div>
35
 
36
- <?php
37
- $authors_dropdown = '';
38
- if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
39
- $users_opt = array(
40
- 'hide_if_only_one_author' => false,
41
- 'who' => 'authors',
42
- 'name' => 'post_author',
43
- 'id' => 'post_author',
44
- 'class'=> 'authors',
45
- 'multi' => 1,
46
- 'echo' => 0
47
- );
 
 
 
 
 
 
 
 
 
 
48
 
49
- if ( $authors = wp_dropdown_users( $users_opt ) ) :
50
- $authors_dropdown = '<div class="form-control" data-clone-author><label>' . __( 'Author' ) . '</label>';
51
- $authors_dropdown .= $authors;
52
- $authors_dropdown .= '</div>';
53
- endif;
54
- echo $authors_dropdown;
 
 
 
 
 
 
 
 
 
 
 
55
  endif;
56
- ?>
57
- </div><!-- .modal-body -->
 
 
 
58
 
59
- </div><!-- /.modal-content -->
60
  <div class="modal-footer">
61
- <button type="button" class="button modal-close" data-dismiss="modal">
62
- <?php _e('Cancel'); ?>
63
  </button>
64
  <a accesskey="s" class="button-primary alignright" data-confirm-clone>
65
  <?php _e( 'Clone', 'wp-nested-pages' ); ?>
66
  </a>
67
- <span class="np-qe-loading np-link-loading" data-clone-loading></span>
 
 
68
  </div>
69
- </div><!-- /.modal-dialog -->
 
70
  </div><!-- /.modal -->
3
  * Modal Form for cloning posts
4
  */
5
  ?>
6
+ <div class="nestedpages-modal-backdrop" data-nestedpages-modal="np-clone-modal"></div>
7
+ <div class="nestedpages-modal-content" id="np-clone-modal" data-nestedpages-modal="np-clone-modal">
 
 
8
 
9
+ <div class="modal-content clone-modal np-modal-form">
10
+ <h3><?php _e('Clone', 'wp-nested-pages'); ?> <span data-clone-parent></span></h3>
11
 
12
+ <div class="modal-body">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
+ <div class="form-control">
15
+ <label for="clone-quantity"><?php _e('Number of Copies', 'wp-nested-pages'); ?></label>
16
+ <select id="clone-quantity" data-clone-quantity>
17
+ <option value="1" selected="">1</option>
18
+ <?php
19
+ for ( $i = 2; $i < 11; $i++ ){
20
+ echo '<option value="' . absint($i) . '">' . absint($i) . '</option>';
21
+ }
22
+ ?>
23
+ </select>
24
+ </div>
25
+
26
+ <div class="form-control">
27
+ <label><?php _e( 'Status', 'wp-nested-pages' ); ?></label>
28
+ <select name="_status" data-clone-status>
29
+ <?php if ( $can_publish ) : ?>
30
+ <option value="publish"><?php _e( 'Published', 'wp-nested-pages' ); ?></option>
31
+ <?php endif; ?>
32
+ <option value="pending"><?php _e( 'Pending Review', 'wp-nested-pages' ); ?></option>
33
+ <option value="draft"><?php _e( 'Draft', 'wp-nested-pages' ); ?></option>
34
+ </select>
35
+ </div>
36
 
37
+ <?php
38
+ $authors_dropdown = '';
39
+ if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
40
+ $users_opt = [
41
+ 'hide_if_only_one_author' => false,
42
+ 'who' => 'authors',
43
+ 'name' => 'post_author',
44
+ 'id' => 'post_author',
45
+ 'class'=> 'authors',
46
+ 'multi' => 1,
47
+ 'echo' => 0
48
+ ];
49
+
50
+ if ( $authors = wp_dropdown_users( $users_opt ) ) :
51
+ $authors_dropdown = '<div class="form-control" data-clone-author><label>' . __( 'Author' ) . '</label>';
52
+ $authors_dropdown .= $authors;
53
+ $authors_dropdown .= '</div>';
54
  endif;
55
+ echo $authors_dropdown;
56
+ endif;
57
+ ?>
58
+ </div><!-- .modal-body -->
59
+
60
 
 
61
  <div class="modal-footer">
62
+ <button type="button" class="button modal-close" data-nestedpages-modal-close>
63
+ <?php _e('Cancel', 'wp-nested-pages'); ?>
64
  </button>
65
  <a accesskey="s" class="button-primary alignright" data-confirm-clone>
66
  <?php _e( 'Clone', 'wp-nested-pages' ); ?>
67
  </a>
68
+ <div class="np-qe-loading" data-clone-loading>
69
+ <?php include( NestedPages\Helpers::asset('images/spinner.svg') ); ?>
70
+ </div>
71
  </div>
72
+ </div><!-- .modal-content -->
73
+
74
  </div><!-- /.modal -->
app/Views/forms/delete-confirmation-modal.php CHANGED
@@ -3,14 +3,11 @@
3
  * Modal for confirming link delete
4
  */
5
  ?>
6
- <div class="np-modal fade np-trash-modal" id="np-delete-confirmation-modal">
7
- <div class="modal-dialog">
8
- <div class="modal-content">
9
- <div class="modal-body">
10
- <p data-np-link-delete-text></p>
11
- <a href="#" class="np-cancel-trash button modal-close" data-dismiss="modal"><?php _e('Cancel', 'wp-nested-pages'); ?></a>
12
- <a href="#" class="button-primary" data-delete-confirmation><?php _e('Delete', 'wp-nested-pages'); ?></a>
13
- </div>
14
- </div><!-- /.modal-content -->
15
- </div><!-- /.modal-dialog -->
16
  </div><!-- /.modal -->
3
  * Modal for confirming link delete
4
  */
5
  ?>
6
+ <div class="nestedpages-modal-backdrop" data-nestedpages-modal="np-delete-confirmation-modal"></div>
7
+ <div class="nestedpages-modal-content" id="np-trash-modal" data-nestedpages-modal="np-delete-confirmation-modal">
8
+ <div class="modal-body np-trash-modal">
9
+ <p data-np-link-delete-text></p>
10
+ <a href="#" class="np-cancel-trash button modal-close" data-nestedpages-modal-close><?php _e('Cancel', 'wp-nested-pages'); ?></a>
11
+ <a href="#" class="button-primary" data-delete-confirmation><?php _e('Delete', 'wp-nested-pages'); ?></a>
12
+ </div>
 
 
 
13
  </div><!-- /.modal -->
app/Views/forms/empty-trash-modal.php CHANGED
@@ -3,15 +3,12 @@
3
  * Modal for confirming trash empty
4
  */
5
  ?>
6
- <div class="np-modal fade np-trash-modal" id="np-trash-modal">
7
- <div class="modal-dialog">
8
- <div class="modal-content">
9
- <div class="modal-body">
10
- <p>Are you sure you would like to empty the trash? This action is not reversable.</p>
11
- <a href="#" class="np-cancel-trash button modal-close" data-dismiss="modal"><?php _e('Cancel', 'wp-nested-pages'); ?></a>
12
- <a href="#" class="np-trash-confirm button-primary"><?php _e('Empty Trash', 'wp-nested-pages'); ?></a>
13
- <input type="hidden" id="np-trash-posttype" value="<?php echo esc_attr($this->post_type->name); ?>">
14
- </div>
15
- </div><!-- /.modal-content -->
16
- </div><!-- /.modal-dialog -->
17
  </div><!-- /.modal -->
3
  * Modal for confirming trash empty
4
  */
5
  ?>
6
+ <div class="nestedpages-modal-backdrop" data-nestedpages-modal="np-trash-modal"></div>
7
+ <div class="nestedpages-modal-content" id="np-trash-modal" data-nestedpages-modal="np-trash-modal">
8
+ <div class="modal-body np-trash-modal">
9
+ <p><?php _e('Are you sure you would like to empty the trash? This action is not reversable.', 'wp-nested-pages'); ?></p>
10
+ <a href="#" class="np-cancel-trash button modal-close" data-nestedpages-modal-close><?php _e('Cancel', 'wp-nested-pages'); ?></a>
11
+ <a href="#" class="np-trash-confirm button-primary"><?php _e('Empty Trash', 'wp-nested-pages'); ?></a>
12
+ <input type="hidden" id="np-trash-posttype" value="<?php echo esc_attr($this->post_type->name); ?>">
13
+ </div>
 
 
 
14
  </div><!-- /.modal -->
app/Views/forms/link-form.php CHANGED
@@ -5,111 +5,119 @@
5
  $post_type_object = get_post_type_object( 'page' );
6
  $can_publish = current_user_can( $post_type_object->cap->publish_posts );
7
  ?>
8
- <div class="np-modal fade" id="np-link-modal">
9
- <div class="modal-dialog">
10
- <div class="modal-content">
11
-
12
- <div id="npmenuitems" class="np-tabbed-content" data-np-tab-pane>
13
- <form data-np-menu-item-form action="">
14
- <div class="modal-body np-menu-item-form">
15
- <div class="np-menu-type-selection">
16
- <ul data-np-menu-accordion>
17
 
18
- <li><a href="#" class="np-custom-link" data-np-menu-object="custom" data-np-menu-type="custom" data-np-menu-objectid="" data-np-permalink="" data-np-menu-selection><?php _e('Custom Link', 'wp-nested-pages'); ?></a></li>
 
 
 
 
 
 
19
 
20
- <?php
21
- // Post Types
22
- foreach ( $this->listing_repo->postTypes() as $name => $type ) {
23
- $recent_posts = $this->listing_repo->recentPosts($name);
24
- if ( !$recent_posts ) continue;
25
- $out = '<li><a href="#" data-np-menu-accordion-item>' . esc_html($type->labels->name) . '</a>';
26
- $out .= '<ul>';
27
- $out .= '<li class="np-menu-search"><input type="text" data-np-menu-search data-search-type="post_type" data-search-object="' . esc_attr($name) . '" placeholder="' . __('Search', 'wp-nested-pages') . ' ' . esc_attr($type->labels->name) . '" /><div class="np-menu-search-loading"></div><div class="np-menu-search-noresults">' . __('No Results', 'wp-nested-pages') . '</div></li>';
28
- foreach ( $recent_posts as $post ){
29
- $out .= '<li data-default-result><a href="#" data-np-menu-object="' . esc_attr($name) . '" data-np-menu-type="post_type" data-np-menu-objectid="' . esc_attr($post->ID) . '" data-np-permalink="' . get_the_permalink($post->ID) . '" data-np-object-name="' . esc_attr($type->labels->singular_name) . '" data-np-menu-selection>' . esc_html($post->post_title) . '</a></li>';
30
- }
31
- $out .= '</ul>';
32
- $out .= '</li>';
33
- echo $out;
 
 
 
 
 
34
  }
35
- ?>
36
-
37
- <?php
38
- // Taxonomies
39
- foreach ( $this->listing_repo->taxonomies() as $name => $taxonomy ) {
40
- $terms = $this->listing_repo->terms($name);
41
- if ( !$terms ) continue;
42
- $out = '<li><a href="#" data-np-menu-accordion-item>' . esc_html($taxonomy->labels->name) . '</a>';
43
- $out .= '<ul>';
44
- $out .= '<li class="np-menu-search"><input type="text" data-np-menu-search data-search-type="taxonomy" data-search-object="' . esc_attr($name) . '" placeholder="' . __('Search', 'wp-nested-pages') . ' ' . esc_attr($taxonomy->labels->name) . '" /><div class="np-menu-search-loading"></div><div class="np-menu-search-noresults">' . __('No Results', 'wp-nested-pages') . '</div></li>';
45
- foreach ( $terms as $term ){
46
- $out .= '<li data-default-result><a href="#" data-np-menu-object="' . esc_attr($name) . '" data-np-menu-type="taxonomy" data-np-menu-objectid="' . esc_attr($term->term_id) . '" data-np-permalink="' . esc_attr(get_term_link($term)) . '" data-np-object-name="' . esc_attr($taxonomy->labels->name) . '" data-np-menu-selection>' . esc_html($term->name) . '</a></li>';
47
- }
48
- $out .= '</ul>';
49
- $out .= '</li>';
50
- echo $out;
51
  }
52
- ?>
53
-
54
- </ul>
55
- </div><!-- .np-menu-type-selection -->
56
- <div class="np-menu-link-object">
57
- <div class="np-menu-link-object-placeholder">
58
- <?php _e('Select an item', 'wp-nested-pages'); ?>
59
- </div>
60
- <div class="np-menu-link-details" style="display:none;">
61
- <h3><span data-np-menu-title></span> <em></em></h3>
62
- <div class="original-link">
63
- <?php _e('Original', 'wp-nested-pages'); ?>: <span data-np-original-link></span>
64
- </div>
65
- <div class="np-quickedit-error" data-np-error style="clear:both;display:none;"></div>
66
- <div class="fields">
67
- <p data-np-menu-url-cont style="display:none;">
68
- <label><?php _e('URL', 'wp-nested-pages'); ?></label>
69
- <input type="text" name="url" data-np-menu-url />
70
- </p>
71
- <p>
72
- <label><?php _e('Navigation Label', 'wp-nested-pages'); ?></label>
73
- <input type="text" name="navigationLabel" data-np-menu-navigation-label />
74
- </p>
75
- <p>
76
- <label><?php _e('Title Attribute', 'wp-nested-pages'); ?></label>
77
- <input type="text" name="titleAttribute" data-np-menu-title-attr />
78
- </p>
79
- <p>
80
- <label><?php _e('CSS Classes (optional)', 'wp-nested-pages'); ?></label>
81
- <input type="text" name="cssClasses" data-np-menu-css-classes />
82
- </p>
83
- <?php if ( $this->user->canSortPages() ) : // Menu Options Button ?>
84
- <label class="checkbox">
85
- <input type="checkbox" name="linkTarget" class="link_target" data-np-menu-link-target />
86
- <span class="checkbox-title"><?php _e( 'Open link in a new window/tab' ); ?></span>
87
- </label>
88
- <?php endif; ?>
89
- </div><!-- .fields -->
90
- </div><!-- .np-menu-link-details -->
91
  </div>
92
- </div><!-- .modal-body -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
 
94
- <div class="modal-footer">
95
- <input type="hidden" name="menuTitle" data-np-menu-title value="">
96
- <input type="hidden" name="objectType" data-np-menu-object-input value="">
97
- <input type="hidden" name="objectId" data-np-menu-objectid-input value="">
98
- <input type="hidden" name="menuType" data-np-menu-type-input value="">
99
- <input type="hidden" name="parent_id" class="parent_id" value="">
100
- <button type="button" class="button modal-close" data-dismiss="modal">
101
- <?php _e('Cancel'); ?>
102
- </button>
103
 
104
- <a accesskey="s" class="button-primary" data-np-save-link style="display:none;float:right;">
105
- <?php _e( 'Add', 'wp-nested-pages' ); ?>
106
- </a>
107
- <span class="np-qe-loading"></span>
 
 
108
 
109
- </div><!-- .modal-footer -->
110
- </form>
111
- </div><!-- #npmenuitems -->
112
-
113
- </div><!-- /.modal-content -->
114
- </div><!-- /.modal-dialog -->
115
  </div><!-- /.modal -->
5
  $post_type_object = get_post_type_object( 'page' );
6
  $can_publish = current_user_can( $post_type_object->cap->publish_posts );
7
  ?>
8
+ <div class="nestedpages-modal-backdrop" data-nestedpages-modal="np-link-modal"></div>
9
+ <div class="nestedpages-modal-content" id="np-link-modal" data-nestedpages-modal="np-link-modal">
 
 
 
 
 
 
 
10
 
11
+ <div class="modal-content">
12
+
13
+ <div id="npmenuitems" class="np-tabbed-content" data-np-tab-pane>
14
+ <form data-np-menu-item-form action="">
15
+ <div class="modal-body np-menu-item-form">
16
+ <div class="np-menu-type-selection">
17
+ <ul data-np-menu-accordion>
18
 
19
+ <li><a href="#" class="np-custom-link" data-np-menu-object="custom" data-np-menu-type="custom" data-np-menu-objectid="" data-np-permalink="" data-np-menu-selection><?php _e('Custom Link', 'wp-nested-pages'); ?></a></li>
20
+
21
+ <?php
22
+ // Post Types
23
+ foreach ( $this->listing_repo->postTypes() as $name => $type ) {
24
+ $recent_posts = $this->listing_repo->recentPosts($name);
25
+ if ( !$recent_posts ) continue;
26
+ $out = '<li><a href="#" data-np-menu-accordion-item>' . esc_html($type->labels->name) . '</a>';
27
+ $out .= '<ul>';
28
+ $out .= '<li class="np-menu-search"><input type="text" data-np-menu-search data-search-type="post_type" data-search-object="' . esc_attr($name) . '" placeholder="' . __('Search', 'wp-nested-pages') . ' ' . esc_attr($type->labels->name) . '" />';
29
+ $out .= '<div class="np-default-loading np-menu-search-loading">';
30
+ ob_start();
31
+ include( NestedPages\Helpers::asset('images/spinner.svg') );
32
+ $out .= ob_get_contents();
33
+ ob_end_clean();
34
+ $out .= '</div>';
35
+ $out .= '<div class="np-menu-search-noresults">' . __('No Results', 'wp-nested-pages') . '</div></li>';
36
+ foreach ( $recent_posts as $post ){
37
+ $out .= '<li data-default-result><a href="#" data-np-menu-object="' . esc_attr($name) . '" data-np-menu-type="post_type" data-np-menu-objectid="' . esc_attr($post->ID) . '" data-np-permalink="' . get_the_permalink($post->ID) . '" data-np-object-name="' . esc_attr($type->labels->singular_name) . '" data-np-menu-selection>' . esc_html($post->post_title) . '</a></li>';
38
  }
39
+ $out .= '</ul>';
40
+ $out .= '</li>';
41
+ echo $out;
42
+ }
43
+ ?>
44
+
45
+ <?php
46
+ // Taxonomies
47
+ foreach ( $this->listing_repo->taxonomies() as $name => $taxonomy ) {
48
+ $terms = $this->listing_repo->terms($name);
49
+ if ( !$terms ) continue;
50
+ $out = '<li><a href="#" data-np-menu-accordion-item>' . esc_html($taxonomy->labels->name) . '</a>';
51
+ $out .= '<ul>';
52
+ $out .= '<li class="np-menu-search"><input type="text" data-np-menu-search data-search-type="taxonomy" data-search-object="' . esc_attr($name) . '" placeholder="' . __('Search', 'wp-nested-pages') . ' ' . esc_attr($taxonomy->labels->name) . '" /><div class="np-menu-search-loading"></div><div class="np-menu-search-noresults">' . __('No Results', 'wp-nested-pages') . '</div></li>';
53
+ foreach ( $terms as $term ){
54
+ $out .= '<li data-default-result><a href="#" data-np-menu-object="' . esc_attr($name) . '" data-np-menu-type="taxonomy" data-np-menu-objectid="' . esc_attr($term->term_id) . '" data-np-permalink="' . esc_attr(get_term_link($term)) . '" data-np-object-name="' . esc_attr($taxonomy->labels->name) . '" data-np-menu-selection>' . esc_html($term->name) . '</a></li>';
55
  }
56
+ $out .= '</ul>';
57
+ $out .= '</li>';
58
+ echo $out;
59
+ }
60
+ ?>
61
+
62
+ </ul>
63
+ </div><!-- .np-menu-type-selection -->
64
+ <div class="np-menu-link-object">
65
+ <div class="np-menu-link-object-placeholder">
66
+ <?php _e('Select an item', 'wp-nested-pages'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  </div>
68
+ <div class="np-menu-link-details" style="display:none;">
69
+ <h3><span data-np-menu-title></span> <em></em></h3>
70
+ <div class="original-link">
71
+ <?php _e('Original', 'wp-nested-pages'); ?>: <span data-np-original-link></span>
72
+ </div>
73
+ <div class="np-quickedit-error" data-np-error style="clear:both;display:none;"></div>
74
+ <div class="fields">
75
+ <p data-np-menu-url-cont style="display:none;">
76
+ <label><?php _e('URL', 'wp-nested-pages'); ?></label>
77
+ <input type="text" name="url" data-np-menu-url />
78
+ </p>
79
+ <p>
80
+ <label><?php _e('Navigation Label', 'wp-nested-pages'); ?></label>
81
+ <input type="text" name="navigationLabel" data-np-menu-navigation-label />
82
+ </p>
83
+ <p>
84
+ <label><?php _e('Title Attribute', 'wp-nested-pages'); ?></label>
85
+ <input type="text" name="titleAttribute" data-np-menu-title-attr />
86
+ </p>
87
+ <p>
88
+ <label><?php _e('CSS Classes (optional)', 'wp-nested-pages'); ?></label>
89
+ <input type="text" name="cssClasses" data-np-menu-css-classes />
90
+ </p>
91
+ <?php if ( $this->user->canSortPages() ) : // Menu Options Button ?>
92
+ <label class="checkbox">
93
+ <input type="checkbox" name="linkTarget" class="link_target" data-np-menu-link-target />
94
+ <span class="checkbox-title"><?php _e( 'Open link in a new window/tab' ); ?></span>
95
+ </label>
96
+ <?php endif; ?>
97
+ </div><!-- .fields -->
98
+ </div><!-- .np-menu-link-details -->
99
+ </div>
100
+ </div><!-- .modal-body -->
101
 
102
+ <div class="modal-footer">
103
+ <input type="hidden" name="menuTitle" data-np-menu-title value="">
104
+ <input type="hidden" name="objectType" data-np-menu-object-input value="">
105
+ <input type="hidden" name="objectId" data-np-menu-objectid-input value="">
106
+ <input type="hidden" name="menuType" data-np-menu-type-input value="">
107
+ <input type="hidden" name="parent_id" class="parent_id" value="">
108
+ <button type="button" class="button modal-close" data-nestedpages-modal-close>
109
+ <?php _e('Cancel', 'wp-nested-pages'); ?>
110
+ </button>
111
 
112
+ <a accesskey="s" class="button-primary" data-np-save-link style="display:none;float:right;">
113
+ <?php _e( 'Add', 'wp-nested-pages' ); ?>
114
+ </a>
115
+ <div class="np-qe-loading">
116
+ <?php include( NestedPages\Helpers::asset('images/spinner.svg') ); ?>
117
+ </div>
118
 
119
+ </div><!-- .modal-footer -->
120
+ </form>
121
+ </div><!-- #npmenuitems -->
122
+
 
 
123
  </div><!-- /.modal -->
app/Views/forms/more-options-modal.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
- /**
3
- * Modal with additional options for posts
4
- */
5
- ?>
6
- <div class="np-modal fade np-trash-modal" id="np-more-options-modal">
7
- <div class="modal-dialog">
8
- <div class="modal-content">
9
- <div class="modal-body">
10
-
11
- </div>
12
- </div><!-- /.modal-content -->
13
- </div><!-- /.modal-dialog -->
14
- </div><!-- /.modal -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/Views/forms/new-child.php CHANGED
@@ -4,7 +4,7 @@
4
  ?>
5
  <form method="get" action="" class="np-new-child-form">
6
  <div class="form-interior">
7
- <h3><strong><?php _e('Add Child', 'wp-nested-pages'); ?></strong><span class="parent_name"></span></h3>
8
 
9
  <div class="np-quickedit-error" style="clear:both;display:none;"></div>
10
 
@@ -14,7 +14,7 @@
14
 
15
  <ol class="new-page-titles">
16
  <li>
17
- <i class="handle np-icon-menu"></i>
18
  <div class="form-control new-child-row">
19
  <label><?php _e( 'Title' ); ?></label>
20
  <div>
@@ -47,7 +47,7 @@
47
  */
48
  $authors_dropdown = '';
49
  if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
50
- $users_opt = array(
51
  'hide_if_only_one_author' => false,
52
  'who' => 'authors',
53
  'name' => 'post_author',
@@ -56,7 +56,7 @@
56
  'multi' => 1,
57
  'echo' => 0,
58
  'selected' => get_current_user_id()
59
- );
60
 
61
  if ( $authors = wp_dropdown_users( $users_opt ) ) :
62
  $authors_dropdown = '<div class="form-control np_author"><label>' . __( 'Author' ) . '</label>';
@@ -95,8 +95,10 @@
95
 
96
  <div class="buttons">
97
  <input type="hidden" name="parent_id" class="page_parent_id" />
 
 
98
  <input type="hidden" name="post_type" value="<?php echo $this->post_type->name; ?>" />
99
- <a accesskey="c" href="#" class="button-secondary alignleft np-cancel-newchild">
100
  <?php _e( 'Cancel' ); ?>
101
  </a>
102
  <a accesskey="s" href="#" class="button-primary np-save-newchild alignright" style="margin-left:10px;">
@@ -105,6 +107,8 @@
105
  <a href="#" class="button-secondary np-save-newchild add-edit alignright">
106
  <?php _e( 'Add & Edit', 'wp-nested-pages' ); ?>
107
  </a>
108
- <span class="np-qe-loading"></span>
 
 
109
  </div>
110
  </form>
4
  ?>
5
  <form method="get" action="" class="np-new-child-form">
6
  <div class="form-interior">
7
+ <h3 data-new-post-relation-title><strong><?php _e('Add Child', 'wp-nested-pages'); ?></strong><span class="parent_name"></span></h3>
8
 
9
  <div class="np-quickedit-error" style="clear:both;display:none;"></div>
10
 
14
 
15
  <ol class="new-page-titles">
16
  <li>
17
+ <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>
18
  <div class="form-control new-child-row">
19
  <label><?php _e( 'Title' ); ?></label>
20
  <div>
47
  */
48
  $authors_dropdown = '';
49
  if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
50
+ $users_opt = [
51
  'hide_if_only_one_author' => false,
52
  'who' => 'authors',
53
  'name' => 'post_author',
56
  'multi' => 1,
57
  'echo' => 0,
58
  'selected' => get_current_user_id()
59
+ ];
60
 
61
  if ( $authors = wp_dropdown_users( $users_opt ) ) :
62
  $authors_dropdown = '<div class="form-control np_author"><label>' . __( 'Author' ) . '</label>';
95
 
96
  <div class="buttons">
97
  <input type="hidden" name="parent_id" class="page_parent_id" />
98
+ <input type="hidden" name="before_id" class="page_before_id" />
99
+ <input type="hidden" name="after_id" class="page_after_id" />
100
  <input type="hidden" name="post_type" value="<?php echo $this->post_type->name; ?>" />
101
+ <a accesskey="c" href="#" class="button-secondary alignleft np-cancel-newchild" data-nestedpages-modal-close>
102
  <?php _e( 'Cancel' ); ?>
103
  </a>
104
  <a accesskey="s" href="#" class="button-primary np-save-newchild alignright" style="margin-left:10px;">
107
  <a href="#" class="button-secondary np-save-newchild add-edit alignright">
108
  <?php _e( 'Add & Edit', 'wp-nested-pages' ); ?>
109
  </a>
110
+ <div class="np-qe-loading">
111
+ <?php include( NestedPages\Helpers::asset('images/spinner.svg') ); ?>
112
+ </div>
113
  </div>
114
  </form>
app/Views/forms/quickedit-link.php CHANGED
@@ -86,6 +86,8 @@
86
  <a accesskey="s" href="#inline-edit" class="button-primary np-save-quickedit-redirect alignright">
87
  <?php _e( 'Update' ); ?>
88
  </a>
89
- <span class="np-qe-loading"></span>
 
 
90
  </div>
91
  </form>
86
  <a accesskey="s" href="#inline-edit" class="button-primary np-save-quickedit-redirect alignright">
87
  <?php _e( 'Update' ); ?>
88
  </a>
89
+ <div class="np-qe-loading">
90
+ <?php include( NestedPages\Helpers::asset('images/spinner.svg') ); ?>
91
+ </div>
92
  </div>
93
  </form>
app/Views/forms/quickedit-post.php CHANGED
@@ -11,7 +11,7 @@
11
 
12
  <form method="get" action="">
13
  <div class="form-interior">
14
- <h3><?php _e('Quick Edit'); ?><span class="page_id"></span></h3>
15
 
16
  <div class="np-quickedit-error" style="clear:both;display:none;"></div>
17
 
@@ -65,7 +65,7 @@
65
  if ( !array_key_exists('author', $this->disabled_standard_fields) ) :
66
  $authors_dropdown = '';
67
  if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
68
- $users_opt = array(
69
  'hide_if_only_one_author' => false,
70
  'who' => 'authors',
71
  'name' => 'post_author',
@@ -73,7 +73,7 @@
73
  'class'=> 'authors',
74
  'multi' => 1,
75
  'echo' => 0
76
- );
77
 
78
  if ( $authors = wp_dropdown_users( $users_opt ) ) :
79
  $authors_dropdown = '<div class="form-control np_author"><label>' . __( 'Author' ) . '</label>';
@@ -247,6 +247,8 @@
247
  <a accesskey="s" href="#inline-edit" class="button-primary np-save-quickedit alignright">
248
  <?php _e( 'Update' ); ?>
249
  </a>
250
- <span class="np-qe-loading"></span>
 
 
251
  </div>
252
  </form>
11
 
12
  <form method="get" action="">
13
  <div class="form-interior">
14
+ <h3><?php _e('Quick Edit', 'wp-nested-pages'); ?><span class="page_id"></span></h3>
15
 
16
  <div class="np-quickedit-error" style="clear:both;display:none;"></div>
17
 
65
  if ( !array_key_exists('author', $this->disabled_standard_fields) ) :
66
  $authors_dropdown = '';
67
  if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
68
+ $users_opt = [
69
  'hide_if_only_one_author' => false,
70
  'who' => 'authors',
71
  'name' => 'post_author',
73
  'class'=> 'authors',
74
  'multi' => 1,
75
  'echo' => 0
76
+ ];
77
 
78
  if ( $authors = wp_dropdown_users( $users_opt ) ) :
79
  $authors_dropdown = '<div class="form-control np_author"><label>' . __( 'Author' ) . '</label>';
247
  <a accesskey="s" href="#inline-edit" class="button-primary np-save-quickedit alignright">
248
  <?php _e( 'Update' ); ?>
249
  </a>
250
+ <div class="np-qe-loading">
251
+ <?php include( NestedPages\Helpers::asset('images/spinner.svg') ); ?>
252
+ </div>
253
  </div>
254
  </form>
app/Views/listing.php CHANGED
@@ -3,38 +3,33 @@ $wpml_pages = ( $this->integrations->plugins->wpml->installed && $this->integrat
3
  if ( !$this->integrations->plugins->wpml->installed ) $wpml_pages = true;
4
  ?>
5
  <div class="wrap nestedpages">
6
- <h2 class="nestedpages-listing-title">
7
- <?php esc_html_e($this->post_type->labels->name); ?>
8
-
9
- <a href="<?php echo $this->post_type_repo->addNewPostLink($this->post_type->name); ?>" class="add-new-h2">
 
 
10
  <?php esc_html_e($this->post_type->labels->add_new); ?>
11
  </a>
12
 
13
  <?php if ( current_user_can('publish_pages') && !$this->listing_repo->isSearch() && $wpml_pages ) : ?>
14
- <a href="#" class="add-new-h2 open-bulk-modal" title="<?php _e('Add Multiple', 'wp-nested-pages'); ?>" data-parentid="0">
15
  <?php esc_html_e('Add Multiple', 'wp-nested-pages'); ?>
16
  </a>
17
  <?php endif; ?>
18
 
19
- <?php if ( current_user_can('publish_pages') && $this->post_type->name == 'page' && !$this->listing_repo->isSearch() && !$this->settings->menusDisabled() && !$this->integrations->plugins->wpml->installed ) : ?>
20
- <a href="#" class="add-new-h2 open-redirect-modal" title="<?php _e('Add Link', 'wp-nested-pages'); ?>" data-parentid="0">
21
  <?php esc_html_e('Add Link', 'wp-nested-pages'); ?>
22
  </a>
23
  <?php endif; ?>
24
- </h2>
25
 
26
- <?php if ( $this->confirmation->getMessage() ) : ?>
27
- <div id="message" class="updated notice is-dismissible"><p><?php echo $this->confirmation->getMessage(); ?></p><button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php esc_html_e('Dismiss this notice.', 'wp-nested-pages'); ?></span></button></div>
28
- <?php endif; ?>
29
-
30
- <div data-nestedpages-error class="updated error notice is-dismissible" style="display:none;"><p></p><button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php esc_html_e('Dismiss this notice.', 'wp-nested-pages'); ?></span></button></div>
31
-
32
- <div class="nestedpages-top-toggles">
33
  <?php if ( $this->post_type->hierarchical && !$this->listing_repo->isSearch() ) : ?>
34
  <a href="#" class="np-btn nestedpages-toggleall" data-toggle="closed"><?php esc_html_e('Expand All', 'wp-nested-pages'); ?></a>
35
  <?php endif; ?>
36
 
37
- <?php if ( $this->user->canSortPages() && !$this->listing_repo->isSearch() && !$this->listing_repo->isFiltered() ) : ?>
38
  <div class="np-sync-menu-cont" <?php if ( $this->confirmation->getMessage() ) echo 'style="margin-top:2px;"';?>>
39
 
40
  <?php if ( $this->settings->autoPageOrderDisabled() ) : ?>
@@ -72,9 +67,19 @@ if ( !$this->integrations->plugins->wpml->installed ) $wpml_pages = true;
72
  </div>
73
  <?php endif; ?>
74
 
75
- <img src="<?php echo NestedPages\Helpers::plugin_url(); ?>/assets/images/spinner-2x.gif" alt="loading" id="nested-loading" />
 
 
76
  </div><!-- .nestedpages-top-toggles -->
77
 
 
 
 
 
 
 
 
 
78
  <?php include(NestedPages\Helpers::view('partials/tool-list')); ?>
79
 
80
  <div id="np-error" class="updated error" style="clear:both;display:none;"></div>
@@ -91,7 +96,9 @@ if ( !$this->integrations->plugins->wpml->installed ) $wpml_pages = true;
91
  <div class="quick-edit quick-edit-form-redirect np-inline-modal" style="display:none;">
92
  <?php include( NestedPages\Helpers::view('forms/quickedit-link') ); ?>
93
  </div>
 
94
 
 
95
  <div class="new-child new-child-form np-inline-modal" style="display:none;">
96
  <?php include( NestedPages\Helpers::view('forms/new-child') ); ?>
97
  </div>
@@ -101,7 +108,6 @@ if ( !$this->integrations->plugins->wpml->installed ) $wpml_pages = true;
101
  </div><!-- .wrap -->
102
 
103
  <?php
104
- include( NestedPages\Helpers::view('forms/more-options-modal') );
105
  include( NestedPages\Helpers::view('forms/empty-trash-modal') );
106
  include( NestedPages\Helpers::view('forms/clone-form') );
107
  if ( !$this->integrations->plugins->wpml->installed) include( NestedPages\Helpers::view('forms/link-form') );
3
  if ( !$this->integrations->plugins->wpml->installed ) $wpml_pages = true;
4
  ?>
5
  <div class="wrap nestedpages">
6
+ <div class="nestedpages-listing-title">
7
+ <h1 class="wp-heading-inline">
8
+ <?php esc_html_e($this->post_type->labels->name); ?>
9
+ </h1>
10
+
11
+ <a href="<?php echo $this->post_type_repo->addNewPostLink($this->post_type->name); ?>" class="page-title-action">
12
  <?php esc_html_e($this->post_type->labels->add_new); ?>
13
  </a>
14
 
15
  <?php if ( current_user_can('publish_pages') && !$this->listing_repo->isSearch() && $wpml_pages ) : ?>
16
+ <a href="#" class="open-bulk-modal page-title-action" title="<?php _e('Add Multiple', 'wp-nested-pages'); ?>" data-parentid="0" data-nestedpages-modal-toggle="np-bulk-modal">
17
  <?php esc_html_e('Add Multiple', 'wp-nested-pages'); ?>
18
  </a>
19
  <?php endif; ?>
20
 
21
+ <?php if ( current_user_can('publish_pages') && $this->post_type->name == 'page' && !$this->listing_repo->isSearch() && !$this->listing_repo->isOrdered($this->post_type->name) && !$this->settings->menusDisabled() && !$this->integrations->plugins->wpml->installed ) : ?>
22
+ <a href="#" class="open-redirect-modal page-title-action" title="<?php _e('Add Link', 'wp-nested-pages'); ?>" data-parentid="0">
23
  <?php esc_html_e('Add Link', 'wp-nested-pages'); ?>
24
  </a>
25
  <?php endif; ?>
 
26
 
27
+ <div class="nestedpages-top-toggles">
 
 
 
 
 
 
28
  <?php if ( $this->post_type->hierarchical && !$this->listing_repo->isSearch() ) : ?>
29
  <a href="#" class="np-btn nestedpages-toggleall" data-toggle="closed"><?php esc_html_e('Expand All', 'wp-nested-pages'); ?></a>
30
  <?php endif; ?>
31
 
32
+ <?php if ( $this->user->canSortPages() && !$this->listing_repo->isSearch() && !$this->listing_repo->isFiltered() && !$this->listing_repo->isOrdered($this->post_type->name) ) : ?>
33
  <div class="np-sync-menu-cont" <?php if ( $this->confirmation->getMessage() ) echo 'style="margin-top:2px;"';?>>
34
 
35
  <?php if ( $this->settings->autoPageOrderDisabled() ) : ?>
67
  </div>
68
  <?php endif; ?>
69
 
70
+ <div id="nested-loading">
71
+ <?php include( NestedPages\Helpers::asset('images/spinner.svg') ); ?>
72
+ </div>
73
  </div><!-- .nestedpages-top-toggles -->
74
 
75
+ </div><!-- .nestedpages-listing-title -->
76
+
77
+ <?php if ( $this->confirmation->getMessage() ) : ?>
78
+ <div id="message" class="updated notice is-dismissible"><p><?php echo $this->confirmation->getMessage(); ?></p><button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php esc_html_e('Dismiss this notice.', 'wp-nested-pages'); ?></span></button></div>
79
+ <?php endif; ?>
80
+
81
+ <div data-nestedpages-error class="updated error notice is-dismissible" style="display:none;"><p></p><button type="button" class="notice-dismiss"><span class="screen-reader-text"><?php esc_html_e('Dismiss this notice.', 'wp-nested-pages'); ?></span></button></div>
82
+
83
  <?php include(NestedPages\Helpers::view('partials/tool-list')); ?>
84
 
85
  <div id="np-error" class="updated error" style="clear:both;display:none;"></div>
96
  <div class="quick-edit quick-edit-form-redirect np-inline-modal" style="display:none;">
97
  <?php include( NestedPages\Helpers::view('forms/quickedit-link') ); ?>
98
  </div>
99
+ <?php endif; ?>
100
 
101
+ <?php if ( current_user_can('publish_pages') ) : ?>
102
  <div class="new-child new-child-form np-inline-modal" style="display:none;">
103
  <?php include( NestedPages\Helpers::view('forms/new-child') ); ?>
104
  </div>
108
  </div><!-- .wrap -->
109
 
110
  <?php
 
111
  include( NestedPages\Helpers::view('forms/empty-trash-modal') );
112
  include( NestedPages\Helpers::view('forms/clone-form') );
113
  if ( !$this->integrations->plugins->wpml->installed) include( NestedPages\Helpers::view('forms/link-form') );
app/Views/partials/bulk-edit.php CHANGED
@@ -21,8 +21,8 @@
21
  <?php
22
  $authors_dropdown = '';
23
  if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
24
- $users_opt = array(
25
- 'show_option_none' => '&mdash; ' . __('No Change') . ' &mdash;',
26
  'hide_if_only_one_author' => false,
27
  'who' => 'authors',
28
  'name' => 'post_author',
@@ -30,9 +30,9 @@
30
  'class'=> 'authors',
31
  'multi' => 1,
32
  'echo' => 0
33
- );
34
  if ( $authors = wp_dropdown_users( $users_opt ) ) :
35
- $authors_dropdown = '<div class="form-control"><label>' . __( 'Author' ) . '</label>';
36
  $authors_dropdown .= $authors;
37
  $authors_dropdown .= '</div>';
38
  endif;
@@ -41,39 +41,55 @@
41
  ?>
42
 
43
  <div class="form-control">
44
- <label><?php _e( 'Status' ); ?></label>
45
  <select name="_status">
46
- <option value="">&mdash; <?php _e('No Change'); ?> &mdash;</option>
47
  <?php if ( $can_publish ) : ?>
48
- <option value="publish"><?php _e( 'Published' ); ?></option>
49
  <?php endif; ?>
50
- <option value="private"><?php _e( 'Private' ); ?></option>
51
- <option value="pending"><?php _e( 'Pending Review' ); ?></option>
52
- <option value="draft"><?php _e( 'Draft' ); ?></option>
53
  </select>
54
  </div>
55
 
56
  <?php if ( $this->post_type->hierarchical ) : ?>
57
  <div class="form-control">
58
- <label><?php _e( 'Template' ); ?></label>
59
  <select name="page_template">
60
- <option value="">&mdash; <?php _e('No Change'); ?> &mdash;</option>
61
- <option value="default"><?php _e( 'Default Template' ); ?></option>
62
  <?php page_template_dropdown() ?>
63
  </select>
64
  </div>
65
  <?php endif; ?>
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  </div><!-- .left -->
68
 
69
  <div class="right">
70
 
71
  <div class="form-control">
72
- <label><?php _e( 'Comments' ); ?></label>
73
  <select name="comment_status">
74
- <option value="">&mdash; <?php _e('No Change'); ?> &mdash;</option>
75
- <option value="open"><?php _e('Allow'); ?></option>
76
- <option value="closed"><?php _e('Do not allow'); ?></option>
77
  </select>
78
  </div>
79
 
@@ -81,9 +97,9 @@
81
  <div class="form-control">
82
  <label><?php _e( 'Display in Nested View', 'wp-nested-pages' ); ?></label>
83
  <select name="nested_pages_status">
84
- <option value="">&mdash; <?php _e('No Change'); ?> &mdash;</option>
85
- <option value="hide"><?php _e('Hide'); ?></option>
86
- <option value="show"><?php _e('Show'); ?></option>
87
  </select>
88
  </div>
89
 
@@ -91,9 +107,9 @@
91
  <div class="form-control">
92
  <label><?php _e( 'Hide in Nav Menu', 'wp-nested-pages' ); ?></label>
93
  <select name="nav_status">
94
- <option value="">&mdash; <?php _e('No Change'); ?> &mdash;</option>
95
- <option value="hide"><?php _e('Hide'); ?></option>
96
- <option value="show"><?php _e('Show'); ?></option>
97
  </select>
98
  </div>
99
  <?php endif; endif; // Edit theme options ?>
21
  <?php
22
  $authors_dropdown = '';
23
  if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) :
24
+ $users_opt = [
25
+ 'show_option_none' => '&mdash; ' . __('No Change', 'wp-nested-pages') . ' &mdash;',
26
  'hide_if_only_one_author' => false,
27
  'who' => 'authors',
28
  'name' => 'post_author',
30
  'class'=> 'authors',
31
  'multi' => 1,
32
  'echo' => 0
33
+ ];
34
  if ( $authors = wp_dropdown_users( $users_opt ) ) :
35
+ $authors_dropdown = '<div class="form-control"><label>' . __( 'Author', 'wp-nested-pages') . '</label>';
36
  $authors_dropdown .= $authors;
37
  $authors_dropdown .= '</div>';
38
  endif;
41
  ?>
42
 
43
  <div class="form-control">
44
+ <label><?php _e( 'Status', 'wp-nested-pages' ); ?></label>
45
  <select name="_status">
46
+ <option value="">&mdash; <?php _e('No Change', 'wp-nested-pages'); ?> &mdash;</option>
47
  <?php if ( $can_publish ) : ?>
48
+ <option value="publish"><?php _e( 'Published', 'wp-nested-pages' ); ?></option>
49
  <?php endif; ?>
50
+ <option value="private"><?php _e( 'Private', 'wp-nested-pages' ); ?></option>
51
+ <option value="pending"><?php _e( 'Pending Review', 'wp-nested-pages' ); ?></option>
52
+ <option value="draft"><?php _e( 'Draft', 'wp-nested-pages' ); ?></option>
53
  </select>
54
  </div>
55
 
56
  <?php if ( $this->post_type->hierarchical ) : ?>
57
  <div class="form-control">
58
+ <label><?php _e( 'Template', 'wp-nested-pages' ); ?></label>
59
  <select name="page_template">
60
+ <option value="">&mdash; <?php _e('No Change', 'wp-nested-pages'); ?> &mdash;</option>
61
+ <option value="default"><?php _e( 'Default Template', 'wp-nested-pages' ); ?></option>
62
  <?php page_template_dropdown() ?>
63
  </select>
64
  </div>
65
  <?php endif; ?>
66
 
67
+ <?php if ( $this->user->canSortPages() && $this->post_type->hierarchical ) : ?>
68
+ <div class="form-control">
69
+ <label><?php echo __('Parent', 'wp-nested-pages') . ' ' . $this->post_type->labels->singular_name; ?></label>
70
+ <?php
71
+ wp_dropdown_pages([
72
+ 'show_option_no_change'=> __('— No Change —', 'wp-nested-pages'),
73
+ 'sort_column' => 'menu_order',
74
+ 'hierarchical' => 1,
75
+ 'depth' => 0,
76
+ 'name' => 'post_parent',
77
+ 'post_type' => $this->post_type->name
78
+ ]);
79
+ ?>
80
+ </div>
81
+ <?php endif; ?>
82
+
83
  </div><!-- .left -->
84
 
85
  <div class="right">
86
 
87
  <div class="form-control">
88
+ <label><?php _e( 'Comments', 'wp-nested-pages' ); ?></label>
89
  <select name="comment_status">
90
+ <option value="">&mdash; <?php _e('No Change', 'wp-nested-pages'); ?> &mdash;</option>
91
+ <option value="open"><?php _e('Allow', 'wp-nested-pages'); ?></option>
92
+ <option value="closed"><?php _e('Do not allow', 'wp-nested-pages'); ?></option>
93
  </select>
94
  </div>
95
 
97
  <div class="form-control">
98
  <label><?php _e( 'Display in Nested View', 'wp-nested-pages' ); ?></label>
99
  <select name="nested_pages_status">
100
+ <option value="">&mdash; <?php _e('No Change', 'wp-nested-pages'); ?> &mdash;</option>
101
+ <option value="hide"><?php _e('Hide', 'wp-nested-pages'); ?></option>
102
+ <option value="show"><?php _e('Show', 'wp-nested-pages'); ?></option>
103
  </select>
104
  </div>
105
 
107
  <div class="form-control">
108
  <label><?php _e( 'Hide in Nav Menu', 'wp-nested-pages' ); ?></label>
109
  <select name="nav_status">
110
+ <option value="">&mdash; <?php _e('No Change', 'wp-nested-pages'); ?> &mdash;</option>
111
+ <option value="hide"><?php _e('Hide', 'wp-nested-pages'); ?></option>
112
+ <option value="show"><?php _e('Show', 'wp-nested-pages'); ?></option>
113
  </select>
114
  </div>
115
  <?php endif; endif; // Edit theme options ?>
app/Views/partials/list-header.php CHANGED
@@ -14,7 +14,7 @@
14
  <?php endif; ?>
15
  <option value="edit"><?php _e('Edit', 'wp-nested-pages'); ?></option>
16
  </select>
17
- <input type="submit" class="button" value="Apply">
18
  </form>
19
  <p class="np-hidden-select-count" data-np-hidden-count-parent><span data-np-hidden-count></span> <?php _e('Nested Items Selected', 'wp-nested-pages'); ?>. <a href="#" class="nestedpages-toggleall"><?php _e('Expand All', 'wp-nested-pages'); ?></a></p>
20
  </div>
14
  <?php endif; ?>
15
  <option value="edit"><?php _e('Edit', 'wp-nested-pages'); ?></option>
16
  </select>
17
+ <input type="submit" class="button" value="<?php echo esc_attr__('Apply', 'wp-nested-pages'); ?>">
18
  </form>
19
  <p class="np-hidden-select-count" data-np-hidden-count-parent><span data-np-hidden-count></span> <?php _e('Nested Items Selected', 'wp-nested-pages'); ?>. <a href="#" class="nestedpages-toggleall"><?php _e('Expand All', 'wp-nested-pages'); ?></a></p>
20
  </div>
app/Views/partials/row-link.php CHANGED
@@ -6,22 +6,25 @@ $link = ( $this->post->nav_type && $this->post->nav_type !== 'custom' )
6
  ? $this->post->nav_original_link
7
  : esc_url($this->post->content);
8
  ?>
9
- <div class="row" <?php if ( $this->listing_repo->isSearch() ) echo 'style="padding-left:10px;"';?>>
10
 
11
- <?php if ( $this->post_type->hierarchical && !$this->listing_repo->isSearch() ) : ?>
12
- <div class="child-toggle"></div>
13
- <?php endif; ?>
14
 
15
  <div class="row-inner">
16
 
17
- <i class="np-icon-sub-menu"></i>
18
 
19
- <?php if ( $this->user->canSortPages() && !$this->listing_repo->isSearch() ) : ?>
20
- <i class="handle np-icon-menu"></i>
21
  <?php endif; ?>
22
 
23
  <a href="<?php echo $link; ?>" class="page-link page-title" target="_blank">
24
- <span class="title"><?php echo apply_filters('the_title', $this->post->title, $this->post->id, $view = 'nestedpages_title'); ?> <i class="np-icon-link"></i></span>
 
 
 
25
  <?php
26
 
27
  // Post Status
@@ -33,7 +36,7 @@ $link = ( $this->post->nav_type && $this->post->nav_type !== 'custom' )
33
 
34
  // Nested Pages Status
35
  if ( $this->post->np_status == 'hide' )
36
- echo '<i class="np-icon-eye-blocked"></i>';
37
 
38
  // Nav Status
39
  if ( $this->post->nav_status == 'hide' ){
@@ -44,8 +47,6 @@ $link = ( $this->post->nav_type && $this->post->nav_type !== 'custom' )
44
  ?>
45
  </a>
46
 
47
- <a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a>
48
-
49
  <div class="action-buttons">
50
 
51
  <a href="#"
@@ -65,12 +66,12 @@ $link = ( $this->post->nav_type && $this->post->nav_type !== 'custom' )
65
  data-nav-original-link="<?php echo esc_attr($this->post->nav_original_link); ?>"
66
  data-nav-original-title="<?php echo esc_attr($this->post->nav_original_title); ?>"
67
  data-linktarget="<?php echo esc_attr($this->post->link_target); ?>">
68
- <?php _e('Quick Edit'); ?>
69
  </a>
70
 
71
  <?php if ( current_user_can('delete_pages') ) : ?>
72
  <a href="<?php echo get_delete_post_link($this->post->id, '', true); ?>" class="np-btn np-btn-trash" data-np-confirm-delete>
73
- <i class="np-icon-remove"></i>
74
  </a>
75
  <?php endif; ?>
76
 
@@ -88,13 +89,8 @@ $link = ( $this->post->nav_type && $this->post->nav_type !== 'custom' )
88
  $image = get_the_post_thumbnail($this->post->nav_object_id, $thumbnail_source);
89
  $out .= apply_filters('nestedpages_thumbnail', $image, $this->post);
90
  else :
91
- $out = '<div class="np-thumbnail link">';
92
- $fallback_icon = 'np-icon-link';
93
- if ( $this->post->nav_type == 'taxonomy' ) $fallback_icon = 'np-icon-tag';
94
- if ( $this->post->nav_object == 'post' ) $fallback_icon = 'np-icon-post';
95
- if ( $this->post->nav_object == 'page' ) $fallback_icon = 'np-icon-page';
96
- $image_fallback = '<i class="' . esc_attr($fallback_icon) . '" /></i>';
97
- $image_fallback = apply_filters('nestedpages_thumbnail_fallback', $image_fallback, $this->post);
98
  if ( $image_fallback ) :
99
  $out .= $image_fallback;
100
  endif;
6
  ? $this->post->nav_original_link
7
  : esc_url($this->post->content);
8
  ?>
9
+ <div class="row <?php if ( $this->listing_repo->isSearch() || $this->listing_repo->isOrdered($this->post_type->name) ) echo 'search';?>">
10
 
11
+ <div class="child-toggle">
12
+ <div class="child-toggle-spacer"></div>
13
+ </div>
14
 
15
  <div class="row-inner">
16
 
17
+ <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>
18
 
19
+ <?php if ( $this->user->canSortPages() && !$this->listing_repo->isSearch() && !$this->listing_repo->isOrdered($this->post_type->name) ) : ?>
20
+ <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>
21
  <?php endif; ?>
22
 
23
  <a href="<?php echo $link; ?>" class="page-link page-title" target="_blank">
24
+ <span class="title">
25
+ <?php echo apply_filters('the_title', $this->post->title, $this->post->id, $view = 'nestedpages_title'); ?>
26
+ <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>
27
+ </span>
28
  <?php
29
 
30
  // Post Status
36
 
37
  // Nested Pages Status
38
  if ( $this->post->np_status == 'hide' )
39
+ echo '<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>';
40
 
41
  // Nav Status
42
  if ( $this->post->nav_status == 'hide' ){
47
  ?>
48
  </a>
49
 
 
 
50
  <div class="action-buttons">
51
 
52
  <a href="#"
66
  data-nav-original-link="<?php echo esc_attr($this->post->nav_original_link); ?>"
67
  data-nav-original-title="<?php echo esc_attr($this->post->nav_original_title); ?>"
68
  data-linktarget="<?php echo esc_attr($this->post->link_target); ?>">
69
+ <?php _e('Quick Edit', 'wp-nested-pages'); ?>
70
  </a>
71
 
72
  <?php if ( current_user_can('delete_pages') ) : ?>
73
  <a href="<?php echo get_delete_post_link($this->post->id, '', true); ?>" class="np-btn np-btn-trash" data-np-confirm-delete>
74
+ <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>
75
  </a>
76
  <?php endif; ?>
77
 
89
  $image = get_the_post_thumbnail($this->post->nav_object_id, $thumbnail_source);
90
  $out .= apply_filters('nestedpages_thumbnail', $image, $this->post);
91
  else :
92
+ $out = '<div class="np-thumbnail ' . esc_attr($thumbnail_size) . '">';
93
+ $image_fallback = apply_filters('nestedpages_thumbnail_fallback', false, $this->post);
 
 
 
 
 
94
  if ( $image_fallback ) :
95
  $out .= $image_fallback;
96
  endif;
app/Views/partials/row.php CHANGED
@@ -17,10 +17,10 @@ if ( !$wpml ) $wpml_pages = true;
17
  <?php if ( !$this->post_type->hierarchical ) echo '<div class="non-hierarchical-spacer"></div>'; ?>
18
 
19
  <div class="row-inner">
20
- <i class="np-icon-sub-menu"></i>
21
 
22
- <?php if ( $this->user->canSortPages() && !$this->listing_repo->isSearch() && !$this->post_type_settings->disable_sorting && $wpml_current_language !== 'all' ) : ?>
23
- <i class="handle np-icon-menu"></i>
24
  <?php endif; ?>
25
 
26
  <a href="<?php echo apply_filters('nestedpages_edit_link', get_edit_post_link(), $this->post); ?>" class="page-link page-title">
@@ -31,18 +31,23 @@ if ( !$wpml ) $wpml_pages = true;
31
  if ( $this->post->id == get_option('page_on_front') ) echo ' <em class="np-page-type"><strong>&ndash; ' . __('Front Page', 'wp-nested-pages') . '</strong></em>';
32
  if ( $this->post->id == get_option('page_for_posts') ) echo ' <em class="np-page-type"><strong>&ndash; ' . __('Posts Page', 'wp-nested-pages') . '</strong></em>';
33
  endif;
 
34
  ?>
35
  </span>
36
  <?php
37
  // Post Status
38
  echo '<span class="status">';
39
  if ( $this->post->status !== 'publish' ) echo '(' . __(ucfirst($this->post->status)) . ')';
40
- if ( post_password_required($this->post->id) ) echo ' <i class="np-icon-lock"></i>';
 
 
 
 
41
  echo '</span>';
42
 
43
  // Nested Pages Status
44
  if ( $this->post->np_status == 'hide' && !$wpml )
45
- echo '<i class="np-icon-eye-blocked"></i>';
46
 
47
  // Nav Status
48
  if ( $this->post->nav_status == 'hide' && !$wpml ){
@@ -54,11 +59,15 @@ if ( !$wpml ) $wpml_pages = true;
54
  // Post Lock
55
  if ( $user = wp_check_post_lock($this->post->id) ){
56
  $u = get_userdata($user);
57
- echo '<span class="locked"><i class="np-icon-lock"></i><em> ' . esc_html($u->display_name) . ' ' . __('currently editing', 'wp-nested-pages') . '</em></span>';
 
 
58
  } elseif ( !$this->integrations->plugins->editorial_access_manager->hasAccess($this->post->id) ){
59
- echo '<span class="locked"><i class="np-icon-lock"></i></span>';
 
 
60
  } else {
61
- echo '<span class="edit-indicator"><i class="np-icon-pencil"></i>' . apply_filters('nestedpages_edit_link_text', __('Edit'), $this->post) . '</span>';
62
  }
63
 
64
  // Sticky
@@ -67,24 +76,13 @@ if ( !$wpml ) $wpml_pages = true;
67
  echo '>(' . __('Sticky', 'wp-nested-pages') . ')<span>';
68
 
69
  if ( $this->post->status !== 'publish' ) echo '(' . __(ucfirst($this->post->status)) . ')';
70
- if ( post_password_required($this->post->id) ) echo ' <i class="np-icon-lock"></i>';
71
-
72
-
73
-
74
  ?>
75
  </a>
76
 
77
- <?php if ( $assigned_pt ) : ?>
78
- <ul class="np-assigned-pt-actions">
79
- <?php if ( current_user_can('publish_posts') ) : ?>
80
- <li><a href="<?php echo $this->post_type_repo->addNewPostLink($assigned_pt->name); ?>" class=""><?php echo $assigned_pt->labels->add_new; ?></a></li>
81
- <?php endif; ?>
82
- <li><a href="<?php echo $this->post_type_repo->allPostsLink($assigned_pt->name); ?>" class=""><?php echo $assigned_pt->labels->all_items . ' (' . $this->listing_repo->postCount($assigned_pt->name) . ')'; ?></a></li>
83
- </ul>
84
- <?php endif; ?>
85
-
86
- <!-- Responsive Toggle Button -->
87
- <a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a>
88
 
89
  <?php if ( !$this->post->hierarchical ) : echo $this->post->hierarchical; ?>
90
  <div class="np-post-columns">
@@ -102,31 +100,101 @@ if ( !$wpml ) $wpml_pages = true;
102
  ?>
103
 
104
  <div class="action-buttons">
105
- <?php if ( $wpml ) : ?>
106
- <a href="#" class="np-btn" data-nestedpages-translations><?php _e('Translations', 'wp-nested-pages'); ?> (<?php echo $this->integrations->plugins->wpml->getAllTranslations($this->post->id, 'count'); ?>)</a>
107
- <?php endif; ?>
108
-
109
- <?php if ( $this->post->comment_status == 'open' ) : $comments = wp_count_comments($this->post->id); $cs = 'open' ?>
110
-
111
- <a href="<?php echo admin_url( 'edit-comments.php?p=' . get_the_id() ); ?>" class="np-btn">
112
- <i class="np-icon-bubble"></i> <?php echo $comments->total_comments; ?>
113
- </a>
114
 
115
- <?php else : $cs = 'closed'; endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
- <?php if ( current_user_can('publish_pages') && $this->post_type->hierarchical && !$this->listing_repo->isSearch() && $wpml_pages ) : ?>
118
-
119
- <?php if (!$this->settings->menusDisabled() && !$this->integrations->plugins->wpml->installed) : ?>
120
- <a href="#" class="np-btn open-redirect-modal" data-parentid="<?php echo esc_attr($this->post->id); ?>"><i class="np-icon-link"></i></a>
121
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
 
123
- <a href="#" class="np-btn add-new-child" data-id="<?php echo esc_attr(get_the_id()); ?>" data-parentname="<?php echo esc_html($this->post->title); ?>"><?php _e('Add Child', 'wp-nested-pages'); ?></a>
 
 
 
 
124
 
125
- <?php endif; ?>
126
 
127
- <?php if ( current_user_can('edit_pages') && current_user_can('edit_posts') && $wpml_pages ) : ?>
128
- <a href="#" class="np-btn clone-post" data-id="<?php echo esc_attr(get_the_id()); ?>" data-parentname="<?php echo esc_html($this->post->title); ?>"><?php _e('Clone', 'wp-nested-pages'); ?></a>
129
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
 
131
  <?php if ( !$user = wp_check_post_lock($this->post->id) || !$this->integrations->plugins->editorial_access_manager->hasAccess($this->post->id) ) : ?>
132
  <a href="#"
@@ -158,19 +226,17 @@ if ( !$wpml ) $wpml_pages = true;
158
  data-timeformat="<?php echo get_option('time_format'); ?>"
159
  data-ampm="<?php echo date('a', $this->post->date->datepicker); ?>"
160
  data-sticky="<?php if ( in_array($this->post->id, $this->sticky_posts) ) echo 'sticky'; ?>">
161
- <?php _e('Quick Edit'); ?>
162
  </a>
163
  <?php endif; ?>
164
 
165
  <a href="<?php echo apply_filters('nestedpages_view_link', get_the_permalink(), $this->post); ?>" class="np-btn np-view-button" target="_blank">
166
- <?php echo apply_filters('nestedpages_view_link_text', __('View'), $this->post); ?>
167
  </a>
168
 
169
- <!-- <a href="#" class="np-btn"><i class="np-icon-more_vert"></i></a> -->
170
-
171
  <?php if ( current_user_can('delete_pages') && $this->integrations->plugins->editorial_access_manager->hasAccess($this->post->id) ) : ?>
172
  <a href="<?php echo get_delete_post_link(get_the_id()); ?>" class="np-btn np-btn-trash">
173
- <i class="np-icon-remove"></i>
174
  </a>
175
  <?php endif; ?>
176
 
17
  <?php if ( !$this->post_type->hierarchical ) echo '<div class="non-hierarchical-spacer"></div>'; ?>
18
 
19
  <div class="row-inner">
20
+ <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>
21
 
22
+ <?php if ( $this->user->canSortPages() && !$this->listing_repo->isSearch() && !$this->post_type_settings->disable_sorting && $wpml_current_language !== 'all' && !$this->listing_repo->isOrdered($this->post_type->name) ) : ?>
23
+ <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>
24
  <?php endif; ?>
25
 
26
  <a href="<?php echo apply_filters('nestedpages_edit_link', get_edit_post_link(), $this->post); ?>" class="page-link page-title">
31
  if ( $this->post->id == get_option('page_on_front') ) echo ' <em class="np-page-type"><strong>&ndash; ' . __('Front Page', 'wp-nested-pages') . '</strong></em>';
32
  if ( $this->post->id == get_option('page_for_posts') ) echo ' <em class="np-page-type"><strong>&ndash; ' . __('Posts Page', 'wp-nested-pages') . '</strong></em>';
33
  endif;
34
+ echo $this->postStates();
35
  ?>
36
  </span>
37
  <?php
38
  // Post Status
39
  echo '<span class="status">';
40
  if ( $this->post->status !== 'publish' ) echo '(' . __(ucfirst($this->post->status)) . ')';
41
+ if ( post_password_required($this->post->id) ) {
42
+ echo '<span class="locked password-required">';
43
+ echo ' <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>';
44
+ echo '</span>';
45
+ }
46
  echo '</span>';
47
 
48
  // Nested Pages Status
49
  if ( $this->post->np_status == 'hide' && !$wpml )
50
+ echo '<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>';
51
 
52
  // Nav Status
53
  if ( $this->post->nav_status == 'hide' && !$wpml ){
59
  // Post Lock
60
  if ( $user = wp_check_post_lock($this->post->id) ){
61
  $u = get_userdata($user);
62
+ echo '<span class="locked">';
63
+ echo ' <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>';
64
+ echo '<em> ' . esc_html($u->display_name) . ' ' . __('currently editing', 'wp-nested-pages') . '</em></span>';
65
  } elseif ( !$this->integrations->plugins->editorial_access_manager->hasAccess($this->post->id) ){
66
+ echo '<span class="locked">';
67
+ echo ' <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>';
68
+ echo '</span>';
69
  } else {
70
+ echo '<span class="edit-indicator">' . apply_filters('nestedpages_edit_link_text', __('Edit', 'wp-nested-pages'), $this->post) . '</span>';
71
  }
72
 
73
  // Sticky
76
  echo '>(' . __('Sticky', 'wp-nested-pages') . ')<span>';
77
 
78
  if ( $this->post->status !== 'publish' ) echo '(' . __(ucfirst($this->post->status)) . ')';
79
+ if ( post_password_required($this->post->id) ) {
80
+ echo ' <span class="status-icon-locked"><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></span>';
81
+ }
 
82
  ?>
83
  </a>
84
 
85
+ <?php echo $this->rowActions($assigned_pt); ?>
 
 
 
 
 
 
 
 
 
 
86
 
87
  <?php if ( !$this->post->hierarchical ) : echo $this->post->hierarchical; ?>
88
  <div class="np-post-columns">
100
  ?>
101
 
102
  <div class="action-buttons">
 
 
 
 
 
 
 
 
 
103
 
104
+ <div class="nestedpages-dropdown" data-dropdown>
105
+ <a href="#" class="np-btn has-icon toggle" data-dropdown-toggle>
106
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
107
+ <path d="M0 0h24v24H0z" fill="none"/>
108
+ <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"/>
109
+ </svg>
110
+ </a>
111
+ <ul class="nestedpages-dropdown-content" data-dropdown-content>
112
+
113
+ <?php
114
+ // WPML Translations
115
+ if ( $wpml ) : ?>
116
+ <li>
117
+ <a href="#" data-nestedpages-translations>
118
+ <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="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg>
119
+ <?php _e('Translations', 'wp-nested-pages'); ?> (<?php echo $this->integrations->plugins->wpml->getAllTranslations($this->post->id, 'count'); ?>)
120
+ </a>
121
+ </li>
122
+ <?php endif; ?>
123
 
124
+ <?php
125
+ // Comments
126
+ if ( $this->post->comment_status == 'open' ) : $comments = wp_count_comments($this->post->id); $cs = 'open' ?>
127
+ <li>
128
+ <a href="<?php echo admin_url( 'edit-comments.php?p=' . get_the_id() ); ?>">
129
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path 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>
130
+ <?php echo $comments->total_comments . ' ' . __('Comments', 'wp-nested-pages'); ?>
131
+ </a>
132
+ </li>
133
+ <?php else : $cs = 'closed'; endif; ?>
134
+
135
+ <?php
136
+ if ( current_user_can('publish_pages') && $this->post_type->hierarchical && !$this->listing_repo->isSearch() && $wpml_pages ) :
137
+
138
+ // Link
139
+ if (!$this->settings->menusDisabled() && !$this->integrations->plugins->wpml->installed) : ?>
140
+ <li>
141
+ <a href="#" class="open-redirect-modal" data-parentid="<?php echo esc_attr($this->post->id); ?>">
142
+ <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>
143
+ <?php _e('Add Child Link', 'wp-nested-pages'); ?></a>
144
+ </li>
145
+ <?php endif; ?>
146
 
147
+ <li>
148
+ <a href="#" class="add-new-child" data-id="<?php echo esc_attr(get_the_id()); ?>" data-parentname="<?php echo esc_html($this->post->title); ?>">
149
+ <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>
150
+ <?php echo __('Add Child', 'wp-nested-pages') . ' ' . $this->post_type->labels->singular_name; ?></a>
151
+ </li>
152
 
153
+ <?php endif; ?>
154
 
155
+ <?php if ( current_user_can('publish_pages') && !$this->listing_repo->isSearch() && !$this->listing_repo->isOrdered($this->post_type->name) ) : ?>
156
+ <li>
157
+ <a href="#" data-insert-before="<?php echo esc_attr(get_the_id()); ?>" data-parentname="<?php echo esc_html($this->post->title); ?>">
158
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M8 11h3v10h2V11h3l-4-4-4 4zM4 3v2h16V3H4z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
159
+ <?php printf(esc_html__('Insert %s Before', 'wp-nested-pages'), $this->post_type->labels->singular_name); ?></a>
160
+ </li>
161
+
162
+ <li>
163
+ <a href="#" data-insert-after="<?php echo esc_attr(get_the_id()); ?>" data-parentname="<?php echo esc_html($this->post->title); ?>">
164
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16 13h-3V3h-2v10H8l4 4 4-4zM4 19v2h16v-2H4z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
165
+ <?php printf(esc_html__('Insert %s After', 'wp-nested-pages'), $this->post_type->labels->singular_name); ?></a>
166
+ </li>
167
+ <?php endif; ?>
168
+
169
+ <?php if ( $this->user->canSortPages() && !$this->listing_repo->isSearch() && !$this->post_type_settings->disable_sorting && $wpml_current_language !== 'all' && !$this->listing_repo->isOrdered($this->post_type->name) ) : ?>
170
+ <li>
171
+ <a href="#" data-push-to-top>
172
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
173
+ <path fill="none" d="M0 0h24v24H0V0z"/>
174
+ <path d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"/>
175
+ </svg>
176
+ <?php _e('Push to Top', 'wp-nested-pages'); ?></a>
177
+ </li>
178
+
179
+ <li>
180
+ <a href="#" data-push-to-bottom>
181
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
182
+ <path fill="none" d="M0 0h24v24H0V0z"/>
183
+ <path fill="#010101" d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"/>
184
+ </svg>
185
+ <?php _e('Push to Bottom', 'wp-nested-pages'); ?></a>
186
+ </li>
187
+ <?php endif; ?>
188
+
189
+ <?php if ( current_user_can('edit_pages') && current_user_can('edit_posts') && $wpml_pages ) : ?>
190
+ <li>
191
+ <a href="#" class="clone-post" data-id="<?php echo esc_attr(get_the_id()); ?>" data-parentname="<?php echo esc_html($this->post->title); ?>">
192
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"/></svg>
193
+ <?php _e('Clone', 'wp-nested-pages'); ?></a>
194
+ </li>
195
+ <?php endif; ?>
196
+ </ul>
197
+ </div><!-- .dropdown -->
198
 
199
  <?php if ( !$user = wp_check_post_lock($this->post->id) || !$this->integrations->plugins->editorial_access_manager->hasAccess($this->post->id) ) : ?>
200
  <a href="#"
226
  data-timeformat="<?php echo get_option('time_format'); ?>"
227
  data-ampm="<?php echo date('a', $this->post->date->datepicker); ?>"
228
  data-sticky="<?php if ( in_array($this->post->id, $this->sticky_posts) ) echo 'sticky'; ?>">
229
+ <?php _e('Quick Edit', 'wp-nested-pages'); ?>
230
  </a>
231
  <?php endif; ?>
232
 
233
  <a href="<?php echo apply_filters('nestedpages_view_link', get_the_permalink(), $this->post); ?>" class="np-btn np-view-button" target="_blank">
234
+ <?php echo apply_filters('nestedpages_view_link_text', __('View', 'wp-nested-pages'), $this->post); ?>
235
  </a>
236
 
 
 
237
  <?php if ( current_user_can('delete_pages') && $this->integrations->plugins->editorial_access_manager->hasAccess($this->post->id) ) : ?>
238
  <a href="<?php echo get_delete_post_link(get_the_id()); ?>" class="np-btn np-btn-trash">
239
+ <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>
240
  </a>
241
  <?php endif; ?>
242
 
app/Views/partials/tool-list.php CHANGED
@@ -11,15 +11,15 @@ if ( $wpml && $current_lang ) $searchLabel .= ' (' . $this->integrations->plugin
11
 
12
  <ul class="subsubsub">
13
  <li>
14
- <a href="#all" class="np-toggle-publish active"><?php _e('All'); ?></a> |
15
  </li>
16
 
17
  <li>
18
- <a href="#published" class="np-toggle-publish"><?php _e('Published'); ?></a> |
19
  </li>
20
 
21
  <li>
22
- <a href="#draft" class="np-toggle-publish"><?php _e('Draft'); ?></a>
23
  </li>
24
 
25
  <li> |
@@ -34,8 +34,8 @@ if ( $wpml && $current_lang ) $searchLabel .= ' (' . $this->integrations->plugin
34
  <?php if ( current_user_can('delete_pages') && $trashedCount > 0) : ?>
35
  <li class="np-trash-links">
36
  |
37
- <a href="<?php echo esc_url($this->post_type_repo->trashLink($this->post_type->name)); ?>"><?php _e('Trash'); ?> </a>
38
- <span class="count">(<a href="#" class="np-empty-trash" data-posttype="<?php echo esc_attr($this->post_type->name); ?>"><?php _e('Empty', 'wp-nested-pages'); ?></a> <?php echo absint($trashedCount); ?>)</span>
39
  </li>
40
  <?php endif; ?>
41
 
@@ -43,7 +43,7 @@ if ( $wpml && $current_lang ) $searchLabel .= ' (' . $this->integrations->plugin
43
  <li>
44
  |
45
  <a href="<?php echo NestedPages\Helpers::defaultPagesLink($this->post_type->name); ?>">
46
- <?php _e('Default'); ?> <?php _e($this->post_type->labels->name); ?>
47
  </a>
48
  </li>
49
  <?php endif; ?>
@@ -55,14 +55,11 @@ if ( $wpml && $current_lang ) $searchLabel .= ' (' . $this->integrations->plugin
55
  ?>
56
 
57
  <?php
58
- if ( $this->post_type->name !== 'page' && $this->post_type_repo->hasSortOptions($this->post_type->name) ) : ?>
59
  <div class="np-tools-primary">
60
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post" class="np-tools-sort">
61
- <input type="hidden" name="action" value="npListingSort">
62
- <input type="hidden" name="page" value="<?php echo $this->pageURL(); ?>">
63
- <input type="hidden" name="post_type" value="<?php echo esc_attr($this->post_type->name); ?>">
64
  <?php if ( $this->post_type_repo->sortOptionEnabled($this->post_type->name, 'author') ) : ?>
65
- <div class="select first">
66
  <select id="np_sortauthor" name="np_author" class="nestedpages-sort">
67
  <?php
68
  $out = '<option value="all">' . __('All Authors', 'wp-nested-pages') . '</option>';
@@ -77,7 +74,11 @@ if ( $wpml && $current_lang ) $searchLabel .= ' (' . $this->integrations->plugin
77
  </select>
78
  </div>
79
  <?php endif; ?>
80
- <?php if ( $this->post_type_repo->sortOptionEnabled($this->post_type->name, 'orderby') ) : ?>
 
 
 
 
81
  <div class="select">
82
  <select id="np_orderby" name="np_orderby" class="nestedpages-sort">
83
  <?php
@@ -89,6 +90,7 @@ if ( $wpml && $current_lang ) $searchLabel .= ' (' . $this->integrations->plugin
89
  $out = '<option value="">' . __('Order By', 'wp-nested-pages') . '</option>';
90
  foreach ( $options as $key => $option ){
91
  $out .= '<option value="' . $key . '"';
 
92
  if ( isset($_GET['orderby']) && ($_GET['orderby'] == $key) ) $out .= ' selected';
93
  $out .= '>' . esc_html($option) . '</option>';
94
  }
@@ -97,17 +99,22 @@ if ( $wpml && $current_lang ) $searchLabel .= ' (' . $this->integrations->plugin
97
  </select>
98
  </div>
99
  <?php endif; ?>
100
- <?php if ( $this->post_type_repo->sortOptionEnabled($this->post_type->name, 'order') ) : ?>
 
 
 
 
101
  <div class="select">
102
  <select id="np_order" name="np_order" class="nestedpages-sort">
103
  <?php
104
- $options = array(
105
  'ASC' => __('Ascending', 'wp-nested-pages'),
106
  'DESC' => __('Descending', 'wp-nested-pages')
107
- );
108
  $out = '';
109
  foreach ( $options as $key => $option ){
110
  $out .= '<option value="' . esc_attr($key) . '"';
 
111
  if ( isset($_GET['order']) && ($_GET['order'] == $key) ) $out .= ' selected';
112
  $out .= '>' . esc_html($option) . '</option>';
113
  }
@@ -137,7 +144,10 @@ if ( $wpml && $current_lang ) $searchLabel .= ' (' . $this->integrations->plugin
137
  endforeach;
138
  ?>
139
  <div class="select">
140
- <input type="submit" id="nestedpages-sort" class="button" value="Apply">
 
 
 
141
  </div>
142
  </form>
143
  </div>
@@ -147,9 +157,7 @@ if ( $wpml && $current_lang ) $searchLabel .= ' (' . $this->integrations->plugin
147
  <?php if ( $this->post_type->name == 'page' && $this->post_type_repo->categoriesEnabled($this->post_type->name) ) : ?>
148
  <div class="np-tools-primary">
149
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post" class="np-tools-sort">
150
- <input type="hidden" name="action" value="npCategoryFilter">
151
- <input type="hidden" name="page" value="<?php echo esc_url($this->pageURL()); ?>">
152
- <div class="select first">
153
  <select id="np_category" name="np_category" class="nestedpages-sort">
154
  <?php
155
  $tax = get_taxonomy('category');
@@ -165,6 +173,8 @@ if ( $wpml && $current_lang ) $searchLabel .= ' (' . $this->integrations->plugin
165
  </select>
166
  </div>
167
  <div class="select">
 
 
168
  <input type="submit" id="nestedpages-sort" class="button" value="Apply">
169
  </div>
170
  </form>
11
 
12
  <ul class="subsubsub">
13
  <li>
14
+ <a href="#all" class="np-toggle-publish active"><?php _e('All', 'wp-nested-pages'); ?></a> |
15
  </li>
16
 
17
  <li>
18
+ <a href="#published" class="np-toggle-publish"><?php _e('Published', 'wp-nested-pages'); ?></a> |
19
  </li>
20
 
21
  <li>
22
+ <a href="#draft" class="np-toggle-publish"><?php _e('Draft', 'wp-nested-pages'); ?></a>
23
  </li>
24
 
25
  <li> |
34
  <?php if ( current_user_can('delete_pages') && $trashedCount > 0) : ?>
35
  <li class="np-trash-links">
36
  |
37
+ <a href="<?php echo esc_url($this->post_type_repo->trashLink($this->post_type->name)); ?>"><?php _e('Trash', 'wp-nested-pages'); ?> </a>
38
+ <span class="count">(<a href="#" class="np-empty-trash" data-posttype="<?php echo esc_attr($this->post_type->name); ?>" data-nestedpages-modal-toggle="np-trash-modal"><?php _e('Empty', 'wp-nested-pages'); ?></a> <?php echo absint($trashedCount); ?>)</span>
39
  </li>
40
  <?php endif; ?>
41
 
43
  <li>
44
  |
45
  <a href="<?php echo NestedPages\Helpers::defaultPagesLink($this->post_type->name); ?>">
46
+ <?php _e('Default', 'wp-nested-pages'); ?> <?php _e($this->post_type->labels->name); ?>
47
  </a>
48
  </li>
49
  <?php endif; ?>
55
  ?>
56
 
57
  <?php
58
+ if ( $this->post_type_repo->hasSortOptions($this->post_type->name) ) : ?>
59
  <div class="np-tools-primary">
60
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post" class="np-tools-sort">
 
 
 
61
  <?php if ( $this->post_type_repo->sortOptionEnabled($this->post_type->name, 'author') ) : ?>
62
+ <div class="select">
63
  <select id="np_sortauthor" name="np_author" class="nestedpages-sort">
64
  <?php
65
  $out = '<option value="all">' . __('All Authors', 'wp-nested-pages') . '</option>';
74
  </select>
75
  </div>
76
  <?php endif; ?>
77
+ <?php
78
+ if ( $this->post_type_repo->sortOptionEnabled($this->post_type->name, 'orderby') ) :
79
+ $default_order_by = $this->post_type_repo->defaultSortOption($this->post_type->name, 'orderby');
80
+ if ( isset($_GET['orderby']) ) $default_order_by = false;
81
+ ?>
82
  <div class="select">
83
  <select id="np_orderby" name="np_orderby" class="nestedpages-sort">
84
  <?php
90
  $out = '<option value="">' . __('Order By', 'wp-nested-pages') . '</option>';
91
  foreach ( $options as $key => $option ){
92
  $out .= '<option value="' . $key . '"';
93
+ if ( $default_order_by && $default_order_by == $key ) $out .= ' selected';
94
  if ( isset($_GET['orderby']) && ($_GET['orderby'] == $key) ) $out .= ' selected';
95
  $out .= '>' . esc_html($option) . '</option>';
96
  }
99
  </select>
100
  </div>
101
  <?php endif; ?>
102
+ <?php
103
+ if ( $this->post_type_repo->sortOptionEnabled($this->post_type->name, 'order') ) :
104
+ $default_order = $this->post_type_repo->defaultSortOption($this->post_type->name, 'order');
105
+ if ( isset($_GET['order']) ) $default_order = false;
106
+ ?>
107
  <div class="select">
108
  <select id="np_order" name="np_order" class="nestedpages-sort">
109
  <?php
110
+ $options = [
111
  'ASC' => __('Ascending', 'wp-nested-pages'),
112
  'DESC' => __('Descending', 'wp-nested-pages')
113
+ ];
114
  $out = '';
115
  foreach ( $options as $key => $option ){
116
  $out .= '<option value="' . esc_attr($key) . '"';
117
+ if ( $default_order && $default_order == $key ) $out .= ' selected';
118
  if ( isset($_GET['order']) && ($_GET['order'] == $key) ) $out .= ' selected';
119
  $out .= '>' . esc_html($option) . '</option>';
120
  }
144
  endforeach;
145
  ?>
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>
152
  </form>
153
  </div>
157
  <?php if ( $this->post_type->name == 'page' && $this->post_type_repo->categoriesEnabled($this->post_type->name) ) : ?>
158
  <div class="np-tools-primary">
159
  <form action="<?php echo admin_url('admin-post.php'); ?>" method="post" class="np-tools-sort">
160
+ <div class="select">
 
 
161
  <select id="np_category" name="np_category" class="nestedpages-sort">
162
  <?php
163
  $tax = get_taxonomy('category');
173
  </select>
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>
180
  </form>
app/Views/partials/wpml-translations.php CHANGED
@@ -2,8 +2,8 @@
2
  <div class="quick-edit np-wpml-translations-modal np-inline-modal loading" data-np-wpml-translations-modal style="display:none;">
3
  <div class="form-interior">
4
  <h3><?php _e('Translations for ', 'wp-nested-pages'); ?><strong data-wmpl-translation-title></strong></h3>
5
- <div class="loading-indicator">
6
- <img src="<?php echo NestedPages\Helpers::plugin_url(); ?>/assets/images/spinner-2x.gif" alt="<?php _e('Loading', 'wp-nested-pages'); ?>" />
7
  </div>
8
  <div class="np-quickedit-error" style="clear:both;display:none;"></div>
9
  <table class="np-translations-table" data-np-wpml-translations-modal-table></table>
2
  <div class="quick-edit np-wpml-translations-modal np-inline-modal loading" data-np-wpml-translations-modal style="display:none;">
3
  <div class="form-interior">
4
  <h3><?php _e('Translations for ', 'wp-nested-pages'); ?><strong data-wmpl-translation-title></strong></h3>
5
+ <div class="np-qe-loading">
6
+ <?php include( NestedPages\Helpers::asset('images/spinner.svg') ); ?>
7
  </div>
8
  <div class="np-quickedit-error" style="clear:both;display:none;"></div>
9
  <table class="np-translations-table" data-np-wpml-translations-modal-table></table>
app/Views/settings/settings-posttypes.php CHANGED
@@ -30,7 +30,7 @@ settings_fields( 'nestedpages-posttypes' );
30
  <?php _e('Replace the default top-level item with the nested view link.', 'wp-nested-pages'); ?></p>
31
  </div>
32
  <div class="field">
33
- <label><input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][replace_menu]" value="true" <?php if ( $type->replace_menu ) echo 'checked'; ?> /><?php echo __('Replace Default') . ' ' . esc_html($type->label) . ' ' . __('Menu', 'wp-nested-pages'); ?></label>
34
  </div><!-- .field -->
35
  </div><!-- .row -->
36
  </li>
@@ -52,7 +52,7 @@ settings_fields( 'nestedpages-posttypes' );
52
  <?php _e('Remove drag and drop sorting from this post type.', 'wp-nested-pages'); ?></p>
53
  </div>
54
  <div class="field">
55
- <label><input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][disable_sorting]" value="true" <?php if ( $type->disable_sorting ) echo 'checked'; ?> /><?php echo __('Disable Sorting') ?></label>
56
  </div><!-- .field -->
57
  </div><!-- .row -->
58
  </li>
@@ -93,7 +93,9 @@ settings_fields( 'nestedpages-posttypes' );
93
  ?>
94
  <input type="search" data-nestedpages-post-search="page" placeholder="<?php _e('Search Pages', 'wp-nested-pages'); ?>" />
95
  <div class="np-quickedit-info" style="display:none;" data-nestedpages-no-results><?php _e('No pages were found.', 'wp-nested-pages'); ?></div>
96
- <img src="<?php echo NestedPages\Helpers::plugin_url(); ?>/assets/images/spinner.gif" alt="<?php _e('Loading', 'wp-nested-pages'); ?>" style="display:none;" data-nestedpages-loading />
 
 
97
  <div class="nestedpages-page-search-results" data-nestedpages-search-results>
98
  <ul>
99
  <?php foreach($recent_pages as $page) : ?>
@@ -237,7 +239,6 @@ settings_fields( 'nestedpages-posttypes' );
237
  </li>
238
  <?php endif; ?>
239
  <?php
240
- if ( $type->name !== 'page' ) :
241
  $h_taxonomies = $this->post_type_repo->getTaxonomies($type->name, true);
242
  $f_taxonomies = $this->post_type_repo->getTaxonomies($type->name, false);
243
  $taxonomies = array_merge($h_taxonomies, $f_taxonomies);
@@ -252,16 +253,54 @@ settings_fields( 'nestedpages-posttypes' );
252
  <div class="nestedpages-sort-options-selection">
253
  <label>
254
  <input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][sort_options][author]" value="true" <?php if ( $this->post_type_repo->sortOptionEnabled($type->name, 'author') ) echo 'checked'; ?> />
255
- <?php _e('Author') ?>
256
  </label>
 
257
  <label>
258
- <input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][sort_options][orderby]" value="true" <?php if ( $this->post_type_repo->sortOptionEnabled($type->name, 'orderby') ) echo 'checked'; ?> />
259
- <?php _e('Order By') ?>
260
  </label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  <label>
262
- <input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][sort_options][order]" value="true" <?php if ( $this->post_type_repo->sortOptionEnabled($type->name, 'order') ) echo 'checked'; ?> />
263
- <?php _e('Order') ?>
264
  </label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
265
 
266
  <?php if ( !empty($taxonomies) ) : foreach ( $taxonomies as $tax ) : ?>
267
  <label>
@@ -274,7 +313,6 @@ settings_fields( 'nestedpages-posttypes' );
274
  </div><!-- .field -->
275
  </div><!-- .row -->
276
  </li>
277
- <?php endif; ?>
278
  </ul>
279
  </div><!-- .body -->
280
  </div><!-- .post-type -->
30
  <?php _e('Replace the default top-level item with the nested view link.', 'wp-nested-pages'); ?></p>
31
  </div>
32
  <div class="field">
33
+ <label><input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][replace_menu]" value="true" <?php if ( $type->replace_menu ) echo 'checked'; ?> /><?php echo __('Replace Default', 'wp-nested-pages') . ' ' . esc_html($type->label) . ' ' . __('Menu', 'wp-nested-pages'); ?></label>
34
  </div><!-- .field -->
35
  </div><!-- .row -->
36
  </li>
52
  <?php _e('Remove drag and drop sorting from this post type.', 'wp-nested-pages'); ?></p>
53
  </div>
54
  <div class="field">
55
+ <label><input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][disable_sorting]" value="true" <?php if ( $type->disable_sorting ) echo 'checked'; ?> /><?php echo __('Disable Sorting', 'wp-nested-pages') ?></label>
56
  </div><!-- .field -->
57
  </div><!-- .row -->
58
  </li>
93
  ?>
94
  <input type="search" data-nestedpages-post-search="page" placeholder="<?php _e('Search Pages', 'wp-nested-pages'); ?>" />
95
  <div class="np-quickedit-info" style="display:none;" data-nestedpages-no-results><?php _e('No pages were found.', 'wp-nested-pages'); ?></div>
96
+ <div class="np-default-loading" data-nestedpages-loading>
97
+ <?php include( NestedPages\Helpers::asset('images/spinner.svg') ); ?>
98
+ </div>
99
  <div class="nestedpages-page-search-results" data-nestedpages-search-results>
100
  <ul>
101
  <?php foreach($recent_pages as $page) : ?>
239
  </li>
240
  <?php endif; ?>
241
  <?php
 
242
  $h_taxonomies = $this->post_type_repo->getTaxonomies($type->name, true);
243
  $f_taxonomies = $this->post_type_repo->getTaxonomies($type->name, false);
244
  $taxonomies = array_merge($h_taxonomies, $f_taxonomies);
253
  <div class="nestedpages-sort-options-selection">
254
  <label>
255
  <input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][sort_options][author]" value="true" <?php if ( $this->post_type_repo->sortOptionEnabled($type->name, 'author') ) echo 'checked'; ?> />
256
+ <?php _e('Author', 'wp-nested-pages') ?>
257
  </label>
258
+
259
  <label>
260
+ <input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][sort_options][orderby][enabled]" value="true" <?php if ( $this->post_type_repo->sortOptionEnabled($type->name, 'orderby') ) echo 'checked'; ?> data-nestedpages-sort-option-checkbox />
261
+ <?php _e('Order By', 'wp-nested-pages') ?>
262
  </label>
263
+ <div class="sort-options-default" data-nestedpages-sort-option-default>
264
+ <label><?php _e('Initial Order By:', 'wp-nested-pages'); ?></label>
265
+ <select name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][sort_options][orderby][initial]">
266
+ <?php
267
+ $options = array(
268
+ 'date' => __('Date', 'wp-nested-pages'),
269
+ 'title' => __('Title', 'wp-nested-pages')
270
+ );
271
+ $out = '<option value="">' . __('Default (Menu Order)', 'wp-nested-pages') . '</option>';
272
+ foreach ( $options as $key => $option ){
273
+ $out .= '<option value="' . $key . '"';
274
+ if ( $this->post_type_repo->defaultSortOption($type->name, 'orderby') == $key) $out .= ' selected';
275
+ $out .= '>' . esc_html($option) . '</option>';
276
+ }
277
+ echo $out;
278
+ ?>
279
+ </select>
280
+ </div><!-- .sort-options-default -->
281
+
282
  <label>
283
+ <input type="checkbox" name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][sort_options][order][enabled]" value="true" <?php if ( $this->post_type_repo->sortOptionEnabled($type->name, 'order') ) echo 'checked'; ?> data-nestedpages-sort-option-checkbox />
284
+ <?php _e('Order', 'wp-nested-pages') ?>
285
  </label>
286
+ <div class="sort-options-default" data-nestedpages-sort-option-default>
287
+ <label><?php _e('Initial Order:', 'wp-nested-pages'); ?></label>
288
+ <select name="nestedpages_posttypes[<?php echo esc_attr($type->name); ?>][sort_options][order][initial]">
289
+ <?php
290
+ $options = array(
291
+ 'ASC' => __('Ascending', 'wp-nested-pages'),
292
+ 'DESC' => __('Descending', 'wp-nested-pages')
293
+ );
294
+ $out = '';
295
+ foreach ( $options as $key => $option ){
296
+ $out .= '<option value="' . $key . '"';
297
+ if ( $this->post_type_repo->defaultSortOption($type->name, 'initial_order') == $key) $out .= ' selected';
298
+ $out .= '>' . esc_html($option) . '</option>';
299
+ }
300
+ echo $out;
301
+ ?>
302
+ </select>
303
+ </div><!-- .sort-options-default -->
304
 
305
  <?php if ( !empty($taxonomies) ) : foreach ( $taxonomies as $tax ) : ?>
306
  <label>
313
  </div><!-- .field -->
314
  </div><!-- .row -->
315
  </li>
 
316
  </ul>
317
  </div><!-- .body -->
318
  </div><!-- .post-type -->
assets/css/fonts/nestedpages.eot DELETED
Binary file
assets/css/fonts/nestedpages.svg DELETED
@@ -1,30 +0,0 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Generated by IcoMoon</metadata>
5
- <defs>
6
- <font id="nestedpages" horiz-adv-x="512">
7
- <font-face units-per-em="512" ascent="480" descent="-32" />
8
- <missing-glyph horiz-adv-x="512" />
9
- <glyph unicode="&#x20;" horiz-adv-x="256" d="" />
10
- <glyph unicode="&#xe254;" glyph-name="pencil" d="M442 319.333l-39-39-80 80 39 39c8 8 22 8 30 0l50-50c8-8 8-22 0-30zM64 101.333l236 236 80-80-236-236h-80v80z" />
11
- <glyph unicode="&#xe54e;" glyph-name="tag" d="M117 320.333c18 0 32 14 32 32s-14 32-32 32-32-14-32-32 14-32 32-32zM457 222.333c8-8 12-18 12-30s-4-22-12-30l-150-150c-8-8-18-12-30-12s-22 4-30 12l-192 192c-8 8-12 18-12 30v150c0 23 19 42 42 42h150c12 0 22-4 30-12z" />
12
- <glyph unicode="&#xe5d4;" glyph-name="more_vert" d="M256 128.333c23 0 43-20 43-43s-20-43-43-43-43 20-43 43 20 43 43 43zM256 256.333c23 0 43-20 43-43s-20-43-43-43-43 20-43 43 20 43 43 43zM256 298.333c-23 0-43 20-43 43s20 43 43 43 43-20 43-43-20-43-43-43z" />
13
- <glyph unicode="&#xe600;" glyph-name="sub-menu" d="M102.4 198.4h230.4v76.8l128-102.4-128-102.4v76.8h-281.6v230.4h51.2v-179.2z" />
14
- <glyph unicode="&#xe601;" glyph-name="no" d="M398.080 129.28l-56.064-52.736-87.552 93.44-93.184-87.808-52.736 55.808 93.184 87.808-87.552 93.184 55.808 52.736 87.808-93.184 93.184 87.552 52.48-55.808-93.184-87.808z" />
15
- <glyph unicode="&#xe602;" glyph-name="yes" d="M368.384 339.2l34.304-24.064-137.472-190.72h-34.304l-77.312 102.656 34.304 32 60.16-47.872z" />
16
- <glyph unicode="&#xe603;" glyph-name="menu" d="M435.2 300.8v51.2h-358.4v-51.2h358.4zM435.2 198.4v51.2h-358.4v-51.2h358.4zM435.2 96v51.2h-358.4v-51.2h358.4z" />
17
- <glyph unicode="&#xe604;" glyph-name="arrow-down" d="M384 275.2l-103.168-153.6-101.632 153.6h204.8z" />
18
- <glyph unicode="&#xe605;" glyph-name="arrow-right" d="M204.8 326.4l153.6-103.168-153.6-101.632v204.8z" />
19
- <glyph unicode="&#xe606;" glyph-name="menu2" d="M32 384h448v-96h-448zM32 256h448v-96h-448zM32 128h448v-96h-448z" />
20
- <glyph unicode="&#xe607;" glyph-name="bubble" d="M256 448c141.385 0 256-93.125 256-208s-114.615-208-256-208c-13.578 0-26.905 0.867-39.912 2.522-54.989-54.989-120.625-64.85-184.088-66.298v13.458c34.268 16.789 64 47.37 64 82.318 0 4.877-0.379 9.665-1.082 14.348-57.898 38.132-94.918 96.377-94.918 161.652 0 114.875 114.615 208 256 208z" />
21
- <glyph unicode="&#xe60a;" glyph-name="remove" d="M400 416h-288c-26.51 0-48-21.49-48-48v-16h384v16c0 26.51-21.49 48-48 48zM316.16 448l7.058-50.5h-134.436l7.057 50.5h120.321M320 480h-128c-13.2 0-25.495-10.696-27.321-23.769l-9.357-66.962c-1.827-13.073 7.478-23.769 20.678-23.769h160c13.2 0 22.505 10.696 20.679 23.769l-9.357 66.962c-1.827 13.073-14.122 23.769-27.322 23.769v0zM408 320h-304c-17.6 0-30.696-14.341-29.103-31.869l26.206-288.263c1.593-17.527 17.297-31.868 34.897-31.868h240c17.6 0 33.304 14.341 34.897 31.868l26.205 288.263c1.594 17.528-11.502 31.869-29.102 31.869zM192 32h-48l-16 224h64v-224zM288 32h-64v224h64v-224zM368 32h-48v224h64l-16-224z" />
22
- <glyph unicode="&#xe60b;" glyph-name="eye" d="M256 384c-111.659 0-208.441-65.021-256-160 47.559-94.979 144.341-160 256-160 111.657 0 208.439 65.021 256 160-47.558 94.979-144.343 160-256 160zM382.225 299.148c30.081-19.187 55.571-44.887 74.717-75.148-19.146-30.261-44.637-55.961-74.718-75.149-37.797-24.108-81.445-36.851-126.224-36.851-44.78 0-88.428 12.743-126.225 36.852-30.080 19.186-55.57 44.886-74.717 75.148 19.146 30.262 44.637 55.962 74.717 75.148 1.959 1.25 3.938 2.461 5.929 3.65-4.979-13.664-7.704-28.411-7.704-43.798 0-70.692 57.308-128 128-128s128 57.308 128 128c0 15.387-2.725 30.134-7.704 43.799 1.99-1.189 3.969-2.401 5.929-3.651zM256 275c0-26.51-21.49-48-48-48s-48 21.49-48 48 21.49 48 48 48 48-21.49 48-48z" />
23
- <glyph unicode="&#xe60c;" glyph-name="eye-blocked" d="M419.661 331.792c38.822-27.515 70.685-64.546 92.339-107.792-47.561-94.979-144.343-160-256-160-31.283 0-61.396 5.106-89.589 14.542l38.978 38.978c16.529-3.65 33.486-5.52 50.611-5.52 44.779 0 88.427 12.743 126.223 36.852 30.081 19.188 55.572 44.888 74.718 75.149-18.526 29.283-43.007 54.275-71.825 73.247l34.545 34.544zM256 131c-11.362 0-22.376 1.488-32.864 4.267l156.593 156.592c2.781-10.486 4.271-21.497 4.271-32.859 0-70.692-57.308-128-128-128zM480 480h-26.869l-109.806-109.806c-27.538 8.962-56.877 13.806-87.325 13.806-111.659 0-208.441-65.021-256-160 21.329-42.596 52.564-79.154 90.597-106.534l-90.597-90.597v-26.869h26.869l453.131 453.131v26.869zM208 323c24.022 0 43.923-17.647 47.446-40.685l-54.762-54.762c-23.037 3.524-40.684 23.425-40.684 47.447 0 26.51 21.49 48 48 48zM55.058 224c19.146 30.262 44.637 55.962 74.717 75.148 1.959 1.25 3.938 2.461 5.929 3.65-4.979-13.664-7.704-28.411-7.704-43.798 0-29.262 9.825-56.224 26.349-77.781l-29.275-29.275c-28.036 18.821-51.877 43.386-70.016 72.056z" />
24
- <glyph unicode="&#xe60d;" glyph-name="list" d="M192 448h320v-64h-320v64zM192 256h320v-64h-320v64zM192 64h320v-64h-320v64zM0 416c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64s-64 28.654-64 64zM0 224c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64s-64 28.654-64 64zM0 32c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64s-64 28.654-64 64z" />
25
- <glyph unicode="&#xe611;" glyph-name="plus" d="M496 288h-176v176c0 8.836-7.164 16-16 16h-96c-8.836 0-16-7.164-16-16v-176h-176c-8.836 0-16-7.164-16-16v-96c0-8.836 7.164-16 16-16h176v-176c0-8.836 7.164-16 16-16h96c8.836 0 16 7.164 16 16v176h176c8.836 0 16 7.164 16 16v96c0 8.836-7.164 16-16 16z" />
26
- <glyph unicode="&#xe612;" glyph-name="link" d="M476.698 442.679l-2.014 2.021c-47.074 47.067-124.097 47.067-171.163 0l-109.053-109.068c-47.067-47.066-47.067-124.088 0-171.155l2.013-2.013c3.916-3.924 8.073-7.462 12.368-10.729l39.924 39.925c-4.651 2.747-9.063 6.036-13.058 10.030l-2.021 2.021c-25.557 25.549-25.557 67.136 0 92.695l109.064 109.056c25.558 25.559 67.137 25.559 92.693 0l2.021-2.012c25.55-25.558 25.55-67.146 0-92.695l-49.343-49.343c8.566-21.154 12.624-43.7 12.269-66.193l76.302 76.302c47.067 47.068 47.067 124.089-0.002 171.158zM315.521 285.533c-3.916 3.916-8.073 7.461-12.368 10.72l-39.924-39.916c4.652-2.748 9.063-6.037 13.058-10.031l2.021-2.020c25.558-25.558 25.558-67.136 0-92.694l-109.065-109.067c-25.559-25.551-67.138-25.551-92.694 0l-2.021 2.021c-25.549 25.56-25.549 67.138 0 92.694l49.344 49.343c-8.567 21.153-12.623 43.701-12.269 66.193l-76.301-76.299c-47.068-47.066-47.068-124.089 0-171.162l2.013-2.016c47.076-47.064 124.096-47.064 171.164 0l109.055 109.059c47.067 47.066 47.067 124.097 0 171.163l-2.013 2.012z" />
27
- <glyph unicode="&#xe897;" glyph-name="lock" d="M322 298.333v43c0 36-30 66-66 66s-66-30-66-66v-43h132zM256 106.333c23 0 43 20 43 43s-20 43-43 43-43-20-43-43 20-43 43-43zM384 298.333c23 0 43-19 43-42v-214c0-23-20-42-43-42h-256c-23 0-43 19-43 42v214c0 23 20 42 43 42h21v43c0 59 48 107 107 107s107-48 107-107v-43h21z" />
28
- <glyph unicode="&#xe900;" glyph-name="post" d="M267.264 402.688l46.592 46.592 162.816-162.56-46.848-46.592c-26.88 17.408-63.488 14.592-87.296-9.216l-19.2-19.2c-23.552-23.808-26.624-60.16-8.96-87.296l-46.848-46.592-61.696 61.696-71.68-71.424c-10.752-10.752-86.528-69.376-97.28-58.624s47.616 86.784 58.368 97.536l71.424 71.424-61.696 61.952 46.848 46.592c26.88-17.664 63.488-14.592 87.040 9.216l19.2 19.2c23.808 23.552 26.88 60.16 9.216 87.296z" />
29
- <glyph unicode="&#xe901;" glyph-name="page" d="M153.6 96v332.8h256v-332.8h-256zM128 70.4h204.8v-51.2h-256v332.8h51.2v-281.6z" />
30
- </font></defs></svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/fonts/nestedpages.ttf DELETED
Binary file
assets/css/fonts/nestedpages.woff DELETED
Binary file
assets/css/fonts/nestedpages.woff2 DELETED
Binary file
assets/css/nestedpages.css CHANGED
@@ -1 +1 @@
1
- @font-face{font-family:'nestedpages';src:url("fonts/nestedpages.eot")}@font-face{font-family:'nestedpages';src:url("data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMghi/6sAAAC8AAAAYGNtYXCa4JfrAAABHAAAAIxnYXNwAAAAEAAAAagAAAAIZ2x5ZthTIwkAAAGwAAAIVGhlYWQJZzAVAAAKBAAAADZoaGVhA+IB+QAACjwAAAAkaG10eCsABZEAAApgAAAAYGxvY2EUUBJOAAAKwAAAADJtYXhwACAAUwAACvQAAAAgbmFtZdvrS2kAAAsUAAABtnBvc3QAAwAAAAAMzAAAACAAAwH0AZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpAQHg/+AAIAHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAcAAAABgAEAADAAgAAQAg4lTlTuXU5gfmDeYS6JfpAf/9//8AAAAAACDiVOVO5dTmAOYK5hHol+kA//3//wAB/+MdsBq3GjIaBxoFGgIXfhcWAAMAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAPAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAIAQAAVAboBjwAJAA4AAAEHJzc2Mh8BFhQFNxcHIwG6J1AnBhIGMgb+gOxQ7FABPydQJwYGMgYS4OxQ7AAAAAACACsAAAHVAaoACwAlAAATMjY1NCYjIgYVFBYFHgEVFAYPAQ4BIyImLwEuAT0BNDY7ATIWF3UNExIODRMSAWIGBgYGlgYPCQkPBsAGBhkRlgkPBgFAEw0OEhIODRNiBg8JCQ8GlgYGBgbABg8JlhIYBgYAAAMA1QAqASsBgAALABcAIwAAJTIWFRQGIyImNTQ2NzIWFRQGIyImNTQ2NyImNTQ2MzIWFRQGAQARGhoRERoaEREaGhERGhoRERoaEREaGoAZEhEaGhESGYAZEhEaGhESGSoaERIZGRIRGgAAAAEAMwBGAc0BegAJAAA3MzUXBzUhNTMVZueAgP7mM8ZNZmdN57QAAAABAG0ATQGTAXQACwAAJQcnByc3JzcXNxcHAY44WF00XVg4WF00XYE0XVg4WF01XVc4WAAAAQCaAHwBkwFTAAYAAAEXByMnNxcBcCOKIk0iPAFTGL9nIDAAAwBNAGABswFgAAMABwALAAABNSEVBTUhFQU1IRUBs/6aAWb+mgFm/poBLTMzZzQ0ZjMzAAEAswB6AYABEwADAAABByczAYBnZs0BE5mZAAABAM0AegFmAUYAAwAAExcHNc2ZmQFGZ2XMAAAAAwAgACAB4AGAAAMABwALAAATIRUhFSEVIRUhFSEgAcD+QAHA/kABwP5AAYBgIGAgYAAAAAEAAP/gAgABwAAeAAABMh4CFRQOAiMiJicOAQc1PgE1NCY1LgE1ND4CAQA1XUYoKEZdNQoUCilfMBomASwzKEZdAcAhOEwrK0w4IQECKhgBDgwsGgQHAx1UMStMOCEAAAcAQP/gAcAB4AAJAA4AHwAvADMANwA7AAABISIGHQEhNTQmJxcjNzM3IyIGDwEGFjsBMjYvAS4BIxchIgYXEx4BOwEyNjcTNiYDIyczFyM1MxcjNTMBkP7gFBwBgBxoB4YHeASAChABCgEMCqAKDAEKARAKWP7QDREBGgEVDfANFQEaARHlMBBAYEBAUDBAAaAcFBAQFBwgMjIgDgpDCg0NCkMKDqATDf7gDRMTDQEgDRP+4ODg4ODgAAAAAwAAAEACAAGAABMAOABEAAABIg4CBx4DMzI+AjcuAxceARcOAQcOASMiJicuASc+ATc+ATcOARUUFjMyNjU0JiceARcHFAYjIiY1NDYzMhYBACpNQjUSEjVCTSoqTUI1EhI1Qk1UFyYODiYXHEAiIkAcFyYODiYXAQMCBARLNTVLBAQCAwF+HBQUHBwUFBwBgBcqOyQkOyoXFyo7JCQ7KhdVDiYXFyYOEhMTEg4mFxcmDgECAQoWDDVLSzUMFgoBAgEYFBwcFBQcHAAABQAAAAACAAHgABkAIwA1AD8AUAAAAR4BFw4DIyImJzceATMyNjc+ATcuASc3ByImJzceARUUBhMjBy4BIyIOAgceARcHFTMBBTIWFwcuATU0Ngc+ATc+ATcOARUUFhcHLgEnAaQdLxASNUJNKhctFicNGQ0iQBwXJg4OJBYjpAkQCJ0CAkurG24ULBcqTUI1EhAuHVsbAcX+8BIbAjYSFxyFDiYXAQMCBAQODB0VIw4BTBU3ICQ7KhcHCCcDAxMSDiYXFiUOI8kCAp0IEAk1SwFdbgcHFyo7JCA2FVobAcWCFxI2AhsSFBxjFyYOAQIBChYMFigQHQ4kFgAABgAA/+ACAAHgAAMABwALABcAIwAvAAATIRUhFSEVIRUhFSEDNDYzMhYVFAYjIiYVNDYzMhYVFAYjIiYVNDYzMhYVFAYjIibAAUD+wAFA/sABQP7AwCUbGyUlGxslJRsbJSUbGyUlGxslJRsbJQHAQIBAgEABoBslJRsbJSWlGyUlGxslJaUbJSUbGyUlAAAAAQAA/+ACAAHgACMAAAEjNTQmKwEiBh0BIyIGHQEUFjsBFRQWOwEyNj0BMzI2PQE0JgHwsAkHYAcJsAcJCQewCQdgBwmwBwkJASCwBwkJB7AJB2AHCbAHCQkHsAkHYAcJAAAAAAIAIwADAd0BvQAjAEgAAAEnJiIPAQYUHwEeARc3LgEvASY0PwE2Mh8BFhQPAR4BBzc2NAcuAScHHgEfARYUDwEGIi8BJjQ/AS4BNwcGFB8BFjI/ATY0LwEB3QIkZCNuIyMCAwcDKAQGAwITE20TNhMCFBQxBwYBTSPEAwcDKAQGAwITE20TNhMCFBQxBwYBTSMjAiRkI24jIwIBuwIjI20kZCQCAgYCKAIFAwITNhNtFBQCEzYTMg8iEU0jZHkCBgIoAgUDAhM2E20UFAITNhMyDyIRTSNkJAIjI20kZCQCAAAAAAMAVQAAAasBwAAIABQALQAAATU0JiMiBh0BFzI2NTQmIyIGFRQWNzIWHQEUBiMhIiY9ATQ2OwE1NDYzMhYdAQFCJxsbJ0IRGhoRERoakREaGhH/ABEaGhEVPywsPwEqKxsnJxsrwBoREhkZEhEawBgS1hEZGRHWEhgrLT4+LSsAAQAlAAkB3QHBAB0AAAE3FwcmBg8BDgEXBycHDgEnJjY/ASc3FjY/AT4BJwELL6MvFDIRFBEFDS4+SAhRCAg6CEg+LxQxEhMSBQ4Bky6iLw0EEhMSMRUuPkgIOwgJUQhHPi8NBBITEjEVAAAAAgBNABMBmgGtAAQACgAANxEhESEHMxUhETOaAQD/ABrN/wAzYAFN/rMaMwFNAAAAAQAAAAEAAPW5O21fDzz1AAsCAAAAAADUI/esAAAAANQj96wAAP/gAgAB4AAAAAgAAgAAAAAAAAABAAAB4P/gAAACAAAAAAACAAABAAAAAAAAAAAAAAAAAAAAGAIAAAAAAAAAAAAAAAEAAAACAABAAgAAKwIAANUCAAAzAgAAbQIAAJoCAABNAgAAswIAAM0CAAAgAgAAAAIAAEACAAAAAgAAAAIAAAACAAAAAgAAIwIAAFUCAAAlAgAATQAAAAAACgAUAB4APgB4AK4AwgDcAO4BCAEWASQBPgFuAcwCMgKwAvgDKgOcA9wEEgQqAAAAAQAAABgAUQAHAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAsAAAABAAAAAAACAAcAhAABAAAAAAADAAsAQgABAAAAAAAEAAsAmQABAAAAAAAFAAsAIQABAAAAAAAGAAsAYwABAAAAAAAKABoAugADAAEECQABABYACwADAAEECQACAA4AiwADAAEECQADABYATQADAAEECQAEABYApAADAAEECQAFABYALAADAAEECQAGABYAbgADAAEECQAKADQA1G5lc3RlZHBhZ2VzAG4AZQBzAHQAZQBkAHAAYQBnAGUAc1ZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMG5lc3RlZHBhZ2VzAG4AZQBzAHQAZQBkAHAAYQBnAGUAc25lc3RlZHBhZ2VzAG4AZQBzAHQAZQBkAHAAYQBnAGUAc1JlZ3VsYXIAUgBlAGcAdQBsAGEAcm5lc3RlZHBhZ2VzAG4AZQBzAHQAZQBkAHAAYQBnAGUAc0ZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") format("truetype");font-weight:normal;font-style:normal}[class^="np-icon-"],[class*=" np-icon-"]{font-family:'nestedpages' !important;speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.np-icon-pencil:before{content:"\e254"}.np-icon-lock:before{content:"\e897"}.np-icon-tag:before{content:"\e54e"}.np-icon-more_vert:before{content:"\e5d4"}.np-icon-page:before{content:"\e901"}.np-icon-post:before{content:"\e900"}.np-icon-no:before{content:"\e601"}.np-icon-yes:before{content:"\e602"}.np-icon-menu:before{content:"\e603"}.np-icon-arrow-down:before{content:"\e604"}.np-icon-arrow-right:before{content:"\e605"}.np-icon-sub-menu:before{content:"\e600"}.np-icon-bubble:before{content:"\e607"}.np-icon-remove:before{content:"\e60a"}.np-icon-list:before{content:"\e60d"}.np-icon-menu2:before{content:"\e606"}.np-icon-link:before{content:"\e612"}.np-icon-eye:before{content:"\e60b"}.np-icon-eye-blocked:before{content:"\e60c"}.np-icon-plus:before{content:"\e611"}.np-btn,.np-toggle-edit{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}.np-btn:hover,.np-toggle-edit: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-toggle-edit:disabled,.np-btn.disabled,.disabled.np-toggle-edit{opacity:.6;cursor:not-allowed}.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-toggle-edit{display:none;float:right;margin-right:10px;position:relative;top:9px}.np-toggle-edit.active{background-color:#0074a2;color:#fff;-webkit-box-shadow:none;box-shadow:none;border-color:#0074a2}@media (max-width: 767px){.np-toggle-edit{display:inline-block}}.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}.modal-open{overflow:hidden}.np-modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:99999;-webkit-overflow-scrolling:touch;outline:0}.np-modal .modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#000;opacity:.85;z-index:9999}.np-modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform 0.3s ease-out;-o-transition:-o-transform 0.3s ease-out;transition:-webkit-transform 0.3s ease-out;-o-transition:transform 0.3s ease-out;transition:transform 0.3s ease-out;transition:transform 0.3s ease-out, -webkit-transform 0.3s ease-out}.np-modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);transform:translate(0, 0)}.np-modal .modal-open .modal{overflow-x:hidden;overflow-y:auto}.np-modal .modal-dialog{position:relative;width:90%;height:80%;margin:10px auto 0px auto;max-width:800px;z-index:9999}.np-modal .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}.np-modal .modal-header{padding:8px;background-color:#ebebeb}.np-modal .modal-header .sr-only{display:none}.np-modal .modal-header .close{margin-top:-2px}.np-modal .modal-title{margin:0}.np-modal .modal-body{position:relative;padding:10px}.np-modal .modal-body.new-child{padding:0}.np-modal .modal-footer{padding:10px;text-align:right;background-color:#404040;zoom:1}.np-modal .modal-footer:before,.np-modal .modal-footer:after{content:" ";display:table}.np-modal .modal-footer:after{clear:both}.np-modal .modal-footer .modal-close{float:left}.np-modal .modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.clone-modal h3{margin:0;padding:8px;background-color:#e5e5e5}.clone-modal .form-control{margin:0 !important;padding:5px 10px}.np-trash-modal{text-align:center}.np-trash-modal .modal-body{padding-bottom:30px}.np-trash-modal .button-primary{margin-left: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{float:left}.nestedpages .updated{clear:both}.nestedpages-toggleall.np-btn,.nestedpages-toggleall.np-toggle-edit{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}#nested-loading{display:none;float:right;width:30px;margin:0px 20px 0 0}.nestedpages-top-toggles{zoom:1;padding-top:10px}.nestedpages-top-toggles:before,.nestedpages-top-toggles:after{content:" ";display:table}.nestedpages-top-toggles:after{clear:both}.np-tabs{background-color:#ebebeb;padding:0px}.np-tabs ul{text-align:left;list-style-type:none;margin:0;padding:0}.np-tabs ul li{display:inline-block;margin:0}.np-tabs ul li a{display:block;text-decoration:none;padding:5px 10px}.np-tabs ul li a.active{position:relative;color:#333;background-color:#fff}.np-tabs ul li a:focus,.np-tabs ul li a:active{outline:none;-webkit-box-shadow:none;box-shadow:none}.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-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{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:20px}.nestedpages ol .locked em{font-style:normal}.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;margin-left:10px}.nestedpages ol .np-assigned-pt-actions li{display:inline-block;background:transparent;border:0}.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:46px;background-color:#f0f0f0;text-align:center;position:relative}.nestedpages .child-toggle .child-toggle-spacer{height:46px;width:100%}.nestedpages .child-toggle a{position:absolute;top:50%;left:8px;margin-top:-16px;width:28px;height:28px;background-color:#fff;border:1px solid #e1e1e1;-webkit-border-radius:20px;border-radius:20px;font-size:20px;line-height:30px;color:#333;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease}.nestedpages .child-toggle a i{line-height:26px}.nestedpages .child-toggle a:hover{background-color:#0074a2;color:#fff;border-color:#0074a2}.nestedpages .handle{display:inline-block;cursor:move;font-size:20px;margin-top:-8px;position:relative;top:2px;color:#b3b3b3;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease}.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;color:#999}.nestedpages .row.no-sort .page-title{padding-left:10px}.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{background-color:#ebebeb;text-align:center}.nestedpages .np-thumbnail.link i{font-size:1.8em;opacity:.5}.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 li ol .row .np-icon-sub-menu{display:inline-block}.nestedpages li ol .row .handle{display:none}.nestedpages li ol .row:hover .np-icon-sub-menu{display:none}.nestedpages li ol .row:hover .handle{display:inline-block}.nestedpages li ol .row.no-sort .np-icon-sub-menu{display:inline-block}.nestedpages .row{background-color:#fff;display:table;width:100%}.nestedpages .row:hover{background-color:#f0f0f0}.nestedpages .row:hover .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}.nestedpages .action-buttons a.np-btn-trash{margin-left:4px}.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{display:block}.nestedpages .row:hover .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 .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 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:100%}.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-toggle-options,.nestedpages .new-child .np-toggle-options{background-color:#f2f2f2;padding:5px}.nestedpages .quick-edit .np-taxonomies,.nestedpages .quick-edit .np-menuoptions,.nestedpages .new-child .np-taxonomies,.nestedpages .new-child .np-menuoptions{display:none;clear:both;background-color:#f9f9f9;padding:8px;zoom:1;margin-top:5px}.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,.nestedpages .new-child .np-menuoptions{padding:15px}.nestedpages .quick-edit .np-menuoptions label,.nestedpages .quick-edit .np-menuoptions input[type="text"],.nestedpages .new-child .np-menuoptions label,.nestedpages .new-child .np-menuoptions input[type="text"]{display:block;float:none;width:100%}.nestedpages .quick-edit .np-menuoptions .menuoptions-left,.nestedpages .new-child .np-menuoptions .menuoptions-left{float:left;width:47%}.nestedpages .quick-edit .np-menuoptions .menuoptions-right,.nestedpages .new-child .np-menuoptions .menuoptions-right{float:right;width:47%;padding-top:18px}.nestedpages .quick-edit .np-menuoptions .menuoptions-right label,.nestedpages .new-child .np-menuoptions .menuoptions-right label{margin-bottom:10px}.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;height:auto;line-height:26px}.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}.np-qe-loading{display:none;float:right;width:25px;height:25px;margin:2px 10px 0 0;background:url("../images/loading-white.gif") no-repeat}@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}.modal-body.np-menu-item-form{height:400px;padding:0;border-top:1px solid #e1e1e1}.np-menu-type-selection{float:left;height:100%;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%;float:right;height:100%;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{display:none;height:30px;background:url("../images/spinner.gif") no-repeat;background-position:center}.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 .loading-indicator{display:none;text-align:center;padding:30px 0}.np-wpml-translations-modal.loading .np-translations-table{display:none}.np-wpml-translations-modal.loading .loading-indicator{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,.nestedpages-settings-table .np-toggle-edit{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,.nestedpages-settings-table .np-toggle-edit: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-toggle-edit:disabled,.nestedpages-settings-table .np-btn.disabled,.nestedpages-settings-table .disabled.np-toggle-edit{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-table{border:1px solid #e5e5e5;-webkit-border-radius:3px;border-radius:3px}.nestedpages-settings-table .row-container{background-color:#fff;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 .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}
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%;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}.nestedpages-modal-content.active{top:50px;-webkit-transition:all 200ms ease;-o-transition:all 200ms ease;transition:all 200ms ease}.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-tabs{background-color:#ebebeb;padding:0px}.np-tabs ul{text-align:left;list-style-type:none;margin:0;padding:0}.np-tabs ul li{display:inline-block;margin:0}.np-tabs ul li a{display:block;text-decoration:none;padding:5px 10px}.np-tabs ul li a.active{position:relative;color:#333;background-color:#fff}.np-tabs ul li a:focus,.np-tabs ul li a:active{outline:none;-webkit-box-shadow:none;box-shadow:none}.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;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;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:46px;background-color:#f0f0f0;text-align:center;position:relative}.nestedpages .child-toggle .child-toggle-spacer{height:46px;width:100%}.nestedpages .child-toggle a{position:absolute;top:50%;left:8px;margin-top:-16px;width:28px;height:28px;background-color:#fff;border:1px solid #e1e1e1;-webkit-border-radius:20px;border-radius:20px;font-size:20px;line-height:30px;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 .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:hover{background-color:#333;border-color:#333}.nestedpages .child-toggle a:hover .np-icon-arrow{border-left-color:#fff}.nestedpages .np-icon-arrow{display:inline-block;vertical-align:middle;width:0;height:0;position:relative;top:-3px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:6px solid #333}.nestedpages .handle{display:inline-block;cursor:move;margin-top:-8px;position:relative;top:2px;width:22px;height:22px;color:#b3b3b3;-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;width:18px;height:18px}.nestedpages .np-icon-sub-menu .arrow{fill:#999}.nestedpages .row.no-sort .page-title{padding-left:10px}.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 li ol .row .np-icon-sub-menu{display:inline-block}.nestedpages li ol .row .handle{display:none}.nestedpages li ol .row:hover .np-icon-sub-menu{display:none}.nestedpages li ol .row:hover .handle{display:inline-block}.nestedpages 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 .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 .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 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:100%}.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-toggle-options,.nestedpages .new-child .np-toggle-options{background-color:#f2f2f2;padding:5px}.nestedpages .quick-edit .np-taxonomies,.nestedpages .quick-edit .np-menuoptions,.nestedpages .new-child .np-taxonomies,.nestedpages .new-child .np-menuoptions{display:none;clear:both;background-color:#f9f9f9;padding:8px;zoom:1;margin-top:5px}.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,.nestedpages .new-child .np-menuoptions{padding:15px}.nestedpages .quick-edit .np-menuoptions label,.nestedpages .quick-edit .np-menuoptions input[type="text"],.nestedpages .new-child .np-menuoptions label,.nestedpages .new-child .np-menuoptions input[type="text"]{display:block;float:none;width:100%}.nestedpages .quick-edit .np-menuoptions .menuoptions-left,.nestedpages .new-child .np-menuoptions .menuoptions-left{float:left;width:47%}.nestedpages .quick-edit .np-menuoptions .menuoptions-right,.nestedpages .new-child .np-menuoptions .menuoptions-right{float:right;width:47%;padding-top:18px}.nestedpages .quick-edit .np-menuoptions .menuoptions-right label,.nestedpages .new-child .np-menuoptions .menuoptions-right label{margin-bottom:10px}.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}.modal-body.np-menu-item-form{height:400px;padding:0;border-top:1px solid #e1e1e1}.np-menu-type-selection{float:left;height:100%;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%;float:right;height:100%;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-table{border:1px solid #e5e5e5;-webkit-border-radius:3px;border-radius:3px}.nestedpages-settings-table .row-container{background-color:#fff;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 .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}
assets/images/loading-white.gif DELETED
Binary file
assets/images/loading.gif DELETED
Binary file
assets/images/spinner-2x.gif DELETED
Binary file
assets/images/spinner.gif DELETED
Binary file
assets/images/spinner.svg ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 40 40" enable-background="new 0 0 40 40" xml:space="preserve">
2
+ <path d="M20,0C9,0,0,9,0,20c0,11,9,20,20,20s20-9,20-20C40,9,31,0,20,0z M20,14.1c-2.3,0-4.1-1.8-4.1-4.1s1.8-4.1,4.1-4.1
3
+ s4.1,1.8,4.1,4.1S22.3,14.1,20,14.1z"/>
4
+ </svg>
assets/js/lib/bootstrap.min.js DELETED
@@ -1,7 +0,0 @@
1
- /*!
2
- * Bootstrap v3.3.2 (http://getbootstrap.com)
3
- * Copyright 2011-2015 Twitter, Inc.
4
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
- */
6
- if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.2",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.2",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.2",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a(this.options.trigger).filter('[href="#'+b.id+'"], [data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.2",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0,trigger:'[data-toggle="collapse"]'},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":a.extend({},e.data(),{trigger:this});c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.2",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27|32)/.test(b.which)&&!/input|textarea/i.test(b.target.tagName)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g&&27!=b.which||g&&27==b.which)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.divider):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(b.target);38==b.which&&j>0&&j--,40==b.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.2",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.options.backdrop&&d.adjustBackdrop(),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in").attr("aria-hidden",!1),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$element.find(".modal-dialog").one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a('<div class="modal-backdrop '+e+'" />').prependTo(this.$element).on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.options.backdrop&&this.adjustBackdrop(),this.adjustDialog()},c.prototype.adjustBackdrop=function(){this.$backdrop.css("height",0).css("height",this.$element[0].scrollHeight)},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){this.bodyIsOverflowing=document.body.scrollHeight>document.documentElement.clientHeight,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.3.2",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-m<p.top?"bottom":"right"==h&&k.right+l>p.width?"left":"left"==h&&k.left-l<p.left?"right":h,f.removeClass(n).addClass(h)}var q=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(q,h);var r=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",r).emulateTransitionEnd(c.TRANSITION_DURATION):r()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=this.tip(),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.2",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},c.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){var e=a.proxy(this.process,this);this.$body=a("body"),this.$scrollElement=a(a(c).is("body")?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.2",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b="offset",c=0;a.isWindow(this.$scrollElement[0])||(b="position",c=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var d=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+c,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){d.offsets.push(this[0]),d.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.2",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()
7
- }var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.2",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a("body").height();"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
 
 
 
 
 
 
 
assets/js/lib/bs-modal.js DELETED
@@ -1,281 +0,0 @@
1
- /* ========================================================================
2
- * Bootstrap: modal.js v3.3.0
3
- * http://getbootstrap.com/javascript/#modals
4
- * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
6
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
- * ======================================================================== */
8
-
9
-
10
- +function ($) {
11
- 'use strict';
12
-
13
- // MODAL CLASS DEFINITION
14
- // ======================
15
-
16
- var Modal = function (element, options) {
17
- this.options = options
18
- this.$body = $(document.body)
19
- this.$element = $(element)
20
- this.$backdrop =
21
- this.isShown = null
22
- this.scrollbarWidth = 0
23
-
24
- if (this.options.remote) {
25
- this.$element
26
- .find('.modal-content')
27
- .load(this.options.remote, $.proxy(function () {
28
- this.$element.trigger('loaded.bs.modal')
29
- }, this))
30
- }
31
- }
32
-
33
- Modal.VERSION = '3.3.0'
34
-
35
- Modal.TRANSITION_DURATION = 300
36
- Modal.BACKDROP_TRANSITION_DURATION = 150
37
-
38
- Modal.DEFAULTS = {
39
- backdrop: true,
40
- keyboard: true,
41
- show: true
42
- }
43
-
44
- Modal.prototype.toggle = function (_relatedTarget) {
45
- return this.isShown ? this.hide() : this.show(_relatedTarget)
46
- }
47
-
48
- Modal.prototype.show = function (_relatedTarget) {
49
- var that = this
50
- var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
51
-
52
- this.$element.trigger(e)
53
-
54
- if (this.isShown || e.isDefaultPrevented()) return
55
-
56
- this.isShown = true
57
-
58
- this.checkScrollbar()
59
- this.$body.addClass('modal-open')
60
-
61
- this.setScrollbar()
62
- this.escape()
63
-
64
- this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
65
-
66
- this.backdrop(function () {
67
- var transition = $.support.transition && that.$element.hasClass('fade')
68
-
69
- if (!that.$element.parent().length) {
70
- that.$element.appendTo(that.$body) // don't move modals dom position
71
- }
72
-
73
- that.$element
74
- .show()
75
- .scrollTop(0)
76
-
77
- if (transition) {
78
- that.$element[0].offsetWidth // force reflow
79
- }
80
-
81
- that.$element
82
- .addClass('in')
83
- .attr('aria-hidden', false)
84
-
85
- that.enforceFocus()
86
-
87
- var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
88
-
89
- transition ?
90
- that.$element.find('.modal-dialog') // wait for modal to slide in
91
- .one('bsTransitionEnd', function () {
92
- that.$element.trigger('focus').trigger(e)
93
- })
94
- .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
95
- that.$element.trigger('focus').trigger(e)
96
- })
97
- }
98
-
99
- Modal.prototype.hide = function (e) {
100
- if (e) e.preventDefault()
101
-
102
- e = $.Event('hide.bs.modal')
103
-
104
- this.$element.trigger(e)
105
-
106
- if (!this.isShown || e.isDefaultPrevented()) return
107
-
108
- this.isShown = false
109
-
110
- this.escape()
111
-
112
- $(document).off('focusin.bs.modal')
113
-
114
- this.$element
115
- .removeClass('in')
116
- .attr('aria-hidden', true)
117
- .off('click.dismiss.bs.modal')
118
-
119
- $.support.transition && this.$element.hasClass('fade') ?
120
- this.$element
121
- .one('bsTransitionEnd', $.proxy(this.hideModal, this))
122
- .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
123
- this.hideModal()
124
- }
125
-
126
- Modal.prototype.enforceFocus = function () {
127
- $(document)
128
- .off('focusin.bs.modal') // guard against infinite focus loop
129
- .on('focusin.bs.modal', $.proxy(function (e) {
130
- if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
131
- this.$element.trigger('focus')
132
- }
133
- }, this))
134
- }
135
-
136
- Modal.prototype.escape = function () {
137
- if (this.isShown && this.options.keyboard) {
138
- this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
139
- e.which == 27 && this.hide()
140
- }, this))
141
- } else if (!this.isShown) {
142
- this.$element.off('keydown.dismiss.bs.modal')
143
- }
144
- }
145
-
146
- Modal.prototype.hideModal = function () {
147
- var that = this
148
- this.$element.hide()
149
- this.backdrop(function () {
150
- that.$body.removeClass('modal-open')
151
- that.resetScrollbar()
152
- that.$element.trigger('hidden.bs.modal')
153
- })
154
- }
155
-
156
- Modal.prototype.removeBackdrop = function () {
157
- this.$backdrop && this.$backdrop.remove()
158
- this.$backdrop = null
159
- }
160
-
161
- Modal.prototype.backdrop = function (callback) {
162
- var that = this
163
- var animate = this.$element.hasClass('fade') ? 'fade' : ''
164
-
165
- if (this.isShown && this.options.backdrop) {
166
- var doAnimate = $.support.transition && animate
167
-
168
- this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
169
- .prependTo(this.$element)
170
- .on('click.dismiss.bs.modal', $.proxy(function (e) {
171
- if (e.target !== e.currentTarget) return
172
- this.options.backdrop == 'static'
173
- ? this.$element[0].focus.call(this.$element[0])
174
- : this.hide.call(this)
175
- }, this))
176
-
177
- if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
178
-
179
- this.$backdrop.addClass('in')
180
-
181
- if (!callback) return
182
-
183
- doAnimate ?
184
- this.$backdrop
185
- .one('bsTransitionEnd', callback)
186
- .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
187
- callback()
188
-
189
- } else if (!this.isShown && this.$backdrop) {
190
- this.$backdrop.removeClass('in')
191
-
192
- var callbackRemove = function () {
193
- that.removeBackdrop()
194
- callback && callback()
195
- }
196
- $.support.transition && this.$element.hasClass('fade') ?
197
- this.$backdrop
198
- .one('bsTransitionEnd', callbackRemove)
199
- .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
200
- callbackRemove()
201
-
202
- } else if (callback) {
203
- callback()
204
- }
205
- }
206
-
207
- Modal.prototype.checkScrollbar = function () {
208
- this.scrollbarWidth = this.measureScrollbar()
209
- }
210
-
211
- Modal.prototype.setScrollbar = function () {
212
- var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
213
- if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
214
- }
215
-
216
- Modal.prototype.resetScrollbar = function () {
217
- this.$body.css('padding-right', '')
218
- }
219
-
220
- Modal.prototype.measureScrollbar = function () { // thx walsh
221
- if (document.body.clientWidth >= window.innerWidth) return 0
222
- var scrollDiv = document.createElement('div')
223
- scrollDiv.className = 'modal-scrollbar-measure'
224
- this.$body.append(scrollDiv)
225
- var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
226
- this.$body[0].removeChild(scrollDiv)
227
- return scrollbarWidth
228
- }
229
-
230
-
231
- // MODAL PLUGIN DEFINITION
232
- // =======================
233
-
234
- function Plugin(option, _relatedTarget) {
235
- return this.each(function () {
236
- var $this = $(this)
237
- var data = $this.data('bs.modal')
238
- var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
239
-
240
- if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
241
- if (typeof option == 'string') data[option](_relatedTarget)
242
- else if (options.show) data.show(_relatedTarget)
243
- })
244
- }
245
-
246
- var old = $.fn.modal
247
-
248
- $.fn.modal = Plugin
249
- $.fn.modal.Constructor = Modal
250
-
251
-
252
- // MODAL NO CONFLICT
253
- // =================
254
-
255
- $.fn.modal.noConflict = function () {
256
- $.fn.modal = old
257
- return this
258
- }
259
-
260
-
261
- // MODAL DATA-API
262
- // ==============
263
-
264
- $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
265
- var $this = $(this)
266
- var href = $this.attr('href')
267
- var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
268
- var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
269
-
270
- if ($this.is('a')) e.preventDefault()
271
-
272
- $target.one('show.bs.modal', function (showEvent) {
273
- if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
274
- $target.one('hidden.bs.modal', function () {
275
- $this.is(':visible') && $this.trigger('focus')
276
- })
277
- })
278
- Plugin.call($target, option, this)
279
- })
280
-
281
- }(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/lib/nestedpages-factory.js CHANGED
@@ -69,7 +69,7 @@ NestedPages.selectors = {
69
 
70
  // Link Items
71
  openLinkModal : '.open-redirect-modal', // Opens new link modal
72
- linkModal : '#np-link-modal', // The add a link modal
73
  saveLink : '.np-save-link', // Save Link Button
74
  linkLoadingIndicator : '.np-link-loading', // Loading Indicator in Link Modal
75
  linkErrorDiv : '.np-new-link-error', // Error Div in Link Modal
@@ -78,7 +78,7 @@ NestedPages.selectors = {
78
  // Link Deletion
79
  linkDeleteButton : '[data-np-confirm-delete]',
80
  linkDeleteConfirmationButton : '[data-delete-confirmation]',
81
- linkDeleteConfirmationModal : '#np-delete-confirmation-modal',
82
  linkDeleteConfirmationModalText : '[data-np-link-delete-text]',
83
 
84
  // New Page Items
@@ -92,11 +92,13 @@ NestedPages.selectors = {
92
  addChildButton : '.add-new-child', // Button to add child page(s)
93
  newChildError : '.np-newchild-error', // Error div in new child quick edit
94
  cancelNewChildButton : '.np-cancel-newchild', // Cancel button in new child quick edit
 
 
95
 
96
  // Clone
97
  cloneButton : '.clone-post', // Button to clone a post
98
  confirmClone : '[data-confirm-clone]', // Button in modal to confirm clone
99
- cloneModal : '#np-clone-modal', // Modal with clone options
100
  cloneQuantity : '[data-clone-quantity]', // Quantity to Clone
101
  cloneStatus : '[data-clone-status]', // Clone Status
102
  cloneAuthor : '[data-clone-author]', // Clone Author
@@ -119,8 +121,6 @@ NestedPages.selectors = {
119
 
120
  // CSS Classes
121
  NestedPages.cssClasses = {
122
- iconToggleDown : 'np-icon-arrow-down',
123
- iconToggleRight : 'np-icon-arrow-right',
124
  noborder : 'no-border'
125
  }
126
 
@@ -151,6 +151,7 @@ NestedPages.formActions = {
151
  syncNesting : 'npsort',
152
  syncMenu : 'npsyncMenu',
153
  newPage : 'npnewChild',
 
154
  quickEditLink : 'npquickEditLink',
155
  getTaxonomies : 'npgetTaxonomies',
156
  quickEditPost : 'npquickEdit',
@@ -173,7 +174,8 @@ NestedPages.Factory = function()
173
  var $ = jQuery;
174
 
175
  plugin.formatter = new NestedPages.Formatter;
176
- plugin.responsive = new NestedPages.Responsive;
 
177
  plugin.checkAll = new NestedPages.CheckAll;
178
  plugin.bulkActions = new NestedPages.BulkActions;
179
  plugin.menuToggle = new NestedPages.MenuToggle;
@@ -190,6 +192,7 @@ NestedPages.Factory = function()
190
  plugin.confirmDelete = new NestedPages.ConfirmDelete;
191
  plugin.manualSync = new NestedPages.ManualSync;
192
  plugin.postSearch = new NestedPages.PostSearch;
 
193
  plugin.wpml = new NestedPages.Wpml;
194
 
195
  plugin.init = function()
69
 
70
  // Link Items
71
  openLinkModal : '.open-redirect-modal', // Opens new link modal
72
+ linkModal : 'np-link-modal', // The add a link modal
73
  saveLink : '.np-save-link', // Save Link Button
74
  linkLoadingIndicator : '.np-link-loading', // Loading Indicator in Link Modal
75
  linkErrorDiv : '.np-new-link-error', // Error Div in Link Modal
78
  // Link Deletion
79
  linkDeleteButton : '[data-np-confirm-delete]',
80
  linkDeleteConfirmationButton : '[data-delete-confirmation]',
81
+ linkDeleteConfirmationModal : 'np-delete-confirmation-modal',
82
  linkDeleteConfirmationModalText : '[data-np-link-delete-text]',
83
 
84
  // New Page Items
92
  addChildButton : '.add-new-child', // Button to add child page(s)
93
  newChildError : '.np-newchild-error', // Error div in new child quick edit
94
  cancelNewChildButton : '.np-cancel-newchild', // Cancel button in new child quick edit
95
+ newBeforeButton : 'data-insert-before', // Add new post(s) before a post
96
+ newAfterButton : 'data-insert-after', // Add new post(s) after a post
97
 
98
  // Clone
99
  cloneButton : '.clone-post', // Button to clone a post
100
  confirmClone : '[data-confirm-clone]', // Button in modal to confirm clone
101
+ cloneModal : 'np-clone-modal', // Modal with clone options
102
  cloneQuantity : '[data-clone-quantity]', // Quantity to Clone
103
  cloneStatus : '[data-clone-status]', // Clone Status
104
  cloneAuthor : '[data-clone-author]', // Clone Author
121
 
122
  // CSS Classes
123
  NestedPages.cssClasses = {
 
 
124
  noborder : 'no-border'
125
  }
126
 
151
  syncNesting : 'npsort',
152
  syncMenu : 'npsyncMenu',
153
  newPage : 'npnewChild',
154
+ newBeforeAfter : 'npnewBeforeAfter',
155
  quickEditLink : 'npquickEditLink',
156
  getTaxonomies : 'npgetTaxonomies',
157
  quickEditPost : 'npquickEdit',
174
  var $ = jQuery;
175
 
176
  plugin.formatter = new NestedPages.Formatter;
177
+ plugin.dropdowns = new NestedPages.Dropdowns;
178
+ plugin.modals = new NestedPages.Modals;
179
  plugin.checkAll = new NestedPages.CheckAll;
180
  plugin.bulkActions = new NestedPages.BulkActions;
181
  plugin.menuToggle = new NestedPages.MenuToggle;
192
  plugin.confirmDelete = new NestedPages.ConfirmDelete;
193
  plugin.manualSync = new NestedPages.ManualSync;
194
  plugin.postSearch = new NestedPages.PostSearch;
195
+ plugin.postMove = new NestedPages.MovePost;
196
  plugin.wpml = new NestedPages.Wpml;
197
 
198
  plugin.init = function()
assets/js/lib/nestedpages-responsive.js DELETED
@@ -1,55 +0,0 @@
1
- var NestedPages = NestedPages || {};
2
-
3
- /**
4
- * Responsive functionality for nested view
5
- * @package Nested Pages
6
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
7
- */
8
- NestedPages.Responsive = function()
9
- {
10
- var plugin = this;
11
- var $ = jQuery;
12
-
13
- plugin.init = function()
14
- {
15
- plugin.bindEvents();
16
- }
17
-
18
- plugin.bindEvents = function()
19
- {
20
- $(document).on('click', NestedPages.selectors.toggleEditButtons, function(e){
21
- e.preventDefault();
22
- plugin.toggleEdit($(this));
23
- });
24
- // Remove the block display when sizing up
25
- $(window).resize(function() {
26
- plugin.timer(function(){
27
- $('.action-buttons').removeAttr('style');
28
- $('.np-toggle-edit').removeClass('active');
29
- }, 500);
30
- });
31
- }
32
-
33
- // Toggle the responsive edit buttons
34
- plugin.toggleEdit = function(button)
35
- {
36
- var buttons = $(button).siblings('.action-buttons');
37
- if ( $(buttons).is(':visible') ){
38
- $(button).removeClass('active');
39
- $(buttons).hide();
40
- return;
41
- }
42
- $(button).addClass('active');
43
- $(buttons).show();
44
- }
45
-
46
- plugin.timer = (function(){
47
- var timer = 0;
48
- return function(callback, ms){
49
- clearTimeout (timer);
50
- timer = setTimeout(callback, ms);
51
- };
52
- })();
53
-
54
- return plugin.init();
55
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/lib/nestedpages.bulk-actions.js CHANGED
@@ -157,6 +157,7 @@ NestedPages.BulkActions = function()
157
  {
158
  plugin.toggleLinkCountAlert();
159
  if ( visible ){
 
160
  $(NestedPages.selectors.bulkEditForm).show();
161
  $(NestedPages.selectors.bulkActionsForm).hide();
162
  plugin.setWPSuggest();
@@ -182,6 +183,18 @@ NestedPages.BulkActions = function()
182
  $(NestedPages.selectors.bulkEditLinkCount).parent('div').show();
183
  }
184
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  /**
186
  * Initialize WP Auto Suggest on Flat Taxonomy fields
187
  */
@@ -202,6 +215,7 @@ NestedPages.BulkActions = function()
202
  var selectFields = $(NestedPages.selectors.bulkEditForm).find('select');
203
  $.each(selectFields, function(){
204
  $(this).find('option').first().prop('selected', true);
 
205
  });
206
  var categoryChecklists = $(NestedPages.selectors.bulkEditForm).find('.cat-checklist');
207
  $.each(categoryChecklists, function(){
157
  {
158
  plugin.toggleLinkCountAlert();
159
  if ( visible ){
160
+ plugin.disableParentOptions();
161
  $(NestedPages.selectors.bulkEditForm).show();
162
  $(NestedPages.selectors.bulkActionsForm).hide();
163
  plugin.setWPSuggest();
183
  $(NestedPages.selectors.bulkEditLinkCount).parent('div').show();
184
  }
185
 
186
+ /**
187
+ * Set parent options to disabled for selected posts
188
+ */
189
+ plugin.disableParentOptions = function()
190
+ {
191
+ var selectElement = $(NestedPages.selectors.bulkEditForm).find('select[name=post_parent]');
192
+ for ( var i = 0; i < plugin.selectedPosts.length; i++ )
193
+ {
194
+ $(selectElement).find('option[value=' + plugin.selectedPosts[i].id + ']').attr('disabled', true);
195
+ }
196
+ }
197
+
198
  /**
199
  * Initialize WP Auto Suggest on Flat Taxonomy fields
200
  */
215
  var selectFields = $(NestedPages.selectors.bulkEditForm).find('select');
216
  $.each(selectFields, function(){
217
  $(this).find('option').first().prop('selected', true);
218
+ $(this).find('option').removeAttr('disabled');
219
  });
220
  var categoryChecklists = $(NestedPages.selectors.bulkEditForm).find('.cat-checklist');
221
  $.each(categoryChecklists, function(){
assets/js/lib/nestedpages.clone.js CHANGED
@@ -16,12 +16,6 @@ NestedPages.Clone = function()
16
 
17
  plugin.formatter = new NestedPages.Formatter;
18
 
19
- plugin.init = function()
20
- {
21
- plugin.bindEvents();
22
- }
23
-
24
-
25
  plugin.bindEvents = function()
26
  {
27
  $(document).on('click', NestedPages.selectors.cloneButton, function(e){
@@ -40,11 +34,10 @@ NestedPages.Clone = function()
40
  // Open the modal with clone options
41
  plugin.openModal = function()
42
  {
43
- $(NestedPages.selectors.cloneModal).find('[data-clone-parent]').text(plugin.parent_title);
44
- $(NestedPages.selectors.cloneModal).modal('show');
45
  }
46
 
47
-
48
  // Clone the post
49
  plugin.clone = function()
50
  {
@@ -63,24 +56,23 @@ NestedPages.Clone = function()
63
  },
64
  success : function(data){
65
  plugin.toggleLoading(false);
66
- $(NestedPages.selectors.cloneModal).modal('hide');
67
  location.reload();
68
  }
69
  });
70
  }
71
 
72
-
73
  // Toggle Loading
74
  plugin.toggleLoading = function(loading)
75
  {
76
  if ( loading ){
77
- $(NestedPages.selectors.cloneModal).find('[data-clone-loading]').show();
78
  $(NestedPages.selectors.confirmClone).attr('disabled', 'disabled');
79
  return;
80
  }
81
- $(NestedPages.selectors.cloneModal).find('[data-clone-loading]').hide();
82
  $(NestedPages.selectors.confirmClone).attr('disabled', false);
83
  }
84
 
85
- return plugin.init();
86
  }
16
 
17
  plugin.formatter = new NestedPages.Formatter;
18
 
 
 
 
 
 
 
19
  plugin.bindEvents = function()
20
  {
21
  $(document).on('click', NestedPages.selectors.cloneButton, function(e){
34
  // Open the modal with clone options
35
  plugin.openModal = function()
36
  {
37
+ $('#' + NestedPages.selectors.cloneModal).find('[data-clone-parent]').text(plugin.parent_title);
38
+ $(document).trigger('open-modal-manual', NestedPages.selectors.cloneModal);
39
  }
40
 
 
41
  // Clone the post
42
  plugin.clone = function()
43
  {
56
  },
57
  success : function(data){
58
  plugin.toggleLoading(false);
59
+ $(document).trigger('close-modal-manual');
60
  location.reload();
61
  }
62
  });
63
  }
64
 
 
65
  // Toggle Loading
66
  plugin.toggleLoading = function(loading)
67
  {
68
  if ( loading ){
69
+ $('#' + NestedPages.selectors.cloneModal).find('[data-clone-loading]').show();
70
  $(NestedPages.selectors.confirmClone).attr('disabled', 'disabled');
71
  return;
72
  }
73
+ $('#' + NestedPages.selectors.cloneModal).find('[data-clone-loading]').hide();
74
  $(NestedPages.selectors.confirmClone).attr('disabled', false);
75
  }
76
 
77
+ return plugin.bindEvents();
78
  }
assets/js/lib/nestedpages.confirm-delete.js CHANGED
@@ -38,7 +38,7 @@ NestedPages.ConfirmDelete = function()
38
  plugin.deleteLink = $(button).attr('href');
39
  $(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation_singular);
40
  $(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.delete).removeClass('bulk');
41
- $(NestedPages.selectors.linkDeleteConfirmationModal).modal('show');
42
  }
43
 
44
  // Confirm Multiple link deletion
@@ -50,7 +50,7 @@ NestedPages.ConfirmDelete = function()
50
  event.preventDefault();
51
  $(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation);
52
  $(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.trash_delete_links).addClass('bulk');
53
- $(NestedPages.selectors.linkDeleteConfirmationModal).modal('show');
54
  }
55
 
56
  // Submit the form to delete multiple
38
  plugin.deleteLink = $(button).attr('href');
39
  $(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation_singular);
40
  $(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.delete).removeClass('bulk');
41
+ $(document).trigger('open-modal-manual', NestedPages.selectors.linkDeleteConfirmationModal);
42
  }
43
 
44
  // Confirm Multiple link deletion
50
  event.preventDefault();
51
  $(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation);
52
  $(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.trash_delete_links).addClass('bulk');
53
+ $(document).trigger('open-modal-manual', [NestedPages.selectors.linkDeleteConfirmationModal]);
54
  }
55
 
56
  // Submit the form to delete multiple
assets/js/lib/nestedpages.dropdowns.js ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var NestedPages = NestedPages || {};
2
+ /**
3
+ * Dropdowns
4
+ *
5
+ * @author Kyle Phillips
6
+ *
7
+ * To use, wrap dropdown content and toggle link/button in an element with data attribute of data-dropdown
8
+ * Give content data attribute of data-dropdown-content and toggle element data attribute of data-dropdown-toggle
9
+ * For CSS, wrapping/parent element gets class of "dropdown", content gets class of "dropdown-content"
10
+ */
11
+ NestedPages.Dropdowns = function()
12
+ {
13
+ var self = this;
14
+ var $ = jQuery;
15
+
16
+ self.dropdown = ''; // The Active Dropdown
17
+ self.activeBtn = ''; // The Active Button
18
+ self.activeContent = ''; // The Active Dropdown Content
19
+ self.toggleBtn = '[data-dropdown-toggle]';
20
+ self.dropdownContainer = '[data-dropdown]';
21
+ self.dropdownContent = '[data-dropdown-content]'
22
+
23
+ self.selectors = {
24
+ caret_up : 'icon-arrow_drop_up',
25
+ caret_down : 'icon-arrow_drop_down'
26
+ }
27
+
28
+ self.bindEvents = function()
29
+ {
30
+ $(document).on('click', self.toggleBtn, function(e){
31
+ e.preventDefault();
32
+ self.activeBtn = $(this);
33
+ self.dropdown = $(this).parents(self.dropdownContainer);
34
+ self.toggleDropdown();
35
+ });
36
+ $(document).on('click', function(e){
37
+ self.closeDropdowns(e.target);
38
+ });
39
+ $(document).on('dropdown-opened', function(e, content){
40
+ if ( $(content).parents(NestedPages.selectors.row).length > 0 ){
41
+ $(content).parents(NestedPages.selectors.row).addClass('active');
42
+ }
43
+ });
44
+ $(document).on('dropdown-closed', function(){
45
+ $(NestedPages.selectors.row).removeClass('active');
46
+ });
47
+ }
48
+
49
+ self.toggleDropdown = function()
50
+ {
51
+ $('.' + self.selectors.caret_up).attr('class', self.selectors.caret_down);
52
+ var content = $(self.dropdown).find(self.dropdownContent);
53
+ self.activeContent = content;
54
+ if ( $(content).hasClass('active') ){
55
+ $(content).removeClass('active');
56
+ $(self.activeBtn).removeClass('active');
57
+ $(self.activeBtn).find('.' + self.selectors.caret_up).attr('class', self.selectors.caret_down);
58
+ $(document).trigger('dropdown-closed', content);
59
+ return;
60
+ }
61
+ self.setPositioning();
62
+ $(self.toggleBtn).removeClass('active');
63
+ $(self.dropdownContent).removeClass('active');
64
+ $(content).addClass('active');
65
+ $(self.activeBtn).find('.' + self.selectors.caret_down).attr('class', self.selectors.caret_up);
66
+ $(self.activeBtn).addClass('active');
67
+ $(document).trigger('dropdown-opened', content);
68
+ }
69
+
70
+
71
+ self.setPositioning = function()
72
+ {
73
+ var buttonHeight = $(self.activeBtn).outerHeight();
74
+ $(self.activeContent).css('top', buttonHeight + 'px');
75
+ }
76
+
77
+ self.closeDropdowns = function(target)
78
+ {
79
+ if ( $(target).parents(self.dropdownContainer).length === 0 ){
80
+ $(self.dropdownContent).removeClass('active');
81
+ $(self.toggleBtn).removeClass('active');
82
+ $(self.activeBtn).find('.' + self.selectors.caret_up).attr('class', self.selectors.caret_down);
83
+ var content;
84
+ $(document).trigger('dropdown-closed', content);
85
+ }
86
+ }
87
+
88
+ return self.bindEvents();
89
+ }
assets/js/lib/nestedpages.formatter.js CHANGED
@@ -21,11 +21,12 @@ NestedPages.Formatter = function()
21
  var row = $(button).parent('.row').parent('li');
22
  if ( $(row).children('ol').length > 0 ){ // Row has a child menu
23
 
24
- var icon = ( $(row).children('ol:visible').length > 0 )
25
- ? NestedPages.cssClasses.iconToggleDown
26
- : NestedPages.cssClasses.iconToggleRight;
27
-
28
- $(button).html('<div class="child-toggle-spacer"></div><a href="#"><i class="' + icon + '"></i></a>');
 
29
 
30
  if ( ($(row).children('ol').children('.np-hide').length > 0) && ($(row).children('ol').children('.np-hide.shown').length === 0) ){
31
  $(button).find('a').hide();
21
  var row = $(button).parent('.row').parent('li');
22
  if ( $(row).children('ol').length > 0 ){ // Row has a child menu
23
 
24
+ var open = ( $(row).children('ol:visible').length > 0 ) ? true : false;
25
+ var html = '<div class="child-toggle-spacer"></div>';
26
+ html += '<a href="#"';
27
+ if ( open ) html += ' class="open"';
28
+ html += '><span class="np-icon-arrow"></span></a>';
29
+ $(button).html(html);
30
 
31
  if ( ($(row).children('ol').children('.np-hide').length > 0) && ($(row).children('ol').children('.np-hide.shown').length === 0) ){
32
  $(button).find('a').hide();
assets/js/lib/nestedpages.menu-links.js CHANGED
@@ -75,7 +75,7 @@ NestedPages.MenuLinks = function()
75
  plugin.submitForm();
76
  });
77
  $(document).on('keydown', function(e){
78
- if ( e.keyCode === 27 ) $('#np-link-modal').modal('hide');
79
  });
80
  }
81
 
@@ -88,7 +88,7 @@ NestedPages.MenuLinks = function()
88
  plugin.clearForm();
89
  $(plugin.selectors.accordion).find('ul').hide();
90
  $(plugin.selectors.typeSelect).removeClass('active');
91
- $(NestedPages.selectors.linkModal).modal('show');
92
  }
93
 
94
  // Accordion Menu
@@ -203,10 +203,13 @@ NestedPages.MenuLinks = function()
203
  var html = '<li id="menuItem_' + plugin.post.id + '" class="page-row published';
204
  html += '">'
205
 
206
- html += '<div class="row"><div class="child-toggle"><div class="child-toggle-spacer"></div></div><div class="row-inner"><i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i><a href="' + plugin.post.np_link_content + '" class="page-link page-title" target="_blank"><span class="title">' + plugin.post.menuTitle + ' <i class="np-icon-link"></i></span>';
 
 
 
207
 
208
  // Quick Edit Button
209
- html += '</a><a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ';
210
  html += 'data-id="' + plugin.post.id + '"';
211
  html += 'data-parentid="' + plugin.post.parent_id + '"';
212
  html += 'data-title="' + plugin.post.menuTitle + '" ';
@@ -236,7 +239,7 @@ NestedPages.MenuLinks = function()
236
  plugin.appendChildRow(html);
237
  }
238
 
239
- $(NestedPages.selectors.linkModal).modal('hide');
240
 
241
  plugin.row = $('#menuItem_' + plugin.post.id).find('.row');
242
  plugin.formatter.flashRow(plugin.row);
75
  plugin.submitForm();
76
  });
77
  $(document).on('keydown', function(e){
78
+ if ( e.keyCode === 27 ) $(document).trigger('close-modal-manual');
79
  });
80
  }
81
 
88
  plugin.clearForm();
89
  $(plugin.selectors.accordion).find('ul').hide();
90
  $(plugin.selectors.typeSelect).removeClass('active');
91
+ $(document).trigger('open-modal-manual', NestedPages.selectors.linkModal);
92
  }
93
 
94
  // Accordion Menu
203
  var html = '<li id="menuItem_' + plugin.post.id + '" class="page-row published';
204
  html += '">'
205
 
206
+ html += '<div class="row"><div class="child-toggle"><div class="child-toggle-spacer"></div></div><div class="row-inner">';
207
+ 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>';
208
+ 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>';
209
+ 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>';
210
 
211
  // Quick Edit Button
212
+ html += '</a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ';
213
  html += 'data-id="' + plugin.post.id + '"';
214
  html += 'data-parentid="' + plugin.post.parent_id + '"';
215
  html += 'data-title="' + plugin.post.menuTitle + '" ';
239
  plugin.appendChildRow(html);
240
  }
241
 
242
+ $(document).trigger('close-modal-manual');
243
 
244
  plugin.row = $('#menuItem_' + plugin.post.id).find('.row');
245
  plugin.formatter.flashRow(plugin.row);
assets/js/lib/nestedpages.menu-toggle.js CHANGED
@@ -29,9 +29,7 @@ NestedPages.MenuToggle = function()
29
  plugin.toggleSingleMenu = function(button)
30
  {
31
  var submenu = $(button).parent(NestedPages.selectors.childToggle).parent(NestedPages.selectors.row).siblings('ol');
32
- $(button).find('i')
33
- .toggleClass(NestedPages.cssClasses.iconToggleDown)
34
- .toggleClass(NestedPages.cssClasses.iconToggleRight);
35
  $(submenu).toggle();
36
  plugin.formatter.setBorders();
37
  plugin.formatter.setNestedMargins();
@@ -46,8 +44,7 @@ NestedPages.MenuToggle = function()
46
  if ( $(button).attr('data-toggle') === 'closed' ){
47
  $(NestedPages.selectors.lists).show();
48
  $(button).attr('data-toggle', 'opened').text(NestedPages.jsData.collapseText);
49
- $(NestedPages.selectors.childToggle).find('i').removeClass(NestedPages.cssClasses.iconToggleRight).addClass(NestedPages.cssClasses.iconToggleDown);
50
- // revert_quick_edit();
51
  plugin.formatter.setBorders();
52
  plugin.syncUserToggles();
53
  return;
@@ -55,8 +52,7 @@ NestedPages.MenuToggle = function()
55
 
56
  $(NestedPages.selectors.lists).not($(NestedPages.selectors.lists)[0]).hide();
57
  $(button).attr('data-toggle', 'closed').text(NestedPages.jsData.expandText);
58
- $(NestedPages.selectors.childToggle).find('i').removeClass(NestedPages.cssClasses.iconToggleDown).addClass(NestedPages.cssClasses.iconToggleRight);
59
- // revert_quick_edit();
60
  plugin.formatter.setBorders();
61
  plugin.syncUserToggles();
62
  }
29
  plugin.toggleSingleMenu = function(button)
30
  {
31
  var submenu = $(button).parent(NestedPages.selectors.childToggle).parent(NestedPages.selectors.row).siblings('ol');
32
+ $(button).toggleClass('open');
 
 
33
  $(submenu).toggle();
34
  plugin.formatter.setBorders();
35
  plugin.formatter.setNestedMargins();
44
  if ( $(button).attr('data-toggle') === 'closed' ){
45
  $(NestedPages.selectors.lists).show();
46
  $(button).attr('data-toggle', 'opened').text(NestedPages.jsData.collapseText);
47
+ $(NestedPages.selectors.childToggle + ' a').addClass('open');
 
48
  plugin.formatter.setBorders();
49
  plugin.syncUserToggles();
50
  return;
52
 
53
  $(NestedPages.selectors.lists).not($(NestedPages.selectors.lists)[0]).hide();
54
  $(button).attr('data-toggle', 'closed').text(NestedPages.jsData.expandText);
55
+ $(NestedPages.selectors.childToggle + ' a').removeClass('open');
 
56
  plugin.formatter.setBorders();
57
  plugin.syncUserToggles();
58
  }
assets/js/lib/nestedpages.modals.js ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var NestedPages = NestedPages || {};
2
+ /**
3
+ * Modal Windows
4
+ *
5
+ * @author Kyle Phillips
6
+ *
7
+ * To use, include a modal backdrop and modal content window with the appropriate data-attributes
8
+ * The data attributes should match the value of the toggle buttons data-modal-toggle attribute
9
+ */
10
+ NestedPages.Modals = function()
11
+ {
12
+ var self = this;
13
+ var $ = jQuery;
14
+
15
+ self.activeBtn = '';
16
+ self.activeModal = '';
17
+ self.modalOpen = false;
18
+
19
+ self.selectors = {
20
+ toggleBtn : '[data-nestedpages-modal-toggle]',
21
+ backdrop : '[data-nestedpages-modal-backdrop]',
22
+ closeBtn : '[data-nestedpages-modal-close]',
23
+ title : 'data-nestedpages-modal-title',
24
+ content : 'data-nestedpages-modal-content'
25
+ }
26
+
27
+ self.bindEvents = function()
28
+ {
29
+ $(document).on('click', self.selectors.toggleBtn, function(e){
30
+ e.preventDefault();
31
+ self.activeBtn = $(this);
32
+ self.openModal();
33
+ });
34
+ $(document).on('click', self.selectors.closeBtn, function(e){
35
+ e.preventDefault();
36
+ self.closeModals();
37
+ });
38
+ $(document).on('open-modal-manual', function(e, modal){
39
+ self.activeModal = $('[data-nestedpages-modal="' + modal + '"]');
40
+ self.openModal();
41
+ });
42
+ $(document).on('close-modal-manual', function(e){
43
+ self.closeModals();
44
+ });
45
+ $(document).on('click', self.selectors.backdrop, function(e){
46
+ self.closeModals();
47
+ });
48
+ $(document).ready(function(){
49
+ self.checkHash();
50
+ });
51
+ }
52
+
53
+ /**
54
+ * Open the Modal Window
55
+ */
56
+ self.openModal = function()
57
+ {
58
+ if ( self.modalOpen ){
59
+ self.closeModals();
60
+ return;
61
+ }
62
+ if ( $(self.activeBtn).length > 0 ){
63
+ var modal = $(self.activeBtn).attr('data-nestedpages-modal-toggle');
64
+ self.activeModal = $('*[data-nestedpages-modal="' + modal + '"]');
65
+ }
66
+ $(self.activeModal).addClass('active');
67
+ self.modalOpen = true;
68
+ self.populateModal();
69
+ $(document).trigger('open-modal', [self.activeBtn, self.activeModal]);
70
+ }
71
+
72
+ /**
73
+ * Close the Modal Window
74
+ */
75
+ self.closeModals = function()
76
+ {
77
+ self.modalOpen = false;
78
+ $('[data-nestedpages-modal]').removeClass('active');
79
+ self.activeModal = '';
80
+ self.activeBtn = '';
81
+ }
82
+
83
+ /**
84
+ * Populate the Modal if needed
85
+ */
86
+ self.populateModal = function()
87
+ {
88
+ var title = $(self.activeBtn).attr(self.selectors.title);
89
+ if ( typeof title !== 'undefined' && title !== '' ){
90
+ $(self.activeModal).find('[data-nestedpages-modal-title]').text(title);
91
+ }
92
+ var content = $(self.activeBtn).attr(self.selectors.content);
93
+ if ( typeof content !== 'undefined' && content !== '' ){
94
+ $(self.activeModal).find('[data-nestedpages-modal-content]').html(content);
95
+ }
96
+ }
97
+
98
+ /**
99
+ * Check for Hash
100
+ */
101
+ self.checkHash = function()
102
+ {
103
+ if ( !window.location.hash ) return;
104
+ var hashType = window.location.hash.substring(0, 6);
105
+ if ( hashType !== '#modal' ) return;
106
+
107
+ var modalId = window.location.hash.substring(7);
108
+ self.activeModal = $('*[data-nestedpages-modal="' + modalId + '"]');
109
+ self.openModal();
110
+ }
111
+
112
+ return self.bindEvents();
113
+ }
assets/js/lib/nestedpages.move-post.js ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var NestedPages = NestedPages || {};
2
+
3
+ /**
4
+ * Move a Post Up or Down in the list
5
+ * @package Nested Pages
6
+ * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
7
+ */
8
+ NestedPages.MovePost = function()
9
+ {
10
+ var plugin = this;
11
+ var $ = jQuery;
12
+
13
+ plugin.formatter = new NestedPages.Formatter;
14
+ plugin.nesting = new NestedPages.Nesting;
15
+ plugin.activeRow;
16
+
17
+ plugin.selectors = {
18
+ moveToTop : 'data-push-to-top',
19
+ moveToBottom : 'data-push-to-bottom'
20
+ }
21
+
22
+ plugin.bindEvents = function()
23
+ {
24
+ $(document).ready(function(){
25
+ plugin.disableTopOnFirst();
26
+ plugin.disableBottomOnLast();
27
+ });
28
+ $(document).on('click', '[' + plugin.selectors.moveToTop + ']', function(e){
29
+ e.preventDefault();
30
+ if ( $(this).hasClass('disabled') ) return;
31
+ plugin.activeRow = $(this).closest(NestedPages.selectors.rows);
32
+ plugin.moveToTop();
33
+ });
34
+ $(document).on('click', '[' + plugin.selectors.moveToBottom + ']', function(e){
35
+ e.preventDefault();
36
+ if ( $(this).hasClass('disabled') ) return;
37
+ plugin.activeRow = $(this).closest(NestedPages.selectors.rows);
38
+ plugin.moveToBottom();
39
+ });
40
+ }
41
+
42
+ /**
43
+ * Move a post to the top of its list
44
+ */
45
+ plugin.moveToTop = function()
46
+ {
47
+ var parent = $(plugin.activeRow).parent(NestedPages.selectors.lists);
48
+ var first = $(parent).find(NestedPages.selectors.rows).first();
49
+ $(plugin.activeRow).insertBefore(first);
50
+ plugin.formatter.setBorders();
51
+ $(document).click(); // Close Dropdowns
52
+ plugin.nesting.syncNesting();
53
+ plugin.disableTopOnFirst();
54
+ plugin.disableBottomOnLast();
55
+ }
56
+
57
+ /**
58
+ * Move a post to the bottom of its list
59
+ */
60
+ plugin.moveToBottom = function()
61
+ {
62
+ var parent = $(plugin.activeRow).parent(NestedPages.selectors.lists);
63
+ var last = $(parent).children(NestedPages.selectors.rows).last();
64
+ $(plugin.activeRow).insertAfter(last);
65
+ plugin.formatter.setBorders();
66
+ $(document).click(); // Close Dropdowns
67
+ plugin.nesting.syncNesting();
68
+ plugin.disableTopOnFirst();
69
+ plugin.disableBottomOnLast();
70
+ }
71
+
72
+ plugin.disableTopOnFirst = function()
73
+ {
74
+ var lists = $(NestedPages.selectors.lists);
75
+ $.each(lists, function(){
76
+ $(this).find('[' + plugin.selectors.moveToTop + ']').removeClass('disabled');
77
+ var first = $(this).find(NestedPages.selectors.rows).first();
78
+ $(first).find('[' + plugin.selectors.moveToTop + ']').addClass('disabled');
79
+ });
80
+ }
81
+
82
+ plugin.disableBottomOnLast = function()
83
+ {
84
+ var lists = $(NestedPages.selectors.lists);
85
+ $.each(lists, function(){
86
+ $(this).find('[' + plugin.selectors.moveToBottom + ']').removeClass('disabled');
87
+ var last = $(this).find(NestedPages.selectors.rows).last();
88
+ $(last).find('[' + plugin.selectors.moveToBottom + ']').addClass('disabled');
89
+ });
90
+ }
91
+
92
+ return plugin.bindEvents();
93
+ }
assets/js/lib/nestedpages.nesting.js CHANGED
@@ -12,37 +12,68 @@ NestedPages.Nesting = function()
12
 
13
  plugin.formatter = new NestedPages.Formatter;
14
 
15
-
16
  // Make the Menu sortable
17
  plugin.initializeSortable = function()
18
  {
19
- maxLevels = ( NestedPages.jsData.nestable ) ? 0 : 1;
 
20
  $(NestedPages.selectors.sortable).not(NestedPages.selectors.notSortable).nestedSortable({
21
  items : NestedPages.selectors.rows,
22
  toleranceElement: '> .row',
23
  handle: NestedPages.selectors.handle,
24
  placeholder: "ui-sortable-placeholder",
25
- maxLevels: maxLevels,
26
  tabSize : 56,
 
 
 
27
  start: function(e, ui){
28
- ui.placeholder.height(ui.item.height());
29
- },
30
- sort: function(e, ui){
31
- plugin.formatter.updatePlaceholderWidth(ui);
32
- },
33
- stop: function(e, ui){
34
- setTimeout(
35
- function(){
36
- plugin.formatter.updateSubMenuToggle();
37
- plugin.formatter.setBorders();
38
- plugin.formatter.setNestedMargins();
39
- }, 100
40
- );
41
- plugin.syncNesting();
42
- },
43
  });
44
  }
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  // Disable Nesting
48
  plugin.disableNesting = function()
@@ -54,11 +85,17 @@ NestedPages.Nesting = function()
54
  // Sync Nesting
55
  plugin.syncNesting = function(manual, callback)
56
  {
 
 
57
  if ( nestedpages.manual_order_sync === '1' && !manual) return;
58
  $(NestedPages.selectors.errorDiv).hide();
59
  $(NestedPages.selectors.loadingIndicator).show();
60
-
61
- list = $(NestedPages.selectors.sortable).nestedSortable('toHierarchy', {startDepthCount: 0});
 
 
 
 
62
  plugin.disableNesting();
63
 
64
  var syncmenu = NestedPages.jsData.syncmenu;
@@ -91,4 +128,32 @@ NestedPages.Nesting = function()
91
  });
92
  }
93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  }
12
 
13
  plugin.formatter = new NestedPages.Formatter;
14
 
 
15
  // Make the Menu sortable
16
  plugin.initializeSortable = function()
17
  {
18
+ if ( !NestedPages.jsData.nestable ) return plugin.initializeSortableFlat();
19
+
20
  $(NestedPages.selectors.sortable).not(NestedPages.selectors.notSortable).nestedSortable({
21
  items : NestedPages.selectors.rows,
22
  toleranceElement: '> .row',
23
  handle: NestedPages.selectors.handle,
24
  placeholder: "ui-sortable-placeholder",
 
25
  tabSize : 56,
26
+ isAllowed: function(placeholder, placeholderParent, currentItem){
27
+ return ( $(placeholderParent).hasClass('post-type-np-redirect') && !$(currentItem).hasClass('post-type-np-redirect') ) ? false : true;
28
+ },
29
  start: function(e, ui){
30
+ ui.placeholder.height(ui.item.height());
31
+ },
32
+ sort: function(e, ui){
33
+ plugin.formatter.updatePlaceholderWidth(ui);
34
+ },
35
+ stop: function(e, ui){
36
+ setTimeout(
37
+ function(){
38
+ plugin.formatter.updateSubMenuToggle();
39
+ plugin.formatter.setBorders();
40
+ plugin.formatter.setNestedMargins();
41
+ }, 100
42
+ );
43
+ plugin.syncNesting();
44
+ },
45
  });
46
  }
47
 
48
+ // Initialize Flat Sortable (Non-Hierarchical Post Types)
49
+ plugin.initializeSortableFlat = function()
50
+ {
51
+ var lists = $(NestedPages.selectors.lists).not(NestedPages.selectors.notSortable);
52
+ $.each(lists, function(){
53
+ $(this).sortable({
54
+ items : '>' + NestedPages.selectors.rows,
55
+ handle: NestedPages.selectors.handle,
56
+ placeholder: "ui-sortable-placeholder",
57
+ forcePlaceholderSize: true,
58
+ start: function(e, ui){
59
+ ui.placeholder.height(ui.item.height());
60
+ },
61
+ sort: function(e, ui){
62
+ plugin.formatter.updatePlaceholderWidth(ui);
63
+ },
64
+ stop: function(e, ui){
65
+ setTimeout(
66
+ function(){
67
+ plugin.formatter.updateSubMenuToggle();
68
+ plugin.formatter.setBorders();
69
+ plugin.formatter.setNestedMargins();
70
+ }, 100
71
+ );
72
+ plugin.syncNesting();
73
+ },
74
+ });
75
+ });
76
+ }
77
 
78
  // Disable Nesting
79
  plugin.disableNesting = function()
85
  // Sync Nesting
86
  plugin.syncNesting = function(manual, callback)
87
  {
88
+ var list;
89
+
90
  if ( nestedpages.manual_order_sync === '1' && !manual) return;
91
  $(NestedPages.selectors.errorDiv).hide();
92
  $(NestedPages.selectors.loadingIndicator).show();
93
+ if ( NestedPages.jsData.nestable ){
94
+ list = $(NestedPages.selectors.sortable).nestedSortable('toHierarchy', {startDepthCount: 0});
95
+ } else {
96
+ list = plugin.setNestingArray();
97
+ }
98
+
99
  plugin.disableNesting();
100
 
101
  var syncmenu = NestedPages.jsData.syncmenu;
128
  });
129
  }
130
 
131
+ plugin.setNestingArray = function(list)
132
+ {
133
+ ret = [];
134
+ $(NestedPages.selectors.lists).first().children('li.page-row').each(function() {
135
+ var level = plugin.recursiveNesting(this);
136
+ ret.push(level);
137
+ });
138
+ return ret;
139
+ }
140
+
141
+ plugin.recursiveNesting = function(item) {
142
+ var id = $(item).attr('id');
143
+ var currentItem;
144
+ if (id) {
145
+ id = id.replace('menuItem_', '');
146
+ currentItem = {
147
+ "id": id
148
+ };
149
+ if ($(item).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).length > 0) {
150
+ currentItem.children = [];
151
+ $(item).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).each(function() {
152
+ var level = plugin.recursiveNesting(this);
153
+ currentItem.children.push(level);
154
+ });
155
+ }
156
+ return currentItem;
157
+ }
158
+ }
159
  }
assets/js/lib/nestedpages.new-link.js DELETED
@@ -1,157 +0,0 @@
1
- var NestedPages = NestedPages || {};
2
-
3
- /**
4
- * Add a new Link (top level and child)
5
- * @package Nested Pages
6
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
7
- * @todo - remove in 1.4.1
8
- */
9
- NestedPages.NewLink = function()
10
- {
11
- var plugin = this;
12
- var $ = jQuery;
13
-
14
- plugin.postParent = 0; // Parent Post ID
15
- plugin.post = ''; // New Post Data
16
- plugin.row = ''; // Newly Appended Row
17
-
18
- plugin.formatter = new NestedPages.Formatter;
19
-
20
- plugin.init = function()
21
- {
22
- plugin.bindEvents();
23
- }
24
-
25
-
26
- plugin.bindEvents = function()
27
- {
28
- $(document).on('click', NestedPages.selectors.openLinkModal, function(e){
29
- e.preventDefault();
30
- plugin.postParent = $(this).attr('data-parentid');
31
- plugin.openModal();
32
- });
33
- $(document).on('click', NestedPages.selectors.saveLink, function(e){
34
- e.preventDefault();
35
- plugin.saveLink();
36
- });
37
- }
38
-
39
-
40
- // Open the Modal and Clear/Populate hidden fields
41
- plugin.openModal = function()
42
- {
43
- $(NestedPages.selectors.linkErrorDiv).hide();
44
- $(NestedPages.selectors.linkModal).find('input').val('');
45
- $(NestedPages.selectors.linkModal).find('.parent_id').val(plugin.postParent);
46
- $(NestedPages.selectors.linkModal).modal('show');
47
- }
48
-
49
-
50
- // Toggle the loading state in the link modal
51
- plugin.toggleLoading = function(loading)
52
- {
53
- if ( loading ){
54
- $(NestedPages.selectors.linkErrorDiv).hide();
55
- $(NestedPages.selectors.linkLoadingIndicator).show();
56
- $(NestedPages.selectors.saveLink).attr('disabled', 'disabled');
57
- return;
58
- }
59
- $(NestedPages.selectors.linkLoadingIndicator).hide();
60
- $(NestedPages.selectors.saveLink).attr('disabled', false);
61
- }
62
-
63
-
64
- // Save the link
65
- plugin.saveLink = function()
66
- {
67
- plugin.toggleLoading(true);
68
- var data = $(NestedPages.selectors.linkForm).serialize();
69
-
70
- $.ajax({
71
- url: NestedPages.jsData.ajaxurl,
72
- type: 'POST',
73
- datatype: 'json',
74
- data: data + '&action=' + NestedPages.formActions.newLink + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
75
- success: function(data){
76
- plugin.toggleLoading(false);
77
- if (data.status === 'error'){
78
- $(NestedPages.selectors.linkErrorDiv).text(data.message).show();
79
- return;
80
- }
81
- plugin.post = data.post_data;
82
- plugin.createRow();
83
- }
84
- });
85
- }
86
-
87
-
88
- // Create the nested pages row for the new link
89
- plugin.createRow = function()
90
- {
91
- var html = '<li id="menuItem_' + plugin.post.id + '" class="page-row';
92
- if ( plugin.post._status === 'publish' ) html += ' published';
93
- html += '">'
94
-
95
- html += '<div class="row"><div class="child-toggle"><div class="child-toggle-spacer"></div></div><div class="row-inner"><i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i><a href="' + plugin.post.np_link_content + '" class="page-link page-title" target="_blank"><span class="title">' + plugin.post.np_link_title + ' <i class="np-icon-link"></i></span>';
96
-
97
- // Post Status
98
- html += '<span class="status">';
99
- if ( plugin.post._status !== 'publish' ) html += plugin.post._status;
100
- html += '</span>';
101
-
102
- // Nested Pages Status
103
- if ( plugin.post.np_status === "hide" ) html += '<i class="np-icon-eye-blocked"></i>';
104
-
105
- // Nav Menu Status
106
- html += '<span class="nav-status">';
107
- if ( plugin.post.nav_status === "hide" ) html += '(' + NestedPages.jsData.hiddenText + ')';
108
- html += '</span>';
109
-
110
- // Quick Edit Button
111
- html += '</a><a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ';
112
- html += 'data-id="' + plugin.post.id + '"';
113
- html += 'data-parentid="' + plugin.post.parent_id + '"';
114
- html += 'data-title="' + plugin.post.np_link_title + '" ';
115
- html += 'data-url="' + plugin.post.np_link_content + '" ';
116
- html += 'data-status="' + plugin.post._status + '" ';
117
- html += 'data-np-status="' + plugin.post.np_status + '" ';
118
- html += 'data-navstatus="' + plugin.post.nav_status + '" ';
119
- html += 'data-linktarget="' + plugin.post.link_target + '">'
120
- html += NestedPages.jsData.quickEditText;
121
- html += '</a>';
122
-
123
- // Delete Link
124
- html += '<a href="' + plugin.post.delete_link + '" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>';
125
-
126
- html += '</div></div></div></li>';
127
-
128
- if ( plugin.post.parent_id === "0" ){
129
- $('.nplist:first li:first').after(html);
130
- } else {
131
- plugin.appendChildRow(html);
132
- }
133
-
134
- $(NestedPages.selectors.linkModal).modal('hide');
135
-
136
- plugin.row = $('#menuItem_' + plugin.post.id).find('.row');
137
- plugin.formatter.flashRow(plugin.row);
138
- }
139
-
140
-
141
- // Append a new child link to the appropriate menu
142
- plugin.appendChildRow = function(html)
143
- {
144
- var parent_row = $('#menuItem_' + plugin.post.parent_id);
145
- if ( $(parent_row).children('ol').length === 0 ){
146
- html = '<ol class="sortable nplist" style="display:block;">' + html + '</ol>';
147
- $(parent_row).append(html);
148
- } else {
149
- $(parent_row).find('ol:first').prepend(html);
150
- }
151
- plugin.formatter.updateSubMenuToggle();
152
- }
153
-
154
-
155
- return plugin.init();
156
-
157
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/lib/nestedpages.new-post.js CHANGED
@@ -17,9 +17,11 @@ NestedPages.NewPost = function()
17
 
18
  plugin.bindEvents = function()
19
  {
20
- $(document).on('click', NestedPages.selectors.openPageModal, function(e){
21
- e.preventDefault();
22
- plugin.openModal();
 
 
23
  });
24
  $(document).on('submit', NestedPages.selectors.newPageForm, function(e){
25
  e.preventDefault();
@@ -40,16 +42,17 @@ NestedPages.NewPost = function()
40
  e.preventDefault();
41
  plugin.openQuickEdit($(this));
42
  });
43
- $(NestedPages.selectors.newPageModal).on('hide.bs.modal', function(){
 
44
  plugin.cancelNewPage();
45
  });
46
- $(NestedPages.selectors.newPageModal).on('shown.bs.modal', function(){
47
- plugin.modalOpened($(this));
 
48
  });
49
- $(document).on('click', NestedPages.selectors.cancelNewChildButton, function(e){
50
  e.preventDefault();
51
- plugin.cancelNewPage();
52
- $(NestedPages.selectors.newPageModal).modal('hide');
53
  });
54
  }
55
 
@@ -61,19 +64,19 @@ NestedPages.NewPost = function()
61
  $(NestedPages.selectors.newPageModal).find('.modal-body').html(newform);
62
  $(NestedPages.selectors.newPageModal).find('h3').text(nestedpages.add_multiple);
63
  $(NestedPages.selectors.newPageModal).find('.page_parent_id').val(plugin.parent_id);
64
- $(NestedPages.selectors.newPageModal).modal('show');
65
- }
66
-
67
- // Modal has opened, set the attributes
68
- plugin.modalOpened = function(modal)
69
- {
70
- $(modal).find('.np_title').focus();
71
- $(modal).find(NestedPages.selectors.newPageTitle).prop('tabindex', '2');
72
  }
73
 
74
  // Open the new child quick edit
75
  plugin.openQuickEdit = function(button)
76
  {
 
 
 
 
 
 
77
  var parent_li = $(button).closest(NestedPages.selectors.row).parent('li');
78
  var newform = $(NestedPages.selectors.newPageFormContainer).clone();
79
 
@@ -85,12 +88,23 @@ NestedPages.NewPost = function()
85
  $(newform).appendTo(parent_li);
86
  }
87
 
 
88
  $(newform).siblings(NestedPages.selectors.row).hide();
89
 
90
  plugin.formatter.showQuickEdit();
91
 
92
  $(newform).find('.parent_name').html('<em>Parent:</em> ' + $(button).attr('data-parentname'));
93
- $(newform).find('.page_parent_id').val($(button).attr('data-id'));
 
 
 
 
 
 
 
 
 
 
94
  $(newform).show();
95
  $(newform).find('.np_title').focus();
96
  $(newform).find(NestedPages.selectors.newPageTitle).prop('tabindex', '2');
@@ -111,7 +125,7 @@ NestedPages.NewPost = function()
111
  {
112
  var form = $(button).parents('form');
113
  var fieldcount = $(button).siblings('.new-page-titles').children('li').length + 1;
114
- var html = '<li><i class="handle np-icon-menu"></i><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>';
115
  var container = $(button).siblings('.new-page-titles').append(html);
116
  $(form).find('.np_title').last().focus();
117
  $(form).find(NestedPages.selectors.newPageTitle).prop('tabindex', fieldcount++);
@@ -134,12 +148,15 @@ NestedPages.NewPost = function()
134
  plugin.form = $(button).parents('form');
135
 
136
  var addedit = ( $(button).hasClass('add-edit') ) ? true : false;
137
-
 
 
 
138
  $.ajax({
139
  url: NestedPages.jsData.ajaxurl,
140
  type: 'post',
141
  datatype: 'json',
142
- data: $(plugin.form).serialize() + '&action=' + NestedPages.formActions.newPage + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
143
  success: function(data){
144
  if (data.status === 'error'){
145
  plugin.toggleLoading(false);
@@ -167,10 +184,16 @@ NestedPages.NewPost = function()
167
  // Add the new posts
168
  plugin.addPosts = function()
169
  {
 
 
 
 
 
 
170
  var parent_li = $(plugin.form).parent('.new-child').parent('.page-row');
171
 
172
  // If parent li doesn't have a child ol, add one
173
- if ( $(parent_li).children('ol').length === 0 ){
174
  $(parent_li).append('<ol class="nplist"></ol>');
175
  }
176
 
@@ -181,19 +204,22 @@ NestedPages.NewPost = function()
181
  }
182
 
183
  for (i = 0; i < plugin.posts.length; i++){
184
- plugin.appendRows(appendto, plugin.posts[i]);
185
  }
186
 
187
  // Show the child page list and reset submenu toggles
188
- $(appendto).show();
 
 
 
189
  plugin.formatter.updateSubMenuToggle();
190
  plugin.formatter.setNestedMargins();
191
  plugin.cancelNewPage();
192
- $(NestedPages.selectors.newPageModal).modal('hide');
193
  }
194
 
195
  // Append new post rows to the nested view
196
- plugin.appendRows = function(appendto, post)
197
  {
198
  var html = '<li id="menuItem_' + post.id + '" class="page-row';
199
  if ( post.status === 'publish' ) html += ' published';
@@ -208,7 +234,10 @@ NestedPages.NewPost = function()
208
  }
209
 
210
  html += '<div class="row-inner">';
211
- html += '<i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i>';
 
 
 
212
  html += '<a href="' + post.edit_link + '" class="page-link page-title">';
213
  html += '<span class="title">' + post.title + '</span>';
214
 
@@ -226,7 +255,7 @@ NestedPages.NewPost = function()
226
  }
227
  html += '</span>';
228
 
229
- html += '<span class="edit-indicator"><i class="np-icon-pencil"></i>Edit</span>';
230
  html += '</a>';
231
 
232
  // Non-Hierarchical Data
@@ -246,22 +275,46 @@ NestedPages.NewPost = function()
246
 
247
  // Action Buttons
248
  html += '<div class="action-buttons">';
249
- html += '<a href="#" class="np-btn open-redirect-modal" data-parentid="' + post.id + '"><i class="np-icon-link"></i></a>';
250
- html += '<a href="#" class="np-btn add-new-child" data-id="' + post.id + '" data-parentname="' + post.title + '">' + nestedpages.add_child_short + '</a>';
 
 
 
 
251
 
252
  // Quick Edit (data attrs)
253
  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>';
254
 
255
  html += '<a href="' + post.view_link + '" class="np-btn" target="_blank">' + nestedpages.view + '</a>';
256
- html += '<a href="' + post.delete_link + '" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>';
 
 
257
  html += '</div><!-- .action-buttons -->';
258
 
259
  html += '</div><!-- .row-inner --></div><!-- .row -->';
260
  html += '</li>';
261
 
 
 
 
 
 
 
 
 
 
 
 
262
  $(appendto).append(html);
263
  }
264
 
 
 
 
 
 
 
 
265
  // Toggle the form loading state
266
  plugin.toggleLoading = function(loading)
267
  {
17
 
18
  plugin.bindEvents = function()
19
  {
20
+ $(document).on('open-modal', function(e, button, modal){
21
+ var target = $(button).attr('data-nestedpages-modal-toggle');
22
+ if ( typeof target !== 'undefined' && target == 'np-bulk-modal' ){
23
+ plugin.openModal();
24
+ }
25
  });
26
  $(document).on('submit', NestedPages.selectors.newPageForm, function(e){
27
  e.preventDefault();
42
  e.preventDefault();
43
  plugin.openQuickEdit($(this));
44
  });
45
+ $(document).on('click', NestedPages.selectors.cancelNewChildButton, function(e){
46
+ e.preventDefault();
47
  plugin.cancelNewPage();
48
  });
49
+ $(document).on('click', '[' + NestedPages.selectors.newBeforeButton + ']', function(e){
50
+ e.preventDefault();
51
+ plugin.openQuickEdit($(this));
52
  });
53
+ $(document).on('click', '[' + NestedPages.selectors.newAfterButton + ']', function(e){
54
  e.preventDefault();
55
+ plugin.openQuickEdit($(this));
 
56
  });
57
  }
58
 
64
  $(NestedPages.selectors.newPageModal).find('.modal-body').html(newform);
65
  $(NestedPages.selectors.newPageModal).find('h3').text(nestedpages.add_multiple);
66
  $(NestedPages.selectors.newPageModal).find('.page_parent_id').val(plugin.parent_id);
67
+ $(newform).find('.np_title').first().focus();
68
+ $(newform).find(NestedPages.selectors.newPageTitle).first().prop('tabindex', '2');
 
 
 
 
 
 
69
  }
70
 
71
  // Open the new child quick edit
72
  plugin.openQuickEdit = function(button)
73
  {
74
+ var before = $(button).attr(NestedPages.selectors.newBeforeButton);
75
+ before = ( typeof before === 'undefined' || before === '' ) ? false : before;
76
+
77
+ var after = $(button).attr(NestedPages.selectors.newAfterButton);
78
+ after = ( typeof after === 'undefined' || after === '' ) ? false : after;
79
+
80
  var parent_li = $(button).closest(NestedPages.selectors.row).parent('li');
81
  var newform = $(NestedPages.selectors.newPageFormContainer).clone();
82
 
88
  $(newform).appendTo(parent_li);
89
  }
90
 
91
+
92
  $(newform).siblings(NestedPages.selectors.row).hide();
93
 
94
  plugin.formatter.showQuickEdit();
95
 
96
  $(newform).find('.parent_name').html('<em>Parent:</em> ' + $(button).attr('data-parentname'));
97
+ if ( !before && !after ) $(newform).find('.page_parent_id').val($(button).attr('data-id'));
98
+
99
+ if ( before ) {
100
+ $(newform).find('.page_before_id').val(before);
101
+ $(newform).find('[data-new-post-relation-title]').text(nestedpages.insert_before + ': ' + $(button).attr('data-parentname'));
102
+ }
103
+ if ( after ) {
104
+ $(newform).find('.page_after_id').val(after);
105
+ $(newform).find('[data-new-post-relation-title]').text(nestedpages.insert_after + ': ' + $(button).attr('data-parentname'));
106
+ }
107
+
108
  $(newform).show();
109
  $(newform).find('.np_title').focus();
110
  $(newform).find(NestedPages.selectors.newPageTitle).prop('tabindex', '2');
125
  {
126
  var form = $(button).parents('form');
127
  var fieldcount = $(button).siblings('.new-page-titles').children('li').length + 1;
128
+ 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>';
129
  var container = $(button).siblings('.new-page-titles').append(html);
130
  $(form).find('.np_title').last().focus();
131
  $(form).find(NestedPages.selectors.newPageTitle).prop('tabindex', fieldcount++);
148
  plugin.form = $(button).parents('form');
149
 
150
  var addedit = ( $(button).hasClass('add-edit') ) ? true : false;
151
+ var action = NestedPages.formActions.newPage;
152
+ if ( $(plugin.form).find('.page_before_id').val() !== '' ) action = NestedPages.formActions.newBeforeAfter;
153
+ if ( $(plugin.form).find('.page_after_id').val() !== '' ) action = NestedPages.formActions.newBeforeAfter;
154
+
155
  $.ajax({
156
  url: NestedPages.jsData.ajaxurl,
157
  type: 'post',
158
  datatype: 'json',
159
+ data: $(plugin.form).serialize() + '&action=' + action + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
160
  success: function(data){
161
  if (data.status === 'error'){
162
  plugin.toggleLoading(false);
184
  // Add the new posts
185
  plugin.addPosts = function()
186
  {
187
+ // Before/After ID if applicable
188
+ var before = $(plugin.form).find('.page_before_id').val();
189
+ before = ( before !== '' ) ? before : false;
190
+ var after = $(plugin.form).find('.page_after_id').val();
191
+ after = ( after !== '' ) ? after : false;
192
+
193
  var parent_li = $(plugin.form).parent('.new-child').parent('.page-row');
194
 
195
  // If parent li doesn't have a child ol, add one
196
+ if ( $(parent_li).children('ol').length === 0 && !before && !after ){
197
  $(parent_li).append('<ol class="nplist"></ol>');
198
  }
199
 
204
  }
205
 
206
  for (i = 0; i < plugin.posts.length; i++){
207
+ plugin.appendRows(appendto, plugin.posts[i], before, after);
208
  }
209
 
210
  // Show the child page list and reset submenu toggles
211
+ if ( !before && !after ){
212
+ $(appendto).show();
213
+ }
214
+
215
  plugin.formatter.updateSubMenuToggle();
216
  plugin.formatter.setNestedMargins();
217
  plugin.cancelNewPage();
218
+ $(document).trigger('close-modal-manual');
219
  }
220
 
221
  // Append new post rows to the nested view
222
+ plugin.appendRows = function(appendto, post, before, after)
223
  {
224
  var html = '<li id="menuItem_' + post.id + '" class="page-row';
225
  if ( post.status === 'publish' ) html += ' published';
234
  }
235
 
236
  html += '<div class="row-inner">';
237
+ // Submenu
238
+ 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>';
239
+ // Handle
240
+ 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>';
241
  html += '<a href="' + post.edit_link + '" class="page-link page-title">';
242
  html += '<span class="title">' + post.title + '</span>';
243
 
255
  }
256
  html += '</span>';
257
 
258
+ html += '<span class="edit-indicator">Edit</span>';
259
  html += '</a>';
260
 
261
  // Non-Hierarchical Data
275
 
276
  // Action Buttons
277
  html += '<div class="action-buttons">';
278
+ 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>';
279
+ // Add Link
280
+ 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>';
281
+ // Add Child
282
+ 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>';
283
+ html += '</ul></div>';
284
 
285
  // Quick Edit (data attrs)
286
  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>';
287
 
288
  html += '<a href="' + post.view_link + '" class="np-btn" target="_blank">' + nestedpages.view + '</a>';
289
+
290
+ // Trash
291
+ 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>';
292
  html += '</div><!-- .action-buttons -->';
293
 
294
  html += '</div><!-- .row-inner --></div><!-- .row -->';
295
  html += '</li>';
296
 
297
+ if ( before ){
298
+ var row = plugin.findRowById(before);
299
+ $(html).insertBefore(row);
300
+ return;
301
+ }
302
+ if ( after ){
303
+ var row = plugin.findRowById(after);
304
+ $(html).insertAfter(row);
305
+ return;
306
+ }
307
+
308
  $(appendto).append(html);
309
  }
310
 
311
+ // Find the row for inserting before/after
312
+ plugin.findRowById = function(id)
313
+ {
314
+ var row = $(NestedPages.selectors.rows + '#menuItem_' + id);
315
+ return row;
316
+ }
317
+
318
  // Toggle the form loading state
319
  plugin.toggleLoading = function(loading)
320
  {
assets/js/lib/nestedpages.quickedit-link.js CHANGED
@@ -16,13 +16,6 @@ NestedPages.QuickEditLink = function()
16
  plugin.newPostData = ''; // Data after update
17
  plugin.form = ''; // The newly created Quick Edit Form
18
 
19
-
20
- plugin.init = function()
21
- {
22
- plugin.bindEvents();
23
- }
24
-
25
-
26
  plugin.bindEvents = function()
27
  {
28
  $(document).on('click', NestedPages.selectors.quickEditButtonLink, function(e){
@@ -172,9 +165,8 @@ NestedPages.QuickEditLink = function()
172
  // Update the row after successfully saving quick edit data
173
  plugin.updateRow = function()
174
  {
175
- console.log(plugin.newPostData);
176
  var row = $(plugin.form).siblings('.row');
177
- $(row).find('.title').html(plugin.newPostData.post_title + ' <i class="np-icon-link"></i>');
178
 
179
  var status = $(row).find('.status');
180
  if ( (plugin.newPostData._status !== 'publish') && (plugin.newPostData._status !== 'future') ){
@@ -195,10 +187,10 @@ NestedPages.QuickEditLink = function()
195
  var li = $(row).parent('li');
196
  if ( (plugin.newPostData.np_status == 'hide') ){
197
  $(li).addClass('np-hide');
198
- $(row).find('.status').after('<i class="np-icon-eye-blocked"></i>');
199
  } else {
200
  $(li).removeClass('np-hide');
201
- $(row).find('.np-icon-eye-blocked').remove();
202
  }
203
 
204
  var button = $(row).find(NestedPages.selectors.quickEditButtonLink);
@@ -232,7 +224,6 @@ NestedPages.QuickEditLink = function()
232
  $(NestedPages.selectors.quickEditLoadingIndicator).hide();
233
  }
234
 
235
-
236
- return plugin.init();
237
 
238
  }
16
  plugin.newPostData = ''; // Data after update
17
  plugin.form = ''; // The newly created Quick Edit Form
18
 
 
 
 
 
 
 
 
19
  plugin.bindEvents = function()
20
  {
21
  $(document).on('click', NestedPages.selectors.quickEditButtonLink, function(e){
165
  // Update the row after successfully saving quick edit data
166
  plugin.updateRow = function()
167
  {
 
168
  var row = $(plugin.form).siblings('.row');
169
+ $(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>');
170
 
171
  var status = $(row).find('.status');
172
  if ( (plugin.newPostData._status !== 'publish') && (plugin.newPostData._status !== 'future') ){
187
  var li = $(row).parent('li');
188
  if ( (plugin.newPostData.np_status == 'hide') ){
189
  $(li).addClass('np-hide');
190
+ $(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>');
191
  } else {
192
  $(li).removeClass('np-hide');
193
+ $(row).find('.status-np-hidden').remove();
194
  }
195
 
196
  var button = $(row).find(NestedPages.selectors.quickEditButtonLink);
224
  $(NestedPages.selectors.quickEditLoadingIndicator).hide();
225
  }
226
 
227
+ return plugin.bindEvents();
 
228
 
229
  }
assets/js/lib/nestedpages.quickedit-post.js CHANGED
@@ -358,7 +358,9 @@ NestedPages.QuickEditPost = function()
358
  // Password Lock Icon
359
  if ( plugin.newData.post_password !== "" && typeof plugin.newData.post_password !== 'undefined'){
360
  var statustext = $(status).text();
361
- statustext += ' <i class="np-icon-lock"></i>';
 
 
362
  $(status).html(statustext);
363
  }
364
 
@@ -374,10 +376,10 @@ NestedPages.QuickEditPost = function()
374
  var li = $(plugin.row).parent('li');
375
  if ( (plugin.newData.np_status == 'hide') ){
376
  $(li).addClass('np-hide');
377
- $(plugin.row).find('.status').after('<i class="np-icon-eye-blocked"></i>');
378
  } else {
379
  $(li).removeClass('np-hide');
380
- $(plugin.row).find('.np-icon-eye-blocked').remove();
381
  }
382
 
383
  // Sticky
358
  // Password Lock Icon
359
  if ( plugin.newData.post_password !== "" && typeof plugin.newData.post_password !== 'undefined'){
360
  var statustext = $(status).text();
361
+ statustext += ' <span class="locked">';
362
+ 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>'
363
+ statustext += '</span>';
364
  $(status).html(statustext);
365
  }
366
 
376
  var li = $(plugin.row).parent('li');
377
  if ( (plugin.newData.np_status == 'hide') ){
378
  $(li).addClass('np-hide');
379
+ $(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>');
380
  } else {
381
  $(li).removeClass('np-hide');
382
+ $(plugin.row).find('.status-np-hidden').remove();
383
  }
384
 
385
  // Sticky
assets/js/lib/nestedpages.settings.js CHANGED
@@ -28,6 +28,10 @@ NestedPages.Settings = function()
28
  assignPostTypeOption : '[data-assignment-page-id]', // Option within the listing to select page for post type assignment
29
  assignPostTypeRemove : '[data-nestedpages-page-pt-assignment-remove]', // Link to remove the assigned page for the post type,
30
  assignPostTypeSelection : '[data-nestedpages-page-pt-assignment-selection]', // The div displaying the selection
 
 
 
 
31
  }
32
 
33
  plugin.bindEvents = function()
@@ -39,6 +43,7 @@ NestedPages.Settings = function()
39
  plugin.toggleMenuCheckboxes();
40
  plugin.toggleHideCheckbox();
41
  plugin.toggleAssignPostType();
 
42
  });
43
  $(document).on('click', plugin.selectors.postTypeToggle, function(e){
44
  e.preventDefault();
@@ -76,6 +81,9 @@ NestedPages.Settings = function()
76
  e.preventDefault();
77
  plugin.removeAssignPostType($(this));
78
  });
 
 
 
79
  }
80
 
81
  /**
@@ -242,13 +250,33 @@ NestedPages.Settings = function()
242
  $(container).find(plugin.selectors.assignPostTypeTitle).val('');
243
  }
244
 
 
 
 
 
 
 
 
 
 
 
245
 
246
- plugin.init = function()
 
 
 
247
  {
248
- plugin.bindEvents();
 
 
 
 
 
 
 
249
  }
250
 
251
- return plugin.init();
252
  }
253
 
254
  new NestedPages.Settings;
28
  assignPostTypeOption : '[data-assignment-page-id]', // Option within the listing to select page for post type assignment
29
  assignPostTypeRemove : '[data-nestedpages-page-pt-assignment-remove]', // Link to remove the assigned page for the post type,
30
  assignPostTypeSelection : '[data-nestedpages-page-pt-assignment-selection]', // The div displaying the selection
31
+
32
+ // Sort Options for Post Types
33
+ sortOptionCheckbox : '[data-nestedpages-sort-option-checkbox]', // Checkbox for enabling a sort option
34
+ defaultSortOptions : '[data-nestedpages-sort-option-default]', // Default sort options (containing div)
35
  }
36
 
37
  plugin.bindEvents = function()
43
  plugin.toggleMenuCheckboxes();
44
  plugin.toggleHideCheckbox();
45
  plugin.toggleAssignPostType();
46
+ plugin.toggleAllDefaultSortOptions();
47
  });
48
  $(document).on('click', plugin.selectors.postTypeToggle, function(e){
49
  e.preventDefault();
81
  e.preventDefault();
82
  plugin.removeAssignPostType($(this));
83
  });
84
+ $(document).on('change', plugin.selectors.sortOptionCheckbox, function(){
85
+ plugin.toggleDefaultSortOptions($(this));
86
+ });
87
  }
88
 
89
  /**
250
  $(container).find(plugin.selectors.assignPostTypeTitle).val('');
251
  }
252
 
253
+ /**
254
+ * Toggle all the default sort options
255
+ */
256
+ plugin.toggleAllDefaultSortOptions = function()
257
+ {
258
+ var checkboxes = $(plugin.selectors.sortOptionCheckbox);
259
+ $.each(checkboxes, function(){
260
+ plugin.toggleDefaultSortOptions($(this));
261
+ });
262
+ }
263
 
264
+ /**
265
+ * Toggle the default sort options
266
+ */
267
+ plugin.toggleDefaultSortOptions = function(checkbox)
268
  {
269
+ var checked = ( $(checkbox).is(':checked') ) ? true : false;
270
+ var options = $(checkbox).parent('label').next(plugin.selectors.defaultSortOptions);
271
+ if ( $(options).length < 1 ) return;
272
+ if ( checked ) {
273
+ $(options).show();
274
+ return;
275
+ }
276
+ $(options).hide();
277
  }
278
 
279
+ return plugin.bindEvents();
280
  }
281
 
282
  new NestedPages.Settings;
assets/js/lib/nestedpages.sync-menu-setting.js CHANGED
@@ -52,6 +52,9 @@ NestedPages.SyncMenuSetting = function()
52
  plugin.formatter.showAjaxError(data.message);
53
  }
54
  },
 
 
 
55
  });
56
  }
57
 
52
  plugin.formatter.showAjaxError(data.message);
53
  }
54
  },
55
+ error: function(data){
56
+ console.log(data);
57
+ }
58
  });
59
  }
60
 
assets/js/lib/nestedpages.trash.js CHANGED
@@ -25,18 +25,7 @@ var NestedPagesTrash = function()
25
  plugin.nonce = nestedpages.np_nonce;
26
  plugin.formAction = 'npEmptyTrash';
27
 
28
-
29
- // Initialization
30
- plugin.init = function(){
31
- plugin.bindEvents();
32
- }
33
-
34
- // Bind Events
35
  plugin.bindEvents = function(){
36
- $(document).on('click', plugin.trashButton, function(e){
37
- e.preventDefault();
38
- $(plugin.warningModal).modal('show');
39
- });
40
  $(document).on('click', plugin.confirmButton, function(e){
41
  e.preventDefault();
42
  plugin.confirmEmpty();
@@ -46,7 +35,7 @@ var NestedPagesTrash = function()
46
  // Confirm Trash Empty
47
  plugin.confirmEmpty = function(){
48
  plugin.loading(true);
49
- $(plugin.warningModal).hide();
50
  $(plugin.errorAlert).hide();
51
  plugin.emptyTrash();
52
  }
@@ -83,5 +72,5 @@ var NestedPagesTrash = function()
83
  $(plugin.loadingIndicator).hide();
84
  }
85
 
86
- return plugin.init();
87
- }
25
  plugin.nonce = nestedpages.np_nonce;
26
  plugin.formAction = 'npEmptyTrash';
27
 
 
 
 
 
 
 
 
28
  plugin.bindEvents = function(){
 
 
 
 
29
  $(document).on('click', plugin.confirmButton, function(e){
30
  e.preventDefault();
31
  plugin.confirmEmpty();
35
  // Confirm Trash Empty
36
  plugin.confirmEmpty = function(){
37
  plugin.loading(true);
38
+ $(document).trigger('close-modal-manual');
39
  $(plugin.errorAlert).hide();
40
  plugin.emptyTrash();
41
  }
72
  $(plugin.loadingIndicator).hide();
73
  }
74
 
75
+ return plugin.bindEvents();
76
+ }
assets/js/lib/nestedpages.wpml.js CHANGED
@@ -37,8 +37,8 @@ NestedPages.Wpml = function()
37
  */
38
  plugin.createTranslationsModal = function(button)
39
  {
40
- plugin.parent_li = $(button).closest(NestedPages.selectors.row).parent('li');
41
- plugin.button = $(button).siblings(NestedPages.selectors.quickEditOpen);
42
  plugin.postData = {
43
  id : $(plugin.button).attr('data-id'),
44
  title : $(plugin.button).attr('data-title'),
@@ -73,6 +73,8 @@ NestedPages.Wpml = function()
73
  nonce : NestedPages.jsData.nonce
74
  },
75
  success: function(data){
 
 
76
  if ( data.status === 'success' ){
77
  plugin.populateModal(data.translations);
78
  } else {
37
  */
38
  plugin.createTranslationsModal = function(button)
39
  {
40
+ plugin.parent_li = $(button).parents('.action-buttons').closest(NestedPages.selectors.row).parent('li');
41
+ plugin.button = $(plugin.parent_li).find(NestedPages.selectors.quickEditOpen);
42
  plugin.postData = {
43
  id : $(plugin.button).attr('data-id'),
44
  title : $(plugin.button).attr('data-title'),
73
  nonce : NestedPages.jsData.nonce
74
  },
75
  success: function(data){
76
+ console.log(data);
77
+ console.log(plugin.postData.id);
78
  if ( data.status === 'success' ){
79
  plugin.populateModal(data.translations);
80
  } else {
assets/js/nestedpages.js CHANGED
@@ -1,60 +1,5 @@
1
  var NestedPages = NestedPages || {};
2
 
3
- /**
4
- * Responsive functionality for nested view
5
- * @package Nested Pages
6
- * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
7
- */
8
- NestedPages.Responsive = function()
9
- {
10
- var plugin = this;
11
- var $ = jQuery;
12
-
13
- plugin.init = function()
14
- {
15
- plugin.bindEvents();
16
- }
17
-
18
- plugin.bindEvents = function()
19
- {
20
- $(document).on('click', NestedPages.selectors.toggleEditButtons, function(e){
21
- e.preventDefault();
22
- plugin.toggleEdit($(this));
23
- });
24
- // Remove the block display when sizing up
25
- $(window).resize(function() {
26
- plugin.timer(function(){
27
- $('.action-buttons').removeAttr('style');
28
- $('.np-toggle-edit').removeClass('active');
29
- }, 500);
30
- });
31
- }
32
-
33
- // Toggle the responsive edit buttons
34
- plugin.toggleEdit = function(button)
35
- {
36
- var buttons = $(button).siblings('.action-buttons');
37
- if ( $(buttons).is(':visible') ){
38
- $(button).removeClass('active');
39
- $(buttons).hide();
40
- return;
41
- }
42
- $(button).addClass('active');
43
- $(buttons).show();
44
- }
45
-
46
- plugin.timer = (function(){
47
- var timer = 0;
48
- return function(callback, ms){
49
- clearTimeout (timer);
50
- timer = setTimeout(callback, ms);
51
- };
52
- })();
53
-
54
- return plugin.init();
55
- }
56
- var NestedPages = NestedPages || {};
57
-
58
  /**
59
  * Formatting updates
60
  * @package Nested Pages
@@ -76,11 +21,12 @@ NestedPages.Formatter = function()
76
  var row = $(button).parent('.row').parent('li');
77
  if ( $(row).children('ol').length > 0 ){ // Row has a child menu
78
 
79
- var icon = ( $(row).children('ol:visible').length > 0 )
80
- ? NestedPages.cssClasses.iconToggleDown
81
- : NestedPages.cssClasses.iconToggleRight;
82
-
83
- $(button).html('<div class="child-toggle-spacer"></div><a href="#"><i class="' + icon + '"></i></a>');
 
84
 
85
  if ( ($(row).children('ol').children('.np-hide').length > 0) && ($(row).children('ol').children('.np-hide.shown').length === 0) ){
86
  $(button).find('a').hide();
@@ -210,6 +156,208 @@ NestedPages.Formatter = function()
210
 
211
  }
212
  var NestedPages = NestedPages || {};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
 
214
  /**
215
  * Check All functionality for Nested Pages
@@ -459,6 +607,7 @@ NestedPages.BulkActions = function()
459
  {
460
  plugin.toggleLinkCountAlert();
461
  if ( visible ){
 
462
  $(NestedPages.selectors.bulkEditForm).show();
463
  $(NestedPages.selectors.bulkActionsForm).hide();
464
  plugin.setWPSuggest();
@@ -484,6 +633,18 @@ NestedPages.BulkActions = function()
484
  $(NestedPages.selectors.bulkEditLinkCount).parent('div').show();
485
  }
486
 
 
 
 
 
 
 
 
 
 
 
 
 
487
  /**
488
  * Initialize WP Auto Suggest on Flat Taxonomy fields
489
  */
@@ -504,6 +665,7 @@ NestedPages.BulkActions = function()
504
  var selectFields = $(NestedPages.selectors.bulkEditForm).find('select');
505
  $.each(selectFields, function(){
506
  $(this).find('option').first().prop('selected', true);
 
507
  });
508
  var categoryChecklists = $(NestedPages.selectors.bulkEditForm).find('.cat-checklist');
509
  $.each(categoryChecklists, function(){
@@ -597,9 +759,7 @@ NestedPages.MenuToggle = function()
597
  plugin.toggleSingleMenu = function(button)
598
  {
599
  var submenu = $(button).parent(NestedPages.selectors.childToggle).parent(NestedPages.selectors.row).siblings('ol');
600
- $(button).find('i')
601
- .toggleClass(NestedPages.cssClasses.iconToggleDown)
602
- .toggleClass(NestedPages.cssClasses.iconToggleRight);
603
  $(submenu).toggle();
604
  plugin.formatter.setBorders();
605
  plugin.formatter.setNestedMargins();
@@ -614,8 +774,7 @@ NestedPages.MenuToggle = function()
614
  if ( $(button).attr('data-toggle') === 'closed' ){
615
  $(NestedPages.selectors.lists).show();
616
  $(button).attr('data-toggle', 'opened').text(NestedPages.jsData.collapseText);
617
- $(NestedPages.selectors.childToggle).find('i').removeClass(NestedPages.cssClasses.iconToggleRight).addClass(NestedPages.cssClasses.iconToggleDown);
618
- // revert_quick_edit();
619
  plugin.formatter.setBorders();
620
  plugin.syncUserToggles();
621
  return;
@@ -623,8 +782,7 @@ NestedPages.MenuToggle = function()
623
 
624
  $(NestedPages.selectors.lists).not($(NestedPages.selectors.lists)[0]).hide();
625
  $(button).attr('data-toggle', 'closed').text(NestedPages.jsData.expandText);
626
- $(NestedPages.selectors.childToggle).find('i').removeClass(NestedPages.cssClasses.iconToggleDown).addClass(NestedPages.cssClasses.iconToggleRight);
627
- // revert_quick_edit();
628
  plugin.formatter.setBorders();
629
  plugin.syncUserToggles();
630
  }
@@ -764,37 +922,68 @@ NestedPages.Nesting = function()
764
 
765
  plugin.formatter = new NestedPages.Formatter;
766
 
767
-
768
  // Make the Menu sortable
769
  plugin.initializeSortable = function()
770
  {
771
- maxLevels = ( NestedPages.jsData.nestable ) ? 0 : 1;
 
772
  $(NestedPages.selectors.sortable).not(NestedPages.selectors.notSortable).nestedSortable({
773
  items : NestedPages.selectors.rows,
774
  toleranceElement: '> .row',
775
  handle: NestedPages.selectors.handle,
776
  placeholder: "ui-sortable-placeholder",
777
- maxLevels: maxLevels,
778
  tabSize : 56,
 
 
 
779
  start: function(e, ui){
780
- ui.placeholder.height(ui.item.height());
781
- },
782
- sort: function(e, ui){
783
- plugin.formatter.updatePlaceholderWidth(ui);
784
- },
785
- stop: function(e, ui){
786
- setTimeout(
787
- function(){
788
- plugin.formatter.updateSubMenuToggle();
789
- plugin.formatter.setBorders();
790
- plugin.formatter.setNestedMargins();
791
- }, 100
792
- );
793
- plugin.syncNesting();
794
- },
795
  });
796
  }
797
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
798
 
799
  // Disable Nesting
800
  plugin.disableNesting = function()
@@ -806,11 +995,17 @@ NestedPages.Nesting = function()
806
  // Sync Nesting
807
  plugin.syncNesting = function(manual, callback)
808
  {
 
 
809
  if ( nestedpages.manual_order_sync === '1' && !manual) return;
810
  $(NestedPages.selectors.errorDiv).hide();
811
  $(NestedPages.selectors.loadingIndicator).show();
812
-
813
- list = $(NestedPages.selectors.sortable).nestedSortable('toHierarchy', {startDepthCount: 0});
 
 
 
 
814
  plugin.disableNesting();
815
 
816
  var syncmenu = NestedPages.jsData.syncmenu;
@@ -843,6 +1038,34 @@ NestedPages.Nesting = function()
843
  });
844
  }
845
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
846
  }
847
  var NestedPages = NestedPages || {};
848
 
@@ -898,6 +1121,9 @@ NestedPages.SyncMenuSetting = function()
898
  plugin.formatter.showAjaxError(data.message);
899
  }
900
  },
 
 
 
901
  });
902
  }
903
 
@@ -922,9 +1148,11 @@ NestedPages.NewPost = function()
922
 
923
  plugin.bindEvents = function()
924
  {
925
- $(document).on('click', NestedPages.selectors.openPageModal, function(e){
926
- e.preventDefault();
927
- plugin.openModal();
 
 
928
  });
929
  $(document).on('submit', NestedPages.selectors.newPageForm, function(e){
930
  e.preventDefault();
@@ -945,16 +1173,17 @@ NestedPages.NewPost = function()
945
  e.preventDefault();
946
  plugin.openQuickEdit($(this));
947
  });
948
- $(NestedPages.selectors.newPageModal).on('hide.bs.modal', function(){
 
949
  plugin.cancelNewPage();
950
  });
951
- $(NestedPages.selectors.newPageModal).on('shown.bs.modal', function(){
952
- plugin.modalOpened($(this));
 
953
  });
954
- $(document).on('click', NestedPages.selectors.cancelNewChildButton, function(e){
955
  e.preventDefault();
956
- plugin.cancelNewPage();
957
- $(NestedPages.selectors.newPageModal).modal('hide');
958
  });
959
  }
960
 
@@ -966,19 +1195,19 @@ NestedPages.NewPost = function()
966
  $(NestedPages.selectors.newPageModal).find('.modal-body').html(newform);
967
  $(NestedPages.selectors.newPageModal).find('h3').text(nestedpages.add_multiple);
968
  $(NestedPages.selectors.newPageModal).find('.page_parent_id').val(plugin.parent_id);
969
- $(NestedPages.selectors.newPageModal).modal('show');
970
- }
971
-
972
- // Modal has opened, set the attributes
973
- plugin.modalOpened = function(modal)
974
- {
975
- $(modal).find('.np_title').focus();
976
- $(modal).find(NestedPages.selectors.newPageTitle).prop('tabindex', '2');
977
  }
978
 
979
  // Open the new child quick edit
980
  plugin.openQuickEdit = function(button)
981
  {
 
 
 
 
 
 
982
  var parent_li = $(button).closest(NestedPages.selectors.row).parent('li');
983
  var newform = $(NestedPages.selectors.newPageFormContainer).clone();
984
 
@@ -990,12 +1219,23 @@ NestedPages.NewPost = function()
990
  $(newform).appendTo(parent_li);
991
  }
992
 
 
993
  $(newform).siblings(NestedPages.selectors.row).hide();
994
 
995
  plugin.formatter.showQuickEdit();
996
 
997
  $(newform).find('.parent_name').html('<em>Parent:</em> ' + $(button).attr('data-parentname'));
998
- $(newform).find('.page_parent_id').val($(button).attr('data-id'));
 
 
 
 
 
 
 
 
 
 
999
  $(newform).show();
1000
  $(newform).find('.np_title').focus();
1001
  $(newform).find(NestedPages.selectors.newPageTitle).prop('tabindex', '2');
@@ -1016,7 +1256,7 @@ NestedPages.NewPost = function()
1016
  {
1017
  var form = $(button).parents('form');
1018
  var fieldcount = $(button).siblings('.new-page-titles').children('li').length + 1;
1019
- var html = '<li><i class="handle np-icon-menu"></i><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>';
1020
  var container = $(button).siblings('.new-page-titles').append(html);
1021
  $(form).find('.np_title').last().focus();
1022
  $(form).find(NestedPages.selectors.newPageTitle).prop('tabindex', fieldcount++);
@@ -1039,12 +1279,15 @@ NestedPages.NewPost = function()
1039
  plugin.form = $(button).parents('form');
1040
 
1041
  var addedit = ( $(button).hasClass('add-edit') ) ? true : false;
1042
-
 
 
 
1043
  $.ajax({
1044
  url: NestedPages.jsData.ajaxurl,
1045
  type: 'post',
1046
  datatype: 'json',
1047
- data: $(plugin.form).serialize() + '&action=' + NestedPages.formActions.newPage + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
1048
  success: function(data){
1049
  if (data.status === 'error'){
1050
  plugin.toggleLoading(false);
@@ -1072,10 +1315,16 @@ NestedPages.NewPost = function()
1072
  // Add the new posts
1073
  plugin.addPosts = function()
1074
  {
 
 
 
 
 
 
1075
  var parent_li = $(plugin.form).parent('.new-child').parent('.page-row');
1076
 
1077
  // If parent li doesn't have a child ol, add one
1078
- if ( $(parent_li).children('ol').length === 0 ){
1079
  $(parent_li).append('<ol class="nplist"></ol>');
1080
  }
1081
 
@@ -1086,19 +1335,22 @@ NestedPages.NewPost = function()
1086
  }
1087
 
1088
  for (i = 0; i < plugin.posts.length; i++){
1089
- plugin.appendRows(appendto, plugin.posts[i]);
1090
  }
1091
 
1092
  // Show the child page list and reset submenu toggles
1093
- $(appendto).show();
 
 
 
1094
  plugin.formatter.updateSubMenuToggle();
1095
  plugin.formatter.setNestedMargins();
1096
  plugin.cancelNewPage();
1097
- $(NestedPages.selectors.newPageModal).modal('hide');
1098
  }
1099
 
1100
  // Append new post rows to the nested view
1101
- plugin.appendRows = function(appendto, post)
1102
  {
1103
  var html = '<li id="menuItem_' + post.id + '" class="page-row';
1104
  if ( post.status === 'publish' ) html += ' published';
@@ -1113,7 +1365,10 @@ NestedPages.NewPost = function()
1113
  }
1114
 
1115
  html += '<div class="row-inner">';
1116
- html += '<i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i>';
 
 
 
1117
  html += '<a href="' + post.edit_link + '" class="page-link page-title">';
1118
  html += '<span class="title">' + post.title + '</span>';
1119
 
@@ -1131,7 +1386,7 @@ NestedPages.NewPost = function()
1131
  }
1132
  html += '</span>';
1133
 
1134
- html += '<span class="edit-indicator"><i class="np-icon-pencil"></i>Edit</span>';
1135
  html += '</a>';
1136
 
1137
  // Non-Hierarchical Data
@@ -1151,22 +1406,46 @@ NestedPages.NewPost = function()
1151
 
1152
  // Action Buttons
1153
  html += '<div class="action-buttons">';
1154
- html += '<a href="#" class="np-btn open-redirect-modal" data-parentid="' + post.id + '"><i class="np-icon-link"></i></a>';
1155
- html += '<a href="#" class="np-btn add-new-child" data-id="' + post.id + '" data-parentname="' + post.title + '">' + nestedpages.add_child_short + '</a>';
 
 
 
 
1156
 
1157
  // Quick Edit (data attrs)
1158
  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>';
1159
 
1160
  html += '<a href="' + post.view_link + '" class="np-btn" target="_blank">' + nestedpages.view + '</a>';
1161
- html += '<a href="' + post.delete_link + '" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>';
 
 
1162
  html += '</div><!-- .action-buttons -->';
1163
 
1164
  html += '</div><!-- .row-inner --></div><!-- .row -->';
1165
  html += '</li>';
1166
 
 
 
 
 
 
 
 
 
 
 
 
1167
  $(appendto).append(html);
1168
  }
1169
 
 
 
 
 
 
 
 
1170
  // Toggle the form loading state
1171
  plugin.toggleLoading = function(loading)
1172
  {
@@ -1542,7 +1821,9 @@ NestedPages.QuickEditPost = function()
1542
  // Password Lock Icon
1543
  if ( plugin.newData.post_password !== "" && typeof plugin.newData.post_password !== 'undefined'){
1544
  var statustext = $(status).text();
1545
- statustext += ' <i class="np-icon-lock"></i>';
 
 
1546
  $(status).html(statustext);
1547
  }
1548
 
@@ -1558,10 +1839,10 @@ NestedPages.QuickEditPost = function()
1558
  var li = $(plugin.row).parent('li');
1559
  if ( (plugin.newData.np_status == 'hide') ){
1560
  $(li).addClass('np-hide');
1561
- $(plugin.row).find('.status').after('<i class="np-icon-eye-blocked"></i>');
1562
  } else {
1563
  $(li).removeClass('np-hide');
1564
- $(plugin.row).find('.np-icon-eye-blocked').remove();
1565
  }
1566
 
1567
  // Sticky
@@ -1727,13 +2008,6 @@ NestedPages.QuickEditLink = function()
1727
  plugin.newPostData = ''; // Data after update
1728
  plugin.form = ''; // The newly created Quick Edit Form
1729
 
1730
-
1731
- plugin.init = function()
1732
- {
1733
- plugin.bindEvents();
1734
- }
1735
-
1736
-
1737
  plugin.bindEvents = function()
1738
  {
1739
  $(document).on('click', NestedPages.selectors.quickEditButtonLink, function(e){
@@ -1883,9 +2157,8 @@ NestedPages.QuickEditLink = function()
1883
  // Update the row after successfully saving quick edit data
1884
  plugin.updateRow = function()
1885
  {
1886
- console.log(plugin.newPostData);
1887
  var row = $(plugin.form).siblings('.row');
1888
- $(row).find('.title').html(plugin.newPostData.post_title + ' <i class="np-icon-link"></i>');
1889
 
1890
  var status = $(row).find('.status');
1891
  if ( (plugin.newPostData._status !== 'publish') && (plugin.newPostData._status !== 'future') ){
@@ -1906,10 +2179,10 @@ NestedPages.QuickEditLink = function()
1906
  var li = $(row).parent('li');
1907
  if ( (plugin.newPostData.np_status == 'hide') ){
1908
  $(li).addClass('np-hide');
1909
- $(row).find('.status').after('<i class="np-icon-eye-blocked"></i>');
1910
  } else {
1911
  $(li).removeClass('np-hide');
1912
- $(row).find('.np-icon-eye-blocked').remove();
1913
  }
1914
 
1915
  var button = $(row).find(NestedPages.selectors.quickEditButtonLink);
@@ -1943,8 +2216,7 @@ NestedPages.QuickEditLink = function()
1943
  $(NestedPages.selectors.quickEditLoadingIndicator).hide();
1944
  }
1945
 
1946
-
1947
- return plugin.init();
1948
 
1949
  }
1950
  var NestedPages = NestedPages || {};
@@ -1965,12 +2237,6 @@ NestedPages.Clone = function()
1965
 
1966
  plugin.formatter = new NestedPages.Formatter;
1967
 
1968
- plugin.init = function()
1969
- {
1970
- plugin.bindEvents();
1971
- }
1972
-
1973
-
1974
  plugin.bindEvents = function()
1975
  {
1976
  $(document).on('click', NestedPages.selectors.cloneButton, function(e){
@@ -1989,11 +2255,10 @@ NestedPages.Clone = function()
1989
  // Open the modal with clone options
1990
  plugin.openModal = function()
1991
  {
1992
- $(NestedPages.selectors.cloneModal).find('[data-clone-parent]').text(plugin.parent_title);
1993
- $(NestedPages.selectors.cloneModal).modal('show');
1994
  }
1995
 
1996
-
1997
  // Clone the post
1998
  plugin.clone = function()
1999
  {
@@ -2012,26 +2277,25 @@ NestedPages.Clone = function()
2012
  },
2013
  success : function(data){
2014
  plugin.toggleLoading(false);
2015
- $(NestedPages.selectors.cloneModal).modal('hide');
2016
  location.reload();
2017
  }
2018
  });
2019
  }
2020
 
2021
-
2022
  // Toggle Loading
2023
  plugin.toggleLoading = function(loading)
2024
  {
2025
  if ( loading ){
2026
- $(NestedPages.selectors.cloneModal).find('[data-clone-loading]').show();
2027
  $(NestedPages.selectors.confirmClone).attr('disabled', 'disabled');
2028
  return;
2029
  }
2030
- $(NestedPages.selectors.cloneModal).find('[data-clone-loading]').hide();
2031
  $(NestedPages.selectors.confirmClone).attr('disabled', false);
2032
  }
2033
 
2034
- return plugin.init();
2035
  }
2036
  var NestedPages = NestedPages || {};
2037
 
@@ -2146,7 +2410,7 @@ NestedPages.selectors = {
2146
 
2147
  // Link Items
2148
  openLinkModal : '.open-redirect-modal', // Opens new link modal
2149
- linkModal : '#np-link-modal', // The add a link modal
2150
  saveLink : '.np-save-link', // Save Link Button
2151
  linkLoadingIndicator : '.np-link-loading', // Loading Indicator in Link Modal
2152
  linkErrorDiv : '.np-new-link-error', // Error Div in Link Modal
@@ -2155,7 +2419,7 @@ NestedPages.selectors = {
2155
  // Link Deletion
2156
  linkDeleteButton : '[data-np-confirm-delete]',
2157
  linkDeleteConfirmationButton : '[data-delete-confirmation]',
2158
- linkDeleteConfirmationModal : '#np-delete-confirmation-modal',
2159
  linkDeleteConfirmationModalText : '[data-np-link-delete-text]',
2160
 
2161
  // New Page Items
@@ -2169,11 +2433,13 @@ NestedPages.selectors = {
2169
  addChildButton : '.add-new-child', // Button to add child page(s)
2170
  newChildError : '.np-newchild-error', // Error div in new child quick edit
2171
  cancelNewChildButton : '.np-cancel-newchild', // Cancel button in new child quick edit
 
 
2172
 
2173
  // Clone
2174
  cloneButton : '.clone-post', // Button to clone a post
2175
  confirmClone : '[data-confirm-clone]', // Button in modal to confirm clone
2176
- cloneModal : '#np-clone-modal', // Modal with clone options
2177
  cloneQuantity : '[data-clone-quantity]', // Quantity to Clone
2178
  cloneStatus : '[data-clone-status]', // Clone Status
2179
  cloneAuthor : '[data-clone-author]', // Clone Author
@@ -2196,8 +2462,6 @@ NestedPages.selectors = {
2196
 
2197
  // CSS Classes
2198
  NestedPages.cssClasses = {
2199
- iconToggleDown : 'np-icon-arrow-down',
2200
- iconToggleRight : 'np-icon-arrow-right',
2201
  noborder : 'no-border'
2202
  }
2203
 
@@ -2228,6 +2492,7 @@ NestedPages.formActions = {
2228
  syncNesting : 'npsort',
2229
  syncMenu : 'npsyncMenu',
2230
  newPage : 'npnewChild',
 
2231
  quickEditLink : 'npquickEditLink',
2232
  getTaxonomies : 'npgetTaxonomies',
2233
  quickEditPost : 'npquickEdit',
@@ -2250,7 +2515,8 @@ NestedPages.Factory = function()
2250
  var $ = jQuery;
2251
 
2252
  plugin.formatter = new NestedPages.Formatter;
2253
- plugin.responsive = new NestedPages.Responsive;
 
2254
  plugin.checkAll = new NestedPages.CheckAll;
2255
  plugin.bulkActions = new NestedPages.BulkActions;
2256
  plugin.menuToggle = new NestedPages.MenuToggle;
@@ -2267,6 +2533,7 @@ NestedPages.Factory = function()
2267
  plugin.confirmDelete = new NestedPages.ConfirmDelete;
2268
  plugin.manualSync = new NestedPages.ManualSync;
2269
  plugin.postSearch = new NestedPages.PostSearch;
 
2270
  plugin.wpml = new NestedPages.Wpml;
2271
 
2272
  plugin.init = function()
@@ -2420,7 +2687,7 @@ NestedPages.MenuLinks = function()
2420
  plugin.submitForm();
2421
  });
2422
  $(document).on('keydown', function(e){
2423
- if ( e.keyCode === 27 ) $('#np-link-modal').modal('hide');
2424
  });
2425
  }
2426
 
@@ -2433,7 +2700,7 @@ NestedPages.MenuLinks = function()
2433
  plugin.clearForm();
2434
  $(plugin.selectors.accordion).find('ul').hide();
2435
  $(plugin.selectors.typeSelect).removeClass('active');
2436
- $(NestedPages.selectors.linkModal).modal('show');
2437
  }
2438
 
2439
  // Accordion Menu
@@ -2548,10 +2815,13 @@ NestedPages.MenuLinks = function()
2548
  var html = '<li id="menuItem_' + plugin.post.id + '" class="page-row published';
2549
  html += '">'
2550
 
2551
- html += '<div class="row"><div class="child-toggle"><div class="child-toggle-spacer"></div></div><div class="row-inner"><i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i><a href="' + plugin.post.np_link_content + '" class="page-link page-title" target="_blank"><span class="title">' + plugin.post.menuTitle + ' <i class="np-icon-link"></i></span>';
 
 
 
2552
 
2553
  // Quick Edit Button
2554
- html += '</a><a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ';
2555
  html += 'data-id="' + plugin.post.id + '"';
2556
  html += 'data-parentid="' + plugin.post.parent_id + '"';
2557
  html += 'data-title="' + plugin.post.menuTitle + '" ';
@@ -2581,7 +2851,7 @@ NestedPages.MenuLinks = function()
2581
  plugin.appendChildRow(html);
2582
  }
2583
 
2584
- $(NestedPages.selectors.linkModal).modal('hide');
2585
 
2586
  plugin.row = $('#menuItem_' + plugin.post.id).find('.row');
2587
  plugin.formatter.flashRow(plugin.row);
@@ -2773,18 +3043,7 @@ var NestedPagesTrash = function()
2773
  plugin.nonce = nestedpages.np_nonce;
2774
  plugin.formAction = 'npEmptyTrash';
2775
 
2776
-
2777
- // Initialization
2778
- plugin.init = function(){
2779
- plugin.bindEvents();
2780
- }
2781
-
2782
- // Bind Events
2783
  plugin.bindEvents = function(){
2784
- $(document).on('click', plugin.trashButton, function(e){
2785
- e.preventDefault();
2786
- $(plugin.warningModal).modal('show');
2787
- });
2788
  $(document).on('click', plugin.confirmButton, function(e){
2789
  e.preventDefault();
2790
  plugin.confirmEmpty();
@@ -2794,7 +3053,7 @@ var NestedPagesTrash = function()
2794
  // Confirm Trash Empty
2795
  plugin.confirmEmpty = function(){
2796
  plugin.loading(true);
2797
- $(plugin.warningModal).hide();
2798
  $(plugin.errorAlert).hide();
2799
  plugin.emptyTrash();
2800
  }
@@ -2831,9 +3090,8 @@ var NestedPagesTrash = function()
2831
  $(plugin.loadingIndicator).hide();
2832
  }
2833
 
2834
- return plugin.init();
2835
  }
2836
-
2837
  var NestedPages = NestedPages || {};
2838
 
2839
  /**
@@ -2874,7 +3132,7 @@ NestedPages.ConfirmDelete = function()
2874
  plugin.deleteLink = $(button).attr('href');
2875
  $(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation_singular);
2876
  $(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.delete).removeClass('bulk');
2877
- $(NestedPages.selectors.linkDeleteConfirmationModal).modal('show');
2878
  }
2879
 
2880
  // Confirm Multiple link deletion
@@ -2886,7 +3144,7 @@ NestedPages.ConfirmDelete = function()
2886
  event.preventDefault();
2887
  $(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation);
2888
  $(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.trash_delete_links).addClass('bulk');
2889
- $(NestedPages.selectors.linkDeleteConfirmationModal).modal('show');
2890
  }
2891
 
2892
  // Submit the form to delete multiple
@@ -3117,6 +3375,99 @@ NestedPages.PostSearch = function()
3117
  }
3118
  var NestedPages = NestedPages || {};
3119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3120
  /**
3121
  * WPML functionality
3122
  * @package Nested Pages
@@ -3154,8 +3505,8 @@ NestedPages.Wpml = function()
3154
  */
3155
  plugin.createTranslationsModal = function(button)
3156
  {
3157
- plugin.parent_li = $(button).closest(NestedPages.selectors.row).parent('li');
3158
- plugin.button = $(button).siblings(NestedPages.selectors.quickEditOpen);
3159
  plugin.postData = {
3160
  id : $(plugin.button).attr('data-id'),
3161
  title : $(plugin.button).attr('data-title'),
@@ -3190,6 +3541,8 @@ NestedPages.Wpml = function()
3190
  nonce : NestedPages.jsData.nonce
3191
  },
3192
  success: function(data){
 
 
3193
  if ( data.status === 'success' ){
3194
  plugin.populateModal(data.translations);
3195
  } else {
1
  var NestedPages = NestedPages || {};
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  /**
4
  * Formatting updates
5
  * @package Nested Pages
21
  var row = $(button).parent('.row').parent('li');
22
  if ( $(row).children('ol').length > 0 ){ // Row has a child menu
23
 
24
+ var open = ( $(row).children('ol:visible').length > 0 ) ? true : false;
25
+ var html = '<div class="child-toggle-spacer"></div>';
26
+ html += '<a href="#"';
27
+ if ( open ) html += ' class="open"';
28
+ html += '><span class="np-icon-arrow"></span></a>';
29
+ $(button).html(html);
30
 
31
  if ( ($(row).children('ol').children('.np-hide').length > 0) && ($(row).children('ol').children('.np-hide.shown').length === 0) ){
32
  $(button).find('a').hide();
156
 
157
  }
158
  var NestedPages = NestedPages || {};
159
+ /**
160
+ * Dropdowns
161
+ *
162
+ * @author Kyle Phillips
163
+ *
164
+ * To use, wrap dropdown content and toggle link/button in an element with data attribute of data-dropdown
165
+ * Give content data attribute of data-dropdown-content and toggle element data attribute of data-dropdown-toggle
166
+ * For CSS, wrapping/parent element gets class of "dropdown", content gets class of "dropdown-content"
167
+ */
168
+ NestedPages.Dropdowns = function()
169
+ {
170
+ var self = this;
171
+ var $ = jQuery;
172
+
173
+ self.dropdown = ''; // The Active Dropdown
174
+ self.activeBtn = ''; // The Active Button
175
+ self.activeContent = ''; // The Active Dropdown Content
176
+ self.toggleBtn = '[data-dropdown-toggle]';
177
+ self.dropdownContainer = '[data-dropdown]';
178
+ self.dropdownContent = '[data-dropdown-content]'
179
+
180
+ self.selectors = {
181
+ caret_up : 'icon-arrow_drop_up',
182
+ caret_down : 'icon-arrow_drop_down'
183
+ }
184
+
185
+ self.bindEvents = function()
186
+ {
187
+ $(document).on('click', self.toggleBtn, function(e){
188
+ e.preventDefault();
189
+ self.activeBtn = $(this);
190
+ self.dropdown = $(this).parents(self.dropdownContainer);
191
+ self.toggleDropdown();
192
+ });
193
+ $(document).on('click', function(e){
194
+ self.closeDropdowns(e.target);
195
+ });
196
+ $(document).on('dropdown-opened', function(e, content){
197
+ if ( $(content).parents(NestedPages.selectors.row).length > 0 ){
198
+ $(content).parents(NestedPages.selectors.row).addClass('active');
199
+ }
200
+ });
201
+ $(document).on('dropdown-closed', function(){
202
+ $(NestedPages.selectors.row).removeClass('active');
203
+ });
204
+ }
205
+
206
+ self.toggleDropdown = function()
207
+ {
208
+ $('.' + self.selectors.caret_up).attr('class', self.selectors.caret_down);
209
+ var content = $(self.dropdown).find(self.dropdownContent);
210
+ self.activeContent = content;
211
+ if ( $(content).hasClass('active') ){
212
+ $(content).removeClass('active');
213
+ $(self.activeBtn).removeClass('active');
214
+ $(self.activeBtn).find('.' + self.selectors.caret_up).attr('class', self.selectors.caret_down);
215
+ $(document).trigger('dropdown-closed', content);
216
+ return;
217
+ }
218
+ self.setPositioning();
219
+ $(self.toggleBtn).removeClass('active');
220
+ $(self.dropdownContent).removeClass('active');
221
+ $(content).addClass('active');
222
+ $(self.activeBtn).find('.' + self.selectors.caret_down).attr('class', self.selectors.caret_up);
223
+ $(self.activeBtn).addClass('active');
224
+ $(document).trigger('dropdown-opened', content);
225
+ }
226
+
227
+
228
+ self.setPositioning = function()
229
+ {
230
+ var buttonHeight = $(self.activeBtn).outerHeight();
231
+ $(self.activeContent).css('top', buttonHeight + 'px');
232
+ }
233
+
234
+ self.closeDropdowns = function(target)
235
+ {
236
+ if ( $(target).parents(self.dropdownContainer).length === 0 ){
237
+ $(self.dropdownContent).removeClass('active');
238
+ $(self.toggleBtn).removeClass('active');
239
+ $(self.activeBtn).find('.' + self.selectors.caret_up).attr('class', self.selectors.caret_down);
240
+ var content;
241
+ $(document).trigger('dropdown-closed', content);
242
+ }
243
+ }
244
+
245
+ return self.bindEvents();
246
+ }
247
+ var NestedPages = NestedPages || {};
248
+ /**
249
+ * Modal Windows
250
+ *
251
+ * @author Kyle Phillips
252
+ *
253
+ * To use, include a modal backdrop and modal content window with the appropriate data-attributes
254
+ * The data attributes should match the value of the toggle buttons data-modal-toggle attribute
255
+ */
256
+ NestedPages.Modals = function()
257
+ {
258
+ var self = this;
259
+ var $ = jQuery;
260
+
261
+ self.activeBtn = '';
262
+ self.activeModal = '';
263
+ self.modalOpen = false;
264
+
265
+ self.selectors = {
266
+ toggleBtn : '[data-nestedpages-modal-toggle]',
267
+ backdrop : '[data-nestedpages-modal-backdrop]',
268
+ closeBtn : '[data-nestedpages-modal-close]',
269
+ title : 'data-nestedpages-modal-title',
270
+ content : 'data-nestedpages-modal-content'
271
+ }
272
+
273
+ self.bindEvents = function()
274
+ {
275
+ $(document).on('click', self.selectors.toggleBtn, function(e){
276
+ e.preventDefault();
277
+ self.activeBtn = $(this);
278
+ self.openModal();
279
+ });
280
+ $(document).on('click', self.selectors.closeBtn, function(e){
281
+ e.preventDefault();
282
+ self.closeModals();
283
+ });
284
+ $(document).on('open-modal-manual', function(e, modal){
285
+ self.activeModal = $('[data-nestedpages-modal="' + modal + '"]');
286
+ self.openModal();
287
+ });
288
+ $(document).on('close-modal-manual', function(e){
289
+ self.closeModals();
290
+ });
291
+ $(document).on('click', self.selectors.backdrop, function(e){
292
+ self.closeModals();
293
+ });
294
+ $(document).ready(function(){
295
+ self.checkHash();
296
+ });
297
+ }
298
+
299
+ /**
300
+ * Open the Modal Window
301
+ */
302
+ self.openModal = function()
303
+ {
304
+ if ( self.modalOpen ){
305
+ self.closeModals();
306
+ return;
307
+ }
308
+ if ( $(self.activeBtn).length > 0 ){
309
+ var modal = $(self.activeBtn).attr('data-nestedpages-modal-toggle');
310
+ self.activeModal = $('*[data-nestedpages-modal="' + modal + '"]');
311
+ }
312
+ $(self.activeModal).addClass('active');
313
+ self.modalOpen = true;
314
+ self.populateModal();
315
+ $(document).trigger('open-modal', [self.activeBtn, self.activeModal]);
316
+ }
317
+
318
+ /**
319
+ * Close the Modal Window
320
+ */
321
+ self.closeModals = function()
322
+ {
323
+ self.modalOpen = false;
324
+ $('[data-nestedpages-modal]').removeClass('active');
325
+ self.activeModal = '';
326
+ self.activeBtn = '';
327
+ }
328
+
329
+ /**
330
+ * Populate the Modal if needed
331
+ */
332
+ self.populateModal = function()
333
+ {
334
+ var title = $(self.activeBtn).attr(self.selectors.title);
335
+ if ( typeof title !== 'undefined' && title !== '' ){
336
+ $(self.activeModal).find('[data-nestedpages-modal-title]').text(title);
337
+ }
338
+ var content = $(self.activeBtn).attr(self.selectors.content);
339
+ if ( typeof content !== 'undefined' && content !== '' ){
340
+ $(self.activeModal).find('[data-nestedpages-modal-content]').html(content);
341
+ }
342
+ }
343
+
344
+ /**
345
+ * Check for Hash
346
+ */
347
+ self.checkHash = function()
348
+ {
349
+ if ( !window.location.hash ) return;
350
+ var hashType = window.location.hash.substring(0, 6);
351
+ if ( hashType !== '#modal' ) return;
352
+
353
+ var modalId = window.location.hash.substring(7);
354
+ self.activeModal = $('*[data-nestedpages-modal="' + modalId + '"]');
355
+ self.openModal();
356
+ }
357
+
358
+ return self.bindEvents();
359
+ }
360
+ var NestedPages = NestedPages || {};
361
 
362
  /**
363
  * Check All functionality for Nested Pages
607
  {
608
  plugin.toggleLinkCountAlert();
609
  if ( visible ){
610
+ plugin.disableParentOptions();
611
  $(NestedPages.selectors.bulkEditForm).show();
612
  $(NestedPages.selectors.bulkActionsForm).hide();
613
  plugin.setWPSuggest();
633
  $(NestedPages.selectors.bulkEditLinkCount).parent('div').show();
634
  }
635
 
636
+ /**
637
+ * Set parent options to disabled for selected posts
638
+ */
639
+ plugin.disableParentOptions = function()
640
+ {
641
+ var selectElement = $(NestedPages.selectors.bulkEditForm).find('select[name=post_parent]');
642
+ for ( var i = 0; i < plugin.selectedPosts.length; i++ )
643
+ {
644
+ $(selectElement).find('option[value=' + plugin.selectedPosts[i].id + ']').attr('disabled', true);
645
+ }
646
+ }
647
+
648
  /**
649
  * Initialize WP Auto Suggest on Flat Taxonomy fields
650
  */
665
  var selectFields = $(NestedPages.selectors.bulkEditForm).find('select');
666
  $.each(selectFields, function(){
667
  $(this).find('option').first().prop('selected', true);
668
+ $(this).find('option').removeAttr('disabled');
669
  });
670
  var categoryChecklists = $(NestedPages.selectors.bulkEditForm).find('.cat-checklist');
671
  $.each(categoryChecklists, function(){
759
  plugin.toggleSingleMenu = function(button)
760
  {
761
  var submenu = $(button).parent(NestedPages.selectors.childToggle).parent(NestedPages.selectors.row).siblings('ol');
762
+ $(button).toggleClass('open');
 
 
763
  $(submenu).toggle();
764
  plugin.formatter.setBorders();
765
  plugin.formatter.setNestedMargins();
774
  if ( $(button).attr('data-toggle') === 'closed' ){
775
  $(NestedPages.selectors.lists).show();
776
  $(button).attr('data-toggle', 'opened').text(NestedPages.jsData.collapseText);
777
+ $(NestedPages.selectors.childToggle + ' a').addClass('open');
 
778
  plugin.formatter.setBorders();
779
  plugin.syncUserToggles();
780
  return;
782
 
783
  $(NestedPages.selectors.lists).not($(NestedPages.selectors.lists)[0]).hide();
784
  $(button).attr('data-toggle', 'closed').text(NestedPages.jsData.expandText);
785
+ $(NestedPages.selectors.childToggle + ' a').removeClass('open');
 
786
  plugin.formatter.setBorders();
787
  plugin.syncUserToggles();
788
  }
922
 
923
  plugin.formatter = new NestedPages.Formatter;
924
 
 
925
  // Make the Menu sortable
926
  plugin.initializeSortable = function()
927
  {
928
+ if ( !NestedPages.jsData.nestable ) return plugin.initializeSortableFlat();
929
+
930
  $(NestedPages.selectors.sortable).not(NestedPages.selectors.notSortable).nestedSortable({
931
  items : NestedPages.selectors.rows,
932
  toleranceElement: '> .row',
933
  handle: NestedPages.selectors.handle,
934
  placeholder: "ui-sortable-placeholder",
 
935
  tabSize : 56,
936
+ isAllowed: function(placeholder, placeholderParent, currentItem){
937
+ return ( $(placeholderParent).hasClass('post-type-np-redirect') && !$(currentItem).hasClass('post-type-np-redirect') ) ? false : true;
938
+ },
939
  start: function(e, ui){
940
+ ui.placeholder.height(ui.item.height());
941
+ },
942
+ sort: function(e, ui){
943
+ plugin.formatter.updatePlaceholderWidth(ui);
944
+ },
945
+ stop: function(e, ui){
946
+ setTimeout(
947
+ function(){
948
+ plugin.formatter.updateSubMenuToggle();
949
+ plugin.formatter.setBorders();
950
+ plugin.formatter.setNestedMargins();
951
+ }, 100
952
+ );
953
+ plugin.syncNesting();
954
+ },
955
  });
956
  }
957
 
958
+ // Initialize Flat Sortable (Non-Hierarchical Post Types)
959
+ plugin.initializeSortableFlat = function()
960
+ {
961
+ var lists = $(NestedPages.selectors.lists).not(NestedPages.selectors.notSortable);
962
+ $.each(lists, function(){
963
+ $(this).sortable({
964
+ items : '>' + NestedPages.selectors.rows,
965
+ handle: NestedPages.selectors.handle,
966
+ placeholder: "ui-sortable-placeholder",
967
+ forcePlaceholderSize: true,
968
+ start: function(e, ui){
969
+ ui.placeholder.height(ui.item.height());
970
+ },
971
+ sort: function(e, ui){
972
+ plugin.formatter.updatePlaceholderWidth(ui);
973
+ },
974
+ stop: function(e, ui){
975
+ setTimeout(
976
+ function(){
977
+ plugin.formatter.updateSubMenuToggle();
978
+ plugin.formatter.setBorders();
979
+ plugin.formatter.setNestedMargins();
980
+ }, 100
981
+ );
982
+ plugin.syncNesting();
983
+ },
984
+ });
985
+ });
986
+ }
987
 
988
  // Disable Nesting
989
  plugin.disableNesting = function()
995
  // Sync Nesting
996
  plugin.syncNesting = function(manual, callback)
997
  {
998
+ var list;
999
+
1000
  if ( nestedpages.manual_order_sync === '1' && !manual) return;
1001
  $(NestedPages.selectors.errorDiv).hide();
1002
  $(NestedPages.selectors.loadingIndicator).show();
1003
+ if ( NestedPages.jsData.nestable ){
1004
+ list = $(NestedPages.selectors.sortable).nestedSortable('toHierarchy', {startDepthCount: 0});
1005
+ } else {
1006
+ list = plugin.setNestingArray();
1007
+ }
1008
+
1009
  plugin.disableNesting();
1010
 
1011
  var syncmenu = NestedPages.jsData.syncmenu;
1038
  });
1039
  }
1040
 
1041
+ plugin.setNestingArray = function(list)
1042
+ {
1043
+ ret = [];
1044
+ $(NestedPages.selectors.lists).first().children('li.page-row').each(function() {
1045
+ var level = plugin.recursiveNesting(this);
1046
+ ret.push(level);
1047
+ });
1048
+ return ret;
1049
+ }
1050
+
1051
+ plugin.recursiveNesting = function(item) {
1052
+ var id = $(item).attr('id');
1053
+ var currentItem;
1054
+ if (id) {
1055
+ id = id.replace('menuItem_', '');
1056
+ currentItem = {
1057
+ "id": id
1058
+ };
1059
+ if ($(item).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).length > 0) {
1060
+ currentItem.children = [];
1061
+ $(item).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).each(function() {
1062
+ var level = plugin.recursiveNesting(this);
1063
+ currentItem.children.push(level);
1064
+ });
1065
+ }
1066
+ return currentItem;
1067
+ }
1068
+ }
1069
  }
1070
  var NestedPages = NestedPages || {};
1071
 
1121
  plugin.formatter.showAjaxError(data.message);
1122
  }
1123
  },
1124
+ error: function(data){
1125
+ console.log(data);
1126
+ }
1127
  });
1128
  }
1129
 
1148
 
1149
  plugin.bindEvents = function()
1150
  {
1151
+ $(document).on('open-modal', function(e, button, modal){
1152
+ var target = $(button).attr('data-nestedpages-modal-toggle');
1153
+ if ( typeof target !== 'undefined' && target == 'np-bulk-modal' ){
1154
+ plugin.openModal();
1155
+ }
1156
  });
1157
  $(document).on('submit', NestedPages.selectors.newPageForm, function(e){
1158
  e.preventDefault();
1173
  e.preventDefault();
1174
  plugin.openQuickEdit($(this));
1175
  });
1176
+ $(document).on('click', NestedPages.selectors.cancelNewChildButton, function(e){
1177
+ e.preventDefault();
1178
  plugin.cancelNewPage();
1179
  });
1180
+ $(document).on('click', '[' + NestedPages.selectors.newBeforeButton + ']', function(e){
1181
+ e.preventDefault();
1182
+ plugin.openQuickEdit($(this));
1183
  });
1184
+ $(document).on('click', '[' + NestedPages.selectors.newAfterButton + ']', function(e){
1185
  e.preventDefault();
1186
+ plugin.openQuickEdit($(this));
 
1187
  });
1188
  }
1189
 
1195
  $(NestedPages.selectors.newPageModal).find('.modal-body').html(newform);
1196
  $(NestedPages.selectors.newPageModal).find('h3').text(nestedpages.add_multiple);
1197
  $(NestedPages.selectors.newPageModal).find('.page_parent_id').val(plugin.parent_id);
1198
+ $(newform).find('.np_title').first().focus();
1199
+ $(newform).find(NestedPages.selectors.newPageTitle).first().prop('tabindex', '2');
 
 
 
 
 
 
1200
  }
1201
 
1202
  // Open the new child quick edit
1203
  plugin.openQuickEdit = function(button)
1204
  {
1205
+ var before = $(button).attr(NestedPages.selectors.newBeforeButton);
1206
+ before = ( typeof before === 'undefined' || before === '' ) ? false : before;
1207
+
1208
+ var after = $(button).attr(NestedPages.selectors.newAfterButton);
1209
+ after = ( typeof after === 'undefined' || after === '' ) ? false : after;
1210
+
1211
  var parent_li = $(button).closest(NestedPages.selectors.row).parent('li');
1212
  var newform = $(NestedPages.selectors.newPageFormContainer).clone();
1213
 
1219
  $(newform).appendTo(parent_li);
1220
  }
1221
 
1222
+
1223
  $(newform).siblings(NestedPages.selectors.row).hide();
1224
 
1225
  plugin.formatter.showQuickEdit();
1226
 
1227
  $(newform).find('.parent_name').html('<em>Parent:</em> ' + $(button).attr('data-parentname'));
1228
+ if ( !before && !after ) $(newform).find('.page_parent_id').val($(button).attr('data-id'));
1229
+
1230
+ if ( before ) {
1231
+ $(newform).find('.page_before_id').val(before);
1232
+ $(newform).find('[data-new-post-relation-title]').text(nestedpages.insert_before + ': ' + $(button).attr('data-parentname'));
1233
+ }
1234
+ if ( after ) {
1235
+ $(newform).find('.page_after_id').val(after);
1236
+ $(newform).find('[data-new-post-relation-title]').text(nestedpages.insert_after + ': ' + $(button).attr('data-parentname'));
1237
+ }
1238
+
1239
  $(newform).show();
1240
  $(newform).find('.np_title').focus();
1241
  $(newform).find(NestedPages.selectors.newPageTitle).prop('tabindex', '2');
1256
  {
1257
  var form = $(button).parents('form');
1258
  var fieldcount = $(button).siblings('.new-page-titles').children('li').length + 1;
1259
+ 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>';
1260
  var container = $(button).siblings('.new-page-titles').append(html);
1261
  $(form).find('.np_title').last().focus();
1262
  $(form).find(NestedPages.selectors.newPageTitle).prop('tabindex', fieldcount++);
1279
  plugin.form = $(button).parents('form');
1280
 
1281
  var addedit = ( $(button).hasClass('add-edit') ) ? true : false;
1282
+ var action = NestedPages.formActions.newPage;
1283
+ if ( $(plugin.form).find('.page_before_id').val() !== '' ) action = NestedPages.formActions.newBeforeAfter;
1284
+ if ( $(plugin.form).find('.page_after_id').val() !== '' ) action = NestedPages.formActions.newBeforeAfter;
1285
+
1286
  $.ajax({
1287
  url: NestedPages.jsData.ajaxurl,
1288
  type: 'post',
1289
  datatype: 'json',
1290
+ data: $(plugin.form).serialize() + '&action=' + action + '&nonce=' + NestedPages.jsData.nonce + '&syncmenu=' + NestedPages.jsData.syncmenu + '&post_type=' + NestedPages.jsData.posttype,
1291
  success: function(data){
1292
  if (data.status === 'error'){
1293
  plugin.toggleLoading(false);
1315
  // Add the new posts
1316
  plugin.addPosts = function()
1317
  {
1318
+ // Before/After ID if applicable
1319
+ var before = $(plugin.form).find('.page_before_id').val();
1320
+ before = ( before !== '' ) ? before : false;
1321
+ var after = $(plugin.form).find('.page_after_id').val();
1322
+ after = ( after !== '' ) ? after : false;
1323
+
1324
  var parent_li = $(plugin.form).parent('.new-child').parent('.page-row');
1325
 
1326
  // If parent li doesn't have a child ol, add one
1327
+ if ( $(parent_li).children('ol').length === 0 && !before && !after ){
1328
  $(parent_li).append('<ol class="nplist"></ol>');
1329
  }
1330
 
1335
  }
1336
 
1337
  for (i = 0; i < plugin.posts.length; i++){
1338
+ plugin.appendRows(appendto, plugin.posts[i], before, after);
1339
  }
1340
 
1341
  // Show the child page list and reset submenu toggles
1342
+ if ( !before && !after ){
1343
+ $(appendto).show();
1344
+ }
1345
+
1346
  plugin.formatter.updateSubMenuToggle();
1347
  plugin.formatter.setNestedMargins();
1348
  plugin.cancelNewPage();
1349
+ $(document).trigger('close-modal-manual');
1350
  }
1351
 
1352
  // Append new post rows to the nested view
1353
+ plugin.appendRows = function(appendto, post, before, after)
1354
  {
1355
  var html = '<li id="menuItem_' + post.id + '" class="page-row';
1356
  if ( post.status === 'publish' ) html += ' published';
1365
  }
1366
 
1367
  html += '<div class="row-inner">';
1368
+ // Submenu
1369
+ 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>';
1370
+ // Handle
1371
+ 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>';
1372
  html += '<a href="' + post.edit_link + '" class="page-link page-title">';
1373
  html += '<span class="title">' + post.title + '</span>';
1374
 
1386
  }
1387
  html += '</span>';
1388
 
1389
+ html += '<span class="edit-indicator">Edit</span>';
1390
  html += '</a>';
1391
 
1392
  // Non-Hierarchical Data
1406
 
1407
  // Action Buttons
1408
  html += '<div class="action-buttons">';
1409
+ 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>';
1410
+ // Add Link
1411
+ 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>';
1412
+ // Add Child
1413
+ 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>';
1414
+ html += '</ul></div>';
1415
 
1416
  // Quick Edit (data attrs)
1417
  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>';
1418
 
1419
  html += '<a href="' + post.view_link + '" class="np-btn" target="_blank">' + nestedpages.view + '</a>';
1420
+
1421
+ // Trash
1422
+ 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>';
1423
  html += '</div><!-- .action-buttons -->';
1424
 
1425
  html += '</div><!-- .row-inner --></div><!-- .row -->';
1426
  html += '</li>';
1427
 
1428
+ if ( before ){
1429
+ var row = plugin.findRowById(before);
1430
+ $(html).insertBefore(row);
1431
+ return;
1432
+ }
1433
+ if ( after ){
1434
+ var row = plugin.findRowById(after);
1435
+ $(html).insertAfter(row);
1436
+ return;
1437
+ }
1438
+
1439
  $(appendto).append(html);
1440
  }
1441
 
1442
+ // Find the row for inserting before/after
1443
+ plugin.findRowById = function(id)
1444
+ {
1445
+ var row = $(NestedPages.selectors.rows + '#menuItem_' + id);
1446
+ return row;
1447
+ }
1448
+
1449
  // Toggle the form loading state
1450
  plugin.toggleLoading = function(loading)
1451
  {
1821
  // Password Lock Icon
1822
  if ( plugin.newData.post_password !== "" && typeof plugin.newData.post_password !== 'undefined'){
1823
  var statustext = $(status).text();
1824
+ statustext += ' <span class="locked">';
1825
+ 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>'
1826
+ statustext += '</span>';
1827
  $(status).html(statustext);
1828
  }
1829
 
1839
  var li = $(plugin.row).parent('li');
1840
  if ( (plugin.newData.np_status == 'hide') ){
1841
  $(li).addClass('np-hide');
1842
+ $(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>');
1843
  } else {
1844
  $(li).removeClass('np-hide');
1845
+ $(plugin.row).find('.status-np-hidden').remove();
1846
  }
1847
 
1848
  // Sticky
2008
  plugin.newPostData = ''; // Data after update
2009
  plugin.form = ''; // The newly created Quick Edit Form
2010
 
 
 
 
 
 
 
 
2011
  plugin.bindEvents = function()
2012
  {
2013
  $(document).on('click', NestedPages.selectors.quickEditButtonLink, function(e){
2157
  // Update the row after successfully saving quick edit data
2158
  plugin.updateRow = function()
2159
  {
 
2160
  var row = $(plugin.form).siblings('.row');
2161
+ $(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>');
2162
 
2163
  var status = $(row).find('.status');
2164
  if ( (plugin.newPostData._status !== 'publish') && (plugin.newPostData._status !== 'future') ){
2179
  var li = $(row).parent('li');
2180
  if ( (plugin.newPostData.np_status == 'hide') ){
2181
  $(li).addClass('np-hide');
2182
+ $(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>');
2183
  } else {
2184
  $(li).removeClass('np-hide');
2185
+ $(row).find('.status-np-hidden').remove();
2186
  }
2187
 
2188
  var button = $(row).find(NestedPages.selectors.quickEditButtonLink);
2216
  $(NestedPages.selectors.quickEditLoadingIndicator).hide();
2217
  }
2218
 
2219
+ return plugin.bindEvents();
 
2220
 
2221
  }
2222
  var NestedPages = NestedPages || {};
2237
 
2238
  plugin.formatter = new NestedPages.Formatter;
2239
 
 
 
 
 
 
 
2240
  plugin.bindEvents = function()
2241
  {
2242
  $(document).on('click', NestedPages.selectors.cloneButton, function(e){
2255
  // Open the modal with clone options
2256
  plugin.openModal = function()
2257
  {
2258
+ $('#' + NestedPages.selectors.cloneModal).find('[data-clone-parent]').text(plugin.parent_title);
2259
+ $(document).trigger('open-modal-manual', NestedPages.selectors.cloneModal);
2260
  }
2261
 
 
2262
  // Clone the post
2263
  plugin.clone = function()
2264
  {
2277
  },
2278
  success : function(data){
2279
  plugin.toggleLoading(false);
2280
+ $(document).trigger('close-modal-manual');
2281
  location.reload();
2282
  }
2283
  });
2284
  }
2285
 
 
2286
  // Toggle Loading
2287
  plugin.toggleLoading = function(loading)
2288
  {
2289
  if ( loading ){
2290
+ $('#' + NestedPages.selectors.cloneModal).find('[data-clone-loading]').show();
2291
  $(NestedPages.selectors.confirmClone).attr('disabled', 'disabled');
2292
  return;
2293
  }
2294
+ $('#' + NestedPages.selectors.cloneModal).find('[data-clone-loading]').hide();
2295
  $(NestedPages.selectors.confirmClone).attr('disabled', false);
2296
  }
2297
 
2298
+ return plugin.bindEvents();
2299
  }
2300
  var NestedPages = NestedPages || {};
2301
 
2410
 
2411
  // Link Items
2412
  openLinkModal : '.open-redirect-modal', // Opens new link modal
2413
+ linkModal : 'np-link-modal', // The add a link modal
2414
  saveLink : '.np-save-link', // Save Link Button
2415
  linkLoadingIndicator : '.np-link-loading', // Loading Indicator in Link Modal
2416
  linkErrorDiv : '.np-new-link-error', // Error Div in Link Modal
2419
  // Link Deletion
2420
  linkDeleteButton : '[data-np-confirm-delete]',
2421
  linkDeleteConfirmationButton : '[data-delete-confirmation]',
2422
+ linkDeleteConfirmationModal : 'np-delete-confirmation-modal',
2423
  linkDeleteConfirmationModalText : '[data-np-link-delete-text]',
2424
 
2425
  // New Page Items
2433
  addChildButton : '.add-new-child', // Button to add child page(s)
2434
  newChildError : '.np-newchild-error', // Error div in new child quick edit
2435
  cancelNewChildButton : '.np-cancel-newchild', // Cancel button in new child quick edit
2436
+ newBeforeButton : 'data-insert-before', // Add new post(s) before a post
2437
+ newAfterButton : 'data-insert-after', // Add new post(s) after a post
2438
 
2439
  // Clone
2440
  cloneButton : '.clone-post', // Button to clone a post
2441
  confirmClone : '[data-confirm-clone]', // Button in modal to confirm clone
2442
+ cloneModal : 'np-clone-modal', // Modal with clone options
2443
  cloneQuantity : '[data-clone-quantity]', // Quantity to Clone
2444
  cloneStatus : '[data-clone-status]', // Clone Status
2445
  cloneAuthor : '[data-clone-author]', // Clone Author
2462
 
2463
  // CSS Classes
2464
  NestedPages.cssClasses = {
 
 
2465
  noborder : 'no-border'
2466
  }
2467
 
2492
  syncNesting : 'npsort',
2493
  syncMenu : 'npsyncMenu',
2494
  newPage : 'npnewChild',
2495
+ newBeforeAfter : 'npnewBeforeAfter',
2496
  quickEditLink : 'npquickEditLink',
2497
  getTaxonomies : 'npgetTaxonomies',
2498
  quickEditPost : 'npquickEdit',
2515
  var $ = jQuery;
2516
 
2517
  plugin.formatter = new NestedPages.Formatter;
2518
+ plugin.dropdowns = new NestedPages.Dropdowns;
2519
+ plugin.modals = new NestedPages.Modals;
2520
  plugin.checkAll = new NestedPages.CheckAll;
2521
  plugin.bulkActions = new NestedPages.BulkActions;
2522
  plugin.menuToggle = new NestedPages.MenuToggle;
2533
  plugin.confirmDelete = new NestedPages.ConfirmDelete;
2534
  plugin.manualSync = new NestedPages.ManualSync;
2535
  plugin.postSearch = new NestedPages.PostSearch;
2536
+ plugin.postMove = new NestedPages.MovePost;
2537
  plugin.wpml = new NestedPages.Wpml;
2538
 
2539
  plugin.init = function()
2687
  plugin.submitForm();
2688
  });
2689
  $(document).on('keydown', function(e){
2690
+ if ( e.keyCode === 27 ) $(document).trigger('close-modal-manual');
2691
  });
2692
  }
2693
 
2700
  plugin.clearForm();
2701
  $(plugin.selectors.accordion).find('ul').hide();
2702
  $(plugin.selectors.typeSelect).removeClass('active');
2703
+ $(document).trigger('open-modal-manual', NestedPages.selectors.linkModal);
2704
  }
2705
 
2706
  // Accordion Menu
2815
  var html = '<li id="menuItem_' + plugin.post.id + '" class="page-row published';
2816
  html += '">'
2817
 
2818
+ html += '<div class="row"><div class="child-toggle"><div class="child-toggle-spacer"></div></div><div class="row-inner">';
2819
+ 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>';
2820
+ 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>';
2821
+ 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>';
2822
 
2823
  // Quick Edit Button
2824
+ html += '</a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ';
2825
  html += 'data-id="' + plugin.post.id + '"';
2826
  html += 'data-parentid="' + plugin.post.parent_id + '"';
2827
  html += 'data-title="' + plugin.post.menuTitle + '" ';
2851
  plugin.appendChildRow(html);
2852
  }
2853
 
2854
+ $(document).trigger('close-modal-manual');
2855
 
2856
  plugin.row = $('#menuItem_' + plugin.post.id).find('.row');
2857
  plugin.formatter.flashRow(plugin.row);
3043
  plugin.nonce = nestedpages.np_nonce;
3044
  plugin.formAction = 'npEmptyTrash';
3045
 
 
 
 
 
 
 
 
3046
  plugin.bindEvents = function(){
 
 
 
 
3047
  $(document).on('click', plugin.confirmButton, function(e){
3048
  e.preventDefault();
3049
  plugin.confirmEmpty();
3053
  // Confirm Trash Empty
3054
  plugin.confirmEmpty = function(){
3055
  plugin.loading(true);
3056
+ $(document).trigger('close-modal-manual');
3057
  $(plugin.errorAlert).hide();
3058
  plugin.emptyTrash();
3059
  }
3090
  $(plugin.loadingIndicator).hide();
3091
  }
3092
 
3093
+ return plugin.bindEvents();
3094
  }
 
3095
  var NestedPages = NestedPages || {};
3096
 
3097
  /**
3132
  plugin.deleteLink = $(button).attr('href');
3133
  $(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation_singular);
3134
  $(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.delete).removeClass('bulk');
3135
+ $(document).trigger('open-modal-manual', NestedPages.selectors.linkDeleteConfirmationModal);
3136
  }
3137
 
3138
  // Confirm Multiple link deletion
3144
  event.preventDefault();
3145
  $(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation);
3146
  $(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.trash_delete_links).addClass('bulk');
3147
+ $(document).trigger('open-modal-manual', [NestedPages.selectors.linkDeleteConfirmationModal]);
3148
  }
3149
 
3150
  // Submit the form to delete multiple
3375
  }
3376
  var NestedPages = NestedPages || {};
3377
 
3378
+ /**
3379
+ * Move a Post Up or Down in the list
3380
+ * @package Nested Pages
3381
+ * @author Kyle Phillips - https://github.com/kylephillips/wp-nested-pages
3382
+ */
3383
+ NestedPages.MovePost = function()
3384
+ {
3385
+ var plugin = this;
3386
+ var $ = jQuery;
3387
+
3388
+ plugin.formatter = new NestedPages.Formatter;
3389
+ plugin.nesting = new NestedPages.Nesting;
3390
+ plugin.activeRow;
3391
+
3392
+ plugin.selectors = {
3393
+ moveToTop : 'data-push-to-top',
3394
+ moveToBottom : 'data-push-to-bottom'
3395
+ }
3396
+
3397
+ plugin.bindEvents = function()
3398
+ {
3399
+ $(document).ready(function(){
3400
+ plugin.disableTopOnFirst();
3401
+ plugin.disableBottomOnLast();
3402
+ });
3403
+ $(document).on('click', '[' + plugin.selectors.moveToTop + ']', function(e){
3404
+ e.preventDefault();
3405
+ if ( $(this).hasClass('disabled') ) return;
3406
+ plugin.activeRow = $(this).closest(NestedPages.selectors.rows);
3407
+ plugin.moveToTop();
3408
+ });
3409
+ $(document).on('click', '[' + plugin.selectors.moveToBottom + ']', function(e){
3410
+ e.preventDefault();
3411
+ if ( $(this).hasClass('disabled') ) return;
3412
+ plugin.activeRow = $(this).closest(NestedPages.selectors.rows);
3413
+ plugin.moveToBottom();
3414
+ });
3415
+ }
3416
+
3417
+ /**
3418
+ * Move a post to the top of its list
3419
+ */
3420
+ plugin.moveToTop = function()
3421
+ {
3422
+ var parent = $(plugin.activeRow).parent(NestedPages.selectors.lists);
3423
+ var first = $(parent).find(NestedPages.selectors.rows).first();
3424
+ $(plugin.activeRow).insertBefore(first);
3425
+ plugin.formatter.setBorders();
3426
+ $(document).click(); // Close Dropdowns
3427
+ plugin.nesting.syncNesting();
3428
+ plugin.disableTopOnFirst();
3429
+ plugin.disableBottomOnLast();
3430
+ }
3431
+
3432
+ /**
3433
+ * Move a post to the bottom of its list
3434
+ */
3435
+ plugin.moveToBottom = function()
3436
+ {
3437
+ var parent = $(plugin.activeRow).parent(NestedPages.selectors.lists);
3438
+ var last = $(parent).children(NestedPages.selectors.rows).last();
3439
+ $(plugin.activeRow).insertAfter(last);
3440
+ plugin.formatter.setBorders();
3441
+ $(document).click(); // Close Dropdowns
3442
+ plugin.nesting.syncNesting();
3443
+ plugin.disableTopOnFirst();
3444
+ plugin.disableBottomOnLast();
3445
+ }
3446
+
3447
+ plugin.disableTopOnFirst = function()
3448
+ {
3449
+ var lists = $(NestedPages.selectors.lists);
3450
+ $.each(lists, function(){
3451
+ $(this).find('[' + plugin.selectors.moveToTop + ']').removeClass('disabled');
3452
+ var first = $(this).find(NestedPages.selectors.rows).first();
3453
+ $(first).find('[' + plugin.selectors.moveToTop + ']').addClass('disabled');
3454
+ });
3455
+ }
3456
+
3457
+ plugin.disableBottomOnLast = function()
3458
+ {
3459
+ var lists = $(NestedPages.selectors.lists);
3460
+ $.each(lists, function(){
3461
+ $(this).find('[' + plugin.selectors.moveToBottom + ']').removeClass('disabled');
3462
+ var last = $(this).find(NestedPages.selectors.rows).last();
3463
+ $(last).find('[' + plugin.selectors.moveToBottom + ']').addClass('disabled');
3464
+ });
3465
+ }
3466
+
3467
+ return plugin.bindEvents();
3468
+ }
3469
+ var NestedPages = NestedPages || {};
3470
+
3471
  /**
3472
  * WPML functionality
3473
  * @package Nested Pages
3505
  */
3506
  plugin.createTranslationsModal = function(button)
3507
  {
3508
+ plugin.parent_li = $(button).parents('.action-buttons').closest(NestedPages.selectors.row).parent('li');
3509
+ plugin.button = $(plugin.parent_li).find(NestedPages.selectors.quickEditOpen);
3510
  plugin.postData = {
3511
  id : $(plugin.button).attr('data-id'),
3512
  title : $(plugin.button).attr('data-title'),
3541
  nonce : NestedPages.jsData.nonce
3542
  },
3543
  success: function(data){
3544
+ console.log(data);
3545
+ console.log(plugin.postData.id);
3546
  if ( data.status === 'success' ){
3547
  plugin.populateModal(data.translations);
3548
  } else {
assets/js/nestedpages.min.js CHANGED
@@ -1 +1 @@
1
- var NestedPages=NestedPages||{};NestedPages.Responsive=function(){var e=this,t=jQuery;return e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("click",NestedPages.selectors.toggleEditButtons,function(a){a.preventDefault(),e.toggleEdit(t(this))}),t(window).resize(function(){e.timer(function(){t(".action-buttons").removeAttr("style"),t(".np-toggle-edit").removeClass("active")},500)})},e.toggleEdit=function(e){var a=t(e).siblings(".action-buttons");if(t(a).is(":visible"))return t(e).removeClass("active"),void t(a).hide();t(e).addClass("active"),t(a).show()},e.timer=function(){var e=0;return function(t,a){clearTimeout(e),e=setTimeout(t,a)}}(),e.init()},(NestedPages=NestedPages||{}).Formatter=function(){var e=this,t=jQuery;e.updateSubMenuToggle=function(){for(var e=t(NestedPages.selectors.childToggle),a=0;a<e.length;a++){var s=e[a],n=t(s).parent(".row").parent("li");if(t(n).children("ol").length>0){var o=t(n).children("ol:visible").length>0?NestedPages.cssClasses.iconToggleDown:NestedPages.cssClasses.iconToggleRight;t(s).html('<div class="child-toggle-spacer"></div><a href="#"><i class="'+o+'"></i></a>'),t(n).children("ol").children(".np-hide").length>0&&0===t(n).children("ol").children(".np-hide.shown").length?t(s).find("a").hide():t(n).children("ol").children(".np-hide").length>0&&t(n).children("ol").children(".np-hide.shown").length>0&&t(s).find("a").show()}else t(s).empty().html('<div class="child-toggle-spacer"></div>')}},e.setBorders=function(){t(NestedPages.selectors.rows).removeClass(NestedPages.cssClasses.noborder),t.each(t(NestedPages.selectors.lists),function(){t(this).find(".page-row:visible:first").addClass(NestedPages.cssClasses.noborder)})},e.setNestedMargins=function(){t.each(t(NestedPages.selectors.lists),function(e,a){var s=t(this).parents(NestedPages.selectors.lists).length,n=0;if(NestedPages.jsData.sortable||(n=10),s>0){n=20*s+n;t(this).find(".row-inner").css("padding-left",n+"px")}else NestedPages.jsData.sortable?t(this).find(".row-inner").css("padding-left","0px"):t(this).find(".row-inner").css("padding-left","10px")})},e.updatePlaceholderWidth=function(a){if(NestedPages.jsData.nestable){var s=40*t(a.placeholder).parents("ol").length-40,n=t(NestedPages.selectors.sortable).width()-s;t(a.placeholder).width(n).css("margin-left",s+"px")}e.updateListVisibility(a)},e.updateListVisibility=function(e){var a=t(e.placeholder).parent("ol");t(a).is(":visible")||(t(a).addClass("nplist"),t(a).show())},e.removeQuickEdit=function(){t(NestedPages.selectors.quickEditOverlay).removeClass("active").remove(),t(".sortable .quick-edit").remove(),t(".row").show()},e.showQuickEdit=function(){t("body").append('<div class="np-inline-overlay"></div>'),setTimeout(function(){t(".np-inline-overlay").addClass("active")},50)},e.flashRow=function(a){t(a).addClass("np-updated"),e.setBorders(),setTimeout(function(){t(a).addClass("np-updated-show")},1500)},e.showAjaxError=function(e){t(NestedPages.selectors.ajaxError).find("p").text(e),t(NestedPages.selectors.ajaxError).show()},e.hideAjaxError=function(e){t(NestedPages.selectors.ajaxError).hide()},e.sizeLinkThumbnails=function(){var e=t(NestedPages.selectors.thumbnailContainer).not(NestedPages.selectors.thumbnailContainerLink).first().find("img"),a=t(e).width(),s=t(e).height();t.each(t(NestedPages.selectors.thumbnailContainerLink),function(){t(this).width(a),t(this).height(s)})}},(NestedPages=NestedPages||{}).CheckAll=function(){var e=this,t=jQuery;return e.activeCheckbox="",e.selectors={checkbox:"[data-np-check-all]"},e.bindEvents=function(){t(document).on("change",e.selectors.checkbox,function(){e.activeCheckbox=t(this),e.toggleCheckboxes()}),t(document).on("change","input[type=checkbox]",function(){e.checkAllStatus(t(this))})},e.init=function(){e.bindEvents()},e.toggleCheckboxes=function(){var a=!!t(e.activeCheckbox).is(":checked"),s=t(e.activeCheckbox).attr("data-np-check-all"),n=t('*[name="'+s+'"]');t.each(n,function(){var e=t(this).parents(NestedPages.selectors.rows);t(this).prop("checked",a),t(e).hasClass("np-hide")&&!t(e).is(":visible")&&t(e).find(NestedPages.selectors.bulkActionsCheckbox).prop("checked",!1)}),e.toggleCheckAll()},e.toggleCheckAll=function(){var a=t(e.activeCheckbox).attr("data-np-check-all"),s=t('*[name="'+a+'"]').length;s=s-t(".np-hide").find(NestedPages.selectors.bulkActionsCheckbox).length+t(".np-hide:visible").find(NestedPages.selectors.bulkActionsCheckbox).length;var n=t('*[name="'+a+'"]:checked').length;if(s==n)return t(e.activeCheckbox).prop("checked",!0),void t(e.activeCheckbox).removeClass("check-all-partial");n>0?t(e.activeCheckbox).addClass("check-all-partial"):(t(e.activeCheckbox).attr("checked",!1),t(e.activeCheckbox).removeClass("check-all-partial"))},e.checkAllStatus=function(a){var s=t(a).attr("name"),n=t('*[data-np-check-all="'+s+'"]');0!==n.length&&(e.activeCheckbox=t(n)[0],e.toggleCheckAll())},e.init()},(NestedPages=NestedPages||{}).BulkActions=function(){var e=this,t=jQuery;return e.selectedNumber=0,e.selectedLinks=[],e.selectedPosts=[],e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("change",NestedPages.selectors.bulkActionsCheckbox,function(){e.toggleBulkForm()}),t(document).on("submit",NestedPages.selectors.bulkActionsForm,function(a){"edit"===t("select[name=np_bulk_action]").val()&&(a.preventDefault(),e.toggleBulkEdit(!0))}),t(document).on("click",NestedPages.selectors.bulkEditRemoveItem,function(a){a.preventDefault();var s=t(this).siblings("input[type=hidden]").val();e.uncheckBulkItem(s)}),t(document).on("click",NestedPages.selectors.bulkEditCancel,function(t){t.preventDefault(),e.uncheckAllBulkItems()})},e.toggleBulkForm=function(){var a=!1,s="",n="";if(e.selectedPosts=[],e.selectedLinks=[],t.each(t(NestedPages.selectors.bulkActionsCheckbox),function(){if(t(this).is(":checked")){var o=t(this).parents(NestedPages.selectors.rows);if(a=!0,t(this).parent("div").hasClass("np-check-all")||t(o).hasClass("post-type-np-redirect")||(s+=t(this).val()+","),t(o).hasClass("post-type-np-redirect")&&(n+=t(this).val()+",",e.selectedLinks.push(t(this).val())),"np-redirect"!==t(this).attr("data-np-post-type")&&!t(this).parent("div").hasClass("np-check-all")){var i=[];i.title=t(this).attr("data-np-bulk-checkbox"),i.id=t(this).val(),e.selectedPosts.push(i)}}}),e.setBulkEditPosts(),e.toggleEditOption(),e.toggleLinkCountAlert(),a)return t(NestedPages.selectors.bulkActionsForm).show(),t(NestedPages.selectors.bulkActionsIds).val(s),t(NestedPages.selectors.bulkActionRedirectIds).val(n),void e.setSelectedNumber();t(NestedPages.selectors.bulkActionsIds).val(""),t(NestedPages.selectors.bulkActionsForm).hide()},e.setBulkEditPosts=function(){for(var a="",s=0;s<e.selectedPosts.length;s++)a+='<li><a href="#" class="np-remove" data-np-remove-bulk-item>&times;</a>',a+=e.selectedPosts[s].title,a+='<input type="hidden" name="post_ids[]" value="'+e.selectedPosts[s].id+'"></li>';t(NestedPages.selectors.bulkEditTitles).html(a)},e.uncheckBulkItem=function(a){t.each(t(NestedPages.selectors.bulkActionsCheckbox),function(){t(this).val()==a&&t(this).prop("checked",!1).change()}),0===t(NestedPages.selectors.bulkEditRemoveItem).length&&e.toggleBulkEdit(!1)},e.uncheckAllBulkItems=function(){t.each(t(NestedPages.selectors.bulkActionsCheckbox),function(){t(this).prop("checked",!1).change()}),e.toggleBulkEdit(!1)},e.setSelectedNumber=function(){var e=t(NestedPages.selectors.bulkActionsCheckbox+":checked").not(".np-check-all input").length,a=t(NestedPages.selectors.bulkActionsForm).find("select option").first();t(a).text(nestedpages.bulk_actions+" ("+e+")")},e.toggleEditOption=function(){var a=t(NestedPages.selectors.bulkActionsCheckbox+":checked").not(".np-check-all input").not(".np-redirect-bulk").length,s=t(NestedPages.selectors.bulkActionsForm).find("select option[value=edit]");if(0===a)return t(s).prop("disabled",!0),t(NestedPages.selectors.bulkActionsForm).find("select option").first().prop("selected",!0),void e.toggleBulkEdit(!1);t(s).prop("disabled",!1)},e.toggleBulkEdit=function(a){if(e.toggleLinkCountAlert(),a)return t(NestedPages.selectors.bulkEditForm).show(),t(NestedPages.selectors.bulkActionsForm).hide(),void e.setWPSuggest();t(NestedPages.selectors.bulkEditForm).hide(),t(NestedPages.selectors.bulkActionsForm).show(),t(NestedPages.selectors.bulkEditLinkCount).parent("div").hide(),t(NestedPages.selectors.bulkActionsForm).find("select option").first().text(nestedpages.bulk_actions),e.resetBulkEditFields()},e.toggleLinkCountAlert=function(){0!==e.selectedLinks.length?t(NestedPages.selectors.bulkEditLinkCount).parent("div").show():t(NestedPages.selectors.bulkEditLinkCount).parent("div").hide()},e.setWPSuggest=function(){var e=t(NestedPages.selectors.bulkEditForm).find("[data-autotag]");t.each(e,function(e,a){var s=t(this).attr("data-taxonomy");t(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+s,{multiple:!0,multipleSep:","})})},e.resetBulkEditFields=function(){var e=t(NestedPages.selectors.bulkEditForm).find("select");t.each(e,function(){t(this).find("option").first().prop("selected",!0)});var a=t(NestedPages.selectors.bulkEditForm).find(".cat-checklist");t.each(a,function(){t(this).find("input[type=checkbox]").prop("checked",!1)})},e.init()},(NestedPages=NestedPages||{}).HiddenItemCount=function(){var e=this,t=jQuery;return e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("change",NestedPages.selectors.bulkActionsCheckbox,function(){e.toggleHiddenCount()}),t(document).on("click",NestedPages.selectors.toggleAll,function(){e.toggleHiddenCount()}),t(document).on("click",NestedPages.selectors.pageToggle,function(){e.toggleHiddenCount()})},e.toggleHiddenCount=function(){var e=0;t.each(t(NestedPages.selectors.bulkActionsCheckbox),function(){if(t(this).is(":checked")){if(t(this).parent("div").hasClass("np-check-all"))return;var a=t(this).closest(".page-row");t(a).is(":visible")||e++}}),e<1?t(NestedPages.selectors.hiddenItemCountParent).hide():(t(NestedPages.selectors.hiddenItemCount).text(e),t(NestedPages.selectors.hiddenItemCountParent).show())},e.init()},(NestedPages=NestedPages||{}).MenuToggle=function(){var e=this,t=jQuery;return e.formatter=new NestedPages.Formatter,e.bindEvents=function(){t(document).on("click",NestedPages.selectors.childToggleLink,function(a){a.preventDefault(),e.toggleSingleMenu(t(this))}),t(document).on("click",NestedPages.selectors.toggleAll,function(t){t.preventDefault(),e.toggleAllMenus()})},e.toggleSingleMenu=function(a){var s=t(a).parent(NestedPages.selectors.childToggle).parent(NestedPages.selectors.row).siblings("ol");t(a).find("i").toggleClass(NestedPages.cssClasses.iconToggleDown).toggleClass(NestedPages.cssClasses.iconToggleRight),t(s).toggle(),e.formatter.setBorders(),e.formatter.setNestedMargins(),e.syncUserToggles()},e.toggleAllMenus=function(){var a=NestedPages.selectors.toggleAll;if("closed"===t(a).attr("data-toggle"))return t(NestedPages.selectors.lists).show(),t(a).attr("data-toggle","opened").text(NestedPages.jsData.collapseText),t(NestedPages.selectors.childToggle).find("i").removeClass(NestedPages.cssClasses.iconToggleRight).addClass(NestedPages.cssClasses.iconToggleDown),e.formatter.setBorders(),void e.syncUserToggles();t(NestedPages.selectors.lists).not(t(NestedPages.selectors.lists)[0]).hide(),t(a).attr("data-toggle","closed").text(NestedPages.jsData.expandText),t(NestedPages.selectors.childToggle).find("i").removeClass(NestedPages.cssClasses.iconToggleDown).addClass(NestedPages.cssClasses.iconToggleRight),e.formatter.setBorders(),e.syncUserToggles()},e.visibleRowIDs=function(){var e=[],a=t(NestedPages.selectors.rows+":visible");return t.each(a,function(a,s){var n=t(this).attr("id");e.push(n.replace("menuItem_",""))}),e},e.syncUserToggles=function(){t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.syncToggles,nonce:NestedPages.jsData.nonce,ids:e.visibleRowIDs(),posttype:NestedPages.jsData.posttype},success:function(e){"success"!==e.status&&console.log("There was an error saving toggled pages.")}})},e.bindEvents()},(NestedPages=NestedPages||{}).PageToggle=function(){var e=this,t=jQuery;return e.activeButton="",e.formatter=new NestedPages.Formatter,e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("click",NestedPages.selectors.toggleHidden,function(a){a.preventDefault(),e.activeButton=t(this),e.toggleHidden()}),t(document).on("click",NestedPages.selectors.toggleStatus,function(a){a.preventDefault(),e.toggleStatus(t(this))})},e.toggleHidden=function(){var a=t(e.activeButton),s=t(a).attr("href");if("#show"==s)return t(a).attr("href","#hide").text(NestedPages.jsData.showHiddenText),t(NestedPages.selectors.hiddenRows).removeClass("shown").hide(),e.formatter.updateSubMenuToggle(),void e.formatter.setBorders();"#hide"==s&&(t(a).attr("href","#show").text(NestedPages.jsData.hideHiddenText),t(NestedPages.selectors.hiddenRows).addClass("shown").show(),e.formatter.updateSubMenuToggle(),e.formatter.setBorders())},e.toggleStatus=function(e){var a=t(e).attr("href");a=a.substring(1),t(NestedPages.selectors.syncCheckbox).attr("disabled",!1),t(NestedPages.selectors.toggleStatus).removeClass("active"),t(e).addClass("active"),"draft"==a&&(t(NestedPages.selectors.syncCheckbox).attr("disabled",!0),t("."+a).addClass("nested-visible")),"all"!=a?(t(NestedPages.selectors.rows).hide(),t("."+a).show()):t(NestedPages.selectors.rows).show()},e.init()},(NestedPages=NestedPages||{}).Nesting=function(){var e=this,t=jQuery;e.formatter=new NestedPages.Formatter,e.initializeSortable=function(){maxLevels=NestedPages.jsData.nestable?0:1,t(NestedPages.selectors.sortable).not(NestedPages.selectors.notSortable).nestedSortable({items:NestedPages.selectors.rows,toleranceElement:"> .row",handle:NestedPages.selectors.handle,placeholder:"ui-sortable-placeholder",maxLevels:maxLevels,tabSize:56,start:function(e,t){t.placeholder.height(t.item.height())},sort:function(t,a){e.formatter.updatePlaceholderWidth(a)},stop:function(t,a){setTimeout(function(){e.formatter.updateSubMenuToggle(),e.formatter.setBorders(),e.formatter.setNestedMargins()},100),e.syncNesting()}})},e.disableNesting=function(){t(NestedPages.selectors.sortable).sortable("destroy")},e.syncNesting=function(a,s){if("1"!==nestedpages.manual_order_sync||a){t(NestedPages.selectors.errorDiv).hide(),t(NestedPages.selectors.loadingIndicator).show(),list=t(NestedPages.selectors.sortable).nestedSortable("toHierarchy",{startDepthCount:0}),e.disableNesting();var n=NestedPages.jsData.syncmenu;"1"===nestedpages.manual_menu_sync&&(n="nosync"),t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.syncNesting,nonce:NestedPages.jsData.nonce,list:list,post_type:NestedPages.jsData.posttype,syncmenu:n},success:function(a,s){if(e.initializeSortable(),"error"===a.status)t(NestedPages.selectors.errorDiv).text(a.message).show(),t(NestedPages.selectors.loadingIndicator).hide();else{if(s&&"function"==typeof s)return void s();t(NestedPages.selectors.loadingIndicator).hide()}}})}}},(NestedPages=NestedPages||{}).SyncMenuSetting=function(){var e=this,t=jQuery;return e.formatter=new NestedPages.Formatter,e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).ready(function(){"1"!==nestedpages.manual_menu_sync&&"1"===nestedpages.syncmenu&&e.syncSetting()}),t(document).on("change",NestedPages.selectors.syncCheckbox,function(){e.syncSetting()})},e.syncSetting=function(){"page"===NestedPages.jsData.posttype&&0!==t(NestedPages.selectors.syncCheckbox).length&&(NestedPages.jsData.syncmenu=t(NestedPages.selectors.syncCheckbox).is(":checked")?"sync":"nosync",t.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(t){"error"===t.status&&e.formatter.showAjaxError(t.message)}}))},e.bindEvents()},(NestedPages=NestedPages||{}).NewPost=function(){var e=this,t=jQuery;return e.formatter=new NestedPages.Formatter,e.parent_id=0,e.posts="",e.form="",e.bindEvents=function(){t(document).on("click",NestedPages.selectors.openPageModal,function(t){t.preventDefault(),e.openModal()}),t(document).on("submit",NestedPages.selectors.newPageForm,function(e){e.preventDefault()}),t(document).on("click",NestedPages.selectors.newPageSubmitButton,function(a){a.preventDefault(),e.submitForm(t(this))}),t(document).on("click",NestedPages.selectors.newPageTitle,function(a){a.preventDefault(),e.addTitleField(t(this))}),t(document).on("click",NestedPages.selectors.newPageRemoveTitle,function(a){a.preventDefault(),e.removeTitleField(t(this))}),t(document).on("click",NestedPages.selectors.addChildButton,function(a){a.preventDefault(),e.openQuickEdit(t(this))}),t(NestedPages.selectors.newPageModal).on("hide.bs.modal",function(){e.cancelNewPage()}),t(NestedPages.selectors.newPageModal).on("shown.bs.modal",function(){e.modalOpened(t(this))}),t(document).on("click",NestedPages.selectors.cancelNewChildButton,function(a){a.preventDefault(),e.cancelNewPage(),t(NestedPages.selectors.newPageModal).modal("hide")})},e.openModal=function(){var a=t(NestedPages.selectors.newPageFormContainer).clone().find(NestedPages.selectors.newPageForm);t(a).addClass("in-modal"),t(NestedPages.selectors.newPageModal).find(".modal-body").html(a),t(NestedPages.selectors.newPageModal).find("h3").text(nestedpages.add_multiple),t(NestedPages.selectors.newPageModal).find(".page_parent_id").val(e.parent_id),t(NestedPages.selectors.newPageModal).modal("show")},e.modalOpened=function(e){t(e).find(".np_title").focus(),t(e).find(NestedPages.selectors.newPageTitle).prop("tabindex","2")},e.openQuickEdit=function(a){var s=t(a).closest(NestedPages.selectors.row).parent("li"),n=t(NestedPages.selectors.newPageFormContainer).clone();if(t(s).children("ol").length>0){var o=t(s).children("ol");t(n).insertBefore(o)}else t(n).appendTo(s);t(n).siblings(NestedPages.selectors.row).hide(),e.formatter.showQuickEdit(),t(n).find(".parent_name").html("<em>Parent:</em> "+t(a).attr("data-parentname")),t(n).find(".page_parent_id").val(t(a).attr("data-id")),t(n).show(),t(n).find(".np_title").focus(),t(n).find(NestedPages.selectors.newPageTitle).prop("tabindex","2")},e.cancelNewPage=function(){e.formatter.removeQuickEdit(),t(NestedPages.selectors.newChildError).hide(),t(NestedPages.selectors.newPageModal).find(".modal-body").empty(),t(NestedPages.selectors.sortable).find(".new-child").remove(),t(NestedPages.selectors.row).show()},e.addTitleField=function(e){var a=t(e).parents("form"),s=t(e).siblings(".new-page-titles").children("li").length+1,n='<li><i class="handle np-icon-menu"></i><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="'+s+'" /><a href="#" class="button-secondary np-remove-child">-</a></div></div></li>';t(e).siblings(".new-page-titles").append(n);t(a).find(".np_title").last().focus(),t(a).find(NestedPages.selectors.newPageTitle).prop("tabindex",s++),t(".new-page-titles").sortable({items:"li",handle:".handle"})},e.removeTitleField=function(e){t(e).parents(".new-child-row").parent("li").remove()},e.submitForm=function(a){e.toggleLoading(!0),e.form=t(a).parents("form");var s=!!t(a).hasClass("add-edit");t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:t(e.form).serialize()+"&action="+NestedPages.formActions.newPage+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(a){if("error"===a.status)return e.toggleLoading(!1),void t(e.form).find(NestedPages.selectors.quickEditErrorDiv).text(a.message).show();if(!0===s){var n=a.new_pages[0].edit_link;return n=n.replace(/&amp;/g,"&"),void window.location.replace(n)}e.toggleLoading(!1),e.posts=a.new_pages,e.addPosts()},error:function(a){console.log(a),e.toggleLoading(!1),t(e.form).find(NestedPages.selectors.quickEditErrorDiv).text("The form could not be saved at this time.").show()}})},e.addPosts=function(){var a=t(e.form).parent(".new-child").parent(".page-row");if(0===t(a).children("ol").length&&t(a).append('<ol class="nplist"></ol>'),t(e.form).hasClass("in-modal"))s=t(".nplist.sortable li.page-row:first");else var s=t(a).children("ol");for(i=0;i<e.posts.length;i++)e.appendRows(s,e.posts[i]);t(s).show(),e.formatter.updateSubMenuToggle(),e.formatter.setNestedMargins(),e.cancelNewPage(),t(NestedPages.selectors.newPageModal).modal("hide")},e.appendRows=function(e,a){var s='<li id="menuItem_'+a.id+'" class="page-row';"publish"===a.status&&(s+=" published"),s+='">',NestedPages.jsData.hierarchical?(s+='<div class="row">',s+='<div class="child-toggle"></div>'):(s+='<div class="row non-hierarchical">',s+='<div class="non-hierarchical-spacer"></div>'),s+='<div class="row-inner">',s+='<i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i>',s+='<a href="'+a.edit_link+'" class="page-link page-title">',s+='<span class="title">'+a.title+"</span>","Publish"!==a.status?s+='<span class="status">('+a.status+")</span>":s+='<span class="status"></span>',s+='<span class="nav-status">',"hide"===a.np_nav_status&&(s+=" "+nestedpages.hidden),s+="</span>",s+='<span class="edit-indicator"><i class="np-icon-pencil"></i>Edit</span>',s+="</a>",NestedPages.jsData.hierarchical||(s+='<div class="np-post-columns">',s+='<ul class="np-post-info">',s+='<li><span class="np-author-display">'+a.author_formatted+"</span></li>",s+="<li>"+a.date_formatted+"</li>",s+="</ul>",s+="</div>"),t(".nplist").first().hasClass("has-yoast")&&(s+='<span class="np-seo-indicator na"></span>'),s+='<div class="action-buttons">',s+='<a href="#" class="np-btn open-redirect-modal" data-parentid="'+a.id+'"><i class="np-icon-link"></i></a>',s+='<a href="#" class="np-btn add-new-child" data-id="'+a.id+'" data-parentname="'+a.title+'">'+nestedpages.add_child_short+"</a>",s+='<a href="#" class="np-btn np-quick-edit" data-id="'+a.id+'" data-template="'+a.page_template+'" data-title="'+a.title+'" data-slug="'+a.slug+'" data-commentstatus="closed" data-status="'+a.status.toLowerCase()+'" data-np-status="show"\tdata-navstatus="show" data-author="'+a.author+'" data-template="'+a.template+'" data-month="'+a.month+'" data-day="'+a.day+'" data-year="'+a.year+'" data-hour="'+a.hour+'" data-minute="'+a.minute+'" data-datepicker="'+a.datepicker+'" data-time="'+a.time+'" data-formattedtime="'+a.formattedtime+'" data-ampm="'+a.ampm+'">'+nestedpages.quick_edit+"</a>",s+='<a href="'+a.view_link+'" class="np-btn" target="_blank">'+nestedpages.view+"</a>",s+='<a href="'+a.delete_link+'" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>',s+="</div>\x3c!-- .action-buttons --\x3e",s+="</div>\x3c!-- .row-inner --\x3e</div>\x3c!-- .row --\x3e",s+="</li>",t(e).append(s)},e.toggleLoading=function(e){if(e)return t(NestedPages.selectors.quickEditErrorDiv).hide(),t(NestedPages.selectors.newPageSubmitButton).attr("disabled","disabled"),void t(NestedPages.selectors.quickEditLoadingIndicator).show();t(NestedPages.selectors.newPageSubmitButton).attr("disabled",!1),t(NestedPages.selectors.quickEditLoadingIndicator).hide()},e.bindEvents()},(NestedPages=NestedPages||{}).QuickEditPost=function(){var e=this,t=jQuery;return e.formatter=new NestedPages.Formatter,e.button="",e.initialData="",e.parent_li="",e.form="",e.flatTerms="",e.termNames="",e.saveButton="",e.newData="",e.row="",e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("click",NestedPages.selectors.quickEditOpen,function(a){a.preventDefault(),e.button=t(this),e.openForm()}),t(document).on("click",NestedPages.selectors.quickEditCancel,function(t){t.preventDefault(),e.formatter.removeQuickEdit()}),t(document).on("click",NestedPages.selectors.quickEditToggleTaxonomies,function(e){e.preventDefault(),t(this).parents("form").find(".np-taxonomies").toggle()}),t(document).on("click",NestedPages.selectors.quickEditToggleMenuOptions,function(e){e.preventDefault(),t(this).parents("form").find(".np-menuoptions").toggle()}),t(document).on("change",".keep_private",function(){this.checked?t(".post_password").val("").prop("readonly",!0):t(".post_password").prop("readonly",!1)}),t(document).on("click",NestedPages.selectors.quickEditSaveButton,function(a){a.preventDefault(),e.saveButton=t(this),e.save()}),t(document).on("keydown",function(t){27===t.keyCode&&e.formatter.removeQuickEdit()})},e.openForm=function(){e.setInitialData(),e.createForm(),e.populateForm(),e.populateFlatTaxonomies()},e.setInitialData=function(){e.initialData={id:t(e.button).attr("data-id"),title:t(e.button).attr("data-title"),slug:t(e.button).attr("data-slug"),author:t(e.button).attr("data-author"),cs:t(e.button).attr("data-commentstatus"),status:t(e.button).attr("data-status"),template:t(e.button).attr("data-template"),month:t(e.button).attr("data-month"),day:t(e.button).attr("data-day"),year:t(e.button).attr("data-year"),hour:t(e.button).attr("data-hour"),minute:t(e.button).attr("data-minute"),navstatus:t(e.button).attr("data-navstatus"),npstatus:t(e.button).attr("data-np-status"),navtitle:t(e.button).attr("data-navtitle"),navtitleattr:t(e.button).attr("data-navtitleattr"),navcss:t(e.button).attr("data-navcss"),linktarget:t(e.button).attr("data-linktarget"),password:t(e.button).attr("data-password"),datepicker:t(e.button).attr("data-datepicker"),time:t(e.button).attr("data-formattedtime"),timeTwentyFour:t(e.button).attr("data-time"),ampm:t(e.button).attr("data-ampm"),timeFormat:t(e.button).attr("data-timeformat"),sticky:t(e.button).attr("data-sticky")},e.initialData.h_taxonomies=[],e.initialData.f_taxonomies=[],e.parent_li=t(e.button).closest(NestedPages.selectors.row).parent("li");var a=t(e.parent_li).attr("class").split(/\s+/);for(i=0;i<a.length;i++)"in-"===a[i].substring(0,3)&&e.initialData.h_taxonomies.push(a[i]),"inf-"===a[i].substring(0,4)&&e.initialData.f_taxonomies.push(a[i])},e.createForm=function(){if(e.form=t(NestedPages.selectors.quickEditPostForm).clone(),t(e.parent_li).children("ol").length>0){var a=t(e.parent_li).children("ol");t(e.form).insertBefore(a)}else t(e.form).appendTo(e.parent_li);t(e.form).siblings(NestedPages.selectors.row).hide(),t(e.form).show()},e.populateForm=function(){if(t(e.form).find(".page_id").html("<em>ID:</em> "+e.initialData.id),t(e.form).find(".np_id").val(e.initialData.id),t(e.form).find(".np_title").val(e.initialData.title),t(e.form).find(".np_slug").val(e.initialData.slug),t(e.form).find(".np_author select").val(e.initialData.author),t(e.form).find(".np_status").val(e.initialData.status),t(e.form).find(".np_nav_title").val(e.initialData.navtitle),t(e.form).find(".np_title_attribute").val(e.initialData.navtitleattr),t(e.form).find(".np_nav_css_classes").val(e.initialData.navcss),t(e.form).find(".post_password").val(e.initialData.password),t(e.form).find(".np_datepicker").val(e.initialData.datepicker),"open"===e.initialData.cs&&t(e.form).find(".np_cs").attr("checked","checked"),""!==e.initialData.template?t(e.form).find(".np_template").val(e.initialData.template):t(e.form).find(".np_template").val("default"),"private"===e.initialData.status&&(t(e.form).find(".post_password").attr("readonly",!0),t(e.form).find(".keep_private").attr("checked",!0)),"hide"===e.initialData.npstatus?t(e.form).find(".nested_pages_status").attr("checked","checked"):t(e.form).find(".nested_pages_status").removeAttr("checked"),"hide"===e.initialData.navstatus?t(e.form).find(".np_nav_status").attr("checked","checked"):t(e.form).find(".np_nav_status").attr("checked",!1),"_blank"===e.initialData.linktarget?t(e.form).find(".link_target").attr("checked","checked"):t(e.form).find(".link_target").attr("checked",!1),"private"===e.initialData.status&&t(e.form).find(".np_status").val("publish"),"sticky"===e.initialData.sticky?t(e.form).find(".np-sticky").attr("checked","checked"):t(e.form).find(".np-sticky").removeAttr("checked"),"H:i"===e.initialData.timeFormat?t(e.form).find(".np_time").val(e.initialData.timeTwentyFour):(t(e.form).find(".np_time").val(e.initialData.time),t(e.form).find(".np_ampm").val(e.initialData.ampm),t(e.form).find('select[name="mm"]').val(e.initialData.month),t(e.form).find('input[name="jj"]').val(e.initialData.day),t(e.form).find('input[name="aa"]').val(e.initialData.year),t(e.form).find('input[name="hh"]').val(e.initialData.hour),t(e.form).find('input[name="mn"]').val(e.initialData.minute)),e.initialData.hasOwnProperty("h_taxonomies")){var a=e.initialData.h_taxonomies;for(i=0;i<a.length;i++){var s="#"+a[i];t(e.form).find(s).attr("checked","checked")}}t(e.form).find(".np_datepicker").datepicker({beforeShow:function(e,a){t("#ui-datepicker-div").addClass("nestedpages-datepicker")}}),e.formatter.showQuickEdit(),t(e.form).show()},e.populateFlatTaxonomies=function(){e.initialData.hasOwnProperty("f_taxonomies")&&(e.createTaxonomyObject(),e.getTermNames(),e.setWPSuggest())},e.createTaxonomyObject=function(){var t={};for(i=0;i<e.initialData.f_taxonomies.length;i++){var a=e.initialData.f_taxonomies[i],s=a.split("-"),n=s.indexOf("nps"),o=s.splice(n+1);o=o.join("-");var r=a.split("-").splice(0,n);r.shift("inf");var l=r.join("-");l in t||(t[l]=[]),t[l].push(o)}e.flatTerms=t},e.getTermNames=function(){t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.getTaxonomies,nonce:NestedPages.jsData.nonce,terms:e.flatTerms},success:function(t){e.termNames=t.terms,e.populateFlatTaxonomyFields()}})},e.populateFlatTaxonomyFields=function(){e.termNames&&t.each(e.termNames,function(e,a){var s=t("#"+e+"-quickedit");t(s).val(a.join(","))})},e.setWPSuggest=function(){var a=t(e.form).find("[data-autotag]");t.each(a,function(e,a){var s=t(this).attr("data-taxonomy");t(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+s,{multiple:!0,multipleSep:","})})},e.save=function(){e.toggleLoading(!0),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:t(e.form).find("form").serialize()+"&action="+NestedPages.formActions.quickEditPost+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(a){"error"===a.status?(e.toggleLoading(!1),t(e.form).find(NestedPages.selectors.quickEditErrorDiv).text(a.message).show()):(e.toggleLoading(!1),e.newData=a.post_data,e.updatePostRow())},error:function(e){console.log(e)}})},e.updatePostRow=function(){e.row=t(e.button).parents(".row-inner"),t(e.row).find(".title").text(e.newData.post_title),t(e.row).find(".np-view-button").attr("href",e.newData.permalink);var a=t(e.row).find(".status");if("publish"!==e.newData._status&&"future"!==e.newData._status?t(a).text("("+e.newData._status+")"):"private"===e.newData.keep_private?t(a).text("("+e.newData.keep_private+")"):t(a).text(""),""!==e.newData.post_password&&void 0!==e.newData.post_password){var s=t(a).text();s+=' <i class="np-icon-lock"></i>',t(a).html(s)}var n=t(e.row).find(".nav-status");"hide"==e.newData.nav_status?t(n).text("(Hidden)"):t(n).text("");var o=t(e.row).parent("li");"hide"==e.newData.np_status?(t(o).addClass("np-hide"),t(e.row).find(".status").after('<i class="np-icon-eye-blocked"></i>')):(t(o).removeClass("np-hide"),t(e.row).find(".np-icon-eye-blocked").remove());var i=t(e.row).find(".sticky");"sticky"==e.newData.sticky?t(i).show():t(i).hide(),NestedPages.jsData.hierarchical||t(e.row).find(".np-author-display").text(e.newData.author_name);var r=t(e.row).find(NestedPages.selectors.quickEditOpen);t(r).attr("data-id",e.newData.post_id),t(r).attr("data-template",e.newData.page_template),t(r).attr("data-title",e.newData.post_title),t(r).attr("data-slug",e.newData.post_name),t(r).attr("data-commentstatus",e.newData.comment_status),t(r).attr("data-status",e.newData._status),t(r).attr("data-sticky",e.newData.sticky),"private"===e.newData.keep_private&&t(r).attr("data-status","private"),t(r).attr("data-author",e.newData.post_author),t(r).attr("data-np-status",e.newData.np_status),t(r).attr("data-password",e.newData.post_password),t(r).attr("data-navstatus",e.newData.nav_status),t(r).attr("data-navtitle",e.newData.np_nav_title),t(r).attr("data-linktarget",e.newData.link_target),t(r).attr("data-navtitleattr",e.newData.np_title_attribute),t(r).attr("data-navcss",e.newData.np_nav_css_classes),t(r).attr("data-month",e.newData.mm),t(r).attr("data-day",e.newData.jj),t(r).attr("data-year",e.newData.aa),t(r).attr("data-hour",e.newData.hh),t(r).attr("data-minute",e.newData.mn),t(r).attr("data-datepicker",e.newData.np_date),t(r).attr("data-time",e.newData.np_time),t(r).attr("data-formattedtime",e.newData.np_time),t(r).attr("data-ampm",e.newData.np_ampm),e.removeTaxonomyClasses(),e.addCategoryClasses(),e.addHierarchicalClasses(),e.addFlatClasses(),e.addStatusClass(),e.formatter.removeQuickEdit(),e.formatter.flashRow(e.row)},e.addStatusClass=function(){var a=["published","draft","pending","future"];for(i=0;i<a.length;i++)t(e.row).removeClass(a[i]);t(e.row).addClass(e.newData._status)},e.removeTaxonomyClasses=function(){taxonomies=[];var a=t(e.row).attr("class").split(/\s+/);for(i=0;i<a.length;i++)"in-"===a[i].substring(0,3)&&t(e.row).removeClass(a[i]),"inf-"===a[i].substring(0,4)&&t(e.row).removeClass(a[i])},e.addCategoryClasses=function(){if(e.newData.hasOwnProperty("post_category")){var a=e.newData.post_category;for(i=0;i<a.length;i++){var s="in-category-"+a[i];t(e.row).addClass(s)}}},e.addHierarchicalClasses=function(){if(e.newData.hasOwnProperty("tax_input")){var a=e.newData.tax_input;t.each(a,function(a,s){for(i=0;i<s.length;i++){var n="in-"+a+"-"+s[i];t(e.row).addClass(n)}})}},e.addFlatClasses=function(){if(e.newData.hasOwnProperty("flat_tax")){var a=e.newData.flat_tax;t.each(a,function(a,s){for(i=0;i<s.length;i++){var n="inf-"+a+"-nps-"+s[i];t(e.row).addClass(n)}})}},e.toggleLoading=function(a){if(a)return t(NestedPages.selectors.quickEditErrorDiv).hide(),t(e.saveButton).attr("disabled","disabled"),void t(NestedPages.selectors.quickEditLoadingIndicator).show();t(e.saveButton).attr("disabled",!1),t(NestedPages.selectors.quickEditLoadingIndicator).hide()},e.init()},(NestedPages=NestedPages||{}).QuickEditLink=function(){var e=this,t=jQuery;return e.formatter=new NestedPages.Formatter,e.button="",e.postData="",e.newPostData="",e.form="",e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("click",NestedPages.selectors.quickEditButtonLink,function(a){a.preventDefault(),e.formatter.removeQuickEdit(),e.button=t(this),e.openQuickEdit()}),t(document).on("click",NestedPages.selectors.quickEditLinkSaveButton,function(t){t.preventDefault(),e.submitForm()}),t(document).on("keydown",function(t){27===t.keyCode&&e.formatter.removeQuickEdit()})},e.openQuickEdit=function(){e.setData(),e.createForm(),e.populateForm()},e.setData=function(){e.postData={id:t(e.button).attr("data-id"),url:t(e.button).attr("data-url"),title:t(e.button).attr("data-title"),status:t(e.button).attr("data-status"),navstatus:t(e.button).attr("data-navstatus"),npstatus:t(e.button).attr("data-np-status"),linktarget:t(e.button).attr("data-linktarget"),parentid:t(e.button).attr("data-parentid"),navtitleattr:t(e.button).attr("data-navtitleattr"),navcss:t(e.button).attr("data-navcss"),navtype:t(e.button).attr("data-nav-type"),navobject:t(e.button).attr("data-nav-object"),navobjectid:t(e.button).attr("data-nav-object-id"),navoriginallink:t(e.button).attr("data-nav-original-link"),navoriginaltitle:t(e.button).attr("data-nav-original-title")}},e.createForm=function(){var a=t(e.button).closest(NestedPages.selectors.row).parent("li");if(e.form=t(NestedPages.selectors.quickEditLinkForm).clone(),t(a).children("ol").length>0){var s=t(a).children("ol");t(e.form).insertBefore(s)}else t(e.form).appendTo(a);t(e.form).siblings(NestedPages.selectors.row).hide()},e.populateForm=function(){if(t(e.form).find(".np_id").val(e.postData.id),t(e.form).find(".np_title").val(e.postData.title),t(e.form).find(".np_author select").val(e.postData.author),t(e.form).find(".np_status").val(e.postData.status),t(e.form).find(".np_content").val(e.postData.url),t(e.form).find(".np_parent_id").val(e.postData.parentid),t(e.form).find(".np_title_attribute").val(e.postData.navtitleattr),t(e.form).find(".np_nav_css_classes").val(e.postData.navcss),"hide"===e.postData.npstatus?t(e.form).find(".np_status").prop("checked","checked"):t(e.form).find(".np_status").removeAttr("checked"),"hide"===e.postData.navstatus?t(e.form).find(".np_nav_status").prop("checked","checked"):t(e.form).find(".np_nav_status").removeAttr("checked"),"_blank"===e.postData.linktarget?t(e.form).find(".link_target").prop("checked","checked"):t(e.form).find(".link_target").removeAttr("checked"),"custom"!==e.postData.navobject&&""!==e.postData.navobject){var a='<div class="form-control original-link">Original: <a href="'+e.postData.navoriginallink+'" target="_blank">'+e.postData.navoriginaltitle+"</a></div>";t(e.form).find("[data-url-field]").remove(),t(a).insertAfter(t(e.form).find("h3")),t(e.form).find("[data-np-menu-object-input]").val(e.postData.navobject),t(e.form).find("[data-np-menu-objectid-input]").val(e.postData.navobjectid),t(e.form).find("[data-np-menu-type-input]").val(e.postData.navtype),t(e.form).find("h3").text("Link: "+e.postData.navoriginaltitle)}else t(e.form).find("h3").text("Link"),t(e.form).find("[data-np-menu-object-input]").val("custom"),t(e.form).find("[data-np-menu-type-input]").val("custom");e.formatter.showQuickEdit(),t(e.form).show()},e.submitForm=function(){e.toggleLoading(!0),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:t(e.form).find("form").serialize()+"&action="+NestedPages.formActions.quickEditLink+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(a){"error"===a.status?(e.toggleLoading(!1),t(e.form).find(NestedPages.selectors.quickEditErrorDiv).text(a.message).show()):(e.toggleLoading(!1),e.newPostData=a.post_data,e.updateRow())},error:function(a){e.toggleLoading(!1),t(e.form).find(NestedPages.selectors.quickEditErrorDiv).text("The form could not be saved at this time.").show()}})},e.updateRow=function(){console.log(e.newPostData);var a=t(e.form).siblings(".row");t(a).find(".title").html(e.newPostData.post_title+' <i class="np-icon-link"></i>');var s=t(a).find(".status");"publish"!==e.newPostData._status&&"future"!==e.newPostData._status?t(s).text("("+e.newPostData._status+")"):t(s).text("");var n=t(a).find(".nav-status");"hide"==e.newPostData.nav_status?t(n).text("("+NestedPages.jsData.hiddenText+")"):t(n).text("");var o=t(a).parent("li");"hide"==e.newPostData.np_status?(t(o).addClass("np-hide"),t(a).find(".status").after('<i class="np-icon-eye-blocked"></i>')):(t(o).removeClass("np-hide"),t(a).find(".np-icon-eye-blocked").remove());var i=t(a).find(NestedPages.selectors.quickEditButtonLink);t(i).attr("data-id",e.newPostData.post_id),t(i).attr("data-title",e.newPostData.post_title),t(i).attr("data-url",e.newPostData.post_content),t(i).attr("data-status",e.newPostData._status),t(i).attr("data-navstatus",e.newPostData.nav_status),t(i).attr("data-np-status",e.newPostData.np_status),t(i).attr("data-linkTarget",e.newPostData.linkTarget),t(i).attr("data-navtitleattr",e.newPostData.titleAttribute),t(i).attr("data-navcss",e.newPostData.cssClasses),e.formatter.removeQuickEdit(),e.formatter.flashRow(a)},e.toggleLoading=function(e){if(t(".row").removeClass("np-updated").removeClass("np-updated-show"),e)return t(NestedPages.selectors.quickEditErrorDiv).hide(),t(NestedPages.selectors.quickEditLinkSaveButton).attr("disabled","disabled"),void t(NestedPages.selectors.quickEditLoadingIndicator).show();t(NestedPages.selectors.quickEditLinkSaveButton).attr("disabled",!1),t(NestedPages.selectors.quickEditLoadingIndicator).hide()},e.init()},(NestedPages=NestedPages||{}).Clone=function(){var e=this,t=jQuery;return e.parent_id="",e.parent_title="",e.parentLi=null,e.formatter=new NestedPages.Formatter,e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("click",NestedPages.selectors.cloneButton,function(a){a.preventDefault(),e.parent_id=t(this).attr("data-id"),e.parent_title=t(this).attr("data-parentname"),e.parentLi=t(this).parent(".row").parent(".page-row").parent(".npList"),e.openModal()}),t(document).on("click",NestedPages.selectors.confirmClone,function(t){t.preventDefault(),e.clone()})},e.openModal=function(){t(NestedPages.selectors.cloneModal).find("[data-clone-parent]").text(e.parent_title),t(NestedPages.selectors.cloneModal).modal("show")},e.clone=function(){e.toggleLoading(!0),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",data:{action:NestedPages.formActions.clonePost,parent_id:e.parent_id,quantity:t(NestedPages.selectors.cloneQuantity).val(),status:t(NestedPages.selectors.cloneStatus).val(),author:t(NestedPages.selectors.cloneAuthor).find("select").val(),nonce:NestedPages.jsData.nonce,posttype:NestedPages.jsData.posttype},success:function(a){e.toggleLoading(!1),t(NestedPages.selectors.cloneModal).modal("hide"),location.reload()}})},e.toggleLoading=function(e){if(e)return t(NestedPages.selectors.cloneModal).find("[data-clone-loading]").show(),void t(NestedPages.selectors.confirmClone).attr("disabled","disabled");t(NestedPages.selectors.cloneModal).find("[data-clone-loading]").hide(),t(NestedPages.selectors.confirmClone).attr("disabled",!1)},e.init()},(NestedPages=NestedPages||{}).Tabs=function(){var e=this,t=jQuery;return e.activeContent="",e.activeButton="",e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("click",NestedPages.selectors.tabButton,function(a){a.preventDefault(),e.activeButton=t(this),e.toggleTabs()})},e.toggleTabs=function(){e.activeContent=t(e.activeButton).attr("href"),t(NestedPages.selectors.tabContent).hide(),t(e.activeContent).show(),t(e.activeButton).parents(NestedPages.selectors.tabButtonParent).find(NestedPages.selectors.tabButton).removeClass("active"),t(e.activeButton).addClass("active")},e.init()},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]",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",quickEditToggleTaxonomies:".np-toggle-taxonomies",quickEditToggleMenuOptions:".np-toggle-menuoptions",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",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={iconToggleDown:"np-icon-arrow-down",iconToggleRight:"np-icon-arrow-right",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",quickEditLink:"npquickEditLink",getTaxonomies:"npgetTaxonomies",quickEditPost:"npquickEdit",clonePost:"npclonePost",search:"npmenuSearch",newMenuItem:"npnewMenuItem",manualMenuSync:"npmanualMenuSync",postSearch:"nppostSearch",wpmlTranslations:"npWpmlTranslations",resetSettings:"npresetSettings"},NestedPages.Factory=function(){var e=this,t=jQuery;return e.formatter=new NestedPages.Formatter,e.responsive=new NestedPages.Responsive,e.checkAll=new NestedPages.CheckAll,e.bulkActions=new NestedPages.BulkActions,e.menuToggle=new NestedPages.MenuToggle,e.pageToggle=new NestedPages.PageToggle,e.nesting=new NestedPages.Nesting,e.syncMenuSetting=new NestedPages.SyncMenuSetting,e.newPage=new NestedPages.NewPost,e.quickEditLink=new NestedPages.QuickEditLink,e.quickEditPost=new NestedPages.QuickEditPost,e.clone=new NestedPages.Clone,e.tabs=new NestedPages.Tabs,e.menuLinks=new NestedPages.MenuLinks,e.hiddenItemCount=new NestedPages.HiddenItemCount,e.confirmDelete=new NestedPages.ConfirmDelete,e.manualSync=new NestedPages.ManualSync,e.postSearch=new NestedPages.PostSearch,e.wpml=new NestedPages.Wpml,e.init=function(){nestedpages.settings_page||(e.bindEvents(),e.setPostType(),e.setMenuSync(),e.setNestable(),e.setSortable(),e.formatter.updateSubMenuToggle(),e.formatter.setBorders(),e.formatter.setNestedMargins(),e.nesting.initializeSortable())},e.bindEvents=function(){t(document).on("click",NestedPages.selectors.quickEditOverlay,function(t){e.formatter.removeQuickEdit(),e.newPage.cancelNewPage()}),t(document).ready(function(){e.formatter.hideAjaxError(),e.formatter.sizeLinkThumbnails()})},e.setNestable=function(){var e=!1;t.each(NestedPages.jsData.allPostTypes,function(t,a){a.name===NestedPages.jsData.posttype&&(!0===a.hierarchical&&(e=!0),!0===a.disable_nesting&&(e=!1))}),NestedPages.jsData.nestable=e},e.setSortable=function(){var e=!0;t.each(NestedPages.jsData.allPostTypes,function(t,a){a.name===NestedPages.jsData.posttype&&void 0!==a.disable_sorting&&""!==a.disable_sorting&&"true"===a.disable_sorting&&(e=!1)}),NestedPages.jsData.sortable=e},e.setPostType=function(){NestedPages.jsData.posttype=nestedpages.current_post_type,void 0!==NestedPages.jsData.posttype&&""!==NestedPages.jsData.posttype||(NestedPages.jsData.posttype=t(NestedPages.selectors.sortable).attr("id").substring(3)),NestedPages.jsData.hierarchical=NestedPages.jsData.allPostTypes[NestedPages.jsData.posttype].hierarchical},e.setMenuSync=function(){NestedPages.jsData.syncmenu="1"===nestedpages.syncmenu?"sync":"nosync"},e.init()},(NestedPages=NestedPages||{}).MenuLinks=function(){var e=this,t=jQuery;return e.typeButton="",e.post="",e.formatter=new NestedPages.Formatter,e.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]"},e.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]"},e.search=new NestedPages.MenuSearch,e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("click",NestedPages.selectors.openLinkModal,function(a){a.preventDefault(),e.postParent=t(this).attr("data-parentid"),t(e.selectors.form).find(".parent_id").val(t(this).attr("data-parentid")),e.openModal()}),t(document).on("click",e.selectors.accordionItem,function(a){a.preventDefault(),e.accordion(t(this))}),t(document).on("click",e.selectors.typeSelect,function(a){a.preventDefault(),e.typeButton=t(this),e.setLinkType()}),t(document).on("keyup",e.fields.navigationLabel,function(){e.updateTitle()}),t(document).on("click",e.selectors.saveButton,function(t){t.preventDefault(),e.submitForm()}),t(document).on("keydown",function(e){27===e.keyCode&&t("#np-link-modal").modal("hide")})},e.openModal=function(){t(NestedPages.selectors.linkErrorDiv).hide(),t(NestedPages.selectors.linkModal).find("input").val(""),t(NestedPages.selectors.linkModal).find(".parent_id").val(e.postParent),e.clearForm(),t(e.selectors.accordion).find("ul").hide(),t(e.selectors.typeSelect).removeClass("active"),t(NestedPages.selectors.linkModal).modal("show")},e.accordion=function(a){e.clearForm();var s=t(a).siblings("ul");if(t(s).is(":visible"))return t(a).removeClass("active"),void t(s).slideUp("fast");t(e.selectors.accordionItem).removeClass("active"),t(a).addClass("active"),t(a).parents(e.selectors.accordion).find("ul").slideUp("fast"),t(s).slideDown("fast")},e.setLinkType=function(){t(e.typeButton).hasClass("active")?e.clearForm():(t(e.typeButton).hasClass("np-custom-link")&&(t(e.selectors.accordionItem).removeClass("active"),t(e.selectors.accordion).find("ul").slideUp("fast")),t(e.selectors.formPlaceholder).hide(),e.populateForm())},e.populateForm=function(){t(e.selectors.saveButton).show(),t(e.selectors.typeSelect).removeClass("active"),t(e.typeButton).addClass("active"),t(e.fields.menuTitle).text(t(e.typeButton).text()).val(t(e.typeButton).text()),t(e.selectors.form).find("h3").find("em").text(t(e.typeButton).attr("data-np-object-name")),""!==t(e.typeButton).attr("data-np-permalink")?(t(e.selectors.form).find(e.selectors.urlInputCont).hide(),t(e.selectors.form).find(e.selectors.originalLink).html('<a href="'+t(e.typeButton).attr("data-np-permalink")+'">'+t(e.typeButton).text()+"</a>"),t(e.selectors.form).find(e.selectors.originalLink).parent(".original-link").show()):(t(e.selectors.form).find(e.selectors.urlInputCont).show(),t(e.selectors.form).find(e.selectors.originalLink).parent(".original-link").hide()),t(e.fields.object).val(t(e.typeButton).attr("data-np-menu-object")),t(e.fields.objectid).val(t(e.typeButton).attr("data-np-menu-objectid")),t(e.fields.itemType).val(t(e.typeButton).attr("data-np-menu-type")),t(e.selectors.formDetails).show()},e.clearForm=function(){t(e.selectors.form).find(e.selectors.errorDiv).hide(),t(e.selectors.saveButton).hide(),t(e.selectors.formDetails).hide(),t(e.selectors.formPlaceholder).show(),t(e.selectors.form).find("input").not(".parent_id").val(""),t(e.selectors.form).find(e.fields.linkTarget).val("_blank"),t(e.selectors.form).find('input[type="checkbox"]').attr("checked",!1),t(e.selectors.typeSelect).removeClass("active"),e.search.toggleLoading(!1),t(e.selectors.searchResults).remove(),t(e.selectors.defaultResults).show()},e.updateTitle=function(){var a=t(e.fields.navigationLabel).val(),s=t(e.selectors.form).find("h3").find("span");""!==a?(t(e.fields.menuTitle).val(a),t(s).text(a)):(t(e.fields.menuTitle).val(t(e.typeButton).text()),t(s).text(t(e.typeButton).text()))},e.submitForm=function(){e.toggleLoading(!0),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",data:t(e.selectors.form).serialize()+"&action="+NestedPages.formActions.newMenuItem+"&nonce="+NestedPages.jsData.nonce+"&post_type="+NestedPages.jsData.posttype+"&syncmenu="+NestedPages.jsData.syncmenu,success:function(a){e.toggleLoading(!1),"error"!==a.status?(e.post=a.post_data,e.createRow()):t(e.selectors.form).find(e.selectors.errorDiv).text(a.message).show()},error:function(e){console.log(e)}})},e.createRow=function(){var a='<li id="menuItem_'+e.post.id+'" class="page-row published';a+='">',a+='<div class="row"><div class="child-toggle"><div class="child-toggle-spacer"></div></div><div class="row-inner"><i class="np-icon-sub-menu"></i><i class="handle np-icon-menu"></i><a href="'+e.post.np_link_content+'" class="page-link page-title" target="_blank"><span class="title">'+e.post.menuTitle+' <i class="np-icon-link"></i></span>',a+='</a><a href="#" class="np-toggle-edit"><i class="np-icon-pencil"></i></a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ',a+='data-id="'+e.post.id+'"',a+='data-parentid="'+e.post.parent_id+'"',a+='data-title="'+e.post.menuTitle+'" ',a+='data-url="'+e.post.url+'" ',a+='data-status="publish" ',a+='data-np-status="show" ',a+='data-navstatus="show" ',a+='data-navcss="'+e.post.cssClasses+'" ',a+='data-navtitleattr="'+e.post.titleAttribute+'" ',a+='data-nav-type="'+e.post.menuType+'" ',a+='data-nav-object="'+e.post.objectType+'" ',a+='data-nav-object-id="'+e.post.objectId+'" ',a+='data-nav-original-link="'+e.post.original_link+'" ',a+='data-nav-original-title="'+e.post.original_title+'" ',a+='data-linktarget="'+e.post.link_target+'">',a+=NestedPages.jsData.quickEditText,a+="</a>",a+='<a href="'+e.post.delete_link+'" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>',a+="</div></div></div></li>","0"===e.post.parent_id?t(".nplist:first li:first").after(a):e.appendChildRow(a),t(NestedPages.selectors.linkModal).modal("hide"),e.row=t("#menuItem_"+e.post.id).find(".row"),e.formatter.flashRow(e.row)},e.appendChildRow=function(a){var s=t("#menuItem_"+e.post.parent_id);0===t(s).children("ol").length?(a='<ol class="sortable nplist" style="display:block;">'+a+"</ol>",t(s).append(a)):t(s).find("ol:first").prepend(a),e.formatter.updateSubMenuToggle()},e.toggleLoading=function(a){if(a)return t(e.selectors.form).find(e.selectors.errorDiv).hide(),t(e.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).show(),void t(e.selectors.saveButton).attr("disabled","disabled");t(e.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).hide(),t(e.selectors.saveButton).attr("disabled",!1)},e.init()},(NestedPages=NestedPages||{}).MenuSearch=function(){var e=this,t=jQuery;return e.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]"},e.activeForm="",e.results="",e.defaultResults="",e.searchType="",e.searchObject="",e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("keyup",e.selectors.searchForms,function(){e.activeForm=t(this),t(e.selectors.searchResults).remove(),e.performSearch()})},e.performSearch=function(){if(e.defaultResults=t(e.activeForm).parent("li").siblings(e.selectors.defaultResults),t(e.activeForm).val().length>2)return t(e.defaultResults).hide(),e.toggleLoading(!0),void e.query();e.toggleLoading(!1),t(e.defaultResults).show()},e.query=function(){e.searchType=t(e.activeForm).attr(e.selectors.searchType),e.searchObject=t(e.activeForm).attr(e.selectors.searchObject),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.search,nonce:NestedPages.jsData.nonce,term:t(e.activeForm).val(),searchType:e.searchType,searchObject:e.searchObject},success:function(a){console.log(a),a.results?(e.results=a.results,e.toggleLoading(!1),"post_type"===e.searchType?e.appendPosts():e.appendTaxonomies()):(e.toggleLoading(!1),t(e.activeForm).siblings(e.selectors.noResults).show())}})},e.appendPosts=function(){var a="";t.each(e.results,function(t,s){a+='<li data-np-search-result><a href="#" data-np-menu-object="'+e.searchObject+'" data-np-menu-type="post_type" data-np-menu-objectid="'+s.ID+'" data-np-permalink="'+s.permalink+'" data-np-object-name="'+s.singular_name+'" data-np-menu-selection>'+s.post_title+"</a></li>"}),t(a).insertAfter(t(e.activeForm).parent("li")),e.toggleLoading(!1)},e.appendTaxonomies=function(){var a="";t.each(e.results,function(t,s){a+='<li data-np-search-result><a href="#" data-np-menu-object="'+e.searchObject+'" data-np-menu-type="post_type" data-np-menu-objectid="'+s.term_id+'" data-np-permalink="'+s.permalink+'" data-np-object-name="'+s.taxonomy+'" data-np-menu-selection>'+s.name+"</a></li>"}),t(a).insertAfter(t(e.activeForm).parent("li")),e.toggleLoading(!1)},e.toggleLoading=function(a){var s=t(e.activeForm).siblings(e.selectors.loadingIndicator);t(e.selectors.noResults).hide(),a?t(s).show():t(s).hide()},e.init()},jQuery(document).ready(function(){new NestedPagesTrash});var NestedPagesTrash=function(){var e=this,t=jQuery;return e.trashButton=".np-empty-trash",e.confirmButton=".np-trash-confirm",e.warningModal="#np-trash-modal",e.errorAlert="#np-error",e.loadingIndicator="#nested-loading",e.trashLinks=".np-trash-links",e.postType=t("#np-trash-posttype").val(),e.nonce=nestedpages.np_nonce,e.formAction="npEmptyTrash",e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("click",e.trashButton,function(a){a.preventDefault(),t(e.warningModal).modal("show")}),t(document).on("click",e.confirmButton,function(t){t.preventDefault(),e.confirmEmpty()})},e.confirmEmpty=function(){e.loading(!0),t(e.warningModal).hide(),t(e.errorAlert).hide(),e.emptyTrash()},e.emptyTrash=function(){t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:e.formAction,nonce:e.nonce,posttype:e.postType},success:function(a){e.loading(!1),"error"===a.status?t(e.errorAlert).text(a.message).show():(t(e.trashLinks).hide(),t(".notice-dismiss").click())}})},e.loading=function(a){a?t(e.loadingIndicator).show():t(e.loadingIndicator).hide()},e.init()};(NestedPages=NestedPages||{}).ConfirmDelete=function(){var e=this,t=jQuery;return e.deleteLink="",e.bindEvents=function(){t(document).on("click",NestedPages.selectors.linkDeleteButton,function(a){a.preventDefault(),e.confirmSingle(t(this))}),t(document).on("click",NestedPages.selectors.linkDeleteConfirmationButton,function(a){a.preventDefault(),t(this).hasClass("bulk")?e.deleteMultiple():e.deleteSingle()}),t(document).on("submit",NestedPages.selectors.bulkActionsForm,function(t){e.confirmMultiple(t)})},e.confirmSingle=function(a){e.deleteLink=t(a).attr("href"),t(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation_singular),t(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.delete).removeClass("bulk"),t(NestedPages.selectors.linkDeleteConfirmationModal).modal("show")},e.confirmMultiple=function(e){"trash"===t('select[name="np_bulk_action"]').val()&&""!==t(NestedPages.selectors.bulkActionRedirectIds).val()&&(e.preventDefault(),t(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation),t(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.trash_delete_links).addClass("bulk"),t(NestedPages.selectors.linkDeleteConfirmationModal).modal("show"))},e.deleteMultiple=function(){t(NestedPages.selectors.bulkActionsForm)[0].submit()},e.deleteSingle=function(){window.location.replace(e.deleteLink)},e.bindEvents()},(NestedPages=NestedPages||{}).ManualSync=function(){var e=this,t=jQuery;return e.activeBtn="",e.bindEvents=function(){t(document).on("click",NestedPages.selectors.manualMenuSync,function(a){a.preventDefault(),e.activeBtn=t(this),e.syncMenu()}),t(document).on("click",NestedPages.selectors.manualOrderSync,function(a){a.preventDefault(),e.activeBtn=t(this),e.syncOrder()})},e.syncMenu=function(){e.loading(!0),t.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(a){"error"===a.status?(t(NestedPages.selectors.errorDiv).text(a.message).show(),t(NestedPages.selectors.loadingIndicator).hide()):e.loading(!1)}})},e.syncOrder=function(){e.loading(!0),(new NestedPages.Nesting).syncNesting(!0,e.loading(!1))},e.loading=function(a){if(a)return t(e.activeBtn).addClass("disabled"),void t(NestedPages.selectors.loadingIndicator).show();t(e.activeBtn).removeClass("disabled"),t(NestedPages.selectors.loadingIndicator).hide()},e.bindEvents()},(NestedPages=NestedPages||{}).PostSearch=function(){var e=this,t=jQuery;return e.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"},e.changed=!1,e.activeInput="",e.results="",e.defaultResults="",e.postType="",e.activeForm="",e.bindEvents=function(){t("["+e.selectors.input+"]").on("input",function(){if(e.activeInput=t(this),e.setOptions(),e.changed||e.setDefaultResults(),""===t(this).val())return t(e.activeForm).find("["+e.selectors.noResults+"]").hide(),void e.showDefaultResults();e.query()})},e.setDefaultResults=function(){e.defaultResults=t(e.activeForm).find("["+e.selectors.results+"]").html(),e.changed=!0},e.showDefaultResults=function(){t(e.activeForm).find("["+e.selectors.results+"]").html(e.defaultResults)},e.setOptions=function(){e.postType=t(e.activeInput).attr(e.selectors.input),e.activeForm=t(e.activeInput).parents("["+e.selectors.form+"]")},e.performSearch=function(){if(e.defaultResults=t(e.activeForm).parent("li").siblings(e.selectors.defaultResults),t(e.activeForm).val().length>2)return t(e.defaultResults).hide(),e.toggleLoading(!0),void e.query();e.toggleLoading(!1),t(e.defaultResults).show()},e.query=function(){t(e.activeForm).find("["+e.selectors.results+"]").empty(),e.toggleLoading(!0),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.postSearch,nonce:NestedPages.jsData.nonce,term:t(e.activeInput).val(),postType:e.postType},success:function(a){a.results?(e.results=a.results,e.loadResults(),e.toggleLoading(!1)):(e.toggleLoading(!1),t(e.activeForm).find("["+e.selectors.noResults+"]").show())}})},e.loadResults=function(){var a="<ul>";t.each(e.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>",t(e.activeForm).find("["+e.selectors.results+"]").html(a),e.toggleLoading(!1)},e.toggleLoading=function(a){var s=t(e.activeForm).find("["+e.selectors.loadingIndicator+"]"),n=t(e.activeForm).find("["+e.selectors.noResults+"]");t(n).hide(),a?t(s).show():t(s).hide()},e.bindEvents()},(NestedPages=NestedPages||{}).Wpml=function(){var e=this,t=jQuery;return e.button=null,e.postData=null,e.modal=null,e.parent_li=null,e.formatter=new NestedPages.Formatter,e.selectors={translationsBtn:"data-nestedpages-translations",modal:"data-np-wpml-translations-modal",title:"data-wmpl-translation-title",table:"data-np-wpml-translations-modal-table"},e.bindEvents=function(){nestedpages.wpml&&t(document).on("click","["+e.selectors.translationsBtn+"]",function(a){a.preventDefault(),e.createTranslationsModal(t(this))})},e.createTranslationsModal=function(a){if(e.parent_li=t(a).closest(NestedPages.selectors.row).parent("li"),e.button=t(a).siblings(NestedPages.selectors.quickEditOpen),e.postData={id:t(e.button).attr("data-id"),title:t(e.button).attr("data-title"),slug:t(e.button).attr("data-slug")},e.modal=t("["+e.selectors.modal+"]").clone(),t(e.parent_li).children("ol").length>0){var s=t(e.parent_li).children("ol");t(e.modal).insertBefore(s)}else t(e.modal).appendTo(e.parent_li);t(e.modal).find("["+e.selectors.title+"]").text(e.postData.title),e.formatter.showQuickEdit(),t(e.modal).show(),e.getTranslationData()},e.getTranslationData=function(){t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.wpmlTranslations,post_id:e.postData.id,nonce:NestedPages.jsData.nonce},success:function(a){"success"===a.status?e.populateModal(a.translations):(t(e.modal).find(NestedPages.selectors.quickEditErrorDiv).text(a.message).show(),e.toggleLoading(!1))}})},e.populateModal=function(a){var s="<tbody>";t.each(a,function(e,t){var n=a[e];s+="<tr>",s+='<td><img src="'+n.country_flag_url+'" alt="'+n.translated_name+'" /> '+n.translated_name+"</td>",s+="<td>",n.has_translation&&n.edit_link?s+='<a href="'+n.edit_link+'">'+n.translation.post_title+" ("+nestedpages.edit+")</a>":s+='<a href="'+n.add_link+'" class="np-btn">+ '+nestedpages.add_translation+"</a>",s+="</td>",s+="</tr>"}),s+="</tbody>",t(e.modal).find("["+e.selectors.table+"]").html(s),e.toggleLoading(!1)},e.toggleLoading=function(a){a?t(e.modal).addClass("loading"):t(e.modal).removeClass("loading")},e.bindEvents()};
1
+ NestedPages=NestedPages||{};NestedPages.Formatter=function(){var e=this,t=jQuery;e.updateSubMenuToggle=function(){for(var e=t(NestedPages.selectors.childToggle),a=0;a<e.length;a++){var s=e[a],n=t(s).parent(".row").parent("li");if(t(n).children("ol").length>0){var o='<div class="child-toggle-spacer"></div>';o+='<a href="#"',t(n).children("ol:visible").length>0&&(o+=' class="open"'),o+='><span class="np-icon-arrow"></span></a>',t(s).html(o),t(n).children("ol").children(".np-hide").length>0&&0===t(n).children("ol").children(".np-hide.shown").length?t(s).find("a").hide():t(n).children("ol").children(".np-hide").length>0&&t(n).children("ol").children(".np-hide.shown").length>0&&t(s).find("a").show()}else t(s).empty().html('<div class="child-toggle-spacer"></div>')}},e.setBorders=function(){t(NestedPages.selectors.rows).removeClass(NestedPages.cssClasses.noborder),t.each(t(NestedPages.selectors.lists),function(){t(this).find(".page-row:visible:first").addClass(NestedPages.cssClasses.noborder)})},e.setNestedMargins=function(){t.each(t(NestedPages.selectors.lists),function(e,a){var s=t(this).parents(NestedPages.selectors.lists).length,n=0;if(NestedPages.jsData.sortable||(n=10),s>0){n=20*s+n;t(this).find(".row-inner").css("padding-left",n+"px")}else NestedPages.jsData.sortable?t(this).find(".row-inner").css("padding-left","0px"):t(this).find(".row-inner").css("padding-left","10px")})},e.updatePlaceholderWidth=function(a){if(NestedPages.jsData.nestable){var s=40*t(a.placeholder).parents("ol").length-40,n=t(NestedPages.selectors.sortable).width()-s;t(a.placeholder).width(n).css("margin-left",s+"px")}e.updateListVisibility(a)},e.updateListVisibility=function(e){var a=t(e.placeholder).parent("ol");t(a).is(":visible")||(t(a).addClass("nplist"),t(a).show())},e.removeQuickEdit=function(){t(NestedPages.selectors.quickEditOverlay).removeClass("active").remove(),t(".sortable .quick-edit").remove(),t(".row").show()},e.showQuickEdit=function(){t("body").append('<div class="np-inline-overlay"></div>'),setTimeout(function(){t(".np-inline-overlay").addClass("active")},50)},e.flashRow=function(a){t(a).addClass("np-updated"),e.setBorders(),setTimeout(function(){t(a).addClass("np-updated-show")},1500)},e.showAjaxError=function(e){t(NestedPages.selectors.ajaxError).find("p").text(e),t(NestedPages.selectors.ajaxError).show()},e.hideAjaxError=function(e){t(NestedPages.selectors.ajaxError).hide()},e.sizeLinkThumbnails=function(){var e=t(NestedPages.selectors.thumbnailContainer).not(NestedPages.selectors.thumbnailContainerLink).first().find("img"),a=t(e).width(),s=t(e).height();t.each(t(NestedPages.selectors.thumbnailContainerLink),function(){t(this).width(a),t(this).height(s)})}};(NestedPages=NestedPages||{}).Dropdowns=function(){var e=this,t=jQuery;return e.dropdown="",e.activeBtn="",e.activeContent="",e.toggleBtn="[data-dropdown-toggle]",e.dropdownContainer="[data-dropdown]",e.dropdownContent="[data-dropdown-content]",e.selectors={caret_up:"icon-arrow_drop_up",caret_down:"icon-arrow_drop_down"},e.bindEvents=function(){t(document).on("click",e.toggleBtn,function(a){a.preventDefault(),e.activeBtn=t(this),e.dropdown=t(this).parents(e.dropdownContainer),e.toggleDropdown()}),t(document).on("click",function(t){e.closeDropdowns(t.target)}),t(document).on("dropdown-opened",function(e,a){t(a).parents(NestedPages.selectors.row).length>0&&t(a).parents(NestedPages.selectors.row).addClass("active")}),t(document).on("dropdown-closed",function(){t(NestedPages.selectors.row).removeClass("active")})},e.toggleDropdown=function(){t("."+e.selectors.caret_up).attr("class",e.selectors.caret_down);var a=t(e.dropdown).find(e.dropdownContent);if(e.activeContent=a,t(a).hasClass("active"))return t(a).removeClass("active"),t(e.activeBtn).removeClass("active"),t(e.activeBtn).find("."+e.selectors.caret_up).attr("class",e.selectors.caret_down),void t(document).trigger("dropdown-closed",a);e.setPositioning(),t(e.toggleBtn).removeClass("active"),t(e.dropdownContent).removeClass("active"),t(a).addClass("active"),t(e.activeBtn).find("."+e.selectors.caret_down).attr("class",e.selectors.caret_up),t(e.activeBtn).addClass("active"),t(document).trigger("dropdown-opened",a)},e.setPositioning=function(){var a=t(e.activeBtn).outerHeight();t(e.activeContent).css("top",a+"px")},e.closeDropdowns=function(a){if(0===t(a).parents(e.dropdownContainer).length){t(e.dropdownContent).removeClass("active"),t(e.toggleBtn).removeClass("active"),t(e.activeBtn).find("."+e.selectors.caret_up).attr("class",e.selectors.caret_down);t(document).trigger("dropdown-closed",void 0)}},e.bindEvents()};(NestedPages=NestedPages||{}).Modals=function(){var e=this,t=jQuery;return e.activeBtn="",e.activeModal="",e.modalOpen=!1,e.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"},e.bindEvents=function(){t(document).on("click",e.selectors.toggleBtn,function(a){a.preventDefault(),e.activeBtn=t(this),e.openModal()}),t(document).on("click",e.selectors.closeBtn,function(t){t.preventDefault(),e.closeModals()}),t(document).on("open-modal-manual",function(a,s){e.activeModal=t('[data-nestedpages-modal="'+s+'"]'),e.openModal()}),t(document).on("close-modal-manual",function(t){e.closeModals()}),t(document).on("click",e.selectors.backdrop,function(t){e.closeModals()}),t(document).ready(function(){e.checkHash()})},e.openModal=function(){if(e.modalOpen)e.closeModals();else{if(t(e.activeBtn).length>0){var a=t(e.activeBtn).attr("data-nestedpages-modal-toggle");e.activeModal=t('*[data-nestedpages-modal="'+a+'"]')}t(e.activeModal).addClass("active"),e.modalOpen=!0,e.populateModal(),t(document).trigger("open-modal",[e.activeBtn,e.activeModal])}},e.closeModals=function(){e.modalOpen=!1,t("[data-nestedpages-modal]").removeClass("active"),e.activeModal="",e.activeBtn=""},e.populateModal=function(){var a=t(e.activeBtn).attr(e.selectors.title);void 0!==a&&""!==a&&t(e.activeModal).find("[data-nestedpages-modal-title]").text(a);var s=t(e.activeBtn).attr(e.selectors.content);void 0!==s&&""!==s&&t(e.activeModal).find("[data-nestedpages-modal-content]").html(s)},e.checkHash=function(){if(window.location.hash){if("#modal"===window.location.hash.substring(0,6)){var a=window.location.hash.substring(7);e.activeModal=t('*[data-nestedpages-modal="'+a+'"]'),e.openModal()}}},e.bindEvents()};(NestedPages=NestedPages||{}).CheckAll=function(){var e=this,t=jQuery;return e.activeCheckbox="",e.selectors={checkbox:"[data-np-check-all]"},e.bindEvents=function(){t(document).on("change",e.selectors.checkbox,function(){e.activeCheckbox=t(this),e.toggleCheckboxes()}),t(document).on("change","input[type=checkbox]",function(){e.checkAllStatus(t(this))})},e.init=function(){e.bindEvents()},e.toggleCheckboxes=function(){var a=!!t(e.activeCheckbox).is(":checked"),s=t(e.activeCheckbox).attr("data-np-check-all"),n=t('*[name="'+s+'"]');t.each(n,function(){var e=t(this).parents(NestedPages.selectors.rows);t(this).prop("checked",a),t(e).hasClass("np-hide")&&!t(e).is(":visible")&&t(e).find(NestedPages.selectors.bulkActionsCheckbox).prop("checked",!1)}),e.toggleCheckAll()},e.toggleCheckAll=function(){var a=t(e.activeCheckbox).attr("data-np-check-all"),s=t('*[name="'+a+'"]').length;s=s-t(".np-hide").find(NestedPages.selectors.bulkActionsCheckbox).length+t(".np-hide:visible").find(NestedPages.selectors.bulkActionsCheckbox).length;var n=t('*[name="'+a+'"]:checked').length;if(s==n)return t(e.activeCheckbox).prop("checked",!0),void t(e.activeCheckbox).removeClass("check-all-partial");n>0?t(e.activeCheckbox).addClass("check-all-partial"):(t(e.activeCheckbox).attr("checked",!1),t(e.activeCheckbox).removeClass("check-all-partial"))},e.checkAllStatus=function(a){var s=t(a).attr("name"),n=t('*[data-np-check-all="'+s+'"]');0!==n.length&&(e.activeCheckbox=t(n)[0],e.toggleCheckAll())},e.init()};(NestedPages=NestedPages||{}).BulkActions=function(){var e=this,t=jQuery;return e.selectedNumber=0,e.selectedLinks=[],e.selectedPosts=[],e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("change",NestedPages.selectors.bulkActionsCheckbox,function(){e.toggleBulkForm()}),t(document).on("submit",NestedPages.selectors.bulkActionsForm,function(a){"edit"===t("select[name=np_bulk_action]").val()&&(a.preventDefault(),e.toggleBulkEdit(!0))}),t(document).on("click",NestedPages.selectors.bulkEditRemoveItem,function(a){a.preventDefault();var s=t(this).siblings("input[type=hidden]").val();e.uncheckBulkItem(s)}),t(document).on("click",NestedPages.selectors.bulkEditCancel,function(t){t.preventDefault(),e.uncheckAllBulkItems()})},e.toggleBulkForm=function(){var a=!1,s="",n="";if(e.selectedPosts=[],e.selectedLinks=[],t.each(t(NestedPages.selectors.bulkActionsCheckbox),function(){if(t(this).is(":checked")){var o=t(this).parents(NestedPages.selectors.rows);if(a=!0,t(this).parent("div").hasClass("np-check-all")||t(o).hasClass("post-type-np-redirect")||(s+=t(this).val()+","),t(o).hasClass("post-type-np-redirect")&&(n+=t(this).val()+",",e.selectedLinks.push(t(this).val())),"np-redirect"!==t(this).attr("data-np-post-type")&&!t(this).parent("div").hasClass("np-check-all")){var i=[];i.title=t(this).attr("data-np-bulk-checkbox"),i.id=t(this).val(),e.selectedPosts.push(i)}}}),e.setBulkEditPosts(),e.toggleEditOption(),e.toggleLinkCountAlert(),a)return t(NestedPages.selectors.bulkActionsForm).show(),t(NestedPages.selectors.bulkActionsIds).val(s),t(NestedPages.selectors.bulkActionRedirectIds).val(n),void e.setSelectedNumber();t(NestedPages.selectors.bulkActionsIds).val(""),t(NestedPages.selectors.bulkActionsForm).hide()},e.setBulkEditPosts=function(){for(var a="",s=0;s<e.selectedPosts.length;s++)a+='<li><a href="#" class="np-remove" data-np-remove-bulk-item>&times;</a>',a+=e.selectedPosts[s].title,a+='<input type="hidden" name="post_ids[]" value="'+e.selectedPosts[s].id+'"></li>';t(NestedPages.selectors.bulkEditTitles).html(a)},e.uncheckBulkItem=function(a){t.each(t(NestedPages.selectors.bulkActionsCheckbox),function(){t(this).val()==a&&t(this).prop("checked",!1).change()}),0===t(NestedPages.selectors.bulkEditRemoveItem).length&&e.toggleBulkEdit(!1)},e.uncheckAllBulkItems=function(){t.each(t(NestedPages.selectors.bulkActionsCheckbox),function(){t(this).prop("checked",!1).change()}),e.toggleBulkEdit(!1)},e.setSelectedNumber=function(){var e=t(NestedPages.selectors.bulkActionsCheckbox+":checked").not(".np-check-all input").length,a=t(NestedPages.selectors.bulkActionsForm).find("select option").first();t(a).text(nestedpages.bulk_actions+" ("+e+")")},e.toggleEditOption=function(){var a=t(NestedPages.selectors.bulkActionsCheckbox+":checked").not(".np-check-all input").not(".np-redirect-bulk").length,s=t(NestedPages.selectors.bulkActionsForm).find("select option[value=edit]");if(0===a)return t(s).prop("disabled",!0),t(NestedPages.selectors.bulkActionsForm).find("select option").first().prop("selected",!0),void e.toggleBulkEdit(!1);t(s).prop("disabled",!1)},e.toggleBulkEdit=function(a){if(e.toggleLinkCountAlert(),a)return e.disableParentOptions(),t(NestedPages.selectors.bulkEditForm).show(),t(NestedPages.selectors.bulkActionsForm).hide(),void e.setWPSuggest();t(NestedPages.selectors.bulkEditForm).hide(),t(NestedPages.selectors.bulkActionsForm).show(),t(NestedPages.selectors.bulkEditLinkCount).parent("div").hide(),t(NestedPages.selectors.bulkActionsForm).find("select option").first().text(nestedpages.bulk_actions),e.resetBulkEditFields()},e.toggleLinkCountAlert=function(){0!==e.selectedLinks.length?t(NestedPages.selectors.bulkEditLinkCount).parent("div").show():t(NestedPages.selectors.bulkEditLinkCount).parent("div").hide()},e.disableParentOptions=function(){for(var a=t(NestedPages.selectors.bulkEditForm).find("select[name=post_parent]"),s=0;s<e.selectedPosts.length;s++)t(a).find("option[value="+e.selectedPosts[s].id+"]").attr("disabled",!0)},e.setWPSuggest=function(){var e=t(NestedPages.selectors.bulkEditForm).find("[data-autotag]");t.each(e,function(e,a){var s=t(this).attr("data-taxonomy");t(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+s,{multiple:!0,multipleSep:","})})},e.resetBulkEditFields=function(){var e=t(NestedPages.selectors.bulkEditForm).find("select");t.each(e,function(){t(this).find("option").first().prop("selected",!0),t(this).find("option").removeAttr("disabled")});var a=t(NestedPages.selectors.bulkEditForm).find(".cat-checklist");t.each(a,function(){t(this).find("input[type=checkbox]").prop("checked",!1)})},e.init()};(NestedPages=NestedPages||{}).HiddenItemCount=function(){var e=this,t=jQuery;return e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("change",NestedPages.selectors.bulkActionsCheckbox,function(){e.toggleHiddenCount()}),t(document).on("click",NestedPages.selectors.toggleAll,function(){e.toggleHiddenCount()}),t(document).on("click",NestedPages.selectors.pageToggle,function(){e.toggleHiddenCount()})},e.toggleHiddenCount=function(){var e=0;t.each(t(NestedPages.selectors.bulkActionsCheckbox),function(){if(t(this).is(":checked")){if(t(this).parent("div").hasClass("np-check-all"))return;var a=t(this).closest(".page-row");t(a).is(":visible")||e++}}),e<1?t(NestedPages.selectors.hiddenItemCountParent).hide():(t(NestedPages.selectors.hiddenItemCount).text(e),t(NestedPages.selectors.hiddenItemCountParent).show())},e.init()};(NestedPages=NestedPages||{}).MenuToggle=function(){var e=this,t=jQuery;return e.formatter=new NestedPages.Formatter,e.bindEvents=function(){t(document).on("click",NestedPages.selectors.childToggleLink,function(a){a.preventDefault(),e.toggleSingleMenu(t(this))}),t(document).on("click",NestedPages.selectors.toggleAll,function(t){t.preventDefault(),e.toggleAllMenus()})},e.toggleSingleMenu=function(a){var s=t(a).parent(NestedPages.selectors.childToggle).parent(NestedPages.selectors.row).siblings("ol");t(a).toggleClass("open"),t(s).toggle(),e.formatter.setBorders(),e.formatter.setNestedMargins(),e.syncUserToggles()},e.toggleAllMenus=function(){var a=NestedPages.selectors.toggleAll;if("closed"===t(a).attr("data-toggle"))return t(NestedPages.selectors.lists).show(),t(a).attr("data-toggle","opened").text(NestedPages.jsData.collapseText),t(NestedPages.selectors.childToggle+" a").addClass("open"),e.formatter.setBorders(),void e.syncUserToggles();t(NestedPages.selectors.lists).not(t(NestedPages.selectors.lists)[0]).hide(),t(a).attr("data-toggle","closed").text(NestedPages.jsData.expandText),t(NestedPages.selectors.childToggle+" a").removeClass("open"),e.formatter.setBorders(),e.syncUserToggles()},e.visibleRowIDs=function(){var e=[],a=t(NestedPages.selectors.rows+":visible");return t.each(a,function(a,s){var n=t(this).attr("id");e.push(n.replace("menuItem_",""))}),e},e.syncUserToggles=function(){t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.syncToggles,nonce:NestedPages.jsData.nonce,ids:e.visibleRowIDs(),posttype:NestedPages.jsData.posttype},success:function(e){"success"!==e.status&&console.log("There was an error saving toggled pages.")}})},e.bindEvents()};(NestedPages=NestedPages||{}).PageToggle=function(){var e=this,t=jQuery;return e.activeButton="",e.formatter=new NestedPages.Formatter,e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("click",NestedPages.selectors.toggleHidden,function(a){a.preventDefault(),e.activeButton=t(this),e.toggleHidden()}),t(document).on("click",NestedPages.selectors.toggleStatus,function(a){a.preventDefault(),e.toggleStatus(t(this))})},e.toggleHidden=function(){var a=t(e.activeButton),s=t(a).attr("href");if("#show"==s)return t(a).attr("href","#hide").text(NestedPages.jsData.showHiddenText),t(NestedPages.selectors.hiddenRows).removeClass("shown").hide(),e.formatter.updateSubMenuToggle(),void e.formatter.setBorders();"#hide"==s&&(t(a).attr("href","#show").text(NestedPages.jsData.hideHiddenText),t(NestedPages.selectors.hiddenRows).addClass("shown").show(),e.formatter.updateSubMenuToggle(),e.formatter.setBorders())},e.toggleStatus=function(e){var a=t(e).attr("href");a=a.substring(1),t(NestedPages.selectors.syncCheckbox).attr("disabled",!1),t(NestedPages.selectors.toggleStatus).removeClass("active"),t(e).addClass("active"),"draft"==a&&(t(NestedPages.selectors.syncCheckbox).attr("disabled",!0),t("."+a).addClass("nested-visible")),"all"!=a?(t(NestedPages.selectors.rows).hide(),t("."+a).show()):t(NestedPages.selectors.rows).show()},e.init()};(NestedPages=NestedPages||{}).Nesting=function(){var e=this,t=jQuery;e.formatter=new NestedPages.Formatter,e.initializeSortable=function(){if(!NestedPages.jsData.nestable)return e.initializeSortableFlat();t(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,a,s){return!(t(a).hasClass("post-type-np-redirect")&&!t(s).hasClass("post-type-np-redirect"))},start:function(e,t){t.placeholder.height(t.item.height())},sort:function(t,a){e.formatter.updatePlaceholderWidth(a)},stop:function(t,a){setTimeout(function(){e.formatter.updateSubMenuToggle(),e.formatter.setBorders(),e.formatter.setNestedMargins()},100),e.syncNesting()}})},e.initializeSortableFlat=function(){var a=t(NestedPages.selectors.lists).not(NestedPages.selectors.notSortable);t.each(a,function(){t(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(t,a){e.formatter.updatePlaceholderWidth(a)},stop:function(t,a){setTimeout(function(){e.formatter.updateSubMenuToggle(),e.formatter.setBorders(),e.formatter.setNestedMargins()},100),e.syncNesting()}})})},e.disableNesting=function(){t(NestedPages.selectors.sortable).sortable("destroy")},e.syncNesting=function(a,s){var n;if("1"!==nestedpages.manual_order_sync||a){t(NestedPages.selectors.errorDiv).hide(),t(NestedPages.selectors.loadingIndicator).show(),n=NestedPages.jsData.nestable?t(NestedPages.selectors.sortable).nestedSortable("toHierarchy",{startDepthCount:0}):e.setNestingArray(),e.disableNesting();var o=NestedPages.jsData.syncmenu;"1"===nestedpages.manual_menu_sync&&(o="nosync"),t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.syncNesting,nonce:NestedPages.jsData.nonce,list:n,post_type:NestedPages.jsData.posttype,syncmenu:o},success:function(a,s){if(e.initializeSortable(),"error"===a.status)t(NestedPages.selectors.errorDiv).text(a.message).show(),t(NestedPages.selectors.loadingIndicator).hide();else{if(s&&"function"==typeof s)return void s();t(NestedPages.selectors.loadingIndicator).hide()}}})}},e.setNestingArray=function(a){return ret=[],t(NestedPages.selectors.lists).first().children("li.page-row").each(function(){var t=e.recursiveNesting(this);ret.push(t)}),ret},e.recursiveNesting=function(a){var s,n=t(a).attr("id");if(n)return n=n.replace("menuItem_",""),s={id:n},t(a).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).length>0&&(s.children=[],t(a).children(NestedPages.selectors.lists).children(NestedPages.selectors.rows).each(function(){var t=e.recursiveNesting(this);s.children.push(t)})),s}};(NestedPages=NestedPages||{}).SyncMenuSetting=function(){var e=this,t=jQuery;return e.formatter=new NestedPages.Formatter,e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).ready(function(){"1"!==nestedpages.manual_menu_sync&&"1"===nestedpages.syncmenu&&e.syncSetting()}),t(document).on("change",NestedPages.selectors.syncCheckbox,function(){e.syncSetting()})},e.syncSetting=function(){"page"===NestedPages.jsData.posttype&&0!==t(NestedPages.selectors.syncCheckbox).length&&(NestedPages.jsData.syncmenu=t(NestedPages.selectors.syncCheckbox).is(":checked")?"sync":"nosync",t.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(t){"error"===t.status&&e.formatter.showAjaxError(t.message)},error:function(e){console.log(e)}}))},e.bindEvents()};(NestedPages=NestedPages||{}).NewPost=function(){var e=this,t=jQuery;return e.formatter=new NestedPages.Formatter,e.parent_id=0,e.posts="",e.form="",e.bindEvents=function(){t(document).on("open-modal",function(a,s,n){var o=t(s).attr("data-nestedpages-modal-toggle");void 0!==o&&"np-bulk-modal"==o&&e.openModal()}),t(document).on("submit",NestedPages.selectors.newPageForm,function(e){e.preventDefault()}),t(document).on("click",NestedPages.selectors.newPageSubmitButton,function(a){a.preventDefault(),e.submitForm(t(this))}),t(document).on("click",NestedPages.selectors.newPageTitle,function(a){a.preventDefault(),e.addTitleField(t(this))}),t(document).on("click",NestedPages.selectors.newPageRemoveTitle,function(a){a.preventDefault(),e.removeTitleField(t(this))}),t(document).on("click",NestedPages.selectors.addChildButton,function(a){a.preventDefault(),e.openQuickEdit(t(this))}),t(document).on("click",NestedPages.selectors.cancelNewChildButton,function(t){t.preventDefault(),e.cancelNewPage()}),t(document).on("click","["+NestedPages.selectors.newBeforeButton+"]",function(a){a.preventDefault(),e.openQuickEdit(t(this))}),t(document).on("click","["+NestedPages.selectors.newAfterButton+"]",function(a){a.preventDefault(),e.openQuickEdit(t(this))})},e.openModal=function(){var a=t(NestedPages.selectors.newPageFormContainer).clone().find(NestedPages.selectors.newPageForm);t(a).addClass("in-modal"),t(NestedPages.selectors.newPageModal).find(".modal-body").html(a),t(NestedPages.selectors.newPageModal).find("h3").text(nestedpages.add_multiple),t(NestedPages.selectors.newPageModal).find(".page_parent_id").val(e.parent_id),t(a).find(".np_title").first().focus(),t(a).find(NestedPages.selectors.newPageTitle).first().prop("tabindex","2")},e.openQuickEdit=function(a){var s=t(a).attr(NestedPages.selectors.newBeforeButton);s=void 0!==s&&""!==s&&s;var n=t(a).attr(NestedPages.selectors.newAfterButton);n=void 0!==n&&""!==n&&n;var o=t(a).closest(NestedPages.selectors.row).parent("li"),i=t(NestedPages.selectors.newPageFormContainer).clone();if(t(o).children("ol").length>0){var r=t(o).children("ol");t(i).insertBefore(r)}else t(i).appendTo(o);t(i).siblings(NestedPages.selectors.row).hide(),e.formatter.showQuickEdit(),t(i).find(".parent_name").html("<em>Parent:</em> "+t(a).attr("data-parentname")),s||n||t(i).find(".page_parent_id").val(t(a).attr("data-id")),s&&(t(i).find(".page_before_id").val(s),t(i).find("[data-new-post-relation-title]").text(nestedpages.insert_before+": "+t(a).attr("data-parentname"))),n&&(t(i).find(".page_after_id").val(n),t(i).find("[data-new-post-relation-title]").text(nestedpages.insert_after+": "+t(a).attr("data-parentname"))),t(i).show(),t(i).find(".np_title").focus(),t(i).find(NestedPages.selectors.newPageTitle).prop("tabindex","2")},e.cancelNewPage=function(){e.formatter.removeQuickEdit(),t(NestedPages.selectors.newChildError).hide(),t(NestedPages.selectors.newPageModal).find(".modal-body").empty(),t(NestedPages.selectors.sortable).find(".new-child").remove(),t(NestedPages.selectors.row).show()},e.addTitleField=function(e){var a=t(e).parents("form"),s=t(e).siblings(".new-page-titles").children("li").length+1,n='<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="'+s+'" /><a href="#" class="button-secondary np-remove-child">-</a></div></div></li>';t(e).siblings(".new-page-titles").append(n);t(a).find(".np_title").last().focus(),t(a).find(NestedPages.selectors.newPageTitle).prop("tabindex",s++),t(".new-page-titles").sortable({items:"li",handle:".handle"})},e.removeTitleField=function(e){t(e).parents(".new-child-row").parent("li").remove()},e.submitForm=function(a){e.toggleLoading(!0),e.form=t(a).parents("form");var s=!!t(a).hasClass("add-edit"),n=NestedPages.formActions.newPage;""!==t(e.form).find(".page_before_id").val()&&(n=NestedPages.formActions.newBeforeAfter),""!==t(e.form).find(".page_after_id").val()&&(n=NestedPages.formActions.newBeforeAfter),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:t(e.form).serialize()+"&action="+n+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(a){if("error"===a.status)return e.toggleLoading(!1),void t(e.form).find(NestedPages.selectors.quickEditErrorDiv).text(a.message).show();if(!0===s){var n=a.new_pages[0].edit_link;return n=n.replace(/&amp;/g,"&"),void window.location.replace(n)}e.toggleLoading(!1),e.posts=a.new_pages,e.addPosts()},error:function(a){console.log(a),e.toggleLoading(!1),t(e.form).find(NestedPages.selectors.quickEditErrorDiv).text("The form could not be saved at this time.").show()}})},e.addPosts=function(){var a=t(e.form).find(".page_before_id").val();a=""!==a&&a;var s=t(e.form).find(".page_after_id").val();s=""!==s&&s;var n=t(e.form).parent(".new-child").parent(".page-row");if(0!==t(n).children("ol").length||a||s||t(n).append('<ol class="nplist"></ol>'),t(e.form).hasClass("in-modal"))o=t(".nplist.sortable li.page-row:first");else var o=t(n).children("ol");for(i=0;i<e.posts.length;i++)e.appendRows(o,e.posts[i],a,s);a||s||t(o).show(),e.formatter.updateSubMenuToggle(),e.formatter.setNestedMargins(),e.cancelNewPage(),t(document).trigger("close-modal-manual")},e.appendRows=function(a,s,n,o){var i='<li id="menuItem_'+s.id+'" class="page-row';if("publish"===s.status&&(i+=" published"),i+='">',NestedPages.jsData.hierarchical?(i+='<div class="row">',i+='<div class="child-toggle"></div>'):(i+='<div class="row non-hierarchical">',i+='<div class="non-hierarchical-spacer"></div>'),i+='<div class="row-inner">',i+='<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>',i+='<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>',i+='<a href="'+s.edit_link+'" class="page-link page-title">',i+='<span class="title">'+s.title+"</span>","Publish"!==s.status?i+='<span class="status">('+s.status+")</span>":i+='<span class="status"></span>',i+='<span class="nav-status">',"hide"===s.np_nav_status&&(i+=" "+nestedpages.hidden),i+="</span>",i+='<span class="edit-indicator">Edit</span>',i+="</a>",NestedPages.jsData.hierarchical||(i+='<div class="np-post-columns">',i+='<ul class="np-post-info">',i+='<li><span class="np-author-display">'+s.author_formatted+"</span></li>",i+="<li>"+s.date_formatted+"</li>",i+="</ul>",i+="</div>"),t(".nplist").first().hasClass("has-yoast")&&(i+='<span class="np-seo-indicator na"></span>'),i+='<div class="action-buttons">',i+='<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>',i+='<li><a href="#" class="open-redirect-modal" data-parentid="'+s.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>",i+='<li><a href="#" class="add-new-child" data-id="'+s.id+'" data-parentname="'+s.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>",i+="</ul></div>",i+='<a href="#" class="np-btn np-quick-edit" data-id="'+s.id+'" data-template="'+s.page_template+'" data-title="'+s.title+'" data-slug="'+s.slug+'" data-commentstatus="closed" data-status="'+s.status.toLowerCase()+'" data-np-status="show"\tdata-navstatus="show" data-author="'+s.author+'" data-template="'+s.template+'" data-month="'+s.month+'" data-day="'+s.day+'" data-year="'+s.year+'" data-hour="'+s.hour+'" data-minute="'+s.minute+'" data-datepicker="'+s.datepicker+'" data-time="'+s.time+'" data-formattedtime="'+s.formattedtime+'" data-ampm="'+s.ampm+'">'+nestedpages.quick_edit+"</a>",i+='<a href="'+s.view_link+'" class="np-btn" target="_blank">'+nestedpages.view+"</a>",i+='<a href="'+s.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>',i+="</div>\x3c!-- .action-buttons --\x3e",i+="</div>\x3c!-- .row-inner --\x3e</div>\x3c!-- .row --\x3e",i+="</li>",n){r=e.findRowById(n);t(i).insertBefore(r)}else if(o){var r=e.findRowById(o);t(i).insertAfter(r)}else t(a).append(i)},e.findRowById=function(e){return t(NestedPages.selectors.rows+"#menuItem_"+e)},e.toggleLoading=function(e){if(e)return t(NestedPages.selectors.quickEditErrorDiv).hide(),t(NestedPages.selectors.newPageSubmitButton).attr("disabled","disabled"),void t(NestedPages.selectors.quickEditLoadingIndicator).show();t(NestedPages.selectors.newPageSubmitButton).attr("disabled",!1),t(NestedPages.selectors.quickEditLoadingIndicator).hide()},e.bindEvents()};(NestedPages=NestedPages||{}).QuickEditPost=function(){var e=this,t=jQuery;return e.formatter=new NestedPages.Formatter,e.button="",e.initialData="",e.parent_li="",e.form="",e.flatTerms="",e.termNames="",e.saveButton="",e.newData="",e.row="",e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("click",NestedPages.selectors.quickEditOpen,function(a){a.preventDefault(),e.button=t(this),e.openForm()}),t(document).on("click",NestedPages.selectors.quickEditCancel,function(t){t.preventDefault(),e.formatter.removeQuickEdit()}),t(document).on("click",NestedPages.selectors.quickEditToggleTaxonomies,function(e){e.preventDefault(),t(this).parents("form").find(".np-taxonomies").toggle()}),t(document).on("click",NestedPages.selectors.quickEditToggleMenuOptions,function(e){e.preventDefault(),t(this).parents("form").find(".np-menuoptions").toggle()}),t(document).on("change",".keep_private",function(){this.checked?t(".post_password").val("").prop("readonly",!0):t(".post_password").prop("readonly",!1)}),t(document).on("click",NestedPages.selectors.quickEditSaveButton,function(a){a.preventDefault(),e.saveButton=t(this),e.save()}),t(document).on("keydown",function(t){27===t.keyCode&&e.formatter.removeQuickEdit()})},e.openForm=function(){e.setInitialData(),e.createForm(),e.populateForm(),e.populateFlatTaxonomies()},e.setInitialData=function(){e.initialData={id:t(e.button).attr("data-id"),title:t(e.button).attr("data-title"),slug:t(e.button).attr("data-slug"),author:t(e.button).attr("data-author"),cs:t(e.button).attr("data-commentstatus"),status:t(e.button).attr("data-status"),template:t(e.button).attr("data-template"),month:t(e.button).attr("data-month"),day:t(e.button).attr("data-day"),year:t(e.button).attr("data-year"),hour:t(e.button).attr("data-hour"),minute:t(e.button).attr("data-minute"),navstatus:t(e.button).attr("data-navstatus"),npstatus:t(e.button).attr("data-np-status"),navtitle:t(e.button).attr("data-navtitle"),navtitleattr:t(e.button).attr("data-navtitleattr"),navcss:t(e.button).attr("data-navcss"),linktarget:t(e.button).attr("data-linktarget"),password:t(e.button).attr("data-password"),datepicker:t(e.button).attr("data-datepicker"),time:t(e.button).attr("data-formattedtime"),timeTwentyFour:t(e.button).attr("data-time"),ampm:t(e.button).attr("data-ampm"),timeFormat:t(e.button).attr("data-timeformat"),sticky:t(e.button).attr("data-sticky")},e.initialData.h_taxonomies=[],e.initialData.f_taxonomies=[],e.parent_li=t(e.button).closest(NestedPages.selectors.row).parent("li");var a=t(e.parent_li).attr("class").split(/\s+/);for(i=0;i<a.length;i++)"in-"===a[i].substring(0,3)&&e.initialData.h_taxonomies.push(a[i]),"inf-"===a[i].substring(0,4)&&e.initialData.f_taxonomies.push(a[i])},e.createForm=function(){if(e.form=t(NestedPages.selectors.quickEditPostForm).clone(),t(e.parent_li).children("ol").length>0){var a=t(e.parent_li).children("ol");t(e.form).insertBefore(a)}else t(e.form).appendTo(e.parent_li);t(e.form).siblings(NestedPages.selectors.row).hide(),t(e.form).show()},e.populateForm=function(){if(t(e.form).find(".page_id").html("<em>ID:</em> "+e.initialData.id),t(e.form).find(".np_id").val(e.initialData.id),t(e.form).find(".np_title").val(e.initialData.title),t(e.form).find(".np_slug").val(e.initialData.slug),t(e.form).find(".np_author select").val(e.initialData.author),t(e.form).find(".np_status").val(e.initialData.status),t(e.form).find(".np_nav_title").val(e.initialData.navtitle),t(e.form).find(".np_title_attribute").val(e.initialData.navtitleattr),t(e.form).find(".np_nav_css_classes").val(e.initialData.navcss),t(e.form).find(".post_password").val(e.initialData.password),t(e.form).find(".np_datepicker").val(e.initialData.datepicker),"open"===e.initialData.cs&&t(e.form).find(".np_cs").attr("checked","checked"),""!==e.initialData.template?t(e.form).find(".np_template").val(e.initialData.template):t(e.form).find(".np_template").val("default"),"private"===e.initialData.status&&(t(e.form).find(".post_password").attr("readonly",!0),t(e.form).find(".keep_private").attr("checked",!0)),"hide"===e.initialData.npstatus?t(e.form).find(".nested_pages_status").attr("checked","checked"):t(e.form).find(".nested_pages_status").removeAttr("checked"),"hide"===e.initialData.navstatus?t(e.form).find(".np_nav_status").attr("checked","checked"):t(e.form).find(".np_nav_status").attr("checked",!1),"_blank"===e.initialData.linktarget?t(e.form).find(".link_target").attr("checked","checked"):t(e.form).find(".link_target").attr("checked",!1),"private"===e.initialData.status&&t(e.form).find(".np_status").val("publish"),"sticky"===e.initialData.sticky?t(e.form).find(".np-sticky").attr("checked","checked"):t(e.form).find(".np-sticky").removeAttr("checked"),"H:i"===e.initialData.timeFormat?t(e.form).find(".np_time").val(e.initialData.timeTwentyFour):(t(e.form).find(".np_time").val(e.initialData.time),t(e.form).find(".np_ampm").val(e.initialData.ampm),t(e.form).find('select[name="mm"]').val(e.initialData.month),t(e.form).find('input[name="jj"]').val(e.initialData.day),t(e.form).find('input[name="aa"]').val(e.initialData.year),t(e.form).find('input[name="hh"]').val(e.initialData.hour),t(e.form).find('input[name="mn"]').val(e.initialData.minute)),e.initialData.hasOwnProperty("h_taxonomies")){var a=e.initialData.h_taxonomies;for(i=0;i<a.length;i++){var s="#"+a[i];t(e.form).find(s).attr("checked","checked")}}t(e.form).find(".np_datepicker").datepicker({beforeShow:function(e,a){t("#ui-datepicker-div").addClass("nestedpages-datepicker")}}),e.formatter.showQuickEdit(),t(e.form).show()},e.populateFlatTaxonomies=function(){e.initialData.hasOwnProperty("f_taxonomies")&&(e.createTaxonomyObject(),e.getTermNames(),e.setWPSuggest())},e.createTaxonomyObject=function(){var t={};for(i=0;i<e.initialData.f_taxonomies.length;i++){var a=e.initialData.f_taxonomies[i],s=a.split("-"),n=s.indexOf("nps"),o=s.splice(n+1);o=o.join("-");var r=a.split("-").splice(0,n);r.shift("inf");var d=r.join("-");d in t||(t[d]=[]);t[d].push(o)}e.flatTerms=t},e.getTermNames=function(){t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.getTaxonomies,nonce:NestedPages.jsData.nonce,terms:e.flatTerms},success:function(t){e.termNames=t.terms,e.populateFlatTaxonomyFields()}})},e.populateFlatTaxonomyFields=function(){e.termNames&&t.each(e.termNames,function(e,a){var s=t("#"+e+"-quickedit");t(s).val(a.join(","))})},e.setWPSuggest=function(){var a=t(e.form).find("[data-autotag]");t.each(a,function(e,a){var s=t(this).attr("data-taxonomy");t(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+s,{multiple:!0,multipleSep:","})})},e.save=function(){e.toggleLoading(!0),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:t(e.form).find("form").serialize()+"&action="+NestedPages.formActions.quickEditPost+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(a){"error"===a.status?(e.toggleLoading(!1),t(e.form).find(NestedPages.selectors.quickEditErrorDiv).text(a.message).show()):(e.toggleLoading(!1),e.newData=a.post_data,e.updatePostRow())},error:function(e){console.log(e)}})},e.updatePostRow=function(){e.row=t(e.button).parents(".row-inner"),t(e.row).find(".title").text(e.newData.post_title),t(e.row).find(".np-view-button").attr("href",e.newData.permalink);var a=t(e.row).find(".status");if("publish"!==e.newData._status&&"future"!==e.newData._status?t(a).text("("+e.newData._status+")"):"private"===e.newData.keep_private?t(a).text("("+e.newData.keep_private+")"):t(a).text(""),""!==e.newData.post_password&&void 0!==e.newData.post_password){var s=t(a).text();s+=' <span class="locked">',s+='<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>',s+="</span>",t(a).html(s)}var n=t(e.row).find(".nav-status");"hide"==e.newData.nav_status?t(n).text("(Hidden)"):t(n).text("");var o=t(e.row).parent("li");"hide"==e.newData.np_status?(t(o).addClass("np-hide"),t(e.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>')):(t(o).removeClass("np-hide"),t(e.row).find(".status-np-hidden").remove());var i=t(e.row).find(".sticky");"sticky"==e.newData.sticky?t(i).show():t(i).hide(),NestedPages.jsData.hierarchical||t(e.row).find(".np-author-display").text(e.newData.author_name);var r=t(e.row).find(NestedPages.selectors.quickEditOpen);t(r).attr("data-id",e.newData.post_id),t(r).attr("data-template",e.newData.page_template),t(r).attr("data-title",e.newData.post_title),t(r).attr("data-slug",e.newData.post_name),t(r).attr("data-commentstatus",e.newData.comment_status),t(r).attr("data-status",e.newData._status),t(r).attr("data-sticky",e.newData.sticky),"private"===e.newData.keep_private&&t(r).attr("data-status","private"),t(r).attr("data-author",e.newData.post_author),t(r).attr("data-np-status",e.newData.np_status),t(r).attr("data-password",e.newData.post_password),t(r).attr("data-navstatus",e.newData.nav_status),t(r).attr("data-navtitle",e.newData.np_nav_title),t(r).attr("data-linktarget",e.newData.link_target),t(r).attr("data-navtitleattr",e.newData.np_title_attribute),t(r).attr("data-navcss",e.newData.np_nav_css_classes),t(r).attr("data-month",e.newData.mm),t(r).attr("data-day",e.newData.jj),t(r).attr("data-year",e.newData.aa),t(r).attr("data-hour",e.newData.hh),t(r).attr("data-minute",e.newData.mn),t(r).attr("data-datepicker",e.newData.np_date),t(r).attr("data-time",e.newData.np_time),t(r).attr("data-formattedtime",e.newData.np_time),t(r).attr("data-ampm",e.newData.np_ampm),e.removeTaxonomyClasses(),e.addCategoryClasses(),e.addHierarchicalClasses(),e.addFlatClasses(),e.addStatusClass(),e.formatter.removeQuickEdit(),e.formatter.flashRow(e.row)},e.addStatusClass=function(){var a=["published","draft","pending","future"];for(i=0;i<a.length;i++)t(e.row).removeClass(a[i]);t(e.row).addClass(e.newData._status)},e.removeTaxonomyClasses=function(){taxonomies=[];var a=t(e.row).attr("class").split(/\s+/);for(i=0;i<a.length;i++)"in-"===a[i].substring(0,3)&&t(e.row).removeClass(a[i]),"inf-"===a[i].substring(0,4)&&t(e.row).removeClass(a[i])},e.addCategoryClasses=function(){if(e.newData.hasOwnProperty("post_category")){var a=e.newData.post_category;for(i=0;i<a.length;i++){var s="in-category-"+a[i];t(e.row).addClass(s)}}},e.addHierarchicalClasses=function(){if(e.newData.hasOwnProperty("tax_input")){var a=e.newData.tax_input;t.each(a,function(a,s){for(i=0;i<s.length;i++){var n="in-"+a+"-"+s[i];t(e.row).addClass(n)}})}},e.addFlatClasses=function(){if(e.newData.hasOwnProperty("flat_tax")){var a=e.newData.flat_tax;t.each(a,function(a,s){for(i=0;i<s.length;i++){var n="inf-"+a+"-nps-"+s[i];t(e.row).addClass(n)}})}},e.toggleLoading=function(a){if(a)return t(NestedPages.selectors.quickEditErrorDiv).hide(),t(e.saveButton).attr("disabled","disabled"),void t(NestedPages.selectors.quickEditLoadingIndicator).show();t(e.saveButton).attr("disabled",!1),t(NestedPages.selectors.quickEditLoadingIndicator).hide()},e.init()};(NestedPages=NestedPages||{}).QuickEditLink=function(){var e=this,t=jQuery;return e.formatter=new NestedPages.Formatter,e.button="",e.postData="",e.newPostData="",e.form="",e.bindEvents=function(){t(document).on("click",NestedPages.selectors.quickEditButtonLink,function(a){a.preventDefault(),e.formatter.removeQuickEdit(),e.button=t(this),e.openQuickEdit()}),t(document).on("click",NestedPages.selectors.quickEditLinkSaveButton,function(t){t.preventDefault(),e.submitForm()}),t(document).on("keydown",function(t){27===t.keyCode&&e.formatter.removeQuickEdit()})},e.openQuickEdit=function(){e.setData(),e.createForm(),e.populateForm()},e.setData=function(){e.postData={id:t(e.button).attr("data-id"),url:t(e.button).attr("data-url"),title:t(e.button).attr("data-title"),status:t(e.button).attr("data-status"),navstatus:t(e.button).attr("data-navstatus"),npstatus:t(e.button).attr("data-np-status"),linktarget:t(e.button).attr("data-linktarget"),parentid:t(e.button).attr("data-parentid"),navtitleattr:t(e.button).attr("data-navtitleattr"),navcss:t(e.button).attr("data-navcss"),navtype:t(e.button).attr("data-nav-type"),navobject:t(e.button).attr("data-nav-object"),navobjectid:t(e.button).attr("data-nav-object-id"),navoriginallink:t(e.button).attr("data-nav-original-link"),navoriginaltitle:t(e.button).attr("data-nav-original-title")}},e.createForm=function(){var a=t(e.button).closest(NestedPages.selectors.row).parent("li");if(e.form=t(NestedPages.selectors.quickEditLinkForm).clone(),t(a).children("ol").length>0){var s=t(a).children("ol");t(e.form).insertBefore(s)}else t(e.form).appendTo(a);t(e.form).siblings(NestedPages.selectors.row).hide()},e.populateForm=function(){if(t(e.form).find(".np_id").val(e.postData.id),t(e.form).find(".np_title").val(e.postData.title),t(e.form).find(".np_author select").val(e.postData.author),t(e.form).find(".np_status").val(e.postData.status),t(e.form).find(".np_content").val(e.postData.url),t(e.form).find(".np_parent_id").val(e.postData.parentid),t(e.form).find(".np_title_attribute").val(e.postData.navtitleattr),t(e.form).find(".np_nav_css_classes").val(e.postData.navcss),"hide"===e.postData.npstatus?t(e.form).find(".np_status").prop("checked","checked"):t(e.form).find(".np_status").removeAttr("checked"),"hide"===e.postData.navstatus?t(e.form).find(".np_nav_status").prop("checked","checked"):t(e.form).find(".np_nav_status").removeAttr("checked"),"_blank"===e.postData.linktarget?t(e.form).find(".link_target").prop("checked","checked"):t(e.form).find(".link_target").removeAttr("checked"),"custom"!==e.postData.navobject&&""!==e.postData.navobject){var a='<div class="form-control original-link">Original: <a href="'+e.postData.navoriginallink+'" target="_blank">'+e.postData.navoriginaltitle+"</a></div>";t(e.form).find("[data-url-field]").remove(),t(a).insertAfter(t(e.form).find("h3")),t(e.form).find("[data-np-menu-object-input]").val(e.postData.navobject),t(e.form).find("[data-np-menu-objectid-input]").val(e.postData.navobjectid),t(e.form).find("[data-np-menu-type-input]").val(e.postData.navtype),t(e.form).find("h3").text("Link: "+e.postData.navoriginaltitle)}else t(e.form).find("h3").text("Link"),t(e.form).find("[data-np-menu-object-input]").val("custom"),t(e.form).find("[data-np-menu-type-input]").val("custom");e.formatter.showQuickEdit(),t(e.form).show()},e.submitForm=function(){e.toggleLoading(!0),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:t(e.form).find("form").serialize()+"&action="+NestedPages.formActions.quickEditLink+"&nonce="+NestedPages.jsData.nonce+"&syncmenu="+NestedPages.jsData.syncmenu+"&post_type="+NestedPages.jsData.posttype,success:function(a){"error"===a.status?(e.toggleLoading(!1),t(e.form).find(NestedPages.selectors.quickEditErrorDiv).text(a.message).show()):(e.toggleLoading(!1),e.newPostData=a.post_data,e.updateRow())},error:function(a){e.toggleLoading(!1),t(e.form).find(NestedPages.selectors.quickEditErrorDiv).text("The form could not be saved at this time.").show()}})},e.updateRow=function(){var a=t(e.form).siblings(".row");t(a).find(".title").html(e.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 s=t(a).find(".status");"publish"!==e.newPostData._status&&"future"!==e.newPostData._status?t(s).text("("+e.newPostData._status+")"):t(s).text("");var n=t(a).find(".nav-status");"hide"==e.newPostData.nav_status?t(n).text("("+NestedPages.jsData.hiddenText+")"):t(n).text("");var o=t(a).parent("li");"hide"==e.newPostData.np_status?(t(o).addClass("np-hide"),t(a).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>')):(t(o).removeClass("np-hide"),t(a).find(".status-np-hidden").remove());var i=t(a).find(NestedPages.selectors.quickEditButtonLink);t(i).attr("data-id",e.newPostData.post_id),t(i).attr("data-title",e.newPostData.post_title),t(i).attr("data-url",e.newPostData.post_content),t(i).attr("data-status",e.newPostData._status),t(i).attr("data-navstatus",e.newPostData.nav_status),t(i).attr("data-np-status",e.newPostData.np_status),t(i).attr("data-linkTarget",e.newPostData.linkTarget),t(i).attr("data-navtitleattr",e.newPostData.titleAttribute),t(i).attr("data-navcss",e.newPostData.cssClasses),e.formatter.removeQuickEdit(),e.formatter.flashRow(a)},e.toggleLoading=function(e){if(t(".row").removeClass("np-updated").removeClass("np-updated-show"),e)return t(NestedPages.selectors.quickEditErrorDiv).hide(),t(NestedPages.selectors.quickEditLinkSaveButton).attr("disabled","disabled"),void t(NestedPages.selectors.quickEditLoadingIndicator).show();t(NestedPages.selectors.quickEditLinkSaveButton).attr("disabled",!1),t(NestedPages.selectors.quickEditLoadingIndicator).hide()},e.bindEvents()};(NestedPages=NestedPages||{}).Clone=function(){var e=this,t=jQuery;return e.parent_id="",e.parent_title="",e.parentLi=null,e.formatter=new NestedPages.Formatter,e.bindEvents=function(){t(document).on("click",NestedPages.selectors.cloneButton,function(a){a.preventDefault(),e.parent_id=t(this).attr("data-id"),e.parent_title=t(this).attr("data-parentname"),e.parentLi=t(this).parent(".row").parent(".page-row").parent(".npList"),e.openModal()}),t(document).on("click",NestedPages.selectors.confirmClone,function(t){t.preventDefault(),e.clone()})},e.openModal=function(){t("#"+NestedPages.selectors.cloneModal).find("[data-clone-parent]").text(e.parent_title),t(document).trigger("open-modal-manual",NestedPages.selectors.cloneModal)},e.clone=function(){e.toggleLoading(!0),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",data:{action:NestedPages.formActions.clonePost,parent_id:e.parent_id,quantity:t(NestedPages.selectors.cloneQuantity).val(),status:t(NestedPages.selectors.cloneStatus).val(),author:t(NestedPages.selectors.cloneAuthor).find("select").val(),nonce:NestedPages.jsData.nonce,posttype:NestedPages.jsData.posttype},success:function(a){e.toggleLoading(!1),t(document).trigger("close-modal-manual"),location.reload()}})},e.toggleLoading=function(e){if(e)return t("#"+NestedPages.selectors.cloneModal).find("[data-clone-loading]").show(),void t(NestedPages.selectors.confirmClone).attr("disabled","disabled");t("#"+NestedPages.selectors.cloneModal).find("[data-clone-loading]").hide(),t(NestedPages.selectors.confirmClone).attr("disabled",!1)},e.bindEvents()};(NestedPages=NestedPages||{}).Tabs=function(){var e=this,t=jQuery;return e.activeContent="",e.activeButton="",e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("click",NestedPages.selectors.tabButton,function(a){a.preventDefault(),e.activeButton=t(this),e.toggleTabs()})},e.toggleTabs=function(){e.activeContent=t(e.activeButton).attr("href"),t(NestedPages.selectors.tabContent).hide(),t(e.activeContent).show(),t(e.activeButton).parents(NestedPages.selectors.tabButtonParent).find(NestedPages.selectors.tabButton).removeClass("active"),t(e.activeButton).addClass("active")},e.init()},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]",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",quickEditToggleTaxonomies:".np-toggle-taxonomies",quickEditToggleMenuOptions:".np-toggle-menuoptions",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"},NestedPages.Factory=function(){var e=this,t=jQuery;return e.formatter=new NestedPages.Formatter,e.dropdowns=new NestedPages.Dropdowns,e.modals=new NestedPages.Modals,e.checkAll=new NestedPages.CheckAll,e.bulkActions=new NestedPages.BulkActions,e.menuToggle=new NestedPages.MenuToggle,e.pageToggle=new NestedPages.PageToggle,e.nesting=new NestedPages.Nesting,e.syncMenuSetting=new NestedPages.SyncMenuSetting,e.newPage=new NestedPages.NewPost,e.quickEditLink=new NestedPages.QuickEditLink,e.quickEditPost=new NestedPages.QuickEditPost,e.clone=new NestedPages.Clone,e.tabs=new NestedPages.Tabs,e.menuLinks=new NestedPages.MenuLinks,e.hiddenItemCount=new NestedPages.HiddenItemCount,e.confirmDelete=new NestedPages.ConfirmDelete,e.manualSync=new NestedPages.ManualSync,e.postSearch=new NestedPages.PostSearch,e.postMove=new NestedPages.MovePost,e.wpml=new NestedPages.Wpml,e.init=function(){nestedpages.settings_page||(e.bindEvents(),e.setPostType(),e.setMenuSync(),e.setNestable(),e.setSortable(),e.formatter.updateSubMenuToggle(),e.formatter.setBorders(),e.formatter.setNestedMargins(),e.nesting.initializeSortable())},e.bindEvents=function(){t(document).on("click",NestedPages.selectors.quickEditOverlay,function(t){e.formatter.removeQuickEdit(),e.newPage.cancelNewPage()}),t(document).ready(function(){e.formatter.hideAjaxError(),e.formatter.sizeLinkThumbnails()})},e.setNestable=function(){var e=!1;t.each(NestedPages.jsData.allPostTypes,function(t,a){a.name===NestedPages.jsData.posttype&&(!0===a.hierarchical&&(e=!0),!0===a.disable_nesting&&(e=!1))}),NestedPages.jsData.nestable=e},e.setSortable=function(){var e=!0;t.each(NestedPages.jsData.allPostTypes,function(t,a){a.name===NestedPages.jsData.posttype&&void 0!==a.disable_sorting&&""!==a.disable_sorting&&"true"===a.disable_sorting&&(e=!1)}),NestedPages.jsData.sortable=e},e.setPostType=function(){NestedPages.jsData.posttype=nestedpages.current_post_type,void 0!==NestedPages.jsData.posttype&&""!==NestedPages.jsData.posttype||(NestedPages.jsData.posttype=t(NestedPages.selectors.sortable).attr("id").substring(3)),NestedPages.jsData.hierarchical=NestedPages.jsData.allPostTypes[NestedPages.jsData.posttype].hierarchical},e.setMenuSync=function(){NestedPages.jsData.syncmenu="1"===nestedpages.syncmenu?"sync":"nosync"},e.init()};(NestedPages=NestedPages||{}).MenuLinks=function(){var e=this,t=jQuery;return e.typeButton="",e.post="",e.formatter=new NestedPages.Formatter,e.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]"},e.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]"},e.search=new NestedPages.MenuSearch,e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("click",NestedPages.selectors.openLinkModal,function(a){a.preventDefault(),e.postParent=t(this).attr("data-parentid"),t(e.selectors.form).find(".parent_id").val(t(this).attr("data-parentid")),e.openModal()}),t(document).on("click",e.selectors.accordionItem,function(a){a.preventDefault(),e.accordion(t(this))}),t(document).on("click",e.selectors.typeSelect,function(a){a.preventDefault(),e.typeButton=t(this),e.setLinkType()}),t(document).on("keyup",e.fields.navigationLabel,function(){e.updateTitle()}),t(document).on("click",e.selectors.saveButton,function(t){t.preventDefault(),e.submitForm()}),t(document).on("keydown",function(e){27===e.keyCode&&t(document).trigger("close-modal-manual")})},e.openModal=function(){t(NestedPages.selectors.linkErrorDiv).hide(),t(NestedPages.selectors.linkModal).find("input").val(""),t(NestedPages.selectors.linkModal).find(".parent_id").val(e.postParent),e.clearForm(),t(e.selectors.accordion).find("ul").hide(),t(e.selectors.typeSelect).removeClass("active"),t(document).trigger("open-modal-manual",NestedPages.selectors.linkModal)},e.accordion=function(a){e.clearForm();var s=t(a).siblings("ul");if(t(s).is(":visible"))return t(a).removeClass("active"),void t(s).slideUp("fast");t(e.selectors.accordionItem).removeClass("active"),t(a).addClass("active"),t(a).parents(e.selectors.accordion).find("ul").slideUp("fast"),t(s).slideDown("fast")},e.setLinkType=function(){t(e.typeButton).hasClass("active")?e.clearForm():(t(e.typeButton).hasClass("np-custom-link")&&(t(e.selectors.accordionItem).removeClass("active"),t(e.selectors.accordion).find("ul").slideUp("fast")),t(e.selectors.formPlaceholder).hide(),e.populateForm())},e.populateForm=function(){t(e.selectors.saveButton).show(),t(e.selectors.typeSelect).removeClass("active"),t(e.typeButton).addClass("active"),t(e.fields.menuTitle).text(t(e.typeButton).text()).val(t(e.typeButton).text()),t(e.selectors.form).find("h3").find("em").text(t(e.typeButton).attr("data-np-object-name")),""!==t(e.typeButton).attr("data-np-permalink")?(t(e.selectors.form).find(e.selectors.urlInputCont).hide(),t(e.selectors.form).find(e.selectors.originalLink).html('<a href="'+t(e.typeButton).attr("data-np-permalink")+'">'+t(e.typeButton).text()+"</a>"),t(e.selectors.form).find(e.selectors.originalLink).parent(".original-link").show()):(t(e.selectors.form).find(e.selectors.urlInputCont).show(),t(e.selectors.form).find(e.selectors.originalLink).parent(".original-link").hide()),t(e.fields.object).val(t(e.typeButton).attr("data-np-menu-object")),t(e.fields.objectid).val(t(e.typeButton).attr("data-np-menu-objectid")),t(e.fields.itemType).val(t(e.typeButton).attr("data-np-menu-type")),t(e.selectors.formDetails).show()},e.clearForm=function(){t(e.selectors.form).find(e.selectors.errorDiv).hide(),t(e.selectors.saveButton).hide(),t(e.selectors.formDetails).hide(),t(e.selectors.formPlaceholder).show(),t(e.selectors.form).find("input").not(".parent_id").val(""),t(e.selectors.form).find(e.fields.linkTarget).val("_blank"),t(e.selectors.form).find('input[type="checkbox"]').attr("checked",!1),t(e.selectors.typeSelect).removeClass("active"),e.search.toggleLoading(!1),t(e.selectors.searchResults).remove(),t(e.selectors.defaultResults).show()},e.updateTitle=function(){var a=t(e.fields.navigationLabel).val(),s=t(e.selectors.form).find("h3").find("span");""!==a?(t(e.fields.menuTitle).val(a),t(s).text(a)):(t(e.fields.menuTitle).val(t(e.typeButton).text()),t(s).text(t(e.typeButton).text()))},e.submitForm=function(){e.toggleLoading(!0),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",data:t(e.selectors.form).serialize()+"&action="+NestedPages.formActions.newMenuItem+"&nonce="+NestedPages.jsData.nonce+"&post_type="+NestedPages.jsData.posttype+"&syncmenu="+NestedPages.jsData.syncmenu,success:function(a){e.toggleLoading(!1),"error"!==a.status?(e.post=a.post_data,e.createRow()):t(e.selectors.form).find(e.selectors.errorDiv).text(a.message).show()},error:function(e){console.log(e)}})},e.createRow=function(){var a='<li id="menuItem_'+e.post.id+'" class="page-row published';a+='">',a+='<div class="row"><div class="child-toggle"><div class="child-toggle-spacer"></div></div><div class="row-inner">',a+='<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>',a+='<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>',a+='<a href="'+e.post.np_link_content+'" class="page-link page-title" target="_blank"><span class="title">'+e.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>',a+='</a><div class="action-buttons"><a href="#" class="np-btn np-quick-edit-redirect" ',a+='data-id="'+e.post.id+'"',a+='data-parentid="'+e.post.parent_id+'"',a+='data-title="'+e.post.menuTitle+'" ',a+='data-url="'+e.post.url+'" ',a+='data-status="publish" ',a+='data-np-status="show" ',a+='data-navstatus="show" ',a+='data-navcss="'+e.post.cssClasses+'" ',a+='data-navtitleattr="'+e.post.titleAttribute+'" ',a+='data-nav-type="'+e.post.menuType+'" ',a+='data-nav-object="'+e.post.objectType+'" ',a+='data-nav-object-id="'+e.post.objectId+'" ',a+='data-nav-original-link="'+e.post.original_link+'" ',a+='data-nav-original-title="'+e.post.original_title+'" ',a+='data-linktarget="'+e.post.link_target+'">',a+=NestedPages.jsData.quickEditText,a+="</a>",a+='<a href="'+e.post.delete_link+'" class="np-btn np-btn-trash"><i class="np-icon-remove"></i></a>',a+="</div></div></div></li>","0"===e.post.parent_id?t(".nplist:first li:first").after(a):e.appendChildRow(a),t(document).trigger("close-modal-manual"),e.row=t("#menuItem_"+e.post.id).find(".row"),e.formatter.flashRow(e.row)},e.appendChildRow=function(a){var s=t("#menuItem_"+e.post.parent_id);0===t(s).children("ol").length?(a='<ol class="sortable nplist" style="display:block;">'+a+"</ol>",t(s).append(a)):t(s).find("ol:first").prepend(a),e.formatter.updateSubMenuToggle()},e.toggleLoading=function(a){if(a)return t(e.selectors.form).find(e.selectors.errorDiv).hide(),t(e.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).show(),void t(e.selectors.saveButton).attr("disabled","disabled");t(e.selectors.form).find(NestedPages.selectors.quickEditLoadingIndicator).hide(),t(e.selectors.saveButton).attr("disabled",!1)},e.init()};(NestedPages=NestedPages||{}).MenuSearch=function(){var e=this,t=jQuery;return e.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]"},e.activeForm="",e.results="",e.defaultResults="",e.searchType="",e.searchObject="",e.init=function(){e.bindEvents()},e.bindEvents=function(){t(document).on("keyup",e.selectors.searchForms,function(){e.activeForm=t(this),t(e.selectors.searchResults).remove(),e.performSearch()})},e.performSearch=function(){if(e.defaultResults=t(e.activeForm).parent("li").siblings(e.selectors.defaultResults),t(e.activeForm).val().length>2)return t(e.defaultResults).hide(),e.toggleLoading(!0),void e.query();e.toggleLoading(!1),t(e.defaultResults).show()},e.query=function(){e.searchType=t(e.activeForm).attr(e.selectors.searchType),e.searchObject=t(e.activeForm).attr(e.selectors.searchObject),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.search,nonce:NestedPages.jsData.nonce,term:t(e.activeForm).val(),searchType:e.searchType,searchObject:e.searchObject},success:function(a){console.log(a),a.results?(e.results=a.results,e.toggleLoading(!1),"post_type"===e.searchType?e.appendPosts():e.appendTaxonomies()):(e.toggleLoading(!1),t(e.activeForm).siblings(e.selectors.noResults).show())}})},e.appendPosts=function(){var a="";t.each(e.results,function(t,s){a+='<li data-np-search-result><a href="#" data-np-menu-object="'+e.searchObject+'" data-np-menu-type="post_type" data-np-menu-objectid="'+s.ID+'" data-np-permalink="'+s.permalink+'" data-np-object-name="'+s.singular_name+'" data-np-menu-selection>'+s.post_title+"</a></li>"}),t(a).insertAfter(t(e.activeForm).parent("li")),e.toggleLoading(!1)},e.appendTaxonomies=function(){var a="";t.each(e.results,function(t,s){a+='<li data-np-search-result><a href="#" data-np-menu-object="'+e.searchObject+'" data-np-menu-type="post_type" data-np-menu-objectid="'+s.term_id+'" data-np-permalink="'+s.permalink+'" data-np-object-name="'+s.taxonomy+'" data-np-menu-selection>'+s.name+"</a></li>"}),t(a).insertAfter(t(e.activeForm).parent("li")),e.toggleLoading(!1)},e.toggleLoading=function(a){var s=t(e.activeForm).siblings(e.selectors.loadingIndicator);t(e.selectors.noResults).hide(),a?t(s).show():t(s).hide()},e.init()},jQuery(document).ready(function(){new NestedPagesTrash});var NestedPagesTrash=function(){var e=this,t=jQuery;return e.trashButton=".np-empty-trash",e.confirmButton=".np-trash-confirm",e.warningModal="#np-trash-modal",e.errorAlert="#np-error",e.loadingIndicator="#nested-loading",e.trashLinks=".np-trash-links",e.postType=t("#np-trash-posttype").val(),e.nonce=nestedpages.np_nonce,e.formAction="npEmptyTrash",e.bindEvents=function(){t(document).on("click",e.confirmButton,function(t){t.preventDefault(),e.confirmEmpty()})},e.confirmEmpty=function(){e.loading(!0),t(document).trigger("close-modal-manual"),t(e.errorAlert).hide(),e.emptyTrash()},e.emptyTrash=function(){t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:e.formAction,nonce:e.nonce,posttype:e.postType},success:function(a){e.loading(!1),"error"===a.status?t(e.errorAlert).text(a.message).show():(t(e.trashLinks).hide(),t(".notice-dismiss").click())}})},e.loading=function(a){a?t(e.loadingIndicator).show():t(e.loadingIndicator).hide()},e.bindEvents()};(NestedPages=NestedPages||{}).ConfirmDelete=function(){var e=this,t=jQuery;return e.deleteLink="",e.bindEvents=function(){t(document).on("click",NestedPages.selectors.linkDeleteButton,function(a){a.preventDefault(),e.confirmSingle(t(this))}),t(document).on("click",NestedPages.selectors.linkDeleteConfirmationButton,function(a){a.preventDefault(),t(this).hasClass("bulk")?e.deleteMultiple():e.deleteSingle()}),t(document).on("submit",NestedPages.selectors.bulkActionsForm,function(t){e.confirmMultiple(t)})},e.confirmSingle=function(a){e.deleteLink=t(a).attr("href"),t(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation_singular),t(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.delete).removeClass("bulk"),t(document).trigger("open-modal-manual",NestedPages.selectors.linkDeleteConfirmationModal)},e.confirmMultiple=function(e){if("trash"===t('select[name="np_bulk_action"]').val()){""!==t(NestedPages.selectors.bulkActionRedirectIds).val()&&(e.preventDefault(),t(NestedPages.selectors.linkDeleteConfirmationModalText).text(nestedpages.link_delete_confirmation),t(NestedPages.selectors.linkDeleteConfirmationButton).text(nestedpages.trash_delete_links).addClass("bulk"),t(document).trigger("open-modal-manual",[NestedPages.selectors.linkDeleteConfirmationModal]))}},e.deleteMultiple=function(){t(NestedPages.selectors.bulkActionsForm)[0].submit()},e.deleteSingle=function(){window.location.replace(e.deleteLink)},e.bindEvents()};(NestedPages=NestedPages||{}).ManualSync=function(){var e=this,t=jQuery;return e.activeBtn="",e.bindEvents=function(){t(document).on("click",NestedPages.selectors.manualMenuSync,function(a){a.preventDefault(),e.activeBtn=t(this),e.syncMenu()}),t(document).on("click",NestedPages.selectors.manualOrderSync,function(a){a.preventDefault(),e.activeBtn=t(this),e.syncOrder()})},e.syncMenu=function(){e.loading(!0),t.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(a){"error"===a.status?(t(NestedPages.selectors.errorDiv).text(a.message).show(),t(NestedPages.selectors.loadingIndicator).hide()):e.loading(!1)}})},e.syncOrder=function(){e.loading(!0);(new NestedPages.Nesting).syncNesting(!0,e.loading(!1))},e.loading=function(a){if(a)return t(e.activeBtn).addClass("disabled"),void t(NestedPages.selectors.loadingIndicator).show();t(e.activeBtn).removeClass("disabled"),t(NestedPages.selectors.loadingIndicator).hide()},e.bindEvents()};(NestedPages=NestedPages||{}).PostSearch=function(){var e=this,t=jQuery;return e.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"},e.changed=!1,e.activeInput="",e.results="",e.defaultResults="",e.postType="",e.activeForm="",e.bindEvents=function(){t("["+e.selectors.input+"]").on("input",function(){if(e.activeInput=t(this),e.setOptions(),e.changed||e.setDefaultResults(),""===t(this).val())return t(e.activeForm).find("["+e.selectors.noResults+"]").hide(),void e.showDefaultResults();e.query()})},e.setDefaultResults=function(){e.defaultResults=t(e.activeForm).find("["+e.selectors.results+"]").html(),e.changed=!0},e.showDefaultResults=function(){t(e.activeForm).find("["+e.selectors.results+"]").html(e.defaultResults)},e.setOptions=function(){e.postType=t(e.activeInput).attr(e.selectors.input),e.activeForm=t(e.activeInput).parents("["+e.selectors.form+"]")},e.performSearch=function(){if(e.defaultResults=t(e.activeForm).parent("li").siblings(e.selectors.defaultResults),t(e.activeForm).val().length>2)return t(e.defaultResults).hide(),e.toggleLoading(!0),void e.query();e.toggleLoading(!1),t(e.defaultResults).show()},e.query=function(){t(e.activeForm).find("["+e.selectors.results+"]").empty(),e.toggleLoading(!0),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.postSearch,nonce:NestedPages.jsData.nonce,term:t(e.activeInput).val(),postType:e.postType},success:function(a){a.results?(e.results=a.results,e.loadResults(),e.toggleLoading(!1)):(e.toggleLoading(!1),t(e.activeForm).find("["+e.selectors.noResults+"]").show())}})},e.loadResults=function(){var a="<ul>";t.each(e.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>",t(e.activeForm).find("["+e.selectors.results+"]").html(a),e.toggleLoading(!1)},e.toggleLoading=function(a){var s=t(e.activeForm).find("["+e.selectors.loadingIndicator+"]"),n=t(e.activeForm).find("["+e.selectors.noResults+"]");t(n).hide(),a?t(s).show():t(s).hide()},e.bindEvents()};(NestedPages=NestedPages||{}).MovePost=function(){var e=this,t=jQuery;return e.formatter=new NestedPages.Formatter,e.nesting=new NestedPages.Nesting,e.activeRow,e.selectors={moveToTop:"data-push-to-top",moveToBottom:"data-push-to-bottom"},e.bindEvents=function(){t(document).ready(function(){e.disableTopOnFirst(),e.disableBottomOnLast()}),t(document).on("click","["+e.selectors.moveToTop+"]",function(a){a.preventDefault(),t(this).hasClass("disabled")||(e.activeRow=t(this).closest(NestedPages.selectors.rows),e.moveToTop())}),t(document).on("click","["+e.selectors.moveToBottom+"]",function(a){a.preventDefault(),t(this).hasClass("disabled")||(e.activeRow=t(this).closest(NestedPages.selectors.rows),e.moveToBottom())})},e.moveToTop=function(){var a=t(e.activeRow).parent(NestedPages.selectors.lists),s=t(a).find(NestedPages.selectors.rows).first();t(e.activeRow).insertBefore(s),e.formatter.setBorders(),t(document).click(),e.nesting.syncNesting(),e.disableTopOnFirst(),e.disableBottomOnLast()},e.moveToBottom=function(){var a=t(e.activeRow).parent(NestedPages.selectors.lists),s=t(a).children(NestedPages.selectors.rows).last();t(e.activeRow).insertAfter(s),e.formatter.setBorders(),t(document).click(),e.nesting.syncNesting(),e.disableTopOnFirst(),e.disableBottomOnLast()},e.disableTopOnFirst=function(){var a=t(NestedPages.selectors.lists);t.each(a,function(){t(this).find("["+e.selectors.moveToTop+"]").removeClass("disabled");var a=t(this).find(NestedPages.selectors.rows).first();t(a).find("["+e.selectors.moveToTop+"]").addClass("disabled")})},e.disableBottomOnLast=function(){var a=t(NestedPages.selectors.lists);t.each(a,function(){t(this).find("["+e.selectors.moveToBottom+"]").removeClass("disabled");var a=t(this).find(NestedPages.selectors.rows).last();t(a).find("["+e.selectors.moveToBottom+"]").addClass("disabled")})},e.bindEvents()};var NestedPages;(NestedPages=NestedPages||{}).Wpml=function(){var e=this,t=jQuery;return e.button=null,e.postData=null,e.modal=null,e.parent_li=null,e.formatter=new NestedPages.Formatter,e.selectors={translationsBtn:"data-nestedpages-translations",modal:"data-np-wpml-translations-modal",title:"data-wmpl-translation-title",table:"data-np-wpml-translations-modal-table"},e.bindEvents=function(){nestedpages.wpml&&t(document).on("click","["+e.selectors.translationsBtn+"]",function(a){a.preventDefault(),e.createTranslationsModal(t(this))})},e.createTranslationsModal=function(a){if(e.parent_li=t(a).parents(".action-buttons").closest(NestedPages.selectors.row).parent("li"),e.button=t(e.parent_li).find(NestedPages.selectors.quickEditOpen),e.postData={id:t(e.button).attr("data-id"),title:t(e.button).attr("data-title"),slug:t(e.button).attr("data-slug")},e.modal=t("["+e.selectors.modal+"]").clone(),t(e.parent_li).children("ol").length>0){var s=t(e.parent_li).children("ol");t(e.modal).insertBefore(s)}else t(e.modal).appendTo(e.parent_li);t(e.modal).find("["+e.selectors.title+"]").text(e.postData.title),e.formatter.showQuickEdit(),t(e.modal).show(),e.getTranslationData()},e.getTranslationData=function(){t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.wpmlTranslations,post_id:e.postData.id,nonce:NestedPages.jsData.nonce},success:function(a){console.log(a),console.log(e.postData.id),"success"===a.status?e.populateModal(a.translations):(t(e.modal).find(NestedPages.selectors.quickEditErrorDiv).text(a.message).show(),e.toggleLoading(!1))}})},e.populateModal=function(a){var s="<tbody>";t.each(a,function(e,t){var n=a[e];s+="<tr>",s+='<td><img src="'+n.country_flag_url+'" alt="'+n.translated_name+'" /> '+n.translated_name+"</td>",s+="<td>",n.has_translation&&n.edit_link?s+='<a href="'+n.edit_link+'">'+n.translation.post_title+" ("+nestedpages.edit+")</a>":s+='<a href="'+n.add_link+'" class="np-btn">+ '+nestedpages.add_translation+"</a>",s+="</td>",s+="</tr>"}),s+="</tbody>",t(e.modal).find("["+e.selectors.table+"]").html(s),e.toggleLoading(!1)},e.toggleLoading=function(a){a?t(e.modal).addClass("loading"):t(e.modal).removeClass("loading")},e.bindEvents()};
assets/js/nestedpages.settings.min.js CHANGED
@@ -1 +1 @@
1
- var NestedPages=NestedPages||{};NestedPages.SettingsReset=function(){var e=this,t=jQuery;return e.selectors={resetButton:"data-nestedpages-reset-settings",resetForm:".nestedpages-reset-settings",formComplete:".nestedpages-reset-settings-complete"},e.bindEvents=function(){t(document).on("click","["+e.selectors.resetButton+"]",function(t){t.preventDefault(),e.resetSettings()})},e.resetSettings=function(){e.loading(!0),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.resetSettings,nonce:NestedPages.jsData.nonce},success:function(s){e.loading(!1),t(e.selectors.resetForm).hide(),t(e.selectors.formComplete).show(),"success"!==s.status&&console.log("There was an error saving toggled pages.")}})},e.loading=function(s){s?t("["+e.selectors.resetButton+"]").attr("disabled",!0):t("["+e.selectors.resetButton+"]").removeAttr("disabled")},e.bindEvents()},new NestedPages.SettingsReset,(NestedPages=NestedPages||{}).Settings=function(){var e=this,t=jQuery;return e.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]"},e.bindEvents=function(){t(document).ready(function(){e.toggleAllSettingsButtons(),e.toogleAllFieldSettings(".custom-fields"),e.toogleAllFieldSettings(".standard-fields"),e.toggleMenuCheckboxes(),e.toggleHideCheckbox(),e.toggleAssignPostType()}),t(document).on("click",e.selectors.postTypeToggle,function(s){s.preventDefault(),e.toggleRow(t(this))}),t(document).on("change",e.selectors.postTypeCheckbox,function(){e.toggleSettingsButton(t(this))}),t(document).on("change",e.selectors.customFieldsCheckbox,function(){e.toogleFieldSettings(t(this),".custom-fields")}),t(document).on("change",e.selectors.standardFieldsCheckbox,function(){e.toogleFieldSettings(t(this),".standard-fields")}),t(document).on("change",e.selectors.taxonomiesFieldCheckbox,function(){e.toggleTaxonomyCheckboxes(t(this))}),t(document).on("change",e.selectors.thumbnailsCheckbox,function(){e.toggleThumbnailSettings(t(this))}),t(document).on("change",e.selectors.disableMenuCheckbox,function(){e.toggleMenuCheckboxes()}),t(document).on("change",e.selectors.disableAutoCheckbox,function(){e.toggleHideCheckbox()}),t(document).on("change",e.selectors.assignPostTypeCheckbox,function(){e.toggleAssignPostType()}),t(document).on("click",e.selectors.assignPostTypeOption,function(s){s.preventDefault(),e.chooseAssignPostType(t(this))}),t(document).on("click",e.selectors.assignPostTypeRemove,function(s){s.preventDefault(),e.removeAssignPostType(t(this))})},e.toggleRow=function(e){t(e).parent(".head").siblings(".body").toggle(),t(e).parents(".row-container").toggleClass("active")},e.toggleSettingsButton=function(s){var n=t(s).parents(".head").find(e.selectors.postTypeToggle);if(t(s).is(":checked"))return t(n).show(),void t(n).parents(".head").siblings(".body").find('input[type="hidden"]').attr("disabled",!1);t(n).hide(),t(n).parents(".head").siblings(".body").hide(),t(n).parents(".row-container").removeClass("active"),t(n).parents(".head").siblings(".body").find('input[type="checkbox"]').attr("checked",!1),t(n).parents(".head").siblings(".body").find('input[type="hidden"]').attr("disabled",!0),t(n).parents(".head").siblings(".body").find("select").val(!1)},e.toggleAllSettingsButtons=function(){var s=t(e.selectors.postTypeCheckbox);t.each(s,function(){e.toggleSettingsButton(t(this))})},e.toogleFieldSettings=function(e,s){var n=t(e).parents(".body").find(s);t(e).is(":checked")?t(n).show():t(n).hide()},e.toogleAllFieldSettings=function(s){n=t(e.selectors.customFieldsCheckbox);if(".standard-fields"==s)var n=t(e.selectors.standardFieldsCheckbox);t.each(n,function(){e.toogleFieldSettings(t(this),s)})},e.toggleTaxonomyCheckboxes=function(e){var s=t(e).parents("ul").find(t("*[data-taxonomy-single]"));t(e).is(":checked")?t(s).hide():t(s).show()},e.toggleThumbnailSettings=function(e){var s=t(e).parents(".field").find(t("*[data-thumbnail-options]"));t(e).is(":checked")?t(s).show():t(s).hide()},e.toggleMenuCheckboxes=function(){var s=t(e.selectors.disableMenuCheckbox),n=t(e.selectors.menuEnabledOption);t(s).is(":checked")?t(n).hide():t(n).show()},e.toggleHideCheckbox=function(){var s=t(e.selectors.disableAutoCheckbox),n=t("[data-menu-hide-checkbox]");t(s).is(":checked")?t(n).hide():t(n).show()},e.toggleAssignPostType=function(){var s=t(e.selectors.assignPostTypeCheckbox);t.each(s,function(){var e=t(this),s=t(this).parents(".field").find(".nestedpages-assignment-display");t(e).is(":checked")?t(s).show():t(s).hide()})},e.chooseAssignPostType=function(s){var n=t(s).attr("data-assignment-page-id"),o=t(s).attr("data-assignment-page-title"),i=t(s).parents(".field"),a=nestedpages.currently_assigned_to+" "+o+' <a href="#" data-nestedpages-page-pt-assignment-remove>('+nestedpages.remove+")</a>";t(i).find(e.selectors.assignPostTypeId).val(n),t(i).find(e.selectors.assignPostTypeTitle).val(o),t(i).find(e.selectors.assignPostTypeSelection).html(a).show(),t(i).find("[data-nestedpages-post-search-form]").hide()},e.removeAssignPostType=function(s){var n=t(s).parents(".field");t(n).find(e.selectors.assignPostTypeSelection).hide(),t(n).find("[data-nestedpages-post-search-form]").show(),t(n).find(e.selectors.assignPostTypeId).val(""),t(n).find(e.selectors.assignPostTypeTitle).val("")},e.init=function(){e.bindEvents()},e.init()},new NestedPages.Settings;
1
+ NestedPages=NestedPages||{};NestedPages.SettingsReset=function(){var e=this,t=jQuery;return e.selectors={resetButton:"data-nestedpages-reset-settings",resetForm:".nestedpages-reset-settings",formComplete:".nestedpages-reset-settings-complete"},e.bindEvents=function(){t(document).on("click","["+e.selectors.resetButton+"]",function(t){t.preventDefault(),e.resetSettings()})},e.resetSettings=function(){e.loading(!0),t.ajax({url:NestedPages.jsData.ajaxurl,type:"post",datatype:"json",data:{action:NestedPages.formActions.resetSettings,nonce:NestedPages.jsData.nonce},success:function(s){e.loading(!1),t(e.selectors.resetForm).hide(),t(e.selectors.formComplete).show(),"success"!==s.status&&console.log("There was an error saving toggled pages.")}})},e.loading=function(s){s?t("["+e.selectors.resetButton+"]").attr("disabled",!0):t("["+e.selectors.resetButton+"]").removeAttr("disabled")},e.bindEvents()},new NestedPages.SettingsReset;var NestedPages;(NestedPages=NestedPages||{}).Settings=function(){var e=this,t=jQuery;return e.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]"},e.bindEvents=function(){t(document).ready(function(){e.toggleAllSettingsButtons(),e.toogleAllFieldSettings(".custom-fields"),e.toogleAllFieldSettings(".standard-fields"),e.toggleMenuCheckboxes(),e.toggleHideCheckbox(),e.toggleAssignPostType(),e.toggleAllDefaultSortOptions()}),t(document).on("click",e.selectors.postTypeToggle,function(s){s.preventDefault(),e.toggleRow(t(this))}),t(document).on("change",e.selectors.postTypeCheckbox,function(){e.toggleSettingsButton(t(this))}),t(document).on("change",e.selectors.customFieldsCheckbox,function(){e.toogleFieldSettings(t(this),".custom-fields")}),t(document).on("change",e.selectors.standardFieldsCheckbox,function(){e.toogleFieldSettings(t(this),".standard-fields")}),t(document).on("change",e.selectors.taxonomiesFieldCheckbox,function(){e.toggleTaxonomyCheckboxes(t(this))}),t(document).on("change",e.selectors.thumbnailsCheckbox,function(){e.toggleThumbnailSettings(t(this))}),t(document).on("change",e.selectors.disableMenuCheckbox,function(){e.toggleMenuCheckboxes()}),t(document).on("change",e.selectors.disableAutoCheckbox,function(){e.toggleHideCheckbox()}),t(document).on("change",e.selectors.assignPostTypeCheckbox,function(){e.toggleAssignPostType()}),t(document).on("click",e.selectors.assignPostTypeOption,function(s){s.preventDefault(),e.chooseAssignPostType(t(this))}),t(document).on("click",e.selectors.assignPostTypeRemove,function(s){s.preventDefault(),e.removeAssignPostType(t(this))}),t(document).on("change",e.selectors.sortOptionCheckbox,function(){e.toggleDefaultSortOptions(t(this))})},e.toggleRow=function(e){t(e).parent(".head").siblings(".body").toggle(),t(e).parents(".row-container").toggleClass("active")},e.toggleSettingsButton=function(s){var o=t(s).parents(".head").find(e.selectors.postTypeToggle);if(t(s).is(":checked"))return t(o).show(),void t(o).parents(".head").siblings(".body").find('input[type="hidden"]').attr("disabled",!1);t(o).hide(),t(o).parents(".head").siblings(".body").hide(),t(o).parents(".row-container").removeClass("active"),t(o).parents(".head").siblings(".body").find('input[type="checkbox"]').attr("checked",!1),t(o).parents(".head").siblings(".body").find('input[type="hidden"]').attr("disabled",!0),t(o).parents(".head").siblings(".body").find("select").val(!1)},e.toggleAllSettingsButtons=function(){var s=t(e.selectors.postTypeCheckbox);t.each(s,function(){e.toggleSettingsButton(t(this))})},e.toogleFieldSettings=function(e,s){var o=t(e).parents(".body").find(s);t(e).is(":checked")?t(o).show():t(o).hide()},e.toogleAllFieldSettings=function(s){o=t(e.selectors.customFieldsCheckbox);if(".standard-fields"==s)var o=t(e.selectors.standardFieldsCheckbox);t.each(o,function(){e.toogleFieldSettings(t(this),s)})},e.toggleTaxonomyCheckboxes=function(e){var s=t(e).parents("ul").find(t("*[data-taxonomy-single]"));t(e).is(":checked")?t(s).hide():t(s).show()},e.toggleThumbnailSettings=function(e){var s=t(e).parents(".field").find(t("*[data-thumbnail-options]"));t(e).is(":checked")?t(s).show():t(s).hide()},e.toggleMenuCheckboxes=function(){var s=t(e.selectors.disableMenuCheckbox),o=t(e.selectors.menuEnabledOption);t(s).is(":checked")?t(o).hide():t(o).show()},e.toggleHideCheckbox=function(){var s=t(e.selectors.disableAutoCheckbox),o=t("[data-menu-hide-checkbox]");t(s).is(":checked")?t(o).hide():t(o).show()},e.toggleAssignPostType=function(){var s=t(e.selectors.assignPostTypeCheckbox);t.each(s,function(){var e=t(this),s=t(this).parents(".field").find(".nestedpages-assignment-display");t(e).is(":checked")?t(s).show():t(s).hide()})},e.chooseAssignPostType=function(s){var o=t(s).attr("data-assignment-page-id"),n=t(s).attr("data-assignment-page-title"),i=t(s).parents(".field"),a=nestedpages.currently_assigned_to+" "+n+' <a href="#" data-nestedpages-page-pt-assignment-remove>('+nestedpages.remove+")</a>";t(i).find(e.selectors.assignPostTypeId).val(o),t(i).find(e.selectors.assignPostTypeTitle).val(n),t(i).find(e.selectors.assignPostTypeSelection).html(a).show(),t(i).find("[data-nestedpages-post-search-form]").hide()},e.removeAssignPostType=function(s){var o=t(s).parents(".field");t(o).find(e.selectors.assignPostTypeSelection).hide(),t(o).find("[data-nestedpages-post-search-form]").show(),t(o).find(e.selectors.assignPostTypeId).val(""),t(o).find(e.selectors.assignPostTypeTitle).val("")},e.toggleAllDefaultSortOptions=function(){var s=t(e.selectors.sortOptionCheckbox);t.each(s,function(){e.toggleDefaultSortOptions(t(this))})},e.toggleDefaultSortOptions=function(s){var o=!!t(s).is(":checked"),n=t(s).parent("label").next(e.selectors.defaultSortOptions);t(n).length<1||(o?t(n).show():t(n).hide())},e.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: 2.0.4
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: wp-nested-pages
@@ -12,7 +12,7 @@ License: GPLv2 or later.
12
  Copyright: Kyle Phillips
13
  */
14
 
15
- /* Copyright 2017 Kyle Phillips (email : support@nestedpages.com)
16
 
17
  This program is free software; you can redistribute it and/or modify
18
  it under the terms of the GNU General Public License, version 2, as
@@ -32,7 +32,7 @@ Copyright: Kyle Phillips
32
  * Check Wordpress and PHP versions before instantiating plugin
33
  */
34
  register_activation_hook( __FILE__, 'nestedpages_check_versions' );
35
- function nestedpages_check_versions( $wp = '3.9', $php = '5.3.2' ) {
36
  global $wp_version;
37
  if ( version_compare( PHP_VERSION, $php, '<' ) ) $flag = 'PHP';
38
  elseif ( version_compare( $wp_version, $wp, '<' ) ) $flag = 'WordPress';
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.0.1
7
  Author: Kyle Phillips
8
  Author URI: https://github.com/kylephillips
9
  Text Domain: wp-nested-pages
12
  Copyright: Kyle Phillips
13
  */
14
 
15
+ /* Copyright 2018 Kyle Phillips (email : support@nestedpages.com)
16
 
17
  This program is free software; you can redistribute it and/or modify
18
  it under the terms of the GNU General Public License, version 2, as
32
  * Check Wordpress and PHP versions before instantiating plugin
33
  */
34
  register_activation_hook( __FILE__, 'nestedpages_check_versions' );
35
+ function nestedpages_check_versions( $wp = '3.9', $php = '5.4.0' ) {
36
  global $wp_version;
37
  if ( version_compare( PHP_VERSION, $php, '<' ) ) $flag = 'PHP';
38
  elseif ( version_compare( $wp_version, $wp, '<' ) ) $flag = 'WordPress';
readme.txt CHANGED
@@ -4,7 +4,8 @@ Donate link: http://nestedpages.com/
4
  Tags: pages, admin, nested, tree view, page tree, sort, quick edit, structure
5
  Requires at least: 3.8
6
  Tested up to: 4.9
7
- Stable tag: 2.0.3
 
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -24,7 +25,7 @@ Nested Pages provides a drag and drop interface for managing pages & posts in th
24
 
25
  For more information visit [nestedpages.com](http://nestedpages.com).
26
 
27
- **Important: Nested Pages requires WordPress version 3.8 or higher, and PHP version 5.3.2 or higher.**
28
 
29
  **Languages:**
30
 
@@ -98,6 +99,23 @@ As of version 1.6, yes. Visit Settings > Nested Pages > Post Types to configure
98
 
99
  == Changelog ==
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  = 2.0.4 =
102
  * Fixes PHP warning if a search is performed with only one result when WP_DEBUG is enabled.
103
  * Fixes "undefined variable: c" PHP warning on some installs when WP_DEBUG is enabled.
4
  Tags: pages, admin, nested, tree view, page tree, sort, quick edit, structure
5
  Requires at least: 3.8
6
  Tested up to: 4.9
7
+ Requires PHP: 5.4
8
+ Stable tag: 2.0.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
25
 
26
  For more information visit [nestedpages.com](http://nestedpages.com).
27
 
28
+ **Important: Nested Pages requires WordPress version 3.8 or higher, and PHP version 5.4 or higher.**
29
 
30
  **Languages:**
31
 
99
 
100
  == Changelog ==
101
 
102
+ = 3.1.0 =
103
+ * Breaking Change: PHP Version 5.4.0+ is required to run Nested Pages V3+.
104
+ * Parent field added to bulk edit under hierarchical post types.
105
+ * Fixes HTML Validation where invalid rel attribute error was being thrown on custom link items.
106
+ * Fixes bug where filtering by taxonomy did not work.
107
+ * Adds error handling for existing nav menu with the name “Nested Pages”, preventing WP_Error object from saving in the database which causes a fatal error in some instances.
108
+ * Adds support for custom post states, using the display_post_states filter (Ex: Showing a WooCommerce - Checkout Page designator).
109
+ * Adds support for custom row actions using the post_row_actions and page_row_actions filters.
110
+ * Adds new feature for inserting new posts before/after a selected post.
111
+ * Adds new option to set a default "order by" and "order" parameter for post types, including pages. Visit the post type settings tab in the plugin settings to enable (Note: Sorting/nesting will not be available when viewing the lists in any combination other than menu_order/ascending).
112
+ * Fixes issue where disabling nesting of a post type was not working.
113
+ * Adds template names as CSS classes for custom row styling.
114
+ * Adds enhancements to the user interface.
115
+ * Removes capability to nest a page underneath a link, preventing broken links.
116
+ * Fixes issue where meta values were not being saved during cloning, when the source post contained multiple entries with the same meta_key.
117
+ * Fixes bug where new page modals were not displaying when WPML was installed.
118
+
119
  = 2.0.4 =
120
  * Fixes PHP warning if a search is performed with only one result when WP_DEBUG is enabled.
121
  * Fixes "undefined variable: c" PHP warning on some installs when WP_DEBUG is enabled.
vendor/composer/ClassLoader.php CHANGED
@@ -10,7 +10,7 @@
10
  * file that was distributed with this source code.
11
  */
12
 
13
- namespace Composer\Autoload;
14
 
15
  /**
16
  * ClassLoader implements a PSR-0 class loader
10
  * file that was distributed with this source code.
11
  */
12
 
13
+ namespace NestedPages\Composer\Autoload;
14
 
15
  /**
16
  * ClassLoader implements a PSR-0 class loader
vendor/composer/autoload_real.php CHANGED
@@ -8,7 +8,7 @@ class ComposerAutoloaderInit236886854fb2275d6b0b4224182e20cd
8
 
9
  public static function loadClassLoader($class)
10
  {
11
- if ('Composer\Autoload\ClassLoader' === $class) {
12
  require __DIR__ . '/ClassLoader.php';
13
  }
14
  }
@@ -20,7 +20,7 @@ class ComposerAutoloaderInit236886854fb2275d6b0b4224182e20cd
20
  }
21
 
22
  spl_autoload_register(array('ComposerAutoloaderInit236886854fb2275d6b0b4224182e20cd', 'loadClassLoader'), true, true);
23
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
  spl_autoload_unregister(array('ComposerAutoloaderInit236886854fb2275d6b0b4224182e20cd', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
8
 
9
  public static function loadClassLoader($class)
10
  {
11
+ if ('NestedPages\Composer\Autoload\ClassLoader' === $class) {
12
  require __DIR__ . '/ClassLoader.php';
13
  }
14
  }
20
  }
21
 
22
  spl_autoload_register(array('ComposerAutoloaderInit236886854fb2275d6b0b4224182e20cd', 'loadClassLoader'), true, true);
23
+ self::$loader = $loader = new \NestedPages\Composer\Autoload\ClassLoader();
24
  spl_autoload_unregister(array('ComposerAutoloaderInit236886854fb2275d6b0b4224182e20cd', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';