Skip to content

Commit ecb5b33

Browse files
committed
Remove comments
1 parent 2b1e2d5 commit ecb5b33

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

Source/Blazorise/wwwroot/utilities.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -337,19 +337,16 @@ export function log(message, args) {
337337
const HOST_ID = "blazorise-license-banner-host";
338338
const GLOBAL = "__blazoriseBannerState__";
339339

340-
// Global state (lives until full page refresh)
341340
const st = (window[GLOBAL] ||= {
342341
dismissed: false,
343342
bodyObserver: null,
344343
attrObserver: null
345344
});
346345

347-
// If user already dismissed (in this page lifetime), don't show again
348346
if (st.dismissed) {
349347
return;
350348
}
351349

352-
// Prepare message for HTML (strip %c and escape)
353350
let cleanMessage = typeof message === "string" ? message.replace(/%c/g, "") : String(message);
354351
cleanMessage = cleanMessage
355352
.replace(/&/g, "&")
@@ -358,20 +355,17 @@ export function log(message, args) {
358355
.replace(/"/g, """)
359356
.replace(/'/g, "'");
360357

361-
// If banner exists, just update the message
362358
let host = document.getElementById(HOST_ID);
363359
if (host && host.shadowRoot) {
364360
const msgEl = host.shadowRoot.querySelector(".msg");
365361
if (msgEl) msgEl.innerHTML = cleanMessage;
366362
return;
367363
}
368364

369-
// Create host + Shadow DOM (isolates styles)
370365
host = document.createElement("div");
371366
host.id = HOST_ID;
372367
const shadow = host.attachShadow({ mode: "open" });
373368

374-
// Styles: Blazorise purple, subtle sizing
375369
const style = document.createElement("style");
376370
style.textContent = `
377371
:host { all: initial !important; }
@@ -382,7 +376,7 @@ export function log(message, args) {
382376
bottom: 0 !important;
383377
z-index: 2147483647 !important;
384378
padding: 10px 14px !important;
385-
background: #6C63FF !important; /* Blazorise purple */
379+
background: #6C63FF !important;
386380
color: #FFFFFF !important;
387381
font: 500 14px/1.4 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif !important;
388382
box-shadow: 0 -4px 12px rgba(0,0,0,0.2) !important;
@@ -409,7 +403,6 @@ export function log(message, args) {
409403

410404
shadow.appendChild(style);
411405

412-
// Markup
413406
const wrapperElement = document.createElement("div");
414407
wrapperElement.className = "wrapper";
415408

@@ -422,7 +415,6 @@ export function log(message, args) {
422415
button.type = "button";
423416
button.textContent = "Dismiss";
424417
button.addEventListener("click", () => {
425-
// Mark dismissed for current page lifetime and stop observers
426418
st.dismissed = true;
427419
if (st.bodyObserver) try { st.bodyObserver.disconnect(); } catch { }
428420
if (st.attrObserver) try { st.attrObserver.disconnect(); } catch { }
@@ -434,7 +426,6 @@ export function log(message, args) {
434426
shadow.appendChild(wrapperElement);
435427
document.body.appendChild(host);
436428

437-
// Re-add if removed from body
438429
if (!st.bodyObserver) {
439430
st.bodyObserver = new MutationObserver(() => {
440431
if (st.dismissed) return;
@@ -446,7 +437,6 @@ export function log(message, args) {
446437
st.bodyObserver.observe(document.body, { childList: true });
447438
}
448439

449-
// Undo display:none / hidden
450440
if (!st.attrObserver) {
451441
st.attrObserver = new MutationObserver(() => {
452442
if (st.dismissed) return;

0 commit comments

Comments
 (0)