Skip to content

Commit 99c5080

Browse files
committed
Fix javadoc search js
Cannot use --no-module-directories as that would break any links to the main java documentation JAVA-3329
1 parent f448bdf commit 99c5080

File tree

1 file changed

+38
-21
lines changed

1 file changed

+38
-21
lines changed

gradle/javadoc.gradle

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ allprojects {
4242
options {
4343
author = true
4444
version = true
45-
links 'https://docs.oracle.com/javase/9/docs/api/'
45+
links 'https://docs.oracle.com/en/java/javase/11/docs/api/'
4646
tagletPath single(utilProject.sourceSets.main.output.classesDirs)
4747
taglets 'ManualTaglet'
4848
taglets 'DochubTaglet'
@@ -53,26 +53,43 @@ allprojects {
5353
addBooleanOption("html5", true)
5454
addBooleanOption("-allow-script-in-comments", true)
5555
header = '''
56-
| <script type="text/javascript">
57-
| <!-- Set the location hash in the classFrame -->
58-
| try {
59-
| locationHash = top.location.hash;
60-
| if (window.name == "classFrame" && locationHash != "") {
61-
| window.location.hash = locationHash;
62-
| }
63-
| } catch (error) {}
64-
| <!-- GA Tracking code -->
65-
| if (window.name == "" || window.name == "classFrame") {
66-
| var _elqQ = _elqQ || [];
67-
| _elqQ.push(["elqSetSiteId", "413370795"]);
68-
| _elqQ.push(["elqTrackPageView"]);
69-
| (function () {
70-
| function async_load() { var s = document.createElement("script"); s.type = "text/javascript"; s.async = true; s.src = "//img03.en25.com/i/elqCfg.min.js"; var x = document.getElementsByTagName("script")[0]; x.parentNode.insertBefore(s, x); }
71-
| if (window.addEventListener) window.addEventListener("DOMContentLoaded", async_load, false);
72-
| else if (window.attachEvent) window.attachEvent("onload", async_load);
73-
| })();
74-
| }
75-
| </script>'''.stripMargin()
56+
| <script type="text/javascript">
57+
| function setLocationHash() {
58+
| try {
59+
| locationHash = top.location.hash;
60+
| if (window.name == "classFrame" && locationHash != "") {
61+
| window.location.hash = locationHash;
62+
| }
63+
| } catch (error) {}
64+
| };
65+
| function setGATrackingCode() {
66+
| if (window.name == "" || window.name == "classFrame") {
67+
| var _elqQ = _elqQ || [];
68+
| _elqQ.push(["elqSetSiteId", "413370795"]);
69+
| _elqQ.push(["elqTrackPageView"]);
70+
| (function () {
71+
| function async_load() { var s = document.createElement("script"); s.type = "text/javascript"; s.async = true; s.src = "//img03.en25.com/i/elqCfg.min.js"; var x = document.getElementsByTagName("script")[0]; x.parentNode.insertBefore(s, x); }
72+
| if (window.addEventListener) window.addEventListener("DOMContentLoaded", async_load, false);
73+
| else if (window.attachEvent) window.attachEvent("onload", async_load);
74+
| })();
75+
| }
76+
| };
77+
| function setSearchUrlPrefix() {
78+
| if (typeof getURLPrefix === 'function') {
79+
| var getURLPrefixOri = getURLPrefix;
80+
| getURLPrefix = function(ui) {
81+
| var urlPrefix = getURLPrefixOri(ui);
82+
| return (urlPrefix && urlPrefix != "undefined/" ? urlPrefix: "");
83+
| };
84+
| } else {
85+
| window.setTimeout(setSearchUrlPrefix, 500 );
86+
| }
87+
| };
88+
| setLocationHash();
89+
| setGATrackingCode();
90+
| setSearchUrlPrefix();
91+
|
92+
| </script>'''.stripMargin()
7693
}
7794
}
7895
}

0 commit comments

Comments
 (0)