Content server: Start work on FTS integration

This commit is contained in:
Kovid Goyal 2022-12-07 12:56:12 +05:30
parent 7e2b7274fd
commit c62386684f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 42 additions and 0 deletions

26
imgsrc/srv/fts.svg Normal file
View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
id="SVGRoot"
width="128"
height="128"
version="1.1"
viewBox="0 0 128 128"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs10" />
<g
id="layer1"
transform="translate(6.2816136,0.20846979)">
<g id="text189">
<path
d="M 1.336354,0.37399976 H 59.45371 Q 55.982346,4.9651589 54.470623,7.596677 53.01489,10.228195 50.71931,16.051129 l -0.447918,1.119795 Q 46.576069,9.5563181 42.936735,7.3167283 39.353392,5.0771384 30.78696,5.0771384 l -3.191415,0.05599 -5.431005,-0.05599 -2.071621,-0.05599 V 31.22435 h 3.415374 V 8.1005847 l 1.623703,-0.05599 q 3.471364,-0.1679693 7.390647,-0.1679693 11.421908,0 14.277385,5.9349133 -2.743498,-2.631518 -5.990903,-3.527354 -3.191416,-0.9518259 -9.910185,-0.9518259 -2.407559,0 -5.990903,0.2799487 V 31.22435 h 8.454452 l 8.958359,-9.462267 V 45.221786 L 32.914571,35.927488 H 20.092919 V 64.14632 l 7.166687,7.278667 H -0.23135887 L 8.8949697,64.14632 V 40.07073 q -4.3112104,0 -7.5586157,3.247405 L 0.27254884,42.14235 Q 3.5199541,38.559007 8.8949697,38.559007 v -2.631519 q -1.1757846,-0.111979 -1.6796924,-0.111979 -5.2070463,0 -9.0143491,4.255221 L -2.191,39.174894 Q 0.32853859,31.896227 8.8949697,31.22435 V 7.596677 Z M 63.708931,3.7893743 Q 55.702397,13.139662 53.630777,20.922237 L 52.454992,20.13838 Q 54.582602,11.34799 62.701116,2.8375486 Z M 46.4081,23.721724 v 24.18757 L 44.952366,47.069448 V 22.881878 Z M 36.385935,40.630627 H 24.908037 v 23.963611 l 9.854195,12.205765 H 2.3441694 L 0.94442579,75.28828 H 31.626807 L 23.508293,65.266115 V 39.118904 h 11.253939 z"
id="path293" />
</g>
<g id="text301">
<path
d="m 114.10015,50.782996 q -0.50391,0.951826 -0.67188,1.287764 l -3.8073,6.71877 q -1.95964,3.583344 -3.63934,8.958359 l -0.11198,0.279949 -0.55989,-0.391928 -0.16797,-0.727867 q -1.62371,-6.382831 -4.64715,-8.84638 -2.967459,-2.463549 -9.126331,-2.463549 -2.519539,0 -5.039077,0.223959 h -0.671877 v 60.692887 l 6.60679,6.10288 H 66.676831 l 7.838564,-6.5508 V 60.357243 l -3.975272,-0.05599 q -5.766943,0 -8.230492,2.29558 -2.407559,2.23959 -2.855477,7.950544 H 57.99842 q 0.615888,-6.550801 3.359385,-9.126329 2.799487,-2.575528 9.182318,-2.575528 l 3.359385,0.05599 h 0.615887 v -2.743498 q -2.855477,-0.335939 -5.431005,-0.335939 -7.222677,0 -10.414093,2.967457 -3.191415,2.911467 -3.527354,9.910185 H 54.471066 Q 52.063507,60.91714 47.02443,51.342894 l -0.335938,-0.559898 z m 3.52735,3.527354 q -3.86329,4.927098 -8.11851,16.349006 l -0.22396,0.559898 -1.23178,-1.063806 0.16797,-0.503907 q 4.14324,-11.589878 8.00654,-16.125047 l 0.27994,-0.335939 z m -14.94926,8.734401 q -4.311213,-2.799488 -10.078157,-2.799488 -1.287764,0 -2.687507,0.16797 l 0.223959,56.269697 8.902369,10.52607 h -28.61076 l -1.287764,-1.51172 h 26.819088 l -7.502626,-8.56643 V 58.78953 l 3.023446,-0.05599 q 5.431006,0 7.670596,0.895836 2.295576,0.839846 3.527356,3.415375 z"
id="path296" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

14
src/pyj/book_list/fts.pyj Normal file
View File

@ -0,0 +1,14 @@
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2022, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import bound_methods, hash_literals
from book_list.ui import set_panel_handler
def init(container_id):
c = document.getElementById(container_id)
c.innerText = 'TODO: Implement me'
set_panel_handler('fts', init)

View File

@ -27,6 +27,7 @@ import book_list.local_books # noqa: unused-import
import book_list.book_details # noqa: unused-import
import book_list.edit_metadata # noqa: unused-import
import book_list.convert_book # noqa: unused-import
import book_list.fts # noqa: unused-import
def remove_initial_progress_bar():

View File

@ -431,6 +431,7 @@ def create_search_panel(container):
search_bar = create_search_bar(execute_search_interactive, 'search-books', tooltip=_('Search for books'), placeholder=_('Enter the search query'), button=search_button)
set_css(search_bar, flex_grow='10', margin_right='0.5em')
search_container.appendChild(E.div(style="display: flex; width: 100%;", search_bar, search_button))
search_container.appendChild(E.div(style="text-align: left; padding-top: 1ex", E.a(class_="blue-link", svgicon("fts"), '\xa0', _('Search the full text of books instead'), href='javascript: void(0)', onclick=show_panel.bind(None, "fts"))))
search_container.appendChild(E.ul(class_='search-items', data_component='search_expression'))
# Build loading panel