!function(){var moduleFactory=function($){var module=this;$.require().stylesheet("ajaxPopover/default").done(function(){var exports=function(){$.fn.ajaxPopover=function(popoverOptions){var elements=this,defaultOptions={trigger:"click",beforeAjax:'<div class="ajaxPopover loading"></div>'},options=$.extend({},defaultOptions,popoverOptions);return $.each(elements,function(i,element){if(element=$(element),"string"==typeof popoverOptions)return"toggle"===popoverOptions&&(popoverOptions=void 0===element.data("popover")?"show":element.data("popover").$tip.hasClass("in")?"hide":"show"),element.popover(popoverOptions).trigger("ajaxPopover"+$.String.capitalize(popoverOptions)),void 0;
var originalContent=options.content||element.data("content")||"";if(options.content=options.beforeAjax,void 0===options.ajax&&void 0!==element.data("ajax")&&(options.ajax=function(){return eval(element.data("ajax"))}),void 0!==options.ajax){var trigger="manual"===options.trigger?"ajaxPopoverShow":options.trigger;element.one(trigger,function(){var task=options.ajax;$.isFunction(task)&&(task=options.ajax()),"string"==typeof task&&(options.content=task,rePopover(element,options)),$.isDeferred(task)&&task.done(function(html){options.content=html,rePopover(element,options)
}).fail(function(html){options.content="string"!=typeof html||""===html?'<div class="ajaxPopover error">Failed loading.</div>':html,rePopover(element,options)})})}element.popover(options)}),elements};var rePopover=function(element,options){$(element).popover("destroy").data("popover",null).popover(options).popover("show")}};exports(),module.resolveWith(exports)})};dispatch("ajaxPopover").containing(moduleFactory).to("Foundry/2.1 Modules")}();