//>>built define("dojox/editor/plugins/PasteFromWord",["dojo","dijit","dojox","dijit/_editor/_Plugin","dijit/_base/manager","dijit/_editor/RichText","dijit/form/Button","dijit/Dialog","dojox/html/format","dojo/_base/connect","dojo/_base/declare","dojo/i18n","dojo/string","dojo/i18n!dojox/editor/plugins/nls/PasteFromWord","dojo/i18n!dijit/nls/common","dojo/i18n!dijit/_editor/nls/commands"],function(_1,_2,_3,_4){ var _5=_1.declare("dojox.editor.plugins.PasteFromWord",_4,{iconClassPrefix:"dijitAdditionalEditorIcon",width:"400px",height:"300px",_template:["
","
${instructions}
","
","","","","","","","
",""," ","","
","
"].join(""),_filters:[{regexp:/(]*\s*>)|(<\s*link\s* href="file:[^>]*\s*>)|(<\/?\s*\w+:[^>]*\s*>)/gi,handler:""},{regexp:/(?:]*)>([\s\S]*?)<\/style>|]*rel=['"]?stylesheet)([^>]*?href=(['"])([^>]*?)\4[^>\/]*)\/?>)/gi,handler:""},{regexp:/(class="Mso[^"]*")|()/gi,handler:""},{regexp:/(]*>\s*(\ |\u00A0)*\s*<\/p[^>]*>)|(]*>\s*]*>\s*(\ |\u00A0)*\s*<\/\s*font\s*>\s<\/p[^>]*>)/ig,handler:""},{regexp:/(style="[^"]*mso-[^;][^"]*")|(style="margin:\s*[^;"]*;")/gi,handler:""},{regexp:/(<\s*script[^>]*>((.|\s)*?)<\\?\/\s*script\s*>)|(<\s*script\b([^<>]|\s)*>?)|(<[^>]*=(\s|)*[("|')]javascript:[^$1][(\s|.)]*[$1][^>]*>)/ig,handler:""},{regexp:/<(\/?)o\:p[^>]*>/gi,handler:""}],_initButton:function(){ this._filters=this._filters.slice(0); var _6=_1.i18n.getLocalization("dojox.editor.plugins","PasteFromWord"); _1.mixin(_6,_1.i18n.getLocalization("dijit","common")); _1.mixin(_6,_1.i18n.getLocalization("dijit._editor","commands")); this.button=new _2.form.Button({label:_6["pasteFromWord"],showLabel:false,iconClass:this.iconClassPrefix+" "+this.iconClassPrefix+"PasteFromWord",tabIndex:"-1",onClick:_1.hitch(this,"_openDialog")}); this._uId=_2.getUniqueId(this.editor.id); _6.uId=this._uId; _6.width=this.width||"400px"; _6.height=this.height||"300px"; this._dialog=new _2.Dialog({title:_6["pasteFromWord"]}).placeAt(_1.body()); this._dialog.set("content",_1.string.substitute(this._template,_6)); _1.style(_1.byId(this._uId+"_rte"),"opacity",0.001); this.connect(_2.byId(this._uId+"_paste"),"onClick","_paste"); this.connect(_2.byId(this._uId+"_cancel"),"onClick","_cancel"); this.connect(this._dialog,"onHide","_clearDialog"); },updateState:function(){ this.button.set("disabled",this.get("disabled")); },setEditor:function(_7){ this.editor=_7; this._initButton(); },_openDialog:function(){ this._dialog.show(); if(!this._rte){ setTimeout(_1.hitch(this,function(){ this._rte=new _2._editor.RichText({height:this.height||"300px"},this._uId+"_rte"); this._rte.onLoadDeferred.addCallback(_1.hitch(this,function(){ _1.animateProperty({node:this._rte.domNode,properties:{opacity:{start:0.001,end:1}}}).play(); })); }),100); } },_paste:function(){ var _8=_3.html.format.prettyPrint(this._rte.get("value")); this._dialog.hide(); var i; for(i=0;i