home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2006 April / DPPRO0406DVD.ISO / Essentials / Programming / Eclipse SDK / eclipse-SDK-3.1.1-win32.exe / eclipse / plugins / org.eclipse.help.webapp_3.1.0 / advanced / nav.jsp < prev    next >
Encoding:
Text File  |  2005-09-29  |  4.0 KB  |  149 lines

  1. <%--
  2.  Copyright (c) 2000, 2004 IBM Corporation and others.
  3.  All rights reserved. This program and the accompanying materials 
  4.  are made available under the terms of the Eclipse Public License v1.0
  5.  which accompanies this distribution, and is available at
  6.  http://www.eclipse.org/legal/epl-v10.html
  7.  
  8.  Contributors:
  9.      IBM Corporation - initial API and implementation
  10. --%>
  11. <%@ include file="fheader.jsp"%>
  12.  
  13. <% 
  14.     LayoutData data = new LayoutData(application,request, response);
  15.     WebappPreferences prefs = data.getPrefs();
  16. %>
  17.  
  18. <html>
  19.  
  20. <head>
  21. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  22. <title><%=ServletResources.getString("Help", request)%></title>
  23.  
  24. <style type="text/css">
  25. <% 
  26. if (data.isMozilla()) {
  27. %>
  28. HTML {
  29.     border-<%=isRTL?"right":"left"%>:1px solid ThreeDShadow;
  30.     background:<%=prefs.getToolbarBackground()%>;
  31. }
  32. <% 
  33. } else {
  34. %>
  35. FRAMESET {
  36.     border-top:1px solid ThreeDShadow;
  37.     border-left:1px solid ThreeDShadow;
  38.     border-right:1px solid ThreeDShadow;
  39. }
  40. <%
  41. }
  42. %>
  43. </style>
  44.  
  45. <script language="JavaScript">
  46. var isMozilla = navigator.userAgent.indexOf('Mozilla') != -1 && parseInt(navigator.appVersion.substring(0,1)) >= 5;
  47. var isMozilla10 = isMozilla && navigator.userAgent.indexOf('rv:1') != -1;
  48. var isIE = navigator.userAgent.indexOf('MSIE') != -1;
  49.  
  50. /**
  51.  * Views can call this to set the title on the content toolbar
  52.  */
  53. function setContentToolbarTitle(title)
  54. {
  55.     if(parent.ContentFrame.ContentToolbarFrame && parent.ContentFrame.ContentToolbarFrame.setTitle ){
  56.         parent.ContentFrame.ContentToolbarFrame.setTitle(title);
  57.     }
  58. }
  59.  
  60. /**
  61.  * Shows specified view. Called from actions that switch the view
  62.  */
  63. function showView(view)
  64. {
  65.     // Note: assumes the same id shared by tabs and iframes
  66.     ViewsFrame.showView(view);
  67.     TabsFrame.showTab(view);
  68. }
  69.  
  70. var temp;
  71. var tempActiveId;
  72. var tempView = "";
  73.  
  74. /**
  75.  * Shows the TOC frame, loads appropriate TOC, and selects the topic
  76.  */
  77. function displayTocFor(topic)
  78. {
  79.     tempView = ViewsFrame.lastView;
  80.     
  81.     /******** HARD CODED VIEW NAME *********/
  82.     showView("toc");
  83.     
  84.     var tocView = ViewsFrame.toc.tocViewFrame;
  85.  
  86.     if (tocView.selectTopic && tocView.selectTopic(topic))
  87.         return;
  88.     else {
  89.         // save the current navigation, so we can retrieve it when synch does not work
  90.         saveNavigation();
  91.  
  92.         var advIndex=window.location.href.indexOf("/advanced/nav.jsp");
  93.         if(advIndex < 0)
  94.             return;
  95.         var tocURL = window.location.href.substr(0, advIndex) + "/advanced/tocView.jsp";
  96.         tocView.location.replace(tocURL + "?topic="+topic+"&synch=yes");            
  97.     }
  98. }
  99.  
  100. function saveNavigation()
  101. {
  102.     /**** HARD CODED VIEW NAME *********/
  103.     var tocView = ViewsFrame.toc.tocViewFrame;
  104.     
  105.     if (tocView.oldActive) {
  106.         tempActiveId = tocView.oldActive.id;
  107.         tocView.oldActive.className = tocView.oldActiveClass;
  108.         tocView.oldActive = null;
  109.     }
  110.         
  111.     if (isIE)
  112.         temp = tocView.document.body.innerHTML;
  113.     else if (isMozilla)
  114.         temp = tocView.document.documentElement.innerHTML;
  115. }
  116.  
  117. function restoreNavigation(errorMessage)
  118. {    
  119.     // switch to saved view
  120.     showView(tempView);
  121.  
  122.     /**** HARD CODED VIEW NAME *********/    
  123.     var tocView = ViewsFrame.toc.tocViewFrame;
  124.  
  125.     if (temp && (isIE || isMozilla10)) {
  126.         // Restore old navigation
  127.         if (isIE) {
  128.             tocView.document.body.innerHTML = temp;
  129.         } else if (isMozilla10) {
  130.             tocView.document.documentElement.innerHTML = temp;
  131.         }
  132.         if (tempActiveId){
  133.             tocView.selectTopicById(tempActiveId);
  134.         }
  135.     } else {
  136.         // fail back case
  137.         tocView.location.replace("tocView.jsp");
  138.     }
  139.     window.status=errorMessage;    
  140. }
  141. </script>
  142. </head>
  143.  
  144. <frameset onload="showView('<%=data.getVisibleView()%>')" id="navFrameset" rows="*,21"  framespacing="0" border="0"  frameborder="0" scrolling="no">
  145.    <frame name="ViewsFrame" title="<%=ServletResources.getString("ignore", "ViewsFrame", request)%>" src='<%="views.jsp"+data.getQuery()%>' marginwidth="0" marginheight="0" scrolling="no" frameborder="0" resize=yes>
  146.    <frame name="TabsFrame" title="<%=ServletResources.getString("TabsFrame", request)%>" src='<%="tabs.jsp"+data.getQuery()%>' marginwidth="0" marginheight="0" scrolling="no" frameborder="0" noresize>
  147. </frameset>
  148.  
  149. </html>