< prev index next >
src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java
Print this page
rev 185 : 8024756: method grouping tabs are not selectable
Reviewed-by: jjg
rev 186 : 8151921: Improved page resolution
Summary: Include indenting changes to HtmlWriter.java from 8011650
Reviewed-by: jjg, ksrini
@@ -286,13 +286,17 @@
protected HtmlTree getWinTitleScript(){
HtmlTree script = new HtmlTree(HtmlTag.SCRIPT);
if(winTitle != null && winTitle.length() > 0) {
script.addAttr(HtmlAttr.TYPE, "text/javascript");
String scriptCode = "<!--" + DocletConstants.NL +
+ " try {" + DocletConstants.NL +
" if (location.href.indexOf('is-external=true') == -1) {" + DocletConstants.NL +
" parent.document.title=\"" + escapeJavaScriptChars(winTitle) + "\";" + DocletConstants.NL +
" }" + DocletConstants.NL +
+ " }" + DocletConstants.NL +
+ " catch(err) {" + DocletConstants.NL +
+ " }" + DocletConstants.NL +
"//-->" + DocletConstants.NL;
RawHtml scriptContent = new RawHtml(scriptCode);
script.addContent(scriptContent);
}
return script;
@@ -348,18 +352,20 @@
/**
* Returns a content tree for the SCRIPT tag for the main page(index.html).
*
* @return a content for the SCRIPT tag
*/
- protected Content getFramesetJavaScript(){
+ protected Content getFramesetJavaScript() {
HtmlTree script = new HtmlTree(HtmlTag.SCRIPT);
script.addAttr(HtmlAttr.TYPE, "text/javascript");
- String scriptCode = DocletConstants.NL + " targetPage = \"\" + window.location.search;" + DocletConstants.NL +
- " if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL +
- " targetPage = targetPage.substring(1);" + DocletConstants.NL +
- " if (targetPage.indexOf(\":\") != -1 || (targetPage != \"\" && !validURL(targetPage)))" + DocletConstants.NL +
- " targetPage = \"undefined\";" + DocletConstants.NL +
+ String scriptCode = DocletConstants.NL +
+ " tmpTargetPage = \"\" + window.location.search;" + DocletConstants.NL +
+ " if (tmpTargetPage != \"\" && tmpTargetPage != \"undefined\")" + DocletConstants.NL +
+ " tmpTargetPage = tmpTargetPage.substring(1);" + DocletConstants.NL +
+ " if (tmpTargetPage.indexOf(\":\") != -1 || (tmpTargetPage != \"\" && !validURL(tmpTargetPage)))" + DocletConstants.NL +
+ " tmpTargetPage = \"undefined\";" + DocletConstants.NL +
+ " targetPage = tmpTargetPage;" + DocletConstants.NL +
" function validURL(url) {" + DocletConstants.NL +
" var pos = url.indexOf(\".html\");" + DocletConstants.NL +
" if (pos == -1 || pos != url.length - 5)" + DocletConstants.NL +
" return false;" + DocletConstants.NL +
" var allowNumber = false;" + DocletConstants.NL +
< prev index next >