Project

General

Profile

Bug #16507 ยป rtehtmlarea_bugfix_4121.patch

Administrator Admin, 2008-03-01 03:40

View differences:

typo3/sysext/rtehtmlarea/extensions/TYPO3HtmlParser/class.tx_rtehtmlarea_typo3htmlparser.php (working copy)
);
public function main($parentObject) {
return parent::main($parentObject) && $this->thisConfig['enableWordClean'] && is_array($this->thisConfig['enableWordClean.']);
return parent::main($parentObject) && $this->thisConfig['enableWordClean'] && is_array($this->thisConfig['enableWordClean.']['HTMLparser.']);
}
/**
typo3/sysext/rtehtmlarea/htmlarea/htmlarea-gecko.js (working copy)
*/
HTMLArea.prototype.getBookmarkNode = function(bookmark, endPoint) {
if (endPoint) {
return bookmark.startNode || this._doc.getElementById(bookmark.startId);
return this._doc.getElementById(bookmark.startId);
} else {
return bookmark.endNode || this._doc.getElementById(bookmark.endId);
return this._doc.getElementById(bookmark.endId);
}
};
......
// Mozilla lauches an exception, but can paste anyway on ctrl-V
// UI is false on keyboard shortcut, and undefined on button click
if(typeof(UI) != "undefined") {
this._doc.execCommand(cmdID, UI, param);
if (cmdID == "Paste" && this.config.killWordOnPaste) HTMLArea._wordClean(this._doc.body);
try { this._doc.execCommand(cmdID, UI, param); } catch(e) { }
if (cmdID == "Paste" && this._toolbarObjects.CleanWord) {
this._toolbarObjects.CleanWord.cmd(this, "CleanWord");
}
} else if (this.config.enableMozillaExtension) {
if (confirm(HTMLArea.I18N.msg["Allow-Clipboard-Helper-Extension"])) {
if (InstallTrigger.enabled()) {
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (working copy)
case "Paste" :
try {
this._doc.execCommand(cmdID, false, null);
if (cmdID == "Paste" && this._toolbarObjects.CleanWord) {
// In FF3, the paste operation will indeed trigger the paste event
if (HTMLArea.is_gecko && cmdID == "Paste" && this._toolbarObjects.CleanWord && navigator.productSub < 2008020514) {
this._toolbarObjects.CleanWord.cmd(this, "CleanWord");
}
} catch (e) {
......
editor.execCommand(cmd, false, null);
HTMLArea._stopEvent(ev);
return false;
} else 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) {
window.setTimeout(cleanLaterFunctRef, 50);
// In FF3, the paste operation will indeed trigger the paste event
} else if (HTMLArea.is_opera || (HTMLArea.is_gecko && navigator.productSub < 2008020514)) {
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) {
window.setTimeout(cleanLaterFunctRef, 50);
}
}
}
break;
......
HTMLArea.prototype.setHTML = function(html) {
switch (this._editMode) {
case "wysiwyg":
if(!this.config.fullPage) this._doc.body.innerHTML = html;
else this._doc.body.innerHTML = html;
this._doc.body.innerHTML = html;
break;
case "textmode": this._textArea.value = html; break;
case "textmode":
this._textArea.value = html;
break;
}
return false;
};
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js (working copy)
// Could be a button or its hotkey
var buttonId = this.translateHotKey(id);
buttonId = buttonId ? buttonId : id;
this.clean(this.editor._doc.body);
var bookmark = this.editor.getBookmark(this.editor._createRange(this.editor._getSelection()));
this.clean(this.editor._doc.body, bookmark);
return false;
},
......
HTMLArea._addEvents((HTMLArea.is_ie ? doc.body : doc), ["paste","dragdrop","drop"], cleanFunctRef, true);
},
clean : function(body) {
clean : function(body, bookmark) {
var editor = this.editor;
var content = {
editorNo : this.editorNumber,
content : body.innerHTML
};
this.postData(this.parseHtmlModulePath, content, function(response) { editor.setHTML(response); });
return true;
this.postData( this.parseHtmlModulePath,
content,
function(response) {
editor.setHTML(response);
editor.selectRange(editor.moveToBookmark(bookmark));
}
);
},
cleanLater : function () {
this.clean(this.editor._doc.body);
if (this.doUpdateToolbar) {
this.editor.updateToolbar();
}
this.doUpdateToolbar = false;
var bookmark = this.editor.getBookmark(this.editor._createRange(this.editor._getSelection()));
this.clean(this.editor._doc.body, bookmark);
},
/*
......
if (typeof(HTMLArea.Dialog) != "undefined" && HTMLArea.Dialog.TYPO3Image) {
HTMLArea.Dialog.TYPO3Image.close();
} else {
this.doUpdateToolbar = false;
window.setTimeout(this.cleanLaterFunctRef, 250);
}
}
    (1-1/1)