1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
8
* Licensed under the terms of any of the following licenses at your
11
* - GNU General Public License Version 2 or later (the "GPL")
12
* http://www.gnu.org/licenses/gpl.html
14
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
* http://www.gnu.org/licenses/lgpl.html
17
* - Mozilla Public License Version 1.1 or later (the "MPL")
18
* http://www.mozilla.org/MPL/MPL-1.1.html
22
* This dialog is shown when, for some reason (usually security settings),
23
* the user is not able to paste data from the clipboard to the editor using
24
* the toolbar buttons or the context menu.
26
<html xmlns="http://www.w3.org/1999/xhtml">
29
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
<meta name="robots" content="noindex, nofollow" />
32
<script type="text/javascript">
33
var oEditor = window.parent.InnerDialogLoaded() ;
34
var FCK = oEditor.FCK;
35
var FCKTools = oEditor.FCKTools ;
36
var FCKConfig = oEditor.FCKConfig ;
38
window.onload = function ()
40
// First of all, translate the dialog box texts
41
oEditor.FCKLanguageManager.TranslatePage(document) ;
43
var sPastingType = window.parent.dialogArguments.CustomValue ;
45
if ( sPastingType == 'Word' || sPastingType == 'Security' )
47
if ( sPastingType == 'Security' )
48
document.getElementById( 'xSecurityMsg' ).style.display = '' ;
50
var oFrame = document.getElementById('frmData') ;
51
oFrame.style.display = '' ;
53
// Avoid errors if the pasted content has any script that fails: #389
54
var oDoc = oFrame.contentWindow.document ;
56
oDoc.write('<html><head><script>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>') ;
59
if ( oFrame.contentDocument )
60
oFrame.contentDocument.designMode = 'on' ;
62
oFrame.contentWindow.document.body.contentEditable = true ;
64
// Set the focus on the pasting area
65
oFrame.contentWindow.focus();
69
document.getElementById('txtData').style.display = '' ;
72
if ( sPastingType != 'Word' )
73
document.getElementById('oWordCommands').style.display = 'none' ;
75
window.parent.SetOkButton( true ) ;
76
window.parent.SetAutoSize( true ) ;
81
// Before doing anything, save undo snapshot.
82
oEditor.FCKUndo.SaveUndoStep() ;
86
var sPastingType = window.parent.dialogArguments.CustomValue ;
88
if ( sPastingType == 'Word' || sPastingType == 'Security' )
90
var oFrame = document.getElementById('frmData') ;
93
if ( oFrame.contentDocument )
94
oBody = oFrame.contentDocument.body ;
96
oBody = oFrame.contentWindow.document.body ;
98
if ( sPastingType == 'Word' )
100
// If a plugin creates a FCK.CustomCleanWord function it will be called instead of the default one
101
if ( typeof( FCK.CustomCleanWord ) == 'function' )
102
sHtml = FCK.CustomCleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
104
sHtml = CleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
107
sHtml = oBody.innerHTML ;
109
// Fix relative anchor URLs (IE automatically adds the current page URL).
110
var re = new RegExp( window.location + "#", "g" ) ;
111
sHtml = sHtml.replace( re, '#') ;
115
sHtml = oEditor.FCKTools.HTMLEncode( document.getElementById('txtData').value ) ;
116
sHtml = FCKTools.ProcessLineBreaks( oEditor, FCKConfig, sHtml ) ;
118
// FCK.InsertHtml() does not work for us, since document fragments cannot contain node fragments. :(
119
// Use the marker method instead. It's primitive, but it works.
120
var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
121
var oDoc = oEditor.FCK.EditorDocument ;
122
range.MoveToSelection() ;
123
range.DeleteContents() ;
125
for ( var i = 0 ; i < 5 ; i++ )
126
marker.push( parseInt(Math.random() * 100000, 10 ) ) ;
127
marker = marker.join( "" ) ;
128
range.InsertNode ( oDoc.createTextNode( marker ) ) ;
129
var bookmark = range.CreateBookmark() ;
131
// Now we've got a marker indicating the paste position in the editor document.
132
// Find its position in the HTML code.
133
var htmlString = oDoc.body.innerHTML ;
134
var index = htmlString.indexOf( marker ) ;
136
// Split it the HTML code up, add the code we generated, and put them back together.
138
htmlList.push( htmlString.substr( 0, index ) ) ;
139
htmlList.push( sHtml ) ;
140
htmlList.push( htmlString.substr( index + marker.length ) ) ;
141
htmlString = htmlList.join( "" ) ;
143
if ( oEditor.FCKBrowserInfo.IsIE )
144
oEditor.FCK.SetInnerHtml( htmlString ) ;
146
oDoc.body.innerHTML = htmlString ;
148
range.MoveToBookmark( bookmark ) ;
149
range.Collapse( false ) ;
155
oEditor.FCK.InsertHtml( sHtml ) ;
160
function CleanUpBox()
162
var oFrame = document.getElementById('frmData') ;
164
if ( oFrame.contentDocument )
165
oFrame.contentDocument.body.innerHTML = '' ;
167
oFrame.contentWindow.document.body.innerHTML = '' ;
171
// This function will be called from the PasteFromWord dialog (fck_paste.html)
172
// Input: oNode a DOM node that contains the raw paste from the clipboard
173
// bIgnoreFont, bRemoveStyles booleans according to the values set in the dialog
174
// Output: the cleaned string
175
function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
177
var html = oNode.innerHTML ;
179
html = html.replace(/<o:p>\s*<\/o:p>/g, '') ;
180
html = html.replace(/<o:p>.*?<\/o:p>/g, ' ') ;
182
// Remove mso-xxx styles.
183
html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
185
// Remove margin styles.
186
html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, '' ) ;
187
html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
189
html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, '' ) ;
190
html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
192
html = html.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;
194
html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\"" ) ;
196
html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ;
198
html = html.replace( /\s*tab-stops:[^;"]*;?/gi, '' ) ;
199
html = html.replace( /\s*tab-stops:[^"]*/gi, '' ) ;
201
// Remove FONT face attributes.
204
html = html.replace( /\s*face="[^"]*"/gi, '' ) ;
205
html = html.replace( /\s*face=[^ >]*/gi, '' ) ;
207
html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, '' ) ;
210
// Remove Class attributes
211
html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
215
html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
217
// Remove empty styles.
218
html = html.replace( /\s*style="\s*"/gi, '' ) ;
220
html = html.replace( /<SPAN\s*[^>]*>\s* \s*<\/SPAN>/gi, ' ' ) ;
222
html = html.replace( /<SPAN\s*[^>]*><\/SPAN>/gi, '' ) ;
224
// Remove Lang attributes
225
html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
227
html = html.replace( /<SPAN\s*>(.*?)<\/SPAN>/gi, '$1' ) ;
229
html = html.replace( /<FONT\s*>(.*?)<\/FONT>/gi, '$1' ) ;
231
// Remove XML elements and declarations
232
html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ;
234
// Remove Tags with XML namespace declarations: <o:p><\/o:p>
235
html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ;
237
// Remove comments [SF BUG-1481861].
238
html = html.replace(/<\!--.*?-->/g, '' ) ;
240
html = html.replace( /<(U|I|STRIKE)> <\/\1>/g, ' ' ) ;
242
html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
244
// Remove "display:none" tags.
245
html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none(.*?)<\/\1>/ig, '' ) ;
247
// Remove language tags
248
html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ;
250
// Remove onmouseover and onmouseout events (from MS Word comments effect)
251
html = html.replace( /<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi, "<$1$3") ;
252
html = html.replace( /<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi, "<$1$3") ;
254
if ( FCKConfig.CleanWordKeepsStructure )
256
// The original <Hn> tag send from Word is something like this: <Hn style="margin-top:0px;margin-bottom:0px">
257
html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ;
259
// Word likes to insert extra <font> tags, when using MSIE. (Wierd).
260
html = html.replace( /<(H\d)><FONT[^>]*>(.*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' );
261
html = html.replace( /<(H\d)><EM>(.*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );
265
html = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size="6">' ) ;
266
html = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size="5">' ) ;
267
html = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size="4">' ) ;
268
html = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size="3">' ) ;
269
html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ;
270
html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ;
272
html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ;
274
// Transform <P> to <DIV>
275
var re = new RegExp( '(<P)([^>]*>.*?)(<\/P>)', 'gi' ) ; // Different because of a IE 5.0 error
276
html = html.replace( re, '<div$2<\/div>' ) ;
278
// Remove empty tags (three times, just to be sure).
279
// This also removes any empty anchor
280
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
281
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
282
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
291
<body style="overflow: hidden">
292
<table cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 98%">
295
<div id="xSecurityMsg" style="display: none">
296
<span fcklang="DlgPasteSec">Because of your browser security settings,
297
the editor is not able to access your clipboard data directly. You are required
298
to paste it again in this window.</span><br />
302
<span fcklang="DlgPasteMsg2">Please paste inside the following box using the keyboard
303
(<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.</span><br />
309
<td valign="top" height="100%" style="border-right: #000000 1px solid; border-top: #000000 1px solid;
310
border-left: #000000 1px solid; border-bottom: #000000 1px solid">
311
<textarea id="txtData" cols="80" rows="5" style="border: #000000 1px; display: none;
312
width: 99%; height: 98%"></textarea>
313
<iframe id="frmData" src="javascript:void(0)" height="98%" width="99%" frameborder="0"
314
style="border-right: #000000 1px; border-top: #000000 1px; display: none; border-left: #000000 1px;
315
border-bottom: #000000 1px; background-color: #ffffff"></iframe>
318
<tr id="oWordCommands">
320
<table border="0" cellpadding="0" cellspacing="0" width="100%">
323
<input id="chkRemoveFont" type="checkbox" checked="checked" />
324
<label for="chkRemoveFont" fcklang="DlgPasteIgnoreFont">
325
Ignore Font Face definitions</label>
327
<input id="chkRemoveStyles" type="checkbox" />
328
<label for="chkRemoveStyles" fcklang="DlgPasteRemoveStyles">
329
Remove Styles definitions</label>
331
<td align="right" valign="top">
332
<input type="button" fcklang="DlgPasteCleanBox" value="Clean Up Box" onclick="CleanUpBox()" />
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
8
* Licensed under the terms of any of the following licenses at your
11
* - GNU General Public License Version 2 or later (the "GPL")
12
* http://www.gnu.org/licenses/gpl.html
14
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
* http://www.gnu.org/licenses/lgpl.html
17
* - Mozilla Public License Version 1.1 or later (the "MPL")
18
* http://www.mozilla.org/MPL/MPL-1.1.html
22
* This dialog is shown when, for some reason (usually security settings),
23
* the user is not able to paste data from the clipboard to the editor using
24
* the toolbar buttons or the context menu.
26
<html xmlns="http://www.w3.org/1999/xhtml">
29
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
<meta name="robots" content="noindex, nofollow" />
32
<script type="text/javascript">
33
var oEditor = window.parent.InnerDialogLoaded() ;
34
var FCK = oEditor.FCK;
35
var FCKTools = oEditor.FCKTools ;
36
var FCKConfig = oEditor.FCKConfig ;
38
window.onload = function ()
40
// First of all, translate the dialog box texts
41
oEditor.FCKLanguageManager.TranslatePage(document) ;
43
var sPastingType = window.parent.dialogArguments.CustomValue ;
45
if ( sPastingType == 'Word' || sPastingType == 'Security' )
47
if ( sPastingType == 'Security' )
48
document.getElementById( 'xSecurityMsg' ).style.display = '' ;
50
var oFrame = document.getElementById('frmData') ;
51
oFrame.style.display = '' ;
53
// Avoid errors if the pasted content has any script that fails: #389
54
var oDoc = oFrame.contentWindow.document ;
56
oDoc.write('<html><head><script>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>') ;
59
if ( oFrame.contentDocument )
60
oFrame.contentDocument.designMode = 'on' ;
62
oFrame.contentWindow.document.body.contentEditable = true ;
64
// Set the focus on the pasting area
65
oFrame.contentWindow.focus();
69
document.getElementById('txtData').style.display = '' ;
72
if ( sPastingType != 'Word' )
73
document.getElementById('oWordCommands').style.display = 'none' ;
75
window.parent.SetOkButton( true ) ;
76
window.parent.SetAutoSize( true ) ;
81
// Before doing anything, save undo snapshot.
82
oEditor.FCKUndo.SaveUndoStep() ;
86
var sPastingType = window.parent.dialogArguments.CustomValue ;
88
if ( sPastingType == 'Word' || sPastingType == 'Security' )
90
var oFrame = document.getElementById('frmData') ;
93
if ( oFrame.contentDocument )
94
oBody = oFrame.contentDocument.body ;
96
oBody = oFrame.contentWindow.document.body ;
98
if ( sPastingType == 'Word' )
100
// If a plugin creates a FCK.CustomCleanWord function it will be called instead of the default one
101
if ( typeof( FCK.CustomCleanWord ) == 'function' )
102
sHtml = FCK.CustomCleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
104
sHtml = CleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
107
sHtml = oBody.innerHTML ;
109
// Fix relative anchor URLs (IE automatically adds the current page URL).
110
var re = new RegExp( window.location + "#", "g" ) ;
111
sHtml = sHtml.replace( re, '#') ;
115
sHtml = oEditor.FCKTools.HTMLEncode( document.getElementById('txtData').value ) ;
116
sHtml = FCKTools.ProcessLineBreaks( oEditor, FCKConfig, sHtml ) ;
118
// FCK.InsertHtml() does not work for us, since document fragments cannot contain node fragments. :(
119
// Use the marker method instead. It's primitive, but it works.
120
var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
121
var oDoc = oEditor.FCK.EditorDocument ;
122
range.MoveToSelection() ;
123
range.DeleteContents() ;
125
for ( var i = 0 ; i < 5 ; i++ )
126
marker.push( parseInt(Math.random() * 100000, 10 ) ) ;
127
marker = marker.join( "" ) ;
128
range.InsertNode ( oDoc.createTextNode( marker ) ) ;
129
var bookmark = range.CreateBookmark() ;
131
// Now we've got a marker indicating the paste position in the editor document.
132
// Find its position in the HTML code.
133
var htmlString = oDoc.body.innerHTML ;
134
var index = htmlString.indexOf( marker ) ;
136
// Split it the HTML code up, add the code we generated, and put them back together.
138
htmlList.push( htmlString.substr( 0, index ) ) ;
139
htmlList.push( sHtml ) ;
140
htmlList.push( htmlString.substr( index + marker.length ) ) ;
141
htmlString = htmlList.join( "" ) ;
143
if ( oEditor.FCKBrowserInfo.IsIE )
144
oEditor.FCK.SetInnerHtml( htmlString ) ;
146
oDoc.body.innerHTML = htmlString ;
148
range.MoveToBookmark( bookmark ) ;
149
range.Collapse( false ) ;
155
oEditor.FCK.InsertHtml( sHtml ) ;
160
function CleanUpBox()
162
var oFrame = document.getElementById('frmData') ;
164
if ( oFrame.contentDocument )
165
oFrame.contentDocument.body.innerHTML = '' ;
167
oFrame.contentWindow.document.body.innerHTML = '' ;
171
// This function will be called from the PasteFromWord dialog (fck_paste.html)
172
// Input: oNode a DOM node that contains the raw paste from the clipboard
173
// bIgnoreFont, bRemoveStyles booleans according to the values set in the dialog
174
// Output: the cleaned string
175
function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
177
var html = oNode.innerHTML ;
179
html = html.replace(/<o:p>\s*<\/o:p>/g, '') ;
180
html = html.replace(/<o:p>.*?<\/o:p>/g, ' ') ;
182
// Remove mso-xxx styles.
183
html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
185
// Remove margin styles.
186
html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, '' ) ;
187
html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
189
html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, '' ) ;
190
html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
192
html = html.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;
194
html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\"" ) ;
196
html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ;
198
html = html.replace( /\s*tab-stops:[^;"]*;?/gi, '' ) ;
199
html = html.replace( /\s*tab-stops:[^"]*/gi, '' ) ;
201
// Remove FONT face attributes.
204
html = html.replace( /\s*face="[^"]*"/gi, '' ) ;
205
html = html.replace( /\s*face=[^ >]*/gi, '' ) ;
207
html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, '' ) ;
210
// Remove Class attributes
211
html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
215
html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
217
// Remove empty styles.
218
html = html.replace( /\s*style="\s*"/gi, '' ) ;
220
html = html.replace( /<SPAN\s*[^>]*>\s* \s*<\/SPAN>/gi, ' ' ) ;
222
html = html.replace( /<SPAN\s*[^>]*><\/SPAN>/gi, '' ) ;
224
// Remove Lang attributes
225
html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
227
html = html.replace( /<SPAN\s*>(.*?)<\/SPAN>/gi, '$1' ) ;
229
html = html.replace( /<FONT\s*>(.*?)<\/FONT>/gi, '$1' ) ;
231
// Remove XML elements and declarations
232
html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ;
234
// Remove Tags with XML namespace declarations: <o:p><\/o:p>
235
html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ;
237
// Remove comments [SF BUG-1481861].
238
html = html.replace(/<\!--.*?-->/g, '' ) ;
240
html = html.replace( /<(U|I|STRIKE)> <\/\1>/g, ' ' ) ;
242
html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
244
// Remove "display:none" tags.
245
html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none(.*?)<\/\1>/ig, '' ) ;
247
// Remove language tags
248
html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ;
250
// Remove onmouseover and onmouseout events (from MS Word comments effect)
251
html = html.replace( /<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi, "<$1$3") ;
252
html = html.replace( /<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi, "<$1$3") ;
254
if ( FCKConfig.CleanWordKeepsStructure )
256
// The original <Hn> tag send from Word is something like this: <Hn style="margin-top:0px;margin-bottom:0px">
257
html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ;
259
// Word likes to insert extra <font> tags, when using MSIE. (Wierd).
260
html = html.replace( /<(H\d)><FONT[^>]*>(.*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' );
261
html = html.replace( /<(H\d)><EM>(.*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );
265
html = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size="6">' ) ;
266
html = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size="5">' ) ;
267
html = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size="4">' ) ;
268
html = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size="3">' ) ;
269
html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ;
270
html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ;
272
html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ;
274
// Transform <P> to <DIV>
275
var re = new RegExp( '(<P)([^>]*>.*?)(<\/P>)', 'gi' ) ; // Different because of a IE 5.0 error
276
html = html.replace( re, '<div$2<\/div>' ) ;
278
// Remove empty tags (three times, just to be sure).
279
// This also removes any empty anchor
280
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
281
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
282
html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
291
<body style="overflow: hidden">
292
<table cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 98%">
295
<div id="xSecurityMsg" style="display: none">
296
<span fcklang="DlgPasteSec">Because of your browser security settings,
297
the editor is not able to access your clipboard data directly. You are required
298
to paste it again in this window.</span><br />
302
<span fcklang="DlgPasteMsg2">Please paste inside the following box using the keyboard
303
(<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.</span><br />
309
<td valign="top" height="100%" style="border-right: #000000 1px solid; border-top: #000000 1px solid;
310
border-left: #000000 1px solid; border-bottom: #000000 1px solid">
311
<textarea id="txtData" cols="80" rows="5" style="border: #000000 1px; display: none;
312
width: 99%; height: 98%"></textarea>
313
<iframe id="frmData" src="javascript:void(0)" height="98%" width="99%" frameborder="0"
314
style="border-right: #000000 1px; border-top: #000000 1px; display: none; border-left: #000000 1px;
315
border-bottom: #000000 1px; background-color: #ffffff"></iframe>
318
<tr id="oWordCommands">
320
<table border="0" cellpadding="0" cellspacing="0" width="100%">
323
<input id="chkRemoveFont" type="checkbox" checked="checked" />
324
<label for="chkRemoveFont" fcklang="DlgPasteIgnoreFont">
325
Ignore Font Face definitions</label>
327
<input id="chkRemoveStyles" type="checkbox" />
328
<label for="chkRemoveStyles" fcklang="DlgPasteRemoveStyles">
329
Remove Styles definitions</label>
331
<td align="right" valign="top">
332
<input type="button" fcklang="DlgPasteCleanBox" value="Clean Up Box" onclick="CleanUpBox()" />