From 02902019cbaf7a03f89b97e2ad80a29079aaf00a Mon Sep 17 00:00:00 2001 From: SteveSamJacob19 Date: Mon, 17 Jun 2024 13:37:57 +0530 Subject: [PATCH 1/8] Adding frameless javadoc --- scripts/build/javadoc_clone.sh | 2 +- scripts/build/javadoc_modify.sh | 32 +- .../content/_assets/js/javadoc-redirect.js | 30 +- .../_assets/js/javadoc-search-frameless.js | 366 ++++++++++++ ...-extended-stylesheet-frameless-api_spi.css | 287 +++++++++ .../javadoc-extended-stylesheet-frameless.css | 564 ++++++++++-------- .../src/css/javadoc-extended-stylesheet.css | 350 +++++++++++ .../content/antora_ui/src/js/06-javadocs.js | 31 +- .../openliberty/website/SecurityFilter.java | 2 +- 9 files changed, 1383 insertions(+), 281 deletions(-) create mode 100644 src/main/content/_assets/js/javadoc-search-frameless.js create mode 100644 src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless-api_spi.css create mode 100644 src/main/content/antora_ui/src/css/javadoc-extended-stylesheet.css diff --git a/scripts/build/javadoc_clone.sh b/scripts/build/javadoc_clone.sh index bed8505055..ec0d5fcda1 100755 --- a/scripts/build/javadoc_clone.sh +++ b/scripts/build/javadoc_clone.sh @@ -2,7 +2,7 @@ # Determine which branch of docs-javadoc repo to clone timer_start=$(date +%s) -BRANCH_NAME="prod" +BRANCH_NAME="ssj_test" # Development environments with draft content if [[ "$STAGING_SITE" == "true" || "$JAVADOC_STAGING_SITE" == "true" ]]; then echo "Cloning the staging branch of javadoc" diff --git a/scripts/build/javadoc_modify.sh b/scripts/build/javadoc_modify.sh index 611036ff00..76c7abb27c 100755 --- a/scripts/build/javadoc_modify.sh +++ b/scripts/build/javadoc_modify.sh @@ -23,11 +23,28 @@ modifyStylesheetFrameless () { mv newstylesheet.css "$1" } +modifyStylesheetFramelessSPIAPI () { + # Append extra javadoc styling located in the css direcctory to the stylesheet.css located in the javadoc api/spi subdirectories + cat src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless-api_spi.css >> "$1" + + # insert extra import to the beginning of the file + sed '1 i\ + @import url("https://fonts.googleapis.com/css?family=Asap:300,400,500"); + ' "$1" > newstylesheet.css + + mv newstylesheet.css "$1" +} + modifySearch () { # add url support to search cp src/main/content/_assets/js/javadoc-search.js "$1" } +modifyFramelessSearch () { + # add url support to frameless javadoc search + cp src/main/content/_assets/js/javadoc-search-frameless.js "$1" +} + modifyRedirect () { a=$1 cp src/main/content/_assets/js/javadoc-redirect.js "${a/script.js/redirect.js}" @@ -38,14 +55,19 @@ modifyRedirect () { export -f modifyStylesheet export -f modifyStylesheetFrameless +export -f modifyStylesheetFramelessSPIAPI export -f modifySearch +export -f modifyFramelessSearch export -f modifyRedirect -find target/jekyll-webapp/docs -path "*microprofile*/stylesheet.css" -exec bash -c 'modifyStylesheet {}' \; -find target/jekyll-webapp/docs -path "*liberty-*/stylesheet.css" -exec bash -c 'modifyStylesheet {}' \; -find target/jekyll-webapp/docs -path "*io.openliberty*/stylesheet.css" -exec bash -c 'modifyStylesheetFrameless {}' \; -find target/jekyll-webapp/docs -path "*com.ibm.websphere.appserver*/stylesheet.css" -exec bash -c 'modifyStylesheetFrameless {}' \; -find target/jekyll-webapp/docs -name search.js -exec bash -c 'modifySearch {}' \; +# find target/jekyll-webapp/docs -path "*liberty-javaee7*/stylesheet.css" -exec bash -c 'modifyStylesheet {}' \; +find target/jekyll-webapp/docs -path "*liberty-*/stylesheet.css" -exec bash -c 'modifyStylesheetFrameless {}' \; +find target/jekyll-webapp/docs -path "*microprofile*/stylesheet.css" -exec bash -c 'modifyStylesheetFrameless {}' \; +find target/jekyll-webapp/docs -path "*io.openliberty*/stylesheet.css" -exec bash -c 'modifyStylesheetFramelessSPIAPI {}' \; +find target/jekyll-webapp/docs -path "*com.ibm.websphere.appserver*/stylesheet.css" -exec bash -c 'modifyStylesheetFramelessSPIAPI {}' \; +# find target/jekyll-webapp/docs -not -path "*microprofile-6.0*" -name search.js -exec bash -c 'modifySearch {}' \; +find target/jekyll-webapp/docs -path "*microprofile*" -name search.js -exec bash -c 'modifyFramelessSearch {}' \; +find target/jekyll-webapp/docs -path "*liberty-*" -name search.js -exec bash -c 'modifyFramelessSearch {}' \; find target/jekyll-webapp/docs -name script.js -exec bash -c 'modifyRedirect {}' \; timer_end=$(date +%s) diff --git a/src/main/content/_assets/js/javadoc-redirect.js b/src/main/content/_assets/js/javadoc-redirect.js index 6d970cf055..b50757933c 100644 --- a/src/main/content/_assets/js/javadoc-redirect.js +++ b/src/main/content/_assets/js/javadoc-redirect.js @@ -38,13 +38,27 @@ function javadocRedirect(api,version,jd) { } var pack = jd.substring(0, jd.lastIndexOf('/')); var port = window.top.location.port !== '' ? ':' + window.top.location.port : ''; - window.top.location.href = - 'https://' + - window.top.location.hostname + - port + - '/docs/latest/reference/javadoc/'+ api + - version + - (pack ? '-javadoc.html?package='+pack+'/package-frame.html&class=': '-javadoc.html?class=') + - jd; + var mainFrame = $('#javadoc_container'); + var isFrameless = mainFrame.contents().find('iframe').length === 0; + if(isFrameless){ + window.top.location.href = + 'https://' + + window.top.location.hostname + + port + + '/docs/latest/reference/javadoc/'+ api + + version + + (pack ? '-javadoc.html?package='+pack+'/package-summary.html&class=': '-javadoc.html?class=') + + jd; + } + else{ + window.top.location.href = + 'https://' + + window.top.location.hostname + + port + + '/docs/latest/reference/javadoc/'+ api + + version + + (pack ? '-javadoc.html?package='+pack+'/package-frame.html&class=': '-javadoc.html?class=') + + jd; + } } diff --git a/src/main/content/_assets/js/javadoc-search-frameless.js b/src/main/content/_assets/js/javadoc-search-frameless.js new file mode 100644 index 0000000000..327e0369e9 --- /dev/null +++ b/src/main/content/_assets/js/javadoc-search-frameless.js @@ -0,0 +1,366 @@ +/* + * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +var noResult = {l: 'No results found'}; +var loading = {l: 'Loading search index...'}; +var catModules = 'Modules'; +var catPackages = 'Packages'; +var catTypes = 'Classes and Interfaces'; +var catMembers = 'Members'; +var catSearchTags = 'SearchTags'; +var highlight = '$&'; +var searchPattern = ''; +var fallbackPattern = ''; +var RANKING_THRESHOLD = 2; +var NO_MATCH = 0xffff; +var MIN_RESULTS = 3; +var MAX_RESULTS = 500; +var UNNAMED = ''; +function escapeHtml(str) { + return str.replace(//g, '>'); +} +function getHighlightedText(item, matcher, fallbackMatcher) { + var escapedItem = escapeHtml(item); + var highlighted = escapedItem.replace(matcher, highlight); + if (highlighted === escapedItem) { + highlighted = escapedItem.replace(fallbackMatcher, highlight) + } + return highlighted; +} +function getURLPrefix(ui) { + var urlPrefix=''; + var slash = '/'; + if (ui.item.category === catModules) { + return ui.item.l + slash; + } else if (ui.item.category === catPackages && ui.item.m) { + return ui.item.m + slash; + } else if (ui.item.category === catTypes || ui.item.category === catMembers) { + if (ui.item.m) { + urlPrefix = ui.item.m + slash; + } else { + $.each(packageSearchIndex, function(index, item) { + if (item.m && ui.item.p === item.l) { + urlPrefix = item.m + slash; + } + }); + } + } + return urlPrefix; +} +function createSearchPattern(term) { + var pattern = ''; + var isWordToken = false; + term.replace(/,\s*/g, ', ').trim().split(/\s+/).forEach(function(w, index) { + if (index > 0) { + // whitespace between identifiers is significant + pattern += (isWordToken && /^\w/.test(w)) ? '\\s+' : '\\s*'; + } + var tokens = w.split(/(?=[A-Z,.()<>[\/])/); + for (var i = 0; i < tokens.length; i++) { + var s = tokens[i]; + if (s === '') { + continue; + } + pattern += $.ui.autocomplete.escapeRegex(s); + isWordToken = /\w$/.test(s); + if (isWordToken) { + pattern += '([a-z0-9_$<>\\[\\]]*?)'; + } + } + }); + return pattern; +} +function createMatcher(pattern, flags) { + var isCamelCase = /[A-Z]/.test(pattern); + return new RegExp(pattern, flags + (isCamelCase ? '' : 'i')); +} +var watermark = 'Search'; +$(function() { + var search = $('#search-input'); + var reset = $('#reset-button'); + search.val(''); + search.prop('disabled', false); + reset.prop('disabled', false); + search.val(watermark).addClass('watermark'); + search.blur(function() { + if ($(this).val().length === 0) { + $(this).val(watermark).addClass('watermark'); + } + }); + search.on('click keydown paste', function() { + if ($(this).val() === watermark) { + $(this).val('').removeClass('watermark'); + } + }); + reset.click(function() { + search.val('').focus(); + }); + search.focus()[0].setSelectionRange(0, 0); +}); +$.widget('custom.catcomplete', $.ui.autocomplete, { + _create: function() { + this._super(); + this.widget().menu('option', 'items', '> :not(.ui-autocomplete-category)'); + }, + _renderMenu: function(ul, items) { + var rMenu = this; + var currentCategory = ''; + rMenu.menu.bindings = $(); + $.each(items, function(index, item) { + var li; + if (item.category && item.category !== currentCategory) { + ul.append('
  • ' + item.category + '
  • '); + currentCategory = item.category; + } + li = rMenu._renderItemData(ul, item); + if (item.category) { + li.attr('aria-label', item.category + ' : ' + item.l); + li.attr('class', 'resultItem'); + } else { + li.attr('aria-label', item.l); + li.attr('class', 'resultItem'); + } + }); + }, + _renderItem: function(ul, item) { + var label = ''; + var matcher = createMatcher(escapeHtml(searchPattern), 'g'); + var fallbackMatcher = new RegExp(fallbackPattern, 'gi') + if (item.category === catModules) { + label = getHighlightedText(item.l, matcher, fallbackMatcher); + } else if (item.category === catPackages) { + label = getHighlightedText(item.l, matcher, fallbackMatcher); + } else if (item.category === catTypes) { + label = (item.p && item.p !== UNNAMED) + ? getHighlightedText(item.p + '.' + item.l, matcher, fallbackMatcher) + : getHighlightedText(item.l, matcher, fallbackMatcher); + } else if (item.category === catMembers) { + label = (item.p && item.p !== UNNAMED) + ? getHighlightedText(item.p + '.' + item.c + '.' + item.l, matcher, fallbackMatcher) + : getHighlightedText(item.c + '.' + item.l, matcher, fallbackMatcher); + } else if (item.category === catSearchTags) { + label = getHighlightedText(item.l, matcher, fallbackMatcher); + } else { + label = item.l; + } + var li = $('
  • ').appendTo(ul); + var div = $('
    ').appendTo(li); + if (item.category === catSearchTags && item.h) { + if (item.d) { + div.html(label + ' (' + item.h + ')
    ' + + item.d + '
    '); + } else { + div.html(label + ' (' + item.h + ')'); + } + } else { + if (item.m) { + div.html(item.m + '/' + label); + } else { + div.html(label); + } + } + return li; + } +}); +function rankMatch(match, category) { + if (!match) { + return NO_MATCH; + } + var index = match.index; + var input = match.input; + var leftBoundaryMatch = 2; + var periferalMatch = 0; + // make sure match is anchored on a left word boundary + if (index === 0 || /\W/.test(input[index - 1]) || '_' === input[index]) { + leftBoundaryMatch = 0; + } else if ('_' === input[index - 1] || (input[index] === input[index].toUpperCase() && !/^[A-Z0-9_$]+$/.test(input))) { + leftBoundaryMatch = 1; + } + var matchEnd = index + match[0].length; + var leftParen = input.indexOf('('); + var endOfName = leftParen > -1 ? leftParen : input.length; + // exclude peripheral matches + if (category !== catModules && category !== catSearchTags) { + var delim = category === catPackages ? '/' : '.'; + if (leftParen > -1 && leftParen < index) { + periferalMatch += 2; + } else if (input.lastIndexOf(delim, endOfName) >= matchEnd) { + periferalMatch += 2; + } + } + var delta = match[0].length === endOfName ? 0 : 1; // rank full match higher than partial match + for (var i = 1; i < match.length; i++) { + // lower ranking if parts of the name are missing + if (match[i]) + delta += match[i].length; + } + if (category === catTypes) { + // lower ranking if a type name contains unmatched camel-case parts + if (/[A-Z]/.test(input.substring(matchEnd))) + delta += 5; + if (/[A-Z]/.test(input.substring(0, index))) + delta += 5; + } + return leftBoundaryMatch + periferalMatch + (delta / 200); + +} +function doSearch(request, response) { + var result = []; + searchPattern = createSearchPattern(request.term); + fallbackPattern = createSearchPattern(request.term.toLowerCase()); + if (searchPattern === '') { + return this.close(); + } + var camelCaseMatcher = createMatcher(searchPattern, ''); + var fallbackMatcher = new RegExp(fallbackPattern, 'i'); + + function searchIndexWithMatcher(indexArray, matcher, category, nameFunc) { + if (indexArray) { + var newResults = []; + $.each(indexArray, function (i, item) { + item.category = category; + var ranking = rankMatch(matcher.exec(nameFunc(item)), category); + if (ranking < RANKING_THRESHOLD) { + newResults.push({ranking: ranking, item: item}); + } + return newResults.length <= MAX_RESULTS; + }); + return newResults.sort(function(e1, e2) { + return e1.ranking - e2.ranking; + }).map(function(e) { + return e.item; + }); + } + return []; + } + function searchIndex(indexArray, category, nameFunc) { + var primaryResults = searchIndexWithMatcher(indexArray, camelCaseMatcher, category, nameFunc); + result = result.concat(primaryResults); + if (primaryResults.length <= MIN_RESULTS && !camelCaseMatcher.ignoreCase) { + var secondaryResults = searchIndexWithMatcher(indexArray, fallbackMatcher, category, nameFunc); + result = result.concat(secondaryResults.filter(function (item) { + return primaryResults.indexOf(item) === -1; + })); + } + } + + searchIndex(moduleSearchIndex, catModules, function(item) { return item.l; }); + searchIndex(packageSearchIndex, catPackages, function(item) { + return (item.m && request.term.indexOf('/') > -1) + ? (item.m + '/' + item.l) : item.l; + }); + searchIndex(typeSearchIndex, catTypes, function(item) { + return request.term.indexOf('.') > -1 ? item.p + '.' + item.l : item.l; + }); + searchIndex(memberSearchIndex, catMembers, function(item) { + return request.term.indexOf('.') > -1 + ? item.p + '.' + item.c + '.' + item.l : item.l; + }); + searchIndex(tagSearchIndex, catSearchTags, function(item) { return item.l; }); + + if (!indexFilesLoaded()) { + updateSearchResults = function() { + doSearch(request, response); + } + result.unshift(loading); + } else { + updateSearchResults = function() {}; + } + response(result); +} +$(function() { + $('#search-input').catcomplete({ + minLength: 1, + delay: 300, + source: doSearch, + response: function(event, ui) { + if (!ui.content.length) { + ui.content.push(noResult); + } else { + $('#search-input').empty(); + } + }, + autoFocus: true, + focus: function(event, ui) { + return false; + }, + position: { + collision: 'flip' + }, + select: function(event, ui) { + if (ui.item.category) { + var url = getURLPrefix(ui); + if (ui.item.category === catModules) { + console.log("inside ===catModules"); + url += 'module-summary.html'; + console.log("url is "+url); + } else if (ui.item.category === catPackages) { + console.log("inside ===catPackages"); + if (ui.item.u) { + url = ui.item.u; + console.log("url is "+url); + } else { + url += ui.item.l.replace(/\./g, '/') + '/package-summary.html'; + console.log("url else is "+url); + } + } else if (ui.item.category === catTypes) { + console.log("inside ===catTypes"); + if (ui.item.u) { + url = ui.item.u; + } else if (ui.item.p === UNNAMED) { + url += ui.item.l + '.html'; + } else { + url += ui.item.p.replace(/\./g, '/') + '/' + ui.item.l + '.html'; + } + } else if (ui.item.category === catMembers) { + console.log("inside ===catMembers"); + if (ui.item.p === UNNAMED) { + url += ui.item.c + '.html' + '#'; + } else { + url += ui.item.p.replace(/\./g, '/') + '/' + ui.item.c + '.html' + '#'; + } + if (ui.item.u) { + url += ui.item.u; + } else { + url += ui.item.l; + } + console.log("url is "+url); + } else if (ui.item.category === catSearchTags) { + console.log("inside ===catSearchTags"); + url += ui.item.u; + } + if (top !== window) { + console.log("top is "+top+" and window is "+window); + console.log("pathtoroot is "+ pathtoroot +" and url is "+url); + // parent.classFrame.location = pathtoroot + url; + window.location.href = pathtoroot + url + } else { + window.location.href = pathtoroot + url; + } + // $('#search-input').focus(); + } + } + }); +}); diff --git a/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless-api_spi.css b/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless-api_spi.css new file mode 100644 index 0000000000..d3b72dd687 --- /dev/null +++ b/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless-api_spi.css @@ -0,0 +1,287 @@ +/******************************************************************************* + * Copyright (c) 2023 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +/* + * Since this is a separate section to override the existing or adding new stylings to javadoc, it is sometimes + * necessary to put in existing styling again here so that the intended styling would not be overriden by the ones + * provided in this section. + * + * A combined css file will be created using the original stylesheet.css + this css with the extended styling + * appended to the end of the combined file. + */ +body { + background-color: white; + font-family: Asap, 'DejaVu Sans', Arial, Helvetica, sans-serif; } + +#javadoc_container { + height: 100%; } + +a[target="packageFrame"], +a[target="classFrame"] { + font-size: 14px; + color: #5d6a8e; + letter-spacing: 0; + line-height: 24px; } + +h1 { + font-family: BunueloLight, Arial Narrow, Helvetica, Arial; + font-size:30px +} + +h2 { + font-family: BunueloBold, Arial Narrow, Helvetica, Arial; } + +.table-header { + font-family: BunueloBold, Arial Narrow, Helvetica, Arial; + font-size: 11px; } + +th > a { + font-weight: 500; + font-size: 14px; } + +main { + padding-left: 0px; + padding-top: 96px } + +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color: black; + text-transform: none; } + +.bar { + border-top: 1px solid #D4D7E3; + padding: 20px 0px 0px 8px; + margin: 20px 10px 5px 0px; + font-family: BunueloBold, Arial Narrow, Helvetica, Arial; + font-size: 14px; + color: #313653; + text-transform: uppercase; + background-color: white; } + +.top-nav { + background-color: #f1f4fe; + color: #5E6B8D; + height: 52px; + font-size: 16px; + padding-top: 0px; } + +/* open a standalone with no frame to check the top and bottom: All Classes is displayed but nothing else */ +.bottom-nav { + display: none; } + +.sub-nav { + background-color: unset; + float: unset; + overflow: unset; + width: unset; + font-size: unset; } + +/* this is used in the header of the right frame too - Start of Top navbar */ +.sub-nav .nav-list { + display: none; } + +.sub-nav .nav-list:nth-of-type(2) { + display: none; } + +.sub-nav div { + display: none; + /* Hide the Summary sub-nav filters from javadoc */ } + +/* used in Start of Top NavBar with display: none */ +ul.nav-list, ul.sub-nav-list { + display: table; + height: 100%; } + +/* All Classes at the top in a standalone with no frame */ +ul.nav-list li { + display: table-cell; + vertical-align: middle; + text-align: center; + padding: 0px 22px; + font-size: 16px; + font-weight: 500; + float: none; } + +/* doesn't seem to pick up this on focus */ +.clickableNavListTab, ul.nav-list li:focus { + background-color: #D6D9E4; + color: #253441; } + +.clickableNavListTab:hover { + cursor: pointer; } + +ul.nav-list li > a:hover { + color: inherit; } + +ul.nav-list-search { + margin: 5px 14px 0 0; } + +ul.nav-list-search li label, ul.nav-list-search li span { + display: none; } + +.top-nav a:link, .top-nav a:active, .top-nav a:visited, .bottom-nav a:link, .bottom-nav a:active, .bottom-nav a:visited { + color: #5E6B8D; + font-weight: 500; } + +.nav-bar-cell1-rev { + background-color: #D6D9E4; } + +.indexNav { + display: none; } + +ul.block-list ul.block-list ul.block-list li.block-list h3 { + background-color: #C8CCD8; } + +#all-packages-table tr:nth-child(1):not(.even-row-color) { + font-family: BunueloBold, Arial Narrow, Helvetica, Arial; } + +/* +#all-packages-table .summary-table .table-header { + padding-top: 20px; + padding-bottom: 0px; }*/ + +#all-packages-table .caption span, #class-summary .caption span, .field-summary .caption span, #related-package-summary .caption span, .details .caption span, #interface .caption span, #field .caption span, #method .caption span, .constructor-summary .caption span, .nested-class-summary .caption span, +.caption span, +div.table-tabs > button { + background-color: #D6D9E4; + font-family: BunueloLight, Arial Narrow, Helvetica, Arial; + font-size: 20px; + height: auto; } + +#method-summary-table .table-tabs { + padding-top: 0px; +} + +div.table-tabs > button.table-tab { + background-color: #5e6b8d; +} + +.table-tabs button.active-table-tab { + background-color: #D6D9E4; + height: auto; } + +.table-tabs button.table-tab { + height: auto; } + +div.table-tabs > button.active-table-tab { + background-color: #D6D9E4; } + +.table-header.col-first, .table-header.col-second, .table-header.col-last, .col-constructor-name, +.col-first, .col-second, .col-last { + vertical-align: middle; + /* override top in the original css */ } + +.col-first, .col-second, .col-last, .col-constructor-name { + background: #C8CCD8; + padding: 0px 3px 0px 7px; } + +.col-first, .table-header.col-first { + font-size: 14px; } + +/* Has to provide the same font-size here as the original otherwise th[scope='col'] will override the font-size */ +.col-second, .table-header.col-second, .col-last, .col-constructor-name, .table-header.col-last { + font-size: 13px; } + +.constantsSummary th, .packagesSummary th { + font-size: 13px; } + +#all-packages-table .col-first, #all-packages-table .col-second, #all-packages-table .col-last { +/*#method-summary-table .col-first, #method-summary-table .col-second, #method-summary-table .col-last, #method-summary-table .col-constructor-name, +.constructor-summary .col-first, .constructor-summary .col-second, .constructor-summary .col-last, .constructor-summary .ol-constructor-name {*/ + height: 45px; + padding-left: 49px; + padding-top: 20px; + padding-bottom: 0px; + vertical-align: middle; } + +/* has to copy over this styling from the original css, otherwise th.col-first background is picked up */ +.even-row-color, .even-row-color th { + background-color: #FFFFFF; } + +.odd-row-color, .odd-row-color th { + background-color: #EEEFF3; } + +div.block { + font-family: Asap, 'DejaVu Serif', Georgia, "Times New Roman", Times, serif; } + +.leftTop { + height: 45%; + transition: height 0.5s; + border-right: none; + border-bottom: none; } + +.leftBottom { + height: 55%; + transition: height 0.5s; + border-right: none; + border-top: none; } + +.rightContainer { + border-left: none; } + +.sticky { + position: fixed; + top: 0; + width: 100%; + background: white; + z-index: 1; + margin-top: 0px; + /* get rid of the user agent stylesheet margin temporarily */ } + +.sticky::before { + content: ' '; + position: absolute; + top: 20px; + /* This value will be replaced with a calculated value during scrolling */ + left: 0px; + right: 00px; + bottom: 0px; + border-top: 0px solid transparent; + /* This value will be replaced with the same border-top from the frame during scrolling */ + z-index: -1; } + +ul.ui-autocomplete { + font-family: Asap; } + +#search { + background-position: 2px 5px; + padding: 5px 5px 5px 20px; } + +#reset { + left: -5px; } + +.leftFrameHeaderStyling { + border-top: 3px solid #d9d9d9; + padding-top: 30px; } + +/* Custom expand/collapse button */ +div.toggle { + width: 11px; + margin-right: 10px; + margin-top: -1px; + float: left; } + +/* Minus toggle svg */ +div.toggle[collapsed='false'] { + margin-top: -5px; } + +div.toggle:hover { + cursor: pointer; } + +input[type='checkbox'] { + display: none; } + +label { + cursor: pointer; + float: left !important; + /* Overrides the inline float left */ } + +.header { + margin: 0; +} diff --git a/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css b/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css index ba9cc935dd..b02283d42f 100644 --- a/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css +++ b/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css @@ -16,266 +16,304 @@ * A combined css file will be created using the original stylesheet.css + this css with the extended styling * appended to the end of the combined file. */ -body { - background-color: white; - font-family: Asap, 'DejaVu Sans', Arial, Helvetica, sans-serif; } - -#javadoc_container { - height: 100%; } - -a[target="packageFrame"], -a[target="classFrame"] { - font-size: 14px; - color: #5d6a8e; - letter-spacing: 0; - line-height: 24px; } - -h1 { - font-family: BunueloLight, Arial Narrow, Helvetica, Arial; } - -h2 { - font-family: BunueloBold, Arial Narrow, Helvetica, Arial; } - -.table-header { - font-family: BunueloBold, Arial Narrow, Helvetica, Arial; - font-size: 11px; } - -th > a { - font-weight: 500; - font-size: 14px; } - -main { - padding-left: 0px; - padding-top: 96px } - -.bar a, .bar a:link, .bar a:visited, .bar a:active { - color: black; - text-transform: none; } - -.bar { - border-top: 1px solid #D4D7E3; - padding: 20px 0px 0px 8px; - margin: 20px 10px 5px 0px; - font-family: BunueloBold, Arial Narrow, Helvetica, Arial; - font-size: 14px; - color: #313653; - text-transform: uppercase; - background-color: white; } - -.top-nav { - background-color: #f1f4fe; - color: #5E6B8D; - height: 52px; - font-size: 16px; - padding-top: 0px; } - -/* open a standalone with no frame to check the top and bottom: All Classes is displayed but nothing else */ -.bottom-nav { - display: none; } - -.sub-nav { - background-color: unset; - float: unset; - overflow: unset; - width: unset; - font-size: unset; } - -/* this is used in the header of the right frame too - Start of Top navbar */ -.sub-nav .nav-list { - display: none; } - -.sub-nav .nav-list:nth-of-type(2) { - display: none; } - -.sub-nav div { - display: none; - /* Hide the Summary sub-nav filters from javadoc */ } - -/* used in Start of Top NavBar with display: none */ -ul.nav-list, ul.sub-nav-list { - display: table; - height: 100%; } - -/* All Classes at the top in a standalone with no frame */ -ul.nav-list li { - display: table-cell; - vertical-align: middle; - text-align: center; - padding: 0px 22px; - font-size: 16px; - font-weight: 500; - float: none; } - -/* doesn't seem to pick up this on focus */ -.clickableNavListTab, ul.nav-list li:focus { - background-color: #D6D9E4; - color: #253441; } - -.clickableNavListTab:hover { - cursor: pointer; } - -ul.nav-list li > a:hover { - color: inherit; } - -ul.nav-list-search { - margin: 5px 14px 0 0; } - -ul.nav-list-search li label, ul.nav-list-search li span { - display: none; } - -.top-nav a:link, .top-nav a:active, .top-nav a:visited, .bottom-nav a:link, .bottom-nav a:active, .bottom-nav a:visited { - color: #5E6B8D; - font-weight: 500; } - -.nav-bar-cell1-rev { - background-color: #D6D9E4; } - -.indexNav { - display: none; } - -ul.block-list ul.block-list ul.block-list li.block-list h3 { - background-color: #C8CCD8; } - -#all-packages-table tr:nth-child(1):not(.even-row-color) { - font-family: BunueloBold, Arial Narrow, Helvetica, Arial; } - -/* -#all-packages-table .summary-table .table-header { - padding-top: 20px; - padding-bottom: 0px; }*/ - -#all-packages-table .caption span, #class-summary .caption span, .field-summary .caption span, #related-package-summary .caption span, .details .caption span, #interface .caption span, #field .caption span, #method .caption span, .constructor-summary .caption span, .nested-class-summary .caption span, -.caption span, -div.table-tabs > button { - background-color: #D6D9E4; - font-family: BunueloLight, Arial Narrow, Helvetica, Arial; - font-size: 35px; - height: auto; } - -#method-summary-table .table-tabs { - padding-top: 0px; -} - -.table-tabs button.active-table-tab { - background-color: #D6D9E4; - height: auto; } - -.table-tabs button.table-tab { - height: auto; } - -div.table-tabs > button.active-table-tab { - background-color: #D6D9E4; } - -.table-header.col-first, .table-header.col-second, .table-header.col-last, .col-constructor-name, -.col-first, .col-second, .col-last { - vertical-align: middle; - /* override top in the original css */ } - -.col-first, .col-second, .col-last, .col-constructor-name { - background: #C8CCD8; - padding: 0px 3px 0px 7px; } - -.col-first, .table-header.col-first { - font-size: 14px; } - -/* Has to provide the same font-size here as the original otherwise th[scope='col'] will override the font-size */ -.col-second, .table-header.col-second, .col-last, .col-constructor-name, .table-header.col-last { - font-size: 13px; } - -.constantsSummary th, .packagesSummary th { - font-size: 13px; } - -#all-packages-table .col-first, #all-packages-table .col-second, #all-packages-table .col-last { -/*#method-summary-table .col-first, #method-summary-table .col-second, #method-summary-table .col-last, #method-summary-table .col-constructor-name, -.constructor-summary .col-first, .constructor-summary .col-second, .constructor-summary .col-last, .constructor-summary .ol-constructor-name {*/ - height: 45px; - padding-left: 49px; - padding-top: 20px; - padding-bottom: 0px; - vertical-align: middle; } - -/* has to copy over this styling from the original css, otherwise th.col-first background is picked up */ -.even-row-color, .even-row-color th { - background-color: #FFFFFF; } - -.odd-row-color, .odd-row-color th { - background-color: #EEEFF3; } - -div.block { - font-family: Asap, 'DejaVu Serif', Georgia, "Times New Roman", Times, serif; } - -.leftTop { - height: 45%; - transition: height 0.5s; - border-right: none; - border-bottom: none; } - -.leftBottom { - height: 55%; - transition: height 0.5s; - border-right: none; - border-top: none; } - -.rightContainer { - border-left: none; } - -.sticky { - position: fixed; - top: 0; - width: 100%; - background: white; - z-index: 1; - margin-top: 0px; - /* get rid of the user agent stylesheet margin temporarily */ } - -.sticky::before { - content: ' '; - position: absolute; - top: 20px; - /* This value will be replaced with a calculated value during scrolling */ - left: 0px; - right: 00px; - bottom: 0px; - border-top: 0px solid transparent; - /* This value will be replaced with the same border-top from the frame during scrolling */ - z-index: -1; } - -ul.ui-autocomplete { - font-family: Asap; } - -#search { - background-position: 2px 5px; - padding: 5px 5px 5px 20px; } - -#reset { - left: -5px; } - -.leftFrameHeaderStyling { - border-top: 3px solid #d9d9d9; - padding-top: 30px; } - -/* Custom expand/collapse button */ -div.toggle { - width: 11px; - margin-right: 10px; - margin-top: -1px; - float: left; } - -/* Minus toggle svg */ -div.toggle[collapsed='false'] { - margin-top: -5px; } - -div.toggle:hover { - cursor: pointer; } - -input[type='checkbox'] { - display: none; } - -label { - cursor: pointer; - float: left !important; - /* Overrides the inline float left */ } - -.header { - margin: 0; -} + body { + background-color: white; + font-family: Asap, 'DejaVu Sans', Arial, Helvetica, sans-serif; } + + #javadoc_container { + height: 100%; } + + a[target="packageFrame"], + a[target="classFrame"] { + font-size: 14px; + color: #5d6a8e; + letter-spacing: 0; + line-height: 24px; } + + h1 { + font-family: BunueloLight, Arial Narrow, Helvetica, Arial; + font-size: 30px; + } + + h2 { + font-family: BunueloBold, Arial Narrow, Helvetica, Arial; } + + .table-header { + font-family: BunueloBold, Arial Narrow, Helvetica, Arial; + font-size: 11px; } + + th > a { + font-weight: 500; + font-size: 14px; } + + main { + padding-left: 0px; + padding-top: 10px } + + .bar a, .bar a:link, .bar a:visited, .bar a:active { + color: black; + text-transform: none; } + + .bar { + border-top: 1px solid #D4D7E3; + padding: 20px 0px 0px 8px; + margin: 20px 10px 5px 0px; + font-family: BunueloBold, Arial Narrow, Helvetica, Arial; + font-size: 14px; + color: #313653; + text-transform: uppercase; + background-color: white; } + + .top-nav { + background-color: #f1f4fe; + color: #5E6B8D; + height: 52px; + font-size: 16px; + padding-top: 0px; } + + /* open a standalone with no frame to check the top and bottom: All Classes is displayed but nothing else */ + .bottom-nav { + display: none; } + + .sub-nav { + background-color: unset; + float: unset; + overflow: unset; + width: unset; + font-size: unset; } + + + /* this is used in the header of the right frame too - Start of Top navbar */ + .sub-nav .nav-list { + display: none; } + + .sub-nav .nav-list:nth-of-type(2) { + display: none; } + + /* .sub-nav div { + display: none; + /* Hide the Summary sub-nav filters from javadoc *//* } */ + + /* used in Start of Top NavBar with display: none */ + ul.nav-list, ul.sub-nav-list { + display: table; + height: 100%; } + + ul.sub-nav-list li{ + display: none; + } + + /* All Classes at the top in a standalone with no frame */ + ul.nav-list li { + display: table-cell; + vertical-align: middle; + text-align: center; + padding: 0px 22px; + font-size: 16px; + font-weight: 500; + float: none; } + + /* doesn't seem to pick up this on focus */ + .clickableNavListTab, ul.nav-list li:focus { + background-color: #D6D9E4; + color: #253441; } + + .clickableNavListTab:hover { + cursor: pointer; } + + ul.nav-list li > a:hover { + color: inherit; } + + ul.nav-list-search { + margin: 5px 14px 0 0; } + + ul.nav-list-search li label, ul.nav-list-search li span { + display: none; } + + .top-nav a:link, .top-nav a:active, .top-nav a:visited, .bottom-nav a:link, .bottom-nav a:active, .bottom-nav a:visited { + color: #5E6B8D; + font-weight: 500; } + + .nav-bar-cell1-rev { + background-color: #D6D9E4; } + + .indexNav { + display: none; } + + ul.block-list ul.block-list ul.block-list li.block-list h3 { + background-color: #C8CCD8; } + + #all-packages-table tr:nth-child(1):not(.even-row-color) { + font-family: BunueloBold, Arial Narrow, Helvetica, Arial; } + + /* + #all-packages-table .summary-table .table-header { + padding-top: 20px; + padding-bottom: 0px; }*/ + + #all-packages-table .caption span, #class-summary .caption span, .field-summary .caption span, #related-package-summary .caption span, .details .caption span, #interface .caption span, #field .caption span, #method .caption span, .constructor-summary .caption span, .nested-class-summary .caption span, + .caption span, + div.table-tabs > button { + background-color: #D6D9E4; + font-family: BunueloLight, Arial Narrow, Helvetica, Arial; + font-size: 20px; + height: auto; } + + #method-summary-table .table-tabs { + padding-top: 0px; + } + div.table-tabs > button.table-tab { + background-color: #5e6b8d; + } + .table-tabs button.active-table-tab { + background-color: #D6D9E4; + height: auto; } + + .table-tabs button.table-tab { + height: auto; } + + div.table-tabs > button.active-table-tab { + background-color: #D6D9E4; } + + .table-header.col-first, .table-header.col-second, .table-header.col-last, .col-constructor-name, + .col-first, .col-second, .col-last { + vertical-align: middle; + /* override top in the original css */ } + + .col-first, .col-second, .col-last, .col-constructor-name { + background: #C8CCD8; + padding: 0px 3px 0px 7px; } + + .col-first, .table-header.col-first { + font-size: 14px; } + + /* Has to provide the same font-size here as the original otherwise th[scope='col'] will override the font-size */ + .col-second, .table-header.col-second, .col-last, .col-constructor-name, .table-header.col-last { + font-size: 13px; } + + .constantsSummary th, .packagesSummary th { + font-size: 13px; } + + #all-packages-table .col-first, #all-packages-table .col-second, #all-packages-table .col-last { + /*#method-summary-table .col-first, #method-summary-table .col-second, #method-summary-table .col-last, #method-summary-table .col-constructor-name, + .constructor-summary .col-first, .constructor-summary .col-second, .constructor-summary .col-last, .constructor-summary .ol-constructor-name {*/ + height: 45px; + padding-left: 49px; + padding-top: 20px; + padding-bottom: 0px; + vertical-align: middle; } + + /* has to copy over this styling from the original css, otherwise th.col-first background is picked up */ + .even-row-color, .even-row-color th { + background-color: #FFFFFF; } + + .odd-row-color, .odd-row-color th { + background-color: #EEEFF3; } + + div.block { + font-family: Asap, 'DejaVu Serif', Georgia, "Times New Roman", Times, serif; } + + .leftTop { + height: 45%; + transition: height 0.5s; + border-right: none; + border-bottom: none; } + + .leftBottom { + height: 55%; + transition: height 0.5s; + border-right: none; + border-top: none; } + + .rightContainer { + border-left: none; } + + .sticky { + position: fixed; + top: 0; + width: 100%; + background: white; + z-index: 1; + margin-top: 0px; + /* get rid of the user agent stylesheet margin temporarily */ } + + .sticky::before { + content: ' '; + position: absolute; + top: 20px; + /* This value will be replaced with a calculated value during scrolling */ + left: 0px; + right: 00px; + bottom: 0px; + border-top: 0px solid transparent; + /* This value will be replaced with the same border-top from the frame during scrolling */ + z-index: -1; } + + ul.ui-autocomplete { + font-family: Asap; } + + #search { + background-position: 2px 5px; + padding: 5px 5px 5px 20px; } + + #reset { + left: -5px; } + + .leftFrameHeaderStyling { + border-top: 3px solid #d9d9d9; + padding-top: 30px; } + + /* Custom expand/collapse button */ + div.toggle { + width: 11px; + margin-right: 10px; + margin-top: -1px; + float: left; } + + /* Minus toggle svg */ + div.toggle[collapsed='false'] { + margin-top: -5px; } + + div.toggle:hover { + cursor: pointer; } + + input[type='checkbox'] { + display: none; } + + .nav-list-search{ + padding:5px 6px; + } + + /* To hide the search label */ + /* .nav-list-search label{ + display: none; + } */ + + /* label { + cursor: pointer; + float: left !important; + /* Overrides the inline float left */ /*} */ + label{ + display: none; + } + .header { + margin: 0; + } + + #search-input { + background-image: url(resources/glass.png); + background-size: 13px; + background-repeat: no-repeat; + background-position: 2px 5px; + padding: 5px 5px 5px 20px; + position: relative; + right: -18px; + width: 170px; + } + + .nav-list-search { + margin: 10px 20px 0 0; } + + li.ui-autocomplete-category{ + background-color: #5e6b8d; + } \ No newline at end of file diff --git a/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet.css b/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet.css new file mode 100644 index 0000000000..cb1a89c152 --- /dev/null +++ b/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet.css @@ -0,0 +1,350 @@ +/******************************************************************************* + * Copyright (c) 2020 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +/* + * Since this is a separate section to override the existing or adding new stylings to javadoc, it is sometimes + * necessary to put in existing styling again here so that the intended styling would not be overriden by the ones + * provided in this section. + * + * A combined css file will be created using the original stylesheet.css + this css with the extended styling + * appended to the end of the combined file. + */ +body { + background-color: white; + font-family: Asap, 'DejaVu Sans', Arial, Helvetica, sans-serif; } + +#javadoc_container { + height: 100%; } + +a[target="packageFrame"], +a[target="classFrame"] { + font-size: 14px; + color: #5d6a8e; + letter-spacing: 0; + line-height: 24px; } + +h1 { + font-family: BunueloLight, Arial Narrow, Helvetica, Arial; } + +h2 { + font-family: BunueloBold, Arial Narrow, Helvetica, Arial; } + +th[scope='col'] { + font-family: BunueloBold, Arial Narrow, Helvetica, Arial; + font-size: 11px; } + +th > a { + font-weight: 500; + font-size: 14px; } + +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color: black; + text-transform: none; } + +.bar { + border-top: 1px solid #D4D7E3; + padding: 20px 0px 0px 8px; + margin: 20px 10px 5px 0px; + font-family: BunueloBold, Arial Narrow, Helvetica, Arial; + font-size: 14px; + color: #313653; + text-transform: uppercase; + background-color: white; } + +.topNav { + background-color: #f1f4fe; + color: #5E6B8D; + height: 52px; + font-size: 16px; + padding-top: 0px; } + +/* open a standalone with no frame to check the top and bottom: All Classes is displayed but nothing else */ +.bottomNav { + display: none; } + +.subNav { + background-color: unset; + float: unset; + overflow: unset; + width: unset; + font-size: unset; } + +/* this is used in the header of the right frame too - Start of Top navbar */ +.subNav .navList { + display: none; } + +.subNav .navList:nth-of-type(2) { + display: none; } + +.subNav div { + display: none; + /* Hide the Summary subnav filters from javadoc */ } + +/* used in Start of Top NavBar with display: none */ +ul.navList, ul.subNavList { + display: table; + height: 100%; } + +/* All Classes at the top in a standalone with no frame */ +ul.navList li { + display: table-cell; + vertical-align: middle; + text-align: center; + padding: 0px 22px; + font-size: 16px; + font-weight: 500; + float: none; } + +/* doesn't seem to pick up this on focus */ +ul.navList li:focus { + background-color: #D6D9E4; + color: #253441; } + +.clickableNavListTab { + color: #bb7a2a; } + +.clickableNavListTab:hover { + cursor: pointer; } + +ul.navList li > a:hover { + color: inherit; } + +ul.navListSearch { + margin: 5px 14px 0 0; } + +ul.navListSearch li label, ul.navListSearch li span { + display: none; } + +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color: #5E6B8D; + font-weight: 500; } + +.navBarCell1Rev { + background-color: #D6D9E4; } + +.indexNav { + display: none; } + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color: #C8CCD8; } + +ul.blockList ul.blockList li.blockList h3 { + margin: 0 0; } + +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + padding: 10px 0px; } + +.indexContainer { + margin: 0px; } + +.indexContainer h2, +.indexContainer h2[title="Packages"] { + padding: 0 0 0 8px; + font-family: BunueloBold, Arial Narrow, Helvetica, Arial; + text-transform: uppercase; + font-size: 14px; + color: #313653; } + +.indexContainer h2[title="Packages"] { + padding-top: 30px; + margin-right: 10px; + margin-bottom: 5px; } + +.indexContainer ul li { + font-weight: 300; + color: #5D6A8E; + font-size: 14px; + min-height: 30px; + border-left: 8px solid transparent; + padding-left: 19px; + padding-top: 0px; + word-wrap: break-word; } + .indexContainer ul li.selected, .indexContainer ul li:hover, .indexContainer ul li:focus { + background: #fdf2ea; + border-left: 8px solid #f4914d; + font-weight: 500; } + +.overviewSummary tr:nth-child(1):not(.altColor) { + font-family: BunueloBold, Arial Narrow, Helvetica, Arial; } + +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span, +.requiresSummary caption span, .packagesSummary caption span, .providesSummary caption span, +.usesSummary caption span { + background-color: #D6D9E4; + font-family: BunueloLight, Arial Narrow, Helvetica, Arial; + font-size: 20px; + margin-top: 10px; + height: auto; } + +.memberSummary caption span { + font-size: 16px; } + +.memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span { + background-color: #D6D9E4; + height: auto; + padding-left: 30px; + padding-right: 30px; } + +.memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span { + height: auto; + padding-left: 30px; + padding-right: 30px; } + +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd, +.requiresSummary .tabEnd, .packagesSummary .tabEnd, .providesSummary .tabEnd, .usesSummary .tabEnd, +.memberSummary .activeTableTab .tabEnd, .packagesSummary .activeTableTab .tabEnd { + background-color: #D6D9E4; } + +th.colFirst, th.colSecond, th.colLast, th.colConstructorName, .useSummary th, .constantsSummary th, .packagesSummary th, +td.colFirst, td.colSecond, td.colLast, .useSummary td, .constantsSummary td { + vertical-align: middle; + /* override top in the original css */ } + +th.colFirst, th.colSecond, th.colLast, th.colConstructorName, .constantsSummary th, .packagesSummary th { + background: #C8CCD8; + padding: 0px 3px 0px 7px; } + +td.colFirst, th.colFirst { + font-size: 14px; } + +/* Has to provide the same font-size here as the original otherwise th[scope='col'] will override the font-size */ +td.colSecond, th.colSecond, td.colLast, th.colConstructorName, th.colLast { + font-size: 13px; } + +.constantsSummary th, .packagesSummary th { + font-size: 13px; } + +.providesSummary th.colFirst, .providesSummary th.colLast, .providesSummary td.colFirst, +.providesSummary td.colLast { + font-size: 13px; } + +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.requiresSummary td.colFirst, .requiresSummary th.colFirst, +.packagesSummary td.colFirst, .packagesSummary td.colSecond, .packagesSummary th.colFirst, .packagesSummary th, +.usesSummary td.colFirst, .usesSummary th.colFirst, +.providesSummary td.colFirst, .providesSummary th.colFirst, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colSecond, .memberSummary th.colSecond, .memberSummary th.colConstructorName, +.typeSummary td.colFirst { + height: 45px; + padding-left: 49px; + vertical-align: middle; } + +/* has to copy over this styling from the original css, otherwise th.colFIrst background is picked up */ +.altColor, .altColor th { + background-color: #FFFFFF; } + +.rowColor, .rowColor th { + background-color: #EEEFF3; } + +div.block { + font-family: Asap, 'DejaVu Serif', Georgia, "Times New Roman", Times, serif; } + +.leftTop { + height: 45%; + transition: height 0.5s; + border-right: none; + border-bottom: none; } + +.leftBottom { + height: 55%; + transition: height 0.5s; + border-right: none; + border-top: none; } + +.rightContainer { + border-left: none; } + +.sticky { + position: fixed; + top: 0; + width: 100%; + background: white; + z-index: 1; + margin-top: 0px; + /* get rid of the user agent stylesheet margin temporarily */ } + +.sticky::before { + content: ' '; + position: absolute; + top: 20px; + /* This value will be replaced with a calculated value during scrolling */ + left: 0px; + right: 00px; + bottom: 0px; + border-top: 0px solid transparent; + /* This value will be replaced with the same border-top from the frame during scrolling */ + z-index: -1; } + +/* + Mobile styles for the 3 frames +*/ +/* @media only screen and (max-device-width: 767px) { */ +@media (max-width: 767.98px) { + .overviewSummary td.colFirst, .overviewSummary th.colFirst, .requiresSummary td.colFirst, .requiresSummary th.colFirst, .packagesSummary td.colFirst, .packagesSummary td.colSecond, .packagesSummary th.colFirst, .packagesSummary th, .usesSummary td.colFirst, .usesSummary th.colFirst, .providesSummary td.colFirst, .providesSummary th.colFirst, .memberSummary td.colFirst, .memberSummary th.colFirst, .memberSummary td.colSecond, .memberSummary th.colSecond, .memberSummary th.colConstructorName, .typeSummary td.colFirst { + padding-left: 7px; } + .leftContainer, .leftTop, .leftBottom { + display: none; } + .rightContainer { + position: relative; + left: 0; } + .topNav { + overflow-x: auto; } + #navbar\.top, #navbar\.top\.firstrow { + display: none; } } + +/* Allow scrolling in mobile view */ +@media only screen and (max-device-width: 767.98px) { + .rightContainer { + overflow: auto; } } + +ul.ui-autocomplete { + font-family: Asap; } + +#search { + background-position: 2px 5px; + padding: 5px 5px 5px 20px; } + +#reset { + left: -5px; } + +.leftFrameHeaderStyling { + border-top: 3px solid #d9d9d9; + padding-top: 30px; } + +/* Custom expand/collapse button */ +div.toggle { + width: 11px; + margin-right: 10px; + margin-top: -1px; + float: left; } + +/* Minus toggle svg */ +div.toggle[collapsed='false'] { + margin-top: -5px; } + +div.toggle:hover { + cursor: pointer; } + +input[type='checkbox'] { + display: none; } + +label { + cursor: pointer; + float: left !important; + /* Overrides the inline float left */ } + +.header { + margin: 0; } + +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + margin-top: -10px; } diff --git a/src/main/content/antora_ui/src/js/06-javadocs.js b/src/main/content/antora_ui/src/js/06-javadocs.js index 2fd0a083b7..c2ba44d76e 100644 --- a/src/main/content/antora_ui/src/js/06-javadocs.js +++ b/src/main/content/antora_ui/src/js/06-javadocs.js @@ -58,6 +58,18 @@ function addAccessibility() { .attr("aria-label", "Footer navigation"); } +function addAccessibilityFrameless(){ + var javadoc_container = $("#javadoc_container").contents(); + javadoc_container + .contents() + .find("#search-input") + .attr("aria-label", "Search"); + javadoc_container + .contents() + .find("#reset-button") + .attr("aria-label", "Reset the search field"); +} + function addExpandAndCollapseToggleButtons() { var javadoc_container = $("#javadoc_container").contents(); var iframes = javadoc_container.find("iframe"); @@ -400,8 +412,10 @@ function setDynamicIframeContent() { var isFrameless = container.contents().find('iframe').length === 0; var alocation; if (isFrameless) { + console.log(window.location.pathname + "frameless") alocation = container.contents().attr('location'); } else { + console.log(window.location.pathname + "frame") alocation = container .contents() .find(".leftTop iframe") @@ -427,12 +441,16 @@ function setDynamicIframeContent() { if (targetPage.class) { setIFrameContent(CLASS_FRAME, defaultHtmlRootPath + targetPage.class); } - updateTitle(targetPage.package); + updateTitle(targetPage.package); + var isexternal = $("#javadoc_container").contents().find(".external-link").length !== 0; + if(isexternal){ + $("#javadoc_container").contents().find(".external-link").attr('target','_blank'); + } } // Update title in browser tab to show current page function updateTitle(currentPage) { - if (currentPage !== undefined && currentPage !== "allclasses-frame.html") { + if (currentPage !== undefined && currentPage !== "allclasses-frame.html" && currentPage !== "allclasses-index.html") { var currentPage = currentPage .substring(0, currentPage.lastIndexOf("/")) .replace(/\//g, "."); @@ -852,7 +870,14 @@ $(document).ready(function() { $("#javadoc_container").on("load", function() { resizeJavaDocWindow(); - addAccessibility(); + + var mainFrame = $('#javadoc_container'); + var isFrameless = mainFrame.contents().find('iframe').length === 0; + if(isFrameless){ + addAccessibilityFrameless(); + }else{ + addAccessibility(); + } addExpandAndCollapseToggleButtons(); addNavHoverListener(); addLeftFrameScrollListener(".leftTop iframe", 'h2[title="Packages"]'); diff --git a/src/main/java/io/openliberty/website/SecurityFilter.java b/src/main/java/io/openliberty/website/SecurityFilter.java index 0a03ca5950..3378dde815 100644 --- a/src/main/java/io/openliberty/website/SecurityFilter.java +++ b/src/main/java/io/openliberty/website/SecurityFilter.java @@ -71,7 +71,7 @@ public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain response.setHeader("X-Content-Type-Options", "nosniff"); // Mitigating cross site scripting (XSS) from other domains. response.setHeader("Content-Security-Policy", - "default-src 'self' 'unsafe-inline' 'unsafe-eval' cdn.jsdelivr.net fonts.googleapis.com ajax.googleapis.com code.jquery.com fonts.gstatic.com *.githubusercontent.com api.github.com www.googletagmanager.com tagmanager.google.com www.google-analytics.com cdnjs.cloudflare.com data: buttons.github.io www.youtube.com video.ibm.com https://start.openliberty.io/ gitlab.com starter-staging.rh9j6zz75er.us-east.codeengine.appdomain.cloud https://docs.oracle.com/javase/8/docs/api/"); + "default-src 'self' 'unsafe-inline' 'unsafe-eval' cdn.jsdelivr.net fonts.googleapis.com ajax.googleapis.com code.jquery.com fonts.gstatic.com *.githubusercontent.com api.github.com www.googletagmanager.com tagmanager.google.com www.google-analytics.com cdnjs.cloudflare.com data: buttons.github.io www.youtube.com video.ibm.com https://start.openliberty.io/ gitlab.com starter-staging.rh9j6zz75er.us-east.codeengine.appdomain.cloud https://docs.oracle.com/javase/8/docs/api/ https://docs.oracle.com/en/java/javase/17/docs/api/"); // Limits the information sent cross-domain and does not send the origin name. response.setHeader("Referrer-Policy", "no-referrer"); From cc6c4f07c115dae5d1aa2fa78cbb4f90c9f955f5 Mon Sep 17 00:00:00 2001 From: SteveSamJacob19 Date: Mon, 17 Jun 2024 13:49:37 +0530 Subject: [PATCH 2/8] Added search style --- .../src/css/javadoc-extended-stylesheet-frameless.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css b/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css index b02283d42f..bb79a9a104 100644 --- a/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css +++ b/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css @@ -252,6 +252,10 @@ ul.ui-autocomplete { font-family: Asap; } + .result-highlight { + font-weight:bold; + } + #search { background-position: 2px 5px; padding: 5px 5px 5px 20px; } From fe4477593aeccd7a837badf448f2265ff42e2351 Mon Sep 17 00:00:00 2001 From: SteveSamJacob19 Date: Mon, 17 Jun 2024 22:42:14 +0530 Subject: [PATCH 3/8] Removed console log --- .../content/_assets/js/javadoc-search-frameless.js | 13 ------------- src/main/content/antora_ui/src/js/06-javadocs.js | 2 -- 2 files changed, 15 deletions(-) diff --git a/src/main/content/_assets/js/javadoc-search-frameless.js b/src/main/content/_assets/js/javadoc-search-frameless.js index 327e0369e9..0196bb2d9f 100644 --- a/src/main/content/_assets/js/javadoc-search-frameless.js +++ b/src/main/content/_assets/js/javadoc-search-frameless.js @@ -313,20 +313,14 @@ $(function() { if (ui.item.category) { var url = getURLPrefix(ui); if (ui.item.category === catModules) { - console.log("inside ===catModules"); url += 'module-summary.html'; - console.log("url is "+url); } else if (ui.item.category === catPackages) { - console.log("inside ===catPackages"); if (ui.item.u) { url = ui.item.u; - console.log("url is "+url); } else { url += ui.item.l.replace(/\./g, '/') + '/package-summary.html'; - console.log("url else is "+url); } } else if (ui.item.category === catTypes) { - console.log("inside ===catTypes"); if (ui.item.u) { url = ui.item.u; } else if (ui.item.p === UNNAMED) { @@ -335,7 +329,6 @@ $(function() { url += ui.item.p.replace(/\./g, '/') + '/' + ui.item.l + '.html'; } } else if (ui.item.category === catMembers) { - console.log("inside ===catMembers"); if (ui.item.p === UNNAMED) { url += ui.item.c + '.html' + '#'; } else { @@ -346,20 +339,14 @@ $(function() { } else { url += ui.item.l; } - console.log("url is "+url); } else if (ui.item.category === catSearchTags) { - console.log("inside ===catSearchTags"); url += ui.item.u; } if (top !== window) { - console.log("top is "+top+" and window is "+window); - console.log("pathtoroot is "+ pathtoroot +" and url is "+url); - // parent.classFrame.location = pathtoroot + url; window.location.href = pathtoroot + url } else { window.location.href = pathtoroot + url; } - // $('#search-input').focus(); } } }); diff --git a/src/main/content/antora_ui/src/js/06-javadocs.js b/src/main/content/antora_ui/src/js/06-javadocs.js index c2ba44d76e..20865cb193 100644 --- a/src/main/content/antora_ui/src/js/06-javadocs.js +++ b/src/main/content/antora_ui/src/js/06-javadocs.js @@ -412,10 +412,8 @@ function setDynamicIframeContent() { var isFrameless = container.contents().find('iframe').length === 0; var alocation; if (isFrameless) { - console.log(window.location.pathname + "frameless") alocation = container.contents().attr('location'); } else { - console.log(window.location.pathname + "frame") alocation = container .contents() .find(".leftTop iframe") From 7ee3d53046f18b1dde8886628f6a478324e66136 Mon Sep 17 00:00:00 2001 From: SteveSamJacob19 Date: Thu, 27 Jun 2024 12:46:06 +0530 Subject: [PATCH 4/8] Added resulthighlight --- .../src/css/javadoc-extended-stylesheet-frameless.css | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css b/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css index bb79a9a104..5c3bb2fb38 100644 --- a/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css +++ b/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css @@ -29,7 +29,7 @@ color: #5d6a8e; letter-spacing: 0; line-height: 24px; } - + h1 { font-family: BunueloLight, Arial Narrow, Helvetica, Arial; font-size: 30px; @@ -252,7 +252,7 @@ ul.ui-autocomplete { font-family: Asap; } - .result-highlight { + .resultHighlight { font-weight:bold; } @@ -320,4 +320,6 @@ li.ui-autocomplete-category{ background-color: #5e6b8d; - } \ No newline at end of file + } + + \ No newline at end of file From 991ea0d5826c2c85f6271212f05b562bd38fa264 Mon Sep 17 00:00:00 2001 From: SteveSamJacob19 Date: Thu, 11 Jul 2024 20:42:51 +0530 Subject: [PATCH 5/8] Fixed bugs --- src/main/content/_assets/js/javadoc-redirect.js | 3 +-- .../src/css/javadoc-extended-stylesheet-frameless.css | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/content/_assets/js/javadoc-redirect.js b/src/main/content/_assets/js/javadoc-redirect.js index b50757933c..351f5b292c 100644 --- a/src/main/content/_assets/js/javadoc-redirect.js +++ b/src/main/content/_assets/js/javadoc-redirect.js @@ -47,8 +47,7 @@ function javadocRedirect(api,version,jd) { port + '/docs/latest/reference/javadoc/'+ api + version + - (pack ? '-javadoc.html?package='+pack+'/package-summary.html&class=': '-javadoc.html?class=') + - jd; + (pack ? '-javadoc.html?path='+api+version+'-javadoc/'+jd: '-javadoc.html'); } else{ window.top.location.href = diff --git a/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css b/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css index 5c3bb2fb38..c4b6616076 100644 --- a/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css +++ b/src/main/content/antora_ui/src/css/javadoc-extended-stylesheet-frameless.css @@ -197,10 +197,9 @@ #all-packages-table .col-first, #all-packages-table .col-second, #all-packages-table .col-last { /*#method-summary-table .col-first, #method-summary-table .col-second, #method-summary-table .col-last, #method-summary-table .col-constructor-name, .constructor-summary .col-first, .constructor-summary .col-second, .constructor-summary .col-last, .constructor-summary .ol-constructor-name {*/ - height: 45px; padding-left: 49px; padding-top: 20px; - padding-bottom: 0px; + padding-bottom: 20px; vertical-align: middle; } /* has to copy over this styling from the original css, otherwise th.col-first background is picked up */ From 887fda0d07101c7f3c7e77d31f300b04b5b67d81 Mon Sep 17 00:00:00 2001 From: SteveSamJacob19 Date: Fri, 12 Jul 2024 11:31:39 +0530 Subject: [PATCH 6/8] Fixed navigation --- .../content/antora_ui/src/js/06-javadocs.js | 35 ++++++------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/src/main/content/antora_ui/src/js/06-javadocs.js b/src/main/content/antora_ui/src/js/06-javadocs.js index 20865cb193..b67e27967b 100644 --- a/src/main/content/antora_ui/src/js/06-javadocs.js +++ b/src/main/content/antora_ui/src/js/06-javadocs.js @@ -826,13 +826,18 @@ function setFramelessQueryParams(){ alocation = alocation.substring(24); } - var newURL = new URL(window.location.href); + var currentHref= window.location.href; + var newURL = new URL(currentHref); var queryParams = newURL.searchParams; queryParams.set('path', alocation); - var search = window.location.search; - var hash = window.location.hash; - var newURL = window.location.href.replace(search, '').replace(hash, '') + '?' + decodeURIComponent(queryParams.toString()); - window.history.pushState({}, null, newURL); + var baseURL = currentHref.split('?')[0].split('#')[0]; + var newQueryString = '?' + decodeURIComponent(queryParams.toString()); + var newURL = baseURL + newQueryString + window.location.hash; + + // Navigate to the new URL + if(newURL !== currentHref){ + window.history.replaceState({}, null, newURL); + } } } @@ -932,25 +937,5 @@ $(document).ready(function() { setDynamicIframeContent(); - window.onpopstate = function(event) { - if (event.state) { - var mainfr = $("#javadoc_container"); - var isFrameless = mainfr.contents().find('iframe').length === 0; - if (isFrameless) { - if (window.history) { - window.history.back(); - } - } - $.each(event.state, function(key, value) { - setIFrameContent(key, value); - }); - // restore the height in case it is collapsed - setPackageContainerHeight(); - } else { - // This path is exercised with the initial page - setIFrameContent(PACKAGE_FRAME, defaultPackageHtml); - setIFrameContent(CLASS_FRAME, defaultClassHtml); - } - }; }); }); From 5aa414012dbfd336e6b92102f96febad96121527 Mon Sep 17 00:00:00 2001 From: SteveSamJacob19 Date: Thu, 18 Jul 2024 15:11:47 +0530 Subject: [PATCH 7/8] Revert docs-javadoc path --- scripts/build/javadoc_clone.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/javadoc_clone.sh b/scripts/build/javadoc_clone.sh index ec0d5fcda1..bed8505055 100755 --- a/scripts/build/javadoc_clone.sh +++ b/scripts/build/javadoc_clone.sh @@ -2,7 +2,7 @@ # Determine which branch of docs-javadoc repo to clone timer_start=$(date +%s) -BRANCH_NAME="ssj_test" +BRANCH_NAME="prod" # Development environments with draft content if [[ "$STAGING_SITE" == "true" || "$JAVADOC_STAGING_SITE" == "true" ]]; then echo "Cloning the staging branch of javadoc" From 91e96a159d3e89f02c50ea29c2cd75ad8bd1e24c Mon Sep 17 00:00:00 2001 From: SteveSamJacob19 Date: Thu, 18 Jul 2024 15:27:59 +0530 Subject: [PATCH 8/8] Remove comment --- scripts/build/javadoc_modify.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/build/javadoc_modify.sh b/scripts/build/javadoc_modify.sh index 76c7abb27c..fc91d7c410 100755 --- a/scripts/build/javadoc_modify.sh +++ b/scripts/build/javadoc_modify.sh @@ -60,12 +60,10 @@ export -f modifySearch export -f modifyFramelessSearch export -f modifyRedirect -# find target/jekyll-webapp/docs -path "*liberty-javaee7*/stylesheet.css" -exec bash -c 'modifyStylesheet {}' \; find target/jekyll-webapp/docs -path "*liberty-*/stylesheet.css" -exec bash -c 'modifyStylesheetFrameless {}' \; find target/jekyll-webapp/docs -path "*microprofile*/stylesheet.css" -exec bash -c 'modifyStylesheetFrameless {}' \; find target/jekyll-webapp/docs -path "*io.openliberty*/stylesheet.css" -exec bash -c 'modifyStylesheetFramelessSPIAPI {}' \; find target/jekyll-webapp/docs -path "*com.ibm.websphere.appserver*/stylesheet.css" -exec bash -c 'modifyStylesheetFramelessSPIAPI {}' \; -# find target/jekyll-webapp/docs -not -path "*microprofile-6.0*" -name search.js -exec bash -c 'modifySearch {}' \; find target/jekyll-webapp/docs -path "*microprofile*" -name search.js -exec bash -c 'modifyFramelessSearch {}' \; find target/jekyll-webapp/docs -path "*liberty-*" -name search.js -exec bash -c 'modifyFramelessSearch {}' \; find target/jekyll-webapp/docs -name script.js -exec bash -c 'modifyRedirect {}' \;