11 lines
No EOL
22 KiB
JavaScript
11 lines
No EOL
22 KiB
JavaScript
/*
|
|
* # Fomantic UI - 2.9.2
|
|
* https://github.com/fomantic/Fomantic-UI
|
|
* https://fomantic-ui.com/
|
|
*
|
|
* Copyright 2023 Contributors
|
|
* Released under the MIT license
|
|
* https://opensource.org/licenses/MIT
|
|
*
|
|
*/
|
|
!function(X,R,U){"use strict";function V(e){return"function"==typeof e&&"number"!=typeof e.nodeType}R=void 0!==R&&R.Math===Math?R:globalThis,X.fn.modal=function(L){var N,e=X(this),I=X(R),j=X(U),z=X("body"),q=e.selector||"",B=Date.now(),W=[],P=L,K="string"==typeof P,Q=[].slice.call(arguments,1);return e.each(function(){var i,o,s,e,n,t,a,r,c,l,d,u=X.isPlainObject(L)?X.extend(!0,{},X.fn.modal.settings,L):X.extend({},X.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,v=u.error,p="."+h,b="module-"+h,y=X(this),x=[R,U].indexOf(u.context)<0?j.find(u.context):z,k=x[0]===z[0],w=y.find(f.closeIcon),C=y.hasClass("modal"),S=this,A=C?y.data(b):void 0,M=!1,D="",T="",H=!1,F=!1,O=!1,E={initialize:function(){var s;E.create.id(),C||(E.create.modal(),V(u.onHidden)||(u.onHidden=function(){E.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(E.helpers.escape(u.title,u.preserveHTML)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(E.helpers.escape(u.content,u.preserveHTML)).addClass(u.classContent),E.has.configActions()&&(0===(s=y.find(f.actions).addClass(u.classActions)).length?s=X("<div/>",{class:m.actions+" "+(u.classActions||"")}).appendTo(y):s.empty(),u.actions.forEach(function(e){var t=e[g.icon]?"<i "+(e[g.text]?'aria-hidden="true"':"")+' class="'+E.helpers.deQuote(e[g.icon])+' icon"></i>':"",i=E.helpers.escape(e[g.text]||"",u.preserveHTML),n=E.helpers.deQuote(e[g.class]||""),o=e[g.click]&&V(e[g.click])?e[g.click]:function(){};s.append(X("<button/>",{html:t+i,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+n,on:{click:function(){var e=X(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(S,y)||E.hide()}}}))})),E.cache={},E.verbose("Initializing dimmer",x),E.create.dimmer(),u.allowMultiple&&E.create.innerDimmer(),u.centered||y.addClass("top aligned"),E.refreshModals(),E.bind.events(),E.observeChanges(),E.instantiate(),u.autoShow&&E.show()},instantiate:function(){E.verbose("Storing instance of modal"),A=E,y.data(b,A)},create:{modal:function(){var e;y=X("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(w=X("<i/>",{class:m.close,role:"button",tabindex:0,"aria-label":u.text.close}),y.append(w)),""!==u.title&&(e="_"+E.get.id()+"title",y.attr("aria-labelledby",e),X("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+E.get.id()+"desc",y.attr("aria-describedby",e),X("<div/>",{class:m.content,id:e}).appendTo(y)),E.has.configActions()&&X("<div/>",{class:m.actions}).appendTo(y),x.append(y),S=y[0]},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=X.extend(!0,e,u.dimmerSettings);void 0===X.fn.dimmer?E.error(v.dimmer):(E.debug("Creating dimmer"),n=x.dimmer(e),H=E.is.scrolling(),u.detachable?(E.verbose("Modal is detachable, moving content into dimmer"),n.dimmer("add content",y)):E.set.undetached(),t=n.dimmer("get dimmer"))},id:function(){l=(Math.random().toString(16)+"000000000").slice(2,10),c="."+l,E.verbose("Creating unique id for element",l)},innerDimmer:function(){0===y.find(f.dimmer).length&&X("<div/>",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){d&&d.disconnect(),E.verbose("Destroying previous modal"),y.removeData(b).off(p),I.off(c),t.off(c),w.off(c),i&&i.off(c),x.dimmer("destroy")},observeChanges:function(){"MutationObserver"in R&&((d=new MutationObserver(function(e){function o(e){for(var t=[],i=0,n=e.length;i<n;i++)Array.prototype.push.apply(t,o(e[i].childNodes)),t.push(e[i]);return t}var i=!1,n=!1;e.every(function(e){var t;return"attributes"===e.type?O&&("disabled"===e.attributeName||0<X(e.target).find(":input").addBack(":input").length)&&(n=!0):(i=!0,t=X(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=X(o(e.removedNodes)).filter("a[href], [tabindex], :input"),(0<t.length||0<e.length)&&(n=!0)),!n}),i&&u.observeChanges&&(E.debug("DOM tree modified, refreshing"),E.refresh()),n&&E.refreshInputs()})).observe(S,{attributeFilter:["class","disabled"],attributes:!0,childList:!0,subtree:!0}),E.debug("Setting up mutation observer",d))},refresh:function(){E.remove.scrolling(),E.cacheSizes(),E.can.useFlex()||E.set.modalOffset(),E.set.screenHeight(),E.set.type()},refreshModals:function(){s=y.siblings(f.modal),o=s.add(y)},refreshInputs:function(){i&&i.off("keydown"+c),0===(i=y.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===X(this).closest(".disabled").length})).length?(i=y).attr("tabindex",-1):y.removeAttr("tabindex"),i.first().on("keydown"+c,E.event.inputKeyDown.first),i.last().on("keydown"+c,E.event.inputKeyDown.last),u.autofocus&&0===i.filter(":focus").length&&E.set.autofocus()},attachEvents:function(e,t){var i=X(e);t=V(E[t])?E[t]:E.toggle,0<i.length?(E.debug("Attaching modal events to element",e,t),i.off(p).on("click"+p,t)):E.error(v.notFound,e)},bind:{events:function(){E.verbose("Attaching events"),y.on("click"+p,f.close,E.event.close).on("click"+p,f.approve,E.event.approve).on("click"+p,f.deny,E.event.deny),w.on("keyup"+c,E.event.closeKeyUp),I.on("resize"+c,E.event.resize).on("focus"+c,E.event.focus)},scrollLock:function(){n[0].addEventListener("touchmove",E.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){n[0].removeEventListener("touchmove",E.event.preventScroll,{passive:!1})}},get:{id:function(){return l},element:function(){return y},settings:function(){return u}},event:{approve:function(){M||!1===u.onApprove.call(S,X(this))?E.verbose("Approve callback returned false cancelling hide"):(M=!0,E.hide(function(){M=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){M||!1===u.onDeny.call(S,X(this))?E.verbose("Deny callback returned false cancelling hide"):(M=!0,E.hide(function(){M=!1}))},close:function(){E.hide()},closeKeyUp:function(e){e=e.which;e!==u.keys.enter&&e!==u.keys.space||!y.hasClass(m.front)||E.hide()},inputKeyDown:{first:function(e){e.which===u.keys.tab&&e.shiftKey&&(i.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==u.keys.tab||e.shiftKey||(i.first().trigger("focus"),e.preventDefault())}},mousedown:function(e){var t=X(e.target),i=E.is.rtl();(a=0<t.closest(f.modal).length)&&E.verbose("Mouse down event registered inside the modal"),(r=E.is.scrolling()&&(!i&&I.outerWidth()-u.scrollbarWidth<=e.clientX||i&&u.scrollbarWidth>=e.clientX))&&E.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(e){if(u.closable)if(a)E.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(r)E.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var t=0<X(e.target).closest(f.modal).length,e=X.contains(U.documentElement,e.target);if(!t&&e&&E.is.active()&&y.hasClass(m.front)){if(E.debug("Dimmer clicked, hiding all modals"),u.allowMultiple){if(!E.hideAll())return}else if(!E.hide())return;E.remove.clickaway()}}else E.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(E.timer),E.timer=setTimeout(e,t)},keyboard:function(e){e.which===u.keys.escape&&(u.closable?(E.debug("Escape key pressed hiding modal"),y.hasClass(m.front)&&E.hide()):E.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){n.dimmer("is active")&&(E.is.animating()||E.is.active())&&requestAnimationFrame(E.refresh)},focus:function(){n.dimmer("is active")&&E.is.active()&&u.autofocus&&requestAnimationFrame(E.set.autofocus)}},toggle:function(){E.is.active()||E.is.animating()?E.hide():E.show()},show:function(e){e=V(e)?e:function(){},E.refreshModals(),E.set.dimmerSettings(),E.set.dimmerStyles(),E.showModal(e)},hide:function(e){return e=V(e)?e:function(){},E.refreshModals(),E.hideModal(e)},showModal:function(e){e=V(e)?e:function(){},E.is.animating()||!E.is.active()?!1===u.onShow.call(S)?E.verbose("Show callback returned false cancelling show"):(F=E.has.scrollbar(),E.showDimmer(),E.cacheSizes(),F&&E.set.bodyMargin(),E.can.useFlex()?E.remove.legacy():(E.set.legacy(),E.set.modalOffset(),E.debug("Using non-flex legacy modal positioning.")),E.set.screenHeight(),E.set.type(),E.set.clickaway(),!u.allowMultiple&&E.others.active()?E.hideOthers(E.showModal):(M=!1,u.allowMultiple&&(E.others.active()&&s.filter("."+m.active).find(f.dimmer).addClass("active"),u.detachable&&y.detach().appendTo(t)),u.transition&&void 0!==X.fn.transition?(E.debug("Showing modal with css animations"),E.set.observeAttributes(!1),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.showMethod||u.transition)+" in",queue:u.queue,duration:u.transition.showDuration||u.duration,useFailSafe:!0,onComplete:function(){u.onVisible.apply(S),u.keyboardShortcuts&&E.add.keyboardShortcuts(),E.save.focus(),E.set.active(),E.refreshInputs(),requestAnimationFrame(E.set.observeAttributes),e()}})):E.error(v.noTransition))):E.debug("Modal is already visible")},hideModal:function(e,t,i){var n=s.filter("."+m.active).last();if(e=V(e)?e:function(){},!1===u.onHide.call(S,X(this)))return E.verbose("Hide callback returned false cancelling hide"),M=!1;(E.is.animating()||E.is.active())&&(E.debug("Hiding modal"),u.transition&&void 0!==X.fn.transition?(E.remove.active(),E.set.observeAttributes(!1),y.transition({debug:u.debug,verbose:u.verbose,silent:u.silent,animation:(u.transition.hideMethod||u.transition)+" out",queue:u.queue,duration:u.transition.hideDuration||u.duration,useFailSafe:!0,onStart:function(){E.others.active()||E.others.animating()||t||E.hideDimmer(),u.keyboardShortcuts&&!E.others.active()&&E.remove.keyboardShortcuts()},onComplete:function(){E.unbind.scrollLock(),E.remove.active(),u.allowMultiple&&(n.addClass(m.front),y.removeClass(m.front),(i?o:n).find(f.dimmer).removeClass("active")),V(u.onHidden)&&u.onHidden.call(S),E.remove.dimmerStyles(),E.restore.focus(),e()}})):E.error(v.noTransition))},showDimmer:function(){n.dimmer("is animating")||!n.dimmer("is active")?(F&&(k||t.css("top",n.scrollTop()),E.save.bodyMargin()),E.debug("Showing dimmer"),n.dimmer("show")):E.debug("Dimmer already visible")},hideDimmer:function(){n.dimmer("is animating")||n.dimmer("is active")?(E.unbind.scrollLock(),n.dimmer("hide",function(){F&&E.restore.bodyMargin(),E.remove.clickaway(),E.remove.screenHeight()})):E.debug("Dimmer is not visible cannot hide")},hideAll:function(i){var n,e=o.filter("."+m.active+", ."+m.animating);if(i=V(i)?i:function(){},0<e.length)return E.debug("Hiding all visible modals"),n=!0,X(e.get().reverse()).each(function(e,t){n=n&&X(t).modal("hide modal",i,!1,!0)}),n&&E.hideDimmer(),n},hideOthers:function(e){var t=s.filter("."+m.active+", ."+m.animating);e=V(e)?e:function(){},0<t.length&&(E.debug("Hiding other modals",s),t.modal("hide modal",e,!0))},others:{active:function(){return 0<s.filter("."+m.active).length},animating:function(){return 0<s.filter("."+m.animating).length}},add:{keyboardShortcuts:function(){E.verbose("Adding keyboard shortcuts"),j.on("keydown"+p,E.event.keyboard)}},save:{focus:function(){0<X(U.activeElement).closest(y).length||(e=X(U.activeElement).trigger("blur"))},bodyMargin:function(){D=x.css((k?"margin-":"padding-")+(E.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(D.replace(/[^\d.]/g,""),10),t=k?R.innerWidth-U.documentElement.clientWidth:x[0].offsetWidth-x[0].clientWidth;T=e+t}},restore:{focus:function(){e&&0<e.length&&u.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var i=E.can.leftBodyScrollbar()?"left":"right";x.css((k?"margin-":"padding-")+i,D),x.find(f.bodyFixed.replace("right",i)).each(function(){var e=X(this),t="fixed"===e.css("position")?"padding-"+i:i;e.css(t,"")})}},remove:{active:function(){y.removeClass(m.active)},legacy:function(){y.removeClass(m.legacy)},clickaway:function(){u.detachable||y.off("mousedown"+c),t.off("mousedown"+c),t.off("mouseup"+c)},dimmerStyles:function(){t.removeClass(m.inverted),n.removeClass(m.blurring)},bodyStyle:function(){""===x.attr("style")&&(E.verbose("Removing style attribute"),x.removeAttr("style"))},screenHeight:function(){E.debug("Removing page height"),x.css("height",""),E.remove.bodyStyle()},keyboardShortcuts:function(){E.verbose("Removing keyboard shortcuts"),j.off("keydown"+p)},scrolling:function(){H||n.removeClass(m.scrolling),y.removeClass(m.scrolling)}},cacheSizes:function(){y.addClass(m.loading);var e=y.prop("scrollHeight"),t=y.outerWidth(),i=y.outerHeight();void 0!==E.cache.pageHeight&&0===i||(X.extend(E.cache,{pageHeight:j.outerHeight(),width:t,height:i+u.offset,scrollHeight:e+u.offset,contextHeight:(k?I:n).height()}),E.cache.topOffset=-E.cache.height/2),y.removeClass(m.loading),E.debug("Caching modal and container sizes",E.cache)},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var i={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return i[e]}):e}},can:{leftBodyScrollbar:function(){return void 0===E.cache.leftBodyScrollbar&&(E.cache.leftBodyScrollbar=E.is.rtl()&&(E.is.iframe&&!E.is.firefox()||E.is.safari()||E.is.edge()||E.is.ie())),E.cache.leftBodyScrollbar},useFlex:function(){return"auto"===u.useFlex?u.detachable&&!E.is.ie():(u.useFlex&&E.is.ie()?E.debug("useFlex true is not supported in IE"):u.useFlex&&!u.detachable&&E.debug("useFlex true in combination with detachable false is not supported"),u.useFlex)},fit:function(){var e=E.cache.contextHeight,t=E.cache.contextHeight/2,i=E.cache.topOffset,n=E.cache.scrollHeight,o=E.cache.height,s=u.padding;return o<n?t+i+n+s<e:o+2*s<e}},has:{configActions:function(){return Array.isArray(u.actions)&&0<u.actions.length},scrollbar:function(){return k||"hidden"!==x.css("overflow-y")}},is:{active:function(){return y.hasClass(m.active)},ie:function(){var e,t;return void 0===E.cache.isIE&&(e=!R.ActiveXObject&&"ActiveXObject"in R,t="ActiveXObject"in R,E.cache.isIE=e||t),E.cache.isIE},animating:function(){return y.transition("is animating")},scrolling:function(){return n.hasClass(m.scrolling)},modernBrowser:function(){return!(R.ActiveXObject||"ActiveXObject"in R)},rtl:function(){return void 0===E.cache.isRTL&&(E.cache.isRTL="rtl"===y.attr("dir")||"rtl"===y.css("direction")||"rtl"===z.attr("dir")||"rtl"===z.css("direction")||"rtl"===x.attr("dir")||"rtl"===x.css("direction")),E.cache.isRTL},safari:function(){return void 0===E.cache.isSafari&&(E.cache.isSafari=/constructor/i.test(R.HTMLElement)||!!R.ApplePaySession),E.cache.isSafari},edge:function(){return void 0===E.cache.isEdge&&(E.cache.isEdge=!!R.setImmediate&&!E.is.ie()),E.cache.isEdge},firefox:function(){return void 0===E.cache.isFirefox&&(E.cache.isFirefox=!!R.InstallTrigger),E.cache.isFirefox},iframe:function(){return!(self===top)}},set:{observeAttributes:function(e){O=!1!==e},autofocus:function(){var e=i.filter("[autofocus]"),t=i.filter(":input"),e=(0<e.length?e:0<t.length?t:i.filter(":not(i.close)")).first();0<(e=0===e.length&&0<i.length?i.first():e).length&&e.trigger("focus")},bodyMargin:function(){var i=E.can.leftBodyScrollbar()?"left":"right";(u.detachable||E.can.fit())&&x.css((k?"margin-":"padding-")+i,T+"px"),x.find(f.bodyFixed.replace("right",i)).each(function(){var e=X(this),t="fixed"===e.css("position")?"padding-"+i:i;e.css(t,"calc("+e.css(t)+" + "+T+"px)")})},clickaway:function(){u.detachable||y.on("mousedown"+c,E.event.mousedown),t.on("mousedown"+c,E.event.mousedown),t.on("mouseup"+c,E.event.mouseup)},dimmerSettings:function(){var e;void 0===X.fn.dimmer?E.error(v.dimmer):(e={debug:u.debug,dimmerName:"modals",closable:"auto",useFlex:E.can.useFlex(),duration:{show:u.transition.showDuration||u.duration,hide:u.transition.hideDuration||u.duration}},e=X.extend(!0,e,u.dimmerSettings),u.inverted&&(e.variation=void 0!==e.variation?e.variation+" inverted":"inverted"),x.dimmer("setting",e))},dimmerStyles:function(){u.inverted?t.addClass(m.inverted):t.removeClass(m.inverted),u.blurring?n.addClass(m.blurring):n.removeClass(m.blurring)},modalOffset:function(){var e;u.detachable?y.css({marginTop:!y.hasClass("aligned")&&E.can.fit()?-E.cache.height/2:u.padding/2,marginLeft:-E.cache.width/2}):(e=E.can.fit(),y.css({top:!y.hasClass("aligned")&&e?j.scrollTop()+(E.cache.contextHeight-E.cache.height)/2:!e||y.hasClass("top")?j.scrollTop()+u.padding:j.scrollTop()+(E.cache.contextHeight-E.cache.height-u.padding),marginLeft:-E.cache.width/2})),E.verbose("Setting modal offset for legacy mode")},screenHeight:function(){E.can.fit()?x.css("height",""):y.hasClass("bottom")||(E.debug("Modal is taller than page content, resizing page height"),x.css("height",E.cache.height+2*u.padding+"px"))},active:function(){y.addClass(m.active+" "+m.front),s.filter("."+m.active).removeClass(m.front)},scrolling:function(){n.addClass(m.scrolling),y.addClass(m.scrolling),E.unbind.scrollLock()},legacy:function(){y.addClass(m.legacy)},type:function(){E.can.fit()?(E.verbose("Modal fits on screen"),E.others.active()||E.others.animating()||(E.remove.scrolling(),E.bind.scrollLock())):y.hasClass("bottom")?E.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(E.verbose("Modal cannot fit on screen setting to scrolling"),E.set.scrolling())},undetached:function(){n.addClass(m.undetached)}},setting:function(e,t){if(E.debug("Changing setting",e,t),X.isPlainObject(e))X.extend(!0,u,e);else{if(void 0===t)return u[e];X.isPlainObject(u[e])?X.extend(!0,u[e],t):u[e]=t}},internal:function(e,t){if(X.isPlainObject(e))X.extend(!0,E,e);else{if(void 0===t)return E[e];E[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?E.performance.log(arguments):(E.debug=Function.prototype.bind.call(console.info,console,u.name+":"),E.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?E.performance.log(arguments):(E.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),E.verbose.apply(console,arguments)))},error:function(){u.silent||(E.error=Function.prototype.bind.call(console.error,console,u.name+":"),E.error.apply(console,arguments))},performance:{log:function(e){var t,i;u.performance&&(i=(t=Date.now())-(B||t),B=t,W.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":i})),clearTimeout(E.performance.timer),E.performance.timer=setTimeout(E.performance.display,500)},display:function(){var e=u.name+":",i=0;B=!1,clearTimeout(E.performance.timer),X.each(W,function(e,t){i+=t["Execution Time"]}),e+=" "+i+"ms",q&&(e+=" '"+q+"'"),0<W.length&&(console.groupCollapsed(e),console.table?console.table(W):X.each(W,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),W=[]}},invoke:function(n,e,t){var o,s,i,a=A;return e=e||Q,t=t||S,"string"==typeof n&&void 0!==a&&(n=n.split(/[ .]/),o=n.length-1,X.each(n,function(e,t){var i=e!==o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(X.isPlainObject(a[i])&&e!==o)a=a[i];else{if(void 0!==a[i])return s=a[i],!1;{if(!X.isPlainObject(a[t])||e===o)return void 0!==a[t]?s=a[t]:E.error(v.method,n),!1;a=a[t]}}})),V(s)?i=s.apply(t,e):void 0!==s&&(i=s),Array.isArray(N)?N.push(i):void 0!==N?N=[N,i]:void 0!==i&&(N=i),s}};K?(void 0===A&&(V(u.templates[P])&&(u.autoShow=!0,u.className.modal=u.className.template,u=X.extend(!0,{},u,u.templates[P].apply(E,Q)),m=u.className,u.namespace,g=u.fields,v=u.error),E.initialize()),V(u.templates[P])||E.invoke(P)):(void 0!==A&&A.invoke("destroy"),E.initialize(),N=y)}),void 0!==N?N:this},X.modal=X.fn.modal,X.fn.modal.settings={name:"Modal",namespace:"modal",useFlex:"auto",offset:0,silent:!1,debug:!1,verbose:!1,performance:!0,observeChanges:!1,allowMultiple:!1,detachable:!0,closable:!0,autofocus:!0,restoreFocus:!0,autoShow:!1,inverted:!1,blurring:!1,centered:!0,dimmerSettings:{closable:!1,useCSS:!0},keyboardShortcuts:!0,context:"body",queue:!1,duration:500,transition:"scale",padding:50,scrollbarWidth:10,title:"",content:"",class:"",classTitle:"",classContent:"",classActions:"",closeIcon:!1,actions:!1,preserveHTML:!0,fields:{class:"class",text:"text",icon:"icon",click:"click"},onShow:function(){},onVisible:function(){},onHide:function(){return!0},onHidden:!1,onApprove:function(){return!0},onDeny:function(){return!0},keys:{space:32,enter:13,escape:27,tab:9},selector:{title:"> .header",content:"> .content",actions:"> .actions",close:"> .close",closeIcon:"> .close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel",modal:".ui.modal",dimmer:"> .ui.dimmer",bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.fixed.nag, > .ui.fixed.nag > .close",prompt:".ui.input > input"},error:{dimmer:"UI Dimmer, a required component is not included in this page",method:"The method you called is not defined.",notFound:"The element you specified could not be found"},className:{active:"active",animating:"animating",blurring:"blurring",inverted:"inverted",legacy:"legacy",loading:"loading",scrolling:"scrolling",undetached:"undetached",front:"front",close:"close icon",button:"ui button",modal:"ui modal",title:"header",content:"content",actions:"actions",template:"ui tiny modal",ok:"positive",cancel:"negative",prompt:"ui fluid input",innerDimmer:"ui inverted dimmer"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},X.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return X.isPlainObject(e[0])?X.extend({handler:function(){},content:"",title:""},e[0]):(V(e[e.length-1])||e.push(function(){}),{handler:e.pop(),content:e.pop()||"",title:e.pop()||""})},alert:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments),i=t.handler;return{title:t.title,content:t.content,onApprove:i,actions:[{text:e.text.ok,class:e.className.ok,click:i}]}},confirm:function(){function e(){n.handler(!0)}function t(){n.handler(!1)}var i=this.get.settings(),n=i.templates.getArguments(arguments);return{title:n.title,content:n.content,onApprove:e,onDeny:t,actions:[{text:i.text.ok,class:i.className.ok,click:e},{text:i.text.cancel,class:i.className.cancel,click:t}]}},prompt:function(){function e(){var e=i.get.settings(),e=i.get.element().find(e.selector.prompt)[0];o.handler(X(e).val())}function t(){o.handler(null)}var i=this,n=this.get.settings(),o=n.templates.getArguments(arguments);return 0===X(X.parseHTML(o.content)).filter(".ui.input").length&&(o.content+='<p><div class="'+this.helpers.deQuote(n.className.prompt)+'"><input placeholder="'+this.helpers.deQuote(o.placeholder||"")+'" type="text" value="'+this.helpers.deQuote(o.defaultValue||"")+'"></div></p>'),{title:o.title,content:o.content,onApprove:e,onDeny:t,actions:[{text:n.text.ok,class:n.className.ok,click:e},{text:n.text.cancel,class:n.className.cancel,click:t}]}}}}(jQuery,window,document); |