Backported jdk dark theme css vars to jdk7 html layout version

This commit is contained in:
Willem Cazander 2025-01-30 03:11:14 +01:00
parent 5ba12c3a3e
commit 5da1524f06
13 changed files with 429 additions and 94 deletions

View file

@ -71,5 +71,140 @@ public enum MaisDocContentCss {
// frame names maybe can be used to create frame-less html5 JS version // frame names maybe can be used to create frame-less html5 JS version
frameNavOverview, frameNavOverview,
frameNavDetail, frameNavDetail,
frameContent frameContent,
;
// // Below is the updated javadoc css classes, for now we keep the old sun gold.
// //
// // IDs;
// // - button#navbar-toggle-button
// // - #search-input
// // - #page-search-input
// // - #reset-button
// // - div#result-container
// // - span#page-search-link
// // - button#page-search-copy
// // - div#navbar-top
// // - div#navbar-sub-list
// //
// // CSS
// MEMBER_SIGNATURE,
// SUMMARY_TABLE,
// ABOUT_LANGUAGE,
// LEGAL_COPY,
// FLEX_BOX,
// FLEX_HEADER,
// FLEX_CONTENT,
// TOP_NAV,
// SUB_NAV_LIST_SMALL,
// SUB_NAV,
// SUB_NAV_LIST,
// NAV_LIST,
// NAV_LIST_SEARCH,
// NAV_BAR_CELL1_REV,
// SKIP_NAV,
// TITLE,
// SUB_TITLE,
// CONTENTS_LIST,
// CLASS_DECLARATION_PAGE,
// DETAILS,
// CLASS_USE_PAGE,
// MODULE_DECLARATION_PAGE,
// BLOCK_LIST,
// SUMMARY,
// INHERITED_LIST,
// NOTES,
// NAME_VALUE,
// CIRCLE,
// HORIZONTAL,
// INHERITANCE,
// DETAILS_LIST,
// MEMBER_LIST,
// SUMMARY_LIST,
// REF_LIST,
// TAG_LIST,
// TAG_LIST_LONG,
// PREVIEW_FEATURE_LIST,
// DETAILS_TABLE,
// CAPTION,
// TABLE_TABS,
// ACTIVE_TABLE_TAB,
// TABLE_TAB,
// TWO_COLUMN_SEARCH_RESULTS,
// CHECKBOXES,
// TWO_COLUMN_SUMMARY,
// THREE_COLUMN_SUMMARY,
// THREE_COLUMN_RELEASE_SUMMARY,
// FOUR_COLUMN_SUMMARY,
// COL_LAST,
// COL_FIRST,
// COL_SECOND,
// COL_CONSTRUCTOR_NAME,
// COL_SUMMARY_ITEM_NAME,
// TABLE_HEADER,
// EVEN_ROW_COLOR,
// ODD_ROW_COLOR,
// BLOCK,
// MODULE_SIGNATURE,
// PACKAGE_SIGNATURE,
// TYPE_SIGNATURE,
// TYPE_PARAMETER_LONG,
// PARAMETERS,
// EXCEPTIONS,
// TYPE_PARAMETERS,
// SOURCE_LINE_NO,
// DEPRECATED_LABEL,
// DESCRIPTION_FROM_TYPE_LABEL,
// IMPLEMENTATION_LABEL,
// MEMBER_NAME_LINK,
// MODULE_LABEL_IN_PACKAGE,
// MODULE_LABEL_IN_TYPE,
// PACKAGE_LABEL_IN_TYPE,
// PACKAGE_HIERARCHY_LABEL,
// TYPE_NAME_LABEL,
// TYPE_NAME_LINK,
// SEARCH_TAG_LINK,
// PREVIEW_LABEL,
// DEPRECATION_COMMENT,
// HELP_FOOTNOTE,
// PREVIEW_COMMENT,
// DEPRECATION_BLOCK,
// PREVIEW_BLOCK,
// INVALID_TAG,
// UI_STATE_ACTIVE,
// UI_AUTOCOMPLETE_CATEGORY,
// UI_AUTOCOMPLETE,
// UI_STATIC_LINK,
// RESULT_ITEM,
// RESULT_HIGHLIGHT,
// SEARCH_TAG_DESC_RESULT,
// SEARCH_TAG_HOLDER_RESULT,
// SEARCH_TAB_RESULT,
// PAGE_SEARCH_DETAILS,
// SEARCH_RESULT_LINK,
// PAGE_SEARCH_INFO,
// PAGE_SEARCH_HEADER,
// MODULE_GRAPH,
// SEALED_GRAPH,
// CLASS_DESCRIPTION,
// CLASS_USES,
// DETAIL,
// SERIALIZED_CLASS_DETAILS,
// VERTICAL_SEPARATOR,
// HELP_SECTION_LIST,
// HELP_SUBTOC,
// HELP_NOTE,
// ANCHOR_LINK,
// COPY,
// SNIPPET_COPY,
// SNIPPET_CONTAINER,
// BORDERLESS,
// PLAIN,
// STRIPED,
// NAV_BAR_TOGGLE_ICON,
// EXPANDED,
// SNIPPET,
// ITALIC,
// BOLD,
// HIGHLIGHTED,
} }

View file

@ -65,6 +65,7 @@ public class MaisDocContentWriter extends SAX3WriterHtml {
printHeadMeta("keywords", keyword); printHeadMeta("keywords", keyword);
} }
printHeadLinkCss(pathPrefix+"resources/stylesheet.css"); printHeadLinkCss(pathPrefix+"resources/stylesheet.css");
printScriptSrc(pathPrefix+"resources/api-theme.js");
printTagEnd(Tag.head); printTagEnd(Tag.head);
// ======= Write body // ======= Write body
@ -73,7 +74,9 @@ public class MaisDocContentWriter extends SAX3WriterHtml {
StringBuilder script = new StringBuilder(); StringBuilder script = new StringBuilder();
script.append("\n"); script.append("\n");
script.append("\tif (location.href.indexOf('is-external=true') == -1) {\n"); script.append("\tif (location.href.indexOf('is-external=true') == -1) {\n");
script.append("\t\tparent.document.title=\"");script.append(title);script.append("\";\n"); script.append("\t\ttry {\n");
script.append("\t\t\tparent.document.title=\"");script.append(title);script.append("\";\n");
script.append("\t\t} catch (e) {}\n");
script.append("\t}\n"); script.append("\t}\n");
printScriptInline(script.toString()); printScriptInline(script.toString());
printScriptNoDiv(); printScriptNoDiv();

View file

@ -553,6 +553,8 @@ public class MaisDocGenerator implements MaisDocContentPrinter {
private void writeStyleSheet() throws IOException { private void writeStyleSheet() throws IOException {
try { try {
copyResourceToFile("org/x4o/maisdoc/theme/base/api-theme.js",basePath,"resources","api-theme.js");
if (doc.getMetaStyleSheet()!=null) { if (doc.getMetaStyleSheet()!=null) {
copyStreamToFile(new FileInputStream(doc.getMetaStyleSheet()),basePath,"resources","stylesheet.css"); copyStreamToFile(new FileInputStream(doc.getMetaStyleSheet()),basePath,"resources","stylesheet.css");
return; return;
@ -562,6 +564,7 @@ public class MaisDocGenerator implements MaisDocContentPrinter {
thema = "jdk7"; thema = "jdk7";
} }
List<String> cssResources = new ArrayList<String>(10); List<String> cssResources = new ArrayList<String>(10);
cssResources.add("org/x4o/maisdoc/theme/base/api-theme.css");
cssResources.add("org/x4o/maisdoc/theme/base/api-html.css"); cssResources.add("org/x4o/maisdoc/theme/base/api-html.css");
cssResources.add("org/x4o/maisdoc/theme/base/api-layout.css"); cssResources.add("org/x4o/maisdoc/theme/base/api-layout.css");
cssResources.add("org/x4o/maisdoc/theme/base/api-inset.css"); cssResources.add("org/x4o/maisdoc/theme/base/api-inset.css");
@ -582,14 +585,6 @@ public class MaisDocGenerator implements MaisDocContentPrinter {
copyResourceToFile("org/x4o/maisdoc/theme/jdk7/titlebar.png",basePath,"resources","titlebar.png"); copyResourceToFile("org/x4o/maisdoc/theme/jdk7/titlebar.png",basePath,"resources","titlebar.png");
return; return;
} }
if ("jdk7-todo".equals(thema)) {
cssResources.add("org/x4o/maisdoc/theme/jdk7-todo/stylesheet.css");
writeStyleSheetResources(cssResources);
copyResourceToFile("org/x4o/maisdoc/theme/jdk7/background.png",basePath,"resources","background.png");
copyResourceToFile("org/x4o/maisdoc/theme/jdk7/tab.png",basePath,"resources","tab.png");
copyResourceToFile("org/x4o/maisdoc/theme/jdk7/titlebar_end.png",basePath,"resources","titlebar_end.png");
copyResourceToFile("org/x4o/maisdoc/theme/jdk7/titlebar.png",basePath,"resources","titlebar.png");
}
} catch (SecurityException e) { } catch (SecurityException e) {
throw new IOException(e.getMessage()); throw new IOException(e.getMessage());
} catch (InterruptedException e) { } catch (InterruptedException e) {
@ -620,6 +615,7 @@ public class MaisDocGenerator implements MaisDocContentPrinter {
writer.printHeadTitle(title); writer.printHeadTitle(title);
writer.printHeadMetaDate(); writer.printHeadMetaDate();
writer.printHeadLinkCss(resourcePrefix+"resources/stylesheet.css"); writer.printHeadLinkCss(resourcePrefix+"resources/stylesheet.css");
writer.printScriptSrc(resourcePrefix+"resources/api-theme.js");
writer.printTagEnd(Tag.head); writer.printTagEnd(Tag.head);
} }
@ -1027,6 +1023,45 @@ public class MaisDocGenerator implements MaisDocContentPrinter {
} }
writer.printTagEnd(Tag.ul); writer.printTagEnd(Tag.ul);
if (isTop) {
writer.printTagStart(Tag.ul,MaisDocContentCss.navList);
writer.printTagStart(Tag.li);
writer.printTagStart(Tag.div);
atts = new AttributesImpl();
atts.addAttribute("", "href", "", "", "#");
atts.addAttribute("", "id", "", "", "theme_switcher");
writer.printTagStart(Tag.a, atts);
writer.printCharacters("");
writer.printTagEnd(Tag.a);
writer.printTagEnd(Tag.div);
writer.printTagEnd(Tag.li);
writer.printTagEnd(Tag.ul);
StringBuilder buf = new StringBuilder();
buf.append("\n");
buf.append("const switchTheme = document.getElementById('theme_switcher');\n");
buf.append("switchTheme.addEventListener('click', (e)=> {\n");
buf.append("\te.preventDefault();\n");
buf.append("\tif (\"dark\"==readCookie(\"theme\")) {\n");
buf.append("\t\tcreateCookie(\"theme\", \"light\", 365);\n");
buf.append("\t} else {\n");
buf.append("\t\tcreateCookie(\"theme\", \"dark\", 365);\n");
buf.append("\t}\n");
if (pathPrefix.isEmpty()) {
buf.append("\ttop.location.href = 'index.html';\n");
} else {
buf.append("\ttop.location.href = '"+pathPrefix+"index.html';\n");
}
buf.append("});\n");
buf.append("if (\"dark\"==readCookie(\"theme\")) {\n");
buf.append("switchTheme.innerHTML = '⍝ Light';\n");
buf.append("} else {\n");
buf.append("switchTheme.innerHTML = '⍝ Dark';\n");
buf.append("}\n");
writer.printScriptInline(buf.toString());
}
writer.docNavBarAbout(doc.getDocAbout()); writer.docNavBarAbout(doc.getDocAbout());
writer.printTagEnd(Tag.div); // end barCssDiv writer.printTagEnd(Tag.div); // end barCssDiv

View file

@ -21,126 +21,126 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
body { body {
background-color:#ffffff; background-color: var(--body-background-color);
color:#353833; color: var(--body-text-color);
} }
a:link, a:visited { a:link, a:visited {
color:#4c6b87; color: var(--link-color);
} }
a:hover, a:focus { a:hover, a:focus {
color:#bb7a2a; color: var(--link-color-active);
} }
a:active { a:active {
color:#4c6b87; color: var(--link-color);
} }
a[name] { a[name] {
color:#353833; color:var(--block-text-color);
} }
a[name]:hover { a[name]:hover {
color:#353833; color:var(--block-text-color);
} }
.bar a, .bar a:link, .bar a:visited, .bar a:active { .bar a, .bar a:link, .bar a:visited, .bar a:active {
color:#FFFFFF; color: var(--navbar-text-color);
} }
.bar a:hover, .bar a:focus { .bar a:hover, .bar a:focus {
color:#bb7a2a; color:var(--selected-background-color);
} }
.tab { .tab {
background-color:#0066FF; background-color:var(--navbar-background-color);
color:#ffffff; color: var(--navbar-text-color);
} }
.bar { .bar, .topNav, .bottomNav {
color:#FFFFFF; color: var(--navbar-text-color);
} background-color: var(--navbar-background-color);
.topNav {
color:#FFFFFF;
}
.bottomNav {
color:#FFFFFF;
} }
.subNav { .subNav {
background-color:#dee3e9; background-color:var(--subnav-background-color);
border-bottom:1px solid #9eadc0; border-bottom:1px solid var(--border-color);
} }
.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { .topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
color:#FFFFFF; color: var(--navbar-text-color);
} }
.topNav a:hover, .bottomNav a:hover { .topNav a:hover, .bottomNav a:hover {
color:#bb7a2a; color:var(--selected-background-color);
} }
.navBarCell1Rev { .navBarCell1Rev {
color:#FFFFFF; color: var(--navbar-text-color);
border:1px solid #c9aa44; background-color: var(--selected-background-color);
border:1px solid var(--selected-background-color);
} }
.title { .title {
color:#2c4557; color:var(--title-color);
} }
div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
background-color:#dee3e9; background-color:var(--detail-background-color);
border-top:1px solid #9eadc0; border-top:1px solid var(--border-color);
border-bottom:1px solid #9eadc0; border-bottom:1px solid var(--border-color);
} }
ul.blockList ul.blockList ul.blockList li.blockList h3 { ul.blockList ul.blockList ul.blockList li.blockList h3 {
background-color:#dee3e9; background-color:var(--detail-background-color);
border-top:1px solid #9eadc0; border-top:1px solid var(--border-color);
border-bottom:1px solid #9eadc0; border-bottom:1px solid var(--border-color);
} }
.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { .contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
color:#4E4E4E; color:var(--block-text-color);
} }
ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
border:1px solid #9eadc0; border:1px solid var(--border-color);
background-color:#f9f9f9; background-color:var(--section-background-color);
} }
ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
background-color:#ffffff; background-color:var(--detail-background-color);
border:1px solid #9eadc0; border:1px solid var(--border-color);
border-top:none; border-top:none;
} }
ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
border:none; border:none;
border-bottom:1px solid #9eadc0; border-bottom:1px solid var(--border-color);
} }
ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
border-bottom:none; border-bottom:none;
} }
.contentContainer table, .classUseContainer table, .constantValuesContainer table { .contentContainer table, .classUseContainer table, .constantValuesContainer table {
border-bottom:1px solid #9eadc0; border-bottom:1px solid var(--border-color);
} }
.contentContainer .description table, .contentContainer .details table { .contentContainer .description table, .contentContainer .details table {
border-bottom:none; border-bottom:none;
} }
.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption { .overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption {
color:#FFFFFF; color:var(--body-background-color);
}
.overviewSummary caption span,.packageSummary caption span,.contentContainer ul.blockList li.blockList caption span,.summary caption span,.classUseContainer caption span,.constantValuesContainer caption span {
background-color: var(--selected-background-color);
} }
caption a:link, caption a:hover, caption a:active, caption a:visited { caption a:link, caption a:hover, caption a:active, caption a:visited {
color:#FFFFFF; color:var(--body-background-color);
background-color: var(--selected-background-color);
} }
.tableSubHeadingColor { .tableSubHeadingColor {
background-color: #EEEEFF; background-color: var(--detail-background-color);
} }
.altColor { .altColor {
background-color:#eeeeef; background-color:var(--odd-row-color);
} }
.rowColor { .rowColor {
background-color:#ffffff; background-color:var(--even-row-color);
} }
th.colFirst, th.colLast, th.colOne, .constantValuesContainer th { th.colFirst, th.colLast, th.colOne, .constantValuesContainer th {
background:#dee3e9; background:var(--subnav-background-color);
border-top:1px solid #9eadc0; border-top:1px solid var(--border-color);
border-bottom:1px solid #9eadc0; border-bottom:1px solid var(--border-color);
} }
td.colFirst, th.colFirst { td.colFirst, th.colFirst {
border-left:1px solid #9eadc0; border-left:1px solid var(--border-color);
} }
td.colLast, th.colLast { td.colLast, th.colLast {
border-right:1px solid #9eadc0; border-right:1px solid var(--border-color);
} }
td.colOne, th.colOne { td.colOne, th.colOne {
border-right:1px solid #9eadc0; border-right:1px solid var(--border-color);
border-left:1px solid #9eadc0; border-left:1px solid var(--border-color);
} }
.sourceLineNo { .sourceLineNo {
color:green; color: var(--snippet-highlight-color);
} }

View file

@ -21,8 +21,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
body { body {
font-family:Arial, Helvetica, sans-serif; font-family: var(--body-font-family);
font-size:76%; font-size: var(--body-font-size);
} }
pre { pre {
font-size:1.3em; font-size:1.3em;

View file

@ -47,6 +47,9 @@ body {
padding:0px; padding:0px;
padding-top:10px; padding-top:10px;
} }
.subNav {
padding-top: 2px;
}
.subNav div { .subNav div {
padding:0px 0px 5px 6px; padding:0px 0px 5px 6px;
} }
@ -168,17 +171,19 @@ table tr td dl, table tr td dl dt, table tr td dl dd {
margin:0px; margin:0px;
} }
.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span { .overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
padding-top:8px; padding-top:6px;
padding-bottom:2px;
padding-left:8px; padding-left:8px;
padding-right:8px;
} }
ul.blockList ul.blockList li.blockList table { ul.blockList ul.blockList li.blockList table {
margin:0px 0px 12px 0px; margin:0px 0px 12px 0px;
} }
.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td { .overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td {
padding:3px 3px 3px 7px; padding:4px 4px 4px 7px;
} }
th.colFirst, th.colLast, th.colOne, .constantValuesContainer th { th.colFirst, th.colLast, th.colOne, .constantValuesContainer th {
padding:3px 3px 3px 7px; padding:4px 4px 4px 7px;
} }
table.overviewSummary { table.overviewSummary {
padding:0px; padding:0px;

View file

@ -112,7 +112,6 @@ ul.inheritance li {
height:18px; height:18px;
} }
.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd { .overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
width:10px;
position:relative; position:relative;
float:left; float:left;
} }
@ -144,8 +143,3 @@ h1.hidden {
.block { .block {
display:block; display:block;
} }

View file

@ -0,0 +1,75 @@
/*
* Copyright (c) 2004-2014, Willem Cazander
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
:root {
/* body, block and code fonts */
--body-font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
--block-font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times,
serif;
--code-font-family: 'DejaVu Sans Mono', monospace;
/* Base font sizes for body and code elements */
--body-font-size: 14px;
--code-font-size: 14px;
/* Text colors for body and block elements */
--body-text-color: #353833;
--block-text-color: #474747;
/* Background colors for various structural elements */
--body-background-color: #ffffff;
--section-background-color: #f8f8f8;
--detail-background-color: #ffffff;
/* Colors for navigation bar and table captions */
--navbar-background-color: #4D7A97;
--navbar-text-color: #ffffff;
/* Background color for subnavigation and various headers */
--subnav-background-color: #dee3e9;
/* Background and text colors for selected tabs and navigation items */
--selected-background-color: #f8981d;
--selected-text-color: #253441;
--selected-link-color: #1f389c;
/* Background colors for generated tables */
--even-row-color: #ffffff;
--odd-row-color: #eeeeef;
/* Text color for page title */
--title-color: #2c4557;
/* Text colors for links */
--link-color: #4A6782;
--link-color-active: #bb7a2a;
/* Snippet colors */
--snippet-background-color: #ebecee;
--snippet-text-color: var(--block-text-color);
--snippet-highlight-color: #f7c590;
/* Border colors for structural elements and user defined tables */
--border-color: #ededed;
--table-border-color: #000000;
/* Search input colors */
--search-input-background-color: #ffffff;
--search-input-text-color: #000000;
--search-input-placeholder-color: #909090;
/* Highlight color for active search tag target */
--search-tag-highlight-color: #ffff00;
/* Adjustments for icon and active background colors of copy-to-clipboard buttons */
--copy-icon-brightness: 100%;
--copy-button-background-color-active: rgba(168, 168, 176, 0.3);
/* Colors for invalid tag notifications */
--invalid-tag-background-color: #ffe6e6;
--invalid-tag-text-color: #000000;
}

View file

@ -0,0 +1,25 @@
function createCookie(name, value, days) {
expires = "";
if (days) {
let date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toGMTString();
}
document.cookie = name + "=" + value + expires + ";SameSite=strict; path=/";
}
function readCookie(name) {
let nameEQ = name + "=";
let ca = document.cookie.split(';');
for (let i = 0; i < ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
document.addEventListener('DOMContentLoaded', () => {
document.documentElement.setAttribute('data-theme', readCookie("theme"));
})

View file

@ -42,6 +42,11 @@ body {
padding-top: 0px; padding-top: 0px;
padding-bottom: 0px; padding-bottom: 0px;
} }
.bar {
padding-top: 2px;
padding-bottom: 2px;
color:#000;
}
.subNav { .subNav {
background-color: #FFF; background-color: #FFF;
@ -93,6 +98,9 @@ li {
.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span { .overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
background-color: #EEEEFF; background-color: #EEEEFF;
padding-top: 4px;
padding-bottom: 4px;
color:#000;
} }
.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd { .overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {

View file

@ -20,24 +20,70 @@
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
.tab {
:root {
--body-font-family: Arial, Helvetica, sans-serif;
--body-font-size: 76%;
--link-color: #4c6b87;
--border-color: #9eadc0;
--block-text-color: #4E4E4E;
--detail-background-color: #dee3e9;
--section-background-color: #f9f9f9;
--selected-background-color: #bb7a2a;
--snippet-highlight-color: green;
}
html:not([data-theme="dark"]) {
.tab {
background-image:url(titlebar.png); background-image:url(titlebar.png);
background-position:left top; background-position:left top;
background-repeat:no-repeat; background-repeat:no-repeat;
} }
.bar,.topNav,.bottomNav { .bar,.topNav,.bottomNav {
background-image:url(background.png); background-image:url(background.png);
background-repeat:repeat-x; background-repeat:repeat-x;
} }
.navBarCell1Rev { .navBarCell1Rev {
background-image:url(tab.png); background-image:url(tab.png);
} }
.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span { .overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
background-image:url(titlebar.png); background-image:url(titlebar.png);
} }
.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd { .overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
background-image:url(titlebar_end.png); background-image:url(titlebar_end.png);
background-repeat:no-repeat; background-repeat:no-repeat;
background-position:top right; background-position:top right;
}
} }
html[data-theme="dark"] {
--body-text-color: #e0e0e3;
--block-text-color: #e6e7ef;
--body-background-color: #404040;
--section-background-color: #484848;
--detail-background-color: #404040;
--navbar-background-color: #505076;
--navbar-text-color: #ffffff;
--subnav-background-color: #303030;
--selected-background-color: #f8981d;
--selected-text-color: #253441;
--selected-link-color: #1f389c;
--even-row-color: #484848;
--odd-row-color: #383838;
--title-color: #ffffff;
--link-color: #a0c0f8;
--link-color-active: #ffb863;
--snippet-background-color: #383838;
--snippet-text-color: var(--block-text-color);
--snippet-highlight-color: #f7c590;
--border-color: #383838;
--table-border-color: #000000;
--search-input-background-color: #000000;
--search-input-text-color: #ffffff;
--search-input-placeholder-color: #909090;
--search-tag-highlight-color: #ffff00;
--copy-icon-brightness: 250%;
--copy-button-background-color-active: rgba(168, 168, 176, 0.3);
--invalid-tag-background-color: #ffe6e6;
--invalid-tag-text-color: #000000;
}

View file

@ -101,6 +101,15 @@ public class SAX3WriterHtml extends SAX3WriterEnum<SAX3WriterHtml.Tag,SAX3Writer
printTagStartEnd(Tag.link, atts); printTagStartEnd(Tag.link, atts);
} }
public void printScriptSrc(String jsUrl) throws IOException {
AttributesImpl atts = new AttributesImpl();
atts.addAttribute("", "type", "", "", "text/javascript");
atts.addAttribute("", "src", "", "", jsUrl);
printTagStart(Tag.script, atts);
printCharacters(" "); // NOTE: space needed to keep browsers happy
printTagEnd(Tag.script);
}
public void printScriptInline(String script) throws IOException { public void printScriptInline(String script) throws IOException {
AttributesImpl atts = new AttributesImpl(); AttributesImpl atts = new AttributesImpl();
atts.addAttribute("", "type", "", "", "text/javascript"); atts.addAttribute("", "type", "", "", "text/javascript");

View file

@ -69,11 +69,11 @@ public abstract class AbstractContentWriterLexical extends AbstractContentWriter
charactersRaw(SAX3XMLConstants.XML_DOCTYPE_TAG_OPEN); charactersRaw(SAX3XMLConstants.XML_DOCTYPE_TAG_OPEN);
charactersRaw(" "); charactersRaw(" ");
charactersRaw(name); charactersRaw(name);
if (publicId != null) { if (publicId != null && !publicId.isEmpty()) {
charactersRaw(" "); charactersRaw(" ");
charactersRaw(publicId); charactersRaw(publicId);
} }
if (systemId != null) { if (systemId != null && !systemId.isEmpty()) {
charactersRaw(" \""); charactersRaw(" \"");
charactersRaw(systemId); charactersRaw(systemId);
charactersRaw("\""); charactersRaw("\"");