mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 02:10:45 +01:00
Hide post title field in DFW if title is not supported by the current post type or missing, fixes $18568
git-svn-id: http://svn.automattic.com/wordpress/trunk@18828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
32e25b6aec
commit
3be0b41d68
@ -139,8 +139,8 @@ PubSub.prototype.publish = function( topic, args ) {
|
|||||||
|
|
||||||
// Settings can be added or changed by defining "wp_fullscreen_settings" JS object.
|
// Settings can be added or changed by defining "wp_fullscreen_settings" JS object.
|
||||||
// This can be done by defining it as PHP array and passing it to JS with:
|
// This can be done by defining it as PHP array and passing it to JS with:
|
||||||
// wp_add_script_data( 'wp-fullscreen', 'wp_fullscreen_settings', $settings_array )
|
// add_script_data( 'wp-fullscreen', 'wp_fullscreen_settings', $settings_array )
|
||||||
if ( typeof(wp_fullscreen_settings) != 'undefined' )
|
if ( typeof(wp_fullscreen_settings) == 'object' )
|
||||||
$.extend( s, wp_fullscreen_settings );
|
$.extend( s, wp_fullscreen_settings );
|
||||||
|
|
||||||
s.editor_id = wpActiveEditor || 'content';
|
s.editor_id = wpActiveEditor || 'content';
|
||||||
@ -148,8 +148,10 @@ PubSub.prototype.publish = function( topic, args ) {
|
|||||||
if ( !s.title_id ) {
|
if ( !s.title_id ) {
|
||||||
if ( $('input#title').length && s.editor_id == 'content' )
|
if ( $('input#title').length && s.editor_id == 'content' )
|
||||||
s.title_id = 'title';
|
s.title_id = 'title';
|
||||||
|
else if ( $('input#' + s.editor_id + '-title').length ) // the title input field should have [editor_id]-title HTML ID to be auto detected
|
||||||
|
s.title_id = s.editor_id + '-title';
|
||||||
else
|
else
|
||||||
$('#wp-fullscreen-title').hide();
|
$('#wp-fullscreen-title, #wp-fullscreen-title-prompt-text').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
s.mode = $('#' + s.editor_id).is(':hidden') ? 'tinymce' : 'html';
|
s.mode = $('#' + s.editor_id).is(':hidden') ? 'tinymce' : 'html';
|
||||||
@ -536,7 +538,7 @@ PubSub.prototype.publish = function( topic, args ) {
|
|||||||
if ( !s.has_tinymce )
|
if ( !s.has_tinymce )
|
||||||
$('#wp-fullscreen-mode-bar').hide();
|
$('#wp-fullscreen-mode-bar').hide();
|
||||||
|
|
||||||
if ( wptitlehint )
|
if ( wptitlehint && $('#wp-fullscreen-title').length )
|
||||||
wptitlehint('wp-fullscreen-title');
|
wptitlehint('wp-fullscreen-title');
|
||||||
|
|
||||||
$(document).keyup(function(e){
|
$(document).keyup(function(e){
|
||||||
|
File diff suppressed because one or more lines are too long
@ -677,8 +677,10 @@ class WP_Editor {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="wp-fullscreen-wrap" style="width:<?php echo $dfw_width; ?>px;">
|
<div id="wp-fullscreen-wrap" style="width:<?php echo $dfw_width; ?>px;">
|
||||||
|
<?php if ( post_type_supports($post->post_type, 'title') ) { ?>
|
||||||
<label id="wp-fullscreen-title-prompt-text" for="wp-fullscreen-title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>
|
<label id="wp-fullscreen-title-prompt-text" for="wp-fullscreen-title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>
|
||||||
<input type="text" id="wp-fullscreen-title" value="" autocomplete="off" />
|
<input type="text" id="wp-fullscreen-title" value="" autocomplete="off" />
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<div id="wp-fullscreen-container">
|
<div id="wp-fullscreen-container">
|
||||||
<textarea id="wp_mce_fullscreen"></textarea>
|
<textarea id="wp_mce_fullscreen"></textarea>
|
||||||
|
@ -86,7 +86,7 @@ function wp_default_scripts( &$scripts ) {
|
|||||||
|
|
||||||
$scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array('utils','jquery'), '20110820', 1 );
|
$scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array('utils','jquery'), '20110820', 1 );
|
||||||
|
|
||||||
$scripts->add( 'wp-fullscreen', "/wp-admin/js/wp-fullscreen$suffix.js", array('jquery'), '20110926', 1 );
|
$scripts->add( 'wp-fullscreen', "/wp-admin/js/wp-fullscreen$suffix.js", array('jquery'), '20110929', 1 );
|
||||||
|
|
||||||
$scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6.1');
|
$scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6.1');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user