fomantic-ui 2.9.2-beta.1 → 2.9.2-beta.10
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/.github/workflows/ci.yml +1 -1
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +4 -4
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +2 -2
- 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 +7 -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 +2 -2
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +40 -40
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.min.css +2 -2
- package/dist/components/checkbox.min.js +1 -1
- package/dist/components/comment.css +2 -2
- 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 +3 -3
- 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 +8 -6
- package/dist/components/dropdown.js +3 -3
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +2 -2
- package/dist/components/embed.js +2 -2
- package/dist/components/embed.min.css +2 -2
- package/dist/components/embed.min.js +2 -2
- package/dist/components/emoji.css +6 -0
- package/dist/components/feed.css +2 -2
- 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/flyout.css +7 -1
- package/dist/components/flyout.js +18 -30
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +66 -37
- package/dist/components/form.js +102 -94
- package/dist/components/form.min.css +2 -2
- package/dist/components/form.min.js +2 -2
- 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 +59 -25
- package/dist/components/input.min.css +2 -2
- package/dist/components/item.css +3 -3
- package/dist/components/item.min.css +2 -2
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +2 -2
- 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/menu.css +31 -7
- package/dist/components/menu.min.css +9 -1
- package/dist/components/message.css +2 -2
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +15 -8
- 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 +7 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +148 -3
- package/dist/components/popup.js +20 -8
- package/dist/components/popup.min.css +2 -2
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +3 -29
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +2 -2
- 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 +2 -2
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +3 -3
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +15 -37
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +7 -27
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +1 -10
- package/dist/components/site.js +1 -1
- package/dist/components/site.min.css +2 -2
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.css +6 -0
- 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 +2 -2
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +4 -4
- package/dist/components/step.min.css +2 -2
- 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 +2 -2
- package/dist/components/table.min.css +2 -2
- package/dist/components/text.css +7 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +7 -1
- package/dist/components/toast.js +3 -3
- 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 +10 -61
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +1 -1
- package/dist/components/visibility.min.js +1 -1
- package/dist/semantic.css +512 -196
- package/dist/semantic.js +220 -324
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/src/_site/collections/breadcrumb.variables +1 -1
- package/src/_site/collections/message.overrides +1 -1
- package/src/_site/elements/emoji.overrides +3 -0
- package/src/_site/{modules/chatroom.variables → elements/emoji.variables} +0 -0
- package/src/_site/elements/flag.variables +3 -3
- package/src/_site/elements/list.overrides +1 -1
- package/src/_site/elements/placeholder.overrides +3 -0
- package/src/_site/elements/placeholder.variables +3 -0
- package/src/_site/elements/text.overrides +3 -0
- package/src/_site/elements/text.variables +3 -0
- package/src/_site/modules/{chatroom.overrides → calendar.overrides} +0 -0
- package/src/_site/modules/calendar.variables +3 -0
- package/src/_site/modules/flyout.overrides +3 -0
- package/src/_site/modules/flyout.variables +3 -0
- package/src/_site/modules/modal.variables +1 -1
- package/src/_site/modules/rating.variables +1 -1
- package/src/_site/modules/search.variables +1 -1
- package/src/_site/modules/sidebar.variables +1 -1
- package/src/_site/modules/slider.overrides +3 -0
- package/src/_site/modules/slider.variables +3 -0
- package/src/_site/modules/sticky.variables +1 -1
- package/src/_site/modules/toast.overrides +3 -0
- package/src/_site/modules/toast.variables +3 -0
- package/src/_site/views/ad.overrides +1 -1
- package/src/_site/views/card.overrides +1 -1
- package/src/_site/views/comment.overrides +1 -1
- package/src/_site/views/feed.overrides +1 -1
- package/src/_site/views/item.overrides +1 -1
- package/src/_site/views/statistic.overrides +1 -1
- package/src/definitions/behaviors/form.js +101 -93
- package/src/definitions/collections/form.less +4 -14
- package/src/definitions/collections/menu.less +39 -6
- package/src/definitions/elements/input.less +6 -20
- package/src/definitions/globals/site.less +0 -18
- package/src/definitions/modules/accordion.js +3 -3
- package/src/definitions/modules/checkbox.less +39 -39
- package/src/definitions/modules/dimmer.js +2 -2
- package/src/definitions/modules/dropdown.js +2 -2
- package/src/definitions/modules/dropdown.less +6 -10
- package/src/definitions/modules/embed.js +1 -1
- package/src/definitions/modules/embed.less +1 -1
- package/src/definitions/modules/flyout.js +17 -29
- package/src/definitions/modules/modal.js +14 -7
- package/src/definitions/modules/popup.js +19 -7
- package/src/definitions/modules/popup.less +48 -4
- package/src/definitions/modules/progress.js +2 -28
- package/src/definitions/modules/search.js +1 -1
- package/src/definitions/modules/shape.js +14 -36
- package/src/definitions/modules/sidebar.js +6 -26
- package/src/definitions/modules/toast.js +2 -2
- package/src/definitions/modules/transition.js +9 -60
- package/src/theme.less +4 -12
- package/src/themes/default/collections/menu.variables +1 -3
- package/src/themes/default/collections/table.variables +1 -3
- package/src/themes/default/elements/segment.variables +1 -3
- package/src/themes/default/elements/step.variables +1 -1
- package/src/themes/default/globals/site.variables +1 -0
- package/src/themes/default/globals/variation.variables +2 -0
- package/src/themes/default/modules/popup.variables +8 -0
- package/src/themes/default/views/item.variables +1 -1
- package/tasks/config/project/install.js +1 -1
- package/tasks/install.js +8 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.2-beta.
|
2
|
+
* # Fomantic UI - 2.9.2-beta.10+cf51e1c
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(V,W,M){"use strict";function z(t){return"function"==typeof t&&"number"!=typeof t.nodeType}W=void 0!==W&&W.Math===Math?W:globalThis,V.fn.popup=function(T){var E,t=V(this),k=V(M),S=V(W),O=V("body"),A=t.selector||"",D="ontouchstart"in M.documentElement?"touchstart":"click",j=Date.now(),F=[],R=T,H="string"==typeof R,N=[].slice.call(arguments,1);return t.each(function(){var p,s,t,e,o,u=V.isPlainObject(T)?V.extend(!0,{},V.fn.popup.settings,T):V.extend({},V.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=V(this),l=[W,M].indexOf(u.context)<0?k.find(u.context):V(u.context),g=[W,M].indexOf(u.scrollContext)<0?k.find(u.scrollContext):V(u.scrollContext),v=[W,M].indexOf(u.boundary)<0?k.find(u.boundary):V(u.boundary),m=u.target?[W,M].indexOf(u.target)<0?k.find(u.target):V(u.target):h,b=0,w=!1,y=!1,P=this,C=h.data(a),x={initialize:function(){x.debug("Initializing",h),x.createID(),x.bind.events(),!x.exists()&&u.preserve&&x.create(),u.observeChanges&&x.observeChanges(),x.instantiate()},instantiate:function(){x.verbose("Storing instance",x),C=x,h.data(a,C)},observeChanges:function(){"MutationObserver"in W&&((t=new MutationObserver(x.event.documentChanged)).observe(M,{childList:!0,subtree:!0}),x.debug("Setting up mutation observer",t))},refresh:function(){u.popup?p=k.find(u.popup).eq(0):u.inline&&(p=m.nextAll(n.popup).eq(0),u.popup=p),u.popup?(p.addClass(c.loading),s=x.get.offsetParent(),p.removeClass(c.loading),u.movePopup&&x.has.popup()&&x.get.offsetParent(p)[0]!==s[0]&&(x.debug("Moving popup to the same offset parent as target"),p.detach().appendTo(s))):s=u.inline?x.get.offsetParent(m):x.has.popup()?x.get.offsetParent(p):O,s.is("html")&&s[0]!==O[0]&&(x.debug("Setting page as offset parent"),s=O),x.get.variation()&&x.set.variation()},reposition:function(){x.refresh(),x.set.position()},destroy:function(){x.debug("Destroying previous module"),t&&t.disconnect(),p&&!u.preserve&&x.removePopup(),clearTimeout(x.hideTimer),clearTimeout(x.showTimer),x.unbind.close(),x.unbind.events(),h.removeData(a)},event:{start:function(t){var e=V.isPlainObject(u.delay)?u.delay.show:u.delay;clearTimeout(x.hideTimer),y&&!u.addTouchEvents||(x.showTimer=setTimeout(x.show,e))},end:function(){var t=V.isPlainObject(u.delay)?u.delay.hide:u.delay;clearTimeout(x.showTimer),x.hideTimer=setTimeout(x.hide,t)},touchstart:function(t){y=!0,u.addTouchEvents&&x.show()},resize:function(){x.is.visible()&&x.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t===P||0<V(t).find(P).length)&&(x.debug("Element removed from DOM, tearing down events"),x.destroy())})})},hideGracefully:function(t){var e=V(t.target),o=V.contains(M.documentElement,t.target),e=0<e.closest(n.popup).length;t&&!e&&o?(x.debug("Click occurred outside popup hiding popup"),x.hide()):x.debug("Click was inside popup, keeping popup open")}},create:function(){var t=x.get.html(),e=x.get.title(),o=x.get.content();t||o||e?(x.debug("Creating pop-up html"),t=t||u.templates.popup({title:e,content:o}),p=V("<div/>").addClass(c.popup).data(f.activator,h).html(t),u.inline?(x.verbose("Inserting popup element inline",p),p.insertAfter(h)):(x.verbose("Appending popup element to body",p),p.appendTo(l)),x.refresh(),x.set.variation(),u.hoverable&&x.bind.popup(),u.onCreate.call(p,P)):u.popup?(k.find(u.popup).data(f.activator,h),x.verbose("Used popup specified in settings"),x.refresh(),u.hoverable&&x.bind.popup()):0<m.next(n.popup).length?(x.verbose("Pre-existing popup found"),u.inline=!0,u.popup=m.next(n.popup).data(f.activator,h),x.refresh(),u.hoverable&&x.bind.popup()):x.debug("No content specified skipping display",P)},createID:function(){o=(Math.random().toString(16)+"000000000").slice(2,10),e="."+o,x.verbose("Creating unique id for element",o)},toggle:function(){x.debug("Toggling pop-up"),x.is.hidden()?(x.debug("Popup is hidden, showing pop-up"),x.unbind.close(),x.show()):(x.debug("Popup is visible, hiding pop-up"),x.hide())},show:function(t){t=t||function(){},x.debug("Showing pop-up",u.transition),!x.is.hidden()||x.is.active()&&x.is.dropdown()||(x.exists()||x.create(),!1===u.onShow.call(p,P)?x.debug("onShow callback returned false, cancelling popup animation"):(u.preserve||u.popup||x.refresh(),p&&x.set.position()&&(x.save.conditions(),u.exclusive&&x.hideAll(),x.animate.show(t))))},hide:function(t){t=t||function(){},(x.is.visible()||x.is.animating())&&(!1===u.onHide.call(p,P)?x.debug("onHide callback returned false, cancelling popup animation"):(x.remove.visible(),x.unbind.close(),x.restore.conditions(),x.animate.hide(t)))},hideAll:function(){k.find(n.popup).filter("."+c.popupVisible).each(function(){V(this).data(f.activator).popup("hide")})},exists:function(){return!!p&&(u.inline||u.popup?x.has.popup():0<p.closest(l).length)},removePopup:function(){x.has.popup()&&!u.popup&&(x.debug("Removing popup",p),p.remove(),p=void 0,u.onRemove.call(p,P))},save:{conditions:function(){x.cache={title:h.attr("title")},x.cache.title&&h.removeAttr("title"),x.verbose("Saving original attributes",x.cache.title)}},restore:{conditions:function(){return x.cache&&x.cache.title&&(h.attr("title",x.cache.title),x.verbose("Restoring original attributes",x.cache.title)),!0}},supports:{svg:function(){return"undefined"!=typeof SVGGraphicsElement}},animate:{show:function(t){t=z(t)?t:function(){},u.transition&&x.can.useElement("transition")&&h.transition("is supported")&&(x.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(){x.bind.close(),t.call(p,P),u.onVisible.call(p,P)}}))},hide:function(t){t=z(t)?t:function(){},x.debug("Hiding pop-up"),u.transition&&void 0!==V.fn.transition&&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(){x.reset(),t.call(p,P),u.onHidden.call(p,P)}}):x.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=x.get.offsetParent(p),e=m[0],o=v[0]===W,n=m.offset(),i=u.inline||u.popup&&u.movePopup?m.offsetParent().offset():{top:0,left:0},r=o?{top:0,left:0}:v.offset(),a={},o=o?{top:S.scrollTop(),left:S.scrollLeft()}:{top:0,left:0},a={target:{element:m[0],width:m.outerWidth(),height:m.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:v.width(),height:v.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&&x.is.fluid()&&(a.container={width:p.parent().outerWidth()},a.popup.width=a.container.width),a.target.margin.top=u.inline?parseInt(W.getComputedStyle(e).getPropertyValue("margin-top"),10):0,a.target.margin.left=u.inline?x.is.rtl()?parseInt(W.getComputedStyle(e).getPropertyValue("margin-right"),10):parseInt(W.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||x.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)},x.verbose("Distance from boundaries determined",t,o)),o},offsetParent:function(t){var e=(void 0!==t?t:m)[0].parentNode,o=V(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=V(e)).css("transform"),i="static"===o.css("position"),r=o.is("body");return o&&0<o.length?o:V()},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||(x.verbose("All available positions available"),w=x.get.positions()),x.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],x.debug("Trying opposite strategy",a)),"adjacent"===u.prefer&&n&&(a=(a=[o,{left:"center",center:"right",right:"left"}[e]]).join(" "),r=!0===w[a],x.debug("Trying adjacent strategy",a)),(r||i)&&(x.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!==m.length&&0!==p.length){var o,n,i,r,a,s,l;if(e=e||x.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,x.should.centerArrow(e)&&(x.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&&!x.is.svg(i.element))return x.debug("Popup target is hidden, no action taken"),!1;switch(u.inline&&(x.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)),x.debug("Determining popup position from calculations",t,e),x.is.rtl()&&(t=t.replace(/left|right/g,function(t){return"left"===t?"right":"left"}),x.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(void 0===s&&x.error(d.invalidPosition,t),x.debug("Calculated popup positioning values",s),p.css(s).removeClass(c.position).addClass(t).addClass(c.loading),l=x.get.popupOffset(),l=x.get.distanceFromBoundary(l,e),!u.forcePosition&&x.is.offstage(l,t)){if(x.debug("Position is outside viewport",t),b<u.maxSearchDepth)return b++,t=x.get.nextPosition(t),x.debug("Trying new position",t),!!p&&x.set.position(t,e);if(!u.lastResort)return x.debug("Popup could not find a position to display",p),x.error(d.cannotPlace,P),x.remove.attempts(),x.remove.loading(),x.reset(),u.onUnplaceable.call(p,P),!1;x.debug("No position found, showing with last position")}return x.debug("Position is on stage",t),x.remove.attempts(),x.remove.loading(),u.setFluidWidth&&x.is.fluid()&&x.set.fluidWidth(e),!0}x.error(d.notFound)},fluidWidth:function(t){t=t||x.get.calculations(),x.debug("Automatically setting element width to parent width",t.parent.width),p.css("width",t.container.width)},variation:function(t){(t=t||x.get.variation())&&x.has.popup()&&(x.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||x.get.variation())&&(x.verbose("Removing variation",t),p.removeClass(t))},visible:function(){h.removeClass(c.visible)},attempts:function(){x.verbose("Resetting all searched positions"),b=0,w=!1}},bind:{events:function(){x.debug("Binding popup events to module"),"click"===u.on&&h.on(D+r,x.toggle),"hover"===u.on&&h.on("touchstart"+r,x.event.touchstart),x.get.startEvent()&&h.on(x.get.startEvent()+r,x.event.start).on(x.get.endEvent()+r,x.event.end),u.target&&x.debug("Target set to element",m),S.on("resize"+e,x.event.resize)},popup:function(){x.verbose("Allowing hover events on popup to prevent closing"),p&&x.has.popup()&&p.on("mouseenter"+r,x.event.start).on("mouseleave"+r,x.event.end)},close:function(){(!0===u.hideOnScroll||"auto"===u.hideOnScroll&&"click"!==u.on)&&x.bind.closeOnScroll(),x.is.closable()?x.bind.clickaway():"hover"===u.on&&y&&x.bind.touchClose()},closeOnScroll:function(){x.verbose("Binding scroll close event to document"),g.one(x.get.scrollEvent()+e,x.event.hideGracefully)},touchClose:function(){x.verbose("Binding popup touchclose event to document"),k.on("touchstart"+e,function(t){x.verbose("Touched away from popup"),x.event.hideGracefully.call(P,t)})},clickaway:function(){x.verbose("Binding popup close event to document"),k.on(D+e,function(t){x.verbose("Clicked away from popup"),x.event.hideGracefully.call(P,t)})}},unbind:{events:function(){S.off(e),h.off(r)},close:function(){k.off(e),g.off(e)}},can:{useElement:function(t){return void 0!==V.fn[t]||(x.error(d.noElement.replace("{element}",t)),!1)}},has:{popup:function(){return p&&0<p.length}},should:{centerArrow:function(t){return!x.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 V.each(t,function(t,e){e<-u.jitter&&(x.debug("Position exceeds allowable distance from edge",t,e,o),n.push(t))}),0<n.length},svg:function(t){return x.supports.svg()&&t instanceof SVGGraphicsElement},basic:function(){return h.hasClass(c.basic)},active:function(){return h.hasClass(c.active)},animating:function(){return void 0!==p&&p.hasClass(c.animating)},fluid:function(){return void 0!==p&&p.hasClass(c.fluid)},visible:function(){return void 0!==p&&p.hasClass(c.popupVisible)},dropdown:function(){return h.hasClass(c.dropdown)},hidden:function(){return!x.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(){x.remove.visible(),u.preserve?void 0!==V.fn.transition&&p.transition("remove transition"):x.removePopup()},setting:function(t,e){if(V.isPlainObject(t))V.extend(!0,u,t);else{if(void 0===e)return u[t];u[t]=e}},internal:function(t,e){if(V.isPlainObject(t))V.extend(!0,x,t);else{if(void 0===e)return x[t];x[t]=e}},debug:function(){!u.silent&&u.debug&&(u.performance?x.performance.log(arguments):(x.debug=Function.prototype.bind.call(console.info,console,u.name+":"),x.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?x.performance.log(arguments):(x.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),x.verbose.apply(console,arguments)))},error:function(){u.silent||(x.error=Function.prototype.bind.call(console.error,console,u.name+":"),x.error.apply(console,arguments))},performance:{log:function(t){var e,o;u.performance&&(o=(e=Date.now())-(j||e),j=e,F.push({Name:t[0],Arguments:[].slice.call(t,1)||"",Element:P,"Execution Time":o})),clearTimeout(x.performance.timer),x.performance.timer=setTimeout(x.performance.display,500)},display:function(){var t=u.name+":",o=0;j=!1,clearTimeout(x.performance.timer),V.each(F,function(t,e){o+=e["Execution Time"]}),t+=" "+o+"ms",A&&(t+=" '"+A+"'"),0<F.length&&(console.groupCollapsed(t),console.table?console.table(F):V.each(F,function(t,e){console.log(e.Name+": "+e["Execution Time"]+"ms")}),console.groupEnd()),F=[]}},invoke:function(n,t,e){var i,r,o,a=C;return t=t||N,e=e||P,"string"==typeof n&&void 0!==a&&(n=n.split(/[ .]/),i=n.length-1,V.each(n,function(t,e){var o=t!==i?e+n[t+1].charAt(0).toUpperCase()+n[t+1].slice(1):n;if(V.isPlainObject(a[o])&&t!==i)a=a[o];else{if(void 0!==a[o])return r=a[o],!1;{if(!V.isPlainObject(a[e])||t===i)return void 0!==a[e]?r=a[e]:x.error(d.method,n),!1;a=a[e]}}})),z(r)?o=r.apply(e,t):void 0!==r&&(o=r),Array.isArray(E)?E.push(o):void 0!==E?E=[E,o]:void 0!==o&&(E=o),r}};H?(void 0===C&&x.initialize(),x.invoke(R)):(void 0!==C&&C.invoke("destroy"),x.initialize())}),void 0!==E?E:this},V.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:W,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:W,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.",noElement:"This module requires ui {element}",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(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(t){return e[t]}):t},popup:function(t){var e="",o=V.fn.popup.settings.templates.escape;return void 0!==t&&(t.title&&(t.title=o(t.title),e+='<div class="header">'+t.title+"</div>"),t.content&&(t.content=o(t.content),e+='<div class="content">'+t.content+"</div>")),e}}}}(jQuery,window,document);
|
11
|
+
!function(V,W,M){"use strict";function z(t){return"function"==typeof t&&"number"!=typeof t.nodeType}W=void 0!==W&&W.Math===Math?W:globalThis,V.fn.popup=function(T){var E,t=V(this),k=V(M),S=V(W),O=V("body"),A=t.selector||"",D="ontouchstart"in M.documentElement?"touchstart":"click",j=Date.now(),F=[],R=T,H="string"==typeof R,N=[].slice.call(arguments,1);return t.each(function(){var p,s,t,e,o,u=V.isPlainObject(T)?V.extend(!0,{},V.fn.popup.settings,T):V.extend({},V.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=V(this),l=[W,M].indexOf(u.context)<0?k.find(u.context):V(u.context),g=[W,M].indexOf(u.scrollContext)<0?k.find(u.scrollContext):V(u.scrollContext),v=[W,M].indexOf(u.boundary)<0?k.find(u.boundary):V(u.boundary),m=u.target?[W,M].indexOf(u.target)<0?k.find(u.target):V(u.target):h,b=0,w=!1,y=!1,P=this,C=h.data(a),x={initialize:function(){x.debug("Initializing",h),x.createID(),x.bind.events(),!x.exists()&&u.preserve&&x.create(),u.observeChanges&&x.observeChanges(),x.instantiate()},instantiate:function(){x.verbose("Storing instance",x),C=x,h.data(a,C)},observeChanges:function(){"MutationObserver"in W&&((t=new MutationObserver(x.event.documentChanged)).observe(M,{childList:!0,subtree:!0}),x.debug("Setting up mutation observer",t))},refresh:function(){u.popup?p=k.find(u.popup).eq(0):u.inline&&(p=m.nextAll(n.popup).eq(0),u.popup=p),u.popup?(x.set.invisible(),s=x.get.offsetParent(),x.remove.invisible(),u.movePopup&&x.has.popup()&&x.get.offsetParent(p)[0]!==s[0]&&(x.debug("Moving popup to the same offset parent as target"),p.detach().appendTo(s))):s=u.inline?x.get.offsetParent(m):x.has.popup()?x.get.offsetParent(p):O,s.is("html")&&s[0]!==O[0]&&(x.debug("Setting page as offset parent"),s=O),x.get.variation()&&x.set.variation()},reposition:function(){x.refresh(),x.set.position()},destroy:function(){x.debug("Destroying previous module"),t&&t.disconnect(),p&&!u.preserve&&x.removePopup(),clearTimeout(x.hideTimer),clearTimeout(x.showTimer),x.unbind.close(),x.unbind.events(),h.removeData(a)},event:{start:function(t){var e=V.isPlainObject(u.delay)?u.delay.show:u.delay;clearTimeout(x.hideTimer),y&&!u.addTouchEvents||(x.showTimer=setTimeout(x.show,e))},end:function(){var t=V.isPlainObject(u.delay)?u.delay.hide:u.delay;clearTimeout(x.showTimer),x.hideTimer=setTimeout(x.hide,t)},touchstart:function(t){y=!0,u.addTouchEvents&&x.show()},resize:function(){x.is.visible()&&x.set.position()},documentChanged:function(t){[].forEach.call(t,function(t){t.removedNodes&&[].forEach.call(t.removedNodes,function(t){(t===P||0<V(t).find(P).length)&&(x.debug("Element removed from DOM, tearing down events"),x.destroy())})})},hideGracefully:function(t){var e=V(t.target),o=V.contains(M.documentElement,t.target),e=0<e.closest(n.popup).length;t&&!e&&o?(x.debug("Click occurred outside popup hiding popup"),x.hide()):x.debug("Click was inside popup, keeping popup open")}},create:function(){var t=x.get.html(),e=x.get.title(),o=x.get.content();t||o||e?(x.debug("Creating pop-up html"),t=t||u.templates.popup({title:e,content:o}),p=V("<div/>").addClass(c.popup).data(f.activator,h).html(t),u.inline?(x.verbose("Inserting popup element inline",p),p.insertAfter(h)):(x.verbose("Appending popup element to body",p),p.appendTo(l)),x.refresh(),x.set.variation(),u.hoverable&&x.bind.popup(),u.onCreate.call(p,P)):u.popup?(k.find(u.popup).data(f.activator,h),x.verbose("Used popup specified in settings"),x.refresh(),u.hoverable&&x.bind.popup()):0<m.next(n.popup).length?(x.verbose("Pre-existing popup found"),u.inline=!0,u.popup=m.next(n.popup).data(f.activator,h),x.refresh(),u.hoverable&&x.bind.popup()):x.debug("No content specified skipping display",P)},createID:function(){o=(Math.random().toString(16)+"000000000").slice(2,10),e="."+o,x.verbose("Creating unique id for element",o)},toggle:function(){x.debug("Toggling pop-up"),x.is.hidden()?(x.debug("Popup is hidden, showing pop-up"),x.unbind.close(),x.show()):(x.debug("Popup is visible, hiding pop-up"),x.hide())},show:function(t){t=t||function(){},x.debug("Showing pop-up",u.transition),!x.is.hidden()||x.is.active()&&x.is.dropdown()||(x.exists()||x.create(),!1===u.onShow.call(p,P)?x.debug("onShow callback returned false, cancelling popup animation"):(u.preserve||u.popup||x.refresh(),p&&x.set.position()&&(x.save.conditions(),u.exclusive&&x.hideAll(),x.animate.show(t))))},hide:function(t){t=t||function(){},(x.is.visible()||x.is.animating())&&(!1===u.onHide.call(p,P)?x.debug("onHide callback returned false, cancelling popup animation"):(x.remove.visible(),x.unbind.close(),x.restore.conditions(),x.animate.hide(t)))},hideAll:function(){k.find(n.popup).filter("."+c.popupVisible).each(function(){V(this).data(f.activator).popup("hide")})},exists:function(){return!!p&&(u.inline||u.popup?x.has.popup():0<p.closest(l).length)},removePopup:function(){x.has.popup()&&!u.popup&&(x.debug("Removing popup",p),p.remove(),p=void 0,u.onRemove.call(p,P))},save:{conditions:function(){x.cache={title:h.attr("title")},x.cache.title&&h.removeAttr("title"),x.verbose("Saving original attributes",x.cache.title)}},restore:{conditions:function(){return x.cache&&x.cache.title&&(h.attr("title",x.cache.title),x.verbose("Restoring original attributes",x.cache.title)),!0}},supports:{svg:function(){return"undefined"!=typeof SVGGraphicsElement}},animate:{show:function(t){t=z(t)?t:function(){},u.transition&&x.can.useElement("transition")&&(x.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(){x.bind.close(),t.call(p,P),u.onVisible.call(p,P)}}))},hide:function(t){t=z(t)?t:function(){},x.debug("Hiding pop-up"),u.transition&&void 0!==V.fn.transition?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(){x.reset(),t.call(p,P),u.onHidden.call(p,P)}}):x.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=x.get.offsetParent(p),e=m[0],o=v[0]===W,n=m.offset(),i=u.inline||u.popup&&u.movePopup?m.offsetParent().offset():{top:0,left:0},r=o?{top:0,left:0}:v.offset(),a={},o=o?{top:S.scrollTop(),left:S.scrollLeft()}:{top:0,left:0},a={target:{element:m[0],width:m.outerWidth(),height:m.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:v.width(),height:v.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&&x.is.fluid()&&(a.container={width:p.parent().outerWidth()},a.popup.width=a.container.width),a.target.margin.top=u.inline?parseInt(W.getComputedStyle(e).getPropertyValue("margin-top"),10):0,a.target.margin.left=u.inline?x.is.rtl()?parseInt(W.getComputedStyle(e).getPropertyValue("margin-right"),10):parseInt(W.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||x.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)},x.verbose("Distance from boundaries determined",t,o)),o},offsetParent:function(t){var e=(void 0!==t?t:m)[0].parentNode,o=V(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=V(e)).css("transform"),i="static"===o.css("position"),r=o.is("body");return o&&0<o.length?o:V()},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||(x.verbose("All available positions available"),w=x.get.positions()),x.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],x.debug("Trying opposite strategy",a)),"adjacent"===u.prefer&&n&&(a=(a=[o,{left:"center",center:"right",right:"left"}[e]]).join(" "),r=!0===w[a],x.debug("Trying adjacent strategy",a)),(r||i)&&(x.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!==m.length&&0!==p.length){var o,n,i,r,a,s,l;if(e=e||x.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,x.should.centerArrow(e)&&(x.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&&!x.is.svg(i.element))return x.debug("Popup target is hidden, no action taken"),!1;switch(u.inline&&(x.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)),x.debug("Determining popup position from calculations",t,e),x.is.rtl()&&(t=t.replace(/left|right/g,function(t){return"left"===t?"right":"left"}),x.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(void 0===s&&x.error(d.invalidPosition,t),x.debug("Calculated popup positioning values",s),p.css(s).removeClass(c.position).addClass(t),x.set.invisible(),l=x.get.popupOffset(),l=x.get.distanceFromBoundary(l,e),!u.forcePosition&&x.is.offstage(l,t)){if(x.debug("Position is outside viewport",t),b<u.maxSearchDepth)return b++,t=x.get.nextPosition(t),x.debug("Trying new position",t),!!p&&x.set.position(t,e);if(!u.lastResort)return x.debug("Popup could not find a position to display",p),x.error(d.cannotPlace,P),x.remove.attempts(),x.remove.invisible(),x.reset(),u.onUnplaceable.call(p,P),!1;x.debug("No position found, showing with last position")}return x.debug("Position is on stage",t),x.remove.attempts(),x.remove.invisible(),u.setFluidWidth&&x.is.fluid()&&x.set.fluidWidth(e),!0}x.error(d.notFound)},fluidWidth:function(t){t=t||x.get.calculations(),x.debug("Automatically setting element width to parent width",t.parent.width),p.css("width",t.container.width)},loading:function(){p.addClass(c.loading)},invisible:function(){p.addClass(c.invisible)},variation:function(t){(t=t||x.get.variation())&&x.has.popup()&&(x.verbose("Adding variation to popup",t),p.addClass(t))},visible:function(){h.addClass(c.visible)}},remove:{loading:function(){p.removeClass(c.loading)},invisible:function(){p.removeClass(c.invisible)},variation:function(t){(t=t||x.get.variation())&&(x.verbose("Removing variation",t),p.removeClass(t))},visible:function(){h.removeClass(c.visible)},attempts:function(){x.verbose("Resetting all searched positions"),b=0,w=!1}},bind:{events:function(){x.debug("Binding popup events to module"),"click"===u.on&&h.on(D+r,x.toggle),"hover"===u.on&&h.on("touchstart"+r,x.event.touchstart),x.get.startEvent()&&h.on(x.get.startEvent()+r,x.event.start).on(x.get.endEvent()+r,x.event.end),u.target&&x.debug("Target set to element",m),S.on("resize"+e,x.event.resize)},popup:function(){x.verbose("Allowing hover events on popup to prevent closing"),p&&x.has.popup()&&p.on("mouseenter"+r,x.event.start).on("mouseleave"+r,x.event.end)},close:function(){(!0===u.hideOnScroll||"auto"===u.hideOnScroll&&"click"!==u.on)&&x.bind.closeOnScroll(),x.is.closable()?x.bind.clickaway():"hover"===u.on&&y&&x.bind.touchClose()},closeOnScroll:function(){x.verbose("Binding scroll close event to document"),g.one(x.get.scrollEvent()+e,x.event.hideGracefully)},touchClose:function(){x.verbose("Binding popup touchclose event to document"),k.on("touchstart"+e,function(t){x.verbose("Touched away from popup"),x.event.hideGracefully.call(P,t)})},clickaway:function(){x.verbose("Binding popup close event to document"),k.on(D+e,function(t){x.verbose("Clicked away from popup"),x.event.hideGracefully.call(P,t)})}},unbind:{events:function(){S.off(e),h.off(r)},close:function(){k.off(e),g.off(e)}},can:{useElement:function(t){return void 0!==V.fn[t]||(x.error(d.noElement.replace("{element}",t)),!1)}},has:{popup:function(){return p&&0<p.length}},should:{centerArrow:function(t){return!x.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 V.each(t,function(t,e){e<-u.jitter&&(x.debug("Position exceeds allowable distance from edge",t,e,o),n.push(t))}),0<n.length},svg:function(t){return x.supports.svg()&&t instanceof SVGGraphicsElement},basic:function(){return h.hasClass(c.basic)},active:function(){return h.hasClass(c.active)},animating:function(){return void 0!==p&&p.hasClass(c.animating)},fluid:function(){return void 0!==p&&p.hasClass(c.fluid)},visible:function(){return void 0!==p&&p.hasClass(c.popupVisible)},dropdown:function(){return h.hasClass(c.dropdown)},hidden:function(){return!x.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(){x.remove.visible(),u.preserve?void 0!==V.fn.transition&&p.transition("remove transition"):x.removePopup()},setting:function(t,e){if(V.isPlainObject(t))V.extend(!0,u,t);else{if(void 0===e)return u[t];u[t]=e}},internal:function(t,e){if(V.isPlainObject(t))V.extend(!0,x,t);else{if(void 0===e)return x[t];x[t]=e}},debug:function(){!u.silent&&u.debug&&(u.performance?x.performance.log(arguments):(x.debug=Function.prototype.bind.call(console.info,console,u.name+":"),x.debug.apply(console,arguments)))},verbose:function(){!u.silent&&u.verbose&&u.debug&&(u.performance?x.performance.log(arguments):(x.verbose=Function.prototype.bind.call(console.info,console,u.name+":"),x.verbose.apply(console,arguments)))},error:function(){u.silent||(x.error=Function.prototype.bind.call(console.error,console,u.name+":"),x.error.apply(console,arguments))},performance:{log:function(t){var e,o;u.performance&&(o=(e=Date.now())-(j||e),j=e,F.push({Name:t[0],Arguments:[].slice.call(t,1)||"",Element:P,"Execution Time":o})),clearTimeout(x.performance.timer),x.performance.timer=setTimeout(x.performance.display,500)},display:function(){var t=u.name+":",o=0;j=!1,clearTimeout(x.performance.timer),V.each(F,function(t,e){o+=e["Execution Time"]}),t+=" "+o+"ms",A&&(t+=" '"+A+"'"),0<F.length&&(console.groupCollapsed(t),console.table?console.table(F):V.each(F,function(t,e){console.log(e.Name+": "+e["Execution Time"]+"ms")}),console.groupEnd()),F=[]}},invoke:function(n,t,e){var i,r,o,a=C;return t=t||N,e=e||P,"string"==typeof n&&void 0!==a&&(n=n.split(/[ .]/),i=n.length-1,V.each(n,function(t,e){var o=t!==i?e+n[t+1].charAt(0).toUpperCase()+n[t+1].slice(1):n;if(V.isPlainObject(a[o])&&t!==i)a=a[o];else{if(void 0!==a[o])return r=a[o],!1;{if(!V.isPlainObject(a[e])||t===i)return void 0!==a[e]?r=a[e]:x.error(d.method,n),!1;a=a[e]}}})),z(r)?o=r.apply(e,t):void 0!==r&&(o=r),Array.isArray(E)?E.push(o):void 0!==E?E=[E,o]:void 0!==o&&(E=o),r}};H?(void 0===C&&x.initialize(),x.invoke(R)):(void 0!==C&&C.invoke("destroy"),x.initialize())}),void 0!==E?E:this},V.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:W,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:W,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.",noElement:"This module requires ui {element}",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",invisible:"invisible",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(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(t){return e[t]}):t},popup:function(t){var e="",o=V.fn.popup.settings.templates.escape;return void 0!==t&&(t.title&&(t.title=o(t.title),e+='<div class="header">'+t.title+"</div>"),t.content&&(t.content=o(t.content),e+='<div class="content">'+t.content+"</div>")),e}}}}(jQuery,window,document);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.2-beta.
|
2
|
+
* # Fomantic-UI 2.9.2-beta.10+cf51e1c - Progress
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -59,7 +59,6 @@
|
|
59
59
|
instance = $module.data(moduleNamespace),
|
60
60
|
|
61
61
|
animating = false,
|
62
|
-
transitionEnd,
|
63
62
|
module
|
64
63
|
;
|
65
64
|
module = {
|
@@ -115,7 +114,6 @@
|
|
115
114
|
|
116
115
|
initialize: function () {
|
117
116
|
module.set.duration();
|
118
|
-
module.set.transitionEvent();
|
119
117
|
module.debug(element);
|
120
118
|
|
121
119
|
module.read.metadata();
|
@@ -195,17 +193,14 @@
|
|
195
193
|
|
196
194
|
bind: {
|
197
195
|
transitionEnd: function (callback) {
|
198
|
-
var
|
199
|
-
transitionEnd = module.get.transitionEnd()
|
200
|
-
;
|
201
196
|
$bars
|
202
|
-
.one(
|
197
|
+
.one('transitionend' + eventNamespace, function (event) {
|
203
198
|
clearTimeout(module.failSafeTimer);
|
204
199
|
callback.call(this, event);
|
205
200
|
})
|
206
201
|
;
|
207
202
|
module.failSafeTimer = setTimeout(function () {
|
208
|
-
$bars.triggerHandler(
|
203
|
+
$bars.triggerHandler('transitionend');
|
209
204
|
}, settings.duration + settings.failSafeDelay);
|
210
205
|
module.verbose('Adding fail safe timer', module.timer);
|
211
206
|
},
|
@@ -330,24 +325,6 @@
|
|
330
325
|
: value;
|
331
326
|
},
|
332
327
|
|
333
|
-
transitionEnd: function () {
|
334
|
-
var
|
335
|
-
element = document.createElement('element'),
|
336
|
-
transitions = {
|
337
|
-
transition: 'transitionend',
|
338
|
-
OTransition: 'oTransitionEnd',
|
339
|
-
MozTransition: 'transitionend',
|
340
|
-
WebkitTransition: 'webkitTransitionEnd',
|
341
|
-
},
|
342
|
-
transition
|
343
|
-
;
|
344
|
-
for (transition in transitions) {
|
345
|
-
if (element.style[transition] !== undefined) {
|
346
|
-
return transitions[transition];
|
347
|
-
}
|
348
|
-
}
|
349
|
-
},
|
350
|
-
|
351
328
|
// gets current displayed percentage (if animating values this is the intermediary value)
|
352
329
|
displayPercent: function (index) {
|
353
330
|
var
|
@@ -687,9 +664,6 @@
|
|
687
664
|
settings.onError.call(element, module.value, module.total);
|
688
665
|
});
|
689
666
|
},
|
690
|
-
transitionEvent: function () {
|
691
|
-
transitionEnd = module.get.transitionEnd();
|
692
|
-
},
|
693
667
|
total: function (totalValue) {
|
694
668
|
module.total = totalValue;
|
695
669
|
},
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.2-beta.
|
2
|
+
* # Fomantic UI - 2.9.2-beta.10+cf51e1c
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(E,e,P){"use strict";e=void 0!==e&&e.Math===Math?e:globalThis,E.fn.progress=function(m){var b,e=E(this),h=e.selector||"",x=Date.now(),y=[],w=m,V="string"==typeof w,A=[].slice.call(arguments,1);return e.each(function(){var i=E.isPlainObject(m)?E.extend(!0,{},E.fn.progress.settings,m):E.extend({},E.fn.progress.settings),r=i.className,t=i.metadata,e=i.namespace,n=i.selector,l=i.error,a="."+e,o="module-"+e,c=E(this),u=E(this).find(n.bar),s=E(this).find(n.progress),d=E(this).find(n.label),v=this,p=c.data(o),g=!1,f={helper:{sum:function(e){return Array.isArray(e)?e.reduce(function(e,t){return e+Number(t)},0):0},derivePrecision:function(e,t){for(var r=0,n=1,a=e/t;r<10&&!(1<(a*=n));)n=Math.pow(10,r++);return n},forceArray:function(e){return Array.isArray(e)?e:isNaN(e)?"string"==typeof e?e.split(","):[]:[e]}},initialize:function(){f.set.duration(),f.set.transitionEvent(),f.debug(v),f.read.metadata(),f.read.settings(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of progress",f),p=f,c.data(o,f)},destroy:function(){f.verbose("Destroying previous progress for",c),clearInterval(p.interval),f.remove.state(),c.removeData(o),p=void 0},reset:function(){f.remove.nextValue(),f.update.progress(0)},complete:function(e){(void 0===f.percent||f.percent<100)&&(f.remove.progressPoll(),!0!==e&&f.set.percent(100))},read:{metadata:function(){var e={percent:f.helper.forceArray(c.data(t.percent)),total:c.data(t.total),value:f.helper.forceArray(c.data(t.value))};void 0!==e.total&&(f.debug("Total value set from metadata",e.total),f.set.total(e.total)),0<e.value.length&&(f.debug("Current value set from metadata",e.value),f.set.value(e.value),f.set.progress(e.value)),0<e.percent.length&&(f.debug("Current percent value set from metadata",e.percent),f.set.percent(e.percent))},settings:function(){!1!==i.total&&(f.debug("Current total set in settings",i.total),f.set.total(i.total)),!1!==i.value&&(f.debug("Current value set in settings",i.value),f.set.value(i.value),f.set.progress(f.value)),!1!==i.percent&&(f.debug("Current percent set in settings",i.percent),f.set.percent(i.percent))}},bind:{transitionEnd:function(t){var e=f.get.transitionEnd();u.one(e+a,function(e){clearTimeout(f.failSafeTimer),t.call(this,e)}),f.failSafeTimer=setTimeout(function(){u.triggerHandler(e)},i.duration+i.failSafeDelay),f.verbose("Adding fail safe timer",f.timer)}},increment:function(e){var t;e=f.has.total()?(t=f.get.value(),e||1):(t=f.get.percent(),e||f.get.randomValue()),f.debug("Incrementing percentage by",t,t=t+e,e),t=f.get.normalizedValue(t),f.set.progress(t)},decrement:function(e){var t,r;f.get.total()?(r=(t=f.get.value())-(e=e||1),f.debug("Decrementing value by",e,t)):(r=(t=f.get.percent())-(e=e||f.get.randomValue()),f.debug("Decrementing percentage by",e,t)),r=f.get.normalizedValue(r),f.set.progress(r)},has:{progressPoll:function(){return f.progressPoll},total:function(){return!1!==f.get.total()}},get:{text:function(e,t){var r=f.get.value(t=t||0),n=f.get.total(),a=g?f.get.displayPercent(t):f.get.percent(t),o=!1!==n?Math.max(0,n-r):100-a;return e=(e=e||"").replace("{value}",r).replace("{total}",n||0).replace("{left}",o).replace("{percent}",a).replace("{bar}",i.text.bars[t]||""),f.verbose("Adding variables to progress bar text",e),e},normalizedValue:function(e){if(e<0)return f.debug("Value cannot decrement below 0"),0;if(f.has.total()){if(e>f.total)return f.debug("Value cannot increment above total",f.total),f.total}else if(100<e)return f.debug("Value cannot increment above 100 percent"),100;return e},updateInterval:function(){return"auto"===i.updateInterval?i.duration:i.updateInterval},randomValue:function(){return f.debug("Generating random increment percentage"),Math.floor(Math.random()*i.random.max+i.random.min)},numericValue:function(e){return"string"==typeof e?""!==e.replace(/[^\d.]/g,"")&&+e.replace(/[^\d.]/g,""):e},transitionEnd:function(){var e,t=P.createElement("element"),r={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in r)if(void 0!==t.style[e])return r[e]},displayPercent:function(e){var e=E(u[e]),t=e.width(),r=c.width(),e=parseInt(e.css("min-width"),10)<t?t/r*100:f.percent;return 0<i.precision?Math.round(e*(10*i.precision))/(10*i.precision):Math.round(e)},percent:function(e){return f.percent&&f.percent[e||0]||0},value:function(e){return f.nextValue||f.value&&f.value[e||0]||0},total:function(){return void 0!==f.total&&f.total}},create:{progressPoll:function(){f.progressPoll=setTimeout(function(){f.update.toNextValue(),f.remove.progressPoll()},f.get.updateInterval())}},is:{complete:function(){return f.is.success()||f.is.warning()||f.is.error()},success:function(){return c.hasClass(r.success)},warning:function(){return c.hasClass(r.warning)},error:function(){return c.hasClass(r.error)},active:function(){return c.hasClass(r.active)},visible:function(){return c.is(":visible")}},remove:{progressPoll:function(){f.verbose("Removing progress poll timer"),f.progressPoll&&(clearTimeout(f.progressPoll),delete f.progressPoll)},nextValue:function(){f.verbose("Removing progress value stored for next update"),delete f.nextValue},state:function(){f.verbose("Removing stored state"),delete f.total,delete f.percent,delete f.value},active:function(){f.verbose("Removing active state"),c.removeClass(r.active)},success:function(){f.verbose("Removing success state"),c.removeClass(r.success)},warning:function(){f.verbose("Removing warning state"),c.removeClass(r.warning)},error:function(){f.verbose("Removing error state"),c.removeClass(r.error)}},set:{barWidth:function(e){f.debug("set bar width with ",e),e=f.helper.forceArray(e);var a=-1,o=-1,i=f.helper.sum(e),s=u.length,l=1<s,t=e.map(function(e,t){var r=t===s-1&&0===i,n=E(u[t]);return 0===e&&l&&!r?n.css("display","none"):(l&&r&&n.css("background","transparent"),-1===a&&(a=t),o=t,n.css({display:"block",width:e+"%"})),parseFloat(e)});e.forEach(function(e,t){E(u[t]).css({borderTopLeftRadius:t===a?"":"0",borderBottomLeftRadius:t===a?"":"0",borderTopRightRadius:t===o?"":"0",borderBottomRightRadius:t===o?"":"0"})}),c.attr("data-percent",t)},duration:function(e){e=e||i.duration,f.verbose("Setting progress bar transition duration",e="number"==typeof e?e+"ms":e),u.css({"transition-duration":e})},percent:function(e){e=f.helper.forceArray(e).map(function(e){return e="string"==typeof e?+e.replace("%",""):e,i.limitValues?Math.max(0,Math.min(100,e)):e});var t,r=f.has.total(),n=f.helper.sum(e),a=1<e.length&&r,o=f.helper.sum(f.helper.forceArray(f.value));a&&o>f.total?f.error(l.sumExceedsTotal,o,f.total):!a&&100<n?f.error(l.tooHigh,n):n<0?f.error(l.tooLow,n):(t=0<i.precision?i.precision:a?f.helper.derivePrecision(Math.min.apply(null,f.value),f.total):0,o=e.map(function(e){return 0<t?Math.round(e*(10*t))/(10*t):Math.round(e)}),f.percent=o,r&&(f.value=e.map(function(e){return 0<t?Math.round(e/100*f.total*(10*t))/(10*t):Math.round(e/100*f.total*10)/10})),f.set.barWidth(e),f.set.labelInterval()),i.onChange.call(v,e,f.value,f.total)},labelInterval:function(){clearInterval(f.interval),f.bind.transitionEnd(function(){f.verbose("Bar finished animating, removing continuous label updates"),clearInterval(f.interval),g=!1,f.set.labels()}),g=!0,f.interval=setInterval(function(){E.contains(P.documentElement,v)||(clearInterval(f.interval),g=!1),f.set.labels()},i.framerate)},labels:function(){f.verbose("Setting both bar progress and outer label text"),f.set.barLabel(),f.set.state()},label:function(e){e&&(e=f.get.text(e),f.verbose("Setting label to text",e),d.text(e))},state:function(e){100===(e=void 0!==e?e:f.helper.sum(f.percent))?i.autoSuccess&&1===u.length&&!(f.is.warning()||f.is.error()||f.is.success())?(f.set.success(),f.debug("Automatically triggering success at 100%")):(f.verbose("Reached 100% removing active state"),f.remove.active(),f.remove.progressPoll()):0<e?(f.verbose("Adjusting active progress bar label",e),f.set.active()):(f.remove.active(),f.remove.warning(),f.remove.error(),f.remove.success(),f.set.label(i.text.active))},barLabel:function(r){s.each(function(e,t){t=E(t);void 0!==r?t.text(f.get.text(r,e)):"ratio"===i.label&&f.has.total()?(f.verbose("Adding ratio to bar label"),t.text(f.get.text(i.text.ratio,e))):"percent"===i.label&&(f.verbose("Adding percentage to bar label"),t.text(f.get.text(i.text.percent,e)))})},active:function(e){e=e||i.text.active,f.debug("Setting active state"),i.showActivity&&!f.is.active()&&c.addClass(r.active),f.remove.warning(),f.remove.error(),f.remove.success(),(e=i.onLabelUpdate("active",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onActive.call(v,f.value,f.total)})},success:function(e,t){e=e||i.text.success||i.text.active,f.debug("Setting success state"),c.addClass(r.success),f.remove.active(),f.remove.warning(),f.remove.error(),f.complete(t),e=i.text.success?i.onLabelUpdate("success",e,f.value,f.total):i.onLabelUpdate("active",e,f.value,f.total),f.set.label(e),f.bind.transitionEnd(function(){i.onSuccess.call(v,f.total)})},warning:function(e,t){e=e||i.text.warning,f.debug("Setting warning state"),c.addClass(r.warning),f.remove.active(),f.remove.success(),f.remove.error(),f.complete(t),(e=i.onLabelUpdate("warning",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onWarning.call(v,f.value,f.total)})},error:function(e,t){e=e||i.text.error,f.debug("Setting error state"),c.addClass(r.error),f.remove.active(),f.remove.success(),f.remove.warning(),f.complete(t),(e=i.onLabelUpdate("error",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onError.call(v,f.value,f.total)})},transitionEvent:function(){f.get.transitionEnd()},total:function(e){f.total=e},value:function(e){f.value=f.helper.forceArray(e)},progress:function(e){f.has.progressPoll()?(f.debug("Updated within interval, setting next update to use new value",e),f.set.nextValue(e)):(f.debug("First update in progress update interval, immediately updating",e),f.update.progress(e),f.create.progressPoll())},nextValue:function(e){f.nextValue=e}},update:{toNextValue:function(){var e=f.nextValue;e&&(f.debug("Update interval complete using last updated value",e),f.update.progress(e),f.remove.nextValue())},progress:function(e){var r=f.has.total(),e=(r&&f.set.value(e),f.helper.forceArray(e).map(function(e){var t;return!1===(e=f.get.numericValue(e))&&f.error(l.nonNumeric,e),e=f.get.normalizedValue(e),r?(t=0<f.total?e/f.total*100:100,f.debug("Calculating percent complete from total",t)):(t=e,f.debug("Setting value to exact percentage value",t)),t}));f.set.percent(e)}},setting:function(e,t){if(f.debug("Changing setting",e,t),E.isPlainObject(e))E.extend(!0,i,e);else{if(void 0===t)return i[e];E.isPlainObject(i[e])?E.extend(!0,i[e],t):i[e]=t}},internal:function(e,t){if(E.isPlainObject(e))E.extend(!0,f,e);else{if(void 0===t)return f[e];f[e]=t}},debug:function(){!i.silent&&i.debug&&(i.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,i.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!i.silent&&i.verbose&&i.debug&&(i.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,i.name+":"),f.verbose.apply(console,arguments)))},error:function(){i.silent||(f.error=Function.prototype.bind.call(console.error,console,i.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,r;i.performance&&(r=(t=Date.now())-(x||t),x=t,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:v,"Execution Time":r})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var e=i.name+":",r=0;x=!1,clearTimeout(f.performance.timer),E.each(y,function(e,t){r+=t["Execution Time"]}),e+=" "+r+"ms",h&&(e+=" '"+h+"'"),0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):E.each(y,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(n,e,t){var a,o,r,i,s=p;return e=e||A,t=t||v,"string"==typeof n&&void 0!==s&&(n=n.split(/[ .]/),a=n.length-1,E.each(n,function(e,t){var r=e!==a?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(E.isPlainObject(s[r])&&e!==a)s=s[r];else{if(void 0!==s[r])return o=s[r],!1;{if(!E.isPlainObject(s[t])||e===a)return void 0!==s[t]?o=s[t]:f.error(l.method,n),!1;s=s[t]}}})),"function"==typeof(i=o)&&"number"!=typeof i.nodeType?r=o.apply(t,e):void 0!==o&&(r=o),Array.isArray(b)?b.push(r):void 0!==b?b=[b,r]:void 0!==r&&(b=r),o}};V?(void 0===p&&f.initialize(),f.invoke(w)):(void 0!==p&&p.invoke("destroy"),f.initialize())}),void 0!==b?b:this},E.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,failSafeDelay:100,onLabelUpdate:function(e,t,r,n){return t},onChange:function(e,t,r){},onSuccess:function(e){},onActive:function(e,t){},onError:function(e,t){},onWarning:function(e,t){},error:{method:"The method you called is not defined.",nonNumeric:"Progress value is non numeric",tooHigh:"Value specified is above 100%",tooLow:"Value specified is below 0%",sumExceedsTotal:"Sum of multiple values exceed total"},regExp:{variable:/{\$*[\da-z]+}/gi},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}",bars:[""]},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document);
|
11
|
+
!function(P,e,C){"use strict";e=void 0!==e&&e.Math===Math?e:globalThis,P.fn.progress=function(m){var b,e=P(this),h=e.selector||"",x=Date.now(),y=[],w=m,V="string"==typeof w,A=[].slice.call(arguments,1);return e.each(function(){var i=P.isPlainObject(m)?P.extend(!0,{},P.fn.progress.settings,m):P.extend({},P.fn.progress.settings),r=i.className,t=i.metadata,e=i.namespace,n=i.selector,l=i.error,a="."+e,o="module-"+e,c=P(this),u=P(this).find(n.bar),s=P(this).find(n.progress),d=P(this).find(n.label),p=this,v=c.data(o),g=!1,f={helper:{sum:function(e){return Array.isArray(e)?e.reduce(function(e,t){return e+Number(t)},0):0},derivePrecision:function(e,t){for(var r=0,n=1,a=e/t;r<10&&!(1<(a*=n));)n=Math.pow(10,r++);return n},forceArray:function(e){return Array.isArray(e)?e:isNaN(e)?"string"==typeof e?e.split(","):[]:[e]}},initialize:function(){f.set.duration(),f.debug(p),f.read.metadata(),f.read.settings(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of progress",f),v=f,c.data(o,f)},destroy:function(){f.verbose("Destroying previous progress for",c),clearInterval(v.interval),f.remove.state(),c.removeData(o),v=void 0},reset:function(){f.remove.nextValue(),f.update.progress(0)},complete:function(e){(void 0===f.percent||f.percent<100)&&(f.remove.progressPoll(),!0!==e&&f.set.percent(100))},read:{metadata:function(){var e={percent:f.helper.forceArray(c.data(t.percent)),total:c.data(t.total),value:f.helper.forceArray(c.data(t.value))};void 0!==e.total&&(f.debug("Total value set from metadata",e.total),f.set.total(e.total)),0<e.value.length&&(f.debug("Current value set from metadata",e.value),f.set.value(e.value),f.set.progress(e.value)),0<e.percent.length&&(f.debug("Current percent value set from metadata",e.percent),f.set.percent(e.percent))},settings:function(){!1!==i.total&&(f.debug("Current total set in settings",i.total),f.set.total(i.total)),!1!==i.value&&(f.debug("Current value set in settings",i.value),f.set.value(i.value),f.set.progress(f.value)),!1!==i.percent&&(f.debug("Current percent set in settings",i.percent),f.set.percent(i.percent))}},bind:{transitionEnd:function(t){u.one("transitionend"+a,function(e){clearTimeout(f.failSafeTimer),t.call(this,e)}),f.failSafeTimer=setTimeout(function(){u.triggerHandler("transitionend")},i.duration+i.failSafeDelay),f.verbose("Adding fail safe timer",f.timer)}},increment:function(e){var t;e=f.has.total()?(t=f.get.value(),e||1):(t=f.get.percent(),e||f.get.randomValue()),f.debug("Incrementing percentage by",t,t=t+e,e),t=f.get.normalizedValue(t),f.set.progress(t)},decrement:function(e){var t,r;f.get.total()?(r=(t=f.get.value())-(e=e||1),f.debug("Decrementing value by",e,t)):(r=(t=f.get.percent())-(e=e||f.get.randomValue()),f.debug("Decrementing percentage by",e,t)),r=f.get.normalizedValue(r),f.set.progress(r)},has:{progressPoll:function(){return f.progressPoll},total:function(){return!1!==f.get.total()}},get:{text:function(e,t){var r=f.get.value(t=t||0),n=f.get.total(),a=g?f.get.displayPercent(t):f.get.percent(t),o=!1!==n?Math.max(0,n-r):100-a;return e=(e=e||"").replace("{value}",r).replace("{total}",n||0).replace("{left}",o).replace("{percent}",a).replace("{bar}",i.text.bars[t]||""),f.verbose("Adding variables to progress bar text",e),e},normalizedValue:function(e){if(e<0)return f.debug("Value cannot decrement below 0"),0;if(f.has.total()){if(e>f.total)return f.debug("Value cannot increment above total",f.total),f.total}else if(100<e)return f.debug("Value cannot increment above 100 percent"),100;return e},updateInterval:function(){return"auto"===i.updateInterval?i.duration:i.updateInterval},randomValue:function(){return f.debug("Generating random increment percentage"),Math.floor(Math.random()*i.random.max+i.random.min)},numericValue:function(e){return"string"==typeof e?""!==e.replace(/[^\d.]/g,"")&&+e.replace(/[^\d.]/g,""):e},displayPercent:function(e){var e=P(u[e]),t=e.width(),r=c.width(),e=parseInt(e.css("min-width"),10)<t?t/r*100:f.percent;return 0<i.precision?Math.round(e*(10*i.precision))/(10*i.precision):Math.round(e)},percent:function(e){return f.percent&&f.percent[e||0]||0},value:function(e){return f.nextValue||f.value&&f.value[e||0]||0},total:function(){return void 0!==f.total&&f.total}},create:{progressPoll:function(){f.progressPoll=setTimeout(function(){f.update.toNextValue(),f.remove.progressPoll()},f.get.updateInterval())}},is:{complete:function(){return f.is.success()||f.is.warning()||f.is.error()},success:function(){return c.hasClass(r.success)},warning:function(){return c.hasClass(r.warning)},error:function(){return c.hasClass(r.error)},active:function(){return c.hasClass(r.active)},visible:function(){return c.is(":visible")}},remove:{progressPoll:function(){f.verbose("Removing progress poll timer"),f.progressPoll&&(clearTimeout(f.progressPoll),delete f.progressPoll)},nextValue:function(){f.verbose("Removing progress value stored for next update"),delete f.nextValue},state:function(){f.verbose("Removing stored state"),delete f.total,delete f.percent,delete f.value},active:function(){f.verbose("Removing active state"),c.removeClass(r.active)},success:function(){f.verbose("Removing success state"),c.removeClass(r.success)},warning:function(){f.verbose("Removing warning state"),c.removeClass(r.warning)},error:function(){f.verbose("Removing error state"),c.removeClass(r.error)}},set:{barWidth:function(e){f.debug("set bar width with ",e),e=f.helper.forceArray(e);var a=-1,o=-1,i=f.helper.sum(e),s=u.length,l=1<s,t=e.map(function(e,t){var r=t===s-1&&0===i,n=P(u[t]);return 0===e&&l&&!r?n.css("display","none"):(l&&r&&n.css("background","transparent"),-1===a&&(a=t),o=t,n.css({display:"block",width:e+"%"})),parseFloat(e)});e.forEach(function(e,t){P(u[t]).css({borderTopLeftRadius:t===a?"":"0",borderBottomLeftRadius:t===a?"":"0",borderTopRightRadius:t===o?"":"0",borderBottomRightRadius:t===o?"":"0"})}),c.attr("data-percent",t)},duration:function(e){e=e||i.duration,f.verbose("Setting progress bar transition duration",e="number"==typeof e?e+"ms":e),u.css({"transition-duration":e})},percent:function(e){e=f.helper.forceArray(e).map(function(e){return e="string"==typeof e?+e.replace("%",""):e,i.limitValues?Math.max(0,Math.min(100,e)):e});var t,r=f.has.total(),n=f.helper.sum(e),a=1<e.length&&r,o=f.helper.sum(f.helper.forceArray(f.value));a&&o>f.total?f.error(l.sumExceedsTotal,o,f.total):!a&&100<n?f.error(l.tooHigh,n):n<0?f.error(l.tooLow,n):(t=0<i.precision?i.precision:a?f.helper.derivePrecision(Math.min.apply(null,f.value),f.total):0,o=e.map(function(e){return 0<t?Math.round(e*(10*t))/(10*t):Math.round(e)}),f.percent=o,r&&(f.value=e.map(function(e){return 0<t?Math.round(e/100*f.total*(10*t))/(10*t):Math.round(e/100*f.total*10)/10})),f.set.barWidth(e),f.set.labelInterval()),i.onChange.call(p,e,f.value,f.total)},labelInterval:function(){clearInterval(f.interval),f.bind.transitionEnd(function(){f.verbose("Bar finished animating, removing continuous label updates"),clearInterval(f.interval),g=!1,f.set.labels()}),g=!0,f.interval=setInterval(function(){P.contains(C.documentElement,p)||(clearInterval(f.interval),g=!1),f.set.labels()},i.framerate)},labels:function(){f.verbose("Setting both bar progress and outer label text"),f.set.barLabel(),f.set.state()},label:function(e){e&&(e=f.get.text(e),f.verbose("Setting label to text",e),d.text(e))},state:function(e){100===(e=void 0!==e?e:f.helper.sum(f.percent))?i.autoSuccess&&1===u.length&&!(f.is.warning()||f.is.error()||f.is.success())?(f.set.success(),f.debug("Automatically triggering success at 100%")):(f.verbose("Reached 100% removing active state"),f.remove.active(),f.remove.progressPoll()):0<e?(f.verbose("Adjusting active progress bar label",e),f.set.active()):(f.remove.active(),f.remove.warning(),f.remove.error(),f.remove.success(),f.set.label(i.text.active))},barLabel:function(r){s.each(function(e,t){t=P(t);void 0!==r?t.text(f.get.text(r,e)):"ratio"===i.label&&f.has.total()?(f.verbose("Adding ratio to bar label"),t.text(f.get.text(i.text.ratio,e))):"percent"===i.label&&(f.verbose("Adding percentage to bar label"),t.text(f.get.text(i.text.percent,e)))})},active:function(e){e=e||i.text.active,f.debug("Setting active state"),i.showActivity&&!f.is.active()&&c.addClass(r.active),f.remove.warning(),f.remove.error(),f.remove.success(),(e=i.onLabelUpdate("active",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onActive.call(p,f.value,f.total)})},success:function(e,t){e=e||i.text.success||i.text.active,f.debug("Setting success state"),c.addClass(r.success),f.remove.active(),f.remove.warning(),f.remove.error(),f.complete(t),e=i.text.success?i.onLabelUpdate("success",e,f.value,f.total):i.onLabelUpdate("active",e,f.value,f.total),f.set.label(e),f.bind.transitionEnd(function(){i.onSuccess.call(p,f.total)})},warning:function(e,t){e=e||i.text.warning,f.debug("Setting warning state"),c.addClass(r.warning),f.remove.active(),f.remove.success(),f.remove.error(),f.complete(t),(e=i.onLabelUpdate("warning",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onWarning.call(p,f.value,f.total)})},error:function(e,t){e=e||i.text.error,f.debug("Setting error state"),c.addClass(r.error),f.remove.active(),f.remove.success(),f.remove.warning(),f.complete(t),(e=i.onLabelUpdate("error",e,f.value,f.total))&&f.set.label(e),f.bind.transitionEnd(function(){i.onError.call(p,f.value,f.total)})},total:function(e){f.total=e},value:function(e){f.value=f.helper.forceArray(e)},progress:function(e){f.has.progressPoll()?(f.debug("Updated within interval, setting next update to use new value",e),f.set.nextValue(e)):(f.debug("First update in progress update interval, immediately updating",e),f.update.progress(e),f.create.progressPoll())},nextValue:function(e){f.nextValue=e}},update:{toNextValue:function(){var e=f.nextValue;e&&(f.debug("Update interval complete using last updated value",e),f.update.progress(e),f.remove.nextValue())},progress:function(e){var r=f.has.total(),e=(r&&f.set.value(e),f.helper.forceArray(e).map(function(e){var t;return!1===(e=f.get.numericValue(e))&&f.error(l.nonNumeric,e),e=f.get.normalizedValue(e),r?(t=0<f.total?e/f.total*100:100,f.debug("Calculating percent complete from total",t)):(t=e,f.debug("Setting value to exact percentage value",t)),t}));f.set.percent(e)}},setting:function(e,t){if(f.debug("Changing setting",e,t),P.isPlainObject(e))P.extend(!0,i,e);else{if(void 0===t)return i[e];P.isPlainObject(i[e])?P.extend(!0,i[e],t):i[e]=t}},internal:function(e,t){if(P.isPlainObject(e))P.extend(!0,f,e);else{if(void 0===t)return f[e];f[e]=t}},debug:function(){!i.silent&&i.debug&&(i.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,i.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!i.silent&&i.verbose&&i.debug&&(i.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,i.name+":"),f.verbose.apply(console,arguments)))},error:function(){i.silent||(f.error=Function.prototype.bind.call(console.error,console,i.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,r;i.performance&&(r=(t=Date.now())-(x||t),x=t,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:p,"Execution Time":r})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var e=i.name+":",r=0;x=!1,clearTimeout(f.performance.timer),P.each(y,function(e,t){r+=t["Execution Time"]}),e+=" "+r+"ms",h&&(e+=" '"+h+"'"),0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):P.each(y,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(n,e,t){var a,o,r,i,s=v;return e=e||A,t=t||p,"string"==typeof n&&void 0!==s&&(n=n.split(/[ .]/),a=n.length-1,P.each(n,function(e,t){var r=e!==a?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(P.isPlainObject(s[r])&&e!==a)s=s[r];else{if(void 0!==s[r])return o=s[r],!1;{if(!P.isPlainObject(s[t])||e===a)return void 0!==s[t]?o=s[t]:f.error(l.method,n),!1;s=s[t]}}})),"function"==typeof(i=o)&&"number"!=typeof i.nodeType?r=o.apply(t,e):void 0!==o&&(r=o),Array.isArray(b)?b.push(r):void 0!==b?b=[b,r]:void 0!==r&&(b=r),o}};V?(void 0===v&&f.initialize(),f.invoke(w)):(void 0!==v&&v.invoke("destroy"),f.initialize())}),void 0!==b?b:this},P.fn.progress.settings={name:"Progress",namespace:"progress",silent:!1,debug:!1,verbose:!1,performance:!0,random:{min:2,max:5},duration:300,updateInterval:"auto",autoSuccess:!0,showActivity:!0,limitValues:!0,label:"percent",precision:0,framerate:1e3/30,percent:!1,total:!1,value:!1,failSafeDelay:100,onLabelUpdate:function(e,t,r,n){return t},onChange:function(e,t,r){},onSuccess:function(e){},onActive:function(e,t){},onError:function(e,t){},onWarning:function(e,t){},error:{method:"The method you called is not defined.",nonNumeric:"Progress value is non numeric",tooHigh:"Value specified is above 100%",tooLow:"Value specified is below 0%",sumExceedsTotal:"Sum of multiple values exceed total"},regExp:{variable:/{\$*[\da-z]+}/gi},metadata:{percent:"percent",total:"total",value:"value"},selector:{bar:"> .bar",label:"> .label",progress:".bar > .progress"},text:{active:!1,error:!1,success:!1,warning:!1,percent:"{percent}%",ratio:"{value} of {total}",bars:[""]},className:{active:"active",error:"error",success:"success",warning:"warning"}}}(jQuery,window,document);
|
package/dist/components/rail.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.2-beta.
|
2
|
+
* # Fomantic-UI 2.9.2-beta.10+cf51e1c - Search
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -408,7 +408,7 @@
|
|
408
408
|
return module.is.focused() && !module.is.visible() && !module.is.empty();
|
409
409
|
},
|
410
410
|
transition: function () {
|
411
|
-
return settings.transition && $.fn.transition !== undefined
|
411
|
+
return settings.transition && $.fn.transition !== undefined;
|
412
412
|
},
|
413
413
|
},
|
414
414
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.2-beta.
|
2
|
+
* # Fomantic UI - 2.9.2-beta.10+cf51e1c
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* https://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* https://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(F,k,D){"use strict";function E(e){return"function"==typeof e&&"number"!=typeof e.nodeType}k=void 0!==k&&k.Math===Math?k:globalThis,F.fn.search=function(R){var S,x=F(this),C=x.selector||"",w=Date.now(),T=[],A=R,j="string"==typeof A,q=[].slice.call(arguments,1);return x.each(function(){var d=F.isPlainObject(R)?F.extend(!0,{},F.fn.search.settings,R):F.extend({},F.fn.search.settings),f=d.className,c=d.metadata,r=d.regExp,i=d.fields,g=d.selector,h=d.error,e=d.namespace,n="."+e,t=e+"-module",v=F(this),p=v.find(g.prompt),s=v.find(g.searchButton),a=v.find(g.results),o=v.find(g.result),u=(v.find(g.category),this),l=v.data(t),m=!1,y=!1,b={initialize:function(){b.verbose("Initializing module"),b.get.settings(),b.determine.searchFields(),b.bind.events(),b.set.type(),b.create.results(),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),l=b,v.data(t,b)},destroy:function(){b.verbose("Destroying instance"),v.off(n).removeData(t)},refresh:function(){b.debug("Refreshing selector cache"),p=v.find(g.prompt),s=v.find(g.searchButton),v.find(g.category),a=v.find(g.results),o=v.find(g.result)},refreshResults:function(){a=v.find(g.results),o=v.find(g.result)},bind:{events:function(){b.verbose("Binding events to search"),d.automatic&&(v.on(b.get.inputEvent()+n,g.prompt,b.event.input),p.attr("autocomplete",b.is.chrome()?"fomantic-search":"off")),v.on("focus"+n,g.prompt,b.event.focus).on("blur"+n,g.prompt,b.event.blur).on("keydown"+n,g.prompt,b.handleKeyboard).on("click"+n,g.searchButton,b.query).on("mousedown"+n,g.results,b.event.result.mousedown).on("mouseup"+n,g.results,b.event.result.mouseup).on("click"+n,g.result,b.event.result.click)}},determine:{searchFields:function(){R&&void 0!==R.searchFields&&(d.searchFields=R.searchFields)}},event:{input:function(){d.searchDelay?(clearTimeout(b.timer),b.timer=setTimeout(function(){b.is.focused()&&b.query()},d.searchDelay)):b.query()},focus:function(){b.set.focus(),d.searchOnFocus&&b.has.minimumCharacters()&&b.query(function(){b.can.show()&&b.showResults()})},blur:function(e){function t(){b.cancel.query(),b.remove.focus(),b.timer=setTimeout(b.hideResults,d.hideDelay)}var s=D.activeElement===this;s||(y=!1,b.resultsClicked?(b.debug("Determining if user action caused search to close"),v.one("click.close"+n,g.results,function(e){b.is.inMessage(e)||m?p.trigger("focus"):(m=!1,b.is.animating()||b.is.hidden()||t())})):(b.debug("Input blurred without user action, closing results"),t()))},result:{mousedown:function(){b.resultsClicked=!0},mouseup:function(){b.resultsClicked=!1},click:function(e){b.debug("Search result selected");var t=F(this),s=t.find(g.title).eq(0),r=t.is("a[href]")?t:t.find("a[href]").eq(0),n=r.attr("href")||!1,i=r.attr("target")||!1,s=0<s.length&&s.text(),a=b.get.results(),t=t.data(c.result)||b.get.result(s,a),o=b.get.value();if(E(d.onSelect)&&!1===d.onSelect.call(u,t,a))return b.debug("Custom onSelect callback cancelled default select action"),void(m=!0);b.hideResults(),s&&b.get.value()===o&&b.set.value(s),n&&(e.preventDefault(),b.verbose("Opening search link found in result",r),"_blank"===i||e.ctrlKey?k.open(n):k.location.href=n)}}},ensureVisible:function(e){var t,s,r;0!==e.length&&(e=(t=e.position().top)+e.outerHeight(!0),s=a.scrollTop(),r=a.height(),t<0?a.scrollTop(s+t):r<e&&a.scrollTop(s+(e-r)))},handleKeyboard:function(e){var t,s=v.find(g.result),r=v.find(g.category),n=s.filter("."+f.active),i=s.index(n),a=s.length,n=0<n.length,o=e.which,c=13,u=38,l=40;if(o===27&&(b.is.visible()?b.hideResults():(b.verbose("Escape key pressed, blurring search field"),p.trigger("blur")),e.stopPropagation(),y=!0),b.is.visible())if(o===c){if(b.verbose("Enter key pressed, selecting active result"),0<s.filter("."+f.active).length)return b.event.result.click.call(s.filter("."+f.active),e),e.preventDefault(),!1}else o===u&&n?(b.verbose("Up key pressed, changing active result"),t=i-1<0?i:i-1,r.removeClass(f.active),s.removeClass(f.active).eq(t).addClass(f.active).closest(r).addClass(f.active),b.ensureVisible(s.eq(t)),e.preventDefault()):o===l&&(b.verbose("Down key pressed, changing active result"),t=a<=i+1?i:i+1,r.removeClass(f.active),s.removeClass(f.active).eq(t).addClass(f.active).closest(r).addClass(f.active),b.ensureVisible(s.eq(t)),e.preventDefault());else o===c&&(b.verbose("Enter key pressed, executing query"),b.query(),b.set.buttonPressed(),p.one("keyup",b.remove.buttonFocus))},setup:{api:function(r,n){var e={debug:d.debug,on:!1,cache:d.cache,action:"search",urlData:{query:r}};F.extend(!0,e,d.apiSettings,{onSuccess:function(e,t,s){b.parse.response.call(u,e,r),n(),d.apiSettings&&"function"==typeof d.apiSettings.onSuccess&&d.apiSettings.onSuccess.call(this,e,t,s)},onFailure:function(e,t,s){b.displayMessage(h.serverError),n(),d.apiSettings&&"function"==typeof d.apiSettings.onFailure&&d.apiSettings.onFailure.call(this,e,t,s)},onAbort:function(e,t,s){d.apiSettings&&"function"==typeof d.apiSettings.onAbort&&d.apiSettings.onAbort.call(this,e,t,s)},onError:function(e,t,s){b.error(),d.apiSettings&&"function"==typeof d.apiSettings.onError&&d.apiSettings.onError.call(this,e,t,s)}}),b.verbose("Setting up API request",e),v.api(e)}},can:{useAPI:function(){return void 0!==F.fn.api},show:function(){return b.is.focused()&&!b.is.visible()&&!b.is.empty()},transition:function(){return d.transition&&void 0!==F.fn.transition&&v.transition("is supported")}},is:{animating:function(){return a.hasClass(f.animating)},chrome:function(){return!!k.chrome&&!k.StyleMedia},hidden:function(){return a.hasClass(f.hidden)},inMessage:function(e){var t;if(e.target)return t=F(e.target),F.contains(D.documentElement,e.target)&&0<t.closest(g.message).length},empty:function(){return""===a.html()},visible:function(){return 0<a.filter(":visible").length},focused:function(){return 0<p.filter(":focus").length}},get:{settings:function(){F.isPlainObject(R)&&R.searchFullText&&(d.fullTextSearch=R.searchFullText,b.error(d.error.oldSearchSyntax,u)),d.ignoreDiacritics&&!String.prototype.normalize&&(d.ignoreDiacritics=!1,b.error(h.noNormalize,u))},inputEvent:function(){var e=p[0];return void 0!==e&&void 0!==e.oninput?"input":void 0!==e&&void 0!==e.onpropertychange?"propertychange":"keyup"},value:function(){return p.val()},results:function(){return v.data(c.results)},result:function(s,e){var r=!1;return s=void 0!==s?s:b.get.value(),e=void 0!==e?e:b.get.results(),"category"===d.type?(b.debug("Finding result that matches",s),F.each(e,function(e,t){if(Array.isArray(t.results)&&(r=b.search.object(s,t.results)[0]))return!1})):(b.debug("Finding result in results object",s),r=b.search.object(s,e)[0]),r||!1}},select:{firstResult:function(){b.verbose("Selecting first result"),o.first().addClass(f.active)}},set:{focus:function(){v.addClass(f.focus)},loading:function(){v.addClass(f.loading)},value:function(e){b.verbose("Setting search input value",e),p.val(e)},type:function(e){e=e||d.type,f[e]&&v.addClass(f[e])},buttonPressed:function(){s.addClass(f.pressed)}},remove:{loading:function(){v.removeClass(f.loading)},focus:function(){v.removeClass(f.focus)},buttonPressed:function(){s.removeClass(f.pressed)},diacritics:function(e){return d.ignoreDiacritics?e.normalize("NFD").replace(/[\u0300-\u036F]/g,""):e}},query:function(e){e=E(e)?e:function(){};var t=b.get.value(),s=b.read.cache(t);e=e||function(){},b.has.minimumCharacters()?(s?(b.debug("Reading result from cache",t),b.save.results(s.results),b.addResults(s.html),b.inject.id(s.results),e()):(b.debug("Querying for",t),F.isPlainObject(d.source)||Array.isArray(d.source)?(b.search.local(t),e()):b.can.useAPI()?b.search.remote(t,e):(b.error(h.source),e())),d.onSearchQuery.call(u,t)):b.hideResults()},search:{local:function(e){var t,s=b.search.object(e,d.source);b.set.loading(),b.save.results(s),b.debug("Returned full local search results",s),0<d.maxResults&&(b.debug("Using specified max results",s),s=s.slice(0,d.maxResults)),"category"===d.type&&(s=b.create.categoryResults(s)),t=b.generateResults({results:s}),b.remove.loading(),b.addResults(t),b.inject.id(s),b.write.cache(e,{html:t,results:s})},remote:function(e,t){t=E(t)?t:function(){},v.api("is loading")&&v.api("abort"),b.setup.api(e,t),v.api("query")},object:function(n,e,t){n=b.remove.diacritics(String(n));function i(e,t){var s=-1===F.inArray(t,a),r=-1===F.inArray(t,c),n=-1===F.inArray(t,o);s&&r&&n&&e.push(t)}var a=[],o=[],c=[],s=n.replace(r.escape,"\\$&"),u=new RegExp(r.beginsWith+s,"i");if(e=e||d.source,t=void 0!==t?t:d.searchFields,Array.isArray(t)||(t=[t]),void 0===e||!1===e)return b.error(h.source),[];var l=t.length-1;return F.each(e,function(e,s){var r=[];F.each(t,function(e,t){if("string"==typeof s[t]||"number"==typeof s[t]){t="string"==typeof s[t]?b.remove.diacritics(s[t]):s[t].toString();if("all"===d.fullTextSearch){if(r.push(t),e<l)return!0;t=r.join(" ")}"all"!==d.fullTextSearch&&-1!==t.search(u)?i(a,s):"exact"===d.fullTextSearch&&b.exactSearch(n,t)||"some"===d.fullTextSearch&&b.wordSearch(n,t)||"all"===d.fullTextSearch&&b.wordSearch(n,t,!0)?i(o,s):!0===d.fullTextSearch&&b.fuzzySearch(n,t)&&i(c,s)}})}),F.merge(o,c),F.merge(a,o),a}},exactSearch:function(e,t){return e=e.toLowerCase(),-1<(t=t.toLowerCase()).indexOf(e)},wordSearch:function(e,t,s){for(var r=e.split(/\s+/),n=r.length,i=!1,a=0;a<n&&!(!(i=b.exactSearch(r[a],t))&&s||i&&!s);a++);return i},fuzzySearch:function(e,t){var s=t.length,r=e.length;if("string"!=typeof e)return!1;if(e=e.toLowerCase(),t=t.toLowerCase(),s<r)return!1;if(r===s)return e===t;for(var n=0,i=0;n<r;n++){for(var a=!1,o=e.charCodeAt(n);i<s;)if(t.charCodeAt(i++)===o){a=!0;break}if(!a)return!1}return!0},parse:{response:function(e,t){Array.isArray(e)&&((s={})[i.results]=e,e=s);var s=b.generateResults(e);b.verbose("Parsing server response",e),void 0!==e&&void 0!==t&&void 0!==e[i.results]&&(b.addResults(s),b.inject.id(e[i.results]),b.write.cache(t,{html:s,results:e[i.results]}),b.save.results(e[i.results]))}},cancel:{query:function(){b.can.useAPI()&&v.api("abort")}},has:{minimumCharacters:function(){return b.get.value().length>=d.minCharacters},results:function(){return 0!==a.length&&""!==a.html()}},clear:{cache:function(e){var t=v.data(c.cache);e?t&&t[e]&&(b.debug("Removing value from cache",e),delete t[e],v.data(c.cache,t)):(b.debug("Clearing cache",e),v.removeData(c.cache))}},read:{cache:function(e){var t=v.data(c.cache);return!!d.cache&&(b.verbose("Checking cache for generated html for query",e),"object"==typeof t&&void 0!==t[e]&&t[e])}},create:{categoryResults:function(e){var s={};return F.each(e,function(e,t){t.category&&(void 0===s[t.category]?(b.verbose("Creating new category of results",t.category),s[t.category]={name:t.category,results:[t]}):s[t.category].results.push(t))}),s},id:function(e,t){var s,e=e+1;return void 0!==t?(t=String.fromCharCode(97+t),b.verbose("Creating category result id",s=t+e)):b.verbose("Creating result id",s=e),s},results:function(){0===a.length&&(a=F("<div />").addClass(f.results).appendTo(v))}},inject:{result:function(e,t,s){b.verbose("Injecting result into results");s=(void 0!==s?a.children().eq(s).children(g.results).first():a).children(g.result).eq(t);b.verbose("Injecting results metadata",s),s.data(c.result,e)},id:function(e){b.debug("Injecting unique ids into results");var s=0,r=0;return"category"===d.type?F.each(e,function(e,t){0<t.results.length&&(r=0,F.each(t.results,function(e,t){void 0===t.id&&(t.id=b.create.id(r,s)),b.inject.result(t,r,s),r++}),s++)}):F.each(e,function(e,t){void 0===t.id&&(t.id=b.create.id(r)),b.inject.result(t,r),r++}),e}},save:{results:function(e){b.verbose("Saving current search results to metadata",e),v.data(c.results,e)}},write:{cache:function(e,t){var s=void 0!==v.data(c.cache)?v.data(c.cache):{};d.cache&&(b.verbose("Writing generated html to cache",e,t),s[e]=t,v.data(c.cache,s))}},addResults:function(e){if(E(d.onResultsAdd)&&!1===d.onResultsAdd.call(a,e))return b.debug("onResultsAdd callback cancelled default action"),!1;e?(a.html(e),b.refreshResults(),d.selectFirstResult&&b.select.firstResult(),b.showResults()):b.hideResults(function(){a.empty()})},showResults:function(e){e=E(e)?e:function(){},y||!b.is.visible()&&b.has.results()&&(b.can.transition()?(b.debug("Showing results with css animations"),a.transition({animation:d.transition+" in",debug:d.debug,verbose:d.verbose,silent:d.silent,duration:d.duration,onShow:function(){var e=v.find(g.result).eq(0);b.ensureVisible(e)},onComplete:function(){e()},queue:!0})):(b.debug("Showing results with javascript"),a.stop().fadeIn(d.duration,d.easing)),d.onResultsOpen.call(a))},hideResults:function(e){e=E(e)?e:function(){},b.is.visible()&&(b.can.transition()?(b.debug("Hiding results with css animations"),a.transition({animation:d.transition+" out",debug:d.debug,verbose:d.verbose,silent:d.silent,duration:d.duration,onComplete:function(){e()},queue:!0})):(b.debug("Hiding results with javascript"),a.stop().fadeOut(d.duration,d.easing)),d.onResultsClose.call(a))},generateResults:function(e){b.debug("Generating html from response",e);var t=d.templates[d.type],s=F.isPlainObject(e[i.results])&&!F.isEmptyObject(e[i.results]),r=Array.isArray(e[i.results])&&0<e[i.results].length,n="";return s||r?(0<d.maxResults&&(s?"standard"===d.type&&b.error(h.maxResults):e[i.results]=e[i.results].slice(0,d.maxResults)),E(t)?n=t(e,i,d.preserveHTML):b.error(h.noTemplate,!1)):d.showNoResults&&(n=b.displayMessage(h.noResults,"empty",h.noResultsHeader)),d.onResults.call(u,e),n},displayMessage:function(e,t,s){return b.debug("Displaying message",e,t=t||"standard",s),b.addResults(d.templates.message(e,t,s)),d.templates.message(e,t,s)},setting:function(e,t){if(F.isPlainObject(e))F.extend(!0,d,e);else{if(void 0===t)return d[e];d[e]=t}},internal:function(e,t){if(F.isPlainObject(e))F.extend(!0,b,e);else{if(void 0===t)return b[e];b[e]=t}},debug:function(){!d.silent&&d.debug&&(d.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,d.name+":"),b.debug.apply(console,arguments)))},verbose:function(){!d.silent&&d.verbose&&d.debug&&(d.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,d.name+":"),b.verbose.apply(console,arguments)))},error:function(){d.silent||(b.error=Function.prototype.bind.call(console.error,console,d.name+":"),b.error.apply(console,arguments))},performance:{log:function(e){var t,s;d.performance&&(s=(t=Date.now())-(w||t),w=t,T.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:u,"Execution Time":s})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,500)},display:function(){var e=d.name+":",s=0;w=!1,clearTimeout(b.performance.timer),F.each(T,function(e,t){s+=t["Execution Time"]}),e+=" "+s+"ms",C&&(e+=" '"+C+"'"),1<x.length&&(e+=" ("+x.length+")"),0<T.length&&(console.groupCollapsed(e),console.table?console.table(T):F.each(T,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),T=[]}},invoke:function(r,e,t){var n,i,s,a=l;return e=e||q,t=t||u,"string"==typeof r&&void 0!==a&&(r=r.split(/[ .]/),n=r.length-1,F.each(r,function(e,t){var s=e!==n?t+r[e+1].charAt(0).toUpperCase()+r[e+1].slice(1):r;if(F.isPlainObject(a[s])&&e!==n)a=a[s];else{if(void 0!==a[s])return i=a[s],!1;{if(!F.isPlainObject(a[t])||e===n)return void 0!==a[t]?i=a[t]:b.error(h.method,r),!1;a=a[t]}}})),E(i)?s=i.apply(t,e):void 0!==i&&(s=i),Array.isArray(S)?S.push(s):void 0!==S?S=[S,s]:void 0!==s&&(S=s),i}};j?(void 0===l&&b.initialize(),b.invoke(A)):(void 0!==l&&l.invoke("destroy"),b.initialize())}),void 0!==S?S:this},F.fn.search.settings={name:"Search",namespace:"search",silent:!1,debug:!1,verbose:!1,performance:!0,type:"standard",minCharacters:1,selectFirstResult:!1,apiSettings:!1,source:!1,searchOnFocus:!0,searchFields:["id","title","description"],displayField:"",fullTextSearch:"exact",ignoreDiacritics:!1,automatic:!0,hideDelay:0,searchDelay:200,maxResults:7,cache:!0,showNoResults:!0,preserveHTML:!0,transition:"scale",duration:200,easing:"easeOutExpo",onSelect:!1,onResultsAdd:!1,onSearchQuery:function(e){},onResults:function(e){},onResultsOpen:function(){},onResultsClose:function(){},className:{animating:"animating",active:"active",category:"category",empty:"empty",focus:"focus",hidden:"hidden",loading:"loading",results:"results",pressed:"down"},error:{source:"Cannot search. No source used, and Fomantic API module was not included",noResultsHeader:"No Results",noResults:"Your search returned no results",noTemplate:"A valid template name was not specified.",oldSearchSyntax:"searchFullText setting has been renamed fullTextSearch for consistency, please adjust your settings.",serverError:"There was an issue querying the server.",maxResults:"Results must be an array to use maxResults setting",method:"The method you called is not defined.",noNormalize:'"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.'},metadata:{cache:"cache",results:"results",result:"result"},regExp:{escape:/[$()*+./?[\\\]^{|}-]/g,beginsWith:"(?:\\s|^)"},fields:{categories:"results",categoryName:"name",categoryResults:"results",description:"description",image:"image",price:"price",results:"results",title:"title",url:"url",action:"action",actionText:"text",actionURL:"url"},selector:{prompt:".prompt",searchButton:".search.button",results:".results",message:".results > .message",category:".category",result:".result",title:".title, .name"},templates:{escape:function(e,t){if(t)return e;var s={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return s[e]}):e},message:function(e,t,s){var r="";return void 0!==e&&void 0!==t&&(r+='<div class="message '+t+'">',s&&(r+='<div class="header">'+s+"</div>"),r=r+' <div class="description">'+e+"</div></div>"),r},category:function(e,s,r){var n="",i=F.fn.search.settings.templates.escape;return void 0!==e[s.categoryResults]&&(F.each(e[s.categoryResults],function(e,t){void 0!==t[s.results]&&0<t.results.length&&(n+='<div class="category">',void 0!==t[s.categoryName]&&(n+='<div class="name">'+i(t[s.categoryName],r)+"</div>"),n+='<div class="results">',F.each(t.results,function(e,t){n+=t[s.url]?'<a class="result" href="'+t[s.url].replace(/"/g,"")+'">':'<a class="result">',void 0!==t[s.image]&&(n+='<div class="image"> <img src="'+t[s.image].replace(/"/g,"")+'"></div>'),n+='<div class="content">',void 0!==t[s.price]&&(n+='<div class="price">'+i(t[s.price],r)+"</div>"),void 0!==t[s.title]&&(n+='<div class="title">'+i(t[s.title],r)+"</div>"),void 0!==t[s.description]&&(n+='<div class="description">'+i(t[s.description],r)+"</div>"),n+="</div></a>"}),n+="</div></div>")}),e[s.action]&&(n+=!1===s.actionURL?'<div class="action">'+i(e[s.action][s.actionText],r)+"</div>":'<a href="'+e[s.action][s.actionURL].replace(/"/g,"")+'" class="action">'+i(e[s.action][s.actionText],r)+"</a>"),n)},standard:function(e,s,r){var n="",i=F.fn.search.settings.templates.escape;return void 0!==e[s.results]&&(F.each(e[s.results],function(e,t){n+=t[s.url]?'<a class="result" href="'+t[s.url].replace(/"/g,"")+'">':'<a class="result">',void 0!==t[s.image]&&(n+='<div class="image"> <img src="'+t[s.image].replace(/"/g,"")+'"></div>'),n+='<div class="content">',void 0!==t[s.price]&&(n+='<div class="price">'+i(t[s.price],r)+"</div>"),void 0!==t[s.title]&&(n+='<div class="title">'+i(t[s.title],r)+"</div>"),void 0!==t[s.description]&&(n+='<div class="description">'+i(t[s.description],r)+"</div>"),n+="</div></a>"}),e[s.action]&&(n+=!1===s.actionURL?'<div class="action">'+i(e[s.action][s.actionText],r)+"</div>":'<a href="'+e[s.action][s.actionURL].replace(/"/g,"")+'" class="action">'+i(e[s.action][s.actionText],r)+"</a>"),n)}}},F.extend(F.easing,{easeOutExpo:function(e){return 1===e?1:1-Math.pow(2,-10*e)}})}(jQuery,window,document);
|
11
|
+
!function(F,k,D){"use strict";function E(e){return"function"==typeof e&&"number"!=typeof e.nodeType}k=void 0!==k&&k.Math===Math?k:globalThis,F.fn.search=function(R){var S,x=F(this),C=x.selector||"",w=Date.now(),T=[],A=R,j="string"==typeof A,q=[].slice.call(arguments,1);return x.each(function(){var d=F.isPlainObject(R)?F.extend(!0,{},F.fn.search.settings,R):F.extend({},F.fn.search.settings),f=d.className,c=d.metadata,r=d.regExp,i=d.fields,g=d.selector,h=d.error,e=d.namespace,n="."+e,t=e+"-module",v=F(this),p=v.find(g.prompt),s=v.find(g.searchButton),a=v.find(g.results),o=v.find(g.result),u=(v.find(g.category),this),l=v.data(t),m=!1,y=!1,b={initialize:function(){b.verbose("Initializing module"),b.get.settings(),b.determine.searchFields(),b.bind.events(),b.set.type(),b.create.results(),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),l=b,v.data(t,b)},destroy:function(){b.verbose("Destroying instance"),v.off(n).removeData(t)},refresh:function(){b.debug("Refreshing selector cache"),p=v.find(g.prompt),s=v.find(g.searchButton),v.find(g.category),a=v.find(g.results),o=v.find(g.result)},refreshResults:function(){a=v.find(g.results),o=v.find(g.result)},bind:{events:function(){b.verbose("Binding events to search"),d.automatic&&(v.on(b.get.inputEvent()+n,g.prompt,b.event.input),p.attr("autocomplete",b.is.chrome()?"fomantic-search":"off")),v.on("focus"+n,g.prompt,b.event.focus).on("blur"+n,g.prompt,b.event.blur).on("keydown"+n,g.prompt,b.handleKeyboard).on("click"+n,g.searchButton,b.query).on("mousedown"+n,g.results,b.event.result.mousedown).on("mouseup"+n,g.results,b.event.result.mouseup).on("click"+n,g.result,b.event.result.click)}},determine:{searchFields:function(){R&&void 0!==R.searchFields&&(d.searchFields=R.searchFields)}},event:{input:function(){d.searchDelay?(clearTimeout(b.timer),b.timer=setTimeout(function(){b.is.focused()&&b.query()},d.searchDelay)):b.query()},focus:function(){b.set.focus(),d.searchOnFocus&&b.has.minimumCharacters()&&b.query(function(){b.can.show()&&b.showResults()})},blur:function(e){function t(){b.cancel.query(),b.remove.focus(),b.timer=setTimeout(b.hideResults,d.hideDelay)}var s=D.activeElement===this;s||(y=!1,b.resultsClicked?(b.debug("Determining if user action caused search to close"),v.one("click.close"+n,g.results,function(e){b.is.inMessage(e)||m?p.trigger("focus"):(m=!1,b.is.animating()||b.is.hidden()||t())})):(b.debug("Input blurred without user action, closing results"),t()))},result:{mousedown:function(){b.resultsClicked=!0},mouseup:function(){b.resultsClicked=!1},click:function(e){b.debug("Search result selected");var t=F(this),s=t.find(g.title).eq(0),r=t.is("a[href]")?t:t.find("a[href]").eq(0),n=r.attr("href")||!1,i=r.attr("target")||!1,s=0<s.length&&s.text(),a=b.get.results(),t=t.data(c.result)||b.get.result(s,a),o=b.get.value();if(E(d.onSelect)&&!1===d.onSelect.call(u,t,a))return b.debug("Custom onSelect callback cancelled default select action"),void(m=!0);b.hideResults(),s&&b.get.value()===o&&b.set.value(s),n&&(e.preventDefault(),b.verbose("Opening search link found in result",r),"_blank"===i||e.ctrlKey?k.open(n):k.location.href=n)}}},ensureVisible:function(e){var t,s,r;0!==e.length&&(e=(t=e.position().top)+e.outerHeight(!0),s=a.scrollTop(),r=a.height(),t<0?a.scrollTop(s+t):r<e&&a.scrollTop(s+(e-r)))},handleKeyboard:function(e){var t,s=v.find(g.result),r=v.find(g.category),n=s.filter("."+f.active),i=s.index(n),a=s.length,n=0<n.length,o=e.which,c=13,u=38,l=40;if(o===27&&(b.is.visible()?b.hideResults():(b.verbose("Escape key pressed, blurring search field"),p.trigger("blur")),e.stopPropagation(),y=!0),b.is.visible())if(o===c){if(b.verbose("Enter key pressed, selecting active result"),0<s.filter("."+f.active).length)return b.event.result.click.call(s.filter("."+f.active),e),e.preventDefault(),!1}else o===u&&n?(b.verbose("Up key pressed, changing active result"),t=i-1<0?i:i-1,r.removeClass(f.active),s.removeClass(f.active).eq(t).addClass(f.active).closest(r).addClass(f.active),b.ensureVisible(s.eq(t)),e.preventDefault()):o===l&&(b.verbose("Down key pressed, changing active result"),t=a<=i+1?i:i+1,r.removeClass(f.active),s.removeClass(f.active).eq(t).addClass(f.active).closest(r).addClass(f.active),b.ensureVisible(s.eq(t)),e.preventDefault());else o===c&&(b.verbose("Enter key pressed, executing query"),b.query(),b.set.buttonPressed(),p.one("keyup",b.remove.buttonFocus))},setup:{api:function(r,n){var e={debug:d.debug,on:!1,cache:d.cache,action:"search",urlData:{query:r}};F.extend(!0,e,d.apiSettings,{onSuccess:function(e,t,s){b.parse.response.call(u,e,r),n(),d.apiSettings&&"function"==typeof d.apiSettings.onSuccess&&d.apiSettings.onSuccess.call(this,e,t,s)},onFailure:function(e,t,s){b.displayMessage(h.serverError),n(),d.apiSettings&&"function"==typeof d.apiSettings.onFailure&&d.apiSettings.onFailure.call(this,e,t,s)},onAbort:function(e,t,s){d.apiSettings&&"function"==typeof d.apiSettings.onAbort&&d.apiSettings.onAbort.call(this,e,t,s)},onError:function(e,t,s){b.error(),d.apiSettings&&"function"==typeof d.apiSettings.onError&&d.apiSettings.onError.call(this,e,t,s)}}),b.verbose("Setting up API request",e),v.api(e)}},can:{useAPI:function(){return void 0!==F.fn.api},show:function(){return b.is.focused()&&!b.is.visible()&&!b.is.empty()},transition:function(){return d.transition&&void 0!==F.fn.transition}},is:{animating:function(){return a.hasClass(f.animating)},chrome:function(){return!!k.chrome&&!k.StyleMedia},hidden:function(){return a.hasClass(f.hidden)},inMessage:function(e){var t;if(e.target)return t=F(e.target),F.contains(D.documentElement,e.target)&&0<t.closest(g.message).length},empty:function(){return""===a.html()},visible:function(){return 0<a.filter(":visible").length},focused:function(){return 0<p.filter(":focus").length}},get:{settings:function(){F.isPlainObject(R)&&R.searchFullText&&(d.fullTextSearch=R.searchFullText,b.error(d.error.oldSearchSyntax,u)),d.ignoreDiacritics&&!String.prototype.normalize&&(d.ignoreDiacritics=!1,b.error(h.noNormalize,u))},inputEvent:function(){var e=p[0];return void 0!==e&&void 0!==e.oninput?"input":void 0!==e&&void 0!==e.onpropertychange?"propertychange":"keyup"},value:function(){return p.val()},results:function(){return v.data(c.results)},result:function(s,e){var r=!1;return s=void 0!==s?s:b.get.value(),e=void 0!==e?e:b.get.results(),"category"===d.type?(b.debug("Finding result that matches",s),F.each(e,function(e,t){if(Array.isArray(t.results)&&(r=b.search.object(s,t.results)[0]))return!1})):(b.debug("Finding result in results object",s),r=b.search.object(s,e)[0]),r||!1}},select:{firstResult:function(){b.verbose("Selecting first result"),o.first().addClass(f.active)}},set:{focus:function(){v.addClass(f.focus)},loading:function(){v.addClass(f.loading)},value:function(e){b.verbose("Setting search input value",e),p.val(e)},type:function(e){e=e||d.type,f[e]&&v.addClass(f[e])},buttonPressed:function(){s.addClass(f.pressed)}},remove:{loading:function(){v.removeClass(f.loading)},focus:function(){v.removeClass(f.focus)},buttonPressed:function(){s.removeClass(f.pressed)},diacritics:function(e){return d.ignoreDiacritics?e.normalize("NFD").replace(/[\u0300-\u036F]/g,""):e}},query:function(e){e=E(e)?e:function(){};var t=b.get.value(),s=b.read.cache(t);e=e||function(){},b.has.minimumCharacters()?(s?(b.debug("Reading result from cache",t),b.save.results(s.results),b.addResults(s.html),b.inject.id(s.results),e()):(b.debug("Querying for",t),F.isPlainObject(d.source)||Array.isArray(d.source)?(b.search.local(t),e()):b.can.useAPI()?b.search.remote(t,e):(b.error(h.source),e())),d.onSearchQuery.call(u,t)):b.hideResults()},search:{local:function(e){var t,s=b.search.object(e,d.source);b.set.loading(),b.save.results(s),b.debug("Returned full local search results",s),0<d.maxResults&&(b.debug("Using specified max results",s),s=s.slice(0,d.maxResults)),"category"===d.type&&(s=b.create.categoryResults(s)),t=b.generateResults({results:s}),b.remove.loading(),b.addResults(t),b.inject.id(s),b.write.cache(e,{html:t,results:s})},remote:function(e,t){t=E(t)?t:function(){},v.api("is loading")&&v.api("abort"),b.setup.api(e,t),v.api("query")},object:function(n,e,t){n=b.remove.diacritics(String(n));function i(e,t){var s=-1===F.inArray(t,a),r=-1===F.inArray(t,c),n=-1===F.inArray(t,o);s&&r&&n&&e.push(t)}var a=[],o=[],c=[],s=n.replace(r.escape,"\\$&"),u=new RegExp(r.beginsWith+s,"i");if(e=e||d.source,t=void 0!==t?t:d.searchFields,Array.isArray(t)||(t=[t]),void 0===e||!1===e)return b.error(h.source),[];var l=t.length-1;return F.each(e,function(e,s){var r=[];F.each(t,function(e,t){if("string"==typeof s[t]||"number"==typeof s[t]){t="string"==typeof s[t]?b.remove.diacritics(s[t]):s[t].toString();if("all"===d.fullTextSearch){if(r.push(t),e<l)return!0;t=r.join(" ")}"all"!==d.fullTextSearch&&-1!==t.search(u)?i(a,s):"exact"===d.fullTextSearch&&b.exactSearch(n,t)||"some"===d.fullTextSearch&&b.wordSearch(n,t)||"all"===d.fullTextSearch&&b.wordSearch(n,t,!0)?i(o,s):!0===d.fullTextSearch&&b.fuzzySearch(n,t)&&i(c,s)}})}),F.merge(o,c),F.merge(a,o),a}},exactSearch:function(e,t){return e=e.toLowerCase(),-1<(t=t.toLowerCase()).indexOf(e)},wordSearch:function(e,t,s){for(var r=e.split(/\s+/),n=r.length,i=!1,a=0;a<n&&!(!(i=b.exactSearch(r[a],t))&&s||i&&!s);a++);return i},fuzzySearch:function(e,t){var s=t.length,r=e.length;if("string"!=typeof e)return!1;if(e=e.toLowerCase(),t=t.toLowerCase(),s<r)return!1;if(r===s)return e===t;for(var n=0,i=0;n<r;n++){for(var a=!1,o=e.charCodeAt(n);i<s;)if(t.charCodeAt(i++)===o){a=!0;break}if(!a)return!1}return!0},parse:{response:function(e,t){Array.isArray(e)&&((s={})[i.results]=e,e=s);var s=b.generateResults(e);b.verbose("Parsing server response",e),void 0!==e&&void 0!==t&&void 0!==e[i.results]&&(b.addResults(s),b.inject.id(e[i.results]),b.write.cache(t,{html:s,results:e[i.results]}),b.save.results(e[i.results]))}},cancel:{query:function(){b.can.useAPI()&&v.api("abort")}},has:{minimumCharacters:function(){return b.get.value().length>=d.minCharacters},results:function(){return 0!==a.length&&""!==a.html()}},clear:{cache:function(e){var t=v.data(c.cache);e?t&&t[e]&&(b.debug("Removing value from cache",e),delete t[e],v.data(c.cache,t)):(b.debug("Clearing cache",e),v.removeData(c.cache))}},read:{cache:function(e){var t=v.data(c.cache);return!!d.cache&&(b.verbose("Checking cache for generated html for query",e),"object"==typeof t&&void 0!==t[e]&&t[e])}},create:{categoryResults:function(e){var s={};return F.each(e,function(e,t){t.category&&(void 0===s[t.category]?(b.verbose("Creating new category of results",t.category),s[t.category]={name:t.category,results:[t]}):s[t.category].results.push(t))}),s},id:function(e,t){var s,e=e+1;return void 0!==t?(t=String.fromCharCode(97+t),b.verbose("Creating category result id",s=t+e)):b.verbose("Creating result id",s=e),s},results:function(){0===a.length&&(a=F("<div />").addClass(f.results).appendTo(v))}},inject:{result:function(e,t,s){b.verbose("Injecting result into results");s=(void 0!==s?a.children().eq(s).children(g.results).first():a).children(g.result).eq(t);b.verbose("Injecting results metadata",s),s.data(c.result,e)},id:function(e){b.debug("Injecting unique ids into results");var s=0,r=0;return"category"===d.type?F.each(e,function(e,t){0<t.results.length&&(r=0,F.each(t.results,function(e,t){void 0===t.id&&(t.id=b.create.id(r,s)),b.inject.result(t,r,s),r++}),s++)}):F.each(e,function(e,t){void 0===t.id&&(t.id=b.create.id(r)),b.inject.result(t,r),r++}),e}},save:{results:function(e){b.verbose("Saving current search results to metadata",e),v.data(c.results,e)}},write:{cache:function(e,t){var s=void 0!==v.data(c.cache)?v.data(c.cache):{};d.cache&&(b.verbose("Writing generated html to cache",e,t),s[e]=t,v.data(c.cache,s))}},addResults:function(e){if(E(d.onResultsAdd)&&!1===d.onResultsAdd.call(a,e))return b.debug("onResultsAdd callback cancelled default action"),!1;e?(a.html(e),b.refreshResults(),d.selectFirstResult&&b.select.firstResult(),b.showResults()):b.hideResults(function(){a.empty()})},showResults:function(e){e=E(e)?e:function(){},y||!b.is.visible()&&b.has.results()&&(b.can.transition()?(b.debug("Showing results with css animations"),a.transition({animation:d.transition+" in",debug:d.debug,verbose:d.verbose,silent:d.silent,duration:d.duration,onShow:function(){var e=v.find(g.result).eq(0);b.ensureVisible(e)},onComplete:function(){e()},queue:!0})):(b.debug("Showing results with javascript"),a.stop().fadeIn(d.duration,d.easing)),d.onResultsOpen.call(a))},hideResults:function(e){e=E(e)?e:function(){},b.is.visible()&&(b.can.transition()?(b.debug("Hiding results with css animations"),a.transition({animation:d.transition+" out",debug:d.debug,verbose:d.verbose,silent:d.silent,duration:d.duration,onComplete:function(){e()},queue:!0})):(b.debug("Hiding results with javascript"),a.stop().fadeOut(d.duration,d.easing)),d.onResultsClose.call(a))},generateResults:function(e){b.debug("Generating html from response",e);var t=d.templates[d.type],s=F.isPlainObject(e[i.results])&&!F.isEmptyObject(e[i.results]),r=Array.isArray(e[i.results])&&0<e[i.results].length,n="";return s||r?(0<d.maxResults&&(s?"standard"===d.type&&b.error(h.maxResults):e[i.results]=e[i.results].slice(0,d.maxResults)),E(t)?n=t(e,i,d.preserveHTML):b.error(h.noTemplate,!1)):d.showNoResults&&(n=b.displayMessage(h.noResults,"empty",h.noResultsHeader)),d.onResults.call(u,e),n},displayMessage:function(e,t,s){return b.debug("Displaying message",e,t=t||"standard",s),b.addResults(d.templates.message(e,t,s)),d.templates.message(e,t,s)},setting:function(e,t){if(F.isPlainObject(e))F.extend(!0,d,e);else{if(void 0===t)return d[e];d[e]=t}},internal:function(e,t){if(F.isPlainObject(e))F.extend(!0,b,e);else{if(void 0===t)return b[e];b[e]=t}},debug:function(){!d.silent&&d.debug&&(d.performance?b.performance.log(arguments):(b.debug=Function.prototype.bind.call(console.info,console,d.name+":"),b.debug.apply(console,arguments)))},verbose:function(){!d.silent&&d.verbose&&d.debug&&(d.performance?b.performance.log(arguments):(b.verbose=Function.prototype.bind.call(console.info,console,d.name+":"),b.verbose.apply(console,arguments)))},error:function(){d.silent||(b.error=Function.prototype.bind.call(console.error,console,d.name+":"),b.error.apply(console,arguments))},performance:{log:function(e){var t,s;d.performance&&(s=(t=Date.now())-(w||t),w=t,T.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:u,"Execution Time":s})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(b.performance.display,500)},display:function(){var e=d.name+":",s=0;w=!1,clearTimeout(b.performance.timer),F.each(T,function(e,t){s+=t["Execution Time"]}),e+=" "+s+"ms",C&&(e+=" '"+C+"'"),1<x.length&&(e+=" ("+x.length+")"),0<T.length&&(console.groupCollapsed(e),console.table?console.table(T):F.each(T,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),T=[]}},invoke:function(r,e,t){var n,i,s,a=l;return e=e||q,t=t||u,"string"==typeof r&&void 0!==a&&(r=r.split(/[ .]/),n=r.length-1,F.each(r,function(e,t){var s=e!==n?t+r[e+1].charAt(0).toUpperCase()+r[e+1].slice(1):r;if(F.isPlainObject(a[s])&&e!==n)a=a[s];else{if(void 0!==a[s])return i=a[s],!1;{if(!F.isPlainObject(a[t])||e===n)return void 0!==a[t]?i=a[t]:b.error(h.method,r),!1;a=a[t]}}})),E(i)?s=i.apply(t,e):void 0!==i&&(s=i),Array.isArray(S)?S.push(s):void 0!==S?S=[S,s]:void 0!==s&&(S=s),i}};j?(void 0===l&&b.initialize(),b.invoke(A)):(void 0!==l&&l.invoke("destroy"),b.initialize())}),void 0!==S?S:this},F.fn.search.settings={name:"Search",namespace:"search",silent:!1,debug:!1,verbose:!1,performance:!0,type:"standard",minCharacters:1,selectFirstResult:!1,apiSettings:!1,source:!1,searchOnFocus:!0,searchFields:["id","title","description"],displayField:"",fullTextSearch:"exact",ignoreDiacritics:!1,automatic:!0,hideDelay:0,searchDelay:200,maxResults:7,cache:!0,showNoResults:!0,preserveHTML:!0,transition:"scale",duration:200,easing:"easeOutExpo",onSelect:!1,onResultsAdd:!1,onSearchQuery:function(e){},onResults:function(e){},onResultsOpen:function(){},onResultsClose:function(){},className:{animating:"animating",active:"active",category:"category",empty:"empty",focus:"focus",hidden:"hidden",loading:"loading",results:"results",pressed:"down"},error:{source:"Cannot search. No source used, and Fomantic API module was not included",noResultsHeader:"No Results",noResults:"Your search returned no results",noTemplate:"A valid template name was not specified.",oldSearchSyntax:"searchFullText setting has been renamed fullTextSearch for consistency, please adjust your settings.",serverError:"There was an issue querying the server.",maxResults:"Results must be an array to use maxResults setting",method:"The method you called is not defined.",noNormalize:'"ignoreDiacritics" setting will be ignored. Browser does not support String().normalize(). You may consider including <https://cdn.jsdelivr.net/npm/unorm@1.4.1/lib/unorm.min.js> as a polyfill.'},metadata:{cache:"cache",results:"results",result:"result"},regExp:{escape:/[$()*+./?[\\\]^{|}-]/g,beginsWith:"(?:\\s|^)"},fields:{categories:"results",categoryName:"name",categoryResults:"results",description:"description",image:"image",price:"price",results:"results",title:"title",url:"url",action:"action",actionText:"text",actionURL:"url"},selector:{prompt:".prompt",searchButton:".search.button",results:".results",message:".results > .message",category:".category",result:".result",title:".title, .name"},templates:{escape:function(e,t){if(t)return e;var s={"<":"<",">":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return s[e]}):e},message:function(e,t,s){var r="";return void 0!==e&&void 0!==t&&(r+='<div class="message '+t+'">',s&&(r+='<div class="header">'+s+"</div>"),r=r+' <div class="description">'+e+"</div></div>"),r},category:function(e,s,r){var n="",i=F.fn.search.settings.templates.escape;return void 0!==e[s.categoryResults]&&(F.each(e[s.categoryResults],function(e,t){void 0!==t[s.results]&&0<t.results.length&&(n+='<div class="category">',void 0!==t[s.categoryName]&&(n+='<div class="name">'+i(t[s.categoryName],r)+"</div>"),n+='<div class="results">',F.each(t.results,function(e,t){n+=t[s.url]?'<a class="result" href="'+t[s.url].replace(/"/g,"")+'">':'<a class="result">',void 0!==t[s.image]&&(n+='<div class="image"> <img src="'+t[s.image].replace(/"/g,"")+'"></div>'),n+='<div class="content">',void 0!==t[s.price]&&(n+='<div class="price">'+i(t[s.price],r)+"</div>"),void 0!==t[s.title]&&(n+='<div class="title">'+i(t[s.title],r)+"</div>"),void 0!==t[s.description]&&(n+='<div class="description">'+i(t[s.description],r)+"</div>"),n+="</div></a>"}),n+="</div></div>")}),e[s.action]&&(n+=!1===s.actionURL?'<div class="action">'+i(e[s.action][s.actionText],r)+"</div>":'<a href="'+e[s.action][s.actionURL].replace(/"/g,"")+'" class="action">'+i(e[s.action][s.actionText],r)+"</a>"),n)},standard:function(e,s,r){var n="",i=F.fn.search.settings.templates.escape;return void 0!==e[s.results]&&(F.each(e[s.results],function(e,t){n+=t[s.url]?'<a class="result" href="'+t[s.url].replace(/"/g,"")+'">':'<a class="result">',void 0!==t[s.image]&&(n+='<div class="image"> <img src="'+t[s.image].replace(/"/g,"")+'"></div>'),n+='<div class="content">',void 0!==t[s.price]&&(n+='<div class="price">'+i(t[s.price],r)+"</div>"),void 0!==t[s.title]&&(n+='<div class="title">'+i(t[s.title],r)+"</div>"),void 0!==t[s.description]&&(n+='<div class="description">'+i(t[s.description],r)+"</div>"),n+="</div></a>"}),e[s.action]&&(n+=!1===s.actionURL?'<div class="action">'+i(e[s.action][s.actionText],r)+"</div>":'<a href="'+e[s.action][s.actionURL].replace(/"/g,"")+'" class="action">'+i(e[s.action][s.actionText],r)+"</a>"),n)}}},F.extend(F.easing,{easeOutExpo:function(e){return 1===e?1:1-Math.pow(2,-10*e)}})}(jQuery,window,document);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.2-beta.
|
2
|
+
* # Fomantic-UI 2.9.2-beta.10+cf51e1c - Segment
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -363,7 +363,7 @@
|
|
363
363
|
bottom: 0;
|
364
364
|
margin-top: 0;
|
365
365
|
margin-bottom: 0;
|
366
|
-
box-shadow: 0 1px
|
366
|
+
box-shadow: 0 2px 1px -1px rgba(34, 36, 38, 0.15);
|
367
367
|
border-radius: 0 0 0.28571429rem 0.28571429rem;
|
368
368
|
}
|
369
369
|
|
@@ -756,7 +756,7 @@
|
|
756
756
|
margin-top: 0;
|
757
757
|
top: 0;
|
758
758
|
margin-bottom: 1rem;
|
759
|
-
box-shadow: 0 1px
|
759
|
+
box-shadow: 0 2px 1px -1px rgba(34, 36, 38, 0.15);
|
760
760
|
border-radius: 0 0 0.28571429rem 0.28571429rem;
|
761
761
|
}
|
762
762
|
.ui.segment[class*="bottom attached"]:last-child {
|