Project

General

Profile

Bug #18798 » rtehtmlarea_bugfix_8431.patch

Administrator Admin, 2008-05-16 05:10

View differences:

typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js (working copy)
*
* (c) 2002-2004, interactivetools.com, inc.
* (c) 2003-2004 dynarch.com
* (c) 2004-2007 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
* (c) 2004-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......
};
/*
* Determine whether the node intersects the range
*/
HTMLArea.prototype.rangeIntersectsNode = function(range, node) {
var nodeRange = this._doc.createRange();
try {
nodeRange.selectNode(node);
} catch (e) {
nodeRange.selectNodeContents(node);
}
// Note: sometimes Safari inverts the end points
return (range.compareBoundaryPoints(range.END_TO_START, nodeRange) == -1 && range.compareBoundaryPoints(range.START_TO_END, nodeRange) == 1) ||
(range.compareBoundaryPoints(range.END_TO_START, nodeRange) == 1 && range.compareBoundaryPoints(range.START_TO_END, nodeRange) == -1);
};
/*
* Retrieve the HTML contents of selected block
*/
HTMLArea.prototype.getSelectedHTML = function() {
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-ie.js (working copy)
*
* (c) 2002-2004, interactivetools.com, inc.
* (c) 2003-2004 dynarch.com
* (c) 2004, 2005, 2006 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
* (c) 2004-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......
};
/*
* Determine whether the node intersects the range
*/
HTMLArea.prototype.rangeIntersectsNode = function(range, node) {
var nodeRange = this._doc.body.createTextRange();
nodeRange.moveToElementText(node);
return (range.compareEndPoints("EndToStart", nodeRange) == -1 && range.compareEndPoints("StartToEnd", nodeRange) == 1) ||
(range.compareEndPoints("EndToStart", nodeRange) == 1 && range.compareEndPoints("StartToEnd", nodeRange) == -1);
};
/*
* Retrieve the HTML contents of selected block
*/
HTMLArea.prototype.getSelectedHTML = function() {
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3Browsers/typo3browsers.js (working copy)
/***************************************************************
* Copyright notice
*
* (c) 2005, 2006 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>
* (c) 2005-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......
if (node.tagName && node.tagName.toLowerCase() == "a") {
var nodeInRange = false;
if (HTMLArea.is_gecko) {
if(!HTMLArea.is_safari && !HTMLArea.is_opera) nodeInRange = range.intersectsNode(node);
else nodeInRange = true;
nodeInRange = this.rangeIntersectsNode(range, node);
} else {
if (this._getSelection().type.toLowerCase() == "control") {
// we assume an image is selected
......
if (node.tagName && node.tagName.toLowerCase() == "a") {
var intersection = false;
if (HTMLArea.is_gecko) {
if (!HTMLArea.is_safari && !HTMLArea.is_opera) intersection = range.intersectsNode(node);
else intersection = true;
intersection = this.rangeIntersectsNode(range, node);
} else {
if (this._getSelection().type.toLowerCase() == "control") {
// we assume an image is selected
(1-1/4)