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 / views.jsp < prev    next >
Encoding:
Text File  |  2005-09-29  |  5.0 KB  |  210 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="header.jsp"%>
  12.  
  13. <% 
  14.     LayoutData data = new LayoutData(application,request, response);
  15.     WebappPreferences prefs = data.getPrefs();
  16.     View[] views = data.getViews();
  17. %>    
  18.  
  19.  
  20. <html>
  21. <head>
  22. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  23.  
  24. <title><%=ServletResources.getString("Views", request)%></title>
  25.  
  26. <style type="text/css">
  27.  
  28. /* need this one for Mozilla */
  29. HTML { 
  30.     width:100%;
  31.     height:100%;
  32.     margin:0px;
  33.     padding:0px;
  34.     border:0px;
  35.  }
  36.  
  37. BODY {
  38.     margin:0px;
  39.     padding:0px;
  40.     /* Mozilla does not like width:100%, so we set height only */
  41.     height:100%;
  42. }
  43.  
  44. IFRAME {
  45.     width:100%;
  46.     height:100%;
  47. }
  48.  
  49. .hidden {
  50.     visibility:hidden;
  51.     width:0;
  52.     height:0;
  53. }
  54.  
  55. .visible {
  56.     visibility:visible;
  57.     width:100%;
  58.     height:100%;
  59. }
  60.  
  61. </style>
  62.  
  63. <script language="Javascript">
  64.  
  65. var lastView = "";
  66. /**
  67.  * Switches to specified view
  68.  */
  69. function showView(view)
  70. {     
  71.     if (view == lastView) 
  72.         return;
  73.         
  74.     lastView = view;
  75.            
  76.     // show appropriate frame
  77.      var iframes = parent.ViewsFrame.document.body.getElementsByTagName("IFRAME");
  78.      for (var i=0; i<iframes.length; i++)
  79.      {            
  80.           if (iframes[i].id != view){
  81.                iframes[i].className = "hidden";
  82.                iframes[i].style.visibility="hidden";
  83.           }else{
  84.                iframes[i].className = "visible";
  85.                iframes[i].style.visibility="visible";
  86.            }
  87.      }
  88. }
  89.  
  90. var activityFiltering = <%=(new ActivitiesData(application, request, response)).isActivityFiltering()?"true":"false"%>;
  91. var displayShowAllConfirmation = <%=prefs.isDontConfirmShowAll()?"false":"true"%>;
  92. var regExp=/&(showAll|synch)=(on|off|yes|no)/gi;
  93. function toggleShowAll(){
  94.     if(activityFiltering){
  95.         if( displayShowAllConfirmation ){
  96.             confirmShowAll();
  97.         }else{
  98.             showAll();
  99.         }
  100.     } else {
  101.         dontShowAll();
  102.     }
  103. }
  104.  
  105. function dontAskAgain(){
  106.     displayShowAllConfirmation = false;
  107. }
  108. function showAll(){
  109.     var displayConfirmParam;
  110.     if(displayShowAllConfirmation){
  111.         displayConfirmParam="";
  112.     }else{
  113.         displayConfirmParam="&showconfirm=false";
  114.     }
  115.     activityFiltering=false;
  116.     try{
  117.         window.frames.toc.tocToolbarFrame.setButtonState("show_all", true);
  118.     }catch(ex) {}
  119.     try{
  120.         window.frames.search.searchToolbarFrame.setButtonState("show_all", true);
  121.     }catch(ex) {}
  122.     try{
  123.         window.frames.toc.tocViewFrame.location.replace(window.frames.toc.tocViewFrame.location.href.replace(regExp, "")+"&showAll=on"+displayConfirmParam);
  124.     }catch(ex) {}
  125.     try{
  126.         window.frames.search.searchViewFrame.location.replace(window.frames.search.searchViewFrame.location.href.replace(regExp, "")+"&showAll=on");
  127.     }catch(ex) {}
  128. }
  129.  
  130. function dontShowAll(){
  131.     activityFiltering=true;
  132.     try{
  133.         window.frames.toc.tocToolbarFrame.setButtonState("show_all", false);
  134.     }catch(ex) {}
  135.     try{
  136.         window.frames.search.searchToolbarFrame.setButtonState("show_all", false);
  137.     }catch(ex) {}
  138.     try{
  139.         window.frames.toc.tocViewFrame.location.replace(window.frames.toc.tocViewFrame.location.href.replace(regExp, "")+"&showAll=off");
  140.     }catch(ex) {}
  141.     try{
  142.         window.frames.search.searchViewFrame.location.replace(window.frames.search.searchViewFrame.location.href.replace(regExp, "")+"&showAll=off");
  143.     }catch(ex) {}
  144. }
  145.  
  146. var confirmShowAllDialog;
  147. var w = 470;
  148. var h = 300;
  149.  
  150. function confirmShowAll()
  151. {
  152. <%
  153. if (data.isIE()){
  154. %>
  155.     var l = top.screenLeft + (top.document.body.clientWidth - w) / 2;
  156.     var t = top.screenTop + (top.document.body.clientHeight - h) / 2;
  157. <%
  158. } else {
  159. %>
  160.     var l = top.screenX + (top.innerWidth - w) / 2;
  161.     var t = top.screenY + (top.innerHeight - h) / 2;
  162. <%
  163. }
  164. %>
  165.     // move the dialog just a bit higher than the middle
  166.     if (t-50 > 0) t = t-50;
  167.     
  168.     window.location="javascript://needModal";
  169.     confirmShowAllDialog = window.open("confirmShowAll.jsp", "confirmShowAllDialog", "resizeable=no,height="+h+",width="+w+",left="+l+",top="+t );
  170.     confirmShowAllDialog.focus(); 
  171. }
  172.  
  173. function closeConfirmShowAllDialog(){
  174.     try {
  175.         if (confirmShowAllDialog){
  176.             confirmShowAllDialog.close();
  177.         }
  178.     }
  179.     catch(e) {}
  180. }
  181.  
  182. </script>
  183.  
  184. </head>
  185.    
  186. <body dir="<%=direction%>" tabIndex="-1" onunload="closeConfirmShowAllDialog()">
  187. <%
  188.     for (int i=0; i<views.length; i++) 
  189.     {
  190.         // normally we would hide the views first, but mozilla needs all iframes to be visible to load 
  191.         // other frames
  192.         String className =  data.getVisibleView().equals(views[i].getName()) || data.isMozilla() ? "visible" : "hidden";
  193. %>
  194.      <iframe frameborder="0" 
  195.              class="<%=className%>"  
  196.              name="<%=views[i].getName()%>"
  197.              title="<%=ServletResources.getString("ignore", views[i].getName(), request)%>"
  198.              id="<%=views[i].getName()%>" 
  199.              src='<%="view.jsp?view="+views[i].getName()+(request.getQueryString()==null?"":("&"+request.getQueryString()))%>'>
  200.      </iframe> 
  201. <%
  202.     }
  203. %>    
  204.  
  205.  <iframe frameborder="0" style="visibility:hidden" tabindex="-1" name="temp" id="temp" title="<%=ServletResources.getString("ignore", "temp", request)%>"></iframe>
  206.  
  207. </body>
  208. </html>
  209.  
  210.