home *** CD-ROM | disk | FTP | other *** search
/ Thomson (Residential) / TGSTPv7203.iso / mac / Documentation / HTML / TG546v-v7_es / wwhelp / wwhimpl / common / scripts / bookgrps.js < prev    next >
Text File  |  2007-06-22  |  5KB  |  197 lines

  1. // Copyright (c) 2000-2001 Quadralay Corporation.  All rights reserved.
  2. //
  3.  
  4. function  WWHBookGroups_Object()
  5. {
  6.   this.mbShowBooks      = false;
  7.   this.mbExpandAllAtTop = false;
  8.   this.mChildren        = new Array();
  9.  
  10.   this.fAddGrouping  = WWHBookGroups_AddGrouping;
  11.   this.fAddDirectory = WWHBookGroups_AddDirectory;
  12. }
  13.  
  14. function  WWHBookGroups_AddGrouping(ParamTitle,
  15.                                     bParamExpand,
  16.                                     ParamIcon,
  17.                                     ParamOpenIcon)
  18. {
  19.   var  BookGrouping;
  20.  
  21.  
  22.   BookGrouping = new WWHBookGroups_Group_Object(ParamTitle, bParamExpand, ParamIcon, ParamOpenIcon);
  23.  
  24.   // Set mbExpand to default values if not defined
  25.   //
  26.   if (typeof bParamExpand == "undefined")
  27.   {
  28.     if (this.mbExpandAllAtTop)
  29.     {
  30.       BookGrouping.mbExpand = true;
  31.     }
  32.   }
  33.  
  34.   // Add to children list
  35.   //
  36.   this.mChildren[this.mChildren.length] = BookGrouping;
  37.  
  38.   return BookGrouping;
  39. }
  40.  
  41. function  WWHBookGroups_AddDirectory(ParamDirectory,
  42.                                      bParamShow,
  43.                                      bParamExpand,
  44.                                      ParamIcon,
  45.                                      ParamOpenIcon)
  46. {
  47.   var  BookDirectory;
  48.  
  49.  
  50.   BookDirectory = new WWHBookGroups_Directory_Object(ParamDirectory, bParamShow, bParamExpand, ParamIcon, ParamOpenIcon);
  51.  
  52.   // Set mbShow to default values if not defined
  53.   //
  54.   if ((typeof bParamShow == "undefined") ||
  55.       (bParamShow == null))
  56.   {
  57.     BookDirectory.mbShow = this.mbShowBooks;
  58.   }
  59.  
  60.   // Set mbExpand to default values if not defined
  61.   //
  62.   if ((typeof bParamExpand == "undefined") ||
  63.       (bParamExpand == null))
  64.   {
  65.     if (this.mbExpandAllAtTop)
  66.     {
  67.       BookDirectory.mbExpand = true;
  68.     }
  69.   }
  70.  
  71.   // Add to children list
  72.   //
  73.   this.mChildren[this.mChildren.length] = BookDirectory;
  74. }
  75.  
  76. function  WWHBookGroups_Group_Object(ParamTitle,
  77.                                      bParamExpand,
  78.                                      ParamIcon,
  79.                                      ParamOpenIcon)
  80. {
  81.   this.mbGrouping = true;
  82.   this.mTitle     = ParamTitle;
  83.   this.mbExpand   = false;
  84.   this.mChildren  = new Array();
  85.  
  86.   this.fAddGrouping  = WWHBookGroups_Group_AddGrouping;
  87.   this.fAddDirectory = WWHBookGroups_Group_AddDirectory;
  88.  
  89.   // Set mbExpand if override defined
  90.   //
  91.   if ((typeof bParamExpand != "undefined") &&
  92.       (bParamExpand != null))
  93.   {
  94.     if (bParamExpand == true)
  95.     {
  96.       this.mbExpand = true;
  97.     }
  98.   }
  99.  
  100.   // Set mIcon if defined
  101.   //
  102.   if (typeof ParamIcon != "undefined")
  103.   {
  104.     this.mIcon = ParamIcon;
  105.   }
  106.  
  107.   // Set mOpenIcon if defined
  108.   //
  109.   if (typeof ParamOpenIcon != "undefined")
  110.   {
  111.     this.mOpenIcon = ParamOpenIcon;
  112.   }
  113. }
  114.  
  115. function  WWHBookGroups_Group_AddGrouping(ParamTitle,
  116.                                           bParamExpand,
  117.                                           ParamIcon,
  118.                                           ParamOpenIcon)
  119. {
  120.   var  BookGrouping;
  121.  
  122.  
  123.   BookGrouping = new WWHBookGroups_Group_Object(ParamTitle, bParamExpand, ParamIcon, ParamOpenIcon);
  124.   this.mChildren[this.mChildren.length] = BookGrouping;
  125.  
  126.   return BookGrouping;
  127. }
  128.  
  129. function  WWHBookGroups_Group_AddDirectory(ParamDirectory,
  130.                                            bParamShow,
  131.                                            bParamExpand,
  132.                                            ParamIcon,
  133.                                            ParamOpenIcon)
  134. {
  135.   var  BookDirectory;
  136.  
  137.  
  138.   BookDirectory = new WWHBookGroups_Directory_Object(ParamDirectory, bParamShow, bParamExpand, ParamIcon, ParamOpenIcon);
  139.   this.mChildren[this.mChildren.length] = BookDirectory;
  140. }
  141.  
  142. function  WWHBookGroups_Directory_Object(ParamDirectory,
  143.                                          bParamShow,
  144.                                          bParamExpand,
  145.                                          ParamIcon,
  146.                                          ParamOpenIcon)
  147. {
  148.   this.mbGrouping = false;
  149.   this.mDirectory = ParamDirectory;
  150.   this.mbShow     = true;
  151.   this.mbExpand   = false;
  152.  
  153.   // Set mbShow if override defined
  154.   //
  155.   if ((typeof bParamShow == "undefined") ||
  156.       (bParamShow == null))
  157.   {
  158.     this.mbShow = WWHFrame.WWHHelp.mBookGroups.mbShowBooks;
  159.   }
  160.   else
  161.   {
  162.     if (bParamShow == false)
  163.     {
  164.       this.mbShow = bParamShow;
  165.     }
  166.   }
  167.  
  168.   // Set mbExpand if override defined
  169.   //
  170.   if ((typeof bParamExpand != "undefined") &&
  171.       (bParamExpand != null))
  172.   {
  173.     if (bParamExpand == true)
  174.     {
  175.       this.mbExpand = bParamExpand;
  176.     }
  177.   }
  178.  
  179.   // Set mIcon if defined
  180.   //
  181.   if (typeof ParamIcon != "undefined")
  182.   {
  183.     this.mIcon = ParamIcon;
  184.   }
  185.  
  186.   // Set mOpenIcon if defined
  187.   //
  188.   if (typeof ParamOpenIcon != "undefined")
  189.   {
  190.     this.mOpenIcon = ParamOpenIcon;
  191.   }
  192.  
  193.   // Add to book list
  194.   //
  195.   WWHFrame.WWHHelp.mBooks.fInit_AddBookDir(ParamDirectory);
  196. }
  197.