home *** CD-ROM | disk | FTP | other *** search
/ ftp.rsa.com / 2014.05.ftp.rsa.com.tar / ftp.rsa.com / pub / agents / RSASecurIDTokenAuto412x64.msi / Data1.cab / _48A1B10F035BA48085C1A914D771CB4D < prev    next >
Text File  |  2014-03-12  |  10KB  |  436 lines

  1. ∩╗┐//    WebHelp 5.10.003
  2. RegisterListener2(this, WH_MSG_GETSTARTFRAME);
  3. RegisterListener2(this, WH_MSG_GETDEFAULTTOPIC);
  4. RegisterListener2(this, WH_MSG_MINIBARORDER);
  5. RegisterListener2(this, WH_MSG_TOOLBARORDER);
  6. RegisterListener2(this, WH_MSG_ISSEARCHSUPPORT);
  7. RegisterListener2(this, WH_MSG_ISSYNCSSUPPORT);
  8. RegisterListener2(this, WH_MSG_ISAVENUESUPPORT);
  9. RegisterListener2(this, WH_MSG_GETPANETYPE);
  10. RegisterListener2(this, WH_MSG_GETPANES);
  11. RegisterListener2(this, WH_MSG_RELOADNS6);
  12. RegisterListener2(this, WH_MSG_GETCMD);
  13. RegisterListener2(this, WH_MSG_GETPANE);
  14. RegisterListener2(this, WH_MSG_GETDEFPANE);
  15.  
  16. if (gbNav4 && !gbNav6)
  17. {
  18.     var gnReload=0;
  19.     setTimeout("delayReload();",5000);
  20. }
  21.  
  22. function delayReload()
  23. {
  24.     if (!(this.cMRServer && cMRServer.m_strVersion))
  25.     {
  26.         if(gnReload!=2)
  27.         {
  28.             if(typeof(nViewFrameType) != "undefined" && nViewFrameType==1)
  29.                 document.location=document.location;
  30.         }
  31.     }
  32. }
  33.  
  34. var gsToolbarOrder = "toc|idx|fts|glo|blankblock";
  35. var gsMinibarOrder = "blankblock|hide2|";
  36.  
  37. var gsTopic = "introsecuridtoken.htm";
  38. var PANE_OPT_SEARCH = 1;
  39. var PANE_OPT_BROWSESEQ = 2;
  40. var gnOpts=-1;
  41. var gnCmd=-1;
  42. var gnPans=2;
  43. var gsBtns="invalid";
  44. var gsDefaultBtn="invalid";
  45. var gbHasTitle=false;
  46.  
  47. if (location.hash.length > 1)
  48. {
  49.     var sParam = location.hash;
  50.     if (sParam.indexOf("#<") == 0)
  51.     {
  52.         document.location = "whcsh_home.htm#" + sParam.substring(2);
  53.     }
  54.     else if (sParam.indexOf("#>>") == 0)
  55.     {
  56.         parseParam(sParam.substring(3));
  57.         sParam = "#" + gsTopic + sParam.substring(1);
  58.     }
  59.     else
  60.     {
  61.         var nPos = sParam.indexOf(">>");
  62.         if (nPos>1)
  63.         {
  64.             if(IsInternal(sParam.substring(1, nPos)))
  65.                 gsTopic = _textToHtml(sParam.substring(1, nPos));
  66.             parseParam(sParam.substring(nPos+2));
  67.         }
  68.         else
  69.         {
  70.             if(IsInternal(sParam.substring(1)))
  71.                 gsTopic = _textToHtml(sParam.substring(1));
  72.         }
  73.     }
  74.     if (gnPans == 1 && gsTopic)
  75.     {
  76.         var strURL=location.href;
  77.         if (location.hash)
  78.         {
  79.             var nPos=location.href.indexOf(location.hash);
  80.             strURL=strURL.substring(0, nPos);
  81.         }
  82.         if (gbHasTitle)
  83.             document.location=_getPath(strURL)+ "whskin_tw.htm" + sParam;
  84.         else
  85.             document.location=_getPath(strURL)+ gsTopic;
  86.     }
  87. }
  88.  
  89. function parseParam(sParam)
  90. {
  91.     if (sParam)
  92.     {
  93.         var nBPos=0;
  94.         do 
  95.         {
  96.             var nPos=sParam.indexOf(">>", nBPos);
  97.             if (nPos!=-1)
  98.             {
  99.                 if (nPos>0)
  100.                 {
  101.                     var sPart=sParam.substring(nBPos, nPos);
  102.                     parsePart(sPart);
  103.                 }
  104.                 nBPos = nPos + 2;
  105.             }
  106.             else
  107.             {
  108.                 var sPart=sParam.substring(nBPos);
  109.                 parsePart(sPart);
  110.                 break;
  111.             }
  112.         } while(nBPos < sParam.length);
  113.     }    
  114. }
  115.  
  116. function parsePart(sPart)
  117. {
  118.     if(sPart.toLowerCase().indexOf("cmd=")==0)
  119.     {
  120.         gnCmd=parseInt(sPart.substring(4));
  121.     }
  122.     else if(sPart.toLowerCase().indexOf("cap=")==0)
  123.     {
  124.         document.title=_browserStringToText(sPart.substring(4));
  125.         gbHasTitle=true;
  126.     }
  127.     else if(sPart.toLowerCase().indexOf("pan=")==0)
  128.     {
  129.         gnPans=parseInt(sPart.substring(4));
  130.     }
  131.     else if(sPart.toLowerCase().indexOf("pot=")==0)
  132.     {
  133.         gnOpts=parseInt(sPart.substring(4));
  134.     }
  135.     else if(sPart.toLowerCase().indexOf("pbs=")==0)
  136.     {
  137.         var sRawBtns = sPart.substring(4);
  138.         var aBtns = sRawBtns.split("|");
  139.         for (var i=0;i<aBtns.length;i++)
  140.         {
  141.             aBtns[i] = transferAgentNameToPaneName(aBtns[i]);
  142.         }
  143.         gsRawBtns = aBtns.join("|");
  144.     }
  145.     else if(sPart.toLowerCase().indexOf("pdb=")==0)
  146.     {
  147.         gsDefaultBtn=transferAgentNameToPaneName(sPart.substring(4));
  148.     }
  149. }
  150.  
  151. function setToolbarOrder(sOrder)
  152. {
  153.     gsToolbarOrder = sOrder;
  154. }
  155.  
  156. function setMinibarOrder(sOrder)
  157. {
  158.     gsMinibarOrder = sOrder;
  159. }
  160.  
  161. function onSendMessageX(oMsg)
  162. {
  163.     var nMsgId = oMsg.nMessageId;
  164.     if (nMsgId == WH_MSG_GETSTARTFRAME)
  165.     {
  166.         oMsg.oParam.oFrame = this;
  167.         return false;
  168.     }
  169.     else if (nMsgId == WH_MSG_GETDEFAULTTOPIC)
  170.     {
  171.         if (this.cMRServer && cMRServer.m_strVersion)
  172.         {
  173.             if (cMRServer.m_strURLTopic);
  174.             {
  175.                 oMsg.oParam.sTopic = cMRServer.m_strURLTopic;
  176.                 return false;
  177.             }
  178.  
  179.         }
  180.         oMsg.oParam.sTopic = gsTopic;
  181.         return false;
  182.     }
  183.     else if (nMsgId == WH_MSG_TOOLBARORDER)
  184.     {
  185.         var oMsg1 = new whMessage(WH_MSG_GETPANES, this, 1, null);
  186.         if (SendMessage(oMsg1))
  187.         {
  188.             if (oMsg1.oParam)
  189.             {
  190.                 if (this.cMRServer && cMRServer.m_strVersion)
  191.                 {
  192.                     var aToolbarOrder=cMRServer.m_strAgentList.split(";");
  193.                     var i=0;
  194.                     for (i=0;i<aToolbarOrder.length;i++)
  195.                         aToolbarOrder[i]=transferANToPN2(aToolbarOrder[i]);
  196.                     aToolbarOrder[aToolbarOrder.length] = "blankblock";
  197.                     if (cMRServer.m_bShowSearchInput)
  198.                     {
  199.                         aToolbarOrder[aToolbarOrder.length] = "searchform";
  200.                     }
  201.                     aToolbarOrder[aToolbarOrder.length] = "banner";
  202.                     var aToolbarOrderNew = new Array();
  203.                     for (i=0;i<aToolbarOrder.length;i++)
  204.                     {
  205.                         if (isAPane(aToolbarOrder[i]))
  206.                         {
  207.                             if (oMsg1.oParam.aPanes && oMsg1.oParam.aPanes.length)
  208.                             {
  209.                                 for (var j=0;j<oMsg1.oParam.aPanes.length;j++)
  210.                                 {
  211.                                     if (aToolbarOrder[i] == oMsg1.oParam.aPanes[j].sPaneName)
  212.                                     {
  213.                                         aToolbarOrderNew[aToolbarOrderNew.length] = aToolbarOrder[i];
  214.                                         break;
  215.                                     }
  216.                                 }
  217.                             }
  218.                         }
  219.                         else
  220.                             aToolbarOrderNew[aToolbarOrderNew.length] = aToolbarOrder[i];
  221.                     }
  222.                     oMsg.oParam = aToolbarOrderNew.join("|");
  223.                     return false;
  224.                 }
  225.             }
  226.         }
  227.         var sParam="";
  228.         if (gsBtns!="invalid")
  229.             sParam=gsBtns+"|blankblock|banner";
  230.         else
  231.             sParam = gsToolbarOrder;
  232.  
  233.         if (gnOpts!=-1)
  234.         {
  235.             var nPosForm=sParam.indexOf("|searchform|");
  236.             if (gnOpts&PANE_OPT_SEARCH)
  237.             {
  238.                 if (nPosForm == -1 && sParam.indexOf("|fts|") != -1)
  239.                 {
  240.                     var nPos=sParam.indexOf("banner");
  241.                     if (nPos!=-1)
  242.                     {
  243.                         sParam=sParam.substring(0, nPos) + "searchform|" + sParam.substring(nPos);
  244.                     }
  245.                 }
  246.             }
  247.             else
  248.             {
  249.                 if (nPosForm!=-1)
  250.                 {
  251.                     sParam=sParam.substring(0,nPosForm) + sParam.substring(nPosForm+11);
  252.                 }
  253.             }
  254.         }
  255.         oMsg.oParam=sParam;
  256.         return false;
  257.     }
  258.     else if (nMsgId == WH_MSG_MINIBARORDER)
  259.     {
  260.         var sMinParam=gsMinibarOrder;
  261.         if (gnOpts!=-1)
  262.         {
  263.             var nPosBro=gsMinibarOrder.indexOf("avprev|avnext");
  264.             if (gnOpts&PANE_OPT_BROWSESEQ)
  265.             {
  266.                 if (nPosBro==-1)
  267.                 {
  268.                     sMinParam ="avprev|avnext|" + gsMinibarOrder;
  269.                 }
  270.             }
  271.             else
  272.             {
  273.                 if (nPosBro!=-1)
  274.                 {
  275.                     if (nPosBro!=0)
  276.                         sMinParam=gsMinibarOrder.substring(0, nPosBro) + gsMinibarOrder.substring(nPosBro+14);
  277.                     else
  278.                         sMinParam=gsMinibarOrder.substring(14);
  279.                 }
  280.             }
  281.         }
  282.         oMsg.oParam = sMinParam;
  283.         return false;
  284.     }
  285.     else if (nMsgId == WH_MSG_ISSYNCSSUPPORT)
  286.     {
  287.         if (this.cMRServer && cMRServer.m_strVersion)
  288.         {
  289.             if (cMRServer.m_bShowSync)
  290.                 oMsg.oParam=true;
  291.             else
  292.                 oMsg.oParam=false;
  293.             return false;
  294.         }
  295.         else
  296.         {
  297.             if(typeof(nViewFrameType)!="undefined")
  298.             {
  299.                 oMsg.oParam= (nViewFrameType < 3);
  300.                 return false;
  301.             }
  302.         }
  303.     }
  304.     else if (nMsgId == WH_MSG_ISAVENUESUPPORT)
  305.     {
  306.         if (this.cMRServer && cMRServer.m_strVersion)
  307.         {
  308.             if (cMRServer.m_bShowBrowseSequences)
  309.                 oMsg.oParam=true;
  310.             else
  311.                 oMsg.oParam=false;
  312.         }
  313.         else
  314.         {
  315.             oMsg.oParam=true;
  316.         }
  317.         return false;
  318.     }
  319.     else if (nMsgId == WH_MSG_ISSEARCHSUPPORT)
  320.     {
  321.         if(typeof(nViewFrameType)!="undefined")
  322.         {
  323.             oMsg.oParam= (nViewFrameType < 3);
  324.             return false;
  325.         }
  326.     }
  327.     else if (nMsgId == WH_MSG_GETPANETYPE)
  328.     {
  329.         if(typeof(nViewFrameType)!="undefined")
  330.         {
  331.             var oPaneInfo = new Object();
  332.             oPaneInfo.nType = nViewFrameType;
  333.             oPaneInfo.sPaneURL = strPane;
  334.             oMsg.oParam = oPaneInfo;
  335.             return false;
  336.         }
  337.     }
  338.     else if (nMsgId == WH_MSG_GETPANES)
  339.     {
  340.         if (this.cMRServer && cMRServer.m_strVersion)
  341.         {
  342.             var oPanes = new Object();
  343.             var aAgentNames = null;
  344.             if (cMRServer.m_strDefAgent)
  345.                 oPanes.sDefault = transferAgentNameToPaneName(cMRServer.m_strDefAgent);
  346.  
  347.             aPanes = new Array();
  348.             for(var i=0; i< cMRServer.m_cAgents.length; i++)
  349.             {
  350.                 var nCur = aPanes.length;
  351.                 aPanes[nCur] = new Object();
  352.                 aPanes[nCur].sPaneName = transferAgentNameToPaneName(cMRServer.m_cAgents[i].m_strID);
  353.                 aPanes[nCur].sPaneURL = cMRServer.m_cAgents[i].m_strURL;
  354.             }
  355.             oPanes.aPanes = aPanes;
  356.             oMsg.oParam = oPanes;
  357.             return false;
  358.         }
  359.         else
  360.         {
  361.             oMsg.oParam = null;
  362.             return false;
  363.         }
  364.     }
  365.     else if(nMsgId==WH_MSG_RELOADNS6)
  366.     {
  367.         if(gbNav4 && !gbNav6)
  368.             gnReload++;
  369.         return false;
  370.     }
  371.     else if(nMsgId==WH_MSG_GETCMD)
  372.     {
  373.         oMsg.oParam=gnCmd;
  374.         return false;
  375.     }
  376.     else if(nMsgId==WH_MSG_GETPANE)
  377.     {
  378.         if (gsBtns!="invalid" && oMsg.oParam.sName)
  379.         {
  380.             if(gsBtns.indexOf(oMsg.oParam.sName) != -1)
  381.                 oMsg.oParam.bEnable=true;
  382.             else
  383.                 oMsg.oParam.bEnable=false;
  384.         }
  385.         else
  386.             oMsg.oParam.bEnable=true;
  387.         return false;
  388.     }
  389.     else if(nMsgId==WH_MSG_GETDEFPANE)
  390.     {
  391.         if (gsDefaultBtn!="invalid")
  392.         {
  393.             oMsg.oParam=gsDefaultBtn;
  394.         }
  395.         return false;
  396.     }
  397.     return true;
  398. }
  399.  
  400. function transferANToPN2(sAN)
  401. {
  402.     if (sAN =="toc")
  403.         return "toc";
  404.     else if    (sAN =="ndx")
  405.         return "idx";
  406.     else if    (sAN =="nls")
  407.         return "fts";
  408.     else if    (sAN =="gls")
  409.         return "glo";
  410.     else if    (sAN =="WebSearch")
  411.         return "websearch";
  412.     else if (sAN.indexOf("custom_")==0);
  413.         return "custom" + sAN.substring(7);
  414.     return sAN;
  415. }
  416.  
  417. function transferAgentNameToPaneName(sAgentName)
  418. {
  419.     if (sAgentName =="toc")
  420.         return "toc";
  421.     else if    (sAgentName =="ndx")
  422.         return "idx";
  423.     else if    (sAgentName =="nls")
  424.         return "fts";
  425.     else if    (sAgentName =="gls")
  426.         return "glo";
  427.     return "";
  428. }
  429.  
  430. function isAPane(sPaneName)
  431. {
  432.     if (sPaneName == "toc" || sPaneName == "idx" || sPaneName == "fts" || sPaneName == "glo")
  433.         return true;
  434.     else
  435.         return false;
  436. }