+2008-02-29 Stanislas Rolland <typo3@sjbr.ca>
+
+ * Fixed bug #4121: Pasting content on RTE moves cursor to the top of the text
+
2008-02-29 Michael Stucki <michael@typo3.org>
* Fixed bug #7545: Explain queries does not work when selecting multiple tables (patch by Ingo Schmitt)
2008-02-28 Stanislas Rolland <stanislas.rolland@fructifor.ca>
* Fixed bug #7684: htmlArea RTE: Cursor positioning when creating new table
- * Partially fixed bug #7614: htmlArea RTE: Poor tag handling everywhere in Opera
+ * Partially fixed bug #6714: htmlArea RTE: Poor tag handling everywhere in Opera
2008-02-28 Ingmar Schlecht <ingmar@typo3.org>
+2008-02-29 Stanislas Rolland <typo3@sjbr.ca>
+
+ * Fixed bug #4121: Pasting content on RTE moves cursor to the top of the text
+
2008-02-28 Stanislas Rolland <stanislas.rolland@fructifor.ca>
* Fixed bug #7684: htmlArea RTE: Cursor positioning when creating new table
- * Partially fixed bug #7614: htmlArea RTE: Poor tag handling everywhere in Opera
+ * Partially fixed bug #6714: htmlArea RTE: Poor tag handling everywhere in Opera
2008-02-27 Stanislas Rolland <stanislas.rolland@fructifor.ca>
);
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.']);
}
/**
*/
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()) {
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;
};
// 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);
}
}