diff --git a/whm/gniza-whm/remotes.cgi b/whm/gniza-whm/remotes.cgi index 51ece88..fed0b28 100644 --- a/whm/gniza-whm/remotes.cgi +++ b/whm/gniza-whm/remotes.cgi @@ -714,11 +714,17 @@ function gnizaTestConnection() { function gnizaToast(type, msg) { var prev = document.getElementById('gniza-alert'); if (prev) prev.remove(); + var s = document.getElementById('gniza-alert-style'); + if (!s) { + s = document.createElement('style'); + s.id = 'gniza-alert-style'; + s.textContent = '#gniza-alert{position:fixed!important;top:24px!important;right:24px!important;z-index:9999!important;max-width:480px!important;padding:12px 20px!important;border-radius:8px!important;font-size:14px!important;box-shadow:0 4px 12px rgba(0,0,0,.15)!important;transition:opacity .3s!important;display:block!important;}'; + document.head.appendChild(s); + } var el = document.createElement('div'); el.id = 'gniza-alert'; el.className = 'alert alert-' + type; el.textContent = msg; - el.style.cssText = 'position:fixed;top:24px;right:24px;z-index:9999;max-width:480px;padding:12px 20px;border-radius:8px;font-size:14px;box-shadow:0 4px 12px rgba(0,0,0,.15);transition:opacity .3s'; document.body.appendChild(el); setTimeout(function() { el.style.opacity = '0'; }, type === 'error' ? 6000 : 3000); setTimeout(function() { el.remove(); }, type === 'error' ? 6500 : 3500); diff --git a/whm/gniza-whm/setup.cgi b/whm/gniza-whm/setup.cgi index 84fc313..5e12df7 100644 --- a/whm/gniza-whm/setup.cgi +++ b/whm/gniza-whm/setup.cgi @@ -316,11 +316,17 @@ function gnizaTestConnection() { function gnizaToast(type, msg) { var prev = document.getElementById('gniza-alert'); if (prev) prev.remove(); + var s = document.getElementById('gniza-alert-style'); + if (!s) { + s = document.createElement('style'); + s.id = 'gniza-alert-style'; + s.textContent = '#gniza-alert{position:fixed!important;top:24px!important;right:24px!important;z-index:9999!important;max-width:480px!important;padding:12px 20px!important;border-radius:8px!important;font-size:14px!important;box-shadow:0 4px 12px rgba(0,0,0,.15)!important;transition:opacity .3s!important;display:block!important;}'; + document.head.appendChild(s); + } var el = document.createElement('div'); el.id = 'gniza-alert'; el.className = 'alert alert-' + type; el.textContent = msg; - el.style.cssText = 'position:fixed;top:24px;right:24px;z-index:9999;max-width:480px;padding:12px 20px;border-radius:8px;font-size:14px;box-shadow:0 4px 12px rgba(0,0,0,.15);transition:opacity .3s'; document.body.appendChild(el); setTimeout(function() { el.style.opacity = '0'; }, type === 'error' ? 6000 : 3000); setTimeout(function() { el.remove(); }, type === 'error' ? 6500 : 3500);