Bug #21536 » rtehtmlarea_bugfix_12568_typo3_4-2.patch
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js (copie de travail) | ||
---|---|---|
this.insertNodeAtSelection(fragment);
|
||
};
|
||
/*
|
||
* Clean Apple wrapping span and font tags under the specified node
|
||
*
|
||
* @param object node: the node in the subtree of which cleaning is performed
|
||
*
|
||
* @return void
|
||
*/
|
||
HTMLArea.prototype.cleanAppleStyleSpans = function(node) {
|
||
if (HTMLArea.is_safari) {
|
||
if (node.getElementsByClassName) {
|
||
var spans = node.getElementsByClassName("Apple-style-span");
|
||
for (var i = spans.length; --i >= 0;) {
|
||
this.removeMarkup(spans[i]);
|
||
}
|
||
} else {
|
||
var spans = node.getElementsByTagName("span");
|
||
for (var i = spans.length; --i >= 0;) {
|
||
if (HTMLArea._hasClass(spans[i], "Apple-style-span")) {
|
||
this.removeMarkup(spans[i]);
|
||
}
|
||
}
|
||
var fonts = node.getElementsByTagName("font");
|
||
for (i = fonts.length; --i >= 0;) {
|
||
if (HTMLArea._hasClass(fonts[i], "Apple-style-span")) {
|
||
this.removeMarkup(fonts[i]);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
};
|
||
/***************************************************
|
||
* EVENTS HANDLERS
|
||
***************************************************/
|
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (copie de travail) | ||
---|---|---|
return oEl;
|
||
};
|
||
/*
|
||
* This function removes the given markup element
|
||
*
|
||
* @param object element: the inline element to be removed, content being preserved
|
||
*
|
||
* @return void
|
||
*/
|
||
HTMLArea.prototype.removeMarkup = function(element) {
|
||
var bookmark = this.getBookmark(this._createRange(this._getSelection()));
|
||
var parent = element.parentNode;
|
||
while (element.firstChild) {
|
||
parent.insertBefore(element.firstChild, element);
|
||
}
|
||
parent.removeChild(element);
|
||
this.selectRange(this.moveToBookmark(bookmark));
|
||
};
|
||
/***************************************************
|
||
* SELECTIONS AND RANGES
|
||
***************************************************/
|
||
... | ... | |
return false;
|
||
break;
|
||
case "Paste" :
|
||
if (HTMLArea.is_opera || (HTMLArea.is_gecko && navigator.productSub < 20080514)) {
|
||
if (HTMLArea.is_opera || (HTMLArea.is_gecko && navigator.productSub < 20080514) || HTMLArea.is_safari) {
|
||
if (editor._toolbarObjects.CleanWord) {
|
||
var cleanLaterFunctRef = editor.plugins.DefaultClean ? editor.plugins.DefaultClean.instance.cleanLaterFunctRef : (editor.plugins.TYPO3HtmlParser ? editor.plugins.TYPO3HtmlParser.instance.cleanLaterFunctRef : null);
|
||
if (cleanLaterFunctRef) {
|
typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultClean/default-clean.js (copie de travail) | ||
---|---|---|
}
|
||
}
|
||
parseTree(this.editor._doc.body);
|
||
if (HTMLArea.is_safari) {
|
||
this.editor.cleanAppleStyleSpans(this.editor._doc.body);
|
||
}
|
||
}
|
||
});
|
||
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js (copie de travail) | ||
---|---|---|
|
||
clean : function() {
|
||
var editor = this.editor;
|
||
if (HTMLArea.is_safari) {
|
||
editor.cleanAppleStyleSpans(editor._doc.body);
|
||
}
|
||
var bookmark = editor.getBookmark(editor._createRange(editor._getSelection()));
|
||
var content = {
|
||
editorNo : this.editorNumber,
|
- « Previous
- 1
- 2
- Next »