Fixes #40859 #40756.
Built from https://develop.svn.wordpress.org/trunk@40834


git-svn-id: http://core.svn.wordpress.org/trunk@40685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2017-05-25 01:14:43 +00:00
parent 478d7730b6
commit a8309f80c3
7 changed files with 49 additions and 29 deletions

View File

@ -517,7 +517,7 @@ define(
var getData = function (editor) {
return {
html: editor.selection.getContent(),
html: editor.selection.getContent({ contextual: true }),
text: editor.selection.getContent({ format: 'text' })
};
};

File diff suppressed because one or more lines are too long

View File

@ -283,17 +283,17 @@ define(
function (DOMUtils) {
var DOM = DOMUtils.DOM;
var reposition = function (editor, poweredByElm) {
var reposition = function (editor, poweredByElm, hasStatusbar) {
return function () {
var iframeWidth = editor.getContentAreaContainer().querySelector('iframe').offsetWidth;
var scrollbarWidth = Math.max(iframeWidth - editor.getDoc().documentElement.offsetWidth, 0);
var statusbarElm = editor.getContainer().querySelector('.mce-statusbar');
var statusbarHeight = statusbarElm ? statusbarElm.offsetHeight : 1;
DOM.setStyles(poweredByElm, {
right: scrollbarWidth + 'px',
bottom: statusbarHeight + 'px'
});
DOM.setStyle(poweredByElm, 'right', scrollbarWidth + 'px');
if (hasStatusbar) {
DOM.setStyle(poweredByElm, 'top', '-16px');
} else {
DOM.setStyle(poweredByElm, 'bottom', '1px');
}
};
};
@ -303,13 +303,33 @@ define(
};
};
var setupReposition = function (editor, poweredByElm, hasStatusbar) {
reposition(editor, poweredByElm, hasStatusbar)();
editor.on('NodeChange ResizeEditor', reposition(editor, poweredByElm, hasStatusbar));
};
var appendToStatusbar = function (editor, poweredByElm, statusbarElm) {
statusbarElm.appendChild(poweredByElm);
setupReposition(editor, poweredByElm, true);
};
var appendToContainer = function (editor, poweredByElm) {
editor.getContainer().appendChild(poweredByElm);
setupReposition(editor, poweredByElm, false);
};
var setupEventListeners = function (editor) {
editor.on('SkinLoaded', function () {
var poweredByElm = DOM.create('div', { 'class': 'mce-branding-powered-by' });
editor.getContainer().appendChild(poweredByElm);
var statusbarElm = editor.getContainer().querySelector('.mce-statusbar');
if (statusbarElm) {
appendToStatusbar(editor, poweredByElm, statusbarElm);
} else {
appendToContainer(editor, poweredByElm);
}
DOM.bind(poweredByElm, 'click', hide(poweredByElm));
reposition(editor, poweredByElm)();
editor.on('NodeChange ResizeEditor', reposition(editor, poweredByElm));
});
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-beta2-40827';
$wp_version = '4.8-beta2-40834';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
@ -18,7 +18,7 @@ $wp_db_version = 38590;
*
* @global string $tinymce_version
*/
$tinymce_version = '4601-20170510';
$tinymce_version = '4602-20170524';
/**
* Holds the required PHP version