From e950bc8ee2893d4cbe2db8292aa7f0fe9092b874 Mon Sep 17 00:00:00 2001 From: polo2ro Date: Sun, 22 Mar 2015 15:06:39 +0100 Subject: [PATCH] Fix the missing compiled files --- dist/teleperiod.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/teleperiod.min.js b/dist/teleperiod.min.js index 6eb8e12..441e525 100644 --- a/dist/teleperiod.min.js +++ b/dist/teleperiod.min.js @@ -1 +1 @@ -function Selection(a){"use strict";this.teleperiod=a,this.dtstart=null,this.dtend=null;var b=this;this.overlayItems=[],this.isValid=function(){return null===b.dtend||null===b.dtstart?!1:b.dtstart.getTime()a.getTime()||b.isValid()?(b.dtstart=a,b.dtend=null,b.resetOverlay(),!1):b.dtstart.getTime()=b.dtstart&&a.dtend<=b.dtend)return a;if(a.dtstart>=b.dtend||a.dtend<=b.dtstart)return null;var c={};return c.dtstart=a.dtstart>=b.dtstart?a.dtstart:b.dtstart,c.dtend=a.dtend<=b.dtend?a.dtend:b.dtend,c},this.getValidPeriods=function(){var a=new Date(b.dtstart);a.setHours(0,0,0);for(var c,d=[];ae&&(c+=f-e)}return c}}function Teleperiod(a){"use strict";var b=this;this.viewport=a.object,this.settings=a,this.main=null,this.wtTooltip=null,this.workingtimesEvents={},this.events={},this.timelines=[],this.loadedIntervals=[],this.dayGroupByDate={},this.queued=[],this.selection=new Selection(this),this.lastMouseDown=null,this.viewportFrom=null,this.viewportTo=null,this.floatFrom=null,this.floatTo=null,this.getWidth=function(){return this.settings.width||b.viewport.node().parentNode.offsetWidth},this.getDateWidth=function(){return this.settings.dateWidth||30},this.getDateHeight=function(){return 250},this.getHeight=function(){return b.getHeaderHeight()+b.getGraphHeight()+b.getTimelinesHeight()},this.getTimelinesHeight=function(){return b.timelines.length*(b.getTimelineHeight()+b.getTimelineMarginTop())},this.getHeaderHeight=function(){return 50},this.getGraphHeight=function(){return 300},this.getTimelineHeight=function(){return 20},this.getTimelineMarginTop=function(){return this.settings.timelineMarginTop||10},this.getButtonWidth=function(){return this.settings.buttonWidth||30},this.getDayOff=function(){return this.settings.dayOff||[6,0]},this.getMoveDays=function(){return 7},this.getDayFirstMinute=function(){return this.settings.dayFirstMinute||420},this.getDayLastMinute=function(){return this.settings.dayLastMinute||1200},this.getSnapDistance=function(){return this.settings.snapDistance||10},this.getDateLocale=function(){return this.settings.dateLocale||"Fr-fr"},this.getFocusDate=function(){return this.settings.focusDate||new Date},this.initFloatDates=function(){var a=new Date(b.getFocusDate());a.setHours(0,0,0),b.floatFrom=new TimespanBoundary(a),b.floatTo=new TimespanBoundary(a),b.floatFrom.onUpdate(this.drawIntervalDates),b.floatTo.onUpdate(this.drawIntervalDates);var c=1+Math.round(b.getWidth()/b.getDateWidth());b.viewportFrom=0,b.viewportTo=c,b.main.attr("width",c*b.getDateWidth()),b.floatTo.add(c)},this.setSize=function(){b.viewport.attr("width",b.getWidth()).attr("height",b.getHeight())},this.createMain=function(){b.main=b.viewport.append("svg"),b.wtTooltip=b.viewport.append("svg").attr("width",b.getDateWidth()+100).attr("height",50).style("opacity",0),b.wtTooltip.append("polygon").attr("class","wtTooltip").attr("transform","translate("+b.getDateWidth()+",0)").attr("points","15,0 100,0 100,50 15,50 15,25 0,2 15,8"),b.wtTooltip.append("line").attr("x1",0).attr("y1",3).attr("x2",b.getDateWidth()-1).attr("y2",3).attr("stroke","red").attr("stroke-width","2").attr("pointer-events","none");var a=b.getDateWidth()+23;b.wtTooltip.append("text").attr("y",20).attr("x",a).attr("class","wtTooltipDate"),b.wtTooltip.append("text").attr("y",40).attr("x",a).attr("class","wtTooltipHour"),b.leftButton(),b.rightButton(),b.main.attr("class","main").attr("x",0).attr("width",0).attr("height",b.getHeaderHeight()+b.getGraphHeight()+b.getTimelinesHeight()),b.initFloatDates();for(var c=0;cd;){var e=new Date(d),f=b.drawDate(d);d.setDate(d.getDate()+1),e.setHours(0,0,0),b.dayGroupByDate[e]=f}b.load(a,c)},this.getDateX=function(a){var c=a.getTime()/1e3,d=b.floatFrom.currentDate.getTime()/1e3,e=Math.ceil(c/86400),f=Math.ceil(d/86400),g=e-f;return g*b.getDateWidth()},this.getDateY=function(a){var c=60*a.getHours()+a.getMinutes();if(cb.getDayLastMinute())return b.getDayLastMinute();var d=c-b.getDayFirstMinute(),e=b.getDayLastMinute()-b.getDayFirstMinute();return Math.round(d*b.getDateHeight()/e)},this.getDateFromX=function(a){var c=Math.ceil(a/b.getDateWidth()),d=new Date(b.floatFrom.currentDate);return d.setDate(d.getDate()+c),d.setHours(0,0,0),d},this.getMinutesFromY=function(a){var c=b.getDayLastMinute()-b.getDayFirstMinute(),d=b.getDateHeight()/c,e=b.getDayFirstMinute()+Math.round(a/d);return e},this.drawDate=function(a){var c=b.getDateX(a),d=b.main.append("g").attr("class","day").attr("transform","translate("+c+","+b.getHeaderHeight()+")");d.append("rect").attr("width",b.getDateWidth()-1).attr("height",b.getDateHeight()),-1!==b.getDayOff().indexOf(a.getDay())&&d.attr("class","day dayoff"),d.append("text").attr("class","weekday").attr("x",5).attr("y",-10).attr("transform","rotate(90)").text(a.toLocaleDateString(b.getDateLocale(),{weekday:"long"})),d.append("text").attr("class","date").attr("x",b.getDateWidth()/2).attr("y",-10).text(a.getDate()),1===a.getDate()&&d.append("text").attr("class","month").attr("x",5).attr("y",-35).text(a.toLocaleDateString(b.getDateLocale(),{month:"long",year:"numeric"}));for(var e=0;ei?a.dtstart:i),g=b.getDateY(a.dtendd-i&&(d=i),k>j-d&&(d=j);var l=b.getMinutesFromY(d),m=Math.floor(l/60),n=l%60;return n=10*Math.round(n/10),g.setHours(m,n,0),g},this.updateWtTooltip=function(){var a=b.getPointerDate(this),c=d3.mouse(this),d=c[0],e=c[1],f=d3.select(this.parentNode);d=parseInt(f.attr("transform").match(/translate\((\d+),\d+\)/)[1],10),d+=parseInt(b.main.attr("x"),10),e=b.getDateY(a),b.wtTooltip.attr("x",d),b.wtTooltip.attr("y",b.getHeaderHeight()+e-4),b.wtTooltip.select("text.wtTooltipDate").text(a.toLocaleDateString(b.getDateLocale())),b.wtTooltip.select("text.wtTooltipHour").text(a.toLocaleTimeString(b.getDateLocale(),{hour:"2-digit",minute:"2-digit"}))},this.slideMain=function(a){return b.main.transition().attr("x",function(){return parseInt(this.getAttribute("x"),10)+a*b.getDateWidth()})},this.queue=function(a){b.queued.push(a),1=b.queued.length)return!1;b.processQueued()}})},this.createSpaceOnLeft=function(a){var c=parseInt(b.main.attr("width"),10);return b.main.attr("width",c+a*b.getDateWidth()),b.main.attr("x",function(){return parseInt(this.getAttribute("x"),10)-a*b.getDateWidth()}),b.main.selectAll(".day").attr("transform",function(){var c=this.getAttribute("transform").match(/\((\d+),(\d+)\)/);if(!c)return null;var d=parseInt(c[1],10)+a*b.getDateWidth();return"translate("+d+","+c[2]+")"})},this.backwardGrow=function(){if(b.viewportFrom-=b.getMoveDays(),b.viewportTo-=b.getMoveDays(),b.viewportFromb.floatTo.dayPosition){var a=b.viewportTo-b.floatTo.dayPosition,c=Math.abs(parseInt(b.main.attr("x"),10))+b.getWidth(),d=Math.abs(a*b.getDateWidth());return b.main.attr("width",c+d),b.floatTo.add(a),!0}return!1},this.backward=function(){return b.backwardGrow(),b.slideMain(b.getMoveDays())},this.forward=function(){return b.forwardGrow(),b.slideMain(-1*b.getMoveDays())},this.setSelection=function(a,c){b.selection.resetOverlay(),b.selection.setDate(a),b.selection.setDate(c),b.selection.isValid()&&b.selection.highlightPeriods()}}function Timeline(a,b){"use strict";this.name=a,this.datasource=b,this.loadedEvents=[],this.dayIndex={},this.teleperiod=null,this.color={};var c=this;this.load=function(a,b){function d(b){var c;return b.dtstart0?e+=", "+b.summary:e=b.summary,d.text(e),a.attr("style","fill:"+c.getColor(f.length)+";")},this.setColor=function(a,b){c.color[a]=b},this.getBackgroundColor=function(){return c.color[0]?c.color[0]:"rgba(32, 47, 72, 0.78)"},this.getColor=function(a){if(c.color[a])return c.color[a];var b=[];for(var d in c.color)if(c.color.hasOwnProperty(d)){if(d>a)continue;b.push(d)}return 0===b.length?"rgba(10, 180, 10, 1)":(b.sort(),b.pop())}}function TimespanBoundary(a){"use strict";this.initDate=a,this.currentDate=a,this.dayPosition=0,this.onUpdateCallback=null;var b=this;this.add=function(a){b.dayPosition+=a;var c=new Date(b.currentDate),d=new Date(b.currentDate);if(d.setDate(b.currentDate.getDate()+a),b.currentDate=d,null!==b.onUpdateCallback){var e=new Date(d);e.getTime()>c.getTime()?b.onUpdateCallback(c,e):b.onUpdateCallback(e,c)}},this.onUpdate=function(a){b.onUpdateCallback=a}}function MouseDrag(a){"use strict";var b=d3.mouse(a.viewport.node())[0],c=parseInt(a.main.attr("x"),10),d=parseInt(a.main.attr("width"),10),e=parseInt(a.viewport.attr("width"),10),f=a.viewport.attr("x");f=null===f?0:parseInt(f,10);var g,h,i,j=a.getMoveDays()*a.getDateWidth(),k=this;this.getLeftDistance=function(){return f-h},this.getRightDistance=function(){var b=f+e,c=parseInt(a.main.attr("width"),10);return h+c-b},this.dragmove=function(){g=d3.mouse(a.viewport.node())[0],i=g-b,h=c+i,k.getLeftDistance()<0&&a.backwardGrow()&&(c-=j),k.getRightDistance()<0&&a.forwardGrow()&&(d+=j),a.main.attr("x",c+i)}} +function Selection(a){"use strict";this.teleperiod=a,this.dtstart=null,this.dtend=null;var b=this;this.overlayItems=[],this.isValid=function(){return null===b.dtend||null===b.dtstart?!1:b.dtstart.getTime()a.getTime()||b.isValid()?(b.dtstart=a,b.dtend=null,b.resetOverlay(),!1):b.dtstart.getTime()=b.dtstart&&a.dtend<=b.dtend)return a;if(a.dtstart>=b.dtend||a.dtend<=b.dtstart)return null;var c={};return c.dtstart=a.dtstart>=b.dtstart?a.dtstart:b.dtstart,c.dtend=a.dtend<=b.dtend?a.dtend:b.dtend,c},this.getValidPeriods=function(){var a=new Date(b.dtstart);a.setHours(0,0,0);for(var c,d=[];ae&&(c+=f-e)}return c}}function Teleperiod(a){"use strict";var b=this;this.viewport=a.object,this.settings=a,this.main=null,this.wtTooltip=null,this.workingtimesEvents={},this.events={},this.timelines=[],this.loadedIntervals=[],this.dayGroupByDate={},this.queued=[],this.selection=new Selection(this),this.lastMouseDown=null,this.viewportFrom=null,this.viewportTo=null,this.floatFrom=null,this.floatTo=null,this.getWidth=function(){return this.settings.width||b.viewport.node().parentNode.offsetWidth},this.getDateWidth=function(){return this.settings.dateWidth||30},this.getDateHeight=function(){return 250},this.getHeight=function(){return b.getHeaderHeight()+b.getGraphHeight()+b.getTimelinesHeight()},this.getTimelinesHeight=function(){return b.timelines.length*(b.getTimelineHeight()+b.getTimelineMarginTop())},this.getHeaderHeight=function(){return 50},this.getGraphHeight=function(){return 300},this.getTimelineHeight=function(){return 20},this.getTimelineMarginTop=function(){return this.settings.timelineMarginTop||10},this.getButtonWidth=function(){return this.settings.buttonWidth||30},this.getDayOff=function(){return this.settings.dayOff||[6,0]},this.getMoveDays=function(){return 7},this.getDayFirstMinute=function(){return this.settings.dayFirstMinute||420},this.getDayLastMinute=function(){return this.settings.dayLastMinute||1200},this.getSnapDistance=function(){return this.settings.snapDistance||10},this.getDateLocale=function(){return this.settings.dateLocale||"Fr-fr"},this.getFocusDate=function(){return this.settings.focusDate||new Date},this.initFloatDates=function(){var a=new Date(b.getFocusDate());a.setHours(0,0,0),b.floatFrom=new TimespanBoundary(a),b.floatTo=new TimespanBoundary(a),b.floatFrom.onUpdate(this.drawIntervalDates),b.floatTo.onUpdate(this.drawIntervalDates);var c=1+Math.round(b.getWidth()/b.getDateWidth());b.viewportFrom=0,b.viewportTo=c,b.main.attr("width",c*b.getDateWidth()),b.floatTo.add(c)},this.setSize=function(){b.viewport.attr("width",b.getWidth()).attr("height",b.getHeight())},this.createMain=function(){b.main=b.viewport.append("svg"),b.wtTooltip=b.viewport.append("svg").attr("width",b.getDateWidth()+100).attr("height",50).style("opacity",0),b.wtTooltip.append("polygon").attr("class","wtTooltip").attr("transform","translate("+b.getDateWidth()+",0)").attr("points","15,0 100,0 100,50 15,50 15,25 0,2 15,8"),b.wtTooltip.append("line").attr("x1",0).attr("y1",3).attr("x2",b.getDateWidth()-1).attr("y2",3).attr("stroke","red").attr("stroke-width","2").attr("pointer-events","none");var a=b.getDateWidth()+23;b.wtTooltip.append("text").attr("y",20).attr("x",a).attr("class","wtTooltipDate"),b.wtTooltip.append("text").attr("y",40).attr("x",a).attr("class","wtTooltipHour"),b.leftButton(),b.rightButton(),b.main.attr("class","main").attr("x",0).attr("width",0).attr("height",b.getHeaderHeight()+b.getGraphHeight()+b.getTimelinesHeight()),b.initFloatDates();for(var c=0;cd;){var e=new Date(d),f=b.drawDate(d);d.setDate(d.getDate()+1),e.setHours(0,0,0),b.dayGroupByDate[e]=f}b.load(a,c)},this.getDateX=function(a){var c=a.getTime()/1e3,d=b.floatFrom.currentDate.getTime()/1e3,e=Math.ceil(c/86400),f=Math.ceil(d/86400),g=e-f;return g*b.getDateWidth()},this.getDateY=function(a){var c=60*a.getHours()+a.getMinutes();if(cb.getDayLastMinute())return b.getDayLastMinute();var d=c-b.getDayFirstMinute(),e=b.getDayLastMinute()-b.getDayFirstMinute();return Math.round(d*b.getDateHeight()/e)},this.getDateFromX=function(a){var c=Math.ceil(a/b.getDateWidth()),d=new Date(b.floatFrom.currentDate);return d.setDate(d.getDate()+c),d.setHours(0,0,0),d},this.getMinutesFromY=function(a){var c=b.getDayLastMinute()-b.getDayFirstMinute(),d=b.getDateHeight()/c,e=b.getDayFirstMinute()+Math.round(a/d);return e},this.drawDate=function(a){var c=b.getDateX(a),d=b.main.append("g").attr("class","day").attr("transform","translate("+c+","+b.getHeaderHeight()+")");d.append("rect").attr("width",b.getDateWidth()-1).attr("height",b.getDateHeight()),-1!==b.getDayOff().indexOf(a.getDay())&&d.attr("class","day dayoff"),d.append("text").attr("class","weekday").attr("x",5).attr("y",-10).attr("transform","rotate(90)").text(a.toLocaleDateString(b.getDateLocale(),{weekday:"long"})),d.append("text").attr("class","date").attr("x",b.getDateWidth()/2).attr("y",-10).text(a.getDate()),1===a.getDate()&&d.append("text").attr("class","month").attr("x",5).attr("y",-35).text(a.toLocaleDateString(b.getDateLocale(),{month:"long",year:"numeric"}));for(var e=0;ei?a.dtstart:i),g=b.getDateY(a.dtendd-i&&(d=i),k>j-d&&(d=j);var l=b.getMinutesFromY(d),m=Math.floor(l/60),n=l%60;return n=10*Math.round(n/10),g.setHours(m,n,0),g},this.updateWtTooltip=function(){var a=b.getPointerDate(this),c=d3.mouse(this),d=c[0],e=c[1],f=d3.select(this.parentNode);d=parseInt(f.attr("transform").match(/translate\((\d+),\d+\)/)[1],10),d+=parseInt(b.main.attr("x"),10),e=b.getDateY(a),b.wtTooltip.attr("x",d),b.wtTooltip.attr("y",b.getHeaderHeight()+e-4),b.wtTooltip.select("text.wtTooltipDate").text(a.toLocaleDateString(b.getDateLocale())),b.wtTooltip.select("text.wtTooltipHour").text(a.toLocaleTimeString(b.getDateLocale(),{hour:"2-digit",minute:"2-digit"}))},this.slideMain=function(a){return b.main.transition().attr("x",function(){return parseInt(this.getAttribute("x"),10)+a*b.getDateWidth()})},this.queue=function(a){b.queued.push(a),1=b.queued.length)return!1;b.processQueued()}})},this.createSpaceOnLeft=function(a){var c=parseInt(b.main.attr("width"),10);return b.main.attr("width",c+a*b.getDateWidth()),b.main.attr("x",function(){return parseInt(this.getAttribute("x"),10)-a*b.getDateWidth()}),b.main.selectAll(".day").attr("transform",function(){var c=this.getAttribute("transform").match(/\((\d+),(\d+)\)/);if(!c)return null;var d=parseInt(c[1],10)+a*b.getDateWidth();return"translate("+d+","+c[2]+")"})},this.backwardGrow=function(){if(b.viewportFrom-=b.getMoveDays(),b.viewportTo-=b.getMoveDays(),b.viewportFromb.floatTo.dayPosition){var a=b.viewportTo-b.floatTo.dayPosition,c=Math.abs(parseInt(b.main.attr("x"),10))+b.getWidth(),d=Math.abs(a*b.getDateWidth());return b.main.attr("width",c+d),b.floatTo.add(a),!0}return!1},this.backward=function(){return b.backwardGrow(),b.slideMain(b.getMoveDays())},this.forward=function(){return b.forwardGrow(),b.slideMain(-1*b.getMoveDays())},this.setSelection=function(a,c){b.selection.resetOverlay(),b.selection.setDate(a),b.selection.setDate(c),b.selection.isValid()&&b.selection.highlightPeriods()}}function Timeline(a,b){"use strict";this.name=a,this.datasource=b,this.loadedEvents=[],this.dayIndex={},this.teleperiod=null,this.color={};var c=this;this.load=function(a,b){function d(b){var c;return b.dtstart0?e+=", "+b.summary:e=b.summary,d.text(e),a.attr("style","fill:"+c.getColor(f.length)+";")},this.setColor=function(a,b){c.color[a]=b},this.getBackgroundColor=function(){return c.color[0]?c.color[0]:"rgba(32, 47, 72, 0.78)"},this.getColor=function(a){if(c.color[a])return c.color[a];var b=[];for(var d in c.color)if(c.color.hasOwnProperty(d)){if(d>a)continue;b.push(d)}return 0===b.length?"rgba(10, 180, 10, 1)":(b.sort(),b.pop())}}function TimespanBoundary(a){"use strict";this.initDate=a,this.currentDate=a,this.dayPosition=0,this.onUpdateCallback=null;var b=this;this.add=function(a){b.dayPosition+=a;var c=new Date(b.currentDate),d=new Date(b.currentDate);if(d.setDate(b.currentDate.getDate()+a),b.currentDate=d,null!==b.onUpdateCallback){var e=new Date(d);e.getTime()>c.getTime()?b.onUpdateCallback(c,e):b.onUpdateCallback(e,c)}},this.onUpdate=function(a){b.onUpdateCallback=a}}function MouseDrag(a){"use strict";var b=d3.mouse(a.viewport.node())[0],c=parseInt(a.main.attr("x"),10),d=parseInt(a.main.attr("width"),10),e=parseInt(a.viewport.attr("width"),10),f=a.viewport.attr("x");f=null===f?0:parseInt(f,10);var g,h,i,j=a.getMoveDays()*a.getDateWidth(),k=this;this.getLeftDistance=function(){return f-h},this.getRightDistance=function(){var b=f+e,c=parseInt(a.main.attr("width"),10);return h+c-b},this.dragmove=function(){g=d3.mouse(a.viewport.node())[0],i=g-b,h=c+i,k.getLeftDistance()<0&&a.backwardGrow()&&(c-=j),k.getRightDistance()<0&&a.forwardGrow()&&(d+=j),a.main.attr("x",c+i)}}