- Refactored language code handling to replace multiple comma-separated values with 'mul'.
- Single-language entries remain unchanged.
- created the helper function to get the lang tag
- ensured the consistent behaviour for js and nojs version for the kiwix library view
Chrome on Android doesn't support displaying PDF documents inline so an
attempt to load a PDF into the Kiwix viewer iframe fails in a way that
may be confusing to the users. In such situations it is better to offer
to the users to download the PDF file so that they can view it with a
dedicated application. Making the clicked PDF link to open in a new
tab/window achieves exactly that effect.
External links with target="_blank" attribute are opened in a new tab/window.
Also included metaKey (Command key under Mac) in the list of click
modifiers that make the link to be opened in a new tab.
Note however that no upper limit is set on the width of the
autocompleter box - it is possible, but I don't see how we could
come up with a good value for it.
- Changed the position of download button to the end of tile and
added a proper download icon to it. When the button is hovered it
becomes darker.
- Also internationalized the "Download" text on the modal download widget
and added download size information to it.
Zimit2 ZIMs employ Wombat for client-side rewriting of URLs. The latter
interferes with our approach of handling in the viewer CTRL/SHIFT-clicks
on links inside articles. This commit disables Wombat temporarily while
changing the href attribute of the clicked link.
Links that should be handled/opened by external applications - such as email
addresses (mailto:), phone numbers (tel:), etc - are opened by the
viewer in a new tab/window, thus avoiding any issues with content
security policy.
- Tags in the OPDS feed are HTML encoded and must be decoded.
- Tag values must be HTML encoded when injected into the DOM:
* When the injection is done by setting the innerHTML attribute of a
DOM element, HTML encoding must be done explicitly (since that text
is going to be parsed as HTML).
* When the tag value is expanded into a string that is then set as an
attribute of a DOM element via the setAttribute() method, no HTML
encoding must be done (since Element.setAttribute() directly sets
that value and no HTML decoding is involved in that operation).
Switched display of ZIM sizes from decimal (MB) to binary (MiB) units.
Also made the size value to be formatted in a more human friendly way
(fractional part is shown only to provide at least three significant
digits).
Now the search results page is presented by the backend in the language
controlled by the value of the `userlang` URL query parameter (or, if
the latter is missing, the value of the `Accept-Language:` HTTP header).
Note that the front-end doesn't yet take advantage of this
functionality.
Note that static/skin/languages.js must be generated/updated manually
by running the static/generate_i18n_resources_list.py script. Previously
it had to be done only when new languages were added. Now the
translation counts will also need to be updated when new entries are
added to static/skin/i18n/en.json or upon merging a few translatewiki PRs.
... so that extra info about the count of translated strings can be
added.
Note that due to increased size skin/languages.js lost its
too-small-to-be-worth-compressing status.