(function(){function a(b){b.data.mode='html';};CKEDITOR.plugins.add('pastefromword',{init:function(b){var c=0,d=function(e){e&&e.removeListener();b.removeListener('beforePaste',a);c&&setTimeout(function(){c=0;},0);};b.addCommand('pastefromword',{canUndo:false,exec:function(){c=1;b.on('beforePaste',a);if(b.execCommand('paste','html')===false){b.on('dialogShow',function(e){e.removeListener();e.data.on('cancel',d);});b.on('dialogHide',function(e){e.data.removeListener('cancel',d);});}b.on('afterPaste',d);}});b.ui.addButton('PasteFromWord',{label:b.lang.pastefromword.toolbar,command:'pastefromword'});b.on('pasteState',function(e){b.getCommand('pastefromword').setState(e.data);});b.on('paste',function(e){var f=e.data,g;if((g=f.html)&&(c||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(g))){var h=this.loadFilterRules(function(){if(h)b.fire('paste',f);else if(!b.config.pasteFromWordPromptCleanup||c||confirm(b.lang.pastefromword.confirmCleanup))f.html=CKEDITOR.cleanWord(g,b);});h&&e.cancel();}},this);},loadFilterRules:function(b){var c=CKEDITOR.cleanWord;if(c)b();else{var d=CKEDITOR.getUrl(CKEDITOR.config.pasteFromWordCleanupFile||this.path+'filter/default.js');CKEDITOR.scriptLoader.load(d,b,null,true);}return!c;},requires:['clipboard']});})();
