"use strict"; var alerts = undefined; var $ = jQuery; ( function( alerts ) { var alert, error, info, success, warning, _container; /** * Display info alert pop up. * * @param message * @param title * @param options * @return {function} alert() alert function. */ info = function( message, title, options ) { return alert("info", message, title, "icon-info-sign", options ); }; /** * Display warning alert pop up. * @param message * @param title * @param options * @return {function} alert() alert function. */ warning = function( message, title, options ) { return alert( "warning", message, title, "icon-warning-sign", options ); }; /** * Display error alert pop up. * * @param message * @param title * @param options * @return {function} alert() alert function. */ error = function( message, title, options ) { return alert( "error", message, title, "icon-minus-sign", options ); }; /** * Display success alert pop up. * * @param message * @param title * @param options * @return {function} alert() alert function. */ success = function( message, title, options ) { return alert( "success", message, title, "icon-ok-sign", options ); }; /** * Alert Function. * * @param type * @param message * @param title * @param icon * @param options */ alert = function( type, message, title, icon, options ) { var alertElem, messageElem, titleElem, iconElem, innerElem, _container; if ( typeof options === "undefined" ) { options = {}; } options = $.extend( {}, alerts.defaults, options ); if (!_container) { _container = $("#alerts"); if (_container.length === 0) { _container = $( "