diff --git a/css/style.css b/css/style.css index 64ef580..435b9f8 100644 --- a/css/style.css +++ b/css/style.css @@ -1,459 +1,458 @@ -.gantt, .gantt2 { - width: 100%; - margin: 20px auto; - border: 14px solid #ddd; - position: relative; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -.gantt:after { - content: "."; - visibility: hidden; - display: block; - height: 0; - clear: both; -} - -.fn-gantt { - width: 100%; -} - -.fn-gantt .fn-content { - overflow: hidden; - position: relative; - width: 100%; -} - - - - -/* === LEFT PANEL === */ - -.fn-gantt .leftPanel { - float: left; - width: 225px; - overflow: hidden; - border-right: 1px solid #DDD; - position: relative; - z-index: 20; -} - -.fn-gantt .row { - float: left; - height: 24px; - line-height: 24px; - margin-left: -1px; -} - -.fn-gantt .leftPanel .fn-label { - display: inline-block; - margin: 0 0 0 5px; - color: #484A4D; - width: 110px; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; -} - -.fn-gantt .leftPanel .row0 { - border-top: 1px solid #DDD; -} -.fn-gantt .leftPanel .name, .fn-gantt .leftPanel .desc { - float: left; - height: 23px; - margin: 0; - border-bottom: 1px solid #DDD; - background-color: #f6f6f6; -} - -.fn-gantt .leftPanel .name { - width: 110px; - font-weight: bold; -} - -.fn-gantt .leftPanel .desc { - width: 115px; -} - -.fn-gantt .leftPanel .fn-wide, .fn-gantt .leftPanel .fn-wide .fn-label { - width: 225px; -} - -.fn-gantt .spacer { - margin: -2px 0 1px 0; - border-bottom: none; - background-color: #f6f6f6; -} - - - - -/* === RIGHT PANEL === */ - -.fn-gantt .rightPanel { - overflow: hidden; -} - -.fn-gantt .dataPanel { - margin-left: 0px; - border-right: 1px solid #DDD; - background-image: url(../img/grid.png); - background-repeat: repeat; - background-position: 24px 24px; - position: relative; -} - -.fn-gantt .day, .fn-gantt .date { - overflow: visible; - width: 24px; - line-height: 24px; - text-align: center; - border-left: 1px solid #DDD; - border-bottom: 1px solid #DDD; - margin: -1px 0 0 -1px; - font-size: 11px; - color: #484a4d; - text-shadow: 0 1px 0 rgba(255,255,255,0.75); - text-align: center; -} - -.fn-gantt .holiday { - background-color: #ffd263; - height: 23px; - margin: 0 0 -1px -1px; -} - -.fn-gantt .today { - background-color: #fff8da; - height: 23px; - margin: 0 0 -1px -1px; - font-weight: bold; - text-align: center; -} - -.fn-gantt .sa, .fn-gantt .sn, .fn-gantt .wd { - height: 23px; - margin: 0 0 0 -1px; - text-align: center; -} - -.fn-gantt .sa, .fn-gantt .sn { - color: #939496; - background-color: #f5f5f5; - text-align: center; -} - -.fn-gantt .wd { - background-color: #f6f6f6; - text-align: center; -} - -.fn-gantt .rightPanel .month, .fn-gantt .rightPanel .year { - float: left; - overflow: hidden; - border-left: 1px solid #DDD; - border-bottom: 1px solid #DDD; - height: 23px; - margin: 0 0 0 -1px; - background-color: #f6f6f6; - font-weight: bold; - font-size: 11px; - color: #484a4d; - text-shadow: 0 1px 0 rgba(255,255,255,0.75); - text-align: center; -} - -.fn-gantt-hint { - border: 5px solid #edc332; - background-color: #fff5d4; - padding: 10px; - position: absolute; - display: none; - z-index: 11; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -.fn-gantt .bar { - background-color: #D0E4FD; - height: 18px; - margin: 0px 3px 3px 0px; - position: absolute; - z-index: 10; - text-align: center; - -webkit-box-shadow: 0 0 1px rgba(0,0,0,0.25) inset; - -moz-box-shadow: 0 0 1px rgba(0,0,0,0.25) inset; - box-shadow: 0 0 1px rgba(0,0,0,0.25) inset; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} - -.fn-gantt .bar .fn-label { - line-height: 18px; - font-weight: bold; - white-space: nowrap; - width: 100%; - text-overflow: ellipsis; - overflow: hidden; - text-shadow: 0 1px 0 rgba(255,255,255,0.4); - color: #414B57 !important; - text-align: center; - font-size: 11px; -} - -.fn-gantt .ganttRed { - background-color: #F9C4E1; -} -.fn-gantt .ganttRed .fn-label { - color: #78436D !important; -} - -.fn-gantt .ganttGreen { - background-color: #D8EDA3; -} -.fn-gantt .ganttGreen .fn-label { - color: #778461 !important; -} - -.fn-gantt .ganttGray { - background-color: #CCCCCC; -} -.fn-gantt .ganttGray .fn-label { - color: #626184 !important; -} - -.fn-gantt .ganttOrange { - background-color: #FCD29A; -} -.fn-gantt .ganttOrange .fn-label { - color: #714715 !important; -} - -.fn-gantt .depLine { - background-color: transparent; - position: absolute; - z-index: 9999; -} - -.fn-gantt .depLineSh { - margin-top: 2px; - margin-left: 2px; - opacity: 0.3; -} - -.fn-gantt .depStart, .fn-gantt .depEnd { - position: absolute; - width: 5px; - height: 5px; - -webkit-border-radius: 50%; - -moz-border-radius: 50%; - border-radius: 50%; - border: 2px solid #fff; - -webkit-box-shadow: 1px 1px 1px 0px #444; - box-shadow: 1px 1px 1px 0px #444; - z-index: 10001; -} - -/* === BOTTOM NAVIGATION === */ - -.fn-gantt .bottom { - clear: both; - background-color: #f6f6f6; -} -.fn-gantt .navigate { - border-top: 1px solid #DDD; - padding: 10px 0 10px 225px; -} - -.fn-gantt .navigate .nav-slider { - height: 20px; - display: inline-block; -} - -.fn-gantt .navigate .nav-slider-left, .fn-gantt .navigate .nav-slider-right { - text-align: center; - height: 20px; - display: inline-block; -} - -.fn-gantt .navigate .nav-slider-left { - float: left; -} - -.fn-gantt .navigate .nav-slider-right { - float: right; -} - -.fn-gantt .navigate .nav-slider-content { - text-align: left; - width: 160px; - height: 20px; - display: inline-block; - margin: 0 10px; -} - -.fn-gantt .navigate .nav-slider-bar, .fn-gantt .navigate .nav-slider-button { - position: absolute; - display: block; -} - -.fn-gantt .navigate .nav-slider-bar { - width: 155px; - height: 6px; - background-color: #838688; - margin: 8px 0 0 0; - -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.6) inset; - -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.6) inset; - box-shadow: 0 1px 3px rgba(0,0,0,0.6) inset; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} - -.fn-gantt .navigate .nav-slider-button { - width: 17px; - height: 60px; - background: url(../img/slider_handle.png) center center no-repeat; - left: 0px; - top: 0px; - margin: -26px 0 0 0; - cursor: pointer; -} - -.fn-gantt .navigate .page-number { - display: inline-block; - font-size: 10px; - height: 20px; -} - -.fn-gantt .navigate .page-number span { - color: #666666; - margin: 0 6px; - height: 20px; - line-height: 20px; - display: inline-block; -} - -.fn-gantt .navigate a:link, .fn-gantt .navigate a:visited, .fn-gantt .navigate a:active { - text-decoration: none; -} - -.fn-gantt .nav-link { - margin: 0 3px 0 0; - display: inline-block; - width: 20px; - height: 20px; - font-size: 0px; - background: #595959 url(../img/icon_sprite.png) !important; - border: 1px solid #454546; - cursor: pointer; - vertical-align: top; - -webkit-border-radius: 2px; - -moz-border-radius: 2px; - border-radius: 2px; - -webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 1px 1px rgba(0,0,0,0.2); - -moz-box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 1px 1px rgba(0,0,0,0.2); - box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 1px 1px rgba(0,0,0,0.2); - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.fn-gantt .nav-link:active { - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.25) inset, 0 1px 0 #FFF; - -moz-box-shadow: 0 1px 1px rgba(0,0,0,0.25) inset, 0 1px 0 #FFF; - box-shadow: 0 1px 1px rgba(0,0,0,0.25) inset, 0 1px 0 #FFF; -} - -.fn-gantt .navigate .nav-page-back { - background-position: 1px 0 !important; - margin: 0; -} - -.fn-gantt .navigate .nav-page-next { - background-position: 1px -16px !important; - margin-right: 15px; -} - -.fn-gantt .navigate .nav-slider .nav-page-next { - margin-right: 5px; -} - -.fn-gantt .navigate .nav-begin { - background-position: 1px -112px !important; -} - -.fn-gantt .navigate .nav-prev-week { - background-position: 1px -128px !important; -} - -.fn-gantt .navigate .nav-prev-day { - background-position: 1px -48px !important; -} - -.fn-gantt .navigate .nav-next-day { - background-position: 1px -64px !important; -} - -.fn-gantt .navigate .nav-next-week { - background-position: 1px -160px !important; -} - -.fn-gantt .navigate .nav-end { - background-position: 1px -144px !important; -} - -.fn-gantt .navigate .nav-zoomOut { - background-position: 1px -96px !important; -} - -.fn-gantt .navigate .nav-zoomIn { - background-position: 1px -80px !important; - margin-left: 15px; -} - -.fn-gantt .navigate .nav-now { - background-position: 1px -32px !important; -} - -.fn-gantt .navigate .nav-slider .nav-now { - margin-right: 5px; -} - -.fn-gantt-loader { - position: absolute; - width: 100%; - height: 100%; - left: 0; - top: 0; - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bf000000', endColorstr='#bf000000',GradientType=0 ); - background: rgba(0,0,0,0.75); - cursor: wait; - z-index: 30; -} -.fn-gantt-loader-spinner span { - position: absolute; - margin: auto; - top: 0; - right: 0; - bottom: 0; - left: 0; - width: 100%; - text-align: center; - height: 1em; - line-height: 1em; - color: #fff; - font-size: 1em; - font-weight: bold; -} - -.row:after { - clear: both; -} - +.gantt { + width: 100%; + margin: 20px auto; + border: 14px solid #ddd; + position: relative; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.gantt:after { + content: "."; + visibility: hidden; + display: block; + height: 0; + clear: both; +} + +.fn-gantt { + width: 100%; +} + +.fn-gantt *, +.fn-gantt *:after, +.fn-gantt *:before { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.fn-gantt .fn-content { + overflow: hidden; + position: relative; + width: 100%; +} + +.fn-gantt .row { + float: left; + height: 24px; + line-height: 24px; + margin: 0; +} + + +/* === LEFT PANEL === */ + +.fn-gantt .leftPanel { + float: left; + width: 225px; + overflow: hidden; + border-right: 1px solid #DDD; + position: relative; + z-index: 20; +} + +.fn-gantt .leftPanel .fn-label { + display: inline-block; + margin: 0 0 0 5px; + color: #484A4D; + width: 110px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} + +.fn-gantt .leftPanel .row { + border-bottom: 1px solid #DDD; +} + +.fn-gantt .leftPanel .name, +.fn-gantt .leftPanel .desc { + float: left; + height: 24px; + width: 50%; + background-color: #f6f6f6; +} + +.fn-gantt .leftPanel .name { + font-weight: bold; +} + +.fn-gantt .leftPanel .fn-wide, +.fn-gantt .leftPanel .fn-wide .fn-label { + width: 100%; +} + +.fn-gantt .leftPanel .spacer { + background-color: #f6f6f6; + width: 100%; +} + + +/* === RIGHT PANEL === */ + +.fn-gantt .rightPanel { + overflow: hidden; +} + +.fn-gantt .dataPanel { + margin-left: 0; + outline: 1px solid #DDD; + /* TODO: Replace image with gradient? + background-size: 24px 24px; + background-image: linear-gradient(to left, rgba(221, 221, 221, 0.7) 1px, transparent 1px), linear-gradient(to top, rgba(221, 221, 221, 0.7) 1px, transparent 1px); + */ + background-image: url(../img/grid.png); + background-repeat: repeat; + position: relative; +} + +.fn-gantt .row.header { + margin-right: -1px; + width: 100%; +} + +.fn-gantt .day, +.fn-gantt .date { + overflow: visible; + width: 24px; + line-height: 24px; + text-align: center; + border-right: 1px solid #DDD; + border-bottom: 1px solid #DDD; + font-size: 11px; + color: #484a4d; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75); + text-align: center; +} + +.fn-gantt .sa, +.fn-gantt .sn, +.fn-gantt .wd { + height: 24px; + text-align: center; +} + +.fn-gantt .sa, +.fn-gantt .sn { + color: #939496; + background-color: #f5f5f5; + text-align: center; +} + +.fn-gantt .wd { + background-color: #f6f6f6; + text-align: center; +} + +.fn-gantt .holiday { + background-color: #ffd263; + height: 24px; +} + +.fn-gantt .today { + background-color: #fff8da; + height: 24px; + font-weight: bold; + text-align: center; +} + +.fn-gantt .rightPanel .month, +.fn-gantt .rightPanel .year { + float: left; + overflow: hidden; + border-right: 1px solid #DDD; + border-bottom: 1px solid #DDD; + height: 24px; + background-color: #f6f6f6; + font-weight: bold; + font-size: 11px; + color: #484a4d; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75); + text-align: center; +} + +.fn-gantt-hint { + border: 5px solid #edc332; + background-color: #fff5d4; + padding: 10px; + position: absolute; + display: none; + z-index: 11; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.fn-gantt .bar { + background-color: #D0E4FD; + height: 18px; + margin: 0 3px 3px 0; + position: absolute; + z-index: 10; + text-align: center; + -webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.25) inset; + -moz-box-shadow: 0 0 1px rgba(0, 0, 0, 0.25) inset; + box-shadow: 0 0 1px rgba(0, 0, 0, 0.25) inset; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +.fn-gantt .bar .fn-label { + line-height: 18px; + font-weight: bold; + white-space: nowrap; + width: 100%; + text-overflow: ellipsis; + overflow: hidden; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); + color: #414B57 !important; + text-align: center; + font-size: 11px; +} + +.progress-bar { + position: absolute !important; + border-radius: 2px; + background-color: rgba(0, 0, 0, 0.1); + height: 100%; + z-index: 100; +} + +.above-progress { + z-index: 200 !important; +} + +.fn-gantt .ganttRed { + background-color: #F9C4E1; +} + +.fn-gantt .ganttRed .fn-label { + color: #78436D !important; +} + +.fn-gantt .ganttGreen { + background-color: #D8EDA3; +} + +.fn-gantt .ganttGreen .fn-label { + color: #778461 !important; +} + +.fn-gantt .ganttOrange { + background-color: #FCD29A; +} + +.fn-gantt .ganttOrange .fn-label { + color: #714715 !important; +} + + +/* === BOTTOM NAVIGATION === */ + +.fn-gantt .bottom { + clear: both; + background-color: #f6f6f6; + width: 100%; +} + +.fn-gantt .navigate { + border-top: 1px solid #DDD; + padding: 10px 0 10px 225px; +} + +.fn-gantt .navigate .nav-slider { + height: 20px; + display: inline-block; +} + +.fn-gantt .navigate .nav-slider-left, +.fn-gantt .navigate .nav-slider-right { + text-align: center; + height: 20px; + display: inline-block; +} + +.fn-gantt .navigate .nav-slider-left { + float: left; +} + +.fn-gantt .navigate .nav-slider-right { + float: right; +} + +.fn-gantt .navigate .nav-slider-content { + text-align: left; + width: 160px; + height: 20px; + display: inline-block; + margin: 0 10px; +} + +.fn-gantt .navigate .nav-slider-bar, +.fn-gantt .navigate .nav-slider-button { + position: absolute; + display: block; +} + +.fn-gantt .navigate .nav-slider-bar { + width: 155px; + height: 6px; + background-color: #838688; + margin: 8px 0 0 0; + -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) inset; + -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) inset; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) inset; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +.fn-gantt .navigate .nav-slider-button { + width: 17px; + height: 60px; + background: url(../img/slider_handle.png) center center no-repeat; + left: 0; + top: 0; + margin: -26px 0 0 0; + cursor: pointer; +} + +.fn-gantt .navigate .page-number { + display: inline-block; + font-size: 10px; + height: 20px; +} + +.fn-gantt .navigate .page-number span { + color: #666666; + margin: 0 6px; + height: 20px; + line-height: 20px; + display: inline-block; +} + +.fn-gantt .navigate a:link, +.fn-gantt .navigate a:visited, +.fn-gantt .navigate a:active { + text-decoration: none; +} + +.fn-gantt .nav-link { + margin: 0 3px 0 0; + display: inline-block; + width: 20px; + height: 20px; + font-size: 0; + background: #595959 url(../img/icon_sprite.png) !important; + border: 1px solid #454546; + cursor: pointer; + vertical-align: top; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 1px 1px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 1px 1px rgba(0, 0, 0, 0.2); + box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 1px 1px rgba(0, 0, 0, 0.2); + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.fn-gantt .nav-link:active { + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25) inset, 0 1px 0 #FFF; + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25) inset, 0 1px 0 #FFF; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25) inset, 0 1px 0 #FFF; +} + +.fn-gantt .navigate .nav-page-back { + background-position: 1px 0 !important; + margin: 0; +} + +.fn-gantt .navigate .nav-page-next { + background-position: 1px -16px !important; + margin-right: 15px; +} + +.fn-gantt .navigate .nav-slider .nav-page-next { + margin-right: 5px; +} + +.fn-gantt .navigate .nav-begin { + background-position: 1px -112px !important; +} + +.fn-gantt .navigate .nav-prev-week { + background-position: 1px -128px !important; +} + +.fn-gantt .navigate .nav-prev-day { + background-position: 1px -48px !important; +} + +.fn-gantt .navigate .nav-next-day { + background-position: 1px -64px !important; +} + +.fn-gantt .navigate .nav-next-week { + background-position: 1px -160px !important; +} + +.fn-gantt .navigate .nav-end { + background-position: 1px -144px !important; +} + +.fn-gantt .navigate .nav-zoomOut { + background-position: 1px -96px !important; +} + +.fn-gantt .navigate .nav-zoomIn { + background-position: 1px -80px !important; + margin-left: 15px; +} + +.fn-gantt .navigate .nav-now { + background-position: 1px -32px !important; +} + +.fn-gantt .navigate .nav-slider .nav-now { + margin-right: 5px; +} + +.fn-gantt-loader { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#bf000000', endColorstr='#bf000000', GradientType=0); + background: rgba(0, 0, 0, 0.75); + cursor: wait; + z-index: 30; +} + +.fn-gantt-loader-spinner span { + position: absolute; + margin: auto; + top: 0; + right: 0; + bottom: 0; + left: 0; + width: 100%; + text-align: center; + height: 1em; + line-height: 1em; + color: #fff; + font-size: 1em; + font-weight: bold; +} + +.row:after { + clear: both; +} \ No newline at end of file diff --git a/index.html b/index.html index c24091b..0652524 100644 --- a/index.html +++ b/index.html @@ -1,563 +1,649 @@ - - - - jQuery.Gantt - - - - - - - - - -
- -

- jQuery.Gantt - — Draw Gantt charts with the famous jQuery ease of development -

- -

Contributors

- - -

- Example -

- -
- - - -

- Gantt Configuration -

- - -
-$(".selector").gantt({
-	source: "ajax/data.json",
-	scale: "weeks",
-	minScale: "weeks",
-	maxScale: "months",
-	onItemClick: function(data) {
-		alert("Item clicked - show some details");
-	},
-	onAddClick: function(dt, rowId) {
-		alert("Empty space clicked - add an item!");
-	},
-	onRender: function() {
-		console.log("chart rendered");
-	}
-});
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Default - - Accepts Type -
- source - - [] - - Array, String (url) -
- itemsPerPage - - 7 - - Number -
- months - - ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] - - Array -
- dow - - ["S", "M", "T", "W", "T", "F", "S"] - - Array -
- navigate - - "buttons" - - String ("buttons","scroll") -
- scale - - "days" - - String -
- maxScale - - "months" - - String -
- minScale - - "hours" - - String -
- waitText - - "Please Wait..." - - String -
- onItemClick - - function (data) { return; } - a JS Function that gets called when clicking on a Gantt-Item.
The parameter passed to the function is the dataObj of the item
- onAddClick - function (dt, rowId) { return; } - a JS Function that gets called when clicking on a Gantt-Item.
The parameter passed to the function is the DateTime in ms for the clicked Cell, and the ID if the source object (row)
- onRender - function () { return; } - a JS Function called whenever the chart is (re)rendered
- useCookie - false - indicates if cookies should be used to track the chart's state (scale, scrollposition) between postpacks
- jquery.cookie.js needs to be referenced for this to work
- scrollToToday - true - Boolean
- - - - -

- Source Configuration -

- -
-source: [{
-	name: "Example",
-	desc: "Lorem ipsum dolor sit amet.",
-	values: [ ... ]
-}]
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Default - - Accepts Type - - Meaning -
- name - - null - - String - - Bold value in the left-most column of the gantt row. -
- desc - - null - - String - - Secondary value in the gantt row. -
- values - - null - - Array - - Collection of date ranges for gantt items. See next table. -
- - -

- Value Configuration -

- -
-values: [{
-	to: "/Date(1328832000000)/",
-	from: "/Date(1333411200000)/",
-	desc: "Something",
-	label: "Example Value",
-	customClass: "ganttRed",
-	dataObj: foo.bar[i]
-}]
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Parameter - - Accepts Type - - Meaning -
- to - - String (Date) - - - -
- from - - String (Date) - - - -
- desc - - String - - Text that appears on hover, I think? -
- label - - String - - Appears on the gantt item. -
- customClass - - String ("ganttBlue", "ganttGreen", "ganttRed", "ganttOrange", "ganttGray", "MyClass") - - Custom class to be applied to the gantt item. -
- dataObj - - All - - A data object that is applied directly to the gantt item. -
- -
- - - - - - - - + + + + + jQuery.Gantt + + + + + + + + + + + +
+ +

+ jQuery.Gantt + — Draw Gantt charts with the famous jQuery ease of development +

+ +

Contributors

+ + +

+ Example +

+ +
+ + + +

+ Gantt Configuration +

+ + +
+$(".selector").gantt({
+    source: "ajax/data.json",
+    scale: "weeks",
+    minScale: "weeks",
+    maxScale: "months",
+    onItemClick: function(data) {
+        alert("Item clicked - show some details");
+    },
+    onAddClick: function(dt, rowId) {
+        alert("Empty space clicked - add an item!");
+    },
+    onRender: function() {
+        console.log("chart rendered");
+    }
+});
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Default + + Type +
+ source + + [] + + Array, string (url) +
+ itemsPerPage + + 7 + + number +
+ months + + ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] + + Array (12 strings representing the months of the year) +
+ dow + + ["S", "M", "T", "W", "T", "F", "S"] + + Array (7 strings representing the days of the week) +
+ holidays + + undefined + + Array of numbers (ms), date strings (see formats), or Date objects +
+ navigate + + "buttons" + + string ("buttons", "scroll") +
+ scale + + "days" + + string ("months", "weeks", "days", "hours") +
+ maxScale + + "months" + + string ("months", "weeks", "days", "hours") +
+ minScale + + "hours" + + string ("months", "weeks", "days", "hours") +
+ waitText + + "Please wait..." + + string +
+ onItemClick + + function (data) { return; } + Function called when clicking on a Gantt item.
The parameter passed to the function is the dataObj of the source item, if one was provided.
+ onAddClick + function (dt, rowId) { return; } + Function called when clicking on empty space inside the Gantt data panel.
The parameter passed to the function is the date/time in milliseconds for the clicked cell, and the ID of the source object (row), if one was provided.
+ onRender + $.noop + Function called whenever the chart is (re)rendered
+ useCookie + false + indicates whether or not cookies should be used to save and restore the chart's view state (scale, scroll position) between page loads; + jquery.cookie needs to be referenced for this to work
+ cookieKey + "jquery.fn.gantt" + The prefix used when storing cookies (depends on useCookie being set to true)
+ scrollToToday + true + Boolean
+ + + + +

+ Source Configuration +

+ +
+source: [
+    {
+        name: "Example",
+        desc: "Lorem ipsum dolor sit amet.",
+        values: [ ... ]
+        id: 1,
+        cssClass: "redLabel"
+    },
+    ... // more rows
+]
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Type + + Description +
+ name + + string + + Optional primary label for this row of values; appears in the leftmost column of the row. +
+ desc + + string + + Optional secondary label for this row of the Gantt. +
+ values + + Array + + Sequence of date ranges for each row of the Gantt. See table below. +
+ id + + string or number + + Optional value to be passed as second parameter to onAddClick() callback when triggered. +
+ cssClass + + string + + Optional space-separated class names to be applied to this row's labels. +
+ + +

+ Value Configuration +

+ +
+values: [
+    {
+        from: '2012-02-10',
+        to: '2012-04-03',
+        label: "Example Value",
+        desc: "Something",
+        customClass: "ganttRed",
+        dataObj: foo.bar[i]
+    },
+    ... // more items for the row (though Gantt charts traditionally have only one item per row)
+]
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Type + + Description +
+ from + + number (ms), string (see formats) + + Start date/time of the Gantt item. +
+ to + + number (ms), string (see formats) + + End date/time of the Gantt item. +
+ label + + string + + Optional label/name of the Gantt item. +
+ desc + + string + + Optional description of the Gantt item, used as HTML content of hover "hint"). +
+ customClass + + string + + Optional space-separated class names to be applied to the Gantt item. +
+ dataObj + + Any + + Optional data object that is stored directly on the Gantt item. +
+ +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/js/jquery.fn.gantt.js b/js/jquery.fn.gantt.js index e2a7d0a..5b7d1f0 100644 --- a/js/jquery.fn.gantt.js +++ b/js/jquery.fn.gantt.js @@ -1,1789 +1,1723 @@ -// jQuery Gantt Chart -// ================== - -// Basic usage: - -// $(".selector").gantt({ -// source: "ajax/data.json", -// scale: "weeks", -// minScale: "weeks", -// maxScale: "months", -// onItemClick: function(data) { -// alert("Item clicked - show some details"); -// }, -// onAddClick: function(dt, rowId) { -// alert("Empty space clicked - add an item!"); -// }, -// onRender: function() { -// console.log("chart rendered"); -// } -// }); - -// -/*jshint shadow:true, unused:false, laxbreak:true, evil:true*/ -/*globals jQuery, alert*/ -(function ($) { - - "use strict"; - - $.fn.gantt = function (options) { - - var cookieKey = "jquery.fn.gantt"; - var scales = ["hours", "days", "weeks", "months"]; - //Default settings - var settings = { - source: [], - itemsPerPage: 7, - months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], - dow: ["S", "M", "T", "W", "T", "F", "S"], - startPos: new Date(), - navigate: "buttons", - scale: "days", - useCookie: false, - maxScale: "months", - minScale: "hours", - waitText: "Please wait...", - onItemClick: function (data) { return; }, - onAddClick: function (data) { return; }, - onRender: function() { return; }, - onDataLoadFailed: function(data) { return; }, - scrollToToday: true - }; - - /** - * Extend options with default values - */ - if (options) { - $.extend(settings, options); - } - - // can't use cookie if don't have `$.cookie` - settings.useCookie = settings.useCookie && $.isFunction($.cookie); - - // custom selector `:findday` used to match on specified day in ms. - // - // The selector is passed a date in ms and elements are added to the - // selection filter if the element date matches, as determined by the - // id attribute containing a parsable date in ms. - $.extend($.expr[":"], { - findday: function (a, i, m) { - var cd = new Date(parseInt(m[3], 10)); - var id = $(a).attr("id"); - id = id ? id : ""; - var si = id.indexOf("-") + 1; - var ed = new Date(parseInt(id.substring(si, id.length), 10)); - cd = new Date(cd.getFullYear(), cd.getMonth(), cd.getDate()); - ed = new Date(ed.getFullYear(), ed.getMonth(), ed.getDate()); - return cd.getTime() === ed.getTime(); - } - }); - // custom selector `:findweek` used to match on specified week in ms. - $.extend($.expr[":"], { - findweek: function (a, i, m) { - var cd = new Date(parseInt(m[3], 10)); - var id = $(a).attr("id"); - id = id ? id : ""; - var si = id.indexOf("-") + 1; - cd = cd.getFullYear() + "-" + cd.getDayForWeek().getWeekOfYear(); - var ed = id.substring(si, id.length); - return cd === ed; - } - }); - // custom selector `:findmonth` used to match on specified month in ms. - $.extend($.expr[":"], { - findmonth: function (a, i, m) { - var cd = new Date(parseInt(m[3], 10)); - cd = cd.getFullYear() + "-" + cd.getMonth(); - var id = $(a).attr("id"); - id = id ? id : ""; - var si = id.indexOf("-") + 1; - var ed = id.substring(si, id.length); - return cd === ed; - } - }); - - // Date prototype helpers - // ====================== - - // `getWeekId` returns a string in the form of 'dh-YYYY-WW', where WW is - // the week # for the year. - // It is used to add an id to the week divs - Date.prototype.getWeekId = function () { - var y = this.getFullYear(); - var w = this.getDayForWeek().getWeekOfYear(); - var m = this.getMonth(); - if (m === 11 && w === 1) { - y++; - } - return 'dh-' + y + "-" + w; - }; - - // `getRepDate` returns the seconds since the epoch for a given date - // depending on the active scale - Date.prototype.getRepDate = function () { - switch (settings.scale) { - case "hours": - return this.getTime(); - case "weeks": - return this.getDayForWeek().getTime(); - case "months": - return new Date(this.getFullYear(), this.getMonth(), 1).getTime(); - default: - return this.getTime(); - } - }; - - // `getDayOfYear` returns the day number for the year - Date.prototype.getDayOfYear = function () { - var fd = new Date(this.getFullYear(), 0, 0); - var sd = new Date(this.getFullYear(), this.getMonth(), this.getDate()); - return Math.ceil((sd - fd) / 86400000); - }; - - // `getWeekOfYear` returns the week number for the year - Date.prototype.getWeekOfYear = function () { - var ys = new Date(this.getFullYear(), 0, 1); - var sd = new Date(this.getTime()); - // Find Thursday of this week starting on Monday - sd.setDate(sd.getDate() + 4 - (sd.getDay() || 7)); - return Math.floor(Math.round((sd - ys) / 86400000) / 7) + 1; - }; - - // `getDaysInMonth` returns the number of days in a month - Date.prototype.getDaysInMonth = function () { - return 32 - new Date(this.getFullYear(), this.getMonth(), 32).getDate(); - }; - - // `hasWeek` returns `true` if the date resides on a week boundary - // **????????????????? Don't know if this is true** - Date.prototype.hasWeek = function () { - var df = new Date(this.valueOf()); - df.setDate(df.getDate() - df.getDay()); - var dt = new Date(this.valueOf()); - dt.setDate(dt.getDate() + (6 - dt.getDay())); - - if (df.getMonth() === dt.getMonth()) { - return true; - } else { - return (df.getMonth() === this.getMonth() && dt.getDate() < 4) || (df.getMonth() !== this.getMonth() && dt.getDate() >= 4); - } - }; - - // `getDayForWeek` returns the Date object for the starting date of - // the week # for the year - Date.prototype.getDayForWeek = function () { - var df = new Date(this.valueOf()); - df.setDate(df.getDate() - df.getDay()); - var dt = new Date(this.valueOf()); - dt.setDate(dt.getDate() + (6 - dt.getDay())); - if ((df.getMonth() === dt.getMonth()) || (df.getMonth() !== dt.getMonth() && dt.getDate() >= 4)) { - return new Date(dt.setDate(dt.getDate() - 3)); - } else { - return new Date(df.setDate(df.getDate() + 3)); - } - }; - - // fixes https://github.com/taitems/jQuery.Gantt/issues/62 - function ktkGetNextDate(currentDate, scaleStep) { - for(var minIncrements = 1;; minIncrements++) { - var nextDate = new Date(currentDate); - nextDate.setHours(currentDate.getHours() + scaleStep * minIncrements); - - if (nextDate.getTime() !== currentDate.getTime()) { - return nextDate; - } - - // If code reaches here, it's because current didn't really increment (invalid local time) because of daylight-saving adjustments - // => retry adding 2, 3, 4 hours, and so on (until nextDate > current) - } - } - - // Grid management - // =============== - - // Core object is responsible for navigation and rendering - var core = { - // Return the element whose topmost point lies under the given point - // Normalizes for IE - elementFromPoint: function (x, y) { - - if (!$.support.boxModel) { - x -= $(document).scrollLeft(); - y -= $(document).scrollTop(); - } else { - x -= window.pageXOffset; - y -= window.pageYOffset; - } - - return document.elementFromPoint(x, y); - }, - - // **Create the chart** - create: function (element) { - - // Initialize data with a json object or fetch via an xhr - // request depending on `settings.source` - if (typeof settings.source !== "string") { - element.data = settings.source; - core.init(element); - } else { - $.getJSON(settings.source, function (jsData) { - element.data = jsData; - core.init(element); - }); - } - }, - - // **Setup the initial view** - // Here we calculate the number of rows, pages and visible start - // and end dates once the data is ready - init: function (element) { - try { - element.rowsNum = element.data.length; - element.pageCount = Math.ceil(element.rowsNum / settings.itemsPerPage); - element.rowsOnLastPage = element.rowsNum - (Math.floor(element.rowsNum / settings.itemsPerPage) * settings.itemsPerPage); - - element.dateStart = tools.getMinDate(element); - element.dateEnd = tools.getMaxDate(element); - - - /* core.render(element); */ - core.waitToggle(element, true, function () { core.render(element); }); - } - catch(e) { - if ( element.data === null || (typeof element.data === 'object' && element.data.length === 0 ) ) - settings.onDataLoadFailed($(this).data("dataObj")); - } - }, - - // **Render the grid** - render: function (element) { - var content = $('
'); - var $leftPanel = core.leftPanel(element); - content.append($leftPanel); - var $rightPanel = core.rightPanel(element, $leftPanel); - var mLeft, hPos; - - content.append($rightPanel); - content.append(core.navigation(element)); - - var $dataPanel = $rightPanel.find(".dataPanel"); - - element.gantt = $('
').append(content); - - $(element).html(element.gantt); - - element.scrollNavigation.panelMargin = parseInt($dataPanel.css("margin-left").replace("px", ""), 10); - element.scrollNavigation.panelMaxPos = ($dataPanel.width() - $rightPanel.width()); - - element.scrollNavigation.canScroll = ($dataPanel.width() > $rightPanel.width()); - - core.markNow(element); - core.fillData(element, $dataPanel, $leftPanel); - - // Set a cookie to record current position in the view - if (settings.useCookie) { - var sc = $.cookie(this.cookieKey + "ScrollPos"); - if (sc) { - element.hPosition = sc; - } - } - - // Scroll the grid to today's date - if (settings.scrollToToday) { - core.navigateTo(element, 'now'); - core.scrollPanel(element, 0); - // or, scroll the grid to the left most date in the panel - } else { - if (element.hPosition !== 0) { - if (element.scaleOldWidth) { - mLeft = ($dataPanel.width() - $rightPanel.width()); - hPos = mLeft * element.hPosition / element.scaleOldWidth; - hPos = hPos > 0 ? 0 : hPos; - $dataPanel.css({ "margin-left": hPos + "px" }); - element.scrollNavigation.panelMargin = hPos; - element.hPosition = hPos; - element.scaleOldWidth = null; - } else { - $dataPanel.css({ "margin-left": element.hPosition + "px" }); - element.scrollNavigation.panelMargin = element.hPosition; - } - core.repositionLabel(element); - } - } - - $dataPanel.css({ height: $leftPanel.height() }); - core.waitToggle(element, false); - settings.onRender(); - }, - - // Create and return the left panel with labels - leftPanel: function (element) { - /* Left panel */ - var ganttLeftPanel = $('
') - .append($('
') - .css("height", tools.getCellSize() * element.headerRows + "px") - .css("width", "100%")); - - var entries = []; - $.each(element.data, function (i, entry) { - if (i >= element.pageNum * settings.itemsPerPage && i < (element.pageNum * settings.itemsPerPage + settings.itemsPerPage)) { - entries.push('
'); - entries.push('' + (entry.name || '') + ''); - entries.push('
'); - - if (entry.desc) { - entries.push('
'); - entries.push('' + entry.desc + ''); - entries.push('
'); - } - - } - }); - ganttLeftPanel.append(entries.join("")); - return ganttLeftPanel; - }, - - // Create and return the data panel element - dataPanel: function (element, width) { - var dataPanel = $('
'); - - // Handle mousewheel events for scrolling the data panel - var mousewheelevt = (/Firefox/i.test(navigator.userAgent)) ? "DOMMouseScroll" : "mousewheel"; - if (document.attachEvent) { - element.attachEvent("on" + mousewheelevt, function (e) { core.wheelScroll(element, e); }); - } else if (document.addEventListener) { - element.addEventListener(mousewheelevt, function (e) { core.wheelScroll(element, e); }, false); - } - - // Handle click events and dispatch to registered `onAddClick` - // function - dataPanel.click(function (e) { - - e.stopPropagation(); - var corrX/* <- never used? */, corrY; - var leftpanel = $(element).find(".fn-gantt .leftPanel"); - var datapanel = $(element).find(".fn-gantt .dataPanel"); - switch (settings.scale) { - case "weeks": - corrY = tools.getCellSize() * 2; - break; - case "months": - corrY = tools.getCellSize(); - break; - case "hours": - corrY = tools.getCellSize() * 4; - break; - case "days": - corrY = tools.getCellSize() * 3; - break; - default: - corrY = tools.getCellSize() * 2; - break; - } - - /* Adjust, so get middle of elm - corrY -= Math.floor(tools.getCellSize() / 2); - */ - - // Find column where click occurred - var col = core.elementFromPoint(e.pageX, datapanel.offset().top + corrY); - // Was the label clicked directly? - if (col.className === "fn-label") { - col = $(col.parentNode); - } else { - col = $(col); - } - - var dt = col.attr("repdate"); - // Find row where click occurred - var row = core.elementFromPoint(leftpanel.offset().left + leftpanel.width() - 10, e.pageY); - // Was the lable clicked directly? - if (row.className.indexOf("fn-label") === 0) { - row = $(row.parentNode); - } else { - row = $(row); - } - var rowId = row.data().id; - - // Dispatch user registered function with the DateTime in ms - // and the id if the clicked object is a row - settings.onAddClick(dt, rowId); - }); - return dataPanel; - }, - - // Creates and return the right panel containing the year/week/day - // header - rightPanel: function (element, leftPanel /* <- never used? */) { - - var range = null; - // Days of the week have a class of one of - // `sn` (Sunday), `sa` (Saturday), or `wd` (Weekday) - var dowClass = ["sn", "wd", "wd", "wd", "wd", "wd", "sa"]; - //TODO: was someone planning to allow styles to stretch to the bottom of the chart? - //var gridDowClass = [" sn", "", "", "", "", "", " sa"]; - - var yearArr = ['
']; - var daysInYear = 0; - - var monthArr = ['
']; - var daysInMonth = 0; - - var dayArr = []; - - var hoursInDay = 0; - - var dowArr = []; - - var horArr = []; - - - var today = new Date(); - today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); - var holidays = settings.holidays ? settings.holidays.join() : ''; - - // Setup the headings based on the chosen `settings.scale` - switch (settings.scale) { - // **Hours** - case "hours": - - range = tools.parseTimeRange(element.dateStart, element.dateEnd, element.scaleStep); - - var year = range[0].getFullYear(); - var month = range[0].getMonth(); - var day = range[0]; - - for (var i = 0, len = range.length; i < len; i++) { - var rday = range[i]; - - // Fill years - var rfy = rday.getFullYear(); - if (rfy !== year) { - yearArr.push( - ('
' - + year - + '
')); - - year = rfy; - daysInYear = 0; - } - daysInYear++; - - - // Fill months - var rm = rday.getMonth(); - if (rm !== month) { - monthArr.push( - ('
' - + settings.months[month] - + '
')); - - month = rm; - daysInMonth = 0; - } - daysInMonth++; - - - // Fill days & hours - - var rgetDay = rday.getDay(); - var getDay = day.getDay(); - var day_class = dowClass[rgetDay]; - var getTime = day.getTime(); - if (holidays.indexOf((new Date(rday.getFullYear(), rday.getMonth(), rday.getDate())).getTime()) > -1) { - day_class = "holiday"; - } - if (rgetDay !== getDay) { - - var day_class2 = (today - day === 0) ? ' today' : (holidays.indexOf(getTime) > -1) ? "holiday" : dowClass[getDay]; - - dayArr.push('
' - + '
' + day.getDate() + '
'); - dowArr.push('
' - + '
' + settings.dow[getDay] + '
'); - - day = rday; - hoursInDay = 0; - } - hoursInDay++; - - horArr.push('
' - + rday.getHours() - + '
'); - } - // Last year - yearArr.push( - '
' - + year - + '
'); - - // Last month - monthArr.push( - '
' - + settings.months[month] - + '
'); - - var day_class = dowClass[day.getDay()]; - - if (holidays.indexOf((new Date(day.getFullYear(), day.getMonth(), day.getDate())).getTime()) > -1) { - day_class = "holiday"; - } - - dayArr.push('
' - + '
' + day.getDate() + '
'); - - dowArr.push('
' - + '
' + settings.dow[day.getDay()] + '
'); - - var dataPanel = core.dataPanel(element, range.length * tools.getCellSize()); - - - // Append panel elements - dataPanel.append(yearArr.join("")); - dataPanel.append(monthArr.join("")); - dataPanel.append($('
').html(dayArr.join(""))); - dataPanel.append($('
').html(dowArr.join(""))); - dataPanel.append($('
').html(horArr.join(""))); - - break; - - // **Weeks** - case "weeks": - range = tools.parseWeeksRange(element.dateStart, element.dateEnd); - yearArr = ['
']; - monthArr = ['
']; - var year = range[0].getFullYear(); - var month = range[0].getMonth(); - var day = range[0]; - - for (var i = 0, len = range.length; i < len; i++) { - var rday = range[i]; - - // Fill years - if (rday.getFullYear() !== year) { - yearArr.push( - ('
' - + year - + '
')); - year = rday.getFullYear(); - daysInYear = 0; - } - daysInYear++; - - // Fill months - if (rday.getMonth() !== month) { - monthArr.push( - ('
' - + settings.months[month] - + '
')); - month = rday.getMonth(); - daysInMonth = 0; - } - daysInMonth++; - - // Fill weeks - dayArr.push('
' - + '
' + rday.getWeekOfYear() + '
'); - } - - - // Last year - yearArr.push( - '
' - + year - + '
'); - - // Last month - monthArr.push( - '
' - + settings.months[month] - + '
'); - - var dataPanel = core.dataPanel(element, range.length * tools.getCellSize()); - - dataPanel.append(yearArr.join("") + monthArr.join("") + dayArr.join("") + (dowArr.join(""))); - - break; - - // **Months** - case 'months': - range = tools.parseMonthsRange(element.dateStart, element.dateEnd); - - var year = range[0].getFullYear(); - var month = range[0].getMonth(); - var day = range[0]; - - for (var i = 0, len = range.length; i < len; i++) { - var rday = range[i]; - - // Fill years - if (rday.getFullYear() !== year) { - yearArr.push( - ('
' - + year - + '
')); - year = rday.getFullYear(); - daysInYear = 0; - } - daysInYear++; - monthArr.push('
' + (1 + rday.getMonth()) + '
'); - } - - - // Last year - yearArr.push( - '
' - + year - + '
'); - - // Last month - monthArr.push( - '
' - + settings.months[month] - + '
'); - - var dataPanel = core.dataPanel(element, range.length * tools.getCellSize()); - - // Append panel elements - dataPanel.append(yearArr.join("")); - dataPanel.append(monthArr.join("")); - dataPanel.append($('
').html(dayArr.join(""))); - dataPanel.append($('
').html(dowArr.join(""))); - - break; - - // **Days (default)** - default: - range = tools.parseDateRange(element.dateStart, element.dateEnd); - - var dateBefore = ktkGetNextDate(range[0], -1); - var year = dateBefore.getFullYear(); - var month = dateBefore.getMonth(); - var day = dateBefore; // <- never used? - - for (var i = 0, len = range.length; i < len; i++) { - var rday = range[i]; - - // Fill years - if (rday.getFullYear() !== year) { - yearArr.push( - ('
' - + year - + '
')); - year = rday.getFullYear(); - daysInYear = 0; - } - daysInYear++; - - - // Fill months - if (rday.getMonth() !== month) { - monthArr.push( - ('
' - + settings.months[month] - + '
')); - month = rday.getMonth(); - daysInMonth = 0; - } - daysInMonth++; - - var getDay = rday.getDay(); - var day_class = dowClass[getDay]; - if (holidays.indexOf((new Date(rday.getFullYear(), rday.getMonth(), rday.getDate())).getTime()) > -1) { - day_class = "holiday"; - } - - dayArr.push('
' - + '
' + rday.getDate() + '
'); - dowArr.push('
' - + '
' + settings.dow[getDay] + '
'); - } //for - - - // Last year - yearArr.push( - '
' - + year - + '
'); - - // Last month - monthArr.push( - '
' - + settings.months[month] - + '
'); - - var dataPanel = core.dataPanel(element, range.length * tools.getCellSize()); - - - // Append panel elements - - dataPanel.append(yearArr.join("")); - dataPanel.append(monthArr.join("")); - dataPanel.append($('
').html(dayArr.join(""))); - dataPanel.append($('
').html(dowArr.join(""))); - - break; - } - - return $('
').append(dataPanel); - }, - - // **Navigation** - navigation: function (element) { - var ganttNavigate = null; - // Scrolling navigation is provided by setting - // `settings.navigate='scroll'` - if (settings.navigate === "scroll") { - ganttNavigate = $('