diff --git a/dist/calendar-heatmap.min.js b/dist/calendar-heatmap.min.js index f59ea14..06193a8 100644 --- a/dist/calendar-heatmap.min.js +++ b/dist/calendar-heatmap.min.js @@ -1,2 +1,2 @@ -"use strict";var calendarHeatmap={settings:{gutter:5,item_gutter:1,width:1e3,height:200,item_size:10,label_padding:40,max_block_height:20,transition_duration:500,tooltip_width:250,tooltip_padding:15},init:function(a,e,t,n){calendarHeatmap.data=a,calendarHeatmap.color=e||"#ff4500",calendarHeatmap.overview=t||"global",calendarHeatmap.history=["global"],calendarHeatmap.selected={},calendarHeatmap.handler=n,calendarHeatmap.in_transition=!1,calendarHeatmap.createElements(),calendarHeatmap.parseData(),calendarHeatmap.drawChart()},createElements:function(){var a=document.createElement("div");a.className="calendar-heatmap",document.body.appendChild(a);var e=d3.select(a).append("svg").attr("class","svg");calendarHeatmap.items=e.append("g"),calendarHeatmap.labels=e.append("g"),calendarHeatmap.buttons=e.append("g"),calendarHeatmap.tooltip=d3.select(a).append("div").attr("class","heatmap-tooltip").style("opacity",0);var t=function(){var t=Math.round((moment()-moment().subtract(1,"year").startOf("week"))/864e5),n=Math.trunc(t/7),r=n+1;calendarHeatmap.settings.width=a.offsetWidth<1e3?1e3:a.offsetWidth,calendarHeatmap.settings.item_size=(calendarHeatmap.settings.width-calendarHeatmap.settings.label_padding)/r-calendarHeatmap.settings.gutter,calendarHeatmap.settings.height=calendarHeatmap.settings.label_padding+7*(calendarHeatmap.settings.item_size+calendarHeatmap.settings.gutter),e.attr({width:calendarHeatmap.settings.width,height:calendarHeatmap.settings.height}),calendarHeatmap.data&&calendarHeatmap.data[0].summary&&calendarHeatmap.drawChart()};t(),window.onresize=function(a){t()}},parseData:function(){calendarHeatmap.data&&(calendarHeatmap.data[0].summary||calendarHeatmap.data.map(function(a){var e=a.details.reduce(function(a,e){return a[e.name]?a[e.name].value+=e.value:a[e.name]={value:e.value},a},{}),t=Object.keys(e).map(function(a){return{name:a,value:e[a].value}});return a.summary=t.sort(function(a,e){return e.value-a.value}),a}))},drawChart:function(){"global"===calendarHeatmap.overview?calendarHeatmap.drawGlobalOverview():"year"===calendarHeatmap.overview?calendarHeatmap.drawYearOverview():"month"===calendarHeatmap.overview?calendarHeatmap.drawMonthOverview():"week"===calendarHeatmap.overview?calendarHeatmap.drawWeekOverview():"day"===calendarHeatmap.overview&&calendarHeatmap.drawDayOverview()},drawGlobalOverview:function(){calendarHeatmap.history[calendarHeatmap.history.length-1]!==calendarHeatmap.overview&&calendarHeatmap.history.push(calendarHeatmap.overview);var a=moment(calendarHeatmap.data[0].date).startOf("year"),e=moment(calendarHeatmap.data[calendarHeatmap.data.length-1].date).endOf("year"),t=d3.time.years(a,e).map(function(a){var e=moment(a);return{date:e,total:calendarHeatmap.data.reduce(function(a,t){return moment(t.date).year()===e.year()&&(a+=t.total),a},0),summary:function(){var a=calendarHeatmap.data.reduce(function(a,t){if(moment(t.date).year()===e.year())for(var n=0;n",e+="
in "+a.date.year()+"

";for(var t=0;t"+a.summary[t].name+"",e+=""+calendarHeatmap.formatTime(a.summary[t].value)+"";for(var n=i(a.date.year())+calendarHeatmap.settings.tooltip_padding;calendarHeatmap.settings.width-n0?r(a.total):"transparent"}).on("click",function(a){calendarHeatmap.in_transition||0!==a.total&&(calendarHeatmap.in_transition=!0,calendarHeatmap.selected=a,calendarHeatmap.hideTooltip(),calendarHeatmap.removeYearOverview(),calendarHeatmap.overview="day",calendarHeatmap.drawChart())}).on("mouseover",function(a){if(!calendarHeatmap.in_transition){var e=d3.select(this);!function s(){e=e.transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").attr("x",function(a){return i(a)-(1.1*calendarHeatmap.settings.item_size-calendarHeatmap.settings.item_size)/2}).attr("y",function(a){return l(a)-(1.1*calendarHeatmap.settings.item_size-calendarHeatmap.settings.item_size)/2}).attr("width",1.1*calendarHeatmap.settings.item_size).attr("height",1.1*calendarHeatmap.settings.item_size).transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").attr("x",function(a){return i(a)+(calendarHeatmap.settings.item_size-d(a))/2}).attr("y",function(a){return l(a)+(calendarHeatmap.settings.item_size-d(a))/2}).attr("width",function(a){return d(a)}).attr("height",function(a){return d(a)}).each("end",s)}();var t="";t+='
'+(a.total?calendarHeatmap.formatTime(a.total):"No time")+" tracked
",t+="
on "+moment(a.date).format("dddd, MMM Do YYYY")+"

";for(var n=0;n"+a.summary[n].name+"",t+=""+calendarHeatmap.formatTime(a.summary[n].value)+"";var r=i(a)+calendarHeatmap.settings.item_size;calendarHeatmap.settings.width-r
",t+="
"+(a.value?calendarHeatmap.formatTime(a.value):"No time")+" tracked
",t+="
on "+moment(e).format("dddd, MMM Do YYYY")+"
";for(var n=d(moment(e).week())+calendarHeatmap.settings.tooltip_padding;calendarHeatmap.settings.width-n
",t+="
"+(a.value?calendarHeatmap.formatTime(a.value):"No time")+" tracked
",t+="
on "+moment(e).format("dddd, MMM Do YYYY")+"
";var n=parseInt(d3.select(this.parentNode).attr("total"));c.domain([0,n]);for(var r=parseInt(d3.select(this).attr("x"))+c(a.value)/4+calendarHeatmap.settings.tooltip_width/4;calendarHeatmap.settings.width-r

",n+="
"+(a.value?calendarHeatmap.formatTime(a.value):"No time")+" tracked
",n+="
on "+moment(a.date).format("dddd, MMM Do YYYY HH:mm")+"
";for(var r=100*a.value/86400+t(moment(a.date));calendarHeatmap.settings.width-r=n&&e<=r?1:.1})}}).on("mouseout",function(){calendarHeatmap.in_transition||calendarHeatmap.items.selectAll(".item-block").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",.5)}),calendarHeatmap.labels.selectAll(".label-project").remove(),calendarHeatmap.labels.selectAll(".label-project").data(a).enter().append("text").attr("class","label label-project").attr("x",calendarHeatmap.settings.gutter).attr("y",function(a){return e(a)+e.rangeBand()/2}).attr("min-height",function(){return e.rangeBand()}).style("text-anchor","left").attr("font-size",function(){return Math.floor(calendarHeatmap.settings.label_padding/3)+"px"}).text(function(a){return a}).each(function(){for(var a=d3.select(this),e=a.node().getComputedTextLength(),t=a.text();e>1.5*calendarHeatmap.settings.label_padding&&t.length>0;)t=t.slice(0,-1),a.text(t+"..."),e=a.node().getComputedTextLength()}).on("mouseenter",function(a){calendarHeatmap.in_transition||calendarHeatmap.items.selectAll(".item-block").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",function(e){return e.name===a?1:.1})}).on("mouseout",function(){calendarHeatmap.in_transition||calendarHeatmap.items.selectAll(".item-block").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",.5)}),calendarHeatmap.drawButton()},drawButton:function(){calendarHeatmap.buttons.selectAll(".button").remove();var a=calendarHeatmap.buttons.append("g").attr("class","button button-back").style("opacity",0).on("click",function(){calendarHeatmap.in_transition||(calendarHeatmap.in_transition=!0,"year"===calendarHeatmap.overview?calendarHeatmap.removeYearOverview():"month"===calendarHeatmap.overview?calendarHeatmap.removeMonthOverview():"week"===calendarHeatmap.overview?calendarHeatmap.removeWeekOverview():"day"===calendarHeatmap.overview&&calendarHeatmap.removeDayOverview(),calendarHeatmap.history.pop(),calendarHeatmap.overview=calendarHeatmap.history.pop(),calendarHeatmap.drawChart())});a.append("circle").attr("cx",calendarHeatmap.settings.label_padding/2.25).attr("cy",calendarHeatmap.settings.label_padding/2.5).attr("r",calendarHeatmap.settings.item_size/2),a.append("text").attr("x",calendarHeatmap.settings.label_padding/2.25).attr("y",calendarHeatmap.settings.label_padding/2.5).attr("dy",function(){ -return Math.floor(calendarHeatmap.settings.width/100)/3}).attr("font-size",function(){return Math.floor(calendarHeatmap.settings.label_padding/3)+"px"}).html("←"),a.transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",1)},removeGlobalOverview:function(){calendarHeatmap.items.selectAll(".item-block-year").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-out").style("opacity",0).remove(),calendarHeatmap.labels.selectAll(".label-year").remove()},removeYearOverview:function(){calendarHeatmap.items.selectAll(".item-circle").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease").style("opacity",0).remove(),calendarHeatmap.labels.selectAll(".label-day").remove(),calendarHeatmap.labels.selectAll(".label-month").remove(),calendarHeatmap.hideBackButton()},removeMonthOverview:function(){calendarHeatmap.items.selectAll(".item-block-month").selectAll(".item-block-rect").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",0).attr("x",function(a,e){return e%2===0?-calendarHeatmap.settings.width/3:calendarHeatmap.settings.width/3}).remove(),calendarHeatmap.labels.selectAll(".label-day").remove(),calendarHeatmap.labels.selectAll(".label-week").remove(),calendarHeatmap.hideBackButton()},removeWeekOverview:function(){calendarHeatmap.items.selectAll(".item-block-week").selectAll(".item-block-rect").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",0).attr("x",function(a,e){return e%2===0?-calendarHeatmap.settings.width/3:calendarHeatmap.settings.width/3}).remove(),calendarHeatmap.labels.selectAll(".label-day").remove(),calendarHeatmap.labels.selectAll(".label-week").remove(),calendarHeatmap.hideBackButton()},removeDayOverview:function(){calendarHeatmap.items.selectAll(".item-block").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",0).attr("x",function(a,e){return e%2===0?-calendarHeatmap.settings.width/3:calendarHeatmap.settings.width/3}).remove(),calendarHeatmap.labels.selectAll(".label-time").remove(),calendarHeatmap.labels.selectAll(".label-project").remove(),calendarHeatmap.hideBackButton()},hideTooltip:function(){calendarHeatmap.tooltip.transition().duration(calendarHeatmap.settings.transition_duration/2).ease("ease-in").style("opacity",0)},hideBackButton:function(){calendarHeatmap.buttons.selectAll(".button").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease").style("opacity",0).remove()},formatTime:function(a){var e=parseInt(a,10),t=Math.floor(e/3600),n=Math.floor((e-3600*t)/60),r="";return t>0&&(r+=1===t?"1 hour ":t+" hours "),n>0&&(r+=1===n?"1 minute":n+" minutes"),0===t&&0===n&&(r=a+" seconds"),r}}; \ No newline at end of file +"use strict";var calendarHeatmap={settings:{gutter:5,item_gutter:1,width:1e3,height:200,item_size:10,label_padding:40,max_block_height:20,transition_duration:500,tooltip_width:250,tooltip_padding:15},init:function(a,e,t,n){calendarHeatmap.data=a,calendarHeatmap.color=e||"#ff4500",calendarHeatmap.overview=t||"global",calendarHeatmap.history=["global"],calendarHeatmap.selected={},calendarHeatmap.handler=n,calendarHeatmap.in_transition=!1,calendarHeatmap.createElements(),calendarHeatmap.parseData(),calendarHeatmap.drawChart()},createElements:function(){var a=document.createElement("div");a.className="calendar-heatmap",document.body.appendChild(a);var e=d3.select(a).append("svg").attr("class","svg");calendarHeatmap.items=e.append("g"),calendarHeatmap.labels=e.append("g"),calendarHeatmap.buttons=e.append("g"),calendarHeatmap.tooltip=d3.select(a).append("div").attr("class","heatmap-tooltip").style("opacity",0);var t=function(){var t=Math.round((moment()-moment().subtract(1,"year").startOf("week"))/864e5),n=Math.trunc(t/7),r=n+1;calendarHeatmap.settings.width=a.offsetWidth<1e3?1e3:a.offsetWidth,calendarHeatmap.settings.item_size=(calendarHeatmap.settings.width-calendarHeatmap.settings.label_padding)/r-calendarHeatmap.settings.gutter,calendarHeatmap.settings.height=calendarHeatmap.settings.label_padding+7*(calendarHeatmap.settings.item_size+calendarHeatmap.settings.gutter),e.attr({width:calendarHeatmap.settings.width,height:calendarHeatmap.settings.height}),calendarHeatmap.data&&calendarHeatmap.data[0].summary&&calendarHeatmap.drawChart()};t(),window.onresize=function(a){t()}},parseData:function(){calendarHeatmap.data&&(calendarHeatmap.data[0].summary||calendarHeatmap.data.map(function(a){var e=a.details.reduce(function(a,e){return a[e.name]?a[e.name].value+=e.value:a[e.name]={value:e.value},a},{}),t=Object.keys(e).map(function(a){return{name:a,value:e[a].value}});return a.summary=t.sort(function(a,e){return e.value-a.value}),a}))},drawChart:function(){"global"===calendarHeatmap.overview?calendarHeatmap.drawGlobalOverview():"year"===calendarHeatmap.overview?calendarHeatmap.drawYearOverview():"month"===calendarHeatmap.overview?calendarHeatmap.drawMonthOverview():"week"===calendarHeatmap.overview?calendarHeatmap.drawWeekOverview():"day"===calendarHeatmap.overview&&calendarHeatmap.drawDayOverview()},drawGlobalOverview:function(){calendarHeatmap.history[calendarHeatmap.history.length-1]!==calendarHeatmap.overview&&calendarHeatmap.history.push(calendarHeatmap.overview);var a=moment(calendarHeatmap.data[0].date).startOf("year"),e=moment(calendarHeatmap.data[calendarHeatmap.data.length-1].date).endOf("year"),t=d3.time.years(a,e).map(function(a){var e=moment(a);return{date:e,total:calendarHeatmap.data.reduce(function(a,t){return moment(t.date).year()===e.year()&&(a+=t.total),a},0),summary:function(){var a=calendarHeatmap.data.reduce(function(a,t){if(moment(t.date).year()===e.year())for(var n=0;n0&&(e+=""+(1===n?"1 day":n+" days")+"
");var r=Math.floor((t-86400*n)/3600);r>0&&(e+=n>0?"
"+(1===r?"1 hour":r+" hours")+"
":""+(1===r?"1 hour":r+" hours")+"");var l=Math.floor((t-86400*n-3600*r)/60);if(l>0&&(e+=n>0||r>0?"
"+(1===l?"1 minute":l+" minutes")+"
":""+(1===l?"1 minute":l+" minutes")+""),e+="
",a.summary.length<=5)for(var d=0;d"+a.summary[d].name+"",e+=""+calendarHeatmap.formatTime(a.summary[d].value)+"";else{for(var d=0;d<5;d++)e+="
"+a.summary[d].name+"",e+=""+calendarHeatmap.formatTime(a.summary[d].value)+"
";e+="
";for(var o=0,d=5;dOther:",e+=""+calendarHeatmap.formatTime(o)+""}for(var s=i(a.date.year())+2*calendarHeatmap.settings.tooltip_padding;calendarHeatmap.settings.width-s0?r(a.total):"transparent"}).on("click",function(a){calendarHeatmap.in_transition||0!==a.total&&(calendarHeatmap.in_transition=!0,calendarHeatmap.selected=a,calendarHeatmap.hideTooltip(),calendarHeatmap.removeYearOverview(),calendarHeatmap.overview="day",calendarHeatmap.drawChart())}).on("mouseover",function(a){if(!calendarHeatmap.in_transition){var e=d3.select(this);!function s(){e=e.transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").attr("x",function(a){return i(a)-(1.1*calendarHeatmap.settings.item_size-calendarHeatmap.settings.item_size)/2}).attr("y",function(a){return l(a)-(1.1*calendarHeatmap.settings.item_size-calendarHeatmap.settings.item_size)/2}).attr("width",1.1*calendarHeatmap.settings.item_size).attr("height",1.1*calendarHeatmap.settings.item_size).transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").attr("x",function(a){return i(a)+(calendarHeatmap.settings.item_size-d(a))/2}).attr("y",function(a){return l(a)+(calendarHeatmap.settings.item_size-d(a))/2}).attr("width",function(a){return d(a)}).attr("height",function(a){return d(a)}).each("end",s)}();var t="";t+='
'+(a.total?calendarHeatmap.formatTime(a.total):"No time")+" tracked
",t+="
on "+moment(a.date).format("dddd, MMM Do YYYY")+"

";for(var n=0;n"+a.summary[n].name+"",t+=""+calendarHeatmap.formatTime(a.summary[n].value)+"";var r=i(a)+calendarHeatmap.settings.item_size;calendarHeatmap.settings.width-r
",t+="
"+(a.value?calendarHeatmap.formatTime(a.value):"No time")+" tracked
",t+="
on "+moment(e).format("dddd, MMM Do YYYY")+"
";for(var n=d(moment(e).week())+calendarHeatmap.settings.tooltip_padding;calendarHeatmap.settings.width-n
",t+="
"+(a.value?calendarHeatmap.formatTime(a.value):"No time")+" tracked
",t+="
on "+moment(e).format("dddd, MMM Do YYYY")+"
";var n=parseInt(d3.select(this.parentNode).attr("total"));m.domain([0,n]);for(var r=parseInt(d3.select(this).attr("x"))+m(a.value)/4+calendarHeatmap.settings.tooltip_width/4;calendarHeatmap.settings.width-r

",n+="
"+(a.value?calendarHeatmap.formatTime(a.value):"No time")+" tracked
",n+="
on "+moment(a.date).format("dddd, MMM Do YYYY HH:mm")+"
";for(var r=100*a.value/86400+t(moment(a.date));calendarHeatmap.settings.width-r=n&&e<=r?1:.1})}}).on("mouseout",function(){calendarHeatmap.in_transition||calendarHeatmap.items.selectAll(".item-block").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",.5)}),calendarHeatmap.labels.selectAll(".label-project").remove(),calendarHeatmap.labels.selectAll(".label-project").data(a).enter().append("text").attr("class","label label-project").attr("x",calendarHeatmap.settings.gutter).attr("y",function(a){return e(a)+e.rangeBand()/2}).attr("min-height",function(){return e.rangeBand()}).style("text-anchor","left").attr("font-size",function(){return Math.floor(calendarHeatmap.settings.label_padding/3)+"px"}).text(function(a){return a}).each(function(){for(var a=d3.select(this),e=a.node().getComputedTextLength(),t=a.text();e>1.5*calendarHeatmap.settings.label_padding&&t.length>0;)t=t.slice(0,-1),a.text(t+"..."),e=a.node().getComputedTextLength()}).on("mouseenter",function(a){calendarHeatmap.in_transition||calendarHeatmap.items.selectAll(".item-block").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",function(e){return e.name===a?1:.1})}).on("mouseout",function(){calendarHeatmap.in_transition||calendarHeatmap.items.selectAll(".item-block").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",.5)}),calendarHeatmap.drawButton()},drawButton:function(){calendarHeatmap.buttons.selectAll(".button").remove();var a=calendarHeatmap.buttons.append("g").attr("class","button button-back").style("opacity",0).on("click",function(){ +calendarHeatmap.in_transition||(calendarHeatmap.in_transition=!0,"year"===calendarHeatmap.overview?calendarHeatmap.removeYearOverview():"month"===calendarHeatmap.overview?calendarHeatmap.removeMonthOverview():"week"===calendarHeatmap.overview?calendarHeatmap.removeWeekOverview():"day"===calendarHeatmap.overview&&calendarHeatmap.removeDayOverview(),calendarHeatmap.history.pop(),calendarHeatmap.overview=calendarHeatmap.history.pop(),calendarHeatmap.drawChart())});a.append("circle").attr("cx",calendarHeatmap.settings.label_padding/2.25).attr("cy",calendarHeatmap.settings.label_padding/2.5).attr("r",calendarHeatmap.settings.item_size/2),a.append("text").attr("x",calendarHeatmap.settings.label_padding/2.25).attr("y",calendarHeatmap.settings.label_padding/2.5).attr("dy",function(){return Math.floor(calendarHeatmap.settings.width/100)/3}).attr("font-size",function(){return Math.floor(calendarHeatmap.settings.label_padding/3)+"px"}).html("←"),a.transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",1)},removeGlobalOverview:function(){calendarHeatmap.items.selectAll(".item-block-year").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-out").style("opacity",0).remove(),calendarHeatmap.labels.selectAll(".label-year").remove()},removeYearOverview:function(){calendarHeatmap.items.selectAll(".item-circle").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease").style("opacity",0).remove(),calendarHeatmap.labels.selectAll(".label-day").remove(),calendarHeatmap.labels.selectAll(".label-month").remove(),calendarHeatmap.hideBackButton()},removeMonthOverview:function(){calendarHeatmap.items.selectAll(".item-block-month").selectAll(".item-block-rect").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",0).attr("x",function(a,e){return e%2===0?-calendarHeatmap.settings.width/3:calendarHeatmap.settings.width/3}).remove(),calendarHeatmap.labels.selectAll(".label-day").remove(),calendarHeatmap.labels.selectAll(".label-week").remove(),calendarHeatmap.hideBackButton()},removeWeekOverview:function(){calendarHeatmap.items.selectAll(".item-block-week").selectAll(".item-block-rect").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",0).attr("x",function(a,e){return e%2===0?-calendarHeatmap.settings.width/3:calendarHeatmap.settings.width/3}).remove(),calendarHeatmap.labels.selectAll(".label-day").remove(),calendarHeatmap.labels.selectAll(".label-week").remove(),calendarHeatmap.hideBackButton()},removeDayOverview:function(){calendarHeatmap.items.selectAll(".item-block").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease-in").style("opacity",0).attr("x",function(a,e){return e%2===0?-calendarHeatmap.settings.width/3:calendarHeatmap.settings.width/3}).remove(),calendarHeatmap.labels.selectAll(".label-time").remove(),calendarHeatmap.labels.selectAll(".label-project").remove(),calendarHeatmap.hideBackButton()},hideTooltip:function(){calendarHeatmap.tooltip.transition().duration(calendarHeatmap.settings.transition_duration/2).ease("ease-in").style("opacity",0)},hideBackButton:function(){calendarHeatmap.buttons.selectAll(".button").transition().duration(calendarHeatmap.settings.transition_duration).ease("ease").style("opacity",0).remove()},formatTime:function(a){var e=Math.floor(a/3600),t=Math.floor((a-3600*e)/60),n="";return e>0&&(n+=1===e?"1 hour ":e+" hours "),t>0&&(n+=1===t?"1 minute":t+" minutes"),0===e&&0===t&&(n=Math.round(a)+" seconds"),n}}; \ No newline at end of file