Project

General

Profile

Bug #21024 » rtehtmlarea_bugfix_11915_typo3_4-2.patch

Administrator Admin, 2009-09-15 01:34

View differences:

typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js (copie de travail)
case "Paste" :
try {
this._doc.execCommand(cmdID, false, null);
// In FF3, the paste operation will indeed trigger the paste event
if (HTMLArea.is_gecko && cmdID == "Paste" && this._toolbarObjects.CleanWord && navigator.productSub < 2008020514) {
// In FF3, the paste operation will trigger the paste event
if (cmdID == "Paste" && this._toolbarObjects.CleanWord && (HTMLArea.is_opera || (HTMLArea.is_gecko && navigator.productSub < 20080514))) {
this._toolbarObjects.CleanWord.cmd(this, "CleanWord");
}
} catch (e) {
......
return false;
break;
case "Paste" :
if (HTMLArea.is_opera || (HTMLArea.is_gecko && navigator.productSub < 2008020514)) {
if (HTMLArea.is_opera || (HTMLArea.is_gecko && navigator.productSub < 20080514)) {
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) {
......
return null;
};
/** Use XML HTTPRequest to post some data back to the server and do something
* with the response (asyncronously!), this is used by such things as the spellchecker update personal dict function
/*
* Use XML HTTPRequest to post some data back to the server and do something
* with the response (asyncronously or syncronously); this is used by such things as the spellchecker update personal dict function
*/
HTMLArea._postback = function(url, data, handler, addParams, charset) {
HTMLArea._postback = function(url, data, handler, addParams, charset, asynchronous) {
if (typeof(charset) == "undefined") var charset = "utf-8";
if (typeof(asynchronous) == "undefined") {
var asynchronous = true;
}
var req = null;
if (window.XMLHttpRequest) req = new XMLHttpRequest();
else if (window.ActiveXObject) {
......
}
function callBack() {
if(req.readyState == 4) {
if (req.readyState == 4) {
if (req.status == 200) {
if (typeof(handler) == 'function') handler(req.responseText, req);
if (typeof(handler) == "function") handler(req.responseText, req);
HTMLArea._appendToLog("[HTMLArea::_postback]: Server response: " + req.responseText);
} else {
HTMLArea._appendToLog("ERROR [HTMLArea::_postback]: Unable to post " + postUrl + " . Server reported " + req.statusText);
}
}
}
req.onreadystatechange = callBack;
if (asynchronous) {
req.onreadystatechange = callBack;
}
function sendRequest() {
HTMLArea._appendToLog("[HTMLArea::_postback]: Request: " + content);
req.send(content);
}
req.open('POST', postUrl, true);
req.open('POST', postUrl, asynchronous);
req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
window.setTimeout(sendRequest, 500);
if (!asynchronous) {
sendRequest();
if (req.status == 200) {
if (typeof(handler) == "function") {
handler(req.responseText, req);
}
HTMLArea._appendToLog("[HTMLArea::_postback]: Server response: " + req.responseText);
} else {
HTMLArea._appendToLog("ERROR [HTMLArea::_postback]: Unable to post " + postUrl + " . Server reported " + req.statusText);
}
} else {
window.setTimeout(sendRequest, 500);
}
}
};
......
* @param string url: url to post data to
* @param object data: data to be posted
* @param function handler: function that will handle the response returned by the server
* @param boolean asynchronous: flag indicating if the request should processed asynchronously or not
*
* @return boolean true on success
*/
postData : function (url, data, handler) {
HTMLArea._postback(url, data, handler, this.editorConfiguration.RTEtsConfigParams, (this.editorConfiguration.typo3ContentCharset ? this.editorConfiguration.typo3ContentCharset : "utf-8"));
postData : function (url, data, handler, asynchronous) {
if (typeof(asynchronous) == "undefined") {
var asynchronous = true;
}
HTMLArea._postback(url, data, handler, this.editorConfiguration.RTEtsConfigParams, (this.editorConfiguration.typo3ContentCharset ? this.editorConfiguration.typo3ContentCharset : "utf-8"), asynchronous);
},
/**
typo3/sysext/rtehtmlarea/htmlarea/plugins/TYPO3HtmlParser/typo3html-parser.js (copie de travail)
/***************************************************************
* Copyright notice
*
* (c) 2005-2008 Stanislas Rolland <typo3(arobas)sjbr.ca>
* (c) 2005-2009 Stanislas Rolland <typo3(arobas)sjbr.ca>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
......
editorNo : this.editorNumber,
content : editor._doc.body.innerHTML
};
// Invoke server-based synchronous pasted content cleaning
this.postData( this.parseHtmlModulePath,
content,
function(response) {
editor.setHTML(response);
editor.selectRange(editor.moveToBookmark(bookmark));
}
},
false
);
}
});
(2-2/2)