Remove no longer needed js files
FEA: ItEr75S08MigrationZK5
This commit is contained in:
parent
475ae8b380
commit
7e759bafed
5 changed files with 0 additions and 676 deletions
|
|
@ -1,183 +0,0 @@
|
|||
/*
|
||||
* This file is part of NavalPlan
|
||||
*
|
||||
* Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
|
||||
* Desenvolvemento Tecnolóxico de Galicia
|
||||
* Copyright (C) 2010-2011 Igalia, S.L.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
zkResourcesLoadList = addResourcesLoadListMethods( {});
|
||||
|
||||
zkResourcesLoadList.WATERMARK_MIN_HEIGHT = 450;
|
||||
zkResourcesLoadList.WATERMARK_MARGIN_BOTTOM = 40;
|
||||
|
||||
|
||||
zkResourcesLoadList.recalculateTimetrackerHeight = function (cmp) {
|
||||
|
||||
zkResourcesLoadList.resourceloadlist = function(elem) {
|
||||
return YAHOO.util.Selector.query('.resourceloadlist')[0];
|
||||
}
|
||||
|
||||
zkResourcesLoadList.firstWatermarkColumn = function(elem) {
|
||||
return YAHOO.util.Selector.query('.rightpanellayout tr#watermark td')[0];
|
||||
}
|
||||
|
||||
if (zkResourcesLoadList.resourceloadlist() != undefined && zkResourcesLoadList.firstWatermarkColumn() != undefined) {
|
||||
var height = Math.max(
|
||||
zkResourcesLoadList.resourceloadlist().clientHeight + zkResourcesLoadList.WATERMARK_MARGIN_BOTTOM,
|
||||
zkResourcesLoadList.WATERMARK_MIN_HEIGHT);
|
||||
zkResourcesLoadList.firstWatermarkColumn().style.height = height + "px";
|
||||
}
|
||||
}
|
||||
|
||||
function addResourcesLoadListMethods(object) {
|
||||
var scrollSync;
|
||||
|
||||
var SCROLL_DAY = 0;
|
||||
|
||||
function watermark() {
|
||||
return document.getElementById('watermark');
|
||||
}
|
||||
|
||||
function timetracker() {
|
||||
return document.getElementById('timetracker');
|
||||
}
|
||||
|
||||
function resourceloadlist() {
|
||||
return YAHOO.util.Selector.query('.resourceloadlist')[0];
|
||||
}
|
||||
|
||||
function taskspanelgap() {
|
||||
return YAHOO.util.Selector.query('.taskspanelgap')[0];
|
||||
}
|
||||
|
||||
function resourcesloadgraph() {
|
||||
return YAHOO.util.Selector.query('.resourcesloadgraph div')[0];
|
||||
}
|
||||
|
||||
function scrolledpannel() {
|
||||
return YAHOO.util.Selector.query('.rightpanellayout div')[0];
|
||||
}
|
||||
|
||||
function timetrackergap() {
|
||||
return YAHOO.util.Selector.query('.timetrackergap')[0];
|
||||
}
|
||||
|
||||
function leftpanel() {
|
||||
return YAHOO.util.Selector.query('.leftpanelgap .z-tree-body')[0];
|
||||
}
|
||||
|
||||
function rightpanel() {
|
||||
return YAHOO.util.Selector.query('.rightpanellayout div')[0];
|
||||
}
|
||||
|
||||
object.init = function(cmp) {
|
||||
this.adjustTimeTrackerSize(cmp);
|
||||
YAHOO.util.Event.addListener(window, 'resize',
|
||||
zkResourcesLoadList.adjustTimeTrackerSize, cmp);
|
||||
scrollSync = new ScrollSync(cmp);
|
||||
scrollSync.synchXChangeTo(timetracker);
|
||||
listenToScroll();
|
||||
};
|
||||
|
||||
function listenToScroll() {
|
||||
var timetrackergap_ = timetrackergap();
|
||||
var scrolledpannel_ = scrolledpannel();
|
||||
var resourcesloadgraph_ = resourcesloadgraph();
|
||||
var leftpanel_ = leftpanel();
|
||||
var rightpanel_ = rightpanel();
|
||||
|
||||
var onScroll = function() {
|
||||
var timeplotcontainer_ = YAHOO.util.Selector.query('canvas.timeplot-canvas')[0];
|
||||
timeplotcontainer_.style["left"] = "-" + scrolledpannel_.scrollLeft + "px";
|
||||
timetrackergap_.style["left"] = "-" + scrolledpannel_.scrollLeft + "px";
|
||||
leftpanel_.style["top"] = "-" + scrolledpannel_.scrollTop + "px";
|
||||
resourcesloadgraph_.scrollLeft = scrolledpannel_.scrollLeft;
|
||||
};
|
||||
|
||||
rightpanel_.onscroll = onScroll;
|
||||
}
|
||||
|
||||
|
||||
object.adjustTimeTrackerSize = function(cmp) {
|
||||
zkResourcesLoadList.recalculateTimetrackerHeight();
|
||||
watermark().style["height"] = cmp.clientHeight + "px";
|
||||
timetracker().style["width"] = cmp.clientWidth + "px";
|
||||
/* Set watermark width */
|
||||
YAHOO.util.Selector.query('.resourceloadlist')[0].style["width"] = YAHOO.util.Selector
|
||||
.query('.second_level_')[0].clientWidth + "px";
|
||||
};
|
||||
|
||||
object.adjustResourceLoadRows = function(cmp) {
|
||||
YAHOO.util.Selector.query('.row_resourceload').each(function(node) {
|
||||
node.style["width"] = cmp.clientWidth + "px";
|
||||
});
|
||||
};
|
||||
|
||||
object.adjustScrollHorizontalPosition = function(cmp, offsetInPx) {
|
||||
cmp.scrollLeft = offsetInPx;
|
||||
}
|
||||
|
||||
object.update_day_scroll = function(cmp,previousPixelPerDay) {
|
||||
var div1 = cmp;
|
||||
var div2 = div1.parentNode;
|
||||
var div3 = div2.parentNode;
|
||||
|
||||
var maxHPosition = div3.scrollWidth - div3.clientWidth;
|
||||
if( maxHPosition > 0 ){
|
||||
var proportion = div3.scrollWidth / maxHPosition;
|
||||
var positionInScroll = div3.scrollLeft;
|
||||
var positionInPx = positionInScroll * proportion;
|
||||
if(positionInPx > 0){
|
||||
var position = positionInPx / previousPixelPerDay;
|
||||
var day = position;
|
||||
SCROLL_DAY = position;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Scrolls horizontally the ganttpanel when the zoom has resized the component
|
||||
* width.
|
||||
*/
|
||||
|
||||
object.scroll_horizontal = function(cmp,daysDisplacement) {
|
||||
SCROLL_DAY = daysDisplacement;
|
||||
};
|
||||
|
||||
object.move_scroll = function(cmp,diffDays,pixelPerDay) {
|
||||
var div1 = cmp;
|
||||
var div2 = div1.parentNode;
|
||||
var div3 = div2.parentNode;
|
||||
|
||||
var day = SCROLL_DAY;
|
||||
day += parseInt(diffDays);
|
||||
var newPosInPx = parseInt(day * pixelPerDay);
|
||||
var maxHPosition = div3.scrollWidth - div3.clientWidth;
|
||||
var newProportion = div3.scrollWidth / maxHPosition;
|
||||
if( newProportion > 0){
|
||||
var newPosInScroll = newPosInPx / newProportion;
|
||||
if(newPosInScroll < 0){
|
||||
newPosInScroll = 0;
|
||||
}
|
||||
div1.scrollLeft = newPosInScroll;
|
||||
div2.scrollLeft = newPosInScroll;
|
||||
div3.scrollLeft = newPosInScroll;
|
||||
}
|
||||
};
|
||||
|
||||
return object;
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
/*
|
||||
* This file is part of NavalPlan
|
||||
*
|
||||
* Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
|
||||
* Desenvolvemento Tecnolóxico de Galicia
|
||||
* Copyright (C) 2010-2011 Igalia, S.L.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Javascript behaviuor for ResourcesLoadPanel element
|
||||
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
|
||||
*/
|
||||
zkResourcesLoadPanel = {};
|
||||
|
||||
zkResourcesLoadPanel.init = function(cmp){
|
||||
}
|
||||
|
|
@ -1,144 +0,0 @@
|
|||
/*
|
||||
* This file is part of NavalPlan
|
||||
*
|
||||
* Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
|
||||
* Desenvolvemento Tecnolóxico de Galicia
|
||||
* Copyright (C) 2010-2011 Igalia, S.L.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Javascript behaviour and drawing algorithms for queue dependencies
|
||||
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
|
||||
*/
|
||||
|
||||
webapp_context_path = window.location.pathname.split( '/' )[1];
|
||||
|
||||
|
||||
zkLimitingDependency = {};
|
||||
|
||||
|
||||
zkLimitingDependency.origin = function(dependency) {
|
||||
var id = dependency.getAttribute("idTaskOrig");
|
||||
return document.getElementById(id);
|
||||
}
|
||||
|
||||
zkLimitingDependency.destination = function(dependency) {
|
||||
var id = dependency.getAttribute("idTaskEnd");
|
||||
return document.getElementById(id);
|
||||
}
|
||||
|
||||
/* ----------- Generic Limiting dependency draw function ---------- */
|
||||
zkLimitingDependencies.newdraw = function(arrow, orig, dest, param) {
|
||||
var xorig = orig[0];
|
||||
var yorig = orig[1];
|
||||
var xend = dest[0];
|
||||
var yend = dest[1];
|
||||
|
||||
var width = Math.abs(xend - xorig);
|
||||
|
||||
if (yend == yorig) {
|
||||
yend = yend + zkLimitingDependencies.HEIGHT;
|
||||
yorig = yorig + zkLimitingDependencies.HEIGHT;
|
||||
} else if (yend < yorig) {
|
||||
yend = yend + zkLimitingDependencies.HEIGHT;
|
||||
} else {
|
||||
yorig = yorig + zkLimitingDependencies.HEIGHT;
|
||||
}
|
||||
|
||||
var height = Math.abs(yorig - yend);
|
||||
|
||||
// --------- First segment -----------
|
||||
var depstart = this.findImageElement(arrow, 'start');
|
||||
depstart.style.left = xorig + "px";
|
||||
if (yend > yorig) {
|
||||
depstart.style.top = yorig + "px";
|
||||
depstart.style.height = ( height - param ) + "px";
|
||||
} else if (yend == yorig) {
|
||||
depstart.style.top = yorig + "px";
|
||||
depstart.style.height = param + "px";
|
||||
} else if (yend < yorig) {
|
||||
depstart.style.top = ( yend + param ) + "px";
|
||||
depstart.style.height = ( height - param ) + "px";
|
||||
}
|
||||
|
||||
// --------- Second segment -----------
|
||||
var depmid = this.findImageElement(arrow, 'mid');
|
||||
depmid.style.width = width + "px";
|
||||
if (xorig < xend ) {
|
||||
depmid.style.left = xorig + "px";
|
||||
} else {
|
||||
depmid.style.left = xend + "px";
|
||||
}
|
||||
if (yend > yorig) {
|
||||
depmid.style.top = ( yend - param ) + "px";
|
||||
} else if (yend == yorig) {
|
||||
depmid.style.top = ( yend + param ) + "px";
|
||||
} else if (yend < yorig) {
|
||||
depmid.style.top = ( yend + param ) + "px";
|
||||
}
|
||||
|
||||
// --------- Third segment -----------
|
||||
var depend = this.findImageElement(arrow, 'end');
|
||||
depend.style.left = xend + "px";
|
||||
if (yend > yorig) {
|
||||
depend.style.top = ( yend - param ) + "px";
|
||||
depend.style.height = param + "px";
|
||||
} else if (yend == yorig) {
|
||||
depend.style.top = yorig + "px";
|
||||
depend.style.height = param + "px";
|
||||
} else if (yend < yorig) {
|
||||
depend.style.top = yend + "px";
|
||||
depend.style.height = param + "px";
|
||||
}
|
||||
|
||||
// --------- Arrow -----------
|
||||
var deparrow = this.findImageElement(arrow, 'arrow');
|
||||
deparrow.style.left = ( xend - zkLimitingDependencies.HALF_ARROW_PADDING ) + "px";
|
||||
if (yend > yorig) {
|
||||
deparrow.src = this.getImagesDir()+"arrow2.png";
|
||||
deparrow.style.top = ( yend - zkLimitingDependencies.ARROW_PADDING ) + "px";
|
||||
} else if (yend == yorig) {
|
||||
deparrow.src = this.getImagesDir()+"arrow4.png";
|
||||
deparrow.style.top = yorig + "px";
|
||||
} else if (yend < yorig) {
|
||||
deparrow.src = this.getImagesDir()+"arrow4.png";
|
||||
deparrow.style.top = yend + "px";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
zkLimitingDependency.draw = function(dependency) {
|
||||
var posOrig = this.origin(dependency);
|
||||
var posDest = this.destination(dependency);
|
||||
if ( (posOrig != null) && (posDest != null) ) {
|
||||
var orig = zkLimitingDependencies.findPos(posOrig);
|
||||
var dest = zkLimitingDependencies.findPos(posDest);
|
||||
orig[0] = Math.max(orig[0], orig[0] + this.origin(dependency).offsetWidth - zkLimitingDependencies.CORNER);
|
||||
var verticalSeparation = zkLimitingDependencies.ROW_HEIGHT;
|
||||
zkLimitingDependencies.newdraw(dependency, orig, dest, verticalSeparation);
|
||||
}
|
||||
}
|
||||
|
||||
zkLimitingDependency.init = function(dependency) {
|
||||
zkLimitingDependencies.setupArrow(dependency);
|
||||
var parent = dependency.parentNode;
|
||||
if (parent.id !== "listlimitingdependencies") {
|
||||
document.getElementById("listlimitingdependencies").appendChild(dependency);
|
||||
}
|
||||
YAHOO.util.Event.onDOMReady(function() {
|
||||
zkLimitingDependency.draw(dependency);
|
||||
});
|
||||
}
|
||||
|
|
@ -1,133 +0,0 @@
|
|||
/*
|
||||
* This file is part of NavalPlan
|
||||
*
|
||||
* Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
|
||||
* Desenvolvemento Tecnolóxico de Galicia
|
||||
* Copyright (C) 2010-2011 Igalia, S.L.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
zkLimitingDependencylist = {};
|
||||
|
||||
zkLimitingDependencylist.init = function (cmp) {
|
||||
}
|
||||
|
||||
|
||||
zkLimitingDependencies = {};
|
||||
zkLimitingDependencies.constants = {
|
||||
END_START: "END_START",
|
||||
START_START: "START_START",
|
||||
END_END: "END_END"
|
||||
};
|
||||
|
||||
zkLimitingDependencies.CORNER = 10;
|
||||
zkLimitingDependencies.ROW_HEIGHT = 15;
|
||||
zkLimitingDependencies.HEIGHT = 12;
|
||||
zkLimitingDependencies.ARROW_PADDING = 10;
|
||||
zkLimitingDependencies.HALF_ARROW_PADDING = 5;
|
||||
|
||||
/* TODO: Optimize function */
|
||||
zkLimitingDependencies.showDependenciesForQueueElement = function (task) {
|
||||
var dependencies = YAHOO.util.Selector.query('.dependency');
|
||||
for (var i = 0; i < dependencies.length; i++) {
|
||||
if ( (dependencies[i].getAttribute("idTaskOrig") == task) || (dependencies[i].getAttribute("idTaskEnd") == task) ) {
|
||||
dependencies[i].style.display ="inline";
|
||||
dependencies[i].style.opacity ="1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: Optimize function */
|
||||
zkLimitingDependencies.hideDependenciesForQueueElement = function (task) {
|
||||
var dependencies = YAHOO.util.Selector.query('.dependency');
|
||||
for (var i = 0; i < dependencies.length; i++) {
|
||||
if ( (dependencies[i].getAttribute("idTaskOrig") == task) || (dependencies[i].getAttribute("idTaskEnd") == task) ) {
|
||||
dependencies[i].style.display ="none";
|
||||
dependencies[i].style.removeProperty("opacity");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: Optimize function */
|
||||
zkLimitingDependencies.toggleDependenciesForQueueElement = function (task) {
|
||||
var dependencies = YAHOO.util.Selector.query('.dependency');
|
||||
for (var i = 0; i < dependencies.length; i++) {
|
||||
if ( (dependencies[i].getAttribute("idTaskOrig") == task) || (dependencies[i].getAttribute("idTaskEnd") == task) ) {
|
||||
dependencies[i].setAttribute("class", "dependency toggled");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
zkLimitingDependencies.addRelatedDependency = function(cmp, dependency) {
|
||||
if (!cmp['relatedDependencies']) {
|
||||
cmp.relatedDependencies = [];
|
||||
}
|
||||
cmp.relatedDependencies.push(dependency);
|
||||
}
|
||||
|
||||
zkLimitingDependencies.getImagesDir = function() {
|
||||
return "/" + webapp_context_path + "/zkau/web/ganttz/img/";
|
||||
}
|
||||
|
||||
zkLimitingDependencies.init = function(planner){
|
||||
}
|
||||
|
||||
zkLimitingDependencies.findImageElement = function(arrow, name) {
|
||||
var children = arrow.getElementsByTagName("img");
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var child = children[i];
|
||||
if (child.getAttribute("class").indexOf(name) != -1) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
function get_origin() {
|
||||
return YAHOO.util.Dom.getXY('listlimitingdependencies');
|
||||
}
|
||||
|
||||
|
||||
zkLimitingDependencies.findPos = function(obj) {
|
||||
var pos1 = get_origin();
|
||||
var pos2 = YAHOO.util.Dom.getXY(obj.id);
|
||||
return [ pos2[0] - pos1[0], pos2[1] - pos1[1] ];
|
||||
}
|
||||
|
||||
|
||||
zkLimitingDependencies.findPosForMouseCoordinates = function(x, y){
|
||||
/* var pos1 = get_origin() */
|
||||
var pos1 = YAHOO.util.Dom.getXY('listtasks');
|
||||
return [x - pos1[0], y - pos1[1]];
|
||||
}
|
||||
|
||||
|
||||
function getContextPath(element){
|
||||
return element.getAttribute('contextpath');
|
||||
}
|
||||
|
||||
|
||||
zkLimitingDependencies.setupArrow = function(arrowDiv){
|
||||
var image_data = [ [ "start", "pixel.gif" ], [ "mid", "pixel.gif" ],
|
||||
[ "end", "pixel.gif" ], [ "arrow", "arrow.png" ] ];
|
||||
for ( var i = 0; i < image_data.length; i++) {
|
||||
var img = document.createElement('img');
|
||||
img.setAttribute("class", image_data[i][0]+" extra_padding");
|
||||
img.src = this.getImagesDir() + image_data[i][1];
|
||||
arrowDiv.appendChild(img);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,187 +0,0 @@
|
|||
/*
|
||||
* This file is part of NavalPlan
|
||||
*
|
||||
* Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
|
||||
* Desenvolvemento Tecnolóxico de Galicia
|
||||
* Copyright (C) 2010-2011 Igalia, S.L.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
zkLimitingResourcesList = addLimitingResourcesListMethods( {});
|
||||
|
||||
zkLimitingResourcesList.showRelatedElementsForQueueElement = function (task) {
|
||||
zkLimitingDependencies.showDependenciesForQueueElement(task);
|
||||
zkLimitingResourcesList.SetVisibleDeadlineForQueueElement(task, "inline");
|
||||
}
|
||||
|
||||
zkLimitingResourcesList.hideRelatedElementsForQueueElement = function (task) {
|
||||
zkLimitingDependencies.hideDependenciesForQueueElement(task);
|
||||
zkLimitingResourcesList.SetVisibleDeadlineForQueueElement(task, "none");
|
||||
}
|
||||
|
||||
zkLimitingResourcesList.SetVisibleDeadlineForQueueElement = function(task, visible) {
|
||||
var deadlines = YAHOO.util.Selector.query('.deadline');
|
||||
for ( var i = 0; i < deadlines.length; i++) {
|
||||
if ((deadlines[i].parentNode.id == task)) {
|
||||
deadlines[i].style.display = visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function addLimitingResourcesListMethods(object) {
|
||||
var scrollSync;
|
||||
|
||||
var SCROLL_DAY = 0;
|
||||
|
||||
function watermark() {
|
||||
return document.getElementById('watermark');
|
||||
}
|
||||
|
||||
function timetracker() {
|
||||
return document.getElementById('timetracker');
|
||||
}
|
||||
|
||||
function resourceloadlist() {
|
||||
return YAHOO.util.Selector.query('.limitingresourceslist')[0];
|
||||
}
|
||||
|
||||
function taskspanelgap() {
|
||||
return YAHOO.util.Selector.query('.taskspanelgap')[0];
|
||||
}
|
||||
|
||||
function resourcesloadgraph() {
|
||||
return YAHOO.util.Selector.query('.resourcesloadgraph div')[0];
|
||||
}
|
||||
|
||||
function scrolledpannel() {
|
||||
return YAHOO.util.Selector.query('.rightpanellayout div')[0];
|
||||
}
|
||||
|
||||
|
||||
function timetrackergap() {
|
||||
return YAHOO.util.Selector.query('.timetrackergap')[0];
|
||||
}
|
||||
|
||||
function leftpanel() {
|
||||
return YAHOO.util.Selector.query('.leftpanelgap .z-tree-body')[0];
|
||||
}
|
||||
|
||||
|
||||
object.init = function(cmp) {
|
||||
this.adjustTimeTrackerSize(cmp);
|
||||
YAHOO.util.Event.addListener(window, 'resize',
|
||||
zkLimitingResourcesList.adjustTimeTrackerSize, cmp);
|
||||
scrollSync = new ScrollSync(cmp);
|
||||
scrollSync.synchXChangeTo(timetracker);
|
||||
|
||||
listenToScroll();
|
||||
};
|
||||
|
||||
function listenToScroll() {
|
||||
|
||||
var timetrackergap_ = timetrackergap();
|
||||
var scrolledpannel_ = scrolledpannel();
|
||||
var resourcesloadgraph_ = resourcesloadgraph();
|
||||
var leftpanel_ = leftpanel();
|
||||
|
||||
var onScroll = function() {
|
||||
timetrackergap_.style["left"] = "-" + scrolledpannel_.scrollLeft + "px";
|
||||
leftpanel_.style["top"] = "-" + scrolledpannel_.scrollTop + "px";
|
||||
resourcesloadgraph_.scrollLeft = scrolledpannel_.scrollLeft;
|
||||
|
||||
};
|
||||
|
||||
YAHOO.util.Selector.query('.rightpanellayout div')[0].onscroll = onScroll;
|
||||
|
||||
}
|
||||
|
||||
object.adjustTimeTrackerSize = function(cmp) {
|
||||
var _firstWatarmark = YAHOO.util.Selector.query('.rightpanellayout tr#watermark td')[0];
|
||||
|
||||
if (watermark() != null) {
|
||||
watermark().style["height"] = cmp.clientHeight + "px";
|
||||
}
|
||||
|
||||
if (timetracker() != null) {
|
||||
timetracker().style["width"] = cmp.clientWidth + "px";
|
||||
|
||||
YAHOO.util.Selector.query('.limitingresourceslist')[0].style["width"] = YAHOO.util.Selector
|
||||
.query('.second_level_')[0].clientWidth + "px";
|
||||
|
||||
if (_firstWatarmark != undefined ) {
|
||||
_firstWatarmark.style["height"] =YAHOO.util.Selector.query('.limitingresourceslist')[0].clientHeight + 120 + "px";
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
object.adjustResourceLoadRows = function(cmp) {
|
||||
var width = YAHOO.util.Selector.query('.rightpanellayout #timetracker .z-grid-header')[0].clientWidth + "px";
|
||||
YAHOO.util.Selector.query('.row_resourceload').each(function(node) {
|
||||
node.style["width"] = width;
|
||||
});
|
||||
};
|
||||
|
||||
object.update_day_scroll = function(cmp,previousPixelPerDay) {
|
||||
var div1 = cmp;
|
||||
var div2 = div1.parentNode;
|
||||
var div3 = div2.parentNode;
|
||||
|
||||
var maxHPosition = div3.scrollWidth - div3.clientWidth;
|
||||
if( maxHPosition > 0 ){
|
||||
var proportion = div3.scrollWidth / maxHPosition;
|
||||
var positionInScroll = div3.scrollLeft;
|
||||
var positionInPx = positionInScroll * proportion;
|
||||
if(positionInPx > 0){
|
||||
var position = positionInPx / previousPixelPerDay;
|
||||
var day = position;
|
||||
SCROLL_DAY = position;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Scrolls horizontally the ganttpanel when the zoom has resized the component
|
||||
* width.
|
||||
*/
|
||||
|
||||
object.scroll_horizontal = function(cmp,daysDisplacement) {
|
||||
SCROLL_DAY = daysDisplacement;
|
||||
};
|
||||
|
||||
object.move_scroll = function(cmp,diffDays,pixelPerDay) {
|
||||
var div1 = cmp;
|
||||
var div2 = div1.parentNode;
|
||||
var div3 = div2.parentNode;
|
||||
|
||||
var day = SCROLL_DAY;
|
||||
day += parseInt(diffDays);
|
||||
var newPosInPx = parseInt(day * pixelPerDay);
|
||||
var maxHPosition = div3.scrollWidth - div3.clientWidth;
|
||||
var newProportion = div3.scrollWidth / maxHPosition;
|
||||
if( newProportion > 0){
|
||||
var newPosInScroll = newPosInPx / newProportion;
|
||||
if(newPosInScroll < 0){
|
||||
newPosInScroll = 0;
|
||||
}
|
||||
div1.scrollLeft = newPosInScroll;
|
||||
div2.scrollLeft = newPosInScroll;
|
||||
div3.scrollLeft = newPosInScroll;
|
||||
}
|
||||
};
|
||||
|
||||
return object;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue