Widget:BcaSearch: Difference between revisions

From Bodhicitta
(Search: results first, counts after)
(Mobile: finger-sized chapter/verse number chips)
 
(3 intermediate revisions by the same user not shown)
Line 7: Line 7:
.bcas__go:hover{background:#fff}
.bcas__go:hover{background:#fff}
.bcas__hint{font-size:.85rem;color:#666;margin:.2rem 0 1rem}
.bcas__hint{font-size:.85rem;color:#666;margin:.2rem 0 1rem}
.bcas__hint a{cursor:pointer}
.bcas__tabs{display:flex;flex-wrap:wrap;gap:.4rem;border-bottom:1px solid rgba(17,54,81,.15);margin:1rem 0 .8rem}
.bcas__tabs{display:flex;flex-wrap:wrap;gap:.4rem;border-bottom:1px solid rgba(17,54,81,.15);margin:1rem 0 .8rem}
.bcas__tab{padding:.45rem .9rem;border:1px solid transparent;border-bottom:0;border-radius:6px 6px 0 0;cursor:pointer;color:#41607D;font-size:.95rem;margin-bottom:-1px;background:none}
.bcas__tab{padding:.45rem .9rem;border:1px solid transparent;border-bottom:0;border-radius:6px 6px 0 0;cursor:pointer;color:#41607D;font-size:.95rem;margin-bottom:-1px;background:none}
Line 29: Line 28:
.bcas__tips ul{margin:.4rem 0 0 1.2rem}
.bcas__tips ul{margin:.4rem 0 0 1.2rem}
.bcas__tips li{margin:.15rem 0}
.bcas__tips li{margin:.15rem 0}
.bcas__tips a{cursor:pointer}
.bcas__tips a,.bcas__hint a{cursor:pointer;color:#0645AD;text-decoration:none;border-bottom:1px dotted rgba(6,69,173,.4)}
.bcas__tips a:hover,.bcas__hint a:hover{color:#001028}
/* Start panel (in the page below the widget) */
/* Start panel (in the page below the widget) */
.bcas-start{max-width:1100px;margin:1.5rem auto 3rem}
.bcas-start{max-width:1100px;margin:1.5rem auto 3rem}
Line 43: Line 43:
.bcas-start__chips a:hover{border-color:#bf9659;background:rgba(191,150,89,.08)}
.bcas-start__chips a:hover{border-color:#bf9659;background:rgba(191,150,89,.08)}
.bcas-start__chips a span{color:#888;font-size:.8rem}
.bcas-start__chips a span{color:#888;font-size:.8rem}
.bcas-start__chips--small{margin-top:.6rem}
.bcas-start__chips--small{margin-top:.5rem}
.bcas-start__sub{margin-bottom:.8rem}
.bcas-start__chips--small a{padding:.15rem .6rem;font-size:.82rem}
.bcas-start__chips--small a{padding:.15rem .6rem;font-size:.82rem}
/* Phones: finger-sized number chips (they were ~29x26px). */
@media (max-width:767.98px){.bcas-start__chips--small{gap:.5rem}.bcas-start__chips--small a{min-width:2.5rem;min-height:2.5rem;justify-content:center;font-size:.95rem}}
.bcas-start__more{margin-top:.7rem;font-size:.85rem;color:#666}
.bcas-start__more{margin-top:.7rem;font-size:.85rem;color:#666}
.bcas-start__more--stack a{display:block;padding:.15rem 0}
.bcas-start__more--stack a{display:block;padding:.15rem 0}
Line 71: Line 74:
<li><b>word*</b> matches any ending: <a data-q="meditat*">meditat*</a></li>
<li><b>word*</b> matches any ending: <a data-q="meditat*">meditat*</a></li>
<li><b>intitle:</b> searches titles only: <a data-q="intitle:bodhisattva">intitle:bodhisattva</a></li>
<li><b>intitle:</b> searches titles only: <a data-q="intitle:bodhisattva">intitle:bodhisattva</a></li>
<li><b>incategory:</b> searches by tag. Topics, decades, people and publishers are all tags: <a data-q="incategory:&quot;Topic: Tonglen&quot;">incategory:"Topic: Tonglen"</a>, <a data-q="incategory:&quot;Decade: 1990s&quot;">incategory:"Decade: 1990s"</a>, <a data-q="incategory:&quot;Padmakara Translation Group&quot;">incategory:"Padmakara Translation Group"</a>. Combine with words: <a data-q="patience incategory:&quot;Topic: Six Perfections&quot;">patience incategory:"Topic: Six Perfections"</a></li>
<li>Accents are optional (<a data-q="santideva">santideva</a> finds Śāntideva); Tibetan script and Wylie work too.</li>
<li>Accents are optional (<a data-q="santideva">santideva</a> finds Śāntideva); Tibetan script and Wylie work too.</li>
<li>A verse number such as <a data-q="8.120">8.120</a> offers that Bodhicaryāvatāra verse page.</li>
<li>A verse number such as <a data-q="8.120">8.120</a> offers that Bodhicaryāvatāra verse page.</li>
Line 303: Line 307:
$('#bcas-q').val(params.get('q') || '');
$('#bcas-q').val(params.get('q') || '');
$('#bcas-form').on('submit', function (e) { e.preventDefault(); state.cls = ''; run(); });
$('#bcas-form').on('submit', function (e) { e.preventDefault(); state.cls = ''; run(); });
// Clearing the box (its x, or deleting the text) returns to the browse panels.
$('#bcas-q').on('input search', function () { if (!this.value.trim() && state.q) { state.cls = ''; state.tab = 'library'; run(); } });
$('.bcas__tips').on('click', 'a[data-q]', function () { $('#bcas-q').val($(this).attr('data-q')); state.cls = ''; run(); });
$('.bcas__tips').on('click', 'a[data-q]', function () { $('#bcas-q').val($(this).attr('data-q')); state.cls = ''; run(); });
$('#bcas-hint').on('click', 'a[data-q]', function () { $('#bcas-q').val($(this).attr('data-q')); state.cls = ''; run(); });
$('#bcas-hint').on('click', 'a[data-q]', function () { $('#bcas-q').val($(this).attr('data-q')); state.cls = ''; run(); });

Latest revision as of 17:41, 8 October 2026

Site search for the Bodhicitta wiki (preview). Used on Advanced Search/Preview. Full-text search through CirrusSearch, results grouped (library, passages in the aligned texts, essays, topics, people), class filters with counts, the library's bibliographic rows, and the search kept in the page address so it can be shared.