fomantic-ui 2.9.1-beta.24 → 2.9.1-beta.25
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/.eslint/eqeqeq-rule.js +18 -0
- package/.eslint/index.js +3 -0
- package/.eslintrc.js +1 -2
- 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 +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +17 -17
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +18 -17
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +11 -11
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +9 -9
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +1 -1
- package/dist/components/dropdown.js +103 -91
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +5 -5
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +1 -1
- package/dist/components/flyout.js +10 -10
- package/dist/components/flyout.min.css +1 -1
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +77 -60
- package/dist/components/form.min.css +1 -1
- 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 +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +4 -4
- 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 +5 -5
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +39 -31
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +12 -12
- 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 +6 -6
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- 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 +16 -16
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +5 -5
- 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 +13 -13
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +4 -4
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +50 -37
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +5 -5
- package/dist/components/state.min.js +2 -2
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +8 -8
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +17 -17
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +4 -4
- 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 +8 -8
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +12 -12
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +50 -50
- package/dist/semantic.js +462 -411
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/src/definitions/behaviors/api.js +16 -16
- package/src/definitions/behaviors/form.js +76 -59
- package/src/definitions/behaviors/state.js +4 -4
- package/src/definitions/behaviors/visibility.js +11 -11
- package/src/definitions/globals/site.js +3 -3
- package/src/definitions/modules/accordion.js +3 -3
- package/src/definitions/modules/calendar.js +17 -16
- package/src/definitions/modules/checkbox.js +10 -10
- package/src/definitions/modules/dimmer.js +8 -8
- package/src/definitions/modules/dropdown.js +102 -90
- package/src/definitions/modules/embed.js +4 -4
- package/src/definitions/modules/flyout.js +9 -9
- package/src/definitions/modules/modal.js +3 -3
- package/src/definitions/modules/nag.js +4 -4
- package/src/definitions/modules/popup.js +38 -30
- package/src/definitions/modules/progress.js +11 -11
- package/src/definitions/modules/rating.js +5 -5
- package/src/definitions/modules/search.js +15 -15
- package/src/definitions/modules/shape.js +4 -4
- package/src/definitions/modules/sidebar.js +12 -12
- package/src/definitions/modules/slider.js +49 -36
- package/src/definitions/modules/sticky.js +7 -7
- package/src/definitions/modules/tab.js +16 -16
- package/src/definitions/modules/toast.js +3 -3
- package/src/definitions/modules/transition.js +7 -7
- package/tasks/admin/components/init.js +1 -1
- package/tasks/admin/components/update.js +1 -1
- package/tasks/admin/distributions/create.js +4 -5
- package/tasks/admin/distributions/init.js +1 -1
- package/tasks/admin/distributions/update.js +1 -1
- package/tasks/config/project/config.js +2 -2
- package/tasks/config/project/install.js +8 -8
- package/tasks/config/project/release.js +1 -1
- package/tasks/config/tasks.js +2 -2
- package/tasks/docs/metadata.js +1 -1
- package/tasks/install.js +2 -2
- package/test/modules/module.spec.js +1 -1
@@ -0,0 +1,18 @@
|
|
1
|
+
const eslint = require('eslint');
|
2
|
+
const ruleComposer = require('eslint-rule-composer');
|
3
|
+
|
4
|
+
const rule = new eslint.Linter().getRules().get('eqeqeq');
|
5
|
+
|
6
|
+
module.exports = ruleComposer.filterReports(
|
7
|
+
rule,
|
8
|
+
(problem) => {
|
9
|
+
if (problem.node.type === 'BinaryExpression'
|
10
|
+
&& (problem.node.operator === '==' || problem.node.operator === '!=')
|
11
|
+
&& problem.node.right.type === 'Literal'
|
12
|
+
) {
|
13
|
+
return problem;
|
14
|
+
}
|
15
|
+
|
16
|
+
return false;
|
17
|
+
}
|
18
|
+
);
|
package/.eslint/index.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module.exports = {
|
2
2
|
rules: {
|
3
|
+
eqeqeq: require('./eqeqeq-rule'),
|
3
4
|
'no-extra-parens': require('./no-extra-parens-rule'),
|
4
5
|
},
|
5
6
|
configs: {
|
@@ -8,6 +9,8 @@ module.exports = {
|
|
8
9
|
'@internal/eslint-plugin',
|
9
10
|
],
|
10
11
|
rules: {
|
12
|
+
// fixes only variable == (or !=) literal expression
|
13
|
+
'@internal/eqeqeq': ['error', 'always'],
|
11
14
|
// https://github.com/eslint/eslint/issues/16626
|
12
15
|
// https://github.com/airbnb/javascript/blob/eslint-config-airbnb-v19.0.4/packages/eslint-config-airbnb-base/rules/errors.js#L66
|
13
16
|
'@internal/no-extra-parens': ['error', 'all', {
|
package/.eslintrc.js
CHANGED
@@ -85,7 +85,6 @@ module.exports = {
|
|
85
85
|
'unicorn/prefer-array-some': 'off', // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2007
|
86
86
|
'unicorn/prefer-module': 'off',
|
87
87
|
'unicorn/prevent-abbreviations': 'off',
|
88
|
-
'unicorn/switch-case-braces': ['error', 'avoid'],
|
89
88
|
'wrap-iife': ['error', 'inside'],
|
90
89
|
|
91
90
|
// TODO rules to be removed/fixed in v2.10.0 as fixes are not compatible with IE11
|
@@ -113,7 +112,7 @@ module.exports = {
|
|
113
112
|
'vars-on-top': 'off',
|
114
113
|
|
115
114
|
// TODO rules with a lot of errors to be fixed manually, fix in a separate PR
|
116
|
-
eqeqeq: 'off', // about
|
115
|
+
eqeqeq: 'off', // about 20 errors to be fixed manually
|
117
116
|
'global-require': 'off', // about 30 errors to be fixed manually
|
118
117
|
'no-shadow': 'off', // about 220 errors to be fixed manually
|
119
118
|
'no-shadow-restricted-names': 'off', // TODO https://github.com/fomantic/Fomantic-UI/pull/2604
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.25+bbe4e58 - Accordion
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -482,16 +482,16 @@
|
|
482
482
|
query = query.split(/[ .]/);
|
483
483
|
maxDepth = query.length - 1;
|
484
484
|
$.each(query, function (depth, value) {
|
485
|
-
var camelCaseValue = depth
|
485
|
+
var camelCaseValue = depth !== maxDepth
|
486
486
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
487
487
|
: query;
|
488
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
488
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
489
489
|
object = object[camelCaseValue];
|
490
490
|
} else if (object[camelCaseValue] !== undefined) {
|
491
491
|
found = object[camelCaseValue];
|
492
492
|
|
493
493
|
return false;
|
494
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
494
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
495
495
|
object = object[value];
|
496
496
|
} else if (object[value] !== undefined) {
|
497
497
|
found = object[value];
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.1-beta.
|
2
|
+
* # Fomantic UI - 2.9.1-beta.25+bbe4e58
|
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(k,T,A){"use strict";T=T!==A&&T.Math===Math?T:globalThis,k.fn.accordion=function(m){var v,h=k(this),b=Date.now(),y=[],C=m,O="string"==typeof C,x=[].slice.call(arguments,1);return h.each(function(){var e,a=k.isPlainObject(m)?k.extend(!0,{},k.fn.accordion.settings,m):k.extend({},k.fn.accordion.settings),s=a.className,n=a.namespace,l=a.selector,r=a.error,t="."+n,i="module-"+n,o=h.selector||"",c=k(this),d=c.find(l.title),u=c.find(l.content),g=this,p=c.data(i),f={initialize:function(){f.debug("Initializing",c),f.bind.events(),a.observeChanges&&f.observeChanges(),f.instantiate()},instantiate:function(){p=f,c.data(i,f)},destroy:function(){f.debug("Destroying previous instance",c),c.off(t).removeData(i)},refresh:function(){d=c.find(l.title),u=c.find(l.content)},observeChanges:function(){"MutationObserver"in T&&((e=new MutationObserver(function(e){f.debug("DOM tree modified, updating selector cache"),f.refresh()})).observe(g,{childList:!0,subtree:!0}),f.debug("Setting up mutation observer",e))},bind:{events:function(){f.debug("Binding delegated events"),c.on(a.on+t,l.trigger,f.event.click)}},event:{click:function(e){0===k(e.target).closest(l.ignore).length&&f.toggle.call(this)}},toggle:function(e){var e=e!==A?"number"==typeof e?d.eq(e):k(e).closest(l.title):k(this).closest(l.title),n=e.next(u),t=n.hasClass(s.animating),n=n.hasClass(s.active),i=n&&!t,n=!n&&t;f.debug("Toggling visibility of content",e),i||n?a.collapsible?f.close.call(e):f.debug("Cannot close accordion content collapsing is disabled"):f.open.call(e)},open:function(e){var e=e!==A?"number"==typeof e?d.eq(e):k(e).closest(l.title):k(this).closest(l.title),n=e.next(u),t=n.hasClass(s.animating);n.hasClass(s.active)||t?f.debug("Accordion already open, skipping",n):(f.debug("Opening accordion content",e),a.onOpening.call(n),a.onChanging.call(n),a.exclusive&&f.closeOthers.call(e),e.addClass(s.active),n.stop(!0,!0).addClass(s.animating),a.animateChildren&&(k.fn.transition!==A&&c.transition("is supported")?n.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:a.debug,verbose:a.verbose,silent:a.silent,duration:a.duration,skipInlineHidden:!0,onComplete:function(){n.children().removeClass(s.transition)}}):n.children().stop(!0,!0).animate({opacity:1},a.duration,f.resetOpacity)),n.slideDown(a.duration,a.easing,function(){n.removeClass(s.animating).addClass(s.active),f.reset.display.call(this),a.onOpen.call(this),a.onChange.call(this)}))},close:function(e){var e=e!==A?"number"==typeof e?d.eq(e):k(e).closest(l.title):k(this).closest(l.title),n=e.next(u),t=n.hasClass(s.animating),i=n.hasClass(s.active);!i&&!(!i&&t)||i&&t||(f.debug("Closing accordion content",n),a.onClosing.call(n),a.onChanging.call(n),e.removeClass(s.active),n.stop(!0,!0).addClass(s.animating),a.animateChildren&&(k.fn.transition!==A&&c.transition("is supported")?n.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:a.debug,verbose:a.verbose,silent:a.silent,duration:a.duration,skipInlineHidden:!0}):n.children().stop(!0,!0).animate({opacity:0},a.duration,f.resetOpacity)),n.slideUp(a.duration,a.easing,function(){n.removeClass(s.animating).removeClass(s.active),f.reset.display.call(this),a.onClose.call(this),a.onChange.call(this)}))},closeOthers:function(e){var n,e=e!==A?d.eq(e):k(this).closest(l.title),t=e.parents(l.content).prev(l.title),e=e.closest(l.accordion),i=l.title+"."+s.active+":visible",o=l.content+"."+s.active+":visible",o=a.closeNested?(n=e.find(i).not(t)).next(u):(n=e.find(i).not(t),e=e.find(o).find(i).not(t),(n=n.not(e)).next(u));0<n.length&&(f.debug("Exclusive enabled, closing other content",n),n.removeClass(s.active),o.removeClass(s.animating).stop(!0,!0),a.animateChildren&&(k.fn.transition!==A&&c.transition("is supported")?o.children().transition({animation:"fade out",useFailSafe:!0,debug:a.debug,verbose:a.verbose,silent:a.silent,duration:a.duration,skipInlineHidden:!0}):o.children().stop(!0,!0).animate({opacity:0},a.duration,f.resetOpacity)),o.slideUp(a.duration,a.easing,function(){k(this).removeClass(s.active),f.reset.display.call(this)}))},reset:{display:function(){f.verbose("Removing inline display from element",this);var e=k(this);e.css("display",""),""===e.attr("style")&&e.attr("style","").removeAttr("style")},opacity:function(){f.verbose("Removing inline opacity from element",this);var e=k(this);e.css("opacity",""),""===e.attr("style")&&e.attr("style","").removeAttr("style")}},setting:function(e,n){if(f.debug("Changing setting",e,n),k.isPlainObject(e))k.extend(!0,a,e);else{if(n===A)return a[e];k.isPlainObject(a[e])?k.extend(!0,a[e],n):a[e]=n}},internal:function(e,n){if(f.debug("Changing internal",e,n),n===A)return f[e];k.isPlainObject(e)?k.extend(!0,f,e):f[e]=n},debug:function(){!a.silent&&a.debug&&(a.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,a.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),f.verbose.apply(console,arguments)))},error:function(){a.silent||(f.error=Function.prototype.bind.call(console.error,console,a.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var n,t;a.performance&&(t=(n=Date.now())-(b||n),b=n,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:g,"Execution Time":t})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var e=a.name+":",t=0;b=!1,clearTimeout(f.performance.timer),k.each(y,function(e,n){t+=n["Execution Time"]}),e+=" "+t+"ms",o&&(e+=" '"+o+"'"),(console.group!==A||console.table!==A)&&0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):k.each(y,function(e,n){console.log(n.Name+": "+n["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(i,e,n){var o,a,t,s,l=p;return e=e||x,n=n||g,"string"==typeof i&&l!==A&&(i=i.split(/[ .]/),o=i.length-1,k.each(i,function(e,n){var t=e
|
11
|
+
!function(k,T,A){"use strict";T=T!==A&&T.Math===Math?T:globalThis,k.fn.accordion=function(m){var v,h=k(this),b=Date.now(),y=[],C=m,O="string"==typeof C,x=[].slice.call(arguments,1);return h.each(function(){var e,a=k.isPlainObject(m)?k.extend(!0,{},k.fn.accordion.settings,m):k.extend({},k.fn.accordion.settings),s=a.className,n=a.namespace,l=a.selector,r=a.error,t="."+n,i="module-"+n,o=h.selector||"",c=k(this),d=c.find(l.title),u=c.find(l.content),g=this,p=c.data(i),f={initialize:function(){f.debug("Initializing",c),f.bind.events(),a.observeChanges&&f.observeChanges(),f.instantiate()},instantiate:function(){p=f,c.data(i,f)},destroy:function(){f.debug("Destroying previous instance",c),c.off(t).removeData(i)},refresh:function(){d=c.find(l.title),u=c.find(l.content)},observeChanges:function(){"MutationObserver"in T&&((e=new MutationObserver(function(e){f.debug("DOM tree modified, updating selector cache"),f.refresh()})).observe(g,{childList:!0,subtree:!0}),f.debug("Setting up mutation observer",e))},bind:{events:function(){f.debug("Binding delegated events"),c.on(a.on+t,l.trigger,f.event.click)}},event:{click:function(e){0===k(e.target).closest(l.ignore).length&&f.toggle.call(this)}},toggle:function(e){var e=e!==A?"number"==typeof e?d.eq(e):k(e).closest(l.title):k(this).closest(l.title),n=e.next(u),t=n.hasClass(s.animating),n=n.hasClass(s.active),i=n&&!t,n=!n&&t;f.debug("Toggling visibility of content",e),i||n?a.collapsible?f.close.call(e):f.debug("Cannot close accordion content collapsing is disabled"):f.open.call(e)},open:function(e){var e=e!==A?"number"==typeof e?d.eq(e):k(e).closest(l.title):k(this).closest(l.title),n=e.next(u),t=n.hasClass(s.animating);n.hasClass(s.active)||t?f.debug("Accordion already open, skipping",n):(f.debug("Opening accordion content",e),a.onOpening.call(n),a.onChanging.call(n),a.exclusive&&f.closeOthers.call(e),e.addClass(s.active),n.stop(!0,!0).addClass(s.animating),a.animateChildren&&(k.fn.transition!==A&&c.transition("is supported")?n.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:a.debug,verbose:a.verbose,silent:a.silent,duration:a.duration,skipInlineHidden:!0,onComplete:function(){n.children().removeClass(s.transition)}}):n.children().stop(!0,!0).animate({opacity:1},a.duration,f.resetOpacity)),n.slideDown(a.duration,a.easing,function(){n.removeClass(s.animating).addClass(s.active),f.reset.display.call(this),a.onOpen.call(this),a.onChange.call(this)}))},close:function(e){var e=e!==A?"number"==typeof e?d.eq(e):k(e).closest(l.title):k(this).closest(l.title),n=e.next(u),t=n.hasClass(s.animating),i=n.hasClass(s.active);!i&&!(!i&&t)||i&&t||(f.debug("Closing accordion content",n),a.onClosing.call(n),a.onChanging.call(n),e.removeClass(s.active),n.stop(!0,!0).addClass(s.animating),a.animateChildren&&(k.fn.transition!==A&&c.transition("is supported")?n.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:a.debug,verbose:a.verbose,silent:a.silent,duration:a.duration,skipInlineHidden:!0}):n.children().stop(!0,!0).animate({opacity:0},a.duration,f.resetOpacity)),n.slideUp(a.duration,a.easing,function(){n.removeClass(s.animating).removeClass(s.active),f.reset.display.call(this),a.onClose.call(this),a.onChange.call(this)}))},closeOthers:function(e){var n,e=e!==A?d.eq(e):k(this).closest(l.title),t=e.parents(l.content).prev(l.title),e=e.closest(l.accordion),i=l.title+"."+s.active+":visible",o=l.content+"."+s.active+":visible",o=a.closeNested?(n=e.find(i).not(t)).next(u):(n=e.find(i).not(t),e=e.find(o).find(i).not(t),(n=n.not(e)).next(u));0<n.length&&(f.debug("Exclusive enabled, closing other content",n),n.removeClass(s.active),o.removeClass(s.animating).stop(!0,!0),a.animateChildren&&(k.fn.transition!==A&&c.transition("is supported")?o.children().transition({animation:"fade out",useFailSafe:!0,debug:a.debug,verbose:a.verbose,silent:a.silent,duration:a.duration,skipInlineHidden:!0}):o.children().stop(!0,!0).animate({opacity:0},a.duration,f.resetOpacity)),o.slideUp(a.duration,a.easing,function(){k(this).removeClass(s.active),f.reset.display.call(this)}))},reset:{display:function(){f.verbose("Removing inline display from element",this);var e=k(this);e.css("display",""),""===e.attr("style")&&e.attr("style","").removeAttr("style")},opacity:function(){f.verbose("Removing inline opacity from element",this);var e=k(this);e.css("opacity",""),""===e.attr("style")&&e.attr("style","").removeAttr("style")}},setting:function(e,n){if(f.debug("Changing setting",e,n),k.isPlainObject(e))k.extend(!0,a,e);else{if(n===A)return a[e];k.isPlainObject(a[e])?k.extend(!0,a[e],n):a[e]=n}},internal:function(e,n){if(f.debug("Changing internal",e,n),n===A)return f[e];k.isPlainObject(e)?k.extend(!0,f,e):f[e]=n},debug:function(){!a.silent&&a.debug&&(a.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,a.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),f.verbose.apply(console,arguments)))},error:function(){a.silent||(f.error=Function.prototype.bind.call(console.error,console,a.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var n,t;a.performance&&(t=(n=Date.now())-(b||n),b=n,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:g,"Execution Time":t})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var e=a.name+":",t=0;b=!1,clearTimeout(f.performance.timer),k.each(y,function(e,n){t+=n["Execution Time"]}),e+=" "+t+"ms",o&&(e+=" '"+o+"'"),(console.group!==A||console.table!==A)&&0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):k.each(y,function(e,n){console.log(n.Name+": "+n["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(i,e,n){var o,a,t,s,l=p;return e=e||x,n=n||g,"string"==typeof i&&l!==A&&(i=i.split(/[ .]/),o=i.length-1,k.each(i,function(e,n){var t=e!==o?n+i[e+1].charAt(0).toUpperCase()+i[e+1].slice(1):i;if(k.isPlainObject(l[t])&&e!==o)l=l[t];else{if(l[t]!==A)return a=l[t],!1;{if(!k.isPlainObject(l[n])||e===o)return l[n]!==A?a=l[n]:f.error(r.method,i),!1;l=l[n]}}})),"function"==typeof(s=a)&&"number"!=typeof s.nodeType?t=a.apply(n,e):a!==A&&(t=a),Array.isArray(v)?v.push(t):v!==A?v=[v,t]:t!==A&&(v=t),a}};O?(p===A&&f.initialize(),f.invoke(C)):(p!==A&&p.invoke("destroy"),f.initialize())}),v!==A?v:this},k.fn.accordion.settings={name:"Accordion",namespace:"accordion",silent:!1,debug:!1,verbose:!1,performance:!0,on:"click",observeChanges:!0,exclusive:!0,collapsible:!0,closeNested:!1,animateChildren:!0,duration:350,easing:"easeOutQuad",onOpening:function(){},onClosing:function(){},onChanging:function(){},onOpen:function(){},onClose:function(){},onChange:function(){},error:{method:"The method you called is not defined"},className:{active:"active",animating:"animating",transition:"transition"},selector:{accordion:".accordion",title:".title",trigger:".title",ignore:".ui.dropdown",content:".content"}},k.extend(k.easing,{easeOutQuad:function(e){return 1-(1-e)*(1-e)}})}(jQuery,window,void document);
|
package/dist/components/ad.css
CHANGED
package/dist/components/api.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.25+bbe4e58 - API
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -12,7 +12,7 @@
|
|
12
12
|
'use strict';
|
13
13
|
|
14
14
|
function isWindow(obj) {
|
15
|
-
return obj
|
15
|
+
return obj !== null && obj === obj.window;
|
16
16
|
}
|
17
17
|
|
18
18
|
function isFunction(obj) {
|
@@ -117,7 +117,7 @@
|
|
117
117
|
$module
|
118
118
|
.on(triggerEvent + eventNamespace, module.event.trigger)
|
119
119
|
;
|
120
|
-
} else if (settings.on
|
120
|
+
} else if (settings.on === 'now') {
|
121
121
|
module.debug('Querying API endpoint immediately');
|
122
122
|
module.query();
|
123
123
|
}
|
@@ -296,7 +296,7 @@
|
|
296
296
|
},
|
297
297
|
loading: function () {
|
298
298
|
return module.request
|
299
|
-
? module.request.state()
|
299
|
+
? module.request.state() === 'pending'
|
300
300
|
: false;
|
301
301
|
},
|
302
302
|
abortedRequest: function (xhr) {
|
@@ -334,13 +334,13 @@
|
|
334
334
|
return module.cancelled || false;
|
335
335
|
},
|
336
336
|
successful: function () {
|
337
|
-
return module.request && module.request.state()
|
337
|
+
return module.request && module.request.state() === 'resolved';
|
338
338
|
},
|
339
339
|
failure: function () {
|
340
|
-
return module.request && module.request.state()
|
340
|
+
return module.request && module.request.state() === 'rejected';
|
341
341
|
},
|
342
342
|
complete: function () {
|
343
|
-
return module.request && (module.request.state()
|
343
|
+
return module.request && (module.request.state() === 'resolved' || module.request.state() === 'rejected');
|
344
344
|
},
|
345
345
|
},
|
346
346
|
|
@@ -478,7 +478,7 @@
|
|
478
478
|
while (nameKeys.length > 0) {
|
479
479
|
var k = nameKeys.pop();
|
480
480
|
|
481
|
-
if (k
|
481
|
+
if (k === '' && !Array.isArray(value)) { // foo[]
|
482
482
|
value = build([], pushes[pushKey]++, value);
|
483
483
|
} else if (settings.regExp.fixed.test(k)) { // foo[n]
|
484
484
|
value = build([], k, value);
|
@@ -525,7 +525,7 @@
|
|
525
525
|
event: {
|
526
526
|
trigger: function (event) {
|
527
527
|
module.query();
|
528
|
-
if (event.type
|
528
|
+
if (event.type === 'submit' || event.type === 'click') {
|
529
529
|
event.preventDefault();
|
530
530
|
}
|
531
531
|
},
|
@@ -614,15 +614,15 @@
|
|
614
614
|
response = module.get.responseFromXHR(xhr),
|
615
615
|
errorMessage = module.get.errorFromRequest(response, status, httpMessage)
|
616
616
|
;
|
617
|
-
if (status
|
617
|
+
if (status === 'aborted') {
|
618
618
|
module.debug('XHR Aborted (Most likely caused by page navigation or CORS Policy)', status, httpMessage);
|
619
619
|
settings.onAbort.call(context, status, $module, xhr);
|
620
620
|
|
621
621
|
return true;
|
622
622
|
}
|
623
|
-
if (status
|
623
|
+
if (status === 'invalid') {
|
624
624
|
module.debug('JSON did not pass success test. A server-side error has most likely occurred', response);
|
625
|
-
} else if (status
|
625
|
+
} else if (status === 'error') {
|
626
626
|
if (xhr !== undefined) {
|
627
627
|
module.debug('XHR produced a server error', status, httpMessage);
|
628
628
|
// make sure we have an error to display to console
|
@@ -829,12 +829,12 @@
|
|
829
829
|
return data;
|
830
830
|
},
|
831
831
|
event: function () {
|
832
|
-
if (isWindow(element) || settings.on
|
832
|
+
if (isWindow(element) || settings.on === 'now') {
|
833
833
|
module.debug('API called without element, no events attached');
|
834
834
|
|
835
835
|
return false;
|
836
836
|
}
|
837
|
-
if (settings.on
|
837
|
+
if (settings.on === 'auto') {
|
838
838
|
if ($module.is('input')) {
|
839
839
|
return element.oninput !== undefined
|
840
840
|
? 'input'
|
@@ -1004,17 +1004,17 @@
|
|
1004
1004
|
query = query.split(/[ .]/);
|
1005
1005
|
maxDepth = query.length - 1;
|
1006
1006
|
$.each(query, function (depth, value) {
|
1007
|
-
var camelCaseValue = depth
|
1007
|
+
var camelCaseValue = depth !== maxDepth
|
1008
1008
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
1009
1009
|
: query
|
1010
1010
|
;
|
1011
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
1011
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
1012
1012
|
object = object[camelCaseValue];
|
1013
1013
|
} else if (object[camelCaseValue] !== undefined) {
|
1014
1014
|
found = object[camelCaseValue];
|
1015
1015
|
|
1016
1016
|
return false;
|
1017
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
1017
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
1018
1018
|
object = object[value];
|
1019
1019
|
} else if (object[value] !== undefined) {
|
1020
1020
|
found = object[value];
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.1-beta.
|
2
|
+
* # Fomantic UI - 2.9.1-beta.25+bbe4e58
|
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(O,P,j,C){"use strict";function E(e){return null!=e&&e===e.window}function F(e){return"function"==typeof e&&"number"!=typeof e.nodeType}P=P!==C&&P.Math===Math?P:globalThis,O.fn.api=function(q){var x,e=F(this)?O(P):O(this),A=e.selector||"",k=Date.now(),S=[],T=q,w="string"==typeof T,D=[].slice.call(arguments,1);return e.each(function(){var a,n,r,e,s,o,f=O.isPlainObject(q)?O.extend(!0,{},O.fn.api.settings,q):O.extend({},O.fn.api.settings),t=f.namespace,i=f.metadata,u=f.selector,c=f.error,d=f.className,l="."+t,p="module-"+t,g=O(this),m=g.closest(u.form),b=f.stateContext?[P,j].indexOf(f.stateContext)<0?O(j).find(f.stateContext):O(f.stateContext):g,v=this,h=b[0],y=g.data(p),R={initialize:function(){w||(o=f.data,R.bind.events()),R.instantiate()},instantiate:function(){R.verbose("Storing instance of module",R),y=R,g.data(p,y)},destroy:function(){R.verbose("Destroying previous module for",v),g.removeData(p).off(l)},bind:{events:function(){var e=R.get.event();e?(R.verbose("Attaching API events to element",e),g.on(e+l,R.event.trigger)):"now"==f.on&&(R.debug("Querying API endpoint immediately"),R.query())}},decode:{json:function(e){if(e!==C&&"string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}},read:{cachedResponse:function(e){var t;if(P.Storage!==C)return t=sessionStorage.getItem(e+R.get.normalizedData()),R.debug("Using cached response",e,f.data,t),R.decode.json(t);R.error(c.noStorage)}},write:{cachedResponse:function(e,t){P.Storage===C?R.error(c.noStorage):(O.isPlainObject(t)&&(t=JSON.stringify(t)),sessionStorage.setItem(e+R.get.normalizedData(),t),R.verbose("Storing cached response for url",e,f.data,t))}},query:function(){if(R.is.disabled())R.debug("Element is disabled API request aborted");else{if(R.is.loading()){if(!f.interruptRequests)return void R.debug("Cancelling request, previous request is still pending");R.debug("Interrupting previous request"),R.abort()}if(f.defaultData&&O.extend(!0,f.urlData,R.get.defaultData()),f.serializeForm&&(f.data=R.add.formData(o||f.data)),!1===(n=R.get.settings()))return R.cancelled=!0,void R.error(c.beforeSend);if(R.cancelled=!1,(r=R.get.templatedURL())||R.is.mocked()){if((r=R.add.urlData(r))||R.is.mocked()){if(n.url=f.base+r,a=O.extend(!0,{},f,{type:f.method||f.type,data:e,url:f.base+r,beforeSend:f.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),R.debug("Querying URL",a.url),R.verbose("Using AJAX settings",a),"local"===f.cache&&R.read.cachedResponse(r))return R.debug("Response returned from local cache"),R.request=R.create.request(),void R.request.resolveWith(h,[R.read.cachedResponse(r)]);f.throttle?f.throttleFirstRequest||R.timer?(R.debug("Throttling request",f.throttle),clearTimeout(R.timer),R.timer=setTimeout(function(){R.timer&&delete R.timer,R.debug("Sending throttled request",e,a.method),R.send.request()},f.throttle)):(R.debug("Sending request",e,a.method),R.send.request(),R.timer=setTimeout(function(){},f.throttle)):(R.debug("Sending request",e,a.method),R.send.request())}}else R.error(c.missingURL)}},should:{removeError:function(){return!0===f.hideError||"auto"===f.hideError&&!R.is.form()}},is:{disabled:function(){return 0<g.filter(u.disabled).length},expectingJSON:function(){return"json"===f.dataType||"jsonp"===f.dataType},form:function(){return g.is("form")||b.is("form")},mocked:function(){return f.mockResponse||f.mockResponseAsync||f.response||f.responseAsync},input:function(){return g.is("input")},loading:function(){return!!R.request&&"pending"==R.request.state()},abortedRequest:function(e){return e&&e.readyState!==C&&0===e.readyState?(R.verbose("XHR request determined to be aborted"),!0):(R.verbose("XHR request was not aborted"),!1)},validResponse:function(e){return R.is.expectingJSON()&&F(f.successTest)?(R.debug("Checking JSON returned success",f.successTest,e),f.successTest(e)?(R.debug("Response passed success test",e),!0):(R.debug("Response failed success test",e),!1)):(R.verbose("Response is not JSON, skipping validation",f.successTest,e),!0)}},was:{cancelled:function(){return R.cancelled||!1},successful:function(){return R.request&&"resolved"==R.request.state()},failure:function(){return R.request&&"rejected"==R.request.state()},complete:function(){return R.request&&("resolved"==R.request.state()||"rejected"==R.request.state())}},add:{urlData:function(o,a){var e,t;return o&&(e=o.match(f.regExp.required),t=o.match(f.regExp.optional),a=a||f.urlData,e&&(R.debug("Looking for required URL variables",e),O.each(e,function(e,t){var r=-1!==t.indexOf("$")?t.slice(2,-1):t.slice(1,-1),n=O.isPlainObject(a)&&a[r]!==C?a[r]:g.data(r)!==C?g.data(r):b.data(r)!==C?b.data(r):a[r];if(n===C)return R.error(c.requiredParameter,r,o),o=!1;R.verbose("Found required variable",r,n),n=f.encodeParameters?R.get.urlEncodedValue(n):n,o=o.replace(t,n)})),t&&(R.debug("Looking for optional URL variables",e),O.each(t,function(e,t){var r=-1!==t.indexOf("$")?t.slice(3,-1):t.slice(2,-1),n=O.isPlainObject(a)&&a[r]!==C?a[r]:g.data(r)!==C?g.data(r):b.data(r)!==C?b.data(r):a[r];o=n!==C?(R.verbose("Optional variable Found",r,n),o.replace(t,n)):(R.verbose("Optional variable not found",r),-1!==o.indexOf("/"+t)?o.replace("/"+t,""):o.replace(t,""))}))),o},formData:function(r){var e,n,u,c,d,l={},t="formdata"===f.serializeForm;return r=r||o||f.data,e=O.isPlainObject(r),t?(l=new FormData(m[0]),f.processData=f.processData!==C&&f.processData,f.contentType=f.contentType!==C&&f.contentType):(n=m.serializeArray(),u={},c={},d=function(e,t,r){return e[t]=r,e},O.each(O('input[type="file"]',m),function(e,r){O.each(O(r)[0].files,function(e,t){n.push({name:r.name,value:t})})}),O.each(n,function(e,t){if(f.regExp.validate.test(t.name)){var r="checkbox"===O('[name="'+t.name+'"]',m).attr("type"),n=parseFloat(t.value),o=r&&"on"===t.value||"true"===t.value||(String(n)===t.value?n:"false"!==t.value&&t.value),a=t.name.match(f.regExp.key)||[],s=t.name.replace(/\[]$/,"");s in u?Array.isArray(c[s])?c[s].push(o):c[s]=[c[s],o]:(u[s]=0,c[s]=o),-1===s.indexOf("[]")&&(o=c[s]);for(;0<a.length;){var i=a.pop();""!=i||Array.isArray(o)?f.regExp.fixed.test(i)?o=d([],i,o):f.regExp.named.test(i)&&(o=d({},i,o)):o=d([],u[s]++,o)}l=O.extend(!0,l,o)}})),r=e?(R.debug("Extending existing data with form data",r,l),t?(O.each(Object.keys(r),function(e,t){l.append(t,r[t])}),l):O.extend(!0,{},r,l)):(R.debug("Adding form data",l),l)}},send:{request:function(){R.set.loading(),R.request=R.create.request(),R.is.mocked()?R.mockedXHR=R.create.mockedXHR():R.xhr=R.create.xhr(),f.onRequest.call(h,R.request,R.xhr)}},event:{trigger:function(e){R.query(),"submit"!=e.type&&"click"!=e.type||e.preventDefault()},xhr:{always:function(){},done:function(e,t,r){var n=this,o=Date.now()-s,o=f.loadingDuration-o,a=!!F(f.onResponse)&&(R.is.expectingJSON()&&!f.rawResponse?f.onResponse.call(n,O.extend(!0,{},e)):f.onResponse.call(n,e)),o=0<o?o:0;a&&(R.debug("Modified API response in onResponse callback",f.onResponse,a,e),e=a),0<o&&R.debug("Response completed early delaying state change by",o),setTimeout(function(){R.is.validResponse(e)?R.request.resolveWith(n,[e,r]):R.request.rejectWith(n,[r,"invalid"])},o)},fail:function(e,t,r){var n=this,o=Date.now()-s,o=f.loadingDuration-o;0<(o=0<o?o:0)&&R.debug("Response completed early delaying state change by",o),setTimeout(function(){R.is.abortedRequest(e)?R.request.rejectWith(n,[e,"aborted",r]):R.request.rejectWith(n,[e,"error",t,r])},o)}},request:{done:function(e,t){R.debug("Successful API Response",e),"local"===f.cache&&r&&(R.write.cachedResponse(r,e),R.debug("Saving server response locally",R.cache)),f.onSuccess.call(h,e,g,t)},complete:function(e,t){var r,n;R.was.successful()?(n=e,r=t):n=R.get.responseFromXHR(r=e),R.remove.loading(),f.onComplete.call(h,n,g,r)},fail:function(e,t,r){var n=R.get.responseFromXHR(e),o=R.get.errorFromRequest(n,t,r);if("aborted"==t)return R.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,r),f.onAbort.call(h,t,g,e),!0;"invalid"==t?R.debug("JSON did not pass success test. A server-side error has most likely occurred",n):"error"==t&&e!==C&&(R.debug("XHR produced a server error",t,r),(e.status<200||300<=e.status)&&r!==C&&""!==r&&R.error(c.statusMessage+r,a.url),f.onError.call(h,o,g,e)),f.errorDuration&&"aborted"!==t&&(R.debug("Adding error state"),R.set.error(),R.should.removeError()&&setTimeout(R.remove.error,f.errorDuration)),R.debug("API Request failed",o,e),f.onFailure.call(h,n,g,e)}}},create:{request:function(){return O.Deferred().always(R.event.request.complete).done(R.event.request.done).fail(R.event.request.fail)},mockedXHR:function(){var e=f.mockResponse||f.response,t=f.mockResponseAsync||f.responseAsync,r=O.Deferred().always(R.event.xhr.complete).done(R.event.xhr.done).fail(R.event.xhr.fail);return e?(e=F(e)?(R.debug("Using specified synchronous callback",e),e.call(h,n)):(R.debug("Using settings specified response",e),e),r.resolveWith(h,[e,!1,{responseText:e}])):F(t)&&(e=function(e){R.debug("Async callback returned response",e),e?r.resolveWith(h,[e,!1,{responseText:e}]):r.rejectWith(h,[{responseText:e},!1,!1])},R.debug("Using specified async response callback",t),t.call(h,n,e)),r},xhr:function(){var e=O.ajax(a).always(R.event.xhr.always).done(R.event.xhr.done).fail(R.event.xhr.fail);return R.verbose("Created server request",e,a),e}},set:{error:function(){R.verbose("Adding error state to element",b),b.addClass(d.error)},loading:function(){R.verbose("Adding loading state to element",b),b.addClass(d.loading),s=Date.now()}},remove:{error:function(){R.verbose("Removing error state from element",b),b.removeClass(d.error)},loading:function(){R.verbose("Removing loading state from element",b),b.removeClass(d.loading)}},get:{normalizedData:function(){return"string"==typeof f.data?f.data:JSON.stringify(f.data,Object.keys(f.data).sort())},responseFromXHR:function(e){return!!O.isPlainObject(e)&&(R.is.expectingJSON()?R.decode.json(e.responseText):e.responseText)},errorFromRequest:function(e,t,r){return O.isPlainObject(e)&&e.error!==C?e.error:f.error[t]!==C?f.error[t]:r},request:function(){return R.request||!1},xhr:function(){return R.xhr||!1},settings:function(){var e=f.beforeSend.call(g,f);return e&&(e.success!==C&&(R.debug("Legacy success callback detected",e),R.error(c.legacyParameters,e.success),e.onSuccess=e.success),e.failure!==C&&(R.debug("Legacy failure callback detected",e),R.error(c.legacyParameters,e.failure),e.onFailure=e.failure),e.complete!==C&&(R.debug("Legacy complete callback detected",e),R.error(c.legacyParameters,e.complete),e.onComplete=e.complete)),e===C&&R.error(c.noReturnedValue),!1===e?e:e!==C?O.extend(!0,{},e):O.extend(!0,{},f)},urlEncodedValue:function(e){var t=P.decodeURIComponent(e),r=P.encodeURIComponent(e);return t!==e?(R.debug("URL value is already encoded, avoiding double encoding",e),e):(R.verbose("Encoding value using encodeURIComponent",e,r),r)},defaultData:function(){var e={};return E(v)||(R.is.input()?e.value=g.val():R.is.form()||(e.text=g.text())),e},event:function(){return E(v)||"now"==f.on?(R.debug("API called without element, no events attached"),!1):"auto"==f.on?g.is("input")?v.oninput!==C?"input":v.onpropertychange!==C?"propertychange":"keyup":g.is("form")?"submit":"click":f.on},templatedURL:function(e){if(e=e||g.data(i.action)||f.action||!1,r=g.data(i.url)||f.url||!1)return R.debug("Using specified url",r),r;if(e){if(R.debug("Looking up url for action",e,f.api),f.api[e]===C&&!R.is.mocked())return void R.error(c.missingAction,f.action,f.api);r=f.api[e]}else R.is.form()&&(r=g.attr("action")||b.attr("action")||!1,R.debug("No url or action specified, defaulting to form action",r));return r}},abort:function(){var e=R.get.xhr();e&&"resolved"!==e.state()&&(R.debug("Cancelling API request"),e.abort())},reset:function(){R.remove.error(),R.remove.loading()},setting:function(e,t){if(R.debug("Changing setting",e,t),O.isPlainObject(e))O.extend(!0,f,e);else{if(t===C)return f[e];O.isPlainObject(f[e])?O.extend(!0,f[e],t):f[e]=t}},internal:function(e,t){if(O.isPlainObject(e))O.extend(!0,R,e);else{if(t===C)return R[e];R[e]=t}},debug:function(){!f.silent&&f.debug&&(f.performance?R.performance.log(arguments):(R.debug=Function.prototype.bind.call(console.info,console,f.name+":"),R.debug.apply(console,arguments)))},verbose:function(){!f.silent&&f.verbose&&f.debug&&(f.performance?R.performance.log(arguments):(R.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),R.verbose.apply(console,arguments)))},error:function(){f.silent||(R.error=Function.prototype.bind.call(console.error,console,f.name+":"),R.error.apply(console,arguments))},performance:{log:function(e){var t,r;f.performance&&(r=(t=Date.now())-(k||t),k=t,S.push({Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":r})),clearTimeout(R.performance.timer),R.performance.timer=setTimeout(R.performance.display,500)},display:function(){var e=f.name+":",r=0;k=!1,clearTimeout(R.performance.timer),O.each(S,function(e,t){r+=t["Execution Time"]}),e+=" "+r+"ms",A&&(e+=" '"+A+"'"),(console.group!==C||console.table!==C)&&0<S.length&&(console.groupCollapsed(e),console.table?console.table(S):O.each(S,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),S=[]}},invoke:function(n,e,t){var o,a,r,s=y;return e=e||D,t=t||v,"string"==typeof n&&s!==C&&(n=n.split(/[ .]/),o=n.length-1,O.each(n,function(e,t){var r=e!=o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(O.isPlainObject(s[r])&&e!=o)s=s[r];else{if(s[r]!==C)return a=s[r],!1;{if(!O.isPlainObject(s[t])||e==o)return s[t]!==C?a=s[t]:R.error(c.method,n),!1;s=s[t]}}})),F(a)?r=a.apply(t,e):a!==C&&(r=a),Array.isArray(x)?x.push(r):x!==C?x=[x,r]:r!==C&&(x=r),a}};w?(y===C&&R.initialize(),R.invoke(T)):(y!==C&&y.invoke("destroy"),R.initialize())}),x!==C?x:this},O.api=O.fn.api,O.api.settings={name:"API",namespace:"api",debug:!1,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,hideError:"auto",errorDuration:2e3,encodeParameters:!0,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,response:!1,responseAsync:!1,rawResponse:!0,beforeSend:function(e){return e},beforeXHR:function(e){},onRequest:function(e,t){},onResponse:!1,onSuccess:function(e,t){},onComplete:function(e,t){},onFailure:function(e,t){},onError:function(e,t){},onAbort:function(e,t){},successTest:!1,error:{beforeSend:"The before send function has aborted the request",error:"There was an error with your request",exitConditions:"API Request Aborted. Exit conditions met",JSONParse:"JSON could not be parsed during error handling",legacyParameters:"You are using legacy API success callback names",method:"The method you called is not defined",missingAction:"API action used but no url was defined",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",noStorage:"Caching responses locally requires session storage",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},regExp:{required:/{\$*[\da-z]+}/gi,optional:/{\/\$*[\da-z]+}/gi,validate:/^[_a-z][\w-]*(?:\[[\w-]*])*$/i,key:/[\w-]+|(?=\[])/gi,push:/^$/,fixed:/^\d+$/,named:/^[\w-]+$/i},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,document);
|
11
|
+
!function(O,P,j,C){"use strict";function E(e){return null!==e&&e===e.window}function F(e){return"function"==typeof e&&"number"!=typeof e.nodeType}P=P!==C&&P.Math===Math?P:globalThis,O.fn.api=function(q){var x,e=F(this)?O(P):O(this),A=e.selector||"",k=Date.now(),S=[],T=q,w="string"==typeof T,D=[].slice.call(arguments,1);return e.each(function(){var a,n,r,e,s,o,f=O.isPlainObject(q)?O.extend(!0,{},O.fn.api.settings,q):O.extend({},O.fn.api.settings),t=f.namespace,i=f.metadata,u=f.selector,c=f.error,d=f.className,l="."+t,p="module-"+t,g=O(this),m=g.closest(u.form),b=f.stateContext?[P,j].indexOf(f.stateContext)<0?O(j).find(f.stateContext):O(f.stateContext):g,v=this,h=b[0],y=g.data(p),R={initialize:function(){w||(o=f.data,R.bind.events()),R.instantiate()},instantiate:function(){R.verbose("Storing instance of module",R),y=R,g.data(p,y)},destroy:function(){R.verbose("Destroying previous module for",v),g.removeData(p).off(l)},bind:{events:function(){var e=R.get.event();e?(R.verbose("Attaching API events to element",e),g.on(e+l,R.event.trigger)):"now"===f.on&&(R.debug("Querying API endpoint immediately"),R.query())}},decode:{json:function(e){if(e!==C&&"string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}},read:{cachedResponse:function(e){var t;if(P.Storage!==C)return t=sessionStorage.getItem(e+R.get.normalizedData()),R.debug("Using cached response",e,f.data,t),R.decode.json(t);R.error(c.noStorage)}},write:{cachedResponse:function(e,t){P.Storage===C?R.error(c.noStorage):(O.isPlainObject(t)&&(t=JSON.stringify(t)),sessionStorage.setItem(e+R.get.normalizedData(),t),R.verbose("Storing cached response for url",e,f.data,t))}},query:function(){if(R.is.disabled())R.debug("Element is disabled API request aborted");else{if(R.is.loading()){if(!f.interruptRequests)return void R.debug("Cancelling request, previous request is still pending");R.debug("Interrupting previous request"),R.abort()}if(f.defaultData&&O.extend(!0,f.urlData,R.get.defaultData()),f.serializeForm&&(f.data=R.add.formData(o||f.data)),!1===(n=R.get.settings()))return R.cancelled=!0,void R.error(c.beforeSend);if(R.cancelled=!1,(r=R.get.templatedURL())||R.is.mocked()){if((r=R.add.urlData(r))||R.is.mocked()){if(n.url=f.base+r,a=O.extend(!0,{},f,{type:f.method||f.type,data:e,url:f.base+r,beforeSend:f.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),R.debug("Querying URL",a.url),R.verbose("Using AJAX settings",a),"local"===f.cache&&R.read.cachedResponse(r))return R.debug("Response returned from local cache"),R.request=R.create.request(),void R.request.resolveWith(h,[R.read.cachedResponse(r)]);f.throttle?f.throttleFirstRequest||R.timer?(R.debug("Throttling request",f.throttle),clearTimeout(R.timer),R.timer=setTimeout(function(){R.timer&&delete R.timer,R.debug("Sending throttled request",e,a.method),R.send.request()},f.throttle)):(R.debug("Sending request",e,a.method),R.send.request(),R.timer=setTimeout(function(){},f.throttle)):(R.debug("Sending request",e,a.method),R.send.request())}}else R.error(c.missingURL)}},should:{removeError:function(){return!0===f.hideError||"auto"===f.hideError&&!R.is.form()}},is:{disabled:function(){return 0<g.filter(u.disabled).length},expectingJSON:function(){return"json"===f.dataType||"jsonp"===f.dataType},form:function(){return g.is("form")||b.is("form")},mocked:function(){return f.mockResponse||f.mockResponseAsync||f.response||f.responseAsync},input:function(){return g.is("input")},loading:function(){return!!R.request&&"pending"===R.request.state()},abortedRequest:function(e){return e&&e.readyState!==C&&0===e.readyState?(R.verbose("XHR request determined to be aborted"),!0):(R.verbose("XHR request was not aborted"),!1)},validResponse:function(e){return R.is.expectingJSON()&&F(f.successTest)?(R.debug("Checking JSON returned success",f.successTest,e),f.successTest(e)?(R.debug("Response passed success test",e),!0):(R.debug("Response failed success test",e),!1)):(R.verbose("Response is not JSON, skipping validation",f.successTest,e),!0)}},was:{cancelled:function(){return R.cancelled||!1},successful:function(){return R.request&&"resolved"===R.request.state()},failure:function(){return R.request&&"rejected"===R.request.state()},complete:function(){return R.request&&("resolved"===R.request.state()||"rejected"===R.request.state())}},add:{urlData:function(o,a){var e,t;return o&&(e=o.match(f.regExp.required),t=o.match(f.regExp.optional),a=a||f.urlData,e&&(R.debug("Looking for required URL variables",e),O.each(e,function(e,t){var r=-1!==t.indexOf("$")?t.slice(2,-1):t.slice(1,-1),n=O.isPlainObject(a)&&a[r]!==C?a[r]:g.data(r)!==C?g.data(r):b.data(r)!==C?b.data(r):a[r];if(n===C)return R.error(c.requiredParameter,r,o),o=!1;R.verbose("Found required variable",r,n),n=f.encodeParameters?R.get.urlEncodedValue(n):n,o=o.replace(t,n)})),t&&(R.debug("Looking for optional URL variables",e),O.each(t,function(e,t){var r=-1!==t.indexOf("$")?t.slice(3,-1):t.slice(2,-1),n=O.isPlainObject(a)&&a[r]!==C?a[r]:g.data(r)!==C?g.data(r):b.data(r)!==C?b.data(r):a[r];o=n!==C?(R.verbose("Optional variable Found",r,n),o.replace(t,n)):(R.verbose("Optional variable not found",r),-1!==o.indexOf("/"+t)?o.replace("/"+t,""):o.replace(t,""))}))),o},formData:function(r){var e,n,u,c,d,l={},t="formdata"===f.serializeForm;return r=r||o||f.data,e=O.isPlainObject(r),t?(l=new FormData(m[0]),f.processData=f.processData!==C&&f.processData,f.contentType=f.contentType!==C&&f.contentType):(n=m.serializeArray(),u={},c={},d=function(e,t,r){return e[t]=r,e},O.each(O('input[type="file"]',m),function(e,r){O.each(O(r)[0].files,function(e,t){n.push({name:r.name,value:t})})}),O.each(n,function(e,t){if(f.regExp.validate.test(t.name)){var r="checkbox"===O('[name="'+t.name+'"]',m).attr("type"),n=parseFloat(t.value),o=r&&"on"===t.value||"true"===t.value||(String(n)===t.value?n:"false"!==t.value&&t.value),a=t.name.match(f.regExp.key)||[],s=t.name.replace(/\[]$/,"");s in u?Array.isArray(c[s])?c[s].push(o):c[s]=[c[s],o]:(u[s]=0,c[s]=o),-1===s.indexOf("[]")&&(o=c[s]);for(;0<a.length;){var i=a.pop();""!==i||Array.isArray(o)?f.regExp.fixed.test(i)?o=d([],i,o):f.regExp.named.test(i)&&(o=d({},i,o)):o=d([],u[s]++,o)}l=O.extend(!0,l,o)}})),r=e?(R.debug("Extending existing data with form data",r,l),t?(O.each(Object.keys(r),function(e,t){l.append(t,r[t])}),l):O.extend(!0,{},r,l)):(R.debug("Adding form data",l),l)}},send:{request:function(){R.set.loading(),R.request=R.create.request(),R.is.mocked()?R.mockedXHR=R.create.mockedXHR():R.xhr=R.create.xhr(),f.onRequest.call(h,R.request,R.xhr)}},event:{trigger:function(e){R.query(),"submit"!==e.type&&"click"!==e.type||e.preventDefault()},xhr:{always:function(){},done:function(e,t,r){var n=this,o=Date.now()-s,o=f.loadingDuration-o,a=!!F(f.onResponse)&&(R.is.expectingJSON()&&!f.rawResponse?f.onResponse.call(n,O.extend(!0,{},e)):f.onResponse.call(n,e)),o=0<o?o:0;a&&(R.debug("Modified API response in onResponse callback",f.onResponse,a,e),e=a),0<o&&R.debug("Response completed early delaying state change by",o),setTimeout(function(){R.is.validResponse(e)?R.request.resolveWith(n,[e,r]):R.request.rejectWith(n,[r,"invalid"])},o)},fail:function(e,t,r){var n=this,o=Date.now()-s,o=f.loadingDuration-o;0<(o=0<o?o:0)&&R.debug("Response completed early delaying state change by",o),setTimeout(function(){R.is.abortedRequest(e)?R.request.rejectWith(n,[e,"aborted",r]):R.request.rejectWith(n,[e,"error",t,r])},o)}},request:{done:function(e,t){R.debug("Successful API Response",e),"local"===f.cache&&r&&(R.write.cachedResponse(r,e),R.debug("Saving server response locally",R.cache)),f.onSuccess.call(h,e,g,t)},complete:function(e,t){var r,n;R.was.successful()?(n=e,r=t):n=R.get.responseFromXHR(r=e),R.remove.loading(),f.onComplete.call(h,n,g,r)},fail:function(e,t,r){var n=R.get.responseFromXHR(e),o=R.get.errorFromRequest(n,t,r);if("aborted"===t)return R.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,r),f.onAbort.call(h,t,g,e),!0;"invalid"===t?R.debug("JSON did not pass success test. A server-side error has most likely occurred",n):"error"===t&&e!==C&&(R.debug("XHR produced a server error",t,r),(e.status<200||300<=e.status)&&r!==C&&""!==r&&R.error(c.statusMessage+r,a.url),f.onError.call(h,o,g,e)),f.errorDuration&&"aborted"!==t&&(R.debug("Adding error state"),R.set.error(),R.should.removeError()&&setTimeout(R.remove.error,f.errorDuration)),R.debug("API Request failed",o,e),f.onFailure.call(h,n,g,e)}}},create:{request:function(){return O.Deferred().always(R.event.request.complete).done(R.event.request.done).fail(R.event.request.fail)},mockedXHR:function(){var e=f.mockResponse||f.response,t=f.mockResponseAsync||f.responseAsync,r=O.Deferred().always(R.event.xhr.complete).done(R.event.xhr.done).fail(R.event.xhr.fail);return e?(e=F(e)?(R.debug("Using specified synchronous callback",e),e.call(h,n)):(R.debug("Using settings specified response",e),e),r.resolveWith(h,[e,!1,{responseText:e}])):F(t)&&(e=function(e){R.debug("Async callback returned response",e),e?r.resolveWith(h,[e,!1,{responseText:e}]):r.rejectWith(h,[{responseText:e},!1,!1])},R.debug("Using specified async response callback",t),t.call(h,n,e)),r},xhr:function(){var e=O.ajax(a).always(R.event.xhr.always).done(R.event.xhr.done).fail(R.event.xhr.fail);return R.verbose("Created server request",e,a),e}},set:{error:function(){R.verbose("Adding error state to element",b),b.addClass(d.error)},loading:function(){R.verbose("Adding loading state to element",b),b.addClass(d.loading),s=Date.now()}},remove:{error:function(){R.verbose("Removing error state from element",b),b.removeClass(d.error)},loading:function(){R.verbose("Removing loading state from element",b),b.removeClass(d.loading)}},get:{normalizedData:function(){return"string"==typeof f.data?f.data:JSON.stringify(f.data,Object.keys(f.data).sort())},responseFromXHR:function(e){return!!O.isPlainObject(e)&&(R.is.expectingJSON()?R.decode.json(e.responseText):e.responseText)},errorFromRequest:function(e,t,r){return O.isPlainObject(e)&&e.error!==C?e.error:f.error[t]!==C?f.error[t]:r},request:function(){return R.request||!1},xhr:function(){return R.xhr||!1},settings:function(){var e=f.beforeSend.call(g,f);return e&&(e.success!==C&&(R.debug("Legacy success callback detected",e),R.error(c.legacyParameters,e.success),e.onSuccess=e.success),e.failure!==C&&(R.debug("Legacy failure callback detected",e),R.error(c.legacyParameters,e.failure),e.onFailure=e.failure),e.complete!==C&&(R.debug("Legacy complete callback detected",e),R.error(c.legacyParameters,e.complete),e.onComplete=e.complete)),e===C&&R.error(c.noReturnedValue),!1===e?e:e!==C?O.extend(!0,{},e):O.extend(!0,{},f)},urlEncodedValue:function(e){var t=P.decodeURIComponent(e),r=P.encodeURIComponent(e);return t!==e?(R.debug("URL value is already encoded, avoiding double encoding",e),e):(R.verbose("Encoding value using encodeURIComponent",e,r),r)},defaultData:function(){var e={};return E(v)||(R.is.input()?e.value=g.val():R.is.form()||(e.text=g.text())),e},event:function(){return E(v)||"now"===f.on?(R.debug("API called without element, no events attached"),!1):"auto"===f.on?g.is("input")?v.oninput!==C?"input":v.onpropertychange!==C?"propertychange":"keyup":g.is("form")?"submit":"click":f.on},templatedURL:function(e){if(e=e||g.data(i.action)||f.action||!1,r=g.data(i.url)||f.url||!1)return R.debug("Using specified url",r),r;if(e){if(R.debug("Looking up url for action",e,f.api),f.api[e]===C&&!R.is.mocked())return void R.error(c.missingAction,f.action,f.api);r=f.api[e]}else R.is.form()&&(r=g.attr("action")||b.attr("action")||!1,R.debug("No url or action specified, defaulting to form action",r));return r}},abort:function(){var e=R.get.xhr();e&&"resolved"!==e.state()&&(R.debug("Cancelling API request"),e.abort())},reset:function(){R.remove.error(),R.remove.loading()},setting:function(e,t){if(R.debug("Changing setting",e,t),O.isPlainObject(e))O.extend(!0,f,e);else{if(t===C)return f[e];O.isPlainObject(f[e])?O.extend(!0,f[e],t):f[e]=t}},internal:function(e,t){if(O.isPlainObject(e))O.extend(!0,R,e);else{if(t===C)return R[e];R[e]=t}},debug:function(){!f.silent&&f.debug&&(f.performance?R.performance.log(arguments):(R.debug=Function.prototype.bind.call(console.info,console,f.name+":"),R.debug.apply(console,arguments)))},verbose:function(){!f.silent&&f.verbose&&f.debug&&(f.performance?R.performance.log(arguments):(R.verbose=Function.prototype.bind.call(console.info,console,f.name+":"),R.verbose.apply(console,arguments)))},error:function(){f.silent||(R.error=Function.prototype.bind.call(console.error,console,f.name+":"),R.error.apply(console,arguments))},performance:{log:function(e){var t,r;f.performance&&(r=(t=Date.now())-(k||t),k=t,S.push({Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":r})),clearTimeout(R.performance.timer),R.performance.timer=setTimeout(R.performance.display,500)},display:function(){var e=f.name+":",r=0;k=!1,clearTimeout(R.performance.timer),O.each(S,function(e,t){r+=t["Execution Time"]}),e+=" "+r+"ms",A&&(e+=" '"+A+"'"),(console.group!==C||console.table!==C)&&0<S.length&&(console.groupCollapsed(e),console.table?console.table(S):O.each(S,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),S=[]}},invoke:function(n,e,t){var o,a,r,s=y;return e=e||D,t=t||v,"string"==typeof n&&s!==C&&(n=n.split(/[ .]/),o=n.length-1,O.each(n,function(e,t){var r=e!==o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(O.isPlainObject(s[r])&&e!==o)s=s[r];else{if(s[r]!==C)return a=s[r],!1;{if(!O.isPlainObject(s[t])||e===o)return s[t]!==C?a=s[t]:R.error(c.method,n),!1;s=s[t]}}})),F(a)?r=a.apply(t,e):a!==C&&(r=a),Array.isArray(x)?x.push(r):x!==C?x=[x,r]:r!==C&&(x=r),a}};w?(y===C&&R.initialize(),R.invoke(T)):(y!==C&&y.invoke("destroy"),R.initialize())}),x!==C?x:this},O.api=O.fn.api,O.api.settings={name:"API",namespace:"api",debug:!1,verbose:!1,performance:!0,api:{},cache:!0,interruptRequests:!0,on:"auto",stateContext:!1,loadingDuration:0,hideError:"auto",errorDuration:2e3,encodeParameters:!0,action:!1,url:!1,base:"",urlData:{},defaultData:!0,serializeForm:!1,throttle:0,throttleFirstRequest:!0,method:"get",data:{},dataType:"json",mockResponse:!1,mockResponseAsync:!1,response:!1,responseAsync:!1,rawResponse:!0,beforeSend:function(e){return e},beforeXHR:function(e){},onRequest:function(e,t){},onResponse:!1,onSuccess:function(e,t){},onComplete:function(e,t){},onFailure:function(e,t){},onError:function(e,t){},onAbort:function(e,t){},successTest:!1,error:{beforeSend:"The before send function has aborted the request",error:"There was an error with your request",exitConditions:"API Request Aborted. Exit conditions met",JSONParse:"JSON could not be parsed during error handling",legacyParameters:"You are using legacy API success callback names",method:"The method you called is not defined",missingAction:"API action used but no url was defined",missingURL:"No URL specified for api event",noReturnedValue:"The beforeSend callback must return a settings object, beforeSend ignored.",noStorage:"Caching responses locally requires session storage",parseError:"There was an error parsing your request",requiredParameter:"Missing a required URL parameter: ",statusMessage:"Server gave an error: ",timeout:"Your request timed out"},regExp:{required:/{\$*[\da-z]+}/gi,optional:/{\/\$*[\da-z]+}/gi,validate:/^[_a-z][\w-]*(?:\[[\w-]*])*$/i,key:/[\w-]+|(?=\[])/gi,push:/^$/,fixed:/^\d+$/,named:/^[\w-]+$/i},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,document);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.1-beta.
|
2
|
+
* # Fomantic-UI 2.9.1-beta.25+bbe4e58 - Calendar
|
3
3
|
* https://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -662,7 +662,7 @@
|
|
662
662
|
? -1
|
663
663
|
: (keyCode === 38
|
664
664
|
? -bigIncrement
|
665
|
-
: (keyCode
|
665
|
+
: (keyCode === 39 ? 1 : bigIncrement)); // eslint-disable-line unicorn/no-nested-ternary
|
666
666
|
increment *= mode === 'minute' ? settings.minTimeGap : 1;
|
667
667
|
var focusDate = module.get.focusDate() || module.get.date() || new Date();
|
668
668
|
var year = focusDate.getFullYear() + (mode === 'year' ? increment : 0);
|
@@ -695,11 +695,12 @@
|
|
695
695
|
break;
|
696
696
|
}
|
697
697
|
// escape key
|
698
|
-
case 27:
|
698
|
+
case 27: {
|
699
699
|
module.popup('hide');
|
700
700
|
event.stopPropagation();
|
701
701
|
|
702
702
|
break;
|
703
|
+
}
|
703
704
|
}
|
704
705
|
}
|
705
706
|
|
@@ -1138,19 +1139,19 @@
|
|
1138
1139
|
} else if (d !== null && typeof d === 'object') {
|
1139
1140
|
if (d[metadata.year]) {
|
1140
1141
|
if (typeof d[metadata.year] === 'number') {
|
1141
|
-
blocked = date.getFullYear()
|
1142
|
+
blocked = date.getFullYear() === d[metadata.year];
|
1142
1143
|
} else if (Array.isArray(d[metadata.year])) {
|
1143
1144
|
blocked = d[metadata.year].indexOf(date.getFullYear()) > -1;
|
1144
1145
|
}
|
1145
1146
|
} else if (d[metadata.month]) {
|
1146
1147
|
if (typeof d[metadata.month] === 'number') {
|
1147
|
-
blocked = date.getMonth()
|
1148
|
+
blocked = date.getMonth() === d[metadata.month];
|
1148
1149
|
} else if (Array.isArray(d[metadata.month])) {
|
1149
1150
|
blocked = d[metadata.month].indexOf(date.getMonth()) > -1;
|
1150
1151
|
} else if (d[metadata.month] instanceof Date) {
|
1151
1152
|
var sdate = module.helper.sanitiseDate(d[metadata.month]);
|
1152
1153
|
|
1153
|
-
blocked = (date.getMonth()
|
1154
|
+
blocked = (date.getMonth() === sdate.getMonth()) && (date.getFullYear() === sdate.getFullYear());
|
1154
1155
|
}
|
1155
1156
|
} else if (d[metadata.date] && mode === 'day') {
|
1156
1157
|
if (d[metadata.date] instanceof Date) {
|
@@ -1187,7 +1188,7 @@
|
|
1187
1188
|
|
1188
1189
|
if (d[metadata.days]) {
|
1189
1190
|
if (typeof d[metadata.days] === 'number') {
|
1190
|
-
blocked = date.getDay()
|
1191
|
+
blocked = date.getDay() === d[metadata.days];
|
1191
1192
|
} else if (Array.isArray(d[metadata.days])) {
|
1192
1193
|
blocked = d[metadata.days].indexOf(date.getDay()) > -1;
|
1193
1194
|
}
|
@@ -1195,7 +1196,7 @@
|
|
1195
1196
|
|
1196
1197
|
if (d[metadata.hours]) {
|
1197
1198
|
if (typeof d[metadata.hours] === 'number') {
|
1198
|
-
blocked = blocked && date.getHours()
|
1199
|
+
blocked = blocked && date.getHours() === d[metadata.hours];
|
1199
1200
|
} else if (Array.isArray(d[metadata.hours])) {
|
1200
1201
|
blocked = blocked && d[metadata.hours].indexOf(date.getHours()) > -1;
|
1201
1202
|
}
|
@@ -1241,7 +1242,7 @@
|
|
1241
1242
|
}
|
1242
1243
|
if (d !== null && typeof d === 'object') {
|
1243
1244
|
if (d[metadata.year]) {
|
1244
|
-
if (typeof d[metadata.year] === 'number' && date.getFullYear()
|
1245
|
+
if (typeof d[metadata.year] === 'number' && date.getFullYear() === d[metadata.year]) {
|
1245
1246
|
return d;
|
1246
1247
|
}
|
1247
1248
|
if (Array.isArray(d[metadata.year])) {
|
@@ -1250,7 +1251,7 @@
|
|
1250
1251
|
}
|
1251
1252
|
}
|
1252
1253
|
} else if (d[metadata.month]) {
|
1253
|
-
if (typeof d[metadata.month] === 'number' && date.getMonth()
|
1254
|
+
if (typeof d[metadata.month] === 'number' && date.getMonth() === d[metadata.month]) {
|
1254
1255
|
return d;
|
1255
1256
|
}
|
1256
1257
|
if (Array.isArray(d[metadata.month])) {
|
@@ -1259,7 +1260,7 @@
|
|
1259
1260
|
}
|
1260
1261
|
} else if (d[metadata.month] instanceof Date) {
|
1261
1262
|
var sdate = module.helper.sanitiseDate(d[metadata.month]);
|
1262
|
-
if ((date.getMonth()
|
1263
|
+
if ((date.getMonth() === sdate.getMonth()) && (date.getFullYear() === sdate.getFullYear())) {
|
1263
1264
|
return d;
|
1264
1265
|
}
|
1265
1266
|
}
|
@@ -1286,7 +1287,7 @@
|
|
1286
1287
|
var d;
|
1287
1288
|
var hourCheck = function (date, d) {
|
1288
1289
|
if (d[metadata.hours]) {
|
1289
|
-
if (typeof d[metadata.hours] === 'number' && date.getHours()
|
1290
|
+
if (typeof d[metadata.hours] === 'number' && date.getHours() === d[metadata.hours]) {
|
1290
1291
|
return d;
|
1291
1292
|
}
|
1292
1293
|
if (Array.isArray(d[metadata.hours])) {
|
@@ -1298,12 +1299,12 @@
|
|
1298
1299
|
};
|
1299
1300
|
for (var i = 0; i < hours.length; i++) {
|
1300
1301
|
d = hours[i];
|
1301
|
-
if (typeof d === 'number' && date.getHours()
|
1302
|
+
if (typeof d === 'number' && date.getHours() === d) {
|
1302
1303
|
return null;
|
1303
1304
|
}
|
1304
1305
|
if (d !== null && typeof d === 'object') {
|
1305
1306
|
if (d[metadata.days] && hourCheck(date, d)) {
|
1306
|
-
if (typeof d[metadata.days] === 'number' && date.getDay()
|
1307
|
+
if (typeof d[metadata.days] === 'number' && date.getDay() === d[metadata.days]) {
|
1307
1308
|
return d;
|
1308
1309
|
}
|
1309
1310
|
if (Array.isArray(d[metadata.days])) {
|
@@ -1523,17 +1524,17 @@
|
|
1523
1524
|
query = query.split(/[ .]/);
|
1524
1525
|
maxDepth = query.length - 1;
|
1525
1526
|
$.each(query, function (depth, value) {
|
1526
|
-
var camelCaseValue = depth
|
1527
|
+
var camelCaseValue = depth !== maxDepth
|
1527
1528
|
? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
|
1528
1529
|
: query
|
1529
1530
|
;
|
1530
|
-
if ($.isPlainObject(object[camelCaseValue]) && (depth
|
1531
|
+
if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
|
1531
1532
|
object = object[camelCaseValue];
|
1532
1533
|
} else if (object[camelCaseValue] !== undefined) {
|
1533
1534
|
found = object[camelCaseValue];
|
1534
1535
|
|
1535
1536
|
return false;
|
1536
|
-
} else if ($.isPlainObject(object[value]) && (depth
|
1537
|
+
} else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
|
1537
1538
|
object = object[value];
|
1538
1539
|
} else if (object[value] !== undefined) {
|
1539
1540
|
found = object[value];
|