on-demand release 4.0dev+
[moodle.git] / lib / yui / build / moodle-core-notification-alert / moodle-core-notification-alert-min.js
CommitLineData
d970bf0a 1YUI.add("moodle-core-notification-alert",function(o,t){var e,i;M.core=M.core||{},e="Moodle alert",i=function(t){t.closeButton=!1,i.superclass.constructor.apply(this,[t])},o.extend(i,M.core.notification.info,{_closeEvents:null,initializer:function(){var t,e,i;this._closeEvents=[],this.publish("complete"),t=o.Node.create('<input type="button" class="btn btn-primary" id="id_yuialertconfirm-'+this.get("COUNT")+'"value="'+this.get("yesLabel")+'" />'),e=o.Node.create('<div class="confirmation-dialogue"></div>').append(o.Node.create('<div class="confirmation-message">'+this.get("message")+"</div>")).append(o.Node.create('<div class="confirmation-buttons text-xs-right"></div>').append(t)),this.get("notificationBase").addClass("moodle-dialogue-confirm"),this.setStdModContent(o.WidgetStdMod.BODY,e,o.WidgetStdMod.REPLACE),this.setStdModContent(o.WidgetStdMod.HEADER,'<h5 id="moodle-dialogue-'+this.get("COUNT")+'-wrap-header-text">'+this.get("title")+"</h5>",o.WidgetStdMod.REPLACE),this._closeEvents.push(o.on("key",this.submit,window,"down:13",this),t.on("click",this.submit,this)),(i=this.get("boundingBox").one(".closebutton"))&&this._closeEvents.push(i.on("click",this.submit,this))},submit:function(){new o.EventHandle(this._closeEvents).detach(),this.fire("complete"),this.hide(),this.destroy()}},{NAME:e,CSS_PREFIX:"moodle-dialogue",ATTRS:{title:{validator:o.Lang.isString,value:"Alert"},message:{validator:o.Lang.isString,value:"Confirm"},yesLabel:{validator:o.Lang.isString,setter:function(t){return t=t||"OK"},value:"OK"}}}),M.core.alert=i},"@VERSION@",{requires:["moodle-core-notification-dialogue"]});