PageSourceSearch

https://peski13.ru/bitrix/js/main/core/core_popup.min.js

js peski13.ru collected 2026-10-08 10:21:40 UTC 28,778 bytes, 2 lines download raw bytes

1(function(t){if(BX.PopupWindowManager)return;BX.PopupWindowManager={_popups:[],_currentPopup:null,create:function(t,e,i){var o=-1;if((o=this._getPopupIndex(t))!==-1)return this._popups[o];var s=new BX.PopupWindow(t,e,i);BX.addCustomEvent(s,"onPopupShow",BX.delegate(this.onPopupShow,this));BX.addCustomEvent(s,"onPopupClose",BX.delegate(this.onPopupClose,this));BX.addCustomEvent(s,"onPopupDestroy",BX.delegate(this.onPopupDestroy,this));this._popups.push(s);return s},onPopupShow:function(t){if(this._currentPopup!==null)this._currentPopup.close();this._currentPopup=t},onPopupClose:function(t){this._currentPopup=null},onPopupDestroy:function(t){var e=-1;if((e=this._getPopupIndex(t.uniquePopupId))!==-1)this._popups=BX.util.deleteFromArray(this._popups,e)},getCurrentPopup:function(){return this._currentPopup},isPopupExists:function(t){return this._getPopupIndex(t)!==-1},_getPopupIndex:function(t){var e=-1;for(var i=0;i<this._popups.length;i++)if(this._popups[i].uniquePopupId==t)return i;return e}};BX.PopupWindow=function(e,i,o){BX.onCustomEvent("onPopupWindowInit",[e,i,o]);this.uniquePopupId=e;this.params=o||{};this.params.zIndex=parseInt(this.params.zIndex);this.params.zIndex=isNaN(this.params.zIndex)?0:this.params.zIndex;this.buttons=this.params.buttons&&BX.type.isArray(this.params.buttons)?this.params.buttons:[];this.offsetTop=BX.PopupWindow.getOption("offsetTop");this.offsetLeft=BX.PopupWindow.getOption("offsetLeft");this.firstShow=false;this.bordersWidth=20;this.bindElementPos=null;this.closeIcon=null;this.angle=null;this.overlay=null;this.titleBar=null;this.bindOptions=typeof this.params.bindOptions=="object"?this.params.bindOptions:{};this.isAutoHideBinded=false;this.closeByEsc=!!this.params.closeByEsc;this.isCloseByEscBinded=false;this.dragged=false;this.dragPageX=0;this.dragPageY=0;if(this.params.events){for(var s in this.params.events)BX.addCustomEvent(this,s,this.params.events[s])}this.popupContainer=document.createElement("DIV");BX.adjust(this.popupContainer,{props:{id:e},style:{zIndex:this.getZindex(),position:"absolute",display:"none",top:"0px",left:"0px"}});if(o.darkMode){BX.addClass(this.popupContainer,"popup-window-dark")}var n="popup-window";if(o.lightShadow)n+=" popup-window-light";if(o.titleBar)n+=o.lightShadow?" popup-window-titlebar-light":" popup-window-titlebar";if(o.className&&BX.type.isNotEmptyString(o.className))n+=" "+o.className;this.popupContainer.innerHTML=['<table class="',n,'" cellspacing="0"> 		<tr class="popup-window-top-row"> 			<td class="popup-window-left-column"><div class="popup-window-left-spacer"></div></td> 			<td class="popup-window-center-column">',o.titleBar?'<div class="popup-window-titlebar" id="popup-window-titlebar-'+e+'"></div>':"",'</td> 			<td class="popup-window-right-column"><div class="popup-window-right-spacer"></div></td> 		</tr> 		<tr class="popup-window-content-row"> 			<td class="popup-window-left-column"></td> 			<td class="popup-window-center-column"><div class="popup-window-content" id="popup-window-content-',e,'"> 			</div></td> 			<td class="popup-window-right-column"></td> 		</tr> 		<tr class="popup-window-bottom-row"> 			<td class="popup-window-left-column"></td> 			<td class="popup-window-center-column"></td> 			<td class="popup-window-right-column"></td> 		</tr> 	</table>'].join("");document.body.appendChild(this.popupContainer);if(o.closeIcon){this.popupContainer.appendChild(this.closeIcon=BX.create("a",{props:{className:"popup-window-close-icon"+(o.titleBar?" popup-window-titlebar-close-icon":""),href:""},style:typeof o.closeIcon=="object"?o.closeIcon:{},events:{click:BX.proxy(this._onCloseIconClick,this)}}));if(BX.browser.IsIE())BX.adjust(this.closeIcon,{attrs:{hidefocus:"true"}})}this.contentContainer=BX("popup-window-content-"+e);this.titleBar=BX("popup-window-titlebar-"+e);this.buttonsContainer=this.buttonsHr=null;if(o.angle)this.setAngle(o.angle);if(o.overlay)this.setOverlay(o.overlay);this.setOffset(this.params);this.setBindElement(i);this.setTitleBar(this.params.titleBar);this.setContent(this.params.content);this.setButtons(this.params.buttons);if(this.params.bindOnResize!==false){BX.bind(t,"resize",BX.proxy(this._onResizeWindow,this))}};BX.PopupWindow.prototype.setContent=function(t){if(!this.contentContainer||!t)return;if(BX.type.isElementNode(t)){BX.cleanNode(this.contentContainer);this.contentContainer.appendChild(t.parentNode?t.parentNode.removeChild(t):t);t.style.display="block"}else if(BX.type.isString(t)){this.contentContainer.innerHTML=t}else this.contentContainer.innerHTML="&nbsp;"};BX.PopupWindow.prototype.setButtons=function(t){this.buttons=t&&BX.type.isArray(t)?t:[];if(this.buttonsHr)BX.remove(this.buttonsHr);if(this.buttonsContainer)BX.remove(this.buttonsContainer);if(this.buttons.length>0&&this.contentContainer){var e=[];for(var i=0;i<this.buttons.length;i++){var o=this.buttons[i];if(o==null||!BX.is_subclass_of(o,BX.PopupWindowButton))continue;o.popupWindow=this;e.push(o.render())}this.buttonsHr=this.contentContainer.parentNode.appendChild(BX.create("div",{props:{className:"popup-window-hr popup-window-buttons-hr"},children:[BX.create("i",{})]}));this.buttonsContainer=this.contentContainer.parentNode.appendChild(BX.create("div",{props:{className:"popup-window-buttons"},children:e}))}};BX.PopupWindow.prototype.setBindElement=function(t){if(!t||typeof t!="object")return;if(BX.type.isDomNode(t)||BX.type.isNumber(t.top)&&BX.type.isNumber(t.left))this.bindElement=t;else if(BX.type.isNumber(t.clientX)&&BX.type.isNumber(t.clientY)){BX.fixEventPageXY(t);this.bindElement={left:t.pageX,top:t.pageY,bottom:t.pageY}}};BX.PopupWindow.prototype.getBindElementPos=function(t){if(BX.type.isDomNode(t)){return BX.pos(t,false)}else if(t&&typeof t=="object"){if(!BX.type.isNumber(t.bottom))t.bottom=t.top;return t}else{var e=BX.GetWindowInnerSize();var i=BX.GetWindowScrollPos();var o=this.popupContainer.offsetWidth;var s=this.popupContainer.offsetHeight;this.bindOptions.forceTop=true;
1return{left:e.innerWidth/2-o/2+i.scrollLeft,top:e.innerHeight/2-s/2+i.scrollTop,bottom:e.innerHeight/2-s/2+i.scrollTop,windowSize:e,windowScroll:i,popupWidth:o,popupHeight:s}}};BX.PopupWindow.prototype.setAngle=function(t){var e=this.params.lightShadow?"popup-window-light-angly":"popup-window-angly";if(this.angle==null){var i=this.bindOptions.position&&this.bindOptions.position=="top"?"bottom":"top";var o=BX.PopupWindow.getOption(i=="top"?"angleMinTop":"angleMinBottom");var s=BX.type.isNumber(t.offset)?t.offset:0;var n=BX.PopupWindow.getOption("angleLeftOffset",null);if(s>0&&BX.type.isNumber(n))s+=n-BX.PopupWindow.defaultOptions.angleLeftOffset;this.angle={element:BX.create("div",{props:{className:e+" "+e+"-"+i}}),position:i,offset:0,defaultOffset:Math.max(s,o)};this.popupContainer.appendChild(this.angle.element)}if(typeof t=="object"&&t.position&&BX.util.in_array(t.position,["top","right","bottom","left","hide"])){BX.removeClass(this.angle.element,e+"-"+this.angle.position);BX.addClass(this.angle.element,e+"-"+t.position);this.angle.position=t.position}if(typeof t=="object"&&BX.type.isNumber(t.offset)){var p=t.offset;var a,u;if(this.angle.position=="top"){a=BX.PopupWindow.getOption("angleMinTop");u=this.popupContainer.offsetWidth-BX.PopupWindow.getOption("angleMaxTop");u=u<a?Math.max(a,p):u;this.angle.offset=Math.min(Math.max(a,p),u);this.angle.element.style.left=this.angle.offset+"px";this.angle.element.style.marginLeft="auto"}else if(this.angle.position=="bottom"){a=BX.PopupWindow.getOption("angleMinBottom");u=this.popupContainer.offsetWidth-BX.PopupWindow.getOption("angleMaxBottom");u=u<a?Math.max(a,p):u;this.angle.offset=Math.min(Math.max(a,p),u);this.angle.element.style.marginLeft=this.angle.offset+"px";this.angle.element.style.left="auto"}else if(this.angle.position=="right"){a=BX.PopupWindow.getOption("angleMinRight");u=this.popupContainer.offsetHeight-BX.PopupWindow.getOption("angleMaxRight");u=u<a?Math.max(a,p):u;this.angle.offset=Math.min(Math.max(a,p),u);this.angle.element.style.top=this.angle.offset+"px"}else if(this.angle.position=="left"){a=BX.PopupWindow.getOption("angleMinLeft");u=this.popupContainer.offsetHeight-BX.PopupWindow.getOption("angleMaxLeft");u=u<a?Math.max(a,p):u;this.angle.offset=Math.min(Math.max(a,p),u);this.angle.element.style.top=this.angle.offset+"px"}}};BX.PopupWindow.prototype.isTopAngle=function(){return this.angle!=null&&this.angle.position=="top"};BX.PopupWindow.prototype.isBottomAngle=function(){return this.angle!=null&&this.angle.position=="bottom"};BX.PopupWindow.prototype.isTopOrBottomAngle=function(){return this.angle!=null&&BX.util.in_array(this.angle.position,["top","bottom"])};BX.PopupWindow.prototype.getAngleHeight=function(){return this.isTopOrBottomAngle()?BX.PopupWindow.getOption("angleTopOffset"):0};BX.PopupWindow.prototype.setOffset=function(t){if(typeof t!="object")return;if(t.offsetLeft&&BX.type.isNumber(t.offsetLeft))this.offsetLeft=t.offsetLeft+BX.PopupWindow.getOption("offsetLeft");if(t.offsetTop&&BX.type.isNumber(t.offsetTop))this.offsetTop=t.offsetTop+BX.PopupWindow.getOption("offsetTop")};BX.PopupWindow.prototype.setTitleBar=function(t){if(!this.titleBar||typeof t!="object"||!BX.type.isDomNode(t.content))return;this.titleBar.innerHTML="";this.titleBar.appendChild(t.content);if(this.params.draggable){this.titleBar.parentNode.style.cursor="move";BX.bind(this.titleBar.parentNode,"mousedown",BX.proxy(this._startDrag,this))}};BX.PopupWindow.prototype.setClosingByEsc=function(t){t=!!t;if(t){this.closeByEsc=true;if(!this.isCloseByEscBinded){BX.bind(document,"keyup",BX.proxy(this._onKeyUp,this));this.isCloseByEscBinded=true}}else{this.closeByEsc=false;if(this.isCloseByEscBinded){BX.unbind(document,"keyup",BX.proxy(this._onKeyUp,this));this.isCloseByEscBinded=false}}};BX.PopupWindow.prototype.setOverlay=function(t){if(this.overlay==null){this.overlay={element:BX.create("div",{props:{className:"popup-window-overlay",id:"popup-window-overlay-"+this.uniquePopupId}})};this.adjustOverlayZindex();this.resizeOverlay();document.body.appendChild(this.overlay.element)}if(t&&t.opacity&&BX.type.isNumber(t.opacity)&&t.opacity>=0&&t.opacity<=100){if(BX.browser.IsIE()&&!BX.browser.IsIE9())this.overlay.element.style.filter="alpha(opacity="+t.opacity+")";else{this.overlay.element.style.filter="none";this.overlay.element.style.opacity=parseFloat(t.opacity/100).toPrecision(3)}}if(t&&t.backgroundColor)this.overlay.element.style.backgroundColor=t.backgroundColor};BX.PopupWindow.prototype.removeOverlay=function(){if(this.overlay!=null&&this.overlay.element!=null)BX.remove(this.overlay.element);this.overlay=null};BX.PopupWindow.prototype.hideOverlay=function(){if(this.overlay!=null&&this.overlay.element!=null)this.overlay.element.style.display="none"};BX.PopupWindow.prototype.showOverlay=function(){if(this.overlay!=null&&this.overlay.element!=null)this.overlay.element.style.display="block"};BX.PopupWindow.prototype.resizeOverlay=function(){if(this.overlay!=null&&this.overlay.element!=null){var t=BX.GetWindowScrollSize();this.overlay.element.style.width=t.scrollWidth+"px";this.overlay.element.style.height=t.scrollHeight+"px"}};BX.PopupWindow.prototype.getZindex=function(){if(this.overlay!=null)return BX.PopupWindow.getOption("popupOverlayZindex")+this.params.zIndex;else return BX.PopupWindow.getOption("popupZindex")+this.params.zIndex};BX.PopupWindow.prototype.adjustOverlayZindex=function(){if(this.overlay!=null&&this.overlay.element!=null){this.overlay.element.style.zIndex=parseInt(this.popupContainer.style.zIndex)-1}};BX.PopupWindow.prototype.show=function(){if(!this.firstShow){BX.onCustomEvent(this,"onPopupFirstShow",[this]);this.firstShow=true}BX.onCustomEvent(this,"onPopupShow",[this]);this.showOverlay();this.popupContainer.style.display="block";this.adjustPosition();BX.onCustomEvent(this,"onAfterPopupShow",[this]);if(this.closeByEsc&&!this.isCloseByEscBinded){BX.bind(document,"keyup",BX.proxy(this._onKeyUp,this));this.isCloseByEscBinded=true}if(this.params.autoHide&&!this.isAutoHideBinded){setTimeout(BX.proxy(function(){if(this.isShown()){this.isAutoHideBinded=true;BX.bind(this.popupContainer,"click",this.cancelBubble);BX.bind(document,"click",BX.proxy(this.close,this))}},this),100)}};BX.PopupWindow.prototype.isShown=function(){return this.popupContainer.style.display=="block"};BX.PopupWindow.prototype.cancelBubble=function(e){if(!e)e=t.event;if(e.stopPropagation)e.stopPropagation();else e.cancelBubble=true};BX.PopupWindow.prototype.close=function(t){if(!this.isShown())return;if(t&&!(BX.getEventButton(t)&BX.MSLEFT))return true;BX.onCustomEvent(this,"onPopupClose",[this,t]);this.hideOverlay();this.popupContainer.style.display="none";if(this.isCloseByEscBinded){BX.unbind(document,"keyup",BX.proxy(this._onKeyUp,this));this.isCloseByEscBinded=false}setTimeout(BX.proxy(this._close,this),0)};BX.PopupWindow.prototype._close=function(){if(this.params.autoHide&&this.isAutoHideBinded){this.isAutoHideBinded=false;BX.unbind(this.popupContainer,"click",this.cancelBubble);BX.unbind(document,"click",BX.proxy(this.close,this))}};BX.PopupWindow.prototype._onCloseIconClick=function(e){e=e||t.event;this.close(e);BX.PreventDefault(e)};BX.PopupWindow.prototype._onKeyUp=function(e){e=e||t.event;if(e.keyCode==27){o(this.getZindex(),BX.proxy(this.close,this))}};BX.PopupWindow.prototype.destroy=function(){BX.onCustomEvent(this,"onPopupDestroy",[this]);BX.unbindAll(this);BX.unbind(document,"keyup",BX.proxy(this._onKeyUp,this));BX.unbind(document,"click",BX.proxy(this.close,this));BX.unbind(document,"mousemove",BX.proxy(this._moveDrag,this));BX.unbind(document,"mouseup",BX.proxy(this._stopDrag,this));BX.unbind(t,"resize",BX.proxy(this._onResizeWindow,this));BX.remove(this.popupContainer);this.removeOverlay()};BX.PopupWindow.prototype.adjustPosition=function(t){if(t&&typeof t=="object")this.bindOptions=t;var e=this.getBindElementPos(this.bindElement);if(!this.bindOptions.forceBindPosition&&this.bindElementPos!=null&&e.top==this.bindElementPos.top&&e.left==this.bindElementPos.left)return;this.bindElementPos=e;var i=e.windowSize?e.windowSize:BX.GetWindowInnerSize();var o=e.windowScroll?e.windowScroll:BX.GetWindowScrollPos();var s=e.popupWidth?e.popupWidth:this.popupContainer.offsetWidth;var n=e.popupHeight?e.popupHeight:this.popupContainer.offsetHeight;var p=BX.PopupWindow.getOption("angleTopOffset");var a=this.bindElementPos.left+this.offsetLeft-(this.isTopOrBottomAngle()?BX.PopupWindow.getOption("angleLeftOffset"):0);if(!this.bindOptions.forceLeft&&a+s+this.bordersWidth>=i.innerWidth+o.scrollLeft&&i.innerWidth+o.scrollLeft-s-this.bordersWidth>0){var u=a;a=i.innerWidth+o.scrollLeft-s-this.bordersWidth;
1if(this.isTopOrBottomAngle()){this.setAngle({offset:u-a+this.angle.defaultOffset})}}else if(this.isTopOrBottomAngle()){this.setAngle({offset:this.angle.defaultOffset+(a<0?a:0)})}if(a<0)a=0;var l=0;if(this.bindOptions.position&&this.bindOptions.position=="top"){l=this.bindElementPos.top-n-this.offsetTop-(this.isBottomAngle()?p:0);if(l<0||!this.bindOptions.forceTop&&l<o.scrollTop){l=this.bindElementPos.bottom+this.offsetTop;if(this.angle!=null){l+=p;this.setAngle({position:"top"})}}else if(this.isTopAngle()){l=l-p+BX.PopupWindow.getOption("positionTopXOffset");this.setAngle({position:"bottom"})}else{l+=BX.PopupWindow.getOption("positionTopXOffset")}}else{l=this.bindElementPos.bottom+this.offsetTop+this.getAngleHeight();if(!this.bindOptions.forceTop&&l+n>i.innerHeight+o.scrollTop&&this.bindElementPos.top-n-this.getAngleHeight()>=0){l=this.bindElementPos.top-n;if(this.isTopOrBottomAngle()){l-=p;this.setAngle({position:"bottom"})}l+=BX.PopupWindow.getOption("positionTopXOffset")}else if(this.isBottomAngle()){l+=p;this.setAngle({position:"top"})}}if(l<0)l=0;BX.adjust(this.popupContainer,{style:{top:l+"px",left:a+"px",zIndex:this.getZindex()}});this.adjustOverlayZindex()};BX.PopupWindow.prototype._onResizeWindow=function(t){if(this.isShown()){this.adjustPosition();if(this.overlay!=null)this.resizeOverlay()}};BX.PopupWindow.prototype.move=function(t,e){var i=parseInt(this.popupContainer.style.left)+t;var o=parseInt(this.popupContainer.style.top)+e;if(typeof this.params.draggable=="object"&&this.params.draggable.restrict){if(i<0)i=0;var s=BX.GetWindowScrollSize();var n=this.popupContainer.offsetWidth;var p=this.popupContainer.offsetHeight;if(i>s.scrollWidth-n)i=s.scrollWidth-n;if(o>s.scrollHeight-p)o=s.scrollHeight-p;if(o<0)o=0}this.popupContainer.style.left=i+"px";this.popupContainer.style.top=o+"px"};BX.PopupWindow.prototype._startDrag=function(e){e=e||t.event;BX.fixEventPageXY(e);this.dragPageX=e.pageX;this.dragPageY=e.pageY;this.dragged=false;BX.bind(document,"mousemove",BX.proxy(this._moveDrag,this));BX.bind(document,"mouseup",BX.proxy(this._stopDrag,this));if(document.body.setCapture)document.body.setCapture();document.body.ondrag=BX.False;document.body.onselectstart=BX.False;document.body.style.cursor="move";document.body.style.MozUserSelect="none";this.popupContainer.style.MozUserSelect="none";return BX.PreventDefault(e)};BX.PopupWindow.prototype._moveDrag=function(e){e=e||t.event;BX.fixEventPageXY(e);if(this.dragPageX==e.pageX&&this.dragPageY==e.pageY)return;this.move(e.pageX-this.dragPageX,e.pageY-this.dragPageY);this.dragPageX=e.pageX;this.dragPageY=e.pageY;if(!this.dragged){BX.onCustomEvent(this,"onPopupDragStart");this.dragged=true}BX.onCustomEvent(this,"onPopupDrag")};BX.PopupWindow.prototype._stopDrag=function(t){if(document.body.releaseCapture)document.body.releaseCapture();BX.unbind(document,"mousemove",BX.proxy(this._moveDrag,this));BX.unbind(document,"mouseup",BX.proxy(this._stopDrag,this));document.body.ondrag=null;document.body.onselectstart=null;document.body.style.cursor="";document.body.style.MozUserSelect="";this.popupContainer.style.MozUserSelect="";BX.onCustomEvent(this,"onPopupDragEnd");this.dragged=false;return BX.PreventDefault(t)};BX.PopupWindow.options={};BX.PopupWindow.defaultOptions={angleLeftOffset:15,positionTopXOffset:0,angleTopOffset:8,popupZindex:1e3,popupOverlayZindex:1100,angleMinLeft:10,angleMaxLeft:10,angleMinRight:10,angleMaxRight:10,angleMinBottom:7,angleMaxBottom:25,angleMinTop:7,angleMaxTop:25,offsetLeft:0,offsetTop:0};BX.PopupWindow.setOptions=function(t){if(!t||typeof t!="object")return;for(var e in t)BX.PopupWindow.options[e]=t[e]};BX.PopupWindow.getOption=function(t,e){if(typeof BX.PopupWindow.options[t]!="undefined")return BX.PopupWindow.options[t];else if(typeof e!="undefined")return e;else return BX.PopupWindow.defaultOptions[t]};BX.PopupWindowButton=function(t){this.popupWindow=null;this.params=t||{};this.text=this.params.text||"";this.id=this.params.id||"";this.className=this.params.className||"";this.events=this.params.events||{};this.contextEvents={};for(var e in this.events)this.contextEvents[e]=BX.proxy(this.events[e],this);this.nameNode=BX.create("span",{props:{className:"popup-window-button-text"},text:this.text});this.buttonNode=BX.create("span",{props:{className:"popup-window-button"+(this.className.length>0?" "+this.className:""),id:this.id},children:[BX.create("span",{props:{className:"popup-window-button-left"}}),this.nameNode,BX.create("span",{props:{className:"popup-window-button-right"}})],events:this.contextEvents})};BX.PopupWindowButton.prototype.render=function(){return this.buttonNode};BX.PopupWindowButton.prototype.setName=function(t){this.text=t||"";if(this.nameNode){BX.cleanNode(this.nameNode);BX.adjust(this.nameNode,{text:this.text})}};BX.PopupWindowButton.prototype.setClassName=function(t){if(this.buttonNode){if(BX.type.isString(this.className)&&this.className!="")BX.removeClass(this.buttonNode,this.className);BX.addClass(this.buttonNode,t)}this.className=t};BX.PopupWindowButtonLink=function(t){BX.PopupWindowButtonLink.superclass.constructor.apply(this,arguments);this.nameNode=BX.create("span",{props:{className:"popup-window-button-link-text"},text:this.text,events:this.contextEvents});this.buttonNode=BX.create("span",{props:{className:"popup-window-button popup-window-button-link"+(this.className.length>0?" "+this.className:""),id:this.id},children:[this.nameNode]})};BX.extend(BX.PopupWindowButtonLink,BX.PopupWindowButton);BX.PopupMenu={Data:{}
1,currentItem:null,show:function(t,e,i,o){if(this.currentItem!==null){this.currentItem.popupWindow.close()}this.currentItem=this.create(t,e,i,o);this.currentItem.popupWindow.show()},create:function(t,e,i,o){if(!this.Data[t]){this.Data[t]=new BX.PopupMenuWindow(t,e,i,o)}return this.Data[t]},getCurrentMenu:function(){return this.currentItem},getMenuById:function(t){return this.Data[t]?this.Data[t]:null},destroy:function(t){var e=this.getMenuById(t);if(e){if(this.currentItem==e){this.currentItem=null}e.popupWindow.destroy();delete this.Data[t]}}};BX.PopupMenuWindow=function(t,e,i,o){this.id=t;this.bindElement=e;this.menuItems=[];this.itemsContainer=null;if(i&&BX.type.isArray(i)){for(var s=0;s<i.length;s++){this.__addMenuItem(i[s],null)}}this.params=o&&typeof o=="object"?o:{};this.popupWindow=this.__createPopup()};BX.PopupMenuWindow.prototype.__createItem=function(t,e){if(e>0){t.layout.hr=BX.create("div",{props:{className:"popup-window-hr"},children:[BX.create("i",{})]})}if(t.delimiter){t.layout.item=BX.create("span",{props:{className:"popup-window-delimiter"},html:"<i></i>"})}else{t.layout.item=BX.create(!!t.href?"a":"span",{props:{className:"menu-popup-item"+(BX.type.isNotEmptyString(t.className)?" "+t.className:" menu-popup-no-icon")},attrs:{title:t.title?t.title:"",onclick:t.onclick&&BX.type.isString(t.onclick)?t.onclick:"",target:t.target?t.target:""},events:t.onclick&&BX.type.isFunction(t.onclick)?{click:BX.proxy(this.onItemClick,{obj:this,item:t})}:null,children:[BX.create("span",{props:{className:"menu-popup-item-left"}}),BX.create("span",{props:{className:"menu-popup-item-icon"}}),t.layout.text=BX.create("span",{props:{className:"menu-popup-item-text"},html:t.text}),BX.create("span",{props:{className:"menu-popup-item-right"}})]});if(t.href)t.layout.item.href=t.href}return t};BX.PopupMenuWindow.prototype.__createPopup=function(){var t=[];for(var e=0;e<this.menuItems.length;e++){this.__createItem(this.menuItems[e],e);if(this.menuItems[e].layout.hr!=null){t.push(this.menuItems[e].layout.hr)}t.push(this.menuItems[e].layout.item)}var i=new BX.PopupWindow("menu-popup-"+this.id,this.bindElement,{closeByEsc:typeof this.params.closeByEsc!="undefined"?this.params.closeByEsc:false,bindOptions:typeof this.params.bindOptions=="object"?this.params.bindOptions:{},angle:typeof this.params.angle!="undefined"?this.params.angle:false,zIndex:this.params.zIndex?this.params.zIndex:0,overlay:typeof this.params.overlay=="object"?this.params.overlay:null,autoHide:typeof this.params.autoHide!="undefined"?this.params.autoHide:true,offsetTop:this.params.offsetTop?this.params.offsetTop:1,offsetLeft:this.params.offsetLeft?this.params.offsetLeft:0,lightShadow:typeof this.params.lightShadow!="undefined"?this.params.lightShadow:true,content:BX.create("div",{props:{className:"menu-popup"},children:[this.itemsContainer=BX.create("div",{props:{className:"menu-popup-items"},children:t})]})});if(this.params&&this.params.events){for(var o in this.params.events){if(this.params.events.hasOwnProperty(o)){BX.addCustomEvent(i,o,this.params.events[o])}}}return i};BX.PopupMenuWindow.prototype.onItemClick=function(e){e=e||t.event;this.item.onclick.call(this.obj,e,this.item)};BX.PopupMenuWindow.prototype.addMenuItem=function(t,e){var i=this.__addMenuItem(t,e);if(i<0){return false}this.__createItem(t,i);var o=this.getMenuItem(e);if(o!=null){if(o.layout.hr==null){o.layout.hr=BX.create("div",{props:{className:"popup-window-hr"},children:[BX.create("i",{})]});this.itemsContainer.insertBefore(o.layout.hr,o.layout.item)}if(t.layout.hr!=null){this.itemsContainer.insertBefore(t.layout.hr,o.layout.hr)}this.itemsContainer.insertBefore(t.layout.item,o.layout.hr)}else{if(t.layout.hr!=null){this.itemsContainer.appendChild(t.layout.hr)}this.itemsContainer.appendChild(t.layout.item)}return true};BX.PopupMenuWindow.prototype.__addMenuItem=function(t,e){if(!t||!t.delimiter&&!BX.type.isNotEmptyString(t.text)||t.id&&this.getMenuItem(t.id)!=null){return-1}t.layout={item:null,text:null,hr:null};var i=this.getMenuItemPosition(e);if(i>=0){this.menuItems=BX.util.insertIntoArray(this.menuItems,i,t)}else{this.menuItems.push(t);i=this.menuItems.length-1}return i};BX.PopupMenuWindow.prototype.removeMenuItem=function(t){var e=this.getMenuItem(t);if(!e){return}for(var i=0;i<this.menuItems.length;i++){if(this.menuItems[i]==e){this.menuItems=BX.util.deleteFromArray(this.menuItems,i);break}}if(i==0){if(this.menuItems[0]){this.menuItems[0].layout.hr.parentNode.removeChild(this.menuItems[0].layout.hr);this.menuItems[0].layout.hr=null}}else{e.layout.hr.parentNode.removeChild(e.layout.hr)}e.layout.item.parentNode.removeChild(e.layout.item);e.layout.item=null};BX.PopupMenuWindow.prototype.getMenuItem=function(t){for(var e=0;e<this.menuItems.length;e++){if(this.menuItems[e].id&&this.menuItems[e].id==t){return this.menuItems[e]}}return null};BX.PopupMenuWindow.prototype.getMenuItemPosition=function(t){if(t){for(var e=0;e<this.menuItems.length;e++){if(this.menuItems[e].id&&this.menuItems[e].id==t){return e}}}return-1};
1t.BXInputPopup=function(t){this.id=t.id||"bx-inp-popup-"+Math.round(Math.random()*1e6);this.handler=t.handler||false;this.values=t.values||false;this.pInput=t.input;this.bValues=!!this.values;this.defaultValue=t.defaultValue||"";this.openTitle=t.openTitle||"";this.className=t.className||"";this.noMRclassName=t.noMRclassName||"ec-no-rm";this.emptyClassName=t.noMRclassName||"ec-label";var e=this;this.curInd=false;if(this.bValues){this.pInput.onfocus=this.pInput.onclick=function(t){if(this.value==e.defaultValue){this.value="";this.className=e.className}e.ShowPopup();return BX.PreventDefault(t)};this.pInput.onblur=function(){if(e.bShowed)setTimeout(function(){e.ClosePopup(true)},200);e.OnChange()}}else{this.pInput.className=this.noMRclassName;this.pInput.onblur=BX.proxy(this.OnChange,this)}};BXInputPopup.prototype={ShowPopup:function(){if(this.bShowed)return;var t=this;if(!this.oPopup){var e,i=BX.create("DIV",{props:{className:"bxecpl-loc-popup "+this.className}});for(var o=0,s=this.values.length;o<s;o++){e=i.appendChild(BX.create("DIV",{props:{id:"bxecmr_"+o},text:this.values[o].NAME,events:{mouseover:function(){BX.addClass(this,"bxecplloc-over")},mouseout:function(){BX.removeClass(this,"bxecplloc-over")},click:function(){var e=this.id.substr("bxecmr_".length);t.pInput.value=t.values[e].NAME;t.curInd=e;t.OnChange();t.ClosePopup(true)}}}));if(this.values[o].DESCRIPTION)e.title=this.values[o].DESCRIPTION;if(this.values[o].CLASS_NAME)BX.addClass(e,this.values[o].CLASS_NAME);if(this.values[o].URL)e.appendChild(BX.create("A",{props:{href:this.values[o].URL,className:"bxecplloc-view",target:"_blank",title:this.openTitle}}))}this.oPopup=new BX.PopupWindow(this.id,this.pInput,{autoHide:true,offsetTop:1,offsetLeft:0,lightShadow:true,closeByEsc:true,content:i});BX.addCustomEvent(this.oPopup,"onPopupClose",BX.proxy(this.ClosePopup,this))}this.oPopup.show();this.pInput.select();this.bShowed=true;BX.onCustomEvent(this,"onInputPopupShow",[this])},ClosePopup:function(t){this.bShowed=false;if(this.pInput.value=="")this.OnChange();BX.onCustomEvent(this,"onInputPopupClose",[this]);if(t===true)this.oPopup.close()},OnChange:function(){var t=this.pInput.value;if(this.bValues){if(this.pInput.value==""||this.pInput.value==this.defaultValue){this.pInput.value=this.defaultValue;this.pInput.className=this.emptyClassName;t=""}else{this.pInput.className=""}}if(isNaN(parseInt(this.curInd))||this.curInd!==false&&t!=this.values[this.curInd].NAME)this.curInd=false;else this.curInd=parseInt(this.curInd);BX.onCustomEvent(this,"onInputPopupChanged",[this,this.curInd,t]);if(this.handler&&typeof this.handler=="function")this.handler({ind:this.curInd,value:t})},Set:function(t,e,i){this.curInd=t;if(this.curInd!==false)this.pInput.value=this.values[this.curInd].NAME;else this.pInput.value=e;if(i!==false)this.OnChange()},Get:function(t){var e=false;if(typeof t=="undefined")t=this.curInd;if(t!==false&&this.values[t])e=this.values[t].ID;return e},GetIndex:function(t){for(var e=0,i=this.values.length;e<i;e++)if(this.values[e].ID==t)return e;return false},Deactivate:function(t){if(this.pInput.value==""||this.pInput.value==this.defaultValue){if(t){this.pInput.value="";this.pInput.className=this.noMRclassName}else if(this.oEC.bUseMR){this.pInput.value=this.defaultValue;this.pInput.className=this.emptyClassName}}this.pInput.disabled=t}};var e=-1,i=null;function o(t,s){if(t===false){if(i&&i.length>0){for(var n=0;n<i.length;n++){i[n]()}i=null;e=-1}}else{if(i===null){i=[];e=-1;BX.defer(o)(false)}if(t>e){e=t;i=[s]}else if(t==e){i.push(s)}}}})(window);
2//# sourceMappingURL=core_popup.map.js

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.