File manager - Edit - /home/c14075/dragmet-ural.ru/www/bitrix/cache/js/s1/aspro_next/kernel_ui_notification/kernel_ui_notification_v1.js
Back
; /* /bitrix/js/ui/notification/ui.notification.balloon.min.js?16609208768858*/ ; /* /bitrix/js/ui/notification/ui.notification.stack.min.js?15736328504742*/ ; /* /bitrix/js/ui/notification/ui.notification.center.min.js?16609208762785*/ ; /* Start:"a:4:{s:4:"full";s:72:"/bitrix/js/ui/notification/ui.notification.balloon.min.js?16609208768858";s:6:"source";s:53:"/bitrix/js/ui/notification/ui.notification.balloon.js";s:3:"min";s:57:"/bitrix/js/ui/notification/ui.notification.balloon.min.js";s:3:"map";s:57:"/bitrix/js/ui/notification/ui.notification.balloon.map.js";}"*/ (function(){"use strict";BX.namespace("BX.UI.Notification");var t={INIT:0,OPENING:1,OPEN:2,CLOSING:3,CLOSED:4,PAUSED:5,QUEUED:6};BX.UI.Notification.State=t;BX.UI.Notification.Balloon=function(i){i=BX.type.isPlainObject(i)?i:Object.create(null);if(!(i.stack instanceof BX.UI.Notification.Stack)){throw new Error("BX.UI.Notification.Balloon: 'stack' parameter is required.")}this.id=BX.type.isNotEmptyString(i.id)?i.id:BX.util.getRandomString(8).toLowerCase();this.stack=i.stack;this.state=t.INIT;this.container=null;this.content=null;this.actions=[];this.animationClassName="ui-notification-balloon-animate";this.customRender=null;this.category=null;this.autoHide=true;this.autoHideDelay=8e3;this.autoHideTimeout=null;this.data={};this.width=400;this.closeButton=null;this.closeButtonVisibility=true;if(BX.type.isPlainObject(i.events)){for(var e in i.events){this.addEvent(e,i.events[e])}}this.setOptions(i)};BX.UI.Notification.Balloon.prototype={show:function(){if(this.getState()===t.OPENING){return}if(this.getState()===t.OPEN){this.activateAutoHide();return}var i=false;if(!this.getContainer().parentNode){i=true;document.body.appendChild(this.getContainer());BX.ZIndexManager.register(this.getContainer(),{alwaysOnTop:true});this.getStack().add(this);if(this.getState()===t.QUEUED){return}}var e=this.getState()===t.PAUSED;this.setState(t.OPENING);this.adjustPosition();BX.ZIndexManager.bringToFront(this.getContainer());this.animateIn(function(){if(this.getState()!==t.OPENING){return}this.setState(t.OPEN);if(i){this.fireEvent("onOpen")}if(!e){this.activateAutoHide()}}.bind(this))},setOptions:function(t){if(!BX.type.isPlainObject(t)){return}this.setContent(t.content);this.setWidth(t.width);this.setData(t.data);this.setCloseButtonVisibility(t.closeButton);this.setActions(t.actions);this.setCategory(t.category);this.setAutoHide(t.autoHide);this.setCustomRender(t.render);this.setAutoHideDelay(t.autoHideDelay)},update:function(t){this.setOptions(t);BX.cleanNode(this.getContainer());this.getContainer().appendChild(this.render());this.deactivateAutoHide();this.activateAutoHide()},close:function(){if(this.getState()===t.CLOSING||this.getState()===t.CLOSED){return}this.setState(t.CLOSING);this.deactivateAutoHide();this.animateOut(function(){if(this.getState()!==t.CLOSING){return}this.setState(t.CLOSED);BX.ZIndexManager.unregister(this.getContainer());BX.remove(this.getContainer());this.container=null;this.fireEvent("onClose")}.bind(this))},blink:function(){var t=this;this.animateOut(function(){setTimeout(function(){t.update(null);t.animateIn(function(){})},200)})},adjustPosition:function(){if(this.getStack().isNewestOnTop()){this.getStack().adjustPosition()}else{this.getStack().adjustPosition(this)}},getId:function(){return this.id},getCloseButton:function(){if(this.closeButton!==null){return this.closeButton}this.closeButton=BX.create("div",{props:{className:"ui-notification-balloon-close-btn"},events:{click:this.handleCloseBtnClick.bind(this)}});return this.closeButton},setCloseButtonVisibility:function(t){this.closeButtonVisibility=t!==false},isCloseButtonVisible:function(){return this.closeButtonVisibility},getContent:function(){return this.content},setContent:function(t){if(BX.type.isString(t)||BX.type.isDomNode(t)){this.content=t}},getWidth:function(){return this.width},setWidth:function(t){if(BX.type.isNumber(t)||t==="auto"){this.width=t}},getZIndex:function(){var t=BX.ZIndexManager.getComponent(this.getContainer());return t?t.getZIndex():0},setZIndex:function(t){},getHeight:function(){return this.getContainer().offsetHeight},getCategory:function(){return this.category},setCategory:function(t){if(BX.type.isNotEmptyString(t)||t===null){this.category=t}},setActions:function(t){if(BX.type.isArray(t)){this.actions=[];t.forEach(function(t){this.actions.push(new BX.UI.Notification.Action(this,t))},this)}else if(t===null){this.actions=[]}},getActions:function(){return this.actions},getAction:function(t){for(var i=0;i<this.actions.length;i++){var e=this.actions[i];if(e.getId()===t){return e}}return null},getContainer:function(){if(this.container!==null){return this.container}this.container=BX.create("div",{props:{className:"ui-notification-balloon"},children:[this.render()],events:{mouseenter:this.handleMouseEnter.bind(this),mouseleave:this.handleMouseLeave.bind(this)}});return this.container},render:function(){if(this.getCustomRender()!==null){return this.getCustomRender().apply(this,[this])}var t=this.getActions().map(function(t){return t.getContainer()});var i=this.getContent();var e=this.getWidth();return BX.create("div",{props:{className:"ui-notification-balloon-content"},style:{width:BX.type.isNumber(e)?e+"px":e},children:[BX.create("div",{props:{className:"ui-notification-balloon-message"},html:BX.type.isDomNode(i)?null:i,children:BX.type.isDomNode(i)?[i]:[]}),BX.create("div",{props:{className:"ui-notification-balloon-actions"},children:t}),this.isCloseButtonVisible()?this.getCloseButton():null]})},setCustomRender:function(t){if(BX.type.isFunction(t)){this.customRender=t}},getCustomRender:function(){return this.customRender},getStack:function(){return this.stack},setState:function(t){var i=this.getStateCode(t);if(i!==null){this.state=t}},getState:function(){return this.state},getStateCode:function(i){for(var e in t){if(t[e]===i){return e}}return null},activateAutoHide:function(){if(!this.getAutoHide()){return}this.deactivateAutoHide();this.autoHideTimeout=setTimeout(function(){this.close()}.bind(this),this.getAutoHideDelay())},deactivateAutoHide:function(){clearTimeout(this.autoHideTimeout);this.autoHideTimeout=null},setAutoHide:function(t){this.autoHide=t!==false},getAutoHide:function(){return this.autoHide},setAutoHideDelay:function(t){if(BX.type.isNumber(t)&&t>0){this.autoHideDelay=t}},getAutoHideDelay:function(){return this.autoHideDelay},animateIn:function(t){if(!this.getContainer().classList.contains(this.getAnimationClassName())){this.getContainer().addEventListener("transitionend",function i(){this.removeEventListener("transitionend",i);t()});this.getContainer().classList.add(this.getAnimationClassName())}else{t()}},animateOut:function(t){if(this.getContainer().classList.contains(this.getAnimationClassName())){this.getContainer().addEventListener("transitionend",function i(){this.removeEventListener("transitionend",i);t()});this.getContainer().classList.remove(this.getAnimationClassName())}else{t()}},getAnimationClassName:function(){return this.animationClassName},handleCloseBtnClick:function(){this.close()},handleMouseEnter:function(){this.fireEvent("onMouseEnter");this.deactivateAutoHide();this.setState(t.PAUSED);this.show()},handleMouseLeave:function(){this.fireEvent("onMouseLeave");this.activateAutoHide()},fireEvent:function(t){var i=this.getEvent(t);BX.onCustomEvent(this,i.getFullName(),[i]);return i},addEvent:function(t,i){if(BX.type.isFunction(i)){BX.addCustomEvent(this,BX.UI.Notification.Event.getFullName(t),i)}},removeEvent:function(t,i){if(BX.type.isFunction(i)){BX.removeCustomEvent(this,BX.UI.Notification.Event.getFullName(t),i)}},getEvent:function(t){var i=new BX.UI.Notification.Event;i.setBalloon(this);i.setName(t);return i},getData:function(){return this.data},setData:function(t){if(BX.type.isPlainObject(t)){this.data=t}}};BX.UI.Notification.Event=function(){this.balloon=null;this.name=null};BX.UI.Notification.Event.getFullName=function(t){return"UI.Notification.Balloon:"+t};BX.UI.Notification.Event.prototype={getBalloon:function(){return this.balloon},setBalloon:function(t){if(t instanceof BX.UI.Notification.Balloon){this.balloon=t}},getName:function(){return this.name},setName:function(t){if(BX.type.isNotEmptyString(t)){this.name=t}},getFullName:function(){return BX.UI.Notification.Event.getFullName(this.getName())}};BX.UI.Notification.Action=function(t,i){i=BX.type.isPlainObject(i)?i:Object.create(null);this.balloon=t;this.id=BX.type.isNotEmptyString(i.id)?i.id:BX.util.getRandomString(8).toLowerCase();this.container=null;this.href=BX.type.isNotEmptyString(i.href)?i.href:null;this.title=BX.type.isNotEmptyString(i.title)?i.title:null;this.window=window;this.events={};if(BX.type.isPlainObject(i.events)){for(var e in i.events){var n=i.events[e];if(!BX.type.isFunction(n)){continue}this.events[e]=function(t,i){return function(e){t.call(e.target,e,i.getBalloon(),i)}}(n,this)}}};BX.UI.Notification.Action.prototype={getBalloon:function(){return this.balloon},getId:function(){return this.id},getTitle:function(){return this.title},getHref:function(){return this.href},getContainer:function(){if(this.container===null){this.container=BX.create(this.getHref()?"a":"span",{props:{href:this.getHref(),className:"ui-notification-balloon-action"},events:this.events,text:this.getTitle()})}return this.container},getWindow:function(){return this.window}}})(); /* End */ ; ; /* Start:"a:4:{s:4:"full";s:70:"/bitrix/js/ui/notification/ui.notification.stack.min.js?15736328504742";s:6:"source";s:51:"/bitrix/js/ui/notification/ui.notification.stack.js";s:3:"min";s:55:"/bitrix/js/ui/notification/ui.notification.stack.min.js";s:3:"map";s:55:"/bitrix/js/ui/notification/ui.notification.stack.map.js";}"*/ (function(){"use strict";BX.namespace("BX.UI.Notification");BX.UI.Notification.Position={TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right",BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right"};BX.UI.Notification.Stack=function(t){t=BX.type.isPlainObject(t)?t:Object.create(null);this.balloons=[];this.queueStack=[];this.id=BX.type.isNotEmptyString(t.id)?t.id:BX.util.getRandomString(8).toLowerCase();this.position=BX.UI.Notification.Stack.getPositionCode(t.position)?t.position:"top-right";this.spacing=20;this.offsetX=25;this.offsetY=25;this.newestOnTop=false;this.balloonType=BX.UI.Notification.Balloon;this.setOptions(t);BX.addCustomEvent(BX.UI.Notification.Event.getFullName("onClose"),this.handleBalloonClose.bind(this))};BX.UI.Notification.Stack.getPositionCode=function(t){for(var i in BX.UI.Notification.Position){if(BX.UI.Notification.Position[i]===t){return i}}return null};BX.UI.Notification.Stack.prototype={adjustPosition:function(t){var i=0;this.getBalloons().forEach(function(e){if(!t||t===e){switch(this.getPosition()){case BX.UI.Notification.Position.TOP_LEFT:e.getContainer().style.left=this.getOffsetX()+"px";e.getContainer().style.top=i+this.getOffsetY()+"px";break;case BX.UI.Notification.Position.TOP_CENTER:e.getContainer().style.left="50%";e.getContainer().style.transform="translateX(-50%)";e.getContainer().style.top=i+this.getOffsetY()+"px";break;case BX.UI.Notification.Position.TOP_RIGHT:e.getContainer().style.right=this.getOffsetX()+"px";e.getContainer().style.top=i+this.getOffsetY()+"px";break;case BX.UI.Notification.Position.BOTTOM_LEFT:e.getContainer().style.left=this.getOffsetX()+"px";e.getContainer().style.bottom=i+this.getOffsetY()+"px";break;case BX.UI.Notification.Position.BOTTOM_CENTER:e.getContainer().style.left="50%";e.getContainer().style.transform="translateX(-50%)";e.getContainer().style.bottom=i+this.getOffsetY()+"px";break;case BX.UI.Notification.Position.BOTTOM_RIGHT:e.getContainer().style.right=this.getOffsetX()+"px";e.getContainer().style.bottom=i+this.getOffsetY()+"px";break}}i+=this.getSpacing()+e.getHeight()},this)},add:function(t){if(this.getBalloons().length>0&&(this.getQueue().length>0||!this.isBalloonFitToViewport(t))){this.queue(t)}else{this.push(t)}},remove:function(t){this.balloons=this.balloons.filter(function(i){return t!==i})},push:function(t){if(!(t instanceof BX.UI.Notification.Balloon)){throw new Error("'balloon' must be an instance of BX.UI.Notification.Balloon.")}if(this.balloons.indexOf(t)===-1){if(this.isNewestOnTop()){this.balloons.splice(0,0,t)}else{this.balloons.push(t)}}},queue:function(t){if(!(t instanceof BX.UI.Notification.Balloon)){throw new Error("'balloon' must be an instance of BX.UI.Notification.Balloon.")}if(this.queueStack.indexOf(t)===-1){t.setState(BX.UI.Notification.State.QUEUED);this.queueStack.push(t)}},checkQueue:function(){var t=this.queueStack.slice();for(var i=0;i<t.length;i++){var e=t[i];if(!this.isBalloonFitToViewport(e)&&this.getBalloons().length>0){break}e.setState(BX.UI.Notification.State.INIT);this.queueStack.shift();this.push(e);e.show()}},getQueue:function(){return this.queueStack},isBalloonFitToViewport:function(t){var i=document.documentElement.clientHeight;var e=this.getSpacing()+t.getHeight();return this.getHeight()+e<=i},handleBalloonClose:function(t){var i=t.getBalloon();if(i.getStack()!==this){return}this.remove(i);this.adjustPosition();this.checkQueue()},setOptions:function(t){t=t||{};this.setSpacing(t.spacing);this.setOffsetX(t.offsetX);this.setOffsetY(t.offsetY);this.setNewestOnTop(t.newestOnTop);this.setBalloonType(t.balloonType)},getId:function(){return this.id},getBalloons:function(){return this.balloons},getPosition:function(){return this.position},getSpacing:function(){return this.spacing},setSpacing:function(t){if(BX.type.isNumber(t)){this.spacing=t}},getOffsetX:function(){return this.offsetX},setOffsetX:function(t){if(BX.type.isNumber(t)){this.offsetX=t}},getOffsetY:function(){return this.offsetY},setOffsetY:function(t){if(BX.type.isNumber(t)){this.offsetY=t}},getHeight:function(){return this.getBalloons().reduce(function(t,i){return t+i.getHeight()+this.getSpacing()}.bind(this),this.getOffsetY())},getBalloonType:function(t){if(BX.type.isFunction(t)){return t}var i=BX.getClass(t);if(BX.type.isFunction(i)){return i}return this.balloonType||BX.UI.Notification.Balloon},setBalloonType:function(t){if(BX.type.isFunction(t)){this.balloonType=t}else if(BX.type.isNotEmptyString(t)){var i=BX.getClass(t);if(BX.type.isFunction(i)){this.balloonType=i}}},isNewestOnTop:function(){return this.newestOnTop},setNewestOnTop:function(t){if(BX.type.isBoolean(t)){this.newestOnTop=t}}}})(); /* End */ ; ; /* Start:"a:4:{s:4:"full";s:71:"/bitrix/js/ui/notification/ui.notification.center.min.js?16609208762785";s:6:"source";s:52:"/bitrix/js/ui/notification/ui.notification.center.js";s:3:"min";s:56:"/bitrix/js/ui/notification/ui.notification.center.min.js";s:3:"map";s:56:"/bitrix/js/ui/notification/ui.notification.center.map.js";}"*/ (function(){"use strict";BX.namespace("BX.UI.Notification");var t=null;Object.defineProperty(BX.UI.Notification,"Center",{enumerable:false,get:function(){if(t===null){t=new BX.UI.Notification.Manager({})}return t}});BX.UI.Notification.Manager=function(){this.stacks=Object.create(null);this.balloons=Object.create(null);this.balloonDefaults={};this.stackDefaults={};this.defaultPosition=BX.UI.Notification.Position.TOP_RIGHT;BX.addCustomEvent(BX.UI.Notification.Event.getFullName("onClose"),this.handleBalloonClose.bind(this))};BX.UI.Notification.Manager.prototype={notify:function(t){t=BX.type.isPlainObject(t)?t:{};var i=this.getBalloonById(t.id)||this.getBalloonByCategory(t.category);if(i){i.setOptions(t);i.show();if(t.blinkOnUpdate===false){i.update(null)}else{i.blink()}return}var o=null;if(t.stack instanceof BX.UI.Notification.Stack){o=t.stack;this.addStack(o)}else{if(BX.type.isNotEmptyString(t.position)){o=this.getStackByPosition(t.position)}else{o=this.getDefaultStack()}t.stack=o}var n=BX.mergeEx({},this.getBalloonDefaults(),t);var e=o.getBalloonType(t.type);var a=new e(n);if(!(a instanceof BX.UI.Notification.Balloon)){throw new Error("Balloon type must be an instance of BX.UI.Notification.Balloon")}this.balloons[a.getId()]=a;a.show();return a},getBalloonById:function(t){return this.balloons[t]?this.balloons[t]:null},getBalloonByCategory:function(t){if(BX.type.isNotEmptyString(t)){for(var i in this.balloons){var o=this.balloons[i];if(o.getCategory()===t){return o}}}return null},removeBalloon:function(t){delete this.balloons[t.getId()]},handleBalloonClose:function(t){this.removeBalloon(t.getBalloon())},getStack:function(t){return this.stacks[t]?this.stacks[t]:null},getDefaultStack:function(){return this.getStackByPosition(this.getDefaultPosition())},getStackByPosition:function(t){var i=this.getStack(t);if(i===null){i=new BX.UI.Notification.Stack(BX.mergeEx({},this.getStackDefaults(),{id:t,position:t}));this.addStack(i)}return i},addStack:function(t){if(t instanceof BX.UI.Notification.Stack&&this.getStack(t.getId())===null){this.stacks[t.getId()]=t}},setBalloonDefaults:function(t){if(BX.type.isPlainObject(t)){BX.mergeEx(this.balloonDefaults,t)}},getBalloonDefaults:function(){return this.balloonDefaults},setStackDefaults:function(t,i){if(BX.UI.Notification.Stack.getPositionCode(t)){var o=this.getStackByPosition(t);o.setOptions(i)}else if(BX.type.isPlainObject(t)){i=t;for(var n in BX.UI.Notification.Position){t=BX.UI.Notification.Position[n];this.setStackDefaults(t,i)}}},setDefaultPosition:function(t){if(BX.UI.Notification.Stack.getPositionCode(t)){this.defaultPosition=t}},getDefaultPosition:function(){return this.defaultPosition},getStackDefaults:function(){return this.stackDefaults}}})(); /* End */ ; //# sourceMappingURL=kernel_ui_notification.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings