function newFoundationsDocsMainSearchPage() {
let thisObject = {
addSearchHeader: addSearchHeader,
detectEnterOnSearchBox: detectEnterOnSearchBox,
setFocusOnSearchBox: setFocusOnSearchBox,
render: render,
initialize: initialize,
finalize: finalize
}
return thisObject
function initialize() {
}
function finalize() {
}
function render() {
let HTML = ''
HTML = HTML + '
'
HTML = HTML + '
'
HTML = HTML + '
'
HTML = HTML + '
'
let docsContentDiv = document.getElementById('docs-content-div')
docsContentDiv.innerHTML = HTML + UI.projects.education.spaces.docsSpace.footer.addFooter()
UI.projects.education.spaces.docsSpace.mainSearchPage.detectEnterOnSearchBox()
UI.projects.education.spaces.docsSpace.mainSearchPage.setFocusOnSearchBox()
}
function addSearchHeader() {
let HTML = ''
// Logo & Search Box
HTML = HTML + '
'
HTML = HTML + '
'
HTML = HTML + '
'
HTML = HTML + ''
HTML = HTML + '
'
HTML = HTML + '
'
return HTML
}
function detectEnterOnSearchBox() {
const element = document.getElementsByClassName("docs-search-input")[0]
if (UI.projects.education.spaces.docsSpace.commandInterface.command !== undefined) {
element.value = UI.projects.education.spaces.docsSpace.commandInterface.command
}
element.addEventListener("keyup", function (event) {
if (event.key === "Enter" || event.keyCode === 13) {
UI.projects.education.spaces.docsSpace.exitEditMode()
UI.projects.education.spaces.docsSpace.currentBookBeingRendered = undefined
UI.projects.education.spaces.docsSpace.currentDocumentBeingRendered = undefined
UI.projects.education.spaces.docsSpace.contextMenu.removeContextMenuFromScreen()
UI.projects.education.spaces.docsSpace.commandInterface.command = element.value.trim()
UI.projects.education.spaces.docsSpace.commandInterface.detectCommands()
}
});
}
function setFocusOnSearchBox() {
const element = document.getElementsByClassName("docs-search-input")[0]
element.focus()
}
}