Version Description
To upgrade this plugin, remove the old version and replace with the new version. Or just click "Update" from the Plugins screen and let WordPress do it for you automatically.
Note: uninstalling the plugin from the WP Plugins screen results in the removal of all settings and data from the WP database.
Download this release
Release Info
Developer | specialk |
Plugin | Disable Gutenberg |
Version | 1.2 |
Comparing to | |
See all releases |
Code changes from version 1.1 to 1.2
- css/settings.css +1 -1
- disable-gutenberg.php +13 -8
- inc/classic-editor.php +168 -0
- inc/plugin-core.php +53 -7
- inc/resources-enqueue.php +2 -0
- inc/settings-register.php +41 -6
- js/settings.js +2 -2
- languages/disable-gutenberg.pot +204 -0
- lib/classic-editor/classic-edit-form-advanced.php +813 -0
- lib/classic-editor/css/edit-rtl.css +1573 -0
- lib/classic-editor/css/edit-rtl.min.css +2 -0
- lib/classic-editor/css/edit.css +1573 -0
- lib/classic-editor/css/edit.min.css +2 -0
- lib/classic-editor/js/autosave.js +857 -0
- lib/classic-editor/js/autosave.min.js +1 -0
- lib/classic-editor/js/editor-expand.js +1604 -0
- lib/classic-editor/js/editor-expand.min.js +1 -0
- lib/classic-editor/js/editor.js +1436 -0
- lib/classic-editor/js/editor.min.js +1 -0
- lib/classic-editor/js/post.js +1267 -0
- lib/classic-editor/js/post.min.js +1 -0
- lib/classic-editor/js/tags-box.js +263 -0
- lib/classic-editor/js/tags-box.min.js +1 -0
- lib/classic-editor/js/word-count.js +220 -0
- lib/classic-editor/js/word-count.min.js +1 -0
- readme.txt +48 -14
css/settings.css
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
.wp-admin .disable-gutenberg-version { display: inline-block; margin-left: 3px; color: #c7c7c7; font-size: 80%; text-shadow: 1px 1px 1px rgba(255,255,255,0.5); }
|
4 |
.wp-admin form h2 { margin-top: 30px; }
|
5 |
-
.wp-admin label { display: block; margin:
|
6 |
.wp-admin .inline-block { display: inline-block; }
|
7 |
.wp-admin abbr[title] { cursor: help !important; border-bottom: 1px dotted #dfdfdf !important; text-decoration: none !important; }
|
8 |
|
2 |
|
3 |
.wp-admin .disable-gutenberg-version { display: inline-block; margin-left: 3px; color: #c7c7c7; font-size: 80%; text-shadow: 1px 1px 1px rgba(255,255,255,0.5); }
|
4 |
.wp-admin form h2 { margin-top: 30px; }
|
5 |
+
.wp-admin label { display: block; margin: 3px 0 0 0; color: #777; font-size: 90%; font-style: italic; }
|
6 |
.wp-admin .inline-block { display: inline-block; }
|
7 |
.wp-admin abbr[title] { cursor: help !important; border-bottom: 1px dotted #dfdfdf !important; text-decoration: none !important; }
|
8 |
|
disable-gutenberg.php
CHANGED
@@ -6,12 +6,12 @@
|
|
6 |
Tags: gutenberg, disable, post types, g7g
|
7 |
Author: Jeff Starr
|
8 |
Author URI: https://plugin-planet.com/
|
9 |
-
Donate link: https://
|
10 |
Contributors: specialk
|
11 |
Requires at least: 4.5
|
12 |
-
Tested up to: 4.9
|
13 |
-
Stable tag: 1.
|
14 |
-
Version: 1.
|
15 |
Requires PHP: 5.2
|
16 |
Text Domain: disable-gutenberg
|
17 |
Domain Path: /languages
|
@@ -60,13 +60,13 @@ if (!class_exists('DisableGutenberg')) {
|
|
60 |
|
61 |
add_filter('gutenberg_can_edit_post_type', 'disable_gutenberg', 10, 2);
|
62 |
add_filter('admin_init', 'disable_gutenberg_disable_nag');
|
63 |
-
add_action('admin_menu', '
|
64 |
|
65 |
-
}
|
66 |
|
67 |
function constants() {
|
68 |
|
69 |
-
if (!defined('DISABLE_GUTENBERG_VERSION')) define('DISABLE_GUTENBERG_VERSION', '1.
|
70 |
if (!defined('DISABLE_GUTENBERG_REQUIRE')) define('DISABLE_GUTENBERG_REQUIRE', '4.5');
|
71 |
if (!defined('DISABLE_GUTENBERG_AUTHOR')) define('DISABLE_GUTENBERG_AUTHOR', 'Jeff Starr');
|
72 |
if (!defined('DISABLE_GUTENBERG_NAME')) define('DISABLE_GUTENBERG_NAME', __('Disable Gutenberg', 'disable-gutenberg'));
|
@@ -80,6 +80,8 @@ if (!class_exists('DisableGutenberg')) {
|
|
80 |
|
81 |
function includes() {
|
82 |
|
|
|
|
|
83 |
if (is_admin()) {
|
84 |
|
85 |
require_once DISABLE_GUTENBERG_DIR .'inc/plugin-core.php';
|
@@ -99,6 +101,9 @@ if (!class_exists('DisableGutenberg')) {
|
|
99 |
'disable-all' => 1,
|
100 |
'disable-nag' => 1,
|
101 |
'hide-menu' => 0,
|
|
|
|
|
|
|
102 |
|
103 |
);
|
104 |
|
@@ -148,7 +153,7 @@ if (!class_exists('DisableGutenberg')) {
|
|
148 |
$rate_title = esc_attr__('Click here to rate and review this plugin on WordPress.org', 'disable-gutenberg');
|
149 |
$rate_text = esc_html__('Rate this plugin', 'disable-gutenberg') .' »';
|
150 |
|
151 |
-
$links[] = '<a target="_blank" href="'. $rate_href .'" title="'. $rate_title .'">'. $rate_text .'</a>';
|
152 |
|
153 |
}
|
154 |
|
6 |
Tags: gutenberg, disable, post types, g7g
|
7 |
Author: Jeff Starr
|
8 |
Author URI: https://plugin-planet.com/
|
9 |
+
Donate link: https://monzillamedia.com/donate.html
|
10 |
Contributors: specialk
|
11 |
Requires at least: 4.5
|
12 |
+
Tested up to: 4.9.8
|
13 |
+
Stable tag: 1.2
|
14 |
+
Version: 1.2
|
15 |
Requires PHP: 5.2
|
16 |
Text Domain: disable-gutenberg
|
17 |
Domain Path: /languages
|
60 |
|
61 |
add_filter('gutenberg_can_edit_post_type', 'disable_gutenberg', 10, 2);
|
62 |
add_filter('admin_init', 'disable_gutenberg_disable_nag');
|
63 |
+
add_action('admin_menu', 'disable_gutenberg_menu_items', 999);
|
64 |
|
65 |
+
}
|
66 |
|
67 |
function constants() {
|
68 |
|
69 |
+
if (!defined('DISABLE_GUTENBERG_VERSION')) define('DISABLE_GUTENBERG_VERSION', '1.2');
|
70 |
if (!defined('DISABLE_GUTENBERG_REQUIRE')) define('DISABLE_GUTENBERG_REQUIRE', '4.5');
|
71 |
if (!defined('DISABLE_GUTENBERG_AUTHOR')) define('DISABLE_GUTENBERG_AUTHOR', 'Jeff Starr');
|
72 |
if (!defined('DISABLE_GUTENBERG_NAME')) define('DISABLE_GUTENBERG_NAME', __('Disable Gutenberg', 'disable-gutenberg'));
|
80 |
|
81 |
function includes() {
|
82 |
|
83 |
+
require_once DISABLE_GUTENBERG_DIR .'inc/classic-editor.php';
|
84 |
+
|
85 |
if (is_admin()) {
|
86 |
|
87 |
require_once DISABLE_GUTENBERG_DIR .'inc/plugin-core.php';
|
101 |
'disable-all' => 1,
|
102 |
'disable-nag' => 1,
|
103 |
'hide-menu' => 0,
|
104 |
+
'hide-gut' => 0,
|
105 |
+
'templates' => '',
|
106 |
+
'post-ids' => '',
|
107 |
|
108 |
);
|
109 |
|
153 |
$rate_title = esc_attr__('Click here to rate and review this plugin on WordPress.org', 'disable-gutenberg');
|
154 |
$rate_text = esc_html__('Rate this plugin', 'disable-gutenberg') .' »';
|
155 |
|
156 |
+
$links[] = '<a target="_blank" rel="noopener noreferrer" href="'. $rate_href .'" title="'. $rate_title .'">'. $rate_text .'</a>';
|
157 |
|
158 |
}
|
159 |
|
inc/classic-editor.php
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php // Classic Editor
|
2 |
+
|
3 |
+
if (!defined('ABSPATH')) exit;
|
4 |
+
|
5 |
+
function disable_gutenberg_is_gutenberg_active() {
|
6 |
+
|
7 |
+
if (
|
8 |
+
in_array('gutenberg/gutenberg.php', (array) get_option('active_plugins')) ||
|
9 |
+
(is_multisite() && array_key_exists('gutenberg/gutenberg.php', (array) get_site_option('active_sitewide_plugins'))) ||
|
10 |
+
has_filter('load-post.php', 'gutenberg_intercept_edit_post') ||
|
11 |
+
has_filter('replace_editor', 'gutenberg_init')
|
12 |
+
) {
|
13 |
+
|
14 |
+
return true;
|
15 |
+
|
16 |
+
}
|
17 |
+
|
18 |
+
return false;
|
19 |
+
|
20 |
+
}
|
21 |
+
|
22 |
+
function disable_gutenberg_init_actions() {
|
23 |
+
|
24 |
+
if (!disable_gutenberg_is_gutenberg_active()) return;
|
25 |
+
|
26 |
+
// Gutenberg plugin: remove the "Classic editor" row actions
|
27 |
+
remove_action('admin_init', 'gutenberg_add_edit_link_filters');
|
28 |
+
|
29 |
+
// gutenberg.php
|
30 |
+
remove_action('admin_menu', 'gutenberg_menu');
|
31 |
+
remove_action('admin_notices', 'gutenberg_wordpress_version_notice');
|
32 |
+
remove_action('admin_init', 'gutenberg_redirect_demo');
|
33 |
+
remove_action('admin_print_scripts-edit.php', 'gutenberg_replace_default_add_new_button');
|
34 |
+
|
35 |
+
remove_filter('replace_editor', 'gutenberg_init');
|
36 |
+
remove_filter('admin_url', 'gutenberg_modify_add_new_button_url');
|
37 |
+
|
38 |
+
// lib/client-assets.php
|
39 |
+
remove_action('wp_enqueue_scripts', 'gutenberg_register_scripts_and_styles', 5);
|
40 |
+
remove_action('admin_enqueue_scripts', 'gutenberg_register_scripts_and_styles', 5);
|
41 |
+
remove_action('wp_enqueue_scripts', 'gutenberg_common_scripts_and_styles');
|
42 |
+
remove_action('admin_enqueue_scripts', 'gutenberg_common_scripts_and_styles');
|
43 |
+
|
44 |
+
// lib/compat.php
|
45 |
+
remove_filter('wp_refresh_nonces', 'gutenberg_add_rest_nonce_to_heartbeat_response_headers');
|
46 |
+
|
47 |
+
// lib/plugin-compat.php
|
48 |
+
remove_filter('rest_pre_insert_post', 'gutenberg_remove_wpcom_markdown_support');
|
49 |
+
|
50 |
+
// lib/register.php
|
51 |
+
remove_action('plugins_loaded', 'gutenberg_trick_plugins_into_registering_meta_boxes');
|
52 |
+
remove_action('edit_form_top', 'gutenberg_remember_classic_editor_when_saving_posts');
|
53 |
+
|
54 |
+
remove_filter('redirect_post_location', 'gutenberg_redirect_to_classic_editor_when_saving_posts');
|
55 |
+
remove_filter('get_edit_post_link', 'gutenberg_revisions_link_to_editor');
|
56 |
+
remove_filter('wp_prepare_revision_for_js', 'gutenberg_revisions_restore');
|
57 |
+
remove_filter('display_post_states', 'gutenberg_add_gutenberg_post_state');
|
58 |
+
|
59 |
+
// lib/rest-api.php
|
60 |
+
remove_action('rest_api_init', 'gutenberg_register_rest_routes');
|
61 |
+
remove_action('rest_api_init', 'gutenberg_add_taxonomy_visibility_field');
|
62 |
+
|
63 |
+
remove_filter('rest_request_after_callbacks', 'gutenberg_filter_oembed_result');
|
64 |
+
remove_filter('registered_post_type', 'gutenberg_register_post_prepare_functions');
|
65 |
+
remove_filter('registered_taxonomy', 'gutenberg_register_taxonomy_prepare_functions');
|
66 |
+
remove_filter('rest_index', 'gutenberg_ensure_wp_json_has_theme_supports');
|
67 |
+
remove_filter('rest_request_before_callbacks', 'gutenberg_handle_early_callback_checks');
|
68 |
+
remove_filter('rest_user_collection_params', 'gutenberg_filter_user_collection_parameters');
|
69 |
+
remove_filter('rest_request_after_callbacks', 'gutenberg_filter_request_after_callbacks');
|
70 |
+
|
71 |
+
// lib/meta-box-partial-page.php
|
72 |
+
remove_action('do_meta_boxes', 'gutenberg_meta_box_save', 1000);
|
73 |
+
remove_action('submitpost_box', 'gutenberg_intercept_meta_box_render');
|
74 |
+
remove_action('submitpage_box', 'gutenberg_intercept_meta_box_render');
|
75 |
+
remove_action('edit_page_form', 'gutenberg_intercept_meta_box_render');
|
76 |
+
remove_action('edit_form_advanced', 'gutenberg_intercept_meta_box_render');
|
77 |
+
|
78 |
+
remove_filter('redirect_post_location', 'gutenberg_meta_box_save_redirect');
|
79 |
+
remove_filter('filter_gutenberg_meta_boxes', 'gutenberg_filter_meta_boxes');
|
80 |
+
|
81 |
+
// Keep
|
82 |
+
|
83 |
+
// lib/blocks.php
|
84 |
+
// remove_filter('the_content', 'do_blocks', 9);
|
85 |
+
|
86 |
+
// Continue to disable wpautop inside TinyMCE for posts that were started in Gutenberg
|
87 |
+
// remove_filter('wp_editor_settings', 'gutenberg_disable_editor_settings_wpautop');
|
88 |
+
|
89 |
+
// Keep the tweaks to the PHP wpautop
|
90 |
+
// add_filter('the_content', 'wpautop');
|
91 |
+
// remove_filter('the_content', 'gutenberg_wpautop', 8);
|
92 |
+
|
93 |
+
// remove_action('init', 'gutenberg_register_post_types');
|
94 |
+
|
95 |
+
add_filter('replace_editor', 'disable_gutenberg_replace');
|
96 |
+
|
97 |
+
}
|
98 |
+
|
99 |
+
function disable_gutenberg_replace($return) {
|
100 |
+
|
101 |
+
if (true === $return) return $return;
|
102 |
+
|
103 |
+
$suffix = SCRIPT_DEBUG ? '' : '.min';
|
104 |
+
$js_url = plugin_dir_url(__FILE__) . 'js/';
|
105 |
+
$css_url = plugin_dir_url(__FILE__) . 'css/';
|
106 |
+
|
107 |
+
// Enqueued conditionally from legacy-edit-form-advanced.php
|
108 |
+
wp_register_script('editor-expand', $js_url . "editor-expand$suffix.js", array('jquery', 'underscore'), false, 1);
|
109 |
+
|
110 |
+
// The dependency 'tags-suggest' is also needed for 'inline-edit-post', not included
|
111 |
+
wp_register_script('tags-box', $js_url . "tags-box$suffix.js", array('jquery', 'tags-suggest'), false, 1);
|
112 |
+
wp_register_script('word-count', $js_url . "word-count$suffix.js", array(), false, 1);
|
113 |
+
|
114 |
+
// The dependency 'heartbeat' is also loaded on most wp-admin screens, not included
|
115 |
+
wp_register_script('autosave', $js_url . "autosave$suffix.js", array('heartbeat'), false, 1);
|
116 |
+
wp_localize_script('autosave', 'autosaveL10n', array(
|
117 |
+
'autosaveInterval' => AUTOSAVE_INTERVAL,
|
118 |
+
'blog_id' => get_current_blog_id(),
|
119 |
+
));
|
120 |
+
|
121 |
+
wp_enqueue_script('post', $js_url . "post$suffix.js", array(
|
122 |
+
// 'suggest', // deprecated
|
123 |
+
'tags-box', // included
|
124 |
+
'word-count', // included
|
125 |
+
'autosave', // included
|
126 |
+
'wp-lists', // not included, also dependency for 'admin-comments', 'link', and 'nav-menu'.
|
127 |
+
'postbox', // not included, also dependency for 'link', 'comment', 'dashboard', and 'nav-menu'.
|
128 |
+
'underscore', // not included, library
|
129 |
+
'wp-a11y', // not included, library
|
130 |
+
), false, 1);
|
131 |
+
|
132 |
+
wp_localize_script('post', 'postL10n', array(
|
133 |
+
'ok' => __('OK', 'classic-editor'),
|
134 |
+
'cancel' => __('Cancel', 'classic-editor'),
|
135 |
+
'publishOn' => __('Publish on:', 'classic-editor'),
|
136 |
+
'publishOnFuture' => __('Schedule for:', 'classic-editor'),
|
137 |
+
'publishOnPast' => __('Published on:', 'classic-editor'),
|
138 |
+
/* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
|
139 |
+
'dateFormat' => __('%1$s %2$s, %3$s @ %4$s:%5$s', 'classic-editor'),
|
140 |
+
'showcomm' => __('Show more comments', 'classic-editor'),
|
141 |
+
'endcomm' => __('No more comments found.', 'classic-editor'),
|
142 |
+
'publish' => __('Publish', 'classic-editor'),
|
143 |
+
'schedule' => __('Schedule', 'classic-editor'),
|
144 |
+
'update' => __('Update', 'classic-editor'),
|
145 |
+
'savePending' => __('Save as Pending', 'classic-editor'),
|
146 |
+
'saveDraft' => __('Save Draft', 'classic-editor'),
|
147 |
+
'private' => __('Private', 'classic-editor'),
|
148 |
+
'public' => __('Public', 'classic-editor'),
|
149 |
+
'publicSticky' => __('Public, Sticky', 'classic-editor'),
|
150 |
+
'password' => __('Password Protected', 'classic-editor'),
|
151 |
+
'privatelyPublished' => __('Privately Published', 'classic-editor'),
|
152 |
+
'published' => __('Published', 'classic-editor'),
|
153 |
+
'saveAlert' => __('The changes you made will be lost if you navigate away from this page.', 'classic-editor'),
|
154 |
+
'savingText' => __('Saving Draft…', 'classic-editor'),
|
155 |
+
'permalinkSaved' => __('Permalink saved', 'classic-editor'),
|
156 |
+
));
|
157 |
+
|
158 |
+
wp_enqueue_style('classic-edit', plugin_dir_url(__FILE__) . "css/edit$suffix.css");
|
159 |
+
|
160 |
+
// Other scripts and stylesheets:
|
161 |
+
// wp_enqueue_script('admin-comments') is a dependency for 'dashboard', also used in edit-comments.php.
|
162 |
+
// wp_enqueue_script('image-edit') and wp_enqueue_style('imgareaselect') are also used in media.php and media-upload.php.
|
163 |
+
|
164 |
+
include_once(DISABLE_GUTENBERG_DIR . 'lib/classic-editor/classic-edit-form-advanced.php');
|
165 |
+
|
166 |
+
return true;
|
167 |
+
|
168 |
+
}
|
inc/plugin-core.php
CHANGED
@@ -24,6 +24,10 @@ function disable_gutenberg($is_enabled, $post_type) {
|
|
24 |
|
25 |
}
|
26 |
|
|
|
|
|
|
|
|
|
27 |
return $is_enabled;
|
28 |
|
29 |
}
|
@@ -63,8 +67,6 @@ function disable_gutenberg_get_user_roles() {
|
|
63 |
|
64 |
function disable_gutenberg_get_enabled_user_roles() {
|
65 |
|
66 |
-
global $post;
|
67 |
-
|
68 |
$options = disable_gutenberg_get_options();
|
69 |
|
70 |
$array = array();
|
@@ -106,8 +108,6 @@ function disable_gutenberg_get_post_types() {
|
|
106 |
|
107 |
function disable_gutenberg_get_enabled_post_types() {
|
108 |
|
109 |
-
global $post;
|
110 |
-
|
111 |
$options = disable_gutenberg_get_options();
|
112 |
|
113 |
$array = array();
|
@@ -124,6 +124,50 @@ function disable_gutenberg_get_enabled_post_types() {
|
|
124 |
|
125 |
}
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
function disable_gutenberg_disable_nag() {
|
128 |
|
129 |
$options = disable_gutenberg_get_options();
|
@@ -134,12 +178,14 @@ function disable_gutenberg_disable_nag() {
|
|
134 |
|
135 |
}
|
136 |
|
137 |
-
function
|
138 |
|
139 |
$options = disable_gutenberg_get_options();
|
140 |
|
141 |
-
$
|
|
|
142 |
|
143 |
-
if ($
|
|
|
144 |
|
145 |
}
|
24 |
|
25 |
}
|
26 |
|
27 |
+
if (disable_gutenberg_disable_templates()) return false;
|
28 |
+
|
29 |
+
if (disable_gutenberg_disable_ids()) return false;
|
30 |
+
|
31 |
return $is_enabled;
|
32 |
|
33 |
}
|
67 |
|
68 |
function disable_gutenberg_get_enabled_user_roles() {
|
69 |
|
|
|
|
|
70 |
$options = disable_gutenberg_get_options();
|
71 |
|
72 |
$array = array();
|
108 |
|
109 |
function disable_gutenberg_get_enabled_post_types() {
|
110 |
|
|
|
|
|
111 |
$options = disable_gutenberg_get_options();
|
112 |
|
113 |
$array = array();
|
124 |
|
125 |
}
|
126 |
|
127 |
+
function disable_gutenberg_disable_templates() {
|
128 |
+
|
129 |
+
$excluded = array();
|
130 |
+
|
131 |
+
$template = '';
|
132 |
+
|
133 |
+
$post_id = isset($_GET['post']) ? intval($_GET['post']) : null;
|
134 |
+
|
135 |
+
if (is_admin() && !empty($post_id)) {
|
136 |
+
|
137 |
+
$options = disable_gutenberg_get_options();
|
138 |
+
|
139 |
+
$excluded = isset($options['templates']) ? $options['templates'] : null;
|
140 |
+
|
141 |
+
$excluded = array_map('trim', explode(',', $excluded));
|
142 |
+
|
143 |
+
$template = get_page_template_slug($post_id);
|
144 |
+
|
145 |
+
}
|
146 |
+
|
147 |
+
return in_array($template, $excluded);
|
148 |
+
|
149 |
+
}
|
150 |
+
|
151 |
+
function disable_gutenberg_disable_ids() {
|
152 |
+
|
153 |
+
$excluded = array();
|
154 |
+
|
155 |
+
$post_id = isset($_GET['post']) ? intval($_GET['post']) : null;
|
156 |
+
|
157 |
+
if (is_admin() && !empty($post_id)) {
|
158 |
+
|
159 |
+
$options = disable_gutenberg_get_options();
|
160 |
+
|
161 |
+
$excluded = isset($options['post-ids']) ? $options['post-ids'] : null;
|
162 |
+
|
163 |
+
$excluded = array_map('trim', explode(',', $excluded));
|
164 |
+
|
165 |
+
}
|
166 |
+
|
167 |
+
return in_array($post_id, $excluded);
|
168 |
+
|
169 |
+
}
|
170 |
+
|
171 |
function disable_gutenberg_disable_nag() {
|
172 |
|
173 |
$options = disable_gutenberg_get_options();
|
178 |
|
179 |
}
|
180 |
|
181 |
+
function disable_gutenberg_menu_items() {
|
182 |
|
183 |
$options = disable_gutenberg_get_options();
|
184 |
|
185 |
+
$hide_plugin = (isset($options['hide-menu']) && !empty($options['hide-menu'])) ? true : false;
|
186 |
+
$hide_gutenberg = (isset($options['hide-gut']) && !empty($options['hide-gut'])) ? true : false;
|
187 |
|
188 |
+
if ($hide_plugin) remove_submenu_page('options-general.php', 'disable-gutenberg');
|
189 |
+
if ($hide_gutenberg) remove_menu_page('gutenberg');
|
190 |
|
191 |
}
|
inc/resources-enqueue.php
CHANGED
@@ -6,6 +6,8 @@ function disable_gutenberg_enqueue_resources_admin() {
|
|
6 |
|
7 |
$screen = get_current_screen();
|
8 |
|
|
|
|
|
9 |
if (!property_exists($screen, 'id')) return;
|
10 |
|
11 |
if ($screen->id === 'settings_page_disable-gutenberg') {
|
6 |
|
7 |
$screen = get_current_screen();
|
8 |
|
9 |
+
if (!is_object($screen)) $screen = new stdClass();
|
10 |
+
|
11 |
if (!property_exists($screen, 'id')) return;
|
12 |
|
13 |
if ($screen->id === 'settings_page_disable-gutenberg') {
|
inc/settings-register.php
CHANGED
@@ -21,7 +21,9 @@ function disable_gutenberg_register_settings() {
|
|
21 |
add_settings_section('settings_1', 'Complete Disable', 'disable_gutenberg_settings_section_1', 'disable_gutenberg_options');
|
22 |
add_settings_section('settings_2', 'Disable for User Roles', 'disable_gutenberg_settings_section_2', 'disable_gutenberg_options');
|
23 |
add_settings_section('settings_3', 'Disable for Post Types', 'disable_gutenberg_settings_section_3', 'disable_gutenberg_options');
|
24 |
-
add_settings_section('settings_4', '
|
|
|
|
|
25 |
|
26 |
// add_settings_field( $id, $title, $callback, $page, $section, $args );
|
27 |
add_settings_field('disable-all', __('Complete Disable', 'disable-gutenberg'), 'disable_gutenberg_callback_checkbox', 'disable_gutenberg_options', 'settings_1', array('id' => 'disable-all', 'label' => esc_html__('Disable Gutenberg everywhere', 'disable-gutenberg')));
|
@@ -42,9 +44,14 @@ function disable_gutenberg_register_settings() {
|
|
42 |
|
43 |
}
|
44 |
|
45 |
-
add_settings_field('
|
46 |
-
add_settings_field('
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
}
|
50 |
|
@@ -80,6 +87,9 @@ function disable_gutenberg_validate_options($input) {
|
|
80 |
|
81 |
}
|
82 |
|
|
|
|
|
|
|
83 |
if (!isset($input['disable-all'])) $input['disable-all'] = null;
|
84 |
$input['disable-all'] = ($input['disable-all'] == 1 ? 1 : 0);
|
85 |
|
@@ -89,6 +99,9 @@ function disable_gutenberg_validate_options($input) {
|
|
89 |
if (!isset($input['hide-menu'])) $input['hide-menu'] = null;
|
90 |
$input['hide-menu'] = ($input['hide-menu'] == 1 ? 1 : 0);
|
91 |
|
|
|
|
|
|
|
92 |
return $input;
|
93 |
|
94 |
}
|
@@ -101,18 +114,30 @@ function disable_gutenberg_settings_section_1() {
|
|
101 |
|
102 |
function disable_gutenberg_settings_section_2() {
|
103 |
|
104 |
-
echo '<p>'. esc_html__('Select the user roles for which Gutenberg should be disabled.
|
105 |
|
106 |
}
|
107 |
|
108 |
function disable_gutenberg_settings_section_3() {
|
109 |
|
110 |
-
echo '<p>'. esc_html__('Select the post types for which Gutenberg should be disabled.
|
111 |
|
112 |
}
|
113 |
|
114 |
function disable_gutenberg_settings_section_4() {
|
115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
echo '<p class="g7g-display">'. esc_html__('Additional tools and options for handling Gutenberg.', 'disable-gutenberg') .'</p>';
|
117 |
|
118 |
}
|
@@ -175,3 +200,13 @@ function disable_gutenberg_callback_reset($args) {
|
|
175 |
echo '<a class="disable-gutenberg-reset-options" href="'. esc_url($href) .'">'. esc_html($label) .'</a>';
|
176 |
|
177 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
add_settings_section('settings_1', 'Complete Disable', 'disable_gutenberg_settings_section_1', 'disable_gutenberg_options');
|
22 |
add_settings_section('settings_2', 'Disable for User Roles', 'disable_gutenberg_settings_section_2', 'disable_gutenberg_options');
|
23 |
add_settings_section('settings_3', 'Disable for Post Types', 'disable_gutenberg_settings_section_3', 'disable_gutenberg_options');
|
24 |
+
add_settings_section('settings_4', 'Disable for Templates', 'disable_gutenberg_settings_section_4', 'disable_gutenberg_options');
|
25 |
+
add_settings_section('settings_5', 'Disable for Post IDs', 'disable_gutenberg_settings_section_5', 'disable_gutenberg_options');
|
26 |
+
add_settings_section('settings_6', 'More Tools', 'disable_gutenberg_settings_section_6', 'disable_gutenberg_options');
|
27 |
|
28 |
// add_settings_field( $id, $title, $callback, $page, $section, $args );
|
29 |
add_settings_field('disable-all', __('Complete Disable', 'disable-gutenberg'), 'disable_gutenberg_callback_checkbox', 'disable_gutenberg_options', 'settings_1', array('id' => 'disable-all', 'label' => esc_html__('Disable Gutenberg everywhere', 'disable-gutenberg')));
|
44 |
|
45 |
}
|
46 |
|
47 |
+
add_settings_field('templates', __('Disable Templates', 'disable-gutenberg'), 'disable_gutenberg_callback_text', 'disable_gutenberg_options', 'settings_4', array('id' => 'templates', 'label' => esc_html__('Separate multiple templates with commas', 'disable-gutenberg')));
|
48 |
+
add_settings_field('post-ids', __('Disable Post IDs', 'disable-gutenberg'), 'disable_gutenberg_callback_text', 'disable_gutenberg_options', 'settings_5', array('id' => 'post-ids', 'label' => esc_html__('Separate multiple post IDs with commas', 'disable-gutenberg')));
|
49 |
+
|
50 |
+
add_settings_field('disable-nag', __('Disable Nag', 'disable-gutenberg'), 'disable_gutenberg_callback_checkbox', 'disable_gutenberg_options', 'settings_6', array('id' => 'disable-nag', 'label' => esc_html__('Disable "Try Gutenberg" nag', 'disable-gutenberg')));
|
51 |
+
add_settings_field('hide-menu', __('Plugin Menu Item', 'disable-gutenberg'), 'disable_gutenberg_callback_checkbox', 'disable_gutenberg_options', 'settings_6', array('id' => 'hide-menu', 'label' => esc_html__('Hide this plugin’s menu item', 'disable-gutenberg')));
|
52 |
+
add_settings_field('hide-gut', __('Gutenberg Menu Item', 'disable-gutenberg'), 'disable_gutenberg_callback_checkbox', 'disable_gutenberg_options', 'settings_6', array('id' => 'hide-gut', 'label' => esc_html__('Hide the Gutenberg plugin’s menu item', 'disable-gutenberg')));
|
53 |
+
add_settings_field('reset_options', __('Reset Options', 'disable-gutenberg'), 'disable_gutenberg_callback_reset', 'disable_gutenberg_options', 'settings_6', array('id' => 'reset_options', 'label' => esc_html__('Restore default plugin options', 'disable-gutenberg')));
|
54 |
+
add_settings_field('rate_plugin', __('Rate Plugin', 'disable-gutenberg'), 'disable_gutenberg_callback_rate', 'disable_gutenberg_options', 'settings_6', array('id' => 'rate_plugin', 'label' => esc_html__('Show support with a 5-star rating »', 'disable-gutenberg')));
|
55 |
|
56 |
}
|
57 |
|
87 |
|
88 |
}
|
89 |
|
90 |
+
if (isset($input['templates'])) $input['templates'] = sanitize_text_field(trim($input['templates']));
|
91 |
+
if (isset($input['post-ids'])) $input['post-ids'] = sanitize_text_field(trim($input['post-ids']));
|
92 |
+
|
93 |
if (!isset($input['disable-all'])) $input['disable-all'] = null;
|
94 |
$input['disable-all'] = ($input['disable-all'] == 1 ? 1 : 0);
|
95 |
|
99 |
if (!isset($input['hide-menu'])) $input['hide-menu'] = null;
|
100 |
$input['hide-menu'] = ($input['hide-menu'] == 1 ? 1 : 0);
|
101 |
|
102 |
+
if (!isset($input['hide-gut'])) $input['hide-gut'] = null;
|
103 |
+
$input['hide-gut'] = ($input['hide-gut'] == 1 ? 1 : 0);
|
104 |
+
|
105 |
return $input;
|
106 |
|
107 |
}
|
114 |
|
115 |
function disable_gutenberg_settings_section_2() {
|
116 |
|
117 |
+
echo '<p>'. esc_html__('Select the user roles for which Gutenberg should be disabled.', 'disable-gutenberg') .'</p>';
|
118 |
|
119 |
}
|
120 |
|
121 |
function disable_gutenberg_settings_section_3() {
|
122 |
|
123 |
+
echo '<p>'. esc_html__('Select the post types for which Gutenberg should be disabled.', 'disable-gutenberg') .'</p>';
|
124 |
|
125 |
}
|
126 |
|
127 |
function disable_gutenberg_settings_section_4() {
|
128 |
|
129 |
+
echo '<p>'. esc_html__('Select the theme template files for which Gutenberg should be disabled.', 'disable-gutenberg') .'</p>';
|
130 |
+
|
131 |
+
}
|
132 |
+
|
133 |
+
function disable_gutenberg_settings_section_5() {
|
134 |
+
|
135 |
+
echo '<p>'. esc_html__('Select the post IDs for which Gutenberg should be disabled.', 'disable-gutenberg') .'</p>';
|
136 |
+
|
137 |
+
}
|
138 |
+
|
139 |
+
function disable_gutenberg_settings_section_6() {
|
140 |
+
|
141 |
echo '<p class="g7g-display">'. esc_html__('Additional tools and options for handling Gutenberg.', 'disable-gutenberg') .'</p>';
|
142 |
|
143 |
}
|
200 |
echo '<a class="disable-gutenberg-reset-options" href="'. esc_url($href) .'">'. esc_html($label) .'</a>';
|
201 |
|
202 |
}
|
203 |
+
|
204 |
+
function disable_gutenberg_callback_rate($args) {
|
205 |
+
|
206 |
+
$href = 'https://wordpress.org/support/plugin/'. DISABLE_GUTENBERG_SLUG .'/reviews/?rate=5#new-post';
|
207 |
+
$title = esc_attr__('Please give a 5-star rating! A huge THANK YOU for your support!', 'disable-gutenberg');
|
208 |
+
$text = isset($args['label']) ? $args['label'] : esc_html__('Show support with a 5-star rating »', 'disable-gutenberg');
|
209 |
+
|
210 |
+
echo '<a target="_blank" rel="noopener noreferrer" class="disable-gutenberg-rate-plugin" href="'. $href .'" title="'. $title .'">'. $text .'</a>';
|
211 |
+
|
212 |
+
}
|
js/settings.js
CHANGED
@@ -24,9 +24,9 @@ jQuery(document).ready(function($){
|
|
24 |
var disable_g7g_el = 'table.form-table input[name="disable_gutenberg_options[disable-all]"]';
|
25 |
var disable_g7g_go = $(disable_g7g_el +':checked').val();
|
26 |
|
27 |
-
var disable_g7g_title = $('.wrap h2').slice(1,
|
28 |
var disable_g7g_text = $('.wrap p').not('.g7g-display').not('.submit');
|
29 |
-
var disable_g7g_table = $('.wrap table').slice(1,
|
30 |
|
31 |
if (disable_g7g_go) {
|
32 |
disable_g7g_title.hide();
|
24 |
var disable_g7g_el = 'table.form-table input[name="disable_gutenberg_options[disable-all]"]';
|
25 |
var disable_g7g_go = $(disable_g7g_el +':checked').val();
|
26 |
|
27 |
+
var disable_g7g_title = $('.wrap h2').slice(1,5);
|
28 |
var disable_g7g_text = $('.wrap p').not('.g7g-display').not('.submit');
|
29 |
+
var disable_g7g_table = $('.wrap table').slice(1,5);
|
30 |
|
31 |
if (disable_g7g_go) {
|
32 |
disable_g7g_title.hide();
|
languages/disable-gutenberg.pot
ADDED
@@ -0,0 +1,204 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#, fuzzy
|
2 |
+
msgid ""
|
3 |
+
msgstr ""
|
4 |
+
"Project-Id-Version: Disable Gutenberg\n"
|
5 |
+
"Report-Msgid-Bugs-To: \n"
|
6 |
+
"POT-Creation-Date: 2018-08-16 21:47+0000\n"
|
7 |
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
8 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
9 |
+
"Language-Team: \n"
|
10 |
+
"Language: \n"
|
11 |
+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
12 |
+
"MIME-Version: 1.0\n"
|
13 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
+
"Content-Transfer-Encoding: 8bit\n"
|
15 |
+
"X-Generator: Loco https://localise.biz/"
|
16 |
+
|
17 |
+
#. Name of the plugin
|
18 |
+
#: disable-gutenberg.php:72
|
19 |
+
msgid "Disable Gutenberg"
|
20 |
+
msgstr ""
|
21 |
+
|
22 |
+
#: disable-gutenberg.php:138
|
23 |
+
msgid "Settings"
|
24 |
+
msgstr ""
|
25 |
+
|
26 |
+
#: disable-gutenberg.php:153
|
27 |
+
msgid "Click here to rate and review this plugin on WordPress.org"
|
28 |
+
msgstr ""
|
29 |
+
|
30 |
+
#: disable-gutenberg.php:154
|
31 |
+
msgid "Rate this plugin"
|
32 |
+
msgstr ""
|
33 |
+
|
34 |
+
#: disable-gutenberg.php:176
|
35 |
+
msgid "requires WordPress "
|
36 |
+
msgstr ""
|
37 |
+
|
38 |
+
#: disable-gutenberg.php:177
|
39 |
+
msgid " or higher, and has been deactivated! "
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
+
#: disable-gutenberg.php:178
|
43 |
+
msgid "Please return to the"
|
44 |
+
msgstr ""
|
45 |
+
|
46 |
+
#: disable-gutenberg.php:179
|
47 |
+
msgid "WP Admin Area"
|
48 |
+
msgstr ""
|
49 |
+
|
50 |
+
#: disable-gutenberg.php:179
|
51 |
+
msgid "to upgrade WordPress and try again."
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#: disable-gutenberg.php:199 disable-gutenberg.php:205
|
55 |
+
msgid "Sorry, pal!"
|
56 |
+
msgstr ""
|
57 |
+
|
58 |
+
#: inc/settings-reset.php:18
|
59 |
+
msgid "Default options restored."
|
60 |
+
msgstr ""
|
61 |
+
|
62 |
+
#: inc/settings-reset.php:24
|
63 |
+
msgid "No changes made to options."
|
64 |
+
msgstr ""
|
65 |
+
|
66 |
+
#: inc/resources-enqueue.php:33
|
67 |
+
msgid "Confirm Reset"
|
68 |
+
msgstr ""
|
69 |
+
|
70 |
+
#: inc/resources-enqueue.php:34
|
71 |
+
msgid "Restore default options?"
|
72 |
+
msgstr ""
|
73 |
+
|
74 |
+
#: inc/resources-enqueue.php:35
|
75 |
+
msgid "Yes, make it so."
|
76 |
+
msgstr ""
|
77 |
+
|
78 |
+
#: inc/resources-enqueue.php:36
|
79 |
+
msgid "No, abort mission."
|
80 |
+
msgstr ""
|
81 |
+
|
82 |
+
#: inc/settings-register.php:29
|
83 |
+
msgid "Complete Disable"
|
84 |
+
msgstr ""
|
85 |
+
|
86 |
+
#: inc/settings-register.php:29
|
87 |
+
msgid "Disable Gutenberg everywhere"
|
88 |
+
msgstr ""
|
89 |
+
|
90 |
+
#: inc/settings-register.php:35 inc/settings-register.php:43
|
91 |
+
msgid "Disable for"
|
92 |
+
msgstr ""
|
93 |
+
|
94 |
+
#: inc/settings-register.php:35
|
95 |
+
msgid "User Role ="
|
96 |
+
msgstr ""
|
97 |
+
|
98 |
+
#: inc/settings-register.php:43
|
99 |
+
msgid "Post Type ="
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
#: inc/settings-register.php:47
|
103 |
+
msgid "Disable Templates"
|
104 |
+
msgstr ""
|
105 |
+
|
106 |
+
#: inc/settings-register.php:47
|
107 |
+
msgid "Separate multiple templates with commas"
|
108 |
+
msgstr ""
|
109 |
+
|
110 |
+
#: inc/settings-register.php:48
|
111 |
+
msgid "Disable Post IDs"
|
112 |
+
msgstr ""
|
113 |
+
|
114 |
+
#: inc/settings-register.php:48
|
115 |
+
msgid "Separate multiple post IDs with commas"
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: inc/settings-register.php:50
|
119 |
+
msgid "Disable Nag"
|
120 |
+
msgstr ""
|
121 |
+
|
122 |
+
#: inc/settings-register.php:50
|
123 |
+
msgid "Disable \"Try Gutenberg\" nag"
|
124 |
+
msgstr ""
|
125 |
+
|
126 |
+
#: inc/settings-register.php:51
|
127 |
+
msgid "Plugin Menu Item"
|
128 |
+
msgstr ""
|
129 |
+
|
130 |
+
#: inc/settings-register.php:51
|
131 |
+
msgid "Hide this plugin’s menu item"
|
132 |
+
msgstr ""
|
133 |
+
|
134 |
+
#: inc/settings-register.php:52
|
135 |
+
msgid "Gutenberg Menu Item"
|
136 |
+
msgstr ""
|
137 |
+
|
138 |
+
#: inc/settings-register.php:52
|
139 |
+
msgid "Hide the Gutenberg plugin’s menu item"
|
140 |
+
msgstr ""
|
141 |
+
|
142 |
+
#: inc/settings-register.php:53
|
143 |
+
msgid "Reset Options"
|
144 |
+
msgstr ""
|
145 |
+
|
146 |
+
#: inc/settings-register.php:53 inc/settings-register.php:198
|
147 |
+
msgid "Restore default plugin options"
|
148 |
+
msgstr ""
|
149 |
+
|
150 |
+
#: inc/settings-register.php:54
|
151 |
+
msgid "Rate Plugin"
|
152 |
+
msgstr ""
|
153 |
+
|
154 |
+
#: inc/settings-register.php:54 inc/settings-register.php:208
|
155 |
+
msgid "Show support with a 5-star rating »"
|
156 |
+
msgstr ""
|
157 |
+
|
158 |
+
#: inc/settings-register.php:111
|
159 |
+
msgid ""
|
160 |
+
"Enable this setting to completely disable Gutenberg on all post types (and "
|
161 |
+
"use Classic Editor instead). Or, disable this setting to display more "
|
162 |
+
"options."
|
163 |
+
msgstr ""
|
164 |
+
|
165 |
+
#: inc/settings-register.php:117
|
166 |
+
msgid "Select the user roles for which Gutenberg should be disabled."
|
167 |
+
msgstr ""
|
168 |
+
|
169 |
+
#: inc/settings-register.php:123
|
170 |
+
msgid "Select the post types for which Gutenberg should be disabled."
|
171 |
+
msgstr ""
|
172 |
+
|
173 |
+
#: inc/settings-register.php:129
|
174 |
+
msgid "Select the theme template files for which Gutenberg should be disabled."
|
175 |
+
msgstr ""
|
176 |
+
|
177 |
+
#: inc/settings-register.php:135
|
178 |
+
msgid "Select the post IDs for which Gutenberg should be disabled."
|
179 |
+
msgstr ""
|
180 |
+
|
181 |
+
#: inc/settings-register.php:141
|
182 |
+
msgid "Additional tools and options for handling Gutenberg."
|
183 |
+
msgstr ""
|
184 |
+
|
185 |
+
#: inc/settings-register.php:207
|
186 |
+
msgid "Please give a 5-star rating! A huge THANK YOU for your support!"
|
187 |
+
msgstr ""
|
188 |
+
|
189 |
+
#. Description of the plugin
|
190 |
+
msgid ""
|
191 |
+
"Completely disable Gutenberg Editor sitewide or for specific post types."
|
192 |
+
msgstr ""
|
193 |
+
|
194 |
+
#. URI of the plugin
|
195 |
+
msgid "https://perishablepress.com/disable-gutenberg/"
|
196 |
+
msgstr ""
|
197 |
+
|
198 |
+
#. Author of the plugin
|
199 |
+
msgid "Jeff Starr"
|
200 |
+
msgstr ""
|
201 |
+
|
202 |
+
#. Author URI of the plugin
|
203 |
+
msgid "https://plugin-planet.com/"
|
204 |
+
msgstr ""
|
lib/classic-editor/classic-edit-form-advanced.php
ADDED
@@ -0,0 +1,813 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Post advanced form for inclusion in the administration panels.
|
4 |
+
*
|
5 |
+
* @package WordPress
|
6 |
+
* @subpackage Administration
|
7 |
+
*/
|
8 |
+
|
9 |
+
// don't load directly
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
11 |
+
die( 'Invalid request.' );
|
12 |
+
}
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @global string $post_type
|
16 |
+
* @global WP_Post_Type $post_type_object
|
17 |
+
* @global WP_Post $post
|
18 |
+
* And a ton more... (back-compat).
|
19 |
+
*/
|
20 |
+
global $post,
|
21 |
+
$post_type,
|
22 |
+
$post_type_object,
|
23 |
+
$post_ID,
|
24 |
+
$user_ID,
|
25 |
+
$action,
|
26 |
+
$_wp_editor_expand,
|
27 |
+
$_content_editor_dfw,
|
28 |
+
$thumbnail_support,
|
29 |
+
$permalink,
|
30 |
+
$messages,
|
31 |
+
$preview_post_link_html,
|
32 |
+
$scheduled_post_link_html,
|
33 |
+
$view_post_link_html,
|
34 |
+
$preview_page_link_html,
|
35 |
+
$scheduled_page_link_html,
|
36 |
+
$view_page_link_html,
|
37 |
+
$preview_url,
|
38 |
+
$viewable,
|
39 |
+
$scheduled_date,
|
40 |
+
$message,
|
41 |
+
$notice,
|
42 |
+
$form_extra,
|
43 |
+
$autosave,
|
44 |
+
$form_action,
|
45 |
+
$nonce_action,
|
46 |
+
$publish_callback_args,
|
47 |
+
$revisions,
|
48 |
+
$stati,
|
49 |
+
$title_and_editor,
|
50 |
+
$about_pages,
|
51 |
+
$inserting_media,
|
52 |
+
$publish_box,
|
53 |
+
$discussion_settings,
|
54 |
+
$page_attributes,
|
55 |
+
$referer,
|
56 |
+
$post_new_file,
|
57 |
+
$active_post_lock,
|
58 |
+
$form_extra,
|
59 |
+
$title_placeholder,
|
60 |
+
$sample_permalink_html,
|
61 |
+
$shortlink,
|
62 |
+
$has_sample_permalink,
|
63 |
+
$last_user,
|
64 |
+
|
65 |
+
$post_id,
|
66 |
+
$active_post_lock,
|
67 |
+
$title;
|
68 |
+
|
69 |
+
|
70 |
+
if ( ! wp_check_post_lock( $post->ID ) ) {
|
71 |
+
$active_post_lock = wp_set_post_lock( $post->ID );
|
72 |
+
}
|
73 |
+
|
74 |
+
if ( is_multisite() ) {
|
75 |
+
add_action( 'admin_footer', '_admin_notice_post_locked' );
|
76 |
+
} else {
|
77 |
+
$check_users = get_users( array( 'fields' => 'ID', 'number' => 2 ) );
|
78 |
+
|
79 |
+
if ( count( $check_users ) > 1 )
|
80 |
+
add_action( 'admin_footer', '_admin_notice_post_locked' );
|
81 |
+
|
82 |
+
unset( $check_users );
|
83 |
+
}
|
84 |
+
|
85 |
+
$_wp_editor_expand = $_content_editor_dfw = false;
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Filters whether to enable the 'expand' functionality in the post editor.
|
89 |
+
*
|
90 |
+
* @since 4.0.0
|
91 |
+
* @since 4.1.0 Added the `$post_type` parameter.
|
92 |
+
*
|
93 |
+
* @param bool $expand Whether to enable the 'expand' functionality. Default true.
|
94 |
+
* @param string $post_type Post type.
|
95 |
+
*/
|
96 |
+
if ( post_type_supports( $post_type, 'editor' ) && ! wp_is_mobile() &&
|
97 |
+
! ( $GLOBALS['is_IE'] && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) &&
|
98 |
+
apply_filters( 'wp_editor_expand', true, $post_type ) ) {
|
99 |
+
|
100 |
+
wp_enqueue_script( 'editor-expand' );
|
101 |
+
$_content_editor_dfw = true;
|
102 |
+
$_wp_editor_expand = ( get_user_setting( 'editor_expand', 'on' ) === 'on' );
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* Post ID global
|
107 |
+
* @name $post_ID
|
108 |
+
* @var int
|
109 |
+
*/
|
110 |
+
$post_ID = isset( $post_ID ) ? (int) $post_ID : 0;
|
111 |
+
$user_ID = isset( $user_ID ) ? (int) $user_ID : 0;
|
112 |
+
$action = isset( $action ) ? $action : '';
|
113 |
+
|
114 |
+
if ( $post_ID == get_option( 'page_for_posts' ) && empty( $post->post_content ) ) {
|
115 |
+
add_action( 'edit_form_after_title', '_wp_posts_page_notice' );
|
116 |
+
remove_post_type_support( $post_type, 'editor' );
|
117 |
+
}
|
118 |
+
|
119 |
+
$thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
|
120 |
+
if ( ! $thumbnail_support && 'attachment' === $post_type && $post->post_mime_type ) {
|
121 |
+
if ( wp_attachment_is( 'audio', $post ) ) {
|
122 |
+
$thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' );
|
123 |
+
} elseif ( wp_attachment_is( 'video', $post ) ) {
|
124 |
+
$thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' );
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
if ( $thumbnail_support ) {
|
129 |
+
wp_enqueue_media( array( 'post' => $post_ID ) );
|
130 |
+
}
|
131 |
+
|
132 |
+
// Add the local autosave notice HTML
|
133 |
+
add_action( 'admin_footer', '_local_storage_notice' );
|
134 |
+
|
135 |
+
$permalink = get_permalink( $post_ID );
|
136 |
+
if ( ! $permalink ) {
|
137 |
+
$permalink = '';
|
138 |
+
}
|
139 |
+
|
140 |
+
$messages = array();
|
141 |
+
|
142 |
+
$preview_post_link_html = $scheduled_post_link_html = $view_post_link_html = '';
|
143 |
+
$preview_page_link_html = $scheduled_page_link_html = $view_page_link_html = '';
|
144 |
+
|
145 |
+
$preview_url = get_preview_post_link( $post );
|
146 |
+
|
147 |
+
$viewable = is_post_type_viewable( $post_type_object );
|
148 |
+
|
149 |
+
if ( $viewable ) {
|
150 |
+
|
151 |
+
// Preview post link.
|
152 |
+
$preview_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>',
|
153 |
+
esc_url( $preview_url ),
|
154 |
+
__( 'Preview post' )
|
155 |
+
);
|
156 |
+
|
157 |
+
// Scheduled post preview link.
|
158 |
+
$scheduled_post_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>',
|
159 |
+
esc_url( $permalink ),
|
160 |
+
__( 'Preview post' )
|
161 |
+
);
|
162 |
+
|
163 |
+
// View post link.
|
164 |
+
$view_post_link_html = sprintf( ' <a href="%1$s">%2$s</a>',
|
165 |
+
esc_url( $permalink ),
|
166 |
+
__( 'View post' )
|
167 |
+
);
|
168 |
+
|
169 |
+
// Preview page link.
|
170 |
+
$preview_page_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>',
|
171 |
+
esc_url( $preview_url ),
|
172 |
+
__( 'Preview page' )
|
173 |
+
);
|
174 |
+
|
175 |
+
// Scheduled page preview link.
|
176 |
+
$scheduled_page_link_html = sprintf( ' <a target="_blank" href="%1$s">%2$s</a>',
|
177 |
+
esc_url( $permalink ),
|
178 |
+
__( 'Preview page' )
|
179 |
+
);
|
180 |
+
|
181 |
+
// View page link.
|
182 |
+
$view_page_link_html = sprintf( ' <a href="%1$s">%2$s</a>',
|
183 |
+
esc_url( $permalink ),
|
184 |
+
__( 'View page' )
|
185 |
+
);
|
186 |
+
|
187 |
+
}
|
188 |
+
|
189 |
+
/* translators: Publish box date format, see https://secure.php.net/date */
|
190 |
+
$scheduled_date = date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) );
|
191 |
+
|
192 |
+
$messages['post'] = array(
|
193 |
+
0 => '', // Unused. Messages start at index 1.
|
194 |
+
1 => __( 'Post updated.' ) . $view_post_link_html,
|
195 |
+
2 => __( 'Custom field updated.' ),
|
196 |
+
3 => __( 'Custom field deleted.' ),
|
197 |
+
4 => __( 'Post updated.' ),
|
198 |
+
/* translators: %s: date and time of the revision */
|
199 |
+
5 => isset($_GET['revision']) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
200 |
+
6 => __( 'Post published.' ) . $view_post_link_html,
|
201 |
+
7 => __( 'Post saved.' ),
|
202 |
+
8 => __( 'Post submitted.' ) . $preview_post_link_html,
|
203 |
+
9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
|
204 |
+
10 => __( 'Post draft updated.' ) . $preview_post_link_html,
|
205 |
+
);
|
206 |
+
$messages['page'] = array(
|
207 |
+
0 => '', // Unused. Messages start at index 1.
|
208 |
+
1 => __( 'Page updated.' ) . $view_page_link_html,
|
209 |
+
2 => __( 'Custom field updated.' ),
|
210 |
+
3 => __( 'Custom field deleted.' ),
|
211 |
+
4 => __( 'Page updated.' ),
|
212 |
+
/* translators: %s: date and time of the revision */
|
213 |
+
5 => isset($_GET['revision']) ? sprintf( __( 'Page restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
214 |
+
6 => __( 'Page published.' ) . $view_page_link_html,
|
215 |
+
7 => __( 'Page saved.' ),
|
216 |
+
8 => __( 'Page submitted.' ) . $preview_page_link_html,
|
217 |
+
9 => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html,
|
218 |
+
10 => __( 'Page draft updated.' ) . $preview_page_link_html,
|
219 |
+
);
|
220 |
+
$messages['attachment'] = array_fill( 1, 10, __( 'Media file updated.' ) ); // Hack, for now.
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Filters the post updated messages.
|
224 |
+
*
|
225 |
+
* @since 3.0.0
|
226 |
+
*
|
227 |
+
* @param array $messages Post updated messages. For defaults @see $messages declarations above.
|
228 |
+
*/
|
229 |
+
$messages = apply_filters( 'post_updated_messages', $messages );
|
230 |
+
|
231 |
+
$message = false;
|
232 |
+
if ( isset($_GET['message']) ) {
|
233 |
+
$_GET['message'] = absint( $_GET['message'] );
|
234 |
+
if ( isset($messages[$post_type][$_GET['message']]) )
|
235 |
+
$message = $messages[$post_type][$_GET['message']];
|
236 |
+
elseif ( !isset($messages[$post_type]) && isset($messages['post'][$_GET['message']]) )
|
237 |
+
$message = $messages['post'][$_GET['message']];
|
238 |
+
}
|
239 |
+
|
240 |
+
$notice = false;
|
241 |
+
$form_extra = '';
|
242 |
+
if ( 'auto-draft' == $post->post_status ) {
|
243 |
+
if ( 'edit' == $action )
|
244 |
+
$post->post_title = '';
|
245 |
+
$autosave = false;
|
246 |
+
$form_extra .= "<input type='hidden' id='auto_draft' name='auto_draft' value='1' />";
|
247 |
+
} else {
|
248 |
+
$autosave = wp_get_post_autosave( $post_ID );
|
249 |
+
}
|
250 |
+
|
251 |
+
$form_action = 'editpost';
|
252 |
+
$nonce_action = 'update-post_' . $post_ID;
|
253 |
+
$form_extra .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_attr($post_ID) . "' />";
|
254 |
+
|
255 |
+
// Detect if there exists an autosave newer than the post and if that autosave is different than the post
|
256 |
+
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
|
257 |
+
foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) {
|
258 |
+
if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
|
259 |
+
$notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ), get_edit_post_link( $autosave->ID ) );
|
260 |
+
break;
|
261 |
+
}
|
262 |
+
}
|
263 |
+
// If this autosave isn't different from the current post, begone.
|
264 |
+
if ( ! $notice )
|
265 |
+
wp_delete_post_revision( $autosave->ID );
|
266 |
+
unset($autosave_field, $_autosave_field);
|
267 |
+
}
|
268 |
+
|
269 |
+
$post_type_object = get_post_type_object($post_type);
|
270 |
+
|
271 |
+
// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
|
272 |
+
require_once( ABSPATH . 'wp-admin/includes/meta-boxes.php' );
|
273 |
+
|
274 |
+
|
275 |
+
$publish_callback_args = null;
|
276 |
+
if ( post_type_supports($post_type, 'revisions') && 'auto-draft' != $post->post_status ) {
|
277 |
+
$revisions = wp_get_post_revisions( $post_ID );
|
278 |
+
|
279 |
+
// We should aim to show the revisions meta box only when there are revisions.
|
280 |
+
if ( count( $revisions ) > 1 ) {
|
281 |
+
reset( $revisions ); // Reset pointer for key()
|
282 |
+
$publish_callback_args = array( 'revisions_count' => count( $revisions ), 'revision_id' => key( $revisions ) );
|
283 |
+
add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', null, 'normal', 'core');
|
284 |
+
}
|
285 |
+
}
|
286 |
+
|
287 |
+
if ( 'attachment' == $post_type ) {
|
288 |
+
wp_enqueue_script( 'image-edit' );
|
289 |
+
wp_enqueue_style( 'imgareaselect' );
|
290 |
+
add_meta_box( 'submitdiv', __('Save'), 'attachment_submit_meta_box', null, 'side', 'core' );
|
291 |
+
add_action( 'edit_form_after_title', 'edit_form_image_editor' );
|
292 |
+
|
293 |
+
if ( wp_attachment_is( 'audio', $post ) ) {
|
294 |
+
add_meta_box( 'attachment-id3', __( 'Metadata' ), 'attachment_id3_data_meta_box', null, 'normal', 'core' );
|
295 |
+
}
|
296 |
+
} else {
|
297 |
+
add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core', $publish_callback_args );
|
298 |
+
}
|
299 |
+
|
300 |
+
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) )
|
301 |
+
add_meta_box( 'formatdiv', _x( 'Format', 'post format' ), 'post_format_meta_box', null, 'side', 'core' );
|
302 |
+
|
303 |
+
// all taxonomies
|
304 |
+
foreach ( get_object_taxonomies( $post ) as $tax_name ) {
|
305 |
+
$taxonomy = get_taxonomy( $tax_name );
|
306 |
+
if ( ! $taxonomy->show_ui || false === $taxonomy->meta_box_cb )
|
307 |
+
continue;
|
308 |
+
|
309 |
+
$label = $taxonomy->labels->name;
|
310 |
+
|
311 |
+
if ( ! is_taxonomy_hierarchical( $tax_name ) )
|
312 |
+
$tax_meta_box_id = 'tagsdiv-' . $tax_name;
|
313 |
+
else
|
314 |
+
$tax_meta_box_id = $tax_name . 'div';
|
315 |
+
|
316 |
+
add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) );
|
317 |
+
}
|
318 |
+
|
319 |
+
if ( post_type_supports( $post_type, 'page-attributes' ) || count( get_page_templates( $post ) ) > 0 ) {
|
320 |
+
add_meta_box( 'pageparentdiv', $post_type_object->labels->attributes, 'page_attributes_meta_box', null, 'side', 'core' );
|
321 |
+
}
|
322 |
+
|
323 |
+
if ( $thumbnail_support && current_user_can( 'upload_files' ) )
|
324 |
+
add_meta_box('postimagediv', esc_html( $post_type_object->labels->featured_image ), 'post_thumbnail_meta_box', null, 'side', 'low');
|
325 |
+
|
326 |
+
if ( post_type_supports($post_type, 'excerpt') )
|
327 |
+
add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core');
|
328 |
+
|
329 |
+
if ( post_type_supports($post_type, 'trackbacks') )
|
330 |
+
add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', null, 'normal', 'core');
|
331 |
+
|
332 |
+
if ( post_type_supports($post_type, 'custom-fields') )
|
333 |
+
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', null, 'normal', 'core');
|
334 |
+
|
335 |
+
/**
|
336 |
+
* Fires in the middle of built-in meta box registration.
|
337 |
+
*
|
338 |
+
* @since 2.1.0
|
339 |
+
* @deprecated 3.7.0 Use 'add_meta_boxes' instead.
|
340 |
+
*
|
341 |
+
* @param WP_Post $post Post object.
|
342 |
+
*/
|
343 |
+
do_action( 'dbx_post_advanced', $post );
|
344 |
+
|
345 |
+
// Allow the Discussion meta box to show up if the post type supports comments,
|
346 |
+
// or if comments or pings are open.
|
347 |
+
if ( comments_open( $post ) || pings_open( $post ) || post_type_supports( $post_type, 'comments' ) ) {
|
348 |
+
add_meta_box( 'commentstatusdiv', __( 'Discussion' ), 'post_comment_status_meta_box', null, 'normal', 'core' );
|
349 |
+
}
|
350 |
+
|
351 |
+
$stati = get_post_stati( array( 'public' => true ) );
|
352 |
+
if ( empty( $stati ) ) {
|
353 |
+
$stati = array( 'publish' );
|
354 |
+
}
|
355 |
+
$stati[] = 'private';
|
356 |
+
|
357 |
+
if ( in_array( get_post_status( $post ), $stati ) ) {
|
358 |
+
// If the post type support comments, or the post has comments, allow the
|
359 |
+
// Comments meta box.
|
360 |
+
if ( comments_open( $post ) || pings_open( $post ) || $post->comment_count > 0 || post_type_supports( $post_type, 'comments' ) ) {
|
361 |
+
add_meta_box( 'commentsdiv', __( 'Comments' ), 'post_comment_meta_box', null, 'normal', 'core' );
|
362 |
+
}
|
363 |
+
}
|
364 |
+
|
365 |
+
if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) )
|
366 |
+
add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core');
|
367 |
+
|
368 |
+
if ( post_type_supports( $post_type, 'author' ) && current_user_can( $post_type_object->cap->edit_others_posts ) ) {
|
369 |
+
add_meta_box( 'authordiv', __( 'Author' ), 'post_author_meta_box', null, 'normal', 'core' );
|
370 |
+
}
|
371 |
+
|
372 |
+
/**
|
373 |
+
* Fires after all built-in meta boxes have been added.
|
374 |
+
*
|
375 |
+
* @since 3.0.0
|
376 |
+
*
|
377 |
+
* @param string $post_type Post type.
|
378 |
+
* @param WP_Post $post Post object.
|
379 |
+
*/
|
380 |
+
do_action( 'add_meta_boxes', $post_type, $post );
|
381 |
+
|
382 |
+
/**
|
383 |
+
* Fires after all built-in meta boxes have been added, contextually for the given post type.
|
384 |
+
*
|
385 |
+
* The dynamic portion of the hook, `$post_type`, refers to the post type of the post.
|
386 |
+
*
|
387 |
+
* @since 3.0.0
|
388 |
+
*
|
389 |
+
* @param WP_Post $post Post object.
|
390 |
+
*/
|
391 |
+
do_action( "add_meta_boxes_{$post_type}", $post );
|
392 |
+
|
393 |
+
/**
|
394 |
+
* Fires after meta boxes have been added.
|
395 |
+
*
|
396 |
+
* Fires once for each of the default meta box contexts: normal, advanced, and side.
|
397 |
+
*
|
398 |
+
* @since 3.0.0
|
399 |
+
*
|
400 |
+
* @param string $post_type Post type of the post.
|
401 |
+
* @param string $context string Meta box context.
|
402 |
+
* @param WP_Post $post Post object.
|
403 |
+
*/
|
404 |
+
do_action( 'do_meta_boxes', $post_type, 'normal', $post );
|
405 |
+
/** This action is documented in wp-admin/edit-form-advanced.php */
|
406 |
+
do_action( 'do_meta_boxes', $post_type, 'advanced', $post );
|
407 |
+
/** This action is documented in wp-admin/edit-form-advanced.php */
|
408 |
+
do_action( 'do_meta_boxes', $post_type, 'side', $post );
|
409 |
+
|
410 |
+
add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );
|
411 |
+
|
412 |
+
if ( 'post' == $post_type ) {
|
413 |
+
$customize_display = '<p>' . __('The title field and the big Post Editing Area are fixed in place, but you can reposition all the other boxes using drag and drop. You can also minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Excerpt, Send Trackbacks, Custom Fields, Discussion, Slug, Author) or to choose a 1- or 2-column layout for this screen.') . '</p>';
|
414 |
+
|
415 |
+
get_current_screen()->add_help_tab( array(
|
416 |
+
'id' => 'customize-display',
|
417 |
+
'title' => __('Customizing This Display'),
|
418 |
+
'content' => $customize_display,
|
419 |
+
) );
|
420 |
+
|
421 |
+
$title_and_editor = '<p>' . __('<strong>Title</strong> — Enter a title for your post. After you enter a title, you’ll see the permalink below, which you can edit.') . '</p>';
|
422 |
+
$title_and_editor .= '<p>' . __( '<strong>Post editor</strong> — Enter the text for your post. There are two modes of editing: Visual and Text. Choose the mode by clicking on the appropriate tab.' ) . '</p>';
|
423 |
+
$title_and_editor .= '<p>' . __( 'Visual mode gives you an editor that is similar to a word processor. Click the Toolbar Toggle button to get a second row of controls.' ) . '</p>';
|
424 |
+
$title_and_editor .= '<p>' . __( 'The Text mode allows you to enter HTML along with your post text. Note that <p> and <br> tags are converted to line breaks when switching to the Text editor to make it less cluttered. When you type, a single line break can be used instead of typing <br>, and two line breaks instead of paragraph tags. The line breaks are converted back to tags automatically.' ) . '</p>';
|
425 |
+
$title_and_editor .= '<p>' . __( 'You can insert media files by clicking the icons above the post editor and following the directions. You can align or edit images using the inline formatting toolbar available in Visual mode.' ) . '</p>';
|
426 |
+
$title_and_editor .= '<p>' . __( 'You can enable distraction-free writing mode using the icon to the right. This feature is not available for old browsers or devices with small screens, and requires that the full-height editor be enabled in Screen Options.' ) . '</p>';
|
427 |
+
$title_and_editor .= '<p>' . __( 'Keyboard users: When you’re working in the visual editor, you can use <kbd>Alt + F10</kbd> to access the toolbar.' ) . '</p>';
|
428 |
+
|
429 |
+
get_current_screen()->add_help_tab( array(
|
430 |
+
'id' => 'title-post-editor',
|
431 |
+
'title' => __('Title and Post Editor'),
|
432 |
+
'content' => $title_and_editor,
|
433 |
+
) );
|
434 |
+
|
435 |
+
get_current_screen()->set_help_sidebar(
|
436 |
+
'<p>' . sprintf(__('You can also create posts with the <a href="%s">Press This bookmarklet</a>.'), 'tools.php') . '</p>' .
|
437 |
+
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
438 |
+
'<p>' . __('<a href="https://codex.wordpress.org/Posts_Add_New_Screen">Documentation on Writing and Editing Posts</a>') . '</p>' .
|
439 |
+
'<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
|
440 |
+
);
|
441 |
+
} elseif ( 'page' == $post_type ) {
|
442 |
+
$about_pages = '<p>' . __('Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the “Parent” of the other, creating a group of pages.') . '</p>' .
|
443 |
+
'<p>' . __('Creating a Page is very similar to creating a Post, and the screens can be customized in the same way using drag and drop, the Screen Options tab, and expanding/collapsing boxes as you choose. This screen also has the distraction-free writing space, available in both the Visual and Text modes via the Fullscreen buttons. The Page editor mostly works the same as the Post editor, but there are some Page-specific features in the Page Attributes box.') . '</p>';
|
444 |
+
|
445 |
+
get_current_screen()->add_help_tab( array(
|
446 |
+
'id' => 'about-pages',
|
447 |
+
'title' => __('About Pages'),
|
448 |
+
'content' => $about_pages,
|
449 |
+
) );
|
450 |
+
|
451 |
+
get_current_screen()->set_help_sidebar(
|
452 |
+
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
453 |
+
'<p>' . __('<a href="https://codex.wordpress.org/Pages_Add_New_Screen">Documentation on Adding New Pages</a>') . '</p>' .
|
454 |
+
'<p>' . __('<a href="https://codex.wordpress.org/Pages_Screen#Editing_Individual_Pages">Documentation on Editing Pages</a>') . '</p>' .
|
455 |
+
'<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
|
456 |
+
);
|
457 |
+
} elseif ( 'attachment' == $post_type ) {
|
458 |
+
get_current_screen()->add_help_tab( array(
|
459 |
+
'id' => 'overview',
|
460 |
+
'title' => __('Overview'),
|
461 |
+
'content' =>
|
462 |
+
'<p>' . __('This screen allows you to edit four fields for metadata in a file within the media library.') . '</p>' .
|
463 |
+
'<p>' . __('For images only, you can click on Edit Image under the thumbnail to expand out an inline image editor with icons for cropping, rotating, or flipping the image as well as for undoing and redoing. The boxes on the right give you more options for scaling the image, for cropping it, and for cropping the thumbnail in a different way than you crop the original image. You can click on Help in those boxes to get more information.') . '</p>' .
|
464 |
+
'<p>' . __('Note that you crop the image by clicking on it (the Crop icon is already selected) and dragging the cropping frame to select the desired part. Then click Save to retain the cropping.') . '</p>' .
|
465 |
+
'<p>' . __('Remember to click Update Media to save metadata entered or changed.') . '</p>'
|
466 |
+
) );
|
467 |
+
|
468 |
+
get_current_screen()->set_help_sidebar(
|
469 |
+
'<p><strong>' . __('For more information:') . '</strong></p>' .
|
470 |
+
'<p>' . __('<a href="https://codex.wordpress.org/Media_Add_New_Screen#Edit_Media">Documentation on Edit Media</a>') . '</p>' .
|
471 |
+
'<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
|
472 |
+
);
|
473 |
+
}
|
474 |
+
|
475 |
+
if ( 'post' == $post_type || 'page' == $post_type ) {
|
476 |
+
$inserting_media = '<p>' . __( 'You can upload and insert media (images, audio, documents, etc.) by clicking the Add Media button. You can select from the images and files already uploaded to the Media Library, or upload new media to add to your page or post. To create an image gallery, select the images to add and click the “Create a new gallery” button.' ) . '</p>';
|
477 |
+
$inserting_media .= '<p>' . __( 'You can also embed media from many popular websites including Twitter, YouTube, Flickr and others by pasting the media URL on its own line into the content of your post/page. Please refer to the Codex to <a href="https://codex.wordpress.org/Embeds">learn more about embeds</a>.' ) . '</p>';
|
478 |
+
|
479 |
+
get_current_screen()->add_help_tab( array(
|
480 |
+
'id' => 'inserting-media',
|
481 |
+
'title' => __( 'Inserting Media' ),
|
482 |
+
'content' => $inserting_media,
|
483 |
+
) );
|
484 |
+
}
|
485 |
+
|
486 |
+
if ( 'post' == $post_type ) {
|
487 |
+
$publish_box = '<p>' . __('Several boxes on this screen contain settings for how your content will be published, including:') . '</p>';
|
488 |
+
$publish_box .= '<ul><li>' .
|
489 |
+
__( '<strong>Publish</strong> — You can set the terms of publishing your post in the Publish box. For Status, Visibility, and Publish (immediately), click on the Edit link to reveal more options. Visibility includes options for password-protecting a post or making it stay at the top of your blog indefinitely (sticky). The Password protected option allows you to set an arbitrary password for each post. The Private option hides the post from everyone except editors and administrators. Publish (immediately) allows you to set a future or past date and time, so you can schedule a post to be published in the future or backdate a post.' ) .
|
490 |
+
'</li>';
|
491 |
+
|
492 |
+
if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) {
|
493 |
+
$publish_box .= '<li>' . __( '<strong>Format</strong> — Post Formats designate how your theme will display a specific post. For example, you could have a <em>standard</em> blog post with a title and paragraphs, or a short <em>aside</em> that omits the title and contains a short text blurb. Please refer to the Codex for <a href="https://codex.wordpress.org/Post_Formats#Supported_Formats">descriptions of each post format</a>. Your theme could enable all or some of 10 possible formats.' ) . '</li>';
|
494 |
+
}
|
495 |
+
|
496 |
+
if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) {
|
497 |
+
/* translators: %s: Featured Image */
|
498 |
+
$publish_box .= '<li>' . sprintf( __( '<strong>%s</strong> — This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the image as a post thumbnail on the home page, a custom header, etc.' ), esc_html( $post_type_object->labels->featured_image ) ) . '</li>';
|
499 |
+
}
|
500 |
+
|
501 |
+
$publish_box .= '</ul>';
|
502 |
+
|
503 |
+
get_current_screen()->add_help_tab( array(
|
504 |
+
'id' => 'publish-box',
|
505 |
+
'title' => __('Publish Settings'),
|
506 |
+
'content' => $publish_box,
|
507 |
+
) );
|
508 |
+
|
509 |
+
$discussion_settings = '<p>' . __('<strong>Send Trackbacks</strong> — Trackbacks are a way to notify legacy blog systems that you’ve linked to them. Enter the URL(s) you want to send trackbacks. If you link to other WordPress sites they’ll be notified automatically using pingbacks, and this field is unnecessary.') . '</p>';
|
510 |
+
$discussion_settings .= '<p>' . __('<strong>Discussion</strong> — You can turn comments and pings on or off, and if there are comments on the post, you can see them here and moderate them.') . '</p>';
|
511 |
+
|
512 |
+
get_current_screen()->add_help_tab( array(
|
513 |
+
'id' => 'discussion-settings',
|
514 |
+
'title' => __('Discussion Settings'),
|
515 |
+
'content' => $discussion_settings,
|
516 |
+
) );
|
517 |
+
} elseif ( 'page' == $post_type ) {
|
518 |
+
$page_attributes = '<p>' . __('<strong>Parent</strong> — You can arrange your pages in hierarchies. For example, you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how many levels you can nest pages.') . '</p>' .
|
519 |
+
'<p>' . __('<strong>Template</strong> — Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them in this dropdown menu.') . '</p>' .
|
520 |
+
'<p>' . __('<strong>Order</strong> — Pages are usually ordered alphabetically, but you can choose your own order by entering a number (1 for first, etc.) in this field.') . '</p>';
|
521 |
+
|
522 |
+
get_current_screen()->add_help_tab( array(
|
523 |
+
'id' => 'page-attributes',
|
524 |
+
'title' => __('Page Attributes'),
|
525 |
+
'content' => $page_attributes,
|
526 |
+
) );
|
527 |
+
}
|
528 |
+
|
529 |
+
require_once( ABSPATH . 'wp-admin/admin-header.php' );
|
530 |
+
?>
|
531 |
+
|
532 |
+
<div class="wrap">
|
533 |
+
<h1 class="wp-heading-inline"><?php
|
534 |
+
echo esc_html( $title );
|
535 |
+
?></h1>
|
536 |
+
|
537 |
+
<?php
|
538 |
+
if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) ) {
|
539 |
+
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
|
540 |
+
}
|
541 |
+
?>
|
542 |
+
|
543 |
+
<hr class="wp-header-end">
|
544 |
+
|
545 |
+
<?php if ( $notice ) : ?>
|
546 |
+
<div id="notice" class="notice notice-warning"><p id="has-newer-autosave"><?php echo $notice ?></p></div>
|
547 |
+
<?php endif; ?>
|
548 |
+
<?php if ( $message ) : ?>
|
549 |
+
<div id="message" class="updated notice notice-success is-dismissible"><p><?php echo $message; ?></p></div>
|
550 |
+
<?php endif; ?>
|
551 |
+
<div id="lost-connection-notice" class="error hidden">
|
552 |
+
<p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you’re reconnected.' ); ?>
|
553 |
+
<span class="hide-if-no-sessionstorage"><?php _e( 'We’re backing up this post in your browser, just in case.' ); ?></span>
|
554 |
+
</p>
|
555 |
+
</div>
|
556 |
+
<form name="post" action="post.php" method="post" id="post"<?php
|
557 |
+
/**
|
558 |
+
* Fires inside the post editor form tag.
|
559 |
+
*
|
560 |
+
* @since 3.0.0
|
561 |
+
*
|
562 |
+
* @param WP_Post $post Post object.
|
563 |
+
*/
|
564 |
+
do_action( 'post_edit_form_tag', $post );
|
565 |
+
|
566 |
+
$referer = wp_get_referer();
|
567 |
+
?>>
|
568 |
+
<?php wp_nonce_field($nonce_action); ?>
|
569 |
+
<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
|
570 |
+
<input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr( $form_action ) ?>" />
|
571 |
+
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr( $form_action ) ?>" />
|
572 |
+
<input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
|
573 |
+
<input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post_type ) ?>" />
|
574 |
+
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status) ?>" />
|
575 |
+
<input type="hidden" id="referredby" name="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>" />
|
576 |
+
<?php if ( ! empty( $active_post_lock ) ) { ?>
|
577 |
+
<input type="hidden" id="active_post_lock" value="<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>" />
|
578 |
+
<?php
|
579 |
+
}
|
580 |
+
if ( 'draft' != get_post_status( $post ) )
|
581 |
+
wp_original_referer_field(true, 'previous');
|
582 |
+
|
583 |
+
echo $form_extra;
|
584 |
+
|
585 |
+
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
586 |
+
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
587 |
+
?>
|
588 |
+
|
589 |
+
<?php
|
590 |
+
/**
|
591 |
+
* Fires at the beginning of the edit form.
|
592 |
+
*
|
593 |
+
* At this point, the required hidden fields and nonces have already been output.
|
594 |
+
*
|
595 |
+
* @since 3.7.0
|
596 |
+
*
|
597 |
+
* @param WP_Post $post Post object.
|
598 |
+
*/
|
599 |
+
do_action( 'edit_form_top', $post ); ?>
|
600 |
+
|
601 |
+
<div id="poststuff">
|
602 |
+
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
|
603 |
+
<div id="post-body-content">
|
604 |
+
|
605 |
+
<?php if ( post_type_supports($post_type, 'title') ) { ?>
|
606 |
+
<div id="titlediv">
|
607 |
+
<div id="titlewrap">
|
608 |
+
<?php
|
609 |
+
/**
|
610 |
+
* Filters the title field placeholder text.
|
611 |
+
*
|
612 |
+
* @since 3.1.0
|
613 |
+
*
|
614 |
+
* @param string $text Placeholder text. Default 'Enter title here'.
|
615 |
+
* @param WP_Post $post Post object.
|
616 |
+
*/
|
617 |
+
$title_placeholder = apply_filters( 'enter_title_here', __( 'Enter title here' ), $post );
|
618 |
+
?>
|
619 |
+
<label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $title_placeholder; ?></label>
|
620 |
+
<input type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" spellcheck="true" autocomplete="off" />
|
621 |
+
</div>
|
622 |
+
<?php
|
623 |
+
/**
|
624 |
+
* Fires before the permalink field in the edit form.
|
625 |
+
*
|
626 |
+
* @since 4.1.0
|
627 |
+
*
|
628 |
+
* @param WP_Post $post Post object.
|
629 |
+
*/
|
630 |
+
do_action( 'edit_form_before_permalink', $post );
|
631 |
+
?>
|
632 |
+
<div class="inside">
|
633 |
+
<?php
|
634 |
+
if ( $viewable ) :
|
635 |
+
$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';
|
636 |
+
|
637 |
+
// As of 4.4, the Get Shortlink button is hidden by default.
|
638 |
+
if ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) ) {
|
639 |
+
$shortlink = wp_get_shortlink($post->ID, 'post');
|
640 |
+
|
641 |
+
if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) ) {
|
642 |
+
$sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><button type="button" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val());">' . __( 'Get Shortlink' ) . '</button>';
|
643 |
+
}
|
644 |
+
}
|
645 |
+
|
646 |
+
if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {
|
647 |
+
$has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status;
|
648 |
+
?>
|
649 |
+
<div id="edit-slug-box" class="hide-if-no-js">
|
650 |
+
<?php
|
651 |
+
if ( $has_sample_permalink )
|
652 |
+
echo $sample_permalink_html;
|
653 |
+
?>
|
654 |
+
</div>
|
655 |
+
<?php
|
656 |
+
}
|
657 |
+
endif;
|
658 |
+
?>
|
659 |
+
</div>
|
660 |
+
<?php
|
661 |
+
wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
|
662 |
+
?>
|
663 |
+
</div><!-- /titlediv -->
|
664 |
+
<?php
|
665 |
+
}
|
666 |
+
/**
|
667 |
+
* Fires after the title field.
|
668 |
+
*
|
669 |
+
* @since 3.5.0
|
670 |
+
*
|
671 |
+
* @param WP_Post $post Post object.
|
672 |
+
*/
|
673 |
+
do_action( 'edit_form_after_title', $post );
|
674 |
+
|
675 |
+
if ( post_type_supports($post_type, 'editor') ) {
|
676 |
+
?>
|
677 |
+
<div id="postdivrich" class="postarea<?php if ( $_wp_editor_expand ) { echo ' wp-editor-expand'; } ?>">
|
678 |
+
|
679 |
+
<?php wp_editor( $post->post_content, 'content', array(
|
680 |
+
'_content_editor_dfw' => $_content_editor_dfw,
|
681 |
+
'drag_drop_upload' => true,
|
682 |
+
'tabfocus_elements' => 'content-html,save-post',
|
683 |
+
'editor_height' => 300,
|
684 |
+
'tinymce' => array(
|
685 |
+
'resize' => false,
|
686 |
+
'wp_autoresize_on' => $_wp_editor_expand,
|
687 |
+
'add_unload_trigger' => false,
|
688 |
+
),
|
689 |
+
) ); ?>
|
690 |
+
<table id="post-status-info"><tbody><tr>
|
691 |
+
<td id="wp-word-count" class="hide-if-no-js"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
|
692 |
+
<td class="autosave-info">
|
693 |
+
<span class="autosave-message"> </span>
|
694 |
+
<?php
|
695 |
+
if ( 'auto-draft' != $post->post_status ) {
|
696 |
+
echo '<span id="last-edit">';
|
697 |
+
if ( $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ) ) {
|
698 |
+
/* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time */
|
699 |
+
printf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
|
700 |
+
} else {
|
701 |
+
/* translators: 1: Post edited date, 2: Post edited time */
|
702 |
+
printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
|
703 |
+
}
|
704 |
+
echo '</span>';
|
705 |
+
} ?>
|
706 |
+
</td>
|
707 |
+
<td id="content-resize-handle" class="hide-if-no-js"><br /></td>
|
708 |
+
</tr></tbody></table>
|
709 |
+
|
710 |
+
</div>
|
711 |
+
<?php }
|
712 |
+
/**
|
713 |
+
* Fires after the content editor.
|
714 |
+
*
|
715 |
+
* @since 3.5.0
|
716 |
+
*
|
717 |
+
* @param WP_Post $post Post object.
|
718 |
+
*/
|
719 |
+
do_action( 'edit_form_after_editor', $post );
|
720 |
+
?>
|
721 |
+
</div><!-- /post-body-content -->
|
722 |
+
|
723 |
+
<div id="postbox-container-1" class="postbox-container">
|
724 |
+
<?php
|
725 |
+
|
726 |
+
if ( 'page' == $post_type ) {
|
727 |
+
/**
|
728 |
+
* Fires before meta boxes with 'side' context are output for the 'page' post type.
|
729 |
+
*
|
730 |
+
* The submitpage box is a meta box with 'side' context, so this hook fires just before it is output.
|
731 |
+
*
|
732 |
+
* @since 2.5.0
|
733 |
+
*
|
734 |
+
* @param WP_Post $post Post object.
|
735 |
+
*/
|
736 |
+
do_action( 'submitpage_box', $post );
|
737 |
+
}
|
738 |
+
else {
|
739 |
+
/**
|
740 |
+
* Fires before meta boxes with 'side' context are output for all post types other than 'page'.
|
741 |
+
*
|
742 |
+
* The submitpost box is a meta box with 'side' context, so this hook fires just before it is output.
|
743 |
+
*
|
744 |
+
* @since 2.5.0
|
745 |
+
*
|
746 |
+
* @param WP_Post $post Post object.
|
747 |
+
*/
|
748 |
+
do_action( 'submitpost_box', $post );
|
749 |
+
}
|
750 |
+
|
751 |
+
|
752 |
+
do_meta_boxes($post_type, 'side', $post);
|
753 |
+
|
754 |
+
?>
|
755 |
+
</div>
|
756 |
+
<div id="postbox-container-2" class="postbox-container">
|
757 |
+
<?php
|
758 |
+
|
759 |
+
do_meta_boxes(null, 'normal', $post);
|
760 |
+
|
761 |
+
if ( 'page' == $post_type ) {
|
762 |
+
/**
|
763 |
+
* Fires after 'normal' context meta boxes have been output for the 'page' post type.
|
764 |
+
*
|
765 |
+
* @since 1.5.0
|
766 |
+
*
|
767 |
+
* @param WP_Post $post Post object.
|
768 |
+
*/
|
769 |
+
do_action( 'edit_page_form', $post );
|
770 |
+
}
|
771 |
+
else {
|
772 |
+
/**
|
773 |
+
* Fires after 'normal' context meta boxes have been output for all post types other than 'page'.
|
774 |
+
*
|
775 |
+
* @since 1.5.0
|
776 |
+
*
|
777 |
+
* @param WP_Post $post Post object.
|
778 |
+
*/
|
779 |
+
do_action( 'edit_form_advanced', $post );
|
780 |
+
}
|
781 |
+
|
782 |
+
|
783 |
+
do_meta_boxes(null, 'advanced', $post);
|
784 |
+
|
785 |
+
?>
|
786 |
+
</div>
|
787 |
+
<?php
|
788 |
+
/**
|
789 |
+
* Fires after all meta box sections have been output, before the closing #post-body div.
|
790 |
+
*
|
791 |
+
* @since 2.1.0
|
792 |
+
*
|
793 |
+
* @param WP_Post $post Post object.
|
794 |
+
*/
|
795 |
+
do_action( 'dbx_post_sidebar', $post );
|
796 |
+
|
797 |
+
?>
|
798 |
+
</div><!-- /post-body -->
|
799 |
+
<br class="clear" />
|
800 |
+
</div><!-- /poststuff -->
|
801 |
+
</form>
|
802 |
+
</div>
|
803 |
+
|
804 |
+
<?php
|
805 |
+
if ( post_type_supports( $post_type, 'comments' ) )
|
806 |
+
wp_comment_reply();
|
807 |
+
?>
|
808 |
+
|
809 |
+
<?php if ( ! wp_is_mobile() && post_type_supports( $post_type, 'title' ) && '' === $post->post_title ) : ?>
|
810 |
+
<script type="text/javascript">
|
811 |
+
try{document.post.title.focus();}catch(e){}
|
812 |
+
</script>
|
813 |
+
<?php endif; ?>
|
lib/classic-editor/css/edit-rtl.css
ADDED
@@ -0,0 +1,1573 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#poststuff {
|
2 |
+
padding-top: 10px;
|
3 |
+
min-width: 763px;
|
4 |
+
}
|
5 |
+
|
6 |
+
#poststuff #post-body {
|
7 |
+
padding: 0;
|
8 |
+
}
|
9 |
+
|
10 |
+
#poststuff .postbox-container {
|
11 |
+
width: 100%;
|
12 |
+
}
|
13 |
+
|
14 |
+
#poststuff #post-body.columns-2 {
|
15 |
+
margin-left: 300px;
|
16 |
+
}
|
17 |
+
|
18 |
+
/*------------------------------------------------------------------------------
|
19 |
+
11.0 - Write/Edit Post Screen
|
20 |
+
------------------------------------------------------------------------------*/
|
21 |
+
|
22 |
+
#show-comments {
|
23 |
+
overflow: hidden;
|
24 |
+
}
|
25 |
+
|
26 |
+
#save-action .spinner,
|
27 |
+
#show-comments a {
|
28 |
+
float: right;
|
29 |
+
}
|
30 |
+
|
31 |
+
#show-comments .spinner {
|
32 |
+
float: none;
|
33 |
+
margin-top: 0;
|
34 |
+
}
|
35 |
+
|
36 |
+
#lost-connection-notice .spinner {
|
37 |
+
visibility: visible;
|
38 |
+
float: right;
|
39 |
+
margin: 0 0 0 5px;
|
40 |
+
}
|
41 |
+
|
42 |
+
#titlediv {
|
43 |
+
position: relative;
|
44 |
+
}
|
45 |
+
|
46 |
+
#titlediv label {
|
47 |
+
cursor: text;
|
48 |
+
}
|
49 |
+
|
50 |
+
#titlediv div.inside {
|
51 |
+
margin: 0;
|
52 |
+
}
|
53 |
+
|
54 |
+
#poststuff #titlewrap {
|
55 |
+
border: 0;
|
56 |
+
padding: 0;
|
57 |
+
}
|
58 |
+
|
59 |
+
#titlediv #title {
|
60 |
+
padding: 3px 8px;
|
61 |
+
font-size: 1.7em;
|
62 |
+
line-height: 100%;
|
63 |
+
height: 1.7em;
|
64 |
+
width: 100%;
|
65 |
+
outline: none;
|
66 |
+
margin: 0 0 3px;
|
67 |
+
background-color: #fff;
|
68 |
+
}
|
69 |
+
|
70 |
+
#titlediv #title-prompt-text {
|
71 |
+
color: #72777c;
|
72 |
+
position: absolute;
|
73 |
+
font-size: 1.7em;
|
74 |
+
padding: 11px 10px;
|
75 |
+
}
|
76 |
+
|
77 |
+
input#link_description,
|
78 |
+
input#link_url {
|
79 |
+
width: 98%;
|
80 |
+
}
|
81 |
+
|
82 |
+
#pending {
|
83 |
+
background: 100% none;
|
84 |
+
border: 0 none;
|
85 |
+
padding: 0;
|
86 |
+
font-size: 11px;
|
87 |
+
margin-top: -1px;
|
88 |
+
}
|
89 |
+
|
90 |
+
#edit-slug-box,
|
91 |
+
#comment-link-box {
|
92 |
+
line-height: 24px;
|
93 |
+
min-height: 25px; /* Yes, line-height + 1 */
|
94 |
+
margin-top: 5px;
|
95 |
+
padding: 0 10px;
|
96 |
+
color: #666;
|
97 |
+
}
|
98 |
+
|
99 |
+
#edit-slug-box .cancel {
|
100 |
+
margin-left: 10px;
|
101 |
+
padding: 0;
|
102 |
+
font-size: 11px;
|
103 |
+
}
|
104 |
+
|
105 |
+
#comment-link-box {
|
106 |
+
margin: 5px 0;
|
107 |
+
padding: 0 5px;
|
108 |
+
}
|
109 |
+
|
110 |
+
#editable-post-name-full {
|
111 |
+
display: none;
|
112 |
+
}
|
113 |
+
|
114 |
+
#editable-post-name {
|
115 |
+
font-weight: 600;
|
116 |
+
}
|
117 |
+
|
118 |
+
#editable-post-name input {
|
119 |
+
font-size: 13px;
|
120 |
+
font-weight: 400;
|
121 |
+
height: 24px;
|
122 |
+
margin: 0;
|
123 |
+
width: 16em;
|
124 |
+
}
|
125 |
+
|
126 |
+
.postarea h3 label {
|
127 |
+
float: right;
|
128 |
+
}
|
129 |
+
|
130 |
+
body.post-new-php .submitbox .submitdelete {
|
131 |
+
display: none;
|
132 |
+
}
|
133 |
+
|
134 |
+
.submitbox .submit a:hover {
|
135 |
+
text-decoration: underline;
|
136 |
+
}
|
137 |
+
|
138 |
+
.submitbox .submit input {
|
139 |
+
margin-bottom: 8px;
|
140 |
+
margin-left: 4px;
|
141 |
+
padding: 6px;
|
142 |
+
}
|
143 |
+
|
144 |
+
#post-status-select {
|
145 |
+
margin-top: 3px;
|
146 |
+
}
|
147 |
+
|
148 |
+
/* Post Screen */
|
149 |
+
#post-body #normal-sortables {
|
150 |
+
min-height: 50px;
|
151 |
+
}
|
152 |
+
|
153 |
+
.postbox {
|
154 |
+
position: relative;
|
155 |
+
min-width: 255px;
|
156 |
+
border: 1px solid #e5e5e5;
|
157 |
+
box-shadow: 0 1px 1px rgba(0,0,0,0.04);
|
158 |
+
background: #fff;
|
159 |
+
}
|
160 |
+
|
161 |
+
#trackback_url {
|
162 |
+
width: 99%;
|
163 |
+
}
|
164 |
+
|
165 |
+
#normal-sortables .postbox .submit {
|
166 |
+
background: transparent none;
|
167 |
+
border: 0 none;
|
168 |
+
float: left;
|
169 |
+
padding: 0 12px;
|
170 |
+
margin:0;
|
171 |
+
}
|
172 |
+
|
173 |
+
.category-add input[type="text"],
|
174 |
+
.category-add select {
|
175 |
+
width: 100%;
|
176 |
+
max-width: 260px;
|
177 |
+
vertical-align: baseline;
|
178 |
+
}
|
179 |
+
|
180 |
+
#side-sortables .category-add input[type="text"],
|
181 |
+
#side-sortables .category-add select {
|
182 |
+
margin: 0 0 1em;
|
183 |
+
}
|
184 |
+
|
185 |
+
ul.category-tabs li,
|
186 |
+
#side-sortables .add-menu-item-tabs li,
|
187 |
+
.wp-tab-bar li {
|
188 |
+
display: inline;
|
189 |
+
line-height: 1.35em;
|
190 |
+
}
|
191 |
+
|
192 |
+
.no-js .category-tabs li.hide-if-no-js {
|
193 |
+
display: none;
|
194 |
+
}
|
195 |
+
|
196 |
+
.category-tabs a,
|
197 |
+
#side-sortables .add-menu-item-tabs a,
|
198 |
+
.wp-tab-bar a {
|
199 |
+
text-decoration: none;
|
200 |
+
}
|
201 |
+
|
202 |
+
/* @todo: do these really need to be so specific? */
|
203 |
+
#side-sortables .category-tabs .tabs a,
|
204 |
+
#side-sortables .add-menu-item-tabs .tabs a,
|
205 |
+
.wp-tab-bar .wp-tab-active a,
|
206 |
+
#post-body ul.category-tabs li.tabs a,
|
207 |
+
#post-body ul.add-menu-item-tabs li.tabs a {
|
208 |
+
color: #32373c;
|
209 |
+
}
|
210 |
+
|
211 |
+
.category-tabs {
|
212 |
+
margin: 8px 0 5px;
|
213 |
+
}
|
214 |
+
|
215 |
+
/* Back-compat for pre-4.4 */
|
216 |
+
#category-adder h4 {
|
217 |
+
margin: 0;
|
218 |
+
}
|
219 |
+
|
220 |
+
.taxonomy-add-new {
|
221 |
+
display: inline-block;
|
222 |
+
margin: 10px 0;
|
223 |
+
font-weight: 600;
|
224 |
+
}
|
225 |
+
|
226 |
+
#side-sortables .add-menu-item-tabs,
|
227 |
+
.wp-tab-bar {
|
228 |
+
margin-bottom: 3px;
|
229 |
+
}
|
230 |
+
|
231 |
+
#normal-sortables .postbox #replyrow .submit {
|
232 |
+
float: none;
|
233 |
+
margin: 0;
|
234 |
+
padding: 5px 7px 10px;
|
235 |
+
overflow: hidden;
|
236 |
+
}
|
237 |
+
|
238 |
+
#side-sortables .submitbox .submit input,
|
239 |
+
#side-sortables .submitbox .submit .preview,
|
240 |
+
#side-sortables .submitbox .submit a.preview:hover {
|
241 |
+
border: 0 none;
|
242 |
+
}
|
243 |
+
|
244 |
+
/* @todo: make this a more generic class */
|
245 |
+
ul.category-tabs,
|
246 |
+
ul.add-menu-item-tabs,
|
247 |
+
ul.wp-tab-bar {
|
248 |
+
margin-top: 12px;
|
249 |
+
}
|
250 |
+
|
251 |
+
ul.category-tabs li,
|
252 |
+
ul.add-menu-item-tabs li {
|
253 |
+
border: solid 1px transparent;
|
254 |
+
position: relative;
|
255 |
+
}
|
256 |
+
|
257 |
+
ul.category-tabs li.tabs,
|
258 |
+
ul.add-menu-item-tabs li.tabs,
|
259 |
+
.wp-tab-active {
|
260 |
+
border: 1px solid #ddd;
|
261 |
+
border-bottom-color: #fdfdfd;
|
262 |
+
background-color: #fdfdfd;
|
263 |
+
}
|
264 |
+
|
265 |
+
ul.category-tabs li,
|
266 |
+
ul.add-menu-item-tabs li,
|
267 |
+
ul.wp-tab-bar li {
|
268 |
+
padding: 3px 5px 6px;
|
269 |
+
}
|
270 |
+
|
271 |
+
#set-post-thumbnail {
|
272 |
+
display: inline-block;
|
273 |
+
max-width: 100%;
|
274 |
+
}
|
275 |
+
|
276 |
+
#postimagediv .inside img {
|
277 |
+
max-width: 100%;
|
278 |
+
height: auto;
|
279 |
+
width: auto;
|
280 |
+
vertical-align: top;
|
281 |
+
background-image: linear-gradient(-45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4), linear-gradient(-45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4);
|
282 |
+
background-position: 100% 0, 10px 10px;
|
283 |
+
background-size: 20px 20px;
|
284 |
+
}
|
285 |
+
|
286 |
+
form#tags-filter {
|
287 |
+
position: relative;
|
288 |
+
}
|
289 |
+
|
290 |
+
/* Global classes */
|
291 |
+
.wp-hidden-children .wp-hidden-child,
|
292 |
+
.ui-tabs-hide {
|
293 |
+
display: none;
|
294 |
+
}
|
295 |
+
|
296 |
+
#post-body .tagsdiv #newtag {
|
297 |
+
margin-left: 5px;
|
298 |
+
width: 16em;
|
299 |
+
}
|
300 |
+
|
301 |
+
#side-sortables input#post_password {
|
302 |
+
width: 94%
|
303 |
+
}
|
304 |
+
|
305 |
+
#side-sortables .tagsdiv #newtag {
|
306 |
+
width: 68%;
|
307 |
+
}
|
308 |
+
|
309 |
+
#post-status-info {
|
310 |
+
width: 100%;
|
311 |
+
border-spacing: 0;
|
312 |
+
border: 1px solid #e5e5e5;
|
313 |
+
border-top: none;
|
314 |
+
background-color: #f7f7f7;
|
315 |
+
box-shadow: 0 1px 1px rgba(0,0,0,0.04);
|
316 |
+
z-index: 999;
|
317 |
+
}
|
318 |
+
|
319 |
+
#post-status-info td {
|
320 |
+
font-size: 12px;
|
321 |
+
}
|
322 |
+
|
323 |
+
.autosave-info {
|
324 |
+
padding: 2px 10px;
|
325 |
+
text-align: left;
|
326 |
+
}
|
327 |
+
|
328 |
+
#editorcontent #post-status-info {
|
329 |
+
border: none;
|
330 |
+
}
|
331 |
+
|
332 |
+
#content-resize-handle {
|
333 |
+
background: transparent url(../images/resize.gif) no-repeat scroll right bottom;
|
334 |
+
width: 12px;
|
335 |
+
cursor: row-resize;
|
336 |
+
}
|
337 |
+
|
338 |
+
/*rtl:ignore*/
|
339 |
+
.rtl #content-resize-handle {
|
340 |
+
background-image: url(../images/resize-rtl.gif);
|
341 |
+
background-position: left bottom;
|
342 |
+
}
|
343 |
+
|
344 |
+
.wp-editor-expand #content-resize-handle {
|
345 |
+
display: none;
|
346 |
+
}
|
347 |
+
|
348 |
+
#postdivrich #content {
|
349 |
+
resize: none;
|
350 |
+
}
|
351 |
+
|
352 |
+
#wp-word-count {
|
353 |
+
display: block;
|
354 |
+
padding: 2px 10px;
|
355 |
+
}
|
356 |
+
|
357 |
+
#wp-content-editor-container {
|
358 |
+
position: relative;
|
359 |
+
}
|
360 |
+
|
361 |
+
.wp-editor-expand #wp-content-editor-tools {
|
362 |
+
z-index: 1000;
|
363 |
+
border-bottom: 1px solid #e5e5e5;
|
364 |
+
}
|
365 |
+
|
366 |
+
.wp-editor-expand #wp-content-editor-container {
|
367 |
+
box-shadow: none;
|
368 |
+
margin-top: -1px;
|
369 |
+
}
|
370 |
+
|
371 |
+
.wp-editor-expand #wp-content-editor-container {
|
372 |
+
border-bottom: 0 none;
|
373 |
+
}
|
374 |
+
|
375 |
+
.wp-editor-expand div.mce-statusbar {
|
376 |
+
z-index: 1;
|
377 |
+
}
|
378 |
+
|
379 |
+
.wp-editor-expand #post-status-info {
|
380 |
+
border-top: 1px solid #e5e5e5;
|
381 |
+
}
|
382 |
+
|
383 |
+
.wp-editor-expand div.mce-toolbar-grp {
|
384 |
+
z-index: 999;
|
385 |
+
}
|
386 |
+
|
387 |
+
/* TinyMCE native fullscreen mode override */
|
388 |
+
.mce-fullscreen #wp-content-wrap .mce-menubar,
|
389 |
+
.mce-fullscreen #wp-content-wrap .mce-toolbar-grp,
|
390 |
+
.mce-fullscreen #wp-content-wrap .mce-edit-area,
|
391 |
+
.mce-fullscreen #wp-content-wrap .mce-statusbar {
|
392 |
+
position: static !important;
|
393 |
+
width: auto !important;
|
394 |
+
padding: 0 !important;
|
395 |
+
}
|
396 |
+
|
397 |
+
.mce-fullscreen #wp-content-wrap .mce-statusbar {
|
398 |
+
visibility: visible !important;
|
399 |
+
}
|
400 |
+
|
401 |
+
.mce-fullscreen #wp-content-wrap .mce-tinymce .mce-wp-dfw {
|
402 |
+
display: none;
|
403 |
+
}
|
404 |
+
|
405 |
+
.post-php.mce-fullscreen #wpadminbar,
|
406 |
+
.mce-fullscreen #wp-content-wrap .mce-wp-dfw {
|
407 |
+
display: none;
|
408 |
+
}
|
409 |
+
/* End TinyMCE native fullscreen mode override */
|
410 |
+
|
411 |
+
#wp-content-editor-tools {
|
412 |
+
background-color: #f1f1f1;
|
413 |
+
padding-top: 20px;
|
414 |
+
}
|
415 |
+
|
416 |
+
#poststuff #post-body.columns-2 #side-sortables {
|
417 |
+
width: 280px;
|
418 |
+
}
|
419 |
+
|
420 |
+
#timestampdiv select {
|
421 |
+
height: 21px;
|
422 |
+
line-height: 14px;
|
423 |
+
padding: 0;
|
424 |
+
vertical-align: top;
|
425 |
+
font-size: 12px;
|
426 |
+
}
|
427 |
+
|
428 |
+
#aa, #jj, #hh, #mn {
|
429 |
+
padding: 1px;
|
430 |
+
font-size: 12px;
|
431 |
+
}
|
432 |
+
|
433 |
+
#jj, #hh, #mn {
|
434 |
+
width: 2em;
|
435 |
+
}
|
436 |
+
|
437 |
+
#aa {
|
438 |
+
width: 3.4em;
|
439 |
+
}
|
440 |
+
|
441 |
+
.curtime #timestamp {
|
442 |
+
padding: 2px 0 1px 0;
|
443 |
+
display: inline !important;
|
444 |
+
height: auto !important;
|
445 |
+
}
|
446 |
+
|
447 |
+
#post-body .misc-pub-post-status:before,
|
448 |
+
#post-body #visibility:before,
|
449 |
+
.curtime #timestamp:before,
|
450 |
+
#post-body .misc-pub-revisions:before,
|
451 |
+
span.wp-media-buttons-icon:before {
|
452 |
+
color: #82878c;
|
453 |
+
}
|
454 |
+
|
455 |
+
#post-body .misc-pub-post-status:before,
|
456 |
+
#post-body #visibility:before,
|
457 |
+
.curtime #timestamp:before,
|
458 |
+
#post-body .misc-pub-revisions:before {
|
459 |
+
font: normal 20px/1 dashicons;
|
460 |
+
speak: none;
|
461 |
+
display: inline-block;
|
462 |
+
margin-right: -1px;
|
463 |
+
padding-left: 3px;
|
464 |
+
vertical-align: top;
|
465 |
+
-webkit-font-smoothing: antialiased;
|
466 |
+
-moz-osx-font-smoothing: grayscale;
|
467 |
+
}
|
468 |
+
|
469 |
+
#post-body .misc-pub-post-status:before {
|
470 |
+
content: "\f173";
|
471 |
+
}
|
472 |
+
|
473 |
+
#post-body #visibility:before {
|
474 |
+
content: "\f177";
|
475 |
+
}
|
476 |
+
|
477 |
+
.curtime #timestamp:before {
|
478 |
+
content: "\f145";
|
479 |
+
position: relative;
|
480 |
+
top: -1px;
|
481 |
+
}
|
482 |
+
|
483 |
+
#post-body .misc-pub-revisions:before {
|
484 |
+
content: "\f321";
|
485 |
+
}
|
486 |
+
|
487 |
+
#timestampdiv {
|
488 |
+
padding-top: 5px;
|
489 |
+
line-height: 23px;
|
490 |
+
}
|
491 |
+
|
492 |
+
#timestampdiv p {
|
493 |
+
margin: 8px 0 6px;
|
494 |
+
}
|
495 |
+
|
496 |
+
#timestampdiv input {
|
497 |
+
border-width: 1px;
|
498 |
+
border-style: solid;
|
499 |
+
}
|
500 |
+
|
501 |
+
.notification-dialog {
|
502 |
+
position: fixed;
|
503 |
+
top: 30%;
|
504 |
+
max-height: 70%;
|
505 |
+
right: 50%;
|
506 |
+
width: 450px;
|
507 |
+
margin-right: -225px;
|
508 |
+
background: #fff;
|
509 |
+
box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
|
510 |
+
line-height: 1.5;
|
511 |
+
z-index: 1000005;
|
512 |
+
overflow-y: auto;
|
513 |
+
}
|
514 |
+
|
515 |
+
.notification-dialog-background {
|
516 |
+
position: fixed;
|
517 |
+
top: 0;
|
518 |
+
right: 0;
|
519 |
+
left: 0;
|
520 |
+
bottom: 0;
|
521 |
+
background: #000;
|
522 |
+
opacity: 0.7;
|
523 |
+
filter: alpha(opacity=70);
|
524 |
+
z-index: 1000000;
|
525 |
+
}
|
526 |
+
|
527 |
+
#post-lock-dialog .post-locked-message,
|
528 |
+
#post-lock-dialog .post-taken-over {
|
529 |
+
margin: 25px;
|
530 |
+
}
|
531 |
+
|
532 |
+
#post-lock-dialog .post-locked-message a.button,
|
533 |
+
#file-editor-warning .button {
|
534 |
+
margin-left: 10px;
|
535 |
+
}
|
536 |
+
|
537 |
+
#post-lock-dialog .post-locked-avatar {
|
538 |
+
float: right;
|
539 |
+
margin: 0 0 20px 20px;
|
540 |
+
}
|
541 |
+
|
542 |
+
#post-lock-dialog .wp-tab-first {
|
543 |
+
outline: 0;
|
544 |
+
}
|
545 |
+
|
546 |
+
#post-lock-dialog .locked-saving img {
|
547 |
+
float: right;
|
548 |
+
margin-left: 3px;
|
549 |
+
}
|
550 |
+
|
551 |
+
#post-lock-dialog.saving .locked-saving,
|
552 |
+
#post-lock-dialog.saved .locked-saved {
|
553 |
+
display: inline;
|
554 |
+
}
|
555 |
+
|
556 |
+
#excerpt {
|
557 |
+
display: block;
|
558 |
+
margin: 12px 0 0;
|
559 |
+
height: 4em;
|
560 |
+
width: 100%;
|
561 |
+
}
|
562 |
+
|
563 |
+
.tagchecklist {
|
564 |
+
margin-right: 14px;
|
565 |
+
font-size: 12px;
|
566 |
+
overflow: auto;
|
567 |
+
}
|
568 |
+
|
569 |
+
.tagchecklist br {
|
570 |
+
display: none;
|
571 |
+
}
|
572 |
+
|
573 |
+
.tagchecklist strong {
|
574 |
+
margin-right: -8px;
|
575 |
+
position: absolute;
|
576 |
+
}
|
577 |
+
|
578 |
+
.tagchecklist > li {
|
579 |
+
float: right;
|
580 |
+
margin-left: 25px;
|
581 |
+
font-size: 13px;
|
582 |
+
line-height: 1.8em;
|
583 |
+
cursor: default;
|
584 |
+
max-width: 100%;
|
585 |
+
overflow: hidden;
|
586 |
+
text-overflow: ellipsis;
|
587 |
+
}
|
588 |
+
|
589 |
+
.tagchecklist .ntdelbutton {
|
590 |
+
position: absolute;
|
591 |
+
width: 24px;
|
592 |
+
height: 24px;
|
593 |
+
border: none;
|
594 |
+
margin: 0 -19px 0 0;
|
595 |
+
padding: 0;
|
596 |
+
background: none;
|
597 |
+
cursor: pointer;
|
598 |
+
text-indent: 0;
|
599 |
+
}
|
600 |
+
|
601 |
+
#poststuff h3.hndle, /* Back-compat for pre-4.4 */
|
602 |
+
#poststuff .stuffbox > h3, /* Back-compat for pre-4.4 */
|
603 |
+
#poststuff h2 {
|
604 |
+
font-size: 14px;
|
605 |
+
padding: 8px 12px;
|
606 |
+
margin: 0;
|
607 |
+
line-height: 1.4;
|
608 |
+
}
|
609 |
+
|
610 |
+
#poststuff .inside {
|
611 |
+
margin: 6px 0 0 0;
|
612 |
+
}
|
613 |
+
|
614 |
+
#poststuff .inside #parent_id,
|
615 |
+
#poststuff .inside #page_template {
|
616 |
+
max-width: 100%;
|
617 |
+
}
|
618 |
+
|
619 |
+
.ie8 #poststuff .inside #parent_id,
|
620 |
+
.ie8 #poststuff .inside #page_template {
|
621 |
+
width: 250px;
|
622 |
+
}
|
623 |
+
|
624 |
+
.post-attributes-label-wrapper {
|
625 |
+
margin-bottom: 0.5em;
|
626 |
+
}
|
627 |
+
|
628 |
+
.post-attributes-label {
|
629 |
+
vertical-align: baseline;
|
630 |
+
font-weight: 600;
|
631 |
+
}
|
632 |
+
|
633 |
+
#post-visibility-select {
|
634 |
+
line-height: 1.5em;
|
635 |
+
margin-top: 3px;
|
636 |
+
}
|
637 |
+
|
638 |
+
#linksubmitdiv .inside, /* Old Link Manager back-compat. */
|
639 |
+
#poststuff #submitdiv .inside {
|
640 |
+
margin: 0;
|
641 |
+
padding: 0;
|
642 |
+
}
|
643 |
+
|
644 |
+
#post-body-content,
|
645 |
+
.edit-form-section {
|
646 |
+
margin-bottom: 20px;
|
647 |
+
}
|
648 |
+
|
649 |
+
/*------------------------------------------------------------------------------
|
650 |
+
11.1 - Custom Fields
|
651 |
+
------------------------------------------------------------------------------*/
|
652 |
+
|
653 |
+
#postcustomstuff thead th {
|
654 |
+
padding: 5px 8px 8px;
|
655 |
+
background-color: #f1f1f1;
|
656 |
+
}
|
657 |
+
|
658 |
+
#postcustom #postcustomstuff .submit {
|
659 |
+
border: 0 none;
|
660 |
+
float: none;
|
661 |
+
padding: 0 8px 8px;
|
662 |
+
}
|
663 |
+
|
664 |
+
#side-sortables #postcustom #postcustomstuff .submit {
|
665 |
+
margin: 0;
|
666 |
+
padding: 0;
|
667 |
+
}
|
668 |
+
|
669 |
+
#side-sortables #postcustom #postcustomstuff #the-list textarea {
|
670 |
+
height: 85px;
|
671 |
+
}
|
672 |
+
|
673 |
+
#side-sortables #postcustom #postcustomstuff td.left input,
|
674 |
+
#side-sortables #postcustom #postcustomstuff td.left select,
|
675 |
+
#side-sortables #postcustomstuff #newmetaleft a {
|
676 |
+
margin: 3px 3px 0;
|
677 |
+
}
|
678 |
+
|
679 |
+
#postcustomstuff table {
|
680 |
+
margin: 0;
|
681 |
+
width: 100%;
|
682 |
+
border: 1px solid #ddd;
|
683 |
+
border-spacing: 0;
|
684 |
+
background-color: #f9f9f9;
|
685 |
+
}
|
686 |
+
|
687 |
+
#postcustomstuff tr {
|
688 |
+
vertical-align: top;
|
689 |
+
}
|
690 |
+
|
691 |
+
#postcustomstuff table input,
|
692 |
+
#postcustomstuff table select,
|
693 |
+
#postcustomstuff table textarea {
|
694 |
+
width: 96%;
|
695 |
+
margin: 8px;
|
696 |
+
}
|
697 |
+
|
698 |
+
#side-sortables #postcustomstuff table input,
|
699 |
+
#side-sortables #postcustomstuff table select,
|
700 |
+
#side-sortables #postcustomstuff table textarea {
|
701 |
+
margin: 3px;
|
702 |
+
}
|
703 |
+
|
704 |
+
#postcustomstuff th.left,
|
705 |
+
#postcustomstuff td.left {
|
706 |
+
width: 38%;
|
707 |
+
}
|
708 |
+
|
709 |
+
#postcustomstuff .submit input {
|
710 |
+
margin: 0;
|
711 |
+
width: auto;
|
712 |
+
}
|
713 |
+
|
714 |
+
#postcustomstuff #newmetaleft a {
|
715 |
+
display: inline-block;
|
716 |
+
margin: 0 8px 8px;
|
717 |
+
text-decoration: none;
|
718 |
+
}
|
719 |
+
|
720 |
+
.no-js #postcustomstuff #enternew {
|
721 |
+
display: none;
|
722 |
+
}
|
723 |
+
|
724 |
+
#post-body-content .compat-attachment-fields {
|
725 |
+
margin-bottom: 20px;
|
726 |
+
}
|
727 |
+
|
728 |
+
.compat-attachment-fields th {
|
729 |
+
padding-top: 5px;
|
730 |
+
padding-left: 10px;
|
731 |
+
}
|
732 |
+
|
733 |
+
/*------------------------------------------------------------------------------
|
734 |
+
11.3 - Featured Images
|
735 |
+
------------------------------------------------------------------------------*/
|
736 |
+
|
737 |
+
#select-featured-image {
|
738 |
+
padding: 4px 0;
|
739 |
+
overflow: hidden;
|
740 |
+
}
|
741 |
+
|
742 |
+
#select-featured-image img {
|
743 |
+
max-width: 100%;
|
744 |
+
height: auto;
|
745 |
+
margin-bottom: 10px;
|
746 |
+
}
|
747 |
+
|
748 |
+
#select-featured-image a {
|
749 |
+
float: right;
|
750 |
+
clear: both;
|
751 |
+
}
|
752 |
+
|
753 |
+
#select-featured-image .remove {
|
754 |
+
display: none;
|
755 |
+
margin-top: 10px;
|
756 |
+
}
|
757 |
+
|
758 |
+
.js #select-featured-image.has-featured-image .remove {
|
759 |
+
display: inline-block;
|
760 |
+
}
|
761 |
+
|
762 |
+
.no-js #select-featured-image .choose {
|
763 |
+
display: none;
|
764 |
+
}
|
765 |
+
|
766 |
+
/*------------------------------------------------------------------------------
|
767 |
+
11.4 - Post formats
|
768 |
+
------------------------------------------------------------------------------*/
|
769 |
+
|
770 |
+
.post-state-format {
|
771 |
+
overflow: hidden;
|
772 |
+
display: inline-block;
|
773 |
+
vertical-align: middle;
|
774 |
+
height: 20px;
|
775 |
+
width: 20px;
|
776 |
+
margin-left: 5px;
|
777 |
+
margin-top: -4px;
|
778 |
+
}
|
779 |
+
|
780 |
+
.post-state-format:before {
|
781 |
+
display: block;
|
782 |
+
height: 20px;
|
783 |
+
width: 20px;
|
784 |
+
font: normal 20px/1 dashicons !important;
|
785 |
+
speak: none;
|
786 |
+
-webkit-font-smoothing: antialiased;
|
787 |
+
-moz-osx-font-smoothing: grayscale;
|
788 |
+
}
|
789 |
+
|
790 |
+
.post-state-format:before,
|
791 |
+
.post-format-icon:before {
|
792 |
+
color: #ddd;
|
793 |
+
transition: all .1s ease-in-out;
|
794 |
+
}
|
795 |
+
|
796 |
+
a.post-state-format:hover:before,
|
797 |
+
a.post-format-icon:hover:before {
|
798 |
+
color: #00a0d2;
|
799 |
+
}
|
800 |
+
|
801 |
+
#post-formats-select {
|
802 |
+
line-height: 2em;
|
803 |
+
}
|
804 |
+
|
805 |
+
#post-formats-select .post-format-icon:before {
|
806 |
+
top: 5px;
|
807 |
+
}
|
808 |
+
|
809 |
+
input.post-format {
|
810 |
+
margin-top: 1px;
|
811 |
+
}
|
812 |
+
|
813 |
+
label.post-format-icon {
|
814 |
+
margin-right: 0px;
|
815 |
+
padding: 2px 0px 2px 0;
|
816 |
+
}
|
817 |
+
|
818 |
+
.post-format-icon:before {
|
819 |
+
position: relative;
|
820 |
+
display: inline-block;
|
821 |
+
margin-left: 7px;
|
822 |
+
font: normal 20px/1 dashicons;
|
823 |
+
speak: none;
|
824 |
+
-webkit-font-smoothing: antialiased;
|
825 |
+
-moz-osx-font-smoothing: grayscale;
|
826 |
+
}
|
827 |
+
|
828 |
+
.post-state-format.post-format-standard:before,
|
829 |
+
.post-format-icon.post-format-standard:before,
|
830 |
+
a.post-state-format.format-standard:before {
|
831 |
+
content: "\f109";
|
832 |
+
}
|
833 |
+
|
834 |
+
.post-state-format.post-format-image:before,
|
835 |
+
.post-format-icon.post-format-image:before,
|
836 |
+
a.post-state-format.format-image:before {
|
837 |
+
content: "\f128";
|
838 |
+
}
|
839 |
+
|
840 |
+
.post-state-format.post-format-gallery:before,
|
841 |
+
.post-format-icon.post-format-gallery:before,
|
842 |
+
a.post-state-format.format-gallery:before {
|
843 |
+
content: "\f161";
|
844 |
+
}
|
845 |
+
|
846 |
+
.post-state-format.post-format-audio:before,
|
847 |
+
.post-format-icon.post-format-audio:before,
|
848 |
+
a.post-state-format.format-audio:before {
|
849 |
+
content: "\f127";
|
850 |
+
}
|
851 |
+
|
852 |
+
.post-state-format.post-format-video:before,
|
853 |
+
.post-format-icon.post-format-video:before,
|
854 |
+
a.post-state-format.format-video:before {
|
855 |
+
content: "\f126";
|
856 |
+
}
|
857 |
+
|
858 |
+
.post-state-format.post-format-chat:before,
|
859 |
+
.post-format-icon.post-format-chat:before,
|
860 |
+
a.post-state-format.format-chat:before {
|
861 |
+
content: "\f125";
|
862 |
+
}
|
863 |
+
|
864 |
+
.post-state-format.post-format-status:before,
|
865 |
+
.post-format-icon.post-format-status:before,
|
866 |
+
a.post-state-format.format-status:before {
|
867 |
+
content: "\f130";
|
868 |
+
}
|
869 |
+
|
870 |
+
.post-state-format.post-format-aside:before,
|
871 |
+
.post-format-icon.post-format-aside:before,
|
872 |
+
a.post-state-format.format-aside:before {
|
873 |
+
content: "\f123";
|
874 |
+
}
|
875 |
+
|
876 |
+
.post-state-format.post-format-quote:before,
|
877 |
+
.post-format-icon.post-format-quote:before,
|
878 |
+
a.post-state-format.format-quote:before {
|
879 |
+
content: "\f122";
|
880 |
+
}
|
881 |
+
|
882 |
+
.post-state-format.post-format-link:before,
|
883 |
+
.post-format-icon.post-format-link:before,
|
884 |
+
a.post-state-format.format-link:before {
|
885 |
+
content: "\f103";
|
886 |
+
}
|
887 |
+
|
888 |
+
/*------------------------------------------------------------------------------
|
889 |
+
12.0 - Categories
|
890 |
+
------------------------------------------------------------------------------*/
|
891 |
+
|
892 |
+
.category-adder {
|
893 |
+
margin-right: 120px;
|
894 |
+
padding: 4px 0;
|
895 |
+
}
|
896 |
+
|
897 |
+
.category-adder h4 {
|
898 |
+
margin: 0 0 8px;
|
899 |
+
}
|
900 |
+
|
901 |
+
#side-sortables .category-adder {
|
902 |
+
margin: 0;
|
903 |
+
}
|
904 |
+
|
905 |
+
.wp-tab-panel,
|
906 |
+
.categorydiv div.tabs-panel,
|
907 |
+
.customlinkdiv div.tabs-panel,
|
908 |
+
.posttypediv div.tabs-panel,
|
909 |
+
.taxonomydiv div.tabs-panel {
|
910 |
+
min-height: 42px;
|
911 |
+
max-height: 200px;
|
912 |
+
overflow: auto;
|
913 |
+
padding: 0 0.9em;
|
914 |
+
border: solid 1px #ddd;
|
915 |
+
background-color: #fdfdfd;
|
916 |
+
}
|
917 |
+
|
918 |
+
div.tabs-panel-active {
|
919 |
+
display:block;
|
920 |
+
}
|
921 |
+
|
922 |
+
div.tabs-panel-inactive {
|
923 |
+
display:none;
|
924 |
+
}
|
925 |
+
|
926 |
+
#front-page-warning,
|
927 |
+
#front-static-pages ul,
|
928 |
+
ul.export-filters,
|
929 |
+
.inline-editor ul.cat-checklist ul,
|
930 |
+
.categorydiv ul.categorychecklist ul,
|
931 |
+
.customlinkdiv ul.categorychecklist ul,
|
932 |
+
.posttypediv ul.categorychecklist ul,
|
933 |
+
.taxonomydiv ul.categorychecklist ul {
|
934 |
+
margin-right: 18px;
|
935 |
+
}
|
936 |
+
|
937 |
+
ul.categorychecklist li {
|
938 |
+
margin: 0;
|
939 |
+
padding: 0;
|
940 |
+
line-height: 22px;
|
941 |
+
word-wrap: break-word;
|
942 |
+
}
|
943 |
+
|
944 |
+
.categorydiv .tabs-panel,
|
945 |
+
.customlinkdiv .tabs-panel,
|
946 |
+
.posttypediv .tabs-panel,
|
947 |
+
.taxonomydiv .tabs-panel {
|
948 |
+
border-width: 3px;
|
949 |
+
border-style: solid;
|
950 |
+
}
|
951 |
+
|
952 |
+
.form-wrap label {
|
953 |
+
display: block;
|
954 |
+
padding: 2px 0;
|
955 |
+
}
|
956 |
+
|
957 |
+
.form-field input[type="text"],
|
958 |
+
.form-field input[type="password"],
|
959 |
+
.form-field input[type="email"],
|
960 |
+
.form-field input[type="number"],
|
961 |
+
.form-field input[type="search"],
|
962 |
+
.form-field input[type="tel"],
|
963 |
+
.form-field input[type="url"],
|
964 |
+
.form-field textarea {
|
965 |
+
border-style: solid;
|
966 |
+
border-width: 1px;
|
967 |
+
width: 95%;
|
968 |
+
}
|
969 |
+
|
970 |
+
p.description,
|
971 |
+
.form-wrap p {
|
972 |
+
margin: 2px 0 5px;
|
973 |
+
color: #666;
|
974 |
+
}
|
975 |
+
|
976 |
+
p.help,
|
977 |
+
p.description,
|
978 |
+
span.description,
|
979 |
+
.form-wrap p {
|
980 |
+
font-size: 13px;
|
981 |
+
font-style: italic;
|
982 |
+
}
|
983 |
+
|
984 |
+
.form-wrap .form-field {
|
985 |
+
margin: 1em 0;
|
986 |
+
padding: 0;
|
987 |
+
}
|
988 |
+
|
989 |
+
.form-wrap .form-field #parent {
|
990 |
+
max-width: 100%;
|
991 |
+
}
|
992 |
+
|
993 |
+
.col-wrap h2 {
|
994 |
+
margin: 12px 0;
|
995 |
+
font-size: 1.1em;
|
996 |
+
}
|
997 |
+
|
998 |
+
.col-wrap p.submit {
|
999 |
+
margin-top: -10px;
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
.edit-term-notes {
|
1003 |
+
margin-top: 2em;
|
1004 |
+
}
|
1005 |
+
|
1006 |
+
/*------------------------------------------------------------------------------
|
1007 |
+
13.0 - Tags
|
1008 |
+
------------------------------------------------------------------------------*/
|
1009 |
+
|
1010 |
+
#poststuff .tagsdiv .howto {
|
1011 |
+
margin: 0 0 6px 0;
|
1012 |
+
}
|
1013 |
+
|
1014 |
+
.ajaxtag .newtag {
|
1015 |
+
position: relative;
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
.tagsdiv .newtag {
|
1019 |
+
width: 180px;
|
1020 |
+
}
|
1021 |
+
|
1022 |
+
.tagsdiv .the-tags {
|
1023 |
+
display: block;
|
1024 |
+
height: 60px;
|
1025 |
+
margin: 0 auto;
|
1026 |
+
overflow: auto;
|
1027 |
+
width: 260px;
|
1028 |
+
}
|
1029 |
+
|
1030 |
+
#post-body-content .tagsdiv .the-tags {
|
1031 |
+
margin: 0 5px;
|
1032 |
+
}
|
1033 |
+
|
1034 |
+
p.popular-tags {
|
1035 |
+
border: none;
|
1036 |
+
line-height: 2em;
|
1037 |
+
padding: 8px 12px 12px;
|
1038 |
+
text-align: justify;
|
1039 |
+
}
|
1040 |
+
|
1041 |
+
p.popular-tags a {
|
1042 |
+
padding: 0 3px;
|
1043 |
+
}
|
1044 |
+
|
1045 |
+
.tagcloud {
|
1046 |
+
width: 97%;
|
1047 |
+
margin: 0 0 40px;
|
1048 |
+
text-align: justify;
|
1049 |
+
}
|
1050 |
+
|
1051 |
+
.tagcloud h2 {
|
1052 |
+
margin: 2px 0 12px;
|
1053 |
+
}
|
1054 |
+
|
1055 |
+
.the-tagcloud ul {
|
1056 |
+
margin: 0;
|
1057 |
+
}
|
1058 |
+
|
1059 |
+
.the-tagcloud ul li {
|
1060 |
+
display: inline-block;
|
1061 |
+
}
|
1062 |
+
|
1063 |
+
/* Suggest.js autocomplete, no more used by core. */
|
1064 |
+
.ac_results {
|
1065 |
+
display: none;
|
1066 |
+
margin: -1px 0 0;
|
1067 |
+
padding: 0;
|
1068 |
+
list-style: none;
|
1069 |
+
position: absolute;
|
1070 |
+
z-index: 10000;
|
1071 |
+
border: 1px solid #5b9dd9;
|
1072 |
+
background-color: #fff;
|
1073 |
+
}
|
1074 |
+
|
1075 |
+
.wp-customizer .ac_results {
|
1076 |
+
z-index: 500000;
|
1077 |
+
}
|
1078 |
+
|
1079 |
+
.ac_results li {
|
1080 |
+
margin: 0;
|
1081 |
+
padding: 5px 10px;
|
1082 |
+
white-space: nowrap;
|
1083 |
+
text-align: right;
|
1084 |
+
}
|
1085 |
+
|
1086 |
+
.ac_results .ac_over,
|
1087 |
+
.ac_over .ac_match {
|
1088 |
+
background-color: #0073aa;
|
1089 |
+
color: #fff;
|
1090 |
+
cursor: pointer;
|
1091 |
+
}
|
1092 |
+
|
1093 |
+
.ac_match {
|
1094 |
+
text-decoration: underline;
|
1095 |
+
}
|
1096 |
+
|
1097 |
+
#edittag {
|
1098 |
+
max-width: 800px;
|
1099 |
+
}
|
1100 |
+
|
1101 |
+
.edit-tag-actions {
|
1102 |
+
margin-top: 20px;
|
1103 |
+
overflow: hidden;
|
1104 |
+
padding: 10px;
|
1105 |
+
margin-left: 10px;
|
1106 |
+
}
|
1107 |
+
|
1108 |
+
/* Comments */
|
1109 |
+
|
1110 |
+
.comment-php .wp-editor-area {
|
1111 |
+
height: 200px;
|
1112 |
+
}
|
1113 |
+
|
1114 |
+
.comment-ays th,
|
1115 |
+
.comment-ays td {
|
1116 |
+
padding: 10px 15px;
|
1117 |
+
}
|
1118 |
+
|
1119 |
+
.comment-ays .comment-content ul {
|
1120 |
+
list-style: initial;
|
1121 |
+
margin-right: 2em;
|
1122 |
+
}
|
1123 |
+
|
1124 |
+
.comment-ays .comment-content a[href]:after {
|
1125 |
+
content: '(' attr( href ) ')';
|
1126 |
+
display: inline-block;
|
1127 |
+
padding: 0 4px;
|
1128 |
+
color: #72777C;
|
1129 |
+
font-size: 13px;
|
1130 |
+
word-break: break-all;
|
1131 |
+
}
|
1132 |
+
|
1133 |
+
.comment-ays .comment-content p.edit-comment {
|
1134 |
+
margin-top: 10px;
|
1135 |
+
}
|
1136 |
+
|
1137 |
+
.comment-ays .comment-content p.edit-comment a[href]:after {
|
1138 |
+
content: '';
|
1139 |
+
padding: 0;
|
1140 |
+
}
|
1141 |
+
|
1142 |
+
.comment-ays-submit .button-cancel {
|
1143 |
+
margin-right: 1em;
|
1144 |
+
}
|
1145 |
+
|
1146 |
+
.trash-undo-inside,
|
1147 |
+
.spam-undo-inside {
|
1148 |
+
margin: 1px 0 1px 8px;
|
1149 |
+
line-height: 16px;
|
1150 |
+
}
|
1151 |
+
|
1152 |
+
.spam-undo-inside .avatar,
|
1153 |
+
.trash-undo-inside .avatar {
|
1154 |
+
height: 20px;
|
1155 |
+
width: 20px;
|
1156 |
+
margin-left: 8px;
|
1157 |
+
vertical-align: middle;
|
1158 |
+
}
|
1159 |
+
|
1160 |
+
.stuffbox .editcomment {
|
1161 |
+
clear: none;
|
1162 |
+
}
|
1163 |
+
|
1164 |
+
#comment-status-radio p {
|
1165 |
+
margin: 3px 0 5px;
|
1166 |
+
}
|
1167 |
+
|
1168 |
+
#comment-status-radio input {
|
1169 |
+
margin: 2px 0 5px 3px;
|
1170 |
+
vertical-align: middle;
|
1171 |
+
}
|
1172 |
+
|
1173 |
+
#comment-status-radio label {
|
1174 |
+
padding: 5px 0;
|
1175 |
+
}
|
1176 |
+
|
1177 |
+
/* links tables */
|
1178 |
+
table.links-table {
|
1179 |
+
width: 100%;
|
1180 |
+
border-spacing: 0;
|
1181 |
+
}
|
1182 |
+
|
1183 |
+
.links-table th {
|
1184 |
+
font-weight: 400;
|
1185 |
+
text-align: right;
|
1186 |
+
vertical-align: top;
|
1187 |
+
min-width: 80px;
|
1188 |
+
width: 20%;
|
1189 |
+
word-wrap: break-word;
|
1190 |
+
}
|
1191 |
+
|
1192 |
+
.links-table th,
|
1193 |
+
.links-table td {
|
1194 |
+
padding: 5px 0;
|
1195 |
+
}
|
1196 |
+
|
1197 |
+
.links-table td label {
|
1198 |
+
margin-left: 8px;
|
1199 |
+
}
|
1200 |
+
|
1201 |
+
.links-table td input[type="text"],
|
1202 |
+
.links-table td textarea {
|
1203 |
+
width: 100%;
|
1204 |
+
}
|
1205 |
+
|
1206 |
+
.links-table #link_rel {
|
1207 |
+
max-width: 280px;
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
/* DFW 2
|
1211 |
+
-------------------------------------------------------------- */
|
1212 |
+
|
1213 |
+
#wp-content-wrap .mce-wp-dfw,
|
1214 |
+
#qt_content_dfw {
|
1215 |
+
display: none;
|
1216 |
+
}
|
1217 |
+
|
1218 |
+
.wp-editor-expand #wp-content-wrap .mce-wp-dfw,
|
1219 |
+
.wp-editor-expand #qt_content_dfw {
|
1220 |
+
display: inline-block;
|
1221 |
+
}
|
1222 |
+
|
1223 |
+
.focus-on .wrap > h1,
|
1224 |
+
.focus-on .page-title-action,
|
1225 |
+
.focus-on #wpfooter,
|
1226 |
+
.focus-on .postbox-container > *,
|
1227 |
+
.focus-on div.updated,
|
1228 |
+
.focus-on div.error,
|
1229 |
+
.focus-on div.notice,
|
1230 |
+
.focus-on .update-nag,
|
1231 |
+
.focus-on #wp-toolbar,
|
1232 |
+
.focus-on #screen-meta-links,
|
1233 |
+
.focus-on #screen-meta {
|
1234 |
+
opacity: 0;
|
1235 |
+
transition-duration: 0.6s;
|
1236 |
+
transition-property: opacity;
|
1237 |
+
transition-timing-function: ease-in-out;
|
1238 |
+
}
|
1239 |
+
|
1240 |
+
.focus-on #wp-toolbar {
|
1241 |
+
opacity: 0.3;
|
1242 |
+
}
|
1243 |
+
|
1244 |
+
.focus-off .wrap > h1,
|
1245 |
+
.focus-off .page-title-action,
|
1246 |
+
.focus-off #wpfooter,
|
1247 |
+
.focus-off .postbox-container > *,
|
1248 |
+
.focus-off div.updated,
|
1249 |
+
.focus-off div.error,
|
1250 |
+
.focus-off div.notice,
|
1251 |
+
.focus-off .update-nag,
|
1252 |
+
.focus-off #wp-toolbar,
|
1253 |
+
.focus-off #screen-meta-links,
|
1254 |
+
.focus-off #screen-meta {
|
1255 |
+
opacity: 1;
|
1256 |
+
transition-duration: 0.2s;
|
1257 |
+
transition-property: opacity;
|
1258 |
+
transition-timing-function: ease-in-out;
|
1259 |
+
}
|
1260 |
+
|
1261 |
+
.focus-off #wp-toolbar {
|
1262 |
+
-webkit-transform: translate(0, 0);
|
1263 |
+
}
|
1264 |
+
|
1265 |
+
.focus-on #adminmenuback,
|
1266 |
+
.focus-on #adminmenuwrap {
|
1267 |
+
transition-duration: 0.6s;
|
1268 |
+
transition-property: -webkit-transform;
|
1269 |
+
transition-property: transform;
|
1270 |
+
transition-property: transform, -webkit-transform;
|
1271 |
+
transition-timing-function: ease-in-out;
|
1272 |
+
}
|
1273 |
+
|
1274 |
+
.focus-on #adminmenuback,
|
1275 |
+
.focus-on #adminmenuwrap {
|
1276 |
+
-webkit-transform: translateX( 100% );
|
1277 |
+
transform: translateX( 100% );
|
1278 |
+
}
|
1279 |
+
|
1280 |
+
.focus-off #adminmenuback,
|
1281 |
+
.focus-off #adminmenuwrap {
|
1282 |
+
-webkit-transform: translateX( 0 );
|
1283 |
+
transform: translateX( 0 );
|
1284 |
+
transition-duration: 0.2s;
|
1285 |
+
transition-property: -webkit-transform;
|
1286 |
+
transition-property: transform;
|
1287 |
+
transition-property: transform, -webkit-transform;
|
1288 |
+
transition-timing-function: ease-in-out;
|
1289 |
+
}
|
1290 |
+
|
1291 |
+
/* =Media Queries
|
1292 |
+
-------------------------------------------------------------- */
|
1293 |
+
|
1294 |
+
/**
|
1295 |
+
* HiDPI Displays
|
1296 |
+
*/
|
1297 |
+
@media print,
|
1298 |
+
(-webkit-min-device-pixel-ratio: 1.25),
|
1299 |
+
(min-resolution: 120dpi) {
|
1300 |
+
#content-resize-handle,
|
1301 |
+
#post-body .wp_themeSkin .mceStatusbar a.mceResize {
|
1302 |
+
background: transparent url(../images/resize-2x.gif) no-repeat scroll right bottom;
|
1303 |
+
background-size: 11px 11px;
|
1304 |
+
}
|
1305 |
+
|
1306 |
+
/*rtl:ignore*/
|
1307 |
+
.rtl #content-resize-handle,
|
1308 |
+
.rtl #post-body .wp_themeSkin .mceStatusbar a.mceResize {
|
1309 |
+
background-image: url(../images/resize-rtl-2x.gif);
|
1310 |
+
background-position: left bottom;
|
1311 |
+
}
|
1312 |
+
}
|
1313 |
+
|
1314 |
+
/* one column on the post write/edit screen */
|
1315 |
+
@media only screen and (max-width: 850px) {
|
1316 |
+
#poststuff {
|
1317 |
+
min-width: 0;
|
1318 |
+
}
|
1319 |
+
|
1320 |
+
#wpbody-content #poststuff #post-body {
|
1321 |
+
margin: 0;
|
1322 |
+
}
|
1323 |
+
|
1324 |
+
#wpbody-content #post-body.columns-2 #postbox-container-1 {
|
1325 |
+
margin-left: 0;
|
1326 |
+
width: 100%;
|
1327 |
+
}
|
1328 |
+
|
1329 |
+
#poststuff #postbox-container-1 .empty-container,
|
1330 |
+
#poststuff #postbox-container-1 #side-sortables:empty {
|
1331 |
+
border: 0 none;
|
1332 |
+
height: 0;
|
1333 |
+
min-height: 0;
|
1334 |
+
}
|
1335 |
+
|
1336 |
+
#poststuff #post-body.columns-2 #side-sortables {
|
1337 |
+
min-height: 0;
|
1338 |
+
width: auto;
|
1339 |
+
}
|
1340 |
+
|
1341 |
+
/* hide the radio buttons for column prefs */
|
1342 |
+
.screen-layout,
|
1343 |
+
.columns-prefs {
|
1344 |
+
display: none;
|
1345 |
+
}
|
1346 |
+
}
|
1347 |
+
|
1348 |
+
@media screen and ( max-width: 782px ) {
|
1349 |
+
.wp-core-ui .edit-tag-actions .button-primary {
|
1350 |
+
margin-bottom: 0;
|
1351 |
+
}
|
1352 |
+
|
1353 |
+
#post-body-content {
|
1354 |
+
min-width: 0;
|
1355 |
+
}
|
1356 |
+
|
1357 |
+
#titlediv #title-prompt-text {
|
1358 |
+
padding: 10px 10px;
|
1359 |
+
}
|
1360 |
+
|
1361 |
+
#poststuff h3.hndle, /* Back-compat for pre-4.4 */
|
1362 |
+
#poststuff .stuffbox > h3, /* Back-compat for pre-4.4 */
|
1363 |
+
#poststuff h2 {
|
1364 |
+
padding: 12px;
|
1365 |
+
}
|
1366 |
+
|
1367 |
+
.post-format-options {
|
1368 |
+
padding-left: 0;
|
1369 |
+
}
|
1370 |
+
|
1371 |
+
.post-format-options a {
|
1372 |
+
margin-left: 5px;
|
1373 |
+
margin-bottom: 5px;
|
1374 |
+
min-width: 52px;
|
1375 |
+
}
|
1376 |
+
|
1377 |
+
.post-format-options .post-format-title {
|
1378 |
+
font-size: 11px;
|
1379 |
+
}
|
1380 |
+
|
1381 |
+
.post-format-options a div {
|
1382 |
+
height: 28px;
|
1383 |
+
width: 28px;
|
1384 |
+
}
|
1385 |
+
|
1386 |
+
.post-format-options a div:before {
|
1387 |
+
font-size: 26px !important;
|
1388 |
+
}
|
1389 |
+
|
1390 |
+
/* Publish Metabox Options */
|
1391 |
+
#post-visibility-select {
|
1392 |
+
line-height: 280%;
|
1393 |
+
}
|
1394 |
+
|
1395 |
+
.wp-core-ui .save-post-visibility,
|
1396 |
+
.wp-core-ui .save-timestamp {
|
1397 |
+
vertical-align: middle;
|
1398 |
+
margin-left: 15px;
|
1399 |
+
}
|
1400 |
+
|
1401 |
+
.timestamp-wrap select#mm {
|
1402 |
+
display: block;
|
1403 |
+
width: 100%;
|
1404 |
+
margin-bottom: 10px;
|
1405 |
+
}
|
1406 |
+
|
1407 |
+
.timestamp-wrap #jj,
|
1408 |
+
.timestamp-wrap #aa,
|
1409 |
+
.timestamp-wrap #hh,
|
1410 |
+
.timestamp-wrap #mn {
|
1411 |
+
padding: 12px 3px;
|
1412 |
+
font-size: 14px;
|
1413 |
+
margin-bottom: 5px;
|
1414 |
+
width: auto;
|
1415 |
+
text-align: center;
|
1416 |
+
}
|
1417 |
+
|
1418 |
+
/* Categories Metabox */
|
1419 |
+
ul.category-tabs {
|
1420 |
+
margin: 30px 0 15px;
|
1421 |
+
}
|
1422 |
+
|
1423 |
+
ul.category-tabs li.tabs {
|
1424 |
+
padding: 15px;
|
1425 |
+
}
|
1426 |
+
|
1427 |
+
ul.categorychecklist li {
|
1428 |
+
margin-bottom: 15px;
|
1429 |
+
}
|
1430 |
+
|
1431 |
+
ul.categorychecklist ul {
|
1432 |
+
margin-top: 15px;
|
1433 |
+
}
|
1434 |
+
|
1435 |
+
.category-add input[type=text],
|
1436 |
+
.category-add select {
|
1437 |
+
max-width: none;
|
1438 |
+
margin-bottom: 15px;
|
1439 |
+
}
|
1440 |
+
|
1441 |
+
/* Tags Metabox */
|
1442 |
+
.tagsdiv .newtag {
|
1443 |
+
width: 100%;
|
1444 |
+
height: auto;
|
1445 |
+
margin-bottom: 15px;
|
1446 |
+
}
|
1447 |
+
|
1448 |
+
.tagchecklist {
|
1449 |
+
margin: 25px 10px;
|
1450 |
+
}
|
1451 |
+
|
1452 |
+
.tagchecklist > li {
|
1453 |
+
font-size: 16px;
|
1454 |
+
line-height: 1.4;
|
1455 |
+
}
|
1456 |
+
|
1457 |
+
/* Discussion */
|
1458 |
+
#commentstatusdiv p {
|
1459 |
+
line-height: 2.8;
|
1460 |
+
}
|
1461 |
+
|
1462 |
+
/* TinyMCE Adjustments */
|
1463 |
+
.mceToolbar * {
|
1464 |
+
white-space: normal !important;
|
1465 |
+
}
|
1466 |
+
|
1467 |
+
.mceToolbar tr,
|
1468 |
+
.mceToolbar td {
|
1469 |
+
float: right !important;
|
1470 |
+
}
|
1471 |
+
|
1472 |
+
.wp_themeSkin a.mceButton {
|
1473 |
+
width: 30px;
|
1474 |
+
height: 30px;
|
1475 |
+
}
|
1476 |
+
|
1477 |
+
.wp_themeSkin .mceButton .mceIcon {
|
1478 |
+
margin-top: 5px;
|
1479 |
+
margin-right: 5px;
|
1480 |
+
}
|
1481 |
+
|
1482 |
+
.wp_themeSkin .mceSplitButton {
|
1483 |
+
margin-top: 1px;
|
1484 |
+
}
|
1485 |
+
|
1486 |
+
.wp_themeSkin .mceSplitButton td a.mceAction {
|
1487 |
+
padding-top: 6px;
|
1488 |
+
padding-bottom: 6px;
|
1489 |
+
padding-right: 6px;
|
1490 |
+
padding-left: 3px;
|
1491 |
+
}
|
1492 |
+
|
1493 |
+
.wp_themeSkin .mceSplitButton td a.mceOpen,
|
1494 |
+
.wp_themeSkin .mceSplitButtonEnabled:hover td a.mceOpen {
|
1495 |
+
padding-top: 6px;
|
1496 |
+
padding-bottom: 6px;
|
1497 |
+
background-position: 1px 6px;
|
1498 |
+
}
|
1499 |
+
|
1500 |
+
.wp_themeSkin table.mceListBox {
|
1501 |
+
margin: 5px;
|
1502 |
+
}
|
1503 |
+
|
1504 |
+
div.quicktags-toolbar input {
|
1505 |
+
padding: 10px 20px;
|
1506 |
+
}
|
1507 |
+
|
1508 |
+
button.wp-switch-editor {
|
1509 |
+
font-size: 16px;
|
1510 |
+
line-height: 1em;
|
1511 |
+
margin: 7px 7px 0 0;
|
1512 |
+
padding: 8px 12px;
|
1513 |
+
}
|
1514 |
+
|
1515 |
+
#wp-content-media-buttons a {
|
1516 |
+
font-size: 14px;
|
1517 |
+
padding: 6px 10px;
|
1518 |
+
}
|
1519 |
+
|
1520 |
+
.wp-media-buttons span.wp-media-buttons-icon,
|
1521 |
+
.wp-media-buttons span.jetpack-contact-form-icon {
|
1522 |
+
width: 22px !important;
|
1523 |
+
margin-right: -2px !important;
|
1524 |
+
}
|
1525 |
+
|
1526 |
+
.wp-media-buttons .add_media span.wp-media-buttons-icon:before,
|
1527 |
+
.wp-media-buttons #insert-jetpack-contact-form span.jetpack-contact-form-icon:before {
|
1528 |
+
font-size: 20px !important;
|
1529 |
+
}
|
1530 |
+
|
1531 |
+
#content_wp_fullscreen {
|
1532 |
+
display: none;
|
1533 |
+
}
|
1534 |
+
|
1535 |
+
.misc-pub-section {
|
1536 |
+
padding: 20px 10px 20px;
|
1537 |
+
}
|
1538 |
+
|
1539 |
+
.misc-pub-section > a {
|
1540 |
+
float: left;
|
1541 |
+
font-size: 16px;
|
1542 |
+
}
|
1543 |
+
|
1544 |
+
#delete-action,
|
1545 |
+
#publishing-action {
|
1546 |
+
line-height: 47px;
|
1547 |
+
}
|
1548 |
+
|
1549 |
+
#publishing-action .spinner {
|
1550 |
+
float: none;
|
1551 |
+
margin-top: -2px; /* Half of the Publish button's bottom margin. */
|
1552 |
+
}
|
1553 |
+
|
1554 |
+
/* Moderate Comment */
|
1555 |
+
.comment-ays th,
|
1556 |
+
.comment-ays td {
|
1557 |
+
padding-bottom: 0;
|
1558 |
+
}
|
1559 |
+
|
1560 |
+
.comment-ays td {
|
1561 |
+
padding-top: 6px;
|
1562 |
+
}
|
1563 |
+
|
1564 |
+
/* Links */
|
1565 |
+
.links-table #link_rel {
|
1566 |
+
max-width: none;
|
1567 |
+
}
|
1568 |
+
|
1569 |
+
.links-table th,
|
1570 |
+
.links-table td {
|
1571 |
+
padding: 10px 0;
|
1572 |
+
}
|
1573 |
+
}
|
lib/classic-editor/css/edit-rtl.min.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
/*! This file is auto-generated */
|
2 |
+
#pending,#poststuff #titlewrap{border:0;padding:0}#pending,#poststuff #post-body{padding:0}#editable-post-name-full,body.post-new-php .submitbox .submitdelete{display:none}#post-status-info,.postbox{box-shadow:0 1px 1px rgba(0,0,0,.04)}#titlediv,#wp-content-editor-container,.postbox,form#tags-filter{position:relative}#poststuff{padding-top:10px;min-width:763px}#poststuff .postbox-container{width:100%}#poststuff #post-body.columns-2{margin-left:300px}#show-comments{overflow:hidden}#save-action .spinner,#show-comments a{float:right}#show-comments .spinner{float:none;margin-top:0}#lost-connection-notice .spinner{visibility:visible;float:right;margin:0 0 0 5px}#titlediv label{cursor:text}#titlediv div.inside{margin:0}#titlediv #title{padding:3px 8px;font-size:1.7em;line-height:100%;height:1.7em;width:100%;outline:0;margin:0 0 3px;background-color:#fff}#titlediv #title-prompt-text{color:#72777c;position:absolute;font-size:1.7em;padding:11px 10px}input#link_description,input#link_url{width:98%}#pending{background:100% none;font-size:11px;margin-top:-1px}#comment-link-box,#edit-slug-box{line-height:24px;min-height:25px;margin-top:5px;padding:0 10px;color:#666}#edit-slug-box .cancel{margin-left:10px;padding:0;font-size:11px}#comment-link-box{margin:5px 0;padding:0 5px}#editable-post-name{font-weight:600}#editable-post-name input{font-size:13px;font-weight:400;height:24px;margin:0;width:16em}.postarea h3 label{float:right}.submitbox .submit a:hover{text-decoration:underline}.submitbox .submit input{margin-bottom:8px;margin-left:4px;padding:6px}#post-status-select{margin-top:3px}#post-body #normal-sortables{min-height:50px}.postbox{min-width:255px;border:1px solid #e5e5e5;background:#fff}#trackback_url{width:99%}#normal-sortables .postbox .submit{background:0 0;border:0;float:left;padding:0 12px;margin:0}.category-add input[type=text],.category-add select{width:100%;max-width:260px;vertical-align:baseline}#side-sortables .category-add input[type=text],#side-sortables .category-add select{margin:0 0 1em}#side-sortables .add-menu-item-tabs li,.wp-tab-bar li,ul.category-tabs li{display:inline;line-height:1.35em}.no-js .category-tabs li.hide-if-no-js{display:none}#side-sortables .add-menu-item-tabs a,.category-tabs a,.wp-tab-bar a{text-decoration:none}#post-body ul.add-menu-item-tabs li.tabs a,#post-body ul.category-tabs li.tabs a,#side-sortables .add-menu-item-tabs .tabs a,#side-sortables .category-tabs .tabs a,.wp-tab-bar .wp-tab-active a{color:#32373c}.category-tabs{margin:8px 0 5px}#category-adder h4{margin:0}.taxonomy-add-new{display:inline-block;margin:10px 0;font-weight:600}#side-sortables .add-menu-item-tabs,.wp-tab-bar{margin-bottom:3px}#normal-sortables .postbox #replyrow .submit{float:none;margin:0;padding:5px 7px 10px;overflow:hidden}#side-sortables .submitbox .submit .preview,#side-sortables .submitbox .submit a.preview:hover,#side-sortables .submitbox .submit input{border:0}ul.add-menu-item-tabs,ul.category-tabs,ul.wp-tab-bar{margin-top:12px}ul.add-menu-item-tabs li,ul.category-tabs li{border:1px solid transparent;position:relative}.wp-tab-active,ul.add-menu-item-tabs li.tabs,ul.category-tabs li.tabs{border:1px solid #ddd;border-bottom-color:#fdfdfd;background-color:#fdfdfd}ul.add-menu-item-tabs li,ul.category-tabs li,ul.wp-tab-bar li{padding:3px 5px 6px}#set-post-thumbnail{display:inline-block;max-width:100%}.ui-tabs-hide,.wp-editor-expand #content-resize-handle,.wp-hidden-children .wp-hidden-child{display:none}#postimagediv .inside img{max-width:100%;height:auto;width:auto;vertical-align:top;background-image:linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:100% 0,10px 10px;background-size:20px 20px}#post-body .tagsdiv #newtag{margin-left:5px;width:16em}#side-sortables input#post_password{width:94%}#side-sortables .tagsdiv #newtag{width:68%}#post-status-info{width:100%;border-spacing:0;border:1px solid #e5e5e5;border-top:none;background-color:#f7f7f7;z-index:999}#post-status-info td{font-size:12px}.autosave-info{padding:2px 10px;text-align:left}#editorcontent #post-status-info{border:none}#content-resize-handle{background:url(../images/resize.gif) right bottom no-repeat;width:12px;cursor:row-resize}.rtl #content-resize-handle{background-image:url(../images/resize-rtl.gif);background-position:left bottom}#postdivrich #content{resize:none}#wp-word-count{display:block;padding:2px 10px}.wp-editor-expand #wp-content-editor-tools{z-index:1000;border-bottom:1px solid #e5e5e5}.wp-editor-expand #wp-content-editor-container{box-shadow:none;margin-top:-1px;border-bottom:0 none}.wp-editor-expand div.mce-statusbar{z-index:1}.wp-editor-expand #post-status-info{border-top:1px solid #e5e5e5}.wp-editor-expand div.mce-toolbar-grp{z-index:999}.mce-fullscreen #wp-content-wrap .mce-edit-area,.mce-fullscreen #wp-content-wrap .mce-menubar,.mce-fullscreen #wp-content-wrap .mce-statusbar,.mce-fullscreen #wp-content-wrap .mce-toolbar-grp{position:static!important;width:auto!important;padding:0!important}.mce-fullscreen #wp-content-wrap .mce-statusbar{visibility:visible!important}.mce-fullscreen #wp-content-wrap .mce-tinymce .mce-wp-dfw,.mce-fullscreen #wp-content-wrap .mce-wp-dfw,.post-php.mce-fullscreen #wpadminbar{display:none}#wp-content-editor-tools{background-color:#f1f1f1;padding-top:20px}#poststuff #post-body.columns-2 #side-sortables{width:280px}#timestampdiv select{height:21px;line-height:14px;padding:0;vertical-align:top;font-size:12px}#aa,#hh,#jj,#mn{padding:1px;font-size:12px}#hh,#jj,#mn{width:2em}#aa{width:3.4em}.curtime #timestamp{padding:2px 0 1px;display:inline!important;height:auto!important}#post-body #visibility:before,#post-body .misc-pub-post-status:before,#post-body .misc-pub-revisions:before,.curtime #timestamp:before,span.wp-media-buttons-icon:before{color:#82878c}#post-body #visibility:before,#post-body .misc-pub-post-status:before,#post-body .misc-pub-revisions:before,.curtime #timestamp:before{font:400 20px/1 dashicons;speak:none;display:inline-block;margin-right:-1px;padding-left:3px;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#post-body .misc-pub-post-status:before{content:"\f173"}#post-body #visibility:before{content:"\f177"}.curtime #timestamp:before{content:"\f145";position:relative;top:-1px}#post-body .misc-pub-revisions:before{content:"\f321"}#timestampdiv{padding-top:5px;line-height:23px}#timestampdiv p{margin:8px 0 6px}#timestampdiv input{border-width:1px;border-style:solid}.notification-dialog{position:fixed;top:30%;max-height:70%;right:50%;width:450px;margin-right:-225px;background:#fff;box-shadow:0 3px 6px rgba(0,0,0,.3);line-height:1.5;z-index:1000005;overflow-y:auto}.notification-dialog-background{position:fixed;top:0;right:0;left:0;bottom:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:1000000}#post-lock-dialog .post-locked-message,#post-lock-dialog .post-taken-over{margin:25px}#file-editor-warning .button,#post-lock-dialog .post-locked-message a.button{margin-left:10px}#post-lock-dialog .post-locked-avatar{float:right;margin:0 0 20px 20px}#post-lock-dialog .wp-tab-first{outline:0}#post-lock-dialog .locked-saving img{float:right;margin-left:3px}#post-lock-dialog.saved .locked-saved,#post-lock-dialog.saving .locked-saving{display:inline}#excerpt{display:block;margin:12px 0 0;height:4em;width:100%}.tagchecklist{margin-right:14px;font-size:12px;overflow:auto}.tagchecklist br{display:none}.tagchecklist strong{margin-right:-8px;position:absolute}.tagchecklist>li{float:right;margin-left:25px;font-size:13px;line-height:1.8em;cursor:default;max-width:100%;overflow:hidden;text-overflow:ellipsis}.tagchecklist .ntdelbutton{position:absolute;width:24px;height:24px;border:none;margin:0 -19px 0 0;padding:0;background:0 0;cursor:pointer;text-indent:0}#poststuff .stuffbox>h3,#poststuff h2,#poststuff h3.hndle{font-size:14px;padding:8px 12px;margin:0;line-height:1.4}#poststuff .inside{margin:6px 0 0}#poststuff .inside #page_template,#poststuff .inside #parent_id{max-width:100%}.ie8 #poststuff .inside #page_template,.ie8 #poststuff .inside #parent_id{width:250px}.post-attributes-label-wrapper{margin-bottom:.5em}.post-attributes-label{vertical-align:baseline;font-weight:600}#post-visibility-select{line-height:1.5em;margin-top:3px}#linksubmitdiv .inside,#poststuff #submitdiv .inside{margin:0;padding:0}#post-body-content,.edit-form-section{margin-bottom:20px}#postcustomstuff thead th{padding:5px 8px 8px;background-color:#f1f1f1}#postcustom #postcustomstuff .submit{border:0;float:none;padding:0 8px 8px}#side-sortables #postcustom #postcustomstuff .submit{margin:0;padding:0}#side-sortables #postcustom #postcustomstuff #the-list textarea{height:85px}#side-sortables #postcustom #postcustomstuff td.left input,#side-sortables #postcustom #postcustomstuff td.left select,#side-sortables #postcustomstuff #newmetaleft a{margin:3px 3px 0}#postcustomstuff table{margin:0;width:100%;border:1px solid #ddd;border-spacing:0;background-color:#f9f9f9}#postcustomstuff tr{vertical-align:top}#postcustomstuff table input,#postcustomstuff table select,#postcustomstuff table textarea{width:96%;margin:8px}#side-sortables #postcustomstuff table input,#side-sortables #postcustomstuff table select,#side-sortables #postcustomstuff table textarea{margin:3px}#postcustomstuff td.left,#postcustomstuff th.left{width:38%}#postcustomstuff .submit input{margin:0;width:auto}#postcustomstuff #newmetaleft a{display:inline-block;margin:0 8px 8px;text-decoration:none}.no-js #postcustomstuff #enternew{display:none}#post-body-content .compat-attachment-fields{margin-bottom:20px}.compat-attachment-fields th{padding-top:5px;padding-left:10px}#select-featured-image{padding:4px 0;overflow:hidden}#select-featured-image img{max-width:100%;height:auto;margin-bottom:10px}#select-featured-image a{float:right;clear:both}#select-featured-image .remove{display:none;margin-top:10px}.js #select-featured-image.has-featured-image .remove{display:inline-block}.no-js #select-featured-image .choose{display:none}.post-state-format{overflow:hidden;display:inline-block;vertical-align:middle;height:20px;width:20px;margin-left:5px;margin-top:-4px}.post-state-format:before{display:block;height:20px;width:20px;font:400 20px/1 dashicons!important;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.post-format-icon:before,.post-state-format:before{color:#ddd;transition:all .1s ease-in-out}a.post-format-icon:hover:before,a.post-state-format:hover:before{color:#00a0d2}#post-formats-select{line-height:2em}#post-formats-select .post-format-icon:before{top:5px}input.post-format{margin-top:1px}label.post-format-icon{margin-right:0;padding:2px 0}.post-format-icon:before{position:relative;display:inline-block;margin-left:7px;font:400 20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.post-format-icon.post-format-standard:before,.post-state-format.post-format-standard:before,a.post-state-format.format-standard:before{content:"\f109"}.post-format-icon.post-format-image:before,.post-state-format.post-format-image:before,a.post-state-format.format-image:before{content:"\f128"}.post-format-icon.post-format-gallery:before,.post-state-format.post-format-gallery:before,a.post-state-format.format-gallery:before{content:"\f161"}.post-format-icon.post-format-audio:before,.post-state-format.post-format-audio:before,a.post-state-format.format-audio:before{content:"\f127"}.post-format-icon.post-format-video:before,.post-state-format.post-format-video:before,a.post-state-format.format-video:before{content:"\f126"}.post-format-icon.post-format-chat:before,.post-state-format.post-format-chat:before,a.post-state-format.format-chat:before{content:"\f125"}.post-format-icon.post-format-status:before,.post-state-format.post-format-status:before,a.post-state-format.format-status:before{content:"\f130"}.post-format-icon.post-format-aside:before,.post-state-format.post-format-aside:before,a.post-state-format.format-aside:before{content:"\f123"}.post-format-icon.post-format-quote:before,.post-state-format.post-format-quote:before,a.post-state-format.format-quote:before{content:"\f122"}.post-format-icon.post-format-link:before,.post-state-format.post-format-link:before,a.post-state-format.format-link:before{content:"\f103"}.category-adder{margin-right:120px;padding:4px 0}.category-adder h4{margin:0 0 8px}#side-sortables .category-adder{margin:0}.categorydiv div.tabs-panel,.customlinkdiv div.tabs-panel,.posttypediv div.tabs-panel,.taxonomydiv div.tabs-panel,.wp-tab-panel{min-height:42px;max-height:200px;overflow:auto;padding:0 .9em;border:1px solid #ddd;background-color:#fdfdfd}div.tabs-panel-active{display:block}div.tabs-panel-inactive{display:none}#front-page-warning,#front-static-pages ul,.categorydiv ul.categorychecklist ul,.customlinkdiv ul.categorychecklist ul,.inline-editor ul.cat-checklist ul,.posttypediv ul.categorychecklist ul,.taxonomydiv ul.categorychecklist ul,ul.export-filters{margin-right:18px}ul.categorychecklist li{margin:0;padding:0;line-height:22px;word-wrap:break-word}.categorydiv .tabs-panel,.customlinkdiv .tabs-panel,.posttypediv .tabs-panel,.taxonomydiv .tabs-panel{border-width:3px;border-style:solid}.form-wrap label{display:block;padding:2px 0}.form-field input[type=text],.form-field input[type=password],.form-field input[type=email],.form-field input[type=number],.form-field input[type=search],.form-field input[type=tel],.form-field input[type=url],.form-field textarea{border-style:solid;border-width:1px;width:95%}.form-wrap p,p.description{margin:2px 0 5px;color:#666}.form-wrap p,p.description,p.help,span.description{font-size:13px;font-style:italic}.form-wrap .form-field{margin:1em 0;padding:0}.form-wrap .form-field #parent{max-width:100%}.col-wrap h2{margin:12px 0;font-size:1.1em}.col-wrap p.submit{margin-top:-10px}.edit-term-notes{margin-top:2em}#poststuff .tagsdiv .howto{margin:0 0 6px}.ajaxtag .newtag{position:relative}.tagsdiv .newtag{width:180px}.tagsdiv .the-tags{display:block;height:60px;margin:0 auto;overflow:auto;width:260px}#post-body-content .tagsdiv .the-tags{margin:0 5px}p.popular-tags{border:none;line-height:2em;padding:8px 12px 12px;text-align:justify}p.popular-tags a{padding:0 3px}.tagcloud{width:97%;margin:0 0 40px;text-align:justify}.tagcloud h2{margin:2px 0 12px}.the-tagcloud ul{margin:0}.the-tagcloud ul li{display:inline-block}.ac_results{display:none;margin:-1px 0 0;padding:0;list-style:none;position:absolute;z-index:10000;border:1px solid #5b9dd9;background-color:#fff}.wp-customizer .ac_results{z-index:500000}.ac_results li{margin:0;padding:5px 10px;white-space:nowrap;text-align:right}.ac_over .ac_match,.ac_results .ac_over{background-color:#0073aa;color:#fff;cursor:pointer}.ac_match{text-decoration:underline}#edittag{max-width:800px}.edit-tag-actions{margin-top:20px;overflow:hidden;padding:10px;margin-left:10px}.comment-php .wp-editor-area{height:200px}.comment-ays td,.comment-ays th{padding:10px 15px}.comment-ays .comment-content ul{list-style:outside;margin-right:2em}.comment-ays .comment-content a[href]:after{content:'(' attr(href) ')';display:inline-block;padding:0 4px;color:#72777C;font-size:13px;word-break:break-all}.comment-ays .comment-content p.edit-comment{margin-top:10px}.comment-ays .comment-content p.edit-comment a[href]:after{content:'';padding:0}#comment-status-radio label,.links-table td,.links-table th{padding:5px 0}.comment-ays-submit .button-cancel{margin-right:1em}.spam-undo-inside,.trash-undo-inside{margin:1px 0 1px 8px;line-height:16px}.spam-undo-inside .avatar,.trash-undo-inside .avatar{height:20px;width:20px;margin-left:8px;vertical-align:middle}.stuffbox .editcomment{clear:none}#comment-status-radio p{margin:3px 0 5px}#comment-status-radio input{margin:2px 0 5px 3px;vertical-align:middle}table.links-table{width:100%;border-spacing:0}.links-table th{font-weight:400;text-align:right;vertical-align:top;min-width:80px;width:20%;word-wrap:break-word}.links-table td label{margin-left:8px}.links-table td input[type=text],.links-table td textarea{width:100%}.links-table #link_rel{max-width:280px}#qt_content_dfw,#wp-content-wrap .mce-wp-dfw{display:none}.wp-editor-expand #qt_content_dfw,.wp-editor-expand #wp-content-wrap .mce-wp-dfw{display:inline-block}.focus-on #screen-meta,.focus-on #screen-meta-links,.focus-on #wp-toolbar,.focus-on #wpfooter,.focus-on .page-title-action,.focus-on .postbox-container>*,.focus-on .update-nag,.focus-on .wrap>h1,.focus-on div.error,.focus-on div.notice,.focus-on div.updated{opacity:0;transition-duration:.6s;transition-property:opacity;transition-timing-function:ease-in-out}.focus-on #wp-toolbar{opacity:.3}.focus-off #screen-meta,.focus-off #screen-meta-links,.focus-off #wp-toolbar,.focus-off #wpfooter,.focus-off .page-title-action,.focus-off .postbox-container>*,.focus-off .update-nag,.focus-off .wrap>h1,.focus-off div.error,.focus-off div.notice,.focus-off div.updated{opacity:1;transition-duration:.2s;transition-property:opacity;transition-timing-function:ease-in-out}.focus-off #wp-toolbar{-webkit-transform:translate(0,0)}.focus-on #adminmenuback,.focus-on #adminmenuwrap{transition-duration:.6s;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;transition-timing-function:ease-in-out;-webkit-transform:translateX(100%);transform:translateX(100%)}.focus-off #adminmenuback,.focus-off #adminmenuwrap{-webkit-transform:translateX(0);transform:translateX(0);transition-duration:.2s;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;transition-timing-function:ease-in-out}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){#content-resize-handle,#post-body .wp_themeSkin .mceStatusbar a.mceResize{background:url(../images/resize-2x.gif) right bottom no-repeat;background-size:11px 11px}.rtl #content-resize-handle,.rtl #post-body .wp_themeSkin .mceStatusbar a.mceResize{background-image:url(../images/resize-rtl-2x.gif);background-position:left bottom}}@media only screen and (max-width:850px){#poststuff{min-width:0}#wpbody-content #poststuff #post-body{margin:0}#wpbody-content #post-body.columns-2 #postbox-container-1{margin-left:0;width:100%}#poststuff #postbox-container-1 #side-sortables:empty,#poststuff #postbox-container-1 .empty-container{border:0;height:0;min-height:0}#poststuff #post-body.columns-2 #side-sortables{min-height:0;width:auto}.columns-prefs,.screen-layout{display:none}}@media screen and (max-width:782px){.wp-core-ui .edit-tag-actions .button-primary{margin-bottom:0}#post-body-content{min-width:0}#titlediv #title-prompt-text{padding:10px}#poststuff .stuffbox>h3,#poststuff h2,#poststuff h3.hndle{padding:12px}.post-format-options{padding-left:0}.post-format-options a{margin-left:5px;margin-bottom:5px;min-width:52px}.post-format-options .post-format-title{font-size:11px}.post-format-options a div{height:28px;width:28px}.post-format-options a div:before{font-size:26px!important}#post-visibility-select{line-height:280%}.wp-core-ui .save-post-visibility,.wp-core-ui .save-timestamp{vertical-align:middle;margin-left:15px}.timestamp-wrap select#mm{display:block;width:100%;margin-bottom:10px}.timestamp-wrap #aa,.timestamp-wrap #hh,.timestamp-wrap #jj,.timestamp-wrap #mn{padding:12px 3px;font-size:14px;margin-bottom:5px;width:auto;text-align:center}ul.category-tabs{margin:30px 0 15px}.tagsdiv .newtag,ul.categorychecklist li{margin-bottom:15px}ul.category-tabs li.tabs{padding:15px}ul.categorychecklist ul{margin-top:15px}.category-add input[type=text],.category-add select{max-width:none;margin-bottom:15px}.tagsdiv .newtag{width:100%;height:auto}.tagchecklist{margin:25px 10px}.tagchecklist>li{font-size:16px;line-height:1.4}#commentstatusdiv p{line-height:2.8}.mceToolbar *{white-space:normal!important}.mceToolbar td,.mceToolbar tr{float:right!important}.wp_themeSkin a.mceButton{width:30px;height:30px}.wp_themeSkin .mceButton .mceIcon{margin-top:5px;margin-right:5px}.wp_themeSkin .mceSplitButton{margin-top:1px}.wp_themeSkin .mceSplitButton td a.mceAction{padding:6px 6px 6px 3px}.wp_themeSkin .mceSplitButton td a.mceOpen,.wp_themeSkin .mceSplitButtonEnabled:hover td a.mceOpen{padding-top:6px;padding-bottom:6px;background-position:1px 6px}.wp_themeSkin table.mceListBox{margin:5px}div.quicktags-toolbar input{padding:10px 20px}button.wp-switch-editor{font-size:16px;line-height:1em;margin:7px 7px 0 0;padding:8px 12px}#wp-content-media-buttons a{font-size:14px;padding:6px 10px}.wp-media-buttons span.jetpack-contact-form-icon,.wp-media-buttons span.wp-media-buttons-icon{width:22px!important;margin-right:-2px!important}.wp-media-buttons #insert-jetpack-contact-form span.jetpack-contact-form-icon:before,.wp-media-buttons .add_media span.wp-media-buttons-icon:before{font-size:20px!important}#content_wp_fullscreen{display:none}.misc-pub-section{padding:20px 10px}.misc-pub-section>a{float:left;font-size:16px}#delete-action,#publishing-action{line-height:47px}#publishing-action .spinner{float:none;margin-top:-2px}.comment-ays td,.comment-ays th{padding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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#poststuff {
|
2 |
+
padding-top: 10px;
|
3 |
+
min-width: 763px;
|
4 |
+
}
|
5 |
+
|
6 |
+
#poststuff #post-body {
|
7 |
+
padding: 0;
|
8 |
+
}
|
9 |
+
|
10 |
+
#poststuff .postbox-container {
|
11 |
+
width: 100%;
|
12 |
+
}
|
13 |
+
|
14 |
+
#poststuff #post-body.columns-2 {
|
15 |
+
margin-right: 300px;
|
16 |
+
}
|
17 |
+
|
18 |
+
/*------------------------------------------------------------------------------
|
19 |
+
11.0 - Write/Edit Post Screen
|
20 |
+
------------------------------------------------------------------------------*/
|
21 |
+
|
22 |
+
#show-comments {
|
23 |
+
overflow: hidden;
|
24 |
+
}
|
25 |
+
|
26 |
+
#save-action .spinner,
|
27 |
+
#show-comments a {
|
28 |
+
float: left;
|
29 |
+
}
|
30 |
+
|
31 |
+
#show-comments .spinner {
|
32 |
+
float: none;
|
33 |
+
margin-top: 0;
|
34 |
+
}
|
35 |
+
|
36 |
+
#lost-connection-notice .spinner {
|
37 |
+
visibility: visible;
|
38 |
+
float: left;
|
39 |
+
margin: 0 5px 0 0;
|
40 |
+
}
|
41 |
+
|
42 |
+
#titlediv {
|
43 |
+
position: relative;
|
44 |
+
}
|
45 |
+
|
46 |
+
#titlediv label {
|
47 |
+
cursor: text;
|
48 |
+
}
|
49 |
+
|
50 |
+
#titlediv div.inside {
|
51 |
+
margin: 0;
|
52 |
+
}
|
53 |
+
|
54 |
+
#poststuff #titlewrap {
|
55 |
+
border: 0;
|
56 |
+
padding: 0;
|
57 |
+
}
|
58 |
+
|
59 |
+
#titlediv #title {
|
60 |
+
padding: 3px 8px;
|
61 |
+
font-size: 1.7em;
|
62 |
+
line-height: 100%;
|
63 |
+
height: 1.7em;
|
64 |
+
width: 100%;
|
65 |
+
outline: none;
|
66 |
+
margin: 0 0 3px;
|
67 |
+
background-color: #fff;
|
68 |
+
}
|
69 |
+
|
70 |
+
#titlediv #title-prompt-text {
|
71 |
+
color: #72777c;
|
72 |
+
position: absolute;
|
73 |
+
font-size: 1.7em;
|
74 |
+
padding: 11px 10px;
|
75 |
+
}
|
76 |
+
|
77 |
+
input#link_description,
|
78 |
+
input#link_url {
|
79 |
+
width: 98%;
|
80 |
+
}
|
81 |
+
|
82 |
+
#pending {
|
83 |
+
background: 0 none;
|
84 |
+
border: 0 none;
|
85 |
+
padding: 0;
|
86 |
+
font-size: 11px;
|
87 |
+
margin-top: -1px;
|
88 |
+
}
|
89 |
+
|
90 |
+
#edit-slug-box,
|
91 |
+
#comment-link-box {
|
92 |
+
line-height: 24px;
|
93 |
+
min-height: 25px; /* Yes, line-height + 1 */
|
94 |
+
margin-top: 5px;
|
95 |
+
padding: 0 10px;
|
96 |
+
color: #666;
|
97 |
+
}
|
98 |
+
|
99 |
+
#edit-slug-box .cancel {
|
100 |
+
margin-right: 10px;
|
101 |
+
padding: 0;
|
102 |
+
font-size: 11px;
|
103 |
+
}
|
104 |
+
|
105 |
+
#comment-link-box {
|
106 |
+
margin: 5px 0;
|
107 |
+
padding: 0 5px;
|
108 |
+
}
|
109 |
+
|
110 |
+
#editable-post-name-full {
|
111 |
+
display: none;
|
112 |
+
}
|
113 |
+
|
114 |
+
#editable-post-name {
|
115 |
+
font-weight: 600;
|
116 |
+
}
|
117 |
+
|
118 |
+
#editable-post-name input {
|
119 |
+
font-size: 13px;
|
120 |
+
font-weight: 400;
|
121 |
+
height: 24px;
|
122 |
+
margin: 0;
|
123 |
+
width: 16em;
|
124 |
+
}
|
125 |
+
|
126 |
+
.postarea h3 label {
|
127 |
+
float: left;
|
128 |
+
}
|
129 |
+
|
130 |
+
body.post-new-php .submitbox .submitdelete {
|
131 |
+
display: none;
|
132 |
+
}
|
133 |
+
|
134 |
+
.submitbox .submit a:hover {
|
135 |
+
text-decoration: underline;
|
136 |
+
}
|
137 |
+
|
138 |
+
.submitbox .submit input {
|
139 |
+
margin-bottom: 8px;
|
140 |
+
margin-right: 4px;
|
141 |
+
padding: 6px;
|
142 |
+
}
|
143 |
+
|
144 |
+
#post-status-select {
|
145 |
+
margin-top: 3px;
|
146 |
+
}
|
147 |
+
|
148 |
+
/* Post Screen */
|
149 |
+
#post-body #normal-sortables {
|
150 |
+
min-height: 50px;
|
151 |
+
}
|
152 |
+
|
153 |
+
.postbox {
|
154 |
+
position: relative;
|
155 |
+
min-width: 255px;
|
156 |
+
border: 1px solid #e5e5e5;
|
157 |
+
box-shadow: 0 1px 1px rgba(0,0,0,0.04);
|
158 |
+
background: #fff;
|
159 |
+
}
|
160 |
+
|
161 |
+
#trackback_url {
|
162 |
+
width: 99%;
|
163 |
+
}
|
164 |
+
|
165 |
+
#normal-sortables .postbox .submit {
|
166 |
+
background: transparent none;
|
167 |
+
border: 0 none;
|
168 |
+
float: right;
|
169 |
+
padding: 0 12px;
|
170 |
+
margin:0;
|
171 |
+
}
|
172 |
+
|
173 |
+
.category-add input[type="text"],
|
174 |
+
.category-add select {
|
175 |
+
width: 100%;
|
176 |
+
max-width: 260px;
|
177 |
+
vertical-align: baseline;
|
178 |
+
}
|
179 |
+
|
180 |
+
#side-sortables .category-add input[type="text"],
|
181 |
+
#side-sortables .category-add select {
|
182 |
+
margin: 0 0 1em;
|
183 |
+
}
|
184 |
+
|
185 |
+
ul.category-tabs li,
|
186 |
+
#side-sortables .add-menu-item-tabs li,
|
187 |
+
.wp-tab-bar li {
|
188 |
+
display: inline;
|
189 |
+
line-height: 1.35em;
|
190 |
+
}
|
191 |
+
|
192 |
+
.no-js .category-tabs li.hide-if-no-js {
|
193 |
+
display: none;
|
194 |
+
}
|
195 |
+
|
196 |
+
.category-tabs a,
|
197 |
+
#side-sortables .add-menu-item-tabs a,
|
198 |
+
.wp-tab-bar a {
|
199 |
+
text-decoration: none;
|
200 |
+
}
|
201 |
+
|
202 |
+
/* @todo: do these really need to be so specific? */
|
203 |
+
#side-sortables .category-tabs .tabs a,
|
204 |
+
#side-sortables .add-menu-item-tabs .tabs a,
|
205 |
+
.wp-tab-bar .wp-tab-active a,
|
206 |
+
#post-body ul.category-tabs li.tabs a,
|
207 |
+
#post-body ul.add-menu-item-tabs li.tabs a {
|
208 |
+
color: #32373c;
|
209 |
+
}
|
210 |
+
|
211 |
+
.category-tabs {
|
212 |
+
margin: 8px 0 5px;
|
213 |
+
}
|
214 |
+
|
215 |
+
/* Back-compat for pre-4.4 */
|
216 |
+
#category-adder h4 {
|
217 |
+
margin: 0;
|
218 |
+
}
|
219 |
+
|
220 |
+
.taxonomy-add-new {
|
221 |
+
display: inline-block;
|
222 |
+
margin: 10px 0;
|
223 |
+
font-weight: 600;
|
224 |
+
}
|
225 |
+
|
226 |
+
#side-sortables .add-menu-item-tabs,
|
227 |
+
.wp-tab-bar {
|
228 |
+
margin-bottom: 3px;
|
229 |
+
}
|
230 |
+
|
231 |
+
#normal-sortables .postbox #replyrow .submit {
|
232 |
+
float: none;
|
233 |
+
margin: 0;
|
234 |
+
padding: 5px 7px 10px;
|
235 |
+
overflow: hidden;
|
236 |
+
}
|
237 |
+
|
238 |
+
#side-sortables .submitbox .submit input,
|
239 |
+
#side-sortables .submitbox .submit .preview,
|
240 |
+
#side-sortables .submitbox .submit a.preview:hover {
|
241 |
+
border: 0 none;
|
242 |
+
}
|
243 |
+
|
244 |
+
/* @todo: make this a more generic class */
|
245 |
+
ul.category-tabs,
|
246 |
+
ul.add-menu-item-tabs,
|
247 |
+
ul.wp-tab-bar {
|
248 |
+
margin-top: 12px;
|
249 |
+
}
|
250 |
+
|
251 |
+
ul.category-tabs li,
|
252 |
+
ul.add-menu-item-tabs li {
|
253 |
+
border: solid 1px transparent;
|
254 |
+
position: relative;
|
255 |
+
}
|
256 |
+
|
257 |
+
ul.category-tabs li.tabs,
|
258 |
+
ul.add-menu-item-tabs li.tabs,
|
259 |
+
.wp-tab-active {
|
260 |
+
border: 1px solid #ddd;
|
261 |
+
border-bottom-color: #fdfdfd;
|
262 |
+
background-color: #fdfdfd;
|
263 |
+
}
|
264 |
+
|
265 |
+
ul.category-tabs li,
|
266 |
+
ul.add-menu-item-tabs li,
|
267 |
+
ul.wp-tab-bar li {
|
268 |
+
padding: 3px 5px 6px;
|
269 |
+
}
|
270 |
+
|
271 |
+
#set-post-thumbnail {
|
272 |
+
display: inline-block;
|
273 |
+
max-width: 100%;
|
274 |
+
}
|
275 |
+
|
276 |
+
#postimagediv .inside img {
|
277 |
+
max-width: 100%;
|
278 |
+
height: auto;
|
279 |
+
width: auto;
|
280 |
+
vertical-align: top;
|
281 |
+
background-image: linear-gradient(45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4), linear-gradient(45deg, #c4c4c4 25%, transparent 25%, transparent 75%, #c4c4c4 75%, #c4c4c4);
|
282 |
+
background-position: 0 0, 10px 10px;
|
283 |
+
background-size: 20px 20px;
|
284 |
+
}
|
285 |
+
|
286 |
+
form#tags-filter {
|
287 |
+
position: relative;
|
288 |
+
}
|
289 |
+
|
290 |
+
/* Global classes */
|
291 |
+
.wp-hidden-children .wp-hidden-child,
|
292 |
+
.ui-tabs-hide {
|
293 |
+
display: none;
|
294 |
+
}
|
295 |
+
|
296 |
+
#post-body .tagsdiv #newtag {
|
297 |
+
margin-right: 5px;
|
298 |
+
width: 16em;
|
299 |
+
}
|
300 |
+
|
301 |
+
#side-sortables input#post_password {
|
302 |
+
width: 94%
|
303 |
+
}
|
304 |
+
|
305 |
+
#side-sortables .tagsdiv #newtag {
|
306 |
+
width: 68%;
|
307 |
+
}
|
308 |
+
|
309 |
+
#post-status-info {
|
310 |
+
width: 100%;
|
311 |
+
border-spacing: 0;
|
312 |
+
border: 1px solid #e5e5e5;
|
313 |
+
border-top: none;
|
314 |
+
background-color: #f7f7f7;
|
315 |
+
box-shadow: 0 1px 1px rgba(0,0,0,0.04);
|
316 |
+
z-index: 999;
|
317 |
+
}
|
318 |
+
|
319 |
+
#post-status-info td {
|
320 |
+
font-size: 12px;
|
321 |
+
}
|
322 |
+
|
323 |
+
.autosave-info {
|
324 |
+
padding: 2px 10px;
|
325 |
+
text-align: right;
|
326 |
+
}
|
327 |
+
|
328 |
+
#editorcontent #post-status-info {
|
329 |
+
border: none;
|
330 |
+
}
|
331 |
+
|
332 |
+
#content-resize-handle {
|
333 |
+
background: transparent url(../images/resize.gif) no-repeat scroll right bottom;
|
334 |
+
width: 12px;
|
335 |
+
cursor: row-resize;
|
336 |
+
}
|
337 |
+
|
338 |
+
/*rtl:ignore*/
|
339 |
+
.rtl #content-resize-handle {
|
340 |
+
background-image: url(../images/resize-rtl.gif);
|
341 |
+
background-position: left bottom;
|
342 |
+
}
|
343 |
+
|
344 |
+
.wp-editor-expand #content-resize-handle {
|
345 |
+
display: none;
|
346 |
+
}
|
347 |
+
|
348 |
+
#postdivrich #content {
|
349 |
+
resize: none;
|
350 |
+
}
|
351 |
+
|
352 |
+
#wp-word-count {
|
353 |
+
display: block;
|
354 |
+
padding: 2px 10px;
|
355 |
+
}
|
356 |
+
|
357 |
+
#wp-content-editor-container {
|
358 |
+
position: relative;
|
359 |
+
}
|
360 |
+
|
361 |
+
.wp-editor-expand #wp-content-editor-tools {
|
362 |
+
z-index: 1000;
|
363 |
+
border-bottom: 1px solid #e5e5e5;
|
364 |
+
}
|
365 |
+
|
366 |
+
.wp-editor-expand #wp-content-editor-container {
|
367 |
+
box-shadow: none;
|
368 |
+
margin-top: -1px;
|
369 |
+
}
|
370 |
+
|
371 |
+
.wp-editor-expand #wp-content-editor-container {
|
372 |
+
border-bottom: 0 none;
|
373 |
+
}
|
374 |
+
|
375 |
+
.wp-editor-expand div.mce-statusbar {
|
376 |
+
z-index: 1;
|
377 |
+
}
|
378 |
+
|
379 |
+
.wp-editor-expand #post-status-info {
|
380 |
+
border-top: 1px solid #e5e5e5;
|
381 |
+
}
|
382 |
+
|
383 |
+
.wp-editor-expand div.mce-toolbar-grp {
|
384 |
+
z-index: 999;
|
385 |
+
}
|
386 |
+
|
387 |
+
/* TinyMCE native fullscreen mode override */
|
388 |
+
.mce-fullscreen #wp-content-wrap .mce-menubar,
|
389 |
+
.mce-fullscreen #wp-content-wrap .mce-toolbar-grp,
|
390 |
+
.mce-fullscreen #wp-content-wrap .mce-edit-area,
|
391 |
+
.mce-fullscreen #wp-content-wrap .mce-statusbar {
|
392 |
+
position: static !important;
|
393 |
+
width: auto !important;
|
394 |
+
padding: 0 !important;
|
395 |
+
}
|
396 |
+
|
397 |
+
.mce-fullscreen #wp-content-wrap .mce-statusbar {
|
398 |
+
visibility: visible !important;
|
399 |
+
}
|
400 |
+
|
401 |
+
.mce-fullscreen #wp-content-wrap .mce-tinymce .mce-wp-dfw {
|
402 |
+
display: none;
|
403 |
+
}
|
404 |
+
|
405 |
+
.post-php.mce-fullscreen #wpadminbar,
|
406 |
+
.mce-fullscreen #wp-content-wrap .mce-wp-dfw {
|
407 |
+
display: none;
|
408 |
+
}
|
409 |
+
/* End TinyMCE native fullscreen mode override */
|
410 |
+
|
411 |
+
#wp-content-editor-tools {
|
412 |
+
background-color: #f1f1f1;
|
413 |
+
padding-top: 20px;
|
414 |
+
}
|
415 |
+
|
416 |
+
#poststuff #post-body.columns-2 #side-sortables {
|
417 |
+
width: 280px;
|
418 |
+
}
|
419 |
+
|
420 |
+
#timestampdiv select {
|
421 |
+
height: 21px;
|
422 |
+
line-height: 14px;
|
423 |
+
padding: 0;
|
424 |
+
vertical-align: top;
|
425 |
+
font-size: 12px;
|
426 |
+
}
|
427 |
+
|
428 |
+
#aa, #jj, #hh, #mn {
|
429 |
+
padding: 1px;
|
430 |
+
font-size: 12px;
|
431 |
+
}
|
432 |
+
|
433 |
+
#jj, #hh, #mn {
|
434 |
+
width: 2em;
|
435 |
+
}
|
436 |
+
|
437 |
+
#aa {
|
438 |
+
width: 3.4em;
|
439 |
+
}
|
440 |
+
|
441 |
+
.curtime #timestamp {
|
442 |
+
padding: 2px 0 1px 0;
|
443 |
+
display: inline !important;
|
444 |
+
height: auto !important;
|
445 |
+
}
|
446 |
+
|
447 |
+
#post-body .misc-pub-post-status:before,
|
448 |
+
#post-body #visibility:before,
|
449 |
+
.curtime #timestamp:before,
|
450 |
+
#post-body .misc-pub-revisions:before,
|
451 |
+
span.wp-media-buttons-icon:before {
|
452 |
+
color: #82878c;
|
453 |
+
}
|
454 |
+
|
455 |
+
#post-body .misc-pub-post-status:before,
|
456 |
+
#post-body #visibility:before,
|
457 |
+
.curtime #timestamp:before,
|
458 |
+
#post-body .misc-pub-revisions:before {
|
459 |
+
font: normal 20px/1 dashicons;
|
460 |
+
speak: none;
|
461 |
+
display: inline-block;
|
462 |
+
margin-left: -1px;
|
463 |
+
padding-right: 3px;
|
464 |
+
vertical-align: top;
|
465 |
+
-webkit-font-smoothing: antialiased;
|
466 |
+
-moz-osx-font-smoothing: grayscale;
|
467 |
+
}
|
468 |
+
|
469 |
+
#post-body .misc-pub-post-status:before {
|
470 |
+
content: "\f173";
|
471 |
+
}
|
472 |
+
|
473 |
+
#post-body #visibility:before {
|
474 |
+
content: "\f177";
|
475 |
+
}
|
476 |
+
|
477 |
+
.curtime #timestamp:before {
|
478 |
+
content: "\f145";
|
479 |
+
position: relative;
|
480 |
+
top: -1px;
|
481 |
+
}
|
482 |
+
|
483 |
+
#post-body .misc-pub-revisions:before {
|
484 |
+
content: "\f321";
|
485 |
+
}
|
486 |
+
|
487 |
+
#timestampdiv {
|
488 |
+
padding-top: 5px;
|
489 |
+
line-height: 23px;
|
490 |
+
}
|
491 |
+
|
492 |
+
#timestampdiv p {
|
493 |
+
margin: 8px 0 6px;
|
494 |
+
}
|
495 |
+
|
496 |
+
#timestampdiv input {
|
497 |
+
border-width: 1px;
|
498 |
+
border-style: solid;
|
499 |
+
}
|
500 |
+
|
501 |
+
.notification-dialog {
|
502 |
+
position: fixed;
|
503 |
+
top: 30%;
|
504 |
+
max-height: 70%;
|
505 |
+
left: 50%;
|
506 |
+
width: 450px;
|
507 |
+
margin-left: -225px;
|
508 |
+
background: #fff;
|
509 |
+
box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 );
|
510 |
+
line-height: 1.5;
|
511 |
+
z-index: 1000005;
|
512 |
+
overflow-y: auto;
|
513 |
+
}
|
514 |
+
|
515 |
+
.notification-dialog-background {
|
516 |
+
position: fixed;
|
517 |
+
top: 0;
|
518 |
+
left: 0;
|
519 |
+
right: 0;
|
520 |
+
bottom: 0;
|
521 |
+
background: #000;
|
522 |
+
opacity: 0.7;
|
523 |
+
filter: alpha(opacity=70);
|
524 |
+
z-index: 1000000;
|
525 |
+
}
|
526 |
+
|
527 |
+
#post-lock-dialog .post-locked-message,
|
528 |
+
#post-lock-dialog .post-taken-over {
|
529 |
+
margin: 25px;
|
530 |
+
}
|
531 |
+
|
532 |
+
#post-lock-dialog .post-locked-message a.button,
|
533 |
+
#file-editor-warning .button {
|
534 |
+
margin-right: 10px;
|
535 |
+
}
|
536 |
+
|
537 |
+
#post-lock-dialog .post-locked-avatar {
|
538 |
+
float: left;
|
539 |
+
margin: 0 20px 20px 0;
|
540 |
+
}
|
541 |
+
|
542 |
+
#post-lock-dialog .wp-tab-first {
|
543 |
+
outline: 0;
|
544 |
+
}
|
545 |
+
|
546 |
+
#post-lock-dialog .locked-saving img {
|
547 |
+
float: left;
|
548 |
+
margin-right: 3px;
|
549 |
+
}
|
550 |
+
|
551 |
+
#post-lock-dialog.saving .locked-saving,
|
552 |
+
#post-lock-dialog.saved .locked-saved {
|
553 |
+
display: inline;
|
554 |
+
}
|
555 |
+
|
556 |
+
#excerpt {
|
557 |
+
display: block;
|
558 |
+
margin: 12px 0 0;
|
559 |
+
height: 4em;
|
560 |
+
width: 100%;
|
561 |
+
}
|
562 |
+
|
563 |
+
.tagchecklist {
|
564 |
+
margin-left: 14px;
|
565 |
+
font-size: 12px;
|
566 |
+
overflow: auto;
|
567 |
+
}
|
568 |
+
|
569 |
+
.tagchecklist br {
|
570 |
+
display: none;
|
571 |
+
}
|
572 |
+
|
573 |
+
.tagchecklist strong {
|
574 |
+
margin-left: -8px;
|
575 |
+
position: absolute;
|
576 |
+
}
|
577 |
+
|
578 |
+
.tagchecklist > li {
|
579 |
+
float: left;
|
580 |
+
margin-right: 25px;
|
581 |
+
font-size: 13px;
|
582 |
+
line-height: 1.8em;
|
583 |
+
cursor: default;
|
584 |
+
max-width: 100%;
|
585 |
+
overflow: hidden;
|
586 |
+
text-overflow: ellipsis;
|
587 |
+
}
|
588 |
+
|
589 |
+
.tagchecklist .ntdelbutton {
|
590 |
+
position: absolute;
|
591 |
+
width: 24px;
|
592 |
+
height: 24px;
|
593 |
+
border: none;
|
594 |
+
margin: 0 0 0 -19px;
|
595 |
+
padding: 0;
|
596 |
+
background: none;
|
597 |
+
cursor: pointer;
|
598 |
+
text-indent: 0;
|
599 |
+
}
|
600 |
+
|
601 |
+
#poststuff h3.hndle, /* Back-compat for pre-4.4 */
|
602 |
+
#poststuff .stuffbox > h3, /* Back-compat for pre-4.4 */
|
603 |
+
#poststuff h2 {
|
604 |
+
font-size: 14px;
|
605 |
+
padding: 8px 12px;
|
606 |
+
margin: 0;
|
607 |
+
line-height: 1.4;
|
608 |
+
}
|
609 |
+
|
610 |
+
#poststuff .inside {
|
611 |
+
margin: 6px 0 0 0;
|
612 |
+
}
|
613 |
+
|
614 |
+
#poststuff .inside #parent_id,
|
615 |
+
#poststuff .inside #page_template {
|
616 |
+
max-width: 100%;
|
617 |
+
}
|
618 |
+
|
619 |
+
.ie8 #poststuff .inside #parent_id,
|
620 |
+
.ie8 #poststuff .inside #page_template {
|
621 |
+
width: 250px;
|
622 |
+
}
|
623 |
+
|
624 |
+
.post-attributes-label-wrapper {
|
625 |
+
margin-bottom: 0.5em;
|
626 |
+
}
|
627 |
+
|
628 |
+
.post-attributes-label {
|
629 |
+
vertical-align: baseline;
|
630 |
+
font-weight: 600;
|
631 |
+
}
|
632 |
+
|
633 |
+
#post-visibility-select {
|
634 |
+
line-height: 1.5em;
|
635 |
+
margin-top: 3px;
|
636 |
+
}
|
637 |
+
|
638 |
+
#linksubmitdiv .inside, /* Old Link Manager back-compat. */
|
639 |
+
#poststuff #submitdiv .inside {
|
640 |
+
margin: 0;
|
641 |
+
padding: 0;
|
642 |
+
}
|
643 |
+
|
644 |
+
#post-body-content,
|
645 |
+
.edit-form-section {
|
646 |
+
margin-bottom: 20px;
|
647 |
+
}
|
648 |
+
|
649 |
+
/*------------------------------------------------------------------------------
|
650 |
+
11.1 - Custom Fields
|
651 |
+
------------------------------------------------------------------------------*/
|
652 |
+
|
653 |
+
#postcustomstuff thead th {
|
654 |
+
padding: 5px 8px 8px;
|
655 |
+
background-color: #f1f1f1;
|
656 |
+
}
|
657 |
+
|
658 |
+
#postcustom #postcustomstuff .submit {
|
659 |
+
border: 0 none;
|
660 |
+
float: none;
|
661 |
+
padding: 0 8px 8px;
|
662 |
+
}
|
663 |
+
|
664 |
+
#side-sortables #postcustom #postcustomstuff .submit {
|
665 |
+
margin: 0;
|
666 |
+
padding: 0;
|
667 |
+
}
|
668 |
+
|
669 |
+
#side-sortables #postcustom #postcustomstuff #the-list textarea {
|
670 |
+
height: 85px;
|
671 |
+
}
|
672 |
+
|
673 |
+
#side-sortables #postcustom #postcustomstuff td.left input,
|
674 |
+
#side-sortables #postcustom #postcustomstuff td.left select,
|
675 |
+
#side-sortables #postcustomstuff #newmetaleft a {
|
676 |
+
margin: 3px 3px 0;
|
677 |
+
}
|
678 |
+
|
679 |
+
#postcustomstuff table {
|
680 |
+
margin: 0;
|
681 |
+
width: 100%;
|
682 |
+
border: 1px solid #ddd;
|
683 |
+
border-spacing: 0;
|
684 |
+
background-color: #f9f9f9;
|
685 |
+
}
|
686 |
+
|
687 |
+
#postcustomstuff tr {
|
688 |
+
vertical-align: top;
|
689 |
+
}
|
690 |
+
|
691 |
+
#postcustomstuff table input,
|
692 |
+
#postcustomstuff table select,
|
693 |
+
#postcustomstuff table textarea {
|
694 |
+
width: 96%;
|
695 |
+
margin: 8px;
|
696 |
+
}
|
697 |
+
|
698 |
+
#side-sortables #postcustomstuff table input,
|
699 |
+
#side-sortables #postcustomstuff table select,
|
700 |
+
#side-sortables #postcustomstuff table textarea {
|
701 |
+
margin: 3px;
|
702 |
+
}
|
703 |
+
|
704 |
+
#postcustomstuff th.left,
|
705 |
+
#postcustomstuff td.left {
|
706 |
+
width: 38%;
|
707 |
+
}
|
708 |
+
|
709 |
+
#postcustomstuff .submit input {
|
710 |
+
margin: 0;
|
711 |
+
width: auto;
|
712 |
+
}
|
713 |
+
|
714 |
+
#postcustomstuff #newmetaleft a {
|
715 |
+
display: inline-block;
|
716 |
+
margin: 0 8px 8px;
|
717 |
+
text-decoration: none;
|
718 |
+
}
|
719 |
+
|
720 |
+
.no-js #postcustomstuff #enternew {
|
721 |
+
display: none;
|
722 |
+
}
|
723 |
+
|
724 |
+
#post-body-content .compat-attachment-fields {
|
725 |
+
margin-bottom: 20px;
|
726 |
+
}
|
727 |
+
|
728 |
+
.compat-attachment-fields th {
|
729 |
+
padding-top: 5px;
|
730 |
+
padding-right: 10px;
|
731 |
+
}
|
732 |
+
|
733 |
+
/*------------------------------------------------------------------------------
|
734 |
+
11.3 - Featured Images
|
735 |
+
------------------------------------------------------------------------------*/
|
736 |
+
|
737 |
+
#select-featured-image {
|
738 |
+
padding: 4px 0;
|
739 |
+
overflow: hidden;
|
740 |
+
}
|
741 |
+
|
742 |
+
#select-featured-image img {
|
743 |
+
max-width: 100%;
|
744 |
+
height: auto;
|
745 |
+
margin-bottom: 10px;
|
746 |
+
}
|
747 |
+
|
748 |
+
#select-featured-image a {
|
749 |
+
float: left;
|
750 |
+
clear: both;
|
751 |
+
}
|
752 |
+
|
753 |
+
#select-featured-image .remove {
|
754 |
+
display: none;
|
755 |
+
margin-top: 10px;
|
756 |
+
}
|
757 |
+
|
758 |
+
.js #select-featured-image.has-featured-image .remove {
|
759 |
+
display: inline-block;
|
760 |
+
}
|
761 |
+
|
762 |
+
.no-js #select-featured-image .choose {
|
763 |
+
display: none;
|
764 |
+
}
|
765 |
+
|
766 |
+
/*------------------------------------------------------------------------------
|
767 |
+
11.4 - Post formats
|
768 |
+
------------------------------------------------------------------------------*/
|
769 |
+
|
770 |
+
.post-state-format {
|
771 |
+
overflow: hidden;
|
772 |
+
display: inline-block;
|
773 |
+
vertical-align: middle;
|
774 |
+
height: 20px;
|
775 |
+
width: 20px;
|
776 |
+
margin-right: 5px;
|
777 |
+
margin-top: -4px;
|
778 |
+
}
|
779 |
+
|
780 |
+
.post-state-format:before {
|
781 |
+
display: block;
|
782 |
+
height: 20px;
|
783 |
+
width: 20px;
|
784 |
+
font: normal 20px/1 dashicons !important;
|
785 |
+
speak: none;
|
786 |
+
-webkit-font-smoothing: antialiased;
|
787 |
+
-moz-osx-font-smoothing: grayscale;
|
788 |
+
}
|
789 |
+
|
790 |
+
.post-state-format:before,
|
791 |
+
.post-format-icon:before {
|
792 |
+
color: #ddd;
|
793 |
+
transition: all .1s ease-in-out;
|
794 |
+
}
|
795 |
+
|
796 |
+
a.post-state-format:hover:before,
|
797 |
+
a.post-format-icon:hover:before {
|
798 |
+
color: #00a0d2;
|
799 |
+
}
|
800 |
+
|
801 |
+
#post-formats-select {
|
802 |
+
line-height: 2em;
|
803 |
+
}
|
804 |
+
|
805 |
+
#post-formats-select .post-format-icon:before {
|
806 |
+
top: 5px;
|
807 |
+
}
|
808 |
+
|
809 |
+
input.post-format {
|
810 |
+
margin-top: 1px;
|
811 |
+
}
|
812 |
+
|
813 |
+
label.post-format-icon {
|
814 |
+
margin-left: 0px;
|
815 |
+
padding: 2px 0 2px 0px;
|
816 |
+
}
|
817 |
+
|
818 |
+
.post-format-icon:before {
|
819 |
+
position: relative;
|
820 |
+
display: inline-block;
|
821 |
+
margin-right: 7px;
|
822 |
+
font: normal 20px/1 dashicons;
|
823 |
+
speak: none;
|
824 |
+
-webkit-font-smoothing: antialiased;
|
825 |
+
-moz-osx-font-smoothing: grayscale;
|
826 |
+
}
|
827 |
+
|
828 |
+
.post-state-format.post-format-standard:before,
|
829 |
+
.post-format-icon.post-format-standard:before,
|
830 |
+
a.post-state-format.format-standard:before {
|
831 |
+
content: "\f109";
|
832 |
+
}
|
833 |
+
|
834 |
+
.post-state-format.post-format-image:before,
|
835 |
+
.post-format-icon.post-format-image:before,
|
836 |
+
a.post-state-format.format-image:before {
|
837 |
+
content: "\f128";
|
838 |
+
}
|
839 |
+
|
840 |
+
.post-state-format.post-format-gallery:before,
|
841 |
+
.post-format-icon.post-format-gallery:before,
|
842 |
+
a.post-state-format.format-gallery:before {
|
843 |
+
content: "\f161";
|
844 |
+
}
|
845 |
+
|
846 |
+
.post-state-format.post-format-audio:before,
|
847 |
+
.post-format-icon.post-format-audio:before,
|
848 |
+
a.post-state-format.format-audio:before {
|
849 |
+
content: "\f127";
|
850 |
+
}
|
851 |
+
|
852 |
+
.post-state-format.post-format-video:before,
|
853 |
+
.post-format-icon.post-format-video:before,
|
854 |
+
a.post-state-format.format-video:before {
|
855 |
+
content: "\f126";
|
856 |
+
}
|
857 |
+
|
858 |
+
.post-state-format.post-format-chat:before,
|
859 |
+
.post-format-icon.post-format-chat:before,
|
860 |
+
a.post-state-format.format-chat:before {
|
861 |
+
content: "\f125";
|
862 |
+
}
|
863 |
+
|
864 |
+
.post-state-format.post-format-status:before,
|
865 |
+
.post-format-icon.post-format-status:before,
|
866 |
+
a.post-state-format.format-status:before {
|
867 |
+
content: "\f130";
|
868 |
+
}
|
869 |
+
|
870 |
+
.post-state-format.post-format-aside:before,
|
871 |
+
.post-format-icon.post-format-aside:before,
|
872 |
+
a.post-state-format.format-aside:before {
|
873 |
+
content: "\f123";
|
874 |
+
}
|
875 |
+
|
876 |
+
.post-state-format.post-format-quote:before,
|
877 |
+
.post-format-icon.post-format-quote:before,
|
878 |
+
a.post-state-format.format-quote:before {
|
879 |
+
content: "\f122";
|
880 |
+
}
|
881 |
+
|
882 |
+
.post-state-format.post-format-link:before,
|
883 |
+
.post-format-icon.post-format-link:before,
|
884 |
+
a.post-state-format.format-link:before {
|
885 |
+
content: "\f103";
|
886 |
+
}
|
887 |
+
|
888 |
+
/*------------------------------------------------------------------------------
|
889 |
+
12.0 - Categories
|
890 |
+
------------------------------------------------------------------------------*/
|
891 |
+
|
892 |
+
.category-adder {
|
893 |
+
margin-left: 120px;
|
894 |
+
padding: 4px 0;
|
895 |
+
}
|
896 |
+
|
897 |
+
.category-adder h4 {
|
898 |
+
margin: 0 0 8px;
|
899 |
+
}
|
900 |
+
|
901 |
+
#side-sortables .category-adder {
|
902 |
+
margin: 0;
|
903 |
+
}
|
904 |
+
|
905 |
+
.wp-tab-panel,
|
906 |
+
.categorydiv div.tabs-panel,
|
907 |
+
.customlinkdiv div.tabs-panel,
|
908 |
+
.posttypediv div.tabs-panel,
|
909 |
+
.taxonomydiv div.tabs-panel {
|
910 |
+
min-height: 42px;
|
911 |
+
max-height: 200px;
|
912 |
+
overflow: auto;
|
913 |
+
padding: 0 0.9em;
|
914 |
+
border: solid 1px #ddd;
|
915 |
+
background-color: #fdfdfd;
|
916 |
+
}
|
917 |
+
|
918 |
+
div.tabs-panel-active {
|
919 |
+
display:block;
|
920 |
+
}
|
921 |
+
|
922 |
+
div.tabs-panel-inactive {
|
923 |
+
display:none;
|
924 |
+
}
|
925 |
+
|
926 |
+
#front-page-warning,
|
927 |
+
#front-static-pages ul,
|
928 |
+
ul.export-filters,
|
929 |
+
.inline-editor ul.cat-checklist ul,
|
930 |
+
.categorydiv ul.categorychecklist ul,
|
931 |
+
.customlinkdiv ul.categorychecklist ul,
|
932 |
+
.posttypediv ul.categorychecklist ul,
|
933 |
+
.taxonomydiv ul.categorychecklist ul {
|
934 |
+
margin-left: 18px;
|
935 |
+
}
|
936 |
+
|
937 |
+
ul.categorychecklist li {
|
938 |
+
margin: 0;
|
939 |
+
padding: 0;
|
940 |
+
line-height: 22px;
|
941 |
+
word-wrap: break-word;
|
942 |
+
}
|
943 |
+
|
944 |
+
.categorydiv .tabs-panel,
|
945 |
+
.customlinkdiv .tabs-panel,
|
946 |
+
.posttypediv .tabs-panel,
|
947 |
+
.taxonomydiv .tabs-panel {
|
948 |
+
border-width: 3px;
|
949 |
+
border-style: solid;
|
950 |
+
}
|
951 |
+
|
952 |
+
.form-wrap label {
|
953 |
+
display: block;
|
954 |
+
padding: 2px 0;
|
955 |
+
}
|
956 |
+
|
957 |
+
.form-field input[type="text"],
|
958 |
+
.form-field input[type="password"],
|
959 |
+
.form-field input[type="email"],
|
960 |
+
.form-field input[type="number"],
|
961 |
+
.form-field input[type="search"],
|
962 |
+
.form-field input[type="tel"],
|
963 |
+
.form-field input[type="url"],
|
964 |
+
.form-field textarea {
|
965 |
+
border-style: solid;
|
966 |
+
border-width: 1px;
|
967 |
+
width: 95%;
|
968 |
+
}
|
969 |
+
|
970 |
+
p.description,
|
971 |
+
.form-wrap p {
|
972 |
+
margin: 2px 0 5px;
|
973 |
+
color: #666;
|
974 |
+
}
|
975 |
+
|
976 |
+
p.help,
|
977 |
+
p.description,
|
978 |
+
span.description,
|
979 |
+
.form-wrap p {
|
980 |
+
font-size: 13px;
|
981 |
+
font-style: italic;
|
982 |
+
}
|
983 |
+
|
984 |
+
.form-wrap .form-field {
|
985 |
+
margin: 1em 0;
|
986 |
+
padding: 0;
|
987 |
+
}
|
988 |
+
|
989 |
+
.form-wrap .form-field #parent {
|
990 |
+
max-width: 100%;
|
991 |
+
}
|
992 |
+
|
993 |
+
.col-wrap h2 {
|
994 |
+
margin: 12px 0;
|
995 |
+
font-size: 1.1em;
|
996 |
+
}
|
997 |
+
|
998 |
+
.col-wrap p.submit {
|
999 |
+
margin-top: -10px;
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
.edit-term-notes {
|
1003 |
+
margin-top: 2em;
|
1004 |
+
}
|
1005 |
+
|
1006 |
+
/*------------------------------------------------------------------------------
|
1007 |
+
13.0 - Tags
|
1008 |
+
------------------------------------------------------------------------------*/
|
1009 |
+
|
1010 |
+
#poststuff .tagsdiv .howto {
|
1011 |
+
margin: 0 0 6px 0;
|
1012 |
+
}
|
1013 |
+
|
1014 |
+
.ajaxtag .newtag {
|
1015 |
+
position: relative;
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
.tagsdiv .newtag {
|
1019 |
+
width: 180px;
|
1020 |
+
}
|
1021 |
+
|
1022 |
+
.tagsdiv .the-tags {
|
1023 |
+
display: block;
|
1024 |
+
height: 60px;
|
1025 |
+
margin: 0 auto;
|
1026 |
+
overflow: auto;
|
1027 |
+
width: 260px;
|
1028 |
+
}
|
1029 |
+
|
1030 |
+
#post-body-content .tagsdiv .the-tags {
|
1031 |
+
margin: 0 5px;
|
1032 |
+
}
|
1033 |
+
|
1034 |
+
p.popular-tags {
|
1035 |
+
border: none;
|
1036 |
+
line-height: 2em;
|
1037 |
+
padding: 8px 12px 12px;
|
1038 |
+
text-align: justify;
|
1039 |
+
}
|
1040 |
+
|
1041 |
+
p.popular-tags a {
|
1042 |
+
padding: 0 3px;
|
1043 |
+
}
|
1044 |
+
|
1045 |
+
.tagcloud {
|
1046 |
+
width: 97%;
|
1047 |
+
margin: 0 0 40px;
|
1048 |
+
text-align: justify;
|
1049 |
+
}
|
1050 |
+
|
1051 |
+
.tagcloud h2 {
|
1052 |
+
margin: 2px 0 12px;
|
1053 |
+
}
|
1054 |
+
|
1055 |
+
.the-tagcloud ul {
|
1056 |
+
margin: 0;
|
1057 |
+
}
|
1058 |
+
|
1059 |
+
.the-tagcloud ul li {
|
1060 |
+
display: inline-block;
|
1061 |
+
}
|
1062 |
+
|
1063 |
+
/* Suggest.js autocomplete, no more used by core. */
|
1064 |
+
.ac_results {
|
1065 |
+
display: none;
|
1066 |
+
margin: -1px 0 0;
|
1067 |
+
padding: 0;
|
1068 |
+
list-style: none;
|
1069 |
+
position: absolute;
|
1070 |
+
z-index: 10000;
|
1071 |
+
border: 1px solid #5b9dd9;
|
1072 |
+
background-color: #fff;
|
1073 |
+
}
|
1074 |
+
|
1075 |
+
.wp-customizer .ac_results {
|
1076 |
+
z-index: 500000;
|
1077 |
+
}
|
1078 |
+
|
1079 |
+
.ac_results li {
|
1080 |
+
margin: 0;
|
1081 |
+
padding: 5px 10px;
|
1082 |
+
white-space: nowrap;
|
1083 |
+
text-align: left;
|
1084 |
+
}
|
1085 |
+
|
1086 |
+
.ac_results .ac_over,
|
1087 |
+
.ac_over .ac_match {
|
1088 |
+
background-color: #0073aa;
|
1089 |
+
color: #fff;
|
1090 |
+
cursor: pointer;
|
1091 |
+
}
|
1092 |
+
|
1093 |
+
.ac_match {
|
1094 |
+
text-decoration: underline;
|
1095 |
+
}
|
1096 |
+
|
1097 |
+
#edittag {
|
1098 |
+
max-width: 800px;
|
1099 |
+
}
|
1100 |
+
|
1101 |
+
.edit-tag-actions {
|
1102 |
+
margin-top: 20px;
|
1103 |
+
overflow: hidden;
|
1104 |
+
padding: 10px;
|
1105 |
+
margin-right: 10px;
|
1106 |
+
}
|
1107 |
+
|
1108 |
+
/* Comments */
|
1109 |
+
|
1110 |
+
.comment-php .wp-editor-area {
|
1111 |
+
height: 200px;
|
1112 |
+
}
|
1113 |
+
|
1114 |
+
.comment-ays th,
|
1115 |
+
.comment-ays td {
|
1116 |
+
padding: 10px 15px;
|
1117 |
+
}
|
1118 |
+
|
1119 |
+
.comment-ays .comment-content ul {
|
1120 |
+
list-style: initial;
|
1121 |
+
margin-left: 2em;
|
1122 |
+
}
|
1123 |
+
|
1124 |
+
.comment-ays .comment-content a[href]:after {
|
1125 |
+
content: '(' attr( href ) ')';
|
1126 |
+
display: inline-block;
|
1127 |
+
padding: 0 4px;
|
1128 |
+
color: #72777C;
|
1129 |
+
font-size: 13px;
|
1130 |
+
word-break: break-all;
|
1131 |
+
}
|
1132 |
+
|
1133 |
+
.comment-ays .comment-content p.edit-comment {
|
1134 |
+
margin-top: 10px;
|
1135 |
+
}
|
1136 |
+
|
1137 |
+
.comment-ays .comment-content p.edit-comment a[href]:after {
|
1138 |
+
content: '';
|
1139 |
+
padding: 0;
|
1140 |
+
}
|
1141 |
+
|
1142 |
+
.comment-ays-submit .button-cancel {
|
1143 |
+
margin-left: 1em;
|
1144 |
+
}
|
1145 |
+
|
1146 |
+
.trash-undo-inside,
|
1147 |
+
.spam-undo-inside {
|
1148 |
+
margin: 1px 8px 1px 0;
|
1149 |
+
line-height: 16px;
|
1150 |
+
}
|
1151 |
+
|
1152 |
+
.spam-undo-inside .avatar,
|
1153 |
+
.trash-undo-inside .avatar {
|
1154 |
+
height: 20px;
|
1155 |
+
width: 20px;
|
1156 |
+
margin-right: 8px;
|
1157 |
+
vertical-align: middle;
|
1158 |
+
}
|
1159 |
+
|
1160 |
+
.stuffbox .editcomment {
|
1161 |
+
clear: none;
|
1162 |
+
}
|
1163 |
+
|
1164 |
+
#comment-status-radio p {
|
1165 |
+
margin: 3px 0 5px;
|
1166 |
+
}
|
1167 |
+
|
1168 |
+
#comment-status-radio input {
|
1169 |
+
margin: 2px 3px 5px 0;
|
1170 |
+
vertical-align: middle;
|
1171 |
+
}
|
1172 |
+
|
1173 |
+
#comment-status-radio label {
|
1174 |
+
padding: 5px 0;
|
1175 |
+
}
|
1176 |
+
|
1177 |
+
/* links tables */
|
1178 |
+
table.links-table {
|
1179 |
+
width: 100%;
|
1180 |
+
border-spacing: 0;
|
1181 |
+
}
|
1182 |
+
|
1183 |
+
.links-table th {
|
1184 |
+
font-weight: 400;
|
1185 |
+
text-align: left;
|
1186 |
+
vertical-align: top;
|
1187 |
+
min-width: 80px;
|
1188 |
+
width: 20%;
|
1189 |
+
word-wrap: break-word;
|
1190 |
+
}
|
1191 |
+
|
1192 |
+
.links-table th,
|
1193 |
+
.links-table td {
|
1194 |
+
padding: 5px 0;
|
1195 |
+
}
|
1196 |
+
|
1197 |
+
.links-table td label {
|
1198 |
+
margin-right: 8px;
|
1199 |
+
}
|
1200 |
+
|
1201 |
+
.links-table td input[type="text"],
|
1202 |
+
.links-table td textarea {
|
1203 |
+
width: 100%;
|
1204 |
+
}
|
1205 |
+
|
1206 |
+
.links-table #link_rel {
|
1207 |
+
max-width: 280px;
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
/* DFW 2
|
1211 |
+
-------------------------------------------------------------- */
|
1212 |
+
|
1213 |
+
#wp-content-wrap .mce-wp-dfw,
|
1214 |
+
#qt_content_dfw {
|
1215 |
+
display: none;
|
1216 |
+
}
|
1217 |
+
|
1218 |
+
.wp-editor-expand #wp-content-wrap .mce-wp-dfw,
|
1219 |
+
.wp-editor-expand #qt_content_dfw {
|
1220 |
+
display: inline-block;
|
1221 |
+
}
|
1222 |
+
|
1223 |
+
.focus-on .wrap > h1,
|
1224 |
+
.focus-on .page-title-action,
|
1225 |
+
.focus-on #wpfooter,
|
1226 |
+
.focus-on .postbox-container > *,
|
1227 |
+
.focus-on div.updated,
|
1228 |
+
.focus-on div.error,
|
1229 |
+
.focus-on div.notice,
|
1230 |
+
.focus-on .update-nag,
|
1231 |
+
.focus-on #wp-toolbar,
|
1232 |
+
.focus-on #screen-meta-links,
|
1233 |
+
.focus-on #screen-meta {
|
1234 |
+
opacity: 0;
|
1235 |
+
transition-duration: 0.6s;
|
1236 |
+
transition-property: opacity;
|
1237 |
+
transition-timing-function: ease-in-out;
|
1238 |
+
}
|
1239 |
+
|
1240 |
+
.focus-on #wp-toolbar {
|
1241 |
+
opacity: 0.3;
|
1242 |
+
}
|
1243 |
+
|
1244 |
+
.focus-off .wrap > h1,
|
1245 |
+
.focus-off .page-title-action,
|
1246 |
+
.focus-off #wpfooter,
|
1247 |
+
.focus-off .postbox-container > *,
|
1248 |
+
.focus-off div.updated,
|
1249 |
+
.focus-off div.error,
|
1250 |
+
.focus-off div.notice,
|
1251 |
+
.focus-off .update-nag,
|
1252 |
+
.focus-off #wp-toolbar,
|
1253 |
+
.focus-off #screen-meta-links,
|
1254 |
+
.focus-off #screen-meta {
|
1255 |
+
opacity: 1;
|
1256 |
+
transition-duration: 0.2s;
|
1257 |
+
transition-property: opacity;
|
1258 |
+
transition-timing-function: ease-in-out;
|
1259 |
+
}
|
1260 |
+
|
1261 |
+
.focus-off #wp-toolbar {
|
1262 |
+
-webkit-transform: translate(0, 0);
|
1263 |
+
}
|
1264 |
+
|
1265 |
+
.focus-on #adminmenuback,
|
1266 |
+
.focus-on #adminmenuwrap {
|
1267 |
+
transition-duration: 0.6s;
|
1268 |
+
transition-property: -webkit-transform;
|
1269 |
+
transition-property: transform;
|
1270 |
+
transition-property: transform, -webkit-transform;
|
1271 |
+
transition-timing-function: ease-in-out;
|
1272 |
+
}
|
1273 |
+
|
1274 |
+
.focus-on #adminmenuback,
|
1275 |
+
.focus-on #adminmenuwrap {
|
1276 |
+
-webkit-transform: translateX( -100% );
|
1277 |
+
transform: translateX( -100% );
|
1278 |
+
}
|
1279 |
+
|
1280 |
+
.focus-off #adminmenuback,
|
1281 |
+
.focus-off #adminmenuwrap {
|
1282 |
+
-webkit-transform: translateX( 0 );
|
1283 |
+
transform: translateX( 0 );
|
1284 |
+
transition-duration: 0.2s;
|
1285 |
+
transition-property: -webkit-transform;
|
1286 |
+
transition-property: transform;
|
1287 |
+
transition-property: transform, -webkit-transform;
|
1288 |
+
transition-timing-function: ease-in-out;
|
1289 |
+
}
|
1290 |
+
|
1291 |
+
/* =Media Queries
|
1292 |
+
-------------------------------------------------------------- */
|
1293 |
+
|
1294 |
+
/**
|
1295 |
+
* HiDPI Displays
|
1296 |
+
*/
|
1297 |
+
@media print,
|
1298 |
+
(-webkit-min-device-pixel-ratio: 1.25),
|
1299 |
+
(min-resolution: 120dpi) {
|
1300 |
+
#content-resize-handle,
|
1301 |
+
#post-body .wp_themeSkin .mceStatusbar a.mceResize {
|
1302 |
+
background: transparent url(../images/resize-2x.gif) no-repeat scroll right bottom;
|
1303 |
+
background-size: 11px 11px;
|
1304 |
+
}
|
1305 |
+
|
1306 |
+
/*rtl:ignore*/
|
1307 |
+
.rtl #content-resize-handle,
|
1308 |
+
.rtl #post-body .wp_themeSkin .mceStatusbar a.mceResize {
|
1309 |
+
background-image: url(../images/resize-rtl-2x.gif);
|
1310 |
+
background-position: left bottom;
|
1311 |
+
}
|
1312 |
+
}
|
1313 |
+
|
1314 |
+
/* one column on the post write/edit screen */
|
1315 |
+
@media only screen and (max-width: 850px) {
|
1316 |
+
#poststuff {
|
1317 |
+
min-width: 0;
|
1318 |
+
}
|
1319 |
+
|
1320 |
+
#wpbody-content #poststuff #post-body {
|
1321 |
+
margin: 0;
|
1322 |
+
}
|
1323 |
+
|
1324 |
+
#wpbody-content #post-body.columns-2 #postbox-container-1 {
|
1325 |
+
margin-right: 0;
|
1326 |
+
width: 100%;
|
1327 |
+
}
|
1328 |
+
|
1329 |
+
#poststuff #postbox-container-1 .empty-container,
|
1330 |
+
#poststuff #postbox-container-1 #side-sortables:empty {
|
1331 |
+
border: 0 none;
|
1332 |
+
height: 0;
|
1333 |
+
min-height: 0;
|
1334 |
+
}
|
1335 |
+
|
1336 |
+
#poststuff #post-body.columns-2 #side-sortables {
|
1337 |
+
min-height: 0;
|
1338 |
+
width: auto;
|
1339 |
+
}
|
1340 |
+
|
1341 |
+
/* hide the radio buttons for column prefs */
|
1342 |
+
.screen-layout,
|
1343 |
+
.columns-prefs {
|
1344 |
+
display: none;
|
1345 |
+
}
|
1346 |
+
}
|
1347 |
+
|
1348 |
+
@media screen and ( max-width: 782px ) {
|
1349 |
+
.wp-core-ui .edit-tag-actions .button-primary {
|
1350 |
+
margin-bottom: 0;
|
1351 |
+
}
|
1352 |
+
|
1353 |
+
#post-body-content {
|
1354 |
+
min-width: 0;
|
1355 |
+
}
|
1356 |
+
|
1357 |
+
#titlediv #title-prompt-text {
|
1358 |
+
padding: 10px 10px;
|
1359 |
+
}
|
1360 |
+
|
1361 |
+
#poststuff h3.hndle, /* Back-compat for pre-4.4 */
|
1362 |
+
#poststuff .stuffbox > h3, /* Back-compat for pre-4.4 */
|
1363 |
+
#poststuff h2 {
|
1364 |
+
padding: 12px;
|
1365 |
+
}
|
1366 |
+
|
1367 |
+
.post-format-options {
|
1368 |
+
padding-right: 0;
|
1369 |
+
}
|
1370 |
+
|
1371 |
+
.post-format-options a {
|
1372 |
+
margin-right: 5px;
|
1373 |
+
margin-bottom: 5px;
|
1374 |
+
min-width: 52px;
|
1375 |
+
}
|
1376 |
+
|
1377 |
+
.post-format-options .post-format-title {
|
1378 |
+
font-size: 11px;
|
1379 |
+
}
|
1380 |
+
|
1381 |
+
.post-format-options a div {
|
1382 |
+
height: 28px;
|
1383 |
+
width: 28px;
|
1384 |
+
}
|
1385 |
+
|
1386 |
+
.post-format-options a div:before {
|
1387 |
+
font-size: 26px !important;
|
1388 |
+
}
|
1389 |
+
|
1390 |
+
/* Publish Metabox Options */
|
1391 |
+
#post-visibility-select {
|
1392 |
+
line-height: 280%;
|
1393 |
+
}
|
1394 |
+
|
1395 |
+
.wp-core-ui .save-post-visibility,
|
1396 |
+
.wp-core-ui .save-timestamp {
|
1397 |
+
vertical-align: middle;
|
1398 |
+
margin-right: 15px;
|
1399 |
+
}
|
1400 |
+
|
1401 |
+
.timestamp-wrap select#mm {
|
1402 |
+
display: block;
|
1403 |
+
width: 100%;
|
1404 |
+
margin-bottom: 10px;
|
1405 |
+
}
|
1406 |
+
|
1407 |
+
.timestamp-wrap #jj,
|
1408 |
+
.timestamp-wrap #aa,
|
1409 |
+
.timestamp-wrap #hh,
|
1410 |
+
.timestamp-wrap #mn {
|
1411 |
+
padding: 12px 3px;
|
1412 |
+
font-size: 14px;
|
1413 |
+
margin-bottom: 5px;
|
1414 |
+
width: auto;
|
1415 |
+
text-align: center;
|
1416 |
+
}
|
1417 |
+
|
1418 |
+
/* Categories Metabox */
|
1419 |
+
ul.category-tabs {
|
1420 |
+
margin: 30px 0 15px;
|
1421 |
+
}
|
1422 |
+
|
1423 |
+
ul.category-tabs li.tabs {
|
1424 |
+
padding: 15px;
|
1425 |
+
}
|
1426 |
+
|
1427 |
+
ul.categorychecklist li {
|
1428 |
+
margin-bottom: 15px;
|
1429 |
+
}
|
1430 |
+
|
1431 |
+
ul.categorychecklist ul {
|
1432 |
+
margin-top: 15px;
|
1433 |
+
}
|
1434 |
+
|
1435 |
+
.category-add input[type=text],
|
1436 |
+
.category-add select {
|
1437 |
+
max-width: none;
|
1438 |
+
margin-bottom: 15px;
|
1439 |
+
}
|
1440 |
+
|
1441 |
+
/* Tags Metabox */
|
1442 |
+
.tagsdiv .newtag {
|
1443 |
+
width: 100%;
|
1444 |
+
height: auto;
|
1445 |
+
margin-bottom: 15px;
|
1446 |
+
}
|
1447 |
+
|
1448 |
+
.tagchecklist {
|
1449 |
+
margin: 25px 10px;
|
1450 |
+
}
|
1451 |
+
|
1452 |
+
.tagchecklist > li {
|
1453 |
+
font-size: 16px;
|
1454 |
+
line-height: 1.4;
|
1455 |
+
}
|
1456 |
+
|
1457 |
+
/* Discussion */
|
1458 |
+
#commentstatusdiv p {
|
1459 |
+
line-height: 2.8;
|
1460 |
+
}
|
1461 |
+
|
1462 |
+
/* TinyMCE Adjustments */
|
1463 |
+
.mceToolbar * {
|
1464 |
+
white-space: normal !important;
|
1465 |
+
}
|
1466 |
+
|
1467 |
+
.mceToolbar tr,
|
1468 |
+
.mceToolbar td {
|
1469 |
+
float: left !important;
|
1470 |
+
}
|
1471 |
+
|
1472 |
+
.wp_themeSkin a.mceButton {
|
1473 |
+
width: 30px;
|
1474 |
+
height: 30px;
|
1475 |
+
}
|
1476 |
+
|
1477 |
+
.wp_themeSkin .mceButton .mceIcon {
|
1478 |
+
margin-top: 5px;
|
1479 |
+
margin-left: 5px;
|
1480 |
+
}
|
1481 |
+
|
1482 |
+
.wp_themeSkin .mceSplitButton {
|
1483 |
+
margin-top: 1px;
|
1484 |
+
}
|
1485 |
+
|
1486 |
+
.wp_themeSkin .mceSplitButton td a.mceAction {
|
1487 |
+
padding-top: 6px;
|
1488 |
+
padding-bottom: 6px;
|
1489 |
+
padding-left: 6px;
|
1490 |
+
padding-right: 3px;
|
1491 |
+
}
|
1492 |
+
|
1493 |
+
.wp_themeSkin .mceSplitButton td a.mceOpen,
|
1494 |
+
.wp_themeSkin .mceSplitButtonEnabled:hover td a.mceOpen {
|
1495 |
+
padding-top: 6px;
|
1496 |
+
padding-bottom: 6px;
|
1497 |
+
background-position: 1px 6px;
|
1498 |
+
}
|
1499 |
+
|
1500 |
+
.wp_themeSkin table.mceListBox {
|
1501 |
+
margin: 5px;
|
1502 |
+
}
|
1503 |
+
|
1504 |
+
div.quicktags-toolbar input {
|
1505 |
+
padding: 10px 20px;
|
1506 |
+
}
|
1507 |
+
|
1508 |
+
button.wp-switch-editor {
|
1509 |
+
font-size: 16px;
|
1510 |
+
line-height: 1em;
|
1511 |
+
margin: 7px 0 0 7px;
|
1512 |
+
padding: 8px 12px;
|
1513 |
+
}
|
1514 |
+
|
1515 |
+
#wp-content-media-buttons a {
|
1516 |
+
font-size: 14px;
|
1517 |
+
padding: 6px 10px;
|
1518 |
+
}
|
1519 |
+
|
1520 |
+
.wp-media-buttons span.wp-media-buttons-icon,
|
1521 |
+
.wp-media-buttons span.jetpack-contact-form-icon {
|
1522 |
+
width: 22px !important;
|
1523 |
+
margin-left: -2px !important;
|
1524 |
+
}
|
1525 |
+
|
1526 |
+
.wp-media-buttons .add_media span.wp-media-buttons-icon:before,
|
1527 |
+
.wp-media-buttons #insert-jetpack-contact-form span.jetpack-contact-form-icon:before {
|
1528 |
+
font-size: 20px !important;
|
1529 |
+
}
|
1530 |
+
|
1531 |
+
#content_wp_fullscreen {
|
1532 |
+
display: none;
|
1533 |
+
}
|
1534 |
+
|
1535 |
+
.misc-pub-section {
|
1536 |
+
padding: 20px 10px 20px;
|
1537 |
+
}
|
1538 |
+
|
1539 |
+
.misc-pub-section > a {
|
1540 |
+
float: right;
|
1541 |
+
font-size: 16px;
|
1542 |
+
}
|
1543 |
+
|
1544 |
+
#delete-action,
|
1545 |
+
#publishing-action {
|
1546 |
+
line-height: 47px;
|
1547 |
+
}
|
1548 |
+
|
1549 |
+
#publishing-action .spinner {
|
1550 |
+
float: none;
|
1551 |
+
margin-top: -2px; /* Half of the Publish button's bottom margin. */
|
1552 |
+
}
|
1553 |
+
|
1554 |
+
/* Moderate Comment */
|
1555 |
+
.comment-ays th,
|
1556 |
+
.comment-ays td {
|
1557 |
+
padding-bottom: 0;
|
1558 |
+
}
|
1559 |
+
|
1560 |
+
.comment-ays td {
|
1561 |
+
padding-top: 6px;
|
1562 |
+
}
|
1563 |
+
|
1564 |
+
/* Links */
|
1565 |
+
.links-table #link_rel {
|
1566 |
+
max-width: none;
|
1567 |
+
}
|
1568 |
+
|
1569 |
+
.links-table th,
|
1570 |
+
.links-table td {
|
1571 |
+
padding: 10px 0;
|
1572 |
+
}
|
1573 |
+
}
|
lib/classic-editor/css/edit.min.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
/*! This file is auto-generated */
|
2 |
+
#pending,#poststuff #titlewrap{border:0;padding:0}#pending,#poststuff #post-body{padding:0}#editable-post-name-full,body.post-new-php .submitbox .submitdelete{display:none}#post-status-info,.postbox{box-shadow:0 1px 1px rgba(0,0,0,.04)}#titlediv,#wp-content-editor-container,.postbox,form#tags-filter{position:relative}#poststuff{padding-top:10px;min-width:763px}#poststuff .postbox-container{width:100%}#poststuff #post-body.columns-2{margin-right:300px}#show-comments{overflow:hidden}#save-action .spinner,#show-comments a{float:left}#show-comments .spinner{float:none;margin-top:0}#lost-connection-notice .spinner{visibility:visible;float:left;margin:0 5px 0 0}#titlediv label{cursor:text}#titlediv div.inside{margin:0}#titlediv #title{padding:3px 8px;font-size:1.7em;line-height:100%;height:1.7em;width:100%;outline:0;margin:0 0 3px;background-color:#fff}#titlediv #title-prompt-text{color:#72777c;position:absolute;font-size:1.7em;padding:11px 10px}input#link_description,input#link_url{width:98%}#pending{background:0 none;font-size:11px;margin-top:-1px}#comment-link-box,#edit-slug-box{line-height:24px;min-height:25px;margin-top:5px;padding:0 10px;color:#666}#edit-slug-box .cancel{margin-right:10px;padding:0;font-size:11px}#comment-link-box{margin:5px 0;padding:0 5px}#editable-post-name{font-weight:600}#editable-post-name input{font-size:13px;font-weight:400;height:24px;margin:0;width:16em}.postarea h3 label{float:left}.submitbox .submit a:hover{text-decoration:underline}.submitbox .submit input{margin-bottom:8px;margin-right:4px;padding:6px}#post-status-select{margin-top:3px}#post-body #normal-sortables{min-height:50px}.postbox{min-width:255px;border:1px solid #e5e5e5;background:#fff}#trackback_url{width:99%}#normal-sortables .postbox .submit{background:0 0;border:0;float:right;padding:0 12px;margin:0}.category-add input[type=text],.category-add select{width:100%;max-width:260px;vertical-align:baseline}#side-sortables .category-add input[type=text],#side-sortables .category-add select{margin:0 0 1em}#side-sortables .add-menu-item-tabs li,.wp-tab-bar li,ul.category-tabs li{display:inline;line-height:1.35em}.no-js .category-tabs li.hide-if-no-js{display:none}#side-sortables .add-menu-item-tabs a,.category-tabs a,.wp-tab-bar a{text-decoration:none}#post-body ul.add-menu-item-tabs li.tabs a,#post-body ul.category-tabs li.tabs a,#side-sortables .add-menu-item-tabs .tabs a,#side-sortables .category-tabs .tabs a,.wp-tab-bar .wp-tab-active a{color:#32373c}.category-tabs{margin:8px 0 5px}#category-adder h4{margin:0}.taxonomy-add-new{display:inline-block;margin:10px 0;font-weight:600}#side-sortables .add-menu-item-tabs,.wp-tab-bar{margin-bottom:3px}#normal-sortables .postbox #replyrow .submit{float:none;margin:0;padding:5px 7px 10px;overflow:hidden}#side-sortables .submitbox .submit .preview,#side-sortables .submitbox .submit a.preview:hover,#side-sortables .submitbox .submit input{border:0}ul.add-menu-item-tabs,ul.category-tabs,ul.wp-tab-bar{margin-top:12px}ul.add-menu-item-tabs li,ul.category-tabs li{border:1px solid transparent;position:relative}.wp-tab-active,ul.add-menu-item-tabs li.tabs,ul.category-tabs li.tabs{border:1px solid #ddd;border-bottom-color:#fdfdfd;background-color:#fdfdfd}ul.add-menu-item-tabs li,ul.category-tabs li,ul.wp-tab-bar li{padding:3px 5px 6px}#set-post-thumbnail{display:inline-block;max-width:100%}.ui-tabs-hide,.wp-editor-expand #content-resize-handle,.wp-hidden-children .wp-hidden-child{display:none}#postimagediv .inside img{max-width:100%;height:auto;width:auto;vertical-align:top;background-image:linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:0 0,10px 10px;background-size:20px 20px}#post-body .tagsdiv #newtag{margin-right:5px;width:16em}#side-sortables input#post_password{width:94%}#side-sortables .tagsdiv #newtag{width:68%}#post-status-info{width:100%;border-spacing:0;border:1px solid #e5e5e5;border-top:none;background-color:#f7f7f7;z-index:999}#post-status-info td{font-size:12px}.autosave-info{padding:2px 10px;text-align:right}#editorcontent #post-status-info{border:none}#content-resize-handle{background:url(../images/resize.gif) right bottom no-repeat;width:12px;cursor:row-resize}.rtl #content-resize-handle{background-image:url(../images/resize-rtl.gif);background-position:left bottom}#postdivrich #content{resize:none}#wp-word-count{display:block;padding:2px 10px}.wp-editor-expand #wp-content-editor-tools{z-index:1000;border-bottom:1px solid #e5e5e5}.wp-editor-expand #wp-content-editor-container{box-shadow:none;margin-top:-1px;border-bottom:0 none}.wp-editor-expand div.mce-statusbar{z-index:1}.wp-editor-expand #post-status-info{border-top:1px solid #e5e5e5}.wp-editor-expand div.mce-toolbar-grp{z-index:999}.mce-fullscreen #wp-content-wrap .mce-edit-area,.mce-fullscreen #wp-content-wrap .mce-menubar,.mce-fullscreen #wp-content-wrap .mce-statusbar,.mce-fullscreen #wp-content-wrap .mce-toolbar-grp{position:static!important;width:auto!important;padding:0!important}.mce-fullscreen #wp-content-wrap .mce-statusbar{visibility:visible!important}.mce-fullscreen #wp-content-wrap .mce-tinymce .mce-wp-dfw,.mce-fullscreen #wp-content-wrap .mce-wp-dfw,.post-php.mce-fullscreen #wpadminbar{display:none}#wp-content-editor-tools{background-color:#f1f1f1;padding-top:20px}#poststuff #post-body.columns-2 #side-sortables{width:280px}#timestampdiv select{height:21px;line-height:14px;padding:0;vertical-align:top;font-size:12px}#aa,#hh,#jj,#mn{padding:1px;font-size:12px}#hh,#jj,#mn{width:2em}#aa{width:3.4em}.curtime #timestamp{padding:2px 0 1px;display:inline!important;height:auto!important}#post-body #visibility:before,#post-body .misc-pub-post-status:before,#post-body .misc-pub-revisions:before,.curtime #timestamp:before,span.wp-media-buttons-icon:before{color:#82878c}#post-body #visibility:before,#post-body .misc-pub-post-status:before,#post-body .misc-pub-revisions:before,.curtime #timestamp:before{font:400 20px/1 dashicons;speak:none;display:inline-block;margin-left:-1px;padding-right:3px;vertical-align:top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#post-body .misc-pub-post-status:before{content:"\f173"}#post-body #visibility:before{content:"\f177"}.curtime #timestamp:before{content:"\f145";position:relative;top:-1px}#post-body .misc-pub-revisions:before{content:"\f321"}#timestampdiv{padding-top:5px;line-height:23px}#timestampdiv p{margin:8px 0 6px}#timestampdiv input{border-width:1px;border-style:solid}.notification-dialog{position:fixed;top:30%;max-height:70%;left:50%;width:450px;margin-left:-225px;background:#fff;box-shadow:0 3px 6px rgba(0,0,0,.3);line-height:1.5;z-index:1000005;overflow-y:auto}.notification-dialog-background{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:1000000}#post-lock-dialog .post-locked-message,#post-lock-dialog .post-taken-over{margin:25px}#file-editor-warning .button,#post-lock-dialog .post-locked-message a.button{margin-right:10px}#post-lock-dialog .post-locked-avatar{float:left;margin:0 20px 20px 0}#post-lock-dialog .wp-tab-first{outline:0}#post-lock-dialog .locked-saving img{float:left;margin-right:3px}#post-lock-dialog.saved .locked-saved,#post-lock-dialog.saving .locked-saving{display:inline}#excerpt{display:block;margin:12px 0 0;height:4em;width:100%}.tagchecklist{margin-left:14px;font-size:12px;overflow:auto}.tagchecklist br{display:none}.tagchecklist strong{margin-left:-8px;position:absolute}.tagchecklist>li{float:left;margin-right:25px;font-size:13px;line-height:1.8em;cursor:default;max-width:100%;overflow:hidden;text-overflow:ellipsis}.tagchecklist .ntdelbutton{position:absolute;width:24px;height:24px;border:none;margin:0 0 0 -19px;padding:0;background:0 0;cursor:pointer;text-indent:0}#poststuff .stuffbox>h3,#poststuff h2,#poststuff h3.hndle{font-size:14px;padding:8px 12px;margin:0;line-height:1.4}#poststuff .inside{margin:6px 0 0}#poststuff .inside #page_template,#poststuff .inside #parent_id{max-width:100%}.ie8 #poststuff .inside #page_template,.ie8 #poststuff .inside #parent_id{width:250px}.post-attributes-label-wrapper{margin-bottom:.5em}.post-attributes-label{vertical-align:baseline;font-weight:600}#post-visibility-select{line-height:1.5em;margin-top:3px}#linksubmitdiv .inside,#poststuff #submitdiv .inside{margin:0;padding:0}#post-body-content,.edit-form-section{margin-bottom:20px}#postcustomstuff thead th{padding:5px 8px 8px;background-color:#f1f1f1}#postcustom #postcustomstuff .submit{border:0;float:none;padding:0 8px 8px}#side-sortables #postcustom #postcustomstuff .submit{margin:0;padding:0}#side-sortables #postcustom #postcustomstuff #the-list textarea{height:85px}#side-sortables #postcustom #postcustomstuff td.left input,#side-sortables #postcustom #postcustomstuff td.left select,#side-sortables #postcustomstuff #newmetaleft a{margin:3px 3px 0}#postcustomstuff table{margin:0;width:100%;border:1px solid #ddd;border-spacing:0;background-color:#f9f9f9}#postcustomstuff tr{vertical-align:top}#postcustomstuff table input,#postcustomstuff table select,#postcustomstuff table textarea{width:96%;margin:8px}#side-sortables #postcustomstuff table input,#side-sortables #postcustomstuff table select,#side-sortables #postcustomstuff table textarea{margin:3px}#postcustomstuff td.left,#postcustomstuff th.left{width:38%}#postcustomstuff .submit input{margin:0;width:auto}#postcustomstuff #newmetaleft a{display:inline-block;margin:0 8px 8px;text-decoration:none}.no-js #postcustomstuff #enternew{display:none}#post-body-content .compat-attachment-fields{margin-bottom:20px}.compat-attachment-fields th{padding-top:5px;padding-right:10px}#select-featured-image{padding:4px 0;overflow:hidden}#select-featured-image img{max-width:100%;height:auto;margin-bottom:10px}#select-featured-image a{float:left;clear:both}#select-featured-image .remove{display:none;margin-top:10px}.js #select-featured-image.has-featured-image .remove{display:inline-block}.no-js #select-featured-image .choose{display:none}.post-state-format{overflow:hidden;display:inline-block;vertical-align:middle;height:20px;width:20px;margin-right:5px;margin-top:-4px}.post-state-format:before{display:block;height:20px;width:20px;font:400 20px/1 dashicons!important;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.post-format-icon:before,.post-state-format:before{color:#ddd;transition:all .1s ease-in-out}a.post-format-icon:hover:before,a.post-state-format:hover:before{color:#00a0d2}#post-formats-select{line-height:2em}#post-formats-select .post-format-icon:before{top:5px}input.post-format{margin-top:1px}label.post-format-icon{margin-left:0;padding:2px 0}.post-format-icon:before{position:relative;display:inline-block;margin-right:7px;font:400 20px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.post-format-icon.post-format-standard:before,.post-state-format.post-format-standard:before,a.post-state-format.format-standard:before{content:"\f109"}.post-format-icon.post-format-image:before,.post-state-format.post-format-image:before,a.post-state-format.format-image:before{content:"\f128"}.post-format-icon.post-format-gallery:before,.post-state-format.post-format-gallery:before,a.post-state-format.format-gallery:before{content:"\f161"}.post-format-icon.post-format-audio:before,.post-state-format.post-format-audio:before,a.post-state-format.format-audio:before{content:"\f127"}.post-format-icon.post-format-video:before,.post-state-format.post-format-video:before,a.post-state-format.format-video:before{content:"\f126"}.post-format-icon.post-format-chat:before,.post-state-format.post-format-chat:before,a.post-state-format.format-chat:before{content:"\f125"}.post-format-icon.post-format-status:before,.post-state-format.post-format-status:before,a.post-state-format.format-status:before{content:"\f130"}.post-format-icon.post-format-aside:before,.post-state-format.post-format-aside:before,a.post-state-format.format-aside:before{content:"\f123"}.post-format-icon.post-format-quote:before,.post-state-format.post-format-quote:before,a.post-state-format.format-quote:before{content:"\f122"}.post-format-icon.post-format-link:before,.post-state-format.post-format-link:before,a.post-state-format.format-link:before{content:"\f103"}.category-adder{margin-left:120px;padding:4px 0}.category-adder h4{margin:0 0 8px}#side-sortables .category-adder{margin:0}.categorydiv div.tabs-panel,.customlinkdiv div.tabs-panel,.posttypediv div.tabs-panel,.taxonomydiv div.tabs-panel,.wp-tab-panel{min-height:42px;max-height:200px;overflow:auto;padding:0 .9em;border:1px solid #ddd;background-color:#fdfdfd}div.tabs-panel-active{display:block}div.tabs-panel-inactive{display:none}#front-page-warning,#front-static-pages ul,.categorydiv ul.categorychecklist ul,.customlinkdiv ul.categorychecklist ul,.inline-editor ul.cat-checklist ul,.posttypediv ul.categorychecklist ul,.taxonomydiv ul.categorychecklist ul,ul.export-filters{margin-left:18px}ul.categorychecklist li{margin:0;padding:0;line-height:22px;word-wrap:break-word}.categorydiv .tabs-panel,.customlinkdiv .tabs-panel,.posttypediv .tabs-panel,.taxonomydiv .tabs-panel{border-width:3px;border-style:solid}.form-wrap label{display:block;padding:2px 0}.form-field input[type=text],.form-field input[type=password],.form-field input[type=email],.form-field input[type=number],.form-field input[type=search],.form-field input[type=tel],.form-field input[type=url],.form-field textarea{border-style:solid;border-width:1px;width:95%}.form-wrap p,p.description{margin:2px 0 5px;color:#666}.form-wrap p,p.description,p.help,span.description{font-size:13px;font-style:italic}.form-wrap .form-field{margin:1em 0;padding:0}.form-wrap .form-field #parent{max-width:100%}.col-wrap h2{margin:12px 0;font-size:1.1em}.col-wrap p.submit{margin-top:-10px}.edit-term-notes{margin-top:2em}#poststuff .tagsdiv .howto{margin:0 0 6px}.ajaxtag .newtag{position:relative}.tagsdiv .newtag{width:180px}.tagsdiv .the-tags{display:block;height:60px;margin:0 auto;overflow:auto;width:260px}#post-body-content .tagsdiv .the-tags{margin:0 5px}p.popular-tags{border:none;line-height:2em;padding:8px 12px 12px;text-align:justify}p.popular-tags a{padding:0 3px}.tagcloud{width:97%;margin:0 0 40px;text-align:justify}.tagcloud h2{margin:2px 0 12px}.the-tagcloud ul{margin:0}.the-tagcloud ul li{display:inline-block}.ac_results{display:none;margin:-1px 0 0;padding:0;list-style:none;position:absolute;z-index:10000;border:1px solid #5b9dd9;background-color:#fff}.wp-customizer .ac_results{z-index:500000}.ac_results li{margin:0;padding:5px 10px;white-space:nowrap;text-align:left}.ac_over .ac_match,.ac_results .ac_over{background-color:#0073aa;color:#fff;cursor:pointer}.ac_match{text-decoration:underline}#edittag{max-width:800px}.edit-tag-actions{margin-top:20px;overflow:hidden;padding:10px;margin-right:10px}.comment-php .wp-editor-area{height:200px}.comment-ays td,.comment-ays th{padding:10px 15px}.comment-ays .comment-content ul{list-style:outside;margin-left:2em}.comment-ays .comment-content a[href]:after{content:'(' attr(href) ')';display:inline-block;padding:0 4px;color:#72777C;font-size:13px;word-break:break-all}.comment-ays .comment-content p.edit-comment{margin-top:10px}.comment-ays .comment-content p.edit-comment a[href]:after{content:'';padding:0}#comment-status-radio label,.links-table td,.links-table th{padding:5px 0}.comment-ays-submit .button-cancel{margin-left:1em}.spam-undo-inside,.trash-undo-inside{margin:1px 8px 1px 0;line-height:16px}.spam-undo-inside .avatar,.trash-undo-inside .avatar{height:20px;width:20px;margin-right:8px;vertical-align:middle}.stuffbox .editcomment{clear:none}#comment-status-radio p{margin:3px 0 5px}#comment-status-radio input{margin:2px 3px 5px 0;vertical-align:middle}table.links-table{width:100%;border-spacing:0}.links-table th{font-weight:400;text-align:left;vertical-align:top;min-width:80px;width:20%;word-wrap:break-word}.links-table td label{margin-right:8px}.links-table td input[type=text],.links-table td textarea{width:100%}.links-table #link_rel{max-width:280px}#qt_content_dfw,#wp-content-wrap .mce-wp-dfw{display:none}.wp-editor-expand #qt_content_dfw,.wp-editor-expand #wp-content-wrap .mce-wp-dfw{display:inline-block}.focus-on #screen-meta,.focus-on #screen-meta-links,.focus-on #wp-toolbar,.focus-on #wpfooter,.focus-on .page-title-action,.focus-on .postbox-container>*,.focus-on .update-nag,.focus-on .wrap>h1,.focus-on div.error,.focus-on div.notice,.focus-on div.updated{opacity:0;transition-duration:.6s;transition-property:opacity;transition-timing-function:ease-in-out}.focus-on #wp-toolbar{opacity:.3}.focus-off #screen-meta,.focus-off #screen-meta-links,.focus-off #wp-toolbar,.focus-off #wpfooter,.focus-off .page-title-action,.focus-off .postbox-container>*,.focus-off .update-nag,.focus-off .wrap>h1,.focus-off div.error,.focus-off div.notice,.focus-off div.updated{opacity:1;transition-duration:.2s;transition-property:opacity;transition-timing-function:ease-in-out}.focus-off #wp-toolbar{-webkit-transform:translate(0,0)}.focus-on #adminmenuback,.focus-on #adminmenuwrap{transition-duration:.6s;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;transition-timing-function:ease-in-out;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.focus-off #adminmenuback,.focus-off #adminmenuwrap{-webkit-transform:translateX(0);transform:translateX(0);transition-duration:.2s;transition-property:-webkit-transform;transition-property:transform;transition-property:transform,-webkit-transform;transition-timing-function:ease-in-out}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){#content-resize-handle,#post-body .wp_themeSkin .mceStatusbar a.mceResize{background:url(../images/resize-2x.gif) right bottom no-repeat;background-size:11px 11px}.rtl #content-resize-handle,.rtl #post-body .wp_themeSkin .mceStatusbar a.mceResize{background-image:url(../images/resize-rtl-2x.gif);background-position:left bottom}}@media only screen and (max-width:850px){#poststuff{min-width:0}#wpbody-content #poststuff #post-body{margin:0}#wpbody-content #post-body.columns-2 #postbox-container-1{margin-right:0;width:100%}#poststuff #postbox-container-1 #side-sortables:empty,#poststuff #postbox-container-1 .empty-container{border:0;height:0;min-height:0}#poststuff #post-body.columns-2 #side-sortables{min-height:0;width:auto}.columns-prefs,.screen-layout{display:none}}@media screen and (max-width:782px){.wp-core-ui .edit-tag-actions .button-primary{margin-bottom:0}#post-body-content{min-width:0}#titlediv #title-prompt-text{padding:10px}#poststuff .stuffbox>h3,#poststuff h2,#poststuff h3.hndle{padding:12px}.post-format-options{padding-right:0}.post-format-options a{margin-right:5px;margin-bottom:5px;min-width:52px}.post-format-options .post-format-title{font-size:11px}.post-format-options a div{height:28px;width:28px}.post-format-options a div:before{font-size:26px!important}#post-visibility-select{line-height:280%}.wp-core-ui .save-post-visibility,.wp-core-ui .save-timestamp{vertical-align:middle;margin-right:15px}.timestamp-wrap select#mm{display:block;width:100%;margin-bottom:10px}.timestamp-wrap #aa,.timestamp-wrap #hh,.timestamp-wrap #jj,.timestamp-wrap #mn{padding:12px 3px;font-size:14px;margin-bottom:5px;width:auto;text-align:center}ul.category-tabs{margin:30px 0 15px}.tagsdiv .newtag,ul.categorychecklist li{margin-bottom:15px}ul.category-tabs li.tabs{padding:15px}ul.categorychecklist ul{margin-top:15px}.category-add input[type=text],.category-add select{max-width:none;margin-bottom:15px}.tagsdiv .newtag{width:100%;height:auto}.tagchecklist{margin:25px 10px}.tagchecklist>li{font-size:16px;line-height:1.4}#commentstatusdiv p{line-height:2.8}.mceToolbar *{white-space:normal!important}.mceToolbar td,.mceToolbar tr{float:left!important}.wp_themeSkin a.mceButton{width:30px;height:30px}.wp_themeSkin .mceButton .mceIcon{margin-top:5px;margin-left:5px}.wp_themeSkin .mceSplitButton{margin-top:1px}.wp_themeSkin .mceSplitButton td a.mceAction{padding:6px 3px 6px 6px}.wp_themeSkin .mceSplitButton td a.mceOpen,.wp_themeSkin .mceSplitButtonEnabled:hover td a.mceOpen{padding-top:6px;padding-bottom:6px;background-position:1px 6px}.wp_themeSkin table.mceListBox{margin:5px}div.quicktags-toolbar input{padding:10px 20px}button.wp-switch-editor{font-size:16px;line-height:1em;margin:7px 0 0 7px;padding:8px 12px}#wp-content-media-buttons a{font-size:14px;padding:6px 10px}.wp-media-buttons span.jetpack-contact-form-icon,.wp-media-buttons span.wp-media-buttons-icon{width:22px!important;margin-left:-2px!important}.wp-media-buttons #insert-jetpack-contact-form span.jetpack-contact-form-icon:before,.wp-media-buttons .add_media span.wp-media-buttons-icon:before{font-size:20px!important}#content_wp_fullscreen{display:none}.misc-pub-section{padding:20px 10px}.misc-pub-section>a{float:right;font-size:16px}#delete-action,#publishing-action{line-height:47px}#publishing-action .spinner{float:none;margin-top:-2px}.comment-ays td,.comment-ays th{padding-bottom:0}.comment-ays td{padding-top:6px}.links-table #link_rel{max-width:none}.links-table td,.links-table th{padding:10px 0}}
|
lib/classic-editor/js/autosave.js
ADDED
@@ -0,0 +1,857 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global tinymce, wpCookies, autosaveL10n, switchEditors */
|
2 |
+
// Back-compat
|
3 |
+
window.autosave = function() {
|
4 |
+
return true;
|
5 |
+
};
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @summary Adds autosave to the window object on dom ready.
|
9 |
+
*
|
10 |
+
* @since 3.9.0
|
11 |
+
*
|
12 |
+
* @param {jQuery} $ jQuery object.
|
13 |
+
* @param {window} The window object.
|
14 |
+
*
|
15 |
+
*/
|
16 |
+
( function( $, window ) {
|
17 |
+
/**
|
18 |
+
* @summary Auto saves the post.
|
19 |
+
*
|
20 |
+
* @since 3.9.0
|
21 |
+
*
|
22 |
+
* @returns {Object}
|
23 |
+
* {{
|
24 |
+
* getPostData: getPostData,
|
25 |
+
* getCompareString: getCompareString,
|
26 |
+
* disableButtons: disableButtons,
|
27 |
+
* enableButtons: enableButtons,
|
28 |
+
* local: ({hasStorage, getSavedPostData, save, suspend, resume}|*),
|
29 |
+
* server: ({tempBlockSave, triggerSave, postChanged, suspend, resume}|*)}
|
30 |
+
* }
|
31 |
+
* The object with all functions for autosave.
|
32 |
+
*/
|
33 |
+
function autosave() {
|
34 |
+
var initialCompareString,
|
35 |
+
lastTriggerSave = 0,
|
36 |
+
$document = $(document);
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @summary Returns the data saved in both local and remote autosave.
|
40 |
+
*
|
41 |
+
* @since 3.9.0
|
42 |
+
*
|
43 |
+
* @param {string} type The type of autosave either local or remote.
|
44 |
+
*
|
45 |
+
* @returns {Object} Object containing the post data.
|
46 |
+
*/
|
47 |
+
function getPostData( type ) {
|
48 |
+
var post_name, parent_id, data,
|
49 |
+
time = ( new Date() ).getTime(),
|
50 |
+
cats = [],
|
51 |
+
editor = getEditor();
|
52 |
+
|
53 |
+
// Don't run editor.save() more often than every 3 seconds.
|
54 |
+
// It is resource intensive and might slow down typing in long posts on slow devices.
|
55 |
+
if ( editor && editor.isDirty() && ! editor.isHidden() && time - 3000 > lastTriggerSave ) {
|
56 |
+
editor.save();
|
57 |
+
lastTriggerSave = time;
|
58 |
+
}
|
59 |
+
|
60 |
+
data = {
|
61 |
+
post_id: $( '#post_ID' ).val() || 0,
|
62 |
+
post_type: $( '#post_type' ).val() || '',
|
63 |
+
post_author: $( '#post_author' ).val() || '',
|
64 |
+
post_title: $( '#title' ).val() || '',
|
65 |
+
content: $( '#content' ).val() || '',
|
66 |
+
excerpt: $( '#excerpt' ).val() || ''
|
67 |
+
};
|
68 |
+
|
69 |
+
if ( type === 'local' ) {
|
70 |
+
return data;
|
71 |
+
}
|
72 |
+
|
73 |
+
$( 'input[id^="in-category-"]:checked' ).each( function() {
|
74 |
+
cats.push( this.value );
|
75 |
+
});
|
76 |
+
data.catslist = cats.join(',');
|
77 |
+
|
78 |
+
if ( post_name = $( '#post_name' ).val() ) {
|
79 |
+
data.post_name = post_name;
|
80 |
+
}
|
81 |
+
|
82 |
+
if ( parent_id = $( '#parent_id' ).val() ) {
|
83 |
+
data.parent_id = parent_id;
|
84 |
+
}
|
85 |
+
|
86 |
+
if ( $( '#comment_status' ).prop( 'checked' ) ) {
|
87 |
+
data.comment_status = 'open';
|
88 |
+
}
|
89 |
+
|
90 |
+
if ( $( '#ping_status' ).prop( 'checked' ) ) {
|
91 |
+
data.ping_status = 'open';
|
92 |
+
}
|
93 |
+
|
94 |
+
if ( $( '#auto_draft' ).val() === '1' ) {
|
95 |
+
data.auto_draft = '1';
|
96 |
+
}
|
97 |
+
|
98 |
+
return data;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* @summary Concatenates the title, content and excerpt.
|
103 |
+
*
|
104 |
+
* This is used to track changes when auto-saving.
|
105 |
+
*
|
106 |
+
* @since 3.9.0
|
107 |
+
*
|
108 |
+
* @param {Object} postData The object containing the post data.
|
109 |
+
*
|
110 |
+
* @returns {string} A concatenated string with title, content and excerpt.
|
111 |
+
*/
|
112 |
+
function getCompareString( postData ) {
|
113 |
+
if ( typeof postData === 'object' ) {
|
114 |
+
return ( postData.post_title || '' ) + '::' + ( postData.content || '' ) + '::' + ( postData.excerpt || '' );
|
115 |
+
}
|
116 |
+
|
117 |
+
return ( $('#title').val() || '' ) + '::' + ( $('#content').val() || '' ) + '::' + ( $('#excerpt').val() || '' );
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* @summary Disables save buttons.
|
122 |
+
*
|
123 |
+
* @since 3.9.0
|
124 |
+
*
|
125 |
+
* @returns {void}
|
126 |
+
*/
|
127 |
+
function disableButtons() {
|
128 |
+
$document.trigger('autosave-disable-buttons');
|
129 |
+
|
130 |
+
// Re-enable 5 sec later. Just gives autosave a head start to avoid collisions.
|
131 |
+
setTimeout( enableButtons, 5000 );
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* @summary Enables save buttons.
|
136 |
+
*
|
137 |
+
* @since 3.9.0
|
138 |
+
*
|
139 |
+
* @returns {void}
|
140 |
+
*/
|
141 |
+
function enableButtons() {
|
142 |
+
$document.trigger( 'autosave-enable-buttons' );
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* @summary Gets the content editor.
|
147 |
+
*
|
148 |
+
* @since 4.6.0
|
149 |
+
*
|
150 |
+
* @returns {boolean|*} Returns either false if the editor is undefined,
|
151 |
+
* or the instance of the content editor.
|
152 |
+
*/
|
153 |
+
function getEditor() {
|
154 |
+
return typeof tinymce !== 'undefined' && tinymce.get('content');
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* @summary Autosave in localStorage.
|
159 |
+
*
|
160 |
+
* @since 3.9.0
|
161 |
+
*
|
162 |
+
* @returns {
|
163 |
+
* {
|
164 |
+
* hasStorage: *,
|
165 |
+
* getSavedPostData: getSavedPostData,
|
166 |
+
* save: save,
|
167 |
+
* suspend: suspend,
|
168 |
+
* resume: resume
|
169 |
+
* }
|
170 |
+
* }
|
171 |
+
* The object with all functions for local storage autosave.
|
172 |
+
*/
|
173 |
+
function autosaveLocal() {
|
174 |
+
var blog_id, post_id, hasStorage, intervalTimer,
|
175 |
+
lastCompareString,
|
176 |
+
isSuspended = false;
|
177 |
+
|
178 |
+
/**
|
179 |
+
* @summary Checks if the browser supports sessionStorage and it's not disabled.
|
180 |
+
*
|
181 |
+
* @since 3.9.0
|
182 |
+
*
|
183 |
+
* @returns {boolean} True if the sessionStorage is supported and enabled.
|
184 |
+
*/
|
185 |
+
function checkStorage() {
|
186 |
+
var test = Math.random().toString(),
|
187 |
+
result = false;
|
188 |
+
|
189 |
+
try {
|
190 |
+
window.sessionStorage.setItem( 'wp-test', test );
|
191 |
+
result = window.sessionStorage.getItem( 'wp-test' ) === test;
|
192 |
+
window.sessionStorage.removeItem( 'wp-test' );
|
193 |
+
} catch(e) {}
|
194 |
+
|
195 |
+
hasStorage = result;
|
196 |
+
return result;
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* @summary Initializes the local storage.
|
201 |
+
*
|
202 |
+
* @since 3.9.0
|
203 |
+
*
|
204 |
+
* @returns {boolean|Object} False if no sessionStorage in the browser or an Object
|
205 |
+
* containing all postData for this blog.
|
206 |
+
*/
|
207 |
+
function getStorage() {
|
208 |
+
var stored_obj = false;
|
209 |
+
// Separate local storage containers for each blog_id
|
210 |
+
if ( hasStorage && blog_id ) {
|
211 |
+
stored_obj = sessionStorage.getItem( 'wp-autosave-' + blog_id );
|
212 |
+
|
213 |
+
if ( stored_obj ) {
|
214 |
+
stored_obj = JSON.parse( stored_obj );
|
215 |
+
} else {
|
216 |
+
stored_obj = {};
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
return stored_obj;
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* @summary Sets the storage for this blog.
|
225 |
+
*
|
226 |
+
* Confirms that the data was saved successfully.
|
227 |
+
*
|
228 |
+
* @since 3.9.0
|
229 |
+
*
|
230 |
+
* @returns {boolean} True if the data was saved successfully, false if it wasn't saved.
|
231 |
+
*/
|
232 |
+
function setStorage( stored_obj ) {
|
233 |
+
var key;
|
234 |
+
|
235 |
+
if ( hasStorage && blog_id ) {
|
236 |
+
key = 'wp-autosave-' + blog_id;
|
237 |
+
sessionStorage.setItem( key, JSON.stringify( stored_obj ) );
|
238 |
+
return sessionStorage.getItem( key ) !== null;
|
239 |
+
}
|
240 |
+
|
241 |
+
return false;
|
242 |
+
}
|
243 |
+
|
244 |
+
/**
|
245 |
+
* @summary Gets the saved post data for the current post.
|
246 |
+
*
|
247 |
+
* @since 3.9.0
|
248 |
+
*
|
249 |
+
* @returns {boolean|Object} False if no storage or no data or the postData as an Object.
|
250 |
+
*/
|
251 |
+
function getSavedPostData() {
|
252 |
+
var stored = getStorage();
|
253 |
+
|
254 |
+
if ( ! stored || ! post_id ) {
|
255 |
+
return false;
|
256 |
+
}
|
257 |
+
|
258 |
+
return stored[ 'post_' + post_id ] || false;
|
259 |
+
}
|
260 |
+
|
261 |
+
/**
|
262 |
+
* @summary Sets (save or delete) post data in the storage.
|
263 |
+
*
|
264 |
+
* If stored_data evaluates to 'false' the storage key for the current post will be removed.
|
265 |
+
*
|
266 |
+
* @since 3.9.0
|
267 |
+
*
|
268 |
+
* @param {Object|boolean|null} stored_data The post data to store or null/false/empty to delete the key.
|
269 |
+
*
|
270 |
+
* @returns {boolean} True if data is stored, false if data was removed.
|
271 |
+
*/
|
272 |
+
function setData( stored_data ) {
|
273 |
+
var stored = getStorage();
|
274 |
+
|
275 |
+
if ( ! stored || ! post_id ) {
|
276 |
+
return false;
|
277 |
+
}
|
278 |
+
|
279 |
+
if ( stored_data ) {
|
280 |
+
stored[ 'post_' + post_id ] = stored_data;
|
281 |
+
} else if ( stored.hasOwnProperty( 'post_' + post_id ) ) {
|
282 |
+
delete stored[ 'post_' + post_id ];
|
283 |
+
} else {
|
284 |
+
return false;
|
285 |
+
}
|
286 |
+
|
287 |
+
return setStorage( stored );
|
288 |
+
}
|
289 |
+
|
290 |
+
/**
|
291 |
+
* @summary Sets isSuspended to true.
|
292 |
+
*
|
293 |
+
* @since 3.9.0
|
294 |
+
*
|
295 |
+
* @returns {void}
|
296 |
+
*/
|
297 |
+
function suspend() {
|
298 |
+
isSuspended = true;
|
299 |
+
}
|
300 |
+
|
301 |
+
/**
|
302 |
+
* @summary Sets isSuspended to false.
|
303 |
+
*
|
304 |
+
* @since 3.9.0
|
305 |
+
*
|
306 |
+
* @returns {void}
|
307 |
+
*/
|
308 |
+
function resume() {
|
309 |
+
isSuspended = false;
|
310 |
+
}
|
311 |
+
|
312 |
+
/**
|
313 |
+
* @summary Saves post data for the current post.
|
314 |
+
*
|
315 |
+
* Runs on a 15 sec. interval, saves when there are differences in the post title or content.
|
316 |
+
* When the optional data is provided, updates the last saved post data.
|
317 |
+
*
|
318 |
+
* @since 3.9.0
|
319 |
+
*
|
320 |
+
* @param {Object} data The post data for saving, minimum 'post_title' and 'content'.
|
321 |
+
*
|
322 |
+
* @returns {boolean} Returns true when data has been saved, otherwise it returns false.
|
323 |
+
*/
|
324 |
+
function save( data ) {
|
325 |
+
var postData, compareString,
|
326 |
+
result = false;
|
327 |
+
|
328 |
+
if ( isSuspended || ! hasStorage ) {
|
329 |
+
return false;
|
330 |
+
}
|
331 |
+
|
332 |
+
if ( data ) {
|
333 |
+
postData = getSavedPostData() || {};
|
334 |
+
$.extend( postData, data );
|
335 |
+
} else {
|
336 |
+
postData = getPostData('local');
|
337 |
+
}
|
338 |
+
|
339 |
+
compareString = getCompareString( postData );
|
340 |
+
|
341 |
+
if ( typeof lastCompareString === 'undefined' ) {
|
342 |
+
lastCompareString = initialCompareString;
|
343 |
+
}
|
344 |
+
|
345 |
+
// If the content, title and excerpt did not change since the last save, don't save again.
|
346 |
+
if ( compareString === lastCompareString ) {
|
347 |
+
return false;
|
348 |
+
}
|
349 |
+
|
350 |
+
postData.save_time = ( new Date() ).getTime();
|
351 |
+
postData.status = $( '#post_status' ).val() || '';
|
352 |
+
result = setData( postData );
|
353 |
+
|
354 |
+
if ( result ) {
|
355 |
+
lastCompareString = compareString;
|
356 |
+
}
|
357 |
+
|
358 |
+
return result;
|
359 |
+
}
|
360 |
+
|
361 |
+
/**
|
362 |
+
* @summary Initializes the auto save function.
|
363 |
+
*
|
364 |
+
* Checks whether the editor is active or not to use the editor events
|
365 |
+
* to autosave, or uses the values from the elements to autosave.
|
366 |
+
*
|
367 |
+
* Runs on DOM ready.
|
368 |
+
*
|
369 |
+
* @since 3.9.0
|
370 |
+
*
|
371 |
+
* @returns {void}
|
372 |
+
*/
|
373 |
+
function run() {
|
374 |
+
post_id = $('#post_ID').val() || 0;
|
375 |
+
|
376 |
+
// Check if the local post data is different than the loaded post data.
|
377 |
+
if ( $( '#wp-content-wrap' ).hasClass( 'tmce-active' ) ) {
|
378 |
+
|
379 |
+
// If TinyMCE loads first, check the post 1.5 sec. after it is ready.
|
380 |
+
// By this time the content has been loaded in the editor and 'saved' to the textarea.
|
381 |
+
// This prevents false positives.
|
382 |
+
$document.on( 'tinymce-editor-init.autosave', function() {
|
383 |
+
window.setTimeout( function() {
|
384 |
+
checkPost();
|
385 |
+
}, 1500 );
|
386 |
+
});
|
387 |
+
} else {
|
388 |
+
checkPost();
|
389 |
+
}
|
390 |
+
|
391 |
+
// Save every 15 sec.
|
392 |
+
intervalTimer = window.setInterval( save, 15000 );
|
393 |
+
|
394 |
+
$( 'form#post' ).on( 'submit.autosave-local', function() {
|
395 |
+
var editor = getEditor(),
|
396 |
+
post_id = $('#post_ID').val() || 0;
|
397 |
+
|
398 |
+
if ( editor && ! editor.isHidden() ) {
|
399 |
+
|
400 |
+
// Last onSubmit event in the editor, needs to run after the content has been moved to the textarea.
|
401 |
+
editor.on( 'submit', function() {
|
402 |
+
save({
|
403 |
+
post_title: $( '#title' ).val() || '',
|
404 |
+
content: $( '#content' ).val() || '',
|
405 |
+
excerpt: $( '#excerpt' ).val() || ''
|
406 |
+
});
|
407 |
+
});
|
408 |
+
} else {
|
409 |
+
save({
|
410 |
+
post_title: $( '#title' ).val() || '',
|
411 |
+
content: $( '#content' ).val() || '',
|
412 |
+
excerpt: $( '#excerpt' ).val() || ''
|
413 |
+
});
|
414 |
+
}
|
415 |
+
|
416 |
+
var secure = ( 'https:' === window.location.protocol );
|
417 |
+
wpCookies.set( 'wp-saving-post', post_id + '-check', 24 * 60 * 60, false, false, secure );
|
418 |
+
});
|
419 |
+
}
|
420 |
+
|
421 |
+
/**
|
422 |
+
* @summary Compares 2 strings.
|
423 |
+
*
|
424 |
+
* Removes whitespaces in the strings before comparing them.
|
425 |
+
*
|
426 |
+
* @since 3.9.0
|
427 |
+
*
|
428 |
+
* @param {string} str1 The first string.
|
429 |
+
* @param {string} str2 The second string.
|
430 |
+
* @returns {boolean} True if the strings are the same.
|
431 |
+
*/
|
432 |
+
function compare( str1, str2 ) {
|
433 |
+
function removeSpaces( string ) {
|
434 |
+
return string.toString().replace(/[\x20\t\r\n\f]+/g, '');
|
435 |
+
}
|
436 |
+
|
437 |
+
return ( removeSpaces( str1 || '' ) === removeSpaces( str2 || '' ) );
|
438 |
+
}
|
439 |
+
|
440 |
+
/**
|
441 |
+
* @summary Checks if the saved data for the current post (if any) is different
|
442 |
+
* than the loaded post data on the screen.
|
443 |
+
*
|
444 |
+
* Shows a standard message letting the user restore the post data if different.
|
445 |
+
*
|
446 |
+
* @since 3.9.0
|
447 |
+
*
|
448 |
+
* @returns {void}
|
449 |
+
*/
|
450 |
+
function checkPost() {
|
451 |
+
var content, post_title, excerpt, $notice,
|
452 |
+
postData = getSavedPostData(),
|
453 |
+
cookie = wpCookies.get( 'wp-saving-post' ),
|
454 |
+
$newerAutosaveNotice = $( '#has-newer-autosave' ).parent( '.notice' ),
|
455 |
+
$headerEnd = $( '.wp-header-end' );
|
456 |
+
|
457 |
+
if ( cookie === post_id + '-saved' ) {
|
458 |
+
wpCookies.remove( 'wp-saving-post' );
|
459 |
+
// The post was saved properly, remove old data and bail
|
460 |
+
setData( false );
|
461 |
+
return;
|
462 |
+
}
|
463 |
+
|
464 |
+
if ( ! postData ) {
|
465 |
+
return;
|
466 |
+
}
|
467 |
+
|
468 |
+
content = $( '#content' ).val() || '';
|
469 |
+
post_title = $( '#title' ).val() || '';
|
470 |
+
excerpt = $( '#excerpt' ).val() || '';
|
471 |
+
|
472 |
+
if ( compare( content, postData.content ) && compare( post_title, postData.post_title ) &&
|
473 |
+
compare( excerpt, postData.excerpt ) ) {
|
474 |
+
|
475 |
+
return;
|
476 |
+
}
|
477 |
+
|
478 |
+
/*
|
479 |
+
* If '.wp-header-end' is found, append the notices after it otherwise
|
480 |
+
* after the first h1 or h2 heading found within the main content.
|
481 |
+
*/
|
482 |
+
if ( ! $headerEnd.length ) {
|
483 |
+
$headerEnd = $( '.wrap h1, .wrap h2' ).first();
|
484 |
+
}
|
485 |
+
|
486 |
+
$notice = $( '#local-storage-notice' )
|
487 |
+
.insertAfter( $headerEnd )
|
488 |
+
.addClass( 'notice-warning' );
|
489 |
+
|
490 |
+
if ( $newerAutosaveNotice.length ) {
|
491 |
+
|
492 |
+
// If there is a "server" autosave notice, hide it.
|
493 |
+
// The data in the session storage is either the same or newer.
|
494 |
+
$newerAutosaveNotice.slideUp( 150, function() {
|
495 |
+
$notice.slideDown( 150 );
|
496 |
+
});
|
497 |
+
} else {
|
498 |
+
$notice.slideDown( 200 );
|
499 |
+
}
|
500 |
+
|
501 |
+
$notice.find( '.restore-backup' ).on( 'click.autosave-local', function() {
|
502 |
+
restorePost( postData );
|
503 |
+
$notice.fadeTo( 250, 0, function() {
|
504 |
+
$notice.slideUp( 150 );
|
505 |
+
});
|
506 |
+
});
|
507 |
+
}
|
508 |
+
|
509 |
+
/**
|
510 |
+
* @summary Restores the current title, content and excerpt from postData.
|
511 |
+
*
|
512 |
+
* @since 3.9.0
|
513 |
+
*
|
514 |
+
* @param {Object} postData The object containing all post data.
|
515 |
+
*
|
516 |
+
* @returns {boolean} True if the post is restored.
|
517 |
+
*/
|
518 |
+
function restorePost( postData ) {
|
519 |
+
var editor;
|
520 |
+
|
521 |
+
if ( postData ) {
|
522 |
+
// Set the last saved data
|
523 |
+
lastCompareString = getCompareString( postData );
|
524 |
+
|
525 |
+
if ( $( '#title' ).val() !== postData.post_title ) {
|
526 |
+
$( '#title' ).focus().val( postData.post_title || '' );
|
527 |
+
}
|
528 |
+
|
529 |
+
$( '#excerpt' ).val( postData.excerpt || '' );
|
530 |
+
editor = getEditor();
|
531 |
+
|
532 |
+
if ( editor && ! editor.isHidden() && typeof switchEditors !== 'undefined' ) {
|
533 |
+
if ( editor.settings.wpautop && postData.content ) {
|
534 |
+
postData.content = switchEditors.wpautop( postData.content );
|
535 |
+
}
|
536 |
+
|
537 |
+
// Make sure there's an undo level in the editor
|
538 |
+
editor.undoManager.transact( function() {
|
539 |
+
editor.setContent( postData.content || '' );
|
540 |
+
editor.nodeChanged();
|
541 |
+
});
|
542 |
+
} else {
|
543 |
+
|
544 |
+
// Make sure the Text editor is selected
|
545 |
+
$( '#content-html' ).click();
|
546 |
+
$( '#content' ).focus();
|
547 |
+
|
548 |
+
// Using document.execCommand() will let the user undo.
|
549 |
+
document.execCommand( 'selectAll' );
|
550 |
+
document.execCommand( 'insertText', false, postData.content || '' );
|
551 |
+
}
|
552 |
+
|
553 |
+
return true;
|
554 |
+
}
|
555 |
+
|
556 |
+
return false;
|
557 |
+
}
|
558 |
+
|
559 |
+
blog_id = typeof window.autosaveL10n !== 'undefined' && window.autosaveL10n.blog_id;
|
560 |
+
|
561 |
+
// Check if the browser supports sessionStorage and it's not disabled,
|
562 |
+
// then initialize and run checkPost().
|
563 |
+
// Don't run if the post type supports neither 'editor' (textarea#content) nor 'excerpt'.
|
564 |
+
if ( checkStorage() && blog_id && ( $('#content').length || $('#excerpt').length ) ) {
|
565 |
+
$document.ready( run );
|
566 |
+
}
|
567 |
+
|
568 |
+
return {
|
569 |
+
hasStorage: hasStorage,
|
570 |
+
getSavedPostData: getSavedPostData,
|
571 |
+
save: save,
|
572 |
+
suspend: suspend,
|
573 |
+
resume: resume
|
574 |
+
};
|
575 |
+
}
|
576 |
+
|
577 |
+
/**
|
578 |
+
* @summary Auto saves the post on the server.
|
579 |
+
*
|
580 |
+
* @since 3.9.0
|
581 |
+
*
|
582 |
+
* @returns {Object} {
|
583 |
+
* {
|
584 |
+
* tempBlockSave: tempBlockSave,
|
585 |
+
* triggerSave: triggerSave,
|
586 |
+
* postChanged: postChanged,
|
587 |
+
* suspend: suspend,
|
588 |
+
* resume: resume
|
589 |
+
* }
|
590 |
+
* } The object all functions for autosave.
|
591 |
+
*/
|
592 |
+
function autosaveServer() {
|
593 |
+
var _blockSave, _blockSaveTimer, previousCompareString, lastCompareString,
|
594 |
+
nextRun = 0,
|
595 |
+
isSuspended = false;
|
596 |
+
|
597 |
+
|
598 |
+
/**
|
599 |
+
* @summary Blocks saving for the next 10 seconds.
|
600 |
+
*
|
601 |
+
* @since 3.9.0
|
602 |
+
*
|
603 |
+
* @returns {void}
|
604 |
+
*/
|
605 |
+
function tempBlockSave() {
|
606 |
+
_blockSave = true;
|
607 |
+
window.clearTimeout( _blockSaveTimer );
|
608 |
+
|
609 |
+
_blockSaveTimer = window.setTimeout( function() {
|
610 |
+
_blockSave = false;
|
611 |
+
}, 10000 );
|
612 |
+
}
|
613 |
+
|
614 |
+
/**
|
615 |
+
* @summary Sets isSuspended to true.
|
616 |
+
*
|
617 |
+
* @since 3.9.0
|
618 |
+
*
|
619 |
+
* @returns {void}
|
620 |
+
*/
|
621 |
+
function suspend() {
|
622 |
+
isSuspended = true;
|
623 |
+
}
|
624 |
+
|
625 |
+
/**
|
626 |
+
* @summary Sets isSuspended to false.
|
627 |
+
*
|
628 |
+
* @since 3.9.0
|
629 |
+
*
|
630 |
+
* @returns {void}
|
631 |
+
*/
|
632 |
+
function resume() {
|
633 |
+
isSuspended = false;
|
634 |
+
}
|
635 |
+
|
636 |
+
/**
|
637 |
+
* @summary Triggers the autosave with the post data.
|
638 |
+
*
|
639 |
+
* @since 3.9.0
|
640 |
+
*
|
641 |
+
* @param {Object} data The post data.
|
642 |
+
*
|
643 |
+
* @returns {void}
|
644 |
+
*/
|
645 |
+
function response( data ) {
|
646 |
+
_schedule();
|
647 |
+
_blockSave = false;
|
648 |
+
lastCompareString = previousCompareString;
|
649 |
+
previousCompareString = '';
|
650 |
+
|
651 |
+
$document.trigger( 'after-autosave', [data] );
|
652 |
+
enableButtons();
|
653 |
+
|
654 |
+
if ( data.success ) {
|
655 |
+
// No longer an auto-draft
|
656 |
+
$( '#auto_draft' ).val('');
|
657 |
+
}
|
658 |
+
}
|
659 |
+
|
660 |
+
/**
|
661 |
+
* @summary Saves immediately.
|
662 |
+
*
|
663 |
+
* Resets the timing and tells heartbeat to connect now.
|
664 |
+
*
|
665 |
+
* @since 3.9.0
|
666 |
+
*
|
667 |
+
* @returns {void}
|
668 |
+
*/
|
669 |
+
function triggerSave() {
|
670 |
+
nextRun = 0;
|
671 |
+
wp.heartbeat.connectNow();
|
672 |
+
}
|
673 |
+
|
674 |
+
/**
|
675 |
+
* @summary Checks if the post content in the textarea has changed since page load.
|
676 |
+
*
|
677 |
+
* This also happens when TinyMCE is active and editor.save() is triggered by
|
678 |
+
* wp.autosave.getPostData().
|
679 |
+
*
|
680 |
+
* @since 3.9.0
|
681 |
+
*
|
682 |
+
* @return {boolean} True if the post has been changed.
|
683 |
+
*/
|
684 |
+
function postChanged() {
|
685 |
+
return getCompareString() !== initialCompareString;
|
686 |
+
}
|
687 |
+
|
688 |
+
/**
|
689 |
+
* @summary Checks if the post can be saved or not.
|
690 |
+
*
|
691 |
+
* If the post hasn't changed or it cannot be updated,
|
692 |
+
* because the autosave is blocked or suspended, the function returns false.
|
693 |
+
*
|
694 |
+
* @since 3.9.0
|
695 |
+
*
|
696 |
+
* @returns {Object} Returns the post data.
|
697 |
+
*/
|
698 |
+
function save() {
|
699 |
+
var postData, compareString;
|
700 |
+
|
701 |
+
// window.autosave() used for back-compat
|
702 |
+
if ( isSuspended || _blockSave || ! window.autosave() ) {
|
703 |
+
return false;
|
704 |
+
}
|
705 |
+
|
706 |
+
if ( ( new Date() ).getTime() < nextRun ) {
|
707 |
+
return false;
|
708 |
+
}
|
709 |
+
|
710 |
+
postData = getPostData();
|
711 |
+
compareString = getCompareString( postData );
|
712 |
+
|
713 |
+
// First check
|
714 |
+
if ( typeof lastCompareString === 'undefined' ) {
|
715 |
+
lastCompareString = initialCompareString;
|
716 |
+
}
|
717 |
+
|
718 |
+
// No change
|
719 |
+
if ( compareString === lastCompareString ) {
|
720 |
+
return false;
|
721 |
+
}
|
722 |
+
|
723 |
+
previousCompareString = compareString;
|
724 |
+
tempBlockSave();
|
725 |
+
disableButtons();
|
726 |
+
|
727 |
+
$document.trigger( 'wpcountwords', [ postData.content ] )
|
728 |
+
.trigger( 'before-autosave', [ postData ] );
|
729 |
+
|
730 |
+
postData._wpnonce = $( '#_wpnonce' ).val() || '';
|
731 |
+
|
732 |
+
return postData;
|
733 |
+
}
|
734 |
+
|
735 |
+
/**
|
736 |
+
* @summary Sets the next run, based on the autosave interval.
|
737 |
+
*
|
738 |
+
* @private
|
739 |
+
*
|
740 |
+
* @since 3.9.0
|
741 |
+
*
|
742 |
+
* @returns {void}
|
743 |
+
*/
|
744 |
+
function _schedule() {
|
745 |
+
nextRun = ( new Date() ).getTime() + ( autosaveL10n.autosaveInterval * 1000 ) || 60000;
|
746 |
+
}
|
747 |
+
|
748 |
+
/**
|
749 |
+
* @summary Sets the autosaveData on the autosave heartbeat.
|
750 |
+
*
|
751 |
+
* @since 3.9.0
|
752 |
+
*
|
753 |
+
* @returns {void}
|
754 |
+
*/
|
755 |
+
$document.on( 'heartbeat-send.autosave', function( event, data ) {
|
756 |
+
var autosaveData = save();
|
757 |
+
|
758 |
+
if ( autosaveData ) {
|
759 |
+
data.wp_autosave = autosaveData;
|
760 |
+
}
|
761 |
+
|
762 |
+
/**
|
763 |
+
* @summary Triggers the autosave of the post with the autosave data
|
764 |
+
* on the autosave heartbeat.
|
765 |
+
*
|
766 |
+
* @since 3.9.0
|
767 |
+
*
|
768 |
+
* @returns {void}
|
769 |
+
*/
|
770 |
+
}).on( 'heartbeat-tick.autosave', function( event, data ) {
|
771 |
+
if ( data.wp_autosave ) {
|
772 |
+
response( data.wp_autosave );
|
773 |
+
}
|
774 |
+
/**
|
775 |
+
* @summary Disables buttons and throws a notice when the connection is lost.
|
776 |
+
*
|
777 |
+
* @since 3.9.0
|
778 |
+
*
|
779 |
+
* @returns {void}
|
780 |
+
*/
|
781 |
+
}).on( 'heartbeat-connection-lost.autosave', function( event, error, status ) {
|
782 |
+
|
783 |
+
// When connection is lost, keep user from submitting changes.
|
784 |
+
if ( 'timeout' === error || 603 === status ) {
|
785 |
+
var $notice = $('#lost-connection-notice');
|
786 |
+
|
787 |
+
if ( ! wp.autosave.local.hasStorage ) {
|
788 |
+
$notice.find('.hide-if-no-sessionstorage').hide();
|
789 |
+
}
|
790 |
+
|
791 |
+
$notice.show();
|
792 |
+
disableButtons();
|
793 |
+
}
|
794 |
+
|
795 |
+
/**
|
796 |
+
* @summary Enables buttons when the connection is restored.
|
797 |
+
*
|
798 |
+
* @since 3.9.0
|
799 |
+
*
|
800 |
+
* @returns {void}
|
801 |
+
*/
|
802 |
+
}).on( 'heartbeat-connection-restored.autosave', function() {
|
803 |
+
$('#lost-connection-notice').hide();
|
804 |
+
enableButtons();
|
805 |
+
}).ready( function() {
|
806 |
+
_schedule();
|
807 |
+
});
|
808 |
+
|
809 |
+
return {
|
810 |
+
tempBlockSave: tempBlockSave,
|
811 |
+
triggerSave: triggerSave,
|
812 |
+
postChanged: postChanged,
|
813 |
+
suspend: suspend,
|
814 |
+
resume: resume
|
815 |
+
};
|
816 |
+
}
|
817 |
+
|
818 |
+
/**
|
819 |
+
* @summary Sets the autosave time out.
|
820 |
+
*
|
821 |
+
* Wait for TinyMCE to initialize plus 1 second. for any external css to finish loading,
|
822 |
+
* then save to the textarea before setting initialCompareString.
|
823 |
+
* This avoids any insignificant differences between the initial textarea content and the content
|
824 |
+
* extracted from the editor.
|
825 |
+
*
|
826 |
+
* @since 3.9.0
|
827 |
+
*
|
828 |
+
* @returns {void}
|
829 |
+
*/
|
830 |
+
$document.on( 'tinymce-editor-init.autosave', function( event, editor ) {
|
831 |
+
if ( editor.id === 'content' ) {
|
832 |
+
window.setTimeout( function() {
|
833 |
+
editor.save();
|
834 |
+
initialCompareString = getCompareString();
|
835 |
+
}, 1000 );
|
836 |
+
}
|
837 |
+
}).ready( function() {
|
838 |
+
|
839 |
+
// Set the initial compare string in case TinyMCE is not used or not loaded first
|
840 |
+
initialCompareString = getCompareString();
|
841 |
+
});
|
842 |
+
|
843 |
+
return {
|
844 |
+
getPostData: getPostData,
|
845 |
+
getCompareString: getCompareString,
|
846 |
+
disableButtons: disableButtons,
|
847 |
+
enableButtons: enableButtons,
|
848 |
+
local: autosaveLocal(),
|
849 |
+
server: autosaveServer()
|
850 |
+
};
|
851 |
+
}
|
852 |
+
|
853 |
+
/** @namespace wp */
|
854 |
+
window.wp = window.wp || {};
|
855 |
+
window.wp.autosave = autosave();
|
856 |
+
|
857 |
+
}( jQuery, window ));
|
lib/classic-editor/js/autosave.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
window.autosave=function(){return!0},function(a,b){function c(){function c(b){var c,d,e,f=(new Date).getTime(),h=[],i=g();return i&&i.isDirty()&&!i.isHidden()&&f-3e3>k&&(i.save(),k=f),e={post_id:a("#post_ID").val()||0,post_type:a("#post_type").val()||"",post_author:a("#post_author").val()||"",post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""},"local"===b?e:(a('input[id^="in-category-"]:checked').each(function(){h.push(this.value)}),e.catslist=h.join(","),(c=a("#post_name").val())&&(e.post_name=c),(d=a("#parent_id").val())&&(e.parent_id=d),a("#comment_status").prop("checked")&&(e.comment_status="open"),a("#ping_status").prop("checked")&&(e.ping_status="open"),"1"===a("#auto_draft").val()&&(e.auto_draft="1"),e)}function d(b){return"object"==typeof b?(b.post_title||"")+"::"+(b.content||"")+"::"+(b.excerpt||""):(a("#title").val()||"")+"::"+(a("#content").val()||"")+"::"+(a("#excerpt").val()||"")}function e(){l.trigger("autosave-disable-buttons"),setTimeout(f,5e3)}function f(){l.trigger("autosave-enable-buttons")}function g(){return"undefined"!=typeof tinymce&&tinymce.get("content")}function h(){function e(){var a=Math.random().toString(),c=!1;try{b.sessionStorage.setItem("wp-test",a),c=b.sessionStorage.getItem("wp-test")===a,b.sessionStorage.removeItem("wp-test")}catch(d){}return v=c,c}function f(){var a=!1;return v&&t&&(a=sessionStorage.getItem("wp-autosave-"+t),a=a?JSON.parse(a):{}),a}function h(a){var b;return!(!v||!t)&&(b="wp-autosave-"+t,sessionStorage.setItem(b,JSON.stringify(a)),null!==sessionStorage.getItem(b))}function i(){var a=f();return!(!a||!u)&&(a["post_"+u]||!1)}function k(a){var b=f();if(!b||!u)return!1;if(a)b["post_"+u]=a;else{if(!b.hasOwnProperty("post_"+u))return!1;delete b["post_"+u]}return h(b)}function m(){y=!0}function n(){y=!1}function o(b){var e,f,g=!1;return!(y||!v)&&(b?(e=i()||{},a.extend(e,b)):e=c("local"),f=d(e),"undefined"==typeof x&&(x=j),f!==x&&(e.save_time=(new Date).getTime(),e.status=a("#post_status").val()||"",g=k(e),g&&(x=f),g))}function p(){u=a("#post_ID").val()||0,a("#wp-content-wrap").hasClass("tmce-active")?l.on("tinymce-editor-init.autosave",function(){b.setTimeout(function(){r()},1500)}):r(),w=b.setInterval(o,15e3),a("form#post").on("submit.autosave-local",function(){var c=g(),d=a("#post_ID").val()||0;c&&!c.isHidden()?c.on("submit",function(){o({post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""})}):o({post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""});var e="https:"===b.location.protocol;wpCookies.set("wp-saving-post",d+"-check",86400,!1,!1,e)})}function q(a,b){function c(a){return a.toString().replace(/[\x20\t\r\n\f]+/g,"")}return c(a||"")===c(b||"")}function r(){var b,c,d,e,f=i(),g=wpCookies.get("wp-saving-post"),h=a("#has-newer-autosave").parent(".notice"),j=a(".wp-header-end");return g===u+"-saved"?(wpCookies.remove("wp-saving-post"),void k(!1)):void(f&&(b=a("#content").val()||"",c=a("#title").val()||"",d=a("#excerpt").val()||"",q(b,f.content)&&q(c,f.post_title)&&q(d,f.excerpt)||(j.length||(j=a(".wrap h1, .wrap h2").first()),e=a("#local-storage-notice").insertAfter(j).addClass("notice-warning"),h.length?h.slideUp(150,function(){e.slideDown(150)}):e.slideDown(200),e.find(".restore-backup").on("click.autosave-local",function(){s(f),e.fadeTo(250,0,function(){e.slideUp(150)})}))))}function s(b){var c;return!!b&&(x=d(b),a("#title").val()!==b.post_title&&a("#title").focus().val(b.post_title||""),a("#excerpt").val(b.excerpt||""),c=g(),c&&!c.isHidden()&&"undefined"!=typeof switchEditors?(c.settings.wpautop&&b.content&&(b.content=switchEditors.wpautop(b.content)),c.undoManager.transact(function(){c.setContent(b.content||""),c.nodeChanged()})):(a("#content-html").click(),a("#content").focus(),document.execCommand("selectAll"),document.execCommand("insertText",!1,b.content||"")),!0)}var t,u,v,w,x,y=!1;return t="undefined"!=typeof b.autosaveL10n&&b.autosaveL10n.blog_id,e()&&t&&(a("#content").length||a("#excerpt").length)&&l.ready(p),{hasStorage:v,getSavedPostData:i,save:o,suspend:m,resume:n}}function i(){function g(){q=!0,b.clearTimeout(r),r=b.setTimeout(function(){q=!1},1e4)}function h(){v=!0}function i(){v=!1}function k(b){p(),q=!1,t=s,s="",l.trigger("after-autosave",[b]),f(),b.success&&a("#auto_draft").val("")}function m(){u=0,wp.heartbeat.connectNow()}function n(){return d()!==j}function o(){var f,h;return!(v||q||!b.autosave())&&(!((new Date).getTime()<u)&&(f=c(),h=d(f),"undefined"==typeof t&&(t=j),h!==t&&(s=h,g(),e(),l.trigger("wpcountwords",[f.content]).trigger("before-autosave",[f]),f._wpnonce=a("#_wpnonce").val()||"",f)))}function p(){u=(new Date).getTime()+1e3*autosaveL10n.autosaveInterval||6e4}var q,r,s,t,u=0,v=!1;return l.on("heartbeat-send.autosave",function(a,b){var c=o();c&&(b.wp_autosave=c)}).on("heartbeat-tick.autosave",function(a,b){b.wp_autosave&&k(b.wp_autosave)}).on("heartbeat-connection-lost.autosave",function(b,c,d){if("timeout"===c||603===d){var f=a("#lost-connection-notice");wp.autosave.local.hasStorage||f.find(".hide-if-no-sessionstorage").hide(),f.show(),e()}}).on("heartbeat-connection-restored.autosave",function(){a("#lost-connection-notice").hide(),f()}).ready(function(){p()}),{tempBlockSave:g,triggerSave:m,postChanged:n,suspend:h,resume:i}}var j,k=0,l=a(document);return l.on("tinymce-editor-init.autosave",function(a,c){"content"===c.id&&b.setTimeout(function(){c.save(),j=d()},1e3)}).ready(function(){j=d()}),{getPostData:c,getCompareString:d,disableButtons:e,enableButtons:f,local:h(),server:i()}}b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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
( function( window, $, undefined ) {
|
2 |
+
'use strict';
|
3 |
+
|
4 |
+
var $window = $( window ),
|
5 |
+
$document = $( document ),
|
6 |
+
$adminBar = $( '#wpadminbar' ),
|
7 |
+
$footer = $( '#wpfooter' );
|
8 |
+
|
9 |
+
/**
|
10 |
+
* @summary Handles the resizing of the editor.
|
11 |
+
*
|
12 |
+
* @since 4.0.0
|
13 |
+
*
|
14 |
+
* @returns {void}
|
15 |
+
*/
|
16 |
+
$( function() {
|
17 |
+
var $wrap = $( '#postdivrich' ),
|
18 |
+
$contentWrap = $( '#wp-content-wrap' ),
|
19 |
+
$tools = $( '#wp-content-editor-tools' ),
|
20 |
+
$visualTop = $(),
|
21 |
+
$visualEditor = $(),
|
22 |
+
$textTop = $( '#ed_toolbar' ),
|
23 |
+
$textEditor = $( '#content' ),
|
24 |
+
textEditor = $textEditor[0],
|
25 |
+
oldTextLength = 0,
|
26 |
+
$bottom = $( '#post-status-info' ),
|
27 |
+
$menuBar = $(),
|
28 |
+
$statusBar = $(),
|
29 |
+
$sideSortables = $( '#side-sortables' ),
|
30 |
+
$postboxContainer = $( '#postbox-container-1' ),
|
31 |
+
$postBody = $('#post-body'),
|
32 |
+
fullscreen = window.wp.editor && window.wp.editor.fullscreen,
|
33 |
+
mceEditor,
|
34 |
+
mceBind = function(){},
|
35 |
+
mceUnbind = function(){},
|
36 |
+
fixedTop = false,
|
37 |
+
fixedBottom = false,
|
38 |
+
fixedSideTop = false,
|
39 |
+
fixedSideBottom = false,
|
40 |
+
scrollTimer,
|
41 |
+
lastScrollPosition = 0,
|
42 |
+
pageYOffsetAtTop = 130,
|
43 |
+
pinnedToolsTop = 56,
|
44 |
+
sidebarBottom = 20,
|
45 |
+
autoresizeMinHeight = 300,
|
46 |
+
initialMode = $contentWrap.hasClass( 'tmce-active' ) ? 'tinymce' : 'html',
|
47 |
+
advanced = !! parseInt( window.getUserSetting( 'hidetb' ), 10 ),
|
48 |
+
// These are corrected when adjust() runs, except on scrolling if already set.
|
49 |
+
heights = {
|
50 |
+
windowHeight: 0,
|
51 |
+
windowWidth: 0,
|
52 |
+
adminBarHeight: 0,
|
53 |
+
toolsHeight: 0,
|
54 |
+
menuBarHeight: 0,
|
55 |
+
visualTopHeight: 0,
|
56 |
+
textTopHeight: 0,
|
57 |
+
bottomHeight: 0,
|
58 |
+
statusBarHeight: 0,
|
59 |
+
sideSortablesHeight: 0
|
60 |
+
};
|
61 |
+
|
62 |
+
/**
|
63 |
+
* @summary Resizes textarea based on scroll height and width.
|
64 |
+
*
|
65 |
+
* Resizes textarea based on scroll height and width. Doesn't shrink the
|
66 |
+
* editor size below the 300px auto resize minimum height.
|
67 |
+
*
|
68 |
+
* @since 4.6.1
|
69 |
+
*
|
70 |
+
* @returns {void}
|
71 |
+
*/
|
72 |
+
var shrinkTextarea = window._.throttle( function() {
|
73 |
+
var x = window.scrollX || document.documentElement.scrollLeft;
|
74 |
+
var y = window.scrollY || document.documentElement.scrollTop;
|
75 |
+
var height = parseInt( textEditor.style.height, 10 );
|
76 |
+
|
77 |
+
textEditor.style.height = autoresizeMinHeight + 'px';
|
78 |
+
|
79 |
+
if ( textEditor.scrollHeight > autoresizeMinHeight ) {
|
80 |
+
textEditor.style.height = textEditor.scrollHeight + 'px';
|
81 |
+
}
|
82 |
+
|
83 |
+
if ( typeof x !== 'undefined' ) {
|
84 |
+
window.scrollTo( x, y );
|
85 |
+
}
|
86 |
+
|
87 |
+
if ( textEditor.scrollHeight < height ) {
|
88 |
+
adjust();
|
89 |
+
}
|
90 |
+
}, 300 );
|
91 |
+
|
92 |
+
/**
|
93 |
+
* @summary Resizes the text editor depending on the old text length.
|
94 |
+
*
|
95 |
+
* If there is an mceEditor and it is hidden, it resizes the editor depending
|
96 |
+
* on the old text length. If the current length of the text is smaller than
|
97 |
+
* the old text length, it shrinks the text area. Otherwise it resizes the editor to
|
98 |
+
* the scroll height.
|
99 |
+
*
|
100 |
+
* @since 4.6.1
|
101 |
+
*
|
102 |
+
* @returns {void}
|
103 |
+
*/
|
104 |
+
function textEditorResize() {
|
105 |
+
var length = textEditor.value.length;
|
106 |
+
|
107 |
+
if ( mceEditor && ! mceEditor.isHidden() ) {
|
108 |
+
return;
|
109 |
+
}
|
110 |
+
|
111 |
+
if ( ! mceEditor && initialMode === 'tinymce' ) {
|
112 |
+
return;
|
113 |
+
}
|
114 |
+
|
115 |
+
if ( length < oldTextLength ) {
|
116 |
+
shrinkTextarea();
|
117 |
+
} else if ( parseInt( textEditor.style.height, 10 ) < textEditor.scrollHeight ) {
|
118 |
+
textEditor.style.height = Math.ceil( textEditor.scrollHeight ) + 'px';
|
119 |
+
adjust();
|
120 |
+
}
|
121 |
+
|
122 |
+
oldTextLength = length;
|
123 |
+
}
|
124 |
+
|
125 |
+
/**
|
126 |
+
* @summary Gets the height and widths of elements.
|
127 |
+
*
|
128 |
+
* Gets the heights of the window, the adminbar, the tools, the menu,
|
129 |
+
* the visualTop, the textTop, the bottom, the statusbar and sideSortables
|
130 |
+
* and stores these in the heights object. Defaults to 0.
|
131 |
+
* Gets the width of the window and stores this in the heights object.
|
132 |
+
*
|
133 |
+
* @since 4.0.0
|
134 |
+
*
|
135 |
+
* @returns {void}
|
136 |
+
*/
|
137 |
+
function getHeights() {
|
138 |
+
var windowWidth = $window.width();
|
139 |
+
|
140 |
+
heights = {
|
141 |
+
windowHeight: $window.height(),
|
142 |
+
windowWidth: windowWidth,
|
143 |
+
adminBarHeight: ( windowWidth > 600 ? $adminBar.outerHeight() : 0 ),
|
144 |
+
toolsHeight: $tools.outerHeight() || 0,
|
145 |
+
menuBarHeight: $menuBar.outerHeight() || 0,
|
146 |
+
visualTopHeight: $visualTop.outerHeight() || 0,
|
147 |
+
textTopHeight: $textTop.outerHeight() || 0,
|
148 |
+
bottomHeight: $bottom.outerHeight() || 0,
|
149 |
+
statusBarHeight: $statusBar.outerHeight() || 0,
|
150 |
+
sideSortablesHeight: $sideSortables.height() || 0
|
151 |
+
};
|
152 |
+
|
153 |
+
// Adjust for hidden menubar.
|
154 |
+
if ( heights.menuBarHeight < 3 ) {
|
155 |
+
heights.menuBarHeight = 0;
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
// We need to wait for TinyMCE to initialize.
|
160 |
+
/**
|
161 |
+
* @summary Binds all necessary functions for editor expand to the editor
|
162 |
+
* when the editor is initialized.
|
163 |
+
*
|
164 |
+
* @since 4.0.0
|
165 |
+
*
|
166 |
+
* @param {event} event The TinyMCE editor init event.
|
167 |
+
* @param {object} editor The editor to bind the vents on.
|
168 |
+
*
|
169 |
+
* @returns {void}
|
170 |
+
*/
|
171 |
+
$document.on( 'tinymce-editor-init.editor-expand', function( event, editor ) {
|
172 |
+
// VK contains the type of key pressed. VK = virtual keyboard.
|
173 |
+
var VK = window.tinymce.util.VK,
|
174 |
+
/**
|
175 |
+
* @summary Hides any float panel with a hover state. Additionally hides tooltips.
|
176 |
+
*
|
177 |
+
* @returns {void}
|
178 |
+
*/
|
179 |
+
hideFloatPanels = _.debounce( function() {
|
180 |
+
! $( '.mce-floatpanel:hover' ).length && window.tinymce.ui.FloatPanel.hideAll();
|
181 |
+
$( '.mce-tooltip' ).hide();
|
182 |
+
}, 1000, true );
|
183 |
+
|
184 |
+
// Make sure it's the main editor.
|
185 |
+
if ( editor.id !== 'content' ) {
|
186 |
+
return;
|
187 |
+
}
|
188 |
+
|
189 |
+
// Copy the editor instance.
|
190 |
+
mceEditor = editor;
|
191 |
+
|
192 |
+
// Set the minimum height to the initial viewport height.
|
193 |
+
editor.settings.autoresize_min_height = autoresizeMinHeight;
|
194 |
+
|
195 |
+
// Get the necessary UI elements.
|
196 |
+
$visualTop = $contentWrap.find( '.mce-toolbar-grp' );
|
197 |
+
$visualEditor = $contentWrap.find( '.mce-edit-area' );
|
198 |
+
$statusBar = $contentWrap.find( '.mce-statusbar' );
|
199 |
+
$menuBar = $contentWrap.find( '.mce-menubar' );
|
200 |
+
|
201 |
+
/**
|
202 |
+
* @summary Gets the offset of the editor.
|
203 |
+
*
|
204 |
+
* @returns {Number|Boolean} Returns the offset of the editor
|
205 |
+
* or false if there is no offset height.
|
206 |
+
*/
|
207 |
+
function mceGetCursorOffset() {
|
208 |
+
var node = editor.selection.getNode(),
|
209 |
+
range, view, offset;
|
210 |
+
|
211 |
+
/*
|
212 |
+
* If editor.wp.getView and the selection node from the editor selection
|
213 |
+
* are defined, use this as a view for the offset.
|
214 |
+
*/
|
215 |
+
if ( editor.wp && editor.wp.getView && ( view = editor.wp.getView( node ) ) ) {
|
216 |
+
offset = view.getBoundingClientRect();
|
217 |
+
} else {
|
218 |
+
range = editor.selection.getRng();
|
219 |
+
|
220 |
+
// Try to get the offset from a range.
|
221 |
+
try {
|
222 |
+
offset = range.getClientRects()[0];
|
223 |
+
} catch( er ) {}
|
224 |
+
|
225 |
+
// Get the offset from the bounding client rectangle of the node.
|
226 |
+
if ( ! offset ) {
|
227 |
+
offset = node.getBoundingClientRect();
|
228 |
+
}
|
229 |
+
}
|
230 |
+
|
231 |
+
return offset.height ? offset : false;
|
232 |
+
}
|
233 |
+
|
234 |
+
/**
|
235 |
+
* @summary Filters the special keys that should not be used for scrolling.
|
236 |
+
*
|
237 |
+
* @since 4.0.0
|
238 |
+
*
|
239 |
+
* @param {event} event The event to get the key code from.
|
240 |
+
*
|
241 |
+
* @returns {void}
|
242 |
+
*/
|
243 |
+
function mceKeyup( event ) {
|
244 |
+
var key = event.keyCode;
|
245 |
+
|
246 |
+
// Bail on special keys. Key code 47 is a /
|
247 |
+
if ( key <= 47 && ! ( key === VK.SPACEBAR || key === VK.ENTER || key === VK.DELETE || key === VK.BACKSPACE || key === VK.UP || key === VK.LEFT || key === VK.DOWN || key === VK.UP ) ) {
|
248 |
+
return;
|
249 |
+
// OS keys, function keys, num lock, scroll lock. Key code 91-93 are OS keys. Key code 112-123 are F1 to F12. Key code 144 is num lock. Key code 145 is scroll lock.
|
250 |
+
} else if ( ( key >= 91 && key <= 93 ) || ( key >= 112 && key <= 123 ) || key === 144 || key === 145 ) {
|
251 |
+
return;
|
252 |
+
}
|
253 |
+
|
254 |
+
mceScroll( key );
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* @summary Makes sure the cursor is always visible in the editor.
|
259 |
+
*
|
260 |
+
* Makes sure the cursor is kept between the toolbars of the editor and scrolls
|
261 |
+
* the window when the cursor moves out of the viewport to a wpview.
|
262 |
+
* Setting a buffer > 0 will prevent the browser default.
|
263 |
+
* Some browsers will scroll to the middle,
|
264 |
+
* others to the top/bottom of the *window* when moving the cursor out of the viewport.
|
265 |
+
*
|
266 |
+
* @since 4.1.0
|
267 |
+
*
|
268 |
+
* @param {string} key The key code of the pressed key.
|
269 |
+
*
|
270 |
+
* @returns {void}
|
271 |
+
*/
|
272 |
+
function mceScroll( key ) {
|
273 |
+
var offset = mceGetCursorOffset(),
|
274 |
+
buffer = 50,
|
275 |
+
cursorTop, cursorBottom, editorTop, editorBottom;
|
276 |
+
|
277 |
+
// Don't scroll if there is no offset.
|
278 |
+
if ( ! offset ) {
|
279 |
+
return;
|
280 |
+
}
|
281 |
+
|
282 |
+
// Determine the cursorTop based on the offset and the top of the editor iframe.
|
283 |
+
cursorTop = offset.top + editor.iframeElement.getBoundingClientRect().top;
|
284 |
+
|
285 |
+
// Determine the cursorBottom based on the cursorTop and offset height.
|
286 |
+
cursorBottom = cursorTop + offset.height;
|
287 |
+
|
288 |
+
// Subtract the buffer from the cursorTop.
|
289 |
+
cursorTop = cursorTop - buffer;
|
290 |
+
|
291 |
+
// Add the buffer to the cursorBottom.
|
292 |
+
cursorBottom = cursorBottom + buffer;
|
293 |
+
editorTop = heights.adminBarHeight + heights.toolsHeight + heights.menuBarHeight + heights.visualTopHeight;
|
294 |
+
|
295 |
+
/*
|
296 |
+
* Set the editorBottom based on the window Height, and add the bottomHeight and statusBarHeight if the
|
297 |
+
* advanced editor is enabled.
|
298 |
+
*/
|
299 |
+
editorBottom = heights.windowHeight - ( advanced ? heights.bottomHeight + heights.statusBarHeight : 0 );
|
300 |
+
|
301 |
+
// Don't scroll if the node is taller than the visible part of the editor.
|
302 |
+
if ( editorBottom - editorTop < offset.height ) {
|
303 |
+
return;
|
304 |
+
}
|
305 |
+
|
306 |
+
/*
|
307 |
+
* If the cursorTop is smaller than the editorTop and the up, left
|
308 |
+
* or backspace key is pressed, scroll the editor to the position defined
|
309 |
+
* by the cursorTop, pageYOffset and editorTop.
|
310 |
+
*/
|
311 |
+
if ( cursorTop < editorTop && ( key === VK.UP || key === VK.LEFT || key === VK.BACKSPACE ) ) {
|
312 |
+
window.scrollTo( window.pageXOffset, cursorTop + window.pageYOffset - editorTop );
|
313 |
+
|
314 |
+
/*
|
315 |
+
* If any other key is pressed or the cursorTop is bigger than the editorTop,
|
316 |
+
* scroll the editor to the position defined by the cursorBottom,
|
317 |
+
* pageYOffset and editorBottom.
|
318 |
+
*/
|
319 |
+
} else if ( cursorBottom > editorBottom ) {
|
320 |
+
window.scrollTo( window.pageXOffset, cursorBottom + window.pageYOffset - editorBottom );
|
321 |
+
}
|
322 |
+
}
|
323 |
+
|
324 |
+
/**
|
325 |
+
* @summary If the editor is fullscreen, calls adjust.
|
326 |
+
*
|
327 |
+
* @since 4.1.0
|
328 |
+
*
|
329 |
+
* @param {event} event The FullscreenStateChanged event.
|
330 |
+
*
|
331 |
+
* @returns {void}
|
332 |
+
*/
|
333 |
+
function mceFullscreenToggled( event ) {
|
334 |
+
// event.state is true if the editor is fullscreen.
|
335 |
+
if ( ! event.state ) {
|
336 |
+
adjust();
|
337 |
+
}
|
338 |
+
}
|
339 |
+
|
340 |
+
/**
|
341 |
+
* @summary Shows the editor when scrolled.
|
342 |
+
*
|
343 |
+
* Binds the hideFloatPanels function on the window scroll.mce-float-panels event.
|
344 |
+
* Executes the wpAutoResize on the active editor.
|
345 |
+
*
|
346 |
+
* @since 4.0.0
|
347 |
+
*
|
348 |
+
* @returns {void}
|
349 |
+
*/
|
350 |
+
function mceShow() {
|
351 |
+
$window.on( 'scroll.mce-float-panels', hideFloatPanels );
|
352 |
+
|
353 |
+
setTimeout( function() {
|
354 |
+
editor.execCommand( 'wpAutoResize' );
|
355 |
+
adjust();
|
356 |
+
}, 300 );
|
357 |
+
}
|
358 |
+
|
359 |
+
/**
|
360 |
+
* @summary Resizes the editor.
|
361 |
+
*
|
362 |
+
* Removes all functions from the window scroll.mce-float-panels event.
|
363 |
+
* Resizes the text editor and scrolls to a position based on the pageXOffset and adminBarHeight.
|
364 |
+
*
|
365 |
+
* @since 4.0.0
|
366 |
+
*
|
367 |
+
* @returns {void}
|
368 |
+
*/
|
369 |
+
function mceHide() {
|
370 |
+
$window.off( 'scroll.mce-float-panels' );
|
371 |
+
|
372 |
+
setTimeout( function() {
|
373 |
+
var top = $contentWrap.offset().top;
|
374 |
+
|
375 |
+
if ( window.pageYOffset > top ) {
|
376 |
+
window.scrollTo( window.pageXOffset, top - heights.adminBarHeight );
|
377 |
+
}
|
378 |
+
|
379 |
+
textEditorResize();
|
380 |
+
adjust();
|
381 |
+
}, 100 );
|
382 |
+
|
383 |
+
adjust();
|
384 |
+
}
|
385 |
+
|
386 |
+
/**
|
387 |
+
* @summary Toggles advanced states.
|
388 |
+
*
|
389 |
+
* @since 4.1.0
|
390 |
+
*
|
391 |
+
* @returns {void}
|
392 |
+
*/
|
393 |
+
function toggleAdvanced() {
|
394 |
+
advanced = ! advanced;
|
395 |
+
}
|
396 |
+
|
397 |
+
/**
|
398 |
+
* @summary Binds events of the editor and window.
|
399 |
+
*
|
400 |
+
* @since 4.0.0
|
401 |
+
*
|
402 |
+
* @returns {void}
|
403 |
+
*/
|
404 |
+
mceBind = function() {
|
405 |
+
editor.on( 'keyup', mceKeyup );
|
406 |
+
editor.on( 'show', mceShow );
|
407 |
+
editor.on( 'hide', mceHide );
|
408 |
+
editor.on( 'wp-toolbar-toggle', toggleAdvanced );
|
409 |
+
|
410 |
+
// Adjust when the editor resizes.
|
411 |
+
editor.on( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );
|
412 |
+
|
413 |
+
// Don't hide the caret after undo/redo.
|
414 |
+
editor.on( 'undo redo', mceScroll );
|
415 |
+
|
416 |
+
// Adjust when exiting TinyMCE's fullscreen mode.
|
417 |
+
editor.on( 'FullscreenStateChanged', mceFullscreenToggled );
|
418 |
+
|
419 |
+
$window.off( 'scroll.mce-float-panels' ).on( 'scroll.mce-float-panels', hideFloatPanels );
|
420 |
+
};
|
421 |
+
|
422 |
+
/**
|
423 |
+
* @summary Unbinds the events of the editor and window.
|
424 |
+
*
|
425 |
+
* @since 4.0.0
|
426 |
+
*
|
427 |
+
* @returns {void}
|
428 |
+
*/
|
429 |
+
mceUnbind = function() {
|
430 |
+
editor.off( 'keyup', mceKeyup );
|
431 |
+
editor.off( 'show', mceShow );
|
432 |
+
editor.off( 'hide', mceHide );
|
433 |
+
editor.off( 'wp-toolbar-toggle', toggleAdvanced );
|
434 |
+
editor.off( 'setcontent wp-autoresize wp-toolbar-toggle', adjust );
|
435 |
+
editor.off( 'undo redo', mceScroll );
|
436 |
+
editor.off( 'FullscreenStateChanged', mceFullscreenToggled );
|
437 |
+
|
438 |
+
$window.off( 'scroll.mce-float-panels' );
|
439 |
+
};
|
440 |
+
|
441 |
+
if ( $wrap.hasClass( 'wp-editor-expand' ) ) {
|
442 |
+
|
443 |
+
// Adjust "immediately".
|
444 |
+
mceBind();
|
445 |
+
initialResize( adjust );
|
446 |
+
}
|
447 |
+
} );
|
448 |
+
|
449 |
+
/**
|
450 |
+
* @summary Adjusts the toolbars heights and positions.
|
451 |
+
*
|
452 |
+
* Adjusts the toolbar heights and positions based on the scroll position on the page,
|
453 |
+
* the active editor mode and the heights of the editor, admin bar and side bar.
|
454 |
+
*
|
455 |
+
* @since 4.0.0
|
456 |
+
*
|
457 |
+
* @param {event} event The event that calls this function.
|
458 |
+
*
|
459 |
+
* @returns {void}
|
460 |
+
*/
|
461 |
+
function adjust( event ) {
|
462 |
+
|
463 |
+
// Makes sure we're not in fullscreen mode.
|
464 |
+
if ( fullscreen && fullscreen.settings.visible ) {
|
465 |
+
return;
|
466 |
+
}
|
467 |
+
|
468 |
+
var windowPos = $window.scrollTop(),
|
469 |
+
type = event && event.type,
|
470 |
+
resize = type !== 'scroll',
|
471 |
+
visual = mceEditor && ! mceEditor.isHidden(),
|
472 |
+
buffer = autoresizeMinHeight,
|
473 |
+
postBodyTop = $postBody.offset().top,
|
474 |
+
borderWidth = 1,
|
475 |
+
contentWrapWidth = $contentWrap.width(),
|
476 |
+
$top, $editor, sidebarTop, footerTop, canPin,
|
477 |
+
topPos, topHeight, editorPos, editorHeight;
|
478 |
+
|
479 |
+
/*
|
480 |
+
* Refresh the heights if type isn't 'scroll'
|
481 |
+
* or heights.windowHeight isn't set.
|
482 |
+
*/
|
483 |
+
if ( resize || ! heights.windowHeight ) {
|
484 |
+
getHeights();
|
485 |
+
}
|
486 |
+
|
487 |
+
// Resize on resize event when the editor is in text mode.
|
488 |
+
if ( ! visual && type === 'resize' ) {
|
489 |
+
textEditorResize();
|
490 |
+
}
|
491 |
+
|
492 |
+
if ( visual ) {
|
493 |
+
$top = $visualTop;
|
494 |
+
$editor = $visualEditor;
|
495 |
+
topHeight = heights.visualTopHeight;
|
496 |
+
} else {
|
497 |
+
$top = $textTop;
|
498 |
+
$editor = $textEditor;
|
499 |
+
topHeight = heights.textTopHeight;
|
500 |
+
}
|
501 |
+
|
502 |
+
// Return if TinyMCE is still intializing.
|
503 |
+
if ( ! visual && ! $top.length ) {
|
504 |
+
return;
|
505 |
+
}
|
506 |
+
|
507 |
+
topPos = $top.parent().offset().top;
|
508 |
+
editorPos = $editor.offset().top;
|
509 |
+
editorHeight = $editor.outerHeight();
|
510 |
+
|
511 |
+
/*
|
512 |
+
* If in visual mode, checks if the editorHeight is greater than the autoresizeMinHeight + topHeight.
|
513 |
+
* If not in visual mode, checks if the editorHeight is greater than the autoresizeMinHeight + 20.
|
514 |
+
*/
|
515 |
+
canPin = visual ? autoresizeMinHeight + topHeight : autoresizeMinHeight + 20; // 20px from textarea padding
|
516 |
+
canPin = editorHeight > ( canPin + 5 );
|
517 |
+
|
518 |
+
if ( ! canPin ) {
|
519 |
+
if ( resize ) {
|
520 |
+
$tools.css( {
|
521 |
+
position: 'absolute',
|
522 |
+
top: 0,
|
523 |
+
width: contentWrapWidth
|
524 |
+
} );
|
525 |
+
|
526 |
+
if ( visual && $menuBar.length ) {
|
527 |
+
$menuBar.css( {
|
528 |
+
position: 'absolute',
|
529 |
+
top: 0,
|
530 |
+
width: contentWrapWidth - ( borderWidth * 2 )
|
531 |
+
} );
|
532 |
+
}
|
533 |
+
|
534 |
+
$top.css( {
|
535 |
+
position: 'absolute',
|
536 |
+
top: heights.menuBarHeight,
|
537 |
+
width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) )
|
538 |
+
} );
|
539 |
+
|
540 |
+
$statusBar.attr( 'style', advanced ? '' : 'visibility: hidden;' );
|
541 |
+
$bottom.attr( 'style', '' );
|
542 |
+
}
|
543 |
+
} else {
|
544 |
+
// Check if the top is not already in a fixed position.
|
545 |
+
if ( ( ! fixedTop || resize ) &&
|
546 |
+
( windowPos >= ( topPos - heights.toolsHeight - heights.adminBarHeight ) &&
|
547 |
+
windowPos <= ( topPos - heights.toolsHeight - heights.adminBarHeight + editorHeight - buffer ) ) ) {
|
548 |
+
fixedTop = true;
|
549 |
+
|
550 |
+
$tools.css( {
|
551 |
+
position: 'fixed',
|
552 |
+
top: heights.adminBarHeight,
|
553 |
+
width: contentWrapWidth
|
554 |
+
} );
|
555 |
+
|
556 |
+
if ( visual && $menuBar.length ) {
|
557 |
+
$menuBar.css( {
|
558 |
+
position: 'fixed',
|
559 |
+
top: heights.adminBarHeight + heights.toolsHeight,
|
560 |
+
width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) )
|
561 |
+
} );
|
562 |
+
}
|
563 |
+
|
564 |
+
$top.css( {
|
565 |
+
position: 'fixed',
|
566 |
+
top: heights.adminBarHeight + heights.toolsHeight + heights.menuBarHeight,
|
567 |
+
width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) )
|
568 |
+
} );
|
569 |
+
// Check if the top is already in a fixed position.
|
570 |
+
} else if ( fixedTop || resize ) {
|
571 |
+
if ( windowPos <= ( topPos - heights.toolsHeight - heights.adminBarHeight ) ) {
|
572 |
+
fixedTop = false;
|
573 |
+
|
574 |
+
$tools.css( {
|
575 |
+
position: 'absolute',
|
576 |
+
top: 0,
|
577 |
+
width: contentWrapWidth
|
578 |
+
} );
|
579 |
+
|
580 |
+
if ( visual && $menuBar.length ) {
|
581 |
+
$menuBar.css( {
|
582 |
+
position: 'absolute',
|
583 |
+
top: 0,
|
584 |
+
width: contentWrapWidth - ( borderWidth * 2 )
|
585 |
+
} );
|
586 |
+
}
|
587 |
+
|
588 |
+
$top.css( {
|
589 |
+
position: 'absolute',
|
590 |
+
top: heights.menuBarHeight,
|
591 |
+
width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) )
|
592 |
+
} );
|
593 |
+
} else if ( windowPos >= ( topPos - heights.toolsHeight - heights.adminBarHeight + editorHeight - buffer ) ) {
|
594 |
+
fixedTop = false;
|
595 |
+
|
596 |
+
$tools.css( {
|
597 |
+
position: 'absolute',
|
598 |
+
top: editorHeight - buffer,
|
599 |
+
width: contentWrapWidth
|
600 |
+
} );
|
601 |
+
|
602 |
+
if ( visual && $menuBar.length ) {
|
603 |
+
$menuBar.css( {
|
604 |
+
position: 'absolute',
|
605 |
+
top: editorHeight - buffer,
|
606 |
+
width: contentWrapWidth - ( borderWidth * 2 )
|
607 |
+
} );
|
608 |
+
}
|
609 |
+
|
610 |
+
$top.css( {
|
611 |
+
position: 'absolute',
|
612 |
+
top: editorHeight - buffer + heights.menuBarHeight,
|
613 |
+
width: contentWrapWidth - ( borderWidth * 2 ) - ( visual ? 0 : ( $top.outerWidth() - $top.width() ) )
|
614 |
+
} );
|
615 |
+
}
|
616 |
+
}
|
617 |
+
|
618 |
+
// Check if the bottom is not already in a fixed position.
|
619 |
+
if ( ( ! fixedBottom || ( resize && advanced ) ) &&
|
620 |
+
// Add borderWidth for the border around the .wp-editor-container.
|
621 |
+
( windowPos + heights.windowHeight ) <= ( editorPos + editorHeight + heights.bottomHeight + heights.statusBarHeight + borderWidth ) ) {
|
622 |
+
|
623 |
+
if ( event && event.deltaHeight > 0 && event.deltaHeight < 100 ) {
|
624 |
+
window.scrollBy( 0, event.deltaHeight );
|
625 |
+
} else if ( visual && advanced ) {
|
626 |
+
fixedBottom = true;
|
627 |
+
|
628 |
+
$statusBar.css( {
|
629 |
+
position: 'fixed',
|
630 |
+
bottom: heights.bottomHeight,
|
631 |
+
visibility: '',
|
632 |
+
width: contentWrapWidth - ( borderWidth * 2 )
|
633 |
+
} );
|
634 |
+
|
635 |
+
$bottom.css( {
|
636 |
+
position: 'fixed',
|
637 |
+
bottom: 0,
|
638 |
+
width: contentWrapWidth
|
639 |
+
} );
|
640 |
+
}
|
641 |
+
} else if ( ( ! advanced && fixedBottom ) ||
|
642 |
+
( ( fixedBottom || resize ) &&
|
643 |
+
( windowPos + heights.windowHeight ) > ( editorPos + editorHeight + heights.bottomHeight + heights.statusBarHeight - borderWidth ) ) ) {
|
644 |
+
fixedBottom = false;
|
645 |
+
|
646 |
+
$statusBar.attr( 'style', advanced ? '' : 'visibility: hidden;' );
|
647 |
+
$bottom.attr( 'style', '' );
|
648 |
+
}
|
649 |
+
}
|
650 |
+
|
651 |
+
// The postbox container is positioned with @media from CSS. Ensure it is pinned on the side.
|
652 |
+
if ( $postboxContainer.width() < 300 && heights.windowWidth > 600 &&
|
653 |
+
|
654 |
+
// Check if the sidebar is not taller than the document height.
|
655 |
+
$document.height() > ( $sideSortables.height() + postBodyTop + 120 ) &&
|
656 |
+
|
657 |
+
// Check if the editor is taller than the viewport.
|
658 |
+
heights.windowHeight < editorHeight ) {
|
659 |
+
|
660 |
+
if ( ( heights.sideSortablesHeight + pinnedToolsTop + sidebarBottom ) > heights.windowHeight || fixedSideTop || fixedSideBottom ) {
|
661 |
+
|
662 |
+
// Reset the sideSortables style when scrolling to the top.
|
663 |
+
if ( windowPos + pinnedToolsTop <= postBodyTop ) {
|
664 |
+
$sideSortables.attr( 'style', '' );
|
665 |
+
fixedSideTop = fixedSideBottom = false;
|
666 |
+
} else {
|
667 |
+
|
668 |
+
// When scrolling down.
|
669 |
+
if ( windowPos > lastScrollPosition ) {
|
670 |
+
if ( fixedSideTop ) {
|
671 |
+
|
672 |
+
// Let it scroll.
|
673 |
+
fixedSideTop = false;
|
674 |
+
sidebarTop = $sideSortables.offset().top - heights.adminBarHeight;
|
675 |
+
footerTop = $footer.offset().top;
|
676 |
+
|
677 |
+
// Don't get over the footer.
|
678 |
+
if ( footerTop < sidebarTop + heights.sideSortablesHeight + sidebarBottom ) {
|
679 |
+
sidebarTop = footerTop - heights.sideSortablesHeight - 12;
|
680 |
+
}
|
681 |
+
|
682 |
+
$sideSortables.css({
|
683 |
+
position: 'absolute',
|
684 |
+
top: sidebarTop,
|
685 |
+
bottom: ''
|
686 |
+
});
|
687 |
+
} else if ( ! fixedSideBottom && heights.sideSortablesHeight + $sideSortables.offset().top + sidebarBottom < windowPos + heights.windowHeight ) {
|
688 |
+
// Pin the bottom.
|
689 |
+
fixedSideBottom = true;
|
690 |
+
|
691 |
+
$sideSortables.css({
|
692 |
+
position: 'fixed',
|
693 |
+
top: 'auto',
|
694 |
+
bottom: sidebarBottom
|
695 |
+
});
|
696 |
+
}
|
697 |
+
|
698 |
+
// When scrolling up.
|
699 |
+
} else if ( windowPos < lastScrollPosition ) {
|
700 |
+
if ( fixedSideBottom ) {
|
701 |
+
// Let it scroll.
|
702 |
+
fixedSideBottom = false;
|
703 |
+
sidebarTop = $sideSortables.offset().top - sidebarBottom;
|
704 |
+
footerTop = $footer.offset().top;
|
705 |
+
|
706 |
+
// Don't get over the footer.
|
707 |
+
if ( footerTop < sidebarTop + heights.sideSortablesHeight + sidebarBottom ) {
|
708 |
+
sidebarTop = footerTop - heights.sideSortablesHeight - 12;
|
709 |
+
}
|
710 |
+
|
711 |
+
$sideSortables.css({
|
712 |
+
position: 'absolute',
|
713 |
+
top: sidebarTop,
|
714 |
+
bottom: ''
|
715 |
+
});
|
716 |
+
} else if ( ! fixedSideTop && $sideSortables.offset().top >= windowPos + pinnedToolsTop ) {
|
717 |
+
// Pin the top.
|
718 |
+
fixedSideTop = true;
|
719 |
+
|
720 |
+
$sideSortables.css({
|
721 |
+
position: 'fixed',
|
722 |
+
top: pinnedToolsTop,
|
723 |
+
bottom: ''
|
724 |
+
});
|
725 |
+
}
|
726 |
+
}
|
727 |
+
}
|
728 |
+
} else {
|
729 |
+
// If the sidebar container is smaller than the viewport, then pin/unpin the top when scrolling.
|
730 |
+
if ( windowPos >= ( postBodyTop - pinnedToolsTop ) ) {
|
731 |
+
|
732 |
+
$sideSortables.css( {
|
733 |
+
position: 'fixed',
|
734 |
+
top: pinnedToolsTop
|
735 |
+
} );
|
736 |
+
} else {
|
737 |
+
$sideSortables.attr( 'style', '' );
|
738 |
+
}
|
739 |
+
|
740 |
+
fixedSideTop = fixedSideBottom = false;
|
741 |
+
}
|
742 |
+
|
743 |
+
lastScrollPosition = windowPos;
|
744 |
+
} else {
|
745 |
+
$sideSortables.attr( 'style', '' );
|
746 |
+
fixedSideTop = fixedSideBottom = false;
|
747 |
+
}
|
748 |
+
|
749 |
+
if ( resize ) {
|
750 |
+
$contentWrap.css( {
|
751 |
+
paddingTop: heights.toolsHeight
|
752 |
+
} );
|
753 |
+
|
754 |
+
if ( visual ) {
|
755 |
+
$visualEditor.css( {
|
756 |
+
paddingTop: heights.visualTopHeight + heights.menuBarHeight
|
757 |
+
} );
|
758 |
+
} else {
|
759 |
+
$textEditor.css( {
|
760 |
+
marginTop: heights.textTopHeight
|
761 |
+
} );
|
762 |
+
}
|
763 |
+
}
|
764 |
+
}
|
765 |
+
|
766 |
+
/**
|
767 |
+
* @summary Resizes the editor and adjusts the toolbars.
|
768 |
+
*
|
769 |
+
* @since 4.0.0
|
770 |
+
*
|
771 |
+
* @returns {void}
|
772 |
+
*/
|
773 |
+
function fullscreenHide() {
|
774 |
+
textEditorResize();
|
775 |
+
adjust();
|
776 |
+
}
|
777 |
+
|
778 |
+
/**
|
779 |
+
* @summary Runs the passed function with 500ms intervals.
|
780 |
+
*
|
781 |
+
* @since 4.0.0
|
782 |
+
*
|
783 |
+
* @param {function} callback The function to run in the timeout.
|
784 |
+
*
|
785 |
+
* @returns {void}
|
786 |
+
*/
|
787 |
+
function initialResize( callback ) {
|
788 |
+
for ( var i = 1; i < 6; i++ ) {
|
789 |
+
setTimeout( callback, 500 * i );
|
790 |
+
}
|
791 |
+
}
|
792 |
+
|
793 |
+
/**
|
794 |
+
* @summary Runs adjust after 100ms.
|
795 |
+
*
|
796 |
+
* @since 4.0.0
|
797 |
+
*
|
798 |
+
* @returns {void}
|
799 |
+
*/
|
800 |
+
function afterScroll() {
|
801 |
+
clearTimeout( scrollTimer );
|
802 |
+
scrollTimer = setTimeout( adjust, 100 );
|
803 |
+
}
|
804 |
+
|
805 |
+
/**
|
806 |
+
* @summary Binds editor expand events on elements.
|
807 |
+
*
|
808 |
+
* @since 4.0.0
|
809 |
+
*
|
810 |
+
* @returns {void}
|
811 |
+
*/
|
812 |
+
function on() {
|
813 |
+
/*
|
814 |
+
* Scroll to the top when triggering this from JS.
|
815 |
+
* Ensure the toolbars are pinned properly.
|
816 |
+
*/
|
817 |
+
if ( window.pageYOffset && window.pageYOffset > pageYOffsetAtTop ) {
|
818 |
+
window.scrollTo( window.pageXOffset, 0 );
|
819 |
+
}
|
820 |
+
|
821 |
+
$wrap.addClass( 'wp-editor-expand' );
|
822 |
+
|
823 |
+
// Adjust when the window is scrolled or resized.
|
824 |
+
$window.on( 'scroll.editor-expand resize.editor-expand', function( event ) {
|
825 |
+
adjust( event.type );
|
826 |
+
afterScroll();
|
827 |
+
} );
|
828 |
+
|
829 |
+
/*
|
830 |
+
* Adjust when collapsing the menu, changing the columns
|
831 |
+
* or changing the body class.
|
832 |
+
*/
|
833 |
+
$document.on( 'wp-collapse-menu.editor-expand postboxes-columnchange.editor-expand editor-classchange.editor-expand', adjust )
|
834 |
+
.on( 'postbox-toggled.editor-expand postbox-moved.editor-expand', function() {
|
835 |
+
if ( ! fixedSideTop && ! fixedSideBottom && window.pageYOffset > pinnedToolsTop ) {
|
836 |
+
fixedSideBottom = true;
|
837 |
+
window.scrollBy( 0, -1 );
|
838 |
+
adjust();
|
839 |
+
window.scrollBy( 0, 1 );
|
840 |
+
}
|
841 |
+
|
842 |
+
adjust();
|
843 |
+
}).on( 'wp-window-resized.editor-expand', function() {
|
844 |
+
if ( mceEditor && ! mceEditor.isHidden() ) {
|
845 |
+
mceEditor.execCommand( 'wpAutoResize' );
|
846 |
+
} else {
|
847 |
+
textEditorResize();
|
848 |
+
}
|
849 |
+
});
|
850 |
+
|
851 |
+
$textEditor.on( 'focus.editor-expand input.editor-expand propertychange.editor-expand', textEditorResize );
|
852 |
+
mceBind();
|
853 |
+
|
854 |
+
// Adjust when entering or exiting fullscreen mode.
|
855 |
+
fullscreen && fullscreen.pubsub.subscribe( 'hidden', fullscreenHide );
|
856 |
+
|
857 |
+
if ( mceEditor ) {
|
858 |
+
mceEditor.settings.wp_autoresize_on = true;
|
859 |
+
mceEditor.execCommand( 'wpAutoResizeOn' );
|
860 |
+
|
861 |
+
if ( ! mceEditor.isHidden() ) {
|
862 |
+
mceEditor.execCommand( 'wpAutoResize' );
|
863 |
+
}
|
864 |
+
}
|
865 |
+
|
866 |
+
if ( ! mceEditor || mceEditor.isHidden() ) {
|
867 |
+
textEditorResize();
|
868 |
+
}
|
869 |
+
|
870 |
+
adjust();
|
871 |
+
|
872 |
+
$document.trigger( 'editor-expand-on' );
|
873 |
+
}
|
874 |
+
|
875 |
+
/**
|
876 |
+
* @summary Unbinds editor expand events.
|
877 |
+
*
|
878 |
+
* @since 4.0.0
|
879 |
+
*
|
880 |
+
* @returns {void}
|
881 |
+
*/
|
882 |
+
function off() {
|
883 |
+
var height = parseInt( window.getUserSetting( 'ed_size', 300 ), 10 );
|
884 |
+
|
885 |
+
if ( height < 50 ) {
|
886 |
+
height = 50;
|
887 |
+
} else if ( height > 5000 ) {
|
888 |
+
height = 5000;
|
889 |
+
}
|
890 |
+
|
891 |
+
/*
|
892 |
+
* Scroll to the top when triggering this from JS.
|
893 |
+
* Ensure the toolbars are reset properly.
|
894 |
+
*/
|
895 |
+
if ( window.pageYOffset && window.pageYOffset > pageYOffsetAtTop ) {
|
896 |
+
window.scrollTo( window.pageXOffset, 0 );
|
897 |
+
}
|
898 |
+
|
899 |
+
$wrap.removeClass( 'wp-editor-expand' );
|
900 |
+
|
901 |
+
$window.off( '.editor-expand' );
|
902 |
+
$document.off( '.editor-expand' );
|
903 |
+
$textEditor.off( '.editor-expand' );
|
904 |
+
mceUnbind();
|
905 |
+
|
906 |
+
// Adjust when entering or exiting fullscreen mode.
|
907 |
+
fullscreen && fullscreen.pubsub.unsubscribe( 'hidden', fullscreenHide );
|
908 |
+
|
909 |
+
// Reset all css
|
910 |
+
$.each( [ $visualTop, $textTop, $tools, $menuBar, $bottom, $statusBar, $contentWrap, $visualEditor, $textEditor, $sideSortables ], function( i, element ) {
|
911 |
+
element && element.attr( 'style', '' );
|
912 |
+
});
|
913 |
+
|
914 |
+
fixedTop = fixedBottom = fixedSideTop = fixedSideBottom = false;
|
915 |
+
|
916 |
+
if ( mceEditor ) {
|
917 |
+
mceEditor.settings.wp_autoresize_on = false;
|
918 |
+
mceEditor.execCommand( 'wpAutoResizeOff' );
|
919 |
+
|
920 |
+
if ( ! mceEditor.isHidden() ) {
|
921 |
+
$textEditor.hide();
|
922 |
+
|
923 |
+
if ( height ) {
|
924 |
+
mceEditor.theme.resizeTo( null, height );
|
925 |
+
}
|
926 |
+
}
|
927 |
+
}
|
928 |
+
|
929 |
+
// If there is a height found in the user setting.
|
930 |
+
if ( height ) {
|
931 |
+
$textEditor.height( height );
|
932 |
+
}
|
933 |
+
|
934 |
+
$document.trigger( 'editor-expand-off' );
|
935 |
+
}
|
936 |
+
|
937 |
+
// Start on load.
|
938 |
+
if ( $wrap.hasClass( 'wp-editor-expand' ) ) {
|
939 |
+
on();
|
940 |
+
|
941 |
+
// Resize just after CSS has fully loaded and QuickTags is ready.
|
942 |
+
if ( $contentWrap.hasClass( 'html-active' ) ) {
|
943 |
+
initialResize( function() {
|
944 |
+
adjust();
|
945 |
+
textEditorResize();
|
946 |
+
} );
|
947 |
+
}
|
948 |
+
}
|
949 |
+
|
950 |
+
// Show the on/off checkbox.
|
951 |
+
$( '#adv-settings .editor-expand' ).show();
|
952 |
+
$( '#editor-expand-toggle' ).on( 'change.editor-expand', function() {
|
953 |
+
if ( $(this).prop( 'checked' ) ) {
|
954 |
+
on();
|
955 |
+
window.setUserSetting( 'editor_expand', 'on' );
|
956 |
+
} else {
|
957 |
+
off();
|
958 |
+
window.setUserSetting( 'editor_expand', 'off' );
|
959 |
+
}
|
960 |
+
});
|
961 |
+
|
962 |
+
// Expose on() and off().
|
963 |
+
window.editorExpand = {
|
964 |
+
on: on,
|
965 |
+
off: off
|
966 |
+
};
|
967 |
+
} );
|
968 |
+
|
969 |
+
/**
|
970 |
+
* @summary Handles the distraction free writing of TinyMCE.
|
971 |
+
*
|
972 |
+
* @since 4.1.0
|
973 |
+
*
|
974 |
+
* @returns {void}
|
975 |
+
*/
|
976 |
+
$( function() {
|
977 |
+
var $body = $( document.body ),
|
978 |
+
$wrap = $( '#wpcontent' ),
|
979 |
+
$editor = $( '#post-body-content' ),
|
980 |
+
$title = $( '#title' ),
|
981 |
+
$content = $( '#content' ),
|
982 |
+
$overlay = $( document.createElement( 'DIV' ) ),
|
983 |
+
$slug = $( '#edit-slug-box' ),
|
984 |
+
$slugFocusEl = $slug.find( 'a' )
|
985 |
+
.add( $slug.find( 'button' ) )
|
986 |
+
.add( $slug.find( 'input' ) ),
|
987 |
+
$menuWrap = $( '#adminmenuwrap' ),
|
988 |
+
$editorWindow = $(),
|
989 |
+
$editorIframe = $(),
|
990 |
+
_isActive = window.getUserSetting( 'editor_expand', 'on' ) === 'on',
|
991 |
+
_isOn = _isActive ? window.getUserSetting( 'post_dfw' ) === 'on' : false,
|
992 |
+
traveledX = 0,
|
993 |
+
traveledY = 0,
|
994 |
+
buffer = 20,
|
995 |
+
faded, fadedAdminBar, fadedSlug,
|
996 |
+
editorRect, x, y, mouseY, scrollY,
|
997 |
+
focusLostTimer, overlayTimer, editorHasFocus;
|
998 |
+
|
999 |
+
$body.append( $overlay );
|
1000 |
+
|
1001 |
+
$overlay.css( {
|
1002 |
+
display: 'none',
|
1003 |
+
position: 'fixed',
|
1004 |
+
top: $adminBar.height(),
|
1005 |
+
right: 0,
|
1006 |
+
bottom: 0,
|
1007 |
+
left: 0,
|
1008 |
+
'z-index': 9997
|
1009 |
+
} );
|
1010 |
+
|
1011 |
+
$editor.css( {
|
1012 |
+
position: 'relative'
|
1013 |
+
} );
|
1014 |
+
|
1015 |
+
$window.on( 'mousemove.focus', function( event ) {
|
1016 |
+
mouseY = event.pageY;
|
1017 |
+
} );
|
1018 |
+
|
1019 |
+
/**
|
1020 |
+
* @summary Recalculates the bottom and right position of the editor in the DOM.
|
1021 |
+
*
|
1022 |
+
* @since 4.1.0
|
1023 |
+
*
|
1024 |
+
* @returns {void}
|
1025 |
+
*/
|
1026 |
+
function recalcEditorRect() {
|
1027 |
+
editorRect = $editor.offset();
|
1028 |
+
editorRect.right = editorRect.left + $editor.outerWidth();
|
1029 |
+
editorRect.bottom = editorRect.top + $editor.outerHeight();
|
1030 |
+
}
|
1031 |
+
|
1032 |
+
/**
|
1033 |
+
* @summary Activates the distraction free writing mode.
|
1034 |
+
*
|
1035 |
+
* @since 4.1.0
|
1036 |
+
*
|
1037 |
+
* @returns {void}
|
1038 |
+
*/
|
1039 |
+
function activate() {
|
1040 |
+
if ( ! _isActive ) {
|
1041 |
+
_isActive = true;
|
1042 |
+
|
1043 |
+
$document.trigger( 'dfw-activate' );
|
1044 |
+
$content.on( 'keydown.focus-shortcut', toggleViaKeyboard );
|
1045 |
+
}
|
1046 |
+
}
|
1047 |
+
|
1048 |
+
/**
|
1049 |
+
* @summary Deactivates the distraction free writing mode.
|
1050 |
+
*
|
1051 |
+
* @since 4.1.0
|
1052 |
+
*
|
1053 |
+
* @returns {void}
|
1054 |
+
*/
|
1055 |
+
function deactivate() {
|
1056 |
+
if ( _isActive ) {
|
1057 |
+
off();
|
1058 |
+
|
1059 |
+
_isActive = false;
|
1060 |
+
|
1061 |
+
$document.trigger( 'dfw-deactivate' );
|
1062 |
+
$content.off( 'keydown.focus-shortcut' );
|
1063 |
+
}
|
1064 |
+
}
|
1065 |
+
|
1066 |
+
/**
|
1067 |
+
* @summary Returns _isActive.
|
1068 |
+
*
|
1069 |
+
* @since 4.1.0
|
1070 |
+
*
|
1071 |
+
* @returns {boolean} Returns true is _isActive is true.
|
1072 |
+
*/
|
1073 |
+
function isActive() {
|
1074 |
+
return _isActive;
|
1075 |
+
}
|
1076 |
+
|
1077 |
+
/**
|
1078 |
+
* @summary Binds events on the editor for distraction free writing.
|
1079 |
+
*
|
1080 |
+
* @since 4.1.0
|
1081 |
+
*
|
1082 |
+
* @returns {void}
|
1083 |
+
*/
|
1084 |
+
function on() {
|
1085 |
+
if ( ! _isOn && _isActive ) {
|
1086 |
+
_isOn = true;
|
1087 |
+
|
1088 |
+
$content.on( 'keydown.focus', fadeOut );
|
1089 |
+
|
1090 |
+
$title.add( $content ).on( 'blur.focus', maybeFadeIn );
|
1091 |
+
|
1092 |
+
fadeOut();
|
1093 |
+
|
1094 |
+
window.setUserSetting( 'post_dfw', 'on' );
|
1095 |
+
|
1096 |
+
$document.trigger( 'dfw-on' );
|
1097 |
+
}
|
1098 |
+
}
|
1099 |
+
|
1100 |
+
/**
|
1101 |
+
* @summary Unbinds events on the editor for distraction free writing.
|
1102 |
+
*
|
1103 |
+
* @since 4.1.0
|
1104 |
+
*
|
1105 |
+
* @returns {void}
|
1106 |
+
*/
|
1107 |
+
function off() {
|
1108 |
+
if ( _isOn ) {
|
1109 |
+
_isOn = false;
|
1110 |
+
|
1111 |
+
$title.add( $content ).off( '.focus' );
|
1112 |
+
|
1113 |
+
fadeIn();
|
1114 |
+
|
1115 |
+
$editor.off( '.focus' );
|
1116 |
+
|
1117 |
+
window.setUserSetting( 'post_dfw', 'off' );
|
1118 |
+
|
1119 |
+
$document.trigger( 'dfw-off' );
|
1120 |
+
}
|
1121 |
+
}
|
1122 |
+
|
1123 |
+
/**
|
1124 |
+
* @summary Binds or unbinds the editor expand events.
|
1125 |
+
*
|
1126 |
+
* @since 4.1.0
|
1127 |
+
*
|
1128 |
+
* @returns {void}
|
1129 |
+
*/
|
1130 |
+
function toggle() {
|
1131 |
+
if ( _isOn ) {
|
1132 |
+
off();
|
1133 |
+
} else {
|
1134 |
+
on();
|
1135 |
+
}
|
1136 |
+
}
|
1137 |
+
|
1138 |
+
/**
|
1139 |
+
* @summary Returns the value of _isOn.
|
1140 |
+
*
|
1141 |
+
* @since 4.1.0
|
1142 |
+
*
|
1143 |
+
* @returns {boolean} Returns true if _isOn is true.
|
1144 |
+
*/
|
1145 |
+
function isOn() {
|
1146 |
+
return _isOn;
|
1147 |
+
}
|
1148 |
+
|
1149 |
+
/**
|
1150 |
+
* @summary Fades out all elements except for the editor.
|
1151 |
+
*
|
1152 |
+
* The fading is done based on key presses and mouse movements.
|
1153 |
+
* Also calls the fadeIn on certain key presses
|
1154 |
+
* or if the mouse leaves the editor.
|
1155 |
+
*
|
1156 |
+
* @since 4.1.0
|
1157 |
+
*
|
1158 |
+
* @param event The event that triggers this function.
|
1159 |
+
*
|
1160 |
+
* @returns {void}
|
1161 |
+
*/
|
1162 |
+
function fadeOut( event ) {
|
1163 |
+
var isMac,
|
1164 |
+
key = event && event.keyCode;
|
1165 |
+
|
1166 |
+
if ( window.navigator.platform ) {
|
1167 |
+
isMac = ( window.navigator.platform.indexOf( 'Mac' ) > -1 );
|
1168 |
+
}
|
1169 |
+
|
1170 |
+
// Fade in and returns on Escape and keyboard shortcut Alt+Shift+W and Ctrl+Opt+W.
|
1171 |
+
if ( key === 27 || ( key === 87 && event.altKey && ( ( ! isMac && event.shiftKey ) || ( isMac && event.ctrlKey ) ) ) ) {
|
1172 |
+
fadeIn( event );
|
1173 |
+
return;
|
1174 |
+
}
|
1175 |
+
|
1176 |
+
// Return if any of the following keys or combinations of keys is pressed.
|
1177 |
+
if ( event && ( event.metaKey || ( event.ctrlKey && ! event.altKey ) || ( event.altKey && event.shiftKey ) || ( key && (
|
1178 |
+
// Special keys ( tab, ctrl, alt, esc, arrow keys... )
|
1179 |
+
( key <= 47 && key !== 8 && key !== 13 && key !== 32 && key !== 46 ) ||
|
1180 |
+
// Windows keys
|
1181 |
+
( key >= 91 && key <= 93 ) ||
|
1182 |
+
// F keys
|
1183 |
+
( key >= 112 && key <= 135 ) ||
|
1184 |
+
// Num Lock, Scroll Lock, OEM
|
1185 |
+
( key >= 144 && key <= 150 ) ||
|
1186 |
+
// OEM or non-printable
|
1187 |
+
key >= 224
|
1188 |
+
) ) ) ) {
|
1189 |
+
return;
|
1190 |
+
}
|
1191 |
+
|
1192 |
+
if ( ! faded ) {
|
1193 |
+
faded = true;
|
1194 |
+
|
1195 |
+
clearTimeout( overlayTimer );
|
1196 |
+
|
1197 |
+
overlayTimer = setTimeout( function() {
|
1198 |
+
$overlay.show();
|
1199 |
+
}, 600 );
|
1200 |
+
|
1201 |
+
$editor.css( 'z-index', 9998 );
|
1202 |
+
|
1203 |
+
$overlay
|
1204 |
+
// Always recalculate the editor area when entering the overlay with the mouse.
|
1205 |
+
.on( 'mouseenter.focus', function() {
|
1206 |
+
recalcEditorRect();
|
1207 |
+
|
1208 |
+
$window.on( 'scroll.focus', function() {
|
1209 |
+
var nScrollY = window.pageYOffset;
|
1210 |
+
|
1211 |
+
if ( (
|
1212 |
+
scrollY && mouseY &&
|
1213 |
+
scrollY !== nScrollY
|
1214 |
+
) && (
|
1215 |
+
mouseY < editorRect.top - buffer ||
|
1216 |
+
mouseY > editorRect.bottom + buffer
|
1217 |
+
) ) {
|
1218 |
+
fadeIn();
|
1219 |
+
}
|
1220 |
+
|
1221 |
+
scrollY = nScrollY;
|
1222 |
+
} );
|
1223 |
+
} )
|
1224 |
+
.on( 'mouseleave.focus', function() {
|
1225 |
+
x = y = null;
|
1226 |
+
traveledX = traveledY = 0;
|
1227 |
+
|
1228 |
+
$window.off( 'scroll.focus' );
|
1229 |
+
} )
|
1230 |
+
// Fade in when the mouse moves away form the editor area.
|
1231 |
+
.on( 'mousemove.focus', function( event ) {
|
1232 |
+
var nx = event.clientX,
|
1233 |
+
ny = event.clientY,
|
1234 |
+
pageYOffset = window.pageYOffset,
|
1235 |
+
pageXOffset = window.pageXOffset;
|
1236 |
+
|
1237 |
+
if ( x && y && ( nx !== x || ny !== y ) ) {
|
1238 |
+
if (
|
1239 |
+
( ny <= y && ny < editorRect.top - pageYOffset ) ||
|
1240 |
+
( ny >= y && ny > editorRect.bottom - pageYOffset ) ||
|
1241 |
+
( nx <= x && nx < editorRect.left - pageXOffset ) ||
|
1242 |
+
( nx >= x && nx > editorRect.right - pageXOffset )
|
1243 |
+
) {
|
1244 |
+
traveledX += Math.abs( x - nx );
|
1245 |
+
traveledY += Math.abs( y - ny );
|
1246 |
+
|
1247 |
+
if ( (
|
1248 |
+
ny <= editorRect.top - buffer - pageYOffset ||
|
1249 |
+
ny >= editorRect.bottom + buffer - pageYOffset ||
|
1250 |
+
nx <= editorRect.left - buffer - pageXOffset ||
|
1251 |
+
nx >= editorRect.right + buffer - pageXOffset
|
1252 |
+
) && (
|
1253 |
+
traveledX > 10 ||
|
1254 |
+
traveledY > 10
|
1255 |
+
) ) {
|
1256 |
+
fadeIn();
|
1257 |
+
|
1258 |
+
x = y = null;
|
1259 |
+
traveledX = traveledY = 0;
|
1260 |
+
|
1261 |
+
return;
|
1262 |
+
}
|
1263 |
+
} else {
|
1264 |
+
traveledX = traveledY = 0;
|
1265 |
+
}
|
1266 |
+
}
|
1267 |
+
|
1268 |
+
x = nx;
|
1269 |
+
y = ny;
|
1270 |
+
} )
|
1271 |
+
|
1272 |
+
// When the overlay is touched, fade in and cancel the event.
|
1273 |
+
.on( 'touchstart.focus', function( event ) {
|
1274 |
+
event.preventDefault();
|
1275 |
+
fadeIn();
|
1276 |
+
} );
|
1277 |
+
|
1278 |
+
$editor.off( 'mouseenter.focus' );
|
1279 |
+
|
1280 |
+
if ( focusLostTimer ) {
|
1281 |
+
clearTimeout( focusLostTimer );
|
1282 |
+
focusLostTimer = null;
|
1283 |
+
}
|
1284 |
+
|
1285 |
+
$body.addClass( 'focus-on' ).removeClass( 'focus-off' );
|
1286 |
+
}
|
1287 |
+
|
1288 |
+
fadeOutAdminBar();
|
1289 |
+
fadeOutSlug();
|
1290 |
+
}
|
1291 |
+
|
1292 |
+
/**
|
1293 |
+
* @summary Fades all elements back in.
|
1294 |
+
*
|
1295 |
+
* @since 4.1.0
|
1296 |
+
*
|
1297 |
+
* @param event The event that triggers this function.
|
1298 |
+
*
|
1299 |
+
* @returns {void}
|
1300 |
+
*/
|
1301 |
+
function fadeIn( event ) {
|
1302 |
+
if ( faded ) {
|
1303 |
+
faded = false;
|
1304 |
+
|
1305 |
+
clearTimeout( overlayTimer );
|
1306 |
+
|
1307 |
+
overlayTimer = setTimeout( function() {
|
1308 |
+
$overlay.hide();
|
1309 |
+
}, 200 );
|
1310 |
+
|
1311 |
+
$editor.css( 'z-index', '' );
|
1312 |
+
|
1313 |
+
$overlay.off( 'mouseenter.focus mouseleave.focus mousemove.focus touchstart.focus' );
|
1314 |
+
|
1315 |
+
/*
|
1316 |
+
* When fading in, temporarily watch for refocus and fade back out - helps
|
1317 |
+
* with 'accidental' editor exits with the mouse. When fading in and the event
|
1318 |
+
* is a key event (Escape or Alt+Shift+W) don't watch for refocus.
|
1319 |
+
*/
|
1320 |
+
if ( 'undefined' === typeof event ) {
|
1321 |
+
$editor.on( 'mouseenter.focus', function() {
|
1322 |
+
if ( $.contains( $editor.get( 0 ), document.activeElement ) || editorHasFocus ) {
|
1323 |
+
fadeOut();
|
1324 |
+
}
|
1325 |
+
} );
|
1326 |
+
}
|
1327 |
+
|
1328 |
+
focusLostTimer = setTimeout( function() {
|
1329 |
+
focusLostTimer = null;
|
1330 |
+
$editor.off( 'mouseenter.focus' );
|
1331 |
+
}, 1000 );
|
1332 |
+
|
1333 |
+
$body.addClass( 'focus-off' ).removeClass( 'focus-on' );
|
1334 |
+
}
|
1335 |
+
|
1336 |
+
fadeInAdminBar();
|
1337 |
+
fadeInSlug();
|
1338 |
+
}
|
1339 |
+
|
1340 |
+
/**
|
1341 |
+
* @summary Fades in if the focused element based on it position.
|
1342 |
+
*
|
1343 |
+
* @since 4.1.0
|
1344 |
+
*
|
1345 |
+
* @returns {void}
|
1346 |
+
*/
|
1347 |
+
function maybeFadeIn() {
|
1348 |
+
setTimeout( function() {
|
1349 |
+
var position = document.activeElement.compareDocumentPosition( $editor.get( 0 ) );
|
1350 |
+
|
1351 |
+
function hasFocus( $el ) {
|
1352 |
+
return $.contains( $el.get( 0 ), document.activeElement );
|
1353 |
+
}
|
1354 |
+
|
1355 |
+
// The focused node is before or behind the editor area, and not outside the wrap.
|
1356 |
+
if ( ( position === 2 || position === 4 ) && ( hasFocus( $menuWrap ) || hasFocus( $wrap ) || hasFocus( $footer ) ) ) {
|
1357 |
+
fadeIn();
|
1358 |
+
}
|
1359 |
+
}, 0 );
|
1360 |
+
}
|
1361 |
+
|
1362 |
+
/**
|
1363 |
+
* @summary Fades out the admin bar based on focus on the admin bar.
|
1364 |
+
*
|
1365 |
+
* @since 4.1.0
|
1366 |
+
*
|
1367 |
+
* @returns {void}
|
1368 |
+
*/
|
1369 |
+
function fadeOutAdminBar() {
|
1370 |
+
if ( ! fadedAdminBar && faded ) {
|
1371 |
+
fadedAdminBar = true;
|
1372 |
+
|
1373 |
+
$adminBar
|
1374 |
+
.on( 'mouseenter.focus', function() {
|
1375 |
+
$adminBar.addClass( 'focus-off' );
|
1376 |
+
} )
|
1377 |
+
.on( 'mouseleave.focus', function() {
|
1378 |
+
$adminBar.removeClass( 'focus-off' );
|
1379 |
+
} );
|
1380 |
+
}
|
1381 |
+
}
|
1382 |
+
|
1383 |
+
/**
|
1384 |
+
* @summary Fades in the admin bar.
|
1385 |
+
*
|
1386 |
+
* @since 4.1.0
|
1387 |
+
*
|
1388 |
+
* @returns {void}
|
1389 |
+
*/
|
1390 |
+
function fadeInAdminBar() {
|
1391 |
+
if ( fadedAdminBar ) {
|
1392 |
+
fadedAdminBar = false;
|
1393 |
+
|
1394 |
+
$adminBar.off( '.focus' );
|
1395 |
+
}
|
1396 |
+
}
|
1397 |
+
|
1398 |
+
/**
|
1399 |
+
* @summary Fades out the edit slug box.
|
1400 |
+
*
|
1401 |
+
* @since 4.1.0
|
1402 |
+
*
|
1403 |
+
* @returns {void}
|
1404 |
+
*/
|
1405 |
+
function fadeOutSlug() {
|
1406 |
+
if ( ! fadedSlug && faded && ! $slug.find( ':focus').length ) {
|
1407 |
+
fadedSlug = true;
|
1408 |
+
|
1409 |
+
$slug.stop().fadeTo( 'fast', 0.3 ).on( 'mouseenter.focus', fadeInSlug ).off( 'mouseleave.focus' );
|
1410 |
+
|
1411 |
+
$slugFocusEl.on( 'focus.focus', fadeInSlug ).off( 'blur.focus' );
|
1412 |
+
}
|
1413 |
+
}
|
1414 |
+
|
1415 |
+
/**
|
1416 |
+
* @summary Fades in the edit slug box.
|
1417 |
+
*
|
1418 |
+
* @since 4.1.0
|
1419 |
+
*
|
1420 |
+
* @returns {void}
|
1421 |
+
*/
|
1422 |
+
function fadeInSlug() {
|
1423 |
+
if ( fadedSlug ) {
|
1424 |
+
fadedSlug = false;
|
1425 |
+
|
1426 |
+
$slug.stop().fadeTo( 'fast', 1 ).on( 'mouseleave.focus', fadeOutSlug ).off( 'mouseenter.focus' );
|
1427 |
+
|
1428 |
+
$slugFocusEl.on( 'blur.focus', fadeOutSlug ).off( 'focus.focus' );
|
1429 |
+
}
|
1430 |
+
}
|
1431 |
+
|
1432 |
+
/**
|
1433 |
+
* @summary Triggers the toggle on Alt + Shift + W.
|
1434 |
+
*
|
1435 |
+
* Keycode 87 = w.
|
1436 |
+
*
|
1437 |
+
* @since 4.1.0
|
1438 |
+
*
|
1439 |
+
* @param {event} event The event to trigger the toggle.
|
1440 |
+
*
|
1441 |
+
* @returns {void}
|
1442 |
+
*/
|
1443 |
+
function toggleViaKeyboard( event ) {
|
1444 |
+
if ( event.altKey && event.shiftKey && 87 === event.keyCode ) {
|
1445 |
+
toggle();
|
1446 |
+
}
|
1447 |
+
}
|
1448 |
+
|
1449 |
+
if ( $( '#postdivrich' ).hasClass( 'wp-editor-expand' ) ) {
|
1450 |
+
$content.on( 'keydown.focus-shortcut', toggleViaKeyboard );
|
1451 |
+
}
|
1452 |
+
|
1453 |
+
/**
|
1454 |
+
* @summary Adds the distraction free writing button when setting up TinyMCE.
|
1455 |
+
*
|
1456 |
+
* @since 4.1.0
|
1457 |
+
*
|
1458 |
+
* @param {event} event The TinyMCE editor setup event.
|
1459 |
+
* @param {object} editor The editor to add the button to.
|
1460 |
+
*
|
1461 |
+
* @returns {void}
|
1462 |
+
*/
|
1463 |
+
$document.on( 'tinymce-editor-setup.focus', function( event, editor ) {
|
1464 |
+
editor.addButton( 'dfw', {
|
1465 |
+
active: _isOn,
|
1466 |
+
classes: 'wp-dfw btn widget',
|
1467 |
+
disabled: ! _isActive,
|
1468 |
+
onclick: toggle,
|
1469 |
+
onPostRender: function() {
|
1470 |
+
var button = this;
|
1471 |
+
|
1472 |
+
$document
|
1473 |
+
.on( 'dfw-activate.focus', function() {
|
1474 |
+
button.disabled( false );
|
1475 |
+
} )
|
1476 |
+
.on( 'dfw-deactivate.focus', function() {
|
1477 |
+
button.disabled( true );
|
1478 |
+
} )
|
1479 |
+
.on( 'dfw-on.focus', function() {
|
1480 |
+
button.active( true );
|
1481 |
+
} )
|
1482 |
+
.on( 'dfw-off.focus', function() {
|
1483 |
+
button.active( false );
|
1484 |
+
} );
|
1485 |
+
},
|
1486 |
+
tooltip: 'Distraction-free writing mode',
|
1487 |
+
shortcut: 'Alt+Shift+W'
|
1488 |
+
} );
|
1489 |
+
|
1490 |
+
editor.addCommand( 'wpToggleDFW', toggle );
|
1491 |
+
editor.addShortcut( 'access+w', '', 'wpToggleDFW' );
|
1492 |
+
} );
|
1493 |
+
|
1494 |
+
/**
|
1495 |
+
* @summary Binds and unbinds events on the editor.
|
1496 |
+
*
|
1497 |
+
* @since 4.1.0
|
1498 |
+
*
|
1499 |
+
* @param {event} event The TinyMCE editor init event.
|
1500 |
+
* @param {object} editor The editor to bind events on.
|
1501 |
+
*
|
1502 |
+
* @returns {void}
|
1503 |
+
*/
|
1504 |
+
$document.on( 'tinymce-editor-init.focus', function( event, editor ) {
|
1505 |
+
var mceBind, mceUnbind;
|
1506 |
+
|
1507 |
+
function focus() {
|
1508 |
+
editorHasFocus = true;
|
1509 |
+
}
|
1510 |
+
|
1511 |
+
function blur() {
|
1512 |
+
editorHasFocus = false;
|
1513 |
+
}
|
1514 |
+
|
1515 |
+
if ( editor.id === 'content' ) {
|
1516 |
+
$editorWindow = $( editor.getWin() );
|
1517 |
+
$editorIframe = $( editor.getContentAreaContainer() ).find( 'iframe' );
|
1518 |
+
|
1519 |
+
mceBind = function() {
|
1520 |
+
editor.on( 'keydown', fadeOut );
|
1521 |
+
editor.on( 'blur', maybeFadeIn );
|
1522 |
+
editor.on( 'focus', focus );
|
1523 |
+
editor.on( 'blur', blur );
|
1524 |
+
editor.on( 'wp-autoresize', recalcEditorRect );
|
1525 |
+
};
|
1526 |
+
|
1527 |
+
mceUnbind = function() {
|
1528 |
+
editor.off( 'keydown', fadeOut );
|
1529 |
+
editor.off( 'blur', maybeFadeIn );
|
1530 |
+
editor.off( 'focus', focus );
|
1531 |
+
editor.off( 'blur', blur );
|
1532 |
+
editor.off( 'wp-autoresize', recalcEditorRect );
|
1533 |
+
};
|
1534 |
+
|
1535 |
+
if ( _isOn ) {
|
1536 |
+
mceBind();
|
1537 |
+
}
|
1538 |
+
|
1539 |
+
// Bind and unbind based on the distraction free writing focus.
|
1540 |
+
$document.on( 'dfw-on.focus', mceBind ).on( 'dfw-off.focus', mceUnbind );
|
1541 |
+
|
1542 |
+
// Focuse the editor when it is the target of the click event.
|
1543 |
+
editor.on( 'click', function( event ) {
|
1544 |
+
if ( event.target === editor.getDoc().documentElement ) {
|
1545 |
+
editor.focus();
|
1546 |
+
}
|
1547 |
+
} );
|
1548 |
+
}
|
1549 |
+
} );
|
1550 |
+
|
1551 |
+
/**
|
1552 |
+
* @summary Binds events on quicktags init.
|
1553 |
+
*
|
1554 |
+
* @since 4.1.0
|
1555 |
+
*
|
1556 |
+
* @param {event} event The quicktags init event.
|
1557 |
+
* @param {object} editor The editor to bind events on.
|
1558 |
+
*
|
1559 |
+
* @returns {void}
|
1560 |
+
*/
|
1561 |
+
$document.on( 'quicktags-init', function( event, editor ) {
|
1562 |
+
var $button;
|
1563 |
+
|
1564 |
+
// Bind the distraction free writing events if the distraction free writing button is available.
|
1565 |
+
if ( editor.settings.buttons && ( ',' + editor.settings.buttons + ',' ).indexOf( ',dfw,' ) !== -1 ) {
|
1566 |
+
$button = $( '#' + editor.name + '_dfw' );
|
1567 |
+
|
1568 |
+
$( document )
|
1569 |
+
.on( 'dfw-activate', function() {
|
1570 |
+
$button.prop( 'disabled', false );
|
1571 |
+
} )
|
1572 |
+
.on( 'dfw-deactivate', function() {
|
1573 |
+
$button.prop( 'disabled', true );
|
1574 |
+
} )
|
1575 |
+
.on( 'dfw-on', function() {
|
1576 |
+
$button.addClass( 'active' );
|
1577 |
+
} )
|
1578 |
+
.on( 'dfw-off', function() {
|
1579 |
+
$button.removeClass( 'active' );
|
1580 |
+
} );
|
1581 |
+
}
|
1582 |
+
} );
|
1583 |
+
|
1584 |
+
$document.on( 'editor-expand-on.focus', activate ).on( 'editor-expand-off.focus', deactivate );
|
1585 |
+
|
1586 |
+
if ( _isOn ) {
|
1587 |
+
$content.on( 'keydown.focus', fadeOut );
|
1588 |
+
|
1589 |
+
$title.add( $content ).on( 'blur.focus', maybeFadeIn );
|
1590 |
+
}
|
1591 |
+
|
1592 |
+
window.wp = window.wp || {};
|
1593 |
+
window.wp.editor = window.wp.editor || {};
|
1594 |
+
window.wp.editor.dfw = {
|
1595 |
+
activate: activate,
|
1596 |
+
deactivate: deactivate,
|
1597 |
+
isActive: isActive,
|
1598 |
+
on: on,
|
1599 |
+
off: off,
|
1600 |
+
toggle: toggle,
|
1601 |
+
isOn: isOn
|
1602 |
+
};
|
1603 |
+
} );
|
1604 |
+
} )( window, window.jQuery );
|
lib/classic-editor/js/editor-expand.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(a,b,c){"use strict";var d=b(a),e=b(document),f=b("#wpadminbar"),g=b("#wpfooter");b(function(){function c(){var a=x.value.length;o&&!o.isHidden()||(o||"tinymce"!==R)&&(a<y?U():parseInt(x.style.height,10)<x.scrollHeight&&(x.style.height=Math.ceil(x.scrollHeight)+"px",i()),y=a)}function h(){var a=d.width();T={windowHeight:d.height(),windowWidth:a,adminBarHeight:a>600?f.outerHeight():0,toolsHeight:s.outerHeight()||0,menuBarHeight:A.outerHeight()||0,visualTopHeight:t.outerHeight()||0,textTopHeight:v.outerHeight()||0,bottomHeight:z.outerHeight()||0,statusBarHeight:B.outerHeight()||0,sideSortablesHeight:C.height()||0},T.menuBarHeight<3&&(T.menuBarHeight=0)}function i(b){if(!F||!F.settings.visible){var f,i,j,k,l,m,n,p,q,x=d.scrollTop(),y=b&&b.type,G="scroll"!==y,H=o&&!o.isHidden(),N=Q,R=E.offset().top,U=1,V=r.width();!G&&T.windowHeight||h(),H||"resize"!==y||c(),H?(f=t,i=u,n=T.visualTopHeight):(f=v,i=w,n=T.textTopHeight),(H||f.length)&&(m=f.parent().offset().top,p=i.offset().top,q=i.outerHeight(),l=H?Q+n:Q+20,l=q>l+5,l?((!I||G)&&x>=m-T.toolsHeight-T.adminBarHeight&&x<=m-T.toolsHeight-T.adminBarHeight+q-N?(I=!0,s.css({position:"fixed",top:T.adminBarHeight,width:V}),H&&A.length&&A.css({position:"fixed",top:T.adminBarHeight+T.toolsHeight,width:V-2*U-(H?0:f.outerWidth()-f.width())}),f.css({position:"fixed",top:T.adminBarHeight+T.toolsHeight+T.menuBarHeight,width:V-2*U-(H?0:f.outerWidth()-f.width())})):(I||G)&&(x<=m-T.toolsHeight-T.adminBarHeight?(I=!1,s.css({position:"absolute",top:0,width:V}),H&&A.length&&A.css({position:"absolute",top:0,width:V-2*U}),f.css({position:"absolute",top:T.menuBarHeight,width:V-2*U-(H?0:f.outerWidth()-f.width())})):x>=m-T.toolsHeight-T.adminBarHeight+q-N&&(I=!1,s.css({position:"absolute",top:q-N,width:V}),H&&A.length&&A.css({position:"absolute",top:q-N,width:V-2*U}),f.css({position:"absolute",top:q-N+T.menuBarHeight,width:V-2*U-(H?0:f.outerWidth()-f.width())}))),(!J||G&&S)&&x+T.windowHeight<=p+q+T.bottomHeight+T.statusBarHeight+U?b&&b.deltaHeight>0&&b.deltaHeight<100?a.scrollBy(0,b.deltaHeight):H&&S&&(J=!0,B.css({position:"fixed",bottom:T.bottomHeight,visibility:"",width:V-2*U}),z.css({position:"fixed",bottom:0,width:V})):(!S&&J||(J||G)&&x+T.windowHeight>p+q+T.bottomHeight+T.statusBarHeight-U)&&(J=!1,B.attr("style",S?"":"visibility: hidden;"),z.attr("style",""))):G&&(s.css({position:"absolute",top:0,width:V}),H&&A.length&&A.css({position:"absolute",top:0,width:V-2*U}),f.css({position:"absolute",top:T.menuBarHeight,width:V-2*U-(H?0:f.outerWidth()-f.width())}),B.attr("style",S?"":"visibility: hidden;"),z.attr("style","")),D.width()<300&&T.windowWidth>600&&e.height()>C.height()+R+120&&T.windowHeight<q?(T.sideSortablesHeight+O+P>T.windowHeight||K||L?x+O<=R?(C.attr("style",""),K=L=!1):x>M?K?(K=!1,j=C.offset().top-T.adminBarHeight,k=g.offset().top,k<j+T.sideSortablesHeight+P&&(j=k-T.sideSortablesHeight-12),C.css({position:"absolute",top:j,bottom:""})):!L&&T.sideSortablesHeight+C.offset().top+P<x+T.windowHeight&&(L=!0,C.css({position:"fixed",top:"auto",bottom:P})):x<M&&(L?(L=!1,j=C.offset().top-P,k=g.offset().top,k<j+T.sideSortablesHeight+P&&(j=k-T.sideSortablesHeight-12),C.css({position:"absolute",top:j,bottom:""})):!K&&C.offset().top>=x+O&&(K=!0,C.css({position:"fixed",top:O,bottom:""}))):(x>=R-O?C.css({position:"fixed",top:O}):C.attr("style",""),K=L=!1),M=x):(C.attr("style",""),K=L=!1),G&&(r.css({paddingTop:T.toolsHeight}),H?u.css({paddingTop:T.visualTopHeight+T.menuBarHeight}):w.css({marginTop:T.textTopHeight})))}}function j(){c(),i()}function k(a){for(var b=1;b<6;b++)setTimeout(a,500*b)}function l(){clearTimeout(p),p=setTimeout(i,100)}function m(){a.pageYOffset&&a.pageYOffset>N&&a.scrollTo(a.pageXOffset,0),q.addClass("wp-editor-expand"),d.on("scroll.editor-expand resize.editor-expand",function(a){i(a.type),l()}),e.on("wp-collapse-menu.editor-expand postboxes-columnchange.editor-expand editor-classchange.editor-expand",i).on("postbox-toggled.editor-expand postbox-moved.editor-expand",function(){!K&&!L&&a.pageYOffset>O&&(L=!0,a.scrollBy(0,-1),i(),a.scrollBy(0,1)),i()}).on("wp-window-resized.editor-expand",function(){o&&!o.isHidden()?o.execCommand("wpAutoResize"):c()}),w.on("focus.editor-expand input.editor-expand propertychange.editor-expand",c),G(),F&&F.pubsub.subscribe("hidden",j),o&&(o.settings.wp_autoresize_on=!0,o.execCommand("wpAutoResizeOn"),o.isHidden()||o.execCommand("wpAutoResize")),o&&!o.isHidden()||c(),i(),e.trigger("editor-expand-on")}function n(){var c=parseInt(a.getUserSetting("ed_size",300),10);c<50?c=50:c>5e3&&(c=5e3),a.pageYOffset&&a.pageYOffset>N&&a.scrollTo(a.pageXOffset,0),q.removeClass("wp-editor-expand"),d.off(".editor-expand"),e.off(".editor-expand"),w.off(".editor-expand"),H(),F&&F.pubsub.unsubscribe("hidden",j),b.each([t,v,s,A,z,B,r,u,w,C],function(a,b){b&&b.attr("style","")}),I=J=K=L=!1,o&&(o.settings.wp_autoresize_on=!1,o.execCommand("wpAutoResizeOff"),o.isHidden()||(w.hide(),c&&o.theme.resizeTo(null,c))),c&&w.height(c),e.trigger("editor-expand-off")}var o,p,q=b("#postdivrich"),r=b("#wp-content-wrap"),s=b("#wp-content-editor-tools"),t=b(),u=b(),v=b("#ed_toolbar"),w=b("#content"),x=w[0],y=0,z=b("#post-status-info"),A=b(),B=b(),C=b("#side-sortables"),D=b("#postbox-container-1"),E=b("#post-body"),F=a.wp.editor&&a.wp.editor.fullscreen,G=function(){},H=function(){},I=!1,J=!1,K=!1,L=!1,M=0,N=130,O=56,P=20,Q=300,R=r.hasClass("tmce-active")?"tinymce":"html",S=!!parseInt(a.getUserSetting("hidetb"),10),T={windowHeight:0,windowWidth:0,adminBarHeight:0,toolsHeight:0,menuBarHeight:0,visualTopHeight:0,textTopHeight:0,bottomHeight:0,statusBarHeight:0,sideSortablesHeight:0},U=a._.throttle(function(){var b=a.scrollX||document.documentElement.scrollLeft,c=a.scrollY||document.documentElement.scrollTop,d=parseInt(x.style.height,10);x.style.height=Q+"px",x.scrollHeight>Q&&(x.style.height=x.scrollHeight+"px"),"undefined"!=typeof b&&a.scrollTo(b,c),x.scrollHeight<d&&i()},300);e.on("tinymce-editor-init.editor-expand",function(e,f){function g(){var a,b,c,d=f.selection.getNode();if(f.wp&&f.wp.getView&&(b=f.wp.getView(d)))c=b.getBoundingClientRect();else{a=f.selection.getRng();try{c=a.getClientRects()[0]}catch(e){}c||(c=d.getBoundingClientRect())}return!!c.height&&c}function h(a){var b=a.keyCode;b<=47&&b!==s.SPACEBAR&&b!==s.ENTER&&b!==s.DELETE&&b!==s.BACKSPACE&&b!==s.UP&&b!==s.LEFT&&b!==s.DOWN&&b!==s.UP||b>=91&&b<=93||b>=112&&b<=123||144===b||145===b||j(b)}function j(b){var c,d,e,h,i=g(),j=50;i&&(c=i.top+f.iframeElement.getBoundingClientRect().top,d=c+i.height,c-=j,d+=j,e=T.adminBarHeight+T.toolsHeight+T.menuBarHeight+T.visualTopHeight,h=T.windowHeight-(S?T.bottomHeight+T.statusBarHeight:0),h-e<i.height||(c<e&&(b===s.UP||b===s.LEFT||b===s.BACKSPACE)?a.scrollTo(a.pageXOffset,c+a.pageYOffset-e):d>h&&a.scrollTo(a.pageXOffset,d+a.pageYOffset-h)))}function l(a){a.state||i()}function m(){d.on("scroll.mce-float-panels",v),setTimeout(function(){f.execCommand("wpAutoResize"),i()},300)}function n(){d.off("scroll.mce-float-panels"),setTimeout(function(){var b=r.offset().top;a.pageYOffset>b&&a.scrollTo(a.pageXOffset,b-T.adminBarHeight),c(),i()},100),i()}function p(){S=!S}var s=a.tinymce.util.VK,v=_.debounce(function(){!b(".mce-floatpanel:hover").length&&a.tinymce.ui.FloatPanel.hideAll(),b(".mce-tooltip").hide()},1e3,!0);"content"===f.id&&(o=f,f.settings.autoresize_min_height=Q,t=r.find(".mce-toolbar-grp"),u=r.find(".mce-edit-area"),B=r.find(".mce-statusbar"),A=r.find(".mce-menubar"),G=function(){f.on("keyup",h),f.on("show",m),f.on("hide",n),f.on("wp-toolbar-toggle",p),f.on("setcontent wp-autoresize wp-toolbar-toggle",i),f.on("undo redo",j),f.on("FullscreenStateChanged",l),d.off("scroll.mce-float-panels").on("scroll.mce-float-panels",v)},H=function(){f.off("keyup",h),f.off("show",m),f.off("hide",n),f.off("wp-toolbar-toggle",p),f.off("setcontent wp-autoresize wp-toolbar-toggle",i),f.off("undo redo",j),f.off("FullscreenStateChanged",l),d.off("scroll.mce-float-panels")},q.hasClass("wp-editor-expand")&&(G(),k(i)))}),q.hasClass("wp-editor-expand")&&(m(),r.hasClass("html-active")&&k(function(){i(),c()})),b("#adv-settings .editor-expand").show(),b("#editor-expand-toggle").on("change.editor-expand",function(){b(this).prop("checked")?(m(),a.setUserSetting("editor_expand","on")):(n(),a.setUserSetting("editor_expand","off"))}),a.editorExpand={on:m,off:n}}),b(function(){function c(){z=J.offset(),z.right=z.left+J.outerWidth(),z.bottom=z.top+J.outerHeight()}function h(){S||(S=!0,e.trigger("dfw-activate"),L.on("keydown.focus-shortcut",v))}function i(){S&&(l(),S=!1,e.trigger("dfw-deactivate"),L.off("keydown.focus-shortcut"))}function j(){return S}function k(){!T&&S&&(T=!0,L.on("keydown.focus",o),K.add(L).on("blur.focus",q),o(),a.setUserSetting("post_dfw","on"),e.trigger("dfw-on"))}function l(){T&&(T=!1,K.add(L).off(".focus"),p(),J.off(".focus"),a.setUserSetting("post_dfw","off"),e.trigger("dfw-off"))}function m(){T?l():k()}function n(){return T}function o(b){var e,f=b&&b.keyCode;return a.navigator.platform&&(e=a.navigator.platform.indexOf("Mac")>-1),27===f||87===f&&b.altKey&&(!e&&b.shiftKey||e&&b.ctrlKey)?void p(b):void(b&&(b.metaKey||b.ctrlKey&&!b.altKey||b.altKey&&b.shiftKey||f&&(f<=47&&8!==f&&13!==f&&32!==f&&46!==f||f>=91&&f<=93||f>=112&&f<=135||f>=144&&f<=150||f>=224))||(w||(w=!0,clearTimeout(F),F=setTimeout(function(){M.show()},600),J.css("z-index",9998),M.on("mouseenter.focus",function(){c(),d.on("scroll.focus",function(){var b=a.pageYOffset;D&&C&&D!==b&&(C<z.top-W||C>z.bottom+W)&&p(),D=b})}).on("mouseleave.focus",function(){A=B=null,U=V=0,d.off("scroll.focus")}).on("mousemove.focus",function(b){var c=b.clientX,d=b.clientY,e=a.pageYOffset,f=a.pageXOffset;if(A&&B&&(c!==A||d!==B))if(d<=B&&d<z.top-e||d>=B&&d>z.bottom-e||c<=A&&c<z.left-f||c>=A&&c>z.right-f){if(U+=Math.abs(A-c),V+=Math.abs(B-d),(d<=z.top-W-e||d>=z.bottom+W-e||c<=z.left-W-f||c>=z.right+W-f)&&(U>10||V>10))return p(),A=B=null,void(U=V=0)}else U=V=0;A=c,B=d}).on("touchstart.focus",function(a){a.preventDefault(),p()}),J.off("mouseenter.focus"),E&&(clearTimeout(E),E=null),H.addClass("focus-on").removeClass("focus-off")),r(),t()))}function p(a){w&&(w=!1,clearTimeout(F),F=setTimeout(function(){M.hide()},200),J.css("z-index",""),M.off("mouseenter.focus mouseleave.focus mousemove.focus touchstart.focus"),"undefined"==typeof a&&J.on("mouseenter.focus",function(){(b.contains(J.get(0),document.activeElement)||G)&&o()}),E=setTimeout(function(){E=null,J.off("mouseenter.focus")},1e3),H.addClass("focus-off").removeClass("focus-on")),s(),u()}function q(){setTimeout(function(){function a(a){return b.contains(a.get(0),document.activeElement)}var c=document.activeElement.compareDocumentPosition(J.get(0));2!==c&&4!==c||!(a(P)||a(I)||a(g))||p()},0)}function r(){!x&&w&&(x=!0,f.on("mouseenter.focus",function(){f.addClass("focus-off")}).on("mouseleave.focus",function(){f.removeClass("focus-off")}))}function s(){x&&(x=!1,f.off(".focus"))}function t(){y||!w||N.find(":focus").length||(y=!0,N.stop().fadeTo("fast",.3).on("mouseenter.focus",u).off("mouseleave.focus"),O.on("focus.focus",u).off("blur.focus"))}function u(){y&&(y=!1,N.stop().fadeTo("fast",1).on("mouseleave.focus",t).off("mouseenter.focus"),O.on("blur.focus",t).off("focus.focus"))}function v(a){a.altKey&&a.shiftKey&&87===a.keyCode&&m()}var w,x,y,z,A,B,C,D,E,F,G,H=b(document.body),I=b("#wpcontent"),J=b("#post-body-content"),K=b("#title"),L=b("#content"),M=b(document.createElement("DIV")),N=b("#edit-slug-box"),O=N.find("a").add(N.find("button")).add(N.find("input")),P=b("#adminmenuwrap"),Q=b(),R=b(),S="on"===a.getUserSetting("editor_expand","on"),T=!!S&&"on"===a.getUserSetting("post_dfw"),U=0,V=0,W=20;H.append(M),M.css({display:"none",position:"fixed",top:f.height(),right:0,bottom:0,left:0,"z-index":9997}),J.css({position:"relative"}),d.on("mousemove.focus",function(a){C=a.pageY}),b("#postdivrich").hasClass("wp-editor-expand")&&L.on("keydown.focus-shortcut",v),e.on("tinymce-editor-setup.focus",function(a,b){b.addButton("dfw",{active:T,classes:"wp-dfw btn widget",disabled:!S,onclick:m,onPostRender:function(){var a=this;e.on("dfw-activate.focus",function(){a.disabled(!1)}).on("dfw-deactivate.focus",function(){a.disabled(!0)}).on("dfw-on.focus",function(){a.active(!0)}).on("dfw-off.focus",function(){a.active(!1)})},tooltip:"Distraction-free writing mode",shortcut:"Alt+Shift+W"}),b.addCommand("wpToggleDFW",m),b.addShortcut("access+w","","wpToggleDFW")}),e.on("tinymce-editor-init.focus",function(a,d){function f(){G=!0}function g(){G=!1}var h,i;"content"===d.id&&(Q=b(d.getWin()),R=b(d.getContentAreaContainer()).find("iframe"),h=function(){d.on("keydown",o),d.on("blur",q),d.on("focus",f),d.on("blur",g),d.on("wp-autoresize",c)},i=function(){d.off("keydown",o),d.off("blur",q),d.off("focus",f),d.off("blur",g),d.off("wp-autoresize",c)},T&&h(),e.on("dfw-on.focus",h).on("dfw-off.focus",i),d.on("click",function(a){a.target===d.getDoc().documentElement&&d.focus()}))}),e.on("quicktags-init",function(a,c){var d;c.settings.buttons&&(","+c.settings.buttons+",").indexOf(",dfw,")!==-1&&(d=b("#"+c.name+"_dfw"),b(document).on("dfw-activate",function(){d.prop("disabled",!1)}).on("dfw-deactivate",function(){d.prop("disabled",!0)}).on("dfw-on",function(){d.addClass("active")}).on("dfw-off",function(){d.removeClass("active")}))}),e.on("editor-expand-on.focus",h).on("editor-expand-off.focus",i),T&&(L.on("keydown.focus",o),K.add(L).on("blur.focus",q)),a.wp=a.wp||{},a.wp.editor=a.wp.editor||{},a.wp.editor.dfw={activate:h,deactivate:i,isActive:j,on:k,off:l,toggle:m,isOn:n}})}(window,window.jQuery);
|
lib/classic-editor/js/editor.js
ADDED
@@ -0,0 +1,1436 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
5 |
+
|
6 |
+
/**
|
7 |
+
* @summary Utility functions for the editor.
|
8 |
+
*
|
9 |
+
* @since 2.5.0
|
10 |
+
*/
|
11 |
+
function SwitchEditors() {
|
12 |
+
var tinymce, $$,
|
13 |
+
exports = {};
|
14 |
+
|
15 |
+
function init() {
|
16 |
+
if ( ! tinymce && window.tinymce ) {
|
17 |
+
tinymce = window.tinymce;
|
18 |
+
$$ = tinymce.$;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* @summary Handles onclick events for the Visual/Text tabs.
|
22 |
+
*
|
23 |
+
* @since 4.3.0
|
24 |
+
*
|
25 |
+
* @returns {void}
|
26 |
+
*/
|
27 |
+
$$( document ).on( 'click', function( event ) {
|
28 |
+
var id, mode,
|
29 |
+
target = $$( event.target );
|
30 |
+
|
31 |
+
if ( target.hasClass( 'wp-switch-editor' ) ) {
|
32 |
+
id = target.attr( 'data-wp-editor-id' );
|
33 |
+
mode = target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
|
34 |
+
switchEditor( id, mode );
|
35 |
+
}
|
36 |
+
});
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* @summary Returns the height of the editor toolbar(s) in px.
|
42 |
+
*
|
43 |
+
* @since 3.9.0
|
44 |
+
*
|
45 |
+
* @param {Object} editor The TinyMCE editor.
|
46 |
+
* @returns {number} If the height is between 10 and 200 return the height,
|
47 |
+
* else return 30.
|
48 |
+
*/
|
49 |
+
function getToolbarHeight( editor ) {
|
50 |
+
var node = $$( '.mce-toolbar-grp', editor.getContainer() )[0],
|
51 |
+
height = node && node.clientHeight;
|
52 |
+
|
53 |
+
if ( height && height > 10 && height < 200 ) {
|
54 |
+
return parseInt( height, 10 );
|
55 |
+
}
|
56 |
+
|
57 |
+
return 30;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* @summary Switches the editor between Visual and Text mode.
|
62 |
+
*
|
63 |
+
* @since 2.5.0
|
64 |
+
*
|
65 |
+
* @memberof switchEditors
|
66 |
+
*
|
67 |
+
* @param {string} id The id of the editor you want to change the editor mode for. Default: `content`.
|
68 |
+
* @param {string} mode The mode you want to switch to. Default: `toggle`.
|
69 |
+
* @returns {void}
|
70 |
+
*/
|
71 |
+
function switchEditor( id, mode ) {
|
72 |
+
id = id || 'content';
|
73 |
+
mode = mode || 'toggle';
|
74 |
+
|
75 |
+
var editorHeight, toolbarHeight, iframe,
|
76 |
+
editor = tinymce.get( id ),
|
77 |
+
wrap = $$( '#wp-' + id + '-wrap' ),
|
78 |
+
$textarea = $$( '#' + id ),
|
79 |
+
textarea = $textarea[0];
|
80 |
+
|
81 |
+
if ( 'toggle' === mode ) {
|
82 |
+
if ( editor && ! editor.isHidden() ) {
|
83 |
+
mode = 'html';
|
84 |
+
} else {
|
85 |
+
mode = 'tmce';
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
if ( 'tmce' === mode || 'tinymce' === mode ) {
|
90 |
+
// If the editor is visible we are already in `tinymce` mode.
|
91 |
+
if ( editor && ! editor.isHidden() ) {
|
92 |
+
return false;
|
93 |
+
}
|
94 |
+
|
95 |
+
// Insert closing tags for any open tags in QuickTags.
|
96 |
+
if ( typeof( window.QTags ) !== 'undefined' ) {
|
97 |
+
window.QTags.closeAllTags( id );
|
98 |
+
}
|
99 |
+
|
100 |
+
editorHeight = parseInt( textarea.style.height, 10 ) || 0;
|
101 |
+
|
102 |
+
var keepSelection = false;
|
103 |
+
if ( editor ) {
|
104 |
+
keepSelection = editor.getParam( 'wp_keep_scroll_position' );
|
105 |
+
} else {
|
106 |
+
keepSelection = window.tinyMCEPreInit.mceInit[ id ] &&
|
107 |
+
window.tinyMCEPreInit.mceInit[ id ].wp_keep_scroll_position;
|
108 |
+
}
|
109 |
+
|
110 |
+
if ( keepSelection ) {
|
111 |
+
// Save the selection
|
112 |
+
addHTMLBookmarkInTextAreaContent( $textarea );
|
113 |
+
}
|
114 |
+
|
115 |
+
if ( editor ) {
|
116 |
+
editor.show();
|
117 |
+
|
118 |
+
// No point to resize the iframe in iOS.
|
119 |
+
if ( ! tinymce.Env.iOS && editorHeight ) {
|
120 |
+
toolbarHeight = getToolbarHeight( editor );
|
121 |
+
editorHeight = editorHeight - toolbarHeight + 14;
|
122 |
+
|
123 |
+
// Sane limit for the editor height.
|
124 |
+
if ( editorHeight > 50 && editorHeight < 5000 ) {
|
125 |
+
editor.theme.resizeTo( null, editorHeight );
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
if ( editor.getParam( 'wp_keep_scroll_position' ) ) {
|
130 |
+
// Restore the selection
|
131 |
+
focusHTMLBookmarkInVisualEditor( editor );
|
132 |
+
}
|
133 |
+
} else {
|
134 |
+
tinymce.init( window.tinyMCEPreInit.mceInit[ id ] );
|
135 |
+
}
|
136 |
+
|
137 |
+
wrap.removeClass( 'html-active' ).addClass( 'tmce-active' );
|
138 |
+
$textarea.attr( 'aria-hidden', true );
|
139 |
+
window.setUserSetting( 'editor', 'tinymce' );
|
140 |
+
|
141 |
+
} else if ( 'html' === mode ) {
|
142 |
+
// If the editor is hidden (Quicktags is shown) we don't need to switch.
|
143 |
+
if ( editor && editor.isHidden() ) {
|
144 |
+
return false;
|
145 |
+
}
|
146 |
+
|
147 |
+
if ( editor ) {
|
148 |
+
// Don't resize the textarea in iOS. The iframe is forced to 100% height there, we shouldn't match it.
|
149 |
+
if ( ! tinymce.Env.iOS ) {
|
150 |
+
iframe = editor.iframeElement;
|
151 |
+
editorHeight = iframe ? parseInt( iframe.style.height, 10 ) : 0;
|
152 |
+
|
153 |
+
if ( editorHeight ) {
|
154 |
+
toolbarHeight = getToolbarHeight( editor );
|
155 |
+
editorHeight = editorHeight + toolbarHeight - 14;
|
156 |
+
|
157 |
+
// Sane limit for the textarea height.
|
158 |
+
if ( editorHeight > 50 && editorHeight < 5000 ) {
|
159 |
+
textarea.style.height = editorHeight + 'px';
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
var selectionRange = null;
|
165 |
+
|
166 |
+
if ( editor.getParam( 'wp_keep_scroll_position' ) ) {
|
167 |
+
selectionRange = findBookmarkedPosition( editor );
|
168 |
+
}
|
169 |
+
|
170 |
+
editor.hide();
|
171 |
+
|
172 |
+
if ( selectionRange ) {
|
173 |
+
selectTextInTextArea( editor, selectionRange );
|
174 |
+
}
|
175 |
+
} else {
|
176 |
+
// There is probably a JS error on the page. The TinyMCE editor instance doesn't exist. Show the textarea.
|
177 |
+
$textarea.css({ 'display': '', 'visibility': '' });
|
178 |
+
}
|
179 |
+
|
180 |
+
wrap.removeClass( 'tmce-active' ).addClass( 'html-active' );
|
181 |
+
$textarea.attr( 'aria-hidden', false );
|
182 |
+
window.setUserSetting( 'editor', 'html' );
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* @summary Checks if a cursor is inside an HTML tag.
|
188 |
+
*
|
189 |
+
* In order to prevent breaking HTML tags when selecting text, the cursor
|
190 |
+
* must be moved to either the start or end of the tag.
|
191 |
+
*
|
192 |
+
* This will prevent the selection marker to be inserted in the middle of an HTML tag.
|
193 |
+
*
|
194 |
+
* This function gives information whether the cursor is inside a tag or not, as well as
|
195 |
+
* the tag type, if it is a closing tag and check if the HTML tag is inside a shortcode tag,
|
196 |
+
* e.g. `[caption]<img.../>..`.
|
197 |
+
*
|
198 |
+
* @param {string} content The test content where the cursor is.
|
199 |
+
* @param {number} cursorPosition The cursor position inside the content.
|
200 |
+
*
|
201 |
+
* @returns {(null|Object)} Null if cursor is not in a tag, Object if the cursor is inside a tag.
|
202 |
+
*/
|
203 |
+
function getContainingTagInfo( content, cursorPosition ) {
|
204 |
+
var lastLtPos = content.lastIndexOf( '<', cursorPosition - 1 ),
|
205 |
+
lastGtPos = content.lastIndexOf( '>', cursorPosition );
|
206 |
+
|
207 |
+
if ( lastLtPos > lastGtPos || content.substr( cursorPosition, 1 ) === '>' ) {
|
208 |
+
// find what the tag is
|
209 |
+
var tagContent = content.substr( lastLtPos ),
|
210 |
+
tagMatch = tagContent.match( /<\s*(\/)?(\w+)/ );
|
211 |
+
|
212 |
+
if ( ! tagMatch ) {
|
213 |
+
return null;
|
214 |
+
}
|
215 |
+
|
216 |
+
var tagType = tagMatch[2],
|
217 |
+
closingGt = tagContent.indexOf( '>' );
|
218 |
+
|
219 |
+
return {
|
220 |
+
ltPos: lastLtPos,
|
221 |
+
gtPos: lastLtPos + closingGt + 1, // offset by one to get the position _after_ the character,
|
222 |
+
tagType: tagType,
|
223 |
+
isClosingTag: !! tagMatch[1]
|
224 |
+
};
|
225 |
+
}
|
226 |
+
return null;
|
227 |
+
}
|
228 |
+
|
229 |
+
/**
|
230 |
+
* @summary Check if the cursor is inside a shortcode
|
231 |
+
*
|
232 |
+
* If the cursor is inside a shortcode wrapping tag, e.g. `[caption]` it's better to
|
233 |
+
* move the selection marker to before or after the shortcode.
|
234 |
+
*
|
235 |
+
* For example `[caption]` rewrites/removes anything that's between the `[caption]` tag and the
|
236 |
+
* `<img/>` tag inside.
|
237 |
+
*
|
238 |
+
* `[caption]<span>ThisIsGone</span><img .../>[caption]`
|
239 |
+
*
|
240 |
+
* Moving the selection to before or after the short code is better, since it allows to select
|
241 |
+
* something, instead of just losing focus and going to the start of the content.
|
242 |
+
*
|
243 |
+
* @param {string} content The text content to check against.
|
244 |
+
* @param {number} cursorPosition The cursor position to check.
|
245 |
+
*
|
246 |
+
* @return {(undefined|Object)} Undefined if the cursor is not wrapped in a shortcode tag.
|
247 |
+
* Information about the wrapping shortcode tag if it's wrapped in one.
|
248 |
+
*/
|
249 |
+
function getShortcodeWrapperInfo( content, cursorPosition ) {
|
250 |
+
var contentShortcodes = getShortCodePositionsInText( content );
|
251 |
+
|
252 |
+
for ( var i = 0; i < contentShortcodes.length; i++ ) {
|
253 |
+
var element = contentShortcodes[ i ];
|
254 |
+
|
255 |
+
if ( cursorPosition >= element.startIndex && cursorPosition <= element.endIndex ) {
|
256 |
+
return element;
|
257 |
+
}
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
/**
|
262 |
+
* Gets a list of unique shortcodes or shortcode-look-alikes in the content.
|
263 |
+
*
|
264 |
+
* @param {string} content The content we want to scan for shortcodes.
|
265 |
+
*/
|
266 |
+
function getShortcodesInText( content ) {
|
267 |
+
var shortcodes = content.match( /\[+([\w_-])+/g ),
|
268 |
+
result = [];
|
269 |
+
|
270 |
+
if ( shortcodes ) {
|
271 |
+
for ( var i = 0; i < shortcodes.length; i++ ) {
|
272 |
+
var shortcode = shortcodes[ i ].replace( /^\[+/g, '' );
|
273 |
+
|
274 |
+
if ( result.indexOf( shortcode ) === -1 ) {
|
275 |
+
result.push( shortcode );
|
276 |
+
}
|
277 |
+
}
|
278 |
+
}
|
279 |
+
|
280 |
+
return result;
|
281 |
+
}
|
282 |
+
|
283 |
+
/**
|
284 |
+
* @summary Check if a shortcode has Live Preview enabled for it.
|
285 |
+
*
|
286 |
+
* Previewable shortcodes here refers to shortcodes that have Live Preview enabled.
|
287 |
+
*
|
288 |
+
* These shortcodes get rewritten when the editor is in Visual mode, which means that
|
289 |
+
* we don't want to change anything inside them, i.e. inserting a selection marker
|
290 |
+
* inside the shortcode will break it :(
|
291 |
+
*
|
292 |
+
* @link wp-includes/js/mce-view.js
|
293 |
+
*
|
294 |
+
* @param {string} shortcode The shortcode to check.
|
295 |
+
* @return {boolean} If a shortcode has Live Preview or not
|
296 |
+
*/
|
297 |
+
function isShortcodePreviewable( shortcode ) {
|
298 |
+
var defaultPreviewableShortcodes = [ 'caption' ];
|
299 |
+
|
300 |
+
return (
|
301 |
+
defaultPreviewableShortcodes.indexOf( shortcode ) !== -1 ||
|
302 |
+
wp.mce.views.get( shortcode ) !== undefined
|
303 |
+
);
|
304 |
+
|
305 |
+
}
|
306 |
+
|
307 |
+
/**
|
308 |
+
* @summary Get all shortcodes and their positions in the content
|
309 |
+
*
|
310 |
+
* This function returns all the shortcodes that could be found in the textarea content
|
311 |
+
* along with their character positions and boundaries.
|
312 |
+
*
|
313 |
+
* This is used to check if the selection cursor is inside the boundaries of a shortcode
|
314 |
+
* and move it accordingly, to avoid breakage.
|
315 |
+
*
|
316 |
+
* @link adjustTextAreaSelectionCursors
|
317 |
+
*
|
318 |
+
* The information can also be used in other cases when we need to lookup shortcode data,
|
319 |
+
* as it's already structured!
|
320 |
+
*
|
321 |
+
* @param {string} content The content we want to scan for shortcodes
|
322 |
+
*/
|
323 |
+
function getShortCodePositionsInText( content ) {
|
324 |
+
var allShortcodes = getShortcodesInText( content ), shortcodeInfo;
|
325 |
+
|
326 |
+
if ( allShortcodes.length === 0 ) {
|
327 |
+
return [];
|
328 |
+
}
|
329 |
+
|
330 |
+
var shortcodeDetailsRegexp = wp.shortcode.regexp( allShortcodes.join( '|' ) ),
|
331 |
+
shortcodeMatch, // Define local scope for the variable to be used in the loop below.
|
332 |
+
shortcodesDetails = [];
|
333 |
+
|
334 |
+
while ( shortcodeMatch = shortcodeDetailsRegexp.exec( content ) ) {
|
335 |
+
/**
|
336 |
+
* Check if the shortcode should be shown as plain text.
|
337 |
+
*
|
338 |
+
* This corresponds to the [[shortcode]] syntax, which doesn't parse the shortcode
|
339 |
+
* and just shows it as text.
|
340 |
+
*/
|
341 |
+
var showAsPlainText = shortcodeMatch[1] === '[';
|
342 |
+
|
343 |
+
/**
|
344 |
+
* For more context check the docs for:
|
345 |
+
*
|
346 |
+
* @link isShortcodePreviewable
|
347 |
+
*
|
348 |
+
* In addition, if the shortcode will get rendered as plain text ( see above ),
|
349 |
+
* we can treat it as text and use the selection markers in it.
|
350 |
+
*/
|
351 |
+
var isPreviewable = ! showAsPlainText && isShortcodePreviewable( shortcodeMatch[2] );
|
352 |
+
|
353 |
+
shortcodeInfo = {
|
354 |
+
shortcodeName: shortcodeMatch[2],
|
355 |
+
showAsPlainText: showAsPlainText,
|
356 |
+
startIndex: shortcodeMatch.index,
|
357 |
+
endIndex: shortcodeMatch.index + shortcodeMatch[0].length,
|
358 |
+
length: shortcodeMatch[0].length,
|
359 |
+
isPreviewable: isPreviewable
|
360 |
+
};
|
361 |
+
|
362 |
+
shortcodesDetails.push( shortcodeInfo );
|
363 |
+
}
|
364 |
+
|
365 |
+
/**
|
366 |
+
* Get all URL matches, and treat them as embeds.
|
367 |
+
*
|
368 |
+
* Since there isn't a good way to detect if a URL by itself on a line is a previewable
|
369 |
+
* object, it's best to treat all of them as such.
|
370 |
+
*
|
371 |
+
* This means that the selection will capture the whole URL, in a similar way shrotcodes
|
372 |
+
* are treated.
|
373 |
+
*/
|
374 |
+
var urlRegexp = new RegExp(
|
375 |
+
'(^|[\\n\\r][\\n\\r]|<p>)(https?:\\/\\/[^\s"]+?)(<\\/p>\s*|[\\n\\r][\\n\\r]|$)', 'gi'
|
376 |
+
);
|
377 |
+
|
378 |
+
while ( shortcodeMatch = urlRegexp.exec( content ) ) {
|
379 |
+
shortcodeInfo = {
|
380 |
+
shortcodeName: 'url',
|
381 |
+
showAsPlainText: false,
|
382 |
+
startIndex: shortcodeMatch.index,
|
383 |
+
endIndex: shortcodeMatch.index + shortcodeMatch[ 0 ].length,
|
384 |
+
length: shortcodeMatch[ 0 ].length,
|
385 |
+
isPreviewable: true,
|
386 |
+
urlAtStartOfContent: shortcodeMatch[ 1 ] === '',
|
387 |
+
urlAtEndOfContent: shortcodeMatch[ 3 ] === ''
|
388 |
+
};
|
389 |
+
|
390 |
+
shortcodesDetails.push( shortcodeInfo );
|
391 |
+
}
|
392 |
+
|
393 |
+
return shortcodesDetails;
|
394 |
+
}
|
395 |
+
|
396 |
+
/**
|
397 |
+
* Generate a cursor marker element to be inserted in the content.
|
398 |
+
*
|
399 |
+
* `span` seems to be the least destructive element that can be used.
|
400 |
+
*
|
401 |
+
* Using DomQuery syntax to create it, since it's used as both text and as a DOM element.
|
402 |
+
*
|
403 |
+
* @param {Object} domLib DOM library instance.
|
404 |
+
* @param {string} content The content to insert into the cusror marker element.
|
405 |
+
*/
|
406 |
+
function getCursorMarkerSpan( domLib, content ) {
|
407 |
+
return domLib( '<span>' ).css( {
|
408 |
+
display: 'inline-block',
|
409 |
+
width: 0,
|
410 |
+
overflow: 'hidden',
|
411 |
+
'line-height': 0
|
412 |
+
} )
|
413 |
+
.html( content ? content : '' );
|
414 |
+
}
|
415 |
+
|
416 |
+
/**
|
417 |
+
* @summary Get adjusted selection cursor positions according to HTML tags/shortcodes
|
418 |
+
*
|
419 |
+
* Shortcodes and HTML codes are a bit of a special case when selecting, since they may render
|
420 |
+
* content in Visual mode. If we insert selection markers somewhere inside them, it's really possible
|
421 |
+
* to break the syntax and render the HTML tag or shortcode broken.
|
422 |
+
*
|
423 |
+
* @link getShortcodeWrapperInfo
|
424 |
+
*
|
425 |
+
* @param {string} content Textarea content that the cursors are in
|
426 |
+
* @param {{cursorStart: number, cursorEnd: number}} cursorPositions Cursor start and end positions
|
427 |
+
*
|
428 |
+
* @return {{cursorStart: number, cursorEnd: number}}
|
429 |
+
*/
|
430 |
+
function adjustTextAreaSelectionCursors( content, cursorPositions ) {
|
431 |
+
var voidElements = [
|
432 |
+
'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input',
|
433 |
+
'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'
|
434 |
+
];
|
435 |
+
|
436 |
+
var cursorStart = cursorPositions.cursorStart,
|
437 |
+
cursorEnd = cursorPositions.cursorEnd,
|
438 |
+
// check if the cursor is in a tag and if so, adjust it
|
439 |
+
isCursorStartInTag = getContainingTagInfo( content, cursorStart );
|
440 |
+
|
441 |
+
if ( isCursorStartInTag ) {
|
442 |
+
/**
|
443 |
+
* Only move to the start of the HTML tag (to select the whole element) if the tag
|
444 |
+
* is part of the voidElements list above.
|
445 |
+
*
|
446 |
+
* This list includes tags that are self-contained and don't need a closing tag, according to the
|
447 |
+
* HTML5 specification.
|
448 |
+
*
|
449 |
+
* This is done in order to make selection of text a bit more consistent when selecting text in
|
450 |
+
* `<p>` tags or such.
|
451 |
+
*
|
452 |
+
* In cases where the tag is not a void element, the cursor is put to the end of the tag,
|
453 |
+
* so it's either between the opening and closing tag elements or after the closing tag.
|
454 |
+
*/
|
455 |
+
if ( voidElements.indexOf( isCursorStartInTag.tagType ) !== -1 ) {
|
456 |
+
cursorStart = isCursorStartInTag.ltPos;
|
457 |
+
} else {
|
458 |
+
cursorStart = isCursorStartInTag.gtPos;
|
459 |
+
}
|
460 |
+
}
|
461 |
+
|
462 |
+
var isCursorEndInTag = getContainingTagInfo( content, cursorEnd );
|
463 |
+
if ( isCursorEndInTag ) {
|
464 |
+
cursorEnd = isCursorEndInTag.gtPos;
|
465 |
+
}
|
466 |
+
|
467 |
+
var isCursorStartInShortcode = getShortcodeWrapperInfo( content, cursorStart );
|
468 |
+
if ( isCursorStartInShortcode && isCursorStartInShortcode.isPreviewable ) {
|
469 |
+
/**
|
470 |
+
* If a URL is at the start or the end of the content,
|
471 |
+
* the selection doesn't work, because it inserts a marker in the text,
|
472 |
+
* which breaks the embedURL detection.
|
473 |
+
*
|
474 |
+
* The best way to avoid that and not modify the user content is to
|
475 |
+
* adjust the cursor to either after or before URL.
|
476 |
+
*/
|
477 |
+
if ( isCursorStartInShortcode.urlAtStartOfContent ) {
|
478 |
+
cursorStart = isCursorStartInShortcode.endIndex;
|
479 |
+
} else {
|
480 |
+
cursorStart = isCursorStartInShortcode.startIndex;
|
481 |
+
}
|
482 |
+
}
|
483 |
+
|
484 |
+
var isCursorEndInShortcode = getShortcodeWrapperInfo( content, cursorEnd );
|
485 |
+
if ( isCursorEndInShortcode && isCursorEndInShortcode.isPreviewable ) {
|
486 |
+
if ( isCursorEndInShortcode.urlAtEndOfContent ) {
|
487 |
+
cursorEnd = isCursorEndInShortcode.startIndex;
|
488 |
+
} else {
|
489 |
+
cursorEnd = isCursorEndInShortcode.endIndex;
|
490 |
+
}
|
491 |
+
}
|
492 |
+
|
493 |
+
return {
|
494 |
+
cursorStart: cursorStart,
|
495 |
+
cursorEnd: cursorEnd
|
496 |
+
};
|
497 |
+
}
|
498 |
+
|
499 |
+
/**
|
500 |
+
* @summary Adds text selection markers in the editor textarea.
|
501 |
+
*
|
502 |
+
* Adds selection markers in the content of the editor `textarea`.
|
503 |
+
* The method directly manipulates the `textarea` content, to allow TinyMCE plugins
|
504 |
+
* to run after the markers are added.
|
505 |
+
*
|
506 |
+
* @param {object} $textarea TinyMCE's textarea wrapped as a DomQuery object
|
507 |
+
*/
|
508 |
+
function addHTMLBookmarkInTextAreaContent( $textarea ) {
|
509 |
+
if ( ! $textarea || ! $textarea.length ) {
|
510 |
+
// If no valid $textarea object is provided, there's nothing we can do.
|
511 |
+
return;
|
512 |
+
}
|
513 |
+
|
514 |
+
var textArea = $textarea[0],
|
515 |
+
textAreaContent = textArea.value,
|
516 |
+
|
517 |
+
adjustedCursorPositions = adjustTextAreaSelectionCursors( textAreaContent, {
|
518 |
+
cursorStart: textArea.selectionStart,
|
519 |
+
cursorEnd: textArea.selectionEnd
|
520 |
+
} ),
|
521 |
+
|
522 |
+
htmlModeCursorStartPosition = adjustedCursorPositions.cursorStart,
|
523 |
+
htmlModeCursorEndPosition = adjustedCursorPositions.cursorEnd,
|
524 |
+
|
525 |
+
mode = htmlModeCursorStartPosition !== htmlModeCursorEndPosition ? 'range' : 'single',
|
526 |
+
|
527 |
+
selectedText = null,
|
528 |
+
cursorMarkerSkeleton = getCursorMarkerSpan( $$, '' ).attr( 'data-mce-type','bookmark' );
|
529 |
+
|
530 |
+
if ( mode === 'range' ) {
|
531 |
+
var markedText = textArea.value.slice( htmlModeCursorStartPosition, htmlModeCursorEndPosition ),
|
532 |
+
bookMarkEnd = cursorMarkerSkeleton.clone().addClass( 'mce_SELRES_end' );
|
533 |
+
|
534 |
+
selectedText = [
|
535 |
+
markedText,
|
536 |
+
bookMarkEnd[0].outerHTML
|
537 |
+
].join( '' );
|
538 |
+
}
|
539 |
+
|
540 |
+
textArea.value = [
|
541 |
+
textArea.value.slice( 0, htmlModeCursorStartPosition ), // text until the cursor/selection position
|
542 |
+
cursorMarkerSkeleton.clone() // cursor/selection start marker
|
543 |
+
.addClass( 'mce_SELRES_start' )[0].outerHTML,
|
544 |
+
selectedText, // selected text with end cursor/position marker
|
545 |
+
textArea.value.slice( htmlModeCursorEndPosition ) // text from last cursor/selection position to end
|
546 |
+
].join( '' );
|
547 |
+
}
|
548 |
+
|
549 |
+
/**
|
550 |
+
* @summary Focus the selection markers in Visual mode.
|
551 |
+
*
|
552 |
+
* The method checks for existing selection markers inside the editor DOM (Visual mode)
|
553 |
+
* and create a selection between the two nodes using the DOM `createRange` selection API
|
554 |
+
*
|
555 |
+
* If there is only a single node, select only the single node through TinyMCE's selection API
|
556 |
+
*
|
557 |
+
* @param {Object} editor TinyMCE editor instance.
|
558 |
+
*/
|
559 |
+
function focusHTMLBookmarkInVisualEditor( editor ) {
|
560 |
+
var startNode = editor.$( '.mce_SELRES_start' ).attr( 'data-mce-bogus', 1 ),
|
561 |
+
endNode = editor.$( '.mce_SELRES_end' ).attr( 'data-mce-bogus', 1 );
|
562 |
+
|
563 |
+
if ( startNode.length ) {
|
564 |
+
editor.focus();
|
565 |
+
|
566 |
+
if ( ! endNode.length ) {
|
567 |
+
editor.selection.select( startNode[0] );
|
568 |
+
} else {
|
569 |
+
var selection = editor.getDoc().createRange();
|
570 |
+
|
571 |
+
selection.setStartAfter( startNode[0] );
|
572 |
+
selection.setEndBefore( endNode[0] );
|
573 |
+
|
574 |
+
editor.selection.setRng( selection );
|
575 |
+
}
|
576 |
+
}
|
577 |
+
|
578 |
+
if ( editor.getParam( 'wp_keep_scroll_position' ) ) {
|
579 |
+
scrollVisualModeToStartElement( editor, startNode );
|
580 |
+
}
|
581 |
+
|
582 |
+
removeSelectionMarker( startNode );
|
583 |
+
removeSelectionMarker( endNode );
|
584 |
+
}
|
585 |
+
|
586 |
+
/**
|
587 |
+
* @summary Remove selection marker and the parent node if it is an empty paragraph.
|
588 |
+
*
|
589 |
+
* By default TinyMCE wraps loose inline tags in a `<p>`.
|
590 |
+
* When removing selection markers an empty `<p>` may be left behind, remove it.
|
591 |
+
*
|
592 |
+
* @param {object} $marker The marker to be removed from the editor DOM, wrapped in an instnce of `editor.$`
|
593 |
+
*/
|
594 |
+
function removeSelectionMarker( $marker ) {
|
595 |
+
var $markerParent = $marker.parent();
|
596 |
+
|
597 |
+
$marker.remove();
|
598 |
+
|
599 |
+
//Remove empty paragraph left over after removing the marker.
|
600 |
+
if ( $markerParent.is( 'p' ) && ! $markerParent.children().length && ! $markerParent.text() ) {
|
601 |
+
$markerParent.remove();
|
602 |
+
}
|
603 |
+
}
|
604 |
+
|
605 |
+
/**
|
606 |
+
* @summary Scrolls the content to place the selected element in the center of the screen.
|
607 |
+
*
|
608 |
+
* Takes an element, that is usually the selection start element, selected in
|
609 |
+
* `focusHTMLBookmarkInVisualEditor()` and scrolls the screen so the element appears roughly
|
610 |
+
* in the middle of the screen.
|
611 |
+
*
|
612 |
+
* I order to achieve the proper positioning, the editor media bar and toolbar are subtracted
|
613 |
+
* from the window height, to get the proper viewport window, that the user sees.
|
614 |
+
*
|
615 |
+
* @param {Object} editor TinyMCE editor instance.
|
616 |
+
* @param {Object} element HTMLElement that should be scrolled into view.
|
617 |
+
*/
|
618 |
+
function scrollVisualModeToStartElement( editor, element ) {
|
619 |
+
var elementTop = editor.$( element ).offset().top,
|
620 |
+
TinyMCEContentAreaTop = editor.$( editor.getContentAreaContainer() ).offset().top,
|
621 |
+
|
622 |
+
toolbarHeight = getToolbarHeight( editor ),
|
623 |
+
|
624 |
+
edTools = $( '#wp-content-editor-tools' ),
|
625 |
+
edToolsHeight = 0,
|
626 |
+
edToolsOffsetTop = 0;
|
627 |
+
|
628 |
+
if ( edTools.length ) {
|
629 |
+
edToolsHeight = edTools.height();
|
630 |
+
edToolsOffsetTop = edTools.offset().top;
|
631 |
+
}
|
632 |
+
|
633 |
+
var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
|
634 |
+
|
635 |
+
selectionPosition = TinyMCEContentAreaTop + elementTop,
|
636 |
+
visibleAreaHeight = windowHeight - ( edToolsHeight + toolbarHeight );
|
637 |
+
|
638 |
+
/**
|
639 |
+
* The minimum scroll height should be to the top of the editor, to offer a consistent
|
640 |
+
* experience.
|
641 |
+
*
|
642 |
+
* In order to find the top of the editor, we calculate the offset of `#wp-content-editor-tools` and
|
643 |
+
* subtracting the height. This gives the scroll position where the top of the editor tools aligns with
|
644 |
+
* the top of the viewport (under the Master Bar)
|
645 |
+
*/
|
646 |
+
var adjustedScroll = Math.max( selectionPosition - visibleAreaHeight / 2, edToolsOffsetTop - edToolsHeight );
|
647 |
+
|
648 |
+
$( 'html,body' ).animate( {
|
649 |
+
scrollTop: parseInt( adjustedScroll, 10 )
|
650 |
+
}, 100 );
|
651 |
+
}
|
652 |
+
|
653 |
+
/**
|
654 |
+
* This method was extracted from the `SaveContent` hook in
|
655 |
+
* `wp-includes/js/tinymce/plugins/wordpress/plugin.js`.
|
656 |
+
*
|
657 |
+
* It's needed here, since the method changes the content a bit, which confuses the cursor position.
|
658 |
+
*
|
659 |
+
* @param {Object} event TinyMCE event object.
|
660 |
+
*/
|
661 |
+
function fixTextAreaContent( event ) {
|
662 |
+
// Keep empty paragraphs :(
|
663 |
+
event.content = event.content.replace( /<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g, '<p> </p>' );
|
664 |
+
}
|
665 |
+
|
666 |
+
/**
|
667 |
+
* @summary Finds the current selection position in the Visual editor.
|
668 |
+
*
|
669 |
+
* Find the current selection in the Visual editor by inserting marker elements at the start
|
670 |
+
* and end of the selection.
|
671 |
+
*
|
672 |
+
* Uses the standard DOM selection API to achieve that goal.
|
673 |
+
*
|
674 |
+
* Check the notes in the comments in the code below for more information on some gotchas
|
675 |
+
* and why this solution was chosen.
|
676 |
+
*
|
677 |
+
* @param {Object} editor The editor where we must find the selection
|
678 |
+
* @returns {(null|Object)} The selection range position in the editor
|
679 |
+
*/
|
680 |
+
function findBookmarkedPosition( editor ) {
|
681 |
+
// Get the TinyMCE `window` reference, since we need to access the raw selection.
|
682 |
+
var TinyMCEWIndow = editor.getWin(),
|
683 |
+
selection = TinyMCEWIndow.getSelection();
|
684 |
+
|
685 |
+
if ( selection.rangeCount <= 0 ) {
|
686 |
+
// no selection, no need to continue.
|
687 |
+
return;
|
688 |
+
}
|
689 |
+
|
690 |
+
/**
|
691 |
+
* The ID is used to avoid replacing user generated content, that may coincide with the
|
692 |
+
* format specified below.
|
693 |
+
* @type {string}
|
694 |
+
*/
|
695 |
+
var selectionID = 'SELRES_' + Math.random();
|
696 |
+
|
697 |
+
/**
|
698 |
+
* Create two marker elements that will be used to mark the start and the end of the range.
|
699 |
+
*
|
700 |
+
* The elements have hardcoded style that makes them invisible. This is done to avoid seeing
|
701 |
+
* random content flickering in the editor when switching between modes.
|
702 |
+
*/
|
703 |
+
var spanSkeleton = getCursorMarkerSpan( editor.$, selectionID ),
|
704 |
+
startElement = spanSkeleton.clone().addClass( 'mce_SELRES_start' ),
|
705 |
+
endElement = spanSkeleton.clone().addClass( 'mce_SELRES_end' );
|
706 |
+
|
707 |
+
/**
|
708 |
+
* Inspired by:
|
709 |
+
* @link https://stackoverflow.com/a/17497803/153310
|
710 |
+
*
|
711 |
+
* Why do it this way and not with TinyMCE's bookmarks?
|
712 |
+
*
|
713 |
+
* TinyMCE's bookmarks are very nice when working with selections and positions, BUT
|
714 |
+
* there is no way to determine the precise position of the bookmark when switching modes, since
|
715 |
+
* TinyMCE does some serialization of the content, to fix things like shortcodes, run plugins, prettify
|
716 |
+
* HTML code and so on. In this process, the bookmark markup gets lost.
|
717 |
+
*
|
718 |
+
* If we decide to hook right after the bookmark is added, we can see where the bookmark is in the raw HTML
|
719 |
+
* in TinyMCE. Unfortunately this state is before the serialization, so any visual markup in the content will
|
720 |
+
* throw off the positioning.
|
721 |
+
*
|
722 |
+
* To avoid this, we insert two custom `span`s that will serve as the markers at the beginning and end of the
|
723 |
+
* selection.
|
724 |
+
*
|
725 |
+
* Why not use TinyMCE's selection API or the DOM API to wrap the contents? Because if we do that, this creates
|
726 |
+
* a new node, which is inserted in the dom. Now this will be fine, if we worked with fixed selections to
|
727 |
+
* full nodes. Unfortunately in our case, the user can select whatever they like, which means that the
|
728 |
+
* selection may start in the middle of one node and end in the middle of a completely different one. If we
|
729 |
+
* wrap the selection in another node, this will create artifacts in the content.
|
730 |
+
*
|
731 |
+
* Using the method below, we insert the custom `span` nodes at the start and at the end of the selection.
|
732 |
+
* This helps us not break the content and also gives us the option to work with multi-node selections without
|
733 |
+
* breaking the markup.
|
734 |
+
*/
|
735 |
+
var range = selection.getRangeAt( 0 ),
|
736 |
+
startNode = range.startContainer,
|
737 |
+
startOffset = range.startOffset,
|
738 |
+
boundaryRange = range.cloneRange();
|
739 |
+
|
740 |
+
/**
|
741 |
+
* If the selection is on a shortcode with Live View, TinyMCE creates a bogus markup,
|
742 |
+
* which we have to account for.
|
743 |
+
*/
|
744 |
+
if ( editor.$( startNode ).parents( '.mce-offscreen-selection' ).length > 0 ) {
|
745 |
+
startNode = editor.$( '[data-mce-selected]' )[0];
|
746 |
+
|
747 |
+
/**
|
748 |
+
* Marking the start and end element with `data-mce-object-selection` helps
|
749 |
+
* discern when the selected object is a Live Preview selection.
|
750 |
+
*
|
751 |
+
* This way we can adjust the selection to properly select only the content, ignoring
|
752 |
+
* whitespace inserted around the selected object by the Editor.
|
753 |
+
*/
|
754 |
+
startElement.attr( 'data-mce-object-selection', 'true' );
|
755 |
+
endElement.attr( 'data-mce-object-selection', 'true' );
|
756 |
+
|
757 |
+
editor.$( startNode ).before( startElement[0] );
|
758 |
+
editor.$( startNode ).after( endElement[0] );
|
759 |
+
} else {
|
760 |
+
boundaryRange.collapse( false );
|
761 |
+
boundaryRange.insertNode( endElement[0] );
|
762 |
+
|
763 |
+
boundaryRange.setStart( startNode, startOffset );
|
764 |
+
boundaryRange.collapse( true );
|
765 |
+
boundaryRange.insertNode( startElement[0] );
|
766 |
+
|
767 |
+
range.setStartAfter( startElement[0] );
|
768 |
+
range.setEndBefore( endElement[0] );
|
769 |
+
selection.removeAllRanges();
|
770 |
+
selection.addRange( range );
|
771 |
+
}
|
772 |
+
|
773 |
+
/**
|
774 |
+
* Now the editor's content has the start/end nodes.
|
775 |
+
*
|
776 |
+
* Unfortunately the content goes through some more changes after this step, before it gets inserted
|
777 |
+
* in the `textarea`. This means that we have to do some minor cleanup on our own here.
|
778 |
+
*/
|
779 |
+
editor.on( 'GetContent', fixTextAreaContent );
|
780 |
+
|
781 |
+
var content = removep( editor.getContent() );
|
782 |
+
|
783 |
+
editor.off( 'GetContent', fixTextAreaContent );
|
784 |
+
|
785 |
+
startElement.remove();
|
786 |
+
endElement.remove();
|
787 |
+
|
788 |
+
var startRegex = new RegExp(
|
789 |
+
'<span[^>]*\\s*class="mce_SELRES_start"[^>]+>\\s*' + selectionID + '[^<]*<\\/span>(\\s*)'
|
790 |
+
);
|
791 |
+
|
792 |
+
var endRegex = new RegExp(
|
793 |
+
'(\\s*)<span[^>]*\\s*class="mce_SELRES_end"[^>]+>\\s*' + selectionID + '[^<]*<\\/span>'
|
794 |
+
);
|
795 |
+
|
796 |
+
var startMatch = content.match( startRegex ),
|
797 |
+
endMatch = content.match( endRegex );
|
798 |
+
|
799 |
+
if ( ! startMatch ) {
|
800 |
+
return null;
|
801 |
+
}
|
802 |
+
|
803 |
+
var startIndex = startMatch.index,
|
804 |
+
startMatchLength = startMatch[0].length,
|
805 |
+
endIndex = null;
|
806 |
+
|
807 |
+
if (endMatch) {
|
808 |
+
/**
|
809 |
+
* Adjust the selection index, if the selection contains a Live Preview object or not.
|
810 |
+
*
|
811 |
+
* Check where the `data-mce-object-selection` attribute is set above for more context.
|
812 |
+
*/
|
813 |
+
if ( startMatch[0].indexOf( 'data-mce-object-selection' ) !== -1 ) {
|
814 |
+
startMatchLength -= startMatch[1].length;
|
815 |
+
}
|
816 |
+
|
817 |
+
var endMatchIndex = endMatch.index;
|
818 |
+
|
819 |
+
if ( endMatch[0].indexOf( 'data-mce-object-selection' ) !== -1 ) {
|
820 |
+
endMatchIndex -= endMatch[1].length;
|
821 |
+
}
|
822 |
+
|
823 |
+
// We need to adjust the end position to discard the length of the range start marker
|
824 |
+
endIndex = endMatchIndex - startMatchLength;
|
825 |
+
}
|
826 |
+
|
827 |
+
return {
|
828 |
+
start: startIndex,
|
829 |
+
end: endIndex
|
830 |
+
};
|
831 |
+
}
|
832 |
+
|
833 |
+
/**
|
834 |
+
* @summary Selects text in the TinyMCE `textarea`.
|
835 |
+
*
|
836 |
+
* Selects the text in TinyMCE's textarea that's between `selection.start` and `selection.end`.
|
837 |
+
*
|
838 |
+
* For `selection` parameter:
|
839 |
+
* @link findBookmarkedPosition
|
840 |
+
*
|
841 |
+
* @param {Object} editor TinyMCE's editor instance.
|
842 |
+
* @param {Object} selection Selection data.
|
843 |
+
*/
|
844 |
+
function selectTextInTextArea( editor, selection ) {
|
845 |
+
// only valid in the text area mode and if we have selection
|
846 |
+
if ( ! selection ) {
|
847 |
+
return;
|
848 |
+
}
|
849 |
+
|
850 |
+
var textArea = editor.getElement(),
|
851 |
+
start = selection.start,
|
852 |
+
end = selection.end || selection.start;
|
853 |
+
|
854 |
+
if ( textArea.focus ) {
|
855 |
+
// focus and scroll to the position
|
856 |
+
setTimeout( function() {
|
857 |
+
if ( textArea.blur ) {
|
858 |
+
// defocus before focusing
|
859 |
+
textArea.blur();
|
860 |
+
}
|
861 |
+
textArea.focus();
|
862 |
+
}, 100 );
|
863 |
+
|
864 |
+
textArea.focus();
|
865 |
+
}
|
866 |
+
|
867 |
+
textArea.setSelectionRange( start, end );
|
868 |
+
}
|
869 |
+
|
870 |
+
// Restore the selection when the editor is initialized. Needed when the Text editor is the default.
|
871 |
+
$( document ).on( 'tinymce-editor-init.keep-scroll-position', function( event, editor ) {
|
872 |
+
if ( editor.$( '.mce_SELRES_start' ).length ) {
|
873 |
+
focusHTMLBookmarkInVisualEditor( editor );
|
874 |
+
}
|
875 |
+
} );
|
876 |
+
|
877 |
+
/**
|
878 |
+
* @summary Replaces <p> tags with two line breaks. "Opposite" of wpautop().
|
879 |
+
*
|
880 |
+
* Replaces <p> tags with two line breaks except where the <p> has attributes.
|
881 |
+
* Unifies whitespace.
|
882 |
+
* Indents <li>, <dt> and <dd> for better readability.
|
883 |
+
*
|
884 |
+
* @since 2.5.0
|
885 |
+
*
|
886 |
+
* @memberof switchEditors
|
887 |
+
*
|
888 |
+
* @param {string} html The content from the editor.
|
889 |
+
* @return {string} The content with stripped paragraph tags.
|
890 |
+
*/
|
891 |
+
function removep( html ) {
|
892 |
+
var blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure',
|
893 |
+
blocklist1 = blocklist + '|div|p',
|
894 |
+
blocklist2 = blocklist + '|pre',
|
895 |
+
preserve_linebreaks = false,
|
896 |
+
preserve_br = false,
|
897 |
+
preserve = [];
|
898 |
+
|
899 |
+
if ( ! html ) {
|
900 |
+
return '';
|
901 |
+
}
|
902 |
+
|
903 |
+
// Protect script and style tags.
|
904 |
+
if ( html.indexOf( '<script' ) !== -1 || html.indexOf( '<style' ) !== -1 ) {
|
905 |
+
html = html.replace( /<(script|style)[^>]*>[\s\S]*?<\/\1>/g, function( match ) {
|
906 |
+
preserve.push( match );
|
907 |
+
return '<wp-preserve>';
|
908 |
+
} );
|
909 |
+
}
|
910 |
+
|
911 |
+
// Protect pre tags.
|
912 |
+
if ( html.indexOf( '<pre' ) !== -1 ) {
|
913 |
+
preserve_linebreaks = true;
|
914 |
+
html = html.replace( /<pre[^>]*>[\s\S]+?<\/pre>/g, function( a ) {
|
915 |
+
a = a.replace( /<br ?\/?>(\r\n|\n)?/g, '<wp-line-break>' );
|
916 |
+
a = a.replace( /<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-line-break>' );
|
917 |
+
return a.replace( /\r?\n/g, '<wp-line-break>' );
|
918 |
+
});
|
919 |
+
}
|
920 |
+
|
921 |
+
// Remove line breaks but keep <br> tags inside image captions.
|
922 |
+
if ( html.indexOf( '[caption' ) !== -1 ) {
|
923 |
+
preserve_br = true;
|
924 |
+
html = html.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) {
|
925 |
+
return a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' ).replace( /[\r\n\t]+/, '' );
|
926 |
+
});
|
927 |
+
}
|
928 |
+
|
929 |
+
// Normalize white space characters before and after block tags.
|
930 |
+
html = html.replace( new RegExp( '\\s*</(' + blocklist1 + ')>\\s*', 'g' ), '</$1>\n' );
|
931 |
+
html = html.replace( new RegExp( '\\s*<((?:' + blocklist1 + ')(?: [^>]*)?)>', 'g' ), '\n<$1>' );
|
932 |
+
|
933 |
+
// Mark </p> if it has any attributes.
|
934 |
+
html = html.replace( /(<p [^>]+>.*?)<\/p>/g, '$1</p#>' );
|
935 |
+
|
936 |
+
// Preserve the first <p> inside a <div>.
|
937 |
+
html = html.replace( /<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n' );
|
938 |
+
|
939 |
+
// Remove paragraph tags.
|
940 |
+
html = html.replace( /\s*<p>/gi, '' );
|
941 |
+
html = html.replace( /\s*<\/p>\s*/gi, '\n\n' );
|
942 |
+
|
943 |
+
// Normalize white space chars and remove multiple line breaks.
|
944 |
+
html = html.replace( /\n[\s\u00a0]+\n/g, '\n\n' );
|
945 |
+
|
946 |
+
// Replace <br> tags with line breaks.
|
947 |
+
html = html.replace( /(\s*)<br ?\/?>\s*/gi, function( match, space ) {
|
948 |
+
if ( space && space.indexOf( '\n' ) !== -1 ) {
|
949 |
+
return '\n\n';
|
950 |
+
}
|
951 |
+
|
952 |
+
return '\n';
|
953 |
+
});
|
954 |
+
|
955 |
+
// Fix line breaks around <div>.
|
956 |
+
html = html.replace( /\s*<div/g, '\n<div' );
|
957 |
+
html = html.replace( /<\/div>\s*/g, '</div>\n' );
|
958 |
+
|
959 |
+
// Fix line breaks around caption shortcodes.
|
960 |
+
html = html.replace( /\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n' );
|
961 |
+
html = html.replace( /caption\]\n\n+\[caption/g, 'caption]\n\n[caption' );
|
962 |
+
|
963 |
+
// Pad block elements tags with a line break.
|
964 |
+
html = html.replace( new RegExp('\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\s*>', 'g' ), '\n<$1>' );
|
965 |
+
html = html.replace( new RegExp('\\s*</(' + blocklist2 + ')>\\s*', 'g' ), '</$1>\n' );
|
966 |
+
|
967 |
+
// Indent <li>, <dt> and <dd> tags.
|
968 |
+
html = html.replace( /<((li|dt|dd)[^>]*)>/g, ' \t<$1>' );
|
969 |
+
|
970 |
+
// Fix line breaks around <select> and <option>.
|
971 |
+
if ( html.indexOf( '<option' ) !== -1 ) {
|
972 |
+
html = html.replace( /\s*<option/g, '\n<option' );
|
973 |
+
html = html.replace( /\s*<\/select>/g, '\n</select>' );
|
974 |
+
}
|
975 |
+
|
976 |
+
// Pad <hr> with two line breaks.
|
977 |
+
if ( html.indexOf( '<hr' ) !== -1 ) {
|
978 |
+
html = html.replace( /\s*<hr( [^>]*)?>\s*/g, '\n\n<hr$1>\n\n' );
|
979 |
+
}
|
980 |
+
|
981 |
+
// Remove line breaks in <object> tags.
|
982 |
+
if ( html.indexOf( '<object' ) !== -1 ) {
|
983 |
+
html = html.replace( /<object[\s\S]+?<\/object>/g, function( a ) {
|
984 |
+
return a.replace( /[\r\n]+/g, '' );
|
985 |
+
});
|
986 |
+
}
|
987 |
+
|
988 |
+
// Unmark special paragraph closing tags.
|
989 |
+
html = html.replace( /<\/p#>/g, '</p>\n' );
|
990 |
+
|
991 |
+
// Pad remaining <p> tags whit a line break.
|
992 |
+
html = html.replace( /\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1' );
|
993 |
+
|
994 |
+
// Trim.
|
995 |
+
html = html.replace( /^\s+/, '' );
|
996 |
+
html = html.replace( /[\s\u00a0]+$/, '' );
|
997 |
+
|
998 |
+
if ( preserve_linebreaks ) {
|
999 |
+
html = html.replace( /<wp-line-break>/g, '\n' );
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
if ( preserve_br ) {
|
1003 |
+
html = html.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );
|
1004 |
+
}
|
1005 |
+
|
1006 |
+
// Restore preserved tags.
|
1007 |
+
if ( preserve.length ) {
|
1008 |
+
html = html.replace( /<wp-preserve>/g, function() {
|
1009 |
+
return preserve.shift();
|
1010 |
+
} );
|
1011 |
+
}
|
1012 |
+
|
1013 |
+
return html;
|
1014 |
+
}
|
1015 |
+
|
1016 |
+
/**
|
1017 |
+
* @summary Replaces two line breaks with a paragraph tag and one line break with a <br>.
|
1018 |
+
*
|
1019 |
+
* Similar to `wpautop()` in formatting.php.
|
1020 |
+
*
|
1021 |
+
* @since 2.5.0
|
1022 |
+
*
|
1023 |
+
* @memberof switchEditors
|
1024 |
+
*
|
1025 |
+
* @param {string} text The text input.
|
1026 |
+
* @returns {string} The formatted text.
|
1027 |
+
*/
|
1028 |
+
function autop( text ) {
|
1029 |
+
var preserve_linebreaks = false,
|
1030 |
+
preserve_br = false,
|
1031 |
+
blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre' +
|
1032 |
+
'|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section' +
|
1033 |
+
'|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary';
|
1034 |
+
|
1035 |
+
// Normalize line breaks.
|
1036 |
+
text = text.replace( /\r\n|\r/g, '\n' );
|
1037 |
+
|
1038 |
+
if ( text.indexOf( '\n' ) === -1 ) {
|
1039 |
+
return text;
|
1040 |
+
}
|
1041 |
+
|
1042 |
+
// Remove line breaks from <object>.
|
1043 |
+
if ( text.indexOf( '<object' ) !== -1 ) {
|
1044 |
+
text = text.replace( /<object[\s\S]+?<\/object>/g, function( a ) {
|
1045 |
+
return a.replace( /\n+/g, '' );
|
1046 |
+
});
|
1047 |
+
}
|
1048 |
+
|
1049 |
+
// Remove line breaks from tags.
|
1050 |
+
text = text.replace( /<[^<>]+>/g, function( a ) {
|
1051 |
+
return a.replace( /[\n\t ]+/g, ' ' );
|
1052 |
+
});
|
1053 |
+
|
1054 |
+
// Preserve line breaks in <pre> and <script> tags.
|
1055 |
+
if ( text.indexOf( '<pre' ) !== -1 || text.indexOf( '<script' ) !== -1 ) {
|
1056 |
+
preserve_linebreaks = true;
|
1057 |
+
text = text.replace( /<(pre|script)[^>]*>[\s\S]*?<\/\1>/g, function( a ) {
|
1058 |
+
return a.replace( /\n/g, '<wp-line-break>' );
|
1059 |
+
});
|
1060 |
+
}
|
1061 |
+
|
1062 |
+
if ( text.indexOf( '<figcaption' ) !== -1 ) {
|
1063 |
+
text = text.replace( /\s*(<figcaption[^>]*>)/g, '$1' );
|
1064 |
+
text = text.replace( /<\/figcaption>\s*/g, '</figcaption>' );
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
// Keep <br> tags inside captions.
|
1068 |
+
if ( text.indexOf( '[caption' ) !== -1 ) {
|
1069 |
+
preserve_br = true;
|
1070 |
+
|
1071 |
+
text = text.replace( /\[caption[\s\S]+?\[\/caption\]/g, function( a ) {
|
1072 |
+
a = a.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' );
|
1073 |
+
|
1074 |
+
a = a.replace( /<[^<>]+>/g, function( b ) {
|
1075 |
+
return b.replace( /[\n\t ]+/, ' ' );
|
1076 |
+
});
|
1077 |
+
|
1078 |
+
return a.replace( /\s*\n\s*/g, '<wp-temp-br />' );
|
1079 |
+
});
|
1080 |
+
}
|
1081 |
+
|
1082 |
+
text = text + '\n\n';
|
1083 |
+
text = text.replace( /<br \/>\s*<br \/>/gi, '\n\n' );
|
1084 |
+
|
1085 |
+
// Pad block tags with two line breaks.
|
1086 |
+
text = text.replace( new RegExp( '(<(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '\n\n$1' );
|
1087 |
+
text = text.replace( new RegExp( '(</(?:' + blocklist + ')>)', 'gi' ), '$1\n\n' );
|
1088 |
+
text = text.replace( /<hr( [^>]*)?>/gi, '<hr$1>\n\n' );
|
1089 |
+
|
1090 |
+
// Remove white space chars around <option>.
|
1091 |
+
text = text.replace( /\s*<option/gi, '<option' );
|
1092 |
+
text = text.replace( /<\/option>\s*/gi, '</option>' );
|
1093 |
+
|
1094 |
+
// Normalize multiple line breaks and white space chars.
|
1095 |
+
text = text.replace( /\n\s*\n+/g, '\n\n' );
|
1096 |
+
|
1097 |
+
// Convert two line breaks to a paragraph.
|
1098 |
+
text = text.replace( /([\s\S]+?)\n\n/g, '<p>$1</p>\n' );
|
1099 |
+
|
1100 |
+
// Remove empty paragraphs.
|
1101 |
+
text = text.replace( /<p>\s*?<\/p>/gi, '');
|
1102 |
+
|
1103 |
+
// Remove <p> tags that are around block tags.
|
1104 |
+
text = text.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), '$1' );
|
1105 |
+
text = text.replace( /<p>(<li.+?)<\/p>/gi, '$1');
|
1106 |
+
|
1107 |
+
// Fix <p> in blockquotes.
|
1108 |
+
text = text.replace( /<p>\s*<blockquote([^>]*)>/gi, '<blockquote$1><p>');
|
1109 |
+
text = text.replace( /<\/blockquote>\s*<\/p>/gi, '</p></blockquote>');
|
1110 |
+
|
1111 |
+
// Remove <p> tags that are wrapped around block tags.
|
1112 |
+
text = text.replace( new RegExp( '<p>\\s*(</?(?:' + blocklist + ')(?: [^>]*)?>)', 'gi' ), '$1' );
|
1113 |
+
text = text.replace( new RegExp( '(</?(?:' + blocklist + ')(?: [^>]*)?>)\\s*</p>', 'gi' ), '$1' );
|
1114 |
+
|
1115 |
+
text = text.replace( /(<br[^>]*>)\s*\n/gi, '$1' );
|
1116 |
+
|
1117 |
+
// Add <br> tags.
|
1118 |
+
text = text.replace( /\s*\n/g, '<br />\n');
|
1119 |
+
|
1120 |
+
// Remove <br> tags that are around block tags.
|
1121 |
+
text = text.replace( new RegExp( '(</?(?:' + blocklist + ')[^>]*>)\\s*<br />', 'gi' ), '$1' );
|
1122 |
+
text = text.replace( /<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi, '$1' );
|
1123 |
+
|
1124 |
+
// Remove <p> and <br> around captions.
|
1125 |
+
text = text.replace( /(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi, '[caption$1[/caption]' );
|
1126 |
+
|
1127 |
+
// Make sure there is <p> when there is </p> inside block tags that can contain other blocks.
|
1128 |
+
text = text.replace( /(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g, function( a, b, c ) {
|
1129 |
+
if ( c.match( /<p( [^>]*)?>/ ) ) {
|
1130 |
+
return a;
|
1131 |
+
}
|
1132 |
+
|
1133 |
+
return b + '<p>' + c + '</p>';
|
1134 |
+
});
|
1135 |
+
|
1136 |
+
// Restore the line breaks in <pre> and <script> tags.
|
1137 |
+
if ( preserve_linebreaks ) {
|
1138 |
+
text = text.replace( /<wp-line-break>/g, '\n' );
|
1139 |
+
}
|
1140 |
+
|
1141 |
+
// Restore the <br> tags in captions.
|
1142 |
+
if ( preserve_br ) {
|
1143 |
+
text = text.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );
|
1144 |
+
}
|
1145 |
+
|
1146 |
+
return text;
|
1147 |
+
}
|
1148 |
+
|
1149 |
+
/**
|
1150 |
+
* @summary Fires custom jQuery events `beforePreWpautop` and `afterPreWpautop` when jQuery is available.
|
1151 |
+
*
|
1152 |
+
* @since 2.9.0
|
1153 |
+
*
|
1154 |
+
* @memberof switchEditors
|
1155 |
+
*
|
1156 |
+
* @param {String} html The content from the visual editor.
|
1157 |
+
* @returns {String} the filtered content.
|
1158 |
+
*/
|
1159 |
+
function pre_wpautop( html ) {
|
1160 |
+
var obj = { o: exports, data: html, unfiltered: html };
|
1161 |
+
|
1162 |
+
if ( $ ) {
|
1163 |
+
$( 'body' ).trigger( 'beforePreWpautop', [ obj ] );
|
1164 |
+
}
|
1165 |
+
|
1166 |
+
obj.data = removep( obj.data );
|
1167 |
+
|
1168 |
+
if ( $ ) {
|
1169 |
+
$( 'body' ).trigger( 'afterPreWpautop', [ obj ] );
|
1170 |
+
}
|
1171 |
+
|
1172 |
+
return obj.data;
|
1173 |
+
}
|
1174 |
+
|
1175 |
+
/**
|
1176 |
+
* @summary Fires custom jQuery events `beforeWpautop` and `afterWpautop` when jQuery is available.
|
1177 |
+
*
|
1178 |
+
* @since 2.9.0
|
1179 |
+
*
|
1180 |
+
* @memberof switchEditors
|
1181 |
+
*
|
1182 |
+
* @param {String} text The content from the text editor.
|
1183 |
+
* @returns {String} filtered content.
|
1184 |
+
*/
|
1185 |
+
function wpautop( text ) {
|
1186 |
+
var obj = { o: exports, data: text, unfiltered: text };
|
1187 |
+
|
1188 |
+
if ( $ ) {
|
1189 |
+
$( 'body' ).trigger( 'beforeWpautop', [ obj ] );
|
1190 |
+
}
|
1191 |
+
|
1192 |
+
obj.data = autop( obj.data );
|
1193 |
+
|
1194 |
+
if ( $ ) {
|
1195 |
+
$( 'body' ).trigger( 'afterWpautop', [ obj ] );
|
1196 |
+
}
|
1197 |
+
|
1198 |
+
return obj.data;
|
1199 |
+
}
|
1200 |
+
|
1201 |
+
if ( $ ) {
|
1202 |
+
$( document ).ready( init );
|
1203 |
+
} else if ( document.addEventListener ) {
|
1204 |
+
document.addEventListener( 'DOMContentLoaded', init, false );
|
1205 |
+
window.addEventListener( 'load', init, false );
|
1206 |
+
} else if ( window.attachEvent ) {
|
1207 |
+
window.attachEvent( 'onload', init );
|
1208 |
+
document.attachEvent( 'onreadystatechange', function() {
|
1209 |
+
if ( 'complete' === document.readyState ) {
|
1210 |
+
init();
|
1211 |
+
}
|
1212 |
+
} );
|
1213 |
+
}
|
1214 |
+
|
1215 |
+
wp.editor.autop = wpautop;
|
1216 |
+
wp.editor.removep = pre_wpautop;
|
1217 |
+
|
1218 |
+
exports = {
|
1219 |
+
go: switchEditor,
|
1220 |
+
wpautop: wpautop,
|
1221 |
+
pre_wpautop: pre_wpautop,
|
1222 |
+
_wp_Autop: autop,
|
1223 |
+
_wp_Nop: removep
|
1224 |
+
};
|
1225 |
+
|
1226 |
+
return exports;
|
1227 |
+
}
|
1228 |
+
|
1229 |
+
/**
|
1230 |
+
* @namespace {SwitchEditors} switchEditors
|
1231 |
+
* Expose the switch editors to be used globally.
|
1232 |
+
*/
|
1233 |
+
window.switchEditors = new SwitchEditors();
|
1234 |
+
|
1235 |
+
/**
|
1236 |
+
* Initialize TinyMCE and/or Quicktags. For use with wp_enqueue_editor() (PHP).
|
1237 |
+
*
|
1238 |
+
* Intended for use with an existing textarea that will become the Text editor tab.
|
1239 |
+
* The editor width will be the width of the textarea container, height will be adjustable.
|
1240 |
+
*
|
1241 |
+
* Settings for both TinyMCE and Quicktags can be passed on initialization, and are "filtered"
|
1242 |
+
* with custom jQuery events on the document element, wp-before-tinymce-init and wp-before-quicktags-init.
|
1243 |
+
*
|
1244 |
+
* @since 4.8.0
|
1245 |
+
*
|
1246 |
+
* @param {string} id The HTML id of the textarea that is used for the editor.
|
1247 |
+
* Has to be jQuery compliant. No brackets, special chars, etc.
|
1248 |
+
* @param {object} settings Example:
|
1249 |
+
* settings = {
|
1250 |
+
* // See https://www.tinymce.com/docs/configure/integration-and-setup/.
|
1251 |
+
* // Alternatively set to `true` to use the defaults.
|
1252 |
+
* tinymce: {
|
1253 |
+
* setup: function( editor ) {
|
1254 |
+
* console.log( 'Editor initialized', editor );
|
1255 |
+
* }
|
1256 |
+
* }
|
1257 |
+
*
|
1258 |
+
* // Alternatively set to `true` to use the defaults.
|
1259 |
+
* quicktags: {
|
1260 |
+
* buttons: 'strong,em,link'
|
1261 |
+
* }
|
1262 |
+
* }
|
1263 |
+
*/
|
1264 |
+
wp.editor.initialize = function( id, settings ) {
|
1265 |
+
var init;
|
1266 |
+
var defaults;
|
1267 |
+
|
1268 |
+
if ( ! $ || ! id || ! wp.editor.getDefaultSettings ) {
|
1269 |
+
return;
|
1270 |
+
}
|
1271 |
+
|
1272 |
+
defaults = wp.editor.getDefaultSettings();
|
1273 |
+
|
1274 |
+
// Initialize TinyMCE by default
|
1275 |
+
if ( ! settings ) {
|
1276 |
+
settings = {
|
1277 |
+
tinymce: true
|
1278 |
+
};
|
1279 |
+
}
|
1280 |
+
|
1281 |
+
// Add wrap and the Visual|Text tabs.
|
1282 |
+
if ( settings.tinymce && settings.quicktags ) {
|
1283 |
+
var $textarea = $( '#' + id );
|
1284 |
+
|
1285 |
+
var $wrap = $( '<div>' ).attr( {
|
1286 |
+
'class': 'wp-core-ui wp-editor-wrap tmce-active',
|
1287 |
+
id: 'wp-' + id + '-wrap'
|
1288 |
+
} );
|
1289 |
+
|
1290 |
+
var $editorContainer = $( '<div class="wp-editor-container">' );
|
1291 |
+
|
1292 |
+
var $button = $( '<button>' ).attr( {
|
1293 |
+
type: 'button',
|
1294 |
+
'data-wp-editor-id': id
|
1295 |
+
} );
|
1296 |
+
|
1297 |
+
var $editorTools = $( '<div class="wp-editor-tools">' );
|
1298 |
+
|
1299 |
+
if ( settings.mediaButtons ) {
|
1300 |
+
var buttonText = 'Add Media';
|
1301 |
+
|
1302 |
+
if ( window._wpMediaViewsL10n && window._wpMediaViewsL10n.addMedia ) {
|
1303 |
+
buttonText = window._wpMediaViewsL10n.addMedia;
|
1304 |
+
}
|
1305 |
+
|
1306 |
+
var $addMediaButton = $( '<button type="button" class="button insert-media add_media">' );
|
1307 |
+
|
1308 |
+
$addMediaButton.append( '<span class="wp-media-buttons-icon"></span>' );
|
1309 |
+
$addMediaButton.append( document.createTextNode( ' ' + buttonText ) );
|
1310 |
+
$addMediaButton.data( 'editor', id );
|
1311 |
+
|
1312 |
+
$editorTools.append(
|
1313 |
+
$( '<div class="wp-media-buttons">' )
|
1314 |
+
.append( $addMediaButton )
|
1315 |
+
);
|
1316 |
+
}
|
1317 |
+
|
1318 |
+
$wrap.append(
|
1319 |
+
$editorTools
|
1320 |
+
.append( $( '<div class="wp-editor-tabs">' )
|
1321 |
+
.append( $button.clone().attr({
|
1322 |
+
id: id + '-tmce',
|
1323 |
+
'class': 'wp-switch-editor switch-tmce'
|
1324 |
+
}).text( window.tinymce.translate( 'Visual' ) ) )
|
1325 |
+
.append( $button.attr({
|
1326 |
+
id: id + '-html',
|
1327 |
+
'class': 'wp-switch-editor switch-html'
|
1328 |
+
}).text( window.tinymce.translate( 'Text' ) ) )
|
1329 |
+
).append( $editorContainer )
|
1330 |
+
);
|
1331 |
+
|
1332 |
+
$textarea.after( $wrap );
|
1333 |
+
$editorContainer.append( $textarea );
|
1334 |
+
}
|
1335 |
+
|
1336 |
+
if ( window.tinymce && settings.tinymce ) {
|
1337 |
+
if ( typeof settings.tinymce !== 'object' ) {
|
1338 |
+
settings.tinymce = {};
|
1339 |
+
}
|
1340 |
+
|
1341 |
+
init = $.extend( {}, defaults.tinymce, settings.tinymce );
|
1342 |
+
init.selector = '#' + id;
|
1343 |
+
|
1344 |
+
$( document ).trigger( 'wp-before-tinymce-init', init );
|
1345 |
+
window.tinymce.init( init );
|
1346 |
+
|
1347 |
+
if ( ! window.wpActiveEditor ) {
|
1348 |
+
window.wpActiveEditor = id;
|
1349 |
+
}
|
1350 |
+
}
|
1351 |
+
|
1352 |
+
if ( window.quicktags && settings.quicktags ) {
|
1353 |
+
if ( typeof settings.quicktags !== 'object' ) {
|
1354 |
+
settings.quicktags = {};
|
1355 |
+
}
|
1356 |
+
|
1357 |
+
init = $.extend( {}, defaults.quicktags, settings.quicktags );
|
1358 |
+
init.id = id;
|
1359 |
+
|
1360 |
+
$( document ).trigger( 'wp-before-quicktags-init', init );
|
1361 |
+
window.quicktags( init );
|
1362 |
+
|
1363 |
+
if ( ! window.wpActiveEditor ) {
|
1364 |
+
window.wpActiveEditor = init.id;
|
1365 |
+
}
|
1366 |
+
}
|
1367 |
+
};
|
1368 |
+
|
1369 |
+
/**
|
1370 |
+
* Remove one editor instance.
|
1371 |
+
*
|
1372 |
+
* Intended for use with editors that were initialized with wp.editor.initialize().
|
1373 |
+
*
|
1374 |
+
* @since 4.8.0
|
1375 |
+
*
|
1376 |
+
* @param {string} id The HTML id of the editor textarea.
|
1377 |
+
*/
|
1378 |
+
wp.editor.remove = function( id ) {
|
1379 |
+
var mceInstance, qtInstance,
|
1380 |
+
$wrap = $( '#wp-' + id + '-wrap' );
|
1381 |
+
|
1382 |
+
if ( window.tinymce ) {
|
1383 |
+
mceInstance = window.tinymce.get( id );
|
1384 |
+
|
1385 |
+
if ( mceInstance ) {
|
1386 |
+
if ( ! mceInstance.isHidden() ) {
|
1387 |
+
mceInstance.save();
|
1388 |
+
}
|
1389 |
+
|
1390 |
+
mceInstance.remove();
|
1391 |
+
}
|
1392 |
+
}
|
1393 |
+
|
1394 |
+
if ( window.quicktags ) {
|
1395 |
+
qtInstance = window.QTags.getInstance( id );
|
1396 |
+
|
1397 |
+
if ( qtInstance ) {
|
1398 |
+
qtInstance.remove();
|
1399 |
+
}
|
1400 |
+
}
|
1401 |
+
|
1402 |
+
if ( $wrap.length ) {
|
1403 |
+
$wrap.after( $( '#' + id ) );
|
1404 |
+
$wrap.remove();
|
1405 |
+
}
|
1406 |
+
};
|
1407 |
+
|
1408 |
+
/**
|
1409 |
+
* Get the editor content.
|
1410 |
+
*
|
1411 |
+
* Intended for use with editors that were initialized with wp.editor.initialize().
|
1412 |
+
*
|
1413 |
+
* @since 4.8.0
|
1414 |
+
*
|
1415 |
+
* @param {string} id The HTML id of the editor textarea.
|
1416 |
+
* @return The editor content.
|
1417 |
+
*/
|
1418 |
+
wp.editor.getContent = function( id ) {
|
1419 |
+
var editor;
|
1420 |
+
|
1421 |
+
if ( ! $ || ! id ) {
|
1422 |
+
return;
|
1423 |
+
}
|
1424 |
+
|
1425 |
+
if ( window.tinymce ) {
|
1426 |
+
editor = window.tinymce.get( id );
|
1427 |
+
|
1428 |
+
if ( editor && ! editor.isHidden() ) {
|
1429 |
+
editor.save();
|
1430 |
+
}
|
1431 |
+
}
|
1432 |
+
|
1433 |
+
return $( '#' + id ).val();
|
1434 |
+
};
|
1435 |
+
|
1436 |
+
}( window.jQuery, window.wp ));
|
lib/classic-editor/js/editor.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
window.wp=window.wp||{},function(a,b){function c(){function c(){!x&&window.tinymce&&(x=window.tinymce,y=x.$,y(document).on("click",function(a){var b,c,d=y(a.target);d.hasClass("wp-switch-editor")&&(b=d.attr("data-wp-editor-id"),c=d.hasClass("switch-tmce")?"tmce":"html",e(b,c))}))}function d(a){var b=y(".mce-toolbar-grp",a.getContainer())[0],c=b&&b.clientHeight;return c&&c>10&&c<200?parseInt(c,10):30}function e(a,b){a=a||"content",b=b||"toggle";var c,e,f,g=x.get(a),h=y("#wp-"+a+"-wrap"),i=y("#"+a),j=i[0];if("toggle"===b&&(b=g&&!g.isHidden()?"html":"tmce"),"tmce"===b||"tinymce"===b){if(g&&!g.isHidden())return!1;"undefined"!=typeof window.QTags&&window.QTags.closeAllTags(a),c=parseInt(j.style.height,10)||0;var k=!1;k=g?g.getParam("wp_keep_scroll_position"):window.tinyMCEPreInit.mceInit[a]&&window.tinyMCEPreInit.mceInit[a].wp_keep_scroll_position,k&&m(i),g?(g.show(),!x.Env.iOS&&c&&(e=d(g),c=c-e+14,c>50&&c<5e3&&g.theme.resizeTo(null,c)),g.getParam("wp_keep_scroll_position")&&n(g)):x.init(window.tinyMCEPreInit.mceInit[a]),h.removeClass("html-active").addClass("tmce-active"),i.attr("aria-hidden",!0),window.setUserSetting("editor","tinymce")}else if("html"===b){if(g&&g.isHidden())return!1;if(g){x.Env.iOS||(f=g.iframeElement,c=f?parseInt(f.style.height,10):0,c&&(e=d(g),c=c+e-14,c>50&&c<5e3&&(j.style.height=c+"px")));var l=null;g.getParam("wp_keep_scroll_position")&&(l=r(g)),g.hide(),l&&s(g,l)}else i.css({display:"",visibility:""});h.removeClass("tmce-active").addClass("html-active"),i.attr("aria-hidden",!1),window.setUserSetting("editor","html")}}function f(a,b){var c=a.lastIndexOf("<",b-1),d=a.lastIndexOf(">",b);if(c>d||">"===a.substr(b,1)){var e=a.substr(c),f=e.match(/<\s*(\/)?(\w+)/);if(!f)return null;var g=f[2],h=e.indexOf(">");return{ltPos:c,gtPos:c+h+1,tagType:g,isClosingTag:!!f[1]}}return null}function g(a,b){for(var c=j(a),d=0;d<c.length;d++){var e=c[d];if(b>=e.startIndex&&b<=e.endIndex)return e}}function h(a){var b=a.match(/\[+([\w_-])+/g),c=[];if(b)for(var d=0;d<b.length;d++){var e=b[d].replace(/^\[+/g,"");c.indexOf(e)===-1&&c.push(e)}return c}function i(a){var c=["caption"];return c.indexOf(a)!==-1||void 0!==b.mce.views.get(a)}function j(a){var c,d=h(a);if(0===d.length)return[];for(var e,f=b.shortcode.regexp(d.join("|")),g=[];e=f.exec(a);){var j="["===e[1],k=!j&&i(e[2]);c={shortcodeName:e[2],showAsPlainText:j,startIndex:e.index,endIndex:e.index+e[0].length,length:e[0].length,isPreviewable:k},g.push(c)}for(var l=new RegExp('(^|[\\n\\r][\\n\\r]|<p>)(https?:\\/\\/[^s"]+?)(<\\/p>s*|[\\n\\r][\\n\\r]|$)',"gi");e=l.exec(a);)c={shortcodeName:"url",showAsPlainText:!1,startIndex:e.index,endIndex:e.index+e[0].length,length:e[0].length,isPreviewable:!0,urlAtStartOfContent:""===e[1],urlAtEndOfContent:""===e[3]},g.push(c);return g}function k(a,b){return a("<span>").css({display:"inline-block",width:0,overflow:"hidden","line-height":0}).html(b?b:"")}function l(a,b){var c=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],d=b.cursorStart,e=b.cursorEnd,h=f(a,d);h&&(d=c.indexOf(h.tagType)!==-1?h.ltPos:h.gtPos);var i=f(a,e);i&&(e=i.gtPos);var j=g(a,d);j&&j.isPreviewable&&(d=j.urlAtStartOfContent?j.endIndex:j.startIndex);var k=g(a,e);return k&&k.isPreviewable&&(e=k.urlAtEndOfContent?k.startIndex:k.endIndex),{cursorStart:d,cursorEnd:e}}function m(a){if(a&&a.length){var b=a[0],c=b.value,d=l(c,{cursorStart:b.selectionStart,cursorEnd:b.selectionEnd}),e=d.cursorStart,f=d.cursorEnd,g=e!==f?"range":"single",h=null,i=k(y,"").attr("data-mce-type","bookmark");if("range"===g){var j=b.value.slice(e,f),m=i.clone().addClass("mce_SELRES_end");h=[j,m[0].outerHTML].join("")}b.value=[b.value.slice(0,e),i.clone().addClass("mce_SELRES_start")[0].outerHTML,h,b.value.slice(f)].join("")}}function n(a){var b=a.$(".mce_SELRES_start").attr("data-mce-bogus",1),c=a.$(".mce_SELRES_end").attr("data-mce-bogus",1);if(b.length)if(a.focus(),c.length){var d=a.getDoc().createRange();d.setStartAfter(b[0]),d.setEndBefore(c[0]),a.selection.setRng(d)}else a.selection.select(b[0]);a.getParam("wp_keep_scroll_position")&&p(a,b),o(b),o(c)}function o(a){var b=a.parent();a.remove(),!b.is("p")||b.children().length||b.text()||b.remove()}function p(b,c){var e=b.$(c).offset().top,f=b.$(b.getContentAreaContainer()).offset().top,g=d(b),h=a("#wp-content-editor-tools"),i=0,j=0;h.length&&(i=h.height(),j=h.offset().top);var k=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,l=f+e,m=k-(i+g),n=Math.max(l-m/2,j-i);a("html,body").animate({scrollTop:parseInt(n,10)},100)}function q(a){a.content=a.content.replace(/<p>(?:<br ?\/?>|\u00a0|\uFEFF| )*<\/p>/g,"<p> </p>")}function r(a){var b=a.getWin(),c=b.getSelection();if(!(c.rangeCount<=0)){var d="SELRES_"+Math.random(),e=k(a.$,d),f=e.clone().addClass("mce_SELRES_start"),g=e.clone().addClass("mce_SELRES_end"),h=c.getRangeAt(0),i=h.startContainer,j=h.startOffset,l=h.cloneRange();a.$(i).parents(".mce-offscreen-selection").length>0?(i=a.$("[data-mce-selected]")[0],f.attr("data-mce-object-selection","true"),g.attr("data-mce-object-selection","true"),a.$(i).before(f[0]),a.$(i).after(g[0])):(l.collapse(!1),l.insertNode(g[0]),l.setStart(i,j),l.collapse(!0),l.insertNode(f[0]),h.setStartAfter(f[0]),h.setEndBefore(g[0]),c.removeAllRanges(),c.addRange(h)),a.on("GetContent",q);var m=t(a.getContent());a.off("GetContent",q),f.remove(),g.remove();var n=new RegExp('<span[^>]*\\s*class="mce_SELRES_start"[^>]+>\\s*'+d+"[^<]*<\\/span>(\\s*)"),o=new RegExp('(\\s*)<span[^>]*\\s*class="mce_SELRES_end"[^>]+>\\s*'+d+"[^<]*<\\/span>"),p=m.match(n),r=m.match(o);if(!p)return null;var s=p.index,u=p[0].length,v=null;if(r){p[0].indexOf("data-mce-object-selection")!==-1&&(u-=p[1].length);var w=r.index;r[0].indexOf("data-mce-object-selection")!==-1&&(w-=r[1].length),v=w-u}return{start:s,end:v}}}function s(a,b){if(b){var c=a.getElement(),d=b.start,e=b.end||b.start;c.focus&&(setTimeout(function(){c.blur&&c.blur(),c.focus()},100),c.focus()),c.setSelectionRange(d,e)}}function t(a){var b="blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure",c=b+"|div|p",d=b+"|pre",e=!1,f=!1,g=[];return a?(a.indexOf("<script")===-1&&a.indexOf("<style")===-1||(a=a.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,function(a){return g.push(a),"<wp-preserve>"})),a.indexOf("<pre")!==-1&&(e=!0,a=a.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g,function(a){return a=a.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-line-break>"),a=a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-line-break>"),a.replace(/\r?\n/g,"<wp-line-break>")})),a.indexOf("[caption")!==-1&&(f=!0,a=a.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(a){return a.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").replace(/[\r\n\t]+/,"")})),a=a.replace(new RegExp("\\s*</("+c+")>\\s*","g"),"</$1>\n"),a=a.replace(new RegExp("\\s*<((?:"+c+")(?: [^>]*)?)>","g"),"\n<$1>"),a=a.replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>"),a=a.replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n"),a=a.replace(/\s*<p>/gi,""),a=a.replace(/\s*<\/p>\s*/gi,"\n\n"),a=a.replace(/\n[\s\u00a0]+\n/g,"\n\n"),a=a.replace(/(\s*)<br ?\/?>\s*/gi,function(a,b){return b&&b.indexOf("\n")!==-1?"\n\n":"\n"}),a=a.replace(/\s*<div/g,"\n<div"),a=a.replace(/<\/div>\s*/g,"</div>\n"),a=a.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n"),a=a.replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption"),a=a.replace(new RegExp("\\s*<((?:"+d+")(?: [^>]*)?)\\s*>","g"),"\n<$1>"),a=a.replace(new RegExp("\\s*</("+d+")>\\s*","g"),"</$1>\n"),a=a.replace(/<((li|dt|dd)[^>]*)>/g," \t<$1>"),a.indexOf("<option")!==-1&&(a=a.replace(/\s*<option/g,"\n<option"),a=a.replace(/\s*<\/select>/g,"\n</select>")),a.indexOf("<hr")!==-1&&(a=a.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")),a.indexOf("<object")!==-1&&(a=a.replace(/<object[\s\S]+?<\/object>/g,function(a){return a.replace(/[\r\n]+/g,"")})),a=a.replace(/<\/p#>/g,"</p>\n"),a=a.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1"),a=a.replace(/^\s+/,""),a=a.replace(/[\s\u00a0]+$/,""),e&&(a=a.replace(/<wp-line-break>/g,"\n")),f&&(a=a.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),g.length&&(a=a.replace(/<wp-preserve>/g,function(){return g.shift()})),a):""}function u(a){var b=!1,c=!1,d="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary";return a=a.replace(/\r\n|\r/g,"\n"),a.indexOf("\n")===-1?a:(a.indexOf("<object")!==-1&&(a=a.replace(/<object[\s\S]+?<\/object>/g,function(a){return a.replace(/\n+/g,"")})),a=a.replace(/<[^<>]+>/g,function(a){return a.replace(/[\n\t ]+/g," ")}),a.indexOf("<pre")===-1&&a.indexOf("<script")===-1||(b=!0,a=a.replace(/<(pre|script)[^>]*>[\s\S]*?<\/\1>/g,function(a){return a.replace(/\n/g,"<wp-line-break>")})),a.indexOf("<figcaption")!==-1&&(a=a.replace(/\s*(<figcaption[^>]*>)/g,"$1"),a=a.replace(/<\/figcaption>\s*/g,"</figcaption>")),a.indexOf("[caption")!==-1&&(c=!0,a=a.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(a){return a=a.replace(/<br([^>]*)>/g,"<wp-temp-br$1>"),a=a.replace(/<[^<>]+>/g,function(a){return a.replace(/[\n\t ]+/," ")}),a.replace(/\s*\n\s*/g,"<wp-temp-br />")})),a+="\n\n",a=a.replace(/<br \/>\s*<br \/>/gi,"\n\n"),a=a.replace(new RegExp("(<(?:"+d+")(?: [^>]*)?>)","gi"),"\n\n$1"),a=a.replace(new RegExp("(</(?:"+d+")>)","gi"),"$1\n\n"),a=a.replace(/<hr( [^>]*)?>/gi,"<hr$1>\n\n"),a=a.replace(/\s*<option/gi,"<option"),a=a.replace(/<\/option>\s*/gi,"</option>"),a=a.replace(/\n\s*\n+/g,"\n\n"),a=a.replace(/([\s\S]+?)\n\n/g,"<p>$1</p>\n"),a=a.replace(/<p>\s*?<\/p>/gi,""),a=a.replace(new RegExp("<p>\\s*(</?(?:"+d+")(?: [^>]*)?>)\\s*</p>","gi"),"$1"),a=a.replace(/<p>(<li.+?)<\/p>/gi,"$1"),a=a.replace(/<p>\s*<blockquote([^>]*)>/gi,"<blockquote$1><p>"),a=a.replace(/<\/blockquote>\s*<\/p>/gi,"</p></blockquote>"),a=a.replace(new RegExp("<p>\\s*(</?(?:"+d+")(?: [^>]*)?>)","gi"),"$1"),a=a.replace(new RegExp("(</?(?:"+d+")(?: [^>]*)?>)\\s*</p>","gi"),"$1"),a=a.replace(/(<br[^>]*>)\s*\n/gi,"$1"),a=a.replace(/\s*\n/g,"<br />\n"),a=a.replace(new RegExp("(</?(?:"+d+")[^>]*>)\\s*<br />","gi"),"$1"),a=a.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1"),a=a.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi,"[caption$1[/caption]"),a=a.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(a,b,c){return c.match(/<p( [^>]*)?>/)?a:b+"<p>"+c+"</p>"}),b&&(a=a.replace(/<wp-line-break>/g,"\n")),c&&(a=a.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")),a)}function v(b){var c={o:z,data:b,unfiltered:b};return a&&a("body").trigger("beforePreWpautop",[c]),c.data=t(c.data),a&&a("body").trigger("afterPreWpautop",[c]),c.data}function w(b){var c={o:z,data:b,unfiltered:b};return a&&a("body").trigger("beforeWpautop",[c]),c.data=u(c.data),a&&a("body").trigger("afterWpautop",[c]),c.data}var x,y,z={};return a(document).on("tinymce-editor-init.keep-scroll-position",function(a,b){b.$(".mce_SELRES_start").length&&n(b)}),a?a(document).ready(c):document.addEventListener?(document.addEventListener("DOMContentLoaded",c,!1),window.addEventListener("load",c,!1)):window.attachEvent&&(window.attachEvent("onload",c),document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&c()})),b.editor.autop=w,b.editor.removep=v,z={go:e,wpautop:w,pre_wpautop:v,_wp_Autop:u,_wp_Nop:t}}b.editor=b.editor||{},window.switchEditors=new c,b.editor.initialize=function(c,d){var e,f;if(a&&c&&b.editor.getDefaultSettings){if(f=b.editor.getDefaultSettings(),d||(d={tinymce:!0}),d.tinymce&&d.quicktags){var g=a("#"+c),h=a("<div>").attr({"class":"wp-core-ui wp-editor-wrap tmce-active",id:"wp-"+c+"-wrap"}),i=a('<div class="wp-editor-container">'),j=a("<button>").attr({type:"button","data-wp-editor-id":c}),k=a('<div class="wp-editor-tools">');if(d.mediaButtons){var l="Add Media";window._wpMediaViewsL10n&&window._wpMediaViewsL10n.addMedia&&(l=window._wpMediaViewsL10n.addMedia);var m=a('<button type="button" class="button insert-media add_media">');m.append('<span class="wp-media-buttons-icon"></span>'),m.append(document.createTextNode(" "+l)),m.data("editor",c),k.append(a('<div class="wp-media-buttons">').append(m))}h.append(k.append(a('<div class="wp-editor-tabs">').append(j.clone().attr({id:c+"-tmce","class":"wp-switch-editor switch-tmce"}).text(window.tinymce.translate("Visual"))).append(j.attr({id:c+"-html","class":"wp-switch-editor switch-html"}).text(window.tinymce.translate("Text")))).append(i)),g.after(h),i.append(g)}window.tinymce&&d.tinymce&&("object"!=typeof d.tinymce&&(d.tinymce={}),e=a.extend({},f.tinymce,d.tinymce),e.selector="#"+c,a(document).trigger("wp-before-tinymce-init",e),window.tinymce.init(e),window.wpActiveEditor||(window.wpActiveEditor=c)),window.quicktags&&d.quicktags&&("object"!=typeof d.quicktags&&(d.quicktags={}),e=a.extend({},f.quicktags,d.quicktags),e.id=c,a(document).trigger("wp-before-quicktags-init",e),window.quicktags(e),window.wpActiveEditor||(window.wpActiveEditor=e.id))}},b.editor.remove=function(b){var c,d,e=a("#wp-"+b+"-wrap");window.tinymce&&(c=window.tinymce.get(b),c&&(c.isHidden()||c.save(),c.remove())),window.quicktags&&(d=window.QTags.getInstance(b),d&&d.remove()),e.length&&(e.after(a("#"+b)),e.remove())},b.editor.getContent=function(b){var c;if(a&&b)return window.tinymce&&(c=window.tinymce.get(b),c&&!c.isHidden()&&c.save()),a("#"+b).val()}}(window.jQuery,window.wp);
|
lib/classic-editor/js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Ajax, setPostThumbnailL10n, postboxes, pagenow, tinymce, alert, deleteUserSetting */
|
2 |
+
/* global theList:true, theExtraList:true, getUserSetting, setUserSetting, commentReply */
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Contains all dynamic functionality needed on post and term pages.
|
6 |
+
*
|
7 |
+
* @summary Control page and term functionality.
|
8 |
+
*/
|
9 |
+
|
10 |
+
var commentsBox, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint, makeSlugeditClickable, editPermalink;
|
11 |
+
// Backwards compatibility: prevent fatal errors.
|
12 |
+
makeSlugeditClickable = editPermalink = function(){};
|
13 |
+
|
14 |
+
// Make sure the wp object exists.
|
15 |
+
window.wp = window.wp || {};
|
16 |
+
|
17 |
+
( function( $ ) {
|
18 |
+
var titleHasFocus = false;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Control loading of comments on the post and term edit pages.
|
22 |
+
*
|
23 |
+
* @type {{st: number, get: commentsBox.get, load: commentsBox.load}}
|
24 |
+
*
|
25 |
+
* @namespace commentsBox
|
26 |
+
*/
|
27 |
+
commentsBox = {
|
28 |
+
// Comment offset to use when fetching new comments.
|
29 |
+
st : 0,
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Fetch comments using AJAX and display them in the box.
|
33 |
+
*
|
34 |
+
* @param {int} total Total number of comments for this post.
|
35 |
+
* @param {int} num Optional. Number of comments to fetch, defaults to 20.
|
36 |
+
* @returns {boolean} Always returns false.
|
37 |
+
*
|
38 |
+
* @memberof commentsBox
|
39 |
+
*/
|
40 |
+
get : function(total, num) {
|
41 |
+
var st = this.st, data;
|
42 |
+
if ( ! num )
|
43 |
+
num = 20;
|
44 |
+
|
45 |
+
this.st += num;
|
46 |
+
this.total = total;
|
47 |
+
$( '#commentsdiv .spinner' ).addClass( 'is-active' );
|
48 |
+
|
49 |
+
data = {
|
50 |
+
'action' : 'get-comments',
|
51 |
+
'mode' : 'single',
|
52 |
+
'_ajax_nonce' : $('#add_comment_nonce').val(),
|
53 |
+
'p' : $('#post_ID').val(),
|
54 |
+
'start' : st,
|
55 |
+
'number' : num
|
56 |
+
};
|
57 |
+
|
58 |
+
$.post(
|
59 |
+
ajaxurl,
|
60 |
+
data,
|
61 |
+
function(r) {
|
62 |
+
r = wpAjax.parseAjaxResponse(r);
|
63 |
+
$('#commentsdiv .widefat').show();
|
64 |
+
$( '#commentsdiv .spinner' ).removeClass( 'is-active' );
|
65 |
+
|
66 |
+
if ( 'object' == typeof r && r.responses[0] ) {
|
67 |
+
$('#the-comment-list').append( r.responses[0].data );
|
68 |
+
|
69 |
+
theList = theExtraList = null;
|
70 |
+
$( 'a[className*=\':\']' ).unbind();
|
71 |
+
|
72 |
+
// If the offset is over the total number of comments we cannot fetch any more, so hide the button.
|
73 |
+
if ( commentsBox.st > commentsBox.total )
|
74 |
+
$('#show-comments').hide();
|
75 |
+
else
|
76 |
+
$('#show-comments').show().children('a').html(postL10n.showcomm);
|
77 |
+
|
78 |
+
return;
|
79 |
+
} else if ( 1 == r ) {
|
80 |
+
$('#show-comments').html(postL10n.endcomm);
|
81 |
+
return;
|
82 |
+
}
|
83 |
+
|
84 |
+
$('#the-comment-list').append('<tr><td colspan="2">'+wpAjax.broken+'</td></tr>');
|
85 |
+
}
|
86 |
+
);
|
87 |
+
|
88 |
+
return false;
|
89 |
+
},
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Load the next batch of comments.
|
93 |
+
*
|
94 |
+
* @param {int} total Total number of comments to load.
|
95 |
+
*
|
96 |
+
* @memberof commentsBox
|
97 |
+
*/
|
98 |
+
load: function(total){
|
99 |
+
this.st = jQuery('#the-comment-list tr.comment:visible').length;
|
100 |
+
this.get(total);
|
101 |
+
}
|
102 |
+
};
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Overwrite the content of the Featured Image postbox
|
106 |
+
*
|
107 |
+
* @param {string} html New HTML to be displayed in the content area of the postbox.
|
108 |
+
*
|
109 |
+
* @global
|
110 |
+
*/
|
111 |
+
WPSetThumbnailHTML = function(html){
|
112 |
+
$('.inside', '#postimagediv').html(html);
|
113 |
+
};
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Set the Image ID of the Featured Image
|
117 |
+
*
|
118 |
+
* @param {int} id The post_id of the image to use as Featured Image.
|
119 |
+
*
|
120 |
+
* @global
|
121 |
+
*/
|
122 |
+
WPSetThumbnailID = function(id){
|
123 |
+
var field = $('input[value="_thumbnail_id"]', '#list-table');
|
124 |
+
if ( field.length > 0 ) {
|
125 |
+
$('#meta\\[' + field.attr('id').match(/[0-9]+/) + '\\]\\[value\\]').text(id);
|
126 |
+
}
|
127 |
+
};
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Remove the Featured Image
|
131 |
+
*
|
132 |
+
* @param {string} nonce Nonce to use in the request.
|
133 |
+
*
|
134 |
+
* @global
|
135 |
+
*/
|
136 |
+
WPRemoveThumbnail = function(nonce){
|
137 |
+
$.post(ajaxurl, {
|
138 |
+
action: 'set-post-thumbnail', post_id: $( '#post_ID' ).val(), thumbnail_id: -1, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie )
|
139 |
+
},
|
140 |
+
/**
|
141 |
+
* Handle server response
|
142 |
+
*
|
143 |
+
* @param {string} str Response, will be '0' when an error occurred otherwise contains link to add Featured Image.
|
144 |
+
*/
|
145 |
+
function(str){
|
146 |
+
if ( str == '0' ) {
|
147 |
+
alert( setPostThumbnailL10n.error );
|
148 |
+
} else {
|
149 |
+
WPSetThumbnailHTML(str);
|
150 |
+
}
|
151 |
+
}
|
152 |
+
);
|
153 |
+
};
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Heartbeat locks.
|
157 |
+
*
|
158 |
+
* Used to lock editing of an object by only one user at a time.
|
159 |
+
*
|
160 |
+
* When the user does not send a heartbeat in a heartbeat-time
|
161 |
+
* the user is no longer editing and another user can start editing.
|
162 |
+
*/
|
163 |
+
$(document).on( 'heartbeat-send.refresh-lock', function( e, data ) {
|
164 |
+
var lock = $('#active_post_lock').val(),
|
165 |
+
post_id = $('#post_ID').val(),
|
166 |
+
send = {};
|
167 |
+
|
168 |
+
if ( ! post_id || ! $('#post-lock-dialog').length )
|
169 |
+
return;
|
170 |
+
|
171 |
+
send.post_id = post_id;
|
172 |
+
|
173 |
+
if ( lock )
|
174 |
+
send.lock = lock;
|
175 |
+
|
176 |
+
data['wp-refresh-post-lock'] = send;
|
177 |
+
|
178 |
+
}).on( 'heartbeat-tick.refresh-lock', function( e, data ) {
|
179 |
+
// Post locks: update the lock string or show the dialog if somebody has taken over editing.
|
180 |
+
var received, wrap, avatar;
|
181 |
+
|
182 |
+
if ( data['wp-refresh-post-lock'] ) {
|
183 |
+
received = data['wp-refresh-post-lock'];
|
184 |
+
|
185 |
+
if ( received.lock_error ) {
|
186 |
+
// Show "editing taken over" message.
|
187 |
+
wrap = $('#post-lock-dialog');
|
188 |
+
|
189 |
+
if ( wrap.length && ! wrap.is(':visible') ) {
|
190 |
+
if ( wp.autosave ) {
|
191 |
+
// Save the latest changes and disable.
|
192 |
+
$(document).one( 'heartbeat-tick', function() {
|
193 |
+
wp.autosave.server.suspend();
|
194 |
+
wrap.removeClass('saving').addClass('saved');
|
195 |
+
$(window).off( 'beforeunload.edit-post' );
|
196 |
+
});
|
197 |
+
|
198 |
+
wrap.addClass('saving');
|
199 |
+
wp.autosave.server.triggerSave();
|
200 |
+
}
|
201 |
+
|
202 |
+
if ( received.lock_error.avatar_src ) {
|
203 |
+
avatar = $( '<img class="avatar avatar-64 photo" width="64" height="64" alt="" />' ).attr( 'src', received.lock_error.avatar_src.replace( /&/g, '&' ) );
|
204 |
+
wrap.find('div.post-locked-avatar').empty().append( avatar );
|
205 |
+
}
|
206 |
+
|
207 |
+
wrap.show().find('.currently-editing').text( received.lock_error.text );
|
208 |
+
wrap.find('.wp-tab-first').focus();
|
209 |
+
}
|
210 |
+
} else if ( received.new_lock ) {
|
211 |
+
$('#active_post_lock').val( received.new_lock );
|
212 |
+
}
|
213 |
+
}
|
214 |
+
}).on( 'before-autosave.update-post-slug', function() {
|
215 |
+
titleHasFocus = document.activeElement && document.activeElement.id === 'title';
|
216 |
+
}).on( 'after-autosave.update-post-slug', function() {
|
217 |
+
|
218 |
+
/*
|
219 |
+
* Create slug area only if not already there
|
220 |
+
* and the title field was not focused (user was not typing a title) when autosave ran.
|
221 |
+
*/
|
222 |
+
if ( ! $('#edit-slug-box > *').length && ! titleHasFocus ) {
|
223 |
+
$.post( ajaxurl, {
|
224 |
+
action: 'sample-permalink',
|
225 |
+
post_id: $('#post_ID').val(),
|
226 |
+
new_title: $('#title').val(),
|
227 |
+
samplepermalinknonce: $('#samplepermalinknonce').val()
|
228 |
+
},
|
229 |
+
function( data ) {
|
230 |
+
if ( data != '-1' ) {
|
231 |
+
$('#edit-slug-box').html(data);
|
232 |
+
}
|
233 |
+
}
|
234 |
+
);
|
235 |
+
}
|
236 |
+
});
|
237 |
+
|
238 |
+
}(jQuery));
|
239 |
+
|
240 |
+
/**
|
241 |
+
* Heartbeat refresh nonces.
|
242 |
+
*/
|
243 |
+
(function($) {
|
244 |
+
var check, timeout;
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Only allow to check for nonce refresh every 30 seconds.
|
248 |
+
*/
|
249 |
+
function schedule() {
|
250 |
+
check = false;
|
251 |
+
window.clearTimeout( timeout );
|
252 |
+
timeout = window.setTimeout( function(){ check = true; }, 300000 );
|
253 |
+
}
|
254 |
+
|
255 |
+
$(document).on( 'heartbeat-send.wp-refresh-nonces', function( e, data ) {
|
256 |
+
var post_id,
|
257 |
+
$authCheck = $('#wp-auth-check-wrap');
|
258 |
+
|
259 |
+
if ( check || ( $authCheck.length && ! $authCheck.hasClass( 'hidden' ) ) ) {
|
260 |
+
if ( ( post_id = $('#post_ID').val() ) && $('#_wpnonce').val() ) {
|
261 |
+
data['wp-refresh-post-nonces'] = {
|
262 |
+
post_id: post_id
|
263 |
+
};
|
264 |
+
}
|
265 |
+
}
|
266 |
+
}).on( 'heartbeat-tick.wp-refresh-nonces', function( e, data ) {
|
267 |
+
var nonces = data['wp-refresh-post-nonces'];
|
268 |
+
|
269 |
+
if ( nonces ) {
|
270 |
+
schedule();
|
271 |
+
|
272 |
+
if ( nonces.replace ) {
|
273 |
+
$.each( nonces.replace, function( selector, value ) {
|
274 |
+
$( '#' + selector ).val( value );
|
275 |
+
});
|
276 |
+
}
|
277 |
+
|
278 |
+
if ( nonces.heartbeatNonce )
|
279 |
+
window.heartbeatSettings.nonce = nonces.heartbeatNonce;
|
280 |
+
}
|
281 |
+
}).ready( function() {
|
282 |
+
schedule();
|
283 |
+
});
|
284 |
+
}(jQuery));
|
285 |
+
|
286 |
+
/**
|
287 |
+
* All post and postbox controls and functionality.
|
288 |
+
*/
|
289 |
+
jQuery(document).ready( function($) {
|
290 |
+
var stamp, visibility, $submitButtons, updateVisibility, updateText,
|
291 |
+
sticky = '',
|
292 |
+
$textarea = $('#content'),
|
293 |
+
$document = $(document),
|
294 |
+
postId = $('#post_ID').val() || 0,
|
295 |
+
$submitpost = $('#submitpost'),
|
296 |
+
releaseLock = true,
|
297 |
+
$postVisibilitySelect = $('#post-visibility-select'),
|
298 |
+
$timestampdiv = $('#timestampdiv'),
|
299 |
+
$postStatusSelect = $('#post-status-select'),
|
300 |
+
isMac = window.navigator.platform ? window.navigator.platform.indexOf( 'Mac' ) !== -1 : false;
|
301 |
+
|
302 |
+
postboxes.add_postbox_toggles(pagenow);
|
303 |
+
|
304 |
+
/*
|
305 |
+
* Clear the window name. Otherwise if this is a former preview window where the user navigated to edit another post,
|
306 |
+
* and the first post is still being edited, clicking Preview there will use this window to show the preview.
|
307 |
+
*/
|
308 |
+
window.name = '';
|
309 |
+
|
310 |
+
// Post locks: contain focus inside the dialog. If the dialog is shown, focus the first item.
|
311 |
+
$('#post-lock-dialog .notification-dialog').on( 'keydown', function(e) {
|
312 |
+
// Don't do anything when [tab] is pressed.
|
313 |
+
if ( e.which != 9 )
|
314 |
+
return;
|
315 |
+
|
316 |
+
var target = $(e.target);
|
317 |
+
|
318 |
+
// [shift] + [tab] on first tab cycles back to last tab.
|
319 |
+
if ( target.hasClass('wp-tab-first') && e.shiftKey ) {
|
320 |
+
$(this).find('.wp-tab-last').focus();
|
321 |
+
e.preventDefault();
|
322 |
+
// [tab] on last tab cycles back to first tab.
|
323 |
+
} else if ( target.hasClass('wp-tab-last') && ! e.shiftKey ) {
|
324 |
+
$(this).find('.wp-tab-first').focus();
|
325 |
+
e.preventDefault();
|
326 |
+
}
|
327 |
+
}).filter(':visible').find('.wp-tab-first').focus();
|
328 |
+
|
329 |
+
// Set the heartbeat interval to 15 sec. if post lock dialogs are enabled.
|
330 |
+
if ( wp.heartbeat && $('#post-lock-dialog').length ) {
|
331 |
+
wp.heartbeat.interval( 15 );
|
332 |
+
}
|
333 |
+
|
334 |
+
// The form is being submitted by the user.
|
335 |
+
$submitButtons = $submitpost.find( ':submit, a.submitdelete, #post-preview' ).on( 'click.edit-post', function( event ) {
|
336 |
+
var $button = $(this);
|
337 |
+
|
338 |
+
if ( $button.hasClass('disabled') ) {
|
339 |
+
event.preventDefault();
|
340 |
+
return;
|
341 |
+
}
|
342 |
+
|
343 |
+
if ( $button.hasClass('submitdelete') || $button.is( '#post-preview' ) ) {
|
344 |
+
return;
|
345 |
+
}
|
346 |
+
|
347 |
+
// The form submission can be blocked from JS or by using HTML 5.0 validation on some fields.
|
348 |
+
// Run this only on an actual 'submit'.
|
349 |
+
$('form#post').off( 'submit.edit-post' ).on( 'submit.edit-post', function( event ) {
|
350 |
+
if ( event.isDefaultPrevented() ) {
|
351 |
+
return;
|
352 |
+
}
|
353 |
+
|
354 |
+
// Stop auto save.
|
355 |
+
if ( wp.autosave ) {
|
356 |
+
wp.autosave.server.suspend();
|
357 |
+
}
|
358 |
+
|
359 |
+
if ( typeof commentReply !== 'undefined' ) {
|
360 |
+
/*
|
361 |
+
* Warn the user they have an unsaved comment before submitting
|
362 |
+
* the post data for update.
|
363 |
+
*/
|
364 |
+
if ( ! commentReply.discardCommentChanges() ) {
|
365 |
+
return false;
|
366 |
+
}
|
367 |
+
|
368 |
+
/*
|
369 |
+
* Close the comment edit/reply form if open to stop the form
|
370 |
+
* action from interfering with the post's form action.
|
371 |
+
*/
|
372 |
+
commentReply.close();
|
373 |
+
}
|
374 |
+
|
375 |
+
releaseLock = false;
|
376 |
+
$(window).off( 'beforeunload.edit-post' );
|
377 |
+
|
378 |
+
$submitButtons.addClass( 'disabled' );
|
379 |
+
|
380 |
+
if ( $button.attr('id') === 'publish' ) {
|
381 |
+
$submitpost.find( '#major-publishing-actions .spinner' ).addClass( 'is-active' );
|
382 |
+
} else {
|
383 |
+
$submitpost.find( '#minor-publishing .spinner' ).addClass( 'is-active' );
|
384 |
+
}
|
385 |
+
});
|
386 |
+
});
|
387 |
+
|
388 |
+
// Submit the form saving a draft or an autosave, and show a preview in a new tab
|
389 |
+
$('#post-preview').on( 'click.post-preview', function( event ) {
|
390 |
+
var $this = $(this),
|
391 |
+
$form = $('form#post'),
|
392 |
+
$previewField = $('input#wp-preview'),
|
393 |
+
target = $this.attr('target') || 'wp-preview',
|
394 |
+
ua = navigator.userAgent.toLowerCase();
|
395 |
+
|
396 |
+
event.preventDefault();
|
397 |
+
|
398 |
+
if ( $this.hasClass('disabled') ) {
|
399 |
+
return;
|
400 |
+
}
|
401 |
+
|
402 |
+
if ( wp.autosave ) {
|
403 |
+
wp.autosave.server.tempBlockSave();
|
404 |
+
}
|
405 |
+
|
406 |
+
$previewField.val('dopreview');
|
407 |
+
$form.attr( 'target', target ).submit().attr( 'target', '' );
|
408 |
+
|
409 |
+
// Workaround for WebKit bug preventing a form submitting twice to the same action.
|
410 |
+
// https://bugs.webkit.org/show_bug.cgi?id=28633
|
411 |
+
if ( ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1 ) {
|
412 |
+
$form.attr( 'action', function( index, value ) {
|
413 |
+
return value + '?t=' + ( new Date() ).getTime();
|
414 |
+
});
|
415 |
+
}
|
416 |
+
|
417 |
+
$previewField.val('');
|
418 |
+
});
|
419 |
+
|
420 |
+
// This code is meant to allow tabbing from Title to Post content.
|
421 |
+
$('#title').on( 'keydown.editor-focus', function( event ) {
|
422 |
+
var editor;
|
423 |
+
|
424 |
+
if ( event.keyCode === 9 && ! event.ctrlKey && ! event.altKey && ! event.shiftKey ) {
|
425 |
+
editor = typeof tinymce != 'undefined' && tinymce.get('content');
|
426 |
+
|
427 |
+
if ( editor && ! editor.isHidden() ) {
|
428 |
+
editor.focus();
|
429 |
+
} else if ( $textarea.length ) {
|
430 |
+
$textarea.focus();
|
431 |
+
} else {
|
432 |
+
return;
|
433 |
+
}
|
434 |
+
|
435 |
+
event.preventDefault();
|
436 |
+
}
|
437 |
+
});
|
438 |
+
|
439 |
+
// Auto save new posts after a title is typed.
|
440 |
+
if ( $( '#auto_draft' ).val() ) {
|
441 |
+
$( '#title' ).blur( function() {
|
442 |
+
var cancel;
|
443 |
+
|
444 |
+
if ( ! this.value || $('#edit-slug-box > *').length ) {
|
445 |
+
return;
|
446 |
+
}
|
447 |
+
|
448 |
+
// Cancel the auto save when the blur was triggered by the user submitting the form.
|
449 |
+
$('form#post').one( 'submit', function() {
|
450 |
+
cancel = true;
|
451 |
+
});
|
452 |
+
|
453 |
+
window.setTimeout( function() {
|
454 |
+
if ( ! cancel && wp.autosave ) {
|
455 |
+
wp.autosave.server.triggerSave();
|
456 |
+
}
|
457 |
+
}, 200 );
|
458 |
+
});
|
459 |
+
}
|
460 |
+
|
461 |
+
$document.on( 'autosave-disable-buttons.edit-post', function() {
|
462 |
+
$submitButtons.addClass( 'disabled' );
|
463 |
+
}).on( 'autosave-enable-buttons.edit-post', function() {
|
464 |
+
if ( ! wp.heartbeat || ! wp.heartbeat.hasConnectionError() ) {
|
465 |
+
$submitButtons.removeClass( 'disabled' );
|
466 |
+
}
|
467 |
+
}).on( 'before-autosave.edit-post', function() {
|
468 |
+
$( '.autosave-message' ).text( postL10n.savingText );
|
469 |
+
}).on( 'after-autosave.edit-post', function( event, data ) {
|
470 |
+
$( '.autosave-message' ).text( data.message );
|
471 |
+
|
472 |
+
if ( $( document.body ).hasClass( 'post-new-php' ) ) {
|
473 |
+
$( '.submitbox .submitdelete' ).show();
|
474 |
+
}
|
475 |
+
});
|
476 |
+
|
477 |
+
/*
|
478 |
+
* When the user is trying to load another page, or reloads current page
|
479 |
+
* show a confirmation dialog when there are unsaved changes.
|
480 |
+
*/
|
481 |
+
$(window).on( 'beforeunload.edit-post', function() {
|
482 |
+
var editor = typeof tinymce !== 'undefined' && tinymce.get('content');
|
483 |
+
|
484 |
+
if ( ( editor && ! editor.isHidden() && editor.isDirty() ) ||
|
485 |
+
( wp.autosave && wp.autosave.server.postChanged() ) ) {
|
486 |
+
|
487 |
+
return postL10n.saveAlert;
|
488 |
+
}
|
489 |
+
}).on( 'unload.edit-post', function( event ) {
|
490 |
+
if ( ! releaseLock ) {
|
491 |
+
return;
|
492 |
+
}
|
493 |
+
|
494 |
+
/*
|
495 |
+
* Unload is triggered (by hand) on removing the Thickbox iframe.
|
496 |
+
* Make sure we process only the main document unload.
|
497 |
+
*/
|
498 |
+
if ( event.target && event.target.nodeName != '#document' ) {
|
499 |
+
return;
|
500 |
+
}
|
501 |
+
|
502 |
+
var postID = $('#post_ID').val();
|
503 |
+
var postLock = $('#active_post_lock').val();
|
504 |
+
|
505 |
+
if ( ! postID || ! postLock ) {
|
506 |
+
return;
|
507 |
+
}
|
508 |
+
|
509 |
+
var data = {
|
510 |
+
action: 'wp-remove-post-lock',
|
511 |
+
_wpnonce: $('#_wpnonce').val(),
|
512 |
+
post_ID: postID,
|
513 |
+
active_post_lock: postLock
|
514 |
+
};
|
515 |
+
|
516 |
+
if ( window.FormData && window.navigator.sendBeacon ) {
|
517 |
+
var formData = new window.FormData();
|
518 |
+
|
519 |
+
$.each( data, function( key, value ) {
|
520 |
+
formData.append( key, value );
|
521 |
+
});
|
522 |
+
|
523 |
+
if ( window.navigator.sendBeacon( ajaxurl, formData ) ) {
|
524 |
+
return;
|
525 |
+
}
|
526 |
+
}
|
527 |
+
|
528 |
+
// Fall back to a synchronous POST request.
|
529 |
+
// See https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon
|
530 |
+
$.post({
|
531 |
+
async: false,
|
532 |
+
data: data,
|
533 |
+
url: ajaxurl
|
534 |
+
});
|
535 |
+
});
|
536 |
+
|
537 |
+
// Multiple Taxonomies.
|
538 |
+
if ( $('#tagsdiv-post_tag').length ) {
|
539 |
+
window.tagBox && window.tagBox.init();
|
540 |
+
} else {
|
541 |
+
$('.meta-box-sortables').children('div.postbox').each(function(){
|
542 |
+
if ( this.id.indexOf('tagsdiv-') === 0 ) {
|
543 |
+
window.tagBox && window.tagBox.init();
|
544 |
+
return false;
|
545 |
+
}
|
546 |
+
});
|
547 |
+
}
|
548 |
+
|
549 |
+
// Handle categories.
|
550 |
+
$('.categorydiv').each( function(){
|
551 |
+
var this_id = $(this).attr('id'), catAddBefore, catAddAfter, taxonomyParts, taxonomy, settingName;
|
552 |
+
|
553 |
+
taxonomyParts = this_id.split('-');
|
554 |
+
taxonomyParts.shift();
|
555 |
+
taxonomy = taxonomyParts.join('-');
|
556 |
+
settingName = taxonomy + '_tab';
|
557 |
+
|
558 |
+
if ( taxonomy == 'category' ) {
|
559 |
+
settingName = 'cats';
|
560 |
+
}
|
561 |
+
|
562 |
+
// TODO: move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.js
|
563 |
+
$('a', '#' + taxonomy + '-tabs').click( function( e ) {
|
564 |
+
e.preventDefault();
|
565 |
+
var t = $(this).attr('href');
|
566 |
+
$(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
|
567 |
+
$('#' + taxonomy + '-tabs').siblings('.tabs-panel').hide();
|
568 |
+
$(t).show();
|
569 |
+
if ( '#' + taxonomy + '-all' == t ) {
|
570 |
+
deleteUserSetting( settingName );
|
571 |
+
} else {
|
572 |
+
setUserSetting( settingName, 'pop' );
|
573 |
+
}
|
574 |
+
});
|
575 |
+
|
576 |
+
if ( getUserSetting( settingName ) )
|
577 |
+
$('a[href="#' + taxonomy + '-pop"]', '#' + taxonomy + '-tabs').click();
|
578 |
+
|
579 |
+
// Add category button controls.
|
580 |
+
$('#new' + taxonomy).one( 'focus', function() {
|
581 |
+
$( this ).val( '' ).removeClass( 'form-input-tip' );
|
582 |
+
});
|
583 |
+
|
584 |
+
// On [enter] submit the taxonomy.
|
585 |
+
$('#new' + taxonomy).keypress( function(event){
|
586 |
+
if( 13 === event.keyCode ) {
|
587 |
+
event.preventDefault();
|
588 |
+
$('#' + taxonomy + '-add-submit').click();
|
589 |
+
}
|
590 |
+
});
|
591 |
+
|
592 |
+
// After submitting a new taxonomy, re-focus the input field.
|
593 |
+
$('#' + taxonomy + '-add-submit').click( function() {
|
594 |
+
$('#new' + taxonomy).focus();
|
595 |
+
});
|
596 |
+
|
597 |
+
/**
|
598 |
+
* Before adding a new taxonomy, disable submit button.
|
599 |
+
*
|
600 |
+
* @param {Object} s Taxonomy object which will be added.
|
601 |
+
*
|
602 |
+
* @returns {Object}
|
603 |
+
*/
|
604 |
+
catAddBefore = function( s ) {
|
605 |
+
if ( !$('#new'+taxonomy).val() ) {
|
606 |
+
return false;
|
607 |
+
}
|
608 |
+
|
609 |
+
s.data += '&' + $( ':checked', '#'+taxonomy+'checklist' ).serialize();
|
610 |
+
$( '#' + taxonomy + '-add-submit' ).prop( 'disabled', true );
|
611 |
+
return s;
|
612 |
+
};
|
613 |
+
|
614 |
+
/**
|
615 |
+
* Re-enable submit button after a taxonomy has been added.
|
616 |
+
*
|
617 |
+
* Re-enable submit button.
|
618 |
+
* If the taxonomy has a parent place the taxonomy underneath the parent.
|
619 |
+
*
|
620 |
+
* @param {Object} r Response.
|
621 |
+
* @param {Object} s Taxonomy data.
|
622 |
+
*
|
623 |
+
* @returns void
|
624 |
+
*/
|
625 |
+
catAddAfter = function( r, s ) {
|
626 |
+
var sup, drop = $('#new'+taxonomy+'_parent');
|
627 |
+
|
628 |
+
$( '#' + taxonomy + '-add-submit' ).prop( 'disabled', false );
|
629 |
+
if ( 'undefined' != s.parsed.responses[0] && (sup = s.parsed.responses[0].supplemental.newcat_parent) ) {
|
630 |
+
drop.before(sup);
|
631 |
+
drop.remove();
|
632 |
+
}
|
633 |
+
};
|
634 |
+
|
635 |
+
$('#' + taxonomy + 'checklist').wpList({
|
636 |
+
alt: '',
|
637 |
+
response: taxonomy + '-ajax-response',
|
638 |
+
addBefore: catAddBefore,
|
639 |
+
addAfter: catAddAfter
|
640 |
+
});
|
641 |
+
|
642 |
+
// Add new taxonomy button toggles input form visibility.
|
643 |
+
$('#' + taxonomy + '-add-toggle').click( function( e ) {
|
644 |
+
e.preventDefault();
|
645 |
+
$('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' );
|
646 |
+
$('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').click();
|
647 |
+
$('#new'+taxonomy).focus();
|
648 |
+
});
|
649 |
+
|
650 |
+
// Sync checked items between "All {taxonomy}" and "Most used" lists.
|
651 |
+
$('#' + taxonomy + 'checklist, #' + taxonomy + 'checklist-pop').on( 'click', 'li.popular-category > label input[type="checkbox"]', function() {
|
652 |
+
var t = $(this), c = t.is(':checked'), id = t.val();
|
653 |
+
if ( id && t.parents('#taxonomy-'+taxonomy).length )
|
654 |
+
$('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c );
|
655 |
+
});
|
656 |
+
|
657 |
+
}); // end cats
|
658 |
+
|
659 |
+
// Custom Fields postbox.
|
660 |
+
if ( $('#postcustom').length ) {
|
661 |
+
$( '#the-list' ).wpList( {
|
662 |
+
/**
|
663 |
+
* Add current post_ID to request to fetch custom fields
|
664 |
+
*
|
665 |
+
* @param {Object} s Request object.
|
666 |
+
*
|
667 |
+
* @returns {Object} Data modified with post_ID attached.
|
668 |
+
*/
|
669 |
+
addBefore: function( s ) {
|
670 |
+
s.data += '&post_id=' + $('#post_ID').val();
|
671 |
+
return s;
|
672 |
+
},
|
673 |
+
/**
|
674 |
+
* Show the listing of custom fields after fetching.
|
675 |
+
*/
|
676 |
+
addAfter: function() {
|
677 |
+
$('table#list-table').show();
|
678 |
+
}
|
679 |
+
});
|
680 |
+
}
|
681 |
+
|
682 |
+
/*
|
683 |
+
* Publish Post box (#submitdiv)
|
684 |
+
*/
|
685 |
+
if ( $('#submitdiv').length ) {
|
686 |
+
stamp = $('#timestamp').html();
|
687 |
+
visibility = $('#post-visibility-display').html();
|
688 |
+
|
689 |
+
/**
|
690 |
+
* When the visibility of a post changes sub-options should be shown or hidden.
|
691 |
+
*
|
692 |
+
* @returns void
|
693 |
+
*/
|
694 |
+
updateVisibility = function() {
|
695 |
+
// Show sticky for public posts.
|
696 |
+
if ( $postVisibilitySelect.find('input:radio:checked').val() != 'public' ) {
|
697 |
+
$('#sticky').prop('checked', false);
|
698 |
+
$('#sticky-span').hide();
|
699 |
+
} else {
|
700 |
+
$('#sticky-span').show();
|
701 |
+
}
|
702 |
+
|
703 |
+
// Show password input field for password protected post.
|
704 |
+
if ( $postVisibilitySelect.find('input:radio:checked').val() != 'password' ) {
|
705 |
+
$('#password-span').hide();
|
706 |
+
} else {
|
707 |
+
$('#password-span').show();
|
708 |
+
}
|
709 |
+
};
|
710 |
+
|
711 |
+
/**
|
712 |
+
* Make sure all labels represent the current settings.
|
713 |
+
*
|
714 |
+
* @returns {boolean} False when an invalid timestamp has been selected, otherwise True.
|
715 |
+
*/
|
716 |
+
updateText = function() {
|
717 |
+
|
718 |
+
if ( ! $timestampdiv.length )
|
719 |
+
return true;
|
720 |
+
|
721 |
+
var attemptedDate, originalDate, currentDate, publishOn, postStatus = $('#post_status'),
|
722 |
+
optPublish = $('option[value="publish"]', postStatus), aa = $('#aa').val(),
|
723 |
+
mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val();
|
724 |
+
|
725 |
+
attemptedDate = new Date( aa, mm - 1, jj, hh, mn );
|
726 |
+
originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val() );
|
727 |
+
currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val() );
|
728 |
+
|
729 |
+
// Catch unexpected date problems.
|
730 |
+
if ( attemptedDate.getFullYear() != aa || (1 + attemptedDate.getMonth()) != mm || attemptedDate.getDate() != jj || attemptedDate.getMinutes() != mn ) {
|
731 |
+
$timestampdiv.find('.timestamp-wrap').addClass('form-invalid');
|
732 |
+
return false;
|
733 |
+
} else {
|
734 |
+
$timestampdiv.find('.timestamp-wrap').removeClass('form-invalid');
|
735 |
+
}
|
736 |
+
|
737 |
+
// Determine what the publish should be depending on the date and post status.
|
738 |
+
if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) {
|
739 |
+
publishOn = postL10n.publishOnFuture;
|
740 |
+
$('#publish').val( postL10n.schedule );
|
741 |
+
} else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) {
|
742 |
+
publishOn = postL10n.publishOn;
|
743 |
+
$('#publish').val( postL10n.publish );
|
744 |
+
} else {
|
745 |
+
publishOn = postL10n.publishOnPast;
|
746 |
+
$('#publish').val( postL10n.update );
|
747 |
+
}
|
748 |
+
|
749 |
+
// If the date is the same, set it to trigger update events.
|
750 |
+
if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) {
|
751 |
+
// Re-set to the current value.
|
752 |
+
$('#timestamp').html(stamp);
|
753 |
+
} else {
|
754 |
+
$('#timestamp').html(
|
755 |
+
'\n' + publishOn + ' <b>' +
|
756 |
+
postL10n.dateFormat
|
757 |
+
.replace( '%1$s', $( 'option[value="' + mm + '"]', '#mm' ).attr( 'data-text' ) )
|
758 |
+
.replace( '%2$s', parseInt( jj, 10 ) )
|
759 |
+
.replace( '%3$s', aa )
|
760 |
+
.replace( '%4$s', ( '00' + hh ).slice( -2 ) )
|
761 |
+
.replace( '%5$s', ( '00' + mn ).slice( -2 ) ) +
|
762 |
+
'</b> '
|
763 |
+
);
|
764 |
+
}
|
765 |
+
|
766 |
+
// Add "privately published" to post status when applies.
|
767 |
+
if ( $postVisibilitySelect.find('input:radio:checked').val() == 'private' ) {
|
768 |
+
$('#publish').val( postL10n.update );
|
769 |
+
if ( 0 === optPublish.length ) {
|
770 |
+
postStatus.append('<option value="publish">' + postL10n.privatelyPublished + '</option>');
|
771 |
+
} else {
|
772 |
+
optPublish.html( postL10n.privatelyPublished );
|
773 |
+
}
|
774 |
+
$('option[value="publish"]', postStatus).prop('selected', true);
|
775 |
+
$('#misc-publishing-actions .edit-post-status').hide();
|
776 |
+
} else {
|
777 |
+
if ( $('#original_post_status').val() == 'future' || $('#original_post_status').val() == 'draft' ) {
|
778 |
+
if ( optPublish.length ) {
|
779 |
+
optPublish.remove();
|
780 |
+
postStatus.val($('#hidden_post_status').val());
|
781 |
+
}
|
782 |
+
} else {
|
783 |
+
optPublish.html( postL10n.published );
|
784 |
+
}
|
785 |
+
if ( postStatus.is(':hidden') )
|
786 |
+
$('#misc-publishing-actions .edit-post-status').show();
|
787 |
+
}
|
788 |
+
|
789 |
+
// Update "Status:" to currently selected status.
|
790 |
+
$('#post-status-display').html($('option:selected', postStatus).text());
|
791 |
+
|
792 |
+
// Show or hide the "Save Draft" button.
|
793 |
+
if ( $('option:selected', postStatus).val() == 'private' || $('option:selected', postStatus).val() == 'publish' ) {
|
794 |
+
$('#save-post').hide();
|
795 |
+
} else {
|
796 |
+
$('#save-post').show();
|
797 |
+
if ( $('option:selected', postStatus).val() == 'pending' ) {
|
798 |
+
$('#save-post').show().val( postL10n.savePending );
|
799 |
+
} else {
|
800 |
+
$('#save-post').show().val( postL10n.saveDraft );
|
801 |
+
}
|
802 |
+
}
|
803 |
+
return true;
|
804 |
+
};
|
805 |
+
|
806 |
+
// Show the visibility options and hide the toggle button when opened.
|
807 |
+
$( '#visibility .edit-visibility').click( function( e ) {
|
808 |
+
e.preventDefault();
|
809 |
+
if ( $postVisibilitySelect.is(':hidden') ) {
|
810 |
+
updateVisibility();
|
811 |
+
$postVisibilitySelect.slideDown( 'fast', function() {
|
812 |
+
$postVisibilitySelect.find( 'input[type="radio"]' ).first().focus();
|
813 |
+
} );
|
814 |
+
$(this).hide();
|
815 |
+
}
|
816 |
+
});
|
817 |
+
|
818 |
+
// Cancel visibility selection area and hide it from view.
|
819 |
+
$postVisibilitySelect.find('.cancel-post-visibility').click( function( event ) {
|
820 |
+
$postVisibilitySelect.slideUp('fast');
|
821 |
+
$('#visibility-radio-' + $('#hidden-post-visibility').val()).prop('checked', true);
|
822 |
+
$('#post_password').val($('#hidden-post-password').val());
|
823 |
+
$('#sticky').prop('checked', $('#hidden-post-sticky').prop('checked'));
|
824 |
+
$('#post-visibility-display').html(visibility);
|
825 |
+
$('#visibility .edit-visibility').show().focus();
|
826 |
+
updateText();
|
827 |
+
event.preventDefault();
|
828 |
+
});
|
829 |
+
|
830 |
+
// Set the selected visibility as current.
|
831 |
+
$postVisibilitySelect.find('.save-post-visibility').click( function( event ) { // crazyhorse - multiple ok cancels
|
832 |
+
$postVisibilitySelect.slideUp('fast');
|
833 |
+
$('#visibility .edit-visibility').show().focus();
|
834 |
+
updateText();
|
835 |
+
|
836 |
+
if ( $postVisibilitySelect.find('input:radio:checked').val() != 'public' ) {
|
837 |
+
$('#sticky').prop('checked', false);
|
838 |
+
}
|
839 |
+
|
840 |
+
if ( $('#sticky').prop('checked') ) {
|
841 |
+
sticky = 'Sticky';
|
842 |
+
} else {
|
843 |
+
sticky = '';
|
844 |
+
}
|
845 |
+
|
846 |
+
$('#post-visibility-display').html( postL10n[ $postVisibilitySelect.find('input:radio:checked').val() + sticky ] );
|
847 |
+
event.preventDefault();
|
848 |
+
});
|
849 |
+
|
850 |
+
// When the selection changes, update labels.
|
851 |
+
$postVisibilitySelect.find('input:radio').change( function() {
|
852 |
+
updateVisibility();
|
853 |
+
});
|
854 |
+
|
855 |
+
// Edit publish time click.
|
856 |
+
$timestampdiv.siblings('a.edit-timestamp').click( function( event ) {
|
857 |
+
if ( $timestampdiv.is( ':hidden' ) ) {
|
858 |
+
$timestampdiv.slideDown( 'fast', function() {
|
859 |
+
$( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first().focus();
|
860 |
+
} );
|
861 |
+
$(this).hide();
|
862 |
+
}
|
863 |
+
event.preventDefault();
|
864 |
+
});
|
865 |
+
|
866 |
+
// Cancel editing the publish time and hide the settings.
|
867 |
+
$timestampdiv.find('.cancel-timestamp').click( function( event ) {
|
868 |
+
$timestampdiv.slideUp('fast').siblings('a.edit-timestamp').show().focus();
|
869 |
+
$('#mm').val($('#hidden_mm').val());
|
870 |
+
$('#jj').val($('#hidden_jj').val());
|
871 |
+
$('#aa').val($('#hidden_aa').val());
|
872 |
+
$('#hh').val($('#hidden_hh').val());
|
873 |
+
$('#mn').val($('#hidden_mn').val());
|
874 |
+
updateText();
|
875 |
+
event.preventDefault();
|
876 |
+
});
|
877 |
+
|
878 |
+
// Save the changed timestamp.
|
879 |
+
$timestampdiv.find('.save-timestamp').click( function( event ) { // crazyhorse - multiple ok cancels
|
880 |
+
if ( updateText() ) {
|
881 |
+
$timestampdiv.slideUp('fast');
|
882 |
+
$timestampdiv.siblings('a.edit-timestamp').show().focus();
|
883 |
+
}
|
884 |
+
event.preventDefault();
|
885 |
+
});
|
886 |
+
|
887 |
+
// Cancel submit when an invalid timestamp has been selected.
|
888 |
+
$('#post').on( 'submit', function( event ) {
|
889 |
+
if ( ! updateText() ) {
|
890 |
+
event.preventDefault();
|
891 |
+
$timestampdiv.show();
|
892 |
+
|
893 |
+
if ( wp.autosave ) {
|
894 |
+
wp.autosave.enableButtons();
|
895 |
+
}
|
896 |
+
|
897 |
+
$( '#publishing-action .spinner' ).removeClass( 'is-active' );
|
898 |
+
}
|
899 |
+
});
|
900 |
+
|
901 |
+
// Post Status edit click.
|
902 |
+
$postStatusSelect.siblings('a.edit-post-status').click( function( event ) {
|
903 |
+
if ( $postStatusSelect.is( ':hidden' ) ) {
|
904 |
+
$postStatusSelect.slideDown( 'fast', function() {
|
905 |
+
$postStatusSelect.find('select').focus();
|
906 |
+
} );
|
907 |
+
$(this).hide();
|
908 |
+
}
|
909 |
+
event.preventDefault();
|
910 |
+
});
|
911 |
+
|
912 |
+
// Save the Post Status changes and hide the options.
|
913 |
+
$postStatusSelect.find('.save-post-status').click( function( event ) {
|
914 |
+
$postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().focus();
|
915 |
+
updateText();
|
916 |
+
event.preventDefault();
|
917 |
+
});
|
918 |
+
|
919 |
+
// Cancel Post Status editing and hide the options.
|
920 |
+
$postStatusSelect.find('.cancel-post-status').click( function( event ) {
|
921 |
+
$postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().focus();
|
922 |
+
$('#post_status').val( $('#hidden_post_status').val() );
|
923 |
+
updateText();
|
924 |
+
event.preventDefault();
|
925 |
+
});
|
926 |
+
}
|
927 |
+
|
928 |
+
/**
|
929 |
+
* Handle the editing of the post_name. Create the required HTML elements and update the changes via AJAX.
|
930 |
+
*
|
931 |
+
* @summary Permalink aka slug aka post_name editing
|
932 |
+
*
|
933 |
+
* @global
|
934 |
+
*
|
935 |
+
* @returns void
|
936 |
+
*/
|
937 |
+
function editPermalink() {
|
938 |
+
var i, slug_value,
|
939 |
+
$el, revert_e,
|
940 |
+
c = 0,
|
941 |
+
real_slug = $('#post_name'),
|
942 |
+
revert_slug = real_slug.val(),
|
943 |
+
permalink = $( '#sample-permalink' ),
|
944 |
+
permalinkOrig = permalink.html(),
|
945 |
+
permalinkInner = $( '#sample-permalink a' ).html(),
|
946 |
+
buttons = $('#edit-slug-buttons'),
|
947 |
+
buttonsOrig = buttons.html(),
|
948 |
+
full = $('#editable-post-name-full');
|
949 |
+
|
950 |
+
// Deal with Twemoji in the post-name.
|
951 |
+
full.find( 'img' ).replaceWith( function() { return this.alt; } );
|
952 |
+
full = full.html();
|
953 |
+
|
954 |
+
permalink.html( permalinkInner );
|
955 |
+
|
956 |
+
// Save current content to revert to when cancelling.
|
957 |
+
$el = $( '#editable-post-name' );
|
958 |
+
revert_e = $el.html();
|
959 |
+
|
960 |
+
buttons.html( '<button type="button" class="save button button-small">' + postL10n.ok + '</button> <button type="button" class="cancel button-link">' + postL10n.cancel + '</button>' );
|
961 |
+
|
962 |
+
// Save permalink changes.
|
963 |
+
buttons.children( '.save' ).click( function() {
|
964 |
+
var new_slug = $el.children( 'input' ).val();
|
965 |
+
|
966 |
+
if ( new_slug == $('#editable-post-name-full').text() ) {
|
967 |
+
buttons.children('.cancel').click();
|
968 |
+
return;
|
969 |
+
}
|
970 |
+
|
971 |
+
$.post(
|
972 |
+
ajaxurl,
|
973 |
+
{
|
974 |
+
action: 'sample-permalink',
|
975 |
+
post_id: postId,
|
976 |
+
new_slug: new_slug,
|
977 |
+
new_title: $('#title').val(),
|
978 |
+
samplepermalinknonce: $('#samplepermalinknonce').val()
|
979 |
+
},
|
980 |
+
function(data) {
|
981 |
+
var box = $('#edit-slug-box');
|
982 |
+
box.html(data);
|
983 |
+
if (box.hasClass('hidden')) {
|
984 |
+
box.fadeIn('fast', function () {
|
985 |
+
box.removeClass('hidden');
|
986 |
+
});
|
987 |
+
}
|
988 |
+
|
989 |
+
buttons.html(buttonsOrig);
|
990 |
+
permalink.html(permalinkOrig);
|
991 |
+
real_slug.val(new_slug);
|
992 |
+
$( '.edit-slug' ).focus();
|
993 |
+
wp.a11y.speak( postL10n.permalinkSaved );
|
994 |
+
}
|
995 |
+
);
|
996 |
+
});
|
997 |
+
|
998 |
+
// Cancel editing of permalink.
|
999 |
+
buttons.children( '.cancel' ).click( function() {
|
1000 |
+
$('#view-post-btn').show();
|
1001 |
+
$el.html(revert_e);
|
1002 |
+
buttons.html(buttonsOrig);
|
1003 |
+
permalink.html(permalinkOrig);
|
1004 |
+
real_slug.val(revert_slug);
|
1005 |
+
$( '.edit-slug' ).focus();
|
1006 |
+
});
|
1007 |
+
|
1008 |
+
// If more than 1/4th of 'full' is '%', make it empty.
|
1009 |
+
for ( i = 0; i < full.length; ++i ) {
|
1010 |
+
if ( '%' == full.charAt(i) )
|
1011 |
+
c++;
|
1012 |
+
}
|
1013 |
+
slug_value = ( c > full.length / 4 ) ? '' : full;
|
1014 |
+
|
1015 |
+
$el.html( '<input type="text" id="new-post-slug" value="' + slug_value + '" autocomplete="off" />' ).children( 'input' ).keydown( function( e ) {
|
1016 |
+
var key = e.which;
|
1017 |
+
// On [enter], just save the new slug, don't save the post.
|
1018 |
+
if ( 13 === key ) {
|
1019 |
+
e.preventDefault();
|
1020 |
+
buttons.children( '.save' ).click();
|
1021 |
+
}
|
1022 |
+
// On [esc] cancel the editing.
|
1023 |
+
if ( 27 === key ) {
|
1024 |
+
buttons.children( '.cancel' ).click();
|
1025 |
+
}
|
1026 |
+
} ).keyup( function() {
|
1027 |
+
real_slug.val( this.value );
|
1028 |
+
}).focus();
|
1029 |
+
}
|
1030 |
+
|
1031 |
+
$( '#titlediv' ).on( 'click', '.edit-slug', function() {
|
1032 |
+
editPermalink();
|
1033 |
+
});
|
1034 |
+
|
1035 |
+
/**
|
1036 |
+
* Add screen reader text to the title prompt when needed.
|
1037 |
+
*
|
1038 |
+
* @summary Title screen reader text handler.
|
1039 |
+
*
|
1040 |
+
* @param {string} id Optional. HTML ID to add the screen reader helper text to.
|
1041 |
+
*
|
1042 |
+
* @global
|
1043 |
+
*
|
1044 |
+
* @returns void
|
1045 |
+
*/
|
1046 |
+
wptitlehint = function(id) {
|
1047 |
+
id = id || 'title';
|
1048 |
+
|
1049 |
+
var title = $('#' + id), titleprompt = $('#' + id + '-prompt-text');
|
1050 |
+
|
1051 |
+
if ( '' === title.val() )
|
1052 |
+
titleprompt.removeClass('screen-reader-text');
|
1053 |
+
|
1054 |
+
titleprompt.click(function(){
|
1055 |
+
$(this).addClass('screen-reader-text');
|
1056 |
+
title.focus();
|
1057 |
+
});
|
1058 |
+
|
1059 |
+
title.blur(function(){
|
1060 |
+
if ( '' === this.value )
|
1061 |
+
titleprompt.removeClass('screen-reader-text');
|
1062 |
+
}).focus(function(){
|
1063 |
+
titleprompt.addClass('screen-reader-text');
|
1064 |
+
}).keydown(function(e){
|
1065 |
+
titleprompt.addClass('screen-reader-text');
|
1066 |
+
$(this).unbind(e);
|
1067 |
+
});
|
1068 |
+
};
|
1069 |
+
|
1070 |
+
wptitlehint();
|
1071 |
+
|
1072 |
+
// Resize the WYSIWYG and plain text editors.
|
1073 |
+
( function() {
|
1074 |
+
var editor, offset, mce,
|
1075 |
+
$handle = $('#post-status-info'),
|
1076 |
+
$postdivrich = $('#postdivrich');
|
1077 |
+
|
1078 |
+
// If there are no textareas or we are on a touch device, we can't do anything.
|
1079 |
+
if ( ! $textarea.length || 'ontouchstart' in window ) {
|
1080 |
+
// Hide the resize handle.
|
1081 |
+
$('#content-resize-handle').hide();
|
1082 |
+
return;
|
1083 |
+
}
|
1084 |
+
|
1085 |
+
/**
|
1086 |
+
* Handle drag event.
|
1087 |
+
*
|
1088 |
+
* @param {Object} event Event containing details about the drag.
|
1089 |
+
*/
|
1090 |
+
function dragging( event ) {
|
1091 |
+
if ( $postdivrich.hasClass( 'wp-editor-expand' ) ) {
|
1092 |
+
return;
|
1093 |
+
}
|
1094 |
+
|
1095 |
+
if ( mce ) {
|
1096 |
+
editor.theme.resizeTo( null, offset + event.pageY );
|
1097 |
+
} else {
|
1098 |
+
$textarea.height( Math.max( 50, offset + event.pageY ) );
|
1099 |
+
}
|
1100 |
+
|
1101 |
+
event.preventDefault();
|
1102 |
+
}
|
1103 |
+
|
1104 |
+
/**
|
1105 |
+
* When the dragging stopped make sure we return focus and do a sanity check on the height.
|
1106 |
+
*/
|
1107 |
+
function endDrag() {
|
1108 |
+
var height, toolbarHeight;
|
1109 |
+
|
1110 |
+
if ( $postdivrich.hasClass( 'wp-editor-expand' ) ) {
|
1111 |
+
return;
|
1112 |
+
}
|
1113 |
+
|
1114 |
+
if ( mce ) {
|
1115 |
+
editor.focus();
|
1116 |
+
toolbarHeight = parseInt( $( '#wp-content-editor-container .mce-toolbar-grp' ).height(), 10 );
|
1117 |
+
|
1118 |
+
if ( toolbarHeight < 10 || toolbarHeight > 200 ) {
|
1119 |
+
toolbarHeight = 30;
|
1120 |
+
}
|
1121 |
+
|
1122 |
+
height = parseInt( $('#content_ifr').css('height'), 10 ) + toolbarHeight - 28;
|
1123 |
+
} else {
|
1124 |
+
$textarea.focus();
|
1125 |
+
height = parseInt( $textarea.css('height'), 10 );
|
1126 |
+
}
|
1127 |
+
|
1128 |
+
$document.off( '.wp-editor-resize' );
|
1129 |
+
|
1130 |
+
// Sanity check: normalize height to stay within acceptable ranges.
|
1131 |
+
if ( height && height > 50 && height < 5000 ) {
|
1132 |
+
setUserSetting( 'ed_size', height );
|
1133 |
+
}
|
1134 |
+
}
|
1135 |
+
|
1136 |
+
$handle.on( 'mousedown.wp-editor-resize', function( event ) {
|
1137 |
+
if ( typeof tinymce !== 'undefined' ) {
|
1138 |
+
editor = tinymce.get('content');
|
1139 |
+
}
|
1140 |
+
|
1141 |
+
if ( editor && ! editor.isHidden() ) {
|
1142 |
+
mce = true;
|
1143 |
+
offset = $('#content_ifr').height() - event.pageY;
|
1144 |
+
} else {
|
1145 |
+
mce = false;
|
1146 |
+
offset = $textarea.height() - event.pageY;
|
1147 |
+
$textarea.blur();
|
1148 |
+
}
|
1149 |
+
|
1150 |
+
$document.on( 'mousemove.wp-editor-resize', dragging )
|
1151 |
+
.on( 'mouseup.wp-editor-resize mouseleave.wp-editor-resize', endDrag );
|
1152 |
+
|
1153 |
+
event.preventDefault();
|
1154 |
+
}).on( 'mouseup.wp-editor-resize', endDrag );
|
1155 |
+
})();
|
1156 |
+
|
1157 |
+
// TinyMCE specific handling of Post Format changes to reflect in the editor.
|
1158 |
+
if ( typeof tinymce !== 'undefined' ) {
|
1159 |
+
// When changing post formats, change the editor body class.
|
1160 |
+
$( '#post-formats-select input.post-format' ).on( 'change.set-editor-class', function() {
|
1161 |
+
var editor, body, format = this.id;
|
1162 |
+
|
1163 |
+
if ( format && $( this ).prop( 'checked' ) && ( editor = tinymce.get( 'content' ) ) ) {
|
1164 |
+
body = editor.getBody();
|
1165 |
+
body.className = body.className.replace( /\bpost-format-[^ ]+/, '' );
|
1166 |
+
editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format );
|
1167 |
+
$( document ).trigger( 'editor-classchange' );
|
1168 |
+
}
|
1169 |
+
});
|
1170 |
+
|
1171 |
+
// When changing page template, change the editor body class
|
1172 |
+
$( '#page_template' ).on( 'change.set-editor-class', function() {
|
1173 |
+
var editor, body, pageTemplate = $( this ).val() || '';
|
1174 |
+
|
1175 |
+
pageTemplate = pageTemplate.substr( pageTemplate.lastIndexOf( '/' ) + 1, pageTemplate.length )
|
1176 |
+
.replace( /\.php$/, '' )
|
1177 |
+
.replace( /\./g, '-' );
|
1178 |
+
|
1179 |
+
if ( pageTemplate && ( editor = tinymce.get( 'content' ) ) ) {
|
1180 |
+
body = editor.getBody();
|
1181 |
+
body.className = body.className.replace( /\bpage-template-[^ ]+/, '' );
|
1182 |
+
editor.dom.addClass( body, 'page-template-' + pageTemplate );
|
1183 |
+
$( document ).trigger( 'editor-classchange' );
|
1184 |
+
}
|
1185 |
+
});
|
1186 |
+
|
1187 |
+
}
|
1188 |
+
|
1189 |
+
// Save on pressing [ctrl]/[command] + [s] in the Text editor.
|
1190 |
+
$textarea.on( 'keydown.wp-autosave', function( event ) {
|
1191 |
+
// Key [s] has code 83.
|
1192 |
+
if ( event.which === 83 ) {
|
1193 |
+
if ( event.shiftKey || event.altKey || ( isMac && ( ! event.metaKey || event.ctrlKey ) ) || ( ! isMac && ! event.ctrlKey ) ) {
|
1194 |
+
return;
|
1195 |
+
}
|
1196 |
+
|
1197 |
+
wp.autosave && wp.autosave.server.triggerSave();
|
1198 |
+
event.preventDefault();
|
1199 |
+
}
|
1200 |
+
});
|
1201 |
+
|
1202 |
+
// If the last status was auto-draft and the save is triggered, edit the current URL.
|
1203 |
+
if ( $( '#original_post_status' ).val() === 'auto-draft' && window.history.replaceState ) {
|
1204 |
+
var location;
|
1205 |
+
|
1206 |
+
$( '#publish' ).on( 'click', function() {
|
1207 |
+
location = window.location.href;
|
1208 |
+
location += ( location.indexOf( '?' ) !== -1 ) ? '&' : '?';
|
1209 |
+
location += 'wp-post-new-reload=true';
|
1210 |
+
|
1211 |
+
window.history.replaceState( null, null, location );
|
1212 |
+
});
|
1213 |
+
}
|
1214 |
+
});
|
1215 |
+
|
1216 |
+
/**
|
1217 |
+
* TinyMCE word count display
|
1218 |
+
*/
|
1219 |
+
( function( $, counter ) {
|
1220 |
+
$( function() {
|
1221 |
+
var $content = $( '#content' ),
|
1222 |
+
$count = $( '#wp-word-count' ).find( '.word-count' ),
|
1223 |
+
prevCount = 0,
|
1224 |
+
contentEditor;
|
1225 |
+
|
1226 |
+
/**
|
1227 |
+
* Get the word count from TinyMCE and display it
|
1228 |
+
*/
|
1229 |
+
function update() {
|
1230 |
+
var text, count;
|
1231 |
+
|
1232 |
+
if ( ! contentEditor || contentEditor.isHidden() ) {
|
1233 |
+
text = $content.val();
|
1234 |
+
} else {
|
1235 |
+
text = contentEditor.getContent( { format: 'raw' } );
|
1236 |
+
}
|
1237 |
+
|
1238 |
+
count = counter.count( text );
|
1239 |
+
|
1240 |
+
if ( count !== prevCount ) {
|
1241 |
+
$count.text( count );
|
1242 |
+
}
|
1243 |
+
|
1244 |
+
prevCount = count;
|
1245 |
+
}
|
1246 |
+
|
1247 |
+
/**
|
1248 |
+
* Bind the word count update triggers.
|
1249 |
+
*
|
1250 |
+
* When a node change in the main TinyMCE editor has been triggered.
|
1251 |
+
* When a key has been released in the plain text content editor.
|
1252 |
+
*/
|
1253 |
+
$( document ).on( 'tinymce-editor-init', function( event, editor ) {
|
1254 |
+
if ( editor.id !== 'content' ) {
|
1255 |
+
return;
|
1256 |
+
}
|
1257 |
+
|
1258 |
+
contentEditor = editor;
|
1259 |
+
|
1260 |
+
editor.on( 'nodechange keyup', _.debounce( update, 1000 ) );
|
1261 |
+
} );
|
1262 |
+
|
1263 |
+
$content.on( 'input keyup', _.debounce( update, 1000 ) );
|
1264 |
+
|
1265 |
+
update();
|
1266 |
+
} );
|
1267 |
+
} )( jQuery, new wp.utils.WordCounter() );
|
lib/classic-editor/js/post.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var commentsBox,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint,makeSlugeditClickable,editPermalink;makeSlugeditClickable=editPermalink=function(){},window.wp=window.wp||{},function(a){var b=!1;commentsBox={st:0,get:function(b,c){var d,e=this.st;return c||(c=20),this.st+=c,this.total=b,a("#commentsdiv .spinner").addClass("is-active"),d={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),p:a("#post_ID").val(),start:e,number:c},a.post(ajaxurl,d,function(b){return b=wpAjax.parseAjaxResponse(b),a("#commentsdiv .widefat").show(),a("#commentsdiv .spinner").removeClass("is-active"),"object"==typeof b&&b.responses[0]?(a("#the-comment-list").append(b.responses[0].data),theList=theExtraList=null,a("a[className*=':']").unbind(),void(commentsBox.st>commentsBox.total?a("#show-comments").hide():a("#show-comments").show().children("a").html(postL10n.showcomm))):1==b?void a("#show-comments").html(postL10n.endcomm):void a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")}),!1},load:function(a){this.st=jQuery("#the-comment-list tr.comment:visible").length,this.get(a)}},WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)},WPSetThumbnailID=function(b){var c=a('input[value="_thumbnail_id"]',"#list-table");c.length>0&&a("#meta\\["+c.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(b)},WPRemoveThumbnail=function(b){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(a){"0"==a?alert(setPostThumbnailL10n.error):WPSetThumbnailHTML(a)})},a(document).on("heartbeat-send.refresh-lock",function(b,c){var d=a("#active_post_lock").val(),e=a("#post_ID").val(),f={};e&&a("#post-lock-dialog").length&&(f.post_id=e,d&&(f.lock=d),c["wp-refresh-post-lock"]=f)}).on("heartbeat-tick.refresh-lock",function(b,c){var d,e,f;c["wp-refresh-post-lock"]&&(d=c["wp-refresh-post-lock"],d.lock_error?(e=a("#post-lock-dialog"),e.length&&!e.is(":visible")&&(wp.autosave&&(a(document).one("heartbeat-tick",function(){wp.autosave.server.suspend(),e.removeClass("saving").addClass("saved"),a(window).off("beforeunload.edit-post")}),e.addClass("saving"),wp.autosave.server.triggerSave()),d.lock_error.avatar_src&&(f=a('<img class="avatar avatar-64 photo" width="64" height="64" alt="" />').attr("src",d.lock_error.avatar_src.replace(/&/g,"&")),e.find("div.post-locked-avatar").empty().append(f)),e.show().find(".currently-editing").text(d.lock_error.text),e.find(".wp-tab-first").focus())):d.new_lock&&a("#active_post_lock").val(d.new_lock))}).on("before-autosave.update-post-slug",function(){b=document.activeElement&&"title"===document.activeElement.id}).on("after-autosave.update-post-slug",function(){a("#edit-slug-box > *").length||b||a.post(ajaxurl,{action:"sample-permalink",post_id:a("#post_ID").val(),new_title:a("#title").val(),samplepermalinknonce:a("#samplepermalinknonce").val()},function(b){"-1"!=b&&a("#edit-slug-box").html(b)})})}(jQuery),function(a){function b(){c=!1,window.clearTimeout(d),d=window.setTimeout(function(){c=!0},3e5)}var c,d;a(document).on("heartbeat-send.wp-refresh-nonces",function(b,d){var e,f=a("#wp-auth-check-wrap");(c||f.length&&!f.hasClass("hidden"))&&(e=a("#post_ID").val())&&a("#_wpnonce").val()&&(d["wp-refresh-post-nonces"]={post_id:e})}).on("heartbeat-tick.wp-refresh-nonces",function(c,d){var e=d["wp-refresh-post-nonces"];e&&(b(),e.replace&&a.each(e.replace,function(b,c){a("#"+b).val(c)}),e.heartbeatNonce&&(window.heartbeatSettings.nonce=e.heartbeatNonce))}).ready(function(){b()})}(jQuery),jQuery(document).ready(function(a){function b(){var b,c,d,e,f=0,g=a("#post_name"),h=g.val(),i=a("#sample-permalink"),j=i.html(),l=a("#sample-permalink a").html(),m=a("#edit-slug-buttons"),n=m.html(),o=a("#editable-post-name-full");for(o.find("img").replaceWith(function(){return this.alt}),o=o.html(),i.html(l),d=a("#editable-post-name"),e=d.html(),m.html('<button type="button" class="save button button-small">'+postL10n.ok+'</button> <button type="button" class="cancel button-link">'+postL10n.cancel+"</button>"),m.children(".save").click(function(){var b=d.children("input").val();return b==a("#editable-post-name-full").text()?void m.children(".cancel").click():void a.post(ajaxurl,{action:"sample-permalink",post_id:k,new_slug:b,new_title:a("#title").val(),samplepermalinknonce:a("#samplepermalinknonce").val()},function(c){var d=a("#edit-slug-box");d.html(c),d.hasClass("hidden")&&d.fadeIn("fast",function(){d.removeClass("hidden")}),m.html(n),i.html(j),g.val(b),a(".edit-slug").focus(),wp.a11y.speak(postL10n.permalinkSaved)})}),m.children(".cancel").click(function(){a("#view-post-btn").show(),d.html(e),m.html(n),i.html(j),g.val(h),a(".edit-slug").focus()}),b=0;b<o.length;++b)"%"==o.charAt(b)&&f++;c=f>o.length/4?"":o,d.html('<input type="text" id="new-post-slug" value="'+c+'" autocomplete="off" />').children("input").keydown(function(a){var b=a.which;13===b&&(a.preventDefault(),m.children(".save").click()),27===b&&m.children(".cancel").click()}).keyup(function(){g.val(this.value)}).focus()}var c,d,e,f,g,h="",i=a("#content"),j=a(document),k=a("#post_ID").val()||0,l=a("#submitpost"),m=!0,n=a("#post-visibility-select"),o=a("#timestampdiv"),p=a("#post-status-select"),q=!!window.navigator.platform&&window.navigator.platform.indexOf("Mac")!==-1;if(postboxes.add_postbox_toggles(pagenow),window.name="",a("#post-lock-dialog .notification-dialog").on("keydown",function(b){if(9==b.which){var c=a(b.target);c.hasClass("wp-tab-first")&&b.shiftKey?(a(this).find(".wp-tab-last").focus(),b.preventDefault()):c.hasClass("wp-tab-last")&&!b.shiftKey&&(a(this).find(".wp-tab-first").focus(),b.preventDefault())}}).filter(":visible").find(".wp-tab-first").focus(),wp.heartbeat&&a("#post-lock-dialog").length&&wp.heartbeat.interval(15),e=l.find(":submit, a.submitdelete, #post-preview").on("click.edit-post",function(b){var c=a(this);return c.hasClass("disabled")?void b.preventDefault():void(c.hasClass("submitdelete")||c.is("#post-preview")||a("form#post").off("submit.edit-post").on("submit.edit-post",function(b){if(!b.isDefaultPrevented()){if(wp.autosave&&wp.autosave.server.suspend(),"undefined"!=typeof commentReply){if(!commentReply.discardCommentChanges())return!1;commentReply.close()}m=!1,a(window).off("beforeunload.edit-post"),e.addClass("disabled"),"publish"===c.attr("id")?l.find("#major-publishing-actions .spinner").addClass("is-active"):l.find("#minor-publishing .spinner").addClass("is-active")}}))}),a("#post-preview").on("click.post-preview",function(b){var c=a(this),d=a("form#post"),e=a("input#wp-preview"),f=c.attr("target")||"wp-preview",g=navigator.userAgent.toLowerCase();b.preventDefault(),c.hasClass("disabled")||(wp.autosave&&wp.autosave.server.tempBlockSave(),e.val("dopreview"),d.attr("target",f).submit().attr("target",""),g.indexOf("safari")!==-1&&g.indexOf("chrome")===-1&&d.attr("action",function(a,b){return b+"?t="+(new Date).getTime()}),e.val(""))}),a("#title").on("keydown.editor-focus",function(a){var b;if(9===a.keyCode&&!a.ctrlKey&&!a.altKey&&!a.shiftKey){if(b="undefined"!=typeof tinymce&&tinymce.get("content"),b&&!b.isHidden())b.focus();else{if(!i.length)return;i.focus()}a.preventDefault()}}),a("#auto_draft").val()&&a("#title").blur(function(){var b;this.value&&!a("#edit-slug-box > *").length&&(a("form#post").one("submit",function(){b=!0}),window.setTimeout(function(){!b&&wp.autosave&&wp.autosave.server.triggerSave()},200))}),j.on("autosave-disable-buttons.edit-post",function(){e.addClass("disabled")}).on("autosave-enable-buttons.edit-post",function(){wp.heartbeat&&wp.heartbeat.hasConnectionError()||e.removeClass("disabled")}).on("before-autosave.edit-post",function(){a(".autosave-message").text(postL10n.savingText)}).on("after-autosave.edit-post",function(b,c){a(".autosave-message").text(c.message),a(document.body).hasClass("post-new-php")&&a(".submitbox .submitdelete").show()}),a(window).on("beforeunload.edit-post",function(){var a="undefined"!=typeof tinymce&&tinymce.get("content");if(a&&!a.isHidden()&&a.isDirty()||wp.autosave&&wp.autosave.server.postChanged())return postL10n.saveAlert}).on("unload.edit-post",function(b){if(m&&(!b.target||"#document"==b.target.nodeName)){var c=a("#post_ID").val(),d=a("#active_post_lock").val();if(c&&d){var e={action:"wp-remove-post-lock",_wpnonce:a("#_wpnonce").val(),post_ID:c,active_post_lock:d};if(window.FormData&&window.navigator.sendBeacon){var f=new window.FormData;if(a.each(e,function(a,b){f.append(a,b)}),window.navigator.sendBeacon(ajaxurl,f))return}a.post({async:!1,data:e,url:ajaxurl})}}}),a("#tagsdiv-post_tag").length?window.tagBox&&window.tagBox.init():a(".meta-box-sortables").children("div.postbox").each(function(){if(0===this.id.indexOf("tagsdiv-"))return window.tagBox&&window.tagBox.init(),!1}),a(".categorydiv").each(function(){var b,c,d,e,f,g=a(this).attr("id");d=g.split("-"),d.shift(),e=d.join("-"),f=e+"_tab","category"==e&&(f="cats"),a("a","#"+e+"-tabs").click(function(b){b.preventDefault();var c=a(this).attr("href");a(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),a("#"+e+"-tabs").siblings(".tabs-panel").hide(),a(c).show(),"#"+e+"-all"==c?deleteUserSetting(f):setUserSetting(f,"pop")}),getUserSetting(f)&&a('a[href="#'+e+'-pop"]',"#"+e+"-tabs").click(),a("#new"+e).one("focus",function(){a(this).val("").removeClass("form-input-tip")}),a("#new"+e).keypress(function(b){13===b.keyCode&&(b.preventDefault(),a("#"+e+"-add-submit").click())}),a("#"+e+"-add-submit").click(function(){a("#new"+e).focus()}),b=function(b){return!!a("#new"+e).val()&&(b.data+="&"+a(":checked","#"+e+"checklist").serialize(),a("#"+e+"-add-submit").prop("disabled",!0),b)},c=function(b,c){var d,f=a("#new"+e+"_parent");a("#"+e+"-add-submit").prop("disabled",!1),"undefined"!=c.parsed.responses[0]&&(d=c.parsed.responses[0].supplemental.newcat_parent)&&(f.before(d),f.remove())},a("#"+e+"checklist").wpList({alt:"",response:e+"-ajax-response",addBefore:b,addAfter:c}),a("#"+e+"-add-toggle").click(function(b){b.preventDefault(),a("#"+e+"-adder").toggleClass("wp-hidden-children"),a('a[href="#'+e+'-all"]',"#"+e+"-tabs").click(),a("#new"+e).focus()}),a("#"+e+"checklist, #"+e+"checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var b=a(this),c=b.is(":checked"),d=b.val();d&&b.parents("#taxonomy-"+e).length&&a("#in-"+e+"-"+d+", #in-popular-"+e+"-"+d).prop("checked",c)})}),a("#postcustom").length&&a("#the-list").wpList({addBefore:function(b){return b.data+="&post_id="+a("#post_ID").val(),b},addAfter:function(){a("table#list-table").show()}}),a("#submitdiv").length&&(c=a("#timestamp").html(),d=a("#post-visibility-display").html(),f=function(){"public"!=n.find("input:radio:checked").val()?(a("#sticky").prop("checked",!1),a("#sticky-span").hide()):a("#sticky-span").show(),"password"!=n.find("input:radio:checked").val()?a("#password-span").hide():a("#password-span").show()},g=function(){if(!o.length)return!0;var b,d,e,f,g=a("#post_status"),h=a('option[value="publish"]',g),i=a("#aa").val(),j=a("#mm").val(),k=a("#jj").val(),l=a("#hh").val(),m=a("#mn").val();return b=new Date(i,j-1,k,l,m),d=new Date(a("#hidden_aa").val(),a("#hidden_mm").val()-1,a("#hidden_jj").val(),a("#hidden_hh").val(),a("#hidden_mn").val()),e=new Date(a("#cur_aa").val(),a("#cur_mm").val()-1,a("#cur_jj").val(),a("#cur_hh").val(),a("#cur_mn").val()),b.getFullYear()!=i||1+b.getMonth()!=j||b.getDate()!=k||b.getMinutes()!=m?(o.find(".timestamp-wrap").addClass("form-invalid"),!1):(o.find(".timestamp-wrap").removeClass("form-invalid"),b>e&&"future"!=a("#original_post_status").val()?(f=postL10n.publishOnFuture,a("#publish").val(postL10n.schedule)):b<=e&&"publish"!=a("#original_post_status").val()?(f=postL10n.publishOn,a("#publish").val(postL10n.publish)):(f=postL10n.publishOnPast,a("#publish").val(postL10n.update)),d.toUTCString()==b.toUTCString()?a("#timestamp").html(c):a("#timestamp").html("\n"+f+" <b>"+postL10n.dateFormat.replace("%1$s",a('option[value="'+j+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(k,10)).replace("%3$s",i).replace("%4$s",("00"+l).slice(-2)).replace("%5$s",("00"+m).slice(-2))+"</b> "),"private"==n.find("input:radio:checked").val()?(a("#publish").val(postL10n.update),0===h.length?g.append('<option value="publish">'+postL10n.privatelyPublished+"</option>"):h.html(postL10n.privatelyPublished),a('option[value="publish"]',g).prop("selected",!0),a("#misc-publishing-actions .edit-post-status").hide()):("future"==a("#original_post_status").val()||"draft"==a("#original_post_status").val()?h.length&&(h.remove(),g.val(a("#hidden_post_status").val())):h.html(postL10n.published),g.is(":hidden")&&a("#misc-publishing-actions .edit-post-status").show()),a("#post-status-display").html(a("option:selected",g).text()),"private"==a("option:selected",g).val()||"publish"==a("option:selected",g).val()?a("#save-post").hide():(a("#save-post").show(),"pending"==a("option:selected",g).val()?a("#save-post").show().val(postL10n.savePending):a("#save-post").show().val(postL10n.saveDraft)),!0)},a("#visibility .edit-visibility").click(function(b){b.preventDefault(),n.is(":hidden")&&(f(),n.slideDown("fast",function(){n.find('input[type="radio"]').first().focus()}),a(this).hide())}),n.find(".cancel-post-visibility").click(function(b){n.slideUp("fast"),a("#visibility-radio-"+a("#hidden-post-visibility").val()).prop("checked",!0),a("#post_password").val(a("#hidden-post-password").val()),a("#sticky").prop("checked",a("#hidden-post-sticky").prop("checked")),a("#post-visibility-display").html(d),a("#visibility .edit-visibility").show().focus(),g(),b.preventDefault()}),n.find(".save-post-visibility").click(function(b){n.slideUp("fast"),a("#visibility .edit-visibility").show().focus(),g(),"public"!=n.find("input:radio:checked").val()&&a("#sticky").prop("checked",!1),h=a("#sticky").prop("checked")?"Sticky":"",a("#post-visibility-display").html(postL10n[n.find("input:radio:checked").val()+h]),b.preventDefault()}),n.find("input:radio").change(function(){f()}),o.siblings("a.edit-timestamp").click(function(b){o.is(":hidden")&&(o.slideDown("fast",function(){a("input, select",o.find(".timestamp-wrap")).first().focus()}),a(this).hide()),b.preventDefault()}),o.find(".cancel-timestamp").click(function(b){o.slideUp("fast").siblings("a.edit-timestamp").show().focus(),a("#mm").val(a("#hidden_mm").val()),a("#jj").val(a("#hidden_jj").val()),a("#aa").val(a("#hidden_aa").val()),a("#hh").val(a("#hidden_hh").val()),a("#mn").val(a("#hidden_mn").val()),g(),b.preventDefault()}),o.find(".save-timestamp").click(function(a){g()&&(o.slideUp("fast"),o.siblings("a.edit-timestamp").show().focus()),a.preventDefault()}),a("#post").on("submit",function(b){g()||(b.preventDefault(),o.show(),wp.autosave&&wp.autosave.enableButtons(),a("#publishing-action .spinner").removeClass("is-active"))}),p.siblings("a.edit-post-status").click(function(b){p.is(":hidden")&&(p.slideDown("fast",function(){p.find("select").focus()}),a(this).hide()),b.preventDefault()}),p.find(".save-post-status").click(function(a){p.slideUp("fast").siblings("a.edit-post-status").show().focus(),g(),a.preventDefault()}),p.find(".cancel-post-status").click(function(b){p.slideUp("fast").siblings("a.edit-post-status").show().focus(),a("#post_status").val(a("#hidden_post_status").val()),g(),b.preventDefault()})),a("#titlediv").on("click",".edit-slug",function(){b()}),wptitlehint=function(b){b=b||"title";var c=a("#"+b),d=a("#"+b+"-prompt-text");""===c.val()&&d.removeClass("screen-reader-text"),d.click(function(){a(this).addClass("screen-reader-text"),c.focus()}),c.blur(function(){""===this.value&&d.removeClass("screen-reader-text")}).focus(function(){d.addClass("screen-reader-text")}).keydown(function(b){d.addClass("screen-reader-text"),a(this).unbind(b)})},wptitlehint(),function(){function b(a){h.hasClass("wp-editor-expand")||(f?d.theme.resizeTo(null,e+a.pageY):i.height(Math.max(50,e+a.pageY)),a.preventDefault())}function c(){var b,c;h.hasClass("wp-editor-expand")||(f?(d.focus(),c=parseInt(a("#wp-content-editor-container .mce-toolbar-grp").height(),10),(c<10||c>200)&&(c=30),b=parseInt(a("#content_ifr").css("height"),10)+c-28):(i.focus(),b=parseInt(i.css("height"),10)),j.off(".wp-editor-resize"),b&&b>50&&b<5e3&&setUserSetting("ed_size",b))}var d,e,f,g=a("#post-status-info"),h=a("#postdivrich");return!i.length||"ontouchstart"in window?void a("#content-resize-handle").hide():void g.on("mousedown.wp-editor-resize",function(g){"undefined"!=typeof tinymce&&(d=tinymce.get("content")),d&&!d.isHidden()?(f=!0,e=a("#content_ifr").height()-g.pageY):(f=!1,e=i.height()-g.pageY,i.blur()),j.on("mousemove.wp-editor-resize",b).on("mouseup.wp-editor-resize mouseleave.wp-editor-resize",c),g.preventDefault()}).on("mouseup.wp-editor-resize",c)}(),"undefined"!=typeof tinymce&&(a("#post-formats-select input.post-format").on("change.set-editor-class",function(){var b,c,d=this.id;d&&a(this).prop("checked")&&(b=tinymce.get("content"))&&(c=b.getBody(),c.className=c.className.replace(/\bpost-format-[^ ]+/,""),b.dom.addClass(c,"post-format-0"==d?"post-format-standard":d),a(document).trigger("editor-classchange"))}),a("#page_template").on("change.set-editor-class",function(){var b,c,d=a(this).val()||"";d=d.substr(d.lastIndexOf("/")+1,d.length).replace(/\.php$/,"").replace(/\./g,"-"),d&&(b=tinymce.get("content"))&&(c=b.getBody(),c.className=c.className.replace(/\bpage-template-[^ ]+/,""),b.dom.addClass(c,"page-template-"+d),a(document).trigger("editor-classchange"))})),i.on("keydown.wp-autosave",function(a){if(83===a.which){if(a.shiftKey||a.altKey||q&&(!a.metaKey||a.ctrlKey)||!q&&!a.ctrlKey)return;wp.autosave&&wp.autosave.server.triggerSave(),a.preventDefault()}}),"auto-draft"===a("#original_post_status").val()&&window.history.replaceState){var r;a("#publish").on("click",function(){r=window.location.href,r+=r.indexOf("?")!==-1?"&":"?",r+="wp-post-new-reload=true",window.history.replaceState(null,null,r)})}}),function(a,b){a(function(){function c(){var a,c;a=!d||d.isHidden()?e.val():d.getContent({format:"raw"}),c=b.count(a),c!==g&&f.text(c),g=c}var d,e=a("#content"),f=a("#wp-word-count").find(".word-count"),g=0;a(document).on("tinymce-editor-init",function(a,b){"content"===b.id&&(d=b,b.on("nodechange keyup",_.debounce(c,1e3)))}),e.on("input keyup",_.debounce(c,1e3)),c()})}(jQuery,new wp.utils.WordCounter);
|
lib/classic-editor/js/tags-box.js
ADDED
@@ -0,0 +1,263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* jshint curly: false, eqeqeq: false */
|
2 |
+
/* global ajaxurl */
|
3 |
+
|
4 |
+
var tagBox, array_unique_noempty;
|
5 |
+
|
6 |
+
( function( $ ) {
|
7 |
+
var tagDelimiter = ( window.tagsSuggestL10n && window.tagsSuggestL10n.tagDelimiter ) || ',';
|
8 |
+
|
9 |
+
// Return an array with any duplicate, whitespace or empty values removed
|
10 |
+
array_unique_noempty = function( array ) {
|
11 |
+
var out = [];
|
12 |
+
|
13 |
+
$.each( array, function( key, val ) {
|
14 |
+
val = $.trim( val );
|
15 |
+
|
16 |
+
if ( val && $.inArray( val, out ) === -1 ) {
|
17 |
+
out.push( val );
|
18 |
+
}
|
19 |
+
} );
|
20 |
+
|
21 |
+
return out;
|
22 |
+
};
|
23 |
+
|
24 |
+
tagBox = {
|
25 |
+
clean : function( tags ) {
|
26 |
+
if ( ',' !== tagDelimiter ) {
|
27 |
+
tags = tags.replace( new RegExp( tagDelimiter, 'g' ), ',' );
|
28 |
+
}
|
29 |
+
|
30 |
+
tags = tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');
|
31 |
+
|
32 |
+
if ( ',' !== tagDelimiter ) {
|
33 |
+
tags = tags.replace( /,/g, tagDelimiter );
|
34 |
+
}
|
35 |
+
|
36 |
+
return tags;
|
37 |
+
},
|
38 |
+
|
39 |
+
parseTags : function(el) {
|
40 |
+
var id = el.id,
|
41 |
+
num = id.split('-check-num-')[1],
|
42 |
+
taxbox = $(el).closest('.tagsdiv'),
|
43 |
+
thetags = taxbox.find('.the-tags'),
|
44 |
+
current_tags = thetags.val().split( tagDelimiter ),
|
45 |
+
new_tags = [];
|
46 |
+
|
47 |
+
delete current_tags[num];
|
48 |
+
|
49 |
+
$.each( current_tags, function( key, val ) {
|
50 |
+
val = $.trim( val );
|
51 |
+
if ( val ) {
|
52 |
+
new_tags.push( val );
|
53 |
+
}
|
54 |
+
});
|
55 |
+
|
56 |
+
thetags.val( this.clean( new_tags.join( tagDelimiter ) ) );
|
57 |
+
|
58 |
+
this.quickClicks( taxbox );
|
59 |
+
return false;
|
60 |
+
},
|
61 |
+
|
62 |
+
quickClicks : function( el ) {
|
63 |
+
var thetags = $('.the-tags', el),
|
64 |
+
tagchecklist = $('.tagchecklist', el),
|
65 |
+
id = $(el).attr('id'),
|
66 |
+
current_tags, disabled;
|
67 |
+
|
68 |
+
if ( ! thetags.length )
|
69 |
+
return;
|
70 |
+
|
71 |
+
disabled = thetags.prop('disabled');
|
72 |
+
|
73 |
+
current_tags = thetags.val().split( tagDelimiter );
|
74 |
+
tagchecklist.empty();
|
75 |
+
|
76 |
+
$.each( current_tags, function( key, val ) {
|
77 |
+
var listItem, xbutton;
|
78 |
+
|
79 |
+
val = $.trim( val );
|
80 |
+
|
81 |
+
if ( ! val )
|
82 |
+
return;
|
83 |
+
|
84 |
+
// Create a new list item, and ensure the text is properly escaped.
|
85 |
+
listItem = $( '<li />' ).text( val );
|
86 |
+
|
87 |
+
// If tags editing isn't disabled, create the X button.
|
88 |
+
if ( ! disabled ) {
|
89 |
+
/*
|
90 |
+
* Build the X buttons, hide the X icon with aria-hidden and
|
91 |
+
* use visually hidden text for screen readers.
|
92 |
+
*/
|
93 |
+
xbutton = $( '<button type="button" id="' + id + '-check-num-' + key + '" class="ntdelbutton">' +
|
94 |
+
'<span class="remove-tag-icon" aria-hidden="true"></span>' +
|
95 |
+
'<span class="screen-reader-text">' + window.tagsSuggestL10n.removeTerm + ' ' + listItem.html() + '</span>' +
|
96 |
+
'</button>' );
|
97 |
+
|
98 |
+
xbutton.on( 'click keypress', function( e ) {
|
99 |
+
// On click or when using the Enter/Spacebar keys.
|
100 |
+
if ( 'click' === e.type || 13 === e.keyCode || 32 === e.keyCode ) {
|
101 |
+
/*
|
102 |
+
* When using the keyboard, move focus back to the
|
103 |
+
* add new tag field. Note: when releasing the pressed
|
104 |
+
* key this will fire the `keyup` event on the input.
|
105 |
+
*/
|
106 |
+
if ( 13 === e.keyCode || 32 === e.keyCode ) {
|
107 |
+
$( this ).closest( '.tagsdiv' ).find( 'input.newtag' ).focus();
|
108 |
+
}
|
109 |
+
|
110 |
+
tagBox.userAction = 'remove';
|
111 |
+
tagBox.parseTags( this );
|
112 |
+
}
|
113 |
+
});
|
114 |
+
|
115 |
+
listItem.prepend( ' ' ).prepend( xbutton );
|
116 |
+
}
|
117 |
+
|
118 |
+
// Append the list item to the tag list.
|
119 |
+
tagchecklist.append( listItem );
|
120 |
+
});
|
121 |
+
// The buttons list is built now, give feedback to screen reader users.
|
122 |
+
tagBox.screenReadersMessage();
|
123 |
+
},
|
124 |
+
|
125 |
+
flushTags : function( el, a, f ) {
|
126 |
+
var tagsval, newtags, text,
|
127 |
+
tags = $( '.the-tags', el ),
|
128 |
+
newtag = $( 'input.newtag', el );
|
129 |
+
|
130 |
+
a = a || false;
|
131 |
+
|
132 |
+
text = a ? $(a).text() : newtag.val();
|
133 |
+
|
134 |
+
/*
|
135 |
+
* Return if there's no new tag or if the input field is empty.
|
136 |
+
* Note: when using the keyboard to add tags, focus is moved back to
|
137 |
+
* the input field and the `keyup` event attached on this field will
|
138 |
+
* fire when releasing the pressed key. Checking also for the field
|
139 |
+
* emptiness avoids to set the tags and call quickClicks() again.
|
140 |
+
*/
|
141 |
+
if ( 'undefined' == typeof( text ) || '' === text ) {
|
142 |
+
return false;
|
143 |
+
}
|
144 |
+
|
145 |
+
tagsval = tags.val();
|
146 |
+
newtags = tagsval ? tagsval + tagDelimiter + text : text;
|
147 |
+
|
148 |
+
newtags = this.clean( newtags );
|
149 |
+
newtags = array_unique_noempty( newtags.split( tagDelimiter ) ).join( tagDelimiter );
|
150 |
+
tags.val( newtags );
|
151 |
+
this.quickClicks( el );
|
152 |
+
|
153 |
+
if ( ! a )
|
154 |
+
newtag.val('');
|
155 |
+
if ( 'undefined' == typeof( f ) )
|
156 |
+
newtag.focus();
|
157 |
+
|
158 |
+
return false;
|
159 |
+
},
|
160 |
+
|
161 |
+
get : function( id ) {
|
162 |
+
var tax = id.substr( id.indexOf('-') + 1 );
|
163 |
+
|
164 |
+
$.post( ajaxurl, { 'action': 'get-tagcloud', 'tax': tax }, function( r, stat ) {
|
165 |
+
if ( 0 === r || 'success' != stat ) {
|
166 |
+
return;
|
167 |
+
}
|
168 |
+
|
169 |
+
r = $( '<div id="tagcloud-' + tax + '" class="the-tagcloud">' + r + '</div>' );
|
170 |
+
|
171 |
+
$( 'a', r ).click( function() {
|
172 |
+
tagBox.userAction = 'add';
|
173 |
+
tagBox.flushTags( $( '#' + tax ), this );
|
174 |
+
return false;
|
175 |
+
});
|
176 |
+
|
177 |
+
$( '#' + id ).after( r );
|
178 |
+
});
|
179 |
+
},
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Track the user's last action.
|
183 |
+
*
|
184 |
+
* @since 4.7.0
|
185 |
+
*/
|
186 |
+
userAction: '',
|
187 |
+
|
188 |
+
/**
|
189 |
+
* Dispatch an audible message to screen readers.
|
190 |
+
*
|
191 |
+
* @since 4.7.0
|
192 |
+
*/
|
193 |
+
screenReadersMessage: function() {
|
194 |
+
var message;
|
195 |
+
|
196 |
+
switch ( this.userAction ) {
|
197 |
+
case 'remove':
|
198 |
+
message = window.tagsSuggestL10n.termRemoved;
|
199 |
+
break;
|
200 |
+
|
201 |
+
case 'add':
|
202 |
+
message = window.tagsSuggestL10n.termAdded;
|
203 |
+
break;
|
204 |
+
|
205 |
+
default:
|
206 |
+
return;
|
207 |
+
}
|
208 |
+
|
209 |
+
window.wp.a11y.speak( message, 'assertive' );
|
210 |
+
},
|
211 |
+
|
212 |
+
init : function() {
|
213 |
+
var ajaxtag = $('div.ajaxtag');
|
214 |
+
|
215 |
+
$('.tagsdiv').each( function() {
|
216 |
+
tagBox.quickClicks( this );
|
217 |
+
});
|
218 |
+
|
219 |
+
$( '.tagadd', ajaxtag ).click( function() {
|
220 |
+
tagBox.userAction = 'add';
|
221 |
+
tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
|
222 |
+
});
|
223 |
+
|
224 |
+
$( 'input.newtag', ajaxtag ).keyup( function( event ) {
|
225 |
+
if ( 13 == event.which ) {
|
226 |
+
tagBox.userAction = 'add';
|
227 |
+
tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
|
228 |
+
event.preventDefault();
|
229 |
+
event.stopPropagation();
|
230 |
+
}
|
231 |
+
}).keypress( function( event ) {
|
232 |
+
if ( 13 == event.which ) {
|
233 |
+
event.preventDefault();
|
234 |
+
event.stopPropagation();
|
235 |
+
}
|
236 |
+
}).each( function( i, element ) {
|
237 |
+
$( element ).wpTagsSuggest();
|
238 |
+
});
|
239 |
+
|
240 |
+
// save tags on post save/publish
|
241 |
+
$('#post').submit(function(){
|
242 |
+
$('div.tagsdiv').each( function() {
|
243 |
+
tagBox.flushTags(this, false, 1);
|
244 |
+
});
|
245 |
+
});
|
246 |
+
|
247 |
+
// Fetch and toggle the Tag cloud.
|
248 |
+
$('.tagcloud-link').click(function(){
|
249 |
+
// On the first click, fetch the tag cloud and insert it in the DOM.
|
250 |
+
tagBox.get( $( this ).attr( 'id' ) );
|
251 |
+
// Update button state, remove previous click event and attach a new one to toggle the cloud.
|
252 |
+
$( this )
|
253 |
+
.attr( 'aria-expanded', 'true' )
|
254 |
+
.unbind()
|
255 |
+
.click( function() {
|
256 |
+
$( this )
|
257 |
+
.attr( 'aria-expanded', 'false' === $( this ).attr( 'aria-expanded' ) ? 'true' : 'false' )
|
258 |
+
.siblings( '.the-tagcloud' ).toggle();
|
259 |
+
});
|
260 |
+
});
|
261 |
+
}
|
262 |
+
};
|
263 |
+
}( jQuery ));
|
lib/classic-editor/js/tags-box.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var tagBox,array_unique_noempty;!function(a){var b=window.tagsSuggestL10n&&window.tagsSuggestL10n.tagDelimiter||",";array_unique_noempty=function(b){var c=[];return a.each(b,function(b,d){d=a.trim(d),d&&a.inArray(d,c)===-1&&c.push(d)}),c},tagBox={clean:function(a){return","!==b&&(a=a.replace(new RegExp(b,"g"),",")),a=a.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),","!==b&&(a=a.replace(/,/g,b)),a},parseTags:function(c){var d=c.id,e=d.split("-check-num-")[1],f=a(c).closest(".tagsdiv"),g=f.find(".the-tags"),h=g.val().split(b),i=[];return delete h[e],a.each(h,function(b,c){c=a.trim(c),c&&i.push(c)}),g.val(this.clean(i.join(b))),this.quickClicks(f),!1},quickClicks:function(c){var d,e,f=a(".the-tags",c),g=a(".tagchecklist",c),h=a(c).attr("id");f.length&&(e=f.prop("disabled"),d=f.val().split(b),g.empty(),a.each(d,function(b,c){var d,f;c=a.trim(c),c&&(d=a("<li />").text(c),e||(f=a('<button type="button" id="'+h+"-check-num-"+b+'" class="ntdelbutton"><span class="remove-tag-icon" aria-hidden="true"></span><span class="screen-reader-text">'+window.tagsSuggestL10n.removeTerm+" "+d.html()+"</span></button>"),f.on("click keypress",function(b){"click"!==b.type&&13!==b.keyCode&&32!==b.keyCode||(13!==b.keyCode&&32!==b.keyCode||a(this).closest(".tagsdiv").find("input.newtag").focus(),tagBox.userAction="remove",tagBox.parseTags(this))}),d.prepend(" ").prepend(f)),g.append(d))}),tagBox.screenReadersMessage())},flushTags:function(c,d,e){var f,g,h,i=a(".the-tags",c),j=a("input.newtag",c);return d=d||!1,h=d?a(d).text():j.val(),"undefined"!=typeof h&&""!==h&&(f=i.val(),g=f?f+b+h:h,g=this.clean(g),g=array_unique_noempty(g.split(b)).join(b),i.val(g),this.quickClicks(c),d||j.val(""),"undefined"==typeof e&&j.focus(),!1)},get:function(b){var c=b.substr(b.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:c},function(d,e){0!==d&&"success"==e&&(d=a('<div id="tagcloud-'+c+'" class="the-tagcloud">'+d+"</div>"),a("a",d).click(function(){return tagBox.userAction="add",tagBox.flushTags(a("#"+c),this),!1}),a("#"+b).after(d))})},userAction:"",screenReadersMessage:function(){var a;switch(this.userAction){case"remove":a=window.tagsSuggestL10n.termRemoved;break;case"add":a=window.tagsSuggestL10n.termAdded;break;default:return}window.wp.a11y.speak(a,"assertive")},init:function(){var b=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)}),a(".tagadd",b).click(function(){tagBox.userAction="add",tagBox.flushTags(a(this).closest(".tagsdiv"))}),a("input.newtag",b).keyup(function(b){13==b.which&&(tagBox.userAction="add",tagBox.flushTags(a(this).closest(".tagsdiv")),b.preventDefault(),b.stopPropagation())}).keypress(function(a){13==a.which&&(a.preventDefault(),a.stopPropagation())}).each(function(b,c){a(c).wpTagsSuggest()}),a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),a(".tagcloud-link").click(function(){tagBox.get(a(this).attr("id")),a(this).attr("aria-expanded","true").unbind().click(function(){a(this).attr("aria-expanded","false"===a(this).attr("aria-expanded")?"true":"false").siblings(".the-tagcloud").toggle()})})}}}(jQuery);
|
lib/classic-editor/js/word-count.js
ADDED
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* Word or character counting functionality. Count words or characters in a provided text string.
|
3 |
+
*
|
4 |
+
* @summary Count words or characters in a text.
|
5 |
+
*
|
6 |
+
* @namespace wp.utils
|
7 |
+
* @since 2.6.0
|
8 |
+
*/
|
9 |
+
|
10 |
+
( function() {
|
11 |
+
/**
|
12 |
+
* Word counting utility
|
13 |
+
*
|
14 |
+
* @namespace wp.utils.wordcounter
|
15 |
+
* @memberof wp.utils
|
16 |
+
*
|
17 |
+
* @class
|
18 |
+
*
|
19 |
+
* @param {Object} settings Optional. Key-value object containing overrides for
|
20 |
+
* settings.
|
21 |
+
* @param {RegExp} settings.HTMLRegExp Optional. Regular expression to find HTML elements.
|
22 |
+
* @param {RegExp} settings.HTMLcommentRegExp Optional. Regular expression to find HTML comments.
|
23 |
+
* @param {RegExp} settings.spaceRegExp Optional. Regular expression to find irregular space
|
24 |
+
* characters.
|
25 |
+
* @param {RegExp} settings.HTMLEntityRegExp Optional. Regular expression to find HTML entities.
|
26 |
+
* @param {RegExp} settings.connectorRegExp Optional. Regular expression to find connectors that
|
27 |
+
* split words.
|
28 |
+
* @param {RegExp} settings.removeRegExp Optional. Regular expression to find remove unwanted
|
29 |
+
* characters to reduce false-positives.
|
30 |
+
* @param {RegExp} settings.astralRegExp Optional. Regular expression to find unwanted
|
31 |
+
* characters when searching for non-words.
|
32 |
+
* @param {RegExp} settings.wordsRegExp Optional. Regular expression to find words by spaces.
|
33 |
+
* @param {RegExp} settings.characters_excluding_spacesRegExp Optional. Regular expression to find characters which
|
34 |
+
* are non-spaces.
|
35 |
+
* @param {RegExp} settings.characters_including_spacesRegExp Optional. Regular expression to find characters
|
36 |
+
* including spaces.
|
37 |
+
* @param {RegExp} settings.shortcodesRegExp Optional. Regular expression to find shortcodes.
|
38 |
+
* @param {Object} settings.l10n Optional. Localization object containing specific
|
39 |
+
* configuration for the current localization.
|
40 |
+
* @param {String} settings.l10n.type Optional. Method of finding words to count.
|
41 |
+
* @param {Array} settings.l10n.shortcodes Optional. Array of shortcodes that should be removed
|
42 |
+
* from the text.
|
43 |
+
*
|
44 |
+
* @return void
|
45 |
+
*/
|
46 |
+
function WordCounter( settings ) {
|
47 |
+
var key,
|
48 |
+
shortcodes;
|
49 |
+
|
50 |
+
// Apply provided settings to object settings.
|
51 |
+
if ( settings ) {
|
52 |
+
for ( key in settings ) {
|
53 |
+
|
54 |
+
// Only apply valid settings.
|
55 |
+
if ( settings.hasOwnProperty( key ) ) {
|
56 |
+
this.settings[ key ] = settings[ key ];
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
shortcodes = this.settings.l10n.shortcodes;
|
62 |
+
|
63 |
+
// If there are any localization shortcodes, add this as type in the settings.
|
64 |
+
if ( shortcodes && shortcodes.length ) {
|
65 |
+
this.settings.shortcodesRegExp = new RegExp( '\\[\\/?(?:' + shortcodes.join( '|' ) + ')[^\\]]*?\\]', 'g' );
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
// Default settings.
|
70 |
+
WordCounter.prototype.settings = {
|
71 |
+
HTMLRegExp: /<\/?[a-z][^>]*?>/gi,
|
72 |
+
HTMLcommentRegExp: /<!--[\s\S]*?-->/g,
|
73 |
+
spaceRegExp: / | /gi,
|
74 |
+
HTMLEntityRegExp: /&\S+?;/g,
|
75 |
+
|
76 |
+
// \u2014 = em-dash
|
77 |
+
connectorRegExp: /--|\u2014/g,
|
78 |
+
|
79 |
+
// Characters to be removed from input text.
|
80 |
+
removeRegExp: new RegExp( [
|
81 |
+
'[',
|
82 |
+
|
83 |
+
// Basic Latin (extract)
|
84 |
+
'\u0021-\u0040\u005B-\u0060\u007B-\u007E',
|
85 |
+
|
86 |
+
// Latin-1 Supplement (extract)
|
87 |
+
'\u0080-\u00BF\u00D7\u00F7',
|
88 |
+
|
89 |
+
/*
|
90 |
+
* The following range consists of:
|
91 |
+
* General Punctuation
|
92 |
+
* Superscripts and Subscripts
|
93 |
+
* Currency Symbols
|
94 |
+
* Combining Diacritical Marks for Symbols
|
95 |
+
* Letterlike Symbols
|
96 |
+
* Number Forms
|
97 |
+
* Arrows
|
98 |
+
* Mathematical Operators
|
99 |
+
* Miscellaneous Technical
|
100 |
+
* Control Pictures
|
101 |
+
* Optical Character Recognition
|
102 |
+
* Enclosed Alphanumerics
|
103 |
+
* Box Drawing
|
104 |
+
* Block Elements
|
105 |
+
* Geometric Shapes
|
106 |
+
* Miscellaneous Symbols
|
107 |
+
* Dingbats
|
108 |
+
* Miscellaneous Mathematical Symbols-A
|
109 |
+
* Supplemental Arrows-A
|
110 |
+
* Braille Patterns
|
111 |
+
* Supplemental Arrows-B
|
112 |
+
* Miscellaneous Mathematical Symbols-B
|
113 |
+
* Supplemental Mathematical Operators
|
114 |
+
* Miscellaneous Symbols and Arrows
|
115 |
+
*/
|
116 |
+
'\u2000-\u2BFF',
|
117 |
+
|
118 |
+
// Supplemental Punctuation
|
119 |
+
'\u2E00-\u2E7F',
|
120 |
+
']'
|
121 |
+
].join( '' ), 'g' ),
|
122 |
+
|
123 |
+
// Remove UTF-16 surrogate points, see https://en.wikipedia.org/wiki/UTF-16#U.2BD800_to_U.2BDFFF
|
124 |
+
astralRegExp: /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
|
125 |
+
wordsRegExp: /\S\s+/g,
|
126 |
+
characters_excluding_spacesRegExp: /\S/g,
|
127 |
+
|
128 |
+
/*
|
129 |
+
* Match anything that is not a formatting character, excluding:
|
130 |
+
* \f = form feed
|
131 |
+
* \n = new line
|
132 |
+
* \r = carriage return
|
133 |
+
* \t = tab
|
134 |
+
* \v = vertical tab
|
135 |
+
* \u00AD = soft hyphen
|
136 |
+
* \u2028 = line separator
|
137 |
+
* \u2029 = paragraph separator
|
138 |
+
*/
|
139 |
+
characters_including_spacesRegExp: /[^\f\n\r\t\v\u00AD\u2028\u2029]/g,
|
140 |
+
l10n: window.wordCountL10n || {}
|
141 |
+
};
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Counts the number of words (or other specified type) in the specified text.
|
145 |
+
*
|
146 |
+
* @summary Count the number of elements in a text.
|
147 |
+
*
|
148 |
+
* @since 2.6.0
|
149 |
+
* @memberof wp.utils.wordcounter
|
150 |
+
*
|
151 |
+
* @param {String} text Text to count elements in.
|
152 |
+
* @param {String} type Optional. Specify type to use.
|
153 |
+
*
|
154 |
+
* @return {Number} The number of items counted.
|
155 |
+
*/
|
156 |
+
WordCounter.prototype.count = function( text, type ) {
|
157 |
+
var count = 0;
|
158 |
+
|
159 |
+
// Use default type if none was provided.
|
160 |
+
type = type || this.settings.l10n.type;
|
161 |
+
|
162 |
+
// Sanitize type to one of three possibilities: 'words', 'characters_excluding_spaces' or 'characters_including_spaces'.
|
163 |
+
if ( type !== 'characters_excluding_spaces' && type !== 'characters_including_spaces' ) {
|
164 |
+
type = 'words';
|
165 |
+
}
|
166 |
+
|
167 |
+
// If we have any text at all.
|
168 |
+
if ( text ) {
|
169 |
+
text = text + '\n';
|
170 |
+
|
171 |
+
// Replace all HTML with a new-line.
|
172 |
+
text = text.replace( this.settings.HTMLRegExp, '\n' );
|
173 |
+
|
174 |
+
// Remove all HTML comments.
|
175 |
+
text = text.replace( this.settings.HTMLcommentRegExp, '' );
|
176 |
+
|
177 |
+
// If a shortcode regular expression has been provided use it to remove shortcodes.
|
178 |
+
if ( this.settings.shortcodesRegExp ) {
|
179 |
+
text = text.replace( this.settings.shortcodesRegExp, '\n' );
|
180 |
+
}
|
181 |
+
|
182 |
+
// Normalize non-breaking space to a normal space.
|
183 |
+
text = text.replace( this.settings.spaceRegExp, ' ' );
|
184 |
+
|
185 |
+
if ( type === 'words' ) {
|
186 |
+
|
187 |
+
// Remove HTML Entities.
|
188 |
+
text = text.replace( this.settings.HTMLEntityRegExp, '' );
|
189 |
+
|
190 |
+
// Convert connectors to spaces to count attached text as words.
|
191 |
+
text = text.replace( this.settings.connectorRegExp, ' ' );
|
192 |
+
|
193 |
+
// Remove unwanted characters.
|
194 |
+
text = text.replace( this.settings.removeRegExp, '' );
|
195 |
+
} else {
|
196 |
+
|
197 |
+
// Convert HTML Entities to "a".
|
198 |
+
text = text.replace( this.settings.HTMLEntityRegExp, 'a' );
|
199 |
+
|
200 |
+
// Remove surrogate points.
|
201 |
+
text = text.replace( this.settings.astralRegExp, 'a' );
|
202 |
+
}
|
203 |
+
|
204 |
+
// Match with the selected type regular expression to count the items.
|
205 |
+
text = text.match( this.settings[ type + 'RegExp' ] );
|
206 |
+
|
207 |
+
// If we have any matches, set the count to the number of items found.
|
208 |
+
if ( text ) {
|
209 |
+
count = text.length;
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
return count;
|
214 |
+
};
|
215 |
+
|
216 |
+
// Add the WordCounter to the WP Utils.
|
217 |
+
window.wp = window.wp || {};
|
218 |
+
window.wp.utils = window.wp.utils || {};
|
219 |
+
window.wp.utils.WordCounter = WordCounter;
|
220 |
+
} )();
|
lib/classic-editor/js/word-count.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(){function a(a){var b,c;if(a)for(b in a)a.hasOwnProperty(b)&&(this.settings[b]=a[b]);c=this.settings.l10n.shortcodes,c&&c.length&&(this.settings.shortcodesRegExp=new RegExp("\\[\\/?(?:"+c.join("|")+")[^\\]]*?\\]","g"))}a.prototype.settings={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp:/<!--[\s\S]*?-->/g,spaceRegExp:/ | /gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-@[-`{-~","\x80-\xbf\xd7\xf7","\u2000-\u2bff","\u2e00-\u2e7f","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:window.wordCountL10n||{}},a.prototype.count=function(a,b){var c=0;return b=b||this.settings.l10n.type,"characters_excluding_spaces"!==b&&"characters_including_spaces"!==b&&(b="words"),a&&(a+="\n",a=a.replace(this.settings.HTMLRegExp,"\n"),a=a.replace(this.settings.HTMLcommentRegExp,""),this.settings.shortcodesRegExp&&(a=a.replace(this.settings.shortcodesRegExp,"\n")),a=a.replace(this.settings.spaceRegExp," "),"words"===b?(a=a.replace(this.settings.HTMLEntityRegExp,""),a=a.replace(this.settings.connectorRegExp," "),a=a.replace(this.settings.removeRegExp,"")):(a=a.replace(this.settings.HTMLEntityRegExp,"a"),a=a.replace(this.settings.astralRegExp,"a")),a=a.match(this.settings[b+"RegExp"]),a&&(c=a.length)),c},window.wp=window.wp||{},window.wp.utils=window.wp.utils||{},window.wp.utils.WordCounter=a}();
|
readme.txt
CHANGED
@@ -2,42 +2,49 @@
|
|
2 |
|
3 |
Plugin Name: Disable Gutenberg
|
4 |
Plugin URI: https://perishablepress.com/disable-gutenberg/
|
5 |
-
Description:
|
6 |
Tags: gutenberg, disable, post types, g7g
|
7 |
Author: Jeff Starr
|
8 |
Author URI: https://plugin-planet.com/
|
9 |
-
Donate link: https://
|
10 |
Contributors: specialk
|
11 |
Requires at least: 4.5
|
12 |
-
Tested up to: 4.9
|
13 |
-
Stable tag: 1.
|
14 |
-
Version: 1.
|
15 |
Requires PHP: 5.2
|
16 |
Text Domain: disable-gutenberg
|
17 |
Domain Path: /languages
|
18 |
License: GPL v2 or later
|
19 |
|
20 |
-
|
21 |
|
22 |
|
23 |
|
24 |
== Description ==
|
25 |
|
26 |
-
|
27 |
|
28 |
-
>
|
29 |
|
|
|
|
|
|
|
30 |
|
31 |
**Options**
|
32 |
|
33 |
* Disable Gutenberg completely (all post types)
|
34 |
* Disable Gutenberg for any post type
|
35 |
* Disable Gutenberg for any user role
|
36 |
-
* NEW: Disable Gutenberg
|
37 |
-
* NEW:
|
|
|
|
|
|
|
38 |
|
39 |
-
|
40 |
|
|
|
41 |
|
42 |
**Features**
|
43 |
|
@@ -52,14 +59,28 @@ Completely restores original editor functionality on any/all post types (configu
|
|
52 |
* One-click restore plugin default options
|
53 |
* Translation ready
|
54 |
|
|
|
55 |
|
56 |
_Super light & fast plugin, super easy on server resources!_
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
|
60 |
== Screenshots ==
|
61 |
|
62 |
-
1. Plugin Settings
|
|
|
63 |
|
64 |
|
65 |
|
@@ -119,7 +140,7 @@ Note: uninstalling the plugin from the WP Plugins screen results in the removal
|
|
119 |
|
120 |
**Will this work without Gutenberg?**
|
121 |
|
122 |
-
Yes. When Gutenberg is active, the plugin disables it (depending on your selected options). Otherwise, if Gutenberg is not active, the plugin does nothing. So it's totally fine to install before Gutenberg is added to WP core, so it will be ready when the time comes.
|
123 |
|
124 |
|
125 |
**Got a question?**
|
@@ -130,7 +151,7 @@ Send any questions or feedback via my [contact form](https://perishablepress.com
|
|
130 |
|
131 |
== Support development of this plugin ==
|
132 |
|
133 |
-
I develop and maintain this free plugin with love for the WordPress community. To show support, you can [make a
|
134 |
|
135 |
* [The Tao of WordPress](https://wp-tao.com/)
|
136 |
* [Digging into WordPress](https://digwp.com/)
|
@@ -150,6 +171,19 @@ Links, tweets and likes also appreciated. Thanks! :)
|
|
150 |
|
151 |
== Changelog ==
|
152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
**1.1 (2018/05/06)**
|
154 |
|
155 |
* Removes unused .otf font file
|
2 |
|
3 |
Plugin Name: Disable Gutenberg
|
4 |
Plugin URI: https://perishablepress.com/disable-gutenberg/
|
5 |
+
Description: Disable Gutenberg Editor and replace with Classic Editor.
|
6 |
Tags: gutenberg, disable, post types, g7g
|
7 |
Author: Jeff Starr
|
8 |
Author URI: https://plugin-planet.com/
|
9 |
+
Donate link: https://monzillamedia.com/donate.html
|
10 |
Contributors: specialk
|
11 |
Requires at least: 4.5
|
12 |
+
Tested up to: 4.9.8
|
13 |
+
Stable tag: 1.2
|
14 |
+
Version: 1.2
|
15 |
Requires PHP: 5.2
|
16 |
Text Domain: disable-gutenberg
|
17 |
Domain Path: /languages
|
18 |
License: GPL v2 or later
|
19 |
|
20 |
+
Disable Gutenberg Editor and replace with Classic Editor. Selectively disable for posts, pages, roles, post types, and theme templates. Hide the Gutenberg nag, menu item, and more!
|
21 |
|
22 |
|
23 |
|
24 |
== Description ==
|
25 |
|
26 |
+
This plugin disables the new Gutenberg Editor and replaces it with the Classic Editor. You can disable Gutenberg completely, or selectively disable for posts, pages, roles, post types, and theme templates. Plus you can hide the Gutenberg nag, menu item, and more!
|
27 |
|
28 |
+
> The all-in-one, COMPLETE solution handling Gutenberg.
|
29 |
|
30 |
+
> Hide ALL traces of Gutenberg and replace with the Classic Editor.
|
31 |
+
|
32 |
+
The Disable Gutenberg plugin restores the classic (original) WordPress editor and the "Edit Post" screen. So you can continue using plugins and theme functions that extend the Classic Editor. Supports awesome features like Meta Boxes, Quicktags, Custom Fields, and everything else the Classic Editor can do.
|
33 |
|
34 |
**Options**
|
35 |
|
36 |
* Disable Gutenberg completely (all post types)
|
37 |
* Disable Gutenberg for any post type
|
38 |
* Disable Gutenberg for any user role
|
39 |
+
* NEW: Disable Gutenberg for any theme template
|
40 |
+
* NEW: Disable Gutenberg for any post/page IDs
|
41 |
+
* Disable Gutenberg admin notice (nag)
|
42 |
+
* Option to hide the plugin menu item
|
43 |
+
* NEW: Option to hide the Gutenberg plugin menu item (settings link)
|
44 |
|
45 |
+
Fully configurable, enable or disable Gutenberg and restore the Classic Editor wherever is necessary.
|
46 |
|
47 |
+
_Automatically replaces Gutenberg with the Classic Editor._
|
48 |
|
49 |
**Features**
|
50 |
|
59 |
* One-click restore plugin default options
|
60 |
* Translation ready
|
61 |
|
62 |
+
Plus, unlike similar plugins, Disable Gutenberg does NOT add extra Gutenberg options to the WordPress "Writing" settings.
|
63 |
|
64 |
_Super light & fast plugin, super easy on server resources!_
|
65 |
|
66 |
+
**Why?**
|
67 |
+
|
68 |
+
Gutenberg is a useful editor but sometimes you want to disable it for specific posts, pages, user roles, post types, or theme templates. Disable Gutenberg enables you to disable Gutenberg and replace it with the Classic Editor wherever you want. For example, lots of WordPress users already enjoy robust page-building functionality via one of the many great plugins like Composer or Elementor. So many options, no need to feel "locked in" to using Gutenberg!
|
69 |
+
|
70 |
+
The Disable Gutenberg plugin is targeted at everyone who is not ready for the major changes brought by Gutenberg. Install Disable Gutenberg NOW to be ready for when Gutenberg is finally merged into core and released to the public (likely in WP 5.0). That way, your users and clients will experience the same awesome UX as before ;)
|
71 |
+
|
72 |
+
**GDPR**
|
73 |
+
|
74 |
+
This plugin does not collect any user data. So it does _not_ do anything to make your site _less_ compliant with GDPR. I have done my best to ensure that this plugin is 100% GDPR compliant, but I'm not a lawyer so can't guarantee anything. To determine if your site is GDPR compliant, please consult an attorney.
|
75 |
+
|
76 |
+
__If you like this plugin, please give it a 5-star rating to encourage future development.__
|
77 |
+
|
78 |
|
79 |
|
80 |
== Screenshots ==
|
81 |
|
82 |
+
1. Plugin Settings screen (showing default options)
|
83 |
+
2. Plugin Settings screen (showing expanded options)
|
84 |
|
85 |
|
86 |
|
140 |
|
141 |
**Will this work without Gutenberg?**
|
142 |
|
143 |
+
Yes. When Gutenberg is active, the plugin disables it (depending on your selected options) and replaces with the Classic Editor. Otherwise, if Gutenberg is not active, the plugin does nothing. So it's totally fine to install before Gutenberg is added to WP core, so it will be ready when the time comes.
|
144 |
|
145 |
|
146 |
**Got a question?**
|
151 |
|
152 |
== Support development of this plugin ==
|
153 |
|
154 |
+
I develop and maintain this free plugin with love for the WordPress community. To show support, you can [make a donation](https://monzillamedia.com/donate.html) or purchase one of my books:
|
155 |
|
156 |
* [The Tao of WordPress](https://wp-tao.com/)
|
157 |
* [Digging into WordPress](https://digwp.com/)
|
171 |
|
172 |
== Changelog ==
|
173 |
|
174 |
+
**1.2 (2018/08/14)**
|
175 |
+
|
176 |
+
* Adds `rel="noopener noreferrer"` to all [blank-target links](https://perishablepress.com/wordpress-blank-target-vulnerability/)
|
177 |
+
* Adds options to disable Gutenberg for specific post templates and post IDs
|
178 |
+
* Adds option to hide/remove the Gutenberg plugin menu item
|
179 |
+
* Adds Classic Editor replacement for WP 5.0 (in progress)
|
180 |
+
* Fixes object-related PHP warning in enqueue script
|
181 |
+
* Updates GDPR blurb and donate link
|
182 |
+
* Tweaks CSS on plugin settings page
|
183 |
+
* Adds "rate this" link to settings page
|
184 |
+
* Generates default translation template
|
185 |
+
* Further tests on WP versions 4.9 and 5.0 (alpha)
|
186 |
+
|
187 |
**1.1 (2018/05/06)**
|
188 |
|
189 |
* Removes unused .otf font file
|