Bug #18448 ยป rtehtmlarea_bugfix_7862.patch
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js (working copy) | ||
---|---|---|
left.removeChild(block);
|
||
range.setEndAfter(left);
|
||
range.collapse(false);
|
||
p = this.convertNode(p, /^li$/i.test(left.parentNode.nodeName) ? "br" : "p");
|
||
p = this.convertNode(p, /^(li|dd|td|th)$/i.test(left.parentNode.nodeName) ? "br" : "p");
|
||
}
|
||
range.insertNode(df);
|
||
// Remove any anchor created empty
|
||
... | ... | |
var a = p.previousSibling.lastChild;
|
||
if (a && /^a$/i.test(a.nodeName) && !/\S/.test(a.innerHTML)) HTMLArea.removeFromParent(a);
|
||
}
|
||
if (/^br$/i.test(p.nodeName)) {
|
||
p = p.parentNode.insertBefore(this._doc.createTextNode("\x20"), p);
|
||
}
|
||
this.selectNodeContents(p, true);
|
||
} else {
|
||
if (/^(li|dt|dd)$/i.test(block.nodeName)) {
|
typo3/sysext/rtehtmlarea/htmlarea/plugins/BlockElements/block-elements.js (working copy) | ||
---|---|---|
break;
|
||
case "InsertOrderedList":
|
||
case "InsertUnorderedList":
|
||
try {
|
||
this.editor._doc.execCommand(buttonId, false, null);
|
||
} catch(e) {
|
||
this.appendToLog("onButtonPress", e + "\n\nby execCommand(" + buttonId + ");");
|
||
}
|
||
if (HTMLArea.is_safari) {
|
||
this.cleanAppleSpanTags(parentElement);
|
||
}
|
||
this.insertList(buttonId, parentElement);
|
||
break;
|
||
case "none" :
|
||
if (this.isAllowedBlockElement(parentElement.nodeName)) {
|
||
... | ... | |
this.editor.selectRange(range);
|
||
},
|
||
|
||
insertList : function (buttonId, parentElement) {
|
||
if (/^(dd)$/i.test(parentElement.nodeName)) {
|
||
var list = parentElement.appendChild(this.editor._doc.createElement((buttonId === "OrderedList") ? "ol" : "ul"));
|
||
var first = list.appendChild(this.editor._doc.createElement("li"));
|
||
first.innerHTML = "<br />";
|
||
this.editor.selectNodeContents(first,true);
|
||
} else {
|
||
try {
|
||
this.editor._doc.execCommand(buttonId, false, null);
|
||
} catch(e) {
|
||
this.appendToLog("onButtonPress", e + "\n\nby execCommand(" + buttonId + ");");
|
||
}
|
||
if (HTMLArea.is_safari) {
|
||
this.cleanAppleSpanTags(parentElement);
|
||
}
|
||
}
|
||
},
|
||
|
||
/*
|
||
* Indent selected list elements
|
||
*/
|
||
... | ... | |
this.editor.selectNodeContents(item, true);
|
||
return false;
|
||
}
|
||
} else if (/^(li)$/i.test(parentElement.nodeName)
|
||
&& !parentElement.innerText
|
||
&& parentElement.parentNode.parentNode
|
||
&& /^(dd|td|th)$/i.test(parentElement.parentNode.parentNode.nodeName)) {
|
||
var item = parentElement.parentNode.parentNode.insertBefore(this.editor._doc.createTextNode("\x20"), parentElement.parentNode.nextSibling);
|
||
this.editor.selectNodeContents(parentElement.parentNode.parentNode, false);
|
||
parentElement.parentNode.removeChild(parentElement);
|
||
return false;
|
||
}
|
||
}
|
||
}
|