author | bpatel |
Fri, 20 Nov 2015 20:55:07 +0000 | |
changeset 33920 | bd731341c405 |
parent 25874 | 83c19f00452c |
permissions | -rw-r--r-- |
33920 | 1 |
/* |
2 |
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
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. |
|
10 |
* |
|
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). |
|
16 |
* |
|
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. |
|
20 |
* |
|
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 |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
var packageSearchIndex; |
|
27 |
var typeSearchIndex; |
|
28 |
var memberSearchIndex; |
|
29 |
var tagSearchIndex; |
|
30 |
function loadScripts(doc, tag) { |
|
31 |
createElem(doc, tag, 'jquery/jszip/dist/jszip.js'); |
|
32 |
createElem(doc, tag, 'jquery/jszip-utils/dist/jszip-utils.js'); |
|
33 |
if (window.navigator.userAgent.indexOf('MSIE ') > 0 || window.navigator.userAgent.indexOf('Trident/') > 0 || |
|
34 |
window.navigator.userAgent.indexOf('Edge/') > 0) { |
|
35 |
createElem(doc, tag, 'jquery/jszip-utils/dist/jszip-utils-ie.js'); |
|
36 |
} |
|
37 |
createElem(doc, tag, 'search.js'); |
|
38 |
||
39 |
$.get(pathtoroot + "package-search-index.zip") |
|
40 |
.done(function() { |
|
41 |
JSZipUtils.getBinaryContent(pathtoroot + "package-search-index.zip", function(e, data) { |
|
42 |
var zip = new JSZip(data); |
|
43 |
zip.load(data); |
|
44 |
packageSearchIndex = JSON.parse(zip.file("package-search-index.json").asText()); |
|
45 |
}); |
|
46 |
}); |
|
47 |
$.get(pathtoroot + "type-search-index.zip") |
|
48 |
.done(function() { |
|
49 |
JSZipUtils.getBinaryContent(pathtoroot + "type-search-index.zip", function(e, data) { |
|
50 |
var zip = new JSZip(data); |
|
51 |
zip.load(data); |
|
52 |
typeSearchIndex = JSON.parse(zip.file("type-search-index.json").asText()); |
|
53 |
}); |
|
54 |
}); |
|
55 |
$.get(pathtoroot + "member-search-index.zip") |
|
56 |
.done(function() { |
|
57 |
JSZipUtils.getBinaryContent(pathtoroot + "member-search-index.zip", function(e, data) { |
|
58 |
var zip = new JSZip(data); |
|
59 |
zip.load(data); |
|
60 |
memberSearchIndex = JSON.parse(zip.file("member-search-index.json").asText()); |
|
61 |
}); |
|
62 |
}); |
|
63 |
$.get(pathtoroot + "tag-search-index.zip") |
|
64 |
.done(function() { |
|
65 |
JSZipUtils.getBinaryContent(pathtoroot + "tag-search-index.zip", function(e, data) { |
|
66 |
var zip = new JSZip(data); |
|
67 |
zip.load(data); |
|
68 |
tagSearchIndex = JSON.parse(zip.file("tag-search-index.json").asText()); |
|
69 |
}); |
|
70 |
}); |
|
71 |
} |
|
72 |
||
73 |
function createElem(doc, tag, path) { |
|
74 |
var script = doc.createElement(tag); |
|
75 |
var scriptElement = doc.getElementsByTagName(tag)[0]; |
|
76 |
script.src = pathtoroot + path; |
|
77 |
scriptElement.parentNode.insertBefore(script, scriptElement); |
|
78 |
} |
|
79 |
||
14549
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
80 |
function show(type) |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
81 |
{ |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
82 |
count = 0; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
83 |
for (var key in methods) { |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
84 |
var row = document.getElementById(key); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
85 |
if ((methods[key] & type) != 0) { |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
86 |
row.style.display = ''; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
87 |
row.className = (count++ % 2) ? rowColor : altColor; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
88 |
} |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
89 |
else |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
90 |
row.style.display = 'none'; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
91 |
} |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
92 |
updateTabs(type); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
93 |
} |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
94 |
|
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
95 |
function updateTabs(type) |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
96 |
{ |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
97 |
for (var value in tabs) { |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
98 |
var sNode = document.getElementById(tabs[value][0]); |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
99 |
var spanNode = sNode.firstChild; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
100 |
if (value == type) { |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
101 |
sNode.className = activeTableTab; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
102 |
spanNode.innerHTML = tabs[value][1]; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
103 |
} |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
104 |
else { |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
105 |
sNode.className = tableTab; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
106 |
spanNode.innerHTML = "<a href=\"javascript:show("+ value + ");\">" + tabs[value][1] + "</a>"; |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
107 |
} |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
108 |
} |
0599d73bf1da
8002304: Group methods by types in methods summary section
bpatel
parents:
diff
changeset
|
109 |
} |