This will allow the search suggestion to hook up to multiple search
boxes with `.citizen-search-box` as container. Do note that the default
Citizen suggestion is hardcoded for the primary search, so it only
works for the old core search suggestion module.
This is also a prereq for implementing the Codex search like the one
from Vector.
Sometimes the scripts start to run before DOM is fully ready. It causes things
like #475 where the checkbox is not in DOM yet but the script is already asking for it.
Refactor auto theme handling into inline script since theme.js is basically duplicated code
at this point. Also add the event listener whenever auto theme is set.
Closes: #461
Mostly based on Vector 2022. Now we target checkbox hacks by the HTML classes
.mw-checkbox-hack-TYPE instead of defining each individually, which would
make it more scalable.
Since somewhere around MW 1.37, buildSkinFeatures() no longer have access to OutputPage.
That causes $out->isTOCenabled always return null, which makes ToC
broken for any wikis since 1.37. This should fix the issue for now.
More optimizations on the loading behavior will come soon.
This is a part of the site header refactor
* Use relative units
* Add title to toggle button
* Remove unnessecary CSS
* Rewrite HTML classes
* Temporary remove drawer subsearch, it will be re-explored in a later patch
--background-color-dp-XX is now fully deprecated in favor of a simpler 4 color surface system. It can be accessed through the --color-surface-X CSS var.
* feat: rewrite search module (WIP)
There are some caveats because it is a WIP
- Messages are not i18n yet
- Missing placeholder suggestion thumbnail
- Only REST mode works
- Missing greeting message when there is no search query
- Code might look like a mess (I learned JS not long ago)
* refactor: remove old search module
* feat: clean up search suggestion styles
* feat: hide overflow for suggestion text
* feat: add action API and various cleanup
* feat: re-add abort controller
* feat: add message support and tweaks
* feat: use virtual config instead of ResourceLoader hook
* fix: missing comma in const definition
* feat: add ARIA attributes