[Checkins] SVN: zope.html/trunk/src/zope/html/fckeditor/editor/dialog/fck_paste.html make the "paste from word" page valid ZPT

Benji York benji at zope.com
Wed Oct 18 16:29:06 EDT 2006


Log message for revision 70791:
  make the "paste from word" page valid ZPT
  

Changed:
  U   zope.html/trunk/src/zope/html/fckeditor/editor/dialog/fck_paste.html

-=-
Modified: zope.html/trunk/src/zope/html/fckeditor/editor/dialog/fck_paste.html
===================================================================
--- zope.html/trunk/src/zope/html/fckeditor/editor/dialog/fck_paste.html	2006-10-18 17:24:30 UTC (rev 70790)
+++ zope.html/trunk/src/zope/html/fckeditor/editor/dialog/fck_paste.html	2006-10-18 20:29:05 UTC (rev 70791)
@@ -23,45 +23,45 @@
 	<head>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 		<meta name="robots" content="noindex, nofollow">
-		<script language="javascript">
-var oEditor = window.parent.InnerDialogLoaded() ;
+			<script language="javascript">
+	var oEditor = window.parent.InnerDialogLoaded() ;
 
-window.onload = function ()
-{
-	// First of all, translate the dialog box texts
-	oEditor.FCKLanguageManager.TranslatePage(document) ;
-	
-	window.parent.SetOkButton( true ) ;	
-
-	if ( window.parent.dialogArguments.CustomValue == 'Word' )
+	window.onload = function ()
 	{
-		var oFrame = document.getElementById('frmData')
-		oFrame.style.display = '' ;
+		// First of all, translate the dialog box texts
+		oEditor.FCKLanguageManager.TranslatePage(document) ;
 		
-		if ( oFrame.contentDocument ) 
-			oFrame.contentDocument.designMode = 'on' ;
+		window.parent.SetOkButton( true ) ;	
+
+		if ( window.parent.dialogArguments.CustomValue == 'Word' )
+		{
+			var oFrame = document.getElementById('frmData')
+			oFrame.style.display = '' ;
+			
+			if ( oFrame.contentDocument ) 
+				oFrame.contentDocument.designMode = 'on' ;
+			else
+				oFrame.contentWindow.document.body.contentEditable = true ;
+		}
 		else
-			oFrame.contentWindow.document.body.contentEditable = true ;
+		{
+			document.getElementById('txtData').style.display = '' ;
+			document.getElementById('oWordCommands').style.display = 'none' ;
+		}
 	}
-	else
-	{
-		document.getElementById('txtData').style.display = '' ;
-		document.getElementById('oWordCommands').style.display = 'none' ;
-	}
-}
 
-function Ok()
-{
-	var sHtml ;
-	
-	if ( window.parent.dialogArguments.CustomValue == 'Word' )
+	function Ok()
 	{
-		var oFrame = document.getElementById('frmData') ;
+		var sHtml ;
 		
-		if ( oFrame.contentDocument ) 
-			sHtml = oFrame.contentDocument.body.innerHTML ;
-		else
-			sHtml = oFrame.contentWindow.document.body.innerHTML ;
+		if ( window.parent.dialogArguments.CustomValue == 'Word' )
+		{
+			var oFrame = document.getElementById('frmData') ;
+			
+			if ( oFrame.contentDocument ) 
+				sHtml = oFrame.contentDocument.body.innerHTML ;
+			else
+				sHtml = oFrame.contentWindow.document.body.innerHTML ;
 
 		sHtml = CleanWord( sHtml ) ;
 	}
@@ -146,7 +146,7 @@
 	// Remove XML elements and declarations
 	html = html.replace(/<\\?\?xml[^>]*>/gi, "") ;
 	
-	// Remove Tags with XML namespace declarations: <o:p></o:p>
+	// Remove Tags with XML namespace declarations
 	html = html.replace(/<\/?\w+:[^>]*>/gi, "") ;
 	
 	html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
@@ -158,7 +158,7 @@
 	html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ;
 	html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ;
 
-	html = html.replace( /<\/H\d>/gi, '</font></b></div>' ) ;
+	html = html.replace( /<\/H\d>/gi, '<'+'/font><'+'/b><'+'/div>' ) ;
 	
 	html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
 
@@ -169,7 +169,7 @@
 
 	// Transform <P> to <DIV>
 	var re = new RegExp("(<P)([^>]*>.*?)(<\/P>)","gi") ;	// Different because of a IE 5.0 error
-	html = html.replace( re, "<div$2</div>" ) ;
+	html = html.replace( re, "<div$2<"+"/div>" ) ;
 
 	return html ;
 }



More information about the Checkins mailing list