if(typeof(XWiki)=="undefined"||typeof(XWiki.widgets)=="undefined"||typeof(XWiki.widgets.ModalPopup)=="undefined"){if(typeof console!="undefined"&&typeof console.warn=="function"){console.warn("[ConfirmationBox widget] Required class missing: XWiki.widgets.ModalPopup")}}else{XWiki.widgets.ConfirmationBox=Class.create(XWiki.widgets.ModalPopup,{defaultInteractionParameters:{confirmationText:"Are you sure?",yesButtonText:"Yes",noButtonText:"No",cancelButtonText:"Cancel",showCancelButton:false},initialize:function($super,b,c){this.interactionParameters=Object.extend(Object.clone(this.defaultInteractionParameters),c||{});var a={show:{method:this.showDialog,keys:[]},yes:{method:this.onYes,keys:["Enter","Space","y"]},no:{method:this.onNo,keys:["n"]},close:{method:this.closeDialog,keys:["c"]}};if(this.interactionParameters.showCancelButton){a.close.keys.push("Esc")}else{a.no.keys.push("Esc")}$super(this.createContent(this.interactionParameters),a,{displayCloseButton:false,removeOnClose:true});this.showDialog();this.setClass("confirmation");this.behavior=b||{}},createContent:function(e){var b=new Element("div",{"class":"question"}).update(e.confirmationText);var d=new Element("div",{"class":"buttons"});var f=this.createButton("button",e.yesButtonText,"(Enter)","");Event.observe(f,"click",this.onYes.bindAsEventListener(this));d.insert(f);var a=this.createButton("button",e.noButtonText,e.showCancelButton?"(n)":"(Esc)","","secondary");Event.observe(a,"click",this.onNo.bindAsEventListener(this));d.insert(a);if(e.showCancelButton){var g=this.createButton("button",e.cancelButtonText,"(Esc)","","cancel secondary");Event.observe(g,"click",this.onCancel.bindAsEventListener(this));d.insert(g)}var c=new Element("div");c.insert(b).insert(d);return c},onYes:function(a){this.closeDialog();if(typeof(this.behavior.onYes)=="function"){this.behavior.onYes(a)}},onNo:function(a){this.closeDialog();if(typeof(this.behavior.onNo)=="function"){this.behavior.onNo(a)}},onCancel:function(a){this.closeDialog();if(typeof(this.behavior.onCancel)=="function"){this.behavior.onCancel(a)}}})};