First commit

This commit is contained in:
Nathan
2026-09-18 20:29:17 -06:00
commit 3b09abe571
2840 changed files with 467153 additions and 0 deletions
@@ -0,0 +1,32 @@
function pwgToaster(info) {
if (!info.text || !info.icon) {
console.log('set info.text or info.icon');
return;
}
if (typeof info.text !== 'string') {
console.log('info.text is not a string');
return;
}
if (info.icon !== 'success' && info.icon !== 'error') {
console.log('info.icon must be success or error');
return;
}
const template = $('#toast_template').clone();
template.find('.toast_text').html(info.text);
template.find('.toast_icon').addClass(info.icon === 'success' ? 'icon-ok' : 'icon-cancel');
template.addClass(info.icon === 'success' ? info.icon : 'error');
template.removeClass('template-pwg-toaster');
template.appendTo('#pwg_toaster');
const time = info.time ?? 3600;
setTimeout(() => {
template.fadeOut(() => {
template.remove();
})
}, time);
}