bgneal@45: (function(){var Event=tinymce.dom.Event;tinymce.create("tinymce.plugins.PastePlugin",{init:function(ed,url){var t=this;t.editor=ed;ed.addCommand("mcePasteText",function(ui,v){if(ui){if((ed.getParam("paste_use_dialog",true))||(!tinymce.isIE)){ed.windowManager.open({file:url+"/pastetext.htm",width:450,height:400,inline:1},{plugin_url:url})}else{t._insertText(clipboardData.getData("Text"),true)}}else{t._insertText(v.html,v.linebreaks)}});ed.addCommand("mcePasteWord",function(ui,v){if(ui){if((ed.getParam("paste_use_dialog",true))||(!tinymce.isIE)){ed.windowManager.open({file:url+"/pasteword.htm",width:450,height:400,inline:1},{plugin_url:url})}else{t._insertText(t._clipboardHTML())}}else{t._insertWordContent(v)}});ed.addCommand("mceSelectAll",function(){ed.execCommand("selectall")});ed.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText",ui:true});ed.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord",ui:true});ed.addButton("selectall",{title:"paste.selectall_desc",cmd:"mceSelectAll"});if(ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onPaste.add(function(ed,e){return t._handlePasteEvent(e)})}if(!tinymce.isIE&&ed.getParam("paste_auto_cleanup_on_paste",false)){ed.onKeyDown.add(function(ed,e){if(e.ctrlKey&&e.keyCode==86){window.setTimeout(function(){ed.execCommand("mcePasteText",true)},1);Event.cancel(e)}})}},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_handlePasteEvent:function(e){var html=this._clipboardHTML(),ed=this.editor,sel=ed.selection,r;if(ed&&(r=sel.getRng())&&r.text.length>0){ed.execCommand("delete")}if(html&&html.length>0){ed.execCommand("mcePasteWord",false,html)}return Event.cancel(e)},_insertText:function(content,bLinebreaks){content=this.editor.dom.encode(content);if(content&&content.length>0){if(!this.editor.selection.isCollapsed()){this.editor.execCommand("Delete")}if(bLinebreaks){if(this.editor.getParam("paste_create_paragraphs",true)){var rl=this.editor.getParam("paste_replace_list","\u2122,TM,\u2026,...,\u201c|\u201d,\",\u2019,',\u2013|\u2014|\u2015|\u2212,-").split(",");for(var i=0;i

");content=content.replace(/\r\r/g,"

");content=content.replace(/\n\n/g,"

");if((pos=content.indexOf("

"))!=-1){this.editor.execCommand("Delete");var node=this.editor.selection.getNode();var breakElms=[];do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY"){break}breakElms[breakElms.length]=node}}while(node=node.parentNode);var before="",after="

";before+=content.substring(0,pos);for(var i=0;i";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">"}before+="

";content=before+content.substring(pos+7)+after}}if(this.editor.getParam("paste_create_linebreaks",true)){content=content.replace(/\r\n/g,"
");content=content.replace(/\r/g,"
");content=content.replace(/\n/g,"
")}}this.editor.execCommand("mceInsertRawHTML",false,content)}},_insertWordContent:function(content){var t=this,ed=t.editor;if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);if(ed.getParam("paste_insert_word_content_callback")){content=ed.execCallback("paste_insert_word_content_callback","before",content)}var rl=ed.getParam("paste_replace_list","\u2122,TM,\u2026,...,\x93|\x94|\u201c|\u201d,\",\x60|\x91|\x92|\u2018|\u2019,',\u2013|\u2014|\u2015|\u2212,-").split(",");for(var i=0;i(.*?)

","gi"),"

$1

")}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">',"gi"),'">--list--');content=content.replace(new RegExp(bull+"(.*?)
","gi"),"

"+middot+"$1

");content=content.replace(new RegExp('',"gi"),""+bull);content=content.replace(/<\/o:p>/gi,"");content=content.replace(new RegExp('
|