PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.5
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 All 203 releases
betterdocs / react-src / public / shortcodes / search-modal / index.js

index.js in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.5, at react-src/public/shortcodes/search-modal/index.js

35 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React from 'react';
2 import { createRoot } from 'react-dom/client';
3 import SearchField from './SearchField'; // Adjust the path as necessary
4
5 document.addEventListener('DOMContentLoaded', () => {
6 const searchDiv = document.querySelectorAll('[id=betterdocs-search-modal]');
7 if (searchDiv) {
8 for( let node of searchDiv ) {
9 const className = node?.className;
10 const dataAttributes = {
11 placeholder: node.getAttribute('data-placeholder'),
12 heading: node.getAttribute('data-heading'),
13 subheading: node.getAttribute('data-subheading'),
14 headingTag: node.getAttribute('data-headingtag'),
15 subheadingTag: node.getAttribute('data-subheadingtag'),
16 buttonText: node.getAttribute('data-buttontext'),
17 numberofdocs:node.getAttribute('data-numberofdocs'),
18 numberoffaqs:node.getAttribute('data-numberoffaqs'),
19 docterms:node.getAttribute('data-docterms'),
20 faqterms:node.getAttribute('data-faqterms'),
21 searchButton:node.getAttribute('data-searchbutton'),
22 doc_ids:node.getAttribute('data-doc_ids'),
23 doc_categories_ids:node.getAttribute('data-doc_categories_ids'),
24 faq_categories_ids:node.getAttribute('data-faq_categories_ids'),
25 enable_faq_search:node.getAttribute('data-enable_faq_search'),
26 enable_docs_search:node.getAttribute('data-enable_docs_search'),
27 enable_ai_powered_search:node.getAttribute('data-enable_ai_powered_search'),
28 kbBasedSearch:node.getAttribute('data-kb_based_search')
29 };
30 const root = createRoot(node);
31 root.render(<SearchField layout={className} {...dataAttributes} />);
32 }
33 }
34 });
35