PageSourceSearch

https://www.ul.se/Scripts/custom/infobox.min.js

js ul.se collected 2026-09-24 09:06:12 UTC 10,229 bytes, 1 lines download raw bytes

1function InfoBox(a) { a = a || {}, google.maps.OverlayView.apply(this, arguments), this.content_ = a.content || "", this.disableAutoPan_ = a.disableAutoPan || !1, this.maxWidth_ = a.maxWidth || 0, this.pixelOffset_ = a.pixelOffset || new google.maps.Size(0, 0), this.position_ = a.position || new google.maps.LatLng(0, 0), this.zIndex_ = a.zIndex || null, this.boxClass_ = a.boxClass || "infoBox", this.boxStyle_ = a.boxStyle || {}, this.closeBoxMargin_ = a.closeBoxMargin || "2px", this.closeBoxURL_ = a.closeBoxURL || "http://www.google.com/intl/en_us/mapfiles/close.gif", "" === a.closeBoxURL && (this.closeBoxURL_ = ""), this.infoBoxClearance_ = a.infoBoxClearance || new google.maps.Size(1, 1), void 0 === a.visible && (void 0 === a.isHidden ? a.visible = !0 : a.visible = !a.isHidden), this.isHidden_ = !a.visible, this.alignBottom_ = a.alignBottom || !1, this.pane_ = a.pane || "floatPane", this.enableEventPropagation_ = a.enableEventPropagation || !1, this.div_ = null, this.closeListener_ = null, this.moveListener_ = null, this.mapListener_ = null, this.contextListener_ = null, this.eventListeners_ = null, this.fixedWidthSet_ = null } InfoBox.prototype = new google.maps.OverlayView, InfoBox.prototype.createInfoBoxDiv_ = function () { var a, b, c, d = this, e = function (a) { a.cancelBubble = !0, a.stopPropagation && a.stopPropagation() }, f = function (a) { a.returnValue = !1, a.preventDefault && a.preventDefault(), d.enableEventPropagation_ || e(a) }; if (!this.div_) { if (this.div_ = document.createElement("div"), this.setBoxStyle_(), void 0 === this.content_.nodeType ? this.div_.innerHTML = this.getCloseBoxImg_() + this.content_ : (this.div_.innerHTML = this.getCloseBoxImg_(), this.div_.appendChild(this.content_)), this.getPanes()[this.pane_].appendChild(this.div_), this.addClickHandler_(), this.div_.style.width ? this.fixedWidthSet_ = !0 : 0 !== this.maxWidth_ && this.div_.offsetWidth > this.maxWidth_ ? (this.div_.style.width = this.maxWidth_, this.div_.style.overflow = "auto", this.fixedWidthSet_ = !0) : (c = this.getBoxWidths_(), this.div_.style.width = this.div_.offsetWidth - c.left - c.right + "px", this.fixedWidthSet_ = !1), this.panBox_(this.disableAutoPan_), !this.enableEventPropagation_) { for (this.eventListeners_ = [], b = ["mousedown", "mouseover", "mouseout", "mouseup", "click", "dblclick", "touchstart", "touchend", "touchmove"], a = 0; a < b.length; a++) this.eventListeners_.push(google.maps.event.addDomListener(this.div_, b[a], e)); this.eventListeners_.push(google.maps.event.addDomListener(this.div_, "mouseover", function (a) { this.style.cursor = "default" })) } this.contextListener_ = google.maps.event.addDomListener(this.div_, "contextmenu", f), google.maps.event.trigger(this, "domready") } }, InfoBox.prototype.getCloseBoxImg_ = function () { var a = ""; return "" !== this.closeBoxURL_ && (a = "<img", a += " src='" + this.closeBoxURL_ + "'", a += " align=right", a += " style='", a += " position: relative;", a += " cursor: pointer;", a += " margin: " + this.closeBoxMargin_ + ";", a += "'>"), a }, InfoBox.prototype.addClickHandler_ = function () { var a; "" !== this.closeBoxURL_ ? (a = this.div_.firstChild, this.closeListener_ = google.maps.event.addDomListener(a, "click", this.getCloseClickHandler_())) : this.closeListener_ = null }, InfoBox.prototype.getCloseClickHandler_ = function () { var a = this; return function (b) { b.cancelBubble = !0, b.stopPropagation && b.stopPropagation(), google.maps.event.trigger(a, "closeclick"), a.close() } }, InfoBox.prototype.panBox_ = function (a) { var b, d = 0, e = 0; if (!a && (b = this.getMap()) instanceof google.maps.Map) { b.getBounds().contains(this.position_) || b.setCenter(this.position_), b.getBounds(); var f = b.getDiv(), g = f.offsetWidth, h = f.offsetHeight, i = this.pixelOffset_.width, j = this.pixelOffset_.height, k = this.div_.offsetWidth, l = this.div_.offsetHeight, m = this.infoBoxClearance_.width, n = this.infoBoxClearance_.height, o = this.getProjection().fromLatLngToContainerPixel(this.position_); if (o.x < -i + m ? d = o.x + i - m : o.x + k + i + m > g && (d = o.x + k + i + m - g), this.alignBottom_ ? o.y < -j + n + l ? e = o.y + j - n - l : o.y + j + n > h && (e = o.y + j + n - h) : o.y < -j + n ? e = o.y + j - n : o.y + l + j + n > h && (e = o.y + l + j + n - h), 0 !== d || 0 !== e) { b.getCenter(); b.panBy(d, e) } } }, InfoBox.prototype.setBoxStyle_ = function () { var a, b; if (this.div_) { this.div_.className = this.boxClass_, this.div_.style.cssText = "", b = this.boxStyle_; for (a in b) b.hasOwnProperty(a) && (this.div_.style[a] = b[a]); this.div_.style.WebkitTransform = "translateZ(0)", void 0 !== this.div_.style.opacity && "" !== this.div_.style.opacity && (this.div_.style.MsFilter = '"progid:DXImageTransform.Microsoft.Alpha(Opacity=' + 100 * this.div_.style.opacity + ')"', this.div_.style.filter = "alpha(opacity=" + 100 * this.div_.style.opacity + ")"), this.div_.style.position = "absolute", this.div_.style.visibility = "hidden", null !== this.zIndex_ && (this.div_.style.zIndex = this.zIndex_) } }, InfoBox.prototype.getBoxWidths_ = function () { var a, b = { top: 0, bottom: 0, left: 0, right: 0 }, c = this.div_; return document.defaultView && document.defaultView.getComputedStyle ? (a = c.ownerDocument.defaultView.getComputedStyle(c, "")) && (b.top = parseInt(a.borderTopWidth, 10) || 0, b.bottom = parseInt(a.borderBottomWidth, 10) || 0, b.left = parseInt(a.borderLeftWidth, 10) || 0, b.right = parseInt(a.borderRightWidth, 10) || 0) : document.documentElement.currentStyle && c.currentStyle && (b.top = parseInt(c.currentStyle.borderTopWidth, 10) || 0, b.bottom = parseInt(c.currentStyle.borderBottomWidth, 10) || 0, b.left = parseInt(c.currentStyle.borderLeftWidth, 10) || 0, b.right = parseInt(c.currentStyle.borderRightWidth, 10) || 0), b }, InfoBox.prototype.onRemove = function () { this.div_ && (this.div_.parentNode.removeChild(this.div_), this.div_ = null) }, InfoBox.prototype.draw = function () { this.createInfoBoxDiv_(); var a = this.getProjection().fromLatLngToDivPixel(this.position_); this.div_.style.left = a.x + this.pixelOffset_.width + "px", this.alignBottom_ ? this.div_.style.bottom = -(a.y + this.pixelOffset_.height) + "px" : this.div_.style.top = a.y + this.pixelOffset_.height + "px", this.isHidden_ ? this.div_.style.visibility = "hidden" : this.div_.style.visibility = "visible" }, InfoBox.prototype.setOptions = function (a) { void 0 !== a.boxClass && (this.boxClass_ = a.boxClass, this.setBoxStyle_()), void 0 !== a.boxStyle && (this.boxStyle_ = a.boxStyle, this.setBoxStyle_()), void 0 !== a.content && this.setContent(a.content), void 0 !== a.disableAutoPan && (this.disableAutoPan_ = a.disableAutoPan), void 0 !== a.maxWidth && (this.maxWidth_ = a.maxWidth), void 0 !== a.pixelOffset && (this.pixelOffset_ = a.pixelOffset), void 0 !== a.alignBottom && (this.alignBottom_ = a.alignBottom), void 0 !== a.position && this.setPosition(a.position), void 0 !== a.zIndex && this.setZIndex(a.zIndex), void 0 !== a.closeBoxMargin && (this.closeBoxMargin_ = a.closeBoxMargin), void 0 !== a.closeBoxURL && (this.closeBoxURL_ = a.closeBoxURL), void 0 !== a.infoBoxClearance && (this.infoBoxClearance_ = a.infoBoxClearance), void 0 !== a.isHidden && (this.isHidden_ = a.isHidden), void 0 !== a.visible && (this.isHidden_ = !a.visible), void 0 !== a.enableEventPropagation && (this.enableEventPropagation_ = a.enableEventPropagation), this.div_ && this.draw() }, InfoBox.prototype.setContent = function (a) { this.content_ = a, this.div_ && (this.closeListener_ && (google.maps.event.removeListener(this.closeListener_), this.closeListener_ = null), this.fixedWidthSet_ || (this.div_.style.width = ""), void 0 === a.nodeType ? this.div_.innerHTML = this.getCloseBoxImg_() + a : (this.div_.innerHTML = this.getCloseBoxImg_(), this.div_.appendChild(a)), this.fixedWidthSet_ || (this.div_.style.width = this.div_.offsetWidth + "px", void 0 === a.nodeType ? this.div_.innerHTML = this.getCloseBoxImg_() + a : (this.div_.innerHTML = this.getCloseBoxImg_(), this.div_.appendChild(a))), this.addClickHandler_()), google.maps.event.trigger(this, "content_changed") }, InfoBox.prototype.setPosition = function (a) { this.position_ = a, this.div_ && this.draw(), google.maps.event.trigger(this, "position_changed") }, InfoBox.prototype.setZIndex = function (a) { this.zIndex_ = a, this.div_ && (this.div_.style.zIndex = a), google.maps.event.trigger(this, "zindex_changed") }, InfoBox.prototype.setVisible = function (a) { this.isHidden_ = !a, this.div_ && (this.div_.style.visibility = this.isHidden_ ? "hidden" : "visible") }, InfoBox.prototype.getContent = function () { return this.content_ }, InfoBox.prototype.getPosition = function () { return this.position_ }, InfoBox.prototype.getZIndex = function () { return this.zIndex_ }, InfoBox.prototype.getVisible = function () { return void 0 !== this.getMap() && null !== this.getMap() && !this.isHidden_ }, InfoBox.prototype.show = function () { this.isHidden_ = !1, this.div_ && (this.div_.style.visibility = "visible") }, InfoBox.prototype.hide = function () { this.isHidden_ = !0, this.div_ && (this.div_.style.visibility = "hidden") }, InfoBox.prototype.open = function (a, b) { var c = this; b && (this.position_ = b.getPosition(), this.moveListener_ = google.maps.event.addListener(b, "position_changed", function () { c.setPosition(this.getPosition()) }), this.mapListener_ = google.maps.event.addListener(b, "map_changed", function () { c.setMap(this.map) })), this.setMap(a), this.div_ && this.panBox_() }, InfoBox.prototype.close = function () { var a; if (this.closeListener_ && (google.maps.event.removeListener(this.closeListener_), this.closeListener_ = null), this.eventListeners_) { for (a = 0; a < this.eventListeners_.length; a++) google.maps.event.removeListener(this.eventListeners_[a]); this.eventListeners_ = null } this.moveListener_ && (google.maps.event.removeListener(this.moveListener_), this.moveListener_ = null), this.mapListener_ && (google.maps.event.removeListener(this.mapListener_), this.mapListener_ = null), this.contextListener_ && (google.maps.event.removeListener(this.contextListener_), this.contextListener_ = null), this.setMap(null) };

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.