mirror of https://github.com/kiwix/libkiwix.git
Add RSS Feed extension in head
This change adds a <link> element in the head node of welcome page. Browsers with extensions for RSS will show a sign to navigate to the feed. The link changes based on current set filters.
This commit is contained in:
parent
fa80be87be
commit
e3a211e41c
|
@ -18,6 +18,17 @@
|
||||||
let timer;
|
let timer;
|
||||||
let languages = {};
|
let languages = {};
|
||||||
|
|
||||||
|
function updateFeedLink() {
|
||||||
|
const inputParams = new URLSearchParams(window.location.search);
|
||||||
|
const filteredParams = new URLSearchParams();
|
||||||
|
for (const [key, value] of inputParams) {
|
||||||
|
if ( value != '' ) {
|
||||||
|
filteredParams.append(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.querySelector('#feed_link').href = `${root}/catalog/v2/entries?${filteredParams.toString()}`;
|
||||||
|
}
|
||||||
|
|
||||||
function queryUrlBuilder() {
|
function queryUrlBuilder() {
|
||||||
let url = `${root}/catalog/search?`;
|
let url = `${root}/catalog/search?`;
|
||||||
url += Object.keys(incrementalLoadingParams).map(key => `${key}=${incrementalLoadingParams[key]}`).join("&");
|
url += Object.keys(incrementalLoadingParams).map(key => `${key}=${incrementalLoadingParams[key]}`).join("&");
|
||||||
|
@ -363,6 +374,7 @@
|
||||||
setCookie(filterCookieName, params.toString());
|
setCookie(filterCookieName, params.toString());
|
||||||
}
|
}
|
||||||
updateFilterColors();
|
updateFilterColors();
|
||||||
|
updateFeedLink();
|
||||||
await loadAndDisplayBooks(true);
|
await loadAndDisplayBooks(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,6 +504,7 @@
|
||||||
langFilter.dispatchEvent(new Event('change'));
|
langFilter.dispatchEvent(new Event('change'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
updateFeedLink();
|
||||||
setCookie(filterCookieName, params.toString());
|
setCookie(filterCookieName, params.toString());
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -10,6 +10,13 @@
|
||||||
href="{{root}}/skin/index.css?KIWIXCACHEID"
|
href="{{root}}/skin/index.css?KIWIXCACHEID"
|
||||||
rel="Stylesheet"
|
rel="Stylesheet"
|
||||||
/>
|
/>
|
||||||
|
<link
|
||||||
|
rel="alternate"
|
||||||
|
type="application/atom+xml"
|
||||||
|
title="Library OPDS Feed"
|
||||||
|
id="feed_link"
|
||||||
|
href="{{root}}/catalog/v2/entries"
|
||||||
|
/>
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="{{root}}/skin/favicon/apple-touch-icon.png?KIWIXCACHEID">
|
<link rel="apple-touch-icon" sizes="180x180" href="{{root}}/skin/favicon/apple-touch-icon.png?KIWIXCACHEID">
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="{{root}}/skin/favicon/favicon-32x32.png?KIWIXCACHEID">
|
<link rel="icon" type="image/png" sizes="32x32" href="{{root}}/skin/favicon/favicon-32x32.png?KIWIXCACHEID">
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="{{root}}/skin/favicon/favicon-16x16.png?KIWIXCACHEID">
|
<link rel="icon" type="image/png" sizes="16x16" href="{{root}}/skin/favicon/favicon-16x16.png?KIWIXCACHEID">
|
||||||
|
|
|
@ -63,7 +63,7 @@ const ResourceCollection resources200Compressible{
|
||||||
{ DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.css" },
|
{ DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.css" },
|
||||||
{ STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=0f9ba34e" },
|
{ STATIC_CONTENT, "/ROOT%23%3F/skin/index.css?cacheid=0f9ba34e" },
|
||||||
{ DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.js" },
|
{ DYNAMIC_CONTENT, "/ROOT%23%3F/skin/index.js" },
|
||||||
{ STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=2f5a81ac" },
|
{ STATIC_CONTENT, "/ROOT%23%3F/skin/index.js?cacheid=3f19d670" },
|
||||||
{ DYNAMIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js" },
|
{ DYNAMIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js" },
|
||||||
{ STATIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js?cacheid=ecde2bb3" },
|
{ STATIC_CONTENT, "/ROOT%23%3F/skin/iso6391To3.js?cacheid=ecde2bb3" },
|
||||||
{ DYNAMIC_CONTENT, "/ROOT%23%3F/skin/isotope.pkgd.min.js" },
|
{ DYNAMIC_CONTENT, "/ROOT%23%3F/skin/isotope.pkgd.min.js" },
|
||||||
|
@ -280,7 +280,7 @@ R"EXPECTEDRESULT( href="/ROOT%23%3F/skin/index.css?cacheid=0f9ba34e"
|
||||||
src: url("/ROOT%23%3F/skin/fonts/Roboto.ttf?cacheid=84d10248") format("truetype");
|
src: url("/ROOT%23%3F/skin/fonts/Roboto.ttf?cacheid=84d10248") format("truetype");
|
||||||
<script src="/ROOT%23%3F/skin/isotope.pkgd.min.js?cacheid=2e48d392" defer></script>
|
<script src="/ROOT%23%3F/skin/isotope.pkgd.min.js?cacheid=2e48d392" defer></script>
|
||||||
<script src="/ROOT%23%3F/skin/iso6391To3.js?cacheid=ecde2bb3"></script>
|
<script src="/ROOT%23%3F/skin/iso6391To3.js?cacheid=ecde2bb3"></script>
|
||||||
<script type="text/javascript" src="/ROOT%23%3F/skin/index.js?cacheid=2f5a81ac" defer></script>
|
<script type="text/javascript" src="/ROOT%23%3F/skin/index.js?cacheid=3f19d670" defer></script>
|
||||||
)EXPECTEDRESULT"
|
)EXPECTEDRESULT"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue