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 / utils / selectMkb.js

selectMkb.js in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.5, at react-src/utils/selectMkb.js

24 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 export default function ( $scope, $ ) {
2 if( betterdocsCategoryGridConfig?.is_betterdocs_templates != 1 ) { //run this script only from outside betterdocs templates only, this script is made to determine set the kb and its value on cookie
3 $('.betterdocs-category-grid-inner-wrapper .betterdocs-single-category-wrapper .betterdocs-category-link-btn').on('click', function(e){ //this is triggerd when clicked on explore more on category grid
4 let secondTopLayer = $($($($(this)?.parent())?.parent())?.parent())?.parent();
5 let topLayerMkbAttribute = $(secondTopLayer).attr('data-mkb-slug');
6 if( topLayerMkbAttribute?.length > 0 ) {
7 var expiryDate = new Date();
8 var timeStamp = expiryDate.setDate(expiryDate.getDate() + 30).toString();
9 document.cookie = `last_knowledge_base=${topLayerMkbAttribute}; expires=${timeStamp}; path=/;` ;
10 }
11 });
12
13 $('.betterdocs-category-grid-inner-wrapper .betterdocs-single-category-wrapper .betterdocs-body .betterdocs-articles-list li a').on('click', function(e) { //this is triggerd when clicked on single doc list
14 let secondTopLayer = $($($($($($(this).parent()).parent()).parent()).parent()).parent()).parent();
15 let topLayerMkbAttribute = $(secondTopLayer).attr('data-mkb-slug');
16 if( topLayerMkbAttribute?.length > 0 ) {
17 var expiryDate = new Date();
18 var timeStamp = expiryDate.setDate(expiryDate.getDate() + 30).toString();
19 document.cookie = `last_knowledge_base=${topLayerMkbAttribute}; expires=${timeStamp}; path=/;` ;
20 }
21 });
22 }
23 }
24