%notificationDTD; ]> 1 2 3 4 5 6 7 8 9 10 null null null false if (val) this.setAttribute('notificationshidden', true); else this.removeAttribute('notificationshidden'); return val; = 0; n--) { if (aValue == notifications[n].getAttribute("value")) return notifications[n]; } return null; ]]> this.PRIORITY_CRITICAL_BLOCK) throw "Invalid notification priority " + aPriority; // check for where the notification should be inserted according to // priority. If two are equal, the existing one appears on top. var notifications = this.allNotifications; var insertPos = null; for (var n = notifications.length - 1; n >= 0; n--) { if (notifications[n].priority < aPriority) break; insertPos = notifications[n]; } const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; var newitem = document.createElementNS(XULNS, "notification"); newitem.setAttribute("label", aLabel); newitem.setAttribute("value", aValue); if (aImage) newitem.setAttribute("image", aImage); newitem.eventCallback = aEventCallback; if (aButtons) { for (var b = 0; b < aButtons.length; b++) { var button = aButtons[b]; var buttonElem = document.createElementNS(XULNS, "button"); buttonElem.setAttribute("label", button.label); buttonElem.setAttribute("accesskey", button.accessKey); newitem.appendChild(buttonElem); buttonElem.buttonInfo = button; } } newitem.setAttribute("priority", aPriority); if (aPriority >= this.PRIORITY_CRITICAL_LOW) newitem.setAttribute("type", "critical"); else if (aPriority <= this.PRIORITY_INFO_HIGH) newitem.setAttribute("type", "info"); else newitem.setAttribute("type", "warning"); if (!insertPos) { newitem.style.position = "fixed"; newitem.style.top = "100%"; newitem.style.marginTop = "-15px"; newitem.style.opacity = "0"; } this.insertBefore(newitem, insertPos); if (!insertPos) this._showNotification(newitem, true); // Fire event for accessibility APIs var event = document.createEvent("Events"); event.initEvent("AlertActive", true, true); newitem.dispatchEvent(event); return newitem; ]]> = 0; n--) { if (aImmediate) this._removeNotificationElement(notifications[n]); else this.removeNotification(notifications[n]); } this.currentNotification = null; // Must clear up any currently animating notification if (aImmediate) this._finishAnimation(); ]]> = 0; n--) { var notification = notifications[n]; if (notification.persistence) notification.persistence--; else if (Date.now() > notification.timeout) this.removeNotification(notification); } ]]> = 0) ? notifications[idx] : null; if (skipAnimation) { this._removeNotificationElement(this._closedNotification); this._closedNotification = null; this._setBlockingState(this.currentNotification); return; } aNotification.style.marginTop = -height + "px"; aNotification.style.opacity = 0; } this._animating = true; ]]> 0 document.getAnonymousElementByAttribute(this, "anonid", "closebutton"); document.getAnonymousElementByAttribute(this, "anonid", "button"); document.getAnonymousElementByAttribute(this, "anonid", "menupopup");