Fixes #40859 #40756.

git-svn-id: https://develop.svn.wordpress.org/trunk@40834 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2017-05-25 01:13:15 +00:00
parent 6d02212d57
commit f26acaeb99
7 changed files with 3270 additions and 2589 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

File diff suppressed because one or more lines are too long

View File

@ -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