jsgantt-improved
Advanced tools
Comparing version 1.8.1 to 1.8.2
@@ -5,2 +5,4 @@ "use strict"; | ||
var events_1 = require("./events"); | ||
var utils_1 = require("./utils"); | ||
var task_1 = require("./task"); | ||
// Recursively process task tree ... set min, max dates of parent tasks and identfy task level. | ||
@@ -45,3 +47,3 @@ exports.processRows = function (pList, pID, pRow, pLevel, pOpen, pUseSort) { | ||
pList[i].setGroup(2); | ||
JSGantt.processRows(vList, pList[i].getID(), i, vLevel + 1, vVisible, 0); | ||
exports.processRows(vList, pList[i].getID(), i, vLevel + 1, vVisible, 0); | ||
} | ||
@@ -76,3 +78,3 @@ if (vMinSet == 0 || pList[i].getStart() < vMinDate) { | ||
if (pID == 0 && pUseSort == 1) { | ||
JSGantt.sortTasks(pList, 0, 0); | ||
task_1.sortTasks(pList, 0, 0); | ||
pList.sort(function (a, b) { return a.getSortIdx() - b.getSortIdx(); }); | ||
@@ -85,3 +87,3 @@ } | ||
vComb = true; | ||
JSGantt.sortTasks(pList, pList[i].getID(), pList[i].getSortIdx() + 1); | ||
task_1.sortTasks(pList, pList[i].getID(), pList[i].getSortIdx() + 1); | ||
} | ||
@@ -122,15 +124,15 @@ } | ||
var vDateInputFormat = 'yyyy-mm-dd'; | ||
var vDateTaskTableDisplayFormat = JSGantt.parseDateFormatStr('dd/mm/yyyy'); | ||
var vDateTaskDisplayFormat = JSGantt.parseDateFormatStr('dd month yyyy'); | ||
var vHourMajorDateDisplayFormat = JSGantt.parseDateFormatStr('day dd month yyyy'); | ||
var vHourMinorDateDisplayFormat = JSGantt.parseDateFormatStr('HH'); | ||
var vDayMajorDateDisplayFormat = JSGantt.parseDateFormatStr('dd/mm/yyyy'); | ||
var vDayMinorDateDisplayFormat = JSGantt.parseDateFormatStr('dd'); | ||
var vWeekMajorDateDisplayFormat = JSGantt.parseDateFormatStr('yyyy'); | ||
var vWeekMinorDateDisplayFormat = JSGantt.parseDateFormatStr('dd/mm'); | ||
var vMonthMajorDateDisplayFormat = JSGantt.parseDateFormatStr('yyyy'); | ||
var vMonthMinorDateDisplayFormat = JSGantt.parseDateFormatStr('mon'); | ||
var vQuarterMajorDateDisplayFormat = JSGantt.parseDateFormatStr('yyyy'); | ||
var vQuarterMinorDateDisplayFormat = JSGantt.parseDateFormatStr('qq'); | ||
var vUseFullYear = JSGantt.parseDateFormatStr('dd/mm/yyyy'); | ||
var vDateTaskTableDisplayFormat = utils_1.parseDateFormatStr('dd/mm/yyyy'); | ||
var vDateTaskDisplayFormat = utils_1.parseDateFormatStr('dd month yyyy'); | ||
var vHourMajorDateDisplayFormat = utils_1.parseDateFormatStr('day dd month yyyy'); | ||
var vHourMinorDateDisplayFormat = utils_1.parseDateFormatStr('HH'); | ||
var vDayMajorDateDisplayFormat = utils_1.parseDateFormatStr('dd/mm/yyyy'); | ||
var vDayMinorDateDisplayFormat = utils_1.parseDateFormatStr('dd'); | ||
var vWeekMajorDateDisplayFormat = utils_1.parseDateFormatStr('yyyy'); | ||
var vWeekMinorDateDisplayFormat = utils_1.parseDateFormatStr('dd/mm'); | ||
var vMonthMajorDateDisplayFormat = utils_1.parseDateFormatStr('yyyy'); | ||
var vMonthMinorDateDisplayFormat = utils_1.parseDateFormatStr('mon'); | ||
var vQuarterMajorDateDisplayFormat = utils_1.parseDateFormatStr('yyyy'); | ||
var vQuarterMinorDateDisplayFormat = utils_1.parseDateFormatStr('qq'); | ||
var vUseFullYear = utils_1.parseDateFormatStr('dd/mm/yyyy'); | ||
var vCaptionType; | ||
@@ -202,14 +204,14 @@ var vDepId = 1; | ||
this.setDateInputFormat = function (pVal) { vDateInputFormat = pVal; }; | ||
this.setDateTaskTableDisplayFormat = function (pVal) { vDateTaskTableDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setDateTaskDisplayFormat = function (pVal) { vDateTaskDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setHourMajorDateDisplayFormat = function (pVal) { vHourMajorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setHourMinorDateDisplayFormat = function (pVal) { vHourMinorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setDayMajorDateDisplayFormat = function (pVal) { vDayMajorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setDayMinorDateDisplayFormat = function (pVal) { vDayMinorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setWeekMajorDateDisplayFormat = function (pVal) { vWeekMajorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setWeekMinorDateDisplayFormat = function (pVal) { vWeekMinorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setMonthMajorDateDisplayFormat = function (pVal) { vMonthMajorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setMonthMinorDateDisplayFormat = function (pVal) { vMonthMinorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setQuarterMajorDateDisplayFormat = function (pVal) { vQuarterMajorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setQuarterMinorDateDisplayFormat = function (pVal) { vQuarterMinorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setDateTaskTableDisplayFormat = function (pVal) { vDateTaskTableDisplayFormat = utils_1.parseDateFormatStr(pVal); }; | ||
this.setDateTaskDisplayFormat = function (pVal) { vDateTaskDisplayFormat = utils_1.parseDateFormatStr(pVal); }; | ||
this.setHourMajorDateDisplayFormat = function (pVal) { vHourMajorDateDisplayFormat = utils_1.parseDateFormatStr(pVal); }; | ||
this.setHourMinorDateDisplayFormat = function (pVal) { vHourMinorDateDisplayFormat = utils_1.parseDateFormatStr(pVal); }; | ||
this.setDayMajorDateDisplayFormat = function (pVal) { vDayMajorDateDisplayFormat = utils_1.parseDateFormatStr(pVal); }; | ||
this.setDayMinorDateDisplayFormat = function (pVal) { vDayMinorDateDisplayFormat = utils_1.parseDateFormatStr(pVal); }; | ||
this.setWeekMajorDateDisplayFormat = function (pVal) { vWeekMajorDateDisplayFormat = utils_1.parseDateFormatStr(pVal); }; | ||
this.setWeekMinorDateDisplayFormat = function (pVal) { vWeekMinorDateDisplayFormat = utils_1.parseDateFormatStr(pVal); }; | ||
this.setMonthMajorDateDisplayFormat = function (pVal) { vMonthMajorDateDisplayFormat = utils_1.parseDateFormatStr(pVal); }; | ||
this.setMonthMinorDateDisplayFormat = function (pVal) { vMonthMinorDateDisplayFormat = utils_1.parseDateFormatStr(pVal); }; | ||
this.setQuarterMajorDateDisplayFormat = function (pVal) { vQuarterMajorDateDisplayFormat = utils_1.parseDateFormatStr(pVal); }; | ||
this.setQuarterMinorDateDisplayFormat = function (pVal) { vQuarterMinorDateDisplayFormat = utils_1.parseDateFormatStr(pVal); }; | ||
this.setCaptionType = function (pType) { vCaptionType = pType; }; | ||
@@ -516,7 +518,7 @@ this.setFormat = function (pFormat) { | ||
if (vProcessNeeded) | ||
JSGantt.processRows(vTaskList, 0, -1, 1, 1, this.getUseSort()); | ||
exports.processRows(vTaskList, 0, -1, 1, 1, this.getUseSort()); | ||
vProcessNeeded = false; | ||
// get overall min/max dates plus padding | ||
vMinDate = JSGantt.getMinDate(vTaskList, vFormat); | ||
vMaxDate = JSGantt.getMaxDate(vTaskList, vFormat); | ||
vMinDate = utils_1.getMinDate(vTaskList, vFormat); | ||
vMaxDate = utils_1.getMaxDate(vTaskList, vFormat); | ||
// Calculate chart width variables. | ||
@@ -592,3 +594,3 @@ if (vFormat == 'day') | ||
vTaskList[i].setGroupSpan(vTmpSpan); | ||
JSGantt.addFolderListeners(this, vTmpSpan, vID); | ||
events_1.addFolderListeners(this, vTmpSpan, vID); | ||
vTmpDiv.appendChild(document.createTextNode('\u00A0' + vTaskList[i].getName())); | ||
@@ -614,7 +616,7 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, 'gstartdate'); | ||
vTmpDiv = this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTaskList[i].getStart(), vDateTaskTableDisplayFormat, vLangs[vLang])); | ||
vTmpDiv = this.newNode(vTmpCell, 'div', null, null, utils_1.formatDateStr(vTaskList[i].getStart(), vDateTaskTableDisplayFormat, vLangs[vLang])); | ||
} | ||
if (vShowEndDate == 1) { | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, 'genddate'); | ||
vTmpDiv = this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTaskList[i].getEnd(), vDateTaskTableDisplayFormat, vLangs[vLang])); | ||
vTmpDiv = this.newNode(vTmpCell, 'div', null, null, utils_1.formatDateStr(vTaskList[i].getEnd(), vDateTaskTableDisplayFormat, vLangs[vLang])); | ||
} | ||
@@ -665,6 +667,6 @@ vNumRows++; | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass, null, null, null, null, 7); | ||
vCellContents += JSGantt.formatDateStr(vTmpDate, vDayMajorDateDisplayFormat, vLangs[vLang]); | ||
vCellContents += utils_1.formatDateStr(vTmpDate, vDayMajorDateDisplayFormat, vLangs[vLang]); | ||
vTmpDate.setDate(vTmpDate.getDate() + 6); | ||
if (vShowEndWeekDate == 1) | ||
vCellContents += ' - ' + JSGantt.formatDateStr(vTmpDate, vDayMajorDateDisplayFormat, vLangs[vLang]); | ||
vCellContents += ' - ' + utils_1.formatDateStr(vTmpDate, vDayMajorDateDisplayFormat, vLangs[vLang]); | ||
this.newNode(vTmpCell, 'div', null, null, vCellContents, vColWidth * 7); | ||
@@ -675,3 +677,3 @@ vTmpDate.setDate(vTmpDate.getDate() + 1); | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass, null, vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vWeekMajorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, utils_1.formatDateStr(vTmpDate, vWeekMajorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
vTmpDate.setDate(vTmpDate.getDate() + 7); | ||
@@ -684,3 +686,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass, null, null, null, null, vColSpan); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vMonthMajorDateDisplayFormat, vLangs[vLang]), vColWidth * vColSpan); | ||
this.newNode(vTmpCell, 'div', null, null, utils_1.formatDateStr(vTmpDate, vMonthMajorDateDisplayFormat, vLangs[vLang]), vColWidth * vColSpan); | ||
vTmpDate.setFullYear(vTmpDate.getFullYear() + 1, 0, 1); | ||
@@ -693,3 +695,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass, null, null, null, null, vColSpan); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vQuarterMajorDateDisplayFormat, vLangs[vLang]), vColWidth * vColSpan); | ||
this.newNode(vTmpCell, 'div', null, null, utils_1.formatDateStr(vTmpDate, vQuarterMajorDateDisplayFormat, vLangs[vLang]), vColWidth * vColSpan); | ||
vTmpDate.setFullYear(vTmpDate.getFullYear() + 1, 0, 1); | ||
@@ -704,3 +706,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass, null, null, null, null, vColSpan); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vHourMajorDateDisplayFormat, vLangs[vLang]), vColWidth * vColSpan); | ||
this.newNode(vTmpCell, 'div', null, null, utils_1.formatDateStr(vTmpDate, vHourMajorDateDisplayFormat, vLangs[vLang]), vColWidth * vColSpan); | ||
vTmpDate.setHours(0); | ||
@@ -726,3 +728,3 @@ vTmpDate.setDate(vTmpDate.getDate() + 1); | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vDayMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, utils_1.formatDateStr(vTmpDate, vDayMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
vNumCols++; | ||
@@ -735,3 +737,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vWeekMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, utils_1.formatDateStr(vTmpDate, vWeekMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
vNumCols++; | ||
@@ -744,3 +746,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vMonthMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, utils_1.formatDateStr(vTmpDate, vMonthMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
vNumCols++; | ||
@@ -756,3 +758,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vQuarterMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, utils_1.formatDateStr(vTmpDate, vQuarterMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
vNumCols++; | ||
@@ -769,3 +771,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vHourMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, utils_1.formatDateStr(vTmpDate, vHourMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
vNumCols++; | ||
@@ -799,4 +801,4 @@ } | ||
curTaskEnd = new Date(curTaskEnd.getFullYear(), curTaskEnd.getMonth(), curTaskEnd.getDate() + 1, curTaskEnd.getHours(), curTaskEnd.getMinutes(), curTaskEnd.getSeconds()); // add 1 day here to simplify calculations below | ||
vTaskLeftPx = JSGantt.getOffset(vMinDate, curTaskStart, vColWidth, vFormat); | ||
vTaskRightPx = JSGantt.getOffset(curTaskStart, curTaskEnd, vColWidth, vFormat); | ||
vTaskLeftPx = utils_1.getOffset(vMinDate, curTaskStart, vColWidth, vFormat); | ||
vTaskRightPx = utils_1.getOffset(curTaskStart, curTaskEnd, vColWidth, vFormat); | ||
vID = vTaskList[i].getID(); | ||
@@ -811,3 +813,3 @@ var vComb = (vTaskList[i].getParItem() && vTaskList[i].getParItem().getGroup() == 2); | ||
vTaskList[i].setChildRow(vTmpRow); | ||
JSGantt.addThisRowListeners(this, vTaskList[i].getListChildRow(), vTmpRow); | ||
events_1.addThisRowListeners(this, vTaskList[i].getListChildRow(), vTmpRow); | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, 'gtaskcell'); | ||
@@ -846,3 +848,3 @@ vTmpDiv = this.newNode(vTmpCell, 'div', null, 'gtaskcelldiv', '\u00A0\u00A0'); | ||
vTaskList[i].setChildRow(vTmpRow); | ||
JSGantt.addThisRowListeners(this, vTaskList[i].getListChildRow(), vTmpRow); | ||
events_1.addThisRowListeners(this, vTaskList[i].getListChildRow(), vTmpRow); | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, 'gtaskcell'); | ||
@@ -881,3 +883,3 @@ vTmpDiv = this.newNode(vTmpCell, 'div', null, 'gtaskcelldiv', '\u00A0\u00A0'); | ||
vTaskList[i].setChildRow(vTmpRow); | ||
JSGantt.addThisRowListeners(this, vTaskList[i].getListChildRow(), vTmpRow); | ||
events_1.addThisRowListeners(this, vTaskList[i].getListChildRow(), vTmpRow); | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, 'gtaskcell'); | ||
@@ -930,3 +932,3 @@ vTmpDiv = this.newNode(vTmpCell, 'div', null, 'gtaskcelldiv', '\u00A0\u00A0'); | ||
vTmpDiv2.appendChild(this.createTaskInfo(vTaskList[i])); | ||
JSGantt.addTooltipListeners(this, vTaskList[i].getTaskDiv(), vTmpDiv2); | ||
events_1.addTooltipListeners(this, vTaskList[i].getTaskDiv(), vTmpDiv2); | ||
} | ||
@@ -953,3 +955,3 @@ } | ||
// Now all the content exists, register scroll listeners | ||
JSGantt.addScrollListeners(this); | ||
events_1.addScrollListeners(this); | ||
// now check if we are actually scrolling the pane | ||
@@ -963,3 +965,3 @@ if (vScrollTo != '') { | ||
else { | ||
vScrollDate = JSGantt.parseDateStr(vScrollTo, this.getDateInputFormat()); | ||
vScrollDate = utils_1.parseDateStr(vScrollTo, this.getDateInputFormat()); | ||
if (vFormat == 'hour') | ||
@@ -969,3 +971,3 @@ vScrollDate.setMinutes(0, 0, 0); | ||
vScrollDate.setHours(0, 0, 0, 0); | ||
vScrollPx = JSGantt.getOffset(vMinDate, vScrollDate, vColWidth, vFormat); | ||
vScrollPx = utils_1.getOffset(vMinDate, vScrollDate, vColWidth, vFormat); | ||
} | ||
@@ -975,3 +977,3 @@ this.getChartBody().scrollLeft = vScrollPx; | ||
if (vMinDate.getTime() <= (new Date()).getTime() && vMaxDate.getTime() >= (new Date()).getTime()) | ||
vTodayPx = JSGantt.getOffset(vMinDate, new Date(), vColWidth, vFormat); | ||
vTodayPx = utils_1.getOffset(vMinDate, new Date(), vColWidth, vFormat); | ||
else | ||
@@ -994,11 +996,11 @@ vTodayPx = -1; | ||
if (vFormatArr.join().toLowerCase().indexOf('hour') != -1) | ||
JSGantt.addFormatListeners(this, 'hour', this.newNode(vTmpDiv, 'span', vDivId + 'formathour' + pPos, 'gformlabel' + ((vFormat == 'hour') ? ' gselected' : ''), vLangs[vLang]['hour'])); | ||
events_1.addFormatListeners(this, 'hour', this.newNode(vTmpDiv, 'span', vDivId + 'formathour' + pPos, 'gformlabel' + ((vFormat == 'hour') ? ' gselected' : ''), vLangs[vLang]['hour'])); | ||
if (vFormatArr.join().toLowerCase().indexOf('day') != -1) | ||
JSGantt.addFormatListeners(this, 'day', this.newNode(vTmpDiv, 'span', vDivId + 'formatday' + pPos, 'gformlabel' + ((vFormat == 'day') ? ' gselected' : ''), vLangs[vLang]['day'])); | ||
events_1.addFormatListeners(this, 'day', this.newNode(vTmpDiv, 'span', vDivId + 'formatday' + pPos, 'gformlabel' + ((vFormat == 'day') ? ' gselected' : ''), vLangs[vLang]['day'])); | ||
if (vFormatArr.join().toLowerCase().indexOf('week') != -1) | ||
JSGantt.addFormatListeners(this, 'week', this.newNode(vTmpDiv, 'span', vDivId + 'formatweek' + pPos, 'gformlabel' + ((vFormat == 'week') ? ' gselected' : ''), vLangs[vLang]['week'])); | ||
events_1.addFormatListeners(this, 'week', this.newNode(vTmpDiv, 'span', vDivId + 'formatweek' + pPos, 'gformlabel' + ((vFormat == 'week') ? ' gselected' : ''), vLangs[vLang]['week'])); | ||
if (vFormatArr.join().toLowerCase().indexOf('month') != -1) | ||
JSGantt.addFormatListeners(this, 'month', this.newNode(vTmpDiv, 'span', vDivId + 'formatmonth' + pPos, 'gformlabel' + ((vFormat == 'month') ? ' gselected' : ''), vLangs[vLang]['month'])); | ||
events_1.addFormatListeners(this, 'month', this.newNode(vTmpDiv, 'span', vDivId + 'formatmonth' + pPos, 'gformlabel' + ((vFormat == 'month') ? ' gselected' : ''), vLangs[vLang]['month'])); | ||
if (vFormatArr.join().toLowerCase().indexOf('quarter') != -1) | ||
JSGantt.addFormatListeners(this, 'quarter', this.newNode(vTmpDiv, 'span', vDivId + 'formatquarter' + pPos, 'gformlabel' + ((vFormat == 'quarter') ? ' gselected' : ''), vLangs[vLang]['quarter'])); | ||
events_1.addFormatListeners(this, 'quarter', this.newNode(vTmpDiv, 'span', vDivId + 'formatquarter' + pPos, 'gformlabel' + ((vFormat == 'quarter') ? ' gselected' : ''), vLangs[vLang]['quarter'])); | ||
} | ||
@@ -1018,3 +1020,3 @@ else { | ||
this.newNode(vTmpDiv, 'span', null, 'gTaskLabel', vLangs[vLang]['startdate'] + ': '); | ||
this.newNode(vTmpDiv, 'span', null, 'gTaskText', JSGantt.formatDateStr(pTask.getStart(), vDateTaskDisplayFormat, vLangs[vLang])); | ||
this.newNode(vTmpDiv, 'span', null, 'gTaskText', utils_1.formatDateStr(pTask.getStart(), vDateTaskDisplayFormat, vLangs[vLang])); | ||
} | ||
@@ -1024,3 +1026,3 @@ if (vShowTaskInfoEndDate == 1) { | ||
this.newNode(vTmpDiv, 'span', null, 'gTaskLabel', vLangs[vLang]['enddate'] + ': '); | ||
this.newNode(vTmpDiv, 'span', null, 'gTaskText', JSGantt.formatDateStr(pTask.getEnd(), vDateTaskDisplayFormat, vLangs[vLang])); | ||
this.newNode(vTmpDiv, 'span', null, 'gTaskText', utils_1.formatDateStr(pTask.getEnd(), vDateTaskDisplayFormat, vLangs[vLang])); | ||
} | ||
@@ -1068,3 +1070,3 @@ if (vShowTaskInfoDur == 1 && !pTask.getMile()) { | ||
var vTask = ''; | ||
var vOutFrmt = JSGantt.parseDateFormatStr(this.getDateInputFormat() + ' HH:MI'); | ||
var vOutFrmt = utils_1.parseDateFormatStr(this.getDateInputFormat() + ' HH:MI'); | ||
if (pIdx === true) | ||
@@ -1085,4 +1087,4 @@ vIdx = pID; | ||
vTask += '<pName>' + vTaskList[vIdx].getName() + '</pName>'; | ||
vTask += '<pStart>' + JSGantt.formatDateStr(vTaskList[vIdx].getStart(), vOutFrmt, vLangs[vLang]) + '</pStart>'; | ||
vTask += '<pEnd>' + JSGantt.formatDateStr(vTaskList[vIdx].getEnd(), vOutFrmt, vLangs[vLang]) + '</pEnd>'; | ||
vTask += '<pStart>' + utils_1.formatDateStr(vTaskList[vIdx].getStart(), vOutFrmt, vLangs[vLang]) + '</pStart>'; | ||
vTask += '<pEnd>' + utils_1.formatDateStr(vTaskList[vIdx].getEnd(), vOutFrmt, vLangs[vLang]) + '</pEnd>'; | ||
vTask += '<pClass>' + vTaskList[vIdx].getClass() + '</pClass>'; | ||
@@ -1132,3 +1134,3 @@ vTask += '<pLink>' + vTaskList[vIdx].getLink() + '</pLink>'; | ||
vMouseY -= document.documentElement.clientTop; | ||
var vZoomFactor = JSGantt.getZoomFactor(); | ||
var vZoomFactor = utils_1.getZoomFactor(); | ||
if (vZoomFactor != 1) { // IE 7 at non-default zoom level | ||
@@ -1139,3 +1141,3 @@ vMouseX = Math.round(vMouseX / vZoomFactor); | ||
} | ||
var vScrollPos = JSGantt.getScrollPositions(); | ||
var vScrollPos = utils_1.getScrollPositions(); | ||
/* Code for positioned right of the mouse by default*/ | ||
@@ -1179,3 +1181,3 @@ /* | ||
clearInterval(pGanttChartObj.vTool.moveInterval); | ||
pGanttChartObj.vTool.moveInterval = setInterval(function () { JSGantt.moveToolTip(vNewX, vNewY, pGanttChartObj.vTool, pTimer); }, pTimer); | ||
pGanttChartObj.vTool.moveInterval = setInterval(function () { events_1.moveToolTip(vNewX, vNewY, pGanttChartObj.vTool, pTimer); }, pTimer); | ||
} | ||
@@ -1182,0 +1184,0 @@ else { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var utils_1 = require("./utils"); | ||
var task_1 = require("./task"); | ||
var draw_1 = require("./draw"); | ||
exports.mouseOver = function (pObj1, pObj2) { | ||
@@ -40,3 +43,3 @@ if (this.getUseRowHlt()) { | ||
this.addListener('mouseover', function () { clearTimeout(pGanttChartObj.vTool.delayTimeout); }, pGanttChartObj.vTool); | ||
this.addListener('mouseout', function () { JSGantt.delayedHide(pGanttChartObj, pGanttChartObj.vTool, pTimer); }, pGanttChartObj.vTool); | ||
this.addListener('mouseout', function () { utils_1.delayedHide(pGanttChartObj, pGanttChartObj.vTool, pTimer); }, pGanttChartObj.vTool); | ||
} | ||
@@ -49,9 +52,9 @@ clearTimeout(pGanttChartObj.vTool.delayTimeout); | ||
// as we are allowing arbitrary HTML we should remove any tag ids to prevent duplication | ||
JSGantt.stripIds(pGanttChartObj.vTool.vToolCont); | ||
utils_1.stripIds(pGanttChartObj.vTool.vToolCont); | ||
} | ||
pGanttChartObj.vTool.style.visibility = 'visible'; | ||
// Rather than follow the mouse just have it stay put | ||
JSGantt.updateFlyingObj(e, pGanttChartObj, pTimer); | ||
draw_1.updateFlyingObj(e, pGanttChartObj, pTimer); | ||
pGanttChartObj.vTool.style.width = (pWidth) ? pWidth + 'px' : 'auto'; | ||
if (!pWidth && JSGantt.isIE()) { | ||
if (!pWidth && utils_1.isIE()) { | ||
pGanttChartObj.vTool.style.width = pGanttChartObj.vTool.offsetWidth; | ||
@@ -65,3 +68,3 @@ } | ||
clearInterval(pGanttChartObj.vTool.fadeInterval); | ||
pGanttChartObj.vTool.fadeInterval = setInterval(function () { JSGantt.fadeToolTip(1, pGanttChartObj.vTool, vMaxAlpha); }, pTimer); | ||
pGanttChartObj.vTool.fadeInterval = setInterval(function () { utils_1.fadeToolTip(1, pGanttChartObj.vTool, vMaxAlpha); }, pTimer); | ||
} | ||
@@ -74,40 +77,3 @@ else { | ||
}; | ||
exports.hideToolTip = function (pGanttChartObj, pTool, pTimer) { | ||
if (pGanttChartObj.getUseFade()) { | ||
clearInterval(pTool.fadeInterval); | ||
pTool.fadeInterval = setInterval(function () { JSGantt.fadeToolTip(-1, pTool, 0); }, pTimer); | ||
} | ||
else { | ||
pTool.style.opacity = 0; | ||
pTool.style.filter = 'alpha(opacity=0)'; | ||
pTool.style.visibility = 'hidden'; | ||
} | ||
}; | ||
exports.fadeToolTip = function (pDirection, pTool, pMaxAlpha) { | ||
var vIncrement = parseInt(pTool.getAttribute('fadeIncrement')); | ||
var vAlpha = pTool.getAttribute('currentOpacity'); | ||
var vCurAlpha = parseInt(vAlpha); | ||
if ((vCurAlpha != pMaxAlpha && pDirection == 1) || (vCurAlpha != 0 && pDirection == -1)) { | ||
var i = vIncrement; | ||
if (pMaxAlpha - vCurAlpha < vIncrement && pDirection == 1) { | ||
i = pMaxAlpha - vCurAlpha; | ||
} | ||
else if (vAlpha < vIncrement && pDirection == -1) { | ||
i = vCurAlpha; | ||
} | ||
vAlpha = vCurAlpha + (i * pDirection); | ||
pTool.style.opacity = vAlpha * 0.01; | ||
pTool.style.filter = 'alpha(opacity=' + vAlpha + ')'; | ||
pTool.setAttribute('currentOpacity', vAlpha); | ||
} | ||
else { | ||
clearInterval(pTool.fadeInterval); | ||
if (pDirection == -1) { | ||
pTool.style.opacity = 0; | ||
pTool.style.filter = 'alpha(opacity=0)'; | ||
pTool.style.visibility = 'hidden'; | ||
} | ||
} | ||
}; | ||
exports.moveToolTip = function (pNewX, pNewY, pTool) { | ||
exports.moveToolTip = function (pNewX, pNewY, pTool, timer) { | ||
var vSpeed = parseInt(pTool.getAttribute('moveSpeed')); | ||
@@ -133,2 +99,42 @@ var vOldX = parseInt(pTool.style.left); | ||
}; | ||
exports.addListener = function (eventName, handler, control) { | ||
// Check if control is a string | ||
if (control === String(control)) | ||
control = utils_1.findObj(control); | ||
if (control.addEventListener) //Standard W3C | ||
{ | ||
return control.addEventListener(eventName, handler, false); | ||
} | ||
else if (control.attachEvent) //IExplore | ||
{ | ||
return control.attachEvent('on' + eventName, handler); | ||
} | ||
else { | ||
return false; | ||
} | ||
}; | ||
exports.addTooltipListeners = function (pGanttChart, pObj1, pObj2) { | ||
exports.addListener('mouseover', function (e) { exports.showToolTip(pGanttChart, e, pObj2, null, pGanttChart.getTimer()); }, pObj1); | ||
exports.addListener('mouseout', function (e) { utils_1.delayedHide(pGanttChart, pGanttChart.vTool, pGanttChart.getTimer()); }, pObj1); | ||
}; | ||
exports.addThisRowListeners = function (pGanttChart, pObj1, pObj2) { | ||
exports.addListener('mouseover', function () { pGanttChart.mouseOver(pObj1, pObj2); }, pObj1); | ||
exports.addListener('mouseover', function () { pGanttChart.mouseOver(pObj1, pObj2); }, pObj2); | ||
exports.addListener('mouseout', function () { pGanttChart.mouseOut(pObj1, pObj2); }, pObj1); | ||
exports.addListener('mouseout', function () { pGanttChart.mouseOut(pObj1, pObj2); }, pObj2); | ||
}; | ||
exports.addFolderListeners = function (pGanttChart, pObj, pID) { | ||
exports.addListener('click', function () { task_1.folder(pID, pGanttChart); }, pObj); | ||
}; | ||
exports.addFormatListeners = function (pGanttChart, pFormat, pObj) { | ||
exports.addListener('click', function () { utils_1.changeFormat(pFormat, pGanttChart); }, pObj); | ||
}; | ||
exports.addScrollListeners = function (pGanttChart) { | ||
exports.addListener('scroll', function () { pGanttChart.getChartBody().scrollTop = pGanttChart.getListBody().scrollTop; }, pGanttChart.getListBody()); | ||
exports.addListener('scroll', function () { pGanttChart.getListBody().scrollTop = pGanttChart.getChartBody().scrollTop; }, pGanttChart.getChartBody()); | ||
exports.addListener('scroll', function () { pGanttChart.getChartHead().scrollLeft = pGanttChart.getChartBody().scrollLeft; }, pGanttChart.getChartBody()); | ||
exports.addListener('scroll', function () { pGanttChart.getChartBody().scrollLeft = pGanttChart.getChartHead().scrollLeft; }, pGanttChart.getChartHead()); | ||
exports.addListener('resize', function () { pGanttChart.getChartHead().scrollLeft = pGanttChart.getChartBody().scrollLeft; }, window); | ||
exports.addListener('resize', function () { pGanttChart.getListBody().scrollTop = pGanttChart.getChartBody().scrollTop; }, window); | ||
}; | ||
//# sourceMappingURL=events.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var task_1 = require("./task"); | ||
exports.parseJSON = function (pFile, pGanttVar) { | ||
@@ -13,6 +14,6 @@ if (window.XMLHttpRequest) { | ||
var jsonObj = eval('(' + xhttp.response + ')'); | ||
JSGantt.addJSONTask(pGanttVar, jsonObj); | ||
exports.addJSONTask(pGanttVar, jsonObj); | ||
}; | ||
exports.parseJSONString = function (pStr, pGanttVar) { | ||
JSGantt.addJSONTask(pGanttVar, eval('(' + pStr + ')')); | ||
exports.addJSONTask(pGanttVar, eval('(' + pStr + ')')); | ||
}; | ||
@@ -104,3 +105,3 @@ exports.addJSONTask = function (pGanttVar, pJsonObj) { | ||
if (id != undefined && !isNaN(parseInt(id)) && isFinite(id) && name && start && end && itemClass && completion != undefined && !isNaN(parseFloat(completion)) && isFinite(completion) && !isNaN(parseInt(parent)) && isFinite(parent)) { | ||
pGanttVar.AddTaskItem(new JSGantt.TaskItem(id, name, start, end, itemClass, link, milestone, resourceName, completion, group, parent, open, dependsOn, caption, notes, pGanttVar)); | ||
pGanttVar.AddTaskItem(new task_1.TaskItem(id, name, start, end, itemClass, link, milestone, resourceName, completion, group, parent, open, dependsOn, caption, notes, pGanttVar)); | ||
} | ||
@@ -107,0 +108,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var utils_1 = require("./utils"); | ||
// Function to open/close and hide/show children of specified task | ||
@@ -12,4 +13,4 @@ exports.folder = function (pID, ganttObj) { | ||
vList[i].setOpen(0); | ||
JSGantt.hide(pID, ganttObj); | ||
if (JSGantt.isIE()) | ||
exports.hide(pID, ganttObj); | ||
if (utils_1.isIE()) | ||
vList[i].getGroupSpan().innerText = '+'; | ||
@@ -21,4 +22,4 @@ else | ||
vList[i].setOpen(1); | ||
JSGantt.show(pID, 1, ganttObj); | ||
if (JSGantt.isIE()) | ||
exports.show(pID, 1, ganttObj); | ||
if (utils_1.isIE()) | ||
vList[i].getGroupSpan().innerText = '-'; | ||
@@ -47,3 +48,3 @@ else | ||
if (vList[i].getGroup()) | ||
JSGantt.hide(vID, ganttObj); | ||
exports.hide(vID, ganttObj); | ||
} | ||
@@ -61,3 +62,3 @@ } | ||
if (vList[i].getParItem().getGroupSpan()) { | ||
if (JSGantt.isIE()) | ||
if (utils_1.isIE()) | ||
vState = vList[i].getParItem().getGroupSpan().innerText; | ||
@@ -88,3 +89,3 @@ else | ||
if (vList[i].getGroup()) | ||
JSGantt.show(vID, 0, ganttObj); | ||
exports.show(vID, 0, ganttObj); | ||
} | ||
@@ -127,3 +128,3 @@ } | ||
pList[i].setSortIdx(sortIdx++); | ||
sortIdx = JSGantt.sortTasks(pList, pList[i].getID(), sortIdx); | ||
sortIdx = exports.sortTasks(pList, pList[i].getID(), sortIdx); | ||
} | ||
@@ -164,3 +165,3 @@ } | ||
var vCellDiv = null; | ||
var vGantt = (pGantt instanceof JSGantt.GanttChart) ? pGantt : g; //hack for backwards compatibility | ||
var vGantt = pGantt ? pGantt : g; //hack for backwards compatibility | ||
var vBarDiv = null; | ||
@@ -175,10 +176,10 @@ var vTaskDiv = null; | ||
vNotes.innerHTML = pNotes; | ||
JSGantt.stripUnwanted(vNotes); | ||
utils_1.stripUnwanted(vNotes); | ||
} | ||
if (pStart != null && pStart != '') { | ||
vStart = (pStart instanceof Date) ? pStart : JSGantt.parseDateStr(document.createTextNode(pStart).data, vGantt.getDateInputFormat()); | ||
vStart = (pStart instanceof Date) ? pStart : utils_1.parseDateStr(document.createTextNode(pStart).data, vGantt.getDateInputFormat()); | ||
vGroupMinStart = vStart; | ||
} | ||
if (pEnd != null && pEnd != '') { | ||
vEnd = (pEnd instanceof Date) ? pEnd : JSGantt.parseDateStr(document.createTextNode(pEnd).data, vGantt.getDateInputFormat()); | ||
vEnd = (pEnd instanceof Date) ? pEnd : utils_1.parseDateStr(document.createTextNode(pEnd).data, vGantt.getDateInputFormat()); | ||
vGroupMinEnd = vEnd; | ||
@@ -273,3 +274,3 @@ } | ||
} | ||
var tmpPer = (JSGantt.getOffset(this.getStart(), vTaskEnd, 999, vUnits)) / 1000; | ||
var tmpPer = (utils_1.getOffset(this.getStart(), vTaskEnd, 999, vUnits)) / 1000; | ||
if (Math.floor(tmpPer) != tmpPer) | ||
@@ -338,3 +339,3 @@ tmpPer = Math.round(tmpPer * 10) / 10; | ||
vToDelete = false; }; | ||
this.setParItem = function (pParItem) { if (pParItem instanceof JSGantt.TaskItem) | ||
this.setParItem = function (pParItem) { if (pParItem) | ||
vParItem = pParItem; }; | ||
@@ -341,0 +342,0 @@ this.setCellDiv = function (pCellDiv) { if (typeof HTMLDivElement !== 'function' || pCellDiv instanceof HTMLDivElement) |
@@ -96,2 +96,3 @@ "use strict"; | ||
exports.findObj = function (theObj, theDoc) { | ||
if (theDoc === void 0) { theDoc = null; } | ||
var p, i, foundObj; | ||
@@ -200,9 +201,9 @@ if (!theDoc) | ||
case 'ww': | ||
if (JSGantt.getIsoWeek(pDate) < 10) | ||
if (exports.getIsoWeek(pDate) < 10) | ||
vDateStr += '0'; // now fall through | ||
case 'w': | ||
vDateStr += JSGantt.getIsoWeek(pDate); | ||
vDateStr += exports.getIsoWeek(pDate); | ||
break; | ||
case 'week': | ||
var vWeekNum = JSGantt.getIsoWeek(pDate); | ||
var vWeekNum = exports.getIsoWeek(pDate); | ||
var vYear = pDate.getFullYear(); | ||
@@ -215,3 +216,3 @@ var vDayOfWeek = (pDate.getDay() == 0) ? 7 : pDate.getDay(); | ||
if (vWeekNum < 10) | ||
vWeekNum = '0' + vWeekNum; | ||
vWeekNum = parseInt('0' + vWeekNum, 10); | ||
vDateStr += vYear + '-W' + vWeekNum + '-' + vDayOfWeek; | ||
@@ -259,3 +260,3 @@ break; | ||
if (pNode.childNodes[i].hasChildNodes()) | ||
JSGantt.stripIds(pNode.childNodes[i]); | ||
exports.stripIds(pNode.childNodes[i]); | ||
} | ||
@@ -271,3 +272,3 @@ }; | ||
if (pNode.childNodes[i].hasChildNodes()) | ||
JSGantt.stripUnwanted(pNode.childNodes[i]); | ||
exports.stripUnwanted(pNode.childNodes[i]); | ||
} | ||
@@ -278,3 +279,3 @@ }; | ||
if (pTool) | ||
pTool.delayTimeout = setTimeout(function () { JSGantt.hideToolTip(pGanttChartObj, pTool, pTimer); }, vDelay); | ||
pTool.delayTimeout = setTimeout(function () { exports.hideToolTip(pGanttChartObj, pTool, pTimer); }, vDelay); | ||
}; | ||
@@ -313,3 +314,3 @@ exports.getZoomFactor = function () { | ||
if (thisWeek <= 0) | ||
thisWeek = JSGantt.getIsoWeek(new Date(pDate.getFullYear() - 1, 11, 31, 0, 0, 0)); | ||
thisWeek = exports.getIsoWeek(new Date(pDate.getFullYear() - 1, 11, 31, 0, 0, 0)); | ||
else if (thisWeek == 53 && (new Date(pDate.getFullYear(), 0, 1, 0, 0, 0)).getDay() != 4 && (new Date(pDate.getFullYear(), 11, 31, 0, 0, 0)).getDay() != 4) | ||
@@ -324,3 +325,3 @@ thisWeek = 1; | ||
{ | ||
var vZoomFactor = JSGantt.getZoomFactor(); | ||
var vZoomFactor = exports.getZoomFactor(); | ||
vScrollLeft = Math.round(document.documentElement.scrollLeft / vZoomFactor); | ||
@@ -383,2 +384,39 @@ vScrollTop = Math.round(document.documentElement.scrollTop / vZoomFactor); | ||
}; | ||
exports.hideToolTip = function (pGanttChartObj, pTool, pTimer) { | ||
if (pGanttChartObj.getUseFade()) { | ||
clearInterval(pTool.fadeInterval); | ||
pTool.fadeInterval = setInterval(function () { exports.fadeToolTip(-1, pTool, 0); }, pTimer); | ||
} | ||
else { | ||
pTool.style.opacity = 0; | ||
pTool.style.filter = 'alpha(opacity=0)'; | ||
pTool.style.visibility = 'hidden'; | ||
} | ||
}; | ||
exports.fadeToolTip = function (pDirection, pTool, pMaxAlpha) { | ||
var vIncrement = parseInt(pTool.getAttribute('fadeIncrement')); | ||
var vAlpha = pTool.getAttribute('currentOpacity'); | ||
var vCurAlpha = parseInt(vAlpha); | ||
if ((vCurAlpha != pMaxAlpha && pDirection == 1) || (vCurAlpha != 0 && pDirection == -1)) { | ||
var i = vIncrement; | ||
if (pMaxAlpha - vCurAlpha < vIncrement && pDirection == 1) { | ||
i = pMaxAlpha - vCurAlpha; | ||
} | ||
else if (vAlpha < vIncrement && pDirection == -1) { | ||
i = vCurAlpha; | ||
} | ||
vAlpha = vCurAlpha + (i * pDirection); | ||
pTool.style.opacity = vAlpha * 0.01; | ||
pTool.style.filter = 'alpha(opacity=' + vAlpha + ')'; | ||
pTool.setAttribute('currentOpacity', vAlpha); | ||
} | ||
else { | ||
clearInterval(pTool.fadeInterval); | ||
if (pDirection == -1) { | ||
pTool.style.opacity = 0; | ||
pTool.style.filter = 'alpha(opacity=0)'; | ||
pTool.style.visibility = 'hidden'; | ||
} | ||
} | ||
}; | ||
//# sourceMappingURL=utils.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var task_1 = require("./task"); | ||
exports.parseXML = function (pFile, pGanttVar) { | ||
@@ -13,3 +14,3 @@ if (window.XMLHttpRequest) { | ||
var xmlDoc = xhttp.responseXML; | ||
JSGantt.AddXMLTask(pGanttVar, xmlDoc); | ||
exports.AddXMLTask(pGanttVar, xmlDoc); | ||
}; | ||
@@ -26,3 +27,3 @@ exports.parseXMLString = function (pStr, pGanttVar) { | ||
} | ||
JSGantt.AddXMLTask(pGanttVar, xmlDoc); | ||
exports.AddXMLTask(pGanttVar, xmlDoc); | ||
}; | ||
@@ -71,3 +72,3 @@ exports.findXMLNode = function (pRoot, pNodeName) { | ||
var pars = new Array(); | ||
var projNode = JSGantt.findXMLNode(pXmlDoc, 'Project'); | ||
var projNode = exports.findXMLNode(pXmlDoc, 'Project'); | ||
if (typeof projNode != 'undefined' && projNode.length > 0) | ||
@@ -78,3 +79,3 @@ project = projNode[0].getAttribute('xmlns'); | ||
pGanttVar.setDateInputFormat('yyyy-mm-dd'); | ||
Task = JSGantt.findXMLNode(pXmlDoc, 'Task'); | ||
Task = exports.findXMLNode(pXmlDoc, 'Task'); | ||
if (typeof Task == 'undefined') | ||
@@ -84,3 +85,3 @@ n = 0; | ||
n = Task.length; | ||
var resources = JSGantt.findXMLNode(pXmlDoc, 'Resource'); | ||
var resources = exports.findXMLNode(pXmlDoc, 'Resource'); | ||
if (typeof resources == 'undefined') { | ||
@@ -93,8 +94,8 @@ n = 0; | ||
for (i = 0; i < m; i++) { | ||
var resname = JSGantt.getXMLNodeValue(resources[i], 'Name', 2, ''); | ||
var uid = JSGantt.getXMLNodeValue(resources[i], 'UID', 1, -1); | ||
var resname = exports.getXMLNodeValue(resources[i], 'Name', 2, ''); | ||
var uid = exports.getXMLNodeValue(resources[i], 'UID', 1, -1); | ||
if (resname.length > 0 && uid > 0) | ||
res[uid] = resname; | ||
} | ||
var assignments = JSGantt.findXMLNode(pXmlDoc, 'Assignment'); | ||
var assignments = exports.findXMLNode(pXmlDoc, 'Assignment'); | ||
if (typeof assignments == 'undefined') | ||
@@ -105,4 +106,4 @@ j = 0; | ||
for (i = 0; i < j; i++) { | ||
var resUID = JSGantt.getXMLNodeValue(assignments[i], 'ResourceUID', 1, -1); | ||
uid = JSGantt.getXMLNodeValue(assignments[i], 'TaskUID', 1, -1); | ||
var resUID = exports.getXMLNodeValue(assignments[i], 'ResourceUID', 1, -1); | ||
uid = exports.getXMLNodeValue(assignments[i], 'TaskUID', 1, -1); | ||
if (uid > 0) { | ||
@@ -116,5 +117,5 @@ if (resUID > 0) | ||
for (i = 0; i < n; i++) { | ||
uid = JSGantt.getXMLNodeValue(Task[i], 'UID', 1, 0); | ||
uid = exports.getXMLNodeValue(Task[i], 'UID', 1, 0); | ||
if (uid != 0) | ||
var vOutlineNumber = JSGantt.getXMLNodeValue(Task[i], 'OutlineNumber', 2, '0'); | ||
var vOutlineNumber = exports.getXMLNodeValue(Task[i], 'OutlineNumber', 2, '0'); | ||
if (uid > 0) | ||
@@ -128,15 +129,15 @@ pars[vOutlineNumber] = uid; | ||
// Task ID must NOT be zero otherwise it will be skipped | ||
var pID = JSGantt.getXMLNodeValue(Task[i], 'UID', 1, 0); | ||
var pID = exports.getXMLNodeValue(Task[i], 'UID', 1, 0); | ||
if (pID != 0) { | ||
var pName = JSGantt.getXMLNodeValue(Task[i], 'Name', 2, 'No Task Name'); | ||
var pStart = JSGantt.getXMLNodeValue(Task[i], 'Start', 2, ''); | ||
var pEnd = JSGantt.getXMLNodeValue(Task[i], 'Finish', 2, ''); | ||
var pLink = JSGantt.getXMLNodeValue(Task[i], 'HyperlinkAddress', 2, ''); | ||
var pMile = JSGantt.getXMLNodeValue(Task[i], 'Milestone', 1, 0); | ||
var pComp = JSGantt.getXMLNodeValue(Task[i], 'PercentWorkComplete', 1, 0); | ||
var pGroup = JSGantt.getXMLNodeValue(Task[i], 'Summary', 1, 0); | ||
var pName = exports.getXMLNodeValue(Task[i], 'Name', 2, 'No Task Name'); | ||
var pStart = exports.getXMLNodeValue(Task[i], 'Start', 2, ''); | ||
var pEnd = exports.getXMLNodeValue(Task[i], 'Finish', 2, ''); | ||
var pLink = exports.getXMLNodeValue(Task[i], 'HyperlinkAddress', 2, ''); | ||
var pMile = exports.getXMLNodeValue(Task[i], 'Milestone', 1, 0); | ||
var pComp = exports.getXMLNodeValue(Task[i], 'PercentWorkComplete', 1, 0); | ||
var pGroup = exports.getXMLNodeValue(Task[i], 'Summary', 1, 0); | ||
var pParent = 0; | ||
var vOutlineLevel = JSGantt.getXMLNodeValue(Task[i], 'OutlineLevel', 1, 0); | ||
var vOutlineLevel = exports.getXMLNodeValue(Task[i], 'OutlineLevel', 1, 0); | ||
if (vOutlineLevel > 1) { | ||
vOutlineNumber = JSGantt.getXMLNodeValue(Task[i], 'OutlineNumber', 2, '0'); | ||
vOutlineNumber = exports.getXMLNodeValue(Task[i], 'OutlineNumber', 2, '0'); | ||
pParent = pars[vOutlineNumber.substr(0, vOutlineNumber.lastIndexOf('.'))]; | ||
@@ -154,3 +155,3 @@ } | ||
pRes = ''; | ||
var predecessors = JSGantt.findXMLNode(Task[i], 'PredecessorLink'); | ||
var predecessors = exports.findXMLNode(Task[i], 'PredecessorLink'); | ||
if (typeof predecessors == 'undefined') | ||
@@ -162,4 +163,4 @@ j = 0; | ||
for (k = 0; k < j; k++) { | ||
var depUID = JSGantt.getXMLNodeValue(predecessors[k], 'PredecessorUID', 1, -1); | ||
var depType = JSGantt.getXMLNodeValue(predecessors[k], 'Type', 1, 1); | ||
var depUID = exports.getXMLNodeValue(predecessors[k], 'PredecessorUID', 1, -1); | ||
var depType = exports.getXMLNodeValue(predecessors[k], 'Type', 1, 1); | ||
if (depUID > 0) { | ||
@@ -196,3 +197,3 @@ if (pDepend.length > 0) | ||
// check for split tasks | ||
var splits = JSGantt.findXMLNode(ass[pID], 'TimephasedData'); | ||
var splits = exports.findXMLNode(ass[pID], 'TimephasedData'); | ||
if (typeof splits == 'undefined') | ||
@@ -207,3 +208,3 @@ j = 0; | ||
for (k = 0; k < j; k++) { | ||
var vDuration = JSGantt.getXMLNodeValue(splits[k], 'Value', 2, '0'); | ||
var vDuration = exports.getXMLNodeValue(splits[k], 'Value', 2, '0'); | ||
//remove all text | ||
@@ -221,4 +222,4 @@ vDuration = '0' + vDuration.replace(/\D/g, ''); | ||
maxPID++; | ||
vSplitEnd = JSGantt.getXMLNodeValue(splits[k], (k + 1 == j) ? 'Finish' : 'Start', 2, ''); | ||
pGanttVar.AddTaskItem(new JSGantt.TaskItem(maxPID, pName, vSplitStart, vSplitEnd, 'gtaskblue', pLink, pMile, pRes, pComp, 0, pID, pOpen, vDepend, pCaption, pNotes, pGanttVar)); | ||
vSplitEnd = exports.getXMLNodeValue(splits[k], (k + 1 == j) ? 'Finish' : 'Start', 2, ''); | ||
pGanttVar.AddTaskItem(new task_1.TaskItem(maxPID, pName, vSplitStart, vSplitEnd, 'gtaskblue', pLink, pMile, pRes, pComp, 0, pID, pOpen, vDepend, pCaption, pNotes, pGanttVar)); | ||
vSubCreated = true; | ||
@@ -228,3 +229,3 @@ vDepend = ''; | ||
else if (vDuration != 0 && vSubCreated) { | ||
vSplitStart = JSGantt.getXMLNodeValue(splits[k], 'Start', 2, ''); | ||
vSplitStart = exports.getXMLNodeValue(splits[k], 'Start', 2, ''); | ||
vSubCreated = false; | ||
@@ -236,3 +237,3 @@ } | ||
// Finally add the task | ||
pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID, pName, pStart, pEnd, pClass, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGanttVar)); | ||
pGanttVar.AddTaskItem(new task_1.TaskItem(pID, pName, pStart, pEnd, pClass, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGanttVar)); | ||
} | ||
@@ -247,18 +248,18 @@ } | ||
// Task ID must NOT be zero otherwise it will be skipped | ||
pID = JSGantt.getXMLNodeValue(Task[i], 'pID', 1, 0); | ||
pID = exports.getXMLNodeValue(Task[i], 'pID', 1, 0); | ||
if (pID != 0) { | ||
pName = JSGantt.getXMLNodeValue(Task[i], 'pName', 2, 'No Task Name'); | ||
pStart = JSGantt.getXMLNodeValue(Task[i], 'pStart', 2, ''); | ||
pEnd = JSGantt.getXMLNodeValue(Task[i], 'pEnd', 2, ''); | ||
pLink = JSGantt.getXMLNodeValue(Task[i], 'pLink', 2, ''); | ||
pMile = JSGantt.getXMLNodeValue(Task[i], 'pMile', 1, 0); | ||
pComp = JSGantt.getXMLNodeValue(Task[i], 'pComp', 1, 0); | ||
pGroup = JSGantt.getXMLNodeValue(Task[i], 'pGroup', 1, 0); | ||
pParent = JSGantt.getXMLNodeValue(Task[i], 'pParent', 1, 0); | ||
pRes = JSGantt.getXMLNodeValue(Task[i], 'pRes', 2, ''); | ||
pOpen = JSGantt.getXMLNodeValue(Task[i], 'pOpen', 1, 1); | ||
pDepend = JSGantt.getXMLNodeValue(Task[i], 'pDepend', 2, ''); | ||
pCaption = JSGantt.getXMLNodeValue(Task[i], 'pCaption', 2, ''); | ||
pNotes = JSGantt.getXMLNodeValue(Task[i], 'pNotes', 2, ''); | ||
pClass = JSGantt.getXMLNodeValue(Task[i], 'pClass', 2); | ||
pName = exports.getXMLNodeValue(Task[i], 'pName', 2, 'No Task Name'); | ||
pStart = exports.getXMLNodeValue(Task[i], 'pStart', 2, ''); | ||
pEnd = exports.getXMLNodeValue(Task[i], 'pEnd', 2, ''); | ||
pLink = exports.getXMLNodeValue(Task[i], 'pLink', 2, ''); | ||
pMile = exports.getXMLNodeValue(Task[i], 'pMile', 1, 0); | ||
pComp = exports.getXMLNodeValue(Task[i], 'pComp', 1, 0); | ||
pGroup = exports.getXMLNodeValue(Task[i], 'pGroup', 1, 0); | ||
pParent = exports.getXMLNodeValue(Task[i], 'pParent', 1, 0); | ||
pRes = exports.getXMLNodeValue(Task[i], 'pRes', 2, ''); | ||
pOpen = exports.getXMLNodeValue(Task[i], 'pOpen', 1, 1); | ||
pDepend = exports.getXMLNodeValue(Task[i], 'pDepend', 2, ''); | ||
pCaption = exports.getXMLNodeValue(Task[i], 'pCaption', 2, ''); | ||
pNotes = exports.getXMLNodeValue(Task[i], 'pNotes', 2, ''); | ||
pClass = exports.getXMLNodeValue(Task[i], 'pClass', 2, ''); | ||
if (typeof pClass == 'undefined') { | ||
@@ -273,3 +274,3 @@ if (pGroup > 0) | ||
// Finally add the task | ||
pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID, pName, pStart, pEnd, pClass, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGanttVar)); | ||
pGanttVar.AddTaskItem(new task_1.TaskItem(pID, pName, pStart, pEnd, pClass, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGanttVar)); | ||
} | ||
@@ -276,0 +277,0 @@ } |
{ | ||
"name": "jsgantt-improved", | ||
"version": "1.8.1", | ||
"version": "1.8.2", | ||
"description": "jsgantt-improved", | ||
@@ -19,3 +19,3 @@ "main": "dist/index.js", | ||
"type": "git", | ||
"url": "git+https://github.com/jsGanttImproved/jsgantt-improved" | ||
"url": "git+https://github.com/mariohmol/jsgantt-improved" | ||
}, | ||
@@ -25,5 +25,5 @@ "author": "Eduardo Rodrigues, Ricardo Cardoso, Mario Mol <mariohmol@gmail.com>", | ||
"bugs": { | ||
"url": "https://github.com/jsGanttImproved/jsgantt-improved/issues" | ||
"url": "https://github.com/mariohmol/jsgantt-improved/issues" | ||
}, | ||
"homepage": "https://github.com/jsGanttImproved/jsgantt-improved#readme", | ||
"homepage": "https://github.com/mariohmol/jsgantt-improved#readme", | ||
"dependencies": { | ||
@@ -30,0 +30,0 @@ "randexp": "^0.5.3", |
145
src/draw.ts
@@ -1,5 +0,8 @@ | ||
declare var JSGantt: any; | ||
import * as lang from './lang'; | ||
import { mouseOver, mouseOut } from "./events"; | ||
import { mouseOver, mouseOut, addThisRowListeners, addTooltipListeners, addScrollListeners, addFormatListeners, moveToolTip, addFolderListeners } from "./events"; | ||
import { | ||
parseDateFormatStr, formatDateStr, getOffset, parseDateStr, getZoomFactor, | ||
getScrollPositions, getMaxDate, getMinDate | ||
} from './utils'; | ||
import { sortTasks } from './task'; | ||
@@ -47,3 +50,3 @@ // Recursively process task tree ... set min, max dates of parent tasks and identfy task level. | ||
if (pList[i].getParItem() && pList[i].getParItem().getGroup() == 2) pList[i].setGroup(2); | ||
JSGantt.processRows(vList, pList[i].getID(), i, vLevel + 1, vVisible, 0); | ||
processRows(vList, pList[i].getID(), i, vLevel + 1, vVisible, 0); | ||
} | ||
@@ -84,3 +87,3 @@ | ||
if (pID == 0 && pUseSort == 1) { | ||
JSGantt.sortTasks(pList, 0, 0); | ||
sortTasks(pList, 0, 0); | ||
pList.sort(function (a, b) { return a.getSortIdx() - b.getSortIdx(); }); | ||
@@ -93,3 +96,3 @@ } | ||
vComb = true; | ||
JSGantt.sortTasks(pList, pList[i].getID(), pList[i].getSortIdx() + 1); | ||
sortTasks(pList, pList[i].getID(), pList[i].getSortIdx() + 1); | ||
} | ||
@@ -132,15 +135,15 @@ } | ||
var vDateInputFormat = 'yyyy-mm-dd'; | ||
var vDateTaskTableDisplayFormat = JSGantt.parseDateFormatStr('dd/mm/yyyy'); | ||
var vDateTaskDisplayFormat = JSGantt.parseDateFormatStr('dd month yyyy'); | ||
var vHourMajorDateDisplayFormat = JSGantt.parseDateFormatStr('day dd month yyyy'); | ||
var vHourMinorDateDisplayFormat = JSGantt.parseDateFormatStr('HH'); | ||
var vDayMajorDateDisplayFormat = JSGantt.parseDateFormatStr('dd/mm/yyyy'); | ||
var vDayMinorDateDisplayFormat = JSGantt.parseDateFormatStr('dd'); | ||
var vWeekMajorDateDisplayFormat = JSGantt.parseDateFormatStr('yyyy'); | ||
var vWeekMinorDateDisplayFormat = JSGantt.parseDateFormatStr('dd/mm'); | ||
var vMonthMajorDateDisplayFormat = JSGantt.parseDateFormatStr('yyyy'); | ||
var vMonthMinorDateDisplayFormat = JSGantt.parseDateFormatStr('mon'); | ||
var vQuarterMajorDateDisplayFormat = JSGantt.parseDateFormatStr('yyyy'); | ||
var vQuarterMinorDateDisplayFormat = JSGantt.parseDateFormatStr('qq'); | ||
var vUseFullYear = JSGantt.parseDateFormatStr('dd/mm/yyyy'); | ||
var vDateTaskTableDisplayFormat = parseDateFormatStr('dd/mm/yyyy'); | ||
var vDateTaskDisplayFormat = parseDateFormatStr('dd month yyyy'); | ||
var vHourMajorDateDisplayFormat = parseDateFormatStr('day dd month yyyy'); | ||
var vHourMinorDateDisplayFormat = parseDateFormatStr('HH'); | ||
var vDayMajorDateDisplayFormat = parseDateFormatStr('dd/mm/yyyy'); | ||
var vDayMinorDateDisplayFormat = parseDateFormatStr('dd'); | ||
var vWeekMajorDateDisplayFormat = parseDateFormatStr('yyyy'); | ||
var vWeekMinorDateDisplayFormat = parseDateFormatStr('dd/mm'); | ||
var vMonthMajorDateDisplayFormat = parseDateFormatStr('yyyy'); | ||
var vMonthMinorDateDisplayFormat = parseDateFormatStr('mon'); | ||
var vQuarterMajorDateDisplayFormat = parseDateFormatStr('yyyy'); | ||
var vQuarterMinorDateDisplayFormat = parseDateFormatStr('qq'); | ||
var vUseFullYear = parseDateFormatStr('dd/mm/yyyy'); | ||
var vCaptionType; | ||
@@ -213,14 +216,14 @@ var vDepId = 1; | ||
this.setDateInputFormat = function (pVal) { vDateInputFormat = pVal; }; | ||
this.setDateTaskTableDisplayFormat = function (pVal) { vDateTaskTableDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setDateTaskDisplayFormat = function (pVal) { vDateTaskDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setHourMajorDateDisplayFormat = function (pVal) { vHourMajorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setHourMinorDateDisplayFormat = function (pVal) { vHourMinorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setDayMajorDateDisplayFormat = function (pVal) { vDayMajorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setDayMinorDateDisplayFormat = function (pVal) { vDayMinorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setWeekMajorDateDisplayFormat = function (pVal) { vWeekMajorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setWeekMinorDateDisplayFormat = function (pVal) { vWeekMinorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setMonthMajorDateDisplayFormat = function (pVal) { vMonthMajorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setMonthMinorDateDisplayFormat = function (pVal) { vMonthMinorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setQuarterMajorDateDisplayFormat = function (pVal) { vQuarterMajorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setQuarterMinorDateDisplayFormat = function (pVal) { vQuarterMinorDateDisplayFormat = JSGantt.parseDateFormatStr(pVal); }; | ||
this.setDateTaskTableDisplayFormat = function (pVal) { vDateTaskTableDisplayFormat = parseDateFormatStr(pVal); }; | ||
this.setDateTaskDisplayFormat = function (pVal) { vDateTaskDisplayFormat = parseDateFormatStr(pVal); }; | ||
this.setHourMajorDateDisplayFormat = function (pVal) { vHourMajorDateDisplayFormat = parseDateFormatStr(pVal); }; | ||
this.setHourMinorDateDisplayFormat = function (pVal) { vHourMinorDateDisplayFormat = parseDateFormatStr(pVal); }; | ||
this.setDayMajorDateDisplayFormat = function (pVal) { vDayMajorDateDisplayFormat = parseDateFormatStr(pVal); }; | ||
this.setDayMinorDateDisplayFormat = function (pVal) { vDayMinorDateDisplayFormat = parseDateFormatStr(pVal); }; | ||
this.setWeekMajorDateDisplayFormat = function (pVal) { vWeekMajorDateDisplayFormat = parseDateFormatStr(pVal); }; | ||
this.setWeekMinorDateDisplayFormat = function (pVal) { vWeekMinorDateDisplayFormat = parseDateFormatStr(pVal); }; | ||
this.setMonthMajorDateDisplayFormat = function (pVal) { vMonthMajorDateDisplayFormat = parseDateFormatStr(pVal); }; | ||
this.setMonthMinorDateDisplayFormat = function (pVal) { vMonthMinorDateDisplayFormat = parseDateFormatStr(pVal); }; | ||
this.setQuarterMajorDateDisplayFormat = function (pVal) { vQuarterMajorDateDisplayFormat = parseDateFormatStr(pVal); }; | ||
this.setQuarterMinorDateDisplayFormat = function (pVal) { vQuarterMinorDateDisplayFormat = parseDateFormatStr(pVal); }; | ||
this.setCaptionType = function (pType) { vCaptionType = pType; }; | ||
@@ -521,8 +524,8 @@ this.setFormat = function (pFormat) { | ||
// Process all tasks, reset parent date and completion % if task list has altered | ||
if (vProcessNeeded) JSGantt.processRows(vTaskList, 0, -1, 1, 1, this.getUseSort()); | ||
if (vProcessNeeded) processRows(vTaskList, 0, -1, 1, 1, this.getUseSort()); | ||
vProcessNeeded = false; | ||
// get overall min/max dates plus padding | ||
vMinDate = JSGantt.getMinDate(vTaskList, vFormat); | ||
vMaxDate = JSGantt.getMaxDate(vTaskList, vFormat); | ||
vMinDate = getMinDate(vTaskList, vFormat); | ||
vMaxDate = getMaxDate(vTaskList, vFormat); | ||
@@ -589,3 +592,3 @@ // Calculate chart width variables. | ||
vTaskList[i].setGroupSpan(vTmpSpan); | ||
JSGantt.addFolderListeners(this, vTmpSpan, vID); | ||
addFolderListeners(this, vTmpSpan, vID); | ||
vTmpDiv.appendChild(document.createTextNode('\u00A0' + vTaskList[i].getName())); | ||
@@ -612,7 +615,7 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, 'gstartdate'); | ||
vTmpDiv = this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTaskList[i].getStart(), vDateTaskTableDisplayFormat, vLangs[vLang])); | ||
vTmpDiv = this.newNode(vTmpCell, 'div', null, null, formatDateStr(vTaskList[i].getStart(), vDateTaskTableDisplayFormat, vLangs[vLang])); | ||
} | ||
if (vShowEndDate == 1) { | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, 'genddate'); | ||
vTmpDiv = this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTaskList[i].getEnd(), vDateTaskTableDisplayFormat, vLangs[vLang])); | ||
vTmpDiv = this.newNode(vTmpCell, 'div', null, null, formatDateStr(vTaskList[i].getEnd(), vDateTaskTableDisplayFormat, vLangs[vLang])); | ||
} | ||
@@ -661,6 +664,6 @@ vNumRows++; | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass, null, null, null, null, 7); | ||
vCellContents += JSGantt.formatDateStr(vTmpDate, vDayMajorDateDisplayFormat, vLangs[vLang]); | ||
vCellContents += formatDateStr(vTmpDate, vDayMajorDateDisplayFormat, vLangs[vLang]); | ||
vTmpDate.setDate(vTmpDate.getDate() + 6); | ||
if (vShowEndWeekDate == 1) vCellContents += ' - ' + JSGantt.formatDateStr(vTmpDate, vDayMajorDateDisplayFormat, vLangs[vLang]); | ||
if (vShowEndWeekDate == 1) vCellContents += ' - ' + formatDateStr(vTmpDate, vDayMajorDateDisplayFormat, vLangs[vLang]); | ||
@@ -672,3 +675,3 @@ this.newNode(vTmpCell, 'div', null, null, vCellContents, vColWidth * 7); | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass, null, vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vWeekMajorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, formatDateStr(vTmpDate, vWeekMajorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
vTmpDate.setDate(vTmpDate.getDate() + 7); | ||
@@ -680,3 +683,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass, null, null, null, null, vColSpan); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vMonthMajorDateDisplayFormat, vLangs[vLang]), vColWidth * vColSpan); | ||
this.newNode(vTmpCell, 'div', null, null, formatDateStr(vTmpDate, vMonthMajorDateDisplayFormat, vLangs[vLang]), vColWidth * vColSpan); | ||
vTmpDate.setFullYear(vTmpDate.getFullYear() + 1, 0, 1); | ||
@@ -688,3 +691,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass, null, null, null, null, vColSpan); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vQuarterMajorDateDisplayFormat, vLangs[vLang]), vColWidth * vColSpan); | ||
this.newNode(vTmpCell, 'div', null, null, formatDateStr(vTmpDate, vQuarterMajorDateDisplayFormat, vLangs[vLang]), vColWidth * vColSpan); | ||
vTmpDate.setFullYear(vTmpDate.getFullYear() + 1, 0, 1); | ||
@@ -698,3 +701,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass, null, null, null, null, vColSpan); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vHourMajorDateDisplayFormat, vLangs[vLang]), vColWidth * vColSpan); | ||
this.newNode(vTmpCell, 'div', null, null, formatDateStr(vTmpDate, vHourMajorDateDisplayFormat, vLangs[vLang]), vColWidth * vColSpan); | ||
vTmpDate.setHours(0); | ||
@@ -724,3 +727,3 @@ vTmpDate.setDate(vTmpDate.getDate() + 1); | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vDayMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, formatDateStr(vTmpDate, vDayMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
vNumCols++; | ||
@@ -734,3 +737,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vWeekMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, formatDateStr(vTmpDate, vWeekMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
vNumCols++; | ||
@@ -744,3 +747,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vMonthMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, formatDateStr(vTmpDate, vMonthMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
vNumCols++; | ||
@@ -758,3 +761,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vQuarterMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, formatDateStr(vTmpDate, vQuarterMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
vNumCols++; | ||
@@ -772,3 +775,3 @@ } | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, vHeaderCellClass); | ||
this.newNode(vTmpCell, 'div', null, null, JSGantt.formatDateStr(vTmpDate, vHourMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
this.newNode(vTmpCell, 'div', null, null, formatDateStr(vTmpDate, vHourMinorDateDisplayFormat, vLangs[vLang]), vColWidth); | ||
vNumCols++; | ||
@@ -808,4 +811,4 @@ } | ||
vTaskLeftPx = JSGantt.getOffset(vMinDate, curTaskStart, vColWidth, vFormat); | ||
vTaskRightPx = JSGantt.getOffset(curTaskStart, curTaskEnd, vColWidth, vFormat); | ||
vTaskLeftPx = getOffset(vMinDate, curTaskStart, vColWidth, vFormat); | ||
vTaskRightPx = getOffset(curTaskStart, curTaskEnd, vColWidth, vFormat); | ||
@@ -822,3 +825,3 @@ vID = vTaskList[i].getID(); | ||
vTaskList[i].setChildRow(vTmpRow); | ||
JSGantt.addThisRowListeners(this, vTaskList[i].getListChildRow(), vTmpRow); | ||
addThisRowListeners(this, vTaskList[i].getListChildRow(), vTmpRow); | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, 'gtaskcell'); | ||
@@ -860,3 +863,3 @@ vTmpDiv = this.newNode(vTmpCell, 'div', null, 'gtaskcelldiv', '\u00A0\u00A0'); | ||
vTaskList[i].setChildRow(vTmpRow); | ||
JSGantt.addThisRowListeners(this, vTaskList[i].getListChildRow(), vTmpRow); | ||
addThisRowListeners(this, vTaskList[i].getListChildRow(), vTmpRow); | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, 'gtaskcell'); | ||
@@ -897,3 +900,3 @@ vTmpDiv = this.newNode(vTmpCell, 'div', null, 'gtaskcelldiv', '\u00A0\u00A0'); | ||
vTaskList[i].setChildRow(vTmpRow); | ||
JSGantt.addThisRowListeners(this, vTaskList[i].getListChildRow(), vTmpRow); | ||
addThisRowListeners(this, vTaskList[i].getListChildRow(), vTmpRow); | ||
vTmpCell = this.newNode(vTmpRow, 'td', null, 'gtaskcell'); | ||
@@ -938,3 +941,3 @@ vTmpDiv = this.newNode(vTmpCell, 'div', null, 'gtaskcelldiv', '\u00A0\u00A0'); | ||
vTmpDiv2.appendChild(this.createTaskInfo(vTaskList[i])); | ||
JSGantt.addTooltipListeners(this, vTaskList[i].getTaskDiv(), vTmpDiv2); | ||
addTooltipListeners(this, vTaskList[i].getTaskDiv(), vTmpDiv2); | ||
} | ||
@@ -962,3 +965,3 @@ } | ||
// Now all the content exists, register scroll listeners | ||
JSGantt.addScrollListeners(this); | ||
addScrollListeners(this); | ||
@@ -974,6 +977,6 @@ // now check if we are actually scrolling the pane | ||
else { | ||
vScrollDate = JSGantt.parseDateStr(vScrollTo, this.getDateInputFormat()); | ||
vScrollDate = parseDateStr(vScrollTo, this.getDateInputFormat()); | ||
if (vFormat == 'hour') vScrollDate.setMinutes(0, 0, 0); | ||
else vScrollDate.setHours(0, 0, 0, 0); | ||
vScrollPx = JSGantt.getOffset(vMinDate, vScrollDate, vColWidth, vFormat); | ||
vScrollPx = getOffset(vMinDate, vScrollDate, vColWidth, vFormat); | ||
} | ||
@@ -983,3 +986,3 @@ this.getChartBody().scrollLeft = vScrollPx; | ||
if (vMinDate.getTime() <= (new Date()).getTime() && vMaxDate.getTime() >= (new Date()).getTime()) vTodayPx = JSGantt.getOffset(vMinDate, new Date(), vColWidth, vFormat); | ||
if (vMinDate.getTime() <= (new Date()).getTime() && vMaxDate.getTime() >= (new Date()).getTime()) vTodayPx = getOffset(vMinDate, new Date(), vColWidth, vFormat); | ||
else vTodayPx = -1; | ||
@@ -1006,15 +1009,15 @@ this.DrawDependencies(); | ||
if (vFormatArr.join().toLowerCase().indexOf('hour') != -1) | ||
JSGantt.addFormatListeners(this, 'hour', this.newNode(vTmpDiv, 'span', vDivId + 'formathour' + pPos, 'gformlabel' + ((vFormat == 'hour') ? ' gselected' : ''), vLangs[vLang]['hour'])); | ||
addFormatListeners(this, 'hour', this.newNode(vTmpDiv, 'span', vDivId + 'formathour' + pPos, 'gformlabel' + ((vFormat == 'hour') ? ' gselected' : ''), vLangs[vLang]['hour'])); | ||
if (vFormatArr.join().toLowerCase().indexOf('day') != -1) | ||
JSGantt.addFormatListeners(this, 'day', this.newNode(vTmpDiv, 'span', vDivId + 'formatday' + pPos, 'gformlabel' + ((vFormat == 'day') ? ' gselected' : ''), vLangs[vLang]['day'])); | ||
addFormatListeners(this, 'day', this.newNode(vTmpDiv, 'span', vDivId + 'formatday' + pPos, 'gformlabel' + ((vFormat == 'day') ? ' gselected' : ''), vLangs[vLang]['day'])); | ||
if (vFormatArr.join().toLowerCase().indexOf('week') != -1) | ||
JSGantt.addFormatListeners(this, 'week', this.newNode(vTmpDiv, 'span', vDivId + 'formatweek' + pPos, 'gformlabel' + ((vFormat == 'week') ? ' gselected' : ''), vLangs[vLang]['week'])); | ||
addFormatListeners(this, 'week', this.newNode(vTmpDiv, 'span', vDivId + 'formatweek' + pPos, 'gformlabel' + ((vFormat == 'week') ? ' gselected' : ''), vLangs[vLang]['week'])); | ||
if (vFormatArr.join().toLowerCase().indexOf('month') != -1) | ||
JSGantt.addFormatListeners(this, 'month', this.newNode(vTmpDiv, 'span', vDivId + 'formatmonth' + pPos, 'gformlabel' + ((vFormat == 'month') ? ' gselected' : ''), vLangs[vLang]['month'])); | ||
addFormatListeners(this, 'month', this.newNode(vTmpDiv, 'span', vDivId + 'formatmonth' + pPos, 'gformlabel' + ((vFormat == 'month') ? ' gselected' : ''), vLangs[vLang]['month'])); | ||
if (vFormatArr.join().toLowerCase().indexOf('quarter') != -1) | ||
JSGantt.addFormatListeners(this, 'quarter', this.newNode(vTmpDiv, 'span', vDivId + 'formatquarter' + pPos, 'gformlabel' + ((vFormat == 'quarter') ? ' gselected' : ''), vLangs[vLang]['quarter'])); | ||
addFormatListeners(this, 'quarter', this.newNode(vTmpDiv, 'span', vDivId + 'formatquarter' + pPos, 'gformlabel' + ((vFormat == 'quarter') ? ' gselected' : ''), vLangs[vLang]['quarter'])); | ||
} | ||
@@ -1035,3 +1038,3 @@ else { | ||
this.newNode(vTmpDiv, 'span', null, 'gTaskLabel', vLangs[vLang]['startdate'] + ': '); | ||
this.newNode(vTmpDiv, 'span', null, 'gTaskText', JSGantt.formatDateStr(pTask.getStart(), vDateTaskDisplayFormat, vLangs[vLang])); | ||
this.newNode(vTmpDiv, 'span', null, 'gTaskText', formatDateStr(pTask.getStart(), vDateTaskDisplayFormat, vLangs[vLang])); | ||
} | ||
@@ -1041,3 +1044,3 @@ if (vShowTaskInfoEndDate == 1) { | ||
this.newNode(vTmpDiv, 'span', null, 'gTaskLabel', vLangs[vLang]['enddate'] + ': '); | ||
this.newNode(vTmpDiv, 'span', null, 'gTaskText', JSGantt.formatDateStr(pTask.getEnd(), vDateTaskDisplayFormat, vLangs[vLang])); | ||
this.newNode(vTmpDiv, 'span', null, 'gTaskText', formatDateStr(pTask.getEnd(), vDateTaskDisplayFormat, vLangs[vLang])); | ||
} | ||
@@ -1086,3 +1089,3 @@ if (vShowTaskInfoDur == 1 && !pTask.getMile()) { | ||
var vTask = ''; | ||
var vOutFrmt = JSGantt.parseDateFormatStr(this.getDateInputFormat() + ' HH:MI'); | ||
var vOutFrmt = parseDateFormatStr(this.getDateInputFormat() + ' HH:MI'); | ||
if (pIdx === true) vIdx = pID; | ||
@@ -1099,4 +1102,4 @@ else { | ||
vTask += '<pName>' + vTaskList[vIdx].getName() + '</pName>'; | ||
vTask += '<pStart>' + JSGantt.formatDateStr(vTaskList[vIdx].getStart(), vOutFrmt, vLangs[vLang]) + '</pStart>'; | ||
vTask += '<pEnd>' + JSGantt.formatDateStr(vTaskList[vIdx].getEnd(), vOutFrmt, vLangs[vLang]) + '</pEnd>'; | ||
vTask += '<pStart>' + formatDateStr(vTaskList[vIdx].getStart(), vOutFrmt, vLangs[vLang]) + '</pStart>'; | ||
vTask += '<pEnd>' + formatDateStr(vTaskList[vIdx].getEnd(), vOutFrmt, vLangs[vLang]) + '</pEnd>'; | ||
vTask += '<pClass>' + vTaskList[vIdx].getClass() + '</pClass>'; | ||
@@ -1147,3 +1150,3 @@ vTask += '<pLink>' + vTaskList[vIdx].getLink() + '</pLink>'; | ||
var vZoomFactor = JSGantt.getZoomFactor(); | ||
var vZoomFactor = getZoomFactor(); | ||
if (vZoomFactor != 1) {// IE 7 at non-default zoom level | ||
@@ -1155,3 +1158,3 @@ vMouseX = Math.round(vMouseX / vZoomFactor); | ||
var vScrollPos = JSGantt.getScrollPositions(); | ||
var vScrollPos = getScrollPositions(); | ||
@@ -1194,3 +1197,3 @@ /* Code for positioned right of the mouse by default*/ | ||
clearInterval(pGanttChartObj.vTool.moveInterval); | ||
pGanttChartObj.vTool.moveInterval = setInterval(function () { JSGantt.moveToolTip(vNewX, vNewY, pGanttChartObj.vTool, pTimer); }, pTimer); | ||
pGanttChartObj.vTool.moveInterval = setInterval(function () { moveToolTip(vNewX, vNewY, pGanttChartObj.vTool, pTimer); }, pTimer); | ||
} | ||
@@ -1197,0 +1200,0 @@ else { |
@@ -1,2 +0,4 @@ | ||
declare var JSGantt: any; | ||
import { delayedHide, changeFormat, stripIds, isIE, findObj, fadeToolTip } from "./utils"; | ||
import { folder } from "./task"; | ||
import { updateFlyingObj } from "./draw"; | ||
@@ -43,3 +45,3 @@ export const mouseOver = function (pObj1, pObj2) { | ||
this.addListener('mouseover', function () { clearTimeout(pGanttChartObj.vTool.delayTimeout); }, pGanttChartObj.vTool); | ||
this.addListener('mouseout', function () { JSGantt.delayedHide(pGanttChartObj, pGanttChartObj.vTool, pTimer); }, pGanttChartObj.vTool); | ||
this.addListener('mouseout', function () { delayedHide(pGanttChartObj, pGanttChartObj.vTool, pTimer); }, pGanttChartObj.vTool); | ||
} | ||
@@ -53,3 +55,3 @@ clearTimeout(pGanttChartObj.vTool.delayTimeout); | ||
// as we are allowing arbitrary HTML we should remove any tag ids to prevent duplication | ||
JSGantt.stripIds(pGanttChartObj.vTool.vToolCont); | ||
stripIds(pGanttChartObj.vTool.vToolCont); | ||
} | ||
@@ -59,5 +61,5 @@ | ||
// Rather than follow the mouse just have it stay put | ||
JSGantt.updateFlyingObj(e, pGanttChartObj, pTimer); | ||
updateFlyingObj(e, pGanttChartObj, pTimer); | ||
pGanttChartObj.vTool.style.width = (pWidth) ? pWidth + 'px' : 'auto'; | ||
if (!pWidth && JSGantt.isIE()) { | ||
if (!pWidth && isIE()) { | ||
pGanttChartObj.vTool.style.width = pGanttChartObj.vTool.offsetWidth; | ||
@@ -70,3 +72,3 @@ } | ||
clearInterval(pGanttChartObj.vTool.fadeInterval); | ||
pGanttChartObj.vTool.fadeInterval = setInterval(function () { JSGantt.fadeToolTip(1, pGanttChartObj.vTool, vMaxAlpha); }, pTimer); | ||
pGanttChartObj.vTool.fadeInterval = setInterval(function () { fadeToolTip(1, pGanttChartObj.vTool, vMaxAlpha); }, pTimer); | ||
} | ||
@@ -80,40 +82,5 @@ else { | ||
export const hideToolTip = function (pGanttChartObj, pTool, pTimer) { | ||
if (pGanttChartObj.getUseFade()) { | ||
clearInterval(pTool.fadeInterval); | ||
pTool.fadeInterval = setInterval(function () { JSGantt.fadeToolTip(-1, pTool, 0); }, pTimer); | ||
} | ||
else { | ||
pTool.style.opacity = 0; | ||
pTool.style.filter = 'alpha(opacity=0)'; | ||
pTool.style.visibility = 'hidden'; | ||
} | ||
}; | ||
export const fadeToolTip = function (pDirection, pTool, pMaxAlpha) { | ||
var vIncrement = parseInt(pTool.getAttribute('fadeIncrement')); | ||
var vAlpha = pTool.getAttribute('currentOpacity'); | ||
var vCurAlpha = parseInt(vAlpha); | ||
if ((vCurAlpha != pMaxAlpha && pDirection == 1) || (vCurAlpha != 0 && pDirection == -1)) { | ||
var i = vIncrement; | ||
if (pMaxAlpha - vCurAlpha < vIncrement && pDirection == 1) { | ||
i = pMaxAlpha - vCurAlpha; | ||
} else if (vAlpha < vIncrement && pDirection == -1) { | ||
i = vCurAlpha; | ||
} | ||
vAlpha = vCurAlpha + (i * pDirection); | ||
pTool.style.opacity = vAlpha * 0.01; | ||
pTool.style.filter = 'alpha(opacity=' + vAlpha + ')'; | ||
pTool.setAttribute('currentOpacity', vAlpha); | ||
} else { | ||
clearInterval(pTool.fadeInterval); | ||
if (pDirection == -1) { | ||
pTool.style.opacity = 0; | ||
pTool.style.filter = 'alpha(opacity=0)'; | ||
pTool.style.visibility = 'hidden'; | ||
} | ||
} | ||
}; | ||
export const moveToolTip = function (pNewX, pNewY, pTool) { | ||
export const moveToolTip = function (pNewX, pNewY, pTool, timer) { | ||
var vSpeed = parseInt(pTool.getAttribute('moveSpeed')); | ||
@@ -140,1 +107,49 @@ var vOldX = parseInt(pTool.style.left); | ||
}; | ||
export const addListener = function (eventName, handler, control) { | ||
// Check if control is a string | ||
if (control === String(control)) control = findObj(control); | ||
if (control.addEventListener) //Standard W3C | ||
{ | ||
return control.addEventListener(eventName, handler, false); | ||
} | ||
else if (control.attachEvent) //IExplore | ||
{ | ||
return control.attachEvent('on' + eventName, handler); | ||
} | ||
else { | ||
return false; | ||
} | ||
}; | ||
export const addTooltipListeners = function (pGanttChart, pObj1, pObj2) { | ||
addListener('mouseover', function (e) { showToolTip(pGanttChart, e, pObj2, null, pGanttChart.getTimer()); }, pObj1); | ||
addListener('mouseout', function (e) { delayedHide(pGanttChart, pGanttChart.vTool, pGanttChart.getTimer()); }, pObj1); | ||
}; | ||
export const addThisRowListeners = function (pGanttChart, pObj1, pObj2) { | ||
addListener('mouseover', function () { pGanttChart.mouseOver(pObj1, pObj2); }, pObj1); | ||
addListener('mouseover', function () { pGanttChart.mouseOver(pObj1, pObj2); }, pObj2); | ||
addListener('mouseout', function () { pGanttChart.mouseOut(pObj1, pObj2); }, pObj1); | ||
addListener('mouseout', function () { pGanttChart.mouseOut(pObj1, pObj2); }, pObj2); | ||
}; | ||
export const addFolderListeners = function (pGanttChart, pObj, pID) { | ||
addListener('click', function () { folder(pID, pGanttChart); }, pObj); | ||
}; | ||
export const addFormatListeners = function (pGanttChart, pFormat, pObj) { | ||
addListener('click', function () { changeFormat(pFormat, pGanttChart); }, pObj); | ||
}; | ||
export const addScrollListeners = function (pGanttChart) { | ||
addListener('scroll', function () { pGanttChart.getChartBody().scrollTop = pGanttChart.getListBody().scrollTop; }, pGanttChart.getListBody()); | ||
addListener('scroll', function () { pGanttChart.getListBody().scrollTop = pGanttChart.getChartBody().scrollTop; }, pGanttChart.getChartBody()); | ||
addListener('scroll', function () { pGanttChart.getChartHead().scrollLeft = pGanttChart.getChartBody().scrollLeft; }, pGanttChart.getChartBody()); | ||
addListener('scroll', function () { pGanttChart.getChartBody().scrollLeft = pGanttChart.getChartHead().scrollLeft; }, pGanttChart.getChartHead()); | ||
addListener('resize', function () { pGanttChart.getChartHead().scrollLeft = pGanttChart.getChartBody().scrollLeft; }, window); | ||
addListener('resize', function () { pGanttChart.getListBody().scrollTop = pGanttChart.getChartBody().scrollTop; }, window); | ||
}; |
@@ -65,4 +65,6 @@ /* | ||
import { showToolTip, hideToolTip, fadeToolTip, moveToolTip } from "./events"; | ||
import { getMinDate, getMaxDate, findObj, changeFormat, parseDateStr, formatDateStr, parseDateFormatStr, stripIds, stripUnwanted, delayedHide, getOffset, getScrollPositions, isIE, benchMark, getIsoWeek, getZoomFactor } from "./utils"; | ||
import { showToolTip, moveToolTip, addTooltipListeners, addThisRowListeners, addFormatListeners, addScrollListeners, addFolderListeners, addListener } from "./events"; | ||
import { getMinDate, getMaxDate, findObj, changeFormat, parseDateStr, | ||
formatDateStr, parseDateFormatStr, stripIds, stripUnwanted, delayedHide, getOffset, | ||
getScrollPositions, isIE, benchMark, getIsoWeek, getZoomFactor, hideToolTip, fadeToolTip } from "./utils"; | ||
import { parseXML, parseXMLString, findXMLNode, getXMLNodeValue, AddXMLTask } from './xml'; | ||
@@ -132,47 +134,7 @@ import { folder, hide, show, taskLink, sortTasks, TaskItem } from "./task"; | ||
JSGantt.addListener = function (eventName, handler, control) { | ||
// Check if control is a string | ||
if (control === String(control)) control = JSGantt.findObj(control); | ||
if (control.addEventListener) //Standard W3C | ||
{ | ||
return control.addEventListener(eventName, handler, false); | ||
} | ||
else if (control.attachEvent) //IExplore | ||
{ | ||
return control.attachEvent('on' + eventName, handler); | ||
} | ||
else { | ||
return false; | ||
} | ||
}; | ||
JSGantt.addTooltipListeners = function (pGanttChart, pObj1, pObj2) { | ||
JSGantt.addListener('mouseover', function (e) { JSGantt.showToolTip(pGanttChart, e, pObj2, null, pGanttChart.getTimer()); }, pObj1); | ||
JSGantt.addListener('mouseout', function (e) { JSGantt.delayedHide(pGanttChart, pGanttChart.vTool, pGanttChart.getTimer()); }, pObj1); | ||
}; | ||
JSGantt.addThisRowListeners = function (pGanttChart, pObj1, pObj2) { | ||
JSGantt.addListener('mouseover', function () { pGanttChart.mouseOver(pObj1, pObj2); }, pObj1); | ||
JSGantt.addListener('mouseover', function () { pGanttChart.mouseOver(pObj1, pObj2); }, pObj2); | ||
JSGantt.addListener('mouseout', function () { pGanttChart.mouseOut(pObj1, pObj2); }, pObj1); | ||
JSGantt.addListener('mouseout', function () { pGanttChart.mouseOut(pObj1, pObj2); }, pObj2); | ||
}; | ||
JSGantt.addFolderListeners = function (pGanttChart, pObj, pID) { | ||
JSGantt.addListener('click', function () { JSGantt.folder(pID, pGanttChart); }, pObj); | ||
}; | ||
JSGantt.addFormatListeners = function (pGanttChart, pFormat, pObj) { | ||
JSGantt.addListener('click', function () { JSGantt.changeFormat(pFormat, pGanttChart); }, pObj); | ||
}; | ||
JSGantt.addScrollListeners = function (pGanttChart) { | ||
JSGantt.addListener('scroll', function () { pGanttChart.getChartBody().scrollTop = pGanttChart.getListBody().scrollTop; }, pGanttChart.getListBody()); | ||
JSGantt.addListener('scroll', function () { pGanttChart.getListBody().scrollTop = pGanttChart.getChartBody().scrollTop; }, pGanttChart.getChartBody()); | ||
JSGantt.addListener('scroll', function () { pGanttChart.getChartHead().scrollLeft = pGanttChart.getChartBody().scrollLeft; }, pGanttChart.getChartBody()); | ||
JSGantt.addListener('scroll', function () { pGanttChart.getChartBody().scrollLeft = pGanttChart.getChartHead().scrollLeft; }, pGanttChart.getChartHead()); | ||
JSGantt.addListener('resize', function () { pGanttChart.getChartHead().scrollLeft = pGanttChart.getChartBody().scrollLeft; }, window); | ||
JSGantt.addListener('resize', function () { pGanttChart.getListBody().scrollTop = pGanttChart.getChartBody().scrollTop; }, window); | ||
}; | ||
JSGantt.addListener = addListener; | ||
JSGantt.addTooltipListeners = addTooltipListeners; | ||
JSGantt.addThisRowListeners = addThisRowListeners; | ||
JSGantt.addFolderListeners = addFolderListeners; | ||
JSGantt.addFormatListeners = addFormatListeners; | ||
JSGantt.addScrollListeners = addScrollListeners; |
@@ -1,5 +0,3 @@ | ||
declare var JSGantt: any; | ||
import { TaskItem } from "./task"; | ||
export const parseJSON = function (pFile, pGanttVar) { | ||
@@ -16,7 +14,7 @@ if ((<any>window).XMLHttpRequest) { | ||
JSGantt.addJSONTask(pGanttVar, jsonObj); | ||
addJSONTask(pGanttVar, jsonObj); | ||
}; | ||
export const parseJSONString = function (pStr, pGanttVar) { | ||
JSGantt.addJSONTask(pGanttVar, eval('(' + pStr + ')')); | ||
addJSONTask(pGanttVar, eval('(' + pStr + ')')); | ||
}; | ||
@@ -111,3 +109,3 @@ | ||
if (id != undefined && !isNaN(parseInt(id)) && isFinite(id) && name && start && end && itemClass && completion != undefined && !isNaN(parseFloat(completion)) && isFinite(completion) && !isNaN(parseInt(parent)) && isFinite(parent)) { | ||
pGanttVar.AddTaskItem(new JSGantt.TaskItem(id, name, start, end, itemClass, link, milestone, resourceName, completion, group, parent, open, dependsOn, caption, notes, pGanttVar)); | ||
pGanttVar.AddTaskItem(new TaskItem(id, name, start, end, itemClass, link, milestone, resourceName, completion, group, parent, open, dependsOn, caption, notes, pGanttVar)); | ||
} | ||
@@ -114,0 +112,0 @@ } |
@@ -1,2 +0,3 @@ | ||
declare var JSGantt: any; | ||
import { parseDateStr, isIE, stripUnwanted, getOffset } from "./utils"; | ||
declare var g: any; | ||
@@ -15,5 +16,5 @@ | ||
vList[i].setOpen(0); | ||
JSGantt.hide(pID, ganttObj); | ||
hide(pID, ganttObj); | ||
if (JSGantt.isIE()) | ||
if (isIE()) | ||
vList[i].getGroupSpan().innerText = '+'; | ||
@@ -25,5 +26,5 @@ else | ||
vList[i].setOpen(1); | ||
JSGantt.show(pID, 1, ganttObj); | ||
show(pID, 1, ganttObj); | ||
if (JSGantt.isIE()) | ||
if (isIE()) | ||
vList[i].getGroupSpan().innerText = '-'; | ||
@@ -51,3 +52,3 @@ else | ||
vList[i].setVisible(0); | ||
if (vList[i].getGroup()) JSGantt.hide(vID, ganttObj); | ||
if (vList[i].getGroup()) hide(vID, ganttObj); | ||
} | ||
@@ -67,3 +68,3 @@ } | ||
if (vList[i].getParItem().getGroupSpan()) { | ||
if (JSGantt.isIE()) vState = vList[i].getParItem().getGroupSpan().innerText; | ||
if (isIE()) vState = vList[i].getParItem().getGroupSpan().innerText; | ||
else vState = vList[i].getParItem().getGroupSpan().textContent; | ||
@@ -89,3 +90,3 @@ } | ||
} | ||
if (vList[i].getGroup()) JSGantt.show(vID, 0, ganttObj); | ||
if (vList[i].getGroup()) show(vID, 0, ganttObj); | ||
} | ||
@@ -126,3 +127,3 @@ } | ||
pList[i].setSortIdx(sortIdx++); | ||
sortIdx = JSGantt.sortTasks(pList, pList[i].getID(), sortIdx); | ||
sortIdx = sortTasks(pList, pList[i].getID(), sortIdx); | ||
} | ||
@@ -166,3 +167,3 @@ } | ||
var vCellDiv = null; | ||
var vGantt = (pGantt instanceof JSGantt.GanttChart) ? pGantt : g; //hack for backwards compatibility | ||
var vGantt = pGantt ? pGantt : g; //hack for backwards compatibility | ||
var vBarDiv = null; | ||
@@ -178,7 +179,7 @@ var vTaskDiv = null; | ||
vNotes.innerHTML = pNotes; | ||
JSGantt.stripUnwanted(vNotes); | ||
stripUnwanted(vNotes); | ||
} | ||
if (pStart != null && pStart != '') { | ||
vStart = (pStart instanceof Date) ? pStart : JSGantt.parseDateStr(document.createTextNode(pStart).data, vGantt.getDateInputFormat()); | ||
vStart = (pStart instanceof Date) ? pStart : parseDateStr(document.createTextNode(pStart).data, vGantt.getDateInputFormat()); | ||
vGroupMinStart = vStart; | ||
@@ -188,3 +189,3 @@ } | ||
if (pEnd != null && pEnd != '') { | ||
vEnd = (pEnd instanceof Date) ? pEnd : JSGantt.parseDateStr(document.createTextNode(pEnd).data, vGantt.getDateInputFormat()); | ||
vEnd = (pEnd instanceof Date) ? pEnd : parseDateStr(document.createTextNode(pEnd).data, vGantt.getDateInputFormat()); | ||
vGroupMinEnd = vEnd; | ||
@@ -258,3 +259,3 @@ } | ||
} | ||
var tmpPer = (JSGantt.getOffset(this.getStart(), vTaskEnd, 999, vUnits)) / 1000; | ||
var tmpPer = (getOffset(this.getStart(), vTaskEnd, 999, vUnits)) / 1000; | ||
if (Math.floor(tmpPer) != tmpPer) tmpPer = Math.round(tmpPer * 10) / 10; | ||
@@ -306,3 +307,3 @@ switch (vUnits) { | ||
this.setToDelete = function (pToDelete) { if (pToDelete) vToDelete = true; else vToDelete = false; }; | ||
this.setParItem = function (pParItem) { if (pParItem instanceof JSGantt.TaskItem) vParItem = pParItem; }; | ||
this.setParItem = function (pParItem) { if (pParItem) vParItem = pParItem; }; | ||
this.setCellDiv = function (pCellDiv) { if (typeof HTMLDivElement !== 'function' || pCellDiv instanceof HTMLDivElement) vCellDiv = pCellDiv; }; //"typeof HTMLDivElement !== 'function'" to play nice with ie6 and 7 | ||
@@ -309,0 +310,0 @@ this.setGroup = function (pGroup) { vGroup = parseInt(document.createTextNode(pGroup).data); }; |
@@ -1,2 +0,1 @@ | ||
declare var JSGantt: any; | ||
@@ -94,3 +93,3 @@ export const getMinDate = function (pList, pFormat) { | ||
export const findObj = function (theObj, theDoc) { | ||
export const findObj = function (theObj, theDoc = null) { | ||
var p, i, foundObj; | ||
@@ -195,8 +194,8 @@ if (!theDoc) theDoc = document; | ||
case 'ww': | ||
if (JSGantt.getIsoWeek(pDate) < 10) vDateStr += '0'; // now fall through | ||
if (getIsoWeek(pDate) < 10) vDateStr += '0'; // now fall through | ||
case 'w': | ||
vDateStr += JSGantt.getIsoWeek(pDate); | ||
vDateStr += getIsoWeek(pDate); | ||
break; | ||
case 'week': | ||
var vWeekNum = JSGantt.getIsoWeek(pDate); | ||
var vWeekNum = getIsoWeek(pDate); | ||
var vYear = pDate.getFullYear(); | ||
@@ -206,3 +205,3 @@ var vDayOfWeek = (pDate.getDay() == 0) ? 7 : pDate.getDay(); | ||
if (vWeekNum == 1 && parseInt(vMonthStr, 10) === 12) vYear++; | ||
if (vWeekNum < 10) vWeekNum = '0' + vWeekNum; | ||
if (vWeekNum < 10) vWeekNum = parseInt('0' + vWeekNum, 10); | ||
@@ -251,3 +250,3 @@ vDateStr += vYear + '-W' + vWeekNum + '-' + vDayOfWeek; | ||
if ('removeAttribute' in pNode.childNodes[i]) pNode.childNodes[i].removeAttribute('id'); | ||
if (pNode.childNodes[i].hasChildNodes()) JSGantt.stripIds(pNode.childNodes[i]); | ||
if (pNode.childNodes[i].hasChildNodes()) stripIds(pNode.childNodes[i]); | ||
} | ||
@@ -263,3 +262,3 @@ }; | ||
} | ||
if (pNode.childNodes[i].hasChildNodes()) JSGantt.stripUnwanted(pNode.childNodes[i]); | ||
if (pNode.childNodes[i].hasChildNodes()) stripUnwanted(pNode.childNodes[i]); | ||
} | ||
@@ -270,3 +269,3 @@ }; | ||
var vDelay = 1500; | ||
if (pTool) pTool.delayTimeout = setTimeout(function () { JSGantt.hideToolTip(pGanttChartObj, pTool, pTimer); }, vDelay); | ||
if (pTool) pTool.delayTimeout = setTimeout(function () { hideToolTip(pGanttChartObj, pTool, pTimer); }, vDelay); | ||
}; | ||
@@ -312,3 +311,3 @@ | ||
if (thisWeek <= 0) thisWeek = JSGantt.getIsoWeek(new Date(pDate.getFullYear() - 1, 11, 31, 0, 0, 0)); | ||
if (thisWeek <= 0) thisWeek = getIsoWeek(new Date(pDate.getFullYear() - 1, 11, 31, 0, 0, 0)); | ||
else if (thisWeek == 53 && (new Date(pDate.getFullYear(), 0, 1, 0, 0, 0)).getDay() != 4 && (new Date(pDate.getFullYear(), 11, 31, 0, 0, 0)).getDay() != 4) thisWeek = 1; | ||
@@ -323,3 +322,3 @@ return thisWeek; | ||
{ | ||
var vZoomFactor = JSGantt.getZoomFactor(); | ||
var vZoomFactor = getZoomFactor(); | ||
vScrollLeft = Math.round(document.documentElement.scrollLeft / vZoomFactor); | ||
@@ -388,1 +387,39 @@ vScrollTop = Math.round(document.documentElement.scrollTop / vZoomFactor); | ||
export const hideToolTip = function (pGanttChartObj, pTool, pTimer) { | ||
if (pGanttChartObj.getUseFade()) { | ||
clearInterval(pTool.fadeInterval); | ||
pTool.fadeInterval = setInterval(function () { fadeToolTip(-1, pTool, 0); }, pTimer); | ||
} | ||
else { | ||
pTool.style.opacity = 0; | ||
pTool.style.filter = 'alpha(opacity=0)'; | ||
pTool.style.visibility = 'hidden'; | ||
} | ||
}; | ||
export const fadeToolTip = function (pDirection, pTool, pMaxAlpha) { | ||
var vIncrement = parseInt(pTool.getAttribute('fadeIncrement')); | ||
var vAlpha = pTool.getAttribute('currentOpacity'); | ||
var vCurAlpha = parseInt(vAlpha); | ||
if ((vCurAlpha != pMaxAlpha && pDirection == 1) || (vCurAlpha != 0 && pDirection == -1)) { | ||
var i = vIncrement; | ||
if (pMaxAlpha - vCurAlpha < vIncrement && pDirection == 1) { | ||
i = pMaxAlpha - vCurAlpha; | ||
} else if (vAlpha < vIncrement && pDirection == -1) { | ||
i = vCurAlpha; | ||
} | ||
vAlpha = vCurAlpha + (i * pDirection); | ||
pTool.style.opacity = vAlpha * 0.01; | ||
pTool.style.filter = 'alpha(opacity=' + vAlpha + ')'; | ||
pTool.setAttribute('currentOpacity', vAlpha); | ||
} else { | ||
clearInterval(pTool.fadeInterval); | ||
if (pDirection == -1) { | ||
pTool.style.opacity = 0; | ||
pTool.style.filter = 'alpha(opacity=0)'; | ||
pTool.style.visibility = 'hidden'; | ||
} | ||
} | ||
}; |
@@ -1,2 +0,2 @@ | ||
declare var JSGantt: any; | ||
import { TaskItem } from "./task"; | ||
@@ -14,3 +14,3 @@ export const parseXML = function (pFile, pGanttVar) { | ||
JSGantt.AddXMLTask(pGanttVar, xmlDoc); | ||
AddXMLTask(pGanttVar, xmlDoc); | ||
}; | ||
@@ -28,3 +28,3 @@ | ||
JSGantt.AddXMLTask(pGanttVar, xmlDoc); | ||
AddXMLTask(pGanttVar, xmlDoc); | ||
}; | ||
@@ -75,3 +75,3 @@ | ||
var projNode = JSGantt.findXMLNode(pXmlDoc, 'Project'); | ||
var projNode = findXMLNode(pXmlDoc, 'Project'); | ||
if (typeof projNode != 'undefined' && projNode.length > 0) project = projNode[0].getAttribute('xmlns'); | ||
@@ -82,7 +82,7 @@ | ||
pGanttVar.setDateInputFormat('yyyy-mm-dd'); | ||
Task = JSGantt.findXMLNode(pXmlDoc, 'Task'); | ||
Task = findXMLNode(pXmlDoc, 'Task'); | ||
if (typeof Task == 'undefined') n = 0; | ||
else n = Task.length; | ||
var resources = JSGantt.findXMLNode(pXmlDoc, 'Resource'); | ||
var resources = findXMLNode(pXmlDoc, 'Resource'); | ||
if (typeof resources == 'undefined') { n = 0; m = 0; } | ||
@@ -92,4 +92,4 @@ else m = resources.length; | ||
for (i = 0; i < m; i++) { | ||
var resname = JSGantt.getXMLNodeValue(resources[i], 'Name', 2, ''); | ||
var uid = JSGantt.getXMLNodeValue(resources[i], 'UID', 1, -1); | ||
var resname = getXMLNodeValue(resources[i], 'Name', 2, ''); | ||
var uid = getXMLNodeValue(resources[i], 'UID', 1, -1); | ||
@@ -99,3 +99,3 @@ if (resname.length > 0 && uid > 0) res[uid] = resname; | ||
var assignments = JSGantt.findXMLNode(pXmlDoc, 'Assignment'); | ||
var assignments = findXMLNode(pXmlDoc, 'Assignment'); | ||
if (typeof assignments == 'undefined') j = 0; | ||
@@ -105,4 +105,4 @@ else j = assignments.length; | ||
for (i = 0; i < j; i++) { | ||
var resUID = JSGantt.getXMLNodeValue(assignments[i], 'ResourceUID', 1, -1); | ||
uid = JSGantt.getXMLNodeValue(assignments[i], 'TaskUID', 1, -1); | ||
var resUID = getXMLNodeValue(assignments[i], 'ResourceUID', 1, -1); | ||
uid = getXMLNodeValue(assignments[i], 'TaskUID', 1, -1); | ||
@@ -117,5 +117,5 @@ if (uid > 0) { | ||
for (i = 0; i < n; i++) { | ||
uid = JSGantt.getXMLNodeValue(Task[i], 'UID', 1, 0); | ||
uid = getXMLNodeValue(Task[i], 'UID', 1, 0); | ||
if (uid != 0) var vOutlineNumber = JSGantt.getXMLNodeValue(Task[i], 'OutlineNumber', 2, '0'); | ||
if (uid != 0) var vOutlineNumber = getXMLNodeValue(Task[i], 'OutlineNumber', 2, '0'); | ||
if (uid > 0) pars[vOutlineNumber] = uid; | ||
@@ -128,18 +128,18 @@ if (uid > maxPID) maxPID = uid; | ||
// Task ID must NOT be zero otherwise it will be skipped | ||
var pID = JSGantt.getXMLNodeValue(Task[i], 'UID', 1, 0); | ||
var pID = getXMLNodeValue(Task[i], 'UID', 1, 0); | ||
if (pID != 0) { | ||
var pName = JSGantt.getXMLNodeValue(Task[i], 'Name', 2, 'No Task Name'); | ||
var pStart = JSGantt.getXMLNodeValue(Task[i], 'Start', 2, ''); | ||
var pEnd = JSGantt.getXMLNodeValue(Task[i], 'Finish', 2, ''); | ||
var pLink = JSGantt.getXMLNodeValue(Task[i], 'HyperlinkAddress', 2, ''); | ||
var pMile = JSGantt.getXMLNodeValue(Task[i], 'Milestone', 1, 0); | ||
var pComp = JSGantt.getXMLNodeValue(Task[i], 'PercentWorkComplete', 1, 0); | ||
var pGroup = JSGantt.getXMLNodeValue(Task[i], 'Summary', 1, 0); | ||
var pName = getXMLNodeValue(Task[i], 'Name', 2, 'No Task Name'); | ||
var pStart = getXMLNodeValue(Task[i], 'Start', 2, ''); | ||
var pEnd = getXMLNodeValue(Task[i], 'Finish', 2, ''); | ||
var pLink = getXMLNodeValue(Task[i], 'HyperlinkAddress', 2, ''); | ||
var pMile = getXMLNodeValue(Task[i], 'Milestone', 1, 0); | ||
var pComp = getXMLNodeValue(Task[i], 'PercentWorkComplete', 1, 0); | ||
var pGroup = getXMLNodeValue(Task[i], 'Summary', 1, 0); | ||
var pParent = 0; | ||
var vOutlineLevel = JSGantt.getXMLNodeValue(Task[i], 'OutlineLevel', 1, 0); | ||
var vOutlineLevel = getXMLNodeValue(Task[i], 'OutlineLevel', 1, 0); | ||
if (vOutlineLevel > 1) { | ||
vOutlineNumber = JSGantt.getXMLNodeValue(Task[i], 'OutlineNumber', 2, '0'); | ||
vOutlineNumber = getXMLNodeValue(Task[i], 'OutlineNumber', 2, '0'); | ||
pParent = pars[vOutlineNumber.substr(0, vOutlineNumber.lastIndexOf('.'))]; | ||
@@ -155,3 +155,3 @@ } | ||
var predecessors = JSGantt.findXMLNode(Task[i], 'PredecessorLink'); | ||
var predecessors = findXMLNode(Task[i], 'PredecessorLink'); | ||
if (typeof predecessors == 'undefined') j = 0; | ||
@@ -162,4 +162,4 @@ else j = predecessors.length; | ||
for (k = 0; k < j; k++) { | ||
var depUID = JSGantt.getXMLNodeValue(predecessors[k], 'PredecessorUID', 1, -1); | ||
var depType = JSGantt.getXMLNodeValue(predecessors[k], 'Type', 1, 1); | ||
var depUID = getXMLNodeValue(predecessors[k], 'PredecessorUID', 1, -1); | ||
var depType = getXMLNodeValue(predecessors[k], 'Type', 1, 1); | ||
@@ -187,3 +187,3 @@ if (depUID > 0) { | ||
var splits = JSGantt.findXMLNode(ass[pID], 'TimephasedData'); | ||
var splits = findXMLNode(ass[pID], 'TimephasedData'); | ||
if (typeof splits == 'undefined') j = 0; | ||
@@ -198,3 +198,3 @@ else j = splits.length; | ||
for (k = 0; k < j; k++) { | ||
var vDuration = JSGantt.getXMLNodeValue(splits[k], 'Value', 2, '0'); | ||
var vDuration = getXMLNodeValue(splits[k], 'Value', 2, '0'); | ||
//remove all text | ||
@@ -211,4 +211,4 @@ vDuration = '0' + vDuration.replace(/\D/g, ''); | ||
maxPID++; | ||
vSplitEnd = JSGantt.getXMLNodeValue(splits[k], (k + 1 == j) ? 'Finish' : 'Start', 2, ''); | ||
pGanttVar.AddTaskItem(new JSGantt.TaskItem(maxPID, pName, vSplitStart, vSplitEnd, 'gtaskblue', pLink, pMile, pRes, pComp, 0, pID, pOpen, vDepend, pCaption, pNotes, pGanttVar)); | ||
vSplitEnd = getXMLNodeValue(splits[k], (k + 1 == j) ? 'Finish' : 'Start', 2, ''); | ||
pGanttVar.AddTaskItem(new TaskItem(maxPID, pName, vSplitStart, vSplitEnd, 'gtaskblue', pLink, pMile, pRes, pComp, 0, pID, pOpen, vDepend, pCaption, pNotes, pGanttVar)); | ||
vSubCreated = true; | ||
@@ -218,3 +218,3 @@ vDepend = ''; | ||
else if (vDuration != 0 && vSubCreated) { | ||
vSplitStart = JSGantt.getXMLNodeValue(splits[k], 'Start', 2, ''); | ||
vSplitStart = getXMLNodeValue(splits[k], 'Start', 2, ''); | ||
vSubCreated = false; | ||
@@ -226,3 +226,3 @@ } | ||
// Finally add the task | ||
pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID, pName, pStart, pEnd, pClass, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGanttVar)); | ||
pGanttVar.AddTaskItem(new TaskItem(pID, pName, pStart, pEnd, pClass, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGanttVar)); | ||
} | ||
@@ -238,19 +238,19 @@ } | ||
// Task ID must NOT be zero otherwise it will be skipped | ||
pID = JSGantt.getXMLNodeValue(Task[i], 'pID', 1, 0); | ||
pID = getXMLNodeValue(Task[i], 'pID', 1, 0); | ||
if (pID != 0) { | ||
pName = JSGantt.getXMLNodeValue(Task[i], 'pName', 2, 'No Task Name'); | ||
pStart = JSGantt.getXMLNodeValue(Task[i], 'pStart', 2, ''); | ||
pEnd = JSGantt.getXMLNodeValue(Task[i], 'pEnd', 2, ''); | ||
pLink = JSGantt.getXMLNodeValue(Task[i], 'pLink', 2, ''); | ||
pMile = JSGantt.getXMLNodeValue(Task[i], 'pMile', 1, 0); | ||
pComp = JSGantt.getXMLNodeValue(Task[i], 'pComp', 1, 0); | ||
pGroup = JSGantt.getXMLNodeValue(Task[i], 'pGroup', 1, 0); | ||
pParent = JSGantt.getXMLNodeValue(Task[i], 'pParent', 1, 0); | ||
pRes = JSGantt.getXMLNodeValue(Task[i], 'pRes', 2, ''); | ||
pOpen = JSGantt.getXMLNodeValue(Task[i], 'pOpen', 1, 1); | ||
pDepend = JSGantt.getXMLNodeValue(Task[i], 'pDepend', 2, ''); | ||
pCaption = JSGantt.getXMLNodeValue(Task[i], 'pCaption', 2, ''); | ||
pNotes = JSGantt.getXMLNodeValue(Task[i], 'pNotes', 2, ''); | ||
pClass = JSGantt.getXMLNodeValue(Task[i], 'pClass', 2); | ||
pName = getXMLNodeValue(Task[i], 'pName', 2, 'No Task Name'); | ||
pStart = getXMLNodeValue(Task[i], 'pStart', 2, ''); | ||
pEnd = getXMLNodeValue(Task[i], 'pEnd', 2, ''); | ||
pLink = getXMLNodeValue(Task[i], 'pLink', 2, ''); | ||
pMile = getXMLNodeValue(Task[i], 'pMile', 1, 0); | ||
pComp = getXMLNodeValue(Task[i], 'pComp', 1, 0); | ||
pGroup = getXMLNodeValue(Task[i], 'pGroup', 1, 0); | ||
pParent = getXMLNodeValue(Task[i], 'pParent', 1, 0); | ||
pRes = getXMLNodeValue(Task[i], 'pRes', 2, ''); | ||
pOpen = getXMLNodeValue(Task[i], 'pOpen', 1, 1); | ||
pDepend = getXMLNodeValue(Task[i], 'pDepend', 2, ''); | ||
pCaption = getXMLNodeValue(Task[i], 'pCaption', 2, ''); | ||
pNotes = getXMLNodeValue(Task[i], 'pNotes', 2, ''); | ||
pClass = getXMLNodeValue(Task[i], 'pClass', 2, ''); | ||
if (typeof pClass == 'undefined') { | ||
@@ -263,3 +263,3 @@ if (pGroup > 0) pClass = 'ggroupblack'; | ||
// Finally add the task | ||
pGanttVar.AddTaskItem(new JSGantt.TaskItem(pID, pName, pStart, pEnd, pClass, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGanttVar)); | ||
pGanttVar.AddTaskItem(new TaskItem(pID, pName, pStart, pEnd, pClass, pLink, pMile, pRes, pComp, pGroup, pParent, pOpen, pDepend, pCaption, pNotes, pGanttVar)); | ||
} | ||
@@ -266,0 +266,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
0
3
891548
43
5303