Bug #20277 » rtehtmlarea_bugfix_10844_typo3_4-1.patch
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-ie.js (copie de travail) | ||
---|---|---|
* Create a range for the current selection
|
||
*/
|
||
HTMLArea.prototype._createRange = function(sel) {
|
||
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) ||
|
||
... | ... | |
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 {
|
||
... | ... | |
* Split the text node, if needed.
|
||
*/
|
||
HTMLArea.prototype.insertNodeAtSelection = function(toBeInserted) {
|
||
var sel = this._getSelection();
|
||
var range = this._createRange(sel);
|
||
range.pasteHTML(toBeInserted.outerHTML);
|
||
this.insertHTML(toBeInserted.outerHTML);
|
||
};
|
||
/*
|
||
... | ... | |
* Delete the current selection, if any.
|
||
*/
|
||
HTMLArea.prototype.insertHTML = function(html) {
|
||
this.focusEditor();
|
||
var sel = this._getSelection();
|
||
if (sel.type.toLowerCase() == "control") {
|
||
sel.clear();
|