Project

General

Profile

Bug #20277 » rtehtmlarea_bugfix_10844_trunk.patch

Administrator Admin, 2009-04-04 01:32

View differences:

typo3/sysext/rtehtmlarea/htmlarea/htmlarea-ie.js (copie de travail)
* Create a range for the current selection
*/
HTMLArea.prototype._createRange = function(sel) {
if (typeof(sel) != "undefined") return sel.createRange();
this.focusEditor();
if (typeof(sel) != "undefined") {
return sel.createRange();
}
return this._doc.selection.createRange();
};
......
* Determine whether the node intersects the range
*/
HTMLArea.prototype.rangeIntersectsNode = function(range, node) {
this.focusEditor();
var nodeRange = this._doc.body.createTextRange();
nodeRange.moveToElementText(node);
return (range.compareEndPoints("EndToStart", nodeRange) == -1 && range.compareEndPoints("StartToEnd", nodeRange) == 1) ||
......
* Get the deepest node that contains both endpoints of the current selection.
*/
HTMLArea.prototype.getParentElement = function(selection, range) {
if (!selection) var selection = this._getSelection();
if (!selection) {
var selection = this._getSelection();
}
if (typeof(range) === "undefined") {
var range = this._createRange(selection);
}
......
HTMLArea.prototype._activeElement = function(sel) {
if(sel == null) return null;
if(this._selectionEmpty(sel)) return null;
this.focusEditor();
if(sel.type.toLowerCase() == "control") {
return sel.createRange().item(0);
} else {
......
* Delete the current selection, if any.
*/
HTMLArea.prototype.insertHTML = function(html) {
this.focusEditor();
var sel = this._getSelection();
if (sel.type.toLowerCase() == "control") {
sel.clear();
(1-1/4)