<script type="text/javascript" src="/teams/IOBE/Canttouch%20this/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
// Set PicturesPath to the URL of the library that hosts the bar images:
var PicturesPath = "/teams/IOBE/Canttouch%20this/Images";
// Collect the priority level for each task
var barColours = new Array();
var regex = /\(\d\)\s(Amar\sNaidu|Baz\sSelwyn|Carol\sFrancis|Renjiv\sRaman|Ayesha\sSultana)/;
// Find the tasks summary list
var TasksList = $(".ms-ganttOuterTable").siblings("table").find(".ms-summarystandardbody>tbody>tr:not(.ms-viewheadertr)");
if (TasksList.length == 0) TasksList = $(".ms-ganttOuterTable").siblings("table").find(".ms-listviewtable>tbody>tr:not(.ms-viewheadertr)");
TasksList.each(function(i){
try {
barColours[i] = regex.exec($(this).text())[0].substr(1,1);
}
catch(err) {barColours[i] ="";}
});
// Modify the bar color according to priority
$(".ms-ganttTaskRow").each(function(i){
$(this).find("img").each(function(){
var source=this.src;
source = source.replace(/.gif/, barColours[i]+".gif");
source = source.replace(/\/_layouts\/images/,PicturesPath);
this.src=source;
});
});
//Optional: hide the list under the Gantt view
$(".ms-summarystandardbody").hide();
$(".ms-listviewtable").hide();
</script>
<script type="text/javascript">
// Set PicturesPath to the URL of the library that hosts the bar images:
var PicturesPath = "/teams/IOBE/Canttouch%20this/Images";
// Collect the priority level for each task
var barColours = new Array();
var regex = /\(\d\)\s(Amar\sNaidu|Baz\sSelwyn|Carol\sFrancis|Renjiv\sRaman|Ayesha\sSultana)/;
// Find the tasks summary list
var TasksList = $(".ms-ganttOuterTable").siblings("table").find(".ms-summarystandardbody>tbody>tr:not(.ms-viewheadertr)");
if (TasksList.length == 0) TasksList = $(".ms-ganttOuterTable").siblings("table").find(".ms-listviewtable>tbody>tr:not(.ms-viewheadertr)");
TasksList.each(function(i){
try {
barColours[i] = regex.exec($(this).text())[0].substr(1,1);
}
catch(err) {barColours[i] ="";}
});
// Modify the bar color according to priority
$(".ms-ganttTaskRow").each(function(i){
$(this).find("img").each(function(){
var source=this.src;
source = source.replace(/.gif/, barColours[i]+".gif");
source = source.replace(/\/_layouts\/images/,PicturesPath);
this.src=source;
});
});
//Optional: hide the list under the Gantt view
$(".ms-summarystandardbody").hide();
$(".ms-listviewtable").hide();
</script>