Bug #24661 » rtehtmlarea_bugfix_17140_typo3_4-4.patch
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js (copie de travail) | ||
---|---|---|
* Create a range for the current selection
|
||
*/
|
||
HTMLArea.Editor.prototype._createRange = function(sel) {
|
||
if (Ext.isWebKit) {
|
||
if (Ext.isEmpty(sel)) {
|
||
return this._doc.createRange();
|
||
}
|
||
// Older versions of WebKit did not support getRangeAt
|
||
if (Ext.isWebKit && !sel.getRangeAt) {
|
||
var range = this._doc.createRange();
|
||
if (typeof(sel) == "undefined") {
|
||
return range;
|
||
... | ... | |
return range;
|
||
}
|
||
}
|
||
if (Ext.isEmpty(sel)) {
|
||
return this._doc.createRange();
|
||
}
|
||
try {
|
||
return sel.getRangeAt(0);
|
||
} catch(e) {
|
||
... | ... | |
var selection = this._getSelection();
|
||
}
|
||
var ranges = [];
|
||
for (var i = selection.rangeCount; --i >= 0;) {
|
||
ranges.push(selection.getRangeAt(i));
|
||
// Older versions of WebKit did not support getRangeAt
|
||
if (selection.getRangeAt) {
|
||
for (var i = selection.rangeCount; --i >= 0;) {
|
||
ranges.push(selection.getRangeAt(i));
|
||
}
|
||
}
|
||
return ranges;
|
||
};
|
||
... | ... | |
if (!selection) {
|
||
var selection = this._getSelection();
|
||
}
|
||
this.emptySelection(selection);
|
||
for (var i = ranges.length; --i >= 0;) {
|
||
this.addRangeToSelection(selection, ranges[i]);
|
||
if (selection.getRangeAt) {
|
||
this.emptySelection(selection);
|
||
for (var i = ranges.length; --i >= 0;) {
|
||
this.addRangeToSelection(selection, ranges[i]);
|
||
}
|
||
}
|
||
};
|
||
/*
|