Introduce Distraction-Free Writing v2, a re-think of DFW that uses the main editor instance
* the "DFW" button is now an auto/off toggle * defaulting to auto during beta, decide later for release * "auto" means that DFW gets enabled as you start typing in editor * tabbing and mousing out will bring the full interface back * there is a slight grace period during which your mouse can quickly return Feature plugin work happened here: https://github.com/avryl/focus props avryl, azaozz, Michael Arestad fixes #29806 Built from https://develop.svn.wordpress.org/trunk@30338 git-svn-id: http://core.svn.wordpress.org/trunk@30337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
95513a0bca
commit
7c4b9419f4
|
@ -512,7 +512,6 @@ if ( post_type_supports($post_type, 'editor') ) {
|
|||
<div id="postdivrich" class="postarea<?php if ( $_wp_editor_expand ) { echo ' wp-editor-expand'; } ?>">
|
||||
|
||||
<?php wp_editor( $post->post_content, 'content', array(
|
||||
'dfw' => true,
|
||||
'drag_drop_upload' => true,
|
||||
'tabfocus_elements' => 'content-html,save-post',
|
||||
'editor_height' => 300,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -278,6 +278,9 @@ final class _WP_Editors {
|
|||
if ( $set['dfw'] )
|
||||
$qtInit['buttons'] .= ',fullscreen';
|
||||
|
||||
if ( $editor_id === 'content' && ! wp_is_mobile() )
|
||||
$qtInit['buttons'] .= ',dfw';
|
||||
|
||||
/**
|
||||
* Filter the Quicktags settings.
|
||||
*
|
||||
|
@ -546,6 +549,13 @@ final class _WP_Editors {
|
|||
$mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id );
|
||||
$mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array();
|
||||
} else {
|
||||
$mce_buttons = array( 'bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker', 'wp_adv' );
|
||||
|
||||
if ( $editor_id ) {
|
||||
$mce_buttons[] = 'dfw';
|
||||
} else {
|
||||
$mce_buttons[] = 'fullscreen';
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the first-row list of TinyMCE buttons (Visual tab).
|
||||
|
@ -555,7 +565,7 @@ final class _WP_Editors {
|
|||
* @param array $buttons First-row list of buttons.
|
||||
* @param string $editor_id Unique editor identifier, e.g. 'content'.
|
||||
*/
|
||||
$mce_buttons = apply_filters( 'mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id );
|
||||
$mce_buttons = apply_filters( 'mce_buttons', $mce_buttons, $editor_id );
|
||||
|
||||
/**
|
||||
* Filter the second-row list of TinyMCE buttons (Visual tab).
|
||||
|
|
|
@ -283,7 +283,7 @@ div.mce-path {
|
|||
}
|
||||
|
||||
.mce-toolbar .mce-btn,
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
border-color: transparent;
|
||||
background: transparent;
|
||||
-webkit-box-shadow: none;
|
||||
|
@ -294,7 +294,7 @@ div.mce-path {
|
|||
|
||||
#wp-fullscreen-buttons .mce-btn,
|
||||
.mce-toolbar .mce-btn-group .mce-btn,
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
border: 1px solid transparent;
|
||||
margin: 2px;
|
||||
background-image: none;
|
||||
|
@ -308,19 +308,21 @@ div.mce-path {
|
|||
.mce-toolbar .mce-btn-group .mce-btn:hover,
|
||||
#wp-fullscreen-buttons .mce-btn:focus,
|
||||
.mce-toolbar .mce-btn-group .mce-btn:focus,
|
||||
.qt-fullscreen:hover,
|
||||
.qt-fullscreen:focus {
|
||||
.qt-dfw:hover,
|
||||
.qt-dfw:focus {
|
||||
background: #fafafa;
|
||||
border-color: #999;
|
||||
color: #222;
|
||||
-webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 );
|
||||
box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 );
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.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 {
|
||||
#wp-fullscreen-buttons .mce-btn:active,
|
||||
.qt-dfw.active {
|
||||
background: #ebebeb;
|
||||
border-color: #999;
|
||||
-webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.3 );
|
||||
|
@ -353,7 +355,7 @@ div.mce-path {
|
|||
}
|
||||
|
||||
.mce-toolbar .mce-btn button,
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
padding: 2px 3px;
|
||||
line-height: normal;
|
||||
}
|
||||
|
@ -668,7 +670,7 @@ div.mce-menu .mce-menu-item-sep,
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
color: #777;
|
||||
line-height: 20px;
|
||||
width: 28px;
|
||||
|
@ -702,6 +704,7 @@ i.mce-i-strikethrough,
|
|||
i.mce-i-spellchecker,
|
||||
i.mce-i-fullscreen,
|
||||
i.mce-i-wp_fullscreen,
|
||||
i.mce-i-dfw,
|
||||
i.mce-i-wp_adv,
|
||||
i.mce-i-underline,
|
||||
i.mce-i-alignjustify,
|
||||
|
@ -733,7 +736,7 @@ i.mce-i-dashicon,
|
|||
padding-left: 2px;
|
||||
}
|
||||
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
font: normal 20px/1 'dashicons';
|
||||
vertical-align: top;
|
||||
speak: none;
|
||||
|
@ -795,7 +798,8 @@ i.mce-i-spellchecker:before {
|
|||
|
||||
i.mce-i-fullscreen:before,
|
||||
i.mce-i-wp_fullscreen:before,
|
||||
.qt-fullscreen:before {
|
||||
i.mce-i-dfw:before,
|
||||
.qt-dfw:before {
|
||||
content: '\f211';
|
||||
}
|
||||
|
||||
|
@ -1071,8 +1075,8 @@ i.mce-i-hr:before {
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
.mce-toolbar .mce-btn-group .mce-btn.mce-wp-fullscreen,
|
||||
.qt-fullscreen {
|
||||
.mce-toolbar .mce-btn-group .mce-btn.mce-wp-dfw,
|
||||
.qt-dfw {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
@ -1081,7 +1085,7 @@ i.mce-i-hr:before {
|
|||
|
||||
@media screen and ( max-width: 782px ) {
|
||||
.mce-toolbar .mce-btn button,
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
padding: 6px 7px;
|
||||
}
|
||||
|
||||
|
@ -1090,12 +1094,12 @@ i.mce-i-hr:before {
|
|||
margin: 1px;
|
||||
}
|
||||
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
width: 36px;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
.mce-toolbar .mce-btn-group .mce-btn.mce-wp-fullscreen {
|
||||
.mce-toolbar .mce-btn-group .mce-btn.mce-wp-dfw {
|
||||
margin: 4px 0 0 4px;
|
||||
}
|
||||
|
||||
|
@ -2109,3 +2113,78 @@ html:lang(he-il) .rtl .quicktags-toolbar input {
|
|||
}
|
||||
|
||||
/* TODO: DFW responsive */
|
||||
|
||||
/* DFW 2
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
.focus-on .wrap > h2,
|
||||
.focus-on #wpfooter,
|
||||
.focus-on .postbox-container,
|
||||
.focus-on div.updated,
|
||||
.focus-on div.error,
|
||||
.focus-on #wp-toolbar {
|
||||
opacity: 0;
|
||||
-webkit-transition-duration: 0.6s;
|
||||
transition-duration: 0.6s;
|
||||
-webkit-transition-property: opacity;
|
||||
transition-property: opacity;
|
||||
-webkit-transition-timing-function: ease-in-out;
|
||||
transition-timing-function: ease-in-out;
|
||||
}
|
||||
|
||||
.focus-on #wp-toolbar {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.focus-off .wrap > h2,
|
||||
.focus-off #wpfooter,
|
||||
.focus-off .postbox-container,
|
||||
.focus-off div.updated,
|
||||
.focus-off div.error,
|
||||
.focus-off #wp-toolbar {
|
||||
opacity: 1;
|
||||
-webkit-transition-duration: 0.2s;
|
||||
transition-duration: 0.2s;
|
||||
-webkit-transition-property: opacity;
|
||||
transition-property: opacity;
|
||||
-webkit-transition-timing-function: ease-in-out;
|
||||
transition-timing-function: ease-in-out;
|
||||
}
|
||||
|
||||
.focus-on #adminmenuback,
|
||||
.focus-on #adminmenuwrap,
|
||||
.focus-on .screen-meta-toggle {
|
||||
-webkit-transition-duration: 0.6s;
|
||||
transition-duration: 0.6s;
|
||||
-webkit-transition-property: -webkit-transform;
|
||||
transition-property: transform;
|
||||
-webkit-transition-timing-function: ease-in-out;
|
||||
transition-timing-function: ease-in-out;
|
||||
}
|
||||
|
||||
.focus-on #adminmenuback,
|
||||
.focus-on #adminmenuwrap {
|
||||
-webkit-transform: translateX( -100% );
|
||||
-ms-transform: translateX( -100% );
|
||||
transform: translateX( -100% );
|
||||
}
|
||||
|
||||
.focus-on .screen-meta-toggle {
|
||||
-webkit-transform: translateY( -100% );
|
||||
-ms-transform: translateY( -100% );
|
||||
transform: translateY( -100% );
|
||||
}
|
||||
|
||||
.focus-off #adminmenuback,
|
||||
.focus-off #adminmenuwrap,
|
||||
.focus-off .screen-meta-toggle {
|
||||
-webkit-transform: translateX( 0 );
|
||||
-ms-transform: translateX( 0 );
|
||||
transform: translateX( 0 );
|
||||
-webkit-transition-duration: 0.2s;
|
||||
transition-duration: 0.2s;
|
||||
-webkit-transition-property: -webkit-transform;
|
||||
transition-property: transform;
|
||||
-webkit-transition-timing-function: ease-in-out;
|
||||
transition-timing-function: ease-in-out;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -283,7 +283,7 @@ div.mce-path {
|
|||
}
|
||||
|
||||
.mce-toolbar .mce-btn,
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
border-color: transparent;
|
||||
background: transparent;
|
||||
-webkit-box-shadow: none;
|
||||
|
@ -294,7 +294,7 @@ div.mce-path {
|
|||
|
||||
#wp-fullscreen-buttons .mce-btn,
|
||||
.mce-toolbar .mce-btn-group .mce-btn,
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
border: 1px solid transparent;
|
||||
margin: 2px;
|
||||
background-image: none;
|
||||
|
@ -308,19 +308,21 @@ div.mce-path {
|
|||
.mce-toolbar .mce-btn-group .mce-btn:hover,
|
||||
#wp-fullscreen-buttons .mce-btn:focus,
|
||||
.mce-toolbar .mce-btn-group .mce-btn:focus,
|
||||
.qt-fullscreen:hover,
|
||||
.qt-fullscreen:focus {
|
||||
.qt-dfw:hover,
|
||||
.qt-dfw:focus {
|
||||
background: #fafafa;
|
||||
border-color: #999;
|
||||
color: #222;
|
||||
-webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 );
|
||||
box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba( 0, 0, 0, 0.08 );
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.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 {
|
||||
#wp-fullscreen-buttons .mce-btn:active,
|
||||
.qt-dfw.active {
|
||||
background: #ebebeb;
|
||||
border-color: #999;
|
||||
-webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.3 );
|
||||
|
@ -353,7 +355,7 @@ div.mce-path {
|
|||
}
|
||||
|
||||
.mce-toolbar .mce-btn button,
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
padding: 2px 3px;
|
||||
line-height: normal;
|
||||
}
|
||||
|
@ -668,7 +670,7 @@ div.mce-menu .mce-menu-item-sep,
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
color: #777;
|
||||
line-height: 20px;
|
||||
width: 28px;
|
||||
|
@ -702,6 +704,7 @@ i.mce-i-strikethrough,
|
|||
i.mce-i-spellchecker,
|
||||
i.mce-i-fullscreen,
|
||||
i.mce-i-wp_fullscreen,
|
||||
i.mce-i-dfw,
|
||||
i.mce-i-wp_adv,
|
||||
i.mce-i-underline,
|
||||
i.mce-i-alignjustify,
|
||||
|
@ -733,7 +736,7 @@ i.mce-i-dashicon,
|
|||
padding-right: 2px;
|
||||
}
|
||||
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
font: normal 20px/1 'dashicons';
|
||||
vertical-align: top;
|
||||
speak: none;
|
||||
|
@ -795,7 +798,8 @@ i.mce-i-spellchecker:before {
|
|||
|
||||
i.mce-i-fullscreen:before,
|
||||
i.mce-i-wp_fullscreen:before,
|
||||
.qt-fullscreen:before {
|
||||
i.mce-i-dfw:before,
|
||||
.qt-dfw:before {
|
||||
content: '\f211';
|
||||
}
|
||||
|
||||
|
@ -1071,8 +1075,8 @@ i.mce-i-hr:before {
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
.mce-toolbar .mce-btn-group .mce-btn.mce-wp-fullscreen,
|
||||
.qt-fullscreen {
|
||||
.mce-toolbar .mce-btn-group .mce-btn.mce-wp-dfw,
|
||||
.qt-dfw {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
|
@ -1081,7 +1085,7 @@ i.mce-i-hr:before {
|
|||
|
||||
@media screen and ( max-width: 782px ) {
|
||||
.mce-toolbar .mce-btn button,
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
padding: 6px 7px;
|
||||
}
|
||||
|
||||
|
@ -1090,12 +1094,12 @@ i.mce-i-hr:before {
|
|||
margin: 1px;
|
||||
}
|
||||
|
||||
.qt-fullscreen {
|
||||
.qt-dfw {
|
||||
width: 36px;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
.mce-toolbar .mce-btn-group .mce-btn.mce-wp-fullscreen {
|
||||
.mce-toolbar .mce-btn-group .mce-btn.mce-wp-dfw {
|
||||
margin: 4px 4px 0 0;
|
||||
}
|
||||
|
||||
|
@ -2109,3 +2113,78 @@ html:lang(he-il) .rtl .quicktags-toolbar input {
|
|||
}
|
||||
|
||||
/* TODO: DFW responsive */
|
||||
|
||||
/* DFW 2
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
.focus-on .wrap > h2,
|
||||
.focus-on #wpfooter,
|
||||
.focus-on .postbox-container,
|
||||
.focus-on div.updated,
|
||||
.focus-on div.error,
|
||||
.focus-on #wp-toolbar {
|
||||
opacity: 0;
|
||||
-webkit-transition-duration: 0.6s;
|
||||
transition-duration: 0.6s;
|
||||
-webkit-transition-property: opacity;
|
||||
transition-property: opacity;
|
||||
-webkit-transition-timing-function: ease-in-out;
|
||||
transition-timing-function: ease-in-out;
|
||||
}
|
||||
|
||||
.focus-on #wp-toolbar {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
.focus-off .wrap > h2,
|
||||
.focus-off #wpfooter,
|
||||
.focus-off .postbox-container,
|
||||
.focus-off div.updated,
|
||||
.focus-off div.error,
|
||||
.focus-off #wp-toolbar {
|
||||
opacity: 1;
|
||||
-webkit-transition-duration: 0.2s;
|
||||
transition-duration: 0.2s;
|
||||
-webkit-transition-property: opacity;
|
||||
transition-property: opacity;
|
||||
-webkit-transition-timing-function: ease-in-out;
|
||||
transition-timing-function: ease-in-out;
|
||||
}
|
||||
|
||||
.focus-on #adminmenuback,
|
||||
.focus-on #adminmenuwrap,
|
||||
.focus-on .screen-meta-toggle {
|
||||
-webkit-transition-duration: 0.6s;
|
||||
transition-duration: 0.6s;
|
||||
-webkit-transition-property: -webkit-transform;
|
||||
transition-property: transform;
|
||||
-webkit-transition-timing-function: ease-in-out;
|
||||
transition-timing-function: ease-in-out;
|
||||
}
|
||||
|
||||
.focus-on #adminmenuback,
|
||||
.focus-on #adminmenuwrap {
|
||||
-webkit-transform: translateX( -100% );
|
||||
-ms-transform: translateX( -100% );
|
||||
transform: translateX( -100% );
|
||||
}
|
||||
|
||||
.focus-on .screen-meta-toggle {
|
||||
-webkit-transform: translateY( -100% );
|
||||
-ms-transform: translateY( -100% );
|
||||
transform: translateY( -100% );
|
||||
}
|
||||
|
||||
.focus-off #adminmenuback,
|
||||
.focus-off #adminmenuwrap,
|
||||
.focus-off .screen-meta-toggle {
|
||||
-webkit-transform: translateX( 0 );
|
||||
-ms-transform: translateX( 0 );
|
||||
transform: translateX( 0 );
|
||||
-webkit-transition-duration: 0.2s;
|
||||
transition-duration: 0.2s;
|
||||
-webkit-transition-property: -webkit-transform;
|
||||
transition-property: transform;
|
||||
-webkit-transition-timing-function: ease-in-out;
|
||||
transition-timing-function: ease-in-out;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -288,6 +288,10 @@ function edButton(id, display, tagStart, tagEnd, access) {
|
|||
html += theButtons.fullscreen.html(name + '_');
|
||||
}
|
||||
|
||||
if ( use && use.indexOf(',dfw,') !== -1 ) {
|
||||
theButtons.dfw = new qt.DFWButton();
|
||||
html += theButtons.dfw.html( name + '_' );
|
||||
}
|
||||
|
||||
if ( 'rtl' === document.getElementsByTagName('html')[0].dir ) {
|
||||
theButtons.textdirection = new qt.TextDirectionButton();
|
||||
|
@ -296,6 +300,8 @@ function edButton(id, display, tagStart, tagEnd, access) {
|
|||
|
||||
ed.toolbar.innerHTML = html;
|
||||
ed.theButtons = theButtons;
|
||||
|
||||
window.jQuery && window.jQuery( document ).trigger( 'quicktags-init', [ ed ] );
|
||||
}
|
||||
t.buttonsInitDone = true;
|
||||
};
|
||||
|
@ -405,11 +411,19 @@ function edButton(id, display, tagStart, tagEnd, access) {
|
|||
t.instance = instance || '';
|
||||
};
|
||||
qt.Button.prototype.html = function(idPrefix) {
|
||||
var title = this.title ? ' title="' + this.title + '"' : '';
|
||||
var title = this.title ? ' title="' + this.title + '"' : '',
|
||||
active, on, wp,
|
||||
dfw = ( wp = window.wp ) && wp.editor && wp.editor.dfw;
|
||||
|
||||
if ( this.id === 'fullscreen' ) {
|
||||
return '<button type="button" id="' + idPrefix + this.id + '" class="ed_button qt-fullscreen"' + title + '></button>';
|
||||
return '<button type="button" id="' + idPrefix + this.id + '" class="ed_button qt-dfw"' + title + '></button>';
|
||||
} else if ( this.id === 'dfw' ) {
|
||||
active = dfw && dfw.isActive() ? '' : ' disabled="disabled"';
|
||||
on = dfw && dfw.isOn() ? ' active' : '';
|
||||
|
||||
return '<button type="button" id="' + idPrefix + this.id + '" class="ed_button qt-dfw' + on + '"' + title + active + '></button>';
|
||||
}
|
||||
|
||||
return '<input type="button" id="' + idPrefix + this.id + '" class="ed_button button button-small"' + title + ' value="' + this.display + '" />';
|
||||
};
|
||||
qt.Button.prototype.callback = function(){};
|
||||
|
@ -619,6 +633,20 @@ function edButton(id, display, tagStart, tagEnd, access) {
|
|||
wp.editor.fullscreen.on();
|
||||
};
|
||||
|
||||
qt.DFWButton = function() {
|
||||
qt.Button.call( this, 'dfw', '', 'f', quicktagsL10n.dfw );
|
||||
};
|
||||
qt.DFWButton.prototype = new qt.Button();
|
||||
qt.DFWButton.prototype.callback = function() {
|
||||
var wp;
|
||||
|
||||
if ( ! ( wp = window.wp ) || ! wp.editor || ! wp.editor.dfw ) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.wp.editor.dfw.toggle();
|
||||
};
|
||||
|
||||
qt.TextDirectionButton = function() {
|
||||
qt.Button.call(this, 'textdirection', quicktagsL10n.textdirection, '', quicktagsL10n.toggleTextdirection);
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -7,6 +7,10 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) {
|
|||
var DOM = tinymce.DOM, wpAdvButton, modKey, style,
|
||||
last = 0;
|
||||
|
||||
if ( typeof window.jQuery !== 'undefined' ) {
|
||||
window.jQuery( document ).triggerHandler( 'tinymce-editor-setup', [ editor ] );
|
||||
}
|
||||
|
||||
function toggleToolbars( state ) {
|
||||
var iframe, initial, toolbars,
|
||||
pixels = 0;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -117,7 +117,7 @@ tinymce.PluginManager.add( 'wpautoresize', function( editor ) {
|
|||
resize( e );
|
||||
}
|
||||
|
||||
editor.fire( 'wp-autoresize', { height: resizeHeight } );
|
||||
editor.fire( 'wp-autoresize', { height: resizeHeight, deltaHeight: e.type === 'nodechange' ? deltaSize : null } );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
tinymce.PluginManager.add("wpautoresize",function(a){function b(){return a.plugins.fullscreen&&a.plugins.fullscreen.isFullscreen()}function c(a){return parseInt(a,10)||0}function d(e){var f,g,k,l,m,n,o,p,q,r,s,t,u=tinymce.DOM;if(j&&(g=a.getDoc())){if(e=e||{},k=g.body,l=g.documentElement,m=h.autoresize_min_height,!k||e&&"setcontent"===e.type&&e.initial||b())return void(k&&l&&(k.style.overflowY="auto",l.style.overflowY="auto"));o=a.dom.getStyle(k,"margin-top",!0),p=a.dom.getStyle(k,"margin-bottom",!0),q=a.dom.getStyle(k,"padding-top",!0),r=a.dom.getStyle(k,"padding-bottom",!0),s=a.dom.getStyle(k,"border-top-width",!0),t=a.dom.getStyle(k,"border-bottom-width",!0),n=k.offsetHeight+c(o)+c(p)+c(q)+c(r)+c(s)+c(t),n&&n<l.offsetHeight&&(n=l.offsetHeight),(isNaN(n)||0>=n)&&(n=tinymce.Env.ie?k.scrollHeight:tinymce.Env.webkit&&0===k.clientHeight?0:k.offsetHeight),n>h.autoresize_min_height&&(m=n),h.autoresize_max_height&&n>h.autoresize_max_height?(m=h.autoresize_max_height,k.style.overflowY="auto",l.style.overflowY="auto"):(k.style.overflowY="hidden",l.style.overflowY="hidden",k.scrollTop=0),m!==i&&(f=m-i,u.setStyle(a.iframeElement,"height",m+"px"),i=m,tinymce.isWebKit&&0>f&&d(e),a.fire("wp-autoresize",{height:m}))}}function e(a,b,c){setTimeout(function(){d(),a--?e(a,b,c):c&&c()},b)}function f(){a.dom.hasClass(a.getBody(),"wp-autoresize")||(j=!0,a.dom.addClass(a.getBody(),"wp-autoresize"),a.on("nodechange setcontent keyup FullscreenStateChanged",d),d())}function g(){var b;h.wp_autoresize_on||(j=!1,b=a.getDoc(),a.dom.removeClass(a.getBody(),"wp-autoresize"),a.off("nodechange setcontent keyup FullscreenStateChanged",d),b.body.style.overflowY="auto",b.documentElement.style.overflowY="auto",i=0)}var h=a.settings,i=300,j=!1;a.settings.inline||(h.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight),10),h.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0),10),h.wp_autoresize_on&&(j=!0,a.on("init",function(){a.dom.addClass(a.getBody(),"wp-autoresize")}),a.on("nodechange keyup FullscreenStateChanged",d),a.on("setcontent",function(){e(3,100)}),a.getParam("autoresize_on_init",!0)&&a.on("init",function(){e(10,200,function(){e(5,1e3)})})),a.on("show",function(){i=0}),a.addCommand("wpAutoResize",d),a.addCommand("wpAutoResizeOn",f),a.addCommand("wpAutoResizeOff",g))});
|
||||
tinymce.PluginManager.add("wpautoresize",function(a){function b(){return a.plugins.fullscreen&&a.plugins.fullscreen.isFullscreen()}function c(a){return parseInt(a,10)||0}function d(e){var f,g,k,l,m,n,o,p,q,r,s,t,u=tinymce.DOM;if(j&&(g=a.getDoc())){if(e=e||{},k=g.body,l=g.documentElement,m=h.autoresize_min_height,!k||e&&"setcontent"===e.type&&e.initial||b())return void(k&&l&&(k.style.overflowY="auto",l.style.overflowY="auto"));o=a.dom.getStyle(k,"margin-top",!0),p=a.dom.getStyle(k,"margin-bottom",!0),q=a.dom.getStyle(k,"padding-top",!0),r=a.dom.getStyle(k,"padding-bottom",!0),s=a.dom.getStyle(k,"border-top-width",!0),t=a.dom.getStyle(k,"border-bottom-width",!0),n=k.offsetHeight+c(o)+c(p)+c(q)+c(r)+c(s)+c(t),n&&n<l.offsetHeight&&(n=l.offsetHeight),(isNaN(n)||0>=n)&&(n=tinymce.Env.ie?k.scrollHeight:tinymce.Env.webkit&&0===k.clientHeight?0:k.offsetHeight),n>h.autoresize_min_height&&(m=n),h.autoresize_max_height&&n>h.autoresize_max_height?(m=h.autoresize_max_height,k.style.overflowY="auto",l.style.overflowY="auto"):(k.style.overflowY="hidden",l.style.overflowY="hidden",k.scrollTop=0),m!==i&&(f=m-i,u.setStyle(a.iframeElement,"height",m+"px"),i=m,tinymce.isWebKit&&0>f&&d(e),a.fire("wp-autoresize",{height:m,deltaHeight:"nodechange"===e.type?f:null}))}}function e(a,b,c){setTimeout(function(){d(),a--?e(a,b,c):c&&c()},b)}function f(){a.dom.hasClass(a.getBody(),"wp-autoresize")||(j=!0,a.dom.addClass(a.getBody(),"wp-autoresize"),a.on("nodechange setcontent keyup FullscreenStateChanged",d),d())}function g(){var b;h.wp_autoresize_on||(j=!1,b=a.getDoc(),a.dom.removeClass(a.getBody(),"wp-autoresize"),a.off("nodechange setcontent keyup FullscreenStateChanged",d),b.body.style.overflowY="auto",b.documentElement.style.overflowY="auto",i=0)}var h=a.settings,i=300,j=!1;a.settings.inline||(h.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight),10),h.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0),10),h.wp_autoresize_on&&(j=!0,a.on("init",function(){a.dom.addClass(a.getBody(),"wp-autoresize")}),a.on("nodechange keyup FullscreenStateChanged",d),a.on("setcontent",function(){e(3,100)}),a.getParam("autoresize_on_init",!0)&&a.on("init",function(){e(10,200,function(){e(5,1e3)})})),a.on("show",function(){i=0}),a.addCommand("wpAutoResize",d),a.addCommand("wpAutoResizeOn",f),a.addCommand("wpAutoResizeOff",g))});
|
|
@ -65,7 +65,7 @@ tinymce.PluginManager.add( 'wpfullscreen', function( editor ) {
|
|||
tooltip: 'Distraction Free Writing',
|
||||
shortcut: 'Alt+Shift+W',
|
||||
onclick: toggleFullscreen,
|
||||
classes: 'wp-fullscreen btn widget' // This overwrites all classes on the container!
|
||||
classes: 'wp-dfw btn widget' // This overwrites all classes on the container!
|
||||
});
|
||||
|
||||
editor.addMenuItem( 'wp_fullscreen', {
|
||||
|
|
|
@ -1 +1 @@
|
|||
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.addShortcut("alt+shift+w","","wpFullScreen")}),a.addButton("wp_fullscreen",{tooltip:"Distraction Free Writing",shortcut:"Alt+Shift+W",onclick:e,classes:"wp-fullscreen btn widget"}),a.addMenuItem("wp_fullscreen",{text:"Distraction Free Writing",icon:"wp_fullscreen",shortcut:"Alt+Shift+W",context:"view",onclick:e})});
|
||||
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.addShortcut("alt+shift+w","","wpFullScreen")}),a.addButton("wp_fullscreen",{tooltip:"Distraction Free Writing",shortcut:"Alt+Shift+W",onclick:e,classes:"wp-dfw btn widget"}),a.addMenuItem("wp_fullscreen",{text:"Distraction Free Writing",icon:"wp_fullscreen",shortcut:"Alt+Shift+W",context:"view",onclick:e})});
|
|
@ -16,6 +16,7 @@ body {
|
|||
color: #333;
|
||||
margin: 9px 10px;
|
||||
max-width: 100%;
|
||||
-webkit-font-smoothing: antialiased !important;
|
||||
}
|
||||
|
||||
body.rtl {
|
||||
|
|
Binary file not shown.
|
@ -94,7 +94,8 @@ function wp_default_scripts( &$scripts ) {
|
|||
'fullscreen' => __( 'fullscreen' ),
|
||||
'toggleFullscreen' => esc_attr__( 'Toggle fullscreen mode' ),
|
||||
'textdirection' => esc_attr__( 'text direction' ),
|
||||
'toggleTextdirection' => esc_attr__( 'Toggle Editor Text Direction' )
|
||||
'toggleTextdirection' => esc_attr__( 'Toggle Editor Text Direction' ),
|
||||
'dfw' => esc_attr__( 'Distraction Free Writing' )
|
||||
) );
|
||||
|
||||
$scripts->add( 'colorpicker', "/wp-includes/js/colorpicker$suffix.js", array('prototype'), '3517m' );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.1-alpha-30337';
|
||||
$wp_version = '4.1-alpha-30338';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
@ -18,7 +18,7 @@ $wp_db_version = 30133;
|
|||
*
|
||||
* @global string $tinymce_version
|
||||
*/
|
||||
$tinymce_version = '4106-20141022';
|
||||
$tinymce_version = '4106-20141113';
|
||||
|
||||
/**
|
||||
* Holds the required PHP version
|
||||
|
|
Loading…
Reference in New Issue