/*! Message Box jQuery Plugin - v0.1.0 - 2012-08-28 * https://github.com/JeffreyWay/MessageBox * Copyright (c) 2012 Jeffrey Way; Licensed GPL */ (function(e){Object.create||(Object.create=function(e){function t(){}if(arguments.length>1)throw new Error("Object.create implementation only accepts the first parameter.");return t.prototype=e,new t});var t={template:function(e,t){return['

'+e+"

",'
',t,"
"].join("")},initialize:function(t,n){this.el=e("
",{"class":"message-box",style:"display: none"}),this.text=t,this.settings=e.extend({},e.message.defaults,n),this.el.addClass("message-box-"+this.settings.icon);var r=this.createButtons(this.settings.buttons);this.el.html(this.template(t,r)),this.events()},createButtons:function(t){return e.map(t,function(e){return''}).join("")},events:function(){var t=this;this.el.find("input").on("click",function(){t.close(),typeof t.settings.callback=="function"&&t.settings.callback.call(t,e(this).val())})},close:function(){this.el.animate({top:0,opacity:"hide"},150,function(){e(this).remove()})},show:function(){this.el.appendTo("body").animate({top:e(window).height()/2-this.el.outerHeight()/2,opacity:"show"},300).find("input").first().focus()}};e.message=function(e,n){var r=Object.create(t);return r.initialize(e,n),r.show(),r},e.message.defaults={icon:"info",buttons:["Okay"],callback:null}})(jQuery);