/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */
/* This file is part of version 0.96beta2 released Fri, 20 Mar 2009 11:01:14 +0100 */
InsertImage._pluginInfo={name:"InsertImage",origin:"Xinha Core",version:"$LastChangedRevision: 1055 $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),developer:"The Xinha Core Developer Team",developer_url:"$HeadURL: http://svn.xinha.org/trunk/modules/InsertImage/insert_image.js $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),sponsor:"",sponsor_url:"",license:"htmlArea"};function InsertImage(c){this.editor=c;var a=c.config;var b=this;c.config.btnList.insertimage[3]=function(){b.show()}}InsertImage.prototype._lc=function(a){return Xinha._lc(a,"Xinha")};InsertImage.prototype.onGenerateOnce=function(){InsertImage.loadAssets()};InsertImage.loadAssets=function(){var self=InsertImage;if(self.loading){return}self.loading=true;Xinha._getback(_editor_url+"modules/InsertImage/dialog.html",function(getback){self.html=getback;self.dialogReady=true});Xinha._getback(_editor_url+"modules/InsertImage/pluginMethods.js",function(getback){eval(getback);self.methodsReady=true})};InsertImage.prototype.onUpdateToolbar=function(){if(!(InsertImage.dialogReady&&InsertImage.methodsReady)){this.editor._toolbarObjects.insertimage.state("enabled",false)}else{this.onUpdateToolbar=null}};InsertImage.prototype.prepareDialog=function(){var a=this;var c=this.editor;var b=this.dialog=new Xinha.Dialog(c,InsertImage.html,"Xinha",{width:410});b.getElementById("ok").onclick=function(){a.apply()};b.getElementById("cancel").onclick=function(){a.dialog.hide()};b.getElementById("preview").onclick=function(){var d=b.getElementById("f_url");var e=d.value;if(!e){alert(b._lc("You must enter the URL"));d.focus();return false}b.getElementById("ipreview").src=e;return false};this.dialog.onresize=function(){var d=parseInt(this.height,10)-this.getElementById("h1").offsetHeight-this.getElementById("buttons").offsetHeight-this.getElementById("inputs").offsetHeight-parseInt(this.rootElem.style.paddingBottom,10);this.getElementById("ipreview").style.height=((d>0)?d:0)+"px";this.getElementById("ipreview").style.width=this.width-2+"px"};this.dialogReady=true};