Index: typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js (révision 6401) +++ typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js (copie de travail) @@ -479,6 +479,37 @@ this.selectNodeContents(element, false); }; +/* + * 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 ***************************************************/ Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/CopyPaste/copy-paste.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/plugins/CopyPaste/copy-paste.js (révision 6401) +++ typo3/sysext/rtehtmlarea/htmlarea/plugins/CopyPaste/copy-paste.js (copie de travail) @@ -125,8 +125,7 @@ this.applyBrowserCommand(buttonId); } // In FF3, the paste operation will indeed trigger the onPaste event not in FF2; nor in Opera - // Safari does not support the paste operation - if (HTMLArea.is_opera || (HTMLArea.is_gecko && navigator.productSub < 20080514)) { + if (HTMLArea.is_opera || (HTMLArea.is_gecko && navigator.productSub < 20080514) || HTMLArea.is_safari) { var cleanLaterFunctRef = this.getPluginInstance("DefaultClean") ? this.getPluginInstance("DefaultClean").cleanLaterFunctRef : (this.getPluginInstance("TYPO3HtmlParser") ? this.getPluginInstance("TYPO3HtmlParser").cleanLaterFunctRef : null); if (cleanLaterFunctRef) { window.setTimeout(cleanLaterFunctRef, 50); Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultClean/default-clean.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultClean/default-clean.js (révision 6401) +++ typo3/sysext/rtehtmlarea/htmlarea/plugins/DefaultClean/default-clean.js (copie de travail) @@ -164,6 +164,9 @@ } } parseTree(this.editor._doc.body); + if (HTMLArea.is_safari) { + this.editor.cleanAppleStyleSpans(this.editor._doc.body); + } } }); Index: typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js =================================================================== --- typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js (révision 6401) +++ typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js (copie de travail) @@ -94,6 +94,9 @@ 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,