Archived Comments (locked)
|
|
The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008) |
|
|
Thank for you great work and I have just extended your script to be more powerful by converting link in the "Content Module" to direct link, which is much faster than go through the extra step in webct. Test on webct 4.1 Campus Version just insert the following code before
/*
The Purpose is to the path from this format http://webct2.polyu.edu.hk//SCRIPT/COMP433_20071_A/scripts/student/serve_page.pl/COMP433_20071_A/lec11.ZIP?959112278+2479103960 to http://webct2.polyu.edu.hk/web-ct/courses/COMP433_20071_A/2479103960.ZIP
where:
2479103960 is the filename
ZIP is the extension
COMP433_20071_A is the course name
web-ct/courses is the actual directory storing the file
*/
if (chunks[2].indexOf("/serve_page.pl/")!=-1 && chunks[2].indexOf("#")==-1) {
chunks[2]=chunks[2].substr(chunks[2].indexOf("/serve_page.pl/") + "/serve_page.pl/".length);
var filename=chunks[2].substr(chunks[2].indexOf("+")+1);
filename=chunks[2].substring(0, chunks[2].indexOf("/")+1) + filename + chunks[2].substring(chunks[2].indexOf(".", 2), chunks[2].indexOf
("?",2));
href = baseURL + "/web-ct/courses/" + filename;
link.setAttribute("target", "_blank");
link.removeAttribute("onclick");
//COMP433_20071_A/lec11.ZIP?959112278+2479103960
//alert(filename);
//break;
//serve_page.pl/
//http://webct2.polyu.edu.hk/web-ct/courses/COMP433_20071_A/2502401951.ZIP
} else
|