Initial commit
This commit is contained in:
+7
File diff suppressed because one or more lines are too long
+2
File diff suppressed because one or more lines are too long
+2
File diff suppressed because one or more lines are too long
+1661
File diff suppressed because it is too large
Load Diff
+22
@@ -0,0 +1,22 @@
|
||||
/*!
|
||||
* The Final Countdown for jQuery v2.2.0 (http://hilios.github.io/jQuery.countdown/)
|
||||
* Copyright (c) 2016 Edson Hilios
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";function b(a){if(a instanceof Date)return a;if(String(a).match(g))return String(a).match(/^[0-9]*$/)&&(a=Number(a)),String(a).match(/\-/)&&(a=String(a).replace(/\-/g,"/")),new Date(a);throw new Error("Couldn't cast `"+a+"` to a date object.")}function c(a){var b=a.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(b)}function d(a){return function(b){var d=b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(d)for(var f=0,g=d.length;f<g;++f){var h=d[f].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),j=c(h[0]),k=h[1]||"",l=h[3]||"",m=null;h=h[2],i.hasOwnProperty(h)&&(m=i[h],m=Number(a[m])),null!==m&&("!"===k&&(m=e(l,m)),""===k&&m<10&&(m="0"+m.toString()),b=b.replace(j,m.toString()))}return b=b.replace(/%%/,"%")}}function e(a,b){var c="s",d="";return a&&(a=a.replace(/(:|;|\s)/gi,"").split(/\,/),1===a.length?c=a[0]:(d=a[0],c=a[1])),Math.abs(b)>1?c:d}var f=[],g=[],h={precision:100,elapse:!1,defer:!1};g.push(/^[0-9]*$/.source),g.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g=new RegExp(g.join("|"));var i={Y:"years",m:"months",n:"daysToMonth",d:"daysToWeek",w:"weeks",W:"weeksToMonth",H:"hours",M:"minutes",S:"seconds",D:"totalDays",I:"totalHours",N:"totalMinutes",T:"totalSeconds"},j=function(b,c,d){this.el=b,this.$el=a(b),this.interval=null,this.offset={},this.options=a.extend({},h),this.instanceNumber=f.length,f.push(this),this.$el.data("countdown-instance",this.instanceNumber),d&&("function"==typeof d?(this.$el.on("update.countdown",d),this.$el.on("stoped.countdown",d),this.$el.on("finish.countdown",d)):this.options=a.extend({},h,d)),this.setFinalDate(c),this.options.defer===!1&&this.start()};a.extend(j.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var a=this;this.update(),this.interval=setInterval(function(){a.update.call(a)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),f[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(a){this.finalDate=b(a)},update:function(){if(0===this.$el.closest("html").length)return void this.remove();var b,c=void 0!==a._data(this.el,"events"),d=new Date;b=this.finalDate.getTime()-d.getTime(),b=Math.ceil(b/1e3),b=!this.options.elapse&&b<0?0:Math.abs(b),this.totalSecsLeft!==b&&c&&(this.totalSecsLeft=b,this.elapsed=d>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),weeksToMonth:Math.floor(this.totalSecsLeft/60/60/24/7)%4,months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-d.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/60/60/24),totalHours:Math.floor(this.totalSecsLeft/60/60),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft},this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish")))},dispatchEvent:function(b){var c=a.Event(b+".countdown");c.finalDate=this.finalDate,c.elapsed=this.elapsed,c.offset=a.extend({},this.offset),c.strftime=d(this.offset),this.$el.trigger(c)}}),a.fn.countdown=function(){var b=Array.prototype.slice.call(arguments,0);return this.each(function(){var c=a(this).data("countdown-instance");if(void 0!==c){var d=f[c],e=b[0];j.prototype.hasOwnProperty(e)?d[e].apply(d,b.slice(1)):null===String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(d.setFinalDate.call(d,e),d.start()):a.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,e))}else new j(this,b[0],b[1])})}});
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
/* jQuery Nice Select - v1.0
|
||||
https://github.com/hernansartorio/jquery-nice-select
|
||||
Made by Hernán Sartorio */
|
||||
!function(e){e.fn.niceSelect=function(t){function s(t){t.after(e("<div></div>").addClass("nice-select").addClass(t.attr("class")||"").addClass(t.attr("disabled")?"disabled":"").attr("tabindex",t.attr("disabled")?null:"0").html('<span class="current"></span><ul class="list"></ul>'));var s=t.next(),n=t.find("option"),i=t.find("option:selected");s.find(".current").html(i.data("display")||i.text()),n.each(function(t){var n=e(this),i=n.data("display");s.find("ul").append(e("<li></li>").attr("data-value",n.val()).attr("data-display",i||null).addClass("option"+(n.is(":selected")?" selected":"")+(n.is(":disabled")?" disabled":"")).html(n.text()))})}if("string"==typeof t)return"update"==t?this.each(function(){var t=e(this),n=e(this).next(".nice-select"),i=n.hasClass("open");n.length&&(n.remove(),s(t),i&&t.next().trigger("click"))}):"destroy"==t?(this.each(function(){var t=e(this),s=e(this).next(".nice-select");s.length&&(s.remove(),t.css("display",""))}),0==e(".nice-select").length&&e(document).off(".nice_select")):console.log('Method "'+t+'" does not exist.'),this;this.hide(),this.each(function(){var t=e(this);t.next().hasClass("nice-select")||s(t)}),e(document).off(".nice_select"),e(document).on("click.nice_select",".nice-select",function(t){var s=e(this);e(".nice-select").not(s).removeClass("open"),s.toggleClass("open"),s.hasClass("open")?(s.find(".option"),s.find(".focus").removeClass("focus"),s.find(".selected").addClass("focus")):s.focus()}),e(document).on("click.nice_select",function(t){0===e(t.target).closest(".nice-select").length&&e(".nice-select").removeClass("open").find(".option")}),e(document).on("click.nice_select",".nice-select .option:not(.disabled)",function(t){var s=e(this),n=s.closest(".nice-select");n.find(".selected").removeClass("selected"),s.addClass("selected");var i=s.data("display")||s.text();n.find(".current").text(i),n.prev("select").val(s.data("value")).trigger("change")}),e(document).on("keydown.nice_select",".nice-select",function(t){var s=e(this),n=e(s.find(".focus")||s.find(".list .option.selected"));if(32==t.keyCode||13==t.keyCode)return s.hasClass("open")?n.trigger("click"):s.trigger("click"),!1;if(40==t.keyCode){if(s.hasClass("open")){var i=n.nextAll(".option:not(.disabled)").first();i.length>0&&(s.find(".focus").removeClass("focus"),i.addClass("focus"))}else s.trigger("click");return!1}if(38==t.keyCode){if(s.hasClass("open")){var l=n.prevAll(".option:not(.disabled)").first();l.length>0&&(s.find(".focus").removeClass("focus"),l.addClass("focus"))}else s.trigger("click");return!1}if(27==t.keyCode)s.hasClass("open")&&s.trigger("click");else if(9==t.keyCode&&s.hasClass("open"))return!1});var n=document.createElement("a").style;return n.cssText="pointer-events:auto","auto"!==n.pointerEvents&&e("html").addClass("no-csspointerevents"),this}}(jQuery);
|
||||
+816
@@ -0,0 +1,816 @@
|
||||
/*!
|
||||
* Date picker for pickadate.js v3.6.4
|
||||
* http://amsul.github.io/pickadate.js/date.htm
|
||||
*/
|
||||
!(function (a) {
|
||||
"function" == typeof define && define.amd
|
||||
? define(["./picker", "jquery"], a)
|
||||
: "object" == typeof exports
|
||||
? (module.exports = a(require("./picker.js"), require("jquery")))
|
||||
: a(Picker, jQuery);
|
||||
})(function (a, b) {
|
||||
function c(a, b) {
|
||||
var c = this,
|
||||
d = a.$node[0],
|
||||
e = d.value,
|
||||
f = a.$node.data("value"),
|
||||
g = f || e,
|
||||
h = f ? b.formatSubmit : b.format,
|
||||
i = function () {
|
||||
return d.currentStyle
|
||||
? "rtl" == d.currentStyle.direction
|
||||
: "rtl" == getComputedStyle(a.$root[0]).direction;
|
||||
};
|
||||
(c.settings = b),
|
||||
(c.$node = a.$node),
|
||||
(c.queue = {
|
||||
min: "measure create",
|
||||
max: "measure create",
|
||||
now: "now create",
|
||||
select: "parse create validate",
|
||||
highlight: "parse navigate create validate",
|
||||
view: "parse create validate viewset",
|
||||
disable: "deactivate",
|
||||
enable: "activate",
|
||||
}),
|
||||
(c.item = {}),
|
||||
(c.item.clear = null),
|
||||
(c.item.disable = (b.disable || []).slice(0)),
|
||||
(c.item.enable = -(function (a) {
|
||||
return !0 === a[0] ? a.shift() : -1;
|
||||
})(c.item.disable)),
|
||||
c.set("min", b.min).set("max", b.max).set("now"),
|
||||
g
|
||||
? c.set("select", g, { format: h, defaultValue: !0 })
|
||||
: c.set("select", null).set("highlight", c.item.now),
|
||||
(c.key = {
|
||||
40: 7,
|
||||
38: -7,
|
||||
39: function () {
|
||||
return i() ? -1 : 1;
|
||||
},
|
||||
37: function () {
|
||||
return i() ? 1 : -1;
|
||||
},
|
||||
go: function (a) {
|
||||
var b = c.item.highlight,
|
||||
d = new Date(b.year, b.month, b.date + a);
|
||||
c.set("highlight", d, { interval: a }), this.render();
|
||||
},
|
||||
}),
|
||||
a
|
||||
.on(
|
||||
"render",
|
||||
function () {
|
||||
a.$root.find("." + b.klass.selectMonth).on("change", function () {
|
||||
var c = this.value;
|
||||
c &&
|
||||
(a.set("highlight", [
|
||||
a.get("view").year,
|
||||
c,
|
||||
a.get("highlight").date,
|
||||
]),
|
||||
a.$root.find("." + b.klass.selectMonth).trigger("focus"));
|
||||
}),
|
||||
a.$root.find("." + b.klass.selectYear).on("change", function () {
|
||||
var c = this.value;
|
||||
c &&
|
||||
(a.set("highlight", [
|
||||
c,
|
||||
a.get("view").month,
|
||||
a.get("highlight").date,
|
||||
]),
|
||||
a.$root.find("." + b.klass.selectYear).trigger("focus"));
|
||||
});
|
||||
},
|
||||
1
|
||||
)
|
||||
.on(
|
||||
"open",
|
||||
function () {
|
||||
var d = "";
|
||||
c.disabled(c.get("now")) &&
|
||||
(d = ":not(." + b.klass.buttonToday + ")"),
|
||||
a.$root.find("button" + d + ", select").attr("disabled", !1);
|
||||
},
|
||||
1
|
||||
)
|
||||
.on(
|
||||
"close",
|
||||
function () {
|
||||
a.$root.find("button, select").attr("disabled", !0);
|
||||
},
|
||||
1
|
||||
);
|
||||
}
|
||||
var d = 7,
|
||||
e = a._;
|
||||
(c.prototype.set = function (a, b, c) {
|
||||
var d = this,
|
||||
e = d.item;
|
||||
return null === b
|
||||
? ("clear" == a && (a = "select"), (e[a] = b), d)
|
||||
: ((e["enable" == a ? "disable" : "flip" == a ? "enable" : a] = d.queue[a]
|
||||
.split(" ")
|
||||
.map(function (e) {
|
||||
return (b = d[e](a, b, c));
|
||||
})
|
||||
.pop()),
|
||||
"select" == a
|
||||
? d.set("highlight", e.select, c)
|
||||
: "highlight" == a
|
||||
? d.set("view", e.highlight, c)
|
||||
: a.match(/^(flip|min|max|disable|enable)$/) &&
|
||||
(e.select && d.disabled(e.select) && d.set("select", e.select, c),
|
||||
e.highlight &&
|
||||
d.disabled(e.highlight) &&
|
||||
d.set("highlight", e.highlight, c)),
|
||||
d);
|
||||
}),
|
||||
(c.prototype.get = function (a) {
|
||||
return this.item[a];
|
||||
}),
|
||||
(c.prototype.create = function (a, c, d) {
|
||||
var f,
|
||||
g = this;
|
||||
return (
|
||||
(c = void 0 === c ? a : c),
|
||||
c == -1 / 0 || c == 1 / 0
|
||||
? (f = c)
|
||||
: b.isPlainObject(c) && e.isInteger(c.pick)
|
||||
? (c = c.obj)
|
||||
: b.isArray(c)
|
||||
? ((c = new Date(c[0], c[1], c[2])),
|
||||
(c = e.isDate(c) ? c : g.create().obj))
|
||||
: (c =
|
||||
e.isInteger(c) || e.isDate(c)
|
||||
? g.normalize(new Date(c), d)
|
||||
: g.now(a, c, d)),
|
||||
{
|
||||
year: f || c.getFullYear(),
|
||||
month: f || c.getMonth(),
|
||||
date: f || c.getDate(),
|
||||
day: f || c.getDay(),
|
||||
obj: f || c,
|
||||
pick: f || c.getTime(),
|
||||
}
|
||||
);
|
||||
}),
|
||||
(c.prototype.createRange = function (a, c) {
|
||||
var d = this,
|
||||
f = function (a) {
|
||||
return !0 === a || b.isArray(a) || e.isDate(a) ? d.create(a) : a;
|
||||
};
|
||||
return (
|
||||
e.isInteger(a) || (a = f(a)),
|
||||
e.isInteger(c) || (c = f(c)),
|
||||
e.isInteger(a) && b.isPlainObject(c)
|
||||
? (a = [c.year, c.month, c.date + a])
|
||||
: e.isInteger(c) &&
|
||||
b.isPlainObject(a) &&
|
||||
(c = [a.year, a.month, a.date + c]),
|
||||
{ from: f(a), to: f(c) }
|
||||
);
|
||||
}),
|
||||
(c.prototype.withinRange = function (a, b) {
|
||||
return (
|
||||
(a = this.createRange(a.from, a.to)),
|
||||
b.pick >= a.from.pick && b.pick <= a.to.pick
|
||||
);
|
||||
}),
|
||||
(c.prototype.overlapRanges = function (a, b) {
|
||||
var c = this;
|
||||
return (
|
||||
(a = c.createRange(a.from, a.to)),
|
||||
(b = c.createRange(b.from, b.to)),
|
||||
c.withinRange(a, b.from) ||
|
||||
c.withinRange(a, b.to) ||
|
||||
c.withinRange(b, a.from) ||
|
||||
c.withinRange(b, a.to)
|
||||
);
|
||||
}),
|
||||
(c.prototype.now = function (a, b, c) {
|
||||
return (
|
||||
(b = new Date()),
|
||||
c && c.rel && b.setDate(b.getDate() + c.rel),
|
||||
this.normalize(b, c)
|
||||
);
|
||||
}),
|
||||
(c.prototype.navigate = function (a, c, d) {
|
||||
var e,
|
||||
f,
|
||||
g,
|
||||
h,
|
||||
i = b.isArray(c),
|
||||
j = b.isPlainObject(c),
|
||||
k = this.item.view;
|
||||
if (i || j) {
|
||||
for (
|
||||
j
|
||||
? ((f = c.year), (g = c.month), (h = c.date))
|
||||
: ((f = +c[0]), (g = +c[1]), (h = +c[2])),
|
||||
d && d.nav && k && k.month !== g && ((f = k.year), (g = k.month)),
|
||||
e = new Date(f, g + (d && d.nav ? d.nav : 0), 1),
|
||||
f = e.getFullYear(),
|
||||
g = e.getMonth();
|
||||
new Date(f, g, h).getMonth() !== g;
|
||||
|
||||
)
|
||||
h -= 1;
|
||||
c = [f, g, h];
|
||||
}
|
||||
return c;
|
||||
}),
|
||||
(c.prototype.normalize = function (a) {
|
||||
return a.setHours(0, 0, 0, 0), a;
|
||||
}),
|
||||
(c.prototype.measure = function (a, b) {
|
||||
var c = this;
|
||||
return (
|
||||
e.isInteger(b)
|
||||
? (b = c.now(a, b, { rel: b }))
|
||||
: b
|
||||
? "string" == typeof b && (b = c.parse(a, b))
|
||||
: (b = "min" == a ? -1 / 0 : 1 / 0),
|
||||
b
|
||||
);
|
||||
}),
|
||||
(c.prototype.viewset = function (a, b) {
|
||||
return this.create([b.year, b.month, 1]);
|
||||
}),
|
||||
(c.prototype.validate = function (a, c, d) {
|
||||
var f,
|
||||
g,
|
||||
h,
|
||||
i,
|
||||
j = this,
|
||||
k = c,
|
||||
l = d && d.interval ? d.interval : 1,
|
||||
m = -1 === j.item.enable,
|
||||
n = j.item.min,
|
||||
o = j.item.max,
|
||||
p =
|
||||
m &&
|
||||
j.item.disable.filter(function (a) {
|
||||
if (b.isArray(a)) {
|
||||
var d = j.create(a).pick;
|
||||
d < c.pick ? (f = !0) : d > c.pick && (g = !0);
|
||||
}
|
||||
return e.isInteger(a);
|
||||
}).length;
|
||||
if (
|
||||
(!d || (!d.nav && !d.defaultValue)) &&
|
||||
((!m && j.disabled(c)) ||
|
||||
(m && j.disabled(c) && (p || f || g)) ||
|
||||
(!m && (c.pick <= n.pick || c.pick >= o.pick)))
|
||||
)
|
||||
for (
|
||||
m && !p && ((!g && l > 0) || (!f && l < 0)) && (l *= -1);
|
||||
j.disabled(c) &&
|
||||
(Math.abs(l) > 1 &&
|
||||
(c.month < k.month || c.month > k.month) &&
|
||||
((c = k), (l = l > 0 ? 1 : -1)),
|
||||
c.pick <= n.pick
|
||||
? ((h = !0),
|
||||
(l = 1),
|
||||
(c = j.create([
|
||||
n.year,
|
||||
n.month,
|
||||
n.date + (c.pick === n.pick ? 0 : -1),
|
||||
])))
|
||||
: c.pick >= o.pick &&
|
||||
((i = !0),
|
||||
(l = -1),
|
||||
(c = j.create([
|
||||
o.year,
|
||||
o.month,
|
||||
o.date + (c.pick === o.pick ? 0 : 1),
|
||||
]))),
|
||||
!h || !i);
|
||||
|
||||
)
|
||||
c = j.create([c.year, c.month, c.date + l]);
|
||||
return c;
|
||||
}),
|
||||
(c.prototype.disabled = function (a) {
|
||||
var c = this,
|
||||
d = c.item.disable.filter(function (d) {
|
||||
return e.isInteger(d)
|
||||
? a.day === (c.settings.firstDay ? d : d - 1) % 7
|
||||
: b.isArray(d) || e.isDate(d)
|
||||
? a.pick === c.create(d).pick
|
||||
: b.isPlainObject(d)
|
||||
? c.withinRange(d, a)
|
||||
: void 0;
|
||||
});
|
||||
return (
|
||||
(d =
|
||||
d.length &&
|
||||
!d.filter(function (a) {
|
||||
return (
|
||||
(b.isArray(a) && "inverted" == a[3]) ||
|
||||
(b.isPlainObject(a) && a.inverted)
|
||||
);
|
||||
}).length),
|
||||
-1 === c.item.enable
|
||||
? !d
|
||||
: d || a.pick < c.item.min.pick || a.pick > c.item.max.pick
|
||||
);
|
||||
}),
|
||||
(c.prototype.parse = function (a, b, c) {
|
||||
var d = this,
|
||||
f = {};
|
||||
return b && "string" == typeof b
|
||||
? ((c && c.format) || ((c = c || {}), (c.format = d.settings.format)),
|
||||
d.formats.toArray(c.format).map(function (a) {
|
||||
var c = d.formats[a],
|
||||
g = c ? e.trigger(c, d, [b, f]) : a.replace(/^!/, "").length;
|
||||
c && (f[a] = b.substr(0, g)), (b = b.substr(g));
|
||||
}),
|
||||
[f.yyyy || f.yy, +(f.mm || f.m) - 1, f.dd || f.d])
|
||||
: b;
|
||||
}),
|
||||
(c.prototype.formats = (function () {
|
||||
function a(a, b, c) {
|
||||
var d = a.match(/[^\x00-\x7F]+|\w+/)[0];
|
||||
return c.mm || c.m || (c.m = b.indexOf(d) + 1), d.length;
|
||||
}
|
||||
function b(a) {
|
||||
return a.match(/\w+/)[0].length;
|
||||
}
|
||||
return {
|
||||
d: function (a, b) {
|
||||
return a ? e.digits(a) : b.date;
|
||||
},
|
||||
dd: function (a, b) {
|
||||
return a ? 2 : e.lead(b.date);
|
||||
},
|
||||
ddd: function (a, c) {
|
||||
return a ? b(a) : this.settings.weekdaysShort[c.day];
|
||||
},
|
||||
dddd: function (a, c) {
|
||||
return a ? b(a) : this.settings.weekdaysFull[c.day];
|
||||
},
|
||||
m: function (a, b) {
|
||||
return a ? e.digits(a) : b.month + 1;
|
||||
},
|
||||
mm: function (a, b) {
|
||||
return a ? 2 : e.lead(b.month + 1);
|
||||
},
|
||||
mmm: function (b, c) {
|
||||
var d = this.settings.monthsShort;
|
||||
return b ? a(b, d, c) : d[c.month];
|
||||
},
|
||||
mmmm: function (b, c) {
|
||||
var d = this.settings.monthsShort;
|
||||
return b ? a(b, d, c) : d[c.month];
|
||||
},
|
||||
yy: function (a, b) {
|
||||
return a ? 2 : ("" + b.year).slice(2);
|
||||
},
|
||||
yyyy: function (a, b) {
|
||||
return a ? 4 : b.year;
|
||||
},
|
||||
toArray: function (a) {
|
||||
return a.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);
|
||||
},
|
||||
toString: function (a, b) {
|
||||
var c = this;
|
||||
return c.formats
|
||||
.toArray(a)
|
||||
.map(function (a) {
|
||||
return e.trigger(c.formats[a], c, [0, b]) || a.replace(/^!/, "");
|
||||
})
|
||||
.join("");
|
||||
},
|
||||
};
|
||||
})()),
|
||||
(c.prototype.isDateExact = function (a, c) {
|
||||
var d = this;
|
||||
return (e.isInteger(a) && e.isInteger(c)) ||
|
||||
("boolean" == typeof a && "boolean" == typeof c)
|
||||
? a === c
|
||||
: (e.isDate(a) || b.isArray(a)) && (e.isDate(c) || b.isArray(c))
|
||||
? d.create(a).pick === d.create(c).pick
|
||||
: !(!b.isPlainObject(a) || !b.isPlainObject(c)) &&
|
||||
d.isDateExact(a.from, c.from) &&
|
||||
d.isDateExact(a.to, c.to);
|
||||
}),
|
||||
(c.prototype.isDateOverlap = function (a, c) {
|
||||
var d = this,
|
||||
f = d.settings.firstDay ? 1 : 0;
|
||||
return e.isInteger(a) && (e.isDate(c) || b.isArray(c))
|
||||
? (a = (a % 7) + f) === d.create(c).day + 1
|
||||
: e.isInteger(c) && (e.isDate(a) || b.isArray(a))
|
||||
? (c = (c % 7) + f) === d.create(a).day + 1
|
||||
: !(!b.isPlainObject(a) || !b.isPlainObject(c)) &&
|
||||
d.overlapRanges(a, c);
|
||||
}),
|
||||
(c.prototype.flipEnable = function (a) {
|
||||
var b = this.item;
|
||||
b.enable = a || (-1 == b.enable ? 1 : -1);
|
||||
}),
|
||||
(c.prototype.deactivate = function (a, c) {
|
||||
var d = this,
|
||||
f = d.item.disable.slice(0);
|
||||
return (
|
||||
"flip" == c
|
||||
? d.flipEnable()
|
||||
: !1 === c
|
||||
? (d.flipEnable(1), (f = []))
|
||||
: !0 === c
|
||||
? (d.flipEnable(-1), (f = []))
|
||||
: c.map(function (a) {
|
||||
for (var c, g = 0; g < f.length; g += 1)
|
||||
if (d.isDateExact(a, f[g])) {
|
||||
c = !0;
|
||||
break;
|
||||
}
|
||||
c ||
|
||||
((e.isInteger(a) ||
|
||||
e.isDate(a) ||
|
||||
b.isArray(a) ||
|
||||
(b.isPlainObject(a) && a.from && a.to)) &&
|
||||
f.push(a));
|
||||
}),
|
||||
f
|
||||
);
|
||||
}),
|
||||
(c.prototype.activate = function (a, c) {
|
||||
var d = this,
|
||||
f = d.item.disable,
|
||||
g = f.length;
|
||||
return (
|
||||
"flip" == c
|
||||
? d.flipEnable()
|
||||
: !0 === c
|
||||
? (d.flipEnable(1), (f = []))
|
||||
: !1 === c
|
||||
? (d.flipEnable(-1), (f = []))
|
||||
: c.map(function (a) {
|
||||
var c, h, i, j;
|
||||
for (i = 0; i < g; i += 1) {
|
||||
if (((h = f[i]), d.isDateExact(h, a))) {
|
||||
(c = f[i] = null), (j = !0);
|
||||
break;
|
||||
}
|
||||
if (d.isDateOverlap(h, a)) {
|
||||
b.isPlainObject(a)
|
||||
? ((a.inverted = !0), (c = a))
|
||||
: b.isArray(a)
|
||||
? ((c = a), c[3] || c.push("inverted"))
|
||||
: e.isDate(a) &&
|
||||
(c = [
|
||||
a.getFullYear(),
|
||||
a.getMonth(),
|
||||
a.getDate(),
|
||||
"inverted",
|
||||
]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (c)
|
||||
for (i = 0; i < g; i += 1)
|
||||
if (d.isDateExact(f[i], a)) {
|
||||
f[i] = null;
|
||||
break;
|
||||
}
|
||||
if (j)
|
||||
for (i = 0; i < g; i += 1)
|
||||
if (d.isDateOverlap(f[i], a)) {
|
||||
f[i] = null;
|
||||
break;
|
||||
}
|
||||
c && f.push(c);
|
||||
}),
|
||||
f.filter(function (a) {
|
||||
return null != a;
|
||||
})
|
||||
);
|
||||
}),
|
||||
(c.prototype.nodes = function (a) {
|
||||
var b = this,
|
||||
c = b.settings,
|
||||
f = b.item,
|
||||
g = f.now,
|
||||
h = f.select,
|
||||
i = f.highlight,
|
||||
j = f.view,
|
||||
k = f.disable,
|
||||
l = f.min,
|
||||
m = f.max,
|
||||
n = (function (a, b) {
|
||||
return (
|
||||
c.firstDay && (a.push(a.shift()), b.push(b.shift())),
|
||||
e.node(
|
||||
"thead",
|
||||
e.node(
|
||||
"tr",
|
||||
e.group({
|
||||
min: 0,
|
||||
max: d - 1,
|
||||
i: 1,
|
||||
node: "th",
|
||||
item: function (d) {
|
||||
return [
|
||||
a[d],
|
||||
c.klass.weekdays,
|
||||
'scope=col title="' + b[d] + '"',
|
||||
];
|
||||
},
|
||||
})
|
||||
)
|
||||
)
|
||||
);
|
||||
})(
|
||||
(c.showWeekdaysFull ? c.weekdaysFull : c.weekdaysShort).slice(0),
|
||||
c.weekdaysFull.slice(0)
|
||||
),
|
||||
o = function (a) {
|
||||
return e.node(
|
||||
"div",
|
||||
" ",
|
||||
c.klass["nav" + (a ? "Next" : "Prev")] +
|
||||
((a && j.year >= m.year && j.month >= m.month) ||
|
||||
(!a && j.year <= l.year && j.month <= l.month)
|
||||
? " " + c.klass.navDisabled
|
||||
: ""),
|
||||
"data-nav=" +
|
||||
(a || -1) +
|
||||
" " +
|
||||
e.ariaAttr({
|
||||
role: "button",
|
||||
controls: b.$node[0].id + "_table",
|
||||
}) +
|
||||
' title="' +
|
||||
(a ? c.labelMonthNext : c.labelMonthPrev) +
|
||||
'"'
|
||||
);
|
||||
},
|
||||
p = function () {
|
||||
var d = c.showMonthsShort ? c.monthsShort : c.monthsFull;
|
||||
return c.selectMonths
|
||||
? e.node(
|
||||
"select",
|
||||
e.group({
|
||||
min: 0,
|
||||
max: 11,
|
||||
i: 1,
|
||||
node: "option",
|
||||
item: function (a) {
|
||||
return [
|
||||
d[a],
|
||||
0,
|
||||
"value=" +
|
||||
a +
|
||||
(j.month == a ? " selected" : "") +
|
||||
((j.year == l.year && a < l.month) ||
|
||||
(j.year == m.year && a > m.month)
|
||||
? " disabled"
|
||||
: ""),
|
||||
];
|
||||
},
|
||||
}),
|
||||
c.klass.selectMonth,
|
||||
(a ? "" : "disabled") +
|
||||
" " +
|
||||
e.ariaAttr({ controls: b.$node[0].id + "_table" }) +
|
||||
' title="' +
|
||||
c.labelMonthSelect +
|
||||
'"'
|
||||
)
|
||||
: e.node("div", d[j.month], c.klass.month);
|
||||
},
|
||||
q = function () {
|
||||
var d = j.year,
|
||||
f = !0 === c.selectYears ? 5 : ~~(c.selectYears / 2);
|
||||
if (f) {
|
||||
var g = l.year,
|
||||
h = m.year,
|
||||
i = d - f,
|
||||
k = d + f;
|
||||
if ((g > i && ((k += g - i), (i = g)), h < k)) {
|
||||
var n = i - g,
|
||||
o = k - h;
|
||||
(i -= n > o ? o : n), (k = h);
|
||||
}
|
||||
return e.node(
|
||||
"select",
|
||||
e.group({
|
||||
min: i,
|
||||
max: k,
|
||||
i: 1,
|
||||
node: "option",
|
||||
item: function (a) {
|
||||
return [a, 0, "value=" + a + (d == a ? " selected" : "")];
|
||||
},
|
||||
}),
|
||||
c.klass.selectYear,
|
||||
(a ? "" : "disabled") +
|
||||
" " +
|
||||
e.ariaAttr({ controls: b.$node[0].id + "_table" }) +
|
||||
' title="' +
|
||||
c.labelYearSelect +
|
||||
'"'
|
||||
);
|
||||
}
|
||||
return e.node("div", d, c.klass.year);
|
||||
};
|
||||
return (
|
||||
e.node(
|
||||
"div",
|
||||
(c.selectYears ? q() + p() : p() + q()) + o() + o(1),
|
||||
c.klass.header
|
||||
) +
|
||||
e.node(
|
||||
"table",
|
||||
n +
|
||||
e.node(
|
||||
"tbody",
|
||||
e.group({
|
||||
min: 0,
|
||||
max: 5,
|
||||
i: 1,
|
||||
node: "tr",
|
||||
item: function (a) {
|
||||
var f =
|
||||
c.firstDay && 0 === b.create([j.year, j.month, 1]).day
|
||||
? -7
|
||||
: 0;
|
||||
return [
|
||||
e.group({
|
||||
min: d * a - j.day + f + 1,
|
||||
max: function () {
|
||||
return this.min + d - 1;
|
||||
},
|
||||
i: 1,
|
||||
node: "td",
|
||||
item: function (a) {
|
||||
a = b.create([
|
||||
j.year,
|
||||
j.month,
|
||||
a + (c.firstDay ? 1 : 0),
|
||||
]);
|
||||
var d = h && h.pick == a.pick,
|
||||
f = i && i.pick == a.pick,
|
||||
n =
|
||||
(k && b.disabled(a)) ||
|
||||
a.pick < l.pick ||
|
||||
a.pick > m.pick,
|
||||
o = e.trigger(b.formats.toString, b, [c.format, a]);
|
||||
return [
|
||||
e.node(
|
||||
"div",
|
||||
a.date,
|
||||
(function (b) {
|
||||
return (
|
||||
b.push(
|
||||
j.month == a.month
|
||||
? c.klass.infocus
|
||||
: c.klass.outfocus
|
||||
),
|
||||
g.pick == a.pick && b.push(c.klass.now),
|
||||
d && b.push(c.klass.selected),
|
||||
f && b.push(c.klass.highlighted),
|
||||
n && b.push(c.klass.disabled),
|
||||
b.join(" ")
|
||||
);
|
||||
})([c.klass.day]),
|
||||
"data-pick=" +
|
||||
a.pick +
|
||||
" " +
|
||||
e.ariaAttr({
|
||||
role: "gridcell",
|
||||
label: o,
|
||||
selected: !(!d || b.$node.val() !== o) || null,
|
||||
activedescendant: !!f || null,
|
||||
disabled: !!n || null,
|
||||
})
|
||||
),
|
||||
"",
|
||||
e.ariaAttr({ role: "presentation" }),
|
||||
];
|
||||
},
|
||||
}),
|
||||
];
|
||||
},
|
||||
})
|
||||
),
|
||||
c.klass.table,
|
||||
'id="' +
|
||||
b.$node[0].id +
|
||||
'_table" ' +
|
||||
e.ariaAttr({ role: "grid", controls: b.$node[0].id, readonly: !0 })
|
||||
) +
|
||||
e.node(
|
||||
"div",
|
||||
e.node(
|
||||
"button",
|
||||
c.today,
|
||||
c.klass.buttonToday,
|
||||
"type=button data-pick=" +
|
||||
g.pick +
|
||||
(a && !b.disabled(g) ? "" : " disabled") +
|
||||
" " +
|
||||
e.ariaAttr({ controls: b.$node[0].id })
|
||||
) +
|
||||
e.node(
|
||||
"button",
|
||||
c.clear,
|
||||
c.klass.buttonClear,
|
||||
"type=button data-clear=1" +
|
||||
(a ? "" : " disabled") +
|
||||
" " +
|
||||
e.ariaAttr({ controls: b.$node[0].id })
|
||||
) +
|
||||
e.node(
|
||||
"button",
|
||||
c.close,
|
||||
c.klass.buttonClose,
|
||||
"type=button data-close=true " +
|
||||
(a ? "" : " disabled") +
|
||||
" " +
|
||||
e.ariaAttr({ controls: b.$node[0].id })
|
||||
),
|
||||
c.klass.footer
|
||||
)
|
||||
);
|
||||
}),
|
||||
(c.defaults = (function (a) {
|
||||
return {
|
||||
labelMonthNext: "Next month",
|
||||
labelMonthPrev: "Previous month",
|
||||
labelMonthSelect: "Select a month",
|
||||
labelYearSelect: "Select a year",
|
||||
monthsFull: [
|
||||
"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",
|
||||
],
|
||||
weekdaysFull: [
|
||||
"Sunday",
|
||||
"Monday",
|
||||
"Tuesday",
|
||||
"Wednesday",
|
||||
"Thursday",
|
||||
"Friday",
|
||||
"Saturday",
|
||||
],
|
||||
weekdaysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
||||
today: "Today",
|
||||
clear: "Clear",
|
||||
close: "Close",
|
||||
closeOnSelect: !0,
|
||||
closeOnClear: !0,
|
||||
updateInput: !0,
|
||||
format: "d mmmm, yyyy",
|
||||
klass: {
|
||||
table: a + "table",
|
||||
header: a + "header",
|
||||
navPrev: a + "nav--prev",
|
||||
navNext: a + "nav--next",
|
||||
navDisabled: a + "nav--disabled",
|
||||
month: a + "month",
|
||||
year: a + "year",
|
||||
selectMonth: a + "select--month",
|
||||
selectYear: a + "select--year",
|
||||
weekdays: a + "weekday",
|
||||
day: a + "day",
|
||||
disabled: a + "day--disabled",
|
||||
selected: a + "day--selected",
|
||||
highlighted: a + "day--highlighted",
|
||||
now: a + "day--today",
|
||||
infocus: a + "day--infocus",
|
||||
outfocus: a + "day--outfocus",
|
||||
footer: a + "footer",
|
||||
buttonClear: a + "button--clear",
|
||||
buttonToday: a + "button--today",
|
||||
buttonClose: a + "button--close",
|
||||
},
|
||||
};
|
||||
})(a.klasses().picker + "__")),
|
||||
a.extend("pickadate", c);
|
||||
});
|
||||
+503
@@ -0,0 +1,503 @@
|
||||
/*!
|
||||
* pickadate.js v3.6.4, 2019/05/25
|
||||
* By Amsul, http://amsul.ca
|
||||
* Hosted on http://amsul.github.io/pickadate.js
|
||||
* Licensed under MIT
|
||||
*/
|
||||
!(function (a) {
|
||||
"function" == typeof define && define.amd
|
||||
? define("picker", ["jquery"], a)
|
||||
: "object" == typeof exports
|
||||
? (module.exports = a(require("jquery")))
|
||||
: "object" == typeof window
|
||||
? (window.Picker = a(jQuery))
|
||||
: (this.Picker = a(jQuery));
|
||||
})(function (a) {
|
||||
function b(g, h, j, l) {
|
||||
function n() {
|
||||
return b._.node(
|
||||
"div",
|
||||
b._.node(
|
||||
"div",
|
||||
b._.node(
|
||||
"div",
|
||||
b._.node("div", B.component.nodes(w.open), y.box),
|
||||
y.wrap
|
||||
),
|
||||
y.frame
|
||||
),
|
||||
y.holder,
|
||||
'tabindex="-1"'
|
||||
);
|
||||
}
|
||||
function o() {
|
||||
z
|
||||
.data(h, B)
|
||||
.addClass(y.input)
|
||||
.val(z.data("value") ? B.get("select", x.format) : g.value)
|
||||
.on("focus." + w.id + " click." + w.id, function (a) {
|
||||
a.preventDefault(), B.open();
|
||||
})
|
||||
.on("mousedown", function () {
|
||||
w.handlingOpen = !0;
|
||||
var b = function () {
|
||||
setTimeout(function () {
|
||||
a(document).off("mouseup", b), (w.handlingOpen = !1);
|
||||
}, 0);
|
||||
};
|
||||
a(document).on("mouseup", b);
|
||||
}),
|
||||
x.editable || z.on("keydown." + w.id, u),
|
||||
f(g, {
|
||||
haspopup: !0,
|
||||
expanded: !1,
|
||||
readonly: !1,
|
||||
owns: g.id + "_root",
|
||||
});
|
||||
}
|
||||
function p() {
|
||||
f(B.$root[0], "hidden", !0);
|
||||
}
|
||||
function q() {
|
||||
B.$holder
|
||||
.on({
|
||||
keydown: u,
|
||||
"focus.toOpen": t,
|
||||
blur: function () {
|
||||
z.removeClass(y.target);
|
||||
},
|
||||
focusin: function (a) {
|
||||
B.$root.removeClass(y.focused), a.stopPropagation();
|
||||
},
|
||||
"mousedown click": function (b) {
|
||||
var c = e(b, g);
|
||||
c != B.$holder[0] &&
|
||||
(b.stopPropagation(),
|
||||
"mousedown" != b.type ||
|
||||
a(c).is("input, select, textarea, button, option") ||
|
||||
(b.preventDefault(), B.$holder.eq(0).focus()));
|
||||
},
|
||||
})
|
||||
.on(
|
||||
"click",
|
||||
"[data-pick], [data-nav], [data-clear], [data-close]",
|
||||
function () {
|
||||
var b = a(this),
|
||||
c = b.data(),
|
||||
d = b.hasClass(y.navDisabled) || b.hasClass(y.disabled),
|
||||
e = i();
|
||||
(e = e && (e.type || e.href ? e : null)),
|
||||
(d || (e && !a.contains(B.$root[0], e))) &&
|
||||
B.$holder.eq(0).focus(),
|
||||
!d && c.nav
|
||||
? B.set("highlight", B.component.item.highlight, { nav: c.nav })
|
||||
: !d && "pick" in c
|
||||
? (B.set("select", c.pick), x.closeOnSelect && B.close(!0))
|
||||
: c.clear
|
||||
? (B.clear(), x.closeOnClear && B.close(!0))
|
||||
: c.close && B.close(!0);
|
||||
}
|
||||
);
|
||||
}
|
||||
function r() {
|
||||
var b;
|
||||
!0 === x.hiddenName
|
||||
? ((b = g.name), (g.name = ""))
|
||||
: ((b = [
|
||||
"string" == typeof x.hiddenPrefix ? x.hiddenPrefix : "",
|
||||
"string" == typeof x.hiddenSuffix ? x.hiddenSuffix : "_submit",
|
||||
]),
|
||||
(b = b[0] + g.name + b[1])),
|
||||
(B._hidden = a(
|
||||
'<input type=hidden name="' +
|
||||
b +
|
||||
'"' +
|
||||
(z.data("value") || g.value
|
||||
? ' value="' + B.get("select", x.formatSubmit) + '"'
|
||||
: "") +
|
||||
">"
|
||||
)[0]),
|
||||
z.on("change." + w.id, function () {
|
||||
B._hidden.value = g.value ? B.get("select", x.formatSubmit) : "";
|
||||
});
|
||||
}
|
||||
function s() {
|
||||
v && m
|
||||
? B.$holder.find("." + y.frame).one("transitionend", function () {
|
||||
B.$holder.eq(0).focus();
|
||||
})
|
||||
: setTimeout(function () {
|
||||
B.$holder.eq(0).focus();
|
||||
}, 0);
|
||||
}
|
||||
function t(a) {
|
||||
a.stopPropagation(),
|
||||
z.addClass(y.target),
|
||||
B.$root.addClass(y.focused),
|
||||
B.open();
|
||||
}
|
||||
function u(a) {
|
||||
var b = a.keyCode,
|
||||
c = /^(8|46)$/.test(b);
|
||||
if (27 == b) return B.close(!0), !1;
|
||||
(32 == b || c || (!w.open && B.component.key[b])) &&
|
||||
(a.preventDefault(),
|
||||
a.stopPropagation(),
|
||||
c ? B.clear().close() : B.open());
|
||||
}
|
||||
if (!g) return b;
|
||||
var v = !1,
|
||||
w = {
|
||||
id: g.id || "P" + Math.abs(~~(Math.random() * new Date())),
|
||||
handlingOpen: !1,
|
||||
},
|
||||
x = j ? a.extend(!0, {}, j.defaults, l) : l || {},
|
||||
y = a.extend({}, b.klasses(), x.klass),
|
||||
z = a(g),
|
||||
A = function () {
|
||||
return this.start();
|
||||
},
|
||||
B = (A.prototype = {
|
||||
constructor: A,
|
||||
$node: z,
|
||||
start: function () {
|
||||
return w && w.start
|
||||
? B
|
||||
: ((w.methods = {}),
|
||||
(w.start = !0),
|
||||
(w.open = !1),
|
||||
(w.type = g.type),
|
||||
(g.autofocus = g == i()),
|
||||
(g.readOnly = !x.editable),
|
||||
(g.id = g.id || w.id),
|
||||
"text" != g.type && (g.type = "text"),
|
||||
(B.component = new j(B, x)),
|
||||
(B.$root = a(
|
||||
'<div class="' + y.picker + '" id="' + g.id + '_root" />'
|
||||
)),
|
||||
p(),
|
||||
(B.$holder = a(n()).appendTo(B.$root)),
|
||||
q(),
|
||||
x.formatSubmit && r(),
|
||||
o(),
|
||||
x.containerHidden
|
||||
? a(x.containerHidden).append(B._hidden)
|
||||
: z.after(B._hidden),
|
||||
x.container ? a(x.container).append(B.$root) : z.after(B.$root),
|
||||
B.on({
|
||||
start: B.component.onStart,
|
||||
render: B.component.onRender,
|
||||
stop: B.component.onStop,
|
||||
open: B.component.onOpen,
|
||||
close: B.component.onClose,
|
||||
set: B.component.onSet,
|
||||
}).on({
|
||||
start: x.onStart,
|
||||
render: x.onRender,
|
||||
stop: x.onStop,
|
||||
open: x.onOpen,
|
||||
close: x.onClose,
|
||||
set: x.onSet,
|
||||
}),
|
||||
(v = c(B.$holder[0])),
|
||||
g.autofocus && B.open(),
|
||||
B.trigger("start").trigger("render"));
|
||||
},
|
||||
render: function (b) {
|
||||
return (
|
||||
b
|
||||
? ((B.$holder = a(n())), q(), B.$root.html(B.$holder))
|
||||
: B.$root.find("." + y.box).html(B.component.nodes(w.open)),
|
||||
B.trigger("render")
|
||||
);
|
||||
},
|
||||
stop: function () {
|
||||
return w.start
|
||||
? (B.close(),
|
||||
B._hidden && B._hidden.parentNode.removeChild(B._hidden),
|
||||
B.$root.remove(),
|
||||
z.removeClass(y.input).removeData(h),
|
||||
setTimeout(function () {
|
||||
z.off("." + w.id);
|
||||
}, 0),
|
||||
(g.type = w.type),
|
||||
(g.readOnly = !1),
|
||||
B.trigger("stop"),
|
||||
(w.methods = {}),
|
||||
(w.start = !1),
|
||||
B)
|
||||
: B;
|
||||
},
|
||||
open: function (c) {
|
||||
return w.open
|
||||
? B
|
||||
: (z.addClass(y.active),
|
||||
f(g, "expanded", !0),
|
||||
setTimeout(function () {
|
||||
B.$root.addClass(y.opened), f(B.$root[0], "hidden", !1);
|
||||
}, 0),
|
||||
!1 !== c &&
|
||||
((w.open = !0),
|
||||
v &&
|
||||
a("body")
|
||||
.css("overflow", "hidden")
|
||||
.css("padding-right", "+=" + d()),
|
||||
s(),
|
||||
k
|
||||
.on("click." + w.id + " focusin." + w.id, function (a) {
|
||||
if (!w.handlingOpen) {
|
||||
var b = e(a, g);
|
||||
a.isSimulated ||
|
||||
b == g ||
|
||||
b == document ||
|
||||
3 == a.which ||
|
||||
B.close(b === B.$holder[0]);
|
||||
}
|
||||
})
|
||||
.on("keydown." + w.id, function (c) {
|
||||
var d = c.keyCode,
|
||||
f = B.component.key[d],
|
||||
h = e(c, g);
|
||||
27 == d
|
||||
? B.close(!0)
|
||||
: h != B.$holder[0] || (!f && 13 != d)
|
||||
? a.contains(B.$root[0], h) &&
|
||||
13 == d &&
|
||||
(c.preventDefault(), h.click())
|
||||
: (c.preventDefault(),
|
||||
f
|
||||
? b._.trigger(B.component.key.go, B, [b._.trigger(f)])
|
||||
: B.$root
|
||||
.find("." + y.highlighted)
|
||||
.hasClass(y.disabled) ||
|
||||
(B.set("select", B.component.item.highlight),
|
||||
x.closeOnSelect && B.close(!0)));
|
||||
})),
|
||||
B.trigger("open"));
|
||||
},
|
||||
close: function (b) {
|
||||
return (
|
||||
b &&
|
||||
(x.editable
|
||||
? g.focus()
|
||||
: (B.$holder.off("focus.toOpen").focus(),
|
||||
setTimeout(function () {
|
||||
B.$holder.on("focus.toOpen", t);
|
||||
}, 0))),
|
||||
z.removeClass(y.active),
|
||||
f(g, "expanded", !1),
|
||||
setTimeout(function () {
|
||||
B.$root.removeClass(y.opened + " " + y.focused),
|
||||
f(B.$root[0], "hidden", !0);
|
||||
}, 0),
|
||||
w.open
|
||||
? ((w.open = !1),
|
||||
v &&
|
||||
a("body")
|
||||
.css("overflow", "")
|
||||
.css("padding-right", "-=" + d()),
|
||||
k.off("." + w.id),
|
||||
B.trigger("close"))
|
||||
: B
|
||||
);
|
||||
},
|
||||
clear: function (a) {
|
||||
return B.set("clear", null, a);
|
||||
},
|
||||
set: function (b, c, d) {
|
||||
var e,
|
||||
f,
|
||||
g = a.isPlainObject(b),
|
||||
h = g ? b : {};
|
||||
if (((d = g && a.isPlainObject(c) ? c : d || {}), b)) {
|
||||
g || (h[b] = c);
|
||||
for (e in h)
|
||||
(f = h[e]),
|
||||
e in B.component.item &&
|
||||
(void 0 === f && (f = null), B.component.set(e, f, d)),
|
||||
("select" != e && "clear" != e) ||
|
||||
!x.updateInput ||
|
||||
z
|
||||
.val("clear" == e ? "" : B.get(e, x.format))
|
||||
.trigger("change");
|
||||
B.render();
|
||||
}
|
||||
return d.muted ? B : B.trigger("set", h);
|
||||
},
|
||||
get: function (a, c) {
|
||||
if (((a = a || "value"), null != w[a])) return w[a];
|
||||
if ("valueSubmit" == a) {
|
||||
if (B._hidden) return B._hidden.value;
|
||||
a = "value";
|
||||
}
|
||||
if ("value" == a) return g.value;
|
||||
if (a in B.component.item) {
|
||||
if ("string" == typeof c) {
|
||||
var d = B.component.get(a);
|
||||
return d
|
||||
? b._.trigger(B.component.formats.toString, B.component, [c, d])
|
||||
: "";
|
||||
}
|
||||
return B.component.get(a);
|
||||
}
|
||||
},
|
||||
on: function (b, c, d) {
|
||||
var e,
|
||||
f,
|
||||
g = a.isPlainObject(b),
|
||||
h = g ? b : {};
|
||||
if (b) {
|
||||
g || (h[b] = c);
|
||||
for (e in h)
|
||||
(f = h[e]),
|
||||
d && (e = "_" + e),
|
||||
(w.methods[e] = w.methods[e] || []),
|
||||
w.methods[e].push(f);
|
||||
}
|
||||
return B;
|
||||
},
|
||||
off: function () {
|
||||
var a,
|
||||
b,
|
||||
c = arguments;
|
||||
for (a = 0, namesCount = c.length; a < namesCount; a += 1)
|
||||
(b = c[a]) in w.methods && delete w.methods[b];
|
||||
return B;
|
||||
},
|
||||
trigger: function (a, c) {
|
||||
var d = function (a) {
|
||||
var d = w.methods[a];
|
||||
d &&
|
||||
d.map(function (a) {
|
||||
b._.trigger(a, B, [c]);
|
||||
});
|
||||
};
|
||||
return d("_" + a), d(a), B;
|
||||
},
|
||||
});
|
||||
return new A();
|
||||
}
|
||||
function c(a) {
|
||||
var b,
|
||||
c = "position";
|
||||
return (
|
||||
a.currentStyle
|
||||
? (b = a.currentStyle[c])
|
||||
: window.getComputedStyle && (b = getComputedStyle(a)[c]),
|
||||
"fixed" == b
|
||||
);
|
||||
}
|
||||
function d() {
|
||||
if (l.height() <= j.height()) return 0;
|
||||
var b = a('<div style="visibility:hidden;width:100px" />').appendTo("body"),
|
||||
c = b[0].offsetWidth;
|
||||
b.css("overflow", "scroll");
|
||||
var d = a('<div style="width:100%" />').appendTo(b),
|
||||
e = d[0].offsetWidth;
|
||||
return b.remove(), c - e;
|
||||
}
|
||||
function e(a, b) {
|
||||
var c = [];
|
||||
return (
|
||||
a.path && (c = a.path),
|
||||
a.originalEvent && a.originalEvent.path && (c = a.originalEvent.path),
|
||||
c && c.length > 0 ? (b && c.indexOf(b) >= 0 ? b : c[0]) : a.target
|
||||
);
|
||||
}
|
||||
function f(b, c, d) {
|
||||
if (a.isPlainObject(c)) for (var e in c) g(b, e, c[e]);
|
||||
else g(b, c, d);
|
||||
}
|
||||
function g(a, b, c) {
|
||||
a.setAttribute(("role" == b ? "" : "aria-") + b, c);
|
||||
}
|
||||
function h(b, c) {
|
||||
a.isPlainObject(b) || (b = { attribute: c }), (c = "");
|
||||
for (var d in b) {
|
||||
var e = ("role" == d ? "" : "aria-") + d;
|
||||
c += null == b[d] ? "" : e + '="' + b[d] + '"';
|
||||
}
|
||||
return c;
|
||||
}
|
||||
function i() {
|
||||
try {
|
||||
return document.activeElement;
|
||||
} catch (a) {}
|
||||
}
|
||||
var j = a(window),
|
||||
k = a(document),
|
||||
l = a(document.documentElement),
|
||||
m = null != document.documentElement.style.transition;
|
||||
return (
|
||||
(b.klasses = function (a) {
|
||||
return (
|
||||
(a = a || "picker"),
|
||||
{
|
||||
picker: a,
|
||||
opened: a + "--opened",
|
||||
focused: a + "--focused",
|
||||
input: a + "__input",
|
||||
active: a + "__input--active",
|
||||
target: a + "__input--target",
|
||||
holder: a + "__holder",
|
||||
frame: a + "__frame",
|
||||
wrap: a + "__wrap",
|
||||
box: a + "__box",
|
||||
}
|
||||
);
|
||||
}),
|
||||
(b._ = {
|
||||
group: function (a) {
|
||||
for (
|
||||
var c, d = "", e = b._.trigger(a.min, a);
|
||||
e <= b._.trigger(a.max, a, [e]);
|
||||
e += a.i
|
||||
)
|
||||
(c = b._.trigger(a.item, a, [e])),
|
||||
(d += b._.node(a.node, c[0], c[1], c[2]));
|
||||
return d;
|
||||
},
|
||||
node: function (b, c, d, e) {
|
||||
return c
|
||||
? ((c = a.isArray(c) ? c.join("") : c),
|
||||
(d = d ? ' class="' + d + '"' : ""),
|
||||
(e = e ? " " + e : ""),
|
||||
"<" + b + d + e + ">" + c + "</" + b + ">")
|
||||
: "";
|
||||
},
|
||||
lead: function (a) {
|
||||
return (a < 10 ? "0" : "") + a;
|
||||
},
|
||||
trigger: function (a, b, c) {
|
||||
return "function" == typeof a ? a.apply(b, c || []) : a;
|
||||
},
|
||||
digits: function (a) {
|
||||
return /\d/.test(a[1]) ? 2 : 1;
|
||||
},
|
||||
isDate: function (a) {
|
||||
return (
|
||||
{}.toString.call(a).indexOf("Date") > -1 &&
|
||||
this.isInteger(a.getDate())
|
||||
);
|
||||
},
|
||||
isInteger: function (a) {
|
||||
return {}.toString.call(a).indexOf("Number") > -1 && a % 1 == 0;
|
||||
},
|
||||
ariaAttr: h,
|
||||
}),
|
||||
(b.extend = function (c, d) {
|
||||
(a.fn[c] = function (e, f) {
|
||||
var g = this.data(c);
|
||||
return "picker" == e
|
||||
? g
|
||||
: g && "string" == typeof e
|
||||
? b._.trigger(g[e], g, [f])
|
||||
: this.each(function () {
|
||||
a(this).data(c) || new b(this, c, d, e);
|
||||
});
|
||||
}),
|
||||
(a.fn[c].defaults = d.defaults);
|
||||
}),
|
||||
b
|
||||
);
|
||||
});
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
slick-animation.js
|
||||
|
||||
Version: 0.3.3 Beta
|
||||
Author: Marvin Hübner
|
||||
Docs: https://github.com/marvinhuebner/slick-animation
|
||||
Repo: https://github.com/marvinhuebner/slick-animation
|
||||
*/
|
||||
!(function (a) {
|
||||
a.fn.slickAnimation = function () {
|
||||
function n(a, n, t, i, o) {
|
||||
(o = "undefined" != typeof o ? o : !1),
|
||||
1 == n.opacity
|
||||
? (a.addClass(t), a.addClass(i))
|
||||
: (a.removeClass(t), a.removeClass(i)),
|
||||
o && a.css(n);
|
||||
}
|
||||
function t(a, n) {
|
||||
return a ? 1e3 * a + 1e3 : n ? 1e3 * n : a || n ? 1e3 * a + 1e3 * n : 1e3;
|
||||
}
|
||||
function i(a, n, t) {
|
||||
var i = [
|
||||
"animation-" + n,
|
||||
"-webkit-animation-" + n,
|
||||
"-moz-animation-" + n,
|
||||
"-o-animation-" + n,
|
||||
"-ms-animation-" + n,
|
||||
],
|
||||
o = {};
|
||||
i.forEach(function (a) {
|
||||
o[a] = t + "s";
|
||||
}),
|
||||
a.css(o);
|
||||
}
|
||||
var o = a(this),
|
||||
e = o.find(".slick-list .slick-track > div"),
|
||||
s = o.find('[data-slick-index="0"]'),
|
||||
r = "animated",
|
||||
c = { opacity: "1" },
|
||||
d = { opacity: "0" };
|
||||
return (
|
||||
e.each(function () {
|
||||
var e = a(this);
|
||||
e.find("[data-animation-in]").each(function () {
|
||||
var u = a(this);
|
||||
u.css(d);
|
||||
var l = u.attr("data-animation-in"),
|
||||
f = u.attr("data-animation-out"),
|
||||
h = u.attr("data-delay-in"),
|
||||
m = u.attr("data-duration-in"),
|
||||
y = u.attr("data-delay-out"),
|
||||
C = u.attr("data-duration-out");
|
||||
f
|
||||
? (s.length > 0 &&
|
||||
e.hasClass("slick-current") &&
|
||||
(n(u, c, l, r, !0),
|
||||
h && i(u, "delay", h),
|
||||
m && i(u, "duration", m),
|
||||
setTimeout(function () {
|
||||
n(u, d, l, r),
|
||||
n(u, c, f, r),
|
||||
y && i(u, "delay", y),
|
||||
C && i(u, "duration", C);
|
||||
}, t(h, m))),
|
||||
o.on("afterChange", function (a, o, s) {
|
||||
e.hasClass("slick-current") &&
|
||||
(n(u, c, l, r, !0),
|
||||
h && i(u, "delay", h),
|
||||
m && i(u, "duration", m),
|
||||
setTimeout(function () {
|
||||
n(u, d, l, r),
|
||||
n(u, c, f, r),
|
||||
y && i(u, "delay", y),
|
||||
C && i(u, "duration", C);
|
||||
}, t(h, m)));
|
||||
}),
|
||||
o.on("beforeChange", function (a, t, i) {
|
||||
n(u, d, f, r, !0);
|
||||
}))
|
||||
: (s.length > 0 &&
|
||||
e.hasClass("slick-current") &&
|
||||
(n(u, c, l, r, !0),
|
||||
h && i(u, "delay", h),
|
||||
m && i(u, "duration", m)),
|
||||
o.on("afterChange", function (a, t, o) {
|
||||
e.hasClass("slick-current") &&
|
||||
(n(u, c, l, r, !0),
|
||||
h && i(u, "delay", h),
|
||||
m && i(u, "duration", m));
|
||||
}),
|
||||
o.on("beforeChange", function (a, t, i) {
|
||||
n(u, d, l, r, !0);
|
||||
}));
|
||||
});
|
||||
}),
|
||||
this
|
||||
);
|
||||
};
|
||||
})(jQuery);
|
||||
+1
File diff suppressed because one or more lines are too long
+3512
File diff suppressed because it is too large
Load Diff
+446
@@ -0,0 +1,446 @@
|
||||
/* -- DO NOT REMOVE --
|
||||
* jQuery MDTimePicker v1.0 plugin
|
||||
*
|
||||
* Author: Dionlee Uy
|
||||
* Email: dionleeuy@gmail.com
|
||||
*
|
||||
* Date: Tuesday, August 28 2017
|
||||
*
|
||||
* @requires jQuery
|
||||
* -- DO NOT REMOVE -- */
|
||||
if ("undefined" == typeof jQuery)
|
||||
throw new Error("MDTimePicker: This plugin requires jQuery");
|
||||
+(function (e) {
|
||||
var t = "mdtimepicker",
|
||||
i = 120,
|
||||
s = 90,
|
||||
n = 360,
|
||||
r = 30,
|
||||
a = 6,
|
||||
o = [9, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123],
|
||||
c = function (t, i) {
|
||||
(this.hour = t),
|
||||
(this.minute = i),
|
||||
(this.format = function (t, i) {
|
||||
var s = this,
|
||||
n = (t.match(/h/g) || []).length > 1;
|
||||
return e.trim(
|
||||
t.replace(/(hh|h|mm|ss|tt|t)/g, function (e) {
|
||||
switch (e.toLowerCase()) {
|
||||
case "h":
|
||||
var t = s.getHour(!0);
|
||||
return i && 10 > t ? "0" + t : t;
|
||||
case "hh":
|
||||
return s.hour < 10 ? "0" + s.hour : s.hour;
|
||||
case "mm":
|
||||
return s.minute < 10 ? "0" + s.minute : s.minute;
|
||||
case "ss":
|
||||
return "00";
|
||||
case "t":
|
||||
return n ? "" : s.getT().toLowerCase();
|
||||
case "tt":
|
||||
return n ? "" : s.getT();
|
||||
}
|
||||
})
|
||||
);
|
||||
}),
|
||||
(this.setHour = function (e) {
|
||||
this.hour = e;
|
||||
}),
|
||||
(this.getHour = function (e) {
|
||||
return e
|
||||
? 0 === this.hour || 12 === this.hour
|
||||
? 12
|
||||
: this.hour % 12
|
||||
: this.hour;
|
||||
}),
|
||||
(this.invert = function () {
|
||||
"AM" === this.getT()
|
||||
? this.setHour(this.getHour() + 12)
|
||||
: this.setHour(this.getHour() - 12);
|
||||
}),
|
||||
(this.setMinutes = function (e) {
|
||||
this.minute = e;
|
||||
}),
|
||||
(this.getMinutes = function () {
|
||||
return this.minute;
|
||||
}),
|
||||
(this.getT = function () {
|
||||
return this.hour < 12 ? "AM" : "PM";
|
||||
});
|
||||
},
|
||||
d = function (t, i) {
|
||||
var s = this;
|
||||
(this.visible = !1),
|
||||
(this.activeView = "hours"),
|
||||
(this.hTimeout = null),
|
||||
(this.mTimeout = null),
|
||||
(this.input = e(t)),
|
||||
(this.config = i),
|
||||
(this.time = new c(0, 0)),
|
||||
(this.selected = new c(0, 0)),
|
||||
(this.timepicker = {
|
||||
overlay: e('<div class="mdtimepicker hidden"></div>'),
|
||||
wrapper: e('<div class="mdtp__wrapper"></div>'),
|
||||
timeHolder: {
|
||||
wrapper: e('<section class="mdtp__time_holder"></section>'),
|
||||
hour: e('<span class="mdtp__time_h">12</span>'),
|
||||
dots: e('<span class="mdtp__timedots">:</span>'),
|
||||
minute: e('<span class="mdtp__time_m">00</span>'),
|
||||
am_pm: e('<span class="mdtp__ampm">AM</span>'),
|
||||
},
|
||||
clockHolder: {
|
||||
wrapper: e('<section class="mdtp__clock_holder"></section>'),
|
||||
am: e('<span class="mdtp__am">AM</span>'),
|
||||
pm: e('<span class="mdtp__pm">PM</span>'),
|
||||
clock: {
|
||||
wrapper: e('<div class="mdtp__clock"></div>'),
|
||||
dot: e('<span class="mdtp__clock_dot"></span>'),
|
||||
hours: e('<div class="mdtp__hour_holder"></div>'),
|
||||
minutes: e('<div class="mdtp__minute_holder"></div>'),
|
||||
},
|
||||
buttonsHolder: {
|
||||
wrapper: e('<div class="mdtp__buttons">'),
|
||||
btnOk: e('<span class="mdtp__button ok">Ok</span>'),
|
||||
btnCancel: e('<span class="mdtp__button cancel">Cancel</span>'),
|
||||
},
|
||||
},
|
||||
});
|
||||
var n = s.timepicker;
|
||||
if (
|
||||
(s.setup(n).appendTo("body"),
|
||||
n.clockHolder.am.click(function () {
|
||||
"AM" !== s.selected.getT() && s.setT("am");
|
||||
}),
|
||||
n.clockHolder.pm.click(function () {
|
||||
"PM" !== s.selected.getT() && s.setT("pm");
|
||||
}),
|
||||
n.timeHolder.hour.click(function () {
|
||||
"hours" !== s.activeView && s.switchView("hours");
|
||||
}),
|
||||
n.timeHolder.minute.click(function () {
|
||||
"minutes" !== s.activeView && s.switchView("minutes");
|
||||
}),
|
||||
n.clockHolder.buttonsHolder.btnOk.click(function () {
|
||||
s.setValue(s.selected);
|
||||
var t = s.getFormattedTime();
|
||||
s.input
|
||||
.trigger(e.Event("timechanged", { time: t.time, value: t.value }))
|
||||
.trigger("onchange"),
|
||||
s.hide();
|
||||
}),
|
||||
n.clockHolder.buttonsHolder.btnCancel.click(function () {
|
||||
s.hide();
|
||||
}),
|
||||
s.input
|
||||
.on("keydown", function (e) {
|
||||
return (
|
||||
13 === e.keyCode && s.show(),
|
||||
!(o.indexOf(e.which) < 0 && s.config.readOnly)
|
||||
);
|
||||
})
|
||||
.on("click", function () {
|
||||
s.show();
|
||||
})
|
||||
.prop("readonly", s.config.readOnly),
|
||||
"" !== s.input.val())
|
||||
) {
|
||||
var r = s.parseTime(s.input.val(), s.config.format);
|
||||
s.setValue(r);
|
||||
} else {
|
||||
var r = s.getSystemTime();
|
||||
s.time = new c(r.hour, r.minute);
|
||||
}
|
||||
s.resetSelected(), s.switchView(s.activeView);
|
||||
};
|
||||
(d.prototype = {
|
||||
constructor: d,
|
||||
setup: function (t) {
|
||||
if ("undefined" == typeof t) throw new Error("Expecting a value.");
|
||||
var o = this,
|
||||
c = t.overlay,
|
||||
d = t.wrapper,
|
||||
u = t.timeHolder,
|
||||
m = t.clockHolder;
|
||||
u.wrapper
|
||||
.append(u.hour)
|
||||
.append(u.dots)
|
||||
.append(u.minute)
|
||||
.append(u.am_pm)
|
||||
.appendTo(d);
|
||||
for (var l = 0; 12 > l; l++) {
|
||||
var p = l + 1,
|
||||
h = (i + l * r) % n,
|
||||
f = e(
|
||||
'<div class="mdtp__digit rotate-' +
|
||||
h +
|
||||
'" data-hour="' +
|
||||
p +
|
||||
'"><span>' +
|
||||
p +
|
||||
"</span></div>"
|
||||
);
|
||||
f.find("span").click(function () {
|
||||
var t = parseInt(e(this).parent().data("hour")),
|
||||
i = o.selected.getT(),
|
||||
s =
|
||||
(t +
|
||||
(("PM" === i && 12 > t) || ("AM" === i && 12 === t) ? 12 : 0)) %
|
||||
24;
|
||||
o.setHour(s), o.switchView("minutes");
|
||||
}),
|
||||
m.clock.hours.append(f);
|
||||
}
|
||||
for (var l = 0; 60 > l; l++) {
|
||||
var v = 10 > l ? "0" + l : l,
|
||||
h = (s + l * a) % n,
|
||||
k = e(
|
||||
'<div class="mdtp__digit rotate-' +
|
||||
h +
|
||||
'" data-minute="' +
|
||||
l +
|
||||
'"></div>'
|
||||
);
|
||||
l % 5 === 0
|
||||
? k.addClass("marker").html("<span>" + v + "</span>")
|
||||
: k.html("<span></span>"),
|
||||
k.find("span").click(function () {
|
||||
o.setMinute(e(this).parent().data("minute"));
|
||||
}),
|
||||
m.clock.minutes.append(k);
|
||||
}
|
||||
switch (
|
||||
(m.clock.wrapper
|
||||
.append(m.am)
|
||||
.append(m.pm)
|
||||
.append(m.clock.dot)
|
||||
.append(m.clock.hours)
|
||||
.append(m.clock.minutes)
|
||||
.appendTo(m.wrapper),
|
||||
m.buttonsHolder.wrapper
|
||||
.append(m.buttonsHolder.btnCancel)
|
||||
.append(m.buttonsHolder.btnOk)
|
||||
.appendTo(m.wrapper),
|
||||
m.wrapper.appendTo(d),
|
||||
o.config.theme)
|
||||
) {
|
||||
case "red":
|
||||
case "blue":
|
||||
case "green":
|
||||
case "purple":
|
||||
case "indigo":
|
||||
case "teal":
|
||||
d.attr("data-theme", o.config.theme);
|
||||
break;
|
||||
default:
|
||||
d.attr("data-theme", e.fn.mdtimepicker.defaults.theme);
|
||||
}
|
||||
return d.appendTo(c), c;
|
||||
},
|
||||
setHour: function (t) {
|
||||
if ("undefined" == typeof t) throw new Error("Expecting a value.");
|
||||
var i = this;
|
||||
this.selected.setHour(t),
|
||||
this.timepicker.timeHolder.hour.text(this.selected.getHour(!0)),
|
||||
this.timepicker.clockHolder.clock.hours
|
||||
.children("div")
|
||||
.each(function (t, s) {
|
||||
var n = e(s),
|
||||
r = n.data("hour");
|
||||
n[r === i.selected.getHour(!0) ? "addClass" : "removeClass"](
|
||||
"active"
|
||||
);
|
||||
});
|
||||
},
|
||||
setMinute: function (t) {
|
||||
if ("undefined" == typeof t) throw new Error("Expecting a value.");
|
||||
this.selected.setMinutes(t),
|
||||
this.timepicker.timeHolder.minute.text(10 > t ? "0" + t : t),
|
||||
this.timepicker.clockHolder.clock.minutes
|
||||
.children("div")
|
||||
.each(function (i, s) {
|
||||
var n = e(s),
|
||||
r = n.data("minute");
|
||||
n[r === t ? "addClass" : "removeClass"]("active");
|
||||
});
|
||||
},
|
||||
setT: function (e) {
|
||||
if ("undefined" == typeof e) throw new Error("Expecting a value.");
|
||||
this.selected.getT() !== e.toUpperCase() && this.selected.invert();
|
||||
var t = this.selected.getT();
|
||||
this.timepicker.timeHolder.am_pm.text(t),
|
||||
this.timepicker.clockHolder.am["AM" === t ? "addClass" : "removeClass"](
|
||||
"active"
|
||||
),
|
||||
this.timepicker.clockHolder.pm["PM" === t ? "addClass" : "removeClass"](
|
||||
"active"
|
||||
);
|
||||
},
|
||||
setValue: function (e) {
|
||||
if ("undefined" == typeof e) throw new Error("Expecting a value.");
|
||||
var t = "string" == typeof e ? this.parseTime(e, this.config.format) : e;
|
||||
this.time = new c(t.hour, t.minute);
|
||||
var i = this.getFormattedTime();
|
||||
this.input.val(i.value).attr("data-time", i.time).attr("value", i.value);
|
||||
},
|
||||
resetSelected: function () {
|
||||
this.setHour(this.time.hour),
|
||||
this.setMinute(this.time.minute),
|
||||
this.setT(this.time.getT());
|
||||
},
|
||||
getFormattedTime: function () {
|
||||
var e = this.time.format(this.config.timeFormat, !1),
|
||||
t = this.time.format(this.config.format, this.config.hourPadding);
|
||||
return { time: e, value: t };
|
||||
},
|
||||
getSystemTime: function () {
|
||||
var e = new Date();
|
||||
return new c(e.getHours(), e.getMinutes());
|
||||
},
|
||||
parseTime: function (e, t) {
|
||||
var i = this,
|
||||
s = "undefined" == typeof t ? i.config.format : t,
|
||||
n = (s.match(/h/g) || []).length,
|
||||
r = n > 1,
|
||||
a = ((s.match(/m/g) || []).length, (s.match(/t/g) || []).length),
|
||||
o = e.length,
|
||||
d = s.indexOf("h"),
|
||||
u = s.lastIndexOf("h"),
|
||||
m = "",
|
||||
l = "",
|
||||
p = "";
|
||||
if (i.config.hourPadding || r) m = e.substr(d, 2);
|
||||
else {
|
||||
var h = s.substring(d - 1, d),
|
||||
f = s.substring(u + 1, u + 2);
|
||||
m =
|
||||
u === s.length - 1
|
||||
? e.substring(e.indexOf(h, d - 1) + 1, o)
|
||||
: 0 === d
|
||||
? e.substring(0, e.indexOf(f, d))
|
||||
: e.substring(e.indexOf(h, d - 1) + 1, e.indexOf(f, d + 1));
|
||||
}
|
||||
s = s.replace(/(hh|h)/g, m);
|
||||
var v = s.indexOf("m"),
|
||||
k = s.lastIndexOf("m"),
|
||||
g = s.indexOf("t"),
|
||||
w = s.substring(v - 1, v);
|
||||
s.substring(k + 1, k + 2);
|
||||
(l =
|
||||
k === s.length - 1
|
||||
? e.substring(e.indexOf(w, v - 1) + 1, o)
|
||||
: 0 === v
|
||||
? e.substring(0, 2)
|
||||
: e.substr(v, 2)),
|
||||
(p = r
|
||||
? parseInt(m) > 11
|
||||
? a > 1
|
||||
? "PM"
|
||||
: "pm"
|
||||
: a > 1
|
||||
? "AM"
|
||||
: "am"
|
||||
: e.substr(g, 2));
|
||||
var H = "pm" === p.toLowerCase(),
|
||||
_ = new c(parseInt(m), parseInt(l));
|
||||
return (
|
||||
((H && parseInt(m) < 12) || (!H && 12 === parseInt(m))) && _.invert(), _
|
||||
);
|
||||
},
|
||||
switchView: function (e) {
|
||||
var t = this,
|
||||
i = this.timepicker,
|
||||
s = 350;
|
||||
("hours" !== e && "minutes" !== e) ||
|
||||
((t.activeView = e),
|
||||
i.timeHolder.hour["hours" === e ? "addClass" : "removeClass"]("active"),
|
||||
i.timeHolder.minute["hours" === e ? "removeClass" : "addClass"](
|
||||
"active"
|
||||
),
|
||||
i.clockHolder.clock.hours.addClass("animate"),
|
||||
"hours" === e && i.clockHolder.clock.hours.removeClass("hidden"),
|
||||
clearTimeout(t.hTimeout),
|
||||
(t.hTimeout = setTimeout(
|
||||
function () {
|
||||
"hours" !== e && i.clockHolder.clock.hours.addClass("hidden"),
|
||||
i.clockHolder.clock.hours.removeClass("animate");
|
||||
},
|
||||
"hours" === e ? 20 : s
|
||||
)),
|
||||
i.clockHolder.clock.minutes.addClass("animate"),
|
||||
"minutes" === e && i.clockHolder.clock.minutes.removeClass("hidden"),
|
||||
clearTimeout(t.mTimeout),
|
||||
(t.mTimeout = setTimeout(
|
||||
function () {
|
||||
"minutes" !== e && i.clockHolder.clock.minutes.addClass("hidden"),
|
||||
i.clockHolder.clock.minutes.removeClass("animate");
|
||||
},
|
||||
"minutes" === e ? 20 : s
|
||||
)));
|
||||
},
|
||||
show: function () {
|
||||
var t = this;
|
||||
if ("" === t.input.val()) {
|
||||
var i = t.getSystemTime();
|
||||
this.time = new c(i.hour, i.minute);
|
||||
}
|
||||
t.resetSelected(),
|
||||
e("body").attr("mdtimepicker-display", "on"),
|
||||
t.timepicker.wrapper.addClass("animate"),
|
||||
t.timepicker.overlay.removeClass("hidden").addClass("animate"),
|
||||
setTimeout(function () {
|
||||
t.timepicker.overlay.removeClass("animate"),
|
||||
t.timepicker.wrapper.removeClass("animate"),
|
||||
(t.visible = !0),
|
||||
t.input.blur();
|
||||
}, 10);
|
||||
},
|
||||
hide: function () {
|
||||
var t = this;
|
||||
t.timepicker.overlay.addClass("animate"),
|
||||
t.timepicker.wrapper.addClass("animate"),
|
||||
setTimeout(function () {
|
||||
t.switchView("hours"),
|
||||
t.timepicker.overlay.addClass("hidden").removeClass("animate"),
|
||||
t.timepicker.wrapper.removeClass("animate"),
|
||||
e("body").removeAttr("mdtimepicker-display"),
|
||||
(t.visible = !1),
|
||||
t.input.focus();
|
||||
}, 300);
|
||||
},
|
||||
destroy: function () {
|
||||
var e = this;
|
||||
e.input
|
||||
.removeData(t)
|
||||
.unbind("keydown")
|
||||
.unbind("click")
|
||||
.removeProp("readonly"),
|
||||
e.timepicker.overlay.remove();
|
||||
},
|
||||
}),
|
||||
(e.fn.mdtimepicker = function (i) {
|
||||
return e(this).each(function () {
|
||||
var s = this,
|
||||
n = e(this),
|
||||
r = e(this).data(t);
|
||||
(options = e.extend(
|
||||
{},
|
||||
e.fn.mdtimepicker.defaults,
|
||||
n.data(),
|
||||
"object" == typeof i && i
|
||||
)),
|
||||
r || n.data(t, (r = new d(s, options))),
|
||||
"string" == typeof i && r[i](),
|
||||
e(document).on("keydown", function (e) {
|
||||
27 === e.keyCode && r.visible && r.hide();
|
||||
});
|
||||
});
|
||||
}),
|
||||
(e.fn.mdtimepicker.defaults = {
|
||||
timeFormat: "hh:mm:ss.000",
|
||||
format: "h:mm tt",
|
||||
theme: "blue",
|
||||
readOnly: !0,
|
||||
hourPadding: !1,
|
||||
});
|
||||
})(jQuery);
|
||||
+4
File diff suppressed because one or more lines are too long
+34
@@ -0,0 +1,34 @@
|
||||
var $iframe = $('iframe'),
|
||||
$videoLink = $('.play-btn'),
|
||||
playerTemplate = '<div class="player"><div class="player__video"><div class="video-filler"></div><button class="video-close">×</button><iframe class="video-iframe" src="{{iframevideo}}" frameborder="0" allowfullscreen></iframe></div><div/>';
|
||||
|
||||
|
||||
$videoLink.on('click', function (e) {
|
||||
var localTemplate = '',
|
||||
videoWidth = parseInt($(this).data('width')),
|
||||
videoHeight = parseInt($(this).data('height')),
|
||||
videoAspect = (videoHeight / videoWidth) * 100,
|
||||
// elements
|
||||
$player = null,
|
||||
$video = null,
|
||||
$close = null,
|
||||
$iframe = null;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
localTemplate = playerTemplate.replace('{{iframevideo}}', $(this).prop('href'));
|
||||
|
||||
$player = $(localTemplate);
|
||||
|
||||
$player
|
||||
.find('.video-filler')
|
||||
.css('padding-top', videoAspect + '%');
|
||||
|
||||
$close = $player
|
||||
.find('.video-close')
|
||||
.on('click', function () {
|
||||
$(this).off().closest('.player').hide().remove();
|
||||
});
|
||||
|
||||
$player.appendTo('body').addClass('js--show-video');
|
||||
});
|
||||
+6071
File diff suppressed because it is too large
Load Diff
+2
File diff suppressed because one or more lines are too long
+6
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user