Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Framework] Complete implementation info with badges (#216)
* [Framework] Complete implementation info with badges The code now renders more specific implementation information on screen using visual badges on top of browser icons. Badges are: - Feature available on desktop only / mobile only / desktop and mobile - Features requires using a prefix - Feature is behind a flag Essentially, there will always be a desktop/mobile badge and, most of the time, that badge will be the "desktop and mobile" one, because most recent features are developed on all platforms. A tooltip explains what the implementation info means, for instance: "Experimental in Chrome (mobile). Feature requires using a prefix. Source: Chrome Platform Status." That text also appears in a span element for accessibility readers. Clicking on the browser icon takes the reader to the right page on the Platform Status Web site where the implementation info comes from. Some changes made to the `extract-impl-data.js` script to make things possible: - The script now sets a `selected` flag on the implementation info that is considered to be the right one for each user agent. - The script also sets the URL to look at on the underlying Platform Status Web site to get additional info. - The script only runs the selection logic once (it incorrectly ran after each step) - The Chrome Platform Status platform was marked as authoritative for Chrome for Android (it was only considered as authoritative for Chrome for Desktop) The styles of the generated table have been slightly updated to set some minimum width to the implementation column (enough to render 5 browsers), and some maximum width to the feature column (to keep it short). Also created a `tr` function to translate strings instead of passing the translations object around. * [Framework] Write spec title and group name in same column To save some width in generated table for implementation info, and keep all of our tables consistent, the name of the group(s) responsible for a given spec or feature is (are) listed below the specification title in the same column. Styles used are similar to those in the new /TR/ page, the group name appearing in light grey below using a smaller font size. Links now use consistent styles throughout the roadmap, regardless of whether they appear in the body of the text or in generated tables. No underline in the tables in particular to improve readability. The update also removes and sanitizes a few styles that were defined twice in `theme.css` and `roadmap.css`. More work would be needed on that front, but we'll do that later on (for once, I'm not sure why we have two files). Updates to link styles meant the remaining `<strong><a>...</a></strong>` constructs rendered in bold again. I dropped the `<strong>` element everwhere. * [Framework] Implementation info filtering and new UAs - Add the following browsers to the list displayed in the implementations column: Baidu Browser, QQ Browser, Samsung Internet, UC Browser. - Split browsers between "main" (the four main codebases) and "secondary" (those based on one of the main codebases), and display main ones first. - Add a filtering menu to the implementation column that lets the user select which browsers she wants to see displayed. Choices are saved to session storage so that they are preserved when the user navigates between roadmap pages but reset between sessions. - The four main browsers are displayed by default. * [Framework] Translation logic for implementation filtering The implementation filtering mechanism now uses the JSON translation files to display the filtering menu label and the browser names. Code re-shuffled accordingly to put JavaScript functions common to the generation script and to the filtering script in the `utils.js` script and put JavaScript functions that are only useful for the generation script in a separate `generate-utils.js` script. Translation function also updated to fallback to English translations in all cases and record all missing translations in a global `warnings` array displayed when the page is generated at the end of the scripts' initialization to help with translations.
- Loading branch information