//============================== Generic Javascript Functions var user_config = { log: 1, theme: 'default', menu_default: false, // true - Collapsed | false - Open allways_ajax: true }; function log(message, importance = 0) { if (user_config.log === 0) { return; } if (importance === 0) { console.log("LOG:: |" + message + "|"); } if (importance === 1) { console.log(message); } if (importance === 2) { alert("LOG:: |" + message + "|"); } } function isDefined(data) { if (typeof data === 'undefined') { return false; } else { return true; } } function definedOr(data, value = '') { if (typeof data === 'undefined') { return value; } else { return data; } } //============================== Generic Template Functions function revalidate_screen() { $('[data-format]').each(function () { $(this).mask($(this).data('format'), {}); }); $('[data-toggle="popover"]').popover(); $('select').each(function () { if (typeof $(this).data('value') !== "undefined" && $(this).data('value') !== '') { $(this).val($(this).data('value')); } }); $('.datepicker').each(function () { $(this).datepicker({ format: "dd/mm/yyyy", todayBtn: "linked", clearBtn: true, autoclose: true, todayHighlight: true }); }); $('.selectpicker').each(function () { $(this).select2({ liveSearch: true }); }); $('.popup-toggle').each(() => { var template = '