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.
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
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
26 var moduleSearchIndex;
27 var packageSearchIndex;
29 var memberSearchIndex;
31 function loadScripts(doc, tag) {
32 createElem(doc, tag, 'jquery/jszip/dist/jszip.js');
33 createElem(doc, tag, 'jquery/jszip-utils/dist/jszip-utils.js');
34 if (window.navigator.userAgent.indexOf('MSIE ') > 0 || window.navigator.userAgent.indexOf('Trident/') > 0 ||
35 window.navigator.userAgent.indexOf('Edge/') > 0) {
36 createElem(doc, tag, 'jquery/jszip-utils/dist/jszip-utils-ie.js');
38 createElem(doc, tag, 'search.js');
40 $.get(pathtoroot + "module-search-index.zip")
42 JSZipUtils.getBinaryContent(pathtoroot + "module-search-index.zip", function(e, data) {
43 JSZip.loadAsync(data).then(function(zip){
44 zip.file("module-search-index.json").async("text").then(function(content){
45 moduleSearchIndex = JSON.parse(content);
50 $.get(pathtoroot + "package-search-index.zip")
52 JSZipUtils.getBinaryContent(pathtoroot + "package-search-index.zip", function(e, data) {
53 JSZip.loadAsync(data).then(function(zip){
54 zip.file("package-search-index.json").async("text").then(function(content){
55 packageSearchIndex = JSON.parse(content);
60 $.get(pathtoroot + "type-search-index.zip")
62 JSZipUtils.getBinaryContent(pathtoroot + "type-search-index.zip", function(e, data) {
63 JSZip.loadAsync(data).then(function(zip){
64 zip.file("type-search-index.json").async("text").then(function(content){
65 typeSearchIndex = JSON.parse(content);
70 $.get(pathtoroot + "member-search-index.zip")
72 JSZipUtils.getBinaryContent(pathtoroot + "member-search-index.zip", function(e, data) {
73 JSZip.loadAsync(data).then(function(zip){
74 zip.file("member-search-index.json").async("text").then(function(content){
75 memberSearchIndex = JSON.parse(content);
80 $.get(pathtoroot + "tag-search-index.zip")
82 JSZipUtils.getBinaryContent(pathtoroot + "tag-search-index.zip", function(e, data) {
83 JSZip.loadAsync(data).then(function(zip){
84 zip.file("tag-search-index.json").async("text").then(function(content){
85 tagSearchIndex = JSON.parse(content);
90 if (!moduleSearchIndex) {
91 createElem(doc, tag, 'module-search-index.js');
93 if (!packageSearchIndex) {
94 createElem(doc, tag, 'package-search-index.js');
96 if (!typeSearchIndex) {
97 createElem(doc, tag, 'type-search-index.js');
99 if (!memberSearchIndex) {
100 createElem(doc, tag, 'member-search-index.js');
102 if (!tagSearchIndex) {
103 createElem(doc, tag, 'tag-search-index.js');
105 $(window).resize(function() {
106 $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
110 function createElem(doc, tag, path) {
111 var script = doc.createElement(tag);
112 var scriptElement = doc.getElementsByTagName(tag)[0];
113 script.src = pathtoroot + path;
114 scriptElement.parentNode.insertBefore(script, scriptElement);
117 function show(type) {
119 for (var key in data) {
120 var row = document.getElementById(key);
121 if ((data[key] & type) !== 0) {
122 row.style.display = '';
123 row.className = (count++ % 2) ? rowColor : altColor;
126 row.style.display = 'none';
131 function updateTabs(type) {
132 for (var value in tabs) {
133 var sNode = document.getElementById(tabs[value][0]);
134 var spanNode = sNode.firstChild;
136 sNode.className = activeTableTab;
137 spanNode.innerHTML = tabs[value][1];
140 sNode.className = tableTab;
141 spanNode.innerHTML = "<a href=\"javascript:show("+ value + ");\">" + tabs[value][1] + "</a>";
146 function updateModuleFrame(pFrame, cFrame) {
147 top.packageFrame.location = pFrame;
148 top.classFrame.location = cFrame;