< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js

Print this page




  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 moduleSearchIndex;
  27 var packageSearchIndex;
  28 var typeSearchIndex;
  29 var memberSearchIndex;
  30 var tagSearchIndex;
  31 function loadScripts(doc, tag) {
  32     createElem(doc, tag, 'script-dir/jszip/dist/jszip.js');
  33     createElem(doc, tag, 'script-dir/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, 'script-dir/jszip-utils/dist/jszip-utils-ie.js');
  37     }
  38     createElem(doc, tag, 'search.js');
  39 
  40     $.get(pathtoroot + "module-search-index.zip")
  41             .done(function() {
  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);
  46                         });
  47                     });
  48                 });
  49             });
  50     $.get(pathtoroot + "package-search-index.zip")
  51             .done(function() {
  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);
  56                         });
  57                     });
  58                 });
  59             });
  60     $.get(pathtoroot + "type-search-index.zip")
  61             .done(function() {
  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);
  66                         });
  67                     });
  68                 });
  69             });
  70     $.get(pathtoroot + "member-search-index.zip")
  71             .done(function() {
  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);
  76                         });
  77                     });
  78                 });
  79             });
  80     $.get(pathtoroot + "tag-search-index.zip")
  81             .done(function() {
  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);
  86                         });
  87                     });
  88                 });
  89             });
  90     if (!moduleSearchIndex) {
  91         createElem(doc, tag, 'module-search-index.js');
  92     }
  93     if (!packageSearchIndex) {
  94         createElem(doc, tag, 'package-search-index.js');
  95     }
  96     if (!typeSearchIndex) {
  97         createElem(doc, tag, 'type-search-index.js');
  98     }
  99     if (!memberSearchIndex) {
 100         createElem(doc, tag, 'member-search-index.js');
 101     }
 102     if (!tagSearchIndex) {
 103         createElem(doc, tag, 'tag-search-index.js');
 104     }
 105 }
 106 
 107 function createElem(doc, tag, path) {
 108     var script = doc.createElement(tag);
 109     var scriptElement = doc.getElementsByTagName(tag)[0];




  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 moduleSearchIndex;
  27 var packageSearchIndex;
  28 var typeSearchIndex;
  29 var memberSearchIndex;
  30 var tagSearchIndex;
  31 function loadScripts(doc, tag) {






  32     createElem(doc, tag, 'search.js');
  33 


















































  34     if (!moduleSearchIndex) {
  35         createElem(doc, tag, 'module-search-index.js');
  36     }
  37     if (!packageSearchIndex) {
  38         createElem(doc, tag, 'package-search-index.js');
  39     }
  40     if (!typeSearchIndex) {
  41         createElem(doc, tag, 'type-search-index.js');
  42     }
  43     if (!memberSearchIndex) {
  44         createElem(doc, tag, 'member-search-index.js');
  45     }
  46     if (!tagSearchIndex) {
  47         createElem(doc, tag, 'tag-search-index.js');
  48     }
  49 }
  50 
  51 function createElem(doc, tag, path) {
  52     var script = doc.createElement(tag);
  53     var scriptElement = doc.getElementsByTagName(tag)[0];


< prev index next >