Commit graph

56 commits

Author SHA1 Message Date
Thomas Petazzoni
64c9fa5248 Update training courses
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2026-05-06 11:03:49 +02:00
Thomas Petazzoni
7ee53451c1 static/messages.json: update training information
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2026-03-28 20:09:08 +01:00
Thomas Petazzoni
f1b2c52450 static/messages.json: update training course details
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-11-30 14:48:42 +01:00
Thomas Petazzoni
ac70a9e1b7 Update training sessions dates
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-11-19 15:16:23 +01:00
Thomas Petazzoni
89aef0d77b static/messages.json: update training dates, fix typo
Edit by Théo: remove desktop/mobile blocks using:
⟩ jq --indent 4 '[.[] | .desktop]' static/messages.json | sponge static/messages.json

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-10-23 23:26:02 +02:00
Théo Lebrun
05da14b295 static/messages.json: drop mobile object in each entry
Front-end code should handle both cases gracefully as
static/messages.json might be cached.

⟩ # Done using:
⟩ jq --indent 4 '[.[] | .desktop]' static/messages.json | sponge static/messages.json

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-07-25 12:26:16 +02:00
Franciszek Stachura
6a83ae7661 web: refactor message banners & support mobile
We had an hardcoded mobile banner that was nice looking but couldn't
deal with all the content for the various banners we want to display.

Also, it was a separate element to the desktop one. Unify them as a
single element that adapts (as it should) to desktop or mobile
viewports.
2025-07-25 12:26:04 +02:00
Thomas Petazzoni
7cdeaafa9c static/messages.json: update
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-07-25 12:25:40 +02:00
Thomas Petazzoni
3c41681075 static/messages.json: update
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-07-25 12:25:38 +02:00
Thomas Petazzoni
092d4496de static/messages.json: update
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-07-25 12:25:34 +02:00
Franciszek Stachura
2cf83f5f7b web: Add input reset button
I tried type="reset", but it reverts to initial value that is sometimes
set by the backend, instead of actually cleraing data.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/reset
2025-01-31 20:11:53 +01:00
Théo Lebrun
ad558b04c8 static: robots.txt: change Crawl-Delay from 1s to 2s
Recently crawlers have risen back up to high levels.
Let's ask them nicely to calm down.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-01-14 10:49:51 +01:00
Thomas Petazzoni
ede73902cd Update training course messages
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2025-01-14 10:43:00 +01:00
Théo Lebrun
7fbf9ec9e6 static: robots.txt: change Crawl-Delay from 5s to 1s
Crawl-Delay does have a big impact on the loadavg of the server,
meaning:
 - (1) most requests are from crawlers and,
 - (2) most crawlers listen to Crawl-Delay.

The prod server can handle the current loadavg just fine, let's let them
up their game.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-01-09 10:48:14 +01:00
Théo Lebrun
972fdd73e1 js: remove 301 redirect cache fix
This code was required because we messed-up in the past regarding
caching headers. This is not required anymore because the caching set
has expired, so no well behaving user-agent should have remains.

This represents something like 240k requests to the backend (not the
cache) over two weeks. Server load was minimal because generating those
responses is really fast.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2025-01-03 11:33:30 +01:00
Thomas Petazzoni
ec9d0b6538 Update with upcoming training courses
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-12-20 17:24:35 +01:00
Thomas Petazzoni
566da29ccd Adjust year of audio course
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-12-20 17:24:29 +01:00
Théo Lebrun
7be0bfec96 static/messages.json: fix different desktop/mobile link
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2024-12-04 11:47:30 +01:00
Théo Lebrun
b8f71f74f8 static/messages.json: fix invalid FIXME link
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2024-12-04 11:47:12 +01:00
Théo Lebrun
a3e6a10b7a static/messages.json: fix unicode typo 2024-12-04 11:46:58 +01:00
Thomas Petazzoni
452fb5d352 static/messages.json: update messages for training courses
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2024-12-04 11:34:30 +01:00
Franciszek Stachura
44965fcbfa banner: Add functions for testing banner contents
See: cycleBanner
2024-12-04 11:18:53 +01:00
Franciszek Stachura
018677d1c5 banner: Add static/messages.json file listing banner texts 2024-12-04 11:18:53 +01:00
Franciszek Stachura
701d609c2a banner, js: Add dynamic message banner 2024-12-04 11:08:06 +01:00
Théo Lebrun
f7ed4e84fd js: simplify line range anchor parsing
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2024-11-12 10:19:00 +01:00
James Raphael Tiovalen
f2146891c9 js: Highlight line of code when start == end
Enable code highlighting when there is only 1 selected line of code.

Signed-off-by: James Raphael Tiovalen <jamestiotio@gmail.com>
2024-11-12 10:18:17 +01:00
Franciszek Stachura
9a09df90e9 js: Update range highlight on manual hash change 2024-11-06 17:19:11 +01:00
Franciszek Stachura
54bd3bc0a4 js: Refactor line range handling
Important changes that should make reading the diff easier:
* Script now only works on line numbers. Elements are queried when
  necessary
* handleLineRange was refactored into functions that only validate and
  return line number(s), it's now the callers responsibility to
  highlight the range
2024-11-06 17:19:11 +01:00
Franciszek Stachura
558f75e3f5 web: Parse range state from URL
Fixes #329
2024-11-06 17:19:11 +01:00
Louis Chauvet
18376d3f7b web: Display documentation before other things
The current order for displaying references is:

- [definitions] prototype, label, typedef, variable, struct, member,
  function
- documentation
- references

This order is not very practical when you are searching for information
about a symbol, as you often want to know if the symbol is documented.

By inverting the order and displaying the documentation first, the user
experience may be improved for finding the documentation. This should not
significantly change the UX for definitions, as there are already many
definitions, and you already have to search for what you want.
2024-11-06 17:17:00 +01:00
Théo Lebrun
a776fff7ae static/style.css: update normalize.css from v7.0.0 to v8.0.1
Project homepage:
https://necolas.github.io/normalize.css/

Changelog:
https://github.com/necolas/normalize.css/blob/master/CHANGELOG.md

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2024-11-06 15:33:13 +01:00
Théo Lebrun
6356cdc3c7 static: embed all CSS files into /static/style.css
Avoid many tiny requests. The issue is that browsers have a limited
amount of concurrent requests they can make. We do 19 for
loading /linux/v6.11.6/source. Reduce that to 14.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2024-11-06 15:00:41 +01:00
Franciszek Stachura
4779965e0f Fix styles for latest version of Pygments
Pygments 2.12.0 slightly changed the order of HTML elements which
makes line numbers look weird with current CSS styles.

Quoting changelog:
> When linenos=table is used, the <table> itself is now wrapped
> with a <div class="highlight"> tag instead of placing it
> inside the <td class="code"> cell (#632.) With this change,
> the output matches the documented behavior.

https://pygments.org/docs/changelog/#version-2-12-0
Related issue: https://github.com/pygments/pygments/issues/632

This commit aims to fix this by further restricting CSS selectors
that selected everything under .highlight to only select source code
related elements - descendants of .code in the new layout.

This was also tested on Pygemnts 2.14.0, version currently packaged
for Debian Bookworm
https://packages.debian.org/bookworm/armel/python3-pygments
2024-11-05 23:20:51 +01:00
Franciszek Stachura
46254c4a90 web: Add error details for bug reports 2024-09-30 12:00:53 +02:00
Franciszek Stachura
5aca2d51e5 web: Improve error page
Add some useful links, including a link to a pre-filled bug report form
2024-09-30 12:00:53 +02:00
Théo Lebrun
e25b3d7c4b static: add /robots.txt
This is NOT being served by Elixir backend. The HTTP server in front
must serve it. Commit robots.txt to store the file somewhere.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2024-09-27 18:19:11 +02:00
Théo Lebrun
007248e61f web: static/img: commit favicon.ico
favicon.ico being served is not dependent on Elixir's configuration, but
on the front-facing server. Its config must be updated to serve the
favicon; this is why favicon.ico used to not be commited into the
repo.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2024-09-27 17:48:34 +02:00
Franciszek Stachura
e8f8a2e7b4 js: Switch to strict mode in script.js
The script should be compatible with strict mode, and strict mode
prevents some annoying bugs. The most important, it prevents assigning
to an undeclared variable.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
2024-09-26 13:05:00 +02:00
Franciszek Stachura
ef1b83ad75 js: Move minor fixes into functions
Move the following to new functions:
* anchor offset handler
* 301 fix
* autoscrolling prevention

Hookup onload handler with addEventListener.

About autoscrolling prevention:

I'm not sure if this is still relevant. I'm unable to trigger this
behavior. I think it could be related to a some kind of a Chrome bug.

https://forum.jquery.com/portal/en/community/topic/chrome-bug-or-how-do-i-prevent-a-form-field-to-scroll-the-container-when-focused
https://stackoverflow.com/questions/49318282/how-to-prevent-autoscroll-to-focused-input
2024-09-26 13:05:00 +02:00
Franciszek Stachura
2f7b56a4d8 js: Refactor go-to-top handler
href # doesn't work... probably because the wrapper
2024-09-26 13:05:00 +02:00
Franciszek Stachura
61ca8e19f2 js: Refactor sidebar hamburger button script
Move hamburger menu handlers to a new setup function, called from
onload.
2024-09-26 13:04:57 +02:00
Franciszek Stachura
e333b33364 js: Refactor versions tree expand/collapse script
Move versions tree handlers to a new setup function, called from
onload.
2024-09-26 12:48:34 +02:00
Franciszek Stachura
b9817c412b js: Refactor tags filter
Move tag filter setup into a new function, refactor related functions
to avoid global variables. Set up tags filter from onload handler.
2024-09-26 12:48:34 +02:00
Franciszek Stachura
f3d43c380b web: Fix sidebar state if page loaded as mobile
Fixes the following bug:

1. Make sure show-menu == true
2. Open page in mobile mode
3. Reisze to widescreen

Sidebar will be hidden until page is reloaded.
2024-09-20 15:24:59 +02:00
Franciszek Stachura
32141d8e96 web: Fix mobile sidebar close with backdrop click 2024-09-20 15:22:47 +02:00
Franciszek Stachura
c8d088834d web: Make mobile sidebar state separate
...from desktop sidebar state.

Fixes #331
2024-09-20 14:33:01 +02:00
Franciszek Stachura
9a27c7ae20 autocomplete: Submit form on item selection 2024-09-13 11:22:28 +02:00
Franciszek Stachura
b2c3ab73e9 web: Fix highlighting when second select is before first 2024-09-11 15:40:57 +02:00
Franciszek Stachura
30933fea6a web: Highlight whole lines of code 2024-09-11 11:48:27 +02:00
Franciszek Stachura
3b4bcd852a web: Add javascript based range links
Click line anchor and another line anchor holding shift to
make a link to a range.
2024-09-11 11:48:27 +02:00