TinyMCE: update to 4.1.4-20140822. Changes:
- Fixed bug where sometimes the resize rectangles wouldn't properly render on images on WebKit/Blink.9a2d01cc14
- Fixed nodeChanged selection issue where the image selection wouldn't be removed if you clicked right after/before it.dd729c67e0
- Fixed bug in list plugin where delete/backspace would merge empty LI elements in lists incorrectly.caadfb05dd
See #29310 git-svn-id: https://develop.svn.wordpress.org/trunk@29576 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e6a5a8a36b
commit
c83a9ca2c9
@ -624,13 +624,24 @@ tinymce.PluginManager.add('lists', function(editor) {
|
||||
self.backspaceDelete = function(isForward) {
|
||||
function findNextCaretContainer(rng, isForward) {
|
||||
var node = rng.startContainer, offset = rng.startOffset;
|
||||
var nonEmptyBlocks, walker;
|
||||
|
||||
if (node.nodeType == 3 && (isForward ? offset < node.data.length : offset > 0)) {
|
||||
return node;
|
||||
}
|
||||
|
||||
var walker = new tinymce.dom.TreeWalker(rng.startContainer);
|
||||
nonEmptyBlocks = editor.schema.getNonEmptyElements();
|
||||
walker = new tinymce.dom.TreeWalker(rng.startContainer);
|
||||
|
||||
while ((node = walker[isForward ? 'next' : 'prev']())) {
|
||||
if (node.nodeName == 'LI' && !node.hasChildNodes()) {
|
||||
return node;
|
||||
}
|
||||
|
||||
if (nonEmptyBlocks[node.nodeName]) {
|
||||
return node;
|
||||
}
|
||||
|
||||
if (node.nodeType == 3 && node.data.length > 0) {
|
||||
return node;
|
||||
}
|
||||
@ -649,8 +660,14 @@ tinymce.PluginManager.add('lists', function(editor) {
|
||||
dom.remove(node);
|
||||
}
|
||||
|
||||
while ((node = fromElm.firstChild)) {
|
||||
toElm.appendChild(node);
|
||||
if (dom.isEmpty(toElm)) {
|
||||
dom.$(toElm).empty();
|
||||
}
|
||||
|
||||
if (!dom.isEmpty(fromElm)) {
|
||||
while ((node = fromElm.firstChild)) {
|
||||
toElm.appendChild(node);
|
||||
}
|
||||
}
|
||||
|
||||
if (listNode) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
// 4.1.4 (2014-08-21)
|
||||
// 4.1.4 (2014-08-22)
|
||||
|
||||
/**
|
||||
* Compiled inline version. (Library mode)
|
||||
@ -9540,7 +9540,11 @@ define("tinymce/NodeChange", [
|
||||
// Fire an extra nodeChange on mouseup for compatibility reasons
|
||||
editor.on('MouseUp', function(e) {
|
||||
if (!e.isDefaultPrevented()) {
|
||||
editor.nodeChanged();
|
||||
// Delay nodeChanged call for WebKit edge case issue where the range
|
||||
// isn't updated until after you click outside a selected image
|
||||
setTimeout(function() {
|
||||
editor.nodeChanged();
|
||||
}, 0);
|
||||
}
|
||||
});
|
||||
|
||||
@ -9555,7 +9559,7 @@ define("tinymce/NodeChange", [
|
||||
var selection = editor.selection, node, parents, root;
|
||||
|
||||
// Fix for bug #1896577 it seems that this can not be fired while the editor is loading
|
||||
if (editor.initialized && !editor.settings.disable_nodechange && !editor.settings.readonly) {
|
||||
if (editor.initialized && selection && !editor.settings.disable_nodechange && !editor.settings.readonly) {
|
||||
// Get start node
|
||||
root = editor.getBody();
|
||||
node = selection.getStart() || root;
|
||||
@ -26839,10 +26843,11 @@ define("tinymce/util/Quirks", [
|
||||
|
||||
// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
|
||||
// WebKit can't even do simple things like selecting an image
|
||||
// Needs tobe the setBaseAndExtend or it will fail to select floated images
|
||||
// Needs to be the setBaseAndExtend or it will fail to select floated images
|
||||
if (/^(IMG|HR)$/.test(target.nodeName)) {
|
||||
e.preventDefault();
|
||||
selection.getSel().setBaseAndExtent(target, 0, target, 1);
|
||||
editor.nodeChanged();
|
||||
}
|
||||
|
||||
if (target.nodeName == 'A' && dom.hasClass(target, 'mce-item-anchor')) {
|
||||
@ -30670,7 +30675,7 @@ define("tinymce/EditorManager", [
|
||||
* @property releaseDate
|
||||
* @type String
|
||||
*/
|
||||
releaseDate: '2014-08-21',
|
||||
releaseDate: '2014-08-22',
|
||||
|
||||
/**
|
||||
* Collection of editor instances.
|
||||
@ -37514,5 +37519,5 @@ define("tinymce/ui/Throbber", [
|
||||
};
|
||||
});
|
||||
|
||||
expose(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/util/Tools","tinymce/Env","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/dom/Range","tinymce/html/Entities","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/BookmarkManager","tinymce/dom/Selection","tinymce/dom/ElementUtils","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/util/EventDispatcher","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/KeyboardNavigation","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/EditorObservable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/ComboBox","tinymce/ui/ColorBox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/util/Color","tinymce/ui/ColorPicker","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeHandle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"]);
|
||||
expose(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/util/Tools","tinymce/Env","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/dom/Range","tinymce/html/Entities","tinymce/dom/StyleSheetLoader","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/dom/RangeUtils","tinymce/NodeChange","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/BookmarkManager","tinymce/dom/Selection","tinymce/dom/ElementUtils","tinymce/fmt/Preview","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/util/EventDispatcher","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/KeyboardNavigation","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/EditorObservable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/ComboBox","tinymce/ui/ColorBox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/util/Color","tinymce/ui/ColorPicker","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeHandle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"]);
|
||||
})(this);
|
10
src/wp-includes/js/tinymce/tinymce.min.js
vendored
10
src/wp-includes/js/tinymce/tinymce.min.js
vendored
File diff suppressed because one or more lines are too long
@ -18,7 +18,7 @@ $wp_db_version = 29188;
|
||||
*
|
||||
* @global string $tinymce_version
|
||||
*/
|
||||
$tinymce_version = '4104-20140821';
|
||||
$tinymce_version = '4104-20140822';
|
||||
|
||||
/**
|
||||
* Holds the required PHP version
|
||||
|
@ -71,7 +71,7 @@ test('Apply UL list to single P', function() {
|
||||
Utils.setSelection('p', 0);
|
||||
execCommand('InsertUnorderedList');
|
||||
|
||||
equal(editor.getContent(),'<ul><li>a</li></ul>');
|
||||
equal(editor.getContent(), '<ul><li>a</li></ul>');
|
||||
equal(editor.selection.getNode().nodeName, 'LI');
|
||||
});
|
||||
|
||||
@ -118,7 +118,7 @@ test('Apply OL list to single P', function() {
|
||||
Utils.setSelection('p', 0);
|
||||
execCommand('InsertOrderedList');
|
||||
|
||||
equal(editor.getContent(),'<ol><li>a</li></ol>');
|
||||
equal(editor.getContent(), '<ol><li>a</li></ol>');
|
||||
equal(editor.selection.getNode().nodeName, 'LI');
|
||||
});
|
||||
|
||||
@ -359,7 +359,7 @@ test('Apply UL list to single text line', function() {
|
||||
Utils.setSelection('body', 0);
|
||||
execCommand('InsertUnorderedList');
|
||||
|
||||
equal(editor.getContent(),'<ul><li>a</li></ul>');
|
||||
equal(editor.getContent(), '<ul><li>a</li></ul>');
|
||||
equal(editor.selection.getNode().nodeName, 'LI');
|
||||
});
|
||||
|
||||
@ -374,7 +374,7 @@ test('Apply UL list to single text line with BR', function() {
|
||||
Utils.setSelection('body', 0);
|
||||
execCommand('InsertUnorderedList');
|
||||
|
||||
equal(editor.getContent(),'<ul><li>a</li></ul>');
|
||||
equal(editor.getContent(), '<ul><li>a</li></ul>');
|
||||
equal(editor.selection.getNode().nodeName, 'LI');
|
||||
});
|
||||
|
||||
@ -1633,6 +1633,75 @@ test('Backspace at beginning of middle LI in UL inside UL', function() {
|
||||
equal(editor.selection.getNode().nodeName, 'LI');
|
||||
});
|
||||
|
||||
test('Backspace at beginning of LI with empty LI above in UL', function() {
|
||||
editor.getBody().innerHTML = trimBrs(
|
||||
'<ul>' +
|
||||
'<li>a</li>' +
|
||||
'<li></li>' +
|
||||
'<li>b</li>' +
|
||||
'</ul>'
|
||||
);
|
||||
|
||||
editor.focus();
|
||||
Utils.setSelection('li:nth-child(3)', 0);
|
||||
editor.plugins.lists.backspaceDelete();
|
||||
|
||||
equal(editor.getContent(),
|
||||
'<ul>' +
|
||||
'<li>a</li>' +
|
||||
'<li>b</li>' +
|
||||
'</ul>'
|
||||
);
|
||||
|
||||
equal(editor.selection.getNode().innerHTML, 'b');
|
||||
});
|
||||
|
||||
test('Backspace at beginning of LI with BR padded empty LI above in UL', function() {
|
||||
editor.getBody().innerHTML = (
|
||||
'<ul>' +
|
||||
'<li>a</li>' +
|
||||
'<li><br></li>' +
|
||||
'<li>b</li>' +
|
||||
'</ul>'
|
||||
);
|
||||
|
||||
editor.focus();
|
||||
Utils.setSelection('li:nth-child(3)', 0);
|
||||
editor.plugins.lists.backspaceDelete();
|
||||
|
||||
equal(editor.getContent(),
|
||||
'<ul>' +
|
||||
'<li>a</li>' +
|
||||
'<li>b</li>' +
|
||||
'</ul>'
|
||||
);
|
||||
|
||||
equal(editor.selection.getNode().innerHTML, 'b');
|
||||
});
|
||||
|
||||
test('Backspace at beginning of LI with empty LI with STRING and BR above in UL', function() {
|
||||
editor.getBody().innerHTML = (
|
||||
'<ul>' +
|
||||
'<li>a</li>' +
|
||||
'<li><strong><br></strong></li>' +
|
||||
'<li>b</li>' +
|
||||
'</ul>'
|
||||
);
|
||||
|
||||
editor.focus();
|
||||
Utils.setSelection('li:nth-child(3)', 0);
|
||||
editor.plugins.lists.backspaceDelete();
|
||||
|
||||
equal(editor.getContent(),
|
||||
'<ul>' +
|
||||
'<li>a</li>' +
|
||||
'<li>b</li>' +
|
||||
'</ul>'
|
||||
);
|
||||
|
||||
equal(editor.selection.getNode().innerHTML, 'b');
|
||||
});
|
||||
|
||||
// Delete
|
||||
|
||||
test('Delete at end of single LI in UL', function() {
|
||||
@ -1759,6 +1828,75 @@ test('Delete at end of middle LI in UL inside UL', function() {
|
||||
equal(editor.selection.getNode().nodeName, 'LI');
|
||||
});
|
||||
|
||||
test('Delete at end of LI before empty LI', function() {
|
||||
editor.getBody().innerHTML = (
|
||||
'<ul>' +
|
||||
'<li>a</li>' +
|
||||
'<li></li>' +
|
||||
'<li>b</li>' +
|
||||
'</ul>'
|
||||
);
|
||||
|
||||
editor.focus();
|
||||
Utils.setSelection('li', 1);
|
||||
editor.plugins.lists.backspaceDelete(true);
|
||||
|
||||
equal(editor.getContent(),
|
||||
'<ul>' +
|
||||
'<li>a</li>' +
|
||||
'<li>b</li>' +
|
||||
'</ul>'
|
||||
);
|
||||
|
||||
equal(editor.selection.getNode().innerHTML, 'a');
|
||||
});
|
||||
|
||||
test('Delete at end of LI before BR padded empty LI', function() {
|
||||
editor.getBody().innerHTML = (
|
||||
'<ul>' +
|
||||
'<li>a</li>' +
|
||||
'<li><br></li>' +
|
||||
'<li>b</li>' +
|
||||
'</ul>'
|
||||
);
|
||||
|
||||
editor.focus();
|
||||
Utils.setSelection('li', 1);
|
||||
editor.plugins.lists.backspaceDelete(true);
|
||||
|
||||
equal(editor.getContent(),
|
||||
'<ul>' +
|
||||
'<li>a</li>' +
|
||||
'<li>b</li>' +
|
||||
'</ul>'
|
||||
);
|
||||
|
||||
equal(editor.selection.getNode().innerHTML, 'a');
|
||||
});
|
||||
|
||||
test('Delete at end of LI before empty LI with STRONG', function() {
|
||||
editor.getBody().innerHTML = (
|
||||
'<ul>' +
|
||||
'<li>a</li>' +
|
||||
'<li><strong><br></strong></li>' +
|
||||
'<li>b</li>' +
|
||||
'</ul>'
|
||||
);
|
||||
|
||||
editor.focus();
|
||||
Utils.setSelection('li', 1);
|
||||
editor.plugins.lists.backspaceDelete(true);
|
||||
|
||||
equal(editor.getContent(),
|
||||
'<ul>' +
|
||||
'<li>a</li>' +
|
||||
'<li>b</li>' +
|
||||
'</ul>'
|
||||
);
|
||||
|
||||
equal(editor.selection.getNode().innerHTML, 'a');
|
||||
});
|
||||
|
||||
test('Remove UL in inline body element contained in LI', function() {
|
||||
inlineEditor.setContent('<ul><li>a</li></ul>');
|
||||
inlineEditor.selection.setCursorLocation();
|
||||
@ -1805,7 +1943,7 @@ test('Apply OL list to single P', function() {
|
||||
Utils.setSelection('p', 0);
|
||||
execCommand('InsertDefinitionList');
|
||||
|
||||
equal(editor.getContent(),'<dl><dt>a</dt></dl>');
|
||||
equal(editor.getContent(), '<dl><dt>a</dt></dl>');
|
||||
equal(editor.selection.getNode().nodeName, 'DT');
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user