1 2 3 4 5 6 7 8 9 10 null 4 null null if (val) this.setAttribute('notificationshidden', true); else this.removeAttribute('notificationshidden'); = 0; n--) { if (aValue == notifications[n].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 (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); newitem.setAttribute("image", aImage); this.insertBefore(newitem, insertPos); 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.priority = aPriority; if (aPriority >= this.PRIORITY_CRITICAL_LOW) newitem.type = "critical"; else if (aPriority <= this.PRIORITY_INFO_HIGH) newitem.type = "info"; else newitem.type = "warning"; // Fire event for accessibility APIs var event = document.createEvent("Events"); event.initEvent("AlertActive", true, true); this.dispatchEvent(event); if (!insertPos) this._showNotification(newitem, true); return newitem; ]]> = 0; n--) { if (aImmediate) this.removeChild(notifications[n]); else this.removeNotification(notifications[n]); } this.currentNotification = null; ]]> 0 && margin + change >= 0) { aNotification.style.marginTop = "0px"; aNotification.style.opacity = 1; done = true; } else if (change < 0 && margin + change <= -height) { aNotification.style.marginTop = -height + "px"; done = true; } else { aNotification.style.marginTop = (margin + change) + "px"; if (opacitychange) aNotification.style.opacity = Number(aNotification.style.opacity) + opacitychange; } if (done) { clearInterval(self._timer); var newitem; if (aSlideIn) { newitem = aNotification; } else { if (aNotification.parentNode) aNotification.parentNode.removeChild(aNotification); var notifications = self.allNotifications; var idx = notifications.length - 1; if (idx >= 0) newitem = notifications[idx]; } if (newitem) self.currentNotification = newitem; } } this._timer = setInterval(slide, 50); ]]>