Subversion Repositories Applications.papyrus

Rev

Rev 1925 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1925 Rev 2048
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
<!--
2
<!--
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
4
 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
5
 *
5
 *
6
 * == BEGIN LICENSE ==
6
 * == BEGIN LICENSE ==
7
 *
7
 *
8
 * Licensed under the terms of any of the following licenses at your
8
 * Licensed under the terms of any of the following licenses at your
9
 * choice:
9
 * choice:
10
 *
10
 *
11
 *  - GNU General Public License Version 2 or later (the "GPL")
11
 *  - GNU General Public License Version 2 or later (the "GPL")
12
 *    http://www.gnu.org/licenses/gpl.html
12
 *    http://www.gnu.org/licenses/gpl.html
13
 *
13
 *
14
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
14
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
 *    http://www.gnu.org/licenses/lgpl.html
15
 *    http://www.gnu.org/licenses/lgpl.html
16
 *
16
 *
17
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
17
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
18
 *    http://www.mozilla.org/MPL/MPL-1.1.html
18
 *    http://www.mozilla.org/MPL/MPL-1.1.html
19
 *
19
 *
20
 * == END LICENSE ==
20
 * == END LICENSE ==
21
 *
21
 *
22
 * This dialog is shown when, for some reason (usually security settings),
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
23
 * the user is not able to paste data from the clipboard to the editor using
24
 * the toolbar buttons or the context menu.
24
 * the toolbar buttons or the context menu.
25
-->
25
-->
26
<html xmlns="http://www.w3.org/1999/xhtml">
26
<html xmlns="http://www.w3.org/1999/xhtml">
27
<head>
27
<head>
28
	<title></title>
28
	<title></title>
29
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
29
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
	<meta name="robots" content="noindex, nofollow" />
30
	<meta name="robots" content="noindex, nofollow" />
31
	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
31
	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
32
	<script type="text/javascript">
32
	<script type="text/javascript">
33
var dialog = window.parent ;
33
var dialog = window.parent ;
34
var oEditor = dialog.InnerDialogLoaded() ;
34
var oEditor = dialog.InnerDialogLoaded() ;
35
var FCK = oEditor.FCK;
35
var FCK = oEditor.FCK;
36
var FCKTools	= oEditor.FCKTools ;
36
var FCKTools	= oEditor.FCKTools ;
37
var FCKConfig	= oEditor.FCKConfig ;
37
var FCKConfig	= oEditor.FCKConfig ;
38
var FCKBrowserInfo = oEditor.FCKBrowserInfo ;
38
var FCKBrowserInfo = oEditor.FCKBrowserInfo ;
39
 
39
 
40
window.onload = function ()
40
window.onload = function ()
41
{
41
{
42
	// First of all, translate the dialog box texts
42
	// First of all, translate the dialog box texts
43
	oEditor.FCKLanguageManager.TranslatePage(document) ;
43
	oEditor.FCKLanguageManager.TranslatePage(document) ;
44
 
44
 
45
	var sPastingType = dialog.Args().CustomValue ;
45
	var sPastingType = dialog.Args().CustomValue ;
46
 
46
 
47
	if ( sPastingType == 'Word' || sPastingType == 'Security' )
47
	if ( sPastingType == 'Word' || sPastingType == 'Security' )
48
	{
48
	{
49
		if ( sPastingType == 'Security' )
49
		if ( sPastingType == 'Security' )
50
			document.getElementById( 'xSecurityMsg' ).style.display = '' ;
50
			document.getElementById( 'xSecurityMsg' ).style.display = '' ;
51
 
51
 
52
		// For document.domain compatibility (#123) we must do all the magic in
52
		// For document.domain compatibility (#123) we must do all the magic in
53
		// the URL for IE.
53
		// the URL for IE.
54
		var sFrameUrl = !oEditor.FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE ?
54
		var sFrameUrl = !oEditor.FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE ?
55
			'javascript:void(0)' :
55
			'javascript:void(0)' :
56
			'javascript:void( (function(){' +
56
			'javascript:void( (function(){' +
57
				'document.open() ;' +
57
				'document.open() ;' +
58
				'document.domain=\'' + document.domain + '\' ;' +
58
				'document.domain=\'' + document.domain + '\' ;' +
59
				'document.write(\'<html><head><script>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>\') ;' +
59
				'document.write(\'<html><head><script>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>\') ;' +
60
				'document.close() ;' +
60
				'document.close() ;' +
61
				'document.body.contentEditable = true ;' +
61
				'document.body.contentEditable = true ;' +
62
				'window.focus() ;' +
62
				'window.focus() ;' +
63
				'})() )' ;
63
				'})() )' ;
64
 
64
 
65
		var eFrameSpace = document.getElementById( 'xFrameSpace' ) ;
65
		var eFrameSpace = document.getElementById( 'xFrameSpace' ) ;
66
		eFrameSpace.innerHTML = '<iframe id="frmData" src="' + sFrameUrl + '" ' +
66
		eFrameSpace.innerHTML = '<iframe id="frmData" src="' + sFrameUrl + '" ' +
67
					'height="98%" width="99%" frameborder="0" style="border: #000000 1px; background-color: #ffffff"><\/iframe>' ;
67
					'height="98%" width="99%" frameborder="0" style="border: #000000 1px; background-color: #ffffff"><\/iframe>' ;
68
 
68
 
69
		var oFrame = eFrameSpace.firstChild ;
69
		var oFrame = eFrameSpace.firstChild ;
70
 
70
 
71
		if ( !oEditor.FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE )
71
		if ( !oEditor.FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE )
72
		{
72
		{
73
			// Avoid errors if the pasted content has any script that fails: #389
73
			// Avoid errors if the pasted content has any script that fails: #389
74
			var oDoc = oFrame.contentWindow.document ;
74
			var oDoc = oFrame.contentWindow.document ;
75
			oDoc.open() ;
75
			oDoc.open() ;
76
			oDoc.write('<html><head><script>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>') ;
76
			oDoc.write('<html><head><script>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>') ;
77
			oDoc.close() ;
77
			oDoc.close() ;
78
 
78
 
79
			if ( FCKBrowserInfo.IsIE )
79
			if ( FCKBrowserInfo.IsIE )
80
				oDoc.body.contentEditable = true ;
80
				oDoc.body.contentEditable = true ;
81
			else
81
			else
82
				oDoc.designMode = 'on' ;
82
				oDoc.designMode = 'on' ;
83
 
83
 
84
			oFrame.contentWindow.focus();
84
			oFrame.contentWindow.focus();
85
		}
85
		}
86
	}
86
	}
87
	else
87
	else
88
	{
88
	{
89
		document.getElementById('txtData').style.display = '' ;
89
		document.getElementById('txtData').style.display = '' ;
-
 
90
		SelectField( 'txtData' ) ;
90
	}
91
	}
91
 
92
 
92
	if ( sPastingType != 'Word' )
93
	if ( sPastingType != 'Word' )
93
		document.getElementById('oWordCommands').style.display = 'none' ;
94
		document.getElementById('oWordCommands').style.display = 'none' ;
94
 
95
 
95
	dialog.SetOkButton( true ) ;
96
	dialog.SetOkButton( true ) ;
96
	dialog.SetAutoSize( true ) ;
97
	dialog.SetAutoSize( true ) ;
97
}
98
}
98
 
99
 
99
function Ok()
100
function Ok()
100
{
101
{
101
	// Before doing anything, save undo snapshot.
102
	// Before doing anything, save undo snapshot.
102
	oEditor.FCKUndo.SaveUndoStep() ;
103
	oEditor.FCKUndo.SaveUndoStep() ;
103
 
104
 
104
	var sHtml ;
105
	var sHtml ;
105
 
106
 
106
	var sPastingType = dialog.Args().CustomValue ;
107
	var sPastingType = dialog.Args().CustomValue ;
107
 
108
 
108
	if ( sPastingType == 'Word' || sPastingType == 'Security' )
109
	if ( sPastingType == 'Word' || sPastingType == 'Security' )
109
	{
110
	{
110
		var oFrame = document.getElementById('frmData') ;
111
		var oFrame = document.getElementById('frmData') ;
111
		var oBody ;
112
		var oBody ;
112
 
113
 
113
		if ( oFrame.contentDocument )
114
		if ( oFrame.contentDocument )
114
			oBody = oFrame.contentDocument.body ;
115
			oBody = oFrame.contentDocument.body ;
115
		else
116
		else
116
			oBody = oFrame.contentWindow.document.body ;
117
			oBody = oFrame.contentWindow.document.body ;
117
 
118
 
118
		if ( sPastingType == 'Word' )
119
		if ( sPastingType == 'Word' )
119
		{
120
		{
120
			// If a plugin creates a FCK.CustomCleanWord function it will be called instead of the default one
121
			// If a plugin creates a FCK.CustomCleanWord function it will be called instead of the default one
121
			if ( typeof( FCK.CustomCleanWord ) == 'function' )
122
			if ( typeof( FCK.CustomCleanWord ) == 'function' )
122
				sHtml = FCK.CustomCleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
123
				sHtml = FCK.CustomCleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
123
			else
124
			else
124
				sHtml = CleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
125
				sHtml = CleanWord( oBody, document.getElementById('chkRemoveFont').checked, document.getElementById('chkRemoveStyles').checked ) ;
125
		}
126
		}
126
		else
127
		else
127
			sHtml = oBody.innerHTML ;
128
			sHtml = oBody.innerHTML ;
128
 
129
 
129
		// Fix relative anchor URLs (IE automatically adds the current page URL).
130
		// Fix relative anchor URLs (IE automatically adds the current page URL).
130
		var re = new RegExp( window.location + "#", "g" ) ;
131
		var re = new RegExp( window.location + "#", "g" ) ;
131
		sHtml = sHtml.replace( re, '#') ;
132
		sHtml = sHtml.replace( re, '#') ;
132
	}
133
	}
133
	else
134
	else
134
	{
135
	{
135
		sHtml = oEditor.FCKTools.HTMLEncode( document.getElementById('txtData').value )  ;
136
		sHtml = oEditor.FCKTools.HTMLEncode( document.getElementById('txtData').value )  ;
136
		sHtml = FCKTools.ProcessLineBreaks( oEditor, FCKConfig, sHtml ) ;
137
		sHtml = FCKTools.ProcessLineBreaks( oEditor, FCKConfig, sHtml ) ;
137
 
138
 
138
		// FCK.InsertHtml() does not work for us, since document fragments cannot contain node fragments. :(
139
		// FCK.InsertHtml() does not work for us, since document fragments cannot contain node fragments. :(
139
		// Use the marker method instead. It's primitive, but it works.
140
		// Use the marker method instead. It's primitive, but it works.
140
		var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
141
		var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
141
		var oDoc = oEditor.FCK.EditorDocument ;
142
		var oDoc = oEditor.FCK.EditorDocument ;
142
		dialog.Selection.EnsureSelection() ;
143
		dialog.Selection.EnsureSelection() ;
143
		range.MoveToSelection() ;
144
		range.MoveToSelection() ;
144
		range.DeleteContents() ;
145
		range.DeleteContents() ;
145
		var marker = [] ;
146
		var marker = [] ;
146
		for ( var i = 0 ; i < 5 ; i++ )
147
		for ( var i = 0 ; i < 5 ; i++ )
147
			marker.push( parseInt(Math.random() * 100000, 10 ) ) ;
148
			marker.push( parseInt(Math.random() * 100000, 10 ) ) ;
148
		marker = marker.join( "" ) ;
149
		marker = marker.join( "" ) ;
149
		range.InsertNode ( oDoc.createTextNode( marker ) ) ;
150
		range.InsertNode ( oDoc.createTextNode( marker ) ) ;
150
		var bookmark = range.CreateBookmark() ;
151
		var bookmark = range.CreateBookmark() ;
151
 
152
 
152
		// Now we've got a marker indicating the paste position in the editor document.
153
		// Now we've got a marker indicating the paste position in the editor document.
153
		// Find its position in the HTML code.
154
		// Find its position in the HTML code.
154
		var htmlString = oDoc.body.innerHTML ;
155
		var htmlString = oDoc.body.innerHTML ;
155
		var index = htmlString.indexOf( marker ) ;
156
		var index = htmlString.indexOf( marker ) ;
156
 
157
 
157
		// Split it the HTML code up, add the code we generated, and put them back together.
158
		// Split it the HTML code up, add the code we generated, and put them back together.
158
		var htmlList = [] ;
159
		var htmlList = [] ;
159
		htmlList.push( htmlString.substr( 0, index ) ) ;
160
		htmlList.push( htmlString.substr( 0, index ) ) ;
160
		htmlList.push( sHtml ) ;
161
		htmlList.push( sHtml ) ;
161
		htmlList.push( htmlString.substr( index + marker.length ) ) ;
162
		htmlList.push( htmlString.substr( index + marker.length ) ) ;
162
		htmlString = htmlList.join( "" ) ;
163
		htmlString = htmlList.join( "" ) ;
163
 
164
 
164
		if ( oEditor.FCKBrowserInfo.IsIE )
165
		if ( oEditor.FCKBrowserInfo.IsIE )
165
			oEditor.FCK.SetInnerHtml( htmlString ) ;
166
			oEditor.FCK.SetInnerHtml( htmlString ) ;
166
		else
167
		else
167
			oDoc.body.innerHTML = htmlString ;
168
			oDoc.body.innerHTML = htmlString ;
168
 
169
 
169
		range.MoveToBookmark( bookmark ) ;
170
		range.MoveToBookmark( bookmark ) ;
170
		range.Collapse( false ) ;
171
		range.Collapse( false ) ;
171
		range.Select() ;
172
		range.Select() ;
172
		range.Release() ;
173
		range.Release() ;
173
		return true ;
174
		return true ;
174
	}
175
	}
175
 
176
 
176
	oEditor.FCK.InsertHtml( sHtml ) ;
177
	oEditor.FCK.InsertHtml( sHtml ) ;
177
 
178
 
178
	return true ;
179
	return true ;
179
}
180
}
180
 
181
 
181
// This function will be called from the PasteFromWord dialog (fck_paste.html)
182
// This function will be called from the PasteFromWord dialog (fck_paste.html)
182
// Input: oNode a DOM node that contains the raw paste from the clipboard
183
// Input: oNode a DOM node that contains the raw paste from the clipboard
183
// bIgnoreFont, bRemoveStyles booleans according to the values set in the dialog
184
// bIgnoreFont, bRemoveStyles booleans according to the values set in the dialog
184
// Output: the cleaned string
185
// Output: the cleaned string
185
function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
186
function CleanWord( oNode, bIgnoreFont, bRemoveStyles )
186
{
187
{
187
	var html = oNode.innerHTML ;
188
	var html = oNode.innerHTML ;
188
 
189
 
189
	html = html.replace(/<o:p>\s*<\/o:p>/g, '') ;
190
	html = html.replace(/<o:p>\s*<\/o:p>/g, '') ;
190
	html = html.replace(/<o:p>[\s\S]*?<\/o:p>/g, '&nbsp;') ;
191
	html = html.replace(/<o:p>[\s\S]*?<\/o:p>/g, '&nbsp;') ;
191
 
192
 
192
	// Remove mso-xxx styles.
193
	// Remove mso-xxx styles.
193
	html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
194
	html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
194
 
195
 
195
	// Remove margin styles.
196
	// Remove margin styles.
196
	html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, '' ) ;
197
	html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, '' ) ;
197
	html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
198
	html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
198
 
199
 
199
	html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, '' ) ;
200
	html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, '' ) ;
200
	html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
201
	html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
201
 
202
 
202
	html = html.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;
203
	html = html.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;
203
 
204
 
204
	html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\"" ) ;
205
	html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\"" ) ;
205
 
206
 
206
	html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ;
207
	html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ;
207
 
208
 
208
	html = html.replace( /\s*tab-stops:[^;"]*;?/gi, '' ) ;
209
	html = html.replace( /\s*tab-stops:[^;"]*;?/gi, '' ) ;
209
	html = html.replace( /\s*tab-stops:[^"]*/gi, '' ) ;
210
	html = html.replace( /\s*tab-stops:[^"]*/gi, '' ) ;
210
 
211
 
211
	// Remove FONT face attributes.
212
	// Remove FONT face attributes.
212
	if ( bIgnoreFont )
213
	if ( bIgnoreFont )
213
	{
214
	{
214
		html = html.replace( /\s*face="[^"]*"/gi, '' ) ;
215
		html = html.replace( /\s*face="[^"]*"/gi, '' ) ;
215
		html = html.replace( /\s*face=[^ >]*/gi, '' ) ;
216
		html = html.replace( /\s*face=[^ >]*/gi, '' ) ;
216
 
217
 
217
		html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, '' ) ;
218
		html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, '' ) ;
218
	}
219
	}
219
 
220
 
220
	// Remove Class attributes
221
	// Remove Class attributes
221
	html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
222
	html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
222
 
223
 
223
	// Remove styles.
224
	// Remove styles.
224
	if ( bRemoveStyles )
225
	if ( bRemoveStyles )
225
		html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
226
		html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
226
 
227
 
227
	// Remove style, meta and link tags
228
	// Remove style, meta and link tags
228
	html = html.replace( /<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi, '' ) ;
229
	html = html.replace( /<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi, '' ) ;
229
	html = html.replace( /<(?:META|LINK)[^>]*>\s*/gi, '' ) ;
230
	html = html.replace( /<(?:META|LINK)[^>]*>\s*/gi, '' ) ;
230
 
231
 
231
	// Remove empty styles.
232
	// Remove empty styles.
232
	html =  html.replace( /\s*style="\s*"/gi, '' ) ;
233
	html =  html.replace( /\s*style="\s*"/gi, '' ) ;
233
 
234
 
234
	html = html.replace( /<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi, '&nbsp;' ) ;
235
	html = html.replace( /<SPAN\s*[^>]*>\s*&nbsp;\s*<\/SPAN>/gi, '&nbsp;' ) ;
235
 
236
 
236
	html = html.replace( /<SPAN\s*[^>]*><\/SPAN>/gi, '' ) ;
237
	html = html.replace( /<SPAN\s*[^>]*><\/SPAN>/gi, '' ) ;
237
 
238
 
238
	// Remove Lang attributes
239
	// Remove Lang attributes
239
	html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
240
	html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
240
 
241
 
241
	html = html.replace( /<SPAN\s*>([\s\S]*?)<\/SPAN>/gi, '$1' ) ;
242
	html = html.replace( /<SPAN\s*>([\s\S]*?)<\/SPAN>/gi, '$1' ) ;
242
 
243
 
243
	html = html.replace( /<FONT\s*>([\s\S]*?)<\/FONT>/gi, '$1' ) ;
244
	html = html.replace( /<FONT\s*>([\s\S]*?)<\/FONT>/gi, '$1' ) ;
244
 
245
 
245
	// Remove XML elements and declarations
246
	// Remove XML elements and declarations
246
	html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ;
247
	html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ;
247
 
248
 
248
	// Remove w: tags with contents.
249
	// Remove w: tags with contents.
249
	html = html.replace( /<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi, '' ) ;
250
	html = html.replace( /<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi, '' ) ;
250
 
251
 
251
	// Remove Tags with XML namespace declarations: <o:p><\/o:p>
252
	// Remove Tags with XML namespace declarations: <o:p><\/o:p>
252
	html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ;
253
	html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ;
253
 
254
 
254
	// Remove comments [SF BUG-1481861].
255
	// Remove comments [SF BUG-1481861].
255
	html = html.replace(/<\!--[\s\S]*?-->/g, '' ) ;
256
	html = html.replace(/<\!--[\s\S]*?-->/g, '' ) ;
256
 
257
 
257
	html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
258
	html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
258
 
259
 
259
	html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
260
	html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
260
 
261
 
261
	// Remove "display:none" tags.
262
	// Remove "display:none" tags.
262
	html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none[\s\S]*?<\/\1>/ig, '' ) ;
263
	html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none[\s\S]*?<\/\1>/ig, '' ) ;
263
 
264
 
264
	// Remove language tags
265
	// Remove language tags
265
	html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ;
266
	html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ;
266
 
267
 
267
	// Remove onmouseover and onmouseout events (from MS Word comments effect)
268
	// Remove onmouseover and onmouseout events (from MS Word comments effect)
268
	html = html.replace( /<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi, "<$1$3") ;
269
	html = html.replace( /<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi, "<$1$3") ;
269
	html = html.replace( /<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi, "<$1$3") ;
270
	html = html.replace( /<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi, "<$1$3") ;
270
 
271
 
271
	if ( FCKConfig.CleanWordKeepsStructure )
272
	if ( FCKConfig.CleanWordKeepsStructure )
272
	{
273
	{
273
		// The original <Hn> tag send from Word is something like this: <Hn style="margin-top:0px;margin-bottom:0px">
274
		// The original <Hn> tag send from Word is something like this: <Hn style="margin-top:0px;margin-bottom:0px">
274
		html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ;
275
		html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ;
275
 
276
 
276
		// Word likes to insert extra <font> tags, when using MSIE. (Wierd).
277
		// Word likes to insert extra <font> tags, when using MSIE. (Wierd).
277
		html = html.replace( /<(H\d)><FONT[^>]*>([\s\S]*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' );
278
		html = html.replace( /<(H\d)><FONT[^>]*>([\s\S]*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' );
278
		html = html.replace( /<(H\d)><EM>([\s\S]*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );
279
		html = html.replace( /<(H\d)><EM>([\s\S]*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );
279
	}
280
	}
280
	else
281
	else
281
	{
282
	{
282
		html = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size="6">' ) ;
283
		html = html.replace( /<H1([^>]*)>/gi, '<div$1><b><font size="6">' ) ;
283
		html = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size="5">' ) ;
284
		html = html.replace( /<H2([^>]*)>/gi, '<div$1><b><font size="5">' ) ;
284
		html = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size="4">' ) ;
285
		html = html.replace( /<H3([^>]*)>/gi, '<div$1><b><font size="4">' ) ;
285
		html = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size="3">' ) ;
286
		html = html.replace( /<H4([^>]*)>/gi, '<div$1><b><font size="3">' ) ;
286
		html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ;
287
		html = html.replace( /<H5([^>]*)>/gi, '<div$1><b><font size="2">' ) ;
287
		html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ;
288
		html = html.replace( /<H6([^>]*)>/gi, '<div$1><b><font size="1">' ) ;
288
 
289
 
289
		html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ;
290
		html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ;
290
 
291
 
291
		// Transform <P> to <DIV>
292
		// Transform <P> to <DIV>
292
		var re = new RegExp( '(<P)([^>]*>[\\s\\S]*?)(<\/P>)', 'gi' ) ;	// Different because of a IE 5.0 error
293
		var re = new RegExp( '(<P)([^>]*>[\\s\\S]*?)(<\/P>)', 'gi' ) ;	// Different because of a IE 5.0 error
293
		html = html.replace( re, '<div$2<\/div>' ) ;
294
		html = html.replace( re, '<div$2<\/div>' ) ;
294
 
295
 
295
		// Remove empty tags (three times, just to be sure).
296
		// Remove empty tags (three times, just to be sure).
296
		// This also removes any empty anchor
297
		// This also removes any empty anchor
297
		html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
298
		html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
298
		html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
299
		html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
299
		html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
300
		html = html.replace( /<([^\s>]+)(\s[^>]*)?>\s*<\/\1>/g, '' ) ;
300
	}
301
	}
301
 
302
 
302
	return html ;
303
	return html ;
303
}
304
}
304
 
305
 
305
	</script>
306
	</script>
306
 
307
 
307
</head>
308
</head>
308
<body style="overflow: hidden">
309
<body style="overflow: hidden">
309
	<table cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 98%">
310
	<table cellspacing="0" cellpadding="0" width="100%" border="0" style="height: 98%">
310
		<tr>
311
		<tr>
311
			<td>
312
			<td>
312
				<div id="xSecurityMsg" style="display: none">
313
				<div id="xSecurityMsg" style="display: none">
313
					<span fcklang="DlgPasteSec">Because of your browser security settings,
314
					<span fcklang="DlgPasteSec">Because of your browser security settings,
314
						the editor is not able to access your clipboard data directly. You are required
315
						the editor is not able to access your clipboard data directly. You are required
315
						to paste it again in this window.</span><br />
316
						to paste it again in this window.</span><br />
316
					&nbsp;
317
					&nbsp;
317
				</div>
318
				</div>
318
				<div>
319
				<div>
319
					<span fcklang="DlgPasteMsg2">Please paste inside the following box using the keyboard
320
					<span fcklang="DlgPasteMsg2">Please paste inside the following box using the keyboard
320
						(<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.</span><br />
321
						(<strong>Ctrl+V</strong>) and hit <strong>OK</strong>.</span><br />
321
					&nbsp;
322
					&nbsp;
322
				</div>
323
				</div>
323
			</td>
324
			</td>
324
		</tr>
325
		</tr>
325
		<tr>
326
		<tr>
326
			<td id="xFrameSpace" valign="top" height="100%" style="border: #000000 1px solid">
327
			<td id="xFrameSpace" valign="top" height="100%" style="border: #000000 1px solid">
327
				<textarea id="txtData" cols="80" rows="5" style="border: #000000 1px; display: none;
328
				<textarea id="txtData" cols="80" rows="5" style="border: #000000 1px; display: none;
328
					width: 99%; height: 98%"></textarea>
329
					width: 99%; height: 98%"></textarea>
329
			</td>
330
			</td>
330
		</tr>
331
		</tr>
331
		<tr id="oWordCommands">
332
		<tr id="oWordCommands">
332
			<td>
333
			<td>
333
 
334
 
334
					<input id="chkRemoveFont" type="checkbox" checked="checked" />
335
					<input id="chkRemoveFont" type="checkbox" checked="checked" />
335
					<label for="chkRemoveFont" fcklang="DlgPasteIgnoreFont">
336
					<label for="chkRemoveFont" fcklang="DlgPasteIgnoreFont">
336
						Ignore Font Face definitions</label>
337
						Ignore Font Face definitions</label>
337
					<br />
338
					<br />
338
					<input id="chkRemoveStyles" type="checkbox" />
339
					<input id="chkRemoveStyles" type="checkbox" />
339
					<label for="chkRemoveStyles" fcklang="DlgPasteRemoveStyles">
340
					<label for="chkRemoveStyles" fcklang="DlgPasteRemoveStyles">
340
						Remove Styles definitions</label>
341
						Remove Styles definitions</label>
341
 
342
 
342
			</td>
343
			</td>
343
		</tr>
344
		</tr>
344
	</table>
345
	</table>
345
</body>
346
</body>
346
</html>
347
</html>