if (!String.prototype.trim) { String.prototype.trim = function () { return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); }; } function _sys_modal_show_generic(stype,stitle,surl,sfooter,showclosebutton) { $.ajaxSetup ({ // Disable caching of AJAX responses cache: false }); if ( stype.length > 0 ) { stype = '-' + stype; } $('.tooltip').hide(); $('#sysModal' + stype).removeClass("modal-danger"); $('#btn-modal-close').addClass("btn-primary"); $('#btn-modal-close').removeClass("btn-outline"); $('#sysModalContent' + stype).load(surl, function(){ var sbtnClose = ""; if ( showclosebutton == true ) { sbtnClose = ''; }else { sbtnClose = ""; } if ( showclosebutton == false && sfooter.length == 0 ) { $('#sysModalFooter' + stype).hide(); } else { $('#sysModalFooter' + stype).show(); } $('#sysModalFooter' + stype).html(sfooter + sbtnClose); $('#sysModalTitle' + stype).html(stitle); $('#sysModal' + stype).modal({show:true,backdrop:'static'}); $('#sysModal' + stype).css('z-index', 3000); } ); } function sysValidateEmail(email) { const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(String(email).toLowerCase()); } function sysTrim (string) { if ( string == null ) { return ""; } string = '' + string; return string.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); } function _sys_modal_hide(stype) { if ( stype.length > 0 ) { stype = '-' + stype; } $('.tooltip').hide(); $('#sysModal' + stype).modal('hide'); } function _sys_set_field_error(sid, stext) { $('#' + sid).addClass("is-invalid"); alert(stext); $('#' + sid).focus(); } function _sys_toastr_show_success(text) { toastr.success(text); } function _sys_toastr_show_danger(text) { toastr.error(text); } function _sys_toastr_show_warning(text) { toastr.warning(text); } function _sys_toastr_show_info(text) { toastr.info(text); }