simon-git: puzzles (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Mon Oct 17 23:20:28 BST 2022


TL;DR:
  c90d64f js: Move most style settings from JavaScript to CSS
  49849e4 js: Move dialogue-box sizing and positioning from JavaScript to CSS
  3c3d8af js: Remove unnecessary setting of status bar size
  5c180cf js: When making a hidden element visible, just remove "display: none"

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-10-17 23:20:28

commit c90d64f2439cf4fc5ac07f0ace27100aad2b69be
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=c90d64f2439cf4fc5ac07f0ace27100aad2b69be;hp=1bab1d1d2ab472bb8fc7cddfce1d3c37e63a2ed5
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Oct 17 22:04:16 2022 +0100

    js: Move most style settings from JavaScript to CSS
    
    Some elements (generally those created by JavaScript) had their style
    parameters set directly by JavaScript.  Putting styles in CSS generally
    makes them easier to understand (and fiddle with), so I've done that.
    The only styles left in JavaScript are those that are calculated by
    JavaScript (like the status-bar size) and the random-seed permalink
    visibility because I wasn't quite sure how to handle it.

 emcclib.js     | 19 +++++--------------
 emccpre.js     | 24 ++++--------------------
 html/jspage.pl | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 64 insertions(+), 34 deletions(-)

commit 49849e40ec2560fc22cf2da2a5f9be10c90f42bc
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=49849e40ec2560fc22cf2da2a5f9be10c90f42bc;hp=c90d64f2439cf4fc5ac07f0ace27100aad2b69be
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Oct 17 22:34:54 2022 +0100

    js: Move dialogue-box sizing and positioning from JavaScript to CSS
    
    This has the advantage that if you resize the window while a dialogue
    box is active, the dialogue box adjusts itself accordingly.

 emccpre.js     | 3 ---
 html/jspage.pl | 3 +++
 2 files changed, 3 insertions(+), 3 deletions(-)

commit 3c3d8aff2229be103c340c9c2e235c33127556fe
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=3c3d8aff2229be103c340c9c2e235c33127556fe;hp=49849e40ec2560fc22cf2da2a5f9be10c90f42bc
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Oct 17 23:04:22 2022 +0100

    js: Remove unnecessary setting of status bar size
    
    An element with display: block will naturally adjust to fit the width of
    its container, so if that's what you want there's no need to set its
    width explicitly.

 emcclib.js | 6 ------
 1 file changed, 6 deletions(-)

commit 5c180cfa6fee3409d60d959adacc0701d16c0e26
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=5c180cfa6fee3409d60d959adacc0701d16c0e26;hp=3c3d8aff2229be103c340c9c2e235c33127556fe
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Mon Oct 17 23:11:48 2022 +0100

    js: When making a hidden element visible, just remove "display: none"
    
    This removes any assumption in the JavaScript code about precisely what
    "display" setting the element should have.
    
    This means that now the only places where the JavaScript manipulates
    elements' styles are to set the width of the puzzle container and to
    mark and unmark elements with "display: none".  These both seem like
    reasonable kinds of semantic markup that just happen to be expressed as
    styles.

 emcclib.js | 2 +-
 emccpre.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)



More information about the tartarus-commits mailing list