{"size": 15913, "ext": "js", "max_stars_repo_path": "resources/assets/js/libraries/datepicker.min.js", "max_stars_repo_name": "voodoostudio/Heraclee", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "resources/assets/js/libraries/datepicker.min.js", "max_issues_repo_name": "voodoostudio/Heraclee", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "resources/assets/js/libraries/datepicker.min.js", "max_forks_repo_name": "voodoostudio/Heraclee", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 15913.0, "max_line_length": 15913, "alphanum_fraction": 0.6971029975}
if(typeof(gj)==="undefined"){gj={}}gj.widget=function(){var a=this;a.xhr=null;a.generateGUID=function(){function b(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return b()+b()+"-"+b()+"-"+b()+"-"+b()+"-"+b()+b()+b()};a.mouseX=function(b){if(b){if(b.pageX){return b.pageX}else{if(b.clientX){return b.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft)}else{if(b.touches&&b.touches.length){return b.touches[0].pageX}else{if(b.changedTouches&&b.changedTouches.length){return b.changedTouches[0].pageX}else{if(b.originalEvent&&b.originalEvent.touches&&b.originalEvent.touches.length){return b.originalEvent.touches[0].pageX}else{if(b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches.length){return b.originalEvent.touches[0].pageX}}}}}}}return null};a.mouseY=function(b){if(b){if(b.pageY){return b.pageY}else{if(b.clientY){return b.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)}else{if(b.touches&&b.touches.length){return b.touches[0].pageY}else{if(b.changedTouches&&b.changedTouches.length){return b.changedTouches[0].pageY}else{if(b.originalEvent&&b.originalEvent.touches&&b.originalEvent.touches.length){return b.originalEvent.touches[0].pageY}else{if(b.originalEvent&&b.originalEvent.changedTouches&&b.originalEvent.changedTouches.length){return b.originalEvent.touches[0].pageY}}}}}}}return null}};gj.widget.prototype.init=function(a,e){var d,c,b;this.attr("data-type",e);c=$.extend(true,{},this.getHTMLConfig()||{});$.extend(true,c,a||{});b=this.getConfig(c,e);this.attr("data-guid",b.guid);this.data(b);for(d in b){if(gj[e].events.hasOwnProperty(d)){this.on(d,b[d]);delete b[d]}}for(plugin in gj[e].plugins){if(gj[e].plugins.hasOwnProperty(plugin)){gj[e].plugins[plugin].configure(this,b,c)}}return this};gj.widget.prototype.getConfig=function(d,c){var b,a,f,e;b=$.extend(true,{},gj[c].config.base);a=d.hasOwnProperty("uiLibrary")?d.uiLibrary:b.uiLibrary;if(gj[c].config[a]){$.extend(true,b,gj[c].config[a])}f=d.hasOwnProperty("iconsLibrary")?d.iconsLibrary:b.iconsLibrary;if(gj[c].config[f]){$.extend(true,b,gj[c].config[f])}for(e in gj[c].plugins){if(gj[c].plugins.hasOwnProperty(e)){$.extend(true,b,gj[c].plugins[e].config.base);if(gj[c].plugins[e].config[a]){$.extend(true,b,gj[c].plugins[e].config[a])}if(gj[c].plugins[e].config[f]){$.extend(true,b,gj[c].plugins[e].config[f])}}}$.extend(true,b,d);if(!b.guid){b.guid=this.generateGUID()}return b};gj.widget.prototype.getHTMLConfig=function(){var a=this.data(),b=this[0].attributes;if(b.width){a.width=b.width.nodeValue}if(b.height){a.height=b.height.nodeValue}if(b.align){a.align=b.align.nodeValue}if(a&&a.source){a.dataSource=a.source;delete a.source}return a};gj.widget.prototype.createDoneHandler=function(){var a=this;return function(b){if(typeof(b)==="string"&&JSON){b=JSON.parse(b)}gj[a.data("type")].methods.render(a,b)}};gj.widget.prototype.createErrorHandler=function(){var a=this;return function(b){if(b&&b.statusText&&b.statusText!=="abort"){alert(b.statusText)}}};gj.widget.prototype.reload=function(e){var b,a,d=this.data(),c=this.data("type");if(d.dataSource===undefined){gj[c].methods.useHtmlDataSource(this,d)}$.extend(d.params,e);if($.isArray(d.dataSource)){a=gj[c].methods.filter(this);gj[c].methods.render(this,a)}else{if(typeof(d.dataSource)==="string"){b={url:d.dataSource,data:d.params};if(this.xhr){this.xhr.abort()}this.xhr=$.ajax(b).done(this.createDoneHandler()).fail(this.createErrorHandler())}else{if(typeof(d.dataSource)==="object"){if(!d.dataSource.data){d.dataSource.data={}}$.extend(d.dataSource.data,d.params);b=$.extend(true,{},d.dataSource);if(b.dataType==="json"&&typeof(b.data)==="object"){b.data=JSON.stringify(b.data)}if(!b.success){b.success=this.createDoneHandler()}if(!b.error){b.error=this.createErrorHandler()}if(this.xhr){this.xhr.abort()}this.xhr=$.ajax(b)}}}return this};gj.documentManager={events:{},subscribeForEvent:function(a,b,c){if(!gj.documentManager.events[a]||gj.documentManager.events[a].length===0){gj.documentManager.events[a]=[{widgetId:b,callback:c}];$(document).on(a,gj.documentManager.executeCallbacks)}else{if(!gj.documentManager.events[a][b]){gj.documentManager.events[a].push({widgetId:b,callback:c})}else{throw"Event "+a+' for widget with guid="'+b+'" is already attached.'}}},executeCallbacks:function(c){var b=gj.documentManager.events[c.type];if(b){for(var a=0;a<b.length;a++){b[a].callback(c)}}},unsubscribeForEvent:function(a,d){var e=false,c=gj.documentManager.events[a];if(c){for(var b=0;b<c.length;b++){if(c[b].widgetId===d){c.splice(b,1);e=true;if(c.length===0){$(document).off(a);delete gj.documentManager.events[a]}}}}if(!e){throw'The "'+a+'" for widget with guid="'+d+"\" can't be removed."}}};gj.core={monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthShortNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],parseDate:function(f,e){var b,a,c,d,g,j,h;if(f&&typeof f==="string"){if(/^\d+$/.test(f)){h=new Date(f)}else{if(f.indexOf("/Date(")>-1){h=new Date(parseInt(f.substr(6),10))}else{if(f){g=f.split(/[\s,-\.//\:]+/);j=e.split(/[\s,-\.//\:]+/);for(b=0;b<j.length;b++){if(["d","dd"].indexOf(j[b])>-1){a=parseInt(g[b],10)}else{if(["m","mm"].indexOf(j[b])>-1){c=parseInt(g[b],10)-1}else{if("mmm"===j[b]){c=gj.core.monthShortNames.indexOf(g[b])}else{if("mmmm"===j[b]){c=gj.core.monthNames.indexOf(g[b])}else{if(["yy","yyyy"].indexOf(j[b])>-1){d=parseInt(g[b],10);if(j[b]==="yy"){d+=2000}}}}}}}h=new Date(d,c,a)}}}}else{if(typeof f==="number"){h=new Date(f)}else{if(f instanceof Date){h=f}}}return h},formatDate:function(c,h){var a="",g,e,b=h.split(/[\s,-\.//\:]+/),d=h.replace(/[shtdmyHTDMY]/g,""),f=function(k,j){k=String(k);j=j||2;while(k.length<j){k="0"+k}return k};for(i=0;i<b.length;i++){g=(d[i]||"");switch(b[i]){case"s":a+=c.getSeconds()+g;break;case"ss":a+=f(c.getSeconds())+g;break;case"M":a+=c.getMinutes()+g;break;case"MM":a+=f(c.getMinutes())+g;break;case"H":a+=c.getHours()+g;break;case"HH":a+=f(c.getHours())+g;break;case"h":e=c.getHours()>12?c.getHours()%12:c.getHours();a+=e+g;break;case"hh":e=c.getHours()>12?c.getHours()%12:c.getHours();a+=f(e)+g;break;case"tt":a+=(c.getHours()>=12?"pm":"am")+g;break;case"TT":a+=(c.getHours()>=12?"PM":"AM")+g;break;case"d":a+=c.getDate()+g;break;case"dd":a+=f(c.getDate())+g;break;case"m":a+=(c.getMonth()+1)+g;break;case"mm":a+=f(c.getMonth()+1)+g;break;case"mmm":a+=gj.core.monthShortNames[c.getMonth()]+g;break;case"mmmm":a+=gj.core.monthNames[c.getMonth()]+g;break;case"yy":a+=c.getFullYear().toString().substr(2)+g;break;case"yyyy":a+=c.getFullYear()+g;break}}return a},isIE:function(){return !!navigator.userAgent.match(/Trident/g)||!!navigator.userAgent.match(/MSIE/g)}};if(typeof(gj.datepicker)==="undefined"){gj.datepicker={plugins:{}}}gj.datepicker.config={base:{weekDays:["S","M","T","W","T","F","S"],showOtherMonths:false,selectOtherMonths:true,width:undefined,minDate:undefined,maxDate:undefined,format:"mm/dd/yyyy",uiLibrary:"materialdesign",iconsLibrary:"materialicons",icons:{rightIcon:'<i class="material-icons">event</i>',previousMonth:'<i class="material-icons">keyboard_arrow_left</i>',nextMonth:'<i class="material-icons">keyboard_arrow_right</i>'},fontSize:undefined,style:{wrapper:"gj-datepicker gj-datepicker-md gj-unselectable",input:"gj-textbox-md",calendar:"gj-calendar gj-calendar-md"}},bootstrap:{style:{wrapper:"gj-datepicker gj-datepicker-bootstrap gj-unselectable input-group",input:"form-control",calendar:"gj-calendar gj-calendar-bootstrap"},iconsLibrary:"glyphicons",showOtherMonths:true},bootstrap4:{style:{wrapper:"gj-datepicker gj-datepicker-bootstrap gj-unselectable input-group",input:"form-control",calendar:"gj-calendar gj-calendar-bootstrap"},showOtherMonths:true},materialicons:{},fontawesome:{icons:{rightIcon:'<span class="input-group-addon"><i class="fa fa-calendar" aria-hidden="true"></i></span>',previousMonth:'<i class="fa fa-chevron-left" aria-hidden="true"></i>',nextMonth:'<i class="fa fa-chevron-right" aria-hidden="true"></i>'}},glyphicons:{icons:{rightIcon:'<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>',previousMonth:'<span class="glyphicon glyphicon-chevron-left"></span>',nextMonth:'<span class="glyphicon glyphicon-chevron-right"></span>'}}};gj.datepicker.methods={init:function(a){gj.widget.prototype.init.call(this,a,"datepicker");this.attr("data-datepicker","true");gj.datepicker.methods.initialize(this);return this},initialize:function(b){var d=b.data(),c=b.parent('div[role="wrapper"]'),a=d.uiLibrary!=="materialdesign"&&d.iconsLibrary==="materialicons"?$('<span class="input-group-addon">'+d.icons.rightIcon+"</span>"):$(d.icons.rightIcon);a.attr("role","right-icon");if(c.length===0){c=$('<div role="wrapper" />').addClass(d.style.wrapper);b.wrap(c)}else{c.addClass(d.style.wrapper)}c=b.parent('div[role="wrapper"]');d.width&&c.css("width",d.width);b.addClass(d.style.input).attr("role","input");d.fontSize&&b.css("font-size",d.fontSize);a.on("click",function(f){if($("body").children('[role="calendar"][guid="'+b.attr("data-guid")+'"]').is(":visible")){gj.datepicker.methods.hide(b)}else{gj.datepicker.methods.renderCalendar(b);gj.datepicker.methods.show(b)}});c.append(a);gj.datepicker.methods.createCalendar(b)},createCalendar:function(e){var b,g=e.data(),f=e.val(),d=$('<div role="calendar" />').addClass(g.style.calendar).attr("guid",e.attr("data-guid")),a=$("<table/>"),c=$("<thead/>");g.fontSize&&d.css("font-size",g.fontSize);b=gj.core.parseDate(f,g.format);if(!b||isNaN(b.getTime())){b=new Date()}else{e.attr("day",b.getFullYear()+"-"+b.getMonth()+"-"+b.getDate())}e.attr("month",b.getMonth());e.attr("year",b.getFullYear());$row=$('<tr role="month-manager" />');$row.append($("<th><div>"+g.icons.previousMonth+"</div></th>").on("click",gj.datepicker.methods.prevMonth(e)));$row.append('<th colspan="5"><div role="month"></div></th>');$row.append($("<th><div>"+g.icons.nextMonth+"</div></th>").on("click",gj.datepicker.methods.nextMonth(e)));c.append($row);$row=$('<tr role="week-days" />');for(i=0;i<g.weekDays.length;i++){$row.append("<th><div>"+g.weekDays[i]+"</div></th>")}c.append($row);a.append(c);a.append("<tbody/>");d.append(a);d.hide();$("body").append(d);return d},renderCalendar:function(u){var m,h,o,r,l,b,v,d,p,c,s,a,f,e,t=u.data(),q=$("body").children('[role="calendar"][guid="'+u.attr("data-guid")+'"]'),j=q.children("table"),n=j.children("tbody"),g=gj.datepicker.methods.getMinDate(t),k=gj.datepicker.methods.getMaxDate(t);if(u.attr("day")){h=u.attr("day").split("-");h=new Date(h[0],h[1],h[2])}else{h=new Date(undefined)}r=parseInt(u.attr("month"),10);l=parseInt(u.attr("year"),10);j.find('thead [role="month"]').text(gj.core.monthNames[r]+" "+l);b=new Array(31,28,31,30,31,30,31,31,30,31,30,31);if(l%4==0&&l!=1900){b[1]=29}v=b[r];d=new Date(l,r,1).getDay();n.empty();m=0;$row=$("<tr />");s=gj.datepicker.methods.getPrevMonth(r,l);for(p=1;p<=d;p++){o=(b[s.month]-d+p);if(s.year===h.getFullYear()&&s.month===h.getMonth()&&o===h.getDate()){f=$('<td type="selected" />')}else{f=$('<td type="other-month" />')}e=$("<div>"+o+"</div>");if(t.showOtherMonths){f.append(e);if(t.selectOtherMonths&&gj.datepicker.methods.isSelectable(g,k,s.year,s.month,o)){f.addClass("gj-cursor-pointer");e.on("click",gj.datepicker.methods.select(u,q,o,s.month,s.year))}else{f.addClass("disabled")}}$row.append(f);m++}n.append($row);c=new Date();for(p=1;p<=v;p++){if(m==0){$row=$("<tr>")}if(l===h.getFullYear()&&r===h.getMonth()&&p===h.getDate()){f=$('<td type="selected" />')}else{if(l===c.getFullYear()&&r===c.getMonth()&&p===c.getDate()){f=$('<td type="today" />')}else{f=$('<td type="current-month" />')}}e=$("<div>"+p+"</div>");if(gj.datepicker.methods.isSelectable(g,k,l,r,p)){f.addClass("gj-cursor-pointer");e.on("click",gj.datepicker.methods.select(u,q,p,r,l))}else{f.addClass("disabled")}f.append(e);$row.append(f);m++;if(m==7){n.append($row);m=0}}a=gj.datepicker.methods.getNextMonth(r,l);for(p=1;m!=0;p++){if(a.year===h.getFullYear()&&a.month===h.getMonth()&&p===h.getDate()){f=$('<td type="selected" />')}else{f=$('<td type="other-month" />')}if(t.showOtherMonths){e=$("<div>"+p+"</div>");f.append(e);if(t.selectOtherMonths&&gj.datepicker.methods.isSelectable(g,k,a.year,a.month,p)){f.addClass("gj-cursor-pointer");e.on("click",gj.datepicker.methods.select(u,q,p,a.month,a.year))}else{f.addClass("disabled")}}$row.append(f);m++;if(m==7){n.append($row);m=0}}},getMinDate:function(b){var a;if(b.minDate){if(typeof(b.minDate)==="string"){a=new Date(b.minDate)}else{if(typeof(b.minDate)==="function"){a=b.minDate()}else{if(typeof b.minDate.getMonth==="function"){a=b.minDate}}}}return a},getMaxDate:function(a){var b;if(a.maxDate){if(typeof a.maxDate==="string"){b=new Date(a.maxDate)}else{if(typeof a.maxDate==="function"){b=a.maxDate()}else{if(typeof a.maxDate.getMonth==="function"){b=a.maxDate}}}}return b},isSelectable:function(e,g,d,f,b){var a=false,c=new Date(d,f,b);if((!e||e<=c)&&(!g||g>=c)){a=true}return a},getPrevMonth:function(b,a){date=new Date(a,b,1);date.setMonth(date.getMonth()-1);return{month:date.getMonth(),year:date.getFullYear()}},getNextMonth:function(b,a){date=new Date(a,b,1);date.setMonth(date.getMonth()+1);return{month:date.getMonth(),year:date.getFullYear()}},prevMonth:function(a){return function(){var b,d=parseInt(a.attr("month"),10),c=parseInt(a.attr("year"),10);b=gj.datepicker.methods.getPrevMonth(d,c);a.attr("month",b.month);a.attr("year",b.year);gj.datepicker.methods.renderCalendar(a)}},nextMonth:function(a){return function(){var b,d=parseInt(a.attr("month"),10),c=parseInt(a.attr("year"),10);b=gj.datepicker.methods.getNextMonth(d,c);a.attr("month",b.month);a.attr("year",b.year);gj.datepicker.methods.renderCalendar(a)}},select:function(d,c,a,e,b){return function(j){var f,h,g=d.data();f=new Date(b,e,a);h=gj.core.formatDate(f,g.format);d.val(h);gj.datepicker.events.change(d);d.attr("day",b+"-"+e+"-"+a);d.attr("month",e);d.attr("year",b);gj.datepicker.methods.hide(d);return d}},show:function(b){var c=b.data(),d=b.offset(),a=$("body").children('[role="calendar"][guid="'+b.attr("data-guid")+'"]');a.css("left",d.left).css("top",d.top+b.outerHeight(true)+3);a.show();b.focus();gj.datepicker.events.show(b)},hide:function(b){var a=$("body").children('[role="calendar"][guid="'+b.attr("data-guid")+'"]');a.hide();gj.datepicker.events.hide(b)},value:function(c,d){var b,a;if(typeof(d)==="undefined"){return c.val()}else{a=gj.core.parseDate(d,c.data().format);if(a){b=$("body").children('[role="calendar"][guid="'+c.attr("data-guid")+'"]');gj.datepicker.methods.select(c,b,a.getDate(),a.getMonth(),a.getFullYear())()}else{c.val("")}return c}},destroy:function(a){var b=a.data(),c=a.parent();if(b){a.off();$("body").children('[role="calendar"][guid="'+a.attr("data-guid")+'"]').remove();a.removeData();a.removeAttr("data-type").removeAttr("data-guid").removeAttr("data-datepicker");a.removeClass();c.children('[role="right-icon"]').remove();a.unwrap()}return a}};gj.datepicker.events={change:function(a){return a.triggerHandler("change")},show:function(a){return a.triggerHandler("show")},hide:function(a){return a.triggerHandler("hide")}};gj.datepicker.widget=function(b,a){var d=this,c=gj.datepicker.methods;d.value=function(e){return c.value(this,e)};d.destroy=function(){return c.destroy(this)};$.extend(b,d);if("true"!==b.attr("data-datepicker")){c.init.call(b,a)}return b};gj.datepicker.widget.prototype=new gj.widget();gj.datepicker.widget.constructor=gj.datepicker.widget;(function(a){a.fn.datepicker=function(c){var b;if(this&&this.length){if(typeof c==="object"||!c){return new gj.datepicker.widget(this,c)}else{b=new gj.datepicker.widget(this,null);if(b[c]){return b[c].apply(this,Array.prototype.slice.call(arguments,1))}else{throw"Method "+c+" does not exist."}}}}})(jQuery);