//>>built
define("dojox/editor/plugins/UploadImage","dojo dijit dojox dijit/_editor/_Plugin dojo/_base/connect dojo/_base/declare dojox/form/FileUploader dijit/_editor/_Plugin".split(" "),function(b,f,g,h){b.experimental("dojox.editor.plugins.UploadImage");var e=b.declare("dojox.editor.plugins.UploadImage",h,{tempImageUrl:"",iconClassPrefix:"editorIcon",useDefaultCommand:!1,uploadUrl:"",button:null,label:"Upload",setToolbar:function(a){this.button.destroy();this.createFileInput();a.addChild(this.button)},_initButton:function(){this.command=
"uploadImage";this.editor.commands[this.command]="Upload Image";this.inherited("_initButton",arguments);delete this.command},updateState:function(){this.button.set("disabled",this.get("disabled"))},createFileInput:function(){var a=b.create("span",{innerHTML:"."},document.body);b.style(a,{width:"40px",height:"20px",paddingLeft:"8px",paddingRight:"8px"});this.button=new g.form.FileUploader({isDebug:!0,uploadUrl:this.uploadUrl,uploadOnChange:!0,selectMultipleFiles:!1,baseClass:"dojoxEditorUploadNorm",
hoverClass:"dojoxEditorUploadHover",activeClass:"dojoxEditorUploadActive",disabledClass:"dojoxEditorUploadDisabled"},a);this.connect(this.button,"onChange","insertTempImage");this.connect(this.button,"onComplete","onComplete")},onComplete:function(a,c,d){a=a[0];c=b.byId(this.currentImageId,this.editor.document);d=this.downloadPath?this.downloadPath+a.name:a.file;c.src=d;b.attr(c,"_djrealurl",d);a.width&&(c.width=a.width,c.height=a.height)},insertTempImage:function(){this.currentImageId="img_"+(new Date).getTime();
this.editor.execCommand("inserthtml",'\x3cimg id\x3d"'+this.currentImageId+'" src\x3d"'+this.tempImageUrl+'" width\x3d"32" height\x3d"32"/\x3e')}});b.subscribe(f._scopeName+".Editor.getPlugin",null,function(a){if(!a.plugin)switch(a.args.name){case "uploadImage":a.plugin=new e({url:a.args.url})}});return e});