Archived
Updates
This commit is contained in:
1 parent
70d2335bba
commit
7428b67da5
1086 files changed
+94145
-59082
No files matched your search
@@ -207,16 +207,30 @@ tinymce.PluginManager.add('lists', function(editor) {
|
||||
}
|
||||
|
||||
function splitList(ul, li, newBlock) {
|
||||
var tmpRng, fragment;
|
||||
var tmpRng, fragment, bookmarks, node;
|
||||
|
||||
var bookmarks = dom.select('span[data-mce-type="bookmark"]', ul);
|
||||
function removeAndKeepBookmarks(targetNode) {
|
||||
tinymce.each(bookmarks, function(node) {
|
||||
targetNode.parentNode.insertBefore(node, li.parentNode);
|
||||
});
|
||||
|
||||
dom.remove(targetNode);
|
||||
}
|
||||
|
||||
bookmarks = dom.select('span[data-mce-type="bookmark"]', ul);
|
||||
newBlock = newBlock || createNewTextBlock(li);
|
||||
tmpRng = dom.createRng();
|
||||
tmpRng.setStartAfter(li);
|
||||
tmpRng.setEndAfter(ul);
|
||||
fragment = tmpRng.extractContents();
|
||||
|
||||
for (node = fragment.firstChild; node; node = node.firstChild) {
|
||||
if (node.nodeName == 'LI' && dom.isEmpty(node)) {
|
||||
dom.remove(node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!dom.isEmpty(fragment)) {
|
||||
dom.insertAfter(fragment, ul);
|
||||
}
|
||||
@@ -224,14 +238,14 @@ tinymce.PluginManager.add('lists', function(editor) {
|
||||
dom.insertAfter(newBlock, ul);
|
||||
|
||||
if (dom.isEmpty(li.parentNode)) {
|
||||
tinymce.each(bookmarks, function(node) {
|
||||
li.parentNode.parentNode.insertBefore(node, li.parentNode);
|
||||
});
|
||||
|
||||
dom.remove(li.parentNode);
|
||||
removeAndKeepBookmarks(li.parentNode);
|
||||
}
|
||||
|
||||
dom.remove(li);
|
||||
|
||||
if (dom.isEmpty(ul)) {
|
||||
dom.remove(ul);
|
||||
}
|
||||
}
|
||||
|
||||
function mergeWithAdjacentLists(listBlock) {
|
||||
@@ -709,14 +723,22 @@ tinymce.PluginManager.add('lists', function(editor) {
|
||||
}
|
||||
};
|
||||
|
||||
editor.addCommand('Indent', function() {
|
||||
if (!indentSelection()) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
editor.on('BeforeExecCommand', function(e) {
|
||||
var cmd = e.command.toLowerCase(), isHandled;
|
||||
|
||||
editor.addCommand('Outdent', function() {
|
||||
if (!outdentSelection()) {
|
||||
if (cmd == "indent") {
|
||||
if (indentSelection()) {
|
||||
isHandled = true;
|
||||
}
|
||||
} else if (cmd == "outdent") {
|
||||
if (outdentSelection()) {
|
||||
isHandled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isHandled) {
|
||||
editor.fire('ExecCommand', {command: e.command});
|
||||
e.preventDefault();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@@ -738,7 +760,12 @@ tinymce.PluginManager.add('lists', function(editor) {
|
||||
editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState('DL'));
|
||||
|
||||
editor.on('keydown', function(e) {
|
||||
if (e.keyCode == 9 && editor.dom.getParent(editor.selection.getStart(), 'LI,DT,DD')) {
|
||||
// Check for tab but not ctrl/cmd+tab since it switches browser tabs
|
||||
if (e.keyCode != 9 || tinymce.util.VK.metaKeyPressed(e)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (editor.dom.getParent(editor.selection.getStart(), 'LI,DT,DD')) {
|
||||
e.preventDefault();
|
||||
|
||||
if (e.shiftKey) {
|
||||
|
||||
Reference in new issue
Block a user