home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 October / CHIP1002.ISO / exe / COMPUGUI.exe / whproj.js < prev    next >
Encoding:
Text File  |  2002-04-23  |  1.4 KB  |  82 lines

  1. var gaProj=new Array();
  2.  
  3. gaProj[0]=new project("");
  4.  
  5. function setLangId(sLangId)
  6. {
  7.     gaProj[0].sLangId=sLangId;
  8. }
  9.  
  10. function setDataPath(sPath)
  11. {
  12.     if(sPath.length!=0)
  13.     {
  14.         if(sPath.lastIndexOf("/")!=sPath.length-1)
  15.             sPath+="/";
  16.         gaProj[0].sDPath=sPath;    
  17.     }
  18.     else
  19.         gaProj[0].sDPath="";
  20. }
  21.  
  22. function addToc(sFile)
  23. {
  24.     gaProj[0].sToc=sFile;
  25. }
  26.  
  27. function addIdx(sFile)
  28. {
  29.     gaProj[0].sIdx=sFile;
  30. }
  31.  
  32. function addFts(sFile)
  33. {
  34.     gaProj[0].sFts=sFile;
  35. }
  36.  
  37. function addGlo(sFile)
  38. {
  39.     gaProj[0].sGlo=sFile;
  40. }
  41.  
  42. function addRemoteProject(sProjRelPath)
  43. {
  44.     gaProj[gaProj.length]=new project(sProjRelPath);
  45. }
  46.  
  47. function project(sPPath)
  48. {
  49.     this.sPPath=sPPath;
  50.     this.sLangId="";
  51.     this.sDPath="";
  52.     this.sToc="";
  53.     this.sIdx="";
  54.     this.sFts="";
  55.     this.sGlo="";
  56. }
  57.  
  58. window.onload=window_OnLoad;
  59.  
  60. function window_OnLoad()
  61. {
  62.     gsName=document.location.href;
  63.     gsName=_replaceSlash(gsName);
  64.     var nPos=gsName.lastIndexOf("/");
  65.     if(nPos!=-1)
  66.         gaProj[0].sPPath=gsName.substring(0,nPos+1);
  67.     else
  68.         alert("Fehler beim Laden der Navigationskomponente. Bitte regenerieren Sie WebHelp.");
  69.     patchPath(gaProj);
  70.     if(parent&&parent!=this&& typeof(parent.putProjectInfo)=="function")
  71.     {
  72.         parent.putProjectInfo(gaProj);
  73.     }
  74. }
  75.  
  76. function patchPath(aProj)
  77. {
  78.     for(var i=1;i<aProj.length;i++)
  79.     {
  80.         aProj[i].sPPath=_getFullPath(gaProj[0].sPPath,aProj[i].sPPath);
  81.     }
  82. }