PageSourceSearch

https://www2.postkodlotteriet.se/sitevision/system-resource/706c47…9c77fbc171ef52fc04ec9b767285/js/svdialog.js

js postkodlotteriet.se collected 2026-09-27 21:40:06 UTC 4,602 bytes, 2 lines download raw bytes

1(globalThis.webpackChunk_sv_portlet=globalThis.webpackChunk_sv_portlet||[]).push([[372],{10(t,i,o){"use strict";o.r(i);o(6597)},6597(t,i,o){"use strict";o.r(i);o(9608)},9608(){!function(t,i,o){var s="svDialog",e={cssClasses:{},open:!1,modal:!0,movable:!1,url:void 0,title:"My fancy dialog",closeOnEscape:!0,onClose:null,closeButtonLabel:"Close"};function n(i,o){this.element=i,this.$element=t(i),this.options=t.extend({},e,o),this._defaults=e,this._name=s,this.init()}n.prototype={init:function(){var i,o;this.$dialogWrapper=(i=this.options.modal,o="",i&&(o+='<div class="sv-dialog-container"><div class="sv-dialog-backdrop"></div>'),o+='<div class="sv-dialog" role="dialog" aria-hidden="true" aria-labelledby="sv-dialog-title"><div class="sv-dialog-content"><div class="sv-dialog-header"><button class="sv-dialog-close"><span aria-hidden="true">&times;</span></button><h4 id="sv-dialog-title"></h4></div><div class="sv-dialog-body"></div><div class="sv-dialog-footer"></div></div></div>',i&&(o+="</div>"),t(o)),this.$dialogWrapper.find(".sv-dialog-body").append(this.element),this.options.buttons&&this.setupButtons(),this.bindEvents(),this.options.modal||(this.$dialogWrapper.addClass("sv-dialog-movable"),this.$dialogWrapper.draggable({handle:".sv-dialog-header",containment:"body",distance:10})),this.options.open&&this.open()},open:function(){this.options.url?t.get(this.options.url).done(t.proxy(this.handleRemoteContent,this)):this._open()},handleRemoteContent:function(t){this.$element.html(t),this._open()},_open:function(){this.$dialogWrapper.appendTo("body"),this.setTitle(),this.setCloseButton(),this.setAriaHidden(!1),this.$dialogWrapper.find(".sv-dialog-container").css("height",t(i).height()),this.options.modal?t("body").addClass("sv-dialog-open"):this.positionDialog(),this.$dialogWrapper.show(),this.setFocus(),this.setupFocusTrap(),this.$element.trigger("open:dialog.sv-dialog")},setCloseButton:function(){this.$dialogWrapper.find(".sv-dialog-close").attr("aria-label",this.options.closeButtonLabel)},setTitle:function(){this.$dialogWrapper.find("#sv-dialog-title").html(this.options.title)},setAriaHidden:function(t){(this.options.modal?this.$dialogWrapper.find(".sv-dialog"):this.$dialogWrapper).attr("aria-hidden",t)},positionDialog:function(){var t=this.$dialogWrapper.outerWidth();this.$dialogWrapper.css({position:"fixed",top:"30px",left:"50%",marginLeft:"-"+i.parseInt(t,10)/2+"px"})},setupButtons:function(){t.each(this.options.buttons,t.proxy(function(i,o){var s=t('<button class="sv-dialog-btn" />');switch(s.text(o.text).on("click",o.callback),o.type){case"primary":s.addClass("sv-dialog-btn-primary");break;case"link":s.addClass("sv-dialog-btn-link")}s.prependTo(this.$dialogWrapper.find(".sv-dialog-footer"))},this))},setupFocusTrap:function(){var t=this,i=this.$dialogWrapper.find(".sv-dialog-content");this.getFocusableElements=function(){return i.find('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])').filter(":visible").not(":disabled")},i.off("keydown.focustrap").on("keydown.focustrap",function(i){if("Escape"===i.key&&t.options.closeOnEscape)return i.preventDefault(),void t.close();if("Tab"===i.key){var s=t.getFocusableElements();if(0===s.length)return;var e=s.first()[0],n=s.last()[0];i.shiftKey?o.activeElement===e&&(i.preventDefault(),n.focus()):o.activeElement===n&&(i.preventDefault(),e.focus())}})},removeFocusTrap:function(){this.$dialogWrapper&&this.$dialogWrapper.find(".sv-dialog-content").off("keydown.focustrap")},close:function(){this.removeFocusTrap(),this.$dialogWrapper.hide(),this.setAriaHidden(!0),t("body").removeClass("sv-
1dialog-open"),this.options.onClose&&"function"==typeof this.options.onClose&&this.options.onClose()},remove:function(){t("body").removeClass("sv-dialog-open"),this.removeFocusTrap(),this.$dialogWrapper.remove()},setFocus:function(){var t=this.$element.find("input:not([type=hidden], .svhidden, .sv-hidden, .env-d--none),select");t.length&&t.first().trigger("focus")},enableSubmitButton:function(){this.$dialogWrapper.find("button.sv-dialog-btn-primary").prop("disabled",!1)},disableSubmitButton:function(){this.$dialogWrapper.find("button.sv-dialog-btn-primary").prop("disabled",!0)},bindEvents:function(){this.$dialogWrapper.off("click.sv-dialog.close").on("click.sv-dialog.close",".sv-dialog-close",t.proxy(this.close,this))},setURL:function(t){this.options.url=t}},t.fn[s]=function(i,o){return this.each(function(){var e=t.data(this,"plugin_"+s);e?"string"==typeof i&&e[i](o):t.data(this,"plugin_"+s,new n(this,i))})}}(window.$svjq,window,document)}}]);
2//# sourceMappingURL=svdialog.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.