$.fn.myLoading=function(i){var n=this,d={lg:"large",md:"medium",sm:"small"},a=Object.assign({msg:null,timeout:null,fixed:!1,opacity:!0,size:null},i),e="";return null===a.msg&&(a.msg="Processing..."),null!==a.size&&!1!==Object.keys(d).includes(a.size)||(a.size="md"),e+=" "+d[a.size],e+=!0===a.fixed?" fixed":"",e+=!0===a.opacity?" opacity":"",n.myUnloading(!1),n.attr("style",'position:relative'),n.addClass("myLoading loading").append('
'+a.msg+"
"),n.children(".myLoading-container").show(),null!==a.timeout&&setTimeout(function(){n.myUnloading()},a.timeout),n},$.fn.myUnloading=function(i){var n=this;return-1===[!0,!1].indexOf(i)&&(i=!0),!0!==i?(n.children(".myLoading-container").remove(),n.removeClass("loading").addClass("myLoading")):$.when(n.children(".myLoading-container").children(".myLoading-indicator").fadeOut(500)).done(function(){n.children(".myLoading-container").remove(),n.removeClass("loading").addClass("myLoading")}),n};