PageSourceSearch

https://libgen.im/index_files/app.js

js libgen.im collected 2026-10-09 03:08:11 UTC 35,902 bytes, 268 lines download raw bytes

1$('.copyToClipboard').on('click', function() {
2    element = $(this).data('target');
3    var $temp = $("<input>");
4    $("body").append($temp);
5    $temp.val($(element).text()).select();
6    document.execCommand("copy");
7    $temp.remove();
8
9    $(element).parent().append('<small class="text-info copy_response">Copied!</small>');
10
11    setTimeout(function() {
12        $('body .copy_response').remove();
13    }, 2000);
14});
15
16setTimeout(function() {
17    var searchField = document.getElementById('searchFieldx');
18    var searchFieldTopPosition;
19
20    if (searchField) {
21        searchFieldTopPosition = searchField.getBoundingClientRect().top;
22
23        if (searchFieldTopPosition > 0) {
24            searchField.focus();
25        }
26    }
27}, 0);
28
29$("#searchForm").submit(function() {
30    $(this).children('select[value=""]').attr("disabled", "disabled");
31    $.each($("#searchForm select, #searchForm input"), function(key, value) {
32        if ($(this).val() == "") {
33            $(this).attr("disabled", "disabled");
34        }
35    });
36
37
38    const action = $(this).attr('action')
39    if (action.indexOf('/s/') === 0 || action.indexOf('/fulltext/') === 0) {
40        const format = /[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
41        const $input = $(this).find('input[name=q]')
42        if ($input.val().length) {
43            if (!format.test($input.val())) {
44                $(this).attr('action', action + rawurlencode($input.val()))
45                $input.attr("disabled", "disabled")
46            }
47        }
48    }
49
50    return true;
51});
52
53$('#ftcb2').popover({
54    placement: 'bottom',
55    html: true
56});
57
58$('#ftcb1').popover({
59    placement: 'bottom',
60    html: true
61});
62
63function initializePopoverHelper() {
64    if ($('#ftcb').length) {
65
66        if ($('#ftcb').is(':checked')) {
67            wordsContent = 'Search for books containing ALL specified terms ANYWHERE in the text. <div class="etcFt">..text text text <b>my</b> ..text text text text text .. <b>search</b> ..text text text text text.. <b>query</b>.. text text text <b>works</b> ..text text.. <b>good</b> text..</div>'
68            phraseContent = 'Search for books <i>exactly</i> match specified phrase. <div class="etcFt">..text text text text text text.. <b>my search query works good</b> ..text text text text text text text text text text text text..</div>'
69        } else {
70            wordsContent = 'Search for books containing <i>most of</i> specified terms (>75%) ANYWHERE in the text. <div class="etcFt">..text text text <b>my</b> ..text text text text text .. <b>search</b> ..text text text text text.. <b>query</b> ..text text.. <b>works</b> ..text text..</div>'
71            phraseContent = 'Search for books containing ALL specified words that are <i>next to each other</i> and in the <i>same order</i>. <div class="etcFt">..text text text text text text.. <b>my</b> long <b>search query</b> will <b>works good</b> ..text text text text text text text text text text text text..</div>'
72        }
73
74        $('#ftcb2').data('bs.popover').options.content = wordsContent;
75        $('#ftcb1').data('bs.popover').options.content = phraseContent;
76    }
77}
78
79$(function() {
80
81    // Preserving search query on search mode change.
82    $('.change_search_mode').click(function(event) {
83        event.preventDefault()
84
85        if ($(this).closest('li').hasClass('active')) {
86            return
87        }
88
89        /*
90                    const isInSearch = $('#searchFieldx').val() !== null
91
92                    // if on `search results` page, then adjust form action and re-submit form.
93                    if (isInSearch) {
94                        const formActionOld = document.forms.searchForm.action
95                        let formActionNew = formActionOld.substring(0, formActionOld.lastIndexOf('/', formActionOld.length - 2))
96                        formActionNew += formActionOld.includes('fulltext') ? '/s/' : '/fulltext/'
97                        document.forms.searchForm.action = formActionNew
98                        document.forms.searchForm.submit()
99                        return false
100                    }*/
101
102        const newURL = new URL(this.href)
103        const searchForm = document.forms.searchForm
104
105        // gathering only search related input values into `newURL`
106        searchForm.elements.forEach((element) => {
107            if (element.name === '') return
108            if (['checkbox', 'radio'].includes(element.type) && element.checked === false) return
109
110            newURL.searchParams.append(element.name, element.value)
111        })
112
113        window.location.href = newURL
114    })
115});
116
117
118
119$(function() {
120    new ZLibraryMultiselect({
121        wrapSelector: '#wrapYearFrom',
122        relationWrapSelector: '#wrapYearTo',
123        relationType: 'rangeStart',
124        useTargetSelect: true,
125        valuesName: 'yearFrom',
126        sortType: 'number',
127        isReversSort: true,
128        placeholder: 'Year from',
129        textForNone: 'Any year',
130        rowData: {
131            "items": [{ "text": 2025, "value": 2025 },{ "text": 2024, "value": 2024 },{ "text": 2023, "value": 2023 }, { "text": 2022, "value": 2022 }, { "text": 2021, "value": 2021 }, { "text": 2020, "value": 2020 }, { "text": 2019, "value": 2019 }, { "text": 2018, "value": 2018 }, { "text": 2017, "value": 2017 }, { "text": 2016, "value": 2016 }, { "text": 2015, "value": 2015 }, { "text": 2014, "value": 2014 }, { "text": 2013, "value": 2013 }, { "text": 2012, "value": 2012 }, { "text": 2011, "value": 2011 }, { "text": 2010, "value": 2010 }, { "text": 2009, "value": 2009 }, { "text": 2008, "value": 2008 }, { "text": 2007, "value": 2007 }, { "text": 2006, "value": 2006 }, { "text": 2005, "value": 2005 }, { "text": 2004, "value": 2004 }, { "text": 2003, "value": 2003 }, { "text": 2002, "value": 2002 }, { "text": 2001, "value": 2001 }, { "text": 2000, "value": 2000 }, { "text": 1999, "value": 1999 }, { "text": 1998, "value": 1998 }, { "text": 1997, "value": 1997 }, { "text": 1996, "value": 1996 }, { "text": 1995, "value": 1995 }, { "text": 1994, "value": 1994 }, { "text": 1993, "value": 1993 }, { "text": 1992, "value": 1992 }, { "text": 1991, "value": 1991 }, { "text": 1990, "value": 1990 }, { "text": 1989, "value": 1989 }, { "text": 1988, "value": 1988 }, { "text": 1987, "value": 1987 }, { "text": 1986, "value": 1986 }, { "text": 1985, "value": 1985 }, { "text": 1984, "value": 1984 }, { "text": 1983, "value": 1983 }, { "text": 1982, "value": 1982 }, { "text": 1981, "value": 1981 }, { "text": 1980, "value": 1980 }, { "text": 1979, "value": 1979 }, { "text": 1978, "value": 1978 }, { "text": 1977, "value": 1977 }, { "text": 1976, "value": 1976 }, { "text": 1975, "value": 1975 }, { "text": 1974, "value": 1974 }, { "text": 1973, "value": 1973 }, { "text": 1972, "value": 1972 }, { "text": 1971, "value": 1971 }, { "text": 1970, "value": 1970 }, { "text": 1969, "value": 1969 }, { "text": 1968, "value": 1968 }, { "text": 1967, "value": 1967 }, { "text": 1966, "value": 1966 }, { "text": 1965, "value": 1965 }, { "text": 1964, "value": 1964 }, { "text": 1963, "value": 1963 }, { "text": 1962, "value": 1962 }, { "text": 1961, "value": 1961 }, { "text": 1960, "value": 1960 }, { "text": 1959, "value": 1959 }, { "text": 1958, "value": 1958 }, { "text": 1957, "value": 1957 }, { "text": 1956, "value": 1956 }, { "text": 1955, "value": 1955 }, { "text": 1954, "value": 1954 }, { "text": 1953, "value": 1953 }, { "text": 1952, "value": 1952 }, { "text": 1951, "value": 1951 }, { "text": 1950, "value": 1950 }, { "text": 1949, "value": 1949 }, { "text": 1948, "value": 1948 }, { "text": 1947, "value": 1947 }, { "text": 1946, "value": 1946 }, { "text": 1945, "value": 1945 }, { "text": 1944, "value": 1944 }, { "text": 1943, "value": 1943 }, { "text": 1942, "value": 1942 }, { "text": 1941, "value": 1941 }, { "text": 1940, "value": 1940 }, { "text": 1939, "value": 1939 }, { "text": 1938, "value": 1938 }, { "text": 1937, "value": 1937 }, { "text": 1936, "value": 1936 }, { "text": 1935, "value": 1935 }, { "text": 1934, "value": 1934 }, { "text": 1933, "value": 1933 }, { "text": 1932, "value": 1932 }, { "text": 1931, "value": 1931 }, { "text": 1930, "value": 1930 }, { "text": 1929, "value": 1929 }, { "text": 1928, "value": 1928 }, { "text": 1927, "value": 1927 }, { "text": 1926, "value": 1926 }, { "text": 1925, "value": 1925 }, { "text": 1924, "value": 1924 }, { "text": 1923, "value": 1923 }, { "text": 1922, "value": 1922 }, { "text": 1921, "value": 1921 }, { "text": 1920, "value": 1920 }, { "text": 1919, "value": 1919 }, { "text": 1918, "value": 1918 }, { "text": 1917, "value": 1917 }, { "text": 1916, "value": 1916 }, { "text": 1915, "value": 1915 }, { "text": 1914, "value": 1914 }, { "text": 1913, "value": 1913 }, { "text": 1912, "value": 1912 }, { "text": 1911, "value": 1911 }, { "text": 1910, "value": 1910 }, { "text": 1909, "value": 1909 }, { "text": 1908, "value": 1908 }, { "text": 1907, "value": 1907 }, { "text": 1906, "value": 1906 }, { "text": 1905, "value": 1905 }, { "text": 1904, "value": 1904 }, { "text": 1903, "value": 1903 }, { "text": 1902, "value": 1902 }, { "text": 1901, "value": 1901 }, { "text": 1900, "value": 1900 }, { "text": 1899, "value": 1899 }, { "text": 1898, "value": 1898 }, { "text": 1897, "value": 1897 }, { "text": 1896, "value": 1896 }, { "text": 1895, "value": 1895 }, { "text": 1894, "value": 1894 }, { "text": 1893, "value": 1893 }, { "text": 1892, "value": 1892 }, { "text": 1891, "value": 1891 }, { "text": 1890, "value": 1890 }, { "text": 1889, "value": 1889 }, { "text": 1888, "value": 1888 }, { "text": 1887, "value": 1887 }, { "text": 1886, "value": 1886 }, { "text": 1885, "value": 1885 }, { "text": 1884, "value": 1884 }, { "text": 1883, "value": 1883 }, { "text": 1882, "value": 1882 }, { "text": 1881, "value": 1881 }, { "text": 1880, "value": 1880 }, { "text": 1879, "value": 1879 }, { "text": 1878, "value": 1878 }, { "text": 1877, "value": 1877 }, { "text": 1876, "value": 1876 }, { "text": 1875, "value": 1875 }, { "text": 1874, "value": 1874 }, { "text": 1873, "value": 1873 }, { "text": 1872, "value": 1872 }, { "text": 1871, "value": 1871 }, { "text": 1870, "value": 1870 }, { "text": 1869, "value": 1869 }, { "text": 1868, "value": 1868 }, { "text": 1867, "value": 1867 }, { "text": 1866, "value": 1866 }, { "text": 1865, "value": 1865 }, { "text": 1864, "value": 1864 }, { "text": 1863, "value": 1863 }, { "text": 1862, "value": 1862 }, { "text": 1861, "value": 1861 }, { "text": 1860, "value": 1860 }, { "text": 1859, "value": 1859 }, { "text": 1858, "value": 1858 }, { "text": 1857, "value": 1857 }, { "text": 1856, "value": 1856 }, { "text": 1855, "value": 1855 }, { "text": 1854, "value": 1854 }, { "text": 1853, "value": 1853 }, { "text": 1852, "value": 1852 }, { "text": 1851, "value": 1851 }, { "text": 1850, "value": 1850 }, { "text": 1849, "value": 1849 }, { "text": 1848, "value": 1848 }, { "text": 1847, "value": 1847 }, { "text": 1846, "value": 1846 }, { "text": 1845, "value": 1845 }, { "text": 1844, "value": 1844 }, { "text": 1843, "value": 1843 }, { "text": 1842, "value": 1842 }, { "text": 1841, "value": 1841 }, { "text": 1840, "value": 1840 }, { "text": 1839, "value": 1839 }, { "text": 1838, "value": 1838 }, { "text": 1837, "value": 1837 }, { "text": 1836, "value": 1836 }, { "text": 1835, "value": 1835 }, { "text": 1834, "value": 1834 }, { "text": 1833, "value": 1833 }, { "text": 1832, "value": 1832 }, { "text": 1831, "value": 1831 }, { "text": 1830, "value": 1830 }, { "text": 1829, "value": 1829 }, { "text": 1828, "value": 1828 }, { "text": 1827, "value": 1827 }, { "text": 1826, "value": 1826 }, { "text": 1825, "value": 1825 }, { "text": 1824, "value": 1824 }, { "text": 1823, "value": 1823 }, { "text": 1822, "value": 1822 }, { "text": 1821, "value": 1821 }, { "text": 1820, "value": 1820 }, { "text": 1819, "value": 1819 }, { "text": 1818, "value": 1818 }, { "text": 1817, "value": 1817 }, { "text": 1816, "value": 1816 }, { "text": 1815, "value": 1815 }, { "text": 1814, "value": 1814 }, { "text": 1813, "value": 1813 }, { "text": 1812, "value": 1812 }, { "text": 1811, "value": 1811 }, { "text": 1810, "value": 1810 }, { "text": 1809, "value": 1809 }, { "text": 1808, "value": 1808 }, { "text": 1807, "value": 1807 }, { "text": 1806, "value": 1806 }, { "text": 1805, "value": 1805 }, { "text": 1804, "value": 1804 }, { "text": 1803, "value": 1803 }, { "text": 1802, "value": 1802 }, { "text": 1801, "value": 1801 }, { "text": 1800, "value": 1800 }],
132            "selected": selected_year_from
133        },
134    });
135
136    new ZLibraryMultiselect({
137        wrapSelector: '#wrapYearTo',
138        relationWrapSelector: '#wrapYearFrom',
139        relationType: 'rangeEnd',
140        useTargetSelect: true,
141        valuesName: 'yearTo',
142        sortType: 'number',
143        isReversSort: true,
144        placeholder: 'Year to',
145        textForNone: 'Any year',
146        rowData: {
147            "items": [{ "text": 2026, "value": 2026 },{ "text": 2025, "value": 2025 },{ "text": 2024, "value": 2024 },{ "text": 2023, "value": 2023 }, { "text": 2022, "value": 2022 }, { "text": 2021, "value": 2021 }, { "text": 2020, "value": 2020 }, { "text": 2019, "value": 2019 }, { "text": 2018, "value": 2018 }, { "text": 2017, "value": 2017 }, { "text": 2016, "value": 2016 }, { "text": 2015, "value": 2015 }, { "text": 2014, "value": 2014 }, { "text": 2013, "value": 2013 }, { "text": 2012, "value": 2012 }, { "text": 2011, "value": 2011 }, { "text": 2010, "value": 2010 }, { "text": 2009, "value": 2009 }, { "text": 2008, "value": 2008 }, { "text": 2007, "value": 2007 }, { "text": 2006, "value": 2006 }, { "text": 2005, "value": 2005 }, { "text": 2004, "value": 2004 }, { "text": 2003, "value": 2003 }, { "text": 2002, "value": 2002 }, { "text": 2001, "value": 2001 }, { "text": 2000, "value": 2000 }, { "text": 1999, "value": 1999 }, { "text": 1998, "value": 1998 }, { "text": 1997, "value": 1997 }, { "text": 1996, "value": 1996 }, { "text": 1995, "value": 1995 }, { "text": 1994, "value": 1994 }, { "text": 1993, "value": 1993 }, { "text": 1992, "value": 1992 }, { "text": 1991, "value": 1991 }, { "text": 1990, "value": 1990 }, { "text": 1989, "value": 1989 }, { "text": 1988, "value": 1988 }, { "text": 1987, "value": 1987 }, { "text": 1986, "value": 1986 }, { "text": 1985, "value": 1985 }, { "text": 1984, "value": 1984 }, { "text": 1983, "value": 1983 }, { "text": 1982, "value": 1982 }, { "text": 1981, "value": 1981 }, { "text": 1980, "value": 1980 }, { "text": 1979, "value": 1979 }, { "text": 1978, "value": 1978 }, { "text": 1977, "value": 1977 }, { "text": 1976, "value": 1976 }, { "text": 1975, "value": 1975 }, { "text": 1974, "value": 1974 }, { "text": 1973, "value": 1973 }, { "text": 1972, "value": 1972 }, { "text": 1971, "value": 1971 }, { "text": 1970, "value": 1970 }, { "text": 1969, "value": 1969 }, { "text": 1968, "value": 1968 }, { "text": 1967, "value": 1967 }, { "text": 1966, "value": 1966 }, { "text": 1965, "value": 1965 }, { "text": 1964, "value": 1964 }, { "text": 1963, "value": 1963 }, { "text": 1962, "value": 1962 }, { "text": 1961, "value": 1961 }, { "text": 1960, "value": 1960 }, { "text": 1959, "value": 1959 }, { "text": 1958, "value": 1958 }, { "text": 1957, "value": 1957 }, { "text": 1956, "value": 1956 }, { "text": 1955, "value": 1955 }, { "text": 1954, "value": 1954 }, { "text": 1953, "value": 1953 }, { "text": 1952, "value": 1952 }, { "text": 1951, "value": 1951 }, { "text": 1950, "value": 1950 }, { "text": 1949, "value": 1949 }, { "text": 1948, "value": 1948 }, { "text": 1947, "value": 1947 }, { "text": 1946, "value": 1946 }, { "text": 1945, "value": 1945 }, { "text": 1944, "value": 1944 }, { "text": 1943, "value": 1943 }, { "text": 1942, "value": 1942 }, { "text": 1941, "value": 1941 }, { "text": 1940, "value": 1940 }, { "text": 1939, "value": 1939 }, { "text": 1938, "value": 1938 }, { "text": 1937, "value": 1937 }, { "text": 1936, "value": 1936 }, { "text": 1935, "value": 1935 }, { "text": 1934, "value": 1934 }, { "text": 1933, "value": 1933 }, { "text": 1932, "value": 1932 }, { "text": 1931, "value": 1931 }, { "text": 1930, "value": 1930 }, { "text": 1929, "value": 1929 }, { "text": 1928, "value": 1928 }, { "text": 1927, "value": 1927 }, { "text": 1926, "value": 1926 }, { "text": 1925, "value": 1925 }, { "text": 1924, "value": 1924 }, { "text": 1923, "value": 1923 }, { "text": 1922, "value": 1922 }, { "text": 1921, "value": 1921 }, { "text": 1920, "value": 1920 }, { "text": 1919, "value": 1919 }, { "text": 1918, "value": 1918 }, { "text": 1917, "value": 1917 }, { "text": 1916, "value": 1916 }, { "text": 1915, "value": 1915 }, { "text": 1914, "value": 1914 }, { "text": 1913, "value": 1913 }, { "text": 1912, "value": 1912 }, { "text": 1911, "value": 1911 }, { "text": 1910, "value": 1910 }, { "text": 1909, "value": 1909 }, { "text": 1908, "value": 1908 }, { "text": 1907, "value": 1907 }, { "text": 1906, "value": 1906 }, { "text": 1905, "value": 1905 }, { "text": 1904, "value": 1904 }, { "text": 1903, "value": 1903 }, { "text": 1902, "value": 1902 }, { "text": 1901, "value": 1901 }, { "text": 1900, "value": 1900 }, { "text": 1899, "value": 1899 }, { "text": 1898, "value": 1898 }, { "text": 1897, "value": 1897 }, { "text": 1896, "value": 1896 }, { "text": 1895, "value": 1895 }, { "text": 1894, "value": 1894 }, { "text": 1893, "value": 1893 }, { "text": 1892, "value": 1892 }, { "text": 1891, "value": 1891 }, { "text": 1890, "value": 1890 }, { "text": 1889, "value": 1889 }, { "text": 1888, "value": 1888 }, { "text": 1887, "value": 1887 }, { "text": 1886, "value": 1886 }, { "text": 1885, "value": 1885 }, { "text": 1884, "value": 1884 }, { "text": 1883, "value": 1883 }, { "text": 1882, "value": 1882 }, { "text": 1881, "value": 1881 }, { "text": 1880, "value": 1880 }, { "text": 1879, "value": 1879 }, { "text": 1878, "value": 1878 }, { "text": 1877, "value": 1877 }, { "text": 1876, "value": 1876 }, { "text": 1875, "value": 1875 }, { "text": 1874, "value": 1874 }, { "text": 1873, "value": 1873 }, { "text": 1872, "value": 1872 }, { "text": 1871, "value": 1871 }, { "text": 1870, "value": 1870 }, { "text": 1869, "value": 1869 }, { "text": 1868, "value": 1868 }, { "text": 1867, "value": 1867 }, { "text": 1866, "value": 1866 }, { "text": 1865, "value": 1865 }, { "text": 1864, "value": 1864 }, { "text": 1863, "value": 1863 }, { "text": 1862, "value": 1862 }, { "text": 1861, "value": 1861 }, { "text": 1860, "value": 1860 }, { "text": 1859, "value": 1859 }, { "text": 1858, "value": 1858 }, { "text": 1857, "value": 1857 }, { "text": 1856, "value": 1856 }, { "text": 1855, "value": 1855 }, { "text": 1854, "value": 1854 }, { "text": 1853, "value": 1853 }, { "text": 1852, "value": 1852 }, { "text": 1851, "value": 1851 }, { "text": 1850, "value": 1850 }, { "text": 1849, "value": 1849 }, { "text": 1848, "value": 1848 }, { "text": 1847, "value": 1847 }, { "text": 1846, "value": 1846 }, { "text": 1845, "value": 1845 }, { "text": 1844, "value": 1844 }, { "text": 1843, "value": 1843 }, { "text": 1842, "value": 1842 }, { "text": 1841, "value": 1841 }, { "text": 1840, "value": 1840 }, { "text": 1839, "value": 1839 }, { "text": 1838, "value": 1838 }, { "text": 1837, "value": 1837 }, { "text": 1836, "value": 1836 }, { "text": 1835, "value": 1835 }, { "text": 1834, "value": 1834 }, { "text": 1833, "value": 1833 }, { "text": 1832, "value": 1832 }, { "text": 1831, "value": 1831 }, { "text": 1830, "value": 1830 }, { "text": 1829, "value": 1829 }, { "text": 1828, "value": 1828 }, { "text": 1827, "value": 1827 }, { "text": 1826, "value": 1826 }, { "text": 1825, "value": 1825 }, { "text": 1824, "value": 1824 }, { "text": 1823, "value": 1823 }, { "text": 1822, "value": 1822 }, { "text": 1821, "value": 1821 }, { "text": 1820, "value": 1820 }, { "text": 1819, "value": 1819 }, { "text": 1818, "value": 1818 }, { "text": 1817, "value": 1817 }, { "text": 1816, "value": 1816 }, { "text": 1815, "value": 1815 }, { "text": 1814, "value": 1814 }, { "text": 1813, "value": 1813 }, { "text": 1812, "value": 1812 }, { "text": 1811, "value": 1811 }, { "text": 1810, "value": 1810 }, { "text": 1809, "value": 1809 }, { "text": 1808, "value": 1808 }, { "text": 1807, "value": 1807 }, { "text": 1806, "value": 1806 }, { "text": 1805, "value": 1805 }, { "text": 1804, "value": 1804 }, { "text": 1803, "value": 1803 }, { "text": 1802, "value": 1802 }, { "text": 1801, "value": 1801 }, { "text": 1800, "value": 1800 }],
148            "selected": selected_year_to
149        },
150    });
151
152    new ZLibraryMultiselect({
153        wrapSelector: '#wrapLang',
154        useTargetSelect: true,
155        type: 'multiple',
156        multipleCaptionsMode: 'enum',
157        valuesName: 'languages',
158        placeholder: 'Select lan
158guages',
159        textForNone: 'Any Language',
160        rowData: {
161            items: [{ "text": "Arabic", "value": "arabic" }, { "text": "Armenian", "value": "armenian" }, { "text": "Azerbaijani", "value": "azerbaijani" }, { "text": "Bengali", "value": "bengali" }, { "text": "Chinese", "value": "chinese" }, { "text": "Dutch", "value": "dutch" }, { "text": "English", "value": "english" }, { "text": "French", "value": "french" }, { "text": "Georgian", "value": "georgian" }, { "text": "German", "value": "german" }, { "text": "Greek", "value": "greek" }, { "text": "Hindi", "value": "hindi" }, { "text": "Indonesian", "value": "indonesian" }, { "text": "Italian", "value": "italian" }, { "text": "Japanese", "value": "japanese" }, { "text": "Korean", "value": "korean" }, { "text": "Malaysian", "value": "malaysian" }, { "text": "Pashto", "value": "pashto" }, { "text": "Polish", "value": "polish" }, { "text": "Portuguese", "value": "portuguese" }, { "text": "Russian", "value": "russian" }, { "text": "Serbian", "value": "serbian" }, { "text": "Spanish", "value": "spanish" }, { "text": "Telugu", "value": "telugu" }, { "text": "Thai", "value": "thai" }, { "text": "Turkish", "value": "turkish" }, { "text": "Ukrainian", "value": "ukrainian" }, { "text": "Urdu", "value": "urdu" }, { "text": "Vietnamese", "value": "vietnamese" }, { "text": "Abkhazian", "value": "abkhazian" }, { "text": "Afar", "value": "afar" }, { "text": "Afrikaans", "value": "afrikaans" }, { "text": "Akan", "value": "akan" }, { "text": "Albanian", "value": "albanian" }, { "text": "Amharic", "value": "amharic" }, { "text": "Aragonese", "value": "aragonese" }, { "text": "Assamese", "value": "assamese" }, { "text": "Avaric", "value": "avaric" }, { "text": "Avestan", "value": "avestan" }, { "text": "Aymara", "value": "aymara" }, { "text": "Bambara", "value": "bambara" }, { "text": "Bashkir", "value": "bashkir" }, { "text": "Basque", "value": "basque" }, { "text": "Belarusian", "value": "belarusian" }, { "text": "Berber", "value": "berber" }, { "text": "Bislama", "value": "bislama" }, { "text": "Bosnian", "value": "bosnian" }, { "text": "Breton", "value": "breton" }, { "text": "Bulgarian", "value": "bulgarian" }, { "text": "Burmese", "value": "burmese" }, { "text": "Catalan", "value": "catalan" }, { "text": "Central Khmer", "value": "central_khmer" }, { "text": "Chamorro", "value": "chamorro" }, { "text": "Chechen", "value": "chechen" }, { "text": "Chichewa", "value": "chichewa" }, { "text": "Church Slavic", "value": "church_slavic" }, { "text": "Chuvash", "value": "chuvash" }, { "text": "Cornish", "value": "cornish" }, { "text": "Corsican", "value": "corsican" }, { "text": "Cree", "value": "cree" }, { "text": "Crimean Tatar", "value": "crimean" }, { "text": "Croatian", "value": "croatian" }, { "text": "Czech", "value": "czech" }, { "text": "Danish", "value": "danish" }, { "text": "Divehi", "value": "divehi" }, { "text": "Dzongkha", "value": "dzongkha" }, { "text": "Esperanto", "value": "esperanto" }, { "text": "Estonian", "value": "estonian" }, { "text": "Ewe", "value": "ewe" }, { "text": "Faroese", "value": "faroese" }, { "text": "Fijian", "value": "fijian" }, { "text": "Finnish", "value": "finnish" }, { "text": "Fulah", "value": "fulah" }, { "text": "Gaelic", "value": "gaelic" }, { "text": "Galician", "value": "galician" }, { "text": "Ganda", "value": "ganda" }, { "text": "Guarani", "value": "guarani" }, { "text": "Gujarati", "value": "gujarati" }, { "text": "Haitian", "value": "haitian" }, { "text": "Hausa", "value": "hausa" }, { "text": "Hebrew", "value": "hebrew" }, { "text": "Herero", "value": "herero" }, { "text": "Hiri Motu", "value": "hiri_motu" }, { "text": "Hungarian", "value": "hungarian" }, { "text": "Icelandic", "value": "icelandic" }, { "text": "Ido", "value": "ido" }, { "text": "Igbo", "value": "igbo" }, { "text": "Indigenous", "value": "indigenous" }, { "text": "Interlingua", "value": "interlingua" }, { "text": "Inuktitut", "value": "inuktitut" }, { "text": "Inupiaq", "value": "inupiaq" }, { "text": "Irish", "value": "irish" }, { "text": "Javanese", "value": "javanese" }, { "text": "Kalaallisut", "value": "kalaallisut" }, { "text": "Kannada", "value": "kannada" }, { "text": "Kanuri", "value": "kanuri" }, { "text": "Kashmiri", "value": "kashmiri" }, { "text": "Kazakh", "value": "kazakh" }, { "text": "Kikuyu", "value": "kikuyu" }, { "text": "Kinyarwanda", "value": "kinyarwanda" }, { "text": "Kirghiz", "value": "kirghiz" }, { "text": "Komi", "value": "komi" }, { "text": "Kongo", "value": "kongo" }, { "text": "Kuanyama", "value": "kuanyama" }, { "text": "Kurdish", "value": "kurdish" }, { "text": "Lao", "value": "lao" }, { "text": "Latin", "value": "latin" }, { "text": "Latvian", "value": "latvian" }, { "text": "Limburgan", "value": "limburgan" }, { "text": "Lingala", "value": "lingala" }, { "text": "Lithuanian", "value": "lithuanian" }, { "text": "Luba-Katanga", "value": "luba-katanga" }, { "text": "Luxembourgish", "value": "luxembourgish" }, { "text": "Macedonian", "value": "macedonian" }, { "text": "Malagasy", "value": "malagasy" }, { "text": "Malayalam", "value": "malayalam" }, { "text": "Maltese", "value": "maltese" }, { "text": "Manx", "value": "manx" }, { "text": "Maori", "value": "maori" }, { "text": "Marathi", "value": "marathi" }, { "text": "Marshallese", "value": "marshallese" }, { "text": "Moldavian", "value": "moldavian" }, { "text": "Mongolian", "value": "mongolian" }
161, { "text": "Nauru", "value": "nauru" }, { "text": "Navajo", "value": "navajo" }, { "text": "Ndonga", "value": "ndonga" }, { "text": "Nepali", "value": "nepali" }, { "text": "North Ndebele", "value": "north_ndebele" }, { "text": "Northern Sami", "value": "northern_sami" }, { "text": "Norwegian", "value": "norwegian" }, { "text": "Norwegian Bokmål", "value": "norwegian_bokmal" }, { "text": "Norwegian Nynorsk", "value": "norwegian_nynorsk" }, { "text": "Occidental", "value": "occidental" }, { "text": "Occitan", "value": "occitan" }, { "text": "Odia", "value": "odia" }, { "text": "Ojibwa", "value": "ojibwa" }, { "text": "Oromo", "value": "oromo" }, { "text": "Ossetian", "value": "ossetian" }, { "text": "Pali", "value": "pali" }, { "text": "Persian", "value": "persian" }, { "text": "Punjabi", "value": "punjabi" }, { "text": "Quechua", "value": "quechua" }, { "text": "Romanian", "value": "romanian" }, { "text": "Romansh", "value": "romansh" }, { "text": "Rundi", "value": "rundi" }, { "text": "Samoan", "value": "samoan" }, { "text": "Sango", "value": "sango" }, { "text": "Sanskrit", "value": "sanskrit" }, { "text": "Sardinian", "value": "sardinian" }, { "text": "Shona", "value": "shona" }, { "text": "Sichuan Yi", "value": "sichuan_yi" }, { "text": "Sindhi", "value": "sindhi" }, { "text": "Sinhala", "value": "sinhala" }, { "text": "Slovak", "value": "slovak" }, { "text": "Slovenian", "value": "slovenian" }, { "text": "Somali", "value": "somali" }, { "text": "South Ndebele", "value": "south_ndebele" }, { "text": "Southern Sotho", "value": "southern_sotho" }, { "text": "Sundanese", "value": "sundanese" }, { "text": "Swahili", "value": "swahili" }, { "text": "Swati", "value": "swati" }, { "text": "Swedish", "value": "swedish" }, { "text": "Tagalog (Filipino)", "value": "tagalog" }, { "text": "Tahitian", "value": "tahitian" }, { "text": "Tajik", "value": "tajik" }, { "text": "Tamil", "value": "tamil" }, { "text": "Tatar", "value": "tatar" }, { "text": "Tibetan", "value": "tibetan" }, { "text": "Tigrinya", "value": "tigrinya" }, { "text": "Tonga", "value": "tonga" }, { "text": "Tsonga", "value": "tsonga" }, { "text": "Tswana", "value": "tswana" }, { "text": "Turkmen", "value": "turkmen" }, { "text": "Twi", "value": "twi" }, { "text": "Uighur", "value": "uighur" }, { "text": "Uzbek", "value": "uzbek" }, { "text": "Venda", "value": "venda" }, { "text": "Volapük", "value": "volapuk" }, { "text": "Walloon", "value": "walloon" }, { "text": "Welsh", "value": "welsh" }, { "text": "Western Frisian", "value": "western_frisian" }, { "text": "Wolof", "value": "wolof" }, { "text": "Xhosa", "value": "xhosa" }, { "text": "Yiddish", "value": "yiddish" }, { "text": "Yoruba", "value": "yoruba" }, { "text": "Zhuang", "value": "zhuang" }, { "text": "Zulu", "value": "zulu" }],
162            selected: selected_langs,
163        },
164        aliasData: {
165            sources: [{ "english": "en", "russian": "ru", "german": "de", "spanish": "es", "dutch": "nl", "french": "fr", "italian": "it", "portuguese": "pt", "chinese": "zh", "polish": "pl", "ukrainian": "uk", "bulgarian": "bg", "greek": "el", "romanian": "ro", "moldavian": "mo", "turkish": "tr", "persian": "fa", "arabic": "ar", "japanese": "ja", "swedish": "sv", "hungarian": "hu", "serbian": "sr", "latin": "la", "croatian": "hr", "czech": "cs", "kazakh": "kk", "belarusian": "be", "indonesian": "id", "malaysian": "ms", "lithuanian": "lt", "catalan": "ca", "finnish": "fi", "azerbaijani": "az", "korean": "ko", "bengali": "bn", "esperanto": "eo", "hindi": "hi", "urdu": "ur", "danish": "da", "uzbek": "uz", "slovak": "sk", "norwegian": "no", "vietnamese": "vi", "indigenous": "Indig.", "bashkir": "ba", "marathi": "mr", "kirghiz": "ky", "tajik": "tg", "tatar": "tt", "albanian": "sq", "somali": "so", "icelandic": "is", "mongolian": "mn", "latvian": "lv", "georgian": "ka", "sanskrit": "sa", "hebrew": "he", "slovenian": "sl", "malayalam": "ml", "afrikaans": "af", "nepali": "ne", "sinhala": "si", "berber": "ber", "armenian": "hy", "crimean": "cri", "tamil": "ta", "odia": "or", "swahili": "sw", "gujarati": "gu", "telugu": "te", "kannada": "kn", "estonian": "et", "thai": "th", "chamorro": "ch", "galician": "gl", "abkhazian": "ab", "afar": "aa", "akan": "ak", "amharic": "am", "aragonese": "an", "assamese": "as", "avaric": "av", "avestan": "ae", "aymara": "ay", "bambara": "bm", "basque": "eu", "bislama": "bi", "bosnian": "bs", "breton": "br", "burmese": "my", "chechen": "ce", "chichewa": "ny", "church_slavic": "cu", "chuvash": "cv", "cornish": "kw", "corsican": "co", "cree": "cr", "divehi": "dv", "dzongkha": "dz", "ewe": "ee", "faroese": "fo", "fijian": "fj", "western_frisian": "fy", "fulah": "ff", "gaelic": "gd", "ganda": "lg", "kalaallisut": "kl", "guarani": "gn", "haitian": "ht", "hausa": "ha", "herero": "hz", "hiri_motu": "ho", "ido": "io", "igbo": "ig", "interlingua": "ia", "occidental": "ie", "inuktitut": "iu", "inupiaq": "ik", "irish": "ga", "javanese": "jv", "kanuri": "kr", "kashmiri": "ks", "central_khmer": "km", "kikuyu": "ki", "kinyarwanda": "rw", "komi": "kv", "kongo": "kg", "kuanyama": "kj", "kurdish": "ku", "lao": "lo", "limburgan": "li", "lingala": "ln", "luba-katanga": "lu", "luxembourgish": "lb", "macedonian": "mk", "malagasy": "mg", "maltese": "mt", "manx": "gv", "maori": "mi", "marshallese": "mh", "nauru": "na", "navajo": "nv", "north_ndebele": "nd", "south_ndebele": "nr", "ndonga": "ng", "norweg
165ian_bokmal": "nb", "norwegian_nynorsk": "nn", "sichuan_yi": "ii", "occitan": "oc", "ojibwa": "oj", "oromo": "om", "ossetian": "os", "pali": "pi", "pashto": "ps", "punjabi": "pa", "quechua": "qu", "romansh": "rm", "rundi": "rn", "northern_sami": "se", "samoan": "sm", "sango": "sg", "sardinian": "sc", "shona": "sn", "sindhi": "sd", "southern_sotho": "st", "sundanese": "su", "swati": "ss", "tagalog": "tl", "tahitian": "ty", "tibetan": "bo", "tigrinya": "ti", "tonga": "to", "tsonga": "ts", "tswana": "tn", "turkmen": "tk", "twi": "tw", "uighur": "ug", "venda": "ve", "volapuk": "vo", "walloon": "wa", "welsh": "cy", "wolof": "wo", "xhosa": "xh", "yiddish": "yi", "yoruba": "yo", "zhuang": "za", "zulu": "zu" }, 'text'],
166            pipe: [
167                String.prototype.toUpperCase,
168            ],
169        },
170    });
171
172    new ZLibraryMultiselect({
173        wrapSelector: '#wrapExt',
174        useTargetSelect: true,
175        type: 'multiple',
176        multipleCaptionsMode: 'enum',
177        valuesName: 'extensions',
178        placeholder: 'Select extensions',
179        textForNone: 'Any Extension',
180        rowData: {
181            "items": [{ "text": "TXT", "value": "TXT" }, { "text": "PDF", "value": "PDF" }, { "text": "FB2", "value": "FB2" }, { "text": "EPUB", "value": "EPUB" }, { "text": "LIT", "value": "LIT" }, { "text": "MOBI", "value": "MOBI" }, { "text": "RTF", "value": "RTF" }, { "text": "DJV", "value": "DJV" }, { "text": "DJVU", "value": "DJVU" }, { "text": "AZW", "value": "AZW" }, { "text": "AZW3", "value": "AZW3" }],
182            "selected": selected_extensions
183        },
184        actions: [{
185            value: 'kindle-ready',
186            text: 'Available for Kindle',
187            select: ['PDF', 'MOBI', 'EPUB', 'AZW', 'AZW3'],
188            disable: 'all',
189            selected: false,
190            isLocking: true,
191        }, ]
192    });
193
194    ZLibrarySearch.init();
195});
196
197$('document').ready(() => clearSearchButtonEvents('#searchFieldx', '#mainSearchReset'));
198
199$("#quickSearchMenuDD").on('shown.bs.dropdown', function(e) {
200    if (window.outerWidth > 768) {
201        $('#quickSearchInput').focus();
202    }
203});
204
205$("#bs-example-navbar-collapse-1").on('shown.bs.collapse', function(e) {
206    $('#main-menu-dropdown').dropdown('toggle');
207    $('#main-menu-dropdown').attr('data-toggle', ''); // make it static
208
209    $('#admin-menu-dropdown').dropdown('toggle');
210    $('#admin-menu-dropdown').attr('data-toggle', ''); // make it static
211
212    $("#quickSearchMenuDD2").dropdown('toggle');
213    $('#quickSearchMenuDD2').attr('data-toggle', ''); // make it static
214
215    $("#profileMenu").dropdown('toggle');
216    $('#profileMenu').attr('data-toggle', ''); // make it static
217});
218
219$("#bs-example-navbar-collapse-1").on('hide.bs.dropdown', function(e) {
220    if ($(window).width() > 767) return
221
222    $('#loginDDLink, #stagesLink, #admin-menu-dropdown').next('ul').hide();
223})
224
225$('document').ready(() => clearSearchButtonEvents('#quickSearchInput', '#quickSearchReset')); // быстрый поиск из шапки
226
227// Фикс вложенных дропдаунов в bootstrap
228$(document).ready(function() {
229    $('#loginDDLink, #stagesLink, #admin-menu-dropdown').on("click", function(e) {
230        if ($(window).width() > 767) return
231
232        $(this).next('ul').toggle();
233        $(this).parent('.dropdown').siblings('.dropdown.open').find('ul').toggle();
234        $(this).parent('.dropdown').siblings('.dropdown.open').toggleClass('open');
235        $(this).parent('.dropdown').toggleClass('open');
236        e.stopPropagation();
237        e.preventDefault();
238    });
239});
240
241$(document).on('click', '.btnShowMerchantPopup', function() {
242    const merchantModal = new ZLibraryModal({
243        element: 'merchantPopup',
244        container: 'zlibrary-modal-styled',
245    })
246    merchantModal.show()
247})
248
249$(document).on('click', '.btnCloseMerchantPopup', function() {
250    const merchantModal = new ZLibraryModal({
251        element: 'merchantPopup',
252        container: 'zlibrary-modal-styled',
253    })
254    merchantModal.hide()
255})
256
257$(document).on('click', '.btnHideAnnouncement', function() {
258    let cook = getCookie('hiddenMessages');
259    let hidden = cook ? JSON.parse(cook) : [];
260    let messageHash = $(this).data('message');
261
262    if (hidden.indexOf(messageHash) === -1) {
263        hidden.push($(this).data('message'))
264    }
265
266    setCookie('hiddenMessages', JSON.stringify(hidden), 31 * 24 * 60 * 60 * 1000)
267    $('#messageBlock').hide()
268});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.