Project

General

Profile

Bug #24091 » rtehtmlarea_bugfix_16431_trunk_follow_up.patch

Administrator Admin, 2010-11-19 05:23

View differences:

typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js (copie de travail)
HTMLArea.Editor.prototype.selectNode = function(node, endPoint) {
this.focus();
var selection = this._getSelection();
var range = this._doc.createRange();
if (node.nodeType == 1 && node.nodeName.toLowerCase() == "body") {
if (Ext.isWebKit) {
range.setStart(node, 0);
range.setEnd(node, node.childNodes.length);
} else {
range.selectNodeContents(node);
}
if (Ext.isWebKit && /^(img)$/i.test(node.nodeName)) {
this._getSelection().setBaseAndExtent(node, 0, node, 1);
} else {
if (node.nodeType == HTMLArea.DOM.ELEMENT_NODE && (Ext.isWebKit || Ext.isOpera)) {
range.setStart(node, 0);
range.setEnd(node, 0);
var range = this._doc.createRange();
if (node.nodeType == 1 && node.nodeName.toLowerCase() == "body") {
if (Ext.isWebKit) {
range.setStart(node, 0);
range.setEnd(node, node.childNodes.length);
} else {
range.selectNodeContents(node);
}
} else {
range.selectNode(node);
}
if (typeof(endPoint) != "undefined") {
range.collapse(endPoint);
}
this.emptySelection(selection);
this.addRangeToSelection(selection, range);
}
if (typeof(endPoint) != "undefined") {
range.collapse(endPoint);
}
this.emptySelection(selection);
this.addRangeToSelection(selection, range);
};
/*
* Select ONLY the contents inside the given node
(3-3/5)