%notificationDTD; ]> 1 2 3 4 5 6 7 8 9 10 null 4 null null null 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); if (!insertPos) { newitem.style.position = "fixed"; newitem.style.top = "100%"; } 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"; 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.removeChild(notifications[n]); else this.removeNotification(notifications[n]); } this.currentNotification = null; if (aImmediate && this._timer) { // Must clear up any currently animating notification clearInterval(this._timer); if (this._closedNotification) { this.removeChild(this._closedNotification); this._closedNotification = null; } } ]]> = 0; n--) { var notification = notifications[n]; if (notification.persistence) notification.persistence--; else if (Date.now() > notification.timeout) this.removeNotification(notification); } ]]> height) height = this.currentNotification.boxObject.height; this.currentNotification = aNotification; aNotification.style.removeProperty("position"); aNotification.style.removeProperty("top"); if (skipAnimation) { this._setBlockingState(this.currentNotification); return; } aNotification.style.marginTop = -height + "px"; aNotification.style.opacity = 0; margin = -height; } else { change = -change; this._closedNotification = aNotification; var notifications = this.allNotifications; var idx = notifications.length - 1; this.currentNotification = (idx >= 0) ? notifications[idx] : null; if (skipAnimation) { this.removeChild(this._closedNotification); this._closedNotification = null; this._setBlockingState(this.currentNotification); return; } var style = window.getComputedStyle(aNotification, null); margin = style.getPropertyCSSValue("margin-top"). getFloatValue(CSSPrimitiveValue.CSS_PX); } var opacitychange = change / height; const FRAME_LENGTH = 50; function slide(self, args, off) { // If the notificationbox is disconnected then stop the timer if (self.ownerDocument.compareDocumentPosition(self) & Node.DOCUMENT_POSITION_DISCONNECTED) { clearInterval(args.timer); return; } var framesToHandle = 1; // Skip frames if we aren't getting the desired frame rate. if (off > 0) framesToHandle += Math.round(off / FRAME_LENGTH); margin += framesToHandle * change; if (change > 0 && margin >= 0) { aNotification.style.marginTop = "0px"; aNotification.style.opacity = 1; } else if (change < 0 && margin <= -height) { aNotification.style.marginTop = -height + "px"; } else { aNotification.style.marginTop = margin.toFixed(4) + "px"; if (opacitychange) aNotification.style.opacity = Number(aNotification.style.opacity) + framesToHandle * opacitychange; return; } clearInterval(self._timer); self._timer = null; if (self._closedNotification) { self.removeChild(self._closedNotification); self._closedNotification = null; } self._setBlockingState(self.currentNotification); } var args = {}; this._timer = setInterval(slide, FRAME_LENGTH, this, args); args.timer = this._timer; ]]> 0 document.getAnonymousElementByAttribute(this, "anonid", "button"); document.getAnonymousElementByAttribute(this, "anonid", "menupopup");