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(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(M){var O,e=Q(this),D=Q(W),N=Q(U),L=Q("html"),B=Q("head"),z=Q("body"),I=e.selector||"",j=Date.now(),R=[],q=M,K="string"==typeof q,V=[].slice.call(arguments,1);return e.each(function(){var n,e,o,s,t,i,r,a=Q.isPlainObject(M)?Q.extend(!0,{},Q.fn.flyout.settings,M):Q.extend({},Q.fn.flyout.settings),l=a.selector,c=a.className,u=a.namespace,d=a.fields,f=a.regExp,h=a.error,g="."+u,p="module-"+u,v=Q(this),b=[W,U].indexOf(a.context)<0?N.find(a.context):z,m=v.find(l.close),y=v.children(l.flyout),k=b.children(l.pusher),x=v.hasClass("flyout"),S=this,A=x?v.data(p):void 0,C=!1,w=b[0]===z[0],T="",F="",H=!1,P=!1,E={initialize:function(){var s;E.debug("Initializing flyout",M),E.create.id(),x||(E.create.flyout(),X(a.onHidden)||(a.onHidden=function(){E.destroy(),v.remove()}),a.autoShow||(a.autoShow=!0)),v.addClass(a.class),""!==a.title&&v.find(l.header).html(E.helpers.escape(a.title,a.preserveHTML)).addClass(a.classTitle),""!==a.content&&v.find(l.content).html(E.helpers.escape(a.content,a.preserveHTML)).addClass(a.classContent),E.has.configActions()&&(0===(s=v.find(l.actions).addClass(a.classActions)).length?s=Q("<div/>",{class:c.actions+" "+(a.classActions||"")}).appendTo(v):s.empty(),a.actions.forEach(function(e){var t=e[d.icon]?"<i "+(e[d.text]?'aria-hidden="true"':"")+' class="'+E.helpers.deQuote(e[d.icon])+' icon"></i>':"",n=E.helpers.escape(e[d.text]||"",a.preserveHTML),i=E.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:c.button+" "+i,on:{click:function(){!1!==o.call(S,v)&&E.hide()}}}))})),a.delaySetup?requestAnimationFrame(E.setup.layout):E.setup.layout(),requestAnimationFrame(function(){E.setup.cache()}),"left"!==E.get.direction()&&"right"!==E.get.direction()||(E.setup.heights(),E.bind.resize()),E.bind.events(),E.observeChanges(),E.instantiate(),a.autoShow&&E.show()},instantiate:function(){E.verbose("Storing instance of module",E),A=E,v.data(p,A)},create:{flyout:function(){var e;E.verbose("Programmaticaly create flyout",b),v=Q("<div/>",{class:c.flyout,role:"dialog","aria-modal":a.dimPage}),a.closeIcon&&(m=Q("<i/>",{class:c.close,role:"button",tabindex:0,"aria-label":a.text.close}),v.append(m)),""!==a.title&&(e="_"+E.get.id()+"title",v.attr("aria-labelledby",e),Q("<div/>",{class:c.header,id:e}).appendTo(v)),""!==a.content&&(e="_"+E.get.id()+"desc",v.attr("aria-describedby",e),Q("<div/>",{class:c.content,id:e}).appendTo(v)),E.has.configActions()&&Q("<div/>",{class:c.actions}).appendTo(v),v.prependTo(b),S=v[0]},id:function(){t=(Math.random().toString(16)+"000000000").slice(2,10),s="."+t,E.verbose("Creating unique id for element",t)}},destroy:function(){i&&i.disconnect(),E.verbose("Destroying previous module for",v),v.off(g).removeData(p),E.is.ios()&&E.remove.ios(),m.off(s),n&&n.off(s),b.off(s),D.off(s),N.off(s)},event:{keyboard:function(e){e.which===a.keys.escape&&(a.closable?(E.debug("Escape key pressed hiding flyout"),E.hide()):E.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){E.setup.heights()},focus:function(){E.is.visible()&&a.autofocus&&a.dimPage&&requestAnimationFrame(E.set.autofocus)},clickaway:function(e){var t;a.closable&&(t=0<k.find(e.target).length||k.is(e.target),e=b.is(e.target),t&&(E.verbose("User clicked on dimmed page"),E.hide()),e&&(E.verbose("User clicked on dimmable context (scaled out page)"),E.hide()))},close:function(e){E.hide()},closeKeyUp:function(e){e=e.which;e!==a.keys.enter&&e!==a.keys.space||E.hide()},inputKeyDown:{first:function(e){e.which===a.keys.tab&&e.shiftKey&&(n.last().trigger("focus"),e.preventDefault())},last:function(e){e.which!==a.keys.tab||e.shiftKey||(n.first().trigger("focus"),e.preventDefault())}},approve:function(e){C||!1===a.onApprove.call(E.element,Q(this))?E.verbose("Approve callback returned false cancelling close"):(C=!0,E.hide(function(){C=!1}))},deny:function(e){C||!1===a.onDeny.call(E.element,Q(this))?E.verbose("Deny callback returned false cancelling close"):(C=!0,E.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(l.flyout).length&&e.preventDefault()}},bind:{resize:function(){E.verbose("Adding resize event to window",D),D.on("resize"+s,E.event.resize)},events:function(){E.verbose("Attaching events"),v.on("click"+g,l.close,E.event.close).on("click"+g,l.approve,E.event.approve).on("click"+g,l.deny,E.event.deny),m.on("keyup"+s,E.event.closeKeyUp),D.on("focus"+s,E.event.focus)},clickaway:function(){E.verbose("Adding clickaway events to context",b),b.on("click"+s,E.event.clickaway).on("touchend"+s,E.event.clickaway)},scrollLock:function(){a.scrollLock&&(E.debug("Disabling page scroll"),(H=E.has.scrollbar())&&(E.save.bodyMargin(),E.set.bodyMargin()),b.addClass(c.locked)),E.verbose("Adding events to contain flyout scroll"),N.on("touchmove"+s,E.event.touch),v.on("scroll"+g,E.event.containScroll)}},unbind:{clickaway:function(){E.verbose("Removing clickaway events from context",b),b.off(s)},scrollLock:function(){E.verbose("Removing scroll lock from page"),H&&E.restore.bodyMargin(),b.removeClass(c.locked),N.off(s),v.off("scroll"+g)}},add:{inlineCSS:function(){var e=E.cache.width||v.outerWidth(),t=E.cache.height||v.outerHeight(),n=E.is.rtl(),i=E.get.direction(),t={left:e,right:-e,top:t,bottom:-t};n&&(E.verbose("RTL detected, flipping widths"),t.left=-e,t.right=e),n="<style>","left"===i||"right"===i?(E.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); }"),E.is.ie()&&("left"===i||"right"===i?(E.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),E.debug("Adding sizing css to head",o)},keyboardShortcuts:function(){E.verbose("Adding keyboard shortcuts"),N.on("keydown"+g,E.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;e.every(function(e){var t;return"attributes"===e.type?P&&("disabled"===e.attributeName||0<Q(e.target).find(":input").addBack(":input").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)),!n}),n&&E.refreshInputs()})).observe(S,{attributeFilter:["class","disabled"],attributes:!0,childList:!0,subtree:!0}),E.debug("Setting up mutation observer",i))},refresh:function(){E.verbose("Refreshing selector cache"),b=[W,U].indexOf(a.context)<0?N.find(a.context):z,E.refreshFlyouts(),k=b.children(l.pusher),E.clear.cache()},refreshFlyouts:function(){E.verbose("Refreshing other flyouts"),y=b.children(l.flyout)},refreshInputs:function(){n&&n.off("keydown"+s),a.dimPage&&(0===(n=v.find("a[href], [tabindex], :input:enabled").filter(":visible").filter(function(){return 0===Q(this).closest(".disabled").length})).length?(n=v).attr("tabindex",-1):v.removeAttr("tabindex"),n.first().on("keydown"+s,E.event.inputKeyDown.first),n.last().on("keydown"+s,E.event.inputKeyDown.last),a.autofocus&&0===n.filter(":focus").length&&E.set.autofocus())},setup:{cache:function(){E.cache={width:v.outerWidth(),height:v.outerHeight()}},layout:function(){0===b.children(l.pusher).length&&(E.debug("Adding wrapper element for flyout"),E.error(h.pusher),k=Q('<div class="pusher" />'),b.children().not(l.omitted).not(y).wrapAll(k),E.refresh()),0!==v.nextAll(l.pusher).length&&v.nextAll(l.pusher)[0]===k[0]||(E.debug("Moved flyout to correct parent element"),E.error(h.movedFlyout,S),v.detach().prependTo(b),E.refresh()),E.is.mobile()&&v.addClass(c.fullscreen),E.clear.cache(),E.set.pushable(),E.set.direction()},heights:function(){E.debug("Setting up heights",v);var e=v.children(l.header),t=v.children(l.content),n=v.children(l.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(E[t])?E[t]:E.toggle,0<n.length?(E.debug("Attaching flyout events to element",e,t),n.on("click"+g,t)):E.error(h.notFound,e)},show:function(e){e=X(e)?e:function(){},E.is.hidden()?!1===a.onShow.call(S)?E.verbose("Show callback returned false cancelling show"):(E.refresh(),E.othersActive()&&(E.debug("Other flyouts currently visible"),a.exclusive?E.hideOthers():C=!1),E.set.dimmerStyles(),E.set.observeAttributes(!1),E.pushPage(function(){e.call(S),a.onVisible.call(S),a.keyboardShortcuts&&E.add.keyboardShortcuts(),E.save.focus(),E.refreshInputs(),requestAnimationFrame(E.set.observeAttributes)}),a.onChange.call(S)):E.debug("Flyout is already visible")},hide:function(e){if(e=X(e)?e:function(){},!1===a.onHide.call(S,Q(this)))return E.verbose("Hide callback returned false cancelling hide"),C=!1;(E.is.visible()||E.is.animating())&&(E.debug("Hiding flyout",e),E.refreshFlyouts(),E.set.observeAttributes(!1),E.pullPage(function(){e.call(S),X(a.onHidden)&&a.onHidden.call(S),E.restore.focus()}),a.onChange.call(S))},othersAnimating:function(){return 0<y.not(v).filter("."+c.animating).length},othersVisible:function(){return 0<y.not(v).filter("."+c.visible).length},othersActive:function(){return E.othersVisible()||E.othersAnimating()},hideOthers:function(e){var t=y.not(v).filter("."+c.visible),n=t.length,i=0;e=e||function(){},t.flyout("hide",function(){++i===n&&e()})},toggle:function(){E.verbose("Determining toggled direction"),E.is.hidden()?E.show():E.hide()},pushPage:function(t){var e,n,i;t=X(t)?t:function(){},E.set.overlay(),a.returnScroll&&(r=(w?D:b).scrollTop()),E.bind.scrollLock(),e=function(){E.bind.clickaway(),E.add.inlineCSS(),E.set.animating(),E.set.visible()},n=function(){E.set.dimmed()},i=function(e){e.target===v[0]&&(v.off("transitionend"+s,i),E.remove.animating(),t.call(S))},v.off("transitionend"+s),v.on("transitionend"+s,i),requestAnimationFrame(e),a.dimPage&&!E.othersVisible()&&requestAnimationFrame(n)},pullPage:function(t){var e,n;t=X(t)?t:function(){},E.verbose("Removing context push state",E.get.direction()),E.unbind.clickaway(),E.othersActive()||(E.unbind.scrollLock(),a.keyboardShortcuts&&E.remove.keyboardShortcuts()),e=function(){E.set.overlay(),E.set.animating(),a.dimPage&&!E.othersVisible()&&E.set.closing(),E.remove.visible()},n=function(e){e.target===v[0]&&(v.off("transitionend"+s,n),E.remove.animating(),E.remove.closing(),E.remove.overlay(),E.remove.inlineCSS(),a.returnScroll&&E.scrollBack(),a.dimPage&&!E.othersVisible()&&k.removeClass(c.dimmed),t.call(S))},v.off("transitionend"+s),v.on("transitionend"+s,n),requestAnimationFrame(e)},scrollToTop:function(){E.verbose("Scrolling to top of page to avoid animation issues"),v.scrollTop(0),(w?D:b)[0].scrollTo(0,0)},scrollBack:function(){E.verbose("Scrolling back to original page position"),(w?D:b)[0].scrollTo(0,r)},clear:{cache:function(){E.verbose("Clearing cached dimensions"),E.cache={}}},set:{observeAttributes:function(e){P=!1!==e},autofocus:function(){var e=n.filter("[autofocus]"),t=n.filter(":input"),e=(0<e.length?e:0<t.length?t:n.filter(":not(i.close)")).first();0<(e=0===e.length&&0<n.length?n.first():e).length&&e.trigger("focus")},dimmerStyles:function(){a.blurring?k.addClass(c.blurring):k.removeClass(c.blurring)},bodyMargin:function(){var n=E.can.leftBodyScrollbar()?"left":"right";b.css((w?"margin-":"padding-")+n,F+"px"),b.find(l.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)")})},ios:function(){L.addClass(c.ios)},pushed:function(){b.addClass(c.pushed)},pushable:function(){b.addClass(c.pushable)},dimmed:function(){k.addClass(c.dimmed)},active:function(){v.addClass(c.active)},animating:function(){v.addClass(c.animating)},closing:function(){k.addClass(c.closing)},direction:function(e){e=e||E.get.direction(),v.addClass(c[e])},visible:function(){v.addClass(c.visible)},overlay:function(){v.addClass(c.overlay)}},remove:{inlineCSS:function(){E.debug("Removing inline css styles",o),o&&0<o.length&&o.remove()},keyboardShortcuts:function(){E.verbose("Removing keyboard shortcuts"),N.off("keydown"+g)},ios:function(){L.removeClass(c.ios)},pushed:function(){b.removeClass(c.pushed)},pushable:function(){b.removeClass(c.pushable)},active:function(){v.removeClass(c.active)},animating:function(){v.removeClass(c.animating)},closing:function(){k.removeClass(c.closing)},direction:function(e){e=e||E.get.direction(),v.removeClass(c[e])},visible:function(){v.removeClass(c.visible)},overlay:function(){v.removeClass(c.overlay)}},get:{direction:function(){return v.hasClass(c.top)?c.top:v.hasClass(c.right)?c.right:v.hasClass(c.bottom)?c.bottom:c.left},id:function(){return t},element:function(){return v},settings:function(){return a}},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}},save:{focus:function(){0<Q(U.activeElement).closest(v).length||(e=Q(U.activeElement).trigger("blur"))},bodyMargin:function(){T=b.css((w?"margin-":"padding-")+(E.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===E.cache.isSafari&&(E.cache.isSafari=/constructor/i.test(W.HTMLElement)||!!W.ApplePaySession),E.cache.isSafari},edge:function(){return void 0===E.cache.isEdge&&(E.cache.isEdge=!!W.setImmediate&&!E.is.ie()),E.cache.isEdge},firefox:function(){return void 0===E.cache.isFirefox&&(E.cache.isFirefox=!!W.InstallTrigger),E.cache.isFirefox},iframe:function(){return!(self===top)},ie:function(){var e,t;return void 0===E.cache.isIE&&(e=!W.ActiveXObject&&"ActiveXObject"in W,t="ActiveXObject"in W,E.cache.isIE=e||t),E.cache.isIE},ios:function(){var e=navigator.userAgent,t=e.match(f.ios),n=e.match(f.mobileChrome);return!(!t||n)&&(E.verbose("Browser was found to be iOS",e),!0)},mobile:function(){var e=navigator.userAgent;return e.match(f.mobile)?(E.verbose("Browser was found to be mobile",e),!0):(E.verbose("Browser is not mobile, using regular transition",e),!1)},hidden:function(){return!E.is.visible()},visible:function(){return v.hasClass(c.visible)},animating:function(){return b.hasClass(c.animating)},rtl:function(){return void 0===E.cache.isRTL&&(E.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")),E.cache.isRTL}},has:{configActions:function(){return Array.isArray(a.actions)&&0<a.actions.length},scrollbar:function(){return w||"hidden"!==b.css("overflow-y")}},restore:{focus:function(){e&&0<e.length&&a.restoreFocus&&e.trigger("focus")},bodyMargin:function(){var n=E.can.leftBodyScrollbar()?"left":"right";b.css((w?"margin-":"padding-")+n,T),b.find(l.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(E.debug("Changing setting",e,t),Q.isPlainObject(e))Q.extend(!0,a,e);else{if(void 0===t)return a[e];Q.isPlainObject(a[e])?Q.extend(!0,a[e],t):a[e]=t}},internal:function(e,t){if(Q.isPlainObject(e))Q.extend(!0,E,e);else{if(void 0===t)return E[e];E[e]=t}},debug:function(){!a.silent&&a.debug&&(a.performance?E.performance.log(arguments):(E.debug=Function.prototype.bind.call(console.info,console,a.name+":"),E.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?E.performance.log(arguments):(E.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),E.verbose.apply(console,arguments)))},error:function(){a.silent||(E.error=Function.prototype.bind.call(console.error,console,a.name+":"),E.error.apply(console,arguments))},performance:{log:function(e){var t,n;a.performance&&(n=(t=Date.now())-(j||t),j=t,R.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(E.performance.timer),E.performance.timer=setTimeout(E.performance.display,500)},display:function(){var e=a.name+":",n=0;j=!1,clearTimeout(E.performance.timer),Q.each(R,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",I&&(e+=" '"+I+"'"),0<R.length&&(console.groupCollapsed(e),console.table?console.table(R):Q.each(R,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),R=[]}},invoke:function(i,e,t){var o,s,n,r=A;return e=e||V,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]:E.error(h.method,i),!1;r=r[t]}}})),X(s)?n=s.apply(t,e):void 0!==s&&(n=s),Array.isArray(O)?O.push(n):void 0!==O?O=[O,n]:void 0!==n&&(O=n),s}};K?(void 0===A&&(X(a.templates[q])&&(a.autoShow=!0,a.className.flyout=a.className.template,a=Q.extend(!0,{},a,a.templates[q].apply(E,V)),c=a.className,a.namespace,d=a.fields,h=a.error),E.initialize()),X(a.templates[q])||E.invoke(q)):(void 0!==A&&A.invoke("destroy"),E.initialize(),O=v)}),void 0!==O?O: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",ios:"ios",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:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,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); |