{"version":3,"sources":["https:\/\/immet-dist.spbstu.ru\/theme\/mooc\/amd\/src\/notice.js"],"names":["define","$","SELECTORS","show","message","type","time","notice","append","text","addClass","css","width","margin-left","margin-right","fadeIn","setTimeout","fadeOut","remove","is","hide","success","info"],"mappings":"AAAA,aAEAA,OAAO,CAAC,UAAW,SAAUC,GAC3B,IAAIC,EACS,kBASTC,EAAO,SAAcC,EAASC,EAAMC,GAEtCD,EAAOA,GAAQ,UACfC,EAAOA,GAAQ,KAEf,IAAIC,EAASN,EAAE,eACfA,EAAEC,GAAqBC,OAAOK,OAAOD,GACrCA,EAAOE,KAAKL,GAASM,SAAS,eAAiBL,GAAMM,IAAI,CACvDC,MAAO,cACPC,cAAe,OACfC,eAAgB,SAEjBC,OAAO,QACRC,WAAW,WACTT,EAAOU,QAAQ,OAAQ,WACrBV,EAAOW,SAEHjB,EAAEC,GAAqBiB,GAAG,WAC5BlB,EAAEC,GAAqBkB,UAG1Bd,IAyBL,MAAO,CACLe,QAjBY,SAAiBjB,EAASE,GAEtCH,EAAKC,EAAS,UADdE,EAAOA,GAAQ,OAiBfgB,KAPS,SAAclB,EAASE,GAEhCH,EAAKC,EAAS,OADdE,EAAOA,GAAQ","sourcesContent":["\"use strict\";\ndefine(['jquery'], function($) {\n var SELECTORS = {\n CONTAINER: '.edwiser-notice'\n };\n\n \/**\n * Show custom notice\n * @param {String} message Message to show in notice\n * @param {String} type Type of message [success|info|warning|danger]. Default success\n * @param {Number} time For how long notice will appear. Default 1500\n *\/\n var show = function(message, type, time) {\n \/\/ Reinitialize type and time if is not set.\n type = type || 'success';\n time = time || 1500;\n\n \/\/ Create notice alert.\n var notice = $('
<\/div>');\n $(SELECTORS.CONTAINER).show().append(notice);\n notice.text(message)\n .addClass('alert alert-' + type)\n .css({\n width: 'fit-content',\n 'margin-left': 'auto',\n 'margin-right': 'auto'\n })\n \/\/ Show notice alert.\n .fadeIn('slow');\n setTimeout(function() {\n notice.fadeOut('slow', function() {\n notice.remove();\n if ($(SELECTORS.CONTAINER).is(':empty')) {\n $(SELECTORS.CONTAINER).hide();\n }\n });\n }, time);\n };\n\n \/**\n * Show success notice\n * @param {String} message Message to show in notice\n * @param {Number} time For how long notice will appear. Default 1500\n *\/\n var success = function(message, time) {\n time = time || 1500;\n show(message, 'success', time);\n };\n\n \/**\n * Show info notice\n * @param {String} message Message to show in notice\n * @param {Number} time For how long notice will appear. Default 1500\n *\/\n var info = function(message, time) {\n time = time || 1500;\n show(message, 'info', time);\n };\n\n return {\n success: success,\n info: info\n };\n});"],"file":"notice.min.js"}