simon-git: puzzles (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sat Nov 12 11:32:27 GMT 2022


TL;DR:
  60d2bf5 js: Convert menus to use semantically appropriate HTML elements
  27d41e7 js: Simplify menu CSS a little
  8f40128 js: Prettify menu HTML

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: main
Committer:      Ben Harris <bjh21 at bjh21.me.uk>
Date:           2022-11-12 11:32:27

commit 60d2bf5930d9fbac8860fa440fdf4f5e12c134b8
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=60d2bf5930d9fbac8860fa440fdf4f5e12c134b8;hp=22c4cad50e5583d668b87ad19adce377a67452a6
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Tue Oct 18 09:38:37 2022 +0100

    js: Convert menus to use semantically appropriate HTML elements
    
    Presets are now radio buttons with labels, and menu items that take
    actions are now buttons.  The <li> representing each menu item is now a
    thin wrapper around another element: a <label> for radio buttons, a
    <button> for other buttons, and a <div> for submenu headings.  All of
    the things that previously applied to the <li> now apply to that inner
    element instead.
    
    This means that presets can now use the standard "checked" attribute to
    indicate which one is selected, and buttons can be disabled using the
    standard "disabled" attribute.  It also means that we can query and set
    the state of all the presets at once through their RadioNodeList.
    
    I think this should also make the menus more accessible, and make it
    easier to make them keyboard-controllable.

 emcclib.js     | 39 +++++++++++---------------
 emccpre.js     | 16 +++++------
 html/jspage.pl | 88 ++++++++++++++++++++++++++++++++++++++--------------------
 3 files changed, 82 insertions(+), 61 deletions(-)

commit 27d41e7cf0f2c21550f495325230201ad0a1be7b
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=27d41e7cf0f2c21550f495325230201ad0a1be7b;hp=60d2bf5930d9fbac8860fa440fdf4f5e12c134b8
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Sat Nov 12 10:37:07 2022 +0000

    js: Simplify menu CSS a little
    
    Mostly removing redundant rules and simplifying selectors.

 html/jspage.pl | 53 +++++++++++++++++++++++------------------------------
 1 file changed, 23 insertions(+), 30 deletions(-)

commit 8f40128f0863b4bc34ed7e2f271374134b0336b9
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=8f40128f0863b4bc34ed7e2f271374134b0336b9;hp=27d41e7cf0f2c21550f495325230201ad0a1be7b
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Sat Nov 12 11:22:59 2022 +0000

    js: Prettify menu HTML
    
    Now that we're using flex layout, whitespace in the menu isn't scary and
    we can use it to make the HTML readable.
    
    Also finally remove the "afterseparator" class that's long obsolete.
    You can always use ".separator + *" as a selector instead.

 html/jspage.pl | 39 +++++++++++++++++++++++++--------------
 1 file changed, 25 insertions(+), 14 deletions(-)



More information about the tartarus-commits mailing list