-
Bug
-
Resolution: Fixed
-
Major
-
2.6.5
-
None
-
FF3
Pasting a word document into Firefox 3 doesn't work
Update HtmlArea.js with :
HTMLArea.prototype._wordClean = function() {
var editor = this;
function clearClass(node) {
var newc = node.className.replace(/(^|\s)mso.*?(\s|$)/ig, ' ');
if (newc != node.className) {
node.className = newc;
if (!/\S/.test(node.className))
}
};
function clearPrefixAttributes(node) {
var toremove = new Array();
for (var i = 0; i < node.attributes.length; i++)
{
var index = node.attributes[i].nodeName.indexOf(":");
if (index != -1)
}
for (var i=0; i < toremove.length; i++)
}
function clearStyle(node)
;
function stripTag(el)
{
while (el.childNodes.length > 0)
{
var tmp = el.childNodes[0];
if (!HTMLArea.is_ie)
el.parentNode.insertBefore(tmp, el);
if (tmp.nodeType == 1 && parseTree(tmp) != null)
checkEmpty(tmp);
}
el.parentNode.removeChild(el);
};
// vire certains tags vides
function checkEmpty(el) {
if (/^(a|b|strong|i)$/i.test(el.tagName) && !el.firstChild)
};
// vire les tags interdits (font et span)
function clearTag(el) {
if (/^span|font|pre$/i.test(el.tagName))
{
var ftmp = null;
while (el.firstChild)
{
var tmp = el.firstChild;
if (ftmp == null)
ftmp = tmp;
el.removeChild(tmp);
if (!HTMLArea.is_ie)
el.parentNode.insertBefore(tmp, el);
if (tmp.nodeType == 1)
{
var pTmp = parseTree(tmp);
if (pTmp != null)
}
}
el.parentNode.removeChild(el);
return ftmp;
}
return el;
};
// recursivite globale
function parseTree(root) {
var tag = root.tagName.toLowerCase();
if ((HTMLArea.is_ie && root.scopeName != 'HTML') || (!HTMLArea.is_ie && /:/.test(tag)))
else {
var go = true;
while (go)
if (root.childNodes.length != 0)
{
var next;
for (var i = root.firstChild; i; i = next)
}
}
return root;
};
function trim(t)
{ while (t.length > 0 && /[\t\n\r ]/.test(t.charAt(0))) t = t.substring(1); while (t.length > 0 && /[\t\n\r ]/.test(t.charAt(t.length - 1))) t = t.substring(0, t.length - 2); return t } parseTree(this._pasteDoc.body);
this._pasteDoc.body.innerHTML = trim(this._pasteDoc.body.innerHTML);
// showStats();
// this.debugTree();
// this.setHTML(this.getHTML());
// this.setHTML(this.getInnerHTML());
// this.forceRedraw();
this.updateToolbar();
};