芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/www/dustinevents.com/assets/common/js/jquery.timepicker.min.js
!function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;i
e.length)&&(t=e.length);for(var i=0,n=new Array(t);i
=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,l=!0,o=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return l=e.done,e},e:function(e){o=!0,s=e},f:function(){try{l||null==i.return||i.return()}finally{if(o)throw s}}}}var o=86400;function u(e,t){return e==o&&t.show2400?e:e%o}var c,m={appendTo:"body",className:null,closeOnWindow:!1,closeOnScroll:!1,disableTextInput:!1,disableTimeRanges:[],disableTouchKeyboard:!1,durationTime:null,forceRoundTime:!1,lang:{},listWidth:null,maxTime:null,minTime:null,noneOption:!1,orientation:"l",roundingFunction:function(e,t){if(null===e)return null;for(var i=0,n=0;n
1&&void 0!==arguments[1]?arguments[1]:{};t(this,n),this._handleFormatValue=this._handleFormatValue.bind(this),this._handleKeyUp=this._handleKeyUp.bind(this),this.targetEl=e;var r=n.extractAttrOptions(e,Object.keys(m));this.settings=this.parseSettings(s(s(s({},m),i),r))}var r,a,u;return r=n,u=[{key:"extractAttrOptions",value:function(e,t){var i,n={},r=l(t);try{for(r.s();!(i=r.n()).done;){var s=i.value;s in e.dataset&&(n[s]=e.dataset[s])}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"isVisible",value:function(e){var t=e[0];return t.offsetWidth>0&&t.offsetHeight>0}},{key:"hideAll",value:function(){var e,t=l(document.getElementsByClassName("ui-timepicker-input"));try{for(t.s();!(e=t.n()).done;){var i=e.value.timepickerObj;i&&i.hideMe()}}catch(e){t.e(e)}finally{t.f()}}}],(a=[{key:"hideMe",value:function(){if(this.settings.useSelect)this.targetEl.blur();else if(this.list&&n.isVisible(this.list)){this.settings.selectOnBlur&&this._selectValue(),this.list.hide();var e=new CustomEvent("hideTimepicker",f);this.targetEl.dispatchEvent(e)}}},{key:"_findRow",value:function(e){if(!e&&0!==e)return!1;var t=!1;return e=this.settings.roundingFunction(e,this.settings),!!this.list&&(this.list.find("li").each((function(i,n){var r=parseInt(n.dataset.time);if(!isNaN(r))return r==e?(t=n,!1):void 0})),t)}},{key:"_hideKeyboard",value:function(){return(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.settings.disableTouchKeyboard}},{key:"_setTimeValue",value:function(e,t){if("INPUT"===this.targetEl.nodeName){null===e&&""==this.targetEl.value||(this.targetEl.value=e);var i=this;i.settings.useSelect&&"select"!=t&&i.list&&i.list.val(i._roundAndFormatTime(i.anytime2int(e)))}var n=new CustomEvent("selectTime",f);if(this.selectedValue!=e){this.selectedValue=e;var r=new CustomEvent("changeTime",f),s=new CustomEvent("change",Object.assign(f,{detail:"timepicker"}));return"select"==t?(this.targetEl.dispatchEvent(n),this.targetEl.dispatchEvent(r),this.targetEl.dispatchEvent(s)):-1==["error","initial"].indexOf(t)&&this.targetEl.dispatchEvent(r),!0}return-1==["error","initial"].indexOf(t)&&this.targetEl.dispatchEvent(n),!1}},{key:"_getTimeValue",value:function(){return"INPUT"===this.targetEl.nodeName?this.targetEl.value:this.selectedValue}},{key:"_selectValue",value:function(){var e=this;e.settings;var t=e.list.find(".ui-timepicker-selected");if(t.hasClass("ui-timepicker-disabled"))return!1;if(!t.length)return!0;var i=t.get(0).dataset.time;if(i){var n=parseInt(i);isNaN(n)||(i=n)}return null!==i&&("string"!=typeof i&&(i=e._int2time(i)),e._setTimeValue(i,"select")),!0}},{key:"anytime2int",value:function(t){return"number"==typeof t?t:"string"==typeof t?this.time2int(t):"object"===e(t)&&t instanceof Date?3600*t.getHours()+60*t.getMinutes()+t.getSeconds():"function"==typeof t?t():null}},{key:"time2int",value:function(e){if(""===e||null==e)return null;if("now"===e)return this.anytime2int(new Date);if("string"!=typeof e)return e;"a"!=(e=e.toLowerCase().replace(/[\s\.]/g,"")).slice(-1)&&"p"!=e.slice(-1)||(e+="m");var t=/^(([^0-9]*))?([0-9]?[0-9])(([0-5][0-9]))?(([0-5][0-9]))?(([^0-9]*))$/;e.match(/\W/)&&(t=/^(([^0-9]*))?([0-9]?[0-9])(\W+([0-5][0-9]?))?(\W+([0-5][0-9]))?(([^0-9]*))$/);var i=e.match(t);if(!i)return null;var n=parseInt(1*i[3],10),r=i[2]||i[9],s=this.parseMinuteString(i[5]),a=1*i[7]||0;r||2!=i[3].length||"0"!=i[3][0]||(r="am"),n>24&&!s&&(n=1*i[3][0],s=this.parseMinuteString(i[3][1]));var l=n;if(n<=12&&r){var u=(r=r.trim())==this.settings.lang.pm||r==this.settings.lang.PM;l=12==n?u?12:0:n+(u?12:0)}else if(3600*n+60*s+a>=o+(this.settings.show2400?1:0)){if(!1===this.settings.wrapHours)return null;l=n%24}var c=3600*l+60*s+a;if(n<12&&!r&&this.settings._twelveHourTime&&this.settings.scrollDefault()){var m=c-this.settings.scrollDefault();m<0&&m>=-43200&&(c=(c+43200)%o)}return c}},{key:"parseMinuteString",value:function(e){e||(e=0);var t=1;return 1==e.length&&(t=10),parseInt(e)*t||0}},{key:"intStringDateOrFunc2func",value:function(e){var t=this;return null==e?function(){return null}:"function"==typeof e?function(){return t.anytime2int(e())}:function(){return t.anytime2int(e)}}},{key:"parseSettings",value:function(e){if(e.lang=s(s({},d),e.lang),this.settings=e,e.listWidth&&(e.listWidth=this.anytime2int(e.listWidth)),e.minTime=this.intStringDateOrFunc2func(e.minTime),e.maxTime=this.intStringDateOrFunc2func(e.maxTime),e.durationTime=this.intStringDateOrFunc2func(e.durationTime),e.scrollDefault?e.scrollDefault=this.intStringDateOrFunc2func(e.scrollDefault):e.scrollDefault=e.minTime,"string"==typeof e.timeFormat&&e.timeFormat.match(/[gh]/)&&(e._twelveHourTime=!0),"function"!=typeof e.step){var t=e.step;e.step=function(){return t}}return e.disableTimeRanges=this._parseDisableTimeRanges(e.disableTimeRanges),e.closeOnWindowScroll&&!e.closeOnScroll&&(e.closeOnScroll=e.closeOnWindowScroll),!0===e.closeOnScroll&&(e.closeOnScroll=window.document),e}},{key:"_parseDisableTimeRanges",value:function(e){if(!e||0==e.length)return[];for(var t in e)e[t]=[this.anytime2int(e[t][0]),this.anytime2int(e[t][1])];for(t=(e=e.sort((function(e,t){return e[0]-t[0]}))).length-1;t>0;t--)e[t][0]<=e[t-1][1]&&(e[t-1]=[Math.min(e[t][0],e[t-1][0]),Math.max(e[t][1],e[t-1][1])],e.splice(t,1));return e}},{key:"_disableTextInputHandler",value:function(e){switch(e.keyCode){case 13:case 9:return;default:e.preventDefault()}}},{key:"_int2duration",value:function(e,t){e=Math.abs(e);var i,n,r=Math.round(e/60),s=[];return r<60?s=[r,this.settings.lang.mins]:(i=Math.floor(r/60),n=r%60,30==t&&30==n&&(i+=this.settings.lang.decimal+5),s.push(i),s.push(1==i?this.settings.lang.hr:this.settings.lang.hrs),30!=t&&n&&(s.push(n),s.push(this.settings.lang.mins))),s.join(" ")}},{key:"_roundAndFormatTime",value:function(e){if(null!==(e=this.settings.roundingFunction(e,this.settings)))return this._int2time(e)}},{key:"_int2time",value:function(e){if("number"!=typeof e)return null;var t=parseInt(e%60),i=parseInt(e/60%60),n=parseInt(e/3600%24),r=new Date(1970,0,2,n,i,t,0);if(isNaN(r.getTime()))return null;if("function"==typeof this.settings.timeFormat)return this.settings.timeFormat(r);for(var s,a,l="",u=0;u
11?this.settings.lang.pm:this.settings.lang.am;break;case"A":l+=r.getHours()>11?this.settings.lang.PM:this.settings.lang.AM;break;case"g":l+=0==(s=r.getHours()%12)?"12":s;break;case"G":s=r.getHours(),e===o&&(s=this.settings.show2400?24:0),l+=s;break;case"h":0!=(s=r.getHours()%12)&&s<10&&(s="0"+s),l+=0===s?"12":s;break;case"H":s=r.getHours(),e===o&&(s=this.settings.show2400?24:0),l+=s>9?s:"0"+s;break;case"i":l+=(i=r.getMinutes())>9?i:"0"+i;break;case"s":l+=(t=r.getSeconds())>9?t:"0"+t;break;case"\\":u++,l+=this.settings.timeFormat.charAt(u);break;default:l+=a}return l}},{key:"_setSelected",value:function(){var e=this.list;e.find("li").removeClass("ui-timepicker-selected");var t=this.anytime2int(this._getTimeValue());if(null!==t){var i=this._findRow(t);if(i){var n=i.getBoundingClientRect(),r=e.get(0).getBoundingClientRect(),s=n.top-r.top;if(s+n.height>r.height||s<0){var a=e.scrollTop()+(n.top-r.top)-n.height;e.scrollTop(a)}var l=parseInt(i.dataset.time);(this.settings.forceRoundTime||l===t)&&i.classList.add("ui-timepicker-selected")}}}},{key:"_isFocused",value:function(e){return e===document.activeElement}},{key:"_handleFormatValue",value:function(e){e&&"timepicker"==e.detail||this._formatValue(e)}},{key:"_formatValue",value:function(e,t){if(""!==this.targetEl.value){if(!this._isFocused(this.targetEl)||e&&"change"==e.type){var i=this.settings,n=this.anytime2int(this.targetEl.value);if(null!==n){var r=!1;null!==i.minTime&&null!==i.maxTime&&(n
i.maxTime())&&(r=!0);var s,a=l(i.disableTimeRanges);try{for(a.s();!(s=a.n()).done;){var o=s.value;if(n>=o[0]&&n
c&&(v-=o);var y=e._int2duration(c-v,n.step());h.duration=y}var b,k=l(n.disableTimeRanges);try{for(k.s();!(b=k.n()).done;){var T=b.value;if(d%o>=T[0]&&d%o
t(window).height()+t(window).scrollTop()?"t":"b")?(l.addClass("ui-timepicker-positioned-top"),o.top=i.offset().top-l.outerHeight()+parseInt(l.css("marginTop").replace("px",""),10)):(l.removeClass("ui-timepicker-positioned-top"),o.top=i.offset().top+i.outerHeight()+parseInt(l.css("marginTop").replace("px",""),10)),l.offset(o);var u=l.find(".ui-timepicker-selected");if(!u.length){var c=s.anytime2int(s._getTimeValue());null!==c?u=t(s._findRow(c)):a.scrollDefault()&&(u=t(s._findRow(a.scrollDefault())))}if(u.length&&!u.hasClass("ui-timepicker-disabled")||(u=l.find("li:not(.ui-timepicker-disabled):first")),u&&u.length){var m=l.scrollTop()+u.position().top-u.outerHeight();l.scrollTop(m)}else l.scrollTop(0);return a.stopScrollPropagation&&t(document).on("wheel.ui-timepicker",".ui-timepicker-wrapper",(function(e){e.preventDefault();var i=t(this).scrollTop();t(this).scrollTop(i+e.originalEvent.deltaY)})),t(document).on("mousedown.ui-timepicker",r),window.addEventListener("resize",r),a.closeOnScroll&&t(a.closeOnScroll).on("scroll.ui-timepicker",r),i.trigger("showTimepicker"),this}}},hide:function(e){var t=this[0].timepickerObj;return t&&t.hideMe(),p.hideAll(),this},option:function(i,r){return"string"==typeof i&&void 0===r?this[0].timepickerObj.settings[i]:this.each((function(){var s=t(this),a=s[0].timepickerObj,l=a.settings,o=a.list;"object"==e(i)?l=t.extend(l,i):"string"==typeof i&&(l[i]=r),l=a.parseSettings(l),a.settings=l,a._formatValue({type:"change"},"initial"),o&&(o.remove(),a.list=null),l.useSelect&&n(s)}))},getSecondsFromMidnight:function(){var e=this[0].timepickerObj;return e.anytime2int(e._getTimeValue())},getTime:function(e){var t=this[0].timepickerObj,i=t._getTimeValue();if(!i)return null;var n=t.anytime2int(i);if(null===n)return null;e||(e=new Date);var r=new Date(e);return r.setHours(n/3600),r.setMinutes(n%3600/60),r.setSeconds(n%60),r.setMilliseconds(0),r},isVisible:function(){var e=this[0].timepickerObj;return!!(e&&e.list&&p.isVisible(e.list))},setTime:function(e){var t=this[0].timepickerObj,i=t.settings;if(i.forceRoundTime)var n=t._roundAndFormatTime(t.anytime2int(e));else n=t._int2time(t.anytime2int(e));return e&&null===n&&i.noneOption&&(n=e),t._setTimeValue(n,"initial"),t._formatValue({type:"change"},"initial"),t&&t.list&&t._setSelected(),this},remove:function(){var e=this;if(e.hasClass("ui-timepicker-input")){var t=e[0].timepickerObj,i=t.settings;return e.removeAttr("autocomplete","off"),e.removeClass("ui-timepicker-input"),e.removeData("timepicker-obj"),e.off(".timepicker"),t.list&&t.list.remove(),i.useSelect&&e.show(),t.list=null,this}}};function n(e){var n=e[0].timepickerObj,r=n.list,s=n.settings;r&&r.length&&(r.remove(),n.list=null);var a=t(y(n));if(r=s.useSelect?a:a.children("ul"),a.data("timepicker-input",e),n.list=a,s.useSelect)e.val()&&r.val(n._roundAndFormatTime(n.anytime2int(e.val()))),r.on("focus",(function(){t(this).data("timepicker-input").trigger("showTimepicker")})),r.on("blur",(function(){t(this).data("timepicker-input").trigger("hideTimepicker")})),r.on("change",(function(){n._setTimeValue(t(this).val(),"select")})),n._setTimeValue(r.val(),"initial"),e.hide().after(r);else{var l=s.appendTo;"string"==typeof l?l=t(l):"function"==typeof l&&(l=l(e)),l.append(a),n._setSelected(),r.on("mousedown click","li",(function(s){e.off("focus.timepicker"),e.on("focus.timepicker-ie-hack",(function(){e.off("focus.timepicker-ie-hack"),e.on("focus.timepicker",i.show)})),n._hideKeyboard()||e[0].focus(),r.find("li").removeClass("ui-timepicker-selected"),t(this).addClass("ui-timepicker-selected"),n._selectValue()&&(e.trigger("hideTimepicker"),r.on("mouseup.timepicker click.timepicker","li",(function(e){r.off("mouseup.timepicker click.timepicker"),a.hide()})))}))}}function r(e){if("focus"!=e.type||e.target!=window){var i=t(e.target);i.closest(".ui-timepicker-input").length||i.closest(".ui-timepicker-wrapper").length||(p.hideAll(),t(document).off(".ui-timepicker"),t(window).off(".ui-timepicker"))}}function s(e){var n=t(this),r=n[0].timepickerObj,s=r.list;if(!s||!p.isVisible(s)){if(40!=e.keyCode)return!0;i.show.call(n.get(0)),s=r.list,r._hideKeyboard()||n.trigger("focus")}switch(e.keyCode){case 13:return r._selectValue()&&(r._formatValue({type:"change"}),r.hideMe()),e.preventDefault(),!1;case 38:var a=s.find(".ui-timepicker-selected");return a.length?a.is(":first-child")||(a.removeClass("ui-timepicker-selected"),a.prev().addClass("ui-timepicker-selected"),a.prev().position().top
0)return a=t(i),!1})),a.addClass("ui-timepicker-selected")),!1;case 40:return 0===(a=s.find(".ui-timepicker-selected")).length?(s.find("li").each((function(e,i){if(t(i).position().top>0)return a=t(i),!1})),a.addClass("ui-timepicker-selected")):a.is(":last-child")||(a.removeClass("ui-timepicker-selected"),a.next().addClass("ui-timepicker-selected"),a.next().position().top+2*a.outerHeight()>s.outerHeight()&&s.scrollTop(s.scrollTop()+a.outerHeight())),!1;case 27:s.find("li").removeClass("ui-timepicker-selected"),r.hideMe();break;case 9:r.hideMe();break;default:return!0}}t.fn.timepicker=function(n){return this.length?i[n]?this.hasClass("ui-timepicker-input")?i[n].apply(this,Array.prototype.slice.call(arguments,1)):this:"object"!==e(n)&&n?void t.error("Method "+n+" does not exist on jQuery.timepicker"):i.init.apply(this,arguments):this},t.fn.timepicker.defaults=m},"object"===("undefined"==typeof exports?"undefined":e(exports))&&exports&&"object"===("undefined"==typeof module?"undefined":e(module))&&module&&module.exports===exports?c(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],c):c(jQuery)}();