From 9ef3f56204ff4a7a3f819ed4775c353e93bee95c Mon Sep 17 00:00:00 2001 From: chris Date: Wed, 2 Feb 2022 14:16:20 +0100 Subject: [PATCH] [BUGFIX] fixes wrong timeline data ref #43 ref #37 --- dist/js/jq.schedule.js | 2 +- dist/js/jq.schedule.min.js | 2 +- dist/js/jq.schedule.min.js.map | 2 +- src/js/jq.schedule.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/js/jq.schedule.js b/dist/js/jq.schedule.js index ba7347d..c527851 100644 --- a/dist/js/jq.schedule.js +++ b/dist/js/jq.schedule.js @@ -665,7 +665,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi data.text = bdata.text; } - data.timeline = i; + data.timeline = timeline; data.data = {}; if (bdata.data) { diff --git a/dist/js/jq.schedule.min.js b/dist/js/jq.schedule.min.js index 2f69ea2..1573e0e 100644 --- a/dist/js/jq.schedule.min.js +++ b/dist/js/jq.schedule.min.js @@ -1,2 +1,2 @@ -"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(T){var i="jqSchedule",v={calcStringTime:function(e){var t=e.split(":");return 60*Number(t[0])*60+60*Number(t[1])},formatTime:function(e){var t=e%3600;return""+Math.floor(e/36e3)+Math.floor(e/3600%10)+":"+(""+Math.floor(t/600)+Math.floor(t/60%10))},_saveSettingData:function(e){return this.data(i+"Setting",e)},_loadSettingData:function(){return this.data(i+"Setting")},_saveData:function(e){var t=T.extend({tableStartTime:0,tableEndTime:0,schedule:[],timeline:[]},e);return this.data(i,t)},_loadData:function(){return this.data(i)},scheduleData:function(){var e=T(this),t=v._loadData.apply(e);return t?t.schedule:[]},timelineData:function(){var e,t=T(this),i=v._loadData.apply(t),a=[];for(e in i.timeline)a[e]=i.timeline[e],a[e].schedule=[];for(e in i.schedule){var n=i.schedule[e];void 0!==n.timeline&&void 0!==a[n.timeline]&&a[n.timeline].schedule.push(n)}return a},resetData:function(){return this.each(function(){var e=T(this),t=v._loadData.apply(e);for(var i in t.schedule=[],v._saveData.apply(e,[t]),e.find(".sc_bar").remove(),t.timeline)t.timeline[i].schedule=[],v._resizeRow.apply(e,[i,0]);v._saveData.apply(e,[t])})},addSchedule:function(i,a){return this.each(function(){var e=T(this),t={start:a.start,end:a.end,startTime:v.calcStringTime(a.start),endTime:v.calcStringTime(a.end),text:a.text,timeline:i};a.data&&(t.data=a.data),v._addScheduleData.apply(e,[i,t]),v._resetBarPosition.apply(e,[i])})},addRow:function(t,i){return this.each(function(){var e=T(this);v._addRow.apply(e,[t,i])})},resetRowData:function(){return this.each(function(){var e=T(this),t=v._loadData.apply(e);t.schedule=[],t.timeline=[],v._saveData.apply(e,[t]),e.find(".sc_bar").remove(),e.find(".timeline").remove(),e.find(".sc_data").height(0)})},setRows:function(i){return this.each(function(){var e=T(this);for(var t in v.resetRowData.apply(e,[]),i)v.addRow.apply(e,[t,i[t]])})},setDraggable:function(i){return this.each(function(){var e=T(this),t=v._loadSettingData.apply(e);i!==t.draggable&&(t.draggable=i,v._saveSettingData.apply(e,t),i?e.find(".sc_bar").draggable("enable"):e.find(".sc_bar").draggable("disable"))})},setResizable:function(i){return this.each(function(){var e=T(this),t=v._loadSettingData.apply(e);i!==t.resizable&&(t.resizable=i,v._saveSettingData.apply(e,t),i?e.find(".sc_bar").resizable("enable"):e.find(".sc_bar").resizable("disable"))})},_getTimeLineNumber:function(e,t){var i=T(this),a=v._loadSettingData.apply(i),n=0,l=0,s=Math.ceil(t/(a.timeLineY+a.timeLinePaddingTop+a.timeLinePaddingBottom));for(var d in a.rows){var r=a.rows[d],o=0;if("object"===_typeof(r.schedule)&&(o=r.schedule.length),e&&e.timeline&&o++,s<=(l+=Math.max(o,1)))break;n++}return n},_addScheduleBgData:function(s){return this.each(function(){var e=T(this),t=v._loadSettingData.apply(e),i=v._loadData.apply(e),a=Math.ceil((s.startTime-i.tableStartTime)/t.widthTime),n=Math.floor((s.endTime-i.tableStartTime)/t.widthTime),l=T('
');l.css({left:a*t.widthTimeX,top:0,width:(n-a)*t.widthTimeX,height:e.find(".sc_main .timeline").eq(s.timeline).height()}),s.text&&l.find(".text").text(s.text),s.class&&l.addClass(s.class),e.find(".sc_main .timeline").eq(s.timeline).append(l)})},_addScheduleData:function(p,e){var u=e;return u.startTime=u.startTime?u.startTime:v.calcStringTime(u.start),u.endTime=u.endTime?u.endTime:v.calcStringTime(u.end),this.each(function(){var d=T(this),r=v._loadSettingData.apply(d),o=v._loadData.apply(d),e=Math.ceil((u.startTime-o.tableStartTime)/r.widthTime),t=Math.floor((u.endTime-o.tableStartTime)/r.widthTime),i=T('
'),a=v.formatTime(u.startTime),n=v.formatTime(u.endTime),l=v._getScheduleCount.apply(d,[u.timeline]);i.css({left:e*r.widthTimeX,top:l*r.timeLineY+r.timeLinePaddingTop,width:(t-e)*r.widthTimeX,height:r.timeLineY}),i.find(".time").text(a+"-"+n),u.text&&i.find(".text").text(u.text),u.class&&i.addClass(u.class),d.find(".sc_main .timeline").eq(p).append(i),o.schedule.push(u),v._saveData.apply(d,[o]),r.onAppendSchedule&&r.onAppendSchedule.apply(d,[i,u]);var s=o.schedule.length-1;i.data("sc_key",s),i.on("mouseup",function(){if(r.onClick&&!0!==T(this).data("dragCheck")&&!0!==T(this).data("resizeCheck")){var e=T(this),t=e.data("sc_key");r.onClick.apply(d,[e,o.schedule[t]])}});var c=d.find(".sc_bar"),h=null;c.draggable({grid:[r.widthTimeX,1],containment:d.find(".sc_main"),helper:"original",start:function(e,t){var i={};i.node=this,i.offsetTop=t.position.top,i.offsetLeft=t.position.left,i.currentTop=t.position.top,i.currentLeft=t.position.left,i.timeline=v._getTimeLineNumber.apply(d,[h,t.position.top]),i.nowTimeline=i.timeline,h=i},drag:function(e,t){if(T(this).data("dragCheck",!0),!h)return!1;var i=T(this),a=i.data("sc_key"),n=v._getTimeLineNumber.apply(d,[h,t.position.top]);return t.position.left=Math.floor(t.position.left/r.widthTimeX)*r.widthTimeX,h.nowTimeline!==n&&(h.nowTimeline=n),h.currentTop=t.position.top,h.currentLeft=t.position.left,v._rewriteBarText.apply(d,[i,o.schedule[a]]),!0},stop:function(){T(this).data("dragCheck",!1),h=null;var e=T(this),t=e.data("sc_key"),i=e.position().left,a=o.tableStartTime+Math.floor(i/r.widthTimeX)*r.widthTime,n=a+(o.schedule[t].endTime-o.schedule[t].startTime);o.schedule[t].start=v.formatTime(a),o.schedule[t].end=v.formatTime(n),o.schedule[t].startTime=a,o.schedule[t].endTime=n,r.onChange&&r.onChange.apply(d,[e,o.schedule[t]])}});var m=["e"];return r.resizableLeft&&m.push("w"),c.resizable({handles:m.join(","),grid:[r.widthTimeX,r.timeLineY-r.timeBorder],minWidth:r.widthTimeX,containment:d.find(".sc_main_scroll"),start:function(){T(this).data("resizeCheck",!0)},resize:function(e,t){t.element.height(t.size.height),t.element.width(t.size.width)},stop:function(){var e=T(this),t=e.data("sc_key"),i=e.position().left,a=e.outerWidth(),n=o.tableStartTime+Math.floor(i/r.widthTimeX)*r.widthTime,l=o.tableStartTime+Math.floor((i+a)/r.widthTimeX)*r.widthTime,s=o.schedule[t].timeline;o.schedule[t].start=v.formatTime(n),o.schedule[t].end=v.formatTime(l),o.schedule[t].startTime=n,o.schedule[t].endTime=l,v._resetBarPosition.apply(d,[s]),v._rewriteBarText.apply(d,[e,o.schedule[t]]),e.data("resizeCheck",!1),r.onChange&&r.onChange.apply(d,[e,o.schedule[t]])}}),!1===r.draggable&&c.draggable("disable"),!1===r.resizable&&c.resizable("disable"),s})},_getScheduleCount:function(e){var t=T(this),i=v._loadData.apply(t),a=0;for(var n in i.schedule)i.schedule[n].timeline===e&&a++;return a},_addRow:function(u,f){return this.each(function(){var e,s=T(this),i=v._loadSettingData.apply(s),d=v._loadData.apply(s),t=s.find(".sc_main .timeline").length;e="";var a=T(e+='
');f.title&&a.append(''+f.title+""),f.subtitle&&a.append(''+f.subtitle+""),i.onInitRow&&i.onInitRow.apply(s,[a,f]),s.find(".sc_data_scroll").append(a),e="";for(var n=T(e+='
'),l=d.tableStartTime;l');r.outerWidth(i.widthTimeX),r.data("time",v.formatTime(l)),r.data("timeline",u),n.append(r)}if(n.find(".tl").on("click",function(){i.onScheduleClick&&i.onScheduleClick.apply(s,[this,T(this).data("time"),T(this).data("timeline"),d.timeline[T(this).data("timeline")]])}),n.find(".tl").on("contextmenu",function(){return i.onScheduleClick&&i.onScheduleClick.apply(s,[this,T(this).data("time"),T(this).data("timeline"),d.timeline[T(this).data("timeline")]]),!1}),s.find(".sc_main").append(n),d.timeline[u]=f,v._saveData.apply(s,[d]),f.class&&""!==f.class&&(s.find(".sc_data .timeline").eq(t).addClass(f.class),s.find(".sc_main .timeline").eq(t).addClass(f.class)),f.schedule)for(var o in f.schedule){var c=f.schedule[o],h=c.start?c.start:v.calcStringTime(c.startTime),m=c.end?c.end:v.calcStringTime(c.endTime),p={};p.start=h,p.end=m,c.text&&(p.text=c.text),p.timeline=o,p.data={},c.data&&(p.data=c.data),v._addScheduleData.apply(s,[t,p])}v._resetBarPosition.apply(s,[t]),s.find(".sc_main .timeline").eq(t).droppable({accept:".sc_bar",drop:function(e,t){var i=t.draggable,a=i.data("sc_key"),n=d.schedule[a].timeline,l=s.find(".sc_main .timeline").index(this);d.schedule[a].timeline=l,i.appendTo(this),v._resetBarPosition.apply(s,[n]),v._resetBarPosition.apply(s,[l])}}),i.onAppendRow&&s.find(".sc_main .timeline").eq(t).find(".sc_bar").each(function(){var e=T(this),t=e.data("sc_key");i.onAppendRow.apply(s,[e,d.schedule[t]])})})},_rewriteBarText:function(d,r){return this.each(function(){var e=T(this),t=v._loadSettingData.apply(e),i=v._loadData.apply(e),a=d.position().left,n=i.tableStartTime+Math.floor(a/t.widthTimeX)*t.widthTime,l=n+(r.endTime-r.startTime),s=v.formatTime(n)+"-"+v.formatTime(l);T(d).find(".time").html(s)})},_resetBarPosition:function(_){return this.each(function(){var e,t,i,a,n,l,s,d,r=T(this),o=v._loadSettingData.apply(r),c=r.find(".sc_main .timeline").eq(_).find(".sc_bar"),h=[],m=[],p=0;for(d=0;dt.x?1:0}),d=0;d'+v.formatTime(s)+"";var d=T(n),r=Number(Math.min(3600*Math.ceil((s+t.widthTime)/3600),a)-s),o=Math.floor(r/t.widthTime);d.width(o*t.widthTimeX),e.find(".sc_header_scroll").append(d),l=s}for(var c in T(window).on("resize",function(){v._resizeWindow.apply(e)}).trigger("resize"),t.rows)v._addRow.apply(e,[c,t.rows[c]])})}};T.fn.timeSchedule=function(e){return v[e]?v[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!==_typeof(e)&&e?(T.error("Method "+e+" does not exist on jQuery.timeSchedule"),this):v.init.apply(this,arguments)}}(jQuery); +"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(T){var i="jqSchedule",v={calcStringTime:function(e){var t=e.split(":");return 60*Number(t[0])*60+60*Number(t[1])},formatTime:function(e){var t=e%3600;return""+Math.floor(e/36e3)+Math.floor(e/3600%10)+":"+(""+Math.floor(t/600)+Math.floor(t/60%10))},_saveSettingData:function(e){return this.data(i+"Setting",e)},_loadSettingData:function(){return this.data(i+"Setting")},_saveData:function(e){var t=T.extend({tableStartTime:0,tableEndTime:0,schedule:[],timeline:[]},e);return this.data(i,t)},_loadData:function(){return this.data(i)},scheduleData:function(){var e=T(this),t=v._loadData.apply(e);return t?t.schedule:[]},timelineData:function(){var e,t=T(this),i=v._loadData.apply(t),a=[];for(e in i.timeline)a[e]=i.timeline[e],a[e].schedule=[];for(e in i.schedule){var n=i.schedule[e];void 0!==n.timeline&&void 0!==a[n.timeline]&&a[n.timeline].schedule.push(n)}return a},resetData:function(){return this.each(function(){var e=T(this),t=v._loadData.apply(e);for(var i in t.schedule=[],v._saveData.apply(e,[t]),e.find(".sc_bar").remove(),t.timeline)t.timeline[i].schedule=[],v._resizeRow.apply(e,[i,0]);v._saveData.apply(e,[t])})},addSchedule:function(i,a){return this.each(function(){var e=T(this),t={start:a.start,end:a.end,startTime:v.calcStringTime(a.start),endTime:v.calcStringTime(a.end),text:a.text,timeline:i};a.data&&(t.data=a.data),v._addScheduleData.apply(e,[i,t]),v._resetBarPosition.apply(e,[i])})},addRow:function(t,i){return this.each(function(){var e=T(this);v._addRow.apply(e,[t,i])})},resetRowData:function(){return this.each(function(){var e=T(this),t=v._loadData.apply(e);t.schedule=[],t.timeline=[],v._saveData.apply(e,[t]),e.find(".sc_bar").remove(),e.find(".timeline").remove(),e.find(".sc_data").height(0)})},setRows:function(i){return this.each(function(){var e=T(this);for(var t in v.resetRowData.apply(e,[]),i)v.addRow.apply(e,[t,i[t]])})},setDraggable:function(i){return this.each(function(){var e=T(this),t=v._loadSettingData.apply(e);i!==t.draggable&&(t.draggable=i,v._saveSettingData.apply(e,t),i?e.find(".sc_bar").draggable("enable"):e.find(".sc_bar").draggable("disable"))})},setResizable:function(i){return this.each(function(){var e=T(this),t=v._loadSettingData.apply(e);i!==t.resizable&&(t.resizable=i,v._saveSettingData.apply(e,t),i?e.find(".sc_bar").resizable("enable"):e.find(".sc_bar").resizable("disable"))})},_getTimeLineNumber:function(e,t){var i=T(this),a=v._loadSettingData.apply(i),n=0,l=0,s=Math.ceil(t/(a.timeLineY+a.timeLinePaddingTop+a.timeLinePaddingBottom));for(var d in a.rows){var r=a.rows[d],o=0;if("object"===_typeof(r.schedule)&&(o=r.schedule.length),e&&e.timeline&&o++,s<=(l+=Math.max(o,1)))break;n++}return n},_addScheduleBgData:function(s){return this.each(function(){var e=T(this),t=v._loadSettingData.apply(e),i=v._loadData.apply(e),a=Math.ceil((s.startTime-i.tableStartTime)/t.widthTime),n=Math.floor((s.endTime-i.tableStartTime)/t.widthTime),l=T('
');l.css({left:a*t.widthTimeX,top:0,width:(n-a)*t.widthTimeX,height:e.find(".sc_main .timeline").eq(s.timeline).height()}),s.text&&l.find(".text").text(s.text),s.class&&l.addClass(s.class),e.find(".sc_main .timeline").eq(s.timeline).append(l)})},_addScheduleData:function(p,e){var u=e;return u.startTime=u.startTime?u.startTime:v.calcStringTime(u.start),u.endTime=u.endTime?u.endTime:v.calcStringTime(u.end),this.each(function(){var d=T(this),r=v._loadSettingData.apply(d),o=v._loadData.apply(d),e=Math.ceil((u.startTime-o.tableStartTime)/r.widthTime),t=Math.floor((u.endTime-o.tableStartTime)/r.widthTime),i=T('
'),a=v.formatTime(u.startTime),n=v.formatTime(u.endTime),l=v._getScheduleCount.apply(d,[u.timeline]);i.css({left:e*r.widthTimeX,top:l*r.timeLineY+r.timeLinePaddingTop,width:(t-e)*r.widthTimeX,height:r.timeLineY}),i.find(".time").text(a+"-"+n),u.text&&i.find(".text").text(u.text),u.class&&i.addClass(u.class),d.find(".sc_main .timeline").eq(p).append(i),o.schedule.push(u),v._saveData.apply(d,[o]),r.onAppendSchedule&&r.onAppendSchedule.apply(d,[i,u]);var s=o.schedule.length-1;i.data("sc_key",s),i.on("mouseup",function(){if(r.onClick&&!0!==T(this).data("dragCheck")&&!0!==T(this).data("resizeCheck")){var e=T(this),t=e.data("sc_key");r.onClick.apply(d,[e,o.schedule[t]])}});var c=d.find(".sc_bar"),h=null;c.draggable({grid:[r.widthTimeX,1],containment:d.find(".sc_main"),helper:"original",start:function(e,t){var i={};i.node=this,i.offsetTop=t.position.top,i.offsetLeft=t.position.left,i.currentTop=t.position.top,i.currentLeft=t.position.left,i.timeline=v._getTimeLineNumber.apply(d,[h,t.position.top]),i.nowTimeline=i.timeline,h=i},drag:function(e,t){if(T(this).data("dragCheck",!0),!h)return!1;var i=T(this),a=i.data("sc_key"),n=v._getTimeLineNumber.apply(d,[h,t.position.top]);return t.position.left=Math.floor(t.position.left/r.widthTimeX)*r.widthTimeX,h.nowTimeline!==n&&(h.nowTimeline=n),h.currentTop=t.position.top,h.currentLeft=t.position.left,v._rewriteBarText.apply(d,[i,o.schedule[a]]),!0},stop:function(){T(this).data("dragCheck",!1),h=null;var e=T(this),t=e.data("sc_key"),i=e.position().left,a=o.tableStartTime+Math.floor(i/r.widthTimeX)*r.widthTime,n=a+(o.schedule[t].endTime-o.schedule[t].startTime);o.schedule[t].start=v.formatTime(a),o.schedule[t].end=v.formatTime(n),o.schedule[t].startTime=a,o.schedule[t].endTime=n,r.onChange&&r.onChange.apply(d,[e,o.schedule[t]])}});var m=["e"];return r.resizableLeft&&m.push("w"),c.resizable({handles:m.join(","),grid:[r.widthTimeX,r.timeLineY-r.timeBorder],minWidth:r.widthTimeX,containment:d.find(".sc_main_scroll"),start:function(){T(this).data("resizeCheck",!0)},resize:function(e,t){t.element.height(t.size.height),t.element.width(t.size.width)},stop:function(){var e=T(this),t=e.data("sc_key"),i=e.position().left,a=e.outerWidth(),n=o.tableStartTime+Math.floor(i/r.widthTimeX)*r.widthTime,l=o.tableStartTime+Math.floor((i+a)/r.widthTimeX)*r.widthTime,s=o.schedule[t].timeline;o.schedule[t].start=v.formatTime(n),o.schedule[t].end=v.formatTime(l),o.schedule[t].startTime=n,o.schedule[t].endTime=l,v._resetBarPosition.apply(d,[s]),v._rewriteBarText.apply(d,[e,o.schedule[t]]),e.data("resizeCheck",!1),r.onChange&&r.onChange.apply(d,[e,o.schedule[t]])}}),!1===r.draggable&&c.draggable("disable"),!1===r.resizable&&c.resizable("disable"),s})},_getScheduleCount:function(e){var t=T(this),i=v._loadData.apply(t),a=0;for(var n in i.schedule)i.schedule[n].timeline===e&&a++;return a},_addRow:function(u,f){return this.each(function(){var e,s=T(this),i=v._loadSettingData.apply(s),d=v._loadData.apply(s),t=s.find(".sc_main .timeline").length;e="";var a=T(e+='
');f.title&&a.append(''+f.title+""),f.subtitle&&a.append(''+f.subtitle+""),i.onInitRow&&i.onInitRow.apply(s,[a,f]),s.find(".sc_data_scroll").append(a),e="";for(var n=T(e+='
'),l=d.tableStartTime;l');r.outerWidth(i.widthTimeX),r.data("time",v.formatTime(l)),r.data("timeline",u),n.append(r)}if(n.find(".tl").on("click",function(){i.onScheduleClick&&i.onScheduleClick.apply(s,[this,T(this).data("time"),T(this).data("timeline"),d.timeline[T(this).data("timeline")]])}),n.find(".tl").on("contextmenu",function(){return i.onScheduleClick&&i.onScheduleClick.apply(s,[this,T(this).data("time"),T(this).data("timeline"),d.timeline[T(this).data("timeline")]]),!1}),s.find(".sc_main").append(n),d.timeline[u]=f,v._saveData.apply(s,[d]),f.class&&""!==f.class&&(s.find(".sc_data .timeline").eq(t).addClass(f.class),s.find(".sc_main .timeline").eq(t).addClass(f.class)),f.schedule)for(var o in f.schedule){var c=f.schedule[o],h=c.start?c.start:v.calcStringTime(c.startTime),m=c.end?c.end:v.calcStringTime(c.endTime),p={};p.start=h,p.end=m,c.text&&(p.text=c.text),p.timeline=u,p.data={},c.data&&(p.data=c.data),v._addScheduleData.apply(s,[t,p])}v._resetBarPosition.apply(s,[t]),s.find(".sc_main .timeline").eq(t).droppable({accept:".sc_bar",drop:function(e,t){var i=t.draggable,a=i.data("sc_key"),n=d.schedule[a].timeline,l=s.find(".sc_main .timeline").index(this);d.schedule[a].timeline=l,i.appendTo(this),v._resetBarPosition.apply(s,[n]),v._resetBarPosition.apply(s,[l])}}),i.onAppendRow&&s.find(".sc_main .timeline").eq(t).find(".sc_bar").each(function(){var e=T(this),t=e.data("sc_key");i.onAppendRow.apply(s,[e,d.schedule[t]])})})},_rewriteBarText:function(d,r){return this.each(function(){var e=T(this),t=v._loadSettingData.apply(e),i=v._loadData.apply(e),a=d.position().left,n=i.tableStartTime+Math.floor(a/t.widthTimeX)*t.widthTime,l=n+(r.endTime-r.startTime),s=v.formatTime(n)+"-"+v.formatTime(l);T(d).find(".time").html(s)})},_resetBarPosition:function(_){return this.each(function(){var e,t,i,a,n,l,s,d,r=T(this),o=v._loadSettingData.apply(r),c=r.find(".sc_main .timeline").eq(_).find(".sc_bar"),h=[],m=[],p=0;for(d=0;dt.x?1:0}),d=0;d'+v.formatTime(s)+"";var d=T(n),r=Number(Math.min(3600*Math.ceil((s+t.widthTime)/3600),a)-s),o=Math.floor(r/t.widthTime);d.width(o*t.widthTimeX),e.find(".sc_header_scroll").append(d),l=s}for(var c in T(window).on("resize",function(){v._resizeWindow.apply(e)}).trigger("resize"),t.rows)v._addRow.apply(e,[c,t.rows[c]])})}};T.fn.timeSchedule=function(e){return v[e]?v[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!==_typeof(e)&&e?(T.error("Method "+e+" does not exist on jQuery.timeSchedule"),this):v.init.apply(this,arguments)}}(jQuery); //# sourceMappingURL=jq.schedule.min.js.map diff --git a/dist/js/jq.schedule.min.js.map b/dist/js/jq.schedule.min.js.map index 9260f31..61f4a94 100644 --- a/dist/js/jq.schedule.min.js.map +++ b/dist/js/jq.schedule.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["js/jq.schedule.js"],"names":["_typeof","obj","Symbol","iterator","constructor","prototype","$","PLUGIN_NAME","methods","calcStringTime","str","slice","split","Number","formatTime","val","i1","Math","floor","_saveSettingData","data","this","_loadSettingData","_saveData","d","extend","tableStartTime","tableEndTime","schedule","timeline","_loadData","scheduleData","$this","saveData","apply","timelineData","i","push","resetData","each","find","remove","_resizeRow","addSchedule","start","end","startTime","endTime","text","_addScheduleData","_resetBarPosition","addRow","_addRow","resetRowData","height","setRows","setDraggable","enable","setting","draggable","setResizable","resizable","_getTimeLineNumber","node","top","num","n","tn","ceil","timeLineY","timeLinePaddingTop","timeLinePaddingBottom","rows","r","tr","length","max","_addScheduleBgData","st","widthTime","et","$bar","css","left","widthTimeX","width","eq","class","addClass","append","stext","etext","snum","_getScheduleCount","onAppendSchedule","key","on","onClick","$n","scKey","$node","currentNode","grid","containment","helper","event","ui","offsetTop","position","offsetLeft","currentTop","currentLeft","nowTimeline","drag","$moveNode","timelineNum","_rewriteBarText","stop","x","onChange","resizableHandles","resizableLeft","handles","join","timeBorder","minWidth","resize","ev","element","size","w","outerWidth","row","html","id","$data","title","subtitle","onInitRow","$timeline","t","$tl","onScheduleClick","bdata","s","e","droppable","accept","drop","nowTimelineNum","index","appendTo","onAppendRow","$e1","$e2","c1","c2","s1","s2","e1","$barList","codes","check","h","code","sort","a","b","next","j","outerHeight","timeLineBorder","closest","_resizeWindow","scMainWidth","dataWidth","verticalScrollbar","cellNum","_moveSchedules","baseTimeLineCell","moveWidth","v1","v2","min","init","options","config","className","headTimeBorder","bundleMoveWidth","scrollTop","scrollLeft","beforeTime","$time","cn","window","trigger","fn","timeSchedule","method","Array","call","arguments","error","jQuery"],"mappings":"AAAA,aAEA,SAASA,QAAQC,GAAmV,OAAtOD,QAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAmC,SAAiBF,GAAO,cAAcA,GAA2B,SAAiBA,GAAO,OAAOA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAAyBA,IAEnX,SAAWK,GAGT,IAAIC,EAAc,aACdC,EAAU,CAMZC,eAAgB,SAAwBC,GACtC,IAAIC,EAAQD,EAAIE,MAAM,KAGtB,OAF2B,GAAnBC,OAAOF,EAAM,IAAW,GACL,GAAnBE,OAAOF,EAAM,KASvBG,WAAY,SAAoBC,GAC9B,IAAIC,EAAKD,EAAM,KAGf,MAFQ,GAAKE,KAAKC,MAAMH,EAAM,MAASE,KAAKC,MAAMH,EAAM,KAAO,IAEpD,KADH,GAAKE,KAAKC,MAAMF,EAAK,KAAOC,KAAKC,MAAMF,EAAK,GAAK,MAU3DG,iBAAkB,SAA0BC,GAC1C,OAAOC,KAAKD,KAAKb,EAAc,UAAWa,IAQ5CE,iBAAkB,WAChB,OAAOD,KAAKD,KAAKb,EAAc,YASjCgB,UAAW,SAAmBH,GAC5B,IAAII,EAAIlB,EAAEmB,OAAO,CACfC,eAAgB,EAChBC,aAAc,EACdC,SAAU,GACVC,SAAU,IACTT,GACH,OAAOC,KAAK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,MAJEb,EAAQgL,KAAKtJ,MAAMb,KAAMqL,YAx+BtC,CA8+BGE","file":"jq.schedule.min.js","sourcesContent":["\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n(function ($) {\n 'use strict';\n\n var PLUGIN_NAME = 'jqSchedule';\n var methods = {\n /**\n *\n * @param {string} str\n * @returns {number}\n */\n calcStringTime: function calcStringTime(str) {\n var slice = str.split(':');\n var h = Number(slice[0]) * 60 * 60;\n var i = Number(slice[1]) * 60;\n return h + i;\n },\n\n /**\n *\n * @param {number} val\n * @returns {string}\n */\n formatTime: function formatTime(val) {\n var i1 = val % 3600;\n var h = '' + Math.floor(val / 36000) + Math.floor(val / 3600 % 10);\n var i = '' + Math.floor(i1 / 600) + Math.floor(i1 / 60 % 10);\n return h + ':' + i;\n },\n\n /**\n * 設定データの保存\n *\n * @param {Options} data\n * @returns {*}\n */\n _saveSettingData: function _saveSettingData(data) {\n return this.data(PLUGIN_NAME + 'Setting', data);\n },\n\n /**\n * 設定データの取得\n *\n * @returns Options\n */\n _loadSettingData: function _loadSettingData() {\n return this.data(PLUGIN_NAME + 'Setting');\n },\n\n /**\n * 保存データの保存\n *\n * @param {SaveData} data\n * @returns {*}\n */\n _saveData: function _saveData(data) {\n var d = $.extend({\n tableStartTime: 0,\n tableEndTime: 0,\n schedule: [],\n timeline: []\n }, data);\n return this.data(PLUGIN_NAME, d);\n },\n\n /**\n * 保存データの取得\n *\n * @returns SaveData\n */\n _loadData: function _loadData() {\n return this.data(PLUGIN_NAME);\n },\n\n /**\n * スケジュールの取得\n *\n * @returns ScheduleData[]\n */\n scheduleData: function scheduleData() {\n var $this = $(this);\n\n var saveData = methods._loadData.apply($this);\n\n if (saveData) {\n return saveData.schedule;\n }\n\n return [];\n },\n\n /**\n * get timelineData\n * @returns {any[]}\n */\n timelineData: function timelineData() {\n var $this = $(this);\n\n var saveData = methods._loadData.apply($this);\n\n var data = [];\n var i;\n\n for (i in saveData.timeline) {\n data[i] = saveData.timeline[i];\n data[i].schedule = [];\n }\n\n for (i in saveData.schedule) {\n var d = saveData.schedule[i];\n\n if (typeof d.timeline === 'undefined') {\n continue;\n }\n\n if (typeof data[d.timeline] === 'undefined') {\n continue;\n }\n\n data[d.timeline].schedule.push(d);\n }\n\n return data;\n },\n\n /**\n * reset data\n */\n resetData: function resetData() {\n return this.each(function () {\n var $this = $(this);\n\n var saveData = methods._loadData.apply($this);\n\n saveData.schedule = [];\n\n methods._saveData.apply($this, [saveData]);\n\n $this.find('.sc_bar').remove();\n\n for (var i in saveData.timeline) {\n saveData.timeline[i].schedule = [];\n\n methods._resizeRow.apply($this, [i, 0]);\n }\n\n methods._saveData.apply($this, [saveData]);\n });\n },\n\n /**\n * add schedule data\n *\n * @param {number} timeline\n * @param {object} data\n * @returns {methods}\n */\n addSchedule: function addSchedule(timeline, data) {\n return this.each(function () {\n var $this = $(this);\n var d = {\n start: data.start,\n end: data.end,\n startTime: methods.calcStringTime(data.start),\n endTime: methods.calcStringTime(data.end),\n text: data.text,\n timeline: timeline\n };\n\n if (data.data) {\n d.data = data.data;\n }\n\n methods._addScheduleData.apply($this, [timeline, d]);\n\n methods._resetBarPosition.apply($this, [timeline]);\n });\n },\n\n /**\n * add schedule data\n *\n * @param {number} timeline\n * @param {object} data\n * @returns {methods}\n */\n addRow: function addRow(timeline, data) {\n return this.each(function () {\n var $this = $(this);\n\n methods._addRow.apply($this, [timeline, data]);\n });\n },\n\n /**\n * clear row\n *\n * @returns {methods}\n */\n resetRowData: function resetRowData() {\n return this.each(function () {\n var $this = $(this);\n\n var data = methods._loadData.apply($this);\n\n data.schedule = [];\n data.timeline = [];\n\n methods._saveData.apply($this, [data]);\n\n $this.find('.sc_bar').remove();\n $this.find('.timeline').remove();\n $this.find('.sc_data').height(0);\n });\n },\n\n /**\n * clear row\n *\n * @param {object} data\n * @returns {methods}\n */\n setRows: function setRows(data) {\n return this.each(function () {\n var $this = $(this);\n methods.resetRowData.apply($this, []);\n\n for (var timeline in data) {\n methods.addRow.apply($this, [timeline, data[timeline]]);\n }\n });\n },\n\n /**\n * switch draggable\n * @param {boolean} enable\n */\n setDraggable: function setDraggable(enable) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n if (enable !== setting.draggable) {\n setting.draggable = enable;\n\n methods._saveSettingData.apply($this, setting);\n\n if (enable) {\n $this.find('.sc_bar').draggable('enable');\n } else {\n $this.find('.sc_bar').draggable('disable');\n }\n }\n });\n },\n\n /**\n * switch resizable\n * @param {boolean} enable\n */\n setResizable: function setResizable(enable) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n if (enable !== setting.resizable) {\n setting.resizable = enable;\n\n methods._saveSettingData.apply($this, setting);\n\n if (enable) {\n $this.find('.sc_bar').resizable('enable');\n } else {\n $this.find('.sc_bar').resizable('disable');\n }\n }\n });\n },\n\n /**\n * 現在のタイムライン番号を取得\n *\n * @param node\n * @param top\n * @returns {number}\n */\n _getTimeLineNumber: function _getTimeLineNumber(node, top) {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var num = 0;\n var n = 0;\n var tn = Math.ceil(top / (setting.timeLineY + setting.timeLinePaddingTop + setting.timeLinePaddingBottom));\n\n for (var i in setting.rows) {\n var r = setting.rows[i];\n var tr = 0;\n\n if (_typeof(r.schedule) === 'object') {\n tr = r.schedule.length;\n }\n\n if (node && node.timeline) {\n tr++;\n }\n\n n += Math.max(tr, 1);\n\n if (n >= tn) {\n break;\n }\n\n num++;\n }\n\n return num;\n },\n\n /**\n * 背景データ追加\n *\n * @param {ScheduleData} data\n */\n _addScheduleBgData: function _addScheduleBgData(data) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var saveData = methods._loadData.apply($this);\n\n var st = Math.ceil((data.startTime - saveData.tableStartTime) / setting.widthTime);\n var et = Math.floor((data.endTime - saveData.tableStartTime) / setting.widthTime);\n var $bar = $('
');\n $bar.css({\n left: st * setting.widthTimeX,\n top: 0,\n width: (et - st) * setting.widthTimeX,\n height: $this.find('.sc_main .timeline').eq(data.timeline).height()\n });\n\n if (data.text) {\n $bar.find('.text').text(data.text);\n }\n\n if (data.class) {\n $bar.addClass(data.class);\n } // $element.find('.sc_main').append($bar);\n\n\n $this.find('.sc_main .timeline').eq(data.timeline).append($bar);\n });\n },\n\n /**\n * スケジュール追加\n *\n * @param timeline\n * @param {ScheduleData} d\n * @returns {number}\n */\n _addScheduleData: function _addScheduleData(timeline, d) {\n var data = d;\n data.startTime = data.startTime ? data.startTime : methods.calcStringTime(data.start);\n data.endTime = data.endTime ? data.endTime : methods.calcStringTime(data.end);\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var saveData = methods._loadData.apply($this);\n\n var st = Math.ceil((data.startTime - saveData.tableStartTime) / setting.widthTime);\n var et = Math.floor((data.endTime - saveData.tableStartTime) / setting.widthTime);\n var $bar = $('
');\n var stext = methods.formatTime(data.startTime);\n var etext = methods.formatTime(data.endTime);\n\n var snum = methods._getScheduleCount.apply($this, [data.timeline]);\n\n $bar.css({\n left: st * setting.widthTimeX,\n top: snum * setting.timeLineY + setting.timeLinePaddingTop,\n width: (et - st) * setting.widthTimeX,\n height: setting.timeLineY\n });\n $bar.find('.time').text(stext + '-' + etext);\n\n if (data.text) {\n $bar.find('.text').text(data.text);\n }\n\n if (data.class) {\n $bar.addClass(data.class);\n } // $this.find('.sc_main').append($bar);\n\n\n var $row = $this.find('.sc_main .timeline').eq(timeline);\n $row.append($bar); // データの追加\n\n saveData.schedule.push(data);\n\n methods._saveData.apply($this, [saveData]); // コールバックがセットされていたら呼出\n\n\n if (setting.onAppendSchedule) {\n setting.onAppendSchedule.apply($this, [$bar, data]);\n } // key\n\n\n var key = saveData.schedule.length - 1;\n $bar.data('sc_key', key);\n $bar.on('mouseup', function () {\n // コールバックがセットされていたら呼出\n if (setting.onClick) {\n if ($(this).data('dragCheck') !== true && $(this).data('resizeCheck') !== true) {\n var $n = $(this);\n var scKey = $n.data('sc_key');\n setting.onClick.apply($this, [$n, saveData.schedule[scKey]]);\n }\n }\n });\n var $node = $this.find('.sc_bar');\n var currentNode = null; // move node.\n\n $node.draggable({\n grid: [setting.widthTimeX, 1],\n containment: $this.find('.sc_main'),\n helper: 'original',\n start: function start(event, ui) {\n var node = {};\n node.node = this;\n node.offsetTop = ui.position.top;\n node.offsetLeft = ui.position.left;\n node.currentTop = ui.position.top;\n node.currentLeft = ui.position.left;\n node.timeline = methods._getTimeLineNumber.apply($this, [currentNode, ui.position.top]);\n node.nowTimeline = node.timeline;\n currentNode = node;\n },\n\n /**\n *\n * @param {Event} event\n * @param {function} ui\n * @returns {boolean}\n */\n drag: function drag(event, ui) {\n $(this).data('dragCheck', true);\n\n if (!currentNode) {\n return false;\n }\n\n var $moveNode = $(this);\n var scKey = $moveNode.data('sc_key');\n\n var timelineNum = methods._getTimeLineNumber.apply($this, [currentNode, ui.position.top]); // eslint-disable-next-line no-param-reassign\n\n\n ui.position.left = Math.floor(ui.position.left / setting.widthTimeX) * setting.widthTimeX;\n\n if (currentNode.nowTimeline !== timelineNum) {\n // 現在のタイムライン\n currentNode.nowTimeline = timelineNum;\n }\n\n currentNode.currentTop = ui.position.top;\n currentNode.currentLeft = ui.position.left; // テキスト変更\n\n methods._rewriteBarText.apply($this, [$moveNode, saveData.schedule[scKey]]);\n\n return true;\n },\n // 要素の移動が終った後の処理\n stop: function stop() {\n $(this).data('dragCheck', false);\n currentNode = null;\n var $n = $(this);\n var scKey = $n.data('sc_key');\n var x = $n.position().left; // var w = $n.width();\n\n var start = saveData.tableStartTime + Math.floor(x / setting.widthTimeX) * setting.widthTime; // var end = saveData.tableStartTime + (Math.floor((x + w) / setting.widthTimeX) * setting.widthTime);\n\n var end = start + (saveData.schedule[scKey].endTime - saveData.schedule[scKey].startTime);\n saveData.schedule[scKey].start = methods.formatTime(start);\n saveData.schedule[scKey].end = methods.formatTime(end);\n saveData.schedule[scKey].startTime = start;\n saveData.schedule[scKey].endTime = end; // コールバックがセットされていたら呼出\n\n if (setting.onChange) {\n setting.onChange.apply($this, [$n, saveData.schedule[scKey]]);\n }\n }\n });\n var resizableHandles = ['e'];\n\n if (setting.resizableLeft) {\n resizableHandles.push('w');\n }\n\n $node.resizable({\n handles: resizableHandles.join(','),\n grid: [setting.widthTimeX, setting.timeLineY - setting.timeBorder],\n minWidth: setting.widthTimeX,\n containment: $this.find('.sc_main_scroll'),\n start: function start() {\n var $n = $(this);\n $n.data('resizeCheck', true);\n },\n resize: function resize(ev, ui) {\n // box-sizing: border-box; に対応\n ui.element.height(ui.size.height);\n ui.element.width(ui.size.width);\n },\n // 要素の移動が終った後の処理\n stop: function stop() {\n var $n = $(this);\n var scKey = $n.data('sc_key');\n var x = $n.position().left;\n var w = $n.outerWidth();\n var start = saveData.tableStartTime + Math.floor(x / setting.widthTimeX) * setting.widthTime;\n var end = saveData.tableStartTime + Math.floor((x + w) / setting.widthTimeX) * setting.widthTime;\n var timelineNum = saveData.schedule[scKey].timeline;\n saveData.schedule[scKey].start = methods.formatTime(start);\n saveData.schedule[scKey].end = methods.formatTime(end);\n saveData.schedule[scKey].startTime = start;\n saveData.schedule[scKey].endTime = end; // 高さ調整\n\n methods._resetBarPosition.apply($this, [timelineNum]); // テキスト変更\n\n\n methods._rewriteBarText.apply($this, [$n, saveData.schedule[scKey]]);\n\n $n.data('resizeCheck', false); // コールバックがセットされていたら呼出\n\n if (setting.onChange) {\n setting.onChange.apply($this, [$n, saveData.schedule[scKey]]);\n }\n }\n });\n\n if (setting.draggable === false) {\n $node.draggable('disable');\n }\n\n if (setting.resizable === false) {\n $node.resizable('disable');\n }\n\n return key;\n });\n },\n\n /**\n * スケジュール数の取得\n *\n * @param {number} n row number\n * @returns {number}\n */\n _getScheduleCount: function _getScheduleCount(n) {\n var $this = $(this);\n\n var saveData = methods._loadData.apply($this);\n\n var num = 0;\n\n for (var i in saveData.schedule) {\n if (saveData.schedule[i].timeline === n) {\n num++;\n }\n }\n\n return num;\n },\n\n /**\n * add rows\n *\n * @param timeline\n * @param row\n */\n _addRow: function _addRow(timeline, row) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var saveData = methods._loadData.apply($this);\n\n var id = $this.find('.sc_main .timeline').length;\n var html;\n html = '';\n html += '
';\n var $data = $(html);\n\n if (row.title) {\n $data.append('' + row.title + '');\n }\n\n if (row.subtitle) {\n $data.append('' + row.subtitle + '');\n } // event call\n\n\n if (setting.onInitRow) {\n setting.onInitRow.apply($this, [$data, row]);\n }\n\n $this.find('.sc_data_scroll').append($data);\n html = '';\n html += '
';\n var $timeline = $(html);\n\n for (var t = saveData.tableStartTime; t < saveData.tableEndTime; t += setting.widthTime) {\n var $tl = $('
');\n $tl.outerWidth(setting.widthTimeX);\n $tl.data('time', methods.formatTime(t));\n $tl.data('timeline', timeline);\n $timeline.append($tl);\n } // クリックイベント\n // left click\n\n\n $timeline.find('.tl').on('click', function () {\n if (setting.onScheduleClick) {\n setting.onScheduleClick.apply($this, [this, $(this).data('time'), $(this).data('timeline'), saveData.timeline[$(this).data('timeline')]]);\n }\n }); // right click\n\n $timeline.find('.tl').on('contextmenu', function () {\n if (setting.onScheduleClick) {\n setting.onScheduleClick.apply($this, [this, $(this).data('time'), $(this).data('timeline'), saveData.timeline[$(this).data('timeline')]]);\n }\n\n return false;\n });\n $this.find('.sc_main').append($timeline);\n saveData.timeline[timeline] = row;\n\n methods._saveData.apply($this, [saveData]);\n\n if (row.class && row.class !== '') {\n $this.find('.sc_data .timeline').eq(id).addClass(row.class);\n $this.find('.sc_main .timeline').eq(id).addClass(row.class);\n } // スケジュールタイムライン\n\n\n if (row.schedule) {\n for (var i in row.schedule) {\n var bdata = row.schedule[i];\n var s = bdata.start ? bdata.start : methods.calcStringTime(bdata.startTime);\n var e = bdata.end ? bdata.end : methods.calcStringTime(bdata.endTime);\n var data = {};\n data.start = s;\n data.end = e;\n\n if (bdata.text) {\n data.text = bdata.text;\n }\n\n data.timeline = i;\n data.data = {};\n\n if (bdata.data) {\n data.data = bdata.data;\n }\n\n methods._addScheduleData.apply($this, [id, data]);\n }\n } // 高さの調整\n\n\n methods._resetBarPosition.apply($this, [id]);\n\n $this.find('.sc_main .timeline').eq(id).droppable({\n accept: '.sc_bar',\n drop: function drop(ev, ui) {\n var node = ui.draggable;\n var scKey = node.data('sc_key');\n var nowTimelineNum = saveData.schedule[scKey].timeline;\n var timelineNum = $this.find('.sc_main .timeline').index(this); // タイムラインの変更\n\n saveData.schedule[scKey].timeline = timelineNum;\n node.appendTo(this); // 高さ調整\n\n methods._resetBarPosition.apply($this, [nowTimelineNum]);\n\n methods._resetBarPosition.apply($this, [timelineNum]);\n }\n }); // コールバックがセットされていたら呼出\n\n if (setting.onAppendRow) {\n $this.find('.sc_main .timeline').eq(id).find('.sc_bar').each(function () {\n var $n = $(this);\n var scKey = $n.data('sc_key');\n setting.onAppendRow.apply($this, [$n, saveData.schedule[scKey]]);\n });\n }\n });\n },\n\n /**\n * テキストの変更\n *\n * @param {jQuery} node\n * @param {Object} data\n */\n _rewriteBarText: function _rewriteBarText(node, data) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var saveData = methods._loadData.apply($this);\n\n var x = node.position().left; // var w = node.width();\n\n var start = saveData.tableStartTime + Math.floor(x / setting.widthTimeX) * setting.widthTime; // var end = saveData.tableStartTime + (Math.floor((x + w) / setting.widthTimeX) * setting.widthTime);\n\n var end = start + (data.endTime - data.startTime);\n var html = methods.formatTime(start) + '-' + methods.formatTime(end);\n $(node).find('.time').html(html);\n });\n },\n\n /**\n *\n * @param {Number} n\n */\n _resetBarPosition: function _resetBarPosition(n) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this); // 要素の並び替え\n\n\n var $barList = $this.find('.sc_main .timeline').eq(n).find('.sc_bar');\n var codes = [],\n check = [];\n var h = 0;\n var $e1, $e2;\n var c1, c2, s1, s2, e1, e2;\n var i;\n\n for (i = 0; i < $barList.length; i++) {\n codes[i] = {\n code: i,\n x: $($barList[i]).position().left\n };\n } // ソート\n\n\n codes.sort(function (a, b) {\n if (a.x < b.x) {\n return -1;\n }\n\n if (a.x > b.x) {\n return 1;\n }\n\n return 0;\n });\n\n for (i = 0; i < codes.length; i++) {\n c1 = codes[i].code;\n $e1 = $($barList[c1]);\n\n for (h = 0; h < check.length; h++) {\n var next = false;\n\n for (var j = 0; j < check[h].length; j++) {\n c2 = check[h][j];\n $e2 = $($barList[c2]);\n s1 = $e1.position().left;\n e1 = $e1.position().left + $e1.outerWidth();\n s2 = $e2.position().left;\n e2 = $e2.position().left + $e2.outerWidth();\n\n if (s1 < e2 && e1 > s2) {\n next = true;\n continue;\n }\n }\n\n if (!next) {\n break;\n }\n }\n\n if (!check[h]) {\n check[h] = [];\n }\n\n $e1.css({\n top: h * setting.timeLineY + setting.timeLinePaddingTop\n });\n check[h][check[h].length] = c1;\n } // 高さの調整\n\n\n methods._resizeRow.apply($this, [n, check.length]);\n });\n },\n\n /**\n *\n * @param n\n * @param height\n */\n _resizeRow: function _resizeRow(n, height) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var h = Math.max(height, 1);\n $this.find('.sc_data .timeline').eq(n).outerHeight(h * setting.timeLineY + setting.timeLineBorder + setting.timeLinePaddingTop + setting.timeLinePaddingBottom);\n $this.find('.sc_main .timeline').eq(n).outerHeight(h * setting.timeLineY + setting.timeLineBorder + setting.timeLinePaddingTop + setting.timeLinePaddingBottom);\n $this.find('.sc_main .timeline').eq(n).find('.sc_bgBar').each(function () {\n $(this).outerHeight($(this).closest('.timeline').outerHeight());\n });\n $this.find('.sc_data').outerHeight($this.find('.sc_main_box').outerHeight());\n });\n },\n\n /**\n * resizeWindow\n */\n _resizeWindow: function _resizeWindow() {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var saveData = methods._loadData.apply($this);\n\n var scWidth = $this.width();\n var scMainWidth = scWidth - setting.dataWidth - setting.verticalScrollbar;\n var cellNum = Math.floor((saveData.tableEndTime - saveData.tableStartTime) / setting.widthTime);\n $this.find('.sc_header_cell').width(setting.dataWidth);\n $this.find('.sc_data,.sc_data_scroll').width(setting.dataWidth);\n $this.find('.sc_header').width(scMainWidth);\n $this.find('.sc_main_box').width(scMainWidth);\n $this.find('.sc_header_scroll').width(setting.widthTimeX * cellNum);\n $this.find('.sc_main_scroll').width(setting.widthTimeX * cellNum);\n });\n },\n\n /**\n * move all cells of the right of the specified time line cell\n *\n * @param timeline\n * @param baseTimeLineCell\n * @param moveWidth\n */\n _moveSchedules: function _moveSchedules(timeline, baseTimeLineCell, moveWidth) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var saveData = methods._loadData.apply($this);\n\n var $barList = $this.find('.sc_main .timeline').eq(timeline).find('.sc_bar');\n\n for (var i = 0; i < $barList.length; i++) {\n var $bar = $($barList[i]);\n\n if (baseTimeLineCell.position().left <= $bar.position().left) {\n var v1 = $bar.position().left + setting.widthTimeX * moveWidth;\n var v2 = Math.floor((saveData.tableEndTime - saveData.tableStartTime) / setting.widthTime) * setting.widthTimeX - $bar.outerWidth();\n $bar.css({\n left: Math.max(0, Math.min(v1, v2))\n });\n var scKey = $bar.data('sc_key');\n var start = saveData.tableStartTime + Math.floor($bar.position().left / setting.widthTimeX) * setting.widthTime;\n var end = start + (saveData.schedule[scKey].end - saveData.schedule[scKey].start);\n saveData.schedule[scKey].start = methods.formatTime(start);\n saveData.schedule[scKey].end = methods.formatTime(end);\n saveData.schedule[scKey].startTime = start;\n saveData.schedule[scKey].endTime = end;\n\n methods._rewriteBarText.apply($this, [$bar, saveData.schedule[scKey]]); // if setting\n\n\n if (setting.onChange) {\n setting.onChange.apply($this, [$bar, saveData.schedule[scKey]]);\n }\n }\n }\n\n methods._resetBarPosition.apply($this, [timeline]);\n });\n },\n\n /**\n * initialize\n */\n init: function init(options) {\n return this.each(function () {\n var $this = $(this);\n var config = $.extend({\n className: 'jq-schedule',\n rows: {},\n startTime: '07:00',\n endTime: '19:30',\n widthTimeX: 25,\n // 1cell辺りの幅(px)\n widthTime: 600,\n // 区切り時間(秒)\n timeLineY: 50,\n // timeline height(px)\n timeLineBorder: 1,\n // timeline height border\n timeBorder: 1,\n // border width\n timeLinePaddingTop: 0,\n timeLinePaddingBottom: 0,\n headTimeBorder: 1,\n // time border width\n dataWidth: 160,\n // data width\n verticalScrollbar: 0,\n // vertical scrollbar width\n bundleMoveWidth: 1,\n // width to move all schedules to the right of the clicked time cell\n draggable: true,\n resizable: true,\n resizableLeft: false,\n // event\n onInitRow: null,\n onChange: null,\n onClick: null,\n onAppendRow: null,\n onAppendSchedule: null,\n onScheduleClick: null\n }, options);\n\n methods._saveSettingData.apply($this, [config]);\n\n var tableStartTime = methods.calcStringTime(config.startTime);\n var tableEndTime = methods.calcStringTime(config.endTime);\n tableStartTime -= tableStartTime % config.widthTime;\n tableEndTime -= tableEndTime % config.widthTime;\n\n methods._saveData.apply($this, [{\n tableStartTime: tableStartTime,\n tableEndTime: tableEndTime\n }]);\n\n var html = '' + '
' + '\\n' + '
 
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
';\n $this.append(html);\n $this.addClass(config.className);\n $this.find('.sc_main_box').on('scroll', function () {\n $this.find('.sc_data_scroll').css('top', $(this).scrollTop() * -1);\n $this.find('.sc_header_scroll').css('left', $(this).scrollLeft() * -1);\n }); // add time cell\n // var cellNum = Math.floor((tableEndTime - tableStartTime) / config.widthTime);\n\n var beforeTime = -1;\n\n for (var t = tableStartTime; t < tableEndTime; t += config.widthTime) {\n if (beforeTime < 0 || Math.floor(beforeTime / 3600) !== Math.floor(t / 3600)) {\n html = '';\n html += '
' + methods.formatTime(t) + '
';\n var $time = $(html);\n var cn = Number(Math.min(Math.ceil((t + config.widthTime) / 3600) * 3600, tableEndTime) - t);\n var cellNum = Math.floor(cn / config.widthTime);\n $time.width(cellNum * config.widthTimeX);\n $this.find('.sc_header_scroll').append($time);\n beforeTime = t;\n }\n }\n\n $(window).on('resize', function () {\n methods._resizeWindow.apply($this);\n }).trigger('resize'); // addrow\n\n for (var i in config.rows) {\n methods._addRow.apply($this, [i, config.rows[i]]);\n }\n });\n }\n };\n /**\n *\n * @param {Object|string} method\n * @returns {jQuery|methods|*}\n */\n // eslint-disable-next-line no-param-reassign\n\n $.fn.timeSchedule = function (method) {\n // Method calling logic\n if (methods[method]) {\n return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); // eslint-disable-next-line no-else-return\n } else if (_typeof(method) === 'object' || !method) {\n return methods.init.apply(this, arguments);\n }\n\n $.error('Method ' + method + ' does not exist on jQuery.timeSchedule');\n return this;\n };\n})(jQuery);"]} \ No newline at end of file +{"version":3,"sources":["js/jq.schedule.js"],"names":["_typeof","obj","Symbol","iterator","constructor","prototype","$","PLUGIN_NAME","methods","calcStringTime","str","slice","split","Number","formatTime","val","i1","Math","floor","_saveSettingData","data","this","_loadSettingData","_saveData","d","extend","tableStartTime","tableEndTime","schedule","timeline","_loadData","scheduleData","$this","saveData","apply","timelineData","i","push","resetData","each","find","remove","_resizeRow","addSchedule","start","end","startTime","endTime","text","_addScheduleData","_resetBarPosition","addRow","_addRow","resetRowData","height","setRows","setDraggable","enable","setting","draggable","setResizable","resizable","_getTimeLineNumber","node","top","num","n","tn","ceil","timeLineY","timeLinePaddingTop","timeLinePaddingBottom","rows","r","tr","length","max","_addScheduleBgData","st","widthTime","et","$bar","css","left","widthTimeX","width","eq","class","addClass","append","stext","etext","snum","_getScheduleCount","onAppendSchedule","key","on","onClick","$n","scKey","$node","currentNode","grid","containment","helper","event","ui","offsetTop","position","offsetLeft","currentTop","currentLeft","nowTimeline","drag","$moveNode","timelineNum","_rewriteBarText","stop","x","onChange","resizableHandles","resizableLeft","handles","join","timeBorder","minWidth","resize","ev","element","size","w","outerWidth","row","html","id","$data","title","subtitle","onInitRow","$timeline","t","$tl","onScheduleClick","bdata","s","e","droppable","accept","drop","nowTimelineNum","index","appendTo","onAppendRow","$e1","$e2","c1","c2","s1","s2","e1","$barList","codes","check","h","code","sort","a","b","next","j","outerHeight","timeLineBorder","closest","_resizeWindow","scMainWidth","dataWidth","verticalScrollbar","cellNum","_moveSchedules","baseTimeLineCell","moveWidth","v1","v2","min","init","options","config","className","headTimeBorder","bundleMoveWidth","scrollTop","scrollLeft","beforeTime","$time","cn","window","trigger","fn","timeSchedule","method","Array","call","arguments","error","jQuery"],"mappings":"AAAA,aAEA,SAASA,QAAQC,GAAmV,OAAtOD,QAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAmC,SAAiBF,GAAO,cAAcA,GAA2B,SAAiBA,GAAO,OAAOA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAAyBA,IAEnX,SAAWK,GAGT,IAAIC,EAAc,aACdC,EAAU,CAMZC,eAAgB,SAAwBC,GACtC,IAAIC,EAAQD,EAAIE,MAAM,KAGtB,OAF2B,GAAnBC,OAAOF,EAAM,IAAW,GACL,GAAnBE,OAAOF,EAAM,KASvBG,WAAY,SAAoBC,GAC9B,IAAIC,EAAKD,EAAM,KAGf,MAFQ,GAAKE,KAAKC,MAAMH,EAAM,MAASE,KAAKC,MAAMH,EAAM,KAAO,IAEpD,KADH,GAAKE,KAAKC,MAAMF,EAAK,KAAOC,KAAKC,MAAMF,EAAK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AO,CAACI,EAAGsJ,EAAOlH,KAAKpC,SAYrD9B,EAAE+L,GAAGC,aAAe,SAAUC,GAE5B,OAAI/L,EAAQ+L,GACH/L,EAAQ+L,GAAQrK,MAAMb,KAAMmL,MAAMnM,UAAUM,MAAM8L,KAAKC,UAAW,IAC5C,WAApB1M,QAAQuM,IAAyBA,GAI5CjM,EAAEqM,MAAM,UAAYJ,EAAS,0CACtBlL,MAJEb,EAAQgL,KAAKtJ,MAAMb,KAAMqL,YAx+BtC,CA8+BGE","file":"jq.schedule.min.js","sourcesContent":["\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n(function ($) {\n 'use strict';\n\n var PLUGIN_NAME = 'jqSchedule';\n var methods = {\n /**\n *\n * @param {string} str\n * @returns {number}\n */\n calcStringTime: function calcStringTime(str) {\n var slice = str.split(':');\n var h = Number(slice[0]) * 60 * 60;\n var i = Number(slice[1]) * 60;\n return h + i;\n },\n\n /**\n *\n * @param {number} val\n * @returns {string}\n */\n formatTime: function formatTime(val) {\n var i1 = val % 3600;\n var h = '' + Math.floor(val / 36000) + Math.floor(val / 3600 % 10);\n var i = '' + Math.floor(i1 / 600) + Math.floor(i1 / 60 % 10);\n return h + ':' + i;\n },\n\n /**\n * 設定データの保存\n *\n * @param {Options} data\n * @returns {*}\n */\n _saveSettingData: function _saveSettingData(data) {\n return this.data(PLUGIN_NAME + 'Setting', data);\n },\n\n /**\n * 設定データの取得\n *\n * @returns Options\n */\n _loadSettingData: function _loadSettingData() {\n return this.data(PLUGIN_NAME + 'Setting');\n },\n\n /**\n * 保存データの保存\n *\n * @param {SaveData} data\n * @returns {*}\n */\n _saveData: function _saveData(data) {\n var d = $.extend({\n tableStartTime: 0,\n tableEndTime: 0,\n schedule: [],\n timeline: []\n }, data);\n return this.data(PLUGIN_NAME, d);\n },\n\n /**\n * 保存データの取得\n *\n * @returns SaveData\n */\n _loadData: function _loadData() {\n return this.data(PLUGIN_NAME);\n },\n\n /**\n * スケジュールの取得\n *\n * @returns ScheduleData[]\n */\n scheduleData: function scheduleData() {\n var $this = $(this);\n\n var saveData = methods._loadData.apply($this);\n\n if (saveData) {\n return saveData.schedule;\n }\n\n return [];\n },\n\n /**\n * get timelineData\n * @returns {any[]}\n */\n timelineData: function timelineData() {\n var $this = $(this);\n\n var saveData = methods._loadData.apply($this);\n\n var data = [];\n var i;\n\n for (i in saveData.timeline) {\n data[i] = saveData.timeline[i];\n data[i].schedule = [];\n }\n\n for (i in saveData.schedule) {\n var d = saveData.schedule[i];\n\n if (typeof d.timeline === 'undefined') {\n continue;\n }\n\n if (typeof data[d.timeline] === 'undefined') {\n continue;\n }\n\n data[d.timeline].schedule.push(d);\n }\n\n return data;\n },\n\n /**\n * reset data\n */\n resetData: function resetData() {\n return this.each(function () {\n var $this = $(this);\n\n var saveData = methods._loadData.apply($this);\n\n saveData.schedule = [];\n\n methods._saveData.apply($this, [saveData]);\n\n $this.find('.sc_bar').remove();\n\n for (var i in saveData.timeline) {\n saveData.timeline[i].schedule = [];\n\n methods._resizeRow.apply($this, [i, 0]);\n }\n\n methods._saveData.apply($this, [saveData]);\n });\n },\n\n /**\n * add schedule data\n *\n * @param {number} timeline\n * @param {object} data\n * @returns {methods}\n */\n addSchedule: function addSchedule(timeline, data) {\n return this.each(function () {\n var $this = $(this);\n var d = {\n start: data.start,\n end: data.end,\n startTime: methods.calcStringTime(data.start),\n endTime: methods.calcStringTime(data.end),\n text: data.text,\n timeline: timeline\n };\n\n if (data.data) {\n d.data = data.data;\n }\n\n methods._addScheduleData.apply($this, [timeline, d]);\n\n methods._resetBarPosition.apply($this, [timeline]);\n });\n },\n\n /**\n * add schedule data\n *\n * @param {number} timeline\n * @param {object} data\n * @returns {methods}\n */\n addRow: function addRow(timeline, data) {\n return this.each(function () {\n var $this = $(this);\n\n methods._addRow.apply($this, [timeline, data]);\n });\n },\n\n /**\n * clear row\n *\n * @returns {methods}\n */\n resetRowData: function resetRowData() {\n return this.each(function () {\n var $this = $(this);\n\n var data = methods._loadData.apply($this);\n\n data.schedule = [];\n data.timeline = [];\n\n methods._saveData.apply($this, [data]);\n\n $this.find('.sc_bar').remove();\n $this.find('.timeline').remove();\n $this.find('.sc_data').height(0);\n });\n },\n\n /**\n * clear row\n *\n * @param {object} data\n * @returns {methods}\n */\n setRows: function setRows(data) {\n return this.each(function () {\n var $this = $(this);\n methods.resetRowData.apply($this, []);\n\n for (var timeline in data) {\n methods.addRow.apply($this, [timeline, data[timeline]]);\n }\n });\n },\n\n /**\n * switch draggable\n * @param {boolean} enable\n */\n setDraggable: function setDraggable(enable) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n if (enable !== setting.draggable) {\n setting.draggable = enable;\n\n methods._saveSettingData.apply($this, setting);\n\n if (enable) {\n $this.find('.sc_bar').draggable('enable');\n } else {\n $this.find('.sc_bar').draggable('disable');\n }\n }\n });\n },\n\n /**\n * switch resizable\n * @param {boolean} enable\n */\n setResizable: function setResizable(enable) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n if (enable !== setting.resizable) {\n setting.resizable = enable;\n\n methods._saveSettingData.apply($this, setting);\n\n if (enable) {\n $this.find('.sc_bar').resizable('enable');\n } else {\n $this.find('.sc_bar').resizable('disable');\n }\n }\n });\n },\n\n /**\n * 現在のタイムライン番号を取得\n *\n * @param node\n * @param top\n * @returns {number}\n */\n _getTimeLineNumber: function _getTimeLineNumber(node, top) {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var num = 0;\n var n = 0;\n var tn = Math.ceil(top / (setting.timeLineY + setting.timeLinePaddingTop + setting.timeLinePaddingBottom));\n\n for (var i in setting.rows) {\n var r = setting.rows[i];\n var tr = 0;\n\n if (_typeof(r.schedule) === 'object') {\n tr = r.schedule.length;\n }\n\n if (node && node.timeline) {\n tr++;\n }\n\n n += Math.max(tr, 1);\n\n if (n >= tn) {\n break;\n }\n\n num++;\n }\n\n return num;\n },\n\n /**\n * 背景データ追加\n *\n * @param {ScheduleData} data\n */\n _addScheduleBgData: function _addScheduleBgData(data) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var saveData = methods._loadData.apply($this);\n\n var st = Math.ceil((data.startTime - saveData.tableStartTime) / setting.widthTime);\n var et = Math.floor((data.endTime - saveData.tableStartTime) / setting.widthTime);\n var $bar = $('
');\n $bar.css({\n left: st * setting.widthTimeX,\n top: 0,\n width: (et - st) * setting.widthTimeX,\n height: $this.find('.sc_main .timeline').eq(data.timeline).height()\n });\n\n if (data.text) {\n $bar.find('.text').text(data.text);\n }\n\n if (data.class) {\n $bar.addClass(data.class);\n } // $element.find('.sc_main').append($bar);\n\n\n $this.find('.sc_main .timeline').eq(data.timeline).append($bar);\n });\n },\n\n /**\n * スケジュール追加\n *\n * @param timeline\n * @param {ScheduleData} d\n * @returns {number}\n */\n _addScheduleData: function _addScheduleData(timeline, d) {\n var data = d;\n data.startTime = data.startTime ? data.startTime : methods.calcStringTime(data.start);\n data.endTime = data.endTime ? data.endTime : methods.calcStringTime(data.end);\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var saveData = methods._loadData.apply($this);\n\n var st = Math.ceil((data.startTime - saveData.tableStartTime) / setting.widthTime);\n var et = Math.floor((data.endTime - saveData.tableStartTime) / setting.widthTime);\n var $bar = $('
');\n var stext = methods.formatTime(data.startTime);\n var etext = methods.formatTime(data.endTime);\n\n var snum = methods._getScheduleCount.apply($this, [data.timeline]);\n\n $bar.css({\n left: st * setting.widthTimeX,\n top: snum * setting.timeLineY + setting.timeLinePaddingTop,\n width: (et - st) * setting.widthTimeX,\n height: setting.timeLineY\n });\n $bar.find('.time').text(stext + '-' + etext);\n\n if (data.text) {\n $bar.find('.text').text(data.text);\n }\n\n if (data.class) {\n $bar.addClass(data.class);\n } // $this.find('.sc_main').append($bar);\n\n\n var $row = $this.find('.sc_main .timeline').eq(timeline);\n $row.append($bar); // データの追加\n\n saveData.schedule.push(data);\n\n methods._saveData.apply($this, [saveData]); // コールバックがセットされていたら呼出\n\n\n if (setting.onAppendSchedule) {\n setting.onAppendSchedule.apply($this, [$bar, data]);\n } // key\n\n\n var key = saveData.schedule.length - 1;\n $bar.data('sc_key', key);\n $bar.on('mouseup', function () {\n // コールバックがセットされていたら呼出\n if (setting.onClick) {\n if ($(this).data('dragCheck') !== true && $(this).data('resizeCheck') !== true) {\n var $n = $(this);\n var scKey = $n.data('sc_key');\n setting.onClick.apply($this, [$n, saveData.schedule[scKey]]);\n }\n }\n });\n var $node = $this.find('.sc_bar');\n var currentNode = null; // move node.\n\n $node.draggable({\n grid: [setting.widthTimeX, 1],\n containment: $this.find('.sc_main'),\n helper: 'original',\n start: function start(event, ui) {\n var node = {};\n node.node = this;\n node.offsetTop = ui.position.top;\n node.offsetLeft = ui.position.left;\n node.currentTop = ui.position.top;\n node.currentLeft = ui.position.left;\n node.timeline = methods._getTimeLineNumber.apply($this, [currentNode, ui.position.top]);\n node.nowTimeline = node.timeline;\n currentNode = node;\n },\n\n /**\n *\n * @param {Event} event\n * @param {function} ui\n * @returns {boolean}\n */\n drag: function drag(event, ui) {\n $(this).data('dragCheck', true);\n\n if (!currentNode) {\n return false;\n }\n\n var $moveNode = $(this);\n var scKey = $moveNode.data('sc_key');\n\n var timelineNum = methods._getTimeLineNumber.apply($this, [currentNode, ui.position.top]); // eslint-disable-next-line no-param-reassign\n\n\n ui.position.left = Math.floor(ui.position.left / setting.widthTimeX) * setting.widthTimeX;\n\n if (currentNode.nowTimeline !== timelineNum) {\n // 現在のタイムライン\n currentNode.nowTimeline = timelineNum;\n }\n\n currentNode.currentTop = ui.position.top;\n currentNode.currentLeft = ui.position.left; // テキスト変更\n\n methods._rewriteBarText.apply($this, [$moveNode, saveData.schedule[scKey]]);\n\n return true;\n },\n // 要素の移動が終った後の処理\n stop: function stop() {\n $(this).data('dragCheck', false);\n currentNode = null;\n var $n = $(this);\n var scKey = $n.data('sc_key');\n var x = $n.position().left; // var w = $n.width();\n\n var start = saveData.tableStartTime + Math.floor(x / setting.widthTimeX) * setting.widthTime; // var end = saveData.tableStartTime + (Math.floor((x + w) / setting.widthTimeX) * setting.widthTime);\n\n var end = start + (saveData.schedule[scKey].endTime - saveData.schedule[scKey].startTime);\n saveData.schedule[scKey].start = methods.formatTime(start);\n saveData.schedule[scKey].end = methods.formatTime(end);\n saveData.schedule[scKey].startTime = start;\n saveData.schedule[scKey].endTime = end; // コールバックがセットされていたら呼出\n\n if (setting.onChange) {\n setting.onChange.apply($this, [$n, saveData.schedule[scKey]]);\n }\n }\n });\n var resizableHandles = ['e'];\n\n if (setting.resizableLeft) {\n resizableHandles.push('w');\n }\n\n $node.resizable({\n handles: resizableHandles.join(','),\n grid: [setting.widthTimeX, setting.timeLineY - setting.timeBorder],\n minWidth: setting.widthTimeX,\n containment: $this.find('.sc_main_scroll'),\n start: function start() {\n var $n = $(this);\n $n.data('resizeCheck', true);\n },\n resize: function resize(ev, ui) {\n // box-sizing: border-box; に対応\n ui.element.height(ui.size.height);\n ui.element.width(ui.size.width);\n },\n // 要素の移動が終った後の処理\n stop: function stop() {\n var $n = $(this);\n var scKey = $n.data('sc_key');\n var x = $n.position().left;\n var w = $n.outerWidth();\n var start = saveData.tableStartTime + Math.floor(x / setting.widthTimeX) * setting.widthTime;\n var end = saveData.tableStartTime + Math.floor((x + w) / setting.widthTimeX) * setting.widthTime;\n var timelineNum = saveData.schedule[scKey].timeline;\n saveData.schedule[scKey].start = methods.formatTime(start);\n saveData.schedule[scKey].end = methods.formatTime(end);\n saveData.schedule[scKey].startTime = start;\n saveData.schedule[scKey].endTime = end; // 高さ調整\n\n methods._resetBarPosition.apply($this, [timelineNum]); // テキスト変更\n\n\n methods._rewriteBarText.apply($this, [$n, saveData.schedule[scKey]]);\n\n $n.data('resizeCheck', false); // コールバックがセットされていたら呼出\n\n if (setting.onChange) {\n setting.onChange.apply($this, [$n, saveData.schedule[scKey]]);\n }\n }\n });\n\n if (setting.draggable === false) {\n $node.draggable('disable');\n }\n\n if (setting.resizable === false) {\n $node.resizable('disable');\n }\n\n return key;\n });\n },\n\n /**\n * スケジュール数の取得\n *\n * @param {number} n row number\n * @returns {number}\n */\n _getScheduleCount: function _getScheduleCount(n) {\n var $this = $(this);\n\n var saveData = methods._loadData.apply($this);\n\n var num = 0;\n\n for (var i in saveData.schedule) {\n if (saveData.schedule[i].timeline === n) {\n num++;\n }\n }\n\n return num;\n },\n\n /**\n * add rows\n *\n * @param timeline\n * @param row\n */\n _addRow: function _addRow(timeline, row) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var saveData = methods._loadData.apply($this);\n\n var id = $this.find('.sc_main .timeline').length;\n var html;\n html = '';\n html += '
';\n var $data = $(html);\n\n if (row.title) {\n $data.append('' + row.title + '');\n }\n\n if (row.subtitle) {\n $data.append('' + row.subtitle + '');\n } // event call\n\n\n if (setting.onInitRow) {\n setting.onInitRow.apply($this, [$data, row]);\n }\n\n $this.find('.sc_data_scroll').append($data);\n html = '';\n html += '
';\n var $timeline = $(html);\n\n for (var t = saveData.tableStartTime; t < saveData.tableEndTime; t += setting.widthTime) {\n var $tl = $('
');\n $tl.outerWidth(setting.widthTimeX);\n $tl.data('time', methods.formatTime(t));\n $tl.data('timeline', timeline);\n $timeline.append($tl);\n } // クリックイベント\n // left click\n\n\n $timeline.find('.tl').on('click', function () {\n if (setting.onScheduleClick) {\n setting.onScheduleClick.apply($this, [this, $(this).data('time'), $(this).data('timeline'), saveData.timeline[$(this).data('timeline')]]);\n }\n }); // right click\n\n $timeline.find('.tl').on('contextmenu', function () {\n if (setting.onScheduleClick) {\n setting.onScheduleClick.apply($this, [this, $(this).data('time'), $(this).data('timeline'), saveData.timeline[$(this).data('timeline')]]);\n }\n\n return false;\n });\n $this.find('.sc_main').append($timeline);\n saveData.timeline[timeline] = row;\n\n methods._saveData.apply($this, [saveData]);\n\n if (row.class && row.class !== '') {\n $this.find('.sc_data .timeline').eq(id).addClass(row.class);\n $this.find('.sc_main .timeline').eq(id).addClass(row.class);\n } // スケジュールタイムライン\n\n\n if (row.schedule) {\n for (var i in row.schedule) {\n var bdata = row.schedule[i];\n var s = bdata.start ? bdata.start : methods.calcStringTime(bdata.startTime);\n var e = bdata.end ? bdata.end : methods.calcStringTime(bdata.endTime);\n var data = {};\n data.start = s;\n data.end = e;\n\n if (bdata.text) {\n data.text = bdata.text;\n }\n\n data.timeline = timeline;\n data.data = {};\n\n if (bdata.data) {\n data.data = bdata.data;\n }\n\n methods._addScheduleData.apply($this, [id, data]);\n }\n } // 高さの調整\n\n\n methods._resetBarPosition.apply($this, [id]);\n\n $this.find('.sc_main .timeline').eq(id).droppable({\n accept: '.sc_bar',\n drop: function drop(ev, ui) {\n var node = ui.draggable;\n var scKey = node.data('sc_key');\n var nowTimelineNum = saveData.schedule[scKey].timeline;\n var timelineNum = $this.find('.sc_main .timeline').index(this); // タイムラインの変更\n\n saveData.schedule[scKey].timeline = timelineNum;\n node.appendTo(this); // 高さ調整\n\n methods._resetBarPosition.apply($this, [nowTimelineNum]);\n\n methods._resetBarPosition.apply($this, [timelineNum]);\n }\n }); // コールバックがセットされていたら呼出\n\n if (setting.onAppendRow) {\n $this.find('.sc_main .timeline').eq(id).find('.sc_bar').each(function () {\n var $n = $(this);\n var scKey = $n.data('sc_key');\n setting.onAppendRow.apply($this, [$n, saveData.schedule[scKey]]);\n });\n }\n });\n },\n\n /**\n * テキストの変更\n *\n * @param {jQuery} node\n * @param {Object} data\n */\n _rewriteBarText: function _rewriteBarText(node, data) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var saveData = methods._loadData.apply($this);\n\n var x = node.position().left; // var w = node.width();\n\n var start = saveData.tableStartTime + Math.floor(x / setting.widthTimeX) * setting.widthTime; // var end = saveData.tableStartTime + (Math.floor((x + w) / setting.widthTimeX) * setting.widthTime);\n\n var end = start + (data.endTime - data.startTime);\n var html = methods.formatTime(start) + '-' + methods.formatTime(end);\n $(node).find('.time').html(html);\n });\n },\n\n /**\n *\n * @param {Number} n\n */\n _resetBarPosition: function _resetBarPosition(n) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this); // 要素の並び替え\n\n\n var $barList = $this.find('.sc_main .timeline').eq(n).find('.sc_bar');\n var codes = [],\n check = [];\n var h = 0;\n var $e1, $e2;\n var c1, c2, s1, s2, e1, e2;\n var i;\n\n for (i = 0; i < $barList.length; i++) {\n codes[i] = {\n code: i,\n x: $($barList[i]).position().left\n };\n } // ソート\n\n\n codes.sort(function (a, b) {\n if (a.x < b.x) {\n return -1;\n }\n\n if (a.x > b.x) {\n return 1;\n }\n\n return 0;\n });\n\n for (i = 0; i < codes.length; i++) {\n c1 = codes[i].code;\n $e1 = $($barList[c1]);\n\n for (h = 0; h < check.length; h++) {\n var next = false;\n\n for (var j = 0; j < check[h].length; j++) {\n c2 = check[h][j];\n $e2 = $($barList[c2]);\n s1 = $e1.position().left;\n e1 = $e1.position().left + $e1.outerWidth();\n s2 = $e2.position().left;\n e2 = $e2.position().left + $e2.outerWidth();\n\n if (s1 < e2 && e1 > s2) {\n next = true;\n continue;\n }\n }\n\n if (!next) {\n break;\n }\n }\n\n if (!check[h]) {\n check[h] = [];\n }\n\n $e1.css({\n top: h * setting.timeLineY + setting.timeLinePaddingTop\n });\n check[h][check[h].length] = c1;\n } // 高さの調整\n\n\n methods._resizeRow.apply($this, [n, check.length]);\n });\n },\n\n /**\n *\n * @param n\n * @param height\n */\n _resizeRow: function _resizeRow(n, height) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var h = Math.max(height, 1);\n $this.find('.sc_data .timeline').eq(n).outerHeight(h * setting.timeLineY + setting.timeLineBorder + setting.timeLinePaddingTop + setting.timeLinePaddingBottom);\n $this.find('.sc_main .timeline').eq(n).outerHeight(h * setting.timeLineY + setting.timeLineBorder + setting.timeLinePaddingTop + setting.timeLinePaddingBottom);\n $this.find('.sc_main .timeline').eq(n).find('.sc_bgBar').each(function () {\n $(this).outerHeight($(this).closest('.timeline').outerHeight());\n });\n $this.find('.sc_data').outerHeight($this.find('.sc_main_box').outerHeight());\n });\n },\n\n /**\n * resizeWindow\n */\n _resizeWindow: function _resizeWindow() {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var saveData = methods._loadData.apply($this);\n\n var scWidth = $this.width();\n var scMainWidth = scWidth - setting.dataWidth - setting.verticalScrollbar;\n var cellNum = Math.floor((saveData.tableEndTime - saveData.tableStartTime) / setting.widthTime);\n $this.find('.sc_header_cell').width(setting.dataWidth);\n $this.find('.sc_data,.sc_data_scroll').width(setting.dataWidth);\n $this.find('.sc_header').width(scMainWidth);\n $this.find('.sc_main_box').width(scMainWidth);\n $this.find('.sc_header_scroll').width(setting.widthTimeX * cellNum);\n $this.find('.sc_main_scroll').width(setting.widthTimeX * cellNum);\n });\n },\n\n /**\n * move all cells of the right of the specified time line cell\n *\n * @param timeline\n * @param baseTimeLineCell\n * @param moveWidth\n */\n _moveSchedules: function _moveSchedules(timeline, baseTimeLineCell, moveWidth) {\n return this.each(function () {\n var $this = $(this);\n\n var setting = methods._loadSettingData.apply($this);\n\n var saveData = methods._loadData.apply($this);\n\n var $barList = $this.find('.sc_main .timeline').eq(timeline).find('.sc_bar');\n\n for (var i = 0; i < $barList.length; i++) {\n var $bar = $($barList[i]);\n\n if (baseTimeLineCell.position().left <= $bar.position().left) {\n var v1 = $bar.position().left + setting.widthTimeX * moveWidth;\n var v2 = Math.floor((saveData.tableEndTime - saveData.tableStartTime) / setting.widthTime) * setting.widthTimeX - $bar.outerWidth();\n $bar.css({\n left: Math.max(0, Math.min(v1, v2))\n });\n var scKey = $bar.data('sc_key');\n var start = saveData.tableStartTime + Math.floor($bar.position().left / setting.widthTimeX) * setting.widthTime;\n var end = start + (saveData.schedule[scKey].end - saveData.schedule[scKey].start);\n saveData.schedule[scKey].start = methods.formatTime(start);\n saveData.schedule[scKey].end = methods.formatTime(end);\n saveData.schedule[scKey].startTime = start;\n saveData.schedule[scKey].endTime = end;\n\n methods._rewriteBarText.apply($this, [$bar, saveData.schedule[scKey]]); // if setting\n\n\n if (setting.onChange) {\n setting.onChange.apply($this, [$bar, saveData.schedule[scKey]]);\n }\n }\n }\n\n methods._resetBarPosition.apply($this, [timeline]);\n });\n },\n\n /**\n * initialize\n */\n init: function init(options) {\n return this.each(function () {\n var $this = $(this);\n var config = $.extend({\n className: 'jq-schedule',\n rows: {},\n startTime: '07:00',\n endTime: '19:30',\n widthTimeX: 25,\n // 1cell辺りの幅(px)\n widthTime: 600,\n // 区切り時間(秒)\n timeLineY: 50,\n // timeline height(px)\n timeLineBorder: 1,\n // timeline height border\n timeBorder: 1,\n // border width\n timeLinePaddingTop: 0,\n timeLinePaddingBottom: 0,\n headTimeBorder: 1,\n // time border width\n dataWidth: 160,\n // data width\n verticalScrollbar: 0,\n // vertical scrollbar width\n bundleMoveWidth: 1,\n // width to move all schedules to the right of the clicked time cell\n draggable: true,\n resizable: true,\n resizableLeft: false,\n // event\n onInitRow: null,\n onChange: null,\n onClick: null,\n onAppendRow: null,\n onAppendSchedule: null,\n onScheduleClick: null\n }, options);\n\n methods._saveSettingData.apply($this, [config]);\n\n var tableStartTime = methods.calcStringTime(config.startTime);\n var tableEndTime = methods.calcStringTime(config.endTime);\n tableStartTime -= tableStartTime % config.widthTime;\n tableEndTime -= tableEndTime % config.widthTime;\n\n methods._saveData.apply($this, [{\n tableStartTime: tableStartTime,\n tableEndTime: tableEndTime\n }]);\n\n var html = '' + '
' + '\\n' + '
 
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
' + '\\n' + '
';\n $this.append(html);\n $this.addClass(config.className);\n $this.find('.sc_main_box').on('scroll', function () {\n $this.find('.sc_data_scroll').css('top', $(this).scrollTop() * -1);\n $this.find('.sc_header_scroll').css('left', $(this).scrollLeft() * -1);\n }); // add time cell\n // var cellNum = Math.floor((tableEndTime - tableStartTime) / config.widthTime);\n\n var beforeTime = -1;\n\n for (var t = tableStartTime; t < tableEndTime; t += config.widthTime) {\n if (beforeTime < 0 || Math.floor(beforeTime / 3600) !== Math.floor(t / 3600)) {\n html = '';\n html += '
' + methods.formatTime(t) + '
';\n var $time = $(html);\n var cn = Number(Math.min(Math.ceil((t + config.widthTime) / 3600) * 3600, tableEndTime) - t);\n var cellNum = Math.floor(cn / config.widthTime);\n $time.width(cellNum * config.widthTimeX);\n $this.find('.sc_header_scroll').append($time);\n beforeTime = t;\n }\n }\n\n $(window).on('resize', function () {\n methods._resizeWindow.apply($this);\n }).trigger('resize'); // addrow\n\n for (var i in config.rows) {\n methods._addRow.apply($this, [i, config.rows[i]]);\n }\n });\n }\n };\n /**\n *\n * @param {Object|string} method\n * @returns {jQuery|methods|*}\n */\n // eslint-disable-next-line no-param-reassign\n\n $.fn.timeSchedule = function (method) {\n // Method calling logic\n if (methods[method]) {\n return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); // eslint-disable-next-line no-else-return\n } else if (_typeof(method) === 'object' || !method) {\n return methods.init.apply(this, arguments);\n }\n\n $.error('Method ' + method + ' does not exist on jQuery.timeSchedule');\n return this;\n };\n})(jQuery);"]} \ No newline at end of file diff --git a/src/js/jq.schedule.js b/src/js/jq.schedule.js index 7f37914..acb221b 100644 --- a/src/js/jq.schedule.js +++ b/src/js/jq.schedule.js @@ -597,7 +597,7 @@ if (bdata.text) { data.text = bdata.text; } - data.timeline = i; + data.timeline = timeline; data.data = {}; if (bdata.data) { data.data = bdata.data;