fomantic-ui 2.9.0-beta.308 → 2.9.0-beta.310
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +4 -1
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +1 -1
- package/dist/components/api.min.js +1 -1
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +1 -1
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +1 -1
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +7 -1
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +4 -1
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +1 -1
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +1 -1
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +1 -1
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +5 -1
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +1 -1
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +1 -1
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +4 -2
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +1 -1
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +1 -1
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +1 -1
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +12 -5
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +1 -1
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +1 -1
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +1 -1
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +1 -1
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.min.js +1 -1
- package/dist/components/state.js +1 -1
- package/dist/components/state.min.js +1 -1
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +1 -1
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +1 -1
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +1 -1
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +1 -1
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +3 -1
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +1 -1
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +1 -1
- package/dist/components/visibility.js +1 -1
- package/dist/components/visibility.min.js +1 -1
- package/dist/semantic.css +49 -49
- package/dist/semantic.js +57 -30
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/src/definitions/modules/accordion.js +3 -0
- package/src/definitions/modules/dimmer.js +6 -0
- package/src/definitions/modules/dropdown.js +3 -0
- package/src/definitions/modules/modal.js +4 -0
- package/src/definitions/modules/popup.js +3 -1
- package/src/definitions/modules/search.js +11 -4
- package/src/definitions/modules/toast.js +2 -0
package/dist/components/modal.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.0-beta.
|
2
|
+
* # Fomantic-UI 2.9.0-beta.310+19b7d18 - Modal
|
3
3
|
* http://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -552,6 +552,8 @@ $.fn.modal = function(parameters) {
|
|
552
552
|
$module
|
553
553
|
.transition({
|
554
554
|
debug : settings.debug,
|
555
|
+
verbose : settings.verbose,
|
556
|
+
silent : settings.silent,
|
555
557
|
animation : (settings.transition.showMethod || settings.transition) + ' in',
|
556
558
|
queue : settings.queue,
|
557
559
|
duration : settings.transition.showDuration || settings.duration,
|
@@ -602,6 +604,8 @@ $.fn.modal = function(parameters) {
|
|
602
604
|
$module
|
603
605
|
.transition({
|
604
606
|
debug : settings.debug,
|
607
|
+
verbose : settings.verbose,
|
608
|
+
silent : settings.silent,
|
605
609
|
animation : (settings.transition.hideMethod || settings.transition) + ' out',
|
606
610
|
queue : settings.queue,
|
607
611
|
duration : settings.transition.hideDuration || settings.duration,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.0-beta.
|
2
|
+
* # Fomantic UI - 2.9.0-beta.310+19b7d18
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* http://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(R,P,K,Q){"use strict";R.isFunction=R.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},P=void 0!==P&&P.Math==Math?P:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),R.fn.modal=function(T){var D,e=R(this),H=R(P),O=R(K),E=R("body"),L=e.selector||"",I=(new Date).getTime(),N=[],z=T,j="string"==typeof z,q=[].slice.call(arguments,1),B=P.requestAnimationFrame||P.mozRequestAnimationFrame||P.webkitRequestAnimationFrame||P.msRequestAnimationFrame||function(e){setTimeout(e,0)};return e.each(function(){var t,o,s,e,i,n,a,c,r,l,d,u=R.isPlainObject(T)?R.extend(!0,{},R.fn.modal.settings,T):R.extend({},R.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,p=u.error,v="."+h,b="module-"+h,y=R(this),x=[P,K].indexOf(u.context)<0?R(K).find(u.context):R(u.context),k=y.find(f.closeIcon),w=this,C=y.hasClass("modal")?y.data(b):Q,S=!1,F="",M="",A={initialize:function(){var s;A.create.id(),y.hasClass("modal")||(A.create.modal(),R.isFunction(u.onHidden)||(u.onHidden=function(){A.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(A.helpers.escape(u.title,u.preserveHTML)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(A.helpers.escape(u.content,u.preserveHTML)).addClass(u.classContent),A.has.configActions()&&(0===(s=y.find(f.actions).addClass(u.classActions)).length?s=R("<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="'+A.helpers.deQuote(e[g.icon])+' icon"></i>':"",n=A.helpers.escape(e[g.text]||"",u.preserveHTML),i=A.helpers.deQuote(e[g.class]||""),o=e[g.click]&&R.isFunction(e[g.click])?e[g.click]:function(){};s.append(R("<button/>",{html:t+n,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+i,click:function(){var e=R(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(w,y)||A.hide()}}))})),A.cache={},A.verbose("Initializing dimmer",x),A.create.dimmer(),u.allowMultiple&&A.create.innerDimmer(),u.centered||y.addClass("top aligned"),A.refreshModals(),A.refreshInputs(),A.bind.events(),A.observeChanges(),A.instantiate(),u.autoShow&&A.show()},instantiate:function(){A.verbose("Storing instance of modal"),C=A,y.data(b,C)},create:{modal:function(){var e;y=R("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(k=R("<i/>",{class:m.close,role:"button",tabindex:0,"aria-label":u.text.close}),y.append(k)),""!==u.title&&(e="_"+A.get.id()+"title",y.attr("aria-labelledby",e),R("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+A.get.id()+"desc",y.attr("aria-describedby",e),R("<div/>",{class:m.content,id:e}).appendTo(y)),A.has.configActions()&&R("<div/>",{class:m.actions}).appendTo(y),x.append(y)},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=R.extend(!0,e,u.dimmerSettings);R.fn.dimmer===Q?A.error(p.dimmer):(A.debug("Creating dimmer"),i=x.dimmer(e),u.detachable?(A.verbose("Modal is detachable, moving content into dimmer"),i.dimmer("add content",y)):A.set.undetached(),n=i.dimmer("get dimmer"))},id:function(){l=(Math.random().toString(16)+"000000000").slice(2,10),r="."+l,A.verbose("Creating unique id for element",l)},innerDimmer:function(){0===y.find(f.dimmer).length&&R("<div/>",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){d&&d.disconnect(),A.verbose("Destroying previous modal"),y.removeData(b).off(v),H.off(r),n.off(r),k.off(r),t&&t.off(r),x.dimmer("destroy")},observeChanges:function(){"MutationObserver"in P&&((d=new MutationObserver(function(e){u.observeChanges&&(A.debug("DOM tree modified, refreshing"),A.refresh()),A.refreshInputs()})).observe(w,{childList:!0,subtree:!0}),A.debug("Setting up mutation observer",d))},refresh:function(){A.remove.scrolling(),A.cacheSizes(),A.can.useFlex()||A.set.modalOffset(),A.set.screenHeight(),A.set.type()},refreshModals:function(){s=y.siblings(f.modal),o=s.add(y)},refreshInputs:function(){t&&t.off("keydown"+r),(t=y.find("[tabindex], :input").filter(":visible").filter(function(){return 0===R(this).closest(".disabled").length})).first().on("keydown"+r,A.event.inputKeyDown.first),t.last().on("keydown"+r,A.event.inputKeyDown.last)},attachEvents:function(e,t){var n=R(e);t=R.isFunction(A[t])?A[t]:A.toggle,0<n.length?(A.debug("Attaching modal events to element",e,t),n.off(v).on("click"+v,t)):A.error(p.notFound,e)},bind:{events:function(){A.verbose("Attaching events"),y.on("click"+v,f.close,A.event.close).on("click"+v,f.approve,A.event.approve).on("click"+v,f.deny,A.event.deny),k.on("keyup"+r,A.event.closeKeyUp),H.on("resize"+r,A.event.resize)},scrollLock:function(){i.get(0).addEventListener("touchmove",A.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){i.get(0).removeEventListener("touchmove",A.event.preventScroll,{passive:!1})}},get:{id:function(){return l},element:function(){return y},settings:function(){return u}},event:{approve:function(){S||!1===u.onApprove.call(w,R(this))?A.verbose("Approve callback returned false cancelling hide"):(S=!0,A.hide(function(){S=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){S||!1===u.onDeny.call(w,R(this))?A.verbose("Deny callback returned false cancelling hide"):(S=!0,A.hide(function(){S=!1}))},close:function(){A.hide()},closeKeyUp:function(e){e=e.which;e!==u.keys.enter&&e!==u.keys.space||!y.hasClass(m.front)||A.hide()},inputKeyDown:{first:function(e){e.which===u.keys.tab&&e.shiftKey&&(t.last().focus(),e.preventDefault())},last:function(e){e.which!==u.keys.tab||e.shiftKey||(t.first().focus(),e.preventDefault())}},mousedown:function(e){var t=R(e.target),n=A.is.rtl();(a=0<t.closest(f.modal).length)&&A.verbose("Mouse down event registered inside the modal"),(c=A.is.scrolling()&&(!n&&R(P).outerWidth()-u.scrollbarWidth<=e.clientX||n&&u.scrollbarWidth>=e.clientX))&&A.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(e){if(u.closable)if(a)A.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(c)A.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var t=0<R(e.target).closest(f.modal).length,e=R.contains(K.documentElement,e.target);if(!t&&e&&A.is.active()&&y.hasClass(m.front)){if(A.debug("Dimmer clicked, hiding all modals"),u.allowMultiple){if(!A.hideAll())return}else if(!A.hide())return;A.remove.clickaway()}}else A.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(A.timer),A.timer=setTimeout(e,t)},keyboard:function(e){e.which===u.keys.escape&&(u.closable?(A.debug("Escape key pressed hiding modal"),y.hasClass(m.front)&&A.hide()):A.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){i.dimmer("is active")&&(A.is.animating()||A.is.active())&&B(A.refresh)}},toggle:function(){A.is.active()||A.is.animating()?A.hide():A.show()},show:function(e){e=R.isFunction(e)?e:function(){},A.refreshModals(),A.set.dimmerSettings(),A.set.dimmerStyles(),A.showModal(e)},hide:function(e){return e=R.isFunction(e)?e:function(){},A.refreshModals(),A.hideModal(e)},showModal:function(e){e=R.isFunction(e)?e:function(){},A.is.animating()||!A.is.active()?!1===u.onShow.call(w)?A.verbose("Show callback returned false cancelling show"):(A.showDimmer(),A.cacheSizes(),A.set.bodyMargin(),A.can.useFlex()?A.remove.legacy():(A.set.legacy(),A.set.modalOffset(),A.debug("Using non-flex legacy modal positioning.")),A.set.screenHeight(),A.set.type(),A.set.clickaway(),!u.allowMultiple&&A.others.active()?A.hideOthers(A.showModal):(S=!1,u.allowMultiple&&(A.others.active()&&s.filter("."+m.active).find(f.dimmer).addClass("active"),u.detachable&&y.detach().appendTo(n)),u.transition&&R.fn.transition!==Q&&y.transition("is supported")?(A.debug("Showing modal with css animations"),y.transition({debug:u.debug,animation:(u.transition.showMethod||u.transition)+" in",queue:u.queue,duration:u.transition.showDuration||u.duration,useFailSafe:!0,onComplete:function(){u.onVisible.apply(w),u.keyboardShortcuts&&A.add.keyboardShortcuts(),A.save.focus(),A.set.active(),u.autofocus&&A.set.autofocus(),e()}})):A.error(p.noTransition))):A.debug("Modal is already visible")},hideModal:function(e,t,n){var i=s.filter("."+m.active).last();if(e=R.isFunction(e)?e:function(){},!1===u.onHide.call(w,R(this)))return A.verbose("Hide callback returned false cancelling hide"),S=!1;(A.is.animating()||A.is.active())&&(A.debug("Hiding modal"),u.transition&&R.fn.transition!==Q&&y.transition("is supported")?(A.remove.active(),y.transition({debug:u.debug,animation:(u.transition.hideMethod||u.transition)+" out",queue:u.queue,duration:u.transition.hideDuration||u.duration,useFailSafe:!0,onStart:function(){A.others.active()||A.others.animating()||t||A.hideDimmer(),u.keyboardShortcuts&&!A.others.active()&&A.remove.keyboardShortcuts()},onComplete:function(){A.unbind.scrollLock(),u.allowMultiple&&(i.addClass(m.front),y.removeClass(m.front),(n?o:i).find(f.dimmer).removeClass("active")),R.isFunction(u.onHidden)&&u.onHidden.call(w),A.remove.dimmerStyles(),A.restore.focus(),e()}})):A.error(p.noTransition))},showDimmer:function(){i.dimmer("is animating")||!i.dimmer("is active")?(A.save.bodyMargin(),A.debug("Showing dimmer"),i.dimmer("show")):A.debug("Dimmer already visible")},hideDimmer:function(){i.dimmer("is animating")||i.dimmer("is active")?(A.unbind.scrollLock(),i.dimmer("hide",function(){A.restore.bodyMargin(),A.remove.clickaway(),A.remove.screenHeight()})):A.debug("Dimmer is not visible cannot hide")},hideAll:function(n){var i,e=o.filter("."+m.active+", ."+m.animating);if(n=R.isFunction(n)?n:function(){},0<e.length)return A.debug("Hiding all visible modals"),i=!0,R(e.get().reverse()).each(function(e,t){i=i&&R(t).modal("hide modal",n,!1,!0)}),i&&A.hideDimmer(),i},hideOthers:function(e){var t=s.filter("."+m.active+", ."+m.animating);e=R.isFunction(e)?e:function(){},0<t.length&&(A.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(){A.verbose("Adding keyboard shortcuts"),O.on("keydown"+v,A.event.keyboard)}},save:{focus:function(){0<R(K.activeElement).closest(y).length||(e=R(K.activeElement).blur())},bodyMargin:function(){F=E.css("margin-"+(A.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(F.replace(/[^\d.]/g,"")),t=P.innerWidth-K.documentElement.clientWidth;M=e+t}},restore:{focus:function(){e&&0<e.length&&u.restoreFocus&&e.focus()},bodyMargin:function(){var n=A.can.leftBodyScrollbar()?"left":"right";E.css("margin-"+n,F),E.find(f.bodyFixed.replace("right",n)).each(function(){var e=R(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"")})}},remove:{active:function(){y.removeClass(m.active)},legacy:function(){y.removeClass(m.legacy)},clickaway:function(){u.detachable||y.off("mousedown"+r),n.off("mousedown"+r),n.off("mouseup"+r)},dimmerStyles:function(){n.removeClass(m.inverted),i.removeClass(m.blurring)},bodyStyle:function(){""===E.attr("style")&&(A.verbose("Removing style attribute"),E.removeAttr("style"))},screenHeight:function(){A.debug("Removing page height"),E.css("height","")},keyboardShortcuts:function(){A.verbose("Removing keyboard shortcuts"),O.off("keydown"+v)},scrolling:function(){i.removeClass(m.scrolling),y.removeClass(m.scrolling)}},cacheSizes:function(){y.addClass(m.loading);var e=y.prop("scrollHeight"),t=y.outerWidth(),n=y.outerHeight();A.cache.pageHeight!==Q&&0===n||(R.extend(A.cache,{pageHeight:R(K).outerHeight(),width:t,height:n+u.offset,scrollHeight:e+u.offset,contextHeight:("body"==u.context?R(P):i).height()}),A.cache.topOffset=-A.cache.height/2),y.removeClass(m.loading),A.debug("Caching modal and container sizes",A.cache)},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(/&(?![a-z0-9#]{1,6};)/,"&")).replace(/[<>"'`]/g,function(e){return n[e]}):e}},can:{leftBodyScrollbar:function(){return A.cache.leftBodyScrollbar===Q&&(A.cache.leftBodyScrollbar=A.is.rtl()&&(A.is.iframe&&!A.is.firefox()||A.is.safari()||A.is.edge()||A.is.ie())),A.cache.leftBodyScrollbar},useFlex:function(){return"auto"===u.useFlex?u.detachable&&!A.is.ie():(u.useFlex&&A.is.ie()?A.debug("useFlex true is not supported in IE"):u.useFlex&&!u.detachable&&A.debug("useFlex true in combination with detachable false is not supported"),u.useFlex)},fit:function(){var e=A.cache.contextHeight,t=A.cache.contextHeight/2,n=A.cache.topOffset,i=A.cache.scrollHeight,o=A.cache.height,s=u.padding;return o<i?t+n+i+s<e:o+2*s<e}},has:{configActions:function(){return Array.isArray(u.actions)&&0<u.actions.length}},is:{active:function(){return y.hasClass(m.active)},ie:function(){var e,t;return A.cache.isIE===Q&&(e=!P.ActiveXObject&&"ActiveXObject"in P,t="ActiveXObject"in P,A.cache.isIE=e||t),A.cache.isIE},animating:function(){return y.transition("is supported")?y.transition("is animating"):y.is(":visible")},scrolling:function(){return i.hasClass(m.scrolling)},modernBrowser:function(){return!(P.ActiveXObject||"ActiveXObject"in P)},rtl:function(){return A.cache.isRTL===Q&&(A.cache.isRTL="rtl"===E.attr("dir")||"rtl"===E.css("direction")),A.cache.isRTL},safari:function(){return A.cache.isSafari===Q&&(A.cache.isSafari=/constructor/i.test(P.HTMLElement)||!!P.ApplePaySession),A.cache.isSafari},edge:function(){return A.cache.isEdge===Q&&(A.cache.isEdge=!!P.setImmediate&&!A.is.ie()),A.cache.isEdge},firefox:function(){return A.cache.isFirefox===Q&&(A.cache.isFirefox=!!P.InstallTrigger),A.cache.isFirefox},iframe:function(){return!(self===top)}},set:{autofocus:function(){var e=t.filter("[autofocus]"),e=(0<e.length?e:1<t.length?t.filter(":not(i.close)"):t).first();0<e.length&&e.focus()},bodyMargin:function(){var n=A.can.leftBodyScrollbar()?"left":"right";(u.detachable||A.can.fit())&&E.css("margin-"+n,M+"px"),E.find(f.bodyFixed.replace("right",n)).each(function(){var e=R(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"calc("+e.css(t)+" + "+M+"px)")})},clickaway:function(){u.detachable||y.on("mousedown"+r,A.event.mousedown),n.on("mousedown"+r,A.event.mousedown),n.on("mouseup"+r,A.event.mouseup)},dimmerSettings:function(){var e;R.fn.dimmer===Q?A.error(p.dimmer):(e={debug:u.debug,dimmerName:"modals",closable:"auto",useFlex:A.can.useFlex(),duration:{show:u.transition.showDuration||u.duration,hide:u.transition.hideDuration||u.duration}},e=R.extend(!0,e,u.dimmerSettings),u.inverted&&(e.variation=e.variation!==Q?e.variation+" inverted":"inverted"),x.dimmer("setting",e))},dimmerStyles:function(){u.inverted?n.addClass(m.inverted):n.removeClass(m.inverted),u.blurring?i.addClass(m.blurring):i.removeClass(m.blurring)},modalOffset:function(){var e;u.detachable?y.css({marginTop:!y.hasClass("aligned")&&A.can.fit()?-A.cache.height/2:u.padding/2,marginLeft:-A.cache.width/2}):(e=A.can.fit(),y.css({top:!y.hasClass("aligned")&&e?R(K).scrollTop()+(A.cache.contextHeight-A.cache.height)/2:!e||y.hasClass("top")?R(K).scrollTop()+u.padding:R(K).scrollTop()+(A.cache.contextHeight-A.cache.height-u.padding),marginLeft:-A.cache.width/2})),A.verbose("Setting modal offset for legacy mode")},screenHeight:function(){A.can.fit()?E.css("height",""):y.hasClass("bottom")||(A.debug("Modal is taller than page content, resizing page height"),E.css("height",A.cache.height+2*u.padding))},active:function(){y.addClass(m.active+" "+m.front),s.filter("."+m.active).removeClass(m.front)},scrolling:function(){i.addClass(m.scrolling),y.addClass(m.scrolling),A.unbind.scrollLock()},legacy:function(){y.addClass(m.legacy)},type:function(){A.can.fit()?(A.verbose("Modal fits on screen"),A.others.active()||A.others.animating()||(A.remove.scrolling(),A.bind.scrollLock())):y.hasClass("bottom")?A.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(A.verbose("Modal cannot fit on screen setting to scrolling"),A.set.scrolling())},undetached:function(){i.addClass(m.undetached)}},setting:function(e,t){if(A.debug("Changing setting",e,t),R.isPlainObject(e))R.extend(!0,u,e);else{if(t===Q)return u[e];R.isPlainObject(u[e])?R.extend(!0,u[e],t):u[e]=t}},internal:function(e,t){if(R.isPlainObject(e))R.extend(!0,A,e);else{if(t===Q)return A[e];A[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?A.performance.log(arguments):(A.debug=Function.prototype.bind.call(console.info,console,u.name+":"),A.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?A.performance.log(arguments):(A.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),A.verbose.apply(console,arguments)))},error:function(){u.silent||(A.error=Function.prototype.bind.call(console.error,console,u.name+":"),A.error.apply(console,arguments))},performance:{log:function(e){var t,n;u.performance&&(n=(t=(new Date).getTime())-(I||t),I=t,N.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:w,"Execution Time":n})),clearTimeout(A.performance.timer),A.performance.timer=setTimeout(A.performance.display,500)},display:function(){var e=u.name+":",n=0;I=!1,clearTimeout(A.performance.timer),R.each(N,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",L&&(e+=" '"+L+"'"),(console.group!==Q||console.table!==Q)&&0<N.length&&(console.groupCollapsed(e),console.table?console.table(N):R.each(N,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),N=[]}},invoke:function(i,e,t){var o,s,n,a=C;return e=e||q,t=w||t,"string"==typeof i&&a!==Q&&(i=i.split(/[\. ]/),o=i.length-1,R.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(R.isPlainObject(a[n])&&e!=o)a=a[n];else{if(a[n]!==Q)return s=a[n],!1;{if(!R.isPlainObject(a[t])||e==o)return a[t]!==Q&&(s=a[t]),!1;a=a[t]}}})),R.isFunction(s)?n=s.apply(t,e):s!==Q&&(n=s),Array.isArray(D)?D.push(n):D!==Q?D=[D,n]:n!==Q&&(D=n),s}};j?(C===Q&&(R.isFunction(u.templates[z])&&(u.autoShow=!0,u.className.modal=u.className.template,u=R.extend(!0,{},u,u.templates[z].apply(A,q)),m=u.className,u.namespace,g=u.fields,p=u.error),A.initialize()),R.isFunction(u.templates[z])||A.invoke(z)):(C!==Q&&C.invoke("destroy"),A.initialize(),D=y)}),D!==Q?D:this},R.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"}},R.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return R.isPlainObject(e[0])?R.extend({handler:function(){},content:"",title:""},e[0]):(R.isFunction(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),n=t.handler;return{title:t.title,content:t.content,onApprove:n,actions:[{text:e.text.ok,class:e.className.ok,click:n}]}},confirm:function(){function e(){i.handler(!0)}function t(){i.handler(!1)}var n=this.get.settings(),i=n.templates.getArguments(arguments);return{title:i.title,content:i.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}]}},prompt:function(){function e(){var e=n.get.settings(),e=n.get.element().find(e.selector.prompt)[0];o.handler(R(e).val())}function t(){o.handler(null)}var n=this,i=this.get.settings(),o=i.templates.getArguments(arguments);return 0===R(R.parseHTML(o.content)).filter(".ui.input").length&&(o.content+='<p><div class="'+this.helpers.deQuote(i.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:i.text.ok,class:i.className.ok,click:e},{text:i.text.cancel,class:i.className.cancel,click:t}]}}}}(jQuery,window,document);
|
11
|
+
!function(R,P,K,Q){"use strict";R.isFunction=R.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},P=void 0!==P&&P.Math==Math?P:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),R.fn.modal=function(T){var D,e=R(this),H=R(P),O=R(K),E=R("body"),L=e.selector||"",I=(new Date).getTime(),N=[],z=T,j="string"==typeof z,q=[].slice.call(arguments,1),B=P.requestAnimationFrame||P.mozRequestAnimationFrame||P.webkitRequestAnimationFrame||P.msRequestAnimationFrame||function(e){setTimeout(e,0)};return e.each(function(){var t,o,s,e,i,n,a,c,r,l,d,u=R.isPlainObject(T)?R.extend(!0,{},R.fn.modal.settings,T):R.extend({},R.fn.modal.settings),f=u.selector,m=u.className,h=u.namespace,g=u.fields,p=u.error,v="."+h,b="module-"+h,y=R(this),x=[P,K].indexOf(u.context)<0?R(K).find(u.context):R(u.context),k=y.find(f.closeIcon),w=this,C=y.hasClass("modal")?y.data(b):Q,S=!1,F="",M="",A={initialize:function(){var s;A.create.id(),y.hasClass("modal")||(A.create.modal(),R.isFunction(u.onHidden)||(u.onHidden=function(){A.destroy(),y.remove()})),y.addClass(u.class),""!==u.title&&y.find(f.title).html(A.helpers.escape(u.title,u.preserveHTML)).addClass(u.classTitle),""!==u.content&&y.find(f.content).html(A.helpers.escape(u.content,u.preserveHTML)).addClass(u.classContent),A.has.configActions()&&(0===(s=y.find(f.actions).addClass(u.classActions)).length?s=R("<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="'+A.helpers.deQuote(e[g.icon])+' icon"></i>':"",n=A.helpers.escape(e[g.text]||"",u.preserveHTML),i=A.helpers.deQuote(e[g.class]||""),o=e[g.click]&&R.isFunction(e[g.click])?e[g.click]:function(){};s.append(R("<button/>",{html:t+n,"aria-label":(e[g.text]||e[g.icon]||"").replace(/<[^>]+(>|$)/g,""),class:m.button+" "+i,click:function(){var e=R(this);e.is(f.approve)||e.is(f.deny)||!1===o.call(w,y)||A.hide()}}))})),A.cache={},A.verbose("Initializing dimmer",x),A.create.dimmer(),u.allowMultiple&&A.create.innerDimmer(),u.centered||y.addClass("top aligned"),A.refreshModals(),A.refreshInputs(),A.bind.events(),A.observeChanges(),A.instantiate(),u.autoShow&&A.show()},instantiate:function(){A.verbose("Storing instance of modal"),C=A,y.data(b,C)},create:{modal:function(){var e;y=R("<div/>",{class:m.modal,role:"dialog","aria-modal":!0}),u.closeIcon&&(k=R("<i/>",{class:m.close,role:"button",tabindex:0,"aria-label":u.text.close}),y.append(k)),""!==u.title&&(e="_"+A.get.id()+"title",y.attr("aria-labelledby",e),R("<div/>",{class:m.title,id:e}).appendTo(y)),""!==u.content&&(e="_"+A.get.id()+"desc",y.attr("aria-describedby",e),R("<div/>",{class:m.content,id:e}).appendTo(y)),A.has.configActions()&&R("<div/>",{class:m.actions}).appendTo(y),x.append(y)},dimmer:function(){var e={debug:u.debug,dimmerName:"modals"},e=R.extend(!0,e,u.dimmerSettings);R.fn.dimmer===Q?A.error(p.dimmer):(A.debug("Creating dimmer"),i=x.dimmer(e),u.detachable?(A.verbose("Modal is detachable, moving content into dimmer"),i.dimmer("add content",y)):A.set.undetached(),n=i.dimmer("get dimmer"))},id:function(){l=(Math.random().toString(16)+"000000000").slice(2,10),r="."+l,A.verbose("Creating unique id for element",l)},innerDimmer:function(){0===y.find(f.dimmer).length&&R("<div/>",{class:m.innerDimmer}).prependTo(y)}},destroy:function(){d&&d.disconnect(),A.verbose("Destroying previous modal"),y.removeData(b).off(v),H.off(r),n.off(r),k.off(r),t&&t.off(r),x.dimmer("destroy")},observeChanges:function(){"MutationObserver"in P&&((d=new MutationObserver(function(e){u.observeChanges&&(A.debug("DOM tree modified, refreshing"),A.refresh()),A.refreshInputs()})).observe(w,{childList:!0,subtree:!0}),A.debug("Setting up mutation observer",d))},refresh:function(){A.remove.scrolling(),A.cacheSizes(),A.can.useFlex()||A.set.modalOffset(),A.set.screenHeight(),A.set.type()},refreshModals:function(){s=y.siblings(f.modal),o=s.add(y)},refreshInputs:function(){t&&t.off("keydown"+r),(t=y.find("[tabindex], :input").filter(":visible").filter(function(){return 0===R(this).closest(".disabled").length})).first().on("keydown"+r,A.event.inputKeyDown.first),t.last().on("keydown"+r,A.event.inputKeyDown.last)},attachEvents:function(e,t){var n=R(e);t=R.isFunction(A[t])?A[t]:A.toggle,0<n.length?(A.debug("Attaching modal events to element",e,t),n.off(v).on("click"+v,t)):A.error(p.notFound,e)},bind:{events:function(){A.verbose("Attaching events"),y.on("click"+v,f.close,A.event.close).on("click"+v,f.approve,A.event.approve).on("click"+v,f.deny,A.event.deny),k.on("keyup"+r,A.event.closeKeyUp),H.on("resize"+r,A.event.resize)},scrollLock:function(){i.get(0).addEventListener("touchmove",A.event.preventScroll,{passive:!1})}},unbind:{scrollLock:function(){i.get(0).removeEventListener("touchmove",A.event.preventScroll,{passive:!1})}},get:{id:function(){return l},element:function(){return y},settings:function(){return u}},event:{approve:function(){S||!1===u.onApprove.call(w,R(this))?A.verbose("Approve callback returned false cancelling hide"):(S=!0,A.hide(function(){S=!1}))},preventScroll:function(e){-1!==e.target.className.indexOf("dimmer")&&e.preventDefault()},deny:function(){S||!1===u.onDeny.call(w,R(this))?A.verbose("Deny callback returned false cancelling hide"):(S=!0,A.hide(function(){S=!1}))},close:function(){A.hide()},closeKeyUp:function(e){e=e.which;e!==u.keys.enter&&e!==u.keys.space||!y.hasClass(m.front)||A.hide()},inputKeyDown:{first:function(e){e.which===u.keys.tab&&e.shiftKey&&(t.last().focus(),e.preventDefault())},last:function(e){e.which!==u.keys.tab||e.shiftKey||(t.first().focus(),e.preventDefault())}},mousedown:function(e){var t=R(e.target),n=A.is.rtl();(a=0<t.closest(f.modal).length)&&A.verbose("Mouse down event registered inside the modal"),(c=A.is.scrolling()&&(!n&&R(P).outerWidth()-u.scrollbarWidth<=e.clientX||n&&u.scrollbarWidth>=e.clientX))&&A.verbose("Mouse down event registered inside the scrollbar")},mouseup:function(e){if(u.closable)if(a)A.debug("Dimmer clicked but mouse down was initially registered inside the modal");else if(c)A.debug("Dimmer clicked but mouse down was initially registered inside the scrollbar");else{var t=0<R(e.target).closest(f.modal).length,e=R.contains(K.documentElement,e.target);if(!t&&e&&A.is.active()&&y.hasClass(m.front)){if(A.debug("Dimmer clicked, hiding all modals"),u.allowMultiple){if(!A.hideAll())return}else if(!A.hide())return;A.remove.clickaway()}}else A.verbose("Dimmer clicked but closable setting is disabled")},debounce:function(e,t){clearTimeout(A.timer),A.timer=setTimeout(e,t)},keyboard:function(e){e.which===u.keys.escape&&(u.closable?(A.debug("Escape key pressed hiding modal"),y.hasClass(m.front)&&A.hide()):A.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){i.dimmer("is active")&&(A.is.animating()||A.is.active())&&B(A.refresh)}},toggle:function(){A.is.active()||A.is.animating()?A.hide():A.show()},show:function(e){e=R.isFunction(e)?e:function(){},A.refreshModals(),A.set.dimmerSettings(),A.set.dimmerStyles(),A.showModal(e)},hide:function(e){return e=R.isFunction(e)?e:function(){},A.refreshModals(),A.hideModal(e)},showModal:function(e){e=R.isFunction(e)?e:function(){},A.is.animating()||!A.is.active()?!1===u.onShow.call(w)?A.verbose("Show callback returned false cancelling show"):(A.showDimmer(),A.cacheSizes(),A.set.bodyMargin(),A.can.useFlex()?A.remove.legacy():(A.set.legacy(),A.set.modalOffset(),A.debug("Using non-flex legacy modal positioning.")),A.set.screenHeight(),A.set.type(),A.set.clickaway(),!u.allowMultiple&&A.others.active()?A.hideOthers(A.showModal):(S=!1,u.allowMultiple&&(A.others.active()&&s.filter("."+m.active).find(f.dimmer).addClass("active"),u.detachable&&y.detach().appendTo(n)),u.transition&&R.fn.transition!==Q&&y.transition("is supported")?(A.debug("Showing modal with css animations"),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(w),u.keyboardShortcuts&&A.add.keyboardShortcuts(),A.save.focus(),A.set.active(),u.autofocus&&A.set.autofocus(),e()}})):A.error(p.noTransition))):A.debug("Modal is already visible")},hideModal:function(e,t,n){var i=s.filter("."+m.active).last();if(e=R.isFunction(e)?e:function(){},!1===u.onHide.call(w,R(this)))return A.verbose("Hide callback returned false cancelling hide"),S=!1;(A.is.animating()||A.is.active())&&(A.debug("Hiding modal"),u.transition&&R.fn.transition!==Q&&y.transition("is supported")?(A.remove.active(),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(){A.others.active()||A.others.animating()||t||A.hideDimmer(),u.keyboardShortcuts&&!A.others.active()&&A.remove.keyboardShortcuts()},onComplete:function(){A.unbind.scrollLock(),u.allowMultiple&&(i.addClass(m.front),y.removeClass(m.front),(n?o:i).find(f.dimmer).removeClass("active")),R.isFunction(u.onHidden)&&u.onHidden.call(w),A.remove.dimmerStyles(),A.restore.focus(),e()}})):A.error(p.noTransition))},showDimmer:function(){i.dimmer("is animating")||!i.dimmer("is active")?(A.save.bodyMargin(),A.debug("Showing dimmer"),i.dimmer("show")):A.debug("Dimmer already visible")},hideDimmer:function(){i.dimmer("is animating")||i.dimmer("is active")?(A.unbind.scrollLock(),i.dimmer("hide",function(){A.restore.bodyMargin(),A.remove.clickaway(),A.remove.screenHeight()})):A.debug("Dimmer is not visible cannot hide")},hideAll:function(n){var i,e=o.filter("."+m.active+", ."+m.animating);if(n=R.isFunction(n)?n:function(){},0<e.length)return A.debug("Hiding all visible modals"),i=!0,R(e.get().reverse()).each(function(e,t){i=i&&R(t).modal("hide modal",n,!1,!0)}),i&&A.hideDimmer(),i},hideOthers:function(e){var t=s.filter("."+m.active+", ."+m.animating);e=R.isFunction(e)?e:function(){},0<t.length&&(A.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(){A.verbose("Adding keyboard shortcuts"),O.on("keydown"+v,A.event.keyboard)}},save:{focus:function(){0<R(K.activeElement).closest(y).length||(e=R(K.activeElement).blur())},bodyMargin:function(){F=E.css("margin-"+(A.can.leftBodyScrollbar()?"left":"right"));var e=parseInt(F.replace(/[^\d.]/g,"")),t=P.innerWidth-K.documentElement.clientWidth;M=e+t}},restore:{focus:function(){e&&0<e.length&&u.restoreFocus&&e.focus()},bodyMargin:function(){var n=A.can.leftBodyScrollbar()?"left":"right";E.css("margin-"+n,F),E.find(f.bodyFixed.replace("right",n)).each(function(){var e=R(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"")})}},remove:{active:function(){y.removeClass(m.active)},legacy:function(){y.removeClass(m.legacy)},clickaway:function(){u.detachable||y.off("mousedown"+r),n.off("mousedown"+r),n.off("mouseup"+r)},dimmerStyles:function(){n.removeClass(m.inverted),i.removeClass(m.blurring)},bodyStyle:function(){""===E.attr("style")&&(A.verbose("Removing style attribute"),E.removeAttr("style"))},screenHeight:function(){A.debug("Removing page height"),E.css("height","")},keyboardShortcuts:function(){A.verbose("Removing keyboard shortcuts"),O.off("keydown"+v)},scrolling:function(){i.removeClass(m.scrolling),y.removeClass(m.scrolling)}},cacheSizes:function(){y.addClass(m.loading);var e=y.prop("scrollHeight"),t=y.outerWidth(),n=y.outerHeight();A.cache.pageHeight!==Q&&0===n||(R.extend(A.cache,{pageHeight:R(K).outerHeight(),width:t,height:n+u.offset,scrollHeight:e+u.offset,contextHeight:("body"==u.context?R(P):i).height()}),A.cache.topOffset=-A.cache.height/2),y.removeClass(m.loading),A.debug("Caching modal and container sizes",A.cache)},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(/&(?![a-z0-9#]{1,6};)/,"&")).replace(/[<>"'`]/g,function(e){return n[e]}):e}},can:{leftBodyScrollbar:function(){return A.cache.leftBodyScrollbar===Q&&(A.cache.leftBodyScrollbar=A.is.rtl()&&(A.is.iframe&&!A.is.firefox()||A.is.safari()||A.is.edge()||A.is.ie())),A.cache.leftBodyScrollbar},useFlex:function(){return"auto"===u.useFlex?u.detachable&&!A.is.ie():(u.useFlex&&A.is.ie()?A.debug("useFlex true is not supported in IE"):u.useFlex&&!u.detachable&&A.debug("useFlex true in combination with detachable false is not supported"),u.useFlex)},fit:function(){var e=A.cache.contextHeight,t=A.cache.contextHeight/2,n=A.cache.topOffset,i=A.cache.scrollHeight,o=A.cache.height,s=u.padding;return o<i?t+n+i+s<e:o+2*s<e}},has:{configActions:function(){return Array.isArray(u.actions)&&0<u.actions.length}},is:{active:function(){return y.hasClass(m.active)},ie:function(){var e,t;return A.cache.isIE===Q&&(e=!P.ActiveXObject&&"ActiveXObject"in P,t="ActiveXObject"in P,A.cache.isIE=e||t),A.cache.isIE},animating:function(){return y.transition("is supported")?y.transition("is animating"):y.is(":visible")},scrolling:function(){return i.hasClass(m.scrolling)},modernBrowser:function(){return!(P.ActiveXObject||"ActiveXObject"in P)},rtl:function(){return A.cache.isRTL===Q&&(A.cache.isRTL="rtl"===E.attr("dir")||"rtl"===E.css("direction")),A.cache.isRTL},safari:function(){return A.cache.isSafari===Q&&(A.cache.isSafari=/constructor/i.test(P.HTMLElement)||!!P.ApplePaySession),A.cache.isSafari},edge:function(){return A.cache.isEdge===Q&&(A.cache.isEdge=!!P.setImmediate&&!A.is.ie()),A.cache.isEdge},firefox:function(){return A.cache.isFirefox===Q&&(A.cache.isFirefox=!!P.InstallTrigger),A.cache.isFirefox},iframe:function(){return!(self===top)}},set:{autofocus:function(){var e=t.filter("[autofocus]"),e=(0<e.length?e:1<t.length?t.filter(":not(i.close)"):t).first();0<e.length&&e.focus()},bodyMargin:function(){var n=A.can.leftBodyScrollbar()?"left":"right";(u.detachable||A.can.fit())&&E.css("margin-"+n,M+"px"),E.find(f.bodyFixed.replace("right",n)).each(function(){var e=R(this),t="fixed"===e.css("position")?"padding-"+n:n;e.css(t,"calc("+e.css(t)+" + "+M+"px)")})},clickaway:function(){u.detachable||y.on("mousedown"+r,A.event.mousedown),n.on("mousedown"+r,A.event.mousedown),n.on("mouseup"+r,A.event.mouseup)},dimmerSettings:function(){var e;R.fn.dimmer===Q?A.error(p.dimmer):(e={debug:u.debug,dimmerName:"modals",closable:"auto",useFlex:A.can.useFlex(),duration:{show:u.transition.showDuration||u.duration,hide:u.transition.hideDuration||u.duration}},e=R.extend(!0,e,u.dimmerSettings),u.inverted&&(e.variation=e.variation!==Q?e.variation+" inverted":"inverted"),x.dimmer("setting",e))},dimmerStyles:function(){u.inverted?n.addClass(m.inverted):n.removeClass(m.inverted),u.blurring?i.addClass(m.blurring):i.removeClass(m.blurring)},modalOffset:function(){var e;u.detachable?y.css({marginTop:!y.hasClass("aligned")&&A.can.fit()?-A.cache.height/2:u.padding/2,marginLeft:-A.cache.width/2}):(e=A.can.fit(),y.css({top:!y.hasClass("aligned")&&e?R(K).scrollTop()+(A.cache.contextHeight-A.cache.height)/2:!e||y.hasClass("top")?R(K).scrollTop()+u.padding:R(K).scrollTop()+(A.cache.contextHeight-A.cache.height-u.padding),marginLeft:-A.cache.width/2})),A.verbose("Setting modal offset for legacy mode")},screenHeight:function(){A.can.fit()?E.css("height",""):y.hasClass("bottom")||(A.debug("Modal is taller than page content, resizing page height"),E.css("height",A.cache.height+2*u.padding))},active:function(){y.addClass(m.active+" "+m.front),s.filter("."+m.active).removeClass(m.front)},scrolling:function(){i.addClass(m.scrolling),y.addClass(m.scrolling),A.unbind.scrollLock()},legacy:function(){y.addClass(m.legacy)},type:function(){A.can.fit()?(A.verbose("Modal fits on screen"),A.others.active()||A.others.animating()||(A.remove.scrolling(),A.bind.scrollLock())):y.hasClass("bottom")?A.verbose("Bottom aligned modal not fitting on screen is unsupported for scrolling"):(A.verbose("Modal cannot fit on screen setting to scrolling"),A.set.scrolling())},undetached:function(){i.addClass(m.undetached)}},setting:function(e,t){if(A.debug("Changing setting",e,t),R.isPlainObject(e))R.extend(!0,u,e);else{if(t===Q)return u[e];R.isPlainObject(u[e])?R.extend(!0,u[e],t):u[e]=t}},internal:function(e,t){if(R.isPlainObject(e))R.extend(!0,A,e);else{if(t===Q)return A[e];A[e]=t}},debug:function(){!u.silent&&u.debug&&(u.performance?A.performance.log(arguments):(A.debug=Function.prototype.bind.call(console.info,console,u.name+":"),A.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?A.performance.log(arguments):(A.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),A.verbose.apply(console,arguments)))},error:function(){u.silent||(A.error=Function.prototype.bind.call(console.error,console,u.name+":"),A.error.apply(console,arguments))},performance:{log:function(e){var t,n;u.performance&&(n=(t=(new Date).getTime())-(I||t),I=t,N.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:w,"Execution Time":n})),clearTimeout(A.performance.timer),A.performance.timer=setTimeout(A.performance.display,500)},display:function(){var e=u.name+":",n=0;I=!1,clearTimeout(A.performance.timer),R.each(N,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",L&&(e+=" '"+L+"'"),(console.group!==Q||console.table!==Q)&&0<N.length&&(console.groupCollapsed(e),console.table?console.table(N):R.each(N,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),N=[]}},invoke:function(i,e,t){var o,s,n,a=C;return e=e||q,t=w||t,"string"==typeof i&&a!==Q&&(i=i.split(/[\. ]/),o=i.length-1,R.each(i,function(e,t){var n=e!=o?t+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(R.isPlainObject(a[n])&&e!=o)a=a[n];else{if(a[n]!==Q)return s=a[n],!1;{if(!R.isPlainObject(a[t])||e==o)return a[t]!==Q&&(s=a[t]),!1;a=a[t]}}})),R.isFunction(s)?n=s.apply(t,e):s!==Q&&(n=s),Array.isArray(D)?D.push(n):D!==Q?D=[D,n]:n!==Q&&(D=n),s}};j?(C===Q&&(R.isFunction(u.templates[z])&&(u.autoShow=!0,u.className.modal=u.className.template,u=R.extend(!0,{},u,u.templates[z].apply(A,q)),m=u.className,u.namespace,g=u.fields,p=u.error),A.initialize()),R.isFunction(u.templates[z])||A.invoke(z)):(C!==Q&&C.invoke("destroy"),A.initialize(),D=y)}),D!==Q?D:this},R.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"}},R.fn.modal.settings.templates={getArguments:function(e){e=[].slice.call(e);return R.isPlainObject(e[0])?R.extend({handler:function(){},content:"",title:""},e[0]):(R.isFunction(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),n=t.handler;return{title:t.title,content:t.content,onApprove:n,actions:[{text:e.text.ok,class:e.className.ok,click:n}]}},confirm:function(){function e(){i.handler(!0)}function t(){i.handler(!1)}var n=this.get.settings(),i=n.templates.getArguments(arguments);return{title:i.title,content:i.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}]}},prompt:function(){function e(){var e=n.get.settings(),e=n.get.element().find(e.selector.prompt)[0];o.handler(R(e).val())}function t(){o.handler(null)}var n=this,i=this.get.settings(),o=i.templates.getArguments(arguments);return 0===R(R.parseHTML(o.content)).filter(".ui.input").length&&(o.content+='<p><div class="'+this.helpers.deQuote(i.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:i.text.ok,class:i.className.ok,click:e},{text:i.text.cancel,class:i.className.cancel,click:t}]}}}}(jQuery,window,document);
|
package/dist/components/nag.css
CHANGED
package/dist/components/nag.js
CHANGED
package/dist/components/popup.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.0-beta.
|
2
|
+
* # Fomantic-UI 2.9.0-beta.310+19b7d18 - Popup
|
3
3
|
* http://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -438,6 +438,7 @@ $.fn.popup = function(parameters) {
|
|
438
438
|
queue : false,
|
439
439
|
debug : settings.debug,
|
440
440
|
verbose : settings.verbose,
|
441
|
+
silent : settings.silent,
|
441
442
|
duration : settings.transition.showDuration || settings.duration,
|
442
443
|
onComplete : function() {
|
443
444
|
module.bind.close();
|
@@ -462,6 +463,7 @@ $.fn.popup = function(parameters) {
|
|
462
463
|
duration : settings.transition.hideDuration || settings.duration,
|
463
464
|
debug : settings.debug,
|
464
465
|
verbose : settings.verbose,
|
466
|
+
silent : settings.silent,
|
465
467
|
onComplete : function() {
|
466
468
|
module.reset();
|
467
469
|
callback.call($popup, element);
|
@@ -1135,7 +1137,7 @@ $.fn.popup = function(parameters) {
|
|
1135
1137
|
return !module.is.visible();
|
1136
1138
|
},
|
1137
1139
|
rtl: function () {
|
1138
|
-
return $module.attr('dir') === 'rtl' || $module.css('direction') === 'rtl';
|
1140
|
+
return $module.attr('dir') === 'rtl' || $module.css('direction') === 'rtl' || $body.attr('dir') === 'rtl' || $body.css('direction') === 'rtl' || $context.attr('dir') === 'rtl' || $context.css('direction') === 'rtl';
|
1139
1141
|
}
|
1140
1142
|
},
|
1141
1143
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.0-beta.
|
2
|
+
* # Fomantic UI - 2.9.0-beta.310+19b7d18
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* http://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(N,V,W,z){"use strict";N.isFunction=N.isFunction||function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},V=void 0!==V&&V.Math==Math?V:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),N.fn.popup=function(x){var E,t=N(this),k=N(W),S=N(V),O=N("body"),A=t.selector||"",F="ontouchstart"in W.documentElement?"touchstart":"click",D=(new Date).getTime(),j=[],R=x,M="string"==typeof R,H=[].slice.call(arguments,1);return t.each(function(){var p,s,t,e,o,u=N.isPlainObject(x)?N.extend(!0,{},N.fn.popup.settings,x):N.extend({},N.fn.popup.settings),n=u.selector,c=u.className,d=u.error,f=u.metadata,i=u.namespace,r="."+u.namespace,a="module-"+i,h=N(this),l=[V,W].indexOf(u.context)<0?k.find(u.context):N(u.context),g=[V,W].indexOf(u.scrollContext)<0?k.find(u.scrollContext):N(u.scrollContext),m=[V,W].indexOf(u.boundary)<0?k.find(u.boundary):N(u.boundary),v=u.target?[V,W].indexOf(u.target)<0?k.find(u.target):N(u.target):h,b=0,w=!1,y=!1,P=this,C=h.data(a),T={initialize:function(){T.debug("Initializing",h),T.createID(),T.bind.events(),!T.exists()&&u.preserve&&T.create(),u.observeChanges&&T.observeChanges(),T.instantiate()},instantiate:function(){T.verbose("Storing instance",T),C=T,h.data(a,C)},observeChanges:function(){"MutationObserver"in V&&((t=new MutationObserver(T.event.documentChanged)).observe(W,{childList:!0,subtree:!0}),T.debug("Setting up mutation observer",t))},refresh:function(){u.popup?p=k.find(u.popup).eq(0):u.inline&&(p=v.nextAll(n.popup).eq(0),u.popup=p),u.popup?(p.addClass(c.loading),s=T.get.offsetParent(),p.removeClass(c.loading),u.movePopup&&T.has.popup()&&T.get.offsetParent(p)[0]!==s[0]&&(T.debug("Moving popup to the same offset parent as target"),p.detach().appendTo(s))):s=u.inline?T.get.offsetParent(v):T.has.popup()?T.get.offsetParent(p):O,s.is("html")&&s[0]!==O[0]&&(T.debug("Setting page as offset parent"),s=O),T.get.variation()&&T.set.variation()},reposition:function(){T.refresh(),T.set.position()},destroy:function(){T.debug("Destroying previous module"),t&&t.disconnect(),p&&!u.preserve&&T.removePopup(),clearTimeout(T.hideTimer),clearTimeout(T.showTimer),T.unbind.close(),T.unbind.events(),h.removeData(a)},event:{start:function(t){var e=N.isPlainObject(u.delay)?u.delay.show:u.delay;clearTimeout(T.hideTimer),y&&!u.addTouchEvents||(T.showTimer=setTimeout(T.show,e))},end:function(){var t=N.isPlainObject(u.delay)?u.delay.hide:u.delay;clearTimeout(T.showTimer),T.hideTimer=setTimeout(T.hide,t)},touchstart:function(t){y=!0,u.addTouchEvents&&T.show()},resize:function(){T.is.visible()&&T.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==P||0<N(t).find(P).length)&&(T.debug("Element removed from DOM, tearing down events"),T.destroy())})})},hideGracefully:function(t){var e=N(t.target),o=N.contains(W.documentElement,t.target),e=0<e.closest(n.popup).length;t&&!e&&o?(T.debug("Click occurred outside popup hiding popup"),T.hide()):T.debug("Click was inside popup, keeping popup open")}},create:function(){var t=T.get.html(),e=T.get.title(),o=T.get.content();t||o||e?(T.debug("Creating pop-up html"),t=t||u.templates.popup({title:e,content:o}),p=N("<div/>").addClass(c.popup).data(f.activator,h).html(t),u.inline?(T.verbose("Inserting popup element inline",p),p.insertAfter(h)):(T.verbose("Appending popup element to body",p),p.appendTo(l)),T.refresh(),T.set.variation(),u.hoverable&&T.bind.popup(),u.onCreate.call(p,P)):u.popup?(k.find(u.popup).data(f.activator,h),T.verbose("Used popup specified in settings"),T.refresh(),u.hoverable&&T.bind.popup()):0!==v.next(n.popup).length?(T.verbose("Pre-existing popup found"),u.inline=!0,u.popup=v.next(n.popup).data(f.activator,h),T.refresh(),u.hoverable&&T.bind.popup()):T.debug("No content specified skipping display",P)},createID:function(){o=(Math.random().toString(16)+"000000000").slice(2,10),e="."+o,T.verbose("Creating unique id for element",o)},toggle:function(){T.debug("Toggling pop-up"),T.is.hidden()?(T.debug("Popup is hidden, showing pop-up"),T.unbind.close(),T.show()):(T.debug("Popup is visible, hiding pop-up"),T.hide())},show:function(t){t=t||function(){},T.debug("Showing pop-up",u.transition),!T.is.hidden()||T.is.active()&&T.is.dropdown()||(T.exists()||T.create(),!1===u.onShow.call(p,P)?T.debug("onShow callback returned false, cancelling popup animation"):(u.preserve||u.popup||T.refresh(),p&&T.set.position()&&(T.save.conditions(),u.exclusive&&T.hideAll(),T.animate.show(t))))},hide:function(t){t=t||function(){},(T.is.visible()||T.is.animating())&&(!1===u.onHide.call(p,P)?T.debug("onHide callback returned false, cancelling popup animation"):(T.remove.visible(),T.unbind.close(),T.restore.conditions(),T.animate.hide(t)))},hideAll:function(){k.find(n.popup).filter("."+c.popupVisible).each(function(){N(this).data(f.activator).popup("hide")})},exists:function(){return!!p&&(u.inline||u.popup?T.has.popup():1<=p.closest(l).length)},removePopup:function(){T.has.popup()&&!u.popup&&(T.debug("Removing popup",p),p.remove(),p=z,u.onRemove.call(p,P))},save:{conditions:function(){T.cache={title:h.attr("title")},T.cache.title&&h.removeAttr("title"),T.verbose("Saving original attributes",T.cache.title)}},restore:{conditions:function(){return T.cache&&T.cache.title&&(h.attr("title",T.cache.title),T.verbose("Restoring original attributes",T.cache.title)),!0}},supports:{svg:function(){return"undefined"!=typeof SVGGraphicsElement}},animate:{show:function(t){t=N.isFunction(t)?t:function(){},u.transition&&N.fn.transition!==z&&h.transition("is supported")?(T.set.visible(),p.transition({animation:(u.transition.showMethod||u.transition)+" in",queue:!1,debug:u.debug,verbose:u.verbose,duration:u.transition.showDuration||u.duration,onComplete:function(){T.bind.close(),t.call(p,P),u.onVisible.call(p,P)}})):T.error(d.noTransition)},hide:function(t){t=N.isFunction(t)?t:function(){},T.debug("Hiding pop-up"),u.transition&&N.fn.transition!==z&&h.transition("is supported")?p.transition({animation:(u.transition.hideMethod||u.transition)+" out",queue:!1,duration:u.transition.hideDuration||u.duration,debug:u.debug,verbose:u.verbose,onComplete:function(){T.reset(),t.call(p,P),u.onHidden.call(p,P)}}):T.error(d.noTransition)}},change:{content:function(t){p.html(t)}},get:{html:function(){return h.removeData(f.html),h.data(f.html)||u.html},title:function(){return h.removeData(f.title),h.data(f.title)||u.title},content:function(){return h.removeData(f.content),h.data(f.content)||u.content||h.attr("title")},variation:function(){return h.removeData(f.variation),h.data(f.variation)||u.variation},popup:function(){return p},popupOffset:function(){return p.offset()},calculations:function(){var t=T.get.offsetParent(p),e=v[0],o=m[0]==V,n=v.offset(),i=u.inline||u.popup&&u.movePopup?v.offsetParent().offset():{top:0,left:0},r=o?{top:0,left:0}:m.offset(),a={},o=o?{top:S.scrollTop(),left:S.scrollLeft()}:{top:0,left:0},a={target:{element:v[0],width:v.outerWidth(),height:v.outerHeight(),top:n.top-i.top,left:n.left-i.left,margin:{}},popup:{width:p.outerWidth(),height:p.outerHeight()},parent:{width:s.outerWidth(),height:s.outerHeight()},screen:{top:r.top,left:r.left,scroll:{top:o.top,left:o.left},width:m.width(),height:m.height()}};return t[0]!==s[0]&&(n=t.offset(),a.target.top-=n.top,a.target.left-=n.left,a.parent.width=t.outerWidth(),a.parent.height=t.outerHeight()),u.setFluidWidth&&T.is.fluid()&&(a.container={width:p.parent().outerWidth()},a.popup.width=a.container.width),a.target.margin.top=u.inline?parseInt(V.getComputedStyle(e).getPropertyValue("margin-top"),10):0,a.target.margin.left=u.inline?T.is.rtl()?parseInt(V.getComputedStyle(e).getPropertyValue("margin-right"),10):parseInt(V.getComputedStyle(e).getPropertyValue("margin-left"),10):0,i=a.screen,a.boundary={top:i.top+i.scroll.top,bottom:i.top+i.scroll.top+i.height,left:i.left+i.scroll.left,right:i.left+i.scroll.left+i.width},a},id:function(){return o},startEvent:function(){return"hover"==u.on?"mouseenter":"focus"==u.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==u.on?"mouseleave":"focus"==u.on&&"blur"},distanceFromBoundary:function(t,e){var o={},n=(e=e||T.get.calculations()).popup,e=e.boundary;return t&&(o={top:t.top-e.top,left:t.left-e.left,right:e.right-(t.left+n.width),bottom:e.bottom-(t.top+n.height)},T.verbose("Distance from boundaries determined",t,o)),o},offsetParent:function(t){var e=(t!==z?t:v)[0].parentNode,o=N(e);if(e)for(var n="none"===o.css("transform"),i="static"===o.css("position"),r=o.is("body");e&&!r&&i&&n;)e=e.parentNode,n="none"===(o=N(e)).css("transform"),i="static"===o.css("position"),r=o.is("body");return o&&0<o.length?o:N()},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(t){var e=t.split(" "),o=e[0],e=e[1],n="top"==o||"bottom"==o,i=!1,r=!1,a=!1;return w||(T.verbose("All available positions available"),w=T.get.positions()),T.debug("Recording last position tried",t),w[t]=!0,"opposite"===u.prefer&&(a=(a=[{top:"bottom",bottom:"top",left:"right",right:"left"}[o],e]).join(" "),i=!0===w[a],T.debug("Trying opposite strategy",a)),"adjacent"===u.prefer&&n&&(a=(a=[o,{left:"center",center:"right",right:"left"}[e]]).join(" "),r=!0===w[a],T.debug("Trying adjacent strategy",a)),(r||i)&&(T.debug("Using backup position",a),a={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"}[t]),a}},set:{position:function(t,e){if(0!==v.length&&0!==p.length){var o,n,i,r,a,s,l;if(e=e||T.get.calculations(),t=t||h.data(f.position)||u.position,o=h.data(f.offset)||u.offset,n=u.distanceAway,i=e.target,r=e.popup,a=e.parent,T.should.centerArrow(e)&&(T.verbose("Adjusting offset to center arrow on small target element"),"top left"!=t&&"bottom left"!=t||(o=(o+=i.width/2)-u.arrowPixelsFromEdge),"top right"!=t&&"bottom right"!=t||(o=(o-=i.width/2)+u.arrowPixelsFromEdge)),0===i.width&&0===i.height&&!T.is.svg(i.element))return T.debug("Popup target is hidden, no action taken"),!1;switch(u.inline&&(T.debug("Adding margin to calculation",i.margin),"left center"==t||"right center"==t?(o+=i.margin.top,n+=-i.margin.left):"top left"==t||"top center"==t||"top right"==t?(o+=i.margin.left,n-=i.margin.top):(o+=i.margin.left,n+=i.margin.top)),T.debug("Determining popup position from calculations",t,e),T.is.rtl()&&(t=t.replace(/left|right/g,function(t){return"left"==t?"right":"left"}),T.debug("RTL: Popup position updated",t)),t=b==u.maxSearchDepth&&"string"==typeof u.lastResort?u.lastResort:t){case"top left":s={top:"auto",bottom:a.height-i.top+n,left:i.left+o,right:"auto"};break;case"top center":s={bottom:a.height-i.top+n,left:i.left+i.width/2-r.width/2+o,top:"auto",right:"auto"};break;case"top right":s={bottom:a.height-i.top+n,right:a.width-i.left-i.width-o,top:"auto",left:"auto"};break;case"left center":s={top:i.top+i.height/2-r.height/2+o,right:a.width-i.left+n,left:"auto",bottom:"auto"};break;case"right center":s={top:i.top+i.height/2-r.height/2+o,left:i.left+i.width+n,bottom:"auto",right:"auto"};break;case"bottom left":s={top:i.top+i.height+n,left:i.left+o,bottom:"auto",right:"auto"};break;case"bottom center":s={top:i.top+i.height+n,left:i.left+i.width/2-r.width/2+o,bottom:"auto",right:"auto"};break;case"bottom right":s={top:i.top+i.height+n,right:a.width-i.left-i.width-o,left:"auto",bottom:"auto"}}if(s===z&&T.error(d.invalidPosition,t),T.debug("Calculated popup positioning values",s),p.css(s).removeClass(c.position).addClass(t).addClass(c.loading),l=T.get.popupOffset(),l=T.get.distanceFromBoundary(l,e),!u.forcePosition&&T.is.offstage(l,t)){if(T.debug("Position is outside viewport",t),b<u.maxSearchDepth)return b++,t=T.get.nextPosition(t),T.debug("Trying new position",t),!!p&&T.set.position(t,e);if(!u.lastResort)return T.debug("Popup could not find a position to display",p),T.error(d.cannotPlace,P),T.remove.attempts(),T.remove.loading(),T.reset(),u.onUnplaceable.call(p,P),!1;T.debug("No position found, showing with last position")}return T.debug("Position is on stage",t),T.remove.attempts(),T.remove.loading(),u.setFluidWidth&&T.is.fluid()&&T.set.fluidWidth(e),!0}T.error(d.notFound)},fluidWidth:function(t){t=t||T.get.calculations(),T.debug("Automatically setting element width to parent width",t.parent.width),p.css("width",t.container.width)},variation:function(t){(t=t||T.get.variation())&&T.has.popup()&&(T.verbose("Adding variation to popup",t),p.addClass(t))},visible:function(){h.addClass(c.visible)}},remove:{loading:function(){p.removeClass(c.loading)},variation:function(t){(t=t||T.get.variation())&&(T.verbose("Removing variation",t),p.removeClass(t))},visible:function(){h.removeClass(c.visible)},attempts:function(){T.verbose("Resetting all searched positions"),b=0,w=!1}},bind:{events:function(){T.debug("Binding popup events to module"),"click"==u.on&&h.on(F+r,T.toggle),"hover"==u.on&&h.on("touchstart"+r,T.event.touchstart),T.get.startEvent()&&h.on(T.get.startEvent()+r,T.event.start).on(T.get.endEvent()+r,T.event.end),u.target&&T.debug("Target set to element",v),S.on("resize"+e,T.event.resize)},popup:function(){T.verbose("Allowing hover events on popup to prevent closing"),p&&T.has.popup()&&p.on("mouseenter"+r,T.event.start).on("mouseleave"+r,T.event.end)},close:function(){(!0===u.hideOnScroll||"auto"==u.hideOnScroll&&"click"!=u.on)&&T.bind.closeOnScroll(),T.is.closable()?T.bind.clickaway():"hover"==u.on&&y&&T.bind.touchClose()},closeOnScroll:function(){T.verbose("Binding scroll close event to document"),g.one(T.get.scrollEvent()+e,T.event.hideGracefully)},touchClose:function(){T.verbose("Binding popup touchclose event to document"),k.on("touchstart"+e,function(t){T.verbose("Touched away from popup"),T.event.hideGracefully.call(P,t)})},clickaway:function(){T.verbose("Binding popup close event to document"),k.on(F+e,function(t){T.verbose("Clicked away from popup"),T.event.hideGracefully.call(P,t)})}},unbind:{events:function(){S.off(e),h.off(r)},close:function(){k.off(e),g.off(e)}},has:{popup:function(){return p&&0<p.length}},should:{centerArrow:function(t){return!T.is.basic()&&t.target.width<=2*u.arrowPixelsFromEdge}},is:{closable:function(){return"auto"==u.closable?"hover"!=u.on:u.closable},offstage:function(t,o){var n=[];return N.each(t,function(t,e){e<-u.jitter&&(T.debug("Position exceeds allowable distance from edge",t,e,o),n.push(t))}),0<n.length},svg:function(t){return T.supports.svg()&&t instanceof SVGGraphicsElement},basic:function(){return h.hasClass(c.basic)},active:function(){return h.hasClass(c.active)},animating:function(){return p!==z&&p.hasClass(c.animating)},fluid:function(){return p!==z&&p.hasClass(c.fluid)},visible:function(){return p!==z&&p.hasClass(c.popupVisible)},dropdown:function(){return h.hasClass(c.dropdown)},hidden:function(){return!T.is.visible()},rtl:function(){return"rtl"===h.attr("dir")||"rtl"===h.css("direction")}},reset:function(){T.remove.visible(),u.preserve?N.fn.transition!==z&&p.transition("remove transition"):T.removePopup()},setting:function(t,e){if(N.isPlainObject(t))N.extend(!0,u,t);else{if(e===z)return u[t];u[t]=e}},internal:function(t,e){if(N.isPlainObject(t))N.extend(!0,T,t);else{if(e===z)return T[t];T[t]=e}},debug:function(){!u.silent&&u.debug&&(u.performance?T.performance.log(arguments):(T.debug=Function.prototype.bind.call(console.info,console,u.name+":"),T.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?T.performance.log(arguments):(T.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),T.verbose.apply(console,arguments)))},error:function(){u.silent||(T.error=Function.prototype.bind.call(console.error,console,u.name+":"),T.error.apply(console,arguments))},performance:{log:function(t){var e,o;u.performance&&(o=(e=(new Date).getTime())-(D||e),D=e,j.push({Name:t[0],Arguments:[].slice.call(t,1)||"",Element:P,"Execution Time":o})),clearTimeout(T.performance.timer),T.performance.timer=setTimeout(T.performance.display,500)},display:function(){var t=u.name+":",o=0;D=!1,clearTimeout(T.performance.timer),N.each(j,function(t,e){o+=e["Execution Time"]}),t+=" "+o+"ms",A&&(t+=" '"+A+"'"),(console.group!==z||console.table!==z)&&0<j.length&&(console.groupCollapsed(t),console.table?console.table(j):N.each(j,function(t,e){console.log(e.Name+": "+e["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(n,t,e){var i,r,o,a=C;return t=t||H,e=P||e,"string"==typeof n&&a!==z&&(n=n.split(/[\. ]/),i=n.length-1,N.each(n,function(t,e){var o=t!=i?e+n[t+1].charAt(0).toUpperCase()+n[t+1].slice(1):n;if(N.isPlainObject(a[o])&&t!=i)a=a[o];else{if(a[o]!==z)return r=a[o],!1;{if(!N.isPlainObject(a[e])||t==i)return a[e]!==z&&(r=a[e]),!1;a=a[e]}}})),N.isFunction(r)?o=r.apply(e,t):r!==z&&(o=r),Array.isArray(E)?E.push(o):E!==z?E=[E,o]:o!==z&&(E=o),r}};M?(C===z&&T.initialize(),T.invoke(R)):(C!==z&&C.invoke("destroy"),T.initialize())}),E!==z?E:this},N.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:V,addTouchEvents:!0,position:"top left",forcePosition:!1,variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:V,prefer:"opposite",lastResort:!1,arrowPixelsFromEdge:20,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",basic:"basic",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(t){var e={"<":"<",">":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(t)?(t=t.replace(/&(?![a-z0-9#]{1,6};)/,"&")).replace(/[<>"'`]/g,function(t){return e[t]}):t},popup:function(t){var e="",o=N.fn.popup.settings.templates.escape;return typeof t!==z&&(typeof t.title!==z&&t.title&&(t.title=o(t.title),e+='<div class="header">'+t.title+"</div>"),typeof t.content!==z&&t.content&&(t.content=o(t.content),e+='<div class="content">'+t.content+"</div>")),e}}}}(jQuery,window,document);
|
11
|
+
!function(N,V,W,z){"use strict";N.isFunction=N.isFunction||function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},V=void 0!==V&&V.Math==Math?V:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),N.fn.popup=function(x){var E,t=N(this),k=N(W),S=N(V),O=N("body"),A=t.selector||"",F="ontouchstart"in W.documentElement?"touchstart":"click",D=(new Date).getTime(),j=[],R=x,M="string"==typeof R,H=[].slice.call(arguments,1);return t.each(function(){var p,s,t,e,o,u=N.isPlainObject(x)?N.extend(!0,{},N.fn.popup.settings,x):N.extend({},N.fn.popup.settings),n=u.selector,c=u.className,d=u.error,f=u.metadata,i=u.namespace,r="."+u.namespace,a="module-"+i,h=N(this),l=[V,W].indexOf(u.context)<0?k.find(u.context):N(u.context),g=[V,W].indexOf(u.scrollContext)<0?k.find(u.scrollContext):N(u.scrollContext),m=[V,W].indexOf(u.boundary)<0?k.find(u.boundary):N(u.boundary),v=u.target?[V,W].indexOf(u.target)<0?k.find(u.target):N(u.target):h,b=0,w=!1,y=!1,P=this,C=h.data(a),T={initialize:function(){T.debug("Initializing",h),T.createID(),T.bind.events(),!T.exists()&&u.preserve&&T.create(),u.observeChanges&&T.observeChanges(),T.instantiate()},instantiate:function(){T.verbose("Storing instance",T),C=T,h.data(a,C)},observeChanges:function(){"MutationObserver"in V&&((t=new MutationObserver(T.event.documentChanged)).observe(W,{childList:!0,subtree:!0}),T.debug("Setting up mutation observer",t))},refresh:function(){u.popup?p=k.find(u.popup).eq(0):u.inline&&(p=v.nextAll(n.popup).eq(0),u.popup=p),u.popup?(p.addClass(c.loading),s=T.get.offsetParent(),p.removeClass(c.loading),u.movePopup&&T.has.popup()&&T.get.offsetParent(p)[0]!==s[0]&&(T.debug("Moving popup to the same offset parent as target"),p.detach().appendTo(s))):s=u.inline?T.get.offsetParent(v):T.has.popup()?T.get.offsetParent(p):O,s.is("html")&&s[0]!==O[0]&&(T.debug("Setting page as offset parent"),s=O),T.get.variation()&&T.set.variation()},reposition:function(){T.refresh(),T.set.position()},destroy:function(){T.debug("Destroying previous module"),t&&t.disconnect(),p&&!u.preserve&&T.removePopup(),clearTimeout(T.hideTimer),clearTimeout(T.showTimer),T.unbind.close(),T.unbind.events(),h.removeData(a)},event:{start:function(t){var e=N.isPlainObject(u.delay)?u.delay.show:u.delay;clearTimeout(T.hideTimer),y&&!u.addTouchEvents||(T.showTimer=setTimeout(T.show,e))},end:function(){var t=N.isPlainObject(u.delay)?u.delay.hide:u.delay;clearTimeout(T.showTimer),T.hideTimer=setTimeout(T.hide,t)},touchstart:function(t){y=!0,u.addTouchEvents&&T.show()},resize:function(){T.is.visible()&&T.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t==P||0<N(t).find(P).length)&&(T.debug("Element removed from DOM, tearing down events"),T.destroy())})})},hideGracefully:function(t){var e=N(t.target),o=N.contains(W.documentElement,t.target),e=0<e.closest(n.popup).length;t&&!e&&o?(T.debug("Click occurred outside popup hiding popup"),T.hide()):T.debug("Click was inside popup, keeping popup open")}},create:function(){var t=T.get.html(),e=T.get.title(),o=T.get.content();t||o||e?(T.debug("Creating pop-up html"),t=t||u.templates.popup({title:e,content:o}),p=N("<div/>").addClass(c.popup).data(f.activator,h).html(t),u.inline?(T.verbose("Inserting popup element inline",p),p.insertAfter(h)):(T.verbose("Appending popup element to body",p),p.appendTo(l)),T.refresh(),T.set.variation(),u.hoverable&&T.bind.popup(),u.onCreate.call(p,P)):u.popup?(k.find(u.popup).data(f.activator,h),T.verbose("Used popup specified in settings"),T.refresh(),u.hoverable&&T.bind.popup()):0!==v.next(n.popup).length?(T.verbose("Pre-existing popup found"),u.inline=!0,u.popup=v.next(n.popup).data(f.activator,h),T.refresh(),u.hoverable&&T.bind.popup()):T.debug("No content specified skipping display",P)},createID:function(){o=(Math.random().toString(16)+"000000000").slice(2,10),e="."+o,T.verbose("Creating unique id for element",o)},toggle:function(){T.debug("Toggling pop-up"),T.is.hidden()?(T.debug("Popup is hidden, showing pop-up"),T.unbind.close(),T.show()):(T.debug("Popup is visible, hiding pop-up"),T.hide())},show:function(t){t=t||function(){},T.debug("Showing pop-up",u.transition),!T.is.hidden()||T.is.active()&&T.is.dropdown()||(T.exists()||T.create(),!1===u.onShow.call(p,P)?T.debug("onShow callback returned false, cancelling popup animation"):(u.preserve||u.popup||T.refresh(),p&&T.set.position()&&(T.save.conditions(),u.exclusive&&T.hideAll(),T.animate.show(t))))},hide:function(t){t=t||function(){},(T.is.visible()||T.is.animating())&&(!1===u.onHide.call(p,P)?T.debug("onHide callback returned false, cancelling popup animation"):(T.remove.visible(),T.unbind.close(),T.restore.conditions(),T.animate.hide(t)))},hideAll:function(){k.find(n.popup).filter("."+c.popupVisible).each(function(){N(this).data(f.activator).popup("hide")})},exists:function(){return!!p&&(u.inline||u.popup?T.has.popup():1<=p.closest(l).length)},removePopup:function(){T.has.popup()&&!u.popup&&(T.debug("Removing popup",p),p.remove(),p=z,u.onRemove.call(p,P))},save:{conditions:function(){T.cache={title:h.attr("title")},T.cache.title&&h.removeAttr("title"),T.verbose("Saving original attributes",T.cache.title)}},restore:{conditions:function(){return T.cache&&T.cache.title&&(h.attr("title",T.cache.title),T.verbose("Restoring original attributes",T.cache.title)),!0}},supports:{svg:function(){return"undefined"!=typeof SVGGraphicsElement}},animate:{show:function(t){t=N.isFunction(t)?t:function(){},u.transition&&N.fn.transition!==z&&h.transition("is supported")?(T.set.visible(),p.transition({animation:(u.transition.showMethod||u.transition)+" in",queue:!1,debug:u.debug,verbose:u.verbose,silent:u.silent,duration:u.transition.showDuration||u.duration,onComplete:function(){T.bind.close(),t.call(p,P),u.onVisible.call(p,P)}})):T.error(d.noTransition)},hide:function(t){t=N.isFunction(t)?t:function(){},T.debug("Hiding pop-up"),u.transition&&N.fn.transition!==z&&h.transition("is supported")?p.transition({animation:(u.transition.hideMethod||u.transition)+" out",queue:!1,duration:u.transition.hideDuration||u.duration,debug:u.debug,verbose:u.verbose,silent:u.silent,onComplete:function(){T.reset(),t.call(p,P),u.onHidden.call(p,P)}}):T.error(d.noTransition)}},change:{content:function(t){p.html(t)}},get:{html:function(){return h.removeData(f.html),h.data(f.html)||u.html},title:function(){return h.removeData(f.title),h.data(f.title)||u.title},content:function(){return h.removeData(f.content),h.data(f.content)||u.content||h.attr("title")},variation:function(){return h.removeData(f.variation),h.data(f.variation)||u.variation},popup:function(){return p},popupOffset:function(){return p.offset()},calculations:function(){var t=T.get.offsetParent(p),e=v[0],o=m[0]==V,n=v.offset(),i=u.inline||u.popup&&u.movePopup?v.offsetParent().offset():{top:0,left:0},r=o?{top:0,left:0}:m.offset(),a={},o=o?{top:S.scrollTop(),left:S.scrollLeft()}:{top:0,left:0},a={target:{element:v[0],width:v.outerWidth(),height:v.outerHeight(),top:n.top-i.top,left:n.left-i.left,margin:{}},popup:{width:p.outerWidth(),height:p.outerHeight()},parent:{width:s.outerWidth(),height:s.outerHeight()},screen:{top:r.top,left:r.left,scroll:{top:o.top,left:o.left},width:m.width(),height:m.height()}};return t[0]!==s[0]&&(n=t.offset(),a.target.top-=n.top,a.target.left-=n.left,a.parent.width=t.outerWidth(),a.parent.height=t.outerHeight()),u.setFluidWidth&&T.is.fluid()&&(a.container={width:p.parent().outerWidth()},a.popup.width=a.container.width),a.target.margin.top=u.inline?parseInt(V.getComputedStyle(e).getPropertyValue("margin-top"),10):0,a.target.margin.left=u.inline?T.is.rtl()?parseInt(V.getComputedStyle(e).getPropertyValue("margin-right"),10):parseInt(V.getComputedStyle(e).getPropertyValue("margin-left"),10):0,i=a.screen,a.boundary={top:i.top+i.scroll.top,bottom:i.top+i.scroll.top+i.height,left:i.left+i.scroll.left,right:i.left+i.scroll.left+i.width},a},id:function(){return o},startEvent:function(){return"hover"==u.on?"mouseenter":"focus"==u.on&&"focus"},scrollEvent:function(){return"scroll"},endEvent:function(){return"hover"==u.on?"mouseleave":"focus"==u.on&&"blur"},distanceFromBoundary:function(t,e){var o={},n=(e=e||T.get.calculations()).popup,e=e.boundary;return t&&(o={top:t.top-e.top,left:t.left-e.left,right:e.right-(t.left+n.width),bottom:e.bottom-(t.top+n.height)},T.verbose("Distance from boundaries determined",t,o)),o},offsetParent:function(t){var e=(t!==z?t:v)[0].parentNode,o=N(e);if(e)for(var n="none"===o.css("transform"),i="static"===o.css("position"),r=o.is("body");e&&!r&&i&&n;)e=e.parentNode,n="none"===(o=N(e)).css("transform"),i="static"===o.css("position"),r=o.is("body");return o&&0<o.length?o:N()},positions:function(){return{"top left":!1,"top center":!1,"top right":!1,"bottom left":!1,"bottom center":!1,"bottom right":!1,"left center":!1,"right center":!1}},nextPosition:function(t){var e=t.split(" "),o=e[0],e=e[1],n="top"==o||"bottom"==o,i=!1,r=!1,a=!1;return w||(T.verbose("All available positions available"),w=T.get.positions()),T.debug("Recording last position tried",t),w[t]=!0,"opposite"===u.prefer&&(a=(a=[{top:"bottom",bottom:"top",left:"right",right:"left"}[o],e]).join(" "),i=!0===w[a],T.debug("Trying opposite strategy",a)),"adjacent"===u.prefer&&n&&(a=(a=[o,{left:"center",center:"right",right:"left"}[e]]).join(" "),r=!0===w[a],T.debug("Trying adjacent strategy",a)),(r||i)&&(T.debug("Using backup position",a),a={"top left":"top center","top center":"top right","top right":"right center","right center":"bottom right","bottom right":"bottom center","bottom center":"bottom left","bottom left":"left center","left center":"top left"}[t]),a}},set:{position:function(t,e){if(0!==v.length&&0!==p.length){var o,n,i,r,a,s,l;if(e=e||T.get.calculations(),t=t||h.data(f.position)||u.position,o=h.data(f.offset)||u.offset,n=u.distanceAway,i=e.target,r=e.popup,a=e.parent,T.should.centerArrow(e)&&(T.verbose("Adjusting offset to center arrow on small target element"),"top left"!=t&&"bottom left"!=t||(o=(o+=i.width/2)-u.arrowPixelsFromEdge),"top right"!=t&&"bottom right"!=t||(o=(o-=i.width/2)+u.arrowPixelsFromEdge)),0===i.width&&0===i.height&&!T.is.svg(i.element))return T.debug("Popup target is hidden, no action taken"),!1;switch(u.inline&&(T.debug("Adding margin to calculation",i.margin),"left center"==t||"right center"==t?(o+=i.margin.top,n+=-i.margin.left):"top left"==t||"top center"==t||"top right"==t?(o+=i.margin.left,n-=i.margin.top):(o+=i.margin.left,n+=i.margin.top)),T.debug("Determining popup position from calculations",t,e),T.is.rtl()&&(t=t.replace(/left|right/g,function(t){return"left"==t?"right":"left"}),T.debug("RTL: Popup position updated",t)),t=b==u.maxSearchDepth&&"string"==typeof u.lastResort?u.lastResort:t){case"top left":s={top:"auto",bottom:a.height-i.top+n,left:i.left+o,right:"auto"};break;case"top center":s={bottom:a.height-i.top+n,left:i.left+i.width/2-r.width/2+o,top:"auto",right:"auto"};break;case"top right":s={bottom:a.height-i.top+n,right:a.width-i.left-i.width-o,top:"auto",left:"auto"};break;case"left center":s={top:i.top+i.height/2-r.height/2+o,right:a.width-i.left+n,left:"auto",bottom:"auto"};break;case"right center":s={top:i.top+i.height/2-r.height/2+o,left:i.left+i.width+n,bottom:"auto",right:"auto"};break;case"bottom left":s={top:i.top+i.height+n,left:i.left+o,bottom:"auto",right:"auto"};break;case"bottom center":s={top:i.top+i.height+n,left:i.left+i.width/2-r.width/2+o,bottom:"auto",right:"auto"};break;case"bottom right":s={top:i.top+i.height+n,right:a.width-i.left-i.width-o,left:"auto",bottom:"auto"}}if(s===z&&T.error(d.invalidPosition,t),T.debug("Calculated popup positioning values",s),p.css(s).removeClass(c.position).addClass(t).addClass(c.loading),l=T.get.popupOffset(),l=T.get.distanceFromBoundary(l,e),!u.forcePosition&&T.is.offstage(l,t)){if(T.debug("Position is outside viewport",t),b<u.maxSearchDepth)return b++,t=T.get.nextPosition(t),T.debug("Trying new position",t),!!p&&T.set.position(t,e);if(!u.lastResort)return T.debug("Popup could not find a position to display",p),T.error(d.cannotPlace,P),T.remove.attempts(),T.remove.loading(),T.reset(),u.onUnplaceable.call(p,P),!1;T.debug("No position found, showing with last position")}return T.debug("Position is on stage",t),T.remove.attempts(),T.remove.loading(),u.setFluidWidth&&T.is.fluid()&&T.set.fluidWidth(e),!0}T.error(d.notFound)},fluidWidth:function(t){t=t||T.get.calculations(),T.debug("Automatically setting element width to parent width",t.parent.width),p.css("width",t.container.width)},variation:function(t){(t=t||T.get.variation())&&T.has.popup()&&(T.verbose("Adding variation to popup",t),p.addClass(t))},visible:function(){h.addClass(c.visible)}},remove:{loading:function(){p.removeClass(c.loading)},variation:function(t){(t=t||T.get.variation())&&(T.verbose("Removing variation",t),p.removeClass(t))},visible:function(){h.removeClass(c.visible)},attempts:function(){T.verbose("Resetting all searched positions"),b=0,w=!1}},bind:{events:function(){T.debug("Binding popup events to module"),"click"==u.on&&h.on(F+r,T.toggle),"hover"==u.on&&h.on("touchstart"+r,T.event.touchstart),T.get.startEvent()&&h.on(T.get.startEvent()+r,T.event.start).on(T.get.endEvent()+r,T.event.end),u.target&&T.debug("Target set to element",v),S.on("resize"+e,T.event.resize)},popup:function(){T.verbose("Allowing hover events on popup to prevent closing"),p&&T.has.popup()&&p.on("mouseenter"+r,T.event.start).on("mouseleave"+r,T.event.end)},close:function(){(!0===u.hideOnScroll||"auto"==u.hideOnScroll&&"click"!=u.on)&&T.bind.closeOnScroll(),T.is.closable()?T.bind.clickaway():"hover"==u.on&&y&&T.bind.touchClose()},closeOnScroll:function(){T.verbose("Binding scroll close event to document"),g.one(T.get.scrollEvent()+e,T.event.hideGracefully)},touchClose:function(){T.verbose("Binding popup touchclose event to document"),k.on("touchstart"+e,function(t){T.verbose("Touched away from popup"),T.event.hideGracefully.call(P,t)})},clickaway:function(){T.verbose("Binding popup close event to document"),k.on(F+e,function(t){T.verbose("Clicked away from popup"),T.event.hideGracefully.call(P,t)})}},unbind:{events:function(){S.off(e),h.off(r)},close:function(){k.off(e),g.off(e)}},has:{popup:function(){return p&&0<p.length}},should:{centerArrow:function(t){return!T.is.basic()&&t.target.width<=2*u.arrowPixelsFromEdge}},is:{closable:function(){return"auto"==u.closable?"hover"!=u.on:u.closable},offstage:function(t,o){var n=[];return N.each(t,function(t,e){e<-u.jitter&&(T.debug("Position exceeds allowable distance from edge",t,e,o),n.push(t))}),0<n.length},svg:function(t){return T.supports.svg()&&t instanceof SVGGraphicsElement},basic:function(){return h.hasClass(c.basic)},active:function(){return h.hasClass(c.active)},animating:function(){return p!==z&&p.hasClass(c.animating)},fluid:function(){return p!==z&&p.hasClass(c.fluid)},visible:function(){return p!==z&&p.hasClass(c.popupVisible)},dropdown:function(){return h.hasClass(c.dropdown)},hidden:function(){return!T.is.visible()},rtl:function(){return"rtl"===h.attr("dir")||"rtl"===h.css("direction")||"rtl"===O.attr("dir")||"rtl"===O.css("direction")||"rtl"===l.attr("dir")||"rtl"===l.css("direction")}},reset:function(){T.remove.visible(),u.preserve?N.fn.transition!==z&&p.transition("remove transition"):T.removePopup()},setting:function(t,e){if(N.isPlainObject(t))N.extend(!0,u,t);else{if(e===z)return u[t];u[t]=e}},internal:function(t,e){if(N.isPlainObject(t))N.extend(!0,T,t);else{if(e===z)return T[t];T[t]=e}},debug:function(){!u.silent&&u.debug&&(u.performance?T.performance.log(arguments):(T.debug=Function.prototype.bind.call(console.info,console,u.name+":"),T.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?T.performance.log(arguments):(T.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),T.verbose.apply(console,arguments)))},error:function(){u.silent||(T.error=Function.prototype.bind.call(console.error,console,u.name+":"),T.error.apply(console,arguments))},performance:{log:function(t){var e,o;u.performance&&(o=(e=(new Date).getTime())-(D||e),D=e,j.push({Name:t[0],Arguments:[].slice.call(t,1)||"",Element:P,"Execution Time":o})),clearTimeout(T.performance.timer),T.performance.timer=setTimeout(T.performance.display,500)},display:function(){var t=u.name+":",o=0;D=!1,clearTimeout(T.performance.timer),N.each(j,function(t,e){o+=e["Execution Time"]}),t+=" "+o+"ms",A&&(t+=" '"+A+"'"),(console.group!==z||console.table!==z)&&0<j.length&&(console.groupCollapsed(t),console.table?console.table(j):N.each(j,function(t,e){console.log(e.Name+": "+e["Execution Time"]+"ms")}),console.groupEnd()),j=[]}},invoke:function(n,t,e){var i,r,o,a=C;return t=t||H,e=P||e,"string"==typeof n&&a!==z&&(n=n.split(/[\. ]/),i=n.length-1,N.each(n,function(t,e){var o=t!=i?e+n[t+1].charAt(0).toUpperCase()+n[t+1].slice(1):n;if(N.isPlainObject(a[o])&&t!=i)a=a[o];else{if(a[o]!==z)return r=a[o],!1;{if(!N.isPlainObject(a[e])||t==i)return a[e]!==z&&(r=a[e]),!1;a=a[e]}}})),N.isFunction(r)?o=r.apply(e,t):r!==z&&(o=r),Array.isArray(E)?E.push(o):E!==z?E=[E,o]:o!==z&&(E=o),r}};M?(C===z&&T.initialize(),T.invoke(R)):(C!==z&&C.invoke("destroy"),T.initialize())}),E!==z?E:this},N.fn.popup.settings={name:"Popup",silent:!1,debug:!1,verbose:!1,performance:!0,namespace:"popup",observeChanges:!0,onCreate:function(){},onRemove:function(){},onShow:function(){},onVisible:function(){},onHide:function(){},onUnplaceable:function(){},onHidden:function(){},on:"hover",boundary:V,addTouchEvents:!0,position:"top left",forcePosition:!1,variation:"",movePopup:!0,target:!1,popup:!1,inline:!1,preserve:!1,hoverable:!1,content:!1,html:!1,title:!1,closable:!0,hideOnScroll:"auto",exclusive:!1,context:"body",scrollContext:V,prefer:"opposite",lastResort:!1,arrowPixelsFromEdge:20,delay:{show:50,hide:70},setFluidWidth:!0,duration:200,transition:"scale",distanceAway:0,jitter:2,offset:0,maxSearchDepth:15,error:{invalidPosition:"The position you specified is not a valid position",cannotPlace:"Popup does not fit within the boundaries of the viewport",method:"The method you called is not defined.",noTransition:"This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>",notFound:"The target or popup you specified does not exist on the page"},metadata:{activator:"activator",content:"content",html:"html",offset:"offset",position:"position",title:"title",variation:"variation"},className:{active:"active",basic:"basic",animating:"animating",dropdown:"dropdown",fluid:"fluid",loading:"loading",popup:"ui popup",position:"top left center bottom right",visible:"visible",popupVisible:"visible"},selector:{popup:".ui.popup"},templates:{escape:function(t){var e={"<":"<",">":">",'"':""","'":"'","`":"`"};return/[&<>"'`]/.test(t)?(t=t.replace(/&(?![a-z0-9#]{1,6};)/,"&")).replace(/[<>"'`]/g,function(t){return e[t]}):t},popup:function(t){var e="",o=N.fn.popup.settings.templates.escape;return typeof t!==z&&(typeof t.title!==z&&t.title&&(t.title=o(t.title),e+='<div class="header">'+t.title+"</div>"),typeof t.content!==z&&t.content&&(t.content=o(t.content),e+='<div class="content">'+t.content+"</div>")),e}}}}(jQuery,window,document);
|
package/dist/components/rail.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.0-beta.
|
2
|
+
* # Fomantic-UI 2.9.0-beta.310+19b7d18 - Search
|
3
3
|
* http://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -293,8 +293,12 @@ $.fn.search = function(parameters) {
|
|
293
293
|
;
|
294
294
|
// search shortcuts
|
295
295
|
if(keyCode == keys.escape) {
|
296
|
-
module.
|
297
|
-
|
296
|
+
if(!module.is.visible()) {
|
297
|
+
module.verbose('Escape key pressed, blurring search field');
|
298
|
+
$prompt.blur();
|
299
|
+
} else {
|
300
|
+
module.hideResults();
|
301
|
+
}
|
298
302
|
event.stopPropagation();
|
299
303
|
resultsDismissed = true;
|
300
304
|
}
|
@@ -531,8 +535,8 @@ $.fn.search = function(parameters) {
|
|
531
535
|
},
|
532
536
|
type: function(type) {
|
533
537
|
type = type || settings.type;
|
534
|
-
if(
|
535
|
-
$module.addClass(
|
538
|
+
if(className[type]) {
|
539
|
+
$module.addClass(className[type]);
|
536
540
|
}
|
537
541
|
},
|
538
542
|
buttonPressed: function() {
|
@@ -994,6 +998,7 @@ $.fn.search = function(parameters) {
|
|
994
998
|
animation : settings.transition + ' in',
|
995
999
|
debug : settings.debug,
|
996
1000
|
verbose : settings.verbose,
|
1001
|
+
silent : settings.silent,
|
997
1002
|
duration : settings.duration,
|
998
1003
|
onShow : function() {
|
999
1004
|
var $firstResult = $module.find(selector.result).eq(0);
|
@@ -1029,6 +1034,7 @@ $.fn.search = function(parameters) {
|
|
1029
1034
|
animation : settings.transition + ' out',
|
1030
1035
|
debug : settings.debug,
|
1031
1036
|
verbose : settings.verbose,
|
1037
|
+
silent : settings.silent,
|
1032
1038
|
duration : settings.duration,
|
1033
1039
|
onComplete : function() {
|
1034
1040
|
callback();
|
@@ -1351,6 +1357,7 @@ $.fn.search.settings = {
|
|
1351
1357
|
className: {
|
1352
1358
|
animating : 'animating',
|
1353
1359
|
active : 'active',
|
1360
|
+
category : 'category',
|
1354
1361
|
empty : 'empty',
|
1355
1362
|
focus : 'focus',
|
1356
1363
|
hidden : 'hidden',
|