2 Replies Latest reply on Jun 6, 2011 12:48 AM by Willam van Weelden

    Wrap Text TOC

    annimi

      I need help with the option to wrap the text in my TOC. I followed the 3 step instructions provided in a previous post but it not only didn't work but it deactivated my TOC links so that you could not expand the books nor could you click into any of the topics.

       

      http://forums.adobe.com/message/3565732

       

      Step 1: In the whthost.js file,
      function writeBookItems(nIdx,num)

      To swap out the no-break spaces for plain spaces, Search-n-Replace this:
      ==================================================

      function writeBookItems(nIdx,num)
      {
      var sHTML="";
      if(num>0){
      var nCIdx=0;
      do{
      nCIdx++;
      var i=nIdx+nCIdx;
      var nItemType=getItemType(i);
      if(nItemType==1||nItemType==4||nItemType==8){
      sHTML+=writeBook(i);
      nCIdx+=getItemContentsNum(i);
      }
      else if(nItemType==2||nItemType==16){
      sHTML+=writeAnItem(i);
      }
      }
      while(nCIdx<num);
      }
      return sHTML;
      }
      ======================================================
      with this:
      =======================================================

      function writeBookItems(nIdx,num)
      {
      var pattern = /\&nbsp\;/g;
      var sHTML="";
      var newsHTML="";
      var softsHTML="";

      if(num>0){
      var nCIdx=0;
      do{
      nCIdx++;
      var i=nIdx+nCIdx;
      var nItemType=getItemType(i);
      if(nItemType==1||nItemType==4||nItemType==8){
      sHTML+=writeBook(i);
      nCIdx+=getItemContentsNum(i);
      }
      else if(nItemType==2||nItemType==16){

      newsHTML=writeAnItem(i);

      softsHTML= newsHTML.replace(pattern," "); ///////////////////////// swap it

      sHTML+=softsHTML;
      }
      }
      while(nCIdx<num);
      }
      return sHTML;
      }

       

      Step 2: The TocWriteFixedWidth function, change the table to remove the width property,

      =======================================================
      to this

      =======================================================
      function TocWriteFixedWidth(bBegin,nWidth)

       

       

      Removed width property

      ==================================================

      function TocWriteFixedWidth(bBegin,nWidth)
      {
      if((gbIE4)&&(gbMac)&&(!gbIE5)){
        if(bBegin)
         document.write("<table width="+nWidth+" border=0><tr><td>");
        else
         document.write("</td></tr></table>");
      }
      }