PageSourceSearch

https://forte.se/sitevision/system-resource/706c47851a9c6e84fdd504…171ef52fc04ec9b767285/js/popover-plugins.js

js forte.se collected 2026-09-24 18:12:07 UTC 17,823 bytes, 2 lines download raw bytes

vendor: 10,908 bytes, line 1
1(globalThis.webpackChunk_sv_portlet=globalThis.webpackChunk_sv_portlet||[]).push([[7409],{8061(t,e,i){"use strict";i(7237)},7237(t,e,i){var o,n,s;!function(h,r,a){"use strict";n=[i(3501)],(s="function"==typeof(o=function(t){var e="webuiPopover",i="webui-popover",o="webui.popover",n={placement:"top",container:null,width:"auto",height:"auto",trigger:"hover",style:"",selector:!1,delay:{show:300,hide:100},async:{type:"GET",before:null,success:null,error:null},cache:!0,multi:!1,arrow:!0,title:"",content:"",closeable:!1,padding:!0,url:"",type:"async",direction:"",animation:null,template:'<div class="webui-popover"><div class="webui-arrow"></div><div class="webui-popover-inner"><a href="#" class="close"></a><h3 class="webui-popover-title"></h3><div class="webui-popover-content"><i class="glyphicon glyphicon-refresh"></i> <p></p></div></div></div>',backdrop:!1,dismissible:!0,onShow:null,onHide:null,abortXHR:!0,autoHide:!1,offsetTop:0,offsetLeft:0,iframeOptions:{frameborder:"0",allowtransparency:"true",id:"",name:"",scrolling:"",onload:"",height:"",width:""},hideEmpty:!1},s=i+"-rtl",l=[],c=t('<div class="webui-popover-backdrop"></div>'),p=0,f=!1,d=-2e3,g=t(r),u=function(t,e){return isNaN(t)?e||0:Number(t)},m=function(t){return t.data("plugin_"+e)},v=function(){for(var t=null,e=0;e<l.length;e++)(t=m(l[e]))&&t.hide(!0);g.trigger("hiddenAll."+o)},y=function(t){for(var e=null,i=0;i<l.length;i++)(e=m(l[i]))&&e.id!==t.id&&e.hide(!0);g.trigger("hiddenAll."+o)},w="ontouchstart"in r.documentElement&&/Mobi/.test(navigator.userAgent),b=function(t){var e={x:0,y:0};if("touchstart"===t.type||"touchmove"===t.type||"touchend"===t.type||"touchcancel"===t.type){var i=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0];e.x=i.pageX,e.y=i.pageY}else"mousedown"!==t.type&&"mouseup"!==t.type&&"click"!==t.type||(e.x=t.pageX,e.y=t.pageY);return e};function $(i,o){return this.$element=t(i),o&&("string"!=typeof o.delay&&"number"!=typeof o.delay||(o.delay={show:o.delay,hide:o.delay})),this.options=t.extend({},n,o),this._defaults=n,this._name=e,this._targetclick=!1,this.init(),l.push(this.$element),this}$.prototype={init:function(){if(this.$element[0]instanceof r.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");"manual"!==this.getTrigger()&&(w?this.$element.off("touchend",this.options.selector).on("touchend",this.options.selector,t.proxy(this.toggle,this)):"click"===this.getTrigger()?this.$element.off("click",this.options.selector).on("click",this.options.selector,t.proxy(this.toggle,this)):"hover"===this.getTrigger()&&this.$element.off("mouseenter mouseleave click",this.options.selector).on("mouseenter",this.options.selector,t.proxy(this.mouseenterHandler,this)).on("mouseleave",this.options.selector,t.proxy(this.mouseleaveHandler,this))),this._poped=!1,this._inited=!0,this._opened=!1,this._idSeed=p,this.id=e+this._idSeed,this.options.container=t(this.options.container||r.body).first(),this.options.backdrop&&c.appendTo(this.options.container).hide(),p++,"sticky"===this.getTrigger()&&this.show(),this.options.selector&&(this._options=t.extend({},this.options,{selector:""}))},destroy:function(){for(var t=-1,i=0;i<l.length;i++)if(l[i]===this.$element){t=i;break}l.splice(t,1),this.hide(),this.$element.data("plugin_"+e,null),"click"===this.getTrigger()?this.$element.off("click"):"hover"===this.getTrigger()&&this.$element.off("mouseenter mouseleave"),this.$target&&this.$target.remove()},getDelegateOptions:function(){var e={};return this._options&&t.each(this._options,function(t,i){n[t]!==i&&(e[t]=i)}),e},hide:function(e,i){if((e||"sticky"!==this.getTrigger())&&this._opened){i&&(i.preventDefault(),i.stopPropagation()),this.xhr&&!0===this.options.abortXHR&&(this.xhr.abort(),this.xhr=null);var n=t.Event("hide."+o);if(this.$element.trigger(n,[this.$target]),this.$target){this.$target.removeClass("in").addClass(this.getHideAnimation());var s=this;setTimeout(function(){s.$target.hide(),s.getCache()||s.$target.remove()},s.getHideDelay())}this.options.backdrop&&c.hide(),this._opened=!1,this.$element.trigger("hidden."+o,[this.$target]),this.options.onHide&&this.options.onHide(this.$target)}},resetAutoHide:function(){var t=this,e=t.getAutoHide();e&&(t.autoHideHandler&&clearTimeout(t.autoHideHandler),t.autoHideHandler=setTimeout(function(){t.hide()},e))},delegate:function(i){var o=t(i).data("plugin_"+e);return o||(o=new $(i,this.getDelegateOptions()),t(i).data("plugin_"+e,o)),o},toggle:function(t){var e=this;t&&(t.preventDefault(),t.stopPropagation(),this.options.selector&&(e=this.delegate(t.currentTarget))),e[e.getTarget().hasClass("in")?"hide":"show"]()},hideAll:function(){v()},hideOthers:function(){y(this)},show:function(){if(!this._opened){var t=this.getTarget().removeClass().addClass(i).addClass(this._customTargetClass);if(this.options.multi||this.hideOthers(),!this.getCache()||!this._poped||""===this.content){if(this.content="",this.setTitle(this.getTitle()),this.options.closeable||t.find(".close").off("click").remove(),this.isAsync()?this.setContentASync(this.options.content):this.setContent(this.getContent()),this.canEmptyHide()&&""===this.content)return;t.show()}this.displayContent(),this.options.onShow&&this.options.onShow(t),this.bindBodyEvents(),this.options.backdrop&&c.show(),this._opened=!0,this.resetAutoHide()}},displayContent:function(){var e=this.getElementPosition(),n=this.getTarget().removeClass().addClass(i).addClass(this._customTargetClass),h=this.getContentElement(),r=n[0].offsetWidth,a=n[0].offsetHeight,l="bottom",c=t.Event("show."+o);if(this.canEmptyHide()){var p=h.children().html();if(null!==p&&0===p.trim().length)return}this.$element.trigger(c,[n]);var f=this.$element.data("width")||this.options.width;""===f&&(f=this._defaults.width),"auto"!==f&&n.width(f);var g=this.$element.data("height")||this.options.height;""===g&&(g=this._defaults.height),"auto"!==g&&h.height(g),this.options.style&&this.$target.addClass(i+"-"+this.options.style),"rtl"!==this.options.direction||h.hasClass(s)||h.addClass(s),this.options.arrow||n.find(".webui-arrow").remove(),n.detach().css({top:d,left:d,display:"block"}),this.getAnimation()&&n.addClass(this.getAnimation()),n.appendTo(this.options.container),l=this.getPlacement(e),this.$element.trigger("added."+o),this.initTargetEvents(),this.options.padding||("auto"!==this.options.height&&h.css("height",h.outerHeight()),this.$target.addClass("webui-no-padding")),this.options.maxHeight&&h.css("maxHeight",this.options.maxHeight),this.options.maxWidth&&h.css("maxWidth",this.options.maxWidth),r=n[0].offsetWidth,a=n[0].offsetHeight;var u=this.getTargetPositin(e,l,r,a);if(this.$target.css(u.position).addClass(l).addClass("in"),"iframe"===this.options.type){var m=n.find("iframe"),v=n.width(),y=m.parent().height();""!==this.options.iframeOptions.width&&"auto"!==this.options.iframeOptions.width&&(v=this.options.iframeOptions.width),""!==this.options.iframeOptions.height&&"auto"!==this.options.iframeOptions.height&&(y=this.options.iframeOptions.height),m.width(v).height(y)}if(this.options.arrow||this.$target.css({margin:0}),this.options.arrow){var w=this.$target.find(".webui-arrow");w.removeAttr("style"),"left"===l||"right"===l?w.css({top:this.$target.height()/2}):"top"!==l&&"bottom"!==l||w.css({left:this.$target.width()/2}),u.arrowOffset&&(-1===u.arrowOffset.left||-1===u.arrowOffset.top?w.hide():w.css(u.arrowOffset))}this._poped=!0,this.$element.trigger("shown."+o,[this.$target])},isTargetLoaded:function(){return 0===this.getTarget().find("i.glyphicon-refresh").length},getTriggerElement:function(){return this.$element},getTarget:function(){if(!this.$target){var o=e+this._idSeed;this.$target=t(this.options.template).attr("id",o),this._customTargetClass=this.$target.attr("class")!==i?this.$target.attr("class"):null,this.getTriggerElement().attr("data-target",o)}return this.$target.data("trigger-element")||this.$target.data("trigger-element",this.getTriggerElement()),this.$target},removeTarget:function(){this.$target.remove(),this.$target=null,this.$contentElement=null},getTitleElement:function(){return this.getTarget().find("."+i+"-title")},getContentElement:function(){return this.$contentElement||(this.$contentElement=this.getTarget().find("."+i+"-content")),this.$contentElement},getTitle:function(){return this.$element.attr("data-title")||this.options.title||this.$element.attr("title")},getUrl:function(){return this.$element.attr("data-url")||this.options.url},getAutoHide:function(){return this.$element.attr("data-auto-hide")||this.options.autoHide},getOffsetTop:function(){return u(this.$element.attr("data-offset-top"))||this.options.offsetTop},getOffsetLeft:function(){return u(this.$element.attr("data-offset-left"))||this.options.offsetLeft},getCache:function(){var t=this.$element.attr("data-cache");if(void 0!==t)switch(t.toLowerCase()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":return!1}return this.options.cache},getTrigger:function(){return this.$element.attr("data-trigger")||this.options.trigger},getDelayShow:function(){var t=this.$element.attr("data-delay-show");return void 0!==t?t:0===this.options.delay.show?0:this.options.delay.show||100},getHideDelay:function(){var t=this.$element.attr("data-delay-hide");return void 0!==t?t:0===this.options.delay.hide?0:this.options.delay.hide||100},getAnimation:function(){return this.$element.attr("data-animation")||this.options.animation},getHideAnimation:function(){var t=this.getAnimation();return t?t+"-out":"out"},setTitle:function(t){var e=this.getTitleElement();t?("rtl"!==this.options.direction||e.hasClass(s)||e.addClass(s),e.html(t)):e.remove()},hasContent:function(){return this.getContent()},canEmptyHide:function(){return this.options.hideEmpty&&"html"===this.options.type},getIframe:function(){var e=t("<iframe></iframe>").attr("src",this.getUrl()),i=this;return t.each(this._defaults.iframeOptions,function(t){void 0!==i.options.iframeOptions[t]&&e.attr(t,i.options.iframeOptions[t])}),e},getContent:function(){if(this.getUrl())switch(this.options.type){case"iframe":this.content=this.getIframe();break;case"html":try{this.content=t(this.getUrl()),this.content.is(":visible")||this.content.show()}catch(t){throw new Error("Unable to get popover content. Invalid selector specified.")}}else if(!this.content){var e="";if(e="function"==typeof this.options.content?this.options.content.apply(this.$element[0],[this]):this.options.content,this.content=this.$element.attr("data-content")||e,!this.content){var o=this.$element.next();o&&o.hasClass(i+"-content")&&(this.content=o)}}return this.content},setContent:function(e){var o=this.getTarget(),n=this.getContentElement();"string"==typeof e?n.html(e):e instanceof t&&(n.html(""),this.options.cache?e.removeClass(i+"-content").appendTo(n):e.clone(!0,!0).removeClass(i+"-content").appendTo(n)),this.$target=
1o},isAsync:function(){return"async"===this.options.type},setContentASync:function(e){var i=this;this.xhr||(this.xhr=t.ajax({url:this.getUrl(),type:this.options.async.type,cache:this.getCache(),beforeSend:function(t,e){i.options.async.before&&i.options.async.before(i,t,e)},success:function(t){i.bindBodyEvents(),i.content=e&&"function"==typeof e?e.apply(i.$element[0],[t]):t,i.setContent(i.content),i.getContentElement().removeAttr("style"),i.displayContent(),i.options.async.success&&i.options.async.success(i,t)},complete:function(){i.xhr=null},error:function(t,e){i.options.async.error&&i.options.async.error(i,t,e)}}))},bindBodyEvents:function(){f||(this.options.dismissible&&"click"===this.getTrigger()?w?g.off("touchstart.webui-popover").on("touchstart.webui-popover",t.proxy(this.bodyTouchStartHandler,this)):(g.off("keyup.webui-popover").on("keyup.webui-popover",t.proxy(this.escapeHandler,this)),g.off("click.webui-popover").on("click.webui-popover",t.proxy(this.bodyClickHandler,this))):"hover"===this.getTrigger()&&g.off("touchend.webui-popover").on("touchend.webui-popover",t.proxy(this.bodyClickHandler,this)))},mouseenterHandler:function(t){var e=this;t&&this.options.selector&&(e=this.delegate(t.currentTarget)),e._timeout&&clearTimeout(e._timeout),e._enterTimeout=setTimeout(function(){e.getTarget().is(":visible")||e.show()},this.getDelayShow())},mouseleaveHandler:function(){var t=this;clearTimeout(t._enterTimeout),t._timeout=setTimeout(function(){t.hide()},this.getHideDelay())},escapeHandler:function(t){27===t.keyCode&&this.hideAll()},bodyTouchStartHandler:function(e){var i=this,o=t(e.currentTarget);o.on("touchend",function(t){i.bodyClickHandler(t),o.off("touchend")}),o.on("touchmove",function(){o.off("touchend")})},bodyClickHandler:function(t){f=!0;for(var e=!0,i=0;i<l.length;i++){var o=m(l[i]);if(o&&o._opened){var n=o.getTarget().offset(),s=n.left,h=n.top,r=n.left+o.getTarget().width(),a=n.top+o.getTarget().height(),c=b(t);if(c.x>=s&&c.x<=r&&c.y>=h&&c.y<=a){e=!1;break}}}e&&v()},initTargetEvents:function(){"hover"===this.getTrigger()&&this.$target.off("mouseenter mouseleave").on("mouseenter",t.proxy(this.mouseenterHandler,this)).on("mouseleave",t.proxy(this.mouseleaveHandler,this)),this.$target.find(".close").off("click").on("click",t.proxy(this.hide,this,!0))},getPlacement:function(t){var e,i=this.options.container,o=i.innerWidth(),n=i.innerHeight(),s=i.scrollTop(),h=i.scrollLeft(),r=Math.max(0,t.left-h),a=Math.max(0,t.top-s),l="horizontal"===(e="function"==typeof this.options.placement?this.options.placement.call(this,this.getTarget()[0],this.$element[0]):this.$element.data("placement")||this.options.placement),c="vertical"===e;return"auto"===e||l||c?e=r<o/3?a<n/3?l?"right-bottom":"bottom-right":a<2*n/3?c?a<=n/2?"bottom-right":"top-right":"right":l?"right-top":"top-right":r<2*o/3?a<n/3?l?r<=o/2?"right-bottom":"left-bottom":"bottom":a<2*n/3?l?r<=o/2?"right":"left":a<=n/2?"bottom":"top":l?r<=o/2?"right-top":"left-top":"top":a<n/3?l?"left-bottom":"bottom-left":a<2*n/3?c?a<=n/2?"bottom-left":"top-left":"left":l?"left-top":"top-left":"auto-top"===e?e=r<o/3?"top-right":r<2*o/3?"top":"top-left":"auto-bottom"===e?e=r<o/3?"bottom-right":r<2*o/3?"bottom":"bottom-left":"auto-left"===e?e=a<n/3?"left-top":a<2*n/3?"left":"left-bottom":"auto-right"===e&&(e=a<n/3?"right-bottom":a<2*n/3?"right":"right-top"),e},getElementPosition:function(){var e=this.$element[0].getBoundingClientRect(),i=this.options.container,o=i.css("position");if(i.is(r.body)||"static"===o)return t.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth||e.width,height:this.$element[0].offsetHeight||e.height});if("fixed"===o){var n=i[0].getBoundingClientRect();return{top:e.top-n.top+i.scrollTop(),left:e.left-n.left+i.scrollLeft(),width:e.width,height:e.height}}return"relative"===o?{top:this.$element.offset().top-i.offset().top,left:this.$element.offset().left-i.offset().left,width:this.$element[0].offsetWidth||e.width,height:this.$element[0].offsetHeight||e.height}:void 0},getTargetPositin:function(t,e,i,o){var n=t,s=this.options.container,h=this.$element.outerWidth(),a=this.$element.outerHeight(),l=r.documentElement.scrollTop+s.scrollTop(),c=r.documentElement.scrollLeft+s.scrollLeft(),p={},f=null,g=this.options.arrow?20:0,u=10,m=h<g+u?g:0,v=a<g+u?g:0,y=0,w=r.documentElement.clientHeight+l,b=r.documentElement.clientWidth+c,$=n.left+n.width/2-m>0,T=n.left+n.width/2+m<b,C=n.top+n.height/2-v>0,H=n.top+n.height/2+v<w;switch(e){case"bottom":p={top:n.top+n.height,left:n.left+n.width/2-i/2};break;case"top":p={top:n.top-o,left:n.left+n.width/2-i/2};break;case"left":p={top:n.top+n.height/2-o/2,left:n.left-i};break;case"right":p={top:n.top+n.height/2-o/2,left:n.left+n.width};break;case"top-right":p={top:n.top-o,left:$?n.left-m:u},f={left:$?Math.min(h,i)/2+m:d};break;case"top-left":y=T?m:-u,p={top:n.top-o,left:n.left-i+n.width+y},f={left:T?i-Math.min(h,i)/2-m:d};break;case"bottom-right":p={top:n.top+n.height,left:$?n.left-m:u},f={left:$?Math.min(h,i)/2+m:d};break;case"bottom-left":y=T?m:-u,p={top:n.top+n.height,left:n.left-i+n.width+y},f={left:T?i-Math.min(h,i)/2-m:d};break;case"right-top":y=H?v:-u,p={top:n.top-o+n.height+y,left:n.left+n.width},f={top:H?o-Math.min(a,o)/2-v:d};break;case"right-bottom":p={top:C?n.top-v:u,left:n.left+n.width},f={top:C?Math.min(a,o)/2+v:d};break;case"left-top":y=H?v:-u,p={top:n.top-o+n.height+y,left:n.left-i},f={top:H?o-Math.min(a,o)/2-v:d};break;case"left-bottom":p={top:C?n.top-v:u,left:n.left-i},f={top:C?Math.min(a,o)/2+v:d}}return p.top+=this.getOffsetTop(),p.left+=this.getOffsetLeft(),{position:p,arrowOffset:f}}},t.fn[e]=function(i,o){var n=[],s=this.each(function(){var s=t.data(this,"plugin_"+e);s?"destroy"===i?s.destroy():"string"==typeof i&&n.push(s[i]()):(i?"string"==typeof i?"destroy"!==i&&(o||(s=new $(this,null),n.push(s[i]()))):"object"==typeof i&&(s=new $(this,i)):s=new $(this,null),t.data(this,"plugin_"+e,s))});return n.length?n:s};var T={show:function(e,i){i?t(e).webuiPopover(i).webuiPopover("show"):t(e).webuiPopover("show")},hide:function(e){t(e).webuiPopover("hide")},create:function(e,i){i=i||{},t(e).webuiPopover(i)},isCreated:function(i){var o=!0;return t(i).each(function(i,n){o=o&&t(n).data("plugin_"+e)!==a}),o},hideAll:function(){v()},updateContent:function(i,o){var n=t(i).data("plugin_"+e);if(n){var s=n.getCache();n.options.cache=!1,n.options.content=o,n._opened?(n._opened=!1,n.show()):n.isAsync()?n.setContentASync(o):n.setContent(o),n.options.cache=s}},updateContentAsync:function(i,o){var n=t(i).data("plugin_"+e);if(n){var s=n.getCache(),h=n.options.type;n.options.cache=!1,n.options.url=o,n._opened?(n._opened=!1,n.show()):(n.options.type="async",n.setContentASync(n.content)),n.options.cache=s,n.options.type=h}},setDefaultOptions:function(e){n=t.extend({},n,e)}};h.WebuiPopovers=T})?o.apply(e,n):o)===a||(t.exports=s)}(window,document)}}]);
2//# sourceMappingURL=popover-plugins.js.map

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.