MCPcopy Index your code
hub / github.com/docsifyjs/docsify / tpl

Function tpl

src/plugins/search/component.js:113–131  ·  view source on GitHub ↗
(defaultValue = '')

Source from the content-addressed store, hash-verified

111}
112
113function tpl(defaultValue = '') {
114 const html = `<div class="input-wrap">
115 <input type="search" value="${defaultValue}" aria-label="Search text" />
116 <div class="clear-button">
117 <svg width="26" height="24">
118 <circle cx="12" cy="12" r="11" fill="#ccc" />
119 <path stroke="white" stroke-width="2" d="M8.25,8.25,15.75,15.75" />
120 <path stroke="white" stroke-width="2"d="M8.25,15.75,15.75,8.25" />
121 </svg>
122 </div>
123 </div>
124 <div class="results-panel"></div>
125 </div>`;
126 const el = Docsify.dom.create('div', html);
127 const aside = Docsify.dom.find('aside');
128
129 Docsify.dom.toggleClass(el, 'search');
130 Docsify.dom.before(aside, el);
131}
132
133function doSearch(value) {
134 const $search = Docsify.dom.find('div.search');

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected