- Remove the old DFW.
- Add back-compat stub for wp-fullscreen.js.
- Keep wp_ajax_wp_fullscreen_save_post() for now.
See #30949.
Built from https://develop.svn.wordpress.org/trunk@32677


git-svn-id: http://core.svn.wordpress.org/trunk@32647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2015-06-01 17:38:29 +00:00
parent ecf0bcc9fc
commit b3d04247b7
35 changed files with 73 additions and 2071 deletions

View File

@ -56,7 +56,7 @@ $core_actions_post = array(
'hidden-columns', 'update-welcome-panel', 'menu-get-metabox', 'wp-link-ajax',
'menu-locations-save', 'menu-quick-search', 'meta-box-order', 'get-permalink',
'sample-permalink', 'inline-save', 'inline-save-tax', 'find_posts', 'widgets-order',
'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-fullscreen-save-post',
'save-widget', 'set-post-thumbnail', 'date_format', 'time_format',
'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment',
'query-attachments', 'save-attachment', 'save-attachment-compat', 'send-link-to-editor',
'send-attachment-to-editor', 'save-attachment-order', 'heartbeat', 'get-revision-diffs',
@ -65,6 +65,9 @@ $core_actions_post = array(
'press-this-add-category',
);
// Deprecated
$core_actions_post[] = 'wp-fullscreen-save-post';
// Register core Ajax calls.
if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get ) )
add_action( 'wp_ajax_' . $_GET['action'], 'wp_ajax_' . str_replace( '-', '_', $_GET['action'] ), 1 );

View File

@ -70,12 +70,6 @@
padding: 11px 10px;
}
#wp-fullscreen-save .fs-saved {
color: #999;
float: left;
margin-top: 4px;
}
#poststuff .inside-submitbox,
#side-sortables .inside-submitbox {
margin: 0 3px;
@ -390,24 +384,6 @@ td.plugin-title p {
border: 1px solid transparent;
}
.wp-fullscreen-wrap #content-textarea-clone {
display: none;
}
/* editor-expand.js override */
.wp-fullscreen-wrap {
padding-top: 0 !important;
}
.wp-fullscreen-wrap .wp-editor-area {
margin-top: 0 !important;
}
.wp-fullscreen-wrap .mce-edit-area {
padding-top: 0 !important;
}
/* end editor-expand.js override */
.wp-editor-expand #wp-content-editor-tools {
z-index: 1000;
border-bottom: 1px solid #e5e5e5;

View File

@ -70,12 +70,6 @@
padding: 11px 10px;
}
#wp-fullscreen-save .fs-saved {
color: #999;
float: right;
margin-top: 4px;
}
#poststuff .inside-submitbox,
#side-sortables .inside-submitbox {
margin: 0 3px;
@ -390,24 +384,6 @@ td.plugin-title p {
border: 1px solid transparent;
}
.wp-fullscreen-wrap #content-textarea-clone {
display: none;
}
/* editor-expand.js override */
.wp-fullscreen-wrap {
padding-top: 0 !important;
}
.wp-fullscreen-wrap .wp-editor-area {
margin-top: 0 !important;
}
.wp-fullscreen-wrap .mce-edit-area {
padding-top: 0 !important;
}
/* end editor-expand.js override */
.wp-editor-expand #wp-content-editor-tools {
z-index: 1000;
border-bottom: 1px solid #e5e5e5;

View File

@ -50,19 +50,6 @@
width: 35%;
}
.wp-fullscreen-title {
width: 97%;
}
#wp_mce_fullscreen_ifr {
background-color: #f9f9f9;
}
#wp-fullscreen-tagline {
color: #82878c;
font-size: 14px;
}
#adminmenuback {
right: 0;
background-image: none;

File diff suppressed because one or more lines are too long

View File

@ -50,19 +50,6 @@
width: 35%;
}
.wp-fullscreen-title {
width: 97%;
}
#wp_mce_fullscreen_ifr {
background-color: #f9f9f9;
}
#wp-fullscreen-tagline {
color: #82878c;
font-size: 14px;
}
#adminmenuback {
left: 0;
background-image: none;

File diff suppressed because one or more lines are too long

View File

@ -54,13 +54,6 @@ body.locale-he-il .press-this a.wp-switch-editor {
/* zn_CH: Enlarge font size, set font-size: normal */
.locale-zh-cn form.upgrade .hint { font-style: normal; font-size: 100%; }
/* Zn_CH: Distraction-free writing.
* More beautiful font for "Just write."
* Larger text for HTML/Visual mode.
*/
.locale-zh-cn #wp-fullscreen-tagline { font-family: KaiTi, "楷体", sans-serif; }
.locale-zh-cn #wp-fullscreen-modes a { font-size: 12px; }
/* zh_CN: Enlarge font-size. */
.locale-zh-cn #sort-buttons { font-size: 1em !important; }

View File

@ -54,13 +54,6 @@ body.locale-he-il .press-this a.wp-switch-editor {
/* zn_CH: Enlarge font size, set font-size: normal */
.locale-zh-cn form.upgrade .hint { font-style: normal; font-size: 100%; }
/* Zn_CH: Distraction-free writing.
* More beautiful font for "Just write."
* Larger text for HTML/Visual mode.
*/
.locale-zh-cn #wp-fullscreen-tagline { font-family: KaiTi, "楷体", sans-serif; }
.locale-zh-cn #wp-fullscreen-modes a { font-size: 12px; }
/* zh_CN: Enlarge font-size. */
.locale-zh-cn #sort-buttons { font-size: 1em !important; }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2102,6 +2102,7 @@ function wp_ajax_time_format() {
* Ajax handler for saving posts from the fullscreen editor.
*
* @since 3.1.0
* @deprecated 4.3.0
*/
function wp_ajax_wp_fullscreen_save_post() {
$post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0;

View File

@ -0,0 +1,39 @@
/**
* Distraction-Free Writing (wp-fullscreen) backwards compatibility stub.
* Todo: remove at the end of 2016.
*
* Original was deprecated in 4.1, removed in 4.3.
*/
( function() {
var noop = function(){};
window.wp = window.wp || {};
window.wp.editor = window.wp.editor || {};
window.wp.editor.fullscreen = {
bind_resize: noop,
dfwWidth: noop,
off: noop,
on: noop,
refreshButtons: noop,
resizeTextarea: noop,
save: noop,
switchmode: noop,
toggleUI: noop,
settings: {},
pubsub: {
publish: noop,
subscribe: noop,
unsubscribe: noop,
topics: {}
},
fade: {
In: noop,
Out: noop
},
ui: {
fade: noop,
init: noop
}
};
}());

1
wp-admin/js/wp-fullscreen-stub.min.js vendored Normal file
View File

@ -0,0 +1 @@
!function(){var a=function(){};window.wp=window.wp||{},window.wp.editor=window.wp.editor||{},window.wp.editor.fullscreen={bind_resize:a,dfwWidth:a,off:a,on:a,refreshButtons:a,resizeTextarea:a,save:a,switchmode:a,toggleUI:a,settings:{},pubsub:{publish:a,subscribe:a,unsubscribe:a,topics:{}},fade:{In:a,Out:a},ui:{fade:a,init:a}}}();

View File

@ -1,704 +0,0 @@
/* global deleteUserSetting, setUserSetting, switchEditors, tinymce, tinyMCEPreInit */
/**
* Distraction-Free Writing
* (wp-fullscreen)
*
* Access the API globally using the window.wp.editor.fullscreen variable.
*/
( function( $, window ) {
var api, ps, s, toggleUI, uiTimer, PubSub,
uiScrollTop = 0,
transitionend = 'transitionend webkitTransitionEnd',
$body = $( document.body ),
$document = $( document );
/**
* PubSub
*
* A lightweight publish/subscribe implementation.
*
* @access private
*/
PubSub = function() {
this.topics = {};
this.subscribe = function( topic, callback ) {
if ( ! this.topics[ topic ] )
this.topics[ topic ] = [];
this.topics[ topic ].push( callback );
return callback;
};
this.unsubscribe = function( topic, callback ) {
var i, l,
topics = this.topics[ topic ];
if ( ! topics )
return callback || [];
// Clear matching callbacks
if ( callback ) {
for ( i = 0, l = topics.length; i < l; i++ ) {
if ( callback == topics[i] )
topics.splice( i, 1 );
}
return callback;
// Clear all callbacks
} else {
this.topics[ topic ] = [];
return topics;
}
};
this.publish = function( topic, args ) {
var i, l, broken,
topics = this.topics[ topic ];
if ( ! topics )
return;
args = args || [];
for ( i = 0, l = topics.length; i < l; i++ ) {
broken = ( topics[i].apply( null, args ) === false || broken );
}
return ! broken;
};
};
// Initialize the fullscreen/api object
api = {};
// Create the PubSub (publish/subscribe) interface.
ps = api.pubsub = new PubSub();
s = api.settings = { // Settings
visible: false,
mode: 'tinymce',
id: '',
title_id: '',
timer: 0,
toolbar_shown: false
};
function _hideUI() {
$body.removeClass('wp-dfw-show-ui');
}
/**
* toggleUI
*
* Toggle the CSS class to show/hide the toolbar, borders and statusbar.
*/
toggleUI = api.toggleUI = function( show ) {
clearTimeout( uiTimer );
if ( ! $body.hasClass('wp-dfw-show-ui') || show === 'show' ) {
$body.addClass('wp-dfw-show-ui');
} else if ( show !== 'autohide' ) {
$body.removeClass('wp-dfw-show-ui');
}
if ( show === 'autohide' ) {
uiTimer = setTimeout( _hideUI, 2000 );
}
};
function resetCssPosition( add ) {
s.$dfwWrap.parents().each( function( i, parent ) {
var cssPosition, $parent = $(parent);
if ( add ) {
if ( parent.style.position ) {
$parent.data( 'wp-dfw-css-position', parent.style.position );
}
$parent.css( 'position', 'static' );
} else {
cssPosition = $parent.data( 'wp-dfw-css-position' );
cssPosition = cssPosition || '';
$parent.css( 'position', cssPosition );
}
if ( parent.nodeName === 'BODY' ) {
return false;
}
});
}
/**
* on()
*
* Turns fullscreen on.
*
* @param string mode Optional. Switch to the given mode before opening.
*/
api.on = function() {
var id, $dfwWrap, titleId;
if ( s.visible ) {
return;
}
if ( ! s.$fullscreenFader ) {
api.ui.init();
}
// Settings can be added or changed by defining "wp_fullscreen_settings" JS object.
if ( typeof window.wp_fullscreen_settings === 'object' )
$.extend( s, window.wp_fullscreen_settings );
id = s.id || window.wpActiveEditor;
if ( ! id ) {
if ( s.hasTinymce ) {
id = tinymce.activeEditor.id;
} else {
return;
}
}
s.id = id;
$dfwWrap = s.$dfwWrap = $( '#wp-' + id + '-wrap' );
if ( ! $dfwWrap.length ) {
return;
}
s.$dfwTextarea = $( '#' + id );
s.$editorContainer = $dfwWrap.find( '.wp-editor-container' );
uiScrollTop = $document.scrollTop();
if ( s.hasTinymce ) {
s.editor = tinymce.get( id );
}
if ( s.editor && ! s.editor.isHidden() ) {
s.origHeight = $( '#' + id + '_ifr' ).height();
s.mode = 'tinymce';
} else {
s.origHeight = s.$dfwTextarea.height();
s.mode = 'html';
}
// Try to find title field
if ( typeof window.adminpage !== 'undefined' &&
( window.adminpage === 'post-php' || window.adminpage === 'post-new-php' ) ) {
titleId = 'title';
} else {
titleId = id + '-title';
}
s.$dfwTitle = $( '#' + titleId );
if ( ! s.$dfwTitle.length ) {
s.$dfwTitle = null;
}
api.ui.fade( 'show', 'showing', 'shown' );
};
/**
* off()
*
* Turns fullscreen off.
*/
api.off = function() {
if ( ! s.visible )
return;
api.ui.fade( 'hide', 'hiding', 'hidden' );
};
/**
* switchmode()
*
* @return string - The current mode.
*
* @param string to - The fullscreen mode to switch to.
* @event switchMode
* @eventparam string to - The new mode.
* @eventparam string from - The old mode.
*/
api.switchmode = function( to ) {
var from = s.mode;
if ( ! to || ! s.visible || ! s.hasTinymce || typeof switchEditors === 'undefined' ) {
return from;
}
// Don't switch if the mode is the same.
if ( from == to )
return from;
if ( to === 'tinymce' && ! s.editor ) {
s.editor = tinymce.get( s.id );
if ( ! s.editor && typeof tinyMCEPreInit !== 'undefined' &&
tinyMCEPreInit.mceInit && tinyMCEPreInit.mceInit[ s.id ] ) {
// If the TinyMCE instance hasn't been created, set the "wp_fulscreen" flag on creating it
tinyMCEPreInit.mceInit[ s.id ].wp_fullscreen = true;
}
}
s.mode = to;
switchEditors.go( s.id, to );
api.refreshButtons( true );
if ( to === 'html' ) {
setTimeout( api.resizeTextarea, 200 );
}
return to;
};
/**
* General
*/
api.save = function() {
var $hidden = $('#hiddenaction'),
oldVal = $hidden.val(),
$spinner = $('#wp-fullscreen-save .spinner'),
$saveMessage = $('#wp-fullscreen-save .wp-fullscreen-saved-message'),
$errorMessage = $('#wp-fullscreen-save .wp-fullscreen-error-message');
$spinner.addClass( 'is-active' );
$errorMessage.hide();
$saveMessage.hide();
$hidden.val('wp-fullscreen-save-post');
if ( s.editor && ! s.editor.isHidden() ) {
s.editor.save();
}
$.ajax({
url: window.ajaxurl,
type: 'post',
data: $('form#post').serialize(),
dataType: 'json'
}).done( function( response ) {
$spinner.removeClass( 'is-active' );
if ( response && response.success ) {
$saveMessage.show();
setTimeout( function() {
$saveMessage.fadeOut(300);
}, 3000 );
if ( response.data && response.data.last_edited ) {
$('#wp-fullscreen-save input').attr( 'title', response.data.last_edited );
}
} else {
$errorMessage.show();
}
}).fail( function() {
$spinner.removeClass( 'is-active' );
$errorMessage.show();
});
$hidden.val( oldVal );
};
api.dfwWidth = function( pixels, total ) {
var width;
if ( pixels && pixels.toString().indexOf('%') !== -1 ) {
s.$editorContainer.css( 'width', pixels );
s.$statusbar.css( 'width', pixels );
if ( s.$dfwTitle ) {
s.$dfwTitle.css( 'width', pixels );
}
return;
}
if ( ! pixels ) {
// Reset to theme width
width = $('#wp-fullscreen-body').data('theme-width') || 800;
s.$editorContainer.width( width );
s.$statusbar.width( width );
if ( s.$dfwTitle ) {
s.$dfwTitle.width( width - 16 );
}
deleteUserSetting('dfw_width');
return;
}
if ( total ) {
width = pixels;
} else {
width = s.$editorContainer.width();
width += pixels;
}
if ( width < 200 || width > 1200 ) {
// sanity check
return;
}
s.$editorContainer.width( width );
s.$statusbar.width( width );
if ( s.$dfwTitle ) {
s.$dfwTitle.width( width - 16 );
}
setUserSetting( 'dfw_width', width );
};
// This event occurs before the overlay blocks the UI.
ps.subscribe( 'show', function() {
var title = $('#last-edit').text();
if ( title ) {
$('#wp-fullscreen-save input').attr( 'title', title );
}
});
// This event occurs while the overlay blocks the UI.
ps.subscribe( 'showing', function() {
$body.addClass( 'wp-fullscreen-active' );
s.$dfwWrap.addClass( 'wp-fullscreen-wrap' );
if ( s.$dfwTitle ) {
s.$dfwTitle.after( '<span id="wp-fullscreen-title-placeholder">' );
s.$dfwWrap.prepend( s.$dfwTitle.addClass('wp-fullscreen-title') );
}
api.refreshButtons();
resetCssPosition( true );
$('#wpadminbar').hide();
// Show the UI for 2 sec. when opening
toggleUI('autohide');
api.bind_resize();
if ( s.editor ) {
s.editor.execCommand( 'wpFullScreenOn' );
}
if ( 'ontouchstart' in window ) {
api.dfwWidth( '90%' );
} else {
api.dfwWidth( $( '#wp-fullscreen-body' ).data('dfw-width') || 800, true );
}
// scroll to top so the user is not disoriented
scrollTo(0, 0);
});
// This event occurs after the overlay unblocks the UI
ps.subscribe( 'shown', function() {
s.visible = true;
if ( s.editor && ! s.editor.isHidden() ) {
s.editor.execCommand( 'wpAutoResize' );
} else {
api.resizeTextarea( 'force' );
}
});
ps.subscribe( 'hide', function() { // This event occurs before the overlay blocks DFW.
$document.unbind( '.fullscreen' );
s.$dfwTextarea.unbind('.wp-dfw-resize');
});
ps.subscribe( 'hiding', function() { // This event occurs while the overlay blocks the DFW UI.
$body.removeClass( 'wp-fullscreen-active' );
if ( s.$dfwTitle ) {
$( '#wp-fullscreen-title-placeholder' ).before( s.$dfwTitle.removeClass('wp-fullscreen-title').css( 'width', '' ) ).remove();
}
s.$dfwWrap.removeClass( 'wp-fullscreen-wrap' );
s.$editorContainer.css( 'width', '' );
s.$dfwTextarea.add( '#' + s.id + '_ifr' ).height( s.origHeight );
if ( s.editor ) {
s.editor.execCommand( 'wpFullScreenOff' );
}
resetCssPosition( false );
window.scrollTo( 0, uiScrollTop );
$('#wpadminbar').show();
});
// This event occurs after DFW is removed.
ps.subscribe( 'hidden', function() {
s.visible = false;
});
api.refreshButtons = function( fade ) {
if ( s.mode === 'html' ) {
$('#wp-fullscreen-mode-bar').removeClass('wp-tmce-mode').addClass('wp-html-mode')
.find('a').removeClass( 'active' ).filter('.wp-fullscreen-mode-html').addClass( 'active' );
if ( fade ) {
$('#wp-fullscreen-button-bar').fadeOut( 150, function(){
$(this).addClass('wp-html-mode').fadeIn( 150 );
});
} else {
$('#wp-fullscreen-button-bar').addClass('wp-html-mode');
}
} else if ( s.mode === 'tinymce' ) {
$('#wp-fullscreen-mode-bar').removeClass('wp-html-mode').addClass('wp-tmce-mode')
.find('a').removeClass( 'active' ).filter('.wp-fullscreen-mode-tinymce').addClass( 'active' );
if ( fade ) {
$('#wp-fullscreen-button-bar').fadeOut( 150, function(){
$(this).removeClass('wp-html-mode').fadeIn( 150 );
});
} else {
$('#wp-fullscreen-button-bar').removeClass('wp-html-mode');
}
}
};
/**
* UI Elements
*
* Used for transitioning between states.
*/
api.ui = {
init: function() {
var toolbar;
s.toolbar = toolbar = $('#fullscreen-topbar');
s.$fullscreenFader = $('#fullscreen-fader');
s.$statusbar = $('#wp-fullscreen-status');
s.hasTinymce = typeof tinymce !== 'undefined';
if ( ! s.hasTinymce )
$('#wp-fullscreen-mode-bar').hide();
$document.keyup( function(e) {
var c = e.keyCode || e.charCode, modKey;
if ( ! s.visible ) {
return;
}
if ( navigator.platform && navigator.platform.indexOf('Mac') !== -1 ) {
modKey = e.ctrlKey; // Ctrl key for Mac
} else {
modKey = e.altKey; // Alt key for Win & Linux
}
if ( modKey && ( 61 === c || 107 === c || 187 === c ) ) { // +
api.dfwWidth( 25 );
e.preventDefault();
}
if ( modKey && ( 45 === c || 109 === c || 189 === c ) ) { // -
api.dfwWidth( -25 );
e.preventDefault();
}
if ( modKey && 48 === c ) { // 0
api.dfwWidth( 0 );
e.preventDefault();
}
});
$( window ).on( 'keydown.wp-fullscreen', function( event ) {
// Turn fullscreen off when Esc is pressed.
if ( 27 === event.keyCode && s.visible ) {
api.off();
event.stopImmediatePropagation();
}
});
if ( 'ontouchstart' in window ) {
$body.addClass('wp-dfw-touch');
}
toolbar.on( 'mouseenter', function() {
toggleUI('show');
}).on( 'mouseleave', function() {
toggleUI('autohide');
});
// Bind buttons
$('#wp-fullscreen-buttons').on( 'click.wp-fullscreen', 'button', function( event ) {
var command = event.currentTarget.id ? event.currentTarget.id.substr(6) : null;
if ( s.editor && 'tinymce' === s.mode ) {
switch( command ) {
case 'bold':
s.editor.execCommand('Bold');
break;
case 'italic':
s.editor.execCommand('Italic');
break;
case 'bullist':
s.editor.execCommand('InsertUnorderedList');
break;
case 'numlist':
s.editor.execCommand('InsertOrderedList');
break;
case 'link':
s.editor.execCommand('WP_Link');
break;
case 'unlink':
s.editor.execCommand('unlink');
break;
case 'help':
s.editor.execCommand('WP_Help');
break;
case 'blockquote':
s.editor.execCommand('mceBlockQuote');
break;
}
} else if ( command === 'link' && window.wpLink ) {
window.wpLink.open();
}
if ( command === 'wp-media-library' && typeof wp !== 'undefined' && wp.media && wp.media.editor ) {
wp.media.editor.open( s.id );
}
});
},
fade: function( before, during, after ) {
if ( ! s.$fullscreenFader ) {
api.ui.init();
}
// If any callback bound to before returns false, bail.
if ( before && ! ps.publish( before ) ) {
return;
}
api.fade.In( s.$fullscreenFader, 200, function() {
if ( during ) {
ps.publish( during );
}
api.fade.Out( s.$fullscreenFader, 200, function() {
if ( after ) {
ps.publish( after );
}
});
});
}
};
api.fade = {
// Sensitivity to allow browsers to render the blank element before animating.
sensitivity: 100,
In: function( element, speed, callback, stop ) {
callback = callback || $.noop;
speed = speed || 400;
stop = stop || false;
if ( api.fade.transitions ) {
if ( element.is(':visible') ) {
element.addClass( 'fade-trigger' );
return element;
}
element.show();
element.first().one( transitionend, function() {
callback();
});
setTimeout( function() { element.addClass( 'fade-trigger' ); }, this.sensitivity );
} else {
if ( stop ) {
element.stop();
}
element.css( 'opacity', 1 );
element.first().fadeIn( speed, callback );
if ( element.length > 1 ) {
element.not(':first').fadeIn( speed );
}
}
return element;
},
Out: function( element, speed, callback, stop ) {
callback = callback || $.noop;
speed = speed || 400;
stop = stop || false;
if ( ! element.is(':visible') ) {
return element;
}
if ( api.fade.transitions ) {
element.first().one( transitionend, function() {
if ( element.hasClass('fade-trigger') ) {
return;
}
element.hide();
callback();
});
setTimeout( function() { element.removeClass( 'fade-trigger' ); }, this.sensitivity );
} else {
if ( stop ) {
element.stop();
}
element.first().fadeOut( speed, callback );
if ( element.length > 1 ) {
element.not(':first').fadeOut( speed );
}
}
return element;
},
// Check if the browser supports CSS 3.0 transitions
transitions: ( function() {
var style = document.documentElement.style;
return ( typeof style.WebkitTransition === 'string' ||
typeof style.MozTransition === 'string' ||
typeof style.OTransition === 'string' ||
typeof style.transition === 'string' );
})()
};
/**
* Resize API
*
* Automatically updates textarea height.
*/
api.bind_resize = function() {
s.$dfwTextarea.on( 'keydown.wp-dfw-resize click.wp-dfw-resize paste.wp-dfw-resize', function() {
api.resizeTextarea();
});
};
api.resizeTextarea = function() {
var node = s.$dfwTextarea[0];
if ( node.scrollHeight > node.clientHeight ) {
node.style.height = node.scrollHeight + 50 + 'px';
}
};
// Export
window.wp = window.wp || {};
window.wp.editor = window.wp.editor || {};
window.wp.editor.fullscreen = api;
})( jQuery, window );

File diff suppressed because one or more lines are too long

View File

@ -25,6 +25,7 @@ final class _WP_Editors {
private static $has_medialib = false;
private static $editor_buttons_css = true;
private static $drag_drop_upload = false;
private static $old_dfw_compat = false;
private function __construct() {}
@ -53,8 +54,7 @@ final class _WP_Editors {
* @type string $editor_class Extra classes to add to the editor textarea elemen. Default empty.
* @type bool $teeny Whether to output the minimal editor config. Examples include
* Press This and the Comment editor. Default false.
* @type bool $dfw Whether to replace the default fullscreen with "Distraction Free
* Writing". DFW requires specific DOM elements and css). Default false.
* @type bool $dfw Deprecated in 4.1. Since 4.3 used only to enqueue wp-fullscreen-stub.js for backwards compatibility.
* @type bool|array $tinymce Whether to load TinyMCE. Can be used to pass settings directly to
* TinyMCE using an array. Default true.
* @type bool|array $quicktags Whether to load Quicktags. Can be used to pass settings directly to
@ -111,6 +111,10 @@ final class _WP_Editors {
if ( self::$this_quicktags )
self::$has_quicktags = true;
if ( $set['dfw'] ) {
self::$old_dfw_compat = true;
}
if ( empty( $set['editor_height'] ) )
return $set;
@ -283,9 +287,6 @@ final class _WP_Editors {
if ( empty($qtInit['buttons']) )
$qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close';
if ( $set['dfw'] )
$qtInit['buttons'] .= ',fullscreen';
if ( $set['_content_editor_dfw'] ) {
$qtInit['buttons'] .= ',dfw';
}
@ -469,9 +470,6 @@ final class _WP_Editors {
}
}
if ( $set['dfw'] )
$plugins[] = 'wpfullscreen';
self::$plugins = $plugins;
self::$ext_plugins = $ext_plugins;
@ -637,18 +635,6 @@ final class _WP_Editors {
unset($set['tinymce']['body_class']);
}
if ( $set['dfw'] ) {
// replace the first 'fullscreen' with 'wp_fullscreen'
if ( ($key = array_search('fullscreen', $mce_buttons)) !== false )
$mce_buttons[$key] = 'wp_fullscreen';
elseif ( ($key = array_search('fullscreen', $mce_buttons_2)) !== false )
$mce_buttons_2[$key] = 'wp_fullscreen';
elseif ( ($key = array_search('fullscreen', $mce_buttons_3)) !== false )
$mce_buttons_3[$key] = 'wp_fullscreen';
elseif ( ($key = array_search('fullscreen', $mce_buttons_4)) !== false )
$mce_buttons_4[$key] = 'wp_fullscreen';
}
$mceInit = array (
'selector' => "#$editor_id",
'resize' => 'vertical',
@ -753,8 +739,9 @@ final class _WP_Editors {
wp_enqueue_script('wplink');
}
if ( in_array('wpfullscreen', self::$plugins, true) || in_array('fullscreen', self::$qt_buttons, true) )
wp_enqueue_script('wp-fullscreen');
if ( self::$old_dfw_compat ) {
wp_enqueue_script('wp-fullscreen-stub');
}
if ( self::$has_medialib ) {
add_thickbox();
@ -1252,9 +1239,6 @@ final class _WP_Editors {
if ( in_array( 'wplink', self::$plugins, true ) || in_array( 'link', self::$qt_buttons, true ) )
self::wp_link_dialog();
if ( in_array( 'wpfullscreen', self::$plugins, true ) || in_array( 'fullscreen', self::$qt_buttons, true ) )
self::wp_fullscreen_html();
/**
* Fires after any core TinyMCE editor instances are created.
*
@ -1271,96 +1255,7 @@ final class _WP_Editors {
* @global int $content_width
*/
public static function wp_fullscreen_html() {
global $content_width;
$post = get_post();
$width = isset( $content_width ) && 800 > $content_width ? $content_width : 800;
$width = $width + 22; // compensate for the padding and border
$dfw_width = get_user_setting( 'dfw_width', $width );
$save = $post && $post->post_status == 'publish' ? __('Update') : __('Save');
?>
<div id="wp-fullscreen-body" class="wp-core-ui<?php if ( is_rtl() ) echo ' rtl'; ?>" data-theme-width="<?php echo (int) $width; ?>" data-dfw-width="<?php echo (int) $dfw_width; ?>">
<div id="fullscreen-topbar">
<div id="wp-fullscreen-toolbar">
<div id="wp-fullscreen-close"><a href="#" onclick="wp.editor.fullscreen.off();return false;"><?php _e('Exit fullscreen'); ?></a></div>
<div id="wp-fullscreen-central-toolbar" style="width:<?php echo $width; ?>px;">
<div id="wp-fullscreen-mode-bar">
<div id="wp-fullscreen-modes" class="button-group">
<a class="button wp-fullscreen-mode-tinymce" href="#" onclick="wp.editor.fullscreen.switchmode( 'tinymce' ); return false;"><?php _e( 'Visual' ); ?></a>
<a class="button wp-fullscreen-mode-html" href="#" onclick="wp.editor.fullscreen.switchmode( 'html' ); return false;"><?php _ex( 'Text', 'Name for the Text editor tab (formerly HTML)' ); ?></a>
</div>
</div>
<div id="wp-fullscreen-button-bar"><div id="wp-fullscreen-buttons" class="mce-toolbar">
<?php
$buttons = array(
// format: title, onclick, show in both editors
'bold' => array( 'title' => __('Bold (Ctrl + B)'), 'both' => false ),
'italic' => array( 'title' => __('Italic (Ctrl + I)'), 'both' => false ),
'bullist' => array( 'title' => __('Unordered list (Alt + Shift + U)'), 'both' => false ),
'numlist' => array( 'title' => __('Ordered list (Alt + Shift + O)'), 'both' => false ),
'blockquote' => array( 'title' => __('Blockquote (Alt + Shift + Q)'), 'both' => false ),
'wp-media-library' => array( 'title' => __('Media library (Alt + Shift + M)'), 'both' => true ),
'link' => array( 'title' => __('Insert/edit link (Alt + Shift + A)'), 'both' => true ),
'unlink' => array( 'title' => __('Unlink (Alt + Shift + S)'), 'both' => false ),
'help' => array( 'title' => __('Help (Alt + Shift + H)'), 'both' => false ),
);
/**
* Filter the list of TinyMCE buttons for the fullscreen
* 'Distraction-Free Writing' editor.
*
* @since 3.2.0
*
* @param array $buttons An array of TinyMCE buttons for the DFW editor.
*/
$buttons = apply_filters( 'wp_fullscreen_buttons', $buttons );
foreach ( $buttons as $button => $args ) {
if ( 'separator' == $args ) {
continue;
}
$onclick = ! empty( $args['onclick'] ) ? ' onclick="' . $args['onclick'] . '"' : '';
$title = esc_attr( $args['title'] );
?>
<div class="mce-widget mce-btn<?php if ( $args['both'] ) { ?> wp-fullscreen-both<?php } ?>">
<button type="button" aria-label="<?php echo $title; ?>" title="<?php echo $title; ?>"<?php echo $onclick; ?> id="wp_fs_<?php echo $button; ?>">
<i class="mce-ico mce-i-<?php echo $button; ?>"></i>
</button>
</div>
<?php
}
?>
</div></div>
<div id="wp-fullscreen-save">
<input type="button" class="button button-primary right" value="<?php echo $save; ?>" onclick="wp.editor.fullscreen.save();" />
<span class="wp-fullscreen-saved-message"><?php if ( $post && $post->post_status == 'publish' ) _e('Updated.'); else _e('Saved.'); ?></span>
<span class="wp-fullscreen-error-message"><?php _e('Save failed.'); ?></span>
<span class="spinner"></span>
</div>
</div>
</div>
</div>
<div id="wp-fullscreen-statusbar">
<div id="wp-fullscreen-status">
<div id="wp-fullscreen-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></div>
<div id="wp-fullscreen-tagline"><?php _e('Just write.'); ?></div>
</div>
</div>
</div>
<div class="fullscreen-overlay" id="fullscreen-overlay"></div>
<div class="fullscreen-overlay fullscreen-fader fade-300" id="fullscreen-fader"></div>
<?php
_deprecated_function( __FUNCTION__, '4.3' );
}
/**

View File

@ -299,7 +299,6 @@ div.mce-path {
cursor: pointer;
}
#wp-fullscreen-buttons .mce-btn,
.mce-toolbar .mce-btn-group .mce-btn,
.qt-dfw {
border: 1px solid transparent;
@ -311,9 +310,7 @@ div.mce-path {
filter: none;
}
#wp-fullscreen-buttons .mce-btn:hover,
.mce-toolbar .mce-btn-group .mce-btn:hover,
#wp-fullscreen-buttons .mce-btn:focus,
.mce-toolbar .mce-btn-group .mce-btn:focus,
.qt-dfw:hover,
.qt-dfw:focus {
@ -326,9 +323,7 @@ div.mce-path {
}
.mce-toolbar .mce-btn-group .mce-btn.mce-active,
#wp-fullscreen-buttons .mce-btn.mce-active,
.mce-toolbar .mce-btn-group .mce-btn:active,
#wp-fullscreen-buttons .mce-btn:active,
.qt-dfw.active {
background: #ebebeb;
border-color: #999;
@ -345,9 +340,7 @@ div.mce-path {
}
.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:hover,
#wp-fullscreen-buttons .mce-btn.mce-disabled:hover,
.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus,
#wp-fullscreen-buttons .mce-btn.mce-disabled:focus {
.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus {
color: #a0a5aa;
background: none;
border-color: #ddd;
@ -1111,7 +1104,6 @@ i.mce-i-wp_code:before {
padding: 6px 7px;
}
#wp-fullscreen-buttons .mce-btn,
.mce-toolbar .mce-btn-group .mce-btn {
margin: 1px;
}
@ -1607,509 +1599,13 @@ i.mce-i-wp_code:before {
}
}
/* Old TinyMCE 3.x modal */
/*
.clearlooks2 .mceTop {
border-bottom: 1px solid #ccc;
}
.clearlooks2 .mceTop span {
font: 13px/24px "Open Sans", sans-serif;
color: #e5e5e5;
}
.clearlooks2 .mceTop .mceLeft {
background: #444444;
border-color: transparent;
}
.clearlooks2 .mceTop .mceRight {
background: #444444;
border-color: transparent;
}
.clearlooks2 .mceMiddle {
clip: rect(24px auto auto auto);
}
.clearlooks2 .mceMiddle .mceLeft {
background: #f1f1f1;
border-color: transparent;
}
.clearlooks2 .mceMiddle .mceRight {
background: #f1f1f1;
border-color: transparent;
}
.clearlooks2 .mceBottom {
background: #f1f1f1;
border-color: transparent;
}
.clearlooks2 .mceBottom .mceLeft {
background: #f1f1f1;
border-color: transparent;
}
.clearlooks2 .mceBottom .mceCenter {
background: #f1f1f1;
border-color: transparent;
}
.clearlooks2 .mceBottom .mceRight {
background: #f1f1f1;
border-color: transparent;
}
.clearlooks2 .mceClose,
.clearlooks2 .mceFocus .mceClose,
.clearlooks2 .mceFocus .mceClose:hover {
background-image: none;
}
.clearlooks2 .mceClose:before {
content: '\f158';
font: normal 20px/1 'dashicons';
speak: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #999;
padding-left: 12px;
}
/* from colors.css
.clearlooks2 {
box-shadow: 0 5px 15px rgba(0,0,0,0.7);
}
.clearlooks2 .mceMiddle span,
.clearlooks2 .mceMiddle .mceLeft,
.clearlooks2 .mceMiddle .mceRight,
.clearlooks2 .mceBottom,
.clearlooks2 .mceBottom .mceLeft,
.clearlooks2 .mceBottom .mceCenter,
.clearlooks2 .mceBottom .mceRight {
background-color: #fcfcfc;
}
.clearlooks2 .mceTop span,
.clearlooks2 .mceFocus .mceTop span {
color: #23282d;
}
.clearlooks2 .mceClose:before {
color: #999;
}
.clearlooks2 .mceClose:hover:before {
color: #00a0d2;
}
*/
/* Distraction-Free Writing mode
* =Overlay Styles
-------------------------------------------------------------- */
.fullscreen-overlay {
z-index: 100005;
display: none;
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
-webkit-filter: inherit;
filter: inherit;
}
.wp-fullscreen-active .fullscreen-overlay,
.wp-fullscreen-active #wp-fullscreen-body {
display: block;
}
.fullscreen-fader {
z-index: 200000;
}
.wp-fullscreen-active .fullscreen-fader,
.wp-core-ui.wp-fullscreen-active .postbox-container {
display: none;
}
/* =Overlay Body
-------------------------------------------------------------- */
#wp-fullscreen-body,
.mce-fullscreen {
z-index: 100010;
}
#wp-fullscreen-body {
display: none;
}
.wp-fullscreen-wrap {
margin: 0;
padding: 0;
position: absolute;
right: 0;
left: 0;
bottom: 30px;
top: 60px;
z-index: 100015;
}
.wp-fullscreen-wrap .wp-editor-container,
.wp-fullscreen-title,
#wp-fullscreen-central-toolbar {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
max-width: 100%;
}
.wp-fullscreen-active .wp-editor-tools,
.wp-fullscreen-active .quicktags-toolbar,
.wp-fullscreen-active .mce-toolbar-grp,
.wp-fullscreen-active .mce-statusbar {
display: none;
}
#wp-fullscreen-statusbar {
position: fixed;
right: 0;
left: 0;
bottom: 0;
height: 30px;
z-index: 100020;
background: #fff;
-webkit-transition: height 0.2s;
transition: height 0.2s;
}
#wp-fullscreen-status {
margin: 0 auto;
padding: 0;
}
.wp-fullscreen-active .wp-fullscreen-title,
.wp-fullscreen-active .wp-fullscreen-title:focus,
.wp-fullscreen-active .wp-editor-container {
-webkit-border-radius: 0;
border-radius: 0;
border: 1px dashed transparent;
background: transparent;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-transition: border-color 0.4s;
transition: border-color 0.4s;
}
.wp-fullscreen-active .wp-editor-container {
margin: 0 auto 40px;
}
.wp-fullscreen-active .wp-fullscreen-title {
font-size: 1.7em;
line-height: 100%;
outline: medium none;
padding: 3px 7px;
margin: 10px auto 30px;
display: block;
}
#wp-fullscreen-tagline {
color: #82878c;
font-size: 18px;
float: left;
padding: 4px 0 0;
}
/* =Top bar
-------------------------------------------------------------- */
#fullscreen-topbar {
background: #f5f5f5;
border-bottom: 1px solid #dedede;
height: 45px;
position: fixed;
right: 0;
left: 0;
top: 0;
width: 100%;
z-index: 100020;
-webkit-transition: opacity 0.4s;
transition: opacity 0.4s;
}
#wp-fullscreen-toolbar {
padding: 6px 10px 0;
clear: both;
max-width: 1100px;
margin: 0 auto;
}
#wp-fullscreen-mode-bar,
#wp-fullscreen-button-bar,
#wp-fullscreen-close {
float: right;
}
#wp-fullscreen-count,
#wp-fullscreen-tagline {
display: inline-block;
}
#wp-fullscreen-button-bar {
margin-top: 2px;
}
#wp-fullscreen-save {
float: left;
padding: 2px 0 0;
min-width: 95px;
}
#wp-fullscreen-count,
#wp-fullscreen-close {
padding: 5px 0 0;
}
#wp-fullscreen-central-toolbar {
margin: auto;
padding: 0;
min-width: 620px;
}
#wp-fullscreen-buttons > div {
float: right;
}
#wp-fullscreen-mode-bar {
padding: 3px 0 0 14px;
}
#wp-fullscreen-buttons .hidden {
display: none;
}
#wp-fullscreen-buttons .disabled {
opacity: 0.5;
}
#wp-fullscreen-buttons .mce-btn button {
margin: 0;
outline: 0 none;
border: 0 none;
white-space: nowrap;
width: auto;
background: none;
color: #32373c;
cursor: pointer;
font-size: 18px;
line-height: 20px;
overflow: visible;
text-align: center;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.wp-html-mode #wp-fullscreen-buttons div {
display: none;
}
.wp-html-mode #wp-fullscreen-buttons div.wp-fullscreen-both {
display: block;
}
#wp-fullscreen-save img {
vertical-align: middle;
}
#wp-fullscreen-save span {
display: none;
margin: 5px 6px 0;
float: right;
}
/* =Thickbox Adjustments
-------------------------------------------------------------- */
.wp-fullscreen-active #TB_overlay {
z-index: 100050;
}
.wp-fullscreen-active #TB_window {
z-index: 100051;
}
/* Colors */
.fullscreen-overlay {
background: #fff;
}
/* =CSS 3 transitions
-------------------------------------------------------------- */
.wp-fullscreen-active #fullscreen-topbar {
-webkit-transition-duration: 0.8s;
transition-duration: 0.8s;
opacity: 0;
filter: alpha(opacity=0);
}
.wp-fullscreen-active #wp-fullscreen-statusbar {
height: 0;
}
.wp-fullscreen-active.wp-dfw-show-ui #fullscreen-topbar {
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
opacity: 1;
filter: alpha(opacity=100);
}
.wp-fullscreen-active.wp-dfw-show-ui #wp-fullscreen-statusbar {
height: 29px;
background: #f8f8f8;
border-top: 1px solid #eee;
}
.wp-fullscreen-active .wp-fullscreen-title,
.wp-fullscreen-active .wp-editor-container {
-webkit-transition-duration: 0.8s;
transition-duration: 0.8s;
border-color: transparent;
}
.wp-fullscreen-active.wp-dfw-show-ui .wp-fullscreen-title,
.wp-fullscreen-active.wp-dfw-show-ui .wp-editor-container {
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
border-color: #ccc;
}
.fade-1000,
.fade-600,
.fade-400,
.fade-300 {
opacity: 0;
-webkit-transition-property: opacity;
transition-property: opacity;
}
.fade-1000 {
-webkit-transition-duration: 1s;
transition-duration: 1s;
}
.fade-600 {
-webkit-transition-duration: 0.6s;
transition-duration: 0.6s;
}
.fade-400 {
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
}
.fade-300 {
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.fade-trigger {
opacity: 1;
}
/* DFW on touch screen devices */
.wp-dfw-touch #fullscreen-topbar {
position: absolute;
opacity: 1;
}
.wp-dfw-touch .wp-fullscreen-wrap .wp-editor-container,
.wp-dfw-touch .wp-fullscreen-title {
max-width: 700px;
}
.wp-fullscreen-active.wp-dfw-touch .wp-fullscreen-title,
.wp-fullscreen-active.wp-dfw-touch .wp-editor-container {
border-color: #ccc;
}
.wp-dfw-touch #wp-fullscreen-statusbar {
height: 30px;
}
@media screen and ( max-width: 782px ) {
#wp-fullscreen-close,
#wp-fullscreen-central-toolbar,
#wp-fullscreen-mode-bar,
#wp-fullscreen-button-bar,
#wp-fullscreen-save {
display: inline-block;
}
#fullscreen-topbar {
height: 85px;
}
#wp-fullscreen-central-toolbar {
width: auto !important;
min-width: 0;
}
#wp-fullscreen-close {
line-height: 30px;
vertical-align: top;
padding: 0 12px;
}
#wp-fullscreen-button-bar {
position: absolute;
top: 45px;
right: 0;
}
.wp-fullscreen-wrap {
top: 95px;
}
#wp-fullscreen-save {
position: absolute;
left: 10px;
}
}
@media screen and ( max-width: 480px ) {
#wp_fs_help {
display: none;
}
.wp-fullscreen-wrap .wp-editor-container,
.wp-fullscreen-title {
width: 480px !important;
}
body.wp-fullscreen-active {
width: 480px;
overflow: auto;
}
#fullscreen-topbar,
.wp-fullscreen-wrap {
width: 480px;
}
#fullscreen-topbar {
position: absolute;
}
#wp-fullscreen-status {
width: auto !important;
max-width: 100%;
padding: 0 10px;
}
}
/* =Localization
-------------------------------------------------------------- */
.rtl .wp-switch-editor,
@ -2136,8 +1632,7 @@ html:lang(he-il) .rtl .quicktags-toolbar input {
@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
.wp-media-buttons .add_media span.wp-media-buttons-icon,
#wp-fullscreen-buttons #wp_fs_image span.mce_image {
.wp-media-buttons .add_media span.wp-media-buttons-icon {
background: none;
}
}

File diff suppressed because one or more lines are too long

View File

@ -299,7 +299,6 @@ div.mce-path {
cursor: pointer;
}
#wp-fullscreen-buttons .mce-btn,
.mce-toolbar .mce-btn-group .mce-btn,
.qt-dfw {
border: 1px solid transparent;
@ -311,9 +310,7 @@ div.mce-path {
filter: none;
}
#wp-fullscreen-buttons .mce-btn:hover,
.mce-toolbar .mce-btn-group .mce-btn:hover,
#wp-fullscreen-buttons .mce-btn:focus,
.mce-toolbar .mce-btn-group .mce-btn:focus,
.qt-dfw:hover,
.qt-dfw:focus {
@ -326,9 +323,7 @@ div.mce-path {
}
.mce-toolbar .mce-btn-group .mce-btn.mce-active,
#wp-fullscreen-buttons .mce-btn.mce-active,
.mce-toolbar .mce-btn-group .mce-btn:active,
#wp-fullscreen-buttons .mce-btn:active,
.qt-dfw.active {
background: #ebebeb;
border-color: #999;
@ -345,9 +340,7 @@ div.mce-path {
}
.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:hover,
#wp-fullscreen-buttons .mce-btn.mce-disabled:hover,
.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus,
#wp-fullscreen-buttons .mce-btn.mce-disabled:focus {
.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus {
color: #a0a5aa;
background: none;
border-color: #ddd;
@ -1111,7 +1104,6 @@ i.mce-i-wp_code:before {
padding: 6px 7px;
}
#wp-fullscreen-buttons .mce-btn,
.mce-toolbar .mce-btn-group .mce-btn {
margin: 1px;
}
@ -1607,509 +1599,13 @@ i.mce-i-wp_code:before {
}
}
/* Old TinyMCE 3.x modal */
/*
.clearlooks2 .mceTop {
border-bottom: 1px solid #ccc;
}
.clearlooks2 .mceTop span {
font: 13px/24px "Open Sans", sans-serif;
color: #e5e5e5;
}
.clearlooks2 .mceTop .mceLeft {
background: #444444;
border-color: transparent;
}
.clearlooks2 .mceTop .mceRight {
background: #444444;
border-color: transparent;
}
.clearlooks2 .mceMiddle {
clip: rect(24px auto auto auto);
}
.clearlooks2 .mceMiddle .mceLeft {
background: #f1f1f1;
border-color: transparent;
}
.clearlooks2 .mceMiddle .mceRight {
background: #f1f1f1;
border-color: transparent;
}
.clearlooks2 .mceBottom {
background: #f1f1f1;
border-color: transparent;
}
.clearlooks2 .mceBottom .mceLeft {
background: #f1f1f1;
border-color: transparent;
}
.clearlooks2 .mceBottom .mceCenter {
background: #f1f1f1;
border-color: transparent;
}
.clearlooks2 .mceBottom .mceRight {
background: #f1f1f1;
border-color: transparent;
}
.clearlooks2 .mceClose,
.clearlooks2 .mceFocus .mceClose,
.clearlooks2 .mceFocus .mceClose:hover {
background-image: none;
}
.clearlooks2 .mceClose:before {
content: '\f158';
font: normal 20px/1 'dashicons';
speak: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #999;
padding-left: 12px;
}
/* from colors.css
.clearlooks2 {
box-shadow: 0 5px 15px rgba(0,0,0,0.7);
}
.clearlooks2 .mceMiddle span,
.clearlooks2 .mceMiddle .mceLeft,
.clearlooks2 .mceMiddle .mceRight,
.clearlooks2 .mceBottom,
.clearlooks2 .mceBottom .mceLeft,
.clearlooks2 .mceBottom .mceCenter,
.clearlooks2 .mceBottom .mceRight {
background-color: #fcfcfc;
}
.clearlooks2 .mceTop span,
.clearlooks2 .mceFocus .mceTop span {
color: #23282d;
}
.clearlooks2 .mceClose:before {
color: #999;
}
.clearlooks2 .mceClose:hover:before {
color: #00a0d2;
}
*/
/* Distraction-Free Writing mode
* =Overlay Styles
-------------------------------------------------------------- */
.fullscreen-overlay {
z-index: 100005;
display: none;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
-webkit-filter: inherit;
filter: inherit;
}
.wp-fullscreen-active .fullscreen-overlay,
.wp-fullscreen-active #wp-fullscreen-body {
display: block;
}
.fullscreen-fader {
z-index: 200000;
}
.wp-fullscreen-active .fullscreen-fader,
.wp-core-ui.wp-fullscreen-active .postbox-container {
display: none;
}
/* =Overlay Body
-------------------------------------------------------------- */
#wp-fullscreen-body,
.mce-fullscreen {
z-index: 100010;
}
#wp-fullscreen-body {
display: none;
}
.wp-fullscreen-wrap {
margin: 0;
padding: 0;
position: absolute;
left: 0;
right: 0;
bottom: 30px;
top: 60px;
z-index: 100015;
}
.wp-fullscreen-wrap .wp-editor-container,
.wp-fullscreen-title,
#wp-fullscreen-central-toolbar {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
max-width: 100%;
}
.wp-fullscreen-active .wp-editor-tools,
.wp-fullscreen-active .quicktags-toolbar,
.wp-fullscreen-active .mce-toolbar-grp,
.wp-fullscreen-active .mce-statusbar {
display: none;
}
#wp-fullscreen-statusbar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: 30px;
z-index: 100020;
background: #fff;
-webkit-transition: height 0.2s;
transition: height 0.2s;
}
#wp-fullscreen-status {
margin: 0 auto;
padding: 0;
}
.wp-fullscreen-active .wp-fullscreen-title,
.wp-fullscreen-active .wp-fullscreen-title:focus,
.wp-fullscreen-active .wp-editor-container {
-webkit-border-radius: 0;
border-radius: 0;
border: 1px dashed transparent;
background: transparent;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-transition: border-color 0.4s;
transition: border-color 0.4s;
}
.wp-fullscreen-active .wp-editor-container {
margin: 0 auto 40px;
}
.wp-fullscreen-active .wp-fullscreen-title {
font-size: 1.7em;
line-height: 100%;
outline: medium none;
padding: 3px 7px;
margin: 10px auto 30px;
display: block;
}
#wp-fullscreen-tagline {
color: #82878c;
font-size: 18px;
float: right;
padding: 4px 0 0;
}
/* =Top bar
-------------------------------------------------------------- */
#fullscreen-topbar {
background: #f5f5f5;
border-bottom: 1px solid #dedede;
height: 45px;
position: fixed;
left: 0;
right: 0;
top: 0;
width: 100%;
z-index: 100020;
-webkit-transition: opacity 0.4s;
transition: opacity 0.4s;
}
#wp-fullscreen-toolbar {
padding: 6px 10px 0;
clear: both;
max-width: 1100px;
margin: 0 auto;
}
#wp-fullscreen-mode-bar,
#wp-fullscreen-button-bar,
#wp-fullscreen-close {
float: left;
}
#wp-fullscreen-count,
#wp-fullscreen-tagline {
display: inline-block;
}
#wp-fullscreen-button-bar {
margin-top: 2px;
}
#wp-fullscreen-save {
float: right;
padding: 2px 0 0;
min-width: 95px;
}
#wp-fullscreen-count,
#wp-fullscreen-close {
padding: 5px 0 0;
}
#wp-fullscreen-central-toolbar {
margin: auto;
padding: 0;
min-width: 620px;
}
#wp-fullscreen-buttons > div {
float: left;
}
#wp-fullscreen-mode-bar {
padding: 3px 14px 0 0;
}
#wp-fullscreen-buttons .hidden {
display: none;
}
#wp-fullscreen-buttons .disabled {
opacity: 0.5;
}
#wp-fullscreen-buttons .mce-btn button {
margin: 0;
outline: 0 none;
border: 0 none;
white-space: nowrap;
width: auto;
background: none;
color: #32373c;
cursor: pointer;
font-size: 18px;
line-height: 20px;
overflow: visible;
text-align: center;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.wp-html-mode #wp-fullscreen-buttons div {
display: none;
}
.wp-html-mode #wp-fullscreen-buttons div.wp-fullscreen-both {
display: block;
}
#wp-fullscreen-save img {
vertical-align: middle;
}
#wp-fullscreen-save span {
display: none;
margin: 5px 6px 0;
float: left;
}
/* =Thickbox Adjustments
-------------------------------------------------------------- */
.wp-fullscreen-active #TB_overlay {
z-index: 100050;
}
.wp-fullscreen-active #TB_window {
z-index: 100051;
}
/* Colors */
.fullscreen-overlay {
background: #fff;
}
/* =CSS 3 transitions
-------------------------------------------------------------- */
.wp-fullscreen-active #fullscreen-topbar {
-webkit-transition-duration: 0.8s;
transition-duration: 0.8s;
opacity: 0;
filter: alpha(opacity=0);
}
.wp-fullscreen-active #wp-fullscreen-statusbar {
height: 0;
}
.wp-fullscreen-active.wp-dfw-show-ui #fullscreen-topbar {
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
opacity: 1;
filter: alpha(opacity=100);
}
.wp-fullscreen-active.wp-dfw-show-ui #wp-fullscreen-statusbar {
height: 29px;
background: #f8f8f8;
border-top: 1px solid #eee;
}
.wp-fullscreen-active .wp-fullscreen-title,
.wp-fullscreen-active .wp-editor-container {
-webkit-transition-duration: 0.8s;
transition-duration: 0.8s;
border-color: transparent;
}
.wp-fullscreen-active.wp-dfw-show-ui .wp-fullscreen-title,
.wp-fullscreen-active.wp-dfw-show-ui .wp-editor-container {
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
border-color: #ccc;
}
.fade-1000,
.fade-600,
.fade-400,
.fade-300 {
opacity: 0;
-webkit-transition-property: opacity;
transition-property: opacity;
}
.fade-1000 {
-webkit-transition-duration: 1s;
transition-duration: 1s;
}
.fade-600 {
-webkit-transition-duration: 0.6s;
transition-duration: 0.6s;
}
.fade-400 {
-webkit-transition-duration: 0.4s;
transition-duration: 0.4s;
}
.fade-300 {
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.fade-trigger {
opacity: 1;
}
/* DFW on touch screen devices */
.wp-dfw-touch #fullscreen-topbar {
position: absolute;
opacity: 1;
}
.wp-dfw-touch .wp-fullscreen-wrap .wp-editor-container,
.wp-dfw-touch .wp-fullscreen-title {
max-width: 700px;
}
.wp-fullscreen-active.wp-dfw-touch .wp-fullscreen-title,
.wp-fullscreen-active.wp-dfw-touch .wp-editor-container {
border-color: #ccc;
}
.wp-dfw-touch #wp-fullscreen-statusbar {
height: 30px;
}
@media screen and ( max-width: 782px ) {
#wp-fullscreen-close,
#wp-fullscreen-central-toolbar,
#wp-fullscreen-mode-bar,
#wp-fullscreen-button-bar,
#wp-fullscreen-save {
display: inline-block;
}
#fullscreen-topbar {
height: 85px;
}
#wp-fullscreen-central-toolbar {
width: auto !important;
min-width: 0;
}
#wp-fullscreen-close {
line-height: 30px;
vertical-align: top;
padding: 0 12px;
}
#wp-fullscreen-button-bar {
position: absolute;
top: 45px;
left: 0;
}
.wp-fullscreen-wrap {
top: 95px;
}
#wp-fullscreen-save {
position: absolute;
right: 10px;
}
}
@media screen and ( max-width: 480px ) {
#wp_fs_help {
display: none;
}
.wp-fullscreen-wrap .wp-editor-container,
.wp-fullscreen-title {
width: 480px !important;
}
body.wp-fullscreen-active {
width: 480px;
overflow: auto;
}
#fullscreen-topbar,
.wp-fullscreen-wrap {
width: 480px;
}
#fullscreen-topbar {
position: absolute;
}
#wp-fullscreen-status {
width: auto !important;
max-width: 100%;
padding: 0 10px;
}
}
/* =Localization
-------------------------------------------------------------- */
.rtl .wp-switch-editor,
@ -2136,8 +1632,7 @@ html:lang(he-il) .rtl .quicktags-toolbar input {
@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
.wp-media-buttons .add_media span.wp-media-buttons-icon,
#wp-fullscreen-buttons #wp_fs_image span.mce_image {
.wp-media-buttons .add_media span.wp-media-buttons-icon {
background: none;
}
}

File diff suppressed because one or more lines are too long

View File

@ -2042,7 +2042,6 @@
}
/* Drag & drop on the editor upload */
#wp-fullscreen-body .uploader-editor,
.wp-editor-wrap .uploader-editor {
background: rgba( 150, 150, 150, 0.9 );
position: absolute;
@ -2055,17 +2054,6 @@
text-align: center;
}
#wp-fullscreen-body .uploader-editor {
background: rgba( 0, 86, 132, 0.9 );
position: fixed;
z-index: 100050; /* above the editor toolbar */
}
.wp-editor-wrap.wp-fullscreen-wrap .uploader-editor {
opacity: 0;
}
#wp-fullscreen-body .uploader-editor-content,
.wp-editor-wrap .uploader-editor-content {
border: 1px dashed #fff;
position: absolute;
@ -2075,7 +2063,6 @@
bottom: 10px;
}
#wp-fullscreen-body .uploader-editor .uploader-editor-title,
.wp-editor-wrap .uploader-editor .uploader-editor-title {
position: absolute;
top: 50%;
@ -2097,7 +2084,6 @@
background: rgba( 0, 86, 132, 0.9 );
}
#wp-fullscreen-body .uploader-editor .uploader-editor-title,
.wp-editor-wrap .uploader-editor.droppable .uploader-editor-title {
display: block;
}

File diff suppressed because one or more lines are too long

View File

@ -2042,7 +2042,6 @@
}
/* Drag & drop on the editor upload */
#wp-fullscreen-body .uploader-editor,
.wp-editor-wrap .uploader-editor {
background: rgba( 150, 150, 150, 0.9 );
position: absolute;
@ -2055,17 +2054,6 @@
text-align: center;
}
#wp-fullscreen-body .uploader-editor {
background: rgba( 0, 86, 132, 0.9 );
position: fixed;
z-index: 100050; /* above the editor toolbar */
}
.wp-editor-wrap.wp-fullscreen-wrap .uploader-editor {
opacity: 0;
}
#wp-fullscreen-body .uploader-editor-content,
.wp-editor-wrap .uploader-editor-content {
border: 1px dashed #fff;
position: absolute;
@ -2075,7 +2063,6 @@
bottom: 10px;
}
#wp-fullscreen-body .uploader-editor .uploader-editor-title,
.wp-editor-wrap .uploader-editor .uploader-editor-title {
position: absolute;
top: 50%;
@ -2097,7 +2084,6 @@
background: rgba( 0, 86, 132, 0.9 );
}
#wp-fullscreen-body .uploader-editor .uploader-editor-title,
.wp-editor-wrap .uploader-editor.droppable .uploader-editor-title {
display: block;
}

File diff suppressed because one or more lines are too long

View File

@ -283,11 +283,6 @@ function edButton(id, display, tagStart, tagEnd, access) {
}
}
if ( use && use.indexOf(',fullscreen,') !== -1 ) {
theButtons.fullscreen = new qt.FullscreenButton();
html += theButtons.fullscreen.html(name + '_');
}
if ( use && use.indexOf(',dfw,') !== -1 ) {
theButtons.dfw = new qt.DFWButton();
html += theButtons.dfw.html( name + '_' );
@ -623,18 +618,6 @@ function edButton(id, display, tagStart, tagEnd, access) {
}
};
qt.FullscreenButton = function() {
qt.Button.call(this, 'fullscreen', quicktagsL10n.fullscreen, 'f', quicktagsL10n.toggleFullscreen);
};
qt.FullscreenButton.prototype = new qt.Button();
qt.FullscreenButton.prototype.callback = function(e, c) {
if ( ! c.id || typeof wp === 'undefined' || ! wp.editor || ! wp.editor.fullscreen ) {
return;
}
wp.editor.fullscreen.on();
};
qt.DFWButton = function() {
qt.Button.call( this, 'dfw', '', 'f', quicktagsL10n.dfw );
};

File diff suppressed because one or more lines are too long

View File

@ -1,76 +0,0 @@
/* global tinymce */
/**
* WP Fullscreen (Distraction-Free Writing) TinyMCE plugin
*/
tinymce.PluginManager.add( 'wpfullscreen', function( editor ) {
var settings = editor.settings;
function fullscreenOn() {
settings.wp_fullscreen = true;
editor.dom.addClass( editor.getDoc().documentElement, 'wp-fullscreen' );
// Start auto-resizing
editor.execCommand( 'wpAutoResizeOn' );
}
function fullscreenOff() {
settings.wp_fullscreen = false;
editor.dom.removeClass( editor.getDoc().documentElement, 'wp-fullscreen' );
// Stop auto-resizing
editor.execCommand( 'wpAutoResizeOff' );
}
// For use from outside the editor.
editor.addCommand( 'wpFullScreenOn', fullscreenOn );
editor.addCommand( 'wpFullScreenOff', fullscreenOff );
function getExtAPI() {
return ( typeof wp !== 'undefined' && wp.editor && wp.editor.fullscreen );
}
// Toggle DFW mode. For use from inside the editor.
function toggleFullscreen() {
var fullscreen = getExtAPI();
if ( fullscreen ) {
if ( editor.getParam('wp_fullscreen') ) {
fullscreen.off();
} else {
fullscreen.on();
}
}
}
editor.addCommand( 'wpFullScreen', toggleFullscreen );
editor.on( 'keydown', function( event ) {
var fullscreen;
// Turn fullscreen off when Esc is pressed.
if ( event.keyCode === 27 && ( fullscreen = getExtAPI() ) && fullscreen.settings.visible ) {
fullscreen.off();
}
});
editor.on( 'init', function() {
// Set the editor when initializing from whitin DFW
if ( editor.getParam('wp_fullscreen') ) {
fullscreenOn();
}
});
// Register buttons
editor.addButton( 'wp_fullscreen', {
tooltip: 'Distraction-free writing mode',
shortcut: 'Alt+Shift+W',
onclick: toggleFullscreen,
classes: 'wp-fullscreen btn widget' // This overwrites all classes on the container!
});
editor.addMenuItem( 'wp_fullscreen', {
text: 'Distraction-free writing mode',
icon: 'wp_fullscreen',
shortcut: 'Alt+Shift+W',
context: 'view',
onclick: toggleFullscreen
});
});

View File

@ -1 +0,0 @@
tinymce.PluginManager.add("wpfullscreen",function(a){function b(){f.wp_fullscreen=!0,a.dom.addClass(a.getDoc().documentElement,"wp-fullscreen"),a.execCommand("wpAutoResizeOn")}function c(){f.wp_fullscreen=!1,a.dom.removeClass(a.getDoc().documentElement,"wp-fullscreen"),a.execCommand("wpAutoResizeOff")}function d(){return"undefined"!=typeof wp&&wp.editor&&wp.editor.fullscreen}function e(){var b=d();b&&(a.getParam("wp_fullscreen")?b.off():b.on())}var f=a.settings;a.addCommand("wpFullScreenOn",b),a.addCommand("wpFullScreenOff",c),a.addCommand("wpFullScreen",e),a.on("keydown",function(a){var b;27===a.keyCode&&(b=d())&&b.settings.visible&&b.off()}),a.on("init",function(){a.getParam("wp_fullscreen")&&b()}),a.addButton("wp_fullscreen",{tooltip:"Distraction-free writing mode",shortcut:"Alt+Shift+W",onclick:e,classes:"wp-fullscreen btn widget"}),a.addMenuItem("wp_fullscreen",{text:"Distraction-free writing mode",icon:"wp_fullscreen",shortcut:"Alt+Shift+W",context:"view",onclick:e})});

View File

@ -71,17 +71,6 @@ img.emoji {
box-shadow: none !important;
}
/* DFW mode */
html.wp-fullscreen,
html.wp-fullscreen body#tinymce {
width: auto;
max-width: none;
min-height: 0;
overflow: hidden;
color: #333;
background: transparent;
}
.aligncenter,
dl.aligncenter,
.html5-captions .wp-caption.aligncenter {

View File

@ -94,8 +94,6 @@ function wp_default_scripts( &$scripts ) {
'enterURL' => __( 'Enter the URL' ),
'enterImageURL' => __( 'Enter the URL of the image' ),
'enterImageDescription' => __( 'Enter a description of the image' ),
'fullscreen' => __( 'fullscreen' ),
'toggleFullscreen' => esc_attr__( 'Toggle fullscreen mode' ),
'textdirection' => esc_attr__( 'text direction' ),
'toggleTextdirection' => esc_attr__( 'Toggle Editor Text Direction' ),
'dfw' => esc_attr__( 'Distraction-free writing mode' )
@ -105,7 +103,8 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array('utils','jquery'), false, 1 );
$scripts->add( 'wp-fullscreen', "/wp-admin/js/wp-fullscreen$suffix.js", array('jquery'), false, 1 );
// Back-compat for old DFW. To-do: remove at the end of 2016.
$scripts->add( 'wp-fullscreen-stub', "/wp-admin/js/wp-fullscreen-stub$suffix.js", array(), false, 1 );
$scripts->add( 'wp-ajax-response', "/wp-includes/js/wp-ajax-response$suffix.js", array('jquery'), false, 1 );
did_action( 'init' ) && $scripts->localize( 'wp-ajax-response', 'wpAjax', array(

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-alpha-32676';
$wp_version = '4.3-alpha-32677';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.