158 |
158 |
159 if (content && content.length > 0) { |
159 if (content && content.length > 0) { |
160 // Cleanup Word content |
160 // Cleanup Word content |
161 var bull = String.fromCharCode(8226); |
161 var bull = String.fromCharCode(8226); |
162 var middot = String.fromCharCode(183); |
162 var middot = String.fromCharCode(183); |
163 var cb; |
163 |
164 |
164 if (ed.getParam('paste_insert_word_content_callback')) |
165 if ((cb = this.editor.getParam("paste_insert_word_content_callback", "")) != "") |
165 content = ed.execCallback('paste_insert_word_content_callback', 'before', content); |
166 content = eval(cb + "('before', content)"); |
166 |
167 |
167 var rl = ed.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); |
168 var rl = this.editor.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); |
|
169 for (var i=0; i<rl.length; i+=2) |
168 for (var i=0; i<rl.length; i+=2) |
170 content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]); |
169 content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]); |
171 |
170 |
172 if (this.editor.getParam("paste_convert_headers_to_strong", false)) { |
171 if (this.editor.getParam("paste_convert_headers_to_strong", false)) { |
173 content = content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>', 'gi'), '<p><b>$1</b></p>'); |
172 content = content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>', 'gi'), '<p><b>$1</b></p>'); |
243 content = content.replace(/^( )*/gi, ''); |
242 content = content.replace(/^( )*/gi, ''); |
244 } |
243 } |
245 |
244 |
246 content = content.replace(/--list--/gi, ""); // Remove --list-- |
245 content = content.replace(/--list--/gi, ""); // Remove --list-- |
247 |
246 |
248 if ((cb = this.editor.getParam("paste_insert_word_content_callback", "")) != "") |
247 if (ed.getParam('paste_insert_word_content_callback')) |
249 content = eval(cb + "('after', content)"); |
248 content = ed.execCallback('paste_insert_word_content_callback', 'after', content); |
250 |
249 |
251 // Insert cleaned content |
250 // Insert cleaned content |
252 this.editor.execCommand("mceInsertContent", false, content); |
251 this.editor.execCommand("mceInsertContent", false, content); |
253 |
252 |
254 if (this.editor.getParam('paste_force_cleanup_wordpaste', true)) { |
253 if (this.editor.getParam('paste_force_cleanup_wordpaste', true)) { |