diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/js/feedback.js b/_vendor/github.com/chef/chef-docs-theme/assets/js/feedback.js index 11179f0c5b..8a8065dd73 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/js/feedback.js +++ b/_vendor/github.com/chef/chef-docs-theme/assets/js/feedback.js @@ -104,6 +104,8 @@ function submitContactFormFeedback(event) { .catch((error) => alert(error)); }; -document - .querySelector("#feedback-form") - .addEventListener("submit", submitContactFormFeedback); +const feedbackForm = document.querySelector("#feedback-form"); + +if (feedbackForm) { + feedbackForm.addEventListener("submit", submitContactFormFeedback); +} diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/js/swiftype-config.js b/_vendor/github.com/chef/chef-docs-theme/assets/js/swiftype-config.js index c854cf9728..29e373ea9f 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/js/swiftype-config.js +++ b/_vendor/github.com/chef/chef-docs-theme/assets/js/swiftype-config.js @@ -9,40 +9,91 @@ $(document).ready(function() { - // Swiftype UI elements // + // Retrieve list of default search product keys from search page HTML and parse into JSON array + let defaultSearchProducts = $('#swiftype-search').data('default-search-keys'); + + function returnParsedJson(jsonString) { + if (jsonString) { + let stringifiedJSON = JSON.stringify(jsonString); + let parsedJSON = JSON.parse(stringifiedJSON); + return parsedJSON; + } else { + return null; + } + } + + let parsedDefaultSearchProducts = returnParsedJson(defaultSearchProducts); + + /////////////////////////////////// + // + // Search Modal functions + // + /////////////////////////////////// - var showSearchModal = function() { - $("#swiftype-modal").show(500); - $("#swiftype-search-form-modal").focus(); + function showSearchModal(event) { + $("#swiftype-modal").show(250); + $("#swiftype-search-form-modal-input").focus(); + event.stopPropagation(); } - var hideSearchModal = function() { + function hideSearchModal() { $("#swiftype-modal").hide(250); - $("#swiftype-custom-facets input:checkbox[class='product-filter']").prop( "checked", false ); - window.location.hash = ""; + $('input#swiftype-search-form-modal-input').val(''); } - $("#swiftype-close-button").click(function(){ + // Hide search modal if clicking close button + $("#swiftype-search-close-button").click(function(){ hideSearchModal(); }); - $('body').click(function (event) { - if($('#swiftype-modal').is(":visible") && !$(event.target).closest('#swiftype-modal-content').length && !$(event.target).is('#swiftype-modal-content')) { - hideSearchModal(); + // Hide search modal if it's already visible and click outside modal box + $('body').on('click', function(event) { + if ($('#swiftype-modal').is(':visible') && !$(event.target).closest("#swiftype-modal").length) { + $('#swiftype-modal:visible').hide(); } }); - $("#swiftype-custom-facets-toggle-button").click(function(){ - if ($(window).width() < 768) { - $("#swiftype-custom-facets").toggle(500); - $("#swiftype-custom-facets-toggle-caret").find('svg').toggle(); - } + // Show search modal when clicking on search bar in top nav + $("#swiftype-search-top-nav").click(function(event){ + showSearchModal(event); + }); + + // Clear text in search modal if x button is clicked + $('#swiftype-search-form-modal-input-clear').click(function() { + $('input#swiftype-search-form-modal-input').val(''); + $('input#swiftype-search-form-modal-input').focus(); }); - $('#swiftype-facet-infra').on('change',function(){ - $('#swiftype-facet-client, #swiftype-facet-server').prop('checked',$(this).prop('checked')); + // on pressing enter key, navigate to search page and submit search string + $("input.swiftype-search-input").on('keypress', function (event) { + if (event.keycode == 13 || event.which == 13) { + event.preventDefault(); + window.location.href = "/search/#stq=" + encodeURIComponent($(this).val()) + '&stp=1'; + hideSearchModal(); + }; + }); + + /////////////////////////////////// + // + // Search Input functions + // + /////////////////////////////////// + + // If x button next to input is clicked: + // Clear search input + // Reset search in URL + // Reset search results + $('input#swiftype-search-top-container-form-input-clear').click(function() { + $('input#swiftype-search-top-container-form-input').val(''); + $('input#swiftype-search-top-container-form-input').focus(); + history.pushState({page: "Chef Documentation Search"}, "", "/search/") }); + $("input#swiftype-search-top-container-form-input-search").on('click', function() { + const searchString = $('input#swiftype-search-top-container-form-input').val(); + window.location.href = "/search/#stq=" + encodeURIComponent(searchString) + '&stp=1'; + }); + // trigger hideCustomFacets function after resize ends var debounce = function(fn, interval) { let timer; @@ -54,18 +105,73 @@ $(document).ready(function() { }; } + // show and hide elements when resizing var hideCustomFacets = function() { if ($(this).width() > 768) { - $('#swiftype-custom-facets').show(); + $('#swiftype-custom-facet-products').show(); + $("#search-facet-product-toggle-caret > svg.fa-caret-down").hide(); + $("#search-facet-product-toggle-caret > svg.fa-caret-up").hide(); } else { - $('#swiftype-custom-facets').hide(); - $("#swiftype-custom-facets-toggle-caret > svg.fa-caret-down").hide(); - $("#swiftype-custom-facets-toggle-caret > svg.fa-caret-up").show(); + $('#swiftype-custom-facet-products').hide(); + $("#search-facet-product-toggle-caret > svg.fa-caret-down").hide(); + $("#search-facet-product-toggle-caret > svg.fa-caret-up").show(); } } $(window).resize(debounce(hideCustomFacets, 400)); + /////////////////////////////////// + // + // Search Filter functions + // + /////////////////////////////////// + + // On selecting a checkbox for a versioned product: + // 1. display the version select tag + + // On deselecting a checkbox for a versioned product + // selected versioned checkboxes are deselected + $('.swiftype-product-with-versions').on('change', function(){ + + const versionListId = $($(this).data('version-selector-id')); + + if ($(this).is(':checked')) { + versionListId.show(); + } else { + versionListId.hide(); + } + + getChefProducts(); + reloadResults(); + }); + + // When selecting a version option + // 1. regenerate results + $('select.search-facet-versions').on('change', function(){ + getChefProducts(); + reloadResults(); + }); + + // When the product facet checkboxes are checked/unchecked, update the array of products and reload the results + $("#swiftype-custom-facets input:checkbox[class='product-filter']").change(function() { + getChefProducts(); + reloadResults(); + }); + + // "Clear all" button resets search filters + // show hidden products + // hide version checkboxes + // uncheck everything + // reload results + $('#swiftype-clear-all-filters').on('click', function() { + $('#swiftype-custom-facets input[type=checkbox]').prop('checked', false).css('display', 'inline-block'); + $('select.search-facet-versions').css('display', 'none'); + + getChefProducts(); + reloadResults(); + }); + + const searchHashRegex = /^#stq./; const searchStringMatchRegex = /^#stq=(.*)/; const searchPageNumRegex = /&stp=\d{1,3}$/; @@ -79,7 +185,7 @@ $(document).ready(function() { } else { var matchString = decodeURIComponent(hash); }; - $('input#swiftype-search-form-modal').val(matchString); + $('input#swiftype-search-top-container-form-input').val(matchString); }; // Watch for hashchange @@ -89,21 +195,18 @@ $(document).ready(function() { $(window).on('hashchange', function() { if (searchHashRegex.test(window.location.hash)) { processLocationHash(); - showSearchModal(); } }); if (searchHashRegex.test(window.location.hash)) { processLocationHash(); - showSearchModal(); }; - // Autocomplete UI elements - $("input.swiftype-search-input").on('keypress', function (event) { - if (event.keycode == 13 || event.which == 13) { - event.preventDefault(); - window.location.hash = 'stq=' + encodeURIComponent($(this).val()) + '&stp=1'; - }; + $("#search-facet-product").click(function() { + if ($(window).width() < 860) { + $("#swiftype-custom-facet-products").toggle(500); + $("#search-facet-product-toggle-caret").find('svg').toggle(); + } }); ///////////////////////// @@ -113,14 +216,16 @@ $(document).ready(function() { "facets": {} }; - ///////// - // Handle Regular Search Results - ///////// + // Define default products used in search + searchConfig.facets['chef-products'] = parsedDefaultSearchProducts; + var resultTemplate = Hogan.compile([ "
  • ", "", "{{title}}", - "Product: {{product}} {{{sections}}} • {{{body}}}", + "Product: {{product}} ", + "{{{sections}}}", + "{{{body}}}", "", "
  • " ].join('') ); @@ -137,24 +242,25 @@ $(document).ready(function() { return resultTemplate.render(data); }; - // Update the hash value in window.location // + // Update the hash value in window.location var reloadResults = function() { - window.location.hash = window.location.hash.replace(/stp=[^&]*/i, 'stp=1'); // Reset to page 1 + // Reset window to page 1 + window.location.hash = window.location.hash.replace(/stp=[^&]*/i, 'stp=1'); $(window).hashchange(); }; - //Checking the Infra checkbox will also check the Infra Client and Infra Server checkboxes. - $('#swiftype-facet-infra').on('change',function(){ - $('#swiftype-facet-client, #swiftype-facet-server').prop('checked',$(this).prop('checked')); - }); + // Get all Chef products selected in product checkbox field + // If no checkboxes are selected, return the default list of products + const getChefProducts = function(){ + if ($('#swiftype-product-filters :checkbox:checked').length === 0) { + searchConfig.facets['chef-products'] = parsedDefaultSearchProducts; + } else { + searchConfig.facets['chef-products'] = $("#swiftype-custom-facets input:checkbox[name='chef-product']:checked, select.search-facet-versions:visible option:selected").map(function() { + return $(this).val() + }).get(); + } + }; - // When the product facet checkboxes are checked/unchecked, update the array of products and reload the results - $("#swiftype-custom-facets input:checkbox[class='product-filter']").change(function() { - searchConfig.facets['chef-products'] = $("#swiftype-custom-facets input:checkbox[name='chef-product']:checked").map(function() { - return $(this).val() - }).get(); - reloadResults(); - }); // Returns an array of the chef-products to filter by var readFilters = function () { @@ -172,59 +278,20 @@ $(document).ready(function() { } } - ///////// - // Handle Autocomplete Search Results - ///////// - - var resultAutocompleteTemplate = Hogan.compile([ - "", - "{{title}}", - "{{{sections}}}", - "" - ].join('') ); - - var customAutocompleteFunction = function(document_type, item) { - var - data = { - title: item['title'], - url: item['url'], - sections: item['highlight']['sections'], - }; - return resultAutocompleteTemplate.render(data); - }; - - var autoHighlightFields = { - "page": { - "sections":{"size": 200, "fallback":true}, - "body":{"size": 250, "fallback": true}, - } - } - /* The swiftypeSearch function is from the Swiftype jQuery Plugin - "jquery.swiftype.search.js" https://swiftype.com/documentation/site-search/guides/jquery https://github.com/swiftype/swiftype-search-jquery */ - $('#swiftype-search-form-modal').swiftypeSearch({ + $('#swiftype-search-top-container-form-input').swiftypeSearch({ resultContainingElement: '#swiftype-search-results', engineKey: 'mXqaEKYsv--xS9fcY3Jz', renderFunction: customRenderFunction, facets: { page: ['chef-product'] }, filters: readFilters, - perPage: 8, + perPage: 10, highlightFields: highlightFields, }); - /* - The swiftype function is from the autocomplete plugin - "jquery.swiftype.autocomplete.js" - https://swiftype.com/documentation/site-search/guides/jquery - https://github.com/swiftype/swiftype-autocomplete-jquery - */ - - $('.swiftype-search-autocomplete').swiftype({ - engineKey: 'mXqaEKYsv--xS9fcY3Jz', - highlightFields: autoHighlightFields, - renderFunction: customAutocompleteFunction, - }); }); diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/js/version-docs.js b/_vendor/github.com/chef/chef-docs-theme/assets/js/version-docs.js deleted file mode 100644 index 8aa4b8d959..0000000000 --- a/_vendor/github.com/chef/chef-docs-theme/assets/js/version-docs.js +++ /dev/null @@ -1,101 +0,0 @@ - -// Display text divs with parentClass class and displayClass class -// Hide other text divs with just parentClass class -displayHideTextBlocks = function(displayClass, parentClass){ - for (var i = 0; i < parentClass.length; i++) { - versionedText = parentClass[i]; - versionedTextVersion = parentClass[i].classList[1]; - - if (versionedTextVersion === displayClass) { - versionedText.style.display = "block"; - } else { - versionedText.style.display = "none"; - } - } -} - -// Display correct product/version in dropdown list -changeDropdownListValue = function(version){ - var opts = dropdownId.options.length; - for (var i=0; i." - console.log("This browser does not support Window.localstorage") - }; - - } else { - urlVersion = urlVersion.split("#")[0] - displayHideTextBlocks(urlVersion, versionedTextBlocks) - changeDropdownListValue(urlVersion) - if (typeof(Storage) !== "undefined") { - localStorage.setItem(docsProductVersionKey, urlVersion); - } else { - // If browser does not support Window.localstorage - // Drop a div in between each section of the versioned documentation - // Stating something like "The following is documentation for version x.y of ." - console.log("This browser does not support Window.localstorage") - }; - }; -}; diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/_homepage.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/_homepage.scss index d35fceb21a..e7f45b4c1e 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/_homepage.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/_homepage.scss @@ -59,7 +59,6 @@ .cell{ -webkit-box-shadow: $box-shadow; - -moz-box-shadow: $box-shadow; box-shadow: $box-shadow; border: 1px solid transparent; } diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/main.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/main.scss index 5a43ad1756..d08170bc7a 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/main.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/main.scss @@ -33,4 +33,5 @@ body { @import "partials/tab-container"; @import "partials/toc"; @import "partials/utility-bar"; -@import "partials/breadcrumbs" +@import "partials/breadcrumbs"; +@import "partials/version_selector" diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_breadcrumbs.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_breadcrumbs.scss index dd75afc315..f18cf8ec48 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_breadcrumbs.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_breadcrumbs.scss @@ -1,7 +1,7 @@ #breadcrumb { - padding: 1rem 1.5rem 1rem 0; - font-size: .9rem; + font-size: .8rem; + margin: 2rem 0 1rem 0; ol { padding-left: 0; @@ -9,6 +9,9 @@ } li { display: inline; + a { + padding: 5px; + } &:not(:last-child)::after { content: " / "; diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_grid.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_grid.scss index e3395b6a72..c00d1230dd 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_grid.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_grid.scss @@ -28,7 +28,6 @@ display: block; margin: rem-calc(32) auto; -webkit-box-shadow: $box-shadow; - -moz-box-shadow: $box-shadow; box-shadow: $box-shadow; border: 1px solid transparent; padding: 1rem; @@ -49,7 +48,6 @@ text-indent: 0; border: 1px solid transparent; -webkit-box-shadow: $box-shadow; - -moz-box-shadow: $box-shadow; box-shadow: $box-shadow; padding: 0.5rem; margin: rem-calc(32) auto; @@ -71,7 +69,6 @@ padding: 0; border: none; -webkit-box-shadow: none; - -moz-box-shadow: none; box-shadow: none; } } diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_sidebar.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_sidebar.scss index 69086802db..77c4091ef6 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_sidebar.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_sidebar.scss @@ -1,8 +1,6 @@ #left-nav-on-canvas { - margin-top: .5rem; - padding: rem-calc(18 0); + margin: .5rem 1rem 0 0; z-index: 50; - width: 260px; box-shadow: none; } @@ -23,6 +21,9 @@ color:$orange-lighter; } } + #top-bar-close { + height: 25px; + } } .sidebar { @@ -33,10 +34,10 @@ #sidebar-nav{ height: 100%; - z-index: 25; + padding: 0 10px; overflow-y: scroll; overflow-x: hidden; - margin: 0 10px; + &.offCanvas{ width: inherit; } @@ -45,11 +46,10 @@ margin-bottom: 30px; > .accordion-menu { - font-size: rem-calc(14px); > li { > a { - font-weight: 700; + font-weight: 600; } a { @@ -60,6 +60,7 @@ &:focus { outline: none; } + padding: .75rem 0 .75rem 1rem; } } diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_swiftype_search.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_swiftype_search.scss index 2fc4228157..571e1a8258 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_swiftype_search.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_swiftype_search.scss @@ -1,31 +1,75 @@ #swiftype-modal { - display: none; /* Hidden by default */ - position: fixed; /* Stay in place */ - z-index: 1000; /* Sit on top */ - left: 0; - top: 0; - width: 100%; /* Full width */ - height: 100%; /* Full height */ - background-color: rgb(0,0,0); /* Fallback color */ - background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ + display: none; + background-color: #fefefe; + left: 50%; + top: 90px; + position: absolute; + transform: translate(-50%, -50%); + z-index: 1000; + + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + padding: 10px; + font-size: 1rem; + + @media (max-width: map-get($breakpoints, medium)) { + width: 100%; + } + + @media not (max-width: map-get($breakpoints, medium)) { + width: 60%; + } &-content { - background-color: #fefefe; - padding: 20px; - border: 1px solid #888; - width: 80%; - height: 90%; - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - overflow-y: hidden; display: flex; - flex-direction: column; + align-items: center; + font-size: 1rem; + flex-direction: row; + + #swiftype-search-form-modal { + flex: 1; + flex-shrink: 1; + } + + #swiftype-search-close { + + flex: 0; + position: relative; + top: -15px; + + &-button { + display: inline; + vertical-align: text-top; + font-size: 1.5rem; + margin: 0 .5rem 0 .75rem; + margin-bottom: auto; + } + } + + .input-group { + margin: 1rem; + min-width: 10px; + } + + input { + border: 1px solid $border-dark; + } + + #swiftype-search-form-modal-input{ + border-right: none; + padding: 2px; + } + + #swiftype-search-form-modal-input-clear { + background: none; + border-left: none; + padding: 0 10px; + margin-right: 5px; + } + } } -#swiftype-lower-container{ +#swiftype-lower-container { overflow-y: hidden; padding-bottom: 10px; display: flex; @@ -33,7 +77,7 @@ width: 100%; height: 100%; - #swiftype-modal-content-container{ + #swiftype-content-container{ margin: 0 1rem 1rem 0; overflow-y: hidden; display: flex; @@ -41,41 +85,56 @@ width: 100%; height: 100%; - h3 { - font-size: 1.25rem; - font-weight: 600; - margin-top: 1rem; - padding-top: 0; - display: inline; - position: relative; - } - #swiftype-container-left-sidebar { padding-top: 1rem; flex-grow: 0; - span#swiftype-custom-facets-toggle-caret{ - color: $accordionmenu-arrow-color; - margin-left: .5rem; + #swiftype-filters-heading{ + border-bottom: 1px solid $border-dark; + padding: 10px 0; } - label { - font-size: .8rem; + #swiftype-filters-title { + font-size: 1.2rem; + font-weight: 700; } - #swiftype-custom-facets{ - >ul{ - margin: 1em 0; - ul{ - margin-left: 1em; - } + + #swiftype-clear-all-filters { + margin-top: 10px; + } + + #swiftype-product-filters{ + border-bottom: 1px solid $border-dark; + padding: 20px 0; + + select { + width: 100%; + max-width: 120px; + border: 1px solid $border-dark; + height: 2rem; + border-radius: $border-radius-base; } - ul { - list-style-type: none; - input { - margin-bottom: .75em; - } + } + + #search-facet-product { + font-size: 1.2rem; + font-weight: 600; + } + + #swiftype-version-filters { + border-bottom: 1px solid $border-dark; + padding: 20px 0; + display: none; + + .swiftype-product-versions { + display: none; } } + + .search-facet-versions { + display: none; + margin: 0 0 1rem 1.5rem; + } } #swiftype-results-container{ @@ -86,8 +145,10 @@ flex-grow: 1; padding-top: 16px; - #swiftype-results-heading{ + #swiftype-results-heading { flex-grow: 0; + font-size: 1.5rem; + font-weight: 600; } #swiftype-search-results { overflow-y: scroll; @@ -95,42 +156,57 @@ padding-right: 10px; width: 100%; flex: 1 1 auto; - margin-left: 0; - a { - padding: .5rem 0; + margin: 0; + + li { + padding: 10px 0; border-bottom: 1px solid $border-dark; - display: block; - width: 100%; - >span { - display: inherit; - overflow: hidden; - &.st-result-title { - font-size: 15px; - font-weight: 500; - line-height: 1.2; - } - &.st-result-detail { - font-size: 12px; - font-weight: 400; - line-height: 1.4; - color:$lightgray; - em { - color: $gray + a { + padding: .5rem 0; + + display: block; + text-decoration: none; + width: 100%; + >span { + display: inherit; + overflow: hidden; + + &.st-result-detail-body, &.st-result-sections { + @media (max-width: map-get($breakpoints, medium)) { + display: none; + } } - >.st-result-highlight-product{ - color:red; + + &.st-result-title { + font-size: 1.25rem; + font-weight: 500; + line-height: 1.2; + } + &.detail { + color: $charcoal; + padding: 2px 0; + + em { + font-weight: 500; + + } + } + &.st-result-highlight-product{ display: none; } } } } + >.st-page { - border-bottom: 1px solid $border-dark; - overflow:hidden; + >a { position: relative; border-bottom: none; width: auto; + margin-top: 5px; + padding: 5px 0; + font-size: 1rem; &.st-prev { float: left; } @@ -150,183 +226,55 @@ } } -@media (max-width: 768px) { - #swiftype-modal-content { - width: 100%; - height: 100%; - } - .st-result-detail-body { - display: none; - } - #swiftype-lower-container { - #swiftype-modal-content-container { - flex-direction: column; - } - } - #swiftype-custom-facets { - display: none; - } -} - /////// -// Search Input +// Swiftype Search /////// -#left-nav-off-canvas-top-bar { - @include top-bar-unstack; - .search { - display: inline-block; - margin-right: 1rem; - } - .close-button { - position: relative; - margin: 0 0 0 1rem; - display: inline-block; - right: 0; - top: 0; - } -} +#swiftype-search { + &-top-container { + &-input { + width: 80%; + } + &-form { + border-radius: $border-radius-base; + outline: none; + + &-input { + padding: 10px; + font-size: 1rem; + width: 90%; + border: 1px solid $border-dark; + border-right: none; + height: 2.5rem; + + &-clear { + + font-size: 1rem; + padding: 10px; + border-left: none; + border-right: 1px solid $border-dark; + border-top: 1px solid $border-dark; + border-bottom: 1px solid $border-dark; -form > input.swiftype-search { - - &-input { - padding: 7px 11px 7px 28px; - font-size: 14px; - font-weight: 400; - line-height: 16px; - border-radius: $border-radius-base; - border: 1px solid #ccc; - outline: none; - background: #fcfcfc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAUFJREFUeNqU0j0oRWEcx/Hj3ifvlMHL7C1lY7mDwUBKkoksBjKJxWIQu7xlOybDLVGukhhMZDFbxGBS8nIjKR3E96nf0dPjuuVfn+6tc35P//P8/yYMw8CpbgygGQlcYw8H+Ai8MvotxQImgt81hk1M4cEPF2IV43jCGo7wjk5MYhhlGMKbG+7BKO4wiGPn8DO1vIN+jGA9fpjQaUksecG4zjGPL3VQ5IZb9OAw+LtO1FkjatxwUuEoTzjSbRu9/xO+0W97nnArqvXuoxve1/9p1OUIlmNGU7EX9+KGt3GKNuyiC5WoQAe2NJFP3PpzzmoR0khpxle6h3pnkeKJPCPjbtglerVFfWhSVxfqJtK4qrChTMY4XdjVm9O21aIA92LrFcv6HHtAsclxQVnxa0WfsqgDUib4X9muStCA2W8BBgDJ0EeGeFZ8WAAAAABJRU5ErkJggg==) no-repeat 5px 8px; - } + margin-right: 10px; + background-color: $white; - &-autocomplete { - margin: 5px 0; - display: inline-block; - height: 2.5em; - } -} + &:hover { + color: $white; + background-color: $body-font-color; + } -#swiftype-modal-search-form { - form > #swiftype-search-form-modal { - width: 100%; - margin-right: 10px; - box-sizing: border-box; - height: 32px; + } + } + } } - - - #swiftype-close-button { - font-size: .9rem; - margin-left: 10px; - padding: 6px; - border: 1px solid $border-dark; - border-radius: $border-radius-base; - - &:hover { - color: $white; - background-color: $body-font-color; + #swiftype-lower-container { + #swiftype-custom-facets{ + .swiftype-custom-facet-content { + @media (max-width: map-get($breakpoints, mediumlarge)) { + display: none; + } + } } } } - -///// -// Autocomplete Search Results -///// - -.swiftype-widget .autocomplete { - border-radius: $border-radius-base; - background-color: $white; - display: block; - list-style-type: none; - margin: 0; - padding: 0; - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); - position: absolute; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - -ms-border-radius: 3px; - -o-border-radius: 3px; - border-radius: 3px; - text-align: left; -} - -.swiftype-widget .autocomplete ul { - background-color: #fff; - display: block; - list-style-type: none; - margin: 0; - padding: 0; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - -ms-border-radius: 3px; - -o-border-radius: 3px; - border-radius: 3px; - text-align: left; -} - -.swiftype-widget .autocomplete li { - border-top: 1px solid $border; - cursor: pointer; - padding: 10px 8px; - font-size: 12px; - font-weight: 400; - list-style-type: none; - background-image: none; - margin: 0; -} - -.swiftype-widget .autocomplete li:first-child { - -webkit-border-radius: 3px 3px 0 0; - -moz-border-radius: 3px 3px 0 0; - -ms-border-radius: 3px 3px 0 0; - -o-border-radius: 3px 3px 0 0; - border-radius: 3px 3px 0 0; -} - -.swiftype-widget .autocomplete li:last-child { - -webkit-border-radius: 0 0 3px 3px; - -moz-border-radius: 0 0 3px 3px; - -ms-border-radius: 0 0 3px 3px; - -o-border-radius: 0 0 3px 3px; - border-radius: 0 0 3px 3px; -} - -.swiftype-widget .autocomplete li.active { - background-color: $menu-item-background-active; -} - -.swiftype-widget .autocomplete li span { - line-height: 16px; - margin: 0; - padding: 0; - text-overflow: ellipsis; - overflow-x: hidden; - white-space: nowrap; -} - -.swiftype-widget .autocomplete li span.swiftype-auto-result-title{ - font-weight: bold; - color: $blue-darker; - overflow: hidden; - display: block; -} - -.swiftype-widget .autocomplete li span.swiftype-auto-result-detail{ - color: $lightgray; - overflow: hidden; - display: block; -} - - -.swiftype-widget .autocomplete li span.swiftype-auto-result-title em { - color: #0b2644; - font-style: normal; - font-weight: bold; -} - -.swiftype-widget .autocomplete li.active span.swiftype-auto-result-title{ - color: $menu-item-color-active; -} diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_utility-bar.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_utility-bar.scss index de2781d648..7761717936 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_utility-bar.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_utility-bar.scss @@ -33,6 +33,22 @@ nav#utility-bar { } } } + + } + + button#swiftype-search-magnifying-icon { + border: 1px solid $border; + background-color: $sidebar-gray; + border-radius: $border-radius-base; + padding: .5rem; + margin: .25rem; + &:hover { + color: $blue-darker; + } + #swiftype-search-search-text{ + min-width: 170px; + display: inline-block; + } } button.utility-bar-nav-bars { diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_version_selector.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_version_selector.scss new file mode 100644 index 0000000000..d6bd62c704 --- /dev/null +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_version_selector.scss @@ -0,0 +1,28 @@ +.version-select { + margin-left: .5rem; + margin-bottom: 1rem; + &-label { + font-weight: bold; + } + &-menu { + li.version-select-menu-parent.is-dropdown-submenu-parent { + width: 100%; + border: 1px solid $border-dark; + border-radius: $border-radius-base; + margin-top: 10px; + + a, a::after { + font-size: .8rem; + color: $charcoal; + font-weight: 600; + border-color: $charcoal transparent transparent; + } + + >ul.version-selector-submenu { + width: 100%; + border: 1px solid $border-dark; + border-radius: 0 0 $border-radius-base $border-radius-base; + } + } + } +} diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/typography/_prose.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/typography/_prose.scss index 627a7a1359..415696345d 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/typography/_prose.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/typography/_prose.scss @@ -54,31 +54,6 @@ margin-top: 1rem; } } - #chef-product-version-dropdown{ - margin: -12px 0 26px 0; - &-label { - display: inline-block; - font-style: bold; - font-size: 1.25rem; - } - &-select { - display: inline-block; - width: auto; - border-radius: $border-radius-base; - } - } - .chef-product-version{ - &-not-newest{ - background-color: $ash; - padding: 1rem; - margin: 1.5rem; - border: 1px solid lightgray; - border-radius: $border-radius-base; - p { - margin: 0; - } - } - } } .responsive-table { diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/_default/baseof.html b/_vendor/github.com/chef/chef-docs-theme/layouts/_default/baseof.html index fb1007cd8e..f6361e4c4f 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/_default/baseof.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/_default/baseof.html @@ -44,8 +44,6 @@
    {{ partial .Params.toc_layout . }}
    - {{ else if (.Params.version_docs_product)}} - {{ partial "versioned-docs-toc" . }} {{ else }}
    {{ partial "table-of-contents" . }} diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/_default/data-api.html b/_vendor/github.com/chef/chef-docs-theme/layouts/_default/data-api.html index f49d1c697b..073f212c33 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/_default/data-api.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/_default/data-api.html @@ -3,6 +3,7 @@ {{- with .Params.description -}} + {{- end -}} {{.Title}} @@ -18,7 +19,7 @@ {{ if eq $.Page.Params.title "Chef Automate API" }} -
    +
    Return to Docs @@ -32,7 +33,7 @@
    {{ else }} - Return to Docs + Return to Docs {{ end }} {{ $redocJs := resources.Get "redoc/bundles/redoc.standalone.js" }} diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/_default/search.html b/_vendor/github.com/chef/chef-docs-theme/layouts/_default/search.html new file mode 100644 index 0000000000..df9a976633 --- /dev/null +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/_default/search.html @@ -0,0 +1,88 @@ +{{ define "main" }} + +{{ $defaultSearchKeys := delimit .Site.Params.search.default_search_product_keys `", "` }} + +{{ end }} diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/javascript.html b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/javascript.html index 5b4e543e9b..983bee4d96 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/javascript.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/javascript.html @@ -25,9 +25,8 @@ {{- $imageModal := resources.Get "js/image-modal.js" -}} {{- $inspecFilter := resources.Get "js/inspec-filter.js" -}} {{- $resourceNote := resources.Get "js/resource-note.js" -}} -{{- $versionDocs := resources.Get "js/version-docs.js" -}} -{{- $customJs := slice $copycodebutton $chefHugo $inspecFilter $resourceNote $versionDocs $feedback $imageModal -}} +{{- $customJs := slice $copycodebutton $chefHugo $inspecFilter $resourceNote $feedback $imageModal -}} {{ if hugo.Environment | eq "development" }} {{- $customJs = $customJs | resources.Concat "js/custom-bundle.js" -}} diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/on_canvas_top_bar.html b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/on_canvas_top_bar.html new file mode 100644 index 0000000000..d11f8cfdae --- /dev/null +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/on_canvas_top_bar.html @@ -0,0 +1,7 @@ +{{ if .Site.Params.version_selector }} +
    +
    + {{ partial "version_selector" . }} +
    +
    +{{ end }} \ No newline at end of file diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/range_menu.html b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/range_menu.html index 58e1194bf4..fb3ab10d18 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/range_menu.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/range_menu.html @@ -64,4 +64,4 @@ {{ end }} {{ end }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/sidebar-off-canvas.html b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/sidebar-off-canvas.html index 11744c7b65..5688877aed 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/sidebar-off-canvas.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/sidebar-off-canvas.html @@ -2,35 +2,39 @@
    +{{ end }} \ No newline at end of file diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/swiftype_search_modal.html b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/swiftype_search_modal.html index 8a0d9040e5..d2ffea390b 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/swiftype_search_modal.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/swiftype_search_modal.html @@ -1,85 +1,21 @@
    -
    -
    - -
    -
    -
    -
    - -
    - -
    -
      -
    • - -
      -
    • -
    • - -
      -
    • -
    • - -
      -
    • -
    • - -
      -
    • -
    • - -
      -
        -
      • - -
        -
      • -
      • - -
        -
      • -
      -
    • -
    • - -
      -
    • -
    • - -
      -
    • -
    • - -
      -
    • -
    • - -
      -
    • -
    -
    -
    - -
    -

    Search Results

    -
      -
    -
    -
    -
    diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/utility-bar.html b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/utility-bar.html index d0bda0734f..0f8b5bbe26 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/utility-bar.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/utility-bar.html @@ -1,20 +1,26 @@ -