src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js
changeset 50167 cc705c956798
parent 47447 9887d1bc3e9c
child 52616 1a395165c09b
equal deleted inserted replaced
50166:1d683e243d8d 50167:cc705c956798
     1 /*
     1 /*
     2  * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   102     var scriptElement = doc.getElementsByTagName(tag)[0];
   102     var scriptElement = doc.getElementsByTagName(tag)[0];
   103     script.src = pathtoroot + path;
   103     script.src = pathtoroot + path;
   104     scriptElement.parentNode.insertBefore(script, scriptElement);
   104     scriptElement.parentNode.insertBefore(script, scriptElement);
   105 }
   105 }
   106 
   106 
   107 function show(type)
   107 function show(type) {
   108 {
       
   109     count = 0;
   108     count = 0;
   110     for (var key in methods) {
   109     for (var key in data) {
   111         var row = document.getElementById(key);
   110         var row = document.getElementById(key);
   112         if ((methods[key] &  type) !== 0) {
   111         if ((data[key] &  type) !== 0) {
   113             row.style.display = '';
   112             row.style.display = '';
   114             row.className = (count++ % 2) ? rowColor : altColor;
   113             row.className = (count++ % 2) ? rowColor : altColor;
   115         }
   114         }
   116         else
   115         else
   117             row.style.display = 'none';
   116             row.style.display = 'none';
   118     }
   117     }
   119     updateTabs(type);
   118     updateTabs(type);
   120 }
   119 }
   121 
   120 
   122 function showPkgs(type)
   121 function updateTabs(type) {
   123 {
       
   124     count = 0;
       
   125     for (var key in packages) {
       
   126         var row = document.getElementById(key);
       
   127         if ((packages[key] &  type) !== 0) {
       
   128             row.style.display = '';
       
   129             row.className = (count++ % 2) ? rowColor : altColor;
       
   130         }
       
   131         else
       
   132             row.style.display = 'none';
       
   133     }
       
   134     updatePkgsTabs(type);
       
   135 }
       
   136 
       
   137 function showGroups(type)
       
   138 {
       
   139     count = 0;
       
   140     for (var key in groups) {
       
   141         var row = document.getElementById(key);
       
   142         if ((groups[key] &  type) !== 0) {
       
   143             row.style.display = '';
       
   144             row.className = (count++ % 2) ? rowColor : altColor;
       
   145         }
       
   146         else
       
   147             row.style.display = 'none';
       
   148     }
       
   149     updateGroupsTabs(type);
       
   150 }
       
   151 
       
   152 function updateTabs(type)
       
   153 {
       
   154     for (var value in tabs) {
   122     for (var value in tabs) {
   155         var sNode = document.getElementById(tabs[value][0]);
   123         var sNode = document.getElementById(tabs[value][0]);
   156         var spanNode = sNode.firstChild;
   124         var spanNode = sNode.firstChild;
   157         if (value == type) {
   125         if (value == type) {
   158             sNode.className = activeTableTab;
   126             sNode.className = activeTableTab;
   163             spanNode.innerHTML = "<a href=\"javascript:show("+ value + ");\">" + tabs[value][1] + "</a>";
   131             spanNode.innerHTML = "<a href=\"javascript:show("+ value + ");\">" + tabs[value][1] + "</a>";
   164         }
   132         }
   165     }
   133     }
   166 }
   134 }
   167 
   135 
   168 function updateModuleFrame(pFrame, cFrame)
   136 function updateModuleFrame(pFrame, cFrame) {
   169 {
       
   170     top.packageFrame.location = pFrame;
   137     top.packageFrame.location = pFrame;
   171     top.classFrame.location = cFrame;
   138     top.classFrame.location = cFrame;
   172 }
   139 }
   173 
       
   174 function updatePkgsTabs(type)
       
   175 {
       
   176     for (var value in tabs) {
       
   177         var sNode = document.getElementById(tabs[value][0]);
       
   178         var spanNode = sNode.firstChild;
       
   179         if (value == type) {
       
   180             sNode.className = activeTableTab;
       
   181             spanNode.innerHTML = tabs[value][1];
       
   182         }
       
   183         else {
       
   184             sNode.className = tableTab;
       
   185             spanNode.innerHTML = "<a href=\"javascript:showPkgs(" + value + ");\">" + tabs[value][1] + "</a>";
       
   186         }
       
   187     }
       
   188 }
       
   189 
       
   190 function updateGroupsTabs(type)
       
   191 {
       
   192     for (var value in tabs) {
       
   193         var sNode = document.getElementById(tabs[value][0]);
       
   194         var spanNode = sNode.firstChild;
       
   195         if (value == type) {
       
   196             sNode.className = activeTableTab;
       
   197             spanNode.innerHTML = tabs[value][1];
       
   198         }
       
   199         else {
       
   200             sNode.className = tableTab;
       
   201             spanNode.innerHTML = "<a href=\"javascript:showGroups(" + value + ");\">" + tabs[value][1] + "</a>";
       
   202         }
       
   203     }
       
   204 }