11 lines
No EOL
22 KiB
JavaScript
11 lines
No EOL
22 KiB
JavaScript
/*
|
|
* # Fomantic UI - 2.9.3
|
|
* https://github.com/fomantic/Fomantic-UI
|
|
* https://fomantic-ui.com/
|
|
*
|
|
* Copyright 2023 Contributors
|
|
* Released under the MIT license
|
|
* https://opensource.org/licenses/MIT
|
|
*
|
|
*/
|
|
!function(Q,W,U){"use strict";function X(e){return"function"==typeof e&&"number"!=typeof e.nodeType}W=void 0!==W&&W.Math===Math?W:globalThis,Q.fn.flyout=function(O){var D,e=Q(this),N=Q(W),L=Q(U),B=(Q("html"),Q("head")),z=Q("body"),I=Date.now(),j=[],R=O,q="string"==typeof R,K=[].slice.call(arguments,1),V=function(e,t){var n;return 0<=[W,U].indexOf(e)?n=z:0===(n=Q(t.document).find(e)).length&&(n=t.frameElement?V(e,t.parent):z),n};return e.each(function(){var n,e,o,s,t,i,r,l=Q.isPlainObject(O)?Q.extend(!0,{},Q.fn.flyout.settings,O):Q.extend({},Q.fn.flyout.settings),c=l.selector,a=l.className,u=l.namespace,d=l.fields,f=l.regExp,h=l.error,g="."+u,p="module-"+u,v=Q(this),b=V(l.context,W),m=v.find(c.close),y=v.children(c.flyout),k=b.children(c.pusher),x=v.hasClass("flyout"),S=this,A=x?v.data(p):void 0,C=!1,w=b[0]===z[0],T="",F="",E=!1,H=!1,M=!1,P={initialize:function(){var s;P.debug("Initializing flyout",O),P.create.id(),x||(P.create.flyout(),X(l.onHidden)||(l.onHidden=function(){P.destroy(),v.remove()}),l.autoShow||(l.autoShow=!0)),v.addClass(l.class),""!==l.title&&v.find(c.header).html(P.helpers.escape(l.title,l.preserveHTML)).addClass(l.classTitle),""!==l.content&&v.find(c.content).html(P.helpers.escape(l.content,l.preserveHTML)).addClass(l.classContent),P.has.configActions()&&(0===(s=v.find(c.actions).addClass(l.classActions)).length?s=Q("<div/>",{class:a.actions+" "+(l.classActions||"")}).appendTo(v):s.empty(),l.actions.forEach(function(e){var t=e[d.icon]?"<i "+(e[d.text]?'aria-hidden="true"':"")+' class="'+P.helpers.deQuote(e[d.icon])+' icon"></i>':"",n=P.helpers.escape(e[d.text]||"",l.preserveHTML),i=P.helpers.deQuote(e[d.class]||""),o=e[d.click]&&X(e[d.click])?e[d.click]:function(){};s.append(Q("<button/>",{html:t+n,"aria-label":(e[d.text]||e[d.icon]||"").replace(/<[^>]+(>|$)/g,""),class:a.button+" "+i,on:{click:function(){!1!==o.call(S,v)&&P.hide()}}}))})),l.delaySetup?requestAnimationFrame(P.setup.layout):P.setup.layout(),requestAnimationFrame(function(){P.setup.cache()}),"left"!==P.get.direction()&&"right"!==P.get.direction()||(P.setup.heights(),P.bind.resize()),P.bind.events(),P.observeChanges(),P.instantiate(),l.autoShow&&P.show()},instantiate:function(){P.verbose("Storing instance of module",P),A=P,v.data(p,A)},create:{flyout:function(){var e;P.verbose("Programmaticaly create flyout",b),v=Q("<div/>",{class:a.flyout,role:"dialog","aria-modal":l.dimPage}),l.closeIcon&&(m=Q("<i/>",{class:a.close,role:"button",tabindex:0,"aria-label":l.text.close}),v.append(m)),""!==l.title&&(e="_"+P.get.id()+"title",v.attr("aria-labelledby",e),Q("<div/>",{class:a.header,id:e}).appendTo(v)),""!==l.content&&(e="_"+P.get.id()+"desc",v.attr("aria-describedby",e),Q("<div/>",{class:a.content,id:e}).appendTo(v)),P.has.configActions()&&Q("<div/>",{class:a.actions}).appendTo(v),v.prependTo(b),S=v[0]},id:function(){t=(Math.random().toString(16)+"000000000").slice(2,10),s="."+t,P.verbose("Creating unique id for element",t)}},destroy:function(){i&&i.disconnect(),P.verbose("Destroying previous module for",v),v.off(g).removeData(p),m.off(s),n&&n.off(s),b.off(s),N.off(s),L.off(s)},event:{keyboard:function(e){e.which===l.keys.escape&&(l.closable?(P.debug("Escape key pressed hiding flyout"),P.hide()):P.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){P.setup.heights()},focus:function(){H=!0},click:function(e){H&&U.activeElement!==e.target&&P.is.visible()&&l.autofocus&&l.dimPage&&0===Q(U.activeElement).closest(c.flyout).length&&requestAnimationFrame(P.set.autofocus),H=!1},clickaway:function(e){var t;l.closable&&(t=0<k.find(e.target).length||k.is(e.target),e=b.is(e.target),t&&(P.verbose("User clicked on dimmed page"),P.hide()),e&&(P.verbose("User clicked on dimmable context (scaled out page)"),P.hide()))},close:function(e){P.hide()},closeKeyUp:function(e){e=e.which;e!==l.keys.enter&&e!==l.keys.space||P.hide()},inputKeyDown:{first:function(e){e.which===l.keys.tab&&e.shiftKey&&(n.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==l.keys.tab||e.shiftKey||(n.first().trigger("focus"),e.preventDefault())}},approve:function(e){C||!1===l.onApprove.call(P.element,Q(this))?P.verbose("Approve callback returned false cancelling close"):(C=!0,P.hide(function(){C=!1}))},deny:function(e){C||!1===l.onDeny.call(P.element,Q(this))?P.verbose("Deny callback returned false cancelling close"):(C=!0,P.hide(function(){C=!1}))},touch:function(e){},containScroll:function(e){S.scrollTop<=0&&(S.scrollTop=1),S.scrollTop+S.offsetHeight>=S.scrollHeight&&(S.scrollTop=S.scrollHeight-S.offsetHeight-1)},scroll:function(e){0===Q(e.target).closest(c.flyout).length&&e.preventDefault()}},bind:{resize:function(){P.verbose("Adding resize event to window",N),N.on("resize"+s,P.event.resize)},events:function(){P.verbose("Attaching events"),v.on("click"+g,c.close,P.event.close).on("click"+g,c.approve,P.event.approve).on("click"+g,c.deny,P.event.deny),m.on("keyup"+s,P.event.closeKeyUp),N.on("focus"+s,P.event.focus),b.on("click"+s,P.event.click)},clickaway:function(){P.verbose("Adding clickaway events to context",b),b.on("click"+s,P.event.clickaway).on("touchend"+s,P.event.clickaway)},scrollLock:function(){l.scrollLock&&(P.debug("Disabling page scroll"),(E=P.has.scrollbar())&&(P.save.bodyMargin(),P.set.bodyMargin()),b.addClass(a.locked)),P.verbose("Adding events to contain flyout scroll"),L.on("touchmove"+s,P.event.touch),v.on("scroll"+g,P.event.containScroll)}},unbind:{clickaway:function(){P.verbose("Removing clickaway events from context",b),b.off(s)},scrollLock:function(){P.verbose("Removing scroll lock from page"),E&&P.restore.bodyMargin(),b.removeClass(a.locked),L.off(s),v.off("scroll"+g)}},add:{inlineCSS:function(){var e=P.cache.width||v.outerWidth(),t=P.cache.height||v.outerHeight(),n=P.is.rtl(),i=P.get.direction(),t={left:e,right:-e,top:t,bottom:-t};n&&(P.verbose("RTL detected, flipping widths"),t.left=-e,t.right=e),n="<style>","left"===i||"right"===i?(P.debug("Adding CSS rules for animation distance",e),n+=" .ui.visible."+i+".flyout ~ .fixed, .ui.visible."+i+".flyout ~ .pusher { transform: translate3d("+t[i]+"px, 0, 0); }"):"top"!==i&&"bottom"!==i||(n+=" .ui.visible."+i+".flyout ~ .fixed, .ui.visible."+i+".flyout ~ .pusher { transform: translate3d(0, "+t[i]+"px, 0); }"),P.is.ie()&&("left"===i||"right"===i?(P.debug("Adding CSS rules for animation distance",e),n+=" body.pushable > .ui.visible."+i+".flyout ~ .pusher::after { transform: translate3d("+t[i]+"px, 0, 0); }"):"top"!==i&&"bottom"!==i||(n+=" body.pushable > .ui.visible."+i+".flyout ~ .pusher::after { transform: translate3d(0, "+t[i]+"px, 0); }"),n+=" body.pushable > .ui.visible.left.flyout ~ .ui.visible.right.flyout ~ .pusher::after, body.pushable > .ui.visible.right.flyout ~ .ui.visible.left.flyout ~ .pusher::after { transform: translate3d(0, 0, 0); }"),o=Q(n+="</style>").appendTo(B),P.debug("Adding sizing css to head",o)},keyboardShortcuts:function(){P.verbose("Adding keyboard shortcuts"),L.on("keydown"+g,P.event.keyboard)}},observeChanges:function(){"MutationObserver"in W&&((i=new MutationObserver(function(e){function o(e){for(var t=[],n=0,i=e.length;n<i;n++)Array.prototype.push.apply(t,o(e[n].childNodes)),t.push(e[n]);return t}var n=!1,i=!0;e.every(function(e){var t;return"attributes"===e.type?M&&("disabled"===e.attributeName||0<Q(e.target).find(":input").addBack(":input").filter(":visible").length)&&(n=!0):(t=Q(o(e.addedNodes)).filter("a[href], [tabindex], :input:enabled").filter(":visible"),e=Q(o(e.removedNodes)).filter("a[href], [tabindex], :input"),(0<t.length||0<e.length)&&(n=!0,(0<t.filter(":input").length||0<e.filter(":input").length)&&(i=!1))),!n}),n&&P.refreshInputs(i)})).observe(S,{attributeFilter:["class","disabled"],attributes:!0,childList:!0,subtree:!0}),P.debug("Setting up mutation observer",i))},refresh:function(){P.verbose("Refreshing selector cache"),b=V(l.context,W),P.refreshFlyouts(),k=b.children(c.pusher),P.clear.cache()},refreshFlyouts:function(){P.verbose("Refreshing other flyouts"),y=b.children(c.flyout)},refreshInputs:function(e){n&&n.off("keydown"+s),l.dimPage&&(0===(n=v.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===Q(this).closest(".disabled").length})).filter(":input").length?(n=v.add(n),v.attr("tabindex",-1)):v.removeAttr("tabindex"),n.first().on("keydown"+s,P.event.inputKeyDown.first),n.last().on("keydown"+s,P.event.inputKeyDown.last),!e&&l.autofocus&&0===n.filter(":focus").length&&P.set.autofocus())},setup:{cache:function(){P.cache={width:v.outerWidth(),height:v.outerHeight()}},layout:function(){0===b.children(c.pusher).length&&(P.debug("Adding wrapper element for flyout"),P.error(h.pusher),k=Q('<div class="pusher" />'),b.children().not(c.omitted).not(y).wrapAll(k),P.refresh()),0!==v.nextAll(c.pusher).length&&v.nextAll(c.pusher)[0]===k[0]||(P.debug("Moved flyout to correct parent element"),P.error(h.movedFlyout,S),v.detach().prependTo(b),P.refresh()),P.is.mobile()&&v.addClass(a.fullscreen),P.clear.cache(),P.set.pushable(),P.set.direction()},heights:function(){P.debug("Setting up heights",v);var e=v.children(c.header),t=v.children(c.content),n=v.children(c.actions),e=(b.height()||0)-(e.outerHeight()||0)-(n.outerHeight()||0);0<e&&t.css("min-height",String(e)+"px")}},attachEvents:function(e,t){var n=Q(e);t=X(P[t])?P[t]:P.toggle,0<n.length?(P.debug("Attaching flyout events to element",e,t),n.on("click"+g,t)):P.error(h.notFound,e)},show:function(e){e=X(e)?e:function(){},P.is.hidden()?!1===l.onShow.call(S)?P.verbose("Show callback returned false cancelling show"):(P.refresh(),P.othersActive()&&(P.debug("Other flyouts currently visible"),l.exclusive?P.hideOthers():C=!1),P.set.dimmerStyles(),P.set.observeAttributes(!1),P.pushPage(function(){e.call(S),l.onVisible.call(S),l.keyboardShortcuts&&P.add.keyboardShortcuts(),P.save.focus(),P.refreshInputs(),requestAnimationFrame(P.set.observeAttributes)}),l.onChange.call(S)):P.debug("Flyout is already visible")},hide:function(e){if(e=X(e)?e:function(){},!1===l.onHide.call(S,Q(this)))return P.verbose("Hide callback returned false cancelling hide"),C=!1;(P.is.visible()||P.is.animating())&&(P.debug("Hiding flyout",e),P.refreshFlyouts(),P.set.observeAttributes(!1),P.pullPage(function(){e.call(S),X(l.onHidden)&&l.onHidden.call(S),P.restore.focus()}),l.onChange.call(S))},othersAnimating:function(){return 0<y.not(v).filter("."+a.animating).length},othersVisible:function(){return 0<y.not(v).filter("."+a.visible).length},othersActive:function(){return P.othersVisible()||P.othersAnimating()},hideOthers:function(e){var t=y.not(v).filter("."+a.visible),n=t.length,i=0;e=e||function(){},t.flyout("hide",function(){++i===n&&e()})},toggle:function(){P.verbose("Determining toggled direction"),P.is.hidden()?P.show():P.hide()},pushPage:function(t){var e,n,i;t=X(t)?t:function(){},P.set.overlay(),l.returnScroll&&(r=(w?N:b).scrollTop()),P.bind.scrollLock(),e=function(){P.bind.clickaway(),P.add.inlineCSS(),P.set.animating(),P.set.visible()},n=function(){P.set.dimmed()},i=function(e){e.target===v[0]&&(v.off("transitionend"+s,i),P.remove.animating(),t.call(S))},v.off("transitionend"+s),v.on("transitionend"+s,i),requestAnimationFrame(e),l.dimPage&&!P.othersVisible()&&requestAnimationFrame(n)},pullPage:function(t){var e,n;t=X(t)?t:function(){},P.verbose("Removing context push state",P.get.direction()),P.unbind.clickaway(),P.othersActive()||(P.unbind.scrollLock(),l.keyboardShortcuts&&P.remove.keyboardShortcuts()),e=function(){P.set.overlay(),P.set.animating(),l.dimPage&&!P.othersVisible()&&P.set.closing(),P.remove.visible()},n=function(e){e.target===v[0]&&(v.off("transitionend"+s,n),P.remove.animating(),P.remove.closing(),P.remove.overlay(),P.remove.inlineCSS(),l.returnScroll&&P.scrollBack(),l.dimPage&&!P.othersVisible()&&k.removeClass(a.dimmed),t.call(S))},v.off("transitionend"+s),v.on("transitionend"+s,n),requestAnimationFrame(e)},scrollToTop:function(){P.verbose("Scrolling to top of page to avoid animation issues"),v.scrollTop(0),(w?N:b)[0].scrollTo(0,0)},scrollBack:function(){P.verbose("Scrolling back to original page position"),(w?N:b)[0].scrollTo(0,r)},clear:{cache:function(){P.verbose("Clearing cached dimensions"),P.cache={}}},set:{observeAttributes:function(e){M=!1!==e},autofocus:function(){var e=n.filter("[autofocus]"),t=n.filter(":input");(0<e.length?e:0<t.length?t:v).first().trigger("focus")},dimmerStyles:function(){l.blurring?k.addClass(a.blurring):k.removeClass(a.blurring)},bodyMargin:function(){var n=P.can.leftBodyScrollbar()?"left":"right";b.css((w?"margin-":"padding-")+n,F+"px"),b.find(c.bodyFixed.replace("right",n)).each(function(){var e=Q(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"calc("+e.css(t)+" + "+F+"px)")})},pushed:function(){b.addClass(a.pushed)},pushable:function(){b.addClass(a.pushable)},dimmed:function(){k.addClass(a.dimmed)},active:function(){v.addClass(a.active)},animating:function(){v.addClass(a.animating)},closing:function(){k.addClass(a.closing)},direction:function(e){e=e||P.get.direction(),v.addClass(a[e])},visible:function(){v.addClass(a.visible)},overlay:function(){v.addClass(a.overlay)}},remove:{inlineCSS:function(){P.debug("Removing inline css styles",o),o&&0<o.length&&o.remove()},keyboardShortcuts:function(){P.verbose("Removing keyboard shortcuts"),L.off("keydown"+g)},pushed:function(){b.removeClass(a.pushed)},pushable:function(){b.removeClass(a.pushable)},active:function(){v.removeClass(a.active)},animating:function(){v.removeClass(a.animating)},closing:function(){k.removeClass(a.closing)},direction:function(e){e=e||P.get.direction(),v.removeClass(a[e])},visible:function(){v.removeClass(a.visible)},overlay:function(){v.removeClass(a.overlay)}},get:{direction:function(){return v.hasClass(a.top)?a.top:v.hasClass(a.right)?a.right:v.hasClass(a.bottom)?a.bottom:a.left},id:function(){return t},element:function(){return v},settings:function(){return l}},can:{leftBodyScrollbar:function(){return void 0===P.cache.leftBodyScrollbar&&(P.cache.leftBodyScrollbar=P.is.rtl()&&(P.is.iframe&&!P.is.firefox()||P.is.safari()||P.is.edge()||P.is.ie())),P.cache.leftBodyScrollbar}},save:{focus:function(){0<Q(U.activeElement).closest(v).length||(e=Q(U.activeElement).trigger("blur"))},bodyMargin:function(){T=b.css((w?"margin-":"padding-")+(P.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(T.replace(/[^\d.]/g,""),10),t=w?W.innerWidth-U.documentElement.clientWidth:b[0].offsetWidth-b[0].clientWidth;F=e+t}},is:{safari:function(){return void 0===P.cache.isSafari&&(P.cache.isSafari=/constructor/i.test(W.HTMLElement)||!!W.ApplePaySession),P.cache.isSafari},edge:function(){return void 0===P.cache.isEdge&&(P.cache.isEdge=!!W.setImmediate&&!P.is.ie()),P.cache.isEdge},firefox:function(){return void 0===P.cache.isFirefox&&(P.cache.isFirefox=!!W.InstallTrigger),P.cache.isFirefox},iframe:function(){return!(self===top)},ie:function(){var e,t;return void 0===P.cache.isIE&&(e=!W.ActiveXObject&&"ActiveXObject"in W,t="ActiveXObject"in W,P.cache.isIE=e||t),P.cache.isIE},mobile:function(){var e=navigator.userAgent;return e.match(f.mobile)?(P.verbose("Browser was found to be mobile",e),!0):(P.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!P.is.visible()},visible:function(){return v.hasClass(a.visible)},animating:function(){return b.hasClass(a.animating)},rtl:function(){return void 0===P.cache.isRTL&&(P.cache.isRTL="rtl"===v.attr("dir")||"rtl"===v.css("direction")||"rtl"===z.attr("dir")||"rtl"===z.css("direction")||"rtl"===b.attr("dir")||"rtl"===b.css("direction")),P.cache.isRTL}},has:{configActions:function(){return Array.isArray(l.actions)&&0<l.actions.length},scrollbar:function(){return w||"hidden"!==b.css("overflow-y")}},restore:{focus:function(){e&&0<e.length&&l.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var n=P.can.leftBodyScrollbar()?"left":"right";b.css((w?"margin-":"padding-")+n,T),b.find(c.bodyFixed.replace("right",n)).each(function(){var e=Q(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"")})}},helpers:{deQuote:function(e){return String(e).replace(/"/g,"")},escape:function(e,t){if(t)return e;var n={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return n[e]}):e}},setting:function(e,t){if(P.debug("Changing setting",e,t),Q.isPlainObject(e))Q.extend(!0,l,e);else{if(void 0===t)return l[e];Q.isPlainObject(l[e])?Q.extend(!0,l[e],t):l[e]=t}},internal:function(e,t){if(Q.isPlainObject(e))Q.extend(!0,P,e);else{if(void 0===t)return P[e];P[e]=t}},debug:function(){!l.silent&&l.debug&&(l.performance?P.performance.log(arguments):(P.debug=Function.prototype.bind.call(console.info,console,l.name+":"),P.debug.apply(console,arguments)))},verbose:function(){!l.silent&&l.verbose&&l.debug&&(l.performance?P.performance.log(arguments):(P.verbose=Function.prototype.bind.call(console.info,console,l.name+":"),P.verbose.apply(console,arguments)))},error:function(){l.silent||(P.error=Function.prototype.bind.call(console.error,console,l.name+":"),P.error.apply(console,arguments))},performance:{log:function(e){var t,n;l.performance&&(n=(t=Date.now())-(I||t),I=t,j.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(P.performance.timer),P.performance.timer=setTimeout(function(){P.performance.display()},500)},display:function(){var e=l.name+":",n=0;I=!1,clearTimeout(P.performance.timer),Q.each(j,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",0<j.length&&(console.groupCollapsed(e),console.table?console.table(j):Q.each(j,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(i,e,t){var o,s,n,r=A;return e=e||K,t=S||t,"string"==typeof i&&void 0!==r&&(i=i.split(/[ .]/),o=i.length-1,Q.each(i,function(e,t){var n=e!==o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(Q.isPlainObject(r[n])&&e!==o)r=r[n];else{if(void 0!==r[n])return s=r[n],!1;{if(!Q.isPlainObject(r[t])||e===o)return void 0!==r[t]?s=r[t]:P.error(h.method,i),!1;r=r[t]}}})),X(s)?n=s.apply(t,e):void 0!==s&&(n=s),Array.isArray(D)?D.push(n):void 0!==D?D=[D,n]:void 0!==n&&(D=n),s}};q?(void 0===A&&(X(l.templates[R])&&(l.autoShow=!0,l.className.flyout=l.className.template,l=Q.extend(!0,{},l,l.templates[R].apply(P,K)),a=l.className,l.namespace,d=l.fields,h=l.error),P.initialize()),X(l.templates[R])||P.invoke(R)):(void 0!==A&&A.invoke("destroy"),P.initialize(),D=v)}),void 0!==D?D:this},Q.flyout=Q.fn.flyout,Q.fn.flyout.settings={name:"Flyout",namespace:"flyout",silent:!1,debug:!1,verbose:!1,performance:!0,context:"body",exclusive:!1,closable:!0,autofocus:!0,restoreFocus:!0,dimPage:!0,scrollLock:!1,returnScroll:!1,delaySetup:!1,autoShow:!1,keyboardShortcuts:!0,title:"",content:"",class:"",classTitle:"",classContent:"",classActions:"",closeIcon:!1,actions:!1,preserveHTML:!0,fields:{class:"class",text:"text",icon:"icon",click:"click"},onChange:function(){},onShow:function(){},onHide:function(){return!0},onHidden:!1,onVisible:function(){},onApprove:function(){},onDeny:function(){},keys:{space:32,enter:13,escape:27,tab:9},className:{flyout:"ui flyout",close:"close icon",header:"ui header",content:"content",actions:"actions",active:"active",animating:"animating",blurring:"blurring",closing:"closing",dimmed:"dimmed",locked:"locked",pushable:"pushable",pushed:"pushed",right:"right",top:"top",left:"left",bottom:"bottom",visible:"visible",overlay:"overlay",fullscreen:"fullscreen",template:"ui flyout",button:"ui button",ok:"positive",cancel:"negative",prompt:"ui fluid input"},selector:{bodyFixed:"> .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.right.flyout, > .ui.fixed.nag, > .ui.fixed.nag > .close",fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",flyout:".ui.flyout",header:".ui.header",content:".content",actions:".actions",close:".close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel"},regExp:{mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedFlyout:"Had to move flyout. For optimal performance make sure flyout and pusher are direct children of your body tag",notFound:"There were no elements that matched the specified selector"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},Q.fn.flyout.settings.templates={getArguments:function(e){e=[].slice.call(e);return Q.isPlainObject(e[0])?Q.extend({handler:function(){},content:"",title:""},e[0]):(X(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);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:t.handler}]}},confirm:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:function(){t.handler(!0)}},{text:e.text.cancel,class:e.className.cancel,click:function(){t.handler(!1)}}]}},prompt:function(){var t=this,e=this.get.settings(),n=e.templates.getArguments(arguments);return 0===Q(Q.parseHTML(n.content)).filter(".ui.input").length&&(n.content+='<p><div class="'+e.className.prompt+'"><input placeholder="'+this.helpers.deQuote(n.placeholder||"")+'" type="text" value="'+this.helpers.deQuote(n.defaultValue||"")+'"></div></p>'),{title:n.title,content:n.content,actions:[{text:e.text.ok,class:e.className.ok,click:function(){var e=t.get.settings(),e=t.get.element().find(e.selector.prompt)[0];n.handler(Q(e).val())}},{text:e.text.cancel,class:e.className.cancel,click:function(){n.handler(null)}}]}}}}(jQuery,window,document); |