File tree Expand file tree Collapse file tree 2 files changed +14
-16
lines changed
developer-docs/docs/assets/js Expand file tree Collapse file tree 2 files changed +14
-16
lines changed Original file line number Diff line number Diff line change 1919/*
2020* Handle opening external links in a new tab
2121*/
22- /*
23- * Initialize highlightjs
22+ /*
23+ * Initialize highlightjs
2424 */
2525const form = document . getElementById ( "search" ) ;
2626const textInput = document . getElementById ( "query" ) ;
@@ -52,17 +52,16 @@ window.addEventListener("DOMContentLoaded", function() {
5252 var pathname = this . window . location . pathname ;
5353 var origin = this . window . location . origin ;
5454 var searchPage = "search-results.html" + "?search_term=" + searchTerm ;
55- if ( pathname != null && pathname . startsWith ( "/choreo/docs/" ) ) {
56-
55+ if ( pathname != null && ( pathname . startsWith ( "/choreo/docs/" ) || pathname === "/choreo/docs ") ) {
56+
5757 searchPage = origin + "/choreo/docs/" + searchPage ;
58+ } else if ( pathname != null && ( pathname . startsWith ( "/engineering-platform/developer-platform/docs/" ) || pathname === "/engineering-platform/developer-platform/docs" ) ) {
59+
60+ searchPage = origin + "/engineering-platform/developer-platform/docs/" + searchPage ;
5861 } else {
5962 searchPage = origin + "/" + searchPage ;
6063 }
6164
62- // const arrayFromCollection = Array.from(document.links);
63- // localStorage.setItem('searchResults', arrayFromCollection);
6465 document . location . href = searchPage ;
65-
66- // You can add more code here to handle the form submission
6766 }
6867 } ) ;
Original file line number Diff line number Diff line change 1919/*
2020* Handle opening external links in a new tab
2121*/
22- /*
23- * Initialize highlightjs
22+ /*
23+ * Initialize highlightjs
2424 */
2525const form = document . getElementById ( "search" ) ;
2626const textInput = document . getElementById ( "query" ) ;
@@ -52,17 +52,16 @@ window.addEventListener("DOMContentLoaded", function() {
5252 var pathname = this . window . location . pathname ;
5353 var origin = this . window . location . origin ;
5454 var searchPage = "search-results.html" + "?search_term=" + searchTerm ;
55- if ( pathname != null && pathname . startsWith ( "/choreo/docs/" ) ) {
56-
55+ if ( pathname != null && ( pathname . startsWith ( "/choreo/docs/" ) || pathname === "/choreo/docs ") ) {
56+
5757 searchPage = origin + "/choreo/docs/" + searchPage ;
58+ } else if ( pathname != null && ( pathname . startsWith ( "/engineering-platform/developer-platform/docs/" ) || pathname === "/engineering-platform/developer-platform/docs" ) ) {
59+
60+ searchPage = origin + "/engineering-platform/developer-platform/docs/" + searchPage ;
5861 } else {
5962 searchPage = origin + "/" + searchPage ;
6063 }
6164
62- // const arrayFromCollection = Array.from(document.links);
63- // localStorage.setItem('searchResults', arrayFromCollection);
6465 document . location . href = searchPage ;
65-
66- // You can add more code here to handle the form submission
6766 }
6867 } ) ;
You can’t perform that action at this time.
0 commit comments