PageSourceSearch

https://njudungsgymnasiet.se/sitevision/system-resource/24aba2c24f…25dd1cec62118b2fbc96c/js/popover-plugins.js

js njudungsgymnasiet.se collected 2026-10-08 19:55:28 UTC 17,895 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_sv_portlet=self.webpackChunk_sv_portlet||[]).push([[4534],{5451:function(t,e,i){i.r(e);i(4341)},4341:function(t,e,i){i(356);t=i.hmd(t),function(e,o,n){var s;s=function(t){var i="webuiPopover",n="webui-popover",s="webui.popover",h={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},r=n+"-rtl",a=[],l=t('<div class="webui-popover-backdrop"></div>'),c=0,p=!1,f=-2e3,d=t(o),u=function(t,e){return isNaN(t)?e||0:Number(t)},g=function(t){return t.data("plugin_"+i)},m=function(){for(var t=null,e=0;e<a.length;e++)(t=g(a[e]))&&t.hide(!0);d.trigger("hiddenAll."+s)},v="ontouchstart"in o.documentElement&&/Mobi/.test(navigator.userAgent),y=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 w(e,o){return this.$element=t(e),o&&("string"!=typeof o.delay&&"number"!=typeof o.delay||(o.delay={show:o.delay,hide:o.delay})),this.options=t.extend({},h,o),this._defaults=h,this._name=i,this._targetclick=!1,this.init(),a.push(this.$element),this}w.prototype={init:function(){if(this.$element[0]instanceof o.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");"manual"!==this.getTrigger()&&(v?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=c,this.id=i+this._idSeed,this.options.container=t(this.options.container||o.body).first(),this.options.backdrop&&l.appendTo(this.options.container).hide(),c++,"sticky"===this.getTrigger()&&this.show(),this.options.selector&&(this._options=t.extend({},this.options,{selector:""}))},destroy:function(){for(var t=-1,e=0;e<a.length;e++)if(a[e]===this.$element){t=e;break}a.splice(t,1),this.hide(),this.$element.data("plugin_"+i,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){h[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 o=t.Event("hide."+s);if(this.$element.trigger(o,[this.$target]),this.$target){this.$target.removeClass("in").addClass(this.getHideAnimation());var n=this;setTimeout((function(){n.$target.hide(),n.getCache()||n.$target.remove()}),n.getHideDelay())}this.options.backdrop&&l.hide(),this._opened=!1,this.$element.trigger("hidden."+s,[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(e){var o=t(e).data("plugin_"+i);return o||(o=new w(e,this.getDelegateOptions()),t(e).data("plugin_"+i,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(){m()},hideOthers:function(){!function(t){for(var e=null,i=0;i<a.length;i++)(e=g(a[i]))&&e.id!==t.id&&e.hide(!0);d.trigger("hiddenAll."+s)}(this)},show:function(){if(!this._opened){var t=this.getTarget().removeClass().addClass(n).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&&l.show(),this._opened=!0,this.resetAutoHide()}},displayContent:function(){var e,i=this.getElementPosition(),o=this.getTarget().removeClass().addClass(n).addClass(this._customTargetClass),h=this.getContentElement(),a=o[0].offsetWidth,l=o[0].offsetHeight,c=t.Event("show."+s);if(this.canEmptyHide()){var p=h.children().html();if(null!==p&&0===p.trim().length)return}this.$element.trigger(c,[o]);var d=this.$element.data("width")||this.options.width;""===d&&(d=this._defaults.width),"auto"!==d&&o.width(d);var u=this.$element.data("height")||this.options.height;""===u&&(u=this._defaults.height),"auto"!==u&&h.height(u),this.options.style&&this.$target.addClass(n+"-"+this.options.style),"rtl"!==this.options.direction||h.hasClass(r)||h.addClass(r),this.options.arrow||o.find(".webui-arrow").remove(),o.detach().css({top:f,left:f,display:"block"}),this.getAnimation()&&o.addClass(this.getAnimation()),o.appendTo(this.options.container),e=this.getPlacement(i),this.$element.trigger("added."+s),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),a=o[0].offsetWidth,l=o[0].offsetHeight;var g=this.getTargetPositin(i,e,a,l);if(this.$target.css(g.position).addClass(e).addClass("in"),"iframe"===this.options.type){var m=o.find("iframe"),v=o.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"===e||"right"===e?w.css({top:this.$target.height()/2}):"top"!==e&&"bottom"!==e||w.css({left:this.$target.width()/2}),g.arrowOffset&&(-1===g.arrowOffset.left||-1===g.arrowOffset.top?w.hide():w.css(g.arrowOffset))}this._poped=!0,this.$element.trigger("shown."+s,[this.$target])},isTargetLoaded:function(){return 0===this.getTarget().find("i.glyphicon-refresh").length},getTriggerElement:function(){return this.$element},getTarget:function(){if(!this.$target){var e=i+this._idSeed;this.$target=t(this.options.template).attr("id",e),this._customTargetClass=this.$target.attr("class")!==n?this.$target.attr("class"):null,this.getTriggerElement().attr("data-target",e)}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("."+n+"-title")},getContentElement:function(){return this.$contentElement||(this.$contentElement=this.getTarget().find("."+n+"-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(r)||e.addClass(r),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 i=this.$element.next();i&&i.hasClass(n+"-content")&&(this.content=i)}}return this.content},setContent:function(e){var i=this.getTarget(),o=this.getContentElement();"string"==typeof e?o.html(e):e instanceof t&&(o.html(""),this.options.cache?e.removeClass(n+"-content").appendTo(o):e.clone(!0,!0).removeClass(n+"-content").appendTo(o)),this.$target=i},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(){p||(this.options.dismissible&&"click"===this.getTrigger()?v?d.off("touchstart.webui-popover").on("touchstart.webui-popover",t.proxy(this.bodyTouchStartHandler,this)):(d.off("keyup.webui-popover").on("keyup.webui-popover",t.proxy(this.escapeHandler,this)),d.off("
1click.webui-popover").on("click.webui-popover",t.proxy(this.bodyClickHandler,this))):"hover"===this.getTrigger()&&d.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){p=!0;for(var e=!0,i=0;i<a.length;i++){var o=g(a[i]);if(o&&o._opened){var n=o.getTarget().offset(),s=n.left,h=n.top,r=n.left+o.getTarget().width(),l=n.top+o.getTarget().height(),c=y(t);if(c.x>=s&&c.x<=r&&c.y>=h&&c.y<=l){e=!1;break}}}e&&m()},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,n=i.css("position");if(i.is(o.body)||"static"===n)return t.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth||e.width,height:this.$element[0].offsetHeight||e.height});if("fixed"===n){var s=i[0].getBoundingClientRect();return{top:e.top-s.top+i.scrollTop(),left:e.left-s.left+i.scrollLeft(),width:e.width,height:e.height}}return"relative"===n?{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,n){var s=t,h=this.options.container,r=this.$element.outerWidth(),a=this.$element.outerHeight(),l=o.documentElement.scrollTop+h.scrollTop(),c=o.documentElement.scrollLeft+h.scrollLeft(),p={},d=null,u=this.options.arrow?20:0,g=10,m=r<u+g?u:0,v=a<u+g?u:0,y=0,w=o.documentElement.clientHeight+l,b=o.documentElement.clientWidth+c,$=s.left+s.width/2-m>0,T=s.left+s.width/2+m<b,C=s.top+s.height/2-v>0,H=s.top+s.height/2+v<w;switch(e){case"bottom":p={top:s.top+s.height,left:s.left+s.width/2-i/2};break;case"top":p={top:s.top-n,left:s.left+s.width/2-i/2};break;case"left":p={top:s.top+s.height/2-n/2,left:s.left-i};break;case"right":p={top:s.top+s.height/2-n/2,left:s.left+s.width};break;case"top-right":p={top:s.top-n,left:$?s.left-m:g},d={left:$?Math.min(r,i)/2+m:f};break;case"top-left":y=T?m:-10,p={top:s.top-n,left:s.left-i+s.width+y},d={left:T?i-Math.min(r,i)/2-m:f};break;case"bottom-right":p={top:s.top+s.height,left:$?s.left-m:g},d={left:$?Math.min(r,i)/2+m:f};break;case"bottom-left":y=T?m:-10,p={top:s.top+s.height,left:s.left-i+s.width+y},d={left:T?i-Math.min(r,i)/2-m:f};break;case"right-top":y=H?v:-10,p={top:s.top-n+s.height+y,left:s.left+s.width},d={top:H?n-Math.min(a,n)/2-v:f};break;case"right-bottom":p={top:C?s.top-v:g,left:s.left+s.width},d={top:C?Math.min(a,n)/2+v:f};break;case"left-top":y=H?v:-10,p={top:s.top-n+s.height+y,left:s.left-i},d={top:H?n-Math.min(a,n)/2-v:f};break;case"left-bottom":p={top:C?s.top-v:g,left:s.left-i},d={top:C?Math.min(a,n)/2+v:f}}return p.top+=this.getOffsetTop(),p.left+=this.getOffsetLeft(),{position:p,arrowOffset:d}}},t.fn[i]=function(e,o){var n=[],s=this.each((function(){var s=t.data(this,"plugin_"+i);s?"destroy"===e?s.destroy():"string"==typeof e&&n.push(s[e]()):(e?"string"==typeof e?"destroy"!==e&&(o||(s=new w(this,null),n.push(s[e]()))):"object"==typeof e&&(s=new w(this,e)):s=new w(this,null),t.data(this,"plugin_"+i,s))}));return n.length?n:s};var b={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(e){var o=!0;return t(e).each((function(e,n){o=o&&void 0!==t(n).data("plugin_"+i)})),o},hideAll:function(){m()},updateContent:function(e,o){var n=t(e).data("plugin_"+i);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(e,o){var n=t(e).data("plugin_"+i);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){h=t.extend({},h,e)}};e.WebuiPopovers=b},"function"==typeof define&&i.amdO?define(["jquery"],s):"object"==typeof exports?t.exports=s(i(7809)):s(e.$svjq)}(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.