{"size": 15103, "ext": "js", "max_stars_repo_path": "Antd/Scripts/jquery.timepicker.min.js", "max_stars_repo_name": "Heather/Antd", "max_stars_repo_stars_event_min_datetime": "2015-01-08T09:00:20.000Z", "max_stars_repo_stars_event_max_datetime": "2015-02-14T16:15:29.000Z", "max_issues_repo_path": "Antd/Scripts/jquery.timepicker.min.js", "max_issues_repo_name": "Heather/Antd", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Antd/Scripts/jquery.timepicker.min.js", "max_forks_repo_name": "Heather/Antd", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 2157.5714285714, "max_line_length": 14862, "alphanum_fraction": 0.5941865854}
/*!
 * jquery-timepicker v1.4.6 - A jQuery timepicker plugin inspired by Google Calendar. It supports both mouse and keyboard navigation.
 * Copyright (c) 2014 Jon Thornton - http://jonthornton.github.com/jquery-timepicker/
 * License:
 */

!function (a) { "function" == typeof define && define.amd ? define(["jquery"], a) : a(jQuery) }(function (a) { function b(a) { if (a.minTime && (a.minTime = t(a.minTime)), a.maxTime && (a.maxTime = t(a.maxTime)), a.durationTime && "function" != typeof a.durationTime && (a.durationTime = t(a.durationTime)), "now" == a.scrollDefault ? a.scrollDefault = t(new Date) : a.scrollDefault ? a.scrollDefault = t(a.scrollDefault) : a.minTime && (a.scrollDefault = a.minTime), a.scrollDefault && (a.scrollDefault = e(a.scrollDefault, a)), a.timeFormat.match(/[gh]/) && (a._twelveHourTime = !0), a.disableTimeRanges.length > 0) { for (var b in a.disableTimeRanges) a.disableTimeRanges[b] = [t(a.disableTimeRanges[b][0]), t(a.disableTimeRanges[b][1])]; a.disableTimeRanges = a.disableTimeRanges.sort(function (a, b) { return a[0] - b[0] }); for (var b = a.disableTimeRanges.length - 1; b > 0; b--) a.disableTimeRanges[b][0] <= a.disableTimeRanges[b - 1][1] && (a.disableTimeRanges[b - 1] = [Math.min(a.disableTimeRanges[b][0], a.disableTimeRanges[b - 1][0]), Math.max(a.disableTimeRanges[b][1], a.disableTimeRanges[b - 1][1])], a.disableTimeRanges.splice(b, 1)) } return a } function c(b) { var c = b.data("timepicker-settings"), e = b.data("timepicker-list"); if (e && e.length && (e.remove(), b.data("timepicker-list", !1)), c.useSelect) { e = a("<select />", { "class": "ui-timepicker-select" }); var g = e } else { e = a("<ul />", { "class": "ui-timepicker-list" }); var g = a("<div />", { "class": "ui-timepicker-wrapper", tabindex: -1 }); g.css({ display: "none", position: "absolute" }).append(e) } if (c.noneOption) if (c.noneOption === !0 && (c.noneOption = c.useSelect ? "Time..." : "None"), a.isArray(c.noneOption)) { for (var h in c.noneOption) if (parseInt(h, 10) === h) { var j = d(c.noneOption[h], c.useSelect); e.append(j) } } else { var j = d(c.noneOption, c.useSelect); e.append(j) } c.className && g.addClass(c.className), null === c.minTime && null === c.durationTime || !c.showDuration || (g.addClass("ui-timepicker-with-duration"), g.addClass("ui-timepicker-step-" + c.step)); var l = c.minTime; "function" == typeof c.durationTime ? l = t(c.durationTime()) : null !== c.durationTime && (l = c.durationTime); var m = null !== c.minTime ? c.minTime : 0, o = null !== c.maxTime ? c.maxTime : m + v - 1; m >= o && (o += v), o === v - 1 && -1 !== c.timeFormat.indexOf("H") && (o = v); for (var p = c.disableTimeRanges, u = 0, w = p.length, h = m; o >= h; h += 60 * c.step) { var x = h, z = s(x, c.timeFormat); if (c.useSelect) { var A = a("<option />", { value: z }); A.text(z) } else { var A = a("<li />"); A.data("time", 86400 >= x ? x : x % 86400), A.text(z) } if ((null !== c.minTime || null !== c.durationTime) && c.showDuration) { var B = r(h - l, c.step); if (c.useSelect) A.text(A.text() + " (" + B + ")"); else { var C = a("<span />", { "class": "ui-timepicker-duration" }); C.text(" (" + B + ")"), A.append(C) } } w > u && (x >= p[u][1] && (u += 1), p[u] && x >= p[u][0] && x < p[u][1] && (c.useSelect ? A.prop("disabled", !0) : A.addClass("ui-timepicker-disabled"))), e.append(A) } if (g.data("timepicker-input", b), b.data("timepicker-list", g), c.useSelect) e.val(f(b.val(), c)), e.on("focus", function () { a(this).data("timepicker-input").trigger("showTimepicker") }), e.on("blur", function () { a(this).data("timepicker-input").trigger("hideTimepicker") }), e.on("change", function () { n(b, a(this).val(), "select") }), b.hide().after(e); else { var D = c.appendTo; "string" == typeof D ? D = a(D) : "function" == typeof D && (D = D(b)), D.append(g), k(b, e), e.on("mousedown", "li", function () { b.off("focus.timepicker"), b.on("focus.timepicker-ie-hack", function () { b.off("focus.timepicker-ie-hack"), b.on("focus.timepicker", y.show) }), i(b) || b[0].focus(), e.find("li").removeClass("ui-timepicker-selected"), a(this).addClass("ui-timepicker-selected"), q(b) && (b.trigger("hideTimepicker"), g.hide()) }) } } function d(b, c) { var d, e, f; return "object" == typeof b ? (d = b.label, e = b.className, f = b.value) : "string" == typeof b ? d = b : a.error("Invalid noneOption value"), c ? a("<option />", { value: f, "class": e, text: d }) : a("<li />", { "class": e, text: d }).data("time", f) } function e(b, c) { if (a.isNumeric(b) || (b = t(b)), null === b) return null; var d = b % (60 * c.step); return d >= 30 * c.step ? b += 60 * c.step - d : b -= d, b } function f(a, b) { return a = e(a, b), null !== a ? s(a, b.timeFormat) : void 0 } function g() { return new Date(1970, 1, 1, 0, 0, 0) } function h(b) { var c = a(b.target), d = c.closest(".ui-timepicker-input"); 0 === d.length && 0 === c.closest(".ui-timepicker-wrapper").length && (y.hide(), a(document).unbind(".ui-timepicker")) } function i(a) { var b = a.data("timepicker-settings"); return (window.navigator.msMaxTouchPoints || "ontouchstart" in document) && b.disableTouchKeyboard } function j(b, c, d) { if (!d && 0 !== d) return !1; var e = b.data("timepicker-settings"), f = !1, g = 30 * e.step; return c.find("li").each(function (b, c) { var e = a(c); if ("number" == typeof e.data("time")) { var h = e.data("time") - d; return Math.abs(h) < g || h == g ? (f = e, !1) : void 0 } }), f } function k(a, b) { b.find("li").removeClass("ui-timepicker-selected"); var c = t(m(a), a.data("timepicker-settings")); if (null !== c) { var d = j(a, b, c); if (d) { var e = d.offset().top - b.offset().top; (e + d.outerHeight() > b.outerHeight() || 0 > e) && b.scrollTop(b.scrollTop() + d.position().top - d.outerHeight()), d.addClass("ui-timepicker-selected") } } } function l(b) { if ("" !== this.value) { { var c = a(this); c.data("timepicker-list") } if (!c.is(":focus") || b && "change" == b.type) { var d = t(this.value); if (null === d) return void c.trigger("timeFormatError"); var e = c.data("timepicker-settings"), f = !1; if (null !== e.minTime && d < e.minTime ? f = !0 : null !== e.maxTime && d > e.maxTime && (f = !0), a.each(e.disableTimeRanges, function () { return d >= this[0] && d < this[1] ? (f = !0, !1) : void 0 }), e.forceRoundTime) { var g = d % (60 * e.step); g >= 30 * e.step ? d += 60 * e.step - g : d -= g } var h = s(d, e.timeFormat); f ? n(c, h, "error") && c.trigger("timeRangeError") : n(c, h) } } } function m(a) { return a.is("input") ? a.val() : a.data("ui-timepicker-value") } function n(a, b, c) { if (a.is("input")) { a.val(b); var d = a.data("timepicker-settings"); d.useSelect && a.data("timepicker-list").val(f(b, d)) } return a.data("ui-timepicker-value") != b ? (a.data("ui-timepicker-value", b), "select" == c ? a.trigger("selectTime").trigger("changeTime").trigger("change") : "error" != c && a.trigger("changeTime"), !0) : (a.trigger("selectTime"), !1) } function o(b) { var c = a(this), d = c.data("timepicker-list"); if (!d || !d.is(":visible")) { if (40 != b.keyCode) return !0; y.show.call(c.get(0)), d = c.data("timepicker-list"), i(c) || c.focus() } switch (b.keyCode) { case 13: return q(c) && y.hide.apply(this), b.preventDefault(), !1; case 38: var e = d.find(".ui-timepicker-selected"); return e.length ? e.is(":first-child") || (e.removeClass("ui-timepicker-selected"), e.prev().addClass("ui-timepicker-selected"), e.prev().position().top < e.outerHeight() && d.scrollTop(d.scrollTop() - e.outerHeight())) : (d.find("li").each(function (b, c) { return a(c).position().top > 0 ? (e = a(c), !1) : void 0 }), e.addClass("ui-timepicker-selected")), !1; case 40: return e = d.find(".ui-timepicker-selected"), 0 === e.length ? (d.find("li").each(function (b, c) { return a(c).position().top > 0 ? (e = a(c), !1) : void 0 }), e.addClass("ui-timepicker-selected")) : e.is(":last-child") || (e.removeClass("ui-timepicker-selected"), e.next().addClass("ui-timepicker-selected"), e.next().position().top + 2 * e.outerHeight() > d.outerHeight() && d.scrollTop(d.scrollTop() + e.outerHeight())), !1; case 27: d.find("li").removeClass("ui-timepicker-selected"), y.hide(); break; case 9: y.hide(); break; default: return !0 } } function p(b) { var c = a(this), d = c.data("timepicker-list"); if (!d || !d.is(":visible")) return !0; if (!c.data("timepicker-settings").typeaheadHighlight) return d.find("li").removeClass("ui-timepicker-selected"), !0; switch (b.keyCode) { case 96: case 97: case 98: case 99: case 100: case 101: case 102: case 103: case 104: case 105: case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: case 65: case 77: case 80: case 186: case 8: case 46: k(c, d); break; default: return } } function q(a) { var b = a.data("timepicker-settings"), c = a.data("timepicker-list"), d = null, e = c.find(".ui-timepicker-selected"); if (e.hasClass("ui-timepicker-disabled")) return !1; if (e.length && (d = e.data("time")), null !== d) if ("string" == typeof d) a.val(d); else { var f = s(d, b.timeFormat); n(a, f, "select") } return !0 } function r(a, b) { a = Math.abs(a); var c, d, e = Math.round(a / 60), f = []; return 60 > e ? f = [e, x.mins] : (c = Math.floor(e / 60), d = e % 60, 30 == b && 30 == d && (c += x.decimal + 5), f.push(c), f.push(1 == c ? x.hr : x.hrs), 30 != b && d && (f.push(d), f.push(x.mins))), f.join(" ") } function s(a, b) { if (null !== a) { var c = new Date(u.valueOf() + 1e3 * a); if (!isNaN(c.getTime())) { for (var d, e, f = "", g = 0; g < b.length; g++) switch (e = b.charAt(g)) { case "a": f += c.getHours() > 11 ? x.pm : x.am; break; case "A": f += c.getHours() > 11 ? x.PM : x.AM; break; case "g": d = c.getHours() % 12, f += 0 === d ? "12" : d; break; case "G": f += c.getHours(); break; case "h": d = c.getHours() % 12, 0 !== d && 10 > d && (d = "0" + d), f += 0 === d ? "12" : d; break; case "H": d = c.getHours(), a === v && (d = 24), f += d > 9 ? d : "0" + d; break; case "i": var h = c.getMinutes(); f += h > 9 ? h : "0" + h; break; case "s": a = c.getSeconds(), f += a > 9 ? a : "0" + a; break; case "\\": g++, f += b.charAt(g); break; default: f += e } return f } } } function t(a, b) { if ("" === a) return null; if (!a || a + 0 == a) return a; if ("object" == typeof a) return 3600 * a.getHours() + 60 * a.getMinutes() + a.getSeconds(); a = a.toLowerCase(); { var c; new Date(0) } if (c = a.match(/^([0-2]?[0-9])\W?([0-5][0-9])?\W?([0-5][0-9])?\s*([pa]?)m?$/), !c) return null; var d = parseInt(1 * c[1], 10), e = c[4], f = d; e && (f = 12 == d ? "p" == c[4] ? 12 : 0 : d + ("p" == c[4] ? 12 : 0)); var g = 1 * c[2] || 0, h = 1 * c[3] || 0, i = 3600 * f + 60 * g + h; if (!e && b && b._twelveHourTime && b.scrollDefault) { var j = i - b.scrollDefault; 0 > j && j >= v / -2 && (i = (i + v / 2) % v) } return i } var u = g(), v = 86400, w = { className: null, minTime: null, maxTime: null, durationTime: null, step: 30, showDuration: !1, showOnFocus: !0, timeFormat: "g:ia", scrollDefault: null, selectOnBlur: !1, disableTouchKeyboard: !1, forceRoundTime: !1, appendTo: "body", orientation: "ltr", disableTimeRanges: [], closeOnWindowScroll: !1, typeaheadHighlight: !0, noneOption: !1 }, x = { am: "am", pm: "pm", AM: "AM", PM: "PM", decimal: ".", mins: "mins", hr: "hr", hrs: "hrs" }, y = { init: function (d) { return this.each(function () { var e = a(this), f = []; for (var g in w) e.data(g) && (f[g] = e.data(g)); var h = a.extend({}, w, f, d); h.lang && (x = a.extend(x, h.lang)), h = b(h), e.data("timepicker-settings", h), e.addClass("ui-timepicker-input"), h.useSelect ? c(e) : (e.prop("autocomplete", "off"), e.on("click.timepicker focus.timepicker", y.show), e.on("change.timepicker", l), e.on("keydown.timepicker", o), e.on("keyup.timepicker", p), l.call(e.get(0))) }) }, show: function (b) { var d = a(this), e = d.data("timepicker-settings"); if (b) { if (!e.showOnFocus) return !0; b.preventDefault() } if (e.useSelect) return void d.data("timepicker-list").focus(); i(d) && d.blur(); var f = d.data("timepicker-list"); if (!d.prop("readonly") && (f && 0 !== f.length && "function" != typeof e.durationTime || (c(d), f = d.data("timepicker-list")), !f.is(":visible"))) { y.hide(), f.show(); var g = {}; g.left = "rtl" == e.orientation ? d.offset().left + d.outerWidth() - f.outerWidth() + parseInt(f.css("marginLeft").replace("px", ""), 10) : d.offset().left + parseInt(f.css("marginLeft").replace("px", ""), 10), g.top = d.offset().top + d.outerHeight(!0) + f.outerHeight() > a(window).height() + a(window).scrollTop() ? d.offset().top - f.outerHeight() + parseInt(f.css("marginTop").replace("px", ""), 10) : d.offset().top + d.outerHeight() + parseInt(f.css("marginTop").replace("px", ""), 10), f.offset(g); var k = f.find(".ui-timepicker-selected"); if (k.length || (m(d) ? k = j(d, f, t(m(d))) : e.scrollDefault && (k = j(d, f, e.scrollDefault))), k && k.length) { var l = f.scrollTop() + k.position().top - k.outerHeight(); f.scrollTop(l) } else f.scrollTop(0); return a(document).on("touchstart.ui-timepicker mousedown.ui-timepicker", h), e.closeOnWindowScroll && a(document).on("scroll.ui-timepicker", h), d.trigger("showTimepicker"), this } }, hide: function () { var b = a(this), c = b.data("timepicker-settings"); return c && c.useSelect && b.blur(), a(".ui-timepicker-wrapper:visible").each(function () { var b = a(this), c = b.data("timepicker-input"), d = c.data("timepicker-settings"); d && d.selectOnBlur && q(c), b.hide(), c.trigger("hideTimepicker") }), this }, option: function (d, e) { return this.each(function () { var f = a(this), g = f.data("timepicker-settings"), h = f.data("timepicker-list"); if ("object" == typeof d) g = a.extend(g, d); else if ("string" == typeof d && "undefined" != typeof e) g[d] = e; else if ("string" == typeof d) return g[d]; g = b(g), f.data("timepicker-settings", g), h && (h.remove(), f.data("timepicker-list", !1)), g.useSelect && c(f) }) }, getSecondsFromMidnight: function () { return t(m(this)) }, getTime: function (a) { var b = this, c = m(b); if (!c) return null; a || (a = new Date); var d = t(c), e = new Date(a); return e.setHours(d / 3600), e.setMinutes(d % 3600 / 60), e.setSeconds(d % 60), e.setMilliseconds(0), e }, setTime: function (a) { var b = this, c = b.data("timepicker-settings"); if (c.forceRoundTime) var d = f(a, c); else var d = s(t(a), c.timeFormat); return n(b, d), b.data("timepicker-list") && k(b, b.data("timepicker-list")), this }, remove: function () { var a = this; if (a.hasClass("ui-timepicker-input")) { var b = a.data("timepicker-settings"); return a.removeAttr("autocomplete", "off"), a.removeClass("ui-timepicker-input"), a.removeData("timepicker-settings"), a.off(".timepicker"), a.data("timepicker-list") && a.data("timepicker-list").remove(), b.useSelect && a.show(), a.removeData("timepicker-list"), this } } }; a.fn.timepicker = function (b) { return this.length ? y[b] ? this.hasClass("ui-timepicker-input") ? y[b].apply(this, Array.prototype.slice.call(arguments, 1)) : this : "object" != typeof b && b ? void a.error("Method " + b + " does not exist on jQuery.timepicker") : y.init.apply(this, arguments) : this } });