You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*
  2. * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
  3. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. *
  5. *
  6. *
  7. *
  8. *
  9. *
  10. *
  11. *
  12. *
  13. *
  14. *
  15. *
  16. *
  17. *
  18. *
  19. *
  20. *
  21. *
  22. *
  23. *
  24. */
  25. var moduleSearchIndex;
  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. $.get(pathtoroot + "module-search-index.zip")
  39. .done(function() {
  40. JSZipUtils.getBinaryContent(pathtoroot + "module-search-index.zip", function(e, data) {
  41. var zip = new JSZip(data);
  42. zip.load(data);
  43. moduleSearchIndex = JSON.parse(zip.file("module-search-index.json").asText());
  44. });
  45. });
  46. $.get(pathtoroot + "package-search-index.zip")
  47. .done(function() {
  48. JSZipUtils.getBinaryContent(pathtoroot + "package-search-index.zip", function(e, data) {
  49. var zip = new JSZip(data);
  50. zip.load(data);
  51. packageSearchIndex = JSON.parse(zip.file("package-search-index.json").asText());
  52. });
  53. });
  54. $.get(pathtoroot + "type-search-index.zip")
  55. .done(function() {
  56. JSZipUtils.getBinaryContent(pathtoroot + "type-search-index.zip", function(e, data) {
  57. var zip = new JSZip(data);
  58. zip.load(data);
  59. typeSearchIndex = JSON.parse(zip.file("type-search-index.json").asText());
  60. });
  61. });
  62. $.get(pathtoroot + "member-search-index.zip")
  63. .done(function() {
  64. JSZipUtils.getBinaryContent(pathtoroot + "member-search-index.zip", function(e, data) {
  65. var zip = new JSZip(data);
  66. zip.load(data);
  67. memberSearchIndex = JSON.parse(zip.file("member-search-index.json").asText());
  68. });
  69. });
  70. $.get(pathtoroot + "tag-search-index.zip")
  71. .done(function() {
  72. JSZipUtils.getBinaryContent(pathtoroot + "tag-search-index.zip", function(e, data) {
  73. var zip = new JSZip(data);
  74. zip.load(data);
  75. tagSearchIndex = JSON.parse(zip.file("tag-search-index.json").asText());
  76. });
  77. });
  78. if (!moduleSearchIndex) {
  79. createElem(doc, tag, 'module-search-index.js');
  80. }
  81. if (!packageSearchIndex) {
  82. createElem(doc, tag, 'package-search-index.js');
  83. }
  84. if (!typeSearchIndex) {
  85. createElem(doc, tag, 'type-search-index.js');
  86. }
  87. if (!memberSearchIndex) {
  88. createElem(doc, tag, 'member-search-index.js');
  89. }
  90. if (!tagSearchIndex) {
  91. createElem(doc, tag, 'tag-search-index.js');
  92. }
  93. $(window).resize(function() {
  94. $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
  95. });
  96. }
  97. function createElem(doc, tag, path) {
  98. var script = doc.createElement(tag);
  99. var scriptElement = doc.getElementsByTagName(tag)[0];
  100. script.src = pathtoroot + path;
  101. scriptElement.parentNode.insertBefore(script, scriptElement);
  102. }
  103. function show(type) {
  104. count = 0;
  105. for (var key in data) {
  106. var row = document.getElementById(key);
  107. if ((data[key] & type) !== 0) {
  108. row.style.display = '';
  109. row.className = (count++ % 2) ? rowColor : altColor;
  110. }
  111. else
  112. row.style.display = 'none';
  113. }
  114. updateTabs(type);
  115. }
  116. function updateTabs(type) {
  117. for (var value in tabs) {
  118. var sNode = document.getElementById(tabs[value][0]);
  119. var spanNode = sNode.firstChild;
  120. if (value == type) {
  121. sNode.className = activeTableTab;
  122. spanNode.innerHTML = tabs[value][1];
  123. }
  124. else {
  125. sNode.className = tableTab;
  126. spanNode.innerHTML = "<a href=\"javascript:show("+ value + ");\">" + tabs[value][1] + "</a>";
  127. }
  128. }
  129. }
  130. function updateModuleFrame(pFrame, cFrame) {
  131. top.packageFrame.location = pFrame;
  132. top.classFrame.location = cFrame;
  133. }