X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=inline;f=_source%2Fplugins%2Fpastefromword%2Fdialogs%2Fpastefromword.js;fp=_source%2Fplugins%2Fpastefromword%2Fdialogs%2Fpastefromword.js;h=a10f2979eb0432625be1d80c393506c986754fd4;hb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;hp=0000000000000000000000000000000000000000;hpb=b93873b6532ee7515fb0d6f8b73176c44fad28f7;p=ckeditor.git
diff --git a/_source/plugins/pastefromword/dialogs/pastefromword.js b/_source/plugins/pastefromword/dialogs/pastefromword.js
new file mode 100644
index 0000000..a10f297
--- /dev/null
+++ b/_source/plugins/pastefromword/dialogs/pastefromword.js
@@ -0,0 +1,307 @@
+/*
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+CKEDITOR.dialog.add( 'pastefromword', function( editor )
+{
+ return {
+ title : editor.lang.pastefromword.title,
+ minWidth : CKEDITOR.env.ie && CKEDITOR.env.quirks ? 370 : 350,
+ minHeight : CKEDITOR.env.ie && CKEDITOR.env.quirks ? 270 : 260,
+ htmlToLoad : '
',
+ cleanWord : function( editor, html, ignoreFont, removeStyles )
+ {
+ // Remove comments [SF BUG-1481861].
+ html = html.replace(/<\!--[\s\S]*?-->/g, '' ) ;
+
+ html = html.replace(/\s*<\/o:p>/g, '') ;
+ html = html.replace(/[\s\S]*?<\/o:p>/g, ' ') ;
+
+ // Remove mso-xxx styles.
+ html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
+
+ // Remove margin styles.
+ html = html.replace( /\s*MARGIN: 0(?:cm|in) 0(?:cm|in) 0pt\s*;/gi, '' ) ;
+ html = html.replace( /\s*MARGIN: 0(?:cm|in) 0(?:cm|in) 0pt\s*"/gi, "\"" ) ;
+
+ html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, '' ) ;
+ html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
+
+ html = html.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;
+
+ html = html.replace( /\s*PAGE-BREAK-BEFORE: [^\s;]+;?"/gi, "\"" ) ;
+
+ html = html.replace( /\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"" ) ;
+
+ html = html.replace( /\s*tab-stops:[^;"]*;?/gi, '' ) ;
+ html = html.replace( /\s*tab-stops:[^"]*/gi, '' ) ;
+
+ // Remove FONT face attributes.
+ if ( ignoreFont )
+ {
+ html = html.replace( /\s*face="[^"]*"/gi, '' ) ;
+ html = html.replace( /\s*face=[^ >]*/gi, '' ) ;
+
+ html = html.replace( /\s*FONT-FAMILY:[^;"]*;?/gi, '' ) ;
+ }
+
+ // Remove Class attributes
+ html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
+
+ // Remove styles.
+ if ( removeStyles )
+ html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
+
+ // Remove style, meta and link tags
+ html = html.replace( /