fomantic-ui 2.9.0-beta.264 → 2.9.0-beta.267
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/nightly.yml +2 -0
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +1 -1
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +69 -14
- 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 +2 -2
- 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 +1 -1
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +1 -1
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +1 -1
- package/dist/components/container.min.css +1 -1
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +1 -1
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +1 -1
- 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 +1 -1
- package/dist/components/dropdown.min.css +1 -1
- package/dist/components/dropdown.min.js +1 -1
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +1 -1
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +1 -1
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +1 -1
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +1 -1
- package/dist/components/modal.js +1 -1
- package/dist/components/modal.min.css +1 -1
- package/dist/components/modal.min.js +1 -1
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +1 -1
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +1 -1
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +1 -1
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +1 -1
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +1 -1
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +1 -1
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +1 -1
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +1 -1
- package/dist/components/search.js +1 -1
- package/dist/components/search.min.css +1 -1
- package/dist/components/search.min.js +1 -1
- package/dist/components/segment.css +1 -1
- package/dist/components/segment.min.css +1 -1
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +1 -1
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +1 -1
- package/dist/components/sidebar.css +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.min.css +1 -1
- package/dist/components/sidebar.min.js +1 -1
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +1 -1
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.min.js +1 -1
- package/dist/components/state.js +1 -1
- package/dist/components/state.min.js +1 -1
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +1 -1
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +1 -1
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +1 -1
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +1 -1
- package/dist/components/table.css +1 -1
- package/dist/components/table.min.css +1 -1
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +1 -1
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +1 -1
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +1 -1
- package/dist/components/visibility.js +1 -1
- package/dist/components/visibility.min.js +1 -1
- package/dist/semantic.css +49 -49
- package/dist/semantic.js +94 -39
- package/dist/semantic.min.css +1 -1
- package/dist/semantic.min.js +2 -2
- package/package.json +1 -1
- package/scripts/nightly-version.js +39 -39
- package/src/definitions/behaviors/api.js +68 -13
- package/src/definitions/modules/calendar.js +1 -1
@@ -22,8 +22,10 @@ jobs:
|
|
22
22
|
- name: update nightly version
|
23
23
|
run: node ./scripts/nightly-version.js
|
24
24
|
- name: fomantic install & build
|
25
|
+
if: ${{ success() }}
|
25
26
|
run: npx gulp install
|
26
27
|
- name: publish to npm
|
28
|
+
if: ${{ success() }}
|
27
29
|
run: |
|
28
30
|
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
|
29
31
|
npm publish --tag nightly
|
package/dist/components/ad.css
CHANGED
package/dist/components/api.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Fomantic-UI 2.9.0-beta.
|
2
|
+
* # Fomantic-UI 2.9.0-beta.267+acc903b - API
|
3
3
|
* http://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -428,28 +428,76 @@ $.api = $.fn.api = function(parameters) {
|
|
428
428
|
formData: function(data) {
|
429
429
|
var
|
430
430
|
formData = {},
|
431
|
-
hasOtherData
|
431
|
+
hasOtherData,
|
432
|
+
useFormDataApi = settings.serializeForm === 'formdata'
|
432
433
|
;
|
433
434
|
data = data || originalData || settings.data;
|
434
435
|
hasOtherData = $.isPlainObject(data);
|
435
436
|
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
437
|
+
if (useFormDataApi) {
|
438
|
+
formData = new FormData($form[0]);
|
439
|
+
settings.processData = typeof settings.processData !== 'undefined' ? settings.processData : false;
|
440
|
+
settings.contentType = typeof settings.contentType !== 'undefined' ? settings.contentType : false;
|
441
|
+
} else {
|
442
|
+
var formArray = $form.serializeArray(),
|
443
|
+
pushes = {},
|
444
|
+
pushValues= {},
|
445
|
+
build = function(base, key, value) {
|
446
|
+
base[key] = value;
|
447
|
+
return base;
|
448
|
+
}
|
449
|
+
;
|
450
|
+
// add files
|
451
|
+
$.each($('input[type="file"]',$form), function(i, tag) {
|
452
|
+
$.each($(tag)[0].files, function(j, file) {
|
453
|
+
formArray.push({name:tag.name, value: file});
|
454
|
+
});
|
455
|
+
});
|
456
|
+
$.each(formArray, function(i, el) {
|
457
|
+
if (!settings.regExp.validate.test(el.name)) return;
|
458
|
+
var isCheckbox = $('[name="' + el.name + '"]', $form).attr('type') === 'checkbox',
|
459
|
+
floatValue = parseFloat(el.value),
|
460
|
+
value = (isCheckbox && el.value === 'on') || el.value === 'true' || (String(floatValue) === el.value ? floatValue : (el.value === 'false' ? false : el.value)),
|
461
|
+
nameKeys = el.name.match(settings.regExp.key) || [], k, pushKey= el.name.replace(/\[\]$/,'')
|
462
|
+
;
|
463
|
+
if(!(pushKey in pushes)) {
|
464
|
+
pushes[pushKey] = 0;
|
465
|
+
pushValues[pushKey] = value;
|
466
|
+
} else if (Array.isArray(pushValues[pushKey])) {
|
467
|
+
pushValues[pushKey].push(value);
|
442
468
|
} else {
|
443
|
-
|
469
|
+
pushValues[pushKey] = [pushValues[pushKey] , value];
|
444
470
|
}
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
471
|
+
value = pushValues[pushKey];
|
472
|
+
|
473
|
+
while ((k = nameKeys.pop()) !== undefined) {
|
474
|
+
// foo[]
|
475
|
+
if (k == '' && !Array.isArray(value)){
|
476
|
+
value = build([], pushes[pushKey]++, value);
|
477
|
+
}
|
478
|
+
// foo[n]
|
479
|
+
else if (settings.regExp.fixed.test(k)) {
|
480
|
+
value = build([], k, value);
|
481
|
+
}
|
482
|
+
// foo; foo[bar]
|
483
|
+
else if (settings.regExp.named.test(k)) {
|
484
|
+
value = build({}, k, value);
|
485
|
+
}
|
486
|
+
}
|
487
|
+
formData = $.extend(true, formData, value);
|
488
|
+
});
|
489
|
+
}
|
449
490
|
|
450
491
|
if(hasOtherData) {
|
451
492
|
module.debug('Extending existing data with form data', data, formData);
|
452
|
-
|
493
|
+
if(useFormDataApi) {
|
494
|
+
$.each(Object.keys(data),function(i, el){
|
495
|
+
formData.append(el, data[el]);
|
496
|
+
});
|
497
|
+
data = formData;
|
498
|
+
} else {
|
499
|
+
data = $.extend(true, {}, data, formData);
|
500
|
+
}
|
453
501
|
}
|
454
502
|
else {
|
455
503
|
module.debug('Adding form data', formData);
|
@@ -1088,6 +1136,8 @@ $.api.settings = {
|
|
1088
1136
|
defaultData : true,
|
1089
1137
|
|
1090
1138
|
// whether to serialize closest form
|
1139
|
+
// use true to convert complex named keys like a[b][1][c][] into a nested object
|
1140
|
+
// use 'formdata' for formdata web api
|
1091
1141
|
serializeForm : false,
|
1092
1142
|
|
1093
1143
|
// how long to wait before request should occur
|
@@ -1158,6 +1208,11 @@ $.api.settings = {
|
|
1158
1208
|
regExp : {
|
1159
1209
|
required : /\{\$*[A-z0-9]+\}/g,
|
1160
1210
|
optional : /\{\/\$*[A-z0-9]+\}/g,
|
1211
|
+
validate: /^[a-z_][a-z0-9_-]*(?:\[(?:\d*|[a-z0-9_-]+)\])*$/i,
|
1212
|
+
key: /[a-z0-9_-]+|(?=\[\])/gi,
|
1213
|
+
push: /^$/,
|
1214
|
+
fixed: /^\d+$/,
|
1215
|
+
named: /^[a-z0-9_-]+$/i
|
1161
1216
|
},
|
1162
1217
|
|
1163
1218
|
className: {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.0-beta.
|
2
|
+
* # Fomantic UI - 2.9.0-beta.267+acc903b
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* http://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(O,D,e,j){"use strict";O.isWindow=O.isWindow||function(e){return null!=e&&e===e.window},D=void 0!==D&&D.Math==Math?D:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),O.api=O.fn.api=function(q){var x,e=O.isFunction(this)?O(D):O(this),A=e.selector||"",S=(new Date).getTime(),k=[],T=q,P="string"==typeof T,w=[].slice.call(arguments,1);return e.each(function(){var s,a,r,e,i,o,u,c=O.isPlainObject(q)?O.extend(!0,{},O.fn.api.settings,q):O.extend({},O.fn.api.settings),t=c.namespace,n=c.metadata,d=c.selector,l=c.error,f=c.className,g="."+t,p="module-"+t,m=O(this),b=m.closest(d.form),v=c.stateContext?O(c.stateContext):m,h=this,y=v[0],R=m.data(p);u={initialize:function(){P||(o=c.data,u.bind.events()),u.instantiate()},instantiate:function(){u.verbose("Storing instance of module",u),R=u,m.data(p,R)},destroy:function(){u.verbose("Destroying previous module for",h),m.removeData(p).off(g)},bind:{events:function(){var e=u.get.event();e?(u.verbose("Attaching API events to element",e),m.on(e+g,u.event.trigger)):"now"==c.on&&(u.debug("Querying API endpoint immediately"),u.query())}},decode:{json:function(e){if(e!==j&&"string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}},read:{cachedResponse:function(e){var t;if(D.Storage!==j)return t=sessionStorage.getItem(e+u.get.normalizedData()),u.debug("Using cached response",e,c.data,t),t=u.decode.json(t);u.error(l.noStorage)}},write:{cachedResponse:function(e,t){t&&""===t?u.debug("Response empty, not caching",t):D.Storage!==j?(O.isPlainObject(t)&&(t=JSON.stringify(t)),sessionStorage.setItem(e+u.get.normalizedData(),t),u.verbose("Storing cached response for url",e,c.data,t)):u.error(l.noStorage)}},query:function(){if(u.is.disabled())u.debug("Element is disabled API request aborted");else{if(u.is.loading()){if(!c.interruptRequests)return void u.debug("Cancelling request, previous request is still pending");u.debug("Interrupting previous request"),u.abort()}if(c.defaultData&&O.extend(!0,c.urlData,u.get.defaultData()),c.serializeForm&&(c.data=u.add.formData(o||c.data)),!1===(a=u.get.settings()))return u.cancelled=!0,void u.error(l.beforeSend);if(u.cancelled=!1,(r=u.get.templatedURL())||u.is.mocked()){if((r=u.add.urlData(r))||u.is.mocked()){if(a.url=c.base+r,s=O.extend(!0,{},c,{type:c.method||c.type,data:e,url:c.base+r,beforeSend:c.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),u.debug("Querying URL",s.url),u.verbose("Using AJAX settings",s),"local"===c.cache&&u.read.cachedResponse(r))return u.debug("Response returned from local cache"),u.request=u.create.request(),void u.request.resolveWith(y,[u.read.cachedResponse(r)]);c.throttle?c.throttleFirstRequest||u.timer?(u.debug("Throttling request",c.throttle),clearTimeout(u.timer),u.timer=setTimeout(function(){u.timer&&delete u.timer,u.debug("Sending throttled request",e,s.method),u.send.request()},c.throttle)):(u.debug("Sending request",e,s.method),u.send.request(),u.timer=setTimeout(function(){},c.throttle)):(u.debug("Sending request",e,s.method),u.send.request())}}else u.error(l.missingURL)}},should:{removeError:function(){return!0===c.hideError||"auto"===c.hideError&&!u.is.form()}},is:{disabled:function(){return 0<m.filter(d.disabled).length},expectingJSON:function(){return"json"===c.dataType||"jsonp"===c.dataType},form:function(){return m.is("form")||v.is("form")},mocked:function(){return c.mockResponse||c.mockResponseAsync||c.response||c.responseAsync},input:function(){return m.is("input")},loading:function(){return!!u.request&&"pending"==u.request.state()},abortedRequest:function(e){return e&&e.readyState!==j&&0===e.readyState?(u.verbose("XHR request determined to be aborted"),!0):(u.verbose("XHR request was not aborted"),!1)},validResponse:function(e){return u.is.expectingJSON()&&O.isFunction(c.successTest)?(u.debug("Checking JSON returned success",c.successTest,e),c.successTest(e)?(u.debug("Response passed success test",e),!0):(u.debug("Response failed success test",e),!1)):(u.verbose("Response is not JSON, skipping validation",c.successTest,e),!0)}},was:{cancelled:function(){return u.cancelled||!1},successful:function(){return u.request&&"resolved"==u.request.state()},failure:function(){return u.request&&"rejected"==u.request.state()},complete:function(){return u.request&&("resolved"==u.request.state()||"rejected"==u.request.state())}},add:{urlData:function(o,s){var e,t;return o&&(e=o.match(c.regExp.required),t=o.match(c.regExp.optional),s=s||c.urlData,e&&(u.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(s)&&s[r]!==j?s[r]:m.data(r)!==j?m.data(r):v.data(r)!==j?v.data(r):s[r];if(n===j)return u.error(l.requiredParameter,r,o),o=!1;u.verbose("Found required variable",r,n),n=c.encodeParameters?u.get.urlEncodedValue(n):n,o=o.replace(t,n)})),t&&(u.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(s)&&s[r]!==j?s[r]:m.data(r)!==j?m.data(r):v.data(r)!==j?v.data(r):s[r];o=n!==j?(u.verbose("Optional variable Found",r,n),o.replace(t,n)):(u.verbose("Optional variable not found",r),-1!==o.indexOf("/"+t)?o.replace("/"+t,""):o.replace(t,""))}))),o},formData:function(e){var t,n={};return e=e||o||c.data,t=O.isPlainObject(e),O.each(b.serializeArray(),function(e,t){var r=n[t.name];null!=r?Array.isArray(r)?r.push(t.value):n[t.name]=[r,t.value]:n[t.name]=t.value}),e=t?(u.debug("Extending existing data with form data",e,n),O.extend(!0,{},e,n)):(u.debug("Adding form data",n),n)}},send:{request:function(){u.set.loading(),u.request=u.create.request(),u.is.mocked()?u.mockedXHR=u.create.mockedXHR():u.xhr=u.create.xhr(),c.onRequest.call(y,u.request,u.xhr)}},event:{trigger:function(e){u.query(),"submit"!=e.type&&"click"!=e.type||e.preventDefault()},xhr:{always:function(){},done:function(e,t,r){var n=this,o=(new Date).getTime()-i,s=c.loadingDuration-o,a=!!O.isFunction(c.onResponse)&&(u.is.expectingJSON()&&!c.rawResponse?c.onResponse.call(n,O.extend(!0,{},e)):c.onResponse.call(n,e));s=0<s?s:0,a&&(u.debug("Modified API response in onResponse callback",c.onResponse,a,e),e=a),0<s&&u.debug("Response completed early delaying state change by",s),setTimeout(function(){u.is.validResponse(e)?u.request.resolveWith(n,[e,r]):u.request.rejectWith(n,[r,"invalid"])},s)},fail:function(e,t,r){var n=this,o=(new Date).getTime()-i,s=c.loadingDuration-o;0<(s=0<s?s:0)&&u.debug("Response completed early delaying state change by",s),setTimeout(function(){u.is.abortedRequest(e)?u.request.rejectWith(n,[e,"aborted",r]):u.request.rejectWith(n,[e,"error",t,r])},s)}},request:{done:function(e,t){u.debug("Successful API Response",e),"local"===c.cache&&r&&(u.write.cachedResponse(r,e),u.debug("Saving server response locally",u.cache)),c.onSuccess.call(y,e,m,t)},complete:function(e,t){var r,n;u.was.successful()?(n=e,r=t):(r=e,n=u.get.responseFromXHR(r)),u.remove.loading(),c.onComplete.call(y,n,m,r)},fail:function(e,t,r){var n=u.get.responseFromXHR(e),o=u.get.errorFromRequest(n,t,r);if("aborted"==t)return u.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,r),c.onAbort.call(y,t,m,e),!0;"invalid"==t?u.debug("JSON did not pass success test. A server-side error has most likely occurred",n):"error"==t&&e!==j&&(u.debug("XHR produced a server error",t,r),(e.status<200||300<=e.status)&&r!==j&&""!==r&&u.error(l.statusMessage+r,s.url),c.onError.call(y,o,m,e)),c.errorDuration&&"aborted"!==t&&(u.debug("Adding error state"),u.set.error(),u.should.removeError()&&setTimeout(u.remove.error,c.errorDuration)),u.debug("API Request failed",o,e),c.onFailure.call(y,n,m,e)}}},create:{request:function(){return O.Deferred().always(u.event.request.complete).done(u.event.request.done).fail(u.event.request.fail)},mockedXHR:function(){var e,t,r,n=c.mockResponse||c.response,o=c.mockResponseAsync||c.responseAsync;return r=O.Deferred().always(u.event.xhr.complete).done(u.event.xhr.done).fail(u.event.xhr.fail),n?(t=O.isFunction(n)?(u.debug("Using specified synchronous callback",n),n.call(y,a)):(u.debug("Using settings specified response",n),n),r.resolveWith(y,[t,!1,{responseText:t}])):O.isFunction(o)&&(e=function(e){u.debug("Async callback returned response",e),e?r.resolveWith(y,[e,!1,{responseText:e}]):r.rejectWith(y,[{responseText:e},!1,!1])},u.debug("Using specified async response callback",o),o.call(y,a,e)),r},xhr:function(){var e;return e=O.ajax(s).always(u.event.xhr.always).done(u.event.xhr.done).fail(u.event.xhr.fail),u.verbose("Created server request",e,s),e}},set:{error:function(){u.verbose("Adding error state to element",v),v.addClass(f.error)},loading:function(){u.verbose("Adding loading state to element",v),v.addClass(f.loading),i=(new Date).getTime()}},remove:{error:function(){u.verbose("Removing error state from element",v),v.removeClass(f.error)},loading:function(){u.verbose("Removing loading state from element",v),v.removeClass(f.loading)}},get:{normalizedData:function(){return"string"==typeof c.data?c.data:JSON.stringify(c.data,Object.keys(c.data).sort())},responseFromXHR:function(e){return!!O.isPlainObject(e)&&(u.is.expectingJSON()?u.decode.json(e.responseText):e.responseText)},errorFromRequest:function(e,t,r){return O.isPlainObject(e)&&e.error!==j?e.error:c.error[t]!==j?c.error[t]:r},request:function(){return u.request||!1},xhr:function(){return u.xhr||!1},settings:function(){var e;return(e=c.beforeSend.call(m,c))&&(e.success!==j&&(u.debug("Legacy success callback detected",e),u.error(l.legacyParameters,e.success),e.onSuccess=e.success),e.failure!==j&&(u.debug("Legacy failure callback detected",e),u.error(l.legacyParameters,e.failure),e.onFailure=e.failure),e.complete!==j&&(u.debug("Legacy complete callback detected",e),u.error(l.legacyParameters,e.complete),e.onComplete=e.complete)),e===j&&u.error(l.noReturnedValue),!1===e?e:e!==j?O.extend(!0,{},e):O.extend(!0,{},c)},urlEncodedValue:function(e){var t=D.decodeURIComponent(e),r=D.encodeURIComponent(e);return t!==e?(u.debug("URL value is already encoded, avoiding double encoding",e),e):(u.verbose("Encoding value using encodeURIComponent",e,r),r)},defaultData:function(){var e={};return O.isWindow(h)||(u.is.input()?e.value=m.val():u.is.form()||(e.text=m.text())),e},event:function(){return O.isWindow(h)||"now"==c.on?(u.debug("API called without element, no events attached"),!1):"auto"==c.on?m.is("input")?h.oninput!==j?"input":h.onpropertychange!==j?"propertychange":"keyup":m.is("form")?"submit":"click":c.on},templatedURL:function(e){if(e=e||m.data(n.action)||c.action||!1,r=m.data(n.url)||c.url||!1)return u.debug("Using specified url",r),r;if(e){if(u.debug("Looking up url for action",e,c.api),c.api[e]===j&&!u.is.mocked())return void u.error(l.missingAction,c.action,c.api);r=c.api[e]}else u.is.form()&&(r=m.attr("action")||v.attr("action")||!1,u.debug("No url or action specified, defaulting to form action",r));return r}},abort:function(){var e=u.get.xhr();e&&"resolved"!==e.state()&&(u.debug("Cancelling API request"),e.abort())},reset:function(){u.remove.error(),u.remove.loading()},setting:function(e,t){if(u.debug("Changing setting",e,t),O.isPlainObject(e))O.extend(!0,c,e);else{if(t===j)return c[e];O.isPlainObject(c[e])?O.extend(!0,c[e],t):c[e]=t}},internal:function(e,t){if(O.isPlainObject(e))O.extend(!0,u,e);else{if(t===j)return u[e];u[e]=t}},debug:function(){!c.silent&&c.debug&&(c.performance?u.performance.log(arguments):(u.debug=Function.prototype.bind.call(console.info,console,c.name+":"),u.debug.apply(console,arguments)))},verbose:function(){!c.silent&&c.verbose&&c.debug&&(c.performance?u.performance.log(arguments):(u.verbose=Function.prototype.bind.call(console.info,console,c.name+":"),u.verbose.apply(console,arguments)))},error:function(){c.silent||(u.error=Function.prototype.bind.call(console.error,console,c.name+":"),u.error.apply(console,arguments))},performance:{log:function(e){var t,r;c.performance&&(r=(t=(new Date).getTime())-(S||t),S=t,k.push({Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":r})),clearTimeout(u.performance.timer),u.performance.timer=setTimeout(u.performance.display,500)},display:function(){var e=c.name+":",r=0;S=!1,clearTimeout(u.performance.timer),O.each(k,function(e,t){r+=t["Execution Time"]}),e+=" "+r+"ms",A&&(e+=" '"+A+"'"),(console.group!==j||console.table!==j)&&0<k.length&&(console.groupCollapsed(e),console.table?console.table(k):O.each(k,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),k=[]}},invoke:function(n,e,t){var o,s,r,a=R;return e=e||w,t=h||t,"string"==typeof n&&a!==j&&(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(a[r])&&e!=o)a=a[r];else{if(a[r]!==j)return s=a[r],!1;if(!O.isPlainObject(a[t])||e==o)return a[t]!==j?s=a[t]:u.error(l.method,n),!1;a=a[t]}})),O.isFunction(s)?r=s.apply(t,e):s!==j&&(r=s),Array.isArray(x)?x.push(r):x!==j?x=[x,r]:r!==j&&(x=r),s}},P?(R===j&&u.initialize(),u.invoke(T)):(R!==j&&R.invoke("destroy"),u.initialize())}),x!==j?x:this},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:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g},className:{loading:"loading",error:"error"},selector:{disabled:".disabled",form:"form"},metadata:{action:"action",url:"url"}}}(jQuery,window,document);
|
11
|
+
!function(P,O,e,j){"use strict";P.isWindow=P.isWindow||function(e){return null!=e&&e===e.window},O=void 0!==O&&O.Math==Math?O:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),P.api=P.fn.api=function(q){var x,e=P.isFunction(this)?P(O):P(this),A=e.selector||"",k=(new Date).getTime(),S=[],T=q,w="string"==typeof T,D=[].slice.call(arguments,1);return e.each(function(){var s,a,r,e,i,o,f,g=P.isPlainObject(q)?P.extend(!0,{},P.fn.api.settings,q):P.extend({},P.fn.api.settings),t=g.namespace,n=g.metadata,u=g.selector,c=g.error,d=g.className,l="."+t,p="module-"+t,m=P(this),b=m.closest(u.form),v=g.stateContext?P(g.stateContext):m,h=this,y=v[0],R=m.data(p);f={initialize:function(){w||(o=g.data,f.bind.events()),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),R=f,m.data(p,R)},destroy:function(){f.verbose("Destroying previous module for",h),m.removeData(p).off(l)},bind:{events:function(){var e=f.get.event();e?(f.verbose("Attaching API events to element",e),m.on(e+l,f.event.trigger)):"now"==g.on&&(f.debug("Querying API endpoint immediately"),f.query())}},decode:{json:function(e){if(e!==j&&"string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}},read:{cachedResponse:function(e){var t;if(O.Storage!==j)return t=sessionStorage.getItem(e+f.get.normalizedData()),f.debug("Using cached response",e,g.data,t),t=f.decode.json(t);f.error(c.noStorage)}},write:{cachedResponse:function(e,t){t&&""===t?f.debug("Response empty, not caching",t):O.Storage!==j?(P.isPlainObject(t)&&(t=JSON.stringify(t)),sessionStorage.setItem(e+f.get.normalizedData(),t),f.verbose("Storing cached response for url",e,g.data,t)):f.error(c.noStorage)}},query:function(){if(f.is.disabled())f.debug("Element is disabled API request aborted");else{if(f.is.loading()){if(!g.interruptRequests)return void f.debug("Cancelling request, previous request is still pending");f.debug("Interrupting previous request"),f.abort()}if(g.defaultData&&P.extend(!0,g.urlData,f.get.defaultData()),g.serializeForm&&(g.data=f.add.formData(o||g.data)),!1===(a=f.get.settings()))return f.cancelled=!0,void f.error(c.beforeSend);if(f.cancelled=!1,(r=f.get.templatedURL())||f.is.mocked()){if((r=f.add.urlData(r))||f.is.mocked()){if(a.url=g.base+r,s=P.extend(!0,{},g,{type:g.method||g.type,data:e,url:g.base+r,beforeSend:g.beforeXHR,success:function(){},failure:function(){},complete:function(){}}),f.debug("Querying URL",s.url),f.verbose("Using AJAX settings",s),"local"===g.cache&&f.read.cachedResponse(r))return f.debug("Response returned from local cache"),f.request=f.create.request(),void f.request.resolveWith(y,[f.read.cachedResponse(r)]);g.throttle?g.throttleFirstRequest||f.timer?(f.debug("Throttling request",g.throttle),clearTimeout(f.timer),f.timer=setTimeout(function(){f.timer&&delete f.timer,f.debug("Sending throttled request",e,s.method),f.send.request()},g.throttle)):(f.debug("Sending request",e,s.method),f.send.request(),f.timer=setTimeout(function(){},g.throttle)):(f.debug("Sending request",e,s.method),f.send.request())}}else f.error(c.missingURL)}},should:{removeError:function(){return!0===g.hideError||"auto"===g.hideError&&!f.is.form()}},is:{disabled:function(){return 0<m.filter(u.disabled).length},expectingJSON:function(){return"json"===g.dataType||"jsonp"===g.dataType},form:function(){return m.is("form")||v.is("form")},mocked:function(){return g.mockResponse||g.mockResponseAsync||g.response||g.responseAsync},input:function(){return m.is("input")},loading:function(){return!!f.request&&"pending"==f.request.state()},abortedRequest:function(e){return e&&e.readyState!==j&&0===e.readyState?(f.verbose("XHR request determined to be aborted"),!0):(f.verbose("XHR request was not aborted"),!1)},validResponse:function(e){return f.is.expectingJSON()&&P.isFunction(g.successTest)?(f.debug("Checking JSON returned success",g.successTest,e),g.successTest(e)?(f.debug("Response passed success test",e),!0):(f.debug("Response failed success test",e),!1)):(f.verbose("Response is not JSON, skipping validation",g.successTest,e),!0)}},was:{cancelled:function(){return f.cancelled||!1},successful:function(){return f.request&&"resolved"==f.request.state()},failure:function(){return f.request&&"rejected"==f.request.state()},complete:function(){return f.request&&("resolved"==f.request.state()||"rejected"==f.request.state())}},add:{urlData:function(o,s){var e,t;return o&&(e=o.match(g.regExp.required),t=o.match(g.regExp.optional),s=s||g.urlData,e&&(f.debug("Looking for required URL variables",e),P.each(e,function(e,t){var r=-1!==t.indexOf("$")?t.slice(2,-1):t.slice(1,-1),n=P.isPlainObject(s)&&s[r]!==j?s[r]:m.data(r)!==j?m.data(r):v.data(r)!==j?v.data(r):s[r];if(n===j)return f.error(c.requiredParameter,r,o),o=!1;f.verbose("Found required variable",r,n),n=g.encodeParameters?f.get.urlEncodedValue(n):n,o=o.replace(t,n)})),t&&(f.debug("Looking for optional URL variables",e),P.each(t,function(e,t){var r=-1!==t.indexOf("$")?t.slice(3,-1):t.slice(2,-1),n=P.isPlainObject(s)&&s[r]!==j?s[r]:m.data(r)!==j?m.data(r):v.data(r)!==j?v.data(r):s[r];o=n!==j?(f.verbose("Optional variable Found",r,n),o.replace(t,n)):(f.verbose("Optional variable not found",r),-1!==o.indexOf("/"+t)?o.replace("/"+t,""):o.replace(t,""))}))),o},formData:function(r){var e,u={},t="formdata"===g.serializeForm;if(r=r||o||g.data,e=P.isPlainObject(r),t)u=new FormData(b[0]),g.processData=void 0!==g.processData&&g.processData,g.contentType=void 0!==g.contentType&&g.contentType;else{var n=b.serializeArray(),c={},d={},l=function(e,t,r){return e[t]=r,e};P.each(P('input[type="file"]',b),function(e,r){P.each(P(r)[0].files,function(e,t){n.push({name:r.name,value:t})})}),P.each(n,function(e,t){if(g.regExp.validate.test(t.name)){var r,n="checkbox"===P('[name="'+t.name+'"]',b).attr("type"),o=parseFloat(t.value),s=n&&"on"===t.value||"true"===t.value||(String(o)===t.value?o:"false"!==t.value&&t.value),a=t.name.match(g.regExp.key)||[],i=t.name.replace(/\[\]$/,"");i in c?Array.isArray(d[i])?d[i].push(s):d[i]=[d[i],s]:(c[i]=0,d[i]=s),s=d[i];for(;(r=a.pop())!==j;)""!=r||Array.isArray(s)?g.regExp.fixed.test(r)?s=l([],r,s):g.regExp.named.test(r)&&(s=l({},r,s)):s=l([],c[i]++,s);u=P.extend(!0,u,s)}})}return r=e?(f.debug("Extending existing data with form data",r,u),t?(P.each(Object.keys(r),function(e,t){u.append(t,r[t])}),u):P.extend(!0,{},r,u)):(f.debug("Adding form data",u),u)}},send:{request:function(){f.set.loading(),f.request=f.create.request(),f.is.mocked()?f.mockedXHR=f.create.mockedXHR():f.xhr=f.create.xhr(),g.onRequest.call(y,f.request,f.xhr)}},event:{trigger:function(e){f.query(),"submit"!=e.type&&"click"!=e.type||e.preventDefault()},xhr:{always:function(){},done:function(e,t,r){var n=this,o=(new Date).getTime()-i,s=g.loadingDuration-o,a=!!P.isFunction(g.onResponse)&&(f.is.expectingJSON()&&!g.rawResponse?g.onResponse.call(n,P.extend(!0,{},e)):g.onResponse.call(n,e));s=0<s?s:0,a&&(f.debug("Modified API response in onResponse callback",g.onResponse,a,e),e=a),0<s&&f.debug("Response completed early delaying state change by",s),setTimeout(function(){f.is.validResponse(e)?f.request.resolveWith(n,[e,r]):f.request.rejectWith(n,[r,"invalid"])},s)},fail:function(e,t,r){var n=this,o=(new Date).getTime()-i,s=g.loadingDuration-o;0<(s=0<s?s:0)&&f.debug("Response completed early delaying state change by",s),setTimeout(function(){f.is.abortedRequest(e)?f.request.rejectWith(n,[e,"aborted",r]):f.request.rejectWith(n,[e,"error",t,r])},s)}},request:{done:function(e,t){f.debug("Successful API Response",e),"local"===g.cache&&r&&(f.write.cachedResponse(r,e),f.debug("Saving server response locally",f.cache)),g.onSuccess.call(y,e,m,t)},complete:function(e,t){var r,n;f.was.successful()?(n=e,r=t):(r=e,n=f.get.responseFromXHR(r)),f.remove.loading(),g.onComplete.call(y,n,m,r)},fail:function(e,t,r){var n=f.get.responseFromXHR(e),o=f.get.errorFromRequest(n,t,r);if("aborted"==t)return f.debug("XHR Aborted (Most likely caused by page navigation or CORS Policy)",t,r),g.onAbort.call(y,t,m,e),!0;"invalid"==t?f.debug("JSON did not pass success test. A server-side error has most likely occurred",n):"error"==t&&e!==j&&(f.debug("XHR produced a server error",t,r),(e.status<200||300<=e.status)&&r!==j&&""!==r&&f.error(c.statusMessage+r,s.url),g.onError.call(y,o,m,e)),g.errorDuration&&"aborted"!==t&&(f.debug("Adding error state"),f.set.error(),f.should.removeError()&&setTimeout(f.remove.error,g.errorDuration)),f.debug("API Request failed",o,e),g.onFailure.call(y,n,m,e)}}},create:{request:function(){return P.Deferred().always(f.event.request.complete).done(f.event.request.done).fail(f.event.request.fail)},mockedXHR:function(){var e,t,r,n=g.mockResponse||g.response,o=g.mockResponseAsync||g.responseAsync;return r=P.Deferred().always(f.event.xhr.complete).done(f.event.xhr.done).fail(f.event.xhr.fail),n?(t=P.isFunction(n)?(f.debug("Using specified synchronous callback",n),n.call(y,a)):(f.debug("Using settings specified response",n),n),r.resolveWith(y,[t,!1,{responseText:t}])):P.isFunction(o)&&(e=function(e){f.debug("Async callback returned response",e),e?r.resolveWith(y,[e,!1,{responseText:e}]):r.rejectWith(y,[{responseText:e},!1,!1])},f.debug("Using specified async response callback",o),o.call(y,a,e)),r},xhr:function(){var e;return e=P.ajax(s).always(f.event.xhr.always).done(f.event.xhr.done).fail(f.event.xhr.fail),f.verbose("Created server request",e,s),e}},set:{error:function(){f.verbose("Adding error state to element",v),v.addClass(d.error)},loading:function(){f.verbose("Adding loading state to element",v),v.addClass(d.loading),i=(new Date).getTime()}},remove:{error:function(){f.verbose("Removing error state from element",v),v.removeClass(d.error)},loading:function(){f.verbose("Removing loading state from element",v),v.removeClass(d.loading)}},get:{normalizedData:function(){return"string"==typeof g.data?g.data:JSON.stringify(g.data,Object.keys(g.data).sort())},responseFromXHR:function(e){return!!P.isPlainObject(e)&&(f.is.expectingJSON()?f.decode.json(e.responseText):e.responseText)},errorFromRequest:function(e,t,r){return P.isPlainObject(e)&&e.error!==j?e.error:g.error[t]!==j?g.error[t]:r},request:function(){return f.request||!1},xhr:function(){return f.xhr||!1},settings:function(){var e;return(e=g.beforeSend.call(m,g))&&(e.success!==j&&(f.debug("Legacy success callback detected",e),f.error(c.legacyParameters,e.success),e.onSuccess=e.success),e.failure!==j&&(f.debug("Legacy failure callback detected",e),f.error(c.legacyParameters,e.failure),e.onFailure=e.failure),e.complete!==j&&(f.debug("Legacy complete callback detected",e),f.error(c.legacyParameters,e.complete),e.onComplete=e.complete)),e===j&&f.error(c.noReturnedValue),!1===e?e:e!==j?P.extend(!0,{},e):P.extend(!0,{},g)},urlEncodedValue:function(e){var t=O.decodeURIComponent(e),r=O.encodeURIComponent(e);return t!==e?(f.debug("URL value is already encoded, avoiding double encoding",e),e):(f.verbose("Encoding value using encodeURIComponent",e,r),r)},defaultData:function(){var e={};return P.isWindow(h)||(f.is.input()?e.value=m.val():f.is.form()||(e.text=m.text())),e},event:function(){return P.isWindow(h)||"now"==g.on?(f.debug("API called without element, no events attached"),!1):"auto"==g.on?m.is("input")?h.oninput!==j?"input":h.onpropertychange!==j?"propertychange":"keyup":m.is("form")?"submit":"click":g.on},templatedURL:function(e){if(e=e||m.data(n.action)||g.action||!1,r=m.data(n.url)||g.url||!1)return f.debug("Using specified url",r),r;if(e){if(f.debug("Looking up url for action",e,g.api),g.api[e]===j&&!f.is.mocked())return void f.error(c.missingAction,g.action,g.api);r=g.api[e]}else f.is.form()&&(r=m.attr("action")||v.attr("action")||!1,f.debug("No url or action specified, defaulting to form action",r));return r}},abort:function(){var e=f.get.xhr();e&&"resolved"!==e.state()&&(f.debug("Cancelling API request"),e.abort())},reset:function(){f.remove.error(),f.remove.loading()},setting:function(e,t){if(f.debug("Changing setting",e,t),P.isPlainObject(e))P.extend(!0,g,e);else{if(t===j)return g[e];P.isPlainObject(g[e])?P.extend(!0,g[e],t):g[e]=t}},internal:function(e,t){if(P.isPlainObject(e))P.extend(!0,f,e);else{if(t===j)return f[e];f[e]=t}},debug:function(){!g.silent&&g.debug&&(g.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,g.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!g.silent&&g.verbose&&g.debug&&(g.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,g.name+":"),f.verbose.apply(console,arguments)))},error:function(){g.silent||(f.error=Function.prototype.bind.call(console.error,console,g.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var t,r;g.performance&&(r=(t=(new Date).getTime())-(k||t),k=t,S.push({Name:e[0],Arguments:[].slice.call(e,1)||"","Execution Time":r})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(f.performance.display,500)},display:function(){var e=g.name+":",r=0;k=!1,clearTimeout(f.performance.timer),P.each(S,function(e,t){r+=t["Execution Time"]}),e+=" "+r+"ms",A&&(e+=" '"+A+"'"),(console.group!==j||console.table!==j)&&0<S.length&&(console.groupCollapsed(e),console.table?console.table(S):P.each(S,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),S=[]}},invoke:function(n,e,t){var o,s,r,a=R;return e=e||D,t=h||t,"string"==typeof n&&a!==j&&(n=n.split(/[\. ]/),o=n.length-1,P.each(n,function(e,t){var r=e!=o?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(P.isPlainObject(a[r])&&e!=o)a=a[r];else{if(a[r]!==j)return s=a[r],!1;if(!P.isPlainObject(a[t])||e==o)return a[t]!==j?s=a[t]:f.error(c.method,n),!1;a=a[t]}})),P.isFunction(s)?r=s.apply(t,e):s!==j&&(r=s),Array.isArray(x)?x.push(r):x!==j?x=[x,r]:r!==j&&(x=r),s}},w?(R===j&&f.initialize(),f.invoke(T)):(R!==j&&R.invoke("destroy"),f.initialize())}),x!==j?x:this},P.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:/\{\$*[A-z0-9]+\}/g,optional:/\{\/\$*[A-z0-9]+\}/g,validate:/^[a-z_][a-z0-9_-]*(?:\[(?:\d*|[a-z0-9_-]+)\])*$/i,key:/[a-z0-9_-]+|(?=\[\])/gi,push:/^$/,fixed:/^\d+$/,named:/^[a-z0-9_-]+$/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.0-beta.
|
2
|
+
* # Fomantic-UI 2.9.0-beta.267+acc903b - Calendar
|
3
3
|
* http://github.com/fomantic/Fomantic-UI/
|
4
4
|
*
|
5
5
|
*
|
@@ -1560,7 +1560,7 @@ $.fn.calendar.settings = {
|
|
1560
1560
|
if (!text) {
|
1561
1561
|
return null;
|
1562
1562
|
}
|
1563
|
-
text = String(text).replace(/\s/g,'');
|
1563
|
+
text = String(text).trim().replace(/([.:\/\-])\s+/g,'$1').replace(/\s+([.:\/-])/g,'$1').replace(/\s+/g,' ');
|
1564
1564
|
if (text.length === 0) {
|
1565
1565
|
return null;
|
1566
1566
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* # Fomantic UI - 2.9.0-beta.
|
2
|
+
* # Fomantic UI - 2.9.0-beta.267+acc903b
|
3
3
|
* https://github.com/fomantic/Fomantic-UI
|
4
4
|
* http://fomantic-ui.com/
|
5
5
|
*
|
@@ -8,4 +8,4 @@
|
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
10
10
|
*/
|
11
|
-
!function(De,T,O,ve){"use strict";De.isFunction=De.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},T=void 0!==T&&T.Math==Math?T:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),De.fn.calendar=function(g){var y,e=De(this),D=e.selector||"",v=(new Date).getTime(),b=[],C=g,w="string"==typeof C,M=[].slice.call(arguments,1),x={5:{row:4,column:3},10:{row:3,column:2},15:{row:2,column:2},20:{row:3,column:1},30:{row:2,column:1}},ye=["","one","two","three","four","five","six","seven","eight"];return e.each(function(){var c,e,ue,de=De.isPlainObject(g)?De.extend(!0,{},De.fn.calendar.settings,g):De.extend({},De.fn.calendar.settings),fe=de.className,t=de.namespace,i=de.selector,ce=de.formatter,a=de.parser,pe=de.metadata,he=x[de.minTimeGap],s=de.error,n="."+t,r="module-"+t,o=De(this),l=o.find(i.input),me=o.find(i.popup),u=o.find(i.activator),p=this,d=o.data(r),h=!1,ge=o.hasClass(fe.inverted),f=!1,m=!1;ue={initialize:function(){ue.debug("Initializing calendar for",p,o),c=ue.get.isTouch(),ue.setup.config(),ue.setup.popup(),ue.setup.inline(),ue.setup.input(),ue.setup.date(),ue.create.calendar(),ue.bind.events(),ue.observeChanges(),ue.instantiate()},instantiate:function(){ue.verbose("Storing instance of calendar"),d=ue,o.data(r,d)},destroy:function(){ue.verbose("Destroying previous calendar for",p),o.removeData(r),ue.unbind.events(),ue.disconnect.classObserver()},setup:{config:function(){null!==ue.get.minDate()&&ue.set.minDate(o.data(pe.minDate)),null!==ue.get.maxDate()&&ue.set.maxDate(o.data(pe.maxDate)),ue.setting("type",ue.get.type()),ue.setting("on",de.on||"click")},popup:function(){if(!de.inline&&(u.length||(u=o.children().first()).length))if(De.fn.popup!==ve){if(!me.length){var e=u.parent(),t=0!==e.closest(i.append).length?"appendTo":"prependTo";me=De("<div/>").addClass(fe.popup)[t](e)}me.addClass(fe.calendar),ge&&me.addClass(fe.inverted);var a=function(){return ue.refreshTooltips(),de.onVisible.apply(me,arguments)};l.length||(me.attr("tabindex","0"),a=function(){return ue.refreshTooltips(),ue.focus(),de.onVisible.apply(me,arguments)});var n=ue.setting("on"),r=De.extend({},de.popupOptions,{popup:me,on:n,hoverable:"hover"===n,closable:"click"===n,onShow:function(){return ue.set.focusDate(ue.get.date()),ue.set.mode(ue.get.validatedMode(de.startMode)),de.onShow.apply(me,arguments)},onVisible:a,onHide:de.onHide,onHidden:function(){return ue.blur(),de.onHidden.apply(me,arguments)}});ue.popup(r)}else ue.error(s.popup)},inline:function(){u.length&&!de.inline||(de.inline=!0,me=De("<div/>").addClass(fe.calendar).appendTo(o),l.length||me.attr("tabindex","0"))},input:function(){de.touchReadonly&&l.length&&c&&l.prop("readonly",!0),ue.check.disabled()},date:function(){var e;de.initialDate?e=a.date(de.initialDate,de):o.data(pe.date)!==ve?e=a.date(o.data(pe.date),de):l.length&&(e=a.date(l.val(),de)),ue.set.date(e,de.formatInput,!1),ue.set.mode(ue.get.mode(),!1)}},trigger:{change:function(){var e=l[0];if(e){var t=O.createEvent("HTMLEvents");ue.verbose("Triggering native change event"),t.initEvent("change",!0,!1),e.dispatchEvent(t)}}},create:{calendar:function(){var e,t,a,n,r,i,o,s=ue.get.mode(),l=new Date,u=ue.get.date(),d=ue.get.focusDate(),f=ue.helper.dateInRange(d||u||de.initialDate||l);d||(d=f,ue.set.focusDate(d,!1,!1));var c="year"===s,p="month"===s,h="day"===s,m="hour"===s,g="minute"===s,y="time"===de.type,D=Math.max(de.multiMonth,1),v=h?ue.get.monthOffset():0,b=f.getMinutes(),C=f.getHours(),w=f.getDate(),M=f.getMonth()+v,x=f.getFullYear(),T=h?de.showWeekNumbers?8:7:m?4:he.column,O=h||m?6:he.row,k=h?D:1,A=me,F=A.hasClass("left")?"right center":"left center";for(A.empty(),1<k&&(o=De("<div/>").addClass(fe.grid).appendTo(A)),n=0;n<k;n++){if(1<k)A=De("<div/>").addClass(fe.column).appendTo(o);var H=M+n,N=(new Date(x,H,1).getDay()-de.firstDayOfWeek%7+7)%7;if(!de.constantHeight&&h){var E=new Date(x,H+1,0).getDate()+N;O=Math.ceil(E/7)}var Y=c?10:p?1:0,I=h?1:0,j=m||g?1:0,q=m||g?w:1,S=new Date(x-Y,H-I,q-j,C),W=new Date(x+Y,H+I,q+j,C),R=c?new Date(10*Math.ceil(x/10)-9,0,0):p?new Date(x,0,0):h?new Date(x,H,0):new Date(x,H,w,-1),V=c?new Date(10*Math.ceil(x/10)+1,0,1):p?new Date(x+1,0,1):h?new Date(x,H+1,1):new Date(x,H,w+1),G=s;h&&de.showWeekNumbers&&(G+=" andweek");var P=De("<table/>").addClass(fe.table).addClass(G).addClass(ye[T]+" column").appendTo(A);ge&&P.addClass(fe.inverted);var B=T;if(!y){var K=De("<thead/>").appendTo(P);r=De("<tr/>").appendTo(K),i=De("<th/>").attr("colspan",""+T).appendTo(r);var U=c||p?new Date(x,0,1):h?new Date(x,H,1):new Date(x,H,w,C,b),J=De("<span/>").addClass(fe.link).appendTo(i);J.text(ce.header(U,s,de));var z=p?de.disableYear?"day":"year":h?de.disableMonth?"year":"month":"day";if(J.data(pe.mode,z),0===n){var L=De("<span/>").addClass(fe.prev).appendTo(i);L.data(pe.focusDate,S),L.toggleClass(fe.disabledCell,!ue.helper.isDateInRange(R,s)),De("<i/>").addClass(fe.prevIcon).appendTo(L)}if(n===k-1){var $=De("<span/>").addClass(fe.next).appendTo(i);$.data(pe.focusDate,W),$.toggleClass(fe.disabledCell,!ue.helper.isDateInRange(V,s)),De("<i/>").addClass(fe.nextIcon).appendTo($)}if(h)for(r=De("<tr/>").appendTo(K),de.showWeekNumbers&&((i=De("<th/>").appendTo(r)).text(de.text.weekNo),i.addClass(fe.weekCell),B--),e=0;e<B;e++)(i=De("<th/>").appendTo(r)).text(ce.dayColumnHeader((e+de.firstDayOfWeek)%7,de))}var Q=De("<tbody/>").appendTo(P);for(e=c?10*Math.ceil(x/10)-9:h?1-N:0,t=0;t<O;t++)for(r=De("<tr/>").appendTo(Q),h&&de.showWeekNumbers&&((i=De("<th/>").appendTo(r)).text(ue.get.weekOfYear(x,H,e+1-de.firstDayOfWeek)),i.addClass(fe.weekCell)),a=0;a<B;a++,e++){var Z=c?new Date(e,H,1,C,b):p?new Date(x,e,1,C,b):h?new Date(x,H,e,C,b):m?new Date(x,H,w,e):new Date(x,H,w,C,e*de.minTimeGap),X=c?e:p?de.text.monthsShort[e]:h?Z.getDate():ce.time(Z,de,!0);(i=De("<td/>").addClass(fe.cell).appendTo(r)).text(X),i.data(pe.date,Z);var _,ee=h&&Z.getMonth()!==(H+12)%12,te=!de.selectAdjacentDays&&ee||!ue.helper.isDateInRange(Z,s)||de.isDisabled(Z,s)||ue.helper.isDisabled(Z,s)||!ue.helper.isEnabled(Z,s);if(te){var ae=ue.helper.findDayAsObject(Z,s,de.disabledDates);if(null!==ae&&ae[pe.message]&&(i.attr("data-tooltip",ae[pe.message]),i.attr("data-position",ae[pe.position]||F),(ae[pe.inverted]||ge&&ae[pe.inverted]===ve)&&i.attr("data-inverted",""),ae[pe.variation]&&i.attr("data-variation",ae[pe.variation])),"hour"===s){var ne=ue.helper.findHourAsObject(Z,s,de.disabledHours);null!==ne&&ne[pe.message]&&(i.attr("data-tooltip",ne[pe.message]),i.attr("data-position",ne[pe.position]||F),(ne[pe.inverted]||ge&&ne[pe.inverted]===ve)&&i.attr("data-inverted",""),ne[pe.variation]&&i.attr("data-variation",ne[pe.variation]))}}else null!==(_=ue.helper.findDayAsObject(Z,s,de.eventDates))&&(i.addClass(_[pe.class]||de.eventClass),_[pe.message]&&(i.attr("data-tooltip",_[pe.message]),i.attr("data-position",_[pe.position]||F),(_[pe.inverted]||ge&&_[pe.inverted]===ve)&&i.attr("data-inverted",""),_[pe.variation]&&i.attr("data-variation",_[pe.variation])));var re=ue.helper.dateEqual(Z,u,s),ie=ue.helper.dateEqual(Z,l,s);i.toggleClass(fe.adjacentCell,ee&&!_),i.toggleClass(fe.disabledCell,te),i.toggleClass(fe.activeCell,re&&!(ee&&te)),m||g||i.toggleClass(fe.todayCell,!ee&&ie);var oe={mode:s,adjacent:ee,disabled:te,active:re,today:ie};ce.cell(i,Z,oe),ue.helper.dateEqual(Z,d,s)&&ue.set.focusDate(Z,!1,!1)}if(de.today){var se=De("<tr/>").appendTo(Q),le=De("<td/>").attr("colspan",""+T).addClass(fe.today).appendTo(se);le.text(ce.today(de)),le.data(pe.date,l)}ue.update.focus(!1,P),de.inline&&ue.refreshTooltips()}}},update:{focus:function(e,t){t=t||me;var s=ue.get.mode(),a=ue.get.date(),l=ue.get.focusDate(),u=ue.get.startDate(),d=ue.get.endDate(),f=(e?l:null)||a||(c?null:l);t.find("td").each(function(){var e=De(this),t=e.data(pe.date);if(t){var a=e.hasClass(fe.disabledCell),n=e.hasClass(fe.activeCell),r=e.hasClass(fe.adjacentCell),i=ue.helper.dateEqual(t,l,s),o=!!f&&(!!u&&ue.helper.isDateInRange(t,s,u,f)||!!d&&ue.helper.isDateInRange(t,s,f,d));e.toggleClass(fe.focusCell,i&&(!c||h)&&(!r||de.selectAdjacentDays&&r)&&!a),ue.helper.isTodayButton(e)||e.toggleClass(fe.rangeCell,o&&!n&&!a)}})}},refresh:function(){ue.create.calendar()},refreshTooltips:function(){var r=De(T).width();me.find("td[data-position]").each(function(){var e=De(this),t=T.getComputedStyle(e[0],":after").width.replace(/[^0-9\.]/g,""),a=e.attr("data-position"),n=r-e.width()-(parseInt(t,10)||250)>e.offset().left?"right":"left";-1===a.indexOf(n)&&e.attr("data-position",a.replace(/(left|right)/,n))})},bind:{events:function(){ue.debug("Binding events"),me.on("mousedown"+n,ue.event.mousedown),me.on("touchstart"+n,ue.event.mousedown),me.on("mouseup"+n,ue.event.mouseup),me.on("touchend"+n,ue.event.mouseup),me.on("mouseover"+n,ue.event.mouseover),l.length?(l.on("input"+n,ue.event.inputChange),l.on("focus"+n,ue.event.inputFocus),l.on("blur"+n,ue.event.inputBlur),l.on("keydown"+n,ue.event.keydown)):me.on("keydown"+n,ue.event.keydown)}},unbind:{events:function(){ue.debug("Unbinding events"),me.off(n),l.length&&l.off(n)}},event:{mouseover:function(e){var t=De(e.target).data(pe.date),a=1===e.buttons;t&&ue.set.focusDate(t,!1,!0,a)},mousedown:function(e){l.length&&e.preventDefault(),h=0<=e.type.indexOf("touch");var t=De(e.target).data(pe.date);t&&ue.set.focusDate(t,!1,!0,!0)},mouseup:function(e){ue.focus(),e.preventDefault(),e.stopPropagation(),h=!1;var t=De(e.target);if(!t.hasClass("disabled")){var a=t.parent();(a.data(pe.date)||a.data(pe.focusDate)||a.data(pe.mode))&&(t=a);var n=t.data(pe.date),r=t.data(pe.focusDate),i=t.data(pe.mode);if(n&&!1!==de.onSelect.call(p,n,ue.get.mode())){var o=t.hasClass(fe.today);ue.selectDate(n,o)}else r?ue.set.focusDate(r):i&&ue.set.mode(i)}},keydown:function(e){var t=e.which;if(27!==t&&9!==t||ue.popup("hide"),ue.popup("is visible"))if(37===t||38===t||39===t||40===t){var a="day"===(f=ue.get.mode())?7:"hour"===f?4:"minute"===f?he.column:3,n=37===t?-1:38===t?-a:39==t?1:a;n*="minute"===f?de.minTimeGap:1;var r=ue.get.focusDate()||ue.get.date()||new Date,i=r.getFullYear()+("year"===f?n:0),o=r.getMonth()+("month"===f?n:0),s=r.getDate()+("day"===f?n:0),l=r.getHours()+("hour"===f?n:0),u=r.getMinutes()+("minute"===f?n:0),d=new Date(i,o,s,l,u);"time"===de.type&&(d=ue.helper.mergeDateTime(r,d)),ue.helper.isDateInRange(d,f)&&ue.set.focusDate(d)}else if(13===t){var f=ue.get.mode(),c=ue.get.focusDate();c&&!de.isDisabled(c,f)&&!ue.helper.isDisabled(c,f)&&ue.helper.isEnabled(c,f)&&!1!==de.onSelect.call(p,c,ue.get.mode())&&ue.selectDate(c),e.preventDefault(),e.stopPropagation()}38!==t&&40!==t||(e.preventDefault(),ue.popup("show"))},inputChange:function(){var e=l.val(),t=a.date(e,de);ue.set.date(t,!1)},inputFocus:function(){me.addClass(fe.active)},inputBlur:function(){if(me.removeClass(fe.active),de.formatInput){var e=ue.get.date(),t=ce.datetime(e,de);l.val(t)}m&&(ue.trigger.change(),m=!1)},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&ue.check.disabled()})}}},observeChanges:function(){"MutationObserver"in T&&(e=new MutationObserver(ue.event.class.mutation),ue.debug("Setting up mutation observer",e),ue.observe.class())},disconnect:{classObserver:function(){l.length&&e&&e.disconnect()}},observe:{class:function(){l.length&&e&&e.observe(o[0],{attributes:!0})}},is:{disabled:function(){return o.hasClass(fe.disabled)}},check:{disabled:function(){l.attr("tabindex",ue.is.disabled()?-1:0)}},get:{weekOfYear:function(e,t,a){var n,r,i;return n=Date.UTC(e,t,a+3)/864e5,r=Math.floor(n/7),i=new Date(6048e5*r).getUTCFullYear(),r-Math.floor(Date.UTC(i,0,7)/6048e5)+1},date:function(){return ue.helper.sanitiseDate(o.data(pe.date))||null},inputDate:function(){return l.val()},focusDate:function(){return o.data(pe.focusDate)||null},startDate:function(){var e=ue.get.calendarModule(de.startCalendar);return(e?e.get.date():o.data(pe.startDate))||null},endDate:function(){var e=ue.get.calendarModule(de.endCalendar);return(e?e.get.date():o.data(pe.endDate))||null},minDate:function(){return o.data(pe.minDate)||null},maxDate:function(){return o.data(pe.maxDate)||null},monthOffset:function(){return o.data(pe.monthOffset)||de.monthOffset||0},mode:function(){var e=o.data(pe.mode)||de.startMode;return ue.get.validatedMode(e)},validatedMode:function(e){var t=ue.get.validModes();return 0<=De.inArray(e,t)?e:"time"===de.type?"hour":"month"===de.type?"month":"year"===de.type?"year":"day"},type:function(){return o.data(pe.type)||de.type},validModes:function(){var e=[];return"time"!==de.type&&(de.disableYear&&"year"!==de.type||e.push("year"),(de.disableMonth||"year"===de.type)&&"month"!==de.type||e.push("month"),0<=de.type.indexOf("date")&&e.push("day")),0<=de.type.indexOf("time")&&(e.push("hour"),de.disableMinute||e.push("minute")),e},isTouch:function(){try{return O.createEvent("TouchEvent"),!0}catch(e){return!1}},calendarModule:function(e){return e?(e instanceof De||(e=De(e).first()),e.data(r)):null}},set:{date:function(e,t,a){t=!1!==t,a=!1!==a,e=ue.helper.sanitiseDate(e),e=ue.helper.dateInRange(e);var n=ue.get.mode(),r=ce.datetime(e,de);if(a&&!1===de.onBeforeChange.call(p,e,r,n))return!1;if(ue.set.focusDate(e),de.isDisabled(e,n))return!1;var i=ue.get.endDate();i&&e&&i<e&&ue.set.endDate(ve),ue.set.dataKeyValue(pe.date,e),t&&l.length&&l.val(r),a&&de.onChange.call(p,e,r,n)},startDate:function(e,t){e=ue.helper.sanitiseDate(e);var a=ue.get.calendarModule(de.startCalendar);a&&a.set.date(e),ue.set.dataKeyValue(pe.startDate,e,t)},endDate:function(e,t){e=ue.helper.sanitiseDate(e);var a=ue.get.calendarModule(de.endCalendar);a&&a.set.date(e),ue.set.dataKeyValue(pe.endDate,e,t)},focusDate:function(e,t,a,n){e=ue.helper.sanitiseDate(e),e=ue.helper.dateInRange(e);var r="day"===ue.get.mode(),i=ue.get.focusDate();if(r&&e&&i){var o=12*(e.getFullYear()-i.getFullYear())+e.getMonth()-i.getMonth();if(o){var s=ue.get.monthOffset()-o;ue.set.monthOffset(s,!1)}}var l=ue.set.dataKeyValue(pe.focusDate,e,!!e&&t);a=!1!==a&&l&&!1===t||f!=n,f=n,a&&ue.update.focus(n)},minDate:function(e){e=ue.helper.sanitiseDate(e),null!==de.maxDate&&de.maxDate<=e?ue.verbose("Unable to set minDate variable bigger that maxDate variable",e,de.maxDate):(ue.setting("minDate",e),ue.set.dataKeyValue(pe.minDate,e))},maxDate:function(e){e=ue.helper.sanitiseDate(e),null!==de.minDate&&de.minDate>=e?ue.verbose("Unable to set maxDate variable lower that minDate variable",e,de.minDate):(ue.setting("maxDate",e),ue.set.dataKeyValue(pe.maxDate,e))},monthOffset:function(e,t){var a=Math.max(de.multiMonth,1);e=Math.max(1-a,Math.min(0,e)),ue.set.dataKeyValue(pe.monthOffset,e,t)},mode:function(e,t){ue.set.dataKeyValue(pe.mode,e,t)},dataKeyValue:function(e,t,a){var n=o.data(e),r=n===t||n<=t&&t<=n;return t?o.data(e,t):o.removeData(e),(a=!1!==a&&!r)&&ue.refresh(),!r}},selectDate:function(e,t){ue.verbose("New date selection",e);var a=ue.get.mode();if(t||"minute"===a||de.disableMinute&&"hour"===a||"date"===de.type&&"day"===a||"month"===de.type&&"month"===a||"year"===de.type&&"year"===a){if(!(!1===ue.set.date(e))&&(m=!0,de.closable)){ue.popup("hide");var n=ue.get.calendarModule(de.endCalendar);n&&(n.refresh(),"focus"!==n.setting("on")&&n.popup("show"),n.focus())}}else{var r="year"===a?de.disableMonth?"day":"month":"month"===a?"day":"day"===a?"hour":"minute";ue.set.mode(r),"hour"===a||"day"===a&&ue.get.date()?ue.set.date(e,!0,!1):ue.set.focusDate(e)}},changeDate:function(e){ue.set.date(e)},clear:function(){ue.set.date(ve)},popup:function(){return u.popup.apply(u,arguments)},focus:function(){l.length?l.focus():me.focus()},blur:function(){l.length?l.blur():me.blur()},helper:{isDisabled:function(a,n){return("day"===n||"month"===n||"year"===n||"hour"===n)&&("day"===n&&-1!==de.disabledDaysOfWeek.indexOf(a.getDay())||de.disabledDates.some(function(e){if("string"==typeof e&&(e=ue.helper.sanitiseDate(e)),e instanceof Date)return ue.helper.dateEqual(a,e,n);if(null!==e&&"object"==typeof e)if(e[pe.year]){if("number"==typeof e[pe.year])return a.getFullYear()==e[pe.year];if(Array.isArray(e[pe.year]))return-1<e[pe.year].indexOf(a.getFullYear())}else if(e[pe.month]){if("number"==typeof e[pe.month])return a.getMonth()==e[pe.month];if(Array.isArray(e[pe.month]))return-1<e[pe.month].indexOf(a.getMonth());if(e[pe.month]instanceof Date){var t=ue.helper.sanitiseDate(e[pe.month]);return a.getMonth()==t.getMonth()&&a.getFullYear()==t.getFullYear()}}else if(e[pe.date]&&"day"===n){if(e[pe.date]instanceof Date)return ue.helper.dateEqual(a,ue.helper.sanitiseDate(e[pe.date]),n);if(Array.isArray(e[pe.date]))return e[pe.date].some(function(e){return ue.helper.dateEqual(a,e,n)})}})||"hour"===n&&de.disabledHours.some(function(e){if("string"==typeof e&&(e=ue.helper.sanitiseDate(e)),e instanceof Date)return ue.helper.dateEqual(a,e,n);if("number"==typeof e)return a.getHours()===e;if(null!==e&&"object"==typeof e){var t=!0;if(e[pe.date])if(e[pe.date]instanceof Date)t=ue.helper.dateEqual(a,ue.helper.sanitiseDate(e[pe.date]));else if(Array.isArray(e[pe.date]))return e[pe.date].some(function(e){t=ue.helper.dateEqual(a,e,n)});if(e[pe.days]&&("number"==typeof e[pe.days]?t=a.getDay()==e[pe.days]:Array.isArray(e[pe.days])&&(t=-1<e[pe.days].indexOf(a.getDay()))),e[pe.hours]){if("number"==typeof e[pe.hours])return t&&a.getHours()==e[pe.hours];if(Array.isArray(e[pe.hours]))return t&&-1<e[pe.hours].indexOf(a.getHours())}}}))},isEnabled:function(t,a){return"day"!==a||(0===de.enabledDates.length||de.enabledDates.some(function(e){return"string"==typeof e&&(e=ue.helper.sanitiseDate(e)),e instanceof Date?ue.helper.dateEqual(t,e,a):null!==e&&"object"==typeof e&&e[pe.date]?ue.helper.dateEqual(t,ue.helper.sanitiseDate(e[pe.date]),a):void 0}))},findDayAsObject:function(t,a,e){if("day"===a||"month"===a||"year"===a)for(var n,r=0;r<e.length;r++){if("string"==typeof(n=e[r])&&(n=ue.helper.sanitiseDate(n)),n instanceof Date&&ue.helper.dateEqual(t,n,a)){var i={};return i[pe.date]=n,i}if(null!==n&&"object"==typeof n)if(n[pe.year]){if("number"==typeof n[pe.year]&&t.getFullYear()==n[pe.year])return n;if(Array.isArray(n[pe.year])&&-1<n[pe.year].indexOf(t.getFullYear()))return n}else if(n[pe.month]){if("number"==typeof n[pe.month]&&t.getMonth()==n[pe.month])return n;if(Array.isArray(n[pe.month])){if(-1<n[pe.month].indexOf(t.getMonth()))return n}else if(n[pe.month]instanceof Date){var o=ue.helper.sanitiseDate(n[pe.month]);if(t.getMonth()==o.getMonth()&&t.getFullYear()==o.getFullYear())return n}}else if(n[pe.date]&&"day"===a){if(n[pe.date]instanceof Date&&ue.helper.dateEqual(t,ue.helper.sanitiseDate(n[pe.date]),a))return n;if(Array.isArray(n[pe.date])&&n[pe.date].some(function(e){return ue.helper.dateEqual(t,e,a)}))return n}}return null},findHourAsObject:function(t,a,e){if("hour"===a)for(var n,r=function(e,t){if(t[pe.hours]){if("number"==typeof t[pe.hours]&&e.getHours()==t[pe.hours])return t;if(Array.isArray(t[pe.hours])&&-1<t[pe.hours].indexOf(e.getHours()))return t}},i=0;i<e.length;i++){if("number"==typeof(n=e[i])&&t.getHours()==n)return null;if(null!==n&&"object"==typeof n)if(n[pe.days]&&r(t,n)){if("number"==typeof n[pe.days]&&t.getDay()==n[pe.days])return n;if(Array.isArray(n[pe.days])&&-1<n[pe.days].indexOf(t.getDay()))return n}else if(n[pe.date]&&r(t,n)){if(n[pe.date]instanceof Date&&ue.helper.dateEqual(t,ue.helper.sanitiseDate(n[pe.date])))return n;if(Array.isArray(n[pe.date])&&n[pe.date].some(function(e){return ue.helper.dateEqual(t,e,a)}))return n}else if(r(t,n))return n}return null},sanitiseDate:function(e){return e instanceof Date||(e=a.date(""+e,de)),!e||isNaN(e.getTime())?null:e},dateDiff:function(e,t,a){a=a||"day";var n="time"===de.type,r="year"===a,i=r||"month"===a,o="minute"===a,s=o||"hour"===a;return e=new Date(n?2e3:e.getFullYear(),n?0:r?0:e.getMonth(),n?1:i?1:e.getDate(),s?e.getHours():0,o?de.minTimeGap*Math.floor(e.getMinutes()/de.minTimeGap):0),(t=new Date(n?2e3:t.getFullYear(),n?0:r?0:t.getMonth(),n?1:i?1:t.getDate(),s?t.getHours():0,o?de.minTimeGap*Math.floor(t.getMinutes()/de.minTimeGap):0)).getTime()-e.getTime()},dateEqual:function(e,t,a){return!!e&&!!t&&0===ue.helper.dateDiff(e,t,a)},isDateInRange:function(e,t,a,n){if(!a&&!n){var r=ue.get.startDate();a=r&&de.minDate?new Date(Math.max(r,de.minDate)):r||de.minDate,n=de.maxDate}return a=a&&new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),de.minTimeGap*Math.ceil(a.getMinutes()/de.minTimeGap)),!(!e||a&&0<ue.helper.dateDiff(e,a,t)||n&&0<ue.helper.dateDiff(n,e,t))},dateInRange:function(e,t,a){if(!t&&!a){var n=ue.get.startDate();t=n&&de.minDate?new Date(Math.max(n,de.minDate)):n||de.minDate,a=de.maxDate}t=t&&new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),de.minTimeGap*Math.ceil(t.getMinutes()/de.minTimeGap));var r="time"===de.type;return e?t&&0<ue.helper.dateDiff(e,t,"minute")?r?ue.helper.mergeDateTime(e,t):t:a&&0<ue.helper.dateDiff(a,e,"minute")?r?ue.helper.mergeDateTime(e,a):a:e:e},mergeDateTime:function(e,t){return e&&t?new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes()):t},isTodayButton:function(e){return e.text()===de.text.today}},setting:function(e,t){if(ue.debug("Changing setting",e,t),De.isPlainObject(e))De.extend(!0,de,e);else{if(t===ve)return de[e];De.isPlainObject(de[e])?De.extend(!0,de[e],t):de[e]=t}},internal:function(e,t){if(De.isPlainObject(e))De.extend(!0,ue,e);else{if(t===ve)return ue[e];ue[e]=t}},debug:function(){!de.silent&&de.debug&&(de.performance?ue.performance.log(arguments):(ue.debug=Function.prototype.bind.call(console.info,console,de.name+":"),ue.debug.apply(console,arguments)))},verbose:function(){!de.silent&&de.verbose&&de.debug&&(de.performance?ue.performance.log(arguments):(ue.verbose=Function.prototype.bind.call(console.info,console,de.name+":"),ue.verbose.apply(console,arguments)))},error:function(){de.silent||(ue.error=Function.prototype.bind.call(console.error,console,de.name+":"),ue.error.apply(console,arguments))},performance:{log:function(e){var t,a;de.performance&&(a=(t=(new Date).getTime())-(v||t),v=t,b.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:p,"Execution Time":a})),clearTimeout(ue.performance.timer),ue.performance.timer=setTimeout(ue.performance.display,500)},display:function(){var e=de.name+":",a=0;v=!1,clearTimeout(ue.performance.timer),De.each(b,function(e,t){a+=t["Execution Time"]}),e+=" "+a+"ms",D&&(e+=" '"+D+"'"),(console.group!==ve||console.table!==ve)&&0<b.length&&(console.groupCollapsed(e),console.table?console.table(b):De.each(b,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),b=[]}},invoke:function(n,e,t){var r,i,a,o=d;return e=e||M,t=p||t,"string"==typeof n&&o!==ve&&(n=n.split(/[\. ]/),r=n.length-1,De.each(n,function(e,t){var a=e!=r?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(De.isPlainObject(o[a])&&e!=r)o=o[a];else{if(o[a]!==ve)return i=o[a],!1;if(!De.isPlainObject(o[t])||e==r)return o[t]!==ve?i=o[t]:ue.error(s.method,n),!1;o=o[t]}})),De.isFunction(i)?a=i.apply(t,e):i!==ve&&(a=i),Array.isArray(y)?y.push(a):y!==ve?y=[y,a]:a!==ve&&(y=a),i}},w?(d===ve&&ue.initialize(),ue.invoke(C)):(d!==ve&&d.invoke("destroy"),ue.initialize())}),y!==ve?y:this},De.fn.calendar.settings={name:"Calendar",namespace:"calendar",silent:!1,debug:!1,verbose:!1,performance:!1,type:"datetime",firstDayOfWeek:0,constantHeight:!0,today:!1,closable:!0,monthFirst:!0,touchReadonly:!0,inline:!1,on:null,initialDate:null,startMode:!1,minDate:null,maxDate:null,ampm:!0,disableYear:!1,disableMonth:!1,disableMinute:!1,formatInput:!0,startCalendar:null,endCalendar:null,multiMonth:1,monthOffset:0,minTimeGap:5,showWeekNumbers:null,disabledHours:[],disabledDates:[],disabledDaysOfWeek:[],enabledDates:[],eventDates:[],centuryBreak:60,currentCentury:2e3,selectAdjacentDays:!1,popupOptions:{position:"bottom left",lastResort:"bottom left",prefer:"opposite",observeChanges:!1,hideOnScroll:!1},text:{days:["S","M","T","W","T","F","S"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",now:"Now",am:"AM",pm:"PM",weekNo:"Week"},formatter:{header:function(e,t,a){return"year"===t?a.formatter.yearHeader(e,a):"month"===t?a.formatter.monthHeader(e,a):"day"===t?a.formatter.dayHeader(e,a):"hour"===t?a.formatter.hourHeader(e,a):a.formatter.minuteHeader(e,a)},yearHeader:function(e,t){var a=10*Math.ceil(e.getFullYear()/10);return a-9+" - "+(2+a)},monthHeader:function(e,t){return e.getFullYear()},dayHeader:function(e,t){return t.text.months[e.getMonth()]+" "+e.getFullYear()},hourHeader:function(e,t){return t.formatter.date(e,t)},minuteHeader:function(e,t){return t.formatter.date(e,t)},dayColumnHeader:function(e,t){return t.text.days[e]},datetime:function(e,t){if(!e)return"";var a="time"===t.type?"":t.formatter.date(e,t),n=t.type.indexOf("time")<0?"":t.formatter.time(e,t,!1);return a+("datetime"===t.type?" ":"")+n},date:function(e,t){if(!e)return"";var a=e.getDate(),n=t.text.months[e.getMonth()],r=e.getFullYear();return"year"===t.type?r:"month"===t.type?n+" "+r:(t.monthFirst?n+" "+a:a+" "+n)+", "+r},time:function(e,t,a){if(!e)return"";var n=e.getHours(),r=e.getMinutes(),i="";return t.ampm&&(i=" "+(n<12?t.text.am:t.text.pm),n=0===n?12:12<n?n-12:n),n+":"+(r<10?"0":"")+r+i},today:function(e){return"date"===e.type?e.text.today:e.text.now},cell:function(e,t,a){}},parser:{date:function(e,t){if(e instanceof Date)return e;if(!e)return null;if(0===(e=String(e).replace(/\s/g,"")).length)return null;e.match(/^[0-9]{4}[\/\-\.][0-9]{1,2}[\/\-\.][0-9]{1,2}$/)&&(e=e.replace(/[\/\-\.]/g,"/")+" 00:00:00"),e=t.monthFirst||!e.match(/^[0-9]{1,2}[\/\-\.]/)?e:e.replace(/[\/\-\.]/g,"/").replace(/([0-9]+)\/([0-9]+)/,"$2/$1");var a,n,r,i=new Date(e);if(!(null!==e.match(/^[0-9]+$/))&&!isNaN(i.getDate()))return i;e=e.toLowerCase();var o,s,l,u=-1,d=-1,f=-1,c=-1,p=-1,h=ve,m="time"===t.type,g=t.type.indexOf("time")<0,y=e.split(t.regExp.dateWords),D=e.split(t.regExp.dateNumbers);if(!g)for(h=0<=De.inArray(t.text.am.toLowerCase(),y)||!(0<=De.inArray(t.text.pm.toLowerCase(),y))&&ve,a=0;a<D.length;a++)if(0<=(s=D[a]).indexOf(":")){if(d<0||u<0)for(l=s.split(":"),r=0;r<Math.min(2,l.length);r++)n=parseInt(l[r]),isNaN(n)&&(n=0),0===r?d=n%24:u=n%60;D.splice(a,1)}if(!m){for(a=0;a<y.length;a++)if(!((o=y[a]).length<=0)){for(n=0;n<t.text.months.length;n++)if(t.text.months[n].substring(0,o.length).toLowerCase()===o){c=n+1;break}if(0<=c)break}for(a=0;a<D.length;a++)if(n=parseInt(D[a]),!isNaN(n)&&n>=t.centuryBreak&&a===D.length-1){n<=99&&(n+=t.currentCentury-100),p=n,D.splice(a,1);break}if(c<0)for(a=0;a<D.length;a++)if(r=1<a||t.monthFirst?a:1===a?0:1,n=parseInt(D[r]),!isNaN(n)&&1<=n&&n<=12){c=n,D.splice(r,1);break}for(a=0;a<D.length;a++)if(n=parseInt(D[a]),!isNaN(n)&&1<=n&&n<=31){f=n,D.splice(a,1);break}if(p<0)for(a=D.length-1;0<=a;a--)if(n=parseInt(D[a]),!isNaN(n)){n<=99&&(n+=t.currentCentury),p=n,D.splice(a,1);break}}if(!g){if(d<0)for(a=0;a<D.length;a++)if(n=parseInt(D[a]),!isNaN(n)&&0<=n&&n<=23){d=n,D.splice(a,1);break}if(u<0)for(a=0;a<D.length;a++)if(n=parseInt(D[a]),!isNaN(n)&&0<=n&&n<=59){u=n,D.splice(a,1);break}}if(u<0&&d<0&&f<0&&c<0&&p<0)return null;u<0&&(u=0),d<0&&(d=0),f<0&&(f=1),c<0&&(c=1),p<0&&(p=(new Date).getFullYear()),h!==ve&&(h?12===d&&(d=0):d<12&&(d+=12));var v=new Date(p,c-1,f,d,u);return v.getMonth()===c-1&&v.getFullYear()===p||(v=new Date(p,c,0,d,u)),isNaN(v.getTime())?null:v}},onBeforeChange:function(e,t,a){return!0},onChange:function(e,t,a){},onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){},onSelect:function(e,t){},isDisabled:function(e,t){return!1},selector:{popup:".ui.popup",input:"input",activator:"input",append:".inline.field,.inline.fields"},regExp:{dateWords:/[^A-Za-z\u00C0-\u024F]+/g,dateNumbers:/[^\d:]+/g},error:{popup:"UI Popup, a required component is not included in this page",method:"The method you called is not defined."},className:{calendar:"calendar",active:"active",popup:"ui popup",grid:"ui equal width grid",column:"column",table:"ui celled center aligned unstackable table",inverted:"inverted",prev:"prev link",next:"next link",prevIcon:"chevron left icon",nextIcon:"chevron right icon",link:"link",cell:"link",disabledCell:"disabled",weekCell:"disabled",adjacentCell:"adjacent",activeCell:"active",rangeCell:"range",focusCell:"focus",todayCell:"today",today:"today link",disabled:"disabled"},metadata:{date:"date",focusDate:"focusDate",startDate:"startDate",endDate:"endDate",minDate:"minDate",maxDate:"maxDate",mode:"mode",type:"type",monthOffset:"monthOffset",message:"message",class:"class",inverted:"inverted",variation:"variation",position:"position",month:"month",year:"year",hours:"hours",days:"days"},eventClass:"blue"}}(jQuery,window,document);
|
11
|
+
!function(De,T,O,ve){"use strict";De.isFunction=De.isFunction||function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},T=void 0!==T&&T.Math==Math?T:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),De.fn.calendar=function(g){var y,e=De(this),D=e.selector||"",v=(new Date).getTime(),b=[],C=g,w="string"==typeof C,M=[].slice.call(arguments,1),x={5:{row:4,column:3},10:{row:3,column:2},15:{row:2,column:2},20:{row:3,column:1},30:{row:2,column:1}},ye=["","one","two","three","four","five","six","seven","eight"];return e.each(function(){var c,e,ue,de=De.isPlainObject(g)?De.extend(!0,{},De.fn.calendar.settings,g):De.extend({},De.fn.calendar.settings),fe=de.className,t=de.namespace,i=de.selector,ce=de.formatter,a=de.parser,pe=de.metadata,he=x[de.minTimeGap],s=de.error,n="."+t,r="module-"+t,o=De(this),l=o.find(i.input),me=o.find(i.popup),u=o.find(i.activator),p=this,d=o.data(r),h=!1,ge=o.hasClass(fe.inverted),f=!1,m=!1;ue={initialize:function(){ue.debug("Initializing calendar for",p,o),c=ue.get.isTouch(),ue.setup.config(),ue.setup.popup(),ue.setup.inline(),ue.setup.input(),ue.setup.date(),ue.create.calendar(),ue.bind.events(),ue.observeChanges(),ue.instantiate()},instantiate:function(){ue.verbose("Storing instance of calendar"),d=ue,o.data(r,d)},destroy:function(){ue.verbose("Destroying previous calendar for",p),o.removeData(r),ue.unbind.events(),ue.disconnect.classObserver()},setup:{config:function(){null!==ue.get.minDate()&&ue.set.minDate(o.data(pe.minDate)),null!==ue.get.maxDate()&&ue.set.maxDate(o.data(pe.maxDate)),ue.setting("type",ue.get.type()),ue.setting("on",de.on||"click")},popup:function(){if(!de.inline&&(u.length||(u=o.children().first()).length))if(De.fn.popup!==ve){if(!me.length){var e=u.parent(),t=0!==e.closest(i.append).length?"appendTo":"prependTo";me=De("<div/>").addClass(fe.popup)[t](e)}me.addClass(fe.calendar),ge&&me.addClass(fe.inverted);var a=function(){return ue.refreshTooltips(),de.onVisible.apply(me,arguments)};l.length||(me.attr("tabindex","0"),a=function(){return ue.refreshTooltips(),ue.focus(),de.onVisible.apply(me,arguments)});var n=ue.setting("on"),r=De.extend({},de.popupOptions,{popup:me,on:n,hoverable:"hover"===n,closable:"click"===n,onShow:function(){return ue.set.focusDate(ue.get.date()),ue.set.mode(ue.get.validatedMode(de.startMode)),de.onShow.apply(me,arguments)},onVisible:a,onHide:de.onHide,onHidden:function(){return ue.blur(),de.onHidden.apply(me,arguments)}});ue.popup(r)}else ue.error(s.popup)},inline:function(){u.length&&!de.inline||(de.inline=!0,me=De("<div/>").addClass(fe.calendar).appendTo(o),l.length||me.attr("tabindex","0"))},input:function(){de.touchReadonly&&l.length&&c&&l.prop("readonly",!0),ue.check.disabled()},date:function(){var e;de.initialDate?e=a.date(de.initialDate,de):o.data(pe.date)!==ve?e=a.date(o.data(pe.date),de):l.length&&(e=a.date(l.val(),de)),ue.set.date(e,de.formatInput,!1),ue.set.mode(ue.get.mode(),!1)}},trigger:{change:function(){var e=l[0];if(e){var t=O.createEvent("HTMLEvents");ue.verbose("Triggering native change event"),t.initEvent("change",!0,!1),e.dispatchEvent(t)}}},create:{calendar:function(){var e,t,a,n,r,i,o,s=ue.get.mode(),l=new Date,u=ue.get.date(),d=ue.get.focusDate(),f=ue.helper.dateInRange(d||u||de.initialDate||l);d||(d=f,ue.set.focusDate(d,!1,!1));var c="year"===s,p="month"===s,h="day"===s,m="hour"===s,g="minute"===s,y="time"===de.type,D=Math.max(de.multiMonth,1),v=h?ue.get.monthOffset():0,b=f.getMinutes(),C=f.getHours(),w=f.getDate(),M=f.getMonth()+v,x=f.getFullYear(),T=h?de.showWeekNumbers?8:7:m?4:he.column,O=h||m?6:he.row,k=h?D:1,A=me,F=A.hasClass("left")?"right center":"left center";for(A.empty(),1<k&&(o=De("<div/>").addClass(fe.grid).appendTo(A)),n=0;n<k;n++){if(1<k)A=De("<div/>").addClass(fe.column).appendTo(o);var H=M+n,N=(new Date(x,H,1).getDay()-de.firstDayOfWeek%7+7)%7;if(!de.constantHeight&&h){var E=new Date(x,H+1,0).getDate()+N;O=Math.ceil(E/7)}var Y=c?10:p?1:0,I=h?1:0,j=m||g?1:0,q=m||g?w:1,S=new Date(x-Y,H-I,q-j,C),W=new Date(x+Y,H+I,q+j,C),R=c?new Date(10*Math.ceil(x/10)-9,0,0):p?new Date(x,0,0):h?new Date(x,H,0):new Date(x,H,w,-1),V=c?new Date(10*Math.ceil(x/10)+1,0,1):p?new Date(x+1,0,1):h?new Date(x,H+1,1):new Date(x,H,w+1),G=s;h&&de.showWeekNumbers&&(G+=" andweek");var P=De("<table/>").addClass(fe.table).addClass(G).addClass(ye[T]+" column").appendTo(A);ge&&P.addClass(fe.inverted);var B=T;if(!y){var K=De("<thead/>").appendTo(P);r=De("<tr/>").appendTo(K),i=De("<th/>").attr("colspan",""+T).appendTo(r);var U=c||p?new Date(x,0,1):h?new Date(x,H,1):new Date(x,H,w,C,b),J=De("<span/>").addClass(fe.link).appendTo(i);J.text(ce.header(U,s,de));var $=p?de.disableYear?"day":"year":h?de.disableMonth?"year":"month":"day";if(J.data(pe.mode,$),0===n){var z=De("<span/>").addClass(fe.prev).appendTo(i);z.data(pe.focusDate,S),z.toggleClass(fe.disabledCell,!ue.helper.isDateInRange(R,s)),De("<i/>").addClass(fe.prevIcon).appendTo(z)}if(n===k-1){var L=De("<span/>").addClass(fe.next).appendTo(i);L.data(pe.focusDate,W),L.toggleClass(fe.disabledCell,!ue.helper.isDateInRange(V,s)),De("<i/>").addClass(fe.nextIcon).appendTo(L)}if(h)for(r=De("<tr/>").appendTo(K),de.showWeekNumbers&&((i=De("<th/>").appendTo(r)).text(de.text.weekNo),i.addClass(fe.weekCell),B--),e=0;e<B;e++)(i=De("<th/>").appendTo(r)).text(ce.dayColumnHeader((e+de.firstDayOfWeek)%7,de))}var Q=De("<tbody/>").appendTo(P);for(e=c?10*Math.ceil(x/10)-9:h?1-N:0,t=0;t<O;t++)for(r=De("<tr/>").appendTo(Q),h&&de.showWeekNumbers&&((i=De("<th/>").appendTo(r)).text(ue.get.weekOfYear(x,H,e+1-de.firstDayOfWeek)),i.addClass(fe.weekCell)),a=0;a<B;a++,e++){var Z=c?new Date(e,H,1,C,b):p?new Date(x,e,1,C,b):h?new Date(x,H,e,C,b):m?new Date(x,H,w,e):new Date(x,H,w,C,e*de.minTimeGap),X=c?e:p?de.text.monthsShort[e]:h?Z.getDate():ce.time(Z,de,!0);(i=De("<td/>").addClass(fe.cell).appendTo(r)).text(X),i.data(pe.date,Z);var _,ee=h&&Z.getMonth()!==(H+12)%12,te=!de.selectAdjacentDays&&ee||!ue.helper.isDateInRange(Z,s)||de.isDisabled(Z,s)||ue.helper.isDisabled(Z,s)||!ue.helper.isEnabled(Z,s);if(te){var ae=ue.helper.findDayAsObject(Z,s,de.disabledDates);if(null!==ae&&ae[pe.message]&&(i.attr("data-tooltip",ae[pe.message]),i.attr("data-position",ae[pe.position]||F),(ae[pe.inverted]||ge&&ae[pe.inverted]===ve)&&i.attr("data-inverted",""),ae[pe.variation]&&i.attr("data-variation",ae[pe.variation])),"hour"===s){var ne=ue.helper.findHourAsObject(Z,s,de.disabledHours);null!==ne&&ne[pe.message]&&(i.attr("data-tooltip",ne[pe.message]),i.attr("data-position",ne[pe.position]||F),(ne[pe.inverted]||ge&&ne[pe.inverted]===ve)&&i.attr("data-inverted",""),ne[pe.variation]&&i.attr("data-variation",ne[pe.variation]))}}else null!==(_=ue.helper.findDayAsObject(Z,s,de.eventDates))&&(i.addClass(_[pe.class]||de.eventClass),_[pe.message]&&(i.attr("data-tooltip",_[pe.message]),i.attr("data-position",_[pe.position]||F),(_[pe.inverted]||ge&&_[pe.inverted]===ve)&&i.attr("data-inverted",""),_[pe.variation]&&i.attr("data-variation",_[pe.variation])));var re=ue.helper.dateEqual(Z,u,s),ie=ue.helper.dateEqual(Z,l,s);i.toggleClass(fe.adjacentCell,ee&&!_),i.toggleClass(fe.disabledCell,te),i.toggleClass(fe.activeCell,re&&!(ee&&te)),m||g||i.toggleClass(fe.todayCell,!ee&&ie);var oe={mode:s,adjacent:ee,disabled:te,active:re,today:ie};ce.cell(i,Z,oe),ue.helper.dateEqual(Z,d,s)&&ue.set.focusDate(Z,!1,!1)}if(de.today){var se=De("<tr/>").appendTo(Q),le=De("<td/>").attr("colspan",""+T).addClass(fe.today).appendTo(se);le.text(ce.today(de)),le.data(pe.date,l)}ue.update.focus(!1,P),de.inline&&ue.refreshTooltips()}}},update:{focus:function(e,t){t=t||me;var s=ue.get.mode(),a=ue.get.date(),l=ue.get.focusDate(),u=ue.get.startDate(),d=ue.get.endDate(),f=(e?l:null)||a||(c?null:l);t.find("td").each(function(){var e=De(this),t=e.data(pe.date);if(t){var a=e.hasClass(fe.disabledCell),n=e.hasClass(fe.activeCell),r=e.hasClass(fe.adjacentCell),i=ue.helper.dateEqual(t,l,s),o=!!f&&(!!u&&ue.helper.isDateInRange(t,s,u,f)||!!d&&ue.helper.isDateInRange(t,s,f,d));e.toggleClass(fe.focusCell,i&&(!c||h)&&(!r||de.selectAdjacentDays&&r)&&!a),ue.helper.isTodayButton(e)||e.toggleClass(fe.rangeCell,o&&!n&&!a)}})}},refresh:function(){ue.create.calendar()},refreshTooltips:function(){var r=De(T).width();me.find("td[data-position]").each(function(){var e=De(this),t=T.getComputedStyle(e[0],":after").width.replace(/[^0-9\.]/g,""),a=e.attr("data-position"),n=r-e.width()-(parseInt(t,10)||250)>e.offset().left?"right":"left";-1===a.indexOf(n)&&e.attr("data-position",a.replace(/(left|right)/,n))})},bind:{events:function(){ue.debug("Binding events"),me.on("mousedown"+n,ue.event.mousedown),me.on("touchstart"+n,ue.event.mousedown),me.on("mouseup"+n,ue.event.mouseup),me.on("touchend"+n,ue.event.mouseup),me.on("mouseover"+n,ue.event.mouseover),l.length?(l.on("input"+n,ue.event.inputChange),l.on("focus"+n,ue.event.inputFocus),l.on("blur"+n,ue.event.inputBlur),l.on("keydown"+n,ue.event.keydown)):me.on("keydown"+n,ue.event.keydown)}},unbind:{events:function(){ue.debug("Unbinding events"),me.off(n),l.length&&l.off(n)}},event:{mouseover:function(e){var t=De(e.target).data(pe.date),a=1===e.buttons;t&&ue.set.focusDate(t,!1,!0,a)},mousedown:function(e){l.length&&e.preventDefault(),h=0<=e.type.indexOf("touch");var t=De(e.target).data(pe.date);t&&ue.set.focusDate(t,!1,!0,!0)},mouseup:function(e){ue.focus(),e.preventDefault(),e.stopPropagation(),h=!1;var t=De(e.target);if(!t.hasClass("disabled")){var a=t.parent();(a.data(pe.date)||a.data(pe.focusDate)||a.data(pe.mode))&&(t=a);var n=t.data(pe.date),r=t.data(pe.focusDate),i=t.data(pe.mode);if(n&&!1!==de.onSelect.call(p,n,ue.get.mode())){var o=t.hasClass(fe.today);ue.selectDate(n,o)}else r?ue.set.focusDate(r):i&&ue.set.mode(i)}},keydown:function(e){var t=e.which;if(27!==t&&9!==t||ue.popup("hide"),ue.popup("is visible"))if(37===t||38===t||39===t||40===t){var a="day"===(f=ue.get.mode())?7:"hour"===f?4:"minute"===f?he.column:3,n=37===t?-1:38===t?-a:39==t?1:a;n*="minute"===f?de.minTimeGap:1;var r=ue.get.focusDate()||ue.get.date()||new Date,i=r.getFullYear()+("year"===f?n:0),o=r.getMonth()+("month"===f?n:0),s=r.getDate()+("day"===f?n:0),l=r.getHours()+("hour"===f?n:0),u=r.getMinutes()+("minute"===f?n:0),d=new Date(i,o,s,l,u);"time"===de.type&&(d=ue.helper.mergeDateTime(r,d)),ue.helper.isDateInRange(d,f)&&ue.set.focusDate(d)}else if(13===t){var f=ue.get.mode(),c=ue.get.focusDate();c&&!de.isDisabled(c,f)&&!ue.helper.isDisabled(c,f)&&ue.helper.isEnabled(c,f)&&!1!==de.onSelect.call(p,c,ue.get.mode())&&ue.selectDate(c),e.preventDefault(),e.stopPropagation()}38!==t&&40!==t||(e.preventDefault(),ue.popup("show"))},inputChange:function(){var e=l.val(),t=a.date(e,de);ue.set.date(t,!1)},inputFocus:function(){me.addClass(fe.active)},inputBlur:function(){if(me.removeClass(fe.active),de.formatInput){var e=ue.get.date(),t=ce.datetime(e,de);l.val(t)}m&&(ue.trigger.change(),m=!1)},class:{mutation:function(e){e.forEach(function(e){"class"===e.attributeName&&ue.check.disabled()})}}},observeChanges:function(){"MutationObserver"in T&&(e=new MutationObserver(ue.event.class.mutation),ue.debug("Setting up mutation observer",e),ue.observe.class())},disconnect:{classObserver:function(){l.length&&e&&e.disconnect()}},observe:{class:function(){l.length&&e&&e.observe(o[0],{attributes:!0})}},is:{disabled:function(){return o.hasClass(fe.disabled)}},check:{disabled:function(){l.attr("tabindex",ue.is.disabled()?-1:0)}},get:{weekOfYear:function(e,t,a){var n,r,i;return n=Date.UTC(e,t,a+3)/864e5,r=Math.floor(n/7),i=new Date(6048e5*r).getUTCFullYear(),r-Math.floor(Date.UTC(i,0,7)/6048e5)+1},date:function(){return ue.helper.sanitiseDate(o.data(pe.date))||null},inputDate:function(){return l.val()},focusDate:function(){return o.data(pe.focusDate)||null},startDate:function(){var e=ue.get.calendarModule(de.startCalendar);return(e?e.get.date():o.data(pe.startDate))||null},endDate:function(){var e=ue.get.calendarModule(de.endCalendar);return(e?e.get.date():o.data(pe.endDate))||null},minDate:function(){return o.data(pe.minDate)||null},maxDate:function(){return o.data(pe.maxDate)||null},monthOffset:function(){return o.data(pe.monthOffset)||de.monthOffset||0},mode:function(){var e=o.data(pe.mode)||de.startMode;return ue.get.validatedMode(e)},validatedMode:function(e){var t=ue.get.validModes();return 0<=De.inArray(e,t)?e:"time"===de.type?"hour":"month"===de.type?"month":"year"===de.type?"year":"day"},type:function(){return o.data(pe.type)||de.type},validModes:function(){var e=[];return"time"!==de.type&&(de.disableYear&&"year"!==de.type||e.push("year"),(de.disableMonth||"year"===de.type)&&"month"!==de.type||e.push("month"),0<=de.type.indexOf("date")&&e.push("day")),0<=de.type.indexOf("time")&&(e.push("hour"),de.disableMinute||e.push("minute")),e},isTouch:function(){try{return O.createEvent("TouchEvent"),!0}catch(e){return!1}},calendarModule:function(e){return e?(e instanceof De||(e=De(e).first()),e.data(r)):null}},set:{date:function(e,t,a){t=!1!==t,a=!1!==a,e=ue.helper.sanitiseDate(e),e=ue.helper.dateInRange(e);var n=ue.get.mode(),r=ce.datetime(e,de);if(a&&!1===de.onBeforeChange.call(p,e,r,n))return!1;if(ue.set.focusDate(e),de.isDisabled(e,n))return!1;var i=ue.get.endDate();i&&e&&i<e&&ue.set.endDate(ve),ue.set.dataKeyValue(pe.date,e),t&&l.length&&l.val(r),a&&de.onChange.call(p,e,r,n)},startDate:function(e,t){e=ue.helper.sanitiseDate(e);var a=ue.get.calendarModule(de.startCalendar);a&&a.set.date(e),ue.set.dataKeyValue(pe.startDate,e,t)},endDate:function(e,t){e=ue.helper.sanitiseDate(e);var a=ue.get.calendarModule(de.endCalendar);a&&a.set.date(e),ue.set.dataKeyValue(pe.endDate,e,t)},focusDate:function(e,t,a,n){e=ue.helper.sanitiseDate(e),e=ue.helper.dateInRange(e);var r="day"===ue.get.mode(),i=ue.get.focusDate();if(r&&e&&i){var o=12*(e.getFullYear()-i.getFullYear())+e.getMonth()-i.getMonth();if(o){var s=ue.get.monthOffset()-o;ue.set.monthOffset(s,!1)}}var l=ue.set.dataKeyValue(pe.focusDate,e,!!e&&t);a=!1!==a&&l&&!1===t||f!=n,f=n,a&&ue.update.focus(n)},minDate:function(e){e=ue.helper.sanitiseDate(e),null!==de.maxDate&&de.maxDate<=e?ue.verbose("Unable to set minDate variable bigger that maxDate variable",e,de.maxDate):(ue.setting("minDate",e),ue.set.dataKeyValue(pe.minDate,e))},maxDate:function(e){e=ue.helper.sanitiseDate(e),null!==de.minDate&&de.minDate>=e?ue.verbose("Unable to set maxDate variable lower that minDate variable",e,de.minDate):(ue.setting("maxDate",e),ue.set.dataKeyValue(pe.maxDate,e))},monthOffset:function(e,t){var a=Math.max(de.multiMonth,1);e=Math.max(1-a,Math.min(0,e)),ue.set.dataKeyValue(pe.monthOffset,e,t)},mode:function(e,t){ue.set.dataKeyValue(pe.mode,e,t)},dataKeyValue:function(e,t,a){var n=o.data(e),r=n===t||n<=t&&t<=n;return t?o.data(e,t):o.removeData(e),(a=!1!==a&&!r)&&ue.refresh(),!r}},selectDate:function(e,t){ue.verbose("New date selection",e);var a=ue.get.mode();if(t||"minute"===a||de.disableMinute&&"hour"===a||"date"===de.type&&"day"===a||"month"===de.type&&"month"===a||"year"===de.type&&"year"===a){if(!(!1===ue.set.date(e))&&(m=!0,de.closable)){ue.popup("hide");var n=ue.get.calendarModule(de.endCalendar);n&&(n.refresh(),"focus"!==n.setting("on")&&n.popup("show"),n.focus())}}else{var r="year"===a?de.disableMonth?"day":"month":"month"===a?"day":"day"===a?"hour":"minute";ue.set.mode(r),"hour"===a||"day"===a&&ue.get.date()?ue.set.date(e,!0,!1):ue.set.focusDate(e)}},changeDate:function(e){ue.set.date(e)},clear:function(){ue.set.date(ve)},popup:function(){return u.popup.apply(u,arguments)},focus:function(){l.length?l.focus():me.focus()},blur:function(){l.length?l.blur():me.blur()},helper:{isDisabled:function(a,n){return("day"===n||"month"===n||"year"===n||"hour"===n)&&("day"===n&&-1!==de.disabledDaysOfWeek.indexOf(a.getDay())||de.disabledDates.some(function(e){if("string"==typeof e&&(e=ue.helper.sanitiseDate(e)),e instanceof Date)return ue.helper.dateEqual(a,e,n);if(null!==e&&"object"==typeof e)if(e[pe.year]){if("number"==typeof e[pe.year])return a.getFullYear()==e[pe.year];if(Array.isArray(e[pe.year]))return-1<e[pe.year].indexOf(a.getFullYear())}else if(e[pe.month]){if("number"==typeof e[pe.month])return a.getMonth()==e[pe.month];if(Array.isArray(e[pe.month]))return-1<e[pe.month].indexOf(a.getMonth());if(e[pe.month]instanceof Date){var t=ue.helper.sanitiseDate(e[pe.month]);return a.getMonth()==t.getMonth()&&a.getFullYear()==t.getFullYear()}}else if(e[pe.date]&&"day"===n){if(e[pe.date]instanceof Date)return ue.helper.dateEqual(a,ue.helper.sanitiseDate(e[pe.date]),n);if(Array.isArray(e[pe.date]))return e[pe.date].some(function(e){return ue.helper.dateEqual(a,e,n)})}})||"hour"===n&&de.disabledHours.some(function(e){if("string"==typeof e&&(e=ue.helper.sanitiseDate(e)),e instanceof Date)return ue.helper.dateEqual(a,e,n);if("number"==typeof e)return a.getHours()===e;if(null!==e&&"object"==typeof e){var t=!0;if(e[pe.date])if(e[pe.date]instanceof Date)t=ue.helper.dateEqual(a,ue.helper.sanitiseDate(e[pe.date]));else if(Array.isArray(e[pe.date]))return e[pe.date].some(function(e){t=ue.helper.dateEqual(a,e,n)});if(e[pe.days]&&("number"==typeof e[pe.days]?t=a.getDay()==e[pe.days]:Array.isArray(e[pe.days])&&(t=-1<e[pe.days].indexOf(a.getDay()))),e[pe.hours]){if("number"==typeof e[pe.hours])return t&&a.getHours()==e[pe.hours];if(Array.isArray(e[pe.hours]))return t&&-1<e[pe.hours].indexOf(a.getHours())}}}))},isEnabled:function(t,a){return"day"!==a||(0===de.enabledDates.length||de.enabledDates.some(function(e){return"string"==typeof e&&(e=ue.helper.sanitiseDate(e)),e instanceof Date?ue.helper.dateEqual(t,e,a):null!==e&&"object"==typeof e&&e[pe.date]?ue.helper.dateEqual(t,ue.helper.sanitiseDate(e[pe.date]),a):void 0}))},findDayAsObject:function(t,a,e){if("day"===a||"month"===a||"year"===a)for(var n,r=0;r<e.length;r++){if("string"==typeof(n=e[r])&&(n=ue.helper.sanitiseDate(n)),n instanceof Date&&ue.helper.dateEqual(t,n,a)){var i={};return i[pe.date]=n,i}if(null!==n&&"object"==typeof n)if(n[pe.year]){if("number"==typeof n[pe.year]&&t.getFullYear()==n[pe.year])return n;if(Array.isArray(n[pe.year])&&-1<n[pe.year].indexOf(t.getFullYear()))return n}else if(n[pe.month]){if("number"==typeof n[pe.month]&&t.getMonth()==n[pe.month])return n;if(Array.isArray(n[pe.month])){if(-1<n[pe.month].indexOf(t.getMonth()))return n}else if(n[pe.month]instanceof Date){var o=ue.helper.sanitiseDate(n[pe.month]);if(t.getMonth()==o.getMonth()&&t.getFullYear()==o.getFullYear())return n}}else if(n[pe.date]&&"day"===a){if(n[pe.date]instanceof Date&&ue.helper.dateEqual(t,ue.helper.sanitiseDate(n[pe.date]),a))return n;if(Array.isArray(n[pe.date])&&n[pe.date].some(function(e){return ue.helper.dateEqual(t,e,a)}))return n}}return null},findHourAsObject:function(t,a,e){if("hour"===a)for(var n,r=function(e,t){if(t[pe.hours]){if("number"==typeof t[pe.hours]&&e.getHours()==t[pe.hours])return t;if(Array.isArray(t[pe.hours])&&-1<t[pe.hours].indexOf(e.getHours()))return t}},i=0;i<e.length;i++){if("number"==typeof(n=e[i])&&t.getHours()==n)return null;if(null!==n&&"object"==typeof n)if(n[pe.days]&&r(t,n)){if("number"==typeof n[pe.days]&&t.getDay()==n[pe.days])return n;if(Array.isArray(n[pe.days])&&-1<n[pe.days].indexOf(t.getDay()))return n}else if(n[pe.date]&&r(t,n)){if(n[pe.date]instanceof Date&&ue.helper.dateEqual(t,ue.helper.sanitiseDate(n[pe.date])))return n;if(Array.isArray(n[pe.date])&&n[pe.date].some(function(e){return ue.helper.dateEqual(t,e,a)}))return n}else if(r(t,n))return n}return null},sanitiseDate:function(e){return e instanceof Date||(e=a.date(""+e,de)),!e||isNaN(e.getTime())?null:e},dateDiff:function(e,t,a){a=a||"day";var n="time"===de.type,r="year"===a,i=r||"month"===a,o="minute"===a,s=o||"hour"===a;return e=new Date(n?2e3:e.getFullYear(),n?0:r?0:e.getMonth(),n?1:i?1:e.getDate(),s?e.getHours():0,o?de.minTimeGap*Math.floor(e.getMinutes()/de.minTimeGap):0),(t=new Date(n?2e3:t.getFullYear(),n?0:r?0:t.getMonth(),n?1:i?1:t.getDate(),s?t.getHours():0,o?de.minTimeGap*Math.floor(t.getMinutes()/de.minTimeGap):0)).getTime()-e.getTime()},dateEqual:function(e,t,a){return!!e&&!!t&&0===ue.helper.dateDiff(e,t,a)},isDateInRange:function(e,t,a,n){if(!a&&!n){var r=ue.get.startDate();a=r&&de.minDate?new Date(Math.max(r,de.minDate)):r||de.minDate,n=de.maxDate}return a=a&&new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),de.minTimeGap*Math.ceil(a.getMinutes()/de.minTimeGap)),!(!e||a&&0<ue.helper.dateDiff(e,a,t)||n&&0<ue.helper.dateDiff(n,e,t))},dateInRange:function(e,t,a){if(!t&&!a){var n=ue.get.startDate();t=n&&de.minDate?new Date(Math.max(n,de.minDate)):n||de.minDate,a=de.maxDate}t=t&&new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),de.minTimeGap*Math.ceil(t.getMinutes()/de.minTimeGap));var r="time"===de.type;return e?t&&0<ue.helper.dateDiff(e,t,"minute")?r?ue.helper.mergeDateTime(e,t):t:a&&0<ue.helper.dateDiff(a,e,"minute")?r?ue.helper.mergeDateTime(e,a):a:e:e},mergeDateTime:function(e,t){return e&&t?new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes()):t},isTodayButton:function(e){return e.text()===de.text.today}},setting:function(e,t){if(ue.debug("Changing setting",e,t),De.isPlainObject(e))De.extend(!0,de,e);else{if(t===ve)return de[e];De.isPlainObject(de[e])?De.extend(!0,de[e],t):de[e]=t}},internal:function(e,t){if(De.isPlainObject(e))De.extend(!0,ue,e);else{if(t===ve)return ue[e];ue[e]=t}},debug:function(){!de.silent&&de.debug&&(de.performance?ue.performance.log(arguments):(ue.debug=Function.prototype.bind.call(console.info,console,de.name+":"),ue.debug.apply(console,arguments)))},verbose:function(){!de.silent&&de.verbose&&de.debug&&(de.performance?ue.performance.log(arguments):(ue.verbose=Function.prototype.bind.call(console.info,console,de.name+":"),ue.verbose.apply(console,arguments)))},error:function(){de.silent||(ue.error=Function.prototype.bind.call(console.error,console,de.name+":"),ue.error.apply(console,arguments))},performance:{log:function(e){var t,a;de.performance&&(a=(t=(new Date).getTime())-(v||t),v=t,b.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:p,"Execution Time":a})),clearTimeout(ue.performance.timer),ue.performance.timer=setTimeout(ue.performance.display,500)},display:function(){var e=de.name+":",a=0;v=!1,clearTimeout(ue.performance.timer),De.each(b,function(e,t){a+=t["Execution Time"]}),e+=" "+a+"ms",D&&(e+=" '"+D+"'"),(console.group!==ve||console.table!==ve)&&0<b.length&&(console.groupCollapsed(e),console.table?console.table(b):De.each(b,function(e,t){console.log(t.Name+": "+t["Execution Time"]+"ms")}),console.groupEnd()),b=[]}},invoke:function(n,e,t){var r,i,a,o=d;return e=e||M,t=p||t,"string"==typeof n&&o!==ve&&(n=n.split(/[\. ]/),r=n.length-1,De.each(n,function(e,t){var a=e!=r?t+n[e+1].charAt(0).toUpperCase()+n[e+1].slice(1):n;if(De.isPlainObject(o[a])&&e!=r)o=o[a];else{if(o[a]!==ve)return i=o[a],!1;if(!De.isPlainObject(o[t])||e==r)return o[t]!==ve?i=o[t]:ue.error(s.method,n),!1;o=o[t]}})),De.isFunction(i)?a=i.apply(t,e):i!==ve&&(a=i),Array.isArray(y)?y.push(a):y!==ve?y=[y,a]:a!==ve&&(y=a),i}},w?(d===ve&&ue.initialize(),ue.invoke(C)):(d!==ve&&d.invoke("destroy"),ue.initialize())}),y!==ve?y:this},De.fn.calendar.settings={name:"Calendar",namespace:"calendar",silent:!1,debug:!1,verbose:!1,performance:!1,type:"datetime",firstDayOfWeek:0,constantHeight:!0,today:!1,closable:!0,monthFirst:!0,touchReadonly:!0,inline:!1,on:null,initialDate:null,startMode:!1,minDate:null,maxDate:null,ampm:!0,disableYear:!1,disableMonth:!1,disableMinute:!1,formatInput:!0,startCalendar:null,endCalendar:null,multiMonth:1,monthOffset:0,minTimeGap:5,showWeekNumbers:null,disabledHours:[],disabledDates:[],disabledDaysOfWeek:[],enabledDates:[],eventDates:[],centuryBreak:60,currentCentury:2e3,selectAdjacentDays:!1,popupOptions:{position:"bottom left",lastResort:"bottom left",prefer:"opposite",observeChanges:!1,hideOnScroll:!1},text:{days:["S","M","T","W","T","F","S"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",now:"Now",am:"AM",pm:"PM",weekNo:"Week"},formatter:{header:function(e,t,a){return"year"===t?a.formatter.yearHeader(e,a):"month"===t?a.formatter.monthHeader(e,a):"day"===t?a.formatter.dayHeader(e,a):"hour"===t?a.formatter.hourHeader(e,a):a.formatter.minuteHeader(e,a)},yearHeader:function(e,t){var a=10*Math.ceil(e.getFullYear()/10);return a-9+" - "+(2+a)},monthHeader:function(e,t){return e.getFullYear()},dayHeader:function(e,t){return t.text.months[e.getMonth()]+" "+e.getFullYear()},hourHeader:function(e,t){return t.formatter.date(e,t)},minuteHeader:function(e,t){return t.formatter.date(e,t)},dayColumnHeader:function(e,t){return t.text.days[e]},datetime:function(e,t){if(!e)return"";var a="time"===t.type?"":t.formatter.date(e,t),n=t.type.indexOf("time")<0?"":t.formatter.time(e,t,!1);return a+("datetime"===t.type?" ":"")+n},date:function(e,t){if(!e)return"";var a=e.getDate(),n=t.text.months[e.getMonth()],r=e.getFullYear();return"year"===t.type?r:"month"===t.type?n+" "+r:(t.monthFirst?n+" "+a:a+" "+n)+", "+r},time:function(e,t,a){if(!e)return"";var n=e.getHours(),r=e.getMinutes(),i="";return t.ampm&&(i=" "+(n<12?t.text.am:t.text.pm),n=0===n?12:12<n?n-12:n),n+":"+(r<10?"0":"")+r+i},today:function(e){return"date"===e.type?e.text.today:e.text.now},cell:function(e,t,a){}},parser:{date:function(e,t){if(e instanceof Date)return e;if(!e)return null;if(0===(e=String(e).trim().replace(/([.:\/\-])\s+/g,"$1").replace(/\s+([.:\/-])/g,"$1").replace(/\s+/g," ")).length)return null;e.match(/^[0-9]{4}[\/\-\.][0-9]{1,2}[\/\-\.][0-9]{1,2}$/)&&(e=e.replace(/[\/\-\.]/g,"/")+" 00:00:00"),e=t.monthFirst||!e.match(/^[0-9]{1,2}[\/\-\.]/)?e:e.replace(/[\/\-\.]/g,"/").replace(/([0-9]+)\/([0-9]+)/,"$2/$1");var a,n,r,i=new Date(e);if(!(null!==e.match(/^[0-9]+$/))&&!isNaN(i.getDate()))return i;e=e.toLowerCase();var o,s,l,u=-1,d=-1,f=-1,c=-1,p=-1,h=ve,m="time"===t.type,g=t.type.indexOf("time")<0,y=e.split(t.regExp.dateWords),D=e.split(t.regExp.dateNumbers);if(!g)for(h=0<=De.inArray(t.text.am.toLowerCase(),y)||!(0<=De.inArray(t.text.pm.toLowerCase(),y))&&ve,a=0;a<D.length;a++)if(0<=(s=D[a]).indexOf(":")){if(d<0||u<0)for(l=s.split(":"),r=0;r<Math.min(2,l.length);r++)n=parseInt(l[r]),isNaN(n)&&(n=0),0===r?d=n%24:u=n%60;D.splice(a,1)}if(!m){for(a=0;a<y.length;a++)if(!((o=y[a]).length<=0)){for(n=0;n<t.text.months.length;n++)if(t.text.months[n].substring(0,o.length).toLowerCase()===o){c=n+1;break}if(0<=c)break}for(a=0;a<D.length;a++)if(n=parseInt(D[a]),!isNaN(n)&&n>=t.centuryBreak&&a===D.length-1){n<=99&&(n+=t.currentCentury-100),p=n,D.splice(a,1);break}if(c<0)for(a=0;a<D.length;a++)if(r=1<a||t.monthFirst?a:1===a?0:1,n=parseInt(D[r]),!isNaN(n)&&1<=n&&n<=12){c=n,D.splice(r,1);break}for(a=0;a<D.length;a++)if(n=parseInt(D[a]),!isNaN(n)&&1<=n&&n<=31){f=n,D.splice(a,1);break}if(p<0)for(a=D.length-1;0<=a;a--)if(n=parseInt(D[a]),!isNaN(n)){n<=99&&(n+=t.currentCentury),p=n,D.splice(a,1);break}}if(!g){if(d<0)for(a=0;a<D.length;a++)if(n=parseInt(D[a]),!isNaN(n)&&0<=n&&n<=23){d=n,D.splice(a,1);break}if(u<0)for(a=0;a<D.length;a++)if(n=parseInt(D[a]),!isNaN(n)&&0<=n&&n<=59){u=n,D.splice(a,1);break}}if(u<0&&d<0&&f<0&&c<0&&p<0)return null;u<0&&(u=0),d<0&&(d=0),f<0&&(f=1),c<0&&(c=1),p<0&&(p=(new Date).getFullYear()),h!==ve&&(h?12===d&&(d=0):d<12&&(d+=12));var v=new Date(p,c-1,f,d,u);return v.getMonth()===c-1&&v.getFullYear()===p||(v=new Date(p,c,0,d,u)),isNaN(v.getTime())?null:v}},onBeforeChange:function(e,t,a){return!0},onChange:function(e,t,a){},onShow:function(){},onVisible:function(){},onHide:function(){},onHidden:function(){},onSelect:function(e,t){},isDisabled:function(e,t){return!1},selector:{popup:".ui.popup",input:"input",activator:"input",append:".inline.field,.inline.fields"},regExp:{dateWords:/[^A-Za-z\u00C0-\u024F]+/g,dateNumbers:/[^\d:]+/g},error:{popup:"UI Popup, a required component is not included in this page",method:"The method you called is not defined."},className:{calendar:"calendar",active:"active",popup:"ui popup",grid:"ui equal width grid",column:"column",table:"ui celled center aligned unstackable table",inverted:"inverted",prev:"prev link",next:"next link",prevIcon:"chevron left icon",nextIcon:"chevron right icon",link:"link",cell:"link",disabledCell:"disabled",weekCell:"disabled",adjacentCell:"adjacent",activeCell:"active",rangeCell:"range",focusCell:"focus",todayCell:"today",today:"today link",disabled:"disabled"},metadata:{date:"date",focusDate:"focusDate",startDate:"startDate",endDate:"endDate",minDate:"minDate",maxDate:"maxDate",mode:"mode",type:"type",monthOffset:"monthOffset",message:"message",class:"class",inverted:"inverted",variation:"variation",position:"position",month:"month",year:"year",hours:"hours",days:"days"},eventClass:"blue"}}(jQuery,window,document);
|
package/dist/components/card.css
CHANGED