Current File : /home/pacjaorg/public_html/kmm/media/vendor/codemirror/addon/scroll/annotatescrollbar.min.js
(function(l){typeof exports=="object"&&typeof module=="object"?l(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],l):l(CodeMirror)})(function(l){"use strict";l.defineExtension("annotateScrollbar",function(e){return typeof e=="string"&&(e={className:e}),new h(this,e)}),l.defineOption("scrollButtonHeight",0);function h(e,t){this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=e.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();function a(r){clearTimeout(i.doRedraw),i.doRedraw=setTimeout(function(){i.redraw()},r)}var i=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(i.doUpdate),i.doUpdate=setTimeout(function(){i.computeScale()&&a(20)},100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),t.listenForChanges!==!1&&e.on("changes",this.changeHandler=function(){a(250)})}h.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-this.buttonHeight*2)/e.getScrollerElement().scrollHeight;if(t!=this.hScale)return this.hScale=t,!0},h.prototype.update=function(e){this.annotations=e,this.redraw()},h.prototype.redraw=function(e){e!==!1&&this.computeScale();var t=this.cm,a=this.hScale,i=document.createDocumentFragment(),r=this.annotations,H=t.getOption("lineWrapping"),y=H&&t.defaultTextHeight()*1.5,u=null,n=null;function d(f,w){if(u!=f.line){u=f.line,n=t.getLineHandle(f.line);var v=t.getLineHandleVisualStart(n);v!=n&&(u=t.getLineNumber(v),n=v)}if(n.widgets&&n.widgets.length||H&&n.height>y)return t.charCoords(f,"local")[w?"top":"bottom"];var x=t.heightAtLine(n,"local");return x+(w?0:n.height)}var b=t.lastLine();if(t.display.barWidth)for(var o=0,g;o<r.length;o++){var s=r[o];if(!(s.to.line>b)){for(var p=g||d(s.from,!0)*a,c=d(s.to,!1)*a;o<r.length-1&&!(r[o+1].to.line>b||(g=d(r[o+1].from,!0)*a,g>c+.9));)s=r[++o],c=d(s.to,!1)*a;if(c!=p){var S=Math.max(c-p,3),m=i.appendChild(document.createElement("div"));m.style.cssText="position: absolute; right: 0px; width: "+Math.max(t.display.barWidth-1,2)+"px; top: "+(p+this.buttonHeight)+"px; height: "+S+"px",m.className=this.options.className,s.id&&m.setAttribute("annotation-id",s.id)}}}this.div.textContent="",this.div.appendChild(i)},h.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("changes",this.changeHandler),this.div.parentNode.removeChild(this.div)}});
Site is undergoing maintenance

PACJA Events

Maintenance mode is on

Site will be available soon. Thank you for your patience!