mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
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:
@ -18,6 +18,17 @@
|
||||
let timer;
|
||||
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() {
|
||||
let url = `${root}/catalog/search?`;
|
||||
url += Object.keys(incrementalLoadingParams).map(key => `${key}=${incrementalLoadingParams[key]}`).join("&");
|
||||
@ -363,6 +374,7 @@
|
||||
setCookie(filterCookieName, params.toString());
|
||||
}
|
||||
updateFilterColors();
|
||||
updateFeedLink();
|
||||
await loadAndDisplayBooks(true);
|
||||
}
|
||||
|
||||
@ -492,6 +504,7 @@
|
||||
langFilter.dispatchEvent(new Event('change'));
|
||||
}
|
||||
}
|
||||
updateFeedLink();
|
||||
setCookie(filterCookieName, params.toString());
|
||||
}
|
||||
})();
|
||||
|
Reference in New Issue
Block a user