Commit Graph

2585 Commits

Author SHA1 Message Date
9063450b5a Fixed userlang control in the viewer
Now the viewer stores the userlang preference in window.localStorage.
2023-09-09 19:39:16 +04:00
f8c3a1fd2e Added default user language to viewer_settings.js
The default user language determined from the value of "Accept-Language"
header is communicated to the client via the /viewer_settings.js
endpoint.
2023-09-09 19:37:49 +04:00
b5b98e7a61 RIP userlang cookie
This commit drops the usage of the userlang cookie in the backend but
not in the frontend. UI language control should be broken at this point
and will be fixed in the next few commits.
2023-09-09 19:37:49 +04:00
e7e8275a31 Made the language selector button visible
After upgrading my OS to Ubuntu 22.04 the language selector button
didn't show up in the viewer taskbar. Investigation shows that the id
used in the CSS was applied to the wrong HTML element (the enclosing
<a> rather than <img>).
2023-09-09 19:37:49 +04:00
c6456cac42 Merge pull request #993 from kiwix/no_kinetic_package
Remove Ubuntu Kinetic from CI/CD (deprecated)
2023-08-24 17:15:22 +07:00
f0c0400485 Remove Ubuntu Kinetic from CI/CD (deprecated) 2023-08-24 11:15:19 +02:00
ccbeb154a5 Merge pull request #992 from kiwix/fix_rtd 2023-08-24 10:55:57 +02:00
0e8a2952d5 Always set html_theme in doc configuration.
Lat version of read the doc do not set a html_theme for us.
So we have to always set it.

See readthedocs/readthedocs.org#10638
2023-08-24 10:46:46 +02:00
fe5e6c451d Merge pull request #977 from kiwix/translatewiki
Localisation updates from https://translatewiki.net.
2023-08-18 10:37:54 +08:00
3966e8544b Localisation updates from https://translatewiki.net. 2023-08-17 13:10:24 +02:00
09476ededb Merge pull request #974 from kiwix/multipleCategories 2023-07-26 14:57:29 +02:00
d47c4fa72f Unit tests for OPDS filtering by category
Added tests for multiple category filtering for zims
Added new test: catalog_v2_entries_filtered_by_category for entry filtering by category.
2023-07-26 18:15:47 +05:30
c938101c70 Allow multiple category support
Created a generic function multipleQuery which takes:
1. string (representing a comma separated list)
2. param (the value to query on using Xapian).

Category and language query will use this function.
2023-07-26 18:15:45 +05:30
9c91fc7369 Merge pull request #967 from kiwix/opdsFilters 2023-07-26 14:00:06 +02:00
385931f229 Move getLanguageSelfName to tools.h
This is a general utility which other ports can get use of.
Added tests
2023-07-26 16:02:32 +05:30
8726de494c Tests for readLanguagesFromFeed and readCategoriesFromFeed
Added tests on a sample OPDS language and categories stream
2023-07-26 16:02:32 +05:30
94d6bef402 Introduce readCategoriesFromFeed()
Added a function to load categories stored in an OPDS stream
2023-07-26 16:02:32 +05:30
a28c2973e9 Introduce readLanguagesFromFeed()
Added a new function to read languages stored in an OPDS feed
2023-07-26 16:02:32 +05:30
7feb89c30e Add remaining include files to meson.build
These files were overlooked during a merge of another PR
2023-07-26 16:02:32 +05:30
903dcd46d6 Merge pull request #978 from kiwix/fix_missing_includes 2023-07-25 16:32:26 +02:00
1be5424711 Add missing include.
`uint64_t` type (used by `beautifyFileSize`) need to be declared.
2023-07-25 13:37:31 +02:00
de517330f6 Merge pull request #971 from kiwix/beautifyPublic
Make beautifyFileSize public
2023-07-21 19:10:26 +02:00
5c3a997de4 make beautifyFileSize public
This general function will be useful in other kiwix apps
2023-07-21 22:19:45 +05:30
cb74c9c7c7 Merge pull request #972 from kiwix/version_12.1.0 12.1.0 2023-07-20 16:01:30 +02:00
312cecf5f2 New version 12.1.0 2023-07-20 15:54:55 +02:00
a4d207a03a Merge pull request #964 from kiwix/translatewiki 2023-07-17 13:16:40 +02:00
7e36dd5ddb Localisation updates from https://translatewiki.net. 2023-07-17 13:08:18 +02:00
8ca809f8d9 Merge pull request #970 from kiwix/fix_macos_deps_name 2023-07-13 12:12:53 +02:00
fd22e34d58 Fix the name of the deps archive on macos. 2023-07-13 12:04:41 +02:00
3be1ddd8a9 Merge pull request #966 from kiwix/gungbe 2023-07-11 18:50:51 +02:00
e9d9d85427 Added Gungbe language code 2023-07-10 23:28:04 +04:00
9599a31d2f Merge pull request #963 from kiwix/quasiuriencoded_suggestion_links
Quasi-URI-encoded suggestion links
2023-07-10 14:36:46 +02:00
4d60b106a2 Quasi-URI-encoded suggestion links
Before this fix suggestion links were built out of fully URI-encoded
book name and article path components despite the fact that this measure
was taken against only a few dangerous symbols such as '#', '?', '"' and
'\'.  However, URI-encoding the slash symbols in the path has some
undesirable side-effects (see #958).

Henceforth only the problematic symbols are encoded in the article path
component. The book name is still fully URI-encoded since I don't see
any counter-arguments.
2023-07-01 17:52:11 +04:00
60cce602a3 Merge pull request #957 from kiwix/translatewiki
Localisation updates from https://translatewiki.net.
2023-07-01 15:12:42 +02:00
abb81e7798 Localisation updates from https://translatewiki.net. 2023-07-01 15:12:24 +02:00
1808857173 Merge pull request #954 from kiwix/search_remove_accent
Add a new test, showing accents is not properly handle in search endpoint.
2023-07-01 15:11:54 +02:00
556b94daae Fix server_search test.
The pattern (given as a query string) must be url decoded.
2023-06-30 12:04:42 +02:00
5f4dad60b9 Add a new test, showing accents is not properly handle in search endpoint. 2023-06-30 12:04:42 +02:00
820ffa8134 Merge pull request #962 from kiwix/fix_macos_build 2023-06-30 12:04:11 +02:00
f6f7214c99 Unlink and remove some linked python3 files
meson and ninja both depends on python3 which received an update.
This python3 update fails to install when linking.

This temp fix removes those files. Hopefully a future update will remove the need
for this hack
2023-06-30 11:26:55 +02:00
1f5a160d3d Merge pull request #961 from kiwix/issue950 2023-06-28 15:21:23 +02:00
f41007989b Fool-proof checking of book illustration presence
Now (in a library.xml flow) a book is considered to contain an
illustration only if both "faviconMimeType" and "favicon" attributes
are set to non-empty values.
2023-06-24 20:10:41 +04:00
f25d287afa Enhanced the test data to demonstrate issue#950
Presence of the "faviconMimeType" attribute in a book entry in library.xml
file is enough for libkiwix to assume that the book contains an illustration
(even if the "favicon" attribute is missing).
2023-06-24 20:03:54 +04:00
550fc2fcf9 Merge pull request #959 from kiwix/clickable_external_links4
Fixed external links in the viewer iframe (final version)
2023-06-21 17:32:02 +02:00
96fb65f560 Guaranteed activation of external link blocking
This is a quickfix for the problem observed with external link blocking
during certain history navigation actions (when the cached iframe content is
loaded/restored before the viewer setup is completed).

Since external link blocking doesn't depend on the translations (that
are asynchronously loaded during the viewer setup) it can be performed
unconditionally. However, the current dependence of `on_content_load()`
on viewer setup has to be addressed too.
2023-06-18 19:49:47 +04:00
93197f8175 Mostly fixed external links in the viewer iframe
Before this fix clicking an external link in the viewer iframe had no
effect (other than an error being reported in the browser dev tools
console) because the attempt to navigate the top browser context was
suppressed due to sandboxing - the click handling code changed the
target of the link but navigating to that target was blocked. Now the
click handler works as follows:

1. Changes the target of the link to the catch page only if the
   link is going to be opened in a new tab or window (in this case
   sandboxing restrictions do not apply).

2. Otherwise directly navigates the viewer window to external URL
   or the catch page.

An unhandled scenario is opening an external link in a new tab/window
via a middle click or context menu - such events cannot be intercepted
and therefore there is no way of blocking external links accessed in
the said way.
2023-06-18 19:41:10 +04:00
144945cfe0 Merge pull request #940 from kiwix/fix_for_issue912
PDF-friendly book home button in the viewer
2023-06-08 15:48:11 +02:00
c1ad65d515 PDF-friendly book home button in the viewer
In firefox, when PDF content is displayed in the viewer, changing the
viewer URL in the address bar had no effect. The most prominent
manifestation of this bug was the broken book home button but the same
issue was present even if the fragment component of the viewer URL was
edited manually. The bug was a result of

1. an optimization preventing any actions if the new content URL is the
   same as the old content URL (this was needed to break the infinite loop
   of mutual updates of the top-window and content window/iframe URLs when
   any one of them changes).

2. sandboxing of the iframe and inability to access the content URL in
   iframe because of cross-origin restrictions when the content is a PDF
   displayed by the builtin viewer.

Now that issue is fixed. A slight remaining defect is that the
addressbar URL is still not updated when a PDF file is loaded/displayed
in the viewer.
2023-06-08 17:32:50 +04:00
af2dfdccbc Merge pull request #956 from kiwix/no_bionic_package 2023-06-07 11:45:42 +02:00
f2072d87a0 [CI] Remove creation of package for bionic. 2023-06-07 11:26:55 +02:00