mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Add support for DFW for all instances of the editor, part props sushkov, fixes #19843
git-svn-id: https://develop.svn.wordpress.org/trunk@20166 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -138,21 +138,17 @@ PubSub.prototype.publish = function( topic, args ) {
|
||||
return;
|
||||
|
||||
// Settings can be added or changed by defining "wp_fullscreen_settings" JS object.
|
||||
// This can be done by defining it as PHP associative array, json encoding it and passing it to JS with:
|
||||
// wp_add_script_before( 'wp-fullscreen', 'wp_fullscreen_settings = ' . $json_encoded_array . ';' );
|
||||
if ( typeof(wp_fullscreen_settings) == 'object' )
|
||||
$.extend( s, wp_fullscreen_settings );
|
||||
|
||||
s.editor_id = wpActiveEditor || 'content';
|
||||
|
||||
if ( !s.title_id ) {
|
||||
if ( $('input#title').length && s.editor_id == 'content' )
|
||||
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
|
||||
$('#wp-fullscreen-title, #wp-fullscreen-title-prompt-text').hide();
|
||||
}
|
||||
if ( $('input#title').length && s.editor_id == 'content' )
|
||||
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
|
||||
$('#wp-fullscreen-title, #wp-fullscreen-title-prompt-text').hide();
|
||||
|
||||
s.mode = $('#' + s.editor_id).is(':hidden') ? 'tinymce' : 'html';
|
||||
s.qt_canvas = $('#' + s.editor_id).get(0);
|
||||
|
||||
Reference in New Issue
Block a user